https://speakerdeck.com/jmikola/real-time-data-aggregation-with-mongodb
http://fr.slideshare.net/kriswallsmith/love-and-loss-a-symfony-security-play
| <?php | |
| namespace Acme\UserBundle\Entity; | |
| use Doctrine\ORM\EntityRepository; | |
| use Doctrine\ORM\Query\Expr; | |
| /** | |
| * UserRepository | |
| * |
| <?php | |
| namespace Acme\UserBundle\Entity; | |
| use Doctrine\ORM\EntityRepository; | |
| use Doctrine\ORM\Query\Expr; | |
| /** | |
| * UserRepository | |
| * |
| public function newInstance() | |
| { | |
| if ($this->_prototype === null) { | |
| if (PHP_VERSION_ID === 50429 || PHP_VERSION_ID === 50513 || PHP_VERSION_ID >= 50600) { | |
| $this->_prototype = $this->reflClass->newInstanceWithoutConstructor(); | |
| } else { | |
| $this->_prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name)); | |
| } | |
| } |
| $event['method'] = 'on'.preg_replace_callback(array( | |
| '/(?<=\b)[a-z]/i', | |
| '/[^a-z0-9]/i', | |
| ), function ($matches) { return strtoupper($matches[0]); }, $event['event']); | |
| $event['method'] = preg_replace('/[^a-z0-9]/i', '', $event['method']); |
| $event['method'] = 'on'.preg_replace(array( | |
| '/(?<=\b)[a-z]/ie', | |
| '/[^a-z0-9]/i' | |
| ), array('strtoupper("\\0")', ''), $event['event']); | |
| replace with | |
| $event['method'] = 'on'.preg_replace_callback(array( | |
| '/(?<=\b)[a-z]/i', |
| <VirtualHost *:80> | |
| ServerName craft.local | |
| ServerAlias www.craft.local | |
| DocumentRoot /home/jony/Projects/craft/web | |
| <Directory /home/jony/Projects/craft/web> | |
| Options -Indexes +FollowSymLinks +MultiViews | |
| AllowOverride All | |
| Order Allow,Deny | |
| Allow from All |
| error_reporting(-1); | |
| ini_set('display_errors', 'On'); |
#Introduction If you're a php developer on ubuntu, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with php. This is for a developer machine and not for a live environment!
I hope it helps you too!
fyi @mheiniger and me started with an installer here: https://github.com/mheiniger/webdev-setup
| <?php | |
| // Start timing | |
| $startTime = microtime( true ); | |
| // Perform the operation | |
| for ( $i=0; $i<10; $i++ ) { | |
| echo "<p>Hello, world!</p>"; | |
| } | |
| // Stop timing | |
| $endTime = microtime( true ); | |
| $elapsedTime = $endTime - $startTime; |