diff --git a/ace.php b/ace.php index 713a71a..8f0976c 100644 --- a/ace.php +++ b/ace.php @@ -7,7 +7,18 @@ * (c) 2019 by Michael Milawski, www.millsoft.de */ -require __DIR__ . '/vendor/autoload.php'; +$autoload_file = __DIR__ . "/vendor/autoload.php"; +$autoload_file_global = __DIR__ . "/../../autoload.php"; + +if (file_exists($autoload_file_global)) { + //this script is installed in the composer installation + require_once $autoload_file_global; +} else { + if (!file_exists($autoload_file)) { + throw new Exception("Composer autoload not found."); + } + require_once $autoload_file; +} use Millsoft\AceTool\Commands\CommentCommands; use Millsoft\AceTool\Commands\AccountCommands; @@ -27,8 +38,15 @@ public static function init () { Helper::initSession(); + $versionFile = __DIR__ . "/version.txt"; + if(file_exists($versionFile)){ + $version = file_get_contents($versionFile); + }else{ + $version = '???'; + } + $header = <<