dev-master
9999999-devyaf-library
MIT
The Requires
- php >=7.0
- ext-yaf *
- monolog/monolog ^1.13
- pimple/pimple ^3.0
- phpcasts/yaf-console *
- psr/simple-cache ^1.0@dev
The Development Requires
library yaf yaf-library
yaf-library
yaf框架本身是一个比较精简的MVC框架, 本身并没有提供其他类库, 本项目主要提供了一些常用到的组件:, (*1)
方式一(用于单项目):, (*2)
composer require phpcasts/yaf-library -vvv
方式二(用于多项目共享):, (*3)
git clone https://github.com/qloog/yaf-library
修改配置文件的: application.library = APP_PATH "/library" 为: application.library = APP_ROOT "/../yaf-library", (*4)
PS: yaf-library与项目在同一级目录, 达到多项目共享一套
yaf-library
的目的,便于维护和管理, (*5)
打开 conf/application.ini, 添加一下配置:, (*6)
; cache cache.type = redis cache.redis = default ; Redis redis.default.host = 127.0.0.1 redis.default.port = 6379 ;database database.driver = mysql database.host = localhost database.database = test database.username = root database.password = 123456 database.port = 3306 database.charset = utf8 database.collation = utf8_unicode_ci database.prefix = "" ; Log log.level = debug log.channel = default log.file.dir = APP_ROOT "/storage/logs"
一般定义在public/index.php文件中, (*7)
define('APP_ROOT', dirname(__DIR__)); define('APP_PATH', APP_ROOT . '/application');
以使用Cache为例:, (*8)
use PHPCasts\Yaf\Caches\Cache; ... $cache = Cache::getInstance(); $cache->set('test', 'test-value');
MIT, (*9)
yaf-library
MIT
library yaf yaf-library