本文整理汇总了PHP中Gpf_Plugins_Engine::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Gpf_Plugins_Engine::getInstance方法的具体用法?PHP Gpf_Plugins_Engine::getInstance怎么用?PHP Gpf_Plugins_Engine::getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gpf_Plugins_Engine
的用法示例。
在下文中一共展示了Gpf_Plugins_Engine::getInstance方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: execute
public function execute() {
if(Gpf_Plugins_Engine::getInstance()->getConfiguration()->isPluginActive('AffiliateNetwork')){
$Merchant = new Gpf_Db_Role();
$Merchant->setId(Pap_Application::DEFAULT_ROLE_MERCHANT);
$Merchant->load();
$Merchant->setName('Network Owner');
$Merchant->save();
}
}
示例2: isPluginActive
protected function isPluginActive($codename)
{
if (Gpf_Plugins_Engine::getInstance()->getConfiguration()->isPluginActive($codename)) {
return "true";
}
return "false";
}
示例3: onStart
protected function onStart() {
parent::onStart();
Gpf_Paths::getInstance()->saveServerUrlSettings();
Gpf_Plugins_Engine::getInstance()->getAvailablePlugins();
}
示例4: check
public function check()
{
if (!Gpf_Plugins_Engine::getInstance()->getConfiguration()->isPluginActive($this->pluginCode)) {
throw new Gpf_Exception($this->_("Required plugin %s is not active", $this->pluginCode));
}
$plugin = Gpf_Plugins_Engine::getInstance()->findPlugin($this->pluginCode);
if (version_compare($plugin->getVersion(), $this->minVersion) < 0) {
throw new Gpf_Exception($this->_("Required plugin %s has to be in version %s or higher", $this->pluginCode, $this->minVersion));
}
}
示例5: updateAccountDirectory
protected function updateAccountDirectory()
{
if ($this->isPending('clearTemplatesCache', $this->_('Clearing templates cache'))) {
try {
$this->removeTemplateCache();
} catch (Exception $e) {
}
$this->setDoneAndInterrupt();
}
if ($this->isPending('copyTemplates', $this->_('Installing templates'))) {
$this->copyTemplates();
$this->setDoneAndInterrupt();
}
if ($this->isPending('updateEngineConfig', $this->_('Updating plugin engine'))) {
Gpf_Plugins_Engine::getInstance()->refreshConfiguration();
$this->setDone();
}
$this->importLanguages();
}
示例6: onActivate
public function onActivate() {
if (!Gpf_Plugins_Engine::getInstance()->getConfiguration()->isPluginActive(Pap_Features_CommissionGroups_Definition::CODE_NAME)) {
throw new Gpf_Exception($this->_('Plugin can not be activated because Commissions Group feature is not activated!'));
}
}
示例7: execute
public function execute() {
if (in_array(Pap_Features_SplitCommissions_Definition::CODE ,Gpf_Plugins_Engine::getInstance()->getConfiguration()->getActivePlugins())) {
$this->deleteSplitCommissionsMailTemplate();
$this->createSplitCommissionsMailTemplate();
}
}
示例8: execute
public function execute() {
if (in_array(Pap_Features_SplitCommissions_Definition::CODE ,Gpf_Plugins_Engine::getInstance()->getConfiguration()->getActivePlugins())) {
$template = new Pap_Mail_SplitCommissionsMerchantOnSale();
$template->setup(Gpf_Session::getAuthUser()->getAccountId());
}
}
示例9: addPlugins
private function addPlugins()
{
$plugins = new Gpf_Data_IndexedRecordSet('name');
$plugins->setHeader(array('name'));
foreach (Gpf_Plugins_Engine::getInstance()->getConfiguration()->getActivePlugins() as $pluginCode) {
$plugins->add(array($pluginCode));
}
Gpf_Rpc_CachedResponse::addById($plugins, self::PLUGINS);
}
示例10: setActivePlugins
private function setActivePlugins(Gpf_Data_RecordSet $inputResult)
{
$actualConfiguration = Gpf_Plugins_Engine::getInstance()->getConfiguration();
if ($actualConfiguration === null) {
if (defined('ENABLE_ENGINECONFIG_LOG')) {
Gpf_Log::error('Plugin engine configuration is incorrect');
}
throw new Gpf_Exception("Plugin engine configuration is incorrect");
}
foreach ($inputResult as $record) {
$codename = $record->get(Gpf_Plugins_Definition::CODE);
if ($actualConfiguration->isPluginActive($codename)) {
if (defined('ENABLE_ENGINECONFIG_LOG')) {
Gpf_Log::info('setActivePlugins with plugin: ' . $codename . ' - activating');
}
$record->set(Gpf_Plugins_Definition::ACTIVE, 'Y');
} else {
if (defined('ENABLE_ENGINECONFIG_LOG')) {
Gpf_Log::info('setActivePlugins with plugin: ' . $codename . ' - deactivating');
}
$record->set(Gpf_Plugins_Definition::ACTIVE, 'N');
}
}
return $inputResult;
}
示例11: onDeactivate
public function onDeactivate() {
if (Gpf_Plugins_Engine::getInstance()->getConfiguration()->isPluginActive('AffiliateNetwork')) {
throw new Gpf_Exception($this->_('Multiple merchants feature can not be dactivated when Affiliate network is active'));
}
}