Skip to content

Instantly share code, notes, and snippets.

View adrian-green's full-sized avatar

Adrian Green adrian-green

View GitHub Profile
@pix2D
pix2D / config.php
Created April 29, 2012 20:04
ActiveCollab 3 + NGINX + PHP-FPM + SSL + /public as document root
<?php
/**
* activeCollab configuration file
*/
define('ROOT', '/home/example/public_html/activecollab');
define('ROOT_URL', 'https://example.com');
define('URL_BASE', ROOT_URL . '/');
define('ASSETS_URL', ROOT_URL . '/assets');
@herveguetin
herveguetin / magentoObserverArgs.php
Created August 10, 2012 09:24
Pass arguments to observer method using <args> node in Magento's observer design pattern
<?php
class Namespace_Module_Helper_Data extends Mage_Core_Helper_Abstract {
/**
* Retrieve args node of observer config
*
* @param Varien_Event_Observer $observer
* @return array $observerArgs
*/
public function getObserverArgs(Varien_Event_Observer $observer, $callingClass, $callingMethod) {
@harlesc
harlesc / PHP7 Magento 1.9 core patch.md
Last active April 9, 2017 20:31
Patch to get Magento 1.9 working with >= PHP 7.0.0 RC 6

Patch using method below or if you don't want to patch a core file, see this Magento extension that does the same thing but correctly overrides the core file:
https://github.com/MageMechanic/PhpSeven

# run in magento root directory

# one-liner to apply patch using wget
wget -qO- 'https://gist.githubusercontent.com/MageMechanic/66449504110fbbd96214/raw/php7_magento_1_9_core.patch' | patch -p0

# one-liner to apply patch using curl
@colinmollenhour
colinmollenhour / Update.php
Created August 16, 2016 20:58
Improve Magento Layout Cache Efficiency
<?php
/**
* This rewrite modifies the caching behavior so that the layout cache key references a SHA1
* hash of the layout XML instead of the XML itself to avoid duplication. The layout XML must
* still be generated once for each layout key, but it will not be saved if the identical
* contents already exist, saving considerable cache backend storage.
*/
class Template_Core_Model_Layout_Update extends Mage_Core_Model_Layout_Update
{
@petemcw
petemcw / magento_sql_snippets.md
Created July 21, 2011 19:41
Magento SQL Snippets

Magento SQL Snippets

Clear Temporary Data Tables

TRUNCATE `log_customer`;
TRUNCATE `log_quote`;
TRUNCATE `log_summary`;
TRUNCATE `log_url`;
TRUNCATE `log_url_info`;
@colinmollenhour
colinmollenhour / Config.php
Last active July 30, 2021 07:18
Mage_Core_Model_Config (Magento CE through 1.9 - fixes stampeding)
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
@colinmollenhour
colinmollenhour / cleanCache.php
Created May 17, 2012 00:50
Simplified cache cleaning script for production updates.
<?php
/**
* Set global/skip_process_modules_updates to '1' in app/etc/local.xml and
* then use this script to apply updates and refresh the config cache without
* causing a stampede on the config cache.
*
* @author Colin Mollenhour
*/
umask(0);
ini_set('memory_limit','512M');
@krisnoble
krisnoble / deploy.php
Last active April 25, 2023 15:52
A slightly modified version of Brandon Summers' script. For more information: http://simianstudios.com/blog/post/using-bitbucket-for-automated-deployment-of-multiple-repositories
<?php
date_default_timezone_set('Europe/London'); // Set this to your local timezone - http://www.php.net/manual/en/timezones.php
/**
* The root directory where the repos live.
*
* @var string
*/
$root_dir = '/your/root/dir/';
@hightemp
hightemp / gist:2387916
Created April 14, 2012 21:16 — forked from borriglione/gist:2237588
Magento Snippets

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex