Skip to content
Snippets Groups Projects
Verified Commit 56b25b21 authored by Bartek Jaskulski's avatar Bartek Jaskulski
Browse files

refactor: minor readme update

parent 6decad77
No related branches found
No related tags found
2 merge requests!3improve into wp-hook and some additional unfinished things,!21.x
This commit is part of merge request !2. Comments created here will be created in the context of that merge request.
...@@ -30,11 +30,11 @@ The above limits your main plugin file to a short and simple structure. ...@@ -30,11 +30,11 @@ The above limits your main plugin file to a short and simple structure.
* Plugin Name: Example Plugin * Plugin Name: Example Plugin
*/ */
use WPDesk\Init; use WPDesk\Init\Init;
require __DIR__ . '/vendor/autoload.php'; require __DIR__ . '/vendor/autoload.php';
(new Init('config.php'))->boot(); Init::setup('config.php')->boot();
``` ```
### Plugin configuration ### Plugin configuration
...@@ -45,11 +45,13 @@ Supported configuration: ...@@ -45,11 +45,13 @@ Supported configuration:
```php ```php
<?php <?php
// TODO: docs about possible configuration keys
return [ return [
'services' => 'config/services.inc.php', 'services' => 'config/services.inc.php',
'hook_binding' => [], 'hook_resources_path' => [],
'cache_path' => 'generated', 'cache_path' => 'generated',
'requirements' => [], 'requirements' => [],
'plugin_class_name' => 'Example\Plugin', 'plugin_class_name' => 'Example\Plugin',
...@@ -90,12 +92,14 @@ use WPDesk\Init\PluginInit; ...@@ -90,12 +92,14 @@ use WPDesk\Init\PluginInit;
require __DIR__ . '/vendor/autoload.php'; require __DIR__ . '/vendor/autoload.php';
$plugin = (new PluginInit()) Init::setup(
->set_requirements([ [
'requirements' => [
'wp' => '6.0', 'wp' => '6.0',
'php' => '7.2' 'php' => '7.2'
]) ]
->boot(); ]
)->boot();
``` ```
## Credits ## Credits
...@@ -105,9 +109,9 @@ and Alain Schlesser's [`basic-scaffold`](https://github.com/mwpd/basic-scaffold) ...@@ -105,9 +109,9 @@ and Alain Schlesser's [`basic-scaffold`](https://github.com/mwpd/basic-scaffold)
## Roadmap ## Roadmap
1. Add support for path based hook providers discovery similar to Symfony's [controllers resolving](https://github.com/symfony/demo/blob/3787b9f71f6bee24f1ed0718b9a808d824008776/config/routes.yaml#L15-L17) ~1. Add support for path based hook providers discovery similar to Symfony's [controllers resolving](https://github.com/symfony/demo/blob/3787b9f71f6bee24f1ed0718b9a808d824008776/config/routes.yaml#L15-L17)~
1. Improve `wpdesk/wp-basic-requirements` library. This is not related directly to this project, but internals could be rewritten. 1. Improve `wpdesk/wp-basic-requirements` library. This is not related directly to this project, but internals could be rewritten.
1. Scrap plugin data from plugin comment ~1. Scrap plugin data from plugin comments.~
1. Support *bundles* of hook providers. This should be easy to extend plugin capabilities with shared functions, preserving minimal init system 1. Support *bundles* of hook providers. This should be easy to extend plugin capabilities with shared functions, preserving minimal init system
## License ## License
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment