Click Fraud Protection
PHP related blog, freelancer to hire!

Posts Tagged Symfony

How to access magento search results externally (Drupal, Joomla, Zend Framework, Symfony etc)

Blast Search Lucene module enables you to get superquick results delivered to external application Options are: 1) if applications are on the same server you can simply include Magento code and use module method:   $queryText = ‘stainless’; $storeId = 1; $mageFilename = ‘../path_to_your_magento_document_root/app/Mage.php’; require_once $mageFilename; umask(0); […]

Read more

Session time out in Symfony

Quick solution in symfony 1.0.xx all: .settings: timeout: 86400 Just be careful because if you set to false it will disable sessions

Read more

Symfony – Sorting elements in filters (foreign table)

Today i found nice and simple solution how to filter elements in dropdown when you specify filter for field which is forgeign key. Simple go and edit Peer class of table you want to have things sorted. class [YOURTABLE]Peer extends Base[YOURTABLE]Peer { public static function addSelectColumns(Criteria $criteria) […]

Read more

Logging page rendering time in Symfony 1.xx

Change your SF_APP/web/index.php file to be: $timer = sfTimerManager::getTimer(‘myTimer’); sfContext::getInstance()->getController()->dispatch(); $timer->addTime(); $elapsedTime = $timer->getElapsedTime(); $fullRealUri = str_replace( sfContext::getInstance()->getRequest()->getUriPrefix(), “”, sfContext::getInstance()->getRequest()->getUri()); file_put_contents(‘/tmp/time.log’,date(‘Y-m-d H:i:s’).”|$fullRealUri|$elapsedTime\n\r”,FILE_APPEND);

Read more

Symfony admin generator problem

When you change your schema.yml file, especially removing column which you used before for sorting you can have face problem with 500 internal server error. Why? If you look closer into cache directory with auto-generated files you can see: protected function addSortCriteria($c) { if ($sort_column = $this->getUser()->getAttribute(‘sort’, […]

Read more

sfMemcachePlugin limitations

I’m using quite hapilly sfMemcachePlugin, but recently i needed to store object which was around 2Mb, and problems started. I’ve spend couple minutes trying to figure out why app is not working, finally i Found that memcache doesn’t store stuff more than 1Mb. To solve that, I’ve […]

Read more