/**
  * Loads all components from XML
  * @throws \Exception from \SimpleXMLElement
  */
 protected function loadComponentsXML()
 {
     if (!isset($this->xmlData['xml']->components)) {
         return;
     }
     if (!isset($this->xmlData['xml']->components->component)) {
         return;
     }
     foreach ($this->xmlData['xml']->components->component as $component) {
         $attributes = $component->attributes();
         $name = (string) $attributes['handler'];
         if (!in_array($name, $this->xmlData['components'])) {
             if (!file_exists($this->templatePath . "components/{$name}/{$name}" . EXT)) {
                 $this->errors[] = langf('Component |component_name| is broken', 'template_manager', array('component_name' => $name));
                 continue;
             }
             array_push($this->xmlData['components'], $name);
         }
     }
 }
Пример #2
0
 public function create()
 {
     if (!file_exists(BACKUPFOLDER)) {
         mkdir(BACKUPFOLDER);
         chmod(BACKUPFOLDER, 0777);
     }
     if (!is_really_writable(BACKUPFOLDER)) {
         showMessage(langf('Directory {0} has no writing permission', 'admin', array(BACKUPFOLDER)), false, 'r');
         exit;
     }
     switch ($_POST['save_type']) {
         case 'local':
             jsCode("window.location = '" . site_url('admin/backup/force_download/' . $_POST['file_type']) . "'");
             break;
         case 'server':
             $this->load->helper('file');
             $backup = \libraries\Backup::create();
             $deleteOld = $backup->getSetting('backup_del_status');
             if ($deleteOld == 1) {
                 $deleteData = $backup->deleteOldFiles();
             } else {
                 $deleteData = NULL;
             }
             if (FALSE !== ($fileName = $backup->createBackup($_POST['file_type']))) {
                 $message = lang('Backup copying has been completed', 'admin');
                 if (is_array($deleteData)) {
                     $mb = number_format($deleteData['size'] / 1024 / 1024, 2);
                     $message .= "<br /> Deleted {$deleteData['count']} files on {$mb} Mb";
                 }
                 showMessage($message);
             }
             break;
         case 'email':
             $this->send_to_email();
             break;
     }
     pjax('/admin/backup');
 }
 /**
  * database backup
  */
 public function db_backup()
 {
     if (is_really_writable(BACKUPFOLDER)) {
         $this->ci->load->dbutil();
         $filePath = \libraries\Backup::create()->createBackup("sql", "backup", TRUE);
         return pathinfo($filePath, PATHINFO_BASENAME);
     } else {
         showMessage(langf('Can not create a database snapshot, Check the folder {0} on the ability to record', 'admin', array(BACKUPFOLDER)));
     }
     return $name;
 }
Пример #4
0
	<?php 
    $temp = array();
    $temp['runs'] = $runs;
    $temp['run_rels'] = $run_rels;
    $temp['show_links'] = true;
    $GI->load->view('report_plugins/runs/groups', $temp);
    ?>
	<?php 
    $run_count_partial = count($runs);
    ?>
	<?php 
    if ($run_count > $run_count_partial) {
        ?>
		<p class="partial">
			<?php 
        echo langf('reports_tpr_runs_more', $run_count - $run_count_partial);
        ?>
		</p>
	<?php 
    }
} else {
    ?>
	<p><?php 
    echo lang('reports_tpr_runs_empty');
    ?>
</p>
<?php 
}
?>

<?php