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 | |
$suffixes = array(''); | |
// ... | |
foreach ($suffixes as $suffix) { | |
foreach ($dirs as $dir) { | |
if (is_file($file = $dir.DIRECTORY_SEPARATOR.$name.$suffix) && (defined('PHP_WINDOWS_VERSION_BUILD') || is_executable($file))) { | |
return $file; | |
} | |
} |
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 | |
public function find($name, $default = null, array $extraDirs = array()) | |
{ | |
if (ini_get('open_basedir')) { | |
// ... | |
} else { | |
$dirs = array_merge( | |
explode(PATH_SEPARATOR, getenv('PATH') ?: getenv('Path')), | |
$extraDirs |
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 | |
public function find($includeArgs = true) | |
{ | |
// ... | |
$dirs = array(PHP_BINDIR); | |
// ... | |
return $this->executableFinder->find('php', false, $dirs); |
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 | |
$transaction = Mage::getModel('core/resource_transaction'); | |
$transaction->addObject($model_a) | |
$transaction->addObject($model_b) | |
$transaction->save(); |
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 | |
{ | |
$proxy = new SoapClient('./api/v2_soap/?wsdl'); | |
$sessionId = $proxy->login('XXXXX', 'XXXXX'); | |
$result = $proxy->giftcardAccountCreate( | |
$sessionId, | |
array( |
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
<?xml version="1.0"?> | |
<!-- | |
http://magento.stackexchange.com/questions/4748/how-rendering-of-price-phtml-in-catalog-product-listing-page-is-happening | |
http://magento.stackexchange.com/questions/14124/overriding-price-phtml-template-using-addpriceblocktype-in-magento-ce-1-7-0-2 | |
--> | |
<layout> | |
<default> |
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 | |
/** | |
* Error reporting | |
*/ | |
error_reporting(E_ALL | E_STRICT); | |
/** | |
* Compilation includes configuration file | |
*/ | |
define('MAGENTO_ROOT', getcwd()); |
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 | |
public function getAllCategoryNames() | |
{ | |
$names = array(); | |
// Build out a category collection and add the name attribute to the select. | |
$model = Mage::getModel('catalog/category'); | |
$collection = $model->getCollection(); | |
$collection->addAttributeToSelect('name'); |
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 | |
$configurable = Mage::getModel('catalog/product_type_configurable')->setProduct($_product); | |
$collection = $configurable->getUsedProductCollection(); | |
$collection->addAttributeToSelect('*'); | |
$collection->addFilterByRequiredOptions(); | |
foreach ($collection as $product) { | |
print_r($product->debug()); | |
} |
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 | |
static public function register() | |
{ | |
spl_autoload_register(array(self::instance(), 'autoload')); | |
} | |
/** | |
* Load class source code | |
* | |
* @param string $class |