It's been 9 years since the release of PHP, but my muscle memory still wants a double beat (as opposed to tripple) when I type function definitions.
class Baz
{
function getSomething()
{
}
}
protected function _getProtectedPropertyFromObject($property, $object) | |
{ | |
$r = new ReflectionClass($object); | |
$p = $r->getProperty($property); | |
$p->setAccessible(true); | |
return $p->getValue($object); | |
} |
It's been 9 years since the release of PHP, but my muscle memory still wants a double beat (as opposed to tripple) when I type function definitions.
class Baz
{
function getSomething()
{
}
}
SET @DATABASE = 'prod'; | |
SELECT CONCAT(table_schema, '.', table_name), | |
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows, | |
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA, | |
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx, | |
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size, | |
ROUND(index_length / data_length, 2) idxfrac | |
FROM information_schema.TABLES | |
WHERE `information_schema`.TABLES.table_schema = @DATABASE |
<?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 |
#!/bin/bash | |
################################################################################ | |
# FUNCTIONS | |
################################################################################ | |
# 1. Check required system tools | |
_check_installed_tools() { | |
local missed="" |
<?php | |
/** | |
* @param double $cReal | |
* @param double $cImag | |
* @param int $maxIterations | |
* @return int | |
*/ | |
function mandelbrotIteration($cReal, $cImag, $maxIterations) | |
{ |
<?php | |
/** | |
* SupportDesk_FixAcl.php v1.1 | |
* SupportDesk (www.supportdesk.nu) | |
* 10/7/2015 | |
* | |
* NOTICE OF LICENSE | |
* | |
* This source file is subject to the Open Software License (OSL 3.0) | |
* It is available through the world-wide-web at this URL: |
After having many deadlocks due to a high order volumne I've applied the these fixes to the core. Some can be found in a Magento forum. Before the fixes we could only process 1 order every 5-10 secs. Updating to Magento 1.8 is currently not an option but in 1-2 months.
Mage_Sales_Model_Abstract::_afterSave
must be removed and replaced with afterCommitCallback
. This is important to move the grid update (of sales_flat_order_grid) out of the transaction.
Rewrite the method of the Mage_CatalogInventory_Model_Observer::reindexQuoteInventory()
to remove the price reindexing from the transaction. That index process will also be fired in event sales_model_service_quote_submit_success
.
<?php | |
require_once 'abstract.php'; | |
/** | |
* Generate a CSV of modules with admin routes that haven't implemented _isAllowed() | |
*/ | |
class Mpchadwick_Missing_Acl_Checker extends Mage_Shell_Abstract | |
{ | |
const MODULES_PATH = 'modules'; |
# Empty relevant tables | |
DELETE FROM sales_flat_creditmemo; | |
DELETE FROM sales_flat_invoice; | |
DELETE FROM sales_flat_order; | |
DELETE FROM sales_flat_quote; | |
DELETE FROM sales_flat_shipment; | |
DELETE FROM customer_entity; | |
# Reset increment_ids | |
# Beware of store_ids when using multiple stores |