Code Monkey home page Code Monkey logo

admin's Introduction

webman admin

创建 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;
}

admin's People

Contributors

smallruraldog avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.