Example #1
0
 public static function get_instance()
 {
     if (self::$instance === null) {
         self::$instance = new nc_backup();
     }
     return self::$instance;
 }
Example #2
0
 if (!$mode) {
     $mode = 'export';
 }
 $UI_CONFIG->activeToolbarButtons = array($mode);
 $UI_CONFIG->locationHash = 'tools.databackup.' . $mode;
 // if ($mode == 'export' && ! $id) {
 //     throw new Exception(TOOLS_COPYSUB_ERROR_PARAM, 1);
 // }
 // // Проверка токена
 // if ( $mode == 'export' AND ! $nc_core->token->verify()) {
 //     throw new Exception(NETCAT_TOKEN_INVALID, 1);
 // }
 //--------------------------------------------------------------------------
 require_once $SYSTEM_FOLDER . 'backup' . DS . 'nc_backup.class.php';
 // создаем объект импорта/экспорта соответствующий типу импортируемых данных
 $backup = new nc_backup();
 //--------------------------------------------------------------------------
 switch ($mode) {
     // ИМПОРТ
     case 'import':
         $file = $nc_core->input->fetch_files('import');
         $step = $nc_core->input->fetch_get_post('step');
         if ($file || $step) {
             if ($file) {
                 if (!$type) {
                     $type = $backup->detect_type($file);
                 }
                 $file = $file['tmp_name'];
             }
             if (!$type) {
                 throw new Exception("Type not set", 1);
Example #3
0
 /**
  *
  * @return nc_backup
  */
 public function backup()
 {
     require_once $this->SYSTEM_FOLDER . 'backup/nc_backup.class.php';
     return nc_backup::get_instance();
 }