Skip to content

Instantly share code, notes, and snippets.

@sidor1989
Last active March 11, 2020 13:41
Show Gist options
  • Save sidor1989/0e2c2443d790641049c2c771f1ab73aa to your computer and use it in GitHub Desktop.
Save sidor1989/0e2c2443d790641049c2c771f1ab73aa to your computer and use it in GitHub Desktop.
<?
//пишем данные в файл. полезно при отладке аякс запросов
$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');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment