Webman plugin smallruraldog/admin

Installs: 12

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:JavaScript

1.0.35 2024-08-13 04:35 UTC

This package is auto-updated.

Last update: 2024-11-13 05:14:15 UTC


README

创建 webman 项目

composer create-project workerman/webman project-name

安装扩展

composer require smallruraldog/admin

更新扩展

composer update smallruraldog/admin

创建.env 文件

ADMIN_ROUTE_SUFFIX=admin
ADMIN_DOMAIN=

DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=webman-admin
DB_USERNAME=root
DB_PASSWORD=
DB_SOCKET=

配置 database.php

return [
    'default' => 'mysql',
    'connections' => [
        'mysql' => [
            'driver' => 'mysql',
            'host' => getenv('DB_HOST'),
            'port' => getenv('DB_PORT'),
            'database' => getenv('DB_DATABASE'),
            'username' => getenv('DB_USERNAME'),
            'password' => getenv('DB_PASSWORD'),
            'unix_socket' => getenv('DB_SOCKET'),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'strict'      => true,
            'engine'      => null,
        ],
    ],
];

初始化数据,只需要在首次安装时执行

php webman smallruraldog-admin:install

发布资源文件,如果有更新,需要重新发布

php webman smallruraldog-admin:assets

启动项目

php start.php start

访问后台

http://0.0.0.0:8787/admin

加入文件监听

修改配置文件 config/process.php 加入以下代码到 monitorDir 数组中

base_path() . '/admin',

修改监进程文件 process\Monitor.php 注释掉以下两行代码

if (DIRECTORY_SEPARATOR === '/' && isset($this->loadedFiles[$file->getRealPath()])) {
    //echo "$file updated but cannot be reloaded because only auto-loaded files support reload.\n";
    //continue;
}