From a0621b623be7827cc27b30762f3f96410e8edd5d Mon Sep 17 00:00:00 2001 From: mirzaev Date: Thu, 11 Jan 2024 05:38:30 +0700 Subject: [PATCH] added installer --- .../project}/system/controllers/core.php | 14 +++++++------- .../project}/system/controllers/index.php | 8 ++++---- .../project}/system/models/core.php | 6 +++--- .../project}/system/models/session.php | 6 +++--- .../project}/system/models/traits/status.php | 6 +++--- .../system/public/css/themes/default/main.css | 0 .../project}/system/public/index.php | 2 +- .../project}/system/settings/.gitignore | 0 .../project}/system/settings/arangodb.php.sample | 4 ++-- .../project}/system/views/templater.php | 10 +++++----- .../project}/system/views/themes/default/core.html | 0 .../system/views/themes/default/footer.html | 0 .../project}/system/views/themes/default/head.html | 0 .../system/views/themes/default/header.html | 0 .../system/views/themes/default/index.html | 0 .../project}/system/views/themes/default/js.html | 0 composer.json | 13 ++++++++----- install.sh | 10 ++++++++++ 18 files changed, 46 insertions(+), 33 deletions(-) rename {${REPO_OWNER}/${REPO_NAME} => author/project}/system/controllers/core.php (87%) rename {${REPO_OWNER}/${REPO_NAME} => author/project}/system/controllers/index.php (73%) rename {${REPO_OWNER}/${REPO_NAME} => author/project}/system/models/core.php (98%) rename {${REPO_OWNER}/${REPO_NAME} => author/project}/system/models/session.php (98%) rename {${REPO_OWNER}/${REPO_NAME} => author/project}/system/models/traits/status.php (82%) rename {${REPO_OWNER}/${REPO_NAME} => author/project}/system/public/css/themes/default/main.css (100%) rename {${REPO_OWNER}/${REPO_NAME} => author/project}/system/public/index.php (95%) rename {${REPO_OWNER}/${REPO_NAME} => author/project}/system/settings/.gitignore (100%) rename {${REPO_OWNER}/${REPO_NAME} => author/project}/system/settings/arangodb.php.sample (60%) rename {${REPO_OWNER}/${REPO_NAME} => author/project}/system/views/templater.php (95%) rename {${REPO_OWNER}/${REPO_NAME} => author/project}/system/views/themes/default/core.html (100%) rename {${REPO_OWNER}/${REPO_NAME} => author/project}/system/views/themes/default/footer.html (100%) rename {${REPO_OWNER}/${REPO_NAME} => author/project}/system/views/themes/default/head.html (100%) rename {${REPO_OWNER}/${REPO_NAME} => author/project}/system/views/themes/default/header.html (100%) rename {${REPO_OWNER}/${REPO_NAME} => author/project}/system/views/themes/default/index.html (100%) rename {${REPO_OWNER}/${REPO_NAME} => author/project}/system/views/themes/default/js.html (100%) create mode 100755 install.sh diff --git a/${REPO_OWNER}/${REPO_NAME}/system/controllers/core.php b/author/project/system/controllers/core.php similarity index 87% rename from ${REPO_OWNER}/${REPO_NAME}/system/controllers/core.php rename to author/project/system/controllers/core.php index 9d3859a..6407bfb 100644 --- a/${REPO_OWNER}/${REPO_NAME}/system/controllers/core.php +++ b/author/project/system/controllers/core.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace {$REPO_OWNER}\{$REPO_NAME}\controllers; +namespace ${REPO_OWNER}\${REPO_NAME}\controllers; // Files of the project -use {$REPO_OWNER}\{$REPO_NAME}\views\manager, - {$REPO_OWNER}\{$REPO_NAME}\models\core as models, - {$REPO_OWNER}\{$REPO_NAME}\models\account_model as account, - {$REPO_OWNER}\{$REPO_NAME}\models\session_model as session; +use ${REPO_OWNER}\${REPO_NAME}\views\manager, + ${REPO_OWNER}\${REPO_NAME}\models\core as models, + ${REPO_OWNER}\${REPO_NAME}\models\account_model as account, + ${REPO_OWNER}\${REPO_NAME}\models\session_model as session; // Library for ArangoDB use ArangoDBClient\Document as _document; @@ -19,8 +19,8 @@ use mirzaev\minimal\controller; /** * Core of controllers * - * @package {$REPO_OWNER}\{$REPO_NAME}\controllers - * @author {$REPO_OWNER} < mail > + * @package ${REPO_OWNER}\${REPO_NAME}\controllers + * @author ${REPO_OWNER} < mail > */ class core extends controller { diff --git a/${REPO_OWNER}/${REPO_NAME}/system/controllers/index.php b/author/project/system/controllers/index.php similarity index 73% rename from ${REPO_OWNER}/${REPO_NAME}/system/controllers/index.php rename to author/project/system/controllers/index.php index 84aadb4..a19a1c4 100644 --- a/${REPO_OWNER}/${REPO_NAME}/system/controllers/index.php +++ b/author/project/system/controllers/index.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace {$REPO_OWNER}\{$REPO_NAME}\controllers; +namespace ${REPO_OWNER}\${REPO_NAME}\controllers; // Files of the project -use {$REPO_OWNER}\{$REPO_NAME}\controllers\core; +use ${REPO_OWNER}\${REPO_NAME}\controllers\core; /** * Index controller * - * @package {$REPO_OWNER}\{$REPO_NAME}\controllers - * @author {$REPO_OWNER} < mail > + * @package ${REPO_OWNER}\${REPO_NAME}\controllers + * @author ${REPO_OWNER} < mail > */ final class index extends core { diff --git a/${REPO_OWNER}/${REPO_NAME}/system/models/core.php b/author/project/system/models/core.php similarity index 98% rename from ${REPO_OWNER}/${REPO_NAME}/system/models/core.php rename to author/project/system/models/core.php index 3d353c0..28186bc 100644 --- a/${REPO_OWNER}/${REPO_NAME}/system/models/core.php +++ b/author/project/system/models/core.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace {$REPO_OWNER}\{$REPO_NAME}\models; +namespace ${REPO_OWNER}\${REPO_NAME}\models; // Framework for PHP use mirzaev\minimal\model; @@ -22,8 +22,8 @@ use exception; /** * Core of models * - * @package {$REPO_OWNER}\{$REPO_NAME}\controllers - * @author {$REPO_OWNER} < mail > + * @package ${REPO_OWNER}\${REPO_NAME}\controllers + * @author ${REPO_OWNER} < mail > */ class core extends model { diff --git a/${REPO_OWNER}/${REPO_NAME}/system/models/session.php b/author/project/system/models/session.php similarity index 98% rename from ${REPO_OWNER}/${REPO_NAME}/system/models/session.php rename to author/project/system/models/session.php index 4665b59..3c7ff37 100644 --- a/${REPO_OWNER}/${REPO_NAME}/system/models/session.php +++ b/author/project/system/models/session.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace {$REPO_OWNER}\{$REPO_NAME}\models; +namespace ${REPO_OWNER}\${REPO_NAME}\models; // Files of the project use mirzaev\ebala\models\account, @@ -21,8 +21,8 @@ use exception; /** * Model of session * - * @package {$REPO_OWNER}\{$REPO_NAME}\controllers - * @author {$REPO_OWNER} < mail > + * @package ${REPO_OWNER}\${REPO_NAME}\controllers + * @author ${REPO_OWNER} < mail > */ final class session extends core { diff --git a/${REPO_OWNER}/${REPO_NAME}/system/models/traits/status.php b/author/project/system/models/traits/status.php similarity index 82% rename from ${REPO_OWNER}/${REPO_NAME}/system/models/traits/status.php rename to author/project/system/models/traits/status.php index 00fcca4..b2798c2 100644 --- a/${REPO_OWNER}/${REPO_NAME}/system/models/traits/status.php +++ b/author/project/system/models/traits/status.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace {$REPO_OWNER}\{$REPO_NAME}\models\traits; +namespace ${REPO_OWNER}\${REPO_NAME}\models\traits; // Built-in libraries use exception; @@ -10,9 +10,9 @@ use exception; /** * Trait fo initialization of a status * - * @package {$REPO_OWNER}\{$REPO_NAME}\models\traits + * @package ${REPO_OWNER}\${REPO_NAME}\models\traits * - * @author {$REPO_OWNER} < mail > + * @author ${REPO_OWNER} < mail > */ trait status { diff --git a/${REPO_OWNER}/${REPO_NAME}/system/public/css/themes/default/main.css b/author/project/system/public/css/themes/default/main.css similarity index 100% rename from ${REPO_OWNER}/${REPO_NAME}/system/public/css/themes/default/main.css rename to author/project/system/public/css/themes/default/main.css diff --git a/${REPO_OWNER}/${REPO_NAME}/system/public/index.php b/author/project/system/public/index.php similarity index 95% rename from ${REPO_OWNER}/${REPO_NAME}/system/public/index.php rename to author/project/system/public/index.php index 65975c6..b7f0238 100644 --- a/${REPO_OWNER}/${REPO_NAME}/system/public/index.php +++ b/author/project/system/public/index.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace {$REPO_OWNER}\{$REPO_NAME}; +namespace ${REPO_OWNER}\${REPO_NAME}; use mirzaev\minimal\core; use mirzaev\minimal\router; diff --git a/${REPO_OWNER}/${REPO_NAME}/system/settings/.gitignore b/author/project/system/settings/.gitignore similarity index 100% rename from ${REPO_OWNER}/${REPO_NAME}/system/settings/.gitignore rename to author/project/system/settings/.gitignore diff --git a/${REPO_OWNER}/${REPO_NAME}/system/settings/arangodb.php.sample b/author/project/system/settings/arangodb.php.sample similarity index 60% rename from ${REPO_OWNER}/${REPO_NAME}/system/settings/arangodb.php.sample rename to author/project/system/settings/arangodb.php.sample index 2839054..41b83c7 100644 --- a/${REPO_OWNER}/${REPO_NAME}/system/settings/arangodb.php.sample +++ b/author/project/system/settings/arangodb.php.sample @@ -2,7 +2,7 @@ return [ 'endpoint' => 'unix:///var/run/arangodb3/arango.sock', - 'database' => '{$REPO_NAME}', - 'name' => '{$REPO_NAME}', + 'database' => '${REPO_NAME}', + 'name' => '${REPO_NAME}', 'password' => '' ]; diff --git a/${REPO_OWNER}/${REPO_NAME}/system/views/templater.php b/author/project/system/views/templater.php similarity index 95% rename from ${REPO_OWNER}/${REPO_NAME}/system/views/templater.php rename to author/project/system/views/templater.php index 5436e9a..b85176a 100644 --- a/${REPO_OWNER}/${REPO_NAME}/system/views/templater.php +++ b/author/project/system/views/templater.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace {$REPO_OWNER}\{$REPO_NAME}\views; +namespace ${REPO_OWNER}\${REPO_NAME}\views; // Files of the project -use {$REPO_OWNER}\{$REPO_NAME}\models\session, - {$REPO_OWNER}\{$REPO_NAME}\models\account; +use ${REPO_OWNER}\${REPO_NAME}\models\session, + ${REPO_OWNER}\${REPO_NAME}\models\account; // Framework for PHP use mirzaev\minimal\controller; @@ -24,8 +24,8 @@ use ArrayAccess; /** * Templater core * - * @package {$REPO_OWNER}\{$REPO_NAME}\views - * @author {$REPO_OWNER} < mail > + * @package ${REPO_OWNER}\${REPO_NAME}\views + * @author ${REPO_OWNER} < mail > */ final class templater extends controller implements ArrayAccess { diff --git a/${REPO_OWNER}/${REPO_NAME}/system/views/themes/default/core.html b/author/project/system/views/themes/default/core.html similarity index 100% rename from ${REPO_OWNER}/${REPO_NAME}/system/views/themes/default/core.html rename to author/project/system/views/themes/default/core.html diff --git a/${REPO_OWNER}/${REPO_NAME}/system/views/themes/default/footer.html b/author/project/system/views/themes/default/footer.html similarity index 100% rename from ${REPO_OWNER}/${REPO_NAME}/system/views/themes/default/footer.html rename to author/project/system/views/themes/default/footer.html diff --git a/${REPO_OWNER}/${REPO_NAME}/system/views/themes/default/head.html b/author/project/system/views/themes/default/head.html similarity index 100% rename from ${REPO_OWNER}/${REPO_NAME}/system/views/themes/default/head.html rename to author/project/system/views/themes/default/head.html diff --git a/${REPO_OWNER}/${REPO_NAME}/system/views/themes/default/header.html b/author/project/system/views/themes/default/header.html similarity index 100% rename from ${REPO_OWNER}/${REPO_NAME}/system/views/themes/default/header.html rename to author/project/system/views/themes/default/header.html diff --git a/${REPO_OWNER}/${REPO_NAME}/system/views/themes/default/index.html b/author/project/system/views/themes/default/index.html similarity index 100% rename from ${REPO_OWNER}/${REPO_NAME}/system/views/themes/default/index.html rename to author/project/system/views/themes/default/index.html diff --git a/${REPO_OWNER}/${REPO_NAME}/system/views/themes/default/js.html b/author/project/system/views/themes/default/js.html similarity index 100% rename from ${REPO_OWNER}/${REPO_NAME}/system/views/themes/default/js.html rename to author/project/system/views/themes/default/js.html diff --git a/composer.json b/composer.json index d306cac..0ab457a 100755 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "readme": "README.md", "keywords": [], "type": "", - "homepage": "{$REPO_SSH_URL}", + "homepage": "${REPO_HTTPS_URL}", "license": "WTFPL", "authors": [ { @@ -15,8 +15,8 @@ } ], "support": { - "docs": "{$REPO_SSH_URL}/manual", - "issues": "{$REPO_SSH_URL}/issues" + "docs": "${REPO_HTTPS_URL}/manual", + "issues": "${REPO_HTTPS_URL}/issues" }, "require": { "php": "~8.3", @@ -32,12 +32,15 @@ }, "autoload": { "psr-4": { - "{$REPO_OWNER}\\{$REPO_NAME}\\": "{$REPO_OWNER}/{$REPO_NAME}/system" + "${REPO_OWNER}\\${REPO_NAME}\\": "${REPO_OWNER}/${REPO_NAME}/system" } }, "autoload-dev": { "psr-4": { - "{$REPO_OWNER}\\{$REPO_NAME}\\tests\\": "{$REPO_OWNER}/{$REPO_NAME}/tests" + "${REPO_OWNER}\\${REPO_NAME}\\tests\\": "${REPO_OWNER}/${REPO_NAME}/tests" } + }, + "scripts": { + "pre-install-cmd": "bash ./install.sh" } } diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..4ce2d31 --- /dev/null +++ b/install.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [ -d author/project ]; then + mv author/project author/${REPO_NAME} +fi + +if [ -d author ]; then + mv author ${REPO_OWNER} +fi +