mindtwo/lumen-wp-app

此包包含一个应用程序文件,用于在WordPress中配合一些Laravel组件使用Laravel-Lumen服务容器。

5.4 2023-07-05 18:01 UTC

This package is auto-updated.

Last update: 2024-09-05 20:38:11 UTC


README

Latest Version on Packagist Software License Coverage Status Quality Score Total Downloads

此包包含一个应用程序文件,用于在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)。有关更多信息,请参阅许可文件