Created
March 30, 2014 21:13
-
-
Save Mausglov/9879902 to your computer and use it in GitHub Desktop.
бутстрап для любых консольных скриптов под Битрикс
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* бутстрап для любых консольных скриптов под Битрикс | |
*/ | |
define("LANG", "ru"); | |
define("NO_KEEP_STATISTIC", true); | |
define("NOT_CHECK_PERMISSIONS", true); | |
define("BX_BUFFER_USED", true); | |
// это отключает исполнение агентов | |
define("BX_CLUSTER_GROUP", 2); | |
$_SERVER["DOCUMENT_ROOT"] = "set path here"; | |
chdir($_SERVER["DOCUMENT_ROOT"]); | |
// windows workaround | |
if ( strpos($_SERVER["DOCUMENT_ROOT"], '\\') !== false ) { | |
$_SERVER["DOCUMENT_ROOT"] = str_replace('\\', '/', substr( $_SERVER["DOCUMENT_ROOT"], 2 )); | |
} | |
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php"); | |
while (ob_get_level()) { | |
ob_end_flush(); | |
} | |
// include all needful modules | |
CModule::IncludeModule("iblock") or die(); | |
CModule::IncludeModule("catalog") or die(); | |
CModule::IncludeModule("sale") or die(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment