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
Отключаем SelLinux: | |
sudo vi /etc/selinux/config | |
В файле меняем параметр SELINUX=disabled и перезагружаем машину. Это должно сработать. |
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
К примеру! У нас есть сайт с одним набором файлов, нужно лишь фильтровать по разным городам. | |
Чтобы не изменять файловую структуру сделаем следующее: | |
1. Добавим ссылки формата: | |
- https://sitename.ru/moskow-city/vacancy/ | |
- https://sitename.ru/spb-city/vacancy/ | |
2. В .htaccess пропишем RewriteRule ^([^/]+)-city\/([^/]+)\/.* /$2/?city-code=$1 [NC,L] | |
3. В файле по адресу /vacancy/index.php работаем с get параметром city-code, в нем будет содержаться moskow или spb | |
Если хочется, чтобы в $_GET массив попали еще и QUERY_STRING, то добавляем | |
RewriteCond %{query_string} (.*) |
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
wget https://dl.eff.org/certbot-auto | |
chmod +x certbot-auto | |
sudo ./certbot-auto certonly --webroot --agree-tos --email [email protected] -w /home/bitrix/ext_www/domain.ru -d domain.ru -d www.domain.ru |
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
\Bitrix\Sale\Internals\UserPropsTable::query() | |
->setSelect(['ID', 'NAME', 'PROP_VALUE.*']) | |
->setFilter(['USER_ID' => $USER->GetID(), 'PROP_VALUE.ORDER_PROPS_ID' => 7, 'PROP_VALUE.VALUE' => 234234234]) | |
->registerRuntimeField('PROP_VALUE', [ | |
'data_type' => \Bitrix\Sale\Internals\UserPropsValueTable::class, | |
'reference' => array('=this.ID' => 'ref.USER_PROPS_ID'), | |
'join_type' => "LEFT" | |
])->exec()->fetchAll(); |
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
use Bitrix\Main\Application; | |
use Bitrix\Main\Entity\Base; | |
if (!Application::getConnection()->isTableExists(Base::getInstance('\Namespace\OrmNameTable')->getDBTableName())) { | |
Base::getInstance('\Namespace\OrmNameTable')->createDBTable(); | |
} |
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
Потребуется добавить дополнительно "SELECT" => ['UF_FIELD'] в атрибут select | |
$arResult = \CUser::GetList( | |
$by, | |
$sort, | |
['ID' => $USER->GetID()], | |
[ | |
"SELECT" => array( | |
"UF_CRM_CONTACT", | |
) |
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
Иногда идет n1, а не n0 | |
Строка, число, привязка к элементам, Дата, Дата время, Привязка к пользователю, Справочник: | |
[35] => Array | |
( | |
[n0] => Array | |
( | |
[VALUE] => | |
) | |
) |
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
1. Устанавливаем xdebug; | |
2. В php.ini включаем xdebug и настраиваем удаленное подключение: | |
zend_extension="/usr/lib64/php/modules/xdebug.so" | |
xdebug.profiler_enable = 0 | |
xdebug.remote_enable = 1 | |
xdebug.remote_host = 127.0.0.1 #именно 127.0.0.1, а не localhost, иначе может не сработать | |
xdebug.remote_port=9000 #смотрим свободный, через netstat -tnlp | grep 900 | |
xdebug.remote_handler=dbgp | |
xdebug.idekey=PHPSTORM #ключ по желанию |
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
Применительно к веб-окружению Битрикс: | |
Из главного меню окружения: | |
6. Manage sites.... | |
затем | |
4. Change email settings on site | |
Забиваем поля по любой доступной инструкции. Если почта не отправляется, переходим в /home/bitrix и открываем на редактирование | |
конфиг .msmtprc, содержание: | |
#Яндекс | |
logfile /home/bitrix/msmtp_domain.ru.log |
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
Под phpstorm 2016.1 рабочий http://idea.qinxi1992.cn |