-
Notifications
You must be signed in to change notification settings - Fork 983
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/WWBN/AVideo
- Loading branch information
Showing
62 changed files
with
8,675 additions
and
6,202 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
$cmd = 'ps aux | grep YPTSocket'; | ||
exec($cmd); | ||
|
||
$cmd = 'cat /proc/56529/limits | grep open'; | ||
exec($cmd); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
//streamer config | ||
require_once '../videos/configuration.php'; | ||
|
||
if (!isCommandLineInterface()) { | ||
return die('Command Line only'); | ||
} | ||
|
||
ob_end_flush(); | ||
|
||
$file = Video::getStoragePath().'mysqldump-'.date('YmdHis').'.sql'; | ||
|
||
passthru("mysqldump --opt -u '{$mysqlUser}' -p'{$mysqlPass}' -h {$mysqlHost} {$mysqlDatabase} > {$file}"); | ||
|
||
echo PHP_EOL."Dump file created at {$file}".PHP_EOL; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?php | ||
|
||
//streamer config | ||
$global['createDatabase'] = 1; | ||
$doNotIncludeConfig = 1; | ||
require_once '../videos/configuration.php'; | ||
|
||
$global['mysqli'] = new mysqli($mysqlHost, $mysqlUser, $mysqlPass, '', @$mysqlPort); | ||
$createSQL = "CREATE DATABASE IF NOT EXISTS {$mysqlDatabase};"; | ||
$global['mysqli']->query($createSQL); | ||
$global['mysqli']->select_db($mysqlDatabase); | ||
|
||
if (php_sapi_name() !== 'cli') { | ||
return die('Command Line only'); | ||
} | ||
|
||
ob_end_flush(); | ||
|
||
$globPattern = "{$global['systemRootPath']}videos/mysqldump-*.sql"; | ||
echo "Searching [{$globPattern}]" . PHP_EOL; | ||
$glob = glob($globPattern); | ||
foreach ($glob as $key => $file) { | ||
echo "($key) {$file}" . PHP_EOL; | ||
} | ||
|
||
echo "Type the number of what file you want to restore or just press enter to get the latest" . PHP_EOL; | ||
$option = trim(readline("")); | ||
|
||
if ($option === '') { | ||
$filename = end($glob); | ||
} else { | ||
$option = intval($option); | ||
$filename = $glob[$option]; | ||
} | ||
|
||
echo 'We will make a backup first ...' . PHP_EOL; | ||
|
||
$file = "{$global['systemRootPath']}videos/" . 'mysqlBackupBeforeRestore-' . date('YmdHis') . '.sql'; | ||
passthru("mysqldump --opt -u '{$mysqlUser}' -p'{$mysqlPass}' -h {$mysqlHost} {$mysqlDatabase} > {$file}"); | ||
echo PHP_EOL . "Backup file created at {$file}" . PHP_EOL; | ||
|
||
executeFile($filename); | ||
|
||
function executeFile($filename) { | ||
global $global; | ||
$templine = ''; | ||
// Read in entire file | ||
$lines = file($filename); | ||
// Loop through each line | ||
foreach ($lines as $line) { | ||
// Skip it if it's a comment | ||
if (substr($line, 0, 2) == '--' || $line == '') | ||
continue; | ||
|
||
// Add this line to the current segment | ||
$templine .= $line; | ||
// If it has a semicolon at the end, it's the end of the query | ||
if (substr(trim($line), -1, 1) == ';') { | ||
// Perform the query | ||
if (!$global['mysqli']->query($templine)) { | ||
echo ('sqlDAL::executeFile ' . $filename . ' Error performing query \'<strong>' . $templine . '\': ' . $global['mysqli']->error . '<br /><br />'); | ||
} | ||
// Reset temp variable to empty | ||
$templine = ''; | ||
} | ||
} | ||
} |
Oops, something went wrong.