Skip to content

Commit

Permalink
Update readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
juneszh committed Sep 5, 2022
1 parent 54923d4 commit 1485660
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 8 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
9 changes: 5 additions & 4 deletions src/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 1485660

Please sign in to comment.