diff --git a/exporter/Builder.php b/exporter/Builder.php index 358a919..fb1be7c 100755 --- a/exporter/Builder.php +++ b/exporter/Builder.php @@ -33,25 +33,40 @@ /* [1] Builds project's base file structure =========================================================*/ /* (1) Copy from src/files */ + echo "(1) Building file structure\n"; shell_exec("cp -r ".__ROOT__."/src/files/* ".$this->root); /* [2] Browse each package to load =========================================================*/ - foreach($this->packages as $package=>$version){ - $path = "/$package/$version"; + echo "(2) Building packages\n"; + $count = 1; + foreach($this->packages as $package=>$version){ + $path = "$package/$version"; + + echo " ($count) $package:$version\n"; /* (1) Copy package folder if it exists */ - if( file_exists(__ROOT__."/src/packages$path/") && is_dir(__ROOT__."/src/packages$path/") && count(scandir(__ROOT__."/src/packages$path/")) > 2 ) - shell_exec("cp -r ".__ROOT__."/src/packages$path ".$this->root."/build/$package"); + if( file_exists(__ROOT__."/src/packages/$path") && is_dir(__ROOT__."/src/packages/$path") && count(scandir(__ROOT__."/src/packages/$path")) > 2 ) + shell_exec("cp -r ".__ROOT__."/src/packages/$path ".$this->root."/build/$package"); /* (2) Copy package config if it exists */ - if( file_exists(__ROOT__."/src/config$path/") && is_dir(__ROOT__."/src/config$path/") && count(scandir(__ROOT__."/src/config$path/")) > 2 ) - shell_exec("cp -r ".__ROOT__."/src/config$path/* ".$this->root."/config/"); + if( file_exists(__ROOT__."/src/config/$path") && is_dir(__ROOT__."/src/config/$path") && count(scandir(__ROOT__."/src/config/$path")) > 2 ) + shell_exec("cp -r ".__ROOT__."/src/config/$path/* ".$this->root."/config/"); + $count++; } + echo "(*) Build finished\n"; + + /* [3] Start stats + =========================================================*/ + echo "\n\nStatistics:\n"; + echo shell_exec("du -hs ".$this->root."/*;"); + echo "--\n"; + echo shell_exec("du -hs ".$this->root."/;"); + } diff --git a/exporter/packages.json b/exporter/packages.json index 4ec4086..e97658d 100755 --- a/exporter/packages.json +++ b/exporter/packages.json @@ -1,69 +1,69 @@ { - "available": { - "error": { - "1.0": [], - "2.0": [] - }, - "http": { - "1.0": [] - }, - "api": { - "1.0": { - "error": [ - "1.0" - ] - }, - "2.0": { - "error": [ - "2.0" - ] - }, - "2.1": { - "error": [ - "2.0" - ], - "http": [ - "1.0" - ] - } - }, - "orm": { - "0.8.1": { - "database": [ - "1.0" - ] - }, - "0.8.2": { - "database": [ - "2.0" - ] - } - }, - "database": { - "1.0": { - "error": [ - "1.0" - ] - }, - "2.0": { - "error": [ - "2.0" - ] - } - }, - "lightdb": { - "1.0": [] - }, - "router": { - "1.0": [] - } - }, - "installed": { - "api": "2.1", - "error": "2.0", - "http": "1.0", - "orm": "0.8.2", - "database": "2.0", - "router": "1.0" - } -} \ No newline at end of file + "available": { + "error": { + "1.0": [], + "2.0": [] + }, + "http": { + "1.0": [] + }, + "api": { + "1.0": { + "error": [ + "1.0" + ] + }, + "2.0": { + "error": [ + "2.0" + ] + }, + "2.2": { + "error": [ + "2.0" + ], + "http": [ + "1.0" + ] + } + }, + "orm": { + "0.8.1": { + "database": [ + "1.0" + ] + }, + "0.8.2": { + "database": [ + "2.0" + ] + } + }, + "database": { + "1.0": { + "error": [ + "1.0" + ] + }, + "2.0": { + "error": [ + "2.0" + ] + } + }, + "lightdb": { + "1.0": [] + }, + "router": { + "1.0": [] + } + }, + "installed": { + "api": "2.2", + "error": "2.0", + "http": "1.0", + "orm": "0.8.2", + "database": "2.0", + "router": "1.0" + } +} diff --git a/src/modules/api/1.0/core/Authentification.php b/src/packages/api/1.0/core/Authentification.php similarity index 100% rename from src/modules/api/1.0/core/Authentification.php rename to src/packages/api/1.0/core/Authentification.php diff --git a/src/modules/api/1.0/core/Checker.php b/src/packages/api/1.0/core/Checker.php similarity index 100% rename from src/modules/api/1.0/core/Checker.php rename to src/packages/api/1.0/core/Checker.php diff --git a/src/modules/api/1.0/core/ModuleRequest.php b/src/packages/api/1.0/core/ModuleRequest.php similarity index 100% rename from src/modules/api/1.0/core/ModuleRequest.php rename to src/packages/api/1.0/core/ModuleRequest.php diff --git a/src/modules/api/1.0/core/ModuleResponse.php b/src/packages/api/1.0/core/ModuleResponse.php similarity index 100% rename from src/modules/api/1.0/core/ModuleResponse.php rename to src/packages/api/1.0/core/ModuleResponse.php diff --git a/src/modules/api/1.0/module/module.php b/src/packages/api/1.0/module/module.php similarity index 100% rename from src/modules/api/1.0/module/module.php rename to src/packages/api/1.0/module/module.php diff --git a/src/modules/api/2.0/core/Authentification.php b/src/packages/api/2.0/core/Authentification.php similarity index 100% rename from src/modules/api/2.0/core/Authentification.php rename to src/packages/api/2.0/core/Authentification.php diff --git a/src/modules/api/2.0/core/Checker.php b/src/packages/api/2.0/core/Checker.php similarity index 100% rename from src/modules/api/2.0/core/Checker.php rename to src/packages/api/2.0/core/Checker.php diff --git a/src/modules/api/2.0/core/ModuleFactory.php b/src/packages/api/2.0/core/ModuleFactory.php similarity index 100% rename from src/modules/api/2.0/core/ModuleFactory.php rename to src/packages/api/2.0/core/ModuleFactory.php diff --git a/src/modules/api/2.0/core/Request.php b/src/packages/api/2.0/core/Request.php similarity index 100% rename from src/modules/api/2.0/core/Request.php rename to src/packages/api/2.0/core/Request.php diff --git a/src/modules/api/2.0/core/Response.php b/src/packages/api/2.0/core/Response.php similarity index 100% rename from src/modules/api/2.0/core/Response.php rename to src/packages/api/2.0/core/Response.php diff --git a/src/modules/api/2.0/module/RESTexample.php b/src/packages/api/2.0/module/RESTexample.php similarity index 100% rename from src/modules/api/2.0/module/RESTexample.php rename to src/packages/api/2.0/module/RESTexample.php diff --git a/src/modules/api/2.2/core/Authentification.php b/src/packages/api/2.2/core/Authentification.php similarity index 100% rename from src/modules/api/2.2/core/Authentification.php rename to src/packages/api/2.2/core/Authentification.php diff --git a/src/modules/api/2.2/core/Checker.php b/src/packages/api/2.2/core/Checker.php similarity index 100% rename from src/modules/api/2.2/core/Checker.php rename to src/packages/api/2.2/core/Checker.php diff --git a/src/modules/api/2.2/core/ModuleFactory.php b/src/packages/api/2.2/core/ModuleFactory.php similarity index 100% rename from src/modules/api/2.2/core/ModuleFactory.php rename to src/packages/api/2.2/core/ModuleFactory.php diff --git a/src/modules/api/2.2/core/Request.php b/src/packages/api/2.2/core/Request.php similarity index 100% rename from src/modules/api/2.2/core/Request.php rename to src/packages/api/2.2/core/Request.php diff --git a/src/modules/api/2.2/core/Response.php b/src/packages/api/2.2/core/Response.php similarity index 100% rename from src/modules/api/2.2/core/Response.php rename to src/packages/api/2.2/core/Response.php diff --git a/src/modules/api/2.2/module/RESTexample.php b/src/packages/api/2.2/module/RESTexample.php similarity index 100% rename from src/modules/api/2.2/module/RESTexample.php rename to src/packages/api/2.2/module/RESTexample.php diff --git a/src/modules/database/1.0/core/Database.php b/src/packages/database/1.0/core/Database.php similarity index 100% rename from src/modules/database/1.0/core/Database.php rename to src/packages/database/1.0/core/Database.php diff --git a/src/modules/database/1.0/core/Repo.php b/src/packages/database/1.0/core/Repo.php similarity index 100% rename from src/modules/database/1.0/core/Repo.php rename to src/packages/database/1.0/core/Repo.php diff --git a/src/modules/database/2.0/core/DatabaseDriver.php b/src/packages/database/2.0/core/DatabaseDriver.php similarity index 100% rename from src/modules/database/2.0/core/DatabaseDriver.php rename to src/packages/database/2.0/core/DatabaseDriver.php diff --git a/src/modules/database/2.0/core/Repo.php b/src/packages/database/2.0/core/Repo.php similarity index 100% rename from src/modules/database/2.0/core/Repo.php rename to src/packages/database/2.0/core/Repo.php diff --git a/src/modules/error/1.0/core/Error.php b/src/packages/error/1.0/core/Error.php similarity index 100% rename from src/modules/error/1.0/core/Error.php rename to src/packages/error/1.0/core/Error.php diff --git a/src/modules/error/2.0/Err.php b/src/packages/error/2.0/core/Err.php similarity index 100% rename from src/modules/error/2.0/Err.php rename to src/packages/error/2.0/core/Err.php diff --git a/src/modules/error/2.0/Error.php b/src/packages/error/2.0/core/Error.php similarity index 100% rename from src/modules/error/2.0/Error.php rename to src/packages/error/2.0/core/Error.php diff --git a/src/modules/http/1.0/core/HttpRequest.php b/src/packages/http/1.0/core/HttpRequest.php similarity index 100% rename from src/modules/http/1.0/core/HttpRequest.php rename to src/packages/http/1.0/core/HttpRequest.php diff --git a/src/modules/lightdb/1.0/core/lightdb.php b/src/packages/lightdb/1.0/core/lightdb.php similarity index 100% rename from src/modules/lightdb/1.0/core/lightdb.php rename to src/packages/lightdb/1.0/core/lightdb.php diff --git a/src/modules/orm/0.8.1/core/Rows.php b/src/packages/orm/0.8.1/core/Rows.php similarity index 100% rename from src/modules/orm/0.8.1/core/Rows.php rename to src/packages/orm/0.8.1/core/Rows.php diff --git a/src/modules/orm/0.8.1/core/SQLBuilder.php b/src/packages/orm/0.8.1/core/SQLBuilder.php similarity index 100% rename from src/modules/orm/0.8.1/core/SQLBuilder.php rename to src/packages/orm/0.8.1/core/SQLBuilder.php diff --git a/src/modules/orm/0.8.1/core/Table.php b/src/packages/orm/0.8.1/core/Table.php similarity index 100% rename from src/modules/orm/0.8.1/core/Table.php rename to src/packages/orm/0.8.1/core/Table.php diff --git a/src/modules/orm/0.8.2/core/Rows.php b/src/packages/orm/0.8.2/core/Rows.php similarity index 100% rename from src/modules/orm/0.8.2/core/Rows.php rename to src/packages/orm/0.8.2/core/Rows.php diff --git a/src/modules/orm/0.8.2/core/SQLBuilder.php b/src/packages/orm/0.8.2/core/SQLBuilder.php similarity index 100% rename from src/modules/orm/0.8.2/core/SQLBuilder.php rename to src/packages/orm/0.8.2/core/SQLBuilder.php diff --git a/src/modules/orm/0.8.2/core/Table.php b/src/packages/orm/0.8.2/core/Table.php similarity index 100% rename from src/modules/orm/0.8.2/core/Table.php rename to src/packages/orm/0.8.2/core/Table.php diff --git a/src/modules/router/1.0/core/Route.php b/src/packages/router/1.0/core/Route.php similarity index 100% rename from src/modules/router/1.0/core/Route.php rename to src/packages/router/1.0/core/Route.php diff --git a/src/modules/router/1.0/core/Router.php b/src/packages/router/1.0/core/Router.php similarity index 100% rename from src/modules/router/1.0/core/Router.php rename to src/packages/router/1.0/core/Router.php