示例#1
0
 /**
  * コンストラクタ
  * @param string $file ファイル名
  */
 public function __construct($file)
 {
     if (empty($file)) {
         throw new Exception('File::__construct(): file name is missing!');
     }
     parent::__construct($file);
 }
示例#2
0
 /**
  * コンストラクタ
  * @param string $page
  */
 public function __construct($page)
 {
     if (empty($page)) {
         throw new Exception('DiffFile::__construct(): Page name is missing!');
     }
     $this->page = $page;
     parent::__construct(self::$dir . Utility::encode($page) . '.txt');
 }
示例#3
0
 /**
  * コンストラクタ
  * @param string $page
  */
 public function __construct($page = null)
 {
     if (empty($page)) {
         throw new Exception('CounterFile::__construct(): Page name is missing!');
     }
     if (!is_string($page)) {
         throw new Exception('CounterFile::__construct(): Page name must be string!');
     }
     $this->page = $page;
     parent::__construct(self::$dir . Utility::encode($page) . '.count');
 }
示例#4
0
 /**
  * コンストラクタ
  * @param string $page ページ名
  * @param string $file ファイル名
  * @param int $age バックアップの世代
  */
 public function __construct($page, $file, $age = 0)
 {
     if (empty($page)) {
         throw new Exception('AttachFile::__construct(): Page name is missing!');
     }
     if (!is_string($page)) {
         throw new Exception('AttachFile::__construct(): Page name must be string!');
     }
     if (empty($file)) {
         throw new Exception('AttachFile::__construct(): File name is missing!');
     }
     if (!is_string($file)) {
         throw new Exception('AttachFile::__construct(): File name must be string!');
     }
     parent::__construct(self::$dir . Utility::encode($page) . '_' . Utility::encode($file) . ($age !== 0 ? '.' . $age : ''));
 }
示例#5
0
 /**
  * コンストラクタ
  * @param string $page
  */
 public function __construct($page = null)
 {
     if (empty($this->kind)) {
         throw new Exception('LogFile::__construct(): class "' . get_called_class() . '" does not defined $kind value.');
     }
     $this->config = Utility::loadConfig('config-log.ini.php');
     if (!$this->isWiki) {
         if (empty($page)) {
             throw new Exception('LogFile::__construct(): Page name is missing!');
         }
         // ページ名
         $this->page = $page;
         parent::__construct(self::$dir . $this->kind . '/' . Utility::encode($page) . '.txt');
     } else {
         // Wikiに保存する場合
         parent::__construct(DATA_DIR . Utility::encode($this->config[$this->kind]['file']) . '.txt');
     }
 }
示例#6
0
 /**
  * コンストラクタ
  * @param string $page ページ名
  */
 public function __construct($page = null)
 {
     if (empty($page)) {
         throw new Exception('BackupFile::__construct(): Page name is missing!');
     }
     if (!is_string($page)) {
         throw new Exception('BackupFile::__construct(): Page name must be string!');
     }
     global $do_backup, $cycle, $maxage;
     if (Auth::check_role('readonly') || !$do_backup) {
         return;
     }
     // バックアップのページ名
     $this->page = $page;
     // バックアップの拡張子
     if (function_exists('lzf_compress')) {
         // lzfが使用出来る場合
         $this->ext = '.lzf';
     } else {
         if (function_exists('bzcompress')) {
             // bz2が使用出来る場合
             $this->ext = '.bz2';
         } else {
             if (function_exists('gzcompress')) {
                 $this->ext = '.gz';
             }
         }
     }
     // バックアップの世代間の区切りの正規表現
     $this->splitter_reglex = '/^(' . preg_quote(self::SPLITTER) . '\\s\\d+(\\s(\\d+)|))$/';
     // バックアップの名前(拡張子抜き)
     $this->name = self::$dir . Utility::encode($page);
     // バックアップの最終更新日時
     $this->time = $this->has() ? filemtime($this->filename) : UTIME;
     // このhasBackup()でファイル名($this->file)も定義
     parent::__construct($this->name . $this->ext);
 }
示例#7
0
 /**
  * コンストラクタ
  */
 function __construct($name = 'auth_users')
 {
     $this->filename = DATA_HOME . $name . '.ini.php';
     $this->auth_users = parent::has() ? include $this->filename : array();
     parent::__construct($this->filename);
 }