summaryrefslogtreecommitdiffstats
path: root/vendor/markbaker/complex/classes/Bootstrap.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/markbaker/complex/classes/Bootstrap.php')
-rw-r--r--vendor/markbaker/complex/classes/Bootstrap.php38
1 files changed, 38 insertions, 0 deletions
diff --git a/vendor/markbaker/complex/classes/Bootstrap.php b/vendor/markbaker/complex/classes/Bootstrap.php
new file mode 100644
index 0000000..e933413
--- /dev/null
+++ b/vendor/markbaker/complex/classes/Bootstrap.php
@@ -0,0 +1,38 @@
+<?php
+
+include_once __DIR__ . '/Autoloader.php';
+
+\Complex\Autoloader::Register();
+
+
+abstract class FilesystemRegexFilter extends RecursiveRegexIterator
+{
+ protected $regex;
+ public function __construct(RecursiveIterator $it, $regex)
+ {
+ $this->regex = $regex;
+ parent::__construct($it, $regex);
+ }
+}
+
+class FilenameFilter extends FilesystemRegexFilter
+{
+ // Filter files against the regex
+ public function accept()
+ {
+ return (!$this->isFile() || preg_match($this->regex, $this->getFilename()));
+ }
+}
+
+
+$srcFolder = __DIR__ . DIRECTORY_SEPARATOR . 'src';
+$srcDirectory = new RecursiveDirectoryIterator($srcFolder);
+
+$filteredFileList = new FilenameFilter($srcDirectory, '/(?:php)$/i');
+$filteredFileList = new FilenameFilter($filteredFileList, '/^(?!.*(Complex|Exception)\.php).*$/i');
+
+foreach (new RecursiveIteratorIterator($filteredFileList) as $file) {
+ if ($file->isFile()) {
+ include_once $file;
+ }
+}