Add db backup/restore
This commit is contained in:
@@ -40,7 +40,7 @@ class ToolBox
|
||||
if(defined('STDIN')) mb_parse_str(implode('&', array_slice($argv, 1)), $_GET);
|
||||
$_REQUEST = array_merge($_GET, $_REQUEST);
|
||||
}
|
||||
|
||||
|
||||
public static function array_map_encapsulate($oData, $sChar)
|
||||
{
|
||||
if(is_array($oData))
|
||||
@@ -126,6 +126,32 @@ class ToolBox
|
||||
return json_encode($asData);
|
||||
}
|
||||
|
||||
public static function curl($sUrl, $bHeader=false, $asPostData=array(), $sCookie='', $sCreds='') {
|
||||
$oCurl = curl_init();
|
||||
curl_setopt($oCurl, CURLOPT_URL, $sUrl);
|
||||
curl_setopt($oCurl, CURLOPT_VERBOSE, false);
|
||||
curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, false);
|
||||
|
||||
curl_setopt($oCurl, CURLOPT_HEADER, $bHeader);
|
||||
if($bHeader) curl_setopt($oCurl, CURLOPT_FOLLOWLOCATION, true);
|
||||
|
||||
if(!empty($asPostData)) {
|
||||
curl_setopt($oCurl, CURLOPT_POST, 1);
|
||||
curl_setopt($oCurl, CURLOPT_POSTFIELDS, $asPostData);
|
||||
}
|
||||
|
||||
curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($oCurl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
|
||||
|
||||
if($sCookie!='') curl_setopt($oCurl, CURLOPT_COOKIE, $sCookie);
|
||||
if($sCreds!='') curl_setopt($oCurl, CURLOPT_USERPWD, $sCreds);
|
||||
|
||||
$sContent = curl_exec($oCurl);
|
||||
curl_close($oCurl);
|
||||
return $sContent;
|
||||
}
|
||||
|
||||
public static function getMimeType($sPath, $bSubTypeOnly=false)
|
||||
{
|
||||
$sMimetype = '';
|
||||
|
||||
Reference in New Issue
Block a user