Skip to content

Commit

Permalink
Added Composer-Support, made autoload.php a bit faster and integrated…
Browse files Browse the repository at this point in the history
… in the install command & more
  • Loading branch information
JulianFun123 committed Oct 8, 2021
1 parent 4328321 commit 79f2322
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
4 changes: 2 additions & 2 deletions autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
@include_once "$dir/".str_replace("\\","/",$class).".php";
else if(file_exists("$dir/modules/".str_replace("\\","/",$class).".php"))
@include_once "$dir/modules/".str_replace("\\","/",$class).".php";
else if(file_exists("$dir/src/main/".str_replace("\\","/",$class).".php"))
@include_once "$dir/src/main/".str_replace("\\","/",$class).".php";
else if(file_exists("$dir/src/$mod/".str_replace("\\","/",$class).".php"))
@include_once "$dir/src/$mod/".str_replace("\\","/",$class).".php";
else if(file_exists("$dir/src/".str_replace("\\","/",$class).".php"))
@include_once "$dir/src/".str_replace("\\","/",$class).".php";
else if(isset($namespaceBindingsKeys)) {
Expand Down
3 changes: 1 addition & 2 deletions src/main/de/interaapps/uppm/package/UPPMPackage.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?php
namespace de\interaapps\uppm\package;

use de\interaapps\jsonplus\JSONPlus;
use de\interaapps\uppm\helper\Logger;
use de\interaapps\uppm\helper\Web;
use de\interaapps\uppm\package\uppm\models\PackageVersionResponse;

Expand All @@ -19,6 +17,7 @@ public function getDownloadURL() : string|null {
$version = PackageVersionResponse::fromJson(Web::httpRequest("$repo/$name/$versionName"));
if ($version->error || $version->download_url == "")
continue;
$this->version = $version->name;
return $version->download_url;
}
return null;
Expand Down
13 changes: 13 additions & 0 deletions src/scripts/testing.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php
(include 'autoload.php')(mod: "main");

use de\interaapps\jsonplus\JSONModel;

class Test {
use JSONModel;
public string|null $hello = null;
}

$t = Test::fromJson("{}");
echo $t->hello;
echo $t->toJson();
3 changes: 2 additions & 1 deletion uppm.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"repositories": [],
"run": {
"start": "src\/main\/bootstrap.php",
"install": "src\/scripts\/install.php"
"install": "src\/scripts\/install.php",
"test": "src\/scripts\/testing.php"
},
"build": {
"type": "phar",
Expand Down

0 comments on commit 79f2322

Please sign in to comment.