@@ -22,11 +22,21 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | |
| 24 | 24 | // Define the absolute paths for configured directories |
| 25 | -if ( ! defined('APP_PATH')) define('APP_PATH', realpath($paths['path.app']).DIRECTORY_SEPARATOR); |
|
| 26 | -if ( ! defined('BST_PATH')) define('BST_PATH', realpath($paths['path.bootstrap']).DIRECTORY_SEPARATOR); |
|
| 27 | -if ( ! defined('CON_PATH')) define('CON_PATH', realpath($paths['path.config']).DIRECTORY_SEPARATOR); |
|
| 28 | -if ( ! defined('RES_PATH')) define('RES_PATH', realpath($paths['path.resources']).DIRECTORY_SEPARATOR); |
|
| 29 | -if ( ! defined('SYS_PATH')) define('SYS_PATH', realpath($paths['path.sys']).DIRECTORY_SEPARATOR); |
|
| 25 | +if ( ! defined('APP_PATH')) { |
|
| 26 | + define('APP_PATH', realpath($paths['path.app']).DIRECTORY_SEPARATOR); |
|
| 27 | +} |
|
| 28 | +if ( ! defined('BST_PATH')) { |
|
| 29 | + define('BST_PATH', realpath($paths['path.bootstrap']).DIRECTORY_SEPARATOR); |
|
| 30 | +} |
|
| 31 | +if ( ! defined('CON_PATH')) { |
|
| 32 | + define('CON_PATH', realpath($paths['path.config']).DIRECTORY_SEPARATOR); |
|
| 33 | +} |
|
| 34 | +if ( ! defined('RES_PATH')) { |
|
| 35 | + define('RES_PATH', realpath($paths['path.resources']).DIRECTORY_SEPARATOR); |
|
| 36 | +} |
|
| 37 | +if ( ! defined('SYS_PATH')) { |
|
| 38 | + define('SYS_PATH', realpath($paths['path.sys']).DIRECTORY_SEPARATOR); |
|
| 39 | +} |
|
| 30 | 40 | |
| 31 | 41 | // Call the file constants |
| 32 | 42 | require CON_PATH.'constants.php'; |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | public function processColumnListing($results) |
| 43 | 43 | { |
| 44 | - return array_map(function ($result) { |
|
| 44 | + return array_map(function($result) { |
|
| 45 | 45 | return ((object) $result)->column_name; |
| 46 | 46 | }, $results); |
| 47 | 47 | } |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | public function processColumnListing($results) |
| 43 | 43 | { |
| 44 | - return array_map(function ($result) { |
|
| 44 | + return array_map(function($result) { |
|
| 45 | 45 | return ((object) $result)->column_name; |
| 46 | 46 | }, $results); |
| 47 | 47 | } |
@@ -32,126 +32,126 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | class AutoloadConfig |
| 34 | 34 | { |
| 35 | - /** |
|
| 36 | - * Map of class names and locations. |
|
| 37 | - * |
|
| 38 | - * @var array $classmap |
|
| 39 | - */ |
|
| 40 | - public $classmap = []; |
|
| 35 | + /** |
|
| 36 | + * Map of class names and locations. |
|
| 37 | + * |
|
| 38 | + * @var array $classmap |
|
| 39 | + */ |
|
| 40 | + public $classmap = []; |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * If true, then auto-enabled will happen across all namespaces |
|
| 44 | - * loaded by Composer, as well as the namespaces configured locally. |
|
| 45 | - * |
|
| 46 | - * @var bool $enabledInComposer |
|
| 47 | - */ |
|
| 48 | - public $enabledInComposer = true; |
|
| 42 | + /** |
|
| 43 | + * If true, then auto-enabled will happen across all namespaces |
|
| 44 | + * loaded by Composer, as well as the namespaces configured locally. |
|
| 45 | + * |
|
| 46 | + * @var bool $enabledInComposer |
|
| 47 | + */ |
|
| 48 | + public $enabledInComposer = true; |
|
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * Array of files for autoloading. |
|
| 52 | - * |
|
| 53 | - * @var array $includeFiles |
|
| 54 | - */ |
|
| 55 | - public $includeFiles = []; |
|
| 50 | + /** |
|
| 51 | + * Array of files for autoloading. |
|
| 52 | + * |
|
| 53 | + * @var array $includeFiles |
|
| 54 | + */ |
|
| 55 | + public $includeFiles = []; |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * Array of namespaces for autoloading. |
|
| 59 | - * |
|
| 60 | - * @var array $psr4 |
|
| 61 | - */ |
|
| 62 | - public $psr4 = []; |
|
| 57 | + /** |
|
| 58 | + * Array of namespaces for autoloading. |
|
| 59 | + * |
|
| 60 | + * @var array $psr4 |
|
| 61 | + */ |
|
| 62 | + public $psr4 = []; |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * Constructor. |
|
| 66 | - */ |
|
| 67 | - public function __construct() |
|
| 68 | - { |
|
| 69 | - /** |
|
| 70 | - * --------------------------------------------------------------------- |
|
| 71 | - * Namespaces |
|
| 72 | - * --------------------------------------------------------------------- |
|
| 73 | - * |
|
| 74 | - * This maps the locations of any namespaces in your application to |
|
| 75 | - * their location on the file system. These are used by the Autoloader |
|
| 76 | - * to locate files the first time they have been instantiated. |
|
| 77 | - * |
|
| 78 | - */ |
|
| 79 | - $this->psr4 = require SYS_PATH.'src'.DIRECTORY_SEPARATOR.'register'.DIRECTORY_SEPARATOR.'autoloadPsr4.php'; |
|
| 64 | + /** |
|
| 65 | + * Constructor. |
|
| 66 | + */ |
|
| 67 | + public function __construct() |
|
| 68 | + { |
|
| 69 | + /** |
|
| 70 | + * --------------------------------------------------------------------- |
|
| 71 | + * Namespaces |
|
| 72 | + * --------------------------------------------------------------------- |
|
| 73 | + * |
|
| 74 | + * This maps the locations of any namespaces in your application to |
|
| 75 | + * their location on the file system. These are used by the Autoloader |
|
| 76 | + * to locate files the first time they have been instantiated. |
|
| 77 | + * |
|
| 78 | + */ |
|
| 79 | + $this->psr4 = require SYS_PATH.'src'.DIRECTORY_SEPARATOR.'register'.DIRECTORY_SEPARATOR.'autoloadPsr4.php'; |
|
| 80 | 80 | |
| 81 | - /** |
|
| 82 | - * --------------------------------------------------------------------- |
|
| 83 | - * Class Map |
|
| 84 | - * --------------------------------------------------------------------- |
|
| 85 | - * |
|
| 86 | - * The class map provides a map of class names and their exact location |
|
| 87 | - * on the drive. |
|
| 88 | - * |
|
| 89 | - */ |
|
| 90 | - $this->classmap = require SYS_PATH.'src'.DIRECTORY_SEPARATOR.'register'.DIRECTORY_SEPARATOR.'autoloadClassmap.php'; |
|
| 81 | + /** |
|
| 82 | + * --------------------------------------------------------------------- |
|
| 83 | + * Class Map |
|
| 84 | + * --------------------------------------------------------------------- |
|
| 85 | + * |
|
| 86 | + * The class map provides a map of class names and their exact location |
|
| 87 | + * on the drive. |
|
| 88 | + * |
|
| 89 | + */ |
|
| 90 | + $this->classmap = require SYS_PATH.'src'.DIRECTORY_SEPARATOR.'register'.DIRECTORY_SEPARATOR.'autoloadClassmap.php'; |
|
| 91 | 91 | |
| 92 | - /** |
|
| 93 | - * --------------------------------------------------------------------- |
|
| 94 | - * Include Files |
|
| 95 | - * --------------------------------------------------------------------- |
|
| 96 | - * |
|
| 97 | - * This maps the locations of any files in your application to |
|
| 98 | - * their location on the file system. |
|
| 99 | - * |
|
| 100 | - */ |
|
| 101 | - $this->includeFiles = require SYS_PATH.'src'.DIRECTORY_SEPARATOR.'register'.DIRECTORY_SEPARATOR.'autoloadFiles.php'; |
|
| 102 | - } |
|
| 92 | + /** |
|
| 93 | + * --------------------------------------------------------------------- |
|
| 94 | + * Include Files |
|
| 95 | + * --------------------------------------------------------------------- |
|
| 96 | + * |
|
| 97 | + * This maps the locations of any files in your application to |
|
| 98 | + * their location on the file system. |
|
| 99 | + * |
|
| 100 | + */ |
|
| 101 | + $this->includeFiles = require SYS_PATH.'src'.DIRECTORY_SEPARATOR.'register'.DIRECTORY_SEPARATOR.'autoloadFiles.php'; |
|
| 102 | + } |
|
| 103 | 103 | |
| 104 | - /** |
|
| 105 | - * Get the classes to filename map. |
|
| 106 | - * |
|
| 107 | - * @param array $classmap |
|
| 108 | - * |
|
| 109 | - * @return void |
|
| 110 | - */ |
|
| 111 | - public function addClassMap(array $classmap) |
|
| 112 | - { |
|
| 113 | - if (isset($this->classmap)) { |
|
| 114 | - $this->classmap = array_merge($this->classmap, $classmap); |
|
| 115 | - } else { |
|
| 116 | - $this->classmap = $classmap; |
|
| 117 | - } |
|
| 104 | + /** |
|
| 105 | + * Get the classes to filename map. |
|
| 106 | + * |
|
| 107 | + * @param array $classmap |
|
| 108 | + * |
|
| 109 | + * @return void |
|
| 110 | + */ |
|
| 111 | + public function addClassMap(array $classmap) |
|
| 112 | + { |
|
| 113 | + if (isset($this->classmap)) { |
|
| 114 | + $this->classmap = array_merge($this->classmap, $classmap); |
|
| 115 | + } else { |
|
| 116 | + $this->classmap = $classmap; |
|
| 117 | + } |
|
| 118 | 118 | |
| 119 | - return $this->classmap; |
|
| 120 | - } |
|
| 119 | + return $this->classmap; |
|
| 120 | + } |
|
| 121 | 121 | |
| 122 | - /** |
|
| 123 | - * Get the filename map. |
|
| 124 | - * |
|
| 125 | - * @param array $files |
|
| 126 | - * |
|
| 127 | - * @return void |
|
| 128 | - */ |
|
| 129 | - public function addFiles(array $files) |
|
| 130 | - { |
|
| 131 | - if (isset($this->includeFiles)) { |
|
| 132 | - $this->includeFiles = array_merge($this->includeFiles, $files); |
|
| 133 | - } else { |
|
| 134 | - $this->includeFiles = $files; |
|
| 135 | - } |
|
| 122 | + /** |
|
| 123 | + * Get the filename map. |
|
| 124 | + * |
|
| 125 | + * @param array $files |
|
| 126 | + * |
|
| 127 | + * @return void |
|
| 128 | + */ |
|
| 129 | + public function addFiles(array $files) |
|
| 130 | + { |
|
| 131 | + if (isset($this->includeFiles)) { |
|
| 132 | + $this->includeFiles = array_merge($this->includeFiles, $files); |
|
| 133 | + } else { |
|
| 134 | + $this->includeFiles = $files; |
|
| 135 | + } |
|
| 136 | 136 | |
| 137 | - return $this->includeFiles; |
|
| 138 | - } |
|
| 137 | + return $this->includeFiles; |
|
| 138 | + } |
|
| 139 | 139 | |
| 140 | - /** |
|
| 141 | - * Registers a set of PSR-4 directories for a given namespace. |
|
| 142 | - * |
|
| 143 | - * @param array $psr4 |
|
| 144 | - * |
|
| 145 | - * @return void |
|
| 146 | - */ |
|
| 147 | - public function addPsr4(array $psr4) |
|
| 148 | - { |
|
| 149 | - if (isset($this->psr4)) { |
|
| 150 | - $this->psr4 = array_merge($this->psr4, $psr4); |
|
| 151 | - } else { |
|
| 152 | - $this->psr4 = $psr4; |
|
| 153 | - } |
|
| 140 | + /** |
|
| 141 | + * Registers a set of PSR-4 directories for a given namespace. |
|
| 142 | + * |
|
| 143 | + * @param array $psr4 |
|
| 144 | + * |
|
| 145 | + * @return void |
|
| 146 | + */ |
|
| 147 | + public function addPsr4(array $psr4) |
|
| 148 | + { |
|
| 149 | + if (isset($this->psr4)) { |
|
| 150 | + $this->psr4 = array_merge($this->psr4, $psr4); |
|
| 151 | + } else { |
|
| 152 | + $this->psr4 = $psr4; |
|
| 153 | + } |
|
| 154 | 154 | |
| 155 | - return $this->psr4; |
|
| 156 | - } |
|
| 155 | + return $this->psr4; |
|
| 156 | + } |
|
| 157 | 157 | } |
| 158 | 158 | \ No newline at end of file |
@@ -38,14 +38,14 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | public function get(string $name); |
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * Set an environment variable. |
|
| 43 | - * |
|
| 44 | - * @param string $name |
|
| 45 | - * @param string $value |
|
| 46 | - * |
|
| 47 | - * @return bool |
|
| 48 | - */ |
|
| 41 | + /** |
|
| 42 | + * Set an environment variable. |
|
| 43 | + * |
|
| 44 | + * @param string $name |
|
| 45 | + * @param string $value |
|
| 46 | + * |
|
| 47 | + * @return bool |
|
| 48 | + */ |
|
| 49 | 49 | public function set(string $name, string $value); |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -38,14 +38,14 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | public function read(string $name); |
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * Write to an environment variable. |
|
| 43 | - * |
|
| 44 | - * @param string $name |
|
| 45 | - * @param string $value |
|
| 46 | - * |
|
| 47 | - * @return bool |
|
| 48 | - */ |
|
| 41 | + /** |
|
| 42 | + * Write to an environment variable. |
|
| 43 | + * |
|
| 44 | + * @param string $name |
|
| 45 | + * @param string $value |
|
| 46 | + * |
|
| 47 | + * @return bool |
|
| 48 | + */ |
|
| 49 | 49 | public function write(string $name, string $value); |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | public function initialize(AutoloadConfig $config) |
| 76 | 76 | { |
| 77 | 77 | if (isset($config->psr4)) { |
| 78 | - $this->addNamespace($config->addPsr4((array) $this->classOrNamespaceListMap[0])); |
|
| 78 | + $this->addNamespace($config->addPsr4((array) $this->classOrNamespaceListMap[0])); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | if (isset($config->classmap)) { |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | include_once $config[$class]; |
| 326 | 326 | |
| 327 | 327 | }, true, // Throw exception |
| 328 | - true // Prepend |
|
| 328 | + true // Prepend |
|
| 329 | 329 | ); |
| 330 | 330 | |
| 331 | 331 | // Autoloading for the files helpers, hooks or functions |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | }, true, |
| 341 | - true |
|
| 341 | + true |
|
| 342 | 342 | ); |
| 343 | 343 | } |
| 344 | 344 | |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | // Now prepend another loader for the files in our class map |
| 317 | 317 | $config = is_array($this->classmap) ? $this->classmap : []; |
| 318 | 318 | |
| 319 | - spl_autoload_register(function ($class) use ($config) { |
|
| 319 | + spl_autoload_register(function($class) use ($config) { |
|
| 320 | 320 | |
| 321 | 321 | if (empty($config[$class])) { |
| 322 | 322 | return false; |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | // Autoloading for the files helpers, hooks or functions |
| 332 | 332 | $files = is_array($this->includeFiles) ? $this->includeFiles : []; |
| 333 | 333 | |
| 334 | - spl_autoload_register(function () use ($files) { |
|
| 334 | + spl_autoload_register(function() use ($files) { |
|
| 335 | 335 | |
| 336 | 336 | foreach ($files as $fileIdentifier => $file) { |
| 337 | 337 | $this->getAutoloaderFileRequire($fileIdentifier, $file); |
@@ -72,14 +72,14 @@ |
||
| 72 | 72 | return null; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - /** |
|
| 76 | - * Write to an environment variable. |
|
| 77 | - * |
|
| 78 | - * @param string $name |
|
| 79 | - * @param string $value |
|
| 80 | - * |
|
| 81 | - * @return bool |
|
| 82 | - */ |
|
| 75 | + /** |
|
| 76 | + * Write to an environment variable. |
|
| 77 | + * |
|
| 78 | + * @param string $name |
|
| 79 | + * @param string $value |
|
| 80 | + * |
|
| 81 | + * @return bool |
|
| 82 | + */ |
|
| 83 | 83 | public function write(string $name, string $value) |
| 84 | 84 | { |
| 85 | 85 | putenv("$name=$value"); |
@@ -74,14 +74,14 @@ |
||
| 74 | 74 | return null; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - /** |
|
| 78 | - * Write to an environment variable. |
|
| 79 | - * |
|
| 80 | - * @param string $name |
|
| 81 | - * @param string $value |
|
| 82 | - * |
|
| 83 | - * @return bool |
|
| 84 | - */ |
|
| 77 | + /** |
|
| 78 | + * Write to an environment variable. |
|
| 79 | + * |
|
| 80 | + * @param string $name |
|
| 81 | + * @param string $value |
|
| 82 | + * |
|
| 83 | + * @return bool |
|
| 84 | + */ |
|
| 85 | 85 | public function write(string $name, string $value) |
| 86 | 86 | { |
| 87 | 87 | if ($this->has($name)) { |