This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'abstract.php'; | |
class Mage_Shell_CheckImages extends Mage_Shell_Abstract | |
{ | |
const CATALOG_PRODUCT = '/catalog/product'; | |
const CACHE = '/cache/'; | |
protected function _glob_recursive($pattern, $flags = 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// app/etc/env.php | |
return [ | |
// ... | |
'system' => [ | |
'default' => [ | |
'admin' => [ | |
'security' => [ | |
'session_lifetime' => 31536000, | |
'password_reset_protection_type' => 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$originalCollection = Mage::getModel('catalog/product') | |
->getCollection(); | |
$newCollection = Mage::getModel('catalog/product') | |
->getCollection(); | |
$selectParts = array( | |
Varien_Db_Select::DISTINCT, | |
Varien_Db_Select::COLUMNS, | |
Varien_Db_Select::UNION, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Prevent this script to be called via HTTP | |
if (isset($_SERVER['REQUEST_METHOD'])) | |
{ | |
die('Permission denied.'); | |
} | |
// Avoid any time limit | |
set_time_limit(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Prevent this script to be called via HTTP | |
if (isset($_SERVER['REQUEST_METHOD'])) | |
{ | |
die('Permission denied.'); | |
} | |
// Avoid any time limit | |
set_time_limit(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
try { | |
require __DIR__ . '/app/bootstrap.php'; | |
} catch (\Exception $e) { | |
echo $e->getMessage() . PHP_EOL; | |
exit(1); | |
} | |
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER); | |
/** @var \Magento\Framework\App\Http $app */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** @var Mage_Eav_Model_Entity_Setup $installer */ | |
$installer = $this; | |
$installer->startSetup(); | |
$this->addAttribute( | |
'catalog_category', | |
'my_custom_attribute', | |
array( | |
'group' => 'General Information', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function help { | |
echo "Arguments:" | |
echo " package name" | |
echo " package description" | |
} | |
dir=$(pwd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mage::getConfig()->saveConfig(Bitbull_Multiwarehouse_Helper_Data::XML_PATH_GENERAL_ACTIVE, 1); | |
Mage::getConfig()->cleanCache(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$product = new Varien_Object(); | |
$product->setId(363004); | |
$attribute = Mage::getSingleton('catalog/product')->getResource()->getAttribute('media_gallery'); | |
$media = Mage::getResourceSingleton('catalog/product_attribute_backend_media'); | |
$gallery = $media->loadGallery($product, new Varien_Object(array('attribute' => $attribute))); |
NewerOlder