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
# original source: http://www.redmonkeygoo.com/labs/lab-1-magento-db-reset-scripts/ | |
#-- Magento 1.7.0.0 SQL Table Resets | |
#-- On initial install Magento has 335 tables | |
#SET FOREIGN_KEY_CHECKS=0; | |
#SET FOREIGN_KEY_CHECKS=1; | |
SET FOREIGN_KEY_CHECKS=0; |
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
# Locate malware storing credit card info in images, original source: | |
# http://blog.foregenix.com/magento-malware-alert-mage.jpg-malware-derivative | |
find . -type f -exec egrep -Hl "md5\(md5\(microtime\(\)\)\.rand\(\)\)|\@file_put_contents\([^,]+,'JPEG-1\.1'\.base64_encode\([^\)]+\),FILE_APPEND\)" {} \; |
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
<script type="text/javascript"> | |
var spConfig = new Product.Config(<?php echo $_jsonConfig ?>); | |
// auto select first selections (and remove Choose text...) | |
spConfig.setInitialState = function(dropdown_id) { | |
var dropdown = $(dropdown_id); | |
dropdown[0].remove(); | |
for(index = 0; index < dropdown.length; index++) { | |
if(dropdown[index].value != "") { |
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
/** | |
* Get Allowed Countries | |
*/ | |
protected function _getCountryOptions() { | |
$options = false; | |
$useCache = Mage::app()->useCache('config'); | |
if ($useCache) { | |
$cacheId = 'DIRECTORY_COUNTRY_SELECT_STORE_' . Mage::app()->getStore()->getCode(); | |
$cacheTags = array('config'); |
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 | |
/** | |
* POST data to a REST API via file_post_contents with HTTP user/password support | |
* Author: [email protected] | |
* | |
* @param $url string URL path to REST API HTTP server request | |
* @param $data array Values to POST along side request | |
* @param $debug boolean Display debug data at end of request/response | |
* @param $username string HTTP username | |
* @param $password string HTTP password |
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
ini_set('session.hash_function', 'sha512'); | |
ini_set('session.hash_bits_per_character', 6); | |
ini_set('session.entropy_file', '/dev/urandom'); | |
ini_set('session.entropy_length', 128); | |
# example sesion ID: K7ZvnlbRth5JbbJIRIDWdljiKHnP2fRrOVpCMxSbp9rO4OWzynraCon3O-Gfu9beuy2YGHEBpE14uvMzOfVvj3 |
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 | |
zend_debug::dump( | |
Mage::getSingleton('core/resource') | |
->getConnection('core_write') | |
->isTableExists(trim($this->getTable('namespace/module'),'`')) | |
); |
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 | |
// Define your data here: | |
$blockId = "customblock_id"; | |
$blockTitle = " CMS BLOCK TITLE "; | |
// Using <<<HTML allows for easy copy/pasta of HTML data | |
$content = <<<HTML | |
<a href="#">Test</a> | |
HTML; |
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 | |
$adminSession = Mage::getSingleton('admin/session'); | |
$adminSession->unsetAll(); | |
$adminSession->getCookie()->delete($adminSession->getSessionName()); |
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 | |
/** | |
* Add the parameter "reindexallrequired" to only index the indexers | |
* that are in need of processing to avoid doing full reindexes | |
* that disregard the state of the index as indexer.php does | |
* | |
* Usage: | |
* php shell/betterindexer.php reindexallrequired | |
* | |
* http://magento.stackexchange.com/a/62272/69 |