/** * Sets {@link $source} property to one of plugin_manager::PLUGIN_SOURCE_xxx * constants. * * If the property's value is null after calling this method, then * the type of the plugin has not been recognized and you should throw * an exception. */ public function init_is_standard() { $standard = plugin_manager::standard_plugins_list($this->type); if ($standard !== false) { $standard = array_flip($standard); if (isset($standard[$this->name])) { $this->source = plugin_manager::PLUGIN_SOURCE_STANDARD; } else { if (!is_null($this->versiondb) and is_null($this->versiondisk) and plugin_manager::is_deleted_standard_plugin($this->type, $this->name)) { $this->source = plugin_manager::PLUGIN_SOURCE_STANDARD; // to be deleted } else { $this->source = plugin_manager::PLUGIN_SOURCE_EXTENSION; } } } }
/** * @see plugintype_interface::set_source() */ public function set_source() { $standard = plugin_manager::standard_plugins_list($this->type); if ($standard !== false) { $standard = array_flip($standard); if (isset($standard[$this->name])) { $this->source = plugin_manager::PLUGIN_SOURCE_STANDARD; } else { $this->source = plugin_manager::PLUGIN_SOURCE_EXTENSION; } } }