public function parsehtml()
 {
     $html = getinstance('tadminhtml');
     $html->ini = array();
     foreach ($this->html as $filename) {
         $realfilename = $this->getrealfilename($filename);
         if (!file_exists($realfilename)) {
             $this->error(sprintf('The file "%s" not found', $realfilename));
         }
         if (!($parsed = parse_ini_file($realfilename, true))) {
             $this->error(sprintf('Error parse "%s" ini file', $realfilename));
         }
         if (count($html->ini) == 0) {
             $html->ini = $parsed;
         } else {
             foreach ($parsed as $section => $itemsini) {
                 $html->ini[$section] = isset($html->ini[$section]) ? $itemsini + $html->ini[$section] : $itemsini;
             }
         }
     }
     tfilestorage::savevar(tlocal::getcachedir() . 'adminhtml', $html->ini);
 }
Beispiel #2
0
 public static function cacheini($filename)
 {
     if (isset(self::$inifiles[$filename])) {
         return self::$inifiles[$filename];
     }
     $datafile = tlocal::getcachedir() . sprintf('cacheini.%s.php', md5($filename));
     if (!tfilestorage::loadvar($datafile, $ini) || !is_array($ini)) {
         if (file_exists($filename)) {
             $ini = parse_ini_file($filename, true);
             tfilestorage::savevar($datafile, $ini);
         } else {
             $ini = array();
         }
     }
     if (!isset(self::$inifiles)) {
         self::$inifiles = array();
     }
     self::$inifiles[$filename] = $ini;
     return $ini;
 }
Beispiel #3
0
 public function load()
 {
     $filename = tlocal::getcachedir() . 'adminhtml';
     if (tfilestorage::loadvar($filename, $v) && is_array($v)) {
         $this->ini = $v + $this->ini;
     } else {
         $merger = tlocalmerger::i();
         $merger->parsehtml();
     }
 }