parser.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?php
  2. /**
  3. * Fuel is a fast, lightweight, community driven PHP5 framework.
  4. *
  5. * @package Fuel
  6. * @version 1.5
  7. * @author Fuel Development Team
  8. * @license MIT License
  9. * @copyright 2010 - 2013 Fuel Development Team
  10. * @link http://fuelphp.com
  11. */
  12. /**
  13. * NOTICE:
  14. *
  15. * If you need to make modifications to the default configuration, copy
  16. * this file to your app/config folder, and make them in there.
  17. *
  18. * This will allow you to upgrade fuel without losing your custom config.
  19. */
  20. return array(
  21. // ------------------------------------------------------------------------
  22. // Register extensions to their parsers, either classname or array config
  23. // ------------------------------------------------------------------------
  24. 'extensions' => array(
  25. 'php' => 'View',
  26. 'twig' => 'View_Twig',
  27. 'mustache' => 'View_Mustache',
  28. 'md' => 'View_Markdown',
  29. 'dwoo' => array('class' => 'View_Dwoo', 'extension' => 'tpl'),
  30. 'jade' => 'View_Jade',
  31. 'haml' => 'View_Haml',
  32. 'smarty' => 'View_Smarty',
  33. 'phptal' => 'View_Phptal',
  34. ),
  35. // ------------------------------------------------------------------------
  36. // Individual class config by classname
  37. // ------------------------------------------------------------------------
  38. // MARKDOWN ( http://michelf.com/projects/php-markdown/ )
  39. // ------------------------------------------------------------------------
  40. 'View_Markdown' => array(
  41. 'include' => \Package::exists('parser').'vendor'.DS.'markdown'.DS.'markdown.php',
  42. 'auto_encode' => true,
  43. 'allow_php' => true,
  44. ),
  45. // TWIG ( http://www.twig-project.org/documentation )
  46. // ------------------------------------------------------------------------
  47. 'View_Twig' => array(
  48. 'include' => APPPATH.'vendor'.DS.'Twig'.DS.'Autoloader.php',
  49. 'auto_encode' => true,
  50. 'views_paths' => array(APPPATH.'views'),
  51. 'delimiters' => array(
  52. 'tag_block' => array('left' => '{%', 'right' => '%}'),
  53. 'tag_comment' => array('left' => '{#', 'right' => '#}'),
  54. 'tag_variable' => array('left' => '{{', 'right' => '}}'),
  55. ),
  56. 'environment' => array(
  57. 'debug' => false,
  58. 'charset' => 'utf-8',
  59. 'base_template_class' => 'Twig_Template',
  60. 'cache' => APPPATH.'cache'.DS.'twig'.DS,
  61. 'auto_reload' => true,
  62. 'strict_variables' => false,
  63. 'autoescape' => false,
  64. 'optimizations' => -1,
  65. ),
  66. 'extensions' => array(
  67. 'Twig_Fuel_Extension'
  68. ),
  69. ),
  70. // DWOO ( http://wiki.dwoo.org/ )
  71. // ------------------------------------------------------------------------
  72. 'View_Dwoo' => array(
  73. 'include' => APPPATH.'vendor'.DS.'Dwoo'.DS.'dwooAutoload.php',
  74. 'auto_encode' => true,
  75. 'delimiters' => array('left' => '{{', 'right' => '}}'),
  76. 'environment' => array(
  77. 'autoescape' => false,
  78. 'nested_comments' => false,
  79. 'allow_spaces' => false,
  80. 'cache_dir' => APPPATH.'cache'.DS.'dwoo'.DS,
  81. 'compile_dir' => APPPATH.'cache'.DS.'dwoo'.DS.'compiled'.DS,
  82. 'cache_time' => 0,
  83. // Set what parser should do with PHP tags
  84. // 1 - Encode tags | 2 - Remove tags | 3 - Allow tags
  85. 'allow_php_tags' => 2,
  86. // Which PHP functions should be accessible through Parser
  87. 'allow_php_func' => array(),
  88. ),
  89. ),
  90. // MUSTACHE ( https://github.com/bobthecow/mustache.php )
  91. // ------------------------------------------------------------------------
  92. 'View_Mustache' => array(
  93. 'include' => \Package::exists('parser').'vendor'.DS.'Mustache'.DS.'Mustache.php',
  94. 'auto_encode' => true,
  95. 'delimiters' => array('left' => '{{', 'right' => '}}'),
  96. 'environment' => array(
  97. 'charset' => 'UTF-8',
  98. 'pragmas' => array(),
  99. ),
  100. ),
  101. // JADE PHP ( https://github.com/everzet/jade.php )
  102. // See notes in /parser/classes/view/jade.php
  103. // ------------------------------------------------------------------------
  104. 'View_Jade' => array(
  105. 'include' => APPPATH.'vendor'.DS.'Jade'.DS.'autoload.php.dist',
  106. 'auto_encode' => true,
  107. 'cache_dir' => APPPATH.'cache'.DS.'jade'.DS,
  108. ),
  109. // HAML / PHAMLP ( http://code.google.com/p/phamlp/ )
  110. // ------------------------------------------------------------------------
  111. 'View_Haml' => array(
  112. 'include' => APPPATH.'vendor'.DS.'Phamlp'.DS.'haml'.DS.'HamlParser.php',
  113. 'auto_encode' => true,
  114. 'cache_dir' => APPPATH.'cache'.DS.'haml'.DS,
  115. ),
  116. // SMARTY ( http://www.smarty.net/documentation )
  117. // ------------------------------------------------------------------------
  118. 'View_Smarty' => array(
  119. 'include' => APPPATH.'vendor'.DS.'Smarty'.DS.'libs'.DS.'Smarty.class.php',
  120. 'auto_encode' => true,
  121. 'delimiters' => array('left' => '{', 'right' => '}'),
  122. 'environment' => array(
  123. 'compile_dir' => APPPATH.'tmp'.DS.'Smarty'.DS.'templates_c'.DS,
  124. 'config_dir' => APPPATH.'tmp'.DS.'Smarty'.DS.'configs'.DS,
  125. 'cache_dir' => APPPATH.'cache'.DS.'Smarty'.DS,
  126. 'plugins_dir' => array(),
  127. 'caching' => false,
  128. 'cache_lifetime' => 0,
  129. 'force_compile' => false,
  130. 'compile_check' => true,
  131. 'debugging' => false,
  132. 'autoload_filters' => array(),
  133. 'default_modifiers' => array(),
  134. ),
  135. ),
  136. // Phptal ( http://phptal.org/manual/en/ )
  137. // ------------------------------------------------------------------------
  138. 'View_Phptal' => array(
  139. 'include' => APPPATH.'vendor'.DS.'PHPTAL'.DS.'PHPTAL.php',
  140. 'auto_encode' => true,
  141. 'cache_dir' => APPPATH.'cache'.DS.'PHPTAL'.DS,
  142. 'cache_lifetime' => 0,
  143. 'encoding' => 'UTF-8',
  144. 'output_mode' => 'PHPTAL::XHTML',
  145. 'template_repository' => '',
  146. 'force_reparse' => false,
  147. ),
  148. );
  149. // end of file parser.php