Пример #1
0
 /**
  * Get backup configurations
  * @param string|array $item The keys to get from config
  * @return mixed
  */
 public function getConfig($item = null)
 {
     if (!is_array($this->config) || empty($this->config) || count($this->config) < 1) {
         /** @var optionsBup $options */
         $options = frameBup::getInstance()->getModule('options');
         $this->config = array('full_backup' => (bool) $options->get('full'), 'plugins_dir' => (bool) $options->get('plugins'), 'themes_dir' => (bool) $options->get('themes'), 'uploads_dir' => (bool) $options->get('uploads'), 'database' => (bool) $options->get('database'), 'any_dir' => (bool) $options->get('any_directories'), 'exclude' => $options->get('exclude'), 'warehouse' => realpath(ABSPATH . $options->get('warehouse')) . DIRECTORY_SEPARATOR, 'dest' => $options->get('glb_dest'), 'force_update' => (bool) $options->get('force_update'), 'safe_update' => (bool) $options->get('safe_update'), 'replace_newer' => (bool) $options->get('replace_newer'));
     }
     if ($item === null) {
         return $this->config;
     }
     if (is_string($item)) {
         return isset($this->config[$item]) ? $this->config[$item] : null;
     }
     if (is_array($item)) {
         $config = array();
         foreach ($item as $key) {
             if (isset($this->config[$key])) {
                 $config[$key] = $this->config[$key];
             }
         }
         return $config;
     }
     return null;
 }