• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CAgent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中CAgent的典型用法代码示例。如果您正苦于以下问题:PHP CAgent类的具体用法?PHP CAgent怎么用?PHP CAgent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了CAgent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: actualizeAgent

 /**
  * @param null $mailingId
  * @param null $mailingChainId
  * @throws \Bitrix\Main\ArgumentException
  */
 public static function actualizeAgent($mailingId = null, $mailingChainId = null)
 {
     $agent = new \CAgent();
     $isSendByTimeMethodCron = \COption::GetOptionInt("sender", "auto_method") === 'cron';
     $arFilter = array();
     if ($mailingId) {
         $arFilter['=MAILING_ID'] = $mailingId;
     }
     if ($mailingChainId) {
         $arFilter['=ID'] = $mailingChainId;
     }
     $mailingChainDb = MailingChainTable::getList(array('select' => array('ID', 'STATUS', 'AUTO_SEND_TIME', 'MAILING_ACTIVE' => 'MAILING.ACTIVE'), 'filter' => $arFilter));
     while ($mailingChain = $mailingChainDb->fetch()) {
         $agentName = static::getAgentName($mailingChain['ID']);
         $rsAgents = $agent->GetList(array("ID" => "DESC"), array("MODULE_ID" => "sender", "NAME" => $agentName));
         while ($arAgent = $rsAgents->Fetch()) {
             $agent->Delete($arAgent["ID"]);
         }
         if ($isSendByTimeMethodCron || $mailingChain['REITERATE'] != 'Y' && empty($mailingChain['AUTO_SEND_TIME'])) {
             continue;
         }
         if ($mailingChain['MAILING_ACTIVE'] == 'Y' && $mailingChain['STATUS'] == MailingChainTable::STATUS_SEND) {
             if (!empty($mailingChain['AUTO_SEND_TIME'])) {
                 $dateExecute = $mailingChain['AUTO_SEND_TIME'];
             } else {
                 $dateExecute = "";
             }
             $agent->AddAgent($agentName, "sender", "N", 0, null, "Y", $dateExecute);
         }
     }
 }
开发者ID:akniyev,项目名称:arteva.ru,代码行数:36,代码来源:mailingmanager.php


示例2: execute

 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     @set_time_limit(0);
     @ignore_user_abort(true);
     define('CHK_EVENT', true);
     $agentManager = new \CAgent();
     $agentManager->CheckAgents();
     define('BX_CRONTAB_SUPPORT', true);
     define('BX_CRONTAB', true);
     $eventManager = new \CEvent();
     $eventManager->CheckEvents();
 }
开发者ID:notamedia,项目名称:console-jedi,代码行数:15,代码来源:ExecuteCommand.php


示例3: InstallDB

	function InstallDB()
	{
		global $DB, $APPLICATION;

		$this->errors = false;
		if(!$DB->Query("SELECT 'x' FROM b_pull_stack", true))
			$this->errors = $DB->RunSQLBatch($_SERVER['DOCUMENT_ROOT']."/bitrix/modules/pull/install/db/".strtolower($DB->type)."/install.sql");

		if($this->errors !== false)
		{
			$APPLICATION->ThrowException(implode("", $this->errors));
			return false;
		}

		RegisterModule("pull");
		RegisterModuleDependences("main", "OnProlog", "main", "", "", 3, "/modules/pull/ajax_hit.php");
		RegisterModuleDependences("perfmon", "OnGetTableSchema", "pull", "CPullTableSchema", "OnGetTableSchema");
		RegisterModuleDependences("main", "OnAfterRegisterModule", "pull", "CPullOptions", "ClearCheckCache");
		RegisterModuleDependences("main", "OnAfterUnRegisterModule", "pull", "CPullOptions", "ClearCheckCache");

		COption::SetOptionString("pull", "path_to_listener", (CMain::IsHTTPS() ? "https" : "http")."://#DOMAIN#".(CMain::IsHTTPS() ? ":8894" : ":8893").'/bitrix/sub/');
		COption::SetOptionString("pull", "path_to_websocket", (CMain::IsHTTPS() ? "wss" : "ws")."://#DOMAIN#".(CMain::IsHTTPS() ? ":8894" : ":8893").'/bitrix/subws/');
		COption::SetOptionString("pull", "path_to_publish", 'http://127.0.0.1:8895/bitrix/pub/');
		COption::SetOptionString("pull", "websocket", 'N');
		COption::SetOptionString("pull", "nginx", 'N');
		COption::SetOptionString("pull", "push", 'N');

		CAgent::AddAgent("CPullOptions::ClearAgent();", "pull", "N", 30, "", "Y", ConvertTimeStamp(time()+CTimeZone::GetOffset()+30, "FULL"));

		return true;
	}
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:31,代码来源:index.php


示例4: InstallDB

 function InstallDB($arParams = array())
 {
     global $DB, $DBType, $APPLICATION;
     $this->errors = false;
     // Database tables creation
     $bDBInstall = !$DB->Query("SELECT 'x' FROM b_workflow_document WHERE 1=0", true);
     if ($bDBInstall) {
         $this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/workflow/install/db/" . $DBType . "/install.sql");
     }
     if ($this->errors !== false) {
         $APPLICATION->ThrowException(implode("<br>", $this->errors));
         return false;
     } else {
         RegisterModule("workflow");
         CModule::IncludeModule("workflow");
         if ($bDBInstall) {
             $obWorkflowStatus = new CWorkflowStatus();
             $obWorkflowStatus->Add(array("~TIMESTAMP_X" => $DB->GetNowFunction(), "C_SORT" => 300, "ACTIVE" => "Y", "TITLE" => GetMessage("FLOW_INSTALL_PUBLISHED"), "IS_FINAL" => "Y", "NOTIFY" => "N"));
             $obWorkflowStatus->Add(array("~TIMESTAMP_X" => $DB->GetNowFunction(), "C_SORT" => 100, "ACTIVE" => "Y", "TITLE" => GetMessage("FLOW_INSTALL_DRAFT"), "IS_FINAL" => "N", "NOTIFY" => "N"));
             $obWorkflowStatus->Add(array("~TIMESTAMP_X" => $DB->GetNowFunction(), "C_SORT" => 200, "ACTIVE" => "Y", "TITLE" => GetMessage("FLOW_INSTALL_READY"), "IS_FINAL" => "N", "NOTIFY" => "Y"));
         }
         RegisterModuleDependences("main", "OnPanelCreate", "workflow", "CWorkflow", "OnPanelCreate", "200");
         RegisterModuleDependences("main", "OnChangeFile", "workflow", "CWorkflow", "OnChangeFile");
         //agents
         CAgent::RemoveAgent("CWorkflow::CleanUp();", "workflow");
         CAgent::AddAgent("CWorkflow::CleanUp();", "workflow", "N");
         return true;
     }
 }
开发者ID:Satariall,项目名称:izurit,代码行数:29,代码来源:index.php


示例5: UnInstallDB

 function UnInstallDB($arParams = array())
 {
     global $DB, $DBType, $APPLICATION;
     $this->errors = false;
     if (!array_key_exists("save_tables", $arParams) || $arParams["save_tables"] != "Y") {
         $this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sender/install/db/" . $DBType . "/uninstall.sql");
     }
     CAgent::RemoveModuleAgents('sender');
     UnRegisterModuleDependences("main", "OnMailEventMailRead", "sender", "bitrix\\sender\\postingmanager", "onMailEventMailRead");
     UnRegisterModuleDependences("main", "OnMailEventMailClick", "sender", "bitrix\\sender\\postingmanager", "onMailEventMailClick");
     UnRegisterModuleDependences("main", "OnMailEventSubscriptionDisable", "sender", "Bitrix\\Sender\\Subscription", "onMailEventSubscriptionDisable");
     UnRegisterModuleDependences("main", "OnMailEventSubscriptionEnable", "sender", "Bitrix\\Sender\\Subscription", "onMailEventSubscriptionEnable");
     UnRegisterModuleDependences("main", "OnMailEventSubscriptionList", "sender", "Bitrix\\Sender\\Subscription", "onMailEventSubscriptionList");
     UnRegisterModuleDependences("sender", "OnConnectorList", "sender", "bitrix\\sender\\connectormanager", "onConnectorListContact");
     UnRegisterModuleDependences("sender", "OnConnectorList", "sender", "bitrix\\sender\\connectormanager", "onConnectorListRecipient");
     UnRegisterModuleDependences("sender", "OnPresetTemplateList", "sender", "Bitrix\\Sender\\Preset\\TemplateBase", "onPresetTemplateList");
     UnRegisterModuleDependences("sender", "OnPresetTemplateList", "sender", "Bitrix\\Sender\\TemplateTable", "onPresetTemplateList");
     UnRegisterModuleDependences("sender", "OnPresetMailBlockList", "sender", "Bitrix\\Sender\\Preset\\MailBlockBase", "OnPresetMailBlockList");
     UnRegisterModule("sender");
     if ($this->errors !== false) {
         $APPLICATION->ThrowException(implode("<br>", $this->errors));
         return false;
     }
     return true;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:25,代码来源:index.php


示例6: InstallDB

 function InstallDB($arParams = array())
 {
     global $DB, $DBType, $APPLICATION;
     $this->errors = false;
     // Database tables creation
     if (!$DB->Query("SELECT 'x' FROM b_list_rubric WHERE 1=0", true)) {
         $this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/subscribe/install/db/" . $DBType . "/install.sql");
     }
     if ($this->errors !== false) {
         $APPLICATION->ThrowException(implode("<br>", $this->errors));
         return false;
     } else {
         RegisterModule("subscribe");
         CModule::IncludeModule("subscribe");
         RegisterModuleDependences("main", "OnBeforeLangDelete", "subscribe", "CRubric", "OnBeforeLangDelete");
         RegisterModuleDependences("main", "OnUserDelete", "subscribe", "CSubscription", "OnUserDelete");
         RegisterModuleDependences("main", "OnUserLogout", "subscribe", "CSubscription", "OnUserLogout");
         RegisterModuleDependences("main", "OnGroupDelete", "subscribe", "CPosting", "OnGroupDelete");
         //agents
         CAgent::RemoveAgent("CSubscription::CleanUp();", "subscribe");
         CTimeZone::Disable();
         CAgent::Add(array("NAME" => "CSubscription::CleanUp();", "MODULE_ID" => "subscribe", "ACTIVE" => "Y", "NEXT_EXEC" => date("d.m.Y H:i:s", mktime(3, 0, 0, date("m"), date("j") + 1, date("Y"))), "AGENT_INTERVAL" => 86400, "IS_PERIOD" => "Y"));
         CTimeZone::Enable();
         return true;
     }
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:26,代码来源:index.php


示例7: AgentRun

 public static function AgentRun($profileID, $in_agent = "N")
 {
     global $DB;
     $agent_ID = 0;
     $pr = CProfileAdmin::GetByID($profileID)->Fetch();
     $datacheck = date("d.m.Y H:i:s", $pr["DATA_START"]);
     $agent_period = intval($pr["PERIOD"]);
     if ($agent_period <= 0) {
         $agent_period = 86400;
     }
     if ($profileID > 0) {
         if ($in_agent == "Y") {
             CAgent::RemoveAgent("CGM::ReturnXMLData(" . $profileID . ");", "acrit.googlemerchant");
         } else {
             $arAgent = CAgent::GetList(array(), array("NAME" => "CGM::ReturnXMLData(" . $profileID . ");"))->Fetch();
             if (!$arAgent) {
                 $agent_ID = CAgent::AddAgent("CGM::ReturnXMLData(" . $profileID . ");", "acrit.googlemerchant", "N", $agent_period, $datacheck, "Y", $datacheck, 100);
             } elseif ($arAgent) {
                 if ($arAgent['NEXT_EXEC'] > $datacheck) {
                     $datacheck = $arAgent['NEXT_EXEC'];
                 }
                 CAgent::Update($arAgent['ID'], array("AGENT_INTERVAL" => $agent_period, "ACTIVE" => "Y", "NEXT_EXEC" => $datacheck));
             }
         }
     }
     return $agent_ID;
 }
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:27,代码来源:gmexport.php


示例8: UnInstallDB

	function UnInstallDB($arParams = array())
	{
		global $APPLICATION, $DB, $DOCUMENT_ROOT;

		if(!array_key_exists("savedata", $arParams) || $arParams["savedata"] != "Y")
		{
			$errors = $DB->RunSQLBatch($DOCUMENT_ROOT."/bitrix/modules/socialservices/install/db/".strtolower($DB->type)."/uninstall.sql");
			if (!empty($errors))
			{
				$APPLICATION->ThrowException(implode("", $errors));
				return false;
			}
		}
		UnRegisterModuleDependences("main", "OnUserDelete", "socialservices", "CSocServAuthDB", "OnUserDelete");
		UnRegisterModuleDependences('socialnetwork', 'OnFillSocNetLogEvents', 'socialservices', 'CSocServEventHandlers', 'OnFillSocNetLogEvents');
		UnRegisterModuleDependences('timeman', 'OnAfterTMReportDailyAdd', 'socialservices', 'CSocServAuthDB', 'OnAfterTMReportDailyAdd');
		UnRegisterModuleDependences('timeman', 'OnAfterTMDayStart', 'socialservices', 'CSocServAuthDB', 'OnAfterTMDayStart');
		UnRegisterModuleDependences('timeman', 'OnTimeManShow', 'socialservices', 'CSocServEventHandlers', 'OnTimeManShow');

		$dbSites = CSite::GetList(($b="sort"), ($o="asc"), array("ACTIVE" => "Y"));
		while ($arSite = $dbSites->Fetch())
		{
			$siteId = $arSite['ID'];
			CAgent::RemoveAgent("CSocServAuthManager::GetTwitMessages($siteId);", "socialservices");
		}

		UnRegisterModule("socialservices");

		return true;
	}
开发者ID:nProfessor,项目名称:Mytb,代码行数:30,代码来源:index.php


示例9: CheckExpireAgent

	public static function CheckExpireAgent()
	{
		global $DB;
		if (!CPullOptions::ModuleEnable())
			return false;

		CAgent::RemoveAgent("CPullWatch::CheckExpireAgent();", "pull");

		$strSql = "SELECT count(ID) CNT FROM b_pull_watch WHERE DATE_CREATE < DATE_SUB(NOW(), INTERVAL 30 MINUTE)";
		$dbRes = $DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);
		if ($arRes = $dbRes->Fetch())
		{
			$strSql = "DELETE FROM b_pull_watch WHERE DATE_CREATE < DATE_SUB(NOW(), INTERVAL 30 MINUTE) LIMIT 1000";
			$DB->Query($strSql, false, "File: ".__FILE__."<br>Line: ".__LINE__);

			if ($arRes['CNT'] > 1000)
			{
				CAgent::AddAgent("CPullWatch::CheckExpireAgent();", "pull", "N", 180, "", "Y", ConvertTimeStamp(time()+CTimeZone::GetOffset()+180, "FULL"));
				return false;
			}
		}

		CAgent::AddAgent("CPullWatch::CheckExpireAgent();", "pull", "N", 600, "", "Y", ConvertTimeStamp(time()+CTimeZone::GetOffset()+600, "FULL"));
		return false;
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:25,代码来源:pull_watch.php


示例10: InstallDB

 function InstallDB($arParams = array())
 {
     global $DB, $DBType, $APPLICATION;
     $this->errors = false;
     // Database tables creation
     if (!$DB->Query("SELECT 'x' FROM b_sec_iprule WHERE 1=0", true)) {
         $this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/security/install/db/" . strtolower($DB->type) . "/install.sql");
     }
     if ($this->errors !== false) {
         $APPLICATION->ThrowException(implode("<br>", $this->errors));
         return false;
     } else {
         $this->InstallTasks();
         RegisterModule("security");
         RegisterModuleDependences("main", "OnUserDelete", "security", "CSecurityUser", "OnUserDelete");
         RegisterModuleDependences("main", "OnEventLogGetAuditTypes", "security", "CSecurityFilter", "GetAuditTypes");
         RegisterModuleDependences("main", "OnEventLogGetAuditTypes", "security", "CSecurityAntiVirus", "GetAuditTypes");
         RegisterModuleDependences("main", "OnAdminInformerInsertItems", "security", "CSecurityFilter", "OnAdminInformerInsertItems");
         RegisterModuleDependences("main", "OnAdminInformerInsertItems", "security", "CSecuritySiteChecker", "OnAdminInformerInsertItems");
         CModule::IncludeModule("security");
         //agents
         CAgent::RemoveAgent("CSecuritySession::CleanUpAgent();", "security");
         CAgent::Add(array("NAME" => "CSecuritySession::CleanUpAgent();", "MODULE_ID" => "security", "ACTIVE" => "Y", "AGENT_INTERVAL" => 1800, "IS_PERIOD" => "N"));
         CAgent::RemoveAgent("CSecurityIPRule::CleanUpAgent();", "security");
         CAgent::Add(array("NAME" => "CSecurityIPRule::CleanUpAgent();", "MODULE_ID" => "security", "ACTIVE" => "Y", "AGENT_INTERVAL" => 3600, "IS_PERIOD" => "N"));
         if (!COption::GetOptionString("security", "ipcheck_disable_file")) {
             COption::SetOptionString("security", "ipcheck_disable_file", "/bitrix/modules/ipcheck_disable_" . md5(mt_rand()));
         }
         CAgent::RemoveAgent("CSecurityFilter::ClearTmpFiles();", "security");
         CSecurityFilter::SetActive(true);
         CSecurityAntiVirus::SetActive(true);
         return true;
     }
 }
开发者ID:spas-viktor,项目名称:books,代码行数:34,代码来源:index.php


示例11: InstallDB

 function InstallDB()
 {
     global $DB, $APPLICATION;
     $this->errors = false;
     if (!$DB->Query("SELECT 'x' FROM b_pull_stack", true)) {
         $this->errors = $DB->RunSQLBatch($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/pull/install/db/" . strtolower($DB->type) . "/install.sql");
     }
     if ($this->errors !== false) {
         $APPLICATION->ThrowException(implode("", $this->errors));
         return false;
     }
     RegisterModule("pull");
     RegisterModuleDependences("main", "OnProlog", "main", "", "", 3, "/modules/pull/ajax_hit.php");
     RegisterModuleDependences("main", "OnEpilog", "pull", "CPullWatch", "DeferredSql");
     RegisterModuleDependences("main", "OnEpilog", "pull", "CPullOptions", "OnEpilog");
     RegisterModuleDependences("perfmon", "OnGetTableSchema", "pull", "CPullTableSchema", "OnGetTableSchema");
     RegisterModuleDependences("main", "OnAfterRegisterModule", "pull", "CPullOptions", "ClearCheckCache");
     RegisterModuleDependences("main", "OnAfterUnRegisterModule", "pull", "CPullOptions", "ClearCheckCache");
     if (IsModuleInstalled('intranet')) {
         RegisterModuleDependences("main", "OnAfterUserAuthorize", "pull", "CPullChannel", "OnAfterUserAuthorize");
         RegisterModuleDependences("main", "OnAfterUserLogout", "pull", "CPullChannel", "OnAfterUserLogout");
     }
     CAgent::AddAgent("CPullOptions::ClearAgent();", "pull", "N", 30, "", "Y", ConvertTimeStamp(time() + CTimeZone::GetOffset() + 30, "FULL"));
     return true;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:25,代码来源:index.php


示例12: CheckAgents

 function CheckAgents()
 {
     global $CACHE_MANAGER;
     //For a while agents will execute only on primary cluster group
     if (defined("NO_AGENT_CHECK") && NO_AGENT_CHECK === true || defined("BX_CLUSTER_GROUP") && BX_CLUSTER_GROUP !== 1) {
         return;
     }
     $agents_use_crontab = COption::GetOptionString("main", "agents_use_crontab", "N");
     $str_crontab = "";
     if ($agents_use_crontab == "Y" || defined("BX_CRONTAB_SUPPORT") && BX_CRONTAB_SUPPORT === true) {
         if (defined("BX_CRONTAB") && BX_CRONTAB === true) {
             $str_crontab = " AND IS_PERIOD='N' ";
         } else {
             $str_crontab = " AND IS_PERIOD='Y' ";
         }
     }
     $saved_time = 0;
     if (CACHED_b_agent !== false && $CACHE_MANAGER->Read(CACHED_b_agent, $cache_id = "agents" . $str_crontab, "agents")) {
         $saved_time = $CACHE_MANAGER->Get($cache_id);
         if (time() < $saved_time) {
             return "";
         }
     }
     return CAgent::ExecuteAgents($str_crontab);
 }
开发者ID:,项目名称:,代码行数:25,代码来源:


示例13: UnInstallDB

 function UnInstallDB($arParams = array())
 {
     global $DB, $DBType, $APPLICATION;
     $this->errors = false;
     if (!array_key_exists("savedata", $arParams) || $arParams["savedata"] != "Y") {
         $this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/vote/install/db/" . strtolower($DB->type) . "/uninstall.sql");
     }
     //delete agents
     CAgent::RemoveModuleAgents("vote");
     $db_res = $DB->Query("SELECT ID FROM b_file WHERE MODULE_ID = 'vote'");
     while ($arRes = $db_res->Fetch()) {
         CFile::Delete($arRes["ID"]);
     }
     // Events
     include $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/vote/install/events/del_events.php";
     UnRegisterModuleDependences("im", "OnGetNotifySchema", "vote", "CVoteNotifySchema", "OnGetNotifySchema");
     UnRegisterModuleDependences("main", "OnUserLogin", "vote", "CVoteUser", "OnUserLogin", 200);
     UnRegisterModuleDependences("main", "OnUserTypeBuildList", "vote", "CUserTypeVote", "GetUserTypeDescription", 200);
     UnRegisterModuleDependences("main", "OnBeforeProlog", "main", "", "", "/modules/vote/keepvoting.php");
     UnRegisterModule("vote");
     if ($this->errors !== false) {
         $APPLICATION->ThrowException(implode("<br>", $this->errors));
         return false;
     }
     return true;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:26,代码来源:index.php


示例14: UnInstallDB

 function UnInstallDB($arParams = array())
 {
     UnRegisterModuleDependences("main", "OnPrologAdminTitle", "storeassist", "CStoreAssist", "onPrologAdminTitle");
     UnRegisterModuleDependences('main', 'OnBuildGlobalMenu', "storeassist", "CStoreAssist", "onBuildGlobalMenu");
     CAgent::RemoveModuleAgents("storeassist");
     UnRegisterModule("storeassist");
     return true;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:8,代码来源:index.php


示例15: checkAgentIsAlive

 public static function checkAgentIsAlive($name, $interval)
 {
     $name = '\\' . __CLASS__ . '::' . $name . ';';
     $agent = \CAgent::GetList(array(), array('MODULE_ID' => 'tasks', 'NAME' => $name))->fetch();
     if (!$agent['ID']) {
         \CAgent::AddAgent($name, 'tasks', 'N', $interval);
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:8,代码来源:agentmanager.php


示例16: UnInstallDB

 function UnInstallDB($arParams = array())
 {
     global $DB, $APPLICATION;
     CAgent::RemoveModuleAgents('calendar');
     $errors = null;
     if (true == array_key_exists("savedata", $arParams) && $arParams["savedata"] != 'Y') {
         $GLOBALS["USER_FIELD_MANAGER"]->OnEntityDelete("CALENDAR_EVENT");
         $errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . '/bitrix/modules/' . $this->MODULE_ID . '/install/db/' . strtolower($DB->type) . '/uninstall.sql');
         if (!empty($errors)) {
             $APPLICATION->ThrowException(implode("", $errors));
             return false;
         }
         $this->UnInstallTasks();
     }
     UnRegisterModuleDependences("pull", "OnGetDependentModule", "calendar", "CCalendarPullSchema", "OnGetDependentModule");
     UnRegisterModuleDependences("im", "OnGetNotifySchema", "calendar", "CCalendarNotifySchema", "OnGetNotifySchema");
     UnRegisterModuleDependences("im", "OnBeforeConfirmNotify", "calendar", "CCalendar", "HandleImCallback");
     UnRegisterModuleDependences('intranet', 'OnPlannerInit', 'calendar', 'CCalendarEventHandlers', 'OnPlannerInit');
     UnRegisterModuleDependences('intranet', 'OnPlannerAction', 'calendar', 'CCalendarEventHandlers', 'OnPlannerAction');
     UnRegisterModuleDependences('rest', 'OnRestServiceBuildDescription', 'calendar', 'CCalendarRestService', 'OnRestServiceBuildDescription');
     UnRegisterModuleDependences('socialnetwork', 'OnFillSocNetFeaturesList', 'calendar', 'CCalendarLiveFeed', 'AddEvent');
     UnRegisterModuleDependences('socialnetwork', 'OnSonetLogEntryMenuCreate', 'calendar', 'CCalendarLiveFeed', 'OnSonetLogEntryMenuCreate');
     UnRegisterModuleDependences('socialnetwork', 'OnAfterSonetLogEntryAddComment', 'calendar', 'CCalendarLiveFeed', 'OnAfterSonetLogEntryAddComment');
     UnRegisterModuleDependences('socialnetwork', 'OnForumCommentIMNotify', 'calendar', 'CCalendarLiveFeed', 'OnForumCommentIMNotify');
     UnRegisterModuleDependences('socialnetwork', 'onAfterCommentAddAfter', 'calendar', 'CCalendarLiveFeed', 'onAfterCommentAddAfter');
     UnRegisterModuleDependences('socialnetwork', 'onAfterCommentUpdateAfter', 'calendar', 'CCalendarLiveFeed', 'onAfterCommentUpdateAfter');
     RegisterModuleDependences('socialnetwork', 'OnSocNetGroupDelete', 'calendar', 'CCalendar', 'OnSocNetGroupDelete');
     UnRegisterModuleDependences('search', 'BeforeIndex', 'calendar', 'CCalendarLiveFeed', 'FixForumCommentURL');
     UnRegisterModuleDependences("main", "OnAfterRegisterModule", "main", "calendar", "InstallUserFields", "/modules/calendar/install/index.php");
     // check webdav UF
     UnRegisterModule("calendar");
     // Clear cache
     $arPath = array('access_tasks', 'type_list', 'section_list', 'attendees_list', 'event_list');
     $cache = new CPHPCache();
     foreach ($arPath as $path) {
         if ($path != '') {
             $cache->CleanDir("calendar/" . $path);
         }
     }
     // Remove tasks from LiveFeed
     if (IsModuleInstalled('socialnetwork') && CModule::IncludeModule('socialnetwork')) {
         $dbRes = CSocNetLog::GetList(array(), array("EVENT_ID" => "calendar"), false, false, array("ID"));
         if ($dbRes) {
             while ($arRes = $dbRes->Fetch()) {
                 CSocNetLog::Delete($arRes["ID"]);
             }
         }
     }
     // Remove tasks from IM
     if (IsModuleInstalled('im') && CModule::IncludeModule('im')) {
         if (method_exists('CIMNotify', 'DeleteByModule')) {
             CIMNotify::DeleteByModule('calendar');
         }
     }
     return true;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:56,代码来源:index.php


示例17: ensureAgentExists

 public static function ensureAgentExists()
 {
     if (CTaskCountersProcessorInstaller::checkProcessIsNotActive()) {
         $agent = CAgent::GetList(array(), array('MODULE_ID' => 'tasks', 'NAME' => 'CTaskCountersProcessor::agent();'))->fetch();
         if (!is_array($agent) || !isset($agent['ID'])) {
             CAgent::AddAgent('CTaskCountersProcessor::agent();', 'tasks', 'N', 900);
             // every 15 minutes
         }
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:10,代码来源:countersprocessor.php


示例18: deleteAgentIfExists

 public function deleteAgentIfExists($moduleName, $name)
 {
     /** @noinspection PhpDynamicAsStaticMethodCallInspection */
     $aAgent = \CAgent::GetList(array("ID" => "DESC"), array('MODULE_ID' => $moduleName, 'NAME' => $name))->Fetch();
     if (!$aAgent) {
         return false;
     }
     /** @noinspection PhpDynamicAsStaticMethodCallInspection */
     \CAgent::RemoveAgent($name, $moduleName);
     return true;
 }
开发者ID:andreyryabin,项目名称:sprint.migration,代码行数:11,代码来源:AgentHelper.php


示例19: UnInstallDB

 function UnInstallDB($arParams = array())
 {
     global $DB;
     UnRegisterModuleDependences("perfmon", "OnGetTableSchema", "controller", "controller", "OnGetTableSchema");
     CAgent::RemoveAgent('CControllerMember::UnregisterExpiredAgent();');
     CAgent::RemoveAgent('CControllerAgent::CleanUp();');
     if (!array_key_exists("savedata", $arParams) || $arParams["savedata"] != "Y") {
         if ($DB->Query("SELECT 'x' FROM b_controller_member", true)) {
             $errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/controller/install/db/" . strtolower($DB->type) . "/uninstall.sql");
         }
     }
     UnRegisterModule("controller");
     return true;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:14,代码来源:index.php


示例20: _addAgent

 private static function _addAgent()
 {
     global $APPLICATION;
     static $bAgentAdded = false;
     if (!$bAgentAdded) {
         $bAgentAdded = true;
         $rsAgents = CAgent::GetList(array("ID" => "DESC"), array("NAME" => "CPHPCacheFiles::DelayedDelete(%"));
         if (!$rsAgents->Fetch()) {
             $res = CAgent::AddAgent("CPHPCacheFiles::DelayedDelete();", "main", "Y", 1);
             if (!$res) {
                 $APPLICATION->ResetException();
             }
         }
     }
 }
开发者ID:rasuldev,项目名称:torino,代码行数:15,代码来源:cache_files.php



注:本文中的CAgent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CApi类代码示例发布时间:2022-05-23
下一篇:
PHP CAdminViewTabControl类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap