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 | |
if (!empty($_SERVER['HTTP_CLIENT_IP'])) { | |
$ip = $_SERVER['HTTP_CLIENT_IP']; | |
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { | |
$ip = $_SERVER['HTTP_X_FORWARDED_FOR']; | |
} else { | |
$ip = $_SERVER['REMOTE_ADDR']; | |
} | |
if ($ip != 'my-ip') { |
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 'app/Mage.php'; | |
error_reporting(E_ALL | E_STRICT); | |
ini_set('display_errors', 1); | |
set_time_limit(0); | |
Mage::app('admin')->setUseSessionInUrl(false); |
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 | |
$magento_header = array("website","email","group_id","disable_auto_group_change","firstname","lastname","password_hash","billing_prefix","billing_firstname","billing_middlename","billing_lastname","billing_suffix","billing_street_full","billing_street1","billing_street2","billing_street3","billing_street4","billing_street5","billing_street6","billing_street7","billing_street8","billing_city","billing_region","billing_country","billing_postcode","billing_telephone","billing_company","billing_fax","shipping_prefix","shipping_firstname","shipping_middlename","shipping_lastname","shipping_suffix","shipping_street_full","shipping_street1","shipping_street2","shipping_street3","shipping_street4","shipping_street5","shipping_street6","shipping_street7","shipping_street8","shipping_city","shipping_region","shipping_country","shipping_postcode","shipping_telephone","shipping_company","shipping_fax","created_in","is_subscribed","group","prefix","middlename","suffix","taxvat"); | |
// Array | |
// ( | |
// [0] => login |
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
$params = array('complex_filter' => | |
array( | |
array('key' => 'increment_id', 'value' => array('key' => 'gt', 'value' => '100015225')) | |
) | |
); | |
// $result = $proxy->salesOrderList((object)array('sessionId' => $sessionId->result, 'filters' => array(array('increment_id' =>'100015226')))); | |
$result = $proxy->salesOrderList((object)array('sessionId' => $sessionId->result, 'filters' => $params)); |
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('app/Mage.php'); | |
$client = new Zend_XmlRpc_Client('----url----/api/xmlrpc/'); | |
// If somestuff requires api authentification, | |
// we should get session token | |
$session = $client->call('login', array('username', 'password')); | |
$res = $client->call('call', array($session, 'catalog_product.info', 'id')); |
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 | |
if(!in_array($_SERVER['REMOTE_ADDR'], array('212.92.214.170','74.97.45.98', '213.147.103.86'))){ | |
echo "Maintenance mode."; | |
exit; | |
} |
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 | |
$folders = array('app/code/local/', 'app/code/community/');//folders to parse | |
$configFiles = array(); | |
foreach ($folders as $folder){ | |
$files = glob($folder.'*/*/etc/config.xml');//get all config.xml files in the specified folder | |
$configFiles = array_merge($configFiles, $files);//merge with the rest of the config files | |
} | |
$rewrites = array();//list of all rewrites | |
foreach ($configFiles as $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
function returnInt(x){return parseInt(x, 0);};var a=document.getElementsByClassName('votes');var c=[];for(var i=0;i<a.length;i++){c[i]=a[i].getElementsByTagName('strong')[0].innerHTML};Math.max.apply(Math,c.map(returnInt)); |
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
// Some helpful snippets of code to use when debugging magento: | |
var_export(get_class_methods(get_class($classname))); | |
var_export(array_keys( $this->getData() )); //or | |
var_export(array_keys( $object->getData() )); | |
var_export($object->debug()); | |
// When using with Mage::log()... | |
Mage::log(var_export(get_class_methods(get_class($classname)), TRUE),NULL,'some_filename.log'); |
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
https://sublime.wbond.net/installation#st2 |
NewerOlder