PMA\libraries\Theme::loadInfo PHP Метод

loadInfo() публичный Метод

Loads theme information
public loadInfo ( ) : boolean
Результат boolean whether loading them info was successful or not
    function loadInfo()
    {
        if (!file_exists($this->getPath() . '/info.inc.php')) {
            return false;
        }
        if ($this->mtime_info === filemtime($this->getPath() . '/info.inc.php')) {
            return true;
        }
        @(include $this->getPath() . '/info.inc.php');
        // was it set correctly?
        if (!isset($theme_name)) {
            return false;
        }
        $this->mtime_info = filemtime($this->getPath() . '/info.inc.php');
        $this->filesize_info = filesize($this->getPath() . '/info.inc.php');
        if (isset($theme_full_version)) {
            $this->setVersion($theme_full_version);
        } elseif (isset($theme_generation, $theme_version)) {
            $this->setVersion($theme_generation . '.' . $theme_version);
        }
        $this->setName($theme_name);
        return true;
    }

Usage Example

Пример #1
0
 /**
  * Test for Theme::loadInfo
  *
  * @return void
  */
 public function testLoadInfo()
 {
     $this->object->setPath('./themes/original');
     $infofile = $this->object->getPath() . '/info.inc.php';
     $this->assertTrue($this->object->loadInfo());
     $this->assertEquals(filemtime($infofile), $this->object->mtime_info);
     $this->object->setPath('./themes/original');
     $this->object->mtime_info = filemtime($infofile);
     $this->assertTrue($this->object->loadInfo());
     $this->assertEquals('Original', $this->object->getName());
 }
All Usage Examples Of PMA\libraries\Theme::loadInfo