xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
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 | |
use ArrayIterator; | |
/** | |
* Implements ArrayAccess, Countable, IteratorAggregate | |
*/ | |
trait ParameterBagTrait | |
{ | |
/** |
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 bash | |
if [ ! -d /usr/lib/selenium/ ]; then | |
sudo mkdir /usr/lib/selenium/ | |
fi | |
if [ ! -f /usr/lib/selenium/selenium-server-standalone-2.41.0.jar ]; then | |
sudo curl -o /usr/lib/selenium/selenium-server-standalone-2.41.0.jar http://selenium-release.storage.googleapis.com/2.41/selenium-server-standalone-2.41.0.jar | |
fi |
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
xdebug.profiler_enable = 1 | |
xdebug.profiler_output_dir = "/vagrant/cachegrind" | |
xdebug.profiler_output_name = "callgrind.out.%t.%p" |
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
#!/bin/sh | |
function install_vagrant_plugin { | |
if [[ -z $(vagrant plugin list | grep "$1") ]]; then | |
vagrant plugin install $1 | |
else | |
echo "Vagrant Plugin '$1' already installed...skipping." | |
fi | |
} |
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 benchmark($name, $iterations, Closure $function) | |
{ | |
echo "Starting Benchmark: {$name} (".number_format($iterations)." Iterations)\n"; | |
$start = microtime(true); | |
for ($i = 0; $i < $iterations; $i++) { | |
$function(); | |
} | |
$elapsed = microtime(true) - $start; |
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 | |
/** | |
* Checks the type of the given value against an array of valid types. | |
* | |
* If the value is a valid type, `true` is returned, if not, an | |
* InvalidArgumentException is thrown. | |
* | |
* // Throws: Invalid type: string, Expected type(s): array, ArrayAccess | |
* checktype('foo', ['array', 'ArrayAccess']); |
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 | |
/** | |
* Parses the given Entry into its constituent parts. | |
* @param mixed $entry The entry to parse | |
* @return array | |
* @throws \InvalidArgumentException | |
*/ | |
protected function parseEntry($entry) | |
{ | |
if (! is_array($entry) || $entry instanceof \ArrayAccess) { |
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 | |
/** | |
* Parses the given Entry into its constituent parts. | |
* @param mixed $entry The entry to parse | |
* @return array | |
* @throws \InvalidArgumentException | |
*/ | |
protected function parseEntry($entry) | |
{ | |
if (is_array($entry) || $entry instanceof \ArrayAccess) { |
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 DataCache | |
{ | |
protected $redis; | |
protected $ttl = 300; // Seconds | |
public function __construct($redis) | |
{ | |
$this->redis = $redis; |