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
| ini_set('display_errors',1); | |
| error_reporting(E_ALL); |
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
| composer install --no-dev --prefer-dist --optimize-autoloader |
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_CONFIG="idekey=PHPSTORM" XDEBUG_SESSION_START="PHPSTORM" PHP_IDE_CONFIG="serverName=THE_SERVER_NAME_I_SET_IN_PHPSTORM" php public/index.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 Utils; | |
| /** | |
| * Class RandomStringGenerator | |
| * @package Utils | |
| * | |
| * Solution taken from here: | |
| * http://stackoverflow.com/a/13733588/1056679 |
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
| function random_text( $type = 'alnum', $length = 8 ) | |
| { | |
| switch ( $type ) { | |
| case 'alnum': | |
| $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
| break; | |
| case 'alpha': | |
| $pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
| break; | |
| case 'hexdec': |
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 | |
| $allowedIps = array('127.0.0.1'); | |
| $zray_disable = true; | |
| if (isset($_SERVER['REMOTE_ADDR']) && in_array($_SERVER['REMOTE_ADDR'], $allowedIps)) { | |
| $zray_disable = false; | |
| } | |
| if ($zray_disable == true) { | |
| if (function_exists('zray_disable')) { | |
| zray_disable(); |
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 | |
| /** | |
| * @backupGlobals disabled | |
| * @backupStaticAttributes disabled | |
| */ | |
| class ServiceTest extends \Codeception\TestCase\Test | |
| { | |
| use \Codeception\Specify; |
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 | |
| require_once __DIR__ . '/vendor/autoload.php'; | |
| $namespace = 'PutYourProjectNamespaceHere\\'; | |
| foreach (new RegexIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__ . '/src')), '/^.+\.php$/i', RecursiveRegexIterator::GET_MATCH) as $file) { | |
| require_once $file[0]; | |
| } |
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 | |
| trait CastsValueObjects | |
| { | |
| protected function castAttribute($key, $value) | |
| { | |
| $castToClass = $this->getValueObjectCastType($key); | |
| // no Value Object? simply pass this up to the parent | |
| if (!$castToClass) { | |
| return parent::castAttribute($key, $value); |
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
| class InvalidRowException extends \Exception | |
| { | |
| // One off error messages can use this method... | |
| public static function create(Row $row, $reason) | |
| { | |
| return new static("Row " . $row->getIndex() . " is invalid because: " . $reason); | |
| } | |
| // ...and predefined methods can use it internally. | |
| public static function blankLine(Row $row) |
OlderNewer