This file contains hidden or 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 | |
/* | |
* Extended Doctrine Query class providing a few additional functions | |
* for wrapping your where clauses more efficiently | |
*/ | |
class Doctrine_Query_Extra extends Doctrine_Query | |
{ | |
public function addOrderBy($orderby, $values = null) | |
{ | |
if ($values !== null) |
This file contains hidden or 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 ruby | |
while line = STDIN.gets do | |
line.sub!(/\d,\"/) {|s| s.sub(',"', ' - ')} | |
line.sub!(/\d,/) {|s| s.sub(',', ' - ')} | |
line.gsub!('""', '"'); | |
line.sub!(/"$/, ''); | |
puts line | |
end |
This file contains hidden or 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
<div class="sf_admin_pagination"> | |
<?php $img = image_tag(sfConfig::get('sf_admin_module_web_dir').'/images/first.png', array('alt' => __('First page', array(), 'sf_admin'), 'title' => __('First page', array(), 'sf_admin'))) ?> | |
<?php echo link_to_current($img, array('page' => 1)) ?> | |
<?php $img = image_tag(sfConfig::get('sf_admin_module_web_dir').'/images/previous.png', array('alt' => __('Previous page', array(), 'sf_admin'), 'title' => __('Previous page', array(), 'sf_admin'))) ?> | |
<?php echo link_to_current($img, array('page' => $pager->getPreviousPage())) ?> | |
<?php foreach ($pager->getLinks() as $page): ?> | |
<?php if ($page == $pager->getPage()): ?> |
This file contains hidden or 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 | |
function link_to_current($title, $params = array(), $options = array()) | |
{ | |
$currentRoute = sfContext::getInstance()->getRouting()->getCurrentRouteName(); | |
$currentParams = sfContext::getInstance()->getRequest()->getParameterHolder()->getAll(); | |
unset($currentParams['module'], $currentParams['action']); | |
This file contains hidden or 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/php | |
<?php | |
if (!isset($argv) || !count($argv)) | |
{ | |
throw new Exception("Please provide path of crons to flush"); | |
} | |
foreach ($argv as $path) | |
{ |
This file contains hidden or 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
[email protected] | |
# run daily crons | |
5 1 * * 1 /path/to/project/cron.php --daily > /var/log/cron_prod.log | |
10 1 * * 1 /path/to/other-project/cron.php --daily > /var/log/cron_dev.log | |
# run weekly crons | |
0 0 * * * /path/to/project/cron.php --weekly > /var/log/cron_prod.log | |
5 0 * * * /path/to/other-project/cron.php --weekly > /var/log/cron_dev.log |
This file contains hidden or 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 sfAdminRouteCollection extends sfDoctrineRouteCollection | |
{ | |
protected function generateRoutes() | |
{ | |
parent::generateRoutes(); | |
if (!isset($this->options['with_export']) || $this->options['with_export']) | |
{ |
This file contains hidden or 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
public function getExportFilename() | |
{ | |
return "<?php echo isset($this->config['export']['filename']) ? $this->config['export']['filename'] : ucfirst($this->getModuleName()).'_Export' ?>_".date("Y-m-d_Hi"); | |
<?php unset($this->config['export']['filename']) ?> | |
} |
This file contains hidden or 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 sfFactory | |
{ | |
protected static | |
$lastRandom = array(), | |
$lastIncrement = array(); |
This file contains hidden or 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
# The first argument is the application (default: frontend) | |
export app=$1 | |
if [ ! -n "$app" ]; then | |
export app="frontend" | |
fi | |
# The second argument is the environment. (default: dev) | |
export env=$2 |