| 1 |
<?php |
| 2 |
/** |
| 3 |
* Configuration class. |
| 4 |
* |
| 5 |
* |
| 6 |
* @package depicter |
| 7 |
* @license LICENSE.txt |
| 8 |
* @author averta |
| 9 |
* @link https://depicter.com/ |
| 10 |
*/ |
| 11 |
|
| 12 |
|
| 13 |
if( ! defined( 'DEPICTER_REVISIONS' ) ){ |
| 14 |
define( 'DEPICTER_REVISIONS', 15 ); |
| 15 |
} |
| 16 |
|
| 17 |
return [ |
| 18 |
/** |
| 19 |
* Array of service providers you wish to enable. |
| 20 |
*/ |
| 21 |
'providers' => [ |
| 22 |
\WPEmergeAppCore\AppCore\AppCoreServiceProvider::class, |
| 23 |
\WPEmergeAppCore\Assets\AssetsServiceProvider::class, |
| 24 |
\WPEmergeAppCore\Avatar\AvatarServiceProvider::class, |
| 25 |
\WPEmergeAppCore\Config\ConfigServiceProvider::class, |
| 26 |
\WPEmergeAppCore\Image\ImageServiceProvider::class, |
| 27 |
\WPEmergeAppCore\Sidebar\SidebarServiceProvider::class, |
| 28 |
\Depicter\Security\SecurityServiceProvider::class, |
| 29 |
\Depicter\Middleware\MiddlewareServiceProvider::class, |
| 30 |
\Depicter\Services\ServiceProvider::class, |
| 31 |
\Depicter\Routing\RouteConditionsServiceProvider::class, |
| 32 |
\Depicter\DataSources\ServiceProvider::class, |
| 33 |
\Depicter\Document\ServiceProvider::class, |
| 34 |
\Depicter\Database\DatabaseServiceProvider::class, |
| 35 |
\Depicter\Editor\EditorServiceProvider::class, |
| 36 |
\Depicter\Dashboard\DashboardServiceProvider::class, |
| 37 |
\Depicter\Front\ServiceProvider::class, |
| 38 |
\Depicter\View\ViewServiceProvider::class, |
| 39 |
\Depicter\WordPress\RestApiServiceProvider::class, |
| 40 |
\Depicter\WordPress\AdminServiceProvider::class, |
| 41 |
\Depicter\WordPress\AssetsServiceProvider::class, |
| 42 |
\Depicter\WordPress\EventsServiceProvider::class, |
| 43 |
\Depicter\WordPress\ShortcodesServiceProvider::class, |
| 44 |
\Depicter\WordPress\PluginServiceProvider::class, |
| 45 |
\Depicter\WordPress\WidgetsServiceProvider::class, |
| 46 |
\Depicter\WordPress\SVGServiceProvider::class, |
| 47 |
\Depicter\WordPress\PermissionsServiceProvider::class, |
| 48 |
\Depicter\Modules\ModulesServiceProvider::class |
| 49 |
], |
| 50 |
|
| 51 |
/** |
| 52 |
* Array of route group definitions and default attributes. |
| 53 |
* All of these are optional so if we are not using |
| 54 |
* a certain group of routes we can skip it. |
| 55 |
* If we are not using routing at all we can skip |
| 56 |
* the entire 'routes' option. |
| 57 |
*/ |
| 58 |
'routes' => [ |
| 59 |
'web' => [ |
| 60 |
'definitions' => __DIR__ . DIRECTORY_SEPARATOR . 'routes' . DIRECTORY_SEPARATOR . 'web.php', |
| 61 |
'attributes' => [ |
| 62 |
'namespace' => 'Depicter\\Controllers\\Web\\', |
| 63 |
], |
| 64 |
], |
| 65 |
'admin' => [ |
| 66 |
'definitions' => __DIR__ . DIRECTORY_SEPARATOR . 'routes' . DIRECTORY_SEPARATOR . 'admin.php', |
| 67 |
'attributes' => [ |
| 68 |
'namespace' => 'Depicter\\Controllers\\Admin\\', |
| 69 |
], |
| 70 |
], |
| 71 |
'ajax' => [ |
| 72 |
'definitions' => __DIR__ . DIRECTORY_SEPARATOR . 'routes' . DIRECTORY_SEPARATOR . 'ajax.php', |
| 73 |
'attributes' => [ |
| 74 |
'namespace' => 'Depicter\\Controllers\\Ajax\\', |
| 75 |
], |
| 76 |
], |
| 77 |
], |
| 78 |
|
| 79 |
/** |
| 80 |
* View Composers settings. |
| 81 |
*/ |
| 82 |
'view_composers' => [ |
| 83 |
'namespace' => 'Depicter\\ViewComposers\\', |
| 84 |
], |
| 85 |
|
| 86 |
/** |
| 87 |
* Register middleware class aliases. |
| 88 |
* Use fully qualified middleware class names. |
| 89 |
* |
| 90 |
* Internal aliases that you should avoid overriding: |
| 91 |
* - 'flash' |
| 92 |
* - 'old_input' |
| 93 |
* - 'csrf' |
| 94 |
* - 'user.logged_in' |
| 95 |
* - 'user.logged_out' |
| 96 |
* - 'user.can' |
| 97 |
*/ |
| 98 |
'middleware' => [ |
| 99 |
'cache' => \Depicter\Middleware\CacheMiddleware::class, |
| 100 |
'cors' => \Depicter\Middleware\CORSMiddleware::class, |
| 101 |
'csrf-api' => \Depicter\Middleware\CsrfAPIMiddleware::class, |
| 102 |
'nonce' => \Depicter\Middleware\NonceFieldMiddleware::class, |
| 103 |
'userCan' => \Depicter\Middleware\CapabilityMiddleware::class |
| 104 |
], |
| 105 |
|
| 106 |
/** |
| 107 |
* Register middleware groups. |
| 108 |
* Use fully qualified middleware class names or registered aliases. |
| 109 |
* There are a couple built-in groups that you may override: |
| 110 |
* - 'web' - Automatically applied to web routes. |
| 111 |
* - 'admin' - Automatically applied to admin routes. |
| 112 |
* - 'ajax' - Automatically applied to ajax routes. |
| 113 |
* - 'global' - Automatically applied to all of the above. |
| 114 |
* - 'wpemerge' - Internal group applied the same way 'global' is. |
| 115 |
* |
| 116 |
* Warning: The 'wpemerge' group contains some internal WP Emerge |
| 117 |
* middleware which you should avoid overriding. |
| 118 |
*/ |
| 119 |
'middleware_groups' => [ |
| 120 |
'global' => [], |
| 121 |
'web' => [], |
| 122 |
'ajax' => [], //['csrf:_masterCsrfToken'], |
| 123 |
'admin' => [], |
| 124 |
], |
| 125 |
|
| 126 |
/** |
| 127 |
* Optionally specify middleware execution order. |
| 128 |
* Use fully qualified middleware class names. |
| 129 |
*/ |
| 130 |
'middleware_priority' => [ |
| 131 |
// phpcs:ignore |
| 132 |
// \Depicter\Middleware\MyMiddlewareThatShouldRunFirst::class, |
| 133 |
// \Depicter\Middleware\MyMiddlewareThatShouldRunSecond::class, |
| 134 |
], |
| 135 |
|
| 136 |
/** |
| 137 |
* Custom directories to search for views. |
| 138 |
* Use absolute paths or leave blank to disable. |
| 139 |
* Applies only to the default PhpViewEngine. |
| 140 |
*/ |
| 141 |
'views' => [ dirname( __DIR__ ) . DIRECTORY_SEPARATOR . 'views' ], |
| 142 |
|
| 143 |
/** |
| 144 |
* App Core configuration. |
| 145 |
*/ |
| 146 |
'app_core' => [ |
| 147 |
'path' => dirname( __DIR__ ), |
| 148 |
'url' => plugin_dir_url( DEPICTER_PLUGIN_FILE ), |
| 149 |
], |
| 150 |
|
| 151 |
/** |
| 152 |
* Debug settings. |
| 153 |
*/ |
| 154 |
'debug' => [ |
| 155 |
// Enable debug mode. Defaults to the value of WP_DEBUG. |
| 156 |
'enable' => true, |
| 157 |
// Enable the use of filp/whoops for an enhanced error interface. Defaults to true. |
| 158 |
'pretty_errors' => false |
| 159 |
], |
| 160 |
|
| 161 |
/** |
| 162 |
* Other config goes after this comment. |
| 163 |
*/ |
| 164 |
|
| 165 |
]; |
| 166 |
|