bluzphp/skeleton
Composer 安装命令:
composer require bluzphp/skeleton
包简介
Skeleton application for Bluz, a lightweight PHP framework
README 文档
README
Easy to setup, easy to use. Skeleton application
Achievements
Installation
Bluz works with PHP 7.0 or later and MySQL 5.4 or later (please check requirements)
I.a. From composer
Download composer.phar, it's easy:
curl -s https://getcomposer.org/installer | php
Run create-project command (replace %path% ;):
php composer.phar create-project bluzphp/skeleton %path% --stability=dev
I.b. From repository
Get Bluz skeleton source files from GitHub repository:
git clone git://github.com/bluzphp/skeleton.git %path%
Download composer.phar to the project folder:
cd %path% curl -s https://getcomposer.org/installer | php
Install composer dependencies with the following command:
php composer.phar install
I.c. With PhpStorm
For install you need any web-server (for Windows) and PhpStorm. dows) и PhpStorm.
Create project in PhpStorm:
- File -> New project;
- Set the project name and location;
- In a Project type field choose Composer project;
- Check that radiobutton is set opposite "Download composer.phar from getcomposer.org", type in a search field "bluzphp/skeleton", select this package in Available packages window and click OK.
- After that file composer.phar and all dependencies will be loaded.
II. Configuration
Edit your configuration's files /path/to/application/configs/dev/*.php (configuration for development environment).
I think you need to change only
db.phpfor first run
III. Setup database
To run the migrations, execute the command:
/path/to/vendor/bin/bluzman db:migrate
To fill database with data example, execute the command:
/path/to/vendor/bin/bluzman db:seed:run
IV.a. Run built-in web-server
You can run internal PHP web-server with simple console tool:
/path/to/vendor/bin/bluzman server:start --host[="..."] --port[="..."]
IV.b. Use Apache
Or create symlink to Apache document root (required FollowSymlinks option):
# for Linux
ln -s /path/to/public /path/to/web
# for Windows
mklink /D /path/to/web path/to/public
Usage
You can create models, controllers and views with Bluzman console tool, or following old school style:
Model
Model consists from two classes Table and Row:
<?php namespace Application\Users; class Table extends \Bluz\Db\Table { protected $table = 'users'; protected $primary = ['id']; }
<?php namespace Application\Users; /** * @property integer $id * @property string $login */ class Row extends \Bluz\Db\Row { }
Controller
Controller is file with anonymous function:
<?php namespace Application; /** * @privilege ViewProfile * @cache 5 minutes * @param integer $id * @return array */ return function($id) { return [ 'user' => Users\Table::findRow($id) ]; };
View
View is native:
<h2><?=$user->login?></h2>
Documentation
Demo
License
The project is developed by NIX PHP team and distributed under MIT LICENSE
NIX has OEM License of Redactor. Full text of Redactor License you can read at http://imperavi.com/redactor/license/
Vendors
bluzphp/skeleton 适用场景与选型建议
bluzphp/skeleton 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.73k 次下载、GitHub Stars 达 40, 最近一次更新时间为 2012 年 11 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 bluzphp/skeleton 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bluzphp/skeleton 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.73k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 43
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2012-11-27