Skip to content

Commit

Permalink
More plugin class optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
CaMer0n committed Jan 13, 2019
1 parent c63574c commit 4becf60
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 9 additions & 3 deletions e107_handlers/plugin_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ function __construct()

if(empty($this->_ids))
{
// e107::getDebug()->log("Running e_plugin::_initIDs()");
// e107::getDebug()->log(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS));
$this->_initIDs();
}

Expand Down Expand Up @@ -517,11 +519,15 @@ private function _initIDs()
$path = $row['plugin_path'];
$this->_ids[$path] = (int) $row['plugin_id'];

if(!empty($row['plugin_installflag']) && !isset($pref[$path]))
if(!empty($row['plugin_installflag']) )
{
$this->_installed[$path] = $row['plugin_version'];
$cfg->setPref('plug_installed/'.$path, $row['plugin_version']);
$save = true;

if(!isset($pref[$path]))
{
$cfg->setPref('plug_installed/'.$path, $row['plugin_version']);
$save = true;
}
}

$this->_addons[$path] = !empty($row['plugin_addons']) ? explode(',',$row['plugin_addons']) : null;// $path;
Expand Down
6 changes: 5 additions & 1 deletion e107_handlers/pref_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,11 @@ public function save($from_post = true, $force = false, $session_messages = null
{
if(!$disallow_logs) $log->logMessage('Backup of <strong>'.$this->alias.' ('.$this->prefid.')</strong> successfully created.', E_MESSAGE_DEBUG, E_MESSAGE_SUCCESS, $session_messages);
e107::getCache()->clear_sys('Config_'.$this->alias.'_backup');
e107::getDebug()->log(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,2));
if(deftrue('e_DEBUG'))
{
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,2);
$log->logMessage(print_a($backtrace,true), E_MESSAGE_DEBUG);
}
}

}
Expand Down

0 comments on commit 4becf60

Please sign in to comment.