diff --git a/kilo b/kilo index b46843b..b780839 100755 --- a/kilo +++ b/kilo @@ -3,7 +3,30 @@ namespace Aviat\Kilo; -require_once __DIR__ . '/vendor/autoload.php'; +require_once __DIR__ . '/src/constants.php'; +require_once __DIR__ . '/src/config.php'; +require_once __DIR__ . '/src/functions.php'; + +// Remove the composer install requirement by +// manually handling autoloading +spl_autoload_register(function (string $class) { + $nsParts = explode('\\', $class); + array_shift($nsParts); + array_shift($nsParts); + + array_unshift($nsParts, __DIR__, 'src'); + $file = implode(DIRECTORY_SEPARATOR, $nsParts) . '.php'; + + if (file_exists($file)) + { + require_once($file); + return true; + } + + return false; + +}); + // Log notices/errors/warnings to file set_error_handler(static function (