Skip to content

Commit

Permalink
Use common loading pattern to support install as module or plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
eliot-akira committed Jan 25, 2025
1 parent 92ce019 commit 634f6ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function __call( $method = '', $args = [] ) {
$caller = current( debug_backtrace() );
trigger_error("Undefined method \"$method\" for {$this->name}, called from <b>{$caller['file']}</b> in <b>{$caller['line']}</b><br>", E_USER_WARNING);
}

function load() {

// Parent plugin is expected to load framework
Expand Down
4 changes: 2 additions & 2 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 634f6ee

Please sign in to comment.