Server is slowing down, and noticing that your Symfony project is consuming enormous amount of CPU? Try this tweak:
# factories.yml all: routing: class: sfPatternRouting param: cache: null
What it does: This config disables the …
Server is slowing down, and noticing that your Symfony project is consuming enormous amount of CPU? Try this tweak:
# factories.yml all: routing: class: sfPatternRouting param: cache: null
What it does: This config disables the …
sfConfig::get('sf_environment');
For the times you’ll need access to some of Symfony’s directories:
Symfony dir [php] // root directory structure 'sf_cache_dir_name' => 'cache', 'sf_log_dir_name' => 'log', 'sf_lib_dir_name' => 'lib', …
Sometimes while retrieving data, you might not need all the columns, especially on a large database query result set.
Symfony, or actually Propel (1.3) allows you to chose what columns to retrieve, and skip the hydrate process:
// Custom column, on large subset $c = new Criteria(); $c->clearSelectColumns(); $c->addSelectColumn(TitlePeer::ID); $c->addSelectColumn(TitlePeer::TITLE); $resTitleRS = TitlePeer::doSelectStmt($c); // Loop through result and create custom array while ($row = $resTitleRS->fetch(PDO::FETCH_ASSOC)) { $title_id = $row['ID']; $title_name = $row['TITLE']; $arrTitleDB[$title_id] = $title_name; }
Symfony has a build-in rsync command line, which makes it easy to rollout your code into production. You can define multiple connections, in case you have multiple servers, a load balancer, backups…
In project/config/properties.ini:
[symfony] …