TRUNCATE `log_customer`;
TRUNCATE `log_quote`;
TRUNCATE `log_summary`;
TRUNCATE `log_url`;
TRUNCATE `log_url_info`;
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
#!/bin/bash | |
LOG=var/log/del_unused_img.log | |
function search_db() { | |
COUNT=$(mysql -uYOURUSER -pYOURPASSWORD YOURDB --execute="SELECT count(*) FROM catalog_product_entity_media_gallery WHERE value = \"$1\"") | |
echo $(echo ${COUNT} | cut -d" " -f2) | |
} | |
echo "Start: "\n >> ${LOG} | |
echo $(date) >> ${LOG} |
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 | |
$backend = Mage::getResourceModel('catalog/product_attribute_backend_media'); | |
$attributeId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product', 'media_gallery'); | |
$container = new Varien_Object(array( | |
'attribute' => new Varien_Object(array('id' => $attributeId)) | |
)); | |
$product = new Varien_Object(array( | |
'id' => 519, |
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
<?xml version="1.0"?> | |
<!-- license --> | |
<config> | |
<global> | |
<!-- global config --> | |
</global> | |
<frontend> | |
<events> | |
<!-- disble logs --> | |
<controller_action_predispatch> |
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
http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/ |
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
# configs | |
/app/etc/local.xml | |
/errors/local.xml | |
/app/etc/use_cache.ser | |
# downloader | |
/downloader/.cache | |
/downloader/cache.cfg | |
/downloader/connect.cfg |
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 | |
/** | |
* äöüß und co | |
*/ | |
function cleanUpFilename($val){ | |
// whitespace durch Unterstrich ersetzen | |
$new = preg_replace('=(\s+)=', '_', $val); | |
// Liste aller Umlaute | |
$map = array( | |
'ä' => 'ae', |
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 | |
/** | |
* http://codeaid.net/php/calculate-script-execution-time-(php-class) | |
* Created by tripuls. | |
* User: m.schultheiss | |
* Date: 05.09.13 | |
* Time: 16:20 | |
*/ | |
class Timer |
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 from http://activecodeline.com/git-ignore-gitignore-file-for-magento-project | |
# tested with Magento 1.4.0.1 | |
# put it into magento install dir | |
app/code/community/Phoenix/ | |
app/code/core/ | |
app/design/adminhtml/default/default/ | |
app/design/frontend/base/ |