Exemplo n.º 1
0
 /** Get info from version.xml file
  * @param string $name
  *	Name of info
  *
  * @return mix
  */
 public function getInfo($name)
 {
     // check, if requested info is already in $this->info
     if (isset($this->infofile, $this->infofile[$name]) and !empty($this->infofile[$name])) {
         return $this->infofile[$name];
     }
     // load from version-file
     if (!file_exists('version.xml')) {
         return NULL;
     }
     $this->infofile = ts_XmlHandler::readAll('version.xml');
     // try again to return requested info
     if (isset($this->infofile, $this->infofile[$name])) {
         return $this->infofile[$name];
     }
     return NULL;
 }
Exemplo n.º 2
0
 /** Get info from version.xml
  * @param string $name
  *	Name of information to gather
  * @param bool $refresh
  *	Refresh cached infos?
  *
  * @return mix
  */
 public function getInfofile($name, $refresh = false)
 {
     // refresh?
     if ($refresh) {
         $this->infofile = array();
     }
     // check, if requested info is already in $this->info
     if (isset($this->infofile, $this->infofile[$name]) and !empty($this->infofile[$name])) {
         return $this->infofile[$name];
     }
     // load from version-file
     if (!$this->path or !file_exists($this->path . '/version.xml')) {
         return NULL;
     }
     $xmldata = ts_XmlHandler::readAll($this->path . '/version.xml');
     // read data in infofile
     foreach ($xmldata as $index => $values) {
         $this->infofile[$values['tag']] = $values['value'];
     }
     // try again to return requested info
     if (isset($this->infofile, $this->infofile[$name])) {
         return $this->infofile[$name];
     }
     return NULL;
 }