public function __construct() { parent::__construct(); // Time limit to infinity set_time_limit(0); Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); }
/** * @inheritdoc * * This is a bug fix for setting up "_includeMage" to false. In this case the Mage class will not included. * But in the parent constructor the factory class Mage_Core_Model_Factory gets initialized which occurs an * error without setup the auto loader. */ public function __construct() { require_once $this->_getRootPath() . 'app' . DIRECTORY_SEPARATOR . 'Mage.php'; parent::__construct(); //Display errors to show warnings and strict notices if the error level strict or notice is set ini_set('display_errors', 1); }
public function __construct() { parent::__construct(); $email = $this->getArg('customer-email'); $customerId = $this->getArg('customer-id'); if ($email) { $this->customer = Mage::getModel('customer/customer')->setWebsiteId($this->websiteId)->loadByEmail($email); } elseif ($customerId) { $this->customer = Mage::getModel('customer/customer')->load($customerId); } else { die($this->formatError('No customer specified.')); } if (!$this->customer || !$this->customer->getId()) { die($this->formatError('Customer Not Found!')); } $hasAction = false; foreach ($this->_args as $key => $value) { if (array_key_exists($key, $this->rulesMap)) { $this->rulesMap[$key] = true; $hasAction = true; } } if (!$hasAction) { die($this->formatError('No action specified.')); } }
public function __construct() { parent::__construct(); $this->username = $this->getArg('username'); $this->password = $this->getArg('password'); $this->devMode = $this->getArg('devmode'); }
public function __construct() { parent::__construct(); //Init Ultility Model $this->ultility = Mage::getModel('solrsearch/ultility'); $this->indexer = Mage::getResourceModel('solrsearch/indexer'); }
public function __construct() { try { $_COOKIE = array(); // prevent potential cookies present in browser $this->_parseArgs(); if (false !== $this->getArg('store')) { $this->_appCode = $this->getArg('store'); } parent::__construct(); if (Mage::app()->getStore()->isAdmin()) { Mage::throwException('You cannot use admin store'); } $this->_config = Mage::getConfig(); $this->_renderer = $this->_getOutputRenderer(); $this->_renderer->registerCallback($this, 'captureOutput'); if (false !== $this->getArg('count')) { $this->_count = max(1, $this->getArg('count')); } set_time_limit(0); } catch (Mage_Core_Model_Store_Exception $e) { exit(sprintf('Could not initialize store "%s"', $this->_appCode)); } catch (Exception $e) { exit($e->getMessage()); } }
public function __construct() { parent::__construct(); // unset time limit set_time_limit(0); if ($this->getArg('prepare')) { $this->_prepare = $this->getArg('prepare'); } if ($this->getArg('createmap')) { $this->_createMap = true; } if ($this->getArg('lang')) { $this->_lang = $this->getArg('lang'); } if ($this->getArg('store')) { $this->_storeId = $this->getArg('store'); } if ($this->getArg('oldcat')) { $this->_oldCategories = $this->getArg('oldcat'); } if ($this->getArg('newcat')) { $this->_newCategories = $this->getArg('newcat'); } if ($this->getArg('categoryidmap')) { if (!$this->_lang && !$this->_storeId) { echo "You have to specify language or StoreView id when using a category id map\n"; return false; } $this->_categoryIdMap = $this->parseCategoryIdMap($this->getArg('categoryidmap')); } }
public function __construct() { parent::__construct(); set_time_limit(0); $this->_precacheBaseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); $this->_precacheProductSuffix = Mage::helper('catalog/product')->getProductUrlSuffix(); $this->_precacheCategorySuffix = Mage::helper('catalog/category')->getCategoryUrlSuffix(); if ($this->getArg('stores')) { $this->_precacheStores = array_merge($this->_precacheStores, array_map('trim', explode(',', $this->getArg('stores')))); } if ($this->getArg('categories')) { $this->_precacheCategories = array_merge($this->_precacheCategories, array_map('trim', explode(',', $this->getArg('categories')))); } if ($this->getArg('catdepth') && intval($this->getArg('catdepth'))) { $this->_precacheMaxCategoryDepth = intval($this->getArg('catdepth')); } if ($this->getArg('prodtype') && in_array(strtolower($this->getArg('prodtype')), $this->_precacheProductTypes)) { $this->_precacheProductType = strtolower($this->getArg('prodtype')); if ($this->_precacheProductType == 'none') { $this->_precacheExcludeProducts = true; } } if ($this->getArg('pages') && intval($this->getArg('pages'))) { $this->_precacheCategoryPages = intval($this->getArg('pages')); } }
public function __construct() { parent::__construct(); if ($this->getArg('run-components')) { $this->_components = array_merge($this->_components, array_map('trim', explode(',', $this->getArg('run-components')))); } }
/** * Constructor */ public function __construct() { parent::__construct(); // this requires a bit of memory // so, lets set as 512M ini_set('memory_limit', '512M'); }
public function __construct() { parent::__construct(); $this->spending = $this->getArg('add-spending'); $email = $this->getArg('customer-email'); $customerId = $this->getArg('customer-id'); if ($email) { $this->customer = Mage::getModel('customer/customer')->setWebsiteId($this->websiteId)->loadByEmail($email); } elseif ($customerId) { $this->customer = Mage::getModel('customer/customer')->load($customerId); } if (($email || $customerId) && (!$this->customer || !$this->customer->getId())) { die($this->formatError('Customer Not Found!')); } $products = $this->getArg('products'); if ($products) { $products = explode(',', $products); foreach ($products as $productId) { $product = Mage::getModel('catalog/product')->load($productId); if (!$product->getId()) { $message = "No product was foudn with the following id: {$productId}"; die($this->formatError($message)); } $this->products[] = $product; } } else { $this->productsCount = $this->getArg('products-count'); if (!$this->productsCount) { $this->productsCount = rand($this->minimumNumberOfProducts, $this->maximumNumberOfProducts); } } }
/** * Initialize application and parse input parameters */ public function __construct() { $this->_timeStart = (double) microtime(true); $this->_memoryUsageStart = $this->getMemoryUsage(); parent::__construct(); $this->initLog(); $this->log->debug('== Script execution started =='); }
public function __construct() { parent::__construct(); Mage::setIsDeveloperMode(true); //always enable developer mode when run through the shell. if ($this->getArg('profiler') == '1') { Varien_Profiler::enable(); } }
public function __construct() { try { return parent::__construct(); } catch (Exception $e) { file_put_contents('php://stderr', "[ERROR] {$e->getMessage()}\n"); exit(1); } }
public function __construct() { parent::__construct(); if (version_compare(Mage::getVersion(), '1.4.1.0', '<')) { //TODO: investigate difference in autoloading behaviour //triggers error in Behat\Behat\Formatter\FormatterManager //if (class_exists($name)) { error_reporting(E_ALL ^ E_WARNING); } }
public function __construct() { parent::__construct(); $collection = Mage::getModel('aoe_scheduler/collection_crons'); $_defaultCronJobs = array(); foreach ($collection->getItems() as $item) { $data = $item->getData(); $this->_defaultCronJobs[$data['id']] = $data['model']; } }
public function __construct() { parent::__construct(); // Time limit to infinity set_time_limit(0); // Get command line argument named "argname" // Accepts multiple values (comma separated) if ($this->getArg('argname')) { $this->_argname = array_merge($this->_argname, array_map('trim', explode(',', $this->getArg('argname')))); } }
public function __construct() { parent::__construct(); set_time_limit(0); $this->_precacheBaseUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); $this->_precacheProductSuffix = Mage::helper('catalog/product')->getProductUrlSuffix(); $this->_precacheCategorySuffix = Mage::helper('catalog/category')->getCategoryUrlSuffix(); if ($this->getArg('stores')) { $this->_precacheStores = array_merge($this->_precacheStores, array_map('trim', explode(',', $this->getArg('stores')))); } if ($this->getArg('categories')) { $this->_precacheCategories = array_merge($this->_precacheCategories, array_map('trim', explode(',', $this->getArg('categories')))); } }
/** * constructor */ public function __construct() { parent::__construct(); // unset time limit set_time_limit(0); if ($this->getArg('productid')) { $this->_productId = $this->getArg('productid'); } if ($this->getArg('categoryid')) { $this->_categoryId = $this->getArg('categoryid'); } if ($this->getArg('store')) { $this->_storeId = $this->getArg('store'); } }
public function __construct() { parent::__construct(); $this->ultility = Mage::getModel('solrsearch/ultility'); $itemsPerCommitConfig = Mage::getStoreConfig('webmods_solrsearch/settings/items_per_commit', 0); if (intval($itemsPerCommitConfig) > 0) { $this->itemsPerCommit = $itemsPerCommitConfig; } $checkInstockConfig = Mage::getStoreConfig('webmods_solrsearch/settings/check_instock', 0); if (intval($checkInstockConfig) > 0) { $this->checkInStock = $checkInstockConfig; } $solr_server_url = Mage::getStoreConfig('webmods_solrsearch/settings/solr_server_url', 0); $this->solrServerUrl = $solr_server_url; }
/** * Simple constructor * * @return Smile_Shell_Mongoify */ public function __construct() { parent::__construct(); /** @var Smile_MongoCatalog_Model_Resource_Override_Catalog_Product $catalogResource */ if (Mage::helper('core')->isModuleEnabled("Smile_MongoCatalog")) { $this->_catalogResource = Mage::getResourceModel("catalog/product"); } else { // If module is not enable, instantiate raw object // This permits to manage some tests without enabling the module $this->_catalogResource = new Smile_MongoCatalog_Model_Resource_Override_Catalog_Product(); } /** @var MongoCollection $_catalogResourceCollection */ $this->_catalogResourceCollection = $this->_getDocumentCollection(); $this->_sqlAttributeCodes = $this->_catalogResource->getSqlAttributesCodes(); $this->_getCurrentStats(); }
public function __construct() { parent::__construct(); if (empty($this->_args)) { die($this->usageHelp()); } if ($this->getArg('add-all')) { $this->addAllRules(); } else { foreach ($this->_args as $key => $value) { if (array_key_exists($key, $this->rulesMap)) { $this->rulesMap[$key] = true; } } } }
public function __construct() { require_once $this->_getRootPath() . 'app' . DIRECTORY_SEPARATOR . 'Mage.php'; parent::__construct(); $localXML = $this->_getRootPath() . 'app' . DIRECTORY_SEPARATOR . 'etc' . DIRECTORY_SEPARATOR . 'local.xml'; $this->_configXml = simplexml_load_string(file_get_contents($localXML)); $this->_snapshotXml = $this->_getRootPath() . 'app' . DIRECTORY_SEPARATOR . 'etc' . DIRECTORY_SEPARATOR . 'snapshot.xml'; if (!file_exists($this->_snapshotXml)) { die("Your config file is missing. {$this->_snapshotXml}"); } $this->_snapshotXml = simplexml_load_string(file_get_contents($this->_snapshotXml)); $rootpath = $this->_getRootPath(); $this->_snapshot = $rootpath . 'snapshot'; # Create the snapshot directory if not exists if (!file_exists($this->_snapshot)) { mkdir($this->_snapshot); } }
public function __construct() { parent::__construct(); $this->firstname = $this->getArg('firstname'); $this->lastname = $this->getArg('lastname'); $this->email = $this->getArg('email'); $this->referral = $this->getArg('referral'); $this->mode = (int) $this->getArg('mode'); $password = $this->getArg('password'); if ($password) { $this->password = $password; } $websiteId = $this->getArg('website-id'); if ($websiteId) { $this->websiteId = $websiteId; } $storeId = $this->getArg('store-id'); if ($storeId) { $this->storeId = $storeId; } if (!$this->firstname) { die($this->formatError('No firstname provided')); } if (!$this->lastname) { die($this->formatError('No lastname provided')); } if (!$this->email) { die($this->formatError('No email provided')); } if (!$this->referral) { switch ($this->mode) { case 1: $this->referral = $this->loadRandomCustomer()->getEmail(); break; case 2: $this->referral = $this->loadRandomAffiliate()->getEmail(); break; } } }
public function __construct() { $this->path = __DIR__ . '/../../'; $this->io = new Varien_Io_File(); parent::__construct(); }
public function __construct() { parent::__construct(); // Time limit to infinity set_time_limit(0); }
public function __construct() { parent::__construct(); $this->_log = Praxigento_LoginAs_Model_Logger::getLogger(__CLASS__); $this->_fileNameCustomers = dirname($_SERVER['SCRIPT_NAME']) . '/data_customers.csv'; }