This file contains 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
#! /usr/bin/env lnav -i | |
{ | |
"magento_log" : { | |
"title" : "Magento Log Format", | |
"description" : "Log format used in Magento 1.", | |
"url" : "https://gist.github.com/chrisvanderpoel/e19dcab8ce69bc9806a3", | |
"regex" : { | |
"basic" : { | |
"pattern" : "^(?<timestamp>[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}\\T[0-9]{2}\\:[0-9]{2}\\:[0-9]{2}\\+[0-9]{2}\\:[0-9]{2})\\s(?<level>\\w+)\\s(?<component>\\(\\w+\\))\\:\\s(?<body>.*)$" | |
} |
This file contains 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 | |
// https://stackoverflow.com/questions/18562684/how-to-get-database-field-type-in-laravel/18563159#18563159 | |
/* @var $schema \Doctrine\DBAL\Schema\AbstractSchemaManager */ | |
$schema = DB::getDoctrineSchemaManager(); | |
$columns = $schema->listTableColumns('cities'); | |
dd($columns); | |
/* |
This file contains 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 | |
/** | |
* This core over-ride is the result of a BUG in the Enterprise method of | |
* clearing it's PageCache. During the Mview reindexing process, a changelog | |
* of IDs is determined. This array contains entity IDs that have been updated | |
* since the last reindex and contains many duplicates. When passed to | |
* the PageCache methods to clear the cache, this array of IDs is not de-duped | |
* which can result in hundreds of thousands of needless queries when bulk | |
* updates are made. |
This file contains 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://magento.stackexchange.com/questions/43917/fastest-way-to-update-an-attribute-in-all-products | |
$product->setData('something', true); | |
$product->getResource()->saveAttribute($product, 'something'); | |
// OR | |
\Mage_Catalog_Model_Resource_Product_Action::updateAttributes |
This file contains 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 | |
// Notice this is NOT SAVING the setting... | |
Mage::app()->getStore()->setConfig(Mage_Catalog_Helper_Product_Flat::XML_PATH_USE_PRODUCT_FLAT, '0'); | |
// Build your collection here... |
This file contains 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 | |
// Check if an Mview index is up-to-date | |
$connection = Mage::getSingleton('core/resource')->getConnection('core_read'); | |
$sub = $connection->select()->from(['cl' => $table], ['version_id'])->order('version_id DESC')->limit(1); | |
$select = $connection->select() | |
->from(['m' => 'enterprise_mview_metadata'], ['version_id', 'latest_id' => $sub, 'status']) | |
->where('changelog_name = ?', $table) | |
->limit(1); | |
$status = $connection->fetchRow($select); |
This file contains 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
SELECT DISTINCT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME IN ( 'column' ) AND TABLE_SCHEMA='database_name'; |
This file contains 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 | |
class Layout extends \ArrayIterator | |
{ | |
} | |
class Block extends \ArrayIterator | |
{ | |
protected $_alias; |
This file contains 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 | |
public function getInnerIterator() | |
{ | |
return $this->_children; | |
} | |
public function current() | |
{ | |
return $this->getInnerIterator()->current(); | |
} |
This file contains 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 | |
public function getInnerIterator() | |
{ | |
return $this->_children; | |
} | |
public function current() | |
{ | |
return $this->getInnerIterator()->current(); | |
} |
NewerOlder