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 | |
| /** | |
| * Converts int bytes to a highest, rounded, multiplication that is IEC compliant. | |
| * | |
| * @link https://en.wikipedia.org/wiki/Binary_prefix | |
| * | |
| * @param int $size Number of bytes to convert | |
| * @param int $precision Rounding precision (defaults to 0) | |
| * @return string Highest rounded multiplication with IEC suffix | |
| */ |
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 | |
| // Determine ENV | |
| define('APPLICATION_ENV', getenv('APPLICATION_ENV') == 'development' || PHP_SAPI == 'cli' ? 'development' : 'production'); | |
| // Load the appropriate config file | |
| return | |
| APPLICATION_ENV == 'development' ? | |
| require __DIR__.'/application.development.config.php' : | |
| require __DIR__.'/application.production.config.php' | |
| ; |
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 | |
| namespace Guzzle\Service\Command\LocationVisitor\Response; | |
| use Guzzle\Http\Message\Response; | |
| use Guzzle\Service\Command\CommandInterface; | |
| use Guzzle\Service\Description\Parameter; | |
| class JsonPathVisitor extends JsonVisitor | |
| { | |
| public function visit( |
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 | |
| $xml = new \SimpleXMLElement('<xml> | |
| <node attr="bar">second</node> | |
| </xml>'); | |
| $array = json_decode(json_encode($xml), true); | |
| print_r($array); | |
| /* | |
| 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
| <?php | |
| /** | |
| * The only reliable way of determining if a child exists | |
| * in SimpleXMLElement is to use count(). All other methods | |
| * do not work reliably in global or local NS. | |
| * | |
| * NOTE: Error suppresion on @count() is used to suppress | |
| * "PHP Warning: count(): Node no longer exists" | |
| */ | |
| if(!class_exists('SimpleXMLElement')) die("Bonkers"); |
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 | |
| namespace Doctrine\ORM\Mapping; | |
| use Doctrine\ORM\Mapping\ClassMetadata; | |
| use Doctrine\DBAL\Platforms\AbstractPlatform; | |
| /** | |
| * A set of rules for determining the physical column, alias and table quotes | |
| */ | |
| class EagerQuoteStrategy implements QuoteStrategy |
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 | |
| abstract class AbstractCello | |
| { | |
| /** | |
| * @var EventManager | |
| */ | |
| protected $em; | |
| protected function triggerPre($methodName, $params) |
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 php | |
| <?php | |
| /** | |
| * PHP 5.4 Short Array Syntax Converter | |
| * | |
| * Command-line script to convert PHP's "array()" syntax to PHP 5.4's | |
| * short array syntax "[]" using PHP's built-in tokenizer. | |
| * | |
| * This script is free software; you can redistribute it and/or |
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 | |
| namespace Foo { | |
| class Bar { | |
| public function baz(){} | |
| } | |
| } | |
| namespace Jira { | |
| use Foo\Bar; |
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 | |
| namespace My\App; | |
| use Zend\Filter\FilterChain; | |
| use Zend\InputFilter\Factory; | |
| use Zend\ServiceManager\FactoryInterface; | |
| use Zend\ServiceManager\ServiceLocatorInterface; | |
| use Zend\Validator\ValidatorChain; | |
| /** |