-
Notifications
You must be signed in to change notification settings - Fork 0
/
autoloader.php
78 lines (70 loc) · 3.15 KB
/
autoloader.php
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* __ _ ___ ___ ___ ___ ___ ____ _ __ ___ ___
* / _` |/ / / __/ _ \ / _ \ / / / __/| '_ ` _ \ / /
* | (_| |\ \| (_| (_) | (_) |\ \ | (__ | | | | | |\ \
* \__,_|/__/ \___\___/ \___/ /__/ \___\|_| |_| |_|/__/
*
*
************************************************************************************
* @ASCOOS-NAME : ASCOOS CMS 24' *
* @ASCOOS-VERSION : 24.0.0 *
* @ASCOOS-CATEGORY : Framework (Frontend and Administrator Side) *
* @ASCOOS-CREATOR : Drogidis Christos *
* @ASCOOS-SITE : www.ascoos.com *
* @ASCOOS-LICENSE : [Commercial] http://docs.ascoos.com/lics/ascoos/AGL.html *
* @ASCOOS-COPYRIGHT : Copyright (c) 2007 - 2024, AlexSoft Software. *
************************************************************************************
*
* @package : ASCOOS FRAMEWORK 24'
* @subpackage : Core Autoloader Files
* @source : afw/autoloader.php
* @fileNo :
* @version : 24.0.3
* @created : 2024-07-01 20:00:00 UTC+3
* @updated : 2024-12-02 07:00:00 UTC+3
* @author : Drogidis Christos
* @authorSite : www.alexsoft.gr
* @license : AGL-F
*
* @since PHP 8.2.0
*/
namespace ASCOOS\FRAMEWORK\Autoloader;
defined ("ALEXSOFT_RUN_CMS") or die("Prohibition of Access.");
defined ("ASCOOS_FRAMEWORK_RUN") or die("Prohibition of Access.");
use RecursiveIteratorIterator;
use RecursiveDirectoryIterator;
class TAutoloader {
private $libDir;
private $kernelDir;
public function __construct($libDir = __DIR__.'/libs/', $kernelDir = __DIR__.'/kernel/') {
$this->libDir = $libDir;
$this->kernelDir = $kernelDir;
}
public function includeLibraries() {
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->libDir));
foreach ($iterator as $file) {
if ($file->isFile() && basename($file) === 'autoload.php') {
require_once str_replace('\\', '/', $file->getPathname());
}
}
}
public function includeCoreFiles() {
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->kernelDir));
foreach ($iterator as $file) {
if ($file->isFile() && preg_match('/^core.*\.php$/', $file->getFilename())) {
require_once str_replace('\\', '/', $file->getPathname());
}
}
}
public function includeImplementationFiles() {
$implementationDir = $this->kernelDir . 'implementation/';
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($implementationDir));
foreach ($iterator as $file) {
if ($file->isFile() && preg_match('/.*\.php$/', $file->getFilename())) {
require_once str_replace('\\', '/', $file->getPathname());
}
}
}
}
?>