當前位置: 首頁>>代碼示例>>PHP>>正文


PHP jeedom::restore方法代碼示例

本文整理匯總了PHP中jeedom::restore方法的典型用法代碼示例。如果您正苦於以下問題:PHP jeedom::restore方法的具體用法?PHP jeedom::restore怎麽用?PHP jeedom::restore使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在jeedom的用法示例。


在下文中一共展示了jeedom::restore方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: init

 }
 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));
 }
 if (init('action') == 'getRestoreLog') {
     ajax::success(log::get('restore', 0, 3000));
 }
開發者ID:saez0pub,項目名稱:core,代碼行數:31,代碼來源:jeedom.ajax.php

示例2: Exception

         throw new Exception('Repertoire de téléversement non trouvé : ' . $uploaddir);
     }
     $_file = $_FILES['file'];
     $extension = strtolower(strrchr($_file['name'], '.'));
     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']));
開發者ID:GaelGRIFFON,項目名稱:core,代碼行數:31,代碼來源:jeeApi.php

示例3: retoreBackup

 public static function retoreBackup($_backup)
 {
     $url = config::byKey('market::address') . "/core/php/downloadBackup.php?backup=" . $_backup . '&hwkey=' . jeedom::getHardwareKey() . '&username=' . urlencode(config::byKey('market::username')) . '&password=' . config::byKey('market::password') . '&password_type=sha1';
     $tmp_dir = dirname(__FILE__) . '/../../tmp';
     $tmp = $tmp_dir . '/' . $_backup;
     file_put_contents($tmp, fopen($url, 'r'));
     if (!file_exists($tmp)) {
         throw new Exception(__('Impossible de télécharger la sauvegarde : ', __FILE__) . $url . '.');
     }
     if (!file_exists(dirname(__FILE__) . '/../../backup/')) {
         mkdir(dirname(__FILE__) . '/../../backup/');
     }
     $backup_path = dirname(__FILE__) . '/../../backup/' . $_backup;
     if (!copy($tmp, $backup_path)) {
         throw new Exception(__('Impossible de copier le fichier de  : ', __FILE__) . $tmp . '.');
     }
     if (!file_exists($backup_path)) {
         throw new Exception(__('Impossible de trouver le fichier : ', __FILE__) . $backup_path . '.');
     }
     jeedom::restore('backup/' . $_backup, true);
 }
開發者ID:saez0pub,項目名稱:core,代碼行數:21,代碼來源:market.class.php

示例4: express

                config::save('cronSleepTime', 60);
            }
        } else {
            config::save('cronSleepTime', 60);
        }
        config::save('logLevel', $logLevel);
        echo "OK\n";
        echo 'Installation de socket.io et express (peut etre très long > 30min)';
        echo shell_exec('cd ' . dirname(__FILE__) . '/../core/nodeJS;sudo npm install socket.io;npm install express');
        echo "OK\n";
    }
    config::save('version', jeedom::version());
} catch (Exception $e) {
    if ($update) {
        if ($backup_ok && $update_begin) {
            jeedom::restore();
        }
        jeedom::start();
    }
    echo __('Erreur durant l\'installation : ', __FILE__) . $e->getMessage();
    echo __('Details : ', __FILE__) . print_r($e->getTrace());
    echo "[END UPDATE ERROR]\n";
    throw $e;
}
echo "[END UPDATE SUCCESS]\n";
function incrementVersion($_version)
{
    $version = explode('.', $_version);
    if ($version[2] < 500) {
        $version[2]++;
    } else {
開發者ID:GaelGRIFFON,項目名稱:core,代碼行數:31,代碼來源:install.php


注:本文中的jeedom::restore方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。