dbould/davework

框架生成器

0.1.8-alpha 2018-10-25 09:40 UTC

This package is not auto-updated.

Last update: 2024-09-21 14:35:52 UTC


README

框架生成器。

目前仅支持Slim Framework。

安装

composer require --dev dbould/davework
cp vendor/dbould/davework.json.example myProjectRoot/davework.json

我目前正在修复Phar存档,完成时我会添加链接和说明。

配置

topLevelNamespace

示例

{
    "topLevelNamespace": "Dbould\\Davework"
}

rootDirectory

顶级代码目录示例

{
    "rootDirectory": "src/"
}

testNamespace

示例

{
    "testNamespace": "Test"
}

testsDirectory

示例

{
    "testsDirectory": "test/"
}

factoriesLiveWithClasses

可选。如果设置为true,则工厂文件将与关联的类文件在相同的目录中创建。如果设置为false,则工厂文件将放入一个单独的Factory/目录中。示例

{
    "factoriesLiveWithClasses": false
}

命令

创建带有关联文件的新文件。不需要在文件名末尾追加文件类型,它将为您添加。

vendor/bin/davework slim:create-file fileName type [moduleName]

测试

运行所有测试套件

vendor/bin/phpunit

运行所有功能测试

vendor/bin/phpunit tests/Functional

运行所有单元测试

vendor/bin/phpunit tests/Unit

生成PHAR存档

通过Box https://github.com/box-project/box2 生成

vendor/bin/box build -v