Skip to content

Instantly share code, notes, and snippets.

View iods's full-sized avatar

Rye Miller iods

View GitHub Profile
@pstuifzand
pstuifzand / fetch.php
Created April 7, 2015 06:02
Magento database collection speed tests
<?php
include_once('app/Mage.php');
Mage::app('default');
function makeWalker($collection, $modelName) {
///echo $collection->getSelect(). "\n";
return array($collection->getSelect()->query(), $modelName);
}

Magento Scaling Hypotheses

Magento’s checkout throughput can increase to at least 8 times its current capacity and up to 26 times more in ideal conditions.

  1. The current checkouts per hour limit for large, real-world Magento stores is 4,500
  2. This limit cannot effectively be increased with more and/or better hardware
  3. The improper type handling in Magento’s SQL code is the cause of the current limit
  4. If one SQL query is fixed, large Magento stores can scale to a new, real-world limit of 120,000 checkouts per hour
  5. For commodity hardware, this new limit might be 36,000 checkouts per hour
@peterjaap
peterjaap / magento-testing-scenarios.md
Last active October 17, 2022 10:16
Magento testing scenarios

Magento testing scenarios

For use after an upgrade to verify the correct working of Magento

SHIP IT

Frontend

General

  • Activate all logs on the server (PHP, MySQL, Magento, mail, etc)
  • Check meta tags in HTML
@Vinai
Vinai / bootstrap.php
Last active January 29, 2019 22:50
Simple Magento integration test PHPUnit bootstrap
<?php
/**
* Simple Magento integration test PHPUnit bootstrap
*/
chdir(__DIR__ . '/../..');
$mageFile = 'htdocs/app/Mage.php';
umask(0);
@hkdobrev
hkdobrev / class-order.php
Last active May 15, 2024 16:56
PHP convention for the order in a class.
<?php namespace Vendor\Library;
use Another\Vendor\Library\ClassName;
abstract class ClassName extends AnotherClass implements Countable, Serializable
{
const CONSTANTS = 'top';
use someTrait, anotherTrait {
anotherTrait::traitMethod insteadof someTrait;
@claudiu-marginean
claudiu-marginean / Magento-Snippets-Claudiu.md
Last active July 6, 2021 08:54
Magento Snippets - Claudiu

Magento Snippets

Code snippets from different sections of Magento that are very useful.

JS Translation in phtml files

<script>
//<![CDATA[
Translator.add(
    <?php echo Mage::helper('core')->jsonEncode(array(
@kran
kran / controller.js
Last active September 6, 2016 10:11
express.js controller demo , just for fun !
var Controller = function(route){
this.baseRoute = route;
};
Controller.prototype = {
actions: {},
filters: [],
baseRoute: '',
_beforeAction:function(){
var self = this;
return function(req, res, next){
@molotovbliss
molotovbliss / gist:2562551
Last active September 7, 2022 20:18 — forked from davidalexander/gist:1086455
Magento Snippets

Magento Snippets

Set all categories to is_anchor 1

Find attribute_id

SELECT * FROM eav_attribute where attribute_code = 'is_anchor'

Update all of them with anchor_id from above (usually is ID 51)

UPDATE `catalog_category_entity_int` set value = 1 where attribute_id = 51