chenyuanqi / yii2-smvc

yii2 service & mvc template.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yii2-smvc

yii2 service & mvc template.

requirement

  • Nginx 1.8+
  • PHP 5.4+
  • Mysql 5.6+
  • Redis 3.0+

structure

-- api (example program)
-- commands
    -- controllers (define your command)
-- common
    -- assets (common assets)
    -- base (base class)
    -- components (common components)
    -- datas (common datas)
    -- helpers (common helpers class)
    -- migrations (common migrations script)
    -- models (common models)
    -- services (common services logic)
    -- traits (common traits)
    -- views (common h5 views and some template)
    -- widgets (common widgets)
    -- workers (common queue workers)
-- config (global config)
-- route (route rule)
-- tests (unit test case)
-- runtime (live with cache and logger)

preparation

# download repertory
git clone https://github.com/chenyuanqi/yii2-smvc.git
cd yii2-smvc
# install dependent
composer install
# setting
cp .env.example .env
vim .env

others

  • migrate example
./yii migrate/create create_tests_table -p=common/migrations
./yii migrate/up -p=common/migrations/
  • supervisorctl manage queue
sudo supervisorctl -c /etc/supervisord.conf status
sudo supervisorctl -c /etc/supervisord.conf stop cube-queue
sudo supervisorctl -c /etc/supervisord.conf start cube-queue
./yii queue cube_queue 1 15000

About

yii2 service & mvc template.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:PHP 94.7%Language:Shell 2.7%Language:CSS 1.6%Language:Batchfile 0.9%