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 | |
namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Http\Request; | |
use Illuminate\Routing\Route; | |
use Illuminate\Support\Str; | |
class NewRelicMiddleware |
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 | |
/** | |
* Ищет по тексту в инфоблоке. | |
* | |
* @param $iblockId int | array - ID инфоблока в котором искать. Может быть массивом. | |
* @param $query string - поисковый запрос. может содержать специфичные для Sphinx операторы ( * ) - будет передан прямо в Sphinx. | |
* рекомендуется передавать запрос вида <code>"*" . $searchQuery . "*"</code> | |
* @param $sectionId int - ID раздела в каталоге, в рамках которого искать | |
* @return array - список ID найденных элементов | |
* |
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
<? | |
// include core | |
/* | |
* создает новую форму и вопросы всех возможных типов | |
* */ | |
// у формы обязательно должен быть хоть один статус и один из них обязательно по умолчанию | |
// иначе не сохранить результат в админке или через стд компоненты | |
$status = new \Webform\Install\StatusBuilder(); | |
$status->add("Первый", true); |
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
# send any data to graylog server with http gelf protocol | |
# $1 - facility (info|warning|etc) | |
# $2 - application | |
# $3 - type | |
# $4 - short text (title) | |
# $5 - full text (body) | |
function send_to_graylog { | |
this_host="stage.np.ru" | |
graylog_http_gelf_host="IP:PORT" | |
msg='{"facility":"'$1'", "application":"'$2'", "type":"'$3'", "short_message":"'$4'", "full_message":"'$5'", "host":"'$this_host'"}' |
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 | |
/** | |
* Масштабирует фото, сохраняет копию файла и возвращает путь к нему | |
* либо возвращает ссылку на картинку-заглушку | |
* | |
* --- | |
* | |
* Водяной знак - если существует файл /upload/watermark/watermark_original.png - он будет | |
* смасштабирован под фото и нанесен на всю поверхность с небольшим отступом от края. |
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
https://www.ndchost.com/wiki/cloudlinux/how-to-add-commands-to-cagefs-users | |
https://www.supportsages.com/add-commandbinary-cagefs/ | |
# Adding packages to CageFS users | |
cagefsctl --addrpm <packagename> | |
cagefsctl --force-update |
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
# exclude | |
--exclude=upload/resize_cache --exclude=upload/1c_catalog* --exclude="*.tar*" --exclude="*.zip*" --exclude="*.sql*" --exclude="*.log*" --exclude="bitrix/cache" --exclude=bitrix/backup --exclude=bitrix/html_pages --exclude=_logs | |
--exclude=upload |
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 vendor/robmorgan/phinx/bin/phinx migrate` | |
Если запускать, как указано в мануале | |
`vendor/bin/phinx migrate` | |
то на опенсервере не тот пхп интерпретатор подключается из батника, а там не подключен PDO_MYSQL модуль. | |
--- | |
# добавить в .bashrc |
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
# open server bash alias for composer with php 5.6-x64 | |
alias composer="/d/OpenServer/modules/php/PHP-5.6-x64/php /d/OpenServer/modules/php/PHP-5.6-x64/composer.phar" | |
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
# сервис для выполнения запросов | |
https://www.hurl.it/ | |
# адрес для авторизации | |
/bitrix/admin/1c_exchange.php?mode=checkauth&type=catalog |
NewerOlder