Skip to content

Commit

Permalink
Component/Plugins: 43587, addendum - use absolute path for PLUGIN_BAS…
Browse files Browse the repository at this point in the history
…E_PATH
  • Loading branch information
nhaagen committed Jan 20, 2025
1 parent e1f0ef6 commit a69bbd6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
interface ilComponentRepository
{
public const PLUGIN_BASE_PATH = "Customizing/plugins";
public const PLUGIN_BASE_PATH = __DIR__ . '/../../../../public/Customizing/plugins';

/**
* Check if a component exists.
Expand Down
2 changes: 1 addition & 1 deletion components/ILIAS/Component/classes/class.ilPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ protected function updateDatabase(): int
$lng = $DIC->language();

$dbupdate = new ilPluginDBUpdate(
$this->db,
$ilDB,
$this->getPluginInfo()
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct(
$this->db = $db;
$this->plugin = $plugin;

$this->db_update_file = $this->PATH . $this->getDBUpdateScriptName();
$this->db_update_file = $this->getDBUpdateScriptName();

$this->current_version = $plugin->getCurrentDBVersion() ?? 0;

Expand Down
4 changes: 1 addition & 3 deletions components/ILIAS/Database/classes/class.ilDBUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class ilDBUpdate
protected Iterator $ctrl_structure_iterator;

protected string $error;
protected string $PATH = './';

protected array $filecontent;

Expand All @@ -47,7 +46,6 @@ public function __construct(ilDBInterface $a_db_handler, ilIniFile $client_ini =
{
$this->client_ini = $client_ini;
$this->db = $a_db_handler;
$this->PATH = "./";

$class_map = require ILIAS_ABSOLUTE_PATH . '/vendor/composer/vendor/composer/autoload_classmap.php';
$this->ctrl_structure_iterator = new ilCtrlArrayIterator($class_map);
Expand Down Expand Up @@ -256,7 +254,7 @@ private function readCustomUpdatesInfo(bool $a_force = false): void
}

$this->custom_updates_setting = new ilSetting();
$custom_updates_file = $this->PATH . './components/ILIAS/setup_/sql/dbupdate_custom.php';
$custom_updates_file = ILIAS_ABSOLUTE_PATH . '/components/ILIAS/setup_/sql/dbupdate_custom.php';
if (is_file($custom_updates_file)) {
$this->custom_updates_content = @file($custom_updates_file);
$this->custom_updates_current_version = (int) $this->custom_updates_setting->get('db_version_custom', '0');
Expand Down

0 comments on commit a69bbd6

Please sign in to comment.