v3knet/module
最新稳定版本:0.2.0
Composer 安装命令:
composer create-project v3knet/module
包简介
README 文档
README
Built-ins features
- Twig/Bootstrap/Google analytics/…
- Doctrine Cache, DBAL, ORM
- BernardPHP message queue
- SF2 Console (make your command as service, name it as
anything.command.the_name, then runphp cli.php, you see your command is auto registered) - Module system, check
./modules/systemas example. - Swagger UI
Usage
Require atphp/atsilex in your project's composer.json file:
{
"name": "v3knet/website",
"require": {
"atphp/atsilex": "^0.1.0"
},
"scripts": {
"post-install-cmd": [
"atsilex\\module\\system\\commands\\InstallerScript::execute"
]
},
"extra": {
"atsilex": {
"%site_name%": "My Project",
"%site_version%": "1.0-dev",
"%site_url%": "http://www.vendor-name.com/",
"%site_frontpage%": "hello",
"%site_ga_code%": "UA-1234567-890",
"%vendor_name%": "Vendor Name"
}
}
}
On composer install atsilex will setup default structure for for your application:
files/ # Directory to store temporary files (cache, compiled templates, …)
config.default.php # (*) Default
config.php # The file that return configuration for application.
public/ # Document root
/index.php # (*) Front controller
/assets/modules/* # Symlinks for modules's assets
# Don't edit (*), they will be overwritten in next composer install.
Write custom module
A module is basically a class which extends atsilex\module\Module. Each module can:
Define a module is simple, you also need tell the application about your module —
edit config.php, include your modules there:
return [ // … 'modules' => [ 'my_module' => 'MyModule', 'system' => 'atsilex\module\system\SystemModule', # Can't disable ], // … ];
Configure database connection
Default database for application is a SQLite file, it's auto created in files/app.db
when we run php public/index.php orm:schema-tool:create command.
To change default config for database connection, in config.php, add code similar to this:
# SQlite # $db_options = ['driver' => 'pdo_sqlite', 'path' => '/alternative/path/to/app.db']; # MySQL $db_options = [ 'driver' => 'pdo_mysql', 'host' => 'mysql_write.someplace.tld', 'dbname' => 'my_database', 'user' => 'my_username', 'password' => 'my_password', 'charset' => 'utf8mb4', ]; return [ // … 'db.options' => $db_options, // … ];
统计信息
- 总下载量: 182
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2015-08-09