forked from AppStateESS/canopy3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInitialize.php
More file actions
29 lines (22 loc) · 731 Bytes
/
Initialize.php
File metadata and controls
29 lines (22 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
/**
* Loads sets root directory and autoloader.
*
* @author Matthew McNaney <mcnaneym@appstate.edu>
* @license https://opensource.org/licenses/MIT
*/
namespace Canopy3\Initialize;
function autoloader()
{
// Composer autoloader
require_once C3_DIR . 'vendor/autoload.php';
// Canopy3 and resource autoloader
require_once C3_DIR . 'src/AutoLoader.php';
spl_autoload_register(fn($namespaceString) => \Canopy3\AutoLoader::run($namespaceString));
require_once C3_DIR . 'src/GlobalFunctions.php';
\Canopy3\requireConfigFile(C3_DIR . 'config/system');
$resourceConfig = C3_DIR . 'config/resourcesUrl.php';
if (is_file($resourceConfig)) {
require_once $resourceConfig;
}
}