本文整理汇总了PHP中jeedom::backup方法的典型用法代码示例。如果您正苦于以下问题:PHP jeedom::backup方法的具体用法?PHP jeedom::backup怎么用?PHP jeedom::backup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jeedom
的用法示例。
在下文中一共展示了jeedom::backup方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Exception
if (!in_array($extension, array('.tar.gz', '.gz', '.tar'))) {
throw new Exception('Extension du fichier non valide (autorisé .tar.gz, .tar et .gz) : ' . $extension);
}
if (filesize($_file['tmp_name']) > 50000000) {
throw new Exception('La taille du fichier est trop importante (maximum 50Mo)');
}
$bakcup_name = 'backup-' . jeedom::version() . '-' . date("d-m-Y-H\\hi") . '.tar.gz';
$uploadfile = $uploaddir . '/' . $bakcup_name;
if (!move_uploaded_file($_file['tmp_name'], $uploadfile)) {
throw new Exception('Impossible de téléverser le fichier');
}
jeedom::restore($uploadfile, true);
$jsonrpc->makeSuccess('ok');
}
if ($jsonrpc->getMethod() == 'jeeNetwork::backup') {
jeedom::backup(true);
$jsonrpc->makeSuccess('ok');
}
/* * ************************Log*************************** */
if ($jsonrpc->getMethod() == 'log::get') {
$jsonrpc->makeSuccess(log::get($params['log'], $params['start'], $params['nbLine']));
}
if ($jsonrpc->getMethod() == 'log::list') {
$jsonrpc->makeSuccess(log::liste());
}
if ($jsonrpc->getMethod() == 'log::empty') {
$jsonrpc->makeSuccess(log::clear($params['log']));
}
if ($jsonrpc->getMethod() == 'log::remove') {
$jsonrpc->makeSuccess(log::remove($params['log']));
}
示例2: Exception
throw new Exception(__('401 - Accès non autorisé', __FILE__), -1234);
}
if (init('action') == 'ssh') {
ajax::success(shell_exec(init('command')));
}
if (init('action') == 'update') {
jeedom::update();
ajax::success();
}
if (init('action') == 'clearDate') {
$cache = cache::byKey('jeedom::lastDate');
$cache->remove();
ajax::success();
}
if (init('action') == 'backup') {
jeedom::backup(true, init('noCloudUpload'));
ajax::success();
}
if (init('action') == 'restore') {
jeedom::restore(init('backup'), true);
ajax::success();
}
if (init('action') == 'restoreCloud') {
market::retoreBackup(init('backup'));
ajax::success();
}
if (init('action') == 'getUpdateLog') {
ajax::success(log::get('update', 0, 3000));
}
if (init('action') == 'getBackupLog') {
ajax::success(log::get('backup', 0, 3000));
示例3: __
}
try {
echo __("Mise à plat des droits...", __FILE__);
jeedom::cleanFileSytemRight();
echo __("OK\n", __FILE__);
} catch (Exception $e) {
echo __('***ERREUR*** ', __FILE__) . $e->getMessage();
}
if (init('level', -1) < 1) {
if (config::byKey('update::backupBefore') == 1 && init('mode') != 'force') {
try {
global $NO_PLUGIN_BAKCUP;
$NO_PLUGIN_BAKCUP = true;
global $NO_CLOUD_BAKCUP;
$NO_CLOUD_BAKCUP = true;
jeedom::backup();
} catch (Exception $e) {
if (init('mode') != 'force') {
throw $e;
} else {
echo __('***ERREUR*** ', __FILE__) . $e->getMessage();
}
}
$backup_ok = true;
}
if (init('mode') == 'force') {
echo __("/!\\ Mise à jour en mode forcé /!\\ \n", __FILE__);
}
jeedom::stop();
if (init('version') == '') {
try {