From 634f6eeb0c93211555e6b4556c902d41de5933d7 Mon Sep 17 00:00:00 2001 From: eliot-akira Date: Sat, 25 Jan 2025 21:34:34 +0100 Subject: [PATCH] Use common loading pattern to support install as module or plugin --- index.php | 2 +- plugin.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index 2c1cfc8..b53cb60 100644 --- a/index.php +++ b/index.php @@ -23,7 +23,7 @@ function __call( $method = '', $args = [] ) { $caller = current( debug_backtrace() ); trigger_error("Undefined method \"$method\" for {$this->name}, called from {$caller['file']} in {$caller['line']}
", E_USER_WARNING); } - + function load() { // Parent plugin is expected to load framework diff --git a/plugin.php b/plugin.php index ebba2f7..5c4bb5b 100644 --- a/plugin.php +++ b/plugin.php @@ -10,8 +10,8 @@ define('TANGIBLE_FIELDS_IS_PLUGIN', true); $module_path = is_dir( - ($path = __DIR__ . '/vendor/tangible') -) ? $path : __DIR__ . '/..'; + ($path = __DIR__ . '/../../tangible') // Module +) ? $path : __DIR__ . '/vendor/tangible'; // Plugin require_once $module_path . '/framework/index.php'; require_once $module_path . '/updater/index.php';