Timber - Version 1.12.0

Version Description

Fixes and improvements - Fix resizing for images with UTF-8 characters in their filename #2072 - Added tests to cover RTL languages and special characters in image file names #2072 - Fixed MenuItem menu recursion #2071 #2083

Changes for Theme Developers - Added new found_posts property for Timber\PostQuery. Now you can check how many posts were found in a query.

Download this release

Release Info

Developer jarednova
Plugin Icon 128x128 Timber
Version 1.12.0
Comparing to
See all releases

Code changes from version 1.11.0 to 1.12.0

Files changed (539) hide show
  1. README.md +2 -0
  2. lib/Image.php +3 -2
  3. lib/Image/Operation/Letterbox.php +2 -1
  4. lib/ImageHelper.php +7 -6
  5. lib/LocationManager.php +3 -1
  6. lib/Menu.php +1 -1
  7. lib/MenuItem.php +19 -6
  8. lib/PathHelper.php +55 -0
  9. lib/PostQuery.php +17 -2
  10. lib/QueryIterator.php +13 -1
  11. lib/Timber.php +1 -1
  12. lib/Twig.php +27 -17
  13. readme.txt +17 -2
  14. timber-starter-theme/.gitignore +1 -0
  15. timber-starter-theme/archive.php +5 -5
  16. timber-starter-theme/functions.php +25 -17
  17. timber-starter-theme/index.php +3 -3
  18. timber-starter-theme/page.php +1 -1
  19. timber-starter-theme/single.php +2 -2
  20. timber-starter-theme/tests/test-timber-starter-theme.php +13 -0
  21. timber-starter-theme/timber-starter-theme/.gitignore +0 -2
  22. timber-starter-theme/timber-starter-theme/.travis.yml +0 -22
  23. timber-starter-theme/timber-starter-theme/404.php +0 -13
  24. timber-starter-theme/timber-starter-theme/LICENSE +0 -7
  25. timber-starter-theme/timber-starter-theme/README.md +0 -35
  26. timber-starter-theme/timber-starter-theme/archive.php +0 -40
  27. timber-starter-theme/timber-starter-theme/author.php +0 -21
  28. timber-starter-theme/timber-starter-theme/footer.php +0 -21
  29. timber-starter-theme/timber-starter-theme/functions.php +0 -159
  30. timber-starter-theme/timber-starter-theme/header.php +0 -15
  31. timber-starter-theme/timber-starter-theme/humans.txt +0 -10
  32. timber-starter-theme/timber-starter-theme/index.php +0 -23
  33. timber-starter-theme/timber-starter-theme/page.php +0 -28
  34. timber-starter-theme/timber-starter-theme/phpunit.xml +0 -20
  35. timber-starter-theme/timber-starter-theme/screenshot.png +0 -0
  36. timber-starter-theme/timber-starter-theme/search.php +0 -18
  37. timber-starter-theme/timber-starter-theme/sidebar.php +0 -9
  38. timber-starter-theme/timber-starter-theme/single.php +0 -20
  39. timber-starter-theme/timber-starter-theme/static/no-timber.html +0 -10
  40. timber-starter-theme/timber-starter-theme/static/site.js +0 -5
  41. timber-starter-theme/timber-starter-theme/style.css +0 -5
  42. timber-starter-theme/timber-starter-theme/templates/404.twig +0 -5
  43. timber-starter-theme/timber-starter-theme/templates/archive.twig +0 -9
  44. timber-starter-theme/timber-starter-theme/templates/author.twig +0 -7
  45. timber-starter-theme/timber-starter-theme/templates/base.twig +0 -45
  46. timber-starter-theme/timber-starter-theme/templates/comment-form.twig +0 -28
  47. timber-starter-theme/timber-starter-theme/templates/comment.twig +0 -21
  48. timber-starter-theme/timber-starter-theme/templates/footer.twig +0 -1
  49. timber-starter-theme/timber-starter-theme/templates/html-header.twig +0 -15
  50. timber-starter-theme/timber-starter-theme/templates/index.twig +0 -11
  51. timber-starter-theme/timber-starter-theme/templates/menu.twig +0 -10
  52. timber-starter-theme/timber-starter-theme/templates/page-plugin.twig +0 -7
  53. timber-starter-theme/timber-starter-theme/templates/page.twig +0 -14
  54. timber-starter-theme/timber-starter-theme/templates/partial/pagination.twig +0 -64
  55. timber-starter-theme/timber-starter-theme/templates/search.twig +0 -13
  56. timber-starter-theme/timber-starter-theme/templates/sidebar.twig +0 -1
  57. timber-starter-theme/timber-starter-theme/templates/single-password.twig +0 -9
  58. timber-starter-theme/timber-starter-theme/templates/single.twig +0 -39
  59. timber-starter-theme/timber-starter-theme/templates/tease-post.twig +0 -9
  60. timber-starter-theme/timber-starter-theme/templates/tease.twig +0 -9
  61. timber-starter-theme/timber-starter-theme/tests/bootstrap.php +0 -22
  62. timber-starter-theme/timber-starter-theme/tests/test-timber-starter-theme.php +0 -42
  63. timber.php +1 -1
  64. vendor/autoload.php +1 -1
  65. vendor/composer/autoload_classmap.php +1 -0
  66. vendor/composer/autoload_real.php +7 -7
  67. vendor/composer/autoload_static.php +7 -6
  68. vendor/vendor/altorouter/altorouter/AltoRouter.php +0 -294
  69. vendor/vendor/altorouter/altorouter/README.md +0 -53
  70. vendor/vendor/altorouter/altorouter/composer.json +0 -35
  71. vendor/vendor/asm89/twig-cache-extension/.gitignore +0 -4
  72. vendor/vendor/asm89/twig-cache-extension/.travis.yml +0 -36
  73. vendor/vendor/asm89/twig-cache-extension/LICENSE +0 -19
  74. vendor/vendor/asm89/twig-cache-extension/README.md +0 -238
  75. vendor/vendor/asm89/twig-cache-extension/composer.json +0 -39
  76. vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProvider/DoctrineCacheAdapter.php +0 -49
  77. vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProvider/PsrCacheAdapter.php +0 -68
  78. vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProviderInterface.php +0 -36
  79. vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/BlackholeCacheStrategy.php +0 -53
  80. vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/GenerationalCacheStrategy.php +0 -79
  81. vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/IndexedChainingCacheStrategy.php +0 -76
  82. vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/KeyGeneratorInterface.php +0 -29
  83. vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/LifetimeCacheStrategy.php +0 -68
  84. vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategyInterface.php +0 -49
  85. vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/BaseException.php +0 -20
  86. vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/InvalidCacheKeyException.php +0 -23
  87. vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/InvalidCacheLifetimeException.php +0 -23
  88. vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/NonExistingStrategyException.php +0 -23
  89. vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/NonExistingStrategyKeyException.php +0 -23
  90. vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Extension.php +0 -59
  91. vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Node/CacheNode.php +0 -71
  92. vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/TokenParser/Cache.php +0 -59
  93. vendor/vendor/asm89/twig-cache-extension/phpunit.xml.dist +0 -25
  94. vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheProvider/DoctrineCacheAdapterTest.php +0 -46
  95. vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/GenerationCacheStrategyTest.php +0 -80
  96. vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/IndexedChainingCacheStrategyTest.php +0 -80
  97. vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/LifetimeCacheStrategyTest.php +0 -68
  98. vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/FunctionalExtensionTest.php +0 -182
  99. vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/annotation_expression.twig +0 -3
  100. vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/annotation_not_string.twig +0 -2
  101. vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/gcs_value.twig +0 -1
  102. vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/gcs_value_v2.twig +0 -1
  103. vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/ics_no_key.twig +0 -1
  104. vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/ics_value.twig +0 -1
  105. vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/lcs_value.twig +0 -1
  106. vendor/vendor/asm89/twig-cache-extension/test/bootstrap.php +0 -16
  107. vendor/vendor/autoload.php +0 -7
  108. vendor/vendor/composer/ClassLoader.php +0 -445
  109. vendor/vendor/composer/LICENSE +0 -21
  110. vendor/vendor/composer/autoload_classmap.php +0 -552
  111. vendor/vendor/composer/autoload_files.php +0 -10
  112. vendor/vendor/composer/autoload_namespaces.php +0 -11
  113. vendor/vendor/composer/autoload_psr4.php +0 -14
  114. vendor/vendor/composer/autoload_real.php +0 -70
  115. vendor/vendor/composer/autoload_static.php +0 -626
  116. vendor/vendor/composer/installed.json +0 -420
  117. vendor/vendor/composer/installers/LICENSE +0 -19
  118. vendor/vendor/composer/installers/composer.json +0 -107
  119. vendor/vendor/composer/installers/src/Composer/Installers/AglInstaller.php +0 -21
  120. vendor/vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php +0 -9
  121. vendor/vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php +0 -11
  122. vendor/vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php +0 -49
  123. vendor/vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php +0 -9
  124. vendor/vendor/composer/installers/src/Composer/Installers/BaseInstaller.php +0 -136
  125. vendor/vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php +0 -126
  126. vendor/vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php +0 -9
  127. vendor/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php +0 -82
  128. vendor/vendor/composer/installers/src/Composer/Installers/ChefInstaller.php +0 -11
  129. vendor/vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php +0 -9
  130. vendor/vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php +0 -10
  131. vendor/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php +0 -34
  132. vendor/vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php +0 -11
  133. vendor/vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php +0 -13
  134. vendor/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php +0 -35
  135. vendor/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php +0 -21
  136. vendor/vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php +0 -10
  137. vendor/vendor/composer/installers/src/Composer/Installers/DframeInstaller.php +0 -10
  138. vendor/vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php +0 -50
  139. vendor/vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php +0 -16
  140. vendor/vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php +0 -20
  141. vendor/vendor/composer/installers/src/Composer/Installers/ElggInstaller.php +0 -9
  142. vendor/vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php +0 -12
  143. vendor/vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php +0 -29
  144. vendor/vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php +0 -10
  145. vendor/vendor/composer/installers/src/Composer/Installers/FuelInstaller.php +0 -11
  146. vendor/vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php +0 -9
  147. vendor/vendor/composer/installers/src/Composer/Installers/GravInstaller.php +0 -30
  148. vendor/vendor/composer/installers/src/Composer/Installers/HuradInstaller.php +0 -25
  149. vendor/vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php +0 -11
  150. vendor/vendor/composer/installers/src/Composer/Installers/Installer.php +0 -278
  151. vendor/vendor/composer/installers/src/Composer/Installers/ItopInstaller.php +0 -9
  152. vendor/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php +0 -15
  153. vendor/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php +0 -18
  154. vendor/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php +0 -11
  155. vendor/vendor/composer/installers/src/Composer/Installers/KnownInstaller.php +0 -11
  156. vendor/vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php +0 -10
  157. vendor/vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php +0 -9
  158. vendor/vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php +0 -27
  159. vendor/vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php +0 -9
  160. vendor/vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php +0 -10
  161. vendor/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php +0 -10
  162. vendor/vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php +0 -9
  163. vendor/vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php +0 -16
  164. vendor/vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php +0 -11
  165. vendor/vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php +0 -37
  166. vendor/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php +0 -9
  167. vendor/vendor/composer/installers/src/Composer/Installers/MauticInstaller.php +0 -25
  168. vendor/vendor/composer/installers/src/Composer/Installers/MayaInstaller.php +0 -33
  169. vendor/vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php +0 -51
  170. vendor/vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php +0 -119
  171. vendor/vendor/composer/installers/src/Composer/Installers/ModxInstaller.php +0 -12
  172. vendor/vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php +0 -58
  173. vendor/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php +0 -47
  174. vendor/vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php +0 -24
  175. vendor/vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php +0 -14
  176. vendor/vendor/composer/installers/src/Composer/Installers/OxidInstaller.php +0 -59
  177. vendor/vendor/composer/installers/src/Composer/Installers/PPIInstaller.php +0 -9
  178. vendor/vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php +0 -11
  179. vendor/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php +0 -11
  180. vendor/vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php +0 -21
  181. vendor/vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php +0 -32
  182. vendor/vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php +0 -29
  183. vendor/vendor/composer/installers/src/Composer/Installers/Plugin.php +0 -17
  184. vendor/vendor/composer/installers/src/Composer/Installers/PortoInstaller.php +0 -9
  185. vendor/vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php +0 -10
  186. vendor/vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php +0 -11
  187. vendor/vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php +0 -63
  188. vendor/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php +0 -24
  189. vendor/vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php +0 -10
  190. vendor/vendor/composer/installers/src/Composer/Installers/Redaxo5Installer.php +0 -10
  191. vendor/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php +0 -10
  192. vendor/vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php +0 -22
  193. vendor/vendor/composer/installers/src/Composer/Installers/SMFInstaller.php +0 -10
  194. vendor/vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php +0 -60
  195. vendor/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php +0 -35
  196. vendor/vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php +0 -25
  197. vendor/vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php +0 -49
  198. vendor/vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php +0 -26
  199. vendor/vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php +0 -16
  200. vendor/vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php +0 -38
  201. vendor/vendor/composer/installers/src/Composer/Installers/TaoInstaller.php +0 -12
  202. vendor/vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php +0 -12
  203. vendor/vendor/composer/installers/src/Composer/Installers/TuskInstaller.php +0 -14
  204. vendor/vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php +0 -9
  205. vendor/vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php +0 -10
  206. vendor/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php +0 -49
  207. vendor/vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php +0 -21
  208. vendor/vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php +0 -9
  209. vendor/vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php +0 -12
  210. vendor/vendor/composer/installers/src/Composer/Installers/YawikInstaller.php +0 -32
  211. vendor/vendor/composer/installers/src/Composer/Installers/ZendInstaller.php +0 -11
  212. vendor/vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php +0 -10
  213. vendor/vendor/composer/installers/src/bootstrap.php +0 -13
  214. vendor/vendor/symfony/polyfill-ctype/Ctype.php +0 -227
  215. vendor/vendor/symfony/polyfill-ctype/LICENSE +0 -19
  216. vendor/vendor/symfony/polyfill-ctype/README.md +0 -12
  217. vendor/vendor/symfony/polyfill-ctype/bootstrap.php +0 -26
  218. vendor/vendor/symfony/polyfill-ctype/composer.json +0 -34
  219. vendor/vendor/twig/twig/.editorconfig +0 -18
  220. vendor/vendor/twig/twig/.gitignore +0 -6
  221. vendor/vendor/twig/twig/.php_cs.dist +0 -20
  222. vendor/vendor/twig/twig/.travis.yml +0 -46
  223. vendor/vendor/twig/twig/CHANGELOG +0 -1129
  224. vendor/vendor/twig/twig/LICENSE +0 -31
  225. vendor/vendor/twig/twig/README.rst +0 -24
  226. vendor/vendor/twig/twig/composer.json +0 -53
  227. vendor/vendor/twig/twig/doc/advanced.rst +0 -962
  228. vendor/vendor/twig/twig/doc/advanced_legacy.rst +0 -882
  229. vendor/vendor/twig/twig/doc/api.rst +0 -596
  230. vendor/vendor/twig/twig/doc/coding_standards.rst +0 -101
  231. vendor/vendor/twig/twig/doc/deprecated.rst +0 -224
  232. vendor/vendor/twig/twig/doc/filters/abs.rst +0 -18
  233. vendor/vendor/twig/twig/doc/filters/batch.rst +0 -51
  234. vendor/vendor/twig/twig/doc/filters/capitalize.rst +0 -11
  235. vendor/vendor/twig/twig/doc/filters/convert_encoding.rst +0 -28
  236. vendor/vendor/twig/twig/doc/filters/date.rst +0 -100
  237. vendor/vendor/twig/twig/doc/filters/date_modify.rst +0 -23
  238. vendor/vendor/twig/twig/doc/filters/default.rst +0 -33
  239. vendor/vendor/twig/twig/doc/filters/escape.rst +0 -129
  240. vendor/vendor/twig/twig/doc/filters/filter.rst +0 -58
  241. vendor/vendor/twig/twig/doc/filters/first.rst +0 -25
  242. vendor/vendor/twig/twig/doc/filters/format.rst +0 -16
  243. vendor/vendor/twig/twig/doc/filters/index.rst +0 -41
  244. vendor/vendor/twig/twig/doc/filters/join.rst +0 -35
  245. vendor/vendor/twig/twig/doc/filters/json_encode.rst +0 -23
  246. vendor/vendor/twig/twig/doc/filters/keys.rst +0 -11
  247. vendor/vendor/twig/twig/doc/filters/last.rst +0 -25
  248. vendor/vendor/twig/twig/doc/filters/length.rst +0 -23
  249. vendor/vendor/twig/twig/doc/filters/lower.rst +0 -10
  250. vendor/vendor/twig/twig/doc/filters/map.rst +0 -38
  251. vendor/vendor/twig/twig/doc/filters/merge.rst +0 -48
  252. vendor/vendor/twig/twig/doc/filters/nl2br.rst +0 -22
  253. vendor/vendor/twig/twig/doc/filters/number_format.rst +0 -56
  254. vendor/vendor/twig/twig/doc/filters/raw.rst +0 -38
  255. vendor/vendor/twig/twig/doc/filters/reduce.rst +0 -33
  256. vendor/vendor/twig/twig/doc/filters/replace.rst +0 -25
  257. vendor/vendor/twig/twig/doc/filters/reverse.rst +0 -47
  258. vendor/vendor/twig/twig/doc/filters/round.rst +0 -37
  259. vendor/vendor/twig/twig/doc/filters/slice.rst +0 -71
  260. vendor/vendor/twig/twig/doc/filters/sort.rst +0 -18
  261. vendor/vendor/twig/twig/doc/filters/spaceless.rst +0 -65
  262. vendor/vendor/twig/twig/doc/filters/split.rst +0 -53
  263. vendor/vendor/twig/twig/doc/filters/striptags.rst +0 -29
  264. vendor/vendor/twig/twig/doc/filters/title.rst +0 -11
  265. vendor/vendor/twig/twig/doc/filters/trim.rst +0 -45
  266. vendor/vendor/twig/twig/doc/filters/upper.rst +0 -10
  267. vendor/vendor/twig/twig/doc/filters/url_encode.rst +0 -34
  268. vendor/vendor/twig/twig/doc/functions/attribute.rst +0 -26
  269. vendor/vendor/twig/twig/doc/functions/block.rst +0 -41
  270. vendor/vendor/twig/twig/doc/functions/constant.rst +0 -29
  271. vendor/vendor/twig/twig/doc/functions/cycle.rst +0 -28
  272. vendor/vendor/twig/twig/doc/functions/date.rst +0 -55
  273. vendor/vendor/twig/twig/doc/functions/dump.rst +0 -69
  274. vendor/vendor/twig/twig/doc/functions/include.rst +0 -84
  275. vendor/vendor/twig/twig/doc/functions/index.rst +0 -20
  276. vendor/vendor/twig/twig/doc/functions/max.rst +0 -20
  277. vendor/vendor/twig/twig/doc/functions/min.rst +0 -20
  278. vendor/vendor/twig/twig/doc/functions/parent.rst +0 -20
  279. vendor/vendor/twig/twig/doc/functions/random.rst +0 -36
  280. vendor/vendor/twig/twig/doc/functions/range.rst +0 -58
  281. vendor/vendor/twig/twig/doc/functions/source.rst +0 -32
  282. vendor/vendor/twig/twig/doc/functions/template_from_string.rst +0 -43
  283. vendor/vendor/twig/twig/doc/index.rst +0 -19
  284. vendor/vendor/twig/twig/doc/installation.rst +0 -73
  285. vendor/vendor/twig/twig/doc/internals.rst +0 -144
  286. vendor/vendor/twig/twig/doc/intro.rst +0 -76
  287. vendor/vendor/twig/twig/doc/recipes.rst +0 -568
  288. vendor/vendor/twig/twig/doc/tags/apply.rst +0 -23
  289. vendor/vendor/twig/twig/doc/tags/autoescape.rst +0 -81
  290. vendor/vendor/twig/twig/doc/tags/block.rst +0 -11
  291. vendor/vendor/twig/twig/doc/tags/deprecated.rst +0 -30
  292. vendor/vendor/twig/twig/doc/tags/do.rst +0 -12
  293. vendor/vendor/twig/twig/doc/tags/embed.rst +0 -178
  294. vendor/vendor/twig/twig/doc/tags/extends.rst +0 -270
  295. vendor/vendor/twig/twig/doc/tags/filter.rst +0 -26
  296. vendor/vendor/twig/twig/doc/tags/flush.rst +0 -17
  297. vendor/vendor/twig/twig/doc/tags/for.rst +0 -179
  298. vendor/vendor/twig/twig/doc/tags/from.rst +0 -6
  299. vendor/vendor/twig/twig/doc/tags/if.rst +0 -79
  300. vendor/vendor/twig/twig/doc/tags/import.rst +0 -6
  301. vendor/vendor/twig/twig/doc/tags/include.rst +0 -114
  302. vendor/vendor/twig/twig/doc/tags/index.rst +0 -27
  303. vendor/vendor/twig/twig/doc/tags/macro.rst +0 -139
  304. vendor/vendor/twig/twig/doc/tags/sandbox.rst +0 -30
  305. vendor/vendor/twig/twig/doc/tags/set.rst +0 -78
  306. vendor/vendor/twig/twig/doc/tags/spaceless.rst +0 -41
  307. vendor/vendor/twig/twig/doc/tags/use.rst +0 -124
  308. vendor/vendor/twig/twig/doc/tags/verbatim.rst +0 -24
  309. vendor/vendor/twig/twig/doc/tags/with.rst +0 -44
  310. vendor/vendor/twig/twig/doc/templates.rst +0 -888
  311. vendor/vendor/twig/twig/doc/tests/constant.rst +0 -22
  312. vendor/vendor/twig/twig/doc/tests/defined.rst +0 -30
  313. vendor/vendor/twig/twig/doc/tests/divisibleby.rst +0 -14
  314. vendor/vendor/twig/twig/doc/tests/empty.rst +0 -22
  315. vendor/vendor/twig/twig/doc/tests/even.rst +0 -10
  316. vendor/vendor/twig/twig/doc/tests/index.rst +0 -15
  317. vendor/vendor/twig/twig/doc/tests/iterable.rst +0 -19
  318. vendor/vendor/twig/twig/doc/tests/null.rst +0 -12
  319. vendor/vendor/twig/twig/doc/tests/odd.rst +0 -10
  320. vendor/vendor/twig/twig/doc/tests/sameas.rst +0 -14
  321. vendor/vendor/twig/twig/drupal_test.sh +0 -51
  322. vendor/vendor/twig/twig/ext/twig/.gitignore +0 -30
  323. vendor/vendor/twig/twig/ext/twig/config.m4 +0 -8
  324. vendor/vendor/twig/twig/ext/twig/config.w32 +0 -8
  325. vendor/vendor/twig/twig/ext/twig/php_twig.h +0 -35
  326. vendor/vendor/twig/twig/ext/twig/twig.c +0 -1217
  327. vendor/vendor/twig/twig/lib/Twig/Autoloader.php +0 -52
  328. vendor/vendor/twig/twig/lib/Twig/BaseNodeVisitor.php +0 -11
  329. vendor/vendor/twig/twig/lib/Twig/Cache/Filesystem.php +0 -11
  330. vendor/vendor/twig/twig/lib/Twig/Cache/Null.php +0 -11
  331. vendor/vendor/twig/twig/lib/Twig/CacheInterface.php +0 -11
  332. vendor/vendor/twig/twig/lib/Twig/Compiler.php +0 -11
  333. vendor/vendor/twig/twig/lib/Twig/CompilerInterface.php +0 -34
  334. vendor/vendor/twig/twig/lib/Twig/ContainerRuntimeLoader.php +0 -11
  335. vendor/vendor/twig/twig/lib/Twig/Environment.php +0 -11
  336. vendor/vendor/twig/twig/lib/Twig/Error.php +0 -11
  337. vendor/vendor/twig/twig/lib/Twig/Error/Loader.php +0 -11
  338. vendor/vendor/twig/twig/lib/Twig/Error/Runtime.php +0 -11
  339. vendor/vendor/twig/twig/lib/Twig/Error/Syntax.php +0 -11
  340. vendor/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php +0 -11
  341. vendor/vendor/twig/twig/lib/Twig/ExpressionParser.php +0 -11
  342. vendor/vendor/twig/twig/lib/Twig/Extension.php +0 -11
  343. vendor/vendor/twig/twig/lib/Twig/Extension/Core.php +0 -11
  344. vendor/vendor/twig/twig/lib/Twig/Extension/Debug.php +0 -11
  345. vendor/vendor/twig/twig/lib/Twig/Extension/Escaper.php +0 -11
  346. vendor/vendor/twig/twig/lib/Twig/Extension/GlobalsInterface.php +0 -11
  347. vendor/vendor/twig/twig/lib/Twig/Extension/InitRuntimeInterface.php +0 -11
  348. vendor/vendor/twig/twig/lib/Twig/Extension/Optimizer.php +0 -11
  349. vendor/vendor/twig/twig/lib/Twig/Extension/Profiler.php +0 -11
  350. vendor/vendor/twig/twig/lib/Twig/Extension/Sandbox.php +0 -11
  351. vendor/vendor/twig/twig/lib/Twig/Extension/Staging.php +0 -11
  352. vendor/vendor/twig/twig/lib/Twig/Extension/StringLoader.php +0 -11
  353. vendor/vendor/twig/twig/lib/Twig/ExtensionInterface.php +0 -11
  354. vendor/vendor/twig/twig/lib/Twig/FactoryRuntimeLoader.php +0 -11
  355. vendor/vendor/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php +0 -11
  356. vendor/vendor/twig/twig/lib/Twig/Filter.php +0 -86
  357. vendor/vendor/twig/twig/lib/Twig/Filter/Function.php +0 -40
  358. vendor/vendor/twig/twig/lib/Twig/Filter/Method.php +0 -44
  359. vendor/vendor/twig/twig/lib/Twig/Filter/Node.php +0 -42
  360. vendor/vendor/twig/twig/lib/Twig/FilterCallableInterface.php +0 -24
  361. vendor/vendor/twig/twig/lib/Twig/FilterInterface.php +0 -45
  362. vendor/vendor/twig/twig/lib/Twig/Function.php +0 -76
  363. vendor/vendor/twig/twig/lib/Twig/Function/Function.php +0 -41
  364. vendor/vendor/twig/twig/lib/Twig/Function/Method.php +0 -45
  365. vendor/vendor/twig/twig/lib/Twig/Function/Node.php +0 -42
  366. vendor/vendor/twig/twig/lib/Twig/FunctionCallableInterface.php +0 -24
  367. vendor/vendor/twig/twig/lib/Twig/FunctionInterface.php +0 -42
  368. vendor/vendor/twig/twig/lib/Twig/Lexer.php +0 -11
  369. vendor/vendor/twig/twig/lib/Twig/LexerInterface.php +0 -36
  370. vendor/vendor/twig/twig/lib/Twig/Loader/Array.php +0 -11
  371. vendor/vendor/twig/twig/lib/Twig/Loader/Chain.php +0 -11
  372. vendor/vendor/twig/twig/lib/Twig/Loader/Filesystem.php +0 -11
  373. vendor/vendor/twig/twig/lib/Twig/Loader/String.php +0 -63
  374. vendor/vendor/twig/twig/lib/Twig/LoaderInterface.php +0 -11
  375. vendor/vendor/twig/twig/lib/Twig/Markup.php +0 -11
  376. vendor/vendor/twig/twig/lib/Twig/Node.php +0 -11
  377. vendor/vendor/twig/twig/lib/Twig/Node/AutoEscape.php +0 -11
  378. vendor/vendor/twig/twig/lib/Twig/Node/Block.php +0 -11
  379. vendor/vendor/twig/twig/lib/Twig/Node/BlockReference.php +0 -11
  380. vendor/vendor/twig/twig/lib/Twig/Node/Body.php +0 -11
  381. vendor/vendor/twig/twig/lib/Twig/Node/CheckSecurity.php +0 -11
  382. vendor/vendor/twig/twig/lib/Twig/Node/Deprecated.php +0 -11
  383. vendor/vendor/twig/twig/lib/Twig/Node/Do.php +0 -11
  384. vendor/vendor/twig/twig/lib/Twig/Node/Embed.php +0 -11
  385. vendor/vendor/twig/twig/lib/Twig/Node/Expression.php +0 -11
  386. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Array.php +0 -11
  387. vendor/vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php +0 -11
  388. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary.php +0 -11
  389. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php +0 -11
  390. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php +0 -11
  391. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php +0 -11
  392. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php +0 -11
  393. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php +0 -11
  394. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php +0 -11
  395. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php +0 -11
  396. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php +0 -11
  397. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php +0 -11
  398. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php +0 -11
  399. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php +0 -11
  400. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php +0 -11
  401. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php +0 -11
  402. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php +0 -11
  403. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php +0 -11
  404. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php +0 -11
  405. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php +0 -11
  406. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php +0 -11
  407. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php +0 -11
  408. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php +0 -11
  409. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php +0 -11
  410. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php +0 -11
  411. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php +0 -11
  412. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php +0 -11
  413. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php +0 -11
  414. vendor/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php +0 -11
  415. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Call.php +0 -11
  416. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php +0 -11
  417. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Constant.php +0 -11
  418. vendor/vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php +0 -35
  419. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Filter.php +0 -11
  420. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php +0 -11
  421. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Function.php +0 -11
  422. vendor/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php +0 -11
  423. vendor/vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php +0 -11
  424. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Name.php +0 -11
  425. vendor/vendor/twig/twig/lib/Twig/Node/Expression/NullCoalesce.php +0 -11
  426. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Parent.php +0 -11
  427. vendor/vendor/twig/twig/lib/Twig/Node/Expression/TempName.php +0 -11
  428. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Test.php +0 -11
  429. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php +0 -11
  430. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php +0 -11
  431. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php +0 -11
  432. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php +0 -11
  433. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php +0 -11
  434. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php +0 -11
  435. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php +0 -11
  436. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Unary.php +0 -11
  437. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php +0 -11
  438. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php +0 -11
  439. vendor/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php +0 -11
  440. vendor/vendor/twig/twig/lib/Twig/Node/Flush.php +0 -11
  441. vendor/vendor/twig/twig/lib/Twig/Node/For.php +0 -11
  442. vendor/vendor/twig/twig/lib/Twig/Node/ForLoop.php +0 -11
  443. vendor/vendor/twig/twig/lib/Twig/Node/If.php +0 -11
  444. vendor/vendor/twig/twig/lib/Twig/Node/Import.php +0 -11
  445. vendor/vendor/twig/twig/lib/Twig/Node/Include.php +0 -11
  446. vendor/vendor/twig/twig/lib/Twig/Node/Macro.php +0 -11
  447. vendor/vendor/twig/twig/lib/Twig/Node/Module.php +0 -11
  448. vendor/vendor/twig/twig/lib/Twig/Node/Print.php +0 -11
  449. vendor/vendor/twig/twig/lib/Twig/Node/Sandbox.php +0 -11
  450. vendor/vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php +0 -11
  451. vendor/vendor/twig/twig/lib/Twig/Node/Set.php +0 -11
  452. vendor/vendor/twig/twig/lib/Twig/Node/SetTemp.php +0 -11
  453. vendor/vendor/twig/twig/lib/Twig/Node/Spaceless.php +0 -11
  454. vendor/vendor/twig/twig/lib/Twig/Node/Text.php +0 -11
  455. vendor/vendor/twig/twig/lib/Twig/Node/With.php +0 -11
  456. vendor/vendor/twig/twig/lib/Twig/NodeCaptureInterface.php +0 -11
  457. vendor/vendor/twig/twig/lib/Twig/NodeInterface.php +0 -34
  458. vendor/vendor/twig/twig/lib/Twig/NodeOutputInterface.php +0 -11
  459. vendor/vendor/twig/twig/lib/Twig/NodeTraverser.php +0 -11
  460. vendor/vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php +0 -11
  461. vendor/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php +0 -11
  462. vendor/vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php +0 -11
  463. vendor/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php +0 -11
  464. vendor/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php +0 -11
  465. vendor/vendor/twig/twig/lib/Twig/Parser.php +0 -11
  466. vendor/vendor/twig/twig/lib/Twig/ParserInterface.php +0 -33
  467. vendor/vendor/twig/twig/lib/Twig/Profiler/Dumper/Base.php +0 -11
  468. vendor/vendor/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php +0 -11
  469. vendor/vendor/twig/twig/lib/Twig/Profiler/Dumper/Html.php +0 -11
  470. vendor/vendor/twig/twig/lib/Twig/Profiler/Dumper/Text.php +0 -11
  471. vendor/vendor/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php +0 -11
  472. vendor/vendor/twig/twig/lib/Twig/Profiler/Node/LeaveProfile.php +0 -11
  473. vendor/vendor/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php +0 -11
  474. vendor/vendor/twig/twig/lib/Twig/Profiler/Profile.php +0 -11
  475. vendor/vendor/twig/twig/lib/Twig/RuntimeLoaderInterface.php +0 -11
  476. vendor/vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php +0 -11
  477. vendor/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php +0 -11
  478. vendor/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php +0 -11
  479. vendor/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedMethodError.php +0 -11
  480. vendor/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedPropertyError.php +0 -11
  481. vendor/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php +0 -11
  482. vendor/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php +0 -11
  483. vendor/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php +0 -11
  484. vendor/vendor/twig/twig/lib/Twig/SimpleFilter.php +0 -11
  485. vendor/vendor/twig/twig/lib/Twig/SimpleFunction.php +0 -11
  486. vendor/vendor/twig/twig/lib/Twig/SimpleTest.php +0 -11
  487. vendor/vendor/twig/twig/lib/Twig/Source.php +0 -11
  488. vendor/vendor/twig/twig/lib/Twig/SourceContextLoaderInterface.php +0 -11
  489. vendor/vendor/twig/twig/lib/Twig/Template.php +0 -11
  490. vendor/vendor/twig/twig/lib/Twig/TemplateInterface.php +0 -50
  491. vendor/vendor/twig/twig/lib/Twig/TemplateWrapper.php +0 -11
  492. vendor/vendor/twig/twig/lib/Twig/Test.php +0 -37
  493. vendor/vendor/twig/twig/lib/Twig/Test/Function.php +0 -38
  494. vendor/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php +0 -11
  495. vendor/vendor/twig/twig/lib/Twig/Test/Method.php +0 -42
  496. vendor/vendor/twig/twig/lib/Twig/Test/Node.php +0 -40
  497. vendor/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php +0 -11
  498. vendor/vendor/twig/twig/lib/Twig/TestCallableInterface.php +0 -22
  499. vendor/vendor/twig/twig/lib/Twig/TestInterface.php +0 -27
  500. vendor/vendor/twig/twig/lib/Twig/Token.php +0 -11
  501. vendor/vendor/twig/twig/lib/Twig/TokenParser.php +0 -11
  502. vendor/vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php +0 -11
  503. vendor/vendor/twig/twig/lib/Twig/TokenParser/Block.php +0 -11
  504. vendor/vendor/twig/twig/lib/Twig/TokenParser/Deprecated.php +0 -11
  505. vendor/vendor/twig/twig/lib/Twig/TokenParser/Do.php +0 -11
  506. vendor/vendor/twig/twig/lib/Twig/TokenParser/Embed.php +0 -11
  507. vendor/vendor/twig/twig/lib/Twig/TokenParser/Extends.php +0 -11
  508. vendor/vendor/twig/twig/lib/Twig/TokenParser/Filter.php +0 -11
  509. vendor/vendor/twig/twig/lib/Twig/TokenParser/Flush.php +0 -11
  510. vendor/vendor/twig/twig/lib/Twig/TokenParser/For.php +0 -11
  511. vendor/vendor/twig/twig/lib/Twig/TokenParser/From.php +0 -11
  512. vendor/vendor/twig/twig/lib/Twig/TokenParser/If.php +0 -11
  513. vendor/vendor/twig/twig/lib/Twig/TokenParser/Import.php +0 -11
  514. vendor/vendor/twig/twig/lib/Twig/TokenParser/Include.php +0 -11
  515. vendor/vendor/twig/twig/lib/Twig/TokenParser/Macro.php +0 -11
  516. vendor/vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php +0 -11
  517. vendor/vendor/twig/twig/lib/Twig/TokenParser/Set.php +0 -11
  518. vendor/vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php +0 -11
  519. vendor/vendor/twig/twig/lib/Twig/TokenParser/Use.php +0 -11
  520. vendor/vendor/twig/twig/lib/Twig/TokenParser/With.php +0 -11
  521. vendor/vendor/twig/twig/lib/Twig/TokenParserBroker.php +0 -122
  522. vendor/vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php +0 -46
  523. vendor/vendor/twig/twig/lib/Twig/TokenParserInterface.php +0 -11
  524. vendor/vendor/twig/twig/lib/Twig/TokenStream.php +0 -11
  525. vendor/vendor/twig/twig/lib/Twig/Util/DeprecationCollector.php +0 -11
  526. vendor/vendor/twig/twig/lib/Twig/Util/TemplateDirIterator.php +0 -11
  527. vendor/vendor/twig/twig/phpunit.xml.dist +0 -33
  528. vendor/vendor/twig/twig/src/Cache/CacheInterface.php +0 -60
  529. vendor/vendor/twig/twig/src/Cache/FilesystemCache.php +0 -93
  530. vendor/vendor/twig/twig/src/Cache/NullCache.php +0 -42
  531. vendor/vendor/twig/twig/src/Compiler.php +0 -288
  532. vendor/vendor/twig/twig/src/Environment.php +0 -1638
  533. vendor/vendor/twig/twig/src/Error/Error.php +0 -325
  534. vendor/vendor/twig/twig/src/Error/LoaderError.php +0 -23
  535. vendor/vendor/twig/twig/src/Error/RuntimeError.php +0 -24
  536. vendor/vendor/twig/twig/src/Error/SyntaxError.php +0 -57
  537. vendor/vendor/twig/twig/src/ExpressionParser.php +0 -834
  538. vendor/vendor/twig/twig/src/Extension/AbstractExtension.php +0 -72
  539. vendor/vendor/twig/twig/src/Extension/CoreExtension.php +0 -696
README.md CHANGED
@@ -99,9 +99,11 @@ Timber is great for any WordPress developer who cares about writing good, mainta
99
  * [**Timber Debugger**](https://github.com/djboris88/timber-debugger) Package that provides extra debugging options for Timber
100
  * [**Timber Dump Extension**](https://github.com/nlemoine/timber-dump-extension) Debug output with nice formatting
101
  * [**Timber Photon**](https://github.com/slimndap/TimberPhoton) Plug-in to use JetPack's free Photon image manipulation and CDN with Timber
 
102
  * [**Timber Sugar**](https://github.com/timber/sugar) A catch-all for goodies to use w Timber
103
  * [**Timber WebLink Extension**](https://github.com/nlemoine/timber-weblink-extension) Provides Twig functions to manage the Link HTTP header needed for Web Linking when using HTTP/2 Server Push as well as Resource Hints
104
  * [**Timmy**](https://github.com/MINDKomm/Timmy) Advanced image manipulation for Timber
 
105
 
106
  #### Projects that use Timber
107
  * [**Branch**](https://github.com/JeyKeu/branch/) Bootstrap 3 + Timber = Branch starter theme!
99
  * [**Timber Debugger**](https://github.com/djboris88/timber-debugger) Package that provides extra debugging options for Timber
100
  * [**Timber Dump Extension**](https://github.com/nlemoine/timber-dump-extension) Debug output with nice formatting
101
  * [**Timber Photon**](https://github.com/slimndap/TimberPhoton) Plug-in to use JetPack's free Photon image manipulation and CDN with Timber
102
+ * [**Timber VS Code Extension**](https://github.com/JDevx97/Timber-Snippets) Snippets for Timber in Visual Studio Code
103
  * [**Timber Sugar**](https://github.com/timber/sugar) A catch-all for goodies to use w Timber
104
  * [**Timber WebLink Extension**](https://github.com/nlemoine/timber-weblink-extension) Provides Twig functions to manage the Link HTTP header needed for Web Linking when using HTTP/2 Server Push as well as Resource Hints
105
  * [**Timmy**](https://github.com/MINDKomm/Timmy) Advanced image manipulation for Timber
106
+ * [**Timber ACF WP Blocks**](https://github.com/palmiak/timber-acf-wp-blocks) Easy ACF Gutenberg blocks creation
107
 
108
  #### Projects that use Timber
109
  * [**Branch**](https://github.com/JeyKeu/branch/) Bootstrap 3 + Timber = Branch starter theme!
lib/Image.php CHANGED
@@ -6,6 +6,7 @@ use Timber\CoreInterface;
6
  use Timber\Helper;
7
  use Timber\Post;
8
  use Timber\URLHelper;
 
9
 
10
 
11
  /**
@@ -115,7 +116,7 @@ class Image extends Post implements CoreInterface {
115
  * @return array
116
  */
117
  public function get_pathinfo() {
118
- return pathinfo($this->file);
119
  }
120
 
121
  /**
@@ -497,7 +498,7 @@ class Image extends Post implements CoreInterface {
497
  protected function is_image() {
498
  $src = wp_get_attachment_url($this->ID);
499
  $image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' );
500
- $check = wp_check_filetype(basename($src), null);
501
  return in_array($check['ext'], $image_exts);
502
  }
503
 
6
  use Timber\Helper;
7
  use Timber\Post;
8
  use Timber\URLHelper;
9
+ use Timber\PathHelper;
10
 
11
 
12
  /**
116
  * @return array
117
  */
118
  public function get_pathinfo() {
119
+ return PathHelper::pathinfo($this->file);
120
  }
121
 
122
  /**
498
  protected function is_image() {
499
  $src = wp_get_attachment_url($this->ID);
500
  $image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' );
501
+ $check = wp_check_filetype(PathHelper::basename($src), null);
502
  return in_array($check['ext'], $image_exts);
503
  }
504
 
lib/Image/Operation/Letterbox.php CHANGED
@@ -4,6 +4,7 @@ namespace Timber\Image\Operation;
4
 
5
  use Timber\Helper;
6
  use Timber\ImageHelper;
 
7
  use Timber\Image\Operation as ImageOperation;
8
 
9
  /*
@@ -103,7 +104,7 @@ class Letterbox extends ImageOperation {
103
  $result = $image->save($save_filename);
104
  $func = 'imagecreatefromjpeg';
105
  $save_func = 'imagejpeg';
106
- $ext = pathinfo($save_filename, PATHINFO_EXTENSION);
107
  if ( $ext == 'gif' ) {
108
  $func = 'imagecreatefromgif';
109
  $save_func = 'imagegif';
4
 
5
  use Timber\Helper;
6
  use Timber\ImageHelper;
7
+ use Timber\PathHelper;
8
  use Timber\Image\Operation as ImageOperation;
9
 
10
  /*
104
  $result = $image->save($save_filename);
105
  $func = 'imagecreatefromjpeg';
106
  $save_func = 'imagejpeg';
107
+ $ext = PathHelper::pathinfo($save_filename, PATHINFO_EXTENSION);
108
  if ( $ext == 'gif' ) {
109
  $func = 'imagecreatefromgif';
110
  $save_func = 'imagegif';
lib/ImageHelper.php CHANGED
@@ -10,6 +10,7 @@ use Timber\Image\Operation\Retina;
10
  use Timber\Image\Operation\Letterbox;
11
 
12
  use Timber\URLHelper;
 
13
 
14
  /**
15
  * Implements the Twig image filters:
@@ -163,7 +164,7 @@ class ImageHelper {
163
  * SVG images are not allowed by default in WordPress, so we have to pass a default mime
164
  * type for SVG images.
165
  */
166
- $mime = wp_check_filetype_and_ext( $file_path, basename( $file_path ), array(
167
  'svg' => 'image/svg+xml',
168
  ) );
169
 
@@ -281,7 +282,7 @@ class ImageHelper {
281
  if ( URLHelper::is_absolute($local_file) ) {
282
  $local_file = URLHelper::url_to_file_system($local_file);
283
  }
284
- $info = pathinfo($local_file);
285
  $dir = $info['dirname'];
286
  $ext = $info['extension'];
287
  $filename = $info['filename'];
@@ -348,7 +349,7 @@ class ImageHelper {
348
  $dir = $upload['path'];
349
  $filename = $file;
350
  $file = parse_url($file);
351
- $path_parts = pathinfo($file['path']);
352
  $basename = md5($filename);
353
  $ext = 'jpg';
354
  if ( isset($path_parts['extension']) ) {
@@ -375,7 +376,7 @@ class ImageHelper {
375
  $tmp = download_url($file);
376
  preg_match('/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches);
377
  $file_array = array();
378
- $file_array['name'] = basename($matches[0]);
379
  $file_array['tmp_name'] = $tmp;
380
  // If error storing temporarily, unlink
381
  if ( is_wp_error($tmp) ) {
@@ -383,7 +384,7 @@ class ImageHelper {
383
  $file_array['tmp_name'] = '';
384
  }
385
  // do the validation and storage stuff
386
- $locinfo = pathinfo($loc);
387
  $file = wp_upload_bits($locinfo['basename'], null, file_get_contents($file_array['tmp_name']));
388
  return $file['url'];
389
  }
@@ -432,7 +433,7 @@ class ImageHelper {
432
  $tmp = URLHelper::remove_url_component($tmp, WP_CONTENT_DIR);
433
  }
434
  }
435
- $parts = pathinfo($tmp);
436
  $result['subdir'] = ($parts['dirname'] === '/') ? '' : $parts['dirname'];
437
  $result['filename'] = $parts['filename'];
438
  $result['extension'] = strtolower($parts['extension']);
10
  use Timber\Image\Operation\Letterbox;
11
 
12
  use Timber\URLHelper;
13
+ use Timber\PathHelper;
14
 
15
  /**
16
  * Implements the Twig image filters:
164
  * SVG images are not allowed by default in WordPress, so we have to pass a default mime
165
  * type for SVG images.
166
  */
167
+ $mime = wp_check_filetype_and_ext( $file_path, PathHelper::basename( $file_path ), array(
168
  'svg' => 'image/svg+xml',
169
  ) );
170
 
282
  if ( URLHelper::is_absolute($local_file) ) {
283
  $local_file = URLHelper::url_to_file_system($local_file);
284
  }
285
+ $info = PathHelper::pathinfo($local_file);
286
  $dir = $info['dirname'];
287
  $ext = $info['extension'];
288
  $filename = $info['filename'];
349
  $dir = $upload['path'];
350
  $filename = $file;
351
  $file = parse_url($file);
352
+ $path_parts = PathHelper::pathinfo($file['path']);
353
  $basename = md5($filename);
354
  $ext = 'jpg';
355
  if ( isset($path_parts['extension']) ) {
376
  $tmp = download_url($file);
377
  preg_match('/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches);
378
  $file_array = array();
379
+ $file_array['name'] = PathHelper::basename($matches[0]);
380
  $file_array['tmp_name'] = $tmp;
381
  // If error storing temporarily, unlink
382
  if ( is_wp_error($tmp) ) {
384
  $file_array['tmp_name'] = '';
385
  }
386
  // do the validation and storage stuff
387
+ $locinfo = PathHelper::pathinfo($loc);
388
  $file = wp_upload_bits($locinfo['basename'], null, file_get_contents($file_array['tmp_name']));
389
  return $file['url'];
390
  }
433
  $tmp = URLHelper::remove_url_component($tmp, WP_CONTENT_DIR);
434
  }
435
  }
436
+ $parts = PathHelper::pathinfo($tmp);
437
  $result['subdir'] = ($parts['dirname'] === '/') ? '' : $parts['dirname'];
438
  $result['filename'] = $parts['filename'];
439
  $result['extension'] = strtolower($parts['extension']);
lib/LocationManager.php CHANGED
@@ -2,6 +2,8 @@
2
 
3
  namespace Timber;
4
 
 
 
5
  class LocationManager {
6
 
7
 
@@ -81,7 +83,7 @@ class LocationManager {
81
  public static function get_calling_script_dir( $offset = 0 ) {
82
  $caller = self::get_calling_script_file($offset);
83
  if ( !is_null($caller) ) {
84
- $pathinfo = pathinfo($caller);
85
  $dir = $pathinfo['dirname'];
86
  return $dir;
87
  }
2
 
3
  namespace Timber;
4
 
5
+ use Timber\PathHelper;
6
+
7
  class LocationManager {
8
 
9
 
83
  public static function get_calling_script_dir( $offset = 0 ) {
84
  $caller = self::get_calling_script_file($offset);
85
  if ( !is_null($caller) ) {
86
+ $pathinfo = PathHelper::pathinfo($caller);
87
  $dir = $pathinfo['dirname'];
88
  return $dir;
89
  }
lib/Menu.php CHANGED
@@ -5,7 +5,7 @@ namespace Timber;
5
  use Timber\Core;
6
  use Timber\Post;
7
 
8
- class Menu extends Core {
9
 
10
  public $MenuItemClass = 'Timber\MenuItem';
11
  public $PostClass = 'Timber\Post';
5
  use Timber\Core;
6
  use Timber\Post;
7
 
8
+ class Menu extends Term {
9
 
10
  public $MenuItemClass = 'Timber\MenuItem';
11
  public $PostClass = 'Timber\Post';
lib/MenuItem.php CHANGED
@@ -61,13 +61,14 @@ class MenuItem extends Core implements CoreInterface {
61
  public $current_item_ancestor;
62
 
63
  /**
64
- * Timber Menu.
 
65
  *
66
- * @api
67
- * @since 1.9.6
68
  * @var \Timber\Menu The `Timber\Menu` object the menu item is associated with.
69
  */
70
- public $menu;
71
 
72
  protected $_name;
73
  protected $_menu_item_object_id;
@@ -252,9 +253,9 @@ class MenuItem extends Core implements CoreInterface {
252
  $this->classes = array_unique($this->classes);
253
 
254
  $options = new \stdClass();
255
- if ( isset( $this->menu->options ) ) {
256
  // The options need to be an object.
257
- $options = (object) $this->menu->options;
258
  }
259
 
260
  /**
@@ -339,6 +340,18 @@ class MenuItem extends Core implements CoreInterface {
339
  return $this->_menu_item_type;
340
  }
341
 
 
 
 
 
 
 
 
 
 
 
 
 
342
  /**
343
  * Get a meta value of the menu item.
344
  *
61
  public $current_item_ancestor;
62
 
63
  /**
64
+ * Timber Menu. Previously this was a public property, but converted to a method to avoid
65
+ * recursion (see #2071).
66
  *
67
+ * @since 1.12.0
68
+ * @see \Timber\Menu::menu();
69
  * @var \Timber\Menu The `Timber\Menu` object the menu item is associated with.
70
  */
71
+ protected $menu;
72
 
73
  protected $_name;
74
  protected $_menu_item_object_id;
253
  $this->classes = array_unique($this->classes);
254
 
255
  $options = new \stdClass();
256
+ if ( isset($this->menu()->options) ) {
257
  // The options need to be an object.
258
+ $options = (object) $this->menu()->options;
259
  }
260
 
261
  /**
340
  return $this->_menu_item_type;
341
  }
342
 
343
+ /**
344
+ * Timber Menu.
345
+ *
346
+ * @api
347
+ * @since 1.12.0
348
+ * @return \Timber\Menu The `Timber\Menu` object the menu item is associated with.
349
+ */
350
+ public function menu() {
351
+ return $this->menu;
352
+ }
353
+
354
+
355
  /**
356
  * Get a meta value of the menu item.
357
  *
lib/PathHelper.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Timber;
4
+
5
+ /**
6
+ * Useful methods for working with file paths.
7
+ */
8
+ class PathHelper {
9
+
10
+ /**
11
+ *
12
+ * Unicode-friendly version of the PHP pathinfo() function.
13
+ * https://www.php.net/manual/en/function.pathinfo.php
14
+ *
15
+ * @param string $path the path.
16
+ * @param int $options the path part to extract.
17
+ * @return mixed
18
+ *
19
+ * @package Timber
20
+ */
21
+ public static function pathinfo( $path, $options = PATHINFO_DIRNAME |
22
+ PATHINFO_BASENAME | PATHINFO_EXTENSION | PATHINFO_FILENAME
23
+ ) {
24
+ $info = pathinfo(
25
+ str_replace(
26
+ array( '%2F', '%5C' ),
27
+ array( '/', '\\' ),
28
+ rawurlencode( $path )
29
+ ),
30
+ $options
31
+ );
32
+ if ( is_array( $info ) ) {
33
+ // decode all keys in the array.
34
+ return array_map( 'rawurldecode', $info );
35
+ } else {
36
+ // decode the string when requesting a single path component.
37
+ return rawurldecode( $info );
38
+ }
39
+ }
40
+
41
+ /**
42
+ *
43
+ * Unicode-friendly version of the PHP basename() function.
44
+ * https://www.php.net/manual/en/function.basename.php
45
+ *
46
+ * @param string $path the path.
47
+ * @param string $suffix optional suffix.
48
+ * @return string
49
+ */
50
+ public static function basename( $path, $suffix = '' ) {
51
+ return rawurldecode(
52
+ basename( str_replace( array( '%2F', '%5C' ), '/', rawurlencode( $path ) ), $suffix )
53
+ );
54
+ }
55
+ }
lib/PostQuery.php CHANGED
@@ -14,7 +14,18 @@ use Timber\PostGetter;
14
  * @package Timber
15
  */
16
  class PostQuery extends PostCollection {
17
-
 
 
 
 
 
 
 
 
 
 
 
18
  protected $userQuery;
19
  protected $queryIterator;
20
  protected $pagination = null;
@@ -27,13 +38,17 @@ class PostQuery extends PostCollection {
27
  $this->userQuery = $query;
28
  $this->queryIterator = PostGetter::query_posts($query, $post_class);
29
 
 
 
 
 
30
  $posts = $this->queryIterator->get_posts();
31
 
32
  parent::__construct($posts, $post_class);
33
  }
34
 
35
  /**
36
- * @return mixed the query the user orignally passed
37
  * to the pagination object
38
  */
39
  protected function get_query() {
14
  * @package Timber
15
  */
16
  class PostQuery extends PostCollection {
17
+ /**
18
+ * Found posts.
19
+ *
20
+ * The total amount of posts found for this query. Will be `0` if you used `no_found_rows` as a
21
+ * query parameter. Will be `null` if you passed in an existing collection of posts.
22
+ *
23
+ * @api
24
+ * @since 1.11.1
25
+ * @var int The amount of posts found in the query.
26
+ */
27
+ public $found_posts = null;
28
+
29
  protected $userQuery;
30
  protected $queryIterator;
31
  protected $pagination = null;
38
  $this->userQuery = $query;
39
  $this->queryIterator = PostGetter::query_posts($query, $post_class);
40
 
41
+ if ( $this->queryIterator instanceof QueryIterator ) {
42
+ $this->found_posts = $this->queryIterator->found_posts();
43
+ }
44
+
45
  $posts = $this->queryIterator->get_posts();
46
 
47
  parent::__construct($posts, $post_class);
48
  }
49
 
50
  /**
51
+ * @return mixed the query the user orignally passed
52
  * to the pagination object
53
  */
54
  protected function get_query() {
lib/QueryIterator.php CHANGED
@@ -23,7 +23,7 @@ class QueryIterator implements \Iterator, \Countable {
23
  public function __construct( $query = false, $posts_class = 'Timber\Post' ) {
24
  add_action('pre_get_posts', array($this, 'fix_number_posts_wp_quirk'));
25
  add_action('pre_get_posts', array($this, 'fix_cat_wp_quirk'));
26
-
27
  if ( $posts_class ) {
28
  $this->_posts_class = $posts_class;
29
  }
@@ -64,6 +64,18 @@ class QueryIterator implements \Iterator, \Countable {
64
  return $this->_query->post_count;
65
  }
66
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  public function get_pagination( $prefs ) {
68
  return new Pagination($prefs, $this->_query);
69
  }
23
  public function __construct( $query = false, $posts_class = 'Timber\Post' ) {
24
  add_action('pre_get_posts', array($this, 'fix_number_posts_wp_quirk'));
25
  add_action('pre_get_posts', array($this, 'fix_cat_wp_quirk'));
26
+
27
  if ( $posts_class ) {
28
  $this->_posts_class = $posts_class;
29
  }
64
  return $this->_query->post_count;
65
  }
66
 
67
+ /**
68
+ * Gets the amount of found posts in the query.
69
+ *
70
+ * @api
71
+ * @since 1.11.1
72
+ *
73
+ * @return int
74
+ */
75
+ public function found_posts() {
76
+ return $this->_query->found_posts;
77
+ }
78
+
79
  public function get_pagination( $prefs ) {
80
  return new Pagination($prefs, $this->_query);
81
  }
lib/Timber.php CHANGED
@@ -35,7 +35,7 @@ use Timber\Loader;
35
  */
36
  class Timber {
37
 
38
- public static $version = '1.11.0';
39
  public static $locations;
40
  public static $dirname = 'views';
41
  public static $twig_cache = false;
35
  */
36
  class Timber {
37
 
38
+ public static $version = '1.12.0';
39
  public static $locations;
40
  public static $dirname = 'views';
41
  public static $twig_cache = false;
lib/Twig.php CHANGED
@@ -243,24 +243,34 @@ class Twig {
243
  * @return \Twig\Environment
244
  */
245
  public function add_timber_escapers( $twig ) {
246
-
247
- $twig->getExtension('Twig\Extension\CoreExtension')->setEscaper('esc_url', function( \Twig\Environment $env, $string ) {
248
- return esc_url($string);
249
- });
250
- $twig->getExtension('Twig\Extension\CoreExtension')->setEscaper('wp_kses_post', function( \Twig\Environment $env, $string ) {
251
- return wp_kses_post($string);
252
- });
253
-
254
- $twig->getExtension('Twig\Extension\CoreExtension')->setEscaper('esc_html', function( \Twig\Environment $env, $string ) {
255
- return esc_html($string);
256
- });
257
-
258
- $twig->getExtension('Twig\Extension\CoreExtension')->setEscaper('esc_js', function( \Twig\Environment $env, $string ) {
259
- return esc_js($string);
260
- });
261
-
 
 
 
 
 
 
 
 
 
 
 
262
  return $twig;
263
-
264
  }
265
 
266
  /**
243
  * @return \Twig\Environment
244
  */
245
  public function add_timber_escapers( $twig ) {
246
+ $esc_url = function( \Twig\Environment $env, $string ) {
247
+ return esc_url( $string );
248
+ };
249
+ $wp_kses_post = function( \Twig\Environment $env, $string ) {
250
+ return wp_kses_post( $string );
251
+ };
252
+ $esc_html = function( \Twig\Environment $env, $string ) {
253
+ return esc_html( $string );
254
+ };
255
+ $esc_js = function( \Twig\Environment $env, $string ) {
256
+ return esc_js( $string );
257
+ };
258
+ if ( class_exists( 'Twig\Extension\EscaperExtension' ) ) {
259
+ $escaper_extension = $twig->getExtension('Twig\Extension\EscaperExtension');
260
+ if ( method_exists($escaper_extension, 'setEscaper') ) {
261
+ $escaper_extension->setEscaper('esc_url', $esc_url);
262
+ $escaper_extension->setEscaper('wp_kses_post', $wp_kses_post);
263
+ $escaper_extension->setEscaper('esc_html', $esc_html);
264
+ $escaper_extension->setEscaper('esc_js', $esc_js);
265
+ return $twig;
266
+ }
267
+ }
268
+ $escaper_extension = $twig->getExtension('Twig\Extension\CoreExtension');
269
+ $escaper_extension->setEscaper('esc_url', $esc_url);
270
+ $escaper_extension->setEscaper('wp_kses_post', $wp_kses_post);
271
+ $escaper_extension->setEscaper('esc_html', $esc_html);
272
+ $escaper_extension->setEscaper('esc_js', $esc_js);
273
  return $twig;
 
274
  }
275
 
276
  /**
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: jarednova
3
  Tags: template engine, templates, twig
4
  Requires at least: 4.7.12
5
  Tested up to: 5.2.3
6
- Stable tag: 1.11.0
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -30,7 +30,22 @@ _Twig is the template language powering Timber; if you need a little background
30
 
31
  = Develop (next release) =
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  = 1.11.0 =
 
34
  **General Note**
35
  - If you use WPML with Timber, please upgrade to WPML 4.2.8. The WPML team has removed their included Twig version which means no more conflicts!
36
 
@@ -59,7 +74,7 @@ If you use WPML, please do not upgrade to 1.10.* yet. Because WPML also uses Twi
59
  - Fixes a bug where the last menu item received incorrect CSS classes #2009 #1974 (thanks @strategio)
60
 
61
  **Changes for Theme Developers**
62
- - You can use WordPress's behavior of `get_posts` (versus `WP_Query`) via a filter. By default, Timber uses the behaviors of WP_Query in Timber's queries #1989 (thanks @palmiak)
63
  - If you run into problems with unknown `Twig_SimpleFilter` or unknown `Twig_Filter` classes, you can use `Timber\Twig_Filter` instead.
64
  - Fixed `Timber::get_posts` so that its default query parameters mirror WordPress's `get_posts` #1812 (thanks @bartvanraaij)
65
  - You can now more easily work with menu locations and filters #1959 #2018 (thanks @gchtr)
3
  Tags: template engine, templates, twig
4
  Requires at least: 4.7.12
5
  Tested up to: 5.2.3
6
+ Stable tag: 1.12.0
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
30
 
31
  = Develop (next release) =
32
 
33
+ **Fixes and improvements**
34
+
35
+ **Changes for Theme Developers**
36
+
37
+ = 1.12.0 =
38
+
39
+ **Fixes and improvements**
40
+ - Fix resizing for images with UTF-8 characters in their filename #2072
41
+ - Added tests to cover RTL languages and special characters in image file names #2072
42
+ - Fixed MenuItem menu recursion #2071 #2083
43
+
44
+ **Changes for Theme Developers**
45
+ - Added new `found_posts` property for `Timber\PostQuery`. Now you can check how many posts were found in a query.
46
+
47
  = 1.11.0 =
48
+
49
  **General Note**
50
  - If you use WPML with Timber, please upgrade to WPML 4.2.8. The WPML team has removed their included Twig version which means no more conflicts!
51
 
74
  - Fixes a bug where the last menu item received incorrect CSS classes #2009 #1974 (thanks @strategio)
75
 
76
  **Changes for Theme Developers**
77
+ - You can use WordPress's behavior of `get_posts` (versus `WP_Query`) via a filter. By default, Timber uses the behaviors of WP_Query in Timber's queries #1989 (thanks @palmiak)
78
  - If you run into problems with unknown `Twig_SimpleFilter` or unknown `Twig_Filter` classes, you can use `Timber\Twig_Filter` instead.
79
  - Fixed `Timber::get_posts` so that its default query parameters mirror WordPress's `get_posts` #1812 (thanks @bartvanraaij)
80
  - You can now more easily work with menu locations and filters #1959 #2018 (thanks @gchtr)
timber-starter-theme/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
  vendor
2
  wp-content
 
1
  vendor
2
  wp-content
3
+ composer.lock
timber-starter-theme/archive.php CHANGED
@@ -21,16 +21,16 @@ $context = Timber::context();
21
  $context['title'] = 'Archive';
22
  if ( is_day() ) {
23
  $context['title'] = 'Archive: ' . get_the_date( 'D M Y' );
24
- } else if ( is_month() ) {
25
  $context['title'] = 'Archive: ' . get_the_date( 'M Y' );
26
- } else if ( is_year() ) {
27
  $context['title'] = 'Archive: ' . get_the_date( 'Y' );
28
- } else if ( is_tag() ) {
29
  $context['title'] = single_tag_title( '', false );
30
- } else if ( is_category() ) {
31
  $context['title'] = single_cat_title( '', false );
32
  array_unshift( $templates, 'archive-' . get_query_var( 'cat' ) . '.twig' );
33
- } else if ( is_post_type_archive() ) {
34
  $context['title'] = post_type_archive_title( '', false );
35
  array_unshift( $templates, 'archive-' . get_post_type() . '.twig' );
36
  }
21
  $context['title'] = 'Archive';
22
  if ( is_day() ) {
23
  $context['title'] = 'Archive: ' . get_the_date( 'D M Y' );
24
+ } elseif ( is_month() ) {
25
  $context['title'] = 'Archive: ' . get_the_date( 'M Y' );
26
+ } elseif ( is_year() ) {
27
  $context['title'] = 'Archive: ' . get_the_date( 'Y' );
28
+ } elseif ( is_tag() ) {
29
  $context['title'] = single_tag_title( '', false );
30
+ } elseif ( is_category() ) {
31
  $context['title'] = single_cat_title( '', false );
32
  array_unshift( $templates, 'archive-' . get_query_var( 'cat' ) . '.twig' );
33
+ } elseif ( is_post_type_archive() ) {
34
  $context['title'] = post_type_archive_title( '', false );
35
  array_unshift( $templates, 'archive-' . get_post_type() . '.twig' );
36
  }
timber-starter-theme/functions.php CHANGED
@@ -11,11 +11,11 @@
11
  /**
12
  * If you are installing Timber as a Composer dependency in your theme, you'll need this block
13
  * to load your dependencies and initialize Timber. If you are using Timber via the WordPress.org
14
- * plug-in, you can safely delete this block.
15
  */
16
  $composer_autoload = __DIR__ . '/vendor/autoload.php';
17
- if ( file_exists($composer_autoload) ) {
18
- require_once( $composer_autoload );
19
  $timber = new Timber\Timber();
20
  }
21
 
@@ -25,13 +25,19 @@ if ( file_exists($composer_autoload) ) {
25
  */
26
  if ( ! class_exists( 'Timber' ) ) {
27
 
28
- add_action( 'admin_notices', function() {
29
- echo '<div class="error"><p>Timber not activated. Make sure you activate the plugin in <a href="' . esc_url( admin_url( 'plugins.php#timber' ) ) . '">' . esc_url( admin_url( 'plugins.php' ) ) . '</a></p></div>';
30
- });
31
-
32
- add_filter('template_include', function( $template ) {
33
- return get_stylesheet_directory() . '/static/no-timber.html';
34
- });
 
 
 
 
 
 
35
  return;
36
  }
37
 
@@ -75,11 +81,11 @@ class StarterSite extends Timber\Site {
75
  * @param string $context context['this'] Being the Twig's {{ this }}.
76
  */
77
  public function add_to_context( $context ) {
78
- $context['foo'] = 'bar';
79
  $context['stuff'] = 'I am a value set in your functions.php file';
80
  $context['notes'] = 'These values are available everytime you call Timber::context();';
81
- $context['menu'] = new Timber\Menu();
82
- $context['site'] = $this;
83
  return $context;
84
  }
85
 
@@ -107,7 +113,8 @@ class StarterSite extends Timber\Site {
107
  * to output valid HTML5.
108
  */
109
  add_theme_support(
110
- 'html5', array(
 
111
  'comment-form',
112
  'comment-list',
113
  'gallery',
@@ -121,7 +128,8 @@ class StarterSite extends Timber\Site {
121
  * See: https://codex.wordpress.org/Post_Formats
122
  */
123
  add_theme_support(
124
- 'post-formats', array(
 
125
  'aside',
126
  'image',
127
  'video',
@@ -149,8 +157,8 @@ class StarterSite extends Timber\Site {
149
  * @param string $twig get extension.
150
  */
151
  public function add_to_twig( $twig ) {
152
- $twig->addExtension( new Twig_Extension_StringLoader() );
153
- $twig->addFilter( new Twig_SimpleFilter( 'myfoo', array( $this, 'myfoo' ) ) );
154
  return $twig;
155
  }
156
 
11
  /**
12
  * If you are installing Timber as a Composer dependency in your theme, you'll need this block
13
  * to load your dependencies and initialize Timber. If you are using Timber via the WordPress.org
14
+ * plug-in, you can safely delete this block.
15
  */
16
  $composer_autoload = __DIR__ . '/vendor/autoload.php';
17
+ if ( file_exists( $composer_autoload ) ) {
18
+ require_once $composer_autoload;
19
  $timber = new Timber\Timber();
20
  }
21
 
25
  */
26
  if ( ! class_exists( 'Timber' ) ) {
27
 
28
+ add_action(
29
+ 'admin_notices',
30
+ function() {
31
+ echo '<div class="error"><p>Timber not activated. Make sure you activate the plugin in <a href="' . esc_url( admin_url( 'plugins.php#timber' ) ) . '">' . esc_url( admin_url( 'plugins.php' ) ) . '</a></p></div>';
32
+ }
33
+ );
34
+
35
+ add_filter(
36
+ 'template_include',
37
+ function( $template ) {
38
+ return get_stylesheet_directory() . '/static/no-timber.html';
39
+ }
40
+ );
41
  return;
42
  }
43
 
81
  * @param string $context context['this'] Being the Twig's {{ this }}.
82
  */
83
  public function add_to_context( $context ) {
84
+ $context['foo'] = 'bar';
85
  $context['stuff'] = 'I am a value set in your functions.php file';
86
  $context['notes'] = 'These values are available everytime you call Timber::context();';
87
+ $context['menu'] = new Timber\Menu();
88
+ $context['site'] = $this;
89
  return $context;
90
  }
91
 
113
  * to output valid HTML5.
114
  */
115
  add_theme_support(
116
+ 'html5',
117
+ array(
118
  'comment-form',
119
  'comment-list',
120
  'gallery',
128
  * See: https://codex.wordpress.org/Post_Formats
129
  */
130
  add_theme_support(
131
+ 'post-formats',
132
+ array(
133
  'aside',
134
  'image',
135
  'video',
157
  * @param string $twig get extension.
158
  */
159
  public function add_to_twig( $twig ) {
160
+ $twig->addExtension( new Twig\Extension\StringLoaderExtension() );
161
+ $twig->addFilter( new Twig\TwigFilter( 'myfoo', array( $this, 'myfoo' ) ) );
162
  return $twig;
163
  }
164
 
timber-starter-theme/index.php CHANGED
@@ -13,10 +13,10 @@
13
  * @since Timber 0.1
14
  */
15
 
16
- $context = Timber::context();
17
  $context['posts'] = new Timber\PostQuery();
18
- $context['foo'] = 'bar';
19
- $templates = array( 'index.twig' );
20
  if ( is_home() ) {
21
  array_unshift( $templates, 'front-page.twig', 'home.twig' );
22
  }
13
  * @since Timber 0.1
14
  */
15
 
16
+ $context = Timber::context();
17
  $context['posts'] = new Timber\PostQuery();
18
+ $context['foo'] = 'bar';
19
+ $templates = array( 'index.twig' );
20
  if ( is_home() ) {
21
  array_unshift( $templates, 'front-page.twig', 'home.twig' );
22
  }
timber-starter-theme/page.php CHANGED
@@ -23,6 +23,6 @@
23
 
24
  $context = Timber::context();
25
 
26
- $timber_post = new Timber\Post();
27
  $context['post'] = $timber_post;
28
  Timber::render( array( 'page-' . $timber_post->post_name . '.twig', 'page.twig' ), $context );
23
 
24
  $context = Timber::context();
25
 
26
+ $timber_post = new Timber\Post();
27
  $context['post'] = $timber_post;
28
  Timber::render( array( 'page-' . $timber_post->post_name . '.twig', 'page.twig' ), $context );
timber-starter-theme/single.php CHANGED
@@ -9,8 +9,8 @@
9
  * @since Timber 0.1
10
  */
11
 
12
- $context = Timber::context();
13
- $timber_post = Timber::query_post();
14
  $context['post'] = $timber_post;
15
 
16
  if ( post_password_required( $timber_post->ID ) ) {
9
  * @since Timber 0.1
10
  */
11
 
12
+ $context = Timber::context();
13
+ $timber_post = Timber::query_post();
14
  $context['post'] = $timber_post;
15
 
16
  if ( post_password_required( $timber_post->ID ) ) {
timber-starter-theme/tests/test-timber-starter-theme.php CHANGED
@@ -30,6 +30,19 @@
30
  $this->assertStringEndsWith('</article>', $str);
31
  }
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  static function _setupStarterTheme(){
34
  $dest = WP_CONTENT_DIR . '/themes/' . basename( dirname( dirname( __FILE__ ) ) );
35
  $src = realpath( __DIR__ . '/../../' . basename( dirname( dirname( __FILE__ ) ) ) );
30
  $this->assertStringEndsWith('</article>', $str);
31
  }
32
 
33
+ /**
34
+ * Helper test to output current twig version
35
+ */
36
+ function testTwigVersion() {
37
+ $str = Timber::compile_string("{{ constant('Twig_Environment::VERSION') }}");
38
+ //error_log('Twig version = '.$str);
39
+ }
40
+
41
+ function testTwigFilter() {
42
+ $str = Timber::compile_string('{{ "foo" | myfoo }}');
43
+ $this->assertEquals('foo bar!', $str);
44
+ }
45
+
46
  static function _setupStarterTheme(){
47
  $dest = WP_CONTENT_DIR . '/themes/' . basename( dirname( dirname( __FILE__ ) ) );
48
  $src = realpath( __DIR__ . '/../../' . basename( dirname( dirname( __FILE__ ) ) ) );
timber-starter-theme/timber-starter-theme/.gitignore DELETED
@@ -1,2 +0,0 @@
1
- vendor
2
- wp-content
 
 
timber-starter-theme/timber-starter-theme/.travis.yml DELETED
@@ -1,22 +0,0 @@
1
- sudo: false
2
-
3
- dist: xenial
4
-
5
- services: mysql
6
-
7
- language: php
8
-
9
- php:
10
- - 5.6.30
11
- - 7.3
12
-
13
- env:
14
- - WP_VERSION=latest WP_MULTISITE=0
15
- - WP_VERSION=latest WP_MULTISITE=1
16
-
17
- before_script:
18
- - bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
19
- - composer install
20
-
21
- script:
22
- - vendor/phpunit/phpunit/phpunit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/404.php DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
- /**
3
- * The template for displaying 404 pages (Not Found)
4
- *
5
- * Methods for TimberHelper can be found in the /functions sub-directory
6
- *
7
- * @package WordPress
8
- * @subpackage Timber
9
- * @since Timber 0.1
10
- */
11
-
12
- $context = Timber::context();
13
- Timber::render( '404.twig', $context );
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/LICENSE DELETED
@@ -1,7 +0,0 @@
1
- Copyright (c) 2012-2013 Jared Novack
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/README.md DELETED
@@ -1,35 +0,0 @@
1
-
2
- # The Timber Starter Theme
3
-
4
- The "_s" for Timber: a dead-simple theme that you can build from. The primary purpose of this theme is to provide a file structure rather than a framework for markup or styles. Configure your Sass, scripts, and task runners however you would like!
5
-
6
- [![Build Status](https://travis-ci.org/timber/starter-theme.svg)](https://travis-ci.org/timber/starter-theme)
7
-
8
- ## Installing the Theme
9
-
10
- Install this theme as you would any other, and be sure the Timber plugin is activated. But hey, let's break it down into some bullets:
11
-
12
- 1. Make sure you have installed the plugin for the [Timber Library](https://wordpress.org/plugins/timber-library/) (and Advanced Custom Fields - they [play quite nicely](https://timber.github.io/docs/guides/acf-cookbook/#nav) together).
13
- 2. Download the zip for this theme (or clone it) and move it to `wp-content/themes` in your WordPress installation.
14
- 3. Rename the folder to something that makes sense for your website (generally no spaces and all lowercase). You could keep the name `timber-starter-theme` but the point of a starter theme is to make it your own!
15
- 4. Activate the theme in Appearance > Themes.
16
- 5. Do your thing! And read [the docs](https://github.com/jarednova/timber/wiki).
17
-
18
- ## What's here?
19
-
20
- `static/` is where you can keep your static front-end scripts, styles, or images. In other words, your Sass files, JS files, fonts, and SVGs would live here.
21
-
22
- `templates/` contains all of your Twig templates. These pretty much correspond 1 to 1 with the PHP files that respond to the WordPress template hierarchy. At the end of each PHP template, you'll notice a `Timber::render()` function whose first parameter is the Twig file where that data (or `$context`) will be used. Just an FYI.
23
-
24
- `bin/` and `tests/` ... basically don't worry about (or remove) these unless you know what they are and want to.
25
-
26
- ## Other Resources
27
-
28
- The [main Timber Wiki](https://github.com/jarednova/timber/wiki) is super great, so reference those often. Also, check out these articles and projects for more info:
29
-
30
- * [This branch](https://github.com/laras126/timber-starter-theme/tree/tackle-box) of the starter theme has some more example code with ACF and a slightly different set up.
31
- * [Twig for Timber Cheatsheet](http://notlaura.com/the-twig-for-timber-cheatsheet/)
32
- * [Timber and Twig Reignited My Love for WordPress](https://css-tricks.com/timber-and-twig-reignited-my-love-for-wordpress/) on CSS-Tricks
33
- * [A real live Timber theme](https://github.com/laras126/yuling-theme).
34
- * [Timber Video Tutorials](http://timber.github.io/timber/#video-tutorials) and [an incomplete set of screencasts](https://www.youtube.com/playlist?list=PLuIlodXmVQ6pkqWyR6mtQ5gQZ6BrnuFx-) for building a Timber theme from scratch.
35
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/archive.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
- /**
3
- * The template for displaying Archive pages.
4
- *
5
- * Used to display archive-type pages if nothing more specific matches a query.
6
- * For example, puts together date-based pages if no date.php file exists.
7
- *
8
- * Learn more: http://codex.wordpress.org/Template_Hierarchy
9
- *
10
- * Methods for TimberHelper can be found in the /lib sub-directory
11
- *
12
- * @package WordPress
13
- * @subpackage Timber
14
- * @since Timber 0.2
15
- */
16
-
17
- $templates = array( 'archive.twig', 'index.twig' );
18
-
19
- $context = Timber::context();
20
-
21
- $context['title'] = 'Archive';
22
- if ( is_day() ) {
23
- $context['title'] = 'Archive: ' . get_the_date( 'D M Y' );
24
- } else if ( is_month() ) {
25
- $context['title'] = 'Archive: ' . get_the_date( 'M Y' );
26
- } else if ( is_year() ) {
27
- $context['title'] = 'Archive: ' . get_the_date( 'Y' );
28
- } else if ( is_tag() ) {
29
- $context['title'] = single_tag_title( '', false );
30
- } else if ( is_category() ) {
31
- $context['title'] = single_cat_title( '', false );
32
- array_unshift( $templates, 'archive-' . get_query_var( 'cat' ) . '.twig' );
33
- } else if ( is_post_type_archive() ) {
34
- $context['title'] = post_type_archive_title( '', false );
35
- array_unshift( $templates, 'archive-' . get_post_type() . '.twig' );
36
- }
37
-
38
- $context['posts'] = new Timber\PostQuery();
39
-
40
- Timber::render( $templates, $context );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/author.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- /**
3
- * The template for displaying Author Archive pages
4
- *
5
- * Methods for TimberHelper can be found in the /lib sub-directory
6
- *
7
- * @package WordPress
8
- * @subpackage Timber
9
- * @since Timber 0.1
10
- */
11
-
12
- global $wp_query;
13
-
14
- $context = Timber::context();
15
- $context['posts'] = new Timber\PostQuery();
16
- if ( isset( $wp_query->query_vars['author'] ) ) {
17
- $author = new Timber\User( $wp_query->query_vars['author'] );
18
- $context['author'] = $author;
19
- $context['title'] = 'Author Archives: ' . $author->name();
20
- }
21
- Timber::render( array( 'author.twig', 'archive.twig' ), $context );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/footer.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- /**
3
- * Third party plugins that hijack the theme will call wp_footer() to get the footer template.
4
- * We use this to end our output buffer (started in header.php) and render into the view/page-plugin.twig template.
5
- *
6
- * If you're not using a plugin that requries this behavior (ones that do include Events Calendar Pro and
7
- * WooCommerce) you can delete this file and header.php
8
- *
9
- * @package WordPress
10
- * @subpackage Timber
11
- * @since Timber 0.1
12
- */
13
-
14
- $timberContext = $GLOBALS['timberContext']; // @codingStandardsIgnoreFile
15
- if ( ! isset( $timberContext ) ) {
16
- throw new \Exception( 'Timber context not set in footer.' );
17
- }
18
- $timberContext['content'] = ob_get_contents();
19
- ob_end_clean();
20
- $templates = array( 'page-plugin.twig' );
21
- Timber::render( $templates, $timberContext );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/functions.php DELETED
@@ -1,159 +0,0 @@
1
- <?php
2
- /**
3
- * Timber starter-theme
4
- * https://github.com/timber/starter-theme
5
- *
6
- * @package WordPress
7
- * @subpackage Timber
8
- * @since Timber 0.1
9
- */
10
-
11
- /**
12
- * If you are installing Timber as a Composer dependency in your theme, you'll need this block
13
- * to load your dependencies and initialize Timber. If you are using Timber via the WordPress.org
14
- * plug-in, you can safely delete this block.
15
- */
16
- $composer_autoload = __DIR__ . '/vendor/autoload.php';
17
- if ( file_exists($composer_autoload) ) {
18
- require_once( $composer_autoload );
19
- $timber = new Timber\Timber();
20
- }
21
-
22
- /**
23
- * This ensures that Timber is loaded and available as a PHP class.
24
- * If not, it gives an error message to help direct developers on where to activate
25
- */
26
- if ( ! class_exists( 'Timber' ) ) {
27
-
28
- add_action( 'admin_notices', function() {
29
- echo '<div class="error"><p>Timber not activated. Make sure you activate the plugin in <a href="' . esc_url( admin_url( 'plugins.php#timber' ) ) . '">' . esc_url( admin_url( 'plugins.php' ) ) . '</a></p></div>';
30
- });
31
-
32
- add_filter('template_include', function( $template ) {
33
- return get_stylesheet_directory() . '/static/no-timber.html';
34
- });
35
- return;
36
- }
37
-
38
- /**
39
- * Sets the directories (inside your theme) to find .twig files
40
- */
41
- Timber::$dirname = array( 'templates', 'views' );
42
-
43
- /**
44
- * By default, Timber does NOT autoescape values. Want to enable Twig's autoescape?
45
- * No prob! Just set this value to true
46
- */
47
- Timber::$autoescape = false;
48
-
49
-
50
- /**
51
- * We're going to configure our theme inside of a subclass of Timber\Site
52
- * You can move this to its own file and include here via php's include("MySite.php")
53
- */
54
- class StarterSite extends Timber\Site {
55
- /** Add timber support. */
56
- public function __construct() {
57
- add_action( 'after_setup_theme', array( $this, 'theme_supports' ) );
58
- add_filter( 'timber/context', array( $this, 'add_to_context' ) );
59
- add_filter( 'timber/twig', array( $this, 'add_to_twig' ) );
60
- add_action( 'init', array( $this, 'register_post_types' ) );
61
- add_action( 'init', array( $this, 'register_taxonomies' ) );
62
- parent::__construct();
63
- }
64
- /** This is where you can register custom post types. */
65
- public function register_post_types() {
66
-
67
- }
68
- /** This is where you can register custom taxonomies. */
69
- public function register_taxonomies() {
70
-
71
- }
72
-
73
- /** This is where you add some context
74
- *
75
- * @param string $context context['this'] Being the Twig's {{ this }}.
76
- */
77
- public function add_to_context( $context ) {
78
- $context['foo'] = 'bar';
79
- $context['stuff'] = 'I am a value set in your functions.php file';
80
- $context['notes'] = 'These values are available everytime you call Timber::context();';
81
- $context['menu'] = new Timber\Menu();
82
- $context['site'] = $this;
83
- return $context;
84
- }
85
-
86
- public function theme_supports() {
87
- // Add default posts and comments RSS feed links to head.
88
- add_theme_support( 'automatic-feed-links' );
89
-
90
- /*
91
- * Let WordPress manage the document title.
92
- * By adding theme support, we declare that this theme does not use a
93
- * hard-coded <title> tag in the document head, and expect WordPress to
94
- * provide it for us.
95
- */
96
- add_theme_support( 'title-tag' );
97
-
98
- /*
99
- * Enable support for Post Thumbnails on posts and pages.
100
- *
101
- * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
102
- */
103
- add_theme_support( 'post-thumbnails' );
104
-
105
- /*
106
- * Switch default core markup for search form, comment form, and comments
107
- * to output valid HTML5.
108
- */
109
- add_theme_support(
110
- 'html5', array(
111
- 'comment-form',
112
- 'comment-list',
113
- 'gallery',
114
- 'caption',
115
- )
116
- );
117
-
118
- /*
119
- * Enable support for Post Formats.
120
- *
121
- * See: https://codex.wordpress.org/Post_Formats
122
- */
123
- add_theme_support(
124
- 'post-formats', array(
125
- 'aside',
126
- 'image',
127
- 'video',
128
- 'quote',
129
- 'link',
130
- 'gallery',
131
- 'audio',
132
- )
133
- );
134
-
135
- add_theme_support( 'menus' );
136
- }
137
-
138
- /** This Would return 'foo bar!'.
139
- *
140
- * @param string $text being 'foo', then returned 'foo bar!'.
141
- */
142
- public function myfoo( $text ) {
143
- $text .= ' bar!';
144
- return $text;
145
- }
146
-
147
- /** This is where you can add your own functions to twig.
148
- *
149
- * @param string $twig get extension.
150
- */
151
- public function add_to_twig( $twig ) {
152
- $twig->addExtension( new Twig_Extension_StringLoader() );
153
- $twig->addFilter( new Twig_SimpleFilter( 'myfoo', array( $this, 'myfoo' ) ) );
154
- return $twig;
155
- }
156
-
157
- }
158
-
159
- new StarterSite();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/header.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
- /**
3
- * Third party plugins that hijack the theme will call wp_head() to get the header template.
4
- * We use this to start our output buffer and render into the view/page-plugin.twig template in footer.php
5
- *
6
- * If you're not using a plugin that requries this behavior (ones that do include Events Calendar Pro and
7
- * WooCommerce) you can delete this file and footer.php
8
- *
9
- * @package WordPress
10
- * @subpackage Timber
11
- * @since Timber 0.1
12
- */
13
-
14
- $GLOBALS['timberContext'] = Timber::context();
15
- ob_start();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/humans.txt DELETED
@@ -1,10 +0,0 @@
1
- ## Team
2
-
3
- Your name or company
4
- http://yoursite.org
5
- @you_on_twitter
6
-
7
-
8
- ## Site
9
-
10
- Software: Built with [Timber](http://upstatement.com/timber) by Upstatement
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/index.php DELETED
@@ -1,23 +0,0 @@
1
- <?php
2
- /**
3
- * The main template file
4
- * This is the most generic template file in a WordPress theme
5
- * and one of the two required files for a theme (the other being style.css).
6
- * It is used to display a page when nothing more specific matches a query.
7
- * E.g., it puts together the home page when no home.php file exists
8
- *
9
- * Methods for TimberHelper can be found in the /lib sub-directory
10
- *
11
- * @package WordPress
12
- * @subpackage Timber
13
- * @since Timber 0.1
14
- */
15
-
16
- $context = Timber::context();
17
- $context['posts'] = new Timber\PostQuery();
18
- $context['foo'] = 'bar';
19
- $templates = array( 'index.twig' );
20
- if ( is_home() ) {
21
- array_unshift( $templates, 'front-page.twig', 'home.twig' );
22
- }
23
- Timber::render( $templates, $context );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/page.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
- /**
3
- * The template for displaying all pages.
4
- *
5
- * This is the template that displays all pages by default.
6
- * Please note that this is the WordPress construct of pages
7
- * and that other 'pages' on your WordPress site will use a
8
- * different template.
9
- *
10
- * To generate specific templates for your pages you can use:
11
- * /mytheme/templates/page-mypage.twig
12
- * (which will still route through this PHP file)
13
- * OR
14
- * /mytheme/page-mypage.php
15
- * (in which case you'll want to duplicate this file and save to the above path)
16
- *
17
- * Methods for TimberHelper can be found in the /lib sub-directory
18
- *
19
- * @package WordPress
20
- * @subpackage Timber
21
- * @since Timber 0.1
22
- */
23
-
24
- $context = Timber::context();
25
-
26
- $timber_post = new Timber\Post();
27
- $context['post'] = $timber_post;
28
- Timber::render( array( 'page-' . $timber_post->post_name . '.twig', 'page.twig' ), $context );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/phpunit.xml DELETED
@@ -1,20 +0,0 @@
1
- <phpunit
2
- bootstrap="tests/bootstrap.php"
3
- backupGlobals="false"
4
- colors="true"
5
- convertErrorsToExceptions="true"
6
- convertNoticesToExceptions="true"
7
- convertWarningsToExceptions="true"
8
- >
9
- <testsuites>
10
- <testsuite>
11
- <directory prefix="test-" suffix=".php">./tests/</directory>
12
- </testsuite>
13
- <!-- The suite below HAS to be last to run,
14
- as it includes a test that sets some const and would contaminate
15
- the other tests as well. -->
16
- <testsuite>
17
- <directory prefix="testX-" suffix=".php">./tests/</directory>
18
- </testsuite>
19
- </testsuites>
20
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/screenshot.png DELETED
Binary file
timber-starter-theme/timber-starter-theme/search.php DELETED
@@ -1,18 +0,0 @@
1
- <?php
2
- /**
3
- * Search results page
4
- *
5
- * Methods for TimberHelper can be found in the /lib sub-directory
6
- *
7
- * @package WordPress
8
- * @subpackage Timber
9
- * @since Timber 0.1
10
- */
11
-
12
- $templates = array( 'search.twig', 'archive.twig', 'index.twig' );
13
-
14
- $context = Timber::context();
15
- $context['title'] = 'Search results for ' . get_search_query();
16
- $context['posts'] = new Timber\PostQuery();
17
-
18
- Timber::render( $templates, $context );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/sidebar.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- /**
3
- * The Template for the sidebar containing the main widget area
4
- *
5
- * @package WordPress
6
- * @subpackage Timber
7
- */
8
-
9
- Timber::render( array( 'sidebar.twig' ), $data );
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/single.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
- /**
3
- * The Template for displaying all single posts
4
- *
5
- * Methods for TimberHelper can be found in the /lib sub-directory
6
- *
7
- * @package WordPress
8
- * @subpackage Timber
9
- * @since Timber 0.1
10
- */
11
-
12
- $context = Timber::context();
13
- $timber_post = Timber::query_post();
14
- $context['post'] = $timber_post;
15
-
16
- if ( post_password_required( $timber_post->ID ) ) {
17
- Timber::render( 'single-password.twig', $context );
18
- } else {
19
- Timber::render( array( 'single-' . $timber_post->ID . '.twig', 'single-' . $timber_post->post_type . '.twig', 'single-' . $timber_post->slug . '.twig', 'single.twig' ), $context );
20
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/static/no-timber.html DELETED
@@ -1,10 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <title>Timber not active</title>
5
- </head>
6
-
7
- <body>
8
- <p>Timber not activated</p>
9
- </body>
10
- </html>
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/static/site.js DELETED
@@ -1,5 +0,0 @@
1
- jQuery( document ).ready( function( $ ) {
2
-
3
- // Your JavaScript goes here
4
-
5
- });
 
 
 
 
 
timber-starter-theme/timber-starter-theme/style.css DELETED
@@ -1,5 +0,0 @@
1
- /*
2
- * Theme Name: My Timber Starter Theme
3
- * Description: Starter Theme to use with Timber
4
- * Author: Upstatement and YOU!
5
- */
 
 
 
 
 
timber-starter-theme/timber-starter-theme/templates/404.twig DELETED
@@ -1,5 +0,0 @@
1
- {% extends "base.twig" %}
2
-
3
- {% block content %}
4
- Sorry, we couldn't find what you're looking for.
5
- {% endblock %}
 
 
 
 
 
timber-starter-theme/timber-starter-theme/templates/archive.twig DELETED
@@ -1,9 +0,0 @@
1
- {# This file demonstrates using most of the index.twig template and modifying
2
- just a small part. See `search.twig` for an example of another approach #}
3
-
4
- {% extends "index.twig" %}
5
-
6
- {% block content %}
7
- <h3>This is my archive</h3>
8
- {{ parent() }}
9
- {% endblock %}
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/templates/author.twig DELETED
@@ -1,7 +0,0 @@
1
- {% extends "base.twig" %}
2
-
3
- {% block content %}
4
- {% for post in posts %}
5
- {% include ["tease-"~post.post_type~".twig", "tease.twig"] %}
6
- {% endfor %}
7
- {% endblock %}
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/templates/base.twig DELETED
@@ -1,45 +0,0 @@
1
- {% block html_head_container %}
2
-
3
- {% include 'html-header.twig' %}
4
- {% block head %}
5
- {% endblock %}
6
- </head>
7
- {% endblock %}
8
-
9
- <body class="{{body_class}}" data-template="base.twig">
10
- <a class="skip-link screen-reader-text" href="#content">{{ _e( 'Skip to content') }}</a>
11
- <header class="header" >
12
- {% block header %}
13
- <div class="wrapper">
14
- <h1 class="hdr-logo" role="banner">
15
- <a class="hdr-logo-link" href="{{site.url}}" rel="home">{{site.name}}</a>
16
- </h1>
17
- <nav id="nav-main" class="nav-main" role="navigation">
18
- {% include "menu.twig" with {'items': menu.get_items} %}
19
- </nav><!-- #nav -->
20
- </div>
21
- {% endblock %}
22
- </header>
23
-
24
- <section id="content" role="main" class="content-wrapper">
25
- {% if title %}<h1>{{title}}</h1>{% endif %}
26
- <div class="wrapper {{sidebar_class}}">
27
- {% block content %}
28
- Sorry, no content
29
- {% endblock %}
30
- </div>
31
- {% if sidebar %}
32
- <aside class="layout-sidebar">
33
- {{sidebar}}
34
- </aside>
35
- {% endif %}
36
- </section>
37
-
38
- {% block footer %}
39
- <footer id="footer">
40
- {% include 'footer.twig' %}
41
- </footer>
42
- {{ function('wp_footer') }}
43
- {% endblock %}
44
- </body>
45
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/templates/comment-form.twig DELETED
@@ -1,28 +0,0 @@
1
- <div class="comment-form">
2
- <h3>Add comment</h3>
3
- <form class="comment-form" method="post" action="{{ site.site_url~'/wp-comments-post.php' }}">
4
- {% if user %}
5
- <input type="hidden" name="email" value="{{ user.email }}">
6
- <input type="hidden" name="author" value="{{ user.name }}">
7
- <input type="hidden" name="url" value="{{ user.link }}">
8
- {% else %}
9
- <label>Email<br>
10
- <input required name="email" type="email" id="email">
11
- </label>
12
- <label>Name<br>
13
- <input required name="author" type="text">
14
- </label>
15
- <label>Website<br>
16
- <input name="url" type="url">
17
- </label>
18
- {% endif %}
19
- <label>Comment<br>
20
- <textarea placeholder="Leave a comment..." name="comment" cols="60" rows="3"></textarea>
21
- </label>
22
- <input name="comment_post_ID" value="{{ post.id }}" type="hidden">
23
- <input name="comment_parent" value="{{ comment.ID|default('0') }}" type="hidden">
24
- <button type="submit" name="Submit" class="btn">Send</button>
25
- <button type="reset">Cancel</button>
26
- <p>Your comment will be revised by the site if needed.</p>
27
- </form>
28
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/templates/comment.twig DELETED
@@ -1,21 +0,0 @@
1
- <div class="blog-comment {{comment.comment_type}}" id="blog-comment-{{comment.ID}}">
2
- <h5 class="comment-author">{{comment.author.name}} says</h5>
3
- <div class="comment-content">{{comment.comment_content|wpautop}}</div>
4
-
5
- <section class="comment-box">
6
-
7
- <!-- comment form -->
8
- {% include "comment-form.twig" %}
9
-
10
- <!-- child comments -->
11
- {% if post.comments %}
12
- <h4> replies </h4>
13
- <div class="comments">
14
- {% for cmt in comment.children %}
15
- {% include "comment.twig" with {comment:cmt} %}
16
- {% endfor %}
17
- </div>
18
- {% endif %}
19
-
20
- </section>
21
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/templates/footer.twig DELETED
@@ -1 +0,0 @@
1
- Copyright {{"now"|date('Y')}}
 
timber-starter-theme/timber-starter-theme/templates/html-header.twig DELETED
@@ -1,15 +0,0 @@
1
- <!doctype html>
2
- <!--[if lt IE 9]><html class="no-js no-svg ie lt-ie9 lt-ie8 lt-ie7" {{ site.language_attributes }}> <![endif]-->
3
- <!--[if IE 9]><html class="no-js no-svg ie ie9 lt-ie9 lt-ie8" {{ site.language_attributes }}> <![endif]-->
4
- <!--[if gt IE 9]><!--><html class="no-js no-svg" {{ site.language_attributes }}> <!--<![endif]-->
5
- <head>
6
- <meta charset="{{ site.charset }}" />
7
- <meta name="description" content="{{ site.description }}">
8
- <link rel="stylesheet" href="{{ site.theme.link }}/style.css" type="text/css" media="screen" />
9
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
10
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
11
- <meta name="viewport" content="width=device-width, initial-scale=1">
12
- <link rel="author" href="{{ site.theme.link }}/humans.txt" />
13
- <link rel="pingback" href="{{ site.pingback_url }}" />
14
- <link rel="profile" href="http://gmpg.org/xfn/11">
15
- {{function('wp_head')}}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/templates/index.twig DELETED
@@ -1,11 +0,0 @@
1
- {% extends "base.twig" %}
2
-
3
- {% block content %}
4
- <h2>{{ foo }}</h2>
5
- <p>{{ qux }}</p>
6
- {% for post in posts %}
7
- {% include ['tease-'~post.post_type~'.twig', 'tease.twig'] %}
8
- {% endfor %}
9
-
10
- {% include 'partial/pagination.twig' with { pagination: posts.pagination({show_all: false, mid_size: 3, end_size: 2}) } %}
11
- {% endblock %}
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/templates/menu.twig DELETED
@@ -1,10 +0,0 @@
1
- {% if menu %}
2
- <ul>
3
- {% for item in items %}
4
- <li class="{{ item.classes | join(' ') }}">
5
- <a target="{{ item.target }}" href="{{ item.link }}">{{ item.title }}</a>
6
- {% include "menu.twig" with {'items': item.children} %}
7
- </li>
8
- {% endfor %}
9
- </ul>
10
- {% endif %}
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/templates/page-plugin.twig DELETED
@@ -1,7 +0,0 @@
1
- {% extends "base.twig" %}
2
-
3
- {% block content %}
4
- <div class="container content-wrapper">
5
- {{content}}
6
- </div><!-- /content-wrapper -->
7
- {% endblock %}
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/templates/page.twig DELETED
@@ -1,14 +0,0 @@
1
- {% extends "base.twig" %}
2
-
3
- {% block content %}
4
- <div class="content-wrapper">
5
- <article class="post-type-{{post.post_type}}" id="post-{{post.ID}}">
6
- <section class="article-content">
7
- <h1 class="article-h1">{{post.title}}</h1>
8
- <div class="article-body">
9
- {{post.content}}
10
- </div>
11
- </section>
12
- </article>
13
- </div><!-- /content-wrapper -->
14
- {% endblock %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/templates/partial/pagination.twig DELETED
@@ -1,64 +0,0 @@
1
- {% if posts.pagination.pages is not empty %}
2
- <nav class="pagination-block">
3
- <ul class="pagination">
4
-
5
- {# First #}
6
- {% if pagination.pages|first and pagination.pages|first.current != true %}
7
- <li class="first btn">
8
- <a href="{{ pagination.pages|first.link }}">First</a>
9
- </li>
10
- {% else %}
11
- <li class="first btn disabled">
12
- <button disabled>First</button>
13
- </li>
14
- {% endif %}
15
-
16
- {# Previous #}
17
- {% if pagination.prev %}
18
- <li class="prev btn">
19
- <a href="{{ pagination.prev.link }}">Previous</a>
20
- </li>
21
- {% else %}
22
- <li class="prev btn disabled">
23
- <button disabled>Previous</button>
24
- </li>
25
- {% endif %}
26
-
27
- {# Pages #}
28
- {% for page in pagination.pages %}
29
- {% if page.link %}
30
- <li>
31
- <a href="{{ page.link }}" class="{{ page.class }}">{{ page.title }}</a>
32
- </li>
33
- {% else %}
34
- <li class="current">
35
- <span class="{{ page.class }}">{{ page.title }}</span>
36
- </li>
37
- {% endif %}
38
- {% endfor %}
39
-
40
- {# Next #}
41
- {% if pagination.next %}
42
- <li class="next btn">
43
- <a href="{{ pagination.next.link }}">Next</a>
44
- </li>
45
- {% else %}
46
- <li class="next btn disabled">
47
- <button disabled>Next</button>
48
- </li>
49
- {% endif %}
50
-
51
- {# Last #}
52
- {% if pagination.pages|last and pagination.pages|last.current != true %}
53
- <li class="last btn">
54
- <a href="{{ pagination.pages|last.link }}">Last</a>
55
- </li>
56
- {% else %}
57
- <li class="last btn disabled">
58
- <button disabled>Last</button>
59
- </li>
60
- {% endif %}
61
-
62
- </ul>
63
- </nav>
64
- {% endif %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/templates/search.twig DELETED
@@ -1,13 +0,0 @@
1
- {# see `archive.twig` for an alternative strategy of extending templates #}
2
- {% extends "base.twig" %}
3
-
4
- {% block content %}
5
- {# see `base.twig:27` for where this block's content will be inserted #}
6
- <div class="content-wrapper">
7
- {% for post in posts %}
8
- {% include ['tease-'~post.post_type~'.twig', 'tease.twig'] %}
9
- {% endfor %}
10
-
11
- {% include 'partial/pagination.twig' with { pagination: posts.pagination({show_all: false, mid_size: 3, end_size: 2}) } %}
12
- </div>
13
- {% endblock %}
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/templates/sidebar.twig DELETED
@@ -1 +0,0 @@
1
- Sidebar in Timber. Add HTML to your hearts content.
 
timber-starter-theme/timber-starter-theme/templates/single-password.twig DELETED
@@ -1,9 +0,0 @@
1
- {% extends "base.twig" %}
2
-
3
- {% block content %}
4
- <form class="password-form" action="{{site.site_url}}/wp-login.php?action=postpass" method="post">
5
- <label for="pwbox-{{post.ID}}">Password:</label>
6
- <input class="password-box" name="post_password" id="pwbox-{{post.ID}}" type="password" placeholder="Password" size="20" maxlength="20" />
7
- <input class="password-btn" type="submit" name="Submit" value="Submit" />
8
- </form>
9
- {% endblock %}
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/templates/single.twig DELETED
@@ -1,39 +0,0 @@
1
- {% extends "base.twig" %}
2
-
3
- {% block content %}
4
- <div class="content-wrapper">
5
- <article class="post-type-{{ post.post_type }}" id="post-{{ post.ID }}">
6
- <img src="{{ post.thumbnail.src|resize(1200, 300) }}">
7
- <section class="article-content">
8
- <h1 class="article-h1">{{ post.title }}</h1>
9
- <a href="{{ post.link }}">{{ _e('edit') }}</a>
10
- <p class="blog-author">
11
- <span>By</span><a href="{{post.author.path}}"> {{ post.author.name }} </a><span>&bull;</span> {{ post.date }}
12
- </p>
13
- <div class="article-body">
14
- {{post.content}}
15
- </div>
16
- </section>
17
-
18
- <!-- comment box -->
19
- <section class="comment-box">
20
- <!-- comments -->
21
- <div class="comments">
22
- {% if post.comments %}
23
- <h3> comments </h3>
24
- {% for cmt in post.comments %}
25
- {% include "comment.twig" with {comment:cmt} %}
26
- {% endfor %}
27
- {% endif %}
28
- </div>
29
-
30
- {% if post.comment_status == "closed" %}
31
- <p> comments for this post are closed </p>
32
- {% else %}
33
- <!-- comment form -->
34
- {% include "comment-form.twig" %}
35
- {% endif %}
36
- </section>
37
- </article>
38
- </div><!-- /content-wrapper -->
39
- {% endblock %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/templates/tease-post.twig DELETED
@@ -1,9 +0,0 @@
1
- {% extends "tease.twig" %}
2
-
3
- {% block content %}
4
- <h2 class="h2"><a href="{{post.link}}">{{post.title}}</a></h2>
5
- <p>{{post.preview.length(25)}}</p>
6
- {% if post.thumbnail.src %}
7
- <img src="{{post.thumbnail.src}}" />
8
- {% endif %}
9
- {% endblock %}
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/templates/tease.twig DELETED
@@ -1,9 +0,0 @@
1
- <article class="tease tease-{{post.post_type}}" id="tease-{{post.ID}}">
2
- {% block content %}
3
- <h2 class="h2"><a href="{{post.link}}">{{post.title}}</a></h2>
4
- <p>{{post.preview}}</p>
5
- {% if post.get_thumbnail %}
6
- <img src="{{post.thumbnail.src}}" />
7
- {% endif %}
8
- {% endblock %}
9
- </article>
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/tests/bootstrap.php DELETED
@@ -1,22 +0,0 @@
1
- <?php
2
-
3
- $_tests_dir = getenv('WP_TESTS_DIR');
4
- if ( !$_tests_dir ) $_tests_dir = '/tmp/wordpress-tests-lib';
5
-
6
- require_once $_tests_dir . '/includes/functions.php';
7
-
8
- function _manually_load_plugin() {
9
- $plugins_dir = dirname( __FILE__ ).'/../../../plugins';
10
- $timber = $plugins_dir.'/timber/timber.php';
11
- if ( file_exists($timber) ) {
12
- require_once($timber);
13
- } else {
14
- $timber_library = $plugins_dir.'/timber-library/timber.php';
15
- if ( file_exists($timber_library) ) {
16
- require_once($timber_library);
17
- }
18
- }
19
- }
20
-
21
- tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
22
- require $_tests_dir . '/includes/bootstrap.php';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/timber-starter-theme/tests/test-timber-starter-theme.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
-
3
- class TestTimberStarterTheme extends WP_UnitTestCase {
4
-
5
- function setUp() {
6
- self::_setupStarterTheme();
7
- switch_theme( basename( dirname( dirname( __FILE__ ) ) ) );
8
- require_once(__DIR__.'/../functions.php');
9
- }
10
-
11
- function tearDown() {
12
- switch_theme('twentythirteen');
13
- }
14
-
15
- function testTimberExists() {
16
- $context = Timber::context();
17
- $this->assertTrue(is_array($context));
18
- }
19
-
20
- function testFunctionsPHP() {
21
- $context = Timber::context();
22
- $this->assertEquals('StarterSite', get_class($context['site']));
23
- $this->assertTrue(current_theme_supports('post-thumbnails'));
24
- $this->assertEquals('bar', $context['foo']);
25
- }
26
-
27
- function testLoading() {
28
- $str = Timber::compile('tease.twig');
29
- $this->assertStringStartsWith('<article class="tease tease-" id="tease-">', $str);
30
- $this->assertStringEndsWith('</article>', $str);
31
- }
32
-
33
- static function _setupStarterTheme(){
34
- $dest = WP_CONTENT_DIR . '/themes/' . basename( dirname( dirname( __FILE__ ) ) );
35
- $src = realpath( __DIR__ . '/../../' . basename( dirname( dirname( __FILE__ ) ) ) );
36
- if ( is_dir($src) && !file_exists($dest) ) {
37
- symlink($src, $dest);
38
- }
39
- }
40
-
41
-
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Timber
4
  Description: The WordPress Timber Library allows you to write themes using the power of Twig templates.
5
  Plugin URI: http://timber.upstatement.com
6
  Author: Jared Novack + Upstatement
7
- Version: 1.11.0
8
  Author URI: http://upstatement.com/
9
  */
10
  // we look for Composer files first in the plugins dir.
4
  Description: The WordPress Timber Library allows you to write themes using the power of Twig templates.
5
  Plugin URI: http://timber.upstatement.com
6
  Author: Jared Novack + Upstatement
7
+ Version: 1.12.0
8
  Author URI: http://upstatement.com/
9
  */
10
  // we look for Composer files first in the plugins dir.
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit6567439c14f5705c1376d806b5d78dc2::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitccb9f2abd58411029afebcc31b227257::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -152,6 +152,7 @@ return array(
152
  'Timber\\Menu' => $baseDir . '/lib/Menu.php',
153
  'Timber\\MenuItem' => $baseDir . '/lib/MenuItem.php',
154
  'Timber\\Pagination' => $baseDir . '/lib/Pagination.php',
 
155
  'Timber\\Post' => $baseDir . '/lib/Post.php',
156
  'Timber\\PostCollection' => $baseDir . '/lib/PostCollection.php',
157
  'Timber\\PostGetter' => $baseDir . '/lib/PostGetter.php',
152
  'Timber\\Menu' => $baseDir . '/lib/Menu.php',
153
  'Timber\\MenuItem' => $baseDir . '/lib/MenuItem.php',
154
  'Timber\\Pagination' => $baseDir . '/lib/Pagination.php',
155
+ 'Timber\\PathHelper' => $baseDir . '/lib/PathHelper.php',
156
  'Timber\\Post' => $baseDir . '/lib/Post.php',
157
  'Timber\\PostCollection' => $baseDir . '/lib/PostCollection.php',
158
  'Timber\\PostGetter' => $baseDir . '/lib/PostGetter.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit6567439c14f5705c1376d806b5d78dc2
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit6567439c14f5705c1376d806b5d78dc2
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit6567439c14f5705c1376d806b5d78dc2', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit6567439c14f5705c1376d806b5d78dc2', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit6567439c14f5705c1376d806b5d78dc2::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
@@ -48,19 +48,19 @@ class ComposerAutoloaderInit6567439c14f5705c1376d806b5d78dc2
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
- $includeFiles = Composer\Autoload\ComposerStaticInit6567439c14f5705c1376d806b5d78dc2::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
- composerRequire6567439c14f5705c1376d806b5d78dc2($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
- function composerRequire6567439c14f5705c1376d806b5d78dc2($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitccb9f2abd58411029afebcc31b227257
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitccb9f2abd58411029afebcc31b227257', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitccb9f2abd58411029afebcc31b227257', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInitccb9f2abd58411029afebcc31b227257::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
+ $includeFiles = Composer\Autoload\ComposerStaticInitccb9f2abd58411029afebcc31b227257::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
+ composerRequireccb9f2abd58411029afebcc31b227257($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
+ function composerRequireccb9f2abd58411029afebcc31b227257($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit6567439c14f5705c1376d806b5d78dc2
8
  {
9
  public static $files = array (
10
  '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
@@ -213,6 +213,7 @@ class ComposerStaticInit6567439c14f5705c1376d806b5d78dc2
213
  'Timber\\Menu' => __DIR__ . '/../..' . '/lib/Menu.php',
214
  'Timber\\MenuItem' => __DIR__ . '/../..' . '/lib/MenuItem.php',
215
  'Timber\\Pagination' => __DIR__ . '/../..' . '/lib/Pagination.php',
 
216
  'Timber\\Post' => __DIR__ . '/../..' . '/lib/Post.php',
217
  'Timber\\PostCollection' => __DIR__ . '/../..' . '/lib/PostCollection.php',
218
  'Timber\\PostGetter' => __DIR__ . '/../..' . '/lib/PostGetter.php',
@@ -615,11 +616,11 @@ class ComposerStaticInit6567439c14f5705c1376d806b5d78dc2
615
  public static function getInitializer(ClassLoader $loader)
616
  {
617
  return \Closure::bind(function () use ($loader) {
618
- $loader->prefixLengthsPsr4 = ComposerStaticInit6567439c14f5705c1376d806b5d78dc2::$prefixLengthsPsr4;
619
- $loader->prefixDirsPsr4 = ComposerStaticInit6567439c14f5705c1376d806b5d78dc2::$prefixDirsPsr4;
620
- $loader->fallbackDirsPsr4 = ComposerStaticInit6567439c14f5705c1376d806b5d78dc2::$fallbackDirsPsr4;
621
- $loader->prefixesPsr0 = ComposerStaticInit6567439c14f5705c1376d806b5d78dc2::$prefixesPsr0;
622
- $loader->classMap = ComposerStaticInit6567439c14f5705c1376d806b5d78dc2::$classMap;
623
 
624
  }, null, ClassLoader::class);
625
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitccb9f2abd58411029afebcc31b227257
8
  {
9
  public static $files = array (
10
  '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
213
  'Timber\\Menu' => __DIR__ . '/../..' . '/lib/Menu.php',
214
  'Timber\\MenuItem' => __DIR__ . '/../..' . '/lib/MenuItem.php',
215
  'Timber\\Pagination' => __DIR__ . '/../..' . '/lib/Pagination.php',
216
+ 'Timber\\PathHelper' => __DIR__ . '/../..' . '/lib/PathHelper.php',
217
  'Timber\\Post' => __DIR__ . '/../..' . '/lib/Post.php',
218
  'Timber\\PostCollection' => __DIR__ . '/../..' . '/lib/PostCollection.php',
219
  'Timber\\PostGetter' => __DIR__ . '/../..' . '/lib/PostGetter.php',
616
  public static function getInitializer(ClassLoader $loader)
617
  {
618
  return \Closure::bind(function () use ($loader) {
619
+ $loader->prefixLengthsPsr4 = ComposerStaticInitccb9f2abd58411029afebcc31b227257::$prefixLengthsPsr4;
620
+ $loader->prefixDirsPsr4 = ComposerStaticInitccb9f2abd58411029afebcc31b227257::$prefixDirsPsr4;
621
+ $loader->fallbackDirsPsr4 = ComposerStaticInitccb9f2abd58411029afebcc31b227257::$fallbackDirsPsr4;
622
+ $loader->prefixesPsr0 = ComposerStaticInitccb9f2abd58411029afebcc31b227257::$prefixesPsr0;
623
+ $loader->classMap = ComposerStaticInitccb9f2abd58411029afebcc31b227257::$classMap;
624
 
625
  }, null, ClassLoader::class);
626
  }
vendor/vendor/altorouter/altorouter/AltoRouter.php DELETED
@@ -1,294 +0,0 @@
1
- <?php
2
-
3
- class AltoRouter {
4
-
5
- /**
6
- * @var array Array of all routes (incl. named routes).
7
- */
8
- protected $routes = array();
9
-
10
- /**
11
- * @var array Array of all named routes.
12
- */
13
- protected $namedRoutes = array();
14
-
15
- /**
16
- * @var string Can be used to ignore leading part of the Request URL (if main file lives in subdirectory of host)
17
- */
18
- protected $basePath = '';
19
-
20
- /**
21
- * @var array Array of default match types (regex helpers)
22
- */
23
- protected $matchTypes = array(
24
- 'i' => '[0-9]++',
25
- 'a' => '[0-9A-Za-z]++',
26
- 'h' => '[0-9A-Fa-f]++',
27
- '*' => '.+?',
28
- '**' => '.++',
29
- '' => '[^/\.]++'
30
- );
31
-
32
- /**
33
- * Create router in one call from config.
34
- *
35
- * @param array $routes
36
- * @param string $basePath
37
- * @param array $matchTypes
38
- */
39
- public function __construct( $routes = array(), $basePath = '', $matchTypes = array() ) {
40
- $this->addRoutes($routes);
41
- $this->setBasePath($basePath);
42
- $this->addMatchTypes($matchTypes);
43
- }
44
-
45
- /**
46
- * Retrieves all routes.
47
- * Useful if you want to process or display routes.
48
- * @return array All routes.
49
- */
50
- public function getRoutes() {
51
- return $this->routes;
52
- }
53
-
54
- /**
55
- * Add multiple routes at once from array in the following format:
56
- *
57
- * $routes = array(
58
- * array($method, $route, $target, $name)
59
- * );
60
- *
61
- * @param array $routes
62
- * @return void
63
- * @author Koen Punt
64
- * @throws Exception
65
- */
66
- public function addRoutes($routes){
67
- if(!is_array($routes) && !$routes instanceof Traversable) {
68
- throw new \Exception('Routes should be an array or an instance of Traversable');
69
- }
70
- foreach($routes as $route) {
71
- call_user_func_array(array($this, 'map'), $route);
72
- }
73
- }
74
-
75
- /**
76
- * Set the base path.
77
- * Useful if you are running your application from a subdirectory.
78
- */
79
- public function setBasePath($basePath) {
80
- $this->basePath = $basePath;
81
- }
82
-
83
- /**
84
- * Add named match types. It uses array_merge so keys can be overwritten.
85
- *
86
- * @param array $matchTypes The key is the name and the value is the regex.
87
- */
88
- public function addMatchTypes($matchTypes) {
89
- $this->matchTypes = array_merge($this->matchTypes, $matchTypes);
90
- }
91
-
92
- /**
93
- * Map a route to a target
94
- *
95
- * @param string $method One of 5 HTTP Methods, or a pipe-separated list of multiple HTTP Methods (GET|POST|PATCH|PUT|DELETE)
96
- * @param string $route The route regex, custom regex must start with an @. You can use multiple pre-set regex filters, like [i:id]
97
- * @param mixed $target The target where this route should point to. Can be anything.
98
- * @param string $name Optional name of this route. Supply if you want to reverse route this url in your application.
99
- * @throws Exception
100
- */
101
- public function map($method, $route, $target, $name = null) {
102
-
103
- $this->routes[] = array($method, $route, $target, $name);
104
-
105
- if($name) {
106
- if(isset($this->namedRoutes[$name])) {
107
- throw new \Exception("Can not redeclare route '{$name}'");
108
- } else {
109
- $this->namedRoutes[$name] = $route;
110
- }
111
-
112
- }
113
-
114
- return;
115
- }
116
-
117
- /**
118
- * Reversed routing
119
- *
120
- * Generate the URL for a named route. Replace regexes with supplied parameters
121
- *
122
- * @param string $routeName The name of the route.
123
- * @param array @params Associative array of parameters to replace placeholders with.
124
- * @return string The URL of the route with named parameters in place.
125
- * @throws Exception
126
- */
127
- public function generate($routeName, array $params = array()) {
128
-
129
- // Check if named route exists
130
- if(!isset($this->namedRoutes[$routeName])) {
131
- throw new \Exception("Route '{$routeName}' does not exist.");
132
- }
133
-
134
- // Replace named parameters
135
- $route = $this->namedRoutes[$routeName];
136
-
137
- // prepend base path to route url again
138
- $url = $this->basePath . $route;
139
-
140
- if (preg_match_all('`(/|\.|)\[([^:\]]*+)(?::([^:\]]*+))?\](\?|)`', $route, $matches, PREG_SET_ORDER)) {
141
-
142
- foreach($matches as $match) {
143
- list($block, $pre, $type, $param, $optional) = $match;
144
-
145
- if ($pre) {
146
- $block = substr($block, 1);
147
- }
148
-
149
- if(isset($params[$param])) {
150
- $url = str_replace($block, $params[$param], $url);
151
- } elseif ($optional) {
152
- $url = str_replace($pre . $block, '', $url);
153
- }
154
- }
155
-
156
-
157
- }
158
-
159
- return $url;
160
- }
161
-
162
- /**
163
- * Match a given Request Url against stored routes
164
- * @param string $requestUrl
165
- * @param string $requestMethod
166
- * @return array|boolean Array with route information on success, false on failure (no match).
167
- */
168
- public function match($requestUrl = null, $requestMethod = null) {
169
-
170
- $params = array();
171
- $match = false;
172
-
173
- // set Request Url if it isn't passed as parameter
174
- if($requestUrl === null) {
175
- $requestUrl = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '/';
176
- }
177
-
178
- // strip base path from request url
179
- $requestUrl = substr($requestUrl, strlen($this->basePath));
180
-
181
- // Strip query string (?a=b) from Request Url
182
- if (($strpos = strpos($requestUrl, '?')) !== false) {
183
- $requestUrl = substr($requestUrl, 0, $strpos);
184
- }
185
-
186
- // set Request Method if it isn't passed as a parameter
187
- if($requestMethod === null) {
188
- $requestMethod = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
189
- }
190
-
191
- foreach($this->routes as $handler) {
192
- list($method, $_route, $target, $name) = $handler;
193
-
194
- $methods = explode('|', $method);
195
- $method_match = false;
196
-
197
- // Check if request method matches. If not, abandon early. (CHEAP)
198
- foreach($methods as $method) {
199
- if (strcasecmp($requestMethod, $method) === 0) {
200
- $method_match = true;
201
- break;
202
- }
203
- }
204
-
205
- // Method did not match, continue to next route.
206
- if(!$method_match) continue;
207
-
208
- // Check for a wildcard (matches all)
209
- if ($_route === '*') {
210
- $match = true;
211
- } elseif (isset($_route[0]) && $_route[0] === '@') {
212
- $pattern = '`' . substr($_route, 1) . '`u';
213
- $match = preg_match($pattern, $requestUrl, $params);
214
- } else {
215
- $route = null;
216
- $regex = false;
217
- $j = 0;
218
- $n = isset($_route[0]) ? $_route[0] : null;
219
- $i = 0;
220
-
221
- // Find the longest non-regex substring and match it against the URI
222
- while (true) {
223
- if (!isset($_route[$i])) {
224
- break;
225
- } elseif (false === $regex) {
226
- $c = $n;
227
- $regex = $c === '[' || $c === '(' || $c === '.';
228
- if (false === $regex && false !== isset($_route[$i+1])) {
229
- $n = $_route[$i + 1];
230
- $regex = $n === '?' || $n === '+' || $n === '*' || $n === '{';
231
- }
232
- if (false === $regex && $c !== '/' && (!isset($requestUrl[$j]) || $c !== $requestUrl[$j])) {
233
- continue 2;
234
- }
235
- $j++;
236
- }
237
- $route .= $_route[$i++];
238
- }
239
-
240
- $regex = $this->compileRoute($route);
241
- $match = preg_match($regex, $requestUrl, $params);
242
- }
243
-
244
- if(($match == true || $match > 0)) {
245
-
246
- if($params) {
247
- foreach($params as $key => $value) {
248
- if(is_numeric($key)) unset($params[$key]);
249
- }
250
- }
251
-
252
- return array(
253
- 'target' => $target,
254
- 'params' => $params,
255
- 'name' => $name
256
- );
257
- }
258
- }
259
- return false;
260
- }
261
-
262
- /**
263
- * Compile the regex for a given route (EXPENSIVE)
264
- */
265
- private function compileRoute($route) {
266
- if (preg_match_all('`(/|\.|)\[([^:\]]*+)(?::([^:\]]*+))?\](\?|)`', $route, $matches, PREG_SET_ORDER)) {
267
-
268
- $matchTypes = $this->matchTypes;
269
- foreach($matches as $match) {
270
- list($block, $pre, $type, $param, $optional) = $match;
271
-
272
- if (isset($matchTypes[$type])) {
273
- $type = $matchTypes[$type];
274
- }
275
- if ($pre === '.') {
276
- $pre = '\.';
277
- }
278
-
279
- //Older versions of PCRE require the 'P' in (?P<named>)
280
- $pattern = '(?:'
281
- . ($pre !== '' ? $pre : null)
282
- . '('
283
- . ($param !== '' ? "?P<$param>" : null)
284
- . $type
285
- . '))'
286
- . ($optional !== '' ? '?' : null);
287
-
288
- $route = str_replace($block, $pattern, $route);
289
- }
290
-
291
- }
292
- return "`^$route$`u";
293
- }
294
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/altorouter/altorouter/README.md DELETED
@@ -1,53 +0,0 @@
1
- # AltoRouter [![Build Status](https://api.travis-ci.org/dannyvankooten/AltoRouter.png)](http://travis-ci.org/dannyvankooten/AltoRouter) [![Latest Stable Version](https://poser.pugx.org/altorouter/altorouter/v/stable.svg)](https://packagist.org/packages/altorouter/altorouter) [![License](https://poser.pugx.org/altorouter/altorouter/license.svg)](https://packagist.org/packages/altorouter/altorouter) [![Code Climate](https://codeclimate.com/github/dannyvankooten/AltoRouter/badges/gpa.svg)](https://codeclimate.com/github/dannyvankooten/AltoRouter) [![Test Coverage](https://codeclimate.com/github/dannyvankooten/AltoRouter/badges/coverage.svg)](https://codeclimate.com/github/dannyvankooten/AltoRouter)
2
- AltoRouter is a small but powerful routing class for PHP 5.3+, heavily inspired by [klein.php](https://github.com/chriso/klein.php/).
3
-
4
- ```php
5
- $router = new AltoRouter();
6
-
7
- // map homepage
8
- $router->map( 'GET', '/', function() {
9
- require __DIR__ . '/views/home.php';
10
- });
11
-
12
- // map users details page
13
- $router->map( 'GET|POST', '/users/[i:id]/', function( $id ) {
14
- $user = .....
15
- require __DIR__ . '/views/user/details.php';
16
- });
17
- ```
18
-
19
- ## Features
20
-
21
- * Can be used with all HTTP Methods
22
- * Dynamic routing with named route parameters
23
- * Reversed routing
24
- * Flexible regular expression routing (inspired by [Sinatra](http://www.sinatrarb.com/))
25
- * Custom regexes
26
-
27
- ## Getting started
28
-
29
- You need PHP >= 5.3 to use AltoRouter.
30
-
31
- - [Install AltoRouter](http://altorouter.com/usage/install.html)
32
- - [Rewrite all requests to AltoRouter](http://altorouter.com/usage/rewrite-requests.html)
33
- - [Map your routes](http://altorouter.com/usage/mapping-routes.html)
34
- - [Match requests](http://altorouter.com/usage/matching-requests.html)
35
- - [Process the request your preferred way](http://altorouter.com/usage/processing-requests.html)
36
-
37
- ## Contributors
38
- - [Danny van Kooten](https://github.com/dannyvankooten)
39
- - [Koen Punt](https://github.com/koenpunt)
40
- - [John Long](https://github.com/adduc)
41
- - [Niahoo Osef](https://github.com/niahoo)
42
-
43
- ## License
44
-
45
- (MIT License)
46
-
47
- Copyright (c) 2012-2015 Danny van Kooten <hi@dannyvankooten.com>
48
-
49
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
50
-
51
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
52
-
53
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/altorouter/altorouter/composer.json DELETED
@@ -1,35 +0,0 @@
1
- {
2
- "name": "altorouter/altorouter",
3
- "description": "A lightning fast router for PHP",
4
- "keywords": ["router", "routing", "lightweight"],
5
- "homepage": "https://github.com/dannyvankooten/AltoRouter",
6
- "license": "MIT",
7
- "authors": [
8
- {
9
- "name": "Danny van Kooten",
10
- "email": "dannyvankooten@gmail.com",
11
- "homepage": "http://dannyvankooten.com/"
12
- },
13
- {
14
- "name": "Koen Punt",
15
- "homepage": "https://github.com/koenpunt"
16
- },
17
- {
18
- "name": "niahoo",
19
- "homepage": "https://github.com/niahoo"
20
- }
21
- ],
22
- "require": {
23
- "php": ">=5.3.0"
24
- },
25
- "require-dev": {
26
- "phpunit/phpunit": "4.5.*",
27
- "codeclimate/php-test-reporter": "dev-master"
28
- },
29
- "autoload": {
30
- "classmap": ["AltoRouter.php"]
31
- },
32
- "scripts": {
33
- "test": "vendor/bin/phpunit"
34
- }
35
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/.gitignore DELETED
@@ -1,4 +0,0 @@
1
- phpunit.xml
2
- composer.lock
3
- composer.phar
4
- /vendor/
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/.travis.yml DELETED
@@ -1,36 +0,0 @@
1
- language: php
2
-
3
- cache:
4
- directories:
5
- - vendor
6
- - $HOME/.composer/cache
7
-
8
- env:
9
- - TWIG_VERSION="^1.0"
10
- - TWIG_VERSION="^2.0"
11
-
12
- php:
13
- - 5.3
14
- - 5.4
15
- - 5.5
16
- - 5.6
17
- - 7.0
18
- - 7.1
19
- - hhvm
20
-
21
- matrix:
22
- exclude:
23
- - php: 5.3
24
- env: TWIG_VERSION="^2.0"
25
- - php: 5.4
26
- env: TWIG_VERSION="^2.0"
27
- - php: 5.5
28
- env: TWIG_VERSION="^2.0"
29
- - php: 5.6
30
- env: TWIG_VERSION="^2.0"
31
- - php: hhvm
32
- env: TWIG_VERSION="^2.0"
33
-
34
- install: composer require twig/twig:${TWIG_VERSION}
35
-
36
- script: phpunit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/LICENSE DELETED
@@ -1,19 +0,0 @@
1
- Copyright (c) 2013 Alexander <iam.asm89@gmail.com>
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is furnished
8
- to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/README.md DELETED
@@ -1,238 +0,0 @@
1
- Twig cache extension
2
- ====================
3
-
4
- The missing cache extension for Twig. The extension allows for caching rendered parts of
5
- templates using several cache strategies.
6
-
7
- [![Build Status](https://secure.travis-ci.org/asm89/twig-cache-extension.png?branch=master)](http://travis-ci.org/asm89/twig-cache-extension)
8
-
9
- ## Installation
10
-
11
- The extension is installable via composer:
12
-
13
- ```json
14
- {
15
- "require": {
16
- "asm89/twig-cache-extension": "~1.0"
17
- }
18
- }
19
- ```
20
-
21
- ## Quick start
22
-
23
- ### Setup
24
-
25
- A minimal setup for adding the extension with the `LifeTimeCacheStrategy` and
26
- doctrine array cache is as following:
27
-
28
- ```php
29
- <?php
30
-
31
- use Doctrine\Common\Cache\ArrayCache;
32
- use Asm89\Twig\CacheExtension\CacheProvider\DoctrineCacheAdapter;
33
- use Asm89\Twig\CacheExtension\CacheStrategy\LifetimeCacheStrategy;
34
- use Asm89\Twig\CacheExtension\Extension as CacheExtension;
35
-
36
- $cacheProvider = new DoctrineCacheAdapter(new ArrayCache());
37
- $cacheStrategy = new LifetimeCacheStrategy($cacheProvider);
38
- $cacheExtension = new CacheExtension($cacheStrategy);
39
-
40
- $twig->addExtension($cacheExtension);
41
- ```
42
-
43
- ### Want to use a PSR-6 cache pool?
44
-
45
- Instead of using the default `DoctrineCacheAdapter` the extension also has
46
- a `PSR-6` compatible adapter. You need to instantiate one of the cache pool
47
- implementations as can be found on: http://php-cache.readthedocs.io/en/latest/
48
-
49
- Example: Making use of the `ApcuCachePool` via the `PsrCacheAdapter`:
50
-
51
- ```bash
52
- composer require cache/apcu-adapter
53
- ```
54
-
55
- ```php
56
- <?php
57
-
58
- use Asm89\Twig\CacheExtension\CacheProvider\PsrCacheAdapter;
59
- use Asm89\Twig\CacheExtension\CacheStrategy\LifetimeCacheStrategy;
60
- use Asm89\Twig\CacheExtension\Extension as CacheExtension;
61
- use Cache\Adapter\Apcu\ApcuCachePool;
62
-
63
- $cacheProvider = new PsrCacheAdapter(new ApcuCachePool());
64
- $cacheStrategy = new LifetimeCacheStrategy($cacheProvider);
65
- $cacheExtension = new CacheExtension($cacheStrategy);
66
-
67
- $twig->addExtension($cacheExtension);
68
- ```
69
-
70
- ### Usage
71
-
72
- To cache a part of a template in Twig surround the code with a `cache` block.
73
- The cache block takes two parameters, first an "annotation" part, second the
74
- "value" the cache strategy can work with. Example:
75
-
76
- ```jinja
77
- {% cache 'v1/summary' 900 %}
78
- {# heavy lifting template stuff here, include/render other partials etc #}
79
- {% endcache %}
80
- ```
81
-
82
- Cache blocks can be nested:
83
-
84
- ```jinja
85
- {% cache 'v1' 900 %}
86
- {% for item in items %}
87
- {% cache 'v1' item %}
88
- {# ... #}
89
- {% endcache %}
90
- {% endfor %}
91
- {% endcache %}
92
- ```
93
-
94
- The annotation can also be an expression:
95
-
96
- ```jinja
97
- {% set version = 42 %}
98
- {% cache 'hello_v' ~ version 900 %}
99
- Hello {{ name }}!
100
- {% endcache %}
101
- ```
102
-
103
- ## Cache strategies
104
-
105
- The extension ships with a few cache strategies out of the box. Setup and usage
106
- of all of them is described below.
107
-
108
- ### Lifetime
109
-
110
- See the ["Quick start"](#quick-start) for usage information of the `LifetimeCacheStrategy`.
111
-
112
- ### Generational
113
-
114
- Strategy for generational caching.
115
-
116
- In theory the strategy only saves fragments to the cache with infinite
117
- lifetime. The key of the strategy lies in the fact that the keys for blocks
118
- will change as the value for which the key is generated changes.
119
-
120
- For example: entities containing a last update time, would include a timestamp
121
- in the key. For an interesting blog post about this type of caching see:
122
- http://37signals.com/svn/posts/3113-how-key-based-cache-expiration-works
123
-
124
- ### Blackhole
125
-
126
- Strategy for development mode.
127
-
128
- In development mode it often not very useful to cache fragments. The blackhole
129
- strategy provides an easy way to not cache anything it all. It always generates
130
- a new key and does not fetch or save any fragments.
131
-
132
- #### Setup
133
-
134
- In order to use the strategy you need to setup a `KeyGenerator` class that is
135
- able to generate a cache key for a given value.
136
-
137
- The following naive example always assumes the value is an object with the methods
138
- `getId()` and `getUpdatedAt()` method. The key then composed from the class
139
- name, the id and the updated time of the object:
140
-
141
- ```php
142
- <?php
143
-
144
- use Asm89\Twig\CacheExtension\CacheStrategy\KeyGeneratorInterface;
145
-
146
- class MyKeyGenerator implements KeyGeneratorInterface
147
- {
148
- public function generateKey($value)
149
- {
150
- return get_class($value) . '_' . $value->getId() . '_' . $value->getUpdatedAt();
151
- }
152
-
153
- }
154
- ```
155
-
156
- Next the `GenerationalCacheStrategy` needs to be setup with the keygenerator.
157
-
158
- ```php
159
- <?php
160
-
161
- use Asm89\Twig\CacheExtension\CacheStrategy\GenerationalCacheStrategy;
162
- use Asm89\Twig\CacheExtension\Extension as CacheExtension;
163
-
164
- $keyGenerator = new MyKeyGenerator();
165
- $cacheProvider = /* see Quick start */;
166
- $cacheStrategy = new GenerationalCacheStrategy($cacheProvider, $keyGenerator, 0 /* = infinite lifetime */);
167
- $cacheExtension = new CacheExtension($cacheStrategy);
168
-
169
- $twig->addExtension($cacheExtension);
170
- ```
171
-
172
- #### Usage
173
-
174
- The strategy expects an object as value for determining the cache key of the
175
- block:
176
-
177
- ```jinja
178
- {% cache 'v1/summary' item %}
179
- {# heavy lifting template stuff here, include/render other partials etc #}
180
- {% endcache %}
181
- ```
182
-
183
- ### Using multiple strategies
184
-
185
- Different cache strategies are useful for different usecases. It is possible to
186
- mix multiple strategies in an application with the
187
- `IndexedChainingCacheStrategy`. The strategy takes an array of `'name' =>
188
- $strategy` and delegates the caching to the appropriate strategy.
189
-
190
- #### Setup
191
-
192
- ```php
193
- <?php
194
-
195
- use Asm89\Twig\CacheExtension\CacheStrategy\IndexedChainingCacheStrategy;
196
- use Asm89\Twig\CacheExtension\Extension as CacheExtension;
197
-
198
- $cacheStrategy = new IndexedChainingCacheStrategy(array(
199
- 'time' => $lifetimeCacheStrategy,
200
- 'gen' => $generationalCacheStrategy,
201
- ));
202
- $cacheExtension = new CacheExtension($cacheStrategy);
203
-
204
- $twig->addExtension($cacheExtension);
205
- ```
206
-
207
- #### Usage
208
-
209
- The strategy expects an array with as key the name of the strategy which it
210
- needs to delegate to and as value the appropriate value for the delegated
211
- strategy.
212
-
213
- ```jinja
214
- {# delegate to lifetime strategy #}
215
- {% cache 'v1/summary' {time: 300} %}
216
- {# heavy lifting template stuff here, include/render other partials etc #}
217
- {% endcache %}
218
-
219
- {# delegate to generational strategy #}
220
- {% cache 'v1/summary' {gen: item} %}
221
- {# heavy lifting template stuff here, include/render other partials etc #}
222
- {% endcache %}
223
- ```
224
-
225
- ## Implementing a cache strategy
226
-
227
- Creating separate caches for different access levels, languages or other
228
- usecases can be done by implementing a custom cache strategy. In order to do so
229
- implement the `CacheProviderInterface`. It is recommended to use composition
230
- and wrap a custom strategy around an existing one.
231
-
232
- ## Authors
233
-
234
- Alexander <iam.asm89@gmail.com>
235
-
236
- ## License
237
-
238
- twig-cache-extension is licensed under the MIT License - see the LICENSE file for details
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/composer.json DELETED
@@ -1,39 +0,0 @@
1
- {
2
- "name": "asm89/twig-cache-extension",
3
- "description": "Cache fragments of templates directly within Twig.",
4
- "keywords": ["twig", "cache", "extension"],
5
- "homepage": "https://github.com/asm89/twig-cache-extension",
6
- "type": "library",
7
- "license": "MIT",
8
- "authors": [
9
- {
10
- "name": "Alexander",
11
- "email": "iam.asm89@gmail.com"
12
- }
13
- ],
14
- "require": {
15
- "php": ">=5.3.2",
16
- "twig/twig": "^1.0|^2.0"
17
- },
18
- "require-dev": {
19
- "doctrine/cache": "~1.0"
20
- },
21
- "suggest": {
22
- "psr/cache-implementation": "To make use of PSR-6 cache implementation via PsrCacheAdapter."
23
- },
24
- "autoload": {
25
- "psr-4": {
26
- "": "lib/"
27
- }
28
- },
29
- "autoload-dev": {
30
- "psr-4": {
31
- "": "test/"
32
- }
33
- },
34
- "extra": {
35
- "branch-alias": {
36
- "dev-master": "1.3-dev"
37
- }
38
- }
39
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProvider/DoctrineCacheAdapter.php DELETED
@@ -1,49 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension\CacheProvider;
13
-
14
- use Asm89\Twig\CacheExtension\CacheProviderInterface;
15
- use Doctrine\Common\Cache\Cache;
16
-
17
- /**
18
- * Adapter class to use the cache classes provider by Doctrine.
19
- *
20
- * @author Alexander <iam.asm89@gmail.com>
21
- */
22
- class DoctrineCacheAdapter implements CacheProviderInterface
23
- {
24
- private $cache;
25
-
26
- /**
27
- * @param Cache $cache
28
- */
29
- public function __construct(Cache $cache)
30
- {
31
- $this->cache = $cache;
32
- }
33
-
34
- /**
35
- * {@inheritDoc}
36
- */
37
- public function fetch($key)
38
- {
39
- return $this->cache->fetch($key);
40
- }
41
-
42
- /**
43
- * {@inheritDoc}
44
- */
45
- public function save($key, $value, $lifetime = 0)
46
- {
47
- return $this->cache->save($key, $value, $lifetime);
48
- }
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProvider/PsrCacheAdapter.php DELETED
@@ -1,68 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension\CacheProvider;
13
-
14
- use Asm89\Twig\CacheExtension\CacheProviderInterface;
15
- use Psr\Cache\CacheItemPoolInterface;
16
-
17
- /**
18
- * Adapter class to make extension interoperable with every PSR-6 adapter.
19
- *
20
- * @see http://php-cache.readthedocs.io/
21
- *
22
- * @author Rvanlaak <rvanlaak@gmail.com>
23
- */
24
- class PsrCacheAdapter implements CacheProviderInterface
25
- {
26
- /**
27
- * @var CacheItemPoolInterface
28
- */
29
- private $cache;
30
-
31
- /**
32
- * @param CacheItemPoolInterface $cache
33
- */
34
- public function __construct(CacheItemPoolInterface $cache)
35
- {
36
- $this->cache = $cache;
37
- }
38
-
39
- /**
40
- * @param string $key
41
- * @return mixed|false
42
- */
43
- public function fetch($key)
44
- {
45
- // PSR-6 implementation returns null, CacheProviderInterface expects false
46
- $item = $this->cache->getItem($key);
47
- if ($item->isHit()) {
48
- return $item->get();
49
- }
50
- return false;
51
- }
52
-
53
- /**
54
- * @param string $key
55
- * @param string $value
56
- * @param int|\DateInterval $lifetime
57
- * @return bool
58
- */
59
- public function save($key, $value, $lifetime = 0)
60
- {
61
- $item = $this->cache->getItem($key);
62
- $item->set($value);
63
- $item->expiresAfter($lifetime);
64
-
65
- return $this->cache->save($item);
66
- }
67
-
68
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProviderInterface.php DELETED
@@ -1,36 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension;
13
-
14
- /**
15
- * Cache provider interface.
16
- *
17
- * @author Alexander <iam.asm89@gmail.com>
18
- */
19
- interface CacheProviderInterface
20
- {
21
- /**
22
- * @param string $key
23
- *
24
- * @return mixed False, if there was no value to be fetched. Null or a string otherwise.
25
- */
26
- public function fetch($key);
27
-
28
- /**
29
- * @param string $key
30
- * @param string $value
31
- * @param integer $lifetime
32
- *
33
- * @return boolean
34
- */
35
- public function save($key, $value, $lifetime = 0);
36
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/BlackholeCacheStrategy.php DELETED
@@ -1,53 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension\CacheStrategy;
13
-
14
- use Asm89\Twig\CacheExtension\CacheStrategyInterface;
15
-
16
- /**
17
- * CacheStrategy which doesn't cache at all
18
- *
19
- * This strategy can be used in development mode, e.g. editing twig templates,
20
- * to prevent previously cached versions from being rendered.
21
- *
22
- * @see https://github.com/asm89/twig-cache-extension/pull/29
23
- *
24
- * @author Hagen Hübel <hhuebel@itinance.com>
25
- *
26
- * @package Asm89\Twig\CacheExtension\CacheStrategy
27
- */
28
- class BlackholeCacheStrategy implements CacheStrategyInterface
29
- {
30
- /**
31
- * {@inheritDoc}
32
- */
33
- public function fetchBlock($key)
34
- {
35
- return false;
36
- }
37
-
38
- /**
39
- * {@inheritDoc}
40
- */
41
- public function generateKey($annotation, $value)
42
- {
43
- return microtime(true) . mt_rand();
44
- }
45
-
46
- /**
47
- * {@inheritDoc}
48
- */
49
- public function saveBlock($key, $block)
50
- {
51
- // fire and forget
52
- }
53
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/GenerationalCacheStrategy.php DELETED
@@ -1,79 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension\CacheStrategy;
13
-
14
- use Asm89\Twig\CacheExtension\CacheProviderInterface;
15
- use Asm89\Twig\CacheExtension\CacheStrategyInterface;
16
- use Asm89\Twig\CacheExtension\Exception\InvalidCacheKeyException;
17
-
18
- /**
19
- * Strategy for generational caching.
20
- *
21
- * In theory the strategy only saves fragments to the cache with infinite
22
- * lifetime. The key of the strategy lies in the fact that the keys for blocks
23
- * will change as the value for which the key is generated changes.
24
- *
25
- * For example: entities containing a last update time, would include a
26
- * timestamp in the key.
27
- *
28
- * @see http://37signals.com/svn/posts/3113-how-key-based-cache-expiration-works
29
- *
30
- * @author Alexander <iam.asm89@gmail.com>
31
- */
32
- class GenerationalCacheStrategy implements CacheStrategyInterface
33
- {
34
- private $keyGenerator;
35
- private $cache;
36
- private $lifetime;
37
-
38
- /**
39
- * @param CacheProviderInterface $cache
40
- * @param KeyGeneratorInterface $keyGenerator
41
- * @param integer $lifetime
42
- */
43
- public function __construct(CacheProviderInterface $cache, KeyGeneratorInterface $keyGenerator, $lifetime = 0)
44
- {
45
- $this->keyGenerator = $keyGenerator;
46
- $this->cache = $cache;
47
- $this->lifetime = $lifetime;
48
- }
49
-
50
- /**
51
- * {@inheritDoc}
52
- */
53
- public function fetchBlock($key)
54
- {
55
- return $this->cache->fetch($key);
56
- }
57
-
58
- /**
59
- * {@inheritDoc}
60
- */
61
- public function generateKey($annotation, $value)
62
- {
63
- $key = $this->keyGenerator->generateKey($value);
64
-
65
- if (null === $key) {
66
- throw new InvalidCacheKeyException();
67
- }
68
-
69
- return $annotation . '__GCS__' . $key;
70
- }
71
-
72
- /**
73
- * {@inheritDoc}
74
- */
75
- public function saveBlock($key, $block)
76
- {
77
- return $this->cache->save($key, $block, $this->lifetime);
78
- }
79
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/IndexedChainingCacheStrategy.php DELETED
@@ -1,76 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension\CacheStrategy;
13
-
14
- use Asm89\Twig\CacheExtension\CacheStrategyInterface;
15
- use Asm89\Twig\CacheExtension\Exception\NonExistingStrategyException;
16
- use Asm89\Twig\CacheExtension\Exception\NonExistingStrategyKeyException;
17
-
18
- /**
19
- * Combines several configured cache strategies.
20
- *
21
- * Useful for combining for example generational cache strategy with a lifetime
22
- * cache strategy, but also useful when combining several generational cache
23
- * strategies which differ on cache lifetime (infinite, 1hr, 5m).
24
- *
25
- * @author Alexander <iam.asm89@gmail.com>
26
- */
27
- class IndexedChainingCacheStrategy implements CacheStrategyInterface
28
- {
29
- /**
30
- * @var CacheStrategyInterface[]
31
- */
32
- private $strategies;
33
-
34
- /**
35
- * @param array $strategies
36
- */
37
- public function __construct(array $strategies)
38
- {
39
- $this->strategies = $strategies;
40
- }
41
-
42
- /**
43
- * {@inheritDoc}
44
- */
45
- public function fetchBlock($key)
46
- {
47
- return $this->strategies[$key['strategyKey']]->fetchBlock($key['key']);
48
- }
49
-
50
- /**
51
- * {@inheritDoc}
52
- */
53
- public function generateKey($annotation, $value)
54
- {
55
- if (!is_array($value) || null === $strategyKey = key($value)) {
56
- throw new NonExistingStrategyKeyException();
57
- }
58
-
59
- if (!isset($this->strategies[$strategyKey])) {
60
- throw new NonExistingStrategyException($strategyKey);
61
- }
62
-
63
- return array(
64
- 'strategyKey' => $strategyKey,
65
- 'key' => $this->strategies[$strategyKey]->generateKey($annotation, current($value)),
66
- );
67
- }
68
-
69
- /**
70
- * {@inheritDoc}
71
- */
72
- public function saveBlock($key, $block)
73
- {
74
- return $this->strategies[$key['strategyKey']]->saveBlock($key['key'], $block);
75
- }
76
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/KeyGeneratorInterface.php DELETED
@@ -1,29 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension\CacheStrategy;
13
-
14
- /**
15
- * Generates a key for a given value.
16
- *
17
- * @author Alexander <iam.asm89@gmail.com>
18
- */
19
- interface KeyGeneratorInterface
20
- {
21
- /**
22
- * Generate a cache key for a given value.
23
- *
24
- * @param mixed $value
25
- *
26
- * @return string
27
- */
28
- public function generateKey($value);
29
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/LifetimeCacheStrategy.php DELETED
@@ -1,68 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension\CacheStrategy;
13
-
14
- use Asm89\Twig\CacheExtension\CacheProviderInterface;
15
- use Asm89\Twig\CacheExtension\CacheStrategyInterface;
16
- use Asm89\Twig\CacheExtension\Exception\InvalidCacheLifetimeException;
17
-
18
- /**
19
- * Strategy for caching with a pre-defined lifetime.
20
- *
21
- * The value passed to the strategy is the lifetime of the cache block in
22
- * seconds.
23
- *
24
- * @author Alexander <iam.asm89@gmail.com>
25
- */
26
- class LifetimeCacheStrategy implements CacheStrategyInterface
27
- {
28
- private $cache;
29
-
30
- /**
31
- * @param CacheProviderInterface $cache
32
- */
33
- public function __construct(CacheProviderInterface $cache)
34
- {
35
- $this->cache = $cache;
36
- }
37
-
38
- /**
39
- * {@inheritDoc}
40
- */
41
- public function fetchBlock($key)
42
- {
43
- return $this->cache->fetch($key['key']);
44
- }
45
-
46
- /**
47
- * {@inheritDoc}
48
- */
49
- public function generateKey($annotation, $value)
50
- {
51
- if (!is_numeric($value)) {
52
- throw new InvalidCacheLifetimeException($value);
53
- }
54
-
55
- return array(
56
- 'lifetime' => $value,
57
- 'key' => '__LCS__' . $annotation,
58
- );
59
- }
60
-
61
- /**
62
- * {@inheritDoc}
63
- */
64
- public function saveBlock($key, $block)
65
- {
66
- return $this->cache->save($key['key'], $block, $key['lifetime']);
67
- }
68
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategyInterface.php DELETED
@@ -1,49 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension;
13
-
14
- /**
15
- * Cache strategy interface.
16
- *
17
- * @author Alexander <iam.asm89@gmail.com>
18
- */
19
- interface CacheStrategyInterface
20
- {
21
- /**
22
- * Fetch the block for a given key.
23
- *
24
- * @param mixed $key
25
- *
26
- * @return mixed
27
- */
28
- public function fetchBlock($key);
29
-
30
- /**
31
- * Generate a key for the value.
32
- *
33
- * @param string $annotation
34
- * @param mixed $value
35
- *
36
- * @return mixed
37
- */
38
- public function generateKey($annotation, $value);
39
-
40
- /**
41
- * Save the contents of a rendered block.
42
- *
43
- * @param mixed $key
44
- * @param string $block
45
- *
46
- * @return mixed
47
- */
48
- public function saveBlock($key, $block);
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/BaseException.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension\Exception;
13
-
14
- /**
15
- * @todo Replace \RuntimeException with \InvalidArgumentException at version 2.0
16
- */
17
- class BaseException extends \RuntimeException
18
- {
19
-
20
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/InvalidCacheKeyException.php DELETED
@@ -1,23 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension\Exception;
13
-
14
- class InvalidCacheKeyException extends BaseException
15
- {
16
- /**
17
- * {@inheritdoc}
18
- */
19
- public function __construct($message = 'Key generator did not return a key.', $code = 0, \Exception $previous = null)
20
- {
21
- parent::__construct($message, $code, $previous);
22
- }
23
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/InvalidCacheLifetimeException.php DELETED
@@ -1,23 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension\Exception;
13
-
14
- class InvalidCacheLifetimeException extends BaseException
15
- {
16
- /**
17
- * {@inheritdoc}
18
- */
19
- public function __construct($lifetime, $code = 0, \Exception $previous = null)
20
- {
21
- parent::__construct(sprintf('Value "%s" is not a valid lifetime.', gettype($lifetime)), $code, $previous);
22
- }
23
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/NonExistingStrategyException.php DELETED
@@ -1,23 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension\Exception;
13
-
14
- class NonExistingStrategyException extends BaseException
15
- {
16
- /**
17
- * {@inheritdoc}
18
- */
19
- public function __construct($strategyKey, $code = 0, \Exception $previous = null)
20
- {
21
- parent::__construct(sprintf('No strategy configured with key "%s".', $strategyKey), $code, $previous);
22
- }
23
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/NonExistingStrategyKeyException.php DELETED
@@ -1,23 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension\Exception;
13
-
14
- class NonExistingStrategyKeyException extends BaseException
15
- {
16
- /**
17
- * {@inheritdoc}
18
- */
19
- public function __construct($message = 'No strategy key found in value.', $code = 0, \Exception $previous = null)
20
- {
21
- parent::__construct($message, $code, $previous);
22
- }
23
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Extension.php DELETED
@@ -1,59 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension;
13
-
14
- /**
15
- * Extension for caching template blocks with twig.
16
- *
17
- * @author Alexander <iam.asm89@gmail.com>
18
- */
19
- class Extension extends \Twig_Extension
20
- {
21
- private $cacheStrategy;
22
-
23
- /**
24
- * @param CacheStrategyInterface $cacheStrategy
25
- */
26
- public function __construct(CacheStrategyInterface $cacheStrategy)
27
- {
28
- $this->cacheStrategy = $cacheStrategy;
29
- }
30
-
31
- /**
32
- * @return CacheStrategyInterface
33
- */
34
- public function getCacheStrategy()
35
- {
36
- return $this->cacheStrategy;
37
- }
38
-
39
- /**
40
- * {@inheritDoc}
41
- */
42
- public function getName()
43
- {
44
- if (version_compare(\Twig_Environment::VERSION, '1.26.0', '>=')) {
45
- return get_class($this);
46
- }
47
- return 'asm89_cache';
48
- }
49
-
50
- /**
51
- * {@inheritDoc}
52
- */
53
- public function getTokenParsers()
54
- {
55
- return array(
56
- new TokenParser\Cache(),
57
- );
58
- }
59
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Node/CacheNode.php DELETED
@@ -1,71 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension\Node;
13
-
14
- /**
15
- * Cache twig node.
16
- *
17
- * @author Alexander <iam.asm89@gmail.com>
18
- */
19
- class CacheNode extends \Twig_Node
20
- {
21
- private static $cacheCount = 1;
22
-
23
- /**
24
- * @param \Twig_Node_Expression $annotation
25
- * @param \Twig_Node_Expression $keyInfo
26
- * @param \Twig_NodeInterface $body
27
- * @param integer $lineno
28
- * @param string $tag
29
- */
30
- public function __construct(\Twig_Node_Expression $annotation, \Twig_Node_Expression $keyInfo, \Twig_Node $body, $lineno, $tag = null)
31
- {
32
- parent::__construct(array('key_info' => $keyInfo, 'body' => $body, 'annotation' => $annotation), array(), $lineno, $tag);
33
- }
34
-
35
- /**
36
- * {@inheritDoc}
37
- */
38
- public function compile(\Twig_Compiler $compiler)
39
- {
40
- $i = self::$cacheCount++;
41
-
42
- if (version_compare(\Twig_Environment::VERSION, '1.26.0', '>=')) {
43
- $extension = 'Asm89\Twig\CacheExtension\Extension';
44
- } else {
45
- $extension = 'asm89_cache';
46
- }
47
-
48
- $compiler
49
- ->addDebugInfo($this)
50
- ->write("\$asm89CacheStrategy".$i." = \$this->env->getExtension('{$extension}')->getCacheStrategy();\n")
51
- ->write("\$asm89Key".$i." = \$asm89CacheStrategy".$i."->generateKey(")
52
- ->subcompile($this->getNode('annotation'))
53
- ->raw(", ")
54
- ->subcompile($this->getNode('key_info'))
55
- ->write(");\n")
56
- ->write("\$asm89CacheBody".$i." = \$asm89CacheStrategy".$i."->fetchBlock(\$asm89Key".$i.");\n")
57
- ->write("if (\$asm89CacheBody".$i." === false) {\n")
58
- ->indent()
59
- ->write("ob_start();\n")
60
- ->indent()
61
- ->subcompile($this->getNode('body'))
62
- ->outdent()
63
- ->write("\n")
64
- ->write("\$asm89CacheBody".$i." = ob_get_clean();\n")
65
- ->write("\$asm89CacheStrategy".$i."->saveBlock(\$asm89Key".$i.", \$asm89CacheBody".$i.");\n")
66
- ->outdent()
67
- ->write("}\n")
68
- ->write("echo \$asm89CacheBody".$i.";\n")
69
- ;
70
- }
71
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/TokenParser/Cache.php DELETED
@@ -1,59 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension\TokenParser;
13
-
14
- use Asm89\Twig\CacheExtension\Node\CacheNode;
15
-
16
- /**
17
- * Parser for cache/endcache blocks.
18
- *
19
- * @author Alexander <iam.asm89@gmail.com>
20
- */
21
- class Cache extends \Twig_TokenParser
22
- {
23
- /**
24
- * @param \Twig_Token $token
25
- *
26
- * @return boolean
27
- */
28
- public function decideCacheEnd(\Twig_Token $token)
29
- {
30
- return $token->test('endcache');
31
- }
32
-
33
- /**
34
- * {@inheritDoc}
35
- */
36
- public function getTag()
37
- {
38
- return 'cache';
39
- }
40
-
41
- /**
42
- * {@inheritDoc}
43
- */
44
- public function parse(\Twig_Token $token)
45
- {
46
- $lineno = $token->getLine();
47
- $stream = $this->parser->getStream();
48
-
49
- $annotation = $this->parser->getExpressionParser()->parseExpression();
50
-
51
- $key = $this->parser->getExpressionParser()->parseExpression();
52
-
53
- $stream->expect(\Twig_Token::BLOCK_END_TYPE);
54
- $body = $this->parser->subparse(array($this, 'decideCacheEnd'), true);
55
- $stream->expect(\Twig_Token::BLOCK_END_TYPE);
56
-
57
- return new CacheNode($annotation, $key, $body, $lineno, $this->getTag());
58
- }
59
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/phpunit.xml.dist DELETED
@@ -1,25 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
-
3
- <phpunit backupGlobals="false"
4
- backupStaticAttributes="false"
5
- colors="true"
6
- convertErrorsToExceptions="true"
7
- convertNoticesToExceptions="true"
8
- convertWarningsToExceptions="true"
9
- processIsolation="false"
10
- stopOnFailure="false"
11
- syntaxCheck="false"
12
- bootstrap="test/bootstrap.php"
13
- >
14
- <testsuites>
15
- <testsuite name="Twig Cache Extension Test Suite">
16
- <directory>./test/Asm89/</directory>
17
- </testsuite>
18
- </testsuites>
19
-
20
- <filter>
21
- <whitelist>
22
- <directory suffix=".php">./lib/</directory>
23
- </whitelist>
24
- </filter>
25
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheProvider/DoctrineCacheAdapterTest.php DELETED
@@ -1,46 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension\Tests\CacheProvider;
13
-
14
- use Asm89\Twig\CacheExtension\CacheProvider\DoctrineCacheAdapter;
15
-
16
- class DoctrineCacheAdapterTest extends \PHPUnit_Framework_TestCase
17
- {
18
- public function testFetch()
19
- {
20
- $cacheMock = $this->createCacheMock();
21
- $cacheMock->expects($this->any())
22
- ->method('fetch')
23
- ->will($this->returnValue('fromcache'));
24
-
25
- $cache = new DoctrineCacheAdapter($cacheMock);
26
-
27
- $this->assertEquals('fromcache', $cache->fetch('test'));
28
- }
29
-
30
- public function testSave()
31
- {
32
- $cacheMock = $this->createCacheMock();
33
- $cacheMock->expects($this->once())
34
- ->method('save')
35
- ->with('key', 'value', 42);
36
-
37
- $cache = new DoctrineCacheAdapter($cacheMock);
38
-
39
- $cache->save('key', 'value', 42);
40
- }
41
-
42
- public function createCacheMock()
43
- {
44
- return $this->getMock('Doctrine\Common\Cache\Cache');
45
- }
46
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/GenerationCacheStrategyTest.php DELETED
@@ -1,80 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension\Tests\CacheStrategy;
13
-
14
- use Asm89\Twig\CacheExtension\CacheStrategy\GenerationalCacheStrategy;
15
-
16
- class GenerationalCacheStrategyTest extends \PHPUnit_Framework_TestCase
17
- {
18
- private $keyGeneratorMock;
19
- private $cacheProviderMock;
20
-
21
- public function createCacheStrategy($lifetime = 0)
22
- {
23
- $this->keyGeneratorMock = $this->createKeyGeneratorMock();
24
- $this->cacheProviderMock = $this->createCacheProviderMock();
25
-
26
- return new GenerationalCacheStrategy($this->cacheProviderMock, $this->keyGeneratorMock, $lifetime);
27
- }
28
-
29
- public function testGenerateKeyContainsAnnotation()
30
- {
31
- $strategy = $this->createCacheStrategy();
32
- $this->keyGeneratorMock->expects($this->any())
33
- ->method('generateKey')
34
- ->will($this->returnValue('foo'));
35
-
36
- $this->assertEquals('v42__GCS__foo', $strategy->generateKey('v42', 'value'));
37
- }
38
-
39
- /**
40
- * @expectedException \Asm89\Twig\CacheExtension\Exception\InvalidCacheKeyException
41
- */
42
- public function testGenerationKeyThrowsExceptionWhenKeyGeneratorReturnsNull()
43
- {
44
- $strategy = $this->createCacheStrategy();
45
-
46
- $strategy->generateKey('v42', 'value');
47
- }
48
-
49
- /**
50
- * @dataProvider getLifeTimes
51
- */
52
- public function testSaveBlockUsesConfiguredLifetime($lifetime)
53
- {
54
- $strategy = $this->createCacheStrategy($lifetime);
55
- $this->cacheProviderMock->expects($this->any())
56
- ->method('save')
57
- ->with('key', 'value', $lifetime)
58
- ->will($this->returnValue('foo'));
59
-
60
- $strategy->saveBlock('key', 'value');
61
- }
62
-
63
- public function getLifetimes()
64
- {
65
- return array(
66
- array(0),
67
- array(60),
68
- );
69
- }
70
-
71
- public function createKeyGeneratorMock()
72
- {
73
- return $this->getMock('Asm89\Twig\CacheExtension\CacheStrategy\KeyGeneratorInterface');
74
- }
75
-
76
- public function createCacheProviderMock()
77
- {
78
- return $this->getMock('Asm89\Twig\CacheExtension\CacheProviderInterface');
79
- }
80
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/IndexedChainingCacheStrategyTest.php DELETED
@@ -1,80 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension\Tests\CacheStrategy;
13
-
14
- use Asm89\Twig\CacheExtension\CacheStrategy\IndexedChainingCacheStrategy;
15
-
16
- class IndexedChainingCacheStrategyTest extends \PHPUnit_Framework_TestCase
17
- {
18
- private $cacheStrategyMocks = array();
19
-
20
- public function createCacheStrategy()
21
- {
22
- foreach($this->getStrategies() as $config) {
23
- list($key, $return) = $config;
24
-
25
- $cacheStrategyMock = $this->createCacheStrategyMock();
26
- $cacheStrategyMock->expects($this->any())
27
- ->method('generateKey')
28
- ->will($this->returnValue($return));
29
-
30
- $this->cacheStrategyMocks[$key] = $cacheStrategyMock;
31
- }
32
-
33
- return new IndexedChainingCacheStrategy($this->cacheStrategyMocks);
34
- }
35
-
36
- /**
37
- * @dataProvider getStrategies
38
- */
39
- public function testGenerateKeyProxiesToAppropriateStrategy($key, $return)
40
- {
41
- $strategy = $this->createCacheStrategy();
42
-
43
- $generatedKey = $strategy->generateKey('v42', array($key => 'proxied_value'));
44
-
45
- $this->assertEquals($return, $generatedKey['key']);
46
- $this->assertEquals($key, $generatedKey['strategyKey']);
47
- }
48
-
49
- /**
50
- * @expectedException \Asm89\Twig\CacheExtension\Exception\NonExistingStrategyKeyException
51
- */
52
- public function testGenerateKeyThrowsExceptionOnMissingKey()
53
- {
54
- $strategy = $this->createCacheStrategy();
55
- $strategy->generateKey('v42', 'proxied_value');
56
- }
57
-
58
- /**
59
- * @expectedException \Asm89\Twig\CacheExtension\Exception\NonExistingStrategyException
60
- * @expectedExceptionMessage No strategy configured with key "unknown"
61
- */
62
- public function testGenerateKeyThrowsExceptionOnUnknownKey()
63
- {
64
- $strategy = $this->createCacheStrategy();
65
- $strategy->generateKey('v42', array('unknown' => 'proxied_value'));
66
- }
67
-
68
- public function getStrategies()
69
- {
70
- return array(
71
- array('foo', 'foo_key'),
72
- array('bar', 'bar_key'),
73
- );
74
- }
75
-
76
- public function createCacheStrategyMock()
77
- {
78
- return $this->getMock('Asm89\Twig\CacheExtension\CacheStrategyInterface');
79
- }
80
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/CacheStrategy/LifetimeCacheStrategyTest.php DELETED
@@ -1,68 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension\Tests\CacheStrategy;
13
-
14
- use Asm89\Twig\CacheExtension\CacheStrategy\LifetimeCacheStrategy;
15
-
16
- class LifetimeCacheStrategyTest extends \PHPUnit_Framework_TestCase
17
- {
18
- private $cacheProviderMock;
19
-
20
- public function createCacheStrategy()
21
- {
22
- $this->cacheProviderMock = $this->createCacheProviderMock();
23
-
24
- return new LifetimeCacheStrategy($this->cacheProviderMock);
25
- }
26
-
27
- public function testGenerateKeyUsesGivenLifetime()
28
- {
29
- $strategy = $this->createCacheStrategy();
30
-
31
- $key = $strategy->generateKey('v42', 42);
32
-
33
- $this->assertEquals(42, $key['lifetime']);
34
- }
35
-
36
- public function testGenerateKeyAnnotatesKey()
37
- {
38
- $strategy = $this->createCacheStrategy();
39
-
40
- $key = $strategy->generateKey('the_annotation', 42);
41
-
42
- $this->assertContains('the_annotation', $key['key']);
43
- }
44
-
45
- /**
46
- * @dataProvider getInvalidLifetimeValues
47
- * @expectedException \Asm89\Twig\CacheExtension\Exception\InvalidCacheLifetimeException
48
- */
49
- public function testGenerateKeyThrowsExceptionWhenNoLifetimeProvided($value)
50
- {
51
- $strategy = $this->createCacheStrategy();
52
-
53
- $strategy->generateKey('v42', $value);
54
- }
55
-
56
- public function getInvalidLifetimeValues()
57
- {
58
- return array(
59
- array('foo'),
60
- array(array('foo')),
61
- );
62
- }
63
-
64
- public function createCacheProviderMock()
65
- {
66
- return $this->getMock('Asm89\Twig\CacheExtension\CacheProviderInterface');
67
- }
68
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/FunctionalExtensionTest.php DELETED
@@ -1,182 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Asm89\Twig\CacheExtension\Tests;
13
-
14
- use Asm89\Twig\CacheExtension\CacheProvider\DoctrineCacheAdapter;
15
- use Asm89\Twig\CacheExtension\CacheStrategy\KeyGeneratorInterface;
16
- use Asm89\Twig\CacheExtension\CacheStrategy\GenerationalCacheStrategy;
17
- use Asm89\Twig\CacheExtension\CacheStrategy\IndexedChainingCacheStrategy;
18
- use Asm89\Twig\CacheExtension\CacheStrategy\LifetimeCacheStrategy;
19
- use Asm89\Twig\CacheExtension\Extension;
20
- use Doctrine\Common\Cache\ArrayCache;
21
- use Twig_Loader_Filesystem;
22
- use Twig_Environment;
23
-
24
- class FunctionalExtensionTest extends \PHPUnit_Framework_TestCase
25
- {
26
- private $cache;
27
-
28
- protected function createCacheProvider()
29
- {
30
- $this->cache = new ArrayCache();
31
-
32
- return new DoctrineCacheAdapter($this->cache);
33
- }
34
-
35
- protected function createCacheStrategy($name = null)
36
- {
37
- $cacheProvider = $this->createCacheProvider();
38
- $keyGenerator = $this->createKeyGenerator();
39
- $lifetime = 0;
40
-
41
- switch ($name) {
42
- case 'time':
43
- return new LifetimeCacheStrategy($cacheProvider);
44
- case 'indexed':
45
- return new IndexedChainingCacheStrategy(array(
46
- 'gcs' => new GenerationalCacheStrategy($cacheProvider, $keyGenerator, $lifetime),
47
- 'time' => new LifetimeCacheStrategy($cacheProvider),
48
- ));
49
- default:
50
- return new GenerationalCacheStrategy($cacheProvider, $keyGenerator, $lifetime);
51
- }
52
- }
53
-
54
- protected function createKeyGenerator()
55
- {
56
- return new KeyGenerator();
57
- }
58
-
59
- protected function createTwig($cacheStrategyName = null)
60
- {
61
- $loader = new Twig_Loader_Filesystem(__DIR__ . '/fixtures/');
62
- $twig = new Twig_Environment($loader);
63
-
64
- $cacheExtension = new Extension($this->createCacheStrategy($cacheStrategyName));
65
-
66
- $twig->addExtension($cacheExtension);
67
-
68
- return $twig;
69
- }
70
-
71
- protected function getValue($value, $updatedAt)
72
- {
73
- return new Value($value, $updatedAt);
74
- }
75
-
76
- public function testCachesWithSameCacheKey()
77
- {
78
- $twig = $this->createTwig();
79
-
80
- $rendered = $twig->render('gcs_value.twig', array('value' => $this->getValue('asm89', 1)));
81
- $this->assertEquals('Hello asm89!', $rendered);
82
-
83
- $rendered2 = $twig->render('gcs_value.twig', array('value' => $this->getValue('fabpot', 1)));
84
- $this->assertEquals('Hello asm89!', $rendered2);
85
- }
86
-
87
- public function testDifferentCacheOnDifferentAnnotation()
88
- {
89
- $twig = $this->createTwig();
90
-
91
- $rendered = $twig->render('gcs_value.twig', array('value' => $this->getValue('asm89', 1)));
92
- $this->assertEquals('Hello asm89!', $rendered);
93
-
94
- $rendered2 = $twig->render('gcs_value.twig', array('value' => $this->getValue('fabpot', 1)));
95
- $this->assertEquals('Hello asm89!', $rendered2);
96
-
97
- $rendered3 = $twig->render('gcs_value_v2.twig', array('value' => $this->getValue('fabpot', 1)));
98
- $this->assertEquals('Hello fabpot!', $rendered3);
99
- }
100
-
101
- public function testLifetimeCacheStrategy()
102
- {
103
- $twig = $this->createTwig('time');
104
-
105
- $rendered = $twig->render('lcs_value.twig', array('value' => $this->getValue('asm89', 1)));
106
- $this->assertEquals('Hello asm89!', $rendered);
107
-
108
- $rendered2 = $twig->render('lcs_value.twig', array('value' => $this->getValue('fabpot', 1)));
109
- $this->assertEquals('Hello asm89!', $rendered2);
110
-
111
- $this->cache->flushAll();
112
-
113
- $rendered3 = $twig->render('lcs_value.twig', array('value' => $this->getValue('fabpot', 1)));
114
- $this->assertEquals('Hello fabpot!', $rendered3);
115
- }
116
-
117
- public function testIndexedChainingStrategy()
118
- {
119
- $twig = $this->createTwig('indexed');
120
-
121
- $rendered = $twig->render('ics_value.twig', array('value' => $this->getValue('asm89', 1)));
122
- $this->assertEquals('Hello asm89!', $rendered);
123
-
124
- $rendered2 = $twig->render('ics_value.twig', array('value' => $this->getValue('fabpot', 1)));
125
- $this->assertEquals('Hello asm89!', $rendered2);
126
-
127
- $this->cache->flushAll();
128
-
129
- $rendered3 = $twig->render('ics_value.twig', array('value' => $this->getValue('fabpot', 1)));
130
- $this->assertEquals('Hello fabpot!', $rendered3);
131
- }
132
-
133
- /**
134
- * @expectedException Twig_Error_Runtime
135
- * @expectedExceptionMessage An exception has been thrown during the rendering of a template ("No strategy key found in value.")
136
- */
137
- public function testIndexedChainingStrategyNeedsKey()
138
- {
139
- $twig = $this->createTwig('indexed');
140
-
141
- $twig->render('ics_no_key.twig', array('value' => $this->getValue('asm89', 1)));
142
- }
143
-
144
- public function testAnnotationExpression()
145
- {
146
- $twig = $this->createTwig('indexed');
147
-
148
- $rendered = $twig->render('annotation_expression.twig', array('value' => $this->getValue('asm89', 1), 'version' => 1));
149
- $this->assertEquals('Hello asm89!Hello asm89!', $rendered);
150
- }
151
- }
152
-
153
- class KeyGenerator implements KeyGeneratorInterface
154
- {
155
- public function generateKey($value)
156
- {
157
- return get_class($value) . '_' . $value->getUpdatedAt();
158
- }
159
-
160
- }
161
-
162
- class Value
163
- {
164
- private $value;
165
- private $updatedAt;
166
-
167
- public function __construct($value, $updatedAt)
168
- {
169
- $this->value = $value;
170
- $this->updatedAt = $updatedAt;
171
- }
172
-
173
- public function getUpdatedAt()
174
- {
175
- return $this->updatedAt;
176
- }
177
-
178
- public function __toString()
179
- {
180
- return $this->value;
181
- }
182
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/annotation_expression.twig DELETED
@@ -1,3 +0,0 @@
1
- {%- set k = "v'" ~ version -%}
2
- {%- cache k {time: 10} -%}Hello {{ value }}!{%- endcache -%}
3
- {%- cache 'bob'|capitalize {gcs: value} %}Hello {{ value }}!{%- endcache -%}
 
 
 
vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/annotation_not_string.twig DELETED
@@ -1,2 +0,0 @@
1
- {% set annotation = 'v1' %}
2
- {% cache annotation value %}Hello {{ value }}!{% endcache %}
 
 
vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/gcs_value.twig DELETED
@@ -1 +0,0 @@
1
- {% cache 'v1' value %}Hello {{ value }}!{% endcache %}
 
vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/gcs_value_v2.twig DELETED
@@ -1 +0,0 @@
1
- {% cache 'v2' value %}Hello {{ value }}!{% endcache %}
 
vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/ics_no_key.twig DELETED
@@ -1 +0,0 @@
1
- {% cache 'v1' 10 %}Hello {{ value }}!{% endcache %}
 
vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/ics_value.twig DELETED
@@ -1 +0,0 @@
1
- {% cache 'v1' {time: 10} %}Hello {{ value }}!{% endcache %}
 
vendor/vendor/asm89/twig-cache-extension/test/Asm89/Twig/CacheExtension/Tests/fixtures/lcs_value.twig DELETED
@@ -1 +0,0 @@
1
- {% cache 'v1' 10 %}Hello {{ value }}!{% endcache %}
 
vendor/vendor/asm89/twig-cache-extension/test/bootstrap.php DELETED
@@ -1,16 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of twig-cache-extension.
5
- *
6
- * (c) Alexander <iam.asm89@gmail.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- if (file_exists($file = __DIR__.'/../vendor/autoload.php')) {
13
- $autoload = require_once $file;
14
- } else {
15
- throw new RuntimeException('Install dependencies to run test suite.');
16
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/autoload.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
-
3
- // autoload.php @generated by Composer
4
-
5
- require_once __DIR__ . '/composer/autoload_real.php';
6
-
7
- return ComposerAutoloaderInit5cc6415a5b760b89bb0a84ca350b6b2a::getLoader();
 
 
 
 
 
 
 
vendor/vendor/composer/ClassLoader.php DELETED
@@ -1,445 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Composer.
5
- *
6
- * (c) Nils Adermann <naderman@naderman.de>
7
- * Jordi Boggiano <j.boggiano@seld.be>
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
12
-
13
- namespace Composer\Autoload;
14
-
15
- /**
16
- * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
17
- *
18
- * $loader = new \Composer\Autoload\ClassLoader();
19
- *
20
- * // register classes with namespaces
21
- * $loader->add('Symfony\Component', __DIR__.'/component');
22
- * $loader->add('Symfony', __DIR__.'/framework');
23
- *
24
- * // activate the autoloader
25
- * $loader->register();
26
- *
27
- * // to enable searching the include path (eg. for PEAR packages)
28
- * $loader->setUseIncludePath(true);
29
- *
30
- * In this example, if you try to use a class in the Symfony\Component
31
- * namespace or one of its children (Symfony\Component\Console for instance),
32
- * the autoloader will first look for the class under the component/
33
- * directory, and it will then fallback to the framework/ directory if not
34
- * found before giving up.
35
- *
36
- * This class is loosely based on the Symfony UniversalClassLoader.
37
- *
38
- * @author Fabien Potencier <fabien@symfony.com>
39
- * @author Jordi Boggiano <j.boggiano@seld.be>
40
- * @see http://www.php-fig.org/psr/psr-0/
41
- * @see http://www.php-fig.org/psr/psr-4/
42
- */
43
- class ClassLoader
44
- {
45
- // PSR-4
46
- private $prefixLengthsPsr4 = array();
47
- private $prefixDirsPsr4 = array();
48
- private $fallbackDirsPsr4 = array();
49
-
50
- // PSR-0
51
- private $prefixesPsr0 = array();
52
- private $fallbackDirsPsr0 = array();
53
-
54
- private $useIncludePath = false;
55
- private $classMap = array();
56
- private $classMapAuthoritative = false;
57
- private $missingClasses = array();
58
- private $apcuPrefix;
59
-
60
- public function getPrefixes()
61
- {
62
- if (!empty($this->prefixesPsr0)) {
63
- return call_user_func_array('array_merge', $this->prefixesPsr0);
64
- }
65
-
66
- return array();
67
- }
68
-
69
- public function getPrefixesPsr4()
70
- {
71
- return $this->prefixDirsPsr4;
72
- }
73
-
74
- public function getFallbackDirs()
75
- {
76
- return $this->fallbackDirsPsr0;
77
- }
78
-
79
- public function getFallbackDirsPsr4()
80
- {
81
- return $this->fallbackDirsPsr4;
82
- }
83
-
84
- public function getClassMap()
85
- {
86
- return $this->classMap;
87
- }
88
-
89
- /**
90
- * @param array $classMap Class to filename map
91
- */
92
- public function addClassMap(array $classMap)
93
- {
94
- if ($this->classMap) {
95
- $this->classMap = array_merge($this->classMap, $classMap);
96
- } else {
97
- $this->classMap = $classMap;
98
- }
99
- }
100
-
101
- /**
102
- * Registers a set of PSR-0 directories for a given prefix, either
103
- * appending or prepending to the ones previously set for this prefix.
104
- *
105
- * @param string $prefix The prefix
106
- * @param array|string $paths The PSR-0 root directories
107
- * @param bool $prepend Whether to prepend the directories
108
- */
109
- public function add($prefix, $paths, $prepend = false)
110
- {
111
- if (!$prefix) {
112
- if ($prepend) {
113
- $this->fallbackDirsPsr0 = array_merge(
114
- (array) $paths,
115
- $this->fallbackDirsPsr0
116
- );
117
- } else {
118
- $this->fallbackDirsPsr0 = array_merge(
119
- $this->fallbackDirsPsr0,
120
- (array) $paths
121
- );
122
- }
123
-
124
- return;
125
- }
126
-
127
- $first = $prefix[0];
128
- if (!isset($this->prefixesPsr0[$first][$prefix])) {
129
- $this->prefixesPsr0[$first][$prefix] = (array) $paths;
130
-
131
- return;
132
- }
133
- if ($prepend) {
134
- $this->prefixesPsr0[$first][$prefix] = array_merge(
135
- (array) $paths,
136
- $this->prefixesPsr0[$first][$prefix]
137
- );
138
- } else {
139
- $this->prefixesPsr0[$first][$prefix] = array_merge(
140
- $this->prefixesPsr0[$first][$prefix],
141
- (array) $paths
142
- );
143
- }
144
- }
145
-
146
- /**
147
- * Registers a set of PSR-4 directories for a given namespace, either
148
- * appending or prepending to the ones previously set for this namespace.
149
- *
150
- * @param string $prefix The prefix/namespace, with trailing '\\'
151
- * @param array|string $paths The PSR-4 base directories
152
- * @param bool $prepend Whether to prepend the directories
153
- *
154
- * @throws \InvalidArgumentException
155
- */
156
- public function addPsr4($prefix, $paths, $prepend = false)
157
- {
158
- if (!$prefix) {
159
- // Register directories for the root namespace.
160
- if ($prepend) {
161
- $this->fallbackDirsPsr4 = array_merge(
162
- (array) $paths,
163
- $this->fallbackDirsPsr4
164
- );
165
- } else {
166
- $this->fallbackDirsPsr4 = array_merge(
167
- $this->fallbackDirsPsr4,
168
- (array) $paths
169
- );
170
- }
171
- } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
172
- // Register directories for a new namespace.
173
- $length = strlen($prefix);
174
- if ('\\' !== $prefix[$length - 1]) {
175
- throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
176
- }
177
- $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
178
- $this->prefixDirsPsr4[$prefix] = (array) $paths;
179
- } elseif ($prepend) {
180
- // Prepend directories for an already registered namespace.
181
- $this->prefixDirsPsr4[$prefix] = array_merge(
182
- (array) $paths,
183
- $this->prefixDirsPsr4[$prefix]
184
- );
185
- } else {
186
- // Append directories for an already registered namespace.
187
- $this->prefixDirsPsr4[$prefix] = array_merge(
188
- $this->prefixDirsPsr4[$prefix],
189
- (array) $paths
190
- );
191
- }
192
- }
193
-
194
- /**
195
- * Registers a set of PSR-0 directories for a given prefix,
196
- * replacing any others previously set for this prefix.
197
- *
198
- * @param string $prefix The prefix
199
- * @param array|string $paths The PSR-0 base directories
200
- */
201
- public function set($prefix, $paths)
202
- {
203
- if (!$prefix) {
204
- $this->fallbackDirsPsr0 = (array) $paths;
205
- } else {
206
- $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
207
- }
208
- }
209
-
210
- /**
211
- * Registers a set of PSR-4 directories for a given namespace,
212
- * replacing any others previously set for this namespace.
213
- *
214
- * @param string $prefix The prefix/namespace, with trailing '\\'
215
- * @param array|string $paths The PSR-4 base directories
216
- *
217
- * @throws \InvalidArgumentException
218
- */
219
- public function setPsr4($prefix, $paths)
220
- {
221
- if (!$prefix) {
222
- $this->fallbackDirsPsr4 = (array) $paths;
223
- } else {
224
- $length = strlen($prefix);
225
- if ('\\' !== $prefix[$length - 1]) {
226
- throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
227
- }
228
- $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
229
- $this->prefixDirsPsr4[$prefix] = (array) $paths;
230
- }
231
- }
232
-
233
- /**
234
- * Turns on searching the include path for class files.
235
- *
236
- * @param bool $useIncludePath
237
- */
238
- public function setUseIncludePath($useIncludePath)
239
- {
240
- $this->useIncludePath = $useIncludePath;
241
- }
242
-
243
- /**
244
- * Can be used to check if the autoloader uses the include path to check
245
- * for classes.
246
- *
247
- * @return bool
248
- */
249
- public function getUseIncludePath()
250
- {
251
- return $this->useIncludePath;
252
- }
253
-
254
- /**
255
- * Turns off searching the prefix and fallback directories for classes
256
- * that have not been registered with the class map.
257
- *
258
- * @param bool $classMapAuthoritative
259
- */
260
- public function setClassMapAuthoritative($classMapAuthoritative)
261
- {
262
- $this->classMapAuthoritative = $classMapAuthoritative;
263
- }
264
-
265
- /**
266
- * Should class lookup fail if not found in the current class map?
267
- *
268
- * @return bool
269
- */
270
- public function isClassMapAuthoritative()
271
- {
272
- return $this->classMapAuthoritative;
273
- }
274
-
275
- /**
276
- * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
277
- *
278
- * @param string|null $apcuPrefix
279
- */
280
- public function setApcuPrefix($apcuPrefix)
281
- {
282
- $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
283
- }
284
-
285
- /**
286
- * The APCu prefix in use, or null if APCu caching is not enabled.
287
- *
288
- * @return string|null
289
- */
290
- public function getApcuPrefix()
291
- {
292
- return $this->apcuPrefix;
293
- }
294
-
295
- /**
296
- * Registers this instance as an autoloader.
297
- *
298
- * @param bool $prepend Whether to prepend the autoloader or not
299
- */
300
- public function register($prepend = false)
301
- {
302
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
303
- }
304
-
305
- /**
306
- * Unregisters this instance as an autoloader.
307
- */
308
- public function unregister()
309
- {
310
- spl_autoload_unregister(array($this, 'loadClass'));
311
- }
312
-
313
- /**
314
- * Loads the given class or interface.
315
- *
316
- * @param string $class The name of the class
317
- * @return bool|null True if loaded, null otherwise
318
- */
319
- public function loadClass($class)
320
- {
321
- if ($file = $this->findFile($class)) {
322
- includeFile($file);
323
-
324
- return true;
325
- }
326
- }
327
-
328
- /**
329
- * Finds the path to the file where the class is defined.
330
- *
331
- * @param string $class The name of the class
332
- *
333
- * @return string|false The path if found, false otherwise
334
- */
335
- public function findFile($class)
336
- {
337
- // class map lookup
338
- if (isset($this->classMap[$class])) {
339
- return $this->classMap[$class];
340
- }
341
- if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
342
- return false;
343
- }
344
- if (null !== $this->apcuPrefix) {
345
- $file = apcu_fetch($this->apcuPrefix.$class, $hit);
346
- if ($hit) {
347
- return $file;
348
- }
349
- }
350
-
351
- $file = $this->findFileWithExtension($class, '.php');
352
-
353
- // Search for Hack files if we are running on HHVM
354
- if (false === $file && defined('HHVM_VERSION')) {
355
- $file = $this->findFileWithExtension($class, '.hh');
356
- }
357
-
358
- if (null !== $this->apcuPrefix) {
359
- apcu_add($this->apcuPrefix.$class, $file);
360
- }
361
-
362
- if (false === $file) {
363
- // Remember that this class does not exist.
364
- $this->missingClasses[$class] = true;
365
- }
366
-
367
- return $file;
368
- }
369
-
370
- private function findFileWithExtension($class, $ext)
371
- {
372
- // PSR-4 lookup
373
- $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
374
-
375
- $first = $class[0];
376
- if (isset($this->prefixLengthsPsr4[$first])) {
377
- $subPath = $class;
378
- while (false !== $lastPos = strrpos($subPath, '\\')) {
379
- $subPath = substr($subPath, 0, $lastPos);
380
- $search = $subPath . '\\';
381
- if (isset($this->prefixDirsPsr4[$search])) {
382
- $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
383
- foreach ($this->prefixDirsPsr4[$search] as $dir) {
384
- if (file_exists($file = $dir . $pathEnd)) {
385
- return $file;
386
- }
387
- }
388
- }
389
- }
390
- }
391
-
392
- // PSR-4 fallback dirs
393
- foreach ($this->fallbackDirsPsr4 as $dir) {
394
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
395
- return $file;
396
- }
397
- }
398
-
399
- // PSR-0 lookup
400
- if (false !== $pos = strrpos($class, '\\')) {
401
- // namespaced class name
402
- $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
403
- . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
404
- } else {
405
- // PEAR-like class name
406
- $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
407
- }
408
-
409
- if (isset($this->prefixesPsr0[$first])) {
410
- foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
411
- if (0 === strpos($class, $prefix)) {
412
- foreach ($dirs as $dir) {
413
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
414
- return $file;
415
- }
416
- }
417
- }
418
- }
419
- }
420
-
421
- // PSR-0 fallback dirs
422
- foreach ($this->fallbackDirsPsr0 as $dir) {
423
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
424
- return $file;
425
- }
426
- }
427
-
428
- // PSR-0 include paths.
429
- if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
430
- return $file;
431
- }
432
-
433
- return false;
434
- }
435
- }
436
-
437
- /**
438
- * Scope isolated include.
439
- *
440
- * Prevents access to $this/self from included files.
441
- */
442
- function includeFile($file)
443
- {
444
- include $file;
445
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/LICENSE DELETED
@@ -1,21 +0,0 @@
1
-
2
- Copyright (c) Nils Adermann, Jordi Boggiano
3
-
4
- Permission is hereby granted, free of charge, to any person obtaining a copy
5
- of this software and associated documentation files (the "Software"), to deal
6
- in the Software without restriction, including without limitation the rights
7
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the Software is furnished
9
- to do so, subject to the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be included in all
12
- copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- THE SOFTWARE.
21
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/autoload_classmap.php DELETED
@@ -1,552 +0,0 @@
1
- <?php
2
-
3
- // autoload_classmap.php @generated by Composer
4
-
5
- $vendorDir = dirname(dirname(__FILE__));
6
- $baseDir = dirname($vendorDir);
7
-
8
- return array(
9
- 'AltoRouter' => $vendorDir . '/altorouter/altorouter/AltoRouter.php',
10
- 'Asm89\\Twig\\CacheExtension\\CacheProviderInterface' => $vendorDir . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProviderInterface.php',
11
- 'Asm89\\Twig\\CacheExtension\\CacheProvider\\DoctrineCacheAdapter' => $vendorDir . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProvider/DoctrineCacheAdapter.php',
12
- 'Asm89\\Twig\\CacheExtension\\CacheProvider\\PsrCacheAdapter' => $vendorDir . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProvider/PsrCacheAdapter.php',
13
- 'Asm89\\Twig\\CacheExtension\\CacheStrategyInterface' => $vendorDir . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategyInterface.php',
14
- 'Asm89\\Twig\\CacheExtension\\CacheStrategy\\BlackholeCacheStrategy' => $vendorDir . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/BlackholeCacheStrategy.php',
15
- 'Asm89\\Twig\\CacheExtension\\CacheStrategy\\GenerationalCacheStrategy' => $vendorDir . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/GenerationalCacheStrategy.php',
16
- 'Asm89\\Twig\\CacheExtension\\CacheStrategy\\IndexedChainingCacheStrategy' => $vendorDir . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/IndexedChainingCacheStrategy.php',
17
- 'Asm89\\Twig\\CacheExtension\\CacheStrategy\\KeyGeneratorInterface' => $vendorDir . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/KeyGeneratorInterface.php',
18
- 'Asm89\\Twig\\CacheExtension\\CacheStrategy\\LifetimeCacheStrategy' => $vendorDir . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/LifetimeCacheStrategy.php',
19
- 'Asm89\\Twig\\CacheExtension\\Exception\\BaseException' => $vendorDir . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/BaseException.php',
20
- 'Asm89\\Twig\\CacheExtension\\Exception\\InvalidCacheKeyException' => $vendorDir . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/InvalidCacheKeyException.php',
21
- 'Asm89\\Twig\\CacheExtension\\Exception\\InvalidCacheLifetimeException' => $vendorDir . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/InvalidCacheLifetimeException.php',
22
- 'Asm89\\Twig\\CacheExtension\\Exception\\NonExistingStrategyException' => $vendorDir . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/NonExistingStrategyException.php',
23
- 'Asm89\\Twig\\CacheExtension\\Exception\\NonExistingStrategyKeyException' => $vendorDir . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/NonExistingStrategyKeyException.php',
24
- 'Asm89\\Twig\\CacheExtension\\Extension' => $vendorDir . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Extension.php',
25
- 'Asm89\\Twig\\CacheExtension\\Node\\CacheNode' => $vendorDir . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Node/CacheNode.php',
26
- 'Asm89\\Twig\\CacheExtension\\TokenParser\\Cache' => $vendorDir . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/TokenParser/Cache.php',
27
- 'Composer\\Installers\\AglInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AglInstaller.php',
28
- 'Composer\\Installers\\AimeosInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AimeosInstaller.php',
29
- 'Composer\\Installers\\AnnotateCmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php',
30
- 'Composer\\Installers\\AsgardInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AsgardInstaller.php',
31
- 'Composer\\Installers\\AttogramInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/AttogramInstaller.php',
32
- 'Composer\\Installers\\BaseInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BaseInstaller.php',
33
- 'Composer\\Installers\\BitrixInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BitrixInstaller.php',
34
- 'Composer\\Installers\\BonefishInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/BonefishInstaller.php',
35
- 'Composer\\Installers\\CakePHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CakePHPInstaller.php',
36
- 'Composer\\Installers\\ChefInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ChefInstaller.php',
37
- 'Composer\\Installers\\CiviCrmInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CiviCrmInstaller.php',
38
- 'Composer\\Installers\\ClanCatsFrameworkInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php',
39
- 'Composer\\Installers\\CockpitInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CockpitInstaller.php',
40
- 'Composer\\Installers\\CodeIgniterInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php',
41
- 'Composer\\Installers\\Concrete5Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Concrete5Installer.php',
42
- 'Composer\\Installers\\CraftInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CraftInstaller.php',
43
- 'Composer\\Installers\\CroogoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CroogoInstaller.php',
44
- 'Composer\\Installers\\DecibelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DecibelInstaller.php',
45
- 'Composer\\Installers\\DframeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DframeInstaller.php',
46
- 'Composer\\Installers\\DokuWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DokuWikiInstaller.php',
47
- 'Composer\\Installers\\DolibarrInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DolibarrInstaller.php',
48
- 'Composer\\Installers\\DrupalInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/DrupalInstaller.php',
49
- 'Composer\\Installers\\ElggInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ElggInstaller.php',
50
- 'Composer\\Installers\\EliasisInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/EliasisInstaller.php',
51
- 'Composer\\Installers\\ExpressionEngineInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php',
52
- 'Composer\\Installers\\EzPlatformInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/EzPlatformInstaller.php',
53
- 'Composer\\Installers\\FuelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/FuelInstaller.php',
54
- 'Composer\\Installers\\FuelphpInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/FuelphpInstaller.php',
55
- 'Composer\\Installers\\GravInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/GravInstaller.php',
56
- 'Composer\\Installers\\HuradInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/HuradInstaller.php',
57
- 'Composer\\Installers\\ImageCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ImageCMSInstaller.php',
58
- 'Composer\\Installers\\Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Installer.php',
59
- 'Composer\\Installers\\ItopInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ItopInstaller.php',
60
- 'Composer\\Installers\\JoomlaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/JoomlaInstaller.php',
61
- 'Composer\\Installers\\KanboardInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KanboardInstaller.php',
62
- 'Composer\\Installers\\KirbyInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KirbyInstaller.php',
63
- 'Composer\\Installers\\KnownInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KnownInstaller.php',
64
- 'Composer\\Installers\\KodiCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KodiCMSInstaller.php',
65
- 'Composer\\Installers\\KohanaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/KohanaInstaller.php',
66
- 'Composer\\Installers\\LanManagementSystemInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php',
67
- 'Composer\\Installers\\LaravelInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LaravelInstaller.php',
68
- 'Composer\\Installers\\LavaLiteInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LavaLiteInstaller.php',
69
- 'Composer\\Installers\\LithiumInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/LithiumInstaller.php',
70
- 'Composer\\Installers\\MODULEWorkInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php',
71
- 'Composer\\Installers\\MODXEvoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MODXEvoInstaller.php',
72
- 'Composer\\Installers\\MagentoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MagentoInstaller.php',
73
- 'Composer\\Installers\\MajimaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MajimaInstaller.php',
74
- 'Composer\\Installers\\MakoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MakoInstaller.php',
75
- 'Composer\\Installers\\MauticInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MauticInstaller.php',
76
- 'Composer\\Installers\\MayaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MayaInstaller.php',
77
- 'Composer\\Installers\\MediaWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MediaWikiInstaller.php',
78
- 'Composer\\Installers\\MicroweberInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MicroweberInstaller.php',
79
- 'Composer\\Installers\\ModxInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ModxInstaller.php',
80
- 'Composer\\Installers\\MoodleInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/MoodleInstaller.php',
81
- 'Composer\\Installers\\OctoberInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OctoberInstaller.php',
82
- 'Composer\\Installers\\OntoWikiInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OntoWikiInstaller.php',
83
- 'Composer\\Installers\\OsclassInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OsclassInstaller.php',
84
- 'Composer\\Installers\\OxidInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/OxidInstaller.php',
85
- 'Composer\\Installers\\PPIInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PPIInstaller.php',
86
- 'Composer\\Installers\\PhiftyInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PhiftyInstaller.php',
87
- 'Composer\\Installers\\PhpBBInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PhpBBInstaller.php',
88
- 'Composer\\Installers\\PimcoreInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PimcoreInstaller.php',
89
- 'Composer\\Installers\\PiwikInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PiwikInstaller.php',
90
- 'Composer\\Installers\\PlentymarketsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php',
91
- 'Composer\\Installers\\Plugin' => $vendorDir . '/composer/installers/src/Composer/Installers/Plugin.php',
92
- 'Composer\\Installers\\PortoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PortoInstaller.php',
93
- 'Composer\\Installers\\PrestashopInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PrestashopInstaller.php',
94
- 'Composer\\Installers\\PuppetInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PuppetInstaller.php',
95
- 'Composer\\Installers\\PxcmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/PxcmsInstaller.php',
96
- 'Composer\\Installers\\RadPHPInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
97
- 'Composer\\Installers\\ReIndexInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
98
- 'Composer\\Installers\\Redaxo5Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Redaxo5Installer.php',
99
- 'Composer\\Installers\\RedaxoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
100
- 'Composer\\Installers\\RoundcubeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/RoundcubeInstaller.php',
101
- 'Composer\\Installers\\SMFInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
102
- 'Composer\\Installers\\ShopwareInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ShopwareInstaller.php',
103
- 'Composer\\Installers\\SilverStripeInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SilverStripeInstaller.php',
104
- 'Composer\\Installers\\SiteDirectInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SiteDirectInstaller.php',
105
- 'Composer\\Installers\\SyDESInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/SyDESInstaller.php',
106
- 'Composer\\Installers\\Symfony1Installer' => $vendorDir . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
107
- 'Composer\\Installers\\TYPO3CmsInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
108
- 'Composer\\Installers\\TYPO3FlowInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php',
109
- 'Composer\\Installers\\TaoInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TaoInstaller.php',
110
- 'Composer\\Installers\\TheliaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TheliaInstaller.php',
111
- 'Composer\\Installers\\TuskInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/TuskInstaller.php',
112
- 'Composer\\Installers\\UserFrostingInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/UserFrostingInstaller.php',
113
- 'Composer\\Installers\\VanillaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/VanillaInstaller.php',
114
- 'Composer\\Installers\\VgmcpInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/VgmcpInstaller.php',
115
- 'Composer\\Installers\\WHMCSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/WHMCSInstaller.php',
116
- 'Composer\\Installers\\WolfCMSInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/WolfCMSInstaller.php',
117
- 'Composer\\Installers\\WordPressInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/WordPressInstaller.php',
118
- 'Composer\\Installers\\YawikInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/YawikInstaller.php',
119
- 'Composer\\Installers\\ZendInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ZendInstaller.php',
120
- 'Composer\\Installers\\ZikulaInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ZikulaInstaller.php',
121
- 'Routes' => $vendorDir . '/upstatement/routes/Routes.php',
122
- 'Symfony\\Polyfill\\Ctype\\Ctype' => $vendorDir . '/symfony/polyfill-ctype/Ctype.php',
123
- 'Timber\\Admin' => $baseDir . '/lib/Admin.php',
124
- 'Timber\\Archives' => $baseDir . '/lib/Archives.php',
125
- 'Timber\\Cache\\Cleaner' => $baseDir . '/lib/Cache/Cleaner.php',
126
- 'Timber\\Cache\\KeyGenerator' => $baseDir . '/lib/Cache/KeyGenerator.php',
127
- 'Timber\\Cache\\TimberKeyGeneratorInterface' => $baseDir . '/lib/Cache/TimberKeyGeneratorInterface.php',
128
- 'Timber\\Cache\\WPObjectCacheAdapter' => $baseDir . '/lib/Cache/WPObjectCacheAdapter.php',
129
- 'Timber\\Comment' => $baseDir . '/lib/Comment.php',
130
- 'Timber\\CommentThread' => $baseDir . '/lib/CommentThread.php',
131
- 'Timber\\Core' => $baseDir . '/lib/Core.php',
132
- 'Timber\\CoreInterface' => $baseDir . '/lib/CoreInterface.php',
133
- 'Timber\\FunctionWrapper' => $baseDir . '/lib/FunctionWrapper.php',
134
- 'Timber\\Helper' => $baseDir . '/lib/Helper.php',
135
- 'Timber\\Image' => $baseDir . '/lib/Image.php',
136
- 'Timber\\ImageHelper' => $baseDir . '/lib/ImageHelper.php',
137
- 'Timber\\Image\\Operation' => $baseDir . '/lib/Image/Operation.php',
138
- 'Timber\\Image\\Operation\\Letterbox' => $baseDir . '/lib/Image/Operation/Letterbox.php',
139
- 'Timber\\Image\\Operation\\Resize' => $baseDir . '/lib/Image/Operation/Resize.php',
140
- 'Timber\\Image\\Operation\\Retina' => $baseDir . '/lib/Image/Operation/Retina.php',
141
- 'Timber\\Image\\Operation\\ToJpg' => $baseDir . '/lib/Image/Operation/ToJpg.php',
142
- 'Timber\\Image\\Operation\\ToWebp' => $baseDir . '/lib/Image/Operation/ToWebp.php',
143
- 'Timber\\Integrations' => $baseDir . '/lib/Integrations.php',
144
- 'Timber\\Integrations\\ACF' => $baseDir . '/lib/Integrations/ACF.php',
145
- 'Timber\\Integrations\\CoAuthorsPlus' => $baseDir . '/lib/Integrations/CoAuthorsPlus.php',
146
- 'Timber\\Integrations\\CoAuthorsPlusUser' => $baseDir . '/lib/Integrations/CoAuthorsPlusUser.php',
147
- 'Timber\\Integrations\\Command' => $baseDir . '/lib/Integrations/Command.php',
148
- 'Timber\\Integrations\\Timber_WP_CLI_Command' => $baseDir . '/lib/Integrations/Timber_WP_CLI_Command.php',
149
- 'Timber\\Integrations\\WPML' => $baseDir . '/lib/Integrations/WPML.php',
150
- 'Timber\\Loader' => $baseDir . '/lib/Loader.php',
151
- 'Timber\\LocationManager' => $baseDir . '/lib/LocationManager.php',
152
- 'Timber\\Menu' => $baseDir . '/lib/Menu.php',
153
- 'Timber\\MenuItem' => $baseDir . '/lib/MenuItem.php',
154
- 'Timber\\Pagination' => $baseDir . '/lib/Pagination.php',
155
- 'Timber\\Post' => $baseDir . '/lib/Post.php',
156
- 'Timber\\PostCollection' => $baseDir . '/lib/PostCollection.php',
157
- 'Timber\\PostGetter' => $baseDir . '/lib/PostGetter.php',
158
- 'Timber\\PostPreview' => $baseDir . '/lib/PostPreview.php',
159
- 'Timber\\PostQuery' => $baseDir . '/lib/PostQuery.php',
160
- 'Timber\\PostType' => $baseDir . '/lib/PostType.php',
161
- 'Timber\\PostsIterator' => $baseDir . '/lib/PostsIterator.php',
162
- 'Timber\\QueryIterator' => $baseDir . '/lib/QueryIterator.php',
163
- 'Timber\\Request' => $baseDir . '/lib/Request.php',
164
- 'Timber\\Site' => $baseDir . '/lib/Site.php',
165
- 'Timber\\Term' => $baseDir . '/lib/Term.php',
166
- 'Timber\\TermGetter' => $baseDir . '/lib/TermGetter.php',
167
- 'Timber\\TextHelper' => $baseDir . '/lib/TextHelper.php',
168
- 'Timber\\Theme' => $baseDir . '/lib/Theme.php',
169
- 'Timber\\Timber' => $baseDir . '/lib/Timber.php',
170
- 'Timber\\Twig' => $baseDir . '/lib/Twig.php',
171
- 'Timber\\Twig_Filter' => $baseDir . '/lib/Twig_Filter.php',
172
- 'Timber\\Twig_Function' => $baseDir . '/lib/Twig_Function.php',
173
- 'Timber\\URLHelper' => $baseDir . '/lib/URLHelper.php',
174
- 'Timber\\User' => $baseDir . '/lib/User.php',
175
- 'Twig\\Cache\\CacheInterface' => $vendorDir . '/twig/twig/src/Cache/CacheInterface.php',
176
- 'Twig\\Cache\\FilesystemCache' => $vendorDir . '/twig/twig/src/Cache/FilesystemCache.php',
177
- 'Twig\\Cache\\NullCache' => $vendorDir . '/twig/twig/src/Cache/NullCache.php',
178
- 'Twig\\Compiler' => $vendorDir . '/twig/twig/src/Compiler.php',
179
- 'Twig\\Environment' => $vendorDir . '/twig/twig/src/Environment.php',
180
- 'Twig\\Error\\Error' => $vendorDir . '/twig/twig/src/Error/Error.php',
181
- 'Twig\\Error\\LoaderError' => $vendorDir . '/twig/twig/src/Error/LoaderError.php',
182
- 'Twig\\Error\\RuntimeError' => $vendorDir . '/twig/twig/src/Error/RuntimeError.php',
183
- 'Twig\\Error\\SyntaxError' => $vendorDir . '/twig/twig/src/Error/SyntaxError.php',
184
- 'Twig\\ExpressionParser' => $vendorDir . '/twig/twig/src/ExpressionParser.php',
185
- 'Twig\\Extension\\AbstractExtension' => $vendorDir . '/twig/twig/src/Extension/AbstractExtension.php',
186
- 'Twig\\Extension\\CoreExtension' => $vendorDir . '/twig/twig/src/Extension/CoreExtension.php',
187
- 'Twig\\Extension\\DebugExtension' => $vendorDir . '/twig/twig/src/Extension/DebugExtension.php',
188
- 'Twig\\Extension\\EscaperExtension' => $vendorDir . '/twig/twig/src/Extension/EscaperExtension.php',
189
- 'Twig\\Extension\\ExtensionInterface' => $vendorDir . '/twig/twig/src/Extension/ExtensionInterface.php',
190
- 'Twig\\Extension\\GlobalsInterface' => $vendorDir . '/twig/twig/src/Extension/GlobalsInterface.php',
191
- 'Twig\\Extension\\InitRuntimeInterface' => $vendorDir . '/twig/twig/src/Extension/InitRuntimeInterface.php',
192
- 'Twig\\Extension\\OptimizerExtension' => $vendorDir . '/twig/twig/src/Extension/OptimizerExtension.php',
193
- 'Twig\\Extension\\ProfilerExtension' => $vendorDir . '/twig/twig/src/Extension/ProfilerExtension.php',
194
- 'Twig\\Extension\\RuntimeExtensionInterface' => $vendorDir . '/twig/twig/src/Extension/RuntimeExtensionInterface.php',
195
- 'Twig\\Extension\\SandboxExtension' => $vendorDir . '/twig/twig/src/Extension/SandboxExtension.php',
196
- 'Twig\\Extension\\StagingExtension' => $vendorDir . '/twig/twig/src/Extension/StagingExtension.php',
197
- 'Twig\\Extension\\StringLoaderExtension' => $vendorDir . '/twig/twig/src/Extension/StringLoaderExtension.php',
198
- 'Twig\\FileExtensionEscapingStrategy' => $vendorDir . '/twig/twig/src/FileExtensionEscapingStrategy.php',
199
- 'Twig\\Lexer' => $vendorDir . '/twig/twig/src/Lexer.php',
200
- 'Twig\\Loader\\ArrayLoader' => $vendorDir . '/twig/twig/src/Loader/ArrayLoader.php',
201
- 'Twig\\Loader\\ChainLoader' => $vendorDir . '/twig/twig/src/Loader/ChainLoader.php',
202
- 'Twig\\Loader\\ExistsLoaderInterface' => $vendorDir . '/twig/twig/src/Loader/ExistsLoaderInterface.php',
203
- 'Twig\\Loader\\FilesystemLoader' => $vendorDir . '/twig/twig/src/Loader/FilesystemLoader.php',
204
- 'Twig\\Loader\\LoaderInterface' => $vendorDir . '/twig/twig/src/Loader/LoaderInterface.php',
205
- 'Twig\\Loader\\SourceContextLoaderInterface' => $vendorDir . '/twig/twig/src/Loader/SourceContextLoaderInterface.php',
206
- 'Twig\\Markup' => $vendorDir . '/twig/twig/src/Markup.php',
207
- 'Twig\\NodeTraverser' => $vendorDir . '/twig/twig/src/NodeTraverser.php',
208
- 'Twig\\NodeVisitor\\AbstractNodeVisitor' => $vendorDir . '/twig/twig/src/NodeVisitor/AbstractNodeVisitor.php',
209
- 'Twig\\NodeVisitor\\EscaperNodeVisitor' => $vendorDir . '/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php',
210
- 'Twig\\NodeVisitor\\NodeVisitorInterface' => $vendorDir . '/twig/twig/src/NodeVisitor/NodeVisitorInterface.php',
211
- 'Twig\\NodeVisitor\\OptimizerNodeVisitor' => $vendorDir . '/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php',
212
- 'Twig\\NodeVisitor\\SafeAnalysisNodeVisitor' => $vendorDir . '/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php',
213
- 'Twig\\NodeVisitor\\SandboxNodeVisitor' => $vendorDir . '/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php',
214
- 'Twig\\Node\\AutoEscapeNode' => $vendorDir . '/twig/twig/src/Node/AutoEscapeNode.php',
215
- 'Twig\\Node\\BlockNode' => $vendorDir . '/twig/twig/src/Node/BlockNode.php',
216
- 'Twig\\Node\\BlockReferenceNode' => $vendorDir . '/twig/twig/src/Node/BlockReferenceNode.php',
217
- 'Twig\\Node\\BodyNode' => $vendorDir . '/twig/twig/src/Node/BodyNode.php',
218
- 'Twig\\Node\\CheckSecurityNode' => $vendorDir . '/twig/twig/src/Node/CheckSecurityNode.php',
219
- 'Twig\\Node\\CheckToStringNode' => $vendorDir . '/twig/twig/src/Node/CheckToStringNode.php',
220
- 'Twig\\Node\\DeprecatedNode' => $vendorDir . '/twig/twig/src/Node/DeprecatedNode.php',
221
- 'Twig\\Node\\DoNode' => $vendorDir . '/twig/twig/src/Node/DoNode.php',
222
- 'Twig\\Node\\EmbedNode' => $vendorDir . '/twig/twig/src/Node/EmbedNode.php',
223
- 'Twig\\Node\\Expression\\AbstractExpression' => $vendorDir . '/twig/twig/src/Node/Expression/AbstractExpression.php',
224
- 'Twig\\Node\\Expression\\ArrayExpression' => $vendorDir . '/twig/twig/src/Node/Expression/ArrayExpression.php',
225
- 'Twig\\Node\\Expression\\ArrowFunctionExpression' => $vendorDir . '/twig/twig/src/Node/Expression/ArrowFunctionExpression.php',
226
- 'Twig\\Node\\Expression\\AssignNameExpression' => $vendorDir . '/twig/twig/src/Node/Expression/AssignNameExpression.php',
227
- 'Twig\\Node\\Expression\\Binary\\AbstractBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/AbstractBinary.php',
228
- 'Twig\\Node\\Expression\\Binary\\AddBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/AddBinary.php',
229
- 'Twig\\Node\\Expression\\Binary\\AndBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/AndBinary.php',
230
- 'Twig\\Node\\Expression\\Binary\\BitwiseAndBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/BitwiseAndBinary.php',
231
- 'Twig\\Node\\Expression\\Binary\\BitwiseOrBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/BitwiseOrBinary.php',
232
- 'Twig\\Node\\Expression\\Binary\\BitwiseXorBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/BitwiseXorBinary.php',
233
- 'Twig\\Node\\Expression\\Binary\\ConcatBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/ConcatBinary.php',
234
- 'Twig\\Node\\Expression\\Binary\\DivBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/DivBinary.php',
235
- 'Twig\\Node\\Expression\\Binary\\EndsWithBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php',
236
- 'Twig\\Node\\Expression\\Binary\\EqualBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/EqualBinary.php',
237
- 'Twig\\Node\\Expression\\Binary\\FloorDivBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/FloorDivBinary.php',
238
- 'Twig\\Node\\Expression\\Binary\\GreaterBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/GreaterBinary.php',
239
- 'Twig\\Node\\Expression\\Binary\\GreaterEqualBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/GreaterEqualBinary.php',
240
- 'Twig\\Node\\Expression\\Binary\\InBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/InBinary.php',
241
- 'Twig\\Node\\Expression\\Binary\\LessBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/LessBinary.php',
242
- 'Twig\\Node\\Expression\\Binary\\LessEqualBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/LessEqualBinary.php',
243
- 'Twig\\Node\\Expression\\Binary\\MatchesBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/MatchesBinary.php',
244
- 'Twig\\Node\\Expression\\Binary\\ModBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/ModBinary.php',
245
- 'Twig\\Node\\Expression\\Binary\\MulBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/MulBinary.php',
246
- 'Twig\\Node\\Expression\\Binary\\NotEqualBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/NotEqualBinary.php',
247
- 'Twig\\Node\\Expression\\Binary\\NotInBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/NotInBinary.php',
248
- 'Twig\\Node\\Expression\\Binary\\OrBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/OrBinary.php',
249
- 'Twig\\Node\\Expression\\Binary\\PowerBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/PowerBinary.php',
250
- 'Twig\\Node\\Expression\\Binary\\RangeBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/RangeBinary.php',
251
- 'Twig\\Node\\Expression\\Binary\\StartsWithBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php',
252
- 'Twig\\Node\\Expression\\Binary\\SubBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/SubBinary.php',
253
- 'Twig\\Node\\Expression\\BlockReferenceExpression' => $vendorDir . '/twig/twig/src/Node/Expression/BlockReferenceExpression.php',
254
- 'Twig\\Node\\Expression\\CallExpression' => $vendorDir . '/twig/twig/src/Node/Expression/CallExpression.php',
255
- 'Twig\\Node\\Expression\\ConditionalExpression' => $vendorDir . '/twig/twig/src/Node/Expression/ConditionalExpression.php',
256
- 'Twig\\Node\\Expression\\ConstantExpression' => $vendorDir . '/twig/twig/src/Node/Expression/ConstantExpression.php',
257
- 'Twig\\Node\\Expression\\FilterExpression' => $vendorDir . '/twig/twig/src/Node/Expression/FilterExpression.php',
258
- 'Twig\\Node\\Expression\\Filter\\DefaultFilter' => $vendorDir . '/twig/twig/src/Node/Expression/Filter/DefaultFilter.php',
259
- 'Twig\\Node\\Expression\\FunctionExpression' => $vendorDir . '/twig/twig/src/Node/Expression/FunctionExpression.php',
260
- 'Twig\\Node\\Expression\\GetAttrExpression' => $vendorDir . '/twig/twig/src/Node/Expression/GetAttrExpression.php',
261
- 'Twig\\Node\\Expression\\InlinePrint' => $vendorDir . '/twig/twig/src/Node/Expression/InlinePrint.php',
262
- 'Twig\\Node\\Expression\\MethodCallExpression' => $vendorDir . '/twig/twig/src/Node/Expression/MethodCallExpression.php',
263
- 'Twig\\Node\\Expression\\NameExpression' => $vendorDir . '/twig/twig/src/Node/Expression/NameExpression.php',
264
- 'Twig\\Node\\Expression\\NullCoalesceExpression' => $vendorDir . '/twig/twig/src/Node/Expression/NullCoalesceExpression.php',
265
- 'Twig\\Node\\Expression\\ParentExpression' => $vendorDir . '/twig/twig/src/Node/Expression/ParentExpression.php',
266
- 'Twig\\Node\\Expression\\TempNameExpression' => $vendorDir . '/twig/twig/src/Node/Expression/TempNameExpression.php',
267
- 'Twig\\Node\\Expression\\TestExpression' => $vendorDir . '/twig/twig/src/Node/Expression/TestExpression.php',
268
- 'Twig\\Node\\Expression\\Test\\ConstantTest' => $vendorDir . '/twig/twig/src/Node/Expression/Test/ConstantTest.php',
269
- 'Twig\\Node\\Expression\\Test\\DefinedTest' => $vendorDir . '/twig/twig/src/Node/Expression/Test/DefinedTest.php',
270
- 'Twig\\Node\\Expression\\Test\\DivisiblebyTest' => $vendorDir . '/twig/twig/src/Node/Expression/Test/DivisiblebyTest.php',
271
- 'Twig\\Node\\Expression\\Test\\EvenTest' => $vendorDir . '/twig/twig/src/Node/Expression/Test/EvenTest.php',
272
- 'Twig\\Node\\Expression\\Test\\NullTest' => $vendorDir . '/twig/twig/src/Node/Expression/Test/NullTest.php',
273
- 'Twig\\Node\\Expression\\Test\\OddTest' => $vendorDir . '/twig/twig/src/Node/Expression/Test/OddTest.php',
274
- 'Twig\\Node\\Expression\\Test\\SameasTest' => $vendorDir . '/twig/twig/src/Node/Expression/Test/SameasTest.php',
275
- 'Twig\\Node\\Expression\\Unary\\AbstractUnary' => $vendorDir . '/twig/twig/src/Node/Expression/Unary/AbstractUnary.php',
276
- 'Twig\\Node\\Expression\\Unary\\NegUnary' => $vendorDir . '/twig/twig/src/Node/Expression/Unary/NegUnary.php',
277
- 'Twig\\Node\\Expression\\Unary\\NotUnary' => $vendorDir . '/twig/twig/src/Node/Expression/Unary/NotUnary.php',
278
- 'Twig\\Node\\Expression\\Unary\\PosUnary' => $vendorDir . '/twig/twig/src/Node/Expression/Unary/PosUnary.php',
279
- 'Twig\\Node\\FlushNode' => $vendorDir . '/twig/twig/src/Node/FlushNode.php',
280
- 'Twig\\Node\\ForLoopNode' => $vendorDir . '/twig/twig/src/Node/ForLoopNode.php',
281
- 'Twig\\Node\\ForNode' => $vendorDir . '/twig/twig/src/Node/ForNode.php',
282
- 'Twig\\Node\\IfNode' => $vendorDir . '/twig/twig/src/Node/IfNode.php',
283
- 'Twig\\Node\\ImportNode' => $vendorDir . '/twig/twig/src/Node/ImportNode.php',
284
- 'Twig\\Node\\IncludeNode' => $vendorDir . '/twig/twig/src/Node/IncludeNode.php',
285
- 'Twig\\Node\\MacroNode' => $vendorDir . '/twig/twig/src/Node/MacroNode.php',
286
- 'Twig\\Node\\ModuleNode' => $vendorDir . '/twig/twig/src/Node/ModuleNode.php',
287
- 'Twig\\Node\\Node' => $vendorDir . '/twig/twig/src/Node/Node.php',
288
- 'Twig\\Node\\NodeCaptureInterface' => $vendorDir . '/twig/twig/src/Node/NodeCaptureInterface.php',
289
- 'Twig\\Node\\NodeOutputInterface' => $vendorDir . '/twig/twig/src/Node/NodeOutputInterface.php',
290
- 'Twig\\Node\\PrintNode' => $vendorDir . '/twig/twig/src/Node/PrintNode.php',
291
- 'Twig\\Node\\SandboxNode' => $vendorDir . '/twig/twig/src/Node/SandboxNode.php',
292
- 'Twig\\Node\\SandboxedPrintNode' => $vendorDir . '/twig/twig/src/Node/SandboxedPrintNode.php',
293
- 'Twig\\Node\\SetNode' => $vendorDir . '/twig/twig/src/Node/SetNode.php',
294
- 'Twig\\Node\\SetTempNode' => $vendorDir . '/twig/twig/src/Node/SetTempNode.php',
295
- 'Twig\\Node\\SpacelessNode' => $vendorDir . '/twig/twig/src/Node/SpacelessNode.php',
296
- 'Twig\\Node\\TextNode' => $vendorDir . '/twig/twig/src/Node/TextNode.php',
297
- 'Twig\\Node\\WithNode' => $vendorDir . '/twig/twig/src/Node/WithNode.php',
298
- 'Twig\\Parser' => $vendorDir . '/twig/twig/src/Parser.php',
299
- 'Twig\\Profiler\\Dumper\\BaseDumper' => $vendorDir . '/twig/twig/src/Profiler/Dumper/BaseDumper.php',
300
- 'Twig\\Profiler\\Dumper\\BlackfireDumper' => $vendorDir . '/twig/twig/src/Profiler/Dumper/BlackfireDumper.php',
301
- 'Twig\\Profiler\\Dumper\\HtmlDumper' => $vendorDir . '/twig/twig/src/Profiler/Dumper/HtmlDumper.php',
302
- 'Twig\\Profiler\\Dumper\\TextDumper' => $vendorDir . '/twig/twig/src/Profiler/Dumper/TextDumper.php',
303
- 'Twig\\Profiler\\NodeVisitor\\ProfilerNodeVisitor' => $vendorDir . '/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php',
304
- 'Twig\\Profiler\\Node\\EnterProfileNode' => $vendorDir . '/twig/twig/src/Profiler/Node/EnterProfileNode.php',
305
- 'Twig\\Profiler\\Node\\LeaveProfileNode' => $vendorDir . '/twig/twig/src/Profiler/Node/LeaveProfileNode.php',
306
- 'Twig\\Profiler\\Profile' => $vendorDir . '/twig/twig/src/Profiler/Profile.php',
307
- 'Twig\\RuntimeLoader\\ContainerRuntimeLoader' => $vendorDir . '/twig/twig/src/RuntimeLoader/ContainerRuntimeLoader.php',
308
- 'Twig\\RuntimeLoader\\FactoryRuntimeLoader' => $vendorDir . '/twig/twig/src/RuntimeLoader/FactoryRuntimeLoader.php',
309
- 'Twig\\RuntimeLoader\\RuntimeLoaderInterface' => $vendorDir . '/twig/twig/src/RuntimeLoader/RuntimeLoaderInterface.php',
310
- 'Twig\\Sandbox\\SecurityError' => $vendorDir . '/twig/twig/src/Sandbox/SecurityError.php',
311
- 'Twig\\Sandbox\\SecurityNotAllowedFilterError' => $vendorDir . '/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php',
312
- 'Twig\\Sandbox\\SecurityNotAllowedFunctionError' => $vendorDir . '/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php',
313
- 'Twig\\Sandbox\\SecurityNotAllowedMethodError' => $vendorDir . '/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php',
314
- 'Twig\\Sandbox\\SecurityNotAllowedPropertyError' => $vendorDir . '/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php',
315
- 'Twig\\Sandbox\\SecurityNotAllowedTagError' => $vendorDir . '/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php',
316
- 'Twig\\Sandbox\\SecurityPolicy' => $vendorDir . '/twig/twig/src/Sandbox/SecurityPolicy.php',
317
- 'Twig\\Sandbox\\SecurityPolicyInterface' => $vendorDir . '/twig/twig/src/Sandbox/SecurityPolicyInterface.php',
318
- 'Twig\\Source' => $vendorDir . '/twig/twig/src/Source.php',
319
- 'Twig\\Template' => $vendorDir . '/twig/twig/src/Template.php',
320
- 'Twig\\TemplateWrapper' => $vendorDir . '/twig/twig/src/TemplateWrapper.php',
321
- 'Twig\\Test\\IntegrationTestCase' => $vendorDir . '/twig/twig/src/Test/IntegrationTestCase.php',
322
- 'Twig\\Test\\NodeTestCase' => $vendorDir . '/twig/twig/src/Test/NodeTestCase.php',
323
- 'Twig\\Token' => $vendorDir . '/twig/twig/src/Token.php',
324
- 'Twig\\TokenParser\\AbstractTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/AbstractTokenParser.php',
325
- 'Twig\\TokenParser\\ApplyTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/ApplyTokenParser.php',
326
- 'Twig\\TokenParser\\AutoEscapeTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/AutoEscapeTokenParser.php',
327
- 'Twig\\TokenParser\\BlockTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/BlockTokenParser.php',
328
- 'Twig\\TokenParser\\DeprecatedTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/DeprecatedTokenParser.php',
329
- 'Twig\\TokenParser\\DoTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/DoTokenParser.php',
330
- 'Twig\\TokenParser\\EmbedTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/EmbedTokenParser.php',
331
- 'Twig\\TokenParser\\ExtendsTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/ExtendsTokenParser.php',
332
- 'Twig\\TokenParser\\FilterTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/FilterTokenParser.php',
333
- 'Twig\\TokenParser\\FlushTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/FlushTokenParser.php',
334
- 'Twig\\TokenParser\\ForTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/ForTokenParser.php',
335
- 'Twig\\TokenParser\\FromTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/FromTokenParser.php',
336
- 'Twig\\TokenParser\\IfTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/IfTokenParser.php',
337
- 'Twig\\TokenParser\\ImportTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/ImportTokenParser.php',
338
- 'Twig\\TokenParser\\IncludeTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/IncludeTokenParser.php',
339
- 'Twig\\TokenParser\\MacroTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/MacroTokenParser.php',
340
- 'Twig\\TokenParser\\SandboxTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/SandboxTokenParser.php',
341
- 'Twig\\TokenParser\\SetTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/SetTokenParser.php',
342
- 'Twig\\TokenParser\\SpacelessTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/SpacelessTokenParser.php',
343
- 'Twig\\TokenParser\\TokenParserInterface' => $vendorDir . '/twig/twig/src/TokenParser/TokenParserInterface.php',
344
- 'Twig\\TokenParser\\UseTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/UseTokenParser.php',
345
- 'Twig\\TokenParser\\WithTokenParser' => $vendorDir . '/twig/twig/src/TokenParser/WithTokenParser.php',
346
- 'Twig\\TokenStream' => $vendorDir . '/twig/twig/src/TokenStream.php',
347
- 'Twig\\TwigFilter' => $vendorDir . '/twig/twig/src/TwigFilter.php',
348
- 'Twig\\TwigFunction' => $vendorDir . '/twig/twig/src/TwigFunction.php',
349
- 'Twig\\TwigTest' => $vendorDir . '/twig/twig/src/TwigTest.php',
350
- 'Twig\\Util\\DeprecationCollector' => $vendorDir . '/twig/twig/src/Util/DeprecationCollector.php',
351
- 'Twig\\Util\\TemplateDirIterator' => $vendorDir . '/twig/twig/src/Util/TemplateDirIterator.php',
352
- 'Twig_Autoloader' => $vendorDir . '/twig/twig/lib/Twig/Autoloader.php',
353
- 'Twig_BaseNodeVisitor' => $vendorDir . '/twig/twig/lib/Twig/BaseNodeVisitor.php',
354
- 'Twig_CacheInterface' => $vendorDir . '/twig/twig/lib/Twig/CacheInterface.php',
355
- 'Twig_Cache_Filesystem' => $vendorDir . '/twig/twig/lib/Twig/Cache/Filesystem.php',
356
- 'Twig_Cache_Null' => $vendorDir . '/twig/twig/lib/Twig/Cache/Null.php',
357
- 'Twig_Compiler' => $vendorDir . '/twig/twig/lib/Twig/Compiler.php',
358
- 'Twig_CompilerInterface' => $vendorDir . '/twig/twig/lib/Twig/CompilerInterface.php',
359
- 'Twig_ContainerRuntimeLoader' => $vendorDir . '/twig/twig/lib/Twig/ContainerRuntimeLoader.php',
360
- 'Twig_Environment' => $vendorDir . '/twig/twig/lib/Twig/Environment.php',
361
- 'Twig_Error' => $vendorDir . '/twig/twig/lib/Twig/Error.php',
362
- 'Twig_Error_Loader' => $vendorDir . '/twig/twig/lib/Twig/Error/Loader.php',
363
- 'Twig_Error_Runtime' => $vendorDir . '/twig/twig/lib/Twig/Error/Runtime.php',
364
- 'Twig_Error_Syntax' => $vendorDir . '/twig/twig/lib/Twig/Error/Syntax.php',
365
- 'Twig_ExistsLoaderInterface' => $vendorDir . '/twig/twig/lib/Twig/ExistsLoaderInterface.php',
366
- 'Twig_ExpressionParser' => $vendorDir . '/twig/twig/lib/Twig/ExpressionParser.php',
367
- 'Twig_Extension' => $vendorDir . '/twig/twig/lib/Twig/Extension.php',
368
- 'Twig_ExtensionInterface' => $vendorDir . '/twig/twig/lib/Twig/ExtensionInterface.php',
369
- 'Twig_Extension_Core' => $vendorDir . '/twig/twig/lib/Twig/Extension/Core.php',
370
- 'Twig_Extension_Debug' => $vendorDir . '/twig/twig/lib/Twig/Extension/Debug.php',
371
- 'Twig_Extension_Escaper' => $vendorDir . '/twig/twig/lib/Twig/Extension/Escaper.php',
372
- 'Twig_Extension_GlobalsInterface' => $vendorDir . '/twig/twig/lib/Twig/Extension/GlobalsInterface.php',
373
- 'Twig_Extension_InitRuntimeInterface' => $vendorDir . '/twig/twig/lib/Twig/Extension/InitRuntimeInterface.php',
374
- 'Twig_Extension_Optimizer' => $vendorDir . '/twig/twig/lib/Twig/Extension/Optimizer.php',
375
- 'Twig_Extension_Profiler' => $vendorDir . '/twig/twig/lib/Twig/Extension/Profiler.php',
376
- 'Twig_Extension_Sandbox' => $vendorDir . '/twig/twig/lib/Twig/Extension/Sandbox.php',
377
- 'Twig_Extension_Staging' => $vendorDir . '/twig/twig/lib/Twig/Extension/Staging.php',
378
- 'Twig_Extension_StringLoader' => $vendorDir . '/twig/twig/lib/Twig/Extension/StringLoader.php',
379
- 'Twig_FactoryRuntimeLoader' => $vendorDir . '/twig/twig/lib/Twig/FactoryRuntimeLoader.php',
380
- 'Twig_FileExtensionEscapingStrategy' => $vendorDir . '/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php',
381
- 'Twig_Filter' => $vendorDir . '/twig/twig/lib/Twig/Filter.php',
382
- 'Twig_FilterCallableInterface' => $vendorDir . '/twig/twig/lib/Twig/FilterCallableInterface.php',
383
- 'Twig_FilterInterface' => $vendorDir . '/twig/twig/lib/Twig/FilterInterface.php',
384
- 'Twig_Filter_Function' => $vendorDir . '/twig/twig/lib/Twig/Filter/Function.php',
385
- 'Twig_Filter_Method' => $vendorDir . '/twig/twig/lib/Twig/Filter/Method.php',
386
- 'Twig_Filter_Node' => $vendorDir . '/twig/twig/lib/Twig/Filter/Node.php',
387
- 'Twig_Function' => $vendorDir . '/twig/twig/lib/Twig/Function.php',
388
- 'Twig_FunctionCallableInterface' => $vendorDir . '/twig/twig/lib/Twig/FunctionCallableInterface.php',
389
- 'Twig_FunctionInterface' => $vendorDir . '/twig/twig/lib/Twig/FunctionInterface.php',
390
- 'Twig_Function_Function' => $vendorDir . '/twig/twig/lib/Twig/Function/Function.php',
391
- 'Twig_Function_Method' => $vendorDir . '/twig/twig/lib/Twig/Function/Method.php',
392
- 'Twig_Function_Node' => $vendorDir . '/twig/twig/lib/Twig/Function/Node.php',
393
- 'Twig_Lexer' => $vendorDir . '/twig/twig/lib/Twig/Lexer.php',
394
- 'Twig_LexerInterface' => $vendorDir . '/twig/twig/lib/Twig/LexerInterface.php',
395
- 'Twig_LoaderInterface' => $vendorDir . '/twig/twig/lib/Twig/LoaderInterface.php',
396
- 'Twig_Loader_Array' => $vendorDir . '/twig/twig/lib/Twig/Loader/Array.php',
397
- 'Twig_Loader_Chain' => $vendorDir . '/twig/twig/lib/Twig/Loader/Chain.php',
398
- 'Twig_Loader_Filesystem' => $vendorDir . '/twig/twig/lib/Twig/Loader/Filesystem.php',
399
- 'Twig_Loader_String' => $vendorDir . '/twig/twig/lib/Twig/Loader/String.php',
400
- 'Twig_Markup' => $vendorDir . '/twig/twig/lib/Twig/Markup.php',
401
- 'Twig_Node' => $vendorDir . '/twig/twig/lib/Twig/Node.php',
402
- 'Twig_NodeCaptureInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeCaptureInterface.php',
403
- 'Twig_NodeInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeInterface.php',
404
- 'Twig_NodeOutputInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeOutputInterface.php',
405
- 'Twig_NodeTraverser' => $vendorDir . '/twig/twig/lib/Twig/NodeTraverser.php',
406
- 'Twig_NodeVisitorInterface' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitorInterface.php',
407
- 'Twig_NodeVisitor_Escaper' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitor/Escaper.php',
408
- 'Twig_NodeVisitor_Optimizer' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitor/Optimizer.php',
409
- 'Twig_NodeVisitor_SafeAnalysis' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php',
410
- 'Twig_NodeVisitor_Sandbox' => $vendorDir . '/twig/twig/lib/Twig/NodeVisitor/Sandbox.php',
411
- 'Twig_Node_AutoEscape' => $vendorDir . '/twig/twig/lib/Twig/Node/AutoEscape.php',
412
- 'Twig_Node_Block' => $vendorDir . '/twig/twig/lib/Twig/Node/Block.php',
413
- 'Twig_Node_BlockReference' => $vendorDir . '/twig/twig/lib/Twig/Node/BlockReference.php',
414
- 'Twig_Node_Body' => $vendorDir . '/twig/twig/lib/Twig/Node/Body.php',
415
- 'Twig_Node_CheckSecurity' => $vendorDir . '/twig/twig/lib/Twig/Node/CheckSecurity.php',
416
- 'Twig_Node_Deprecated' => $vendorDir . '/twig/twig/lib/Twig/Node/Deprecated.php',
417
- 'Twig_Node_Do' => $vendorDir . '/twig/twig/lib/Twig/Node/Do.php',
418
- 'Twig_Node_Embed' => $vendorDir . '/twig/twig/lib/Twig/Node/Embed.php',
419
- 'Twig_Node_Expression' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression.php',
420
- 'Twig_Node_Expression_Array' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Array.php',
421
- 'Twig_Node_Expression_AssignName' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/AssignName.php',
422
- 'Twig_Node_Expression_Binary' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary.php',
423
- 'Twig_Node_Expression_Binary_Add' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Add.php',
424
- 'Twig_Node_Expression_Binary_And' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/And.php',
425
- 'Twig_Node_Expression_Binary_BitwiseAnd' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php',
426
- 'Twig_Node_Expression_Binary_BitwiseOr' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php',
427
- 'Twig_Node_Expression_Binary_BitwiseXor' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php',
428
- 'Twig_Node_Expression_Binary_Concat' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php',
429
- 'Twig_Node_Expression_Binary_Div' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Div.php',
430
- 'Twig_Node_Expression_Binary_EndsWith' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php',
431
- 'Twig_Node_Expression_Binary_Equal' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php',
432
- 'Twig_Node_Expression_Binary_FloorDiv' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php',
433
- 'Twig_Node_Expression_Binary_Greater' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php',
434
- 'Twig_Node_Expression_Binary_GreaterEqual' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php',
435
- 'Twig_Node_Expression_Binary_In' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/In.php',
436
- 'Twig_Node_Expression_Binary_Less' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Less.php',
437
- 'Twig_Node_Expression_Binary_LessEqual' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php',
438
- 'Twig_Node_Expression_Binary_Matches' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php',
439
- 'Twig_Node_Expression_Binary_Mod' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php',
440
- 'Twig_Node_Expression_Binary_Mul' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php',
441
- 'Twig_Node_Expression_Binary_NotEqual' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php',
442
- 'Twig_Node_Expression_Binary_NotIn' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php',
443
- 'Twig_Node_Expression_Binary_Or' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Or.php',
444
- 'Twig_Node_Expression_Binary_Power' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Power.php',
445
- 'Twig_Node_Expression_Binary_Range' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Range.php',
446
- 'Twig_Node_Expression_Binary_StartsWith' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php',
447
- 'Twig_Node_Expression_Binary_Sub' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php',
448
- 'Twig_Node_Expression_BlockReference' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/BlockReference.php',
449
- 'Twig_Node_Expression_Call' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Call.php',
450
- 'Twig_Node_Expression_Conditional' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Conditional.php',
451
- 'Twig_Node_Expression_Constant' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Constant.php',
452
- 'Twig_Node_Expression_ExtensionReference' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php',
453
- 'Twig_Node_Expression_Filter' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Filter.php',
454
- 'Twig_Node_Expression_Filter_Default' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Filter/Default.php',
455
- 'Twig_Node_Expression_Function' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Function.php',
456
- 'Twig_Node_Expression_GetAttr' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/GetAttr.php',
457
- 'Twig_Node_Expression_MethodCall' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/MethodCall.php',
458
- 'Twig_Node_Expression_Name' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Name.php',
459
- 'Twig_Node_Expression_NullCoalesce' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/NullCoalesce.php',
460
- 'Twig_Node_Expression_Parent' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Parent.php',
461
- 'Twig_Node_Expression_TempName' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/TempName.php',
462
- 'Twig_Node_Expression_Test' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test.php',
463
- 'Twig_Node_Expression_Test_Constant' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Constant.php',
464
- 'Twig_Node_Expression_Test_Defined' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Defined.php',
465
- 'Twig_Node_Expression_Test_Divisibleby' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php',
466
- 'Twig_Node_Expression_Test_Even' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Even.php',
467
- 'Twig_Node_Expression_Test_Null' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Null.php',
468
- 'Twig_Node_Expression_Test_Odd' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Odd.php',
469
- 'Twig_Node_Expression_Test_Sameas' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php',
470
- 'Twig_Node_Expression_Unary' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Unary.php',
471
- 'Twig_Node_Expression_Unary_Neg' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php',
472
- 'Twig_Node_Expression_Unary_Not' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Unary/Not.php',
473
- 'Twig_Node_Expression_Unary_Pos' => $vendorDir . '/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php',
474
- 'Twig_Node_Flush' => $vendorDir . '/twig/twig/lib/Twig/Node/Flush.php',
475
- 'Twig_Node_For' => $vendorDir . '/twig/twig/lib/Twig/Node/For.php',
476
- 'Twig_Node_ForLoop' => $vendorDir . '/twig/twig/lib/Twig/Node/ForLoop.php',
477
- 'Twig_Node_If' => $vendorDir . '/twig/twig/lib/Twig/Node/If.php',
478
- 'Twig_Node_Import' => $vendorDir . '/twig/twig/lib/Twig/Node/Import.php',
479
- 'Twig_Node_Include' => $vendorDir . '/twig/twig/lib/Twig/Node/Include.php',
480
- 'Twig_Node_Macro' => $vendorDir . '/twig/twig/lib/Twig/Node/Macro.php',
481
- 'Twig_Node_Module' => $vendorDir . '/twig/twig/lib/Twig/Node/Module.php',
482
- 'Twig_Node_Print' => $vendorDir . '/twig/twig/lib/Twig/Node/Print.php',
483
- 'Twig_Node_Sandbox' => $vendorDir . '/twig/twig/lib/Twig/Node/Sandbox.php',
484
- 'Twig_Node_SandboxedPrint' => $vendorDir . '/twig/twig/lib/Twig/Node/SandboxedPrint.php',
485
- 'Twig_Node_Set' => $vendorDir . '/twig/twig/lib/Twig/Node/Set.php',
486
- 'Twig_Node_SetTemp' => $vendorDir . '/twig/twig/lib/Twig/Node/SetTemp.php',
487
- 'Twig_Node_Spaceless' => $vendorDir . '/twig/twig/lib/Twig/Node/Spaceless.php',
488
- 'Twig_Node_Text' => $vendorDir . '/twig/twig/lib/Twig/Node/Text.php',
489
- 'Twig_Node_With' => $vendorDir . '/twig/twig/lib/Twig/Node/With.php',
490
- 'Twig_Parser' => $vendorDir . '/twig/twig/lib/Twig/Parser.php',
491
- 'Twig_ParserInterface' => $vendorDir . '/twig/twig/lib/Twig/ParserInterface.php',
492
- 'Twig_Profiler_Dumper_Base' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Dumper/Base.php',
493
- 'Twig_Profiler_Dumper_Blackfire' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php',
494
- 'Twig_Profiler_Dumper_Html' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Dumper/Html.php',
495
- 'Twig_Profiler_Dumper_Text' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Dumper/Text.php',
496
- 'Twig_Profiler_NodeVisitor_Profiler' => $vendorDir . '/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php',
497
- 'Twig_Profiler_Node_EnterProfile' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php',
498
- 'Twig_Profiler_Node_LeaveProfile' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Node/LeaveProfile.php',
499
- 'Twig_Profiler_Profile' => $vendorDir . '/twig/twig/lib/Twig/Profiler/Profile.php',
500
- 'Twig_RuntimeLoaderInterface' => $vendorDir . '/twig/twig/lib/Twig/RuntimeLoaderInterface.php',
501
- 'Twig_Sandbox_SecurityError' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityError.php',
502
- 'Twig_Sandbox_SecurityNotAllowedFilterError' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php',
503
- 'Twig_Sandbox_SecurityNotAllowedFunctionError' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php',
504
- 'Twig_Sandbox_SecurityNotAllowedMethodError' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedMethodError.php',
505
- 'Twig_Sandbox_SecurityNotAllowedPropertyError' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedPropertyError.php',
506
- 'Twig_Sandbox_SecurityNotAllowedTagError' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php',
507
- 'Twig_Sandbox_SecurityPolicy' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php',
508
- 'Twig_Sandbox_SecurityPolicyInterface' => $vendorDir . '/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php',
509
- 'Twig_SimpleFilter' => $vendorDir . '/twig/twig/lib/Twig/SimpleFilter.php',
510
- 'Twig_SimpleFunction' => $vendorDir . '/twig/twig/lib/Twig/SimpleFunction.php',
511
- 'Twig_SimpleTest' => $vendorDir . '/twig/twig/lib/Twig/SimpleTest.php',
512
- 'Twig_Source' => $vendorDir . '/twig/twig/lib/Twig/Source.php',
513
- 'Twig_SourceContextLoaderInterface' => $vendorDir . '/twig/twig/lib/Twig/SourceContextLoaderInterface.php',
514
- 'Twig_Template' => $vendorDir . '/twig/twig/lib/Twig/Template.php',
515
- 'Twig_TemplateInterface' => $vendorDir . '/twig/twig/lib/Twig/TemplateInterface.php',
516
- 'Twig_TemplateWrapper' => $vendorDir . '/twig/twig/lib/Twig/TemplateWrapper.php',
517
- 'Twig_Test' => $vendorDir . '/twig/twig/lib/Twig/Test.php',
518
- 'Twig_TestCallableInterface' => $vendorDir . '/twig/twig/lib/Twig/TestCallableInterface.php',
519
- 'Twig_TestInterface' => $vendorDir . '/twig/twig/lib/Twig/TestInterface.php',
520
- 'Twig_Test_Function' => $vendorDir . '/twig/twig/lib/Twig/Test/Function.php',
521
- 'Twig_Test_IntegrationTestCase' => $vendorDir . '/twig/twig/lib/Twig/Test/IntegrationTestCase.php',
522
- 'Twig_Test_Method' => $vendorDir . '/twig/twig/lib/Twig/Test/Method.php',
523
- 'Twig_Test_Node' => $vendorDir . '/twig/twig/lib/Twig/Test/Node.php',
524
- 'Twig_Test_NodeTestCase' => $vendorDir . '/twig/twig/lib/Twig/Test/NodeTestCase.php',
525
- 'Twig_Token' => $vendorDir . '/twig/twig/lib/Twig/Token.php',
526
- 'Twig_TokenParser' => $vendorDir . '/twig/twig/lib/Twig/TokenParser.php',
527
- 'Twig_TokenParserBroker' => $vendorDir . '/twig/twig/lib/Twig/TokenParserBroker.php',
528
- 'Twig_TokenParserBrokerInterface' => $vendorDir . '/twig/twig/lib/Twig/TokenParserBrokerInterface.php',
529
- 'Twig_TokenParserInterface' => $vendorDir . '/twig/twig/lib/Twig/TokenParserInterface.php',
530
- 'Twig_TokenParser_AutoEscape' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/AutoEscape.php',
531
- 'Twig_TokenParser_Block' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Block.php',
532
- 'Twig_TokenParser_Deprecated' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Deprecated.php',
533
- 'Twig_TokenParser_Do' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Do.php',
534
- 'Twig_TokenParser_Embed' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Embed.php',
535
- 'Twig_TokenParser_Extends' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Extends.php',
536
- 'Twig_TokenParser_Filter' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Filter.php',
537
- 'Twig_TokenParser_Flush' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Flush.php',
538
- 'Twig_TokenParser_For' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/For.php',
539
- 'Twig_TokenParser_From' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/From.php',
540
- 'Twig_TokenParser_If' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/If.php',
541
- 'Twig_TokenParser_Import' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Import.php',
542
- 'Twig_TokenParser_Include' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Include.php',
543
- 'Twig_TokenParser_Macro' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Macro.php',
544
- 'Twig_TokenParser_Sandbox' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Sandbox.php',
545
- 'Twig_TokenParser_Set' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Set.php',
546
- 'Twig_TokenParser_Spaceless' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Spaceless.php',
547
- 'Twig_TokenParser_Use' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/Use.php',
548
- 'Twig_TokenParser_With' => $vendorDir . '/twig/twig/lib/Twig/TokenParser/With.php',
549
- 'Twig_TokenStream' => $vendorDir . '/twig/twig/lib/Twig/TokenStream.php',
550
- 'Twig_Util_DeprecationCollector' => $vendorDir . '/twig/twig/lib/Twig/Util/DeprecationCollector.php',
551
- 'Twig_Util_TemplateDirIterator' => $vendorDir . '/twig/twig/lib/Twig/Util/TemplateDirIterator.php',
552
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/autoload_files.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- // autoload_files.php @generated by Composer
4
-
5
- $vendorDir = dirname(dirname(__FILE__));
6
- $baseDir = dirname($vendorDir);
7
-
8
- return array(
9
- '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
10
- );
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/autoload_namespaces.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- // autoload_namespaces.php @generated by Composer
4
-
5
- $vendorDir = dirname(dirname(__FILE__));
6
- $baseDir = dirname($vendorDir);
7
-
8
- return array(
9
- 'Twig_' => array($vendorDir . '/twig/twig/lib'),
10
- 'Routes' => array($vendorDir . '/upstatement/routes'),
11
- );
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/autoload_psr4.php DELETED
@@ -1,14 +0,0 @@
1
- <?php
2
-
3
- // autoload_psr4.php @generated by Composer
4
-
5
- $vendorDir = dirname(dirname(__FILE__));
6
- $baseDir = dirname($vendorDir);
7
-
8
- return array(
9
- 'Twig\\' => array($vendorDir . '/twig/twig/src'),
10
- 'Timber\\' => array($baseDir . '/lib'),
11
- 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
12
- 'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'),
13
- '' => array($vendorDir . '/asm89/twig-cache-extension/lib'),
14
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/autoload_real.php DELETED
@@ -1,70 +0,0 @@
1
- <?php
2
-
3
- // autoload_real.php @generated by Composer
4
-
5
- class ComposerAutoloaderInit5cc6415a5b760b89bb0a84ca350b6b2a
6
- {
7
- private static $loader;
8
-
9
- public static function loadClassLoader($class)
10
- {
11
- if ('Composer\Autoload\ClassLoader' === $class) {
12
- require __DIR__ . '/ClassLoader.php';
13
- }
14
- }
15
-
16
- public static function getLoader()
17
- {
18
- if (null !== self::$loader) {
19
- return self::$loader;
20
- }
21
-
22
- spl_autoload_register(array('ComposerAutoloaderInit5cc6415a5b760b89bb0a84ca350b6b2a', 'loadClassLoader'), true, true);
23
- self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit5cc6415a5b760b89bb0a84ca350b6b2a', 'loadClassLoader'));
25
-
26
- $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
- if ($useStaticLoader) {
28
- require_once __DIR__ . '/autoload_static.php';
29
-
30
- call_user_func(\Composer\Autoload\ComposerStaticInit5cc6415a5b760b89bb0a84ca350b6b2a::getInitializer($loader));
31
- } else {
32
- $map = require __DIR__ . '/autoload_namespaces.php';
33
- foreach ($map as $namespace => $path) {
34
- $loader->set($namespace, $path);
35
- }
36
-
37
- $map = require __DIR__ . '/autoload_psr4.php';
38
- foreach ($map as $namespace => $path) {
39
- $loader->setPsr4($namespace, $path);
40
- }
41
-
42
- $classMap = require __DIR__ . '/autoload_classmap.php';
43
- if ($classMap) {
44
- $loader->addClassMap($classMap);
45
- }
46
- }
47
-
48
- $loader->register(true);
49
-
50
- if ($useStaticLoader) {
51
- $includeFiles = Composer\Autoload\ComposerStaticInit5cc6415a5b760b89bb0a84ca350b6b2a::$files;
52
- } else {
53
- $includeFiles = require __DIR__ . '/autoload_files.php';
54
- }
55
- foreach ($includeFiles as $fileIdentifier => $file) {
56
- composerRequire5cc6415a5b760b89bb0a84ca350b6b2a($fileIdentifier, $file);
57
- }
58
-
59
- return $loader;
60
- }
61
- }
62
-
63
- function composerRequire5cc6415a5b760b89bb0a84ca350b6b2a($fileIdentifier, $file)
64
- {
65
- if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
- require $file;
67
-
68
- $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
69
- }
70
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/autoload_static.php DELETED
@@ -1,626 +0,0 @@
1
- <?php
2
-
3
- // autoload_static.php @generated by Composer
4
-
5
- namespace Composer\Autoload;
6
-
7
- class ComposerStaticInit5cc6415a5b760b89bb0a84ca350b6b2a
8
- {
9
- public static $files = array (
10
- '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
11
- );
12
-
13
- public static $prefixLengthsPsr4 = array (
14
- 'T' =>
15
- array (
16
- 'Twig\\' => 5,
17
- 'Timber\\' => 7,
18
- ),
19
- 'S' =>
20
- array (
21
- 'Symfony\\Polyfill\\Ctype\\' => 23,
22
- ),
23
- 'C' =>
24
- array (
25
- 'Composer\\Installers\\' => 20,
26
- ),
27
- );
28
-
29
- public static $prefixDirsPsr4 = array (
30
- 'Twig\\' =>
31
- array (
32
- 0 => __DIR__ . '/..' . '/twig/twig/src',
33
- ),
34
- 'Timber\\' =>
35
- array (
36
- 0 => __DIR__ . '/../..' . '/lib',
37
- ),
38
- 'Symfony\\Polyfill\\Ctype\\' =>
39
- array (
40
- 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype',
41
- ),
42
- 'Composer\\Installers\\' =>
43
- array (
44
- 0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers',
45
- ),
46
- );
47
-
48
- public static $fallbackDirsPsr4 = array (
49
- 0 => __DIR__ . '/..' . '/asm89/twig-cache-extension/lib',
50
- );
51
-
52
- public static $prefixesPsr0 = array (
53
- 'T' =>
54
- array (
55
- 'Twig_' =>
56
- array (
57
- 0 => __DIR__ . '/..' . '/twig/twig/lib',
58
- ),
59
- ),
60
- 'R' =>
61
- array (
62
- 'Routes' =>
63
- array (
64
- 0 => __DIR__ . '/..' . '/upstatement/routes',
65
- ),
66
- ),
67
- );
68
-
69
- public static $classMap = array (
70
- 'AltoRouter' => __DIR__ . '/..' . '/altorouter/altorouter/AltoRouter.php',
71
- 'Asm89\\Twig\\CacheExtension\\CacheProviderInterface' => __DIR__ . '/..' . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProviderInterface.php',
72
- 'Asm89\\Twig\\CacheExtension\\CacheProvider\\DoctrineCacheAdapter' => __DIR__ . '/..' . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProvider/DoctrineCacheAdapter.php',
73
- 'Asm89\\Twig\\CacheExtension\\CacheProvider\\PsrCacheAdapter' => __DIR__ . '/..' . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheProvider/PsrCacheAdapter.php',
74
- 'Asm89\\Twig\\CacheExtension\\CacheStrategyInterface' => __DIR__ . '/..' . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategyInterface.php',
75
- 'Asm89\\Twig\\CacheExtension\\CacheStrategy\\BlackholeCacheStrategy' => __DIR__ . '/..' . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/BlackholeCacheStrategy.php',
76
- 'Asm89\\Twig\\CacheExtension\\CacheStrategy\\GenerationalCacheStrategy' => __DIR__ . '/..' . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/GenerationalCacheStrategy.php',
77
- 'Asm89\\Twig\\CacheExtension\\CacheStrategy\\IndexedChainingCacheStrategy' => __DIR__ . '/..' . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/IndexedChainingCacheStrategy.php',
78
- 'Asm89\\Twig\\CacheExtension\\CacheStrategy\\KeyGeneratorInterface' => __DIR__ . '/..' . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/KeyGeneratorInterface.php',
79
- 'Asm89\\Twig\\CacheExtension\\CacheStrategy\\LifetimeCacheStrategy' => __DIR__ . '/..' . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/CacheStrategy/LifetimeCacheStrategy.php',
80
- 'Asm89\\Twig\\CacheExtension\\Exception\\BaseException' => __DIR__ . '/..' . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/BaseException.php',
81
- 'Asm89\\Twig\\CacheExtension\\Exception\\InvalidCacheKeyException' => __DIR__ . '/..' . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/InvalidCacheKeyException.php',
82
- 'Asm89\\Twig\\CacheExtension\\Exception\\InvalidCacheLifetimeException' => __DIR__ . '/..' . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/InvalidCacheLifetimeException.php',
83
- 'Asm89\\Twig\\CacheExtension\\Exception\\NonExistingStrategyException' => __DIR__ . '/..' . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/NonExistingStrategyException.php',
84
- 'Asm89\\Twig\\CacheExtension\\Exception\\NonExistingStrategyKeyException' => __DIR__ . '/..' . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Exception/NonExistingStrategyKeyException.php',
85
- 'Asm89\\Twig\\CacheExtension\\Extension' => __DIR__ . '/..' . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Extension.php',
86
- 'Asm89\\Twig\\CacheExtension\\Node\\CacheNode' => __DIR__ . '/..' . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/Node/CacheNode.php',
87
- 'Asm89\\Twig\\CacheExtension\\TokenParser\\Cache' => __DIR__ . '/..' . '/asm89/twig-cache-extension/lib/Asm89/Twig/CacheExtension/TokenParser/Cache.php',
88
- 'Composer\\Installers\\AglInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AglInstaller.php',
89
- 'Composer\\Installers\\AimeosInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AimeosInstaller.php',
90
- 'Composer\\Installers\\AnnotateCmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php',
91
- 'Composer\\Installers\\AsgardInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AsgardInstaller.php',
92
- 'Composer\\Installers\\AttogramInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/AttogramInstaller.php',
93
- 'Composer\\Installers\\BaseInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/BaseInstaller.php',
94
- 'Composer\\Installers\\BitrixInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/BitrixInstaller.php',
95
- 'Composer\\Installers\\BonefishInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/BonefishInstaller.php',
96
- 'Composer\\Installers\\CakePHPInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CakePHPInstaller.php',
97
- 'Composer\\Installers\\ChefInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ChefInstaller.php',
98
- 'Composer\\Installers\\CiviCrmInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CiviCrmInstaller.php',
99
- 'Composer\\Installers\\ClanCatsFrameworkInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php',
100
- 'Composer\\Installers\\CockpitInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CockpitInstaller.php',
101
- 'Composer\\Installers\\CodeIgniterInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php',
102
- 'Composer\\Installers\\Concrete5Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Concrete5Installer.php',
103
- 'Composer\\Installers\\CraftInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CraftInstaller.php',
104
- 'Composer\\Installers\\CroogoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/CroogoInstaller.php',
105
- 'Composer\\Installers\\DecibelInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DecibelInstaller.php',
106
- 'Composer\\Installers\\DframeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DframeInstaller.php',
107
- 'Composer\\Installers\\DokuWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DokuWikiInstaller.php',
108
- 'Composer\\Installers\\DolibarrInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DolibarrInstaller.php',
109
- 'Composer\\Installers\\DrupalInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/DrupalInstaller.php',
110
- 'Composer\\Installers\\ElggInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ElggInstaller.php',
111
- 'Composer\\Installers\\EliasisInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/EliasisInstaller.php',
112
- 'Composer\\Installers\\ExpressionEngineInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php',
113
- 'Composer\\Installers\\EzPlatformInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/EzPlatformInstaller.php',
114
- 'Composer\\Installers\\FuelInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/FuelInstaller.php',
115
- 'Composer\\Installers\\FuelphpInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/FuelphpInstaller.php',
116
- 'Composer\\Installers\\GravInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/GravInstaller.php',
117
- 'Composer\\Installers\\HuradInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/HuradInstaller.php',
118
- 'Composer\\Installers\\ImageCMSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ImageCMSInstaller.php',
119
- 'Composer\\Installers\\Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Installer.php',
120
- 'Composer\\Installers\\ItopInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ItopInstaller.php',
121
- 'Composer\\Installers\\JoomlaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/JoomlaInstaller.php',
122
- 'Composer\\Installers\\KanboardInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KanboardInstaller.php',
123
- 'Composer\\Installers\\KirbyInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KirbyInstaller.php',
124
- 'Composer\\Installers\\KnownInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KnownInstaller.php',
125
- 'Composer\\Installers\\KodiCMSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KodiCMSInstaller.php',
126
- 'Composer\\Installers\\KohanaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/KohanaInstaller.php',
127
- 'Composer\\Installers\\LanManagementSystemInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php',
128
- 'Composer\\Installers\\LaravelInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LaravelInstaller.php',
129
- 'Composer\\Installers\\LavaLiteInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LavaLiteInstaller.php',
130
- 'Composer\\Installers\\LithiumInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/LithiumInstaller.php',
131
- 'Composer\\Installers\\MODULEWorkInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php',
132
- 'Composer\\Installers\\MODXEvoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MODXEvoInstaller.php',
133
- 'Composer\\Installers\\MagentoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MagentoInstaller.php',
134
- 'Composer\\Installers\\MajimaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MajimaInstaller.php',
135
- 'Composer\\Installers\\MakoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MakoInstaller.php',
136
- 'Composer\\Installers\\MauticInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MauticInstaller.php',
137
- 'Composer\\Installers\\MayaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MayaInstaller.php',
138
- 'Composer\\Installers\\MediaWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MediaWikiInstaller.php',
139
- 'Composer\\Installers\\MicroweberInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MicroweberInstaller.php',
140
- 'Composer\\Installers\\ModxInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ModxInstaller.php',
141
- 'Composer\\Installers\\MoodleInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/MoodleInstaller.php',
142
- 'Composer\\Installers\\OctoberInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OctoberInstaller.php',
143
- 'Composer\\Installers\\OntoWikiInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OntoWikiInstaller.php',
144
- 'Composer\\Installers\\OsclassInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OsclassInstaller.php',
145
- 'Composer\\Installers\\OxidInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/OxidInstaller.php',
146
- 'Composer\\Installers\\PPIInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PPIInstaller.php',
147
- 'Composer\\Installers\\PhiftyInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PhiftyInstaller.php',
148
- 'Composer\\Installers\\PhpBBInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PhpBBInstaller.php',
149
- 'Composer\\Installers\\PimcoreInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PimcoreInstaller.php',
150
- 'Composer\\Installers\\PiwikInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PiwikInstaller.php',
151
- 'Composer\\Installers\\PlentymarketsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php',
152
- 'Composer\\Installers\\Plugin' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Plugin.php',
153
- 'Composer\\Installers\\PortoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PortoInstaller.php',
154
- 'Composer\\Installers\\PrestashopInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PrestashopInstaller.php',
155
- 'Composer\\Installers\\PuppetInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PuppetInstaller.php',
156
- 'Composer\\Installers\\PxcmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/PxcmsInstaller.php',
157
- 'Composer\\Installers\\RadPHPInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RadPHPInstaller.php',
158
- 'Composer\\Installers\\ReIndexInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ReIndexInstaller.php',
159
- 'Composer\\Installers\\Redaxo5Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Redaxo5Installer.php',
160
- 'Composer\\Installers\\RedaxoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RedaxoInstaller.php',
161
- 'Composer\\Installers\\RoundcubeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/RoundcubeInstaller.php',
162
- 'Composer\\Installers\\SMFInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SMFInstaller.php',
163
- 'Composer\\Installers\\ShopwareInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ShopwareInstaller.php',
164
- 'Composer\\Installers\\SilverStripeInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SilverStripeInstaller.php',
165
- 'Composer\\Installers\\SiteDirectInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SiteDirectInstaller.php',
166
- 'Composer\\Installers\\SyDESInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/SyDESInstaller.php',
167
- 'Composer\\Installers\\Symfony1Installer' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/Symfony1Installer.php',
168
- 'Composer\\Installers\\TYPO3CmsInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php',
169
- 'Composer\\Installers\\TYPO3FlowInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php',
170
- 'Composer\\Installers\\TaoInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TaoInstaller.php',
171
- 'Composer\\Installers\\TheliaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TheliaInstaller.php',
172
- 'Composer\\Installers\\TuskInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/TuskInstaller.php',
173
- 'Composer\\Installers\\UserFrostingInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/UserFrostingInstaller.php',
174
- 'Composer\\Installers\\VanillaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/VanillaInstaller.php',
175
- 'Composer\\Installers\\VgmcpInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/VgmcpInstaller.php',
176
- 'Composer\\Installers\\WHMCSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/WHMCSInstaller.php',
177
- 'Composer\\Installers\\WolfCMSInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/WolfCMSInstaller.php',
178
- 'Composer\\Installers\\WordPressInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/WordPressInstaller.php',
179
- 'Composer\\Installers\\YawikInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/YawikInstaller.php',
180
- 'Composer\\Installers\\ZendInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ZendInstaller.php',
181
- 'Composer\\Installers\\ZikulaInstaller' => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers/ZikulaInstaller.php',
182
- 'Routes' => __DIR__ . '/..' . '/upstatement/routes/Routes.php',
183
- 'Symfony\\Polyfill\\Ctype\\Ctype' => __DIR__ . '/..' . '/symfony/polyfill-ctype/Ctype.php',
184
- 'Timber\\Admin' => __DIR__ . '/../..' . '/lib/Admin.php',
185
- 'Timber\\Archives' => __DIR__ . '/../..' . '/lib/Archives.php',
186
- 'Timber\\Cache\\Cleaner' => __DIR__ . '/../..' . '/lib/Cache/Cleaner.php',
187
- 'Timber\\Cache\\KeyGenerator' => __DIR__ . '/../..' . '/lib/Cache/KeyGenerator.php',
188
- 'Timber\\Cache\\TimberKeyGeneratorInterface' => __DIR__ . '/../..' . '/lib/Cache/TimberKeyGeneratorInterface.php',
189
- 'Timber\\Cache\\WPObjectCacheAdapter' => __DIR__ . '/../..' . '/lib/Cache/WPObjectCacheAdapter.php',
190
- 'Timber\\Comment' => __DIR__ . '/../..' . '/lib/Comment.php',
191
- 'Timber\\CommentThread' => __DIR__ . '/../..' . '/lib/CommentThread.php',
192
- 'Timber\\Core' => __DIR__ . '/../..' . '/lib/Core.php',
193
- 'Timber\\CoreInterface' => __DIR__ . '/../..' . '/lib/CoreInterface.php',
194
- 'Timber\\FunctionWrapper' => __DIR__ . '/../..' . '/lib/FunctionWrapper.php',
195
- 'Timber\\Helper' => __DIR__ . '/../..' . '/lib/Helper.php',
196
- 'Timber\\Image' => __DIR__ . '/../..' . '/lib/Image.php',
197
- 'Timber\\ImageHelper' => __DIR__ . '/../..' . '/lib/ImageHelper.php',
198
- 'Timber\\Image\\Operation' => __DIR__ . '/../..' . '/lib/Image/Operation.php',
199
- 'Timber\\Image\\Operation\\Letterbox' => __DIR__ . '/../..' . '/lib/Image/Operation/Letterbox.php',
200
- 'Timber\\Image\\Operation\\Resize' => __DIR__ . '/../..' . '/lib/Image/Operation/Resize.php',
201
- 'Timber\\Image\\Operation\\Retina' => __DIR__ . '/../..' . '/lib/Image/Operation/Retina.php',
202
- 'Timber\\Image\\Operation\\ToJpg' => __DIR__ . '/../..' . '/lib/Image/Operation/ToJpg.php',
203
- 'Timber\\Image\\Operation\\ToWebp' => __DIR__ . '/../..' . '/lib/Image/Operation/ToWebp.php',
204
- 'Timber\\Integrations' => __DIR__ . '/../..' . '/lib/Integrations.php',
205
- 'Timber\\Integrations\\ACF' => __DIR__ . '/../..' . '/lib/Integrations/ACF.php',
206
- 'Timber\\Integrations\\CoAuthorsPlus' => __DIR__ . '/../..' . '/lib/Integrations/CoAuthorsPlus.php',
207
- 'Timber\\Integrations\\CoAuthorsPlusUser' => __DIR__ . '/../..' . '/lib/Integrations/CoAuthorsPlusUser.php',
208
- 'Timber\\Integrations\\Command' => __DIR__ . '/../..' . '/lib/Integrations/Command.php',
209
- 'Timber\\Integrations\\Timber_WP_CLI_Command' => __DIR__ . '/../..' . '/lib/Integrations/Timber_WP_CLI_Command.php',
210
- 'Timber\\Integrations\\WPML' => __DIR__ . '/../..' . '/lib/Integrations/WPML.php',
211
- 'Timber\\Loader' => __DIR__ . '/../..' . '/lib/Loader.php',
212
- 'Timber\\LocationManager' => __DIR__ . '/../..' . '/lib/LocationManager.php',
213
- 'Timber\\Menu' => __DIR__ . '/../..' . '/lib/Menu.php',
214
- 'Timber\\MenuItem' => __DIR__ . '/../..' . '/lib/MenuItem.php',
215
- 'Timber\\Pagination' => __DIR__ . '/../..' . '/lib/Pagination.php',
216
- 'Timber\\Post' => __DIR__ . '/../..' . '/lib/Post.php',
217
- 'Timber\\PostCollection' => __DIR__ . '/../..' . '/lib/PostCollection.php',
218
- 'Timber\\PostGetter' => __DIR__ . '/../..' . '/lib/PostGetter.php',
219
- 'Timber\\PostPreview' => __DIR__ . '/../..' . '/lib/PostPreview.php',
220
- 'Timber\\PostQuery' => __DIR__ . '/../..' . '/lib/PostQuery.php',
221
- 'Timber\\PostType' => __DIR__ . '/../..' . '/lib/PostType.php',
222
- 'Timber\\PostsIterator' => __DIR__ . '/../..' . '/lib/PostsIterator.php',
223
- 'Timber\\QueryIterator' => __DIR__ . '/../..' . '/lib/QueryIterator.php',
224
- 'Timber\\Request' => __DIR__ . '/../..' . '/lib/Request.php',
225
- 'Timber\\Site' => __DIR__ . '/../..' . '/lib/Site.php',
226
- 'Timber\\Term' => __DIR__ . '/../..' . '/lib/Term.php',
227
- 'Timber\\TermGetter' => __DIR__ . '/../..' . '/lib/TermGetter.php',
228
- 'Timber\\TextHelper' => __DIR__ . '/../..' . '/lib/TextHelper.php',
229
- 'Timber\\Theme' => __DIR__ . '/../..' . '/lib/Theme.php',
230
- 'Timber\\Timber' => __DIR__ . '/../..' . '/lib/Timber.php',
231
- 'Timber\\Twig' => __DIR__ . '/../..' . '/lib/Twig.php',
232
- 'Timber\\Twig_Filter' => __DIR__ . '/../..' . '/lib/Twig_Filter.php',
233
- 'Timber\\Twig_Function' => __DIR__ . '/../..' . '/lib/Twig_Function.php',
234
- 'Timber\\URLHelper' => __DIR__ . '/../..' . '/lib/URLHelper.php',
235
- 'Timber\\User' => __DIR__ . '/../..' . '/lib/User.php',
236
- 'Twig\\Cache\\CacheInterface' => __DIR__ . '/..' . '/twig/twig/src/Cache/CacheInterface.php',
237
- 'Twig\\Cache\\FilesystemCache' => __DIR__ . '/..' . '/twig/twig/src/Cache/FilesystemCache.php',
238
- 'Twig\\Cache\\NullCache' => __DIR__ . '/..' . '/twig/twig/src/Cache/NullCache.php',
239
- 'Twig\\Compiler' => __DIR__ . '/..' . '/twig/twig/src/Compiler.php',
240
- 'Twig\\Environment' => __DIR__ . '/..' . '/twig/twig/src/Environment.php',
241
- 'Twig\\Error\\Error' => __DIR__ . '/..' . '/twig/twig/src/Error/Error.php',
242
- 'Twig\\Error\\LoaderError' => __DIR__ . '/..' . '/twig/twig/src/Error/LoaderError.php',
243
- 'Twig\\Error\\RuntimeError' => __DIR__ . '/..' . '/twig/twig/src/Error/RuntimeError.php',
244
- 'Twig\\Error\\SyntaxError' => __DIR__ . '/..' . '/twig/twig/src/Error/SyntaxError.php',
245
- 'Twig\\ExpressionParser' => __DIR__ . '/..' . '/twig/twig/src/ExpressionParser.php',
246
- 'Twig\\Extension\\AbstractExtension' => __DIR__ . '/..' . '/twig/twig/src/Extension/AbstractExtension.php',
247
- 'Twig\\Extension\\CoreExtension' => __DIR__ . '/..' . '/twig/twig/src/Extension/CoreExtension.php',
248
- 'Twig\\Extension\\DebugExtension' => __DIR__ . '/..' . '/twig/twig/src/Extension/DebugExtension.php',
249
- 'Twig\\Extension\\EscaperExtension' => __DIR__ . '/..' . '/twig/twig/src/Extension/EscaperExtension.php',
250
- 'Twig\\Extension\\ExtensionInterface' => __DIR__ . '/..' . '/twig/twig/src/Extension/ExtensionInterface.php',
251
- 'Twig\\Extension\\GlobalsInterface' => __DIR__ . '/..' . '/twig/twig/src/Extension/GlobalsInterface.php',
252
- 'Twig\\Extension\\InitRuntimeInterface' => __DIR__ . '/..' . '/twig/twig/src/Extension/InitRuntimeInterface.php',
253
- 'Twig\\Extension\\OptimizerExtension' => __DIR__ . '/..' . '/twig/twig/src/Extension/OptimizerExtension.php',
254
- 'Twig\\Extension\\ProfilerExtension' => __DIR__ . '/..' . '/twig/twig/src/Extension/ProfilerExtension.php',
255
- 'Twig\\Extension\\RuntimeExtensionInterface' => __DIR__ . '/..' . '/twig/twig/src/Extension/RuntimeExtensionInterface.php',
256
- 'Twig\\Extension\\SandboxExtension' => __DIR__ . '/..' . '/twig/twig/src/Extension/SandboxExtension.php',
257
- 'Twig\\Extension\\StagingExtension' => __DIR__ . '/..' . '/twig/twig/src/Extension/StagingExtension.php',
258
- 'Twig\\Extension\\StringLoaderExtension' => __DIR__ . '/..' . '/twig/twig/src/Extension/StringLoaderExtension.php',
259
- 'Twig\\FileExtensionEscapingStrategy' => __DIR__ . '/..' . '/twig/twig/src/FileExtensionEscapingStrategy.php',
260
- 'Twig\\Lexer' => __DIR__ . '/..' . '/twig/twig/src/Lexer.php',
261
- 'Twig\\Loader\\ArrayLoader' => __DIR__ . '/..' . '/twig/twig/src/Loader/ArrayLoader.php',
262
- 'Twig\\Loader\\ChainLoader' => __DIR__ . '/..' . '/twig/twig/src/Loader/ChainLoader.php',
263
- 'Twig\\Loader\\ExistsLoaderInterface' => __DIR__ . '/..' . '/twig/twig/src/Loader/ExistsLoaderInterface.php',
264
- 'Twig\\Loader\\FilesystemLoader' => __DIR__ . '/..' . '/twig/twig/src/Loader/FilesystemLoader.php',
265
- 'Twig\\Loader\\LoaderInterface' => __DIR__ . '/..' . '/twig/twig/src/Loader/LoaderInterface.php',
266
- 'Twig\\Loader\\SourceContextLoaderInterface' => __DIR__ . '/..' . '/twig/twig/src/Loader/SourceContextLoaderInterface.php',
267
- 'Twig\\Markup' => __DIR__ . '/..' . '/twig/twig/src/Markup.php',
268
- 'Twig\\NodeTraverser' => __DIR__ . '/..' . '/twig/twig/src/NodeTraverser.php',
269
- 'Twig\\NodeVisitor\\AbstractNodeVisitor' => __DIR__ . '/..' . '/twig/twig/src/NodeVisitor/AbstractNodeVisitor.php',
270
- 'Twig\\NodeVisitor\\EscaperNodeVisitor' => __DIR__ . '/..' . '/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php',
271
- 'Twig\\NodeVisitor\\NodeVisitorInterface' => __DIR__ . '/..' . '/twig/twig/src/NodeVisitor/NodeVisitorInterface.php',
272
- 'Twig\\NodeVisitor\\OptimizerNodeVisitor' => __DIR__ . '/..' . '/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php',
273
- 'Twig\\NodeVisitor\\SafeAnalysisNodeVisitor' => __DIR__ . '/..' . '/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php',
274
- 'Twig\\NodeVisitor\\SandboxNodeVisitor' => __DIR__ . '/..' . '/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php',
275
- 'Twig\\Node\\AutoEscapeNode' => __DIR__ . '/..' . '/twig/twig/src/Node/AutoEscapeNode.php',
276
- 'Twig\\Node\\BlockNode' => __DIR__ . '/..' . '/twig/twig/src/Node/BlockNode.php',
277
- 'Twig\\Node\\BlockReferenceNode' => __DIR__ . '/..' . '/twig/twig/src/Node/BlockReferenceNode.php',
278
- 'Twig\\Node\\BodyNode' => __DIR__ . '/..' . '/twig/twig/src/Node/BodyNode.php',
279
- 'Twig\\Node\\CheckSecurityNode' => __DIR__ . '/..' . '/twig/twig/src/Node/CheckSecurityNode.php',
280
- 'Twig\\Node\\CheckToStringNode' => __DIR__ . '/..' . '/twig/twig/src/Node/CheckToStringNode.php',
281
- 'Twig\\Node\\DeprecatedNode' => __DIR__ . '/..' . '/twig/twig/src/Node/DeprecatedNode.php',
282
- 'Twig\\Node\\DoNode' => __DIR__ . '/..' . '/twig/twig/src/Node/DoNode.php',
283
- 'Twig\\Node\\EmbedNode' => __DIR__ . '/..' . '/twig/twig/src/Node/EmbedNode.php',
284
- 'Twig\\Node\\Expression\\AbstractExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/AbstractExpression.php',
285
- 'Twig\\Node\\Expression\\ArrayExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/ArrayExpression.php',
286
- 'Twig\\Node\\Expression\\ArrowFunctionExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/ArrowFunctionExpression.php',
287
- 'Twig\\Node\\Expression\\AssignNameExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/AssignNameExpression.php',
288
- 'Twig\\Node\\Expression\\Binary\\AbstractBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/AbstractBinary.php',
289
- 'Twig\\Node\\Expression\\Binary\\AddBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/AddBinary.php',
290
- 'Twig\\Node\\Expression\\Binary\\AndBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/AndBinary.php',
291
- 'Twig\\Node\\Expression\\Binary\\BitwiseAndBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/BitwiseAndBinary.php',
292
- 'Twig\\Node\\Expression\\Binary\\BitwiseOrBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/BitwiseOrBinary.php',
293
- 'Twig\\Node\\Expression\\Binary\\BitwiseXorBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/BitwiseXorBinary.php',
294
- 'Twig\\Node\\Expression\\Binary\\ConcatBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/ConcatBinary.php',
295
- 'Twig\\Node\\Expression\\Binary\\DivBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/DivBinary.php',
296
- 'Twig\\Node\\Expression\\Binary\\EndsWithBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php',
297
- 'Twig\\Node\\Expression\\Binary\\EqualBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/EqualBinary.php',
298
- 'Twig\\Node\\Expression\\Binary\\FloorDivBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/FloorDivBinary.php',
299
- 'Twig\\Node\\Expression\\Binary\\GreaterBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/GreaterBinary.php',
300
- 'Twig\\Node\\Expression\\Binary\\GreaterEqualBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/GreaterEqualBinary.php',
301
- 'Twig\\Node\\Expression\\Binary\\InBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/InBinary.php',
302
- 'Twig\\Node\\Expression\\Binary\\LessBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/LessBinary.php',
303
- 'Twig\\Node\\Expression\\Binary\\LessEqualBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/LessEqualBinary.php',
304
- 'Twig\\Node\\Expression\\Binary\\MatchesBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/MatchesBinary.php',
305
- 'Twig\\Node\\Expression\\Binary\\ModBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/ModBinary.php',
306
- 'Twig\\Node\\Expression\\Binary\\MulBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/MulBinary.php',
307
- 'Twig\\Node\\Expression\\Binary\\NotEqualBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/NotEqualBinary.php',
308
- 'Twig\\Node\\Expression\\Binary\\NotInBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/NotInBinary.php',
309
- 'Twig\\Node\\Expression\\Binary\\OrBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/OrBinary.php',
310
- 'Twig\\Node\\Expression\\Binary\\PowerBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/PowerBinary.php',
311
- 'Twig\\Node\\Expression\\Binary\\RangeBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/RangeBinary.php',
312
- 'Twig\\Node\\Expression\\Binary\\StartsWithBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php',
313
- 'Twig\\Node\\Expression\\Binary\\SubBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/SubBinary.php',
314
- 'Twig\\Node\\Expression\\BlockReferenceExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/BlockReferenceExpression.php',
315
- 'Twig\\Node\\Expression\\CallExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/CallExpression.php',
316
- 'Twig\\Node\\Expression\\ConditionalExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/ConditionalExpression.php',
317
- 'Twig\\Node\\Expression\\ConstantExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/ConstantExpression.php',
318
- 'Twig\\Node\\Expression\\FilterExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/FilterExpression.php',
319
- 'Twig\\Node\\Expression\\Filter\\DefaultFilter' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Filter/DefaultFilter.php',
320
- 'Twig\\Node\\Expression\\FunctionExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/FunctionExpression.php',
321
- 'Twig\\Node\\Expression\\GetAttrExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/GetAttrExpression.php',
322
- 'Twig\\Node\\Expression\\InlinePrint' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/InlinePrint.php',
323
- 'Twig\\Node\\Expression\\MethodCallExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/MethodCallExpression.php',
324
- 'Twig\\Node\\Expression\\NameExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/NameExpression.php',
325
- 'Twig\\Node\\Expression\\NullCoalesceExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/NullCoalesceExpression.php',
326
- 'Twig\\Node\\Expression\\ParentExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/ParentExpression.php',
327
- 'Twig\\Node\\Expression\\TempNameExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/TempNameExpression.php',
328
- 'Twig\\Node\\Expression\\TestExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/TestExpression.php',
329
- 'Twig\\Node\\Expression\\Test\\ConstantTest' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Test/ConstantTest.php',
330
- 'Twig\\Node\\Expression\\Test\\DefinedTest' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Test/DefinedTest.php',
331
- 'Twig\\Node\\Expression\\Test\\DivisiblebyTest' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Test/DivisiblebyTest.php',
332
- 'Twig\\Node\\Expression\\Test\\EvenTest' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Test/EvenTest.php',
333
- 'Twig\\Node\\Expression\\Test\\NullTest' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Test/NullTest.php',
334
- 'Twig\\Node\\Expression\\Test\\OddTest' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Test/OddTest.php',
335
- 'Twig\\Node\\Expression\\Test\\SameasTest' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Test/SameasTest.php',
336
- 'Twig\\Node\\Expression\\Unary\\AbstractUnary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Unary/AbstractUnary.php',
337
- 'Twig\\Node\\Expression\\Unary\\NegUnary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Unary/NegUnary.php',
338
- 'Twig\\Node\\Expression\\Unary\\NotUnary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Unary/NotUnary.php',
339
- 'Twig\\Node\\Expression\\Unary\\PosUnary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Unary/PosUnary.php',
340
- 'Twig\\Node\\FlushNode' => __DIR__ . '/..' . '/twig/twig/src/Node/FlushNode.php',
341
- 'Twig\\Node\\ForLoopNode' => __DIR__ . '/..' . '/twig/twig/src/Node/ForLoopNode.php',
342
- 'Twig\\Node\\ForNode' => __DIR__ . '/..' . '/twig/twig/src/Node/ForNode.php',
343
- 'Twig\\Node\\IfNode' => __DIR__ . '/..' . '/twig/twig/src/Node/IfNode.php',
344
- 'Twig\\Node\\ImportNode' => __DIR__ . '/..' . '/twig/twig/src/Node/ImportNode.php',
345
- 'Twig\\Node\\IncludeNode' => __DIR__ . '/..' . '/twig/twig/src/Node/IncludeNode.php',
346
- 'Twig\\Node\\MacroNode' => __DIR__ . '/..' . '/twig/twig/src/Node/MacroNode.php',
347
- 'Twig\\Node\\ModuleNode' => __DIR__ . '/..' . '/twig/twig/src/Node/ModuleNode.php',
348
- 'Twig\\Node\\Node' => __DIR__ . '/..' . '/twig/twig/src/Node/Node.php',
349
- 'Twig\\Node\\NodeCaptureInterface' => __DIR__ . '/..' . '/twig/twig/src/Node/NodeCaptureInterface.php',
350
- 'Twig\\Node\\NodeOutputInterface' => __DIR__ . '/..' . '/twig/twig/src/Node/NodeOutputInterface.php',
351
- 'Twig\\Node\\PrintNode' => __DIR__ . '/..' . '/twig/twig/src/Node/PrintNode.php',
352
- 'Twig\\Node\\SandboxNode' => __DIR__ . '/..' . '/twig/twig/src/Node/SandboxNode.php',
353
- 'Twig\\Node\\SandboxedPrintNode' => __DIR__ . '/..' . '/twig/twig/src/Node/SandboxedPrintNode.php',
354
- 'Twig\\Node\\SetNode' => __DIR__ . '/..' . '/twig/twig/src/Node/SetNode.php',
355
- 'Twig\\Node\\SetTempNode' => __DIR__ . '/..' . '/twig/twig/src/Node/SetTempNode.php',
356
- 'Twig\\Node\\SpacelessNode' => __DIR__ . '/..' . '/twig/twig/src/Node/SpacelessNode.php',
357
- 'Twig\\Node\\TextNode' => __DIR__ . '/..' . '/twig/twig/src/Node/TextNode.php',
358
- 'Twig\\Node\\WithNode' => __DIR__ . '/..' . '/twig/twig/src/Node/WithNode.php',
359
- 'Twig\\Parser' => __DIR__ . '/..' . '/twig/twig/src/Parser.php',
360
- 'Twig\\Profiler\\Dumper\\BaseDumper' => __DIR__ . '/..' . '/twig/twig/src/Profiler/Dumper/BaseDumper.php',
361
- 'Twig\\Profiler\\Dumper\\BlackfireDumper' => __DIR__ . '/..' . '/twig/twig/src/Profiler/Dumper/BlackfireDumper.php',
362
- 'Twig\\Profiler\\Dumper\\HtmlDumper' => __DIR__ . '/..' . '/twig/twig/src/Profiler/Dumper/HtmlDumper.php',
363
- 'Twig\\Profiler\\Dumper\\TextDumper' => __DIR__ . '/..' . '/twig/twig/src/Profiler/Dumper/TextDumper.php',
364
- 'Twig\\Profiler\\NodeVisitor\\ProfilerNodeVisitor' => __DIR__ . '/..' . '/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php',
365
- 'Twig\\Profiler\\Node\\EnterProfileNode' => __DIR__ . '/..' . '/twig/twig/src/Profiler/Node/EnterProfileNode.php',
366
- 'Twig\\Profiler\\Node\\LeaveProfileNode' => __DIR__ . '/..' . '/twig/twig/src/Profiler/Node/LeaveProfileNode.php',
367
- 'Twig\\Profiler\\Profile' => __DIR__ . '/..' . '/twig/twig/src/Profiler/Profile.php',
368
- 'Twig\\RuntimeLoader\\ContainerRuntimeLoader' => __DIR__ . '/..' . '/twig/twig/src/RuntimeLoader/ContainerRuntimeLoader.php',
369
- 'Twig\\RuntimeLoader\\FactoryRuntimeLoader' => __DIR__ . '/..' . '/twig/twig/src/RuntimeLoader/FactoryRuntimeLoader.php',
370
- 'Twig\\RuntimeLoader\\RuntimeLoaderInterface' => __DIR__ . '/..' . '/twig/twig/src/RuntimeLoader/RuntimeLoaderInterface.php',
371
- 'Twig\\Sandbox\\SecurityError' => __DIR__ . '/..' . '/twig/twig/src/Sandbox/SecurityError.php',
372
- 'Twig\\Sandbox\\SecurityNotAllowedFilterError' => __DIR__ . '/..' . '/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php',
373
- 'Twig\\Sandbox\\SecurityNotAllowedFunctionError' => __DIR__ . '/..' . '/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php',
374
- 'Twig\\Sandbox\\SecurityNotAllowedMethodError' => __DIR__ . '/..' . '/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php',
375
- 'Twig\\Sandbox\\SecurityNotAllowedPropertyError' => __DIR__ . '/..' . '/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php',
376
- 'Twig\\Sandbox\\SecurityNotAllowedTagError' => __DIR__ . '/..' . '/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php',
377
- 'Twig\\Sandbox\\SecurityPolicy' => __DIR__ . '/..' . '/twig/twig/src/Sandbox/SecurityPolicy.php',
378
- 'Twig\\Sandbox\\SecurityPolicyInterface' => __DIR__ . '/..' . '/twig/twig/src/Sandbox/SecurityPolicyInterface.php',
379
- 'Twig\\Source' => __DIR__ . '/..' . '/twig/twig/src/Source.php',
380
- 'Twig\\Template' => __DIR__ . '/..' . '/twig/twig/src/Template.php',
381
- 'Twig\\TemplateWrapper' => __DIR__ . '/..' . '/twig/twig/src/TemplateWrapper.php',
382
- 'Twig\\Test\\IntegrationTestCase' => __DIR__ . '/..' . '/twig/twig/src/Test/IntegrationTestCase.php',
383
- 'Twig\\Test\\NodeTestCase' => __DIR__ . '/..' . '/twig/twig/src/Test/NodeTestCase.php',
384
- 'Twig\\Token' => __DIR__ . '/..' . '/twig/twig/src/Token.php',
385
- 'Twig\\TokenParser\\AbstractTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/AbstractTokenParser.php',
386
- 'Twig\\TokenParser\\ApplyTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/ApplyTokenParser.php',
387
- 'Twig\\TokenParser\\AutoEscapeTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/AutoEscapeTokenParser.php',
388
- 'Twig\\TokenParser\\BlockTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/BlockTokenParser.php',
389
- 'Twig\\TokenParser\\DeprecatedTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/DeprecatedTokenParser.php',
390
- 'Twig\\TokenParser\\DoTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/DoTokenParser.php',
391
- 'Twig\\TokenParser\\EmbedTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/EmbedTokenParser.php',
392
- 'Twig\\TokenParser\\ExtendsTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/ExtendsTokenParser.php',
393
- 'Twig\\TokenParser\\FilterTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/FilterTokenParser.php',
394
- 'Twig\\TokenParser\\FlushTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/FlushTokenParser.php',
395
- 'Twig\\TokenParser\\ForTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/ForTokenParser.php',
396
- 'Twig\\TokenParser\\FromTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/FromTokenParser.php',
397
- 'Twig\\TokenParser\\IfTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/IfTokenParser.php',
398
- 'Twig\\TokenParser\\ImportTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/ImportTokenParser.php',
399
- 'Twig\\TokenParser\\IncludeTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/IncludeTokenParser.php',
400
- 'Twig\\TokenParser\\MacroTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/MacroTokenParser.php',
401
- 'Twig\\TokenParser\\SandboxTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/SandboxTokenParser.php',
402
- 'Twig\\TokenParser\\SetTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/SetTokenParser.php',
403
- 'Twig\\TokenParser\\SpacelessTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/SpacelessTokenParser.php',
404
- 'Twig\\TokenParser\\TokenParserInterface' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/TokenParserInterface.php',
405
- 'Twig\\TokenParser\\UseTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/UseTokenParser.php',
406
- 'Twig\\TokenParser\\WithTokenParser' => __DIR__ . '/..' . '/twig/twig/src/TokenParser/WithTokenParser.php',
407
- 'Twig\\TokenStream' => __DIR__ . '/..' . '/twig/twig/src/TokenStream.php',
408
- 'Twig\\TwigFilter' => __DIR__ . '/..' . '/twig/twig/src/TwigFilter.php',
409
- 'Twig\\TwigFunction' => __DIR__ . '/..' . '/twig/twig/src/TwigFunction.php',
410
- 'Twig\\TwigTest' => __DIR__ . '/..' . '/twig/twig/src/TwigTest.php',
411
- 'Twig\\Util\\DeprecationCollector' => __DIR__ . '/..' . '/twig/twig/src/Util/DeprecationCollector.php',
412
- 'Twig\\Util\\TemplateDirIterator' => __DIR__ . '/..' . '/twig/twig/src/Util/TemplateDirIterator.php',
413
- 'Twig_Autoloader' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Autoloader.php',
414
- 'Twig_BaseNodeVisitor' => __DIR__ . '/..' . '/twig/twig/lib/Twig/BaseNodeVisitor.php',
415
- 'Twig_CacheInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/CacheInterface.php',
416
- 'Twig_Cache_Filesystem' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Cache/Filesystem.php',
417
- 'Twig_Cache_Null' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Cache/Null.php',
418
- 'Twig_Compiler' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Compiler.php',
419
- 'Twig_CompilerInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/CompilerInterface.php',
420
- 'Twig_ContainerRuntimeLoader' => __DIR__ . '/..' . '/twig/twig/lib/Twig/ContainerRuntimeLoader.php',
421
- 'Twig_Environment' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Environment.php',
422
- 'Twig_Error' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Error.php',
423
- 'Twig_Error_Loader' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Error/Loader.php',
424
- 'Twig_Error_Runtime' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Error/Runtime.php',
425
- 'Twig_Error_Syntax' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Error/Syntax.php',
426
- 'Twig_ExistsLoaderInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/ExistsLoaderInterface.php',
427
- 'Twig_ExpressionParser' => __DIR__ . '/..' . '/twig/twig/lib/Twig/ExpressionParser.php',
428
- 'Twig_Extension' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension.php',
429
- 'Twig_ExtensionInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/ExtensionInterface.php',
430
- 'Twig_Extension_Core' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Core.php',
431
- 'Twig_Extension_Debug' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Debug.php',
432
- 'Twig_Extension_Escaper' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Escaper.php',
433
- 'Twig_Extension_GlobalsInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/GlobalsInterface.php',
434
- 'Twig_Extension_InitRuntimeInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/InitRuntimeInterface.php',
435
- 'Twig_Extension_Optimizer' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Optimizer.php',
436
- 'Twig_Extension_Profiler' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Profiler.php',
437
- 'Twig_Extension_Sandbox' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Sandbox.php',
438
- 'Twig_Extension_Staging' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/Staging.php',
439
- 'Twig_Extension_StringLoader' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Extension/StringLoader.php',
440
- 'Twig_FactoryRuntimeLoader' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FactoryRuntimeLoader.php',
441
- 'Twig_FileExtensionEscapingStrategy' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php',
442
- 'Twig_Filter' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Filter.php',
443
- 'Twig_FilterCallableInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FilterCallableInterface.php',
444
- 'Twig_FilterInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FilterInterface.php',
445
- 'Twig_Filter_Function' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Filter/Function.php',
446
- 'Twig_Filter_Method' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Filter/Method.php',
447
- 'Twig_Filter_Node' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Filter/Node.php',
448
- 'Twig_Function' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Function.php',
449
- 'Twig_FunctionCallableInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FunctionCallableInterface.php',
450
- 'Twig_FunctionInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/FunctionInterface.php',
451
- 'Twig_Function_Function' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Function/Function.php',
452
- 'Twig_Function_Method' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Function/Method.php',
453
- 'Twig_Function_Node' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Function/Node.php',
454
- 'Twig_Lexer' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Lexer.php',
455
- 'Twig_LexerInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/LexerInterface.php',
456
- 'Twig_LoaderInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/LoaderInterface.php',
457
- 'Twig_Loader_Array' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Loader/Array.php',
458
- 'Twig_Loader_Chain' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Loader/Chain.php',
459
- 'Twig_Loader_Filesystem' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Loader/Filesystem.php',
460
- 'Twig_Loader_String' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Loader/String.php',
461
- 'Twig_Markup' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Markup.php',
462
- 'Twig_Node' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node.php',
463
- 'Twig_NodeCaptureInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeCaptureInterface.php',
464
- 'Twig_NodeInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeInterface.php',
465
- 'Twig_NodeOutputInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeOutputInterface.php',
466
- 'Twig_NodeTraverser' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeTraverser.php',
467
- 'Twig_NodeVisitorInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeVisitorInterface.php',
468
- 'Twig_NodeVisitor_Escaper' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeVisitor/Escaper.php',
469
- 'Twig_NodeVisitor_Optimizer' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeVisitor/Optimizer.php',
470
- 'Twig_NodeVisitor_SafeAnalysis' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php',
471
- 'Twig_NodeVisitor_Sandbox' => __DIR__ . '/..' . '/twig/twig/lib/Twig/NodeVisitor/Sandbox.php',
472
- 'Twig_Node_AutoEscape' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/AutoEscape.php',
473
- 'Twig_Node_Block' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Block.php',
474
- 'Twig_Node_BlockReference' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/BlockReference.php',
475
- 'Twig_Node_Body' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Body.php',
476
- 'Twig_Node_CheckSecurity' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/CheckSecurity.php',
477
- 'Twig_Node_Deprecated' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Deprecated.php',
478
- 'Twig_Node_Do' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Do.php',
479
- 'Twig_Node_Embed' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Embed.php',
480
- 'Twig_Node_Expression' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression.php',
481
- 'Twig_Node_Expression_Array' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Array.php',
482
- 'Twig_Node_Expression_AssignName' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/AssignName.php',
483
- 'Twig_Node_Expression_Binary' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary.php',
484
- 'Twig_Node_Expression_Binary_Add' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Add.php',
485
- 'Twig_Node_Expression_Binary_And' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/And.php',
486
- 'Twig_Node_Expression_Binary_BitwiseAnd' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php',
487
- 'Twig_Node_Expression_Binary_BitwiseOr' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php',
488
- 'Twig_Node_Expression_Binary_BitwiseXor' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php',
489
- 'Twig_Node_Expression_Binary_Concat' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php',
490
- 'Twig_Node_Expression_Binary_Div' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Div.php',
491
- 'Twig_Node_Expression_Binary_EndsWith' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php',
492
- 'Twig_Node_Expression_Binary_Equal' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php',
493
- 'Twig_Node_Expression_Binary_FloorDiv' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php',
494
- 'Twig_Node_Expression_Binary_Greater' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php',
495
- 'Twig_Node_Expression_Binary_GreaterEqual' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php',
496
- 'Twig_Node_Expression_Binary_In' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/In.php',
497
- 'Twig_Node_Expression_Binary_Less' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Less.php',
498
- 'Twig_Node_Expression_Binary_LessEqual' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php',
499
- 'Twig_Node_Expression_Binary_Matches' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php',
500
- 'Twig_Node_Expression_Binary_Mod' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php',
501
- 'Twig_Node_Expression_Binary_Mul' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php',
502
- 'Twig_Node_Expression_Binary_NotEqual' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php',
503
- 'Twig_Node_Expression_Binary_NotIn' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php',
504
- 'Twig_Node_Expression_Binary_Or' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Or.php',
505
- 'Twig_Node_Expression_Binary_Power' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Power.php',
506
- 'Twig_Node_Expression_Binary_Range' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Range.php',
507
- 'Twig_Node_Expression_Binary_StartsWith' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php',
508
- 'Twig_Node_Expression_Binary_Sub' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php',
509
- 'Twig_Node_Expression_BlockReference' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/BlockReference.php',
510
- 'Twig_Node_Expression_Call' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Call.php',
511
- 'Twig_Node_Expression_Conditional' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Conditional.php',
512
- 'Twig_Node_Expression_Constant' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Constant.php',
513
- 'Twig_Node_Expression_ExtensionReference' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php',
514
- 'Twig_Node_Expression_Filter' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Filter.php',
515
- 'Twig_Node_Expression_Filter_Default' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Filter/Default.php',
516
- 'Twig_Node_Expression_Function' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Function.php',
517
- 'Twig_Node_Expression_GetAttr' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/GetAttr.php',
518
- 'Twig_Node_Expression_MethodCall' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/MethodCall.php',
519
- 'Twig_Node_Expression_Name' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Name.php',
520
- 'Twig_Node_Expression_NullCoalesce' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/NullCoalesce.php',
521
- 'Twig_Node_Expression_Parent' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Parent.php',
522
- 'Twig_Node_Expression_TempName' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/TempName.php',
523
- 'Twig_Node_Expression_Test' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test.php',
524
- 'Twig_Node_Expression_Test_Constant' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Constant.php',
525
- 'Twig_Node_Expression_Test_Defined' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Defined.php',
526
- 'Twig_Node_Expression_Test_Divisibleby' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php',
527
- 'Twig_Node_Expression_Test_Even' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Even.php',
528
- 'Twig_Node_Expression_Test_Null' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Null.php',
529
- 'Twig_Node_Expression_Test_Odd' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Odd.php',
530
- 'Twig_Node_Expression_Test_Sameas' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php',
531
- 'Twig_Node_Expression_Unary' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Unary.php',
532
- 'Twig_Node_Expression_Unary_Neg' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php',
533
- 'Twig_Node_Expression_Unary_Not' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Unary/Not.php',
534
- 'Twig_Node_Expression_Unary_Pos' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php',
535
- 'Twig_Node_Flush' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Flush.php',
536
- 'Twig_Node_For' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/For.php',
537
- 'Twig_Node_ForLoop' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/ForLoop.php',
538
- 'Twig_Node_If' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/If.php',
539
- 'Twig_Node_Import' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Import.php',
540
- 'Twig_Node_Include' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Include.php',
541
- 'Twig_Node_Macro' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Macro.php',
542
- 'Twig_Node_Module' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Module.php',
543
- 'Twig_Node_Print' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Print.php',
544
- 'Twig_Node_Sandbox' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Sandbox.php',
545
- 'Twig_Node_SandboxedPrint' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/SandboxedPrint.php',
546
- 'Twig_Node_Set' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Set.php',
547
- 'Twig_Node_SetTemp' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/SetTemp.php',
548
- 'Twig_Node_Spaceless' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Spaceless.php',
549
- 'Twig_Node_Text' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/Text.php',
550
- 'Twig_Node_With' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Node/With.php',
551
- 'Twig_Parser' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Parser.php',
552
- 'Twig_ParserInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/ParserInterface.php',
553
- 'Twig_Profiler_Dumper_Base' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Dumper/Base.php',
554
- 'Twig_Profiler_Dumper_Blackfire' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php',
555
- 'Twig_Profiler_Dumper_Html' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Dumper/Html.php',
556
- 'Twig_Profiler_Dumper_Text' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Dumper/Text.php',
557
- 'Twig_Profiler_NodeVisitor_Profiler' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php',
558
- 'Twig_Profiler_Node_EnterProfile' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php',
559
- 'Twig_Profiler_Node_LeaveProfile' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Node/LeaveProfile.php',
560
- 'Twig_Profiler_Profile' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Profiler/Profile.php',
561
- 'Twig_RuntimeLoaderInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/RuntimeLoaderInterface.php',
562
- 'Twig_Sandbox_SecurityError' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityError.php',
563
- 'Twig_Sandbox_SecurityNotAllowedFilterError' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php',
564
- 'Twig_Sandbox_SecurityNotAllowedFunctionError' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php',
565
- 'Twig_Sandbox_SecurityNotAllowedMethodError' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedMethodError.php',
566
- 'Twig_Sandbox_SecurityNotAllowedPropertyError' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedPropertyError.php',
567
- 'Twig_Sandbox_SecurityNotAllowedTagError' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php',
568
- 'Twig_Sandbox_SecurityPolicy' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php',
569
- 'Twig_Sandbox_SecurityPolicyInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php',
570
- 'Twig_SimpleFilter' => __DIR__ . '/..' . '/twig/twig/lib/Twig/SimpleFilter.php',
571
- 'Twig_SimpleFunction' => __DIR__ . '/..' . '/twig/twig/lib/Twig/SimpleFunction.php',
572
- 'Twig_SimpleTest' => __DIR__ . '/..' . '/twig/twig/lib/Twig/SimpleTest.php',
573
- 'Twig_Source' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Source.php',
574
- 'Twig_SourceContextLoaderInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/SourceContextLoaderInterface.php',
575
- 'Twig_Template' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Template.php',
576
- 'Twig_TemplateInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TemplateInterface.php',
577
- 'Twig_TemplateWrapper' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TemplateWrapper.php',
578
- 'Twig_Test' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test.php',
579
- 'Twig_TestCallableInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TestCallableInterface.php',
580
- 'Twig_TestInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TestInterface.php',
581
- 'Twig_Test_Function' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test/Function.php',
582
- 'Twig_Test_IntegrationTestCase' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test/IntegrationTestCase.php',
583
- 'Twig_Test_Method' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test/Method.php',
584
- 'Twig_Test_Node' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test/Node.php',
585
- 'Twig_Test_NodeTestCase' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Test/NodeTestCase.php',
586
- 'Twig_Token' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Token.php',
587
- 'Twig_TokenParser' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser.php',
588
- 'Twig_TokenParserBroker' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParserBroker.php',
589
- 'Twig_TokenParserBrokerInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParserBrokerInterface.php',
590
- 'Twig_TokenParserInterface' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParserInterface.php',
591
- 'Twig_TokenParser_AutoEscape' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/AutoEscape.php',
592
- 'Twig_TokenParser_Block' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Block.php',
593
- 'Twig_TokenParser_Deprecated' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Deprecated.php',
594
- 'Twig_TokenParser_Do' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Do.php',
595
- 'Twig_TokenParser_Embed' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Embed.php',
596
- 'Twig_TokenParser_Extends' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Extends.php',
597
- 'Twig_TokenParser_Filter' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Filter.php',
598
- 'Twig_TokenParser_Flush' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Flush.php',
599
- 'Twig_TokenParser_For' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/For.php',
600
- 'Twig_TokenParser_From' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/From.php',
601
- 'Twig_TokenParser_If' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/If.php',
602
- 'Twig_TokenParser_Import' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Import.php',
603
- 'Twig_TokenParser_Include' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Include.php',
604
- 'Twig_TokenParser_Macro' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Macro.php',
605
- 'Twig_TokenParser_Sandbox' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Sandbox.php',
606
- 'Twig_TokenParser_Set' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Set.php',
607
- 'Twig_TokenParser_Spaceless' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Spaceless.php',
608
- 'Twig_TokenParser_Use' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/Use.php',
609
- 'Twig_TokenParser_With' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenParser/With.php',
610
- 'Twig_TokenStream' => __DIR__ . '/..' . '/twig/twig/lib/Twig/TokenStream.php',
611
- 'Twig_Util_DeprecationCollector' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Util/DeprecationCollector.php',
612
- 'Twig_Util_TemplateDirIterator' => __DIR__ . '/..' . '/twig/twig/lib/Twig/Util/TemplateDirIterator.php',
613
- );
614
-
615
- public static function getInitializer(ClassLoader $loader)
616
- {
617
- return \Closure::bind(function () use ($loader) {
618
- $loader->prefixLengthsPsr4 = ComposerStaticInit5cc6415a5b760b89bb0a84ca350b6b2a::$prefixLengthsPsr4;
619
- $loader->prefixDirsPsr4 = ComposerStaticInit5cc6415a5b760b89bb0a84ca350b6b2a::$prefixDirsPsr4;
620
- $loader->fallbackDirsPsr4 = ComposerStaticInit5cc6415a5b760b89bb0a84ca350b6b2a::$fallbackDirsPsr4;
621
- $loader->prefixesPsr0 = ComposerStaticInit5cc6415a5b760b89bb0a84ca350b6b2a::$prefixesPsr0;
622
- $loader->classMap = ComposerStaticInit5cc6415a5b760b89bb0a84ca350b6b2a::$classMap;
623
-
624
- }, null, ClassLoader::class);
625
- }
626
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installed.json DELETED
@@ -1,420 +0,0 @@
1
- [
2
- {
3
- "name": "altorouter/altorouter",
4
- "version": "v1.2.0",
5
- "version_normalized": "1.2.0.0",
6
- "source": {
7
- "type": "git",
8
- "url": "https://github.com/dannyvankooten/AltoRouter.git",
9
- "reference": "39c50092470128c12284d332bb57f306bb5b58e4"
10
- },
11
- "dist": {
12
- "type": "zip",
13
- "url": "https://api.github.com/repos/dannyvankooten/AltoRouter/zipball/39c50092470128c12284d332bb57f306bb5b58e4",
14
- "reference": "39c50092470128c12284d332bb57f306bb5b58e4",
15
- "shasum": ""
16
- },
17
- "require": {
18
- "php": ">=5.3.0"
19
- },
20
- "require-dev": {
21
- "codeclimate/php-test-reporter": "dev-master",
22
- "phpunit/phpunit": "4.5.*"
23
- },
24
- "time": "2015-11-30T00:47:43+00:00",
25
- "type": "library",
26
- "installation-source": "dist",
27
- "autoload": {
28
- "classmap": [
29
- "AltoRouter.php"
30
- ]
31
- },
32
- "notification-url": "https://packagist.org/downloads/",
33
- "license": [
34
- "MIT"
35
- ],
36
- "authors": [
37
- {
38
- "name": "Danny van Kooten",
39
- "email": "dannyvankooten@gmail.com",
40
- "homepage": "http://dannyvankooten.com/"
41
- },
42
- {
43
- "name": "Koen Punt",
44
- "homepage": "https://github.com/koenpunt"
45
- },
46
- {
47
- "name": "niahoo",
48
- "homepage": "https://github.com/niahoo"
49
- }
50
- ],
51
- "description": "A lightning fast router for PHP",
52
- "homepage": "https://github.com/dannyvankooten/AltoRouter",
53
- "keywords": [
54
- "lightweight",
55
- "router",
56
- "routing"
57
- ]
58
- },
59
- {
60
- "name": "asm89/twig-cache-extension",
61
- "version": "1.3.2",
62
- "version_normalized": "1.3.2.0",
63
- "source": {
64
- "type": "git",
65
- "url": "https://github.com/asm89/twig-cache-extension.git",
66
- "reference": "630ea7abdc3fc62ba6786c02590a1560e449cf55"
67
- },
68
- "dist": {
69
- "type": "zip",
70
- "url": "https://api.github.com/repos/asm89/twig-cache-extension/zipball/630ea7abdc3fc62ba6786c02590a1560e449cf55",
71
- "reference": "630ea7abdc3fc62ba6786c02590a1560e449cf55",
72
- "shasum": ""
73
- },
74
- "require": {
75
- "php": ">=5.3.2",
76
- "twig/twig": "^1.0|^2.0"
77
- },
78
- "require-dev": {
79
- "doctrine/cache": "~1.0"
80
- },
81
- "suggest": {
82
- "psr/cache-implementation": "To make use of PSR-6 cache implementation via PsrCacheAdapter."
83
- },
84
- "time": "2017-01-10T22:04:15+00:00",
85
- "type": "library",
86
- "extra": {
87
- "branch-alias": {
88
- "dev-master": "1.3-dev"
89
- }
90
- },
91
- "installation-source": "dist",
92
- "autoload": {
93
- "psr-4": {
94
- "": "lib/"
95
- }
96
- },
97
- "notification-url": "https://packagist.org/downloads/",
98
- "license": [
99
- "MIT"
100
- ],
101
- "authors": [
102
- {
103
- "name": "Alexander",
104
- "email": "iam.asm89@gmail.com"
105
- }
106
- ],
107
- "description": "Cache fragments of templates directly within Twig.",
108
- "homepage": "https://github.com/asm89/twig-cache-extension",
109
- "keywords": [
110
- "cache",
111
- "extension",
112
- "twig"
113
- ]
114
- },
115
- {
116
- "name": "composer/installers",
117
- "version": "v1.7.0",
118
- "version_normalized": "1.7.0.0",
119
- "source": {
120
- "type": "git",
121
- "url": "https://github.com/composer/installers.git",
122
- "reference": "141b272484481432cda342727a427dc1e206bfa0"
123
- },
124
- "dist": {
125
- "type": "zip",
126
- "url": "https://api.github.com/repos/composer/installers/zipball/141b272484481432cda342727a427dc1e206bfa0",
127
- "reference": "141b272484481432cda342727a427dc1e206bfa0",
128
- "shasum": ""
129
- },
130
- "require": {
131
- "composer-plugin-api": "^1.0"
132
- },
133
- "replace": {
134
- "roundcube/plugin-installer": "*",
135
- "shama/baton": "*"
136
- },
137
- "require-dev": {
138
- "composer/composer": "1.0.*@dev",
139
- "phpunit/phpunit": "^4.8.36"
140
- },
141
- "time": "2019-08-12T15:00:31+00:00",
142
- "type": "composer-plugin",
143
- "extra": {
144
- "class": "Composer\\Installers\\Plugin",
145
- "branch-alias": {
146
- "dev-master": "1.0-dev"
147
- }
148
- },
149
- "installation-source": "dist",
150
- "autoload": {
151
- "psr-4": {
152
- "Composer\\Installers\\": "src/Composer/Installers"
153
- }
154
- },
155
- "notification-url": "https://packagist.org/downloads/",
156
- "license": [
157
- "MIT"
158
- ],
159
- "authors": [
160
- {
161
- "name": "Kyle Robinson Young",
162
- "email": "kyle@dontkry.com",
163
- "homepage": "https://github.com/shama"
164
- }
165
- ],
166
- "description": "A multi-framework Composer library installer",
167
- "homepage": "https://composer.github.io/installers/",
168
- "keywords": [
169
- "Craft",
170
- "Dolibarr",
171
- "Eliasis",
172
- "Hurad",
173
- "ImageCMS",
174
- "Kanboard",
175
- "Lan Management System",
176
- "MODX Evo",
177
- "Mautic",
178
- "Maya",
179
- "OXID",
180
- "Plentymarkets",
181
- "Porto",
182
- "RadPHP",
183
- "SMF",
184
- "Thelia",
185
- "Whmcs",
186
- "WolfCMS",
187
- "agl",
188
- "aimeos",
189
- "annotatecms",
190
- "attogram",
191
- "bitrix",
192
- "cakephp",
193
- "chef",
194
- "cockpit",
195
- "codeigniter",
196
- "concrete5",
197
- "croogo",
198
- "dokuwiki",
199
- "drupal",
200
- "eZ Platform",
201
- "elgg",
202
- "expressionengine",
203
- "fuelphp",
204
- "grav",
205
- "installer",
206
- "itop",
207
- "joomla",
208
- "known",
209
- "kohana",
210
- "laravel",
211
- "lavalite",
212
- "lithium",
213
- "magento",
214
- "majima",
215
- "mako",
216
- "mediawiki",
217
- "modulework",
218
- "modx",
219
- "moodle",
220
- "osclass",
221
- "phpbb",
222
- "piwik",
223
- "ppi",
224
- "puppet",
225
- "pxcms",
226
- "reindex",
227
- "roundcube",
228
- "shopware",
229
- "silverstripe",
230
- "sydes",
231
- "symfony",
232
- "typo3",
233
- "wordpress",
234
- "yawik",
235
- "zend",
236
- "zikula"
237
- ]
238
- },
239
- {
240
- "name": "symfony/polyfill-ctype",
241
- "version": "v1.12.0",
242
- "version_normalized": "1.12.0.0",
243
- "source": {
244
- "type": "git",
245
- "url": "https://github.com/symfony/polyfill-ctype.git",
246
- "reference": "550ebaac289296ce228a706d0867afc34687e3f4"
247
- },
248
- "dist": {
249
- "type": "zip",
250
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4",
251
- "reference": "550ebaac289296ce228a706d0867afc34687e3f4",
252
- "shasum": ""
253
- },
254
- "require": {
255
- "php": ">=5.3.3"
256
- },
257
- "suggest": {
258
- "ext-ctype": "For best performance"
259
- },
260
- "time": "2019-08-06T08:03:45+00:00",
261
- "type": "library",
262
- "extra": {
263
- "branch-alias": {
264
- "dev-master": "1.12-dev"
265
- }
266
- },
267
- "installation-source": "dist",
268
- "autoload": {
269
- "psr-4": {
270
- "Symfony\\Polyfill\\Ctype\\": ""
271
- },
272
- "files": [
273
- "bootstrap.php"
274
- ]
275
- },
276
- "notification-url": "https://packagist.org/downloads/",
277
- "license": [
278
- "MIT"
279
- ],
280
- "authors": [
281
- {
282
- "name": "Gert de Pagter",
283
- "email": "BackEndTea@gmail.com"
284
- },
285
- {
286
- "name": "Symfony Community",
287
- "homepage": "https://symfony.com/contributors"
288
- }
289
- ],
290
- "description": "Symfony polyfill for ctype functions",
291
- "homepage": "https://symfony.com",
292
- "keywords": [
293
- "compatibility",
294
- "ctype",
295
- "polyfill",
296
- "portable"
297
- ]
298
- },
299
- {
300
- "name": "twig/twig",
301
- "version": "v1.42.3",
302
- "version_normalized": "1.42.3.0",
303
- "source": {
304
- "type": "git",
305
- "url": "https://github.com/twigphp/Twig.git",
306
- "reference": "201baee843e0ffe8b0b956f336dd42b2a92fae4e"
307
- },
308
- "dist": {
309
- "type": "zip",
310
- "url": "https://api.github.com/repos/twigphp/Twig/zipball/201baee843e0ffe8b0b956f336dd42b2a92fae4e",
311
- "reference": "201baee843e0ffe8b0b956f336dd42b2a92fae4e",
312
- "shasum": ""
313
- },
314
- "require": {
315
- "php": ">=5.5.0",
316
- "symfony/polyfill-ctype": "^1.8"
317
- },
318
- "require-dev": {
319
- "psr/container": "^1.0",
320
- "symfony/debug": "^3.4|^4.2",
321
- "symfony/phpunit-bridge": "^4.4@dev|^5.0"
322
- },
323
- "time": "2019-08-24T12:51:03+00:00",
324
- "type": "library",
325
- "extra": {
326
- "branch-alias": {
327
- "dev-master": "1.42-dev"
328
- }
329
- },
330
- "installation-source": "dist",
331
- "autoload": {
332
- "psr-0": {
333
- "Twig_": "lib/"
334
- },
335
- "psr-4": {
336
- "Twig\\": "src/"
337
- }
338
- },
339
- "notification-url": "https://packagist.org/downloads/",
340
- "license": [
341
- "BSD-3-Clause"
342
- ],
343
- "authors": [
344
- {
345
- "name": "Fabien Potencier",
346
- "email": "fabien@symfony.com",
347
- "homepage": "http://fabien.potencier.org",
348
- "role": "Lead Developer"
349
- },
350
- {
351
- "name": "Twig Team",
352
- "homepage": "https://twig.symfony.com/contributors",
353
- "role": "Contributors"
354
- },
355
- {
356
- "name": "Armin Ronacher",
357
- "email": "armin.ronacher@active-4.com",
358
- "role": "Project Founder"
359
- }
360
- ],
361
- "description": "Twig, the flexible, fast, and secure template language for PHP",
362
- "homepage": "https://twig.symfony.com",
363
- "keywords": [
364
- "templating"
365
- ]
366
- },
367
- {
368
- "name": "upstatement/routes",
369
- "version": "0.5",
370
- "version_normalized": "0.5.0.0",
371
- "source": {
372
- "type": "git",
373
- "url": "https://github.com/Upstatement/routes.git",
374
- "reference": "3267d28be0a73f197087d58384e1a358d85671b6"
375
- },
376
- "dist": {
377
- "type": "zip",
378
- "url": "https://api.github.com/repos/Upstatement/routes/zipball/3267d28be0a73f197087d58384e1a358d85671b6",
379
- "reference": "3267d28be0a73f197087d58384e1a358d85671b6",
380
- "shasum": ""
381
- },
382
- "require": {
383
- "altorouter/altorouter": "^1.1.0",
384
- "composer/installers": "~1.0",
385
- "php": ">=5.3.0"
386
- },
387
- "require-dev": {
388
- "phpunit/phpunit": "3.7.*",
389
- "satooshi/php-coveralls": "dev-master",
390
- "wp-cli/wp-cli": "*"
391
- },
392
- "time": "2018-12-04T01:13:41+00:00",
393
- "type": "library",
394
- "installation-source": "dist",
395
- "autoload": {
396
- "psr-0": {
397
- "Routes": ""
398
- }
399
- },
400
- "notification-url": "https://packagist.org/downloads/",
401
- "license": [
402
- "MIT"
403
- ],
404
- "authors": [
405
- {
406
- "name": "Jared Novack",
407
- "email": "jared@upstatement.com",
408
- "homepage": "http://upstatement.com"
409
- }
410
- ],
411
- "description": "Manage rewrites and routes in WordPress with this dead-simple plugin",
412
- "homepage": "http://routes.upstatement.com",
413
- "keywords": [
414
- "redirects",
415
- "rewrite",
416
- "routes",
417
- "routing"
418
- ]
419
- }
420
- ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/LICENSE DELETED
@@ -1,19 +0,0 @@
1
- Copyright (c) 2012 Kyle Robinson Young
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is furnished
8
- to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/composer.json DELETED
@@ -1,107 +0,0 @@
1
- {
2
- "name": "composer/installers",
3
- "type": "composer-plugin",
4
- "license": "MIT",
5
- "description": "A multi-framework Composer library installer",
6
- "keywords": [
7
- "installer",
8
- "Aimeos",
9
- "AGL",
10
- "AnnotateCms",
11
- "Attogram",
12
- "Bitrix",
13
- "CakePHP",
14
- "Chef",
15
- "Cockpit",
16
- "CodeIgniter",
17
- "concrete5",
18
- "Craft",
19
- "Croogo",
20
- "DokuWiki",
21
- "Dolibarr",
22
- "Drupal",
23
- "Elgg",
24
- "Eliasis",
25
- "ExpressionEngine",
26
- "eZ Platform",
27
- "FuelPHP",
28
- "Grav",
29
- "Hurad",
30
- "ImageCMS",
31
- "iTop",
32
- "Joomla",
33
- "Kanboard",
34
- "Known",
35
- "Kohana",
36
- "Lan Management System",
37
- "Laravel",
38
- "Lavalite",
39
- "Lithium",
40
- "Magento",
41
- "majima",
42
- "Mako",
43
- "Mautic",
44
- "Maya",
45
- "MODX",
46
- "MODX Evo",
47
- "MediaWiki",
48
- "OXID",
49
- "osclass",
50
- "MODULEWork",
51
- "Moodle",
52
- "Piwik",
53
- "pxcms",
54
- "phpBB",
55
- "Plentymarkets",
56
- "PPI",
57
- "Puppet",
58
- "Porto",
59
- "RadPHP",
60
- "ReIndex",
61
- "Roundcube",
62
- "shopware",
63
- "SilverStripe",
64
- "SMF",
65
- "SyDES",
66
- "symfony",
67
- "Thelia",
68
- "TYPO3",
69
- "WHMCS",
70
- "WolfCMS",
71
- "WordPress",
72
- "YAWIK",
73
- "Zend",
74
- "Zikula"
75
- ],
76
- "homepage": "https://composer.github.io/installers/",
77
- "authors": [
78
- {
79
- "name": "Kyle Robinson Young",
80
- "email": "kyle@dontkry.com",
81
- "homepage": "https://github.com/shama"
82
- }
83
- ],
84
- "autoload": {
85
- "psr-4": { "Composer\\Installers\\": "src/Composer/Installers" }
86
- },
87
- "extra": {
88
- "class": "Composer\\Installers\\Plugin",
89
- "branch-alias": {
90
- "dev-master": "1.0-dev"
91
- }
92
- },
93
- "replace": {
94
- "shama/baton": "*",
95
- "roundcube/plugin-installer": "*"
96
- },
97
- "require": {
98
- "composer-plugin-api": "^1.0"
99
- },
100
- "require-dev": {
101
- "composer/composer": "1.0.*@dev",
102
- "phpunit/phpunit": "^4.8.36"
103
- },
104
- "scripts": {
105
- "test": "phpunit"
106
- }
107
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/AglInstaller.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class AglInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'More/{$name}/',
8
- );
9
-
10
- /**
11
- * Format package name to CamelCase
12
- */
13
- public function inflectPackageVars($vars)
14
- {
15
- $vars['name'] = preg_replace_callback('/(?:^|_|-)(.?)/', function ($matches) {
16
- return strtoupper($matches[1]);
17
- }, $vars['name']);
18
-
19
- return $vars;
20
- }
21
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/AimeosInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class AimeosInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'extension' => 'ext/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/AnnotateCmsInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class AnnotateCmsInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'addons/modules/{$name}/',
8
- 'component' => 'addons/components/{$name}/',
9
- 'service' => 'addons/services/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/AsgardInstaller.php DELETED
@@ -1,49 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class AsgardInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'Modules/{$name}/',
8
- 'theme' => 'Themes/{$name}/'
9
- );
10
-
11
- /**
12
- * Format package name.
13
- *
14
- * For package type asgard-module, cut off a trailing '-plugin' if present.
15
- *
16
- * For package type asgard-theme, cut off a trailing '-theme' if present.
17
- *
18
- */
19
- public function inflectPackageVars($vars)
20
- {
21
- if ($vars['type'] === 'asgard-module') {
22
- return $this->inflectPluginVars($vars);
23
- }
24
-
25
- if ($vars['type'] === 'asgard-theme') {
26
- return $this->inflectThemeVars($vars);
27
- }
28
-
29
- return $vars;
30
- }
31
-
32
- protected function inflectPluginVars($vars)
33
- {
34
- $vars['name'] = preg_replace('/-module$/', '', $vars['name']);
35
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
36
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
37
-
38
- return $vars;
39
- }
40
-
41
- protected function inflectThemeVars($vars)
42
- {
43
- $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
44
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
45
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
46
-
47
- return $vars;
48
- }
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/AttogramInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class AttogramInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/BaseInstaller.php DELETED
@@ -1,136 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- use Composer\IO\IOInterface;
5
- use Composer\Composer;
6
- use Composer\Package\PackageInterface;
7
-
8
- abstract class BaseInstaller
9
- {
10
- protected $locations = array();
11
- protected $composer;
12
- protected $package;
13
- protected $io;
14
-
15
- /**
16
- * Initializes base installer.
17
- *
18
- * @param PackageInterface $package
19
- * @param Composer $composer
20
- * @param IOInterface $io
21
- */
22
- public function __construct(PackageInterface $package = null, Composer $composer = null, IOInterface $io = null)
23
- {
24
- $this->composer = $composer;
25
- $this->package = $package;
26
- $this->io = $io;
27
- }
28
-
29
- /**
30
- * Return the install path based on package type.
31
- *
32
- * @param PackageInterface $package
33
- * @param string $frameworkType
34
- * @return string
35
- */
36
- public function getInstallPath(PackageInterface $package, $frameworkType = '')
37
- {
38
- $type = $this->package->getType();
39
-
40
- $prettyName = $this->package->getPrettyName();
41
- if (strpos($prettyName, '/') !== false) {
42
- list($vendor, $name) = explode('/', $prettyName);
43
- } else {
44
- $vendor = '';
45
- $name = $prettyName;
46
- }
47
-
48
- $availableVars = $this->inflectPackageVars(compact('name', 'vendor', 'type'));
49
-
50
- $extra = $package->getExtra();
51
- if (!empty($extra['installer-name'])) {
52
- $availableVars['name'] = $extra['installer-name'];
53
- }
54
-
55
- if ($this->composer->getPackage()) {
56
- $extra = $this->composer->getPackage()->getExtra();
57
- if (!empty($extra['installer-paths'])) {
58
- $customPath = $this->mapCustomInstallPaths($extra['installer-paths'], $prettyName, $type, $vendor);
59
- if ($customPath !== false) {
60
- return $this->templatePath($customPath, $availableVars);
61
- }
62
- }
63
- }
64
-
65
- $packageType = substr($type, strlen($frameworkType) + 1);
66
- $locations = $this->getLocations();
67
- if (!isset($locations[$packageType])) {
68
- throw new \InvalidArgumentException(sprintf('Package type "%s" is not supported', $type));
69
- }
70
-
71
- return $this->templatePath($locations[$packageType], $availableVars);
72
- }
73
-
74
- /**
75
- * For an installer to override to modify the vars per installer.
76
- *
77
- * @param array $vars
78
- * @return array
79
- */
80
- public function inflectPackageVars($vars)
81
- {
82
- return $vars;
83
- }
84
-
85
- /**
86
- * Gets the installer's locations
87
- *
88
- * @return array
89
- */
90
- public function getLocations()
91
- {
92
- return $this->locations;
93
- }
94
-
95
- /**
96
- * Replace vars in a path
97
- *
98
- * @param string $path
99
- * @param array $vars
100
- * @return string
101
- */
102
- protected function templatePath($path, array $vars = array())
103
- {
104
- if (strpos($path, '{') !== false) {
105
- extract($vars);
106
- preg_match_all('@\{\$([A-Za-z0-9_]*)\}@i', $path, $matches);
107
- if (!empty($matches[1])) {
108
- foreach ($matches[1] as $var) {
109
- $path = str_replace('{$' . $var . '}', $$var, $path);
110
- }
111
- }
112
- }
113
-
114
- return $path;
115
- }
116
-
117
- /**
118
- * Search through a passed paths array for a custom install path.
119
- *
120
- * @param array $paths
121
- * @param string $name
122
- * @param string $type
123
- * @param string $vendor = NULL
124
- * @return string
125
- */
126
- protected function mapCustomInstallPaths(array $paths, $name, $type, $vendor = NULL)
127
- {
128
- foreach ($paths as $path => $names) {
129
- if (in_array($name, $names) || in_array('type:' . $type, $names) || in_array('vendor:' . $vendor, $names)) {
130
- return $path;
131
- }
132
- }
133
-
134
- return false;
135
- }
136
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/BitrixInstaller.php DELETED
@@ -1,126 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers;
4
-
5
- use Composer\Util\Filesystem;
6
-
7
- /**
8
- * Installer for Bitrix Framework. Supported types of extensions:
9
- * - `bitrix-d7-module` — copy the module to directory `bitrix/modules/<vendor>.<name>`.
10
- * - `bitrix-d7-component` — copy the component to directory `bitrix/components/<vendor>/<name>`.
11
- * - `bitrix-d7-template` — copy the template to directory `bitrix/templates/<vendor>_<name>`.
12
- *
13
- * You can set custom path to directory with Bitrix kernel in `composer.json`:
14
- *
15
- * ```json
16
- * {
17
- * "extra": {
18
- * "bitrix-dir": "s1/bitrix"
19
- * }
20
- * }
21
- * ```
22
- *
23
- * @author Nik Samokhvalov <nik@samokhvalov.info>
24
- * @author Denis Kulichkin <onexhovia@gmail.com>
25
- */
26
- class BitrixInstaller extends BaseInstaller
27
- {
28
- protected $locations = array(
29
- 'module' => '{$bitrix_dir}/modules/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
30
- 'component' => '{$bitrix_dir}/components/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
31
- 'theme' => '{$bitrix_dir}/templates/{$name}/', // deprecated, remove on the major release (Backward compatibility will be broken)
32
- 'd7-module' => '{$bitrix_dir}/modules/{$vendor}.{$name}/',
33
- 'd7-component' => '{$bitrix_dir}/components/{$vendor}/{$name}/',
34
- 'd7-template' => '{$bitrix_dir}/templates/{$vendor}_{$name}/',
35
- );
36
-
37
- /**
38
- * @var array Storage for informations about duplicates at all the time of installation packages.
39
- */
40
- private static $checkedDuplicates = array();
41
-
42
- /**
43
- * {@inheritdoc}
44
- */
45
- public function inflectPackageVars($vars)
46
- {
47
- if ($this->composer->getPackage()) {
48
- $extra = $this->composer->getPackage()->getExtra();
49
-
50
- if (isset($extra['bitrix-dir'])) {
51
- $vars['bitrix_dir'] = $extra['bitrix-dir'];
52
- }
53
- }
54
-
55
- if (!isset($vars['bitrix_dir'])) {
56
- $vars['bitrix_dir'] = 'bitrix';
57
- }
58
-
59
- return parent::inflectPackageVars($vars);
60
- }
61
-
62
- /**
63
- * {@inheritdoc}
64
- */
65
- protected function templatePath($path, array $vars = array())
66
- {
67
- $templatePath = parent::templatePath($path, $vars);
68
- $this->checkDuplicates($templatePath, $vars);
69
-
70
- return $templatePath;
71
- }
72
-
73
- /**
74
- * Duplicates search packages.
75
- *
76
- * @param string $path
77
- * @param array $vars
78
- */
79
- protected function checkDuplicates($path, array $vars = array())
80
- {
81
- $packageType = substr($vars['type'], strlen('bitrix') + 1);
82
- $localDir = explode('/', $vars['bitrix_dir']);
83
- array_pop($localDir);
84
- $localDir[] = 'local';
85
- $localDir = implode('/', $localDir);
86
-
87
- $oldPath = str_replace(
88
- array('{$bitrix_dir}', '{$name}'),
89
- array($localDir, $vars['name']),
90
- $this->locations[$packageType]
91
- );
92
-
93
- if (in_array($oldPath, static::$checkedDuplicates)) {
94
- return;
95
- }
96
-
97
- if ($oldPath !== $path && file_exists($oldPath) && $this->io && $this->io->isInteractive()) {
98
-
99
- $this->io->writeError(' <error>Duplication of packages:</error>');
100
- $this->io->writeError(' <info>Package ' . $oldPath . ' will be called instead package ' . $path . '</info>');
101
-
102
- while (true) {
103
- switch ($this->io->ask(' <info>Delete ' . $oldPath . ' [y,n,?]?</info> ', '?')) {
104
- case 'y':
105
- $fs = new Filesystem();
106
- $fs->removeDirectory($oldPath);
107
- break 2;
108
-
109
- case 'n':
110
- break 2;
111
-
112
- case '?':
113
- default:
114
- $this->io->writeError(array(
115
- ' y - delete package ' . $oldPath . ' and to continue with the installation',
116
- ' n - don\'t delete and to continue with the installation',
117
- ));
118
- $this->io->writeError(' ? - print help');
119
- break;
120
- }
121
- }
122
- }
123
-
124
- static::$checkedDuplicates[] = $oldPath;
125
- }
126
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class BonefishInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'package' => 'Packages/{$vendor}/{$name}/'
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/CakePHPInstaller.php DELETED
@@ -1,82 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- use Composer\DependencyResolver\Pool;
5
-
6
- class CakePHPInstaller extends BaseInstaller
7
- {
8
- protected $locations = array(
9
- 'plugin' => 'Plugin/{$name}/',
10
- );
11
-
12
- /**
13
- * Format package name to CamelCase
14
- */
15
- public function inflectPackageVars($vars)
16
- {
17
- if ($this->matchesCakeVersion('>=', '3.0.0')) {
18
- return $vars;
19
- }
20
-
21
- $nameParts = explode('/', $vars['name']);
22
- foreach ($nameParts as &$value) {
23
- $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
24
- $value = str_replace(array('-', '_'), ' ', $value);
25
- $value = str_replace(' ', '', ucwords($value));
26
- }
27
- $vars['name'] = implode('/', $nameParts);
28
-
29
- return $vars;
30
- }
31
-
32
- /**
33
- * Change the default plugin location when cakephp >= 3.0
34
- */
35
- public function getLocations()
36
- {
37
- if ($this->matchesCakeVersion('>=', '3.0.0')) {
38
- $this->locations['plugin'] = $this->composer->getConfig()->get('vendor-dir') . '/{$vendor}/{$name}/';
39
- }
40
- return $this->locations;
41
- }
42
-
43
- /**
44
- * Check if CakePHP version matches against a version
45
- *
46
- * @param string $matcher
47
- * @param string $version
48
- * @return bool
49
- */
50
- protected function matchesCakeVersion($matcher, $version)
51
- {
52
- if (class_exists('Composer\Semver\Constraint\MultiConstraint')) {
53
- $multiClass = 'Composer\Semver\Constraint\MultiConstraint';
54
- $constraintClass = 'Composer\Semver\Constraint\Constraint';
55
- } else {
56
- $multiClass = 'Composer\Package\LinkConstraint\MultiConstraint';
57
- $constraintClass = 'Composer\Package\LinkConstraint\VersionConstraint';
58
- }
59
-
60
- $repositoryManager = $this->composer->getRepositoryManager();
61
- if ($repositoryManager) {
62
- $repos = $repositoryManager->getLocalRepository();
63
- if (!$repos) {
64
- return false;
65
- }
66
- $cake3 = new $multiClass(array(
67
- new $constraintClass($matcher, $version),
68
- new $constraintClass('!=', '9999999-dev'),
69
- ));
70
- $pool = new Pool('dev');
71
- $pool->addRepository($repos);
72
- $packages = $pool->whatProvides('cakephp/cakephp');
73
- foreach ($packages as $package) {
74
- $installed = new $constraintClass('=', $package->getVersion());
75
- if ($cake3->matches($installed)) {
76
- return true;
77
- }
78
- }
79
- }
80
- return false;
81
- }
82
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/ChefInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class ChefInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'cookbook' => 'Chef/{$vendor}/{$name}/',
8
- 'role' => 'Chef/roles/{$name}/',
9
- );
10
- }
11
-
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class CiviCrmInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'ext' => 'ext/{$name}/'
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class ClanCatsFrameworkInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'ship' => 'CCF/orbit/{$name}/',
8
- 'theme' => 'CCF/app/themes/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class CockpitInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'cockpit/modules/addons/{$name}/',
8
- );
9
-
10
- /**
11
- * Format module name.
12
- *
13
- * Strip `module-` prefix from package name.
14
- *
15
- * @param array @vars
16
- *
17
- * @return array
18
- */
19
- public function inflectPackageVars($vars)
20
- {
21
- if ($vars['type'] == 'cockpit-module') {
22
- return $this->inflectModuleVars($vars);
23
- }
24
-
25
- return $vars;
26
- }
27
-
28
- public function inflectModuleVars($vars)
29
- {
30
- $vars['name'] = ucfirst(preg_replace('/cockpit-/i', '', $vars['name']));
31
-
32
- return $vars;
33
- }
34
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class CodeIgniterInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'library' => 'application/libraries/{$name}/',
8
- 'third-party' => 'application/third_party/{$name}/',
9
- 'module' => 'application/modules/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/Concrete5Installer.php DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class Concrete5Installer extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'core' => 'concrete/',
8
- 'block' => 'application/blocks/{$name}/',
9
- 'package' => 'packages/{$name}/',
10
- 'theme' => 'application/themes/{$name}/',
11
- 'update' => 'updates/{$name}/',
12
- );
13
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/CraftInstaller.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * Installer for Craft Plugins
6
- */
7
- class CraftInstaller extends BaseInstaller
8
- {
9
- const NAME_PREFIX = 'craft';
10
- const NAME_SUFFIX = 'plugin';
11
-
12
- protected $locations = array(
13
- 'plugin' => 'craft/plugins/{$name}/',
14
- );
15
-
16
- /**
17
- * Strip `craft-` prefix and/or `-plugin` suffix from package names
18
- *
19
- * @param array $vars
20
- *
21
- * @return array
22
- */
23
- final public function inflectPackageVars($vars)
24
- {
25
- return $this->inflectPluginVars($vars);
26
- }
27
-
28
- private function inflectPluginVars($vars)
29
- {
30
- $vars['name'] = preg_replace('/-' . self::NAME_SUFFIX . '$/i', '', $vars['name']);
31
- $vars['name'] = preg_replace('/^' . self::NAME_PREFIX . '-/i', '', $vars['name']);
32
-
33
- return $vars;
34
- }
35
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/CroogoInstaller.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class CroogoInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'Plugin/{$name}/',
8
- 'theme' => 'View/Themed/{$name}/',
9
- );
10
-
11
- /**
12
- * Format package name to CamelCase
13
- */
14
- public function inflectPackageVars($vars)
15
- {
16
- $vars['name'] = strtolower(str_replace(array('-', '_'), ' ', $vars['name']));
17
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
18
-
19
- return $vars;
20
- }
21
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/DecibelInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class DecibelInstaller extends BaseInstaller
5
- {
6
- /** @var array */
7
- protected $locations = array(
8
- 'app' => 'app/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/DframeInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers;
4
-
5
- class DframeInstaller extends BaseInstaller
6
- {
7
- protected $locations = array(
8
- 'module' => 'modules/{$vendor}/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php DELETED
@@ -1,50 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class DokuWikiInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'lib/plugins/{$name}/',
8
- 'template' => 'lib/tpl/{$name}/',
9
- );
10
-
11
- /**
12
- * Format package name.
13
- *
14
- * For package type dokuwiki-plugin, cut off a trailing '-plugin',
15
- * or leading dokuwiki_ if present.
16
- *
17
- * For package type dokuwiki-template, cut off a trailing '-template' if present.
18
- *
19
- */
20
- public function inflectPackageVars($vars)
21
- {
22
-
23
- if ($vars['type'] === 'dokuwiki-plugin') {
24
- return $this->inflectPluginVars($vars);
25
- }
26
-
27
- if ($vars['type'] === 'dokuwiki-template') {
28
- return $this->inflectTemplateVars($vars);
29
- }
30
-
31
- return $vars;
32
- }
33
-
34
- protected function inflectPluginVars($vars)
35
- {
36
- $vars['name'] = preg_replace('/-plugin$/', '', $vars['name']);
37
- $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);
38
-
39
- return $vars;
40
- }
41
-
42
- protected function inflectTemplateVars($vars)
43
- {
44
- $vars['name'] = preg_replace('/-template$/', '', $vars['name']);
45
- $vars['name'] = preg_replace('/^dokuwiki_?-?/', '', $vars['name']);
46
-
47
- return $vars;
48
- }
49
-
50
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/DolibarrInstaller.php DELETED
@@ -1,16 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * Class DolibarrInstaller
6
- *
7
- * @package Composer\Installers
8
- * @author Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
9
- */
10
- class DolibarrInstaller extends BaseInstaller
11
- {
12
- //TODO: Add support for scripts and themes
13
- protected $locations = array(
14
- 'module' => 'htdocs/custom/{$name}/',
15
- );
16
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class DrupalInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'core' => 'core/',
8
- 'module' => 'modules/{$name}/',
9
- 'theme' => 'themes/{$name}/',
10
- 'library' => 'libraries/{$name}/',
11
- 'profile' => 'profiles/{$name}/',
12
- 'drush' => 'drush/{$name}/',
13
- 'custom-theme' => 'themes/custom/{$name}/',
14
- 'custom-module' => 'modules/custom/{$name}/',
15
- 'custom-profile' => 'profiles/custom/{$name}/',
16
- 'drupal-multisite' => 'sites/{$name}/',
17
- 'console' => 'console/{$name}/',
18
- 'console-language' => 'console/language/{$name}/',
19
- );
20
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/ElggInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class ElggInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'mod/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class EliasisInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'component' => 'components/{$name}/',
8
- 'module' => 'modules/{$name}/',
9
- 'plugin' => 'plugins/{$name}/',
10
- 'template' => 'templates/{$name}/',
11
- );
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php DELETED
@@ -1,29 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- use Composer\Package\PackageInterface;
5
-
6
- class ExpressionEngineInstaller extends BaseInstaller
7
- {
8
-
9
- protected $locations = array();
10
-
11
- private $ee2Locations = array(
12
- 'addon' => 'system/expressionengine/third_party/{$name}/',
13
- 'theme' => 'themes/third_party/{$name}/',
14
- );
15
-
16
- private $ee3Locations = array(
17
- 'addon' => 'system/user/addons/{$name}/',
18
- 'theme' => 'themes/user/{$name}/',
19
- );
20
-
21
- public function getInstallPath(PackageInterface $package, $frameworkType = '')
22
- {
23
-
24
- $version = "{$frameworkType}Locations";
25
- $this->locations = $this->$version;
26
-
27
- return parent::getInstallPath($package, $frameworkType);
28
- }
29
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class EzPlatformInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'meta-assets' => 'web/assets/ezplatform/',
8
- 'assets' => 'web/assets/ezplatform/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/FuelInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class FuelInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'fuel/app/modules/{$name}/',
8
- 'package' => 'fuel/packages/{$name}/',
9
- 'theme' => 'fuel/app/themes/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/FuelphpInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class FuelphpInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'component' => 'components/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/GravInstaller.php DELETED
@@ -1,30 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class GravInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'user/plugins/{$name}/',
8
- 'theme' => 'user/themes/{$name}/',
9
- );
10
-
11
- /**
12
- * Format package name
13
- *
14
- * @param array $vars
15
- *
16
- * @return array
17
- */
18
- public function inflectPackageVars($vars)
19
- {
20
- $restrictedWords = implode('|', array_keys($this->locations));
21
-
22
- $vars['name'] = strtolower($vars['name']);
23
- $vars['name'] = preg_replace('/^(?:grav-)?(?:(?:'.$restrictedWords.')-)?(.*?)(?:-(?:'.$restrictedWords.'))?$/ui',
24
- '$1',
25
- $vars['name']
26
- );
27
-
28
- return $vars;
29
- }
30
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/HuradInstaller.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class HuradInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'plugins/{$name}/',
8
- 'theme' => 'plugins/{$name}/',
9
- );
10
-
11
- /**
12
- * Format package name to CamelCase
13
- */
14
- public function inflectPackageVars($vars)
15
- {
16
- $nameParts = explode('/', $vars['name']);
17
- foreach ($nameParts as &$value) {
18
- $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
19
- $value = str_replace(array('-', '_'), ' ', $value);
20
- $value = str_replace(' ', '', ucwords($value));
21
- }
22
- $vars['name'] = implode('/', $nameParts);
23
- return $vars;
24
- }
25
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/ImageCMSInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class ImageCMSInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'template' => 'templates/{$name}/',
8
- 'module' => 'application/modules/{$name}/',
9
- 'library' => 'application/libraries/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/Installer.php DELETED
@@ -1,278 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers;
4
-
5
- use Composer\Composer;
6
- use Composer\Installer\BinaryInstaller;
7
- use Composer\Installer\LibraryInstaller;
8
- use Composer\IO\IOInterface;
9
- use Composer\Package\PackageInterface;
10
- use Composer\Repository\InstalledRepositoryInterface;
11
- use Composer\Util\Filesystem;
12
-
13
- class Installer extends LibraryInstaller
14
- {
15
-
16
- /**
17
- * Package types to installer class map
18
- *
19
- * @var array
20
- */
21
- private $supportedTypes = array(
22
- 'aimeos' => 'AimeosInstaller',
23
- 'asgard' => 'AsgardInstaller',
24
- 'attogram' => 'AttogramInstaller',
25
- 'agl' => 'AglInstaller',
26
- 'annotatecms' => 'AnnotateCmsInstaller',
27
- 'bitrix' => 'BitrixInstaller',
28
- 'bonefish' => 'BonefishInstaller',
29
- 'cakephp' => 'CakePHPInstaller',
30
- 'chef' => 'ChefInstaller',
31
- 'civicrm' => 'CiviCrmInstaller',
32
- 'ccframework' => 'ClanCatsFrameworkInstaller',
33
- 'cockpit' => 'CockpitInstaller',
34
- 'codeigniter' => 'CodeIgniterInstaller',
35
- 'concrete5' => 'Concrete5Installer',
36
- 'craft' => 'CraftInstaller',
37
- 'croogo' => 'CroogoInstaller',
38
- 'dframe' => 'DframeInstaller',
39
- 'dokuwiki' => 'DokuWikiInstaller',
40
- 'dolibarr' => 'DolibarrInstaller',
41
- 'decibel' => 'DecibelInstaller',
42
- 'drupal' => 'DrupalInstaller',
43
- 'elgg' => 'ElggInstaller',
44
- 'eliasis' => 'EliasisInstaller',
45
- 'ee3' => 'ExpressionEngineInstaller',
46
- 'ee2' => 'ExpressionEngineInstaller',
47
- 'ezplatform' => 'EzPlatformInstaller',
48
- 'fuel' => 'FuelInstaller',
49
- 'fuelphp' => 'FuelphpInstaller',
50
- 'grav' => 'GravInstaller',
51
- 'hurad' => 'HuradInstaller',
52
- 'imagecms' => 'ImageCMSInstaller',
53
- 'itop' => 'ItopInstaller',
54
- 'joomla' => 'JoomlaInstaller',
55
- 'kanboard' => 'KanboardInstaller',
56
- 'kirby' => 'KirbyInstaller',
57
- 'known' => 'KnownInstaller',
58
- 'kodicms' => 'KodiCMSInstaller',
59
- 'kohana' => 'KohanaInstaller',
60
- 'lms' => 'LanManagementSystemInstaller',
61
- 'laravel' => 'LaravelInstaller',
62
- 'lavalite' => 'LavaLiteInstaller',
63
- 'lithium' => 'LithiumInstaller',
64
- 'magento' => 'MagentoInstaller',
65
- 'majima' => 'MajimaInstaller',
66
- 'mako' => 'MakoInstaller',
67
- 'maya' => 'MayaInstaller',
68
- 'mautic' => 'MauticInstaller',
69
- 'mediawiki' => 'MediaWikiInstaller',
70
- 'microweber' => 'MicroweberInstaller',
71
- 'modulework' => 'MODULEWorkInstaller',
72
- 'modx' => 'ModxInstaller',
73
- 'modxevo' => 'MODXEvoInstaller',
74
- 'moodle' => 'MoodleInstaller',
75
- 'october' => 'OctoberInstaller',
76
- 'ontowiki' => 'OntoWikiInstaller',
77
- 'oxid' => 'OxidInstaller',
78
- 'osclass' => 'OsclassInstaller',
79
- 'pxcms' => 'PxcmsInstaller',
80
- 'phpbb' => 'PhpBBInstaller',
81
- 'pimcore' => 'PimcoreInstaller',
82
- 'piwik' => 'PiwikInstaller',
83
- 'plentymarkets'=> 'PlentymarketsInstaller',
84
- 'ppi' => 'PPIInstaller',
85
- 'puppet' => 'PuppetInstaller',
86
- 'radphp' => 'RadPHPInstaller',
87
- 'phifty' => 'PhiftyInstaller',
88
- 'porto' => 'PortoInstaller',
89
- 'redaxo' => 'RedaxoInstaller',
90
- 'redaxo5' => 'Redaxo5Installer',
91
- 'reindex' => 'ReIndexInstaller',
92
- 'roundcube' => 'RoundcubeInstaller',
93
- 'shopware' => 'ShopwareInstaller',
94
- 'sitedirect' => 'SiteDirectInstaller',
95
- 'silverstripe' => 'SilverStripeInstaller',
96
- 'smf' => 'SMFInstaller',
97
- 'sydes' => 'SyDESInstaller',
98
- 'symfony1' => 'Symfony1Installer',
99
- 'tao' => 'TaoInstaller',
100
- 'thelia' => 'TheliaInstaller',
101
- 'tusk' => 'TuskInstaller',
102
- 'typo3-cms' => 'TYPO3CmsInstaller',
103
- 'typo3-flow' => 'TYPO3FlowInstaller',
104
- 'userfrosting' => 'UserFrostingInstaller',
105
- 'vanilla' => 'VanillaInstaller',
106
- 'whmcs' => 'WHMCSInstaller',
107
- 'wolfcms' => 'WolfCMSInstaller',
108
- 'wordpress' => 'WordPressInstaller',
109
- 'yawik' => 'YawikInstaller',
110
- 'zend' => 'ZendInstaller',
111
- 'zikula' => 'ZikulaInstaller',
112
- 'prestashop' => 'PrestashopInstaller'
113
- );
114
-
115
- /**
116
- * Installer constructor.
117
- *
118
- * Disables installers specified in main composer extra installer-disable
119
- * list
120
- *
121
- * @param IOInterface $io
122
- * @param Composer $composer
123
- * @param string $type
124
- * @param Filesystem|null $filesystem
125
- * @param BinaryInstaller|null $binaryInstaller
126
- */
127
- public function __construct(
128
- IOInterface $io,
129
- Composer $composer,
130
- $type = 'library',
131
- Filesystem $filesystem = null,
132
- BinaryInstaller $binaryInstaller = null
133
- ) {
134
- parent::__construct($io, $composer, $type, $filesystem,
135
- $binaryInstaller);
136
- $this->removeDisabledInstallers();
137
- }
138
-
139
- /**
140
- * {@inheritDoc}
141
- */
142
- public function getInstallPath(PackageInterface $package)
143
- {
144
- $type = $package->getType();
145
- $frameworkType = $this->findFrameworkType($type);
146
-
147
- if ($frameworkType === false) {
148
- throw new \InvalidArgumentException(
149
- 'Sorry the package type of this package is not yet supported.'
150
- );
151
- }
152
-
153
- $class = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
154
- $installer = new $class($package, $this->composer, $this->getIO());
155
-
156
- return $installer->getInstallPath($package, $frameworkType);
157
- }
158
-
159
- public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
160
- {
161
- parent::uninstall($repo, $package);
162
- $installPath = $this->getPackageBasePath($package);
163
- $this->io->write(sprintf('Deleting %s - %s', $installPath, !file_exists($installPath) ? '<comment>deleted</comment>' : '<error>not deleted</error>'));
164
- }
165
-
166
- /**
167
- * {@inheritDoc}
168
- */
169
- public function supports($packageType)
170
- {
171
- $frameworkType = $this->findFrameworkType($packageType);
172
-
173
- if ($frameworkType === false) {
174
- return false;
175
- }
176
-
177
- $locationPattern = $this->getLocationPattern($frameworkType);
178
-
179
- return preg_match('#' . $frameworkType . '-' . $locationPattern . '#', $packageType, $matches) === 1;
180
- }
181
-
182
- /**
183
- * Finds a supported framework type if it exists and returns it
184
- *
185
- * @param string $type
186
- * @return string
187
- */
188
- protected function findFrameworkType($type)
189
- {
190
- $frameworkType = false;
191
-
192
- krsort($this->supportedTypes);
193
-
194
- foreach ($this->supportedTypes as $key => $val) {
195
- if ($key === substr($type, 0, strlen($key))) {
196
- $frameworkType = substr($type, 0, strlen($key));
197
- break;
198
- }
199
- }
200
-
201
- return $frameworkType;
202
- }
203
-
204
- /**
205
- * Get the second part of the regular expression to check for support of a
206
- * package type
207
- *
208
- * @param string $frameworkType
209
- * @return string
210
- */
211
- protected function getLocationPattern($frameworkType)
212
- {
213
- $pattern = false;
214
- if (!empty($this->supportedTypes[$frameworkType])) {
215
- $frameworkClass = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
216
- /** @var BaseInstaller $framework */
217
- $framework = new $frameworkClass(null, $this->composer, $this->getIO());
218
- $locations = array_keys($framework->getLocations());
219
- $pattern = $locations ? '(' . implode('|', $locations) . ')' : false;
220
- }
221
-
222
- return $pattern ? : '(\w+)';
223
- }
224
-
225
- /**
226
- * Get I/O object
227
- *
228
- * @return IOInterface
229
- */
230
- private function getIO()
231
- {
232
- return $this->io;
233
- }
234
-
235
- /**
236
- * Look for installers set to be disabled in composer's extra config and
237
- * remove them from the list of supported installers.
238
- *
239
- * Globals:
240
- * - true, "all", and "*" - disable all installers.
241
- * - false - enable all installers (useful with
242
- * wikimedia/composer-merge-plugin or similar)
243
- *
244
- * @return void
245
- */
246
- protected function removeDisabledInstallers()
247
- {
248
- $extra = $this->composer->getPackage()->getExtra();
249
-
250
- if (!isset($extra['installer-disable']) || $extra['installer-disable'] === false) {
251
- // No installers are disabled
252
- return;
253
- }
254
-
255
- // Get installers to disable
256
- $disable = $extra['installer-disable'];
257
-
258
- // Ensure $disabled is an array
259
- if (!is_array($disable)) {
260
- $disable = array($disable);
261
- }
262
-
263
- // Check which installers should be disabled
264
- $all = array(true, "all", "*");
265
- $intersect = array_intersect($all, $disable);
266
- if (!empty($intersect)) {
267
- // Disable all installers
268
- $this->supportedTypes = array();
269
- } else {
270
- // Disable specified installers
271
- foreach ($disable as $key => $installer) {
272
- if (is_string($installer) && key_exists($installer, $this->supportedTypes)) {
273
- unset($this->supportedTypes[$installer]);
274
- }
275
- }
276
- }
277
- }
278
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/ItopInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class ItopInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'extension' => 'extensions/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/JoomlaInstaller.php DELETED
@@ -1,15 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class JoomlaInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'component' => 'components/{$name}/',
8
- 'module' => 'modules/{$name}/',
9
- 'template' => 'templates/{$name}/',
10
- 'plugin' => 'plugins/{$name}/',
11
- 'library' => 'libraries/{$name}/',
12
- );
13
-
14
- // TODO: Add inflector for mod_ and com_ names
15
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php DELETED
@@ -1,18 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- *
6
- * Installer for kanboard plugins
7
- *
8
- * kanboard.net
9
- *
10
- * Class KanboardInstaller
11
- * @package Composer\Installers
12
- */
13
- class KanboardInstaller extends BaseInstaller
14
- {
15
- protected $locations = array(
16
- 'plugin' => 'plugins/{$name}/',
17
- );
18
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/KirbyInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class KirbyInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'site/plugins/{$name}/',
8
- 'field' => 'site/fields/{$name}/',
9
- 'tag' => 'site/tags/{$name}/'
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/KnownInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class KnownInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'IdnoPlugins/{$name}/',
8
- 'theme' => 'Themes/{$name}/',
9
- 'console' => 'ConsolePlugins/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class KodiCMSInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'cms/plugins/{$name}/',
8
- 'media' => 'cms/media/vendor/{$name}/'
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/KohanaInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class KohanaInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers;
4
-
5
- class LanManagementSystemInstaller extends BaseInstaller
6
- {
7
-
8
- protected $locations = array(
9
- 'plugin' => 'plugins/{$name}/',
10
- 'template' => 'templates/{$name}/',
11
- 'document-template' => 'documents/templates/{$name}/',
12
- 'userpanel-module' => 'userpanel/modules/{$name}/',
13
- );
14
-
15
- /**
16
- * Format package name to CamelCase
17
- */
18
- public function inflectPackageVars($vars)
19
- {
20
- $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
21
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
22
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
23
-
24
- return $vars;
25
- }
26
-
27
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/LaravelInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class LaravelInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'library' => 'libraries/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class LavaLiteInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'package' => 'packages/{$vendor}/{$name}/',
8
- 'theme' => 'public/themes/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class LithiumInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'library' => 'libraries/{$name}/',
8
- 'source' => 'libraries/_source/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/MODULEWorkInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MODULEWorkInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php DELETED
@@ -1,16 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * An installer to handle MODX Evolution specifics when installing packages.
6
- */
7
- class MODXEvoInstaller extends BaseInstaller
8
- {
9
- protected $locations = array(
10
- 'snippet' => 'assets/snippets/{$name}/',
11
- 'plugin' => 'assets/plugins/{$name}/',
12
- 'module' => 'assets/modules/{$name}/',
13
- 'template' => 'assets/templates/{$name}/',
14
- 'lib' => 'assets/lib/{$name}/'
15
- );
16
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/MagentoInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MagentoInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'theme' => 'app/design/frontend/{$name}/',
8
- 'skin' => 'skin/frontend/default/{$name}/',
9
- 'library' => 'lib/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/MajimaInstaller.php DELETED
@@ -1,37 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * Plugin/theme installer for majima
6
- * @author David Neustadt
7
- */
8
- class MajimaInstaller extends BaseInstaller
9
- {
10
- protected $locations = array(
11
- 'plugin' => 'plugins/{$name}/',
12
- );
13
-
14
- /**
15
- * Transforms the names
16
- * @param array $vars
17
- * @return array
18
- */
19
- public function inflectPackageVars($vars)
20
- {
21
- return $this->correctPluginName($vars);
22
- }
23
-
24
- /**
25
- * Change hyphenated names to camelcase
26
- * @param array $vars
27
- * @return array
28
- */
29
- private function correctPluginName($vars)
30
- {
31
- $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
32
- return strtoupper($matches[0][1]);
33
- }, $vars['name']);
34
- $vars['name'] = ucfirst($camelCasedName);
35
- return $vars;
36
- }
37
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MakoInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'package' => 'app/packages/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/MauticInstaller.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MauticInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'plugins/{$name}/',
8
- 'theme' => 'themes/{$name}/',
9
- );
10
-
11
- /**
12
- * Format package name of mautic-plugins to CamelCase
13
- */
14
- public function inflectPackageVars($vars)
15
- {
16
- if ($vars['type'] == 'mautic-plugin') {
17
- $vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) {
18
- return strtoupper($matches[0][1]);
19
- }, ucfirst($vars['name']));
20
- }
21
-
22
- return $vars;
23
- }
24
-
25
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/MayaInstaller.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MayaInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- );
9
-
10
- /**
11
- * Format package name.
12
- *
13
- * For package type maya-module, cut off a trailing '-module' if present.
14
- *
15
- */
16
- public function inflectPackageVars($vars)
17
- {
18
- if ($vars['type'] === 'maya-module') {
19
- return $this->inflectModuleVars($vars);
20
- }
21
-
22
- return $vars;
23
- }
24
-
25
- protected function inflectModuleVars($vars)
26
- {
27
- $vars['name'] = preg_replace('/-module$/', '', $vars['name']);
28
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
29
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
30
-
31
- return $vars;
32
- }
33
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php DELETED
@@ -1,51 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MediaWikiInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'core' => 'core/',
8
- 'extension' => 'extensions/{$name}/',
9
- 'skin' => 'skins/{$name}/',
10
- );
11
-
12
- /**
13
- * Format package name.
14
- *
15
- * For package type mediawiki-extension, cut off a trailing '-extension' if present and transform
16
- * to CamelCase keeping existing uppercase chars.
17
- *
18
- * For package type mediawiki-skin, cut off a trailing '-skin' if present.
19
- *
20
- */
21
- public function inflectPackageVars($vars)
22
- {
23
-
24
- if ($vars['type'] === 'mediawiki-extension') {
25
- return $this->inflectExtensionVars($vars);
26
- }
27
-
28
- if ($vars['type'] === 'mediawiki-skin') {
29
- return $this->inflectSkinVars($vars);
30
- }
31
-
32
- return $vars;
33
- }
34
-
35
- protected function inflectExtensionVars($vars)
36
- {
37
- $vars['name'] = preg_replace('/-extension$/', '', $vars['name']);
38
- $vars['name'] = str_replace('-', ' ', $vars['name']);
39
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
40
-
41
- return $vars;
42
- }
43
-
44
- protected function inflectSkinVars($vars)
45
- {
46
- $vars['name'] = preg_replace('/-skin$/', '', $vars['name']);
47
-
48
- return $vars;
49
- }
50
-
51
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/MicroweberInstaller.php DELETED
@@ -1,119 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MicroweberInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'userfiles/modules/{$install_item_dir}/',
8
- 'module-skin' => 'userfiles/modules/{$install_item_dir}/templates/',
9
- 'template' => 'userfiles/templates/{$install_item_dir}/',
10
- 'element' => 'userfiles/elements/{$install_item_dir}/',
11
- 'vendor' => 'vendor/{$install_item_dir}/',
12
- 'components' => 'components/{$install_item_dir}/'
13
- );
14
-
15
- /**
16
- * Format package name.
17
- *
18
- * For package type microweber-module, cut off a trailing '-module' if present
19
- *
20
- * For package type microweber-template, cut off a trailing '-template' if present.
21
- *
22
- */
23
- public function inflectPackageVars($vars)
24
- {
25
-
26
-
27
- if ($this->package->getTargetDir()) {
28
- $vars['install_item_dir'] = $this->package->getTargetDir();
29
- } else {
30
- $vars['install_item_dir'] = $vars['name'];
31
- if ($vars['type'] === 'microweber-template') {
32
- return $this->inflectTemplateVars($vars);
33
- }
34
- if ($vars['type'] === 'microweber-templates') {
35
- return $this->inflectTemplatesVars($vars);
36
- }
37
- if ($vars['type'] === 'microweber-core') {
38
- return $this->inflectCoreVars($vars);
39
- }
40
- if ($vars['type'] === 'microweber-adapter') {
41
- return $this->inflectCoreVars($vars);
42
- }
43
- if ($vars['type'] === 'microweber-module') {
44
- return $this->inflectModuleVars($vars);
45
- }
46
- if ($vars['type'] === 'microweber-modules') {
47
- return $this->inflectModulesVars($vars);
48
- }
49
- if ($vars['type'] === 'microweber-skin') {
50
- return $this->inflectSkinVars($vars);
51
- }
52
- if ($vars['type'] === 'microweber-element' or $vars['type'] === 'microweber-elements') {
53
- return $this->inflectElementVars($vars);
54
- }
55
- }
56
-
57
-
58
- return $vars;
59
- }
60
-
61
- protected function inflectTemplateVars($vars)
62
- {
63
- $vars['install_item_dir'] = preg_replace('/-template$/', '', $vars['install_item_dir']);
64
- $vars['install_item_dir'] = preg_replace('/template-$/', '', $vars['install_item_dir']);
65
-
66
- return $vars;
67
- }
68
-
69
- protected function inflectTemplatesVars($vars)
70
- {
71
- $vars['install_item_dir'] = preg_replace('/-templates$/', '', $vars['install_item_dir']);
72
- $vars['install_item_dir'] = preg_replace('/templates-$/', '', $vars['install_item_dir']);
73
-
74
- return $vars;
75
- }
76
-
77
- protected function inflectCoreVars($vars)
78
- {
79
- $vars['install_item_dir'] = preg_replace('/-providers$/', '', $vars['install_item_dir']);
80
- $vars['install_item_dir'] = preg_replace('/-provider$/', '', $vars['install_item_dir']);
81
- $vars['install_item_dir'] = preg_replace('/-adapter$/', '', $vars['install_item_dir']);
82
-
83
- return $vars;
84
- }
85
-
86
- protected function inflectModuleVars($vars)
87
- {
88
- $vars['install_item_dir'] = preg_replace('/-module$/', '', $vars['install_item_dir']);
89
- $vars['install_item_dir'] = preg_replace('/module-$/', '', $vars['install_item_dir']);
90
-
91
- return $vars;
92
- }
93
-
94
- protected function inflectModulesVars($vars)
95
- {
96
- $vars['install_item_dir'] = preg_replace('/-modules$/', '', $vars['install_item_dir']);
97
- $vars['install_item_dir'] = preg_replace('/modules-$/', '', $vars['install_item_dir']);
98
-
99
- return $vars;
100
- }
101
-
102
- protected function inflectSkinVars($vars)
103
- {
104
- $vars['install_item_dir'] = preg_replace('/-skin$/', '', $vars['install_item_dir']);
105
- $vars['install_item_dir'] = preg_replace('/skin-$/', '', $vars['install_item_dir']);
106
-
107
- return $vars;
108
- }
109
-
110
- protected function inflectElementVars($vars)
111
- {
112
- $vars['install_item_dir'] = preg_replace('/-elements$/', '', $vars['install_item_dir']);
113
- $vars['install_item_dir'] = preg_replace('/elements-$/', '', $vars['install_item_dir']);
114
- $vars['install_item_dir'] = preg_replace('/-element$/', '', $vars['install_item_dir']);
115
- $vars['install_item_dir'] = preg_replace('/element-$/', '', $vars['install_item_dir']);
116
-
117
- return $vars;
118
- }
119
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/ModxInstaller.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * An installer to handle MODX specifics when installing packages.
6
- */
7
- class ModxInstaller extends BaseInstaller
8
- {
9
- protected $locations = array(
10
- 'extra' => 'core/packages/{$name}/'
11
- );
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/MoodleInstaller.php DELETED
@@ -1,58 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class MoodleInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'mod' => 'mod/{$name}/',
8
- 'admin_report' => 'admin/report/{$name}/',
9
- 'atto' => 'lib/editor/atto/plugins/{$name}/',
10
- 'tool' => 'admin/tool/{$name}/',
11
- 'assignment' => 'mod/assignment/type/{$name}/',
12
- 'assignsubmission' => 'mod/assign/submission/{$name}/',
13
- 'assignfeedback' => 'mod/assign/feedback/{$name}/',
14
- 'auth' => 'auth/{$name}/',
15
- 'availability' => 'availability/condition/{$name}/',
16
- 'block' => 'blocks/{$name}/',
17
- 'booktool' => 'mod/book/tool/{$name}/',
18
- 'cachestore' => 'cache/stores/{$name}/',
19
- 'cachelock' => 'cache/locks/{$name}/',
20
- 'calendartype' => 'calendar/type/{$name}/',
21
- 'format' => 'course/format/{$name}/',
22
- 'coursereport' => 'course/report/{$name}/',
23
- 'customcertelement' => 'mod/customcert/element/{$name}/',
24
- 'datafield' => 'mod/data/field/{$name}/',
25
- 'datapreset' => 'mod/data/preset/{$name}/',
26
- 'editor' => 'lib/editor/{$name}/',
27
- 'enrol' => 'enrol/{$name}/',
28
- 'filter' => 'filter/{$name}/',
29
- 'gradeexport' => 'grade/export/{$name}/',
30
- 'gradeimport' => 'grade/import/{$name}/',
31
- 'gradereport' => 'grade/report/{$name}/',
32
- 'gradingform' => 'grade/grading/form/{$name}/',
33
- 'local' => 'local/{$name}/',
34
- 'logstore' => 'admin/tool/log/store/{$name}/',
35
- 'ltisource' => 'mod/lti/source/{$name}/',
36
- 'ltiservice' => 'mod/lti/service/{$name}/',
37
- 'message' => 'message/output/{$name}/',
38
- 'mnetservice' => 'mnet/service/{$name}/',
39
- 'plagiarism' => 'plagiarism/{$name}/',
40
- 'portfolio' => 'portfolio/{$name}/',
41
- 'qbehaviour' => 'question/behaviour/{$name}/',
42
- 'qformat' => 'question/format/{$name}/',
43
- 'qtype' => 'question/type/{$name}/',
44
- 'quizaccess' => 'mod/quiz/accessrule/{$name}/',
45
- 'quiz' => 'mod/quiz/report/{$name}/',
46
- 'report' => 'report/{$name}/',
47
- 'repository' => 'repository/{$name}/',
48
- 'scormreport' => 'mod/scorm/report/{$name}/',
49
- 'search' => 'search/engine/{$name}/',
50
- 'theme' => 'theme/{$name}/',
51
- 'tinymce' => 'lib/editor/tinymce/plugins/{$name}/',
52
- 'profilefield' => 'user/profile/field/{$name}/',
53
- 'webservice' => 'webservice/{$name}/',
54
- 'workshopallocation' => 'mod/workshop/allocation/{$name}/',
55
- 'workshopeval' => 'mod/workshop/eval/{$name}/',
56
- 'workshopform' => 'mod/workshop/form/{$name}/'
57
- );
58
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class OctoberInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- 'plugin' => 'plugins/{$vendor}/{$name}/',
9
- 'theme' => 'themes/{$name}/'
10
- );
11
-
12
- /**
13
- * Format package name.
14
- *
15
- * For package type october-plugin, cut off a trailing '-plugin' if present.
16
- *
17
- * For package type october-theme, cut off a trailing '-theme' if present.
18
- *
19
- */
20
- public function inflectPackageVars($vars)
21
- {
22
- if ($vars['type'] === 'october-plugin') {
23
- return $this->inflectPluginVars($vars);
24
- }
25
-
26
- if ($vars['type'] === 'october-theme') {
27
- return $this->inflectThemeVars($vars);
28
- }
29
-
30
- return $vars;
31
- }
32
-
33
- protected function inflectPluginVars($vars)
34
- {
35
- $vars['name'] = preg_replace('/^oc-|-plugin$/', '', $vars['name']);
36
- $vars['vendor'] = preg_replace('/[^a-z0-9_]/i', '', $vars['vendor']);
37
-
38
- return $vars;
39
- }
40
-
41
- protected function inflectThemeVars($vars)
42
- {
43
- $vars['name'] = preg_replace('/^oc-|-theme$/', '', $vars['name']);
44
-
45
- return $vars;
46
- }
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class OntoWikiInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'extension' => 'extensions/{$name}/',
8
- 'theme' => 'extensions/themes/{$name}/',
9
- 'translation' => 'extensions/translations/{$name}/',
10
- );
11
-
12
- /**
13
- * Format package name to lower case and remove ".ontowiki" suffix
14
- */
15
- public function inflectPackageVars($vars)
16
- {
17
- $vars['name'] = strtolower($vars['name']);
18
- $vars['name'] = preg_replace('/.ontowiki$/', '', $vars['name']);
19
- $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
20
- $vars['name'] = preg_replace('/-translation$/', '', $vars['name']);
21
-
22
- return $vars;
23
- }
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php DELETED
@@ -1,14 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
-
5
- class OsclassInstaller extends BaseInstaller
6
- {
7
-
8
- protected $locations = array(
9
- 'plugin' => 'oc-content/plugins/{$name}/',
10
- 'theme' => 'oc-content/themes/{$name}/',
11
- 'language' => 'oc-content/languages/{$name}/',
12
- );
13
-
14
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/OxidInstaller.php DELETED
@@ -1,59 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- use Composer\Package\PackageInterface;
5
-
6
- class OxidInstaller extends BaseInstaller
7
- {
8
- const VENDOR_PATTERN = '/^modules\/(?P<vendor>.+)\/.+/';
9
-
10
- protected $locations = array(
11
- 'module' => 'modules/{$name}/',
12
- 'theme' => 'application/views/{$name}/',
13
- 'out' => 'out/{$name}/',
14
- );
15
-
16
- /**
17
- * getInstallPath
18
- *
19
- * @param PackageInterface $package
20
- * @param string $frameworkType
21
- * @return void
22
- */
23
- public function getInstallPath(PackageInterface $package, $frameworkType = '')
24
- {
25
- $installPath = parent::getInstallPath($package, $frameworkType);
26
- $type = $this->package->getType();
27
- if ($type === 'oxid-module') {
28
- $this->prepareVendorDirectory($installPath);
29
- }
30
- return $installPath;
31
- }
32
-
33
- /**
34
- * prepareVendorDirectory
35
- *
36
- * Makes sure there is a vendormetadata.php file inside
37
- * the vendor folder if there is a vendor folder.
38
- *
39
- * @param string $installPath
40
- * @return void
41
- */
42
- protected function prepareVendorDirectory($installPath)
43
- {
44
- $matches = '';
45
- $hasVendorDirectory = preg_match(self::VENDOR_PATTERN, $installPath, $matches);
46
- if (!$hasVendorDirectory) {
47
- return;
48
- }
49
-
50
- $vendorDirectory = $matches['vendor'];
51
- $vendorPath = getcwd() . '/modules/' . $vendorDirectory;
52
- if (!file_exists($vendorPath)) {
53
- mkdir($vendorPath, 0755, true);
54
- }
55
-
56
- $vendorMetaDataPath = $vendorPath . '/vendormetadata.php';
57
- touch($vendorMetaDataPath);
58
- }
59
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/PPIInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PPIInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/PhiftyInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PhiftyInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'bundle' => 'bundles/{$name}/',
8
- 'library' => 'libraries/{$name}/',
9
- 'framework' => 'frameworks/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/PhpBBInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PhpBBInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'extension' => 'ext/{$vendor}/{$name}/',
8
- 'language' => 'language/{$name}/',
9
- 'style' => 'styles/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PimcoreInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'plugins/{$name}/',
8
- );
9
-
10
- /**
11
- * Format package name to CamelCase
12
- */
13
- public function inflectPackageVars($vars)
14
- {
15
- $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
16
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
17
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
18
-
19
- return $vars;
20
- }
21
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/PiwikInstaller.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * Class PiwikInstaller
6
- *
7
- * @package Composer\Installers
8
- */
9
- class PiwikInstaller extends BaseInstaller
10
- {
11
- /**
12
- * @var array
13
- */
14
- protected $locations = array(
15
- 'plugin' => 'plugins/{$name}/',
16
- );
17
-
18
- /**
19
- * Format package name to CamelCase
20
- * @param array $vars
21
- *
22
- * @return array
23
- */
24
- public function inflectPackageVars($vars)
25
- {
26
- $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
27
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
28
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
29
-
30
- return $vars;
31
- }
32
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php DELETED
@@ -1,29 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PlentymarketsInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => '{$name}/'
8
- );
9
-
10
- /**
11
- * Remove hyphen, "plugin" and format to camelcase
12
- * @param array $vars
13
- *
14
- * @return array
15
- */
16
- public function inflectPackageVars($vars)
17
- {
18
- $vars['name'] = explode("-", $vars['name']);
19
- foreach ($vars['name'] as $key => $name) {
20
- $vars['name'][$key] = ucfirst($vars['name'][$key]);
21
- if (strcasecmp($name, "Plugin") == 0) {
22
- unset($vars['name'][$key]);
23
- }
24
- }
25
- $vars['name'] = implode("",$vars['name']);
26
-
27
- return $vars;
28
- }
29
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/Plugin.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers;
4
-
5
- use Composer\Composer;
6
- use Composer\IO\IOInterface;
7
- use Composer\Plugin\PluginInterface;
8
-
9
- class Plugin implements PluginInterface
10
- {
11
-
12
- public function activate(Composer $composer, IOInterface $io)
13
- {
14
- $installer = new Installer($io, $composer);
15
- $composer->getInstallationManager()->addInstaller($installer);
16
- }
17
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/PortoInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PortoInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'container' => 'app/Containers/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/PrestashopInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PrestashopInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$name}/',
8
- 'theme' => 'themes/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers;
4
-
5
- class PuppetInstaller extends BaseInstaller
6
- {
7
-
8
- protected $locations = array(
9
- 'module' => 'modules/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php DELETED
@@ -1,63 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class PxcmsInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'app/Modules/{$name}/',
8
- 'theme' => 'themes/{$name}/',
9
- );
10
-
11
- /**
12
- * Format package name.
13
- *
14
- * @param array $vars
15
- *
16
- * @return array
17
- */
18
- public function inflectPackageVars($vars)
19
- {
20
- if ($vars['type'] === 'pxcms-module') {
21
- return $this->inflectModuleVars($vars);
22
- }
23
-
24
- if ($vars['type'] === 'pxcms-theme') {
25
- return $this->inflectThemeVars($vars);
26
- }
27
-
28
- return $vars;
29
- }
30
-
31
- /**
32
- * For package type pxcms-module, cut off a trailing '-plugin' if present.
33
- *
34
- * return string
35
- */
36
- protected function inflectModuleVars($vars)
37
- {
38
- $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy)
39
- $vars['name'] = str_replace('module-', '', $vars['name']); // strip out module-
40
- $vars['name'] = preg_replace('/-module$/', '', $vars['name']); // strip out -module
41
- $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s
42
- $vars['name'] = ucwords($vars['name']); // make module name camelcased
43
-
44
- return $vars;
45
- }
46
-
47
-
48
- /**
49
- * For package type pxcms-module, cut off a trailing '-plugin' if present.
50
- *
51
- * return string
52
- */
53
- protected function inflectThemeVars($vars)
54
- {
55
- $vars['name'] = str_replace('pxcms-', '', $vars['name']); // strip out pxcms- just incase (legacy)
56
- $vars['name'] = str_replace('theme-', '', $vars['name']); // strip out theme-
57
- $vars['name'] = preg_replace('/-theme$/', '', $vars['name']); // strip out -theme
58
- $vars['name'] = str_replace('-', '_', $vars['name']); // make -'s be _'s
59
- $vars['name'] = ucwords($vars['name']); // make module name camelcased
60
-
61
- return $vars;
62
- }
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/RadPHPInstaller.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class RadPHPInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'bundle' => 'src/{$name}/'
8
- );
9
-
10
- /**
11
- * Format package name to CamelCase
12
- */
13
- public function inflectPackageVars($vars)
14
- {
15
- $nameParts = explode('/', $vars['name']);
16
- foreach ($nameParts as &$value) {
17
- $value = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $value));
18
- $value = str_replace(array('-', '_'), ' ', $value);
19
- $value = str_replace(' ', '', ucwords($value));
20
- }
21
- $vars['name'] = implode('/', $nameParts);
22
- return $vars;
23
- }
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/ReIndexInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class ReIndexInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'theme' => 'themes/{$name}/',
8
- 'plugin' => 'plugins/{$name}/'
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/Redaxo5Installer.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class Redaxo5Installer extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'addon' => 'redaxo/src/addons/{$name}/',
8
- 'bestyle-plugin' => 'redaxo/src/addons/be_style/plugins/{$name}/'
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/RedaxoInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class RedaxoInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'addon' => 'redaxo/include/addons/{$name}/',
8
- 'bestyle-plugin' => 'redaxo/include/addons/be_style/plugins/{$name}/'
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/RoundcubeInstaller.php DELETED
@@ -1,22 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class RoundcubeInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'plugins/{$name}/',
8
- );
9
-
10
- /**
11
- * Lowercase name and changes the name to a underscores
12
- *
13
- * @param array $vars
14
- * @return array
15
- */
16
- public function inflectPackageVars($vars)
17
- {
18
- $vars['name'] = strtolower(str_replace('-', '_', $vars['name']));
19
-
20
- return $vars;
21
- }
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/SMFInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class SMFInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'Sources/{$name}/',
8
- 'theme' => 'Themes/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/ShopwareInstaller.php DELETED
@@ -1,60 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * Plugin/theme installer for shopware
6
- * @author Benjamin Boit
7
- */
8
- class ShopwareInstaller extends BaseInstaller
9
- {
10
- protected $locations = array(
11
- 'backend-plugin' => 'engine/Shopware/Plugins/Local/Backend/{$name}/',
12
- 'core-plugin' => 'engine/Shopware/Plugins/Local/Core/{$name}/',
13
- 'frontend-plugin' => 'engine/Shopware/Plugins/Local/Frontend/{$name}/',
14
- 'theme' => 'templates/{$name}/',
15
- 'plugin' => 'custom/plugins/{$name}/',
16
- 'frontend-theme' => 'themes/Frontend/{$name}/',
17
- );
18
-
19
- /**
20
- * Transforms the names
21
- * @param array $vars
22
- * @return array
23
- */
24
- public function inflectPackageVars($vars)
25
- {
26
- if ($vars['type'] === 'shopware-theme') {
27
- return $this->correctThemeName($vars);
28
- }
29
-
30
- return $this->correctPluginName($vars);
31
- }
32
-
33
- /**
34
- * Changes the name to a camelcased combination of vendor and name
35
- * @param array $vars
36
- * @return array
37
- */
38
- private function correctPluginName($vars)
39
- {
40
- $camelCasedName = preg_replace_callback('/(-[a-z])/', function ($matches) {
41
- return strtoupper($matches[0][1]);
42
- }, $vars['name']);
43
-
44
- $vars['name'] = ucfirst($vars['vendor']) . ucfirst($camelCasedName);
45
-
46
- return $vars;
47
- }
48
-
49
- /**
50
- * Changes the name to a underscore separated name
51
- * @param array $vars
52
- * @return array
53
- */
54
- private function correctThemeName($vars)
55
- {
56
- $vars['name'] = str_replace('-', '_', $vars['name']);
57
-
58
- return $vars;
59
- }
60
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/SilverStripeInstaller.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- use Composer\Package\PackageInterface;
5
-
6
- class SilverStripeInstaller extends BaseInstaller
7
- {
8
- protected $locations = array(
9
- 'module' => '{$name}/',
10
- 'theme' => 'themes/{$name}/',
11
- );
12
-
13
- /**
14
- * Return the install path based on package type.
15
- *
16
- * Relies on built-in BaseInstaller behaviour with one exception: silverstripe/framework
17
- * must be installed to 'sapphire' and not 'framework' if the version is <3.0.0
18
- *
19
- * @param PackageInterface $package
20
- * @param string $frameworkType
21
- * @return string
22
- */
23
- public function getInstallPath(PackageInterface $package, $frameworkType = '')
24
- {
25
- if (
26
- $package->getName() == 'silverstripe/framework'
27
- && preg_match('/^\d+\.\d+\.\d+/', $package->getVersion())
28
- && version_compare($package->getVersion(), '2.999.999') < 0
29
- ) {
30
- return $this->templatePath($this->locations['module'], array('name' => 'sapphire'));
31
- }
32
-
33
- return parent::getInstallPath($package, $frameworkType);
34
- }
35
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/SiteDirectInstaller.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers;
4
-
5
- class SiteDirectInstaller extends BaseInstaller
6
- {
7
- protected $locations = array(
8
- 'module' => 'modules/{$vendor}/{$name}/',
9
- 'plugin' => 'plugins/{$vendor}/{$name}/'
10
- );
11
-
12
- public function inflectPackageVars($vars)
13
- {
14
- return $this->parseVars($vars);
15
- }
16
-
17
- protected function parseVars($vars)
18
- {
19
- $vars['vendor'] = strtolower($vars['vendor']) == 'sitedirect' ? 'SiteDirect' : $vars['vendor'];
20
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
21
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
22
-
23
- return $vars;
24
- }
25
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php DELETED
@@ -1,49 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class SyDESInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'app/modules/{$name}/',
8
- 'theme' => 'themes/{$name}/',
9
- );
10
-
11
- /**
12
- * Format module name.
13
- *
14
- * Strip `sydes-` prefix and a trailing '-theme' or '-module' from package name if present.
15
- *
16
- * @param array @vars
17
- *
18
- * @return array
19
- */
20
- public function inflectPackageVars($vars)
21
- {
22
- if ($vars['type'] == 'sydes-module') {
23
- return $this->inflectModuleVars($vars);
24
- }
25
-
26
- if ($vars['type'] === 'sydes-theme') {
27
- return $this->inflectThemeVars($vars);
28
- }
29
-
30
- return $vars;
31
- }
32
-
33
- public function inflectModuleVars($vars)
34
- {
35
- $vars['name'] = preg_replace('/(^sydes-|-module$)/i', '', $vars['name']);
36
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
37
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
38
-
39
- return $vars;
40
- }
41
-
42
- protected function inflectThemeVars($vars)
43
- {
44
- $vars['name'] = preg_replace('/(^sydes-|-theme$)/', '', $vars['name']);
45
- $vars['name'] = strtolower($vars['name']);
46
-
47
- return $vars;
48
- }
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/Symfony1Installer.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * Plugin installer for symfony 1.x
6
- *
7
- * @author Jérôme Tamarelle <jerome@tamarelle.net>
8
- */
9
- class Symfony1Installer extends BaseInstaller
10
- {
11
- protected $locations = array(
12
- 'plugin' => 'plugins/{$name}/',
13
- );
14
-
15
- /**
16
- * Format package name to CamelCase
17
- */
18
- public function inflectPackageVars($vars)
19
- {
20
- $vars['name'] = preg_replace_callback('/(-[a-z])/', function ($matches) {
21
- return strtoupper($matches[0][1]);
22
- }, $vars['name']);
23
-
24
- return $vars;
25
- }
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/TYPO3CmsInstaller.php DELETED
@@ -1,16 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * Extension installer for TYPO3 CMS
6
- *
7
- * @deprecated since 1.0.25, use https://packagist.org/packages/typo3/cms-composer-installers instead
8
- *
9
- * @author Sascha Egerer <sascha.egerer@dkd.de>
10
- */
11
- class TYPO3CmsInstaller extends BaseInstaller
12
- {
13
- protected $locations = array(
14
- 'extension' => 'typo3conf/ext/{$name}/',
15
- );
16
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/TYPO3FlowInstaller.php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * An installer to handle TYPO3 Flow specifics when installing packages.
6
- */
7
- class TYPO3FlowInstaller extends BaseInstaller
8
- {
9
- protected $locations = array(
10
- 'package' => 'Packages/Application/{$name}/',
11
- 'framework' => 'Packages/Framework/{$name}/',
12
- 'plugin' => 'Packages/Plugins/{$name}/',
13
- 'site' => 'Packages/Sites/{$name}/',
14
- 'boilerplate' => 'Packages/Boilerplates/{$name}/',
15
- 'build' => 'Build/{$name}/',
16
- );
17
-
18
- /**
19
- * Modify the package name to be a TYPO3 Flow style key.
20
- *
21
- * @param array $vars
22
- * @return array
23
- */
24
- public function inflectPackageVars($vars)
25
- {
26
- $autoload = $this->package->getAutoload();
27
- if (isset($autoload['psr-0']) && is_array($autoload['psr-0'])) {
28
- $namespace = key($autoload['psr-0']);
29
- $vars['name'] = str_replace('\\', '.', $namespace);
30
- }
31
- if (isset($autoload['psr-4']) && is_array($autoload['psr-4'])) {
32
- $namespace = key($autoload['psr-4']);
33
- $vars['name'] = rtrim(str_replace('\\', '.', $namespace), '.');
34
- }
35
-
36
- return $vars;
37
- }
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/TaoInstaller.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- /**
5
- * An installer to handle TAO extensions.
6
- */
7
- class TaoInstaller extends BaseInstaller
8
- {
9
- protected $locations = array(
10
- 'extension' => '{$name}'
11
- );
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/TheliaInstaller.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class TheliaInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'local/modules/{$name}/',
8
- 'frontoffice-template' => 'templates/frontOffice/{$name}/',
9
- 'backoffice-template' => 'templates/backOffice/{$name}/',
10
- 'email-template' => 'templates/email/{$name}/',
11
- );
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/TuskInstaller.php DELETED
@@ -1,14 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
- /**
4
- * Composer installer for 3rd party Tusk utilities
5
- * @author Drew Ewing <drew@phenocode.com>
6
- */
7
- class TuskInstaller extends BaseInstaller
8
- {
9
- protected $locations = array(
10
- 'task' => '.tusk/tasks/{$name}/',
11
- 'command' => '.tusk/commands/{$name}/',
12
- 'asset' => 'assets/tusk/{$name}/',
13
- );
14
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class UserFrostingInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'sprinkle' => 'app/sprinkles/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class VanillaInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'plugins/{$name}/',
8
- 'theme' => 'themes/{$name}/',
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php DELETED
@@ -1,49 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class VgmcpInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'bundle' => 'src/{$vendor}/{$name}/',
8
- 'theme' => 'themes/{$name}/'
9
- );
10
-
11
- /**
12
- * Format package name.
13
- *
14
- * For package type vgmcp-bundle, cut off a trailing '-bundle' if present.
15
- *
16
- * For package type vgmcp-theme, cut off a trailing '-theme' if present.
17
- *
18
- */
19
- public function inflectPackageVars($vars)
20
- {
21
- if ($vars['type'] === 'vgmcp-bundle') {
22
- return $this->inflectPluginVars($vars);
23
- }
24
-
25
- if ($vars['type'] === 'vgmcp-theme') {
26
- return $this->inflectThemeVars($vars);
27
- }
28
-
29
- return $vars;
30
- }
31
-
32
- protected function inflectPluginVars($vars)
33
- {
34
- $vars['name'] = preg_replace('/-bundle$/', '', $vars['name']);
35
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
36
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
37
-
38
- return $vars;
39
- }
40
-
41
- protected function inflectThemeVars($vars)
42
- {
43
- $vars['name'] = preg_replace('/-theme$/', '', $vars['name']);
44
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
45
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
46
-
47
- return $vars;
48
- }
49
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/WHMCSInstaller.php DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers;
4
-
5
- class WHMCSInstaller extends BaseInstaller
6
- {
7
- protected $locations = array(
8
- 'addons' => 'modules/addons/{$vendor}_{$name}/',
9
- 'fraud' => 'modules/fraud/{$vendor}_{$name}/',
10
- 'gateways' => 'modules/gateways/{$vendor}_{$name}/',
11
- 'notifications' => 'modules/notifications/{$vendor}_{$name}/',
12
- 'registrars' => 'modules/registrars/{$vendor}_{$name}/',
13
- 'reports' => 'modules/reports/{$vendor}_{$name}/',
14
- 'security' => 'modules/security/{$vendor}_{$name}/',
15
- 'servers' => 'modules/servers/{$vendor}_{$name}/',
16
- 'social' => 'modules/social/{$vendor}_{$name}/',
17
- 'support' => 'modules/support/{$vendor}_{$name}/',
18
- 'templates' => 'templates/{$vendor}_{$name}/',
19
- 'includes' => 'includes/{$vendor}_{$name}/'
20
- );
21
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/WolfCMSInstaller.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class WolfCMSInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'wolf/plugins/{$name}/',
8
- );
9
- }
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/WordPressInstaller.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class WordPressInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'plugin' => 'wp-content/plugins/{$name}/',
8
- 'theme' => 'wp-content/themes/{$name}/',
9
- 'muplugin' => 'wp-content/mu-plugins/{$name}/',
10
- 'dropin' => 'wp-content/{$name}/',
11
- );
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/YawikInstaller.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
- /**
3
- * Created by PhpStorm.
4
- * User: cbleek
5
- * Date: 25.03.16
6
- * Time: 20:55
7
- */
8
-
9
- namespace Composer\Installers;
10
-
11
-
12
- class YawikInstaller extends BaseInstaller
13
- {
14
- protected $locations = array(
15
- 'module' => 'module/{$name}/',
16
- );
17
-
18
- /**
19
- * Format package name to CamelCase
20
- * @param array $vars
21
- *
22
- * @return array
23
- */
24
- public function inflectPackageVars($vars)
25
- {
26
- $vars['name'] = strtolower(preg_replace('/(?<=\\w)([A-Z])/', '_\\1', $vars['name']));
27
- $vars['name'] = str_replace(array('-', '_'), ' ', $vars['name']);
28
- $vars['name'] = str_replace(' ', '', ucwords($vars['name']));
29
-
30
- return $vars;
31
- }
32
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/ZendInstaller.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class ZendInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'library' => 'library/{$name}/',
8
- 'extra' => 'extras/library/{$name}/',
9
- 'module' => 'module/{$name}/',
10
- );
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php DELETED
@@ -1,10 +0,0 @@
1
- <?php
2
- namespace Composer\Installers;
3
-
4
- class ZikulaInstaller extends BaseInstaller
5
- {
6
- protected $locations = array(
7
- 'module' => 'modules/{$vendor}-{$name}/',
8
- 'theme' => 'themes/{$vendor}-{$name}/'
9
- );
10
- }
 
 
 
 
 
 
 
 
 
 
vendor/vendor/composer/installers/src/bootstrap.php DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
- function includeIfExists($file)
3
- {
4
- if (file_exists($file)) {
5
- return include $file;
6
- }
7
- }
8
- if ((!$loader = includeIfExists(__DIR__ . '/../vendor/autoload.php')) && (!$loader = includeIfExists(__DIR__ . '/../../../autoload.php'))) {
9
- die('You must set up the project dependencies, run the following commands:'.PHP_EOL.
10
- 'curl -s http://getcomposer.org/installer | php'.PHP_EOL.
11
- 'php composer.phar install'.PHP_EOL);
12
- }
13
- return $loader;
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/symfony/polyfill-ctype/Ctype.php DELETED
@@ -1,227 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Symfony\Polyfill\Ctype;
13
-
14
- /**
15
- * Ctype implementation through regex.
16
- *
17
- * @internal
18
- *
19
- * @author Gert de Pagter <BackEndTea@gmail.com>
20
- */
21
- final class Ctype
22
- {
23
- /**
24
- * Returns TRUE if every character in text is either a letter or a digit, FALSE otherwise.
25
- *
26
- * @see https://php.net/ctype-alnum
27
- *
28
- * @param string|int $text
29
- *
30
- * @return bool
31
- */
32
- public static function ctype_alnum($text)
33
- {
34
- $text = self::convert_int_to_char_for_ctype($text);
35
-
36
- return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text);
37
- }
38
-
39
- /**
40
- * Returns TRUE if every character in text is a letter, FALSE otherwise.
41
- *
42
- * @see https://php.net/ctype-alpha
43
- *
44
- * @param string|int $text
45
- *
46
- * @return bool
47
- */
48
- public static function ctype_alpha($text)
49
- {
50
- $text = self::convert_int_to_char_for_ctype($text);
51
-
52
- return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text);
53
- }
54
-
55
- /**
56
- * Returns TRUE if every character in text is a control character from the current locale, FALSE otherwise.
57
- *
58
- * @see https://php.net/ctype-cntrl
59
- *
60
- * @param string|int $text
61
- *
62
- * @return bool
63
- */
64
- public static function ctype_cntrl($text)
65
- {
66
- $text = self::convert_int_to_char_for_ctype($text);
67
-
68
- return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text);
69
- }
70
-
71
- /**
72
- * Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise.
73
- *
74
- * @see https://php.net/ctype-digit
75
- *
76
- * @param string|int $text
77
- *
78
- * @return bool
79
- */
80
- public static function ctype_digit($text)
81
- {
82
- $text = self::convert_int_to_char_for_ctype($text);
83
-
84
- return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text);
85
- }
86
-
87
- /**
88
- * Returns TRUE if every character in text is printable and actually creates visible output (no white space), FALSE otherwise.
89
- *
90
- * @see https://php.net/ctype-graph
91
- *
92
- * @param string|int $text
93
- *
94
- * @return bool
95
- */
96
- public static function ctype_graph($text)
97
- {
98
- $text = self::convert_int_to_char_for_ctype($text);
99
-
100
- return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text);
101
- }
102
-
103
- /**
104
- * Returns TRUE if every character in text is a lowercase letter.
105
- *
106
- * @see https://php.net/ctype-lower
107
- *
108
- * @param string|int $text
109
- *
110
- * @return bool
111
- */
112
- public static function ctype_lower($text)
113
- {
114
- $text = self::convert_int_to_char_for_ctype($text);
115
-
116
- return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text);
117
- }
118
-
119
- /**
120
- * Returns TRUE if every character in text will actually create output (including blanks). Returns FALSE if text contains control characters or characters that do not have any output or control function at all.
121
- *
122
- * @see https://php.net/ctype-print
123
- *
124
- * @param string|int $text
125
- *
126
- * @return bool
127
- */
128
- public static function ctype_print($text)
129
- {
130
- $text = self::convert_int_to_char_for_ctype($text);
131
-
132
- return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text);
133
- }
134
-
135
- /**
136
- * Returns TRUE if every character in text is printable, but neither letter, digit or blank, FALSE otherwise.
137
- *
138
- * @see https://php.net/ctype-punct
139
- *
140
- * @param string|int $text
141
- *
142
- * @return bool
143
- */
144
- public static function ctype_punct($text)
145
- {
146
- $text = self::convert_int_to_char_for_ctype($text);
147
-
148
- return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text);
149
- }
150
-
151
- /**
152
- * Returns TRUE if every character in text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters.
153
- *
154
- * @see https://php.net/ctype-space
155
- *
156
- * @param string|int $text
157
- *
158
- * @return bool
159
- */
160
- public static function ctype_space($text)
161
- {
162
- $text = self::convert_int_to_char_for_ctype($text);
163
-
164
- return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text);
165
- }
166
-
167
- /**
168
- * Returns TRUE if every character in text is an uppercase letter.
169
- *
170
- * @see https://php.net/ctype-upper
171
- *
172
- * @param string|int $text
173
- *
174
- * @return bool
175
- */
176
- public static function ctype_upper($text)
177
- {
178
- $text = self::convert_int_to_char_for_ctype($text);
179
-
180
- return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text);
181
- }
182
-
183
- /**
184
- * Returns TRUE if every character in text is a hexadecimal 'digit', that is a decimal digit or a character from [A-Fa-f] , FALSE otherwise.
185
- *
186
- * @see https://php.net/ctype-xdigit
187
- *
188
- * @param string|int $text
189
- *
190
- * @return bool
191
- */
192
- public static function ctype_xdigit($text)
193
- {
194
- $text = self::convert_int_to_char_for_ctype($text);
195
-
196
- return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text);
197
- }
198
-
199
- /**
200
- * Converts integers to their char versions according to normal ctype behaviour, if needed.
201
- *
202
- * If an integer between -128 and 255 inclusive is provided,
203
- * it is interpreted as the ASCII value of a single character
204
- * (negative values have 256 added in order to allow characters in the Extended ASCII range).
205
- * Any other integer is interpreted as a string containing the decimal digits of the integer.
206
- *
207
- * @param string|int $int
208
- *
209
- * @return mixed
210
- */
211
- private static function convert_int_to_char_for_ctype($int)
212
- {
213
- if (!\is_int($int)) {
214
- return $int;
215
- }
216
-
217
- if ($int < -128 || $int > 255) {
218
- return (string) $int;
219
- }
220
-
221
- if ($int < 0) {
222
- $int += 256;
223
- }
224
-
225
- return \chr($int);
226
- }
227
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/symfony/polyfill-ctype/LICENSE DELETED
@@ -1,19 +0,0 @@
1
- Copyright (c) 2018-2019 Fabien Potencier
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is furnished
8
- to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all
11
- copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/symfony/polyfill-ctype/README.md DELETED
@@ -1,12 +0,0 @@
1
- Symfony Polyfill / Ctype
2
- ========================
3
-
4
- This component provides `ctype_*` functions to users who run php versions without the ctype extension.
5
-
6
- More information can be found in the
7
- [main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md).
8
-
9
- License
10
- =======
11
-
12
- This library is released under the [MIT license](LICENSE).
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/symfony/polyfill-ctype/bootstrap.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of the Symfony package.
5
- *
6
- * (c) Fabien Potencier <fabien@symfony.com>
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- use Symfony\Polyfill\Ctype as p;
13
-
14
- if (!function_exists('ctype_alnum')) {
15
- function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); }
16
- function ctype_alpha($text) { return p\Ctype::ctype_alpha($text); }
17
- function ctype_cntrl($text) { return p\Ctype::ctype_cntrl($text); }
18
- function ctype_digit($text) { return p\Ctype::ctype_digit($text); }
19
- function ctype_graph($text) { return p\Ctype::ctype_graph($text); }
20
- function ctype_lower($text) { return p\Ctype::ctype_lower($text); }
21
- function ctype_print($text) { return p\Ctype::ctype_print($text); }
22
- function ctype_punct($text) { return p\Ctype::ctype_punct($text); }
23
- function ctype_space($text) { return p\Ctype::ctype_space($text); }
24
- function ctype_upper($text) { return p\Ctype::ctype_upper($text); }
25
- function ctype_xdigit($text) { return p\Ctype::ctype_xdigit($text); }
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/symfony/polyfill-ctype/composer.json DELETED
@@ -1,34 +0,0 @@
1
- {
2
- "name": "symfony/polyfill-ctype",
3
- "type": "library",
4
- "description": "Symfony polyfill for ctype functions",
5
- "keywords": ["polyfill", "compatibility", "portable", "ctype"],
6
- "homepage": "https://symfony.com",
7
- "license": "MIT",
8
- "authors": [
9
- {
10
- "name": "Gert de Pagter",
11
- "email": "BackEndTea@gmail.com"
12
- },
13
- {
14
- "name": "Symfony Community",
15
- "homepage": "https://symfony.com/contributors"
16
- }
17
- ],
18
- "require": {
19
- "php": ">=5.3.3"
20
- },
21
- "autoload": {
22
- "psr-4": { "Symfony\\Polyfill\\Ctype\\": "" },
23
- "files": [ "bootstrap.php" ]
24
- },
25
- "suggest": {
26
- "ext-ctype": "For best performance"
27
- },
28
- "minimum-stability": "dev",
29
- "extra": {
30
- "branch-alias": {
31
- "dev-master": "1.12-dev"
32
- }
33
- }
34
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/.editorconfig DELETED
@@ -1,18 +0,0 @@
1
- ; top-most EditorConfig file
2
- root = true
3
-
4
- ; Unix-style newlines
5
- [*]
6
- end_of_line = LF
7
-
8
- [*.php]
9
- indent_style = space
10
- indent_size = 4
11
-
12
- [*.test]
13
- indent_style = space
14
- indent_size = 4
15
-
16
- [*.rst]
17
- indent_style = space
18
- indent_size = 4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/.gitignore DELETED
@@ -1,6 +0,0 @@
1
- /build
2
- /composer.lock
3
- /ext/twig/autom4te.cache/
4
- /phpunit.xml
5
- /vendor
6
- .phpunit.result.cache
 
 
 
 
 
 
vendor/vendor/twig/twig/.php_cs.dist DELETED
@@ -1,20 +0,0 @@
1
- <?php
2
-
3
- return PhpCsFixer\Config::create()
4
- ->setRules([
5
- '@Symfony' => true,
6
- '@Symfony:risky' => true,
7
- '@PHPUnit75Migration:risky' => true,
8
- 'php_unit_dedicate_assert' => ['target' => '5.6'],
9
- 'array_syntax' => ['syntax' => 'short'],
10
- 'php_unit_fqcn_annotation' => true,
11
- 'no_unreachable_default_argument_value' => false,
12
- 'braces' => ['allow_single_line_closure' => true],
13
- 'heredoc_to_nowdoc' => false,
14
- 'ordered_imports' => true,
15
- 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
16
- 'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'all'],
17
- ])
18
- ->setRiskyAllowed(true)
19
- ->setFinder(PhpCsFixer\Finder::create()->in(__DIR__))
20
- ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/.travis.yml DELETED
@@ -1,46 +0,0 @@
1
- language: php
2
-
3
- dist: trusty
4
-
5
- sudo: false
6
-
7
- cache:
8
- directories:
9
- - vendor
10
- - $HOME/.composer/cache/files
11
-
12
-
13
- env:
14
- global:
15
- - TWIG_EXT=no
16
- - SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1
17
-
18
- before_install:
19
- - phpenv config-rm xdebug.ini || return 0
20
-
21
- install:
22
- - travis_retry composer install
23
-
24
- before_script:
25
- - if [ "$TWIG_EXT" == "yes" ]; then sh -c "cd ext/twig && phpize && ./configure --enable-twig && make && make install"; fi
26
- - if [ "$TWIG_EXT" == "yes" ]; then echo "extension=twig.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi
27
-
28
- script: ./vendor/bin/simple-phpunit
29
-
30
- jobs:
31
- fast_finish: true
32
- include:
33
- - php: 5.5
34
- - php: 5.5
35
- env: TWIG_EXT=yes
36
- - php: 5.6
37
- - php: 5.6
38
- env: TWIG_EXT=yes
39
- - php: 7.0
40
- - php: 7.1
41
- - php: 7.2
42
- - php: 7.3
43
- - php: 7.4snapshot
44
- - stage: integration tests
45
- php: 7.3
46
- script: ./drupal_test.sh
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/CHANGELOG DELETED
@@ -1,1129 +0,0 @@
1
- * 1.42.3 (2019-08-24)
2
-
3
- * fixed the "split" filter when the delimiter is "0"
4
- * fixed the "empty" test on Traversable instances
5
- * fixed cache when opcache is installed but disabled
6
- * fixed PHP 7.4 compatibility
7
- * bumped the minimal PHP version to 5.5
8
-
9
- * 1.42.2 (2019-06-18)
10
-
11
- * Display partial output (PHP buffer) when an error occurs in debug mode
12
-
13
- * 1.42.1 (2019-06-04)
14
-
15
- * added support for "Twig\Markup" instances in the "in" test (again)
16
- * allowed string operators as variables names in assignments
17
-
18
- * 1.42.0 (2019-05-31)
19
-
20
- * fixed the "filter" filter when the argument is \Traversable but does not implement \Iterator (\SimpleXmlElement for instance)
21
- * fixed a PHP fatal error when calling a macro imported in a block in a nested block
22
- * fixed a PHP fatal error when calling a macro imported in the template in another macro
23
- * fixed wrong error message on "import" and "from"
24
-
25
- * 1.41.0 (2019-05-14)
26
-
27
- * fixed support for PHP 7.4
28
- * added "filter", "map", and "reduce" filters (and support for arrow functions)
29
- * fixed partial output leak when a PHP fatal error occurs
30
- * optimized context access on PHP 7.4
31
-
32
- * 1.40.1 (2019-04-29)
33
-
34
- * fixed regression in NodeTraverser
35
-
36
- * 1.40.0 (2019-04-28)
37
-
38
- * allowed Twig\NodeVisitor\NodeVisitorInterface::leaveNode() to return "null" instead of "false" (same meaning)
39
- * added the "apply" tag as a replacement for the "filter" tag
40
- * allowed Twig\Loader\FilesystemLoader::findTemplate() to return "null" instead of "false" (same meaning)
41
- * added support for "Twig\Markup" instances in the "in" test
42
- * fixed Lexer when using custom options containing the # char
43
- * fixed "import" when macros are stored in a template string
44
-
45
- * 1.39.1 (2019-04-16)
46
-
47
- * fixed EscaperNodeVisitor
48
-
49
- * 1.39.0 (2019-04-16)
50
-
51
- * added Traversable support for the length filter
52
- * fixed some wrong location in error messages
53
- * made exception creation faster
54
- * made escaping on ternary expressions (?: and ??) more fine-grained
55
- * added the possibility to give a nice name to string templates (template_from_string function)
56
- * fixed the "with" behavior to always include the globals (for consistency with the "include" and "embed" tags)
57
- * fixed "include" with "ignore missing" when an error loading occurs in the included template
58
- * added support for a new whitespace trimming option ({%~ ~%}, {{~ ~}}, {#~ ~#})
59
-
60
- * 1.38.4 (2019-03-23)
61
-
62
- * fixed CheckToStringNode implementation (broken when a function/filter is variadic)
63
-
64
- * 1.38.3 (2019-03-21)
65
-
66
- * fixed the spaceless filter so that it behaves like the spaceless tag
67
- * fixed BC break on Environment::resolveTemplate()
68
- * fixed the bundled Autoloader to also load namespaced classes
69
- * allowed Traversable objects to be used in the "with" tag
70
- * allowed Traversable objects to be used in the "with" argument of the "include" and "embed" tags
71
-
72
- * 1.38.2 (2019-03-12)
73
-
74
- * added TemplateWrapper::getTemplateName()
75
-
76
- * 1.38.1 (2019-03-12)
77
-
78
- * fixed class aliases
79
-
80
- * 1.38.0 (2019-03-12)
81
-
82
- * fixed sandbox security issue (under some circumstances, calling the
83
- __toString() method on an object was possible even if not allowed by the
84
- security policy)
85
- * fixed batch filter clobbers array keys when fill parameter is used
86
- * added preserveKeys support for the batch filter
87
- * fixed "embed" support when used from "template_from_string"
88
- * added the possibility to pass a TemplateWrapper to Twig\Environment::load()
89
- * improved the performance of the sandbox
90
- * added a spaceless filter
91
- * added max value to the "random" function
92
- * made namespace classes the default classes (PSR-0 ones are aliases now)
93
- * removed duplicated directory separator in FilesystemLoader
94
- * added Twig\Loader\ChainLoader::getLoaders()
95
- * changed internal code to use the namespaced classes as much as possible
96
-
97
- * 1.37.1 (2019-01-14)
98
-
99
- * fixed regression (key exists check for non ArrayObject objects)
100
- * fixed logic in TemplateWrapper
101
-
102
- * 1.37.0 (2019-01-14)
103
-
104
- * fixed ArrayObject access with a null value
105
- * fixed embedded templates starting with a BOM
106
- * fixed using a Twig_TemplateWrapper instance as an argument to extends
107
- * switched generated code to use the PHP short array notation
108
- * dropped PHP 5.3 support
109
- * fixed float representation in compiled templates
110
- * added a second argument to the join filter (last separator configuration)
111
-
112
- * 1.36.0 (2018-12-16)
113
-
114
- * made sure twig_include returns a string
115
- * fixed multi-byte UFT-8 in escape('html_attr')
116
- * added the "deprecated" tag
117
- * added support for dynamically named tests
118
- * fixed GlobalsInterface extended class
119
- * fixed filesystem loader throwing an exception instead of returning false
120
-
121
- * 1.35.4 (2018-07-13)
122
-
123
- * ensured that syntax errors are triggered with the right line
124
- * added the Symfony ctype polyfill as a dependency
125
- * "js" filter now produces valid JSON
126
-
127
- * 1.35.3 (2018-03-20)
128
-
129
- * fixed block names unicity
130
- * fixed counting children of SimpleXMLElement objects
131
- * added missing else clause to avoid infinite loops
132
- * fixed .. (range operator) in sandbox policy
133
-
134
- * 1.35.2 (2018-03-03)
135
-
136
- * fixed a regression in the way the profiler is registered in templates
137
-
138
- * 1.35.1 (2018-03-02)
139
-
140
- * added an exception when using "===" instead of "same as"
141
- * fixed possible array to string conversion concealing actual error
142
- * made variable names deterministic in compiled templates
143
- * fixed length filter when passing an instance of IteratorAggregate
144
- * fixed Environment::resolveTemplate to accept instances of TemplateWrapper
145
-
146
- * 1.35.0 (2017-09-27)
147
-
148
- * added Twig_Profiler_Profile::reset()
149
- * fixed use TokenParser to return an empty Node
150
- * added RuntimeExtensionInterface
151
- * added circular reference detection when loading templates
152
-
153
- * 1.34.4 (2017-07-04)
154
-
155
- * added support for runtime loaders in IntegrationTestCase
156
- * fixed deprecation when using Twig_Profiler_Dumper_Html
157
-
158
- * 1.34.3 (2017-06-07)
159
-
160
- * fixed namespaces introduction
161
-
162
- * 1.34.2 (2017-06-05)
163
-
164
- * fixed namespaces introduction
165
-
166
- * 1.34.1 (2017-06-05)
167
-
168
- * fixed namespaces introduction
169
-
170
- * 1.34.0 (2017-06-05)
171
-
172
- * added support for PHPUnit 6 when testing extensions
173
- * fixed PHP 7.2 compatibility
174
- * fixed template name generation in Twig_Environment::createTemplate()
175
- * removed final tag on Twig_TokenParser_Include
176
- * added namespaced aliases for all (non-deprecated) classes and interfaces
177
- * dropped HHVM support
178
- * dropped PHP 5.2 support
179
-
180
- * 1.33.2 (2017-04-20)
181
-
182
- * fixed edge case in the method cache for Twig attributes
183
-
184
- * 1.33.1 (2017-04-18)
185
-
186
- * fixed the empty() test
187
-
188
- * 1.33.0 (2017-03-22)
189
-
190
- * fixed a race condition handling when writing cache files
191
- * "length" filter now returns string length when applied to an object that does
192
- not implement \Countable but provides __toString()
193
- * "empty" test will now consider the return value of the __toString() method for
194
- objects implement __toString() but not \Countable
195
- * fixed JS escaping for unicode characters with higher code points
196
-
197
- * 1.32.0 (2017-02-26)
198
-
199
- * fixed deprecation notice in Twig_Util_DeprecationCollector
200
- * added a PSR-11 compatible runtime loader
201
- * added `side` argument to `trim` to allow left or right trimming only.
202
-
203
- * 1.31.0 (2017-01-11)
204
-
205
- * added Twig_NodeCaptureInterface for nodes that capture all output
206
- * fixed marking the environment as initialized too early
207
- * fixed C89 compat for the C extension
208
- * turned fatal error into exception when a previously generated cache is corrupted
209
- * fixed offline cache warm-ups for embedded templates
210
-
211
- * 1.30.0 (2016-12-23)
212
-
213
- * added Twig_FactoryRuntimeLoader
214
- * deprecated function/test/filter/tag overriding
215
- * deprecated the "disable_c_ext" attribute on Twig_Node_Expression_GetAttr
216
-
217
- * 1.29.0 (2016-12-13)
218
-
219
- * fixed sandbox being left enabled if an exception is thrown while rendering
220
- * marked some classes as being final (via @final)
221
- * made Twig_Error report real source path when possible
222
- * added support for {{ _self }} to provide an upgrade path from 1.x to 2.0 (replaces {{ _self.templateName }})
223
- * deprecated silent display of undefined blocks
224
- * deprecated support for mbstring.func_overload != 0
225
-
226
- * 1.28.2 (2016-11-23)
227
-
228
- * fixed precedence between getFoo() and isFoo() in Twig_Template::getAttribute()
229
- * improved a deprecation message
230
-
231
- * 1.28.1 (2016-11-18)
232
-
233
- * fixed block() function when used with a template argument
234
-
235
- * 1.28.0 (2016-11-17)
236
-
237
- * added support for the PHP 7 null coalescing operator for the ?? Twig implementation
238
- * exposed a way to access template data and methods in a portable way
239
- * changed context access to use the PHP 7 null coalescing operator when available
240
- * added the "with" tag
241
- * added support for a custom template on the block() function
242
- * added "is defined" support for block() and constant()
243
- * optimized the way attributes are fetched
244
-
245
- * 1.27.0 (2016-10-25)
246
-
247
- * deprecated Twig_Parser::getEnvironment()
248
- * deprecated Twig_Parser::addHandler() and Twig_Parser::addNodeVisitor()
249
- * deprecated Twig_Compiler::addIndentation()
250
- * fixed regression when registering two extensions having the same class name
251
- * deprecated Twig_LoaderInterface::getSource() (implement Twig_SourceContextLoaderInterface instead)
252
- * fixed the filesystem loader with relative paths
253
- * deprecated Twig_Node::getLine() in favor of Twig_Node::getTemplateLine()
254
- * deprecated Twig_Template::getSource() in favor of Twig_Template::getSourceContext()
255
- * deprecated Twig_Node::getFilename() in favor of Twig_Node::getTemplateName()
256
- * deprecated the "filename" escaping strategy (use "name" instead)
257
- * added Twig_Source to hold information about the original template
258
- * deprecated Twig_Error::getTemplateFile() and Twig_Error::setTemplateFile() in favor of Twig_Error::getTemplateName() and Twig_Error::setTemplateName()
259
- * deprecated Parser::getFilename()
260
- * fixed template paths when a template name contains a protocol like vfs://
261
- * improved debugging with Twig_Sandbox_SecurityError exceptions for disallowed methods and properties
262
-
263
- * 1.26.1 (2016-10-05)
264
-
265
- * removed template source code from generated template classes when debug is disabled
266
- * fixed default implementation of Twig_Template::getDebugInfo() for better BC
267
- * fixed regression on static calls for functions/filters/tests
268
-
269
- * 1.26.0 (2016-10-02)
270
-
271
- * added template cache invalidation based on more environment options
272
- * added a missing deprecation notice
273
- * fixed template paths when a template is stored in a PHAR file
274
- * allowed filters/functions/tests implementation to use a different class than the extension they belong to
275
- * deprecated Twig_ExtensionInterface::getName()
276
-
277
- * 1.25.0 (2016-09-21)
278
-
279
- * changed the way we store template source in template classes
280
- * removed usage of realpath in cache keys
281
- * fixed Twig cache sharing when used with different versions of PHP
282
- * removed embed parent workaround for simple use cases
283
- * deprecated the ability to store non Node instances in Node::$nodes
284
- * deprecated Twig_Environment::getLexer(), Twig_Environment::getParser(), Twig_Environment::getCompiler()
285
- * deprecated Twig_Compiler::getFilename()
286
-
287
- * 1.24.2 (2016-09-01)
288
-
289
- * fixed static callables
290
- * fixed a potential PHP warning when loading the cache
291
- * fixed a case where the autoescaping does not work as expected
292
-
293
- * 1.24.1 (2016-05-30)
294
-
295
- * fixed reserved keywords (forbids true, false, null and none keywords for variables names)
296
- * fixed support for PHP7 (Throwable support)
297
- * marked the following methods as being internals on Twig_Environment:
298
- getFunctions(), getFilters(), getTests(), getFunction(), getFilter(), getTest(),
299
- getTokenParsers(), getTags(), getNodeVisitors(), getUnaryOperators(), getBinaryOperators(),
300
- getFunctions(), getFilters(), getGlobals(), initGlobals(), initExtensions(), and initExtension()
301
-
302
- * 1.24.0 (2016-01-25)
303
-
304
- * adding support for the ?? operator
305
- * fixed the defined test when used on a constant, a map, or a sequence
306
- * undeprecated _self (should only be used to get the template name, not the template instance)
307
- * fixed parsing on PHP7
308
-
309
- * 1.23.3 (2016-01-11)
310
-
311
- * fixed typo
312
-
313
- * 1.23.2 (2015-01-11)
314
-
315
- * added versions in deprecated messages
316
- * made file cache tolerant for trailing (back)slashes on directory configuration
317
- * deprecated unused Twig_Node_Expression_ExtensionReference class
318
-
319
- * 1.23.1 (2015-11-05)
320
-
321
- * fixed some exception messages which triggered PHP warnings
322
- * fixed BC on Twig_Test_NodeTestCase
323
-
324
- * 1.23.0 (2015-10-29)
325
-
326
- * deprecated the possibility to override an extension by registering another one with the same name
327
- * deprecated Twig_ExtensionInterface::getGlobals() (added Twig_Extension_GlobalsInterface for BC)
328
- * deprecated Twig_ExtensionInterface::initRuntime() (added Twig_Extension_InitRuntimeInterface for BC)
329
- * deprecated Twig_Environment::computeAlternatives()
330
-
331
- * 1.22.3 (2015-10-13)
332
-
333
- * fixed regression when using null as a cache strategy
334
- * improved performance when checking template freshness
335
- * fixed warnings when loaded templates do not exist
336
- * fixed template class name generation to prevent possible collisions
337
- * fixed logic for custom escapers to call them even on integers and null values
338
- * changed template cache names to take into account the Twig C extension
339
-
340
- * 1.22.2 (2015-09-22)
341
-
342
- * fixed a race condition in template loading
343
-
344
- * 1.22.1 (2015-09-15)
345
-
346
- * fixed regression in template_from_string
347
-
348
- * 1.22.0 (2015-09-13)
349
-
350
- * made Twig_Test_IntegrationTestCase more flexible
351
- * added an option to force PHP bytecode invalidation when writing a compiled template into the cache
352
- * fixed the profiler duration for the root node
353
- * changed template cache names to take into account enabled extensions
354
- * deprecated Twig_Environment::clearCacheFiles(), Twig_Environment::getCacheFilename(),
355
- Twig_Environment::writeCacheFile(), and Twig_Environment::getTemplateClassPrefix()
356
- * added a way to override the filesystem template cache system
357
- * added a way to get the original template source from Twig_Template
358
-
359
- * 1.21.2 (2015-09-09)
360
-
361
- * fixed variable names for the deprecation triggering code
362
- * fixed escaping strategy detection based on filename
363
- * added Traversable support for replace, merge, and sort
364
- * deprecated support for character by character replacement for the "replace" filter
365
-
366
- * 1.21.1 (2015-08-26)
367
-
368
- * fixed regression when using the deprecated Twig_Test_* classes
369
-
370
- * 1.21.0 (2015-08-24)
371
-
372
- * added deprecation notices for deprecated features
373
- * added a deprecation "framework" for filters/functions/tests and test fixtures
374
-
375
- * 1.20.0 (2015-08-12)
376
-
377
- * forbid access to the Twig environment from templates and internal parts of Twig_Template
378
- * fixed limited RCEs when in sandbox mode
379
- * deprecated Twig_Template::getEnvironment()
380
- * deprecated the _self variable for usage outside of the from and import tags
381
- * added Twig_BaseNodeVisitor to ease the compatibility of node visitors
382
- between 1.x and 2.x
383
-
384
- * 1.19.0 (2015-07-31)
385
-
386
- * fixed wrong error message when including an undefined template in a child template
387
- * added support for variadic filters, functions, and tests
388
- * added support for extra positional arguments in macros
389
- * added ignore_missing flag to the source function
390
- * fixed batch filter with zero items
391
- * deprecated Twig_Environment::clearTemplateCache()
392
- * fixed sandbox disabling when using the include function
393
-
394
- * 1.18.2 (2015-06-06)
395
-
396
- * fixed template/line guessing in exceptions for nested templates
397
- * optimized the number of inodes and the size of realpath cache when using the cache
398
-
399
- * 1.18.1 (2015-04-19)
400
-
401
- * fixed memory leaks in the C extension
402
- * deprecated Twig_Loader_String
403
- * fixed the slice filter when used with a SimpleXMLElement object
404
- * fixed filesystem loader when trying to load non-files (like directories)
405
-
406
- * 1.18.0 (2015-01-25)
407
-
408
- * fixed some error messages where the line was wrong (unknown variables or argument names)
409
- * added a new way to customize the main Module node (via empty nodes)
410
- * added Twig_Environment::createTemplate() to create a template from a string
411
- * added a profiler
412
- * fixed filesystem loader cache when different file paths are used for the same template
413
-
414
- * 1.17.0 (2015-01-14)
415
-
416
- * added a 'filename' autoescaping strategy, which dynamically chooses the
417
- autoescaping strategy for a template based on template file extension.
418
-
419
- * 1.16.3 (2014-12-25)
420
-
421
- * fixed regression for dynamic parent templates
422
- * fixed cache management with statcache
423
- * fixed a regression in the slice filter
424
-
425
- * 1.16.2 (2014-10-17)
426
-
427
- * fixed timezone on dates as strings
428
- * fixed 2-words test names when a custom node class is not used
429
- * fixed macros when using an argument named like a PHP super global (like GET or POST)
430
- * fixed date_modify when working with DateTimeImmutable
431
- * optimized for loops
432
- * fixed multi-byte characters handling in the split filter
433
- * fixed a regression in the in operator
434
- * fixed a regression in the slice filter
435
-
436
- * 1.16.1 (2014-10-10)
437
-
438
- * improved error reporting in a sandboxed template
439
- * fixed missing error file/line information under certain circumstances
440
- * fixed wrong error line number in some error messages
441
- * fixed the in operator to use strict comparisons
442
- * sped up the slice filter
443
- * fixed for mb function overload mb_substr acting different
444
- * fixed the attribute() function when passing a variable for the arguments
445
-
446
- * 1.16.0 (2014-07-05)
447
-
448
- * changed url_encode to always encode according to RFC 3986
449
- * fixed inheritance in a 'use'-hierarchy
450
- * removed the __toString policy check when the sandbox is disabled
451
- * fixed recursively calling blocks in templates with inheritance
452
-
453
- * 1.15.1 (2014-02-13)
454
-
455
- * fixed the conversion of the special '0000-00-00 00:00' date
456
- * added an error message when trying to import an undefined block from a trait
457
- * fixed a C extension crash when accessing defined but uninitialized property.
458
-
459
- * 1.15.0 (2013-12-06)
460
-
461
- * made ignoreStrictCheck in Template::getAttribute() works with __call() methods throwing BadMethodCallException
462
- * added min and max functions
463
- * added the round filter
464
- * fixed a bug that prevented the optimizers to be enabled/disabled selectively
465
- * fixed first and last filters for UTF-8 strings
466
- * added a source function to include the content of a template without rendering it
467
- * fixed the C extension sandbox behavior when get or set is prepend to method name
468
-
469
- * 1.14.2 (2013-10-30)
470
-
471
- * fixed error filename/line when an error occurs in an included file
472
- * allowed operators that contain whitespaces to have more than one whitespace
473
- * allowed tests to be made of 1 or 2 words (like "same as" or "divisible by")
474
-
475
- * 1.14.1 (2013-10-15)
476
-
477
- * made it possible to use named operators as variables
478
- * fixed the possibility to have a variable named 'matches'
479
- * added support for PHP 5.5 DateTimeInterface
480
-
481
- * 1.14.0 (2013-10-03)
482
-
483
- * fixed usage of the html_attr escaping strategy to avoid double-escaping with the html strategy
484
- * added new operators: ends with, starts with, and matches
485
- * fixed some compatibility issues with HHVM
486
- * added a way to add custom escaping strategies
487
- * fixed the C extension compilation on Windows
488
- * fixed the batch filter when using a fill argument with an exact match of elements to batch
489
- * fixed the filesystem loader cache when a template name exists in several namespaces
490
- * fixed template_from_string when the template includes or extends other ones
491
- * fixed a crash of the C extension on an edge case
492
-
493
- * 1.13.2 (2013-08-03)
494
-
495
- * fixed the error line number for an error occurs in and embedded template
496
- * fixed crashes of the C extension on some edge cases
497
-
498
- * 1.13.1 (2013-06-06)
499
-
500
- * added the possibility to ignore the filesystem constructor argument in Twig_Loader_Filesystem
501
- * fixed Twig_Loader_Chain::exists() for a loader which implements Twig_ExistsLoaderInterface
502
- * adjusted backtrace call to reduce memory usage when an error occurs
503
- * added support for object instances as the second argument of the constant test
504
- * fixed the include function when used in an assignment
505
-
506
- * 1.13.0 (2013-05-10)
507
-
508
- * fixed getting a numeric-like item on a variable ('09' for instance)
509
- * fixed getting a boolean or float key on an array, so it is consistent with PHP's array access:
510
- `{{ array[false] }}` behaves the same as `echo $array[false];` (equals `$array[0]`)
511
- * made the escape filter 20% faster for happy path (escaping string for html with UTF-8)
512
- * changed ☃ to § in tests
513
- * enforced usage of named arguments after positional ones
514
-
515
- * 1.12.3 (2013-04-08)
516
-
517
- * fixed a security issue in the filesystem loader where it was possible to include a template one
518
- level above the configured path
519
- * fixed fatal error that should be an exception when adding a filter/function/test too late
520
- * added a batch filter
521
- * added support for encoding an array as query string in the url_encode filter
522
-
523
- * 1.12.2 (2013-02-09)
524
-
525
- * fixed the timezone used by the date filter and function when the given date contains a timezone (like 2010-01-28T15:00:00+02:00)
526
- * fixed globals when getGlobals is called early on
527
- * added the first and last filter
528
-
529
- * 1.12.1 (2013-01-15)
530
-
531
- * added support for object instances as the second argument of the constant function
532
- * relaxed globals management to avoid a BC break
533
- * added support for {{ some_string[:2] }}
534
-
535
- * 1.12.0 (2013-01-08)
536
-
537
- * added verbatim as an alias for the raw tag to avoid confusion with the raw filter
538
- * fixed registration of tests and functions as anonymous functions
539
- * fixed globals management
540
-
541
- * 1.12.0-RC1 (2012-12-29)
542
-
543
- * added an include function (does the same as the include tag but in a more flexible way)
544
- * added the ability to use any PHP callable to define filters, functions, and tests
545
- * added a syntax error when using a loop variable that is not defined
546
- * added the ability to set default values for macro arguments
547
- * added support for named arguments for filters, tests, and functions
548
- * moved filters/functions/tests syntax errors to the parser
549
- * added support for extended ternary operator syntaxes
550
-
551
- * 1.11.1 (2012-11-11)
552
-
553
- * fixed debug info line numbering (was off by 2)
554
- * fixed escaping when calling a macro inside another one (regression introduced in 1.9.1)
555
- * optimized variable access on PHP 5.4
556
- * fixed a crash of the C extension when an exception was thrown from a macro called without being imported (using _self.XXX)
557
-
558
- * 1.11.0 (2012-11-07)
559
-
560
- * fixed macro compilation when a variable name is a PHP reserved keyword
561
- * changed the date filter behavior to always apply the default timezone, except if false is passed as the timezone
562
- * fixed bitwise operator precedences
563
- * added the template_from_string function
564
- * fixed default timezone usage for the date function
565
- * optimized the way Twig exceptions are managed (to make them faster)
566
- * added Twig_ExistsLoaderInterface (implementing this interface in your loader make the chain loader much faster)
567
-
568
- * 1.10.3 (2012-10-19)
569
-
570
- * fixed wrong template location in some error messages
571
- * reverted a BC break introduced in 1.10.2
572
- * added a split filter
573
-
574
- * 1.10.2 (2012-10-15)
575
-
576
- * fixed macro calls on PHP 5.4
577
-
578
- * 1.10.1 (2012-10-15)
579
-
580
- * made a speed optimization to macro calls when imported via the "import" tag
581
- * fixed C extension compilation on Windows
582
- * fixed a segfault in the C extension when using DateTime objects
583
-
584
- * 1.10.0 (2012-09-28)
585
-
586
- * extracted functional tests framework to make it reusable for third-party extensions
587
- * added namespaced templates support in Twig_Loader_Filesystem
588
- * added Twig_Loader_Filesystem::prependPath()
589
- * fixed an error when a token parser pass a closure as a test to the subparse() method
590
-
591
- * 1.9.2 (2012-08-25)
592
-
593
- * fixed the in operator for objects that contain circular references
594
- * fixed the C extension when accessing a public property of an object implementing the \ArrayAccess interface
595
-
596
- * 1.9.1 (2012-07-22)
597
-
598
- * optimized macro calls when auto-escaping is on
599
- * fixed wrong parent class for Twig_Function_Node
600
- * made Twig_Loader_Chain more explicit about problems
601
-
602
- * 1.9.0 (2012-07-13)
603
-
604
- * made the parsing independent of the template loaders
605
- * fixed exception trace when an error occurs when rendering a child template
606
- * added escaping strategies for CSS, URL, and HTML attributes
607
- * fixed nested embed tag calls
608
- * added the date_modify filter
609
-
610
- * 1.8.3 (2012-06-17)
611
-
612
- * fixed paths in the filesystem loader when passing a path that ends with a slash or a backslash
613
- * fixed escaping when a project defines a function named html or js
614
- * fixed chmod mode to apply the umask correctly
615
-
616
- * 1.8.2 (2012-05-30)
617
-
618
- * added the abs filter
619
- * fixed a regression when using a number in template attributes
620
- * fixed compiler when mbstring.func_overload is set to 2
621
- * fixed DateTimeZone support in date filter
622
-
623
- * 1.8.1 (2012-05-17)
624
-
625
- * fixed a regression when dealing with SimpleXMLElement instances in templates
626
- * fixed "is_safe" value for the "dump" function when "html_errors" is not defined in php.ini
627
- * switched to use mbstring whenever possible instead of iconv (you might need to update your encoding as mbstring and iconv encoding names sometimes differ)
628
-
629
- * 1.8.0 (2012-05-08)
630
-
631
- * enforced interface when adding tests, filters, functions, and node visitors from extensions
632
- * fixed a side-effect of the date filter where the timezone might be changed
633
- * simplified usage of the autoescape tag; the only (optional) argument is now the escaping strategy or false (with a BC layer)
634
- * added a way to dynamically change the auto-escaping strategy according to the template "filename"
635
- * changed the autoescape option to also accept a supported escaping strategy (for BC, true is equivalent to html)
636
- * added an embed tag
637
-
638
- * 1.7.0 (2012-04-24)
639
-
640
- * fixed a PHP warning when using CIFS
641
- * fixed template line number in some exceptions
642
- * added an iterable test
643
- * added an error when defining two blocks with the same name in a template
644
- * added the preserves_safety option for filters
645
- * fixed a PHP notice when trying to access a key on a non-object/array variable
646
- * enhanced error reporting when the template file is an instance of SplFileInfo
647
- * added Twig_Environment::mergeGlobals()
648
- * added compilation checks to avoid misuses of the sandbox tag
649
- * fixed filesystem loader freshness logic for high traffic websites
650
- * fixed random function when charset is null
651
-
652
- * 1.6.5 (2012-04-11)
653
-
654
- * fixed a regression when a template only extends another one without defining any blocks
655
-
656
- * 1.6.4 (2012-04-02)
657
-
658
- * fixed PHP notice in Twig_Error::guessTemplateLine() introduced in 1.6.3
659
- * fixed performance when compiling large files
660
- * optimized parent template creation when the template does not use dynamic inheritance
661
-
662
- * 1.6.3 (2012-03-22)
663
-
664
- * fixed usage of Z_ADDREF_P for PHP 5.2 in the C extension
665
- * fixed compilation of numeric values used in templates when using a locale where the decimal separator is not a dot
666
- * made the strategy used to guess the real template file name and line number in exception messages much faster and more accurate
667
-
668
- * 1.6.2 (2012-03-18)
669
-
670
- * fixed sandbox mode when used with inheritance
671
- * added preserveKeys support for the slice filter
672
- * fixed the date filter when a DateTime instance is passed with a specific timezone
673
- * added a trim filter
674
-
675
- * 1.6.1 (2012-02-29)
676
-
677
- * fixed Twig C extension
678
- * removed the creation of Twig_Markup instances when not needed
679
- * added a way to set the default global timezone for dates
680
- * fixed the slice filter on strings when the length is not specified
681
- * fixed the creation of the cache directory in case of a race condition
682
-
683
- * 1.6.0 (2012-02-04)
684
-
685
- * fixed raw blocks when used with the whitespace trim option
686
- * made a speed optimization to macro calls when imported via the "from" tag
687
- * fixed globals, parsers, visitors, filters, tests, and functions management in Twig_Environment when a new one or new extension is added
688
- * fixed the attribute function when passing arguments
689
- * added slice notation support for the [] operator (syntactic sugar for the slice operator)
690
- * added a slice filter
691
- * added string support for the reverse filter
692
- * fixed the empty test and the length filter for Twig_Markup instances
693
- * added a date function to ease date comparison
694
- * fixed unary operators precedence
695
- * added recursive parsing support in the parser
696
- * added string and integer handling for the random function
697
-
698
- * 1.5.1 (2012-01-05)
699
-
700
- * fixed a regression when parsing strings
701
-
702
- * 1.5.0 (2012-01-04)
703
-
704
- * added Traversable objects support for the join filter
705
-
706
- * 1.5.0-RC2 (2011-12-30)
707
-
708
- * added a way to set the default global date interval format
709
- * fixed the date filter for DateInterval instances (setTimezone() does not exist for them)
710
- * refactored Twig_Template::display() to ease its extension
711
- * added a number_format filter
712
-
713
- * 1.5.0-RC1 (2011-12-26)
714
-
715
- * removed the need to quote hash keys
716
- * allowed hash keys to be any expression
717
- * added a do tag
718
- * added a flush tag
719
- * added support for dynamically named filters and functions
720
- * added a dump function to help debugging templates
721
- * added a nl2br filter
722
- * added a random function
723
- * added a way to change the default format for the date filter
724
- * fixed the lexer when an operator ending with a letter ends a line
725
- * added string interpolation support
726
- * enhanced exceptions for unknown filters, functions, tests, and tags
727
-
728
- * 1.4.0 (2011-12-07)
729
-
730
- * fixed lexer when using big numbers (> PHP_INT_MAX)
731
- * added missing preserveKeys argument to the reverse filter
732
- * fixed macros containing filter tag calls
733
-
734
- * 1.4.0-RC2 (2011-11-27)
735
-
736
- * removed usage of Reflection in Twig_Template::getAttribute()
737
- * added a C extension that can optionally replace Twig_Template::getAttribute()
738
- * added negative timestamp support to the date filter
739
-
740
- * 1.4.0-RC1 (2011-11-20)
741
-
742
- * optimized variable access when using PHP 5.4
743
- * changed the precedence of the .. operator to be more consistent with languages that implements such a feature like Ruby
744
- * added an Exception to Twig_Loader_Array::isFresh() method when the template does not exist to be consistent with other loaders
745
- * added Twig_Function_Node to allow more complex functions to have their own Node class
746
- * added Twig_Filter_Node to allow more complex filters to have their own Node class
747
- * added Twig_Test_Node to allow more complex tests to have their own Node class
748
- * added a better error message when a template is empty but contain a BOM
749
- * fixed "in" operator for empty strings
750
- * fixed the "defined" test and the "default" filter (now works with more than one call (foo.bar.foo) and for both values of the strict_variables option)
751
- * changed the way extensions are loaded (addFilter/addFunction/addGlobal/addTest/addNodeVisitor/addTokenParser/addExtension can now be called in any order)
752
- * added Twig_Environment::display()
753
- * made the escape filter smarter when the encoding is not supported by PHP
754
- * added a convert_encoding filter
755
- * moved all node manipulations outside the compile() Node method
756
- * made several speed optimizations
757
-
758
- * 1.3.0 (2011-10-08)
759
-
760
- no changes
761
-
762
- * 1.3.0-RC1 (2011-10-04)
763
-
764
- * added an optimization for the parent() function
765
- * added cache reloading when auto_reload is true and an extension has been modified
766
- * added the possibility to force the escaping of a string already marked as safe (instance of Twig_Markup)
767
- * allowed empty templates to be used as traits
768
- * added traits support for the "parent" function
769
-
770
- * 1.2.0 (2011-09-13)
771
-
772
- no changes
773
-
774
- * 1.2.0-RC1 (2011-09-10)
775
-
776
- * enhanced the exception when a tag remains unclosed
777
- * added support for empty Countable objects for the "empty" test
778
- * fixed algorithm that determines if a template using inheritance is valid (no output between block definitions)
779
- * added better support for encoding problems when escaping a string (available as of PHP 5.4)
780
- * added a way to ignore a missing template when using the "include" tag ({% include "foo" ignore missing %})
781
- * added support for an array of templates to the "include" and "extends" tags ({% include ['foo', 'bar'] %})
782
- * added support for bitwise operators in expressions
783
- * added the "attribute" function to allow getting dynamic attributes on variables
784
- * added Twig_Loader_Chain
785
- * added Twig_Loader_Array::setTemplate()
786
- * added an optimization for the set tag when used to capture a large chunk of static text
787
- * changed name regex to match PHP one "[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*" (works for blocks, tags, functions, filters, and macros)
788
- * removed the possibility to use the "extends" tag from a block
789
- * added "if" modifier support to "for" loops
790
-
791
- * 1.1.2 (2011-07-30)
792
-
793
- * fixed json_encode filter on PHP 5.2
794
- * fixed regression introduced in 1.1.1 ({{ block(foo|lower) }})
795
- * fixed inheritance when using conditional parents
796
- * fixed compilation of templates when the body of a child template is not empty
797
- * fixed output when a macro throws an exception
798
- * fixed a parsing problem when a large chunk of text is enclosed in a comment tag
799
- * added PHPDoc for all Token parsers and Core extension functions
800
-
801
- * 1.1.1 (2011-07-17)
802
-
803
- * added a performance optimization in the Optimizer (also helps to lower the number of nested level calls)
804
- * made some performance improvement for some edge cases
805
-
806
- * 1.1.0 (2011-06-28)
807
-
808
- * fixed json_encode filter
809
-
810
- * 1.1.0-RC3 (2011-06-24)
811
-
812
- * fixed method case-sensitivity when using the sandbox mode
813
- * added timezone support for the date filter
814
- * fixed possible security problems with NUL bytes
815
-
816
- * 1.1.0-RC2 (2011-06-16)
817
-
818
- * added an exception when the template passed to "use" is not a string
819
- * made 'a.b is defined' not throw an exception if a is not defined (in strict mode)
820
- * added {% line \d+ %} directive
821
-
822
- * 1.1.0-RC1 (2011-05-28)
823
-
824
- Flush your cache after upgrading.
825
-
826
- * fixed date filter when using a timestamp
827
- * fixed the defined test for some cases
828
- * fixed a parsing problem when a large chunk of text is enclosed in a raw tag
829
- * added support for horizontal reuse of template blocks (see docs for more information)
830
- * added whitespace control modifier to all tags (see docs for more information)
831
- * added null as an alias for none (the null test is also an alias for the none test now)
832
- * made TRUE, FALSE, NONE equivalent to their lowercase counterparts
833
- * wrapped all compilation and runtime exceptions with Twig_Error_Runtime and added logic to guess the template name and line
834
- * moved display() method to Twig_Template (generated templates should now use doDisplay() instead)
835
-
836
- * 1.0.0 (2011-03-27)
837
-
838
- * fixed output when using mbstring
839
- * fixed duplicate call of methods when using the sandbox
840
- * made the charset configurable for the escape filter
841
-
842
- * 1.0.0-RC2 (2011-02-21)
843
-
844
- * changed the way {% set %} works when capturing (the content is now marked as safe)
845
- * added support for macro name in the endmacro tag
846
- * make Twig_Error compatible with PHP 5.3.0 >
847
- * fixed an infinite loop on some Windows configurations
848
- * fixed the "length" filter for numbers
849
- * fixed Template::getAttribute() as properties in PHP are case sensitive
850
- * removed coupling between Twig_Node and Twig_Template
851
- * fixed the ternary operator precedence rule
852
-
853
- * 1.0.0-RC1 (2011-01-09)
854
-
855
- Backward incompatibilities:
856
-
857
- * the "items" filter, which has been deprecated for quite a long time now, has been removed
858
- * the "range" filter has been converted to a function: 0|range(10) -> range(0, 10)
859
- * the "constant" filter has been converted to a function: {{ some_date|date('DATE_W3C'|constant) }} -> {{ some_date|date(constant('DATE_W3C')) }}
860
- * the "cycle" filter has been converted to a function: {{ ['odd', 'even']|cycle(i) }} -> {{ cycle(['odd', 'even'], i) }}
861
- * the "for" tag does not support "joined by" anymore
862
- * the "autoescape" first argument is now "true"/"false" (instead of "on"/"off")
863
- * the "parent" tag has been replaced by a "parent" function ({{ parent() }} instead of {% parent %})
864
- * the "display" tag has been replaced by a "block" function ({{ block('title') }} instead of {% display title %})
865
- * removed the grammar and simple token parser (moved to the Twig Extensions repository)
866
-
867
- Changes:
868
-
869
- * added "needs_context" option for filters and functions (the context is then passed as a first argument)
870
- * added global variables support
871
- * made macros return their value instead of echoing directly (fixes calling a macro in sandbox mode)
872
- * added the "from" tag to import macros as functions
873
- * added support for functions (a function is just syntactic sugar for a getAttribute() call)
874
- * made macros callable when sandbox mode is enabled
875
- * added an exception when a macro uses a reserved name
876
- * the "default" filter now uses the "empty" test instead of just checking for null
877
- * added the "empty" test
878
-
879
- * 0.9.10 (2010-12-16)
880
-
881
- Backward incompatibilities:
882
-
883
- * The Escaper extension is enabled by default, which means that all displayed
884
- variables are now automatically escaped. You can revert to the previous
885
- behavior by removing the extension via $env->removeExtension('escaper')
886
- or just set the 'autoescape' option to 'false'.
887
- * removed the "without loop" attribute for the "for" tag (not needed anymore
888
- as the Optimizer take care of that for most cases)
889
- * arrays and hashes have now a different syntax
890
- * arrays keep the same syntax with square brackets: [1, 2]
891
- * hashes now use curly braces (["a": "b"] should now be written as {"a": "b"})
892
- * support for "arrays with keys" and "hashes without keys" is not supported anymore ([1, "foo": "bar"] or {"foo": "bar", 1})
893
- * the i18n extension is now part of the Twig Extensions repository
894
-
895
- Changes:
896
-
897
- * added the merge filter
898
- * removed 'is_escaper' option for filters (a left over from the previous version) -- you must use 'is_safe' now instead
899
- * fixed usage of operators as method names (like is, in, and not)
900
- * changed the order of execution for node visitors
901
- * fixed default() filter behavior when used with strict_variables set to on
902
- * fixed filesystem loader compatibility with PHAR files
903
- * enhanced error messages when an unexpected token is parsed in an expression
904
- * fixed filename not being added to syntax error messages
905
- * added the autoescape option to enable/disable autoescaping
906
- * removed the newline after a comment (mimics PHP behavior)
907
- * added a syntax error exception when parent block is used on a template that does not extend another one
908
- * made the Escaper extension enabled by default
909
- * fixed sandbox extension when used with auto output escaping
910
- * fixed escaper when wrapping a Twig_Node_Print (the original class must be preserved)
911
- * added an Optimizer extension (enabled by default; optimizes "for" loops and "raw" filters)
912
- * added priority to node visitors
913
-
914
- * 0.9.9 (2010-11-28)
915
-
916
- Backward incompatibilities:
917
- * the self special variable has been renamed to _self
918
- * the odd and even filters are now tests:
919
- {{ foo|odd }} must now be written {{ foo is odd }}
920
- * the "safe" filter has been renamed to "raw"
921
- * in Node classes,
922
- sub-nodes are now accessed via getNode() (instead of property access)
923
- attributes via getAttribute() (instead of array access)
924
- * the urlencode filter had been renamed to url_encode
925
- * the include tag now merges the passed variables with the current context by default
926
- (the old behavior is still possible by adding the "only" keyword)
927
- * moved Exceptions to Twig_Error_* (Twig_SyntaxError/Twig_RuntimeError are now Twig_Error_Syntax/Twig_Error_Runtime)
928
- * removed support for {{ 1 < i < 3 }} (use {{ i > 1 and i < 3 }} instead)
929
- * the "in" filter has been removed ({{ a|in(b) }} should now be written {{ a in b }})
930
-
931
- Changes:
932
- * added file and line to Twig_Error_Runtime exceptions thrown from Twig_Template
933
- * changed trans tag to accept any variable for the plural count
934
- * fixed sandbox mode (__toString() method check was not enforced if called implicitly from complex statements)
935
- * added the ** (power) operator
936
- * changed the algorithm used for parsing expressions
937
- * added the spaceless tag
938
- * removed trim_blocks option
939
- * added support for is*() methods for attributes (foo.bar now looks for foo->getBar() or foo->isBar())
940
- * changed all exceptions to extend Twig_Error
941
- * fixed unary expressions ({{ not(1 or 0) }})
942
- * fixed child templates (with an extend tag) that uses one or more imports
943
- * added support for {{ 1 not in [2, 3] }} (more readable than the current {{ not (1 in [2, 3]) }})
944
- * escaping has been rewritten
945
- * the implementation of template inheritance has been rewritten
946
- (blocks can now be called individually and still work with inheritance)
947
- * fixed error handling for if tag when a syntax error occurs within a subparse process
948
- * added a way to implement custom logic for resolving token parsers given a tag name
949
- * fixed js escaper to be stricter (now uses a whilelist-based js escaper)
950
- * added the following filers: "constant", "trans", "replace", "json_encode"
951
- * added a "constant" test
952
- * fixed objects with __toString() not being autoescaped
953
- * fixed subscript expressions when calling __call() (methods now keep the case)
954
- * added "test" feature (accessible via the "is" operator)
955
- * removed the debug tag (should be done in an extension)
956
- * fixed trans tag when no vars are used in plural form
957
- * fixed race condition when writing template cache
958
- * added the special _charset variable to reference the current charset
959
- * added the special _context variable to reference the current context
960
- * renamed self to _self (to avoid conflict)
961
- * fixed Twig_Template::getAttribute() for protected properties
962
-
963
- * 0.9.8 (2010-06-28)
964
-
965
- Backward incompatibilities:
966
- * the trans tag plural count is now attached to the plural tag:
967
- old: `{% trans count %}...{% plural %}...{% endtrans %}`
968
- new: `{% trans %}...{% plural count %}...{% endtrans %}`
969
-
970
- * added a way to translate strings coming from a variable ({% trans var %})
971
- * fixed trans tag when used with the Escaper extension
972
- * fixed default cache umask
973
- * removed Twig_Template instances from the debug tag output
974
- * fixed objects with __isset() defined
975
- * fixed set tag when used with a capture
976
- * fixed type hinting for Twig_Environment::addFilter() method
977
-
978
- * 0.9.7 (2010-06-12)
979
-
980
- Backward incompatibilities:
981
- * changed 'as' to '=' for the set tag ({% set title as "Title" %} must now be {% set title = "Title" %})
982
- * removed the sandboxed attribute of the include tag (use the new sandbox tag instead)
983
- * refactored the Node system (if you have custom nodes, you will have to update them to use the new API)
984
-
985
- * added self as a special variable that refers to the current template (useful for importing macros from the current template)
986
- * added Twig_Template instance support to the include tag
987
- * added support for dynamic and conditional inheritance ({% extends some_var %} and {% extends standalone ? "minimum" : "base" %})
988
- * added a grammar sub-framework to ease the creation of custom tags
989
- * fixed the for tag for large arrays (some loop variables are now only available for arrays and objects that implement the Countable interface)
990
- * removed the Twig_Resource::resolveMissingFilter() method
991
- * fixed the filter tag which did not apply filtering to included files
992
- * added a bunch of unit tests
993
- * added a bunch of phpdoc
994
- * added a sandbox tag in the sandbox extension
995
- * changed the date filter to support any date format supported by DateTime
996
- * added strict_variable setting to throw an exception when an invalid variable is used in a template (disabled by default)
997
- * added the lexer, parser, and compiler as arguments to the Twig_Environment constructor
998
- * changed the cache option to only accepts an explicit path to a cache directory or false
999
- * added a way to add token parsers, filters, and visitors without creating an extension
1000
- * added three interfaces: Twig_NodeInterface, Twig_TokenParserInterface, and Twig_FilterInterface
1001
- * changed the generated code to match the new coding standards
1002
- * fixed sandbox mode (__toString() method check was not enforced if called implicitly from a simple statement like {{ article }})
1003
- * added an exception when a child template has a non-empty body (as it is always ignored when rendering)
1004
-
1005
- * 0.9.6 (2010-05-12)
1006
-
1007
- * fixed variables defined outside a loop and for which the value changes in a for loop
1008
- * fixed the test suite for PHP 5.2 and older versions of PHPUnit
1009
- * added support for __call() in expression resolution
1010
- * fixed node visiting for macros (macros are now visited by visitors as any other node)
1011
- * fixed nested block definitions with a parent call (rarely useful but nonetheless supported now)
1012
- * added the cycle filter
1013
- * fixed the Lexer when mbstring.func_overload is used with an mbstring.internal_encoding different from ASCII
1014
- * added a long-syntax for the set tag ({% set foo %}...{% endset %})
1015
- * unit tests are now powered by PHPUnit
1016
- * added support for gettext via the `i18n` extension
1017
- * fixed twig_capitalize_string_filter() and fixed twig_length_filter() when used with UTF-8 values
1018
- * added a more useful exception if an if tag is not closed properly
1019
- * added support for escaping strategy in the autoescape tag
1020
- * fixed lexer when a template has a big chunk of text between/in a block
1021
-
1022
- * 0.9.5 (2010-01-20)
1023
-
1024
- As for any new release, don't forget to remove all cached templates after
1025
- upgrading.
1026
-
1027
- If you have defined custom filters, you MUST upgrade them for this release. To
1028
- upgrade, replace "array" with "new Twig_Filter_Function", and replace the
1029
- environment constant by the "needs_environment" option:
1030
-
1031
- // before
1032
- 'even' => array('twig_is_even_filter', false),
1033
- 'escape' => array('twig_escape_filter', true),
1034
-
1035
- // after
1036
- 'even' => new Twig_Filter_Function('twig_is_even_filter'),
1037
- 'escape' => new Twig_Filter_Function('twig_escape_filter', array('needs_environment' => true)),
1038
-
1039
- If you have created NodeTransformer classes, you will need to upgrade them to
1040
- the new interface (please note that the interface is not yet considered
1041
- stable).
1042
-
1043
- * fixed list nodes that did not extend the Twig_NodeListInterface
1044
- * added the "without loop" option to the for tag (it disables the generation of the loop variable)
1045
- * refactored node transformers to node visitors
1046
- * fixed automatic-escaping for blocks
1047
- * added a way to specify variables to pass to an included template
1048
- * changed the automatic-escaping rules to be more sensible and more configurable in custom filters (the documentation lists all the rules)
1049
- * improved the filter system to allow object methods to be used as filters
1050
- * changed the Array and String loaders to actually make use of the cache mechanism
1051
- * included the default filter function definitions in the extension class files directly (Core, Escaper)
1052
- * added the // operator (like the floor() PHP function)
1053
- * added the .. operator (as a syntactic sugar for the range filter when the step is 1)
1054
- * added the in operator (as a syntactic sugar for the in filter)
1055
- * added the following filters in the Core extension: in, range
1056
- * added support for arrays (same behavior as in PHP, a mix between lists and dictionaries, arrays and hashes)
1057
- * enhanced some error messages to provide better feedback in case of parsing errors
1058
-
1059
- * 0.9.4 (2009-12-02)
1060
-
1061
- If you have custom loaders, you MUST upgrade them for this release: The
1062
- Twig_Loader base class has been removed, and the Twig_LoaderInterface has also
1063
- been changed (see the source code for more information or the documentation).
1064
-
1065
- * added support for DateTime instances for the date filter
1066
- * fixed loop.last when the array only has one item
1067
- * made it possible to insert newlines in tag and variable blocks
1068
- * fixed a bug when a literal '\n' were present in a template text
1069
- * fixed bug when the filename of a template contains */
1070
- * refactored loaders
1071
-
1072
- * 0.9.3 (2009-11-11)
1073
-
1074
- This release is NOT backward compatible with the previous releases.
1075
-
1076
- The loaders do not take the cache and autoReload arguments anymore. Instead,
1077
- the Twig_Environment class has two new options: cache and auto_reload.
1078
- Upgrading your code means changing this kind of code:
1079
-
1080
- $loader = new Twig_Loader_Filesystem('/path/to/templates', '/path/to/compilation_cache', true);
1081
- $twig = new Twig_Environment($loader);
1082
-
1083
- to something like this:
1084
-
1085
- $loader = new Twig_Loader_Filesystem('/path/to/templates');
1086
- $twig = new Twig_Environment($loader, array(
1087
- 'cache' => '/path/to/compilation_cache',
1088
- 'auto_reload' => true,
1089
- ));
1090
-
1091
- * deprecated the "items" filter as it is not needed anymore
1092
- * made cache and auto_reload options of Twig_Environment instead of arguments of Twig_Loader
1093
- * optimized template loading speed
1094
- * removed output when an error occurs in a template and render() is used
1095
- * made major speed improvements for loops (up to 300% on even the smallest loops)
1096
- * added properties as part of the sandbox mode
1097
- * added public properties support (obj.item can now be the item property on the obj object)
1098
- * extended set tag to support expression as value ({% set foo as 'foo' ~ 'bar' %} )
1099
- * fixed bug when \ was used in HTML
1100
-
1101
- * 0.9.2 (2009-10-29)
1102
-
1103
- * made some speed optimizations
1104
- * changed the cache extension to .php
1105
- * added a js escaping strategy
1106
- * added support for short block tag
1107
- * changed the filter tag to allow chained filters
1108
- * made lexer more flexible as you can now change the default delimiters
1109
- * added set tag
1110
- * changed default directory permission when cache dir does not exist (more secure)
1111
- * added macro support
1112
- * changed filters first optional argument to be a Twig_Environment instance instead of a Twig_Template instance
1113
- * made Twig_Autoloader::autoload() a static method
1114
- * avoid writing template file if an error occurs
1115
- * added $ escaping when outputting raw strings
1116
- * enhanced some error messages to ease debugging
1117
- * fixed empty cache files when the template contains an error
1118
-
1119
- * 0.9.1 (2009-10-14)
1120
-
1121
- * fixed a bug in PHP 5.2.6
1122
- * fixed numbers with one than one decimal
1123
- * added support for method calls with arguments ({{ foo.bar('a', 43) }})
1124
- * made small speed optimizations
1125
- * made minor tweaks to allow better extensibility and flexibility
1126
-
1127
- * 0.9.0 (2009-10-12)
1128
-
1129
- * Initial release
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/LICENSE DELETED
@@ -1,31 +0,0 @@
1
- Copyright (c) 2009-2019 by the Twig Team.
2
-
3
- Some rights reserved.
4
-
5
- Redistribution and use in source and binary forms, with or without
6
- modification, are permitted provided that the following conditions are
7
- met:
8
-
9
- * Redistributions of source code must retain the above copyright
10
- notice, this list of conditions and the following disclaimer.
11
-
12
- * Redistributions in binary form must reproduce the above
13
- copyright notice, this list of conditions and the following
14
- disclaimer in the documentation and/or other materials provided
15
- with the distribution.
16
-
17
- * The names of the contributors may not be used to endorse or
18
- promote products derived from this software without specific
19
- prior written permission.
20
-
21
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25
- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/README.rst DELETED
@@ -1,24 +0,0 @@
1
- Twig, the flexible, fast, and secure template language for PHP
2
- ==============================================================
3
-
4
- Twig is a template language for PHP, released under the new BSD license (code
5
- and documentation).
6
-
7
- Twig uses a syntax similar to the Django and Jinja template languages which
8
- inspired the Twig runtime environment.
9
-
10
- Sponsors
11
- --------
12
-
13
- .. raw:: html
14
-
15
- <a href="https://blackfire.io/docs/introduction?utm_source=twig&utm_medium=github_readme&utm_campaign=logo">
16
- <img src="https://static.blackfire.io/assets/intemporals/logo/png/blackfire-io_secondary_horizontal_transparent.png?1" width="255px" alt="Blackfire.io">
17
- </a>
18
-
19
- More Information
20
- ----------------
21
-
22
- Read the `documentation`_ for more information.
23
-
24
- .. _documentation: https://twig.symfony.com/documentation
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/composer.json DELETED
@@ -1,53 +0,0 @@
1
- {
2
- "name": "twig/twig",
3
- "type": "library",
4
- "description": "Twig, the flexible, fast, and secure template language for PHP",
5
- "keywords": ["templating"],
6
- "homepage": "https://twig.symfony.com",
7
- "license": "BSD-3-Clause",
8
- "authors": [
9
- {
10
- "name": "Fabien Potencier",
11
- "email": "fabien@symfony.com",
12
- "homepage": "http://fabien.potencier.org",
13
- "role": "Lead Developer"
14
- },
15
- {
16
- "name": "Twig Team",
17
- "homepage": "https://twig.symfony.com/contributors",
18
- "role": "Contributors"
19
- },
20
- {
21
- "name": "Armin Ronacher",
22
- "email": "armin.ronacher@active-4.com",
23
- "role": "Project Founder"
24
- }
25
- ],
26
- "require": {
27
- "php": ">=5.5.0",
28
- "symfony/polyfill-ctype": "^1.8"
29
- },
30
- "require-dev": {
31
- "symfony/phpunit-bridge": "^4.4@dev|^5.0",
32
- "symfony/debug": "^3.4|^4.2",
33
- "psr/container": "^1.0"
34
- },
35
- "autoload": {
36
- "psr-0" : {
37
- "Twig_" : "lib/"
38
- },
39
- "psr-4" : {
40
- "Twig\\" : "src/"
41
- }
42
- },
43
- "autoload-dev": {
44
- "psr-4" : {
45
- "Twig\\Tests\\" : "tests"
46
- }
47
- },
48
- "extra": {
49
- "branch-alias": {
50
- "dev-master": "1.42-dev"
51
- }
52
- }
53
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/advanced.rst DELETED
@@ -1,962 +0,0 @@
1
- Extending Twig
2
- ==============
3
-
4
- .. caution::
5
-
6
- This section describes how to extend Twig as of **Twig 1.12**. If you are
7
- using an older version, read the :doc:`legacy<advanced_legacy>` chapter
8
- instead.
9
-
10
- Twig can be extended in many ways; you can add extra tags, filters, tests,
11
- operators, global variables, and functions. You can even extend the parser
12
- itself with node visitors.
13
-
14
- .. note::
15
-
16
- The first section of this chapter describes how to extend Twig. If you want
17
- to reuse your changes in different projects or if you want to share them
18
- with others, you should then create an extension as described in the
19
- following section.
20
-
21
- .. caution::
22
-
23
- When extending Twig without creating an extension, Twig won't be able to
24
- recompile your templates when the PHP code is updated. To see your changes
25
- in real-time, either disable template caching or package your code into an
26
- extension (see the next section of this chapter).
27
-
28
- Before extending Twig, you must understand the differences between all the
29
- different possible extension points and when to use them.
30
-
31
- First, remember that Twig has two main language constructs:
32
-
33
- * ``{{ }}``: used to print the result of an expression evaluation;
34
-
35
- * ``{% %}``: used to execute statements.
36
-
37
- To understand why Twig exposes so many extension points, let's see how to
38
- implement a *Lorem ipsum* generator (it needs to know the number of words to
39
- generate).
40
-
41
- You can use a ``lipsum`` *tag*:
42
-
43
- .. code-block:: twig
44
-
45
- {% lipsum 40 %}
46
-
47
- That works, but using a tag for ``lipsum`` is not a good idea for at least
48
- three main reasons:
49
-
50
- * ``lipsum`` is not a language construct;
51
- * The tag outputs something;
52
- * The tag is not flexible as you cannot use it in an expression:
53
-
54
- .. code-block:: twig
55
-
56
- {{ 'some text' ~ {% lipsum 40 %} ~ 'some more text' }}
57
-
58
- In fact, you rarely need to create tags; and that's good news because tags are
59
- the most complex extension point.
60
-
61
- Now, let's use a ``lipsum`` *filter*:
62
-
63
- .. code-block:: twig
64
-
65
- {{ 40|lipsum }}
66
-
67
- Again, it works. But a filter should transform the passed value to something
68
- else. Here, we use the value to indicate the number of words to generate (so,
69
- ``40`` is an argument of the filter, not the value we want to transform).
70
-
71
- Next, let's use a ``lipsum`` *function*:
72
-
73
- .. code-block:: twig
74
-
75
- {{ lipsum(40) }}
76
-
77
- Here we go. For this specific example, the creation of a function is the
78
- extension point to use. And you can use it anywhere an expression is accepted:
79
-
80
- .. code-block:: twig
81
-
82
- {{ 'some text' ~ lipsum(40) ~ 'some more text' }}
83
-
84
- {% set lipsum = lipsum(40) %}
85
-
86
- Lastly, you can also use a *global* object with a method able to generate lorem
87
- ipsum text:
88
-
89
- .. code-block:: twig
90
-
91
- {{ text.lipsum(40) }}
92
-
93
- As a rule of thumb, use functions for frequently used features and global
94
- objects for everything else.
95
-
96
- Keep in mind the following when you want to extend Twig:
97
-
98
- ========== ========================== ========== =========================
99
- What? Implementation difficulty? How often? When?
100
- ========== ========================== ========== =========================
101
- *macro* simple frequent Content generation
102
- *global* simple frequent Helper object
103
- *function* simple frequent Content generation
104
- *filter* simple frequent Value transformation
105
- *tag* complex rare DSL language construct
106
- *test* simple rare Boolean decision
107
- *operator* simple rare Values transformation
108
- ========== ========================== ========== =========================
109
-
110
- Globals
111
- -------
112
-
113
- A global variable is like any other template variable, except that it's
114
- available in all templates and macros::
115
-
116
- $twig = new \Twig\Environment($loader);
117
- $twig->addGlobal('text', new Text());
118
-
119
- You can then use the ``text`` variable anywhere in a template:
120
-
121
- .. code-block:: twig
122
-
123
- {{ text.lipsum(40) }}
124
-
125
- Filters
126
- -------
127
-
128
- Creating a filter consists of associating a name with a PHP callable::
129
-
130
- // an anonymous function
131
- $filter = new \Twig\TwigFilter('rot13', function ($string) {
132
- return str_rot13($string);
133
- });
134
-
135
- // or a simple PHP function
136
- $filter = new \Twig\TwigFilter('rot13', 'str_rot13');
137
-
138
- // or a class static method
139
- $filter = new \Twig\TwigFilter('rot13', ['SomeClass', 'rot13Filter']);
140
- $filter = new \Twig\TwigFilter('rot13', 'SomeClass::rot13Filter');
141
-
142
- // or a class method
143
- $filter = new \Twig\TwigFilter('rot13', [$this, 'rot13Filter']);
144
- // the one below needs a runtime implementation (see below for more information)
145
- $filter = new \Twig\TwigFilter('rot13', ['SomeClass', 'rot13Filter']);
146
-
147
- The first argument passed to the ``\Twig\TwigFilter`` constructor is the name
148
- of the filter you will use in templates and the second one is the PHP callable
149
- to associate with it.
150
-
151
- Then, add the filter to the Twig environment::
152
-
153
- $twig = new \Twig\Environment($loader);
154
- $twig->addFilter($filter);
155
-
156
- And here is how to use it in a template:
157
-
158
- .. code-block:: twig
159
-
160
- {{ 'Twig'|rot13 }}
161
-
162
- {# will output Gjvt #}
163
-
164
- When called by Twig, the PHP callable receives the left side of the filter
165
- (before the pipe ``|``) as the first argument and the extra arguments passed
166
- to the filter (within parentheses ``()``) as extra arguments.
167
-
168
- For instance, the following code:
169
-
170
- .. code-block:: twig
171
-
172
- {{ 'TWIG'|lower }}
173
- {{ now|date('d/m/Y') }}
174
-
175
- is compiled to something like the following::
176
-
177
- <?php echo strtolower('TWIG') ?>
178
- <?php echo twig_date_format_filter($now, 'd/m/Y') ?>
179
-
180
- The ``\Twig\TwigFilter`` class takes an array of options as its last
181
- argument::
182
-
183
- $filter = new \Twig\TwigFilter('rot13', 'str_rot13', $options);
184
-
185
- Environment-aware Filters
186
- ~~~~~~~~~~~~~~~~~~~~~~~~~
187
-
188
- If you want to access the current environment instance in your filter, set the
189
- ``needs_environment`` option to ``true``; Twig will pass the current
190
- environment as the first argument to the filter call::
191
-
192
- $filter = new \Twig\TwigFilter('rot13', function (Twig_Environment $env, $string) {
193
- // get the current charset for instance
194
- $charset = $env->getCharset();
195
-
196
- return str_rot13($string);
197
- }, ['needs_environment' => true]);
198
-
199
- Context-aware Filters
200
- ~~~~~~~~~~~~~~~~~~~~~
201
-
202
- If you want to access the current context in your filter, set the
203
- ``needs_context`` option to ``true``; Twig will pass the current context as
204
- the first argument to the filter call (or the second one if
205
- ``needs_environment`` is also set to ``true``)::
206
-
207
- $filter = new \Twig\TwigFilter('rot13', function ($context, $string) {
208
- // ...
209
- }, ['needs_context' => true]);
210
-
211
- $filter = new \Twig\TwigFilter('rot13', function (Twig_Environment $env, $context, $string) {
212
- // ...
213
- }, ['needs_context' => true, 'needs_environment' => true]);
214
-
215
- Automatic Escaping
216
- ~~~~~~~~~~~~~~~~~~
217
-
218
- If automatic escaping is enabled, the output of the filter may be escaped
219
- before printing. If your filter acts as an escaper (or explicitly outputs HTML
220
- or JavaScript code), you will want the raw output to be printed. In such a
221
- case, set the ``is_safe`` option::
222
-
223
- $filter = new \Twig\TwigFilter('nl2br', 'nl2br', ['is_safe' => ['html']]);
224
-
225
- Some filters may need to work on input that is already escaped or safe, for
226
- example when adding (safe) HTML tags to originally unsafe output. In such a
227
- case, set the ``pre_escape`` option to escape the input data before it is run
228
- through your filter::
229
-
230
- $filter = new \Twig\TwigFilter('somefilter', 'somefilter', ['pre_escape' => 'html', 'is_safe' => ['html']]);
231
-
232
- Variadic Filters
233
- ~~~~~~~~~~~~~~~~
234
-
235
- .. versionadded:: 1.19
236
- Support for variadic filters was added in Twig 1.19.
237
-
238
- When a filter should accept an arbitrary number of arguments, set the
239
- ``is_variadic`` option to ``true``; Twig will pass the extra arguments as the
240
- last argument to the filter call as an array::
241
-
242
- $filter = new \Twig\TwigFilter('thumbnail', function ($file, array $options = []) {
243
- // ...
244
- }, ['is_variadic' => true]);
245
-
246
- Be warned that :ref:`named arguments <named-arguments>` passed to a variadic
247
- filter cannot be checked for validity as they will automatically end up in the
248
- option array.
249
-
250
- Dynamic Filters
251
- ~~~~~~~~~~~~~~~
252
-
253
- A filter name containing the special ``*`` character is a dynamic filter and
254
- the ``*`` part will match any string::
255
-
256
- $filter = new \Twig\TwigFilter('*_path', function ($name, $arguments) {
257
- // ...
258
- });
259
-
260
- The following filters are matched by the above defined dynamic filter:
261
-
262
- * ``product_path``
263
- * ``category_path``
264
-
265
- A dynamic filter can define more than one dynamic parts::
266
-
267
- $filter = new \Twig\TwigFilter('*_path_*', function ($name, $suffix, $arguments) {
268
- // ...
269
- });
270
-
271
- The filter receives all dynamic part values before the normal filter arguments,
272
- but after the environment and the context. For instance, a call to
273
- ``'foo'|a_path_b()`` will result in the following arguments to be passed to the
274
- filter: ``('a', 'b', 'foo')``.
275
-
276
- Deprecated Filters
277
- ~~~~~~~~~~~~~~~~~~
278
-
279
- .. versionadded:: 1.21
280
- Support for deprecated filters was added in Twig 1.21.
281
-
282
- You can mark a filter as being deprecated by setting the ``deprecated`` option
283
- to ``true``. You can also give an alternative filter that replaces the
284
- deprecated one when that makes sense::
285
-
286
- $filter = new \Twig\TwigFilter('obsolete', function () {
287
- // ...
288
- }, ['deprecated' => true, 'alternative' => 'new_one']);
289
-
290
- When a filter is deprecated, Twig emits a deprecation notice when compiling a
291
- template using it. See :ref:`deprecation-notices` for more information.
292
-
293
- Functions
294
- ---------
295
-
296
- Functions are defined in the exact same way as filters, but you need to create
297
- an instance of ``\Twig\TwigFunction``::
298
-
299
- $twig = new \Twig\Environment($loader);
300
- $function = new \Twig\TwigFunction('function_name', function () {
301
- // ...
302
- });
303
- $twig->addFunction($function);
304
-
305
- Functions support the same features as filters, except for the ``pre_escape``
306
- and ``preserves_safety`` options.
307
-
308
- Tests
309
- -----
310
-
311
- Tests are defined in the exact same way as filters and functions, but you need
312
- to create an instance of ``\Twig\TwigTest``::
313
-
314
- $twig = new \Twig\Environment($loader);
315
- $test = new \Twig\TwigTest('test_name', function () {
316
- // ...
317
- });
318
- $twig->addTest($test);
319
-
320
- Tests allow you to create custom application specific logic for evaluating
321
- boolean conditions. As a simple example, let's create a Twig test that checks if
322
- objects are 'red'::
323
-
324
- $twig = new \Twig\Environment($loader);
325
- $test = new \Twig\TwigTest('red', function ($value) {
326
- if (isset($value->color) && $value->color == 'red') {
327
- return true;
328
- }
329
- if (isset($value->paint) && $value->paint == 'red') {
330
- return true;
331
- }
332
- return false;
333
- });
334
- $twig->addTest($test);
335
-
336
- Test functions must always return ``true``/``false``.
337
-
338
- When creating tests you can use the ``node_class`` option to provide custom test
339
- compilation. This is useful if your test can be compiled into PHP primitives.
340
- This is used by many of the tests built into Twig::
341
-
342
- $twig = new \Twig\Environment($loader);
343
- $test = new \Twig\TwigTest(
344
- 'odd',
345
- null,
346
- ['node_class' => '\Twig\Node\Expression\Test\OddTest']);
347
- $twig->addTest($test);
348
-
349
- class Twig_Node_Expression_Test_Odd extends \Twig\Node\Expression\TestExpression
350
- {
351
- public function compile(\Twig\Compiler $compiler)
352
- {
353
- $compiler
354
- ->raw('(')
355
- ->subcompile($this->getNode('node'))
356
- ->raw(' % 2 == 1')
357
- ->raw(')')
358
- ;
359
- }
360
- }
361
-
362
- The above example shows how you can create tests that use a node class. The node
363
- class has access to one sub-node called ``node``. This sub-node contains the
364
- value that is being tested. When the ``odd`` filter is used in code such as:
365
-
366
- .. code-block:: twig
367
-
368
- {% if my_value is odd %}
369
-
370
- The ``node`` sub-node will contain an expression of ``my_value``. Node-based
371
- tests also have access to the ``arguments`` node. This node will contain the
372
- various other arguments that have been provided to your test.
373
-
374
- .. versionadded:: 1.36
375
- Dynamic tests support was added in Twig 1.36.
376
-
377
- If you want to pass a variable number of positional or named arguments to the
378
- test, set the ``is_variadic`` option to ``true``. Tests support dynamic
379
- names (see dynamic filters for the syntax).
380
-
381
- Tags
382
- ----
383
-
384
- One of the most exciting features of a template engine like Twig is the
385
- possibility to define new **language constructs**. This is also the most complex
386
- feature as you need to understand how Twig's internals work.
387
-
388
- Most of the time though, a tag is not needed:
389
-
390
- * If your tag generates some output, use a **function** instead.
391
-
392
- * If your tag modifies some content and returns it, use a **filter** instead.
393
-
394
- For instance, if you want to create a tag that converts a Markdown formatted
395
- text to HTML, create a ``markdown`` filter instead:
396
-
397
- .. code-block:: twig
398
-
399
- {{ '**markdown** text'|markdown }}
400
-
401
- If you want use this filter on large amounts of text, wrap it with the
402
- :doc:`apply <tags/apply>` tag:
403
-
404
- .. code-block:: twig
405
-
406
- {% apply markdown %}
407
- Title
408
- =====
409
-
410
- Much better than creating a tag as you can **compose** filters.
411
- {% endapply %}
412
-
413
- .. note::
414
-
415
- The ``apply`` tag was introduced in Twig 1.40; use the ``filter`` tag with
416
- previous versions.
417
-
418
- * If your tag does not output anything, but only exists because of a side
419
- effect, create a **function** that returns nothing and call it via the
420
- :doc:`filter <tags/do>` tag.
421
-
422
- For instance, if you want to create a tag that logs text, create a ``log``
423
- function instead and call it via the :doc:`do <tags/do>` tag:
424
-
425
- .. code-block:: twig
426
-
427
- {% do log('Log some things') %}
428
-
429
- If you still want to create a tag for a new language construct, great!
430
-
431
- Let's create a ``set`` tag that allows the definition of simple variables from
432
- within a template. The tag can be used like follows:
433
-
434
- .. code-block:: twig
435
-
436
- {% set name = "value" %}
437
-
438
- {{ name }}
439
-
440
- {# should output value #}
441
-
442
- .. note::
443
-
444
- The ``set`` tag is part of the Core extension and as such is always
445
- available. The built-in version is slightly more powerful and supports
446
- multiple assignments by default.
447
-
448
- Three steps are needed to define a new tag:
449
-
450
- * Defining a Token Parser class (responsible for parsing the template code);
451
-
452
- * Defining a Node class (responsible for converting the parsed code to PHP);
453
-
454
- * Registering the tag.
455
-
456
- Registering a new tag
457
- ~~~~~~~~~~~~~~~~~~~~~
458
-
459
- Add a tag by calling the ``addTokenParser`` method on the ``\Twig\Environment``
460
- instance::
461
-
462
- $twig = new \Twig\Environment($loader);
463
- $twig->addTokenParser(new Project_Set_TokenParser());
464
-
465
- Defining a Token Parser
466
- ~~~~~~~~~~~~~~~~~~~~~~~
467
-
468
- Now, let's see the actual code of this class::
469
-
470
- class Project_Set_TokenParser extends \Twig\TokenParser\AbstractTokenParser
471
- {
472
- public function parse(\Twig\Token $token)
473
- {
474
- $parser = $this->parser;
475
- $stream = $parser->getStream();
476
-
477
- $name = $stream->expect(\Twig\Token::NAME_TYPE)->getValue();
478
- $stream->expect(\Twig\Token::OPERATOR_TYPE, '=');
479
- $value = $parser->getExpressionParser()->parseExpression();
480
- $stream->expect(\Twig\Token::BLOCK_END_TYPE);
481
-
482
- return new Project_Set_Node($name, $value, $token->getLine(), $this->getTag());
483
- }
484
-
485
- public function getTag()
486
- {
487
- return 'set';
488
- }
489
- }
490
-
491
- The ``getTag()`` method must return the tag we want to parse, here ``set``.
492
-
493
- The ``parse()`` method is invoked whenever the parser encounters a ``set``
494
- tag. It should return a ``\Twig\Node\Node`` instance that represents the node (the
495
- ``Project_Set_Node`` calls creating is explained in the next section).
496
-
497
- The parsing process is simplified thanks to a bunch of methods you can call
498
- from the token stream (``$this->parser->getStream()``):
499
-
500
- * ``getCurrent()``: Gets the current token in the stream.
501
-
502
- * ``next()``: Moves to the next token in the stream, *but returns the old one*.
503
-
504
- * ``test($type)``, ``test($value)`` or ``test($type, $value)``: Determines whether
505
- the current token is of a particular type or value (or both). The value may be an
506
- array of several possible values.
507
-
508
- * ``expect($type[, $value[, $message]])``: If the current token isn't of the given
509
- type/value a syntax error is thrown. Otherwise, if the type and value are correct,
510
- the token is returned and the stream moves to the next token.
511
-
512
- * ``look()``: Looks at the next token without consuming it.
513
-
514
- Parsing expressions is done by calling the ``parseExpression()`` like we did for
515
- the ``set`` tag.
516
-
517
- .. tip::
518
-
519
- Reading the existing ``TokenParser`` classes is the best way to learn all
520
- the nitty-gritty details of the parsing process.
521
-
522
- Defining a Node
523
- ~~~~~~~~~~~~~~~
524
-
525
- The ``Project_Set_Node`` class itself is quite short::
526
-
527
- class Project_Set_Node extends \Twig\Node\Node
528
- {
529
- public function __construct($name, \Twig\Node\Expression\AbstractExpression $value, $line, $tag = null)
530
- {
531
- parent::__construct(['value' => $value], ['name' => $name], $line, $tag);
532
- }
533
-
534
- public function compile(\Twig\Compiler $compiler)
535
- {
536
- $compiler
537
- ->addDebugInfo($this)
538
- ->write('$context[\''.$this->getAttribute('name').'\'] = ')
539
- ->subcompile($this->getNode('value'))
540
- ->raw(";\n")
541
- ;
542
- }
543
- }
544
-
545
- The compiler implements a fluid interface and provides methods that helps the
546
- developer generate beautiful and readable PHP code:
547
-
548
- * ``subcompile()``: Compiles a node.
549
-
550
- * ``raw()``: Writes the given string as is.
551
-
552
- * ``write()``: Writes the given string by adding indentation at the beginning
553
- of each line.
554
-
555
- * ``string()``: Writes a quoted string.
556
-
557
- * ``repr()``: Writes a PHP representation of a given value (see
558
- ``\Twig\Node\ForNode`` for a usage example).
559
-
560
- * ``addDebugInfo()``: Adds the line of the original template file related to
561
- the current node as a comment.
562
-
563
- * ``indent()``: Indents the generated code (see ``\Twig\Node\BlockNode`` for a
564
- usage example).
565
-
566
- * ``outdent()``: Outdents the generated code (see ``\Twig\Node\BlockNode`` for a
567
- usage example).
568
-
569
- .. _creating_extensions:
570
-
571
- Creating an Extension
572
- ---------------------
573
-
574
- The main motivation for writing an extension is to move often used code into a
575
- reusable class like adding support for internationalization. An extension can
576
- define tags, filters, tests, operators, functions, and node visitors.
577
-
578
- Most of the time, it is useful to create a single extension for your project,
579
- to host all the specific tags and filters you want to add to Twig.
580
-
581
- .. tip::
582
-
583
- When packaging your code into an extension, Twig is smart enough to
584
- recompile your templates whenever you make a change to it (when
585
- ``auto_reload`` is enabled).
586
-
587
- .. note::
588
-
589
- Before writing your own extensions, have a look at the Twig official
590
- extension repository: https://github.com/twigphp/Twig-extensions.
591
-
592
- An extension is a class that implements the following interface::
593
-
594
- interface Twig_ExtensionInterface
595
- {
596
- /**
597
- * Initializes the runtime environment.
598
- *
599
- * This is where you can load some file that contains filter functions for instance.
600
- *
601
- * @deprecated since 1.23 (to be removed in 2.0), implement \Twig\Extension\InitRuntimeInterface instead
602
- */
603
- function initRuntime(\Twig\Environment $environment);
604
-
605
- /**
606
- * Returns the token parser instances to add to the existing list.
607
- *
608
- * @return (Twig_TokenParserInterface|Twig_TokenParserBrokerInterface)[]
609
- */
610
- function getTokenParsers();
611
-
612
- /**
613
- * Returns the node visitor instances to add to the existing list.
614
- *
615
- * @return \Twig\NodeVisitor\NodeVisitorInterface[]
616
- */
617
- function getNodeVisitors();
618
-
619
- /**
620
- * Returns a list of filters to add to the existing list.
621
- *
622
- * @return \Twig\TwigFilter[]
623
- */
624
- function getFilters();
625
-
626
- /**
627
- * Returns a list of tests to add to the existing list.
628
- *
629
- * @return \Twig\TwigTest[]
630
- */
631
- function getTests();
632
-
633
- /**
634
- * Returns a list of functions to add to the existing list.
635
- *
636
- * @return \Twig\TwigFunction[]
637
- */
638
- function getFunctions();
639
-
640
- /**
641
- * Returns a list of operators to add to the existing list.
642
- *
643
- * @return array<array> First array of unary operators, second array of binary operators
644
- */
645
- function getOperators();
646
-
647
- /**
648
- * Returns a list of global variables to add to the existing list.
649
- *
650
- * @return array An array of global variables
651
- *
652
- * @deprecated since 1.23 (to be removed in 2.0), implement \Twig\Extension\GlobalsInterface instead
653
- */
654
- function getGlobals();
655
-
656
- /**
657
- * Returns the name of the extension.
658
- *
659
- * @return string The extension name
660
- *
661
- * @deprecated since 1.26 (to be removed in 2.0), not used anymore internally
662
- */
663
- function getName();
664
- }
665
-
666
- To keep your extension class clean and lean, inherit from the built-in
667
- ``\Twig\Extension\AbstractExtension`` class instead of implementing the interface as it provides
668
- empty implementations for all methods:
669
-
670
- class Project_Twig_Extension extends \Twig\Extension\AbstractExtension
671
- {
672
- }
673
-
674
- This extension does nothing for now. We will customize it in the next sections.
675
-
676
- .. note::
677
-
678
- Prior to Twig 1.26, you must implement the ``getName()`` method which must
679
- return a unique identifier for the extension.
680
-
681
- You can save your extension anywhere on the filesystem, as all extensions must
682
- be registered explicitly to be available in your templates.
683
-
684
- You can register an extension by using the ``addExtension()`` method on your
685
- main ``Environment`` object::
686
-
687
- $twig = new \Twig\Environment($loader);
688
- $twig->addExtension(new Project_Twig_Extension());
689
-
690
- .. tip::
691
-
692
- The Twig core extensions are great examples of how extensions work.
693
-
694
- Globals
695
- ~~~~~~~
696
-
697
- Global variables can be registered in an extension via the ``getGlobals()``
698
- method::
699
-
700
- class Project_Twig_Extension extends \Twig\Extension\AbstractExtension implements \Twig\Extension\GlobalsInterface
701
- {
702
- public function getGlobals()
703
- {
704
- return [
705
- 'text' => new Text(),
706
- ];
707
- }
708
-
709
- // ...
710
- }
711
-
712
- Functions
713
- ~~~~~~~~~
714
-
715
- Functions can be registered in an extension via the ``getFunctions()``
716
- method::
717
-
718
- class Project_Twig_Extension extends \Twig\Extension\AbstractExtension
719
- {
720
- public function getFunctions()
721
- {
722
- return [
723
- new \Twig\TwigFunction('lipsum', 'generate_lipsum'),
724
- ];
725
- }
726
-
727
- // ...
728
- }
729
-
730
- Filters
731
- ~~~~~~~
732
-
733
- To add a filter to an extension, you need to override the ``getFilters()``
734
- method. This method must return an array of filters to add to the Twig
735
- environment::
736
-
737
- class Project_Twig_Extension extends \Twig\Extension\AbstractExtension
738
- {
739
- public function getFilters()
740
- {
741
- return [
742
- new \Twig\TwigFilter('rot13', 'str_rot13'),
743
- ];
744
- }
745
-
746
- // ...
747
- }
748
-
749
- Tags
750
- ~~~~
751
-
752
- Adding a tag in an extension can be done by overriding the
753
- ``getTokenParsers()`` method. This method must return an array of tags to add
754
- to the Twig environment::
755
-
756
- class Project_Twig_Extension extends \Twig\Extension\AbstractExtension
757
- {
758
- public function getTokenParsers()
759
- {
760
- return [new Project_Set_TokenParser()];
761
- }
762
-
763
- // ...
764
- }
765
-
766
- In the above code, we have added a single new tag, defined by the
767
- ``Project_Set_TokenParser`` class. The ``Project_Set_TokenParser`` class is
768
- responsible for parsing the tag and compiling it to PHP.
769
-
770
- Operators
771
- ~~~~~~~~~
772
-
773
- The ``getOperators()`` methods lets you add new operators. Here is how to add
774
- the ``!``, ``||``, and ``&&`` operators::
775
-
776
- class Project_Twig_Extension extends \Twig\Extension\AbstractExtension
777
- {
778
- public function getOperators()
779
- {
780
- return [
781
- [
782
- '!' => ['precedence' => 50, 'class' => '\Twig\Node\Expression\Unary\NotUnary'],
783
- ],
784
- [
785
- '||' => ['precedence' => 10, 'class' => '\Twig\Node\Expression\Binary\OrBinary', 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT],
786
- '&&' => ['precedence' => 15, 'class' => '\Twig\Node\Expression\Binary\AndBinary', 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT],
787
- ],
788
- ];
789
- }
790
-
791
- // ...
792
- }
793
-
794
- Tests
795
- ~~~~~
796
-
797
- The ``getTests()`` method lets you add new test functions::
798
-
799
- class Project_Twig_Extension extends \Twig\Extension\AbstractExtension
800
- {
801
- public function getTests()
802
- {
803
- return [
804
- new \Twig\TwigTest('even', 'twig_test_even'),
805
- ];
806
- }
807
-
808
- // ...
809
- }
810
-
811
- Definition vs Runtime
812
- ~~~~~~~~~~~~~~~~~~~~~
813
-
814
- Twig filters, functions, and tests runtime implementations can be defined as
815
- any valid PHP callable:
816
-
817
- * **functions/static methods**: Simple to implement and fast (used by all Twig
818
- core extensions); but it is hard for the runtime to depend on external
819
- objects;
820
-
821
- * **closures**: Simple to implement;
822
-
823
- * **object methods**: More flexible and required if your runtime code depends
824
- on external objects.
825
-
826
- The simplest way to use methods is to define them on the extension itself::
827
-
828
- class Project_Twig_Extension extends \Twig\Extension\AbstractExtension
829
- {
830
- private $rot13Provider;
831
-
832
- public function __construct($rot13Provider)
833
- {
834
- $this->rot13Provider = $rot13Provider;
835
- }
836
-
837
- public function getFunctions()
838
- {
839
- return [
840
- new \Twig\TwigFunction('rot13', [$this, 'rot13']),
841
- ];
842
- }
843
-
844
- public function rot13($value)
845
- {
846
- return $this->rot13Provider->rot13($value);
847
- }
848
- }
849
-
850
- This is very convenient but not recommended as it makes template compilation
851
- depend on runtime dependencies even if they are not needed (think for instance
852
- as a dependency that connects to a database engine).
853
-
854
- As of Twig 1.26, you can decouple the extension definitions from their
855
- runtime implementations by registering a ``\Twig\RuntimeLoader\RuntimeLoaderInterface``
856
- instance on the environment that knows how to instantiate such runtime classes
857
- (runtime classes must be autoload-able)::
858
-
859
- class RuntimeLoader implements \Twig\RuntimeLoader\RuntimeLoaderInterface
860
- {
861
- public function load($class)
862
- {
863
- // implement the logic to create an instance of $class
864
- // and inject its dependencies
865
- // most of the time, it means using your dependency injection container
866
- if ('Project_Twig_RuntimeExtension' === $class) {
867
- return new $class(new Rot13Provider());
868
- } else {
869
- // ...
870
- }
871
- }
872
- }
873
-
874
- $twig->addRuntimeLoader(new RuntimeLoader());
875
-
876
- .. note::
877
-
878
- As of Twig 1.32, Twig comes with a PSR-11 compatible runtime loader
879
- (``\Twig\RuntimeLoader\ContainerRuntimeLoader``).
880
-
881
- It is now possible to move the runtime logic to a new
882
- ``Project_Twig_RuntimeExtension`` class and use it directly in the extension::
883
-
884
- class Project_Twig_RuntimeExtension
885
- {
886
- private $rot13Provider;
887
-
888
- public function __construct($rot13Provider)
889
- {
890
- $this->rot13Provider = $rot13Provider;
891
- }
892
-
893
- public function rot13($value)
894
- {
895
- return $this->rot13Provider->rot13($value);
896
- }
897
- }
898
-
899
- class Project_Twig_Extension extends \Twig\Extension\AbstractExtension
900
- {
901
- public function getFunctions()
902
- {
903
- return [
904
- new \Twig\TwigFunction('rot13', ['Project_Twig_RuntimeExtension', 'rot13']),
905
- // or
906
- new \Twig\TwigFunction('rot13', 'Project_Twig_RuntimeExtension::rot13'),
907
- ];
908
- }
909
- }
910
-
911
- Testing an Extension
912
- --------------------
913
-
914
- Functional Tests
915
- ~~~~~~~~~~~~~~~~
916
-
917
- You can create functional tests for extensions by creating the following file
918
- structure in your test directory::
919
-
920
- Fixtures/
921
- filters/
922
- foo.test
923
- bar.test
924
- functions/
925
- foo.test
926
- bar.test
927
- tags/
928
- foo.test
929
- bar.test
930
- IntegrationTest.php
931
-
932
- The ``IntegrationTest.php`` file should look like this::
933
-
934
- class Project_Tests_IntegrationTest extends \Twig\Test\IntegrationTestCase
935
- {
936
- public function getExtensions()
937
- {
938
- return [
939
- new Project_Twig_Extension1(),
940
- new Project_Twig_Extension2(),
941
- ];
942
- }
943
-
944
- public function getFixturesDir()
945
- {
946
- return __DIR__.'/Fixtures/';
947
- }
948
- }
949
-
950
- Fixtures examples can be found within the Twig repository
951
- `tests/Twig/Fixtures`_ directory.
952
-
953
- Node Tests
954
- ~~~~~~~~~~
955
-
956
- Testing the node visitors can be complex, so extend your test cases from
957
- ``\Twig\Test\NodeTestCase``. Examples can be found in the Twig repository
958
- `tests/Twig/Node`_ directory.
959
-
960
- .. _`rot13`: https://secure.php.net/manual/en/function.str-rot13.php
961
- .. _`tests/Twig/Fixtures`: https://github.com/twigphp/Twig/tree/1.x/tests/Fixtures
962
- .. _`tests/Twig/Node`: https://github.com/twigphp/Twig/tree/1.x/tests/Node
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/advanced_legacy.rst DELETED
@@ -1,882 +0,0 @@
1
- Extending Twig
2
- ==============
3
-
4
- .. caution::
5
-
6
- This section describes how to extends Twig for versions **older than
7
- 1.12**. If you are using a newer version, read the :doc:`newer<advanced>`
8
- chapter instead.
9
-
10
- Twig can be extended in many ways; you can add extra tags, filters, tests,
11
- operators, global variables, and functions. You can even extend the parser
12
- itself with node visitors.
13
-
14
- .. note::
15
-
16
- The first section of this chapter describes how to extend Twig. If
17
- you want to reuse your changes in different projects or if you want to
18
- share them with others, you should then create an extension as described
19
- in the following section.
20
-
21
- .. caution::
22
-
23
- When extending Twig by calling methods on the Twig environment instance,
24
- Twig won't be able to recompile your templates when the PHP code is
25
- updated. To see your changes in real-time, either disable template caching
26
- or package your code into an extension (see the next section of this
27
- chapter).
28
-
29
- Before extending Twig, you must understand the differences between all the
30
- different possible extension points and when to use them.
31
-
32
- First, remember that Twig has two main language constructs:
33
-
34
- * ``{{ }}``: used to print the result of an expression evaluation;
35
-
36
- * ``{% %}``: used to execute statements.
37
-
38
- To understand why Twig exposes so many extension points, let's see how to
39
- implement a *Lorem ipsum* generator (it needs to know the number of words to
40
- generate).
41
-
42
- You can use a ``lipsum`` *tag*:
43
-
44
- .. code-block:: twig
45
-
46
- {% lipsum 40 %}
47
-
48
- That works, but using a tag for ``lipsum`` is not a good idea for at least
49
- three main reasons:
50
-
51
- * ``lipsum`` is not a language construct;
52
- * The tag outputs something;
53
- * The tag is not flexible as you cannot use it in an expression:
54
-
55
- .. code-block:: twig
56
-
57
- {{ 'some text' ~ {% lipsum 40 %} ~ 'some more text' }}
58
-
59
- In fact, you rarely need to create tags; and that's good news because tags are
60
- the most complex extension point of Twig.
61
-
62
- Now, let's use a ``lipsum`` *filter*:
63
-
64
- .. code-block:: twig
65
-
66
- {{ 40|lipsum }}
67
-
68
- Again, it works, but it looks weird. A filter transforms the passed value to
69
- something else but here we use the value to indicate the number of words to
70
- generate (so, ``40`` is an argument of the filter, not the value we want to
71
- transform).
72
-
73
- Next, let's use a ``lipsum`` *function*:
74
-
75
- .. code-block:: twig
76
-
77
- {{ lipsum(40) }}
78
-
79
- Here we go. For this specific example, the creation of a function is the
80
- extension point to use. And you can use it anywhere an expression is accepted:
81
-
82
- .. code-block:: twig
83
-
84
- {{ 'some text' ~ ipsum(40) ~ 'some more text' }}
85
-
86
- {% set ipsum = ipsum(40) %}
87
-
88
- Last but not the least, you can also use a *global* object with a method able
89
- to generate lorem ipsum text:
90
-
91
- .. code-block:: twig
92
-
93
- {{ text.lipsum(40) }}
94
-
95
- As a rule of thumb, use functions for frequently used features and global
96
- objects for everything else.
97
-
98
- Keep in mind the following when you want to extend Twig:
99
-
100
- ========== ========================== ========== =========================
101
- What? Implementation difficulty? How often? When?
102
- ========== ========================== ========== =========================
103
- *macro* trivial frequent Content generation
104
- *global* trivial frequent Helper object
105
- *function* trivial frequent Content generation
106
- *filter* trivial frequent Value transformation
107
- *tag* complex rare DSL language construct
108
- *test* trivial rare Boolean decision
109
- *operator* trivial rare Values transformation
110
- ========== ========================== ========== =========================
111
-
112
- Globals
113
- -------
114
-
115
- A global variable is like any other template variable, except that it's
116
- available in all templates and macros::
117
-
118
- $twig = new \Twig\Environment($loader);
119
- $twig->addGlobal('text', new Text());
120
-
121
- You can then use the ``text`` variable anywhere in a template:
122
-
123
- .. code-block:: twig
124
-
125
- {{ text.lipsum(40) }}
126
-
127
- Filters
128
- -------
129
-
130
- A filter is a regular PHP function or an object method that takes the left
131
- side of the filter (before the pipe ``|``) as first argument and the extra
132
- arguments passed to the filter (within parentheses ``()``) as extra arguments.
133
-
134
- Defining a filter is as easy as associating the filter name with a PHP
135
- callable. For instance, let's say you have the following code in a template:
136
-
137
- .. code-block:: twig
138
-
139
- {{ 'TWIG'|lower }}
140
-
141
- When compiling this template to PHP, Twig looks for the PHP callable
142
- associated with the ``lower`` filter. The ``lower`` filter is a built-in Twig
143
- filter, and it is mapped directly to the PHP ``strtolower()`` function. After
144
- compilation, the generated PHP code is roughly equivalent to:
145
-
146
- .. code-block:: html+php
147
-
148
- <?php echo strtolower('TWIG') ?>
149
-
150
- As you can see, the ``'TWIG'`` string is passed as a first argument to the PHP
151
- function.
152
-
153
- A filter can also take extra arguments like in the following example:
154
-
155
- .. code-block:: twig
156
-
157
- {{ now|date('d/m/Y') }}
158
-
159
- In this case, the extra arguments are passed to the function after the main
160
- argument, and the compiled code is equivalent to:
161
-
162
- .. code-block:: html+php
163
-
164
- <?php echo twig_date_format_filter($now, 'd/m/Y') ?>
165
-
166
- Let's see how to create a new filter.
167
-
168
- In this section, we will create a ``rot13`` filter, which should return the
169
- `rot13`_ transformation of a string. Here is an example of its usage and the
170
- expected output:
171
-
172
- .. code-block:: twig
173
-
174
- {{ "Twig"|rot13 }}
175
-
176
- {# should displays Gjvt #}
177
-
178
- Adding a filter is as simple as calling the ``addFilter()`` method on the
179
- ``\Twig\Environment`` instance::
180
-
181
- $twig = new \Twig\Environment($loader);
182
- $twig->addFilter('rot13', new Twig_Filter_Function('str_rot13'));
183
-
184
- The second argument of ``addFilter()`` is an instance of ``Twig_Filter``.
185
- Here, we use ``Twig_Filter_Function`` as the filter is a PHP function. The
186
- first argument passed to the ``Twig_Filter_Function`` constructor is the name
187
- of the PHP function to call, here ``str_rot13``, a native PHP function.
188
-
189
- Let's say I now want to be able to add a prefix before the converted string:
190
-
191
- .. code-block:: twig
192
-
193
- {{ "Twig"|rot13('prefix_') }}
194
-
195
- {# should displays prefix_Gjvt #}
196
-
197
- As the PHP ``str_rot13()`` function does not support this requirement, let's
198
- create a new PHP function::
199
-
200
- function project_compute_rot13($string, $prefix = '')
201
- {
202
- return $prefix.str_rot13($string);
203
- }
204
-
205
- As you can see, the ``prefix`` argument of the filter is passed as an extra
206
- argument to the ``project_compute_rot13()`` function.
207
-
208
- Adding this filter is as easy as before::
209
-
210
- $twig->addFilter('rot13', new Twig_Filter_Function('project_compute_rot13'));
211
-
212
- For better encapsulation, a filter can also be defined as a static method of a
213
- class. The ``Twig_Filter_Function`` class can also be used to register such
214
- static methods as filters::
215
-
216
- $twig->addFilter('rot13', new Twig_Filter_Function('SomeClass::rot13Filter'));
217
-
218
- .. tip::
219
-
220
- In an extension, you can also define a filter as a static method of the
221
- extension class.
222
-
223
- Environment aware Filters
224
- ~~~~~~~~~~~~~~~~~~~~~~~~~
225
-
226
- The ``Twig_Filter`` classes take options as their last argument. For instance,
227
- if you want access to the current environment instance in your filter, set the
228
- ``needs_environment`` option to ``true``::
229
-
230
- $filter = new Twig_Filter_Function('str_rot13', ['needs_environment' => true]);
231
-
232
- Twig will then pass the current environment as the first argument to the
233
- filter call::
234
-
235
- function twig_compute_rot13(\Twig\Environment $env, $string)
236
- {
237
- // get the current charset for instance
238
- $charset = $env->getCharset();
239
-
240
- return str_rot13($string);
241
- }
242
-
243
- Automatic Escaping
244
- ~~~~~~~~~~~~~~~~~~
245
-
246
- If automatic escaping is enabled, the output of the filter may be escaped
247
- before printing. If your filter acts as an escaper (or explicitly outputs HTML
248
- or JavaScript code), you will want the raw output to be printed. In such a
249
- case, set the ``is_safe`` option::
250
-
251
- $filter = new Twig_Filter_Function('nl2br', ['is_safe' => ['html']]);
252
-
253
- Some filters may need to work on input that is already escaped or safe, for
254
- example when adding (safe) HTML tags to originally unsafe output. In such a
255
- case, set the ``pre_escape`` option to escape the input data before it is run
256
- through your filter::
257
-
258
- $filter = new Twig_Filter_Function('somefilter', ['pre_escape' => 'html', 'is_safe' => ['html']]);
259
-
260
- Dynamic Filters
261
- ~~~~~~~~~~~~~~~
262
-
263
- .. versionadded:: 1.5
264
- Dynamic filters support was added in Twig 1.5.
265
-
266
- A filter name containing the special ``*`` character is a dynamic filter as
267
- the ``*`` can be any string::
268
-
269
- $twig->addFilter('*_path_*', new Twig_Filter_Function('twig_path'));
270
-
271
- function twig_path($name, $arguments)
272
- {
273
- // ...
274
- }
275
-
276
- The following filters will be matched by the above defined dynamic filter:
277
-
278
- * ``product_path``
279
- * ``category_path``
280
-
281
- A dynamic filter can define more than one dynamic parts::
282
-
283
- $twig->addFilter('*_path_*', new Twig_Filter_Function('twig_path'));
284
-
285
- function twig_path($name, $suffix, $arguments)
286
- {
287
- // ...
288
- }
289
-
290
- The filter will receive all dynamic part values before the normal filters
291
- arguments. For instance, a call to ``'foo'|a_path_b()`` will result in the
292
- following PHP call: ``twig_path('a', 'b', 'foo')``.
293
-
294
- Functions
295
- ---------
296
-
297
- A function is a regular PHP function or an object method that can be called from
298
- templates.
299
-
300
- .. code-block:: twig
301
-
302
- {{ constant("DATE_W3C") }}
303
-
304
- When compiling this template to PHP, Twig looks for the PHP callable
305
- associated with the ``constant`` function. The ``constant`` function is a built-in Twig
306
- function, and it is mapped directly to the PHP ``constant()`` function. After
307
- compilation, the generated PHP code is roughly equivalent to:
308
-
309
- .. code-block:: html+php
310
-
311
- <?php echo constant('DATE_W3C') ?>
312
-
313
- Adding a function is similar to adding a filter. This can be done by calling the
314
- ``addFunction()`` method on the ``\Twig\Environment`` instance::
315
-
316
- $twig = new \Twig\Environment($loader);
317
- $twig->addFunction('functionName', new Twig_Function_Function('someFunction'));
318
-
319
- You can also expose extension methods as functions in your templates::
320
-
321
- // $this is an object that implements \Twig\Extension\ExtensionInterface.
322
- $twig = new \Twig\Environment($loader);
323
- $twig->addFunction('otherFunction', new Twig_Function_Method($this, 'someMethod'));
324
-
325
- Functions also support ``needs_environment`` and ``is_safe`` parameters.
326
-
327
- Dynamic Functions
328
- ~~~~~~~~~~~~~~~~~
329
-
330
- .. versionadded:: 1.5
331
- Dynamic functions support was added in Twig 1.5.
332
-
333
- A function name containing the special ``*`` character is a dynamic function
334
- as the ``*`` can be any string::
335
-
336
- $twig->addFunction('*_path', new Twig_Function_Function('twig_path'));
337
-
338
- function twig_path($name, $arguments)
339
- {
340
- // ...
341
- }
342
-
343
- The following functions will be matched by the above defined dynamic function:
344
-
345
- * ``product_path``
346
- * ``category_path``
347
-
348
- A dynamic function can define more than one dynamic parts::
349
-
350
- $twig->addFilter('*_path_*', new Twig_Filter_Function('twig_path'));
351
-
352
- function twig_path($name, $suffix, $arguments)
353
- {
354
- // ...
355
- }
356
-
357
- The function will receive all dynamic part values before the normal functions
358
- arguments. For instance, a call to ``a_path_b('foo')`` will result in the
359
- following PHP call: ``twig_path('a', 'b', 'foo')``.
360
-
361
- Tags
362
- ----
363
-
364
- One of the most exciting feature of a template engine like Twig is the
365
- possibility to define new language constructs. This is also the most complex
366
- feature as you need to understand how Twig's internals work.
367
-
368
- Let's create a simple ``set`` tag that allows the definition of simple
369
- variables from within a template. The tag can be used like follows:
370
-
371
- .. code-block:: twig
372
-
373
- {% set name = "value" %}
374
-
375
- {{ name }}
376
-
377
- {# should output value #}
378
-
379
- .. note::
380
-
381
- The ``set`` tag is part of the Core extension and as such is always
382
- available. The built-in version is slightly more powerful and supports
383
- multiple assignments by default (cf. the template designers chapter for
384
- more information).
385
-
386
- Three steps are needed to define a new tag:
387
-
388
- * Defining a Token Parser class (responsible for parsing the template code);
389
-
390
- * Defining a Node class (responsible for converting the parsed code to PHP);
391
-
392
- * Registering the tag.
393
-
394
- Registering a new tag
395
- ~~~~~~~~~~~~~~~~~~~~~
396
-
397
- Adding a tag is as simple as calling the ``addTokenParser`` method on the
398
- ``\Twig\Environment`` instance::
399
-
400
- $twig = new \Twig\Environment($loader);
401
- $twig->addTokenParser(new Project_Set_TokenParser());
402
-
403
- Defining a Token Parser
404
- ~~~~~~~~~~~~~~~~~~~~~~~
405
-
406
- Now, let's see the actual code of this class::
407
-
408
- class Project_Set_TokenParser extends \Twig\TokenParser\AbstractTokenParser
409
- {
410
- public function parse(\Twig\Token $token)
411
- {
412
- $lineno = $token->getLine();
413
- $name = $this->parser->getStream()->expect(\Twig\Token::NAME_TYPE)->getValue();
414
- $this->parser->getStream()->expect(\Twig\Token::OPERATOR_TYPE, '=');
415
- $value = $this->parser->getExpressionParser()->parseExpression();
416
-
417
- $this->parser->getStream()->expect(\Twig\Token::BLOCK_END_TYPE);
418
-
419
- return new Project_Set_Node($name, $value, $lineno, $this->getTag());
420
- }
421
-
422
- public function getTag()
423
- {
424
- return 'set';
425
- }
426
- }
427
-
428
- The ``getTag()`` method must return the tag we want to parse, here ``set``.
429
-
430
- The ``parse()`` method is invoked whenever the parser encounters a ``set``
431
- tag. It should return a ``\Twig\Node\Node`` instance that represents the node (the
432
- ``Project_Set_Node`` calls creating is explained in the next section).
433
-
434
- The parsing process is simplified thanks to a bunch of methods you can call
435
- from the token stream (``$this->parser->getStream()``):
436
-
437
- * ``getCurrent()``: Gets the current token in the stream.
438
-
439
- * ``next()``: Moves to the next token in the stream, *but returns the old one*.
440
-
441
- * ``test($type)``, ``test($value)`` or ``test($type, $value)``: Determines whether
442
- the current token is of a particular type or value (or both). The value may be an
443
- array of several possible values.
444
-
445
- * ``expect($type[, $value[, $message]])``: If the current token isn't of the given
446
- type/value a syntax error is thrown. Otherwise, if the type and value are correct,
447
- the token is returned and the stream moves to the next token.
448
-
449
- * ``look()``: Looks a the next token without consuming it.
450
-
451
- Parsing expressions is done by calling the ``parseExpression()`` like we did for
452
- the ``set`` tag.
453
-
454
- .. tip::
455
-
456
- Reading the existing ``TokenParser`` classes is the best way to learn all
457
- the nitty-gritty details of the parsing process.
458
-
459
- Defining a Node
460
- ~~~~~~~~~~~~~~~
461
-
462
- The ``Project_Set_Node`` class itself is rather simple::
463
-
464
- class Project_Set_Node extends \Twig\Node\Node
465
- {
466
- public function __construct($name, \Twig\Node\Expression\AbstractExpression $value, $lineno, $tag = null)
467
- {
468
- parent::__construct(['value' => $value], ['name' => $name], $lineno, $tag);
469
- }
470
-
471
- public function compile(\Twig\Compiler $compiler)
472
- {
473
- $compiler
474
- ->addDebugInfo($this)
475
- ->write('$context[\''.$this->getAttribute('name').'\'] = ')
476
- ->subcompile($this->getNode('value'))
477
- ->raw(";\n")
478
- ;
479
- }
480
- }
481
-
482
- The compiler implements a fluid interface and provides methods that helps the
483
- developer generate beautiful and readable PHP code:
484
-
485
- * ``subcompile()``: Compiles a node.
486
-
487
- * ``raw()``: Writes the given string as is.
488
-
489
- * ``write()``: Writes the given string by adding indentation at the beginning
490
- of each line.
491
-
492
- * ``string()``: Writes a quoted string.
493
-
494
- * ``repr()``: Writes a PHP representation of a given value (see
495
- ``\Twig\Node\ForNode`` for a usage example).
496
-
497
- * ``addDebugInfo()``: Adds the line of the original template file related to
498
- the current node as a comment.
499
-
500
- * ``indent()``: Indents the generated code (see ``\Twig\Node\BlockNode`` for a
501
- usage example).
502
-
503
- * ``outdent()``: Outdents the generated code (see ``\Twig\Node\BlockNode`` for a
504
- usage example).
505
-
506
- Creating an Extension
507
- ---------------------
508
-
509
- The main motivation for writing an extension is to move often used code into a
510
- reusable class like adding support for internationalization. An extension can
511
- define tags, filters, tests, operators, global variables, functions, and node
512
- visitors.
513
-
514
- Creating an extension also makes for a better separation of code that is
515
- executed at compilation time and code needed at runtime. As such, it makes
516
- your code faster.
517
-
518
- Most of the time, it is useful to create a single extension for your project,
519
- to host all the specific tags and filters you want to add to Twig.
520
-
521
- .. tip::
522
-
523
- When packaging your code into an extension, Twig is smart enough to
524
- recompile your templates whenever you make a change to it (when the
525
- ``auto_reload`` is enabled).
526
-
527
- .. note::
528
-
529
- Before writing your own extensions, have a look at the Twig official
530
- extension repository: https://github.com/twigphp/Twig-extensions.
531
-
532
- An extension is a class that implements the following interface::
533
-
534
- interface Twig_ExtensionInterface
535
- {
536
- /**
537
- * Initializes the runtime environment.
538
- *
539
- * This is where you can load some file that contains filter functions for instance.
540
- */
541
- function initRuntime(\Twig\Environment $environment);
542
-
543
- /**
544
- * Returns the token parser instances to add to the existing list.
545
- *
546
- * @return (Twig_TokenParserInterface|Twig_TokenParserBrokerInterface)[]
547
- */
548
- function getTokenParsers();
549
-
550
- /**
551
- * Returns the node visitor instances to add to the existing list.
552
- *
553
- * @return \Twig\NodeVisitor\NodeVisitorInterface[]
554
- */
555
- function getNodeVisitors();
556
-
557
- /**
558
- * Returns a list of filters to add to the existing list.
559
- *
560
- * @return \Twig\TwigFilter[]
561
- */
562
- function getFilters();
563
-
564
- /**
565
- * Returns a list of tests to add to the existing list.
566
- *
567
- * @return \Twig\TwigTest[]
568
- */
569
- function getTests();
570
-
571
- /**
572
- * Returns a list of functions to add to the existing list.
573
- *
574
- * @return \Twig\TwigFunction[]
575
- */
576
- function getFunctions();
577
-
578
- /**
579
- * Returns a list of operators to add to the existing list.
580
- *
581
- * @return array<array> First array of unary operators, second array of binary operators
582
- */
583
- function getOperators();
584
-
585
- /**
586
- * Returns a list of global variables to add to the existing list.
587
- *
588
- * @return array An array of global variables
589
- */
590
- function getGlobals();
591
-
592
- /**
593
- * Returns the name of the extension.
594
- *
595
- * @return string The extension name
596
- */
597
- function getName();
598
- }
599
-
600
- To keep your extension class clean and lean, it can inherit from the built-in
601
- ``\Twig\Extension\AbstractExtension`` class instead of implementing the whole interface. That
602
- way, you just need to implement the ``getName()`` method as the
603
- ``\Twig\Extension\AbstractExtension`` provides empty implementations for all other methods.
604
-
605
- The ``getName()`` method must return a unique identifier for your extension.
606
-
607
- Now, with this information in mind, let's create the most basic extension
608
- possible::
609
-
610
- class Project_Twig_Extension extends \Twig\Extension\AbstractExtension
611
- {
612
- public function getName()
613
- {
614
- return 'project';
615
- }
616
- }
617
-
618
- .. note::
619
-
620
- This extension does nothing for now. We will customize it in the next sections.
621
-
622
- Twig does not care where you save your extension on the filesystem, as all
623
- extensions must be registered explicitly to be available in your templates.
624
-
625
- You can register an extension by using the ``addExtension()`` method on your
626
- main ``Environment`` object::
627
-
628
- $twig = new \Twig\Environment($loader);
629
- $twig->addExtension(new Project_Twig_Extension());
630
-
631
- Don't forget to load first the extension file by either using ``require_once()``
632
- or by using an autoloader (see `spl_autoload_register()`_).
633
-
634
- .. tip::
635
-
636
- The bundled extensions are great examples of how extensions work.
637
-
638
- Globals
639
- ~~~~~~~
640
-
641
- Global variables can be registered in an extension via the ``getGlobals()``
642
- method::
643
-
644
- class Project_Twig_Extension extends \Twig\Extension\AbstractExtension
645
- {
646
- public function getGlobals()
647
- {
648
- return [
649
- 'text' => new Text(),
650
- ];
651
- }
652
-
653
- // ...
654
- }
655
-
656
- Functions
657
- ~~~~~~~~~
658
-
659
- Functions can be registered in an extension via the ``getFunctions()``
660
- method::
661
-
662
- class Project_Twig_Extension extends \Twig\Extension\AbstractExtension
663
- {
664
- public function getFunctions()
665
- {
666
- return [
667
- 'lipsum' => new Twig_Function_Function('generate_lipsum'),
668
- ];
669
- }
670
-
671
- // ...
672
- }
673
-
674
- Filters
675
- ~~~~~~~
676
-
677
- To add a filter to an extension, you need to override the ``getFilters()``
678
- method. This method must return an array of filters to add to the Twig
679
- environment::
680
-
681
- class Project_Twig_Extension extends \Twig\Extension\AbstractExtension
682
- {
683
- public function getFilters()
684
- {
685
- return [
686
- 'rot13' => new Twig_Filter_Function('str_rot13'),
687
- ];
688
- }
689
-
690
- // ...
691
- }
692
-
693
- As you can see in the above code, the ``getFilters()`` method returns an array
694
- where keys are the name of the filters (``rot13``) and the values the
695
- definition of the filter (``new Twig_Filter_Function('str_rot13')``).
696
-
697
- As seen in the previous chapter, you can also define filters as static methods
698
- on the extension class::
699
-
700
- $twig->addFilter('rot13', new Twig_Filter_Function('Project_Twig_Extension::rot13Filter'));
701
-
702
- You can also use ``Twig_Filter_Method`` instead of ``Twig_Filter_Function``
703
- when defining a filter to use a method::
704
-
705
- class Project_Twig_Extension extends \Twig\Extension\AbstractExtension
706
- {
707
- public function getFilters()
708
- {
709
- return [
710
- 'rot13' => new Twig_Filter_Method($this, 'rot13Filter'),
711
- ];
712
- }
713
-
714
- public function rot13Filter($string)
715
- {
716
- return str_rot13($string);
717
- }
718
-
719
- // ...
720
- }
721
-
722
- The first argument of the ``Twig_Filter_Method`` constructor is always
723
- ``$this``, the current extension object. The second one is the name of the
724
- method to call.
725
-
726
- Using methods for filters is a great way to package your filter without
727
- polluting the global namespace. This also gives the developer more flexibility
728
- at the cost of a small overhead.
729
-
730
- Overriding default Filters
731
- ..........................
732
-
733
- If some default core filters do not suit your needs, you can override
734
- them by creating your own extension. Just use the same names as the one you
735
- want to override::
736
-
737
- class MyCoreExtension extends \Twig\Extension\AbstractExtension
738
- {
739
- public function getFilters()
740
- {
741
- return [
742
- 'date' => new Twig_Filter_Method($this, 'dateFilter'),
743
- // ...
744
- ];
745
- }
746
-
747
- public function dateFilter($timestamp, $format = 'F j, Y H:i')
748
- {
749
- return '...'.twig_date_format_filter($timestamp, $format);
750
- }
751
-
752
- public function getName()
753
- {
754
- return 'project';
755
- }
756
- }
757
-
758
- Here, we override the ``date`` filter with a custom one. Using this extension
759
- is as simple as registering the ``MyCoreExtension`` extension by calling the
760
- ``addExtension()`` method on the environment instance::
761
-
762
- $twig = new \Twig\Environment($loader);
763
- $twig->addExtension(new MyCoreExtension());
764
-
765
- Tags
766
- ~~~~
767
-
768
- Adding a tag in an extension can be done by overriding the
769
- ``getTokenParsers()`` method. This method must return an array of tags to add
770
- to the Twig environment::
771
-
772
- class Project_Twig_Extension extends \Twig\Extension\AbstractExtension
773
- {
774
- public function getTokenParsers()
775
- {
776
- return [new Project_Set_TokenParser()];
777
- }
778
-
779
- // ...
780
- }
781
-
782
- In the above code, we have added a single new tag, defined by the
783
- ``Project_Set_TokenParser`` class. The ``Project_Set_TokenParser`` class is
784
- responsible for parsing the tag and compiling it to PHP.
785
-
786
- Operators
787
- ~~~~~~~~~
788
-
789
- The ``getOperators()`` methods allows to add new operators. Here is how to add
790
- ``!``, ``||``, and ``&&`` operators::
791
-
792
- class Project_Twig_Extension extends \Twig\Extension\AbstractExtension
793
- {
794
- public function getOperators()
795
- {
796
- return [
797
- [
798
- '!' => ['precedence' => 50, 'class' => '\Twig\Node\Expression\Unary\NotUnary'],
799
- ),
800
- [
801
- '||' => ['precedence' => 10, 'class' => '\Twig\Node\Expression\Binary\OrBinary', 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT],
802
- '&&' => ['precedence' => 15, 'class' => '\Twig\Node\Expression\Binary\AndBinary', 'associativity' => \Twig\ExpressionParser::OPERATOR_LEFT],
803
- ],
804
- ];
805
- }
806
-
807
- // ...
808
- }
809
-
810
- Tests
811
- ~~~~~
812
-
813
- The ``getTests()`` methods allows to add new test functions::
814
-
815
- class Project_Twig_Extension extends \Twig\Extension\AbstractExtension
816
- {
817
- public function getTests()
818
- {
819
- return [
820
- 'even' => new Twig_Test_Function('twig_test_even'),
821
- ];
822
- }
823
-
824
- // ...
825
- }
826
-
827
- Testing an Extension
828
- --------------------
829
-
830
- .. versionadded:: 1.10
831
- Support for functional tests was added in Twig 1.10.
832
-
833
- Functional Tests
834
- ~~~~~~~~~~~~~~~~
835
-
836
- You can create functional tests for extensions by creating the
837
- following file structure in your test directory::
838
-
839
- Fixtures/
840
- filters/
841
- foo.test
842
- bar.test
843
- functions/
844
- foo.test
845
- bar.test
846
- tags/
847
- foo.test
848
- bar.test
849
- IntegrationTest.php
850
-
851
- The ``IntegrationTest.php`` file should look like this::
852
-
853
- class Project_Tests_IntegrationTest extends \Twig\Test\IntegrationTestCase
854
- {
855
- public function getExtensions()
856
- {
857
- return [
858
- new Project_Twig_Extension1(),
859
- new Project_Twig_Extension2(),
860
- ];
861
- }
862
-
863
- public function getFixturesDir()
864
- {
865
- return __DIR__.'/Fixtures/';
866
- }
867
- }
868
-
869
- Fixtures examples can be found within the Twig repository
870
- `tests/Twig/Fixtures`_ directory.
871
-
872
- Node Tests
873
- ~~~~~~~~~~
874
-
875
- Testing the node visitors can be complex, so extend your test cases from
876
- ``\Twig\Test\NodeTestCase``. Examples can be found in the Twig repository
877
- `tests/Twig/Node`_ directory.
878
-
879
- .. _`spl_autoload_register()`: https://secure.php.net/spl_autoload_register
880
- .. _`rot13`: https://secure.php.net/manual/en/function.str-rot13.php
881
- .. _`tests/Twig/Fixtures`: https://github.com/twigphp/Twig/tree/1.x/tests/Fixtures
882
- .. _`tests/Twig/Node`: https://github.com/twigphp/Twig/tree/1.x/tests/Node
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/api.rst DELETED
@@ -1,596 +0,0 @@
1
- Twig for Developers
2
- ===================
3
-
4
- This chapter describes the API to Twig and not the template language. It will
5
- be most useful as reference to those implementing the template interface to
6
- the application and not those who are creating Twig templates.
7
-
8
- Basics
9
- ------
10
-
11
- Twig uses a central object called the **environment** (of class
12
- ``\Twig\Environment``). Instances of this class are used to store the
13
- configuration and extensions, and are used to load templates.
14
-
15
- Most applications create one ``\Twig\Environment`` object on application
16
- initialization and use that to load templates. In some cases, it might be useful
17
- to have multiple environments side by side, with different configurations.
18
-
19
- The typical way to configure Twig to load templates for an application looks
20
- roughly like this::
21
-
22
- require_once '/path/to/lib/Twig/Autoloader.php';
23
- Twig_Autoloader::register();
24
-
25
- $loader = new \Twig\Loader\FilesystemLoader('/path/to/templates');
26
- $twig = new \Twig\Environment($loader, [
27
- 'cache' => '/path/to/compilation_cache',
28
- ]);
29
-
30
- This creates a template environment with a default configuration and a loader
31
- that looks up templates in the ``/path/to/templates/`` directory. Different
32
- loaders are available and you can also write your own if you want to load
33
- templates from a database or other resources.
34
-
35
- .. note::
36
-
37
- Notice that the second argument of the environment is an array of options.
38
- The ``cache`` option is a compilation cache directory, where Twig caches
39
- the compiled templates to avoid the parsing phase for sub-sequent
40
- requests. It is very different from the cache you might want to add for
41
- the evaluated templates. For such a need, you can use any available PHP
42
- cache library.
43
-
44
- Rendering Templates
45
- -------------------
46
-
47
- To load a template from a Twig environment, call the ``load()`` method which
48
- returns a ``\Twig\TemplateWrapper`` instance::
49
-
50
- $template = $twig->load('index.html');
51
-
52
- .. note::
53
-
54
- Before Twig 1.28, use ``loadTemplate()`` instead which returns a
55
- ``\Twig\Template`` instance.
56
-
57
- To render the template with some variables, call the ``render()`` method::
58
-
59
- echo $template->render(['the' => 'variables', 'go' => 'here']);
60
-
61
- .. note::
62
-
63
- The ``display()`` method is a shortcut to output the rendered template.
64
-
65
- You can also load and render the template in one fell swoop::
66
-
67
- echo $twig->render('index.html', ['the' => 'variables', 'go' => 'here']);
68
-
69
- .. versionadded:: 1.28
70
- The possibility to render blocks from the API was added in Twig 1.28.
71
-
72
- If a template defines blocks, they can be rendered individually via the
73
- ``renderBlock()`` call::
74
-
75
- echo $template->renderBlock('block_name', ['the' => 'variables', 'go' => 'here']);
76
-
77
- .. _environment_options:
78
-
79
- Environment Options
80
- -------------------
81
-
82
- When creating a new ``\Twig\Environment`` instance, you can pass an array of
83
- options as the constructor second argument::
84
-
85
- $twig = new \Twig\Environment($loader, ['debug' => true]);
86
-
87
- The following options are available:
88
-
89
- * ``debug`` *boolean*
90
-
91
- When set to ``true``, the generated templates have a
92
- ``__toString()`` method that you can use to display the generated nodes
93
- (default to ``false``).
94
-
95
- * ``charset`` *string* (defaults to ``utf-8``)
96
-
97
- The charset used by the templates.
98
-
99
- * ``base_template_class`` *string* (defaults to ``\Twig\Template``)
100
-
101
- The base template class to use for generated
102
- templates.
103
-
104
- * ``cache`` *string* or ``false``
105
-
106
- An absolute path where to store the compiled templates, or
107
- ``false`` to disable caching (which is the default).
108
-
109
- * ``auto_reload`` *boolean*
110
-
111
- When developing with Twig, it's useful to recompile the
112
- template whenever the source code changes. If you don't provide a value for
113
- the ``auto_reload`` option, it will be determined automatically based on the
114
- ``debug`` value.
115
-
116
- * ``strict_variables`` *boolean*
117
-
118
- If set to ``false``, Twig will silently ignore invalid
119
- variables (variables and or attributes/methods that do not exist) and
120
- replace them with a ``null`` value. When set to ``true``, Twig throws an
121
- exception instead (default to ``false``).
122
-
123
- * ``autoescape`` *string* or *boolean*
124
-
125
- If set to ``true``, HTML auto-escaping will be enabled by
126
- default for all templates (default to ``true``).
127
-
128
- As of Twig 1.8, you can set the escaping strategy to use (``html``, ``js``,
129
- ``false`` to disable).
130
-
131
- As of Twig 1.9, you can set the escaping strategy to use (``css``, ``url``,
132
- ``html_attr``, or a PHP callback that takes the template name and must
133
- return the escaping strategy to use -- the callback cannot be a function name
134
- to avoid collision with built-in escaping strategies).
135
-
136
- As of Twig 1.17, the ``filename`` escaping strategy (renamed to ``name`` as
137
- of Twig 1.27) determines the escaping strategy to use for a template based on
138
- the template filename extension (this strategy does not incur any overhead at
139
- runtime as auto-escaping is done at compilation time.)
140
-
141
- * ``optimizations`` *integer*
142
-
143
- A flag that indicates which optimizations to apply
144
- (default to ``-1`` -- all optimizations are enabled; set it to ``0`` to
145
- disable).
146
-
147
- Loaders
148
- -------
149
-
150
- Loaders are responsible for loading templates from a resource such as the file
151
- system.
152
-
153
- Compilation Cache
154
- ~~~~~~~~~~~~~~~~~
155
-
156
- All template loaders can cache the compiled templates on the filesystem for
157
- future reuse. It speeds up Twig a lot as templates are only compiled once; and
158
- the performance boost is even larger if you use a PHP accelerator such as
159
- OPCache. See the ``cache`` and ``auto_reload`` options of ``\Twig\Environment``
160
- above for more information.
161
-
162
- Built-in Loaders
163
- ~~~~~~~~~~~~~~~~
164
-
165
- Here is a list of the built-in loaders:
166
-
167
- ``\Twig\Loader\FilesystemLoader``
168
- .................................
169
-
170
- .. versionadded:: 1.10
171
- The ``prependPath()`` and support for namespaces were added in Twig 1.10.
172
-
173
- .. versionadded:: 1.27
174
- Relative paths support was added in Twig 1.27.
175
-
176
- ``\Twig\Loader\FilesystemLoader`` loads templates from the file system. This loader
177
- can find templates in folders on the file system and is the preferred way to
178
- load them::
179
-
180
- $loader = new \Twig\Loader\FilesystemLoader($templateDir);
181
-
182
- It can also look for templates in an array of directories::
183
-
184
- $loader = new \Twig\Loader\FilesystemLoader([$templateDir1, $templateDir2]);
185
-
186
- With such a configuration, Twig will first look for templates in
187
- ``$templateDir1`` and if they do not exist, it will fallback to look for them
188
- in the ``$templateDir2``.
189
-
190
- You can add or prepend paths via the ``addPath()`` and ``prependPath()``
191
- methods::
192
-
193
- $loader->addPath($templateDir3);
194
- $loader->prependPath($templateDir4);
195
-
196
- The filesystem loader also supports namespaced templates. This allows to group
197
- your templates under different namespaces which have their own template paths.
198
-
199
- When using the ``setPaths()``, ``addPath()``, and ``prependPath()`` methods,
200
- specify the namespace as the second argument (when not specified, these
201
- methods act on the "main" namespace)::
202
-
203
- $loader->addPath($templateDir, 'admin');
204
-
205
- Namespaced templates can be accessed via the special
206
- ``@namespace_name/template_path`` notation::
207
-
208
- $twig->render('@admin/index.html', []);
209
-
210
- ``\Twig\Loader\FilesystemLoader`` support absolute and relative paths. Using relative
211
- paths is preferred as it makes the cache keys independent of the project root
212
- directory (for instance, it allows warming the cache from a build server where
213
- the directory might be different from the one used on production servers)::
214
-
215
- $loader = new \Twig\Loader\FilesystemLoader('templates', getcwd().'/..');
216
-
217
- .. note::
218
-
219
- When not passing the root path as a second argument, Twig uses ``getcwd()``
220
- for relative paths.
221
-
222
- ``\Twig\Loader\ArrayLoader``
223
- ............................
224
-
225
- ``\Twig\Loader\ArrayLoader`` loads a template from a PHP array. It is passed an
226
- array of strings bound to template names::
227
-
228
- $loader = new \Twig\Loader\ArrayLoader([
229
- 'index.html' => 'Hello {{ name }}!',
230
- ]);
231
- $twig = new \Twig\Environment($loader);
232
-
233
- echo $twig->render('index.html', ['name' => 'Fabien']);
234
-
235
- This loader is very useful for unit testing. It can also be used for small
236
- projects where storing all templates in a single PHP file might make sense.
237
-
238
- .. tip::
239
-
240
- When using the ``Array`` loaders with a cache mechanism, you should know
241
- that a new cache key is generated each time a template content "changes"
242
- (the cache key being the source code of the template). If you don't want to
243
- see your cache grows out of control, you need to take care of clearing the
244
- old cache file by yourself.
245
-
246
- ``\Twig\Loader\ChainLoader``
247
- ............................
248
-
249
- ``\Twig\Loader\ChainLoader`` delegates the loading of templates to other loaders::
250
-
251
- $loader1 = new \Twig\Loader\ArrayLoader([
252
- 'base.html' => '{% block content %}{% endblock %}',
253
- ]);
254
- $loader2 = new \Twig\Loader\ArrayLoader([
255
- 'index.html' => '{% extends "base.html" %}{% block content %}Hello {{ name }}{% endblock %}',
256
- 'base.html' => 'Will never be loaded',
257
- ]);
258
-
259
- $loader = new \Twig\Loader\ChainLoader([$loader1, $loader2]);
260
-
261
- $twig = new \Twig\Environment($loader);
262
-
263
- When looking for a template, Twig tries each loader in turn and returns as soon
264
- as the template is found. When rendering the ``index.html`` template from the
265
- above example, Twig will load it with ``$loader2`` but the ``base.html``
266
- template will be loaded from ``$loader1``.
267
-
268
- .. note::
269
-
270
- You can also add loaders via the ``addLoader()`` method.
271
-
272
- Create your own Loader
273
- ~~~~~~~~~~~~~~~~~~~~~~
274
-
275
- All loaders implement the ``\Twig\Loader\LoaderInterface``::
276
-
277
- interface Twig_LoaderInterface
278
- {
279
- /**
280
- * Gets the source code of a template, given its name.
281
- *
282
- * @param string $name string The name of the template to load
283
- *
284
- * @return string The template source code
285
- *
286
- * @deprecated since 1.27 (to be removed in 2.0), implement \Twig\Loader\SourceContextLoaderInterface
287
- */
288
- function getSource($name);
289
-
290
- /**
291
- * Gets the cache key to use for the cache for a given template name.
292
- *
293
- * @param string $name string The name of the template to load
294
- *
295
- * @return string The cache key
296
- */
297
- function getCacheKey($name);
298
-
299
- /**
300
- * Returns true if the template is still fresh.
301
- *
302
- * @param string $name The template name
303
- * @param timestamp $time The last modification time of the cached template
304
- */
305
- function isFresh($name, $time);
306
- }
307
-
308
- The ``isFresh()`` method must return ``true`` if the current cached template
309
- is still fresh, given the last modification time, or ``false`` otherwise.
310
-
311
- .. note::
312
-
313
- As of Twig 1.27, you should also implement
314
- ``\Twig\Loader\SourceContextLoaderInterface`` to avoid deprecation notices.
315
-
316
- .. tip::
317
-
318
- As of Twig 1.11.0, you can also implement ``\Twig\Loader\ExistsLoaderInterface``
319
- to make your loader faster when used with the chain loader.
320
-
321
- Using Extensions
322
- ----------------
323
-
324
- Twig extensions are packages that add new features to Twig. Register an
325
- extension via the ``addExtension()`` method::
326
-
327
- $twig->addExtension(new \Twig\Extension\SandboxExtension());
328
-
329
- Twig comes bundled with the following extensions:
330
-
331
- * *Twig\Extension\CoreExtension*: Defines all the core features of Twig.
332
-
333
- * *Twig\Extension\DebugExtension*: Defines the ``dump`` function to help debug
334
- template variables.
335
-
336
- * *Twig\Extension\EscaperExtension*: Adds automatic output-escaping and the
337
- possibility to escape/unescape blocks of code.
338
-
339
- * *Twig\Extension\SandboxExtension*: Adds a sandbox mode to the default Twig
340
- environment, making it safe to evaluate untrusted code.
341
-
342
- * *Twig\Extension\ProfilerExtension*: Enabled the built-in Twig profiler (as of
343
- Twig 1.18).
344
-
345
- * *Twig\Extension\OptimizerExtension*: Optimizes the node tree before
346
- compilation.
347
-
348
- * *Twig\Extension\StringLoaderExtension*: Defined the ``template_from_string``
349
- function to allow loading templates from string in a template.
350
-
351
- The Core, Escaper, and Optimizer extensions are registered by default.
352
-
353
- Built-in Extensions
354
- -------------------
355
-
356
- This section describes the features added by the built-in extensions.
357
-
358
- .. tip::
359
-
360
- Read the chapter about extending Twig to learn how to create your own
361
- extensions.
362
-
363
- Core Extension
364
- ~~~~~~~~~~~~~~
365
-
366
- The ``core`` extension defines all the core features of Twig:
367
-
368
- * :doc:`Tags <tags/index>`;
369
- * :doc:`Filters <filters/index>`;
370
- * :doc:`Functions <functions/index>`;
371
- * :doc:`Tests <tests/index>`.
372
-
373
- Escaper Extension
374
- ~~~~~~~~~~~~~~~~~
375
-
376
- The ``escaper`` extension adds automatic output escaping to Twig. It defines a
377
- tag, ``autoescape``, and a filter, ``raw``.
378
-
379
- When creating the escaper extension, you can switch on or off the global
380
- output escaping strategy::
381
-
382
- $escaper = new \Twig\Extension\EscaperExtension('html');
383
- $twig->addExtension($escaper);
384
-
385
- If set to ``html``, all variables in templates are escaped (using the ``html``
386
- escaping strategy), except those using the ``raw`` filter:
387
-
388
- .. code-block:: twig
389
-
390
- {{ article.to_html|raw }}
391
-
392
- You can also change the escaping mode locally by using the ``autoescape`` tag
393
- (see the :doc:`autoescape<tags/autoescape>` doc for the syntax used before
394
- Twig 1.8):
395
-
396
- .. code-block:: twig
397
-
398
- {% autoescape 'html' %}
399
- {{ var }}
400
- {{ var|raw }} {# var won't be escaped #}
401
- {{ var|escape }} {# var won't be double-escaped #}
402
- {% endautoescape %}
403
-
404
- .. warning::
405
-
406
- The ``autoescape`` tag has no effect on included files.
407
-
408
- The escaping rules are implemented as follows:
409
-
410
- * Literals (integers, booleans, arrays, ...) used in the template directly as
411
- variables or filter arguments are never automatically escaped:
412
-
413
- .. code-block:: twig
414
-
415
- {{ "Twig<br />" }} {# won't be escaped #}
416
-
417
- {% set text = "Twig<br />" %}
418
- {{ text }} {# will be escaped #}
419
-
420
- * Expressions which the result is always a literal or a variable marked safe
421
- are never automatically escaped:
422
-
423
- .. code-block:: twig
424
-
425
- {{ foo ? "Twig<br />" : "<br />Twig" }} {# won't be escaped #}
426
-
427
- {% set text = "Twig<br />" %}
428
- {{ foo ? text : "<br />Twig" }} {# will be escaped #}
429
-
430
- {% set text = "Twig<br />" %}
431
- {{ foo ? text|raw : "<br />Twig" }} {# won't be escaped #}
432
-
433
- {% set text = "Twig<br />" %}
434
- {{ foo ? text|escape : "<br />Twig" }} {# the result of the expression won't be escaped #}
435
-
436
- * Escaping is applied before printing, after any other filter is applied:
437
-
438
- .. code-block:: twig
439
-
440
- {{ var|upper }} {# is equivalent to {{ var|upper|escape }} #}
441
-
442
- * The `raw` filter should only be used at the end of the filter chain:
443
-
444
- .. code-block:: twig
445
-
446
- {{ var|raw|upper }} {# will be escaped #}
447
-
448
- {{ var|upper|raw }} {# won't be escaped #}
449
-
450
- * Automatic escaping is not applied if the last filter in the chain is marked
451
- safe for the current context (e.g. ``html`` or ``js``). ``escape`` and
452
- ``escape('html')`` are marked safe for HTML, ``escape('js')`` is marked
453
- safe for JavaScript, ``raw`` is marked safe for everything.
454
-
455
- .. code-block:: twig
456
-
457
- {% autoescape 'js' %}
458
- {{ var|escape('html') }} {# will be escaped for HTML and JavaScript #}
459
- {{ var }} {# will be escaped for JavaScript #}
460
- {{ var|escape('js') }} {# won't be double-escaped #}
461
- {% endautoescape %}
462
-
463
- .. note::
464
-
465
- Note that autoescaping has some limitations as escaping is applied on
466
- expressions after evaluation. For instance, when working with
467
- concatenation, ``{{ foo|raw ~ bar }}`` won't give the expected result as
468
- escaping is applied on the result of the concatenation, not on the
469
- individual variables (so, the ``raw`` filter won't have any effect here).
470
-
471
- Sandbox Extension
472
- ~~~~~~~~~~~~~~~~~
473
-
474
- The ``sandbox`` extension can be used to evaluate untrusted code. Access to
475
- unsafe attributes and methods is prohibited. The sandbox security is managed
476
- by a policy instance. By default, Twig comes with one policy class:
477
- ``\Twig\Sandbox\SecurityPolicy``. This class allows you to white-list some
478
- tags, filters, properties, and methods::
479
-
480
- $tags = ['if'];
481
- $filters = ['upper'];
482
- $methods = [
483
- 'Article' => ['getTitle', 'getBody'],
484
- ];
485
- $properties = [
486
- 'Article' => ['title', 'body'],
487
- ];
488
- $functions = ['range'];
489
- $policy = new \Twig\Sandbox\SecurityPolicy($tags, $filters, $methods, $properties, $functions);
490
-
491
- With the previous configuration, the security policy will only allow usage of
492
- the ``if`` tag, and the ``upper`` filter. Moreover, the templates will only be
493
- able to call the ``getTitle()`` and ``getBody()`` methods on ``Article``
494
- objects, and the ``title`` and ``body`` public properties. Everything else
495
- won't be allowed and will generate a ``\Twig\Sandbox\SecurityError`` exception.
496
-
497
- The policy object is the first argument of the sandbox constructor::
498
-
499
- $sandbox = new \Twig\Extension\SandboxExtension($policy);
500
- $twig->addExtension($sandbox);
501
-
502
- By default, the sandbox mode is disabled and should be enabled when including
503
- untrusted template code by using the ``sandbox`` tag:
504
-
505
- .. code-block:: twig
506
-
507
- {% sandbox %}
508
- {% include 'user.html' %}
509
- {% endsandbox %}
510
-
511
- You can sandbox all templates by passing ``true`` as the second argument of
512
- the extension constructor::
513
-
514
- $sandbox = new \Twig\Extension\SandboxExtension($policy, true);
515
-
516
- Profiler Extension
517
- ~~~~~~~~~~~~~~~~~~
518
-
519
- .. versionadded:: 1.18
520
- The Profile extension was added in Twig 1.18.
521
-
522
- The ``profiler`` extension enables a profiler for Twig templates; it should
523
- only be used on your development machines as it adds some overhead::
524
-
525
- $profile = new \Twig\Profiler\Profile();
526
- $twig->addExtension(new \Twig\Extension\ProfilerExtension($profile));
527
-
528
- $dumper = new \Twig\Profiler\Dumper\TextDumper();
529
- echo $dumper->dump($profile);
530
-
531
- A profile contains information about time and memory consumption for template,
532
- block, and macro executions.
533
-
534
- You can also dump the data in a `Blackfire.io <https://blackfire.io/>`_
535
- compatible format::
536
-
537
- $dumper = new \Twig\Profiler\Dumper\BlackfireDumper();
538
- file_put_contents('/path/to/profile.prof', $dumper->dump($profile));
539
-
540
- Upload the profile to visualize it (create a `free account
541
- <https://blackfire.io/signup?utm_source=twig&utm_medium=doc&utm_campaign=profiler>`_
542
- first):
543
-
544
- .. code-block:: sh
545
-
546
- blackfire --slot=7 upload /path/to/profile.prof
547
-
548
- Optimizer Extension
549
- ~~~~~~~~~~~~~~~~~~~
550
-
551
- The ``optimizer`` extension optimizes the node tree before compilation::
552
-
553
- $twig->addExtension(new \Twig\Extension\OptimizerExtension());
554
-
555
- By default, all optimizations are turned on. You can select the ones you want
556
- to enable by passing them to the constructor::
557
-
558
- $optimizer = new \Twig\Extension\OptimizerExtension(\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_FOR);
559
-
560
- $twig->addExtension($optimizer);
561
-
562
- Twig supports the following optimizations:
563
-
564
- * ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_ALL``, enables all optimizations
565
- (this is the default value).
566
-
567
- * ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_NONE``, disables all optimizations.
568
- This reduces the compilation time, but it can increase the execution time
569
- and the consumed memory.
570
-
571
- * ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_FOR``, optimizes the ``for`` tag by
572
- removing the ``loop`` variable creation whenever possible.
573
-
574
- * ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_RAW_FILTER``, removes the ``raw``
575
- filter whenever possible.
576
-
577
- * ``\Twig\NodeVisitor\OptimizerNodeVisitor::OPTIMIZE_VAR_ACCESS``, simplifies the creation
578
- and access of variables in the compiled templates whenever possible.
579
-
580
- Exceptions
581
- ----------
582
-
583
- Twig can throw exceptions:
584
-
585
- * ``\Twig\Error\Error``: The base exception for all errors.
586
-
587
- * ``\Twig\Error\SyntaxError``: Thrown to tell the user that there is a problem with
588
- the template syntax.
589
-
590
- * ``\Twig\Error\RuntimeError``: Thrown when an error occurs at runtime (when a filter
591
- does not exist for instance).
592
-
593
- * ``\Twig\Error\LoaderError``: Thrown when an error occurs during template loading.
594
-
595
- * ``\Twig\Sandbox\SecurityError``: Thrown when an unallowed tag, filter, or
596
- method is called in a sandboxed template.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/coding_standards.rst DELETED
@@ -1,101 +0,0 @@
1
- Coding Standards
2
- ================
3
-
4
- When writing Twig templates, we recommend you to follow these official coding
5
- standards:
6
-
7
- * Put one (and only one) space after the start of a delimiter (``{{``, ``{%``,
8
- and ``{#``) and before the end of a delimiter (``}}``, ``%}``, and ``#}``):
9
-
10
- .. code-block:: twig
11
-
12
- {{ foo }}
13
- {# comment #}
14
- {% if foo %}{% endif %}
15
-
16
- When using the whitespace control character, do not put any spaces between
17
- it and the delimiter:
18
-
19
- .. code-block:: twig
20
-
21
- {{- foo -}}
22
- {#- comment -#}
23
- {%- if foo -%}{%- endif -%}
24
-
25
- * Put one (and only one) space before and after the following operators:
26
- comparison operators (``==``, ``!=``, ``<``, ``>``, ``>=``, ``<=``), math
27
- operators (``+``, ``-``, ``/``, ``*``, ``%``, ``//``, ``**``), logic
28
- operators (``not``, ``and``, ``or``), ``~``, ``is``, ``in``, and the ternary
29
- operator (``?:``):
30
-
31
- .. code-block:: twig
32
-
33
- {{ 1 + 2 }}
34
- {{ foo ~ bar }}
35
- {{ true ? true : false }}
36
-
37
- * Put one (and only one) space after the ``:`` sign in hashes and ``,`` in
38
- arrays and hashes:
39
-
40
- .. code-block:: twig
41
-
42
- {{ [1, 2, 3] }}
43
- {{ {'foo': 'bar'} }}
44
-
45
- * Do not put any spaces after an opening parenthesis and before a closing
46
- parenthesis in expressions:
47
-
48
- .. code-block:: twig
49
-
50
- {{ 1 + (2 * 3) }}
51
-
52
- * Do not put any spaces before and after string delimiters:
53
-
54
- .. code-block:: twig
55
-
56
- {{ 'foo' }}
57
- {{ "foo" }}
58
-
59
- * Do not put any spaces before and after the following operators: ``|``,
60
- ``.``, ``..``, ``[]``:
61
-
62
- .. code-block:: twig
63
-
64
- {{ foo|upper|lower }}
65
- {{ user.name }}
66
- {{ user[name] }}
67
- {% for i in 1..12 %}{% endfor %}
68
-
69
- * Do not put any spaces before and after the parenthesis used for filter and
70
- function calls:
71
-
72
- .. code-block:: twig
73
-
74
- {{ foo|default('foo') }}
75
- {{ range(1..10) }}
76
-
77
- * Do not put any spaces before and after the opening and the closing of arrays
78
- and hashes:
79
-
80
- .. code-block:: twig
81
-
82
- {{ [1, 2, 3] }}
83
- {{ {'foo': 'bar'} }}
84
-
85
- * Use lower cased and underscored variable names:
86
-
87
- .. code-block:: twig
88
-
89
- {% set foo = 'foo' %}
90
- {% set foo_bar = 'foo' %}
91
-
92
- * Indent your code inside tags (use the same indentation as the one used for
93
- the target language of the rendered template):
94
-
95
- .. code-block:: twig
96
-
97
- {% block foo %}
98
- {% if true %}
99
- true
100
- {% endif %}
101
- {% endblock %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/deprecated.rst DELETED
@@ -1,224 +0,0 @@
1
- Deprecated Features
2
- ===================
3
-
4
- This document lists all deprecated features in Twig. Deprecated features are
5
- kept for backward compatibility and removed in the next major release (a
6
- feature that was deprecated in Twig 1.x is removed in Twig 2.0).
7
-
8
- Deprecation Notices
9
- -------------------
10
-
11
- As of Twig 1.21, Twig generates deprecation notices when a template uses
12
- deprecated features. See :ref:`deprecation-notices` for more information.
13
-
14
- Macros
15
- ------
16
-
17
- As of Twig 2.0, macros imported in a file are not available in child templates
18
- anymore (via an ``include`` call for instance). You need to import macros
19
- explicitly in each file where you are using them.
20
-
21
- Token Parsers
22
- -------------
23
-
24
- * As of Twig 1.x, the token parser broker sub-system is deprecated. The
25
- following class and interface will be removed in 2.0:
26
-
27
- * ``Twig_TokenParserBrokerInterface``
28
- * ``Twig_TokenParserBroker``
29
-
30
- * As of Twig 1.27, ``\Twig\Parser::getFilename()`` is deprecated. From a token
31
- parser, use ``$this->parser->getStream()->getSourceContext()->getPath()`` instead.
32
-
33
- * As of Twig 1.27, ``\Twig\Parser::getEnvironment()`` is deprecated.
34
-
35
- Extensions
36
- ----------
37
-
38
- * As of Twig 1.x, the ability to remove an extension is deprecated and the
39
- ``\Twig\Environment::removeExtension()`` method will be removed in 2.0.
40
-
41
- * As of Twig 1.23, the ``\Twig\Extension\ExtensionInterface::initRuntime()`` method is
42
- deprecated. You have two options to avoid the deprecation notice: if you
43
- implement this method to store the environment for your custom filters,
44
- functions, or tests, use the ``needs_environment`` option instead; if you
45
- have more complex needs, explicitly implement
46
- ``\Twig\Extension\InitRuntimeInterface`` (not recommended).
47
-
48
- * As of Twig 1.23, the ``\Twig\Extension\ExtensionInterface::getGlobals()`` method is
49
- deprecated. Implement ``\Twig\Extension\GlobalsInterface`` to avoid
50
- deprecation notices.
51
-
52
- * As of Twig 1.26, the ``\Twig\Extension\ExtensionInterface::getName()`` method is
53
- deprecated and it is not used internally anymore.
54
-
55
- PEAR
56
- ----
57
-
58
- PEAR support has been discontinued in Twig 1.15.1, and no PEAR packages are
59
- provided anymore. Use Composer instead.
60
-
61
- Filters
62
- -------
63
-
64
- * As of Twig 1.x, use ``\Twig\TwigFilter`` to add a filter. The following
65
- classes and interfaces will be removed in 2.0:
66
-
67
- * ``Twig_FilterInterface``
68
- * ``Twig_FilterCallableInterface``
69
- * ``Twig_Filter``
70
- * ``Twig_Filter_Function``
71
- * ``Twig_Filter_Method``
72
- * ``Twig_Filter_Node``
73
-
74
- * As of Twig 2.x, the ``Twig_SimpleFilter`` class is deprecated and will be
75
- removed in Twig 3.x (use ``\Twig\TwigFilter`` instead). In Twig 2.x,
76
- ``Twig_SimpleFilter`` is just an alias for ``\Twig\TwigFilter``.
77
-
78
- Functions
79
- ---------
80
-
81
- * As of Twig 1.x, use ``\Twig\TwigFunction`` to add a function. The following
82
- classes and interfaces will be removed in 2.0:
83
-
84
- * ``Twig_FunctionInterface``
85
- * ``Twig_FunctionCallableInterface``
86
- * ``Twig_Function``
87
- * ``Twig_Function_Function``
88
- * ``Twig_Function_Method``
89
- * ``Twig_Function_Node``
90
-
91
- * As of Twig 2.x, the ``Twig_SimpleFunction`` class is deprecated and will be
92
- removed in Twig 3.x (use ``\Twig\TwigFunction`` instead). In Twig 2.x,
93
- ``Twig_SimpleFunction`` is just an alias for ``\Twig\TwigFunction``.
94
-
95
- Tests
96
- -----
97
-
98
- * As of Twig 1.x, use ``\Twig\TwigTest`` to add a test. The following classes
99
- and interfaces will be removed in 2.0:
100
-
101
- * ``Twig_TestInterface``
102
- * ``Twig_TestCallableInterface``
103
- * ``Twig_Test``
104
- * ``Twig_Test_Function``
105
- * ``Twig_Test_Method``
106
- * ``Twig_Test_Node``
107
-
108
- * As of Twig 2.x, the ``Twig_SimpleTest`` class is deprecated and will be
109
- removed in Twig 3.x (use ``\Twig\TwigTest`` instead). In Twig 2.x,
110
- ``Twig_SimpleTest`` is just an alias for ``\Twig\TwigTest``.
111
-
112
- * The ``sameas`` and ``divisibleby`` tests are deprecated in favor of ``same
113
- as`` and ``divisible by`` respectively.
114
-
115
- Tags
116
- ----
117
-
118
- * As of Twig 1.x, the ``raw`` tag is deprecated. You should use ``verbatim``
119
- instead.
120
-
121
- Nodes
122
- -----
123
-
124
- * As of Twig 1.x, ``Node::toXml()`` is deprecated and will be removed in Twig
125
- 2.0.
126
-
127
- * As of Twig 1.26, ``Node::$nodes`` should only contains ``\Twig\Node\Node``
128
- instances, storing a ``null`` value is deprecated and won't be possible in
129
- Twig 2.x.
130
-
131
- * As of Twig 1.27, the ``filename`` attribute on ``\Twig\Node\ModuleNode`` is
132
- deprecated. Use ``getName()`` instead.
133
-
134
- * As of Twig 1.27, the ``\Twig\Node\Node::getFilename()/\Twig\Node\Node::getLine()``
135
- methods are deprecated, use
136
- ``\Twig\Node\Node::getTemplateName()/\Twig\Node\Node::getTemplateLine()`` instead.
137
-
138
- Interfaces
139
- ----------
140
-
141
- * As of Twig 2.x, the following interfaces are deprecated and empty (they will
142
- be removed in Twig 3.0):
143
-
144
- * ``Twig_CompilerInterface`` (use ``\Twig\Compiler`` instead)
145
- * ``Twig_LexerInterface`` (use ``\Twig\Lexer`` instead)
146
- * ``Twig_NodeInterface`` (use ``\Twig\Node\Node`` instead)
147
- * ``Twig_ParserInterface`` (use ``\Twig\Parser`` instead)
148
- * ``\Twig\Loader\ExistsLoaderInterface`` (merged with ``\Twig\Loader\LoaderInterface``)
149
- * ``\Twig\Loader\SourceContextLoaderInterface`` (merged with ``\Twig\Loader\LoaderInterface``)
150
- * ``Twig_TemplateInterface`` (use ``\Twig\Template`` instead, and use
151
- those constants \Twig\Template::ANY_CALL, \Twig\Template::ARRAY_CALL,
152
- \Twig\Template::METHOD_CALL)
153
-
154
- Compiler
155
- --------
156
-
157
- * As of Twig 1.26, the ``\Twig\Compiler::getFilename()`` has been deprecated.
158
- You should not use it anyway as its values is not reliable.
159
-
160
- * As of Twig 1.27, the ``\Twig\Compiler::addIndentation()`` has been deprecated.
161
- Use ``\Twig\Compiler::write('')`` instead.
162
-
163
- Loaders
164
- -------
165
-
166
- * As of Twig 1.x, ``Twig_Loader_String`` is deprecated and will be removed in
167
- 2.0. You can render a string via ``\Twig\Environment::createTemplate()``.
168
-
169
- * As of Twig 1.27, ``\Twig\Loader\LoaderInterface::getSource()`` is deprecated.
170
- Implement ``\Twig\Loader\SourceContextLoaderInterface`` instead and use
171
- ``getSourceContext()``.
172
-
173
- Node Visitors
174
- -------------
175
-
176
- * Because of the removal of ``Twig_NodeInterface`` in 2.0, you need to extend
177
- ``\Twig\NodeVisitor\AbstractNodeVisitor`` instead of implementing ``\Twig\NodeVisitor\NodeVisitorInterface``
178
- directly to make your node visitors compatible with both Twig 1.x and 2.x.
179
-
180
- Globals
181
- -------
182
-
183
- * As of Twig 2.x, the ability to register a global variable after the runtime
184
- or the extensions have been initialized is not possible anymore (but
185
- changing the value of an already registered global is possible).
186
-
187
- * As of Twig 1.x, using the ``_self`` global variable to get access to the
188
- current ``\Twig\Template`` instance is deprecated; most usages only need the
189
- current template name, which will continue to work in Twig 2.0. In Twig 2.0,
190
- ``_self`` returns the current template name instead of the current
191
- ``\Twig\Template`` instance. If you are using ``{{ _self.templateName }}``,
192
- just replace it with ``{{ _self }}``.
193
-
194
- Miscellaneous
195
- -------------
196
-
197
- * As of Twig 1.x, ``\Twig\Environment::clearTemplateCache()``,
198
- ``\Twig\Environment::writeCacheFile()``,
199
- ``\Twig\Environment::clearCacheFiles()``,
200
- ``\Twig\Environment::getCacheFilename()``,
201
- ``\Twig\Environment::getTemplateClassPrefix()``,
202
- ``\Twig\Environment::getLexer()``, ``\Twig\Environment::getParser()``, and
203
- ``\Twig\Environment::getCompiler()`` are deprecated and will be removed in 2.0.
204
-
205
- * As of Twig 1.x, ``\Twig\Template::getEnvironment()`` and
206
- ``Twig_TemplateInterface::getEnvironment()`` are deprecated and will be
207
- removed in 2.0.
208
-
209
- * As of Twig 1.21, setting the environment option ``autoescape`` to ``true`` is
210
- deprecated and will be removed in 2.0. Use ``"html"`` instead.
211
-
212
- * As of Twig 1.27, ``\Twig\Error\Error::getTemplateFile()`` and
213
- ``\Twig\Error\Error::setTemplateFile()`` are deprecated. Use
214
- ``\Twig\Error\Error::getTemplateName()`` and ``\Twig\Error\Error::setTemplateName()``
215
- instead.
216
-
217
- * As of Twig 1.27, ``\Twig\Template::getSource()`` is deprecated. Use
218
- ``\Twig\Template::getSourceContext()`` instead.
219
-
220
- * As of Twig 1.27, ``\Twig\Parser::addHandler()`` and
221
- ``\Twig\Parser::addNodeVisitor()`` are deprecated and will be removed in 2.0.
222
-
223
- * As of Twig 1.29, some classes are marked as being final via the `@final`
224
- annotation. Those classes will be marked as final in 2.0.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/abs.rst DELETED
@@ -1,18 +0,0 @@
1
- ``abs``
2
- =======
3
-
4
- The ``abs`` filter returns the absolute value.
5
-
6
- .. code-block:: twig
7
-
8
- {# number = -5 #}
9
-
10
- {{ number|abs }}
11
-
12
- {# outputs 5 #}
13
-
14
- .. note::
15
-
16
- Internally, Twig uses the PHP `abs`_ function.
17
-
18
- .. _`abs`: https://secure.php.net/abs
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/batch.rst DELETED
@@ -1,51 +0,0 @@
1
- ``batch``
2
- =========
3
-
4
- .. versionadded:: 1.12.3
5
- The ``batch`` filter was added in Twig 1.12.3.
6
-
7
- The ``batch`` filter "batches" items by returning a list of lists with the
8
- given number of items. A second parameter can be provided and used to fill in
9
- missing items:
10
-
11
- .. code-block:: twig
12
-
13
- {% set items = ['a', 'b', 'c', 'd', 'e', 'f', 'g'] %}
14
-
15
- <table>
16
- {% for row in items|batch(3, 'No item') %}
17
- <tr>
18
- {% for column in row %}
19
- <td>{{ column }}</td>
20
- {% endfor %}
21
- </tr>
22
- {% endfor %}
23
- </table>
24
-
25
- The above example will be rendered as:
26
-
27
- .. code-block:: twig
28
-
29
- <table>
30
- <tr>
31
- <td>a</td>
32
- <td>b</td>
33
- <td>c</td>
34
- </tr>
35
- <tr>
36
- <td>d</td>
37
- <td>e</td>
38
- <td>f</td>
39
- </tr>
40
- <tr>
41
- <td>g</td>
42
- <td>No item</td>
43
- <td>No item</td>
44
- </tr>
45
- </table>
46
-
47
- Arguments
48
- ---------
49
-
50
- * ``size``: The size of the batch; fractional numbers will be rounded up
51
- * ``fill``: Used to fill in missing items
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/capitalize.rst DELETED
@@ -1,11 +0,0 @@
1
- ``capitalize``
2
- ==============
3
-
4
- The ``capitalize`` filter capitalizes a value. The first character will be
5
- uppercase, all others lowercase:
6
-
7
- .. code-block:: twig
8
-
9
- {{ 'my first car'|capitalize }}
10
-
11
- {# outputs 'My first car' #}
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/convert_encoding.rst DELETED
@@ -1,28 +0,0 @@
1
- ``convert_encoding``
2
- ====================
3
-
4
- .. versionadded:: 1.4
5
- The ``convert_encoding`` filter was added in Twig 1.4.
6
-
7
- The ``convert_encoding`` filter converts a string from one encoding to
8
- another. The first argument is the expected output charset and the second one
9
- is the input charset:
10
-
11
- .. code-block:: twig
12
-
13
- {{ data|convert_encoding('UTF-8', 'iso-2022-jp') }}
14
-
15
- .. note::
16
-
17
- This filter relies on the `iconv`_ or `mbstring`_ extension, so one of
18
- them must be installed. In case both are installed, `mbstring`_ is used by
19
- default (Twig before 1.8.1 uses `iconv`_ by default).
20
-
21
- Arguments
22
- ---------
23
-
24
- * ``to``: The output charset
25
- * ``from``: The input charset
26
-
27
- .. _`iconv`: https://secure.php.net/iconv
28
- .. _`mbstring`: https://secure.php.net/mbstring
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/date.rst DELETED
@@ -1,100 +0,0 @@
1
- ``date``
2
- ========
3
-
4
- .. versionadded:: 1.1
5
- The timezone support has been added in Twig 1.1.
6
-
7
- .. versionadded:: 1.5
8
- The default date format support has been added in Twig 1.5.
9
-
10
- .. versionadded:: 1.6.1
11
- The default timezone support has been added in Twig 1.6.1.
12
-
13
- .. versionadded:: 1.11.0
14
- The introduction of the false value for the timezone was introduced in Twig 1.11.0
15
-
16
- The ``date`` filter formats a date to a given format:
17
-
18
- .. code-block:: twig
19
-
20
- {{ post.published_at|date("m/d/Y") }}
21
-
22
- The format specifier is the same as supported by `date`_,
23
- except when the filtered data is of type `DateInterval`_, when the format must conform to
24
- `DateInterval::format`_ instead.
25
-
26
- The ``date`` filter accepts strings (it must be in a format supported by the
27
- `strtotime`_ function), `DateTime`_ instances, or `DateInterval`_ instances. For
28
- instance, to display the current date, filter the word "now":
29
-
30
- .. code-block:: twig
31
-
32
- {{ "now"|date("m/d/Y") }}
33
-
34
- To escape words and characters in the date format use ``\\`` in front of each
35
- character:
36
-
37
- .. code-block:: twig
38
-
39
- {{ post.published_at|date("F jS \\a\\t g:ia") }}
40
-
41
- If the value passed to the ``date`` filter is ``null``, it will return the
42
- current date by default. If an empty string is desired instead of the current
43
- date, use a ternary operator:
44
-
45
- .. code-block:: twig
46
-
47
- {{ post.published_at is empty ? "" : post.published_at|date("m/d/Y") }}
48
-
49
- If no format is provided, Twig will use the default one: ``F j, Y H:i``. This
50
- default can be changed by calling the ``setDateFormat()`` method on the
51
- ``core`` extension instance. The first argument is the default format for
52
- dates and the second one is the default format for date intervals:
53
-
54
- .. code-block:: php
55
-
56
- $twig = new \Twig\Environment($loader);
57
- $twig->getExtension('\Twig\Extension\CoreExtension')->setDateFormat('d/m/Y', '%d days');
58
-
59
- // before Twig 1.26
60
- $twig->getExtension('core')->setDateFormat('d/m/Y', '%d days');
61
-
62
- Timezone
63
- --------
64
-
65
- By default, the date is displayed by applying the default timezone (the one
66
- specified in php.ini or declared in Twig -- see below), but you can override
67
- it by explicitly specifying a timezone:
68
-
69
- .. code-block:: twig
70
-
71
- {{ post.published_at|date("m/d/Y", "Europe/Paris") }}
72
-
73
- If the date is already a DateTime object, and if you want to keep its current
74
- timezone, pass ``false`` as the timezone value:
75
-
76
- .. code-block:: twig
77
-
78
- {{ post.published_at|date("m/d/Y", false) }}
79
-
80
- The default timezone can also be set globally by calling ``setTimezone()``:
81
-
82
- .. code-block:: php
83
-
84
- $twig = new \Twig\Environment($loader);
85
- $twig->getExtension('\Twig\Extension\CoreExtension')->setTimezone('Europe/Paris');
86
-
87
- // before Twig 1.26
88
- $twig->getExtension('core')->setTimezone('Europe/Paris');
89
-
90
- Arguments
91
- ---------
92
-
93
- * ``format``: The date format
94
- * ``timezone``: The date timezone
95
-
96
- .. _`strtotime`: https://secure.php.net/strtotime
97
- .. _`DateTime`: https://secure.php.net/DateTime
98
- .. _`DateInterval`: https://secure.php.net/DateInterval
99
- .. _`date`: https://secure.php.net/date
100
- .. _`DateInterval::format`: https://secure.php.net/DateInterval.format
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/date_modify.rst DELETED
@@ -1,23 +0,0 @@
1
- ``date_modify``
2
- ===============
3
-
4
- .. versionadded:: 1.9.0
5
- The date_modify filter has been added in Twig 1.9.0.
6
-
7
- The ``date_modify`` filter modifies a date with a given modifier string:
8
-
9
- .. code-block:: twig
10
-
11
- {{ post.published_at|date_modify("+1 day")|date("m/d/Y") }}
12
-
13
- The ``date_modify`` filter accepts strings (it must be in a format supported
14
- by the `strtotime`_ function) or `DateTime`_ instances. You can combine
15
- it with the :doc:`date<date>` filter for formatting.
16
-
17
- Arguments
18
- ---------
19
-
20
- * ``modifier``: The modifier
21
-
22
- .. _`strtotime`: https://secure.php.net/strtotime
23
- .. _`DateTime`: https://secure.php.net/DateTime
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/default.rst DELETED
@@ -1,33 +0,0 @@
1
- ``default``
2
- ===========
3
-
4
- The ``default`` filter returns the passed default value if the value is
5
- undefined or empty, otherwise the value of the variable:
6
-
7
- .. code-block:: twig
8
-
9
- {{ var|default('var is not defined') }}
10
-
11
- {{ var.foo|default('foo item on var is not defined') }}
12
-
13
- {{ var['foo']|default('foo item on var is not defined') }}
14
-
15
- {{ ''|default('passed var is empty') }}
16
-
17
- When using the ``default`` filter on an expression that uses variables in some
18
- method calls, be sure to use the ``default`` filter whenever a variable can be
19
- undefined:
20
-
21
- .. code-block:: twig
22
-
23
- {{ var.method(foo|default('foo'))|default('foo') }}
24
-
25
- .. note::
26
-
27
- Read the documentation for the :doc:`defined<../tests/defined>` and
28
- :doc:`empty<../tests/empty>` tests to learn more about their semantics.
29
-
30
- Arguments
31
- ---------
32
-
33
- * ``default``: The default value
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/escape.rst DELETED
@@ -1,129 +0,0 @@
1
- ``escape``
2
- ==========
3
-
4
- .. versionadded:: 1.9.0
5
- The ``css``, ``url``, and ``html_attr`` strategies were added in Twig
6
- 1.9.0.
7
-
8
- .. versionadded:: 1.14.0
9
- The ability to define custom escapers was added in Twig 1.14.0.
10
-
11
- The ``escape`` filter escapes a string using strategies that depend on the
12
- context.
13
-
14
- By default, it uses the HTML escaping strategy:
15
-
16
- .. code-block:: html+twig
17
-
18
- <p>
19
- {{ user.username|escape }}
20
- </p>
21
-
22
- For convenience, the ``e`` filter is defined as an alias:
23
-
24
- .. code-block:: html+twig
25
-
26
- <p>
27
- {{ user.username|e }}
28
- </p>
29
-
30
- The ``escape`` filter can also be used in other contexts than HTML thanks to
31
- an optional argument which defines the escaping strategy to use:
32
-
33
- .. code-block:: twig
34
-
35
- {{ user.username|e }}
36
- {# is equivalent to #}
37
- {{ user.username|e('html') }}
38
-
39
- And here is how to escape variables included in JavaScript code:
40
-
41
- .. code-block:: twig
42
-
43
- {{ user.username|escape('js') }}
44
- {{ user.username|e('js') }}
45
-
46
- The ``escape`` filter supports the following escaping strategies for HTML
47
- documents:
48
-
49
- * ``html``: escapes a string for the **HTML body** context.
50
-
51
- * ``js``: escapes a string for the **JavaScript** context.
52
-
53
- * ``css``: escapes a string for the **CSS** context. CSS escaping can be
54
- applied to any string being inserted into CSS and escapes everything except
55
- alphanumerics.
56
-
57
- * ``url``: escapes a string for the **URI or parameter** contexts. This should
58
- not be used to escape an entire URI; only a subcomponent being inserted.
59
-
60
- * ``html_attr``: escapes a string for the **HTML attribute** context.
61
-
62
- Note that doing contextual escaping in HTML documents is hard and choosing the
63
- right escaping strategy depends on a lot of factors. Please, read related
64
- documentation like `the OWASP prevention cheat sheet
65
- <https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.md>`_
66
- to learn more about this topic.
67
-
68
- .. note::
69
-
70
- Internally, ``escape`` uses the PHP native `htmlspecialchars`_ function
71
- for the HTML escaping strategy.
72
-
73
- .. caution::
74
-
75
- When using automatic escaping, Twig tries to not double-escape a variable
76
- when the automatic escaping strategy is the same as the one applied by the
77
- escape filter; but that does not work when using a variable as the
78
- escaping strategy:
79
-
80
- .. code-block:: twig
81
-
82
- {% set strategy = 'html' %}
83
-
84
- {% autoescape 'html' %}
85
- {{ var|escape('html') }} {# won't be double-escaped #}
86
- {{ var|escape(strategy) }} {# will be double-escaped #}
87
- {% endautoescape %}
88
-
89
- When using a variable as the escaping strategy, you should disable
90
- automatic escaping:
91
-
92
- .. code-block:: twig
93
-
94
- {% set strategy = 'html' %}
95
-
96
- {% autoescape 'html' %}
97
- {{ var|escape(strategy)|raw }} {# won't be double-escaped #}
98
- {% endautoescape %}
99
-
100
- Custom Escapers
101
- ---------------
102
-
103
- You can define custom escapers by calling the ``setEscaper()`` method on the
104
- ``core`` extension instance. The first argument is the escaper name (to be
105
- used in the ``escape`` call) and the second one must be a valid PHP callable:
106
-
107
- .. code-block:: php
108
-
109
- $twig = new \Twig\Environment($loader);
110
- $twig->getExtension('\Twig\Extension\CoreExtension')->setEscaper('csv', 'csv_escaper');
111
-
112
- // before Twig 1.26
113
- $twig->getExtension('core')->setEscaper('csv', 'csv_escaper');
114
-
115
- When called by Twig, the callable receives the Twig environment instance, the
116
- string to escape, and the charset.
117
-
118
- .. note::
119
-
120
- Built-in escapers cannot be overridden mainly because they should be
121
- considered as the final implementation and also for better performance.
122
-
123
- Arguments
124
- ---------
125
-
126
- * ``strategy``: The escaping strategy
127
- * ``charset``: The string charset
128
-
129
- .. _`htmlspecialchars`: https://secure.php.net/htmlspecialchars
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/filter.rst DELETED
@@ -1,58 +0,0 @@
1
- ``filter``
2
- =========
3
-
4
- .. versionadded:: 1.41
5
- The ``filter`` filter was added in Twig 1.41 and 2.10.
6
-
7
- The ``filter`` filter filters elements of a sequence or a mapping using an arrow
8
- function. The arrow function receives the value of the sequence or mapping:
9
-
10
- .. code-block:: twig
11
-
12
- {% set sizes = [34, 36, 38, 40, 42] %}
13
-
14
- {{ sizes|filter(v => v > 38)|join(', ') }}
15
- {# output 40, 42 #}
16
-
17
- Combined with the ``for`` tag, it allows to filter the items to iterate over:
18
-
19
- .. code-block:: twig
20
-
21
- {% for v in sizes|filter(v => v > 38) -%}
22
- {{ v }}
23
- {% endfor %}
24
- {# output 40 42 #}
25
-
26
- It also works with mappings:
27
-
28
- .. code-block:: twig
29
-
30
- {% set sizes = {
31
- xs: 34,
32
- s: 36,
33
- m: 38,
34
- l: 40,
35
- xl: 42,
36
- } %}
37
-
38
- {% for k, v in sizes|filter(v => v > 38) -%}
39
- {{ k }} = {{ v }}
40
- {% endfor %}
41
- {# output l = 40 xl = 42 #}
42
-
43
- The arrow function also receives the key as a second argument:
44
-
45
- .. code-block:: twig
46
-
47
- {% for k, v in sizes|filter((v, k) => v > 38 and k != "xl") -%}
48
- {{ k }} = {{ v }}
49
- {% endfor %}
50
- {# output l = 40 #}
51
-
52
- Note that the arrow function has access to the current context.
53
-
54
- Arguments
55
- ---------
56
-
57
- * ``array``: The sequence or mapping
58
- * ``arrow``: The arrow function
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/first.rst DELETED
@@ -1,25 +0,0 @@
1
- ``first``
2
- =========
3
-
4
- .. versionadded:: 1.12.2
5
- The ``first`` filter was added in Twig 1.12.2.
6
-
7
- The ``first`` filter returns the first "element" of a sequence, a mapping, or
8
- a string:
9
-
10
- .. code-block:: twig
11
-
12
- {{ [1, 2, 3, 4]|first }}
13
- {# outputs 1 #}
14
-
15
- {{ { a: 1, b: 2, c: 3, d: 4 }|first }}
16
- {# outputs 1 #}
17
-
18
- {{ '1234'|first }}
19
- {# outputs 1 #}
20
-
21
- .. note::
22
-
23
- It also works with objects implementing the `Traversable`_ interface.
24
-
25
- .. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/format.rst DELETED
@@ -1,16 +0,0 @@
1
- ``format``
2
- ==========
3
-
4
- The ``format`` filter formats a given string by replacing the placeholders
5
- (placeholders follows the `sprintf`_ notation):
6
-
7
- .. code-block:: twig
8
-
9
- {{ "I like %s and %s."|format(foo, "bar") }}
10
-
11
- {# outputs I like foo and bar
12
- if the foo parameter equals to the foo string. #}
13
-
14
- .. _`sprintf`: https://secure.php.net/sprintf
15
-
16
- .. seealso:: :doc:`replace<replace>`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/index.rst DELETED
@@ -1,41 +0,0 @@
1
- Filters
2
- =======
3
-
4
- .. toctree::
5
- :maxdepth: 1
6
-
7
- abs
8
- batch
9
- capitalize
10
- convert_encoding
11
- date
12
- date_modify
13
- default
14
- escape
15
- filter
16
- first
17
- format
18
- join
19
- json_encode
20
- keys
21
- last
22
- length
23
- lower
24
- map
25
- merge
26
- nl2br
27
- number_format
28
- raw
29
- reduce
30
- replace
31
- reverse
32
- round
33
- slice
34
- sort
35
- spaceless
36
- split
37
- striptags
38
- title
39
- trim
40
- upper
41
- url_encode
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/join.rst DELETED
@@ -1,35 +0,0 @@
1
- ``join``
2
- ========
3
-
4
- .. versionadded:: 1.37 and 2.6.1
5
- The ``and`` argument was added in Twig 1.37 and 2.6.1.
6
-
7
- The ``join`` filter returns a string which is the concatenation of the items
8
- of a sequence:
9
-
10
- .. code-block:: twig
11
-
12
- {{ [1, 2, 3]|join }}
13
- {# returns 123 #}
14
-
15
- The separator between elements is an empty string per default, but you can
16
- define it with the optional first parameter:
17
-
18
- .. code-block:: twig
19
-
20
- {{ [1, 2, 3]|join('|') }}
21
- {# outputs 1|2|3 #}
22
-
23
- A second parameter can also be provided that will be the separator used between
24
- the last two items of the sequence:
25
-
26
- .. code-block:: twig
27
-
28
- {{ [1, 2, 3]|join(', ', ' and ') }}
29
- {# outputs 1, 2 and 3 #}
30
-
31
- Arguments
32
- ---------
33
-
34
- * ``glue``: The separator
35
- * ``and``: The separator for the last pair of input items
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/json_encode.rst DELETED
@@ -1,23 +0,0 @@
1
- ``json_encode``
2
- ===============
3
-
4
- The ``json_encode`` filter returns the JSON representation of a value:
5
-
6
- .. code-block:: twig
7
-
8
- {{ data|json_encode() }}
9
-
10
- .. note::
11
-
12
- Internally, Twig uses the PHP `json_encode`_ function.
13
-
14
- Arguments
15
- ---------
16
-
17
- * ``options``: A bitmask of `json_encode options`_: ``{{
18
- data|json_encode(constant('JSON_PRETTY_PRINT')) }}``.
19
- Combine constants using :ref:`bitwise operators<template_logic>`:
20
- ``{{ data|json_encode(constant('JSON_PRETTY_PRINT') b-or constant('JSON_HEX_QUOT')) }}``
21
-
22
- .. _`json_encode`: https://secure.php.net/json_encode
23
- .. _`json_encode options`: https://secure.php.net/manual/en/json.constants.php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/keys.rst DELETED
@@ -1,11 +0,0 @@
1
- ``keys``
2
- ========
3
-
4
- The ``keys`` filter returns the keys of an array. It is useful when you want to
5
- iterate over the keys of an array:
6
-
7
- .. code-block:: twig
8
-
9
- {% for key in array|keys %}
10
- ...
11
- {% endfor %}
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/last.rst DELETED
@@ -1,25 +0,0 @@
1
- ``last``
2
- ========
3
-
4
- .. versionadded:: 1.12.2
5
- The ``last`` filter was added in Twig 1.12.2.
6
-
7
- The ``last`` filter returns the last "element" of a sequence, a mapping, or
8
- a string:
9
-
10
- .. code-block:: twig
11
-
12
- {{ [1, 2, 3, 4]|last }}
13
- {# outputs 4 #}
14
-
15
- {{ { a: 1, b: 2, c: 3, d: 4 }|last }}
16
- {# outputs 4 #}
17
-
18
- {{ '1234'|last }}
19
- {# outputs 4 #}
20
-
21
- .. note::
22
-
23
- It also works with objects implementing the `Traversable`_ interface.
24
-
25
- .. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/length.rst DELETED
@@ -1,23 +0,0 @@
1
- ``length``
2
- ==========
3
-
4
- .. versionadded:: 1.33
5
-
6
- Support for the ``__toString()`` magic method has been added in Twig 1.33.
7
-
8
- The ``length`` filter returns the number of items of a sequence or mapping, or
9
- the length of a string.
10
-
11
- For objects that implement the ``Countable`` interface, ``length`` will use the
12
- return value of the ``count()`` method.
13
-
14
- For objects that implement the ``__toString()`` magic method (and not ``Countable``),
15
- it will return the length of the string provided by that method.
16
-
17
- For objects that implement the ``IteratorAggregate`` interface, ``length`` will use the return value of the ``iterator_count()`` method.
18
-
19
- .. code-block:: twig
20
-
21
- {% if users|length > 10 %}
22
- ...
23
- {% endif %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/lower.rst DELETED
@@ -1,10 +0,0 @@
1
- ``lower``
2
- =========
3
-
4
- The ``lower`` filter converts a value to lowercase:
5
-
6
- .. code-block:: twig
7
-
8
- {{ 'WELCOME'|lower }}
9
-
10
- {# outputs 'welcome' #}
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/map.rst DELETED
@@ -1,38 +0,0 @@
1
- ``map``
2
- =======
3
-
4
- .. versionadded:: 1.41
5
- The ``map`` filter was added in Twig 1.41 and 2.10.
6
-
7
- The ``map`` filter applies an arrow function to the elements of a sequence or a
8
- mapping. The arrow function receives the value of the sequence or mapping:
9
-
10
- .. code-block:: twig
11
-
12
- {% set people = [
13
- {first: "Bob", last: "Smith"},
14
- {first: "Alice", last: "Dupond"},
15
- ] %}
16
-
17
- {{ people|map(p => "#{p.first} #{p.last}")|join(', ') }}
18
- {# outputs Bob Smith, Alice Dupond #}
19
-
20
- The arrow function also receives the key as a second argument:
21
-
22
- .. code-block:: twig
23
-
24
- {% set people = {
25
- "Bob": "Smith",
26
- "Alice": "Dupond",
27
- } %}
28
-
29
- {{ people|map((last, first) => "#{first} #{last}")|join(', ') }}
30
- {# outputs Bob Smith, Alice Dupond #}
31
-
32
- Note that the arrow function has access to the current context.
33
-
34
- Arguments
35
- ---------
36
-
37
- * ``array``: The sequence or mapping
38
- * ``arrow``: The arrow function
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/merge.rst DELETED
@@ -1,48 +0,0 @@
1
- ``merge``
2
- =========
3
-
4
- The ``merge`` filter merges an array with another array:
5
-
6
- .. code-block:: twig
7
-
8
- {% set values = [1, 2] %}
9
-
10
- {% set values = values|merge(['apple', 'orange']) %}
11
-
12
- {# values now contains [1, 2, 'apple', 'orange'] #}
13
-
14
- New values are added at the end of the existing ones.
15
-
16
- The ``merge`` filter also works on hashes:
17
-
18
- .. code-block:: twig
19
-
20
- {% set items = { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'unknown' } %}
21
-
22
- {% set items = items|merge({ 'peugeot': 'car', 'renault': 'car' }) %}
23
-
24
- {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car', 'renault': 'car' } #}
25
-
26
- For hashes, the merging process occurs on the keys: if the key does not
27
- already exist, it is added but if the key already exists, its value is
28
- overridden.
29
-
30
- .. tip::
31
-
32
- If you want to ensure that some values are defined in an array (by given
33
- default values), reverse the two elements in the call:
34
-
35
- .. code-block:: twig
36
-
37
- {% set items = { 'apple': 'fruit', 'orange': 'fruit' } %}
38
-
39
- {% set items = { 'apple': 'unknown' }|merge(items) %}
40
-
41
- {# items now contains { 'apple': 'fruit', 'orange': 'fruit' } #}
42
-
43
- .. note::
44
-
45
- Internally, Twig uses the PHP `array_merge`_ function. It supports
46
- Traversable objects by transforming those to arrays.
47
-
48
- .. _`array_merge`: https://secure.php.net/array_merge
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/nl2br.rst DELETED
@@ -1,22 +0,0 @@
1
- ``nl2br``
2
- =========
3
-
4
- .. versionadded:: 1.5
5
- The ``nl2br`` filter was added in Twig 1.5.
6
-
7
- The ``nl2br`` filter inserts HTML line breaks before all newlines in a string:
8
-
9
- .. code-block:: twig
10
-
11
- {{ "I like Twig.\nYou will like it too."|nl2br }}
12
- {# outputs
13
-
14
- I like Twig.<br />
15
- You will like it too.
16
-
17
- #}
18
-
19
- .. note::
20
-
21
- The ``nl2br`` filter pre-escapes the input before applying the
22
- transformation.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/number_format.rst DELETED
@@ -1,56 +0,0 @@
1
- ``number_format``
2
- =================
3
-
4
- .. versionadded:: 1.5
5
- The ``number_format`` filter was added in Twig 1.5
6
-
7
- The ``number_format`` filter formats numbers. It is a wrapper around PHP's
8
- `number_format`_ function:
9
-
10
- .. code-block:: twig
11
-
12
- {{ 200.35|number_format }}
13
-
14
- You can control the number of decimal places, decimal point, and thousands
15
- separator using the additional arguments:
16
-
17
- .. code-block:: twig
18
-
19
- {{ 9800.333|number_format(2, '.', ',') }}
20
-
21
- To format negative numbers, wrap the number with parentheses (needed because of
22
- Twig's :ref:`precedence of operators <twig-expressions>`:
23
-
24
- .. code-block:: twig
25
-
26
- {{ -9800.333|number_format(2, '.', ',') }} {# outputs : -9 #}
27
- {{ (-9800.333)|number_format(2, '.', ',') }} {# outputs : -9,800.33 #}
28
-
29
- If no formatting options are provided then Twig will use the default formatting
30
- options of:
31
-
32
- * 0 decimal places.
33
- * ``.`` as the decimal point.
34
- * ``,`` as the thousands separator.
35
-
36
- These defaults can be changed through the core extension:
37
-
38
- .. code-block:: php
39
-
40
- $twig = new \Twig\Environment($loader);
41
- $twig->getExtension('\Twig\Extension\CoreExtension')->setNumberFormat(3, '.', ',');
42
-
43
- // before Twig 1.26
44
- $twig->getExtension('core')->setNumberFormat(3, '.', ',');
45
-
46
- The defaults set for ``number_format`` can be over-ridden upon each call using the
47
- additional parameters.
48
-
49
- Arguments
50
- ---------
51
-
52
- * ``decimal``: The number of decimal points to display
53
- * ``decimal_point``: The character(s) to use for the decimal point
54
- * ``thousand_sep``: The character(s) to use for the thousands separator
55
-
56
- .. _`number_format`: https://secure.php.net/number_format
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/raw.rst DELETED
@@ -1,38 +0,0 @@
1
- ``raw``
2
- =======
3
-
4
- The ``raw`` filter marks the value as being "safe", which means that in an
5
- environment with automatic escaping enabled this variable will not be escaped
6
- if ``raw`` is the last filter applied to it:
7
-
8
- .. code-block:: twig
9
-
10
- {% autoescape %}
11
- {{ var|raw }} {# var won't be escaped #}
12
- {% endautoescape %}
13
-
14
- .. note::
15
-
16
- **This note only applies to Twig before versions 1.39 and 2.8**.
17
-
18
- Be careful when using the ``raw`` filter inside expressions:
19
-
20
- .. code-block:: twig
21
-
22
- {% autoescape %}
23
- {% set hello = '<strong>Hello</strong>' %}
24
- {% set hola = '<strong>Hola</strong>' %}
25
-
26
- {{ false ? '<strong>Hola</strong>' : hello|raw }}
27
- does not render the same as
28
- {{ false ? hola : hello|raw }}
29
- but renders the same as
30
- {{ (false ? hola : hello)|raw }}
31
- {% endautoescape %}
32
-
33
- The first ternary statement is not escaped: ``hello`` is marked as being
34
- safe and Twig does not escape static values (see
35
- :doc:`escape<../tags/autoescape>`). In the second ternary statement, even
36
- if ``hello`` is marked as safe, ``hola`` remains unsafe and so is the whole
37
- expression. The third ternary statement is marked as safe and the result is
38
- not escaped.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/reduce.rst DELETED
@@ -1,33 +0,0 @@
1
- ``reduce``
2
- =========
3
-
4
- .. versionadded:: 1.41
5
- The ``reduce`` filter was added in Twig 1.41 and 2.10.
6
-
7
- The ``reduce`` filter iteratively reduces a sequence or a mapping to a single
8
- value using an arrow function, so as to reduce it to a single value. The arrow
9
- function receives the return value of the previous iteration and the current
10
- value of the sequence or mapping:
11
-
12
- .. code-block:: twig
13
-
14
- {% set numbers = [1, 2, 3] %}
15
-
16
- {{ numbers|reduce((carry, v) => carry + v) }}
17
- {# output 6 #}
18
-
19
- The ``reduce`` filter takes an ``initial`` value as a second argument:
20
-
21
- .. code-block:: twig
22
-
23
- {{ numbers|reduce((carry, v) => carry + v, 10) }}
24
- {# output 16 #}
25
-
26
- Note that the arrow function has access to the current context.
27
-
28
- Arguments
29
- ---------
30
-
31
- * ``array``: The sequence or mapping
32
- * ``arrow``: The arrow function
33
- * ``initial``: The initial value
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/replace.rst DELETED
@@ -1,25 +0,0 @@
1
- ``replace``
2
- ===========
3
-
4
- The ``replace`` filter formats a given string by replacing the placeholders
5
- (placeholders are free-form):
6
-
7
- .. code-block:: twig
8
-
9
- {{ "I like %this% and %that%."|replace({'%this%': foo, '%that%': "bar"}) }}
10
-
11
- {# outputs I like foo and bar
12
- if the foo parameter equals to the foo string. #}
13
-
14
- {# using % as a delimiter is purely conventional and optional #}
15
-
16
- {{ "I like this and --that--."|replace({'this': foo, '--that--': "bar"}) }}
17
-
18
- {# outputs I like foo and bar #}
19
-
20
- Arguments
21
- ---------
22
-
23
- * ``from``: The placeholder values
24
-
25
- .. seealso:: :doc:`format<format>`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/reverse.rst DELETED
@@ -1,47 +0,0 @@
1
- ``reverse``
2
- ===========
3
-
4
- .. versionadded:: 1.6
5
- Support for strings has been added in Twig 1.6.
6
-
7
- The ``reverse`` filter reverses a sequence, a mapping, or a string:
8
-
9
- .. code-block:: twig
10
-
11
- {% for user in users|reverse %}
12
- ...
13
- {% endfor %}
14
-
15
- {{ '1234'|reverse }}
16
-
17
- {# outputs 4321 #}
18
-
19
- .. tip::
20
-
21
- For sequences and mappings, numeric keys are not preserved. To reverse
22
- them as well, pass ``true`` as an argument to the ``reverse`` filter:
23
-
24
- .. code-block:: twig
25
-
26
- {% for key, value in {1: "a", 2: "b", 3: "c"}|reverse %}
27
- {{ key }}: {{ value }}
28
- {%- endfor %}
29
-
30
- {# output: 0: c 1: b 2: a #}
31
-
32
- {% for key, value in {1: "a", 2: "b", 3: "c"}|reverse(true) %}
33
- {{ key }}: {{ value }}
34
- {%- endfor %}
35
-
36
- {# output: 3: c 2: b 1: a #}
37
-
38
- .. note::
39
-
40
- It also works with objects implementing the `Traversable`_ interface.
41
-
42
- Arguments
43
- ---------
44
-
45
- * ``preserve_keys``: Preserve keys when reversing a mapping or a sequence.
46
-
47
- .. _`Traversable`: https://secure.php.net/Traversable
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/round.rst DELETED
@@ -1,37 +0,0 @@
1
- ``round``
2
- =========
3
-
4
- .. versionadded:: 1.15.0
5
- The ``round`` filter was added in Twig 1.15.0.
6
-
7
- The ``round`` filter rounds a number to a given precision:
8
-
9
- .. code-block:: twig
10
-
11
- {{ 42.55|round }}
12
- {# outputs 43 #}
13
-
14
- {{ 42.55|round(1, 'floor') }}
15
- {# outputs 42.5 #}
16
-
17
- The ``round`` filter takes two optional arguments; the first one specifies the
18
- precision (default is ``0``) and the second the rounding method (default is
19
- ``common``):
20
-
21
- * ``common`` rounds either up or down (rounds the value up to precision decimal
22
- places away from zero, when it is half way there -- making 1.5 into 2 and
23
- -1.5 into -2);
24
-
25
- * ``ceil`` always rounds up;
26
-
27
- * ``floor`` always rounds down.
28
-
29
- .. note::
30
-
31
- The ``//`` operator is equivalent to ``|round(0, 'floor')``.
32
-
33
- Arguments
34
- ---------
35
-
36
- * ``precision``: The rounding precision
37
- * ``method``: The rounding method
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/slice.rst DELETED
@@ -1,71 +0,0 @@
1
- ``slice``
2
- ===========
3
-
4
- .. versionadded:: 1.6
5
- The ``slice`` filter was added in Twig 1.6.
6
-
7
- The ``slice`` filter extracts a slice of a sequence, a mapping, or a string:
8
-
9
- .. code-block:: twig
10
-
11
- {% for i in [1, 2, 3, 4, 5]|slice(1, 2) %}
12
- {# will iterate over 2 and 3 #}
13
- {% endfor %}
14
-
15
- {{ '12345'|slice(1, 2) }}
16
-
17
- {# outputs 23 #}
18
-
19
- You can use any valid expression for both the start and the length:
20
-
21
- .. code-block:: twig
22
-
23
- {% for i in [1, 2, 3, 4, 5]|slice(start, length) %}
24
- {# ... #}
25
- {% endfor %}
26
-
27
- As syntactic sugar, you can also use the ``[]`` notation:
28
-
29
- .. code-block:: twig
30
-
31
- {% for i in [1, 2, 3, 4, 5][start:length] %}
32
- {# ... #}
33
- {% endfor %}
34
-
35
- {{ '12345'[1:2] }} {# will display "23" #}
36
-
37
- {# you can omit the first argument -- which is the same as 0 #}
38
- {{ '12345'[:2] }} {# will display "12" #}
39
-
40
- {# you can omit the last argument -- which will select everything till the end #}
41
- {{ '12345'[2:] }} {# will display "345" #}
42
-
43
- The ``slice`` filter works as the `array_slice`_ PHP function for arrays and
44
- `mb_substr`_ for strings with a fallback to `substr`_.
45
-
46
- If the start is non-negative, the sequence will start at that start in the
47
- variable. If start is negative, the sequence will start that far from the end
48
- of the variable.
49
-
50
- If length is given and is positive, then the sequence will have up to that
51
- many elements in it. If the variable is shorter than the length, then only the
52
- available variable elements will be present. If length is given and is
53
- negative then the sequence will stop that many elements from the end of the
54
- variable. If it is omitted, then the sequence will have everything from offset
55
- up until the end of the variable.
56
-
57
- .. note::
58
-
59
- It also works with objects implementing the `Traversable`_ interface.
60
-
61
- Arguments
62
- ---------
63
-
64
- * ``start``: The start of the slice
65
- * ``length``: The size of the slice
66
- * ``preserve_keys``: Whether to preserve key or not (when the input is an array)
67
-
68
- .. _`Traversable`: https://secure.php.net/manual/en/class.traversable.php
69
- .. _`array_slice`: https://secure.php.net/array_slice
70
- .. _`mb_substr` : https://secure.php.net/mb-substr
71
- .. _`substr`: https://secure.php.net/substr
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/sort.rst DELETED
@@ -1,18 +0,0 @@
1
- ``sort``
2
- ========
3
-
4
- The ``sort`` filter sorts an array:
5
-
6
- .. code-block:: twig
7
-
8
- {% for user in users|sort %}
9
- ...
10
- {% endfor %}
11
-
12
- .. note::
13
-
14
- Internally, Twig uses the PHP `asort`_ function to maintain index
15
- association. It supports Traversable objects by transforming
16
- those to arrays.
17
-
18
- .. _`asort`: https://secure.php.net/asort
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/spaceless.rst DELETED
@@ -1,65 +0,0 @@
1
- ``spaceless``
2
- =============
3
-
4
- .. versionadded:: 1.38
5
-
6
- The ``spaceless`` filter was added in Twig 1.38.
7
-
8
- Use the ``spaceless`` filter to remove whitespace *between HTML tags*, not
9
- whitespace within HTML tags or whitespace in plain text:
10
-
11
- .. code-block:: twig
12
-
13
- {{
14
- "<div>
15
- <strong>foo</strong>
16
- </div>
17
- "|spaceless }}
18
-
19
- {# output will be <div><strong>foo</strong></div> #}
20
-
21
- You can combine ``spaceless`` with the ``apply`` tag to apply the transformation
22
- on large amounts of HTML:
23
-
24
- .. code-block:: twig
25
-
26
- {% apply spaceless %}
27
- <div>
28
- <strong>foo</strong>
29
- </div>
30
- {% endapply %}
31
-
32
- {# output will be <div><strong>foo</strong></div> #}
33
-
34
- .. note::
35
-
36
- The ``apply`` tag was introduced in Twig 1.40; use the ``filter`` tag with
37
- previous versions.
38
-
39
- This tag is not meant to "optimize" the size of the generated HTML content but
40
- merely to avoid extra whitespace between HTML tags to avoid browser rendering
41
- quirks under some circumstances.
42
-
43
- .. caution::
44
-
45
- As the filter uses a regular expression behind the scenes, its performance
46
- is directly related to the text size you are working on (remember that
47
- filters are executed at runtime).
48
-
49
- .. tip::
50
-
51
- If you want to optimize the size of the generated HTML content, gzip
52
- compress the output instead.
53
-
54
- .. tip::
55
-
56
- If you want to create a tag that actually removes all extra whitespace in
57
- an HTML string, be warned that this is not as easy as it seems to be
58
- (think of ``textarea`` or ``pre`` tags for instance). Using a third-party
59
- library like Tidy is probably a better idea.
60
-
61
- .. tip::
62
-
63
- For more information on whitespace control, read the
64
- :ref:`dedicated section <templates-whitespace-control>` of the documentation and learn how
65
- you can also use the whitespace control modifier on your tags.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/split.rst DELETED
@@ -1,53 +0,0 @@
1
- ``split``
2
- =========
3
-
4
- .. versionadded:: 1.10.3
5
- The ``split`` filter was added in Twig 1.10.3.
6
-
7
- The ``split`` filter splits a string by the given delimiter and returns a list
8
- of strings:
9
-
10
- .. code-block:: twig
11
-
12
- {% set foo = "one,two,three"|split(',') %}
13
- {# foo contains ['one', 'two', 'three'] #}
14
-
15
- You can also pass a ``limit`` argument:
16
-
17
- * If ``limit`` is positive, the returned array will contain a maximum of
18
- limit elements with the last element containing the rest of string;
19
-
20
- * If ``limit`` is negative, all components except the last -limit are
21
- returned;
22
-
23
- * If ``limit`` is zero, then this is treated as 1.
24
-
25
- .. code-block:: twig
26
-
27
- {% set foo = "one,two,three,four,five"|split(',', 3) %}
28
- {# foo contains ['one', 'two', 'three,four,five'] #}
29
-
30
- If the ``delimiter`` is an empty string, then value will be split by equal
31
- chunks. Length is set by the ``limit`` argument (one character by default).
32
-
33
- .. code-block:: twig
34
-
35
- {% set foo = "123"|split('') %}
36
- {# foo contains ['1', '2', '3'] #}
37
-
38
- {% set bar = "aabbcc"|split('', 2) %}
39
- {# bar contains ['aa', 'bb', 'cc'] #}
40
-
41
- .. note::
42
-
43
- Internally, Twig uses the PHP `explode`_ or `str_split`_ (if delimiter is
44
- empty) functions for string splitting.
45
-
46
- Arguments
47
- ---------
48
-
49
- * ``delimiter``: The delimiter
50
- * ``limit``: The limit argument
51
-
52
- .. _`explode`: https://secure.php.net/explode
53
- .. _`str_split`: https://secure.php.net/str_split
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/striptags.rst DELETED
@@ -1,29 +0,0 @@
1
- ``striptags``
2
- =============
3
-
4
- The ``striptags`` filter strips SGML/XML tags and replace adjacent whitespace
5
- by one space:
6
-
7
- .. code-block:: twig
8
-
9
- {{ some_html|striptags }}
10
-
11
- You can also provide tags which should not be stripped:
12
-
13
- .. code-block:: twig
14
-
15
- {{ some_html|striptags('<br><p>') }}
16
-
17
- In this example, the ``<br/>``, ``<br>``, ``<p>``, and ``</p>`` tags won't be
18
- removed from the string.
19
-
20
- .. note::
21
-
22
- Internally, Twig uses the PHP `strip_tags`_ function.
23
-
24
- Arguments
25
- ---------
26
-
27
- * ``allowable_tags``: Tags which should not be stripped
28
-
29
- .. _`strip_tags`: https://secure.php.net/strip_tags
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/title.rst DELETED
@@ -1,11 +0,0 @@
1
- ``title``
2
- =========
3
-
4
- The ``title`` filter returns a titlecased version of the value. Words will
5
- start with uppercase letters, all remaining characters are lowercase:
6
-
7
- .. code-block:: twig
8
-
9
- {{ 'my first car'|title }}
10
-
11
- {# outputs 'My First Car' #}
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/trim.rst DELETED
@@ -1,45 +0,0 @@
1
- ``trim``
2
- ========
3
-
4
- .. versionadded:: 1.32
5
- The ``side`` argument was added in Twig 1.32.
6
-
7
- .. versionadded:: 1.6.2
8
- The ``trim`` filter was added in Twig 1.6.2.
9
-
10
- The ``trim`` filter strips whitespace (or other characters) from the beginning
11
- and end of a string:
12
-
13
- .. code-block:: twig
14
-
15
- {{ ' I like Twig. '|trim }}
16
-
17
- {# outputs 'I like Twig.' #}
18
-
19
- {{ ' I like Twig.'|trim('.') }}
20
-
21
- {# outputs ' I like Twig' #}
22
-
23
- {{ ' I like Twig. '|trim(side='left') }}
24
-
25
- {# outputs 'I like Twig. ' #}
26
-
27
- {{ ' I like Twig. '|trim(' ', 'right') }}
28
-
29
- {# outputs ' I like Twig.' #}
30
-
31
- .. note::
32
-
33
- Internally, Twig uses the PHP `trim`_, `ltrim`_, and `rtrim`_ functions.
34
-
35
- Arguments
36
- ---------
37
-
38
- * ``character_mask``: The characters to strip
39
-
40
- * ``side``: The default is to strip from the left and the right (`both`) sides, but `left`
41
- and `right` will strip from either the left side or right side only
42
-
43
- .. _`trim`: https://secure.php.net/trim
44
- .. _`ltrim`: https://secure.php.net/ltrim
45
- .. _`rtrim`: https://secure.php.net/rtrim
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/upper.rst DELETED
@@ -1,10 +0,0 @@
1
- ``upper``
2
- =========
3
-
4
- The ``upper`` filter converts a value to uppercase:
5
-
6
- .. code-block:: twig
7
-
8
- {{ 'welcome'|upper }}
9
-
10
- {# outputs 'WELCOME' #}
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/filters/url_encode.rst DELETED
@@ -1,34 +0,0 @@
1
- ``url_encode``
2
- ==============
3
-
4
- .. versionadded:: 1.12.3
5
- Support for encoding an array as query string was added in Twig 1.12.3.
6
-
7
- .. versionadded:: 1.16.0
8
- The ``raw`` argument was removed in Twig 1.16.0. Twig now always encodes
9
- according to RFC 3986.
10
-
11
- The ``url_encode`` filter percent encodes a given string as URL segment
12
- or an array as query string:
13
-
14
- .. code-block:: twig
15
-
16
- {{ "path-seg*ment"|url_encode }}
17
- {# outputs "path-seg%2Ament" #}
18
-
19
- {{ "string with spaces"|url_encode }}
20
- {# outputs "string%20with%20spaces" #}
21
-
22
- {{ {'param': 'value', 'foo': 'bar'}|url_encode }}
23
- {# outputs "param=value&foo=bar" #}
24
-
25
- .. note::
26
-
27
- Internally, Twig uses the PHP `urlencode`_ (or `rawurlencode`_ if you pass
28
- ``true`` as the first parameter) or the `http_build_query`_ function. Note
29
- that as of Twig 1.16.0, ``urlencode`` **always** uses ``rawurlencode`` (the
30
- ``raw`` argument was removed.)
31
-
32
- .. _`urlencode`: https://secure.php.net/urlencode
33
- .. _`rawurlencode`: https://secure.php.net/rawurlencode
34
- .. _`http_build_query`: https://secure.php.net/http_build_query
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/functions/attribute.rst DELETED
@@ -1,26 +0,0 @@
1
- ``attribute``
2
- =============
3
-
4
- .. versionadded:: 1.2
5
- The ``attribute`` function was added in Twig 1.2.
6
-
7
- The ``attribute`` function can be used to access a "dynamic" attribute of a
8
- variable:
9
-
10
- .. code-block:: twig
11
-
12
- {{ attribute(object, method) }}
13
- {{ attribute(object, method, arguments) }}
14
- {{ attribute(array, item) }}
15
-
16
- In addition, the ``defined`` test can check for the existence of a dynamic
17
- attribute:
18
-
19
- .. code-block:: twig
20
-
21
- {{ attribute(object, method) is defined ? 'Method exists' : 'Method does not exist' }}
22
-
23
- .. note::
24
-
25
- The resolution algorithm is the same as the one used for the ``.``
26
- notation, except that the item can be any valid expression.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/functions/block.rst DELETED
@@ -1,41 +0,0 @@
1
- ``block``
2
- =========
3
-
4
- .. versionadded: 1.28
5
- Using ``block`` with the ``defined`` test was added in Twig 1.28.
6
-
7
- .. versionadded: 1.28
8
- Support for the template argument was added in Twig 1.28.
9
-
10
- When a template uses inheritance and if you want to print a block multiple
11
- times, use the ``block`` function:
12
-
13
- .. code-block:: twig
14
-
15
- <title>{% block title %}{% endblock %}</title>
16
-
17
- <h1>{{ block('title') }}</h1>
18
-
19
- {% block body %}{% endblock %}
20
-
21
- The ``block`` function can also be used to display one block from another
22
- template:
23
-
24
- .. code-block:: twig
25
-
26
- {{ block("title", "common_blocks.twig") }}
27
-
28
- Use the ``defined`` test to check if a block exists in the context of the
29
- current template:
30
-
31
- .. code-block:: twig
32
-
33
- {% if block("footer") is defined %}
34
- ...
35
- {% endif %}
36
-
37
- {% if block("footer", "common_blocks.twig") is defined %}
38
- ...
39
- {% endif %}
40
-
41
- .. seealso:: :doc:`extends<../tags/extends>`, :doc:`parent<../functions/parent>`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/functions/constant.rst DELETED
@@ -1,29 +0,0 @@
1
- ``constant``
2
- ============
3
-
4
- .. versionadded: 1.12.1
5
- constant now accepts object instances as the second argument.
6
-
7
- .. versionadded: 1.28
8
- Using ``constant`` with the ``defined`` test was added in Twig 1.28.
9
-
10
- ``constant`` returns the constant value for a given string:
11
-
12
- .. code-block:: twig
13
-
14
- {{ some_date|date(constant('DATE_W3C')) }}
15
- {{ constant('Namespace\\Classname::CONSTANT_NAME') }}
16
-
17
- As of 1.12.1 you can read constants from object instances as well:
18
-
19
- .. code-block:: twig
20
-
21
- {{ constant('RSS', date) }}
22
-
23
- Use the ``defined`` test to check if a constant is defined:
24
-
25
- .. code-block:: twig
26
-
27
- {% if constant('SOME_CONST') is defined %}
28
- ...
29
- {% endif %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/functions/cycle.rst DELETED
@@ -1,28 +0,0 @@
1
- ``cycle``
2
- =========
3
-
4
- The ``cycle`` function cycles on an array of values:
5
-
6
- .. code-block:: twig
7
-
8
- {% set start_year = date() | date('Y') %}
9
- {% set end_year = start_year + 5 %}
10
-
11
- {% for year in start_year..end_year %}
12
- {{ cycle(['odd', 'even'], loop.index0) }}
13
- {% endfor %}
14
-
15
- The array can contain any number of values:
16
-
17
- .. code-block:: twig
18
-
19
- {% set fruits = ['apple', 'orange', 'citrus'] %}
20
-
21
- {% for i in 0..10 %}
22
- {{ cycle(fruits, i) }}
23
- {% endfor %}
24
-
25
- Arguments
26
- ---------
27
-
28
- * ``position``: The cycle position
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/functions/date.rst DELETED
@@ -1,55 +0,0 @@
1
- ``date``
2
- ========
3
-
4
- .. versionadded:: 1.6
5
- The date function has been added in Twig 1.6.
6
-
7
- .. versionadded:: 1.6.1
8
- The default timezone support has been added in Twig 1.6.1.
9
-
10
- Converts an argument to a date to allow date comparison:
11
-
12
- .. code-block:: twig
13
-
14
- {% if date(user.created_at) < date('-2days') %}
15
- {# do something #}
16
- {% endif %}
17
-
18
- The argument must be in one of PHP’s supported `date and time formats`_.
19
-
20
- You can pass a timezone as the second argument:
21
-
22
- .. code-block:: twig
23
-
24
- {% if date(user.created_at) < date('-2days', 'Europe/Paris') %}
25
- {# do something #}
26
- {% endif %}
27
-
28
- If no argument is passed, the function returns the current date:
29
-
30
- .. code-block:: twig
31
-
32
- {% if date(user.created_at) < date() %}
33
- {# always! #}
34
- {% endif %}
35
-
36
- .. note::
37
-
38
- You can set the default timezone globally by calling ``setTimezone()`` on
39
- the ``core`` extension instance:
40
-
41
- .. code-block:: php
42
-
43
- $twig = new \Twig\Environment($loader);
44
- $twig->getExtension('\Twig\Extension\CoreExtension')->setTimezone('Europe/Paris');
45
-
46
- // before Twig 1.26
47
- $twig->getExtension('core')->setTimezone('Europe/Paris');
48
-
49
- Arguments
50
- ---------
51
-
52
- * ``date``: The date
53
- * ``timezone``: The timezone
54
-
55
- .. _`date and time formats`: https://secure.php.net/manual/en/datetime.formats.php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/functions/dump.rst DELETED
@@ -1,69 +0,0 @@
1
- ``dump``
2
- ========
3
-
4
- .. versionadded:: 1.5
5
- The ``dump`` function was added in Twig 1.5.
6
-
7
- The ``dump`` function dumps information about a template variable. This is
8
- mostly useful to debug a template that does not behave as expected by
9
- introspecting its variables:
10
-
11
- .. code-block:: twig
12
-
13
- {{ dump(user) }}
14
-
15
- .. note::
16
-
17
- The ``dump`` function is not available by default. You must add the
18
- ``\Twig\Extension\DebugExtension`` extension explicitly when creating your Twig
19
- environment::
20
-
21
- $twig = new \Twig\Environment($loader, [
22
- 'debug' => true,
23
- // ...
24
- ]);
25
- $twig->addExtension(new \Twig\Extension\DebugExtension());
26
-
27
- Even when enabled, the ``dump`` function won't display anything if the
28
- ``debug`` option on the environment is not enabled (to avoid leaking debug
29
- information on a production server).
30
-
31
- In an HTML context, wrap the output with a ``pre`` tag to make it easier to
32
- read:
33
-
34
- .. code-block:: twig
35
-
36
- <pre>
37
- {{ dump(user) }}
38
- </pre>
39
-
40
- .. tip::
41
-
42
- Using a ``pre`` tag is not needed when `XDebug`_ is enabled and
43
- ``html_errors`` is ``on``; as a bonus, the output is also nicer with
44
- XDebug enabled.
45
-
46
- You can debug several variables by passing them as additional arguments:
47
-
48
- .. code-block:: twig
49
-
50
- {{ dump(user, categories) }}
51
-
52
- If you don't pass any value, all variables from the current context are
53
- dumped:
54
-
55
- .. code-block:: twig
56
-
57
- {{ dump() }}
58
-
59
- .. note::
60
-
61
- Internally, Twig uses the PHP `var_dump`_ function.
62
-
63
- Arguments
64
- ---------
65
-
66
- * ``context``: The context to dump
67
-
68
- .. _`XDebug`: https://xdebug.org/docs/display
69
- .. _`var_dump`: https://secure.php.net/var_dump
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/functions/include.rst DELETED
@@ -1,84 +0,0 @@
1
- ``include``
2
- ===========
3
-
4
- .. versionadded:: 1.12
5
- The ``include`` function was added in Twig 1.12.
6
-
7
- The ``include`` function returns the rendered content of a template:
8
-
9
- .. code-block:: twig
10
-
11
- {{ include('template.html') }}
12
- {{ include(some_var) }}
13
-
14
- Included templates have access to the variables of the active context.
15
-
16
- If you are using the filesystem loader, the templates are looked for in the
17
- paths defined by it.
18
-
19
- The context is passed by default to the template but you can also pass
20
- additional variables:
21
-
22
- .. code-block:: twig
23
-
24
- {# template.html will have access to the variables from the current context and the additional ones provided #}
25
- {{ include('template.html', {foo: 'bar'}) }}
26
-
27
- You can disable access to the context by setting ``with_context`` to
28
- ``false``:
29
-
30
- .. code-block:: twig
31
-
32
- {# only the foo variable will be accessible #}
33
- {{ include('template.html', {foo: 'bar'}, with_context = false) }}
34
-
35
- .. code-block:: twig
36
-
37
- {# no variables will be accessible #}
38
- {{ include('template.html', with_context = false) }}
39
-
40
- And if the expression evaluates to a ``\Twig\Template`` or a
41
- ``\Twig\TemplateWrapper`` instance, Twig will use it directly::
42
-
43
- // {{ include(template) }}
44
-
45
- // deprecated as of Twig 1.28
46
- $template = $twig->loadTemplate('some_template.twig');
47
-
48
- // as of Twig 1.28
49
- $template = $twig->load('some_template.twig');
50
-
51
- $twig->display('template.twig', ['template' => $template]);
52
-
53
- When you set the ``ignore_missing`` flag, Twig will return an empty string if
54
- the template does not exist:
55
-
56
- .. code-block:: twig
57
-
58
- {{ include('sidebar.html', ignore_missing = true) }}
59
-
60
- You can also provide a list of templates that are checked for existence before
61
- inclusion. The first template that exists will be rendered:
62
-
63
- .. code-block:: twig
64
-
65
- {{ include(['page_detailed.html', 'page.html']) }}
66
-
67
- If ``ignore_missing`` is set, it will fall back to rendering nothing if none
68
- of the templates exist, otherwise it will throw an exception.
69
-
70
- When including a template created by an end user, you should consider
71
- sandboxing it:
72
-
73
- .. code-block:: twig
74
-
75
- {{ include('page.html', sandboxed = true) }}
76
-
77
- Arguments
78
- ---------
79
-
80
- * ``template``: The template to render
81
- * ``variables``: The variables to pass to the template
82
- * ``with_context``: Whether to pass the current context variables or not
83
- * ``ignore_missing``: Whether to ignore missing templates or not
84
- * ``sandboxed``: Whether to sandbox the template or not
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/functions/index.rst DELETED
@@ -1,20 +0,0 @@
1
- Functions
2
- =========
3
-
4
- .. toctree::
5
- :maxdepth: 1
6
-
7
- attribute
8
- block
9
- constant
10
- cycle
11
- date
12
- dump
13
- include
14
- max
15
- min
16
- parent
17
- random
18
- range
19
- source
20
- template_from_string
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/functions/max.rst DELETED
@@ -1,20 +0,0 @@
1
- ``max``
2
- =======
3
-
4
- .. versionadded:: 1.15
5
- The ``max`` function was added in Twig 1.15.
6
-
7
- ``max`` returns the biggest value of a sequence or a set of values:
8
-
9
- .. code-block:: twig
10
-
11
- {{ max(1, 3, 2) }}
12
- {{ max([1, 3, 2]) }}
13
-
14
- When called with a mapping, max ignores keys and only compares values:
15
-
16
- .. code-block:: twig
17
-
18
- {{ max({2: "e", 1: "a", 3: "b", 5: "d", 4: "c"}) }}
19
- {# returns "e" #}
20
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/functions/min.rst DELETED
@@ -1,20 +0,0 @@
1
- ``min``
2
- =======
3
-
4
- .. versionadded:: 1.15
5
- The ``min`` function was added in Twig 1.15.
6
-
7
- ``min`` returns the lowest value of a sequence or a set of values:
8
-
9
- .. code-block:: twig
10
-
11
- {{ min(1, 3, 2) }}
12
- {{ min([1, 3, 2]) }}
13
-
14
- When called with a mapping, min ignores keys and only compares values:
15
-
16
- .. code-block:: twig
17
-
18
- {{ min({2: "e", 3: "a", 1: "b", 5: "d", 4: "c"}) }}
19
- {# returns "a" #}
20
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/functions/parent.rst DELETED
@@ -1,20 +0,0 @@
1
- ``parent``
2
- ==========
3
-
4
- When a template uses inheritance, it's possible to render the contents of the
5
- parent block when overriding a block by using the ``parent`` function:
6
-
7
- .. code-block:: twig
8
-
9
- {% extends "base.html" %}
10
-
11
- {% block sidebar %}
12
- <h3>Table Of Contents</h3>
13
- ...
14
- {{ parent() }}
15
- {% endblock %}
16
-
17
- The ``parent()`` call will return the content of the ``sidebar`` block as
18
- defined in the ``base.html`` template.
19
-
20
- .. seealso:: :doc:`extends<../tags/extends>`, :doc:`block<../functions/block>`, :doc:`block<../tags/block>`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/functions/random.rst DELETED
@@ -1,36 +0,0 @@
1
- ``random``
2
- ==========
3
-
4
- .. versionadded:: 1.5
5
- The ``random`` function was added in Twig 1.5.
6
-
7
- .. versionadded:: 1.6
8
- String and integer handling was added in Twig 1.6.
9
-
10
- .. versionadded:: 1.38
11
- The "max" argument was added in Twig 1.38.
12
-
13
- The ``random`` function returns a random value depending on the supplied
14
- parameter type:
15
-
16
- * a random item from a sequence;
17
- * a random character from a string;
18
- * a random integer between 0 and the integer parameter (inclusive).
19
- * a random integer between the integer parameter (when negative) and 0 (inclusive).
20
- * a random integer between the first integer and the second integer parameter (inclusive).
21
-
22
- .. code-block:: twig
23
-
24
- {{ random(['apple', 'orange', 'citrus']) }} {# example output: orange #}
25
- {{ random('ABC') }} {# example output: C #}
26
- {{ random() }} {# example output: 15386094 (works as the native PHP mt_rand function) #}
27
- {{ random(5) }} {# example output: 3 #}
28
- {{ random(50, 100) }} {# example output: 63 #}
29
-
30
- Arguments
31
- ---------
32
-
33
- * ``values``: The values
34
- * ``max``: The max value when values is an integer
35
-
36
- .. _`mt_rand`: https://secure.php.net/mt_rand
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/functions/range.rst DELETED
@@ -1,58 +0,0 @@
1
- ``range``
2
- =========
3
-
4
- Returns a list containing an arithmetic progression of integers:
5
-
6
- .. code-block:: twig
7
-
8
- {% for i in range(0, 3) %}
9
- {{ i }},
10
- {% endfor %}
11
-
12
- {# outputs 0, 1, 2, 3, #}
13
-
14
- When step is given (as the third parameter), it specifies the increment (or
15
- decrement for negative values):
16
-
17
- .. code-block:: twig
18
-
19
- {% for i in range(0, 6, 2) %}
20
- {{ i }},
21
- {% endfor %}
22
-
23
- {# outputs 0, 2, 4, 6, #}
24
-
25
- .. note::
26
-
27
- Note that if the start is greater than the end, ``range`` assumes a step of
28
- ``-1``:
29
-
30
- .. code-block:: twig
31
-
32
- {% for i in range(3, 0) %}
33
- {{ i }},
34
- {% endfor %}
35
-
36
- {# outputs 3, 2, 1, 0, #}
37
-
38
- The Twig built-in ``..`` operator is just syntactic sugar for the ``range``
39
- function (with a step of ``1``, or ``-1`` if the start is greater than the end):
40
-
41
- .. code-block:: twig
42
-
43
- {% for i in 0..3 %}
44
- {{ i }},
45
- {% endfor %}
46
-
47
- .. tip::
48
-
49
- The ``range`` function works as the native PHP `range`_ function.
50
-
51
- Arguments
52
- ---------
53
-
54
- * ``low``: The first value of the sequence.
55
- * ``high``: The highest possible value of the sequence.
56
- * ``step``: The increment between elements of the sequence.
57
-
58
- .. _`range`: https://secure.php.net/range
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/functions/source.rst DELETED
@@ -1,32 +0,0 @@
1
- ``source``
2
- ==========
3
-
4
- .. versionadded:: 1.15
5
- The ``source`` function was added in Twig 1.15.
6
-
7
- .. versionadded:: 1.18.3
8
- The ``ignore_missing`` flag was added in Twig 1.18.3.
9
-
10
- The ``source`` function returns the content of a template without rendering it:
11
-
12
- .. code-block:: twig
13
-
14
- {{ source('template.html') }}
15
- {{ source(some_var) }}
16
-
17
- When you set the ``ignore_missing`` flag, Twig will return an empty string if
18
- the template does not exist:
19
-
20
- .. code-block:: twig
21
-
22
- {{ source('template.html', ignore_missing = true) }}
23
-
24
- The function uses the same template loaders as the ones used to include
25
- templates. So, if you are using the filesystem loader, the templates are looked
26
- for in the paths defined by it.
27
-
28
- Arguments
29
- ---------
30
-
31
- * ``name``: The name of the template to read
32
- * ``ignore_missing``: Whether to ignore missing templates or not
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/functions/template_from_string.rst DELETED
@@ -1,43 +0,0 @@
1
- ``template_from_string``
2
- ========================
3
-
4
- .. versionadded:: 1.11
5
- The ``template_from_string`` function was added in Twig 1.11.
6
-
7
- .. versionadded:: 1.39
8
- The name argument was added in Twig 1.39.
9
-
10
- The ``template_from_string`` function loads a template from a string:
11
-
12
- .. code-block:: twig
13
-
14
- {{ include(template_from_string("Hello {{ name }}")) }}
15
- {{ include(template_from_string(page.template)) }}
16
-
17
- To ease debugging, you can also give the template a name that will be part of
18
- any related error message:
19
-
20
- .. code-block:: twig
21
-
22
- {{ include(template_from_string(page.template, "template for page " ~ page.name)) }}
23
-
24
- .. note::
25
-
26
- The ``template_from_string`` function is not available by default. You
27
- must add the ``\Twig\Extension\StringLoaderExtension`` extension explicitly when
28
- creating your Twig environment::
29
-
30
- $twig = new \Twig\Environment(...);
31
- $twig->addExtension(new \Twig\Extension\StringLoaderExtension());
32
-
33
- .. note::
34
-
35
- Even if you will probably always use the ``template_from_string`` function
36
- with the ``include`` function, you can use it with any tag or function that
37
- takes a template as an argument (like the ``embed`` or ``extends`` tags).
38
-
39
- Arguments
40
- ---------
41
-
42
- * ``template``: The template
43
- * ``name``: A name for the template
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/index.rst DELETED
@@ -1,19 +0,0 @@
1
- Twig
2
- ====
3
-
4
- .. toctree::
5
- :maxdepth: 2
6
-
7
- intro
8
- installation
9
- templates
10
- api
11
- advanced
12
- internals
13
- deprecated
14
- recipes
15
- coding_standards
16
- tags/index
17
- filters/index
18
- functions/index
19
- tests/index
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/installation.rst DELETED
@@ -1,73 +0,0 @@
1
- Installation
2
- ============
3
-
4
- You have multiple ways to install Twig.
5
-
6
- Installing the Twig PHP package
7
- -------------------------------
8
-
9
- Install `Composer`_ and run the following command:
10
-
11
- .. code-block:: bash
12
-
13
- composer require "twig/twig:^1.0"
14
-
15
- Installing the C extension
16
- --------------------------
17
-
18
- .. versionadded:: 1.4
19
- The C extension was added in Twig 1.4.
20
-
21
- Twig comes with an **optional** C extension that improves the performance of the
22
- Twig runtime engine.
23
-
24
- Note that this extension does not replace the PHP code but only provides an
25
- optimized version of the ``\Twig\Template::getAttribute()`` method; you must
26
- still install the regular PHP code
27
-
28
- The C extension is only compatible and useful for **PHP5**.
29
-
30
- Install it like any other PHP extensions:
31
-
32
- .. code-block:: bash
33
-
34
- cd ext/twig
35
- phpize
36
- ./configure
37
- make
38
- make install
39
-
40
- For Windows:
41
-
42
- 1. Setup the build environment following the `PHP documentation`_
43
- 2. Put Twig's C extension source code into ``C:\php-sdk\phpdev\vcXX\x86\php-source-directory\ext\twig``
44
- 3. Use the ``configure --disable-all --enable-cli --enable-twig=shared`` command instead of step 14
45
- 4. ``nmake``
46
- 5. Copy the ``C:\php-sdk\phpdev\vcXX\x86\php-source-directory\Release_TS\php_twig.dll`` file to your PHP setup.
47
-
48
- .. tip::
49
-
50
- For Windows ZendServer, ZTS is not enabled as mentioned in `Zend Server
51
- FAQ`_.
52
-
53
- You have to use ``configure --disable-all --disable-zts --enable-cli
54
- --enable-twig=shared`` to be able to build the twig C extension for
55
- ZendServer.
56
-
57
- The built DLL will be available in
58
- ``C:\\php-sdk\\phpdev\\vcXX\\x86\\php-source-directory\\Release``
59
-
60
- Finally, enable the extension in your ``php.ini`` configuration file:
61
-
62
- .. code-block:: ini
63
-
64
- extension=twig.so # For Unix systems
65
- extension=php_twig.dll # For Windows systems
66
-
67
- And from now on, Twig will automatically compile your templates to take
68
- advantage of the C extension.
69
-
70
- .. _`download page`: https://github.com/twigphp/Twig/tags
71
- .. _`Composer`: https://getcomposer.org/download/
72
- .. _`PHP documentation`: https://wiki.php.net/internals/windows/stepbystepbuild
73
- .. _`Zend Server FAQ`: https://www.zend.com/en/products/server/faq#faqD6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/internals.rst DELETED
@@ -1,144 +0,0 @@
1
- Twig Internals
2
- ==============
3
-
4
- Twig is very extensible and you can hack it. Keep in mind that you
5
- should probably try to create an extension before hacking the core, as most
6
- features and enhancements can be handled with extensions. This chapter is also
7
- useful for people who want to understand how Twig works under the hood.
8
-
9
- How does Twig work?
10
- -------------------
11
-
12
- The rendering of a Twig template can be summarized into four key steps:
13
-
14
- * **Load** the template: If the template is already compiled, load it and go
15
- to the *evaluation* step, otherwise:
16
-
17
- * First, the **lexer** tokenizes the template source code into small pieces
18
- for easier processing;
19
-
20
- * Then, the **parser** converts the token stream into a meaningful tree
21
- of nodes (the Abstract Syntax Tree);
22
-
23
- * Finally, the *compiler* transforms the AST into PHP code.
24
-
25
- * **Evaluate** the template: It means calling the ``display()``
26
- method of the compiled template and passing it the context.
27
-
28
- The Lexer
29
- ---------
30
-
31
- The lexer tokenizes a template source code into a token stream (each token is
32
- an instance of ``\Twig\Token``, and the stream is an instance of
33
- ``\Twig\TokenStream``). The default lexer recognizes 13 different token types:
34
-
35
- * ``\Twig\Token::BLOCK_START_TYPE``, ``\Twig\Token::BLOCK_END_TYPE``: Delimiters for blocks (``{% %}``)
36
- * ``\Twig\Token::VAR_START_TYPE``, ``\Twig\Token::VAR_END_TYPE``: Delimiters for variables (``{{ }}``)
37
- * ``\Twig\Token::TEXT_TYPE``: A text outside an expression;
38
- * ``\Twig\Token::NAME_TYPE``: A name in an expression;
39
- * ``\Twig\Token::NUMBER_TYPE``: A number in an expression;
40
- * ``\Twig\Token::STRING_TYPE``: A string in an expression;
41
- * ``\Twig\Token::OPERATOR_TYPE``: An operator;
42
- * ``\Twig\Token::PUNCTUATION_TYPE``: A punctuation sign;
43
- * ``\Twig\Token::INTERPOLATION_START_TYPE``, ``\Twig\Token::INTERPOLATION_END_TYPE`` (as of Twig 1.5): Delimiters for string interpolation;
44
- * ``\Twig\Token::EOF_TYPE``: Ends of template.
45
-
46
- You can manually convert a source code into a token stream by calling the
47
- ``tokenize()`` method of an environment::
48
-
49
- $stream = $twig->tokenize(new \Twig\Source($source, $identifier));
50
-
51
- .. versionadded:: 1.27
52
- ``\Twig\Source`` was introduced in version 1.27, pass the source and the
53
- identifier directly on previous versions.
54
-
55
- As the stream has a ``__toString()`` method, you can have a textual
56
- representation of it by echoing the object::
57
-
58
- echo $stream."\n";
59
-
60
- Here is the output for the ``Hello {{ name }}`` template:
61
-
62
- .. code-block:: text
63
-
64
- TEXT_TYPE(Hello )
65
- VAR_START_TYPE()
66
- NAME_TYPE(name)
67
- VAR_END_TYPE()
68
- EOF_TYPE()
69
-
70
- .. note::
71
-
72
- The default lexer (``\Twig\Lexer``) can be changed by calling
73
- the ``setLexer()`` method::
74
-
75
- $twig->setLexer($lexer);
76
-
77
- The Parser
78
- ----------
79
-
80
- The parser converts the token stream into an AST (Abstract Syntax Tree), or a
81
- node tree (an instance of ``\Twig\Node\ModuleNode``). The core extension defines
82
- the basic nodes like: ``for``, ``if``, ... and the expression nodes.
83
-
84
- You can manually convert a token stream into a node tree by calling the
85
- ``parse()`` method of an environment::
86
-
87
- $nodes = $twig->parse($stream);
88
-
89
- Echoing the node object gives you a nice representation of the tree::
90
-
91
- echo $nodes."\n";
92
-
93
- Here is the output for the ``Hello {{ name }}`` template:
94
-
95
- .. code-block:: text
96
-
97
- \Twig\Node\ModuleNode(
98
- \Twig\Node\TextNode(Hello )
99
- \Twig\Node\PrintNode(
100
- \Twig\Node\Expression\NameExpression(name)
101
- )
102
- )
103
-
104
- .. note::
105
-
106
- The default parser (``\Twig\TokenParser\AbstractTokenParser``) can be changed by calling the
107
- ``setParser()`` method::
108
-
109
- $twig->setParser($parser);
110
-
111
- The Compiler
112
- ------------
113
-
114
- The last step is done by the compiler. It takes a node tree as an input and
115
- generates PHP code usable for runtime execution of the template.
116
-
117
- You can manually compile a node tree to PHP code with the ``compile()`` method
118
- of an environment::
119
-
120
- $php = $twig->compile($nodes);
121
-
122
- The generated template for a ``Hello {{ name }}`` template reads as follows
123
- (the actual output can differ depending on the version of Twig you are
124
- using)::
125
-
126
- /* Hello {{ name }} */
127
- class __TwigTemplate_1121b6f109fe93ebe8c6e22e3712bceb extends \Twig\Template
128
- {
129
- protected function doDisplay(array $context, array $blocks = [])
130
- {
131
- // line 1
132
- echo "Hello ";
133
- echo twig_escape_filter($this->env, (isset($context["name"]) ? $context["name"] : null), "html", null, true);
134
- }
135
-
136
- // some more code
137
- }
138
-
139
- .. note::
140
-
141
- The default compiler (``\Twig\Compiler``) can be changed by calling the
142
- ``setCompiler()`` method::
143
-
144
- $twig->setCompiler($compiler);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/intro.rst DELETED
@@ -1,76 +0,0 @@
1
- Introduction
2
- ============
3
-
4
- Welcome to the documentation for Twig, the flexible, fast, and secure template
5
- engine for PHP.
6
-
7
- Twig is both designer and developer friendly by sticking to PHP's principles and
8
- adding functionality useful for templating environments.
9
-
10
- The key-features are...
11
-
12
- * *Fast*: Twig compiles templates down to plain optimized PHP code. The
13
- overhead compared to regular PHP code was reduced to the very minimum.
14
-
15
- * *Secure*: Twig has a sandbox mode to evaluate untrusted template code. This
16
- allows Twig to be used as a template language for applications where users
17
- may modify the template design.
18
-
19
- * *Flexible*: Twig is powered by a flexible lexer and parser. This allows the
20
- developer to define their own custom tags and filters, and to create their own DSL.
21
-
22
- Twig is used by many Open-Source projects like Symfony, Drupal8, eZPublish,
23
- phpBB, Matomo, OroCRM; and many frameworks have support for it as well like
24
- Slim, Yii, Laravel, and Codeigniter — just to name a few.
25
-
26
- Prerequisites
27
- -------------
28
-
29
- Twig needs at least **PHP 5.5.0** to run.
30
-
31
- Installation
32
- ------------
33
-
34
- The recommended way to install Twig is via Composer:
35
-
36
- .. code-block:: bash
37
-
38
- composer require "twig/twig:^1.0"
39
-
40
- .. note::
41
-
42
- To learn more about the other installation methods, read the
43
- :doc:`installation<installation>` chapter; it also explains how to install
44
- the Twig C extension.
45
-
46
- Basic API Usage
47
- ---------------
48
-
49
- This section gives you a brief introduction to the PHP API for Twig.
50
-
51
- .. code-block:: php
52
-
53
- require_once '/path/to/vendor/autoload.php';
54
-
55
- $loader = new \Twig\Loader\ArrayLoader([
56
- 'index' => 'Hello {{ name }}!',
57
- ]);
58
- $twig = new \Twig\Environment($loader);
59
-
60
- echo $twig->render('index', ['name' => 'Fabien']);
61
-
62
- Twig uses a loader (``\Twig\Loader\ArrayLoader``) to locate templates, and an
63
- environment (``\Twig\Environment``) to store its configuration.
64
-
65
- The ``render()`` method loads the template passed as a first argument and
66
- renders it with the variables passed as a second argument.
67
-
68
- As templates are generally stored on the filesystem, Twig also comes with a
69
- filesystem loader::
70
-
71
- $loader = new \Twig\Loader\FilesystemLoader('/path/to/templates');
72
- $twig = new \Twig\Environment($loader, [
73
- 'cache' => '/path/to/compilation_cache',
74
- ]);
75
-
76
- echo $twig->render('index.html', ['name' => 'Fabien']);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/recipes.rst DELETED
@@ -1,568 +0,0 @@
1
- Recipes
2
- =======
3
-
4
- .. _deprecation-notices:
5
-
6
- Displaying Deprecation Notices
7
- ------------------------------
8
-
9
- .. versionadded:: 1.21
10
- This works as of Twig 1.21.
11
-
12
- Deprecated features generate deprecation notices (via a call to the
13
- ``trigger_error()`` PHP function). By default, they are silenced and never
14
- displayed nor logged.
15
-
16
- To remove all deprecated feature usages from your templates, write and run a
17
- script along the lines of the following::
18
-
19
- require_once __DIR__.'/vendor/autoload.php';
20
-
21
- $twig = create_your_twig_env();
22
-
23
- $deprecations = new \Twig\Util\DeprecationCollector($twig);
24
-
25
- print_r($deprecations->collectDir(__DIR__.'/templates'));
26
-
27
- The ``collectDir()`` method compiles all templates found in a directory,
28
- catches deprecation notices, and return them.
29
-
30
- .. tip::
31
-
32
- If your templates are not stored on the filesystem, use the ``collect()``
33
- method instead. ``collect()`` takes a ``Traversable`` which must return
34
- template names as keys and template contents as values (as done by
35
- ``\Twig\Util\TemplateDirIterator``).
36
-
37
- However, this code won't find all deprecations (like using deprecated some Twig
38
- classes). To catch all notices, register a custom error handler like the one
39
- below::
40
-
41
- $deprecations = [];
42
- set_error_handler(function ($type, $msg) use (&$deprecations) {
43
- if (E_USER_DEPRECATED === $type) {
44
- $deprecations[] = $msg;
45
- }
46
- });
47
-
48
- // run your application
49
-
50
- print_r($deprecations);
51
-
52
- Note that most deprecation notices are triggered during **compilation**, so
53
- they won't be generated when templates are already cached.
54
-
55
- .. tip::
56
-
57
- If you want to manage the deprecation notices from your PHPUnit tests, have
58
- a look at the `symfony/phpunit-bridge
59
- <https://github.com/symfony/phpunit-bridge>`_ package, which eases the
60
- process.
61
-
62
- Making a Layout conditional
63
- ---------------------------
64
-
65
- Working with Ajax means that the same content is sometimes displayed as is,
66
- and sometimes decorated with a layout. As Twig layout template names can be
67
- any valid expression, you can pass a variable that evaluates to ``true`` when
68
- the request is made via Ajax and choose the layout accordingly:
69
-
70
- .. code-block:: twig
71
-
72
- {% extends request.ajax ? "base_ajax.html" : "base.html" %}
73
-
74
- {% block content %}
75
- This is the content to be displayed.
76
- {% endblock %}
77
-
78
- Making an Include dynamic
79
- -------------------------
80
-
81
- When including a template, its name does not need to be a string. For
82
- instance, the name can depend on the value of a variable:
83
-
84
- .. code-block:: twig
85
-
86
- {% include var ~ '_foo.html' %}
87
-
88
- If ``var`` evaluates to ``index``, the ``index_foo.html`` template will be
89
- rendered.
90
-
91
- As a matter of fact, the template name can be any valid expression, such as
92
- the following:
93
-
94
- .. code-block:: twig
95
-
96
- {% include var|default('index') ~ '_foo.html' %}
97
-
98
- Overriding a Template that also extends itself
99
- ----------------------------------------------
100
-
101
- A template can be customized in two different ways:
102
-
103
- * *Inheritance*: A template *extends* a parent template and overrides some
104
- blocks;
105
-
106
- * *Replacement*: If you use the filesystem loader, Twig loads the first
107
- template it finds in a list of configured directories; a template found in a
108
- directory *replaces* another one from a directory further in the list.
109
-
110
- But how do you combine both: *replace* a template that also extends itself
111
- (aka a template in a directory further in the list)?
112
-
113
- Let's say that your templates are loaded from both ``.../templates/mysite``
114
- and ``.../templates/default`` in this order. The ``page.twig`` template,
115
- stored in ``.../templates/default`` reads as follows:
116
-
117
- .. code-block:: twig
118
-
119
- {# page.twig #}
120
- {% extends "layout.twig" %}
121
-
122
- {% block content %}
123
- {% endblock %}
124
-
125
- You can replace this template by putting a file with the same name in
126
- ``.../templates/mysite``. And if you want to extend the original template, you
127
- might be tempted to write the following:
128
-
129
- .. code-block:: twig
130
-
131
- {# page.twig in .../templates/mysite #}
132
- {% extends "page.twig" %} {# from .../templates/default #}
133
-
134
- However, this will not work as Twig will always load the template from
135
- ``.../templates/mysite``.
136
-
137
- It turns out it is possible to get this to work, by adding a directory right
138
- at the end of your template directories, which is the parent of all of the
139
- other directories: ``.../templates`` in our case. This has the effect of
140
- making every template file within our system uniquely addressable. Most of the
141
- time you will use the "normal" paths, but in the special case of wanting to
142
- extend a template with an overriding version of itself we can reference its
143
- parent's full, unambiguous template path in the extends tag:
144
-
145
- .. code-block:: twig
146
-
147
- {# page.twig in .../templates/mysite #}
148
- {% extends "default/page.twig" %} {# from .../templates #}
149
-
150
- .. note::
151
-
152
- This recipe was inspired by the following Django wiki page:
153
- https://code.djangoproject.com/wiki/ExtendingTemplates
154
-
155
- Customizing the Syntax
156
- ----------------------
157
-
158
- Twig allows some syntax customization for the block delimiters. It's **not**
159
- recommended to use this feature as templates will be tied with your custom
160
- syntax. But for specific projects, it can make sense to change the defaults.
161
-
162
- To change the block delimiters, you need to create your own lexer object::
163
-
164
- $twig = new \Twig\Environment();
165
-
166
- $lexer = new \Twig\Lexer($twig, [
167
- 'tag_comment' => ['{#', '#}'],
168
- 'tag_block' => ['{%', '%}'],
169
- 'tag_variable' => ['{{', '}}'],
170
- 'interpolation' => ['#{', '}'],
171
- ]);
172
- $twig->setLexer($lexer);
173
-
174
- Here are some configuration example that simulates some other template engines
175
- syntax::
176
-
177
- // Ruby erb syntax
178
- $lexer = new \Twig\Lexer($twig, [
179
- 'tag_comment' => ['<%#', '%>'],
180
- 'tag_block' => ['<%', '%>'],
181
- 'tag_variable' => ['<%=', '%>'],
182
- ]);
183
-
184
- // SGML Comment Syntax
185
- $lexer = new \Twig\Lexer($twig, [
186
- 'tag_comment' => ['<!--#', '-->'],
187
- 'tag_block' => ['<!--', '-->'],
188
- 'tag_variable' => ['${', '}'],
189
- ]);
190
-
191
- // Smarty like
192
- $lexer = new \Twig\Lexer($twig, [
193
- 'tag_comment' => ['{*', '*}'],
194
- 'tag_block' => ['{', '}'],
195
- 'tag_variable' => ['{$', '}'],
196
- ]);
197
-
198
- Using dynamic Object Properties
199
- -------------------------------
200
-
201
- When Twig encounters a variable like ``article.title``, it tries to find a
202
- ``title`` public property in the ``article`` object.
203
-
204
- It also works if the property does not exist but is rather defined dynamically
205
- thanks to the magic ``__get()`` method; you need to also implement the
206
- ``__isset()`` magic method like shown in the following snippet of code::
207
-
208
- class Article
209
- {
210
- public function __get($name)
211
- {
212
- if ('title' == $name) {
213
- return 'The title';
214
- }
215
-
216
- // throw some kind of error
217
- }
218
-
219
- public function __isset($name)
220
- {
221
- if ('title' == $name) {
222
- return true;
223
- }
224
-
225
- return false;
226
- }
227
- }
228
-
229
- Accessing the parent Context in Nested Loops
230
- --------------------------------------------
231
-
232
- Sometimes, when using nested loops, you need to access the parent context. The
233
- parent context is always accessible via the ``loop.parent`` variable. For
234
- instance, if you have the following template data::
235
-
236
- $data = [
237
- 'topics' => [
238
- 'topic1' => ['Message 1 of topic 1', 'Message 2 of topic 1'],
239
- 'topic2' => ['Message 1 of topic 2', 'Message 2 of topic 2'],
240
- ],
241
- ];
242
-
243
- And the following template to display all messages in all topics:
244
-
245
- .. code-block:: twig
246
-
247
- {% for topic, messages in topics %}
248
- * {{ loop.index }}: {{ topic }}
249
- {% for message in messages %}
250
- - {{ loop.parent.loop.index }}.{{ loop.index }}: {{ message }}
251
- {% endfor %}
252
- {% endfor %}
253
-
254
- The output will be similar to:
255
-
256
- .. code-block:: text
257
-
258
- * 1: topic1
259
- - 1.1: The message 1 of topic 1
260
- - 1.2: The message 2 of topic 1
261
- * 2: topic2
262
- - 2.1: The message 1 of topic 2
263
- - 2.2: The message 2 of topic 2
264
-
265
- In the inner loop, the ``loop.parent`` variable is used to access the outer
266
- context. So, the index of the current ``topic`` defined in the outer for loop
267
- is accessible via the ``loop.parent.loop.index`` variable.
268
-
269
- Defining undefined Functions and Filters on the Fly
270
- ---------------------------------------------------
271
-
272
- When a function (or a filter) is not defined, Twig defaults to throw a
273
- ``\Twig\Error\SyntaxError`` exception. However, it can also call a `callback`_ (any
274
- valid PHP callable) which should return a function (or a filter).
275
-
276
- For filters, register callbacks with ``registerUndefinedFilterCallback()``.
277
- For functions, use ``registerUndefinedFunctionCallback()``::
278
-
279
- // auto-register all native PHP functions as Twig functions
280
- // don't try this at home as it's not secure at all!
281
- $twig->registerUndefinedFunctionCallback(function ($name) {
282
- if (function_exists($name)) {
283
- return new \Twig\TwigFunction($name, $name);
284
- }
285
-
286
- return false;
287
- });
288
-
289
- If the callable is not able to return a valid function (or filter), it must
290
- return ``false``.
291
-
292
- If you register more than one callback, Twig will call them in turn until one
293
- does not return ``false``.
294
-
295
- .. tip::
296
-
297
- As the resolution of functions and filters is done during compilation,
298
- there is no overhead when registering these callbacks.
299
-
300
- Validating the Template Syntax
301
- ------------------------------
302
-
303
- When template code is provided by a third-party (through a web interface for
304
- instance), it might be interesting to validate the template syntax before
305
- saving it. If the template code is stored in a `$template` variable, here is
306
- how you can do it::
307
-
308
- try {
309
- $twig->parse($twig->tokenize(new \Twig\Source($template)));
310
-
311
- // the $template is valid
312
- } catch (\Twig\Error\SyntaxError $e) {
313
- // $template contains one or more syntax errors
314
- }
315
-
316
- If you iterate over a set of files, you can pass the filename to the
317
- ``tokenize()`` method to get the filename in the exception message::
318
-
319
- foreach ($files as $file) {
320
- try {
321
- $twig->parse($twig->tokenize(new \Twig\Source($template, $file->getFilename(), $file)));
322
-
323
- // the $template is valid
324
- } catch (\Twig\Error\SyntaxError $e) {
325
- // $template contains one or more syntax errors
326
- }
327
- }
328
-
329
- .. versionadded:: 1.27
330
- ``\Twig\Source`` was introduced in version 1.27, pass the source and the
331
- identifier directly on previous versions.
332
-
333
- .. note::
334
-
335
- This method won't catch any sandbox policy violations because the policy
336
- is enforced during template rendering (as Twig needs the context for some
337
- checks like allowed methods on objects).
338
-
339
- Refreshing modified Templates when OPcache or APC is enabled
340
- ------------------------------------------------------------
341
-
342
- When using OPcache with ``opcache.validate_timestamps`` set to ``0`` or APC
343
- with ``apc.stat`` set to ``0`` and Twig cache enabled, clearing the template
344
- cache won't update the cache.
345
-
346
- To get around this, force Twig to invalidate the bytecode cache::
347
-
348
- $twig = new \Twig\Environment($loader, [
349
- 'cache' => new \Twig\Cache\FilesystemCache('/some/cache/path', \Twig\Cache\FilesystemCache::FORCE_BYTECODE_INVALIDATION),
350
- // ...
351
- ]);
352
-
353
- .. note::
354
-
355
- Before Twig 1.22, you should extend ``\Twig\Environment`` instead::
356
-
357
- class OpCacheAwareTwigEnvironment extends \Twig\Environment
358
- {
359
- protected function writeCacheFile($file, $content)
360
- {
361
- parent::writeCacheFile($file, $content);
362
-
363
- // Compile cached file into bytecode cache
364
- if (function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) {
365
- opcache_invalidate($file, true);
366
- } elseif (function_exists('apc_compile_file')) {
367
- apc_compile_file($file);
368
- }
369
- }
370
- }
371
-
372
- Reusing a stateful Node Visitor
373
- -------------------------------
374
-
375
- When attaching a visitor to a ``\Twig\Environment`` instance, Twig uses it to
376
- visit *all* templates it compiles. If you need to keep some state information
377
- around, you probably want to reset it when visiting a new template.
378
-
379
- This can be achieved with the following code::
380
-
381
- protected $someTemplateState = [];
382
-
383
- public function enterNode(Twig_NodeInterface $node, \Twig\Environment $env)
384
- {
385
- if ($node instanceof \Twig\Node\ModuleNode) {
386
- // reset the state as we are entering a new template
387
- $this->someTemplateState = [];
388
- }
389
-
390
- // ...
391
-
392
- return $node;
393
- }
394
-
395
- Using a Database to store Templates
396
- -----------------------------------
397
-
398
- If you are developing a CMS, templates are usually stored in a database. This
399
- recipe gives you a simple PDO template loader you can use as a starting point
400
- for your own.
401
-
402
- First, let's create a temporary in-memory SQLite3 database to work with::
403
-
404
- $dbh = new PDO('sqlite::memory:');
405
- $dbh->exec('CREATE TABLE templates (name STRING, source STRING, last_modified INTEGER)');
406
- $base = '{% block content %}{% endblock %}';
407
- $index = '
408
- {% extends "base.twig" %}
409
- {% block content %}Hello {{ name }}{% endblock %}
410
- ';
411
- $now = time();
412
- $dbh->prepare('INSERT INTO templates (name, source, last_modified) VALUES (?, ?, ?)')->execute(['base.twig', $base, $now]);
413
- $dbh->prepare('INSERT INTO templates (name, source, last_modified) VALUES (?, ?, ?)')->execute(['index.twig', $index, $now]);
414
-
415
- We have created a simple ``templates`` table that hosts two templates:
416
- ``base.twig`` and ``index.twig``.
417
-
418
- Now, let's define a loader able to use this database::
419
-
420
- class DatabaseTwigLoader implements \Twig\Loader\LoaderInterface, \Twig\Loader\ExistsLoaderInterface, \Twig\Loader\SourceContextLoaderInterface
421
- {
422
- protected $dbh;
423
-
424
- public function __construct(PDO $dbh)
425
- {
426
- $this->dbh = $dbh;
427
- }
428
-
429
- public function getSource($name)
430
- {
431
- if (false === $source = $this->getValue('source', $name)) {
432
- throw new \Twig\Error\LoaderError(sprintf('Template "%s" does not exist.', $name));
433
- }
434
-
435
- return $source;
436
- }
437
-
438
- // \Twig\Loader\SourceContextLoaderInterface as of Twig 1.27
439
- public function getSourceContext($name)
440
- {
441
- if (false === $source = $this->getValue('source', $name)) {
442
- throw new \Twig\Error\LoaderError(sprintf('Template "%s" does not exist.', $name));
443
- }
444
-
445
- return new \Twig\Source($source, $name);
446
- }
447
-
448
- // \Twig\Loader\ExistsLoaderInterface as of Twig 1.11
449
- public function exists($name)
450
- {
451
- return $name === $this->getValue('name', $name);
452
- }
453
-
454
- public function getCacheKey($name)
455
- {
456
- return $name;
457
- }
458
-
459
- public function isFresh($name, $time)
460
- {
461
- if (false === $lastModified = $this->getValue('last_modified', $name)) {
462
- return false;
463
- }
464
-
465
- return $lastModified <= $time;
466
- }
467
-
468
- protected function getValue($column, $name)
469
- {
470
- $sth = $this->dbh->prepare('SELECT '.$column.' FROM templates WHERE name = :name');
471
- $sth->execute([':name' => (string) $name]);
472
-
473
- return $sth->fetchColumn();
474
- }
475
- }
476
-
477
- Finally, here is an example on how you can use it::
478
-
479
- $loader = new DatabaseTwigLoader($dbh);
480
- $twig = new \Twig\Environment($loader);
481
-
482
- echo $twig->render('index.twig', ['name' => 'Fabien']);
483
-
484
- Using different Template Sources
485
- --------------------------------
486
-
487
- This recipe is the continuation of the previous one. Even if you store the
488
- contributed templates in a database, you might want to keep the original/base
489
- templates on the filesystem. When templates can be loaded from different
490
- sources, you need to use the ``\Twig\Loader\ChainLoader`` loader.
491
-
492
- As you can see in the previous recipe, we reference the template in the exact
493
- same way as we would have done it with a regular filesystem loader. This is
494
- the key to be able to mix and match templates coming from the database, the
495
- filesystem, or any other loader for that matter: the template name should be a
496
- logical name, and not the path from the filesystem::
497
-
498
- $loader1 = new DatabaseTwigLoader($dbh);
499
- $loader2 = new \Twig\Loader\ArrayLoader([
500
- 'base.twig' => '{% block content %}{% endblock %}',
501
- ]);
502
- $loader = new \Twig\Loader\ChainLoader([$loader1, $loader2]);
503
-
504
- $twig = new \Twig\Environment($loader);
505
-
506
- echo $twig->render('index.twig', ['name' => 'Fabien']);
507
-
508
- Now that the ``base.twig`` templates is defined in an array loader, you can
509
- remove it from the database, and everything else will still work as before.
510
-
511
- Loading a Template from a String
512
- --------------------------------
513
-
514
- From a template, you can load a template stored in a string via the
515
- ``template_from_string`` function (available as of Twig 1.11 via the
516
- ``\Twig\Extension\StringLoaderExtension`` extension):
517
-
518
- .. code-block:: twig
519
-
520
- {{ include(template_from_string("Hello {{ name }}")) }}
521
-
522
- From PHP, it's also possible to load a template stored in a string via
523
- ``\Twig\Environment::createTemplate()`` (available as of Twig 1.18)::
524
-
525
- $template = $twig->createTemplate('hello {{ name }}');
526
- echo $template->render(['name' => 'Fabien']);
527
-
528
- .. note::
529
-
530
- Never use the ``Twig_Loader_String`` loader, which has severe limitations.
531
-
532
- Using Twig and AngularJS in the same Templates
533
- ----------------------------------------------
534
-
535
- Mixing different template syntaxes in the same file is not a recommended
536
- practice as both AngularJS and Twig use the same delimiters in their syntax:
537
- ``{{`` and ``}}``.
538
-
539
- Still, if you want to use AngularJS and Twig in the same template, there are
540
- two ways to make it work depending on the amount of AngularJS you need to
541
- include in your templates:
542
-
543
- * Escaping the AngularJS delimiters by wrapping AngularJS sections with the
544
- ``{% verbatim %}`` tag or by escaping each delimiter via ``{{ '{{' }}`` and
545
- ``{{ '}}' }}``;
546
-
547
- * Changing the delimiters of one of the template engines (depending on which
548
- engine you introduced last):
549
-
550
- * For AngularJS, change the interpolation tags using the
551
- ``interpolateProvider`` service, for instance at the module initialization
552
- time:
553
-
554
- .. code-block:: javascript
555
-
556
- angular.module('myApp', []).config(function($interpolateProvider) {
557
- $interpolateProvider.startSymbol('{[').endSymbol(']}');
558
- });
559
-
560
- * For Twig, change the delimiters via the ``tag_variable`` Lexer option:
561
-
562
- .. code-block:: php
563
-
564
- $env->setLexer(new \Twig\Lexer($env, [
565
- 'tag_variable' => ['{[', ']}'],
566
- ]));
567
-
568
- .. _callback: https://secure.php.net/manual/en/function.is-callable.php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/apply.rst DELETED
@@ -1,23 +0,0 @@
1
- ``apply``
2
- =========
3
-
4
- .. versionadded:: 1.40
5
- The ``apply`` tag was added in Twig 1.40.
6
-
7
- The ``apply`` tag allows you to apply Twig filters on a block of template data:
8
-
9
- .. code-block:: twig
10
-
11
- {% apply upper %}
12
- This text becomes uppercase
13
- {% endapply %}
14
-
15
- You can also chain filters and pass arguments to them:
16
-
17
- .. code-block:: twig
18
-
19
- {% apply lower|escape('html') %}
20
- <strong>SOME TEXT</strong>
21
- {% endapply %}
22
-
23
- {# outputs "&lt;strong&gt;some text&lt;/strong&gt;" #}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/autoescape.rst DELETED
@@ -1,81 +0,0 @@
1
- ``autoescape``
2
- ==============
3
-
4
- Whether automatic escaping is enabled or not, you can mark a section of a
5
- template to be escaped or not by using the ``autoescape`` tag:
6
-
7
- .. code-block:: twig
8
-
9
- {% autoescape %}
10
- Everything will be automatically escaped in this block
11
- using the HTML strategy
12
- {% endautoescape %}
13
-
14
- {% autoescape 'html' %}
15
- Everything will be automatically escaped in this block
16
- using the HTML strategy
17
- {% endautoescape %}
18
-
19
- {% autoescape 'js' %}
20
- Everything will be automatically escaped in this block
21
- using the js escaping strategy
22
- {% endautoescape %}
23
-
24
- {% autoescape false %}
25
- Everything will be outputted as is in this block
26
- {% endautoescape %}
27
-
28
- .. note::
29
-
30
- Before Twig 1.8, the syntax was different:
31
-
32
- .. code-block:: twig
33
-
34
- {% autoescape true %}
35
- Everything will be automatically escaped in this block
36
- using the HTML strategy
37
- {% endautoescape %}
38
-
39
- {% autoescape false %}
40
- Everything will be outputted as is in this block
41
- {% endautoescape %}
42
-
43
- {% autoescape true js %}
44
- Everything will be automatically escaped in this block
45
- using the js escaping strategy
46
- {% endautoescape %}
47
-
48
- When automatic escaping is enabled everything is escaped by default except for
49
- values explicitly marked as safe. Those can be marked in the template by using
50
- the :doc:`raw<../filters/raw>` filter:
51
-
52
- .. code-block:: twig
53
-
54
- {% autoescape %}
55
- {{ safe_value|raw }}
56
- {% endautoescape %}
57
-
58
- Functions returning template data (like :doc:`macros<macro>` and
59
- :doc:`parent<../functions/parent>`) always return safe markup.
60
-
61
- .. note::
62
-
63
- Twig is smart enough to not escape an already escaped value by the
64
- :doc:`escape<../filters/escape>` filter.
65
-
66
- .. note::
67
-
68
- Twig does not escape static expressions:
69
-
70
- .. code-block:: twig
71
-
72
- {% set hello = "<strong>Hello</strong>" %}
73
- {{ hello }}
74
- {{ "<strong>world</strong>" }}
75
-
76
- Will be rendered "<strong>Hello</strong> **world**".
77
-
78
- .. note::
79
-
80
- The chapter :doc:`Twig for Developers<../api>` gives more information
81
- about when and how automatic escaping is applied.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/block.rst DELETED
@@ -1,11 +0,0 @@
1
- ``block``
2
- =========
3
-
4
- Blocks are used for inheritance and act as placeholders and replacements at
5
- the same time. They are documented in detail in the documentation for the
6
- :doc:`extends<../tags/extends>` tag.
7
-
8
- Block names should consist of alphanumeric characters, and underscores. Dashes
9
- are not permitted.
10
-
11
- .. seealso:: :doc:`block<../functions/block>`, :doc:`parent<../functions/parent>`, :doc:`use<../tags/use>`, :doc:`extends<../tags/extends>`
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/deprecated.rst DELETED
@@ -1,30 +0,0 @@
1
- ``deprecated``
2
- ==============
3
-
4
- .. versionadded:: 1.36 and 2.6
5
- The ``deprecated`` tag was added in Twig 1.36 and 2.6.
6
-
7
- Twig generates a deprecation notice (via a call to the ``trigger_error()``
8
- PHP function) where the ``deprecated`` tag is used in a template:
9
-
10
- .. code-block:: twig
11
-
12
- {# base.twig #}
13
- {% deprecated 'The "base.twig" template is deprecated, use "layout.twig" instead.' %}
14
- {% extends 'layout.twig' %}
15
-
16
- Also you can deprecate a block in the following way:
17
-
18
- .. code-block:: twig
19
-
20
- {% block hey %}
21
- {% deprecated 'The "hey" block is deprecated, use "greet" instead.' %}
22
- {{ block('greet') }}
23
- {% endblock %}
24
-
25
- {% block greet %}
26
- Hey you!
27
- {% endblock %}
28
-
29
- Note that by default, the deprecation notices are silenced and never displayed nor logged.
30
- See :ref:`deprecation-notices` to learn how to handle them.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/do.rst DELETED
@@ -1,12 +0,0 @@
1
- ``do``
2
- ======
3
-
4
- .. versionadded:: 1.5
5
- The ``do`` tag was added in Twig 1.5.
6
-
7
- The ``do`` tag works exactly like the regular variable expression (``{{ ...
8
- }}``) just that it doesn't print anything:
9
-
10
- .. code-block:: twig
11
-
12
- {% do 1 + 2 %}
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/embed.rst DELETED
@@ -1,178 +0,0 @@
1
- ``embed``
2
- =========
3
-
4
- .. versionadded:: 1.8
5
- The ``embed`` tag was added in Twig 1.8.
6
-
7
- The ``embed`` tag combines the behaviour of :doc:`include<include>` and
8
- :doc:`extends<extends>`.
9
- It allows you to include another template's contents, just like ``include``
10
- does. But it also allows you to override any block defined inside the
11
- included template, like when extending a template.
12
-
13
- Think of an embedded template as a "micro layout skeleton".
14
-
15
- .. code-block:: twig
16
-
17
- {% embed "teasers_skeleton.twig" %}
18
- {# These blocks are defined in "teasers_skeleton.twig" #}
19
- {# and we override them right here: #}
20
- {% block left_teaser %}
21
- Some content for the left teaser box
22
- {% endblock %}
23
- {% block right_teaser %}
24
- Some content for the right teaser box
25
- {% endblock %}
26
- {% endembed %}
27
-
28
- The ``embed`` tag takes the idea of template inheritance to the level of
29
- content fragments. While template inheritance allows for "document skeletons",
30
- which are filled with life by child templates, the ``embed`` tag allows you to
31
- create "skeletons" for smaller units of content and re-use and fill them
32
- anywhere you like.
33
-
34
- Since the use case may not be obvious, let's look at a simplified example.
35
- Imagine a base template shared by multiple HTML pages, defining a single block
36
- named "content":
37
-
38
- .. code-block:: text
39
-
40
- ┌─── page layout ─────────────────────┐
41
- │ │
42
- │ ┌── block "content" ──┐ │
43
- │ │ │ │
44
- │ │ │ │
45
- │ │ (child template to │ │
46
- │ │ put content here) │ │
47
- │ │ │ │
48
- │ │ │ │
49
- │ └─────────────────────┘ │
50
- │ │
51
- └─────────────────────────────────────┘
52
-
53
- Some pages ("foo" and "bar") share the same content structure -
54
- two vertically stacked boxes:
55
-
56
- .. code-block:: text
57
-
58
- ┌─── page layout ─────────────────────┐
59
- │ │
60
- │ ┌── block "content" ──┐ │
61
- │ │ ┌─ block "top" ───┐ │ │
62
- │ │ │ │ │ │
63
- │ │ └─────────────────┘ │ │
64
- │ │ ┌─ block "bottom" ┐ │ │
65
- │ │ │ │ │ │
66
- │ │ └─────────────────┘ │ │
67
- │ └─────────────────────┘ │
68
- │ │
69
- └─────────────────────────────────────┘
70
-
71
- While other pages ("boom" and "baz") share a different content structure -
72
- two boxes side by side:
73
-
74
- .. code-block:: text
75
-
76
- ┌─── page layout ─────────────────────┐
77
- │ │
78
- │ ┌── block "content" ──┐ │
79
- │ │ │ │
80
- │ │ ┌ block ┐ ┌ block ┐ │ │
81
- │ │ │"left" │ │"right"│ │ │
82
- │ │ │ │ │ │ │ │
83
- │ │ │ │ │ │ │ │
84
- │ │ └───────┘ └───────┘ │ │
85
- │ └─────────────────────┘ │
86
- │ │
87
- └─────────────────────────────────────┘
88
-
89
- Without the ``embed`` tag, you have two ways to design your templates:
90
-
91
- * Create two "intermediate" base templates that extend the master layout
92
- template: one with vertically stacked boxes to be used by the "foo" and
93
- "bar" pages and another one with side-by-side boxes for the "boom" and
94
- "baz" pages.
95
-
96
- * Embed the markup for the top/bottom and left/right boxes into each page
97
- template directly.
98
-
99
- These two solutions do not scale well because they each have a major drawback:
100
-
101
- * The first solution may indeed work for this simplified example. But imagine
102
- we add a sidebar, which may again contain different, recurring structures
103
- of content. Now we would need to create intermediate base templates for
104
- all occurring combinations of content structure and sidebar structure...
105
- and so on.
106
-
107
- * The second solution involves duplication of common code with all its negative
108
- consequences: any change involves finding and editing all affected copies
109
- of the structure, correctness has to be verified for each copy, copies may
110
- go out of sync by careless modifications etc.
111
-
112
- In such a situation, the ``embed`` tag comes in handy. The common layout
113
- code can live in a single base template, and the two different content structures,
114
- let's call them "micro layouts" go into separate templates which are embedded
115
- as necessary:
116
-
117
- Page template ``foo.twig``:
118
-
119
- .. code-block:: twig
120
-
121
- {% extends "layout_skeleton.twig" %}
122
-
123
- {% block content %}
124
- {% embed "vertical_boxes_skeleton.twig" %}
125
- {% block top %}
126
- Some content for the top box
127
- {% endblock %}
128
-
129
- {% block bottom %}
130
- Some content for the bottom box
131
- {% endblock %}
132
- {% endembed %}
133
- {% endblock %}
134
-
135
- And here is the code for ``vertical_boxes_skeleton.twig``:
136
-
137
- .. code-block:: html+twig
138
-
139
- <div class="top_box">
140
- {% block top %}
141
- Top box default content
142
- {% endblock %}
143
- </div>
144
-
145
- <div class="bottom_box">
146
- {% block bottom %}
147
- Bottom box default content
148
- {% endblock %}
149
- </div>
150
-
151
- The goal of the ``vertical_boxes_skeleton.twig`` template being to factor
152
- out the HTML markup for the boxes.
153
-
154
- The ``embed`` tag takes the exact same arguments as the ``include`` tag:
155
-
156
- .. code-block:: twig
157
-
158
- {% embed "base" with {'foo': 'bar'} %}
159
- ...
160
- {% endembed %}
161
-
162
- {% embed "base" with {'foo': 'bar'} only %}
163
- ...
164
- {% endembed %}
165
-
166
- {% embed "base" ignore missing %}
167
- ...
168
- {% endembed %}
169
-
170
- .. warning::
171
-
172
- As embedded templates do not have "names", auto-escaping strategies based
173
- on the template name won't work as expected if you change the context (for
174
- instance, if you embed a CSS/JavaScript template into an HTML one). In that
175
- case, explicitly set the default auto-escaping strategy with the
176
- ``autoescape`` tag.
177
-
178
- .. seealso:: :doc:`include<../tags/include>`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/extends.rst DELETED
@@ -1,270 +0,0 @@
1
- ``extends``
2
- ===========
3
-
4
- The ``extends`` tag can be used to extend a template from another one.
5
-
6
- .. note::
7
-
8
- Like PHP, Twig does not support multiple inheritance. So you can only have
9
- one extends tag called per rendering. However, Twig supports horizontal
10
- :doc:`reuse<use>`.
11
-
12
- Let's define a base template, ``base.html``, which defines a simple HTML
13
- skeleton document:
14
-
15
- .. code-block:: html+twig
16
-
17
- <!DOCTYPE html>
18
- <html>
19
- <head>
20
- {% block head %}
21
- <link rel="stylesheet" href="style.css" />
22
- <title>{% block title %}{% endblock %} - My Webpage</title>
23
- {% endblock %}
24
- </head>
25
- <body>
26
- <div id="content">{% block content %}{% endblock %}</div>
27
- <div id="footer">
28
- {% block footer %}
29
- &copy; Copyright 2011 by <a href="http://domain.invalid/">you</a>.
30
- {% endblock %}
31
- </div>
32
- </body>
33
- </html>
34
-
35
- In this example, the :doc:`block<block>` tags define four blocks that child
36
- templates can fill in.
37
-
38
- All the ``block`` tag does is to tell the template engine that a child
39
- template may override those portions of the template.
40
-
41
- Child Template
42
- --------------
43
-
44
- A child template might look like this:
45
-
46
- .. code-block:: twig
47
-
48
- {% extends "base.html" %}
49
-
50
- {% block title %}Index{% endblock %}
51
- {% block head %}
52
- {{ parent() }}
53
- <style type="text/css">
54
- .important { color: #336699; }
55
- </style>
56
- {% endblock %}
57
- {% block content %}
58
- <h1>Index</h1>
59
- <p class="important">
60
- Welcome on my awesome homepage.
61
- </p>
62
- {% endblock %}
63
-
64
- The ``extends`` tag is the key here. It tells the template engine that this
65
- template "extends" another template. When the template system evaluates this
66
- template, first it locates the parent. The extends tag should be the first tag
67
- in the template.
68
-
69
- Note that since the child template doesn't define the ``footer`` block, the
70
- value from the parent template is used instead.
71
-
72
- You can't define multiple ``block`` tags with the same name in the same
73
- template. This limitation exists because a block tag works in "both"
74
- directions. That is, a block tag doesn't just provide a hole to fill - it also
75
- defines the content that fills the hole in the *parent*. If there were two
76
- similarly-named ``block`` tags in a template, that template's parent wouldn't
77
- know which one of the blocks' content to use.
78
-
79
- If you want to print a block multiple times you can however use the
80
- ``block`` function:
81
-
82
- .. code-block:: twig
83
-
84
- <title>{% block title %}{% endblock %}</title>
85
- <h1>{{ block('title') }}</h1>
86
- {% block body %}{% endblock %}
87
-
88
- Parent Blocks
89
- -------------
90
-
91
- It's possible to render the contents of the parent block by using the
92
- :doc:`parent<../functions/parent>` function. This gives back the results of
93
- the parent block:
94
-
95
- .. code-block:: twig
96
-
97
- {% block sidebar %}
98
- <h3>Table Of Contents</h3>
99
- ...
100
- {{ parent() }}
101
- {% endblock %}
102
-
103
- Named Block End-Tags
104
- --------------------
105
-
106
- Twig allows you to put the name of the block after the end tag for better
107
- readability (the name after the ``endblock`` word must match the block name):
108
-
109
- .. code-block:: twig
110
-
111
- {% block sidebar %}
112
- {% block inner_sidebar %}
113
- ...
114
- {% endblock inner_sidebar %}
115
- {% endblock sidebar %}
116
-
117
- Block Nesting and Scope
118
- -----------------------
119
-
120
- Blocks can be nested for more complex layouts. Per default, blocks have access
121
- to variables from outer scopes:
122
-
123
- .. code-block:: twig
124
-
125
- {% for item in seq %}
126
- <li>{% block loop_item %}{{ item }}{% endblock %}</li>
127
- {% endfor %}
128
-
129
- Block Shortcuts
130
- ---------------
131
-
132
- For blocks with little content, it's possible to use a shortcut syntax. The
133
- following constructs do the same thing:
134
-
135
- .. code-block:: twig
136
-
137
- {% block title %}
138
- {{ page_title|title }}
139
- {% endblock %}
140
-
141
- .. code-block:: twig
142
-
143
- {% block title page_title|title %}
144
-
145
- Dynamic Inheritance
146
- -------------------
147
-
148
- Twig supports dynamic inheritance by using a variable as the base template:
149
-
150
- .. code-block:: twig
151
-
152
- {% extends some_var %}
153
-
154
- If the variable evaluates to a ``\Twig\Template`` or a ``\Twig\TemplateWrapper``
155
- instance, Twig will use it as the parent template::
156
-
157
- // {% extends layout %}
158
-
159
- // deprecated as of Twig 1.28
160
- $layout = $twig->loadTemplate('some_layout_template.twig');
161
-
162
- // as of Twig 1.28
163
- $layout = $twig->load('some_layout_template.twig');
164
-
165
- $twig->display('template.twig', ['layout' => $layout]);
166
-
167
- .. versionadded:: 1.2
168
- The possibility to pass an array of templates has been added in Twig 1.2.
169
-
170
- You can also provide a list of templates that are checked for existence. The
171
- first template that exists will be used as a parent:
172
-
173
- .. code-block:: twig
174
-
175
- {% extends ['layout.html', 'base_layout.html'] %}
176
-
177
- Conditional Inheritance
178
- -----------------------
179
-
180
- As the template name for the parent can be any valid Twig expression, it's
181
- possible to make the inheritance mechanism conditional:
182
-
183
- .. code-block:: twig
184
-
185
- {% extends standalone ? "minimum.html" : "base.html" %}
186
-
187
- In this example, the template will extend the "minimum.html" layout template
188
- if the ``standalone`` variable evaluates to ``true``, and "base.html"
189
- otherwise.
190
-
191
- How do blocks work?
192
- -------------------
193
-
194
- A block provides a way to change how a certain part of a template is rendered
195
- but it does not interfere in any way with the logic around it.
196
-
197
- Let's take the following example to illustrate how a block works and more
198
- importantly, how it does not work:
199
-
200
- .. code-block:: twig
201
-
202
- {# base.twig #}
203
-
204
- {% for post in posts %}
205
- {% block post %}
206
- <h1>{{ post.title }}</h1>
207
- <p>{{ post.body }}</p>
208
- {% endblock %}
209
- {% endfor %}
210
-
211
- If you render this template, the result would be exactly the same with or
212
- without the ``block`` tag. The ``block`` inside the ``for`` loop is just a way
213
- to make it overridable by a child template:
214
-
215
- .. code-block:: twig
216
-
217
- {# child.twig #}
218
-
219
- {% extends "base.twig" %}
220
-
221
- {% block post %}
222
- <article>
223
- <header>{{ post.title }}</header>
224
- <section>{{ post.text }}</section>
225
- </article>
226
- {% endblock %}
227
-
228
- Now, when rendering the child template, the loop is going to use the block
229
- defined in the child template instead of the one defined in the base one; the
230
- executed template is then equivalent to the following one:
231
-
232
- .. code-block:: twig
233
-
234
- {% for post in posts %}
235
- <article>
236
- <header>{{ post.title }}</header>
237
- <section>{{ post.text }}</section>
238
- </article>
239
- {% endfor %}
240
-
241
- Let's take another example: a block included within an ``if`` statement:
242
-
243
- .. code-block:: twig
244
-
245
- {% if posts is empty %}
246
- {% block head %}
247
- {{ parent() }}
248
-
249
- <meta name="robots" content="noindex, follow">
250
- {% endblock head %}
251
- {% endif %}
252
-
253
- Contrary to what you might think, this template does not define a block
254
- conditionally; it just makes overridable by a child template the output of
255
- what will be rendered when the condition is ``true``.
256
-
257
- If you want the output to be displayed conditionally, use the following
258
- instead:
259
-
260
- .. code-block:: twig
261
-
262
- {% block head %}
263
- {{ parent() }}
264
-
265
- {% if posts is empty %}
266
- <meta name="robots" content="noindex, follow">
267
- {% endif %}
268
- {% endblock head %}
269
-
270
- .. seealso:: :doc:`block<../functions/block>`, :doc:`block<../tags/block>`, :doc:`parent<../functions/parent>`, :doc:`use<../tags/use>`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/filter.rst DELETED
@@ -1,26 +0,0 @@
1
- ``filter``
2
- ==========
3
-
4
- .. note::
5
-
6
- As of Twig 1.40, you should use the ``apply`` tag instead which does the
7
- same thing except that the wrapped template data is not scoped.
8
-
9
- Filter sections allow you to apply regular Twig filters on a block of template
10
- data. Just wrap the code in the special ``filter`` section:
11
-
12
- .. code-block:: twig
13
-
14
- {% filter upper %}
15
- This text becomes uppercase
16
- {% endfilter %}
17
-
18
- You can also chain filters and pass arguments to them:
19
-
20
- .. code-block:: twig
21
-
22
- {% filter lower|escape('html') %}
23
- <strong>SOME TEXT</strong>
24
- {% endfilter %}
25
-
26
- {# outputs "&lt;strong&gt;some text&lt;/strong&gt;" #}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/flush.rst DELETED
@@ -1,17 +0,0 @@
1
- ``flush``
2
- =========
3
-
4
- .. versionadded:: 1.5
5
- The flush tag was added in Twig 1.5.
6
-
7
- The ``flush`` tag tells Twig to flush the output buffer:
8
-
9
- .. code-block:: twig
10
-
11
- {% flush %}
12
-
13
- .. note::
14
-
15
- Internally, Twig uses the PHP `flush`_ function.
16
-
17
- .. _`flush`: https://secure.php.net/flush
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/for.rst DELETED
@@ -1,179 +0,0 @@
1
- ``for``
2
- =======
3
-
4
- Loop over each item in a sequence. For example, to display a list of users
5
- provided in a variable called ``users``:
6
-
7
- .. code-block:: twig
8
-
9
- <h1>Members</h1>
10
- <ul>
11
- {% for user in users %}
12
- <li>{{ user.username|e }}</li>
13
- {% endfor %}
14
- </ul>
15
-
16
- .. note::
17
-
18
- A sequence can be either an array or an object implementing the
19
- ``Traversable`` interface.
20
-
21
- If you do need to iterate over a sequence of numbers, you can use the ``..``
22
- operator:
23
-
24
- .. code-block:: twig
25
-
26
- {% for i in 0..10 %}
27
- * {{ i }}
28
- {% endfor %}
29
-
30
- The above snippet of code would print all numbers from 0 to 10.
31
-
32
- It can be also useful with letters:
33
-
34
- .. code-block:: twig
35
-
36
- {% for letter in 'a'..'z' %}
37
- * {{ letter }}
38
- {% endfor %}
39
-
40
- The ``..`` operator can take any expression at both sides:
41
-
42
- .. code-block:: twig
43
-
44
- {% for letter in 'a'|upper..'z'|upper %}
45
- * {{ letter }}
46
- {% endfor %}
47
-
48
- .. tip:
49
-
50
- If you need a step different from 1, you can use the ``range`` function
51
- instead.
52
-
53
- The `loop` variable
54
- -------------------
55
-
56
- Inside of a ``for`` loop block you can access some special variables:
57
-
58
- ===================== =============================================================
59
- Variable Description
60
- ===================== =============================================================
61
- ``loop.index`` The current iteration of the loop. (1 indexed)
62
- ``loop.index0`` The current iteration of the loop. (0 indexed)
63
- ``loop.revindex`` The number of iterations from the end of the loop (1 indexed)
64
- ``loop.revindex0`` The number of iterations from the end of the loop (0 indexed)
65
- ``loop.first`` True if first iteration
66
- ``loop.last`` True if last iteration
67
- ``loop.length`` The number of items in the sequence
68
- ``loop.parent`` The parent context
69
- ===================== =============================================================
70
-
71
- .. code-block:: twig
72
-
73
- {% for user in users %}
74
- {{ loop.index }} - {{ user.username }}
75
- {% endfor %}
76
-
77
- .. note::
78
-
79
- The ``loop.length``, ``loop.revindex``, ``loop.revindex0``, and
80
- ``loop.last`` variables are only available for PHP arrays, or objects that
81
- implement the ``Countable`` interface. They are also not available when
82
- looping with a condition.
83
-
84
- .. versionadded:: 1.2
85
- The ``if`` modifier support has been added in Twig 1.2.
86
-
87
- Adding a condition
88
- ------------------
89
-
90
- .. tip::
91
-
92
- As of Twig 1.41, use the :doc:`filter <../filters/filter>` filter instead,
93
- or an ``if`` condition inside the ``for`` body (if your condition depends on
94
- a variable updated inside the loop and you are not using the ``loop``
95
- variable).
96
-
97
- Unlike in PHP, it's not possible to ``break`` or ``continue`` in a loop. You
98
- can however filter the sequence during iteration which allows you to skip
99
- items. The following example skips all the users which are not active:
100
-
101
- .. code-block:: twig
102
-
103
- <ul>
104
- {% for user in users if user.active %}
105
- <li>{{ user.username|e }}</li>
106
- {% endfor %}
107
- </ul>
108
-
109
- The advantage is that the special loop variable will count correctly thus not
110
- counting the users not iterated over. Keep in mind that properties like
111
- ``loop.last`` will not be defined when using loop conditions.
112
-
113
- .. note::
114
-
115
- Using the ``loop`` variable within the condition is not recommended as it
116
- will probably not be doing what you expect it to. For instance, adding a
117
- condition like ``loop.index > 4`` won't work as the index is only
118
- incremented when the condition is true (so the condition will never
119
- match).
120
-
121
- The `else` Clause
122
- -----------------
123
-
124
- If no iteration took place because the sequence was empty, you can render a
125
- replacement block by using ``else``:
126
-
127
- .. code-block:: twig
128
-
129
- <ul>
130
- {% for user in users %}
131
- <li>{{ user.username|e }}</li>
132
- {% else %}
133
- <li><em>no user found</em></li>
134
- {% endfor %}
135
- </ul>
136
-
137
- Iterating over Keys
138
- -------------------
139
-
140
- By default, a loop iterates over the values of the sequence. You can iterate
141
- on keys by using the ``keys`` filter:
142
-
143
- .. code-block:: twig
144
-
145
- <h1>Members</h1>
146
- <ul>
147
- {% for key in users|keys %}
148
- <li>{{ key }}</li>
149
- {% endfor %}
150
- </ul>
151
-
152
- Iterating over Keys and Values
153
- ------------------------------
154
-
155
- You can also access both keys and values:
156
-
157
- .. code-block:: twig
158
-
159
- <h1>Members</h1>
160
- <ul>
161
- {% for key, user in users %}
162
- <li>{{ key }}: {{ user.username|e }}</li>
163
- {% endfor %}
164
- </ul>
165
-
166
- Iterating over a Subset
167
- -----------------------
168
-
169
- You might want to iterate over a subset of values. This can be achieved using
170
- the :doc:`slice <../filters/slice>` filter:
171
-
172
- .. code-block:: twig
173
-
174
- <h1>Top Ten Members</h1>
175
- <ul>
176
- {% for user in users|slice(0, 10) %}
177
- <li>{{ user.username|e }}</li>
178
- {% endfor %}
179
- </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/from.rst DELETED
@@ -1,6 +0,0 @@
1
- ``from``
2
- ========
3
-
4
- The ``from`` tag imports :doc:`macro<../tags/macro>` names into the current
5
- namespace. The tag is documented in detail in the documentation for the
6
- :doc:`macro<../tags/macro>` tag.
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/if.rst DELETED
@@ -1,79 +0,0 @@
1
- ``if``
2
- ======
3
-
4
- The ``if`` statement in Twig is comparable with the if statements of PHP.
5
-
6
- In the simplest form you can use it to test if an expression evaluates to
7
- ``true``:
8
-
9
- .. code-block:: twig
10
-
11
- {% if online == false %}
12
- <p>Our website is in maintenance mode. Please, come back later.</p>
13
- {% endif %}
14
-
15
- You can also test if an array is not empty:
16
-
17
- .. code-block:: twig
18
-
19
- {% if users %}
20
- <ul>
21
- {% for user in users %}
22
- <li>{{ user.username|e }}</li>
23
- {% endfor %}
24
- </ul>
25
- {% endif %}
26
-
27
- .. note::
28
-
29
- If you want to test if the variable is defined, use ``if users is
30
- defined`` instead.
31
-
32
- You can also use ``not`` to check for values that evaluate to ``false``:
33
-
34
- .. code-block:: twig
35
-
36
- {% if not user.subscribed %}
37
- <p>You are not subscribed to our mailing list.</p>
38
- {% endif %}
39
-
40
- For multiple conditions, ``and`` and ``or`` can be used:
41
-
42
- .. code-block:: twig
43
-
44
- {% if temperature > 18 and temperature < 27 %}
45
- <p>It's a nice day for a walk in the park.</p>
46
- {% endif %}
47
-
48
- For multiple branches ``elseif`` and ``else`` can be used like in PHP. You can
49
- use more complex ``expressions`` there too:
50
-
51
- .. code-block:: twig
52
-
53
- {% if product.stock > 10 %}
54
- Available
55
- {% elseif product.stock > 0 %}
56
- Only {{ product.stock }} left!
57
- {% else %}
58
- Sold-out!
59
- {% endif %}
60
-
61
- .. note::
62
-
63
- The rules to determine if an expression is ``true`` or ``false`` are the
64
- same as in PHP; here are the edge cases rules:
65
-
66
- ====================== ====================
67
- Value Boolean evaluation
68
- ====================== ====================
69
- empty string false
70
- numeric zero false
71
- NAN (Not A Number) true
72
- INF (Infinity) true
73
- whitespace-only string true
74
- string "0" or '0' false
75
- empty array false
76
- null false
77
- non-empty array true
78
- object true
79
- ====================== ====================
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/import.rst DELETED
@@ -1,6 +0,0 @@
1
- ``import``
2
- ==========
3
-
4
- The ``import`` tag imports :doc:`macro<../tags/macro>` names in a local
5
- variable. The tag is documented in detail in the documentation for the
6
- :doc:`macro<../tags/macro>` tag.
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/include.rst DELETED
@@ -1,114 +0,0 @@
1
- ``include``
2
- ===========
3
-
4
- The ``include`` statement includes a template and returns the rendered content
5
- of that file:
6
-
7
- .. code-block:: twig
8
-
9
- {% include 'header.html' %}
10
- Body
11
- {% include 'footer.html' %}
12
-
13
- .. note::
14
-
15
- As of Twig 1.12, it is recommended to use the
16
- :doc:`include<../functions/include>` function instead as it provides the
17
- same features with a bit more flexibility:
18
-
19
- * The ``include`` function is semantically more "correct" (including a
20
- template outputs its rendered contents in the current scope; a tag should
21
- not display anything);
22
-
23
- * It's easier to store the rendered template in a variable when using
24
- the ``include`` function:
25
-
26
- .. code-block:: twig
27
-
28
- {% set content %}{% include 'template.html' %}{% endset %}
29
-
30
- {# vs #}
31
-
32
- {% set content = include('template.html') %}
33
-
34
- * The ``include`` function does not impose any specific order for
35
- arguments thanks to :ref:`named arguments <named-arguments>`.
36
-
37
- Included templates have access to the variables of the active context.
38
-
39
- If you are using the filesystem loader, the templates are looked for in the
40
- paths defined by it.
41
-
42
- You can add additional variables by passing them after the ``with`` keyword:
43
-
44
- .. code-block:: twig
45
-
46
- {# template.html will have access to the variables from the current context and the additional ones provided #}
47
- {% include 'template.html' with {'foo': 'bar'} %}
48
-
49
- {% set vars = {'foo': 'bar'} %}
50
- {% include 'template.html' with vars %}
51
-
52
- You can disable access to the context by appending the ``only`` keyword:
53
-
54
- .. code-block:: twig
55
-
56
- {# only the foo variable will be accessible #}
57
- {% include 'template.html' with {'foo': 'bar'} only %}
58
-
59
- .. code-block:: twig
60
-
61
- {# no variables will be accessible #}
62
- {% include 'template.html' only %}
63
-
64
- .. tip::
65
-
66
- When including a template created by an end user, you should consider
67
- sandboxing it. More information in the :doc:`Twig for Developers<../api>`
68
- chapter and in the :doc:`sandbox<../tags/sandbox>` tag documentation.
69
-
70
- The template name can be any valid Twig expression:
71
-
72
- .. code-block:: twig
73
-
74
- {% include some_var %}
75
- {% include ajax ? 'ajax.html' : 'not_ajax.html' %}
76
-
77
- And if the expression evaluates to a ``\Twig\Template`` or a
78
- ``\Twig\TemplateWrapper`` instance, Twig will use it directly::
79
-
80
- // {% include template %}
81
-
82
- // deprecated as of Twig 1.28
83
- $template = $twig->loadTemplate('some_template.twig');
84
-
85
- // as of Twig 1.28
86
- $template = $twig->load('some_template.twig');
87
-
88
- $twig->display('template.twig', ['template' => $template]);
89
-
90
- .. versionadded:: 1.2
91
- The ``ignore missing`` feature has been added in Twig 1.2.
92
-
93
- You can mark an include with ``ignore missing`` in which case Twig will ignore
94
- the statement if the template to be included does not exist. It has to be
95
- placed just after the template name. Here some valid examples:
96
-
97
- .. code-block:: twig
98
-
99
- {% include 'sidebar.html' ignore missing %}
100
- {% include 'sidebar.html' ignore missing with {'foo': 'bar'} %}
101
- {% include 'sidebar.html' ignore missing only %}
102
-
103
- .. versionadded:: 1.2
104
- The possibility to pass an array of templates has been added in Twig 1.2.
105
-
106
- You can also provide a list of templates that are checked for existence before
107
- inclusion. The first template that exists will be included:
108
-
109
- .. code-block:: twig
110
-
111
- {% include ['page_detailed.html', 'page.html'] %}
112
-
113
- If ``ignore missing`` is given, it will fall back to rendering nothing if none
114
- of the templates exist, otherwise it will throw an exception.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/index.rst DELETED
@@ -1,27 +0,0 @@
1
- Tags
2
- ====
3
-
4
- .. toctree::
5
- :maxdepth: 1
6
-
7
- apply
8
- autoescape
9
- block
10
- deprecated
11
- do
12
- embed
13
- extends
14
- filter
15
- flush
16
- for
17
- from
18
- if
19
- import
20
- include
21
- macro
22
- sandbox
23
- set
24
- spaceless
25
- use
26
- verbatim
27
- with
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/macro.rst DELETED
@@ -1,139 +0,0 @@
1
- ``macro``
2
- =========
3
-
4
- .. versionadded:: 1.12
5
-
6
- The possibility to define default values for arguments in the macro
7
- signature was added in Twig 1.12.
8
-
9
- Macros are comparable with functions in regular programming languages. They
10
- are useful to reuse template fragments to not repeat yourself.
11
-
12
- Macros are defined in regular templates.
13
-
14
- Imagine having a generic helper template that define how to render HTML forms
15
- via macros (called ``forms.html``):
16
-
17
- .. code-block:: twig
18
-
19
- {% macro input(name, value, type = "text", size = 20) %}
20
- <input type="{{ type }}" name="{{ name }}" value="{{ value|e }}" size="{{ size }}" />
21
- {% endmacro %}
22
-
23
- {% macro textarea(name, value, rows = 10, cols = 40) %}
24
- <textarea name="{{ name }}" rows="{{ rows }}" cols="{{ cols }}">{{ value|e }}</textarea>
25
- {% endmacro %}
26
-
27
- Each macro argument can have a default value (here ``text`` is the default value
28
- for ``type`` if not provided in the call).
29
-
30
- .. note::
31
-
32
- Before Twig 1.12, defining default argument values was done via the
33
- ``default`` filter in the macro body:
34
-
35
- .. code-block:: twig
36
-
37
- {% macro input(name, value, type, size) %}
38
- <input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value|e }}" size="{{ size|default(20) }}" />
39
- {% endmacro %}
40
-
41
- Macros differ from native PHP functions in a few ways:
42
-
43
- * Arguments of a macro are always optional.
44
-
45
- * If extra positional arguments are passed to a macro, they end up in the
46
- special ``varargs`` variable as a list of values.
47
-
48
- But as with PHP functions, macros don't have access to the current template
49
- variables.
50
-
51
- .. tip::
52
-
53
- You can pass the whole context as an argument by using the special
54
- ``_context`` variable.
55
-
56
- Import
57
- ------
58
-
59
- There are two ways to import macros. You can import the complete template
60
- containing the macros into a local variable (via the ``import`` tag) or only
61
- import specific macros from the template (via the ``from`` tag).
62
-
63
- To import all macros from a template into a local variable, use the ``import``
64
- tag:
65
-
66
- .. code-block:: twig
67
-
68
- {% import "forms.html" as forms %}
69
-
70
- The above ``import`` call imports the ``forms.html`` file (which can contain
71
- only macros, or a template and some macros), and import the macros as items of
72
- the ``forms`` local variable.
73
-
74
- The macros can then be called at will in the *current* template:
75
-
76
- .. code-block:: twig
77
-
78
- <p>{{ forms.input('username') }}</p>
79
- <p>{{ forms.input('password', null, 'password') }}</p>
80
-
81
- When you want to use a macro in another macro from the same file, you need to
82
- import it locally:
83
-
84
- .. code-block:: twig
85
-
86
- {% macro input(name, value, type, size) %}
87
- <input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value|e }}" size="{{ size|default(20) }}" />
88
- {% endmacro %}
89
-
90
- {% macro wrapped_input(name, value, type, size) %}
91
- {% import _self as forms %}
92
-
93
- <div class="field">
94
- {{ forms.input(name, value, type, size) }}
95
- </div>
96
- {% endmacro %}
97
-
98
- Alternatively you can import names from the template into the current namespace
99
- via the ``from`` tag:
100
-
101
- .. code-block:: twig
102
-
103
- {% from 'forms.html' import input as input_field, textarea %}
104
-
105
- <p>{{ input_field('password', '', 'password') }}</p>
106
- <p>{{ textarea('comment') }}</p>
107
-
108
- .. note::
109
-
110
- Importing macros using ``import`` or ``from`` is **local** to the current
111
- file. The imported macros are not available in included templates or child
112
- templates; you need to explicitly re-import macros in each file.
113
-
114
- .. tip::
115
-
116
- To import macros from the current file, use the special ``_self`` variable:
117
-
118
- .. code-block:: twig
119
-
120
- {% import _self as forms %}
121
-
122
- <p>{{ forms.input('username') }}</p>
123
-
124
- When you define a macro in the template where you are going to use it, you
125
- might be tempted to call the macro directly via ``_self.input()`` instead of
126
- importing it; even if it seems to work, this is just a side-effect of the
127
- current implementation and it won't work anymore in Twig 2.x.
128
-
129
- Named Macro End-Tags
130
- --------------------
131
-
132
- Twig allows you to put the name of the macro after the end tag for better
133
- readability (the name after the ``endmacro`` word must match the macro name):
134
-
135
- .. code-block:: twig
136
-
137
- {% macro input() %}
138
- ...
139
- {% endmacro input %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/sandbox.rst DELETED
@@ -1,30 +0,0 @@
1
- ``sandbox``
2
- ===========
3
-
4
- The ``sandbox`` tag can be used to enable the sandboxing mode for an included
5
- template, when sandboxing is not enabled globally for the Twig environment:
6
-
7
- .. code-block:: twig
8
-
9
- {% sandbox %}
10
- {% include 'user.html' %}
11
- {% endsandbox %}
12
-
13
- .. warning::
14
-
15
- The ``sandbox`` tag is only available when the sandbox extension is
16
- enabled (see the :doc:`Twig for Developers<../api>` chapter).
17
-
18
- .. note::
19
-
20
- The ``sandbox`` tag can only be used to sandbox an include tag and it
21
- cannot be used to sandbox a section of a template. The following example
22
- won't work:
23
-
24
- .. code-block:: twig
25
-
26
- {% sandbox %}
27
- {% for i in 1..2 %}
28
- {{ i }}
29
- {% endfor %}
30
- {% endsandbox %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/set.rst DELETED
@@ -1,78 +0,0 @@
1
- ``set``
2
- =======
3
-
4
- Inside code blocks you can also assign values to variables. Assignments use
5
- the ``set`` tag and can have multiple targets.
6
-
7
- Here is how you can assign the ``bar`` value to the ``foo`` variable:
8
-
9
- .. code-block:: twig
10
-
11
- {% set foo = 'bar' %}
12
-
13
- After the ``set`` call, the ``foo`` variable is available in the template like
14
- any other ones:
15
-
16
- .. code-block:: twig
17
-
18
- {# displays bar #}
19
- {{ foo }}
20
-
21
- The assigned value can be any valid :ref:`Twig expression
22
- <twig-expressions>`:
23
-
24
- .. code-block:: twig
25
-
26
- {% set foo = [1, 2] %}
27
- {% set foo = {'foo': 'bar'} %}
28
- {% set foo = 'foo' ~ 'bar' %}
29
-
30
- Several variables can be assigned in one block:
31
-
32
- .. code-block:: twig
33
-
34
- {% set foo, bar = 'foo', 'bar' %}
35
-
36
- {# is equivalent to #}
37
-
38
- {% set foo = 'foo' %}
39
- {% set bar = 'bar' %}
40
-
41
- The ``set`` tag can also be used to 'capture' chunks of text:
42
-
43
- .. code-block:: twig
44
-
45
- {% set foo %}
46
- <div id="pagination">
47
- ...
48
- </div>
49
- {% endset %}
50
-
51
- .. caution::
52
-
53
- If you enable automatic output escaping, Twig will only consider the
54
- content to be safe when capturing chunks of text.
55
-
56
- .. note::
57
-
58
- Note that loops are scoped in Twig; therefore a variable declared inside a
59
- ``for`` loop is not accessible outside the loop itself:
60
-
61
- .. code-block:: twig
62
-
63
- {% for item in list %}
64
- {% set foo = item %}
65
- {% endfor %}
66
-
67
- {# foo is NOT available #}
68
-
69
- If you want to access the variable, just declare it before the loop:
70
-
71
- .. code-block:: twig
72
-
73
- {% set foo = "" %}
74
- {% for item in list %}
75
- {% set foo = item %}
76
- {% endfor %}
77
-
78
- {# foo is available #}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/spaceless.rst DELETED
@@ -1,41 +0,0 @@
1
- ``spaceless``
2
- =============
3
-
4
- .. tip::
5
-
6
- As of Twig 1.38, use the :doc:`spaceless <../filters/spaceless>` filter instead.
7
-
8
- Use the ``spaceless`` tag to remove whitespace *between HTML tags*, not
9
- whitespace within HTML tags or whitespace in plain text:
10
-
11
- .. code-block:: twig
12
-
13
- {% spaceless %}
14
- <div>
15
- <strong>foo</strong>
16
- </div>
17
- {% endspaceless %}
18
-
19
- {# output will be <div><strong>foo</strong></div> #}
20
-
21
- This tag is not meant to "optimize" the size of the generated HTML content but
22
- merely to avoid extra whitespace between HTML tags to avoid browser rendering
23
- quirks under some circumstances.
24
-
25
- .. tip::
26
-
27
- If you want to optimize the size of the generated HTML content, gzip
28
- compress the output instead.
29
-
30
- .. tip::
31
-
32
- If you want to create a tag that actually removes all extra whitespace in
33
- an HTML string, be warned that this is not as easy as it seems to be
34
- (think of ``textarea`` or ``pre`` tags for instance). Using a third-party
35
- library like Tidy is probably a better idea.
36
-
37
- .. tip::
38
-
39
- For more information on whitespace control, read the
40
- :ref:`dedicated section <templates-whitespace-control>` of the documentation and learn how
41
- you can also use the whitespace control modifier on your tags.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/use.rst DELETED
@@ -1,124 +0,0 @@
1
- ``use``
2
- =======
3
-
4
- .. versionadded:: 1.1
5
- Horizontal reuse was added in Twig 1.1.
6
-
7
- .. note::
8
-
9
- Horizontal reuse is an advanced Twig feature that is hardly ever needed in
10
- regular templates. It is mainly used by projects that need to make
11
- template blocks reusable without using inheritance.
12
-
13
- Template inheritance is one of the most powerful features of Twig but it is
14
- limited to single inheritance; a template can only extend one other template.
15
- This limitation makes template inheritance simple to understand and easy to
16
- debug:
17
-
18
- .. code-block:: twig
19
-
20
- {% extends "base.html" %}
21
-
22
- {% block title %}{% endblock %}
23
- {% block content %}{% endblock %}
24
-
25
- Horizontal reuse is a way to achieve the same goal as multiple inheritance,
26
- but without the associated complexity:
27
-
28
- .. code-block:: twig
29
-
30
- {% extends "base.html" %}
31
-
32
- {% use "blocks.html" %}
33
-
34
- {% block title %}{% endblock %}
35
- {% block content %}{% endblock %}
36
-
37
- The ``use`` statement tells Twig to import the blocks defined in
38
- ``blocks.html`` into the current template (it's like macros, but for blocks):
39
-
40
- .. code-block:: twig
41
-
42
- {# blocks.html #}
43
-
44
- {% block sidebar %}{% endblock %}
45
-
46
- In this example, the ``use`` statement imports the ``sidebar`` block into the
47
- main template. The code is mostly equivalent to the following one (the
48
- imported blocks are not outputted automatically):
49
-
50
- .. code-block:: twig
51
-
52
- {% extends "base.html" %}
53
-
54
- {% block sidebar %}{% endblock %}
55
- {% block title %}{% endblock %}
56
- {% block content %}{% endblock %}
57
-
58
- .. note::
59
-
60
- The ``use`` tag only imports a template if it does not extend another
61
- template, if it does not define macros, and if the body is empty. But it
62
- can *use* other templates.
63
-
64
- .. note::
65
-
66
- Because ``use`` statements are resolved independently of the context
67
- passed to the template, the template reference cannot be an expression.
68
-
69
- The main template can also override any imported block. If the template
70
- already defines the ``sidebar`` block, then the one defined in ``blocks.html``
71
- is ignored. To avoid name conflicts, you can rename imported blocks:
72
-
73
- .. code-block:: twig
74
-
75
- {% extends "base.html" %}
76
-
77
- {% use "blocks.html" with sidebar as base_sidebar, title as base_title %}
78
-
79
- {% block sidebar %}{% endblock %}
80
- {% block title %}{% endblock %}
81
- {% block content %}{% endblock %}
82
-
83
- .. versionadded:: 1.3
84
- The ``parent()`` support was added in Twig 1.3.
85
-
86
- The ``parent()`` function automatically determines the correct inheritance
87
- tree, so it can be used when overriding a block defined in an imported
88
- template:
89
-
90
- .. code-block:: twig
91
-
92
- {% extends "base.html" %}
93
-
94
- {% use "blocks.html" %}
95
-
96
- {% block sidebar %}
97
- {{ parent() }}
98
- {% endblock %}
99
-
100
- {% block title %}{% endblock %}
101
- {% block content %}{% endblock %}
102
-
103
- In this example, ``parent()`` will correctly call the ``sidebar`` block from
104
- the ``blocks.html`` template.
105
-
106
- .. tip::
107
-
108
- In Twig 1.2, renaming allows you to simulate inheritance by calling the
109
- "parent" block:
110
-
111
- .. code-block:: twig
112
-
113
- {% extends "base.html" %}
114
-
115
- {% use "blocks.html" with sidebar as parent_sidebar %}
116
-
117
- {% block sidebar %}
118
- {{ block('parent_sidebar') }}
119
- {% endblock %}
120
-
121
- .. note::
122
-
123
- You can use as many ``use`` statements as you want in any given template.
124
- If two imported templates define the same block, the latest one wins.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/verbatim.rst DELETED
@@ -1,24 +0,0 @@
1
- ``verbatim``
2
- ============
3
-
4
- .. versionadded:: 1.12
5
- The ``verbatim`` tag was added in Twig 1.12 (it was named ``raw`` before).
6
-
7
- The ``verbatim`` tag marks sections as being raw text that should not be
8
- parsed. For example to put Twig syntax as example into a template you can use
9
- this snippet:
10
-
11
- .. code-block:: twig
12
-
13
- {% verbatim %}
14
- <ul>
15
- {% for item in seq %}
16
- <li>{{ item }}</li>
17
- {% endfor %}
18
- </ul>
19
- {% endverbatim %}
20
-
21
- .. note::
22
-
23
- The ``verbatim`` tag works in the exact same way as the old ``raw`` tag,
24
- but was renamed to avoid confusion with the ``raw`` filter.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tags/with.rst DELETED
@@ -1,44 +0,0 @@
1
- ``with``
2
- ========
3
-
4
- .. versionadded:: 1.28
5
- The ``with`` tag was added in Twig 1.28.
6
-
7
- Use the ``with`` tag to create a new inner scope. Variables set within this
8
- scope are not visible outside of the scope:
9
-
10
- .. code-block:: twig
11
-
12
- {% with %}
13
- {% set foo = 42 %}
14
- {{ foo }} foo is 42 here
15
- {% endwith %}
16
- foo is not visible here any longer
17
-
18
- Instead of defining variables at the beginning of the scope, you can pass a
19
- hash of variables you want to define in the ``with`` tag; the previous example
20
- is equivalent to the following one:
21
-
22
- .. code-block:: twig
23
-
24
- {% with { foo: 42 } %}
25
- {{ foo }} foo is 42 here
26
- {% endwith %}
27
- foo is not visible here any longer
28
-
29
- {# it works with any expression that resolves to a hash #}
30
- {% set vars = { foo: 42 } %}
31
- {% with vars %}
32
- ...
33
- {% endwith %}
34
-
35
- By default, the inner scope has access to the outer scope context; you can
36
- disable this behavior by appending the ``only`` keyword:
37
-
38
- .. code-block:: twig
39
-
40
- {% set bar = 'bar' %}
41
- {% with { foo: 42 } only %}
42
- {# only foo is defined #}
43
- {# bar is not defined #}
44
- {% endwith %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/templates.rst DELETED
@@ -1,888 +0,0 @@
1
- Twig for Template Designers
2
- ===========================
3
-
4
- This document describes the syntax and semantics of the template engine and
5
- will be most useful as reference to those creating Twig templates.
6
-
7
- Synopsis
8
- --------
9
-
10
- A template is a regular text file. It can generate any text-based format (HTML,
11
- XML, CSV, LaTeX, etc.). It doesn't have a specific extension, ``.html`` or
12
- ``.xml`` are just fine.
13
-
14
- A template contains **variables** or **expressions**, which get replaced with
15
- values when the template is evaluated, and **tags**, which control the
16
- template's logic.
17
-
18
- Below is a minimal template that illustrates a few basics. We will cover further
19
- details later on:
20
-
21
- .. code-block:: html+twig
22
-
23
- <!DOCTYPE html>
24
- <html>
25
- <head>
26
- <title>My Webpage</title>
27
- </head>
28
- <body>
29
- <ul id="navigation">
30
- {% for item in navigation %}
31
- <li><a href="{{ item.href }}">{{ item.caption }}</a></li>
32
- {% endfor %}
33
- </ul>
34
-
35
- <h1>My Webpage</h1>
36
- {{ a_variable }}
37
- </body>
38
- </html>
39
-
40
- There are two kinds of delimiters: ``{% ... %}`` and ``{{ ... }}``. The first
41
- one is used to execute statements such as for-loops, the latter outputs the
42
- result of an expression.
43
-
44
- IDEs Integration
45
- ----------------
46
-
47
- Many IDEs support syntax highlighting and auto-completion for Twig:
48
-
49
- * *Textmate* via the `Twig bundle`_
50
- * *Vim* via the `Jinja syntax plugin`_ or the `vim-twig plugin`_
51
- * *Netbeans* via the `Twig syntax plugin`_ (until 7.1, native as of 7.2)
52
- * *PhpStorm* (native as of 2.1)
53
- * *Eclipse* via the `Twig plugin`_
54
- * *Sublime Text* via the `Twig bundle`_
55
- * *GtkSourceView* via the `Twig language definition`_ (used by gedit and other projects)
56
- * *Coda* and *SubEthaEdit* via the `Twig syntax mode`_
57
- * *Coda 2* via the `other Twig syntax mode`_
58
- * *Komodo* and *Komodo Edit* via the Twig highlight/syntax check mode
59
- * *Notepad++* via the `Notepad++ Twig Highlighter`_
60
- * *Emacs* via `web-mode.el`_
61
- * *Atom* via the `PHP-twig for atom`_
62
- * *Visual Studio Code* via the `Twig pack`_
63
-
64
- Also, `TwigFiddle`_ is an online service that allows you to execute Twig templates
65
- from a browser; it supports all versions of Twig.
66
-
67
- Variables
68
- ---------
69
-
70
- The application passes variables to the templates for manipulation in the
71
- template. Variables may have attributes or elements you can access, too. The
72
- visual representation of a variable depends heavily on the application providing
73
- it.
74
-
75
- Use a dot (``.``) to access attributes of a variable (methods or properties of a
76
- PHP object, or items of a PHP array):
77
-
78
- .. code-block:: twig
79
-
80
- {{ foo.bar }}
81
-
82
- .. note::
83
-
84
- It's important to know that the curly braces are *not* part of the
85
- variable but the print statement. When accessing variables inside tags,
86
- don't put the braces around them.
87
-
88
- .. sidebar:: Implementation
89
-
90
- For convenience's sake ``foo.bar`` does the following things on the PHP
91
- layer:
92
-
93
- * check if ``foo`` is an array and ``bar`` a valid element;
94
- * if not, and if ``foo`` is an object, check that ``bar`` is a valid property;
95
- * if not, and if ``foo`` is an object, check that ``bar`` is a valid method
96
- (even if ``bar`` is the constructor - use ``__construct()`` instead);
97
- * if not, and if ``foo`` is an object, check that ``getBar`` is a valid method;
98
- * if not, and if ``foo`` is an object, check that ``isBar`` is a valid method;
99
- * if not, return a ``null`` value.
100
-
101
- Twig also supports a specific syntax for accessing items on PHP arrays,
102
- ``foo['bar']``:
103
-
104
- * check if ``foo`` is an array and ``bar`` a valid element;
105
- * if not, return a ``null`` value.
106
-
107
- If a variable or attribute does not exist, you will receive a ``null`` value
108
- when the ``strict_variables`` option is set to ``false``; alternatively, if ``strict_variables``
109
- is set, Twig will throw an error (see :ref:`environment options<environment_options>`).
110
-
111
- .. note::
112
-
113
- If you want to access a dynamic attribute of a variable, use the
114
- :doc:`attribute<functions/attribute>` function instead.
115
-
116
- The ``attribute`` function is also useful when the attribute contains
117
- special characters (like ``-`` that would be interpreted as the minus
118
- operator):
119
-
120
- .. code-block:: twig
121
-
122
- {# equivalent to the non-working foo.data-foo #}
123
- {{ attribute(foo, 'data-foo') }}
124
-
125
- Global Variables
126
- ~~~~~~~~~~~~~~~~
127
-
128
- The following variables are always available in templates:
129
-
130
- * ``_self``: references the current template;
131
- * ``_context``: references the current context;
132
- * ``_charset``: references the current charset.
133
-
134
- Setting Variables
135
- ~~~~~~~~~~~~~~~~~
136
-
137
- You can assign values to variables inside code blocks. Assignments use the
138
- :doc:`set<tags/set>` tag:
139
-
140
- .. code-block:: twig
141
-
142
- {% set foo = 'foo' %}
143
- {% set foo = [1, 2] %}
144
- {% set foo = {'foo': 'bar'} %}
145
-
146
- Filters
147
- -------
148
-
149
- Variables can be modified by **filters**. Filters are separated from the
150
- variable by a pipe symbol (``|``). Multiple filters can be chained. The output
151
- of one filter is applied to the next.
152
-
153
- The following example removes all HTML tags from the ``name`` and title-cases
154
- it:
155
-
156
- .. code-block:: twig
157
-
158
- {{ name|striptags|title }}
159
-
160
- Filters that accept arguments have parentheses around the arguments. This
161
- example joins the elements of a list by commas:
162
-
163
- .. code-block:: twig
164
-
165
- {{ list|join(', ') }}
166
-
167
- To apply a filter on a section of code, wrap it with the
168
- :doc:`apply<tags/apply>` tag:
169
-
170
- .. code-block:: twig
171
-
172
- {% apply upper %}
173
- This text becomes uppercase
174
- {% endapply %}
175
-
176
- Go to the :doc:`filters<filters/index>` page to learn more about built-in
177
- filters.
178
-
179
- .. note::
180
-
181
- The ``apply`` tag was introduced in Twig 1.40; use the ``filter`` tag with
182
- previous versions.
183
-
184
- Functions
185
- ---------
186
-
187
- Functions can be called to generate content. Functions are called by their
188
- name followed by parentheses (``()``) and may have arguments.
189
-
190
- For instance, the ``range`` function returns a list containing an arithmetic
191
- progression of integers:
192
-
193
- .. code-block:: twig
194
-
195
- {% for i in range(0, 3) %}
196
- {{ i }},
197
- {% endfor %}
198
-
199
- Go to the :doc:`functions<functions/index>` page to learn more about the
200
- built-in functions.
201
-
202
- .. _named-arguments:
203
-
204
- Named Arguments
205
- ---------------
206
-
207
- .. versionadded:: 1.12
208
- Support for named arguments was added in Twig 1.12.
209
-
210
- .. code-block:: twig
211
-
212
- {% for i in range(low=1, high=10, step=2) %}
213
- {{ i }},
214
- {% endfor %}
215
-
216
- Using named arguments makes your templates more explicit about the meaning of
217
- the values you pass as arguments:
218
-
219
- .. code-block:: twig
220
-
221
- {{ data|convert_encoding('UTF-8', 'iso-2022-jp') }}
222
-
223
- {# versus #}
224
-
225
- {{ data|convert_encoding(from='iso-2022-jp', to='UTF-8') }}
226
-
227
- Named arguments also allow you to skip some arguments for which you don't want
228
- to change the default value:
229
-
230
- .. code-block:: twig
231
-
232
- {# the first argument is the date format, which defaults to the global date format if null is passed #}
233
- {{ "now"|date(null, "Europe/Paris") }}
234
-
235
- {# or skip the format value by using a named argument for the time zone #}
236
- {{ "now"|date(timezone="Europe/Paris") }}
237
-
238
- You can also use both positional and named arguments in one call, in which
239
- case positional arguments must always come before named arguments:
240
-
241
- .. code-block:: twig
242
-
243
- {{ "now"|date('d/m/Y H:i', timezone="Europe/Paris") }}
244
-
245
- .. tip::
246
-
247
- Each function and filter documentation page has a section where the names
248
- of all arguments are listed when supported.
249
-
250
- Control Structure
251
- -----------------
252
-
253
- A control structure refers to all those things that control the flow of a
254
- program - conditionals (i.e. ``if``/``elseif``/``else``), ``for``-loops, as
255
- well as things like blocks. Control structures appear inside ``{% ... %}``
256
- blocks.
257
-
258
- For example, to display a list of users provided in a variable called
259
- ``users``, use the :doc:`for<tags/for>` tag:
260
-
261
- .. code-block:: twig
262
-
263
- <h1>Members</h1>
264
- <ul>
265
- {% for user in users %}
266
- <li>{{ user.username|e }}</li>
267
- {% endfor %}
268
- </ul>
269
-
270
- The :doc:`if<tags/if>` tag can be used to test an expression:
271
-
272
- .. code-block:: twig
273
-
274
- {% if users|length > 0 %}
275
- <ul>
276
- {% for user in users %}
277
- <li>{{ user.username|e }}</li>
278
- {% endfor %}
279
- </ul>
280
- {% endif %}
281
-
282
- Go to the :doc:`tags<tags/index>` page to learn more about the built-in tags.
283
-
284
- Comments
285
- --------
286
-
287
- To comment-out part of a line in a template, use the comment syntax ``{# ...
288
- #}``. This is useful for debugging or to add information for other template
289
- designers or yourself:
290
-
291
- .. code-block:: twig
292
-
293
- {# note: disabled template because we no longer use this
294
- {% for user in users %}
295
- ...
296
- {% endfor %}
297
- #}
298
-
299
- Including other Templates
300
- -------------------------
301
-
302
- The :doc:`include<functions/include>` function is useful to include a template
303
- and return the rendered content of that template into the current one:
304
-
305
- .. code-block:: twig
306
-
307
- {{ include('sidebar.html') }}
308
-
309
- By default, included templates have access to the same context as the template
310
- which includes them. This means that any variable defined in the main template
311
- will be available in the included template too:
312
-
313
- .. code-block:: twig
314
-
315
- {% for box in boxes %}
316
- {{ include('render_box.html') }}
317
- {% endfor %}
318
-
319
- The included template ``render_box.html`` is able to access the ``box`` variable.
320
-
321
- The name of the template depends on the template loader. For instance, the
322
- ``\Twig\Loader\FilesystemLoader`` allows you to access other templates by giving the
323
- filename. You can access templates in subdirectories with a slash:
324
-
325
- .. code-block:: twig
326
-
327
- {{ include('sections/articles/sidebar.html') }}
328
-
329
- This behavior depends on the application embedding Twig.
330
-
331
- Template Inheritance
332
- --------------------
333
-
334
- The most powerful part of Twig is template inheritance. Template inheritance
335
- allows you to build a base "skeleton" template that contains all the common
336
- elements of your site and defines **blocks** that child templates can
337
- override.
338
-
339
- It's easier to understand the concept by starting with an example.
340
-
341
- Let's define a base template, ``base.html``, which defines an HTML skeleton
342
- document that might be used for a two-column page:
343
-
344
- .. code-block:: html+twig
345
-
346
- <!DOCTYPE html>
347
- <html>
348
- <head>
349
- {% block head %}
350
- <link rel="stylesheet" href="style.css" />
351
- <title>{% block title %}{% endblock %} - My Webpage</title>
352
- {% endblock %}
353
- </head>
354
- <body>
355
- <div id="content">{% block content %}{% endblock %}</div>
356
- <div id="footer">
357
- {% block footer %}
358
- &copy; Copyright 2011 by <a href="http://domain.invalid/">you</a>.
359
- {% endblock %}
360
- </div>
361
- </body>
362
- </html>
363
-
364
- In this example, the :doc:`block<tags/block>` tags define four blocks that
365
- child templates can fill in. All the ``block`` tag does is to tell the
366
- template engine that a child template may override those portions of the
367
- template.
368
-
369
- A child template might look like this:
370
-
371
- .. code-block:: twig
372
-
373
- {% extends "base.html" %}
374
-
375
- {% block title %}Index{% endblock %}
376
- {% block head %}
377
- {{ parent() }}
378
- <style type="text/css">
379
- .important { color: #336699; }
380
- </style>
381
- {% endblock %}
382
- {% block content %}
383
- <h1>Index</h1>
384
- <p class="important">
385
- Welcome to my awesome homepage.
386
- </p>
387
- {% endblock %}
388
-
389
- The :doc:`extends<tags/extends>` tag is the key here. It tells the template
390
- engine that this template "extends" another template. When the template system
391
- evaluates this template, first it locates the parent. The extends tag should
392
- be the first tag in the template.
393
-
394
- Note that since the child template doesn't define the ``footer`` block, the
395
- value from the parent template is used instead.
396
-
397
- It's possible to render the contents of the parent block by using the
398
- :doc:`parent<functions/parent>` function. This gives back the results of the
399
- parent block:
400
-
401
- .. code-block:: twig
402
-
403
- {% block sidebar %}
404
- <h3>Table Of Contents</h3>
405
- ...
406
- {{ parent() }}
407
- {% endblock %}
408
-
409
- .. tip::
410
-
411
- The documentation page for the :doc:`extends<tags/extends>` tag describes
412
- more advanced features like block nesting, scope, dynamic inheritance, and
413
- conditional inheritance.
414
-
415
- .. note::
416
-
417
- Twig also supports multiple inheritance via "horizontal reuse" with the help
418
- of the :doc:`use<tags/use>` tag.
419
-
420
- HTML Escaping
421
- -------------
422
-
423
- When generating HTML from templates, there's always a risk that a variable
424
- will include characters that affect the resulting HTML. There are two
425
- approaches: manually escaping each variable or automatically escaping
426
- everything by default.
427
-
428
- Twig supports both, automatic escaping is enabled by default.
429
-
430
- The automatic escaping strategy can be configured via the
431
- :ref:`autoescape<environment_options>` option and defaults to ``html``.
432
-
433
- Working with Manual Escaping
434
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
435
-
436
- If manual escaping is enabled, it is **your** responsibility to escape variables
437
- if needed. What to escape? Any variable that comes from an untrusted source.
438
-
439
- Escaping works by using the :doc:`escape<filters/escape>` or ``e`` filter:
440
-
441
- .. code-block:: twig
442
-
443
- {{ user.username|e }}
444
-
445
- By default, the ``escape`` filter uses the ``html`` strategy, but depending on
446
- the escaping context, you might want to explicitly use an other strategy:
447
-
448
- .. code-block:: twig
449
-
450
- {{ user.username|e('js') }}
451
- {{ user.username|e('css') }}
452
- {{ user.username|e('url') }}
453
- {{ user.username|e('html_attr') }}
454
-
455
- Working with Automatic Escaping
456
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
457
-
458
- Whether automatic escaping is enabled or not, you can mark a section of a
459
- template to be escaped or not by using the :doc:`autoescape<tags/autoescape>`
460
- tag:
461
-
462
- .. code-block:: twig
463
-
464
- {% autoescape %}
465
- Everything will be automatically escaped in this block (using the HTML strategy)
466
- {% endautoescape %}
467
-
468
- By default, auto-escaping uses the ``html`` escaping strategy. If you output
469
- variables in other contexts, you need to explicitly escape them with the
470
- appropriate escaping strategy:
471
-
472
- .. code-block:: twig
473
-
474
- {% autoescape 'js' %}
475
- Everything will be automatically escaped in this block (using the JS strategy)
476
- {% endautoescape %}
477
-
478
- Escaping
479
- --------
480
-
481
- It is sometimes desirable or even necessary to have Twig ignore parts it would
482
- otherwise handle as variables or blocks. For example if the default syntax is
483
- used and you want to use ``{{`` as raw string in the template and not start a
484
- variable you have to use a trick.
485
-
486
- The easiest way is to output the variable delimiter (``{{``) by using a variable
487
- expression:
488
-
489
- .. code-block:: twig
490
-
491
- {{ '{{' }}
492
-
493
- For bigger sections it makes sense to mark a block
494
- :doc:`verbatim<tags/verbatim>`.
495
-
496
- Macros
497
- ------
498
-
499
- .. versionadded:: 1.12
500
- Support for default argument values was added in Twig 1.12.
501
-
502
- Macros are comparable with functions in regular programming languages. They are
503
- useful to reuse HTML fragments to not repeat yourself. They are described in the
504
- :doc:`macro<tags/macro>` tag documentation.
505
-
506
- .. _twig-expressions:
507
-
508
- Expressions
509
- -----------
510
-
511
- Twig allows expressions everywhere.
512
-
513
- .. note::
514
-
515
- The operator precedence is as follows, with the lowest-precedence operators
516
- listed first: ``?:`` (ternary operator), ``b-and``, ``b-xor``, ``b-or``,
517
- ``or``, ``and``, ``==``, ``!=``, ``<``, ``>``, ``>=``, ``<=``, ``in``,
518
- ``matches``, ``starts with``, ``ends with``, ``..``, ``+``, ``-``, ``~``,
519
- ``*``, ``/``, ``//``, ``%``, ``is`` (tests), ``**``, ``??``, ``|``
520
- (filters), ``[]``, and ``.``:
521
-
522
- .. code-block:: twig
523
-
524
- {% set greeting = 'Hello ' %}
525
- {% set name = 'Fabien' %}
526
-
527
- {{ greeting ~ name|lower }} {# Hello fabien #}
528
-
529
- {# use parenthesis to change precedence #}
530
- {{ (greeting ~ name)|lower }} {# hello fabien #}
531
-
532
- Literals
533
- ~~~~~~~~
534
-
535
- .. versionadded:: 1.5
536
- Support for hash keys as names and expressions was added in Twig 1.5.
537
-
538
- The simplest form of expressions are literals. Literals are representations
539
- for PHP types such as strings, numbers, and arrays. The following literals
540
- exist:
541
-
542
- * ``"Hello World"``: Everything between two double or single quotes is a
543
- string. They are useful whenever you need a string in the template (for
544
- example as arguments to function calls, filters or just to extend or include
545
- a template). A string can contain a delimiter if it is preceded by a
546
- backslash (``\``) -- like in ``'It\'s good'``. If the string contains a
547
- backslash (e.g. ``'c:\Program Files'``) escape it by doubling it
548
- (e.g. ``'c:\\Program Files'``).
549
-
550
- * ``42`` / ``42.23``: Integers and floating point numbers are created by
551
- writing the number down. If a dot is present the number is a float,
552
- otherwise an integer.
553
-
554
- * ``["foo", "bar"]``: Arrays are defined by a sequence of expressions
555
- separated by a comma (``,``) and wrapped with squared brackets (``[]``).
556
-
557
- * ``{"foo": "bar"}``: Hashes are defined by a list of keys and values
558
- separated by a comma (``,``) and wrapped with curly braces (``{}``):
559
-
560
- .. code-block:: twig
561
-
562
- {# keys as string #}
563
- { 'foo': 'foo', 'bar': 'bar' }
564
-
565
- {# keys as names (equivalent to the previous hash) -- as of Twig 1.5 #}
566
- { foo: 'foo', bar: 'bar' }
567
-
568
- {# keys as integer #}
569
- { 2: 'foo', 4: 'bar' }
570
-
571
- {# keys as expressions (the expression must be enclosed into parentheses) -- as of Twig 1.5 #}
572
- {% set foo = 'foo' %}
573
- { (foo): 'foo', (1 + 1): 'bar', (foo ~ 'b'): 'baz' }
574
-
575
- * ``true`` / ``false``: ``true`` represents the true value, ``false``
576
- represents the false value.
577
-
578
- * ``null``: ``null`` represents no specific value. This is the value returned
579
- when a variable does not exist. ``none`` is an alias for ``null``.
580
-
581
- Arrays and hashes can be nested:
582
-
583
- .. code-block:: twig
584
-
585
- {% set foo = [1, {"foo": "bar"}] %}
586
-
587
- .. tip::
588
-
589
- Using double-quoted or single-quoted strings has no impact on performance
590
- but :ref:`string interpolation <templates-string-interpolation>` is only
591
- supported in double-quoted strings.
592
-
593
- Math
594
- ~~~~
595
-
596
- Twig allows you to do math in templates; the following operators are supported:
597
-
598
- * ``+``: Adds two numbers together (the operands are casted to numbers). ``{{
599
- 1 + 1 }}`` is ``2``.
600
-
601
- * ``-``: Subtracts the second number from the first one. ``{{ 3 - 2 }}`` is
602
- ``1``.
603
-
604
- * ``/``: Divides two numbers. The returned value will be a floating point
605
- number. ``{{ 1 / 2 }}`` is ``{{ 0.5 }}``.
606
-
607
- * ``%``: Calculates the remainder of an integer division. ``{{ 11 % 7 }}`` is
608
- ``4``.
609
-
610
- * ``//``: Divides two numbers and returns the floored integer result. ``{{ 20
611
- // 7 }}`` is ``2``, ``{{ -20 // 7 }}`` is ``-3`` (this is just syntactic
612
- sugar for the :doc:`round<filters/round>` filter).
613
-
614
- * ``*``: Multiplies the left operand with the right one. ``{{ 2 * 2 }}`` would
615
- return ``4``.
616
-
617
- * ``**``: Raises the left operand to the power of the right operand. ``{{ 2 **
618
- 3 }}`` would return ``8``.
619
-
620
- .. _template_logic:
621
-
622
- Logic
623
- ~~~~~
624
-
625
- You can combine multiple expressions with the following operators:
626
-
627
- * ``and``: Returns true if the left and the right operands are both true.
628
-
629
- * ``or``: Returns true if the left or the right operand is true.
630
-
631
- * ``not``: Negates a statement.
632
-
633
- * ``(expr)``: Groups an expression.
634
-
635
- .. note::
636
-
637
- Twig also supports bitwise operators (``b-and``, ``b-xor``, and ``b-or``).
638
-
639
- .. note::
640
-
641
- Operators are case sensitive.
642
-
643
- Comparisons
644
- ~~~~~~~~~~~
645
-
646
- The following comparison operators are supported in any expression: ``==``,
647
- ``!=``, ``<``, ``>``, ``>=``, and ``<=``.
648
-
649
- You can also check if a string ``starts with`` or ``ends with`` another
650
- string:
651
-
652
- .. code-block:: twig
653
-
654
- {% if 'Fabien' starts with 'F' %}
655
- {% endif %}
656
-
657
- {% if 'Fabien' ends with 'n' %}
658
- {% endif %}
659
-
660
- .. note::
661
-
662
- For complex string comparisons, the ``matches`` operator allows you to use
663
- `regular expressions`_:
664
-
665
- .. code-block:: twig
666
-
667
- {% if phone matches '/^[\\d\\.]+$/' %}
668
- {% endif %}
669
-
670
- Containment Operator
671
- ~~~~~~~~~~~~~~~~~~~~
672
-
673
- The ``in`` operator performs containment test. It returns ``true`` if the left
674
- operand is contained in the right:
675
-
676
- .. code-block:: twig
677
-
678
- {# returns true #}
679
-
680
- {{ 1 in [1, 2, 3] }}
681
-
682
- {{ 'cd' in 'abcde' }}
683
-
684
- .. tip::
685
-
686
- You can use this filter to perform a containment test on strings, arrays,
687
- or objects implementing the ``Traversable`` interface.
688
-
689
- To perform a negative test, use the ``not in`` operator:
690
-
691
- .. code-block:: twig
692
-
693
- {% if 1 not in [1, 2, 3] %}
694
-
695
- {# is equivalent to #}
696
- {% if not (1 in [1, 2, 3]) %}
697
-
698
- Test Operator
699
- ~~~~~~~~~~~~~
700
-
701
- The ``is`` operator performs tests. Tests can be used to test a variable against
702
- a common expression. The right operand is name of the test:
703
-
704
- .. code-block:: twig
705
-
706
- {# find out if a variable is odd #}
707
-
708
- {{ name is odd }}
709
-
710
- Tests can accept arguments too:
711
-
712
- .. code-block:: twig
713
-
714
- {% if post.status is constant('Post::PUBLISHED') %}
715
-
716
- Tests can be negated by using the ``is not`` operator:
717
-
718
- .. code-block:: twig
719
-
720
- {% if post.status is not constant('Post::PUBLISHED') %}
721
-
722
- {# is equivalent to #}
723
- {% if not (post.status is constant('Post::PUBLISHED')) %}
724
-
725
- Go to the :doc:`tests<tests/index>` page to learn more about the built-in
726
- tests.
727
-
728
- Other Operators
729
- ~~~~~~~~~~~~~~~
730
-
731
- .. versionadded:: 1.12.0
732
- Support for the extended ternary operator was added in Twig 1.12.0.
733
-
734
- The following operators don't fit into any of the other categories:
735
-
736
- * ``|``: Applies a filter.
737
-
738
- * ``..``: Creates a sequence based on the operand before and after the operator
739
- (this is syntactic sugar for the :doc:`range<functions/range>` function):
740
-
741
- .. code-block:: twig
742
-
743
- {{ 1..5 }}
744
-
745
- {# equivalent to #}
746
- {{ range(1, 5) }}
747
-
748
- Note that you must use parentheses when combining it with the filter operator
749
- due to the :ref:`operator precedence rules <twig-expressions>`:
750
-
751
- .. code-block:: twig
752
-
753
- (1..5)|join(', ')
754
-
755
- * ``~``: Converts all operands into strings and concatenates them. ``{{ "Hello
756
- " ~ name ~ "!" }}`` would return (assuming ``name`` is ``'John'``) ``Hello
757
- John!``.
758
-
759
- * ``.``, ``[]``: Gets an attribute of a variable.
760
-
761
- * ``?:``: The ternary operator:
762
-
763
- .. code-block:: twig
764
-
765
- {{ foo ? 'yes' : 'no' }}
766
-
767
- {# as of Twig 1.12.0 #}
768
- {{ foo ?: 'no' }} is the same as {{ foo ? foo : 'no' }}
769
- {{ foo ? 'yes' }} is the same as {{ foo ? 'yes' : '' }}
770
-
771
- * ``??``: The null-coalescing operator:
772
-
773
- .. code-block:: twig
774
-
775
- {# returns the value of foo if it is defined and not null, 'no' otherwise #}
776
- {{ foo ?? 'no' }}
777
-
778
- .. _templates-string-interpolation:
779
-
780
- String Interpolation
781
- ~~~~~~~~~~~~~~~~~~~~
782
-
783
- .. versionadded:: 1.5
784
- String interpolation was added in Twig 1.5.
785
-
786
- String interpolation (``#{expression}``) allows any valid expression to appear
787
- within a *double-quoted string*. The result of evaluating that expression is
788
- inserted into the string:
789
-
790
- .. code-block:: twig
791
-
792
- {{ "foo #{bar} baz" }}
793
- {{ "foo #{1 + 2} baz" }}
794
-
795
- .. _templates-whitespace-control:
796
-
797
- Whitespace Control
798
- ------------------
799
-
800
- .. versionadded:: 1.1
801
- Tag level whitespace control was added in Twig 1.1.
802
-
803
- .. versionadded:: 1.39
804
- Tag level Line whitespace control was added in Twig 1.39.
805
-
806
- The first newline after a template tag is removed automatically (like in PHP).
807
- Whitespace is not further modified by the template engine, so each whitespace
808
- (spaces, tabs, newlines etc.) is returned unchanged.
809
-
810
- You can also control whitespace on a per tag level. By using the whitespace
811
- control modifiers on your tags, you can trim leading and or trailing whitespace.
812
-
813
- Twig supports two modifiers:
814
-
815
- * *Whitespace trimming* via the ``-`` modifier: Removes all whitespace
816
- (including newlines);
817
-
818
- * *Line whitespace trimming* via the ``~`` modifier: Removes all whitespace
819
- (excluding newlines). Using this modifier on the right disables the default
820
- removal of the first newline inherited from PHP.
821
-
822
- The modifiers can be used on either side of the tags like in ``{%-`` or ``-%}``
823
- and they consume all whitespace for that side of the tag. It is possible to use
824
- the modifiers on one side of a tag or on both sides:
825
-
826
- .. code-block:: twig
827
-
828
- {% set value = 'no spaces' %}
829
- {#- No leading/trailing whitespace -#}
830
- {%- if true -%}
831
- {{- value -}}
832
- {%- endif -%}
833
- {# output 'no spaces' #}
834
-
835
- <li>
836
- {{ value }} </li>
837
- {# outputs '<li>\n no spaces </li>' #}
838
-
839
- <li>
840
- {{- value }} </li>
841
- {# outputs '<li>no spaces </li>' #}
842
-
843
- <li>
844
- {{~ value }} </li>
845
- {# outputs '<li>\nno spaces </li>' #}
846
-
847
- .. tip::
848
-
849
- In addition to the whitespace modifiers, Twig also has a ``spaceless`` filter
850
- that removes whitespace **between HTML tags**:
851
-
852
- .. code-block:: twig
853
-
854
- {% apply spaceless %}
855
- <div>
856
- <strong>foo bar</strong>
857
- </div>
858
- {% endapply %}
859
-
860
- {# output will be <div><strong>foo bar</strong></div> #}
861
-
862
- Note that the ``apply`` tag was introduced in Twig 1.40; use the ``filter``
863
- tag with previous versions.
864
-
865
- Extensions
866
- ----------
867
-
868
- Twig can be extended. If you are looking for new tags, filters, or functions,
869
- have a look at the Twig official `extension repository`_.
870
-
871
- If you want to create your own, read the :ref:`Creating an
872
- Extension<creating_extensions>` chapter.
873
-
874
- .. _`Twig bundle`: https://github.com/Anomareh/PHP-Twig.tmbundle
875
- .. _`Jinja syntax plugin`: http://jinja.pocoo.org/docs/integration/#vim
876
- .. _`vim-twig plugin`: https://github.com/lumiliet/vim-twig
877
- .. _`Twig syntax plugin`: http://plugins.netbeans.org/plugin/37069/php-twig
878
- .. _`Twig plugin`: https://github.com/pulse00/Twig-Eclipse-Plugin
879
- .. _`Twig language definition`: https://github.com/gabrielcorpse/gedit-twig-template-language
880
- .. _`extension repository`: https://github.com/twigphp/Twig-extensions
881
- .. _`Twig syntax mode`: https://github.com/bobthecow/Twig-HTML.mode
882
- .. _`other Twig syntax mode`: https://github.com/muxx/Twig-HTML.mode
883
- .. _`Notepad++ Twig Highlighter`: https://github.com/Banane9/notepadplusplus-twig
884
- .. _`web-mode.el`: http://web-mode.org/
885
- .. _`regular expressions`: https://secure.php.net/manual/en/pcre.pattern.php
886
- .. _`PHP-twig for atom`: https://github.com/reesef/php-twig
887
- .. _`TwigFiddle`: https://twigfiddle.com/
888
- .. _`Twig pack`: https://marketplace.visualstudio.com/items?itemName=bajdzis.vscode-twig-pack
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tests/constant.rst DELETED
@@ -1,22 +0,0 @@
1
- ``constant``
2
- ============
3
-
4
- .. versionadded: 1.13.1
5
- constant now accepts object instances as the second argument.
6
-
7
- ``constant`` checks if a variable has the exact same value as a constant. You
8
- can use either global constants or class constants:
9
-
10
- .. code-block:: twig
11
-
12
- {% if post.status is constant('Post::PUBLISHED') %}
13
- the status attribute is exactly the same as Post::PUBLISHED
14
- {% endif %}
15
-
16
- You can test constants from object instances as well:
17
-
18
- .. code-block:: twig
19
-
20
- {% if post.status is constant('PUBLISHED', post) %}
21
- the status attribute is exactly the same as Post::PUBLISHED
22
- {% endif %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tests/defined.rst DELETED
@@ -1,30 +0,0 @@
1
- ``defined``
2
- ===========
3
-
4
- ``defined`` checks if a variable is defined in the current context. This is very
5
- useful if you use the ``strict_variables`` option:
6
-
7
- .. code-block:: twig
8
-
9
- {# defined works with variable names #}
10
- {% if foo is defined %}
11
- ...
12
- {% endif %}
13
-
14
- {# and attributes on variables names #}
15
- {% if foo.bar is defined %}
16
- ...
17
- {% endif %}
18
-
19
- {% if foo['bar'] is defined %}
20
- ...
21
- {% endif %}
22
-
23
- When using the ``defined`` test on an expression that uses variables in some
24
- method calls, be sure that they are all defined first:
25
-
26
- .. code-block:: twig
27
-
28
- {% if var is defined and foo.method(var) is defined %}
29
- ...
30
- {% endif %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tests/divisibleby.rst DELETED
@@ -1,14 +0,0 @@
1
- ``divisible by``
2
- ================
3
-
4
- .. versionadded:: 1.14.2
5
- The ``divisible by`` test was added in Twig 1.14.2 as an alias for
6
- ``divisibleby``.
7
-
8
- ``divisible by`` checks if a variable is divisible by a number:
9
-
10
- .. code-block:: twig
11
-
12
- {% if loop.index is divisible by(3) %}
13
- ...
14
- {% endif %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tests/empty.rst DELETED
@@ -1,22 +0,0 @@
1
- ``empty``
2
- =========
3
-
4
- .. versionadded:: 1.33
5
-
6
- Support for the ``__toString()`` magic method has been added in Twig 1.33.
7
-
8
- ``empty`` checks if a variable is an empty string, an empty array, an empty
9
- hash, exactly ``false``, or exactly ``null``.
10
-
11
- For objects that implement the ``Countable`` interface, ``empty`` will check the
12
- return value of the ``count()`` method.
13
-
14
- For objects that implement the ``__toString()`` magic method (and not ``Countable``),
15
- it will check if an empty string is returned.
16
-
17
- .. code-block:: twig
18
-
19
- {% if foo is empty %}
20
- ...
21
- {% endif %}
22
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tests/even.rst DELETED
@@ -1,10 +0,0 @@
1
- ``even``
2
- ========
3
-
4
- ``even`` returns ``true`` if the given number is even:
5
-
6
- .. code-block:: twig
7
-
8
- {{ var is even }}
9
-
10
- .. seealso:: :doc:`odd<../tests/odd>`
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tests/index.rst DELETED
@@ -1,15 +0,0 @@
1
- Tests
2
- =====
3
-
4
- .. toctree::
5
- :maxdepth: 1
6
-
7
- constant
8
- defined
9
- divisibleby
10
- empty
11
- even
12
- iterable
13
- null
14
- odd
15
- sameas
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tests/iterable.rst DELETED
@@ -1,19 +0,0 @@
1
- ``iterable``
2
- ============
3
-
4
- .. versionadded:: 1.7
5
- The iterable test was added in Twig 1.7.
6
-
7
- ``iterable`` checks if a variable is an array or a traversable object:
8
-
9
- .. code-block:: twig
10
-
11
- {# evaluates to true if the foo variable is iterable #}
12
- {% if users is iterable %}
13
- {% for user in users %}
14
- Hello {{ user }}!
15
- {% endfor %}
16
- {% else %}
17
- {# users is probably a string #}
18
- Hello {{ users }}!
19
- {% endif %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tests/null.rst DELETED
@@ -1,12 +0,0 @@
1
- ``null``
2
- ========
3
-
4
- ``null`` returns ``true`` if the variable is ``null``:
5
-
6
- .. code-block:: twig
7
-
8
- {{ var is null }}
9
-
10
- .. note::
11
-
12
- ``none`` is an alias for ``null``.
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tests/odd.rst DELETED
@@ -1,10 +0,0 @@
1
- ``odd``
2
- =======
3
-
4
- ``odd`` returns ``true`` if the given number is odd:
5
-
6
- .. code-block:: twig
7
-
8
- {{ var is odd }}
9
-
10
- .. seealso:: :doc:`even<../tests/even>`
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/doc/tests/sameas.rst DELETED
@@ -1,14 +0,0 @@
1
- ``same as``
2
- ===========
3
-
4
- .. versionadded:: 1.14.2
5
- The ``same as`` test was added in Twig 1.14.2 as an alias for ``sameas``.
6
-
7
- ``same as`` checks if a variable is the same as another variable.
8
- This is the equivalent to ``===`` in PHP:
9
-
10
- .. code-block:: twig
11
-
12
- {% if foo.attribute is same as(false) %}
13
- the foo attribute really is the 'false' PHP value
14
- {% endif %}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/drupal_test.sh DELETED
@@ -1,51 +0,0 @@
1
- #!/bin/bash
2
-
3
- set -x
4
- set -e
5
-
6
- REPO=`pwd`
7
- cd /tmp
8
- rm -rf drupal-twig-test
9
- composer create-project --no-interaction drupal-composer/drupal-project:8.x-dev drupal-twig-test
10
- cd drupal-twig-test
11
- (cd vendor/twig && rm -rf twig && ln -sf $REPO twig)
12
- echo '$config["system.logging"]["error_level"] = "verbose";' >> web/sites/default/settings.php
13
- php ./web/core/scripts/drupal install --no-interaction demo_umami > output
14
- perl -p -i -e 's/^([A-Za-z]+)\: (.+)$/export DRUPAL_\1=\2/' output
15
- source output
16
-
17
- wget https://get.symfony.com/cli/installer -O - | bash
18
- export PATH="$HOME/.symfony/bin:$PATH"
19
- symfony server:start -d --no-tls
20
- ENDPOINT=`symfony server:status -no-ansi | sed -E 's/^.+ http/http/'`
21
-
22
- curl -OLsS https://get.blackfire.io/blackfire-player.phar
23
- chmod +x blackfire-player.phar
24
- cat > drupal-tests.bkf <<EOF
25
- name "Drupal tests"
26
-
27
- scenario
28
- name "homepage"
29
- set name "admin"
30
- set pass "pass"
31
-
32
- visit url('/')
33
- expect status_code() == 200
34
- click link('Articles')
35
- expect status_code() == 200
36
- click link('Dairy-free and delicious milk chocolate')
37
- expect body() matches "/Dairy\-free milk chocolate is made in largely the same way as regular chocolate/"
38
- expect status_code() == 200
39
- click link('Log in')
40
- expect status_code() == 200
41
- submit button("Log in")
42
- param name name
43
- param pass pass
44
- expect status_code() == 303
45
- follow
46
- expect status_code() == 200
47
- click link('Structure')
48
- expect status_code() == 200
49
- EOF
50
- ./blackfire-player.phar run drupal-tests.bkf --endpoint=$ENDPOINT --variable name=$DRUPAL_Username --variable pass=$DRUPAL_Password
51
- symfony server:stop
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/ext/twig/.gitignore DELETED
@@ -1,30 +0,0 @@
1
- *.sw*
2
- .deps
3
- Makefile
4
- Makefile.fragments
5
- Makefile.global
6
- Makefile.objects
7
- acinclude.m4
8
- aclocal.m4
9
- build/
10
- config.cache
11
- config.guess
12
- config.h
13
- config.h.in
14
- config.log
15
- config.nice
16
- config.status
17
- config.sub
18
- configure
19
- configure.in
20
- install-sh
21
- libtool
22
- ltmain.sh
23
- missing
24
- mkinstalldirs
25
- run-tests.php
26
- twig.loT
27
- .libs/
28
- modules/
29
- twig.la
30
- twig.lo
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/ext/twig/config.m4 DELETED
@@ -1,8 +0,0 @@
1
- dnl config.m4 for extension twig
2
-
3
- PHP_ARG_ENABLE(twig, whether to enable twig support,
4
- [ --enable-twig Enable twig support])
5
-
6
- if test "$PHP_TWIG" != "no"; then
7
- PHP_NEW_EXTENSION(twig, twig.c, $ext_shared)
8
- fi
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/ext/twig/config.w32 DELETED
@@ -1,8 +0,0 @@
1
- // vim:ft=javascript
2
-
3
- ARG_ENABLE("twig", "Twig support", "no");
4
-
5
- if (PHP_TWIG != "no") {
6
- AC_DEFINE('HAVE_TWIG', 1);
7
- EXTENSION('twig', 'twig.c');
8
- }
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/ext/twig/php_twig.h DELETED
@@ -1,35 +0,0 @@
1
- /*
2
- +----------------------------------------------------------------------+
3
- | Twig Extension |
4
- +----------------------------------------------------------------------+
5
- | Copyright (c) 2011 Derick Rethans |
6
- +----------------------------------------------------------------------+
7
- | Redistribution and use in source and binary forms, with or without |
8
- | modification, are permitted provided that the conditions mentioned |
9
- | in the accompanying LICENSE file are met (BSD-3-Clause). |
10
- +----------------------------------------------------------------------+
11
- | Author: Derick Rethans <derick@derickrethans.nl> |
12
- +----------------------------------------------------------------------+
13
- */
14
-
15
- #ifndef PHP_TWIG_H
16
- #define PHP_TWIG_H
17
-
18
- #define PHP_TWIG_VERSION "1.42.3"
19
-
20
- #include "php.h"
21
-
22
- extern zend_module_entry twig_module_entry;
23
- #define phpext_twig_ptr &twig_module_entry
24
- #ifndef PHP_WIN32
25
- zend_module_entry *get_module(void);
26
- #endif
27
-
28
- #ifdef ZTS
29
- #include "TSRM.h"
30
- #endif
31
-
32
- PHP_FUNCTION(twig_template_get_attributes);
33
- PHP_RSHUTDOWN_FUNCTION(twig);
34
-
35
- #endif
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/ext/twig/twig.c DELETED
@@ -1,1217 +0,0 @@
1
- /*
2
- +----------------------------------------------------------------------+
3
- | Twig Extension |
4
- +----------------------------------------------------------------------+
5
- | Copyright (c) 2011 Derick Rethans |
6
- +----------------------------------------------------------------------+
7
- | Redistribution and use in source and binary forms, with or without |
8
- | modification, are permitted provided that the conditions mentioned |
9
- | in the accompanying LICENSE file are met (BSD-3-Clause). |
10
- +----------------------------------------------------------------------+
11
- | Author: Derick Rethans <derick@derickrethans.nl> |
12
- +----------------------------------------------------------------------+
13
- */
14
-
15
- #ifdef HAVE_CONFIG_H
16
- #include "config.h"
17
- #endif
18
-
19
- #include "php.h"
20
- #include "php_twig.h"
21
- #include "ext/standard/php_var.h"
22
- #include "ext/standard/php_string.h"
23
- #include "ext/standard/php_smart_str.h"
24
- #include "ext/spl/spl_exceptions.h"
25
-
26
- #include "Zend/zend_object_handlers.h"
27
- #include "Zend/zend_interfaces.h"
28
- #include "Zend/zend_exceptions.h"
29
-
30
- #ifndef Z_ADDREF_P
31
- #define Z_ADDREF_P(pz) (pz)->refcount++
32
- #endif
33
-
34
- #ifndef E_USER_DEPRECATED
35
- #define E_USER_DEPRECATED (1<<14L)
36
- #endif
37
-
38
- #define FREE_DTOR(z) \
39
- zval_dtor(z); \
40
- efree(z);
41
-
42
- #if PHP_VERSION_ID >= 50300
43
- #define APPLY_TSRMLS_DC TSRMLS_DC
44
- #define APPLY_TSRMLS_CC TSRMLS_CC
45
- #define APPLY_TSRMLS_FETCH()
46
- #else
47
- #define APPLY_TSRMLS_DC
48
- #define APPLY_TSRMLS_CC
49
- #define APPLY_TSRMLS_FETCH() TSRMLS_FETCH()
50
- #endif
51
-
52
- ZEND_BEGIN_ARG_INFO_EX(twig_template_get_attribute_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 6)
53
- ZEND_ARG_INFO(0, template)
54
- ZEND_ARG_INFO(0, object)
55
- ZEND_ARG_INFO(0, item)
56
- ZEND_ARG_INFO(0, arguments)
57
- ZEND_ARG_INFO(0, type)
58
- ZEND_ARG_INFO(0, isDefinedTest)
59
- ZEND_END_ARG_INFO()
60
-
61
- #ifndef PHP_FE_END
62
- #define PHP_FE_END { NULL, NULL, NULL}
63
- #endif
64
-
65
- static const zend_function_entry twig_functions[] = {
66
- PHP_FE(twig_template_get_attributes, twig_template_get_attribute_args)
67
- PHP_FE_END
68
- };
69
-
70
- PHP_RSHUTDOWN_FUNCTION(twig)
71
- {
72
- #if ZEND_DEBUG
73
- CG(unclean_shutdown) = 0; /* get rid of PHPUnit's exit() and report memleaks */
74
- #endif
75
- return SUCCESS;
76
- }
77
-
78
- zend_module_entry twig_module_entry = {
79
- STANDARD_MODULE_HEADER,
80
- "twig",
81
- twig_functions,
82
- NULL,
83
- NULL,
84
- NULL,
85
- PHP_RSHUTDOWN(twig),
86
- NULL,
87
- PHP_TWIG_VERSION,
88
- STANDARD_MODULE_PROPERTIES
89
- };
90
-
91
-
92
- #ifdef COMPILE_DL_TWIG
93
- ZEND_GET_MODULE(twig)
94
- #endif
95
-
96
- static int TWIG_ARRAY_KEY_EXISTS(zval *array, zval *key)
97
- {
98
- if (Z_TYPE_P(array) != IS_ARRAY) {
99
- return 0;
100
- }
101
-
102
- switch (Z_TYPE_P(key)) {
103
- case IS_NULL:
104
- return zend_hash_exists(Z_ARRVAL_P(array), "", 1);
105
-
106
- case IS_BOOL:
107
- case IS_DOUBLE:
108
- convert_to_long(key);
109
- case IS_LONG:
110
- return zend_hash_index_exists(Z_ARRVAL_P(array), Z_LVAL_P(key));
111
-
112
- default:
113
- convert_to_string(key);
114
- return zend_symtable_exists(Z_ARRVAL_P(array), Z_STRVAL_P(key), Z_STRLEN_P(key) + 1);
115
- }
116
- }
117
-
118
- static int TWIG_INSTANCE_OF(zval *object, zend_class_entry *interface TSRMLS_DC)
119
- {
120
- if (Z_TYPE_P(object) != IS_OBJECT) {
121
- return 0;
122
- }
123
- return instanceof_function(Z_OBJCE_P(object), interface TSRMLS_CC);
124
- }
125
-
126
- static int TWIG_INSTANCE_OF_USERLAND(zval *object, char *interface TSRMLS_DC)
127
- {
128
- zend_class_entry **pce;
129
- if (Z_TYPE_P(object) != IS_OBJECT) {
130
- return 0;
131
- }
132
- if (zend_lookup_class(interface, strlen(interface), &pce TSRMLS_CC) == FAILURE) {
133
- return 0;
134
- }
135
- return instanceof_function(Z_OBJCE_P(object), *pce TSRMLS_CC);
136
- }
137
-
138
- static zval *TWIG_GET_ARRAYOBJECT_ELEMENT(zval *object, zval *offset TSRMLS_DC)
139
- {
140
- zend_class_entry *ce = Z_OBJCE_P(object);
141
- zval *retval;
142
-
143
- if (Z_TYPE_P(object) == IS_OBJECT) {
144
- SEPARATE_ARG_IF_REF(offset);
145
- zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval, offset);
146
-
147
- zval_ptr_dtor(&offset);
148
-
149
- if (!retval) {
150
- if (!EG(exception)) {
151
- zend_error(E_ERROR, "Undefined offset for object of type %s used as array.", ce->name);
152
- }
153
- return NULL;
154
- }
155
-
156
- return retval;
157
- }
158
- return NULL;
159
- }
160
-
161
- static int TWIG_ISSET_ARRAYOBJECT_ELEMENT(zval *object, zval *offset TSRMLS_DC)
162
- {
163
- zend_class_entry *ce = Z_OBJCE_P(object);
164
- zval *retval;
165
-
166
- if (Z_TYPE_P(object) == IS_OBJECT) {
167
- SEPARATE_ARG_IF_REF(offset);
168
- zend_call_method_with_1_params(&object, ce, NULL, "offsetexists", &retval, offset);
169
-
170
- zval_ptr_dtor(&offset);
171
-
172
- if (!retval) {
173
- if (!EG(exception)) {
174
- zend_error(E_ERROR, "Undefined offset for object of type %s used as array.", ce->name);
175
- }
176
- return 0;
177
- }
178
-
179
- return (retval && Z_TYPE_P(retval) == IS_BOOL && Z_LVAL_P(retval));
180
- }
181
- return 0;
182
- }
183
-
184
- static char *TWIG_STRTOLOWER(const char *str, int str_len)
185
- {
186
- char *item_dup;
187
-
188
- item_dup = estrndup(str, str_len);
189
- php_strtolower(item_dup, str_len);
190
- return item_dup;
191
- }
192
-
193
- static zval *TWIG_CALL_USER_FUNC_ARRAY(zval *object, char *function, zval *arguments TSRMLS_DC)
194
- {
195
- zend_fcall_info fci;
196
- zval ***args = NULL;
197
- int arg_count = 0;
198
- HashTable *table;
199
- HashPosition pos;
200
- int i = 0;
201
- zval *retval_ptr;
202
- zval *zfunction;
203
-
204
- if (arguments) {
205
- table = HASH_OF(arguments);
206
- args = safe_emalloc(sizeof(zval **), table->nNumOfElements, 0);
207
-
208
- zend_hash_internal_pointer_reset_ex(table, &pos);
209
-
210
- while (zend_hash_get_current_data_ex(table, (void **)&args[i], &pos) == SUCCESS) {
211
- i++;
212
- zend_hash_move_forward_ex(table, &pos);
213
- }
214
- arg_count = table->nNumOfElements;
215
- }
216
-
217
- MAKE_STD_ZVAL(zfunction);
218
- ZVAL_STRING(zfunction, function, 1);
219
- fci.size = sizeof(fci);
220
- fci.function_table = EG(function_table);
221
- fci.function_name = zfunction;
222
- fci.symbol_table = NULL;
223
- #if PHP_VERSION_ID >= 50300
224
- fci.object_ptr = object;
225
- #else
226
- fci.object_pp = &object;
227
- #endif
228
- fci.retval_ptr_ptr = &retval_ptr;
229
- fci.param_count = arg_count;
230
- fci.params = args;
231
- fci.no_separation = 0;
232
-
233
- if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE) {
234
- ALLOC_INIT_ZVAL(retval_ptr);
235
- ZVAL_BOOL(retval_ptr, 0);
236
- }
237
-
238
- if (args) {
239
- efree(fci.params);
240
- }
241
- FREE_DTOR(zfunction);
242
- return retval_ptr;
243
- }
244
-
245
- static int TWIG_CALL_BOOLEAN(zval *object, char *functionName TSRMLS_DC)
246
- {
247
- zval *ret;
248
- int res;
249
-
250
- ret = TWIG_CALL_USER_FUNC_ARRAY(object, functionName, NULL TSRMLS_CC);
251
- res = Z_LVAL_P(ret);
252
- zval_ptr_dtor(&ret);
253
- return res;
254
- }
255
-
256
- static zval *TWIG_GET_STATIC_PROPERTY(zval *class, char *prop_name TSRMLS_DC)
257
- {
258
- zval **tmp_zval;
259
- zend_class_entry *ce;
260
-
261
- if (class == NULL || Z_TYPE_P(class) != IS_OBJECT) {
262
- return NULL;
263
- }
264
-
265
- ce = zend_get_class_entry(class TSRMLS_CC);
266
- #if PHP_VERSION_ID >= 50400
267
- tmp_zval = zend_std_get_static_property(ce, prop_name, strlen(prop_name), 0, NULL TSRMLS_CC);
268
- #else
269
- tmp_zval = zend_std_get_static_property(ce, prop_name, strlen(prop_name), 0 TSRMLS_CC);
270
- #endif
271
- return *tmp_zval;
272
- }
273
-
274
- static zval *TWIG_GET_ARRAY_ELEMENT_ZVAL(zval *class, zval *prop_name TSRMLS_DC)
275
- {
276
- zval **tmp_zval;
277
-
278
- if (class == NULL || Z_TYPE_P(class) != IS_ARRAY) {
279
- if (class != NULL && Z_TYPE_P(class) == IS_OBJECT && TWIG_INSTANCE_OF(class, zend_ce_arrayaccess TSRMLS_CC)) {
280
- // array access object
281
- return TWIG_GET_ARRAYOBJECT_ELEMENT(class, prop_name TSRMLS_CC);
282
- }
283
- return NULL;
284
- }
285
-
286
- switch(Z_TYPE_P(prop_name)) {
287
- case IS_NULL:
288
- zend_hash_find(HASH_OF(class), "", 1, (void**) &tmp_zval);
289
- return *tmp_zval;
290
-
291
- case IS_BOOL:
292
- case IS_DOUBLE:
293
- convert_to_long(prop_name);
294
- case IS_LONG:
295
- zend_hash_index_find(HASH_OF(class), Z_LVAL_P(prop_name), (void **) &tmp_zval);
296
- return *tmp_zval;
297
-
298
- case IS_STRING:
299
- zend_symtable_find(HASH_OF(class), Z_STRVAL_P(prop_name), Z_STRLEN_P(prop_name) + 1, (void**) &tmp_zval);
300
- return *tmp_zval;
301
- }
302
-
303
- return NULL;
304
- }
305
-
306
- static zval *TWIG_GET_ARRAY_ELEMENT(zval *class, char *prop_name, int prop_name_length TSRMLS_DC)
307
- {
308
- zval **tmp_zval;
309
-
310
- if (class == NULL/* || Z_TYPE_P(class) != IS_ARRAY*/) {
311
- return NULL;
312
- }
313
-
314
- if (class != NULL && Z_TYPE_P(class) == IS_OBJECT && TWIG_INSTANCE_OF(class, zend_ce_arrayaccess TSRMLS_CC)) {
315
- // array access object
316
- zval *tmp_name_zval;
317
- zval *tmp_ret_zval;
318
-
319
- ALLOC_INIT_ZVAL(tmp_name_zval);
320
- ZVAL_STRING(tmp_name_zval, prop_name, 1);
321
- tmp_ret_zval = TWIG_GET_ARRAYOBJECT_ELEMENT(class, tmp_name_zval TSRMLS_CC);
322
- FREE_DTOR(tmp_name_zval);
323
- return tmp_ret_zval;
324
- }
325
-
326
- if (zend_symtable_find(HASH_OF(class), prop_name, prop_name_length+1, (void**)&tmp_zval) == SUCCESS) {
327
- return *tmp_zval;
328
- }
329
- return NULL;
330
- }
331
-
332
- static zval *TWIG_PROPERTY(zval *object, zval *propname TSRMLS_DC)
333
- {
334
- zval *tmp = NULL;
335
-
336
- if (Z_OBJ_HT_P(object)->read_property) {
337
- #if PHP_VERSION_ID >= 50400
338
- tmp = Z_OBJ_HT_P(object)->read_property(object, propname, BP_VAR_IS, NULL TSRMLS_CC);
339
- #else
340
- tmp = Z_OBJ_HT_P(object)->read_property(object, propname, BP_VAR_IS TSRMLS_CC);
341
- #endif
342
- if (tmp == EG(uninitialized_zval_ptr)) {
343
- ZVAL_NULL(tmp);
344
- }
345
- }
346
- return tmp;
347
- }
348
-
349
- static int TWIG_HAS_PROPERTY(zval *object, zval *propname TSRMLS_DC)
350
- {
351
- if (Z_OBJ_HT_P(object)->has_property) {
352
- #if PHP_VERSION_ID >= 50400
353
- return Z_OBJ_HT_P(object)->has_property(object, propname, 0, NULL TSRMLS_CC);
354
- #else
355
- return Z_OBJ_HT_P(object)->has_property(object, propname, 0 TSRMLS_CC);
356
- #endif
357
- }
358
- return 0;
359
- }
360
-
361
- static int TWIG_HAS_DYNAMIC_PROPERTY(zval *object, char *prop, int prop_len TSRMLS_DC)
362
- {
363
- if (Z_OBJ_HT_P(object)->get_properties) {
364
- return zend_hash_quick_exists(
365
- Z_OBJ_HT_P(object)->get_properties(object TSRMLS_CC), // the properties hash
366
- prop, // property name
367
- prop_len + 1, // property length
368
- zend_get_hash_value(prop, prop_len + 1) // hash value
369
- );
370
- }
371
- return 0;
372
- }
373
-
374
- static zval *TWIG_PROPERTY_CHAR(zval *object, char *propname TSRMLS_DC)
375
- {
376
- zval *tmp_name_zval, *tmp;
377
-
378
- ALLOC_INIT_ZVAL(tmp_name_zval);
379
- ZVAL_STRING(tmp_name_zval, propname, 1);
380
- tmp = TWIG_PROPERTY(object, tmp_name_zval TSRMLS_CC);
381
- FREE_DTOR(tmp_name_zval);
382
- return tmp;
383
- }
384
-
385
- static zval *TWIG_CALL_S(zval *object, char *method, char *arg0 TSRMLS_DC)
386
- {
387
- zend_fcall_info fci;
388
- zval **args[1];
389
- zval *argument;
390
- zval *zfunction;
391
- zval *retval_ptr;
392
-
393
- MAKE_STD_ZVAL(argument);
394
- ZVAL_STRING(argument, arg0, 1);
395
- args[0] = &argument;
396
-
397
- MAKE_STD_ZVAL(zfunction);
398
- ZVAL_STRING(zfunction, method, 1);
399
- fci.size = sizeof(fci);
400
- fci.function_table = EG(function_table);
401
- fci.function_name = zfunction;
402
- fci.symbol_table = NULL;
403
- #if PHP_VERSION_ID >= 50300
404
- fci.object_ptr = object;
405
- #else
406
- fci.object_pp = &object;
407
- #endif
408
- fci.retval_ptr_ptr = &retval_ptr;
409
- fci.param_count = 1;
410
- fci.params = args;
411
- fci.no_separation = 0;
412
-
413
- if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE) {
414
- FREE_DTOR(zfunction);
415
- zval_ptr_dtor(&argument);
416
- return 0;
417
- }
418
- FREE_DTOR(zfunction);
419
- zval_ptr_dtor(&argument);
420
- return retval_ptr;
421
- }
422
-
423
- static int TWIG_CALL_SB(zval *object, char *method, char *arg0 TSRMLS_DC)
424
- {
425
- zval *retval_ptr;
426
- int success;
427
-
428
- retval_ptr = TWIG_CALL_S(object, method, arg0 TSRMLS_CC);
429
- success = (retval_ptr && (Z_TYPE_P(retval_ptr) == IS_BOOL) && Z_LVAL_P(retval_ptr));
430
-
431
- if (retval_ptr) {
432
- zval_ptr_dtor(&retval_ptr);
433
- }
434
-
435
- return success;
436
- }
437
-
438
- static int TWIG_CALL_ZZ(zval *object, char *method, zval *arg1, zval *arg2 TSRMLS_DC)
439
- {
440
- zend_fcall_info fci;
441
- zval **args[2];
442
- zval *zfunction;
443
- zval *retval_ptr;
444
- int success;
445
-
446
- args[0] = &arg1;
447
- args[1] = &arg2;
448
-
449
- MAKE_STD_ZVAL(zfunction);
450
- ZVAL_STRING(zfunction, method, 1);
451
- fci.size = sizeof(fci);
452
- fci.function_table = EG(function_table);
453
- fci.function_name = zfunction;
454
- fci.symbol_table = NULL;
455
- #if PHP_VERSION_ID >= 50300
456
- fci.object_ptr = object;
457
- #else
458
- fci.object_pp = &object;
459
- #endif
460
- fci.retval_ptr_ptr = &retval_ptr;
461
- fci.param_count = 2;
462
- fci.params = args;
463
- fci.no_separation = 0;
464
-
465
- if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE) {
466
- FREE_DTOR(zfunction);
467
- return 0;
468
- }
469
-
470
- FREE_DTOR(zfunction);
471
-
472
- success = (retval_ptr && (Z_TYPE_P(retval_ptr) == IS_BOOL) && Z_LVAL_P(retval_ptr));
473
- if (retval_ptr) {
474
- zval_ptr_dtor(&retval_ptr);
475
- }
476
-
477
- return success;
478
- }
479
-
480
- #ifndef Z_SET_REFCOUNT_P
481
- # define Z_SET_REFCOUNT_P(pz, rc) pz->refcount = rc
482
- # define Z_UNSET_ISREF_P(pz) pz->is_ref = 0
483
- #endif
484
-
485
- static void TWIG_NEW(zval *object, char *class, zval *arg0, zval *arg1 TSRMLS_DC)
486
- {
487
- zend_class_entry **pce;
488
-
489
- if (zend_lookup_class(class, strlen(class), &pce TSRMLS_CC) == FAILURE) {
490
- return;
491
- }
492
-
493
- Z_TYPE_P(object) = IS_OBJECT;
494
- object_init_ex(object, *pce);
495
- Z_SET_REFCOUNT_P(object, 1);
496
- Z_UNSET_ISREF_P(object);
497
-
498
- TWIG_CALL_ZZ(object, "__construct", arg0, arg1 TSRMLS_CC);
499
- }
500
-
501
- static int twig_add_array_key_to_string(void *pDest APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
502
- {
503
- smart_str *buf;
504
- char *joiner;
505
- APPLY_TSRMLS_FETCH();
506
-
507
- buf = va_arg(args, smart_str*);
508
- joiner = va_arg(args, char*);
509
-
510
- if (buf->len != 0) {
511
- smart_str_appends(buf, joiner);
512
- }
513
-
514
- if (hash_key->nKeyLength == 0) {
515
- smart_str_append_long(buf, (long) hash_key->h);
516
- } else {
517
- char *key, *tmp_str;
518
- int key_len, tmp_len;
519
- key = php_addcslashes(hash_key->arKey, hash_key->nKeyLength - 1, &key_len, 0, "'\\", 2 TSRMLS_CC);
520
- tmp_str = php_str_to_str_ex(key, key_len, "\0", 1, "' . \"\\0\" . '", 12, &tmp_len, 0, NULL);
521
-
522
- smart_str_appendl(buf, tmp_str, tmp_len);
523
- efree(key);
524
- efree(tmp_str);
525
- }
526
-
527
- return 0;
528
- }
529
-
530
- static char *TWIG_IMPLODE_ARRAY_KEYS(char *joiner, zval *array TSRMLS_DC)
531
- {
532
- smart_str collector = { 0, 0, 0 };
533
-
534
- smart_str_appendl(&collector, "", 0);
535
- zend_hash_apply_with_arguments(HASH_OF(array) APPLY_TSRMLS_CC, twig_add_array_key_to_string, 2, &collector, joiner);
536
- smart_str_0(&collector);
537
-
538
- return collector.c;
539
- }
540
-
541
- static void TWIG_RUNTIME_ERROR(zval *template TSRMLS_DC, char *message, ...)
542
- {
543
- char *buffer;
544
- va_list args;
545
- zend_class_entry **pce;
546
- zval *ex;
547
- zval *constructor;
548
- zval *zmessage;
549
- zval *lineno;
550
- zval *filename_func;
551
- zval *filename;
552
- zval *constructor_args[3];
553
- zval *constructor_retval;
554
-
555
- if (zend_lookup_class("Twig_Error_Runtime", strlen("Twig_Error_Runtime"), &pce TSRMLS_CC) == FAILURE) {
556
- return;
557
- }
558
-
559
- va_start(args, message);
560
- vspprintf(&buffer, 0, message, args);
561
- va_end(args);
562
-
563
- MAKE_STD_ZVAL(ex);
564
- object_init_ex(ex, *pce);
565
-
566
- // Call Twig_Error constructor
567
- MAKE_STD_ZVAL(constructor);
568
- MAKE_STD_ZVAL(zmessage);
569
- MAKE_STD_ZVAL(lineno);
570
- MAKE_STD_ZVAL(filename);
571
- MAKE_STD_ZVAL(filename_func);
572
- MAKE_STD_ZVAL(constructor_retval);
573
-
574
- ZVAL_STRINGL(constructor, "__construct", sizeof("__construct")-1, 1);
575
- ZVAL_STRING(zmessage, buffer, 1);
576
- ZVAL_LONG(lineno, -1);
577
-
578
- // Get template filename
579
- ZVAL_STRINGL(filename_func, "getTemplateName", sizeof("getTemplateName")-1, 1);
580
- call_user_function(EG(function_table), &template, filename_func, filename, 0, 0 TSRMLS_CC);
581
-
582
- constructor_args[0] = zmessage;
583
- constructor_args[1] = lineno;
584
- constructor_args[2] = filename;
585
- call_user_function(EG(function_table), &ex, constructor, constructor_retval, 3, constructor_args TSRMLS_CC);
586
-
587
- zval_ptr_dtor(&constructor_retval);
588
- zval_ptr_dtor(&zmessage);
589
- zval_ptr_dtor(&lineno);
590
- zval_ptr_dtor(&filename);
591
- FREE_DTOR(constructor);
592
- FREE_DTOR(filename_func);
593
- efree(buffer);
594
-
595
- zend_throw_exception_object(ex TSRMLS_CC);
596
- }
597
-
598
- static char *TWIG_GET_CLASS_NAME(zval *object TSRMLS_DC)
599
- {
600
- char *class_name;
601
- zend_uint class_name_len;
602
-
603
- if (Z_TYPE_P(object) != IS_OBJECT) {
604
- return "";
605
- }
606
- #if PHP_API_VERSION >= 20100412
607
- zend_get_object_classname(object, (const char **) &class_name, &class_name_len TSRMLS_CC);
608
- #else
609
- zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC);
610
- #endif
611
- return class_name;
612
- }
613
-
614
- static int twig_add_method_to_class(void *pDest APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
615
- {
616
- zend_class_entry *ce;
617
- zval *retval;
618
- char *item;
619
- size_t item_len;
620
- zend_function *mptr = (zend_function *) pDest;
621
- APPLY_TSRMLS_FETCH();
622
-
623
- if (!(mptr->common.fn_flags & ZEND_ACC_PUBLIC)) {
624
- return 0;
625
- }
626
-
627
- ce = *va_arg(args, zend_class_entry**);
628
- retval = va_arg(args, zval*);
629
-
630
- item_len = strlen(mptr->common.function_name);
631
- item = estrndup(mptr->common.function_name, item_len);
632
- php_strtolower(item, item_len);
633
-
634
- if (strcmp("getenvironment", item) == 0) {
635
- zend_class_entry **twig_template_ce;
636
- if (zend_lookup_class("Twig_Template", strlen("Twig_Template"), &twig_template_ce TSRMLS_CC) == FAILURE) {
637
- return 0;
638
- }
639
- if (instanceof_function(ce, *twig_template_ce TSRMLS_CC)) {
640
- return 0;
641
- }
642
- }
643
-
644
- add_assoc_stringl_ex(retval, item, item_len+1, item, item_len, 0);
645
-
646
- return 0;
647
- }
648
-
649
- static int twig_add_property_to_class(void *pDest APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key)
650
- {
651
- zend_class_entry *ce;
652
- zval *retval;
653
- char *class_name, *prop_name;
654
- zend_property_info *pptr = (zend_property_info *) pDest;
655
- APPLY_TSRMLS_FETCH();
656
-
657
- if (!(pptr->flags & ZEND_ACC_PUBLIC) || (pptr->flags & ZEND_ACC_STATIC)) {
658
- return 0;
659
- }
660
-
661
- ce = *va_arg(args, zend_class_entry**);
662
- retval = va_arg(args, zval*);
663
-
664
- #if PHP_API_VERSION >= 20100412
665
- zend_unmangle_property_name(pptr->name, pptr->name_length, (const char **) &class_name, (const char **) &prop_name);
666
- #else
667
- zend_unmangle_property_name(pptr->name, pptr->name_length, &class_name, &prop_name);
668
- #endif
669
-
670
- add_assoc_string(retval, prop_name, prop_name, 1);
671
-
672
- return 0;
673
- }
674
-
675
- static void twig_add_class_to_cache(zval *cache, zval *object, char *class_name TSRMLS_DC)
676
- {
677
- zval *class_info, *class_methods, *class_properties;
678
- zend_class_entry *class_ce;
679
-
680
- class_ce = zend_get_class_entry(object TSRMLS_CC);
681
-
682
- ALLOC_INIT_ZVAL(class_info);
683
- ALLOC_INIT_ZVAL(class_methods);
684
- ALLOC_INIT_ZVAL(class_properties);
685
- array_init(class_info);
686
- array_init(class_methods);
687
- array_init(class_properties);
688
- // add all methods to self::cache[$class]['methods']
689
- zend_hash_apply_with_arguments(&class_ce->function_table APPLY_TSRMLS_CC, twig_add_method_to_class, 2, &class_ce, class_methods);
690
- zend_hash_apply_with_arguments(&class_ce->properties_info APPLY_TSRMLS_CC, twig_add_property_to_class, 2, &class_ce, class_properties);
691
-
692
- add_assoc_zval(class_info, "methods", class_methods);
693
- add_assoc_zval(class_info, "properties", class_properties);
694
- add_assoc_zval(cache, class_name, class_info);
695
- }
696
-
697
- /* {{{ proto mixed twig_template_get_attributes(TwigTemplate template, mixed object, mixed item, array arguments, string type, boolean isDefinedTest, boolean ignoreStrictCheck)
698
- A C implementation of TwigTemplate::getAttribute() */
699
- PHP_FUNCTION(twig_template_get_attributes)
700
- {
701
- zval *template;
702
- zval *object;
703
- char *item;
704
- int item_len;
705
- zval *zitem, ztmpitem;
706
- zval *arguments = NULL;
707
- zval *ret = NULL;
708
- char *type = NULL;
709
- int type_len = 0;
710
- zend_bool isDefinedTest = 0;
711
- zend_bool ignoreStrictCheck = 0;
712
- int free_ret = 0;
713
- zval *tmp_self_cache;
714
- char *class_name = NULL;
715
- zval *tmp_class;
716
- char *type_name;
717
-
718
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ozz|asbb", &template, &object, &zitem, &arguments, &type, &type_len, &isDefinedTest, &ignoreStrictCheck) == FAILURE) {
719
- return;
720
- }
721
-
722
- // convert the item to a string
723
- ztmpitem = *zitem;
724
- zval_copy_ctor(&ztmpitem);
725
- convert_to_string(&ztmpitem);
726
- item_len = Z_STRLEN(ztmpitem);
727
- item = estrndup(Z_STRVAL(ztmpitem), item_len);
728
- zval_dtor(&ztmpitem);
729
-
730
- if (!type) {
731
- type = "any";
732
- }
733
-
734
- /*
735
- // array
736
- if (\Twig\Template::METHOD_CALL !== $type) {
737
- $arrayItem = is_bool($item) || is_float($item) ? (int) $item : $item;
738
-
739
- if ((is_array($object) && array_key_exists($arrayItem, $object))
740
- || ($object instanceof ArrayAccess && isset($object[$arrayItem]))
741
- ) {
742
- if ($isDefinedTest) {
743
- return true;
744
- }
745
-
746
- return $object[$arrayItem];
747
- }
748
- */
749
-
750
-
751
- if (strcmp("method", type) != 0) {
752
- if ((TWIG_ARRAY_KEY_EXISTS(object, zitem))
753
- || (TWIG_INSTANCE_OF(object, zend_ce_arrayaccess TSRMLS_CC) && TWIG_ISSET_ARRAYOBJECT_ELEMENT(object, zitem TSRMLS_CC))
754
- ) {
755
-
756
- if (isDefinedTest) {
757
- efree(item);
758
- RETURN_TRUE;
759
- }
760
-
761
- ret = TWIG_GET_ARRAY_ELEMENT_ZVAL(object, zitem TSRMLS_CC);
762
-
763
- if (!ret) {
764
- ret = &EG(uninitialized_zval);
765
- }
766
- RETVAL_ZVAL(ret, 1, 0);
767
- if (free_ret) {
768
- zval_ptr_dtor(&ret);
769
- }
770
- efree(item);
771
- return;
772
- }
773
- /*
774
- if (\Twig\Template::ARRAY_CALL === $type) {
775
- if ($isDefinedTest) {
776
- return false;
777
- }
778
- if ($ignoreStrictCheck || !$this->env->isStrictVariables()) {
779
- return null;
780
- }
781
- */
782
- if (strcmp("array", type) == 0 || Z_TYPE_P(object) != IS_OBJECT) {
783
- if (isDefinedTest) {
784
- efree(item);
785
- RETURN_FALSE;
786
- }
787
- if (ignoreStrictCheck || !TWIG_CALL_BOOLEAN(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "isStrictVariables" TSRMLS_CC)) {
788
- efree(item);
789
- return;
790
- }
791
- /*
792
- if ($object instanceof ArrayAccess) {
793
- $message = sprintf('Key "%s" in object with ArrayAccess of class "%s" does not exist', $arrayItem, get_class($object));
794
- } elseif (is_object($object)) {
795
- $message = sprintf('Impossible to access a key "%s" on an object of class "%s" that does not implement ArrayAccess interface', $item, get_class($object));
796
- } elseif (is_array($object)) {
797
- if (empty($object)) {
798
- $message = sprintf('Key "%s" does not exist as the array is empty', $arrayItem);
799
- } else {
800
- $message = sprintf('Key "%s" for array with keys "%s" does not exist', $arrayItem, implode(', ', array_keys($object)));
801
- }
802
- } elseif (\Twig\Template::ARRAY_CALL === $type) {
803
- if (null === $object) {
804
- $message = sprintf('Impossible to access a key ("%s") on a null variable', $item);
805
- } else {
806
- $message = sprintf('Impossible to access a key ("%s") on a %s variable ("%s")', $item, gettype($object), $object);
807
- }
808
- } elseif (null === $object) {
809
- $message = sprintf('Impossible to access an attribute ("%s") on a null variable', $item);
810
- } else {
811
- $message = sprintf('Impossible to access an attribute ("%s") on a %s variable ("%s")', $item, gettype($object), $object);
812
- }
813
- throw new \Twig\Error\RuntimeError($message, -1, $this->getTemplateName());
814
- }
815
- }
816
- */
817
- if (TWIG_INSTANCE_OF(object, zend_ce_arrayaccess TSRMLS_CC)) {
818
- TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Key \"%s\" in object with ArrayAccess of class \"%s\" does not exist.", item, TWIG_GET_CLASS_NAME(object TSRMLS_CC));
819
- } else if (Z_TYPE_P(object) == IS_OBJECT) {
820
- TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Impossible to access a key \"%s\" on an object of class \"%s\" that does not implement ArrayAccess interface.", item, TWIG_GET_CLASS_NAME(object TSRMLS_CC));
821
- } else if (Z_TYPE_P(object) == IS_ARRAY) {
822
- if (0 == zend_hash_num_elements(Z_ARRVAL_P(object))) {
823
- TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Key \"%s\" does not exist as the array is empty.", item);
824
- } else {
825
- char *array_keys = TWIG_IMPLODE_ARRAY_KEYS(", ", object TSRMLS_CC);
826
- TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Key \"%s\" for array with keys \"%s\" does not exist.", item, array_keys);
827
- efree(array_keys);
828
- }
829
- } else {
830
- char *type_name = zend_zval_type_name(object);
831
- Z_ADDREF_P(object);
832
- if (Z_TYPE_P(object) == IS_NULL) {
833
- convert_to_string(object);
834
- TWIG_RUNTIME_ERROR(template TSRMLS_CC,
835
- (strcmp("array", type) == 0)
836
- ? "Impossible to access a key (\"%s\") on a %s variable."
837
- : "Impossible to access an attribute (\"%s\") on a %s variable.",
838
- item, type_name);
839
- } else {
840
- convert_to_string(object);
841
- TWIG_RUNTIME_ERROR(template TSRMLS_CC,
842
- (strcmp("array", type) == 0)
843
- ? "Impossible to access a key (\"%s\") on a %s variable (\"%s\")."
844
- : "Impossible to access an attribute (\"%s\") on a %s variable (\"%s\").",
845
- item, type_name, Z_STRVAL_P(object));
846
- }
847
- zval_ptr_dtor(&object);
848
- }
849
- efree(item);
850
- return;
851
- }
852
- }
853
-
854
- /*
855
- if (!is_object($object)) {
856
- if ($isDefinedTest) {
857
- return false;
858
- }
859
- */
860
-
861
- if (Z_TYPE_P(object) != IS_OBJECT) {
862
- if (isDefinedTest) {
863
- efree(item);
864
- RETURN_FALSE;
865
- }
866
- /*
867
- if ($ignoreStrictCheck || !$this->env->isStrictVariables()) {
868
- return null;
869
- }
870
-
871
- if (null === $object) {
872
- $message = sprintf('Impossible to invoke a method ("%s") on a null variable', $item);
873
- } elseif (is_array($object)) {
874
- $message = sprintf('Impossible to invoke a method ("%s") on an array.', $item);
875
- } else {
876
- $message = sprintf('Impossible to invoke a method ("%s") on a %s variable ("%s")', $item, gettype($object), $object);
877
- }
878
-
879
- throw new \Twig\Error\RuntimeError($message, -1, $this->getTemplateName());
880
- }
881
- */
882
- if (ignoreStrictCheck || !TWIG_CALL_BOOLEAN(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "isStrictVariables" TSRMLS_CC)) {
883
- efree(item);
884
- return;
885
- }
886
-
887
- type_name = zend_zval_type_name(object);
888
- Z_ADDREF_P(object);
889
- if (Z_TYPE_P(object) == IS_NULL) {
890
- TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Impossible to invoke a method (\"%s\") on a null variable.", item);
891
- } else if (Z_TYPE_P(object) == IS_ARRAY) {
892
- TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Impossible to invoke a method (\"%s\") on an array.", item);
893
- } else {
894
- convert_to_string_ex(&object);
895
-
896
- TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Impossible to invoke a method (\"%s\") on a %s variable (\"%s\").", item, type_name, Z_STRVAL_P(object));
897
- }
898
-
899
- zval_ptr_dtor(&object);
900
- efree(item);
901
- return;
902
- }
903
- /*
904
- $class = get_class($object);
905
- */
906
-
907
- class_name = TWIG_GET_CLASS_NAME(object TSRMLS_CC);
908
- tmp_self_cache = TWIG_GET_STATIC_PROPERTY(template, "cache" TSRMLS_CC);
909
- tmp_class = TWIG_GET_ARRAY_ELEMENT(tmp_self_cache, class_name, strlen(class_name) TSRMLS_CC);
910
-
911
- if (!tmp_class) {
912
- twig_add_class_to_cache(tmp_self_cache, object, class_name TSRMLS_CC);
913
- tmp_class = TWIG_GET_ARRAY_ELEMENT(tmp_self_cache, class_name, strlen(class_name) TSRMLS_CC);
914
- }
915
- efree(class_name);
916
-
917
- /*
918
- // object property
919
- if (\Twig\Template::METHOD_CALL !== $type && !$object instanceof \Twig\Template) {
920
- if (isset($object->$item) || array_key_exists((string) $item, $object)) {
921
- if ($isDefinedTest) {
922
- return true;
923
- }
924
-
925
- if ($this->env->hasExtension('\Twig\Extension\SandboxExtension')) {
926
- $this->env->getExtension('\Twig\Extension\SandboxExtension')->checkPropertyAllowed($object, $item);
927
- }
928
-
929
- return $object->$item;
930
- }
931
- }
932
- */
933
- if (strcmp("method", type) != 0 && !TWIG_INSTANCE_OF_USERLAND(object, "Twig_Template" TSRMLS_CC)) {
934
- zval *tmp_properties, *tmp_item;
935
-
936
- tmp_properties = TWIG_GET_ARRAY_ELEMENT(tmp_class, "properties", strlen("properties") TSRMLS_CC);
937
- tmp_item = TWIG_GET_ARRAY_ELEMENT(tmp_properties, item, item_len TSRMLS_CC);
938
-
939
- if (tmp_item || TWIG_HAS_PROPERTY(object, zitem TSRMLS_CC) || TWIG_HAS_DYNAMIC_PROPERTY(object, item, item_len TSRMLS_CC)) {
940
- if (isDefinedTest) {
941
- efree(item);
942
- RETURN_TRUE;
943
- }
944
- if (TWIG_CALL_SB(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "hasExtension", "Twig_Extension_Sandbox" TSRMLS_CC)) {
945
- TWIG_CALL_ZZ(TWIG_CALL_S(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "getExtension", "Twig_Extension_Sandbox" TSRMLS_CC), "checkPropertyAllowed", object, zitem TSRMLS_CC);
946
- }
947
- if (EG(exception)) {
948
- efree(item);
949
- return;
950
- }
951
-
952
- ret = TWIG_PROPERTY(object, zitem TSRMLS_CC);
953
- efree(item);
954
- RETURN_ZVAL(ret, 1, 0);
955
- }
956
- }
957
- /*
958
- // object method
959
- if (!isset(self::$cache[$class]['methods'])) {
960
- if ($object instanceof self) {
961
- $ref = new \ReflectionClass($class);
962
- $methods = [];
963
-
964
- foreach ($ref->getMethods(ReflectionMethod::IS_PUBLIC) as $refMethod) {
965
- $methodName = strtolower($refMethod->name);
966
-
967
- // Accessing the environment from templates is forbidden to prevent untrusted changes to the environment
968
- if ('getenvironment' !== $methodName) {
969
- $methods[$methodName] = true;
970
- }
971
- }
972
-
973
- self::$cache[$class]['methods'] = $methods;
974
- } else {
975
- self::$cache[$class]['methods'] = array_change_key_case(array_flip(get_class_methods($object)));
976
- }
977
- }
978
-
979
- $call = false;
980
- $lcItem = strtolower($item);
981
- if (isset(self::$cache[$class]['methods'][$lcItem])) {
982
- $method = (string) $item;
983
- } elseif (isset(self::$cache[$class]['methods']['get'.$lcItem])) {
984
- $method = 'get'.$item;
985
- } elseif (isset(self::$cache[$class]['methods']['is'.$lcItem])) {
986
- $method = 'is'.$item;
987
- } elseif (isset(self::$cache[$class]['methods']['__call'])) {
988
- $method = (string) $item;
989
- $call = true;
990
- */
991
- {
992
- int call = 0;
993
- char *lcItem = TWIG_STRTOLOWER(item, item_len);
994
- int lcItem_length;
995
- char *method = NULL;
996
- char *methodForDeprecation = NULL;
997
- char *tmp_method_name_get;
998
- char *tmp_method_name_is;
999
- zval *zmethod;
1000
- zval *tmp_methods;
1001
-
1002
- lcItem_length = strlen(lcItem);
1003
- tmp_method_name_get = emalloc(4 + lcItem_length);
1004
- tmp_method_name_is = emalloc(3 + lcItem_length);
1005
-
1006
- sprintf(tmp_method_name_get, "get%s", lcItem);
1007
- sprintf(tmp_method_name_is, "is%s", lcItem);
1008
-
1009
- tmp_methods = TWIG_GET_ARRAY_ELEMENT(tmp_class, "methods", strlen("methods") TSRMLS_CC);
1010
- methodForDeprecation = emalloc(item_len + 1);
1011
- sprintf(methodForDeprecation, "%s", item);
1012
-
1013
- if (TWIG_GET_ARRAY_ELEMENT(tmp_methods, lcItem, lcItem_length TSRMLS_CC)) {
1014
- method = item;
1015
- } else if (TWIG_GET_ARRAY_ELEMENT(tmp_methods, tmp_method_name_get, lcItem_length + 3 TSRMLS_CC)) {
1016
- method = tmp_method_name_get;
1017
- } else if (TWIG_GET_ARRAY_ELEMENT(tmp_methods, tmp_method_name_is, lcItem_length + 2 TSRMLS_CC)) {
1018
- method = tmp_method_name_is;
1019
- } else if (TWIG_GET_ARRAY_ELEMENT(tmp_methods, "__call", 6 TSRMLS_CC)) {
1020
- method = item;
1021
- call = 1;
1022
- /*
1023
- } else {
1024
- if ($isDefinedTest) {
1025
- return false;
1026
- }
1027
-
1028
- if ($ignoreStrictCheck || !$this->env->isStrictVariables()) {
1029
- return null;
1030
- }
1031
-
1032
- throw new \Twig\Error\RuntimeError(sprintf('Method "%s" for object "%s" does not exist.', $item, get_class($object)), -1, $this->getTemplateName());
1033
- }
1034
-
1035
- if ($isDefinedTest) {
1036
- return true;
1037
- }
1038
- */
1039
- } else {
1040
- efree(tmp_method_name_get);
1041
- efree(tmp_method_name_is);
1042
- efree(lcItem);
1043
-
1044
- if (isDefinedTest) {
1045
- efree(item);
1046
- RETURN_FALSE;
1047
- }
1048
- if (ignoreStrictCheck || !TWIG_CALL_BOOLEAN(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "isStrictVariables" TSRMLS_CC)) {
1049
- efree(item);
1050
- return;
1051
- }
1052
- TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Neither the property \"%s\" nor one of the methods \"%s()\", \"get%s()\"/\"is%s()\" or \"__call()\" exist and have public access in class \"%s\".", item, item, item, item, TWIG_GET_CLASS_NAME(object TSRMLS_CC));
1053
- efree(item);
1054
- return;
1055
- }
1056
-
1057
- if (isDefinedTest) {
1058
- efree(tmp_method_name_get);
1059
- efree(tmp_method_name_is);
1060
- efree(lcItem);efree(item);
1061
- RETURN_TRUE;
1062
- }
1063
- /*
1064
- if ($this->env->hasExtension('\Twig\Extension\SandboxExtension')) {
1065
- $this->env->getExtension('\Twig\Extension\SandboxExtension')->checkMethodAllowed($object, $method);
1066
- }
1067
- */
1068
- MAKE_STD_ZVAL(zmethod);
1069
- ZVAL_STRING(zmethod, method, 1);
1070
- if (TWIG_CALL_SB(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "hasExtension", "Twig_Extension_Sandbox" TSRMLS_CC)) {
1071
- TWIG_CALL_ZZ(TWIG_CALL_S(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "getExtension", "Twig_Extension_Sandbox" TSRMLS_CC), "checkMethodAllowed", object, zmethod TSRMLS_CC);
1072
- }
1073
- zval_ptr_dtor(&zmethod);
1074
- if (EG(exception)) {
1075
- efree(tmp_method_name_get);
1076
- efree(tmp_method_name_is);
1077
- efree(lcItem);efree(item);
1078
- return;
1079
- }
1080
- /*
1081
- // Some objects throw exceptions when they have __call, and the method we try
1082
- // to call is not supported. If ignoreStrictCheck is true, we should return null.
1083
- try {
1084
- $ret = call_user_func_array([$object, $method], $arguments);
1085
- } catch (\BadMethodCallException $e) {
1086
- if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) {
1087
- return null;
1088
- }
1089
- throw $e;
1090
- }
1091
- */
1092
- ret = TWIG_CALL_USER_FUNC_ARRAY(object, method, arguments TSRMLS_CC);
1093
- if (EG(exception) && TWIG_INSTANCE_OF(EG(exception), spl_ce_BadMethodCallException TSRMLS_CC)) {
1094
- if (ignoreStrictCheck || !TWIG_CALL_BOOLEAN(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "isStrictVariables" TSRMLS_CC)) {
1095
- efree(tmp_method_name_get);
1096
- efree(tmp_method_name_is);
1097
- efree(lcItem);efree(item);
1098
- zend_clear_exception(TSRMLS_C);
1099
- return;
1100
- }
1101
- }
1102
- free_ret = 1;
1103
- efree(tmp_method_name_get);
1104
- efree(tmp_method_name_is);
1105
- efree(lcItem);
1106
- /*
1107
- // @deprecated in 1.28
1108
- if ($object instanceof Twig_TemplateInterface) {
1109
- $self = $object->getTemplateName() === $this->getTemplateName();
1110
- $message = sprintf('Calling "%s" on template "%s" from template "%s" is deprecated since version 1.28 and won\'t be supported anymore in 2.0.', $item, $object->getTemplateName(), $this->getTemplateName());
1111
- if ('renderBlock' === $method || 'displayBlock' === $method) {
1112
- $message .= sprintf(' Use block("%s"%s) instead).', $arguments[0], $self ? '' : ', template');
1113
- } elseif ('hasBlock' === $method) {
1114
- $message .= sprintf(' Use "block("%s"%s) is defined" instead).', $arguments[0], $self ? '' : ', template');
1115
- } elseif ('render' === $method || 'display' === $method) {
1116
- $message .= sprintf(' Use include("%s") instead).', $object->getTemplateName());
1117
- }
1118
- @trigger_error($message, E_USER_DEPRECATED);
1119
-
1120
- return $ret === '' ? '' : new \Twig\Markup($ret, $this->env->getCharset());
1121
- }
1122
-
1123
- return $ret;
1124
- */
1125
- efree(item);
1126
- // ret can be null, if e.g. the called method throws an exception
1127
- if (ret) {
1128
- if (TWIG_INSTANCE_OF_USERLAND(object, "Twig_TemplateInterface" TSRMLS_CC)) {
1129
- int self;
1130
- int old_error_reporting;
1131
- zval *object_filename;
1132
- zval *this_filename;
1133
- zval *filename_func;
1134
- char *deprecation_message_complement = NULL;
1135
- char *deprecation_message = NULL;
1136
-
1137
- MAKE_STD_ZVAL(object_filename);
1138
- MAKE_STD_ZVAL(this_filename);
1139
- MAKE_STD_ZVAL(filename_func);
1140
-
1141
- // Get templates names
1142
- ZVAL_STRINGL(filename_func, "getTemplateName", sizeof("getTemplateName")-1, 1);
1143
- call_user_function(EG(function_table), &object, filename_func, object_filename, 0, 0 TSRMLS_CC);
1144
- ZVAL_STRINGL(filename_func, "getTemplateName", sizeof("getTemplateName")-1, 1);
1145
- call_user_function(EG(function_table), &template, filename_func, this_filename, 0, 0 TSRMLS_CC);
1146
-
1147
- self = (strcmp(Z_STRVAL_P(object_filename), Z_STRVAL_P(this_filename)) == 0);
1148
-
1149
- if (strcmp(methodForDeprecation, "renderBlock") == 0 || strcmp(methodForDeprecation, "displayBlock") == 0) {
1150
- zval **arg0;
1151
- zend_hash_index_find(HASH_OF(arguments), 0, (void **) &arg0);
1152
- asprintf(
1153
- &deprecation_message_complement,
1154
- " Use block(\"%s\"%s) instead).",
1155
- Z_STRVAL_PP(arg0),
1156
- self ? "" : ", template"
1157
- );
1158
- } else if (strcmp(methodForDeprecation, "hasBlock") == 0) {
1159
- zval **arg0;
1160
- zend_hash_index_find(HASH_OF(arguments), 0, (void **) &arg0);
1161
- asprintf(
1162
- &deprecation_message_complement,
1163
- " Use \"block(\"%s\"%s) is defined\" instead).",
1164
- Z_STRVAL_PP(arg0),
1165
- self ? "" : ", template"
1166
- );
1167
- } else if (strcmp(methodForDeprecation, "render") == 0 || strcmp(methodForDeprecation, "display") == 0) {
1168
- asprintf(
1169
- &deprecation_message_complement,
1170
- " Use include(\"%s\") instead).",
1171
- Z_STRVAL_P(object_filename)
1172
- );
1173
- } else {
1174
- deprecation_message_complement = (char*)calloc(0, sizeof(char));
1175
- }
1176
-
1177
- asprintf(
1178
- &deprecation_message,
1179
- "Calling \"%s\" on template \"%s\" from template \"%s\" is deprecated since version 1.28 and won't be supported anymore in 2.0.%s",
1180
- methodForDeprecation,
1181
- Z_STRVAL_P(object_filename),
1182
- Z_STRVAL_P(this_filename),
1183
- deprecation_message_complement
1184
- );
1185
-
1186
- old_error_reporting = EG(error_reporting);
1187
- EG(error_reporting) = 0;
1188
- zend_error(E_USER_DEPRECATED, "%s", deprecation_message);
1189
- EG(error_reporting) = old_error_reporting;
1190
-
1191
- FREE_DTOR(filename_func)
1192
- FREE_DTOR(object_filename)
1193
- FREE_DTOR(this_filename)
1194
- free(deprecation_message);
1195
- free(deprecation_message_complement);
1196
-
1197
- if (Z_STRLEN_P(ret) != 0) {
1198
- zval *charset = TWIG_CALL_USER_FUNC_ARRAY(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "getCharset", NULL TSRMLS_CC);
1199
- TWIG_NEW(return_value, "Twig_Markup", ret, charset TSRMLS_CC);
1200
- zval_ptr_dtor(&charset);
1201
- if (ret) {
1202
- zval_ptr_dtor(&ret);
1203
- }
1204
- efree(methodForDeprecation);
1205
- return;
1206
- }
1207
- }
1208
-
1209
- RETVAL_ZVAL(ret, 1, 0);
1210
- if (free_ret) {
1211
- zval_ptr_dtor(&ret);
1212
- }
1213
- }
1214
-
1215
- efree(methodForDeprecation);
1216
- }
1217
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Autoloader.php DELETED
@@ -1,52 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- @trigger_error('The Twig_Autoloader class is deprecated since version 1.21 and will be removed in 2.0. Use Composer instead.', E_USER_DEPRECATED);
13
-
14
- /**
15
- * Autoloads Twig classes.
16
- *
17
- * @author Fabien Potencier <fabien@symfony.com>
18
- *
19
- * @deprecated since 1.21 and will be removed in 2.0. Use Composer instead. 2.0.
20
- */
21
- class Twig_Autoloader
22
- {
23
- /**
24
- * Registers Twig_Autoloader as an SPL autoloader.
25
- *
26
- * @param bool $prepend whether to prepend the autoloader or not
27
- */
28
- public static function register($prepend = false)
29
- {
30
- @trigger_error('Using Twig_Autoloader is deprecated since version 1.21. Use Composer instead.', E_USER_DEPRECATED);
31
-
32
- spl_autoload_register([__CLASS__, 'autoload'], true, $prepend);
33
- }
34
-
35
- /**
36
- * Handles autoloading of classes.
37
- *
38
- * @param string $class a class name
39
- */
40
- public static function autoload($class)
41
- {
42
- if (0 !== strpos($class, 'Twig')) {
43
- return;
44
- }
45
-
46
- if (is_file($file = __DIR__.'/../'.str_replace(['_', "\0"], ['/', ''], $class).'.php')) {
47
- require $file;
48
- } elseif (is_file($file = __DIR__.'/../../src/'.str_replace(['Twig\\', '\\', "\0"], ['', '/', ''], $class).'.php')) {
49
- require $file;
50
- }
51
- }
52
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/BaseNodeVisitor.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\NodeVisitor\AbstractNodeVisitor;
4
-
5
- class_exists('Twig\NodeVisitor\AbstractNodeVisitor');
6
-
7
- if (\false) {
8
- class Twig_BaseNodeVisitor extends AbstractNodeVisitor
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Cache/Filesystem.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Cache\FilesystemCache;
4
-
5
- class_exists('Twig\Cache\FilesystemCache');
6
-
7
- if (\false) {
8
- class Twig_Cache_Filesystem extends FilesystemCache
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Cache/Null.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Cache\NullCache;
4
-
5
- class_exists('Twig\Cache\NullCache');
6
-
7
- if (\false) {
8
- class Twig_Cache_Null extends NullCache
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/CacheInterface.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Cache\CacheInterface;
4
-
5
- class_exists('Twig\Cache\CacheInterface');
6
-
7
- if (\false) {
8
- class Twig_CacheInterface extends CacheInterface
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Compiler.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Compiler;
4
-
5
- class_exists('Twig\Compiler');
6
-
7
- if (\false) {
8
- class Twig_Compiler extends Compiler
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/CompilerInterface.php DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- /**
13
- * Interface implemented by compiler classes.
14
- *
15
- * @author Fabien Potencier <fabien@symfony.com>
16
- *
17
- * @deprecated since 1.12 (to be removed in 3.0)
18
- */
19
- interface Twig_CompilerInterface
20
- {
21
- /**
22
- * Compiles a node.
23
- *
24
- * @return $this
25
- */
26
- public function compile(Twig_NodeInterface $node);
27
-
28
- /**
29
- * Gets the current PHP code after compilation.
30
- *
31
- * @return string The PHP code
32
- */
33
- public function getSource();
34
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/ContainerRuntimeLoader.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\RuntimeLoader\ContainerRuntimeLoader;
4
-
5
- class_exists('Twig\RuntimeLoader\ContainerRuntimeLoader');
6
-
7
- if (\false) {
8
- class Twig_ContainerRuntimeLoader extends ContainerRuntimeLoader
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Environment.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Environment;
4
-
5
- class_exists('Twig\Environment');
6
-
7
- if (\false) {
8
- class Twig_Environment extends Environment
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Error.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Error\Error;
4
-
5
- class_exists('Twig\Error\Error');
6
-
7
- if (\false) {
8
- class Twig_Error extends Error
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Error/Loader.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Error\LoaderError;
4
-
5
- class_exists('Twig\Error\LoaderError');
6
-
7
- if (\false) {
8
- class Twig_Error_Loader extends LoaderError
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Error/Runtime.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Error\RuntimeError;
4
-
5
- class_exists('Twig\Error\RuntimeError');
6
-
7
- if (\false) {
8
- class Twig_Error_Runtime extends RuntimeError
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Error/Syntax.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Error\SyntaxError;
4
-
5
- class_exists('Twig\Error\SyntaxError');
6
-
7
- if (\false) {
8
- class Twig_Error_Syntax extends SyntaxError
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/ExistsLoaderInterface.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Loader\ExistsLoaderInterface;
4
-
5
- class_exists('Twig\Loader\ExistsLoaderInterface');
6
-
7
- if (\false) {
8
- class Twig_ExistsLoaderInterface extends ExistsLoaderInterface
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/ExpressionParser.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\ExpressionParser;
4
-
5
- class_exists('Twig\ExpressionParser');
6
-
7
- if (\false) {
8
- class Twig_ExpressionParser extends ExpressionParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Extension.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Extension\AbstractExtension;
4
-
5
- class_exists('Twig\Extension\AbstractExtension');
6
-
7
- if (\false) {
8
- class Twig_Extension extends AbstractExtension
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Extension/Core.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Extension\CoreExtension;
4
-
5
- class_exists('Twig\Extension\CoreExtension');
6
-
7
- if (\false) {
8
- class Twig_Extension_Core extends CoreExtension
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Extension/Debug.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Extension\DebugExtension;
4
-
5
- class_exists('Twig\Extension\DebugExtension');
6
-
7
- if (\false) {
8
- class Twig_Extension_Debug extends DebugExtension
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Extension/Escaper.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Extension\EscaperExtension;
4
-
5
- class_exists('Twig\Extension\EscaperExtension');
6
-
7
- if (\false) {
8
- class Twig_Extension_Escaper extends EscaperExtension
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Extension/GlobalsInterface.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Extension\GlobalsInterface;
4
-
5
- class_exists('Twig\Extension\GlobalsInterface');
6
-
7
- if (\false) {
8
- class Twig_Extension_GlobalsInterface extends GlobalsInterface
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Extension/InitRuntimeInterface.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Extension\InitRuntimeInterface;
4
-
5
- class_exists('Twig\Extension\InitRuntimeInterface');
6
-
7
- if (\false) {
8
- class Twig_Extension_InitRuntimeInterface extends InitRuntimeInterface
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Extension/Optimizer.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Extension\OptimizerExtension;
4
-
5
- class_exists('Twig\Extension\OptimizerExtension');
6
-
7
- if (\false) {
8
- class Twig_Extension_Optimizer extends OptimizerExtension
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Extension/Profiler.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Extension\ProfilerExtension;
4
-
5
- class_exists('Twig\Extension\ProfilerExtension');
6
-
7
- if (\false) {
8
- class Twig_Extension_Profiler extends ProfilerExtension
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Extension/Sandbox.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Extension\SandboxExtension;
4
-
5
- class_exists('Twig\Extension\SandboxExtension');
6
-
7
- if (\false) {
8
- class Twig_Extension_Sandbox extends SandboxExtension
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Extension/Staging.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Extension\StagingExtension;
4
-
5
- class_exists('Twig\Extension\StagingExtension');
6
-
7
- if (\false) {
8
- class Twig_Extension_Staging extends StagingExtension
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Extension/StringLoader.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Extension\StringLoaderExtension;
4
-
5
- class_exists('Twig\Extension\StringLoaderExtension');
6
-
7
- if (\false) {
8
- class Twig_Extension_StringLoader extends StringLoaderExtension
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/ExtensionInterface.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Extension\ExtensionInterface;
4
-
5
- class_exists('Twig\Extension\ExtensionInterface');
6
-
7
- if (\false) {
8
- class Twig_ExtensionInterface extends ExtensionInterface
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/FactoryRuntimeLoader.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\RuntimeLoader\FactoryRuntimeLoader;
4
-
5
- class_exists('Twig\RuntimeLoader\FactoryRuntimeLoader');
6
-
7
- if (\false) {
8
- class Twig_FactoryRuntimeLoader extends FactoryRuntimeLoader
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/FileExtensionEscapingStrategy.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\FileExtensionEscapingStrategy;
4
-
5
- class_exists('Twig\FileExtensionEscapingStrategy');
6
-
7
- if (\false) {
8
- class Twig_FileExtensionEscapingStrategy extends FileExtensionEscapingStrategy
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Filter.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- use Twig\Node\Node;
13
-
14
- @trigger_error('The Twig_Filter class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFilter instead.', E_USER_DEPRECATED);
15
-
16
- /**
17
- * Represents a template filter.
18
- *
19
- * Use \Twig\TwigFilter instead.
20
- *
21
- * @author Fabien Potencier <fabien@symfony.com>
22
- *
23
- * @deprecated since 1.12 (to be removed in 2.0)
24
- */
25
- abstract class Twig_Filter implements Twig_FilterInterface, Twig_FilterCallableInterface
26
- {
27
- protected $options;
28
- protected $arguments = [];
29
-
30
- public function __construct(array $options = [])
31
- {
32
- $this->options = array_merge([
33
- 'needs_environment' => false,
34
- 'needs_context' => false,
35
- 'pre_escape' => null,
36
- 'preserves_safety' => null,
37
- 'callable' => null,
38
- ], $options);
39
- }
40
-
41
- public function setArguments($arguments)
42
- {
43
- $this->arguments = $arguments;
44
- }
45
-
46
- public function getArguments()
47
- {
48
- return $this->arguments;
49
- }
50
-
51
- public function needsEnvironment()
52
- {
53
- return $this->options['needs_environment'];
54
- }
55
-
56
- public function needsContext()
57
- {
58
- return $this->options['needs_context'];
59
- }
60
-
61
- public function getSafe(Node $filterArgs)
62
- {
63
- if (isset($this->options['is_safe'])) {
64
- return $this->options['is_safe'];
65
- }
66
-
67
- if (isset($this->options['is_safe_callback'])) {
68
- return \call_user_func($this->options['is_safe_callback'], $filterArgs);
69
- }
70
- }
71
-
72
- public function getPreservesSafety()
73
- {
74
- return $this->options['preserves_safety'];
75
- }
76
-
77
- public function getPreEscape()
78
- {
79
- return $this->options['pre_escape'];
80
- }
81
-
82
- public function getCallable()
83
- {
84
- return $this->options['callable'];
85
- }
86
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Filter/Function.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- @trigger_error('The Twig_Filter_Function class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFilter instead.', E_USER_DEPRECATED);
13
-
14
- /**
15
- * Represents a function template filter.
16
- *
17
- * Use \Twig\TwigFilter instead.
18
- *
19
- * @author Fabien Potencier <fabien@symfony.com>
20
- *
21
- * @deprecated since 1.12 (to be removed in 2.0)
22
- */
23
- class Twig_Filter_Function extends Twig_Filter
24
- {
25
- protected $function;
26
-
27
- public function __construct($function, array $options = [])
28
- {
29
- $options['callable'] = $function;
30
-
31
- parent::__construct($options);
32
-
33
- $this->function = $function;
34
- }
35
-
36
- public function compile()
37
- {
38
- return $this->function;
39
- }
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Filter/Method.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- use Twig\Extension\ExtensionInterface;
13
-
14
- @trigger_error('The Twig_Filter_Method class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFilter instead.', E_USER_DEPRECATED);
15
-
16
- /**
17
- * Represents a method template filter.
18
- *
19
- * Use \Twig\TwigFilter instead.
20
- *
21
- * @author Fabien Potencier <fabien@symfony.com>
22
- *
23
- * @deprecated since 1.12 (to be removed in 2.0)
24
- */
25
- class Twig_Filter_Method extends Twig_Filter
26
- {
27
- protected $extension;
28
- protected $method;
29
-
30
- public function __construct(ExtensionInterface $extension, $method, array $options = [])
31
- {
32
- $options['callable'] = [$extension, $method];
33
-
34
- parent::__construct($options);
35
-
36
- $this->extension = $extension;
37
- $this->method = $method;
38
- }
39
-
40
- public function compile()
41
- {
42
- return sprintf('$this->env->getExtension(\'%s\')->%s', \get_class($this->extension), $this->method);
43
- }
44
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Filter/Node.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- @trigger_error('The Twig_Filter_Node class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFilter instead.', E_USER_DEPRECATED);
13
-
14
- /**
15
- * Represents a template filter as a node.
16
- *
17
- * Use \Twig\TwigFilter instead.
18
- *
19
- * @author Fabien Potencier <fabien@symfony.com>
20
- *
21
- * @deprecated since 1.12 (to be removed in 2.0)
22
- */
23
- class Twig_Filter_Node extends Twig_Filter
24
- {
25
- protected $class;
26
-
27
- public function __construct($class, array $options = [])
28
- {
29
- parent::__construct($options);
30
-
31
- $this->class = $class;
32
- }
33
-
34
- public function getClass()
35
- {
36
- return $this->class;
37
- }
38
-
39
- public function compile()
40
- {
41
- }
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/FilterCallableInterface.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- /**
13
- * Represents a callable template filter.
14
- *
15
- * Use \Twig\TwigFilter instead.
16
- *
17
- * @author Fabien Potencier <fabien@symfony.com>
18
- *
19
- * @deprecated since 1.12 (to be removed in 2.0)
20
- */
21
- interface Twig_FilterCallableInterface
22
- {
23
- public function getCallable();
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/FilterInterface.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- use Twig\Node\Node;
13
-
14
- /**
15
- * Represents a template filter.
16
- *
17
- * Use \Twig\TwigFilter instead.
18
- *
19
- * @author Fabien Potencier <fabien@symfony.com>
20
- *
21
- * @deprecated since 1.12 (to be removed in 2.0)
22
- */
23
- interface Twig_FilterInterface
24
- {
25
- /**
26
- * Compiles a filter.
27
- *
28
- * @return string The PHP code for the filter
29
- */
30
- public function compile();
31
-
32
- public function needsEnvironment();
33
-
34
- public function needsContext();
35
-
36
- public function getSafe(Node $filterArgs);
37
-
38
- public function getPreservesSafety();
39
-
40
- public function getPreEscape();
41
-
42
- public function setArguments($arguments);
43
-
44
- public function getArguments();
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Function.php DELETED
@@ -1,76 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- use Twig\Node\Node;
13
-
14
- @trigger_error('The Twig_Function class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFunction instead.', E_USER_DEPRECATED);
15
-
16
- /**
17
- * Represents a template function.
18
- *
19
- * Use \Twig\TwigFunction instead.
20
- *
21
- * @author Fabien Potencier <fabien@symfony.com>
22
- *
23
- * @deprecated since 1.12 (to be removed in 2.0)
24
- */
25
- abstract class Twig_Function implements Twig_FunctionInterface, Twig_FunctionCallableInterface
26
- {
27
- protected $options;
28
- protected $arguments = [];
29
-
30
- public function __construct(array $options = [])
31
- {
32
- $this->options = array_merge([
33
- 'needs_environment' => false,
34
- 'needs_context' => false,
35
- 'callable' => null,
36
- ], $options);
37
- }
38
-
39
- public function setArguments($arguments)
40
- {
41
- $this->arguments = $arguments;
42
- }
43
-
44
- public function getArguments()
45
- {
46
- return $this->arguments;
47
- }
48
-
49
- public function needsEnvironment()
50
- {
51
- return $this->options['needs_environment'];
52
- }
53
-
54
- public function needsContext()
55
- {
56
- return $this->options['needs_context'];
57
- }
58
-
59
- public function getSafe(Node $functionArgs)
60
- {
61
- if (isset($this->options['is_safe'])) {
62
- return $this->options['is_safe'];
63
- }
64
-
65
- if (isset($this->options['is_safe_callback'])) {
66
- return \call_user_func($this->options['is_safe_callback'], $functionArgs);
67
- }
68
-
69
- return [];
70
- }
71
-
72
- public function getCallable()
73
- {
74
- return $this->options['callable'];
75
- }
76
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Function/Function.php DELETED
@@ -1,41 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- * (c) Arnaud Le Blanc
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
12
-
13
- @trigger_error('The Twig_Function_Function class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFunction instead.', E_USER_DEPRECATED);
14
-
15
- /**
16
- * Represents a function template function.
17
- *
18
- * Use \Twig\TwigFunction instead.
19
- *
20
- * @author Arnaud Le Blanc <arnaud.lb@gmail.com>
21
- *
22
- * @deprecated since 1.12 (to be removed in 2.0)
23
- */
24
- class Twig_Function_Function extends Twig_Function
25
- {
26
- protected $function;
27
-
28
- public function __construct($function, array $options = [])
29
- {
30
- $options['callable'] = $function;
31
-
32
- parent::__construct($options);
33
-
34
- $this->function = $function;
35
- }
36
-
37
- public function compile()
38
- {
39
- return $this->function;
40
- }
41
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Function/Method.php DELETED
@@ -1,45 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- * (c) Arnaud Le Blanc
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
12
-
13
- use Twig\Extension\ExtensionInterface;
14
-
15
- @trigger_error('The Twig_Function_Method class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFunction instead.', E_USER_DEPRECATED);
16
-
17
- /**
18
- * Represents a method template function.
19
- *
20
- * Use \Twig\TwigFunction instead.
21
- *
22
- * @author Arnaud Le Blanc <arnaud.lb@gmail.com>
23
- *
24
- * @deprecated since 1.12 (to be removed in 2.0)
25
- */
26
- class Twig_Function_Method extends Twig_Function
27
- {
28
- protected $extension;
29
- protected $method;
30
-
31
- public function __construct(ExtensionInterface $extension, $method, array $options = [])
32
- {
33
- $options['callable'] = [$extension, $method];
34
-
35
- parent::__construct($options);
36
-
37
- $this->extension = $extension;
38
- $this->method = $method;
39
- }
40
-
41
- public function compile()
42
- {
43
- return sprintf('$this->env->getExtension(\'%s\')->%s', \get_class($this->extension), $this->method);
44
- }
45
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Function/Node.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- @trigger_error('The Twig_Function_Node class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigFunction instead.', E_USER_DEPRECATED);
13
-
14
- /**
15
- * Represents a template function as a node.
16
- *
17
- * Use \Twig\TwigFunction instead.
18
- *
19
- * @author Fabien Potencier <fabien@symfony.com>
20
- *
21
- * @deprecated since 1.12 (to be removed in 2.0)
22
- */
23
- class Twig_Function_Node extends Twig_Function
24
- {
25
- protected $class;
26
-
27
- public function __construct($class, array $options = [])
28
- {
29
- parent::__construct($options);
30
-
31
- $this->class = $class;
32
- }
33
-
34
- public function getClass()
35
- {
36
- return $this->class;
37
- }
38
-
39
- public function compile()
40
- {
41
- }
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/FunctionCallableInterface.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- /**
13
- * Represents a callable template function.
14
- *
15
- * Use \Twig\TwigFunction instead.
16
- *
17
- * @author Fabien Potencier <fabien@symfony.com>
18
- *
19
- * @deprecated since 1.12 (to be removed in 2.0)
20
- */
21
- interface Twig_FunctionCallableInterface
22
- {
23
- public function getCallable();
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/FunctionInterface.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- * (c) Arnaud Le Blanc
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
12
-
13
- use Twig\Node\Node;
14
-
15
- /**
16
- * Represents a template function.
17
- *
18
- * Use \Twig\TwigFunction instead.
19
- *
20
- * @author Arnaud Le Blanc <arnaud.lb@gmail.com>
21
- *
22
- * @deprecated since 1.12 (to be removed in 2.0)
23
- */
24
- interface Twig_FunctionInterface
25
- {
26
- /**
27
- * Compiles a function.
28
- *
29
- * @return string The PHP code for the function
30
- */
31
- public function compile();
32
-
33
- public function needsEnvironment();
34
-
35
- public function needsContext();
36
-
37
- public function getSafe(Node $filterArgs);
38
-
39
- public function setArguments($arguments);
40
-
41
- public function getArguments();
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Lexer.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Lexer;
4
-
5
- class_exists('Twig\Lexer');
6
-
7
- if (\false) {
8
- class Twig_Lexer extends Lexer
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/LexerInterface.php DELETED
@@ -1,36 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- use Twig\Error\SyntaxError;
13
- use Twig\Source;
14
- use Twig\TokenStream;
15
-
16
- /**
17
- * Interface implemented by lexer classes.
18
- *
19
- * @author Fabien Potencier <fabien@symfony.com>
20
- *
21
- * @deprecated since 1.12 (to be removed in 3.0)
22
- */
23
- interface Twig_LexerInterface
24
- {
25
- /**
26
- * Tokenizes a source code.
27
- *
28
- * @param string|Source $code The source code
29
- * @param string $name A unique identifier for the source code
30
- *
31
- * @return TokenStream
32
- *
33
- * @throws SyntaxError When the code is syntactically wrong
34
- */
35
- public function tokenize($code, $name = null);
36
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Loader/Array.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Loader\ArrayLoader;
4
-
5
- class_exists('Twig\Loader\ArrayLoader');
6
-
7
- if (\false) {
8
- class Twig_Loader_Array extends ArrayLoader
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Loader/Chain.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Loader\ChainLoader;
4
-
5
- class_exists('Twig\Loader\ChainLoader');
6
-
7
- if (\false) {
8
- class Twig_Loader_Chain extends ChainLoader
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Loader/Filesystem.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Loader\FilesystemLoader;
4
-
5
- class_exists('Twig\Loader\FilesystemLoader');
6
-
7
- if (\false) {
8
- class Twig_Loader_Filesystem extends FilesystemLoader
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Loader/String.php DELETED
@@ -1,63 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- use Twig\Loader\ExistsLoaderInterface;
13
- use Twig\Loader\LoaderInterface;
14
- use Twig\Loader\SourceContextLoaderInterface;
15
- use Twig\Source;
16
-
17
- @trigger_error('The Twig_Loader_String class is deprecated since version 1.18.1 and will be removed in 2.0. Use "Twig\Loader\ArrayLoader" instead or "Twig\Environment::createTemplate()".', E_USER_DEPRECATED);
18
-
19
- /**
20
- * Loads a template from a string.
21
- *
22
- * This loader should NEVER be used. It only exists for Twig internal purposes.
23
- *
24
- * When using this loader with a cache mechanism, you should know that a new cache
25
- * key is generated each time a template content "changes" (the cache key being the
26
- * source code of the template). If you don't want to see your cache grows out of
27
- * control, you need to take care of clearing the old cache file by yourself.
28
- *
29
- * @deprecated since 1.18.1 (to be removed in 2.0)
30
- *
31
- * @internal
32
- *
33
- * @author Fabien Potencier <fabien@symfony.com>
34
- */
35
- class Twig_Loader_String implements LoaderInterface, ExistsLoaderInterface, SourceContextLoaderInterface
36
- {
37
- public function getSource($name)
38
- {
39
- @trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', \get_class($this)), E_USER_DEPRECATED);
40
-
41
- return $name;
42
- }
43
-
44
- public function getSourceContext($name)
45
- {
46
- return new Source($name, $name);
47
- }
48
-
49
- public function exists($name)
50
- {
51
- return true;
52
- }
53
-
54
- public function getCacheKey($name)
55
- {
56
- return $name;
57
- }
58
-
59
- public function isFresh($name, $time)
60
- {
61
- return true;
62
- }
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/LoaderInterface.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Loader\LoaderInterface;
4
-
5
- class_exists('Twig\Loader\LoaderInterface');
6
-
7
- if (\false) {
8
- class Twig_LoaderInterface extends LoaderInterface
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Markup.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Markup;
4
-
5
- class_exists('Twig\Markup');
6
-
7
- if (\false) {
8
- class Twig_Markup extends Markup
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Node;
4
-
5
- class_exists('Twig\Node\Node');
6
-
7
- if (\false) {
8
- class Twig_Node extends Node
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/AutoEscape.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\AutoEscapeNode;
4
-
5
- class_exists('Twig\Node\AutoEscapeNode');
6
-
7
- if (\false) {
8
- class Twig_Node_AutoEscape extends AutoEscapeNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Block.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\BlockNode;
4
-
5
- class_exists('Twig\Node\BlockNode');
6
-
7
- if (\false) {
8
- class Twig_Node_Block extends BlockNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/BlockReference.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\BlockReferenceNode;
4
-
5
- class_exists('Twig\Node\BlockReferenceNode');
6
-
7
- if (\false) {
8
- class Twig_Node_BlockReference extends BlockReferenceNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Body.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\BodyNode;
4
-
5
- class_exists('Twig\Node\BodyNode');
6
-
7
- if (\false) {
8
- class Twig_Node_Body extends BodyNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/CheckSecurity.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\CheckSecurityNode;
4
-
5
- class_exists('Twig\Node\CheckSecurityNode');
6
-
7
- if (\false) {
8
- class Twig_Node_CheckSecurity extends CheckSecurityNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Deprecated.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\DeprecatedNode;
4
-
5
- class_exists('Twig\Node\DeprecatedNode');
6
-
7
- if (\false) {
8
- class Twig_Node_Deprecated extends DeprecatedNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Do.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\DoNode;
4
-
5
- class_exists('Twig\Node\DoNode');
6
-
7
- if (\false) {
8
- class Twig_Node_Do extends DoNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Embed.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\EmbedNode;
4
-
5
- class_exists('Twig\Node\EmbedNode');
6
-
7
- if (\false) {
8
- class Twig_Node_Embed extends EmbedNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\AbstractExpression;
4
-
5
- class_exists('Twig\Node\Expression\AbstractExpression');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression extends AbstractExpression
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Array.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\ArrayExpression;
4
-
5
- class_exists('Twig\Node\Expression\ArrayExpression');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Array extends ArrayExpression
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/AssignName.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\AssignNameExpression;
4
-
5
- class_exists('Twig\Node\Expression\AssignNameExpression');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_AssignName extends AssignNameExpression
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\AbstractBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\AbstractBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary extends AbstractBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\AddBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\AddBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_Add extends AddBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/And.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\AndBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\AndBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_And extends AndBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseAnd.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\BitwiseAndBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\BitwiseAndBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_BitwiseAnd extends BitwiseAndBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseOr.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\BitwiseOrBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\BitwiseOrBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_BitwiseOr extends BitwiseOrBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/BitwiseXor.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\BitwiseXorBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\BitwiseXorBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_BitwiseXor extends BitwiseXorBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Concat.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\ConcatBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\ConcatBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_Concat extends ConcatBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Div.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\DivBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\DivBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_Div extends DivBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/EndsWith.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\EndsWithBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\EndsWithBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_EndsWith extends EndsWithBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Equal.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\EqualBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\EqualBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_Equal extends EqualBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/FloorDiv.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\FloorDivBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\FloorDivBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_FloorDiv extends FloorDivBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Greater.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\GreaterBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\GreaterBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_Greater extends GreaterBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/GreaterEqual.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\GreaterEqualBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\GreaterEqualBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_GreaterEqual extends GreaterEqualBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/In.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\InBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\InBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_In extends InBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Less.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\LessBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\LessBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_Less extends LessBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/LessEqual.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\LessEqualBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\LessEqualBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_LessEqual extends LessEqualBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Matches.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\MatchesBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\MatchesBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_Matches extends MatchesBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mod.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\ModBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\ModBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_Mod extends ModBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Mul.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\MulBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\MulBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_Mul extends MulBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotEqual.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\NotEqualBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\NotEqualBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_NotEqual extends NotEqualBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/NotIn.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\NotInBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\NotInBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_NotIn extends NotInBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Or.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\OrBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\OrBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_Or extends OrBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Power.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\PowerBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\PowerBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_Power extends PowerBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Range.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\RangeBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\RangeBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_Range extends RangeBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/StartsWith.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\StartsWithBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\StartsWithBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_StartsWith extends StartsWithBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Sub.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Binary\SubBinary;
4
-
5
- class_exists('Twig\Node\Expression\Binary\SubBinary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Binary_Sub extends SubBinary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/BlockReference.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\BlockReferenceExpression;
4
-
5
- class_exists('Twig\Node\Expression\BlockReferenceExpression');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_BlockReference extends BlockReferenceExpression
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Call.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\CallExpression;
4
-
5
- class_exists('Twig\Node\Expression\CallExpression');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Call extends CallExpression
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Conditional.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\ConditionalExpression;
4
-
5
- class_exists('Twig\Node\Expression\ConditionalExpression');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Conditional extends ConditionalExpression
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Constant.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\ConstantExpression;
4
-
5
- class_exists('Twig\Node\Expression\ConstantExpression');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Constant extends ConstantExpression
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/ExtensionReference.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- use Twig\Compiler;
13
- use Twig\Node\Expression\AbstractExpression;
14
-
15
- @trigger_error('The Twig_Node_Expression_ExtensionReference class is deprecated since version 1.23 and will be removed in 2.0.', E_USER_DEPRECATED);
16
-
17
- /**
18
- * Represents an extension call node.
19
- *
20
- * @author Fabien Potencier <fabien@symfony.com>
21
- *
22
- * @deprecated since 1.23 and will be removed in 2.0.
23
- */
24
- class Twig_Node_Expression_ExtensionReference extends AbstractExpression
25
- {
26
- public function __construct($name, $lineno, $tag = null)
27
- {
28
- parent::__construct([], ['name' => $name], $lineno, $tag);
29
- }
30
-
31
- public function compile(Compiler $compiler)
32
- {
33
- $compiler->raw(sprintf("\$this->env->getExtension('%s')", $this->getAttribute('name')));
34
- }
35
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Filter.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\FilterExpression;
4
-
5
- class_exists('Twig\Node\Expression\FilterExpression');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Filter extends FilterExpression
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Filter/Default.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Filter\DefaultFilter;
4
-
5
- class_exists('Twig\Node\Expression\Filter\DefaultFilter');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Filter_Default extends DefaultFilter
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Function.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\FunctionExpression;
4
-
5
- class_exists('Twig\Node\Expression\FunctionExpression');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Function extends FunctionExpression
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/GetAttr.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\GetAttrExpression;
4
-
5
- class_exists('Twig\Node\Expression\GetAttrExpression');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_GetAttr extends GetAttrExpression
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/MethodCall.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\MethodCallExpression;
4
-
5
- class_exists('Twig\Node\Expression\MethodCallExpression');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_MethodCall extends MethodCallExpression
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Name.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\NameExpression;
4
-
5
- class_exists('Twig\Node\Expression\NameExpression');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Name extends NameExpression
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/NullCoalesce.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\NullCoalesceExpression;
4
-
5
- class_exists('Twig\Node\Expression\NullCoalesceExpression');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_NullCoalesce extends NullCoalesceExpression
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Parent.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\ParentExpression;
4
-
5
- class_exists('Twig\Node\Expression\ParentExpression');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Parent extends ParentExpression
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/TempName.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\TempNameExpression;
4
-
5
- class_exists('Twig\Node\Expression\TempNameExpression');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_TempName extends TempNameExpression
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Test.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\TestExpression;
4
-
5
- class_exists('Twig\Node\Expression\TestExpression');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Test extends TestExpression
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Test/Constant.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Test\ConstantTest;
4
-
5
- class_exists('Twig\Node\Expression\Test\ConstantTest');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Test_Constant extends ConstantTest
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Test/Defined.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Test\DefinedTest;
4
-
5
- class_exists('Twig\Node\Expression\Test\DefinedTest');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Test_Defined extends DefinedTest
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Test/Divisibleby.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Test\DivisiblebyTest;
4
-
5
- class_exists('Twig\Node\Expression\Test\DivisiblebyTest');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Test_Divisibleby extends DivisiblebyTest
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Test/Even.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Test\EvenTest;
4
-
5
- class_exists('Twig\Node\Expression\Test\EvenTest');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Test_Even extends EvenTest
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Test/Null.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Test\NullTest;
4
-
5
- class_exists('Twig\Node\Expression\Test\NullTest');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Test_Null extends NullTest
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Test/Odd.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Test\OddTest;
4
-
5
- class_exists('Twig\Node\Expression\Test\OddTest');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Test_Odd extends OddTest
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Test/Sameas.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Test\SameasTest;
4
-
5
- class_exists('Twig\Node\Expression\Test\SameasTest');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Test_Sameas extends SameasTest
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Unary.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Unary\AbstractUnary;
4
-
5
- class_exists('Twig\Node\Expression\Unary\AbstractUnary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Unary extends AbstractUnary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Neg.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Unary\NegUnary;
4
-
5
- class_exists('Twig\Node\Expression\Unary\NegUnary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Unary_Neg extends NegUnary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Not.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Unary\NotUnary;
4
-
5
- class_exists('Twig\Node\Expression\Unary\NotUnary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Unary_Not extends NotUnary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Expression/Unary/Pos.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\Expression\Unary\PosUnary;
4
-
5
- class_exists('Twig\Node\Expression\Unary\PosUnary');
6
-
7
- if (\false) {
8
- class Twig_Node_Expression_Unary_Pos extends PosUnary
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Flush.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\FlushNode;
4
-
5
- class_exists('Twig\Node\FlushNode');
6
-
7
- if (\false) {
8
- class Twig_Node_Flush extends FlushNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/For.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\ForNode;
4
-
5
- class_exists('Twig\Node\ForNode');
6
-
7
- if (\false) {
8
- class Twig_Node_For extends ForNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/ForLoop.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\ForLoopNode;
4
-
5
- class_exists('Twig\Node\ForLoopNode');
6
-
7
- if (\false) {
8
- class Twig_Node_ForLoop extends ForLoopNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/If.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\IfNode;
4
-
5
- class_exists('Twig\Node\IfNode');
6
-
7
- if (\false) {
8
- class Twig_Node_If extends IfNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Import.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\ImportNode;
4
-
5
- class_exists('Twig\Node\ImportNode');
6
-
7
- if (\false) {
8
- class Twig_Node_Import extends ImportNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Include.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\IncludeNode;
4
-
5
- class_exists('Twig\Node\IncludeNode');
6
-
7
- if (\false) {
8
- class Twig_Node_Include extends IncludeNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Macro.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\MacroNode;
4
-
5
- class_exists('Twig\Node\MacroNode');
6
-
7
- if (\false) {
8
- class Twig_Node_Macro extends MacroNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Module.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\ModuleNode;
4
-
5
- class_exists('Twig\Node\ModuleNode');
6
-
7
- if (\false) {
8
- class Twig_Node_Module extends ModuleNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Print.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\PrintNode;
4
-
5
- class_exists('Twig\Node\PrintNode');
6
-
7
- if (\false) {
8
- class Twig_Node_Print extends PrintNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Sandbox.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\SandboxNode;
4
-
5
- class_exists('Twig\Node\SandboxNode');
6
-
7
- if (\false) {
8
- class Twig_Node_Sandbox extends SandboxNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/SandboxedPrint.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\SandboxedPrintNode;
4
-
5
- class_exists('Twig\Node\SandboxedPrintNode');
6
-
7
- if (\false) {
8
- class Twig_Node_SandboxedPrint extends SandboxedPrintNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Set.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\SetNode;
4
-
5
- class_exists('Twig\Node\SetNode');
6
-
7
- if (\false) {
8
- class Twig_Node_Set extends SetNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/SetTemp.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\SetTempNode;
4
-
5
- class_exists('Twig\Node\SetTempNode');
6
-
7
- if (\false) {
8
- class Twig_Node_SetTemp extends SetTempNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Spaceless.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\SpacelessNode;
4
-
5
- class_exists('Twig\Node\SpacelessNode');
6
-
7
- if (\false) {
8
- class Twig_Node_Spaceless extends SpacelessNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/Text.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\TextNode;
4
-
5
- class_exists('Twig\Node\TextNode');
6
-
7
- if (\false) {
8
- class Twig_Node_Text extends TextNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Node/With.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\WithNode;
4
-
5
- class_exists('Twig\Node\WithNode');
6
-
7
- if (\false) {
8
- class Twig_Node_With extends WithNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/NodeCaptureInterface.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\NodeCaptureInterface;
4
-
5
- class_exists('Twig\Node\NodeCaptureInterface');
6
-
7
- if (\false) {
8
- class Twig_NodeCaptureInterface extends NodeCaptureInterface
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/NodeInterface.php DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- use Twig\Compiler;
13
-
14
- /**
15
- * Represents a node in the AST.
16
- *
17
- * @author Fabien Potencier <fabien@symfony.com>
18
- *
19
- * @deprecated since 1.12 (to be removed in 3.0)
20
- */
21
- interface Twig_NodeInterface extends \Countable, \IteratorAggregate
22
- {
23
- /**
24
- * Compiles the node to PHP.
25
- */
26
- public function compile(Compiler $compiler);
27
-
28
- /**
29
- * @deprecated since 1.27 (to be removed in 2.0)
30
- */
31
- public function getLine();
32
-
33
- public function getNodeTag();
34
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/NodeOutputInterface.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Node\NodeOutputInterface;
4
-
5
- class_exists('Twig\Node\NodeOutputInterface');
6
-
7
- if (\false) {
8
- class Twig_NodeOutputInterface extends NodeOutputInterface
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/NodeTraverser.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\NodeTraverser;
4
-
5
- class_exists('Twig\NodeTraverser');
6
-
7
- if (\false) {
8
- class Twig_NodeTraverser extends NodeTraverser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/NodeVisitor/Escaper.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\NodeVisitor\EscaperNodeVisitor;
4
-
5
- class_exists('Twig\NodeVisitor\EscaperNodeVisitor');
6
-
7
- if (\false) {
8
- class Twig_NodeVisitor_Escaper extends EscaperNodeVisitor
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\NodeVisitor\OptimizerNodeVisitor;
4
-
5
- class_exists('Twig\NodeVisitor\OptimizerNodeVisitor');
6
-
7
- if (\false) {
8
- class Twig_NodeVisitor_Optimizer extends OptimizerNodeVisitor
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/NodeVisitor/SafeAnalysis.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\NodeVisitor\SafeAnalysisNodeVisitor;
4
-
5
- class_exists('Twig\NodeVisitor\SafeAnalysisNodeVisitor');
6
-
7
- if (\false) {
8
- class Twig_NodeVisitor_SafeAnalysis extends SafeAnalysisNodeVisitor
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/NodeVisitor/Sandbox.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\NodeVisitor\SandboxNodeVisitor;
4
-
5
- class_exists('Twig\NodeVisitor\SandboxNodeVisitor');
6
-
7
- if (\false) {
8
- class Twig_NodeVisitor_Sandbox extends SandboxNodeVisitor
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/NodeVisitorInterface.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\NodeVisitor\NodeVisitorInterface;
4
-
5
- class_exists('Twig\NodeVisitor\NodeVisitorInterface');
6
-
7
- if (\false) {
8
- class Twig_NodeVisitorInterface extends NodeVisitorInterface
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Parser.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Parser;
4
-
5
- class_exists('Twig\Parser');
6
-
7
- if (\false) {
8
- class Twig_Parser extends Parser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/ParserInterface.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- use Twig\Error\SyntaxError;
13
- use Twig\Node\ModuleNode;
14
- use Twig\TokenStream;
15
-
16
- /**
17
- * Interface implemented by parser classes.
18
- *
19
- * @author Fabien Potencier <fabien@symfony.com>
20
- *
21
- * @deprecated since 1.12 (to be removed in 3.0)
22
- */
23
- interface Twig_ParserInterface
24
- {
25
- /**
26
- * Converts a token stream to a node tree.
27
- *
28
- * @return ModuleNode
29
- *
30
- * @throws SyntaxError When the token stream is syntactically or semantically wrong
31
- */
32
- public function parse(TokenStream $stream);
33
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Profiler/Dumper/Base.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Profiler\Dumper\BaseDumper;
4
-
5
- class_exists('Twig\Profiler\Dumper\BaseDumper');
6
-
7
- if (\false) {
8
- class Twig_Profiler_Dumper_Base extends BaseDumper
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Profiler/Dumper/Blackfire.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Profiler\Dumper\BlackfireDumper;
4
-
5
- class_exists('Twig\Profiler\Dumper\BlackfireDumper');
6
-
7
- if (\false) {
8
- class Twig_Profiler_Dumper_Blackfire extends BlackfireDumper
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Profiler/Dumper/Html.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Profiler\Dumper\HtmlDumper;
4
-
5
- class_exists('Twig\Profiler\Dumper\HtmlDumper');
6
-
7
- if (\false) {
8
- class Twig_Profiler_Dumper_Html extends HtmlDumper
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Profiler/Dumper/Text.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Profiler\Dumper\TextDumper;
4
-
5
- class_exists('Twig\Profiler\Dumper\TextDumper');
6
-
7
- if (\false) {
8
- class Twig_Profiler_Dumper_Text extends TextDumper
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Profiler/Node/EnterProfile.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Profiler\Node\EnterProfileNode;
4
-
5
- class_exists('Twig\Profiler\Node\EnterProfileNode');
6
-
7
- if (\false) {
8
- class Twig_Profiler_Node_EnterProfile extends EnterProfileNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Profiler/Node/LeaveProfile.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Profiler\Node\LeaveProfileNode;
4
-
5
- class_exists('Twig\Profiler\Node\LeaveProfileNode');
6
-
7
- if (\false) {
8
- class Twig_Profiler_Node_LeaveProfile extends LeaveProfileNode
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Profiler\NodeVisitor\ProfilerNodeVisitor;
4
-
5
- class_exists('Twig\Profiler\NodeVisitor\ProfilerNodeVisitor');
6
-
7
- if (\false) {
8
- class Twig_Profiler_NodeVisitor_Profiler extends ProfilerNodeVisitor
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Profiler/Profile.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Profiler\Profile;
4
-
5
- class_exists('Twig\Profiler\Profile');
6
-
7
- if (\false) {
8
- class Twig_Profiler_Profile extends Profile
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/RuntimeLoaderInterface.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\RuntimeLoader\RuntimeLoaderInterface;
4
-
5
- class_exists('Twig\RuntimeLoader\RuntimeLoaderInterface');
6
-
7
- if (\false) {
8
- class Twig_RuntimeLoaderInterface extends RuntimeLoaderInterface
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Sandbox/SecurityError.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Sandbox\SecurityError;
4
-
5
- class_exists('Twig\Sandbox\SecurityError');
6
-
7
- if (\false) {
8
- class Twig_Sandbox_SecurityError extends SecurityError
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFilterError.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Sandbox\SecurityNotAllowedFilterError;
4
-
5
- class_exists('Twig\Sandbox\SecurityNotAllowedFilterError');
6
-
7
- if (\false) {
8
- class Twig_Sandbox_SecurityNotAllowedFilterError extends SecurityNotAllowedFilterError
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedFunctionError.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Sandbox\SecurityNotAllowedFunctionError;
4
-
5
- class_exists('Twig\Sandbox\SecurityNotAllowedFunctionError');
6
-
7
- if (\false) {
8
- class Twig_Sandbox_SecurityNotAllowedFunctionError extends SecurityNotAllowedFunctionError
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedMethodError.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Sandbox\SecurityNotAllowedMethodError;
4
-
5
- class_exists('Twig\Sandbox\SecurityNotAllowedMethodError');
6
-
7
- if (\false) {
8
- class Twig_Sandbox_SecurityNotAllowedMethodError extends SecurityNotAllowedMethodError
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedPropertyError.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Sandbox\SecurityNotAllowedPropertyError;
4
-
5
- class_exists('Twig\Sandbox\SecurityNotAllowedPropertyError');
6
-
7
- if (\false) {
8
- class Twig_Sandbox_SecurityNotAllowedPropertyError extends SecurityNotAllowedPropertyError
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Sandbox/SecurityNotAllowedTagError.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Sandbox\SecurityNotAllowedTagError;
4
-
5
- class_exists('Twig\Sandbox\SecurityNotAllowedTagError');
6
-
7
- if (\false) {
8
- class Twig_Sandbox_SecurityNotAllowedTagError extends SecurityNotAllowedTagError
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicy.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Sandbox\SecurityPolicy;
4
-
5
- class_exists('Twig\Sandbox\SecurityPolicy');
6
-
7
- if (\false) {
8
- class Twig_Sandbox_SecurityPolicy extends SecurityPolicy
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Sandbox/SecurityPolicyInterface.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Sandbox\SecurityPolicyInterface;
4
-
5
- class_exists('Twig\Sandbox\SecurityPolicyInterface');
6
-
7
- if (\false) {
8
- class Twig_Sandbox_SecurityPolicyInterface extends SecurityPolicyInterface
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/SimpleFilter.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TwigFilter;
4
-
5
- class_exists('Twig\TwigFilter');
6
-
7
- if (\false) {
8
- class Twig_SimpleFilter extends TwigFilter
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/SimpleFunction.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TwigFunction;
4
-
5
- class_exists('Twig\TwigFunction');
6
-
7
- if (\false) {
8
- class Twig_SimpleFunction extends TwigFunction
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/SimpleTest.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TwigTest;
4
-
5
- class_exists('Twig\TwigTest');
6
-
7
- if (\false) {
8
- class Twig_SimpleTest extends TwigTest
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Source.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Source;
4
-
5
- class_exists('Twig\Source');
6
-
7
- if (\false) {
8
- class Twig_Source extends Source
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/SourceContextLoaderInterface.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Loader\SourceContextLoaderInterface;
4
-
5
- class_exists('Twig\Loader\SourceContextLoaderInterface');
6
-
7
- if (\false) {
8
- class Twig_SourceContextLoaderInterface extends SourceContextLoaderInterface
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Template.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Template;
4
-
5
- class_exists('Twig\Template');
6
-
7
- if (\false) {
8
- class Twig_Template extends Template
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TemplateInterface.php DELETED
@@ -1,50 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- use Twig\Environment;
13
-
14
- /**
15
- * Interface implemented by all compiled templates.
16
- *
17
- * @author Fabien Potencier <fabien@symfony.com>
18
- *
19
- * @deprecated since 1.12 (to be removed in 3.0)
20
- */
21
- interface Twig_TemplateInterface
22
- {
23
- const ANY_CALL = 'any';
24
- const ARRAY_CALL = 'array';
25
- const METHOD_CALL = 'method';
26
-
27
- /**
28
- * Renders the template with the given context and returns it as string.
29
- *
30
- * @param array $context An array of parameters to pass to the template
31
- *
32
- * @return string The rendered template
33
- */
34
- public function render(array $context);
35
-
36
- /**
37
- * Displays the template with the given context.
38
- *
39
- * @param array $context An array of parameters to pass to the template
40
- * @param array $blocks An array of blocks to pass to the template
41
- */
42
- public function display(array $context, array $blocks = []);
43
-
44
- /**
45
- * Returns the bound environment for this template.
46
- *
47
- * @return Environment
48
- */
49
- public function getEnvironment();
50
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TemplateWrapper.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TemplateWrapper;
4
-
5
- class_exists('Twig\TemplateWrapper');
6
-
7
- if (\false) {
8
- class Twig_TemplateWrapper extends TemplateWrapper
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Test.php DELETED
@@ -1,37 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- @trigger_error('The Twig_Test class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigTest instead.', E_USER_DEPRECATED);
13
-
14
- /**
15
- * Represents a template test.
16
- *
17
- * @author Fabien Potencier <fabien@symfony.com>
18
- *
19
- * @deprecated since 1.12 (to be removed in 2.0)
20
- */
21
- abstract class Twig_Test implements Twig_TestInterface, Twig_TestCallableInterface
22
- {
23
- protected $options;
24
- protected $arguments = [];
25
-
26
- public function __construct(array $options = [])
27
- {
28
- $this->options = array_merge([
29
- 'callable' => null,
30
- ], $options);
31
- }
32
-
33
- public function getCallable()
34
- {
35
- return $this->options['callable'];
36
- }
37
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Test/Function.php DELETED
@@ -1,38 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- @trigger_error('The Twig_Test_Function class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigTest instead.', E_USER_DEPRECATED);
13
-
14
- /**
15
- * Represents a function template test.
16
- *
17
- * @author Fabien Potencier <fabien@symfony.com>
18
- *
19
- * @deprecated since 1.12 (to be removed in 2.0)
20
- */
21
- class Twig_Test_Function extends Twig_Test
22
- {
23
- protected $function;
24
-
25
- public function __construct($function, array $options = [])
26
- {
27
- $options['callable'] = $function;
28
-
29
- parent::__construct($options);
30
-
31
- $this->function = $function;
32
- }
33
-
34
- public function compile()
35
- {
36
- return $this->function;
37
- }
38
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Test\IntegrationTestCase;
4
-
5
- class_exists('Twig\Test\IntegrationTestCase');
6
-
7
- if (\false) {
8
- class Twig_Test_IntegrationTestCase extends IntegrationTestCase
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Test/Method.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- use Twig\Extension\ExtensionInterface;
13
-
14
- @trigger_error('The Twig_Test_Method class is deprecated since version 1.12 and will be removed in 2.0. Use \Twig\TwigTest instead.', E_USER_DEPRECATED);
15
-
16
- /**
17
- * Represents a method template test.
18
- *
19
- * @author Fabien Potencier <fabien@symfony.com>
20
- *
21
- * @deprecated since 1.12 (to be removed in 2.0)
22
- */
23
- class Twig_Test_Method extends Twig_Test
24
- {
25
- protected $extension;
26
- protected $method;
27
-
28
- public function __construct(ExtensionInterface $extension, $method, array $options = [])
29
- {
30
- $options['callable'] = [$extension, $method];
31
-
32
- parent::__construct($options);
33
-
34
- $this->extension = $extension;
35
- $this->method = $method;
36
- }
37
-
38
- public function compile()
39
- {
40
- return sprintf('$this->env->getExtension(\'%s\')->%s', \get_class($this->extension), $this->method);
41
- }
42
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Test/Node.php DELETED
@@ -1,40 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- @trigger_error('The Twig_Test_Node class is deprecated since version 1.12 and will be removed in 2.0.', E_USER_DEPRECATED);
13
-
14
- /**
15
- * Represents a template test as a Node.
16
- *
17
- * @author Fabien Potencier <fabien@symfony.com>
18
- *
19
- * @deprecated since 1.12 (to be removed in 2.0)
20
- */
21
- class Twig_Test_Node extends Twig_Test
22
- {
23
- protected $class;
24
-
25
- public function __construct($class, array $options = [])
26
- {
27
- parent::__construct($options);
28
-
29
- $this->class = $class;
30
- }
31
-
32
- public function getClass()
33
- {
34
- return $this->class;
35
- }
36
-
37
- public function compile()
38
- {
39
- }
40
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Test\NodeTestCase;
4
-
5
- class_exists('Twig\Test\NodeTestCase');
6
-
7
- if (\false) {
8
- class Twig_Test_NodeTestCase extends NodeTestCase
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TestCallableInterface.php DELETED
@@ -1,22 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- /**
13
- * Represents a callable template test.
14
- *
15
- * @author Fabien Potencier <fabien@symfony.com>
16
- *
17
- * @deprecated since 1.12 (to be removed in 2.0)
18
- */
19
- interface Twig_TestCallableInterface
20
- {
21
- public function getCallable();
22
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TestInterface.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- /**
13
- * Represents a template test.
14
- *
15
- * @author Fabien Potencier <fabien@symfony.com>
16
- *
17
- * @deprecated since 1.12 (to be removed in 2.0)
18
- */
19
- interface Twig_TestInterface
20
- {
21
- /**
22
- * Compiles a test.
23
- *
24
- * @return string The PHP code for the test
25
- */
26
- public function compile();
27
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Token.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Token;
4
-
5
- class_exists('Twig\Token');
6
-
7
- if (\false) {
8
- class Twig_Token extends Token
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\AbstractTokenParser;
4
-
5
- class_exists('Twig\TokenParser\AbstractTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser extends AbstractTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser/AutoEscape.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\AutoEscapeTokenParser;
4
-
5
- class_exists('Twig\TokenParser\AutoEscapeTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser_AutoEscape extends AutoEscapeTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser/Block.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\BlockTokenParser;
4
-
5
- class_exists('Twig\TokenParser\BlockTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser_Block extends BlockTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser/Deprecated.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\DeprecatedTokenParser;
4
-
5
- class_exists('Twig\TokenParser\DeprecatedTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser_Deprecated extends DeprecatedTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser/Do.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\DoTokenParser;
4
-
5
- class_exists('Twig\TokenParser\DoTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser_Do extends DoTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser/Embed.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\EmbedTokenParser;
4
-
5
- class_exists('Twig\TokenParser\EmbedTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser_Embed extends EmbedTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser/Extends.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\ExtendsTokenParser;
4
-
5
- class_exists('Twig\TokenParser\ExtendsTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser_Extends extends ExtendsTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser/Filter.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\FilterTokenParser;
4
-
5
- class_exists('Twig\TokenParser\FilterTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser_Filter extends FilterTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser/Flush.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\FlushTokenParser;
4
-
5
- class_exists('Twig\TokenParser\FlushTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser_Flush extends FlushTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser/For.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\ForTokenParser;
4
-
5
- class_exists('Twig\TokenParser\ForTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser_For extends ForTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser/From.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\FromTokenParser;
4
-
5
- class_exists('Twig\TokenParser\FromTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser_From extends FromTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser/If.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\IfTokenParser;
4
-
5
- class_exists('Twig\TokenParser\IfTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser_If extends IfTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser/Import.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\ImportTokenParser;
4
-
5
- class_exists('Twig\TokenParser\ImportTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser_Import extends ImportTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser/Include.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\IncludeTokenParser;
4
-
5
- class_exists('Twig\TokenParser\IncludeTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser_Include extends IncludeTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser/Macro.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\MacroTokenParser;
4
-
5
- class_exists('Twig\TokenParser\MacroTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser_Macro extends MacroTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser/Sandbox.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\SandboxTokenParser;
4
-
5
- class_exists('Twig\TokenParser\SandboxTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser_Sandbox extends SandboxTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser/Set.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\SetTokenParser;
4
-
5
- class_exists('Twig\TokenParser\SetTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser_Set extends SetTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser/Spaceless.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\SpacelessTokenParser;
4
-
5
- class_exists('Twig\TokenParser\SpacelessTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser_Spaceless extends SpacelessTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser/Use.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\UseTokenParser;
4
-
5
- class_exists('Twig\TokenParser\UseTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser_Use extends UseTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParser/With.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\WithTokenParser;
4
-
5
- class_exists('Twig\TokenParser\WithTokenParser');
6
-
7
- if (\false) {
8
- class Twig_TokenParser_With extends WithTokenParser
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParserBroker.php DELETED
@@ -1,122 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- * (c) Arnaud Le Blanc
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
12
-
13
- use Twig\TokenParser\TokenParserInterface;
14
-
15
- /**
16
- * Default implementation of a token parser broker.
17
- *
18
- * @author Arnaud Le Blanc <arnaud.lb@gmail.com>
19
- *
20
- * @deprecated since 1.12 (to be removed in 2.0)
21
- */
22
- class Twig_TokenParserBroker implements Twig_TokenParserBrokerInterface
23
- {
24
- protected $parser;
25
- protected $parsers = [];
26
- protected $brokers = [];
27
-
28
- /**
29
- * @param array|\Traversable $parsers A \Traversable of Twig_TokenParserInterface instances
30
- * @param array|\Traversable $brokers A \Traversable of Twig_TokenParserBrokerInterface instances
31
- * @param bool $triggerDeprecationError
32
- */
33
- public function __construct($parsers = [], $brokers = [], $triggerDeprecationError = true)
34
- {
35
- if ($triggerDeprecationError) {
36
- @trigger_error('The '.__CLASS__.' class is deprecated since version 1.12 and will be removed in 2.0.', E_USER_DEPRECATED);
37
- }
38
-
39
- foreach ($parsers as $parser) {
40
- if (!$parser instanceof TokenParserInterface) {
41
- throw new \LogicException('$parsers must a an array of Twig_TokenParserInterface.');
42
- }
43
- $this->parsers[$parser->getTag()] = $parser;
44
- }
45
- foreach ($brokers as $broker) {
46
- if (!$broker instanceof Twig_TokenParserBrokerInterface) {
47
- throw new \LogicException('$brokers must a an array of Twig_TokenParserBrokerInterface.');
48
- }
49
- $this->brokers[] = $broker;
50
- }
51
- }
52
-
53
- public function addTokenParser(TokenParserInterface $parser)
54
- {
55
- $this->parsers[$parser->getTag()] = $parser;
56
- }
57
-
58
- public function removeTokenParser(TokenParserInterface $parser)
59
- {
60
- $name = $parser->getTag();
61
- if (isset($this->parsers[$name]) && $parser === $this->parsers[$name]) {
62
- unset($this->parsers[$name]);
63
- }
64
- }
65
-
66
- public function addTokenParserBroker(self $broker)
67
- {
68
- $this->brokers[] = $broker;
69
- }
70
-
71
- public function removeTokenParserBroker(self $broker)
72
- {
73
- if (false !== $pos = array_search($broker, $this->brokers)) {
74
- unset($this->brokers[$pos]);
75
- }
76
- }
77
-
78
- /**
79
- * Gets a suitable TokenParser for a tag.
80
- *
81
- * First looks in parsers, then in brokers.
82
- *
83
- * @param string $tag A tag name
84
- *
85
- * @return TokenParserInterface|null A Twig_TokenParserInterface or null if no suitable TokenParser was found
86
- */
87
- public function getTokenParser($tag)
88
- {
89
- if (isset($this->parsers[$tag])) {
90
- return $this->parsers[$tag];
91
- }
92
- $broker = end($this->brokers);
93
- while (false !== $broker) {
94
- $parser = $broker->getTokenParser($tag);
95
- if (null !== $parser) {
96
- return $parser;
97
- }
98
- $broker = prev($this->brokers);
99
- }
100
- }
101
-
102
- public function getParsers()
103
- {
104
- return $this->parsers;
105
- }
106
-
107
- public function getParser()
108
- {
109
- return $this->parser;
110
- }
111
-
112
- public function setParser(Twig_ParserInterface $parser)
113
- {
114
- $this->parser = $parser;
115
- foreach ($this->parsers as $tokenParser) {
116
- $tokenParser->setParser($parser);
117
- }
118
- foreach ($this->brokers as $broker) {
119
- $broker->setParser($parser);
120
- }
121
- }
122
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php DELETED
@@ -1,46 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- * (c) Arnaud Le Blanc
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
12
-
13
- use Twig\TokenParser\TokenParserInterface;
14
-
15
- /**
16
- * Interface implemented by token parser brokers.
17
- *
18
- * Token parser brokers allows to implement custom logic in the process of resolving a token parser for a given tag name.
19
- *
20
- * @author Arnaud Le Blanc <arnaud.lb@gmail.com>
21
- *
22
- * @deprecated since 1.12 (to be removed in 2.0)
23
- */
24
- interface Twig_TokenParserBrokerInterface
25
- {
26
- /**
27
- * Gets a TokenParser suitable for a tag.
28
- *
29
- * @param string $tag A tag name
30
- *
31
- * @return TokenParserInterface|null A Twig_TokenParserInterface or null if no suitable TokenParser was found
32
- */
33
- public function getTokenParser($tag);
34
-
35
- /**
36
- * Calls Twig\TokenParser\TokenParserInterface::setParser on all parsers the implementation knows of.
37
- */
38
- public function setParser(Twig_ParserInterface $parser);
39
-
40
- /**
41
- * Gets the Twig_ParserInterface.
42
- *
43
- * @return Twig_ParserInterface|null A Twig_ParserInterface instance or null
44
- */
45
- public function getParser();
46
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenParserInterface.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenParser\TokenParserInterface;
4
-
5
- class_exists('Twig\TokenParser\TokenParserInterface');
6
-
7
- if (\false) {
8
- class Twig_TokenParserInterface extends TokenParserInterface
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/TokenStream.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\TokenStream;
4
-
5
- class_exists('Twig\TokenStream');
6
-
7
- if (\false) {
8
- class Twig_TokenStream extends TokenStream
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Util/DeprecationCollector.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Util\DeprecationCollector;
4
-
5
- class_exists('Twig\Util\DeprecationCollector');
6
-
7
- if (\false) {
8
- class Twig_Util_DeprecationCollector extends DeprecationCollector
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/lib/Twig/Util/TemplateDirIterator.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- use Twig\Util\TemplateDirIterator;
4
-
5
- class_exists('Twig\Util\TemplateDirIterator');
6
-
7
- if (\false) {
8
- class Twig_Util_TemplateDirIterator extends TemplateDirIterator
9
- {
10
- }
11
- }
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/phpunit.xml.dist DELETED
@@ -1,33 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
-
3
- <phpunit backupGlobals="false"
4
- backupStaticAttributes="false"
5
- colors="true"
6
- convertErrorsToExceptions="true"
7
- convertNoticesToExceptions="true"
8
- convertWarningsToExceptions="true"
9
- processIsolation="false"
10
- stopOnFailure="false"
11
- bootstrap="vendor/autoload.php"
12
- >
13
- <testsuites>
14
- <testsuite name="Twig Test Suite">
15
- <directory>./tests/</directory>
16
- </testsuite>
17
- </testsuites>
18
-
19
- <php>
20
- <ini name="error_reporting" value="-1" />
21
- <ini name="xdebug.overload_var_dump" value="0" />
22
- </php>
23
-
24
- <listeners>
25
- <listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
26
- </listeners>
27
-
28
- <filter>
29
- <whitelist>
30
- <directory suffix=".php">./src/</directory>
31
- </whitelist>
32
- </filter>
33
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/src/Cache/CacheInterface.php DELETED
@@ -1,60 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Twig\Cache;
13
-
14
- /**
15
- * Interface implemented by cache classes.
16
- *
17
- * It is highly recommended to always store templates on the filesystem to
18
- * benefit from the PHP opcode cache. This interface is mostly useful if you
19
- * need to implement a custom strategy for storing templates on the filesystem.
20
- *
21
- * @author Andrew Tch <andrew@noop.lv>
22
- */
23
- interface CacheInterface
24
- {
25
- /**
26
- * Generates a cache key for the given template class name.
27
- *
28
- * @param string $name The template name
29
- * @param string $className The template class name
30
- *
31
- * @return string
32
- */
33
- public function generateKey($name, $className);
34
-
35
- /**
36
- * Writes the compiled template to cache.
37
- *
38
- * @param string $key The cache key
39
- * @param string $content The template representation as a PHP class
40
- */
41
- public function write($key, $content);
42
-
43
- /**
44
- * Loads a template from the cache.
45
- *
46
- * @param string $key The cache key
47
- */
48
- public function load($key);
49
-
50
- /**
51
- * Returns the modification timestamp of a key.
52
- *
53
- * @param string $key The cache key
54
- *
55
- * @return int
56
- */
57
- public function getTimestamp($key);
58
- }
59
-
60
- class_alias('Twig\Cache\CacheInterface', 'Twig_CacheInterface');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/src/Cache/FilesystemCache.php DELETED
@@ -1,93 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Twig\Cache;
13
-
14
- /**
15
- * Implements a cache on the filesystem.
16
- *
17
- * @author Andrew Tch <andrew@noop.lv>
18
- */
19
- class FilesystemCache implements CacheInterface
20
- {
21
- const FORCE_BYTECODE_INVALIDATION = 1;
22
-
23
- private $directory;
24
- private $options;
25
-
26
- /**
27
- * @param string $directory The root cache directory
28
- * @param int $options A set of options
29
- */
30
- public function __construct($directory, $options = 0)
31
- {
32
- $this->directory = rtrim($directory, '\/').'/';
33
- $this->options = $options;
34
- }
35
-
36
- public function generateKey($name, $className)
37
- {
38
- $hash = hash('sha256', $className);
39
-
40
- return $this->directory.$hash[0].$hash[1].'/'.$hash.'.php';
41
- }
42
-
43
- public function load($key)
44
- {
45
- if (file_exists($key)) {
46
- @include_once $key;
47
- }
48
- }
49
-
50
- public function write($key, $content)
51
- {
52
- $dir = \dirname($key);
53
- if (!is_dir($dir)) {
54
- if (false === @mkdir($dir, 0777, true)) {
55
- clearstatcache(true, $dir);
56
- if (!is_dir($dir)) {
57
- throw new \RuntimeException(sprintf('Unable to create the cache directory (%s).', $dir));
58
- }
59
- }
60
- } elseif (!is_writable($dir)) {
61
- throw new \RuntimeException(sprintf('Unable to write in the cache directory (%s).', $dir));
62
- }
63
-
64
- $tmpFile = tempnam($dir, basename($key));
65
- if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $key)) {
66
- @chmod($key, 0666 & ~umask());
67
-
68
- if (self::FORCE_BYTECODE_INVALIDATION == ($this->options & self::FORCE_BYTECODE_INVALIDATION)) {
69
- // Compile cached file into bytecode cache
70
- if (\function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) {
71
- @opcache_invalidate($key, true);
72
- } elseif (\function_exists('apc_compile_file')) {
73
- apc_compile_file($key);
74
- }
75
- }
76
-
77
- return;
78
- }
79
-
80
- throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $key));
81
- }
82
-
83
- public function getTimestamp($key)
84
- {
85
- if (!file_exists($key)) {
86
- return 0;
87
- }
88
-
89
- return (int) @filemtime($key);
90
- }
91
- }
92
-
93
- class_alias('Twig\Cache\FilesystemCache', 'Twig_Cache_Filesystem');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/src/Cache/NullCache.php DELETED
@@ -1,42 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Twig\Cache;
13
-
14
- /**
15
- * Implements a no-cache strategy.
16
- *
17
- * @final
18
- *
19
- * @author Fabien Potencier <fabien@symfony.com>
20
- */
21
- class NullCache implements CacheInterface
22
- {
23
- public function generateKey($name, $className)
24
- {
25
- return '';
26
- }
27
-
28
- public function write($key, $content)
29
- {
30
- }
31
-
32
- public function load($key)
33
- {
34
- }
35
-
36
- public function getTimestamp($key)
37
- {
38
- return 0;
39
- }
40
- }
41
-
42
- class_alias('Twig\Cache\NullCache', 'Twig_Cache_Null');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/src/Compiler.php DELETED
@@ -1,288 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- * (c) Armin Ronacher
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
12
-
13
- namespace Twig;
14
-
15
- use Twig\Node\ModuleNode;
16
-
17
- /**
18
- * Compiles a node to PHP code.
19
- *
20
- * @author Fabien Potencier <fabien@symfony.com>
21
- */
22
- class Compiler implements \Twig_CompilerInterface
23
- {
24
- protected $lastLine;
25
- protected $source;
26
- protected $indentation;
27
- protected $env;
28
- protected $debugInfo = [];
29
- protected $sourceOffset;
30
- protected $sourceLine;
31
- protected $filename;
32
- private $varNameSalt = 0;
33
-
34
- public function __construct(Environment $env)
35
- {
36
- $this->env = $env;
37
- }
38
-
39
- /**
40
- * @deprecated since 1.25 (to be removed in 2.0)
41
- */
42
- public function getFilename()
43
- {
44
- @trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), E_USER_DEPRECATED);
45
-
46
- return $this->filename;
47
- }
48
-
49
- /**
50
- * Returns the environment instance related to this compiler.
51
- *
52
- * @return Environment
53
- */
54
- public function getEnvironment()
55
- {
56
- return $this->env;
57
- }
58
-
59
- /**
60
- * Gets the current PHP code after compilation.
61
- *
62
- * @return string The PHP code
63
- */
64
- public function getSource()
65
- {
66
- return $this->source;
67
- }
68
-
69
- /**
70
- * Compiles a node.
71
- *
72
- * @param int $indentation The current indentation
73
- *
74
- * @return $this
75
- */
76
- public function compile(\Twig_NodeInterface $node, $indentation = 0)
77
- {
78
- $this->lastLine = null;
79
- $this->source = '';
80
- $this->debugInfo = [];
81
- $this->sourceOffset = 0;
82
- // source code starts at 1 (as we then increment it when we encounter new lines)
83
- $this->sourceLine = 1;
84
- $this->indentation = $indentation;
85
- $this->varNameSalt = 0;
86
-
87
- if ($node instanceof ModuleNode) {
88
- // to be removed in 2.0
89
- $this->filename = $node->getTemplateName();
90
- }
91
-
92
- $node->compile($this);
93
-
94
- return $this;
95
- }
96
-
97
- public function subcompile(\Twig_NodeInterface $node, $raw = true)
98
- {
99
- if (false === $raw) {
100
- $this->source .= str_repeat(' ', $this->indentation * 4);
101
- }
102
-
103
- $node->compile($this);
104
-
105
- return $this;
106
- }
107
-
108
- /**
109
- * Adds a raw string to the compiled code.
110
- *
111
- * @param string $string The string
112
- *
113
- * @return $this
114
- */
115
- public function raw($string)
116
- {
117
- $this->source .= $string;
118
-
119
- return $this;
120
- }
121
-
122
- /**
123
- * Writes a string to the compiled code by adding indentation.
124
- *
125
- * @return $this
126
- */
127
- public function write()
128
- {
129
- $strings = \func_get_args();
130
- foreach ($strings as $string) {
131
- $this->source .= str_repeat(' ', $this->indentation * 4).$string;
132
- }
133
-
134
- return $this;
135
- }
136
-
137
- /**
138
- * Appends an indentation to the current PHP code after compilation.
139
- *
140
- * @return $this
141
- *
142
- * @deprecated since 1.27 (to be removed in 2.0).
143
- */
144
- public function addIndentation()
145
- {
146
- @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use write(\'\') instead.', E_USER_DEPRECATED);
147
-
148
- $this->source .= str_repeat(' ', $this->indentation * 4);
149
-
150
- return $this;
151
- }
152
-
153
- /**
154
- * Adds a quoted string to the compiled code.
155
- *
156
- * @param string $value The string
157
- *
158
- * @return $this
159
- */
160
- public function string($value)
161
- {
162
- $this->source .= sprintf('"%s"', addcslashes($value, "\0\t\"\$\\"));
163
-
164
- return $this;
165
- }
166
-
167
- /**
168
- * Returns a PHP representation of a given value.
169
- *
170
- * @param mixed $value The value to convert
171
- *
172
- * @return $this
173
- */
174
- public function repr($value)
175
- {
176
- if (\is_int($value) || \is_float($value)) {
177
- if (false !== $locale = setlocale(LC_NUMERIC, '0')) {
178
- setlocale(LC_NUMERIC, 'C');
179
- }
180
-
181
- $this->raw(var_export($value, true));
182
-
183
- if (false !== $locale) {
184
- setlocale(LC_NUMERIC, $locale);
185
- }
186
- } elseif (null === $value) {
187
- $this->raw('null');
188
- } elseif (\is_bool($value)) {
189
- $this->raw($value ? 'true' : 'false');
190
- } elseif (\is_array($value)) {
191
- $this->raw('[');
192
- $first = true;
193
- foreach ($value as $key => $v) {
194
- if (!$first) {
195
- $this->raw(', ');
196
- }
197
- $first = false;
198
- $this->repr($key);
199
- $this->raw(' => ');
200
- $this->repr($v);
201
- }
202
- $this->raw(']');
203
- } else {
204
- $this->string($value);
205
- }
206
-
207
- return $this;
208
- }
209
-
210
- /**
211
- * Adds debugging information.
212
- *
213
- * @return $this
214
- */
215
- public function addDebugInfo(\Twig_NodeInterface $node)
216
- {
217
- if ($node->getTemplateLine() != $this->lastLine) {
218
- $this->write(sprintf("// line %d\n", $node->getTemplateLine()));
219
-
220
- // when mbstring.func_overload is set to 2
221
- // mb_substr_count() replaces substr_count()
222
- // but they have different signatures!
223
- if (((int) ini_get('mbstring.func_overload')) & 2) {
224
- @trigger_error('Support for having "mbstring.func_overload" different from 0 is deprecated version 1.29 and will be removed in 2.0.', E_USER_DEPRECATED);
225
-
226
- // this is much slower than the "right" version
227
- $this->sourceLine += mb_substr_count(mb_substr($this->source, $this->sourceOffset), "\n");
228
- } else {
229
- $this->sourceLine += substr_count($this->source, "\n", $this->sourceOffset);
230
- }
231
- $this->sourceOffset = \strlen($this->source);
232
- $this->debugInfo[$this->sourceLine] = $node->getTemplateLine();
233
-
234
- $this->lastLine = $node->getTemplateLine();
235
- }
236
-
237
- return $this;
238
- }
239
-
240
- public function getDebugInfo()
241
- {
242
- ksort($this->debugInfo);
243
-
244
- return $this->debugInfo;
245
- }
246
-
247
- /**
248
- * Indents the generated code.
249
- *
250
- * @param int $step The number of indentation to add
251
- *
252
- * @return $this
253
- */
254
- public function indent($step = 1)
255
- {
256
- $this->indentation += $step;
257
-
258
- return $this;
259
- }
260
-
261
- /**
262
- * Outdents the generated code.
263
- *
264
- * @param int $step The number of indentation to remove
265
- *
266
- * @return $this
267
- *
268
- * @throws \LogicException When trying to outdent too much so the indentation would become negative
269
- */
270
- public function outdent($step = 1)
271
- {
272
- // can't outdent by more steps than the current indentation level
273
- if ($this->indentation < $step) {
274
- throw new \LogicException('Unable to call outdent() as the indentation would become negative.');
275
- }
276
-
277
- $this->indentation -= $step;
278
-
279
- return $this;
280
- }
281
-
282
- public function getVarName()
283
- {
284
- return sprintf('__internal_%s', hash('sha256', __METHOD__.$this->varNameSalt++));
285
- }
286
- }
287
-
288
- class_alias('Twig\Compiler', 'Twig_Compiler');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/src/Environment.php DELETED
@@ -1,1638 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Twig;
13
-
14
- use Twig\Cache\CacheInterface;
15
- use Twig\Cache\FilesystemCache;
16
- use Twig\Cache\NullCache;
17
- use Twig\Error\Error;
18
- use Twig\Error\LoaderError;
19
- use Twig\Error\RuntimeError;
20
- use Twig\Error\SyntaxError;
21
- use Twig\Extension\CoreExtension;
22
- use Twig\Extension\EscaperExtension;
23
- use Twig\Extension\ExtensionInterface;
24
- use Twig\Extension\GlobalsInterface;
25
- use Twig\Extension\InitRuntimeInterface;
26
- use Twig\Extension\OptimizerExtension;
27
- use Twig\Extension\StagingExtension;
28
- use Twig\Loader\ArrayLoader;
29
- use Twig\Loader\ChainLoader;
30
- use Twig\Loader\LoaderInterface;
31
- use Twig\Loader\SourceContextLoaderInterface;
32
- use Twig\Node\ModuleNode;
33
- use Twig\NodeVisitor\NodeVisitorInterface;
34
- use Twig\RuntimeLoader\RuntimeLoaderInterface;
35
- use Twig\TokenParser\TokenParserInterface;
36
-
37
- /**
38
- * Stores the Twig configuration.
39
- *
40
- * @author Fabien Potencier <fabien@symfony.com>
41
- */
42
- class Environment
43
- {
44
- const VERSION = '1.42.3';
45
- const VERSION_ID = 14203;
46
- const MAJOR_VERSION = 1;
47
- const MINOR_VERSION = 42;
48
- const RELEASE_VERSION = 3;
49
- const EXTRA_VERSION = '';
50
-
51
- protected $charset;
52
- protected $loader;
53
- protected $debug;
54
- protected $autoReload;
55
- protected $cache;
56
- protected $lexer;
57
- protected $parser;
58
- protected $compiler;
59
- protected $baseTemplateClass;
60
- protected $extensions;
61
- protected $parsers;
62
- protected $visitors;
63
- protected $filters;
64
- protected $tests;
65
- protected $functions;
66
- protected $globals;
67
- protected $runtimeInitialized = false;
68
- protected $extensionInitialized = false;
69
- protected $loadedTemplates;
70
- protected $strictVariables;
71
- protected $unaryOperators;
72
- protected $binaryOperators;
73
- protected $templateClassPrefix = '__TwigTemplate_';
74
- protected $functionCallbacks = [];
75
- protected $filterCallbacks = [];
76
- protected $staging;
77
-
78
- private $originalCache;
79
- private $bcWriteCacheFile = false;
80
- private $bcGetCacheFilename = false;
81
- private $lastModifiedExtension = 0;
82
- private $extensionsByClass = [];
83
- private $runtimeLoaders = [];
84
- private $runtimes = [];
85
- private $optionsHash;
86
-
87
- /**
88
- * Constructor.
89
- *
90
- * Available options:
91
- *
92
- * * debug: When set to true, it automatically set "auto_reload" to true as
93
- * well (default to false).
94
- *
95
- * * charset: The charset used by the templates (default to UTF-8).
96
- *
97
- * * base_template_class: The base template class to use for generated
98
- * templates (default to \Twig\Template).
99
- *
100
- * * cache: An absolute path where to store the compiled templates,
101
- * a \Twig\Cache\CacheInterface implementation,
102
- * or false to disable compilation cache (default).
103
- *
104
- * * auto_reload: Whether to reload the template if the original source changed.
105
- * If you don't provide the auto_reload option, it will be
106
- * determined automatically based on the debug value.
107
- *
108
- * * strict_variables: Whether to ignore invalid variables in templates
109
- * (default to false).
110
- *
111
- * * autoescape: Whether to enable auto-escaping (default to html):
112
- * * false: disable auto-escaping
113
- * * true: equivalent to html
114
- * * html, js: set the autoescaping to one of the supported strategies
115
- * * name: set the autoescaping strategy based on the template name extension
116
- * * PHP callback: a PHP callback that returns an escaping strategy based on the template "name"
117
- *
118
- * * optimizations: A flag that indicates which optimizations to apply
119
- * (default to -1 which means that all optimizations are enabled;
120
- * set it to 0 to disable).
121
- */
122
- public function __construct(LoaderInterface $loader = null, $options = [])
123
- {
124
- if (null !== $loader) {
125
- $this->setLoader($loader);
126
- } else {
127
- @trigger_error('Not passing a "Twig\Lodaer\LoaderInterface" as the first constructor argument of "Twig\Environment" is deprecated since version 1.21.', E_USER_DEPRECATED);
128
- }
129
-
130
- $options = array_merge([
131
- 'debug' => false,
132
- 'charset' => 'UTF-8',
133
- 'base_template_class' => '\Twig\Template',
134
- 'strict_variables' => false,
135
- 'autoescape' => 'html',
136
- 'cache' => false,
137
- 'auto_reload' => null,
138
- 'optimizations' => -1,
139
- ], $options);
140
-
141
- $this->debug = (bool) $options['debug'];
142
- $this->charset = strtoupper($options['charset']);
143
- $this->baseTemplateClass = $options['base_template_class'];
144
- $this->autoReload = null === $options['auto_reload'] ? $this->debug : (bool) $options['auto_reload'];
145
- $this->strictVariables = (bool) $options['strict_variables'];
146
- $this->setCache($options['cache']);
147
-
148
- $this->addExtension(new CoreExtension());
149
- $this->addExtension(new EscaperExtension($options['autoescape']));
150
- $this->addExtension(new OptimizerExtension($options['optimizations']));
151
- $this->staging = new StagingExtension();
152
-
153
- // For BC
154
- if (\is_string($this->originalCache)) {
155
- $r = new \ReflectionMethod($this, 'writeCacheFile');
156
- if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
157
- @trigger_error('The Twig\Environment::writeCacheFile method is deprecated since version 1.22 and will be removed in Twig 2.0.', E_USER_DEPRECATED);
158
-
159
- $this->bcWriteCacheFile = true;
160
- }
161
-
162
- $r = new \ReflectionMethod($this, 'getCacheFilename');
163
- if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
164
- @trigger_error('The Twig\Environment::getCacheFilename method is deprecated since version 1.22 and will be removed in Twig 2.0.', E_USER_DEPRECATED);
165
-
166
- $this->bcGetCacheFilename = true;
167
- }
168
- }
169
- }
170
-
171
- /**
172
- * Gets the base template class for compiled templates.
173
- *
174
- * @return string The base template class name
175
- */
176
- public function getBaseTemplateClass()
177
- {
178
- return $this->baseTemplateClass;
179
- }
180
-
181
- /**
182
- * Sets the base template class for compiled templates.
183
- *
184
- * @param string $class The base template class name
185
- */
186
- public function setBaseTemplateClass($class)
187
- {
188
- $this->baseTemplateClass = $class;
189
- $this->updateOptionsHash();
190
- }
191
-
192
- /**
193
- * Enables debugging mode.
194
- */
195
- public function enableDebug()
196
- {
197
- $this->debug = true;
198
- $this->updateOptionsHash();
199
- }
200
-
201
- /**
202
- * Disables debugging mode.
203
- */
204
- public function disableDebug()
205
- {
206
- $this->debug = false;
207
- $this->updateOptionsHash();
208
- }
209
-
210
- /**
211
- * Checks if debug mode is enabled.
212
- *
213
- * @return bool true if debug mode is enabled, false otherwise
214
- */
215
- public function isDebug()
216
- {
217
- return $this->debug;
218
- }
219
-
220
- /**
221
- * Enables the auto_reload option.
222
- */
223
- public function enableAutoReload()
224
- {
225
- $this->autoReload = true;
226
- }
227
-
228
- /**
229
- * Disables the auto_reload option.
230
- */
231
- public function disableAutoReload()
232
- {
233
- $this->autoReload = false;
234
- }
235
-
236
- /**
237
- * Checks if the auto_reload option is enabled.
238
- *
239
- * @return bool true if auto_reload is enabled, false otherwise
240
- */
241
- public function isAutoReload()
242
- {
243
- return $this->autoReload;
244
- }
245
-
246
- /**
247
- * Enables the strict_variables option.
248
- */
249
- public function enableStrictVariables()
250
- {
251
- $this->strictVariables = true;
252
- $this->updateOptionsHash();
253
- }
254
-
255
- /**
256
- * Disables the strict_variables option.
257
- */
258
- public function disableStrictVariables()
259
- {
260
- $this->strictVariables = false;
261
- $this->updateOptionsHash();
262
- }
263
-
264
- /**
265
- * Checks if the strict_variables option is enabled.
266
- *
267
- * @return bool true if strict_variables is enabled, false otherwise
268
- */
269
- public function isStrictVariables()
270
- {
271
- return $this->strictVariables;
272
- }
273
-
274
- /**
275
- * Gets the current cache implementation.
276
- *
277
- * @param bool $original Whether to return the original cache option or the real cache instance
278
- *
279
- * @return CacheInterface|string|false A Twig\Cache\CacheInterface implementation,
280
- * an absolute path to the compiled templates,
281
- * or false to disable cache
282
- */
283
- public function getCache($original = true)
284
- {
285
- return $original ? $this->originalCache : $this->cache;
286
- }
287
-
288
- /**
289
- * Sets the current cache implementation.
290
- *
291
- * @param CacheInterface|string|false $cache A Twig\Cache\CacheInterface implementation,
292
- * an absolute path to the compiled templates,
293
- * or false to disable cache
294
- */
295
- public function setCache($cache)
296
- {
297
- if (\is_string($cache)) {
298
- $this->originalCache = $cache;
299
- $this->cache = new FilesystemCache($cache);
300
- } elseif (false === $cache) {
301
- $this->originalCache = $cache;
302
- $this->cache = new NullCache();
303
- } elseif (null === $cache) {
304
- @trigger_error('Using "null" as the cache strategy is deprecated since version 1.23 and will be removed in Twig 2.0.', E_USER_DEPRECATED);
305
- $this->originalCache = false;
306
- $this->cache = new NullCache();
307
- } elseif ($cache instanceof CacheInterface) {
308
- $this->originalCache = $this->cache = $cache;
309
- } else {
310
- throw new \LogicException(sprintf('Cache can only be a string, false, or a \Twig\Cache\CacheInterface implementation.'));
311
- }
312
- }
313
-
314
- /**
315
- * Gets the cache filename for a given template.
316
- *
317
- * @param string $name The template name
318
- *
319
- * @return string|false The cache file name or false when caching is disabled
320
- *
321
- * @deprecated since 1.22 (to be removed in 2.0)
322
- */
323
- public function getCacheFilename($name)
324
- {
325
- @trigger_error(sprintf('The %s method is deprecated since version 1.22 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED);
326
-
327
- $key = $this->cache->generateKey($name, $this->getTemplateClass($name));
328
-
329
- return !$key ? false : $key;
330
- }
331
-
332
- /**
333
- * Gets the template class associated with the given string.
334
- *
335
- * The generated template class is based on the following parameters:
336
- *
337
- * * The cache key for the given template;
338
- * * The currently enabled extensions;
339
- * * Whether the Twig C extension is available or not;
340
- * * PHP version;
341
- * * Twig version;
342
- * * Options with what environment was created.
343
- *
344
- * @param string $name The name for which to calculate the template class name
345
- * @param int|null $index The index if it is an embedded template
346
- *
347
- * @return string The template class name
348
- */
349
- public function getTemplateClass($name, $index = null)
350
- {
351
- $key = $this->getLoader()->getCacheKey($name).$this->optionsHash;
352
-
353
- return $this->templateClassPrefix.hash('sha256', $key).(null === $index ? '' : '___'.$index);
354
- }
355
-
356
- /**
357
- * Gets the template class prefix.
358
- *
359
- * @return string The template class prefix
360
- *
361
- * @deprecated since 1.22 (to be removed in 2.0)
362
- */
363
- public function getTemplateClassPrefix()
364
- {
365
- @trigger_error(sprintf('The %s method is deprecated since version 1.22 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED);
366
-
367
- return $this->templateClassPrefix;
368
- }
369
-
370
- /**
371
- * Renders a template.
372
- *
373
- * @param string|TemplateWrapper $name The template name
374
- * @param array $context An array of parameters to pass to the template
375
- *
376
- * @return string The rendered template
377
- *
378
- * @throws LoaderError When the template cannot be found
379
- * @throws SyntaxError When an error occurred during compilation
380
- * @throws RuntimeError When an error occurred during rendering
381
- */
382
- public function render($name, array $context = [])
383
- {
384
- return $this->load($name)->render($context);
385
- }
386
-
387
- /**
388
- * Displays a template.
389
- *
390
- * @param string|TemplateWrapper $name The template name
391
- * @param array $context An array of parameters to pass to the template
392
- *
393
- * @throws LoaderError When the template cannot be found
394
- * @throws SyntaxError When an error occurred during compilation
395
- * @throws RuntimeError When an error occurred during rendering
396
- */
397
- public function display($name, array $context = [])
398
- {
399
- $this->load($name)->display($context);
400
- }
401
-
402
- /**
403
- * Loads a template.
404
- *
405
- * @param string|TemplateWrapper|\Twig\Template $name The template name
406
- *
407
- * @throws LoaderError When the template cannot be found
408
- * @throws RuntimeError When a previously generated cache is corrupted
409
- * @throws SyntaxError When an error occurred during compilation
410
- *
411
- * @return TemplateWrapper
412
- */
413
- public function load($name)
414
- {
415
- if ($name instanceof TemplateWrapper) {
416
- return $name;
417
- }
418
-
419
- if ($name instanceof Template) {
420
- return new TemplateWrapper($this, $name);
421
- }
422
-
423
- return new TemplateWrapper($this, $this->loadTemplate($name));
424
- }
425
-
426
- /**
427
- * Loads a template internal representation.
428
- *
429
- * This method is for internal use only and should never be called
430
- * directly.
431
- *
432
- * @param string $name The template name
433
- * @param int $index The index if it is an embedded template
434
- *
435
- * @return \Twig_TemplateInterface A template instance representing the given template name
436
- *
437
- * @throws LoaderError When the template cannot be found
438
- * @throws RuntimeError When a previously generated cache is corrupted
439
- * @throws SyntaxError When an error occurred during compilation
440
- *
441
- * @internal
442
- */
443
- public function loadTemplate($name, $index = null)
444
- {
445
- return $this->loadClass($this->getTemplateClass($name), $name, $index);
446
- }
447
-
448
- /**
449
- * @internal
450
- */
451
- public function loadClass($cls, $name, $index = null)
452
- {
453
- $mainCls = $cls;
454
- if (null !== $index) {
455
- $cls .= '___'.$index;
456
- }
457
-
458
- if (isset($this->loadedTemplates[$cls])) {
459
- return $this->loadedTemplates[$cls];
460
- }
461
-
462
- if (!class_exists($cls, false)) {
463
- if ($this->bcGetCacheFilename) {
464
- $key = $this->getCacheFilename($name);
465
- } else {
466
- $key = $this->cache->generateKey($name, $mainCls);
467
- }
468
-
469
- if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
470
- $this->cache->load($key);
471
- }
472
-
473
- $source = null;
474
- if (!class_exists($cls, false)) {
475
- $loader = $this->getLoader();
476
- if (!$loader instanceof SourceContextLoaderInterface) {
477
- $source = new Source($loader->getSource($name), $name);
478
- } else {
479
- $source = $loader->getSourceContext($name);
480
- }
481
-
482
- $content = $this->compileSource($source);
483
-
484
- if ($this->bcWriteCacheFile) {
485
- $this->writeCacheFile($key, $content);
486
- } else {
487
- $this->cache->write($key, $content);
488
- $this->cache->load($key);
489
- }
490
-
491
- if (!class_exists($mainCls, false)) {
492
- /* Last line of defense if either $this->bcWriteCacheFile was used,
493
- * $this->cache is implemented as a no-op or we have a race condition
494
- * where the cache was cleared between the above calls to write to and load from
495
- * the cache.
496
- */
497
- eval('?>'.$content);
498
- }
499
- }
500
-
501
- if (!class_exists($cls, false)) {
502
- throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
503
- }
504
- }
505
-
506
- if (!$this->runtimeInitialized) {
507
- $this->initRuntime();
508
- }
509
-
510
- return $this->loadedTemplates[$cls] = new $cls($this);
511
- }
512
-
513
- /**
514
- * Creates a template from source.
515
- *
516
- * This method should not be used as a generic way to load templates.
517
- *
518
- * @param string $template The template name
519
- * @param string $name An optional name of the template to be used in error messages
520
- *
521
- * @return TemplateWrapper A template instance representing the given template name
522
- *
523
- * @throws LoaderError When the template cannot be found
524
- * @throws SyntaxError When an error occurred during compilation
525
- */
526
- public function createTemplate($template, $name = null)
527
- {
528
- $hash = hash('sha256', $template, false);
529
- if (null !== $name) {
530
- $name = sprintf('%s (string template %s)', $name, $hash);
531
- } else {
532
- $name = sprintf('__string_template__%s', $hash);
533
- }
534
-
535
- $loader = new ChainLoader([
536
- new ArrayLoader([$name => $template]),
537
- $current = $this->getLoader(),
538
- ]);
539
-
540
- $this->setLoader($loader);
541
- try {
542
- $template = new TemplateWrapper($this, $this->loadTemplate($name));
543
- } catch (\Exception $e) {
544
- $this->setLoader($current);
545
-
546
- throw $e;
547
- } catch (\Throwable $e) {
548
- $this->setLoader($current);
549
-
550
- throw $e;
551
- }
552
- $this->setLoader($current);
553
-
554
- return $template;
555
- }
556
-
557
- /**
558
- * Returns true if the template is still fresh.
559
- *
560
- * Besides checking the loader for freshness information,
561
- * this method also checks if the enabled extensions have
562
- * not changed.
563
- *
564
- * @param string $name The template name
565
- * @param int $time The last modification time of the cached template
566
- *
567
- * @return bool true if the template is fresh, false otherwise
568
- */
569
- public function isTemplateFresh($name, $time)
570
- {
571
- if (0 === $this->lastModifiedExtension) {
572
- foreach ($this->extensions as $extension) {
573
- $r = new \ReflectionObject($extension);
574
- if (file_exists($r->getFileName()) && ($extensionTime = filemtime($r->getFileName())) > $this->lastModifiedExtension) {
575
- $this->lastModifiedExtension = $extensionTime;
576
- }
577
- }
578
- }
579
-
580
- return $this->lastModifiedExtension <= $time && $this->getLoader()->isFresh($name, $time);
581
- }
582
-
583
- /**
584
- * Tries to load a template consecutively from an array.
585
- *
586
- * Similar to load() but it also accepts instances of \Twig\Template and
587
- * \Twig\TemplateWrapper, and an array of templates where each is tried to be loaded.
588
- *
589
- * @param string|Template|\Twig\TemplateWrapper|array $names A template or an array of templates to try consecutively
590
- *
591
- * @return TemplateWrapper|Template
592
- *
593
- * @throws LoaderError When none of the templates can be found
594
- * @throws SyntaxError When an error occurred during compilation
595
- */
596
- public function resolveTemplate($names)
597
- {
598
- if (!\is_array($names)) {
599
- $names = [$names];
600
- }
601
-
602
- foreach ($names as $name) {
603
- if ($name instanceof Template) {
604
- return $name;
605
- }
606
- if ($name instanceof TemplateWrapper) {
607
- return $name;
608
- }
609
-
610
- try {
611
- return $this->loadTemplate($name);
612
- } catch (LoaderError $e) {
613
- if (1 === \count($names)) {
614
- throw $e;
615
- }
616
- }
617
- }
618
-
619
- throw new LoaderError(sprintf('Unable to find one of the following templates: "%s".', implode('", "', $names)));
620
- }
621
-
622
- /**
623
- * Clears the internal template cache.
624
- *
625
- * @deprecated since 1.18.3 (to be removed in 2.0)
626
- */
627
- public function clearTemplateCache()
628
- {
629
- @trigger_error(sprintf('The %s method is deprecated since version 1.18.3 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED);
630
-
631
- $this->loadedTemplates = [];
632
- }
633
-
634
- /**
635
- * Clears the template cache files on the filesystem.
636
- *
637
- * @deprecated since 1.22 (to be removed in 2.0)
638
- */
639
- public function clearCacheFiles()
640
- {
641
- @trigger_error(sprintf('The %s method is deprecated since version 1.22 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED);
642
-
643
- if (\is_string($this->originalCache)) {
644
- foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->originalCache), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
645
- if ($file->isFile()) {
646
- @unlink($file->getPathname());
647
- }
648
- }
649
- }
650
- }
651
-
652
- /**
653
- * Gets the Lexer instance.
654
- *
655
- * @return \Twig_LexerInterface
656
- *
657
- * @deprecated since 1.25 (to be removed in 2.0)
658
- */
659
- public function getLexer()
660
- {
661
- @trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), E_USER_DEPRECATED);
662
-
663
- if (null === $this->lexer) {
664
- $this->lexer = new Lexer($this);
665
- }
666
-
667
- return $this->lexer;
668
- }
669
-
670
- public function setLexer(\Twig_LexerInterface $lexer)
671
- {
672
- $this->lexer = $lexer;
673
- }
674
-
675
- /**
676
- * Tokenizes a source code.
677
- *
678
- * @param string|Source $source The template source code
679
- * @param string $name The template name (deprecated)
680
- *
681
- * @return TokenStream
682
- *
683
- * @throws SyntaxError When the code is syntactically wrong
684
- */
685
- public function tokenize($source, $name = null)
686
- {
687
- if (!$source instanceof Source) {
688
- @trigger_error(sprintf('Passing a string as the $source argument of %s() is deprecated since version 1.27. Pass a Twig\Source instance instead.', __METHOD__), E_USER_DEPRECATED);
689
- $source = new Source($source, $name);
690
- }
691
-
692
- if (null === $this->lexer) {
693
- $this->lexer = new Lexer($this);
694
- }
695
-
696
- return $this->lexer->tokenize($source);
697
- }
698
-
699
- /**
700
- * Gets the Parser instance.
701
- *
702
- * @return \Twig_ParserInterface
703
- *
704
- * @deprecated since 1.25 (to be removed in 2.0)
705
- */
706
- public function getParser()
707
- {
708
- @trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), E_USER_DEPRECATED);
709
-
710
- if (null === $this->parser) {
711
- $this->parser = new Parser($this);
712
- }
713
-
714
- return $this->parser;
715
- }
716
-
717
- public function setParser(\Twig_ParserInterface $parser)
718
- {
719
- $this->parser = $parser;
720
- }
721
-
722
- /**
723
- * Converts a token stream to a node tree.
724
- *
725
- * @return ModuleNode
726
- *
727
- * @throws SyntaxError When the token stream is syntactically or semantically wrong
728
- */
729
- public function parse(TokenStream $stream)
730
- {
731
- if (null === $this->parser) {
732
- $this->parser = new Parser($this);
733
- }
734
-
735
- return $this->parser->parse($stream);
736
- }
737
-
738
- /**
739
- * Gets the Compiler instance.
740
- *
741
- * @return \Twig_CompilerInterface
742
- *
743
- * @deprecated since 1.25 (to be removed in 2.0)
744
- */
745
- public function getCompiler()
746
- {
747
- @trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), E_USER_DEPRECATED);
748
-
749
- if (null === $this->compiler) {
750
- $this->compiler = new Compiler($this);
751
- }
752
-
753
- return $this->compiler;
754
- }
755
-
756
- public function setCompiler(\Twig_CompilerInterface $compiler)
757
- {
758
- $this->compiler = $compiler;
759
- }
760
-
761
- /**
762
- * Compiles a node and returns the PHP code.
763
- *
764
- * @return string The compiled PHP source code
765
- */
766
- public function compile(\Twig_NodeInterface $node)
767
- {
768
- if (null === $this->compiler) {
769
- $this->compiler = new Compiler($this);
770
- }
771
-
772
- return $this->compiler->compile($node)->getSource();
773
- }
774
-
775
- /**
776
- * Compiles a template source code.
777
- *
778
- * @param string|Source $source The template source code
779
- * @param string $name The template name (deprecated)
780
- *
781
- * @return string The compiled PHP source code
782
- *
783
- * @throws SyntaxError When there was an error during tokenizing, parsing or compiling
784
- */
785
- public function compileSource($source, $name = null)
786
- {
787
- if (!$source instanceof Source) {
788
- @trigger_error(sprintf('Passing a string as the $source argument of %s() is deprecated since version 1.27. Pass a Twig\Source instance instead.', __METHOD__), E_USER_DEPRECATED);
789
- $source = new Source($source, $name);
790
- }
791
-
792
- try {
793
- return $this->compile($this->parse($this->tokenize($source)));
794
- } catch (Error $e) {
795
- $e->setSourceContext($source);
796
- throw $e;
797
- } catch (\Exception $e) {
798
- throw new SyntaxError(sprintf('An exception has been thrown during the compilation of a template ("%s").', $e->getMessage()), -1, $source, $e);
799
- }
800
- }
801
-
802
- public function setLoader(LoaderInterface $loader)
803
- {
804
- if (!$loader instanceof SourceContextLoaderInterface && 0 !== strpos(\get_class($loader), 'Mock_')) {
805
- @trigger_error(sprintf('Twig loader "%s" should implement Twig\Loader\SourceContextLoaderInterface since version 1.27.', \get_class($loader)), E_USER_DEPRECATED);
806
- }
807
-
808
- $this->loader = $loader;
809
- }
810
-
811
- /**
812
- * Gets the Loader instance.
813
- *
814
- * @return LoaderInterface
815
- */
816
- public function getLoader()
817
- {
818
- if (null === $this->loader) {
819
- throw new \LogicException('You must set a loader first.');
820
- }
821
-
822
- return $this->loader;
823
- }
824
-
825
- /**
826
- * Sets the default template charset.
827
- *
828
- * @param string $charset The default charset
829
- */
830
- public function setCharset($charset)
831
- {
832
- $this->charset = strtoupper($charset);
833
- }
834
-
835
- /**
836
- * Gets the default template charset.
837
- *
838
- * @return string The default charset
839
- */
840
- public function getCharset()
841
- {
842
- return $this->charset;
843
- }
844
-
845
- /**
846
- * Initializes the runtime environment.
847
- *
848
- * @deprecated since 1.23 (to be removed in 2.0)
849
- */
850
- public function initRuntime()
851
- {
852
- $this->runtimeInitialized = true;
853
-
854
- foreach ($this->getExtensions() as $name => $extension) {
855
- if (!$extension instanceof InitRuntimeInterface) {
856
- $m = new \ReflectionMethod($extension, 'initRuntime');
857
-
858
- $parentClass = $m->getDeclaringClass()->getName();
859
- if ('Twig_Extension' !== $parentClass && 'Twig\Extension\AbstractExtension' !== $parentClass) {
860
- @trigger_error(sprintf('Defining the initRuntime() method in the "%s" extension is deprecated since version 1.23. Use the `needs_environment` option to get the \Twig_Environment instance in filters, functions, or tests; or explicitly implement Twig\Extension\InitRuntimeInterface if needed (not recommended).', $name), E_USER_DEPRECATED);
861
- }
862
- }
863
-
864
- $extension->initRuntime($this);
865
- }
866
- }
867
-
868
- /**
869
- * Returns true if the given extension is registered.
870
- *
871
- * @param string $class The extension class name
872
- *
873
- * @return bool Whether the extension is registered or not
874
- */
875
- public function hasExtension($class)
876
- {
877
- $class = ltrim($class, '\\');
878
- if (!isset($this->extensionsByClass[$class]) && class_exists($class, false)) {
879
- // For BC/FC with namespaced aliases
880
- $class = new \ReflectionClass($class);
881
- $class = $class->name;
882
- }
883
-
884
- if (isset($this->extensions[$class])) {
885
- if ($class !== \get_class($this->extensions[$class])) {
886
- @trigger_error(sprintf('Referencing the "%s" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', $class), E_USER_DEPRECATED);
887
- }
888
-
889
- return true;
890
- }
891
-
892
- return isset($this->extensionsByClass[$class]);
893
- }
894
-
895
- /**
896
- * Adds a runtime loader.
897
- */
898
- public function addRuntimeLoader(RuntimeLoaderInterface $loader)
899
- {
900
- $this->runtimeLoaders[] = $loader;
901
- }
902
-
903
- /**
904
- * Gets an extension by class name.
905
- *
906
- * @param string $class The extension class name
907
- *
908
- * @return ExtensionInterface
909
- */
910
- public function getExtension($class)
911
- {
912
- $class = ltrim($class, '\\');
913
- if (!isset($this->extensionsByClass[$class]) && class_exists($class, false)) {
914
- // For BC/FC with namespaced aliases
915
- $class = new \ReflectionClass($class);
916
- $class = $class->name;
917
- }
918
-
919
- if (isset($this->extensions[$class])) {
920
- if ($class !== \get_class($this->extensions[$class])) {
921
- @trigger_error(sprintf('Referencing the "%s" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', $class), E_USER_DEPRECATED);
922
- }
923
-
924
- return $this->extensions[$class];
925
- }
926
-
927
- if (!isset($this->extensionsByClass[$class])) {
928
- throw new RuntimeError(sprintf('The "%s" extension is not enabled.', $class));
929
- }
930
-
931
- return $this->extensionsByClass[$class];
932
- }
933
-
934
- /**
935
- * Returns the runtime implementation of a Twig element (filter/function/test).
936
- *
937
- * @param string $class A runtime class name
938
- *
939
- * @return object The runtime implementation
940
- *
941
- * @throws RuntimeError When the template cannot be found
942
- */
943
- public function getRuntime($class)
944
- {
945
- if (isset($this->runtimes[$class])) {
946
- return $this->runtimes[$class];
947
- }
948
-
949
- foreach ($this->runtimeLoaders as $loader) {
950
- if (null !== $runtime = $loader->load($class)) {
951
- return $this->runtimes[$class] = $runtime;
952
- }
953
- }
954
-
955
- throw new RuntimeError(sprintf('Unable to load the "%s" runtime.', $class));
956
- }
957
-
958
- public function addExtension(ExtensionInterface $extension)
959
- {
960
- if ($this->extensionInitialized) {
961
- throw new \LogicException(sprintf('Unable to register extension "%s" as extensions have already been initialized.', $extension->getName()));
962
- }
963
-
964
- $class = \get_class($extension);
965
- if ($class !== $extension->getName()) {
966
- if (isset($this->extensions[$extension->getName()])) {
967
- unset($this->extensions[$extension->getName()], $this->extensionsByClass[$class]);
968
- @trigger_error(sprintf('The possibility to register the same extension twice ("%s") is deprecated since version 1.23 and will be removed in Twig 2.0. Use proper PHP inheritance instead.', $extension->getName()), E_USER_DEPRECATED);
969
- }
970
- }
971
-
972
- $this->lastModifiedExtension = 0;
973
- $this->extensionsByClass[$class] = $extension;
974
- $this->extensions[$extension->getName()] = $extension;
975
- $this->updateOptionsHash();
976
- }
977
-
978
- /**
979
- * Removes an extension by name.
980
- *
981
- * This method is deprecated and you should not use it.
982
- *
983
- * @param string $name The extension name
984
- *
985
- * @deprecated since 1.12 (to be removed in 2.0)
986
- */
987
- public function removeExtension($name)
988
- {
989
- @trigger_error(sprintf('The %s method is deprecated since version 1.12 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED);
990
-
991
- if ($this->extensionInitialized) {
992
- throw new \LogicException(sprintf('Unable to remove extension "%s" as extensions have already been initialized.', $name));
993
- }
994
-
995
- $class = ltrim($name, '\\');
996
- if (!isset($this->extensionsByClass[$class]) && class_exists($class, false)) {
997
- // For BC/FC with namespaced aliases
998
- $class = new \ReflectionClass($class);
999
- $class = $class->name;
1000
- }
1001
-
1002
- if (isset($this->extensions[$class])) {
1003
- if ($class !== \get_class($this->extensions[$class])) {
1004
- @trigger_error(sprintf('Referencing the "%s" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', $class), E_USER_DEPRECATED);
1005
- }
1006
-
1007
- unset($this->extensions[$class]);
1008
- }
1009
-
1010
- unset($this->extensions[$class]);
1011
- $this->updateOptionsHash();
1012
- }
1013
-
1014
- /**
1015
- * Registers an array of extensions.
1016
- *
1017
- * @param array $extensions An array of extensions
1018
- */
1019
- public function setExtensions(array $extensions)
1020
- {
1021
- foreach ($extensions as $extension) {
1022
- $this->addExtension($extension);
1023
- }
1024
- }
1025
-
1026
- /**
1027
- * Returns all registered extensions.
1028
- *
1029
- * @return ExtensionInterface[] An array of extensions (keys are for internal usage only and should not be relied on)
1030
- */
1031
- public function getExtensions()
1032
- {
1033
- return $this->extensions;
1034
- }
1035
-
1036
- public function addTokenParser(TokenParserInterface $parser)
1037
- {
1038
- if ($this->extensionInitialized) {
1039
- throw new \LogicException('Unable to add a token parser as extensions have already been initialized.');
1040
- }
1041
-
1042
- $this->staging->addTokenParser($parser);
1043
- }
1044
-
1045
- /**
1046
- * Gets the registered Token Parsers.
1047
- *
1048
- * @return \Twig_TokenParserBrokerInterface
1049
- *
1050
- * @internal
1051
- */
1052
- public function getTokenParsers()
1053
- {
1054
- if (!$this->extensionInitialized) {
1055
- $this->initExtensions();
1056
- }
1057
-
1058
- return $this->parsers;
1059
- }
1060
-
1061
- /**
1062
- * Gets registered tags.
1063
- *
1064
- * Be warned that this method cannot return tags defined by \Twig_TokenParserBrokerInterface classes.
1065
- *
1066
- * @return TokenParserInterface[]
1067
- *
1068
- * @internal
1069
- */
1070
- public function getTags()
1071
- {
1072
- $tags = [];
1073
- foreach ($this->getTokenParsers()->getParsers() as $parser) {
1074
- if ($parser instanceof TokenParserInterface) {
1075
- $tags[$parser->getTag()] = $parser;
1076
- }
1077
- }
1078
-
1079
- return $tags;
1080
- }
1081
-
1082
- public function addNodeVisitor(NodeVisitorInterface $visitor)
1083
- {
1084
- if ($this->extensionInitialized) {
1085
- throw new \LogicException('Unable to add a node visitor as extensions have already been initialized.');
1086
- }
1087
-
1088
- $this->staging->addNodeVisitor($visitor);
1089
- }
1090
-
1091
- /**
1092
- * Gets the registered Node Visitors.
1093
- *
1094
- * @return NodeVisitorInterface[]
1095
- *
1096
- * @internal
1097
- */
1098
- public function getNodeVisitors()
1099
- {
1100
- if (!$this->extensionInitialized) {
1101
- $this->initExtensions();
1102
- }
1103
-
1104
- return $this->visitors;
1105
- }
1106
-
1107
- /**
1108
- * Registers a Filter.
1109
- *
1110
- * @param string|TwigFilter $name The filter name or a \Twig_SimpleFilter instance
1111
- * @param \Twig_FilterInterface|TwigFilter $filter
1112
- */
1113
- public function addFilter($name, $filter = null)
1114
- {
1115
- if (!$name instanceof TwigFilter && !($filter instanceof TwigFilter || $filter instanceof \Twig_FilterInterface)) {
1116
- throw new \LogicException('A filter must be an instance of \Twig_FilterInterface or \Twig_SimpleFilter.');
1117
- }
1118
-
1119
- if ($name instanceof TwigFilter) {
1120
- $filter = $name;
1121
- $name = $filter->getName();
1122
- } else {
1123
- @trigger_error(sprintf('Passing a name as a first argument to the %s method is deprecated since version 1.21. Pass an instance of "Twig_SimpleFilter" instead when defining filter "%s".', __METHOD__, $name), E_USER_DEPRECATED);
1124
- }
1125
-
1126
- if ($this->extensionInitialized) {
1127
- throw new \LogicException(sprintf('Unable to add filter "%s" as extensions have already been initialized.', $name));
1128
- }
1129
-
1130
- $this->staging->addFilter($name, $filter);
1131
- }
1132
-
1133
- /**
1134
- * Get a filter by name.
1135
- *
1136
- * Subclasses may override this method and load filters differently;
1137
- * so no list of filters is available.
1138
- *
1139
- * @param string $name The filter name
1140
- *
1141
- * @return \Twig_Filter|false
1142
- *
1143
- * @internal
1144
- */
1145
- public function getFilter($name)
1146
- {
1147
- if (!$this->extensionInitialized) {
1148
- $this->initExtensions();
1149
- }
1150
-
1151
- if (isset($this->filters[$name])) {
1152
- return $this->filters[$name];
1153
- }
1154
-
1155
- foreach ($this->filters as $pattern => $filter) {
1156
- $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count);
1157
-
1158
- if ($count) {
1159
- if (preg_match('#^'.$pattern.'$#', $name, $matches)) {
1160
- array_shift($matches);
1161
- $filter->setArguments($matches);
1162
-
1163
- return $filter;
1164
- }
1165
- }
1166
- }
1167
-
1168
- foreach ($this->filterCallbacks as $callback) {
1169
- if (false !== $filter = \call_user_func($callback, $name)) {
1170
- return $filter;
1171
- }
1172
- }
1173
-
1174
- return false;
1175
- }
1176
-
1177
- public function registerUndefinedFilterCallback($callable)
1178
- {
1179
- $this->filterCallbacks[] = $callable;
1180
- }
1181
-
1182
- /**
1183
- * Gets the registered Filters.
1184
- *
1185
- * Be warned that this method cannot return filters defined with registerUndefinedFilterCallback.
1186
- *
1187
- * @return \Twig_FilterInterface[]
1188
- *
1189
- * @see registerUndefinedFilterCallback
1190
- *
1191
- * @internal
1192
- */
1193
- public function getFilters()
1194
- {
1195
- if (!$this->extensionInitialized) {
1196
- $this->initExtensions();
1197
- }
1198
-
1199
- return $this->filters;
1200
- }
1201
-
1202
- /**
1203
- * Registers a Test.
1204
- *
1205
- * @param string|TwigTest $name The test name or a \Twig_SimpleTest instance
1206
- * @param \Twig_TestInterface|TwigTest $test A \Twig_TestInterface instance or a \Twig_SimpleTest instance
1207
- */
1208
- public function addTest($name, $test = null)
1209
- {
1210
- if (!$name instanceof TwigTest && !($test instanceof TwigTest || $test instanceof \Twig_TestInterface)) {
1211
- throw new \LogicException('A test must be an instance of \Twig_TestInterface or \Twig_SimpleTest.');
1212
- }
1213
-
1214
- if ($name instanceof TwigTest) {
1215
- $test = $name;
1216
- $name = $test->getName();
1217
- } else {
1218
- @trigger_error(sprintf('Passing a name as a first argument to the %s method is deprecated since version 1.21. Pass an instance of "Twig_SimpleTest" instead when defining test "%s".', __METHOD__, $name), E_USER_DEPRECATED);
1219
- }
1220
-
1221
- if ($this->extensionInitialized) {
1222
- throw new \LogicException(sprintf('Unable to add test "%s" as extensions have already been initialized.', $name));
1223
- }
1224
-
1225
- $this->staging->addTest($name, $test);
1226
- }
1227
-
1228
- /**
1229
- * Gets the registered Tests.
1230
- *
1231
- * @return \Twig_TestInterface[]
1232
- *
1233
- * @internal
1234
- */
1235
- public function getTests()
1236
- {
1237
- if (!$this->extensionInitialized) {
1238
- $this->initExtensions();
1239
- }
1240
-
1241
- return $this->tests;
1242
- }
1243
-
1244
- /**
1245
- * Gets a test by name.
1246
- *
1247
- * @param string $name The test name
1248
- *
1249
- * @return \Twig_Test|false
1250
- *
1251
- * @internal
1252
- */
1253
- public function getTest($name)
1254
- {
1255
- if (!$this->extensionInitialized) {
1256
- $this->initExtensions();
1257
- }
1258
-
1259
- if (isset($this->tests[$name])) {
1260
- return $this->tests[$name];
1261
- }
1262
-
1263
- foreach ($this->tests as $pattern => $test) {
1264
- $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count);
1265
-
1266
- if ($count) {
1267
- if (preg_match('#^'.$pattern.'$#', $name, $matches)) {
1268
- array_shift($matches);
1269
- $test->setArguments($matches);
1270
-
1271
- return $test;
1272
- }
1273
- }
1274
- }
1275
-
1276
- return false;
1277
- }
1278
-
1279
- /**
1280
- * Registers a Function.
1281
- *
1282
- * @param string|TwigFunction $name The function name or a \Twig_SimpleFunction instance
1283
- * @param \Twig_FunctionInterface|TwigFunction $function
1284
- */
1285
- public function addFunction($name, $function = null)
1286
- {
1287
- if (!$name instanceof TwigFunction && !($function instanceof TwigFunction || $function instanceof \Twig_FunctionInterface)) {
1288
- throw new \LogicException('A function must be an instance of \Twig_FunctionInterface or \Twig_SimpleFunction.');
1289
- }
1290
-
1291
- if ($name instanceof TwigFunction) {
1292
- $function = $name;
1293
- $name = $function->getName();
1294
- } else {
1295
- @trigger_error(sprintf('Passing a name as a first argument to the %s method is deprecated since version 1.21. Pass an instance of "Twig_SimpleFunction" instead when defining function "%s".', __METHOD__, $name), E_USER_DEPRECATED);
1296
- }
1297
-
1298
- if ($this->extensionInitialized) {
1299
- throw new \LogicException(sprintf('Unable to add function "%s" as extensions have already been initialized.', $name));
1300
- }
1301
-
1302
- $this->staging->addFunction($name, $function);
1303
- }
1304
-
1305
- /**
1306
- * Get a function by name.
1307
- *
1308
- * Subclasses may override this method and load functions differently;
1309
- * so no list of functions is available.
1310
- *
1311
- * @param string $name function name
1312
- *
1313
- * @return \Twig_Function|false
1314
- *
1315
- * @internal
1316
- */
1317
- public function getFunction($name)
1318
- {
1319
- if (!$this->extensionInitialized) {
1320
- $this->initExtensions();
1321
- }
1322
-
1323
- if (isset($this->functions[$name])) {
1324
- return $this->functions[$name];
1325
- }
1326
-
1327
- foreach ($this->functions as $pattern => $function) {
1328
- $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count);
1329
-
1330
- if ($count) {
1331
- if (preg_match('#^'.$pattern.'$#', $name, $matches)) {
1332
- array_shift($matches);
1333
- $function->setArguments($matches);
1334
-
1335
- return $function;
1336
- }
1337
- }
1338
- }
1339
-
1340
- foreach ($this->functionCallbacks as $callback) {
1341
- if (false !== $function = \call_user_func($callback, $name)) {
1342
- return $function;
1343
- }
1344
- }
1345
-
1346
- return false;
1347
- }
1348
-
1349
- public function registerUndefinedFunctionCallback($callable)
1350
- {
1351
- $this->functionCallbacks[] = $callable;
1352
- }
1353
-
1354
- /**
1355
- * Gets registered functions.
1356
- *
1357
- * Be warned that this method cannot return functions defined with registerUndefinedFunctionCallback.
1358
- *
1359
- * @return \Twig_FunctionInterface[]
1360
- *
1361
- * @see registerUndefinedFunctionCallback
1362
- *
1363
- * @internal
1364
- */
1365
- public function getFunctions()
1366
- {
1367
- if (!$this->extensionInitialized) {
1368
- $this->initExtensions();
1369
- }
1370
-
1371
- return $this->functions;
1372
- }
1373
-
1374
- /**
1375
- * Registers a Global.
1376
- *
1377
- * New globals can be added before compiling or rendering a template;
1378
- * but after, you can only update existing globals.
1379
- *
1380
- * @param string $name The global name
1381
- * @param mixed $value The global value
1382
- */
1383
- public function addGlobal($name, $value)
1384
- {
1385
- if ($this->extensionInitialized || $this->runtimeInitialized) {
1386
- if (null === $this->globals) {
1387
- $this->globals = $this->initGlobals();
1388
- }
1389
-
1390
- if (!\array_key_exists($name, $this->globals)) {
1391
- // The deprecation notice must be turned into the following exception in Twig 2.0
1392
- @trigger_error(sprintf('Registering global variable "%s" at runtime or when the extensions have already been initialized is deprecated since version 1.21.', $name), E_USER_DEPRECATED);
1393
- //throw new \LogicException(sprintf('Unable to add global "%s" as the runtime or the extensions have already been initialized.', $name));
1394
- }
1395
- }
1396
-
1397
- if ($this->extensionInitialized || $this->runtimeInitialized) {
1398
- // update the value
1399
- $this->globals[$name] = $value;
1400
- } else {
1401
- $this->staging->addGlobal($name, $value);
1402
- }
1403
- }
1404
-
1405
- /**
1406
- * Gets the registered Globals.
1407
- *
1408
- * @return array An array of globals
1409
- *
1410
- * @internal
1411
- */
1412
- public function getGlobals()
1413
- {
1414
- if (!$this->runtimeInitialized && !$this->extensionInitialized) {
1415
- return $this->initGlobals();
1416
- }
1417
-
1418
- if (null === $this->globals) {
1419
- $this->globals = $this->initGlobals();
1420
- }
1421
-
1422
- return $this->globals;
1423
- }
1424
-
1425
- /**
1426
- * Merges a context with the defined globals.
1427
- *
1428
- * @param array $context An array representing the context
1429
- *
1430
- * @return array The context merged with the globals
1431
- */
1432
- public function mergeGlobals(array $context)
1433
- {
1434
- // we don't use array_merge as the context being generally
1435
- // bigger than globals, this code is faster.
1436
- foreach ($this->getGlobals() as $key => $value) {
1437
- if (!\array_key_exists($key, $context)) {
1438
- $context[$key] = $value;
1439
- }
1440
- }
1441
-
1442
- return $context;
1443
- }
1444
-
1445
- /**
1446
- * Gets the registered unary Operators.
1447
- *
1448
- * @return array An array of unary operators
1449
- *
1450
- * @internal
1451
- */
1452
- public function getUnaryOperators()
1453
- {
1454
- if (!$this->extensionInitialized) {
1455
- $this->initExtensions();
1456
- }
1457
-
1458
- return $this->unaryOperators;
1459
- }
1460
-
1461
- /**
1462
- * Gets the registered binary Operators.
1463
- *
1464
- * @return array An array of binary operators
1465
- *
1466
- * @internal
1467
- */
1468
- public function getBinaryOperators()
1469
- {
1470
- if (!$this->extensionInitialized) {
1471
- $this->initExtensions();
1472
- }
1473
-
1474
- return $this->binaryOperators;
1475
- }
1476
-
1477
- /**
1478
- * @deprecated since 1.23 (to be removed in 2.0)
1479
- */
1480
- public function computeAlternatives($name, $items)
1481
- {
1482
- @trigger_error(sprintf('The %s method is deprecated since version 1.23 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED);
1483
-
1484
- return SyntaxError::computeAlternatives($name, $items);
1485
- }
1486
-
1487
- /**
1488
- * @internal
1489
- */
1490
- protected function initGlobals()
1491
- {
1492
- $globals = [];
1493
- foreach ($this->extensions as $name => $extension) {
1494
- if (!$extension instanceof GlobalsInterface) {
1495
- $m = new \ReflectionMethod($extension, 'getGlobals');
1496
-
1497
- $parentClass = $m->getDeclaringClass()->getName();
1498
- if ('Twig_Extension' !== $parentClass && 'Twig\Extension\AbstractExtension' !== $parentClass) {
1499
- @trigger_error(sprintf('Defining the getGlobals() method in the "%s" extension without explicitly implementing Twig\Extension\GlobalsInterface is deprecated since version 1.23.', $name), E_USER_DEPRECATED);
1500
- }
1501
- }
1502
-
1503
- $extGlob = $extension->getGlobals();
1504
- if (!\is_array($extGlob)) {
1505
- throw new \UnexpectedValueException(sprintf('"%s::getGlobals()" must return an array of globals.', \get_class($extension)));
1506
- }
1507
-
1508
- $globals[] = $extGlob;
1509
- }
1510
-
1511
- $globals[] = $this->staging->getGlobals();
1512
-
1513
- return \call_user_func_array('array_merge', $globals);
1514
- }
1515
-
1516
- /**
1517
- * @internal
1518
- */
1519
- protected function initExtensions()
1520
- {
1521
- if ($this->extensionInitialized) {
1522
- return;
1523
- }
1524
-
1525
- $this->parsers = new \Twig_TokenParserBroker([], [], false);
1526
- $this->filters = [];
1527
- $this->functions = [];
1528
- $this->tests = [];
1529
- $this->visitors = [];
1530
- $this->unaryOperators = [];
1531
- $this->binaryOperators = [];
1532
-
1533
- foreach ($this->extensions as $extension) {
1534
- $this->initExtension($extension);
1535
- }
1536
- $this->initExtension($this->staging);
1537
- // Done at the end only, so that an exception during initialization does not mark the environment as initialized when catching the exception
1538
- $this->extensionInitialized = true;
1539
- }
1540
-
1541
- /**
1542
- * @internal
1543
- */
1544
- protected function initExtension(ExtensionInterface $extension)
1545
- {
1546
- // filters
1547
- foreach ($extension->getFilters() as $name => $filter) {
1548
- if ($filter instanceof TwigFilter) {
1549
- $name = $filter->getName();
1550
- } else {
1551
- @trigger_error(sprintf('Using an instance of "%s" for filter "%s" is deprecated since version 1.21. Use \Twig_SimpleFilter instead.', \get_class($filter), $name), E_USER_DEPRECATED);
1552
- }
1553
-
1554
- $this->filters[$name] = $filter;
1555
- }
1556
-
1557
- // functions
1558
- foreach ($extension->getFunctions() as $name => $function) {
1559
- if ($function instanceof TwigFunction) {
1560
- $name = $function->getName();
1561
- } else {
1562
- @trigger_error(sprintf('Using an instance of "%s" for function "%s" is deprecated since version 1.21. Use \Twig_SimpleFunction instead.', \get_class($function), $name), E_USER_DEPRECATED);
1563
- }
1564
-
1565
- $this->functions[$name] = $function;
1566
- }
1567
-
1568
- // tests
1569
- foreach ($extension->getTests() as $name => $test) {
1570
- if ($test instanceof TwigTest) {
1571
- $name = $test->getName();
1572
- } else {
1573
- @trigger_error(sprintf('Using an instance of "%s" for test "%s" is deprecated since version 1.21. Use \Twig_SimpleTest instead.', \get_class($test), $name), E_USER_DEPRECATED);
1574
- }
1575
-
1576
- $this->tests[$name] = $test;
1577
- }
1578
-
1579
- // token parsers
1580
- foreach ($extension->getTokenParsers() as $parser) {
1581
- if ($parser instanceof TokenParserInterface) {
1582
- $this->parsers->addTokenParser($parser);
1583
- } elseif ($parser instanceof \Twig_TokenParserBrokerInterface) {
1584
- @trigger_error('Registering a \Twig_TokenParserBrokerInterface instance is deprecated since version 1.21.', E_USER_DEPRECATED);
1585
-
1586
- $this->parsers->addTokenParserBroker($parser);
1587
- } else {
1588
- throw new \LogicException('getTokenParsers() must return an array of \Twig_TokenParserInterface or \Twig_TokenParserBrokerInterface instances.');
1589
- }
1590
- }
1591
-
1592
- // node visitors
1593
- foreach ($extension->getNodeVisitors() as $visitor) {
1594
- $this->visitors[] = $visitor;
1595
- }
1596
-
1597
- // operators
1598
- if ($operators = $extension->getOperators()) {
1599
- if (!\is_array($operators)) {
1600
- throw new \InvalidArgumentException(sprintf('"%s::getOperators()" must return an array with operators, got "%s".', \get_class($extension), \is_object($operators) ? \get_class($operators) : \gettype($operators).(\is_resource($operators) ? '' : '#'.$operators)));
1601
- }
1602
-
1603
- if (2 !== \count($operators)) {
1604
- throw new \InvalidArgumentException(sprintf('"%s::getOperators()" must return an array of 2 elements, got %d.', \get_class($extension), \count($operators)));
1605
- }
1606
-
1607
- $this->unaryOperators = array_merge($this->unaryOperators, $operators[0]);
1608
- $this->binaryOperators = array_merge($this->binaryOperators, $operators[1]);
1609
- }
1610
- }
1611
-
1612
- /**
1613
- * @deprecated since 1.22 (to be removed in 2.0)
1614
- */
1615
- protected function writeCacheFile($file, $content)
1616
- {
1617
- $this->cache->write($file, $content);
1618
- }
1619
-
1620
- private function updateOptionsHash()
1621
- {
1622
- $hashParts = array_merge(
1623
- array_keys($this->extensions),
1624
- [
1625
- (int) \function_exists('twig_template_get_attributes'),
1626
- PHP_MAJOR_VERSION,
1627
- PHP_MINOR_VERSION,
1628
- self::VERSION,
1629
- (int) $this->debug,
1630
- $this->baseTemplateClass,
1631
- (int) $this->strictVariables,
1632
- ]
1633
- );
1634
- $this->optionsHash = implode(':', $hashParts);
1635
- }
1636
- }
1637
-
1638
- class_alias('Twig\Environment', 'Twig_Environment');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/src/Error/Error.php DELETED
@@ -1,325 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Twig\Error;
13
-
14
- use Twig\Source;
15
- use Twig\Template;
16
-
17
- /**
18
- * Twig base exception.
19
- *
20
- * This exception class and its children must only be used when
21
- * an error occurs during the loading of a template, when a syntax error
22
- * is detected in a template, or when rendering a template. Other
23
- * errors must use regular PHP exception classes (like when the template
24
- * cache directory is not writable for instance).
25
- *
26
- * To help debugging template issues, this class tracks the original template
27
- * name and line where the error occurred.
28
- *
29
- * Whenever possible, you must set these information (original template name
30
- * and line number) yourself by passing them to the constructor. If some or all
31
- * these information are not available from where you throw the exception, then
32
- * this class will guess them automatically (when the line number is set to -1
33
- * and/or the name is set to null). As this is a costly operation, this
34
- * can be disabled by passing false for both the name and the line number
35
- * when creating a new instance of this class.
36
- *
37
- * @author Fabien Potencier <fabien@symfony.com>
38
- */
39
- class Error extends \Exception
40
- {
41
- protected $lineno;
42
- // to be renamed to name in 2.0
43
- protected $filename;
44
- protected $rawMessage;
45
-
46
- private $sourcePath;
47
- private $sourceCode;
48
-
49
- /**
50
- * Constructor.
51
- *
52
- * Set the line number to -1 to enable its automatic guessing.
53
- * Set the name to null to enable its automatic guessing.
54
- *
55
- * @param string $message The error message
56
- * @param int $lineno The template line where the error occurred
57
- * @param Source|string|null $source The source context where the error occurred
58
- * @param \Exception $previous The previous exception
59
- */
60
- public function __construct($message, $lineno = -1, $source = null, \Exception $previous = null)
61
- {
62
- if (null === $source) {
63
- $name = null;
64
- } elseif (!$source instanceof Source) {
65
- // for compat with the Twig C ext., passing the template name as string is accepted
66
- $name = $source;
67
- } else {
68
- $name = $source->getName();
69
- $this->sourceCode = $source->getCode();
70
- $this->sourcePath = $source->getPath();
71
- }
72
- parent::__construct('', 0, $previous);
73
-
74
- $this->lineno = $lineno;
75
- $this->filename = $name;
76
- $this->rawMessage = $message;
77
- $this->updateRepr();
78
- }
79
-
80
- /**
81
- * Gets the raw message.
82
- *
83
- * @return string The raw message
84
- */
85
- public function getRawMessage()
86
- {
87
- return $this->rawMessage;
88
- }
89
-
90
- /**
91
- * Gets the logical name where the error occurred.
92
- *
93
- * @return string The name
94
- *
95
- * @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead.
96
- */
97
- public function getTemplateFile()
98
- {
99
- @trigger_error(sprintf('The "%s" method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), E_USER_DEPRECATED);
100
-
101
- return $this->filename;
102
- }
103
-
104
- /**
105
- * Sets the logical name where the error occurred.
106
- *
107
- * @param string $name The name
108
- *
109
- * @deprecated since 1.27 (to be removed in 2.0). Use setSourceContext() instead.
110
- */
111
- public function setTemplateFile($name)
112
- {
113
- @trigger_error(sprintf('The "%s" method is deprecated since version 1.27 and will be removed in 2.0. Use setSourceContext() instead.', __METHOD__), E_USER_DEPRECATED);
114
-
115
- $this->filename = $name;
116
-
117
- $this->updateRepr();
118
- }
119
-
120
- /**
121
- * Gets the logical name where the error occurred.
122
- *
123
- * @return string The name
124
- *
125
- * @deprecated since 1.29 (to be removed in 2.0). Use getSourceContext() instead.
126
- */
127
- public function getTemplateName()
128
- {
129
- @trigger_error(sprintf('The "%s" method is deprecated since version 1.29 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), E_USER_DEPRECATED);
130
-
131
- return $this->filename;
132
- }
133
-
134
- /**
135
- * Sets the logical name where the error occurred.
136
- *
137
- * @param string $name The name
138
- *
139
- * @deprecated since 1.29 (to be removed in 2.0). Use setSourceContext() instead.
140
- */
141
- public function setTemplateName($name)
142
- {
143
- @trigger_error(sprintf('The "%s" method is deprecated since version 1.29 and will be removed in 2.0. Use setSourceContext() instead.', __METHOD__), E_USER_DEPRECATED);
144
-
145
- $this->filename = $name;
146
- $this->sourceCode = $this->sourcePath = null;
147
-
148
- $this->updateRepr();
149
- }
150
-
151
- /**
152
- * Gets the template line where the error occurred.
153
- *
154
- * @return int The template line
155
- */
156
- public function getTemplateLine()
157
- {
158
- return $this->lineno;
159
- }
160
-
161
- /**
162
- * Sets the template line where the error occurred.
163
- *
164
- * @param int $lineno The template line
165
- */
166
- public function setTemplateLine($lineno)
167
- {
168
- $this->lineno = $lineno;
169
-
170
- $this->updateRepr();
171
- }
172
-
173
- /**
174
- * Gets the source context of the Twig template where the error occurred.
175
- *
176
- * @return Source|null
177
- */
178
- public function getSourceContext()
179
- {
180
- return $this->filename ? new Source($this->sourceCode, $this->filename, $this->sourcePath) : null;
181
- }
182
-
183
- /**
184
- * Sets the source context of the Twig template where the error occurred.
185
- */
186
- public function setSourceContext(Source $source = null)
187
- {
188
- if (null === $source) {
189
- $this->sourceCode = $this->filename = $this->sourcePath = null;
190
- } else {
191
- $this->sourceCode = $source->getCode();
192
- $this->filename = $source->getName();
193
- $this->sourcePath = $source->getPath();
194
- }
195
-
196
- $this->updateRepr();
197
- }
198
-
199
- public function guess()
200
- {
201
- $this->guessTemplateInfo();
202
- $this->updateRepr();
203
- }
204
-
205
- public function appendMessage($rawMessage)
206
- {
207
- $this->rawMessage .= $rawMessage;
208
- $this->updateRepr();
209
- }
210
-
211
- /**
212
- * @internal
213
- */
214
- protected function updateRepr()
215
- {
216
- $this->message = $this->rawMessage;
217
-
218
- if ($this->sourcePath && $this->lineno > 0) {
219
- $this->file = $this->sourcePath;
220
- $this->line = $this->lineno;
221
-
222
- return;
223
- }
224
-
225
- $dot = false;
226
- if ('.' === substr($this->message, -1)) {
227
- $this->message = substr($this->message, 0, -1);
228
- $dot = true;
229
- }
230
-
231
- $questionMark = false;
232
- if ('?' === substr($this->message, -1)) {
233
- $this->message = substr($this->message, 0, -1);
234
- $questionMark = true;
235
- }
236
-
237
- if ($this->filename) {
238
- if (\is_string($this->filename) || (\is_object($this->filename) && method_exists($this->filename, '__toString'))) {
239
- $name = sprintf('"%s"', $this->filename);
240
- } else {
241
- $name = json_encode($this->filename);
242
- }
243
- $this->message .= sprintf(' in %s', $name);
244
- }
245
-
246
- if ($this->lineno && $this->lineno >= 0) {
247
- $this->message .= sprintf(' at line %d', $this->lineno);
248
- }
249
-
250
- if ($dot) {
251
- $this->message .= '.';
252
- }
253
-
254
- if ($questionMark) {
255
- $this->message .= '?';
256
- }
257
- }
258
-
259
- /**
260
- * @internal
261
- */
262
- protected function guessTemplateInfo()
263
- {
264
- $template = null;
265
- $templateClass = null;
266
-
267
- $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT);
268
- foreach ($backtrace as $trace) {
269
- if (isset($trace['object']) && $trace['object'] instanceof Template && 'Twig_Template' !== \get_class($trace['object'])) {
270
- $currentClass = \get_class($trace['object']);
271
- $isEmbedContainer = 0 === strpos($templateClass, $currentClass);
272
- if (null === $this->filename || ($this->filename == $trace['object']->getTemplateName() && !$isEmbedContainer)) {
273
- $template = $trace['object'];
274
- $templateClass = \get_class($trace['object']);
275
- }
276
- }
277
- }
278
-
279
- // update template name
280
- if (null !== $template && null === $this->filename) {
281
- $this->filename = $template->getTemplateName();
282
- }
283
-
284
- // update template path if any
285
- if (null !== $template && null === $this->sourcePath) {
286
- $src = $template->getSourceContext();
287
- $this->sourceCode = $src->getCode();
288
- $this->sourcePath = $src->getPath();
289
- }
290
-
291
- if (null === $template || $this->lineno > -1) {
292
- return;
293
- }
294
-
295
- $r = new \ReflectionObject($template);
296
- $file = $r->getFileName();
297
-
298
- $exceptions = [$e = $this];
299
- while ($e instanceof self && $e = $e->getPrevious()) {
300
- $exceptions[] = $e;
301
- }
302
-
303
- while ($e = array_pop($exceptions)) {
304
- $traces = $e->getTrace();
305
- array_unshift($traces, ['file' => $e->getFile(), 'line' => $e->getLine()]);
306
-
307
- while ($trace = array_shift($traces)) {
308
- if (!isset($trace['file']) || !isset($trace['line']) || $file != $trace['file']) {
309
- continue;
310
- }
311
-
312
- foreach ($template->getDebugInfo() as $codeLine => $templateLine) {
313
- if ($codeLine <= $trace['line']) {
314
- // update template line
315
- $this->lineno = $templateLine;
316
-
317
- return;
318
- }
319
- }
320
- }
321
- }
322
- }
323
- }
324
-
325
- class_alias('Twig\Error\Error', 'Twig_Error');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/src/Error/LoaderError.php DELETED
@@ -1,23 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Twig\Error;
13
-
14
- /**
15
- * Exception thrown when an error occurs during template loading.
16
- *
17
- * @author Fabien Potencier <fabien@symfony.com>
18
- */
19
- class LoaderError extends Error
20
- {
21
- }
22
-
23
- class_alias('Twig\Error\LoaderError', 'Twig_Error_Loader');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/src/Error/RuntimeError.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- * (c) Armin Ronacher
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
12
-
13
- namespace Twig\Error;
14
-
15
- /**
16
- * Exception thrown when an error occurs at runtime.
17
- *
18
- * @author Fabien Potencier <fabien@symfony.com>
19
- */
20
- class RuntimeError extends Error
21
- {
22
- }
23
-
24
- class_alias('Twig\Error\RuntimeError', 'Twig_Error_Runtime');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/src/Error/SyntaxError.php DELETED
@@ -1,57 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- * (c) Armin Ronacher
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
12
-
13
- namespace Twig\Error;
14
-
15
- /**
16
- * \Exception thrown when a syntax error occurs during lexing or parsing of a template.
17
- *
18
- * @author Fabien Potencier <fabien@symfony.com>
19
- */
20
- class SyntaxError extends Error
21
- {
22
- /**
23
- * Tweaks the error message to include suggestions.
24
- *
25
- * @param string $name The original name of the item that does not exist
26
- * @param array $items An array of possible items
27
- */
28
- public function addSuggestions($name, array $items)
29
- {
30
- if (!$alternatives = self::computeAlternatives($name, $items)) {
31
- return;
32
- }
33
-
34
- $this->appendMessage(sprintf(' Did you mean "%s"?', implode('", "', $alternatives)));
35
- }
36
-
37
- /**
38
- * @internal
39
- *
40
- * To be merged with the addSuggestions() method in 2.0.
41
- */
42
- public static function computeAlternatives($name, $items)
43
- {
44
- $alternatives = [];
45
- foreach ($items as $item) {
46
- $lev = levenshtein($name, $item);
47
- if ($lev <= \strlen($name) / 3 || false !== strpos($item, $name)) {
48
- $alternatives[$item] = $lev;
49
- }
50
- }
51
- asort($alternatives);
52
-
53
- return array_keys($alternatives);
54
- }
55
- }
56
-
57
- class_alias('Twig\Error\SyntaxError', 'Twig_Error_Syntax');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/src/ExpressionParser.php DELETED
@@ -1,834 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- * (c) Armin Ronacher
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
12
-
13
- namespace Twig;
14
-
15
- use Twig\Error\SyntaxError;
16
- use Twig\Node\Expression\ArrayExpression;
17
- use Twig\Node\Expression\ArrowFunctionExpression;
18
- use Twig\Node\Expression\AssignNameExpression;
19
- use Twig\Node\Expression\Binary\ConcatBinary;
20
- use Twig\Node\Expression\BlockReferenceExpression;
21
- use Twig\Node\Expression\ConditionalExpression;
22
- use Twig\Node\Expression\ConstantExpression;
23
- use Twig\Node\Expression\GetAttrExpression;
24
- use Twig\Node\Expression\MethodCallExpression;
25
- use Twig\Node\Expression\NameExpression;
26
- use Twig\Node\Expression\ParentExpression;
27
- use Twig\Node\Expression\Unary\NegUnary;
28
- use Twig\Node\Expression\Unary\NotUnary;
29
- use Twig\Node\Expression\Unary\PosUnary;
30
- use Twig\Node\Node;
31
-
32
- /**
33
- * Parses expressions.
34
- *
35
- * This parser implements a "Precedence climbing" algorithm.
36
- *
37
- * @see https://www.engr.mun.ca/~theo/Misc/exp_parsing.htm
38
- * @see https://en.wikipedia.org/wiki/Operator-precedence_parser
39
- *
40
- * @author Fabien Potencier <fabien@symfony.com>
41
- *
42
- * @internal
43
- */
44
- class ExpressionParser
45
- {
46
- const OPERATOR_LEFT = 1;
47
- const OPERATOR_RIGHT = 2;
48
-
49
- protected $parser;
50
- protected $unaryOperators;
51
- protected $binaryOperators;
52
-
53
- private $env;
54
-
55
- public function __construct(Parser $parser, $env = null)
56
- {
57
- $this->parser = $parser;
58
-
59
- if ($env instanceof Environment) {
60
- $this->env = $env;
61
- $this->unaryOperators = $env->getUnaryOperators();
62
- $this->binaryOperators = $env->getBinaryOperators();
63
- } else {
64
- @trigger_error('Passing the operators as constructor arguments to '.__METHOD__.' is deprecated since version 1.27. Pass the environment instead.', E_USER_DEPRECATED);
65
-
66
- $this->env = $parser->getEnvironment();
67
- $this->unaryOperators = func_get_arg(1);
68
- $this->binaryOperators = func_get_arg(2);
69
- }
70
- }
71
-
72
- public function parseExpression($precedence = 0, $allowArrow = false)
73
- {
74
- if ($allowArrow && $arrow = $this->parseArrow()) {
75
- return $arrow;
76
- }
77
-
78
- $expr = $this->getPrimary();
79
- $token = $this->parser->getCurrentToken();
80
- while ($this->isBinary($token) && $this->binaryOperators[$token->getValue()]['precedence'] >= $precedence) {
81
- $op = $this->binaryOperators[$token->getValue()];
82
- $this->parser->getStream()->next();
83
-
84
- if ('is not' === $token->getValue()) {
85
- $expr = $this->parseNotTestExpression($expr);
86
- } elseif ('is' === $token->getValue()) {
87
- $expr = $this->parseTestExpression($expr);
88
- } elseif (isset($op['callable'])) {
89
- $expr = \call_user_func($op['callable'], $this->parser, $expr);
90
- } else {
91
- $expr1 = $this->parseExpression(self::OPERATOR_LEFT === $op['associativity'] ? $op['precedence'] + 1 : $op['precedence']);
92
- $class = $op['class'];
93
- $expr = new $class($expr, $expr1, $token->getLine());
94
- }
95
-
96
- $token = $this->parser->getCurrentToken();
97
- }
98
-
99
- if (0 === $precedence) {
100
- return $this->parseConditionalExpression($expr);
101
- }
102
-
103
- return $expr;
104
- }
105
-
106
- /**
107
- * @return ArrowFunctionExpression|null
108
- */
109
- private function parseArrow()
110
- {
111
- $stream = $this->parser->getStream();
112
-
113
- // short array syntax (one argument, no parentheses)?
114
- if ($stream->look(1)->test(Token::ARROW_TYPE)) {
115
- $line = $stream->getCurrent()->getLine();
116
- $token = $stream->expect(Token::NAME_TYPE);
117
- $names = [new AssignNameExpression($token->getValue(), $token->getLine())];
118
- $stream->expect(Token::ARROW_TYPE);
119
-
120
- return new ArrowFunctionExpression($this->parseExpression(0), new Node($names), $line);
121
- }
122
-
123
- // first, determine if we are parsing an arrow function by finding => (long form)
124
- $i = 0;
125
- if (!$stream->look($i)->test(Token::PUNCTUATION_TYPE, '(')) {
126
- return null;
127
- }
128
- ++$i;
129
- while (true) {
130
- // variable name
131
- ++$i;
132
- if (!$stream->look($i)->test(Token::PUNCTUATION_TYPE, ',')) {
133
- break;
134
- }
135
- ++$i;
136
- }
137
- if (!$stream->look($i)->test(Token::PUNCTUATION_TYPE, ')')) {
138
- return null;
139
- }
140
- ++$i;
141
- if (!$stream->look($i)->test(Token::ARROW_TYPE)) {
142
- return null;
143
- }
144
-
145
- // yes, let's parse it properly
146
- $token = $stream->expect(Token::PUNCTUATION_TYPE, '(');
147
- $line = $token->getLine();
148
-
149
- $names = [];
150
- while (true) {
151
- $token = $stream->expect(Token::NAME_TYPE);
152
- $names[] = new AssignNameExpression($token->getValue(), $token->getLine());
153
-
154
- if (!$stream->nextIf(Token::PUNCTUATION_TYPE, ',')) {
155
- break;
156
- }
157
- }
158
- $stream->expect(Token::PUNCTUATION_TYPE, ')');
159
- $stream->expect(Token::ARROW_TYPE);
160
-
161
- return new ArrowFunctionExpression($this->parseExpression(0), new Node($names), $line);
162
- }
163
-
164
- protected function getPrimary()
165
- {
166
- $token = $this->parser->getCurrentToken();
167
-
168
- if ($this->isUnary($token)) {
169
- $operator = $this->unaryOperators[$token->getValue()];
170
- $this->parser->getStream()->next();
171
- $expr = $this->parseExpression($operator['precedence']);
172
- $class = $operator['class'];
173
-
174
- return $this->parsePostfixExpression(new $class($expr, $token->getLine()));
175
- } elseif ($token->test(Token::PUNCTUATION_TYPE, '(')) {
176
- $this->parser->getStream()->next();
177
- $expr = $this->parseExpression();
178
- $this->parser->getStream()->expect(Token::PUNCTUATION_TYPE, ')', 'An opened parenthesis is not properly closed');
179
-
180
- return $this->parsePostfixExpression($expr);
181
- }
182
-
183
- return $this->parsePrimaryExpression();
184
- }
185
-
186
- protected function parseConditionalExpression($expr)
187
- {
188
- while ($this->parser->getStream()->nextIf(Token::PUNCTUATION_TYPE, '?')) {
189
- if (!$this->parser->getStream()->nextIf(Token::PUNCTUATION_TYPE, ':')) {
190
- $expr2 = $this->parseExpression();
191
- if ($this->parser->getStream()->nextIf(Token::PUNCTUATION_TYPE, ':')) {
192
- $expr3 = $this->parseExpression();
193
- } else {
194
- $expr3 = new ConstantExpression('', $this->parser->getCurrentToken()->getLine());
195
- }
196
- } else {
197
- $expr2 = $expr;
198
- $expr3 = $this->parseExpression();
199
- }
200
-
201
- $expr = new ConditionalExpression($expr, $expr2, $expr3, $this->parser->getCurrentToken()->getLine());
202
- }
203
-
204
- return $expr;
205
- }
206
-
207
- protected function isUnary(Token $token)
208
- {
209
- return $token->test(Token::OPERATOR_TYPE) && isset($this->unaryOperators[$token->getValue()]);
210
- }
211
-
212
- protected function isBinary(Token $token)
213
- {
214
- return $token->test(Token::OPERATOR_TYPE) && isset($this->binaryOperators[$token->getValue()]);
215
- }
216
-
217
- public function parsePrimaryExpression()
218
- {
219
- $token = $this->parser->getCurrentToken();
220
- switch ($token->getType()) {
221
- case Token::NAME_TYPE:
222
- $this->parser->getStream()->next();
223
- switch ($token->getValue()) {
224
- case 'true':
225
- case 'TRUE':
226
- $node = new ConstantExpression(true, $token->getLine());
227
- break;
228
-
229
- case 'false':
230
- case 'FALSE':
231
- $node = new ConstantExpression(false, $token->getLine());
232
- break;
233
-
234
- case 'none':
235
- case 'NONE':
236
- case 'null':
237
- case 'NULL':
238
- $node = new ConstantExpression(null, $token->getLine());
239
- break;
240
-
241
- default:
242
- if ('(' === $this->parser->getCurrentToken()->getValue()) {
243
- $node = $this->getFunctionNode($token->getValue(), $token->getLine());
244
- } else {
245
- $node = new NameExpression($token->getValue(), $token->getLine());
246
- }
247
- }
248
- break;
249
-
250
- case Token::NUMBER_TYPE:
251
- $this->parser->getStream()->next();
252
- $node = new ConstantExpression($token->getValue(), $token->getLine());
253
- break;
254
-
255
- case Token::STRING_TYPE:
256
- case Token::INTERPOLATION_START_TYPE:
257
- $node = $this->parseStringExpression();
258
- break;
259
-
260
- case Token::OPERATOR_TYPE:
261
- if (preg_match(Lexer::REGEX_NAME, $token->getValue(), $matches) && $matches[0] == $token->getValue()) {
262
- // in this context, string operators are variable names
263
- $this->parser->getStream()->next();
264
- $node = new NameExpression($token->getValue(), $token->getLine());
265
- break;
266
- } elseif (isset($this->unaryOperators[$token->getValue()])) {
267
- $class = $this->unaryOperators[$token->getValue()]['class'];
268
-
269
- $ref = new \ReflectionClass($class);
270
- $negClass = 'Twig\Node\Expression\Unary\NegUnary';
271
- $posClass = 'Twig\Node\Expression\Unary\PosUnary';
272
- if (!(\in_array($ref->getName(), [$negClass, $posClass, 'Twig_Node_Expression_Unary_Neg', 'Twig_Node_Expression_Unary_Pos'])
273
- || $ref->isSubclassOf($negClass) || $ref->isSubclassOf($posClass)
274
- || $ref->isSubclassOf('Twig_Node_Expression_Unary_Neg') || $ref->isSubclassOf('Twig_Node_Expression_Unary_Pos'))
275
- ) {
276
- throw new SyntaxError(sprintf('Unexpected unary operator "%s".', $token->getValue()), $token->getLine(), $this->parser->getStream()->getSourceContext());
277
- }
278
-
279
- $this->parser->getStream()->next();
280
- $expr = $this->parsePrimaryExpression();
281
-
282
- $node = new $class($expr, $token->getLine());
283
- break;
284
- }
285
-
286
- // no break
287
- default:
288
- if ($token->test(Token::PUNCTUATION_TYPE, '[')) {
289
- $node = $this->parseArrayExpression();
290
- } elseif ($token->test(Token::PUNCTUATION_TYPE, '{')) {
291
- $node = $this->parseHashExpression();
292
- } elseif ($token->test(Token::OPERATOR_TYPE, '=') && ('==' === $this->parser->getStream()->look(-1)->getValue() || '!=' === $this->parser->getStream()->look(-1)->getValue())) {
293
- throw new SyntaxError(sprintf('Unexpected operator of value "%s". Did you try to use "===" or "!==" for strict comparison? Use "is same as(value)" instead.', $token->getValue()), $token->getLine(), $this->parser->getStream()->getSourceContext());
294
- } else {
295
- throw new SyntaxError(sprintf('Unexpected token "%s" of value "%s".', Token::typeToEnglish($token->getType()), $token->getValue()), $token->getLine(), $this->parser->getStream()->getSourceContext());
296
- }
297
- }
298
-
299
- return $this->parsePostfixExpression($node);
300
- }
301
-
302
- public function parseStringExpression()
303
- {
304
- $stream = $this->parser->getStream();
305
-
306
- $nodes = [];
307
- // a string cannot be followed by another string in a single expression
308
- $nextCanBeString = true;
309
- while (true) {
310
- if ($nextCanBeString && $token = $stream->nextIf(Token::STRING_TYPE)) {
311
- $nodes[] = new ConstantExpression($token->getValue(), $token->getLine());
312
- $nextCanBeString = false;
313
- } elseif ($stream->nextIf(Token::INTERPOLATION_START_TYPE)) {
314
- $nodes[] = $this->parseExpression();
315
- $stream->expect(Token::INTERPOLATION_END_TYPE);
316
- $nextCanBeString = true;
317
- } else {
318
- break;
319
- }
320
- }
321
-
322
- $expr = array_shift($nodes);
323
- foreach ($nodes as $node) {
324
- $expr = new ConcatBinary($expr, $node, $node->getTemplateLine());
325
- }
326
-
327
- return $expr;
328
- }
329
-
330
- public function parseArrayExpression()
331
- {
332
- $stream = $this->parser->getStream();
333
- $stream->expect(Token::PUNCTUATION_TYPE, '[', 'An array element was expected');
334
-
335
- $node = new ArrayExpression([], $stream->getCurrent()->getLine());
336
- $first = true;
337
- while (!$stream->test(Token::PUNCTUATION_TYPE, ']')) {
338
- if (!$first) {
339
- $stream->expect(Token::PUNCTUATION_TYPE, ',', 'An array element must be followed by a comma');
340
-
341
- // trailing ,?
342
- if ($stream->test(Token::PUNCTUATION_TYPE, ']')) {
343
- break;
344
- }
345
- }
346
- $first = false;
347
-
348
- $node->addElement($this->parseExpression());
349
- }
350
- $stream->expect(Token::PUNCTUATION_TYPE, ']', 'An opened array is not properly closed');
351
-
352
- return $node;
353
- }
354
-
355
- public function parseHashExpression()
356
- {
357
- $stream = $this->parser->getStream();
358
- $stream->expect(Token::PUNCTUATION_TYPE, '{', 'A hash element was expected');
359
-
360
- $node = new ArrayExpression([], $stream->getCurrent()->getLine());
361
- $first = true;
362
- while (!$stream->test(Token::PUNCTUATION_TYPE, '}')) {
363
- if (!$first) {
364
- $stream->expect(Token::PUNCTUATION_TYPE, ',', 'A hash value must be followed by a comma');
365
-
366
- // trailing ,?
367
- if ($stream->test(Token::PUNCTUATION_TYPE, '}')) {
368
- break;
369
- }
370
- }
371
- $first = false;
372
-
373
- // a hash key can be:
374
- //
375
- // * a number -- 12
376
- // * a string -- 'a'
377
- // * a name, which is equivalent to a string -- a
378
- // * an expression, which must be enclosed in parentheses -- (1 + 2)
379
- if (($token = $stream->nextIf(Token::STRING_TYPE)) || ($token = $stream->nextIf(Token::NAME_TYPE)) || $token = $stream->nextIf(Token::NUMBER_TYPE)) {
380
- $key = new ConstantExpression($token->getValue(), $token->getLine());
381
- } elseif ($stream->test(Token::PUNCTUATION_TYPE, '(')) {
382
- $key = $this->parseExpression();
383
- } else {
384
- $current = $stream->getCurrent();
385
-
386
- throw new SyntaxError(sprintf('A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "%s" of value "%s".', Token::typeToEnglish($current->getType()), $current->getValue()), $current->getLine(), $stream->getSourceContext());
387
- }
388
-
389
- $stream->expect(Token::PUNCTUATION_TYPE, ':', 'A hash key must be followed by a colon (:)');
390
- $value = $this->parseExpression();
391
-
392
- $node->addElement($value, $key);
393
- }
394
- $stream->expect(Token::PUNCTUATION_TYPE, '}', 'An opened hash is not properly closed');
395
-
396
- return $node;
397
- }
398
-
399
- public function parsePostfixExpression($node)
400
- {
401
- while (true) {
402
- $token = $this->parser->getCurrentToken();
403
- if (Token::PUNCTUATION_TYPE == $token->getType()) {
404
- if ('.' == $token->getValue() || '[' == $token->getValue()) {
405
- $node = $this->parseSubscriptExpression($node);
406
- } elseif ('|' == $token->getValue()) {
407
- $node = $this->parseFilterExpression($node);
408
- } else {
409
- break;
410
- }
411
- } else {
412
- break;
413
- }
414
- }
415
-
416
- return $node;
417
- }
418
-
419
- public function getFunctionNode($name, $line)
420
- {
421
- switch ($name) {
422
- case 'parent':
423
- $this->parseArguments();
424
- if (!\count($this->parser->getBlockStack())) {
425
- throw new SyntaxError('Calling "parent" outside a block is forbidden.', $line, $this->parser->getStream()->getSourceContext());
426
- }
427
-
428
- if (!$this->parser->getParent() && !$this->parser->hasTraits()) {
429
- throw new SyntaxError('Calling "parent" on a template that does not extend nor "use" another template is forbidden.', $line, $this->parser->getStream()->getSourceContext());
430
- }
431
-
432
- return new ParentExpression($this->parser->peekBlockStack(), $line);
433
- case 'block':
434
- $args = $this->parseArguments();
435
- if (\count($args) < 1) {
436
- throw new SyntaxError('The "block" function takes one argument (the block name).', $line, $this->parser->getStream()->getSourceContext());
437
- }
438
-
439
- return new BlockReferenceExpression($args->getNode(0), \count($args) > 1 ? $args->getNode(1) : null, $line);
440
- case 'attribute':
441
- $args = $this->parseArguments();
442
- if (\count($args) < 2) {
443
- throw new SyntaxError('The "attribute" function takes at least two arguments (the variable and the attributes).', $line, $this->parser->getStream()->getSourceContext());
444
- }
445
-
446
- return new GetAttrExpression($args->getNode(0), $args->getNode(1), \count($args) > 2 ? $args->getNode(2) : null, Template::ANY_CALL, $line);
447
- default:
448
- if (null !== $alias = $this->parser->getImportedSymbol('function', $name)) {
449
- $arguments = new ArrayExpression([], $line);
450
- foreach ($this->parseArguments() as $n) {
451
- $arguments->addElement($n);
452
- }
453
-
454
- $node = new MethodCallExpression($alias['node'], $alias['name'], $arguments, $line);
455
- $node->setAttribute('safe', true);
456
-
457
- return $node;
458
- }
459
-
460
- $args = $this->parseArguments(true);
461
- $class = $this->getFunctionNodeClass($name, $line);
462
-
463
- return new $class($name, $args, $line);
464
- }
465
- }
466
-
467
- public function parseSubscriptExpression($node)
468
- {
469
- $stream = $this->parser->getStream();
470
- $token = $stream->next();
471
- $lineno = $token->getLine();
472
- $arguments = new ArrayExpression([], $lineno);
473
- $type = Template::ANY_CALL;
474
- if ('.' == $token->getValue()) {
475
- $token = $stream->next();
476
- if (
477
- Token::NAME_TYPE == $token->getType()
478
- ||
479
- Token::NUMBER_TYPE == $token->getType()
480
- ||
481
- (Token::OPERATOR_TYPE == $token->getType() && preg_match(Lexer::REGEX_NAME, $token->getValue()))
482
- ) {
483
- $arg = new ConstantExpression($token->getValue(), $lineno);
484
-
485
- if ($stream->test(Token::PUNCTUATION_TYPE, '(')) {
486
- $type = Template::METHOD_CALL;
487
- foreach ($this->parseArguments() as $n) {
488
- $arguments->addElement($n);
489
- }
490
- }
491
- } else {
492
- throw new SyntaxError('Expected name or number.', $lineno, $stream->getSourceContext());
493
- }
494
-
495
- if ($node instanceof NameExpression && null !== $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) {
496
- if (!$arg instanceof ConstantExpression) {
497
- throw new SyntaxError(sprintf('Dynamic macro names are not supported (called on "%s").', $node->getAttribute('name')), $token->getLine(), $stream->getSourceContext());
498
- }
499
-
500
- $name = $arg->getAttribute('value');
501
-
502
- if ($this->parser->isReservedMacroName($name)) {
503
- throw new SyntaxError(sprintf('"%s" cannot be called as macro as it is a reserved keyword.', $name), $token->getLine(), $stream->getSourceContext());
504
- }
505
-
506
- $node = new MethodCallExpression($node, 'get'.$name, $arguments, $lineno);
507
- $node->setAttribute('safe', true);
508
-
509
- return $node;
510
- }
511
- } else {
512
- $type = Template::ARRAY_CALL;
513
-
514
- // slice?
515
- $slice = false;
516
- if ($stream->test(Token::PUNCTUATION_TYPE, ':')) {
517
- $slice = true;
518
- $arg = new ConstantExpression(0, $token->getLine());
519
- } else {
520
- $arg = $this->parseExpression();
521
- }
522
-
523
- if ($stream->nextIf(Token::PUNCTUATION_TYPE, ':')) {
524
- $slice = true;
525
- }
526
-
527
- if ($slice) {
528
- if ($stream->test(Token::PUNCTUATION_TYPE, ']')) {
529
- $length = new ConstantExpression(null, $token->getLine());
530
- } else {
531
- $length = $this->parseExpression();
532
- }
533
-
534
- $class = $this->getFilterNodeClass('slice', $token->getLine());
535
- $arguments = new Node([$arg, $length]);
536
- $filter = new $class($node, new ConstantExpression('slice', $token->getLine()), $arguments, $token->getLine());
537
-
538
- $stream->expect(Token::PUNCTUATION_TYPE, ']');
539
-
540
- return $filter;
541
- }
542
-
543
- $stream->expect(Token::PUNCTUATION_TYPE, ']');
544
- }
545
-
546
- return new GetAttrExpression($node, $arg, $arguments, $type, $lineno);
547
- }
548
-
549
- public function parseFilterExpression($node)
550
- {
551
- $this->parser->getStream()->next();
552
-
553
- return $this->parseFilterExpressionRaw($node);
554
- }
555
-
556
- public function parseFilterExpressionRaw($node, $tag = null)
557
- {
558
- while (true) {
559
- $token = $this->parser->getStream()->expect(Token::NAME_TYPE);
560
-
561
- $name = new ConstantExpression($token->getValue(), $token->getLine());
562
- if (!$this->parser->getStream()->test(Token::PUNCTUATION_TYPE, '(')) {
563
- $arguments = new Node();
564
- } else {
565
- $arguments = $this->parseArguments(true, false, true);
566
- }
567
-
568
- $class = $this->getFilterNodeClass($name->getAttribute('value'), $token->getLine());
569
-
570
- $node = new $class($node, $name, $arguments, $token->getLine(), $tag);
571
-
572
- if (!$this->parser->getStream()->test(Token::PUNCTUATION_TYPE, '|')) {
573
- break;
574
- }
575
-
576
- $this->parser->getStream()->next();
577
- }
578
-
579
- return $node;
580
- }
581
-
582
- /**
583
- * Parses arguments.
584
- *
585
- * @param bool $namedArguments Whether to allow named arguments or not
586
- * @param bool $definition Whether we are parsing arguments for a function definition
587
- *
588
- * @return Node
589
- *
590
- * @throws SyntaxError
591
- */
592
- public function parseArguments($namedArguments = false, $definition = false, $allowArrow = false)
593
- {
594
- $args = [];
595
- $stream = $this->parser->getStream();
596
-
597
- $stream->expect(Token::PUNCTUATION_TYPE, '(', 'A list of arguments must begin with an opening parenthesis');
598
- while (!$stream->test(Token::PUNCTUATION_TYPE, ')')) {
599
- if (!empty($args)) {
600
- $stream->expect(Token::PUNCTUATION_TYPE, ',', 'Arguments must be separated by a comma');
601
- }
602
-
603
- if ($definition) {
604
- $token = $stream->expect(Token::NAME_TYPE, null, 'An argument must be a name');
605
- $value = new NameExpression($token->getValue(), $this->parser->getCurrentToken()->getLine());
606
- } else {
607
- $value = $this->parseExpression(0, $allowArrow);
608
- }
609
-
610
- $name = null;
611
- if ($namedArguments && $token = $stream->nextIf(Token::OPERATOR_TYPE, '=')) {
612
- if (!$value instanceof NameExpression) {
613
- throw new SyntaxError(sprintf('A parameter name must be a string, "%s" given.', \get_class($value)), $token->getLine(), $stream->getSourceContext());
614
- }
615
- $name = $value->getAttribute('name');
616
-
617
- if ($definition) {
618
- $value = $this->parsePrimaryExpression();
619
-
620
- if (!$this->checkConstantExpression($value)) {
621
- throw new SyntaxError(sprintf('A default value for an argument must be a constant (a boolean, a string, a number, or an array).'), $token->getLine(), $stream->getSourceContext());
622
- }
623
- } else {
624
- $value = $this->parseExpression(0, $allowArrow);
625
- }
626
- }
627
-
628
- if ($definition) {
629
- if (null === $name) {
630
- $name = $value->getAttribute('name');
631
- $value = new ConstantExpression(null, $this->parser->getCurrentToken()->getLine());
632
- }
633
- $args[$name] = $value;
634
- } else {
635
- if (null === $name) {
636
- $args[] = $value;
637
- } else {
638
- $args[$name] = $value;
639
- }
640
- }
641
- }
642
- $stream->expect(Token::PUNCTUATION_TYPE, ')', 'A list of arguments must be closed by a parenthesis');
643
-
644
- return new Node($args);
645
- }
646
-
647
- public function parseAssignmentExpression()
648
- {
649
- $stream = $this->parser->getStream();
650
- $targets = [];
651
- while (true) {
652
- $token = $this->parser->getCurrentToken();
653
- if ($stream->test(Token::OPERATOR_TYPE) && preg_match(Lexer::REGEX_NAME, $token->getValue())) {
654
- // in this context, string operators are variable names
655
- $this->parser->getStream()->next();
656
- } else {
657
- $stream->expect(Token::NAME_TYPE, null, 'Only variables can be assigned to');
658
- }
659
- $value = $token->getValue();
660
- if (\in_array(strtolower($value), ['true', 'false', 'none', 'null'])) {
661
- throw new SyntaxError(sprintf('You cannot assign a value to "%s".', $value), $token->getLine(), $stream->getSourceContext());
662
- }
663
- $targets[] = new AssignNameExpression($value, $token->getLine());
664
-
665
- if (!$stream->nextIf(Token::PUNCTUATION_TYPE, ',')) {
666
- break;
667
- }
668
- }
669
-
670
- return new Node($targets);
671
- }
672
-
673
- public function parseMultitargetExpression()
674
- {
675
- $targets = [];
676
- while (true) {
677
- $targets[] = $this->parseExpression();
678
- if (!$this->parser->getStream()->nextIf(Token::PUNCTUATION_TYPE, ',')) {
679
- break;
680
- }
681
- }
682
-
683
- return new Node($targets);
684
- }
685
-
686
- private function parseNotTestExpression(\Twig_NodeInterface $node)
687
- {
688
- return new NotUnary($this->parseTestExpression($node), $this->parser->getCurrentToken()->getLine());
689
- }
690
-
691
- private function parseTestExpression(\Twig_NodeInterface $node)
692
- {
693
- $stream = $this->parser->getStream();
694
- list($name, $test) = $this->getTest($node->getTemplateLine());
695
-
696
- $class = $this->getTestNodeClass($test);
697
- $arguments = null;
698
- if ($stream->test(Token::PUNCTUATION_TYPE, '(')) {
699
- $arguments = $this->parseArguments(true);
700
- }
701
-
702
- return new $class($node, $name, $arguments, $this->parser->getCurrentToken()->getLine());
703
- }
704
-
705
- private function getTest($line)
706
- {
707
- $stream = $this->parser->getStream();
708
- $name = $stream->expect(Token::NAME_TYPE)->getValue();
709
-
710
- if ($test = $this->env->getTest($name)) {
711
- return [$name, $test];
712
- }
713
-
714
- if ($stream->test(Token::NAME_TYPE)) {
715
- // try 2-words tests
716
- $name = $name.' '.$this->parser->getCurrentToken()->getValue();
717
-
718
- if ($test = $this->env->getTest($name)) {
719
- $stream->next();
720
-
721
- return [$name, $test];
722
- }
723
- }
724
-
725
- $e = new SyntaxError(sprintf('Unknown "%s" test.', $name), $line, $stream->getSourceContext());
726
- $e->addSuggestions($name, array_keys($this->env->getTests()));
727
-
728
- throw $e;
729
- }
730
-
731
- private function getTestNodeClass($test)
732
- {
733
- if ($test instanceof TwigTest && $test->isDeprecated()) {
734
- $stream = $this->parser->getStream();
735
- $message = sprintf('Twig Test "%s" is deprecated', $test->getName());
736
- if (!\is_bool($test->getDeprecatedVersion())) {
737
- $message .= sprintf(' since version %s', $test->getDeprecatedVersion());
738
- }
739
- if ($test->getAlternative()) {
740
- $message .= sprintf('. Use "%s" instead', $test->getAlternative());
741
- }
742
- $src = $stream->getSourceContext();
743
- $message .= sprintf(' in %s at line %d.', $src->getPath() ? $src->getPath() : $src->getName(), $stream->getCurrent()->getLine());
744
-
745
- @trigger_error($message, E_USER_DEPRECATED);
746
- }
747
-
748
- if ($test instanceof TwigTest) {
749
- return $test->getNodeClass();
750
- }
751
-
752
- return $test instanceof \Twig_Test_Node ? $test->getClass() : 'Twig\Node\Expression\TestExpression';
753
- }
754
-
755
- protected function getFunctionNodeClass($name, $line)
756
- {
757
- if (false === $function = $this->env->getFunction($name)) {
758
- $e = new SyntaxError(sprintf('Unknown "%s" function.', $name), $line, $this->parser->getStream()->getSourceContext());
759
- $e->addSuggestions($name, array_keys($this->env->getFunctions()));
760
-
761
- throw $e;
762
- }
763
-
764
- if ($function instanceof TwigFunction && $function->isDeprecated()) {
765
- $message = sprintf('Twig Function "%s" is deprecated', $function->getName());
766
- if (!\is_bool($function->getDeprecatedVersion())) {
767
- $message .= sprintf(' since version %s', $function->getDeprecatedVersion());
768
- }
769
- if ($function->getAlternative()) {
770
- $message .= sprintf('. Use "%s" instead', $function->getAlternative());
771
- }
772
- $src = $this->parser->getStream()->getSourceContext();
773
- $message .= sprintf(' in %s at line %d.', $src->getPath() ? $src->getPath() : $src->getName(), $line);
774
-
775
- @trigger_error($message, E_USER_DEPRECATED);
776
- }
777
-
778
- if ($function instanceof TwigFunction) {
779
- return $function->getNodeClass();
780
- }
781
-
782
- return $function instanceof \Twig_Function_Node ? $function->getClass() : 'Twig\Node\Expression\FunctionExpression';
783
- }
784
-
785
- protected function getFilterNodeClass($name, $line)
786
- {
787
- if (false === $filter = $this->env->getFilter($name)) {
788
- $e = new SyntaxError(sprintf('Unknown "%s" filter.', $name), $line, $this->parser->getStream()->getSourceContext());
789
- $e->addSuggestions($name, array_keys($this->env->getFilters()));
790
-
791
- throw $e;
792
- }
793
-
794
- if ($filter instanceof TwigFilter && $filter->isDeprecated()) {
795
- $message = sprintf('Twig Filter "%s" is deprecated', $filter->getName());
796
- if (!\is_bool($filter->getDeprecatedVersion())) {
797
- $message .= sprintf(' since version %s', $filter->getDeprecatedVersion());
798
- }
799
- if ($filter->getAlternative()) {
800
- $message .= sprintf('. Use "%s" instead', $filter->getAlternative());
801
- }
802
- $src = $this->parser->getStream()->getSourceContext();
803
- $message .= sprintf(' in %s at line %d.', $src->getPath() ? $src->getPath() : $src->getName(), $line);
804
-
805
- @trigger_error($message, E_USER_DEPRECATED);
806
- }
807
-
808
- if ($filter instanceof TwigFilter) {
809
- return $filter->getNodeClass();
810
- }
811
-
812
- return $filter instanceof \Twig_Filter_Node ? $filter->getClass() : 'Twig\Node\Expression\FilterExpression';
813
- }
814
-
815
- // checks that the node only contains "constant" elements
816
- protected function checkConstantExpression(\Twig_NodeInterface $node)
817
- {
818
- if (!($node instanceof ConstantExpression || $node instanceof ArrayExpression
819
- || $node instanceof NegUnary || $node instanceof PosUnary
820
- )) {
821
- return false;
822
- }
823
-
824
- foreach ($node as $n) {
825
- if (!$this->checkConstantExpression($n)) {
826
- return false;
827
- }
828
- }
829
-
830
- return true;
831
- }
832
- }
833
-
834
- class_alias('Twig\ExpressionParser', 'Twig_ExpressionParser');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/src/Extension/AbstractExtension.php DELETED
@@ -1,72 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Twig\Extension;
13
-
14
- use Twig\Environment;
15
-
16
- abstract class AbstractExtension implements ExtensionInterface
17
- {
18
- /**
19
- * @deprecated since 1.23 (to be removed in 2.0), implement \Twig_Extension_InitRuntimeInterface instead
20
- */
21
- public function initRuntime(Environment $environment)
22
- {
23
- }
24
-
25
- public function getTokenParsers()
26
- {
27
- return [];
28
- }
29
-
30
- public function getNodeVisitors()
31
- {
32
- return [];
33
- }
34
-
35
- public function getFilters()
36
- {
37
- return [];
38
- }
39
-
40
- public function getTests()
41
- {
42
- return [];
43
- }
44
-
45
- public function getFunctions()
46
- {
47
- return [];
48
- }
49
-
50
- public function getOperators()
51
- {
52
- return [];
53
- }
54
-
55
- /**
56
- * @deprecated since 1.23 (to be removed in 2.0), implement \Twig_Extension_GlobalsInterface instead
57
- */
58
- public function getGlobals()
59
- {
60
- return [];
61
- }
62
-
63
- /**
64
- * @deprecated since 1.26 (to be removed in 2.0), not used anymore internally
65
- */
66
- public function getName()
67
- {
68
- return \get_class($this);
69
- }
70
- }
71
-
72
- class_alias('Twig\Extension\AbstractExtension', 'Twig_Extension');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/vendor/twig/twig/src/Extension/CoreExtension.php DELETED
@@ -1,1728 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Twig.
5
- *
6
- * (c) Fabien Potencier
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
11
-
12
- namespace Twig\Extension {
13
- use Twig\ExpressionParser;
14
- use Twig\TokenParser\ApplyTokenParser;
15
- use Twig\TokenParser\BlockTokenParser;
16
- use Twig\TokenParser\DeprecatedTokenParser;
17
- use Twig\TokenParser\DoTokenParser;
18
- use Twig\TokenParser\EmbedTokenParser;
19
- use Twig\TokenParser\ExtendsTokenParser;
20
- use Twig\TokenParser\FilterTokenParser;
21
- use Twig\TokenParser\FlushTokenParser;
22
- use Twig\TokenParser\ForTokenParser;
23
- use Twig\TokenParser\FromTokenParser;
24
- use Twig\TokenParser\IfTokenParser;
25
- use Twig\TokenParser\ImportTokenParser;
26
- use Twig\TokenParser\IncludeTokenParser;
27
- use Twig\TokenParser\MacroTokenParser;
28
- use Twig\TokenParser\SetTokenParser;
29
- use Twig\TokenParser\SpacelessTokenParser;
30
- use Twig\TokenParser\UseTokenParser;
31
- use Twig\TokenParser\WithTokenParser;
32
- use Twig\TwigFilter;
33
- use Twig\TwigFunction;
34
- use Twig\TwigTest;
35
-
36
- /**
37
- * @final
38
- */
39
- class CoreExtension extends AbstractExtension
40
- {
41
- protected $dateFormats = ['F j, Y H:i', '%d days'];
42
- protected $numberFormat = [0, '.', ','];
43
- protected $timezone = null;
44
- protected $escapers = [];
45
-
46
- /**
47
- * Defines a new escaper to be used via the escape filter.
48
- *
49
- * @param string $strategy The strategy name that should be used as a strategy in the escape call
50
- * @param callable $callable A valid PHP callable
51
- */
52
- public function setEscaper($strategy, $callable)
53
- {
54
- $this->escapers[$strategy] = $callable;
55
- }
56
-
57
- /**
58
- * Gets all defined escapers.
59
- *
60
- * @return array An array of escapers
61
- */
62
- public function getEscapers()
63
- {
64
- return $this->escapers;
65
- }
66
-
67
- /**
68
- * Sets the default format to be used by the date filter.
69
- *
70
- * @param string $format The default date format string
71
- * @param string $dateIntervalFormat The default date interval format string
72
- */
73
- public function setDateFormat($format = null, $dateIntervalFormat = null)
74
- {
75
- if (null !== $format) {
76
- $this->dateFormats[0] = $format;
77
- }
78
-
79
- if (null !== $dateIntervalFormat) {
80
- $this->dateFormats[1] = $dateIntervalFormat;
81
- }
82
- }
83
-
84
- /**
85
- * Gets the default format to be used by the date filter.
86
- *
87
- * @return array The default date format string and the default date interval format string
88
- */
89
- public function getDateFormat()
90
- {
91
- return $this->dateFormats;
92
- }
93
-
94
- /**
95
- * Sets the default timezone to be used by the date filter.
96
- *
97
- * @param \DateTimeZone|string $timezone The default timezone string or a \DateTimeZone object
98
- */
99
- public function setTimezone($timezone)
100
- {
101
- $this->timezone = $timezone instanceof \DateTimeZone ? $timezone : new \DateTimeZone($timezone);
102
- }
103
-
104
- /**
105
- * Gets the default timezone to be used by the date filter.
106
- *
107
- * @return \DateTimeZone The default timezone currently in use
108
- */
109
- public function getTimezone()
110
- {
111
- if (null === $this->timezone) {
112
- $this->timezone = new \DateTimeZone(date_default_timezone_get());
113
- }
114
-
115
- return $this->timezone;
116
- }
117
-
118
- /**
119
- * Sets the default format to be used by the number_format filter.
120
- *
121
- * @param int $decimal the number of decimal places to use
122
- * @param string $decimalPoint the character(s) to use for the decimal point
123
- * @param string $thousandSep the character(s) to use for the thousands separator
124
- */
125
- public function setNumberFormat($decimal, $decimalPoint, $thousandSep)
126
- {
127
- $this->numberFormat = [$decimal, $decimalPoint, $thousandSep];
128
- }
129
-
130
- /**
131
- * Get the default format used by the number_format filter.
132
- *
133
- * @return array The arguments for number_format()
134
- */
135
- public function getNumberFormat()
136
- {
137
- return $this->numberFormat;
138
- }
139
-
140
- public function getTokenParsers()
141
- {
142
- return [
143
- new ApplyTokenParser(),
144
- new ForTokenParser(),
145
- new IfTokenParser(),
146
- new ExtendsTokenParser(),
147
- new IncludeTokenParser(),
148
- new BlockTokenParser(),
149
- new UseTokenParser(),
150
- new FilterTokenParser(),
151
- new MacroTokenParser(),
152
- new ImportTokenParser(),
153
- new FromTokenParser(),
154
- new SetTokenParser(),
155
- new SpacelessTokenParser(),
156
- new FlushTokenParser(),
157
- new DoTokenParser(),
158
- new EmbedTokenParser(),
159
- new WithTokenParser(),
160
- new DeprecatedTokenParser(),
161
- ];
162
- }
163
-
164
- public function getFilters()
165
- {
166
- $filters = [
167
- // formatting filters
168
- new TwigFilter('date', 'twig_date_format_filter', ['needs_environment' => true]),
169
- new TwigFilter('date_modify', 'twig_date_modify_filter', ['needs_environment' => true]),
170
- new TwigFilter('format', 'sprintf'),
171
- new TwigFilter('replace', 'twig_replace_filter'),
172
- new TwigFilter('number_format', 'twig_number_format_filter', ['needs_environment' => true]),
173
- new TwigFilter('abs', 'abs'),
174
- new TwigFilter('round', 'twig_round'),
175
-
176
- // encoding
177
- new TwigFilter('url_encode', 'twig_urlencode_filter'),
178
- new TwigFilter('json_encode', 'twig_jsonencode_filter'),
179
- new TwigFilter('convert_encoding', 'twig_convert_encoding'),
180
-
181
- // string filters
182
- new TwigFilter('title', 'twig_title_string_filter', ['needs_environment' => true]),
183
- new TwigFilter('capitalize', 'twig_capitalize_string_filter', ['needs_environment' => true]),
184
- new TwigFilter('upper', 'strtoupper'),
185
- new TwigFilter('lower', 'strtolower'),
186
- new TwigFilter('striptags', 'strip_tags'),
187
- new TwigFilter('trim', 'twig_trim_filter'),
188
- new TwigFilter('nl2br', 'nl2br', ['pre_escape' => 'html', 'is_safe' => ['html']]),
189
- new TwigFilter('spaceless', 'twig_spaceless', ['is_safe' => ['html']]),
190
-
191
- // array helpers
192
- new TwigFilter('join', 'twig_join_filter'),
193
- new TwigFilter('split', 'twig_split_filter', ['needs_environment' => true]),
194
- new TwigFilter('sort', 'twig_sort_filter'),
195
- new TwigFilter('merge', 'twig_array_merge'),
196
- new TwigFilter('batch', 'twig_array_batch'),
197
- new TwigFilter('filter', 'twig_array_filter'),
198
- new TwigFilter('map', 'twig_array_map'),
199
- new TwigFilter('reduce', 'twig_array_reduce'),
200
-
201
- // string/array filters
202
- new TwigFilter('reverse', 'twig_reverse_filter', ['needs_environment' => true]),
203
- new TwigFilter('length', 'twig_length_filter', ['needs_environment' => true]),
204
- new TwigFilter('slice', 'twig_slice', ['needs_environment' => true]),
205
- new TwigFilter('first', 'twig_first', ['needs_environment' => true]),
206
- new TwigFilter('last', 'twig_last', ['needs_environment' => true]),
207
-
208
- // iteration and runtime
209
- new TwigFilter('default', '_twig_default_filter', ['node_class' => '\Twig\Node\Expression\Filter\DefaultFilter']),
210
- new TwigFilter('keys', 'twig_get_array_keys_filter'),
211
-
212
- // escaping
213
- new TwigFilter('escape', 'twig_escape_filter', ['needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe']),
214
- new TwigFilter('e', 'twig_escape_filter', ['needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe']),
215
- ];
216
-
217
- if (\function_exists('mb_get_info')) {
218
- $filters[] = new TwigFilter('upper', 'twig_upper_filter', ['needs_environment' => true]);
219
- $filters[] = new TwigFilter('lower', 'twig_lower_filter', ['needs_environment' => true]);
220
- }
221
-
222
- return $filters;
223
- }
224
-
225
- public function getFunctions()
226
- {
227
- return [
228
- new TwigFunction('max', 'max'),
229
- new TwigFunction('min', 'min'),
230
- new TwigFunction('range', 'range'),
231
- new TwigFunction('constant', 'twig_constant'),
232
- new TwigFunction('cycle', 'twig_cycle'),
233
- new TwigFunction('random', 'twig_random', ['needs_environment' => true]),
234
- new TwigFunction('date', 'twig_date_converter', ['needs_environment' => true]),
235
- new TwigFunction('include', 'twig_include', ['needs_environment' => true, 'needs_context' => true, 'is_safe' => ['all']]),
236
- new TwigFunction('source', 'twig_source', ['needs_environment' => true, 'is_safe' => ['all']]),
237
- ];
238
- }
239
-
240
- public function getTests()
241
- {
242
- return [
243
- new TwigTest('even', null, ['node_class' => '\Twig\Node\Expression\Test\EvenTest']),
244
- new TwigTest('odd', null, ['node_class' => '\Twig\Node\Expression\Test\OddTest']),
245
- new TwigTest('defined', null, ['node_class' => '\Twig\Node\Expression\Test\DefinedTest']),
246
- new TwigTest('sameas', null, ['node_class' => '\Twig\Node\Expression\Test\SameasTest', 'deprecated' => '1.21', 'alternative' => 'same as']),
247
- new TwigTest('same as', null, ['node_class' => '\Twig\Node\Expression\Test\SameasTest']),
248
- new TwigTest('none', null, ['node_class' => '\Twig\Node\Expression\Test\NullTest']),
249
- new TwigTest('null', null, ['node_class' => '\Twig\Node\Expression\Test\NullTest']),
250
- new TwigTest('divisibleby', null, ['node_class' => '\Twig\Node\Expression\Test\DivisiblebyTest', 'deprecated' => '1.21', 'alternative' => 'divisible by']),
251
- new TwigTest('divisible by', null, ['node_class' => '\Twig\Node\Expression\Test\DivisiblebyTest']),
252
- new TwigTest('constant', null, ['node_class' => '\Twig\Node\Expression\Test\ConstantTest']),
253
- new TwigTest('empty', 'twig_test_empty'),
254
- new TwigTest('iterable', 'twig_test_iterable'),
255
- ];
256
- }
257
-
258
- public function getOperators()
259
- {
260
- return [
261
- [
262
- 'not' => ['precedence' => 50, 'class' => '\Twig\Node\Expression\Unary\NotUnary'],
263
- '-' => ['precedence' => 500, 'class' => '\Twig\Node\Expression\Unary\NegUnary'],
264
- '+' => ['precedence' => 500, 'class' => '\Twig\Node\Expression\Unary\PosUnary'],
265
- ],
266
- [
267
- 'or' => ['precedence' => 10, 'class' => '\Twig\Node\Expression\Binary\OrBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
268
- 'and' => ['precedence' => 15, 'class' => '\Twig\Node\Expression\Binary\AndBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
269
- 'b-or' => ['precedence' => 16, 'class' => '\Twig\Node\Expression\Binary\BitwiseOrBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
270
- 'b-xor' => ['precedence' => 17, 'class' => '\Twig\Node\Expression\Binary\BitwiseXorBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
271
- 'b-and' => ['precedence' => 18, 'class' => '\Twig\Node\Expression\Binary\BitwiseAndBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
272
- '==' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\EqualBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
273
- '!=' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\NotEqualBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
274
- '<' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\LessBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
275
- '>' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\GreaterBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
276
- '>=' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\GreaterEqualBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
277
- '<=' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\LessEqualBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
278
- 'not in' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\NotInBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
279
- 'in' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\InBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
280
- 'matches' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\MatchesBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
281
- 'starts with' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\StartsWithBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
282
- 'ends with' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\EndsWithBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
283
- '..' => ['precedence' => 25, 'class' => '\Twig\Node\Expression\Binary\RangeBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
284
- '+' => ['precedence' => 30, 'class' => '\Twig\Node\Expression\Binary\AddBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
285
- '-' => ['precedence' => 30, 'class' => '\Twig\Node\Expression\Binary\SubBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
286
- '~' => ['precedence' => 40, 'class' => '\Twig\Node\Expression\Binary\ConcatBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
287
- '*' => ['precedence' => 60, 'class' => '\Twig\Node\Expression\Binary\MulBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
288
- '/' => ['precedence' => 60, 'class' => '\Twig\Node\Expression\Binary\DivBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
289
- '//' => ['precedence' => 60, 'class' => '\Twig\Node\Expression\Binary\FloorDivBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
290
- '%' => ['precedence' => 60, 'class' => '\Twig\Node\Expression\Binary\ModBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT],
291
- 'is' => ['precedence' => 100, 'associativity' => ExpressionParser::OPERATOR_LEFT],
292
- 'is not' => ['precedence' => 100, 'associativity' => ExpressionParser::OPERATOR_LEFT],
293
- '**' => ['precedence' => 200, 'class' => '\Twig\Node\Expression\Binary\PowerBinary', 'associativity' => ExpressionParser::OPERATOR_RIGHT],
294
- '??' => ['precedence' => 300, 'class' => '\Twig\Node\Expression\NullCoalesceExpression', 'associativity' => ExpressionParser::OPERATOR_RIGHT],
295
- ],
296
- ];
297
- }
298
-
299
- public function getName()
300
- {
301
- return 'core';
302
- }
303
- }
304
-
305
- class_alias('Twig\Extension\CoreExtension', 'Twig_Extension_Core');
306
- }
307
-
308
- namespace {
309
- use Twig\Environment;
310
- use Twig\Error\LoaderError;
311
- use Twig\Error\RuntimeError;
312
- use Twig\Loader\SourceContextLoaderInterface;
313
- use Twig\Markup;
314
- use Twig\Node\Expression\ConstantExpression;
315
- use Twig\Node\Node;
316
-
317
- /**
318
- * Cycles over a value.
319
- *
320
- * @param \ArrayAccess|array $values
321
- * @param int $position The cycle position
322
- *
323
- * @return string The next value in the cycle
324
- */
325
- function twig_cycle($values, $position)
326
- {
327
- if (!\is_array($values) && !$values instanceof \ArrayAccess) {
328
- return $values;
329
- }
330
-
331
- return $values[$position % \count($values)];
332
- }
333
-
334
- /**
335
- * Returns a random value depending on the supplied parameter type:
336
- * - a random item from a \Traversable or array
337
- * - a random character from a string
338
- * - a random integer between 0 and the integer parameter.
339
- *
340
- * @param \Traversable|array|int|float|string $values The values to pick a random item from
341
- * @param int|null $max Maximum value used when $values is an int
342
- *
343
- * @throws RuntimeError when $values is an empty array (does not apply to an empty string which is returned as is)
344
- *
345
- * @return mixed A random value from the given sequence
346
- */
347
- function twig_random(Environment $env, $values = null, $max = null)
348
- {
349
- if (null === $values) {
350
- return null === $max ? mt_rand() : mt_rand(0, $max);
351
- }
352
-
353
- if (\is_int($values) || \is_float($values)) {
354
- if (null === $max) {
355
- if ($values < 0) {
356
- $max = 0;
357
- $min = $values;
358
- } else {
359
- $max = $values;
360
- $min = 0;
361
- }
362
- } else {
363
- $min = $values;
364
- $max = $max;
365
- }
366
-
367
- return mt_rand($min, $max);
368
- }
369
-
370
- if (\is_string($values)) {
371
- if ('' === $values) {
372
- return '';
373
- }
374
- if (null !== $charset = $env->getCharset()) {
375
- if ('UTF-8' !== $charset) {
376
- $values = twig_convert_encoding($values, 'UTF-8', $charset);
377
- }
378
-
379
- // unicode version of str_split()
380
- // split at all positions, but not after the start and not before the end
381
- $values = preg_split('/(?<!^)(?!$)/u', $values);
382
-
383
- if ('UTF-8' !== $charset) {
384
- foreach ($values as $i => $value) {
385
- $values[$i] = twig_convert_encoding($value, $charset, 'UTF-8');
386
- }
387
- }
388
- } else {
389
- return $values[mt_rand(0, \strlen($values) - 1)];
390
- }
391
- }
392
-
393
- if (!twig_test_iterable($values)) {
394
- return $values;
395
- }
396
-
397
- $values = twig_to_array($values);
398
-
399
- if (0 === \count($values)) {
400
- throw new RuntimeError('The random function cannot pick from an empty array.');
401
- }
402
-
403
- return $values[array_rand($values, 1)];
404
- }
405
-
406
- /**
407
- * Converts a date to the given format.
408
- *
409
- * {{ post.published_at|date("m/d/Y") }}
410
- *
411
- * @param \DateTime|\DateTimeInterface|\DateInterval|string $date A date
412
- * @param string|null $format The target format, null to use the default
413
- * @param \DateTimeZone|string|false|null $timezone The target timezone, null to use the default, false to leave unchanged
414
- *
415
- * @return string The formatted date
416
- */
417
- function twig_date_format_filter(Environment $env, $date, $format = null, $timezone = null)
418
- {
419
- if (null === $format) {
420
- $formats = $env->getExtension('\Twig\Extension\CoreExtension')->getDateFormat();
421
- $format = $date instanceof \DateInterval ? $formats[1] : $formats[0];
422
- }
423
-
424
- if ($date instanceof \DateInterval) {
425
- return $date->format($format);
426
- }
427
-
428
- return twig_date_converter($env, $date, $timezone)->format($format);
429
- }
430
-
431
- /**
432
- * Returns a new date object modified.
433
- *
434
- * {{ post.published_at|date_modify("-1day")|date("m/d/Y") }}
435
- *
436
- * @param \DateTime|string $date A date
437
- * @param string $modifier A modifier string
438
- *
439
- * @return \DateTime
440
- */
441
- function twig_date_modify_filter(Environment $env, $date, $modifier)
442
- {
443
- $date = twig_date_converter($env, $date, false);
444
- $resultDate = $date->modify($modifier);
445
-
446
- // This is a hack to ensure PHP 5.2 support and support for \DateTimeImmutable
447
- // \DateTime::modify does not return the modified \DateTime object < 5.3.0
448
- // and \DateTimeImmutable does not modify $date.
449
- return null === $resultDate ? $date : $resultDate;
450
- }
451
-
452
- /**
453
- * Converts an input to a \DateTime instance.
454
- *
455
- * {% if date(user.created_at) < date('+2days') %}
456
- * {# do something #}
457
- * {% endif %}
458
- *
459
- * @param \DateTime|\DateTimeInterface|string|null $date A date
460
- * @param \DateTimeZone|string|false|null $timezone The target timezone, null to use the default, false to leave unchanged
461
- *
462
- * @return \DateTime
463
- */
464
- function twig_date_converter(Environment $env, $date = null, $timezone = null)
465
- {
466
- // determine the timezone
467
- if (false !== $timezone) {
468
- if (null === $timezone) {
469
- $timezone = $env->getExtension('\Twig\Extension\CoreExtension')->getTimezone();
470
- } elseif (!$timezone instanceof \DateTimeZone) {
471
- $timezone = new \DateTimeZone($timezone);
472
- }
473
- }
474
-
475
- // immutable dates
476
- if ($date instanceof \DateTimeImmutable) {
477
- return false !== $timezone ? $date->setTimezone($timezone) : $date;
478
- }
479
-
480
- if ($date instanceof \DateTime || $date instanceof \DateTimeInterface) {
481
- $date = clone $date;
482
- if (false !== $timezone) {
483
- $date->setTimezone($timezone);
484
- }
485
-
486
- return $date;
487
- }
488
-
489
- if (null === $date || 'now' === $date) {
490
- return new \DateTime($date, false !== $timezone ? $timezone : $env->getExtension('\Twig\Extension\CoreExtension')->getTimezone());
491
- }
492
-
493
- $asString = (string) $date;
494
- if (ctype_digit($asString) || (!empty($asString) && '-' === $asString[0] && ctype_digit(substr($asString, 1)))) {
495
- $date = new \DateTime('@'.$date);
496
- } else {
497
- $date = new \DateTime($date, $env->getExtension('\Twig\Extension\CoreExtension')->getTimezone());
498
- }
499
-
500
- if (false !== $timezone) {
501
- $date->setTimezone($timezone);
502
- }
503
-
504
- return $date;
505
- }
506
-
507
- /**
508
- * Replaces strings within a string.
509
- *
510
- * @param string $str String to replace in
511
- * @param array|\Traversable $from Replace values
512
- * @param string|null $to Replace to, deprecated (@see https://secure.php.net/manual/en/function.strtr.php)
513
- *
514
- * @return string
515
- */
516
- function twig_replace_filter($str, $from, $to = null)
517
- {
518
- if (\is_string($from) && \is_string($to)) {
519
- @trigger_error('Using "replace" with character by character replacement is deprecated since version 1.22 and will be removed in Twig 2.0', E_USER_DEPRECATED);
520
-
521
- return strtr($str, $from, $to);
522
- }
523
-
524
- if (!twig_test_iterable($from)) {
525
- throw new RuntimeError(sprintf('The "replace" filter expects an array or "Traversable" as replace values, got "%s".', \is_object($from) ? \get_class($from) : \gettype($from)));
526
- }
527
-
528
- return strtr($str, twig_to_array($from));
529
- }
530
-
531
- /**
532
- * Rounds a number.
533
- *
534
- * @param int|float $value The value to round
535
- * @param int|float $precision The rounding precision
536
- * @param string $method The method to use for rounding
537
- *
538
- * @return int|float The rounded number
539
- */
540
- function twig_round($value, $precision = 0, $method = 'common')
541
- {
542
- if ('common' == $method) {
543
- return round($value, $precision);
544
- }
545
-
546
- if ('ceil' != $method && 'floor' != $method) {
547
- throw new RuntimeError('The round filter only supports the "common", "ceil", and "floor" methods.');
548
- }
549
-
550
- return $method($value * pow(10, $precision)) / pow(10, $precision);
551
- }
552
-
553
- /**
554
- * Number format filter.
555
- *
556
- * All of the formatting options can be left null, in that case the defaults will
557
- * be used. Supplying any of the parameters will override the defaults set in the
558
- * environment object.
559
- *
560
- * @param mixed $number A float/int/string of the number to format
561
- * @param int $decimal the number of decimal points to display
562
- * @param string $decimalPoint the character(s) to use for the decimal point
563
- * @param string $thousandSep the character(s) to use for the thousands separator
564
- *
565
- * @return string The formatted number
566
- */
567
- function twig_number_format_filter(Environment $env, $number, $decimal = null, $decimalPoint = null, $thousandSep = null)
568
- {
569
- $defaults = $env->getExtension('\Twig\Extension\CoreExtension')->getNumberFormat();
570
- if (null === $decimal) {
571
- $decimal = $defaults[0];
572
- }
573
-
574
- if (null === $decimalPoint) {
575
- $decimalPoint = $defaults[1];
576
- }
577
-
578
- if (null === $thousandSep) {
579
- $thousandSep = $defaults[2];
580
- }
581
-
582
- return number_format((float) $number, $decimal, $decimalPoint, $thousandSep);
583
- }
584
-
585
- /**
586
- * URL encodes (RFC 3986) a string as a path segment or an array as a query string.
587
- *
588
- * @param string|array $url A URL or an array of query parameters
589
- *
590
- * @return string The URL encoded value
591
- */
592
- function twig_urlencode_filter($url)
593
- {
594
- if (\is_array($url)) {
595
- if (\defined('PHP_QUERY_RFC3986')) {
596
- return http_build_query($url, '', '&', PHP_QUERY_RFC3986);
597
- }
598
-
599
- return http_build_query($url, '', '&');
600
- }
601
-
602
- return rawurlencode($url);
603
- }
604
-
605
- /**
606
- * JSON encodes a variable.
607
- *
608
- * @param mixed $value the value to encode
609
- * @param int $options Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT
610
- *
611
- * @return mixed The JSON encoded value
612
- */
613
- function twig_jsonencode_filter($value, $options = 0)
614
- {
615
- if ($value instanceof Markup) {
616
- $value = (string) $value;
617
- } elseif (\is_array($value)) {
618
- array_walk_recursive($value, '_twig_markup2string');
619
- }
620
-
621
- return json_encode($value, $options);
622
- }
623
-
624
- function _twig_markup2string(&$value)
625
- {
626
- if ($value instanceof Markup) {
627
- $value = (string) $value;
628
- }
629
- }
630
-
631
- /**
632
- * Merges an array with another one.
633
- *
634
- * {% set items = { 'apple': 'fruit', 'orange': 'fruit' } %}
635
- *
636
- * {% set items = items|merge({ 'peugeot': 'car' }) %}
637
- *
638
- * {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car' } #}
639
- *
640
- * @param array|\Traversable $arr1 An array
641
- * @param array|\Traversable $arr2 An array
642
- *
643
- * @return array The merged array
644
- */
645
- function twig_array_merge($arr1, $arr2)
646
- {
647
- if (!twig_test_iterable($arr1)) {
648
- throw new RuntimeError(sprintf('The merge filter only works with arrays or "Traversable", got "%s" as first argument.', \gettype($arr1)));
649
- }
650
-
651
- if (!twig_test_iterable($arr2)) {
652
- throw new RuntimeError(sprintf('The merge filter only works with arrays or "Traversable", got "%s" as second argument.', \gettype($arr2)));
653
- }
654
-
655
- return array_merge(twig_to_array($arr1), twig_to_array($arr2));
656
- }
657
-
658
- /**
659
- * Slices a variable.
660
- *
661
- * @param mixed $item A variable
662
- * @param int $start Start of the slice
663
- * @param int $length Size of the slice
664
- * @param bool $preserveKeys Whether to preserve key or not (when the input is an array)
665
- *
666
- * @return mixed The sliced variable
667
- */
668
- function twig_slice(Environment $env, $item, $start, $length = null, $preserveKeys = false)
669
- {
670
- if ($item instanceof \Traversable) {
671
- while ($item instanceof \IteratorAggregate) {
672
- $item = $item->getIterator();
673
- }
674
-
675
- if ($start >= 0 && $length >= 0 && $item instanceof \Iterator) {
676
- try {
677
- return iterator_to_array(new \LimitIterator($item, $start, null === $length ? -1 : $length), $preserveKeys);
678
- } catch (\OutOfBoundsException $e) {
679
- return [];
680
- }
681
- }
682
-
683
- $item = iterator_to_array($item, $preserveKeys);
684
- }
685
-
686
- if (\is_array($item)) {
687
- return \array_slice($item, $start, $length, $preserveKeys);
688
- }
689
-
690
- $item = (string) $item;
691
-
692
- if (\function_exists('mb_get_info') && null !== $charset = $env->getCharset()) {
693
- return (string) mb_substr($item, $start, null === $length ? mb_strlen($item, $charset) - $start : $length, $charset);
694
- }
695
-
696
- return (string) (null === $length ? substr($item,