h - move left
j - move down
k - move up
l - move right
ctrl-b - page up
ctrl-f - page down
% - jump to matching brace
alias.co checkout | |
alias.ci commit | |
alias.rb rebase | |
alias.st status | |
alias.br branch | |
alias.submodule-pull-all submodule foreach git pull --all | |
alias.submodule-fetch-all submodule foreach git fetch --tags | |
alias.sup submodule update --init --recursive | |
alias.lol log --graph --decorate --pretty=oneline --abbrev-commit | |
alias.lola log --graph --decorate --pretty=oneline --abbrev-commit --all |
# Symfony 2 | |
alias sf='php app/console' | |
alias sf-vendors='php bin/vendors update' | |
alias sf-db='sf doctrine:database:drop --force && sf doctrine:database:create && sf doctrine:schema:update --force' | |
alias sf-fixtures='sf doctrine:fixtures:load' | |
alias sf-cc='rm -rf app/cache/* && rm -rf app/logs/* && sf cache:clear' | |
alias sf-assets='rm -rf web/bundles/* && sf assets:install --symlink web' | |
alias sf-acl='sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs && sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs' | |
# Widop Fixtures Bundle |
# Symfony aliases | |
## Cache | |
alias sf_cache_clear="php app/console cache:clear" # Clears the cache | |
alias sf_cache_warmup="php app/console cache:warmup" # Warms up an empty cache | |
## Doctrine | |
alias sf_doctrine_="php app/console doctrine:cache:clear-metadata" # Clears all metadata cache for a entity manager | |
alias sf_doctrine_="php app/console doctrine:cache:clear-query" # Clears all query cache for a entity manager | |
alias sf_doctrine_="php app/console doctrine:cache:clear-result" # Clears result cache for a entity manager | |
alias sf_doctrine_="php app/console doctrine:database:create" # Creates the configured databases |
<?php | |
require_once dirname(__DIR__).'/../../../../app/AppKernel.php'; | |
/** | |
* Test case class helpful with Entity tests requiring the database interaction. | |
* For regular entity tests it's better to extend standard \PHPUnit_Framework_TestCase instead. | |
*/ | |
abstract class KernelAwareTest extends \PHPUnit_Framework_TestCase | |
{ |
public function inMultiDimensionalArray($needle, $haystack, $strict = false) { | |
foreach ($haystack as $item) { | |
if (($strict ? $item === $needle : $item == $needle) || (\is_array($item) && $this->inMultidimensionalArray($needle, $item, $strict))) { | |
return true; | |
} | |
} | |
return false; | |
} |
<?php | |
namespace Demo\FormBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller ; | |
use Symfony\Component\HttpFoundation\Response; | |
use Symfony\Component\OptionsResolver\OptionsResolver; | |
use Symfony\Component\HttpKernel\Exception\HttpException; | |
/** |
/** | |
* Camelizes a string. | |
* | |
* @param string $id A string to camelize | |
* | |
* @return string The camelized string | |
*/ | |
public static function camelize($id) | |
{ | |
return strtr(ucwords(strtr($id, array('_' => ' ', '.' => '_ '))), array(' ' => '')); |
<?php | |
namespace RE\AssetBundle\Model; | |
use Knp\Bundle\GaufretteBundle\FilesystemMap; | |
use Doctrine\ORM\EntityManager; | |
use Symfony\Component\HttpFoundation\File\UploadedFile; | |
use Symfony\Component\EventDispatcher\EventDispatcher; | |
use Gaufrette\FileStream\Local; |