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


PHP XenForo_Helper_DevelopmentXml::scanFile方法代码示例

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


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

示例1: scanXmlFile

 public static function scanXmlFile($xmlFile)
 {
     if (self::callbackChecker('XenForo_Helper_DevelopmentXml', 'scanFile')) {
         //Protected method
         $file = XenForo_Helper_DevelopmentXml::scanFile($xmlFile);
     } else {
         //Classic PHP method
         $file = new SimpleXMLElement($xmlFile, null, true);
     }
     return $file;
 }
开发者ID:Sywooch,项目名称:forums,代码行数:11,代码来源:Bbm.php

示例2: execute

 public function execute(array $deferred, array $data, $targetRunTime, &$status)
 {
     $data = array_merge(array('file' => XenForo_Application::getInstance()->getRootDir() . '/install/data/email_templates.xml'), $data);
     /* @var $templateModel XenForo_Model_EmailTemplate */
     $templateModel = XenForo_Model::create('XenForo_Model_EmailTemplate');
     $document = XenForo_Helper_DevelopmentXml::scanFile($data['file']);
     $templateModel->importEmailTemplatesAddOnXml($document, 'XenForo', false);
     $actionPhrase = new XenForo_Phrase('importing');
     $typePhrase = new XenForo_Phrase('email_templates');
     $status = sprintf('%s... %s', $actionPhrase, $typePhrase);
     return false;
 }
开发者ID:Sywooch,项目名称:forums,代码行数:12,代码来源:ImportEmailTemplate.php

示例3: execute

 public function execute(array $deferred, array $data, $targetRunTime, &$status)
 {
     $data = array_merge(array('file' => XenForo_Application::getInstance()->getRootDir() . '/install/data/phrases.xml', 'offset' => 0, 'position' => 0), $data);
     /* @var $phraseModel XenForo_Model_Phrase */
     $phraseModel = XenForo_Model::create('XenForo_Model_Phrase');
     $document = XenForo_Helper_DevelopmentXml::scanFile($data['file']);
     $result = $phraseModel->importPhrasesAddOnXml($document, 'XenForo', $targetRunTime, $data['offset']);
     if (is_int($result)) {
         $data['offset'] = $result;
         $data['position']++;
         $actionPhrase = new XenForo_Phrase('importing');
         $typePhrase = new XenForo_Phrase('phrases');
         $status = sprintf('%s... %s %s', $actionPhrase, $typePhrase, str_repeat(' . ', $data['position']));
         return $data;
         // continue again
     } else {
         return false;
     }
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:19,代码来源:ImportPhrase.php

示例4: parseSVG

 public function parseSVG($filename)
 {
     $svgfile = null;
     try {
         if (method_exists('XenForo_Helper_DevelopmentXml', 'scanFile')) {
             $svgfile = XenForo_Helper_DevelopmentXml::scanFile($filename);
         } else {
             $svgfile = new SimpleXMLElement($filename, 0, true);
         }
     } catch (Exception $e) {
         XenForo_Error::logException($e, false);
         $svgfile = null;
     }
     if (empty($svgfile)) {
         return null;
     }
     // check for bad tags
     $options = XenForo_Application::getOptions();
     $badTags = array_fill_keys(explode(',', strtolower($options->SV_AttachImpro_badTags)), true);
     $badAttributes = array_fill_keys(explode(',', strtolower($options->SV_AttachmentImprovements_badAttributes)), true);
     return $this->_scanSVG($svgfile, $badTags, $badAttributes);
 }
开发者ID:Xon,项目名称:XenForo-AttachmentImprovements,代码行数:22,代码来源:Attachment.php

示例5: importOptionsDevelopmentXml

 /**
  * Imports the options development XML data.
  *
  * @param string $fileName File to read the XML from
  */
 public function importOptionsDevelopmentXml($fileName)
 {
     $document = XenForo_Helper_DevelopmentXml::scanFile($fileName);
     $this->importOptionsAddOnXml($document, 'XenForo');
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:10,代码来源:Option.php

示例6: importStylePropertyDevelopmentXml

 /**
  * Imports the development admin navigation XML data.
  *
  * @param string $fileName File to read the XML from
  */
 public function importStylePropertyDevelopmentXml($fileName, $styleId)
 {
     $document = XenForo_Helper_DevelopmentXml::scanFile($fileName);
     $this->importStylePropertyXml($document, $styleId, 'XenForo');
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:10,代码来源:StyleProperty.php

示例7: installAddOnXmlFromFile

 /**
  * Installs (or upgrades) an add-on using XML from a file.
  *
  * If an upgrade add-on is given, the XML add-on ID will be checked against if.
  * If matching, an upgrade will be performed. Otherwise, installing existing add-ons will
  * be blocked.
  *
  * @param string $fileName Path to file
  * @param string|false $upgradeAddOnId ID of the add-on to upgrade, if there is one
  *
  * @return bool
  */
 public function installAddOnXmlFromFile($fileName, $upgradeAddOnId = false)
 {
     if (!file_exists($fileName) || !is_readable($fileName)) {
         throw new XenForo_Exception(new XenForo_Phrase('please_enter_valid_file_name_requested_file_not_read'), true);
     }
     try {
         $document = XenForo_Helper_DevelopmentXml::scanFile($fileName);
     } catch (Exception $e) {
         throw new XenForo_Exception(new XenForo_Phrase('provided_file_was_not_valid_xml_file'), true);
     }
     return $this->installAddOnXml($document, $upgradeAddOnId);
 }
开发者ID:darkearl,项目名称:projectT122015,代码行数:24,代码来源:AddOn.php

示例8: importAdminNavigationDevelopmentXml

 /**
  * Imports the development admin navigation XML data.
  *
  * @param string $fileName File to read the XML from
  */
 public function importAdminNavigationDevelopmentXml($fileName)
 {
     $document = XenForo_Helper_DevelopmentXml::scanFile($fileName);
     $this->importAdminNavigationAddOnXml($document, 'XenForo');
 }
开发者ID:VoDongMy,项目名称:xenforo-laravel5.1,代码行数:10,代码来源:AdminNavigation.php

示例9: readMetaDataFile

 /**
  * Reads all of the meta-data out of the specified file.
  *
  * @param string $metaDataFile Path to meta data file
  *
  * @return array Format: [title] => meta-data
  */
 public static function readMetaDataFile($metaDataFile)
 {
     if (file_exists($metaDataFile)) {
         $metaData = array();
         $xml = XenForo_Helper_DevelopmentXml::scanFile($metaDataFile);
         foreach ($xml->item as $tag) {
             $title = (string) $tag['title'];
             if (isset($metaData[$title])) {
                 continue;
                 // give precedence to earlier entries as they are more up to date
             }
             $attributes = array();
             foreach ($tag->attributes() as $key => $value) {
                 $attributes[(string) $key] = (string) $value;
             }
             $metaData[$title] = $attributes;
         }
     } else {
         $metaData = array();
     }
     return $metaData;
 }
开发者ID:namgiangle90,项目名称:tokyobaito,代码行数:29,代码来源:DevelopmentXml.php


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