Например,
telnet 127.0.0.1 11211 // присоединяемся flush_all // чистим quit // разрываем соединение
Читать далее
telnet 127.0.0.1 11211 // присоединяемся flush_all // чистим quit // разрываем соединение
/** @var $productFlatIndexer Mage_Catalog_Model_Product_Flat_Indexer */ $productFlatIndexer = Mage::getModel('catalog/product_flat_indexer'); // модель для обновления значения атрибута во flat-таблице $storeId = 1; // необходимый store id /** @var $productCollection Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection */ $productCollection = Mage::getResourceModel('appstore_extension/product_collection'); /** @var $product AppStore_Extension_Model_Product */ foreach ($productCollection as $product) { $product->setDiscusCommentCount($newCommentValue); $product->getResource() ->saveAttribute($product, 'disqus_comment_count'); // Обновляем значение атрибута во flat-таблице стора $productFlatIndexer->updateAttribute('disqus_comment_count', $storeId, $product->getId()); }Вот и все. Стоит сказать, что Mage_Catalog_Model_Product_Flat_Indexer::updateAttribute() в цикле это не лучшее решение. Если логика приложения позволяет вынести вызов этого метода из цикла и обновить значение атрибута для пачки продуктов - смело делайте это.
sudo portsnap fetch update cd /usr/ports/ftp/pure-ftpd sudo make config install clean (убедитесь что включена опция "Support for TLS") sudo ee /usr/local/etc/pure-ftpd.conf sudo echo pureftpd_enable="YES" >> /etc/rc.conf (см. конфиг ниже) sudo /usr/local/etc/rc.d/pure-ftpd start rehash sudo pure-pw useradd LOGIN -u UID -g GID -d /home/igor/ftp -m (введите ваш LOGIN, UID и GID. UID можно найти в /etc/group, GID такой же как UID)
sudo mkdir -p /etc/ssl/private sudo openssl req -x509 -nodes -newkey rsa:1024 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem You should skip all questions pressing Enter or enter any appropriate values sudo chmod 600 /etc/ssl/private/*.pem sudo ee /usr/local/etc/pure-ftpd.conf Add "TLS 1" at the end of file and save sudo /usr/local/etc/rc.d/pure-ftpd restart
ChrootEveryone yes TrustedGID 1004 BrokenClientsCompatibility no MaxClientsNumber 20 Daemonize yes MaxClientsPerIP 8 VerboseLog no DisplayDotFiles yes AnonymousOnly no NoAnonymous yes SyslogFacility none # FortunesFile /usr/share/fortune/zippy DontResolve yes # MaxIdleTime 15 PureDB /usr/local/etc/pureftpd.pdb UnixAuthentication yes LimitRecursion 10000 8 AnonymousCanCreateDirs no MaxLoad 4 #AntiWarez yes Umask 133:022 MinUID 1000 ProhibitDotFilesWrite no ProhibitDotFilesRead no AnonymousCantUpload yes AltLog clf:/var/log/pureftpd.log #Quota 100000000:1200 MaxDiskUsage 95 CustomerProof yes NoTruncate yes IPV4Only yes
Названием добавленной табы является содержимое тегаsms_reply_tab navoq_magicsms/adminhtml_sms_tab_reply
$this->_redirect("*/navoq_magicsms/edit", array( 'id' => $sms->getId(), 'active_tab' => 'sms_reply_tab', ));
// Первый Foo() { } // Второй Foo() { }
Certain ECMAScript statements (empty statement, variable statement, expression statement, do-while statement, continue statement, break statement, return statement, and throw statement) must be terminated with semicolons. Such semicolons may always appear explicitly in the source text. For convenience, however, such semicolons may be omitted from the source text in certain situations. These situations are described by saying that semicolons are automatically inserted into the source code token stream in those situations.
function FooA() { return { x: 8 }; }; function FooB() { return { x: 8 }; }; function Bar() { console.log(FooA().x); console.log(FooB().x); }
$ svn --version svn, version 1.6.18 (r1303927) compiled Jun 15 2012, 19:07:58 Copyright (C) 2000-2009 CollabNet. Subversion is open source software, see http://subversion.apache.org/ This product includes software developed by CollabNet (http://www.Collab.Net/). The following repository access (RA) modules are available: * ra_neon : Module for accessing a repository via WebDAV protocol using Neon. - handles 'http' scheme - handles 'https' scheme * ra_svn : Module for accessing a repository using the svn network protocol. - handles 'svn' scheme * ra_local : Module for accessing a repository on local disk. - handles 'file' scheme
$collection->addAttributeToFilter('color', '24');не фильтрует коллекцию, это означает что в бекенде у данного атрибута не включен параметр "Used in product listing?". Как это ни странно, Magento добавляет атрибут в таблицу catalog_product_flat только если этот параметр включен. Если же он выключен, ни о какой фильтрации не может быть и речи. После включения "Used in product listing?" не забудьте сделать реиндекс.
/* @var $installer Navoq_TextMagic_Model_Resource_Setup */ $installer = $this; $installer->startSetup(); $installer->addAttribute('customer', 'navoq_textmagic_phone', array( 'label' => 'Phone', 'visible' => true, 'required' => false, 'type' => 'text', 'input' => 'text' )); /** @var $eavConfig Mage_Eav_Model_Config */ $eavConfig = Mage::getSingleton('eav/config'); /** @var $attribute Mage_Customer_Model_Attribute */ $attribute = $eavConfig->getAttribute('customer', 'navoq_textmagic_phone'); $attribute->addData(array( 'is_used_for_customer_segment' => true, 'used_in_forms' => array('customer_account_edit', 'adminhtml_customer'), 'is_user_defined' => true, 'backend_type' => 'varchar', 'is_system' => false, 'is_visible' => true, 'is_unique' => false, 'sort_order' => 250 ))->save(); $installer->endSetup();
define('MY_AUTO', 'KIA'); if (MY_AUTO == $_GET['auto']) { echo "it's my auto!"; }
define('MY_AUTO', 'KIA'); if ($_GET['auto'] = MY_AUTO) { echo "it's my auto!"; }
purge
... function showMenu() { echo '
PHP Fatal Error: Cannot redeclare showMenu() (previously declared in /home/test/index.phtml)
... if (!function_exist('showMenu')) { function showMenu() { echo '
/** * @runTestsInSeparateProcesses **/ class MyTest extends PHPUnit_Framework_TestCase { public function testTest1() { // ... } public function testTest2() { // ... } }
class MyTest extends PHPUnit_Framework_TestCase { public function testTest1() { // ... } /** * @runInSeparateProcess **/ public function testTest2() { // ... } }
#branches from currently checked out directory git checkout -b
git checkout -borigin/
git checkout --
git commit --amend
git add --edit
git revert HEAD^
# After changes have been made... git stash # Do some other stuff here, like switch branches, merge other changes, etc. #Re-apply the changes git stash pop
git push origin :
# Add a remote branch git remote add# For example: git remote add lightfaceOfficial git://github.com/darkwing/LightFace.git # Get changes from that branch git fetch
# Create a Tag git tag# Delete the tag git tag -d # Push Tags git push --tags
git blame
/** @var $installer Navoq_Backup_Model_Resource_Setup */ $installer = $this; /** @var $adapter Varien_Db_Adapter_Pdo_Mysql */ $adapter = $installer->getConnection(); // Add 'file_name' column $adapter->addColumn($installer->getTable('navoq_backup/file'), 'file_name', array( 'comment' => 'Name of file', 'nullable' => true, 'column_type' => Varien_Db_Ddl_Table::TYPE_VARCHAR, 'length' => 100 ));
/** @var $installer Navoq_Backup_Model_Resource_Setup */ $installer = $this; /** @var $adapter Varien_Db_Adapter_Pdo_Mysql */ $adapter = $installer->getConnection(); /** * Create table 'navoq_backup/backup_list' */ $table = $adapter->newTable($installer->getTable('navoq_backup/file')) ->addColumn('file_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, 100, array('nullable' => true), 'Name of file') ->setComment('Navoq Backup File List'); $adapter->createTable($table);
/** @var $installer Navoq_Backup_Model_Resource_Setup */ $installer = $this; /** @var $adapter Varien_Db_Adapter_Pdo_Mysql */ $adapter = $installer->getConnection(); // Add 'file_name' column $adapter->addColumn($installer->getTable('navoq_backup/backup_list'), 'file_name', array( 'comment' => 'Name of file', 'nullable' => true, 'column_type' => Varien_Db_Ddl_Table::TYPE_TEXT ));
/** @var $installer Navoq_Backup_Model_Resource_Setup */ $installer = $this; /** @var $adapter Varien_Db_Adapter_Pdo_Mysql */ $adapter = $installer->getConnection(); // Add 'file_name' column $adapter->addColumn($installer->getTable('navoq_backup/backup_list'), 'file_name', array( 'comment' => 'Name of file', 'nullable' => true, 'column_type' => Varien_Db_Ddl_Table::TYPE_TEXT, 'length' => 100 ));
$ git remote origin
$ git remote add new_repo http://git.site.com/project/new_repo
$ git remote origin new_repo
$ git fetch new_repo
$ git branch -r
.... VMOptions.i386 -Xms128m -Xmx512m -XX:MaxPermSize=250m -XX:ReservedCodeCacheSize=64m VMOptions.x86_64 -Xms128m -Xmx800m -XX:MaxPermSize=250m -XX:ReservedCodeCacheSize=64m -XX:+UseCompressedOops ...
/Applications/MAMP/bin/php5/bin/pear channel-update pear.php.net /Applications/MAMP/bin/php5/bin/pear upgrade pear
/Applications/MAMP/bin/php5/bin/pear channel-discover pear.phpunit.de /Applications/MAMP/bin/php5/bin/pear install phpunit/PHPUnit
mv /Applications/MAMP/bin/php5/bin/phpunit /usr/local/bin/phpunit
phpunit --version
PHPUnit 3.6.9 by Sebastian Bergmann
require_once('Zend/Loader.php'); Zend_Loader::registerAutoload(); if (!class_exists('MyTestClass')) { // class doesn't exist, but now the auto-loader will try and load it } if (!class_exists('MyOtherTestClass', false)) { // class doesn't exist, and the auto-loader will not be used }