diff --git a/README.md b/README.md index 295ff8e..2ad42d6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Alight Admin +# Alight-Admin Alight Admin is a quick admin panel extension based on the [Alight framework](https://github.com/juneszh/alight). ![desktop screenshot](example/image/screenshot_1.png) @@ -11,15 +11,26 @@ Alight Admin is a quick admin panel extension based on the [Alight framework](h * Includes **authorization**, **permissions** and **user management**. * Customizable **Charts** displayed in the console by PHP, such as **Line**, **Column**, **Pie**, etc. +## Alight Family + +| Project | Description | +| --- | --- | +| [Alight](https://github.com/juneszh/alight) | Basic framework built-in routing, database, caching, etc. | +| [Alight-Admin](https://github.com/juneszh/alight-admin) | A full admin panel extension based on Alight. No front-end coding required.| +| [Alight-Project](https://github.com/juneszh/alight-project) | A template for beginner to easily create web applications by Alight/Alight-Admin. | + +## Requirements +PHP 7.4+ + ## Usage -Alight Admin can be quickly built using [Alight Project](https://github.com/juneszh/alight-project). +Alight Admin can be quickly built using [Alight-Project](https://github.com/juneszh/alight-project). ### Creating Project ```bash $ composer create-project juneszh/alight-project {PROJECT_DIRECTORY} ``` ### Initialize Admin -The following commands will build the runtime environment required by **Alight Admin**, such as installing composer package, inserting configuration options, creating database tables, and downloading front-end resources. Please make sure the [database has been configured](https://github.com/juneszh/alight#database). +The following commands will build the runtime environment required by **Alight-Admin**, such as installing composer package, inserting configuration options, creating database tables, and downloading front-end resources. Please make sure the [database has been configured](https://github.com/juneszh/alight#database). ```bash $ cd {PROJECT_DIRECTORY} $ composer require juneszh/alight-admin diff --git a/composer.json b/composer.json index 597470a..36de858 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,8 @@ } }, "require": { - "juneszh/alight": "^1.1.0", + "php": ">=7.4", + "juneszh/alight": "^1.1", "gregwar/captcha": "^1.1", "symfony/var-exporter": ">=5.4" } diff --git a/src/Admin.php b/src/Admin.php index d1fc087..c101494 100644 --- a/src/Admin.php +++ b/src/Admin.php @@ -106,7 +106,7 @@ public static function globalScript(string $component, array $config = []) public static function install() { if (PHP_SAPI !== 'cli') { - throw new Exception('Php-cli mode required.'); + throw new Exception('PHP-CLI required.'); } $configFile = realpath('config/app.php'); @@ -376,12 +376,11 @@ private static function createTable() public static function download() { if (PHP_SAPI !== 'cli') { - throw new Exception('Php-cli mode required.'); + throw new Exception('PHP-CLI required.'); } $package = 'juneszh/alight-admin'; $version = InstalledVersions::getPrettyVersion($package); - echo $version . PHP_EOL; if ($version[0] !== 'v') { echo 'Unable to download about version: ', $version, PHP_EOL; @@ -398,7 +397,9 @@ public static function download() exec('rm -rf ' . $dir . '/*'); } - if (copy($url, $file)) { + exec('wget -O ' . $file . ' ' . $url); + + if (file_exists($file)) { $phar = new PharData($file); $phar->decompress(); $phar->extractTo($dir);