This file contains 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 | |
/** | |
* PHPUnit style mocking: | |
*/ | |
class AbstractManagerBase extends \PHPUnit_Framework_TestCase | |
{ | |
protected function getEmMock() | |
{ | |
$emMock = $this->getMock('\Doctrine\ORM\EntityManager', | |
array('getRepository', 'getClassMetadata', 'persist', 'flush'), array(), '', false); |
This file contains 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 ProcessInfo { | |
/** @var array $processes */ | |
protected $processes = array(); | |
/** | |
* Find a processes | |
* |
This file contains 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
/** | |
* Convert string such as '500mb' to bytes. Converts KB, MB, GB, TB, PB) The strings | |
* are case insensitive (mb=MB=m=M, k=K=kb=KB=Kb=kB) | |
* | |
* Usage: | |
* $bytes = convertToBytes("512kb"); | |
* | |
* @param string $from | |
* | |
* @return bool|integer |
This file contains 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 | |
/** | |
* Curl get contents instead of file_get_contents. | |
* | |
* @param string The URL to grab contents of | |
* @param array Post data to send to the url, empty if not desired | |
* @param mixed Bool false if no desired verbose output, string of filename to write to if verbose output desired | |
* @param mixed False if referer not desired, string if you wish to set a referrer url | |
* @param mixed False if no cookie desired, string to set the cookie filepath |
This file contains 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 | |
/** | |
* colorize | |
* Description: Provides a function that may be used to style the output of a console application. | |
* | |
* Examples: | |
* colorize("Something bolded in cyan on red background", 'bold', 'on_red', 'cyan') | |
* You may use multiple styles together: | |
* colorize("Something bolded underlines and blinking.", 'bold', 'underline', 'blink') |