diff options
author | Kevin Chabowski <kevin@kch42.de> | 2014-05-24 01:54:04 +0200 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2014-05-24 01:54:04 +0200 |
commit | f7ddc264d832d163494904da67ca96856335487b (patch) | |
tree | 68e1b25d4799a966242150082a9ff3a12832b561 /steloader.php | |
parent | 84d815f4e006e02521759070bb89025dab80b219 (diff) | |
download | ste-f7ddc264d832d163494904da67ca96856335487b.tar.gz ste-f7ddc264d832d163494904da67ca96856335487b.tar.bz2 ste-f7ddc264d832d163494904da67ca96856335487b.zip |
Simple autoloader for examples and tests.
Diffstat (limited to 'steloader.php')
-rw-r--r-- | steloader.php | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/steloader.php b/steloader.php new file mode 100644 index 0000000..166f52d --- /dev/null +++ b/steloader.php @@ -0,0 +1,16 @@ +<?php + +/* + * Very simple autoloader for ste. Will only load ste. + * Should only be used for the examples and tests in this project. + * Use a full-fledged PSR-3 autoloader (e.g. the composer loader) for production! + */ + +function autoload_ste($cl) { + $path = explode("\\", $cl); + if(($path[0] == "kch42") && ($path[1] == "ste")) { + require_once(__DIR__ . "/" . $path[2] . ".php"); + } +} + +spl_autoload_register("autoload_ste"); |