本文整理汇总了PHP中Bitrix\Main\HttpApplication类的典型用法代码示例。如果您正苦于以下问题:PHP HttpApplication类的具体用法?PHP HttpApplication怎么用?PHP HttpApplication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HttpApplication类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: execute
protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln("Install bitrix...");
global $DB, $DBType, $DBHost, $DBLogin, $DBPassword, $DBName, $DBDebug, $DBDebugToFile, $APPLICATION, $USER, $arWizardConfig, $MESS;
$bitrixRoot = $this->projectPath;
$_SERVER["DOCUMENT_ROOT"] = $bitrixRoot;
$_SERVER["REQUEST_URI"] = "/index.php";
$_SERVER["QUERY_STRING"] = "";
define("B_PROLOG_INCLUDED", true);
ob_start();
require_once "{$bitrixRoot}/bitrix/modules/main/install/wizard/wizard.php";
ob_end_clean();
$output->writeln("Step 1. Create database:");
$wizard = new \CWizardBase("nonlux.createDb.wizard", null);
$dbName = time() . "_db";
$output->writeln("database name: {$dbName}");
$data = $this->getConfig(array("agree_license", "user", "password", "database", "utf8", "dbType", "host", "create_user", "create_database", "root_user", "root_password", 'file_access_perms', 'folder_access_perms', 'bitrixRoot'));
foreach ($data as $key => $value) {
$wizard->SetVar($key, $value);
}
$step = new \CreateDBStep();
$wizard->AddStep($step);
$step->OnPostForm();
$output->writeln("Done");
require_once $bitrixRoot . '/bitrix/php_interface/dbconn.php';
$output->writeln("Step 2. Install modules:");
$wizard = new \CWizardBase("nonlux.installModules.wizard", null);
$data = array_merge(array("nextStep" => "main", "nextStepStage" => "utf8"), $this->getConfig(array('bitrixRoot', "user", "password", "utf8")));
$step = new CreateModulesStep();
$wizard->AddStep($step);
foreach ($data as $key => $value) {
$wizard->SetVar($key, $value);
}
do {
$output->writeln("Install " . $wizard->GetVar("nextStep") . " " . $wizard->GetVar("nextStepStage"));
$step->OnPostForm();
if ($wizard->GetVar("nextStep") === 'main' && $wizard->GetVar("nextStepStage") === 'files') {
$HttpApplication = \Bitrix\Main\HttpApplication::getInstance();
$HttpApplication->initializeBasicKernel();
$HttpApplication->getCache()->clearCache(true);
$GLOBALS['CACHE_MANAGER']->Clean('b_option');
Option::clearOptions("main");
}
} while ($wizard->GetVar('nextStep') != '__finish');
$output->writeln("Done");
$USER = new \CUser();
$policy = $USER->GetSecurityPolicy();
$output->writeln("Step 3. Create admin:");
$data = $this->getConfig(array('email', 'login', 'admin_password_confirm', 'admin_password', 'user_name', "utf8", 'user_surname'));
foreach ($data as $key => $value) {
$wizard->SetVar($key, $value);
}
$wizard = new \CWizardBase("nonlux.admin.wizard", null);
$step = new \CreateAdminStep();
$wizard->AddStep($step);
$step->OnPostForm();
$output->writeln("Done");
$step = new \FinishStep();
$step->ShowStep();
}
开发者ID:ASDAFF,项目名称:bitapp,代码行数:60,代码来源:BitrixInstallCommand.php
示例2: search
public static function search($words)
{
$dbConnection = Main\HttpApplication::getConnection();
$dbHelper = Main\HttpApplication::getConnection()->getSqlHelper();
$wordStatTableName = WordStatTable::getTableName();
$preparedLike = array();
foreach ($words as $word) {
$preparedLike[] = "%TABLE_NAME%.WORD like '" . $dbHelper->forSql($word) . "%'";
}
$preparedLike = implode(' or ', $preparedLike);
$sql = "\n\t\t\tselect C.*, WS_CITY.WORD as CWORD, WS_VILLAGE.WORD as VWORD, WS_STREET.WORD as SWORD from " . static::getTableName() . " C\n\n\t\t\t\tinner join b_sale_loc_word_stat WS_STREET on \n\n\t\t\t\t\t(\n\t\t\t\t\t\tWS_STREET.TYPE_ID = '7'\n\t\t\t\t\t\tand\n\t\t\t\t\t\tWS_STREET.LOCATION_ID = C.STREET_ID\n\t\t\t\t\t\tand\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t(" . str_replace(array('%TABLE_NAME%'), array('WS_STREET'), $preparedLike) . ")\n\t\t\t\t\t\t\tor\n\t\t\t\t\t\t\t(WS_STREET.LOCATION_ID = '0')\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\n\t\t\t\tinner join b_sale_loc_word_stat WS_VILLAGE on \n\n\t\t\t\t\t(\n\t\t\t\t\t\tWS_VILLAGE.TYPE_ID = '6'\n\t\t\t\t\t\tand\n\t\t\t\t\t\tWS_VILLAGE.LOCATION_ID = C.VILLAGE_ID\n\t\t\t\t\t\tand\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t(" . str_replace(array('%TABLE_NAME%'), array('WS_VILLAGE'), $preparedLike) . ")\n\t\t\t\t\t\t\tor\n\t\t\t\t\t\t\t(WS_VILLAGE.LOCATION_ID = '0')\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\n\t\t\t\tinner join b_sale_loc_word_stat WS_CITY on \n\n\t\t\t\t\t(\n\t\t\t\t\t\tWS_CITY.TYPE_ID = '3'\n\t\t\t\t\t\tand\n\t\t\t\t\t\tWS_CITY.LOCATION_ID = C.CITY_ID\n\t\t\t\t\t\tand\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t(" . str_replace(array('%TABLE_NAME%'), array('WS_CITY'), $preparedLike) . ")\n\t\t\t\t\t\t\tor\n\t\t\t\t\t\t\t(WS_CITY.LOCATION_ID = '0')\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\n\t\t\torder by C.TYPE_SORT desc\n\t\t\tlimit 5\n\t\t";
/*
$sql = "
select * from ".static::getTableName()." C
where
(
C.CITY_ID = 0 or C.CITY_ID in (
select LOCATION_ID from b_sale_loc_word_stat
where
TYPE_ID = 3
and
(".$preparedLike.")
)
)
and
(
C.VILLAGE_ID = 0 or C.VILLAGE_ID in (
select LOCATION_ID from b_sale_loc_word_stat
where
TYPE_ID = 6
and
(".$preparedLike.")
)
)
and
(
C.STREET_ID = 0 or C.STREET_ID in (
select LOCATION_ID from b_sale_loc_word_stat
where
TYPE_ID = 7
and
(".$preparedLike.")
)
)
order by C.TYPE_SORT desc
limit 5
";
*/
print '<pre>';
print_r($sql);
print '</pre>';
return $dbConnection->query($sql);
}
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:58,代码来源:chain.php
示例3: initializeData
public static function initializeData()
{
$locationTable = Location\LocationTable::getTableName();
$groupLocationTable = Location\GroupLocationTable::getTableName();
$siteLocationTable = Location\SiteLocationTable::getTableName();
// ORACLE: OK, MSSQL: OK
$sql = "\n\t\t\tinsert into " . static::getTableName() . " \n\t\t\t\t(LOCATION_ID, SITE_ID) \n\t\t\tselect LC.ID, LS.SITE_ID\n\t\t\t\tfrom " . $siteLocationTable . " LS\n\t\t\t\t\tinner join " . $locationTable . " L on LS.LOCATION_ID = L.ID and LS.LOCATION_TYPE = 'L'\n\t\t\t\t\tinner join " . $locationTable . " LC on LC.LEFT_MARGIN >= L.LEFT_MARGIN and LC.RIGHT_MARGIN <= L.RIGHT_MARGIN\n\t\t\tunion \n\t\t\tselect LC.ID, LS.SITE_ID\n\t\t\t\tfrom " . $siteLocationTable . " LS\n\t\t\t\t\tinner join " . $groupLocationTable . " LG on LS.LOCATION_ID = LG.LOCATION_GROUP_ID and LS.LOCATION_TYPE = 'G'\n\t\t\t\t\tinner join " . $locationTable . " L on LG.LOCATION_ID = L.ID\n\t\t\t\t\tinner join " . $locationTable . " LC on LC.LEFT_MARGIN >= L.LEFT_MARGIN and LC.RIGHT_MARGIN <= L.RIGHT_MARGIN\n\t\t";
Main\HttpApplication::getConnection()->query($sql);
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:9,代码来源:sitelink.php
示例4: setDebugModeOn
public static function setDebugModeOn()
{
global $DB, $APPLICATION;
// define("PERFMON_STARTED", $DB->ShowSqlStat."|".\Bitrix\Main\Data\Cache::getShowCacheStat()."|".$APPLICATION->ShowIncludeStat);
$DB->ShowSqlStat = true;
$application = \Bitrix\Main\HttpApplication::getInstance();
$application->getConnection()->startTracker();
\Bitrix\Main\Data\Cache::setShowCacheStat(COption::GetOptionString("perfmon", "cache_log") === "Y");
$APPLICATION->ShowIncludeStat = true;
}
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:10,代码来源:keeper.php
示例5: addPropertyValueField
protected static function addPropertyValueField($tableAlias = 'V', &$arFields, &$arSelectFields)
{
$tableAlias = \Bitrix\Main\HttpApplication::getConnection()->getSqlHelper()->forSql($tableAlias);
// locations kept in CODEs, but must be shown as IDs
if (CSaleLocation::isLocationProMigrated()) {
$arSelectFields = array_merge(array('PROP_TYPE'), $arSelectFields);
// P.TYPE should be there and go above our join
$arFields['VALUE'] = array("FIELD" => "\n\t\t\t\tCASE\n\n\t\t\t\t\tWHEN\n\t\t\t\t\t\tP.TYPE = 'LOCATION'\n\t\t\t\t\tTHEN\n\t\t\t\t\t\tCAST(L.ID as " . \Bitrix\Sale\Location\DB\Helper::getSqlForDataType('char', 255) . ")\n\n\t\t\t\t\tELSE\n\t\t\t\t\t\t" . $tableAlias . ".VALUE\n\t\t\t\tEND\n\t\t\t", "TYPE" => "string", "FROM" => "LEFT JOIN b_sale_location L ON (P.TYPE = 'LOCATION' AND " . $tableAlias . ".VALUE IS NOT NULL AND " . $tableAlias . ".VALUE = L.CODE)");
$arFields['VALUE_ORIG'] = array("FIELD" => $tableAlias . ".VALUE", "TYPE" => "string");
} else {
$arFields['VALUE'] = array("FIELD" => $tableAlias . ".VALUE", "TYPE" => "string");
}
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:13,代码来源:order_user_props_value.php
示例6: dropIndexByName
public static function dropIndexByName($indexName, $tableName)
{
$dbConnection = Main\HttpApplication::getConnection();
$dbHelper = $dbConnection->getSqlHelper();
$indexName = $dbHelper->forSql(trim($indexName));
$tableName = $dbHelper->forSql(trim($tableName));
if (!strlen($indexName) || !strlen($tableName)) {
return false;
}
if (!static::checkIndexNameExists($indexName, $tableName)) {
return false;
}
$dbConnection->query("drop index {$indexName} on {$tableName}");
return true;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:15,代码来源:helper.php
示例7: execute
protected function execute(InputInterface $input, OutputInterface $output)
{
global $DB, $DBType, $DBHost, $DBLogin, $DBPassword, $DBName, $DBDebug, $DBDebugToFile, $APPLICATION, $USER, $arWizardConfig, $MESS;
$bitrixRoot = $this->projectPath;
$output->writeln("Install bitrix... in {$bitrixRoot}");
$st = 1;
/*
$output->writeln("Step $st. Create database:");
++$st;
$wizard = new \CWizardBase("nonlux.createDb.wizard", null);
$dbName = $this->config['database'];
$output->writeln("database name: $dbName");
$data = $this->getConfig(array(
"agree_license",
"user" ,
"password",
"database",
"utf8",
"dbType",
"host",
"create_user",
"create_database",
"root_user",
"root_password",
'file_access_perms',
'folder_access_perms',
'bitrixRoot'
));
foreach ($data as $key => $value) {
$wizard->SetVar($key, $value);
}
$step = new \CreateDBStep();
$wizard->AddStep($step);
$step->OnPostForm();
$errors=$step->GetErrors();
if (isset($errors[0])){
$last_error=iconv('cp1251', 'utf-8', $errors[0][0]);
throw new \Exception($last_error);
}
$output->writeln("Done");
*/
$output->writeln("Step {$st}. Generate config files:");
++$st;
$data = $this->getConfig(array("agree_license", "user", "password", "database", "utf8", "dbType", "host", "create_user", "create_database", "root_user", "root_password", 'file_access_perms', 'folder_access_perms', 'bitrixRoot'));
$settings = sprintf("<?php\nreturn array (\n 'className' => '\\\\Bitrix\\\\Main\\\\DB\\\\MysqliConnection',\n 'host' => '%s',\n 'database' => '%s',\n 'login' => '%s',\n 'password' => '%s',\n 'options' => 2,\n );\n", $data['host'], $data['database'], $data['user'], $data['password']);
file_put_contents($bitrixRoot . '/bitrix/.db_settings.php', $settings);
$settings = "<?php return require(__DIR__.'/.settings_prod.php');";
file_put_contents($bitrixRoot . '/bitrix/.settings.php', $settings);
$output->writeln("Done");
$_SERVER["DOCUMENT_ROOT"] = $bitrixRoot;
$_SERVER["REQUEST_URI"] = "/index.php";
$_SERVER["QUERY_STRING"] = "";
define("B_PROLOG_INCLUDED", true);
ob_start();
require_once "{$bitrixRoot}/bitrix/modules/main/install/wizard/wizard.php";
ob_end_clean();
require_once $bitrixRoot . '/bitrix/php_interface/dbconn.php';
$connection = \Bitrix\Main\Application::getConnection();
var_dump($connection);
$output->writeln("Step {$st}. Install modules:");
++$st;
$wizard = new \CWizardBase("nonlux.installModules.wizard", null);
$data = array_merge(array("nextStep" => "main", "nextStepStage" => "files"), $this->getConfig(array('bitrixRoot', "user", "password", "utf8")));
$step = new CreateModulesStep();
$wizard->AddStep($step);
foreach ($data as $key => $value) {
$wizard->SetVar($key, $value);
}
do {
$wizard->SetVar("nextStepStage", "files");
$output->writeln("Install " . $wizard->GetVar("nextStep") . " " . $wizard->GetVar("nextStepStage"));
$step->OnPostForm();
if ($wizard->GetVar("nextStep") === 'main' && $wizard->GetVar("nextStepStage") === 'files') {
$HttpApplication = \Bitrix\Main\HttpApplication::getInstance();
$HttpApplication->initializeBasicKernel();
$HttpApplication->getCache()->clearCache(true);
$GLOBALS['CACHE_MANAGER']->Clean('b_option');
Option::clearOptions("main");
}
} while ($wizard->GetVar('nextStep') != '__finish');
$output->writeln("Done");
/*
$USER = new \CUser;
$policy = $USER->GetSecurityPolicy();
$output->writeln("Step $st. Create admin:");
++$st;
$data = $this->getConfig(array(
'email',
'login',
'admin_password_confirm',
'admin_password',
'user_name',
"utf8",
'user_surname'
));
foreach ($data as $key => $value) {
//.........这里部分代码省略.........
开发者ID:nonlux,项目名称:bitapp,代码行数:101,代码来源:BitrixInstallCommand.php
示例8: getmicrotime
<?php
if (file_exists($_SERVER["DOCUMENT_ROOT"] . "/bitrix/d7.php")) {
function getmicrotime()
{
list($usec, $sec) = explode(" ", microtime());
return (double) $usec + (double) $sec;
}
require_once dirname(__FILE__) . "/../bx_root.php";
include_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/lib/loader.php";
/** @var $application \Bitrix\Main\HttpApplication */
$application = \Bitrix\Main\HttpApplication::getInstance();
$application->turnOnCompatibleMode();
$application->setInputParameters($_GET, $_POST, $_FILES, $_COOKIE, $_SERVER, $_ENV);
$application->initialize();
$page = new \Bitrix\Main\PublicPage();
$application->setPage($page);
$application->start();
CMain::PrologActions();
return;
}
define("START_EXEC_PROLOG_BEFORE_1", microtime());
$GLOBALS["BX_STATE"] = "PB";
if (isset($_REQUEST["BX_STATE"])) {
unset($_REQUEST["BX_STATE"]);
}
if (isset($_GET["BX_STATE"])) {
unset($_GET["BX_STATE"]);
}
if (isset($_POST["BX_STATE"])) {
unset($_POST["BX_STATE"]);
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:prolog_before.php
示例9: truncateTable
public static function truncateTable($tableName)
{
$dbConnection = Main\HttpApplication::getConnection();
$tableName = $dbConnection->getSqlHelper()->forSql($tableName);
if ($dbConnection->isTableExists($tableName)) {
Main\HttpApplication::getConnection()->query('truncate table ' . $tableName);
}
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:8,代码来源:commonhelper.php
示例10: prepareSql
protected function prepareSql($row)
{
if(!is_array($row) || empty($row))
return '';
$sql = array();
foreach($this->fldVector as $fld => $none)
{
$val = $row[$fld];
// only numeric and literal fields supported at the moment
if($this->tableMap[$fld]['data_type'] == 'integer')
$sql[] = intval($val);
else
$sql[] = "'".Main\HttpApplication::getConnection()->getSqlHelper()->forSql($val)."'";
}
return '('.implode(',', $sql).')';
}
开发者ID:akniyev,项目名称:arteva.ru,代码行数:19,代码来源:dbblockinserter.php
示例11: resetAutoIncrement
public static function resetAutoIncrement($tableName, $startIndex = 1)
{
$startIndex = intval($startIndex);
if ($startIndex <= 0 || !strlen($tableName)) {
return false;
}
$dbConnection = Main\HttpApplication::getConnection();
$dbHelper = $dbConnection->getSqlHelper();
$tableName = $dbHelper->forSql(trim($tableName));
if (strlen($tableName) > 27) {
// too long
return false;
}
if ($sqName = Helper::checkSequenceExistsForTable($tableName)) {
$dbConnection->query('drop sequence ' . $sqName);
}
$dbConnection->query('create sequence ' . $sqName . ' start with ' . $startIndex . ' increment by 1 NOMAXVALUE NOCYCLE NOCACHE NOORDER');
$dbConnection->query("\n\t\t\tCREATE OR REPLACE TRIGGER " . $tableName . "_I\n\t\t\tBEFORE INSERT\n\t\t\tON " . $tableName . "\n\t\t\tFOR EACH ROW\n\t\t\tBEGIN\n\t\t\t\tIF :NEW.ID IS NULL THEN\n\t\t\t\t\tSELECT " . $sqName . ".NEXTVAL INTO :NEW.ID FROM dual;\n\t\t\t\tEND IF;\n\t\t\tEND;\n\t\t");
return true;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:20,代码来源:helper.php
示例12: resetLegacyPath
public static function resetLegacyPath()
{
Helper::dropTable(self::TABLE_LEGACY_RELATIONS);
$dbConnection = \Bitrix\Main\HttpApplication::getConnection();
$dbConnection->query("create table " . self::TABLE_LEGACY_RELATIONS . " (\n\t\t\tID " . Helper::getSqlForDataType('int') . ",\n\t\t\tCOUNTRY_ID " . Helper::getSqlForDataType('int') . ",\n\t\t\tREGION_ID " . Helper::getSqlForDataType('int') . ",\n\t\t\tCITY_ID " . Helper::getSqlForDataType('int') . "\n\t\t)");
$dbConnection->query("insert into " . self::TABLE_LEGACY_RELATIONS . " (ID, COUNTRY_ID, REGION_ID, CITY_ID) select ID, COUNTRY_ID, REGION_ID, CITY_ID from b_sale_location");
Location\LocationTable::resetLegacyPath();
}
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:8,代码来源:migrate.php
示例13: getNameOfParentOfType
protected static function getNameOfParentOfType($item, $typeCode, $strLang = LANGUAGE_ID)
{
/*
$item = Location\LocationTable::getList(array('filter' => array(
'<=LEFT_MARGIN' => $item['LEFT_MARGIN'],
'>=RIGHT_MARGIN' => $item['RIGHT_MARGIN'],
'=TYPE.CODE' => $typeCode,
'=NAME.LANGUAGE_ID' => $strLang
), 'select' => array(
ToUpper($typeCode).'_NAME' => 'NAME.NAME',
ToUpper($typeCode).'_NAME_ORIG' => 'NAME.NAME',
ToUpper($typeCode).'_SHORT_NAME' => 'NAME.SHORT_NAME',
ToUpper($typeCode).'_NAME_LANG' => 'NAME.LANGUAGE_ID'
)))->fetch();
*/
global $DB;
$dbConnection = Main\HttpApplication::getConnection();
$dbHelper = $dbConnection->getSqlHelper();
$types = self::getTypes();
$typeCode = ToUpper($dbHelper->forSql($typeCode));
$strLang = substr($dbHelper->forSql($strLang), 0, 2);
$mappedTypes = array("'" . intval($types[$typeCode]) . "'");
if ($typeCode == 'CITY' && intval($types['VILLAGE'])) {
$mappedTypes[] = "'" . intval($types['VILLAGE']) . "'";
}
$query = "\n\t\t\tselect \n\t\t\t\tN.NAME as " . $typeCode . "_NAME,\n\t\t\t\tN.SHORT_NAME as " . $typeCode . "_SHORT_NAME,\n\t\t\t\tL.ID as " . $typeCode . "_ID\n\t\t\tfrom \n\t\t\t\tb_sale_loc_name N\n\t\t\t\tinner join b_sale_location L on \n\t\t\t\t\tN.LOCATION_ID = L.ID \n\t\t\t\t\tand\n\t\t\t\t\tN.LANGUAGE_ID = '" . $strLang . "'\n\t\t\t\t\tand\n\t\t\t\t\tL.LEFT_MARGIN <= '" . intval($item['LEFT_MARGIN']) . "'\n\t\t\t\t\tand\n\t\t\t\t\tL.RIGHT_MARGIN >= '" . intval($item['RIGHT_MARGIN']) . "'\n\t\t\t\t\tand\n\t\t\t\t\tL.TYPE_ID in (" . implode(', ', $mappedTypes) . ")\n\t\t";
$item = $DB->query($query)->fetch();
$item[$typeCode . '_NAME_ORIG'] = $item[$typeCode . '_NAME'];
$item[$typeCode . '_NAME_LANG'] = $item[$typeCode . '_NAME'];
if (!is_array($item)) {
return array();
}
return $item;
}
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:34,代码来源:location.php
示例14: getBoundsByWord
public static function getBoundsByWord($word)
{
$word = trim($word);
$dbConnection = Main\HttpApplication::getConnection();
$sql = "select MIN(POSITION) as INF, MAX(POSITION) as SUP from " . static::getTableName() . " where WORD like '" . ToUpper($dbConnection->getSqlHelper()->forSql($word)) . "%'";
return $dbConnection->query($sql)->fetch();
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:7,代码来源:word.php
示例15: deleteByTaskId
/**
* Removes a task from favorites for all users. This function DOES NOT check permissions.
*
* @param integer Task id
* @param mixed[] Behaviour
*
* <li> LOW_LEVEL boolean If set to true, function will ignore all events and do a low-level db query
*
* @return \Bitrix\Main\Entity\DeleteResult
*/
public static function deleteByTaskId($taskId, $behaviour = array('LOW_LEVEL' => false))
{
$taskId = Assert::expectIntegerPositive($taskId, '$taskId');
if (!is_array($behaviour)) {
$behaviour = array();
}
if (!isset($behaviour['LOW_LEVEL'])) {
$behaviour['LOW_LEVEL'] = false;
}
if ($behaviour['LOW_LEVEL']) {
HttpApplication::getConnection()->query("delete from " . static::getTableName() . " where TASK_ID = '" . intval($taskId) . "'");
$result = true;
} else {
$result = array();
$res = static::getList(array('filter' => array('=TASK_ID' => $taskId)));
while ($item = $res->fetch()) {
$result[] = static::delete(array('TASK_ID' => $item['TASK_ID'], 'USER_ID' => $item['USER_ID']));
}
}
return $result;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:favorite.php
示例16: cleanUp
public static function cleanUp()
{
Main\HttpApplication::getConnection()->query('truncate table ' . static::getTableName());
}
开发者ID:Satariall,项目名称:izurit,代码行数:4,代码来源:wordstat.php
示例17: deleteMultipleByParentRangeSql
/**
* This method is for internal use only. It may be changed without any notification further, or even mystically disappear.
*
* @access private
*/
public static function deleteMultipleByParentRangeSql($sql)
{
if (!strlen($sql)) {
throw new Main\SystemException('Range sql is empty');
}
$dbConnection = Main\HttpApplication::getConnection();
$dbConnection->query('delete from ' . static::getTableName() . ' where ' . static::getReferenceFieldName() . ' in (' . $sql . ')');
}
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:13,代码来源:nameentity.php
示例18: deleteByTemplateId
/**
* Removes all checklist's items for given template.
* This function is low-level, i.e. it disrespects any events\callbacks
*
* @param integer $templateId
* @throws \Bitrix\Main\ArgumentException
*/
public static function deleteByTemplateId($templateId)
{
$templateId = Assert::expectIntegerPositive($templateId, '$templateId');
\Bitrix\Main\HttpApplication::getConnection()->query("DELETE FROM " . static::getTableName() . " WHERE TEMPLATE_ID = '" . $templateId . "'");
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:12,代码来源:checklistitem.php
示例19: initData
public static function initData($parameters = array())
{
static::cleanUp();
$sql = "\n\t\t\tinsert into b_sale_loc_search_sitelink \n\t\t\t\t(LOCATION_ID, SITE_ID) \n\t\t\tselect distinct LC.ID, LS.SITE_ID\n\t\t\t\tfrom b_sale_loc_2site LS\n\t\t\t\t\tinner join b_sale_location L on LS.LOCATION_ID = L.ID\n\t\t\t\t\tinner join b_sale_location LC on LC.LEFT_MARGIN >= L.LEFT_MARGIN and LC.RIGHT_MARGIN <= L.RIGHT_MARGIN\n\t\t";
Main\HttpApplication::getConnection()->query($sql);
}
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:6,代码来源:sitelink.php
示例20: InstallModule
function InstallModule($_1998741287, $_1652945689)
{
if ($_1998741287 == ___125355289(1660)) {
$GLOBALS['____1308158154'][361](E_COMPILE_ERROR | E_ERROR | E_CORE_ERROR | E_PARSE);
global $DB, $DBType, $DBHost, $DBLogin, $DBPassword, $DBName, $DBDebug, $DBDebugToFile, $APPLICATION;
$_918413367 = \Bitrix\Main\HttpApplication::getInstance();
$_918413367->initializeBasicKernel();
require_once $_SERVER[___125355289(1661)] . BX_PERSONAL_ROOT . ___125355289(1662);
require_once $_SERVER[___125355289(1663)] . ___125355289(1664);
require_once $_SERVER[___125355289(1665)] . ___125355289(1666) . $DBType . ___125355289(1667);
require_once $_SERVER[___125355289(1668)] . ___125355289(1669);
require_once $_SERVER[___125355289(1670)] . ___125355289(1671);
require_once $_SERVER[___125355289(1672)] . ___125355289(1673) . $DBType . ___125355289(1674);
require_once $_SERVER[___125355289(1675)] . ___125355289(1676);
require_once $_SERVER[___125355289(1677)] . ___125355289(1678) . $DBType . ___125355289(1679);
require_once $_SERVER[___125355289(1680)] . ___125355289(1681) . $DBType . ___125355289(1682);
require_once $_SERVER[___125355289(1683)] . ___125355289(1684) . $DBType . ___125355289(1685);
require_once $_SERVER[___125355289(1686)] . ___125355289(1687) . $DBType . ___125355289(1688);
require_once $_SERVER[___125355289(1689)] . ___125355289(1690) . $DBType . ___125355289(1691);
} else {
global $DB, $DBType, $DBHost, $DBLogin, $DBPassword, $DBName, $DBDebug, $DBDebugToFile, $APPLICATION, $USER, $MESS;
$_725846781 = $MESS;
require_once $_SERVER[___125355289(1692)] . ___125355289(1693);
$MESS = $GLOBALS['____1308158154'][362]($MESS, $_725846781);
if ($GLOBALS['____1308158154'][363]($DB->type) == ___125355289(1694) && $GLOBALS['____1308158154'][364](___125355289(1695)) && $GLOBALS['____1308158154'][365](MYSQL_TABLE_TYPE) > min(192, 0, 64)) {
$DB->Query(___125355289(1696) . MYSQL_TABLE_TYPE . ___125355289(1697), true);
}
global $MESS;
include $_SERVER[___125355289(1698)] . ___125355289(1699);
if (LANGUAGE_ID != ___125355289(1700) && $GLOBALS['____1308158154'][366]($_SERVER[___125355289(1701)] . ___125355289(1702) . LANGUAGE_ID . ___125355289(1703))) {
include $_SERVER[___125355289(1704)] . ___125355289(1705) . LANGUAGE_ID . ___125355289(1706);
}
if (IsModuleInstalled($_1998741287) && $_1652945689 == ___125355289(1707)) {
return true;
}
}
@$GLOBALS['____1308158154'][367](round(0 + 3600));
$_751369233 =& $this->__1633338433($_1998741287);
if (!$GLOBALS['____1308158154'][368]($_751369233)) {
return true;
}
if ($_1652945689 == ___125355289(1708)) {
return true;
} elseif ($_1652945689 == ___125355289(1709)) {
if (!$this->IsModuleEncode($_1998741287)) {
if ($_1998741287 == ___125355289(1710)) {
$this->EncodeDemoWizard();
}
BXInstallServices::EncodeDir($_SERVER[___125355289(1711)] . ___125355289(1712) . $_1998741287, INSTALL_CHARSET);
$this->SetEncodeModule($_1998741287);
}
return true;
} elseif ($_1652945689 == ___125355289(1713)) {
$DBDebug = true;
if (!$_751369233->InstallDB()) {
if ($_1863542457 = $APPLICATION->GetException()) {
BXInstallServices::Add2Log($_1863542457->GetString(), ___125355289(1714));
}
return false;
}
$_751369233->InstallEvents();
if ($_1998741287 == ___125355289(1715)) {
$_2066407594 = array(___125355289(1716), ___125355289(1717), ___125355289(1718), ___125355289(1719), $GLOBALS['____1308158154'][369](___125355289(1720)));
$_1147689662 = $_SERVER[___125355289(1721)] . ___125355289(1722) . $GLOBALS['____1308158154'][370](___125355289(1723), $_2066407594);
$_1352053273 = round(0 + 7.5 + 7.5 + 7.5 + 7.5);
if ($GLOBALS['____1308158154'][371]($_SERVER[___125355289(1724)] . ___125355289(1725))) {
$bxProductConfig = array();
include $_SERVER[___125355289(1726)] . ___125355289(1727);
if (isset($bxProductConfig[___125355289(1728)][___125355289(1729)])) {
$_774506179 = $GLOBALS['____1308158154'][372]($bxProductConfig[___125355289(1730)][___125355289(1731)]);
if ($_774506179 > 1236 / 2 - 618 && $_774506179 < round(0 + 7.5 + 7.5 + 7.5 + 7.5)) {
$_1352053273 = $_774506179;
}
}
}
$_104682532 = ___125355289(1732);
$_279588367 = $GLOBALS['____1308158154'][373](___125355289(1733), $GLOBALS['____1308158154'][374](min(170, 0, 56.666666666667), 890 - 2 * 445, 1152 / 2 - 576, $GLOBALS['____1308158154'][375](___125355289(1734)), $GLOBALS['____1308158154'][376](___125355289(1735)) + $_1352053273, $GLOBALS['____1308158154'][377](___125355289(1736))));
$_357410628 = $GLOBALS['____1308158154'][378](___125355289(1737), $GLOBALS['____1308158154'][379](1352 / 2 - 676, 202 * 2 - 404, min(60, 0, 20), $GLOBALS['____1308158154'][380](___125355289(1738)), $GLOBALS['____1308158154'][381](___125355289(1739)) + $_1352053273, $GLOBALS['____1308158154'][382](___125355289(1740))));
$_2101028031 = $GLOBALS['____1308158154'][383](___125355289(1741), $GLOBALS['____1308158154'][384](min(248, 0, 82.666666666667), 782 - 2 * 391, 904 - 2 * 452, $GLOBALS['____1308158154'][385](___125355289(1742)), $GLOBALS['____1308158154'][386](___125355289(1743)) + $_1352053273, $GLOBALS['____1308158154'][387](___125355289(1744))));
$_1230282874 = ___125355289(1745);
$_754705508 = ___125355289(1746) . $GLOBALS['____1308158154'][388]($_279588367, round(0 + 0.25 + 0.25 + 0.25 + 0.25), round(0 + 0.2 + 0.2 + 0.2 + 0.2 + 0.2)) . $GLOBALS['____1308158154'][389]($_2101028031, round(0 + 3), round(0 + 0.2 + 0.2 + 0.2 + 0.2 + 0.2)) . ___125355289(1747) . $GLOBALS['____1308158154'][390]($_357410628, 768 - 2 * 384, round(0 + 1)) . $GLOBALS['____1308158154'][391]($_2101028031, round(0 + 0.2 + 0.2 + 0.2 + 0.2 + 0.2), round(0 + 0.33333333333333 + 0.33333333333333 + 0.33333333333333)) . ___125355289(1748) . $GLOBALS['____1308158154'][392]($_279588367, 1416 / 2 - 708, round(0 + 0.5 + 0.5)) . ___125355289(1749) . $GLOBALS['____1308158154'][393]($_2101028031, 146 * 2 - 292, round(0 + 0.2 + 0.2 + 0.2 + 0.2 + 0.2)) . ___125355289(1750) . $GLOBALS['____1308158154'][394]($_2101028031, round(0 + 1 + 1), round(0 + 0.2 + 0.2 + 0.2 + 0.2 + 0.2)) . ___125355289(1751) . $GLOBALS['____1308158154'][395]($_357410628, round(0 + 0.5 + 0.5), round(0 + 0.2 + 0.2 + 0.2 + 0.2 + 0.2)) . ___125355289(1752);
$_104682532 = $GLOBALS['____1308158154'][396](___125355289(1753)) . $GLOBALS['____1308158154'][397](___125355289(1754), $_104682532, ___125355289(1755));
$_1855239886 = $GLOBALS['____1308158154'][398]($_104682532);
$_1478677807 = 1360 / 2 - 680;
for ($_676804512 = 1496 / 2 - 748; $_676804512 < $GLOBALS['____1308158154'][399]($_754705508); $_676804512++) {
$_1230282874 .= $GLOBALS['____1308158154'][400]($GLOBALS['____1308158154'][401]($_754705508[$_676804512]) ^ $GLOBALS['____1308158154'][402]($_104682532[$_1478677807]));
if ($_1478677807 == $_1855239886 - round(0 + 0.33333333333333 + 0.33333333333333 + 0.33333333333333)) {
$_1478677807 = 924 - 2 * 462;
} else {
$_1478677807 = $_1478677807 + round(0 + 0.25 + 0.25 + 0.25 + 0.25);
}
}
$_1230282874 = ___125355289(1756) . ___125355289(1757) . ___125355289(1758) . $GLOBALS['____1308158154'][403]($_1230282874) . ___125355289(1759) . ___125355289(1760) . ___125355289(1761);
BXInstallServices::CheckDirPath($_1147689662);
if (!$GLOBALS['____1308158154'][404]($_1147689662)) {
$_1318943328 = @$GLOBALS['____1308158154'][405]($_1147689662, ___125355289(1762));
@$GLOBALS['____1308158154'][406]($_1318943328, $_1230282874);
@$GLOBALS['____1308158154'][407]($_1318943328);
}
$_32065584 = ___125355289(1763);
//.........这里部分代码省略.........
开发者ID:spas-viktor,项目名称:books,代码行数:101,代码来源:wizard.php
注:本文中的Bitrix\Main\HttpApplication类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论