當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。