Timber - Version 1.8.0

Version Description

Download this release

Release Info

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

Code changes from version 1.7.1 to 1.8.0

Files changed (127) hide show
  1. lib/Image.php +1 -1
  2. lib/Image/Operation/Letterbox.php +6 -0
  3. lib/Image/Operation/Resize.php +4 -0
  4. lib/Image/Operation/Retina.php +5 -0
  5. lib/Image/Operation/ToJpg.php +8 -0
  6. lib/Image/Operation/ToWebp.php +69 -0
  7. lib/ImageHelper.php +29 -0
  8. lib/Pagination.php +1 -1
  9. lib/Post.php +2 -2
  10. lib/PostPreview.php +2 -2
  11. lib/Term.php +1 -1
  12. lib/Theme.php +3 -1
  13. lib/Timber.php +1 -1
  14. lib/Twig.php +12 -33
  15. lib/URLHelper.php +2 -3
  16. readme.txt +11 -2
  17. timber-starter-theme/.gitignore +1 -1
  18. timber-starter-theme/archive.php +3 -3
  19. timber-starter-theme/composer.json +1 -1
  20. timber-starter-theme/composer.lock +0 -139
  21. timber-starter-theme/footer.php +6 -2
  22. timber-starter-theme/functions.php +51 -17
  23. timber-starter-theme/header.php +5 -1
  24. timber-starter-theme/index.php +1 -0
  25. timber-starter-theme/page.php +1 -1
  26. timber-starter-theme/sidebar.php +0 -1
  27. timber-starter-theme/templates/html-header.twig +0 -7
  28. timber-starter-theme/templates/single-password.twig +1 -1
  29. timber.php +1 -1
  30. vendor/autoload.php +1 -1
  31. vendor/composer/autoload_classmap.php +2 -1
  32. vendor/composer/autoload_real.php +3 -3
  33. vendor/composer/installed.json +119 -119
  34. vendor/composer/installers/.editorconfig +0 -10
  35. vendor/composer/installers/.gitignore +0 -3
  36. vendor/composer/installers/.travis.yml +0 -33
  37. vendor/composer/installers/CHANGELOG.md +0 -86
  38. vendor/composer/installers/CONTRIBUTING.md +0 -24
  39. vendor/composer/installers/README.md +0 -221
  40. vendor/composer/installers/_config.yml +0 -1
  41. vendor/composer/installers/phpunit.xml.dist +0 -25
  42. vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php +9 -0
  43. vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php +1 -1
  44. vendor/composer/installers/src/Composer/Installers/Installer.php +75 -1
  45. vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php +1 -0
  46. vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php +1 -0
  47. vendor/composer/installers/tests/Composer/Installers/Test/AsgardInstallerTest.php +0 -80
  48. vendor/composer/installers/tests/Composer/Installers/Test/BitrixInstallerTest.php +0 -75
  49. vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php +0 -114
  50. vendor/composer/installers/tests/Composer/Installers/Test/CraftInstallerTest.php +0 -83
  51. vendor/composer/installers/tests/Composer/Installers/Test/DokuWikiInstallerTest.php +0 -90
  52. vendor/composer/installers/tests/Composer/Installers/Test/GravInstallerTest.php +0 -63
  53. vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php +0 -552
  54. vendor/composer/installers/tests/Composer/Installers/Test/MayaInstallerTest.php +0 -62
  55. vendor/composer/installers/tests/Composer/Installers/Test/MediaWikiInstallerTest.php +0 -67
  56. vendor/composer/installers/tests/Composer/Installers/Test/OctoberInstallerTest.php +0 -67
  57. vendor/composer/installers/tests/Composer/Installers/Test/OntoWikiInstallerTest.php +0 -84
  58. vendor/composer/installers/tests/Composer/Installers/Test/PimcoreInstallerTest.php +0 -44
  59. vendor/composer/installers/tests/Composer/Installers/Test/PiwikInstallerTest.php +0 -63
  60. vendor/composer/installers/tests/Composer/Installers/Test/SiteDirectInstallerTest.php +0 -120
  61. vendor/composer/installers/tests/Composer/Installers/Test/SyDESInstallerTest.php +0 -82
  62. vendor/composer/installers/tests/Composer/Installers/Test/TestCase.php +0 -65
  63. vendor/composer/installers/tests/Composer/Installers/Test/VgmcpInstallerTest.php +0 -80
  64. vendor/composer/installers/tests/Composer/Installers/Test/YawikInstallerTest.php +0 -64
  65. vendor/composer/installers/tests/bootstrap.php +0 -4
  66. vendor/twig/twig/.travis.yml +7 -13
  67. vendor/twig/twig/CHANGELOG +2 -21
  68. vendor/twig/twig/LICENSE +1 -1
  69. vendor/twig/twig/composer.json +1 -1
  70. vendor/twig/twig/doc/advanced.rst +2 -2
  71. vendor/twig/twig/doc/filters/length.rst +0 -2
  72. vendor/twig/twig/doc/filters/replace.rst +0 -6
  73. vendor/twig/twig/doc/functions/block.rst +1 -1
  74. vendor/twig/twig/doc/templates.rst +1 -2
  75. vendor/twig/twig/ext/twig/php_twig.h +1 -1
  76. vendor/twig/twig/ext/twig/twig.c +3 -5
  77. vendor/twig/twig/lib/Twig/Compiler.php +1 -3
  78. vendor/twig/twig/lib/Twig/Environment.php +11 -35
  79. vendor/twig/twig/lib/Twig/ExpressionParser.php +5 -8
  80. vendor/twig/twig/lib/Twig/Extension/Core.php +4 -12
  81. vendor/twig/twig/lib/Twig/Lexer.php +2 -2
  82. vendor/twig/twig/lib/Twig/Loader/Filesystem.php +1 -1
  83. vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php +2 -2
  84. vendor/twig/twig/lib/Twig/Parser.php +3 -5
  85. vendor/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php +1 -1
  86. vendor/twig/twig/lib/Twig/Profiler/Profile.php +0 -6
  87. vendor/twig/twig/lib/Twig/Template.php +1 -3
  88. vendor/twig/twig/lib/Twig/TokenParser/For.php +1 -1
  89. vendor/twig/twig/lib/Twig/TokenParser/Use.php +0 -2
  90. vendor/twig/twig/lib/Twig/TokenParserBroker.php +2 -2
  91. vendor/twig/twig/lib/Twig/TokenStream.php +1 -1
  92. vendor/twig/twig/phpunit.xml.dist +1 -1
  93. vendor/twig/twig/src/Extension/RuntimeExtensionInterface.php +0 -19
  94. vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php +1 -1
  95. vendor/twig/twig/test/Twig/Tests/Cache/FilesystemTest.php +1 -1
  96. vendor/twig/twig/test/Twig/Tests/CompilerTest.php +1 -1
  97. vendor/twig/twig/test/Twig/Tests/ContainerRuntimeLoaderTest.php +1 -1
  98. vendor/twig/twig/test/Twig/Tests/CustomExtensionTest.php +1 -1
  99. vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php +1 -28
  100. vendor/twig/twig/test/Twig/Tests/ErrorTest.php +1 -1
  101. vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php +1 -1
  102. vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php +3 -3
  103. vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php +2 -2
  104. vendor/twig/twig/test/Twig/Tests/FactoryRuntimeLoaderTest.php +1 -1
  105. vendor/twig/twig/test/Twig/Tests/FileCachingTest.php +1 -1
  106. vendor/twig/twig/test/Twig/Tests/FileExtensionEscapingStrategyTest.php +1 -1
  107. vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/child_contents_outside_blocks.test +2 -2
  108. vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/strict_comparison_operator.test +0 -6
  109. vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test +0 -3
  110. vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/use_with_parent.test +0 -24
  111. vendor/twig/twig/test/Twig/Tests/IntegrationTest.php +0 -18
  112. vendor/twig/twig/test/Twig/Tests/LexerTest.php +1 -1
  113. vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php +1 -1
  114. vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php +1 -1
  115. vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php +1 -1
  116. vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php +1 -1
  117. vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php +1 -1
  118. vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php +1 -1
  119. vendor/twig/twig/test/Twig/Tests/ParserTest.php +1 -1
  120. vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php +1 -1
  121. vendor/twig/twig/test/Twig/Tests/Profiler/ProfileTest.php +1 -11
  122. vendor/twig/twig/test/Twig/Tests/TemplateTest.php +1 -2
  123. vendor/twig/twig/test/Twig/Tests/TemplateWrapperTest.php +1 -1
  124. vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php +1 -1
  125. vendor/twig/twig/test/Twig/Tests/Util/DeprecationCollectorTest.php +1 -1
  126. vendor/twig/twig/test/Twig/Tests/escapingTest.php +1 -1
  127. vendor/twig/twig/test/bootstrap.php +21 -0
lib/Image.php CHANGED
@@ -231,7 +231,7 @@ class Image extends Post implements CoreInterface {
231
  }
232
 
233
  if ( !is_numeric($iid) && is_string($iid) ) {
234
- if ( strstr($iid, '://') ) {
235
  $this->init_with_url($iid);
236
  return;
237
  }
231
  }
232
 
233
  if ( !is_numeric($iid) && is_string($iid) ) {
234
+ if ( strpos($iid, '//') === 0 || strstr($iid, '://') ) {
235
  $this->init_with_url($iid);
236
  return;
237
  }
lib/Image/Operation/Letterbox.php CHANGED
@@ -3,6 +3,7 @@
3
  namespace Timber\Image\Operation;
4
 
5
  use Timber\Helper;
 
6
  use Timber\Image\Operation as ImageOperation;
7
 
8
  /*
@@ -57,6 +58,11 @@ class Letterbox extends ImageOperation {
57
  * @return bool true if everything went fine, false otherwise
58
  */
59
  public function run( $load_filename, $save_filename ) {
 
 
 
 
 
60
  $w = $this->w;
61
  $h = $this->h;
62
 
3
  namespace Timber\Image\Operation;
4
 
5
  use Timber\Helper;
6
+ use Timber\ImageHelper;
7
  use Timber\Image\Operation as ImageOperation;
8
 
9
  /*
58
  * @return bool true if everything went fine, false otherwise
59
  */
60
  public function run( $load_filename, $save_filename ) {
61
+ // Attempt to check if SVG.
62
+ if ( ImageHelper::is_svg($load_filename) ) {
63
+ return false;
64
+ }
65
+
66
  $w = $this->w;
67
  $h = $this->h;
68
 
lib/Image/Operation/Resize.php CHANGED
@@ -172,6 +172,10 @@ class Resize extends ImageOperation {
172
  * @return boolean|null true if everything went fine, false otherwise
173
  */
174
  public function run( $load_filename, $save_filename ) {
 
 
 
 
175
  $image = wp_get_image_editor($load_filename);
176
  if ( !is_wp_error($image) ) {
177
  //should be resized by gif resizer
172
  * @return boolean|null true if everything went fine, false otherwise
173
  */
174
  public function run( $load_filename, $save_filename ) {
175
+ // Attempt to check if SVG.
176
+ if ( ImageHelper::is_svg($load_filename) ) {
177
+ return false;
178
+ }
179
  $image = wp_get_image_editor($load_filename);
180
  if ( !is_wp_error($image) ) {
181
  //should be resized by gif resizer
lib/Image/Operation/Retina.php CHANGED
@@ -3,6 +3,7 @@
3
  namespace Timber\Image\Operation;
4
 
5
  use Timber\Helper;
 
6
  use Timber\Image\Operation as ImageOperation;
7
 
8
  /**
@@ -51,6 +52,10 @@ class Retina extends ImageOperation {
51
  * @return bool true if everything went fine, false otherwise
52
  */
53
  public function run( $load_filename, $save_filename ) {
 
 
 
 
54
  $image = wp_get_image_editor($load_filename);
55
  if ( !is_wp_error($image) ) {
56
  $current_size = $image->get_size();
3
  namespace Timber\Image\Operation;
4
 
5
  use Timber\Helper;
6
+ use Timber\ImageHelper;
7
  use Timber\Image\Operation as ImageOperation;
8
 
9
  /**
52
  * @return bool true if everything went fine, false otherwise
53
  */
54
  public function run( $load_filename, $save_filename ) {
55
+ // Attempt to check if SVG.
56
+ if ( ImageHelper::is_svg($load_filename) ) {
57
+ return false;
58
+ }
59
  $image = wp_get_image_editor($load_filename);
60
  if ( !is_wp_error($image) ) {
61
  $current_size = $image->get_size();
lib/Image/Operation/ToJpg.php CHANGED
@@ -2,6 +2,8 @@
2
 
3
  namespace Timber\Image\Operation;
4
 
 
 
5
  use Timber\Image\Operation as ImageOperation;
6
 
7
  /**
@@ -44,6 +46,11 @@ class ToJpg extends ImageOperation {
44
  if ( !file_exists($load_filename) ) {
45
  return false;
46
  }
 
 
 
 
 
47
 
48
  $ext = wp_check_filetype($load_filename);
49
  if ( isset($ext['ext']) ) {
@@ -68,4 +75,5 @@ class ToJpg extends ImageOperation {
68
  imagejpeg($output, $save_filename);
69
  return true;
70
  }
 
71
  }
2
 
3
  namespace Timber\Image\Operation;
4
 
5
+ use Timber\Helper;
6
+ use Timber\ImageHelper;
7
  use Timber\Image\Operation as ImageOperation;
8
 
9
  /**
46
  if ( !file_exists($load_filename) ) {
47
  return false;
48
  }
49
+
50
+ // Attempt to check if SVG.
51
+ if ( ImageHelper::is_svg($load_filename) ) {
52
+ return false;
53
+ }
54
 
55
  $ext = wp_check_filetype($load_filename);
56
  if ( isset($ext['ext']) ) {
75
  imagejpeg($output, $save_filename);
76
  return true;
77
  }
78
+
79
  }
lib/Image/Operation/ToWebp.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Timber\Image\Operation;
4
+
5
+ use Timber\Image\Operation as ImageOperation;
6
+
7
+ /**
8
+ * @codeCoverageIgnore
9
+ */
10
+ class ToWebp extends ImageOperation {
11
+
12
+ private $quality;
13
+
14
+ /**
15
+ * @param string $quality ranges from 0 (worst quality, smaller file) to 100 (best quality, biggest file)
16
+ */
17
+ public function __construct( $quality ) {
18
+ $this->quality = $quality;
19
+ }
20
+
21
+ /**
22
+ * @param string $src_filename the basename of the file (ex: my-awesome-pic)
23
+ * @param string $src_extension ignored
24
+ * @return string the final filename to be used (ex: my-awesome-pic.jpg)
25
+ */
26
+ public function filename( $src_filename, $src_extension = 'webp' ) {
27
+ $new_name = $src_filename . '.webp';
28
+ return $new_name;
29
+ }
30
+
31
+ /**
32
+ * Performs the actual image manipulation,
33
+ * including saving the target file.
34
+ *
35
+ * @param string $load_filename filepath (not URL) to source file (ex: /src/var/www/wp-content/uploads/my-pic.jpg)
36
+ * @param string $save_filename filepath (not URL) where result file should be saved
37
+ * (ex: /src/var/www/wp-content/uploads/my-pic.webp)
38
+ * @return bool true if everything went fine, false otherwise
39
+ */
40
+ public function run( $load_filename, $save_filename ) {
41
+ if (!is_file($load_filename)) {
42
+ return false;
43
+ }
44
+
45
+ $ext = wp_check_filetype($load_filename);
46
+ if ( isset($ext['ext']) ) {
47
+ $ext = $ext['ext'];
48
+ }
49
+ $ext = strtolower($ext);
50
+ $ext = str_replace('jpg', 'jpeg', $ext);
51
+
52
+ $imagecreate_function = 'imagecreatefrom' . $ext;
53
+ if ( !function_exists($imagecreate_function) ) {
54
+ return false;
55
+ }
56
+
57
+ $input = $imagecreate_function($load_filename);
58
+
59
+ if ( !imageistruecolor($input) ) {
60
+ imagepalettetotruecolor($input);
61
+ }
62
+
63
+ if (!function_exists('imagewebp')) {
64
+ return false;
65
+ }
66
+
67
+ return imagewebp($input, $save_filename, $this->quality);
68
+ }
69
+ }
lib/ImageHelper.php CHANGED
@@ -4,6 +4,7 @@ namespace Timber;
4
 
5
  use Timber\Image;
6
  use Timber\Image\Operation\ToJpg;
 
7
  use Timber\Image\Operation\Resize;
8
  use Timber\Image\Operation\Retina;
9
  use Timber\Image\Operation\Letterbox;
@@ -140,6 +141,21 @@ class ImageHelper {
140
  fclose($fh);
141
  return $count > 1;
142
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
 
144
  /**
145
  * Generate a new image with the specified dimensions.
@@ -169,6 +185,19 @@ class ImageHelper {
169
  return self::_operate($src, $op, $force);
170
  }
171
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  //-- end of public methods --//
173
 
174
  /**
4
 
5
  use Timber\Image;
6
  use Timber\Image\Operation\ToJpg;
7
+ use Timber\Image\Operation\ToWebp;
8
  use Timber\Image\Operation\Resize;
9
  use Timber\Image\Operation\Retina;
10
  use Timber\Image\Operation\Letterbox;
141
  fclose($fh);
142
  return $count > 1;
143
  }
144
+
145
+ /**
146
+ *
147
+ * Checks if file is an SVG
148
+ * @param string $file_path file path.
149
+ * @return boolean true if svg, false if not svg or file doesn't exist.
150
+ */
151
+ public static function is_svg( $file_path ) {
152
+ $ret = false;
153
+ if ( isset($file_path) && '' !== $file_path && file_exists($file_path) ) {
154
+ $mime = mime_content_type($file_path);
155
+ $ret = in_array($mime, ['image/svg+xml', 'text/html', 'text/plain']);
156
+ }
157
+ return $ret;
158
+ }
159
 
160
  /**
161
  * Generate a new image with the specified dimensions.
185
  return self::_operate($src, $op, $force);
186
  }
187
 
188
+ /**
189
+ * Generates a new image by converting the source into WEBP
190
+ *
191
+ * @param string $src a url or path to the image (http://example.org/wp-content/uploads/2014/image.jpg)
192
+ * or (/wp-content/uploads/2014/image.jpg)
193
+ * @param int $quality ranges from 0 (worst quality, smaller file) to 100 (best quality, biggest file)
194
+ * @param bool $force
195
+ */
196
+ public static function img_to_webp( $src, $quality = 80, $force = false ) {
197
+ $op = new Image\Operation\ToWebp($quality);
198
+ return self::_operate($src, $op, $force);
199
+ }
200
+
201
  //-- end of public methods --//
202
 
203
  /**
lib/Pagination.php CHANGED
@@ -20,7 +20,7 @@ class Pagination {
20
  * @param array $prefs
21
  * @return array mixed
22
  */
23
- public static function get_pagination( $prefs ) {
24
  $pagination = new self($prefs);
25
  $pagination = get_object_vars($pagination);
26
  return $pagination;
20
  * @param array $prefs
21
  * @return array mixed
22
  */
23
+ public static function get_pagination( $prefs = array() ) {
24
  $pagination = new self($prefs);
25
  $pagination = get_object_vars($pagination);
26
  return $pagination;
lib/Post.php CHANGED
@@ -106,7 +106,7 @@ class Post extends Core implements CoreInterface {
106
 
107
  /**
108
  * @api
109
- * @var string $id the numeric WordPress id of a post
110
  */
111
  public $id;
112
 
@@ -1366,7 +1366,7 @@ class Post extends Core implements CoreInterface {
1366
  * ```twig
1367
  * <img src="{{ post.thumbnail.src }}" />
1368
  * ```
1369
- * @return Timber/Image|null of your thumbnail
1370
  */
1371
  public function thumbnail() {
1372
  $tid = get_post_thumbnail_id($this->ID);
106
 
107
  /**
108
  * @api
109
+ * @var int $id the numeric WordPress id of a post
110
  */
111
  public $id;
112
 
1366
  * ```twig
1367
  * <img src="{{ post.thumbnail.src }}" />
1368
  * ```
1369
+ * @return Timber\Image|null of your thumbnail
1370
  */
1371
  public function thumbnail() {
1372
  $tid = get_post_thumbnail_id($this->ID);
lib/PostPreview.php CHANGED
@@ -70,7 +70,7 @@ class PostPreview {
70
  }
71
 
72
  /**
73
- * @param boolean|string $strip strip the tags or what? You can also provide a list of allowed tags
74
  */
75
  public function strip( $strip = true ) {
76
  $this->strip = $strip;
@@ -164,4 +164,4 @@ class PostPreview {
164
  return trim($text);
165
  }
166
 
167
- }
70
  }
71
 
72
  /**
73
+ * @param boolean|string $strip strip the tags or what? You can also provide a list of allowed tags (e.g. '<p><a>')
74
  */
75
  public function strip( $strip = true ) {
76
  $this->strip = $strip;
164
  return trim($text);
165
  }
166
 
167
+ }
lib/Term.php CHANGED
@@ -260,7 +260,7 @@ class Term extends Core implements CoreInterface {
260
  $PostClass = $this->PostClass;
261
  }
262
  $default_tax_query = array(array(
263
- 'field' => 'id',
264
  'terms' => $this->ID,
265
  'taxonomy' => $this->taxonomy,
266
  ));
260
  $PostClass = $this->PostClass;
261
  }
262
  $default_tax_query = array(array(
263
+ 'field' => 'term_id',
264
  'terms' => $this->ID,
265
  'taxonomy' => $this->taxonomy,
266
  ));
lib/Theme.php CHANGED
@@ -114,7 +114,9 @@ class Theme extends Core {
114
  * @return string the relative path to the theme (ex: `/wp-content/themes/my-timber-theme`)
115
  */
116
  public function path() {
117
- return URLHelper::get_rel_url($this->link());
 
 
118
  }
119
 
120
  /**
114
  * @return string the relative path to the theme (ex: `/wp-content/themes/my-timber-theme`)
115
  */
116
  public function path() {
117
+ // force = true to work with specifying the port
118
+ // @see https://github.com/timber/timber/issues/1739
119
+ return URLHelper::get_rel_url($this->link(), true);
120
  }
121
 
122
  /**
lib/Timber.php CHANGED
@@ -35,7 +35,7 @@ use Timber\Loader;
35
  */
36
  class Timber {
37
 
38
- public static $version = '1.7.1';
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.8.0';
39
  public static $locations;
40
  public static $dirname = 'views';
41
  public static $twig_cache = false;
lib/Twig.php CHANGED
@@ -111,39 +111,17 @@ class Twig {
111
  } ));
112
 
113
  /* bloginfo and translate */
114
- $twig->addFunction(new Twig_Function('bloginfo', function( $show = '', $filter = 'raw' ) {
115
- return get_bloginfo($show, $filter);
116
- } ));
117
- $twig->addFunction(new Twig_Function('__', function( $text, $domain = 'default' ) {
118
- return __($text, $domain);
119
- } ));
120
- $twig->addFunction(new Twig_Function('translate', function( $text, $domain = 'default' ) {
121
- return translate($text, $domain);
122
- } ));
123
- $twig->addFunction(new Twig_Function('_e', function( $text, $domain = 'default' ) {
124
- return _e($text, $domain);
125
- } ));
126
- $twig->addFunction(new Twig_Function('_n', function( $single, $plural, $number, $domain = 'default' ) {
127
- return _n($single, $plural, $number, $domain);
128
- } ));
129
- $twig->addFunction(new Twig_Function('_x', function( $text, $context, $domain = 'default' ) {
130
- return _x($text, $context, $domain);
131
- } ));
132
- $twig->addFunction(new Twig_Function('_ex', function( $text, $context, $domain = 'default' ) {
133
- return _ex($text, $context, $domain);
134
- } ));
135
- $twig->addFunction(new Twig_Function('_nx', function( $single, $plural, $number, $context, $domain = 'default' ) {
136
- return _nx($single, $plural, $number, $context, $domain);
137
- } ));
138
- $twig->addFunction(new Twig_Function('_n_noop', function( $singular, $plural, $domain = 'default' ) {
139
- return _n_noop($singular, $plural, $domain);
140
- } ));
141
- $twig->addFunction(new Twig_Function('_nx_noop', function( $singular, $plural, $context, $domain = 'default' ) {
142
- return _nx_noop($singular, $plural, $context, $domain);
143
- } ));
144
- $twig->addFunction(new Twig_Function('translate_nooped_plural', function( $nooped_plural, $count, $domain = 'default' ) {
145
- return translate_nooped_plural($nooped_plural, $count, $domain);
146
- } ));
147
 
148
  return $twig;
149
  }
@@ -204,6 +182,7 @@ class Twig {
204
  $twig->addFilter(new \Twig_SimpleFilter('retina', array('Timber\ImageHelper', 'retina_resize')));
205
  $twig->addFilter(new \Twig_SimpleFilter('letterbox', array('Timber\ImageHelper', 'letterbox')));
206
  $twig->addFilter(new \Twig_SimpleFilter('tojpg', array('Timber\ImageHelper', 'img_to_jpg')));
 
207
 
208
  /* debugging filters */
209
  $twig->addFilter(new \Twig_SimpleFilter('get_class', 'get_class'));
111
  } ));
112
 
113
  /* bloginfo and translate */
114
+ $twig->addFunction(new Twig_Function('bloginfo', 'bloginfo'));
115
+ $twig->addFunction(new Twig_Function('__', '__'));
116
+ $twig->addFunction(new Twig_Function('translate', 'translate'));
117
+ $twig->addFunction(new Twig_Function('_e', '_e'));
118
+ $twig->addFunction(new Twig_Function('_n', '_n'));
119
+ $twig->addFunction(new Twig_Function('_x', '_x'));
120
+ $twig->addFunction(new Twig_Function('_ex', '_ex'));
121
+ $twig->addFunction(new Twig_Function('_nx', '_nx'));
122
+ $twig->addFunction(new Twig_Function('_n_noop', '_n_noop'));
123
+ $twig->addFunction(new Twig_Function('_nx_noop', '_nx_noop'));
124
+ $twig->addFunction(new Twig_Function('translate_nooped_plural', 'translate_nooped_plural'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
 
126
  return $twig;
127
  }
182
  $twig->addFilter(new \Twig_SimpleFilter('retina', array('Timber\ImageHelper', 'retina_resize')));
183
  $twig->addFilter(new \Twig_SimpleFilter('letterbox', array('Timber\ImageHelper', 'letterbox')));
184
  $twig->addFilter(new \Twig_SimpleFilter('tojpg', array('Timber\ImageHelper', 'img_to_jpg')));
185
+ $twig->addFilter(new \Twig_SimpleFilter('towebp', array('Timber\ImageHelper', 'img_to_webp')));
186
 
187
  /* debugging filters */
188
  $twig->addFilter(new \Twig_SimpleFilter('get_class', 'get_class'));
lib/URLHelper.php CHANGED
@@ -11,7 +11,7 @@ class URLHelper {
11
  */
12
  public static function get_current_url() {
13
  $pageURL = self::get_scheme()."://";
14
- if ( isset($_SERVER["SERVER_PORT"]) && $_SERVER["SERVER_PORT"] && $_SERVER["SERVER_PORT"] != "80" ) {
15
  $pageURL .= self::get_host().":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
16
  } else {
17
  $pageURL .= self::get_host().$_SERVER["REQUEST_URI"];
@@ -181,8 +181,7 @@ class URLHelper {
181
  public static function get_content_subdir() {
182
  $home_url = get_home_url();
183
  $home_url = apply_filters('timber/URLHelper/get_content_subdir/home_url', $home_url);
184
- $wp_content_path = str_replace($home_url, '', WP_CONTENT_URL);
185
- return $wp_content_path;
186
  }
187
 
188
  /**
11
  */
12
  public static function get_current_url() {
13
  $pageURL = self::get_scheme()."://";
14
+ if ( isset($_SERVER["SERVER_PORT"]) && $_SERVER["SERVER_PORT"] && $_SERVER["SERVER_PORT"] != "80" && $_SERVER["SERVER_PORT"] != "443") {
15
  $pageURL .= self::get_host().":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
16
  } else {
17
  $pageURL .= self::get_host().$_SERVER["REQUEST_URI"];
181
  public static function get_content_subdir() {
182
  $home_url = get_home_url();
183
  $home_url = apply_filters('timber/URLHelper/get_content_subdir/home_url', $home_url);
184
+ return str_replace($home_url, '', WP_CONTENT_URL);
 
185
  }
186
 
187
  /**
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: jarednova, connorjburton, lggorman
3
  Tags: template engine, templates, twig
4
  Requires at least: 4.7.9
5
  Tested up to: 4.9.6
6
- Stable tag: 1.7.1
7
  PHP version: 5.3.0 or greater
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -36,13 +36,22 @@ _Twig is the template language powering Timber; if you need a little background
36
  **Changes for Theme Developers**
37
  - Please add any usage changes here so theme developers are informed of changes.
38
 
 
 
 
 
 
 
 
 
 
 
39
  = 1.7.1 =
40
  **Fixes and improvements**
41
  - Fixes issues previewing custom fields with ACF #1712
42
  - Fixes some edge cases with Menu Item classes #1709
43
  - Improved efficiency of Post class instantiation #1660
44
 
45
-
46
  = 1.7.0 =
47
  **Fixes and improvements**
48
  - Fixed some issues with animated gif resizing when Imagick isn't available #1653
3
  Tags: template engine, templates, twig
4
  Requires at least: 4.7.9
5
  Tested up to: 4.9.6
6
+ Stable tag: 1.8.0
7
  PHP version: 5.3.0 or greater
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
36
  **Changes for Theme Developers**
37
  - Please add any usage changes here so theme developers are informed of changes.
38
 
39
+ = 1.8.0=
40
+ **Changes for Theme Developers**
41
+ - Webp is now supported as a conversion format ( `{{ post.thumbnail.src | towebp }}` ) @mhz-tamb @pascalknecht #1638 #1777 #1780
42
+ - Timber now recognizes that SVGs shouldn't be resized as if they are rasters (for retina, etc.) @palmiak #1726 #1736
43
+
44
+ **Fixes and improvements**
45
+ - Clean-up on i18n function calls @drzraf #1753
46
+ - Fixed some odd port handling @pascalknecht #1760
47
+ - Fixed how terms are retrived through a post @shvlv #1729
48
+
49
  = 1.7.1 =
50
  **Fixes and improvements**
51
  - Fixes issues previewing custom fields with ACF #1712
52
  - Fixes some edge cases with Menu Item classes #1709
53
  - Improved efficiency of Post class instantiation #1660
54
 
 
55
  = 1.7.0 =
56
  **Fixes and improvements**
57
  - Fixed some issues with animated gif resizing when Imagick isn't available #1653
timber-starter-theme/.gitignore CHANGED
@@ -1,2 +1,2 @@
1
  vendor
2
- wp-content
1
  vendor
2
+ wp-content
timber-starter-theme/archive.php CHANGED
@@ -20,11 +20,11 @@ $context = Timber::get_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() ) {
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() ) {
timber-starter-theme/composer.json CHANGED
@@ -24,6 +24,6 @@
24
  }
25
  },
26
  "require": {
27
- "wpackagist-plugin/timber-library": "0.22.*"
28
  }
29
  }
24
  }
25
  },
26
  "require": {
27
+ "wpackagist-plugin/timber-library": "1.*"
28
  }
29
  }
timber-starter-theme/composer.lock DELETED
@@ -1,139 +0,0 @@
1
- {
2
- "_readme": [
3
- "This file locks the dependencies of your project to a known state",
4
- "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5
- "This file is @generated automatically"
6
- ],
7
- "hash": "03c15e6c57468a60aa7ddc84134dfb24",
8
- "content-hash": "ddbdaaec9f3f849d39a5aa1525e75c79",
9
- "packages": [
10
- {
11
- "name": "composer/installers",
12
- "version": "v1.0.25",
13
- "source": {
14
- "type": "git",
15
- "url": "https://github.com/composer/installers.git",
16
- "reference": "36e5b5843203d7f1cf6ffb0305a97e014387bd8e"
17
- },
18
- "dist": {
19
- "type": "zip",
20
- "url": "https://api.github.com/repos/composer/installers/zipball/36e5b5843203d7f1cf6ffb0305a97e014387bd8e",
21
- "reference": "36e5b5843203d7f1cf6ffb0305a97e014387bd8e",
22
- "shasum": ""
23
- },
24
- "require": {
25
- "composer-plugin-api": "^1.0"
26
- },
27
- "replace": {
28
- "roundcube/plugin-installer": "*",
29
- "shama/baton": "*"
30
- },
31
- "require-dev": {
32
- "composer/composer": "1.0.*@dev",
33
- "phpunit/phpunit": "4.1.*"
34
- },
35
- "type": "composer-plugin",
36
- "extra": {
37
- "class": "Composer\\Installers\\Plugin",
38
- "branch-alias": {
39
- "dev-master": "1.0-dev"
40
- }
41
- },
42
- "autoload": {
43
- "psr-4": {
44
- "Composer\\Installers\\": "src/Composer/Installers"
45
- }
46
- },
47
- "notification-url": "https://packagist.org/downloads/",
48
- "license": [
49
- "MIT"
50
- ],
51
- "authors": [
52
- {
53
- "name": "Kyle Robinson Young",
54
- "email": "kyle@dontkry.com",
55
- "homepage": "https://github.com/shama"
56
- }
57
- ],
58
- "description": "A multi-framework Composer library installer",
59
- "homepage": "https://composer.github.io/installers/",
60
- "keywords": [
61
- "Craft",
62
- "Dolibarr",
63
- "Hurad",
64
- "ImageCMS",
65
- "MODX Evo",
66
- "Mautic",
67
- "OXID",
68
- "SMF",
69
- "Thelia",
70
- "WolfCMS",
71
- "agl",
72
- "aimeos",
73
- "annotatecms",
74
- "bitrix",
75
- "cakephp",
76
- "chef",
77
- "codeigniter",
78
- "concrete5",
79
- "croogo",
80
- "dokuwiki",
81
- "drupal",
82
- "elgg",
83
- "fuelphp",
84
- "grav",
85
- "installer",
86
- "joomla",
87
- "kohana",
88
- "laravel",
89
- "lithium",
90
- "magento",
91
- "mako",
92
- "mediawiki",
93
- "modulework",
94
- "moodle",
95
- "phpbb",
96
- "piwik",
97
- "ppi",
98
- "puppet",
99
- "roundcube",
100
- "shopware",
101
- "silverstripe",
102
- "symfony",
103
- "typo3",
104
- "wordpress",
105
- "zend",
106
- "zikula"
107
- ],
108
- "time": "2016-04-13 19:46:30"
109
- },
110
- {
111
- "name": "wpackagist-plugin/timber-library",
112
- "version": "0.22.5",
113
- "source": {
114
- "type": "svn",
115
- "url": "https://plugins.svn.wordpress.org/timber-library/",
116
- "reference": "tags/0.22.5"
117
- },
118
- "dist": {
119
- "type": "zip",
120
- "url": "https://downloads.wordpress.org/plugin/timber-library.0.22.5.zip",
121
- "reference": null,
122
- "shasum": null
123
- },
124
- "require": {
125
- "composer/installers": "~1.0"
126
- },
127
- "type": "wordpress-plugin",
128
- "homepage": "https://wordpress.org/plugins/timber-library/"
129
- }
130
- ],
131
- "packages-dev": [],
132
- "aliases": [],
133
- "minimum-stability": "stable",
134
- "stability-flags": [],
135
- "prefer-stable": false,
136
- "prefer-lowest": false,
137
- "platform": [],
138
- "platform-dev": []
139
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
timber-starter-theme/footer.php CHANGED
@@ -3,11 +3,15 @@
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
 
10
- $timberContext = $GLOBALS['timberContext'];
11
  if ( ! isset( $timberContext ) ) {
12
  throw new \Exception( 'Timber context not set in footer.' );
13
  }
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
  }
timber-starter-theme/functions.php CHANGED
@@ -1,24 +1,47 @@
1
  <?php
 
 
 
 
 
 
 
 
2
 
3
  if ( ! class_exists( 'Timber' ) ) {
4
  add_action( 'admin_notices', function() {
5
- 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>';
6
  });
7
-
8
- add_filter('template_include', function($template) {
9
  return get_stylesheet_directory() . '/static/no-timber.html';
10
  });
11
-
12
  return;
13
  }
14
 
15
- Timber::$dirname = array('templates', 'views');
 
 
 
 
 
 
 
 
 
16
 
17
- class StarterSite extends TimberSite {
18
 
19
- function __construct() {
 
 
 
 
 
 
20
  add_theme_support( 'post-formats' );
21
  add_theme_support( 'post-thumbnails' );
 
22
  add_theme_support( 'menus' );
23
  add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ) );
24
  add_filter( 'timber_context', array( $this, 'add_to_context' ) );
@@ -27,33 +50,44 @@ class StarterSite extends TimberSite {
27
  add_action( 'init', array( $this, 'register_taxonomies' ) );
28
  parent::__construct();
29
  }
 
 
30
 
31
- function register_post_types() {
32
- //this is where you can register custom post types
33
  }
 
 
34
 
35
- function register_taxonomies() {
36
- //this is where you can register custom taxonomies
37
  }
38
 
39
- function add_to_context( $context ) {
 
 
 
 
40
  $context['foo'] = 'bar';
41
  $context['stuff'] = 'I am a value set in your functions.php file';
42
  $context['notes'] = 'These values are available everytime you call Timber::get_context();';
43
- $context['menu'] = new TimberMenu();
44
  $context['site'] = $this;
45
  return $context;
46
  }
47
 
48
- function myfoo( $text ) {
 
 
 
 
49
  $text .= ' bar!';
50
  return $text;
51
  }
52
 
53
- function add_to_twig( $twig ) {
54
- /* this is where you can add your own functions to twig */
 
 
 
55
  $twig->addExtension( new Twig_Extension_StringLoader() );
56
- $twig->addFilter('myfoo', new Twig_SimpleFilter('myfoo', array($this, 'myfoo')));
57
  return $twig;
58
  }
59
 
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
  if ( ! class_exists( 'Timber' ) ) {
12
  add_action( 'admin_notices', function() {
13
+ 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>';
14
  });
15
+
16
+ add_filter('template_include', function( $template ) {
17
  return get_stylesheet_directory() . '/static/no-timber.html';
18
  });
19
+
20
  return;
21
  }
22
 
23
+ /**
24
+ * Sets the directories (inside your theme) to find .twig files
25
+ */
26
+ Timber::$dirname = array( 'templates', 'views' );
27
+
28
+ /**
29
+ * By default, Timber does NOT autoescape values. Want to enable Twig's autoescape?
30
+ * No prob! Just set this value to true
31
+ */
32
+ Timber::$autoescape = false;
33
 
 
34
 
35
+ /**
36
+ * We're going to configure our theme inside of a subclass of Timber\Site
37
+ * You can move this to its own file and include here via php's include("MySite.php")
38
+ */
39
+ class StarterSite extends Timber\Site {
40
+ /** Add timber support. */
41
+ public function __construct() {
42
  add_theme_support( 'post-formats' );
43
  add_theme_support( 'post-thumbnails' );
44
+ add_theme_support( 'title-tag' );
45
  add_theme_support( 'menus' );
46
  add_theme_support( 'html5', array( 'comment-list', 'comment-form', 'search-form', 'gallery', 'caption' ) );
47
  add_filter( 'timber_context', array( $this, 'add_to_context' ) );
50
  add_action( 'init', array( $this, 'register_taxonomies' ) );
51
  parent::__construct();
52
  }
53
+ /** This is where you can register custom post types. */
54
+ public function register_post_types() {
55
 
 
 
56
  }
57
+ /** This is where you can register custom taxonomies. */
58
+ public function register_taxonomies() {
59
 
 
 
60
  }
61
 
62
+ /** This is where you add some context
63
+ *
64
+ * @param string $context context['this'] Being the Twig's {{ this }}.
65
+ */
66
+ public function add_to_context( $context ) {
67
  $context['foo'] = 'bar';
68
  $context['stuff'] = 'I am a value set in your functions.php file';
69
  $context['notes'] = 'These values are available everytime you call Timber::get_context();';
70
+ $context['menu'] = new Timber\Menu();
71
  $context['site'] = $this;
72
  return $context;
73
  }
74
 
75
+ /** This Would return 'foo bar!'.
76
+ *
77
+ * @param string $text being 'foo', then returned 'foo bar!'.
78
+ */
79
+ public function myfoo( $text ) {
80
  $text .= ' bar!';
81
  return $text;
82
  }
83
 
84
+ /** This is where you can add your own functions to twig.
85
+ *
86
+ * @param string $twig get extension.
87
+ */
88
+ public function add_to_twig( $twig ) {
89
  $twig->addExtension( new Twig_Extension_StringLoader() );
90
+ $twig->addFilter( new Twig_SimpleFilter( 'myfoo', array( $this, 'myfoo' ) ) );
91
  return $twig;
92
  }
93
 
timber-starter-theme/header.php CHANGED
@@ -3,8 +3,12 @@
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
 
10
  $GLOBALS['timberContext'] = Timber::get_context();
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::get_context();
timber-starter-theme/index.php CHANGED
@@ -12,6 +12,7 @@
12
  * @subpackage Timber
13
  * @since Timber 0.1
14
  */
 
15
  $context = Timber::get_context();
16
  $context['posts'] = new Timber\PostQuery();
17
  $context['foo'] = 'bar';
12
  * @subpackage Timber
13
  * @since Timber 0.1
14
  */
15
+
16
  $context = Timber::get_context();
17
  $context['posts'] = new Timber\PostQuery();
18
  $context['foo'] = 'bar';
timber-starter-theme/page.php CHANGED
@@ -24,4 +24,4 @@
24
  $context = Timber::get_context();
25
  $post = new TimberPost();
26
  $context['post'] = $post;
27
- Timber::render( array( 'page-' . $post->post_name . '.twig', 'page.twig' ), $context );
24
  $context = Timber::get_context();
25
  $post = new TimberPost();
26
  $context['post'] = $post;
27
+ Timber::render( array( 'page-' . $post->post_name . '.twig', 'page.twig' ), $context );
timber-starter-theme/sidebar.php CHANGED
@@ -2,7 +2,6 @@
2
  /**
3
  * The Template for the sidebar containing the main widget area
4
  *
5
- *
6
  * @package WordPress
7
  * @subpackage Timber
8
  */
2
  /**
3
  * The Template for the sidebar containing the main widget area
4
  *
 
5
  * @package WordPress
6
  * @subpackage Timber
7
  */
timber-starter-theme/templates/html-header.twig CHANGED
@@ -5,13 +5,6 @@
5
  <!--[if gt IE 8]><!--><html class="no-js" {{ site.language_attributes }}> <!--<![endif]-->
6
  <head>
7
  <meta charset="{{ site.charset }}" />
8
- <title>
9
- {% if wp_title %}
10
- {{ wp_title }} - {{ site.name }}
11
- {% else %}
12
- {{ site.name }}
13
- {% endif %}
14
- </title>
15
  <meta name="description" content="{{ site.description }}">
16
  <link rel="stylesheet" href="{{ site.theme.link }}/style.css" type="text/css" media="screen" />
17
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
5
  <!--[if gt IE 8]><!--><html class="no-js" {{ site.language_attributes }}> <!--<![endif]-->
6
  <head>
7
  <meta charset="{{ site.charset }}" />
 
 
 
 
 
 
 
8
  <meta name="description" content="{{ site.description }}">
9
  <link rel="stylesheet" href="{{ site.theme.link }}/style.css" type="text/css" media="screen" />
10
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
timber-starter-theme/templates/single-password.twig CHANGED
@@ -1,7 +1,7 @@
1
  {% extends "base.twig" %}
2
 
3
  {% block content %}
4
- <form class="password-form" action="{{site.link}}/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" />
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" />
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.7.1
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.8.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 ComposerAutoloaderInitc42aa27f1d57b332ff0f441aa8cd7aa5::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit77fa4599d331e2be6457346ebbccd4da::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -34,6 +34,7 @@ return array(
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\\ClanCatsFrameworkInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php',
38
  'Composer\\Installers\\CockpitInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CockpitInstaller.php',
39
  'Composer\\Installers\\CodeIgniterInstaller' => $vendorDir . '/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php',
@@ -133,6 +134,7 @@ return array(
133
  'Timber\\Image\\Operation\\Resize' => $baseDir . '/lib/Image/Operation/Resize.php',
134
  'Timber\\Image\\Operation\\Retina' => $baseDir . '/lib/Image/Operation/Retina.php',
135
  'Timber\\Image\\Operation\\ToJpg' => $baseDir . '/lib/Image/Operation/ToJpg.php',
 
136
  'Timber\\Integrations' => $baseDir . '/lib/Integrations.php',
137
  'Timber\\Integrations\\ACF' => $baseDir . '/lib/Integrations/ACF.php',
138
  'Timber\\Integrations\\CoAuthorsPlus' => $baseDir . '/lib/Integrations/CoAuthorsPlus.php',
@@ -183,7 +185,6 @@ return array(
183
  'Twig\\Extension\\InitRuntimeInterface' => $vendorDir . '/twig/twig/src/Extension/InitRuntimeInterface.php',
184
  'Twig\\Extension\\OptimizerExtension' => $vendorDir . '/twig/twig/src/Extension/OptimizerExtension.php',
185
  'Twig\\Extension\\ProfilerExtension' => $vendorDir . '/twig/twig/src/Extension/ProfilerExtension.php',
186
- 'Twig\\Extension\\RuntimeExtensionInterface' => $vendorDir . '/twig/twig/src/Extension/RuntimeExtensionInterface.php',
187
  'Twig\\Extension\\SandboxExtension' => $vendorDir . '/twig/twig/src/Extension/SandboxExtension.php',
188
  'Twig\\Extension\\StagingExtension' => $vendorDir . '/twig/twig/src/Extension/StagingExtension.php',
189
  'Twig\\Extension\\StringLoaderExtension' => $vendorDir . '/twig/twig/src/Extension/StringLoaderExtension.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',
134
  'Timber\\Image\\Operation\\Resize' => $baseDir . '/lib/Image/Operation/Resize.php',
135
  'Timber\\Image\\Operation\\Retina' => $baseDir . '/lib/Image/Operation/Retina.php',
136
  'Timber\\Image\\Operation\\ToJpg' => $baseDir . '/lib/Image/Operation/ToJpg.php',
137
+ 'Timber\\Image\\Operation\\ToWebp' => $baseDir . '/lib/Image/Operation/ToWebp.php',
138
  'Timber\\Integrations' => $baseDir . '/lib/Integrations.php',
139
  'Timber\\Integrations\\ACF' => $baseDir . '/lib/Integrations/ACF.php',
140
  'Timber\\Integrations\\CoAuthorsPlus' => $baseDir . '/lib/Integrations/CoAuthorsPlus.php',
185
  'Twig\\Extension\\InitRuntimeInterface' => $vendorDir . '/twig/twig/src/Extension/InitRuntimeInterface.php',
186
  'Twig\\Extension\\OptimizerExtension' => $vendorDir . '/twig/twig/src/Extension/OptimizerExtension.php',
187
  'Twig\\Extension\\ProfilerExtension' => $vendorDir . '/twig/twig/src/Extension/ProfilerExtension.php',
 
188
  'Twig\\Extension\\SandboxExtension' => $vendorDir . '/twig/twig/src/Extension/SandboxExtension.php',
189
  'Twig\\Extension\\StagingExtension' => $vendorDir . '/twig/twig/src/Extension/StagingExtension.php',
190
  'Twig\\Extension\\StringLoaderExtension' => $vendorDir . '/twig/twig/src/Extension/StringLoaderExtension.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInitc42aa27f1d57b332ff0f441aa8cd7aa5
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitc42aa27f1d57b332ff0f441aa8cd7aa5
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitc42aa27f1d57b332ff0f441aa8cd7aa5', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitc42aa27f1d57b332ff0f441aa8cd7aa5', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit77fa4599d331e2be6457346ebbccd4da
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit77fa4599d331e2be6457346ebbccd4da', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit77fa4599d331e2be6457346ebbccd4da', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
vendor/composer/installed.json CHANGED
@@ -1,17 +1,17 @@
1
  [
2
  {
3
  "name": "composer/installers",
4
- "version": "v1.5.0",
5
- "version_normalized": "1.5.0.0",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/composer/installers.git",
9
- "reference": "049797d727261bf27f2690430d935067710049c2"
10
  },
11
  "dist": {
12
  "type": "zip",
13
- "url": "https://api.github.com/repos/composer/installers/zipball/049797d727261bf27f2690430d935067710049c2",
14
- "reference": "049797d727261bf27f2690430d935067710049c2",
15
  "shasum": ""
16
  },
17
  "require": {
@@ -25,7 +25,7 @@
25
  "composer/composer": "1.0.*@dev",
26
  "phpunit/phpunit": "^4.8.36"
27
  },
28
- "time": "2017-12-29 09:13:20",
29
  "type": "composer-plugin",
30
  "extra": {
31
  "class": "Composer\\Installers\\Plugin",
@@ -121,19 +121,125 @@
121
  "zikula"
122
  ]
123
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  {
125
  "name": "twig/twig",
126
- "version": "v1.35.2",
127
- "version_normalized": "1.35.2.0",
128
  "source": {
129
  "type": "git",
130
  "url": "https://github.com/twigphp/Twig.git",
131
- "reference": "9c24f2cd39dc1906b76879e099970b7e53724601"
132
  },
133
  "dist": {
134
  "type": "zip",
135
- "url": "https://api.github.com/repos/twigphp/Twig/zipball/9c24f2cd39dc1906b76879e099970b7e53724601",
136
- "reference": "9c24f2cd39dc1906b76879e099970b7e53724601",
137
  "shasum": ""
138
  },
139
  "require": {
@@ -144,11 +250,11 @@
144
  "symfony/debug": "~2.7",
145
  "symfony/phpunit-bridge": "~3.3@dev"
146
  },
147
- "time": "2018-03-03 16:21:29",
148
  "type": "library",
149
  "extra": {
150
  "branch-alias": {
151
- "dev-master": "1.35-dev"
152
  }
153
  },
154
  "installation-source": "dist",
@@ -243,111 +349,5 @@
243
  "extension",
244
  "twig"
245
  ]
246
- },
247
- {
248
- "name": "altorouter/altorouter",
249
- "version": "v1.1.0",
250
- "version_normalized": "1.1.0.0",
251
- "source": {
252
- "type": "git",
253
- "url": "https://github.com/dannyvankooten/AltoRouter.git",
254
- "reference": "09d9d946c546bae6d22a7654cdb3b825ffda54b4"
255
- },
256
- "dist": {
257
- "type": "zip",
258
- "url": "https://api.github.com/repos/dannyvankooten/AltoRouter/zipball/09d9d946c546bae6d22a7654cdb3b825ffda54b4",
259
- "reference": "09d9d946c546bae6d22a7654cdb3b825ffda54b4",
260
- "shasum": ""
261
- },
262
- "require": {
263
- "php": ">=5.3.0"
264
- },
265
- "time": "2014-04-16 09:44:40",
266
- "type": "library",
267
- "installation-source": "dist",
268
- "autoload": {
269
- "classmap": [
270
- "AltoRouter.php"
271
- ]
272
- },
273
- "notification-url": "https://packagist.org/downloads/",
274
- "license": [
275
- "MIT"
276
- ],
277
- "authors": [
278
- {
279
- "name": "Danny van Kooten",
280
- "email": "dannyvankooten@gmail.com",
281
- "homepage": "http://dannyvankooten.com/"
282
- },
283
- {
284
- "name": "Koen Punt",
285
- "homepage": "https://github.com/koenpunt"
286
- },
287
- {
288
- "name": "niahoo",
289
- "homepage": "https://github.com/niahoo"
290
- }
291
- ],
292
- "description": "A lightning fast router for PHP",
293
- "homepage": "https://github.com/dannyvankooten/AltoRouter",
294
- "keywords": [
295
- "lightweight",
296
- "router",
297
- "routing"
298
- ]
299
- },
300
- {
301
- "name": "upstatement/routes",
302
- "version": "0.4",
303
- "version_normalized": "0.4.0.0",
304
- "source": {
305
- "type": "git",
306
- "url": "https://github.com/Upstatement/routes.git",
307
- "reference": "fae7d46f56e8b5775f072774941a5f0a25cb86f3"
308
- },
309
- "dist": {
310
- "type": "zip",
311
- "url": "https://api.github.com/repos/Upstatement/routes/zipball/fae7d46f56e8b5775f072774941a5f0a25cb86f3",
312
- "reference": "fae7d46f56e8b5775f072774941a5f0a25cb86f3",
313
- "shasum": ""
314
- },
315
- "require": {
316
- "altorouter/altorouter": "1.1.0",
317
- "composer/installers": "~1.0",
318
- "php": ">=5.3.0"
319
- },
320
- "require-dev": {
321
- "phpunit/phpunit": "3.7.*",
322
- "satooshi/php-coveralls": "dev-master",
323
- "wp-cli/wp-cli": "*"
324
- },
325
- "time": "2016-07-06 12:53:24",
326
- "type": "library",
327
- "installation-source": "dist",
328
- "autoload": {
329
- "psr-0": {
330
- "Routes": ""
331
- }
332
- },
333
- "notification-url": "https://packagist.org/downloads/",
334
- "license": [
335
- "MIT"
336
- ],
337
- "authors": [
338
- {
339
- "name": "Jared Novack",
340
- "email": "jared@upstatement.com",
341
- "homepage": "http://upstatement.com"
342
- }
343
- ],
344
- "description": "Manage rewrites and routes in WordPress with this dead-simple plugin",
345
- "homepage": "http://routes.upstatement.com",
346
- "keywords": [
347
- "redirects",
348
- "rewrite",
349
- "routes",
350
- "routing"
351
- ]
352
  }
353
  ]
1
  [
2
  {
3
  "name": "composer/installers",
4
+ "version": "v1.6.0",
5
+ "version_normalized": "1.6.0.0",
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/composer/installers.git",
9
+ "reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b"
10
  },
11
  "dist": {
12
  "type": "zip",
13
+ "url": "https://api.github.com/repos/composer/installers/zipball/cfcca6b1b60bc4974324efb5783c13dca6932b5b",
14
+ "reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b",
15
  "shasum": ""
16
  },
17
  "require": {
25
  "composer/composer": "1.0.*@dev",
26
  "phpunit/phpunit": "^4.8.36"
27
  },
28
+ "time": "2018-08-27 06:10:37",
29
  "type": "composer-plugin",
30
  "extra": {
31
  "class": "Composer\\Installers\\Plugin",
121
  "zikula"
122
  ]
123
  },
124
+ {
125
+ "name": "altorouter/altorouter",
126
+ "version": "v1.1.0",
127
+ "version_normalized": "1.1.0.0",
128
+ "source": {
129
+ "type": "git",
130
+ "url": "https://github.com/dannyvankooten/AltoRouter.git",
131
+ "reference": "09d9d946c546bae6d22a7654cdb3b825ffda54b4"
132
+ },
133
+ "dist": {
134
+ "type": "zip",
135
+ "url": "https://api.github.com/repos/dannyvankooten/AltoRouter/zipball/09d9d946c546bae6d22a7654cdb3b825ffda54b4",
136
+ "reference": "09d9d946c546bae6d22a7654cdb3b825ffda54b4",
137
+ "shasum": ""
138
+ },
139
+ "require": {
140
+ "php": ">=5.3.0"
141
+ },
142
+ "time": "2014-04-16 09:44:40",
143
+ "type": "library",
144
+ "installation-source": "dist",
145
+ "autoload": {
146
+ "classmap": [
147
+ "AltoRouter.php"
148
+ ]
149
+ },
150
+ "notification-url": "https://packagist.org/downloads/",
151
+ "license": [
152
+ "MIT"
153
+ ],
154
+ "authors": [
155
+ {
156
+ "name": "Danny van Kooten",
157
+ "email": "dannyvankooten@gmail.com",
158
+ "homepage": "http://dannyvankooten.com/"
159
+ },
160
+ {
161
+ "name": "Koen Punt",
162
+ "homepage": "https://github.com/koenpunt"
163
+ },
164
+ {
165
+ "name": "niahoo",
166
+ "homepage": "https://github.com/niahoo"
167
+ }
168
+ ],
169
+ "description": "A lightning fast router for PHP",
170
+ "homepage": "https://github.com/dannyvankooten/AltoRouter",
171
+ "keywords": [
172
+ "lightweight",
173
+ "router",
174
+ "routing"
175
+ ]
176
+ },
177
+ {
178
+ "name": "upstatement/routes",
179
+ "version": "0.4",
180
+ "version_normalized": "0.4.0.0",
181
+ "source": {
182
+ "type": "git",
183
+ "url": "https://github.com/Upstatement/routes.git",
184
+ "reference": "fae7d46f56e8b5775f072774941a5f0a25cb86f3"
185
+ },
186
+ "dist": {
187
+ "type": "zip",
188
+ "url": "https://api.github.com/repos/Upstatement/routes/zipball/fae7d46f56e8b5775f072774941a5f0a25cb86f3",
189
+ "reference": "fae7d46f56e8b5775f072774941a5f0a25cb86f3",
190
+ "shasum": ""
191
+ },
192
+ "require": {
193
+ "altorouter/altorouter": "1.1.0",
194
+ "composer/installers": "~1.0",
195
+ "php": ">=5.3.0"
196
+ },
197
+ "require-dev": {
198
+ "phpunit/phpunit": "3.7.*",
199
+ "satooshi/php-coveralls": "dev-master",
200
+ "wp-cli/wp-cli": "*"
201
+ },
202
+ "time": "2016-07-06 12:53:24",
203
+ "type": "library",
204
+ "installation-source": "dist",
205
+ "autoload": {
206
+ "psr-0": {
207
+ "Routes": ""
208
+ }
209
+ },
210
+ "notification-url": "https://packagist.org/downloads/",
211
+ "license": [
212
+ "MIT"
213
+ ],
214
+ "authors": [
215
+ {
216
+ "name": "Jared Novack",
217
+ "email": "jared@upstatement.com",
218
+ "homepage": "http://upstatement.com"
219
+ }
220
+ ],
221
+ "description": "Manage rewrites and routes in WordPress with this dead-simple plugin",
222
+ "homepage": "http://routes.upstatement.com",
223
+ "keywords": [
224
+ "redirects",
225
+ "rewrite",
226
+ "routes",
227
+ "routing"
228
+ ]
229
+ },
230
  {
231
  "name": "twig/twig",
232
+ "version": "v1.34.4",
233
+ "version_normalized": "1.34.4.0",
234
  "source": {
235
  "type": "git",
236
  "url": "https://github.com/twigphp/Twig.git",
237
+ "reference": "f878bab48edb66ad9c6ed626bf817f60c6c096ee"
238
  },
239
  "dist": {
240
  "type": "zip",
241
+ "url": "https://api.github.com/repos/twigphp/Twig/zipball/f878bab48edb66ad9c6ed626bf817f60c6c096ee",
242
+ "reference": "f878bab48edb66ad9c6ed626bf817f60c6c096ee",
243
  "shasum": ""
244
  },
245
  "require": {
250
  "symfony/debug": "~2.7",
251
  "symfony/phpunit-bridge": "~3.3@dev"
252
  },
253
+ "time": "2017-07-04 13:19:31",
254
  "type": "library",
255
  "extra": {
256
  "branch-alias": {
257
+ "dev-master": "1.34-dev"
258
  }
259
  },
260
  "installation-source": "dist",
349
  "extension",
350
  "twig"
351
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
352
  }
353
  ]
vendor/composer/installers/.editorconfig DELETED
@@ -1,10 +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
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/.gitignore DELETED
@@ -1,3 +0,0 @@
1
- vendor/
2
- composer.lock
3
- .idea/
 
 
 
vendor/composer/installers/.travis.yml DELETED
@@ -1,33 +0,0 @@
1
- language: php
2
-
3
- sudo: false
4
-
5
- dist: trusty
6
-
7
- git:
8
- depth: 5
9
-
10
- php:
11
- - 5.4
12
- - 5.5
13
- - 5.6
14
- - 7.0
15
- - 7.1
16
- - 7.2
17
- - hhvm
18
- - nightly
19
-
20
- matrix:
21
- include:
22
- - dist: precise
23
- php: 5.3
24
- fast_finish: true
25
- allow_failures:
26
- - php: nightly
27
-
28
- before_script:
29
- - composer self-update
30
- - composer install
31
-
32
- script:
33
- - composer test
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/CHANGELOG.md DELETED
@@ -1,86 +0,0 @@
1
- # Change Log
2
-
3
- ## [Unreleased]
4
-
5
- ## v1.5.0 - 2017-12-29
6
- ### Added
7
- * Added WordPress dropin support.
8
- * Added new types supported for Eliasis.
9
- * Added support for Phoenix CMS.
10
- * Added MODX installer.
11
- * Added Majima instaler.
12
- * Added SiteDirect installer.
13
- * Added support optional prefix in OctoberCMS installers.
14
- * Added PHP 7.2 support.
15
-
16
- ### Changed
17
- * Changed remove packages, see [#348](https://github.com/composer/installers/pull/348).
18
-
19
- ### Fixed
20
- * Fixed code style, removed unused imports.
21
-
22
- ## v1.4.0 - 2017-08-09
23
- ### Added
24
- * Installer for eZ Platform.
25
- * Installer for UserFrosting.
26
- * Installer for Osclass.
27
- * Installer for Lan Management System.
28
-
29
- ### Changed
30
- * Added vendor name to package path for Lavalite.
31
-
32
- ## v1.3.0 - 2017-04-24
33
- ### Added
34
- * Kanboard plugins installer.
35
- * Porto-SAP installer.
36
- * Add `core` to concrete5 installer.
37
- * Support Moodle "search" plugin type.
38
- * SyDES installer.
39
- * iTop installer.
40
- * Lavalite installer.
41
- * Module type for Eliasis.
42
- * Vgmcp installer.
43
- * OntoWiki installer.
44
- * The requirements for contributing (CONTRIBUTING.md).
45
-
46
- ## v1.2.0 - 2016-08-13
47
- ### Added
48
- * Installer for Attogram.
49
- * Installer for Cockpit.
50
- * Installer for Plentymarkets.
51
- * Installer for ReIndex.
52
- * Installer for Vanilla.
53
- * Installer for YAWIK.
54
- * Added missing environments for new Shopware (5.2) Plugin System.
55
-
56
- ## v1.1.0 - 2016-07-05
57
- ### Added
58
- * Installer for ReIndex.
59
- * Installer for RadPHP.
60
- * Installer for Decibel.
61
- * Installer for Phifty.
62
- * Installer for ExpressionEngine.
63
-
64
- ### Changed
65
- * New paths for new Bitrix CMS. Old paths is deprecated.
66
-
67
- ### Deprecated
68
- * Old paths in Bitrix CMS Installer is deprecated.
69
-
70
- ## v1.0.25 - 2016-04-13
71
- ### Removed
72
- * Revert TYPO3 installer deletion.
73
-
74
- ## v1.0.24 - 2016-04-05
75
- ### Added
76
- * Installer for ImageCMS.
77
- * Installer for Mautic.
78
- * New types in the Kirby installer: `kirby-plugin` and `kirby-field`.
79
- * New types in the Drupal installer: `custom-theme` and `custom-module`.
80
-
81
- ### Changed
82
- * Switch to PSR-4.
83
- * Update Bitrix Installer: configuration for setting custom path to directory with kernel.
84
-
85
- ### Removed
86
- * Remove TYPO3 Extension installers.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/CONTRIBUTING.md DELETED
@@ -1,24 +0,0 @@
1
- # Contributing
2
-
3
- If you would like to help, please take a look at the list of
4
- [issues](https://github.com/composer/installers/issues).
5
-
6
- ## Pull requests
7
-
8
- * [Fork and clone](https://help.github.com/articles/fork-a-repo).
9
- * Run the command `php composer.phar install` to install the dependencies.
10
- This will also install the dev dependencies. See [Composer](https://getcomposer.org/doc/03-cli.md#install).
11
- * Use the command `phpunit` to run the tests. See [PHPUnit](http://phpunit.de).
12
- * Create a branch, commit, push and send us a
13
- [pull request](https://help.github.com/articles/using-pull-requests).
14
-
15
- To ensure a consistent code base, you should make sure the code follows the
16
- coding standards [PSR-1](http://www.php-fig.org/psr/psr-1/) and
17
- [PSR-2](http://www.php-fig.org/psr/psr-2/).
18
-
19
- ### Create a new Installer
20
-
21
- * Create class extends `Composer\Installers\BaseInstaller` with your Installer.
22
- * Create unit tests as a separate class or as part of a `Composer\Installers\Test\InstallerTest`.
23
- * Add information about your Installer in `README.md` in section "Current Supported Package Types".
24
- * Run the tests.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/README.md DELETED
@@ -1,221 +0,0 @@
1
- # A Multi-Framework [Composer](http://getcomposer.org) Library Installer
2
-
3
- [![Build Status](http://img.shields.io/travis/composer/installers.svg)](http://travis-ci.org/composer/installers)
4
-
5
- This is for PHP package authors to require in their `composer.json`. It will
6
- install their package to the correct location based on the specified package
7
- type.
8
-
9
- The goal of Installers is to be a simple package type to install path map.
10
- Users can also customize the install path per package and package authors can
11
- modify the package name upon installing.
12
-
13
- Installers isn't intended on replacing all custom installers. If your
14
- package requires special installation handling then by all means, create a
15
- custom installer to handle it.
16
-
17
- **Natively Supported Frameworks**:
18
-
19
- The following frameworks natively work with Composer and will be
20
- installed to the default `vendor` directory. `composer/installers`
21
- is not needed to install packages with these frameworks:
22
-
23
- * Aura
24
- * Symfony2
25
- * Yii
26
- * Yii2
27
-
28
- ## Current Supported Package Types
29
-
30
- > Stable types are marked as **bold**, this means that installation paths
31
- > for those type will not be changed. Any adjustment for those types would
32
- > require creation of brand new type that will cover required changes.
33
-
34
- | Framework | Types
35
- | --------- | -----
36
- | Aimeos | `aimeos-extension`
37
- | Asgard | `asgard-module`<br>`asgard-theme`
38
- | Attogram | `attogram-module`
39
- | AGL | `agl-module`
40
- | Bonefish | `bonefish-package`
41
- | AnnotateCms | `annotatecms-module`<br>`annotatecms-component`<br>`annotatecms-service`
42
- | Bitrix | `bitrix-module` (deprecated) <br>`bitrix-component` (deprecated) <br>`bitrix-theme` (deprecated) <br><br> `bitrix-d7-module` <br> `bitrix-d7-component` <br> `bitrix-d7-template`
43
- | CakePHP 2+ | **`cakephp-plugin`**
44
- | Chef | `chef-cookbook`<br>`chef-role`
45
- | CCFramework | `ccframework-ship`<br>`ccframework-theme`
46
- | Cockpit | `cockpit-module`
47
- | CodeIgniter | `codeigniter-library`<br>`codeigniter-third-party`<br>`codeigniter-module`
48
- | concrete5 | `concrete5-core`<br>`concrete5-package`<br>`concrete5-theme`<br>`concrete5-block`<br>`concrete5-update`
49
- | Craft | `craft-plugin`
50
- | Croogo | `croogo-plugin`<br>`croogo-theme`
51
- | Decibel | `decibel-app`
52
- | DokuWiki | `dokuwiki-plugin`<br>`dokuwiki-template`
53
- | Dolibarr | `dolibarr-module`
54
- | Drupal | <b>`drupal-core`<br>`drupal-module`<br>`drupal-theme`</b><br>`drupal-library`<br>`drupal-profile`<br>`drupal-drush`
55
- | Elgg | `elgg-plugin`
56
- | Eliasis | `eliasis-component`<br>`eliasis-module`<br>`eliasis-plugin`<br>`eliasis-template`
57
- | ExpressionEngine 3 | `ee3-addon`<br>`ee3-theme`
58
- | eZ Platform | `ezplatform-assets`<br>`ezplatform-meta-assets`
59
- | FuelPHP v1.x | `fuel-module`<br>`fuel-package`<br/>`fuel-theme`
60
- | FuelPHP v2.x | `fuelphp-component`
61
- | Grav | `grav-plugin`<br>`grav-theme`
62
- | Hurad | `hurad-plugin`<br>`hurad-theme`
63
- | ImageCMS | `imagecms-template`<br>`imagecms-module`<br>`imagecms-library`
64
- | iTop | `itop-extension`
65
- | Joomla | `joomla-component`<br>`joomla-module`<br>`joomla-template`<br>`joomla-plugin`<br>`joomla-library`
66
- | Kanboard | `kanboard-plugin`
67
- | Kirby | **`kirby-plugin`**<br>`kirby-field`<br>`kirby-tag`
68
- | KodiCMS | `kodicms-plugin`<br>`kodicms-media`
69
- | Kohana | **`kohana-module`**
70
- | Lan Management System | `lms-plugin`<br>`lms-template`<br>`lms-document-template`<br>`lms-userpanel-module`
71
- | Laravel | `laravel-library`
72
- | Lavalite | `lavalite-theme`<br>`lavalite-package`
73
- | Lithium | **`lithium-library`<br>`lithium-source`**
74
- | Magento | `magento-library`<br>`magento-skin`<br>`magento-theme`
75
- | majima | `majima-plugin`
76
- | Mako | `mako-package`
77
- | Mautic | `mautic-plugin`<br>`mautic-theme`
78
- | Maya | `maya-module`
79
- | MODX | `modx-extra`
80
- | MODX Evo | `modxevo-snippet`<br>`modxevo-plugin`<br>`modxevo-module`<br>`modxevo-template`<br>`modxevo-lib`
81
- | MediaWiki | `mediawiki-extension`
82
- | October | **`october-module`<br>`october-plugin`<br>`october-theme`**
83
- | OntoWiki | `ontowiki-extension`<br>`ontowiki-theme`<br>`ontowiki-translation`
84
- | OXID | `oxid-module`<br>`oxid-theme`<br>`oxid-out`
85
- | Osclass | `osclass-plugin`<br>`osclass-theme`<br>`osclass-language`
86
- | MODULEWork | `modulework-module`
87
- | Moodle | `moodle-*` (Please [check source](https://raw.githubusercontent.com/composer/installers/master/src/Composer/Installers/MoodleInstaller.php) for all supported types)
88
- | Piwik | `piwik-plugin`
89
- | phpBB | `phpbb-extension`<br>`phpbb-style`<br>`phpbb-language`
90
- | Pimcore | `pimcore-plugin`
91
- | Plentymarkets | `plentymarkets-plugin`
92
- | PPI | **`ppi-module`**
93
- | Puppet | `puppet-module`
94
- | Porto | `porto-container`
95
- | RadPHP | `radphp-bundle`
96
- | REDAXO | `redaxo-addon`
97
- | ReIndex | **`reindex-plugin`** <br> **`reindex-theme`**
98
- | Roundcube | `roundcube-plugin`
99
- | shopware | `shopware-backend-plugin`<br/>`shopware-core-plugin`<br/>`shopware-frontend-plugin`<br/>`shopware-theme`<br/>`shopware-plugin`<br/>`shopware-frontend-theme`
100
- | SilverStripe | `silverstripe-module`<br>`silverstripe-theme`
101
- | SiteDirect | `sitedirect-module`<br>`sitedirect-plugin`
102
- | SMF | `smf-module`<br>`smf-theme`
103
- | SyDES | `sydes-module`<br>`sydes-theme`
104
- | symfony1 | **`symfony1-plugin`**
105
- | Tusk | `tusk-task`<br>`tusk-command`<br>`tusk-asset`
106
- | TYPO3 Flow | `typo3-flow-package`<br>`typo3-flow-framework`<br>`typo3-flow-plugin`<br>`typo3-flow-site`<br>`typo3-flow-boilerplate`<br>`typo3-flow-build`
107
- | TYPO3 CMS | `typo3-cms-extension` (Deprecated in this package, use the [TYPO3 CMS Installers](https://packagist.org/packages/typo3/cms-composer-installers) instead)
108
- | UserFrosting | `userfrosting-sprinkle`
109
- | Vanilla | `vanilla-plugin`<br>`vanilla-theme`
110
- | Vgmcp | `vgmcp-bundle`<br>`vgmcp-theme`
111
- | Wolf CMS | `wolfcms-plugin`
112
- | WordPress | <b>`wordpress-plugin`<br>`wordpress-theme`</b><br>`wordpress-muplugin`<br>`wordpress-dropin`
113
- | YAWIK | `yawik-module`
114
- | Zend | `zend-library`<br>`zend-extra`<br>`zend-module`
115
- | Zikula | `zikula-module`<br>`zikula-theme`
116
- | Prestashop | `prestashop-module`<br>`prestashop-theme`
117
- | Phifty | `phifty-bundle`<br>`phifty-framework`<br>`phifty-library`
118
-
119
- ## Example `composer.json` File
120
-
121
- This is an example for a CakePHP plugin. The only important parts to set in your
122
- composer.json file are `"type": "cakephp-plugin"` which describes what your
123
- package is and `"require": { "composer/installers": "~1.0" }` which tells composer
124
- to load the custom installers.
125
-
126
- ```json
127
- {
128
- "name": "you/ftp",
129
- "type": "cakephp-plugin",
130
- "require": {
131
- "composer/installers": "~1.0"
132
- }
133
- }
134
- ```
135
-
136
- This would install your package to the `Plugin/Ftp/` folder of a CakePHP app
137
- when a user runs `php composer.phar install`.
138
-
139
- So submit your packages to [packagist.org](http://packagist.org)!
140
-
141
- ## Custom Install Paths
142
-
143
- If you are consuming a package that uses the `composer/installers` you can
144
- override the install path with the following extra in your `composer.json`:
145
-
146
- ```json
147
- {
148
- "extra": {
149
- "installer-paths": {
150
- "your/custom/path/{$name}/": ["shama/ftp", "vendor/package"]
151
- }
152
- }
153
- }
154
- ```
155
-
156
- A package type can have a custom installation path with a `type:` prefix.
157
-
158
- ``` json
159
- {
160
- "extra": {
161
- "installer-paths": {
162
- "your/custom/path/{$name}/": ["type:wordpress-plugin"]
163
- }
164
- }
165
- }
166
- ```
167
-
168
- You can also have the same vendor packages with a custom installation path by
169
- using the `vendor:` prefix.
170
-
171
- ``` json
172
- {
173
- "extra": {
174
- "installer-paths": {
175
- "your/custom/path/{$name}/": ["vendor:my_organization"]
176
- }
177
- }
178
- }
179
- ```
180
-
181
- These would use your custom path for each of the listed packages. The available
182
- variables to use in your paths are: `{$name}`, `{$vendor}`, `{$type}`.
183
-
184
- ## Custom Install Names
185
-
186
- If you're a package author and need your package to be named differently when
187
- installed consider using the `installer-name` extra.
188
-
189
- For example you have a package named `shama/cakephp-ftp` with the type
190
- `cakephp-plugin`. Installing with `composer/installers` would install to the
191
- path `Plugin/CakephpFtp`. Due to the strict naming conventions, you as a
192
- package author actually need the package to be named and installed to
193
- `Plugin/Ftp`. Using the following config within your **package** `composer.json`
194
- will allow this:
195
-
196
- ```json
197
- {
198
- "name": "shama/cakephp-ftp",
199
- "type": "cakephp-plugin",
200
- "extra": {
201
- "installer-name": "Ftp"
202
- }
203
- }
204
- ```
205
-
206
- Please note the name entered into `installer-name` will be the final and will
207
- not be inflected.
208
-
209
- ## Should we allow dynamic package types or paths? No.
210
-
211
- What are they? The ability for a package author to determine where a package
212
- will be installed either through setting the path directly in their
213
- `composer.json` or through a dynamic package type: `"type":
214
- "framework-install-here"`.
215
-
216
- It has been proposed many times. Even implemented once early on and then
217
- removed. Installers won't do this because it would allow a single package
218
- author to wipe out entire folders without the user's consent. That user would
219
- then come here to yell at us.
220
-
221
- Anyone still wanting this capability should consider requiring https://github.com/oomphinc/composer-installers-extender.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/_config.yml DELETED
@@ -1 +0,0 @@
1
- theme: jekyll-theme-cayman
 
vendor/composer/installers/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="tests/bootstrap.php"
13
- >
14
- <testsuites>
15
- <testsuite name="Installers Test Suite">
16
- <directory>tests/Composer/Installers</directory>
17
- </testsuite>
18
- </testsuites>
19
-
20
- <filter>
21
- <whitelist>
22
- <directory>src/Composer/Installers</directory>
23
- </whitelist>
24
- </filter>
25
- </phpunit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Composer\Installers;
3
+
4
+ class CiviCrmInstaller extends BaseInstaller
5
+ {
6
+ protected $locations = array(
7
+ 'ext' => 'ext/{$name}/'
8
+ );
9
+ }
vendor/composer/installers/src/Composer/Installers/DrupalInstaller.php CHANGED
@@ -11,6 +11,6 @@ class DrupalInstaller extends BaseInstaller
11
  'profile' => 'profiles/{$name}/',
12
  'drush' => 'drush/{$name}/',
13
  'custom-theme' => 'themes/custom/{$name}/',
14
- 'custom-module' => 'modules/custom/{$name}',
15
  );
16
  }
11
  'profile' => 'profiles/{$name}/',
12
  'drush' => 'drush/{$name}/',
13
  'custom-theme' => 'themes/custom/{$name}/',
14
+ 'custom-module' => 'modules/custom/{$name}/',
15
  );
16
  }
vendor/composer/installers/src/Composer/Installers/Installer.php CHANGED
@@ -1,13 +1,18 @@
1
  <?php
 
2
  namespace Composer\Installers;
3
 
4
- use Composer\IO\IOInterface;
 
5
  use Composer\Installer\LibraryInstaller;
 
6
  use Composer\Package\PackageInterface;
7
  use Composer\Repository\InstalledRepositoryInterface;
 
8
 
9
  class Installer extends LibraryInstaller
10
  {
 
11
  /**
12
  * Package types to installer class map
13
  *
@@ -23,6 +28,7 @@ class Installer extends LibraryInstaller
23
  'bonefish' => 'BonefishInstaller',
24
  'cakephp' => 'CakePHPInstaller',
25
  'chef' => 'ChefInstaller',
 
26
  'ccframework' => 'ClanCatsFrameworkInstaller',
27
  'cockpit' => 'CockpitInstaller',
28
  'codeigniter' => 'CodeIgniterInstaller',
@@ -102,6 +108,30 @@ class Installer extends LibraryInstaller
102
  'prestashop' => 'PrestashopInstaller'
103
  );
104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  /**
106
  * {@inheritDoc}
107
  */
@@ -197,4 +227,48 @@ class Installer extends LibraryInstaller
197
  {
198
  return $this->io;
199
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
200
  }
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
  *
28
  'bonefish' => 'BonefishInstaller',
29
  'cakephp' => 'CakePHPInstaller',
30
  'chef' => 'ChefInstaller',
31
+ 'civicrm' => 'CiviCrmInstaller',
32
  'ccframework' => 'ClanCatsFrameworkInstaller',
33
  'cockpit' => 'CockpitInstaller',
34
  'codeigniter' => 'CodeIgniterInstaller',
108
  'prestashop' => 'PrestashopInstaller'
109
  );
110
 
111
+ /**
112
+ * Installer constructor.
113
+ *
114
+ * Disables installers specified in main composer extra installer-disable
115
+ * list
116
+ *
117
+ * @param IOInterface $io
118
+ * @param Composer $composer
119
+ * @param string $type
120
+ * @param Filesystem|null $filesystem
121
+ * @param BinaryInstaller|null $binaryInstaller
122
+ */
123
+ public function __construct(
124
+ IOInterface $io,
125
+ Composer $composer,
126
+ $type = 'library',
127
+ Filesystem $filesystem = null,
128
+ BinaryInstaller $binaryInstaller = null
129
+ ) {
130
+ parent::__construct($io, $composer, $type, $filesystem,
131
+ $binaryInstaller);
132
+ $this->removeDisabledInstallers();
133
+ }
134
+
135
  /**
136
  * {@inheritDoc}
137
  */
227
  {
228
  return $this->io;
229
  }
230
+
231
+ /**
232
+ * Look for installers set to be disabled in composer's extra config and
233
+ * remove them from the list of supported installers.
234
+ *
235
+ * Globals:
236
+ * - true, "all", and "*" - disable all installers.
237
+ * - false - enable all installers (useful with
238
+ * wikimedia/composer-merge-plugin or similar)
239
+ *
240
+ * @return void
241
+ */
242
+ protected function removeDisabledInstallers()
243
+ {
244
+ $extra = $this->composer->getPackage()->getExtra();
245
+
246
+ if (!isset($extra['installer-disable']) || $extra['installer-disable'] === false) {
247
+ // No installers are disabled
248
+ return;
249
+ }
250
+
251
+ // Get installers to disable
252
+ $disable = $extra['installer-disable'];
253
+
254
+ // Ensure $disabled is an array
255
+ if (!is_array($disable)) {
256
+ $disable = array($disable);
257
+ }
258
+
259
+ // Check which installers should be disabled
260
+ $all = array(true, "all", "*");
261
+ $intersect = array_intersect($all, $disable);
262
+ if (!empty($intersect)) {
263
+ // Disable all installers
264
+ $this->supportedTypes = array();
265
+ } else {
266
+ // Disable specified installers
267
+ foreach ($disable as $key => $installer) {
268
+ if (is_string($installer) && key_exists($installer, $this->supportedTypes)) {
269
+ unset($this->supportedTypes[$installer]);
270
+ }
271
+ }
272
+ }
273
+ }
274
  }
vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php CHANGED
@@ -4,6 +4,7 @@ namespace Composer\Installers;
4
  class MediaWikiInstaller extends BaseInstaller
5
  {
6
  protected $locations = array(
 
7
  'extension' => 'extensions/{$name}/',
8
  'skin' => 'skins/{$name}/',
9
  );
4
  class MediaWikiInstaller extends BaseInstaller
5
  {
6
  protected $locations = array(
7
+ 'core' => 'core/',
8
  'extension' => 'extensions/{$name}/',
9
  'skin' => 'skins/{$name}/',
10
  );
vendor/composer/installers/src/Composer/Installers/OctoberInstaller.php CHANGED
@@ -33,6 +33,7 @@ class OctoberInstaller extends BaseInstaller
33
  protected function inflectPluginVars($vars)
34
  {
35
  $vars['name'] = preg_replace('/^oc-|-plugin$/', '', $vars['name']);
 
36
 
37
  return $vars;
38
  }
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
  }
vendor/composer/installers/tests/Composer/Installers/Test/AsgardInstallerTest.php DELETED
@@ -1,80 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\AsgardInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
- use PHPUnit\Framework\TestCase;
8
-
9
- class AsgardInstallerTest extends TestCase
10
- {
11
- /**
12
- * @var AsgardInstaller
13
- */
14
- private $installer;
15
-
16
- public function setUp()
17
- {
18
- $this->installer = new AsgardInstaller(
19
- new Package('NyanCat', '4.2', '4.2'),
20
- new Composer()
21
- );
22
- }
23
-
24
- /**
25
- * @dataProvider packageNameInflectionProvider
26
- */
27
- public function testInflectPackageVars($type, $name, $expected)
28
- {
29
- $this->assertEquals(
30
- array('name' => $expected, 'type' => $type),
31
- $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
32
- );
33
- }
34
-
35
- public function packageNameInflectionProvider()
36
- {
37
- return array(
38
- // Should keep module name StudlyCase
39
- array(
40
- 'asgard-module',
41
- 'user-profile',
42
- 'UserProfile'
43
- ),
44
- array(
45
- 'asgard-module',
46
- 'asgard-module',
47
- 'Asgard'
48
- ),
49
- array(
50
- 'asgard-module',
51
- 'blog',
52
- 'Blog'
53
- ),
54
- // tests that exactly one '-module' is cut off
55
- array(
56
- 'asgard-module',
57
- 'some-module-module',
58
- 'SomeModule',
59
- ),
60
- // tests that exactly one '-theme' is cut off
61
- array(
62
- 'asgard-theme',
63
- 'some-theme-theme',
64
- 'SomeTheme',
65
- ),
66
- // tests that names without '-theme' suffix stay valid
67
- array(
68
- 'asgard-theme',
69
- 'someothertheme',
70
- 'Someothertheme',
71
- ),
72
- // Should keep theme name StudlyCase
73
- array(
74
- 'asgard-theme',
75
- 'adminlte-advanced',
76
- 'AdminlteAdvanced'
77
- ),
78
- );
79
- }
80
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/BitrixInstallerTest.php DELETED
@@ -1,75 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers\Test;
4
-
5
- use Composer\Installers\BitrixInstaller;
6
- use Composer\Package\Package;
7
- use Composer\Composer;
8
-
9
- /**
10
- * Tests for the BitrixInstaller Class
11
- *
12
- * @coversDefaultClass Composer\Installers\BitrixInstaller
13
- */
14
- class BitrixInstallerTest extends TestCase
15
- {
16
- /** @var BitrixInstaller */
17
- private $installer;
18
-
19
- /** @var Composer */
20
- private $composer;
21
-
22
-
23
- /**
24
- * Sets up the fixture, for example, instantiate the class-under-test.
25
- *
26
- * This method is called before a test is executed.
27
- */
28
- final function setUp()
29
- {
30
- $this->composer = new Composer();
31
- }
32
-
33
- /**
34
- * @param string $vars
35
- * @param string $expectedVars
36
- *
37
- * @covers ::inflectPackageVars
38
- *
39
- * @dataProvider provideExpectedInflectionResults
40
- */
41
- final public function testInflectPackageVars($vars, $expectedVars)
42
- {
43
-
44
- $this->installer = new BitrixInstaller(
45
- new Package($vars['name'], '4.2', '4.2'),
46
- $this->composer
47
- );
48
- $actual = $this->installer->inflectPackageVars($vars);
49
- $this->assertEquals($actual, $expectedVars);
50
- }
51
-
52
- /**
53
- * Provides various parameters for packages and the expected result after inflection
54
- *
55
- * @return array
56
- */
57
- final public function provideExpectedInflectionResults()
58
- {
59
- return array(
60
- //check bitrix-dir is correct
61
- array(
62
- array('name' => 'Nyan/Cat'),
63
- array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix')
64
- ),
65
- array(
66
- array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix'),
67
- array('name' => 'Nyan/Cat', 'bitrix_dir' => 'bitrix')
68
- ),
69
- array(
70
- array('name' => 'Nyan/Cat', 'bitrix_dir' => 'local'),
71
- array('name' => 'Nyan/Cat', 'bitrix_dir' => 'local')
72
- ),
73
- );
74
- }
75
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/CakePHPInstallerTest.php DELETED
@@ -1,114 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\CakePHPInstaller;
5
- use Composer\Repository\RepositoryManager;
6
- use Composer\Repository\InstalledArrayRepository;
7
- use Composer\Package\Package;
8
- use Composer\Package\RootPackage;
9
- use Composer\Package\Version\VersionParser;
10
- use Composer\Composer;
11
- use Composer\Config;
12
-
13
- class CakePHPInstallerTest extends TestCase
14
- {
15
- private $composer;
16
- private $io;
17
-
18
- /**
19
- * setUp
20
- *
21
- * @return void
22
- */
23
- public function setUp()
24
- {
25
- $this->package = new Package('CamelCased', '1.0', '1.0');
26
- $this->io = $this->getMock('Composer\IO\PackageInterface');
27
- $this->composer = new Composer();
28
- $this->composer->setConfig(new Config(false));
29
- }
30
-
31
- /**
32
- * testInflectPackageVars
33
- *
34
- * @return void
35
- */
36
- public function testInflectPackageVars()
37
- {
38
- $installer = new CakePHPInstaller($this->package, $this->composer);
39
- $result = $installer->inflectPackageVars(array('name' => 'CamelCased'));
40
- $this->assertEquals($result, array('name' => 'CamelCased'));
41
-
42
- $installer = new CakePHPInstaller($this->package, $this->composer);
43
- $result = $installer->inflectPackageVars(array('name' => 'with-dash'));
44
- $this->assertEquals($result, array('name' => 'WithDash'));
45
-
46
- $installer = new CakePHPInstaller($this->package, $this->composer);
47
- $result = $installer->inflectPackageVars(array('name' => 'with_underscore'));
48
- $this->assertEquals($result, array('name' => 'WithUnderscore'));
49
-
50
- $installer = new CakePHPInstaller($this->package, $this->composer);
51
- $result = $installer->inflectPackageVars(array('name' => 'cake/acl'));
52
- $this->assertEquals($result, array('name' => 'Cake/Acl'));
53
-
54
- $installer = new CakePHPInstaller($this->package, $this->composer);
55
- $result = $installer->inflectPackageVars(array('name' => 'cake/debug-kit'));
56
- $this->assertEquals($result, array('name' => 'Cake/DebugKit'));
57
- }
58
-
59
- /**
60
- * Test getLocations returning appropriate values based on CakePHP version
61
- *
62
- */
63
- public function testGetLocations() {
64
- $package = new RootPackage('CamelCased', '1.0', '1.0');
65
- $composer = $this->composer;
66
- $rm = new RepositoryManager(
67
- $this->getMock('Composer\IO\IOInterface'),
68
- $this->getMock('Composer\Config')
69
- );
70
- $composer->setRepositoryManager($rm);
71
- $installer = new CakePHPInstaller($package, $composer);
72
-
73
- // 2.0 < cakephp < 3.0
74
- $this->setCakephpVersion($rm, '2.0.0');
75
- $result = $installer->getLocations();
76
- $this->assertContains('Plugin/', $result['plugin']);
77
-
78
- $this->setCakephpVersion($rm, '2.5.9');
79
- $result = $installer->getLocations();
80
- $this->assertContains('Plugin/', $result['plugin']);
81
-
82
- $this->setCakephpVersion($rm, '~2.5');
83
- $result = $installer->getLocations();
84
- $this->assertContains('Plugin/', $result['plugin']);
85
-
86
- // special handling for 2.x versions when 3.x is still in development
87
- $this->setCakephpVersion($rm, 'dev-master');
88
- $result = $installer->getLocations();
89
- $this->assertContains('Plugin/', $result['plugin']);
90
-
91
- $this->setCakephpVersion($rm, '>=2.5');
92
- $result = $installer->getLocations();
93
- $this->assertContains('Plugin/', $result['plugin']);
94
-
95
- // cakephp >= 3.0
96
- $this->setCakephpVersion($rm, '3.0.*-dev');
97
- $result = $installer->getLocations();
98
- $this->assertContains('vendor/{$vendor}/{$name}/', $result['plugin']);
99
-
100
- $this->setCakephpVersion($rm, '~8.8');
101
- $result = $installer->getLocations();
102
- $this->assertContains('vendor/{$vendor}/{$name}/', $result['plugin']);
103
- }
104
-
105
- protected function setCakephpVersion($rm, $version) {
106
- $parser = new VersionParser();
107
- list(, $version) = explode(' ', $parser->parseConstraints($version));
108
- $installed = new InstalledArrayRepository();
109
- $package = new Package('cakephp/cakephp', $version, $version);
110
- $installed->addPackage($package);
111
- $rm->setLocalRepository($installed);
112
- }
113
-
114
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/CraftInstallerTest.php DELETED
@@ -1,83 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers\Test;
4
-
5
- use Composer\Installers\CraftInstaller;
6
-
7
- /**
8
- * Tests for the CraftInstaller Class
9
- *
10
- * @coversDefaultClass Composer\Installers\CraftInstaller
11
- */
12
- class CraftInstallerTest extends TestCase
13
- {
14
- /** @var CraftInstaller */
15
- private $installer;
16
-
17
- /**
18
- * Sets up the fixture, for example, instantiate the class-under-test.
19
- *
20
- * This method is called before a test is executed.
21
- */
22
- final public function setup()
23
- {
24
- $this->installer = new CraftInstaller();
25
- }
26
-
27
- /**
28
- * @param string $packageName
29
- * @param string $expectedName
30
- *
31
- * @covers ::inflectPackageVars
32
- *
33
- * @dataProvider provideExpectedInflectionResults
34
- */
35
- final public function testInflectPackageVars($packageName, $expectedName)
36
- {
37
- $installer = $this->installer;
38
-
39
- $vars = array('name' => $packageName);
40
- $expected = array('name' => $expectedName);
41
-
42
- $actual = $installer->inflectPackageVars($vars);
43
-
44
- $this->assertEquals($actual, $expected);
45
- }
46
-
47
- /**
48
- * Provides various names for packages and the expected result after inflection
49
- *
50
- * @return array
51
- */
52
- final public function provideExpectedInflectionResults()
53
- {
54
- return array(
55
- // lowercase
56
- array('foo', 'foo'),
57
- array('craftfoo', 'craftfoo'),
58
- array('fooplugin', 'fooplugin'),
59
- array('craftfooplugin', 'craftfooplugin'),
60
- // lowercase - dash
61
- array('craft-foo', 'foo'),
62
- array('foo-plugin', 'foo'),
63
- array('craft-foo-plugin', 'foo'),
64
- // lowercase - underscore
65
- array('craft_foo', 'craft_foo'),
66
- array('foo_plugin', 'foo_plugin'),
67
- array('craft_foo_plugin', 'craft_foo_plugin'),
68
- // CamelCase
69
- array('Foo', 'Foo'),
70
- array('CraftFoo', 'CraftFoo'),
71
- array('FooPlugin', 'FooPlugin'),
72
- array('CraftFooPlugin', 'CraftFooPlugin'),
73
- // CamelCase - Dash
74
- array('Craft-Foo', 'Foo'),
75
- array('Foo-Plugin', 'Foo'),
76
- array('Craft-Foo-Plugin', 'Foo'),
77
- // CamelCase - underscore
78
- array('Craft_Foo', 'Craft_Foo'),
79
- array('Foo_Plugin', 'Foo_Plugin'),
80
- array('Craft_Foo_Plugin', 'Craft_Foo_Plugin'),
81
- );
82
- }
83
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/DokuWikiInstallerTest.php DELETED
@@ -1,90 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\DokuWikiInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
- use PHPUnit\Framework\TestCase as BaseTestCase;
8
-
9
- class DokuWikiInstallerTest extends BaseTestCase
10
- {
11
- /**
12
- * @var DokuWikiInstaller
13
- */
14
- private $installer;
15
-
16
- public function setUp()
17
- {
18
- $this->installer = new DokuWikiInstaller(
19
- new Package('NyanCat', '4.2', '4.2'),
20
- new Composer()
21
- );
22
- }
23
-
24
- /**
25
- * @dataProvider packageNameInflectionProvider
26
- */
27
- public function testInflectPackageVars($type, $name, $expected)
28
- {
29
- $this->assertEquals(
30
- $this->installer->inflectPackageVars(array('name' => $name, 'type'=>$type)),
31
- array('name' => $expected, 'type'=>$type)
32
- );
33
- }
34
-
35
- public function packageNameInflectionProvider()
36
- {
37
- return array(
38
- array(
39
- 'dokuwiki-plugin',
40
- 'dokuwiki-test-plugin',
41
- 'test',
42
- ),
43
- array(
44
- 'dokuwiki-plugin',
45
- 'test-plugin',
46
- 'test',
47
- ),
48
- array(
49
- 'dokuwiki-plugin',
50
- 'dokuwiki_test',
51
- 'test',
52
- ),
53
- array(
54
- 'dokuwiki-plugin',
55
- 'test',
56
- 'test',
57
- ),
58
- array(
59
- 'dokuwiki-plugin',
60
- 'test-template',
61
- 'test-template',
62
- ),
63
- array(
64
- 'dokuwiki-template',
65
- 'dokuwiki-test-template',
66
- 'test',
67
- ),
68
- array(
69
- 'dokuwiki-template',
70
- 'test-template',
71
- 'test',
72
- ),
73
- array(
74
- 'dokuwiki-template',
75
- 'dokuwiki_test',
76
- 'test',
77
- ),
78
- array(
79
- 'dokuwiki-template',
80
- 'test',
81
- 'test',
82
- ),
83
- array(
84
- 'dokuwiki-template',
85
- 'test-plugin',
86
- 'test-plugin',
87
- ),
88
- );
89
- }
90
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/GravInstallerTest.php DELETED
@@ -1,63 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Composer;
5
- use Composer\Installers\GravInstaller;
6
-
7
- class GravInstallerTest extends TestCase
8
- {
9
- /* @var \Composer\Composer */
10
- protected $composer;
11
-
12
- public function setUp()
13
- {
14
- $this->composer = new Composer();
15
- }
16
-
17
- public function testInflectPackageVars()
18
- {
19
- $package = $this->getPackage('vendor/name', '0.0.0');
20
- $installer = new GravInstaller($package, $this->composer);
21
- $packageVars = $this->getPackageVars($package);
22
-
23
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => 'test')));
24
- $this->assertEquals('test', $result['name']);
25
-
26
- foreach ($installer->getLocations() as $name => $location) {
27
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "$name-test")));
28
- $this->assertEquals('test', $result['name']);
29
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "test-$name")));
30
- $this->assertEquals('test', $result['name']);
31
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "$name-test-test")));
32
- $this->assertEquals('test-test', $result['name']);
33
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "test-test-$name")));
34
- $this->assertEquals('test-test', $result['name']);
35
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "grav-$name-test")));
36
- $this->assertEquals('test', $result['name']);
37
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "grav-test-$name")));
38
- $this->assertEquals('test', $result['name']);
39
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "grav-$name-test-test")));
40
- $this->assertEquals('test-test', $result['name']);
41
- $result = $installer->inflectPackageVars(array_merge($packageVars, array('name' => "grav-test-test-$name")));
42
- $this->assertEquals('test-test', $result['name']);
43
- }
44
- }
45
-
46
- /**
47
- * @param $package \Composer\Package\PackageInterface
48
- */
49
- public function getPackageVars($package)
50
- {
51
- $type = $package->getType();
52
-
53
- $prettyName = $package->getPrettyName();
54
- if (strpos($prettyName, '/') !== false) {
55
- list($vendor, $name) = explode('/', $prettyName);
56
- } else {
57
- $vendor = '';
58
- $name = $prettyName;
59
- }
60
-
61
- return compact('name', 'vendor', 'type');
62
- }
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/InstallerTest.php DELETED
@@ -1,552 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\Installer;
5
- use Composer\Util\Filesystem;
6
- use Composer\Package\Package;
7
- use Composer\Package\RootPackage;
8
- use Composer\Composer;
9
- use Composer\Config;
10
-
11
- class InstallerTest extends TestCase
12
- {
13
- private $composer;
14
- private $config;
15
- private $vendorDir;
16
- private $binDir;
17
- private $dm;
18
- private $repository;
19
- private $io;
20
- private $fs;
21
-
22
- /**
23
- * setUp
24
- *
25
- * @return void
26
- */
27
- public function setUp()
28
- {
29
- $this->fs = new Filesystem;
30
-
31
- $this->composer = new Composer();
32
- $this->config = new Config();
33
- $this->composer->setConfig($this->config);
34
-
35
- $this->vendorDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'baton-test-vendor';
36
- $this->ensureDirectoryExistsAndClear($this->vendorDir);
37
-
38
- $this->binDir = realpath(sys_get_temp_dir()) . DIRECTORY_SEPARATOR . 'baton-test-bin';
39
- $this->ensureDirectoryExistsAndClear($this->binDir);
40
-
41
- $this->config->merge(array(
42
- 'config' => array(
43
- 'vendor-dir' => $this->vendorDir,
44
- 'bin-dir' => $this->binDir,
45
- ),
46
- ));
47
-
48
- $this->dm = $this->getMockBuilder('Composer\Downloader\DownloadManager')
49
- ->disableOriginalConstructor()
50
- ->getMock();
51
- $this->composer->setDownloadManager($this->dm);
52
-
53
- $this->repository = $this->getMock('Composer\Repository\InstalledRepositoryInterface');
54
- $this->io = $this->getMock('Composer\IO\IOInterface');
55
- }
56
-
57
- /**
58
- * tearDown
59
- *
60
- * @return void
61
- */
62
- public function tearDown()
63
- {
64
- $this->fs->removeDirectory($this->vendorDir);
65
- $this->fs->removeDirectory($this->binDir);
66
- }
67
-
68
- /**
69
- * testSupports
70
- *
71
- * @return void
72
- *
73
- * @dataProvider dataForTestSupport
74
- */
75
- public function testSupports($type, $expected)
76
- {
77
- $installer = new Installer($this->io, $this->composer);
78
- $this->assertSame($expected, $installer->supports($type), sprintf('Failed to show support for %s', $type));
79
- }
80
-
81
- /**
82
- * dataForTestSupport
83
- */
84
- public function dataForTestSupport()
85
- {
86
- return array(
87
- array('agl-module', true),
88
- array('aimeos-extension', true),
89
- array('annotatecms-module', true),
90
- array('annotatecms-component', true),
91
- array('annotatecms-service', true),
92
- array('attogram-module', true),
93
- array('bitrix-module', true),
94
- array('bitrix-component', true),
95
- array('bitrix-theme', true),
96
- array('bonefish-package', true),
97
- array('cakephp', false),
98
- array('cakephp-', false),
99
- array('cakephp-app', false),
100
- array('cakephp-plugin', true),
101
- array('chef-cookbook', true),
102
- array('chef-role', true),
103
- array('cockpit-module', true),
104
- array('codeigniter-app', false),
105
- array('codeigniter-library', true),
106
- array('codeigniter-third-party', true),
107
- array('codeigniter-module', true),
108
- array('concrete5-block', true),
109
- array('concrete5-package', true),
110
- array('concrete5-theme', true),
111
- array('concrete5-core', true),
112
- array('concrete5-update', true),
113
- array('craft-plugin', true),
114
- array('croogo-plugin', true),
115
- array('croogo-theme', true),
116
- array('decibel-app', true),
117
- array('dokuwiki-plugin', true),
118
- array('dokuwiki-template', true),
119
- array('drupal-module', true),
120
- array('dolibarr-module', true),
121
- array('ee3-theme', true),
122
- array('ee3-addon', true),
123
- array('ee2-theme', true),
124
- array('ee2-addon', true),
125
- array('elgg-plugin', true),
126
- array('eliasis-component', true),
127
- array('eliasis-module', true),
128
- array('eliasis-plugin', true),
129
- array('eliasis-template', true),
130
- array('ezplatform-assets', true),
131
- array('ezplatform-meta-assets', true),
132
- array('fuel-module', true),
133
- array('fuel-package', true),
134
- array('fuel-theme', true),
135
- array('fuelphp-component', true),
136
- array('hurad-plugin', true),
137
- array('hurad-theme', true),
138
- array('imagecms-template', true),
139
- array('imagecms-module', true),
140
- array('imagecms-library', true),
141
- array('itop-extension', true),
142
- array('joomla-library', true),
143
- array('kanboard-plugin', true),
144
- array('kirby-plugin', true),
145
- array('kohana-module', true),
146
- array('lms-plugin', true),
147
- array('lms-template', true),
148
- array('lms-document-template', true),
149
- array('lms-userpanel-module', true),
150
- array('laravel-library', true),
151
- array('lavalite-theme', true),
152
- array('lavalite-package', true),
153
- array('lithium-library', true),
154
- array('magento-library', true),
155
- array('majima-plugin', true),
156
- array('mako-package', true),
157
- array('modx-extra', true),
158
- array('modxevo-snippet', true),
159
- array('modxevo-plugin', true),
160
- array('modxevo-module', true),
161
- array('modxevo-template', true),
162
- array('modxevo-lib', true),
163
- array('mediawiki-extension', true),
164
- array('mediawiki-skin', true),
165
- array('microweber-module', true),
166
- array('modulework-module', true),
167
- array('moodle-mod', true),
168
- array('october-module', true),
169
- array('october-plugin', true),
170
- array('piwik-plugin', true),
171
- array('pxcms-module', true),
172
- array('pxcms-theme', true),
173
- array('phpbb-extension', true),
174
- array('pimcore-plugin', true),
175
- array('plentymarkets-plugin', true),
176
- array('ppi-module', true),
177
- array('prestashop-module', true),
178
- array('prestashop-theme', true),
179
- array('puppet-module', true),
180
- array('porto-container', true),
181
- array('radphp-bundle', true),
182
- array('redaxo-addon', true),
183
- array('redaxo-bestyle-plugin', true),
184
- array('reindex-theme', true),
185
- array('reindex-plugin', true),
186
- array('roundcube-plugin', true),
187
- array('shopware-backend-plugin', true),
188
- array('shopware-core-plugin', true),
189
- array('shopware-frontend-plugin', true),
190
- array('shopware-theme', true),
191
- array('shopware-plugin', true),
192
- array('shopware-frontend-theme', true),
193
- array('silverstripe-module', true),
194
- array('silverstripe-theme', true),
195
- array('smf-module', true),
196
- array('smf-theme', true),
197
- array('sydes-module', true),
198
- array('sydes-theme', true),
199
- array('symfony1-plugin', true),
200
- array('thelia-module', true),
201
- array('thelia-frontoffice-template', true),
202
- array('thelia-backoffice-template', true),
203
- array('thelia-email-template', true),
204
- array('tusk-task', true),
205
- array('tusk-asset', true),
206
- array('typo3-flow-plugin', true),
207
- array('typo3-cms-extension', true),
208
- array('userfrosting-sprinkle', true),
209
- array('vanilla-plugin', true),
210
- array('vanilla-theme', true),
211
- array('whmcs-gateway', true),
212
- array('wolfcms-plugin', true),
213
- array('wordpress-plugin', true),
214
- array('wordpress-core', false),
215
- array('yawik-module', true),
216
- array('zend-library', true),
217
- array('zikula-module', true),
218
- array('zikula-theme', true),
219
- array('kodicms-plugin', true),
220
- array('kodicms-media', true),
221
- array('phifty-bundle', true),
222
- array('phifty-library', true),
223
- array('phifty-framework', true),
224
- array('osclass-plugin', true),
225
- array('osclass-theme', true),
226
- array('osclass-language', true),
227
- );
228
- }
229
-
230
- /**
231
- * testInstallPath
232
- *
233
- * @dataProvider dataForTestInstallPath
234
- */
235
- public function testInstallPath($type, $path, $name, $version = '1.0.0')
236
- {
237
- $installer = new Installer($this->io, $this->composer);
238
- $package = new Package($name, $version, $version);
239
-
240
- $package->setType($type);
241
- $result = $installer->getInstallPath($package);
242
- $this->assertEquals($path, $result);
243
- }
244
-
245
- /**
246
- * dataFormTestInstallPath
247
- */
248
- public function dataForTestInstallPath()
249
- {
250
- return array(
251
- array('agl-module', 'More/MyTestPackage/', 'agl/my_test-package'),
252
- array('aimeos-extension', 'ext/ai-test/', 'author/ai-test'),
253
- array('annotatecms-module', 'addons/modules/my_module/', 'vysinsky/my_module'),
254
- array('annotatecms-component', 'addons/components/my_component/', 'vysinsky/my_component'),
255
- array('annotatecms-service', 'addons/services/my_service/', 'vysinsky/my_service'),
256
- array('attogram-module', 'modules/my_module/', 'author/my_module'),
257
- array('bitrix-module', 'bitrix/modules/my_module/', 'author/my_module'),
258
- array('bitrix-component', 'bitrix/components/my_component/', 'author/my_component'),
259
- array('bitrix-theme', 'bitrix/templates/my_theme/', 'author/my_theme'),
260
- array('bitrix-d7-module', 'bitrix/modules/author.my_module/', 'author/my_module'),
261
- array('bitrix-d7-component', 'bitrix/components/author/my_component/', 'author/my_component'),
262
- array('bitrix-d7-template', 'bitrix/templates/author_my_template/', 'author/my_template'),
263
- array('bonefish-package', 'Packages/bonefish/package/', 'bonefish/package'),
264
- array('cakephp-plugin', 'Plugin/Ftp/', 'shama/ftp'),
265
- array('chef-cookbook', 'Chef/mre/my_cookbook/', 'mre/my_cookbook'),
266
- array('chef-role', 'Chef/roles/my_role/', 'mre/my_role'),
267
- array('cockpit-module', 'cockpit/modules/addons/My_module/', 'piotr-cz/cockpit-my_module'),
268
- array('codeigniter-library', 'application/libraries/my_package/', 'shama/my_package'),
269
- array('codeigniter-module', 'application/modules/my_package/', 'shama/my_package'),
270
- array('concrete5-block', 'application/blocks/concrete5_block/', 'remo/concrete5_block'),
271
- array('concrete5-package', 'packages/concrete5_package/', 'remo/concrete5_package'),
272
- array('concrete5-theme', 'application/themes/concrete5_theme/', 'remo/concrete5_theme'),
273
- array('concrete5-core', 'concrete/', 'concrete5/core'),
274
- array('concrete5-update', 'updates/concrete5/', 'concrete5/concrete5'),
275
- array('craft-plugin', 'craft/plugins/my_plugin/', 'mdcpepper/my_plugin'),
276
- array('croogo-plugin', 'Plugin/Sitemaps/', 'fahad19/sitemaps'),
277
- array('croogo-theme', 'View/Themed/Readable/', 'rchavik/readable'),
278
- array('decibel-app', 'app/someapp/', 'author/someapp'),
279
- array('dokuwiki-plugin', 'lib/plugins/someplugin/', 'author/someplugin'),
280
- array('dokuwiki-template', 'lib/tpl/sometemplate/', 'author/sometemplate'),
281
- array('dolibarr-module', 'htdocs/custom/my_module/', 'shama/my_module'),
282
- array('drupal-module', 'modules/my_module/', 'shama/my_module'),
283
- array('drupal-theme', 'themes/my_module/', 'shama/my_module'),
284
- array('drupal-profile', 'profiles/my_module/', 'shama/my_module'),
285
- array('drupal-drush', 'drush/my_module/', 'shama/my_module'),
286
- array('elgg-plugin', 'mod/sample_plugin/', 'test/sample_plugin'),
287
- array('eliasis-component', 'components/my_component/', 'shama/my_component'),
288
- array('eliasis-module', 'modules/my_module/', 'shama/my_module'),
289
- array('eliasis-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
290
- array('eliasis-template', 'templates/my_template/', 'shama/my_template'),
291
- array('ee3-addon', 'system/user/addons/ee_theme/', 'author/ee_theme'),
292
- array('ee3-theme', 'themes/user/ee_package/', 'author/ee_package'),
293
- array('ee2-addon', 'system/expressionengine/third_party/ee_theme/', 'author/ee_theme'),
294
- array('ee2-theme', 'themes/third_party/ee_package/', 'author/ee_package'),
295
- array('ezplatform-assets', 'web/assets/ezplatform/ezplatform_comp/', 'author/ezplatform_comp'),
296
- array('ezplatform-meta-assets', 'web/assets/ezplatform/', 'author/ezplatform_comp'),
297
- array('fuel-module', 'fuel/app/modules/module/', 'fuel/module'),
298
- array('fuel-package', 'fuel/packages/orm/', 'fuel/orm'),
299
- array('fuel-theme', 'fuel/app/themes/theme/', 'fuel/theme'),
300
- array('fuelphp-component', 'components/demo/', 'fuelphp/demo'),
301
- array('hurad-plugin', 'plugins/Akismet/', 'atkrad/akismet'),
302
- array('hurad-theme', 'plugins/Hurad2013/', 'atkrad/Hurad2013'),
303
- array('imagecms-template', 'templates/my_template/', 'shama/my_template'),
304
- array('imagecms-module', 'application/modules/my_module/', 'shama/my_module'),
305
- array('imagecms-library', 'application/libraries/my_library/', 'shama/my_library'),
306
- array('itop-extension', 'extensions/my_extension/', 'shama/my_extension'),
307
- array('joomla-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
308
- array('kanboard-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
309
- array('kirby-plugin', 'site/plugins/my_plugin/', 'shama/my_plugin'),
310
- array('kohana-module', 'modules/my_package/', 'shama/my_package'),
311
- array('lms-plugin', 'plugins/MyPackage/', 'shama/MyPackage'),
312
- array('lms-plugin', 'plugins/MyPackage/', 'shama/my_package'),
313
- array('lms-template', 'templates/MyPackage/', 'shama/MyPackage'),
314
- array('lms-template', 'templates/MyPackage/', 'shama/my_package'),
315
- array('lms-document-template', 'documents/templates/MyPackage/', 'shama/MyPackage'),
316
- array('lms-document-template', 'documents/templates/MyPackage/', 'shama/my_package'),
317
- array('lms-userpanel-module', 'userpanel/modules/MyPackage/', 'shama/MyPackage'),
318
- array('lms-userpanel-module', 'userpanel/modules/MyPackage/', 'shama/my_package'),
319
- array('laravel-library', 'libraries/my_package/', 'shama/my_package'),
320
- array('lavalite-theme', 'public/themes/my_theme/', 'shama/my_theme'),
321
- array('lavalite-package', 'packages/my_group/my_package/', 'my_group/my_package'),
322
- array('lithium-library', 'libraries/li3_test/', 'user/li3_test'),
323
- array('magento-library', 'lib/foo/', 'test/foo'),
324
- array('majima-plugin', 'plugins/MyPlugin/', 'shama/my-plugin'),
325
- array('modx-extra', 'core/packages/extra/', 'vendor/extra'),
326
- array('modxevo-snippet', 'assets/snippets/my_snippet/', 'shama/my_snippet'),
327
- array('modxevo-plugin', 'assets/plugins/my_plugin/', 'shama/my_plugin'),
328
- array('modxevo-module', 'assets/modules/my_module/', 'shama/my_module'),
329
- array('modxevo-template', 'assets/templates/my_template/', 'shama/my_template'),
330
- array('modxevo-lib', 'assets/lib/my_lib/', 'shama/my_lib'),
331
- array('mako-package', 'app/packages/my_package/', 'shama/my_package'),
332
- array('mediawiki-extension', 'extensions/APC/', 'author/APC'),
333
- array('mediawiki-extension', 'extensions/APC/', 'author/APC-extension'),
334
- array('mediawiki-extension', 'extensions/UploadWizard/', 'author/upload-wizard'),
335
- array('mediawiki-extension', 'extensions/SyntaxHighlight_GeSHi/', 'author/syntax-highlight_GeSHi'),
336
- array('mediawiki-skin', 'skins/someskin/', 'author/someskin-skin'),
337
- array('mediawiki-skin', 'skins/someskin/', 'author/someskin'),
338
- array('microweber-module', 'userfiles/modules/my-thing/', 'author/my-thing-module'),
339
- array('modulework-module', 'modules/my_package/', 'shama/my_package'),
340
- array('moodle-mod', 'mod/my_package/', 'shama/my_package'),
341
- array('october-module', 'modules/my_plugin/', 'shama/my_plugin'),
342
- array('october-plugin', 'plugins/shama/my_plugin/', 'shama/my_plugin'),
343
- array('october-theme', 'themes/my_theme/', 'shama/my_theme'),
344
- array('piwik-plugin', 'plugins/VisitSummary/', 'shama/visit-summary'),
345
- array('prestashop-module', 'modules/a-module/', 'vendor/a-module'),
346
- array('prestashop-theme', 'themes/a-theme/', 'vendor/a-theme'),
347
- array('pxcms-module', 'app/Modules/Foo/', 'vendor/module-foo'),
348
- array('pxcms-module', 'app/Modules/Foo/', 'vendor/pxcms-foo'),
349
- array('pxcms-theme', 'themes/Foo/', 'vendor/theme-foo'),
350
- array('pxcms-theme', 'themes/Foo/', 'vendor/pxcms-foo'),
351
- array('phpbb-extension', 'ext/test/foo/', 'test/foo'),
352
- array('phpbb-style', 'styles/foo/', 'test/foo'),
353
- array('phpbb-language', 'language/foo/', 'test/foo'),
354
- array('pimcore-plugin', 'plugins/MyPlugin/', 'ubikz/my_plugin'),
355
- array('plentymarkets-plugin', 'HelloWorld/', 'plugin-hello-world'),
356
- array('ppi-module', 'modules/foo/', 'test/foo'),
357
- array('puppet-module', 'modules/puppet-name/', 'puppet/puppet-name'),
358
- array('porto-container', 'app/Containers/container-name/', 'test/container-name'),
359
- array('radphp-bundle', 'src/Migration/', 'atkrad/migration'),
360
- array('redaxo-addon', 'redaxo/include/addons/my_plugin/', 'shama/my_plugin'),
361
- array('redaxo-bestyle-plugin', 'redaxo/include/addons/be_style/plugins/my_plugin/', 'shama/my_plugin'),
362
- array('reindex-theme', 'themes/my_module/', 'author/my_module'),
363
- array('reindex-plugin', 'plugins/my_module/', 'author/my_module'),
364
- array('roundcube-plugin', 'plugins/base/', 'test/base'),
365
- array('roundcube-plugin', 'plugins/replace_dash/', 'test/replace-dash'),
366
- array('shopware-backend-plugin', 'engine/Shopware/Plugins/Local/Backend/ShamaMyBackendPlugin/', 'shama/my-backend-plugin'),
367
- array('shopware-core-plugin', 'engine/Shopware/Plugins/Local/Core/ShamaMyCorePlugin/', 'shama/my-core-plugin'),
368
- array('shopware-frontend-plugin', 'engine/Shopware/Plugins/Local/Frontend/ShamaMyFrontendPlugin/', 'shama/my-frontend-plugin'),
369
- array('shopware-theme', 'templates/my_theme/', 'shama/my-theme'),
370
- array('shopware-frontend-theme', 'themes/Frontend/ShamaMyFrontendTheme/', 'shama/my-frontend-theme'),
371
- array('shopware-plugin', 'custom/plugins/ShamaMyPlugin/', 'shama/my-plugin'),
372
- array('silverstripe-module', 'my_module/', 'shama/my_module'),
373
- array('silverstripe-module', 'sapphire/', 'silverstripe/framework', '2.4.0'),
374
- array('silverstripe-module', 'framework/', 'silverstripe/framework', '3.0.0'),
375
- array('silverstripe-module', 'framework/', 'silverstripe/framework', '3.0.0-rc1'),
376
- array('silverstripe-module', 'framework/', 'silverstripe/framework', 'my/branch'),
377
- array('silverstripe-theme', 'themes/my_theme/', 'shama/my_theme'),
378
- array('smf-module', 'Sources/my_module/', 'shama/my_module'),
379
- array('smf-theme', 'Themes/my_theme/', 'shama/my_theme'),
380
- array('symfony1-plugin', 'plugins/sfShamaPlugin/', 'shama/sfShamaPlugin'),
381
- array('symfony1-plugin', 'plugins/sfShamaPlugin/', 'shama/sf-shama-plugin'),
382
- array('thelia-module', 'local/modules/my_module/', 'shama/my_module'),
383
- array('thelia-frontoffice-template', 'templates/frontOffice/my_template_fo/', 'shama/my_template_fo'),
384
- array('thelia-backoffice-template', 'templates/backOffice/my_template_bo/', 'shama/my_template_bo'),
385
- array('thelia-email-template', 'templates/email/my_template_email/', 'shama/my_template_email'),
386
- array('tusk-task', '.tusk/tasks/my_task/', 'shama/my_task'),
387
- array('typo3-flow-package', 'Packages/Application/my_package/', 'shama/my_package'),
388
- array('typo3-flow-build', 'Build/my_package/', 'shama/my_package'),
389
- array('typo3-cms-extension', 'typo3conf/ext/my_extension/', 'shama/my_extension'),
390
- array('userfrosting-sprinkle', 'app/sprinkles/my_sprinkle/', 'shama/my_sprinkle'),
391
- array('vanilla-plugin', 'plugins/my_plugin/', 'shama/my_plugin'),
392
- array('vanilla-theme', 'themes/my_theme/', 'shama/my_theme'),
393
- array('whmcs-gateway', 'modules/gateways/gateway_name/', 'vendor/gateway_name'),
394
- array('wolfcms-plugin', 'wolf/plugins/my_plugin/', 'shama/my_plugin'),
395
- array('wordpress-plugin', 'wp-content/plugins/my_plugin/', 'shama/my_plugin'),
396
- array('wordpress-muplugin', 'wp-content/mu-plugins/my_plugin/', 'shama/my_plugin'),
397
- array('zend-extra', 'extras/library/zend_test/', 'shama/zend_test'),
398
- array('zikula-module', 'modules/my-test_module/', 'my/test_module'),
399
- array('zikula-theme', 'themes/my-test_theme/', 'my/test_theme'),
400
- array('kodicms-media', 'cms/media/vendor/my_media/', 'shama/my_media'),
401
- array('kodicms-plugin', 'cms/plugins/my_plugin/', 'shama/my_plugin'),
402
- array('phifty-bundle', 'bundles/core/', 'shama/core'),
403
- array('phifty-library', 'libraries/my-lib/', 'shama/my-lib'),
404
- array('phifty-framework', 'frameworks/my-framework/', 'shama/my-framework'),
405
- array('yawik-module', 'module/MyModule/', 'shama/my_module'),
406
- array('osclass-plugin', 'oc-content/plugins/sample_plugin/', 'test/sample_plugin'),
407
- array('osclass-theme', 'oc-content/themes/sample_theme/', 'test/sample_theme'),
408
- array('osclass-language', 'oc-content/languages/sample_lang/', 'test/sample_lang'),
409
- );
410
- }
411
-
412
- /**
413
- * testGetCakePHPInstallPathException
414
- *
415
- * @return void
416
- *
417
- * @expectedException \InvalidArgumentException
418
- */
419
- public function testGetCakePHPInstallPathException()
420
- {
421
- $installer = new Installer($this->io, $this->composer);
422
- $package = new Package('shama/ftp', '1.0.0', '1.0.0');
423
-
424
- $package->setType('cakephp-whoops');
425
- $result = $installer->getInstallPath($package);
426
- }
427
-
428
- /**
429
- * testCustomInstallPath
430
- */
431
- public function testCustomInstallPath()
432
- {
433
- $installer = new Installer($this->io, $this->composer);
434
- $package = new Package('shama/ftp', '1.0.0', '1.0.0');
435
- $package->setType('cakephp-plugin');
436
- $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0');
437
- $this->composer->setPackage($consumerPackage);
438
- $consumerPackage->setExtra(array(
439
- 'installer-paths' => array(
440
- 'my/custom/path/{$name}/' => array(
441
- 'shama/ftp',
442
- 'foo/bar',
443
- ),
444
- ),
445
- ));
446
- $result = $installer->getInstallPath($package);
447
- $this->assertEquals('my/custom/path/Ftp/', $result);
448
- }
449
-
450
- /**
451
- * testCustomInstallerName
452
- */
453
- public function testCustomInstallerName()
454
- {
455
- $installer = new Installer($this->io, $this->composer);
456
- $package = new Package('shama/cakephp-ftp-plugin', '1.0.0', '1.0.0');
457
- $package->setType('cakephp-plugin');
458
- $package->setExtra(array(
459
- 'installer-name' => 'FTP',
460
- ));
461
- $result = $installer->getInstallPath($package);
462
- $this->assertEquals('Plugin/FTP/', $result);
463
- }
464
-
465
- /**
466
- * testCustomTypePath
467
- */
468
- public function testCustomTypePath()
469
- {
470
- $installer = new Installer($this->io, $this->composer);
471
- $package = new Package('slbmeh/my_plugin', '1.0.0', '1.0.0');
472
- $package->setType('wordpress-plugin');
473
- $consumerPackage = new RootPackage('foo/bar', '1.0.0', '1.0.0');
474
- $this->composer->setPackage($consumerPackage);
475
- $consumerPackage->setExtra(array(
476
- 'installer-paths' => array(
477
- 'my/custom/path/{$name}/' => array(
478
- 'type:wordpress-plugin'
479
- ),
480
- ),
481
- ));
482
- $result = $installer->getInstallPath($package);
483
- $this->assertEquals('my/custom/path/my_plugin/', $result);
484
- }
485
-
486
- /**
487
- * testVendorPath
488
- */
489
- public function testVendorPath()
490
- {
491
- $installer = new Installer($this->io, $this->composer);
492
- $package = new Package('penyaskito/my_module', '1.0.0', '1.0.0');
493
- $package->setType('drupal-module');
494
- $consumerPackage = new RootPackage('drupal/drupal', '1.0.0', '1.0.0');
495
- $this->composer->setPackage($consumerPackage);
496
- $consumerPackage->setExtra(array(
497
- 'installer-paths' => array(
498
- 'modules/custom/{$name}/' => array(
499
- 'vendor:penyaskito'
500
- ),
501
- ),
502
- ));
503
- $result = $installer->getInstallPath($package);
504
- $this->assertEquals('modules/custom/my_module/', $result);
505
- }
506
-
507
- /**
508
- * testNoVendorName
509
- */
510
- public function testNoVendorName()
511
- {
512
- $installer = new Installer($this->io, $this->composer);
513
- $package = new Package('sfPhpunitPlugin', '1.0.0', '1.0.0');
514
-
515
- $package->setType('symfony1-plugin');
516
- $result = $installer->getInstallPath($package);
517
- $this->assertEquals('plugins/sfPhpunitPlugin/', $result);
518
- }
519
-
520
- /**
521
- * testTypo3Inflection
522
- */
523
- public function testTypo3Inflection()
524
- {
525
- $installer = new Installer($this->io, $this->composer);
526
- $package = new Package('typo3/fluid', '1.0.0', '1.0.0');
527
-
528
- $package->setAutoload(array(
529
- 'psr-0' => array(
530
- 'TYPO3\\Fluid' => 'Classes',
531
- ),
532
- ));
533
-
534
- $package->setType('typo3-flow-package');
535
- $result = $installer->getInstallPath($package);
536
- $this->assertEquals('Packages/Application/TYPO3.Fluid/', $result);
537
- }
538
-
539
- public function testUninstallAndDeletePackageFromLocalRepo()
540
- {
541
- $package = new Package('foo', '1.0.0', '1.0.0');
542
-
543
- $installer = $this->getMock('Composer\Installers\Installer', array('getInstallPath'), array($this->io, $this->composer));
544
- $installer->expects($this->atLeastOnce())->method('getInstallPath')->with($package)->will($this->returnValue(sys_get_temp_dir().'/foo'));
545
-
546
- $repo = $this->getMock('Composer\Repository\InstalledRepositoryInterface');
547
- $repo->expects($this->once())->method('hasPackage')->with($package)->will($this->returnValue(true));
548
- $repo->expects($this->once())->method('removePackage')->with($package);
549
-
550
- $installer->uninstall($repo, $package);
551
- }
552
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/MayaInstallerTest.php DELETED
@@ -1,62 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\MayaInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
- use PHPUnit\Framework\TestCase as BaseTestCase;
8
-
9
- class MayaInstallerTest extends BaseTestCase
10
- {
11
- /**
12
- * @var MayaInstaller
13
- */
14
- private $installer;
15
-
16
- public function setUp()
17
- {
18
- $this->installer = new MayaInstaller(
19
- new Package('NyanCat', '4.2', '4.2'),
20
- new Composer()
21
- );
22
- }
23
-
24
- /**
25
- * @dataProvider packageNameInflectionProvider
26
- */
27
- public function testInflectPackageVars($type, $name, $expected)
28
- {
29
- $this->assertEquals(
30
- array('name' => $expected, 'type' => $type),
31
- $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
32
- );
33
- }
34
-
35
- public function packageNameInflectionProvider()
36
- {
37
- return array(
38
- // Should keep module name StudlyCase
39
- array(
40
- 'maya-module',
41
- 'user-profile',
42
- 'UserProfile'
43
- ),
44
- array(
45
- 'maya-module',
46
- 'maya-module',
47
- 'Maya'
48
- ),
49
- array(
50
- 'maya-module',
51
- 'blog',
52
- 'Blog'
53
- ),
54
- // tests that exactly one '-module' is cut off
55
- array(
56
- 'maya-module',
57
- 'some-module-module',
58
- 'SomeModule',
59
- ),
60
- );
61
- }
62
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/MediaWikiInstallerTest.php DELETED
@@ -1,67 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\MediaWikiInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
- use PHPUnit\Framework\TestCase as BaseTestCase;
8
-
9
- class MediaWikiInstallerTest extends BaseTestCase
10
- {
11
- /**
12
- * @var MediaWikiInstaller
13
- */
14
- private $installer;
15
-
16
- public function setUp()
17
- {
18
- $this->installer = new MediaWikiInstaller(
19
- new Package('NyanCat', '4.2', '4.2'),
20
- new Composer()
21
- );
22
- }
23
-
24
- /**
25
- * @dataProvider packageNameInflectionProvider
26
- */
27
- public function testInflectPackageVars($type, $name, $expected)
28
- {
29
- $this->assertEquals(
30
- $this->installer->inflectPackageVars(array('name' => $name, 'type'=>$type)),
31
- array('name' => $expected, 'type'=>$type)
32
- );
33
- }
34
-
35
- public function packageNameInflectionProvider()
36
- {
37
- return array(
38
- array(
39
- 'mediawiki-extension',
40
- 'sub-page-list',
41
- 'SubPageList',
42
- ),
43
- array(
44
- 'mediawiki-extension',
45
- 'sub-page-list-extension',
46
- 'SubPageList',
47
- ),
48
- array(
49
- 'mediawiki-extension',
50
- 'semantic-mediawiki',
51
- 'SemanticMediawiki',
52
- ),
53
- // tests that exactly one '-skin' is cut off, and that skins do not get ucwords treatment like extensions
54
- array(
55
- 'mediawiki-skin',
56
- 'some-skin-skin',
57
- 'some-skin',
58
- ),
59
- // tests that names without '-skin' suffix stay valid
60
- array(
61
- 'mediawiki-skin',
62
- 'someotherskin',
63
- 'someotherskin',
64
- ),
65
- );
66
- }
67
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/OctoberInstallerTest.php DELETED
@@ -1,67 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\OctoberInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
- use PHPUnit\Framework\TestCase as BaseTestCase;
8
-
9
- class OctoberInstallerTest extends BaseTestCase
10
- {
11
- /**
12
- * @var OctoberInstaller
13
- */
14
- private $installer;
15
-
16
- public function setUp()
17
- {
18
- $this->installer = new OctoberInstaller(
19
- new Package('NyanCat', '4.2', '4.2'),
20
- new Composer()
21
- );
22
- }
23
-
24
- /**
25
- * @dataProvider packageNameInflectionProvider
26
- */
27
- public function testInflectPackageVars($type, $name, $expected)
28
- {
29
- $this->assertEquals(
30
- $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type)),
31
- array('name' => $expected, 'type' => $type)
32
- );
33
- }
34
-
35
- public function packageNameInflectionProvider()
36
- {
37
- return array(
38
- array(
39
- 'october-plugin',
40
- 'subpagelist',
41
- 'subpagelist',
42
- ),
43
- array(
44
- 'october-plugin',
45
- 'subpagelist-plugin',
46
- 'subpagelist',
47
- ),
48
- array(
49
- 'october-plugin',
50
- 'semanticoctober',
51
- 'semanticoctober',
52
- ),
53
- // tests that exactly one '-theme' is cut off
54
- array(
55
- 'october-theme',
56
- 'some-theme-theme',
57
- 'some-theme',
58
- ),
59
- // tests that names without '-theme' suffix stay valid
60
- array(
61
- 'october-theme',
62
- 'someothertheme',
63
- 'someothertheme',
64
- ),
65
- );
66
- }
67
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/OntoWikiInstallerTest.php DELETED
@@ -1,84 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\OntoWikiInstaller;
5
- use PHPUnit\Framework\TestCase as BaseTestCase;
6
-
7
- /**
8
- * Test for the OntoWikiInstaller
9
- * code was taken from DokuWikiInstaller
10
- */
11
- class OntoWikiInstallerTest extends BaseTestCase
12
- {
13
- /**
14
- * @var OntoWikiInstaller
15
- */
16
- private $installer;
17
-
18
- public function setUp()
19
- {
20
- $this->installer = new OntoWikiInstaller();
21
- }
22
-
23
- /**
24
- * @dataProvider packageNameInflectionProvider
25
- */
26
- public function testInflectPackageVars($type, $name, $expected)
27
- {
28
- $this->assertEquals(
29
- $this->installer->inflectPackageVars(array('name' => $name, 'type'=>$type)),
30
- array('name' => $expected, 'type'=>$type)
31
- );
32
- }
33
-
34
- public function packageNameInflectionProvider()
35
- {
36
- return array(
37
- array(
38
- 'ontowiki-extension',
39
- 'CSVImport.ontowiki',
40
- 'csvimport',
41
- ),
42
- array(
43
- 'ontowiki-extension',
44
- 'csvimport',
45
- 'csvimport',
46
- ),
47
- array(
48
- 'ontowiki-extension',
49
- 'some_ontowiki_extension',
50
- 'some_ontowiki_extension',
51
- ),
52
- array(
53
- 'ontowiki-extension',
54
- 'some_ontowiki_extension.ontowiki',
55
- 'some_ontowiki_extension',
56
- ),
57
- array(
58
- 'ontowiki-translation',
59
- 'de-translation.ontowiki',
60
- 'de',
61
- ),
62
- array(
63
- 'ontowiki-translation',
64
- 'en-US-translation.ontowiki',
65
- 'en-us',
66
- ),
67
- array(
68
- 'ontowiki-translation',
69
- 'en-US-translation',
70
- 'en-us',
71
- ),
72
- array(
73
- 'ontowiki-theme',
74
- 'blue-theme.ontowiki',
75
- 'blue',
76
- ),
77
- array(
78
- 'ontowiki-theme',
79
- 'blue-theme',
80
- 'blue',
81
- ),
82
- );
83
- }
84
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/PimcoreInstallerTest.php DELETED
@@ -1,44 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\PimcoreInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
-
8
- class PimcoreInstallerTest extends TestCase
9
- {
10
- private $composer;
11
- private $io;
12
-
13
- /**
14
- * setUp
15
- *
16
- * @return void
17
- */
18
- public function setUp()
19
- {
20
- $this->package = new Package('CamelCased', '1.0', '1.0');
21
- $this->io = $this->getMock('Composer\IO\PackageInterface');
22
- $this->composer = new Composer();
23
- }
24
-
25
- /**
26
- * testInflectPackageVars
27
- *
28
- * @return void
29
- */
30
- public function testInflectPackageVars()
31
- {
32
- $installer = new PimcoreInstaller($this->package, $this->composer);
33
- $result = $installer->inflectPackageVars(array('name' => 'CamelCased'));
34
- $this->assertEquals($result, array('name' => 'CamelCased'));
35
-
36
- $installer = new PimcoreInstaller($this->package, $this->composer);
37
- $result = $installer->inflectPackageVars(array('name' => 'with-dash'));
38
- $this->assertEquals($result, array('name' => 'WithDash'));
39
-
40
- $installer = new PimcoreInstaller($this->package, $this->composer);
41
- $result = $installer->inflectPackageVars(array('name' => 'with_underscore'));
42
- $this->assertEquals($result, array('name' => 'WithUnderscore'));
43
- }
44
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/PiwikInstallerTest.php DELETED
@@ -1,63 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Composer;
5
- use Composer\Installers\PiwikInstaller;
6
- use Composer\Package\Package;
7
- use Composer\Package\PackageInterface;
8
-
9
- /**
10
- * Class PiwikInstallerTest
11
- *
12
- * @package Composer\Installers\Test
13
- */
14
- class PiwikInstallerTest extends TestCase
15
- {
16
- /**
17
- * @varComposer
18
- */
19
- private $composer;
20
-
21
- /**
22
- * @var PackageInterface
23
- */
24
- private $io;
25
-
26
- /**
27
- * @var Package
28
- */
29
- private $package;
30
-
31
- /**
32
- * setUp
33
- *
34
- * @return void
35
- */
36
- public function setUp()
37
- {
38
- $this->package = new Package('VisitSummary', '1.0', '1.0');
39
- $this->io = $this->getMock('Composer\IO\PackageInterface');
40
- $this->composer = new Composer();
41
- }
42
-
43
- /**
44
- * testInflectPackageVars
45
- *
46
- * @return void
47
- */
48
- public function testInflectPackageVars()
49
- {
50
- $installer = new PiwikInstaller($this->package, $this->composer);
51
- $result = $installer->inflectPackageVars(array('name' => 'VisitSummary'));
52
- $this->assertEquals($result, array('name' => 'VisitSummary'));
53
-
54
- $installer = new PiwikInstaller($this->package, $this->composer);
55
- $result = $installer->inflectPackageVars(array('name' => 'visit-summary'));
56
- $this->assertEquals($result, array('name' => 'VisitSummary'));
57
-
58
- $installer = new PiwikInstaller($this->package, $this->composer);
59
- $result = $installer->inflectPackageVars(array('name' => 'visit_summary'));
60
- $this->assertEquals($result, array('name' => 'VisitSummary'));
61
- }
62
-
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/SiteDirectInstallerTest.php DELETED
@@ -1,120 +0,0 @@
1
- <?php
2
-
3
- namespace Composer\Installers\Test;
4
-
5
- use Composer\Composer;
6
- use Composer\Installers\SiteDirectInstaller;
7
- use Composer\Package\Package;
8
-
9
- class SiteDirectInstallerTest extends TestCase
10
- {
11
- /** @var SiteDirectInstaller $installer */
12
- protected $installer;
13
-
14
- /** @var Package */
15
- private $package;
16
-
17
- public function SetUp()
18
- {
19
- $this->package = new Package('sitedirect/some_name', '1.0.9', '1.0');
20
- $this->installer = new SiteDirectInstaller(
21
- $this->package,
22
- new Composer()
23
- );
24
-
25
- }
26
-
27
- /**
28
- * @dataProvider dataProvider
29
- */
30
- public function testInflectPackageVars($data, $expected)
31
- {
32
- $result = $this->installer->inflectPackageVars($data);
33
- $this->assertEquals($result, $expected);
34
- }
35
-
36
- /**
37
- * @dataProvider dataProvider
38
- */
39
- public function testInstallPath($data, $expected)
40
- {
41
- $result = $this->installer->inflectPackageVars($data);
42
- $path = $this->createPackage($data);
43
-
44
- // use $result to get the proper capitalization for the vendor path
45
- $expectedPath = "modules/{$result['vendor']}/{$result['name']}/";
46
- $notExpectedPath = "modules/{$data['vendor']}/{$data['name']}/";
47
- $this->assertEquals($expectedPath, $path);
48
- $this->assertNotEquals($notExpectedPath, $path);
49
- }
50
-
51
- /**
52
- * @param $data
53
- * @return string
54
- */
55
- private function createPackage($data)
56
- {
57
- $fullName = "{$data['vendor']}/{$data['name']}";
58
-
59
- $package = new Package($fullName, '1.0', '1.0');
60
- $package->setType('sitedirect-module');
61
- $installer = new SiteDirectInstaller($package, new Composer());
62
-
63
- $path = $installer->getInstallPath($package, 'sitedirect');
64
- return $path;
65
- }
66
-
67
- public function dataProvider()
68
- {
69
- return array(
70
- array(
71
- 'data' => array(
72
- 'name' => 'kernel',
73
- 'vendor' => 'sitedirect',
74
- 'type' => 'sitedirect-module',
75
- ),
76
- 'expected' => array(
77
- 'name' => 'Kernel',
78
- 'vendor' => 'SiteDirect',
79
- 'type' => 'sitedirect-module',
80
- )
81
- ),
82
- array(
83
- 'data' => array(
84
- 'name' => 'that_guy',
85
- 'vendor' => 'whatGuy',
86
- 'type' => 'sitedirect-module',
87
- ),
88
- 'expected' => array(
89
- 'name' => 'ThatGuy',
90
- 'vendor' => 'whatGuy',
91
- 'type' => 'sitedirect-module',
92
- )
93
- ),
94
- array(
95
- 'data' => array(
96
- 'name' => 'checkout',
97
- 'vendor' => 'someVendor',
98
- 'type' => 'sitedirect-plugin',
99
- ),
100
- 'expected' => array(
101
- 'name' => 'Checkout',
102
- 'vendor' => 'someVendor',
103
- 'type' => 'sitedirect-plugin',
104
- )
105
- ),
106
- array(
107
- 'data' => array(
108
- 'name' => 'checkout',
109
- 'vendor' => 'siteDirect',
110
- 'type' => 'sitedirect-plugin',
111
- ),
112
- 'expected' => array(
113
- 'name' => 'Checkout',
114
- 'vendor' => 'SiteDirect',
115
- 'type' => 'sitedirect-plugin',
116
- )
117
- ),
118
- );
119
- }
120
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/SyDESInstallerTest.php DELETED
@@ -1,82 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\SyDESInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
- use PHPUnit\Framework\TestCase as BaseTestCase;
8
-
9
- class SyDESInstallerTest extends BaseTestCase
10
- {
11
- /**
12
- * @var SyDESInstaller
13
- */
14
- private $installer;
15
-
16
- public function setUp()
17
- {
18
- $this->installer = new SyDESInstaller(
19
- new Package('NyanCat', '4.2', '4.2'),
20
- new Composer()
21
- );
22
- }
23
-
24
- /**
25
- * @dataProvider packageNameInflectionProvider
26
- */
27
- public function testInflectPackageVars($type, $name, $expected)
28
- {
29
- $this->assertEquals(
30
- array('name' => $expected, 'type' => $type),
31
- $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
32
- );
33
- }
34
-
35
- public function packageNameInflectionProvider()
36
- {
37
- return array(
38
- // modules
39
- array(
40
- 'sydes-module',
41
- 'name',
42
- 'Name'
43
- ),
44
- array(
45
- 'sydes-module',
46
- 'sample-name',
47
- 'SampleName'
48
- ),
49
- array(
50
- 'sydes-module',
51
- 'sydes-name',
52
- 'Name'
53
- ),
54
- array(
55
- 'sydes-module',
56
- 'sample-name-module',
57
- 'SampleName',
58
- ),
59
- array(
60
- 'sydes-module',
61
- 'sydes-sample-name-module',
62
- 'SampleName'
63
- ),
64
- // themes
65
- array(
66
- 'sydes-theme',
67
- 'some-theme-theme',
68
- 'some-theme',
69
- ),
70
- array(
71
- 'sydes-theme',
72
- 'sydes-sometheme',
73
- 'sometheme',
74
- ),
75
- array(
76
- 'sydes-theme',
77
- 'Sample-Name',
78
- 'sample-name'
79
- ),
80
- );
81
- }
82
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/TestCase.php DELETED
@@ -1,65 +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\Installers\Test;
14
-
15
- use Composer\Package\Version\VersionParser;
16
- use Composer\Package\Package;
17
- use Composer\Package\AliasPackage;
18
- use Composer\Package\LinkConstraint\VersionConstraint;
19
- use Composer\Util\Filesystem;
20
- use PHPUnit\Framework\TestCase as BaseTestCase;
21
-
22
- abstract class TestCase extends BaseTestCase
23
- {
24
- private static $parser;
25
-
26
- protected static function getVersionParser()
27
- {
28
- if (!self::$parser) {
29
- self::$parser = new VersionParser();
30
- }
31
-
32
- return self::$parser;
33
- }
34
-
35
- protected function getVersionConstraint($operator, $version)
36
- {
37
- return new VersionConstraint(
38
- $operator,
39
- self::getVersionParser()->normalize($version)
40
- );
41
- }
42
-
43
- protected function getPackage($name, $version)
44
- {
45
- $normVersion = self::getVersionParser()->normalize($version);
46
-
47
- return new Package($name, $normVersion, $version);
48
- }
49
-
50
- protected function getAliasPackage($package, $version)
51
- {
52
- $normVersion = self::getVersionParser()->normalize($version);
53
-
54
- return new AliasPackage($package, $normVersion, $version);
55
- }
56
-
57
- protected function ensureDirectoryExistsAndClear($directory)
58
- {
59
- $fs = new Filesystem();
60
- if (is_dir($directory)) {
61
- $fs->removeDirectory($directory);
62
- }
63
- mkdir($directory, 0777, true);
64
- }
65
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/VgmcpInstallerTest.php DELETED
@@ -1,80 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Installers\VgmcpInstaller;
5
- use Composer\Package\Package;
6
- use Composer\Composer;
7
- use PHPUnit\Framework\TestCase as BaseTestCase;
8
-
9
- class VgmcpInstallerTest extends BaseTestCase
10
- {
11
- /**
12
- * @var VgmcpInstaller
13
- */
14
- private $installer;
15
-
16
- public function setUp()
17
- {
18
- $this->installer = new VgmcpInstaller(
19
- new Package('NyanCat', '4.2', '4.2'),
20
- new Composer()
21
- );
22
- }
23
-
24
- /**
25
- * @dataProvider packageNameInflectionProvider
26
- */
27
- public function testInflectPackageVars($type, $name, $expected)
28
- {
29
- $this->assertEquals(
30
- array('name' => $expected, 'type' => $type),
31
- $this->installer->inflectPackageVars(array('name' => $name, 'type' => $type))
32
- );
33
- }
34
-
35
- public function packageNameInflectionProvider()
36
- {
37
- return array(
38
- // Should keep bundle name StudlyCase
39
- array(
40
- 'vgmcp-bundle',
41
- 'user-profile',
42
- 'UserProfile'
43
- ),
44
- array(
45
- 'vgmcp-bundle',
46
- 'vgmcp-bundle',
47
- 'Vgmcp'
48
- ),
49
- array(
50
- 'vgmcp-bundle',
51
- 'blog',
52
- 'Blog'
53
- ),
54
- // tests that exactly one '-bundle' is cut off
55
- array(
56
- 'vgmcp-bundle',
57
- 'some-bundle-bundle',
58
- 'SomeBundle',
59
- ),
60
- // tests that exactly one '-theme' is cut off
61
- array(
62
- 'vgmcp-theme',
63
- 'some-theme-theme',
64
- 'SomeTheme',
65
- ),
66
- // tests that names without '-theme' suffix stay valid
67
- array(
68
- 'vgmcp-theme',
69
- 'someothertheme',
70
- 'Someothertheme',
71
- ),
72
- // Should keep theme name StudlyCase
73
- array(
74
- 'vgmcp-theme',
75
- 'adminlte-advanced',
76
- 'AdminlteAdvanced'
77
- ),
78
- );
79
- }
80
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/Composer/Installers/Test/YawikInstallerTest.php DELETED
@@ -1,64 +0,0 @@
1
- <?php
2
- namespace Composer\Installers\Test;
3
-
4
- use Composer\Composer;
5
- use Composer\Installers\YawikInstaller;
6
- use Composer\Package\Package;
7
- use Composer\Package\PackageInterface;
8
-
9
- /**
10
- * Class YawikInstallerTest
11
- *
12
- * @package Composer\Installers\Test
13
- */
14
- class YawikInstallerTest extends TestCase
15
- {
16
- /**
17
- * @varComposer
18
- */
19
- private $composer;
20
-
21
- /**
22
- * @var PackageInterface
23
- */
24
- private $io;
25
-
26
- /**
27
- * @var Package
28
- */
29
- private $package;
30
-
31
- /**
32
- * setUp
33
- *
34
- * @return void
35
- */
36
- public function setUp()
37
- {
38
- $this->package = new Package('YawikCompanyRegistration', '1.0', '1.0');
39
- $this->io = $this->getMock('Composer\IO\PackageInterface');
40
- $this->composer = new Composer();
41
- }
42
-
43
- /**
44
- * testInflectPackageVars
45
- *
46
- * @dataProvider packageNameProvider
47
- * @return void
48
- */
49
- public function testInflectPackageVars($input)
50
- {
51
- $installer = new YawikInstaller($this->package, $this->composer);
52
- $result = $installer->inflectPackageVars(array('name' => $input));
53
- $this->assertEquals($result, array('name' => 'YawikCompanyRegistration'));
54
- }
55
-
56
- public function packageNameProvider()
57
- {
58
- return array(
59
- array('yawik-company-registration'),
60
- array('yawik_company_registration'),
61
- array('YawikCompanyRegistration')
62
- );
63
- }
64
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/installers/tests/bootstrap.php DELETED
@@ -1,4 +0,0 @@
1
- <?php
2
-
3
- $loader = require __DIR__ . '/../src/bootstrap.php';
4
- $loader->add('Composer\Installers\Test', __DIR__);
 
 
 
 
vendor/twig/twig/.travis.yml CHANGED
@@ -8,20 +8,20 @@ cache:
8
  - $HOME/.composer/cache/files
9
 
10
  php:
 
11
  - 5.4
12
  - 5.5
13
  - 5.6
14
  - 7.0
15
  - 7.1
16
- - 7.2
17
  - nightly
18
 
19
  env:
20
  - TWIG_EXT=no
 
21
 
22
  before_install:
23
- # turn off XDebug
24
- - phpenv config-rm xdebug.ini || return 0
25
 
26
  install:
27
  - travis_retry composer install
@@ -39,16 +39,10 @@ script: |
39
 
40
  matrix:
41
  fast_finish: true
42
- include:
43
- - php: 5.3
44
- dist: precise
45
  env: TWIG_EXT=yes
46
- - php: 5.3
47
- dist: precise
48
- env: TWIG_EXT=no
49
- - php: 5.4
50
  env: TWIG_EXT=yes
51
- - php: 5.5
52
- env: TWIG_EXT=yes
53
- - php: 5.6
54
  env: TWIG_EXT=yes
8
  - $HOME/.composer/cache/files
9
 
10
  php:
11
+ - 5.3
12
  - 5.4
13
  - 5.5
14
  - 5.6
15
  - 7.0
16
  - 7.1
 
17
  - nightly
18
 
19
  env:
20
  - TWIG_EXT=no
21
+ - TWIG_EXT=yes
22
 
23
  before_install:
24
+ - phpenv config-rm xdebug.ini
 
25
 
26
  install:
27
  - travis_retry composer install
39
 
40
  matrix:
41
  fast_finish: true
42
+ exclude:
43
+ - php: 7.0
 
44
  env: TWIG_EXT=yes
45
+ - php: 7.1
 
 
 
46
  env: TWIG_EXT=yes
47
+ - php: nightly
 
 
48
  env: TWIG_EXT=yes
vendor/twig/twig/CHANGELOG CHANGED
@@ -1,22 +1,3 @@
1
- * 1.35.2 (2018-03-03)
2
-
3
- * fixed a regression in the way the profiler is registered in templates
4
-
5
- * 1.35.1 (2018-03-02)
6
-
7
- * added an exception when using "===" instead of "same as"
8
- * fixed possible array to string conversion concealing actual error
9
- * made variable names deterministic in compiled templates
10
- * fixed length filter when passing an instance of IteratorAggregate
11
- * fixed Environment::resolveTemplate to accept instances of TemplateWrapper
12
-
13
- * 1.35.0 (2017-09-27)
14
-
15
- * added Twig_Profiler_Profile::reset()
16
- * fixed use TokenParser to return an empty Node
17
- * added RuntimeExtensionInterface
18
- * added circular reference detection when loading templates
19
-
20
  * 1.34.4 (2017-07-04)
21
 
22
  * added support for runtime loaders in IntegrationTestCase
@@ -161,7 +142,7 @@
161
 
162
  * fixed reserved keywords (forbids true, false, null and none keywords for variables names)
163
  * fixed support for PHP7 (Throwable support)
164
- * marked the following methods as being internals on Twig_Environment:
165
  getFunctions(), getFilters(), getTests(), getFunction(), getFilter(), getTest(),
166
  getTokenParsers(), getTags(), getNodeVisitors(), getUnaryOperators(), getBinaryOperators(),
167
  getFunctions(), getFilters(), getGlobals(), initGlobals(), initExtensions(), and initExtension()
@@ -245,7 +226,7 @@
245
  * fixed limited RCEs when in sandbox mode
246
  * deprecated Twig_Template::getEnvironment()
247
  * deprecated the _self variable for usage outside of the from and import tags
248
- * added Twig_BaseNodeVisitor to ease the compatibility of node visitors
249
  between 1.x and 2.x
250
 
251
  * 1.19.0 (2015-07-31)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  * 1.34.4 (2017-07-04)
2
 
3
  * added support for runtime loaders in IntegrationTestCase
142
 
143
  * fixed reserved keywords (forbids true, false, null and none keywords for variables names)
144
  * fixed support for PHP7 (Throwable support)
145
+ * marked the following methods as being internals on Twig_Environment:
146
  getFunctions(), getFilters(), getTests(), getFunction(), getFilter(), getTest(),
147
  getTokenParsers(), getTags(), getNodeVisitors(), getUnaryOperators(), getBinaryOperators(),
148
  getFunctions(), getFilters(), getGlobals(), initGlobals(), initExtensions(), and initExtension()
226
  * fixed limited RCEs when in sandbox mode
227
  * deprecated Twig_Template::getEnvironment()
228
  * deprecated the _self variable for usage outside of the from and import tags
229
+ * added Twig_BaseNodeVisitor to ease the compatibility of node visitors
230
  between 1.x and 2.x
231
 
232
  * 1.19.0 (2015-07-31)
vendor/twig/twig/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009-2018 by the Twig Team.
2
 
3
  Some rights reserved.
4
 
1
+ Copyright (c) 2009-2017 by the Twig Team.
2
 
3
  Some rights reserved.
4
 
vendor/twig/twig/composer.json CHANGED
@@ -44,7 +44,7 @@
44
  },
45
  "extra": {
46
  "branch-alias": {
47
- "dev-master": "1.35-dev"
48
  }
49
  }
50
  }
44
  },
45
  "extra": {
46
  "branch-alias": {
47
+ "dev-master": "1.34-dev"
48
  }
49
  }
50
  }
vendor/twig/twig/doc/advanced.rst CHANGED
@@ -800,7 +800,7 @@ The simplest way to use methods is to define them on the extension itself::
800
 
801
  public function rot13($value)
802
  {
803
- return $this->rot13Provider->rot13($value);
804
  }
805
  }
806
 
@@ -849,7 +849,7 @@ It is now possible to move the runtime logic to a new
849
 
850
  public function rot13($value)
851
  {
852
- return $this->rot13Provider->rot13($value);
853
  }
854
  }
855
 
800
 
801
  public function rot13($value)
802
  {
803
+ return $rot13Provider->rot13($value);
804
  }
805
  }
806
 
849
 
850
  public function rot13($value)
851
  {
852
+ return $rot13Provider->rot13($value);
853
  }
854
  }
855
 
vendor/twig/twig/doc/filters/length.rst CHANGED
@@ -14,8 +14,6 @@ return value of the ``count()`` method.
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:: jinja
20
 
21
  {% if users|length > 10 %}
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
  .. code-block:: jinja
18
 
19
  {% if users|length > 10 %}
vendor/twig/twig/doc/filters/replace.rst CHANGED
@@ -11,12 +11,6 @@ The ``replace`` filter formats a given string by replacing the placeholders
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
 
11
  {# outputs I like foo and bar
12
  if the foo parameter equals to the foo string. #}
13
 
 
 
 
 
 
 
14
  Arguments
15
  ---------
16
 
vendor/twig/twig/doc/functions/block.rst CHANGED
@@ -18,7 +18,7 @@ times, use the ``block`` function:
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:: jinja
18
 
19
  {% block body %}{% endblock %}
20
 
21
+ The ``block`` function can also be used to display one block of another
22
  template:
23
 
24
  .. code-block:: jinja
vendor/twig/twig/doc/templates.rst CHANGED
@@ -611,8 +611,7 @@ exist:
611
  { 2: 'foo', 4: 'bar' }
612
 
613
  {# keys as expressions (the expression must be enclosed into parentheses) -- as of Twig 1.5 #}
614
- {% set foo = 'foo' %}
615
- { (foo): 'foo', (1 + 1): 'bar', (foo ~ 'b'): 'baz' }
616
 
617
  * ``true`` / ``false``: ``true`` represents the true value, ``false``
618
  represents the false value.
611
  { 2: 'foo', 4: 'bar' }
612
 
613
  {# keys as expressions (the expression must be enclosed into parentheses) -- as of Twig 1.5 #}
614
+ { (1 + 1): 'foo', (a ~ 'b'): 'bar' }
 
615
 
616
  * ``true`` / ``false``: ``true`` represents the true value, ``false``
617
  represents the false value.
vendor/twig/twig/ext/twig/php_twig.h CHANGED
@@ -15,7 +15,7 @@
15
  #ifndef PHP_TWIG_H
16
  #define PHP_TWIG_H
17
 
18
- #define PHP_TWIG_VERSION "1.35.2"
19
 
20
  #include "php.h"
21
 
15
  #ifndef PHP_TWIG_H
16
  #define PHP_TWIG_H
17
 
18
+ #define PHP_TWIG_VERSION "1.34.4"
19
 
20
  #include "php.h"
21
 
vendor/twig/twig/ext/twig/twig.c CHANGED
@@ -870,8 +870,6 @@ PHP_FUNCTION(twig_template_get_attributes)
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
  }
@@ -887,9 +885,9 @@ PHP_FUNCTION(twig_template_get_attributes)
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
 
870
 
871
  if (null === $object) {
872
  $message = sprintf('Impossible to invoke a method ("%s") on a null variable', $item);
 
 
873
  } else {
874
  $message = sprintf('Impossible to invoke a method ("%s") on a %s variable ("%s")', $item, gettype($object), $object);
875
  }
885
  type_name = zend_zval_type_name(object);
886
  Z_ADDREF_P(object);
887
  if (Z_TYPE_P(object) == IS_NULL) {
888
+ convert_to_string_ex(&object);
889
+
890
+ TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Impossible to invoke a method (\"%s\") on a %s variable.", item, type_name);
891
  } else {
892
  convert_to_string_ex(&object);
893
 
vendor/twig/twig/lib/Twig/Compiler.php CHANGED
@@ -25,7 +25,6 @@ class Twig_Compiler implements Twig_CompilerInterface
25
  protected $sourceOffset;
26
  protected $sourceLine;
27
  protected $filename;
28
- private $varNameSalt = 0;
29
 
30
  public function __construct(Twig_Environment $env)
31
  {
@@ -79,7 +78,6 @@ class Twig_Compiler implements Twig_CompilerInterface
79
  // source code starts at 1 (as we then increment it when we encounter new lines)
80
  $this->sourceLine = 1;
81
  $this->indentation = $indentation;
82
- $this->varNameSalt = 0;
83
 
84
  if ($node instanceof Twig_Node_Module) {
85
  // to be removed in 2.0
@@ -278,7 +276,7 @@ class Twig_Compiler implements Twig_CompilerInterface
278
 
279
  public function getVarName()
280
  {
281
- return sprintf('__internal_%s', hash('sha256', __METHOD__.$this->varNameSalt++));
282
  }
283
  }
284
 
25
  protected $sourceOffset;
26
  protected $sourceLine;
27
  protected $filename;
 
28
 
29
  public function __construct(Twig_Environment $env)
30
  {
78
  // source code starts at 1 (as we then increment it when we encounter new lines)
79
  $this->sourceLine = 1;
80
  $this->indentation = $indentation;
 
81
 
82
  if ($node instanceof Twig_Node_Module) {
83
  // to be removed in 2.0
276
 
277
  public function getVarName()
278
  {
279
+ return sprintf('__internal_%s', hash('sha256', uniqid(mt_rand(), true), false));
280
  }
281
  }
282
 
vendor/twig/twig/lib/Twig/Environment.php CHANGED
@@ -16,11 +16,11 @@
16
  */
17
  class Twig_Environment
18
  {
19
- const VERSION = '1.35.2';
20
- const VERSION_ID = 13501;
21
  const MAJOR_VERSION = 1;
22
- const MINOR_VERSION = 35;
23
- const RELEASE_VERSION = 1;
24
  const EXTRA_VERSION = '';
25
 
26
  protected $charset;
@@ -58,7 +58,6 @@ class Twig_Environment
58
  private $runtimeLoaders = array();
59
  private $runtimes = array();
60
  private $optionsHash;
61
- private $loading = array();
62
 
63
  /**
64
  * Constructor.
@@ -132,14 +131,14 @@ class Twig_Environment
132
  // For BC
133
  if (is_string($this->originalCache)) {
134
  $r = new ReflectionMethod($this, 'writeCacheFile');
135
- if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
136
  @trigger_error('The Twig_Environment::writeCacheFile method is deprecated since version 1.22 and will be removed in Twig 2.0.', E_USER_DEPRECATED);
137
 
138
  $this->bcWriteCacheFile = true;
139
  }
140
 
141
  $r = new ReflectionMethod($this, 'getCacheFilename');
142
- if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
143
  @trigger_error('The Twig_Environment::getCacheFilename method is deprecated since version 1.22 and will be removed in Twig 2.0.', E_USER_DEPRECATED);
144
 
145
  $this->bcGetCacheFilename = true;
@@ -383,10 +382,6 @@ class Twig_Environment
383
  *
384
  * @param string|Twig_TemplateWrapper|Twig_Template $name The template name
385
  *
386
- * @throws Twig_Error_Loader When the template cannot be found
387
- * @throws Twig_Error_Runtime When a previously generated cache is corrupted
388
- * @throws Twig_Error_Syntax When an error occurred during compilation
389
- *
390
  * @return Twig_TemplateWrapper
391
  */
392
  public function load($name)
@@ -477,22 +472,7 @@ class Twig_Environment
477
  $this->initRuntime();
478
  }
479
 
480
- if (isset($this->loading[$cls])) {
481
- throw new Twig_Error_Runtime(sprintf('Circular reference detected for Twig template "%s", path: %s.', $name, implode(' -> ', array_merge($this->loading, array($name)))));
482
- }
483
-
484
- $this->loading[$cls] = $name;
485
-
486
- try {
487
- $this->loadedTemplates[$cls] = new $cls($this);
488
- unset($this->loading[$cls]);
489
- } catch (\Exception $e) {
490
- unset($this->loading[$cls]);
491
-
492
- throw $e;
493
- }
494
-
495
- return $this->loadedTemplates[$cls];
496
  }
497
 
498
  /**
@@ -562,12 +542,12 @@ class Twig_Environment
562
  /**
563
  * Tries to load a template consecutively from an array.
564
  *
565
- * Similar to loadTemplate() but it also accepts instances of Twig_Template and
566
- * Twig_TemplateWrapper, and an array of templates where each is tried to be loaded.
567
  *
568
- * @param string|Twig_Template|Twig_TemplateWrapper|array $names A template or an array of templates to try consecutively
569
  *
570
- * @return Twig_Template|Twig_TemplateWrapper
571
  *
572
  * @throws Twig_Error_Loader When none of the templates can be found
573
  * @throws Twig_Error_Syntax When an error occurred during compilation
@@ -583,10 +563,6 @@ class Twig_Environment
583
  return $name;
584
  }
585
 
586
- if ($name instanceof Twig_TemplateWrapper) {
587
- return $name;
588
- }
589
-
590
  try {
591
  return $this->loadTemplate($name);
592
  } catch (Twig_Error_Loader $e) {
16
  */
17
  class Twig_Environment
18
  {
19
+ const VERSION = '1.34.4';
20
+ const VERSION_ID = 13404;
21
  const MAJOR_VERSION = 1;
22
+ const MINOR_VERSION = 34;
23
+ const RELEASE_VERSION = 4;
24
  const EXTRA_VERSION = '';
25
 
26
  protected $charset;
58
  private $runtimeLoaders = array();
59
  private $runtimes = array();
60
  private $optionsHash;
 
61
 
62
  /**
63
  * Constructor.
131
  // For BC
132
  if (is_string($this->originalCache)) {
133
  $r = new ReflectionMethod($this, 'writeCacheFile');
134
+ if ($r->getDeclaringClass()->getName() !== __CLASS__) {
135
  @trigger_error('The Twig_Environment::writeCacheFile method is deprecated since version 1.22 and will be removed in Twig 2.0.', E_USER_DEPRECATED);
136
 
137
  $this->bcWriteCacheFile = true;
138
  }
139
 
140
  $r = new ReflectionMethod($this, 'getCacheFilename');
141
+ if ($r->getDeclaringClass()->getName() !== __CLASS__) {
142
  @trigger_error('The Twig_Environment::getCacheFilename method is deprecated since version 1.22 and will be removed in Twig 2.0.', E_USER_DEPRECATED);
143
 
144
  $this->bcGetCacheFilename = true;
382
  *
383
  * @param string|Twig_TemplateWrapper|Twig_Template $name The template name
384
  *
 
 
 
 
385
  * @return Twig_TemplateWrapper
386
  */
387
  public function load($name)
472
  $this->initRuntime();
473
  }
474
 
475
+ return $this->loadedTemplates[$cls] = new $cls($this);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
476
  }
477
 
478
  /**
542
  /**
543
  * Tries to load a template consecutively from an array.
544
  *
545
+ * Similar to loadTemplate() but it also accepts Twig_TemplateInterface instances and an array
546
+ * of templates where each is tried to be loaded.
547
  *
548
+ * @param string|Twig_Template|array $names A template or an array of templates to try consecutively
549
  *
550
+ * @return Twig_Template
551
  *
552
  * @throws Twig_Error_Loader When none of the templates can be found
553
  * @throws Twig_Error_Syntax When an error occurred during compilation
563
  return $name;
564
  }
565
 
 
 
 
 
566
  try {
567
  return $this->loadTemplate($name);
568
  } catch (Twig_Error_Loader $e) {
vendor/twig/twig/lib/Twig/ExpressionParser.php CHANGED
@@ -199,14 +199,11 @@ class Twig_ExpressionParser
199
  break;
200
  }
201
 
202
- // no break
203
  default:
204
  if ($token->test(Twig_Token::PUNCTUATION_TYPE, '[')) {
205
  $node = $this->parseArrayExpression();
206
  } elseif ($token->test(Twig_Token::PUNCTUATION_TYPE, '{')) {
207
  $node = $this->parseHashExpression();
208
- } elseif ($token->test(Twig_Token::OPERATOR_TYPE, '=') && ('==' === $this->parser->getStream()->look(-1)->getValue() || '!=' === $this->parser->getStream()->look(-1)->getValue())) {
209
- throw new Twig_Error_Syntax(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());
210
  } else {
211
  throw new Twig_Error_Syntax(sprintf('Unexpected token "%s" of value "%s".', Twig_Token::typeToEnglish($token->getType()), $token->getValue()), $token->getLine(), $this->parser->getStream()->getSourceContext());
212
  }
@@ -316,7 +313,7 @@ class Twig_ExpressionParser
316
  {
317
  while (true) {
318
  $token = $this->parser->getCurrentToken();
319
- if (Twig_Token::PUNCTUATION_TYPE == $token->getType()) {
320
  if ('.' == $token->getValue() || '[' == $token->getValue()) {
321
  $node = $this->parseSubscriptExpression($node);
322
  } elseif ('|' == $token->getValue()) {
@@ -387,14 +384,14 @@ class Twig_ExpressionParser
387
  $lineno = $token->getLine();
388
  $arguments = new Twig_Node_Expression_Array(array(), $lineno);
389
  $type = Twig_Template::ANY_CALL;
390
- if ('.' == $token->getValue()) {
391
  $token = $stream->next();
392
  if (
393
- Twig_Token::NAME_TYPE == $token->getType()
394
  ||
395
- Twig_Token::NUMBER_TYPE == $token->getType()
396
  ||
397
- (Twig_Token::OPERATOR_TYPE == $token->getType() && preg_match(Twig_Lexer::REGEX_NAME, $token->getValue()))
398
  ) {
399
  $arg = new Twig_Node_Expression_Constant($token->getValue(), $lineno);
400
 
199
  break;
200
  }
201
 
 
202
  default:
203
  if ($token->test(Twig_Token::PUNCTUATION_TYPE, '[')) {
204
  $node = $this->parseArrayExpression();
205
  } elseif ($token->test(Twig_Token::PUNCTUATION_TYPE, '{')) {
206
  $node = $this->parseHashExpression();
 
 
207
  } else {
208
  throw new Twig_Error_Syntax(sprintf('Unexpected token "%s" of value "%s".', Twig_Token::typeToEnglish($token->getType()), $token->getValue()), $token->getLine(), $this->parser->getStream()->getSourceContext());
209
  }
313
  {
314
  while (true) {
315
  $token = $this->parser->getCurrentToken();
316
+ if ($token->getType() == Twig_Token::PUNCTUATION_TYPE) {
317
  if ('.' == $token->getValue() || '[' == $token->getValue()) {
318
  $node = $this->parseSubscriptExpression($node);
319
  } elseif ('|' == $token->getValue()) {
384
  $lineno = $token->getLine();
385
  $arguments = new Twig_Node_Expression_Array(array(), $lineno);
386
  $type = Twig_Template::ANY_CALL;
387
+ if ($token->getValue() == '.') {
388
  $token = $stream->next();
389
  if (
390
+ $token->getType() == Twig_Token::NAME_TYPE
391
  ||
392
+ $token->getType() == Twig_Token::NUMBER_TYPE
393
  ||
394
+ ($token->getType() == Twig_Token::OPERATOR_TYPE && preg_match(Twig_Lexer::REGEX_NAME, $token->getValue()))
395
  ) {
396
  $arg = new Twig_Node_Expression_Constant($token->getValue(), $lineno);
397
 
vendor/twig/twig/lib/Twig/Extension/Core.php CHANGED
@@ -661,7 +661,7 @@ function twig_slice(Twig_Environment $env, $item, $start, $length = null, $prese
661
 
662
  if ($start >= 0 && $length >= 0 && $item instanceof Iterator) {
663
  try {
664
- return iterator_to_array(new LimitIterator($item, $start, null === $length ? -1 : $length), $preserveKeys);
665
  } catch (OutOfBoundsException $exception) {
666
  return array();
667
  }
@@ -1216,7 +1216,7 @@ function _twig_escape_html_attr_callback($matches)
1216
  * The following replaces characters undefined in HTML with the
1217
  * hex entity for the Unicode replacement character.
1218
  */
1219
- if (($ord <= 0x1f && "\t" != $chr && "\n" != $chr && "\r" != $chr) || ($ord >= 0x7f && $ord <= 0x9f)) {
1220
  return '&#xFFFD;';
1221
  }
1222
 
@@ -1224,7 +1224,7 @@ function _twig_escape_html_attr_callback($matches)
1224
  * Check if the current character to escape has a name entity we should
1225
  * replace it with while grabbing the hex value of the character.
1226
  */
1227
- if (1 == strlen($chr)) {
1228
  $hex = strtoupper(substr('00'.bin2hex($chr), -2));
1229
  } else {
1230
  $chr = twig_convert_encoding($chr, 'UTF-16BE', 'UTF-8');
@@ -1271,10 +1271,6 @@ if (function_exists('mb_get_info')) {
1271
  return count($thing);
1272
  }
1273
 
1274
- if ($thing instanceof \IteratorAggregate) {
1275
- return iterator_count($thing);
1276
- }
1277
-
1278
  return 1;
1279
  }
1280
 
@@ -1374,10 +1370,6 @@ else {
1374
  return count($thing);
1375
  }
1376
 
1377
- if ($thing instanceof \IteratorAggregate) {
1378
- return iterator_count($thing);
1379
- }
1380
-
1381
  return 1;
1382
  }
1383
 
@@ -1452,7 +1444,7 @@ function twig_test_empty($value)
1452
  *
1453
  * <pre>
1454
  * {# evaluates to true if the foo variable is an array or a traversable object #}
1455
- * {% if foo is iterable %}
1456
  * {# ... #}
1457
  * {% endif %}
1458
  * </pre>
661
 
662
  if ($start >= 0 && $length >= 0 && $item instanceof Iterator) {
663
  try {
664
+ return iterator_to_array(new LimitIterator($item, $start, $length === null ? -1 : $length), $preserveKeys);
665
  } catch (OutOfBoundsException $exception) {
666
  return array();
667
  }
1216
  * The following replaces characters undefined in HTML with the
1217
  * hex entity for the Unicode replacement character.
1218
  */
1219
+ if (($ord <= 0x1f && $chr != "\t" && $chr != "\n" && $chr != "\r") || ($ord >= 0x7f && $ord <= 0x9f)) {
1220
  return '&#xFFFD;';
1221
  }
1222
 
1224
  * Check if the current character to escape has a name entity we should
1225
  * replace it with while grabbing the hex value of the character.
1226
  */
1227
+ if (strlen($chr) == 1) {
1228
  $hex = strtoupper(substr('00'.bin2hex($chr), -2));
1229
  } else {
1230
  $chr = twig_convert_encoding($chr, 'UTF-16BE', 'UTF-8');
1271
  return count($thing);
1272
  }
1273
 
 
 
 
 
1274
  return 1;
1275
  }
1276
 
1370
  return count($thing);
1371
  }
1372
 
 
 
 
 
1373
  return 1;
1374
  }
1375
 
1444
  *
1445
  * <pre>
1446
  * {# evaluates to true if the foo variable is an array or a traversable object #}
1447
+ * {% if foo is traversable %}
1448
  * {# ... #}
1449
  * {% endif %}
1450
  * </pre>
vendor/twig/twig/lib/Twig/Lexer.php CHANGED
@@ -235,7 +235,7 @@ class Twig_Lexer implements Twig_LexerInterface
235
  $this->moveCursor($match[0]);
236
 
237
  if ($this->cursor >= $this->end) {
238
- throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', self::STATE_BLOCK === $this->state ? 'block' : 'variable'), $this->currentVarBlockLine, $this->source);
239
  }
240
  }
241
 
@@ -337,7 +337,7 @@ class Twig_Lexer implements Twig_LexerInterface
337
  $this->moveCursor($match[0]);
338
  } elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) {
339
  list($expect, $lineno) = array_pop($this->brackets);
340
- if ('"' != $this->code[$this->cursor]) {
341
  throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $expect), $lineno, $this->source);
342
  }
343
 
235
  $this->moveCursor($match[0]);
236
 
237
  if ($this->cursor >= $this->end) {
238
+ throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $this->state === self::STATE_BLOCK ? 'block' : 'variable'), $this->currentVarBlockLine, $this->source);
239
  }
240
  }
241
 
337
  $this->moveCursor($match[0]);
338
  } elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) {
339
  list($expect, $lineno) = array_pop($this->brackets);
340
+ if ($this->code[$this->cursor] != '"') {
341
  throw new Twig_Error_Syntax(sprintf('Unclosed "%s".', $expect), $lineno, $this->source);
342
  }
343
 
vendor/twig/twig/lib/Twig/Loader/Filesystem.php CHANGED
@@ -279,7 +279,7 @@ class Twig_Loader_Filesystem implements Twig_LoaderInterface, Twig_ExistsLoaderI
279
  {
280
  return strspn($file, '/\\', 0, 1)
281
  || (strlen($file) > 3 && ctype_alpha($file[0])
282
- && ':' === substr($file, 1, 1)
283
  && strspn($file, '/\\', 2, 1)
284
  )
285
  || null !== parse_url($file, PHP_URL_SCHEME)
279
  {
280
  return strspn($file, '/\\', 0, 1)
281
  || (strlen($file) > 3 && ctype_alpha($file[0])
282
+ && substr($file, 1, 1) === ':'
283
  && strspn($file, '/\\', 2, 1)
284
  )
285
  || null !== parse_url($file, PHP_URL_SCHEME)
vendor/twig/twig/lib/Twig/NodeVisitor/Optimizer.php CHANGED
@@ -56,7 +56,7 @@ class Twig_NodeVisitor_Optimizer extends Twig_BaseNodeVisitor
56
  if (PHP_VERSION_ID < 50400 && self::OPTIMIZE_VAR_ACCESS === (self::OPTIMIZE_VAR_ACCESS & $this->optimizers) && !$env->isStrictVariables() && !$env->hasExtension('Twig_Extension_Sandbox')) {
57
  if ($this->inABody) {
58
  if (!$node instanceof Twig_Node_Expression) {
59
- if ('Twig_Node' !== get_class($node)) {
60
  array_unshift($this->prependedNodes, array());
61
  }
62
  } else {
@@ -88,7 +88,7 @@ class Twig_NodeVisitor_Optimizer extends Twig_BaseNodeVisitor
88
  if ($node instanceof Twig_Node_Body) {
89
  $this->inABody = false;
90
  } elseif ($this->inABody) {
91
- if (!$expression && 'Twig_Node' !== get_class($node) && $prependedNodes = array_shift($this->prependedNodes)) {
92
  $nodes = array();
93
  foreach (array_unique($prependedNodes) as $name) {
94
  $nodes[] = new Twig_Node_SetTemp($name, $node->getTemplateLine());
56
  if (PHP_VERSION_ID < 50400 && self::OPTIMIZE_VAR_ACCESS === (self::OPTIMIZE_VAR_ACCESS & $this->optimizers) && !$env->isStrictVariables() && !$env->hasExtension('Twig_Extension_Sandbox')) {
57
  if ($this->inABody) {
58
  if (!$node instanceof Twig_Node_Expression) {
59
+ if (get_class($node) !== 'Twig_Node') {
60
  array_unshift($this->prependedNodes, array());
61
  }
62
  } else {
88
  if ($node instanceof Twig_Node_Body) {
89
  $this->inABody = false;
90
  } elseif ($this->inABody) {
91
+ if (!$expression && get_class($node) !== 'Twig_Node' && $prependedNodes = array_shift($this->prependedNodes)) {
92
  $nodes = array();
93
  foreach (array_unique($prependedNodes) as $name) {
94
  $nodes[] = new Twig_Node_SetTemp($name, $node->getTemplateLine());
vendor/twig/twig/lib/Twig/Parser.php CHANGED
@@ -31,7 +31,6 @@ class Twig_Parser implements Twig_ParserInterface
31
  protected $importedSymbols;
32
  protected $traits;
33
  protected $embeddedTemplates = array();
34
- private $varNameSalt = 0;
35
 
36
  public function __construct(Twig_Environment $env)
37
  {
@@ -50,7 +49,7 @@ class Twig_Parser implements Twig_ParserInterface
50
 
51
  public function getVarName()
52
  {
53
- return sprintf('__internal_%s', hash('sha256', __METHOD__.$this->varNameSalt++));
54
  }
55
 
56
  /**
@@ -99,7 +98,6 @@ class Twig_Parser implements Twig_ParserInterface
99
  $this->blockStack = array();
100
  $this->importedSymbols = array(array());
101
  $this->embeddedTemplates = array();
102
- $this->varNameSalt = 0;
103
 
104
  try {
105
  $body = $this->subparse($test, $dropNeedle);
@@ -155,7 +153,7 @@ class Twig_Parser implements Twig_ParserInterface
155
  $this->stream->next();
156
  $token = $this->getCurrentToken();
157
 
158
- if (Twig_Token::NAME_TYPE !== $token->getType()) {
159
  throw new Twig_Error_Syntax('A block must start with a tag name.', $token->getLine(), $this->stream->getSourceContext());
160
  }
161
 
@@ -385,7 +383,7 @@ class Twig_Parser implements Twig_ParserInterface
385
  throw new Twig_Error_Syntax('A template that extends another one cannot start with a byte order mark (BOM); it must be removed.', $node->getTemplateLine(), $this->stream->getSourceContext());
386
  }
387
 
388
- throw new Twig_Error_Syntax('A template that extends another one cannot include content outside Twig blocks. Did you forget to put the content inside a {% block %} tag?', $node->getTemplateLine(), $this->stream->getSourceContext());
389
  }
390
 
391
  // bypass nodes that will "capture" the output
31
  protected $importedSymbols;
32
  protected $traits;
33
  protected $embeddedTemplates = array();
 
34
 
35
  public function __construct(Twig_Environment $env)
36
  {
49
 
50
  public function getVarName()
51
  {
52
+ return sprintf('__internal_%s', hash('sha256', uniqid(mt_rand(), true), false));
53
  }
54
 
55
  /**
98
  $this->blockStack = array();
99
  $this->importedSymbols = array(array());
100
  $this->embeddedTemplates = array();
 
101
 
102
  try {
103
  $body = $this->subparse($test, $dropNeedle);
153
  $this->stream->next();
154
  $token = $this->getCurrentToken();
155
 
156
+ if ($token->getType() !== Twig_Token::NAME_TYPE) {
157
  throw new Twig_Error_Syntax('A block must start with a tag name.', $token->getLine(), $this->stream->getSourceContext());
158
  }
159
 
383
  throw new Twig_Error_Syntax('A template that extends another one cannot start with a byte order mark (BOM); it must be removed.', $node->getTemplateLine(), $this->stream->getSourceContext());
384
  }
385
 
386
+ throw new Twig_Error_Syntax('A template that extends another one cannot include contents outside Twig blocks. Did you forget to put the contents inside a {% block %} tag?', $node->getTemplateLine(), $this->stream->getSourceContext());
387
  }
388
 
389
  // bypass nodes that will "capture" the output
vendor/twig/twig/lib/Twig/Profiler/NodeVisitor/Profiler.php CHANGED
@@ -55,7 +55,7 @@ class Twig_Profiler_NodeVisitor_Profiler extends Twig_BaseNodeVisitor
55
 
56
  private function getVarName()
57
  {
58
- return sprintf('__internal_%s', hash('sha256', $this->extensionName));
59
  }
60
 
61
  public function getPriority()
55
 
56
  private function getVarName()
57
  {
58
+ return sprintf('__internal_%s', hash('sha256', uniqid(mt_rand(), true), false));
59
  }
60
 
61
  public function getPriority()
vendor/twig/twig/lib/Twig/Profiler/Profile.php CHANGED
@@ -145,12 +145,6 @@ class Twig_Profiler_Profile implements IteratorAggregate, Serializable
145
  );
146
  }
147
 
148
- public function reset()
149
- {
150
- $this->starts = $this->ends = $this->profiles = array();
151
- $this->enter();
152
- }
153
-
154
  public function getIterator()
155
  {
156
  return new ArrayIterator($this->profiles);
145
  );
146
  }
147
 
 
 
 
 
 
 
148
  public function getIterator()
149
  {
150
  return new ArrayIterator($this->profiles);
vendor/twig/twig/lib/Twig/Template.php CHANGED
@@ -568,8 +568,6 @@ abstract class Twig_Template implements Twig_TemplateInterface
568
 
569
  if (null === $object) {
570
  $message = sprintf('Impossible to invoke a method ("%s") on a null variable.', $item);
571
- } elseif (is_array($object)) {
572
- $message = sprintf('Impossible to invoke a method ("%s") on an array.', $item);
573
  } else {
574
  $message = sprintf('Impossible to invoke a method ("%s") on a %s variable ("%s").', $item, gettype($object), $object);
575
  }
@@ -698,7 +696,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
698
  }
699
  @trigger_error($message, E_USER_DEPRECATED);
700
 
701
- return '' === $ret ? '' : new Twig_Markup($ret, $this->env->getCharset());
702
  }
703
 
704
  return $ret;
568
 
569
  if (null === $object) {
570
  $message = sprintf('Impossible to invoke a method ("%s") on a null variable.', $item);
 
 
571
  } else {
572
  $message = sprintf('Impossible to invoke a method ("%s") on a %s variable ("%s").', $item, gettype($object), $object);
573
  }
696
  }
697
  @trigger_error($message, E_USER_DEPRECATED);
698
 
699
+ return $ret === '' ? '' : new Twig_Markup($ret, $this->env->getCharset());
700
  }
701
 
702
  return $ret;
vendor/twig/twig/lib/Twig/TokenParser/For.php CHANGED
@@ -40,7 +40,7 @@ class Twig_TokenParser_For extends Twig_TokenParser
40
 
41
  $stream->expect(Twig_Token::BLOCK_END_TYPE);
42
  $body = $this->parser->subparse(array($this, 'decideForFork'));
43
- if ('else' == $stream->next()->getValue()) {
44
  $stream->expect(Twig_Token::BLOCK_END_TYPE);
45
  $else = $this->parser->subparse(array($this, 'decideForEnd'), true);
46
  } else {
40
 
41
  $stream->expect(Twig_Token::BLOCK_END_TYPE);
42
  $body = $this->parser->subparse(array($this, 'decideForFork'));
43
+ if ($stream->next()->getValue() == 'else') {
44
  $stream->expect(Twig_Token::BLOCK_END_TYPE);
45
  $else = $this->parser->subparse(array($this, 'decideForEnd'), true);
46
  } else {
vendor/twig/twig/lib/Twig/TokenParser/Use.php CHANGED
@@ -57,8 +57,6 @@ class Twig_TokenParser_Use extends Twig_TokenParser
57
  $stream->expect(Twig_Token::BLOCK_END_TYPE);
58
 
59
  $this->parser->addTrait(new Twig_Node(array('template' => $template, 'targets' => new Twig_Node($targets))));
60
-
61
- return new Twig_Node();
62
  }
63
 
64
  public function getTag()
57
  $stream->expect(Twig_Token::BLOCK_END_TYPE);
58
 
59
  $this->parser->addTrait(new Twig_Node(array('template' => $template, 'targets' => new Twig_Node($targets))));
 
 
60
  }
61
 
62
  public function getTag()
vendor/twig/twig/lib/Twig/TokenParserBroker.php CHANGED
@@ -61,12 +61,12 @@ class Twig_TokenParserBroker implements Twig_TokenParserBrokerInterface
61
  }
62
  }
63
 
64
- public function addTokenParserBroker(self $broker)
65
  {
66
  $this->brokers[] = $broker;
67
  }
68
 
69
- public function removeTokenParserBroker(self $broker)
70
  {
71
  if (false !== $pos = array_search($broker, $this->brokers)) {
72
  unset($this->brokers[$pos]);
61
  }
62
  }
63
 
64
+ public function addTokenParserBroker(Twig_TokenParserBroker $broker)
65
  {
66
  $this->brokers[] = $broker;
67
  }
68
 
69
+ public function removeTokenParserBroker(Twig_TokenParserBroker $broker)
70
  {
71
  if (false !== $pos = array_search($broker, $this->brokers)) {
72
  unset($this->brokers[$pos]);
vendor/twig/twig/lib/Twig/TokenStream.php CHANGED
@@ -139,7 +139,7 @@ class Twig_TokenStream
139
  */
140
  public function isEOF()
141
  {
142
- return Twig_Token::EOF_TYPE === $this->tokens[$this->current]->getType();
143
  }
144
 
145
  /**
139
  */
140
  public function isEOF()
141
  {
142
+ return $this->tokens[$this->current]->getType() === Twig_Token::EOF_TYPE;
143
  }
144
 
145
  /**
vendor/twig/twig/phpunit.xml.dist CHANGED
@@ -9,7 +9,7 @@
9
  processIsolation="false"
10
  stopOnFailure="false"
11
  syntaxCheck="false"
12
- bootstrap="vendor/autoload.php"
13
  >
14
  <testsuites>
15
  <testsuite name="Twig Test Suite">
9
  processIsolation="false"
10
  stopOnFailure="false"
11
  syntaxCheck="false"
12
+ bootstrap="test/bootstrap.php"
13
  >
14
  <testsuites>
15
  <testsuite name="Twig Test Suite">
vendor/twig/twig/src/Extension/RuntimeExtensionInterface.php DELETED
@@ -1,19 +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
- /**
15
- * @author Grégoire Pineau <lyrixx@lyrixx.info>
16
- */
17
- interface RuntimeExtensionInterface
18
- {
19
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/twig/twig/test/Twig/Tests/AutoloaderTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_AutoloaderTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @group legacy
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_AutoloaderTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @group legacy
vendor/twig/twig/test/Twig/Tests/Cache/FilesystemTest.php CHANGED
@@ -11,7 +11,7 @@
11
 
12
  require_once dirname(dirname(__FILE__)).'/FilesystemHelper.php';
13
 
14
- class Twig_Tests_Cache_FilesystemTest extends \PHPUnit\Framework\TestCase
15
  {
16
  private $classname;
17
  private $directory;
11
 
12
  require_once dirname(dirname(__FILE__)).'/FilesystemHelper.php';
13
 
14
+ class Twig_Tests_Cache_FilesystemTest extends PHPUnit_Framework_TestCase
15
  {
16
  private $classname;
17
  private $directory;
vendor/twig/twig/test/Twig/Tests/CompilerTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_CompilerTest extends \PHPUnit\Framework\TestCase
13
  {
14
  public function testReprNumericValueWithLocale()
15
  {
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_CompilerTest extends PHPUnit_Framework_TestCase
13
  {
14
  public function testReprNumericValueWithLocale()
15
  {
vendor/twig/twig/test/Twig/Tests/ContainerRuntimeLoaderTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_ContainerRuntimeLoaderTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @requires PHP 5.3
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_ContainerRuntimeLoaderTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @requires PHP 5.3
vendor/twig/twig/test/Twig/Tests/CustomExtensionTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class CustomExtensionTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @requires PHP 5.3
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class CustomExtensionTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @requires PHP 5.3
vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php CHANGED
@@ -11,7 +11,7 @@
11
 
12
  require_once dirname(__FILE__).'/FilesystemHelper.php';
13
 
14
- class Twig_Tests_EnvironmentTest extends \PHPUnit\Framework\TestCase
15
  {
16
  private $deprecations = array();
17
 
@@ -480,33 +480,6 @@ EOF
480
  $this->assertEquals('foo', $twig->render('func_string_named_args'));
481
  }
482
 
483
- /**
484
- * @expectedException Twig_Error_Runtime
485
- * @expectedExceptionMessage Circular reference detected for Twig template "base.html.twig", path: base.html.twig -> base.html.twig in "base.html.twig" at line 1
486
- */
487
- public function testFailLoadTemplateOnCircularReference()
488
- {
489
- $twig = new Twig_Environment(new Twig_Loader_Array(array(
490
- 'base.html.twig' => '{% extends "base.html.twig" %}',
491
- )));
492
-
493
- $twig->loadTemplate('base.html.twig');
494
- }
495
-
496
- /**
497
- * @expectedException Twig_Error_Runtime
498
- * @expectedExceptionMessage Circular reference detected for Twig template "base1.html.twig", path: base1.html.twig -> base2.html.twig -> base1.html.twig in "base1.html.twig" at line 1
499
- */
500
- public function testFailLoadTemplateOnComplexCircularReference()
501
- {
502
- $twig = new Twig_Environment(new Twig_Loader_Array(array(
503
- 'base1.html.twig' => '{% extends "base2.html.twig" %}',
504
- 'base2.html.twig' => '{% extends "base1.html.twig" %}',
505
- )));
506
-
507
- $twig->loadTemplate('base1.html.twig');
508
- }
509
-
510
  protected function getMockLoader($templateName, $templateContent)
511
  {
512
  // to be removed in 2.0
11
 
12
  require_once dirname(__FILE__).'/FilesystemHelper.php';
13
 
14
+ class Twig_Tests_EnvironmentTest extends PHPUnit_Framework_TestCase
15
  {
16
  private $deprecations = array();
17
 
480
  $this->assertEquals('foo', $twig->render('func_string_named_args'));
481
  }
482
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
483
  protected function getMockLoader($templateName, $templateContent)
484
  {
485
  // to be removed in 2.0
vendor/twig/twig/test/Twig/Tests/ErrorTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_ErrorTest extends \PHPUnit\Framework\TestCase
13
  {
14
  public function testErrorWithObjectFilename()
15
  {
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_ErrorTest extends PHPUnit_Framework_TestCase
13
  {
14
  public function testErrorWithObjectFilename()
15
  {
vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_ExpressionParserTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @expectedException Twig_Error_Syntax
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_ExpressionParserTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @expectedException Twig_Error_Syntax
vendor/twig/twig/test/Twig/Tests/Extension/CoreTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_Extension_CoreTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @dataProvider getRandomFunctionTestData
@@ -264,7 +264,7 @@ class Twig_Tests_Extension_CoreTest extends \PHPUnit\Framework\TestCase
264
  array(array(), new CoreTestIterator($i, $keys, true), count($keys) + 10),
265
  array('de', 'abcdef', 3, 2),
266
  array(array(), new SimpleXMLElement('<items><item>1</item><item>2</item></items>'), 3),
267
- array(array(), new ArrayIterator(array(1, 2)), 3),
268
  );
269
  }
270
  }
@@ -344,7 +344,7 @@ final class CoreTestIterator implements Iterator
344
  {
345
  ++$this->position;
346
  if ($this->position === $this->maxPosition) {
347
- throw new LogicException(sprintf('Code should not iterate beyond %d.', $this->maxPosition));
348
  }
349
  }
350
 
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_Extension_CoreTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @dataProvider getRandomFunctionTestData
264
  array(array(), new CoreTestIterator($i, $keys, true), count($keys) + 10),
265
  array('de', 'abcdef', 3, 2),
266
  array(array(), new SimpleXMLElement('<items><item>1</item><item>2</item></items>'), 3),
267
+ array(array(), new ArrayIterator(array(1, 2)), 3)
268
  );
269
  }
270
  }
344
  {
345
  ++$this->position;
346
  if ($this->position === $this->maxPosition) {
347
+ throw new LogicException(sprintf('Code should not iterate beyond %d.', $this->maxPosition));
348
  }
349
  }
350
 
vendor/twig/twig/test/Twig/Tests/Extension/SandboxTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_Extension_SandboxTest extends \PHPUnit\Framework\TestCase
13
  {
14
  protected static $params;
15
  protected static $templates;
@@ -252,7 +252,7 @@ EOF
252
  } catch (Throwable $e) {
253
  } catch (Exception $e) {
254
  }
255
- if (null === $e) {
256
  $this->fail('An exception should be thrown for this test to be valid.');
257
  }
258
 
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_Extension_SandboxTest extends PHPUnit_Framework_TestCase
13
  {
14
  protected static $params;
15
  protected static $templates;
252
  } catch (Throwable $e) {
253
  } catch (Exception $e) {
254
  }
255
+ if ($e === null) {
256
  $this->fail('An exception should be thrown for this test to be valid.');
257
  }
258
 
vendor/twig/twig/test/Twig/Tests/FactoryRuntimeLoaderTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_FactoryRuntimeLoaderTest extends \PHPUnit\Framework\TestCase
13
  {
14
  public function testLoad()
15
  {
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_FactoryRuntimeLoaderTest extends PHPUnit_Framework_TestCase
13
  {
14
  public function testLoad()
15
  {
vendor/twig/twig/test/Twig/Tests/FileCachingTest.php CHANGED
@@ -11,7 +11,7 @@
11
 
12
  require_once dirname(__FILE__).'/FilesystemHelper.php';
13
 
14
- class Twig_Tests_FileCachingTest extends \PHPUnit\Framework\TestCase
15
  {
16
  private $env;
17
  private $tmpDir;
11
 
12
  require_once dirname(__FILE__).'/FilesystemHelper.php';
13
 
14
+ class Twig_Tests_FileCachingTest extends PHPUnit_Framework_TestCase
15
  {
16
  private $env;
17
  private $tmpDir;
vendor/twig/twig/test/Twig/Tests/FileExtensionEscapingStrategyTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_FileExtensionEscapingStrategyTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @dataProvider getGuessData
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_FileExtensionEscapingStrategyTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @dataProvider getGuessData
vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/child_contents_outside_blocks.test CHANGED
@@ -1,5 +1,5 @@
1
  --TEST--
2
- Exception for child templates defining content outside blocks defined by parent
3
  --TEMPLATE--
4
  {% extends 'base.twig' %}
5
 
@@ -12,4 +12,4 @@ Content outside a block.
12
  {% block sidebar %}
13
  {% endblock %}
14
  --EXCEPTION--
15
- Twig_Error_Syntax: A template that extends another one cannot include content outside Twig blocks. Did you forget to put the content inside a {% block %} tag in "index.twig" at line 3?
1
  --TEST--
2
+ Exception for child templates defining contents outside blocks defined by parent
3
  --TEMPLATE--
4
  {% extends 'base.twig' %}
5
 
12
  {% block sidebar %}
13
  {% endblock %}
14
  --EXCEPTION--
15
+ Twig_Error_Syntax: A template that extends another one cannot include contents outside Twig blocks. Did you forget to put the contents inside a {% block %} tag in "index.twig" at line 3?
vendor/twig/twig/test/Twig/Tests/Fixtures/exceptions/strict_comparison_operator.test DELETED
@@ -1,6 +0,0 @@
1
- --TEST--
2
- The PHP === strict comparison operator is not supported
3
- --TEMPLATE--
4
- {{ 1 === 2 }}
5
- --EXCEPTION--
6
- Twig_Error_Syntax: Unexpected operator of value "=". Did you try to use "===" or "!==" for strict comparison? Use "is same as(value)" instead in "index.twig" at line 2.
 
 
 
 
 
 
vendor/twig/twig/test/Twig/Tests/Fixtures/filters/length.test CHANGED
@@ -6,7 +6,6 @@
6
  {{ number|length }}
7
  {{ to_string_able|length }}
8
  {{ countable|length }}
9
- {{ iterator_aggregate|length }}
10
  {{ null|length }}
11
  {{ magic|length }}
12
  {{ non_countable|length }}
@@ -17,7 +16,6 @@ return array(
17
  'number' => 1000,
18
  'to_string_able' => new ToStringStub('foobar'),
19
  'countable' => new CountableStub(42), /* also asserts we do *not* call __toString() */
20
- 'iterator_aggregate' => new IteratorAggregateStub(array('a', 'b', 'c')), /* also asserts we do *not* call __toString() */
21
  'null' => null,
22
  'magic' => new MagicCallStub(), /* used to assert we do *not* call __call */
23
  'non_countable' => new \StdClass(),
@@ -28,7 +26,6 @@ return array(
28
  4
29
  6
30
  42
31
- 3
32
  0
33
  1
34
  1
6
  {{ number|length }}
7
  {{ to_string_able|length }}
8
  {{ countable|length }}
 
9
  {{ null|length }}
10
  {{ magic|length }}
11
  {{ non_countable|length }}
16
  'number' => 1000,
17
  'to_string_able' => new ToStringStub('foobar'),
18
  'countable' => new CountableStub(42), /* also asserts we do *not* call __toString() */
 
19
  'null' => null,
20
  'magic' => new MagicCallStub(), /* used to assert we do *not* call __call */
21
  'non_countable' => new \StdClass(),
26
  4
27
  6
28
  42
 
29
  0
30
  1
31
  1
vendor/twig/twig/test/Twig/Tests/Fixtures/tags/use/use_with_parent.test DELETED
@@ -1,24 +0,0 @@
1
- --TEST--
2
- "use" tag with a parent block
3
- --TEMPLATE--
4
- {% extends "parent.twig" %}
5
-
6
- {% use 'blocks.twig' %}
7
-
8
- {% block body %}
9
- {{ parent() -}}
10
- CHILD
11
- {{ block('content') }}
12
- {% endblock %}
13
- --TEMPLATE(parent.twig)--
14
- {% block body %}
15
- PARENT
16
- {% endblock %}
17
- --TEMPLATE(blocks.twig)--
18
- {% block content 'BLOCK' %}
19
- --DATA--
20
- return array()
21
- --EXPECT--
22
- PARENT
23
- CHILD
24
- BLOCK
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/twig/twig/test/Twig/Tests/IntegrationTest.php CHANGED
@@ -307,21 +307,3 @@ class CountableStub implements \Countable
307
  throw new Exception('__toString shall not be called on \Countables');
308
  }
309
  }
310
-
311
- /**
312
- * This class is used in tests for the length filter.
313
- */
314
- class IteratorAggregateStub implements \IteratorAggregate
315
- {
316
- private $data;
317
-
318
- public function __construct(array $data)
319
- {
320
- $this->data = $data;
321
- }
322
-
323
- public function getIterator()
324
- {
325
- return new ArrayIterator($this->data);
326
- }
327
- }
307
  throw new Exception('__toString shall not be called on \Countables');
308
  }
309
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/twig/twig/test/Twig/Tests/LexerTest.php CHANGED
@@ -8,7 +8,7 @@
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
- class Twig_Tests_LexerTest extends \PHPUnit\Framework\TestCase
12
  {
13
  /**
14
  * @group legacy
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
+ class Twig_Tests_LexerTest extends PHPUnit_Framework_TestCase
12
  {
13
  /**
14
  * @group legacy
vendor/twig/twig/test/Twig/Tests/Loader/ArrayTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_Loader_ArrayTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @group legacy
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_Loader_ArrayTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @group legacy
vendor/twig/twig/test/Twig/Tests/Loader/ChainTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_Loader_ChainTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @group legacy
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_Loader_ChainTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @group legacy
vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_Loader_FilesystemTest extends \PHPUnit\Framework\TestCase
13
  {
14
  public function testGetSourceContext()
15
  {
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_Loader_FilesystemTest extends PHPUnit_Framework_TestCase
13
  {
14
  public function testGetSourceContext()
15
  {
vendor/twig/twig/test/Twig/Tests/NativeExtensionTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_NativeExtensionTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @requires PHP 5.3
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_NativeExtensionTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @requires PHP 5.3
vendor/twig/twig/test/Twig/Tests/Node/Expression/CallTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_Node_Expression_CallTest extends \PHPUnit\Framework\TestCase
13
  {
14
  public function testGetArguments()
15
  {
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_Node_Expression_CallTest extends PHPUnit_Framework_TestCase
13
  {
14
  public function testGetArguments()
15
  {
vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php CHANGED
@@ -8,7 +8,7 @@
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
- class Twig_Tests_NodeVisitor_OptimizerTest extends \PHPUnit\Framework\TestCase
12
  {
13
  public function testRenderBlockOptimizer()
14
  {
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
+ class Twig_Tests_NodeVisitor_OptimizerTest extends PHPUnit_Framework_TestCase
12
  {
13
  public function testRenderBlockOptimizer()
14
  {
vendor/twig/twig/test/Twig/Tests/ParserTest.php CHANGED
@@ -8,7 +8,7 @@
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
- class Twig_Tests_ParserTest extends \PHPUnit\Framework\TestCase
12
  {
13
  /**
14
  * @expectedException Twig_Error_Syntax
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
+ class Twig_Tests_ParserTest extends PHPUnit_Framework_TestCase
12
  {
13
  /**
14
  * @expectedException Twig_Error_Syntax
vendor/twig/twig/test/Twig/Tests/Profiler/Dumper/AbstractTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- abstract class Twig_Tests_Profiler_Dumper_AbstractTest extends \PHPUnit\Framework\TestCase
13
  {
14
  protected function getProfile()
15
  {
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ abstract class Twig_Tests_Profiler_Dumper_AbstractTest extends PHPUnit_Framework_TestCase
13
  {
14
  protected function getProfile()
15
  {
vendor/twig/twig/test/Twig/Tests/Profiler/ProfileTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_Profiler_ProfileTest extends \PHPUnit\Framework\TestCase
13
  {
14
  public function testConstructor()
15
  {
@@ -97,14 +97,4 @@ class Twig_Tests_Profiler_ProfileTest extends \PHPUnit\Framework\TestCase
97
  $this->assertEquals($profile1->getType(), $profile3->getType());
98
  $this->assertEquals($profile1->getName(), $profile3->getName());
99
  }
100
-
101
- public function testReset()
102
- {
103
- $profile = new Twig_Profiler_Profile();
104
- usleep(1);
105
- $profile->leave();
106
- $profile->reset();
107
-
108
- $this->assertEquals(0, $profile->getDuration());
109
- }
110
  }
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_Profiler_ProfileTest extends PHPUnit_Framework_TestCase
13
  {
14
  public function testConstructor()
15
  {
97
  $this->assertEquals($profile1->getType(), $profile3->getType());
98
  $this->assertEquals($profile1->getName(), $profile3->getName());
99
  }
 
 
 
 
 
 
 
 
 
 
100
  }
vendor/twig/twig/test/Twig/Tests/TemplateTest.php CHANGED
@@ -8,7 +8,7 @@
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
- class Twig_Tests_TemplateTest extends \PHPUnit\Framework\TestCase
12
  {
13
  /**
14
  * @expectedException LogicException
@@ -58,7 +58,6 @@ class Twig_Tests_TemplateTest extends \PHPUnit\Framework\TestCase
58
  array('{{ string.a() }}', 'Impossible to invoke a method ("a") on a string variable ("foo") in "%s" at line 1.'),
59
  array('{{ null.a }}', 'Impossible to access an attribute ("a") on a null variable in "%s" at line 1.'),
60
  array('{{ null.a() }}', 'Impossible to invoke a method ("a") on a null variable in "%s" at line 1.'),
61
- array('{{ array.a() }}', 'Impossible to invoke a method ("a") on an array in "%s" at line 1.'),
62
  array('{{ empty_array.a }}', 'Key "a" does not exist as the array is empty in "%s" at line 1.'),
63
  array('{{ array.a }}', 'Key "a" for array with keys "foo" does not exist in "%s" at line 1.'),
64
  array('{{ attribute(array, -10) }}', 'Key "-10" for array with keys "foo" does not exist in "%s" at line 1.'),
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
+ class Twig_Tests_TemplateTest extends PHPUnit_Framework_TestCase
12
  {
13
  /**
14
  * @expectedException LogicException
58
  array('{{ string.a() }}', 'Impossible to invoke a method ("a") on a string variable ("foo") in "%s" at line 1.'),
59
  array('{{ null.a }}', 'Impossible to access an attribute ("a") on a null variable in "%s" at line 1.'),
60
  array('{{ null.a() }}', 'Impossible to invoke a method ("a") on a null variable in "%s" at line 1.'),
 
61
  array('{{ empty_array.a }}', 'Key "a" does not exist as the array is empty in "%s" at line 1.'),
62
  array('{{ array.a }}', 'Key "a" for array with keys "foo" does not exist in "%s" at line 1.'),
63
  array('{{ attribute(array, -10) }}', 'Key "-10" for array with keys "foo" does not exist in "%s" at line 1.'),
vendor/twig/twig/test/Twig/Tests/TemplateWrapperTest.php CHANGED
@@ -8,7 +8,7 @@
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
- class Twig_Tests_TemplateWrapperTest extends \PHPUnit\Framework\TestCase
12
  {
13
  public function testHasGetBlocks()
14
  {
8
  * For the full copyright and license information, please view the LICENSE
9
  * file that was distributed with this source code.
10
  */
11
+ class Twig_Tests_TemplateWrapperTest extends PHPUnit_Framework_TestCase
12
  {
13
  public function testHasGetBlocks()
14
  {
vendor/twig/twig/test/Twig/Tests/TokenStreamTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_TokenStreamTest extends \PHPUnit\Framework\TestCase
13
  {
14
  protected static $tokens;
15
 
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_TokenStreamTest extends PHPUnit_Framework_TestCase
13
  {
14
  protected static $tokens;
15
 
vendor/twig/twig/test/Twig/Tests/Util/DeprecationCollectorTest.php CHANGED
@@ -9,7 +9,7 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- class Twig_Tests_Util_DeprecationCollectorTest extends \PHPUnit\Framework\TestCase
13
  {
14
  /**
15
  * @requires PHP 5.3
9
  * file that was distributed with this source code.
10
  */
11
 
12
+ class Twig_Tests_Util_DeprecationCollectorTest extends PHPUnit_Framework_TestCase
13
  {
14
  /**
15
  * @requires PHP 5.3
vendor/twig/twig/test/Twig/Tests/escapingTest.php CHANGED
@@ -6,7 +6,7 @@
6
  * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
7
  * @license http://framework.zend.com/license/new-bsd New BSD License
8
  */
9
- class Twig_Test_EscapingTest extends \PHPUnit\Framework\TestCase
10
  {
11
  /**
12
  * All character encodings supported by htmlspecialchars().
6
  * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
7
  * @license http://framework.zend.com/license/new-bsd New BSD License
8
  */
9
+ class Twig_Test_EscapingTest extends PHPUnit_Framework_TestCase
10
  {
11
  /**
12
  * All character encodings supported by htmlspecialchars().
vendor/twig/twig/test/bootstrap.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ if (PHP_VERSION_ID < 50300) {
13
+ require_once dirname(__FILE__).'/../lib/Twig/Autoloader.php';
14
+ Twig_Autoloader::register(true);
15
+ } else {
16
+ require __DIR__.'/../vendor/autoload.php';
17
+
18
+ if (!class_exists('\PHPUnit_Framework_TestCase') && class_exists('\PHPUnit\Framework\TestCase')) {
19
+ class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase');
20
+ }
21
+ }