Add config parameter PLUGINS_DIR
This commit is contained in:
@@ -28,8 +28,8 @@ class Loader extends \Core\Base
|
|||||||
*/
|
*/
|
||||||
public function scan()
|
public function scan()
|
||||||
{
|
{
|
||||||
if (file_exists(__DIR__.'/../../../plugins')) {
|
if (file_exists(PLUGINS_DIR)) {
|
||||||
$dir = new DirectoryIterator(__DIR__.'/../../../plugins');
|
$dir = new DirectoryIterator(PLUGINS_DIR);
|
||||||
|
|
||||||
foreach ($dir as $fileinfo) {
|
foreach ($dir as $fileinfo) {
|
||||||
if (! $fileinfo->isDot() && $fileinfo->isDir()) {
|
if (! $fileinfo->isDot() && $fileinfo->isDir()) {
|
||||||
@@ -65,7 +65,7 @@ class Loader extends \Core\Base
|
|||||||
*/
|
*/
|
||||||
public function loadSchema($plugin)
|
public function loadSchema($plugin)
|
||||||
{
|
{
|
||||||
$filename = __DIR__.'/../../../plugins/'.$plugin.'/Schema/'.ucfirst(DB_DRIVER).'.php';
|
$filename = PLUGINS_DIR.'/'.$plugin.'/Schema/'.ucfirst(DB_DRIVER).'.php';
|
||||||
|
|
||||||
if (file_exists($filename)) {
|
if (file_exists($filename)) {
|
||||||
require_once($filename);
|
require_once($filename);
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
defined('DEBUG') or define('DEBUG', false);
|
defined('DEBUG') or define('DEBUG', false);
|
||||||
defined('DEBUG_FILE') or define('DEBUG_FILE', __DIR__.'/../data/debug.log');
|
defined('DEBUG_FILE') or define('DEBUG_FILE', __DIR__.'/../data/debug.log');
|
||||||
|
|
||||||
|
// Plugin directory
|
||||||
|
defined('PLUGINS_DIR') or define('PLUGINS_DIR', __DIR__.'/../plugins');
|
||||||
|
|
||||||
// Application version
|
// Application version
|
||||||
defined('APP_VERSION') or define('APP_VERSION', 'master');
|
defined('APP_VERSION') or define('APP_VERSION', 'master');
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ define('DEBUG', false);
|
|||||||
// Debug file path
|
// Debug file path
|
||||||
define('DEBUG_FILE', __DIR__.'/data/debug.log');
|
define('DEBUG_FILE', __DIR__.'/data/debug.log');
|
||||||
|
|
||||||
|
// Plugins directory
|
||||||
|
define('PLUGINS_DIR', 'data/plugins');
|
||||||
|
|
||||||
// Folder for uploaded files, don't forget the trailing slash
|
// Folder for uploaded files, don't forget the trailing slash
|
||||||
define('FILES_DIR', 'data/files/');
|
define('FILES_DIR', 'data/files/');
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,14 @@ define('DEBUG_FILE', __DIR__.'/data/debug.log');
|
|||||||
All debug information are saved in this file.
|
All debug information are saved in this file.
|
||||||
If you prefer to send logs to `stdout` or `stderr` replace the value by `php://stdout` or `php://stderr`.
|
If you prefer to send logs to `stdout` or `stderr` replace the value by `php://stdout` or `php://stderr`.
|
||||||
|
|
||||||
|
Plugins folder
|
||||||
|
--------------
|
||||||
|
|
||||||
|
```php
|
||||||
|
// Plugin directory
|
||||||
|
define('PLUGINS_DIR', 'data/plugins');
|
||||||
|
```
|
||||||
|
|
||||||
Folder for uploaded files
|
Folder for uploaded files
|
||||||
-------------------------
|
-------------------------
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user