本文整理汇总了PHP中COption::SetOptionString方法的典型用法代码示例。如果您正苦于以下问题:PHP COption::SetOptionString方法的具体用法?PHP COption::SetOptionString怎么用?PHP COption::SetOptionString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COption
的用法示例。
在下文中一共展示了COption::SetOptionString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: InstallDB
function InstallDB()
{
global $DB, $APPLICATION;
$this->errors = false;
if (!$DB->Query("SELECT 'x' FROM b_seo_keywords", true)) {
$this->errors = $DB->RunSQLBatch($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/seo/install/db/" . strtolower($DB->type) . "/install.sql");
}
if ($this->errors !== false) {
$APPLICATION->ThrowException(implode("", $this->errors));
return false;
}
RegisterModule("seo");
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/seo/install/tasks/install.php";
RegisterModuleDependences('main', 'OnPanelCreate', 'seo', 'CSeoEventHandlers', 'SeoOnPanelCreate');
if (COption::GetOptionString('seo', 'searchers_list', '') == '' && CModule::IncludeModule('statistic')) {
$arFilter = array('ACTIVE' => 'Y', 'NAME' => 'Google|MSN|Bing', 'NAME_EXACT_MATCH' => 'Y');
if (COption::GetOptionString('main', 'vendor') == '1c_bitrix') {
$arFilter['NAME'] .= '|Yandex';
}
$strSearchers = '';
$dbRes = CSearcher::GetList($by = 's_id', $order = 'asc', $arFilter, $is_filtered);
while ($arRes = $dbRes->Fetch()) {
$strSearchers .= ($strSearchers == '' ? '' : ',') . $arRes['ID'];
}
COption::SetOptionString('seo', 'searchers_list', $strSearchers);
}
return true;
}
示例2: DoInstall
/**
* Установка модуля
*/
public function DoInstall()
{
global $APPLICATION, $step;
$this->STEP = $step ? (int) $step : $this->STEP;
$stepMessage = '';
switch ($this->STEP) {
case 1:
$stepMessage = Loc::getMessage('STEP_1');
$APPLICATION->IncludeAdminFile($stepMessage, $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/bitrixunittests/install/step1.php');
break;
case 2:
//устанавливаем корректный путь к тестам
$pathToTest = $GLOBALS['UNIT_TESTS_PATH'];
if ($pathToTest[0] != '/') {
$pathToTest = '/' . $pathToTest;
}
$pathToTest = $_SERVER['DOCUMENT_ROOT'] . $pathToTest;
//установка параметров модуля
COption::SetOptionString($this->MODULE_ID, 'UNIT_TESTS_PATH', $pathToTest);
RegisterModule($this->MODULE_ID);
//копирование файлов и создание таблиц
$this->InstallFiles();
$this->installDB();
//заполнение информации о тестах
BitrixUnitTestsHelper::getTestList($pathToTest);
break;
}
return true;
}
示例3: OnModuleInstalledEvent
function OnModuleInstalledEvent($id, $installed, $Module)
{
foreach (GetModuleEvents("main", "OnModuleInstalled", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($id, $installed));
}
$cModules = COption::GetOptionString("main", "mp_modules_date", "");
$arModules = array();
if (strlen($cModules) > 0) {
$arModules = unserialize($cModules);
}
if ($installed == "Y") {
$arModules[] = array("ID" => $id, "NAME" => htmlspecialcharsbx($Module->MODULE_NAME), "TMS" => time());
if (count($arModules) > 3) {
$arModules = array_slice($arModules, -3);
}
COption::SetOptionString("main", "mp_modules_date", serialize($arModules));
} else {
foreach ($arModules as $arid => $val) {
if ($val["ID"] == $id) {
unset($arModules[$arid]);
}
}
if (count($arModules) > 0) {
COption::SetOptionString("main", "mp_modules_date", serialize($arModules));
} else {
COption::RemoveOption("main", "mp_modules_date");
}
$_SESSION["MP_MOD_DELETED"] = array("ID" => $id, "NAME" => $Module->MODULE_NAME);
}
}
示例4: __construct
public function __construct($arDBRecord = false)
{
parent::__construct($arDBRecord);
$DB = CDatabase::GetModuleConnection('statistic');
if (!$arDBRecord) {
$country_recs = COption::GetOptionString("statistic", "COUNTRY_INDEX_LOADED", "N");
if ($country_recs !== "Y") {
$rs = $DB->Query(CStatistics::DBTopSql("SELECT /*TOP*/ * FROM b_stat_country", 1));
if ($rs->Fetch()) {
$country_recs = "Y";
COption::SetOptionString("statistic", "COUNTRY_INDEX_LOADED", "Y");
}
}
$this->country_avail = $country_recs === "Y";
if ($this->country_avail) {
$city_recs = COption::GetOptionString("statistic", "CITY_INDEX_LOADED", "N");
if ($city_recs !== "Y") {
$rs = $DB->Query(CStatistics::DBTopSql("SELECT /*TOP*/ * FROM b_stat_city_ip", 1));
if ($rs->Fetch()) {
COption::SetOptionString("statistic", "CITY_INDEX_LOADED", "Y");
}
}
$this->city_avail = COption::GetOptionString("statistic", "CITY_INDEX_LOADED", "N") === "Y";
}
$this->is_installed = $this->country_avail;
}
}
示例5: OnPageStart
public static function OnPageStart()
{
if(!defined("PERFMON_STOP"))
{
$end_time = COption::GetOptionInt("perfmon", "end_time");
if(time() > $end_time)
{
CPerfomanceKeeper::SetActive(false);
if(COption::GetOptionString("perfmon", "total_mark_value", "") == "measure");
COption::SetOptionString("perfmon", "total_mark_value", "calc");
}
else
{
global $DB, $APPLICATION;
// define("PERFMON_STARTED", $DB->ShowSqlStat);
$DB->ShowSqlStat = true;
$APPLICATION->ShowIncludeStat = true;
global $perfmonErrors;
$perfmonErrors = array();
if(COption::GetOptionString("perfmon", "warning_log") === "Y")
set_error_handler("perfmonErrorHandler");
}
}
}
示例6: InstallDB
function InstallDB()
{
global $DB, $DBType, $APPLICATION;
if (!$DB->Query("SELECT 'x' FROM b_medialib_collection", true)) {
$errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/fileman/install/db/" . $DBType . "/install.sql");
}
if (!empty($errors)) {
$APPLICATION->ThrowException(implode("", $errors));
return false;
}
RegisterModule("fileman");
RegisterModuleDependences("main", "OnGroupDelete", "fileman", "CFileman", "OnGroupDelete");
RegisterModuleDependences("main", "OnPanelCreate", "fileman", "CFileman", "OnPanelCreate");
RegisterModuleDependences("main", "OnModuleUpdate", "fileman", "CFileman", "OnModuleUpdate");
RegisterModuleDependences("main", "OnModuleInstalled", "fileman", "CFileman", "ClearComponentsListCache");
RegisterModuleDependences('iblock', 'OnIBlockPropertyBuildList', 'fileman', 'CIBlockPropertyMapGoogle', 'GetUserTypeDescription');
RegisterModuleDependences('iblock', 'OnIBlockPropertyBuildList', 'fileman', 'CIBlockPropertyMapYandex', 'GetUserTypeDescription');
RegisterModuleDependences('iblock', 'OnIBlockPropertyBuildList', 'fileman', 'CIBlockPropertyVideo', 'GetUserTypeDescription');
RegisterModuleDependences("main", "OnUserTypeBuildList", "fileman", "CUserTypeVideo", "GetUserTypeDescription");
RegisterModuleDependences("main", "OnEventLogGetAuditTypes", "fileman", "CEventFileman", "GetAuditTypes");
RegisterModuleDependences("main", "OnEventLogGetAuditHandlers", "fileman", "CEventFileman", "MakeFilemanObject");
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/fileman/install/tasks/install.php";
COption::SetOptionString('fileman', "use_editor_3", "Y");
// // Add hotkeys
// $hkc = new CHotKeysCode;
// $id = $hkc->Add(array(
// CLASS_NAME => "admin_file_edit_apply",
// CODE => "if(top.AjaxApply && typeof top.AjaxApply == 'function'){top.AjaxApply();}",
// NAME => GetMessage("FILEMAN_HOTKEY_TITLE"),
// IS_CUSTOM => "0"
// ));
// CHotKeys::getInstance()->Add(array("KEYS_STRING"=>"Ctrl+83", "CODE_ID"=>$id, "USER_ID" => 0)); //S
return true;
}
示例7: UnInstallDB
function UnInstallDB($arParams = array())
{
global $DB, $DBType, $APPLICATION;
$this->errors = false;
UnRegisterModuleDependences("main", "OnPageStart", "security", "CSecurityIPRule", "OnPageStart");
UnRegisterModuleDependences("main", "OnBeforeProlog", "security", "CSecurityFilter", "OnBeforeProlog");
UnRegisterModuleDependences("main", "OnEndBufferContent", "security", "CSecurityXSSDetect", "OnEndBufferContent");
UnRegisterModuleDependences("main", "OnBeforeUserLogin", "security", "CSecurityUser", "OnBeforeUserLogin");
UnRegisterModuleDependences("main", "OnUserDelete", "security", "CSecurityUser", "OnUserDelete");
UnRegisterModuleDependences("main", "OnEventLogGetAuditTypes", "security", "CSecurityFilter", "GetAuditTypes");
UnRegisterModuleDependences("main", "OnEventLogGetAuditTypes", "security", "CSecurityAntiVirus", "GetAuditTypes");
UnRegisterModuleDependences("main", "OnBeforeLocalRedirect", "security", "CSecurityRedirect", "BeforeLocalRedirect");
UnRegisterModuleDependences("main", "OnEndBufferContent", "security", "CSecurityRedirect", "EndBufferContent");
UnRegisterModuleDependences("main", "OnAdminInformerInsertItems", "security", "CSecurityFilter", "OnAdminInformerInsertItems");
UnRegisterModuleDependences("main", "OnAdminInformerInsertItems", "security", "CSecuritySiteChecker", "OnAdminInformerInsertItems");
COption::SetOptionString("main", "session_id_ttl", "60");
COption::SetOptionString("main", "use_session_id_ttl", "N");
COption::SetOptionInt("main", "session_id_ttl", 60);
COption::SetOptionString("security", "session", "N");
if (!array_key_exists("save_tables", $arParams) || $arParams["save_tables"] != "Y") {
$this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/security/install/db/" . strtolower($DB->type) . "/uninstall.sql");
$this->UnInstallTasks();
}
UnRegisterModule("security");
if ($this->errors !== false) {
$APPLICATION->ThrowException(implode("<br>", $this->errors));
return false;
}
return true;
}
示例8: InstallDB
function InstallDB($install_wizard = true)
{
global $DB, $DBType, $APPLICATION;
$arCurPhpVer = Explode(".", PhpVersion());
if (IntVal($arCurPhpVer[0]) < 5) {
return true;
}
$errors = null;
if (!$DB->Query("SELECT 'x' FROM b_bp_workflow_instance", true)) {
$errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/bizproc/install/db/" . $DBType . "/install.sql");
}
if (!empty($errors)) {
$APPLICATION->ThrowException(implode("", $errors));
return false;
}
RegisterModule("bizproc");
RegisterModuleDependences("iblock", "OnAfterIBlockElementDelete", "bizproc", "CBPVirtualDocument", "OnAfterIBlockElementDelete");
RegisterModuleDependences("main", "OnAdminInformerInsertItems", "bizproc", "CBPAllTaskService", "OnAdminInformerInsertItems");
RegisterModuleDependences('rest', 'OnRestServiceBuildDescription', 'bizproc', '\\Bitrix\\Bizproc\\RestService', 'onRestServiceBuildDescription');
RegisterModuleDependences('rest', 'OnRestAppDelete', 'bizproc', '\\Bitrix\\Bizproc\\RestService', 'onRestAppDelete');
RegisterModuleDependences('rest', 'OnRestAppUpdate', 'bizproc', '\\Bitrix\\Bizproc\\RestService', 'onRestAppUpdate');
RegisterModuleDependences('timeman', 'OnAfterTMDayStart', 'bizproc', 'CBPDocument', 'onAfterTMDayStart');
COption::SetOptionString("bizproc", "SkipNonPublicCustomTypes", "Y");
return true;
}
示例9: InstallDB
function InstallDB()
{
global $DB, $APPLICATION;
$this->errors = false;
if (!$DB->Query("SELECT 'x' FROM b_im_chat", true)) {
$this->errors = $DB->RunSQLBatch($_SERVER['DOCUMENT_ROOT'] . "/bitrix/modules/im/install/db/" . strtolower($DB->type) . "/install.sql");
}
if ($this->errors !== false) {
$APPLICATION->ThrowException(implode("", $this->errors));
return false;
}
RegisterModule("im");
RegisterModuleDependences('main', 'OnAddRatingVote', 'im', 'CIMEvent', 'OnAddRatingVote');
RegisterModuleDependences('main', 'OnCancelRatingVote', 'im', 'CIMEvent', 'OnCancelRatingVote');
RegisterModuleDependences('main', 'OnAfterUserUpdate', 'im', 'CIMEvent', 'OnAfterUserUpdate');
RegisterModuleDependences("pull", "OnGetDependentModule", "im", "CIMEvent", "OnGetDependentModule");
RegisterModuleDependences("main", "OnProlog", "main", "", "", 3, "/modules/im/ajax_hit.php");
RegisterModuleDependences("perfmon", "OnGetTableSchema", "im", "CIMTableSchema", "OnGetTableSchema");
RegisterModuleDependences("im", "OnGetNotifySchema", "im", "CIMNotifySchema", "OnGetNotifySchema");
CAgent::AddAgent("CIMMail::MailNotifyAgent();", "im", "N", 600);
CAgent::AddAgent("CIMMail::MailMessageAgent();", "im", "N", 600);
$solution = COption::GetOptionString("main", "wizard_solution", false);
if ($solution == 'community') {
COption::SetOptionString("im", "path_to_user_profile", '/people/user/#user_id#/');
COption::SetOptionString("im", "path_to_user_lf", '/people/log/');
}
CModule::IncludeModule("im");
if (CIMConvert::ConvertCount() > 0) {
Cmodule::IncludeModule("im");
CAdminNotify::Add(array("MESSAGE" => GetMessage("IM_CONVERT_MESSAGE", array("#A_TAG_START#" => '<a href="/bitrix/admin/im_convert.php?lang=' . LANGUAGE_ID . '">', "#A_TAG_END#" => "</a>")), "TAG" => "IM_CONVERT", "MODULE_ID" => "IM", "ENABLE_CLOSE" => "Y"));
CAgent::AddAgent("CIMConvert::UndeliveredMessageAgent();", "im", "N", 20, "", "Y", ConvertTimeStamp(time() + CTimeZone::GetOffset() + 20, "FULL"));
}
return true;
}
示例10: 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;
}
示例11: SaveKeys
public function SaveKeys($arKeys)
{
$privKey = $arKeys["PRIV"];
unset($arKeys["PRIV"]);
COption::SetOptionString("main", "~rsa_keys_openssl", serialize($arKeys));
COption::SetOptionString("main", "~rsa_key_pem", $privKey);
}
示例12: GetConfig
function GetConfig($siteId = false)
{
$shopLocationId = CSaleHelper::getShopLocationId($siteId);
$arShopLocation = CSaleHelper::getLocationByIdHitCached($shopLocationId);
if (!$arShopLocation) {
$arShopLocation = array();
}
$shopPrevLocationId = COption::GetOptionString('sale', 'delivery_rus_post_first_prev_loc', 0);
/* if shop's location was changed */
if ($shopPrevLocationId != $shopLocationId) {
COption::SetOptionString('sale', 'delivery_rus_post_first_prev_loc', $shopLocationId);
COption::RemoveOption('sale', 'delivery_rus_post_first_tarifs');
}
$arConfig = array('CONFIG_GROUPS' => array('wrapper' => GetMessage('SALE_DH_RPF_WRP_TITLE')));
$aviableBoxes = self::getAviableBoxes();
foreach ($aviableBoxes as $boxId => $arBox) {
CSaleDeliveryHelper::makeBoxConfig($boxId, $arBox, 'wrapper', $arConfig);
}
$arConfig['CONFIG']['tarif_section_1'] = array('TYPE' => 'SECTION', 'TITLE' => GetMessage('SALE_DH_RPF_TARIFS'), 'GROUP' => 'wrapper');
$arTarifs = CSaleHelper::getOptionOrImportValues('delivery_rus_post_first_tarifs', array('CDeliveryRusPostFirst', 'getTarifsByRegionFromCsv'), array($arShopLocation));
foreach (self::$TARIFS as $arTarif) {
$tarifId = $arTarif[self::$TARIF_IDX];
$arConfig['CONFIG']['TARIF_' . $tarifId] = array('TYPE' => 'STRING', 'DEFAULT' => isset($arTarifs[$tarifId]) ? $arTarifs[$tarifId] : '0', 'TITLE' => $arTarif[self::$TARIF_DESCR], 'GROUP' => 'wrapper');
}
/* Additional services */
foreach (self::$SERVICES as $serviceId => $arService) {
$tarifId = $arService[self::$TARIF_IDX];
$arConfig['CONFIG']['service_' . $tarifId . '_section'] = array('TYPE' => 'SECTION', 'TITLE' => $arService[self::$TARIF_DESCR], 'GROUP' => 'wrapper');
$arConfig['CONFIG']['service_' . $tarifId . '_enabled'] = array('TYPE' => 'CHECKBOX', 'TITLE' => GetMessage('SALE_DH_RPF_SRV_ALLOW'), 'GROUP' => 'wrapper', 'DEFAULT' => $serviceId == 'NOTIFICATION_REG' ? 'N' : 'Y', 'HIDE_BY_NAMES' => array('service_' . $tarifId . '_value'));
$arConfig['CONFIG']['service_' . $tarifId . '_value'] = array('TYPE' => 'STRING', 'TITLE' => GetMessage('SALE_DH_RPF_SRV_PRICE'), 'GROUP' => 'wrapper', 'DEFAULT' => isset($arTarifs[$tarifId]) ? $arTarifs[$tarifId] : '0');
}
return $arConfig;
}
示例13: InstallOptions
function InstallOptions(){
$rSites = CSite::GetList($by="sort", $order="desc", array() );
while( $aSite = $rSites->Fetch() ){
$aSites[$aSite['NAME'].' '.$aSite['ID']] = $aSite['ID'];
};
COption::SetOptionString('tagsmanager', 'SITE_ID', implode( ',',$aSites ));
return true;
}
示例14: OnPostForm
function OnPostForm()
{
$wizard =& $this->GetWizard();
if ($wizard->IsNextButtonClick()) {
COption::SetOptionString("main", "site_personal_name", str_replace(array("<"), array("<"), $wizard->GetVar("siteName")));
COption::SetOptionString("main", "site_copyright", str_replace(array("<"), array("<"), $wizard->GetVar("copyright")));
}
}
示例15: InstallDB
function InstallDB()
{
COption::SetOptionString('wiki', 'GROUP_DEFAULT_RIGHT', 'R');
RegisterModule('wiki');
RegisterModuleDependences('main', 'OnAddRatingVote', 'wiki', 'CRatingsComponentsWiki', 'OnAddRatingVote', 200);
RegisterModuleDependences('main', 'OnCancelRatingVote', 'wiki', 'CRatingsComponentsWiki', 'OnCancelRatingVote', 200);
RegisterModuleDependences('search', 'BeforeIndex', 'wiki', 'CRatingsComponentsWiki', 'BeforeIndex');
return true;
}