Skip to content

Commit

Permalink
Fix autoload for global installation
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel committed Mar 22, 2019
1 parent a4018ae commit 6a98a0c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
22 changes: 20 additions & 2 deletions ace.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 = <<<header
Version: 1.0.1
Version: $version
Last Update: 22 March 2019
(c) 2019 by Michael Milawski
header;
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1
1.0.2

0 comments on commit 6a98a0c

Please sign in to comment.