Skip to content

Instantly share code, notes, and snippets.

Служебные скрипты

wget http://dev.1c-bitrix.ru/download/scripts/bitrix_server_test.php
wget https://www.1c-bitrix.ru/download/files/scripts/restore.php

Настройки GIT

git config --global color.ui auto &&
<?
$arUrlRewrite = array(
array(
"CONDITION" => "~^/personal/projects/requests/(\\d+)/(\\?.*|\$)(?#__rule_sort_hack__)~",
"RULE" => "id=\$1",
"ID" => "",
"PATH" => "/personal/projects/requests/detail.php",
"SORT" => 100,
),
array(
@geff21st
geff21st / .htaccess
Last active September 8, 2017 03:15
# Removes index.php from ExpressionEngine URLs
RewriteCond %{REQUEST_URI} !^/bitrix/
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [L,NE,R] # <- for test, for prod use [L,NE,R=301]
# Adds trailing slashes
RewriteCond %{REQUEST_URI} !^/bitrix/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*[^/])$ /$1/ [L,NE,R] # <- for test, for prod use [L,NE,R=301]
<?
defined("B_PROLOG_INCLUDED") && B_PROLOG_INCLUDED === true || die();
if (!Bitrix\Main\Loader::includeModule("iblock")) return;
/**
* Когда нужно выводить элементы и получать из них разделы
* @source: https://gist.github.com/geff21st/fbf0abeb5422678e4622ccc288a10dac
* @global CMain $APPLICATION
* @var array $arParams
* @var array $arResult
*/
<?
$arData = array();
$cacheId = "cache_id/{$id}";
$cacheDir = $cacheId;
$cacheTag = "iblock_id_{$iblock}";
$cacheTime = 360000;
$cache = \Bitrix\Main\Data\Cache::createInstance();