Skip to content

Instantly share code, notes, and snippets.

View mzeis's full-sized avatar
🤓

Matthias Zeis mzeis

🤓
View GitHub Profile
@mzeis
mzeis / Standard.php
Created April 2, 2013 19:47
Debug module / controller / action routing in Magento CE 1.7.0.2. Save file as app/code/local/Mage/Core/Controller/Varien/Router/Standard.php
<?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
<?php
$input = new StringInput('cache:flush');
// ensure that n98-magerun doesn't stop after first command
$this->getApplication()->setAutoExit(false);
// without output
$this->getApplication()->run($input, new NullOutput());
--- a/app/code/core/Mage/Core/Model/App.php
+++ b/app/code/core/Mage/Core/Model/App.php
@@ -511,11 +511,7 @@ class Mage_Core_Model_App
if ($this->_currentStore == $store) {
$store = $this->getStore($store);
- if ($store->getWebsite()->getDefaultStore()->getId() == $store->getId()) {
- $this->getCookie()->delete(Mage_Core_Model_Store::COOKIE_NAME);
- } else {
- $this->getCookie()->set(Mage_Core_Model_Store::COOKIE_NAME, $this->_currentStore, true);
@mzeis
mzeis / README.md
Last active December 22, 2015 14:08
Performance test CE 1.7.0.2 vs. CE 2.0.0.0-dev45

Colins tweet made me curious so I also did a dumb test with CE 1.7.0.2 and CE 2.0.0.0-dev45.

Method

I kept it simple:

  1. Set up vanilla 1.7.0.2 install on a local VM.
  2. Create sample data using LimeSoda_SampleDataGenerator.
  3. Activate and flush caches.
  4. Call the homepage, one category and product page 5 times each. Take the arithmetic mean value and standard deviation of the loading time in Firebug.
@mzeis
mzeis / README.md
Created September 26, 2013 20:29
Shrink Magento by deactivating core modules. File list: - app/etc/modules/Zzz_Emzee.xml - README.md

I was just playing around with CE 1.8 and tested how many of the more important modules (catalog, checkout, sales, ...) you can deactivate without running into apparent problems. Turns out: pretty much all of them.

I'll put the list of my deactivated modules here just in case I want to move my blog from WordPress to Magento sometime. :P

This would be a healty base for general purpose websites. If you want you could disable even more modules.

<?xml version="1.0"?>
<config>
<modules>
<Emzee_Sorter>
<active>true</active>
<codePool>community</codePool>
<depends></depends>
</Emzee_Sorter>
</modules>
</config>
@mzeis
mzeis / README.md
Last active December 31, 2015 19:49
Reduces the memory usage in the checkout process when using Ebizmarkets_MageMonkey (will be included in future releases).

Open app/code/community/Ebizmarts/MageMonkey/Helper/Data.php and search for

$last_order = Mage::getResourceModel('sales/order_collection')
    ->addFieldToFilter('customer_email', $customer->getEmail())
    ->addFieldToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()))
    ->setOrder('created_at', 'desc')
    ->getFirstItem(); 

and replace it with

@mzeis
mzeis / debug-level-debug.md
Last active August 29, 2015 13:57
Debugging for Vagrant issue "Vagrant seems to hang during smb setup. #3139" (https://github.com/mitchellh/vagrant/issues/3139).

Input:

set VAGRANT_LOG=debug
vagrant up

Output:

 INFO synced_folders: Invoking synced folder prepare for: smb
 INFO interface: output: Preparing SMB shared folders...

INFO interface: output: ==> default: Preparing SMB shared folders...

@mzeis
mzeis / debug.log
Created March 18, 2014 08:45
Debug output for Vagrant bug report "Error "No mapping between account names and security IDs was done." when exporting SMB share".
INFO synced_folders: Invoking synced folder prepare for: smb
INFO interface: output: Preparing SMB shared folders...
INFO interface: output: ==> default: Preparing SMB shared folders...
==> default: Preparing SMB shared folders...
INFO interface: detail: You will be asked for the username and password to use for the SMB
folders shortly. Please use the proper username/password of your
Windows account.
INFO interface: detail: default: You will be asked for the username and password to use for the SMB
default: folders shortly. Please use the proper username/password of your
@mzeis
mzeis / console.log
Last active August 29, 2015 13:57
Console output "C:/Programme (x86)/Vagrant/embedded/gems/gems/net-ssh-2.7.0/lib/net/ssh/buffer.rb:284:in `block in write': incompatible character encodings: ASCII-8BIT and CP850 (Encoding::CompatibilityError)" in Vagrant 1.5.1.
D:\development\vagrant\puphpet>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'debian-wheezy72-x64-vbox43'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: puphpet_default_1395615581257_62562
==> default: Preparing SMB shared folders...
default: You will be asked for the username and password to use for the SMB
default: folders shortly. Please use the proper username/password of your
default: Windows account.
default: