123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- <?php
- if (false === defined('HOA')) {
- define('HOA', true);
- }
- if (false === defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50400) {
- throw new Exception(
- 'Hoa needs at least PHP5.4 to work; you have ' . phpversion() . '.'
- );
- }
- require_once __DIR__ . DIRECTORY_SEPARATOR . 'Autoloader.php';
- require_once __DIR__ . DIRECTORY_SEPARATOR . 'Consistency.php';
- $define = function ($constantName, $constantValue, $case = false) {
- if (!defined($constantName)) {
- return define($constantName, $constantValue, $case);
- }
- return false;
- };
- $define('SUCCEED', true);
- $define('FAILED', false);
- $define('…', '__hoa_core_fill');
- $define('DS', DIRECTORY_SEPARATOR);
- $define('PS', PATH_SEPARATOR);
- $define('ROOT_SEPARATOR', ';');
- $define('RS', ROOT_SEPARATOR);
- $define('CRLF', "\r\n");
- $define('OS_WIN', defined('PHP_WINDOWS_VERSION_PLATFORM'));
- $define('S_64_BITS', PHP_INT_SIZE == 8);
- $define('S_32_BITS', !S_64_BITS);
- $define('PHP_INT_MIN', ~PHP_INT_MAX);
- $define('PHP_FLOAT_MIN', (float) PHP_INT_MIN);
- $define('PHP_FLOAT_MAX', (float) PHP_INT_MAX);
- $define('π', M_PI);
- $define('nil', null);
- $define('_public', 1);
- $define('_protected', 2);
- $define('_private', 4);
- $define('_static', 8);
- $define('_abstract', 16);
- $define('_pure', 32);
- $define('_final', 64);
- $define('_dynamic', ~_static);
- $define('_concrete', ~_abstract);
- $define('_overridable', ~_final);
- $define('WITH_COMPOSER', class_exists('Composer\Autoload\ClassLoader', false) ||
- ('cli' === PHP_SAPI &&
- file_exists(__DIR__ . DS . '..' . DS . '..' . DS . 'autoload.php')));
- if (!function_exists('xcallable')) {
- function xcallable($call, $able = '')
- {
- if ($call instanceof Hoa\Consistency\Xcallable) {
- return $call;
- }
- return new Hoa\Consistency\Xcallable($call, $able);
- }
- }
|