mindtwo / lumen-wp-app
此包包含一个应用程序文件,用于在WordPress中配合一些Laravel组件使用Laravel-Lumen服务容器。
5.4
2023-07-05 18:01 UTC
Requires
- php: ^8.1
- illuminate/cache: ^10.0
- illuminate/config: ^10.0
- illuminate/container: ^10.0
- illuminate/contracts: ^10.0
- illuminate/encryption: ^10.0
- illuminate/events: ^10.0
- illuminate/filesystem: ^10.0
- illuminate/hashing: ^10.0
- illuminate/http: ^10.0
- illuminate/log: ^10.0
- illuminate/support: ^10.0
- illuminate/translation: ^10.0
- illuminate/validation: ^10.0
- symfony/error-handler: ^6.1
- symfony/var-dumper: ^6.1
- vlucas/phpdotenv: ^5.4.1
Requires (Dev)
- mockery/mockery: ^1.4.4
- phpunit/phpunit: ^10.0
README
此包包含一个应用程序文件,用于在WordPress中配合一些Laravel组件使用Laravel-Lumen服务容器。
安装
通过Composer
$ composer require mindtwo/lumen-wp-app
使用方法
创建一个类似这样的bootstrap/app.php
文件
<?php require_once dirname(__DIR__).'/vendor/autoload.php'; (new LumenWpApp\LoadEnvironmentVariables( dirname(__DIR__) ))->bootstrap(); /* |-------------------------------------------------------------------------- | Create The Application |-------------------------------------------------------------------------- | | Here we will load the environment and create the application instance | that serves as the central piece of this framework. We'll use this | application as an "IoC" container and router for this framework. | */ $app = new LumenWpApp\Application( dirname(__DIR__) ); /* |-------------------------------------------------------------------------- | Load The Application |-------------------------------------------------------------------------- */ $app->configure('app'); $app->configure('cache'); $app->configure('database'); $app->configure('filesystems'); $app->configure('logging'); $app->configure('services'); /* |-------------------------------------------------------------------------- | Load The Application |-------------------------------------------------------------------------- */ return $app;
在您的wp-config.php
文件中
/** Load Application */ $app = require_once(realpath(__DIR__ . '/../bootstrap/app.php'));
在您的functions.php
文件中
$app->registerConfiguredProviders()->boot();
变更日志
有关最近更改的更多信息,请参阅变更日志。
测试
$ composer test
贡献
安全
如果您发现任何安全问题,请通过电子邮件info@mindtwo.de联系,而不是使用问题跟踪器。
鸣谢
许可协议
MIT许可协议(MIT)。有关更多信息,请参阅许可文件。