当前位置: 首页>>代码示例>>PHP>>正文


PHP XMLParser::parseByFilename方法代码示例

本文整理汇总了PHP中XMLParser::parseByFilename方法的典型用法代码示例。如果您正苦于以下问题:PHP XMLParser::parseByFilename方法的具体用法?PHP XMLParser::parseByFilename怎么用?PHP XMLParser::parseByFilename使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XMLParser的用法示例。


在下文中一共展示了XMLParser::parseByFilename方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getAllMenus

 public static function getAllMenus()
 {
     $fname = DIR_DATA . '/menus.xml';
     $parser = new XMLParser();
     $a = $parser->parseByFilename($fname);
     $entries = array();
     foreach ($a['menus']['group'] as $key => $value) {
         $entries[] = new MenuItem(array('name' => $value['name'], 'class' => $value['class'], 'link' => $value['link']));
     }
     return $entries;
 }
开发者ID:rootfather,项目名称:scummvm-web,代码行数:11,代码来源:MenuModel.php

示例2: getAllDocuments

 public static function getAllDocuments()
 {
     $fname = DIR_DATA . '/documentation.xml';
     $parser = new XMLParser();
     $a = $parser->parseByFilename($fname);
     $entries = array();
     foreach ($a['documentation']['document'] as $key => $value) {
         $entries[] = new Document($value);
     }
     return $entries;
 }
开发者ID:rootfather,项目名称:scummvm-web,代码行数:11,代码来源:DocumentationModel.php

示例3: getAllCredits

 public static function getAllCredits()
 {
     $fname = DIR_DATA . '/credits.xml';
     $parser = new XMLParser();
     $a = $parser->parseByFilename($fname);
     $sections = array();
     foreach ($a['credits']['section'] as $key => $value) {
         $sections[] = new CSection($value);
     }
     return $sections;
 }
开发者ID:rootfather,项目名称:scummvm-web,代码行数:11,代码来源:CreditsModel.php

示例4: getAllArticles

 public static function getAllArticles()
 {
     $fname = DIR_DATA . '/press_articles.xml';
     $parser = new XMLParser();
     $a = $parser->parseByFilename($fname);
     $entries = array();
     foreach ($a['articles']['article'] as $key => $value) {
         $entries[] = new Article(array('name' => $value['name'], 'url' => $value['url'], 'language' => $value['language'], 'posted' => $value['posted']));
     }
     return $entries;
 }
开发者ID:rootfather,项目名称:scummvm-web,代码行数:11,代码来源:ArticleModel.php

示例5: getAllDownloads

 public static function getAllDownloads()
 {
     $fname = DIR_DATA . '/downloads.xml';
     /* Now parse the data. */
     $parser = new XMLParser();
     $a = $parser->parseByFilename($fname);
     $sections = array();
     foreach ($a['downloads']['section'] as $key => $value) {
         $sections[] = new DSection($value);
     }
     return $sections;
 }
开发者ID:rootfather,项目名称:scummvm-web,代码行数:12,代码来源:DownloadsModel.php

示例6: getAllGroupsAndDemos

 public static function getAllGroupsAndDemos()
 {
     $fname = DIR_DATA . '/game_demos.xml';
     $parser = new XMLParser();
     $a = $parser->parseByFilename($fname);
     $entries = array();
     foreach ($a['game_demos']['group'] as $key => $value) {
         $demos = array();
         foreach ($value['demos']['demo'] as $data) {
             $demos[] = new GameDemo($data);
         }
         $entries[] = array('name' => $value['name'], 'href' => $value['href'], 'demos' => $demos);
     }
     return $entries;
 }
开发者ID:rootfather,项目名称:scummvm-web,代码行数:15,代码来源:GameDemosModel.php

示例7: getAllGroupsAndLinks

 public static function getAllGroupsAndLinks()
 {
     $fname = DIR_DATA . '/links.xml';
     $parser = new XMLParser();
     $a = $parser->parseByFilename($fname);
     $entries = array();
     foreach ($a['external_links']['group'] as $key => $value) {
         /* Get all links. */
         $links = array();
         foreach ($value['link'] as $data) {
             $links[] = new WebLink($data);
         }
         $entries[] = array('name' => $value['name'], 'description' => $value['description'], 'links' => $links);
     }
     return $entries;
 }
开发者ID:rootfather,项目名称:scummvm-web,代码行数:16,代码来源:LinksModel.php

示例8: getAllScreenshots

 public static function getAllScreenshots()
 {
     $fname = DIR_DATA . '/screenshots.xml';
     $parser = new XMLParser();
     $a = $parser->parseByFilename($fname);
     $entries = array();
     BasicObject::toArray($a['screenshots']['group']);
     foreach ($a['screenshots']['group'] as $value) {
         BasicObject::toArray($value['game']);
         $games = array();
         foreach ($value['game'] as $data) {
             $games[] = new Screenshot($data);
         }
         $entries[] = array('title' => $value['title'], 'category' => $value['category'], 'games' => $games);
     }
     return $entries;
 }
开发者ID:rootfather,项目名称:scummvm-web,代码行数:17,代码来源:ScreenshotsModel.php

示例9: getAllData

 public static function getAllData($version)
 {
     if (!is_string($version)) {
         throw new ErrorException(self::NO_VERSION);
     }
     $fname = DIR_COMPAT . "/compat-{$version}.xml";
     $parser = new XMLParser();
     $a = $parser->parseByFilename($fname);
     $entries = array();
     foreach ($a['compatibility']['company'] as $key => $value) {
         $games = array();
         foreach ($value['games']['game'] as $data) {
             $games[] = new CompatGame($data);
         }
         $entries[$value['name']] = $games;
     }
     return $entries;
 }
开发者ID:bgK,项目名称:scummvm-web,代码行数:18,代码来源:CompatibilityModel.php

示例10: getAllSubprojects

 public static function getAllSubprojects()
 {
     $fname = DIR_DATA . '/subprojects.xml';
     $parser = new XMLParser();
     $a = $parser->parseByFilename($fname);
     $entries = array();
     BasicObject::toArray($a['subprojects']['project']);
     foreach ($a['subprojects']['project'] as $key => $value) {
         $downloads = array();
         foreach ($value['entries'] as $type => $data) {
             if ($type == 'file') {
                 BasicObject::toArray($data);
                 foreach ($data as $file) {
                     $downloads[] = new File($file);
                 }
             }
         }
         $entries[] = new Project(array('name' => $value['name'], 'info' => $value['info'], 'downloads' => $downloads));
     }
     return $entries;
 }
开发者ID:rootfather,项目名称:scummvm-web,代码行数:21,代码来源:SubprojectsModel.php


注:本文中的XMLParser::parseByFilename方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。