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


PHP ExtensionManager::listAll方法代码示例

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


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

示例1: build

 /**
  * Download language file
  */
 function build($context)
 {
     // Get context
     $name = $context[2];
     $lang = $context[1];
     $context = $context[0];
     // Get localisation strings
     $data = $this->LocalisationManager->buildDictionary($context, $lang, $name);
     // Load template
     $path = EXTENSIONS . '/localisationmanager/lib';
     if ($context == 'symphony') {
         $template = file_get_contents($path . '/lang.core.tpl');
     } else {
         $template = file_get_contents($path . '/lang.extension.tpl');
     }
     // Add data
     $template = str_replace('<!-- $name -->', $data['about']['name'], $template);
     $template = str_replace('<!-- $author -->', $data['about']['author']['name'], $template);
     $template = str_replace('<!-- $email -->', $data['about']['author']['email'], $template);
     $template = str_replace('<!-- $website -->', $data['about']['author']['website'], $template);
     $template = str_replace('<!-- $date -->', $data['about']['release-date'], $template);
     if ($context != 'symphony') {
         $ExtensionManager = new ExtensionManager($this->parent);
         $extensions = $ExtensionManager->listAll();
         $template = str_replace('<!-- $extension -->', $extensions[$context]['name'], $template);
     }
     $template = str_replace('<!-- $strings -->', $this->__layout($data['dictionary']['strings']), $template);
     $template = str_replace('<!-- $obsolete -->', $this->__layout($data['dictionary']['obsolete'], 'Obsolete'), $template);
     $template = str_replace('<!-- $missing -->', $this->__layout($data['dictionary']['missing'], 'Missing'), $template);
     $template = str_replace('<!-- $namespaces -->', $this->__layoutNamespace($data['dictionary']['namespaces']), $template);
     if ($context == 'symphony') {
         $template = str_replace('<!-- $uppercase -->', $this->__transliterations($data['transliterations']['straight']['uppercase'], 5), $template);
         $template = str_replace('<!-- $lowercase -->', $this->__transliterations($data['transliterations']['straight']['lowercase'], 5), $template);
         $template = str_replace('<!-- $symbolic -->', $this->__transliterations($data['transliterations']['straight']['symbolic'], 3), $template);
         $template = str_replace('<!-- $special -->', $this->__transliterations($data['transliterations']['straight']['special']), $template);
         $template = str_replace('<!-- $otherstraight -->', $this->__transliterations($data['transliterations']['straight']['other']), $template);
         $template = str_replace('<!-- $ampersands -->', $this->__transliterations($data['transliterations']['regexp']['ampersands']), $template);
         $template = str_replace('<!-- $otherregexp -->', $this->__transliterations($data['transliterations']['regexp']['other']), $template);
     }
     // Send file
     header('Content-Type: application/x-php; charset=utf-8');
     header('Content-Disposition: attachment; filename="lang.' . ($lang ? $lang : 'new') . '.php"');
     header("Content-Description: File Transfer");
     header("Cache-Control: no-cache, must-revalidate");
     header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
     echo $template;
     exit;
 }
开发者ID:symphonists,项目名称:localisationmanager,代码行数:51,代码来源:content.download.php


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