This file contains hidden or 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
Array | |
( | |
[gallery] => Array | |
( | |
[1810] => Array | |
( | |
[path] => g/0000430/11.jpg | |
[orig_path] => /1/1/11.jpg | |
) |
This file contains hidden or 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 | |
ini_set('display_errors', 1); | |
ini_set('log_errors', 1); | |
error_reporting(E_ALL); | |
require 'app/Mage.php'; | |
Mage::app('admin', 'store'); | |
/* @var $customers Mage_Customer_Model_Resource_Customer_Collection */ | |
$customers = Mage::getResourceModel('customer/customer_collection'); | |
$customers->addAttributeToSelect('*'); | |
$customers->setPageSize((isset($argv[1]) && is_numeric($argv[1]))?$argv[1]:2000); |
This file contains hidden or 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 | |
$dbConfig = Mage::getConfig()->getNode('global/resources/report_database/connection'); | |
if (!$dbConfig) { | |
return; | |
} | |
/* @var $db Magento_Db_Adapter_Pdo_Mysql */ | |
$db = Mage::getSingleton('core/resource')->getConnection('core_read'); | |
$db->closeConnection(); | |
//update values | |
$dbConfig = $dbConfig->asArray(); |
This file contains hidden or 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
log4j.rootLogger = ALL, Console | |
log4j.appender.Console=org.apache.log4j.ConsoleAppender | |
log4j.appender.Console.layout=org.apache.log4j.PatternLayout | |
log4j.appender.Console.layout.conversionPattern=%m%n |
This file contains hidden or 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 | |
class Email { | |
//... | |
public function setAttachments(array $files) { | |
$this->attachment_list = array(); | |
foreach($files as $filename => $file) { | |
if (is_str($filename)) { | |
$this->addAttachment($file, $filename); | |
} else { |
This file contains hidden or 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
public function syncConfigProductAttributes(Mage_Catalog_Model_Product $product) | |
{ | |
if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) { | |
/* @var $productType Mage_Catalog_Model_Product_Type_Configurable */ | |
$productType = $product->getTypeInstance(true); | |
$syncAttributes = array('short_description', 'description'); | |
foreach ($productType->getUsedProductCollection($product) as $childProduct) { | |
//$childProduct->load($childProduct->getId()); | |
/* @var $childProduct Mage_Catalog_Model_Product */ | |
foreach ($syncAttributes as $attributeCode) { |
This file contains hidden or 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
#!/usr/bin/env php | |
<?php | |
require 'app/Mage.php'; | |
if (!Mage::isInstalled()) { | |
echo "Application is not installed yet, please complete install wizard first."; | |
exit(1); | |
} | |
$baseDir = getcwd(); | |
//not sure if this is necessary, ported over from cron.php script | |
$_SERVER['SCRIPT_NAME'] = $baseDir.'/index.php'; |
This file contains hidden or 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
#/usb/bin/php | |
<?php | |
//author rgranadino aug 22 2012 | |
//tested on a D-Link DIR-615 B2 v2.25 firmware. | |
//this is a php translation of: | |
// http://www.shulerent.com/2009/08/21/cracking-the-d-link-settings-file/ | |
$file = $argv[1]; | |
if (!is_readable($file)) { | |
echo "Cannot read file: $file\n"; |
This file contains hidden or 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
class Foo { | |
public $x = null; | |
} | |
$a = new Foo(); | |
$b = new Foo(); | |
$c = new Foo(); | |
$d = new Foo(); | |
$a->x = $c; |