TubePress - Version 3.1.3

Version Description

  • Bug Fixes
    • Fixed regression bug with auto-next playback.
    • Now able to use HQ thumbnails over HTTPS.
  • Changed
    • YouTube iframe's are now loaded via HTTPS.
    • YouTube iframe's are now loaded with "origin" parameter.
    • Vimeo doesn't support HTTPS thumbnails, so that capability has been removed.
    • Minor improvements to JavaScript capabilities and performance.
    • Updated underlying libraries: epilog, finder, iconic, pulsar, stash, and tickertape.
Download this release

Release Info

Developer k2eric
Plugin Icon wp plugin TubePress
Version 3.1.3
Comparing to
See all releases

Code changes from version 3.1.2 to 3.1.3

Files changed (176) hide show
  1. readme.txt +23 -4
  2. screenshot-1.png +0 -0
  3. screenshot-2.png +0 -0
  4. src/main/php/add-ons/core/classes/tubepress/addons/core/impl/ioc/IocContainerExtension.php +22 -9
  5. src/main/php/add-ons/{wordpress/classes/tubepress/addons/wordpress → core/classes/tubepress/addons/core}/impl/listeners/cssjs/BaseUrlSetter.php +3 -2
  6. src/main/php/add-ons/core/classes/tubepress/addons/core/impl/listeners/cssjs/GalleryInitJsBaseParams.php +1 -3
  7. src/main/php/add-ons/core/classes/tubepress/addons/core/impl/listeners/html/EmbeddedPlayerApiJs.php +0 -56
  8. src/main/php/add-ons/core/classes/tubepress/addons/core/impl/listeners/html/JsConfig.php +1 -1
  9. src/main/php/add-ons/core/classes/tubepress/addons/core/impl/listeners/html/PreCssHtmlListener.php +38 -0
  10. src/main/php/add-ons/core/classes/tubepress/addons/core/impl/player/JqModalPluggablePlayerLocationService.php +5 -2
  11. src/main/php/add-ons/core/classes/tubepress/addons/core/impl/player/NormalPluggablePlayerLocationService.php +5 -2
  12. src/main/php/add-ons/core/classes/tubepress/addons/core/impl/player/PopupPluggablePlayerLocationService.php +5 -2
  13. src/main/php/add-ons/core/classes/tubepress/addons/core/impl/player/ShadowboxPluggablePlayerLocationService.php +5 -2
  14. src/main/php/add-ons/core/classes/tubepress/addons/core/impl/player/SoloPluggablePlayerLocationService.php +5 -2
  15. src/main/php/add-ons/core/classes/tubepress/addons/core/impl/player/StaticPluggablePlayerLocationService.php +5 -2
  16. src/main/php/add-ons/core/classes/tubepress/addons/core/impl/player/VimeoPluggablePlayerLocationService.php +5 -2
  17. src/main/php/add-ons/core/classes/tubepress/addons/core/impl/player/YouTubePluggablePlayerLocationService.php +5 -2
  18. src/main/php/add-ons/core/core.json +2 -1
  19. src/main/php/add-ons/wordpress/classes/tubepress/addons/wordpress/impl/DefaultFrontEndCssAndJsInjector.php +3 -10
  20. src/main/php/add-ons/wordpress/classes/tubepress/addons/wordpress/impl/DefaultWordPressFunctionWrapper.php +35 -1
  21. src/main/php/add-ons/wordpress/classes/tubepress/addons/wordpress/impl/ioc/WordPressIocContainerExtension.php +6 -3
  22. src/main/php/add-ons/wordpress/classes/tubepress/addons/wordpress/impl/listeners/html/CssJsDequerer.php +34 -0
  23. src/main/php/add-ons/wordpress/classes/tubepress/addons/wordpress/impl/options/WordPressStorageManager.php +10 -1
  24. src/main/php/add-ons/wordpress/classes/tubepress/addons/wordpress/spi/WordPressFunctionWrapper.php +28 -0
  25. src/main/php/add-ons/wordpress/wordpress.json +1 -1
  26. src/main/php/add-ons/youtube/classes/tubepress/addons/youtube/impl/embedded/YouTubePluggableEmbeddedPlayerService.php +6 -2
  27. src/main/php/add-ons/youtube/classes/tubepress/addons/youtube/impl/ioc/YouTubeIocContainerExtension.php +2 -2
  28. src/main/php/add-ons/youtube/classes/tubepress/addons/youtube/impl/listeners/options/YouTubePlaylistHandler.php +62 -0
  29. src/main/php/add-ons/youtube/classes/tubepress/addons/youtube/impl/listeners/options/YouTubePlaylistPlPrefixRemover.php +0 -64
  30. src/main/php/add-ons/youtube/classes/tubepress/addons/youtube/impl/options/YouTubeOptionsProvider.php +2 -1
  31. src/main/php/add-ons/youtube/youtube.json +1 -1
  32. src/main/php/classes/tubepress/api/const/event/EventNames.php +47 -57
  33. src/main/php/classes/tubepress/impl/cache/ItemDecorator.php +36 -28
  34. src/main/php/classes/tubepress/impl/cache/PoolDecorator.php +31 -18
  35. src/main/php/classes/tubepress/impl/environment/SimpleEnvironmentDetector.php +103 -15
  36. src/main/php/classes/tubepress/impl/feed/CacheAwareFeedFetcher.php +9 -3
  37. src/main/php/classes/tubepress/impl/html/CssAndJsHtmlGenerator.php +102 -0
  38. src/main/php/classes/tubepress/impl/html/CssAndJsRegistry.php +337 -0
  39. src/main/php/classes/tubepress/impl/html/DefaultCssAndJsGenerator.php +0 -82
  40. src/main/php/classes/tubepress/impl/options/ui/fields/AbstractTemplateBasedOptionsPageField.php +2 -2
  41. src/main/php/classes/tubepress/impl/patterns/sl/ServiceLocator.php +13 -5
  42. src/main/php/classes/tubepress/impl/patterns/toposort/TopologicalSort.php +108 -0
  43. src/main/php/classes/tubepress/spi/environment/EnvironmentDetector.php +13 -9
  44. src/main/php/classes/tubepress/spi/html/{CssAndJsGenerator.php → CssAndJsHtmlGeneratorInterface.php} +10 -12
  45. src/main/php/classes/tubepress/spi/html/CssAndJsRegistryInterface.php +87 -0
  46. src/main/php/classes/tubepress/spi/player/PluggablePlayerLocationService.php +2 -2
  47. src/main/php/scripts/classmaps/full.php +19 -5
  48. src/main/resources/i18n/tubepress-ar.mo +0 -0
  49. src/main/resources/i18n/tubepress-ar.po +2 -2
  50. src/main/resources/i18n/tubepress-de.mo +0 -0
  51. src/main/resources/i18n/tubepress-de.po +3 -3
  52. src/main/resources/i18n/tubepress-el.mo +0 -0
  53. src/main/resources/i18n/tubepress-el.po +3 -3
  54. src/main/resources/i18n/tubepress-es.mo +0 -0
  55. src/main/resources/i18n/tubepress-es.po +3 -3
  56. src/main/resources/i18n/tubepress-fa.mo +0 -0
  57. src/main/resources/i18n/tubepress-fa.po +3 -3
  58. src/main/resources/i18n/tubepress-fi.mo +0 -0
  59. src/main/resources/i18n/tubepress-fi.po +3 -3
  60. src/main/resources/i18n/tubepress-fr.mo +0 -0
  61. src/main/resources/i18n/tubepress-fr.po +3 -3
  62. src/main/resources/i18n/tubepress-he.mo +0 -0
  63. src/main/resources/i18n/tubepress-he.po +3 -3
  64. src/main/resources/i18n/tubepress-hi.mo +0 -0
  65. src/main/resources/i18n/tubepress-hi.po +3 -3
  66. src/main/resources/i18n/tubepress-it.mo +0 -0
  67. src/main/resources/i18n/tubepress-it.po +3 -3
  68. src/main/resources/i18n/tubepress-ja.mo +0 -0
  69. src/main/resources/i18n/tubepress-ja.po +3 -3
  70. src/main/resources/i18n/tubepress-ko.mo +0 -0
  71. src/main/resources/i18n/tubepress-ko.po +3 -3
  72. src/main/resources/i18n/tubepress-nb.mo +0 -0
  73. src/main/resources/i18n/tubepress-nb.po +3 -3
  74. src/main/resources/i18n/tubepress-pl.mo +0 -0
  75. src/main/resources/i18n/tubepress-pl.po +3 -3
  76. src/main/resources/i18n/tubepress-pt_BR.mo +0 -0
  77. src/main/resources/i18n/tubepress-pt_BR.po +2 -4
  78. src/main/resources/i18n/tubepress-ru.mo +0 -0
  79. src/main/resources/i18n/tubepress-ru.po +3 -3
  80. src/main/resources/i18n/tubepress-sv.mo +0 -0
  81. src/main/resources/i18n/tubepress-sv.po +3 -3
  82. src/main/resources/i18n/tubepress-zh_CN.mo +0 -0
  83. src/main/resources/i18n/tubepress-zh_CN.po +3 -3
  84. src/main/resources/i18n/tubepress-zh_TW.mo +0 -0
  85. src/main/resources/i18n/tubepress-zh_TW.po +3 -3
  86. src/main/web/js/gallery-dev.js +552 -546
  87. src/main/web/js/gallery.js +8 -1
  88. src/main/web/js/tubepress-dev.js +49 -17
  89. src/main/web/js/tubepress.js +8 -1
  90. tubepress.php +3 -3
  91. vendor/composer/autoload_classmap.php +1 -1
  92. vendor/composer/autoload_namespaces.php +1 -1
  93. vendor/composer/autoload_real.php +4 -4
  94. vendor/composer/include_paths.php +2 -2
  95. vendor/composer/installed.json +481 -480
  96. vendor/ehough/epilog/src/main/php/ehough/epilog/ErrorHandler.php +8 -4
  97. vendor/ehough/epilog/src/main/php/ehough/epilog/Logger.php +5 -0
  98. vendor/ehough/epilog/src/main/php/ehough/epilog/formatter/LineFormatter.php +5 -3
  99. vendor/ehough/epilog/src/main/php/ehough/epilog/handler/AbstractHandler.php +16 -6
  100. vendor/ehough/epilog/src/main/php/ehough/epilog/handler/AbstractProcessingHandler.php +1 -1
  101. vendor/ehough/epilog/src/main/php/ehough/epilog/handler/HandlerInterface.php +5 -3
  102. vendor/ehough/epilog/src/main/php/ehough/epilog/handler/SyslogUdpHandler.php +75 -0
  103. vendor/ehough/filesystem/README.md +1 -1
  104. vendor/ehough/filesystem/src/main/php/ehough/filesystem/Filesystem.php +36 -38
  105. vendor/ehough/filesystem/src/main/php/ehough/filesystem/exception/ExceptionInterface.php +0 -1
  106. vendor/ehough/filesystem/src/main/php/ehough/filesystem/exception/FileNotFoundException.php +32 -0
  107. vendor/ehough/filesystem/src/main/php/ehough/filesystem/exception/IOException.php +26 -3
  108. vendor/ehough/filesystem/src/main/php/ehough/filesystem/exception/IOExceptionInterface.php +25 -0
  109. vendor/ehough/finder/README.md +2 -2
  110. vendor/ehough/finder/src/main/php/ehough/finder/expression/Expression.php +1 -1
  111. vendor/ehough/finder/src/main/php/ehough/finder/iterator/ExcludeDirectoryFilterIterator.php +1 -2
  112. vendor/ehough/finder/src/main/php/ehough/finder/iterator/MultiplePcreFilterIterator.php +2 -4
  113. vendor/ehough/finder/src/main/php/ehough/finder/shell/Command.php +4 -6
  114. vendor/ehough/iconic/src/main/php/ehough/iconic/Container.php +29 -28
  115. vendor/ehough/iconic/src/main/php/ehough/iconic/ContainerAwareTrait.php +33 -0
  116. vendor/ehough/iconic/src/main/php/ehough/iconic/ContainerBuilder.php +30 -18
  117. vendor/ehough/iconic/src/main/php/ehough/iconic/Definition.php +17 -26
  118. vendor/ehough/iconic/src/main/php/ehough/iconic/DefinitionDecorator.php +1 -2
  119. vendor/ehough/iconic/src/main/php/ehough/iconic/ExpressionLanguage.php +38 -0
  120. vendor/ehough/iconic/src/main/php/ehough/iconic/SimpleXMLElement.php +4 -0
  121. vendor/ehough/iconic/src/main/php/ehough/iconic/compiler/CheckCircularReferencesPass.php +14 -7
  122. vendor/ehough/iconic/src/main/php/ehough/iconic/compiler/CheckDefinitionValidityPass.php +11 -0
  123. vendor/ehough/iconic/src/main/php/ehough/iconic/compiler/Compiler.php +1 -2
  124. vendor/ehough/iconic/src/main/php/ehough/iconic/compiler/InlineServiceDefinitionsPass.php +1 -1
  125. vendor/ehough/iconic/src/main/php/ehough/iconic/compiler/PassConfig.php +3 -7
  126. vendor/ehough/iconic/src/main/php/ehough/iconic/compiler/ResolveDefinitionTemplatesPass.php +1 -1
  127. vendor/ehough/iconic/src/main/php/ehough/iconic/compiler/ServiceReferenceGraph.php +1 -9
  128. vendor/ehough/iconic/src/main/php/ehough/iconic/compiler/ServiceReferenceGraphNode.php +2 -4
  129. vendor/ehough/iconic/src/main/php/ehough/iconic/dumper/PhpDumper.php +23 -3
  130. vendor/ehough/iconic/src/main/php/ehough/iconic/dumper/XmlDumper.php +4 -0
  131. vendor/ehough/iconic/src/main/php/ehough/iconic/dumper/YamlDumper.php +11 -0
  132. vendor/ehough/iconic/src/main/php/ehough/iconic/loader/PhpFileLoader.php +1 -1
  133. vendor/ehough/iconic/src/main/php/ehough/iconic/loader/XmlFileLoader.php +22 -14
  134. vendor/ehough/iconic/src/main/php/ehough/iconic/loader/YamlFileLoader.php +5 -2
  135. vendor/ehough/iconic/src/main/php/ehough/iconic/loader/schema/dic/services/services-1.0.xsd +1 -0
  136. vendor/ehough/iconic/src/main/php/ehough/iconic/parameterbag/ParameterBag.php +2 -4
  137. vendor/ehough/pulsar/src/main/php/ehough/pulsar/ClassCollectionLoader.php +1 -1
  138. vendor/ehough/pulsar/src/main/php/ehough/pulsar/DebugClassLoader.php +2 -0
  139. vendor/ehough/stash/README.md +6 -1
  140. vendor/ehough/stash/composer.json +0 -2
  141. vendor/ehough/stash/src/main/php/ehough/stash/Drivers.php +6 -7
  142. vendor/ehough/stash/src/main/php/ehough/stash/Item.php +59 -19
  143. vendor/ehough/stash/src/main/php/ehough/stash/ItemInterface.php +0 -88
  144. vendor/ehough/stash/src/main/php/ehough/stash/Pool.php +108 -22
  145. vendor/ehough/stash/src/main/php/ehough/stash/PoolInterface.php +0 -47
  146. vendor/ehough/stash/src/main/php/ehough/stash/Session.php +18 -20
  147. vendor/ehough/stash/src/main/php/ehough/stash/Utilities.php +13 -10
  148. vendor/ehough/stash/src/main/php/ehough/stash/driver/Apc.php +11 -9
  149. vendor/ehough/stash/src/main/php/ehough/stash/driver/BlackHole.php +27 -29
  150. vendor/ehough/stash/src/main/php/ehough/stash/driver/Composite.php +4 -4
  151. vendor/ehough/stash/src/main/php/ehough/stash/driver/Ephemeral.php +3 -2
  152. vendor/ehough/stash/src/main/php/ehough/stash/driver/FileSystem.php +38 -30
  153. vendor/ehough/stash/src/main/php/ehough/stash/driver/Memcache.php +7 -6
  154. vendor/ehough/stash/src/main/php/ehough/stash/driver/Redis.php +28 -30
  155. vendor/ehough/stash/src/main/php/ehough/stash/driver/Sqlite.php +27 -25
  156. vendor/ehough/stash/src/main/php/ehough/stash/driver/Xcache.php +20 -27
  157. vendor/ehough/stash/src/main/php/ehough/stash/driver/sub/Memcache.php +6 -4
  158. vendor/ehough/stash/src/main/php/ehough/stash/driver/sub/Memcached.php +6 -3
  159. vendor/ehough/stash/src/main/php/ehough/stash/driver/sub/Sqlite.php +8 -15
  160. vendor/ehough/stash/src/main/php/ehough/stash/driver/sub/SqlitePdo.php +3 -1
  161. vendor/ehough/stash/src/main/php/ehough/stash/driver/sub/SqlitePdo2.php +3 -1
  162. vendor/ehough/stash/src/main/php/ehough/stash/exception/Exception.php +1 -3
  163. vendor/ehough/stash/src/main/php/ehough/stash/exception/InvalidArgumentException.php +1 -3
  164. vendor/ehough/stash/src/main/php/ehough/stash/exception/LogicException.php +2 -4
  165. vendor/ehough/stash/src/main/php/ehough/stash/exception/RuntimeException.php +1 -3
  166. vendor/ehough/stash/src/main/php/ehough/stash/exception/WindowsPathMaxLengthException.php +35 -0
  167. vendor/ehough/stash/src/main/php/ehough/stash/{driver → interfaces}/DriverInterface.php +8 -8
  168. vendor/ehough/stash/src/main/php/ehough/stash/interfaces/ItemInterface.php +34 -0
  169. vendor/ehough/stash/src/main/php/ehough/stash/interfaces/PoolInterface.php +33 -0
  170. vendor/ehough/stash/src/main/php/ehough/stash/interfaces/drivers/ExtendInterface.php +15 -0
  171. vendor/ehough/stash/src/main/php/ehough/stash/interfaces/drivers/IncDecInterface.php +17 -0
  172. vendor/ehough/stash/src/main/php/ehough/stash/interfaces/drivers/MultiInterface.php +17 -0
  173. vendor/ehough/stash/src/main/php/ehough/stash/session/SessionHandlerInterface.php +3 -3
  174. vendor/ehough/tickertape/src/main/php/ehough/tickertape/Event.php +8 -0
  175. vendor/ehough/tickertape/src/main/php/ehough/tickertape/EventDispatcher.php +4 -4
  176. vendor/ehough/tickertape/src/main/php/ehough/tickertape/GenericEvent.php +1 -1
readme.txt CHANGED
@@ -3,12 +3,20 @@ Contributors: k2eric
3
  Donate link: http://tubepress.com
4
  Tags: video, youtube, gallery, videos, vimeo
5
  Requires at least: 2.2
6
- Stable tag: 3.1.2
 
 
7
 
8
- Displays gorgeous YouTube and Vimeo videos and galleries in your site. Please visit tubepress.com for more info!
9
 
10
  == Description ==
11
 
 
 
 
 
 
 
12
  **Demos**
13
 
14
  * [Simple gallery](http://tubepress.com/demo/)
@@ -24,11 +32,22 @@ Displays gorgeous YouTube and Vimeo videos and galleries in your site. Please vi
24
  == Installation ==
25
 
26
  1. Unzip into your plugins directory at `(wp-content/plugins)`
27
- 1. Activate TubePress from Site Admin > Plugins
28
- 1. Configure from Site Admin > Settings > TubePress
29
  1. Type `[tubepress]` in a post or a page where you'd like to insert your first gallery
30
 
31
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
32
  = 3.1.2 =
33
  * New Features
34
  * Refreshed design of WordPress settings page
3
  Donate link: http://tubepress.com
4
  Tags: video, youtube, gallery, videos, vimeo
5
  Requires at least: 2.2
6
+ Tested up to: 3.8
7
+ License: Mozilla Public License v2.0
8
+ Stable tag: 3.1.3
9
 
10
+ Modern video galleries for the web. Visit us at tubepress.com for more!
11
 
12
  == Description ==
13
 
14
+ Rather not host your own copy of TubePress? [TubePress Express](http://express.tubepress.com) is now available!
15
+ TubePress Express is a cloud-hosted version of TubePress with zero installation, maximum performance, and full
16
+ compatability with *any* website or device. Enjoy a risk free 30-day trial and flexible pricing plans.
17
+
18
+ For a limited time, use coupon code `WELCOME2EXPRESS` to lock in **50% off any TubePress Express plan!**
19
+
20
  **Demos**
21
 
22
  * [Simple gallery](http://tubepress.com/demo/)
32
  == Installation ==
33
 
34
  1. Unzip into your plugins directory at `(wp-content/plugins)`
35
+ 1. Activate TubePress from `Site Admin > Plugins`
36
+ 1. Configure from `Site Admin > Settings > TubePress`
37
  1. Type `[tubepress]` in a post or a page where you'd like to insert your first gallery
38
 
39
  == Changelog ==
40
+ = 3.1.3 =
41
+ * Bug Fixes
42
+ * Fixed regression bug with auto-next playback.
43
+ * Now able to use HQ thumbnails over HTTPS.
44
+ * Changed
45
+ * YouTube iframe's are now loaded via HTTPS.
46
+ * YouTube iframe's are now loaded with "origin" parameter.
47
+ * Vimeo doesn't support HTTPS thumbnails, so that capability has been removed.
48
+ * Minor improvements to JavaScript capabilities and performance.
49
+ * Updated underlying libraries: epilog, finder, iconic, pulsar, stash, and tickertape.
50
+
51
  = 3.1.2 =
52
  * New Features
53
  * Refreshed design of WordPress settings page
screenshot-1.png CHANGED
Binary file
screenshot-2.png CHANGED
Binary file
src/main/php/add-ons/core/classes/tubepress/addons/core/impl/ioc/IocContainerExtension.php CHANGED
@@ -32,6 +32,7 @@ class tubepress_addons_core_impl_ioc_IocContainerExtension implements tubepress_
32
  $this->_registerAjaxHandler($container);
33
  $this->_registerCacheService($container);
34
  $this->_registerCssAndJsGenerator($container);
 
35
  $this->_registerEmbeddedHtmlGenerator($container);
36
  $this->_registerExecutionContext($container);
37
  $this->_registerFeedFetcher($container);
@@ -88,25 +89,34 @@ class tubepress_addons_core_impl_ioc_IocContainerExtension implements tubepress_
88
  'tubepress_addons_core_impl_ioc_FilesystemCacheBuilder'
89
  );
90
 
91
- $actualPoolDefinition = new tubepress_impl_ioc_Definition('ehough_stash_PoolInterface');
92
  $actualPoolDefinition->setFactoryService($builderServiceId);
93
  $actualPoolDefinition->setFactoryMethod('buildCache');
94
  $container->setDefinition($actualPoolServiceId, $actualPoolDefinition);
95
 
96
  $container->register(
97
 
98
- 'ehough_stash_PoolInterface',
99
  'tubepress_impl_cache_PoolDecorator'
100
 
101
  )->addArgument(new tubepress_impl_ioc_Reference($actualPoolServiceId));
102
  }
103
 
 
 
 
 
 
 
 
 
 
104
  private function _registerCssAndJsGenerator(tubepress_api_ioc_ContainerInterface $container)
105
  {
106
  $container->register(
107
 
108
- tubepress_spi_html_CssAndJsGenerator::_,
109
- 'tubepress_impl_html_DefaultCssAndJsGenerator'
110
  );
111
  }
112
 
@@ -567,9 +577,6 @@ class tubepress_addons_core_impl_ioc_IocContainerExtension implements tubepress_
567
  {
568
  $listeners = array(
569
 
570
- 'tubepress_addons_core_impl_listeners_html_EmbeddedPlayerApiJs' =>
571
- array('event' => tubepress_api_const_event_EventNames::HTML_EMBEDDED, 'method' => 'onEmbeddedHtml', 'priority' => 10000),
572
-
573
  'tubepress_addons_core_impl_listeners_template_EmbeddedCoreVariables' =>
574
  array('event' => tubepress_api_const_event_EventNames::TEMPLATE_EMBEDDED, 'method' => 'onEmbeddedTemplate', 'priority' => 10100),
575
 
@@ -616,10 +623,16 @@ class tubepress_addons_core_impl_ioc_IocContainerExtension implements tubepress_
616
  array('event' => tubepress_api_const_event_EventNames::VIDEO_GALLERY_PAGE, 'method' => 'onVideoGalleryPage', 'priority' => 10300),
617
 
618
  'tubepress_addons_core_impl_listeners_html_JsConfig' =>
619
- array('event' => tubepress_api_const_event_EventNames::CSS_JS_INLINE_JS, 'method' => 'onInlineJs', 'priority' => 10000),
 
 
 
620
 
621
  'tubepress_addons_core_impl_listeners_boot_OptionsStorageInitListener' =>
622
- array('event' => tubepress_api_const_event_EventNames::BOOT_COMPLETE, 'method' => 'onBoot', 'priority' => 30000)
 
 
 
623
  );
624
 
625
  foreach ($listeners as $className => $tagAttributes) {
32
  $this->_registerAjaxHandler($container);
33
  $this->_registerCacheService($container);
34
  $this->_registerCssAndJsGenerator($container);
35
+ $this->_registerCssAndJsRegistry($container);
36
  $this->_registerEmbeddedHtmlGenerator($container);
37
  $this->_registerExecutionContext($container);
38
  $this->_registerFeedFetcher($container);
89
  'tubepress_addons_core_impl_ioc_FilesystemCacheBuilder'
90
  );
91
 
92
+ $actualPoolDefinition = new tubepress_impl_ioc_Definition('ehough_stash_interfaces_PoolInterface');
93
  $actualPoolDefinition->setFactoryService($builderServiceId);
94
  $actualPoolDefinition->setFactoryMethod('buildCache');
95
  $container->setDefinition($actualPoolServiceId, $actualPoolDefinition);
96
 
97
  $container->register(
98
 
99
+ 'ehough_stash_interfaces_PoolInterface',
100
  'tubepress_impl_cache_PoolDecorator'
101
 
102
  )->addArgument(new tubepress_impl_ioc_Reference($actualPoolServiceId));
103
  }
104
 
105
+ private function _registerCssAndJsRegistry(tubepress_api_ioc_ContainerInterface $container)
106
+ {
107
+ $container->register(
108
+
109
+ tubepress_spi_html_CssAndJsRegistryInterface::_,
110
+ 'tubepress_impl_html_CssAndJsRegistry'
111
+ );
112
+ }
113
+
114
  private function _registerCssAndJsGenerator(tubepress_api_ioc_ContainerInterface $container)
115
  {
116
  $container->register(
117
 
118
+ tubepress_spi_html_CssAndJsHtmlGeneratorInterface::_,
119
+ 'tubepress_impl_html_CssAndJsHtmlGenerator'
120
  );
121
  }
122
 
577
  {
578
  $listeners = array(
579
 
 
 
 
580
  'tubepress_addons_core_impl_listeners_template_EmbeddedCoreVariables' =>
581
  array('event' => tubepress_api_const_event_EventNames::TEMPLATE_EMBEDDED, 'method' => 'onEmbeddedTemplate', 'priority' => 10100),
582
 
623
  array('event' => tubepress_api_const_event_EventNames::VIDEO_GALLERY_PAGE, 'method' => 'onVideoGalleryPage', 'priority' => 10300),
624
 
625
  'tubepress_addons_core_impl_listeners_html_JsConfig' =>
626
+ array('event' => tubepress_api_const_event_EventNames::HTML_SCRIPTS_PRE, 'method' => 'onPreScriptsHtml', 'priority' => 10000),
627
+
628
+ 'tubepress_addons_core_impl_listeners_html_PreCssHtmlListener' =>
629
+ array('event' => tubepress_api_const_event_EventNames::HTML_STYLESHEETS_PRE, 'method' => 'onBeforeCssHtml', 'priority' => 10000),
630
 
631
  'tubepress_addons_core_impl_listeners_boot_OptionsStorageInitListener' =>
632
+ array('event' => tubepress_api_const_event_EventNames::BOOT_COMPLETE, 'method' => 'onBoot', 'priority' => 30000),
633
+
634
+ 'tubepress_addons_core_impl_listeners_cssjs_BaseUrlSetter' =>
635
+ array('event' => tubepress_api_const_event_EventNames::CSS_JS_GLOBAL_JS_CONFIG, 'method' => 'onJsConfig', 'priority' => 10000),
636
  );
637
 
638
  foreach ($listeners as $className => $tagAttributes) {
src/main/php/add-ons/{wordpress/classes/tubepress/addons/wordpress → core/classes/tubepress/addons/core}/impl/listeners/cssjs/BaseUrlSetter.php RENAMED
@@ -10,9 +10,9 @@
10
  */
11
 
12
  /**
13
- * Registers a few extensions to allow TubePress to work inside WordPress.
14
  */
15
- class tubepress_addons_wordpress_impl_listeners_cssjs_BaseUrlSetter
16
  {
17
  public function onJsConfig(tubepress_api_event_EventInterface $event)
18
  {
@@ -28,6 +28,7 @@ class tubepress_addons_wordpress_impl_listeners_cssjs_BaseUrlSetter
28
  }
29
 
30
  $config['urls']['base'] = $environmentDetector->getBaseUrl();
 
31
 
32
  $event->setSubject($config);
33
  }
10
  */
11
 
12
  /**
13
+ *
14
  */
15
+ class tubepress_addons_core_impl_listeners_cssjs_BaseUrlSetter
16
  {
17
  public function onJsConfig(tubepress_api_event_EventInterface $event)
18
  {
28
  }
29
 
30
  $config['urls']['base'] = $environmentDetector->getBaseUrl();
31
+ $config['urls']['usr'] = $environmentDetector->getUserContentUrl();
32
 
33
  $event->setSubject($config);
34
  }
src/main/php/add-ons/core/classes/tubepress/addons/core/impl/listeners/cssjs/GalleryInitJsBaseParams.php CHANGED
@@ -136,8 +136,6 @@ class tubepress_addons_core_impl_listeners_cssjs_GalleryInitJsBaseParams
136
 
137
  private function _getPlayerJsUrl(tubepress_spi_player_PluggablePlayerLocationService $player)
138
  {
139
- $environmentDetector = tubepress_impl_patterns_sl_ServiceLocator::getEnvironmentDetector();
140
-
141
- return $environmentDetector->getBaseUrl() . '/' . trim($player->getRelativePlayerJsUrl(), '/');
142
  }
143
  }
136
 
137
  private function _getPlayerJsUrl(tubepress_spi_player_PluggablePlayerLocationService $player)
138
  {
139
+ return trim($player->getPlayerJsUrl(), '/');
 
 
140
  }
141
  }
src/main/php/add-ons/core/classes/tubepress/addons/core/impl/listeners/html/EmbeddedPlayerApiJs.php DELETED
@@ -1,56 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright 2006 - 2013 TubePress LLC (http://tubepress.com)
4
- *
5
- * This file is part of TubePress (http://tubepress.com)
6
- *
7
- * This Source Code Form is subject to the terms of the Mozilla Public
8
- * License, v. 2.0. If a copy of the MPL was not distributed with this
9
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10
- */
11
-
12
- /**
13
- * Registers videos with the JS player API.
14
- */
15
- class tubepress_addons_core_impl_listeners_html_EmbeddedPlayerApiJs
16
- {
17
- public function onEmbeddedHtml(tubepress_api_event_EventInterface $event)
18
- {
19
- $context = tubepress_impl_patterns_sl_ServiceLocator::getExecutionContext();
20
- $environmentDetector = tubepress_impl_patterns_sl_ServiceLocator::getEnvironmentDetector();
21
-
22
- if (! $environmentDetector->isPro()) {
23
-
24
- return;
25
- }
26
-
27
- if (! $context->get(tubepress_api_const_options_names_Embedded::ENABLE_JS_API)) {
28
-
29
- return;
30
- }
31
-
32
- $html = $event->getSubject();
33
- $domId = $this->_getDomIdFromHtml($html);
34
- $final = $html . <<<EOT
35
- <script type="text/javascript">
36
- var tubePressDomInjector = tubePressDomInjector || [], tubePressPlayerApi = tubePressPlayerApi || [];
37
- tubePressDomInjector.push(['loadPlayerApiJs']);
38
- tubePressPlayerApi.push(['register', '$domId' ]);
39
- </script>
40
- EOT;
41
-
42
- $event->setSubject($final);
43
- }
44
-
45
- private function _getDomIdFromHtml($html)
46
- {
47
- $result = preg_match('/\sid="(tubepress-video-object-[0-9]+)"[^"].*/', $html, $matches);
48
-
49
- if ($result < 1 || count($matches) < 2) {
50
-
51
- throw new RuntimeException("TubePress-generated video embeds must have a DOM id attribute that starts with 'tubepress-video-object-'");
52
- }
53
-
54
- return $matches[1];
55
- }
56
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/main/php/add-ons/core/classes/tubepress/addons/core/impl/listeners/html/JsConfig.php CHANGED
@@ -14,7 +14,7 @@
14
  */
15
  class tubepress_addons_core_impl_listeners_html_JsConfig
16
  {
17
- public function onInlineJs(tubepress_api_event_EventInterface $event)
18
  {
19
  $eventDispatcher = tubepress_impl_patterns_sl_ServiceLocator::getEventDispatcher();
20
 
14
  */
15
  class tubepress_addons_core_impl_listeners_html_JsConfig
16
  {
17
+ public function onPreScriptsHtml(tubepress_api_event_EventInterface $event)
18
  {
19
  $eventDispatcher = tubepress_impl_patterns_sl_ServiceLocator::getEventDispatcher();
20
 
src/main/php/add-ons/core/classes/tubepress/addons/core/impl/listeners/html/PreCssHtmlListener.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright 2006 - 2013 TubePress LLC (http://tubepress.com)
4
+ *
5
+ * This file is part of TubePress (http://tubepress.com)
6
+ *
7
+ * This Source Code Form is subject to the terms of the Mozilla Public
8
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
9
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10
+ */
11
+
12
+ /**
13
+ *
14
+ */
15
+ class tubepress_addons_core_impl_listeners_html_PreCssHtmlListener
16
+ {
17
+ public function onBeforeCssHtml(tubepress_api_event_EventInterface $event)
18
+ {
19
+ $html = $event->getSubject();
20
+
21
+ $html = $this->_addMetaTags($html);
22
+
23
+ $event->setSubject($html);
24
+ }
25
+
26
+ private function _addMetaTags($html)
27
+ {
28
+ $qss = tubepress_impl_patterns_sl_ServiceLocator::getHttpRequestParameterService();
29
+ $page = $qss->getParamValueAsInt(tubepress_spi_const_http_ParamName::PAGE, 1);
30
+
31
+ if ($page > 1) {
32
+
33
+ $html .= "\n" . '<meta name="robots" content="noindex, nofollow" />';
34
+ }
35
+
36
+ return $html;
37
+ }
38
+ }
src/main/php/add-ons/core/classes/tubepress/addons/core/impl/player/JqModalPluggablePlayerLocationService.php CHANGED
@@ -35,9 +35,12 @@ class tubepress_addons_core_impl_player_JqModalPluggablePlayerLocationService im
35
  /**
36
  * @return string Gets the relative path to this player location's JS init script.
37
  */
38
- public final function getRelativePlayerJsUrl()
39
  {
40
- return '/src/main/web/players/jqmodal/jqmodal.js';
 
 
 
41
  }
42
 
43
  /**
35
  /**
36
  * @return string Gets the relative path to this player location's JS init script.
37
  */
38
+ public final function getPlayerJsUrl()
39
  {
40
+ $environmentDetector = tubepress_impl_patterns_sl_ServiceLocator::getEnvironmentDetector();
41
+ $sysUrl = $environmentDetector->getBaseUrl();
42
+
43
+ return "$sysUrl/src/main/web/players/jqmodal/jqmodal.js";
44
  }
45
 
46
  /**
src/main/php/add-ons/core/classes/tubepress/addons/core/impl/player/NormalPluggablePlayerLocationService.php CHANGED
@@ -35,9 +35,12 @@ class tubepress_addons_core_impl_player_NormalPluggablePlayerLocationService imp
35
  /**
36
  * @return string Gets the relative path to this player location's JS init script.
37
  */
38
- public final function getRelativePlayerJsUrl()
39
  {
40
- return '/src/main/web/players/normal/normal.js';
 
 
 
41
  }
42
 
43
  /**
35
  /**
36
  * @return string Gets the relative path to this player location's JS init script.
37
  */
38
+ public final function getPlayerJsUrl()
39
  {
40
+ $environmentDetector = tubepress_impl_patterns_sl_ServiceLocator::getEnvironmentDetector();
41
+ $sysUrl = $environmentDetector->getBaseUrl();
42
+
43
+ return "$sysUrl/src/main/web/players/normal/normal.js";
44
  }
45
 
46
  /**
src/main/php/add-ons/core/classes/tubepress/addons/core/impl/player/PopupPluggablePlayerLocationService.php CHANGED
@@ -35,9 +35,12 @@ class tubepress_addons_core_impl_player_PopupPluggablePlayerLocationService impl
35
  /**
36
  * @return string Gets the relative path to this player location's JS init script.
37
  */
38
- public final function getRelativePlayerJsUrl()
39
  {
40
- return '/src/main/web/players/popup/popup.js';
 
 
 
41
  }
42
 
43
  /**
35
  /**
36
  * @return string Gets the relative path to this player location's JS init script.
37
  */
38
+ public final function getPlayerJsUrl()
39
  {
40
+ $environmentDetector = tubepress_impl_patterns_sl_ServiceLocator::getEnvironmentDetector();
41
+ $sysUrl = $environmentDetector->getBaseUrl();
42
+
43
+ return "$sysUrl/src/main/web/players/popup/popup.js";
44
  }
45
 
46
  /**
src/main/php/add-ons/core/classes/tubepress/addons/core/impl/player/ShadowboxPluggablePlayerLocationService.php CHANGED
@@ -35,9 +35,12 @@ class tubepress_addons_core_impl_player_ShadowboxPluggablePlayerLocationService
35
  /**
36
  * @return string Gets the relative path to this player location's JS init script.
37
  */
38
- public final function getRelativePlayerJsUrl()
39
  {
40
- return '/src/main/web/players/shadowbox/shadowbox.js';
 
 
 
41
  }
42
 
43
  /**
35
  /**
36
  * @return string Gets the relative path to this player location's JS init script.
37
  */
38
+ public final function getPlayerJsUrl()
39
  {
40
+ $environmentDetector = tubepress_impl_patterns_sl_ServiceLocator::getEnvironmentDetector();
41
+ $sysUrl = $environmentDetector->getBaseUrl();
42
+
43
+ return "$sysUrl/src/main/web/players/shadowbox/shadowbox.js";
44
  }
45
 
46
  /**
src/main/php/add-ons/core/classes/tubepress/addons/core/impl/player/SoloPluggablePlayerLocationService.php CHANGED
@@ -35,9 +35,12 @@ class tubepress_addons_core_impl_player_SoloPluggablePlayerLocationService imple
35
  /**
36
  * @return string Gets the relative path to this player location's JS init script.
37
  */
38
- public final function getRelativePlayerJsUrl()
39
  {
40
- return '/src/main/web/players/solo/solo.js';
 
 
 
41
  }
42
 
43
  /**
35
  /**
36
  * @return string Gets the relative path to this player location's JS init script.
37
  */
38
+ public final function getPlayerJsUrl()
39
  {
40
+ $environmentDetector = tubepress_impl_patterns_sl_ServiceLocator::getEnvironmentDetector();
41
+ $sysUrl = $environmentDetector->getBaseUrl();
42
+
43
+ return "$sysUrl/src/main/web/players/solo/solo.js";
44
  }
45
 
46
  /**
src/main/php/add-ons/core/classes/tubepress/addons/core/impl/player/StaticPluggablePlayerLocationService.php CHANGED
@@ -35,9 +35,12 @@ class tubepress_addons_core_impl_player_StaticPluggablePlayerLocationService imp
35
  /**
36
  * @return string Gets the relative path to this player location's JS init script.
37
  */
38
- public final function getRelativePlayerJsUrl()
39
  {
40
- return '/src/main/web/players/static/static.js';
 
 
 
41
  }
42
 
43
  /**
35
  /**
36
  * @return string Gets the relative path to this player location's JS init script.
37
  */
38
+ public final function getPlayerJsUrl()
39
  {
40
+ $environmentDetector = tubepress_impl_patterns_sl_ServiceLocator::getEnvironmentDetector();
41
+ $sysUrl = $environmentDetector->getBaseUrl();
42
+
43
+ return "$sysUrl/src/main/web/players/static/static.js";
44
  }
45
 
46
  /**
src/main/php/add-ons/core/classes/tubepress/addons/core/impl/player/VimeoPluggablePlayerLocationService.php CHANGED
@@ -35,9 +35,12 @@ class tubepress_addons_core_impl_player_VimeoPluggablePlayerLocationService impl
35
  /**
36
  * @return string Gets the relative path to this player location's JS init script.
37
  */
38
- public final function getRelativePlayerJsUrl()
39
  {
40
- return '/src/main/web/players/vimeo/vimeo.js';
 
 
 
41
  }
42
 
43
  /**
35
  /**
36
  * @return string Gets the relative path to this player location's JS init script.
37
  */
38
+ public final function getPlayerJsUrl()
39
  {
40
+ $environmentDetector = tubepress_impl_patterns_sl_ServiceLocator::getEnvironmentDetector();
41
+ $sysUrl = $environmentDetector->getBaseUrl();
42
+
43
+ return "$sysUrl/src/main/web/players/vimeo/vimeo.js";
44
  }
45
 
46
  /**
src/main/php/add-ons/core/classes/tubepress/addons/core/impl/player/YouTubePluggablePlayerLocationService.php CHANGED
@@ -35,9 +35,12 @@ class tubepress_addons_core_impl_player_YouTubePluggablePlayerLocationService im
35
  /**
36
  * @return string Gets the relative path to this player location's JS init script.
37
  */
38
- public final function getRelativePlayerJsUrl()
39
  {
40
- return '/src/main/web/players/youtube/youtube.js';
 
 
 
41
  }
42
 
43
  /**
35
  /**
36
  * @return string Gets the relative path to this player location's JS init script.
37
  */
38
+ public final function getPlayerJsUrl()
39
  {
40
+ $environmentDetector = tubepress_impl_patterns_sl_ServiceLocator::getEnvironmentDetector();
41
+ $sysUrl = $environmentDetector->getBaseUrl();
42
+
43
+ return "$sysUrl/src/main/web/players/youtube/youtube.js";
44
  }
45
 
46
  /**
src/main/php/add-ons/core/core.json CHANGED
@@ -34,9 +34,10 @@
34
  "tubepress_addons_core_impl_ioc_RegisterListenersCompilerPass" : "classes/tubepress/addons/core/impl/ioc/RegisterListenersCompilerPass.php",
35
  "tubepress_addons_core_impl_ioc_RegisterTaggedServicesConsumerPass" : "classes/tubepress/addons/core/impl/ioc/RegisterTaggedServicesConsumerPass.php",
36
  "tubepress_addons_core_impl_listeners_boot_OptionsStorageInitListener" : "classes/tubepress/addons/core/impl/listeners/boot/OptionsStorageInitListener.php",
 
37
  "tubepress_addons_core_impl_listeners_cssjs_GalleryInitJsBaseParams" : "classes/tubepress/addons/core/impl/listeners/cssjs/GalleryInitJsBaseParams.php",
38
- "tubepress_addons_core_impl_listeners_html_EmbeddedPlayerApiJs" : "classes/tubepress/addons/core/impl/listeners/html/EmbeddedPlayerApiJs.php",
39
  "tubepress_addons_core_impl_listeners_html_JsConfig" : "classes/tubepress/addons/core/impl/listeners/html/JsConfig.php",
 
40
  "tubepress_addons_core_impl_listeners_html_ThumbGalleryBaseJs" : "classes/tubepress/addons/core/impl/listeners/html/ThumbGalleryBaseJs.php",
41
  "tubepress_addons_core_impl_listeners_StringMagicFilter" : "classes/tubepress/addons/core/impl/listeners/StringMagicFilter.php",
42
  "tubepress_addons_core_impl_listeners_template_EmbeddedCoreVariables" : "classes/tubepress/addons/core/impl/listeners/template/EmbeddedCoreVariables.php",
34
  "tubepress_addons_core_impl_ioc_RegisterListenersCompilerPass" : "classes/tubepress/addons/core/impl/ioc/RegisterListenersCompilerPass.php",
35
  "tubepress_addons_core_impl_ioc_RegisterTaggedServicesConsumerPass" : "classes/tubepress/addons/core/impl/ioc/RegisterTaggedServicesConsumerPass.php",
36
  "tubepress_addons_core_impl_listeners_boot_OptionsStorageInitListener" : "classes/tubepress/addons/core/impl/listeners/boot/OptionsStorageInitListener.php",
37
+ "tubepress_addons_core_impl_listeners_cssjs_BaseUrlSetter" : "classes/tubepress/addons/core/impl/listeners/cssjs/BaseUrlSetter.php",
38
  "tubepress_addons_core_impl_listeners_cssjs_GalleryInitJsBaseParams" : "classes/tubepress/addons/core/impl/listeners/cssjs/GalleryInitJsBaseParams.php",
 
39
  "tubepress_addons_core_impl_listeners_html_JsConfig" : "classes/tubepress/addons/core/impl/listeners/html/JsConfig.php",
40
+ "tubepress_addons_core_impl_listeners_html_PreCssHtmlListener" : "classes/tubepress/addons/core/impl/listeners/html/PreCssHtmlListener.php",
41
  "tubepress_addons_core_impl_listeners_html_ThumbGalleryBaseJs" : "classes/tubepress/addons/core/impl/listeners/html/ThumbGalleryBaseJs.php",
42
  "tubepress_addons_core_impl_listeners_StringMagicFilter" : "classes/tubepress/addons/core/impl/listeners/StringMagicFilter.php",
43
  "tubepress_addons_core_impl_listeners_template_EmbeddedCoreVariables" : "classes/tubepress/addons/core/impl/listeners/template/EmbeddedCoreVariables.php",
src/main/php/add-ons/wordpress/classes/tubepress/addons/wordpress/impl/DefaultFrontEndCssAndJsInjector.php CHANGED
@@ -26,18 +26,11 @@ class tubepress_addons_wordpress_impl_DefaultFrontEndCssAndJsInjector implements
26
  return;
27
  }
28
 
29
- $hh = tubepress_impl_patterns_sl_ServiceLocator::getCssAndJsGenerator();
30
 
31
  /* this inline JS helps initialize TubePress */
32
- $inlineJs = $hh->getInlineJs();
33
-
34
- /* this meta stuff prevents search engines from indexing gallery pages > 1 */
35
- $meta = $hh->getMetaTags();
36
-
37
- print <<<EOT
38
- $inlineJs
39
- $meta
40
- EOT;
41
  }
42
 
43
  /**
26
  return;
27
  }
28
 
29
+ $hh = tubepress_impl_patterns_sl_ServiceLocator::getCssAndJsHtmlGenerator();
30
 
31
  /* this inline JS helps initialize TubePress */
32
+ print $hh->getCssHtml();
33
+ print $hh->getJsHtml();
 
 
 
 
 
 
 
34
  }
35
 
36
  /**
src/main/php/add-ons/wordpress/classes/tubepress/addons/wordpress/impl/DefaultWordPressFunctionWrapper.php CHANGED
@@ -471,8 +471,42 @@ class tubepress_addons_wordpress_impl_DefaultWordPressFunctionWrapper implements
471
  * 1 if the nonce has been generated in the past 12 hours or less.
472
  * 2 if the nonce was generated between 12 and 24 hours ago.
473
  */
474
- function wp_verify_nonce($nonce, $action)
475
  {
476
  return wp_verify_nonce($nonce, $action);
477
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
478
  }
471
  * 1 if the nonce has been generated in the past 12 hours or less.
472
  * 2 if the nonce was generated between 12 and 24 hours ago.
473
  */
474
+ public function wp_verify_nonce($nonce, $action)
475
  {
476
  return wp_verify_nonce($nonce, $action);
477
  }
478
+
479
+ /**
480
+ * Localizes a script, but only if script has already been added. Can also be used to include arbitrary Javascript data in a page.
481
+ *
482
+ * @param string $handle The script handle you are attaching the data for.
483
+ * @param string $objectName The name for the Javascript object which will contain the data. Note that this should
484
+ * be unique to both the script and to the plugin or theme. Thus, the value here should
485
+ * be properly prefixed with the slug or another unique value, to prevent conflicts.
486
+ * However, as this is a Javascript object name, it cannot contain dashes.
487
+ * Use underscores or camelCasing.
488
+ * @param array $l10n The data itself. The data can be either a single or multi (as of 3.3) dimensional array.
489
+ *
490
+ * @return void
491
+ */
492
+ public function wp_localize_script($handle, $objectName, array $l10n)
493
+ {
494
+ wp_localize_script($handle, $objectName, $l10n);
495
+ }
496
+
497
+ /**
498
+ * The admin_url template tag retrieves the url to the admin area for the current site with the appropriate
499
+ * protocol, 'https' if is_ssl() and 'http' otherwise. If scheme is 'http' or 'https', is_ssl() is overridden.
500
+ *
501
+ * @param string $path Path relative to the admin url.
502
+ * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http'
503
+ * or 'https' can be passed to force those schemes. The function uses get_site_url(), so
504
+ * allowed values include any accepted by that function.
505
+ *
506
+ * @return string Admin url link with optional path appended.
507
+ */
508
+ public function admin_url($path = null, $scheme = 'admin')
509
+ {
510
+ return admin_url($path, $scheme);
511
+ }
512
  }
src/main/php/add-ons/wordpress/classes/tubepress/addons/wordpress/impl/ioc/WordPressIocContainerExtension.php CHANGED
@@ -117,9 +117,12 @@ class tubepress_addons_wordpress_impl_ioc_WordPressIocContainerExtension impleme
117
 
118
  $container->register(
119
 
120
- 'tubepress_addons_wordpress_impl_listeners_cssjs_BaseUrlSetter',
121
- 'tubepress_addons_wordpress_impl_listeners_cssjs_BaseUrlSetter'
122
- )->addTag(self::TAG_EVENT_LISTENER, array('event' => tubepress_api_const_event_EventNames::CSS_JS_GLOBAL_JS_CONFIG, 'method' => 'onJsConfig', 'priority' => 10000));
 
 
 
123
  }
124
 
125
  private function _registerMessageService(tubepress_api_ioc_ContainerInterface $container)
117
 
118
  $container->register(
119
 
120
+ 'tubepress_addons_wordpress_impl_listeners_html_CssJsDequerer',
121
+ 'tubepress_addons_wordpress_impl_listeners_html_CssJsDequerer'
122
+ )->addTag(self::TAG_EVENT_LISTENER, array('event' => tubepress_api_const_event_EventNames::CSS_JS_STYLESHEETS,
123
+ 'method' => 'onCss', 'priority' => 10000))
124
+ ->addTag(self::TAG_EVENT_LISTENER, array('event' => tubepress_api_const_event_EventNames::CSS_JS_SCRIPTS,
125
+ 'method' => 'onJs', 'priority' => 10000));
126
  }
127
 
128
  private function _registerMessageService(tubepress_api_ioc_ContainerInterface $container)
src/main/php/add-ons/wordpress/classes/tubepress/addons/wordpress/impl/listeners/html/CssJsDequerer.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright 2006 - 2013 TubePress LLC (http://tubepress.com)
4
+ *
5
+ * This file is part of TubePress (http://tubepress.com)
6
+ *
7
+ * This Source Code Form is subject to the terms of the Mozilla Public
8
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
9
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10
+ */
11
+
12
+ /**
13
+ *
14
+ */
15
+ class tubepress_addons_wordpress_impl_listeners_html_CssJsDequerer
16
+ {
17
+ public function onCss(tubepress_api_event_EventInterface $event)
18
+ {
19
+ $styles = $event->getSubject();
20
+
21
+ unset($styles['tubepress']);
22
+
23
+ $event->setSubject($styles);
24
+ }
25
+
26
+ public function onJs(tubepress_api_event_EventInterface $event)
27
+ {
28
+ $scripts = $event->getSubject();
29
+
30
+ unset($scripts['tubepress']);
31
+
32
+ $event->setSubject($scripts);
33
+ }
34
+ }
src/main/php/add-ons/wordpress/classes/tubepress/addons/wordpress/impl/options/WordPressStorageManager.php CHANGED
@@ -34,7 +34,16 @@ class tubepress_addons_wordpress_impl_options_WordPressStorageManager extends tu
34
  $wordPressFunctionWrapperService =
35
  tubepress_impl_patterns_sl_ServiceLocator::getService(tubepress_addons_wordpress_spi_WordPressFunctionWrapper::_);
36
 
37
- foreach ($optionNamesToValuesMap as $missingOptionName => $defaultValue) {
 
 
 
 
 
 
 
 
 
38
 
39
  $wordPressFunctionWrapperService->add_option(self::$_optionPrefix . $missingOptionName, $defaultValue);
40
  }
34
  $wordPressFunctionWrapperService =
35
  tubepress_impl_patterns_sl_ServiceLocator::getService(tubepress_addons_wordpress_spi_WordPressFunctionWrapper::_);
36
 
37
+ $existingOptions = array_keys($this->fetchAllCurrentlyKnownOptionNamesToValues());
38
+ $incomingOptions = array_keys($optionNamesToValuesMap);
39
+ $newOptionNames = array_diff($incomingOptions, $existingOptions);
40
+ $toCreate = array();
41
+ foreach ($newOptionNames as $newOptionName) {
42
+
43
+ $toCreate[$newOptionName] = $optionNamesToValuesMap[$newOptionName];
44
+ }
45
+
46
+ foreach ($toCreate as $missingOptionName => $defaultValue) {
47
 
48
  $wordPressFunctionWrapperService->add_option(self::$_optionPrefix . $missingOptionName, $defaultValue);
49
  }
src/main/php/add-ons/wordpress/classes/tubepress/addons/wordpress/spi/WordPressFunctionWrapper.php CHANGED
@@ -76,6 +76,19 @@ interface tubepress_addons_wordpress_spi_WordPressFunctionWrapper
76
  */
77
  function add_options_page($pageTitle, $menuTitle, $capability, $menu_slug, $callback);
78
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  /**
80
  * Tests if the current request was referred from an admin page, or (given $action parameter)
81
  * if the current request carries a valid nonce. Used to avoid security exploits.
@@ -267,6 +280,21 @@ interface tubepress_addons_wordpress_spi_WordPressFunctionWrapper
267
  */
268
  function wp_enqueue_style($handle);
269
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
270
  /**
271
  * Retrieves or displays the nonce hidden form field.
272
  *
76
  */
77
  function add_options_page($pageTitle, $menuTitle, $capability, $menu_slug, $callback);
78
 
79
+ /**
80
+ * The admin_url template tag retrieves the url to the admin area for the current site with the appropriate
81
+ * protocol, 'https' if is_ssl() and 'http' otherwise. If scheme is 'http' or 'https', is_ssl() is overridden.
82
+ *
83
+ * @param string $path Path relative to the admin url.
84
+ * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). 'http'
85
+ * or 'https' can be passed to force those schemes. The function uses get_site_url(), so
86
+ * allowed values include any accepted by that function.
87
+ *
88
+ * @return string Admin url link with optional path appended.
89
+ */
90
+ function admin_url($path = null, $scheme = 'admin');
91
+
92
  /**
93
  * Tests if the current request was referred from an admin page, or (given $action parameter)
94
  * if the current request carries a valid nonce. Used to avoid security exploits.
280
  */
281
  function wp_enqueue_style($handle);
282
 
283
+ /**
284
+ * Localizes a script, but only if script has already been added. Can also be used to include arbitrary Javascript data in a page.
285
+ *
286
+ * @param string $handle The script handle you are attaching the data for.
287
+ * @param string $objectName The name for the Javascript object which will contain the data. Note that this should
288
+ * be unique to both the script and to the plugin or theme. Thus, the value here should
289
+ * be properly prefixed with the slug or another unique value, to prevent conflicts.
290
+ * However, as this is a Javascript object name, it cannot contain dashes.
291
+ * Use underscores or camelCasing.
292
+ * @param array $l10n The data itself. The data can be either a single or multi (as of 3.3) dimensional array.
293
+ *
294
+ * @return void
295
+ */
296
+ function wp_localize_script($handle, $objectName, array $l10n);
297
+
298
  /**
299
  * Retrieves or displays the nonce hidden form field.
300
  *
src/main/php/add-ons/wordpress/wordpress.json CHANGED
@@ -31,7 +31,7 @@
31
  "tubepress_addons_wordpress_impl_DefaultWpAdminHandler" : "classes/tubepress/addons/wordpress/impl/DefaultWpAdminHandler.php",
32
  "tubepress_addons_wordpress_impl_ioc_WordPressIocContainerExtension" : "classes/tubepress/addons/wordpress/impl/ioc/WordPressIocContainerExtension.php",
33
  "tubepress_addons_wordpress_impl_listeners_boot_WordPressApiIntegrator" : "classes/tubepress/addons/wordpress/impl/listeners/boot/WordPressApiIntegrator.php",
34
- "tubepress_addons_wordpress_impl_listeners_cssjs_BaseUrlSetter" : "classes/tubepress/addons/wordpress/impl/listeners/cssjs/BaseUrlSetter.php",
35
  "tubepress_addons_wordpress_impl_listeners_template_options_OptionsUiTemplateListener" : "classes/tubepress/addons/wordpress/impl/listeners/template/options/OptionsUiTemplateListener.php",
36
  "tubepress_addons_wordpress_impl_message_WordPressMessageService" : "classes/tubepress/addons/wordpress/impl/message/WordPressMessageService.php",
37
  "tubepress_addons_wordpress_impl_options_WordPressOptionsProvider" : "classes/tubepress/addons/wordpress/impl/options/WordPressOptionsProvider.php",
31
  "tubepress_addons_wordpress_impl_DefaultWpAdminHandler" : "classes/tubepress/addons/wordpress/impl/DefaultWpAdminHandler.php",
32
  "tubepress_addons_wordpress_impl_ioc_WordPressIocContainerExtension" : "classes/tubepress/addons/wordpress/impl/ioc/WordPressIocContainerExtension.php",
33
  "tubepress_addons_wordpress_impl_listeners_boot_WordPressApiIntegrator" : "classes/tubepress/addons/wordpress/impl/listeners/boot/WordPressApiIntegrator.php",
34
+ "tubepress_addons_wordpress_impl_listeners_html_CssJsDequerer" : "classes/tubepress/addons/wordpress/impl/listeners/html/CssJsDequerer.php",
35
  "tubepress_addons_wordpress_impl_listeners_template_options_OptionsUiTemplateListener" : "classes/tubepress/addons/wordpress/impl/listeners/template/options/OptionsUiTemplateListener.php",
36
  "tubepress_addons_wordpress_impl_message_WordPressMessageService" : "classes/tubepress/addons/wordpress/impl/message/WordPressMessageService.php",
37
  "tubepress_addons_wordpress_impl_options_WordPressOptionsProvider" : "classes/tubepress/addons/wordpress/impl/options/WordPressOptionsProvider.php",
src/main/php/add-ons/youtube/classes/tubepress/addons/youtube/impl/embedded/YouTubePluggableEmbeddedPlayerService.php CHANGED
@@ -39,9 +39,12 @@ class tubepress_addons_youtube_impl_embedded_YouTubePluggableEmbeddedPlayerServi
39
  */
40
  public final function getDataUrlForVideo($videoId)
41
  {
42
- $link = new ehough_curly_Url('http://www.youtube.com/embed/' . $videoId);
43
-
44
  $context = tubepress_impl_patterns_sl_ServiceLocator::getExecutionContext();
 
 
 
 
 
45
 
46
  $autoPlay = $context->get(tubepress_api_const_options_names_Embedded::AUTOPLAY);
47
  $loop = $context->get(tubepress_api_const_options_names_Embedded::LOOP);
@@ -62,6 +65,7 @@ class tubepress_addons_youtube_impl_embedded_YouTubePluggableEmbeddedPlayerServi
62
  $link->setQueryVariable('modestbranding', tubepress_impl_embedded_EmbeddedPlayerUtils::booleanToOneOrZero($modestBranding));
63
  $link->setQueryVariable('rel', tubepress_impl_embedded_EmbeddedPlayerUtils::booleanToOneOrZero($showRelated));
64
  $link->setQueryVariable('showinfo', tubepress_impl_embedded_EmbeddedPlayerUtils::booleanToOneOrZero($showInfo));
 
65
 
66
  return $link;
67
  }
39
  */
40
  public final function getDataUrlForVideo($videoId)
41
  {
 
 
42
  $context = tubepress_impl_patterns_sl_ServiceLocator::getExecutionContext();
43
+ $link = new ehough_curly_Url('https://www.youtube.com/embed/' . $videoId);
44
+ $qss = tubepress_impl_patterns_sl_ServiceLocator::getQueryStringService();
45
+ $url = new ehough_curly_Url($qss->getFullUrl($_SERVER));
46
+ $origin = $url->getScheme() . '://' . $url->getHost();
47
+
48
 
49
  $autoPlay = $context->get(tubepress_api_const_options_names_Embedded::AUTOPLAY);
50
  $loop = $context->get(tubepress_api_const_options_names_Embedded::LOOP);
65
  $link->setQueryVariable('modestbranding', tubepress_impl_embedded_EmbeddedPlayerUtils::booleanToOneOrZero($modestBranding));
66
  $link->setQueryVariable('rel', tubepress_impl_embedded_EmbeddedPlayerUtils::booleanToOneOrZero($showRelated));
67
  $link->setQueryVariable('showinfo', tubepress_impl_embedded_EmbeddedPlayerUtils::booleanToOneOrZero($showInfo));
68
+ $link->setQueryVariable('origin', $origin);
69
 
70
  return $link;
71
  }
src/main/php/add-ons/youtube/classes/tubepress/addons/youtube/impl/ioc/YouTubeIocContainerExtension.php CHANGED
@@ -47,8 +47,8 @@ class tubepress_addons_youtube_impl_ioc_YouTubeIocContainerExtension implements
47
 
48
  $container->register(
49
 
50
- 'tubepress_addons_youtube_impl_listeners_options_YouTubePlaylistPlPrefixRemover',
51
- 'tubepress_addons_youtube_impl_listeners_options_YouTubePlaylistPlPrefixRemover'
52
  )->addTag(self::TAG_EVENT_LISTENER, array('event' => tubepress_api_const_event_EventNames::OPTIONS_NVP_PREVALIDATIONSET, 'method' => 'onPreValidationOptionSet', 'priority' => 10000));
53
  }
54
 
47
 
48
  $container->register(
49
 
50
+ 'tubepress_addons_youtube_impl_listeners_options_YouTubePlaylistHandler',
51
+ 'tubepress_addons_youtube_impl_listeners_options_YouTubePlaylistHandler'
52
  )->addTag(self::TAG_EVENT_LISTENER, array('event' => tubepress_api_const_event_EventNames::OPTIONS_NVP_PREVALIDATIONSET, 'method' => 'onPreValidationOptionSet', 'priority' => 10000));
53
  }
54
 
src/main/php/add-ons/youtube/classes/tubepress/addons/youtube/impl/listeners/options/YouTubePlaylistHandler.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright 2006 - 2012 Eric D. Hough (eric@tubepress.org)
4
+ */
5
+ class tubepress_addons_youtube_impl_listeners_options_YouTubePlaylistHandler
6
+ {
7
+ public function onPreValidationOptionSet(tubepress_api_event_EventInterface $event)
8
+ {
9
+ $name = $event->getArgument('optionName');
10
+
11
+ /** We only care about playlistValue. */
12
+ if ($name !== tubepress_addons_youtube_api_const_options_names_GallerySource::YOUTUBE_PLAYLIST_VALUE) {
13
+
14
+ return;
15
+ }
16
+
17
+ $filteredValue = $this->_maybeGetListValueFromUrl($event->getSubject());
18
+ $filteredValue = $this->_maybeRemoveLeadingPL($filteredValue);
19
+
20
+ $event->setSubject($filteredValue);
21
+ }
22
+
23
+ private function _maybeRemoveLeadingPL($originalValue)
24
+ {
25
+ if (!tubepress_impl_util_StringUtils::startsWith($originalValue, 'PL')) {
26
+
27
+ return $originalValue;
28
+ }
29
+
30
+ return tubepress_impl_util_StringUtils::replaceFirst('PL', '', $originalValue);
31
+ }
32
+
33
+ private function _maybeGetListValueFromUrl($originalValue)
34
+ {
35
+ $url = null;
36
+
37
+ try {
38
+
39
+ $url = new ehough_curly_Url($originalValue);
40
+
41
+ } catch (Exception $e) {
42
+
43
+ return $originalValue;
44
+ }
45
+
46
+ $host = $url->getHost();
47
+
48
+ if (!tubepress_impl_util_StringUtils::endsWith($host, 'youtube.com')) {
49
+
50
+ return $originalValue;
51
+ }
52
+
53
+ $params = $url->getQueryVariables();
54
+
55
+ if (!array_key_exists('list', $params)) {
56
+
57
+ return $originalValue;
58
+ }
59
+
60
+ return $params['list'];
61
+ }
62
+ }
src/main/php/add-ons/youtube/classes/tubepress/addons/youtube/impl/listeners/options/YouTubePlaylistPlPrefixRemover.php DELETED
@@ -1,64 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright 2006 - 2013 TubePress LLC (http://tubepress.com)
4
- *
5
- * This file is part of TubePress (http://tubepress.com)
6
- *
7
- * This Source Code Form is subject to the terms of the Mozilla Public
8
- * License, v. 2.0. If a copy of the MPL was not distributed with this
9
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10
- */
11
-
12
- /**
13
- * Removes "PL" from the start of playlist values.
14
- */
15
- class tubepress_addons_youtube_impl_listeners_options_YouTubePlaylistPlPrefixRemover
16
- {
17
- /**
18
- * @var ehough_epilog_Logger
19
- */
20
- private $_logger;
21
-
22
- public function __construct()
23
- {
24
- $this->_logger = ehough_epilog_LoggerFactory::getLogger('YouTube Playlist PL Prefix Remover');
25
- }
26
-
27
-
28
- public function onPreValidationOptionSet(tubepress_api_event_EventInterface $event)
29
- {
30
- $name = $event->getArgument('optionName');
31
-
32
- /** We only care about playlistValue. */
33
- if ($name !== tubepress_addons_youtube_api_const_options_names_GallerySource::YOUTUBE_PLAYLIST_VALUE) {
34
-
35
- return;
36
- }
37
-
38
- $value = $event->getSubject();
39
-
40
- if (! is_string($value)) {
41
-
42
- return;
43
- }
44
-
45
- if (tubepress_impl_util_StringUtils::startsWith($value, 'PL')) {
46
-
47
- if ($this->_logger->isHandling(ehough_epilog_Logger::DEBUG)) {
48
-
49
- $this->_logger->debug(sprintf('Removing \'PL\' prefix from playlist value of %s', $value));
50
- }
51
-
52
- $newValue = tubepress_impl_util_StringUtils::replaceFirst('PL', '', $value);
53
-
54
- $event->setSubject($newValue);
55
-
56
- return;
57
- }
58
-
59
- if ($this->_logger->isHandling(ehough_epilog_Logger::DEBUG)) {
60
-
61
- $this->_logger->debug(sprintf('Playlist value %s does not beging with \'PL\'', $value));
62
- }
63
- }
64
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/main/php/add-ons/youtube/classes/tubepress/addons/youtube/impl/options/YouTubeOptionsProvider.php CHANGED
@@ -160,7 +160,8 @@ class tubepress_addons_youtube_impl_options_YouTubeOptionsProvider implements tu
160
 
161
  $option = new tubepress_spi_options_OptionDescriptor(tubepress_addons_youtube_api_const_options_names_GallerySource::YOUTUBE_PLAYLIST_VALUE);
162
  $option->setDefaultValue('F679CB240DD4C112');
163
- $option->setDescription('Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser\'s address bar (while looking at a YouTube playlist). It comes right after the "p=". For instance: <a href="http://www.youtube.com/playlist?p=F679CB240DD4C112" target="_blank">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>'); //>(translatable)<
 
164
  $option->setLabel('This YouTube playlist'); //>(translatable)<
165
  $option->setValidValueRegex('/[\w-]+/');
166
  $toReturn[] = $option;
160
 
161
  $option = new tubepress_spi_options_OptionDescriptor(tubepress_addons_youtube_api_const_options_names_GallerySource::YOUTUBE_PLAYLIST_VALUE);
162
  $option->setDefaultValue('F679CB240DD4C112');
163
+ $option->setDescription(sprintf('The URL to any YouTube playlist (e.g. <a href="%s" target="_blank">%s</a>) or just the playlist identifier (e.g. %s).', //>(translatable)<
164
+ 'http://youtube.com/playlist?list=48A83AD3506C9D36', 'http://youtube.com/playlist?list=48A83AD3506C9D36', '48A83AD3506C9D36'));
165
  $option->setLabel('This YouTube playlist'); //>(translatable)<
166
  $option->setValidValueRegex('/[\w-]+/');
167
  $toReturn[] = $option;
src/main/php/add-ons/youtube/youtube.json CHANGED
@@ -32,7 +32,7 @@
32
  "tubepress_addons_youtube_api_const_options_values_YouTube" : "classes/tubepress/addons/youtube/api/const/options/values/YouTube.php",
33
  "tubepress_addons_youtube_impl_embedded_YouTubePluggableEmbeddedPlayerService" : "classes/tubepress/addons/youtube/impl/embedded/YouTubePluggableEmbeddedPlayerService.php",
34
  "tubepress_addons_youtube_impl_listeners_http_YouTubeHttpErrorResponseListener" : "classes/tubepress/addons/youtube/impl/listeners/http/YouTubeHttpErrorResponseListener.php",
35
- "tubepress_addons_youtube_impl_listeners_options_YouTubePlaylistPlPrefixRemover" : "classes/tubepress/addons/youtube/impl/listeners/options/YouTubePlaylistPlPrefixRemover.php",
36
  "tubepress_addons_youtube_impl_listeners_video_YouTubeVideoConstructionListener" : "classes/tubepress/addons/youtube/impl/listeners/video/YouTubeVideoConstructionListener.php",
37
  "tubepress_addons_youtube_impl_options_YouTubeOptionsProvider" : "classes/tubepress/addons/youtube/impl/options/YouTubeOptionsProvider.php",
38
  "tubepress_addons_youtube_impl_ioc_YouTubeIocContainerExtension" : "classes/tubepress/addons/youtube/impl/ioc/YouTubeIocContainerExtension.php",
32
  "tubepress_addons_youtube_api_const_options_values_YouTube" : "classes/tubepress/addons/youtube/api/const/options/values/YouTube.php",
33
  "tubepress_addons_youtube_impl_embedded_YouTubePluggableEmbeddedPlayerService" : "classes/tubepress/addons/youtube/impl/embedded/YouTubePluggableEmbeddedPlayerService.php",
34
  "tubepress_addons_youtube_impl_listeners_http_YouTubeHttpErrorResponseListener" : "classes/tubepress/addons/youtube/impl/listeners/http/YouTubeHttpErrorResponseListener.php",
35
+ "tubepress_addons_youtube_impl_listeners_options_YouTubePlaylistHandler" : "classes/tubepress/addons/youtube/impl/listeners/options/YouTubePlaylistHandler.php",
36
  "tubepress_addons_youtube_impl_listeners_video_YouTubeVideoConstructionListener" : "classes/tubepress/addons/youtube/impl/listeners/video/YouTubeVideoConstructionListener.php",
37
  "tubepress_addons_youtube_impl_options_YouTubeOptionsProvider" : "classes/tubepress/addons/youtube/impl/options/YouTubeOptionsProvider.php",
38
  "tubepress_addons_youtube_impl_ioc_YouTubeIocContainerExtension" : "classes/tubepress/addons/youtube/impl/ioc/YouTubeIocContainerExtension.php",
src/main/php/classes/tubepress/api/const/event/EventNames.php CHANGED
@@ -25,29 +25,27 @@ class tubepress_api_const_event_EventNames
25
  */
26
  const BOOT_COMPLETE = 'tubepress.core.boot.complete';
27
 
28
-
29
-
30
-
31
  /**
32
- * This event is fired when TubePress generates inline CSS for the HTML <head>.
33
  *
34
- * @subject string The inline CSS.
 
35
  *
36
  * @api
37
- * @since 3.1.0
38
  */
39
- const CSS_JS_INLINE_CSS = 'tubepress.core.cssjs.inlineCss';
40
 
41
  /**
42
- * This event is fired when TubePress generates inline JS. This may show up in either the HTML
43
- * <head>, or lower in the DOM. It will be printed *before* the tubepress.js <script> tag.
44
  *
45
- * @subject string The inline JS.
 
46
  *
47
  * @api
48
- * @since 3.1.0
49
  */
50
- const CSS_JS_INLINE_JS = 'tubepress.core.cssjs.inlineJs';
51
 
52
  /**
53
  * This event is fired when TubePress builds the gallery initialization JS code.
@@ -60,43 +58,6 @@ class tubepress_api_const_event_EventNames
60
  */
61
  const CSS_JS_GALLERY_INIT = 'tubepress.core.cssjs.galleryInit';
62
 
63
- /**
64
- * This event is fired when TubePress generates HTML <meta> tags for the HTML <head>.
65
- *
66
- * @subject string The HTML <meta> tags.
67
- *
68
- * @api
69
- * @since 3.1.0
70
- */
71
- const CSS_JS_META_TAGS = 'tubepress.core.cssjs.metaTags';
72
-
73
- /**
74
- * This event is fired when TubePress generates the HTML <script> tag for jQuery.
75
- *
76
- * @subject ehough_curly_Url The URL for jQuery.
77
- *
78
- * @api
79
- * @since 3.1.0
80
- */
81
- const CSS_JS_SCRIPT_URL_JQUERY = 'tubepress.core.cssjs.url.jQuery';
82
-
83
- /**
84
- * This event is fired when TubePress generates the HTML <script> tag for tubepress.js.
85
- *
86
- * @subject ehough_curly_Url The URL to tubepress.js.
87
- *
88
- * @api
89
- * @since 3.1.0
90
- */
91
- const CSS_JS_SCRIPT_URL_TUBEPRESSJS = 'tubepress.core.cssjs.url.tubePressJs';
92
-
93
- /**
94
- * This event is fired when TubePress generates the HTML <link> tag for tubepress.css.
95
- *
96
- * @subject ehough_curly_Url The URL to tubepress.css.
97
- */
98
- const CSS_JS_CSS_URL_TUBEPRESS = 'tubepress.core.cssjs.url.tubePressCss';
99
-
100
  /**
101
  * This event is fired when TubePress builds the TubePressJsConfig object.
102
  *
@@ -108,7 +69,6 @@ class tubepress_api_const_event_EventNames
108
  */
109
  const CSS_JS_GLOBAL_JS_CONFIG = 'tubepress.core.cssjs.globalJsConfig';
110
 
111
-
112
  /**
113
  * This event is fired when TubePress encounters an error during processing and is
114
  * about to return an error message to the screen.
@@ -122,9 +82,6 @@ class tubepress_api_const_event_EventNames
122
  */
123
  const ERROR_EXCEPTION_CAUGHT = 'tubepress.core.error.exceptionCaught';
124
 
125
-
126
-
127
-
128
  /**
129
  * This event is fired when TubePress builds the HTML for an embedded video player.
130
  *
@@ -197,8 +154,45 @@ class tubepress_api_const_event_EventNames
197
  */
198
  const HTML_THUMBNAIL_GALLERY = 'tubepress.core.html.thumbnailGallery';
199
 
 
 
 
 
 
 
 
 
 
200
 
 
 
 
 
 
 
 
 
 
201
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
202
 
203
  /**
204
  * This event is fired after TubePress fetches a HTTP response from the network.
@@ -213,7 +207,6 @@ class tubepress_api_const_event_EventNames
213
  */
214
  const HTTP_RESPONSE = 'tubepress.core.http.response';
215
 
216
-
217
  /**
218
  * This event is fired when an option descriptor is registered.
219
  *
@@ -334,9 +327,6 @@ class tubepress_api_const_event_EventNames
334
  */
335
  const TEMPLATE_THUMBNAIL_GALLERY = 'tubepress.core.template.thumbnailGallery';
336
 
337
-
338
-
339
-
340
  /**
341
  * This event is fired when a TubePress builds a TubePress video. Some providers may add additional
342
  * arguments to this event.
25
  */
26
  const BOOT_COMPLETE = 'tubepress.core.boot.complete';
27
 
 
 
 
28
  /**
29
+ * This event is fied when TubePress is about to print its JS files (either in <head> or near </body>).
30
  *
31
+ * @subject array An associative array where keys are script handles and values are script details.
32
+ * See tubepress_spi_html_CssAndJsRegistryInterface::getScript() for details on array values.
33
  *
34
  * @api
35
+ * @since 3.1.3
36
  */
37
+ const CSS_JS_STYLESHEETS = 'tubepress.core.cssjs.stylesheets';
38
 
39
  /**
40
+ * This event is fied when TubePress is about to print its stylesheets to the HTML head.
 
41
  *
42
+ * @subject array An associative array where keys are style handles and values are style details.
43
+ * See tubepress_spi_html_CssAndJsRegistryInterface::getStyle() for details on array values.
44
  *
45
  * @api
46
+ * @since 3.1.3
47
  */
48
+ const CSS_JS_SCRIPTS = 'tubepress.core.cssjs.scripts';
49
 
50
  /**
51
  * This event is fired when TubePress builds the gallery initialization JS code.
58
  */
59
  const CSS_JS_GALLERY_INIT = 'tubepress.core.cssjs.galleryInit';
60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  /**
62
  * This event is fired when TubePress builds the TubePressJsConfig object.
63
  *
69
  */
70
  const CSS_JS_GLOBAL_JS_CONFIG = 'tubepress.core.cssjs.globalJsConfig';
71
 
 
72
  /**
73
  * This event is fired when TubePress encounters an error during processing and is
74
  * about to return an error message to the screen.
82
  */
83
  const ERROR_EXCEPTION_CAUGHT = 'tubepress.core.error.exceptionCaught';
84
 
 
 
 
85
  /**
86
  * This event is fired when TubePress builds the HTML for an embedded video player.
87
  *
154
  */
155
  const HTML_THUMBNAIL_GALLERY = 'tubepress.core.html.thumbnailGallery';
156
 
157
+ /**
158
+ * This event is fired immediately before TubePress prints out the HTML for its stylesheets.
159
+ *
160
+ * @subject string The HTML for TubePress's stylesheets.
161
+ *
162
+ * @api
163
+ * @since 3.1.3
164
+ */
165
+ const HTML_STYLESHEETS_PRE = 'tubepress.core.html.stylesheets.pre';
166
 
167
+ /**
168
+ * This event is fired immediately after TubePress prints out the HTML for its stylesheets.
169
+ *
170
+ * @subject string The HTML for TubePress's stylesheets.
171
+ *
172
+ * @api
173
+ * @since 3.1.3
174
+ */
175
+ const HTML_STYLESHEETS_POST = 'tubepress.core.html.stylesheets.post';
176
 
177
+ /**
178
+ * This event is fired immediately before TubePress prints out the HTML for its scripts.
179
+ *
180
+ * @subject string The HTML for TubePress's scripts.
181
+ *
182
+ * @api
183
+ * @since 3.1.3
184
+ */
185
+ const HTML_SCRIPTS_PRE = 'tubepress.core.html.scripts.pre';
186
+
187
+ /**
188
+ * This event is fired immediately after TubePress prints out the HTML for its scripts.
189
+ *
190
+ * @subject string The HTML for TubePress's scripts.
191
+ *
192
+ * @api
193
+ * @since 3.1.3
194
+ */
195
+ const HTML_SCRIPTS_POST = 'tubepress.core.html.scripts.post';
196
 
197
  /**
198
  * This event is fired after TubePress fetches a HTTP response from the network.
207
  */
208
  const HTTP_RESPONSE = 'tubepress.core.http.response';
209
 
 
210
  /**
211
  * This event is fired when an option descriptor is registered.
212
  *
327
  */
328
  const TEMPLATE_THUMBNAIL_GALLERY = 'tubepress.core.template.thumbnailGallery';
329
 
 
 
 
330
  /**
331
  * This event is fired when a TubePress builds a TubePress video. Some providers may add additional
332
  * arguments to this event.
src/main/php/classes/tubepress/impl/cache/ItemDecorator.php CHANGED
@@ -12,19 +12,19 @@
12
  /**
13
  * Decorates ehough_stash_Item to handle cache cleaning and TTL.
14
  */
15
- class tubepress_impl_cache_ItemDecorator implements ehough_stash_ItemInterface
16
  {
17
  /**
18
- * @var ehough_stash_ItemInterface
19
  */
20
  private $_delegate;
21
 
22
  /**
23
- * @var ehough_stash_PoolInterface
24
  */
25
  private $_parentCache;
26
 
27
- public function __construct(ehough_stash_ItemInterface $delegate, ehough_stash_PoolInterface $parentCache)
28
  {
29
  $this->_delegate = $delegate;
30
  $this->_parentCache = $parentCache;
@@ -54,9 +54,9 @@ class tubepress_impl_cache_ItemDecorator implements ehough_stash_ItemInterface
54
  *
55
  * @return mixed
56
  */
57
- public function get()
58
  {
59
- return $this->_delegate->get();
60
  }
61
 
62
  /**
@@ -93,7 +93,7 @@ class tubepress_impl_cache_ItemDecorator implements ehough_stash_ItemInterface
93
  */
94
  if ($cleaningFactor > 0 && rand(1, $cleaningFactor) === 1) {
95
 
96
- $this->_parentCache->clear();
97
  }
98
 
99
  if ($ttl === null) {
@@ -104,30 +104,38 @@ class tubepress_impl_cache_ItemDecorator implements ehough_stash_ItemInterface
104
  return $this->_delegate->set($value, $ttl);
105
  }
106
 
107
- /**
108
- * Validates the current state of the item in the cache.
109
- *
110
- * Checks the validity of a cache result. If the object is good (is not a
111
- * miss, and meets all the standards set by the Implementing Library) then
112
- * this function returns true.
113
- *
114
- * @return bool
115
- */
116
- public function isValid()
117
  {
118
- return $this->_delegate->isValid();
119
  }
120
 
121
- /**
122
- * Removes the current key from the cache.
123
- *
124
- * Returns true if the item is no longer present (either because it was
125
- * removed or was not present to begin with).
126
- *
127
- * @return bool
128
- */
129
- public function remove()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  {
131
- return $this->_delegate->remove();
132
  }
133
  }
12
  /**
13
  * Decorates ehough_stash_Item to handle cache cleaning and TTL.
14
  */
15
+ class tubepress_impl_cache_ItemDecorator implements ehough_stash_interfaces_ItemInterface
16
  {
17
  /**
18
+ * @var ehough_stash_interfaces_ItemInterface
19
  */
20
  private $_delegate;
21
 
22
  /**
23
+ * @var ehough_stash_interfaces_PoolInterface
24
  */
25
  private $_parentCache;
26
 
27
+ public function __construct(ehough_stash_interfaces_ItemInterface $delegate, ehough_stash_interfaces_PoolInterface $parentCache)
28
  {
29
  $this->_delegate = $delegate;
30
  $this->_parentCache = $parentCache;
54
  *
55
  * @return mixed
56
  */
57
+ public function get($invalidation = 0, $arg = null, $arg2 = null)
58
  {
59
+ return $this->_delegate->get($invalidation, $arg, $arg2);
60
  }
61
 
62
  /**
93
  */
94
  if ($cleaningFactor > 0 && rand(1, $cleaningFactor) === 1) {
95
 
96
+ $this->_parentCache->flush();
97
  }
98
 
99
  if ($ttl === null) {
104
  return $this->_delegate->set($value, $ttl);
105
  }
106
 
107
+ public function disable()
 
 
 
 
 
 
 
 
 
108
  {
109
+ return $this->_delegate->disable();
110
  }
111
 
112
+ public function clear()
113
+ {
114
+ return $this->_delegate->clear();
115
+ }
116
+
117
+ public function isMiss()
118
+ {
119
+ return $this->_delegate->isMiss();
120
+ }
121
+
122
+ public function lock($ttl = null)
123
+ {
124
+ return $this->_delegate->lock($ttl);
125
+ }
126
+
127
+ public function extend($ttl = null)
128
+ {
129
+ return $this->_delegate->extend($ttl);
130
+ }
131
+
132
+ public function isDisabled()
133
+ {
134
+ return $this->_delegate->isDisabled();
135
+ }
136
+
137
+ public function setLogger($logger)
138
  {
139
+ $this->_delegate->setLogger($logger);
140
  }
141
  }
src/main/php/classes/tubepress/impl/cache/PoolDecorator.php CHANGED
@@ -12,14 +12,14 @@
12
  /**
13
  * Basic cache functionality.
14
  */
15
- class tubepress_impl_cache_PoolDecorator implements ehough_stash_PoolInterface
16
  {
17
  /**
18
- * @var ehough_stash_PoolInterface
19
  */
20
  private $_delegate;
21
 
22
- public function __construct(ehough_stash_PoolInterface $delegate)
23
  {
24
  $this->_delegate = $delegate;
25
  }
@@ -32,14 +32,12 @@ class tubepress_impl_cache_PoolDecorator implements ehough_stash_PoolInterface
32
  * backends, but must be able to supply the original key if needed. Keys
33
  * should not contain the special characters listed:
34
  * {}()/\@
35
- *
36
- * @param string $key
37
- *
38
- * @return ehough_stash_ItemInterface
39
  */
40
- public function getItem($key)
41
  {
42
- return $this->_toDecoratedItem($this->_delegate->getItem($key));
43
  }
44
 
45
  /**
@@ -63,18 +61,33 @@ class tubepress_impl_cache_PoolDecorator implements ehough_stash_PoolInterface
63
  return new ArrayIterator($items);
64
  }
65
 
66
- /**
67
- * Clears the cache pool of all items.
68
- *
69
- * @return bool
70
- */
71
- public function clear()
72
  {
73
- return $this->_delegate->clear();
74
  }
75
 
76
- private function _toDecoratedItem(ehough_stash_ItemInterface $item)
77
  {
78
- return new tubepress_impl_cache_ItemDecorator($item, $this);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  }
80
  }
12
  /**
13
  * Basic cache functionality.
14
  */
15
+ class tubepress_impl_cache_PoolDecorator implements ehough_stash_interfaces_PoolInterface
16
  {
17
  /**
18
+ * @var ehough_stash_interfaces_PoolInterface
19
  */
20
  private $_delegate;
21
 
22
+ public function __construct(ehough_stash_interfaces_PoolInterface $delegate)
23
  {
24
  $this->_delegate = $delegate;
25
  }
32
  * backends, but must be able to supply the original key if needed. Keys
33
  * should not contain the special characters listed:
34
  * {}()/\@
35
+ * *
36
+ * @return ehough_stash_interfaces_ItemInterface
 
 
37
  */
38
+ public function getItem()
39
  {
40
+ return $this->_toDecoratedItem($this->_delegate->getItem(func_get_args()));
41
  }
42
 
43
  /**
61
  return new ArrayIterator($items);
62
  }
63
 
64
+ private function _toDecoratedItem(ehough_stash_interfaces_ItemInterface $item)
 
 
 
 
 
65
  {
66
+ return new tubepress_impl_cache_ItemDecorator($item, $this);
67
  }
68
 
69
+ public function flush()
70
  {
71
+ return $this->_delegate->flush();
72
+ }
73
+
74
+ public function purge()
75
+ {
76
+ return $this->_delegate->purge();
77
+ }
78
+
79
+ public function setDriver(ehough_stash_interfaces_DriverInterface $driver)
80
+ {
81
+ $this->_delegate->setDriver($driver);
82
+ }
83
+
84
+ public function getDriver()
85
+ {
86
+ return $this->_delegate->getDriver();
87
+ }
88
+
89
+ public function setLogger($logger)
90
+ {
91
+ $this->_delegate->setLogger($logger);
92
  }
93
  }
src/main/php/classes/tubepress/impl/environment/SimpleEnvironmentDetector.php CHANGED
@@ -20,13 +20,33 @@ class tubepress_impl_environment_SimpleEnvironmentDetector implements tubepress_
20
  private $_version;
21
 
22
  /**
23
- * @var string
24
  */
25
  private $_baseUrl;
26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  public function __construct()
28
  {
29
- $this->_version = tubepress_spi_version_Version::parse('3.1.0');
30
  }
31
 
32
  /**
@@ -36,7 +56,12 @@ class tubepress_impl_environment_SimpleEnvironmentDetector implements tubepress_
36
  */
37
  public function isPro()
38
  {
39
- return is_readable(dirname(__FILE__) . '/../../../TubePressPro.php');
 
 
 
 
 
40
  }
41
 
42
  /**
@@ -46,8 +71,13 @@ class tubepress_impl_environment_SimpleEnvironmentDetector implements tubepress_
46
  */
47
  public function isWordPress()
48
  {
49
- return strpos(realpath(__FILE__), 'wp-content' . DIRECTORY_SEPARATOR . 'plugins') !== false
 
 
50
  || function_exists('wp_cron');
 
 
 
51
  }
52
 
53
  /**
@@ -58,24 +88,31 @@ class tubepress_impl_environment_SimpleEnvironmentDetector implements tubepress_
58
  */
59
  public function getUserContentDirectory()
60
  {
61
- if (defined('TUBEPRESS_CONTENT_DIRECTORY')) {
62
 
63
- return rtrim(TUBEPRESS_CONTENT_DIRECTORY, DIRECTORY_SEPARATOR);
64
- }
65
-
66
- if ($this->isWordPress()) {
67
 
68
- if (! defined('WP_CONTENT_DIR' )) {
69
 
70
- define('WP_CONTENT_DIR', ABSPATH . 'wp-content');
71
  }
72
 
73
- return WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'tubepress-content';
 
 
74
 
75
- } else {
 
76
 
77
- return TUBEPRESS_ROOT . DIRECTORY_SEPARATOR . 'tubepress-content';
 
 
 
 
 
78
  }
 
 
79
  }
80
 
81
  /**
@@ -97,12 +134,63 @@ class tubepress_impl_environment_SimpleEnvironmentDetector implements tubepress_
97
  }
98
 
99
  public function setBaseUrl($url)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  {
101
  if (!($url instanceof ehough_curly_Url)) {
102
 
103
  $url = new ehough_curly_Url($url);
104
  }
105
 
106
- $this->_baseUrl = rtrim($url->toString(), '/');
107
  }
108
  }
20
  private $_version;
21
 
22
  /**
23
+ * @var string TubePress installation URL.
24
  */
25
  private $_baseUrl;
26
 
27
+ /**
28
+ * @var string User content URL.
29
+ */
30
+ private $_userContentUrl;
31
+
32
+ /**
33
+ * @var bool Cache to reduce file lookups.
34
+ */
35
+ private $_cacheIsWordPress;
36
+
37
+ /**
38
+ * @var bool Cache to reduce file lookups.
39
+ */
40
+ private $_cacheIsPro;
41
+
42
+ /**
43
+ * @var string Cache to reduce computation.
44
+ */
45
+ private $_cacheUserContentDirectory;
46
+
47
  public function __construct()
48
  {
49
+ $this->_version = tubepress_spi_version_Version::parse('3.1.3');
50
  }
51
 
52
  /**
56
  */
57
  public function isPro()
58
  {
59
+ if (!isset($this->_cacheIsPro)) {
60
+
61
+ $this->_cacheIsPro = is_readable(dirname(__FILE__) . '/../../../TubePressPro.php');
62
+ }
63
+
64
+ return $this->_cacheIsPro;
65
  }
66
 
67
  /**
71
  */
72
  public function isWordPress()
73
  {
74
+ if (!isset($this->_cacheIsWordPress)) {
75
+
76
+ $this->_cacheIsWordPress = strpos(realpath(__FILE__), 'wp-content' . DIRECTORY_SEPARATOR . 'plugins') !== false
77
  || function_exists('wp_cron');
78
+ }
79
+
80
+ return $this->_cacheIsWordPress;
81
  }
82
 
83
  /**
88
  */
89
  public function getUserContentDirectory()
90
  {
91
+ if (!isset($this->_cacheUserContentDirectory)) {
92
 
93
+ if (defined('TUBEPRESS_CONTENT_DIRECTORY')) {
 
 
 
94
 
95
+ $this->_cacheUserContentDirectory = rtrim(TUBEPRESS_CONTENT_DIRECTORY, DIRECTORY_SEPARATOR);
96
 
97
+ return $this->_cacheUserContentDirectory;
98
  }
99
 
100
+ if ($this->isWordPress()) {
101
+
102
+ if (! defined('WP_CONTENT_DIR' )) {
103
 
104
+ define('WP_CONTENT_DIR', ABSPATH . 'wp-content');
105
+ }
106
 
107
+ $this->_cacheUserContentDirectory = WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'tubepress-content';
108
+
109
+ } else {
110
+
111
+ $this->_cacheUserContentDirectory = TUBEPRESS_ROOT . DIRECTORY_SEPARATOR . 'tubepress-content';
112
+ }
113
  }
114
+
115
+ return $this->_cacheUserContentDirectory;
116
  }
117
 
118
  /**
134
  }
135
 
136
  public function setBaseUrl($url)
137
+ {
138
+ $this->_baseUrl = $this->_urlToString($url);
139
+ }
140
+
141
+ /**
142
+ * @return string The user content URL.
143
+ */
144
+ public function getUserContentUrl()
145
+ {
146
+ if (!isset($this->_userContentUrl)) {
147
+
148
+ if (defined('TUBEPRESS_CONTENT_URL')) {
149
+
150
+ $this->_userContentUrl = rtrim(TUBEPRESS_CONTENT_URL, DIRECTORY_SEPARATOR);
151
+
152
+ return $this->_userContentUrl;
153
+ }
154
+
155
+ if ($this->isWordPress()) {
156
+
157
+ /**
158
+ * @var $wordPressFunctionWrapper tubepress_addons_wordpress_spi_WordPressFunctionWrapper
159
+ */
160
+ $wordPressFunctionWrapper = tubepress_impl_patterns_sl_ServiceLocator::getService(tubepress_addons_wordpress_spi_WordPressFunctionWrapper::_);
161
+
162
+ $prefix = $wordPressFunctionWrapper->content_url();
163
+
164
+ } else {
165
+
166
+ $prefix = $this->getBaseUrl();
167
+ }
168
+
169
+ $this->_userContentUrl = $this->_urlToString($prefix . '/tubepress-content');
170
+ }
171
+
172
+ return $this->_userContentUrl;
173
+ }
174
+
175
+ /**
176
+ * Set the user content URL.
177
+ *
178
+ * @param mixed $url The user content URL.
179
+ *
180
+ * @return void
181
+ */
182
+ public function setUserContentUrl($url)
183
+ {
184
+ $this->_userContentUrl = $this->_urlToString($url);
185
+ }
186
+
187
+ private function _urlToString($url)
188
  {
189
  if (!($url instanceof ehough_curly_Url)) {
190
 
191
  $url = new ehough_curly_Url($url);
192
  }
193
 
194
+ return rtrim($url->toString(), '/');
195
  }
196
  }
src/main/php/classes/tubepress/impl/feed/CacheAwareFeedFetcher.php CHANGED
@@ -82,7 +82,7 @@ class tubepress_impl_feed_CacheAwareFeedFetcher implements tubepress_spi_feed_Fe
82
  private function _getFromCache($url, tubepress_spi_context_ExecutionContext $context, $isDebugEnabled)
83
  {
84
  /**
85
- * @var $cache ehough_stash_PoolInterface
86
  */
87
  $cache = tubepress_impl_patterns_sl_ServiceLocator::getCacheService();
88
 
@@ -91,9 +91,10 @@ class tubepress_impl_feed_CacheAwareFeedFetcher implements tubepress_spi_feed_Fe
91
  $this->_logger->debug(sprintf('First asking cache for <a href="%s">URL</a>', $url));
92
  }
93
 
94
- $result = $cache->getItem($url);
 
95
 
96
- if ($result && $result->isValid()) {
97
 
98
  if ($isDebugEnabled) {
99
 
@@ -124,4 +125,9 @@ class tubepress_impl_feed_CacheAwareFeedFetcher implements tubepress_spi_feed_Fe
124
 
125
  return $result->get();
126
  }
 
 
 
 
 
127
  }
82
  private function _getFromCache($url, tubepress_spi_context_ExecutionContext $context, $isDebugEnabled)
83
  {
84
  /**
85
+ * @var $cache ehough_stash_interfaces_PoolInterface
86
  */
87
  $cache = tubepress_impl_patterns_sl_ServiceLocator::getCacheService();
88
 
91
  $this->_logger->debug(sprintf('First asking cache for <a href="%s">URL</a>', $url));
92
  }
93
 
94
+ $cacheKey = $this->_urlToCacheKey($url);
95
+ $result = $cache->getItem($cacheKey);
96
 
97
+ if ($result && !$result->isMiss()) {
98
 
99
  if ($isDebugEnabled) {
100
 
125
 
126
  return $result->get();
127
  }
128
+
129
+ private function _urlToCacheKey($url)
130
+ {
131
+ return str_replace('/', '~', $url);
132
+ }
133
  }
src/main/php/classes/tubepress/impl/html/CssAndJsHtmlGenerator.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright 2006 - 2013 TubePress LLC (http://tubepress.com)
4
+ *
5
+ * This file is part of TubePress (http://tubepress.com)
6
+ *
7
+ * This Source Code Form is subject to the terms of the Mozilla Public
8
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
9
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10
+ */
11
+
12
+ /**
13
+ * Generates HTML for use in the <head>.
14
+ */
15
+ class tubepress_impl_html_CssAndJsHtmlGenerator implements tubepress_spi_html_CssAndJsHtmlGeneratorInterface
16
+ {
17
+ /**
18
+ * @return string The HTML that should be displayed in the HTML <head>.
19
+ */
20
+ public function getCssHtml()
21
+ {
22
+ $cssHtml = $this->_fireEventAndReturnSubject(tubepress_api_const_event_EventNames::HTML_STYLESHEETS_PRE, '') . "\n";
23
+
24
+ $cssAndJsRegistry = tubepress_impl_patterns_sl_ServiceLocator::getCssAndJsRegistry();
25
+ $styleHandles = $cssAndJsRegistry->getStyleHandlesForDisplay();
26
+ $styles = array();
27
+
28
+ foreach ($styleHandles as $handle) {
29
+
30
+ $style = $cssAndJsRegistry->getStyle($handle);
31
+
32
+ if ($style !== null) {
33
+
34
+ $styles[$handle] = $style;
35
+ }
36
+ }
37
+
38
+ $filteredStyles = $this->_fireEventAndReturnSubject(tubepress_api_const_event_EventNames::CSS_JS_STYLESHEETS, $styles);
39
+
40
+ foreach ($filteredStyles as $handle => $info) {
41
+
42
+ $cssHtml .= $this->_toCssTag($info);
43
+ }
44
+
45
+ $cssHtml = $this->_fireEventAndReturnSubject(tubepress_api_const_event_EventNames::HTML_STYLESHEETS_POST, $cssHtml);
46
+
47
+ return $cssHtml;
48
+ }
49
+
50
+ /**
51
+ * @return string The HTML that should be displayed in the HTML footer (just before </html>)
52
+ */
53
+ public function getJsHtml()
54
+ {
55
+ $cssAndJsRegistry = tubepress_impl_patterns_sl_ServiceLocator::getCssAndJsRegistry();
56
+ $scriptHandles = $cssAndJsRegistry->getScriptHandlesForDisplay();
57
+ $scripts = array();
58
+
59
+ foreach ($scriptHandles as $handle) {
60
+
61
+ $script = $cssAndJsRegistry->getScript($handle);
62
+
63
+ if ($script !== null) {
64
+
65
+ $scripts[$handle] = $script;
66
+ }
67
+ }
68
+
69
+ $jsHtml = $this->_fireEventAndReturnSubject(tubepress_api_const_event_EventNames::HTML_SCRIPTS_PRE, '') . "\n";
70
+ $filteredScripts = $this->_fireEventAndReturnSubject(tubepress_api_const_event_EventNames::CSS_JS_SCRIPTS, $scripts);
71
+
72
+ foreach ($filteredScripts as $handle => $info) {
73
+
74
+ $jsHtml .= $this->_toJsTag($info);
75
+ }
76
+
77
+ $jsHtml = $this->_fireEventAndReturnSubject(tubepress_api_const_event_EventNames::HTML_SCRIPTS_POST, $jsHtml);
78
+
79
+ return $jsHtml;
80
+ }
81
+
82
+ private function _toJsTag(array $script)
83
+ {
84
+ return sprintf("<script type=\"text/javascript\" src=\"%s\"></script>\n", $script['url']);
85
+
86
+ }
87
+
88
+ private function _toCssTag(array $style)
89
+ {
90
+ return sprintf("<link href=\"%s\" rel=\"stylesheet\" type=\"text/css\" media=\"%s\">\n", $style['url'], $style['media']);
91
+ }
92
+
93
+ private function _fireEventAndReturnSubject($eventName, $raw)
94
+ {
95
+ $eventDispatcher = tubepress_impl_patterns_sl_ServiceLocator::getEventDispatcher();
96
+ $event = new tubepress_spi_event_EventBase($raw);
97
+
98
+ $eventDispatcher->dispatch($eventName, $event);
99
+
100
+ return $event->getSubject();
101
+ }
102
+ }
src/main/php/classes/tubepress/impl/html/CssAndJsRegistry.php ADDED
@@ -0,0 +1,337 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright 2006 - 2013 TubePress LLC (http://tubepress.com)
4
+ *
5
+ * This file is part of TubePress (http://tubepress.com)
6
+ *
7
+ * This Source Code Form is subject to the terms of the Mozilla Public
8
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
9
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10
+ */
11
+
12
+ /**
13
+ * Collects CSS files to be loaded.
14
+ */
15
+ class tubepress_impl_html_CssAndJsRegistry implements tubepress_spi_html_CssAndJsRegistryInterface
16
+ {
17
+ private $_styles = array();
18
+
19
+ private $_scripts = array();
20
+
21
+ private $_isDebugLoggingEnabled = false;
22
+
23
+ /**
24
+ * @var ehough_epilog_Logger Logger.
25
+ */
26
+ private $_logger;
27
+
28
+ /**
29
+ * @var null|array
30
+ */
31
+ private $_styleHandleCache;
32
+
33
+ /**
34
+ * @var null|array
35
+ */
36
+ private $_scriptHandleCache;
37
+
38
+ /**
39
+ * Enqueue a CSS file for TubePress to display.
40
+ *
41
+ * @param string $handle The unique handle for this stylesheet.
42
+ * @param string $url The absolute URL to the stylesheet.
43
+ * @param array $deps (Optional). Array of dependencies, specified by style handles.
44
+ * @param string $media (Optional). Media. Defaults to 'all'.
45
+ *
46
+ * @return bool True if style successfully registered, false otherwise.
47
+ */
48
+ public function enqueueStyle($handle, $url, array $deps = array(), $media = 'all')
49
+ {
50
+ $this->_initLogging();
51
+
52
+ if (!$this->_checkHandleAndUrl($handle, $url, 'CSS')) {
53
+
54
+ return false;
55
+ }
56
+
57
+ if (!$this->_isNonEmptyString($media, 'media')) {
58
+
59
+ return false;
60
+ }
61
+
62
+ $this->_styles[(string) $handle] = array(
63
+
64
+ 'url' => $url,
65
+ 'dependencies' => $deps,
66
+ 'media' => $media
67
+ );
68
+
69
+ unset($this->_styleHandleCache);
70
+
71
+ return true;
72
+ }
73
+
74
+ /**
75
+ * Dequeue a CSS file for TubePress to display.
76
+ *
77
+ * @param string $handle The unique handle for the stylesheet.
78
+ *
79
+ * @return bool True if style successfully deregistered. False if no matching handle.
80
+ */
81
+ public function dequeueStyle($handle)
82
+ {
83
+ $this->_initLogging();
84
+
85
+ if (!isset($this->_styles[$handle])) {
86
+
87
+ return false;
88
+ }
89
+
90
+ unset($this->_styles[$handle]);
91
+ unset($this->_styleHandleCache);
92
+
93
+ return true;
94
+ }
95
+
96
+ /**
97
+ * @return array An array of all registered style handles. May be empty, never null. Handles are given in order
98
+ * of correct dependency. i.e. CSS files with no dependencies are loaded first.
99
+ */
100
+ public function getStyleHandlesForDisplay()
101
+ {
102
+ $this->_initLogging();
103
+
104
+ if (!isset($this->_styleHandleCache)) {
105
+
106
+ $this->_styleHandleCache = $this->_calculateHandlesForDisplay($this->_styles);
107
+ }
108
+
109
+ return $this->_styleHandleCache;
110
+ }
111
+
112
+ /**
113
+ * @param string $handle The unique handle for the stylesheet.
114
+ *
115
+ * @return array|null Null if no style registered with that handle. Otherwise an associative array with keys
116
+ * "url", "dependencies", and "media".
117
+ */
118
+ public function getStyle($handle)
119
+ {
120
+ if (!isset($this->_styles[$handle])) {
121
+
122
+ return null;
123
+ }
124
+
125
+ return $this->_styles[$handle];
126
+ }
127
+
128
+ /**
129
+ * Enqueue a JS file for TubePress to display.
130
+ *
131
+ * @param string $handle The unique handle for this script.
132
+ * @param string $url The absolute URL to the script.
133
+ * @param array $deps (Optional). Array of dependencies, specified by script handles.
134
+ *
135
+ * @return bool True if script successfully registered, false otherwise.
136
+ */
137
+ public function enqueueScript($handle, $url, array $deps = array())
138
+ {
139
+ $this->_initLogging();
140
+
141
+ if (!$this->_checkHandleAndUrl($handle, $url, 'JS')) {
142
+
143
+ return false;
144
+ }
145
+
146
+ $this->_scripts[(string) $handle] = array(
147
+
148
+ 'url' => $url,
149
+ 'dependencies' => $deps,
150
+ );
151
+
152
+ unset($this->_scriptHandleCache);
153
+
154
+ return true;
155
+ }
156
+
157
+ /**
158
+ * Dequeue a JS file for TubePress to display.
159
+ *
160
+ * @param string $handle The unique handle for the script.
161
+ *
162
+ * @return bool True if script successfully deregistered. False if no matching handle.
163
+ */
164
+ public function dequeueScript($handle)
165
+ {
166
+ $this->_initLogging();
167
+
168
+ if (!isset($this->_scripts[$handle])) {
169
+
170
+ return false;
171
+ }
172
+
173
+ unset($this->_scripts[$handle]);
174
+ unset($this->_scriptHandleCache);
175
+
176
+ return true;
177
+ }
178
+
179
+ /**
180
+ * @return array An array of all registered script handles. May be empty, never null. Handles are given in order
181
+ * of correct dependency. i.e. JS files with no dependencies are loaded first.
182
+ */
183
+ public function getScriptHandlesForDisplay()
184
+ {
185
+ $this->_initLogging();
186
+
187
+ if (!isset($this->_scriptHandleCache)) {
188
+
189
+ $this->_scriptHandleCache = $this->_calculateHandlesForDisplay($this->_scripts);
190
+ }
191
+
192
+ return $this->_scriptHandleCache;
193
+ }
194
+
195
+ /**
196
+ * @param string $handle The unique handle for the script.
197
+ *
198
+ * @return array|null Null if no script registered with that handle. Otherwise an associative array with keys
199
+ * "url", "dependencies", and "media".
200
+ */
201
+ public function getScript($handle)
202
+ {
203
+ if (!isset($this->_scripts[$handle])) {
204
+
205
+ return null;
206
+ }
207
+
208
+ return $this->_scripts[$handle];
209
+ }
210
+
211
+ private function _checkHandleAndUrl($handle, $url, $name)
212
+ {
213
+ if (!$this->_isNonEmptyString($handle, $name . ' handle')) {
214
+
215
+ return false;
216
+ }
217
+
218
+ if (!$this->_isNonEmptyString($url, $name . ' URL')) {
219
+
220
+ return false;
221
+ }
222
+
223
+ try {
224
+
225
+ new ehough_curly_Url($url);
226
+
227
+ } catch (InvalidArgumentException $e) {
228
+
229
+ if ($this->_isDebugLoggingEnabled) {
230
+
231
+ $this->_logger->warning(sprintf('Invalid URL supplied for %s handle "%s"', $name, $handle));
232
+ }
233
+
234
+ return false;
235
+ }
236
+
237
+ if ($this->_isDebugLoggingEnabled) {
238
+
239
+ $this->_logger->debug(sprintf('"%s" accepted as a %s file with URL %s', $handle, $name, $url));
240
+ }
241
+
242
+ return true;
243
+ }
244
+
245
+ private function _isNonEmptyString($candidate, $name)
246
+ {
247
+ if (!is_string($candidate)) {
248
+
249
+ if ($this->_isDebugLoggingEnabled) {
250
+
251
+ $this->_logger->warning("$name must be a string");
252
+
253
+ return false;
254
+ }
255
+ }
256
+
257
+ if ($candidate === '') {
258
+
259
+ if ($this->_isDebugLoggingEnabled) {
260
+
261
+ $this->_logger->warning("$name must be a non-empty string");
262
+
263
+ return false;
264
+ }
265
+ }
266
+
267
+ return true;
268
+ }
269
+
270
+ private function _initLogging()
271
+ {
272
+ if (isset($this->_logger)) {
273
+
274
+ return;
275
+ }
276
+
277
+ $this->_logger = ehough_epilog_LoggerFactory::getLogger('CSS and JS Registry');
278
+
279
+ $this->_isDebugLoggingEnabled = $this->_logger->isHandling(ehough_epilog_Logger::DEBUG);
280
+ }
281
+
282
+ private function _calculateHandlesForDisplay(array $arr)
283
+ {
284
+ $handles = array_keys($arr);
285
+ $handleCount = count($handles);
286
+
287
+ /**
288
+ * Remove nodes with unsatisfied deps.
289
+ */
290
+ for ($x = 0; $x < $handleCount; $x++) {
291
+
292
+ $file = $arr[$handles[$x]];
293
+
294
+ if (empty($file['dependencies'])) {
295
+
296
+ //no deps
297
+ continue;
298
+ }
299
+
300
+ foreach ($file['dependencies'] as $dep) {
301
+
302
+ if (array_search($dep, $handles) === false) {
303
+
304
+ //missing dependency, start over
305
+ unset($handles[$x]);
306
+ $x = 0;
307
+ $handleCount--;
308
+ break;
309
+ }
310
+ }
311
+ }
312
+
313
+ $edges = $this->_buildEdgeMap($handles, $arr);
314
+
315
+ $sorted = tubepress_impl_patterns_toposort_TopologicalSort::sort($handles, $edges);
316
+
317
+ return array_reverse($sorted);
318
+ }
319
+
320
+ private function _buildEdgeMap($handles, array $arr)
321
+ {
322
+ $edges = array();
323
+
324
+ foreach ($handles as $handle) {
325
+
326
+ $info = $arr[$handle];
327
+ $nodeDeps = $info['dependencies'];
328
+
329
+ foreach ($nodeDeps as $nodeDep) {
330
+
331
+ $edges[] = array($handle, $nodeDep);
332
+ }
333
+ }
334
+
335
+ return $edges;
336
+ }
337
+ }
src/main/php/classes/tubepress/impl/html/DefaultCssAndJsGenerator.php DELETED
@@ -1,82 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright 2006 - 2013 TubePress LLC (http://tubepress.com)
4
- *
5
- * This file is part of TubePress (http://tubepress.com)
6
- *
7
- * This Source Code Form is subject to the terms of the Mozilla Public
8
- * License, v. 2.0. If a copy of the MPL was not distributed with this
9
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10
- */
11
-
12
- /**
13
- * Generates HTML for use in the <head>.
14
- */
15
- class tubepress_impl_html_DefaultCssAndJsGenerator implements tubepress_spi_html_CssAndJsGenerator
16
- {
17
- public function getJqueryScriptTag()
18
- {
19
- $jQueryUrl = $this->_getRelativeUrl('/src/main/web/vendor/jquery/jquery.min.js');
20
- $finalJQueryUrl = $this->_fireEventAndReturnSubject(tubepress_api_const_event_EventNames::CSS_JS_SCRIPT_URL_JQUERY, $jQueryUrl);
21
-
22
- return $this->_getRealScriptTag($finalJQueryUrl);
23
- }
24
-
25
- public function getTubePressScriptTag()
26
- {
27
- $tubePressJsUrl = $this->_getRelativeUrl('/src/main/web/js/tubepress.js');
28
- $finalUrl = $this->_fireEventAndReturnSubject(tubepress_api_const_event_EventNames::CSS_JS_SCRIPT_URL_TUBEPRESSJS, $tubePressJsUrl);
29
-
30
- return $this->_getRealScriptTag($finalUrl);
31
- }
32
-
33
- public function getTubePressCssTag()
34
- {
35
- $tubePressCssUrl = $this->_getRelativeUrl('/src/main/web/css/tubepress.css');
36
- $finalUrl = $this->_fireEventAndReturnSubject(tubepress_api_const_event_EventNames::CSS_JS_CSS_URL_TUBEPRESS, $tubePressCssUrl);
37
-
38
- return sprintf(sprintf('<link rel="stylesheet" href="%s" type="text/css">', $finalUrl));
39
- }
40
-
41
- public function getMetaTags()
42
- {
43
- $qss = tubepress_impl_patterns_sl_ServiceLocator::getHttpRequestParameterService();
44
- $page = $qss->getParamValueAsInt(tubepress_spi_const_http_ParamName::PAGE, 1);
45
- $result = $page > 1 ? '<meta name="robots" content="noindex, nofollow" />' : '';
46
-
47
- return $this->_fireEventAndReturnSubject(tubepress_api_const_event_EventNames::CSS_JS_META_TAGS, $result);
48
- }
49
-
50
- public function getInlineCss()
51
- {
52
- return $this->_fireEventAndReturnSubject(tubepress_api_const_event_EventNames::CSS_JS_INLINE_CSS, '');
53
- }
54
-
55
- public function getInlineJs()
56
- {
57
- return $this->_fireEventAndReturnSubject(tubepress_api_const_event_EventNames::CSS_JS_INLINE_JS, '');
58
- }
59
-
60
- private function _fireEventAndReturnSubject($eventName, $raw)
61
- {
62
- $eventDispatcher = tubepress_impl_patterns_sl_ServiceLocator::getEventDispatcher();
63
- $event = new tubepress_spi_event_EventBase($raw);
64
-
65
- $eventDispatcher->dispatch($eventName, $event);
66
-
67
- return $event->getSubject();
68
- }
69
-
70
- private function _getRealScriptTag($url)
71
- {
72
- return sprintf('<script type="text/javascript" src="%s"></script>', $url);
73
- }
74
-
75
- private function _getRelativeUrl($url)
76
- {
77
- $environmentDetector = tubepress_impl_patterns_sl_ServiceLocator::getEnvironmentDetector();
78
- $baseUrl = $environmentDetector->getBaseUrl();
79
-
80
- return new ehough_curly_Url($baseUrl . $url);
81
- }
82
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/main/php/classes/tubepress/impl/options/ui/fields/AbstractTemplateBasedOptionsPageField.php CHANGED
@@ -25,8 +25,6 @@ abstract class tubepress_impl_options_ui_fields_AbstractTemplateBasedOptionsPage
25
  $templateEvent = new tubepress_spi_event_EventBase($template);
26
  $templateEvent->setArgument('field', $this);
27
 
28
- $eventDispatcher->dispatch(tubepress_api_const_event_EventNames::OPTIONS_PAGE_FIELDTEMPLATE, $templateEvent);
29
-
30
  $templateVariables = $this->getTemplateVariables();
31
 
32
  foreach ($templateVariables as $name => $value) {
@@ -34,6 +32,8 @@ abstract class tubepress_impl_options_ui_fields_AbstractTemplateBasedOptionsPage
34
  $template->setVariable($name, $value);
35
  }
36
 
 
 
37
  return $template->toString();
38
  }
39
 
25
  $templateEvent = new tubepress_spi_event_EventBase($template);
26
  $templateEvent->setArgument('field', $this);
27
 
 
 
28
  $templateVariables = $this->getTemplateVariables();
29
 
30
  foreach ($templateVariables as $name => $value) {
32
  $template->setVariable($name, $value);
33
  }
34
 
35
+ $eventDispatcher->dispatch(tubepress_api_const_event_EventNames::OPTIONS_PAGE_FIELDTEMPLATE, $templateEvent);
36
+
37
  return $template->toString();
38
  }
39
 
src/main/php/classes/tubepress/impl/patterns/sl/ServiceLocator.php CHANGED
@@ -69,11 +69,19 @@ class tubepress_impl_patterns_sl_ServiceLocator
69
  }
70
 
71
  /**
72
- * @return ehough_stash_PoolInterface The cache service.
73
  */
74
  public static function getCacheService()
75
  {
76
- return self::getService('ehough_stash_PoolInterface');
 
 
 
 
 
 
 
 
77
  }
78
 
79
  /**
@@ -133,11 +141,11 @@ class tubepress_impl_patterns_sl_ServiceLocator
133
  }
134
 
135
  /**
136
- * @return tubepress_spi_html_CssAndJsGenerator The head HTML generator.
137
  */
138
- public static function getCssAndJsGenerator()
139
  {
140
- return self::getService(tubepress_spi_html_CssAndJsGenerator::_);
141
  }
142
 
143
  /**
69
  }
70
 
71
  /**
72
+ * @return ehough_stash_interfaces_PoolInterface The cache service.
73
  */
74
  public static function getCacheService()
75
  {
76
+ return self::getService('ehough_stash_interfaces_PoolInterface');
77
+ }
78
+
79
+ /**
80
+ * @return tubepress_spi_html_CssAndJsRegistryInterface The CSS registry.
81
+ */
82
+ public static function getCssAndJsRegistry()
83
+ {
84
+ return self::getService(tubepress_spi_html_CssAndJsRegistryInterface::_);
85
  }
86
 
87
  /**
141
  }
142
 
143
  /**
144
+ * @return tubepress_spi_html_CssAndJsHtmlGeneratorInterface The head HTML generator.
145
  */
146
+ public static function getCssAndJsHtmlGenerator()
147
  {
148
+ return self::getService(tubepress_spi_html_CssAndJsHtmlGeneratorInterface::_);
149
  }
150
 
151
  /**
src/main/php/classes/tubepress/impl/patterns/toposort/TopologicalSort.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright 2006 - 2013 Eric D. Hough (http://ehough.com)
4
+ *
5
+ * This file is part of coauthor (https://github.com/ehough/coauthor)
6
+ *
7
+ * This Source Code Form is subject to the terms of the Mozilla Public
8
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
9
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10
+ */
11
+
12
+ class tubepress_impl_patterns_toposort_TopologicalSort
13
+ {
14
+ /**
15
+ * Author: Dan (http://www.calcatraz.com)
16
+ * Licensing: None - use it as you see fit
17
+ * Updates: http://www.calcatraz.com/blog/php-topological-sort-function-384
18
+ */
19
+ public static function sort($nodeIds, $edges)
20
+ {
21
+ // initialize variables
22
+ $toReturn = array();
23
+ $tempSortedList = array();
24
+ $nodeTable = array();
25
+
26
+ // remove duplicate nodes
27
+ $nodeIds = array_unique($nodeIds);
28
+
29
+ // remove duplicate edges
30
+ $edgeHashes = array();
31
+
32
+ foreach ($edges as $edgeStart => $edgeEnd) {
33
+
34
+ $edgeHash = md5(serialize($edgeEnd));
35
+
36
+ if (in_array($edgeHash, $edgeHashes)) {
37
+
38
+ unset($edges[$edgeStart]);
39
+
40
+ } else {
41
+
42
+ $edgeHashes[] = $edgeHash;
43
+ };
44
+ }
45
+
46
+ // Build a lookup table of each node's edges
47
+ foreach ($nodeIds as $nodeId) {
48
+
49
+ $nodeTable[$nodeId] = array(
50
+
51
+ 'in' => array(),
52
+ 'out' => array()
53
+ );
54
+
55
+ foreach ($edges as $edgeEnd) {
56
+
57
+ if ($nodeId === $edgeEnd[0]) {
58
+
59
+ $nodeTable[$nodeId]['out'][] = $edgeEnd[1];
60
+ }
61
+
62
+ if ($nodeId === $edgeEnd[1]) {
63
+
64
+ $nodeTable[$nodeId]['in'][] = $edgeEnd[0];
65
+ }
66
+ }
67
+ }
68
+
69
+ // While we have nodes left, we pick a node with no inbound edges,
70
+ // remove it and its edges from the graph, and add it to the end
71
+ // of the sorted list.
72
+ foreach ($nodeTable as $nodeId=>$n) {
73
+
74
+ if (empty($n['in'])) {
75
+
76
+ $tempSortedList[] = $nodeId;
77
+ }
78
+ }
79
+
80
+ while (!empty($tempSortedList)) {
81
+
82
+ $toReturn[] = $nodeId = array_shift($tempSortedList);
83
+
84
+ foreach ($nodeTable[$nodeId]['out'] as $outNodeId) {
85
+
86
+ $nodeTable[$outNodeId]['in'] = array_diff($nodeTable[$outNodeId]['in'], array($nodeId));
87
+
88
+ if (empty($nodeTable[$outNodeId]['in'])) {
89
+
90
+ $tempSortedList[] = $outNodeId;
91
+ }
92
+ }
93
+
94
+ $nodeTable[$nodeId]['out'] = array();
95
+ }
96
+
97
+ // Check if we have any edges left unprocessed
98
+ foreach ($nodeTable as $n) {
99
+
100
+ if (!empty($n['in']) || !empty($n['out'])) {
101
+
102
+ return null; // not sortable as graph is cyclic
103
+ }
104
+ }
105
+
106
+ return $toReturn;
107
+ }
108
+ }
src/main/php/classes/tubepress/spi/environment/EnvironmentDetector.php CHANGED
@@ -59,13 +59,17 @@ interface tubepress_spi_environment_EnvironmentDetector
59
  */
60
  function setBaseUrl($url);
61
 
62
- // /**
63
- // * Find the absolute path of the boot cache directory. This directory will contains two files:
64
- // *
65
- // * 1. bootCache.php (the dumped service container)
66
- // * 2. addons.php (a cached representation of the addons for TubePress)
67
- // *
68
- // * @return string The absolute path of the boot cache directory.
69
- // */
70
- // function getBootcacheDirectory();
 
 
 
 
71
  }
59
  */
60
  function setBaseUrl($url);
61
 
62
+ /**
63
+ * @return string The user content URL.
64
+ */
65
+ function getUserContentUrl();
66
+
67
+ /**
68
+ * Set the user content URL.
69
+ *
70
+ * @param mixed $url The user content URL.
71
+ *
72
+ * @return void
73
+ */
74
+ function setUserContentUrl($url);
75
  }
src/main/php/classes/tubepress/spi/html/{CssAndJsGenerator.php → CssAndJsHtmlGeneratorInterface.php} RENAMED
@@ -12,19 +12,17 @@
12
  /**
13
  * Generates HTML for use in the <head>.
14
  */
15
- interface tubepress_spi_html_CssAndJsGenerator
16
  {
17
- const _ = 'tubepress_spi_html_CssAndJsGenerator';
18
 
19
- function getJqueryScriptTag();
 
 
 
20
 
21
- function getTubePressScriptTag();
22
-
23
- function getTubePressCssTag();
24
-
25
- function getMetaTags();
26
-
27
- function getInlineCss();
28
-
29
- function getInlineJs();
30
  }
12
  /**
13
  * Generates HTML for use in the <head>.
14
  */
15
+ interface tubepress_spi_html_CssAndJsHtmlGeneratorInterface
16
  {
17
+ const _ = 'tubepress_spi_html_CssAndJsHtmlGeneratorInterface';
18
 
19
+ /**
20
+ * @return string The HTML that should be displayed in the HTML <head>.
21
+ */
22
+ function getCssHtml();
23
 
24
+ /**
25
+ * @return string The HTML that should be displayed in the HTML footer (just before </html>)
26
+ */
27
+ function getJsHtml();
 
 
 
 
 
28
  }
src/main/php/classes/tubepress/spi/html/CssAndJsRegistryInterface.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copyright 2006 - 2013 TubePress LLC (http://tubepress.com)
4
+ *
5
+ * This file is part of TubePress (http://tubepress.com)
6
+ *
7
+ * This Source Code Form is subject to the terms of the Mozilla Public
8
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
9
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10
+ */
11
+
12
+ /**
13
+ * Collects CSS files to be loaded.
14
+ */
15
+ interface tubepress_spi_html_CssAndJsRegistryInterface
16
+ {
17
+ const _ = 'tubepress_spi_html_CssAndJsRegistryInterface';
18
+
19
+ /**
20
+ * Enqueue a CSS file for TubePress to display.
21
+ *
22
+ * @param string $handle The unique handle for this stylesheet.
23
+ * @param string $url The absolute URL to the stylesheet.
24
+ * @param array $deps (Optional). Array of dependencies, specified by style handles.
25
+ * @param string $media (Optional). Media. Defaults to 'all'.
26
+ *
27
+ * @return bool True if style successfully registered, false otherwise.
28
+ */
29
+ function enqueueStyle($handle, $url, array $deps = array(), $media = 'all');
30
+
31
+ /**
32
+ * Dequeue a CSS file for TubePress to display.
33
+ *
34
+ * @param string $handle The unique handle for the stylesheet.
35
+ *
36
+ * @return bool True if style successfully deregistered. False if no matching handle.
37
+ */
38
+ function dequeueStyle($handle);
39
+
40
+ /**
41
+ * @return array An array of all registered style handles. May be empty, never null. Handles are given in order
42
+ * of correct dependency. i.e. CSS files with no dependencies are loaded first.
43
+ */
44
+ function getStyleHandlesForDisplay();
45
+
46
+ /**
47
+ * @param string $handle The unique handle for the stylesheet.
48
+ *
49
+ * @return array|null Null if no style registered with that handle. Otherwise an associative array with keys
50
+ * "url", "dependencies", and "media".
51
+ */
52
+ function getStyle($handle);
53
+
54
+ /**
55
+ * Enqueue a JS file for TubePress to display.
56
+ *
57
+ * @param string $handle The unique handle for this script.
58
+ * @param string $url The absolute URL to the script.
59
+ * @param array $deps (Optional). Array of dependencies, specified by script handles.
60
+ *
61
+ * @return bool True if script successfully registered, false otherwise.
62
+ */
63
+ function enqueueScript($handle, $url, array $deps = array());
64
+
65
+ /**
66
+ * Dequeue a JS file for TubePress to display.
67
+ *
68
+ * @param string $handle The unique handle for the script.
69
+ *
70
+ * @return bool True if script successfully deregistered. False if no matching handle.
71
+ */
72
+ function dequeueScript($handle);
73
+
74
+ /**
75
+ * @return array An array of all registered script handles. May be empty, never null. Handles are given in order
76
+ * of correct dependency. i.e. JS files with no dependencies are loaded first.
77
+ */
78
+ function getScriptHandlesForDisplay();
79
+
80
+ /**
81
+ * @param string $handle The unique handle for the script.
82
+ *
83
+ * @return array|null Null if no script registered with that handle. Otherwise an associative array with keys
84
+ * "url", "dependencies".
85
+ */
86
+ function getScript($handle);
87
+ }
src/main/php/classes/tubepress/spi/player/PluggablePlayerLocationService.php CHANGED
@@ -29,9 +29,9 @@ interface tubepress_spi_player_PluggablePlayerLocationService
29
  function getName();
30
 
31
  /**
32
- * @return string Gets the relative path to this player location's JS init script.
33
  */
34
- function getRelativePlayerJsUrl();
35
 
36
  /**
37
  * @return boolean True if this player location produces HTML, false otherwise.
29
  function getName();
30
 
31
  /**
32
+ * @return string Gets the URL to this player location's JS init script.
33
  */
34
+ function getPlayerJsUrl();
35
 
36
  /**
37
  * @return boolean True if this player location produces HTML, false otherwise.
src/main/php/scripts/classmaps/full.php CHANGED
@@ -188,17 +188,29 @@ return array(
188
  'ehough_shortstop_spi_HttpTransferDecoder' => $shortstopPrefix . '/spi/HttpTransferDecoder.php',
189
  'ehough_shortstop_spi_HttpTransport' => $shortstopPrefix . '/spi/HttpTransport.php',
190
 
191
- 'ehough_stash_driver_DriverInterface' => $stashPrefix . '/driver/DriverInterface.php',
 
 
 
192
  'ehough_stash_driver_FileSystem' => $stashPrefix . '/driver/FileSystem.php',
 
193
  'ehough_stash_Drivers' => $stashPrefix . '/Drivers.php',
 
 
194
  'ehough_stash_exception_Exception' => $stashPrefix . '/exception/Exception.php',
195
  'ehough_stash_exception_InvalidArgumentException' => $stashPrefix . '/exception/InvalidArgumentException.php',
196
  'ehough_stash_exception_LogicException' => $stashPrefix . '/exception/LogicException.php',
197
  'ehough_stash_exception_RuntimeException' => $stashPrefix . '/exception/RuntimeException.php',
 
 
 
 
 
 
198
  'ehough_stash_Item' => $stashPrefix . '/Item.php',
199
- 'ehough_stash_ItemInterface' => $stashPrefix . '/ItemInterface.php',
200
  'ehough_stash_Pool' => $stashPrefix . '/Pool.php',
201
- 'ehough_stash_PoolInterface' => $stashPrefix . '/PoolInterface.php',
 
202
  'ehough_stash_Utilities' => $stashPrefix . '/Utilities.php',
203
 
204
  'ehough_tickertape_ContainerAwareEventDispatcher' => $tickerTapePrefix . '/ContainerAwareEventDispatcher.php',
@@ -252,7 +264,8 @@ return array(
252
  'tubepress_impl_event_DefaultEventDispatcher' => $implPrefix . '/event/DefaultEventDispatcher.php',
253
  'tubepress_impl_event_TickertapeEventWrapper' => $implPrefix . '/event/TickertapeEventWrapper.php',
254
  'tubepress_impl_feed_CacheAwareFeedFetcher' => $implPrefix . '/feed/CacheAwareFeedFetcher.php',
255
- 'tubepress_impl_html_DefaultCssAndJsGenerator' => $implPrefix . '/html/DefaultCssAndJsGenerator.php',
 
256
  'tubepress_impl_http_AbstractPluggableAjaxCommandService' => $implPrefix . '/http/AbstractPluggableAjaxCommandService.php',
257
  'tubepress_impl_http_DefaultAjaxHandler' => $implPrefix . '/http/DefaultAjaxHandler.php',
258
  'tubepress_impl_http_DefaultHttpRequestParameterService' => $implPrefix . '/http/DefaultHttpRequestParameterService.php',
@@ -304,7 +317,8 @@ return array(
304
  'tubepress_spi_environment_EnvironmentDetector' => $spiPrefix . '/environment/EnvironmentDetector.php',
305
  'tubepress_spi_event_EventBase' => $spiPrefix . '/event/EventBase.php',
306
  'tubepress_spi_feed_FeedFetcher' => $spiPrefix . '/feed/FeedFetcher.php',
307
- 'tubepress_spi_html_CssAndJsGenerator' => $spiPrefix . '/html/CssAndJsGenerator.php',
 
308
  'tubepress_spi_http_AjaxHandler' => $spiPrefix . '/http/AjaxHandler.php',
309
  'tubepress_spi_http_HttpRequestParameterService' => $spiPrefix . '/http/HttpRequestParameterService.php',
310
  'tubepress_spi_http_PluggableAjaxCommandService' => $spiPrefix . '/http/PluggableAjaxCommandService.php',
188
  'ehough_shortstop_spi_HttpTransferDecoder' => $shortstopPrefix . '/spi/HttpTransferDecoder.php',
189
  'ehough_shortstop_spi_HttpTransport' => $shortstopPrefix . '/spi/HttpTransport.php',
190
 
191
+ 'ehough_stash_driver_Apc' => $stashPrefix . '/driver/Apc.php',
192
+ 'ehough_stash_driver_BlackHole' => $stashPrefix . '/driver/BlackHole.php',
193
+ 'ehough_stash_driver_Composite' => $stashPrefix . '/driver/Composite.php',
194
+ 'ehough_stash_driver_Ephemeral' => $stashPrefix . '/driver/Ephemeral.php',
195
  'ehough_stash_driver_FileSystem' => $stashPrefix . '/driver/FileSystem.php',
196
+ 'ehough_stash_driver_Memcache' => $stashPrefix . '/driver/Memcache.php',
197
  'ehough_stash_Drivers' => $stashPrefix . '/Drivers.php',
198
+ 'ehough_stash_driver_sub_Memcached' => $stashPrefix . '/driver/sub/Memcached.php',
199
+ 'ehough_stash_driver_sub_Memcache' => $stashPrefix . '/driver/sub/Memcache.php',
200
  'ehough_stash_exception_Exception' => $stashPrefix . '/exception/Exception.php',
201
  'ehough_stash_exception_InvalidArgumentException' => $stashPrefix . '/exception/InvalidArgumentException.php',
202
  'ehough_stash_exception_LogicException' => $stashPrefix . '/exception/LogicException.php',
203
  'ehough_stash_exception_RuntimeException' => $stashPrefix . '/exception/RuntimeException.php',
204
+ 'ehough_stash_interfaces_DriverInterface' => $stashPrefix . '/interfaces/DriverInterface.php',
205
+ 'ehough_stash_interfaces_drivers_ExtendInterface' => $stashPrefix . '/interfaces/drivers/ExtendInterface.php',
206
+ 'ehough_stash_interfaces_drivers_IncDecInterface' => $stashPrefix . '/interfaces/drivers/IncDecInterface.php',
207
+ 'ehough_stash_interfaces_drivers_MultiInterface' => $stashPrefix . '/interfaces/drivers/MultiInterface.php',
208
+ 'ehough_stash_interfaces_ItemInterface' => $stashPrefix . '/interfaces/ItemInterface.php',
209
+ 'ehough_stash_interfaces_PoolInterface' => $stashPrefix . '/interfaces/PoolInterface.php',
210
  'ehough_stash_Item' => $stashPrefix . '/Item.php',
 
211
  'ehough_stash_Pool' => $stashPrefix . '/Pool.php',
212
+ 'ehough_stash_session_SessionHandlerInterface' => $stashPrefix . '/session/SessionHandlerInterface.php',
213
+ 'ehough_stash_Session' => $stashPrefix . '/Session.php',
214
  'ehough_stash_Utilities' => $stashPrefix . '/Utilities.php',
215
 
216
  'ehough_tickertape_ContainerAwareEventDispatcher' => $tickerTapePrefix . '/ContainerAwareEventDispatcher.php',
264
  'tubepress_impl_event_DefaultEventDispatcher' => $implPrefix . '/event/DefaultEventDispatcher.php',
265
  'tubepress_impl_event_TickertapeEventWrapper' => $implPrefix . '/event/TickertapeEventWrapper.php',
266
  'tubepress_impl_feed_CacheAwareFeedFetcher' => $implPrefix . '/feed/CacheAwareFeedFetcher.php',
267
+ 'tubepress_impl_html_CssAndJsRegistry' => $implPrefix . '/html/CssAndJsRegistry.php',
268
+ 'tubepress_impl_html_CssAndJsHtmlGenerator' => $implPrefix . '/html/CssAndJsHtmlGenerator.php',
269
  'tubepress_impl_http_AbstractPluggableAjaxCommandService' => $implPrefix . '/http/AbstractPluggableAjaxCommandService.php',
270
  'tubepress_impl_http_DefaultAjaxHandler' => $implPrefix . '/http/DefaultAjaxHandler.php',
271
  'tubepress_impl_http_DefaultHttpRequestParameterService' => $implPrefix . '/http/DefaultHttpRequestParameterService.php',
317
  'tubepress_spi_environment_EnvironmentDetector' => $spiPrefix . '/environment/EnvironmentDetector.php',
318
  'tubepress_spi_event_EventBase' => $spiPrefix . '/event/EventBase.php',
319
  'tubepress_spi_feed_FeedFetcher' => $spiPrefix . '/feed/FeedFetcher.php',
320
+ 'tubepress_spi_html_CssAndJsRegistryInterface' => $spiPrefix . '/html/CssAndJsRegistryInterface.php',
321
+ 'tubepress_spi_html_CssAndJsHtmlGeneratorInterface' => $spiPrefix . '/html/CssAndJsHtmlGeneratorInterface.php',
322
  'tubepress_spi_http_AjaxHandler' => $spiPrefix . '/http/AjaxHandler.php',
323
  'tubepress_spi_http_HttpRequestParameterService' => $spiPrefix . '/http/HttpRequestParameterService.php',
324
  'tubepress_spi_http_PluggableAjaxCommandService' => $spiPrefix . '/http/PluggableAjaxCommandService.php',
src/main/resources/i18n/tubepress-ar.mo CHANGED
Binary file
src/main/resources/i18n/tubepress-ar.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2013-10-25 01:52:07+0000\n"
6
  "Language: ar\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -491,7 +491,7 @@ msgstr "اظهر الفيديوهات المشابهة"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "تبديل عرض مقاطع الفيديو ذات الصلة بعد انتهاء الفيديو."
493
 
494
- msgid "Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the \"p=\". For instance: <a href=\"http://www.youtube.com/playlist?p=F679CB240DD4C112\" target=\"_blank\">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>"
495
  msgstr ""
496
 
497
  msgid "\"Modest\" branding"
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2013-12-12 17:37:50+0000\n"
6
  "Language: ar\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "تبديل عرض مقاطع الفيديو ذات الصلة بعد انتهاء الفيديو."
493
 
494
+ msgid "The URL to any YouTube playlist (e.g. <a href=\"%s\" target=\"_blank\">%s</a>) or just the playlist identifier (e.g. %s)."
495
  msgstr ""
496
 
497
  msgid "\"Modest\" branding"
src/main/resources/i18n/tubepress-de.mo CHANGED
Binary file
src/main/resources/i18n/tubepress-de.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2013-10-25 01:52:08+0000\n"
6
  "Language: de\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -491,8 +491,8 @@ msgstr "ähnliche Videos anzeigen"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Schaltet das Anzeigen von ähnlichen Videos nach dem Ende des Videos ein oder aus."
493
 
494
- msgid "Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the \"p=\". For instance: <a href=\"http://www.youtube.com/playlist?p=F679CB240DD4C112\" target=\"_blank\">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>"
495
- msgstr "Begrenzt auf 200 Videos pro Playlist. Wird normalerweise in etwa so aussehen: PLF679CB240DD4C112. Kopieren Sie die Playlist-ID vom Ende der URL in die Adresszeile Ihres Browers (während Sie eine YouTube-Playlist betrachten). Die ID steht direkt hinter 'p='. Zum Beispiel <a href=\"http://www.youtube.com/playlist?p=PLF679CB240DD4C112\">http://www.youtube.com/playlist?p=PLF679CB240DD4C112</a>."
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "\"Bescheidenes\" branding"
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2013-12-12 17:37:51+0000\n"
6
  "Language: de\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Schaltet das Anzeigen von ähnlichen Videos nach dem Ende des Videos ein oder aus."
493
 
494
+ msgid "The URL to any YouTube playlist (e.g. <a href=\"%s\" target=\"_blank\">%s</a>) or just the playlist identifier (e.g. %s)."
495
+ msgstr ""
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "\"Bescheidenes\" branding"
src/main/resources/i18n/tubepress-el.mo CHANGED
Binary file
src/main/resources/i18n/tubepress-el.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2013-10-25 01:52:08+0000\n"
6
  "Language: el\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -491,8 +491,8 @@ msgstr "Δείτε τα σχετικά βίντεο"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Εναλλάσσει την εμφάνιση των σχετικών βίντεο μετά τελειώνει το βίντεο."
493
 
494
- msgid "Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the \"p=\". For instance: <a href=\"http://www.youtube.com/playlist?p=F679CB240DD4C112\" target=\"_blank\">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>"
495
- msgstr "Περιορίζεται σε 200 videos ανά playlist. Συνήθως θα δούμε κάτι σαν αυτό: PLF679CB240DD4C112. Αντιγράψτε το playlist id από το τέλος του URL στη γραμμή διευθύνσεων του browser σας (ενώ ψάχνει σε μια λίστα αναπαραγωγής YouTube). Έρχεται αμέσως μετά το \"p = \". Για παράδειγμα: <a"
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr " \"Μέτρια \" σήματα"
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2013-12-12 17:37:52+0000\n"
6
  "Language: el\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Εναλλάσσει την εμφάνιση των σχετικών βίντεο μετά τελειώνει το βίντεο."
493
 
494
+ msgid "The URL to any YouTube playlist (e.g. <a href=\"%s\" target=\"_blank\">%s</a>) or just the playlist identifier (e.g. %s)."
495
+ msgstr ""
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr " \"Μέτρια \" σήματα"
src/main/resources/i18n/tubepress-es.mo CHANGED
Binary file
src/main/resources/i18n/tubepress-es.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2013-10-25 01:52:09+0000\n"
6
  "Language: es\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -491,8 +491,8 @@ msgstr "Mostrar videos relacionados"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Abrir/cerrar el desplegado de videos relacionados al terminar de reproducir el video."
493
 
494
- msgid "Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the \"p=\". For instance: <a href=\"http://www.youtube.com/playlist?p=F679CB240DD4C112\" target=\"_blank\">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>"
495
- msgstr "Limitado a 200 vídeos por lista de reproducción. Se suele ser algo como esto: PLF679CB240DD4C112. Copie la lista de reproducción Identificación de la final de la URL en la barra de direcciones de tu navegador (mientras mira a una lista de reproducción de YouTube). Viene justo después de la \"p = \". Por ejemplo: <a"
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "Modest \" brandin"
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2013-12-12 17:37:53+0000\n"
6
  "Language: es\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Abrir/cerrar el desplegado de videos relacionados al terminar de reproducir el video."
493
 
494
+ msgid "The URL to any YouTube playlist (e.g. <a href=\"%s\" target=\"_blank\">%s</a>) or just the playlist identifier (e.g. %s)."
495
+ msgstr ""
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "Modest \" brandin"
src/main/resources/i18n/tubepress-fa.mo CHANGED
Binary file
src/main/resources/i18n/tubepress-fa.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2013-10-25 01:52:10+0000\n"
6
  "Language: fa\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -491,8 +491,8 @@ msgstr "نمایش ویدیوهای مرتبط"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "پستی نمایش ویدیوهای مرتبط پس از اتمام ویدئو."
493
 
494
- msgid "Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the \"p=\". For instance: <a href=\"http://www.youtube.com/playlist?p=F679CB240DD4C112\" target=\"_blank\">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>"
495
- msgstr "محدود به 200 فیلم در لیست پخش. معمولا چیزی نگاه مثل این: PLF679CB240DD4C112. کپی لیست پخش ID از پایان URL در نوار آدرس مرورگر خود را به (در حالی که به دنبال در یک لیست پخش یوتیوب). درست بعد از \"P = \" می آید. به عنوان مثال: <"
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr " \"متوسط ​​\" نام تجاری"
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2013-12-12 17:37:55+0000\n"
6
  "Language: fa\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "پستی نمایش ویدیوهای مرتبط پس از اتمام ویدئو."
493
 
494
+ msgid "The URL to any YouTube playlist (e.g. <a href=\"%s\" target=\"_blank\">%s</a>) or just the playlist identifier (e.g. %s)."
495
+ msgstr ""
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr " \"متوسط ​​\" نام تجاری"
src/main/resources/i18n/tubepress-fi.mo CHANGED
Binary file
src/main/resources/i18n/tubepress-fi.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2013-10-25 01:52:11+0000\n"
6
  "Language: fi\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -491,8 +491,8 @@ msgstr "Näytä videoita samasta aiheesta"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Valitse, näytetäänkö videon loputtua lista aiheeseen liittyvistä videoista"
493
 
494
- msgid "Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the \"p=\". For instance: <a href=\"http://www.youtube.com/playlist?p=F679CB240DD4C112\" target=\"_blank\">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>"
495
- msgstr "Rajoitettu 200 videot soittolistaa kohti. Yleensä näyttää suunnilleen tältä: PLF679CB240DD4C112. Kopioi soittolista id lopusta URL-osoitteen selaimen osoiteriville (kun katsot YouTube soittolista). Se tulee heti \"p = \". Esimerkiksi: <a href=\"http://www.youtube.com/playlist?p=PLF679CB240DD4C112\">http://www.youtube.com/playlist?p=PLF679CB240DD4C112</a>"
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "Vaatimaton \" brandin"
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2013-12-12 17:37:56+0000\n"
6
  "Language: fi\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Valitse, näytetäänkö videon loputtua lista aiheeseen liittyvistä videoista"
493
 
494
+ msgid "The URL to any YouTube playlist (e.g. <a href=\"%s\" target=\"_blank\">%s</a>) or just the playlist identifier (e.g. %s)."
495
+ msgstr ""
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "Vaatimaton \" brandin"
src/main/resources/i18n/tubepress-fr.mo CHANGED
Binary file
src/main/resources/i18n/tubepress-fr.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2013-10-25 01:52:12+0000\n"
6
  "Language: fr\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -491,8 +491,8 @@ msgstr "Afficher les vidéos relatives"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Déplier l'affichage des vidéos relatives après la fin de la vidéo."
493
 
494
- msgid "Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the \"p=\". For instance: <a href=\"http://www.youtube.com/playlist?p=F679CB240DD4C112\" target=\"_blank\">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>"
495
- msgstr "Limité à 200 vidéos par liste de lecture. Va chercher habituellement quelque chose comme ceci: PLF679CB240DD4C112. Copiez le playlist Identifiant de la fin de l'URL dans la barre d'adresse de votre navigateur (tout en regardant une playlist YouTube). Il vient juste après le \"p = \". Par exemple: <a href=\"http://www.youtube.com/playlist?p=PLF679CB240DD4C112\">http://www.youtube.com/playlist?p=PLF679CB240DD4C112</a>"
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "Modest\" image de marqu"
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2013-12-12 17:37:57+0000\n"
6
  "Language: fr\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Déplier l'affichage des vidéos relatives après la fin de la vidéo."
493
 
494
+ msgid "The URL to any YouTube playlist (e.g. <a href=\"%s\" target=\"_blank\">%s</a>) or just the playlist identifier (e.g. %s)."
495
+ msgstr ""
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "Modest\" image de marqu"
src/main/resources/i18n/tubepress-he.mo CHANGED
Binary file
src/main/resources/i18n/tubepress-he.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2013-10-25 01:52:12+0000\n"
6
  "Language: he\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -491,8 +491,8 @@ msgstr "הצג קטעי וידאו בנושא"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "תצוגה של קטעי וידאו בנושא אחרי סיום הוידאו"
493
 
494
- msgid "Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the \"p=\". For instance: <a href=\"http://www.youtube.com/playlist?p=F679CB240DD4C112\" target=\"_blank\">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>"
495
- msgstr "מוגבל ל 200 קטעי וידאו ברשימת ההשמעה. בדרך כלל נראה משהו כזה: PLF679CB240DD4C112. העתק את מזהה רשימת ההשמעה מסוף כתובת האתר בשורת הכתובת של הדפדפן שלך (בזמן שמסתכל על רשימת השמעה של YouTube). זה בא מייד אחרי \"p = \". לדוגמה: <"
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "מיתוג \"צנוע \""
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2013-12-12 17:37:58+0000\n"
6
  "Language: he\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "תצוגה של קטעי וידאו בנושא אחרי סיום הוידאו"
493
 
494
+ msgid "The URL to any YouTube playlist (e.g. <a href=\"%s\" target=\"_blank\">%s</a>) or just the playlist identifier (e.g. %s)."
495
+ msgstr ""
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "מיתוג \"צנוע \""
src/main/resources/i18n/tubepress-hi.mo CHANGED
Binary file
src/main/resources/i18n/tubepress-hi.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2013-10-25 01:52:13+0000\n"
6
  "Language: hi\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -491,8 +491,8 @@ msgstr "संबंधित वीडियो दिखाएं"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "एक वीडियो पूर्ण होने के बाद संबंधित वीडियो का प्रदर्शन टॉगल करता है."
493
 
494
- msgid "Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the \"p=\". For instance: <a href=\"http://www.youtube.com/playlist?p=F679CB240DD4C112\" target=\"_blank\">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>"
495
- msgstr "प्लेलिस्ट प्रति 200 वीडियो के लिए सीमित. PLF679CB240DD4C112: कुछ इस तरह लग आमतौर पर होगा. अपने ब्राउज़र की पता पट्टी में URL के अंत से प्लेलिस्ट आईडी (प्लेलिस्ट को देख जबकि) को कॉपी करें. यह सही \"पी = \" के बाद आता है. उदाहरण के लिए: <एक"
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "मामूली \" ब्रांडिं"
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2013-12-12 17:37:59+0000\n"
6
  "Language: hi\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "एक वीडियो पूर्ण होने के बाद संबंधित वीडियो का प्रदर्शन टॉगल करता है."
493
 
494
+ msgid "The URL to any YouTube playlist (e.g. <a href=\"%s\" target=\"_blank\">%s</a>) or just the playlist identifier (e.g. %s)."
495
+ msgstr ""
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "मामूली \" ब्रांडिं"
src/main/resources/i18n/tubepress-it.mo CHANGED
Binary file
src/main/resources/i18n/tubepress-it.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2013-10-25 01:52:14+0000\n"
6
  "Language: it\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -491,8 +491,8 @@ msgstr "Mostra video correlati"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Commuta alla presentazione dei video correlati una volta terminato il video."
493
 
494
- msgid "Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the \"p=\". For instance: <a href=\"http://www.youtube.com/playlist?p=F679CB240DD4C112\" target=\"_blank\">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>"
495
- msgstr "Limitato a 200 video per playlist. Di solito simile a questo: PLF679CB240DD4C112. Copiare la playlist id dalla fine dell'URL nella barra degli indirizzi del browser (mentre guardando una playlist di YouTube). Si presenta subito dopo il \"p = \". Per esempio: <a"
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr " \"Modest \" di branding"
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2013-12-12 17:38:00+0000\n"
6
  "Language: it\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Commuta alla presentazione dei video correlati una volta terminato il video."
493
 
494
+ msgid "The URL to any YouTube playlist (e.g. <a href=\"%s\" target=\"_blank\">%s</a>) or just the playlist identifier (e.g. %s)."
495
+ msgstr ""
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr " \"Modest \" di branding"
src/main/resources/i18n/tubepress-ja.mo CHANGED
Binary file
src/main/resources/i18n/tubepress-ja.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2013-10-25 01:52:15+0000\n"
6
  "Language: ja\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -491,8 +491,8 @@ msgstr "関連動画を表示する"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "ビデオ終了後に関連動画の表示を切り替えます。"
493
 
494
- msgid "Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the \"p=\". For instance: <a href=\"http://www.youtube.com/playlist?p=F679CB240DD4C112\" target=\"_blank\">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>"
495
- msgstr "プレイリストごとに200ビデオに限定。通常はこのようになります:PLF679CB240DD4C112。ブラウザのアドレスバーのURL(YouTubeのプレイリストを見ながら)の端からプレイリストのIDをコピーします。まさに\"P = \"の後に来る。例えば:<"
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "ささやかな\"ブランディン"
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2013-12-12 17:38:01+0000\n"
6
  "Language: ja\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "ビデオ終了後に関連動画の表示を切り替えます。"
493
 
494
+ msgid "The URL to any YouTube playlist (e.g. <a href=\"%s\" target=\"_blank\">%s</a>) or just the playlist identifier (e.g. %s)."
495
+ msgstr ""
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "ささやかな\"ブランディン"
src/main/resources/i18n/tubepress-ko.mo CHANGED
Binary file
src/main/resources/i18n/tubepress-ko.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2013-10-25 01:52:16+0000\n"
6
  "Language: ko\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -491,8 +491,8 @@ msgstr "관련 동영상보기"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "비디오가 끝나면 관련 동영상의 표시를 토글합니다."
493
 
494
- msgid "Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the \"p=\". For instance: <a href=\"http://www.youtube.com/playlist?p=F679CB240DD4C112\" target=\"_blank\">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>"
495
- msgstr "재생 목록 당 200 비디오에 제한됩니다. PLF679CB240DD4C112이 같을 일반적으로 것입니다. 브라우저의 주소 표시 줄에 URL의 끝에서 재생 목록 ID를 (유튜브 재생 목록을 보면서) 복사합니다. 그것은 바로 \"p = \"다음에 온다. 예를 들어 <"
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "겸손한 \"브랜"
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2013-12-12 17:38:03+0000\n"
6
  "Language: ko\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "비디오가 끝나면 관련 동영상의 표시를 토글합니다."
493
 
494
+ msgid "The URL to any YouTube playlist (e.g. <a href=\"%s\" target=\"_blank\">%s</a>) or just the playlist identifier (e.g. %s)."
495
+ msgstr ""
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "겸손한 \"브랜"
src/main/resources/i18n/tubepress-nb.mo CHANGED
Binary file
src/main/resources/i18n/tubepress-nb.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2013-10-25 01:52:17+0000\n"
6
  "Language: nb\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -491,8 +491,8 @@ msgstr "Vis relaterte videoer"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Skrur av og på visning av relatert innhold etter at en video avsluttes"
493
 
494
- msgid "Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the \"p=\". For instance: <a href=\"http://www.youtube.com/playlist?p=F679CB240DD4C112\" target=\"_blank\">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>"
495
- msgstr "Begrenset til 200 videoer per spilleliste. Vil normalt se omentrent ut som dette: PLF679CB240DD4C112. Kopier spilleliste-id´en fra slutten av URL´en i nettleserens adresselinje (mens du ser på en YouTube spilleliste). Dette kommer direkte etter \"p=\". For eksempel: <a href=\"http://www.youtube.com/playlist?p=PLF679CB240DD4C112\">http://www.youtube.com/playlist?p=PLF679CB240DD4C112</a>"
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "\"Beskjeden\" merkenavnbygging"
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2013-12-12 17:38:04+0000\n"
6
  "Language: nb\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Skrur av og på visning av relatert innhold etter at en video avsluttes"
493
 
494
+ msgid "The URL to any YouTube playlist (e.g. <a href=\"%s\" target=\"_blank\">%s</a>) or just the playlist identifier (e.g. %s)."
495
+ msgstr ""
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "\"Beskjeden\" merkenavnbygging"
src/main/resources/i18n/tubepress-pl.mo CHANGED
Binary file
src/main/resources/i18n/tubepress-pl.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2013-10-25 01:52:17+0000\n"
6
  "Language: pl\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -491,8 +491,8 @@ msgstr "Pokaż związane filmy"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Uruchamia wyświetlanie związanych filmów po zakończeniu odtwarzania."
493
 
494
- msgid "Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the \"p=\". For instance: <a href=\"http://www.youtube.com/playlist?p=F679CB240DD4C112\" target=\"_blank\">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>"
495
- msgstr "Ograniczona do 200 filmów na liście odtwarzania. Zazwyczaj wygląda mniej więcej tak: PLF679CB240DD4C112. Skopiuj listę odtwarzania id z końcem adres URL w pasku adresu przeglądarki (patrząc na YouTube listy odtwarzania). To jest tuż po \"p=\". Na przykład: <a href=\"http://www.youtube.com/playlist?p=PLF679CB240DD4C112\">http://www.youtube.com/playlist?p=PLF679CB240DD4C112</a>"
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "\"Skromny\" branding"
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2013-12-12 17:38:05+0000\n"
6
  "Language: pl\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Uruchamia wyświetlanie związanych filmów po zakończeniu odtwarzania."
493
 
494
+ msgid "The URL to any YouTube playlist (e.g. <a href=\"%s\" target=\"_blank\">%s</a>) or just the playlist identifier (e.g. %s)."
495
+ msgstr ""
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "\"Skromny\" branding"
src/main/resources/i18n/tubepress-pt_BR.mo CHANGED
Binary file
src/main/resources/i18n/tubepress-pt_BR.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2013-10-25 01:52:18+0000\n"
6
  "Language: pt-br\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -491,10 +491,8 @@ msgstr "Mostra vídeos relacionados"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Alterna a exibição de vídeos relacionados, após terminar um vídeo."
493
 
494
- msgid "Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the \"p=\". For instance: <a href=\"http://www.youtube.com/playlist?p=F679CB240DD4C112\" target=\"_blank\">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>"
495
  msgstr ""
496
- "Limite de videos por playlist sao 200. Normalmente e necessario um link igual a este PLF679CB240DD4C112. Copie o playlist ID no final do URL que fica na barra de endereco de busca (primeiramente voce precisa clicar no seu Youtube playlist). Ele fica depois do \"p=\". Por examplo: For instance: <a href=\"http://www.youtube.com/playlist?p=PLF679CB240DD4C112\">\n"
497
- "http://www.youtube.com/playlist? p=PLF679CB240DD4C112</a> "
498
 
499
  msgid "\"Modest\" branding"
500
  msgstr "Marca \"modesto\""
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2013-12-12 17:38:06+0000\n"
6
  "Language: pt-br\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Alterna a exibição de vídeos relacionados, após terminar um vídeo."
493
 
494
+ msgid "The URL to any YouTube playlist (e.g. <a href=\"%s\" target=\"_blank\">%s</a>) or just the playlist identifier (e.g. %s)."
495
  msgstr ""
 
 
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "Marca \"modesto\""
src/main/resources/i18n/tubepress-ru.mo CHANGED
Binary file
src/main/resources/i18n/tubepress-ru.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2013-10-25 01:52:19+0000\n"
6
  "Language: ru\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -491,8 +491,8 @@ msgstr "Показывать похожие видео"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Показывать похожие видео после окончания воспроизведения исходного видео."
493
 
494
- msgid "Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the \"p=\". For instance: <a href=\"http://www.youtube.com/playlist?p=F679CB240DD4C112\" target=\"_blank\">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>"
495
- msgstr "Ограничено 200-ми видео в плейлисте. Для примера <a href=\"http://www.youtube.com/playlist?p=PLF679CB240DD4C112\">http://www.youtube.com/playlist?p=PLF679CB240DD4C112</a> Как правило id выглядит как: PLF679CB240DD4C112. Скопируйте id плейлиста, из адресной строки браузера, начинающегося после \"p=\"."
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "\"Скромный\" брендинг"
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2013-12-12 17:38:07+0000\n"
6
  "Language: ru\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Показывать похожие видео после окончания воспроизведения исходного видео."
493
 
494
+ msgid "The URL to any YouTube playlist (e.g. <a href=\"%s\" target=\"_blank\">%s</a>) or just the playlist identifier (e.g. %s)."
495
+ msgstr ""
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "\"Скромный\" брендинг"
src/main/resources/i18n/tubepress-sv.mo CHANGED
Binary file
src/main/resources/i18n/tubepress-sv.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2013-10-25 01:52:20+0000\n"
6
  "Language: sv\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -491,8 +491,8 @@ msgstr "Visa relaterade videos"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Anger om relaterade videos ska visas efter att videon slutat spela."
493
 
494
- msgid "Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the \"p=\". For instance: <a href=\"http://www.youtube.com/playlist?p=F679CB240DD4C112\" target=\"_blank\">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>"
495
- msgstr "Begränsad till 200 videos per spellista. Kommer brukar se ut så här: PLF679CB240DD4C112. Kopiera spellistan ID från slutet av URL i webbläsarens adressfält (medan du tittar på en YouTube spellista). Den kommer direkt efter \"p=\". Till exempel: <a href=\"http://www.youtube.com/playlist?p=PLF679CB240DD4C112\">http://www.youtube.com/playlist?p=PLF679CB240DD4C112</a>"
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "\"Blygsamma\" branding"
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2013-12-12 17:38:09+0000\n"
6
  "Language: sv\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "Anger om relaterade videos ska visas efter att videon slutat spela."
493
 
494
+ msgid "The URL to any YouTube playlist (e.g. <a href=\"%s\" target=\"_blank\">%s</a>) or just the playlist identifier (e.g. %s)."
495
+ msgstr ""
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "\"Blygsamma\" branding"
src/main/resources/i18n/tubepress-zh_CN.mo CHANGED
Binary file
src/main/resources/i18n/tubepress-zh_CN.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2013-10-25 01:52:21+0000\n"
6
  "Language: zh-cn\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -491,8 +491,8 @@ msgstr "相关视频"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "视频结束后,相关视频切换显示。"
493
 
494
- msgid "Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the \"p=\". For instance: <a href=\"http://www.youtube.com/playlist?p=F679CB240DD4C112\" target=\"_blank\">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>"
495
- msgstr "有限公司每200视频播放列表。通常会看起来像这样:PLF679CB240DD4C112。年底在浏览器的地址栏中的URL复制的播放列表ID(同时寻找一个YouTube播放列表)。右后\"P = \"。例如:<a href=\"http://www.youtube.com/playlist?p=PLF679CB240DD4C112\">http://www.youtube.com/playlist?p=PLF679CB240DD4C112</a>"
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "\"谦虚\"的品牌"
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2013-12-12 17:38:10+0000\n"
6
  "Language: zh-cn\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "视频结束后,相关视频切换显示。"
493
 
494
+ msgid "The URL to any YouTube playlist (e.g. <a href=\"%s\" target=\"_blank\">%s</a>) or just the playlist identifier (e.g. %s)."
495
+ msgstr ""
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr "\"谦虚\"的品牌"
src/main/resources/i18n/tubepress-zh_TW.mo CHANGED
Binary file
src/main/resources/i18n/tubepress-zh_TW.po CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
- "PO-Revision-Date: 2013-10-25 01:52:22+0000\n"
6
  "Language: zh-tw\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
@@ -491,8 +491,8 @@ msgstr "相關視頻"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "視頻結束後,相關視頻切換顯示。"
493
 
494
- msgid "Limited to 200 videos per playlist. Will usually look something like this: F679CB240DD4C112. Copy the playlist id from the end of the URL in your browser's address bar (while looking at a YouTube playlist). It comes right after the \"p=\". For instance: <a href=\"http://www.youtube.com/playlist?p=F679CB240DD4C112\" target=\"_blank\">http://www.youtube.com/playlist?p=F679CB240DD4C112</a>"
495
- msgstr "有限公司每200視頻播放列表。通常會看起來像這樣:PLF679CB240DD4C112。年底在瀏覽器的地址欄中的URL複製的播放列表ID(同時尋找一個YouTube播放列表)。右後 “P = ”。例如:<"
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr " “謙虛 ”的品牌"
2
  # This file is distributed under the same license as the TubePress package.
3
  msgid ""
4
  msgstr ""
5
+ "PO-Revision-Date: 2013-12-12 17:38:11+0000\n"
6
  "Language: zh-tw\n"
7
  "MIME-Version: 1.0\n"
8
  "Content-Type: text/plain; charset=UTF-8\n"
491
  msgid "Toggles the display of related videos after a video finishes."
492
  msgstr "視頻結束後,相關視頻切換顯示。"
493
 
494
+ msgid "The URL to any YouTube playlist (e.g. <a href=\"%s\" target=\"_blank\">%s</a>) or just the playlist identifier (e.g. %s)."
495
+ msgstr ""
496
 
497
  msgid "\"Modest\" branding"
498
  msgstr " “謙虛 ”的品牌"
src/main/web/js/gallery-dev.js CHANGED
@@ -1,13 +1,9 @@
1
- /**!
2
- * Copyright 2006 - 2013 TubePress LLC (http://tubepress.com)
3
- *
4
- * This file is part of TubePress (http://tubepress.com)
5
- *
6
  * This Source Code Form is subject to the terms of the Mozilla Public
7
  * License, v. 2.0. If a copy of the MPL was not distributed with this
8
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
- *
10
- * @author Eric D. Hough (eric@tubepress.com)
11
  */
12
 
13
  /**
@@ -15,757 +11,767 @@
15
  *
16
  * http://tobyho.com/2013/03/13/window-prop-vs-global-var/
17
  */
18
- var tubePressGalleryRegistrar,
19
-
20
- TubePressGallery = (function (jquery, win, tubepress) {
21
-
22
- /** http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/ */
23
- 'use strict';
24
-
25
- var text_tubepress = 'tubepress',
26
- text_eventPrefix_gallery = text_tubepress + '.gallery.',
27
- text_eventPrefix_video = text_tubepress + '.video.',
28
- text_eventPrefix_playerLocation = text_tubepress + '.playerlocation.',
29
- text_event_playerLocationPopulate = text_eventPrefix_playerLocation + 'populate',
30
- text_event_playerLocationInvoke = text_eventPrefix_playerLocation + 'invoke',
31
- text_event_galleryLoad = text_eventPrefix_gallery + 'load',
32
- text_event_galleryNewThumbs = text_eventPrefix_gallery + 'newthumbs',
33
- text_event_galleryPageChange = text_eventPrefix_gallery + 'pagechange',
34
- text_event_galleryChangeVideo = text_eventPrefix_gallery + 'changevideo',
35
- text_event_galleryNextVideo = text_eventPrefix_gallery + 'nextvideo',
36
- text_event_galleryPreviousVideo = text_eventPrefix_gallery + 'previousvideo',
37
- text_event_videoStart = text_eventPrefix_video + 'start',
38
- text_event_videoStop = text_eventPrefix_video + 'stop',
39
- text_urls = 'urls',
40
- text_sys = 'sys',
41
- text_js = 'js',
42
- beacon = tubepress.Beacon,
43
- subscribe = beacon.subscribe,
44
- publish = beacon.publish,
45
- langUtils = tubepress.Lang.Utils,
46
- environment = tubepress.Environment,
47
- domInjector = tubepress.DomInjector,
48
- coreJsPrefix = 'src/main/web/js',
49
- troo = true,
50
- fawlse = false,
51
- tubePressJsConfig = win.TubePressJsConfig,
52
 
53
- /**
54
- * Keeps state for any gallery loaded on the page.
55
- */
56
- galleryRegistry = (function () {
57
-
58
- var internalRegistry = {},
59
- text_nvpMap = 'nvpMap',
60
- text_jsMap = 'jsMap',
61
- text_page = 'page',
62
- text_currentVideoId = 'currentVideoId',
63
- text_playingNow = 'playingNow',
64
- parseIntOrZero = langUtils.parseIntOrZero,
65
- text_playerLocation = 'playerLocation',
66
- text_embedded = 'embedded',
67
- subscribe = beacon.subscribe,
68
 
69
- /**
70
- * Have we heard about this gallery?
71
- */
72
- isRegistered = function (galleryId) {
73
 
74
- return langUtils.isDefined(internalRegistry[galleryId]);
75
- },
76
 
77
- /**
78
- * Gets a property for the given gallery.
79
- */
80
- internalGet = function (galleryId, jsOrNvp, property) {
81
 
82
- return isRegistered(galleryId) ?
83
 
84
- internalRegistry[galleryId][jsOrNvp][property] : null;
85
- },
86
 
87
- /**
88
- * What page is this gallery on?
89
- */
90
- getCurrentPageNumber = function (galleryId) {
91
 
92
- //noinspection JSUnresolvedVariable
93
- return isRegistered(galleryId) ? internalRegistry[galleryId][text_page] : undefined;
94
- },
95
 
96
- /**
97
- * What video is this gallery currently playing?
98
- */
99
- getCurrentVideoId = function (galleryId) {
100
 
101
- return isRegistered(galleryId) ? internalRegistry[galleryId][text_currentVideoId] : undefined;
102
- },
103
 
104
- /**
105
- * Does the gallery use Ajax pagination?
106
- */
107
- isAjaxPagination = function (galleryId) {
108
 
109
- return internalGet(galleryId, text_jsMap, 'ajaxPagination');
110
- },
111
 
112
- /**
113
- * Does the gallery use auto-next?
114
- */
115
- isAutoNext = function (galleryId) {
116
 
117
- return internalGet(galleryId, text_jsMap, 'autoNext');
118
- },
119
 
120
- /**
121
- * Is this gallery currently playing a video?
122
- */
123
- isCurrentlyPlayingVideo = function (galleryId) {
124
 
125
- return isRegistered(galleryId) ? internalRegistry[galleryId][text_playingNow] : fawlse;
126
- },
127
 
128
- /**
129
- * Does the gallery use fluid thumbs?
130
- */
131
- isFluidThumbs = function (galleryId) {
132
 
133
- return internalGet(galleryId, text_jsMap, 'fluidThumbs');
134
- },
135
 
136
- /**
137
- * What's the embedded height for the video player of this gallery?
138
- */
139
- getEmbeddedHeight = function (galleryId) {
140
 
141
- return internalGet(galleryId, text_nvpMap, text_embedded + 'Height');
142
- },
143
 
144
- /**
145
- * What's the embedded width for the video player of this gallery?
146
- */
147
- getEmbeddedWidth = function (galleryId) {
148
 
149
- return internalGet(galleryId, text_nvpMap, text_embedded + 'Width');
150
- },
151
 
152
- /**
153
- * Which HTTP method (GET or POST) does this gallery want to use?
154
- */
155
- getHttpMethod = function (galleryId) {
156
 
157
- return internalGet(galleryId, text_jsMap, 'httpMethod');
158
- },
159
 
160
- getNvpMap = function (galleryId) {
161
 
162
- return internalRegistry[galleryId][text_nvpMap];
163
- },
164
 
165
- /**
166
- * What's the gallery's player location name?
167
- */
168
- getPlayerLocationName = function (galleryId) {
169
 
170
- return internalGet(galleryId, text_nvpMap, text_playerLocation);
171
- },
172
 
173
- /**
174
- * Where is the JS init code for this player?
175
- */
176
- getPlayerLocationJsUrl = function (galleryId) {
177
 
178
- return internalGet(galleryId, text_jsMap, text_playerLocation + 'JsUrl');
179
- },
180
 
181
- /**
182
- * Does this player produce HTML?
183
- */
184
- getPlayerLocationProducesHtml = function (galleryId) {
185
 
186
- return internalGet(galleryId, text_jsMap, text_playerLocation + 'ProducesHtml');
187
- },
188
 
189
- /**
190
- * What's the sequence of videos for this gallery?
191
- */
192
- getSequence = function (galleryId) {
193
 
194
- return internalGet(galleryId, text_jsMap, 'sequence');
195
- },
196
 
197
- /**
198
- * Get the jQuery selector where the thumbs live.
199
- *
200
- * this is hard-coded - need to get rid of that.
201
- */
202
- getThumbAreaSelector = function (galleryId) {
203
 
204
- return '#' + text_tubepress + '_gallery_' + galleryId + '_thumbnail_area';
205
- },
206
 
207
- /**
208
- * Performs gallery initialization on jQuery(document).ready().
209
- */
210
- onGalleryLoad = function (event, galleryId, params) {
 
 
 
 
 
 
 
 
 
 
211
 
212
- var currentPage = langUtils.getParameterByName(text_tubepress + '_page'),
213
- pageAsInt = parseIntOrZero(currentPage),
214
- text_ajaxPagination = 'ajaxPagination',
215
- sequence;
216
 
217
- /** Save the params. */
218
- internalRegistry[galleryId] = params;
219
 
220
- /**
221
- * Save the current page.
222
- */
223
- internalRegistry[galleryId][text_page] = pageAsInt === 0 ? 1 : pageAsInt;
224
 
225
- /**
226
- * Record that we're *not* currently playing a video.
227
- */
228
- internalRegistry[galleryId][text_playingNow] = fawlse;
229
 
230
- /**
231
- * If this gallery has a sequence,
232
- * save the first video as the "current" video.
233
- */
234
- sequence = getSequence(galleryId);
235
 
236
- if (sequence) {
237
 
238
- internalRegistry[galleryId][text_currentVideoId] = sequence[0];
239
- }
240
 
241
- if (isAjaxPagination(galleryId)) {
242
 
243
- if (langUtils.hasOwnNestedProperty(tubePressJsConfig, text_urls, text_js, text_sys, text_ajaxPagination)) {
244
 
245
- domInjector.loadJs(tubePressJsConfig[text_urls][text_js][text_sys][text_ajaxPagination]);
246
 
247
- } else {
248
 
249
- domInjector.loadJs(coreJsPrefix + '/' + text_ajaxPagination + '.js');
250
- }
251
  }
252
- },
 
253
 
254
- onPageChange = function (event, galleryId, newPage) {
255
 
256
- if (isRegistered(galleryId)) {
257
 
258
- var asInt = parseIntOrZero(newPage);
259
 
260
- internalRegistry[galleryId][text_page] = asInt === 0 ? 1 : asInt;
261
- }
262
- },
263
 
264
- /**
265
- * Searches through our galleries for one that matches the given.
266
- */
267
- findGalleryThatMatchesTest = function (test) {
268
 
269
- var galleryId;
270
 
271
- for (galleryId in internalRegistry) {
272
 
273
- if (internalRegistry.hasOwnProperty(galleryId)) {
274
 
275
- if (test(galleryId)) {
276
 
277
- return galleryId;
278
- }
279
  }
280
  }
 
281
 
282
- return undefined;
283
- },
284
 
285
- /**
286
- * Find the gallery that is currently playingcurrentVideoId the given video.
287
- */
288
- findGalleryContainingVideoDomId = function (domId) {
289
 
290
- var selector = '[id^="' + domId + '"]',
291
 
292
- test = function (galleryId) {
293
 
294
- var gall = jquery('#' + text_tubepress + '_gallery_' + galleryId);
295
 
296
- if (!gall.length) {
297
 
298
- //we couldn't find this gallery for some reason
299
- return false;
300
- }
301
 
302
- return gall.find(selector).length > 0;
303
- };
304
 
305
- return findGalleryThatMatchesTest(test);
306
- },
 
 
 
 
 
 
 
307
 
308
  /**
309
- * A video on the page has stopped.
310
  */
311
- onVideoStop = function (e, videoId, domId) {
312
 
313
- var matchingGalleryId = findGalleryContainingVideoDomId(domId);
 
314
 
315
- /**
316
- * If we don't have a gallery assigned to this video, we don't really care.
317
- */
318
- if (!matchingGalleryId) {
 
319
 
320
- return;
321
- }
 
 
322
 
323
- /**
324
- * Record the video as not playing.
325
- */
326
- internalRegistry[matchingGalleryId][isCurrentlyPlayingVideo] = fawlse;
327
- },
328
 
329
  /**
330
- * A video on the page has started.
331
  */
332
- onVideoStart = function (e, videoId, domId) {
333
 
334
- var matchingGalleryId = findGalleryContainingVideoDomId(domId);
 
335
 
336
- /**
337
- * If we don't have a gallery assigned to this video, we don't really care.
338
- */
339
- if (!matchingGalleryId) {
 
 
340
 
341
- return;
342
- }
 
 
343
 
344
- /**
345
- * Record the video as playing.
346
- */
347
- internalRegistry[matchingGalleryId][isCurrentlyPlayingVideo] = troo;
348
- internalRegistry[matchingGalleryId][text_currentVideoId] = videoId;
349
- },
350
 
351
- /**
352
- * Set a video as "current" for a gallery.
353
- */
354
- onChangeVideo = function (event, galleryId, videoId) {
355
 
356
- if (isRegistered(galleryId)) {
357
 
358
- internalRegistry[galleryId][text_currentVideoId] = videoId;
359
- }
360
- },
361
 
362
- findAllGalleryIds = function () {
 
363
 
364
- var ids = [],
365
- id;
 
366
 
367
- //noinspection JSLint
368
- for (id in internalRegistry) {
369
 
370
- //noinspection JSUnfilteredForInLoop
371
- ids.push(id);
372
- }
373
 
374
- return ids;
375
- };
376
 
377
- subscribe(text_event_galleryLoad, onGalleryLoad);
378
 
379
- subscribe(text_event_galleryPageChange, onPageChange);
380
 
381
- subscribe(text_event_galleryChangeVideo, onChangeVideo);
382
 
383
- subscribe(text_event_videoStop, onVideoStop);
384
 
385
- subscribe(text_event_videoStart, onVideoStart);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386
 
387
- return {
388
 
389
- isAjaxPagination : isAjaxPagination,
390
- isAutoNext : isAutoNext,
391
- isCurrentlyPlayingVideo : isCurrentlyPlayingVideo,
392
- isFluidThumbs : isFluidThumbs,
393
- isRegistered : isRegistered,
394
- findAllGalleryIds : findAllGalleryIds,
395
- findGalleryContainingVideoDomId : findGalleryContainingVideoDomId,
396
- getCurrentPageNumber : getCurrentPageNumber,
397
- getCurrentVideoId : getCurrentVideoId,
398
- getEmbeddedHeight : getEmbeddedHeight,
399
- getEmbeddedWidth : getEmbeddedWidth,
400
- getHttpMethod : getHttpMethod,
401
- getNvpMap : getNvpMap,
402
- getPlayerLocationName : getPlayerLocationName,
403
- getPlayerLocationProducesHtml : getPlayerLocationProducesHtml,
404
- getPlayerLocationJsUrl : getPlayerLocationJsUrl,
405
- getSequence : getSequence,
406
- getThumbAreaSelector : getThumbAreaSelector
407
- };
408
- }()),
409
 
410
- asyncGalleryRegistrar = (function () {
 
411
 
412
- var register = function (galleryId, params) {
413
 
414
- publish(text_event_galleryLoad, [ galleryId, params ]);
415
- };
 
416
 
417
- return {
 
 
 
 
 
418
 
419
- register : register
420
- };
421
- }());
422
 
423
- /**
424
- * Handles fluid thumbs.
425
- *
426
- * http://www.sohtanaka.com/web-design/smart-columns-w-css-jquery/
427
- */
428
- (function () {
429
 
430
- var floor = Math.floor,
 
431
 
432
- getThumbAreaSelector = function (galleryId) {
 
 
 
433
 
434
- return galleryRegistry.getThumbAreaSelector(galleryId);
435
- },
436
 
437
- /**
438
- * Get the jQuery reference to where the thumbnails live.
439
- */
440
- getThumbArea = function (galleryId) {
 
 
 
441
 
442
- return jquery(getThumbAreaSelector(galleryId));
443
- },
 
444
 
445
- /**
446
- * Get the thumbnail width. Usually this is just a static thumbnail
447
- * image, but *may* be an actual embed or something like that.
448
- *
449
- * Fallback value is 120.
450
- */
451
- getThumbWidth = function (galleryId) {
452
 
453
- var thumbArea = getThumbArea(galleryId),
454
- firstVisualElement = thumbArea.find('img:first'),
455
- width = 120;
456
 
457
  if (firstVisualElement.length === 0) {
458
 
459
- firstVisualElement = thumbArea.find('div.' + text_tubepress + '_thumb:first > div.' + text_tubepress + '_embed');
 
 
460
 
461
- if (firstVisualElement.length === 0) {
462
 
463
- return width;
464
- }
465
- }
466
 
467
- width = firstVisualElement.attr('width');
 
468
 
469
- if (width) {
 
470
 
471
- return width;
472
- }
473
 
474
- return firstVisualElement.width();
475
- },
476
 
477
- makeThumbsFluid = function (galleryId) {
 
 
 
 
 
 
478
 
479
- getThumbArea(galleryId).css({ 'width' : '100%' });
 
 
480
 
481
- var gallerySelector = getThumbAreaSelector(galleryId),
482
- columnWidth = getThumbWidth(galleryId),
483
- gallery = jquery(gallerySelector),
484
- colWrap = gallery.width(),
485
- colNum = floor(colWrap / columnWidth),
486
- colFixed = floor(colWrap / colNum),
487
- thumbs = jquery(gallerySelector + ' div.' + text_tubepress + '_thumb');
488
 
489
- gallery.css({ 'width' : '100%'});
490
- gallery.css({ 'width' : colWrap });
491
- thumbs.css({ 'width' : colFixed});
492
- },
493
 
494
- /**
495
- * Callback for thumbnail loads.
496
- */
497
- onNewGalleryOrThumbs = function (e, galleryId) {
498
 
499
- /* fluid thumbs if we need it */
500
- if (galleryRegistry.isFluidThumbs(galleryId)) {
 
501
 
502
- makeThumbsFluid(galleryId);
503
- }
504
- },
 
505
 
506
- /**
507
- * On window resize.
508
- */
509
- onWindowResize = function (e) {
510
 
511
- var ids = galleryRegistry.findAllGalleryIds(),
512
- index = 0,
513
- length = ids.length;
514
 
515
- for (index; index < length; index += 1) {
 
 
516
 
517
- onNewGalleryOrThumbs(e, ids[index]);
518
- }
519
- };
520
 
521
- subscribe(text_event_galleryNewThumbs + ' ' + text_event_galleryLoad, onNewGalleryOrThumbs);
522
- subscribe(text_tubepress + '.window.resize', onWindowResize);
523
- }());
 
524
 
525
  /**
526
- * Handles thumbnail clicks.
527
  */
528
- (function () {
 
 
 
529
 
530
  /**
531
- * Parse the gallery ID from the "rel" attribute.
532
  */
533
- var getGalleryIdFromRelSplit = function (relSplit) {
534
 
535
- return relSplit[3];
536
- },
537
 
538
- /**
539
- * Parse the video ID from the "rel" attribute.
540
- */
541
- getVideoIdFromIdAttr = function (id) {
542
-
543
- var end = id.lastIndexOf('_');
544
 
545
- return id.substring(16, end);
546
- },
 
 
547
 
548
- /**
549
- * Click listener callback.
550
- */
551
- clickListener = function () {
552
 
553
- var rel_split = jquery(this).attr('rel').split('_'),
554
- galleryId = getGalleryIdFromRelSplit(rel_split),
555
- videoId = getVideoIdFromIdAttr(jquery(this).attr('id'));
556
 
557
- publish(text_event_galleryChangeVideo, [ galleryId, videoId ]);
558
- },
 
 
559
 
560
- /**
561
- * Callback for thumbnail loads.
562
- */
563
- onNewGalleryOrThumbs = function (e, galleryId) {
564
 
565
- /* add a click handler to each link in this gallery */
566
- jquery('#' + text_tubepress + '_gallery_' + galleryId + " a[id^='" + text_tubepress + "_']").click(clickListener);
567
- };
568
 
569
- subscribe(text_event_galleryNewThumbs + ' ' + text_event_galleryLoad, onNewGalleryOrThumbs);
570
 
571
- }());
 
 
 
572
 
573
  /**
574
- * Handles player-related functionality (popup, Shadowbox, etc)
575
  */
576
- (function () {
577
 
578
- /**
579
- * Find the player required for a gallery and load the JS.
580
- */
581
- var onNewGalleryLoaded = function (e, galleryId) {
582
-
583
- var path = galleryRegistry.getPlayerLocationJsUrl(galleryId);
584
-
585
- /*
586
- * Load this player's JS, if needed.
587
- */
588
- domInjector.loadJs(path);
589
- },
590
 
591
- /**
592
- * Load up a TubePress player with the given video ID.
593
  */
594
- onNewVideoRequested = function (e, galleryId, videoId) {
 
595
 
596
- var playerName = galleryRegistry.getPlayerLocationName(galleryId),
597
- height = galleryRegistry.getEmbeddedHeight(galleryId),
598
- width = galleryRegistry.getEmbeddedWidth(galleryId),
599
- nvpMap = galleryRegistry.getNvpMap(galleryId),
600
 
601
- callback = function (data) {
 
 
 
602
 
603
- var result = tubepress.Lang.JsonParser.parse(data.responseText),
604
- title = result.title,
605
- html = result.html;
606
 
607
- publish(text_event_playerLocationPopulate, [ playerName, title, html, height, width, videoId, galleryId ]);
608
- },
 
609
 
610
- dataToSend = {
 
611
 
612
- 'action' : 'playerHtml',
613
- 'tubepress_video' : videoId
614
- },
615
 
616
- method;
 
 
617
 
618
- /**
619
- * Add the NVPs for TubePress to the data.
620
- */
621
- jquery.extend(dataToSend, nvpMap);
622
 
623
- /** Announce we're gonna invoke the player... */
624
- publish(text_event_playerLocationInvoke, [ playerName, height, width, videoId, galleryId ]);
 
 
625
 
626
- /** If this player requires population, go fetch the HTML for it. */
627
- if (galleryRegistry.getPlayerLocationProducesHtml(galleryId)) {
628
 
629
- method = galleryRegistry.getHttpMethod(galleryId);
 
630
 
631
- /* ... and fetch the HTML for it */
632
- tubepress.Ajax.Executor.get(method, environment.getAjaxEndpointUrl(), dataToSend, callback, 'json');
633
- }
634
- };
635
 
636
- /** When we see a new gallery... */
637
- subscribe(text_event_galleryLoad, onNewGalleryLoaded);
 
 
638
 
639
- /** When a user clicks a thumbnail... */
640
- subscribe(text_event_galleryChangeVideo, onNewVideoRequested);
641
- }());
642
 
643
- /**
644
- * Handles pagination clicks.
645
- */
646
- (function () {
647
 
648
- var handlePaginationClick = function (anchor, galleryId) {
 
 
 
649
 
650
- var page = anchor.data('page');
651
 
652
- publish(text_event_galleryPageChange, [ galleryId, page ]);
653
- },
654
 
655
- onNewGalleryOrThumbs = function (event, galleryId) {
 
656
 
657
- var pagationClickCallback = function () {
658
 
659
- handlePaginationClick(jquery(this), galleryId);
660
 
661
- if (galleryRegistry.isAjaxPagination(galleryId)) {
662
 
663
- //prevent default click action
664
- event.preventDefault();
665
- return fawlse;
666
- }
667
 
668
- return troo;
669
- };
 
 
670
 
671
- jquery('#' + text_tubepress + '_gallery_' + galleryId + ' div.pagination a').click(pagationClickCallback);
672
  };
673
 
674
- subscribe(text_event_galleryNewThumbs + ' ' + text_event_galleryLoad, onNewGalleryOrThumbs);
 
675
 
676
- }());
 
 
 
 
 
 
 
677
 
678
  /**
679
- * Handles "next" and "previous" video requests.
680
  */
681
- (function () {
682
 
683
- /**
684
- * Go to the next video in the gallery.
685
- */
686
- var onNextVideoRequested = function (event, galleryId) {
 
687
 
688
- /** Get the gallery's sequence. This is an array of video ids. */
689
- var sequence = galleryRegistry.getSequence(galleryId),
690
- vidId = galleryRegistry.getCurrentVideoId(galleryId),
691
- index = jquery.inArray(vidId.toString(), sequence),
692
- lastIndex = sequence ? sequence.length - 1 : index;
693
 
694
- /** Sorry, we don't know anything about this video id, or we've reached the end of the gallery. */
695
- if (index === -1 || index === lastIndex) {
696
 
697
- return;
698
- }
 
699
 
700
- /** Start the next video in line. */
701
- publish(text_event_galleryChangeVideo, [ galleryId, sequence[index + 1] ]);
702
- },
703
 
704
- /** Play the previous video in the gallery. */
705
- onPrevVideoRequested = function (event, galleryId) {
 
 
706
 
707
- /** Get the gallery's sequence. This is an array of video ids. */
708
- var sequence = galleryRegistry.getSequence(galleryId),
709
- vidId = galleryRegistry.getCurrentVideoId(galleryId),
710
- index = jquery.inArray(vidId.toString(), sequence);
711
 
712
- /** Sorry, we don't know anything about this video id, or we're at the start of the gallery. */
713
- if (index === -1 || index === 0) {
714
 
715
- return;
716
- }
 
717
 
718
- /** Start the previous video in line. */
719
- publish(text_event_galleryChangeVideo, [ galleryId, sequence[index - 1] ]);
720
- };
721
 
722
- subscribe(text_event_galleryNextVideo, onNextVideoRequested);
723
 
724
- subscribe(text_event_galleryPreviousVideo, onPrevVideoRequested);
725
 
726
- }());
 
 
 
727
 
728
  /**
729
- * Handles auto-next.
730
  */
731
- (function () {
732
-
733
- /**
734
- * A video on the page has stopped.
735
- */
736
- var logger = tubepress.Logger,
737
-
738
- onVideoStop = function (e, videoId, domId, providerName, playerImplementationName) {
739
-
740
- var galleryId = galleryRegistry.findGalleryContainingVideoDomId(domId);
741
 
742
- if (!galleryId) {
743
 
744
- return;
745
- }
746
 
747
- if (galleryRegistry.isAutoNext(galleryId) && galleryRegistry.getSequence(galleryId)) {
 
748
 
749
- if (logger.on()) {
750
 
751
- logger.log('Auto-starting next for gallery ' + galleryId);
752
- }
 
 
753
 
754
- /** Go to the next one! */
755
- beacon.publish(text_event_galleryNextVideo, [ galleryId ]);
756
- }
757
- };
758
 
759
- /** We would like to be notified when a video ends, in the case of auto-next. */
760
- beacon.subscribe(text_event_videoStop, onVideoStop);
761
 
762
- }());
763
 
764
- tubepress.AsyncUtil.processQueueCalls('tubePressGalleryRegistrar', asyncGalleryRegistrar);
 
 
 
765
 
766
- return {
 
767
 
768
- Registry : galleryRegistry
769
- };
 
 
770
 
771
- }(jQuery, window, TubePress));
1
+ /*!
2
+ * Copyright 2006 - 2013 TubePress LLC (http://tubepress.com).
3
+ * This file is part of TubePress (http://tubepress.com).
 
 
4
  * This Source Code Form is subject to the terms of the Mozilla Public
5
  * License, v. 2.0. If a copy of the MPL was not distributed with this
6
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 
7
  */
8
 
9
  /**
11
  *
12
  * http://tobyho.com/2013/03/13/window-prop-vs-global-var/
13
  */
14
+ var tubePressGalleryRegistrar;
15
+
16
+ (function (jquery, win, tubepress) {
17
+
18
+ /** http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/ */
19
+ 'use strict';
20
+
21
+ var text_tubepress = 'tubepress',
22
+ text_eventPrefix_gallery = text_tubepress + '.gallery.',
23
+ text_eventPrefix_video = text_tubepress + '.video.',
24
+ text_eventPrefix_playerLocation = text_tubepress + '.playerlocation.',
25
+ text_event_playerLocationPopulate = text_eventPrefix_playerLocation + 'populate',
26
+ text_event_playerLocationInvoke = text_eventPrefix_playerLocation + 'invoke',
27
+ text_event_galleryLoad = text_eventPrefix_gallery + 'load',
28
+ text_event_galleryNewThumbs = text_eventPrefix_gallery + 'newthumbs',
29
+ text_event_galleryPageChange = text_eventPrefix_gallery + 'pagechange',
30
+ text_event_galleryChangeVideo = text_eventPrefix_gallery + 'changevideo',
31
+ text_event_galleryNextVideo = text_eventPrefix_gallery + 'nextvideo',
32
+ text_event_galleryPreviousVideo = text_eventPrefix_gallery + 'previousvideo',
33
+ text_event_videoStart = text_eventPrefix_video + 'start',
34
+ text_event_videoStop = text_eventPrefix_video + 'stop',
35
+ text_urls = 'urls',
36
+ text_sys = 'sys',
37
+ text_js = 'js',
38
+ beacon = tubepress.Beacon,
39
+ subscribe = beacon.subscribe,
40
+ publish = beacon.publish,
41
+ langUtils = tubepress.Lang.Utils,
42
+ environment = tubepress.Environment,
43
+ domInjector = tubepress.DomInjector,
44
+ coreJsPrefix = 'src/main/web/js',
45
+ troo = true,
46
+ fawlse = false,
47
+ tubePressJsConfig = win.TubePressJsConfig,
48
 
49
+ /**
50
+ * Keeps state for any gallery loaded on the page.
51
+ */
52
+ galleryRegistry = (function () {
53
+
54
+ var internalRegistry = {},
55
+ text_nvpMap = 'nvpMap',
56
+ text_jsMap = 'jsMap',
57
+ text_page = 'page',
58
+ text_currentVideoId = 'currentVideoId',
59
+ text_playingNow = 'playingNow',
60
+ parseIntOrZero = langUtils.parseIntOrZero,
61
+ text_playerLocation = 'playerLocation',
62
+ text_embedded = 'embedded',
63
+ subscribe = beacon.subscribe,
64
 
65
+ /**
66
+ * Have we heard about this gallery?
67
+ */
68
+ isRegistered = function (galleryId) {
69
 
70
+ return langUtils.isDefined(internalRegistry[galleryId]);
71
+ },
72
 
73
+ /**
74
+ * Gets a property for the given gallery.
75
+ */
76
+ internalGet = function (galleryId, jsOrNvp, property) {
77
 
78
+ return isRegistered(galleryId) ?
79
 
80
+ internalRegistry[galleryId][jsOrNvp][property] : null;
81
+ },
82
 
83
+ /**
84
+ * What page is this gallery on?
85
+ */
86
+ getCurrentPageNumber = function (galleryId) {
87
 
88
+ //noinspection JSUnresolvedVariable
89
+ return isRegistered(galleryId) ? internalRegistry[galleryId][text_page] : undefined;
90
+ },
91
 
92
+ /**
93
+ * What video is this gallery currently playing?
94
+ */
95
+ getCurrentVideoId = function (galleryId) {
96
 
97
+ return isRegistered(galleryId) ? internalRegistry[galleryId][text_currentVideoId] : undefined;
98
+ },
99
 
100
+ /**
101
+ * Does the gallery use Ajax pagination?
102
+ */
103
+ isAjaxPagination = function (galleryId) {
104
 
105
+ return internalGet(galleryId, text_jsMap, 'ajaxPagination');
106
+ },
107
 
108
+ /**
109
+ * Does the gallery use auto-next?
110
+ */
111
+ isAutoNext = function (galleryId) {
112
 
113
+ return internalGet(galleryId, text_jsMap, 'autoNext');
114
+ },
115
 
116
+ /**
117
+ * Is this gallery currently playing a video?
118
+ */
119
+ isCurrentlyPlayingVideo = function (galleryId) {
120
 
121
+ return isRegistered(galleryId) ? internalRegistry[galleryId][text_playingNow] : fawlse;
122
+ },
123
 
124
+ /**
125
+ * Does the gallery use fluid thumbs?
126
+ */
127
+ isFluidThumbs = function (galleryId) {
128
 
129
+ return internalGet(galleryId, text_jsMap, 'fluidThumbs');
130
+ },
131
 
132
+ /**
133
+ * What's the embedded height for the video player of this gallery?
134
+ */
135
+ getEmbeddedHeight = function (galleryId) {
136
 
137
+ return internalGet(galleryId, text_nvpMap, text_embedded + 'Height');
138
+ },
139
 
140
+ /**
141
+ * What's the embedded width for the video player of this gallery?
142
+ */
143
+ getEmbeddedWidth = function (galleryId) {
144
 
145
+ return internalGet(galleryId, text_nvpMap, text_embedded + 'Width');
146
+ },
147
 
148
+ /**
149
+ * Which HTTP method (GET or POST) does this gallery want to use?
150
+ */
151
+ getHttpMethod = function (galleryId) {
152
 
153
+ return internalGet(galleryId, text_jsMap, 'httpMethod');
154
+ },
155
 
156
+ getJsMap = function (galleryId) {
157
 
158
+ return internalRegistry[galleryId][text_jsMap];
159
+ },
160
 
161
+ getNvpMap = function (galleryId) {
 
 
 
162
 
163
+ return internalRegistry[galleryId][text_nvpMap];
164
+ },
165
 
166
+ /**
167
+ * What's the gallery's player location name?
168
+ */
169
+ getPlayerLocationName = function (galleryId) {
170
 
171
+ return internalGet(galleryId, text_nvpMap, text_playerLocation);
172
+ },
173
 
174
+ /**
175
+ * Where is the JS init code for this player?
176
+ */
177
+ getPlayerLocationJsUrl = function (galleryId) {
178
 
179
+ return internalGet(galleryId, text_jsMap, text_playerLocation + 'JsUrl');
180
+ },
181
 
182
+ /**
183
+ * Does this player produce HTML?
184
+ */
185
+ getPlayerLocationProducesHtml = function (galleryId) {
186
 
187
+ return internalGet(galleryId, text_jsMap, text_playerLocation + 'ProducesHtml');
188
+ },
189
 
190
+ /**
191
+ * What's the sequence of videos for this gallery?
192
+ */
193
+ getSequence = function (galleryId) {
 
 
194
 
195
+ return internalGet(galleryId, text_jsMap, 'sequence');
196
+ },
197
 
198
+ /**
199
+ * Get the jQuery selector where the thumbs live.
200
+ *
201
+ * this is hard-coded - need to get rid of that.
202
+ */
203
+ getThumbAreaSelector = function (galleryId) {
204
+
205
+ return '#' + text_tubepress + '_gallery_' + galleryId + '_thumbnail_area';
206
+ },
207
+
208
+ /**
209
+ * Performs gallery initialization on jQuery(document).ready().
210
+ */
211
+ onGalleryLoad = function (event, galleryId, params) {
212
 
213
+ var currentPage = langUtils.getParameterByName(text_tubepress + '_page'),
214
+ pageAsInt = parseIntOrZero(currentPage),
215
+ text_ajaxPagination = 'ajaxPagination',
216
+ sequence;
217
 
218
+ /** Save the params. */
219
+ internalRegistry[galleryId] = params;
220
 
221
+ /**
222
+ * Save the current page.
223
+ */
224
+ internalRegistry[galleryId][text_page] = pageAsInt === 0 ? 1 : pageAsInt;
225
 
226
+ /**
227
+ * Record that we're *not* currently playing a video.
228
+ */
229
+ internalRegistry[galleryId][text_playingNow] = fawlse;
230
 
231
+ /**
232
+ * If this gallery has a sequence,
233
+ * save the first video as the "current" video.
234
+ */
235
+ sequence = getSequence(galleryId);
236
 
237
+ if (sequence) {
238
 
239
+ internalRegistry[galleryId][text_currentVideoId] = sequence[0];
240
+ }
241
 
242
+ if (isAjaxPagination(galleryId)) {
243
 
244
+ if (langUtils.hasOwnNestedProperty(tubePressJsConfig, text_urls, text_js, text_sys, text_ajaxPagination)) {
245
 
246
+ domInjector.loadJs(tubePressJsConfig[text_urls][text_js][text_sys][text_ajaxPagination]);
247
 
248
+ } else {
249
 
250
+ domInjector.loadJs(coreJsPrefix + '/' + text_ajaxPagination + '.js');
 
251
  }
252
+ }
253
+ },
254
 
255
+ onPageChange = function (event, galleryId, newPage) {
256
 
257
+ if (isRegistered(galleryId)) {
258
 
259
+ var asInt = parseIntOrZero(newPage);
260
 
261
+ internalRegistry[galleryId][text_page] = asInt === 0 ? 1 : asInt;
262
+ }
263
+ },
264
 
265
+ /**
266
+ * Searches through our galleries for one that matches the given.
267
+ */
268
+ findGalleryThatMatchesTest = function (test) {
269
 
270
+ var galleryId;
271
 
272
+ for (galleryId in internalRegistry) {
273
 
274
+ if (internalRegistry.hasOwnProperty(galleryId)) {
275
 
276
+ if (test(galleryId)) {
277
 
278
+ return galleryId;
 
279
  }
280
  }
281
+ }
282
 
283
+ return undefined;
284
+ },
285
 
286
+ /**
287
+ * Find the gallery that is currently playingcurrentVideoId the given video.
288
+ */
289
+ findGalleryContainingVideoDomId = function (domId) {
290
 
291
+ var selector = '[id^="' + domId + '"]',
292
 
293
+ test = function (galleryId) {
294
 
295
+ var gall = jquery('#' + text_tubepress + '_gallery_' + galleryId);
296
 
297
+ if (!gall.length) {
298
 
299
+ //we couldn't find this gallery for some reason
300
+ return false;
301
+ }
302
 
303
+ return gall.find(selector).length > 0;
304
+ };
305
 
306
+ return findGalleryThatMatchesTest(test);
307
+ },
308
+
309
+ /**
310
+ * A video on the page has stopped.
311
+ */
312
+ onVideoStop = function (e, videoId, domId) {
313
+
314
+ var matchingGalleryId = findGalleryContainingVideoDomId(domId);
315
 
316
  /**
317
+ * If we don't have a gallery assigned to this video, we don't really care.
318
  */
319
+ if (!matchingGalleryId) {
320
 
321
+ return;
322
+ }
323
 
324
+ /**
325
+ * Record the video as not playing.
326
+ */
327
+ internalRegistry[matchingGalleryId][isCurrentlyPlayingVideo] = fawlse;
328
+ },
329
 
330
+ /**
331
+ * A video on the page has started.
332
+ */
333
+ onVideoStart = function (e, videoId, domId) {
334
 
335
+ var matchingGalleryId = findGalleryContainingVideoDomId(domId);
 
 
 
 
336
 
337
  /**
338
+ * If we don't have a gallery assigned to this video, we don't really care.
339
  */
340
+ if (!matchingGalleryId) {
341
 
342
+ return;
343
+ }
344
 
345
+ /**
346
+ * Record the video as playing.
347
+ */
348
+ internalRegistry[matchingGalleryId][isCurrentlyPlayingVideo] = troo;
349
+ internalRegistry[matchingGalleryId][text_currentVideoId] = videoId;
350
+ },
351
 
352
+ /**
353
+ * Set a video as "current" for a gallery.
354
+ */
355
+ onChangeVideo = function (event, galleryId, videoId) {
356
 
357
+ if (isRegistered(galleryId)) {
 
 
 
 
 
358
 
359
+ internalRegistry[galleryId][text_currentVideoId] = videoId;
360
+ }
361
+ },
 
362
 
363
+ findAllGalleryIds = function () {
364
 
365
+ var ids = [],
366
+ id;
 
367
 
368
+ //noinspection JSLint
369
+ for (id in internalRegistry) {
370
 
371
+ //noinspection JSUnfilteredForInLoop
372
+ ids.push(id);
373
+ }
374
 
375
+ return ids;
376
+ };
377
 
378
+ subscribe(text_event_galleryLoad, onGalleryLoad);
 
 
379
 
380
+ subscribe(text_event_galleryPageChange, onPageChange);
 
381
 
382
+ subscribe(text_event_galleryChangeVideo, onChangeVideo);
383
 
384
+ subscribe(text_event_videoStop, onVideoStop);
385
 
386
+ subscribe(text_event_videoStart, onVideoStart);
387
 
388
+ return {
389
 
390
+ isAjaxPagination : isAjaxPagination,
391
+ isAutoNext : isAutoNext,
392
+ isCurrentlyPlayingVideo : isCurrentlyPlayingVideo,
393
+ isFluidThumbs : isFluidThumbs,
394
+ isRegistered : isRegistered,
395
+ findAllGalleryIds : findAllGalleryIds,
396
+ findGalleryContainingVideoDomId : findGalleryContainingVideoDomId,
397
+ getCurrentPageNumber : getCurrentPageNumber,
398
+ getCurrentVideoId : getCurrentVideoId,
399
+ getEmbeddedHeight : getEmbeddedHeight,
400
+ getEmbeddedWidth : getEmbeddedWidth,
401
+ getHttpMethod : getHttpMethod,
402
+ getJsMap : getJsMap,
403
+ getNvpMap : getNvpMap,
404
+ getPlayerLocationName : getPlayerLocationName,
405
+ getPlayerLocationProducesHtml : getPlayerLocationProducesHtml,
406
+ getPlayerLocationJsUrl : getPlayerLocationJsUrl,
407
+ getSequence : getSequence,
408
+ getThumbAreaSelector : getThumbAreaSelector
409
+ };
410
+ }()),
411
 
412
+ asyncGalleryRegistrar = (function () {
413
 
414
+ var register = function (galleryId, params) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
415
 
416
+ publish(text_event_galleryLoad, [ galleryId, params ]);
417
+ };
418
 
419
+ return {
420
 
421
+ register : register
422
+ };
423
+ }());
424
 
425
+ /**
426
+ * Handles fluid thumbs.
427
+ *
428
+ * http://www.sohtanaka.com/web-design/smart-columns-w-css-jquery/
429
+ */
430
+ (function () {
431
 
432
+ var floor = Math.floor,
 
 
433
 
434
+ getThumbAreaSelector = function (galleryId) {
 
 
 
 
 
435
 
436
+ return galleryRegistry.getThumbAreaSelector(galleryId);
437
+ },
438
 
439
+ /**
440
+ * Get the jQuery reference to where the thumbnails live.
441
+ */
442
+ getThumbArea = function (galleryId) {
443
 
444
+ return jquery(getThumbAreaSelector(galleryId));
445
+ },
446
 
447
+ /**
448
+ * Get the thumbnail width. Usually this is just a static thumbnail
449
+ * image, but *may* be an actual embed or something like that.
450
+ *
451
+ * Fallback value is 120.
452
+ */
453
+ getThumbWidth = function (galleryId) {
454
 
455
+ var thumbArea = getThumbArea(galleryId),
456
+ firstVisualElement = thumbArea.find('img:first'),
457
+ width = 120;
458
 
459
+ if (firstVisualElement.length === 0) {
 
 
 
 
 
 
460
 
461
+ firstVisualElement = thumbArea.find('div.' + text_tubepress + '_thumb:first > div.' + text_tubepress + '_embed');
 
 
462
 
463
  if (firstVisualElement.length === 0) {
464
 
465
+ return width;
466
+ }
467
+ }
468
 
469
+ width = firstVisualElement.attr('width');
470
 
471
+ if (width) {
 
 
472
 
473
+ return width;
474
+ }
475
 
476
+ return firstVisualElement.width();
477
+ },
478
 
479
+ makeThumbsFluid = function (galleryId) {
 
480
 
481
+ getThumbArea(galleryId).css({ 'width' : '100%' });
 
482
 
483
+ var gallerySelector = getThumbAreaSelector(galleryId),
484
+ columnWidth = getThumbWidth(galleryId),
485
+ gallery = jquery(gallerySelector),
486
+ galleryWidth = gallery.width(),
487
+ colNum = floor(galleryWidth / columnWidth),
488
+ newThumbWidth = floor(galleryWidth / colNum),
489
+ thumbs = jquery(gallerySelector + ' div.' + text_tubepress + '_thumb');
490
 
491
+ gallery.css({ 'width' : '100%'});
492
+ gallery.css({ 'width' : galleryWidth });
493
+ thumbs.css({ 'width' : newThumbWidth});
494
 
495
+ gallery.data('fluid_thumbs_applied', true);
496
+ beacon.publish(text_eventPrefix_gallery + 'fluidThumbs', [ galleryId, newThumbWidth ]);
497
+ },
 
 
 
 
498
 
499
+ /**
500
+ * Callback for thumbnail loads.
501
+ */
502
+ onNewGalleryOrThumbs = function (e, galleryId) {
503
 
504
+ /* fluid thumbs if we need it */
505
+ if (galleryRegistry.isFluidThumbs(galleryId)) {
 
 
506
 
507
+ makeThumbsFluid(galleryId);
508
+ }
509
+ },
510
 
511
+ /**
512
+ * On window resize.
513
+ */
514
+ onWindowResize = function (e) {
515
 
516
+ var ids = galleryRegistry.findAllGalleryIds(),
517
+ index = 0,
518
+ length = ids.length;
 
519
 
520
+ for (index; index < length; index += 1) {
 
 
521
 
522
+ onNewGalleryOrThumbs(e, ids[index]);
523
+ }
524
+ };
525
 
526
+ subscribe(text_event_galleryNewThumbs + ' ' + text_event_galleryLoad, onNewGalleryOrThumbs);
527
+ subscribe(text_tubepress + '.window.resize', onWindowResize);
528
+ }());
529
 
530
+ /**
531
+ * Handles thumbnail clicks.
532
+ */
533
+ (function () {
534
 
535
  /**
536
+ * Parse the gallery ID from the "rel" attribute.
537
  */
538
+ var getGalleryIdFromRelSplit = function (relSplit) {
539
+
540
+ return relSplit[3];
541
+ },
542
 
543
  /**
544
+ * Parse the video ID from the "rel" attribute.
545
  */
546
+ getVideoIdFromIdAttr = function (id) {
547
 
548
+ var end = id.lastIndexOf('_');
 
549
 
550
+ return id.substring(16, end);
551
+ },
 
 
 
 
552
 
553
+ /**
554
+ * Click listener callback.
555
+ */
556
+ clickListener = function () {
557
 
558
+ var rel_split = jquery(this).attr('rel').split('_'),
559
+ galleryId = getGalleryIdFromRelSplit(rel_split),
560
+ videoId = getVideoIdFromIdAttr(jquery(this).attr('id'));
 
561
 
562
+ publish(text_event_galleryChangeVideo, [ galleryId, videoId ]);
563
+ },
 
564
 
565
+ /**
566
+ * Callback for thumbnail loads.
567
+ */
568
+ onNewGalleryOrThumbs = function (e, galleryId) {
569
 
570
+ /* add a click handler to each link in this gallery */
571
+ jquery('#' + text_tubepress + '_gallery_' + galleryId + " a[id^='" + text_tubepress + "_']").click(clickListener);
572
+ };
 
573
 
574
+ subscribe(text_event_galleryNewThumbs + ' ' + text_event_galleryLoad, onNewGalleryOrThumbs);
 
 
575
 
576
+ }());
577
 
578
+ /**
579
+ * Handles player-related functionality (popup, Shadowbox, etc)
580
+ */
581
+ (function () {
582
 
583
  /**
584
+ * Find the player required for a gallery and load the JS.
585
  */
586
+ var onNewGalleryLoaded = function (e, galleryId) {
587
 
588
+ var path = galleryRegistry.getPlayerLocationJsUrl(galleryId);
 
 
 
 
 
 
 
 
 
 
 
589
 
590
+ /*
591
+ * Load this player's JS, if needed.
592
  */
593
+ domInjector.loadJs(path);
594
+ },
595
 
596
+ /**
597
+ * Load up a TubePress player with the given video ID.
598
+ */
599
+ onNewVideoRequested = function (e, galleryId, videoId) {
600
 
601
+ var playerName = galleryRegistry.getPlayerLocationName(galleryId),
602
+ height = galleryRegistry.getEmbeddedHeight(galleryId),
603
+ width = galleryRegistry.getEmbeddedWidth(galleryId),
604
+ nvpMap = galleryRegistry.getNvpMap(galleryId),
605
 
606
+ callback = function (data) {
 
 
607
 
608
+ var result = tubepress.Lang.JsonParser.parse(data.responseText),
609
+ title = result.title,
610
+ html = result.html;
611
 
612
+ publish(text_event_playerLocationPopulate, [ playerName, title, html, height, width, videoId, galleryId ]);
613
+ },
614
 
615
+ dataToSend = {
 
 
616
 
617
+ 'action' : 'playerHtml',
618
+ 'tubepress_video' : videoId
619
+ },
620
 
621
+ method;
 
 
 
622
 
623
+ /**
624
+ * Add the NVPs for TubePress to the data.
625
+ */
626
+ jquery.extend(dataToSend, nvpMap);
627
 
628
+ /** Announce we're gonna invoke the player... */
629
+ publish(text_event_playerLocationInvoke, [ playerName, height, width, videoId, galleryId ]);
630
 
631
+ /** If this player requires population, go fetch the HTML for it. */
632
+ if (galleryRegistry.getPlayerLocationProducesHtml(galleryId)) {
633
 
634
+ method = galleryRegistry.getHttpMethod(galleryId);
 
 
 
635
 
636
+ /* ... and fetch the HTML for it */
637
+ tubepress.Ajax.Executor.get(method, environment.getAjaxEndpointUrl(), dataToSend, callback, 'json');
638
+ }
639
+ };
640
 
641
+ /** When we see a new gallery... */
642
+ subscribe(text_event_galleryLoad, onNewGalleryLoaded);
 
643
 
644
+ /** When a user clicks a thumbnail... */
645
+ subscribe(text_event_galleryChangeVideo, onNewVideoRequested);
646
+ }());
 
647
 
648
+ /**
649
+ * Handles pagination clicks.
650
+ */
651
+ (function () {
652
 
653
+ var handlePaginationClick = function (anchor, galleryId) {
654
 
655
+ var page = anchor.data('page');
 
656
 
657
+ publish(text_event_galleryPageChange, [ galleryId, page ]);
658
+ },
659
 
660
+ onNewGalleryOrThumbs = function (event, galleryId) {
661
 
662
+ var pagationClickCallback = function () {
663
 
664
+ handlePaginationClick(jquery(this), galleryId);
665
 
666
+ if (galleryRegistry.isAjaxPagination(galleryId)) {
 
 
 
667
 
668
+ //prevent default click action
669
+ event.preventDefault();
670
+ return fawlse;
671
+ }
672
 
673
+ return troo;
674
  };
675
 
676
+ jquery('#' + text_tubepress + '_gallery_' + galleryId + ' div.pagination a').click(pagationClickCallback);
677
+ };
678
 
679
+ subscribe(text_event_galleryNewThumbs + ' ' + text_event_galleryLoad, onNewGalleryOrThumbs);
680
+
681
+ }());
682
+
683
+ /**
684
+ * Handles "next" and "previous" video requests.
685
+ */
686
+ (function () {
687
 
688
  /**
689
+ * Go to the next video in the gallery.
690
  */
691
+ var onNextVideoRequested = function (event, galleryId) {
692
 
693
+ /** Get the gallery's sequence. This is an array of video ids. */
694
+ var sequence = galleryRegistry.getSequence(galleryId),
695
+ vidId = galleryRegistry.getCurrentVideoId(galleryId),
696
+ index = jquery.inArray(vidId.toString(), sequence),
697
+ lastIndex = sequence ? sequence.length - 1 : index;
698
 
699
+ /** Sorry, we don't know anything about this video id, or we've reached the end of the gallery. */
700
+ if (index === -1 || index === lastIndex) {
 
 
 
701
 
702
+ return;
703
+ }
704
 
705
+ /** Start the next video in line. */
706
+ publish(text_event_galleryChangeVideo, [ galleryId, sequence[index + 1] ]);
707
+ },
708
 
709
+ /** Play the previous video in the gallery. */
710
+ onPrevVideoRequested = function (event, galleryId) {
 
711
 
712
+ /** Get the gallery's sequence. This is an array of video ids. */
713
+ var sequence = galleryRegistry.getSequence(galleryId),
714
+ vidId = galleryRegistry.getCurrentVideoId(galleryId),
715
+ index = jquery.inArray(vidId.toString(), sequence);
716
 
717
+ /** Sorry, we don't know anything about this video id, or we're at the start of the gallery. */
718
+ if (index === -1 || index === 0) {
 
 
719
 
720
+ return;
721
+ }
722
 
723
+ /** Start the previous video in line. */
724
+ publish(text_event_galleryChangeVideo, [ galleryId, sequence[index - 1] ]);
725
+ };
726
 
727
+ subscribe(text_event_galleryNextVideo, onNextVideoRequested);
 
 
728
 
729
+ subscribe(text_event_galleryPreviousVideo, onPrevVideoRequested);
730
 
731
+ }());
732
 
733
+ /**
734
+ * Handles auto-next.
735
+ */
736
+ (function () {
737
 
738
  /**
739
+ * A video on the page has stopped.
740
  */
741
+ var onVideoStop = function (e, video) {
 
 
 
 
 
 
 
 
 
742
 
743
+ var galleryId = galleryRegistry.findGalleryContainingVideoDomId(video.domId);
744
 
745
+ if (!galleryId) {
 
746
 
747
+ return;
748
+ }
749
 
750
+ if (galleryRegistry.isAutoNext(galleryId) && galleryRegistry.getSequence(galleryId)) {
751
 
752
+ /** Go to the next one! */
753
+ beacon.publish(text_event_galleryNextVideo, [ galleryId ]);
754
+ }
755
+ };
756
 
757
+ /** We would like to be notified when a video ends, in the case of auto-next. */
758
+ beacon.subscribe(text_event_videoStop, onVideoStop);
 
 
759
 
760
+ }());
 
761
 
762
+ tubepress.AsyncUtil.processQueueCalls('tubePressGalleryRegistrar', asyncGalleryRegistrar);
763
 
764
+ /**
765
+ * Make this available via the primary TubePress object.
766
+ */
767
+ tubepress.Gallery = {
768
 
769
+ Registry : galleryRegistry
770
+ };
771
 
772
+ /**
773
+ * Signal that gallery.js has been loaded completely.
774
+ */
775
+ tubepress.Beacon.publish(text_tubepress + '.js.sys.gallery');
776
 
777
+ }(jQuery, window, TubePress));
src/main/web/js/gallery.js CHANGED
@@ -1 +1,8 @@
1
- var tubePressGalleryRegistrar,TubePressGallery=(function(h,g,p){var w="tubepress",l=w+".gallery.",e=w+".video.",d=w+".playerlocation.",j=d+"populate",c=d+"invoke",u=l+"load",x=l+"newthumbs",E=l+"pagechange",f=l+"changevideo",q=l+"nextvideo",k=l+"previousvideo",b=e+"start",r=e+"stop",v="urls",i="sys",n="js",F=p.Beacon,o=F.subscribe,A=F.publish,a=p.Lang.Utils,D=p.Environment,t=p.DomInjector,z="src/main/web/js",B=true,C=false,m=g.TubePressJsConfig,s=(function(){var W={},T="nvpMap",V="jsMap",L="page",G="currentVideoId",ab="playingNow",ac=a.parseIntOrZero,S="playerLocation",af="embedded",aa=F.subscribe,Z=function(ap){return a.isDefined(W[ap])},ae=function(ap,ar,aq){return Z(ap)?W[ap][ar][aq]:null},ad=function(ap){return Z(ap)?W[ap][L]:undefined},Q=function(ap){return Z(ap)?W[ap][G]:undefined},K=function(ap){return ae(ap,V,"ajaxPagination")},U=function(ap){return ae(ap,V,"autoNext")},J=function(ap){return Z(ap)?W[ap][ab]:C},H=function(ap){return ae(ap,V,"fluidThumbs")},ao=function(ap){return ae(ap,T,af+"Height")},an=function(ap){return ae(ap,T,af+"Width")},ak=function(ap){return ae(ap,V,"httpMethod")},M=function(ap){return W[ap][T]},ag=function(ap){return ae(ap,T,S)},P=function(ap){return ae(ap,V,S+"JsUrl")},N=function(ap){return ae(ap,V,S+"ProducesHtml")},Y=function(ap){return ae(ap,V,"sequence")},al=function(ap){return"#"+w+"_gallery_"+ap+"_thumbnail_area"},ai=function(au,at,av){var ar=a.getParameterByName(w+"_page"),ap=ac(ar),aq="ajaxPagination",aw;W[at]=av;W[at][L]=ap===0?1:ap;W[at][ab]=C;aw=Y(at);if(aw){W[at][G]=aw[0]}if(K(at)){if(a.hasOwnNestedProperty(m,v,n,i,aq)){t.loadJs(m[v][n][i][aq])}else{t.loadJs(z+"/"+aq+".js")}}},X=function(at,ar,aq){if(Z(ar)){var ap=ac(aq);W[ar][L]=ap===0?1:ap}},ah=function(aq){var ap;for(ap in W){if(W.hasOwnProperty(ap)){if(aq(ap)){return ap}}}return undefined},I=function(aq){var ap='[id^="'+aq+'"]',ar=function(au){var at=h("#"+w+"_gallery_"+au);if(!at.length){return false}return at.find(ap).length>0};return ah(ar)},am=function(ar,aq,ap){var at=I(ap);if(!at){return}W[at][J]=C},aj=function(ar,aq,ap){var at=I(ap);if(!at){return}W[at][J]=B;W[at][G]=aq},O=function(aq,ap,ar){if(Z(ap)){W[ap][G]=ar}},R=function(){var ap=[],aq;for(aq in W){ap.push(aq)}return ap};aa(u,ai);aa(E,X);aa(f,O);aa(r,am);aa(b,aj);return{isAjaxPagination:K,isAutoNext:U,isCurrentlyPlayingVideo:J,isFluidThumbs:H,isRegistered:Z,findAllGalleryIds:R,findGalleryContainingVideoDomId:I,getCurrentPageNumber:ad,getCurrentVideoId:Q,getEmbeddedHeight:ao,getEmbeddedWidth:an,getHttpMethod:ak,getNvpMap:M,getPlayerLocationName:ag,getPlayerLocationProducesHtml:N,getPlayerLocationJsUrl:P,getSequence:Y,getThumbAreaSelector:al}}()),y=(function(){var G=function(H,I){A(u,[H,I])};return{register:G}}());(function(){var J=Math.floor,I=function(N){return s.getThumbAreaSelector(N)},H=function(N){return h(I(N))},G=function(Q){var O=H(Q),N=O.find("img:first"),P=120;if(N.length===0){N=O.find("div."+w+"_thumb:first > div."+w+"_embed");if(N.length===0){return P}}P=N.attr("width");if(P){return P}return N.width()},K=function(S){H(S).css({width:"100%"});var Q=I(S),U=G(S),O=h(Q),T=O.width(),P=J(T/U),R=J(T/P),N=h(Q+" div."+w+"_thumb");O.css({width:"100%"});O.css({width:T});N.css({width:R})},M=function(O,N){if(s.isFluidThumbs(N)){K(N)}},L=function(Q){var O=s.findAllGalleryIds(),N=0,P=O.length;for(N;N<P;N+=1){M(Q,O[N])}};o(x+" "+u,M);o(w+".window.resize",L)}());(function(){var I=function(K){return K[3]},G=function(L){var K=L.lastIndexOf("_");return L.substring(16,K)},H=function(){var K=h(this).attr("rel").split("_"),L=I(K),M=G(h(this).attr("id"));A(f,[L,M])},J=function(L,K){h("#"+w+"_gallery_"+K+" a[id^='"+w+"_']").click(H)};o(x+" "+u,J)}());(function(){var G=function(K,I){var J=s.getPlayerLocationJsUrl(I);t.loadJs(J)},H=function(N,R,O){var K=s.getPlayerLocationName(R),Q=s.getEmbeddedHeight(R),J=s.getEmbeddedWidth(R),L=s.getNvpMap(R),P=function(U){var S=p.Lang.JsonParser.parse(U.responseText),V=S.title,T=S.html;A(j,[K,V,T,Q,J,O,R])},M={action:"playerHtml",tubepress_video:O},I;h.extend(M,L);A(c,[K,Q,J,O,R]);if(s.getPlayerLocationProducesHtml(R)){I=s.getHttpMethod(R);p.Ajax.Executor.get(I,D.getAjaxEndpointUrl(),M,P,"json")}};o(u,G);o(f,H)}());(function(){var G=function(I,J){var K=I.data("page");A(E,[J,K])},H=function(J,I){var K=function(){G(h(this),I);if(s.isAjaxPagination(I)){J.preventDefault();return C}return B};h("#"+w+"_gallery_"+I+" div.pagination a").click(K)};o(x+" "+u,H)}());(function(){var G=function(L,K){var N=s.getSequence(K),J=s.getCurrentVideoId(K),I=h.inArray(J.toString(),N),M=N?N.length-1:I;if(I===-1||I===M){return}A(f,[K,N[I+1]])},H=function(L,K){var M=s.getSequence(K),J=s.getCurrentVideoId(K),I=h.inArray(J.toString(),M);if(I===-1||I===0){return}A(f,[K,M[I-1]])};o(q,G);o(k,H)}());(function(){var H=p.Logger,G=function(N,M,L,J,K){var I=s.findGalleryContainingVideoDomId(L);if(!I){return}if(s.isAutoNext(I)&&s.getSequence(I)){if(H.on()){H.log("Auto-starting next for gallery "+I)}F.publish(q,[I])}};F.subscribe(r,G)}());p.AsyncUtil.processQueueCalls("tubePressGalleryRegistrar",y);return{Registry:s}}(jQuery,window,TubePress));
 
 
 
 
 
 
 
1
+ /*!
2
+ * Copyright 2006 - 2013 TubePress LLC (http://tubepress.com).
3
+ * This file is part of TubePress (http://tubepress.com).
4
+ * This Source Code Form is subject to the terms of the Mozilla Public
5
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
+ */
8
+ var tubePressGalleryRegistrar;(function(h,g,p){var w="tubepress",l=w+".gallery.",e=w+".video.",d=w+".playerlocation.",j=d+"populate",c=d+"invoke",u=l+"load",x=l+"newthumbs",E=l+"pagechange",f=l+"changevideo",q=l+"nextvideo",k=l+"previousvideo",b=e+"start",r=e+"stop",v="urls",i="sys",n="js",F=p.Beacon,o=F.subscribe,A=F.publish,a=p.Lang.Utils,D=p.Environment,t=p.DomInjector,z="src/main/web/js",B=true,C=false,m=g.TubePressJsConfig,s=(function(){var af={},al="nvpMap",S="jsMap",ae="page",aa="currentVideoId",ai="playingNow",aj=a.parseIntOrZero,M="playerLocation",N="embedded",O=F.subscribe,H=function(aq){return a.isDefined(af[aq])},ac=function(aq,at,ar){return H(aq)?af[aq][at][ar]:null},K=function(aq){return H(aq)?af[aq][ae]:undefined},ao=function(aq){return H(aq)?af[aq][aa]:undefined},J=function(aq){return ac(aq,S,"ajaxPagination")},ah=function(aq){return ac(aq,S,"autoNext")},L=function(aq){return H(aq)?af[aq][ai]:C},ap=function(aq){return ac(aq,S,"fluidThumbs")},an=function(aq){return ac(aq,al,N+"Height")},R=function(aq){return ac(aq,al,N+"Width")},Y=function(aq){return ac(aq,S,"httpMethod")},W=function(aq){return af[aq][S]},P=function(aq){return af[aq][al]},V=function(aq){return ac(aq,al,M)},Z=function(aq){return ac(aq,S,M+"JsUrl")},am=function(aq){return ac(aq,S,M+"ProducesHtml")},ak=function(aq){return ac(aq,S,"sequence")},Q=function(aq){return"#"+w+"_gallery_"+aq+"_thumbnail_area"},T=function(av,au,aw){var at=a.getParameterByName(w+"_page"),aq=aj(at),ar="ajaxPagination",ax;af[au]=aw;af[au][ae]=aq===0?1:aq;af[au][ai]=C;ax=ak(au);if(ax){af[au][aa]=ax[0]}if(J(au)){if(a.hasOwnNestedProperty(m,v,n,i,ar)){t.loadJs(m[v][n][i][ar])}else{t.loadJs(z+"/"+ar+".js")}}},ag=function(au,at,ar){if(H(at)){var aq=aj(ar);af[at][ae]=aq===0?1:aq}},ab=function(ar){var aq;for(aq in af){if(af.hasOwnProperty(aq)){if(ar(aq)){return aq}}}return undefined},U=function(ar){var aq='[id^="'+ar+'"]',at=function(av){var au=h("#"+w+"_gallery_"+av);if(!au.length){return false}return au.find(aq).length>0};return ab(at)},X=function(at,ar,aq){var au=U(aq);if(!au){return}af[au][L]=C},G=function(at,ar,aq){var au=U(aq);if(!au){return}af[au][L]=B;af[au][aa]=ar},I=function(ar,aq,at){if(H(aq)){af[aq][aa]=at}},ad=function(){var aq=[],ar;for(ar in af){aq.push(ar)}return aq};O(u,T);O(E,ag);O(f,I);O(r,X);O(b,G);return{isAjaxPagination:J,isAutoNext:ah,isCurrentlyPlayingVideo:L,isFluidThumbs:ap,isRegistered:H,findAllGalleryIds:ad,findGalleryContainingVideoDomId:U,getCurrentPageNumber:K,getCurrentVideoId:ao,getEmbeddedHeight:an,getEmbeddedWidth:R,getHttpMethod:Y,getJsMap:W,getNvpMap:P,getPlayerLocationName:V,getPlayerLocationProducesHtml:am,getPlayerLocationJsUrl:Z,getSequence:ak,getThumbAreaSelector:Q}}()),y=(function(){var G=function(H,I){A(u,[H,I])};return{register:G}}());(function(){var J=Math.floor,I=function(N){return s.getThumbAreaSelector(N)},H=function(N){return h(I(N))},G=function(Q){var O=H(Q),N=O.find("img:first"),P=120;if(N.length===0){N=O.find("div."+w+"_thumb:first > div."+w+"_embed");if(N.length===0){return P}}P=N.attr("width");if(P){return P}return N.width()},K=function(T){H(T).css({width:"100%"});var S=I(T),U=G(T),P=h(S),R=P.width(),Q=J(R/U),O=J(R/Q),N=h(S+" div."+w+"_thumb");P.css({width:"100%"});P.css({width:R});N.css({width:O});P.data("fluid_thumbs_applied",true);F.publish(l+"fluidThumbs",[T,O])},M=function(O,N){if(s.isFluidThumbs(N)){K(N)}},L=function(Q){var O=s.findAllGalleryIds(),N=0,P=O.length;for(N;N<P;N+=1){M(Q,O[N])}};o(x+" "+u,M);o(w+".window.resize",L)}());(function(){var I=function(K){return K[3]},G=function(L){var K=L.lastIndexOf("_");return L.substring(16,K)},H=function(){var K=h(this).attr("rel").split("_"),L=I(K),M=G(h(this).attr("id"));A(f,[L,M])},J=function(L,K){h("#"+w+"_gallery_"+K+" a[id^='"+w+"_']").click(H)};o(x+" "+u,J)}());(function(){var G=function(K,I){var J=s.getPlayerLocationJsUrl(I);t.loadJs(J)},H=function(N,R,O){var K=s.getPlayerLocationName(R),Q=s.getEmbeddedHeight(R),J=s.getEmbeddedWidth(R),L=s.getNvpMap(R),P=function(U){var S=p.Lang.JsonParser.parse(U.responseText),V=S.title,T=S.html;A(j,[K,V,T,Q,J,O,R])},M={action:"playerHtml",tubepress_video:O},I;h.extend(M,L);A(c,[K,Q,J,O,R]);if(s.getPlayerLocationProducesHtml(R)){I=s.getHttpMethod(R);p.Ajax.Executor.get(I,D.getAjaxEndpointUrl(),M,P,"json")}};o(u,G);o(f,H)}());(function(){var G=function(I,J){var K=I.data("page");A(E,[J,K])},H=function(J,I){var K=function(){G(h(this),I);if(s.isAjaxPagination(I)){J.preventDefault();return C}return B};h("#"+w+"_gallery_"+I+" div.pagination a").click(K)};o(x+" "+u,H)}());(function(){var G=function(L,K){var N=s.getSequence(K),J=s.getCurrentVideoId(K),I=h.inArray(J.toString(),N),M=N?N.length-1:I;if(I===-1||I===M){return}A(f,[K,N[I+1]])},H=function(L,K){var M=s.getSequence(K),J=s.getCurrentVideoId(K),I=h.inArray(J.toString(),M);if(I===-1||I===0){return}A(f,[K,M[I-1]])};o(q,G);o(k,H)}());(function(){var G=function(J,I){var H=s.findGalleryContainingVideoDomId(I.domId);if(!H){return}if(s.isAutoNext(H)&&s.getSequence(H)){F.publish(q,[H])}};F.subscribe(r,G)}());p.AsyncUtil.processQueueCalls("tubePressGalleryRegistrar",y);p.Gallery={Registry:s};p.Beacon.publish(w+".js.sys.gallery")}(jQuery,window,TubePress));
src/main/web/js/tubepress-dev.js CHANGED
@@ -1,13 +1,9 @@
1
- /**!
2
- * Copyright 2006 - 2013 TubePress LLC (http://tubepress.com)
3
- *
4
- * This file is part of TubePress (http://tubepress.com)
5
- *
6
  * This Source Code Form is subject to the terms of the Mozilla Public
7
  * License, v. 2.0. If a copy of the MPL was not distributed with this
8
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9
- *
10
- * @author Eric D. Hough (eric@tubepress.com)
11
  */
12
 
13
  /*global jQuery, console */
@@ -173,7 +169,7 @@ var tubePressDomInjector,
173
  */
174
  log = function (msg) {
175
 
176
- windowConsole.log(msg);
177
  },
178
 
179
  dir = function (obj) {
@@ -195,6 +191,7 @@ var tubePressDomInjector,
195
  environment = (function () {
196
 
197
  var alreadyCalculatedBaseUrl = fawlse,
 
198
  cachedBaseUrl,
199
 
200
  getBaseUrl = function () {
@@ -240,12 +237,23 @@ var tubePressDomInjector,
240
  }
241
 
242
  return getBaseUrl() + '/src/main/web/php/' + text_ajaxEndpoint + '.php';
 
 
 
 
 
 
 
 
 
 
243
  };
244
 
245
  return {
246
 
247
  getBaseUrl : getBaseUrl,
248
- getAjaxEndpointUrl : getAjaxEndpointUrl
 
249
  };
250
  }()),
251
 
@@ -281,8 +289,12 @@ var tubePressDomInjector,
281
 
282
  var args = arguments;
283
 
284
- logger.log('Firing "' + args[0]);
285
- logger.dir(args[1]);
 
 
 
 
286
  }
287
 
288
  bus.trigger.apply(bus, arguments);
@@ -308,7 +320,7 @@ var tubePressDomInjector,
308
  return filesAlreadyLoaded[path] === troo;
309
  },
310
 
311
- convertToAbsoluteUrl = function (url) {
312
 
313
  if (url.indexOf('http') === 0) {
314
 
@@ -316,7 +328,18 @@ var tubePressDomInjector,
316
  return url;
317
  }
318
 
319
- return environment.getBaseUrl() + '/' + langUtils.trimSlashes(url, true);
 
 
 
 
 
 
 
 
 
 
 
320
  },
321
 
322
  doLog = function (path, type) {
@@ -332,9 +355,11 @@ var tubePressDomInjector,
332
  dokument.getElementsByTagName('head')[0].appendChild(element);
333
  },
334
 
335
- loadCss = function (path) {
 
 
336
 
337
- path = convertToAbsoluteUrl(path);
338
 
339
  if (alreadyLoaded(path)) {
340
 
@@ -354,9 +379,11 @@ var tubePressDomInjector,
354
  appendToHead(fileref);
355
  },
356
 
357
- loadJs = function (path) {
 
 
358
 
359
- path = convertToAbsoluteUrl(path);
360
 
361
  if (alreadyLoaded(path)) {
362
 
@@ -434,6 +461,11 @@ var tubePressDomInjector,
434
  delegate[method].apply(this, args);
435
  };
436
 
 
 
 
 
 
437
  if (langUtils.isDefined(queue)) {
438
 
439
  queueLength = queue.length;
1
+ /*!
2
+ * Copyright 2006 - 2013 TubePress LLC (http://tubepress.com).
3
+ * This file is part of TubePress (http://tubepress.com).
 
 
4
  * This Source Code Form is subject to the terms of the Mozilla Public
5
  * License, v. 2.0. If a copy of the MPL was not distributed with this
6
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 
7
  */
8
 
9
  /*global jQuery, console */
169
  */
170
  log = function (msg) {
171
 
172
+ windowConsole.log(text_tubepress + ': ' + msg);
173
  },
174
 
175
  dir = function (obj) {
191
  environment = (function () {
192
 
193
  var alreadyCalculatedBaseUrl = fawlse,
194
+ text_usr = 'usr',
195
  cachedBaseUrl,
196
 
197
  getBaseUrl = function () {
237
  }
238
 
239
  return getBaseUrl() + '/src/main/web/php/' + text_ajaxEndpoint + '.php';
240
+ },
241
+
242
+ getUserContentUrl = function () {
243
+
244
+ if (langUtils.hasOwnNestedProperty(tubePressJsConfig, text_urls, text_usr)) {
245
+
246
+ return tubePressJsConfig[text_urls][text_usr];
247
+ }
248
+
249
+ return getBaseUrl() + '/' + text_tubepress + '-content';
250
  };
251
 
252
  return {
253
 
254
  getBaseUrl : getBaseUrl,
255
+ getAjaxEndpointUrl : getAjaxEndpointUrl,
256
+ getUserContentUrl : getUserContentUrl
257
  };
258
  }()),
259
 
289
 
290
  var args = arguments;
291
 
292
+ logger.log('firing event ' + args[0]);
293
+
294
+ if (args.length > 1) {
295
+
296
+ logger.dir(args[1]);
297
+ }
298
  }
299
 
300
  bus.trigger.apply(bus, arguments);
320
  return filesAlreadyLoaded[path] === troo;
321
  },
322
 
323
+ convertToAbsoluteUrl = function (url, isSystem) {
324
 
325
  if (url.indexOf('http') === 0) {
326
 
328
  return url;
329
  }
330
 
331
+ var prefix;
332
+
333
+ if (isSystem) {
334
+
335
+ prefix = environment.getBaseUrl();
336
+
337
+ } else {
338
+
339
+ prefix = environment.getUserContentUrl();
340
+ }
341
+
342
+ return prefix + '/' + langUtils.trimSlashes(url, true);
343
  },
344
 
345
  doLog = function (path, type) {
355
  dokument.getElementsByTagName('head')[0].appendChild(element);
356
  },
357
 
358
+ loadCss = function (path, isSystem) {
359
+
360
+ isSystem = langUtils.isDefined(isSystem) ? isSystem : true;
361
 
362
+ path = convertToAbsoluteUrl(path, isSystem);
363
 
364
  if (alreadyLoaded(path)) {
365
 
379
  appendToHead(fileref);
380
  },
381
 
382
+ loadJs = function (path, isSystem) {
383
+
384
+ isSystem = langUtils.isDefined(isSystem) ? isSystem : true;
385
 
386
+ path = convertToAbsoluteUrl(path, isSystem);
387
 
388
  if (alreadyLoaded(path)) {
389
 
461
  delegate[method].apply(this, args);
462
  };
463
 
464
+ if (!(queue instanceof Array)) {
465
+
466
+ return;
467
+ }
468
+
469
  if (langUtils.isDefined(queue)) {
470
 
471
  queueLength = queue.length;
src/main/web/js/tubepress.js CHANGED
@@ -1 +1,8 @@
1
- var tubePressDomInjector,tubePressBeacon,TubePress=(function(e,d){var n="tubepress",l="urls",c="base",f="sys",h="js",o=d.location,m=d.document,q=true,p="src/main/web/js",s=e.isFunction,g=d.TubePressJsConfig,i=null,r=false,a=(function(){var z=function(E){return typeof E!=="undefined"},B=function(F){F=F.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var E="[\\?&]"+F+"=([^&#]*)",H=new RegExp(E),G=H.exec(o.search);return G===i?"":decodeURIComponent(G[1].replace(/\+/g," "))},A=function(E){var F=parseInt(E,10);return isNaN(F)?0:F},y=function(H,G,E){if(G()===q){H();return}var F=function(){y(H,G,E)};setTimeout(F,E)},D=function(H){if(!H){return r}var E=Array.prototype.slice.call(arguments),G=E.shift(),F;for(F=0;F<E.length;F+=1){if(!G.hasOwnProperty(E[F])){return r}G=G[E[F]]}return true},C=function(E,F){if(F){return E.replace(/^\/+/,"")}return E.replace(/\/+$/,"")};return{isDefined:z,getParameterByName:B,parseIntOrZero:A,callWhenTrue:y,hasOwnNestedProperty:D,trimSlashes:C}}()),x=(function(){var A=o.search.indexOf(n+"_debug=true")!==-1,D=d.console,y=a.isDefined(D),z=function(){return A&&y},C=function(E){D.log(E)},B=function(E){D.dir(E)};return{on:z,log:C,dir:B}}()),u=(function(){var z=r,y,B=function(){if(!z){if(a.hasOwnNestedProperty(g,l,c)){y=a.trimSlashes(g[l][c],r)}else{var D=m.getElementsByTagName("script"),C=0,E;for(C;C<D.length;C+=1){E=D[C].src;if(E.indexOf("/"+n+".js")!==-1){y=a.trimSlashes(E.substr(0,E.lastIndexOf("/")).split("?")[0].replace(p,""),r);break}}}}return y},A=function(){var C="ajaxEndpoint",D="php";if(a.hasOwnNestedProperty(g,l,D,f,C)){return g[l][D][f][C]}return B()+"/src/main/web/php/"+C+".php"};return{getBaseUrl:B,getAjaxEndpointUrl:A}}()),w=(function(){var z=e({}),y=function(){z.bind.apply(z,arguments)},B=function(){z.unbind.apply(z,arguments)},A=function(){if(x.on()){var C=arguments;x.log('Firing "'+C[0]);x.dir(C[1])}z.trigger.apply(z,arguments)};return{subscribe:y,unsubscribe:B,publish:A}}()),j=(function(){var D=[],B=function(J){return D[J]===q},y=function(J){if(J.indexOf("http")===0){return J}return u.getBaseUrl()+"/"+a.trimSlashes(J,true)},H=function(K,J){if(x.on()){x.log("Injecting "+J+": "+K)}},I=function(J){m.getElementsByTagName("head")[0].appendChild(J)},G=function(K){K=y(K);if(B(K)){return}D[K]=q;var J=m.createElement("link");J.rel="stylesheet";J.type="text/css";J.href=K;H(K,"CSS");I(J)},z=function(K){K=y(K);if(B(K)){return}D[K]=q;H(K,"JS");var J=m.createElement("script");J.type="text/javascript";J.src=K;J.async=q;m.getElementsByTagName("head")[0].appendChild(J)},A=function(J){if(a.hasOwnNestedProperty(g,l,h,f,J)){z(g[l][h][f][J])}else{z(p+"/"+J+".js")}},F=function(){A("gallery")},E=function(){A("playerApi")},C=function(){A("ajaxSearch")};return{loadJs:z,loadCss:G,loadGalleryJs:F,loadPlayerApiJs:E,loadAjaxSearchJs:C}}()),t=(function(){var y=function(B,C){var A=x.on(),E,z=d[B],D=function(F){var H=F[0],G=F.slice(1);C[H].apply(this,G)};if(a.isDefined(z)){E=z.length;if(A){x.log("Running "+E+" queue items for "+B)}z.reverse();while(z.length){D(z.pop())}}if(A){x.log(B+" is now connected")}d[B]={push:D}};return{processQueueCalls:y}}()),k=(function(){var y=e.fn.jquery,B=/1\.6|7|8|9\.[0-9]+/.test(y)!==r,A,z=function(C){return A(C)};if(B){A=function(C){return e.parseJSON(C)}}else{A=function(C){if(typeof C!=="string"||!C){return i}C=e.trim(C);if(/^[\],:{}\s]*$/.test(C.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return(d.JSON&&d.JSON.parse)?d.JSON.parse(C):(new Function("return "+C))()}else{throw"Invalid JSON: "+C}}}return{parse:z}}()),v=(function(){var z=function(A){e(A).fadeTo(0,0.3)},y=function(A){e(A).fadeTo(0,1)};return{applyLoadingStyle:z,removeLoadingStyle:y}}()),b=(function(){var A=function(J,D,G,C,F,I){var E=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,H=function(L){var M=L.responseText,K=C?e("<div>").append(M.replace(E,"")).find(C):M;e(G).html(K);if(s(I)){I()}};if(s(F)){F()}e.ajax({url:D,type:J,dataType:"html",complete:H})},z=function(G,D,E,F,C){e.ajax({url:D,type:G,data:E,dataType:C,complete:F})},B=function(C){v.removeLoadingStyle(C)},y=function(I,D,G,C,F,H){var E=function(){B(G)};v.applyLoadingStyle(G);if(s(H)){E=function(){B(G);H()}}A(I,D,G,C,F,E)};return{loadAndStyle:y,get:z}}());(function(){var z,A=function(){w.publish(n+".window.resize")},y=function(){clearTimeout(z);z=setTimeout(A,150)},B=function(){e(d).resize(y)};e(B)}());(function(){var y="tubePress";t.processQueueCalls(y+"DomInjector",j);t.processQueueCalls(y+"Beacon",w)}());return{Ajax:{Executor:b,LoadStyler:v},AsyncUtil:t,Beacon:w,DomInjector:j,Environment:u,Lang:{Utils:a,JsonParser:k},Logger:x}}(jQuery,window));
 
 
 
 
 
 
 
1
+ /*!
2
+ * Copyright 2006 - 2013 TubePress LLC (http://tubepress.com).
3
+ * This file is part of TubePress (http://tubepress.com).
4
+ * This Source Code Form is subject to the terms of the Mozilla Public
5
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
6
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7
+ */
8
+ var tubePressDomInjector,tubePressBeacon,TubePress=(function(e,d){var n="tubepress",l="urls",c="base",f="sys",h="js",o=d.location,m=d.document,q=true,p="src/main/web/js",s=e.isFunction,g=d.TubePressJsConfig,i=null,r=false,a=(function(){var z=function(E){return typeof E!=="undefined"},B=function(F){F=F.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var E="[\\?&]"+F+"=([^&#]*)",H=new RegExp(E),G=H.exec(o.search);return G===i?"":decodeURIComponent(G[1].replace(/\+/g," "))},A=function(E){var F=parseInt(E,10);return isNaN(F)?0:F},y=function(H,G,E){if(G()===q){H();return}var F=function(){y(H,G,E)};setTimeout(F,E)},D=function(H){if(!H){return r}var E=Array.prototype.slice.call(arguments),G=E.shift(),F;for(F=0;F<E.length;F+=1){if(!G.hasOwnProperty(E[F])){return r}G=G[E[F]]}return true},C=function(E,F){if(F){return E.replace(/^\/+/,"")}return E.replace(/\/+$/,"")};return{isDefined:z,getParameterByName:B,parseIntOrZero:A,callWhenTrue:y,hasOwnNestedProperty:D,trimSlashes:C}}()),x=(function(){var A=o.search.indexOf(n+"_debug=true")!==-1,D=d.console,y=a.isDefined(D),z=function(){return A&&y},C=function(E){D.log(n+": "+E)},B=function(E){D.dir(E)};return{on:z,log:C,dir:B}}()),u=(function(){var z=r,B="usr",y,D=function(){if(!z){if(a.hasOwnNestedProperty(g,l,c)){y=a.trimSlashes(g[l][c],r)}else{var F=m.getElementsByTagName("script"),E=0,G;for(E;E<F.length;E+=1){G=F[E].src;if(G.indexOf("/"+n+".js")!==-1){y=a.trimSlashes(G.substr(0,G.lastIndexOf("/")).split("?")[0].replace(p,""),r);break}}}}return y},A=function(){var E="ajaxEndpoint",F="php";if(a.hasOwnNestedProperty(g,l,F,f,E)){return g[l][F][f][E]}return D()+"/src/main/web/php/"+E+".php"},C=function(){if(a.hasOwnNestedProperty(g,l,B)){return g[l][B]}return D()+"/"+n+"-content"};return{getBaseUrl:D,getAjaxEndpointUrl:A,getUserContentUrl:C}}()),w=(function(){var z=e({}),y=function(){z.bind.apply(z,arguments)},B=function(){z.unbind.apply(z,arguments)},A=function(){if(x.on()){var C=arguments;x.log("firing event "+C[0]);if(C.length>1){x.dir(C[1])}}z.trigger.apply(z,arguments)};return{subscribe:y,unsubscribe:B,publish:A}}()),j=(function(){var D=[],B=function(J){return D[J]===q},y=function(K,J){if(K.indexOf("http")===0){return K}var L;if(J){L=u.getBaseUrl()}else{L=u.getUserContentUrl()}return L+"/"+a.trimSlashes(K,true)},H=function(K,J){if(x.on()){x.log("Injecting "+J+": "+K)}},I=function(J){m.getElementsByTagName("head")[0].appendChild(J)},G=function(L,J){J=a.isDefined(J)?J:true;L=y(L,J);if(B(L)){return}D[L]=q;var K=m.createElement("link");K.rel="stylesheet";K.type="text/css";K.href=L;H(L,"CSS");I(K)},z=function(L,K){K=a.isDefined(K)?K:true;L=y(L,K);if(B(L)){return}D[L]=q;H(L,"JS");var J=m.createElement("script");J.type="text/javascript";J.src=L;J.async=q;m.getElementsByTagName("head")[0].appendChild(J)},A=function(J){if(a.hasOwnNestedProperty(g,l,h,f,J)){z(g[l][h][f][J])}else{z(p+"/"+J+".js")}},F=function(){A("gallery")},E=function(){A("playerApi")},C=function(){A("ajaxSearch")};return{loadJs:z,loadCss:G,loadGalleryJs:F,loadPlayerApiJs:E,loadAjaxSearchJs:C}}()),t=(function(){var y=function(B,C){var A=x.on(),E,z=d[B],D=function(F){var H=F[0],G=F.slice(1);C[H].apply(this,G)};if(!(z instanceof Array)){return}if(a.isDefined(z)){E=z.length;if(A){x.log("Running "+E+" queue items for "+B)}z.reverse();while(z.length){D(z.pop())}}if(A){x.log(B+" is now connected")}d[B]={push:D}};return{processQueueCalls:y}}()),k=(function(){var y=e.fn.jquery,B=/1\.6|7|8|9\.[0-9]+/.test(y)!==r,A,z=function(C){return A(C)};if(B){A=function(C){return e.parseJSON(C)}}else{A=function(C){if(typeof C!=="string"||!C){return i}C=e.trim(C);if(/^[\],:{}\s]*$/.test(C.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){return(d.JSON&&d.JSON.parse)?d.JSON.parse(C):(new Function("return "+C))()}else{throw"Invalid JSON: "+C}}}return{parse:z}}()),v=(function(){var z=function(A){e(A).fadeTo(0,0.3)},y=function(A){e(A).fadeTo(0,1)};return{applyLoadingStyle:z,removeLoadingStyle:y}}()),b=(function(){var A=function(J,D,G,C,F,I){var E=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,H=function(L){var M=L.responseText,K=C?e("<div>").append(M.replace(E,"")).find(C):M;e(G).html(K);if(s(I)){I()}};if(s(F)){F()}e.ajax({url:D,type:J,dataType:"html",complete:H})},z=function(G,D,E,F,C){e.ajax({url:D,type:G,data:E,dataType:C,complete:F})},B=function(C){v.removeLoadingStyle(C)},y=function(I,D,G,C,F,H){var E=function(){B(G)};v.applyLoadingStyle(G);if(s(H)){E=function(){B(G);H()}}A(I,D,G,C,F,E)};return{loadAndStyle:y,get:z}}());(function(){var z,A=function(){w.publish(n+".window.resize")},y=function(){clearTimeout(z);z=setTimeout(A,150)},B=function(){e(d).resize(y)};e(B)}());(function(){var y="tubePress";t.processQueueCalls(y+"DomInjector",j);t.processQueueCalls(y+"Beacon",w)}());return{Ajax:{Executor:b,LoadStyler:v},AsyncUtil:t,Beacon:w,DomInjector:j,Environment:u,Lang:{Utils:a,JsonParser:k},Logger:x}}(jQuery,window));
tubepress.php CHANGED
@@ -3,9 +3,9 @@
3
  Plugin Name: TubePress
4
  Plugin URI: http://tubepress.com
5
  Description: Displays gorgeous YouTube and Vimeo galleries in your posts, pages, and/or sidebar. Upgrade to <a href="http://tubepress.com/pro/">TubePress Pro</a> for more features!
6
- Author: Eric D. Hough
7
- Version: 3.1.2
8
- Author URI: http://ehough.com
9
 
10
  Copyright 2006 - 2013 TubePress LLC (http://tubepress.com)
11
 
3
  Plugin Name: TubePress
4
  Plugin URI: http://tubepress.com
5
  Description: Displays gorgeous YouTube and Vimeo galleries in your posts, pages, and/or sidebar. Upgrade to <a href="http://tubepress.com/pro/">TubePress Pro</a> for more features!
6
+ Author: TubePress LLC
7
+ Version: 3.1.3
8
+ Author URI: http://tubepress.com
9
 
10
  Copyright 2006 - 2013 TubePress LLC (http://tubepress.com)
11
 
vendor/composer/autoload_classmap.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- // autoload_classmap.php generated by Composer
4
 
5
  $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
1
  <?php
2
 
3
+ // autoload_classmap.php @generated by Composer
4
 
5
  $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
vendor/composer/autoload_namespaces.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- // autoload_namespaces.php generated by Composer
4
 
5
  $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
1
  <?php
2
 
3
+ // autoload_namespaces.php @generated by Composer
4
 
5
  $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
vendor/composer/autoload_real.php CHANGED
@@ -1,8 +1,8 @@
1
  <?php
2
 
3
- // autoload_real.php generated by Composer
4
 
5
- class ComposerAutoloaderInitbfb8556ba7665720ebdb81f875e9f024
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitbfb8556ba7665720ebdb81f875e9f024
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitbfb8556ba7665720ebdb81f875e9f024', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitbfb8556ba7665720ebdb81f875e9f024', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
1
  <?php
2
 
3
+ // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitf9c5d3142ee6da076d9771d2ab1dfee5
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitf9c5d3142ee6da076d9771d2ab1dfee5', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitf9c5d3142ee6da076d9771d2ab1dfee5', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
vendor/composer/include_paths.php CHANGED
@@ -1,15 +1,15 @@
1
  <?php
2
 
3
- // include_paths.php generated by Composer
4
 
5
  $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
- $vendorDir . '/phpunit/php-token-stream',
10
  $vendorDir . '/phpunit/php-text-template',
11
  $vendorDir . '/phpunit/phpunit-mock-objects',
12
  $vendorDir . '/phpunit/php-timer',
 
13
  $vendorDir . '/phpunit/php-file-iterator',
14
  $vendorDir . '/phpunit/php-code-coverage',
15
  $vendorDir . '/phpunit/phpunit',
1
  <?php
2
 
3
+ // include_paths.php @generated by Composer
4
 
5
  $vendorDir = dirname(dirname(__FILE__));
6
  $baseDir = dirname($vendorDir);
7
 
8
  return array(
 
9
  $vendorDir . '/phpunit/php-text-template',
10
  $vendorDir . '/phpunit/phpunit-mock-objects',
11
  $vendorDir . '/phpunit/php-timer',
12
+ $vendorDir . '/phpunit/php-token-stream',
13
  $vendorDir . '/phpunit/php-file-iterator',
14
  $vendorDir . '/phpunit/php-code-coverage',
15
  $vendorDir . '/phpunit/phpunit',
vendor/composer/installed.json CHANGED
@@ -1,31 +1,28 @@
1
  [
2
  {
3
- "name": "ehough/contemplate",
4
- "version": "1.0.4",
5
- "version_normalized": "1.0.4.0",
6
  "source": {
7
  "type": "git",
8
- "url": "https://github.com/ehough/contemplate.git",
9
- "reference": "1.0.4"
10
  },
11
  "dist": {
12
  "type": "zip",
13
- "url": "https://api.github.com/repos/ehough/contemplate/zipball/1.0.4",
14
- "reference": "1.0.4",
15
  "shasum": ""
16
  },
17
  "require": {
18
- "php": ">=5.1.0"
19
- },
20
- "require-dev": {
21
- "phpunit/phpunit": "3.7.*"
22
  },
23
- "time": "2013-05-30 22:20:52",
24
  "type": "library",
25
  "installation-source": "dist",
26
  "autoload": {
27
  "psr-0": {
28
- "ehough_contemplate": "src/main/php"
29
  }
30
  },
31
  "notification-url": "https://packagist.org/downloads/",
@@ -39,41 +36,41 @@
39
  "homepage": "http://ehough.com"
40
  }
41
  ],
42
- "description": "Template library that uses pure PHP syntax. Nothing new to learn, blazingly fast, and compatible with PHP 5.2+.",
43
- "homepage": "https://github.com/ehough/contemplate"
44
  },
45
  {
46
- "name": "ehough/filesystem",
47
- "version": "v2.3.3",
48
- "version_normalized": "2.3.3.0",
49
  "source": {
50
  "type": "git",
51
- "url": "https://github.com/ehough/filesystem.git",
52
- "reference": "78e8fcb7232ceffb5507430f03a502d60d7345d0"
53
  },
54
  "dist": {
55
  "type": "zip",
56
- "url": "https://api.github.com/repos/ehough/filesystem/zipball/78e8fcb7232ceffb5507430f03a502d60d7345d0",
57
- "reference": "78e8fcb7232ceffb5507430f03a502d60d7345d0",
58
  "shasum": ""
59
  },
60
  "require": {
61
- "php": ">=5.2"
62
  },
63
  "require-dev": {
64
- "phpunit/phpunit": "3.7.*"
65
  },
66
- "time": "2013-08-19 00:39:46",
67
  "type": "library",
68
  "installation-source": "dist",
69
  "autoload": {
70
  "psr-0": {
71
- "ehough_filesystem": "src/main/php"
72
  }
73
  },
74
  "notification-url": "https://packagist.org/downloads/",
75
  "license": [
76
- "MIT"
77
  ],
78
  "authors": [
79
  {
@@ -82,44 +79,46 @@
82
  "homepage": "http://ehough.com"
83
  }
84
  ],
85
- "description": "Fork of Symfony's Filesystem Component compatible with PHP 5.2+",
86
- "keywords": [
87
- "filesystem"
88
- ]
89
  },
90
  {
91
- "name": "ehough/finder",
92
- "version": "v2.3.3",
93
- "version_normalized": "2.3.3.0",
94
  "source": {
95
  "type": "git",
96
- "url": "https://github.com/ehough/finder.git",
97
- "reference": "v2.3.3"
98
  },
99
  "dist": {
100
  "type": "zip",
101
- "url": "https://api.github.com/repos/ehough/finder/zipball/v2.3.3",
102
- "reference": "v2.3.3",
103
  "shasum": ""
104
  },
105
  "require": {
106
- "ehough/filesystem": "~2.0",
 
 
 
107
  "php": ">=5.2"
108
  },
109
  "require-dev": {
 
110
  "phpunit/phpunit": "3.7.*"
111
  },
112
- "time": "2013-08-19 00:33:33",
113
  "type": "library",
114
  "installation-source": "dist",
115
  "autoload": {
116
  "psr-0": {
117
- "ehough_finder": "src/main/php"
118
  }
119
  },
120
  "notification-url": "https://packagist.org/downloads/",
121
  "license": [
122
- "MIT"
123
  ],
124
  "authors": [
125
  {
@@ -128,47 +127,43 @@
128
  "homepage": "http://ehough.com"
129
  }
130
  ],
131
- "description": "Fork of Symfony's Finder Component compatible with PHP 5.2+"
 
132
  },
133
  {
134
- "name": "ehough/iconic",
135
- "version": "v2.3.3",
136
- "version_normalized": "2.3.3.0",
137
  "source": {
138
  "type": "git",
139
- "url": "https://github.com/ehough/iconic.git",
140
- "reference": "v2.3.3"
141
  },
142
  "dist": {
143
  "type": "zip",
144
- "url": "https://api.github.com/repos/ehough/iconic/zipball/v2.3.3",
145
- "reference": "v2.3.3",
146
  "shasum": ""
147
  },
148
  "require": {
 
149
  "php": ">=5.2.0"
150
  },
151
  "require-dev": {
152
- "phpunit/phpunit": "3.7.*",
153
- "symfony/config": "~2.2",
154
- "symfony/yaml": "~2.0"
155
- },
156
- "suggest": {
157
- "symfony/config": "",
158
- "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
159
- "symfony/yaml": ""
160
  },
161
- "time": "2013-08-19 00:25:21",
162
  "type": "library",
163
  "installation-source": "dist",
164
  "autoload": {
165
  "psr-0": {
166
- "ehough_iconic": "src/main/php"
167
  }
168
  },
169
  "notification-url": "https://packagist.org/downloads/",
170
  "license": [
171
- "MIT"
172
  ],
173
  "authors": [
174
  {
@@ -177,91 +172,98 @@
177
  "homepage": "http://ehough.com"
178
  }
179
  ],
180
- "description": "Fork of Symfony's Dependency Injection component compatible with PHP 5.2+.",
181
- "homepage": "https://github.com/ehough/iconic"
182
  },
183
  {
184
- "name": "ehough/pulsar",
185
- "version": "v2.3.3",
186
- "version_normalized": "2.3.3.0",
187
  "source": {
188
  "type": "git",
189
- "url": "https://github.com/ehough/pulsar.git",
190
- "reference": "268659204ab103517068d2ecbd2441f0840bdc62"
191
  },
192
  "dist": {
193
  "type": "zip",
194
- "url": "https://api.github.com/repos/ehough/pulsar/zipball/268659204ab103517068d2ecbd2441f0840bdc62",
195
- "reference": "268659204ab103517068d2ecbd2441f0840bdc62",
196
  "shasum": ""
197
  },
198
  "require": {
 
199
  "php": ">=5.2"
200
  },
201
  "require-dev": {
202
- "phpunit/phpunit": "3.7.*",
203
- "symfony/finder": "~2.0"
204
  },
205
- "time": "2013-08-18 23:48:22",
206
  "type": "library",
207
  "installation-source": "dist",
208
  "autoload": {
209
  "psr-0": {
210
- "ehough_pulsar": "src/main/php"
211
  }
212
  },
213
  "notification-url": "https://packagist.org/downloads/",
214
  "license": [
215
- "MIT"
216
  ],
217
  "authors": [
218
  {
219
- "name": "Eric D. Hough",
220
  "email": "eric@ehough.com",
221
  "homepage": "http://ehough.com"
222
  }
223
  ],
224
- "description": "Intelligent classloaders PHP 5",
225
- "homepage": "https://github.com/ehough/pulsar",
226
  "keywords": [
227
- "autoload",
228
- "autoloader",
229
- "psr-0"
 
 
 
 
 
 
 
230
  ]
231
  },
232
  {
233
- "name": "ehough/tickertape",
234
- "version": "v2.3.2",
235
- "version_normalized": "2.3.2.0",
236
  "source": {
237
  "type": "git",
238
- "url": "https://github.com/ehough/tickertape.git",
239
- "reference": "v2.3.2"
240
  },
241
  "dist": {
242
  "type": "zip",
243
- "url": "https://api.github.com/repos/ehough/tickertape/zipball/v2.3.2",
244
- "reference": "v2.3.2",
245
  "shasum": ""
246
  },
247
  "require": {
248
- "php": ">=5.2"
249
  },
250
  "require-dev": {
251
- "ehough/iconic": "~2.3",
252
  "phpunit/phpunit": "3.7.*"
253
  },
254
- "time": "2013-07-30 04:59:25",
255
  "type": "library",
256
  "installation-source": "dist",
257
  "autoload": {
258
  "psr-0": {
259
- "ehough_tickertape": "src/main/php"
260
  }
261
  },
262
  "notification-url": "https://packagist.org/downloads/",
263
  "license": [
264
- "MIT"
265
  ],
266
  "authors": [
267
  {
@@ -270,40 +272,39 @@
270
  "homepage": "http://ehough.com"
271
  }
272
  ],
273
- "description": "Fork of Symfony's Event Dispatcher compatible with PHP 5.2+.",
274
- "homepage": "https://github.com/ehough/tickertape"
275
  },
276
  {
277
- "name": "ehough/epilog",
278
- "version": "1.6.0",
279
- "version_normalized": "1.6.0.0",
 
280
  "source": {
281
  "type": "git",
282
- "url": "https://github.com/ehough/epilog.git",
283
- "reference": "1.6.0"
284
  },
285
  "dist": {
286
  "type": "zip",
287
- "url": "https://api.github.com/repos/ehough/epilog/zipball/1.6.0",
288
- "reference": "1.6.0",
289
  "shasum": ""
290
  },
291
  "require": {
292
- "php": ">=5.2.0"
293
- },
294
- "require-dev": {
295
- "doctrine/couchdb": "dev-master",
296
- "ehough/pulsar": "~2.3",
297
- "mlehner/gelf-php": "1.0.*",
298
- "phpunit/phpunit": "3.7.*",
299
- "raven/raven": "0.5.*"
300
  },
301
- "time": "2013-08-18 22:31:34",
302
  "type": "library",
 
 
 
 
 
303
  "installation-source": "dist",
304
  "autoload": {
305
  "psr-0": {
306
- "ehough_epilog": "src/main/php"
307
  }
308
  },
309
  "notification-url": "https://packagist.org/downloads/",
@@ -312,280 +313,292 @@
312
  ],
313
  "authors": [
314
  {
315
- "name": "Eric Hough",
316
- "email": "eric@ehough.com",
317
- "homepage": "http://ehough.com"
 
 
 
318
  }
319
  ],
320
- "description": "Fork of seldaek/monolog compatible with PHP 5.2+.",
321
- "homepage": "https://github.com/ehough/epilog"
322
  },
323
  {
324
- "name": "ehough/curly",
325
- "version": "1.0.3",
326
- "version_normalized": "1.0.3.0",
327
  "source": {
328
  "type": "git",
329
- "url": "https://github.com/ehough/curly.git",
330
- "reference": "1.0.3"
331
  },
332
  "dist": {
333
  "type": "zip",
334
- "url": "https://api.github.com/repos/ehough/curly/zipball/1.0.3",
335
- "reference": "1.0.3",
336
  "shasum": ""
337
  },
338
  "require": {
339
- "php": ">=5.2.0"
340
  },
341
- "time": "2013-04-04 19:52:21",
342
  "type": "library",
343
  "installation-source": "dist",
344
  "autoload": {
345
- "psr-0": {
346
- "ehough_curly": "src/main/php"
347
- }
348
  },
349
  "notification-url": "https://packagist.org/downloads/",
 
 
 
350
  "license": [
351
- "MPL-2.0"
352
  ],
353
  "authors": [
354
  {
355
- "name": "Eric Hough",
356
- "email": "eric@ehough.com",
357
- "homepage": "http://ehough.com"
358
  }
359
  ],
360
- "description": "Powerful PHP class for working with URLs",
361
- "homepage": "https://github.com/ehough/curly"
 
 
 
362
  },
363
  {
364
- "name": "ehough/chaingang",
365
- "version": "1.0.3",
366
- "version_normalized": "1.0.3.0",
367
  "source": {
368
  "type": "git",
369
- "url": "https://github.com/ehough/chaingang.git",
370
- "reference": "1.0.3"
371
  },
372
  "dist": {
373
  "type": "zip",
374
- "url": "https://api.github.com/repos/ehough/chaingang/zipball/1.0.3",
375
- "reference": "1.0.3",
376
  "shasum": ""
377
  },
378
  "require": {
379
- "php": ">=5.2.0"
 
380
  },
381
- "require-dev": {
382
- "ehough/mockery": ">=1.0,<1.1"
383
  },
384
- "time": "2013-03-28 18:28:21",
385
  "type": "library",
386
  "installation-source": "dist",
387
  "autoload": {
388
- "psr-0": {
389
- "ehough_chaingang": "src/main/php"
390
- }
391
  },
392
  "notification-url": "https://packagist.org/downloads/",
 
 
 
393
  "license": [
394
- "MPL-2.0"
395
  ],
396
  "authors": [
397
  {
398
- "name": "Eric Hough",
399
- "email": "eric@ehough.com",
400
- "homepage": "http://ehough.com"
401
  }
402
  ],
403
- "description": "Chain-of-Responsibility / Chain-of-Command pattern in PHP.",
404
- "homepage": "https://github.com/ehough/chaingang"
 
 
 
 
405
  },
406
  {
407
- "name": "ehough/shortstop",
408
- "version": "2.0.2",
409
- "version_normalized": "2.0.2.0",
410
  "source": {
411
  "type": "git",
412
- "url": "https://github.com/ehough/shortstop.git",
413
- "reference": "2.0.2"
414
  },
415
  "dist": {
416
  "type": "zip",
417
- "url": "https://api.github.com/repos/ehough/shortstop/zipball/2.0.2",
418
- "reference": "2.0.2",
419
  "shasum": ""
420
  },
421
  "require": {
422
- "ehough/chaingang": "~1.0.0",
423
- "ehough/curly": "~1.0.0",
424
- "ehough/epilog": "~1.5",
425
- "ehough/tickertape": "~2.3",
426
- "php": ">=5.2"
427
- },
428
- "require-dev": {
429
- "ehough/mockery": "~0.8",
430
- "phpunit/phpunit": "3.7.*"
431
  },
432
- "time": "2013-07-17 22:09:09",
433
  "type": "library",
434
  "installation-source": "dist",
435
  "autoload": {
436
- "psr-0": {
437
- "ehough_shortstop": "src/main/php"
438
- }
439
  },
440
  "notification-url": "https://packagist.org/downloads/",
 
 
 
441
  "license": [
442
- "MPL-2.0"
443
  ],
444
  "authors": [
445
  {
446
- "name": "Eric Hough",
447
- "email": "eric@ehough.com",
448
- "homepage": "http://ehough.com"
449
  }
450
  ],
451
- "description": "Fast and flexible HTTP client for PHP 5.2+",
452
- "homepage": "https://github.com/ehough/shortstop"
 
 
 
453
  },
454
  {
455
- "name": "ehough/stash",
456
- "version": "v0.10.5",
457
- "version_normalized": "0.10.5.0",
458
  "source": {
459
  "type": "git",
460
- "url": "https://github.com/ehough/stash.git",
461
- "reference": "v0.10.5"
462
  },
463
  "dist": {
464
  "type": "zip",
465
- "url": "https://api.github.com/repos/ehough/stash/zipball/v0.10.5",
466
- "reference": "v0.10.5",
467
  "shasum": ""
468
  },
469
  "require": {
470
- "php": ">=5.2.0"
471
- },
472
- "require-dev": {
473
- "phpunit/phpunit": "3.7.*"
474
  },
475
- "time": "2013-07-17 20:40:08",
476
  "type": "library",
 
 
 
 
 
477
  "installation-source": "dist",
478
  "autoload": {
479
- "psr-0": {
480
- "ehough_stash": "src/main/php",
481
- "ehough_stash_test": "src/test/php"
482
- }
483
  },
484
  "notification-url": "https://packagist.org/downloads/",
 
 
 
485
  "license": [
486
  "BSD-3-Clause"
487
  ],
488
  "authors": [
489
  {
490
- "name": "Eric Hough",
491
- "email": "eric@ehough.com",
492
- "homepage": "http://ehough.com"
493
  }
494
  ],
495
- "description": "Fork of tedivm/stash compatible with PHP 5.2+",
496
- "homepage": "http://github.com/ehough/stash",
497
  "keywords": [
498
- "apc",
499
- "cache",
500
- "caching",
501
- "memcached",
502
- "performance",
503
- "redis",
504
- "scalability",
505
- "sessions"
506
  ]
507
  },
508
  {
509
- "name": "ehough/mockery",
510
- "version": "0.8.0",
511
- "version_normalized": "0.8.0.0",
512
  "source": {
513
  "type": "git",
514
- "url": "https://github.com/ehough/mockery.git",
515
- "reference": "0.8.0"
516
  },
517
  "dist": {
518
  "type": "zip",
519
- "url": "https://api.github.com/repos/ehough/mockery/zipball/0.8.0",
520
- "reference": "0.8.0",
521
  "shasum": ""
522
  },
523
  "require": {
524
- "lib-pcre": ">=7.0",
525
- "php": ">=5.2"
526
- },
527
- "require-dev": {
528
- "hamcrest/hamcrest": "1.1.0",
529
- "phpunit/phpunit": "3.7.*"
530
  },
531
- "time": "2013-07-17 20:15:35",
532
  "type": "library",
533
  "installation-source": "dist",
534
  "autoload": {
535
- "psr-0": {
536
- "ehough_mockery": "src/main/php"
537
- }
538
  },
539
  "notification-url": "https://packagist.org/downloads/",
 
 
 
540
  "license": [
541
  "BSD-3-Clause"
542
  ],
543
  "authors": [
544
  {
545
- "name": "Eric Hough",
546
- "email": "eric@ehough.com",
547
- "homepage": "http://ehough.com"
548
  }
549
  ],
550
- "description": "Fork of padraic/mockery compatible with PHP 5.2+.",
551
- "homepage": "https://github.com/ehough/mockery",
552
  "keywords": [
553
- "BDD",
554
- "TDD",
555
- "library",
556
- "mock",
557
- "mock objects",
558
- "mockery",
559
- "stub",
560
- "test",
561
- "test double",
562
- "testing"
563
  ]
564
  },
565
  {
566
- "name": "phpunit/php-token-stream",
567
- "version": "1.2.0",
568
- "version_normalized": "1.2.0.0",
569
  "source": {
570
  "type": "git",
571
- "url": "https://github.com/sebastianbergmann/php-token-stream.git",
572
- "reference": "1.2.0"
573
  },
574
  "dist": {
575
  "type": "zip",
576
- "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1.2.0",
577
- "reference": "1.2.0",
578
  "shasum": ""
579
  },
580
  "require": {
581
- "ext-tokenizer": "*",
582
- "php": ">=5.3.3"
 
 
 
 
 
 
 
 
 
583
  },
584
- "time": "2013-08-04 05:57:48",
585
  "type": "library",
586
  "extra": {
587
  "branch-alias": {
588
- "dev-master": "1.2-dev"
589
  }
590
  },
591
  "installation-source": "dist",
@@ -608,424 +621,404 @@
608
  "role": "lead"
609
  }
610
  ],
611
- "description": "Wrapper around PHP's tokenizer extension.",
612
- "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
613
  "keywords": [
614
- "tokenizer"
 
 
615
  ]
616
  },
617
  {
618
- "name": "symfony/yaml",
619
- "version": "v2.3.4",
620
- "version_normalized": "2.3.4.0",
621
- "target-dir": "Symfony/Component/Yaml",
622
  "source": {
623
  "type": "git",
624
- "url": "https://github.com/symfony/Yaml.git",
625
- "reference": "5a279f1b5f5e1045a6c432354d9ea727ff3a9847"
626
  },
627
  "dist": {
628
  "type": "zip",
629
- "url": "https://api.github.com/repos/symfony/Yaml/zipball/5a279f1b5f5e1045a6c432354d9ea727ff3a9847",
630
- "reference": "5a279f1b5f5e1045a6c432354d9ea727ff3a9847",
631
  "shasum": ""
632
  },
633
  "require": {
634
- "php": ">=5.3.3"
 
 
 
 
 
 
 
 
 
 
635
  },
636
- "time": "2013-08-24 15:26:22",
 
 
 
 
 
 
 
 
 
 
 
 
637
  "type": "library",
638
  "extra": {
639
  "branch-alias": {
640
- "dev-master": "2.3-dev"
641
  }
642
  },
643
  "installation-source": "dist",
644
  "autoload": {
645
- "psr-0": {
646
- "Symfony\\Component\\Yaml\\": ""
647
- }
648
  },
649
  "notification-url": "https://packagist.org/downloads/",
 
 
 
 
650
  "license": [
651
- "MIT"
652
  ],
653
  "authors": [
654
  {
655
- "name": "Fabien Potencier",
656
- "email": "fabien@symfony.com"
657
- },
658
- {
659
- "name": "Symfony Community",
660
- "homepage": "http://symfony.com/contributors"
661
  }
662
  ],
663
- "description": "Symfony Yaml Component",
664
- "homepage": "http://symfony.com"
 
 
 
 
 
665
  },
666
  {
667
- "name": "phpunit/php-text-template",
668
- "version": "1.1.4",
669
- "version_normalized": "1.1.4.0",
670
  "source": {
671
  "type": "git",
672
- "url": "git://github.com/sebastianbergmann/php-text-template.git",
673
- "reference": "1.1.4"
674
  },
675
  "dist": {
676
  "type": "zip",
677
- "url": "https://github.com/sebastianbergmann/php-text-template/zipball/1.1.4",
678
- "reference": "1.1.4",
679
  "shasum": ""
680
  },
681
  "require": {
682
- "php": ">=5.3.3"
 
 
 
 
683
  },
684
- "time": "2012-10-31 11:15:28",
685
  "type": "library",
686
  "installation-source": "dist",
687
  "autoload": {
688
- "classmap": [
689
- "Text/"
690
- ]
691
  },
692
  "notification-url": "https://packagist.org/downloads/",
693
- "include-path": [
694
- ""
695
- ],
696
  "license": [
697
- "BSD-3-Clause"
698
  ],
699
  "authors": [
700
  {
701
- "name": "Sebastian Bergmann",
702
- "email": "sb@sebastian-bergmann.de",
703
- "role": "lead"
704
  }
705
  ],
706
- "description": "Simple template engine.",
707
- "homepage": "https://github.com/sebastianbergmann/php-text-template/",
708
- "keywords": [
709
- "template"
710
- ]
711
  },
712
  {
713
- "name": "phpunit/phpunit-mock-objects",
714
- "version": "1.2.3",
715
- "version_normalized": "1.2.3.0",
716
  "source": {
717
  "type": "git",
718
- "url": "git://github.com/sebastianbergmann/phpunit-mock-objects.git",
719
- "reference": "1.2.3"
720
  },
721
  "dist": {
722
  "type": "zip",
723
- "url": "https://github.com/sebastianbergmann/phpunit-mock-objects/archive/1.2.3.zip",
724
- "reference": "1.2.3",
725
  "shasum": ""
726
  },
727
  "require": {
728
- "php": ">=5.3.3",
729
- "phpunit/php-text-template": ">=1.1.1@stable"
 
 
 
 
 
730
  },
731
  "suggest": {
732
- "ext-soap": "*"
 
 
733
  },
734
- "time": "2013-01-13 10:24:48",
735
  "type": "library",
736
  "installation-source": "dist",
737
  "autoload": {
738
- "classmap": [
739
- "PHPUnit/"
740
- ]
741
  },
742
  "notification-url": "https://packagist.org/downloads/",
743
- "include-path": [
744
- ""
745
- ],
746
  "license": [
747
- "BSD-3-Clause"
748
  ],
749
  "authors": [
750
  {
751
- "name": "Sebastian Bergmann",
752
- "email": "sb@sebastian-bergmann.de",
753
- "role": "lead"
754
  }
755
  ],
756
- "description": "Mock Object library for PHPUnit",
757
- "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
758
- "keywords": [
759
- "mock",
760
- "xunit"
761
- ]
762
  },
763
  {
764
- "name": "phpunit/php-timer",
765
- "version": "1.0.5",
766
- "version_normalized": "1.0.5.0",
767
  "source": {
768
  "type": "git",
769
- "url": "https://github.com/sebastianbergmann/php-timer.git",
770
- "reference": "1.0.5"
771
  },
772
  "dist": {
773
  "type": "zip",
774
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/1.0.5",
775
- "reference": "1.0.5",
776
  "shasum": ""
777
  },
778
  "require": {
779
- "php": ">=5.3.3"
780
  },
781
- "time": "2013-08-02 07:42:54",
 
 
 
 
782
  "type": "library",
783
  "installation-source": "dist",
784
  "autoload": {
785
- "classmap": [
786
- "PHP/"
787
- ]
788
  },
789
  "notification-url": "https://packagist.org/downloads/",
790
- "include-path": [
791
- ""
792
- ],
793
  "license": [
794
- "BSD-3-Clause"
795
  ],
796
  "authors": [
797
  {
798
- "name": "Sebastian Bergmann",
799
- "email": "sb@sebastian-bergmann.de",
800
- "role": "lead"
801
  }
802
  ],
803
- "description": "Utility class for timing",
804
- "homepage": "https://github.com/sebastianbergmann/php-timer/",
805
  "keywords": [
806
- "timer"
 
 
807
  ]
808
  },
809
  {
810
- "name": "phpunit/php-file-iterator",
811
- "version": "1.3.3",
812
- "version_normalized": "1.3.3.0",
813
  "source": {
814
  "type": "git",
815
- "url": "git://github.com/sebastianbergmann/php-file-iterator.git",
816
- "reference": "1.3.3"
817
  },
818
  "dist": {
819
  "type": "zip",
820
- "url": "https://github.com/sebastianbergmann/php-file-iterator/zipball/1.3.3",
821
- "reference": "1.3.3",
822
  "shasum": ""
823
  },
824
  "require": {
825
- "php": ">=5.3.3"
826
  },
827
- "time": "2012-10-11 04:44:38",
 
 
 
 
 
 
 
 
 
828
  "type": "library",
829
  "installation-source": "dist",
830
  "autoload": {
831
- "classmap": [
832
- "File/"
833
- ]
834
  },
835
  "notification-url": "https://packagist.org/downloads/",
836
- "include-path": [
837
- ""
838
- ],
839
  "license": [
840
- "BSD-3-Clause"
841
  ],
842
  "authors": [
843
  {
844
- "name": "Sebastian Bergmann",
845
- "email": "sb@sebastian-bergmann.de",
846
- "role": "lead"
847
  }
848
  ],
849
- "description": "FilterIterator implementation that filters files based on a list of suffixes.",
850
- "homepage": "http://www.phpunit.de/",
851
- "keywords": [
852
- "filesystem",
853
- "iterator"
854
- ]
855
  },
856
  {
857
- "name": "phpunit/php-code-coverage",
858
- "version": "1.2.12",
859
- "version_normalized": "1.2.12.0",
860
  "source": {
861
  "type": "git",
862
- "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
863
- "reference": "1.2.12"
864
  },
865
  "dist": {
866
  "type": "zip",
867
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/1.2.12",
868
- "reference": "1.2.12",
869
  "shasum": ""
870
  },
871
  "require": {
872
- "php": ">=5.3.3",
873
- "phpunit/php-file-iterator": ">=1.3.0@stable",
874
- "phpunit/php-text-template": ">=1.1.1@stable",
875
- "phpunit/php-token-stream": ">=1.1.3@stable"
876
  },
877
  "require-dev": {
878
- "phpunit/phpunit": "3.7.*@dev"
879
- },
880
- "suggest": {
881
- "ext-dom": "*",
882
- "ext-xdebug": ">=2.0.5"
883
  },
884
- "time": "2013-07-06 06:26:16",
885
  "type": "library",
886
- "extra": {
887
- "branch-alias": {
888
- "dev-master": "1.2.x-dev"
889
- }
890
- },
891
  "installation-source": "dist",
892
  "autoload": {
893
- "classmap": [
894
- "PHP/"
895
- ]
896
  },
897
  "notification-url": "https://packagist.org/downloads/",
898
- "include-path": [
899
- ""
900
- ],
901
  "license": [
902
- "BSD-3-Clause"
903
  ],
904
  "authors": [
905
  {
906
- "name": "Sebastian Bergmann",
907
- "email": "sb@sebastian-bergmann.de",
908
- "role": "lead"
909
  }
910
  ],
911
- "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
912
- "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
913
- "keywords": [
914
- "coverage",
915
- "testing",
916
- "xunit"
917
- ]
918
  },
919
  {
920
- "name": "phpunit/phpunit",
921
- "version": "3.7.24",
922
- "version_normalized": "3.7.24.0",
923
  "source": {
924
  "type": "git",
925
- "url": "https://github.com/sebastianbergmann/phpunit.git",
926
- "reference": "3.7.24"
927
  },
928
  "dist": {
929
  "type": "zip",
930
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3.7.24",
931
- "reference": "3.7.24",
932
  "shasum": ""
933
  },
934
  "require": {
935
- "ext-dom": "*",
936
- "ext-pcre": "*",
937
- "ext-reflection": "*",
938
- "ext-spl": "*",
939
- "php": ">=5.3.3",
940
- "phpunit/php-code-coverage": "~1.2.1",
941
- "phpunit/php-file-iterator": ">=1.3.1",
942
- "phpunit/php-text-template": ">=1.1.1",
943
- "phpunit/php-timer": ">=1.0.4",
944
- "phpunit/phpunit-mock-objects": "~1.2.0",
945
- "symfony/yaml": "~2.0"
946
  },
947
  "require-dev": {
948
- "pear-pear/pear": "1.9.4"
949
- },
950
- "suggest": {
951
- "ext-json": "*",
952
- "ext-simplexml": "*",
953
- "ext-tokenizer": "*",
954
- "phpunit/php-invoker": ">=1.1.0,<1.2.0"
955
  },
956
- "time": "2013-08-09 06:58:24",
957
- "bin": [
958
- "composer/bin/phpunit"
959
- ],
960
  "type": "library",
961
- "extra": {
962
- "branch-alias": {
963
- "dev-master": "3.7.x-dev"
964
- }
965
- },
966
  "installation-source": "dist",
967
  "autoload": {
968
- "classmap": [
969
- "PHPUnit/"
970
- ]
971
  },
972
  "notification-url": "https://packagist.org/downloads/",
973
- "include-path": [
974
- "",
975
- "../../symfony/yaml/"
976
- ],
977
  "license": [
978
- "BSD-3-Clause"
979
  ],
980
  "authors": [
981
  {
982
- "name": "Sebastian Bergmann",
983
- "email": "sebastian@phpunit.de",
984
- "role": "lead"
985
  }
986
  ],
987
- "description": "The PHP Unit Testing framework.",
988
- "homepage": "http://www.phpunit.de/",
989
  "keywords": [
990
- "phpunit",
991
- "testing",
992
- "xunit"
993
  ]
994
  },
995
  {
996
- "name": "ehough/coauthor",
997
- "version": "v1.0.0",
998
- "version_normalized": "1.0.0.0",
999
  "source": {
1000
  "type": "git",
1001
- "url": "https://github.com/ehough/coauthor.git",
1002
- "reference": "69d0859b809761fe1734b9c08069a3cf16b61dac"
1003
  },
1004
  "dist": {
1005
  "type": "zip",
1006
- "url": "https://api.github.com/repos/ehough/coauthor/zipball/69d0859b809761fe1734b9c08069a3cf16b61dac",
1007
- "reference": "69d0859b809761fe1734b9c08069a3cf16b61dac",
1008
  "shasum": ""
1009
  },
1010
  "require": {
1011
- "ehough/shortstop": "~2.0.0",
1012
  "php": ">=5.2.0"
1013
  },
1014
  "require-dev": {
1015
- "ehough/mockery": "~0.8",
1016
  "phpunit/phpunit": "3.7.*"
1017
  },
1018
- "time": "2013-08-27 20:35:58",
1019
  "type": "library",
1020
  "installation-source": "dist",
1021
  "autoload": {
1022
  "psr-0": {
1023
- "ehough_coauthor": "src/main/php"
 
1024
  }
1025
  },
1026
  "notification-url": "https://packagist.org/downloads/",
1027
  "license": [
1028
- "MPL-2.0"
1029
  ],
1030
  "authors": [
1031
  {
@@ -1034,7 +1027,15 @@
1034
  "homepage": "http://ehough.com"
1035
  }
1036
  ],
1037
- "description": "OAuth client backed by ehough/shortstop",
1038
- "homepage": "https://github.com/ehough/coauthor"
 
 
 
 
 
 
 
 
1039
  }
1040
  ]
1
  [
2
  {
3
+ "name": "ehough/curly",
4
+ "version": "1.0.3",
5
+ "version_normalized": "1.0.3.0",
6
  "source": {
7
  "type": "git",
8
+ "url": "https://github.com/ehough/curly.git",
9
+ "reference": "abd70d9ccaf774caa7496e77ae27d5c2eb66d2ce"
10
  },
11
  "dist": {
12
  "type": "zip",
13
+ "url": "https://api.github.com/repos/ehough/curly/zipball/abd70d9ccaf774caa7496e77ae27d5c2eb66d2ce",
14
+ "reference": "abd70d9ccaf774caa7496e77ae27d5c2eb66d2ce",
15
  "shasum": ""
16
  },
17
  "require": {
18
+ "php": ">=5.2.0"
 
 
 
19
  },
20
+ "time": "2013-04-04 19:52:21",
21
  "type": "library",
22
  "installation-source": "dist",
23
  "autoload": {
24
  "psr-0": {
25
+ "ehough_curly": "src/main/php"
26
  }
27
  },
28
  "notification-url": "https://packagist.org/downloads/",
36
  "homepage": "http://ehough.com"
37
  }
38
  ],
39
+ "description": "Powerful PHP class for working with URLs",
40
+ "homepage": "https://github.com/ehough/curly"
41
  },
42
  {
43
+ "name": "ehough/chaingang",
44
+ "version": "1.0.3",
45
+ "version_normalized": "1.0.3.0",
46
  "source": {
47
  "type": "git",
48
+ "url": "https://github.com/ehough/chaingang.git",
49
+ "reference": "a94a458bdd468d85231984454508bf3049052157"
50
  },
51
  "dist": {
52
  "type": "zip",
53
+ "url": "https://api.github.com/repos/ehough/chaingang/zipball/a94a458bdd468d85231984454508bf3049052157",
54
+ "reference": "a94a458bdd468d85231984454508bf3049052157",
55
  "shasum": ""
56
  },
57
  "require": {
58
+ "php": ">=5.2.0"
59
  },
60
  "require-dev": {
61
+ "ehough/mockery": "~1.0.0"
62
  },
63
+ "time": "2013-03-28 18:28:21",
64
  "type": "library",
65
  "installation-source": "dist",
66
  "autoload": {
67
  "psr-0": {
68
+ "ehough_chaingang": "src/main/php"
69
  }
70
  },
71
  "notification-url": "https://packagist.org/downloads/",
72
  "license": [
73
+ "MPL-2.0"
74
  ],
75
  "authors": [
76
  {
79
  "homepage": "http://ehough.com"
80
  }
81
  ],
82
+ "description": "Chain-of-Responsibility / Chain-of-Command pattern in PHP.",
83
+ "homepage": "https://github.com/ehough/chaingang"
 
 
84
  },
85
  {
86
+ "name": "ehough/shortstop",
87
+ "version": "2.0.2",
88
+ "version_normalized": "2.0.2.0",
89
  "source": {
90
  "type": "git",
91
+ "url": "https://github.com/ehough/shortstop.git",
92
+ "reference": "1014368f357322968d37b90f0beacfab973f6d78"
93
  },
94
  "dist": {
95
  "type": "zip",
96
+ "url": "https://api.github.com/repos/ehough/shortstop/zipball/1014368f357322968d37b90f0beacfab973f6d78",
97
+ "reference": "1014368f357322968d37b90f0beacfab973f6d78",
98
  "shasum": ""
99
  },
100
  "require": {
101
+ "ehough/chaingang": "~1.0.0",
102
+ "ehough/curly": "~1.0.0",
103
+ "ehough/epilog": "~1.5",
104
+ "ehough/tickertape": "~2.3",
105
  "php": ">=5.2"
106
  },
107
  "require-dev": {
108
+ "ehough/mockery": "~0.8",
109
  "phpunit/phpunit": "3.7.*"
110
  },
111
+ "time": "2013-07-17 22:09:09",
112
  "type": "library",
113
  "installation-source": "dist",
114
  "autoload": {
115
  "psr-0": {
116
+ "ehough_shortstop": "src/main/php"
117
  }
118
  },
119
  "notification-url": "https://packagist.org/downloads/",
120
  "license": [
121
+ "MPL-2.0"
122
  ],
123
  "authors": [
124
  {
127
  "homepage": "http://ehough.com"
128
  }
129
  ],
130
+ "description": "Fast and flexible HTTP client for PHP 5.2+",
131
+ "homepage": "https://github.com/ehough/shortstop"
132
  },
133
  {
134
+ "name": "ehough/coauthor",
135
+ "version": "v1.0.0",
136
+ "version_normalized": "1.0.0.0",
137
  "source": {
138
  "type": "git",
139
+ "url": "https://github.com/ehough/coauthor.git",
140
+ "reference": "69d0859b809761fe1734b9c08069a3cf16b61dac"
141
  },
142
  "dist": {
143
  "type": "zip",
144
+ "url": "https://api.github.com/repos/ehough/coauthor/zipball/69d0859b809761fe1734b9c08069a3cf16b61dac",
145
+ "reference": "69d0859b809761fe1734b9c08069a3cf16b61dac",
146
  "shasum": ""
147
  },
148
  "require": {
149
+ "ehough/shortstop": "~2.0.0",
150
  "php": ">=5.2.0"
151
  },
152
  "require-dev": {
153
+ "ehough/mockery": "~0.8",
154
+ "phpunit/phpunit": "3.7.*"
 
 
 
 
 
 
155
  },
156
+ "time": "2013-08-27 20:35:58",
157
  "type": "library",
158
  "installation-source": "dist",
159
  "autoload": {
160
  "psr-0": {
161
+ "ehough_coauthor": "src/main/php"
162
  }
163
  },
164
  "notification-url": "https://packagist.org/downloads/",
165
  "license": [
166
+ "MPL-2.0"
167
  ],
168
  "authors": [
169
  {
172
  "homepage": "http://ehough.com"
173
  }
174
  ],
175
+ "description": "OAuth client backed by ehough/shortstop",
176
+ "homepage": "https://github.com/ehough/coauthor"
177
  },
178
  {
179
+ "name": "ehough/mockery",
180
+ "version": "0.8.0",
181
+ "version_normalized": "0.8.0.0",
182
  "source": {
183
  "type": "git",
184
+ "url": "https://github.com/ehough/mockery.git",
185
+ "reference": "baeb890e7335f2cca6362cb72e20cbdeaa35d968"
186
  },
187
  "dist": {
188
  "type": "zip",
189
+ "url": "https://api.github.com/repos/ehough/mockery/zipball/baeb890e7335f2cca6362cb72e20cbdeaa35d968",
190
+ "reference": "baeb890e7335f2cca6362cb72e20cbdeaa35d968",
191
  "shasum": ""
192
  },
193
  "require": {
194
+ "lib-pcre": ">=7.0",
195
  "php": ">=5.2"
196
  },
197
  "require-dev": {
198
+ "hamcrest/hamcrest": "1.1.0",
199
+ "phpunit/phpunit": "3.7.*"
200
  },
201
+ "time": "2013-07-17 20:15:35",
202
  "type": "library",
203
  "installation-source": "dist",
204
  "autoload": {
205
  "psr-0": {
206
+ "ehough_mockery": "src/main/php"
207
  }
208
  },
209
  "notification-url": "https://packagist.org/downloads/",
210
  "license": [
211
+ "BSD-3-Clause"
212
  ],
213
  "authors": [
214
  {
215
+ "name": "Eric Hough",
216
  "email": "eric@ehough.com",
217
  "homepage": "http://ehough.com"
218
  }
219
  ],
220
+ "description": "Fork of padraic/mockery compatible with PHP 5.2+.",
221
+ "homepage": "https://github.com/ehough/mockery",
222
  "keywords": [
223
+ "BDD",
224
+ "TDD",
225
+ "library",
226
+ "mock",
227
+ "mock objects",
228
+ "mockery",
229
+ "stub",
230
+ "test",
231
+ "test double",
232
+ "testing"
233
  ]
234
  },
235
  {
236
+ "name": "ehough/contemplate",
237
+ "version": "1.0.4",
238
+ "version_normalized": "1.0.4.0",
239
  "source": {
240
  "type": "git",
241
+ "url": "https://github.com/ehough/contemplate.git",
242
+ "reference": "15f8dc18c40e68fa354993fb8406791ccab134db"
243
  },
244
  "dist": {
245
  "type": "zip",
246
+ "url": "https://api.github.com/repos/ehough/contemplate/zipball/15f8dc18c40e68fa354993fb8406791ccab134db",
247
+ "reference": "15f8dc18c40e68fa354993fb8406791ccab134db",
248
  "shasum": ""
249
  },
250
  "require": {
251
+ "php": ">=5.1.0"
252
  },
253
  "require-dev": {
 
254
  "phpunit/phpunit": "3.7.*"
255
  },
256
+ "time": "2013-05-30 22:20:52",
257
  "type": "library",
258
  "installation-source": "dist",
259
  "autoload": {
260
  "psr-0": {
261
+ "ehough_contemplate": "src/main/php"
262
  }
263
  },
264
  "notification-url": "https://packagist.org/downloads/",
265
  "license": [
266
+ "MPL-2.0"
267
  ],
268
  "authors": [
269
  {
272
  "homepage": "http://ehough.com"
273
  }
274
  ],
275
+ "description": "Template library that uses pure PHP syntax. Nothing new to learn, blazingly fast, and compatible with PHP 5.2+.",
276
+ "homepage": "https://github.com/ehough/contemplate"
277
  },
278
  {
279
+ "name": "symfony/yaml",
280
+ "version": "v2.4.0",
281
+ "version_normalized": "2.4.0.0",
282
+ "target-dir": "Symfony/Component/Yaml",
283
  "source": {
284
  "type": "git",
285
+ "url": "https://github.com/symfony/Yaml.git",
286
+ "reference": "1ae235a1b9d3ad3d9f3860ff20acc072df95b7f5"
287
  },
288
  "dist": {
289
  "type": "zip",
290
+ "url": "https://api.github.com/repos/symfony/Yaml/zipball/1ae235a1b9d3ad3d9f3860ff20acc072df95b7f5",
291
+ "reference": "1ae235a1b9d3ad3d9f3860ff20acc072df95b7f5",
292
  "shasum": ""
293
  },
294
  "require": {
295
+ "php": ">=5.3.3"
 
 
 
 
 
 
 
296
  },
297
+ "time": "2013-11-26 16:40:27",
298
  "type": "library",
299
+ "extra": {
300
+ "branch-alias": {
301
+ "dev-master": "2.4-dev"
302
+ }
303
+ },
304
  "installation-source": "dist",
305
  "autoload": {
306
  "psr-0": {
307
+ "Symfony\\Component\\Yaml\\": ""
308
  }
309
  },
310
  "notification-url": "https://packagist.org/downloads/",
313
  ],
314
  "authors": [
315
  {
316
+ "name": "Fabien Potencier",
317
+ "email": "fabien@symfony.com"
318
+ },
319
+ {
320
+ "name": "Symfony Community",
321
+ "homepage": "http://symfony.com/contributors"
322
  }
323
  ],
324
+ "description": "Symfony Yaml Component",
325
+ "homepage": "http://symfony.com"
326
  },
327
  {
328
+ "name": "phpunit/php-text-template",
329
+ "version": "1.1.4",
330
+ "version_normalized": "1.1.4.0",
331
  "source": {
332
  "type": "git",
333
+ "url": "https://github.com/sebastianbergmann/php-text-template.git",
334
+ "reference": "5180896f51c5b3648ac946b05f9ec02be78a0b23"
335
  },
336
  "dist": {
337
  "type": "zip",
338
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5180896f51c5b3648ac946b05f9ec02be78a0b23",
339
+ "reference": "5180896f51c5b3648ac946b05f9ec02be78a0b23",
340
  "shasum": ""
341
  },
342
  "require": {
343
+ "php": ">=5.3.3"
344
  },
345
+ "time": "2012-10-31 18:15:28",
346
  "type": "library",
347
  "installation-source": "dist",
348
  "autoload": {
349
+ "classmap": [
350
+ "Text/"
351
+ ]
352
  },
353
  "notification-url": "https://packagist.org/downloads/",
354
+ "include-path": [
355
+ ""
356
+ ],
357
  "license": [
358
+ "BSD-3-Clause"
359
  ],
360
  "authors": [
361
  {
362
+ "name": "Sebastian Bergmann",
363
+ "email": "sb@sebastian-bergmann.de",
364
+ "role": "lead"
365
  }
366
  ],
367
+ "description": "Simple template engine.",
368
+ "homepage": "https://github.com/sebastianbergmann/php-text-template/",
369
+ "keywords": [
370
+ "template"
371
+ ]
372
  },
373
  {
374
+ "name": "phpunit/phpunit-mock-objects",
375
+ "version": "1.2.3",
376
+ "version_normalized": "1.2.3.0",
377
  "source": {
378
  "type": "git",
379
+ "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
380
+ "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875"
381
  },
382
  "dist": {
383
  "type": "zip",
384
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/5794e3c5c5ba0fb037b11d8151add2a07fa82875",
385
+ "reference": "5794e3c5c5ba0fb037b11d8151add2a07fa82875",
386
  "shasum": ""
387
  },
388
  "require": {
389
+ "php": ">=5.3.3",
390
+ "phpunit/php-text-template": ">=1.1.1@stable"
391
  },
392
+ "suggest": {
393
+ "ext-soap": "*"
394
  },
395
+ "time": "2013-01-13 10:24:48",
396
  "type": "library",
397
  "installation-source": "dist",
398
  "autoload": {
399
+ "classmap": [
400
+ "PHPUnit/"
401
+ ]
402
  },
403
  "notification-url": "https://packagist.org/downloads/",
404
+ "include-path": [
405
+ ""
406
+ ],
407
  "license": [
408
+ "BSD-3-Clause"
409
  ],
410
  "authors": [
411
  {
412
+ "name": "Sebastian Bergmann",
413
+ "email": "sb@sebastian-bergmann.de",
414
+ "role": "lead"
415
  }
416
  ],
417
+ "description": "Mock Object library for PHPUnit",
418
+ "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
419
+ "keywords": [
420
+ "mock",
421
+ "xunit"
422
+ ]
423
  },
424
  {
425
+ "name": "phpunit/php-timer",
426
+ "version": "1.0.5",
427
+ "version_normalized": "1.0.5.0",
428
  "source": {
429
  "type": "git",
430
+ "url": "https://github.com/sebastianbergmann/php-timer.git",
431
+ "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c"
432
  },
433
  "dist": {
434
  "type": "zip",
435
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
436
+ "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c",
437
  "shasum": ""
438
  },
439
  "require": {
440
+ "php": ">=5.3.3"
 
 
 
 
 
 
 
 
441
  },
442
+ "time": "2013-08-02 07:42:54",
443
  "type": "library",
444
  "installation-source": "dist",
445
  "autoload": {
446
+ "classmap": [
447
+ "PHP/"
448
+ ]
449
  },
450
  "notification-url": "https://packagist.org/downloads/",
451
+ "include-path": [
452
+ ""
453
+ ],
454
  "license": [
455
+ "BSD-3-Clause"
456
  ],
457
  "authors": [
458
  {
459
+ "name": "Sebastian Bergmann",
460
+ "email": "sb@sebastian-bergmann.de",
461
+ "role": "lead"
462
  }
463
  ],
464
+ "description": "Utility class for timing",
465
+ "homepage": "https://github.com/sebastianbergmann/php-timer/",
466
+ "keywords": [
467
+ "timer"
468
+ ]
469
  },
470
  {
471
+ "name": "phpunit/php-token-stream",
472
+ "version": "1.2.1",
473
+ "version_normalized": "1.2.1.0",
474
  "source": {
475
  "type": "git",
476
+ "url": "https://github.com/sebastianbergmann/php-token-stream.git",
477
+ "reference": "5220af2a7929aa35cf663d97c89ad3d50cf5fa3e"
478
  },
479
  "dist": {
480
  "type": "zip",
481
+ "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/5220af2a7929aa35cf663d97c89ad3d50cf5fa3e",
482
+ "reference": "5220af2a7929aa35cf663d97c89ad3d50cf5fa3e",
483
  "shasum": ""
484
  },
485
  "require": {
486
+ "ext-tokenizer": "*",
487
+ "php": ">=5.3.3"
 
 
488
  },
489
+ "time": "2013-09-13 04:58:23",
490
  "type": "library",
491
+ "extra": {
492
+ "branch-alias": {
493
+ "dev-master": "1.2-dev"
494
+ }
495
+ },
496
  "installation-source": "dist",
497
  "autoload": {
498
+ "classmap": [
499
+ "PHP/"
500
+ ]
 
501
  },
502
  "notification-url": "https://packagist.org/downloads/",
503
+ "include-path": [
504
+ ""
505
+ ],
506
  "license": [
507
  "BSD-3-Clause"
508
  ],
509
  "authors": [
510
  {
511
+ "name": "Sebastian Bergmann",
512
+ "email": "sb@sebastian-bergmann.de",
513
+ "role": "lead"
514
  }
515
  ],
516
+ "description": "Wrapper around PHP's tokenizer extension.",
517
+ "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
518
  "keywords": [
519
+ "tokenizer"
 
 
 
 
 
 
 
520
  ]
521
  },
522
  {
523
+ "name": "phpunit/php-file-iterator",
524
+ "version": "1.3.4",
525
+ "version_normalized": "1.3.4.0",
526
  "source": {
527
  "type": "git",
528
+ "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
529
+ "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb"
530
  },
531
  "dist": {
532
  "type": "zip",
533
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/acd690379117b042d1c8af1fafd61bde001bf6bb",
534
+ "reference": "acd690379117b042d1c8af1fafd61bde001bf6bb",
535
  "shasum": ""
536
  },
537
  "require": {
538
+ "php": ">=5.3.3"
 
 
 
 
 
539
  },
540
+ "time": "2013-10-10 15:34:57",
541
  "type": "library",
542
  "installation-source": "dist",
543
  "autoload": {
544
+ "classmap": [
545
+ "File/"
546
+ ]
547
  },
548
  "notification-url": "https://packagist.org/downloads/",
549
+ "include-path": [
550
+ ""
551
+ ],
552
  "license": [
553
  "BSD-3-Clause"
554
  ],
555
  "authors": [
556
  {
557
+ "name": "Sebastian Bergmann",
558
+ "email": "sb@sebastian-bergmann.de",
559
+ "role": "lead"
560
  }
561
  ],
562
+ "description": "FilterIterator implementation that filters files based on a list of suffixes.",
563
+ "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
564
  "keywords": [
565
+ "filesystem",
566
+ "iterator"
 
 
 
 
 
 
 
 
567
  ]
568
  },
569
  {
570
+ "name": "phpunit/php-code-coverage",
571
+ "version": "1.2.13",
572
+ "version_normalized": "1.2.13.0",
573
  "source": {
574
  "type": "git",
575
+ "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
576
+ "reference": "466e7cd2554b4e264c9e3f31216d25ac0e5f3d94"
577
  },
578
  "dist": {
579
  "type": "zip",
580
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/466e7cd2554b4e264c9e3f31216d25ac0e5f3d94",
581
+ "reference": "466e7cd2554b4e264c9e3f31216d25ac0e5f3d94",
582
  "shasum": ""
583
  },
584
  "require": {
585
+ "php": ">=5.3.3",
586
+ "phpunit/php-file-iterator": ">=1.3.0@stable",
587
+ "phpunit/php-text-template": ">=1.1.1@stable",
588
+ "phpunit/php-token-stream": ">=1.1.3@stable"
589
+ },
590
+ "require-dev": {
591
+ "phpunit/phpunit": "3.7.*@dev"
592
+ },
593
+ "suggest": {
594
+ "ext-dom": "*",
595
+ "ext-xdebug": ">=2.0.5"
596
  },
597
+ "time": "2013-09-10 08:14:32",
598
  "type": "library",
599
  "extra": {
600
  "branch-alias": {
601
+ "dev-master": "1.2.x-dev"
602
  }
603
  },
604
  "installation-source": "dist",
621
  "role": "lead"
622
  }
623
  ],
624
+ "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
625
+ "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
626
  "keywords": [
627
+ "coverage",
628
+ "testing",
629
+ "xunit"
630
  ]
631
  },
632
  {
633
+ "name": "phpunit/phpunit",
634
+ "version": "3.7.28",
635
+ "version_normalized": "3.7.28.0",
 
636
  "source": {
637
  "type": "git",
638
+ "url": "https://github.com/sebastianbergmann/phpunit.git",
639
+ "reference": "3b97c8492bcafbabe6b6fbd2ab35f2f04d932a8d"
640
  },
641
  "dist": {
642
  "type": "zip",
643
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3b97c8492bcafbabe6b6fbd2ab35f2f04d932a8d",
644
+ "reference": "3b97c8492bcafbabe6b6fbd2ab35f2f04d932a8d",
645
  "shasum": ""
646
  },
647
  "require": {
648
+ "ext-dom": "*",
649
+ "ext-pcre": "*",
650
+ "ext-reflection": "*",
651
+ "ext-spl": "*",
652
+ "php": ">=5.3.3",
653
+ "phpunit/php-code-coverage": "~1.2.1",
654
+ "phpunit/php-file-iterator": ">=1.3.1",
655
+ "phpunit/php-text-template": ">=1.1.1",
656
+ "phpunit/php-timer": ">=1.0.4",
657
+ "phpunit/phpunit-mock-objects": "~1.2.0",
658
+ "symfony/yaml": "~2.0"
659
  },
660
+ "require-dev": {
661
+ "pear-pear/pear": "1.9.4"
662
+ },
663
+ "suggest": {
664
+ "ext-json": "*",
665
+ "ext-simplexml": "*",
666
+ "ext-tokenizer": "*",
667
+ "phpunit/php-invoker": ">=1.1.0,<1.2.0"
668
+ },
669
+ "time": "2013-10-17 07:27:40",
670
+ "bin": [
671
+ "composer/bin/phpunit"
672
+ ],
673
  "type": "library",
674
  "extra": {
675
  "branch-alias": {
676
+ "dev-master": "3.7.x-dev"
677
  }
678
  },
679
  "installation-source": "dist",
680
  "autoload": {
681
+ "classmap": [
682
+ "PHPUnit/"
683
+ ]
684
  },
685
  "notification-url": "https://packagist.org/downloads/",
686
+ "include-path": [
687
+ "",
688
+ "../../symfony/yaml/"
689
+ ],
690
  "license": [
691
+ "BSD-3-Clause"
692
  ],
693
  "authors": [
694
  {
695
+ "name": "Sebastian Bergmann",
696
+ "email": "sebastian@phpunit.de",
697
+ "role": "lead"
 
 
 
698
  }
699
  ],
700
+ "description": "The PHP Unit Testing framework.",
701
+ "homepage": "http://www.phpunit.de/",
702
+ "keywords": [
703
+ "phpunit",
704
+ "testing",
705
+ "xunit"
706
+ ]
707
  },
708
  {
709
+ "name": "ehough/finder",
710
+ "version": "v2.4.0",
711
+ "version_normalized": "2.4.0.0",
712
  "source": {
713
  "type": "git",
714
+ "url": "https://github.com/ehough/finder.git",
715
+ "reference": "6070a85d73d38be99411861adfddead706833a34"
716
  },
717
  "dist": {
718
  "type": "zip",
719
+ "url": "https://api.github.com/repos/ehough/finder/zipball/6070a85d73d38be99411861adfddead706833a34",
720
+ "reference": "6070a85d73d38be99411861adfddead706833a34",
721
  "shasum": ""
722
  },
723
  "require": {
724
+ "ehough/filesystem": "~2.0",
725
+ "php": ">=5.2"
726
+ },
727
+ "require-dev": {
728
+ "phpunit/phpunit": "3.7.*"
729
  },
730
+ "time": "2013-12-05 00:28:26",
731
  "type": "library",
732
  "installation-source": "dist",
733
  "autoload": {
734
+ "psr-0": {
735
+ "ehough_finder": "src/main/php"
736
+ }
737
  },
738
  "notification-url": "https://packagist.org/downloads/",
 
 
 
739
  "license": [
740
+ "MIT"
741
  ],
742
  "authors": [
743
  {
744
+ "name": "Eric Hough",
745
+ "email": "eric@ehough.com",
746
+ "homepage": "http://ehough.com"
747
  }
748
  ],
749
+ "description": "Fork of Symfony's Finder Component compatible with PHP 5.2+"
 
 
 
 
750
  },
751
  {
752
+ "name": "ehough/iconic",
753
+ "version": "v2.4.0",
754
+ "version_normalized": "2.4.0.0",
755
  "source": {
756
  "type": "git",
757
+ "url": "https://github.com/ehough/iconic.git",
758
+ "reference": "6f8008253cb525d97c283b0a7809b483ce0db43f"
759
  },
760
  "dist": {
761
  "type": "zip",
762
+ "url": "https://api.github.com/repos/ehough/iconic/zipball/6f8008253cb525d97c283b0a7809b483ce0db43f",
763
+ "reference": "6f8008253cb525d97c283b0a7809b483ce0db43f",
764
  "shasum": ""
765
  },
766
  "require": {
767
+ "php": ">=5.2.0"
768
+ },
769
+ "require-dev": {
770
+ "phpunit/phpunit": "3.7.*",
771
+ "symfony/config": "~2.2",
772
+ "symfony/expression-language": "~2.4",
773
+ "symfony/yaml": "~2.0"
774
  },
775
  "suggest": {
776
+ "symfony/config": "",
777
+ "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them",
778
+ "symfony/yaml": ""
779
  },
780
+ "time": "2013-12-05 00:04:34",
781
  "type": "library",
782
  "installation-source": "dist",
783
  "autoload": {
784
+ "psr-0": {
785
+ "ehough_iconic": "src/main/php"
786
+ }
787
  },
788
  "notification-url": "https://packagist.org/downloads/",
 
 
 
789
  "license": [
790
+ "MIT"
791
  ],
792
  "authors": [
793
  {
794
+ "name": "Eric Hough",
795
+ "email": "eric@ehough.com",
796
+ "homepage": "http://ehough.com"
797
  }
798
  ],
799
+ "description": "Fork of Symfony's Dependency Injection component compatible with PHP 5.2+.",
800
+ "homepage": "https://github.com/ehough/iconic"
 
 
 
 
801
  },
802
  {
803
+ "name": "ehough/pulsar",
804
+ "version": "v2.4.0",
805
+ "version_normalized": "2.4.0.0",
806
  "source": {
807
  "type": "git",
808
+ "url": "https://github.com/ehough/pulsar.git",
809
+ "reference": "cbc89cafa739146111dfc8127ebe318bb64c159a"
810
  },
811
  "dist": {
812
  "type": "zip",
813
+ "url": "https://api.github.com/repos/ehough/pulsar/zipball/cbc89cafa739146111dfc8127ebe318bb64c159a",
814
+ "reference": "cbc89cafa739146111dfc8127ebe318bb64c159a",
815
  "shasum": ""
816
  },
817
  "require": {
818
+ "php": ">=5.2"
819
  },
820
+ "require-dev": {
821
+ "phpunit/phpunit": "3.7.*",
822
+ "symfony/finder": "~2.0"
823
+ },
824
+ "time": "2013-12-04 22:08:10",
825
  "type": "library",
826
  "installation-source": "dist",
827
  "autoload": {
828
+ "psr-0": {
829
+ "ehough_pulsar": "src/main/php"
830
+ }
831
  },
832
  "notification-url": "https://packagist.org/downloads/",
 
 
 
833
  "license": [
834
+ "MIT"
835
  ],
836
  "authors": [
837
  {
838
+ "name": "Eric D. Hough",
839
+ "email": "eric@ehough.com",
840
+ "homepage": "http://ehough.com"
841
  }
842
  ],
843
+ "description": "Intelligent classloaders PHP 5",
844
+ "homepage": "https://github.com/ehough/pulsar",
845
  "keywords": [
846
+ "autoload",
847
+ "autoloader",
848
+ "psr-0"
849
  ]
850
  },
851
  {
852
+ "name": "ehough/epilog",
853
+ "version": "1.7.0",
854
+ "version_normalized": "1.7.0.0",
855
  "source": {
856
  "type": "git",
857
+ "url": "https://github.com/ehough/epilog.git",
858
+ "reference": "dbdb5edb126d5e09fb6cb05aab11451e584f8cbd"
859
  },
860
  "dist": {
861
  "type": "zip",
862
+ "url": "https://api.github.com/repos/ehough/epilog/zipball/dbdb5edb126d5e09fb6cb05aab11451e584f8cbd",
863
+ "reference": "dbdb5edb126d5e09fb6cb05aab11451e584f8cbd",
864
  "shasum": ""
865
  },
866
  "require": {
867
+ "php": ">=5.2.0"
868
  },
869
+ "require-dev": {
870
+ "aws/aws-sdk-php": "~2.4.8",
871
+ "doctrine/couchdb": "dev-master",
872
+ "ehough/pulsar": "~2.3",
873
+ "mlehner/gelf-php": "1.0.*",
874
+ "phpunit/phpunit": "~3.7.0",
875
+ "raven/raven": "0.5.*",
876
+ "ruflin/elastica": "0.90.*"
877
+ },
878
+ "time": "2013-12-05 02:07:00",
879
  "type": "library",
880
  "installation-source": "dist",
881
  "autoload": {
882
+ "psr-0": {
883
+ "ehough_epilog": "src/main/php"
884
+ }
885
  },
886
  "notification-url": "https://packagist.org/downloads/",
 
 
 
887
  "license": [
888
+ "MIT"
889
  ],
890
  "authors": [
891
  {
892
+ "name": "Eric Hough",
893
+ "email": "eric@ehough.com",
894
+ "homepage": "http://ehough.com"
895
  }
896
  ],
897
+ "description": "Fork of seldaek/monolog compatible with PHP 5.2+.",
898
+ "homepage": "https://github.com/ehough/epilog"
 
 
 
 
899
  },
900
  {
901
+ "name": "ehough/tickertape",
902
+ "version": "v2.4.0",
903
+ "version_normalized": "2.4.0.0",
904
  "source": {
905
  "type": "git",
906
+ "url": "https://github.com/ehough/tickertape.git",
907
+ "reference": "d096f5591755ebc64fe67504243c413ccac79ceb"
908
  },
909
  "dist": {
910
  "type": "zip",
911
+ "url": "https://api.github.com/repos/ehough/tickertape/zipball/d096f5591755ebc64fe67504243c413ccac79ceb",
912
+ "reference": "d096f5591755ebc64fe67504243c413ccac79ceb",
913
  "shasum": ""
914
  },
915
  "require": {
916
+ "php": ">=5.2"
 
 
 
917
  },
918
  "require-dev": {
919
+ "ehough/iconic": "~2.3",
920
+ "phpunit/phpunit": "3.7.*"
 
 
 
921
  },
922
+ "time": "2013-12-04 21:04:42",
923
  "type": "library",
 
 
 
 
 
924
  "installation-source": "dist",
925
  "autoload": {
926
+ "psr-0": {
927
+ "ehough_tickertape": "src/main/php"
928
+ }
929
  },
930
  "notification-url": "https://packagist.org/downloads/",
 
 
 
931
  "license": [
932
+ "MIT"
933
  ],
934
  "authors": [
935
  {
936
+ "name": "Eric Hough",
937
+ "email": "eric@ehough.com",
938
+ "homepage": "http://ehough.com"
939
  }
940
  ],
941
+ "description": "Fork of Symfony's Event Dispatcher compatible with PHP 5.2+.",
942
+ "homepage": "https://github.com/ehough/tickertape"
 
 
 
 
 
943
  },
944
  {
945
+ "name": "ehough/filesystem",
946
+ "version": "v2.4.0",
947
+ "version_normalized": "2.4.0.0",
948
  "source": {
949
  "type": "git",
950
+ "url": "https://github.com/ehough/filesystem.git",
951
+ "reference": "8efba59e82f6fc4c855acdf09387ef6aaef9f235"
952
  },
953
  "dist": {
954
  "type": "zip",
955
+ "url": "https://api.github.com/repos/ehough/filesystem/zipball/8efba59e82f6fc4c855acdf09387ef6aaef9f235",
956
+ "reference": "8efba59e82f6fc4c855acdf09387ef6aaef9f235",
957
  "shasum": ""
958
  },
959
  "require": {
960
+ "php": ">=5.2"
 
 
 
 
 
 
 
 
 
 
961
  },
962
  "require-dev": {
963
+ "phpunit/phpunit": "3.7.*"
 
 
 
 
 
 
964
  },
965
+ "time": "2013-12-04 20:26:38",
 
 
 
966
  "type": "library",
 
 
 
 
 
967
  "installation-source": "dist",
968
  "autoload": {
969
+ "psr-0": {
970
+ "ehough_filesystem": "src/main/php"
971
+ }
972
  },
973
  "notification-url": "https://packagist.org/downloads/",
 
 
 
 
974
  "license": [
975
+ "MIT"
976
  ],
977
  "authors": [
978
  {
979
+ "name": "Eric Hough",
980
+ "email": "eric@ehough.com",
981
+ "homepage": "http://ehough.com"
982
  }
983
  ],
984
+ "description": "Fork of Symfony's Filesystem Component compatible with PHP 5.2+",
 
985
  "keywords": [
986
+ "filesystem"
 
 
987
  ]
988
  },
989
  {
990
+ "name": "ehough/stash",
991
+ "version": "v0.11.2",
992
+ "version_normalized": "0.11.2.0",
993
  "source": {
994
  "type": "git",
995
+ "url": "https://github.com/ehough/stash.git",
996
+ "reference": "677f6f8bded32345541fc127ae2b3bbef224f643"
997
  },
998
  "dist": {
999
  "type": "zip",
1000
+ "url": "https://api.github.com/repos/ehough/stash/zipball/677f6f8bded32345541fc127ae2b3bbef224f643",
1001
+ "reference": "677f6f8bded32345541fc127ae2b3bbef224f643",
1002
  "shasum": ""
1003
  },
1004
  "require": {
 
1005
  "php": ">=5.2.0"
1006
  },
1007
  "require-dev": {
 
1008
  "phpunit/phpunit": "3.7.*"
1009
  },
1010
+ "time": "2013-12-05 17:30:58",
1011
  "type": "library",
1012
  "installation-source": "dist",
1013
  "autoload": {
1014
  "psr-0": {
1015
+ "ehough_stash": "src/main/php",
1016
+ "ehough_stash_test": "src/test/php"
1017
  }
1018
  },
1019
  "notification-url": "https://packagist.org/downloads/",
1020
  "license": [
1021
+ "BSD-3-Clause"
1022
  ],
1023
  "authors": [
1024
  {
1027
  "homepage": "http://ehough.com"
1028
  }
1029
  ],
1030
+ "description": "Fork of tedivm/stash compatible with PHP 5.2+",
1031
+ "homepage": "http://github.com/ehough/stash",
1032
+ "keywords": [
1033
+ "apc",
1034
+ "cache",
1035
+ "caching",
1036
+ "memcached",
1037
+ "redis",
1038
+ "sessions"
1039
+ ]
1040
  }
1041
  ]
vendor/ehough/epilog/src/main/php/ehough/epilog/ErrorHandler.php CHANGED
@@ -67,7 +67,7 @@ class ehough_epilog_ErrorHandler
67
  public function registerExceptionHandler($level = null, $callPrevious = true)
68
  {
69
  $prev = set_exception_handler(array($this, 'handleException'));
70
- $this->uncaughtExceptionLevel = $level === null ? ehough_epilog_psr_LogLevel::ERROR : $level;
71
  if ($callPrevious && $prev) {
72
  $this->previousExceptionHandler = $prev;
73
  }
@@ -92,7 +92,7 @@ class ehough_epilog_ErrorHandler
92
  register_shutdown_function(array($this, 'handleFatalError'));
93
 
94
  $this->reservedMemory = str_repeat(' ', 1024 * $reservedMemorySize);
95
- $this->fatalLevel = $level === null ? ehough_epilog_psr_LogLevel::ALERT : $level;
96
  }
97
 
98
  protected function defaultErrorLevelMap()
@@ -121,7 +121,11 @@ class ehough_epilog_ErrorHandler
121
  */
122
  public function handleException(Exception $e)
123
  {
124
- $this->logger->log($this->uncaughtExceptionLevel, 'Uncaught exception', array('exception' => $e));
 
 
 
 
125
 
126
  if ($this->previousExceptionHandler) {
127
  call_user_func($this->previousExceptionHandler, $e);
@@ -157,7 +161,7 @@ class ehough_epilog_ErrorHandler
157
  $lastError = error_get_last();
158
  if ($lastError && in_array($lastError['type'], self::$fatalErrors)) {
159
  $this->logger->log(
160
- $this->fatalLevel,
161
  'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'],
162
  array('file' => $lastError['file'], 'line' => $lastError['line'])
163
  );
67
  public function registerExceptionHandler($level = null, $callPrevious = true)
68
  {
69
  $prev = set_exception_handler(array($this, 'handleException'));
70
+ $this->uncaughtExceptionLevel = $level;
71
  if ($callPrevious && $prev) {
72
  $this->previousExceptionHandler = $prev;
73
  }
92
  register_shutdown_function(array($this, 'handleFatalError'));
93
 
94
  $this->reservedMemory = str_repeat(' ', 1024 * $reservedMemorySize);
95
+ $this->fatalLevel = $level;
96
  }
97
 
98
  protected function defaultErrorLevelMap()
121
  */
122
  public function handleException(Exception $e)
123
  {
124
+ $this->logger->log(
125
+ $this->uncaughtExceptionLevel === null ? ehough_epilog_psr_LogLevel::ERROR : $this->uncaughtExceptionLevel,
126
+ 'Uncaught exception',
127
+ array('exception' => $e)
128
+ );
129
 
130
  if ($this->previousExceptionHandler) {
131
  call_user_func($this->previousExceptionHandler, $e);
161
  $lastError = error_get_last();
162
  if ($lastError && in_array($lastError['type'], self::$fatalErrors)) {
163
  $this->logger->log(
164
+ $this->fatalLevel === null ? ehough_epilog_psr_LogLevel::ALERT : $this->fatalLevel,
165
  'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'],
166
  array('file' => $lastError['file'], 'line' => $lastError['line'])
167
  );
vendor/ehough/epilog/src/main/php/ehough/epilog/Logger.php CHANGED
@@ -79,6 +79,11 @@ class ehough_epilog_Logger implements ehough_epilog_psr_LoggerInterface
79
  */
80
  const API = 1;
81
 
 
 
 
 
 
82
  protected static $levels = array(
83
  100 => 'DEBUG',
84
  200 => 'INFO',
79
  */
80
  const API = 1;
81
 
82
+ /**
83
+ * Logging levels from syslog protocol defined in RFC 5424
84
+ *
85
+ * @var array $levels Logging levels
86
+ */
87
  protected static $levels = array(
88
  100 => 'DEBUG',
89
  200 => 'INFO',
vendor/ehough/epilog/src/main/php/ehough/epilog/formatter/LineFormatter.php CHANGED
@@ -48,7 +48,9 @@ class ehough_epilog_formatter_LineFormatter extends ehough_epilog_formatter_Norm
48
  }
49
  }
50
  foreach ($vars as $var => $val) {
51
- $output = str_replace('%'.$var.'%', $this->convertToString($val), $output);
 
 
52
  }
53
 
54
  return $output;
@@ -92,9 +94,9 @@ class ehough_epilog_formatter_LineFormatter extends ehough_epilog_formatter_Norm
92
 
93
  $data = $this->normalize($data);
94
  if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
95
- return $this->toJson($data);
96
  }
97
 
98
- return str_replace('\\/', '/', json_encode($data));
99
  }
100
  }
48
  }
49
  }
50
  foreach ($vars as $var => $val) {
51
+ if (false !== strpos($output, '%'.$var.'%')) {
52
+ $output = str_replace('%'.$var.'%', $this->convertToString($val), $output);
53
+ }
54
  }
55
 
56
  return $output;
94
 
95
  $data = $this->normalize($data);
96
  if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
97
+ return $this->toJson($data, true);
98
  }
99
 
100
+ return str_replace('\\/', '/', @json_encode($data));
101
  }
102
  }
vendor/ehough/epilog/src/main/php/ehough/epilog/handler/AbstractHandler.php CHANGED
@@ -17,7 +17,7 @@
17
  abstract class ehough_epilog_handler_AbstractHandler implements ehough_epilog_handler_HandlerInterface
18
  {
19
  protected $level = ehough_epilog_Logger::DEBUG;
20
- protected $bubble = false;
21
 
22
  /**
23
  * @var ehough_epilog_formatter_FormatterInterface
@@ -71,6 +71,8 @@ abstract class ehough_epilog_handler_AbstractHandler implements ehough_epilog_ha
71
  throw new InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given');
72
  }
73
  array_unshift($this->processors, $callback);
 
 
74
  }
75
 
76
  /**
@@ -91,6 +93,8 @@ abstract class ehough_epilog_handler_AbstractHandler implements ehough_epilog_ha
91
  public function setFormatter(ehough_epilog_formatter_FormatterInterface $formatter)
92
  {
93
  $this->formatter = $formatter;
 
 
94
  }
95
 
96
  /**
@@ -108,11 +112,14 @@ abstract class ehough_epilog_handler_AbstractHandler implements ehough_epilog_ha
108
  /**
109
  * Sets minimum logging level at which this handler will be triggered.
110
  *
111
- * @param integer $level
 
112
  */
113
  public function setLevel($level)
114
  {
115
  $this->level = $level;
 
 
116
  }
117
 
118
  /**
@@ -128,19 +135,22 @@ abstract class ehough_epilog_handler_AbstractHandler implements ehough_epilog_ha
128
  /**
129
  * Sets the bubbling behavior.
130
  *
131
- * @param Boolean $bubble True means that bubbling is not permitted.
132
- * False means that this handler allows bubbling.
 
133
  */
134
  public function setBubble($bubble)
135
  {
136
  $this->bubble = $bubble;
 
 
137
  }
138
 
139
  /**
140
  * Gets the bubbling behavior.
141
  *
142
- * @return Boolean True means that bubbling is not permitted.
143
- * False means that this handler allows bubbling.
144
  */
145
  public function getBubble()
146
  {
17
  abstract class ehough_epilog_handler_AbstractHandler implements ehough_epilog_handler_HandlerInterface
18
  {
19
  protected $level = ehough_epilog_Logger::DEBUG;
20
+ protected $bubble = true;
21
 
22
  /**
23
  * @var ehough_epilog_formatter_FormatterInterface
71
  throw new InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given');
72
  }
73
  array_unshift($this->processors, $callback);
74
+
75
+ return $this;
76
  }
77
 
78
  /**
93
  public function setFormatter(ehough_epilog_formatter_FormatterInterface $formatter)
94
  {
95
  $this->formatter = $formatter;
96
+
97
+ return $this;
98
  }
99
 
100
  /**
112
  /**
113
  * Sets minimum logging level at which this handler will be triggered.
114
  *
115
+ * @param integer $level
116
+ * @return self
117
  */
118
  public function setLevel($level)
119
  {
120
  $this->level = $level;
121
+
122
+ return $this;
123
  }
124
 
125
  /**
135
  /**
136
  * Sets the bubbling behavior.
137
  *
138
+ * @param Boolean $bubble true means that this handler allows bubbling.
139
+ * false means that bubbling is not permitted.
140
+ * @return self
141
  */
142
  public function setBubble($bubble)
143
  {
144
  $this->bubble = $bubble;
145
+
146
+ return $this;
147
  }
148
 
149
  /**
150
  * Gets the bubbling behavior.
151
  *
152
+ * @return Boolean true means that this handler allows bubbling.
153
+ * false means that bubbling is not permitted.
154
  */
155
  public function getBubble()
156
  {
vendor/ehough/epilog/src/main/php/ehough/epilog/handler/AbstractProcessingHandler.php CHANGED
@@ -24,7 +24,7 @@ abstract class ehough_epilog_handler_AbstractProcessingHandler extends ehough_ep
24
  */
25
  public function handle(array $record)
26
  {
27
- if ($record['level'] < $this->level) {
28
  return false;
29
  }
30
 
24
  */
25
  public function handle(array $record)
26
  {
27
+ if (!$this->isHandling($record)) {
28
  return false;
29
  }
30
 
vendor/ehough/epilog/src/main/php/ehough/epilog/handler/HandlerInterface.php CHANGED
@@ -42,8 +42,8 @@ interface ehough_epilog_handler_HandlerInterface
42
  * calling further handlers in the stack with a given log record.
43
  *
44
  * @param array $record The record to handle
45
- * @return Boolean True means that this handler handled the record, and that bubbling is not permitted.
46
- * False means the record was either not processed or that this handler allows bubbling.
47
  */
48
  public function handle(array $record);
49
 
@@ -57,7 +57,8 @@ interface ehough_epilog_handler_HandlerInterface
57
  /**
58
  * Adds a processor in the stack.
59
  *
60
- * @param callable $callback
 
61
  */
62
  public function pushProcessor($callback);
63
 
@@ -72,6 +73,7 @@ interface ehough_epilog_handler_HandlerInterface
72
  * Sets the formatter.
73
  *
74
  * @param ehough_epilog_formatter_FormatterInterface $formatter
 
75
  */
76
  public function setFormatter(ehough_epilog_formatter_FormatterInterface $formatter);
77
 
42
  * calling further handlers in the stack with a given log record.
43
  *
44
  * @param array $record The record to handle
45
+ * @return Boolean true means that this handler handled the record, and that bubbling is not permitted.
46
+ * false means the record was either not processed or that this handler allows bubbling.
47
  */
48
  public function handle(array $record);
49
 
57
  /**
58
  * Adds a processor in the stack.
59
  *
60
+ * @param callable $callback
61
+ * @return self
62
  */
63
  public function pushProcessor($callback);
64
 
73
  * Sets the formatter.
74
  *
75
  * @param ehough_epilog_formatter_FormatterInterface $formatter
76
+ * @return self
77
  */
78
  public function setFormatter(ehough_epilog_formatter_FormatterInterface $formatter);
79
 
vendor/ehough/epilog/src/main/php/ehough/epilog/handler/SyslogUdpHandler.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Monolog package.
5
+ *
6
+ * (c) Jordi Boggiano <j.boggiano@seld.be>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ /**
13
+ * A Handler for logging to a remote syslogd server.
14
+ *
15
+ * @author Jesper Skovgaard Nielsen <nulpunkt@gmail.com>
16
+ */
17
+ class ehough_epilog_handler_SyslogUdpHandler extends ehough_epilog_handler_AbstractSyslogHandler
18
+ {
19
+ /**
20
+ * @param string $host
21
+ * @param int $port
22
+ * @param mixed $facility
23
+ * @param integer $level The minimum logging level at which this handler will be triggered
24
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
25
+ */
26
+ public function __construct($host, $port = 514, $facility = LOG_USER, $level = ehough_epilog_Logger::DEBUG, $bubble = true)
27
+ {
28
+ parent::__construct($facility, $level, $bubble);
29
+
30
+ $this->socket = new ehough_epilog_handler_syslogudp_UdpSocket($host, $port ? $port : 514);
31
+ }
32
+
33
+ protected function write(array $record)
34
+ {
35
+ $lines = $this->splitMessageIntoLines($record['formatted']);
36
+
37
+ $header = $this->makeCommonSyslogHeader($this->logLevels[$record['level']]);
38
+
39
+ foreach ($lines as $line) {
40
+ $this->socket->write($line, $header);
41
+ }
42
+ }
43
+
44
+ public function close()
45
+ {
46
+ $this->socket->close();
47
+ }
48
+
49
+ private function splitMessageIntoLines($message)
50
+ {
51
+ if (is_array($message)) {
52
+ $message = implode("\n", $message);
53
+ }
54
+
55
+ return preg_split('/$\R?^/m', $message);
56
+ }
57
+
58
+ /**
59
+ * Make common syslog header (see rfc5424)
60
+ */
61
+ private function makeCommonSyslogHeader($severity)
62
+ {
63
+ $priority = $severity + $this->facility;
64
+
65
+ return "<$priority>: ";
66
+ }
67
+
68
+ /**
69
+ * Inject your own socket, mainly used for testing
70
+ */
71
+ public function setSocket($socket)
72
+ {
73
+ $this->socket = $socket;
74
+ }
75
+ }
vendor/ehough/filesystem/README.md CHANGED
@@ -6,7 +6,7 @@ Fork of [Symfony's Filesystem component](https://github.com/symfony/Filesystem)
6
 
7
  [Symfony's Filesystem component](https://github.com/symfony/Filesystem) is a fantastic filesystem library,
8
  but it's only compatible with PHP 5.3+. While 97% of PHP servers run PHP 5.2 or higher,
9
- a whopping **44% of all servers are still running PHP 5.2 or lower** ([source](http://w3techs.com/technologies/details/pl-php/5/all)).
10
  It would be a shame to exempt this library from nearly half of the world's servers just because of a few version incompatibilities.
11
 
12
  Once PHP 5.3+ adoption levels near closer to 100%, this library will be retired.
6
 
7
  [Symfony's Filesystem component](https://github.com/symfony/Filesystem) is a fantastic filesystem library,
8
  but it's only compatible with PHP 5.3+. While 97% of PHP servers run PHP 5.2 or higher,
9
+ **32% of all servers are still running PHP 5.2 or lower** ([source](http://w3techs.com/technologies/details/pl-php/5/all)).
10
  It would be a shame to exempt this library from nearly half of the world's servers just because of a few version incompatibilities.
11
 
12
  Once PHP 5.3+ adoption levels near closer to 100%, this library will be retired.
vendor/ehough/filesystem/src/main/php/ehough/filesystem/Filesystem.php CHANGED
@@ -9,10 +9,6 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- //namespace Symfony\Component\Filesystem;
13
-
14
- //use Symfony\Component\Filesystem\Exception\IOException;
15
-
16
  /**
17
  * Provides basic utility to manipulate the file system.
18
  *
@@ -46,12 +42,13 @@ class ehough_filesystem_Filesystem implements ehough_filesystem_FilesystemInterf
46
  * @param string $targetFile The target filename
47
  * @param boolean $override Whether to override an existing file or not
48
  *
49
- * @throws ehough_filesystem_exception_IOException When copy fails
 
50
  */
51
  public function copy($originFile, $targetFile, $override = false)
52
  {
53
  if (stream_is_local($originFile) && !is_file($originFile)) {
54
- throw new ehough_filesystem_exception_IOException(sprintf('Failed to copy %s because file not exists', $originFile));
55
  }
56
 
57
  $this->mkdir(dirname($targetFile));
@@ -72,7 +69,7 @@ class ehough_filesystem_Filesystem implements ehough_filesystem_FilesystemInterf
72
  unset($source, $target);
73
 
74
  if (!is_file($targetFile)) {
75
- throw new ehough_filesystem_exception_IOException(sprintf('Failed to copy %s to %s', $originFile, $targetFile));
76
  }
77
  }
78
  }
@@ -93,7 +90,7 @@ class ehough_filesystem_Filesystem implements ehough_filesystem_FilesystemInterf
93
  }
94
 
95
  if (true !== @mkdir($dir, $mode, true)) {
96
- throw new ehough_filesystem_exception_IOException(sprintf('Failed to create %s', $dir));
97
  }
98
  }
99
  }
@@ -130,7 +127,7 @@ class ehough_filesystem_Filesystem implements ehough_filesystem_FilesystemInterf
130
  foreach ($this->toIterator($files) as $file) {
131
  $touch = $time ? @touch($file, $time, $atime) : @touch($file);
132
  if (true !== $touch) {
133
- throw new ehough_filesystem_exception_IOException(sprintf('Failed to touch %s', $file));
134
  }
135
  }
136
  }
@@ -163,17 +160,17 @@ class ehough_filesystem_Filesystem implements ehough_filesystem_FilesystemInterf
163
  }
164
 
165
  if (true !== @rmdir($file)) {
166
- throw new ehough_filesystem_exception_IOException(sprintf('Failed to remove directory %s', $file));
167
  }
168
  } else {
169
  // https://bugs.php.net/bug.php?id=52176
170
  if (defined('PHP_WINDOWS_VERSION_MAJOR') && is_dir($file)) {
171
  if (true !== @rmdir($file)) {
172
- throw new ehough_filesystem_exception_IOException(sprintf('Failed to remove file %s', $file));
173
  }
174
  } else {
175
  if (true !== @unlink($file)) {
176
- throw new ehough_filesystem_exception_IOException(sprintf('Failed to remove file %s', $file));
177
  }
178
  }
179
  }
@@ -205,7 +202,7 @@ class ehough_filesystem_Filesystem implements ehough_filesystem_FilesystemInterf
205
  }
206
  }
207
  if (true !== @chmod($file, $mode & ~$umask)) {
208
- throw new ehough_filesystem_exception_IOException(sprintf('Failed to chmod file %s', $file));
209
  }
210
  }
211
  }
@@ -235,11 +232,11 @@ class ehough_filesystem_Filesystem implements ehough_filesystem_FilesystemInterf
235
  }
236
  if (is_link($file) && function_exists('lchown')) {
237
  if (true !== @lchown($file, $user)) {
238
- throw new ehough_filesystem_exception_IOException(sprintf('Failed to chown file %s', $file));
239
  }
240
  } else {
241
  if (true !== @chown($file, $user)) {
242
- throw new ehough_filesystem_exception_IOException(sprintf('Failed to chown file %s', $file));
243
  }
244
  }
245
  }
@@ -271,11 +268,11 @@ class ehough_filesystem_Filesystem implements ehough_filesystem_FilesystemInterf
271
  }
272
  if (is_link($file) && function_exists('lchgrp')) {
273
  if (true !== @lchgrp($file, $group)) {
274
- throw new ehough_filesystem_exception_IOException(sprintf('Failed to chgrp file %s', $file));
275
  }
276
  } else {
277
  if (true !== @chgrp($file, $group)) {
278
- throw new ehough_filesystem_exception_IOException(sprintf('Failed to chgrp file %s', $file));
279
  }
280
  }
281
  }
@@ -295,11 +292,11 @@ class ehough_filesystem_Filesystem implements ehough_filesystem_FilesystemInterf
295
  {
296
  // we check that target does not exist
297
  if (!$overwrite && is_readable($target)) {
298
- throw new ehough_filesystem_exception_IOException(sprintf('Cannot rename because the target "%s" already exist.', $target));
299
  }
300
 
301
  if (true !== @rename($origin, $target)) {
302
- throw new ehough_filesystem_exception_IOException(sprintf('Cannot rename "%s" to "%s".', $origin, $target));
303
  }
304
  }
305
 
@@ -339,7 +336,8 @@ class ehough_filesystem_Filesystem implements ehough_filesystem_FilesystemInterf
339
  throw new ehough_filesystem_exception_IOException('Unable to create symlink due to error code 1314: \'A required privilege is not held by the client\'. Do you have the required Administrator-rights?');
340
  }
341
  }
342
- throw new ehough_filesystem_exception_IOException(sprintf('Failed to create symbolic link from %s to %s', $originDir, $targetDir));
 
343
  }
344
  }
345
  }
@@ -454,7 +452,7 @@ class ehough_filesystem_Filesystem implements ehough_filesystem_FilesystemInterf
454
  } elseif (is_dir($file)) {
455
  $this->mkdir($target);
456
  } else {
457
- throw new ehough_filesystem_exception_IOException(sprintf('Unable to guess "%s" file type.', $file));
458
  }
459
  } else {
460
  if (is_link($file)) {
@@ -464,7 +462,7 @@ class ehough_filesystem_Filesystem implements ehough_filesystem_FilesystemInterf
464
  } elseif (is_file($file)) {
465
  $this->copy($file, $target, isset($options['override']) ? $options['override'] : false);
466
  } else {
467
- throw new ehough_filesystem_exception_IOException(sprintf('Unable to guess "%s" file type.', $file));
468
  }
469
  }
470
  }
@@ -556,20 +554,6 @@ class ehough_filesystem_Filesystem implements ehough_filesystem_FilesystemInterf
556
  return null;
557
  }
558
 
559
- /**
560
- * @param mixed $files
561
- *
562
- * @return Traversable
563
- */
564
- private function toIterator($files)
565
- {
566
- if (!$files instanceof Traversable) {
567
- $files = new ArrayObject(is_array($files) ? $files : array($files));
568
- }
569
-
570
- return $files;
571
- }
572
-
573
  /**
574
  * Atomically dumps content into a file.
575
  *
@@ -585,16 +569,30 @@ class ehough_filesystem_Filesystem implements ehough_filesystem_FilesystemInterf
585
  if (!is_dir($dir)) {
586
  $this->mkdir($dir);
587
  } elseif (!is_writable($dir)) {
588
- throw new ehough_filesystem_exception_IOException(sprintf('Unable to write to the "%s" directory.', $dir));
589
  }
590
 
591
  $tmpFile = tempnam($dir, basename($filename));
592
 
593
  if (false === @file_put_contents($tmpFile, $content)) {
594
- throw new ehough_filesystem_exception_IOException(sprintf('Failed to write file "%s".', $filename));
595
  }
596
 
597
  $this->rename($tmpFile, $filename, true);
598
  $this->chmod($filename, $mode);
599
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
600
  }
9
  * file that was distributed with this source code.
10
  */
11
 
 
 
 
 
12
  /**
13
  * Provides basic utility to manipulate the file system.
14
  *
42
  * @param string $targetFile The target filename
43
  * @param boolean $override Whether to override an existing file or not
44
  *
45
+ * @throws ehough_filesystem_exception_FileNotFoundException When originFile doesn't exist
46
+ * @throws ehough_filesystem_exception_IOException When copy fails
47
  */
48
  public function copy($originFile, $targetFile, $override = false)
49
  {
50
  if (stream_is_local($originFile) && !is_file($originFile)) {
51
+ throw new ehough_filesystem_exception_FileNotFoundException(sprintf('Failed to copy "%s" because file does not exist.', $originFile), 0, null, $originFile);
52
  }
53
 
54
  $this->mkdir(dirname($targetFile));
69
  unset($source, $target);
70
 
71
  if (!is_file($targetFile)) {
72
+ throw new ehough_filesystem_exception_IOException(sprintf('Failed to copy "%s" to "%s".', $originFile, $targetFile), 0, null, $originFile);
73
  }
74
  }
75
  }
90
  }
91
 
92
  if (true !== @mkdir($dir, $mode, true)) {
93
+ throw new ehough_filesystem_exception_IOException(sprintf('Failed to create "%s".', $dir), 0, null, $dir);
94
  }
95
  }
96
  }
127
  foreach ($this->toIterator($files) as $file) {
128
  $touch = $time ? @touch($file, $time, $atime) : @touch($file);
129
  if (true !== $touch) {
130
+ throw new ehough_filesystem_exception_IOException(sprintf('Failed to touch "%s".', $file), 0, null, $file);
131
  }
132
  }
133
  }
160
  }
161
 
162
  if (true !== @rmdir($file)) {
163
+ throw new ehough_filesystem_exception_IOException(sprintf('Failed to remove directory "%s".', $file), 0, null, $file);
164
  }
165
  } else {
166
  // https://bugs.php.net/bug.php?id=52176
167
  if (defined('PHP_WINDOWS_VERSION_MAJOR') && is_dir($file)) {
168
  if (true !== @rmdir($file)) {
169
+ throw new ehough_filesystem_exception_IOException(sprintf('Failed to remove file "%s".', $file), 0, null, $file);
170
  }
171
  } else {
172
  if (true !== @unlink($file)) {
173
+ throw new ehough_filesystem_exception_IOException(sprintf('Failed to remove file "%s".', $file), 0, null, $file);
174
  }
175
  }
176
  }
202
  }
203
  }
204
  if (true !== @chmod($file, $mode & ~$umask)) {
205
+ throw new ehough_filesystem_exception_IOException(sprintf('Failed to chmod file "%s".', $file), 0, null, $file);
206
  }
207
  }
208
  }
232
  }
233
  if (is_link($file) && function_exists('lchown')) {
234
  if (true !== @lchown($file, $user)) {
235
+ throw new ehough_filesystem_exception_IOException(sprintf('Failed to chown file "%s".', $file), 0, null, $file);
236
  }
237
  } else {
238
  if (true !== @chown($file, $user)) {
239
+ throw new ehough_filesystem_exception_IOException(sprintf('Failed to chown file "%s".', $file), 0, null, $file);
240
  }
241
  }
242
  }
268
  }
269
  if (is_link($file) && function_exists('lchgrp')) {
270
  if (true !== @lchgrp($file, $group)) {
271
+ throw new ehough_filesystem_exception_IOException(sprintf('Failed to chgrp file "%s".', $file), 0, null, $file);
272
  }
273
  } else {
274
  if (true !== @chgrp($file, $group)) {
275
+ throw new ehough_filesystem_exception_IOException(sprintf('Failed to chgrp file "%s".', $file), 0, null, $file);
276
  }
277
  }
278
  }
292
  {
293
  // we check that target does not exist
294
  if (!$overwrite && is_readable($target)) {
295
+ throw new ehough_filesystem_exception_IOException(sprintf('Cannot rename because the target "%s" already exists.', $target), 0, null, $target);
296
  }
297
 
298
  if (true !== @rename($origin, $target)) {
299
+ throw new ehough_filesystem_exception_IOException(sprintf('Cannot rename "%s" to "%s".', $origin, $target), 0, null, $target);
300
  }
301
  }
302
 
336
  throw new ehough_filesystem_exception_IOException('Unable to create symlink due to error code 1314: \'A required privilege is not held by the client\'. Do you have the required Administrator-rights?');
337
  }
338
  }
339
+
340
+ throw new ehough_filesystem_exception_IOException(sprintf('Failed to create symbolic link from "%s" to "%s".', $originDir, $targetDir), 0, null, $targetDir);
341
  }
342
  }
343
  }
452
  } elseif (is_dir($file)) {
453
  $this->mkdir($target);
454
  } else {
455
+ throw new ehough_filesystem_exception_IOException(sprintf('Unable to guess "%s" file type.', $file), 0, null, $file);
456
  }
457
  } else {
458
  if (is_link($file)) {
462
  } elseif (is_file($file)) {
463
  $this->copy($file, $target, isset($options['override']) ? $options['override'] : false);
464
  } else {
465
+ throw new ehough_filesystem_exception_IOException(sprintf('Unable to guess "%s" file type.', $file), 0, null, $file);
466
  }
467
  }
468
  }
554
  return null;
555
  }
556
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
557
  /**
558
  * Atomically dumps content into a file.
559
  *
569
  if (!is_dir($dir)) {
570
  $this->mkdir($dir);
571
  } elseif (!is_writable($dir)) {
572
+ throw new ehough_filesystem_exception_IOException(sprintf('Unable to write to the "%s" directory.', $dir), 0, null, $dir);
573
  }
574
 
575
  $tmpFile = tempnam($dir, basename($filename));
576
 
577
  if (false === @file_put_contents($tmpFile, $content)) {
578
+ throw new ehough_filesystem_exception_IOException(sprintf('Failed to write file "%s".', $filename), 0, null, $filename);
579
  }
580
 
581
  $this->rename($tmpFile, $filename, true);
582
  $this->chmod($filename, $mode);
583
  }
584
+
585
+ /**
586
+ * @param mixed $files
587
+ *
588
+ * @return \Traversable
589
+ */
590
+ private function toIterator($files)
591
+ {
592
+ if (!$files instanceof Traversable) {
593
+ $files = new ArrayObject(is_array($files) ? $files : array($files));
594
+ }
595
+
596
+ return $files;
597
+ }
598
  }
vendor/ehough/filesystem/src/main/php/ehough/filesystem/exception/ExceptionInterface.php CHANGED
@@ -20,5 +20,4 @@
20
  */
21
  interface ehough_filesystem_exception_ExceptionInterface
22
  {
23
-
24
  }
20
  */
21
  interface ehough_filesystem_exception_ExceptionInterface
22
  {
 
23
  }
vendor/ehough/filesystem/src/main/php/ehough/filesystem/exception/FileNotFoundException.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ /**
13
+ * Exception class thrown when a file couldn't be found
14
+ *
15
+ * @author Fabien Potencier <fabien@symfony.com>
16
+ * @author Christian Gärtner <christiangaertner.film@googlemail.com>
17
+ */
18
+ class ehough_filesystem_exception_FileNotFoundException extends ehough_filesystem_exception_IOException
19
+ {
20
+ public function __construct($message = null, $code = 0, Exception $previous = null, $path = null)
21
+ {
22
+ if (null === $message) {
23
+ if (null === $path) {
24
+ $message = 'File could not be found.';
25
+ } else {
26
+ $message = sprintf('File "%s" could not be found.', $path);
27
+ }
28
+ }
29
+
30
+ parent::__construct($message, $code, $previous, $path);
31
+ }
32
+ }
vendor/ehough/filesystem/src/main/php/ehough/filesystem/exception/IOException.php CHANGED
@@ -9,16 +9,39 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- //namespace Symfony\Component\Filesystem\Exception;
13
-
14
  /**
15
  * Exception class thrown when a filesystem operation failure happens
16
  *
17
  * @author Romain Neutron <imprec@gmail.com>
 
 
18
  *
19
  * @api
20
  */
21
- class ehough_filesystem_exception_IOException extends RuntimeException implements ehough_filesystem_exception_ExceptionInterface
22
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
 
 
 
 
 
 
 
24
  }
9
  * file that was distributed with this source code.
10
  */
11
 
 
 
12
  /**
13
  * Exception class thrown when a filesystem operation failure happens
14
  *
15
  * @author Romain Neutron <imprec@gmail.com>
16
+ * @author Christian Gärtner <christiangaertner.film@googlemail.com>
17
+ * @author Fabien Potencier <fabien@symfony.com>
18
  *
19
  * @api
20
  */
21
+ class ehough_filesystem_exception_IOException extends RuntimeException implements ehough_filesystem_exception_IOExceptionInterface
22
  {
23
+ private $path;
24
+
25
+ public function __construct($message, $code = 0, Exception $previous = null, $path = null)
26
+ {
27
+ $this->path = $path;
28
+
29
+ if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
30
+
31
+ parent::__construct($message, $code, $previous);
32
+
33
+ } else {
34
+
35
+ parent::__construct($message, $code);
36
+ }
37
+
38
+ }
39
 
40
+ /**
41
+ * {@inheritdoc}
42
+ */
43
+ public function getPath()
44
+ {
45
+ return $this->path;
46
+ }
47
  }
vendor/ehough/filesystem/src/main/php/ehough/filesystem/exception/IOExceptionInterface.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ /**
13
+ * IOException interface for file and input/output stream related exceptions thrown by the component.
14
+ *
15
+ * @author Christian Gärtner <christiangaertner.film@googlemail.com>
16
+ */
17
+ interface ehough_filesystem_exception_IOExceptionInterface extends ehough_filesystem_exception_ExceptionInterface
18
+ {
19
+ /**
20
+ * Returns the associated path for the exception
21
+ *
22
+ * @return string The path.
23
+ */
24
+ public function getPath();
25
+ }
vendor/ehough/finder/README.md CHANGED
@@ -5,7 +5,7 @@ Fork of [Symfony's Finder component](https://github.com/symfony/Finder) compatib
5
  ### Motivation
6
 
7
  Symfony's Finder component is fantastic, but it's only compatible with PHP 5.3+. While 97% of PHP servers run PHP 5.2 or higher,
8
- a whopping **44% of all servers are still running PHP 5.2 or lower** ([source](http://w3techs.com/technologies/details/pl-php/5/all)).
9
  It would be a shame to exempt this library from nearly half of the world's servers just because of a few version incompatibilities.
10
 
11
  Once PHP 5.3+ adoption levels near closer to 100%, this library will be retired.
@@ -58,4 +58,4 @@ foreach ($finder->in('s3://bucket-name') as $file) {
58
  ### Releases and Versioning
59
 
60
  Releases are synchronized with the upstream Symfony repository. e.g. `ehough/finder v2.3.1` has merged the code
61
- from `Symfony/Finder v2.3.1`.
5
  ### Motivation
6
 
7
  Symfony's Finder component is fantastic, but it's only compatible with PHP 5.3+. While 97% of PHP servers run PHP 5.2 or higher,
8
+ **32% of all servers are still running PHP 5.2 or lower** ([source](http://w3techs.com/technologies/details/pl-php/5/all)).
9
  It would be a shame to exempt this library from nearly half of the world's servers just because of a few version incompatibilities.
10
 
11
  Once PHP 5.3+ adoption levels near closer to 100%, this library will be retired.
58
  ### Releases and Versioning
59
 
60
  Releases are synchronized with the upstream Symfony repository. e.g. `ehough/finder v2.3.1` has merged the code
61
+ from `Symfony/Finder v2.3.1`.
vendor/ehough/finder/src/main/php/ehough/finder/expression/Expression.php CHANGED
@@ -128,7 +128,7 @@ class ehough_finder_expression_Expression implements ehough_finder_expression_Va
128
  public function getGlob()
129
  {
130
  if (self::TYPE_GLOB !== $this->value->getType()) {
131
- throw new LogicException('Regex cant be transformed to glob.');
132
  }
133
 
134
  return $this->value;
128
  public function getGlob()
129
  {
130
  if (self::TYPE_GLOB !== $this->value->getType()) {
131
+ throw new LogicException('Regex can\'t be transformed to glob.');
132
  }
133
 
134
  return $this->value;
vendor/ehough/finder/src/main/php/ehough/finder/iterator/ExcludeDirectoryFilterIterator.php CHANGED
@@ -16,7 +16,7 @@
16
  */
17
  class ehough_finder_iterator_ExcludeDirectoryFilterIterator extends ehough_finder_iterator_FilterIterator
18
  {
19
- private $patterns;
20
 
21
  /**
22
  * Constructor.
@@ -26,7 +26,6 @@ class ehough_finder_iterator_ExcludeDirectoryFilterIterator extends ehough_finde
26
  */
27
  public function __construct(Iterator $iterator, array $directories)
28
  {
29
- $this->patterns = array();
30
  foreach ($directories as $directory) {
31
  $this->patterns[] = '#(^|/)'.preg_quote($directory, '#').'(/|$)#';
32
  }
16
  */
17
  class ehough_finder_iterator_ExcludeDirectoryFilterIterator extends ehough_finder_iterator_FilterIterator
18
  {
19
+ private $patterns = array();
20
 
21
  /**
22
  * Constructor.
26
  */
27
  public function __construct(Iterator $iterator, array $directories)
28
  {
 
29
  foreach ($directories as $directory) {
30
  $this->patterns[] = '#(^|/)'.preg_quote($directory, '#').'(/|$)#';
31
  }
vendor/ehough/finder/src/main/php/ehough/finder/iterator/MultiplePcreFilterIterator.php CHANGED
@@ -16,8 +16,8 @@
16
  */
17
  abstract class ehough_finder_iterator_MultiplePcreFilterIterator extends ehough_finder_iterator_FilterIterator
18
  {
19
- protected $matchRegexps;
20
- protected $noMatchRegexps;
21
 
22
  /**
23
  * Constructor.
@@ -28,12 +28,10 @@ abstract class ehough_finder_iterator_MultiplePcreFilterIterator extends ehough_
28
  */
29
  public function __construct(Iterator $iterator, array $matchPatterns, array $noMatchPatterns)
30
  {
31
- $this->matchRegexps = array();
32
  foreach ($matchPatterns as $pattern) {
33
  $this->matchRegexps[] = $this->toRegex($pattern);
34
  }
35
 
36
- $this->noMatchRegexps = array();
37
  foreach ($noMatchPatterns as $pattern) {
38
  $this->noMatchRegexps[] = $this->toRegex($pattern);
39
  }
16
  */
17
  abstract class ehough_finder_iterator_MultiplePcreFilterIterator extends ehough_finder_iterator_FilterIterator
18
  {
19
+ protected $matchRegexps = array();
20
+ protected $noMatchRegexps = array();
21
 
22
  /**
23
  * Constructor.
28
  */
29
  public function __construct(Iterator $iterator, array $matchPatterns, array $noMatchPatterns)
30
  {
 
31
  foreach ($matchPatterns as $pattern) {
32
  $this->matchRegexps[] = $this->toRegex($pattern);
33
  }
34
 
 
35
  foreach ($noMatchPatterns as $pattern) {
36
  $this->noMatchRegexps[] = $this->toRegex($pattern);
37
  }
vendor/ehough/finder/src/main/php/ehough/finder/shell/Command.php CHANGED
@@ -22,12 +22,12 @@ class ehough_finder_shell_Command
22
  /**
23
  * @var array
24
  */
25
- private $bits;
26
 
27
  /**
28
  * @var array
29
  */
30
- private $labels;
31
 
32
  /**
33
  * @var callable|null
@@ -37,13 +37,11 @@ class ehough_finder_shell_Command
37
  /**
38
  * Constructor.
39
  *
40
- * @param ehough_finder_shell_Command $parent Parent command
41
  */
42
  public function __construct(ehough_finder_shell_Command $parent = null)
43
  {
44
  $this->parent = $parent;
45
- $this->bits = array();
46
- $this->labels = array();
47
  }
48
 
49
  /**
@@ -59,7 +57,7 @@ class ehough_finder_shell_Command
59
  /**
60
  * Creates a new ehough_finder_shell_Command instance.
61
  *
62
- * @param ehough_finder_shell_Command $parent Parent command
63
  *
64
  * @return ehough_finder_shell_Command New ehough_finder_shell_Command instance
65
  */
22
  /**
23
  * @var array
24
  */
25
+ private $bits = array();
26
 
27
  /**
28
  * @var array
29
  */
30
+ private $labels = array();
31
 
32
  /**
33
  * @var callable|null
37
  /**
38
  * Constructor.
39
  *
40
+ * @param ehough_finder_shell_Command|null $parent Parent command
41
  */
42
  public function __construct(ehough_finder_shell_Command $parent = null)
43
  {
44
  $this->parent = $parent;
 
 
45
  }
46
 
47
  /**
57
  /**
58
  * Creates a new ehough_finder_shell_Command instance.
59
  *
60
+ * @param ehough_finder_shell_Command|null $parent Parent command
61
  *
62
  * @return ehough_finder_shell_Command New ehough_finder_shell_Command instance
63
  */
vendor/ehough/iconic/src/main/php/ehough/iconic/Container.php CHANGED
@@ -56,13 +56,13 @@ class ehough_iconic_Container implements ehough_iconic_IntrospectableContainerIn
56
  */
57
  protected $parameterBag;
58
 
59
- protected $services;
60
- protected $methodMap;
61
- protected $aliases;
62
- protected $scopes;
63
- protected $scopeChildren;
64
- protected $scopedServices;
65
- protected $scopeStacks;
66
  protected $loading = array();
67
 
68
  /**
@@ -76,13 +76,6 @@ class ehough_iconic_Container implements ehough_iconic_IntrospectableContainerIn
76
  {
77
  $this->parameterBag = null === $parameterBag ? new ehough_iconic_parameterbag_ParameterBag() : $parameterBag;
78
 
79
- $this->services = array();
80
- $this->aliases = array();
81
- $this->scopes = array();
82
- $this->scopeChildren = array();
83
- $this->scopedServices = array();
84
- $this->scopeStacks = array();
85
-
86
  $this->set('service_container', $this);
87
  }
88
 
@@ -229,8 +222,9 @@ class ehough_iconic_Container implements ehough_iconic_IntrospectableContainerIn
229
  {
230
  $id = strtolower($id);
231
 
232
- return array_key_exists($id, $this->services)
233
- || array_key_exists($id, $this->aliases)
 
234
  || method_exists($this, 'get'.strtr($id, array('_' => '', '.' => '_')).'Service')
235
  ;
236
  }
@@ -256,16 +250,21 @@ class ehough_iconic_Container implements ehough_iconic_IntrospectableContainerIn
256
  */
257
  public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
258
  {
259
- $id = strtolower($id);
260
-
261
- // resolve aliases
262
- if (isset($this->aliases[$id])) {
263
- $id = $this->aliases[$id];
264
- }
265
-
266
- // re-use shared service instance if it exists
267
- if (array_key_exists($id, $this->services)) {
268
- return $this->services[$id];
 
 
 
 
 
269
  }
270
 
271
  if (isset($this->loading[$id])) {
@@ -328,7 +327,9 @@ class ehough_iconic_Container implements ehough_iconic_IntrospectableContainerIn
328
  */
329
  public function initialized($id)
330
  {
331
- return array_key_exists(strtolower($id), $this->services);
 
 
332
  }
333
 
334
  /**
@@ -513,7 +514,7 @@ class ehough_iconic_Container implements ehough_iconic_IntrospectableContainerIn
513
  */
514
  public static function camelize($id)
515
  {
516
- return strtr(ucwords(strtr($id, array('_' => ' ', '.' => '_ '))), array(' ' => ''));
517
  }
518
 
519
  /**
56
  */
57
  protected $parameterBag;
58
 
59
+ protected $services = array();
60
+ protected $methodMap = array();
61
+ protected $aliases = array();
62
+ protected $scopes = array();
63
+ protected $scopeChildren = array();
64
+ protected $scopedServices = array();
65
+ protected $scopeStacks = array();
66
  protected $loading = array();
67
 
68
  /**
76
  {
77
  $this->parameterBag = null === $parameterBag ? new ehough_iconic_parameterbag_ParameterBag() : $parameterBag;
78
 
 
 
 
 
 
 
 
79
  $this->set('service_container', $this);
80
  }
81
 
222
  {
223
  $id = strtolower($id);
224
 
225
+ return isset($this->services[$id])
226
+ || array_key_exists($id, $this->services)
227
+ || isset($this->aliases[$id])
228
  || method_exists($this, 'get'.strtr($id, array('_' => '', '.' => '_')).'Service')
229
  ;
230
  }
250
  */
251
  public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
252
  {
253
+ // Attempt to retrieve the service by checking first aliases then
254
+ // available services. Service IDs are case insensitive, however since
255
+ // this method can be called thousands of times during a request, avoid
256
+ // calling strotolower() unless necessary.
257
+ foreach (array(false, true) as $strtolower) {
258
+ if ($strtolower) {
259
+ $id = strtolower($id);
260
+ }
261
+ if (isset($this->aliases[$id])) {
262
+ $id = $this->aliases[$id];
263
+ }
264
+ // Re-use shared service instance if it exists.
265
+ if (isset($this->services[$id]) || array_key_exists($id, $this->services)) {
266
+ return $this->services[$id];
267
+ }
268
  }
269
 
270
  if (isset($this->loading[$id])) {
327
  */
328
  public function initialized($id)
329
  {
330
+ $id = strtolower($id);
331
+
332
+ return isset($this->services[$id]) || array_key_exists($id, $this->services);
333
  }
334
 
335
  /**
514
  */
515
  public static function camelize($id)
516
  {
517
+ return strtr(ucwords(strtr($id, array('_' => ' ', '.' => '_ ', '\\' => '_ '))), array(' ' => ''));
518
  }
519
 
520
  /**
vendor/ehough/iconic/src/main/php/ehough/iconic/ContainerAwareTrait.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ /**
13
+ * ContainerAware trait.
14
+ *
15
+ * @author Fabien Potencier <fabien@symfony.com>
16
+ */
17
+ trait ContainerAwareTrait
18
+ {
19
+ /**
20
+ * @var ehough_iconic_ContainerInterface
21
+ */
22
+ protected $container;
23
+
24
+ /**
25
+ * Sets the Container associated with this Controller.
26
+ *
27
+ * @param ehough_iconic_ContainerInterface $container A ContainerInterface instance
28
+ */
29
+ public function setContainer(ehough_iconic_ContainerInterface $container = null)
30
+ {
31
+ $this->container = $container;
32
+ }
33
+ }
vendor/ehough/iconic/src/main/php/ehough/iconic/ContainerBuilder.php CHANGED
@@ -63,6 +63,11 @@ class ehough_iconic_ContainerBuilder extends ehough_iconic_Container implements
63
  */
64
  private $proxyInstantiator;
65
 
 
 
 
 
 
66
  /**
67
  * Sets the track resources flag.
68
  *
@@ -291,11 +296,7 @@ class ehough_iconic_ContainerBuilder extends ehough_iconic_Container implements
291
  */
292
  public function addCompilerPass(ehough_iconic_compiler_CompilerPassInterface $pass, $type = ehough_iconic_compiler_PassConfig::TYPE_BEFORE_OPTIMIZATION)
293
  {
294
- if (null === $this->compiler) {
295
- $this->compiler = new ehough_iconic_compiler_Compiler();
296
- }
297
-
298
- $this->compiler->addPass($pass, $type);
299
 
300
  if (class_exists('\Symfony\Component\Config\Resource\FileResource')) {
301
 
@@ -314,11 +315,7 @@ class ehough_iconic_ContainerBuilder extends ehough_iconic_Container implements
314
  */
315
  public function getCompilerPassConfig()
316
  {
317
- if (null === $this->compiler) {
318
- $this->compiler = new ehough_iconic_compiler_Compiler();
319
- }
320
-
321
- return $this->compiler->getPassConfig();
322
  }
323
 
324
  /**
@@ -599,15 +596,17 @@ class ehough_iconic_ContainerBuilder extends ehough_iconic_Container implements
599
  */
600
  public function compile()
601
  {
602
- if (null === $this->compiler) {
603
- $this->compiler = new ehough_iconic_compiler_Compiler();
604
- }
605
 
606
  if ($this->trackResources && class_exists('\Symfony\Component\Config\Resource\FileResource')) {
607
- foreach ($this->compiler->getPassConfig()->getPasses() as $pass) {
608
  $this->addObjectResource($pass);
609
  }
 
610
 
 
 
 
611
  foreach ($this->definitions as $definition) {
612
  if ($definition->isLazy() && ($class = $definition->getClass()) && class_exists($class)) {
613
  $this->addClassResource(new ReflectionClass($class));
@@ -615,8 +614,6 @@ class ehough_iconic_ContainerBuilder extends ehough_iconic_Container implements
615
  }
616
  }
617
 
618
- $this->compiler->compile($this);
619
-
620
  $this->extensionConfigs = array();
621
 
622
  parent::compile();
@@ -982,11 +979,12 @@ class ehough_iconic_ContainerBuilder extends ehough_iconic_Container implements
982
  }
983
 
984
  /**
985
- * Replaces service references by the real service instance.
986
  *
987
  * @param mixed $value A value
988
  *
989
- * @return mixed The same value with all service references replaced by the real service instances
 
990
  */
991
  public function resolveServices($value)
992
  {
@@ -998,6 +996,8 @@ class ehough_iconic_ContainerBuilder extends ehough_iconic_Container implements
998
  $value = $this->get((string) $value, $value->getInvalidBehavior());
999
  } elseif ($value instanceof ehough_iconic_Definition) {
1000
  $value = $this->createService($value, null);
 
 
1001
  }
1002
 
1003
  return $value;
@@ -1148,4 +1148,16 @@ class ehough_iconic_ContainerBuilder extends ehough_iconic_Container implements
1148
  }
1149
  }
1150
  }
 
 
 
 
 
 
 
 
 
 
 
 
1151
  }
63
  */
64
  private $proxyInstantiator;
65
 
66
+ /**
67
+ * @var ehough_iconic_ExpressionLanguage|null
68
+ */
69
+ private $expressionLanguage;
70
+
71
  /**
72
  * Sets the track resources flag.
73
  *
296
  */
297
  public function addCompilerPass(ehough_iconic_compiler_CompilerPassInterface $pass, $type = ehough_iconic_compiler_PassConfig::TYPE_BEFORE_OPTIMIZATION)
298
  {
299
+ $this->getCompiler()->addPass($pass, $type);
 
 
 
 
300
 
301
  if (class_exists('\Symfony\Component\Config\Resource\FileResource')) {
302
 
315
  */
316
  public function getCompilerPassConfig()
317
  {
318
+ return $this->getCompiler()->getPassConfig();
 
 
 
 
319
  }
320
 
321
  /**
596
  */
597
  public function compile()
598
  {
599
+ $compiler = $this->getCompiler();
 
 
600
 
601
  if ($this->trackResources && class_exists('\Symfony\Component\Config\Resource\FileResource')) {
602
+ foreach ($compiler->getPassConfig()->getPasses() as $pass) {
603
  $this->addObjectResource($pass);
604
  }
605
+ }
606
 
607
+ $compiler->compile($this);
608
+
609
+ if ($this->trackResources) {
610
  foreach ($this->definitions as $definition) {
611
  if ($definition->isLazy() && ($class = $definition->getClass()) && class_exists($class)) {
612
  $this->addClassResource(new ReflectionClass($class));
614
  }
615
  }
616
 
 
 
617
  $this->extensionConfigs = array();
618
 
619
  parent::compile();
979
  }
980
 
981
  /**
982
+ * Replaces service references by the real service instance and evaluates expressions.
983
  *
984
  * @param mixed $value A value
985
  *
986
+ * @return mixed The same value with all service references replaced by
987
+ * the real service instances and all expressions evaluated
988
  */
989
  public function resolveServices($value)
990
  {
996
  $value = $this->get((string) $value, $value->getInvalidBehavior());
997
  } elseif ($value instanceof ehough_iconic_Definition) {
998
  $value = $this->createService($value, null);
999
+ } elseif (is_a($value, 'Symfony\Component\ExpressionLanguage\Expression') === true) {
1000
+ $value = $this->getExpressionLanguage()->evaluate($value, array('container' => $this));
1001
  }
1002
 
1003
  return $value;
1148
  }
1149
  }
1150
  }
1151
+
1152
+ private function getExpressionLanguage()
1153
+ {
1154
+ if (null === $this->expressionLanguage) {
1155
+ if (!class_exists('Symfony\Component\ExpressionLanguage\ExpressionLanguage')) {
1156
+ throw new ehough_iconic_exception_RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.');
1157
+ }
1158
+ $this->expressionLanguage = new ehough_iconic_ExpressionLanguage();
1159
+ }
1160
+
1161
+ return $this->expressionLanguage;
1162
+ }
1163
  }
vendor/ehough/iconic/src/main/php/ehough/iconic/Definition.php CHANGED
@@ -23,24 +23,24 @@ class ehough_iconic_Definition
23
  private $factoryClass;
24
  private $factoryMethod;
25
  private $factoryService;
26
- private $scope;
27
- private $properties;
28
- private $calls;
29
  private $configurator;
30
- private $tags;
31
- private $public;
32
- private $synthetic;
33
- private $abstract;
34
- private $synchronized;
35
- private $lazy;
36
 
37
  protected $arguments;
38
 
39
  /**
40
  * Constructor.
41
  *
42
- * @param string $class The service class
43
- * @param array $arguments An array of arguments to pass to the service constructor
44
  *
45
  * @api
46
  */
@@ -48,15 +48,6 @@ class ehough_iconic_Definition
48
  {
49
  $this->class = $class;
50
  $this->arguments = $arguments;
51
- $this->calls = array();
52
- $this->scope = ehough_iconic_ContainerInterface::SCOPE_CONTAINER;
53
- $this->tags = array();
54
- $this->public = true;
55
- $this->synthetic = false;
56
- $this->synchronized = false;
57
- $this->lazy = false;
58
- $this->abstract = false;
59
- $this->properties = array();
60
  }
61
 
62
  /**
@@ -79,7 +70,7 @@ class ehough_iconic_Definition
79
  /**
80
  * Gets the factory class.
81
  *
82
- * @return string The factory class name
83
  *
84
  * @api
85
  */
@@ -107,7 +98,7 @@ class ehough_iconic_Definition
107
  /**
108
  * Gets the factory method.
109
  *
110
- * @return string The factory method name
111
  *
112
  * @api
113
  */
@@ -135,7 +126,7 @@ class ehough_iconic_Definition
135
  /**
136
  * Gets the factory service id.
137
  *
138
- * @return string The factory service id
139
  *
140
  * @api
141
  */
@@ -163,7 +154,7 @@ class ehough_iconic_Definition
163
  /**
164
  * Gets the service class.
165
  *
166
- * @return string The service class
167
  *
168
  * @api
169
  */
@@ -503,7 +494,7 @@ class ehough_iconic_Definition
503
  /**
504
  * Gets the file to require before creating the service.
505
  *
506
- * @return string The full pathname to include
507
  *
508
  * @api
509
  */
@@ -699,7 +690,7 @@ class ehough_iconic_Definition
699
  /**
700
  * Gets the configurator to call after the service is fully initialized.
701
  *
702
- * @return callable The PHP callable to call
703
  *
704
  * @api
705
  */
23
  private $factoryClass;
24
  private $factoryMethod;
25
  private $factoryService;
26
+ private $scope = ehough_iconic_ContainerInterface::SCOPE_CONTAINER;
27
+ private $properties = array();
28
+ private $calls = array();
29
  private $configurator;
30
+ private $tags = array();
31
+ private $public = true;
32
+ private $synthetic = false;
33
+ private $abstract = false;
34
+ private $synchronized = false;
35
+ private $lazy = false;
36
 
37
  protected $arguments;
38
 
39
  /**
40
  * Constructor.
41
  *
42
+ * @param string|null $class The service class
43
+ * @param array $arguments An array of arguments to pass to the service constructor
44
  *
45
  * @api
46
  */
48
  {
49
  $this->class = $class;
50
  $this->arguments = $arguments;
 
 
 
 
 
 
 
 
 
51
  }
52
 
53
  /**
70
  /**
71
  * Gets the factory class.
72
  *
73
+ * @return string|null The factory class name
74
  *
75
  * @api
76
  */
98
  /**
99
  * Gets the factory method.
100
  *
101
+ * @return string|null The factory method name
102
  *
103
  * @api
104
  */
126
  /**
127
  * Gets the factory service id.
128
  *
129
+ * @return string|null The factory service id
130
  *
131
  * @api
132
  */
154
  /**
155
  * Gets the service class.
156
  *
157
+ * @return string|null The service class
158
  *
159
  * @api
160
  */
494
  /**
495
  * Gets the file to require before creating the service.
496
  *
497
+ * @return string|null The full pathname to include
498
  *
499
  * @api
500
  */
690
  /**
691
  * Gets the configurator to call after the service is fully initialized.
692
  *
693
+ * @return callable|null The PHP callable to call
694
  *
695
  * @api
696
  */
vendor/ehough/iconic/src/main/php/ehough/iconic/DefinitionDecorator.php CHANGED
@@ -19,7 +19,7 @@
19
  class ehough_iconic_DefinitionDecorator extends ehough_iconic_Definition
20
  {
21
  private $parent;
22
- private $changes;
23
 
24
  /**
25
  * Constructor.
@@ -33,7 +33,6 @@ class ehough_iconic_DefinitionDecorator extends ehough_iconic_Definition
33
  parent::__construct();
34
 
35
  $this->parent = $parent;
36
- $this->changes = array();
37
  }
38
 
39
  /**
19
  class ehough_iconic_DefinitionDecorator extends ehough_iconic_Definition
20
  {
21
  private $parent;
22
+ private $changes = array();
23
 
24
  /**
25
  * Constructor.
33
  parent::__construct();
34
 
35
  $this->parent = $parent;
 
36
  }
37
 
38
  /**
vendor/ehough/iconic/src/main/php/ehough/iconic/ExpressionLanguage.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony package.
5
+ *
6
+ * (c) Fabien Potencier <fabien@symfony.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ /**
13
+ * Adds some function to the default ExpressionLanguage.
14
+ *
15
+ * To get a service, use service('request').
16
+ * To get a parameter, use parameter('kernel.debug').
17
+ *
18
+ * @author Fabien Potencier <fabien@symfony.com>
19
+ */
20
+ class ehough_iconic_ExpressionLanguage extends \Symfony\Component\ExpressionLanguage\ExpressionLanguage
21
+ {
22
+ protected function registerFunctions()
23
+ {
24
+ parent::registerFunctions();
25
+
26
+ $this->register('service', function ($arg) {
27
+ return sprintf('$this->get(%s)', $arg);
28
+ }, function (array $variables, $value) {
29
+ return $variables['container']->get($value);
30
+ });
31
+
32
+ $this->register('parameter', function ($arg) {
33
+ return sprintf('$this->getParameter(%s)', $arg);
34
+ }, function (array $variables, $value) {
35
+ return $variables['container']->getParameter($value);
36
+ });
37
+ }
38
+ }
vendor/ehough/iconic/src/main/php/ehough/iconic/SimpleXMLElement.php CHANGED
@@ -73,6 +73,10 @@ class ehough_iconic_SimpleXMLElement extends SimpleXMLElement
73
 
74
  $arguments[$key] = new ehough_iconic_Reference((string) $arg['id'], $invalidBehavior, $strict);
75
  break;
 
 
 
 
76
  case 'collection':
77
  $arguments[$key] = $arg->getArgumentsAsPhp($name, false);
78
  break;
73
 
74
  $arguments[$key] = new ehough_iconic_Reference((string) $arg['id'], $invalidBehavior, $strict);
75
  break;
76
+ case 'expression':
77
+ $ref = new ReflectionClass('Symfony\Component\ExpressionLanguage\Expression');
78
+ $arguments[$key] = $ref->newInstance((string) $arg);
79
+ break;
80
  case 'collection':
81
  $arguments[$key] = $arg->getArgumentsAsPhp($name, false);
82
  break;
vendor/ehough/iconic/src/main/php/ehough/iconic/compiler/CheckCircularReferencesPass.php CHANGED
@@ -23,6 +23,7 @@ class ehough_iconic_compiler_CheckCircularReferencesPass implements ehough_iconi
23
  {
24
  private $currentId;
25
  private $currentPath;
 
26
 
27
  /**
28
  * Checks the ContainerBuilder object for circular references.
@@ -33,6 +34,7 @@ class ehough_iconic_compiler_CheckCircularReferencesPass implements ehough_iconi
33
  {
34
  $graph = $container->getCompiler()->getServiceReferenceGraph();
35
 
 
36
  foreach ($graph->getNodes() as $id => $node) {
37
  $this->currentId = $id;
38
  $this->currentPath = array($id);
@@ -53,15 +55,20 @@ class ehough_iconic_compiler_CheckCircularReferencesPass implements ehough_iconi
53
  foreach ($edges as $edge) {
54
  $node = $edge->getDestNode();
55
  $id = $node->getId();
56
- $searchKey = array_search($id, $this->currentPath);
57
- $this->currentPath[] = $id;
58
 
59
- if (false !== $searchKey) {
60
- throw new ehough_iconic_exception_ServiceCircularReferenceException($id, array_slice($this->currentPath, $searchKey));
61
- }
62
 
63
- $this->checkOutEdges($node->getOutEdges());
64
- array_pop($this->currentPath);
 
 
 
 
 
 
 
65
  }
66
  }
67
  }
23
  {
24
  private $currentId;
25
  private $currentPath;
26
+ private $checkedNodes;
27
 
28
  /**
29
  * Checks the ContainerBuilder object for circular references.
34
  {
35
  $graph = $container->getCompiler()->getServiceReferenceGraph();
36
 
37
+ $this->checkedNodes = array();
38
  foreach ($graph->getNodes() as $id => $node) {
39
  $this->currentId = $id;
40
  $this->currentPath = array($id);
55
  foreach ($edges as $edge) {
56
  $node = $edge->getDestNode();
57
  $id = $node->getId();
 
 
58
 
59
+ if (empty($this->checkedNodes[$id])) {
60
+ $searchKey = array_search($id, $this->currentPath);
61
+ $this->currentPath[] = $id;
62
 
63
+ if (false !== $searchKey) {
64
+ throw new ehough_iconic_exception_ServiceCircularReferenceException($id, array_slice($this->currentPath, $searchKey));
65
+ }
66
+
67
+ $this->checkOutEdges($node->getOutEdges());
68
+
69
+ $this->checkedNodes[$id] = true;
70
+ array_pop($this->currentPath);
71
+ }
72
  }
73
  }
74
  }
vendor/ehough/iconic/src/main/php/ehough/iconic/compiler/CheckDefinitionValidityPass.php CHANGED
@@ -68,6 +68,17 @@ class ehough_iconic_compiler_CheckDefinitionValidityPass implements ehough_iconi
68
  $id
69
  ));
70
  }
 
 
 
 
 
 
 
 
 
 
 
71
  }
72
  }
73
  }
68
  $id
69
  ));
70
  }
71
+
72
+ // tag attribute values must be scalars
73
+ foreach ($definition->getTags() as $name => $tags) {
74
+ foreach ($tags as $attributes) {
75
+ foreach ($attributes as $attribute => $value) {
76
+ if (!is_scalar($value) && null !== $value) {
77
+ throw new ehough_iconic_exception_RuntimeException(sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s", attribute "%s".', $id, $name, $attribute));
78
+ }
79
+ }
80
+ }
81
+ }
82
  }
83
  }
84
  }
vendor/ehough/iconic/src/main/php/ehough/iconic/compiler/Compiler.php CHANGED
@@ -19,7 +19,7 @@
19
  class ehough_iconic_compiler_Compiler
20
  {
21
  private $passConfig;
22
- private $log;
23
  private $loggingFormatter;
24
  private $serviceReferenceGraph;
25
 
@@ -31,7 +31,6 @@ class ehough_iconic_compiler_Compiler
31
  $this->passConfig = new ehough_iconic_compiler_PassConfig();
32
  $this->serviceReferenceGraph = new ehough_iconic_compiler_ServiceReferenceGraph();
33
  $this->loggingFormatter = new ehough_iconic_compiler_LoggingFormatter();
34
- $this->log = array();
35
  }
36
 
37
  /**
19
  class ehough_iconic_compiler_Compiler
20
  {
21
  private $passConfig;
22
+ private $log = array();
23
  private $loggingFormatter;
24
  private $serviceReferenceGraph;
25
 
31
  $this->passConfig = new ehough_iconic_compiler_PassConfig();
32
  $this->serviceReferenceGraph = new ehough_iconic_compiler_ServiceReferenceGraph();
33
  $this->loggingFormatter = new ehough_iconic_compiler_LoggingFormatter();
 
34
  }
35
 
36
  /**
vendor/ehough/iconic/src/main/php/ehough/iconic/compiler/InlineServiceDefinitionsPass.php CHANGED
@@ -110,7 +110,7 @@ class ehough_iconic_compiler_InlineServiceDefinitionsPass implements ehough_icon
110
  return true;
111
  }
112
 
113
- if ($definition->isPublic()) {
114
  return false;
115
  }
116
 
110
  return true;
111
  }
112
 
113
+ if ($definition->isPublic() || $definition->isLazy()) {
114
  return false;
115
  }
116
 
vendor/ehough/iconic/src/main/php/ehough/iconic/compiler/PassConfig.php CHANGED
@@ -27,9 +27,9 @@ class ehough_iconic_compiler_PassConfig
27
  const TYPE_REMOVE = 'removing';
28
 
29
  private $mergePass;
30
- private $afterRemovingPasses;
31
- private $beforeOptimizationPasses;
32
- private $beforeRemovingPasses;
33
  private $optimizationPasses;
34
  private $removingPasses;
35
 
@@ -40,10 +40,6 @@ class ehough_iconic_compiler_PassConfig
40
  {
41
  $this->mergePass = new ehough_iconic_compiler_MergeExtensionConfigurationPass();
42
 
43
- $this->afterRemovingPasses = array();
44
- $this->beforeOptimizationPasses = array();
45
- $this->beforeRemovingPasses = array();
46
-
47
  $this->optimizationPasses = array(
48
  new ehough_iconic_compiler_ResolveDefinitionTemplatesPass(),
49
  new ehough_iconic_compiler_ResolveParameterPlaceHoldersPass(),
27
  const TYPE_REMOVE = 'removing';
28
 
29
  private $mergePass;
30
+ private $afterRemovingPasses = array();
31
+ private $beforeOptimizationPasses = array();
32
+ private $beforeRemovingPasses = array();
33
  private $optimizationPasses;
34
  private $removingPasses;
35
 
40
  {
41
  $this->mergePass = new ehough_iconic_compiler_MergeExtensionConfigurationPass();
42
 
 
 
 
 
43
  $this->optimizationPasses = array(
44
  new ehough_iconic_compiler_ResolveDefinitionTemplatesPass(),
45
  new ehough_iconic_compiler_ResolveParameterPlaceHoldersPass(),
vendor/ehough/iconic/src/main/php/ehough/iconic/compiler/ResolveDefinitionTemplatesPass.php CHANGED
@@ -105,7 +105,7 @@ class ehough_iconic_compiler_ResolveDefinitionTemplatesPass implements ehough_ic
105
  if (isset($changes['public'])) {
106
  $def->setPublic($definition->isPublic());
107
  }
108
- if (isset($changes['lazy'])){
109
  $def->setLazy($definition->isLazy());
110
  }
111
 
105
  if (isset($changes['public'])) {
106
  $def->setPublic($definition->isPublic());
107
  }
108
+ if (isset($changes['lazy'])) {
109
  $def->setLazy($definition->isLazy());
110
  }
111
 
vendor/ehough/iconic/src/main/php/ehough/iconic/compiler/ServiceReferenceGraph.php CHANGED
@@ -22,15 +22,7 @@ class ehough_iconic_compiler_ServiceReferenceGraph
22
  /**
23
  * @var ehough_iconic_compiler_ServiceReferenceGraphNode[]
24
  */
25
- private $nodes;
26
-
27
- /**
28
- * Constructor.
29
- */
30
- public function __construct()
31
- {
32
- $this->nodes = array();
33
- }
34
 
35
  /**
36
  * Checks if the graph has a specific node.
22
  /**
23
  * @var ehough_iconic_compiler_ServiceReferenceGraphNode[]
24
  */
25
+ private $nodes = array();
 
 
 
 
 
 
 
 
26
 
27
  /**
28
  * Checks if the graph has a specific node.
vendor/ehough/iconic/src/main/php/ehough/iconic/compiler/ServiceReferenceGraphNode.php CHANGED
@@ -19,8 +19,8 @@
19
  class ehough_iconic_compiler_ServiceReferenceGraphNode
20
  {
21
  private $id;
22
- private $inEdges;
23
- private $outEdges;
24
  private $value;
25
 
26
  /**
@@ -33,8 +33,6 @@ class ehough_iconic_compiler_ServiceReferenceGraphNode
33
  {
34
  $this->id = $id;
35
  $this->value = $value;
36
- $this->inEdges = array();
37
- $this->outEdges = array();
38
  }
39
 
40
  /**
19
  class ehough_iconic_compiler_ServiceReferenceGraphNode
20
  {
21
  private $id;
22
+ private $inEdges = array();
23
+ private $outEdges = array();
24
  private $value;
25
 
26
  /**
33
  {
34
  $this->id = $id;
35
  $this->value = $value;
 
 
36
  }
37
 
38
  /**
vendor/ehough/iconic/src/main/php/ehough/iconic/dumper/PhpDumper.php CHANGED
@@ -36,6 +36,7 @@ class ehough_iconic_dumper_PhpDumper extends ehough_iconic_dumper_Dumper
36
  private $referenceVariables;
37
  private $variableCount;
38
  private $reservedVariables = array('instance', 'class');
 
39
 
40
  /**
41
  * @var ehough_iconic_lazyproxy_phpdumper_DumperInterface
@@ -175,7 +176,7 @@ class ehough_iconic_dumper_PhpDumper extends ehough_iconic_dumper_Dumper
175
  */
176
  private function addProxyClasses()
177
  {
178
- /* @var $proxyDefinitions ehough_iconic_Definition[] */
179
  $definitions = array_filter(
180
  $this->container->getDefinitions(),
181
  array($this->getProxyDumper(), 'isProxyCandidate')
@@ -427,6 +428,12 @@ class ehough_iconic_dumper_PhpDumper extends ehough_iconic_dumper_Dumper
427
  continue;
428
  }
429
 
 
 
 
 
 
 
430
  $name = (string) $this->_splGetData($this->definitionVariables, $iDefinition, $iDefinition->getClass());
431
  $code .= $this->addServiceMethodCalls(null, $iDefinition, $name);
432
  $code .= $this->addServiceProperties(null, $iDefinition, $name);
@@ -1175,6 +1182,8 @@ EOF;
1175
  }
1176
 
1177
  return $this->getServiceCall((string) $value, $value);
 
 
1178
  } elseif ($value instanceof ehough_iconic_Parameter) {
1179
  return $this->dumpParameter($value);
1180
  } elseif (true === $interpolate && is_string($value)) {
@@ -1301,8 +1310,7 @@ EOF;
1301
  }
1302
  }
1303
 
1304
-
1305
- private function _splGetData($array, $object, $default)
1306
  {
1307
  $hash = spl_object_hash($object);
1308
 
@@ -1340,4 +1348,16 @@ EOF;
1340
 
1341
  return array_key_exists($hash, $array);
1342
  }
 
 
 
 
 
 
 
 
 
 
 
 
1343
  }
36
  private $referenceVariables;
37
  private $variableCount;
38
  private $reservedVariables = array('instance', 'class');
39
+ private $expressionLanguage;
40
 
41
  /**
42
  * @var ehough_iconic_lazyproxy_phpdumper_DumperInterface
176
  */
177
  private function addProxyClasses()
178
  {
179
+ /* @var $definitions ehough_iconic_Definition[] */
180
  $definitions = array_filter(
181
  $this->container->getDefinitions(),
182
  array($this->getProxyDumper(), 'isProxyCandidate')
428
  continue;
429
  }
430
 
431
+ // if the instance is simple, the return statement has already been generated
432
+ // so, the only possible way to get there is because of a circular reference
433
+ if ($this->isSimpleInstance($id, $definition)) {
434
+ throw new ehough_iconic_exception_ServiceCircularReferenceException($id, array($id));
435
+ }
436
+
437
  $name = (string) $this->_splGetData($this->definitionVariables, $iDefinition, $iDefinition->getClass());
438
  $code .= $this->addServiceMethodCalls(null, $iDefinition, $name);
439
  $code .= $this->addServiceProperties(null, $iDefinition, $name);
1182
  }
1183
 
1184
  return $this->getServiceCall((string) $value, $value);
1185
+ } elseif (is_a($value, 'Symfony\Component\ExpressionLanguage\Expression') === true) {
1186
+ return $this->getExpressionLanguage()->compile((string) $value, array('container'));
1187
  } elseif ($value instanceof ehough_iconic_Parameter) {
1188
  return $this->dumpParameter($value);
1189
  } elseif (true === $interpolate && is_string($value)) {
1310
  }
1311
  }
1312
 
1313
+ private function _splGetData($array, $object, $default)
 
1314
  {
1315
  $hash = spl_object_hash($object);
1316
 
1348
 
1349
  return array_key_exists($hash, $array);
1350
  }
1351
+
1352
+ private function getExpressionLanguage()
1353
+ {
1354
+ if (null === $this->expressionLanguage) {
1355
+ if (!class_exists('Symfony\Component\ExpressionLanguage\ExpressionLanguage')) {
1356
+ throw new ehough_iconic_exception_RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.');
1357
+ }
1358
+ $this->expressionLanguage = new ehough_iconic_ExpressionLanguage();
1359
+ }
1360
+
1361
+ return $this->expressionLanguage;
1362
+ }
1363
  }
vendor/ehough/iconic/src/main/php/ehough/iconic/dumper/XmlDumper.php CHANGED
@@ -251,6 +251,10 @@ class ehough_iconic_dumper_XmlDumper extends ehough_iconic_dumper_Dumper
251
  } elseif ($value instanceof ehough_iconic_Definition) {
252
  $element->setAttribute('type', 'service');
253
  $this->addService($value, null, $element);
 
 
 
 
254
  } else {
255
  if (in_array($value, array('null', 'true', 'false'), true)) {
256
  $element->setAttribute('type', 'string');
251
  } elseif ($value instanceof ehough_iconic_Definition) {
252
  $element->setAttribute('type', 'service');
253
  $this->addService($value, null, $element);
254
+ } elseif (is_a($value, 'Symfony\Component\ExpressionLanguage\Expression') === true) {
255
+ $element->setAttribute('type', 'expression');
256
+ $text = $this->document->createTextNode(self::phpToXml((string) $value));
257
+ $element->appendChild($text);
258
  } else {
259
  if (in_array($value, array('null', 'true', 'false'), true)) {
260
  $element->setAttribute('type', 'string');
vendor/ehough/iconic/src/main/php/ehough/iconic/dumper/YamlDumper.php CHANGED
@@ -63,6 +63,10 @@ class ehough_iconic_dumper_YamlDumper extends ehough_iconic_dumper_Dumper
63
  $code .= sprintf(" class: %s\n", $definition->getClass());
64
  }
65
 
 
 
 
 
66
  $tagsCode = '';
67
  foreach ($definition->getTags() as $name => $tags) {
68
  foreach ($tags as $attributes) {
@@ -220,6 +224,8 @@ class ehough_iconic_dumper_YamlDumper extends ehough_iconic_dumper_Dumper
220
  return $this->getServiceCall((string) $value, $value);
221
  } elseif ($value instanceof ehough_iconic_Parameter) {
222
  return $this->getParameterCall((string) $value);
 
 
223
  } elseif (is_object($value) || is_resource($value)) {
224
  throw new ehough_iconic_exception_RuntimeException('Unable to dump a service container if a parameter is an object or a resource.');
225
  }
@@ -256,6 +262,11 @@ class ehough_iconic_dumper_YamlDumper extends ehough_iconic_dumper_Dumper
256
  return sprintf('%%%s%%', $id);
257
  }
258
 
 
 
 
 
 
259
  /**
260
  * Prepares parameters.
261
  *
63
  $code .= sprintf(" class: %s\n", $definition->getClass());
64
  }
65
 
66
+ if (!$definition->isPublic()) {
67
+ $code .= " public: false\n";
68
+ }
69
+
70
  $tagsCode = '';
71
  foreach ($definition->getTags() as $name => $tags) {
72
  foreach ($tags as $attributes) {
224
  return $this->getServiceCall((string) $value, $value);
225
  } elseif ($value instanceof ehough_iconic_Parameter) {
226
  return $this->getParameterCall((string) $value);
227
+ } elseif (is_a($value, 'Symfony\Component\ExpressionLanguage\Expression') === true) {
228
+ return $this->getExpressionCall((string) $value);
229
  } elseif (is_object($value) || is_resource($value)) {
230
  throw new ehough_iconic_exception_RuntimeException('Unable to dump a service container if a parameter is an object or a resource.');
231
  }
262
  return sprintf('%%%s%%', $id);
263
  }
264
 
265
+ private function getExpressionCall($expression)
266
+ {
267
+ return sprintf('@=%s', $expression);
268
+ }
269
+
270
  /**
271
  * Prepares parameters.
272
  *
vendor/ehough/iconic/src/main/php/ehough/iconic/loader/PhpFileLoader.php CHANGED
@@ -13,7 +13,7 @@
13
  * PhpFileLoader loads service definitions from a PHP file.
14
  *
15
  * The PHP file is required and the $container variable can be
16
- * used form the file to change the container.
17
  *
18
  * @author Fabien Potencier <fabien@symfony.com>
19
  */
13
  * PhpFileLoader loads service definitions from a PHP file.
14
  *
15
  * The PHP file is required and the $container variable can be
16
+ * used within the file to change the container.
17
  *
18
  * @author Fabien Potencier <fabien@symfony.com>
19
  */
vendor/ehough/iconic/src/main/php/ehough/iconic/loader/XmlFileLoader.php CHANGED
@@ -29,7 +29,10 @@ class ehough_iconic_loader_XmlFileLoader extends ehough_iconic_loader_FileLoader
29
  $xml = $this->parseFile($path);
30
  $xml->registerXPathNamespace('container', 'http://symfony.com/schema/dic/services');
31
 
32
- $this->container->addResource(new \Symfony\Component\Config\Resource\FileResource($path));
 
 
 
33
 
34
  // anonymous services
35
  $this->processAnonymousServices($xml, $path);
@@ -195,7 +198,7 @@ class ehough_iconic_loader_XmlFileLoader extends ehough_iconic_loader_FileLoader
195
  protected function parseFile($file)
196
  {
197
  try {
198
- $dom = \Symfony\Component\Config\Util\XmlUtils::loadFile($file, array($this, 'validateSchema'));
199
  } catch (InvalidArgumentException $e) {
200
  throw new ehough_iconic_exception_InvalidArgumentException(sprintf('Unable to parse file "%s".', $file), $e->getCode(), $e);
201
  }
@@ -220,7 +223,7 @@ class ehough_iconic_loader_XmlFileLoader extends ehough_iconic_loader_FileLoader
220
  if (false !== $nodes = $xml->xpath('//container:argument[@type="service"][not(@id)]|//container:property[@type="service"][not(@id)]')) {
221
  foreach ($nodes as $node) {
222
  // give it a unique name
223
- $id = sprintf('%s_%d', md5($file), ++$count);
224
  $node['id'] = $id;
225
 
226
  $definitions[$id] = array($node->service, $file, false);
@@ -232,7 +235,7 @@ class ehough_iconic_loader_XmlFileLoader extends ehough_iconic_loader_FileLoader
232
  if (false !== $nodes = $xml->xpath('//container:services/container:service[not(@id)]')) {
233
  foreach ($nodes as $node) {
234
  // give it a unique name
235
- $id = sprintf('%s_%d', md5($file), ++$count);
236
  $node['id'] = $id;
237
 
238
  $definitions[$id] = array($node, $file, true);
@@ -250,7 +253,7 @@ class ehough_iconic_loader_XmlFileLoader extends ehough_iconic_loader_FileLoader
250
 
251
  $oNode = dom_import_simplexml($def[0]);
252
  if (true === $def[2]) {
253
- $nNode = new \DOMElement('_services');
254
  $oNode->parentNode->replaceChild($nNode, $oNode);
255
  $nNode->setAttribute('id', $id);
256
  } else {
@@ -268,7 +271,7 @@ class ehough_iconic_loader_XmlFileLoader extends ehough_iconic_loader_FileLoader
268
  *
269
  * @throws ehough_iconic_exception_RuntimeException When extension references a non-existent XSD file
270
  */
271
- public function validateSchema(\DOMDocument $dom)
272
  {
273
  $schemaLocations = array('http://symfony.com/schema/dic/services' => str_replace('\\', '/', dirname(__FILE__).'/schema/dic/services/services-1.0.xsd'));
274
 
@@ -339,16 +342,16 @@ EOF
339
  *
340
  * @throws ehough_iconic_exception_InvalidArgumentException When no extension is found corresponding to a tag
341
  */
342
- private function validateExtensions(\DOMDocument $dom, $file)
343
  {
344
  foreach ($dom->documentElement->childNodes as $node) {
345
- if (!$node instanceof \DOMElement || 'http://symfony.com/schema/dic/services' === $node->namespaceURI) {
346
  continue;
347
  }
348
 
349
  // can it be handled by an extension?
350
  if (!$this->container->hasExtension($node->namespaceURI)) {
351
- $extensionNamespaces = array_filter(array_map(function ($ext) { return $ext->getNamespace(); }, $this->container->getExtensions()));
352
  throw new ehough_iconic_exception_InvalidArgumentException(sprintf(
353
  'There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s',
354
  $node->tagName,
@@ -368,11 +371,11 @@ EOF
368
  private function loadFromExtensions(SimpleXMLElement $xml)
369
  {
370
  foreach (dom_import_simplexml($xml)->childNodes as $node) {
371
- if (!$node instanceof \DOMElement || $node->namespaceURI === 'http://symfony.com/schema/dic/services') {
372
  continue;
373
  }
374
 
375
- $values = static::convertDomElementToArray($node);
376
  if (!is_array($values)) {
377
  $values = array();
378
  }
@@ -382,7 +385,7 @@ EOF
382
  }
383
 
384
  /**
385
- * Converts a \DomElement object to a PHP array.
386
  *
387
  * The following rules applies during the conversion:
388
  *
@@ -400,8 +403,13 @@ EOF
400
  *
401
  * @return array A PHP array
402
  */
403
- public static function convertDomElementToArray(\DomElement $element)
 
 
 
 
 
404
  {
405
- return \Symfony\Component\Config\Util\XmlUtils::convertDomElementToArray($element);
406
  }
407
  }
29
  $xml = $this->parseFile($path);
30
  $xml->registerXPathNamespace('container', 'http://symfony.com/schema/dic/services');
31
 
32
+ $ref = new ReflectionClass('\Symfony\Component\Config\Resource\FileResource');
33
+ $fileResource = $ref->newInstanceArgs(array($path));
34
+
35
+ $this->container->addResource($fileResource);
36
 
37
  // anonymous services
38
  $this->processAnonymousServices($xml, $path);
198
  protected function parseFile($file)
199
  {
200
  try {
201
+ $dom = call_user_func(array('\Symfony\Component\Config\Util\XmlUtils', 'loadFile'), $file, array($this, 'validateSchema'));
202
  } catch (InvalidArgumentException $e) {
203
  throw new ehough_iconic_exception_InvalidArgumentException(sprintf('Unable to parse file "%s".', $file), $e->getCode(), $e);
204
  }
223
  if (false !== $nodes = $xml->xpath('//container:argument[@type="service"][not(@id)]|//container:property[@type="service"][not(@id)]')) {
224
  foreach ($nodes as $node) {
225
  // give it a unique name
226
+ $id = sprintf('%s_%d', hash('sha256', $file), ++$count);
227
  $node['id'] = $id;
228
 
229
  $definitions[$id] = array($node->service, $file, false);
235
  if (false !== $nodes = $xml->xpath('//container:services/container:service[not(@id)]')) {
236
  foreach ($nodes as $node) {
237
  // give it a unique name
238
+ $id = sprintf('%s_%d', hash('sha256', $file), ++$count);
239
  $node['id'] = $id;
240
 
241
  $definitions[$id] = array($node, $file, true);
253
 
254
  $oNode = dom_import_simplexml($def[0]);
255
  if (true === $def[2]) {
256
+ $nNode = new DOMElement('_services');
257
  $oNode->parentNode->replaceChild($nNode, $oNode);
258
  $nNode->setAttribute('id', $id);
259
  } else {
271
  *
272
  * @throws ehough_iconic_exception_RuntimeException When extension references a non-existent XSD file
273
  */
274
+ public function validateSchema(DOMDocument $dom)
275
  {
276
  $schemaLocations = array('http://symfony.com/schema/dic/services' => str_replace('\\', '/', dirname(__FILE__).'/schema/dic/services/services-1.0.xsd'));
277
 
342
  *
343
  * @throws ehough_iconic_exception_InvalidArgumentException When no extension is found corresponding to a tag
344
  */
345
+ private function validateExtensions(DOMDocument $dom, $file)
346
  {
347
  foreach ($dom->documentElement->childNodes as $node) {
348
+ if (!$node instanceof DOMElement || 'http://symfony.com/schema/dic/services' === $node->namespaceURI) {
349
  continue;
350
  }
351
 
352
  // can it be handled by an extension?
353
  if (!$this->container->hasExtension($node->namespaceURI)) {
354
+ $extensionNamespaces = array_filter(array_map(array($this, '__callbackFilterValidateExtensions'), $this->container->getExtensions()));
355
  throw new ehough_iconic_exception_InvalidArgumentException(sprintf(
356
  'There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s',
357
  $node->tagName,
371
  private function loadFromExtensions(SimpleXMLElement $xml)
372
  {
373
  foreach (dom_import_simplexml($xml)->childNodes as $node) {
374
+ if (!$node instanceof DOMElement || $node->namespaceURI === 'http://symfony.com/schema/dic/services') {
375
  continue;
376
  }
377
 
378
+ $values = self::convertDomElementToArray($node);
379
  if (!is_array($values)) {
380
  $values = array();
381
  }
385
  }
386
 
387
  /**
388
+ * Converts a DomElement object to a PHP array.
389
  *
390
  * The following rules applies during the conversion:
391
  *
403
  *
404
  * @return array A PHP array
405
  */
406
+ public static function convertDomElementToArray(DomElement $element)
407
+ {
408
+ return call_user_func(array('\Symfony\Component\Config\Util\XmlUtils', 'convertDomElementToArray'), $element);
409
+ }
410
+
411
+ public function __callbackFilterValidateExtensions($ext)
412
  {
413
+ return $ext->getNamespace();
414
  }
415
  }
vendor/ehough/iconic/src/main/php/ehough/iconic/loader/YamlFileLoader.php CHANGED
@@ -213,8 +213,8 @@ class ehough_iconic_loader_YamlFileLoader extends ehough_iconic_loader_FileLoade
213
  unset($tag['name']);
214
 
215
  foreach ($tag as $attribute => $value) {
216
- if (!is_scalar($value)) {
217
- throw new ehough_iconic_exception_InvalidArgumentException(sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s" in %s.', $id, $name, $file));
218
  }
219
  }
220
 
@@ -300,6 +300,9 @@ class ehough_iconic_loader_YamlFileLoader extends ehough_iconic_loader_FileLoade
300
  {
301
  if (is_array($value)) {
302
  $value = array_map(array($this, 'resolveServices'), $value);
 
 
 
303
  } elseif (is_string($value) && 0 === strpos($value, '@')) {
304
  if (0 === strpos($value, '@@')) {
305
  $value = substr($value, 1);
213
  unset($tag['name']);
214
 
215
  foreach ($tag as $attribute => $value) {
216
+ if (!is_scalar($value) && null !== $value) {
217
+ throw new ehough_iconic_exception_InvalidArgumentException(sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s", attribute "%s" in %s.', $id, $name, $attribute, $file));
218
  }
219
  }
220
 
300
  {
301
  if (is_array($value)) {
302
  $value = array_map(array($this, 'resolveServices'), $value);
303
+ } elseif (is_string($value) && 0 === strpos($value, '@=')) {
304
+ $ref = new ReflectionClass('Symfony\Component\ExpressionLanguage\Expression');
305
+ return $ref->newInstance(substr($value, 2));
306
  } elseif (is_string($value) && 0 === strpos($value, '@')) {
307
  if (0 === strpos($value, '@@')) {
308
  $value = substr($value, 1);
vendor/ehough/iconic/src/main/php/ehough/iconic/loader/schema/dic/services/services-1.0.xsd CHANGED
@@ -164,6 +164,7 @@
164
  <xsd:restriction base="xsd:string">
165
  <xsd:enumeration value="collection" />
166
  <xsd:enumeration value="service" />
 
167
  <xsd:enumeration value="string" />
168
  <xsd:enumeration value="constant" />
169
  </xsd:restriction>
164
  <xsd:restriction base="xsd:string">
165
  <xsd:enumeration value="collection" />
166
  <xsd:enumeration value="service" />
167
+ <xsd:enumeration value="expression" />
168
  <xsd:enumeration value="string" />
169
  <xsd:enumeration value="constant" />
170
  </xsd:restriction>
vendor/ehough/iconic/src/main/php/ehough/iconic/parameterbag/ParameterBag.php CHANGED
@@ -18,8 +18,8 @@
18
  */
19
  class ehough_iconic_parameterbag_ParameterBag implements ehough_iconic_parameterbag_ParameterBagInterface
20
  {
21
- protected $parameters;
22
- protected $resolved;
23
 
24
  private $_resolving = array();
25
  private $_value = array();
@@ -33,9 +33,7 @@ class ehough_iconic_parameterbag_ParameterBag implements ehough_iconic_parameter
33
  */
34
  public function __construct(array $parameters = array())
35
  {
36
- $this->parameters = array();
37
  $this->add($parameters);
38
- $this->resolved = false;
39
  }
40
 
41
  /**
18
  */
19
  class ehough_iconic_parameterbag_ParameterBag implements ehough_iconic_parameterbag_ParameterBagInterface
20
  {
21
+ protected $parameters = array();
22
+ protected $resolved = false;
23
 
24
  private $_resolving = array();
25
  private $_value = array();
33
  */
34
  public function __construct(array $parameters = array())
35
  {
 
36
  $this->add($parameters);
 
37
  }
38
 
39
  /**
vendor/ehough/pulsar/src/main/php/ehough/pulsar/ClassCollectionLoader.php CHANGED
@@ -51,7 +51,7 @@ class ehough_pulsar_ClassCollectionLoader
51
  $classes = array_diff($classes, $declared);
52
 
53
  // the cache is different depending on which classes are already declared
54
- $name = $name.'-'.substr(md5(implode('|', $classes)), 0, 5);
55
  }
56
 
57
  $classes = array_unique($classes);
51
  $classes = array_diff($classes, $declared);
52
 
53
  // the cache is different depending on which classes are already declared
54
+ $name = $name.'-'.substr(hash('sha256', implode('|', $classes)), 0, 5);
55
  }
56
 
57
  $classes = array_unique($classes);
vendor/ehough/pulsar/src/main/php/ehough/pulsar/DebugClassLoader.php CHANGED
@@ -20,6 +20,8 @@
20
  * @author Christophe Coevoet <stof@notk.org>
21
  *
22
  * @api
 
 
23
  */
24
  class ehough_pulsar_DebugClassLoader
25
  {
20
  * @author Christophe Coevoet <stof@notk.org>
21
  *
22
  * @api
23
+ *
24
+ * @deprecated Deprecated since version 2.4, to be removed in 3.0. Use the DebugClassLoader provided by the Debug component instead.
25
  */
26
  class ehough_pulsar_DebugClassLoader
27
  {
vendor/ehough/stash/README.md CHANGED
@@ -5,7 +5,7 @@ Fork of [tedivm/Stash](https://github.com/tedivm/Stash) compatible with PHP 5.2+
5
  ### Motivation
6
 
7
  `tedivm/Stash` is a fantastic caching library, but it's only compatible with PHP 5.3+. While 97% of PHP servers run PHP 5.2 or higher,
8
- a whopping **47% of all servers are still running PHP 5.2** ([source](http://w3techs.com/technologies/details/pl-php/5/all)).
9
  It would be a shame to exempt this library from nearly half of the world's servers just because of a few version incompatibilities.
10
 
11
  Once PHP 5.3+ adoption levels near closer to 100%, this library will be retired.
@@ -24,3 +24,8 @@ A few examples of class naming conversions:
24
  ### Usage
25
 
26
  Visit [stash.tedivm.com](http://stash.tedivm.com) for the current documentation.
 
 
 
 
 
5
  ### Motivation
6
 
7
  `tedivm/Stash` is a fantastic caching library, but it's only compatible with PHP 5.3+. While 97% of PHP servers run PHP 5.2 or higher,
8
+ **32% of all servers are still running PHP 5.2 or lower** ([source](http://w3techs.com/technologies/details/pl-php/5/all)).
9
  It would be a shame to exempt this library from nearly half of the world's servers just because of a few version incompatibilities.
10
 
11
  Once PHP 5.3+ adoption levels near closer to 100%, this library will be retired.
24
  ### Usage
25
 
26
  Visit [stash.tedivm.com](http://stash.tedivm.com) for the current documentation.
27
+
28
+ ### Releases and Versioning
29
+
30
+ Releases are synchronized with the upstream tedivm repository. e.g. `ehough/stash v0.10.5` has merged the code
31
+ from `tedivm/Stash v0.10.5`.
vendor/ehough/stash/composer.json CHANGED
@@ -5,8 +5,6 @@
5
  "keywords": [
6
  "cache",
7
  "caching",
8
- "performance",
9
- "scalability",
10
  "sessions",
11
  "memcached",
12
  "redis",
5
  "keywords": [
6
  "cache",
7
  "caching",
 
 
8
  "sessions",
9
  "memcached",
10
  "redis",
vendor/ehough/stash/src/main/php/ehough/stash/Drivers.php CHANGED
@@ -33,13 +33,12 @@ class ehough_stash_Drivers
33
  'Xcache' => 'ehough_stash_driver_Xcache',
34
  );
35
 
36
-
37
  /**
38
  * Returns a list of build-in cache drivers that are also supported by this system.
39
  *
40
  * @return array Driver Name => Class Name
41
  */
42
- static function getDrivers()
43
  {
44
  $availableDrivers = array();
45
  foreach (self::$drivers as $name => $class) {
@@ -47,14 +46,14 @@ class ehough_stash_Drivers
47
  continue;
48
  }
49
 
50
- if (!in_array('ehough_stash_driver_DriverInterface', class_implements($class))) {
51
  continue;
52
  }
53
 
54
- if($name == 'Composite') {
55
  $availableDrivers[$name] = $class;
56
  } else {
57
- if(call_user_func(array($class, 'isAvailable'))) {
58
  $availableDrivers[$name] = $class;
59
  }
60
  }
@@ -63,12 +62,12 @@ class ehough_stash_Drivers
63
  return $availableDrivers;
64
  }
65
 
66
- static function registerDriver($name, $class)
67
  {
68
  self::$drivers[$name] = $class;
69
  }
70
 
71
- static function getDriverClass($name)
72
  {
73
  if (!isset(self::$drivers[$name])) {
74
  return false;
33
  'Xcache' => 'ehough_stash_driver_Xcache',
34
  );
35
 
 
36
  /**
37
  * Returns a list of build-in cache drivers that are also supported by this system.
38
  *
39
  * @return array Driver Name => Class Name
40
  */
41
+ public static function getDrivers()
42
  {
43
  $availableDrivers = array();
44
  foreach (self::$drivers as $name => $class) {
46
  continue;
47
  }
48
 
49
+ if (!in_array('ehough_stash_interfaces_DriverInterface', class_implements($class))) {
50
  continue;
51
  }
52
 
53
+ if ($name == 'Composite') {
54
  $availableDrivers[$name] = $class;
55
  } else {
56
+ if (call_user_func(array($class, 'isAvailable'))) {
57
  $availableDrivers[$name] = $class;
58
  }
59
  }
62
  return $availableDrivers;
63
  }
64
 
65
+ public static function registerDriver($name, $class)
66
  {
67
  self::$drivers[$name] = $class;
68
  }
69
 
70
+ public static function getDriverClass($name)
71
  {
72
  if (!isset(self::$drivers[$name])) {
73
  return false;
vendor/ehough/stash/src/main/php/ehough/stash/Item.php CHANGED
@@ -17,7 +17,7 @@
17
  * @package Stash
18
  * @author Robert Hafner <tedivm@tedivm.com>
19
  */
20
- class ehough_stash_Item implements ehough_stash_ItemInterface
21
  {
22
  const SP_NONE = 0;
23
  const SP_OLD = 1;
@@ -30,7 +30,7 @@ class ehough_stash_Item implements ehough_stash_ItemInterface
30
  *
31
  * @var int seconds
32
  */
33
- static public $cacheTime = 432000; // five days
34
 
35
  /**
36
  * Disables the cache system wide. It is used internally when the storage engine fails or if the cache is being
@@ -38,8 +38,7 @@ class ehough_stash_Item implements ehough_stash_ItemInterface
38
  *
39
  * @var bool
40
  */
41
- static $runtimeDisable = false;
42
-
43
 
44
  /**
45
  * Used internally to mark the class as disabled. Unlike the static runtimeDisable flag this is effective only for
@@ -85,10 +84,18 @@ class ehough_stash_Item implements ehough_stash_ItemInterface
85
  * The cacheDriver being used by the system. While this class handles all of the higher functions, it's the cache
86
  * driver here that handles all of the storage/retrieval functionality. This value is set by the constructor.
87
  *
88
- * @var ehough_stash_driver_DriverInterface
89
  */
90
  protected $driver;
91
 
 
 
 
 
 
 
 
 
92
  /**
93
  * This is a flag to see if a valid response is returned. It is set by the getData function and is used by the
94
  * isMiss function.
@@ -102,9 +109,9 @@ class ehough_stash_Item implements ehough_stash_ItemInterface
102
  * creating new ehough_stash_Item objects. It should not be called directly.
103
  *
104
  * @internal
105
- * @param ehough_stash_driver_DriverInterface If no driver is passed the cache is set to script time only.
106
  */
107
- public function __construct(ehough_stash_driver_DriverInterface $driver, $key)
108
  {
109
  $this->driver = $driver;
110
  $this->setupKey($key);
@@ -119,6 +126,7 @@ class ehough_stash_Item implements ehough_stash_ItemInterface
119
  public function disable()
120
  {
121
  $this->cacheEnabled = false;
 
122
  return true;
123
  }
124
 
@@ -149,7 +157,9 @@ class ehough_stash_Item implements ehough_stash_ItemInterface
149
  try {
150
  return $this->executeClear();
151
  } catch (ehough_stash_exception_Exception $e) {
 
152
  $this->disable();
 
153
  return false;
154
  }
155
  }
@@ -177,7 +187,9 @@ class ehough_stash_Item implements ehough_stash_ItemInterface
177
  try {
178
  return $this->executeGet($invalidation, $arg, $arg2);
179
  } catch (ehough_stash_exception_Exception $e) {
 
180
  $this->disable();
 
181
  return null;
182
  }
183
  }
@@ -259,11 +271,12 @@ class ehough_stash_Item implements ehough_stash_ItemInterface
259
 
260
  $this->stampedeRunning = true;
261
 
262
- $expiration = isset($ttl) && is_numeric($ttl) ? (int)$ttl : $this->defaults['stampede_ttl'];
263
 
264
 
265
  $spkey = $this->key;
266
  $spkey[0] = 'sp';
 
267
  return $this->driver->storeData($spkey, true, time() + $expiration);
268
  }
269
 
@@ -272,16 +285,18 @@ class ehough_stash_Item implements ehough_stash_ItemInterface
272
  * including arrays and object, except resources and objects which are
273
  * unable to be serialized.
274
  *
275
- * @param mixed $data bool
276
- * @param int|DateTime|null $ttl Int is time (seconds), DateTime a future expiration date
277
- * @return bool Returns whether the object was successfully stored or not.
278
  */
279
- public function set($data = null, $ttl = null)
280
  {
281
  try {
282
  return $this->executeSet($data, $ttl);
283
  } catch (ehough_stash_exception_Exception $e) {
 
284
  $this->disable();
 
285
  return false;
286
  }
287
  }
@@ -313,7 +328,6 @@ class ehough_stash_Item implements ehough_stash_ItemInterface
313
  $expiration = $store['createdOn'] + $cacheTime;
314
 
315
  if ($cacheTime > 0) {
316
- $diff = $cacheTime * 0.15;
317
  $expirationDiff = rand(0, floor($cacheTime * .15));
318
  $expiration -= $expirationDiff;
319
  }
@@ -334,17 +348,19 @@ class ehough_stash_Item implements ehough_stash_ItemInterface
334
  *
335
  * @return bool
336
  */
337
- public function extendCache()
338
  {
339
  if ($this->isDisabled()) {
340
  return false;
341
  }
342
 
343
- return $this->set($this->get());
344
  }
345
 
346
  /**
347
  * Return true if caching is disabled
 
 
348
  */
349
  public function isDisabled()
350
  {
@@ -353,6 +369,26 @@ class ehough_stash_Item implements ehough_stash_ItemInterface
353
  || (defined('STASH_DISABLE_CACHE') && STASH_DISABLE_CACHE);
354
  }
355
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
356
 
357
  /**
358
  * Returns true if another ehough_stash_Item is currently recalculating the cache.
@@ -371,12 +407,12 @@ class ehough_stash_Item implements ehough_stash_ItemInterface
371
  $sp = false;
372
  }
373
  }
 
374
  return $sp;
375
  }
376
 
377
  /**
378
- * Returns the record for the current key, whether that record is pulled from memory or a driver. If there is no
379
- * record than an empty array is returned.
380
  *
381
  * @return array
382
  */
@@ -395,8 +431,10 @@ class ehough_stash_Item implements ehough_stash_ItemInterface
395
  * Decides whether the current data is fresh according to the supplied validation technique. As some techniques
396
  * actively change the record this function takes that in as a reference.
397
  *
 
 
398
  * @param array $validation
399
- * @param array $record
400
  */
401
  protected function validateRecord($validation, &$record)
402
  {
@@ -424,7 +462,7 @@ class ehough_stash_Item implements ehough_stash_ItemInterface
424
  // If stampede control is on it means another cache is already processing, so we return
425
  // true for the hit.
426
  if ($ttl < $time) {
427
- $this->isHit = (bool)$this->getStampedeFlag($this->key);
428
  }
429
  }
430
 
@@ -434,11 +472,13 @@ class ehough_stash_Item implements ehough_stash_ItemInterface
434
 
435
  if (!isset($invalidation) || $invalidation == self::SP_NONE) {
436
  $this->isHit = false;
 
437
  return;
438
  }
439
 
440
  if (!$this->getStampedeFlag($this->key)) {
441
  $this->isHit = false;
 
442
  return;
443
  }
444
 
17
  * @package Stash
18
  * @author Robert Hafner <tedivm@tedivm.com>
19
  */
20
+ class ehough_stash_Item implements ehough_stash_interfaces_ItemInterface
21
  {
22
  const SP_NONE = 0;
23
  const SP_OLD = 1;
30
  *
31
  * @var int seconds
32
  */
33
+ public static $cacheTime = 432000; // five days
34
 
35
  /**
36
  * Disables the cache system wide. It is used internally when the storage engine fails or if the cache is being
38
  *
39
  * @var bool
40
  */
41
+ public static $runtimeDisable = false;
 
42
 
43
  /**
44
  * Used internally to mark the class as disabled. Unlike the static runtimeDisable flag this is effective only for
84
  * The cacheDriver being used by the system. While this class handles all of the higher functions, it's the cache
85
  * driver here that handles all of the storage/retrieval functionality. This value is set by the constructor.
86
  *
87
+ * @var ehough_stash_interfaces_DriverInterface
88
  */
89
  protected $driver;
90
 
91
+ /**
92
+ * If set various then errors and exceptions will get passed to the PSR Compliant logging library. This
93
+ * can be set using the setLogger() function in this class.
94
+ *
95
+ * @var Psr\Log\LoggerInterface
96
+ */
97
+ protected $logger;
98
+
99
  /**
100
  * This is a flag to see if a valid response is returned. It is set by the getData function and is used by the
101
  * isMiss function.
109
  * creating new ehough_stash_Item objects. It should not be called directly.
110
  *
111
  * @internal
112
+ * @param ehough_stash_interfaces_DriverInterface If no driver is passed the cache is set to script time only.
113
  */
114
+ public function __construct(ehough_stash_interfaces_DriverInterface $driver, $key)
115
  {
116
  $this->driver = $driver;
117
  $this->setupKey($key);
126
  public function disable()
127
  {
128
  $this->cacheEnabled = false;
129
+
130
  return true;
131
  }
132
 
157
  try {
158
  return $this->executeClear();
159
  } catch (ehough_stash_exception_Exception $e) {
160
+ $this->logException('Clearing cache caused exception.', $e);
161
  $this->disable();
162
+
163
  return false;
164
  }
165
  }
187
  try {
188
  return $this->executeGet($invalidation, $arg, $arg2);
189
  } catch (ehough_stash_exception_Exception $e) {
190
+ $this->logException('Retrieving from cache caused exception.', $e);
191
  $this->disable();
192
+
193
  return null;
194
  }
195
  }
271
 
272
  $this->stampedeRunning = true;
273
 
274
+ $expiration = isset($ttl) && is_numeric($ttl) ? (int) $ttl : $this->defaults['stampede_ttl'];
275
 
276
 
277
  $spkey = $this->key;
278
  $spkey[0] = 'sp';
279
+
280
  return $this->driver->storeData($spkey, true, time() + $expiration);
281
  }
282
 
285
  * including arrays and object, except resources and objects which are
286
  * unable to be serialized.
287
  *
288
+ * @param mixed $data bool
289
+ * @param int|DateTime|null $ttl Int is time (seconds), DateTime a future expiration date
290
+ * @return bool Returns whether the object was successfully stored or not.
291
  */
292
+ public function set($data, $ttl = null)
293
  {
294
  try {
295
  return $this->executeSet($data, $ttl);
296
  } catch (ehough_stash_exception_Exception $e) {
297
+ $this->logException('Setting value in cache caused exception.', $e);
298
  $this->disable();
299
+
300
  return false;
301
  }
302
  }
328
  $expiration = $store['createdOn'] + $cacheTime;
329
 
330
  if ($cacheTime > 0) {
 
331
  $expirationDiff = rand(0, floor($cacheTime * .15));
332
  $expiration -= $expirationDiff;
333
  }
348
  *
349
  * @return bool
350
  */
351
+ public function extend($ttl = null)
352
  {
353
  if ($this->isDisabled()) {
354
  return false;
355
  }
356
 
357
+ return $this->set($this->get(), $ttl);
358
  }
359
 
360
  /**
361
  * Return true if caching is disabled
362
+ *
363
+ * @return bool True if caching is disabled.
364
  */
365
  public function isDisabled()
366
  {
369
  || (defined('STASH_DISABLE_CACHE') && STASH_DISABLE_CACHE);
370
  }
371
 
372
+ /**
373
+ * Return true if caching is disabled
374
+ */
375
+ public function setLogger($logger)
376
+ {
377
+ $this->logger = $logger;
378
+ }
379
+
380
+ protected function logException($message, $exception)
381
+ {
382
+ if(!isset($this->logger))
383
+
384
+ return false;
385
+
386
+ $this->logger->critical($message,
387
+ array('exception' => $exception,
388
+ 'key' => $this->keyString));
389
+
390
+ return true;
391
+ }
392
 
393
  /**
394
  * Returns true if another ehough_stash_Item is currently recalculating the cache.
407
  $sp = false;
408
  }
409
  }
410
+
411
  return $sp;
412
  }
413
 
414
  /**
415
+ * Returns the record for the current key. If there is no record than an empty array is returned.
 
416
  *
417
  * @return array
418
  */
431
  * Decides whether the current data is fresh according to the supplied validation technique. As some techniques
432
  * actively change the record this function takes that in as a reference.
433
  *
434
+ * This function has the ability to change the isHit property as well as the record passed.
435
+ *
436
  * @param array $validation
437
+ * @param array $&record
438
  */
439
  protected function validateRecord($validation, &$record)
440
  {
462
  // If stampede control is on it means another cache is already processing, so we return
463
  // true for the hit.
464
  if ($ttl < $time) {
465
+ $this->isHit = (bool) $this->getStampedeFlag($this->key);
466
  }
467
  }
468
 
472
 
473
  if (!isset($invalidation) || $invalidation == self::SP_NONE) {
474
  $this->isHit = false;
475
+
476
  return;
477
  }
478
 
479
  if (!$this->getStampedeFlag($this->key)) {
480
  $this->isHit = false;
481
+
482
  return;
483
  }
484
 
vendor/ehough/stash/src/main/php/ehough/stash/ItemInterface.php DELETED
@@ -1,88 +0,0 @@
1
- <?php
2
- /*
3
- * This file is part of the ehough/stash package.
4
- *
5
- * (c) Eric D. Hough <eric@tubepress.org>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
-
11
- /**
12
- * Cache\Item defines an interface for interacting with objects inside a cache.
13
- *
14
- * The Cache\Item interface defines an item inside a cache system, which can be
15
- * filled with any PHP value capable of being serialized. Each item Cache\Item
16
- * should be associated with a specific key, which can be set according to the
17
- * implementing system and is typically passed by the Cache\Pool object.
18
- */
19
- interface ehough_stash_ItemInterface
20
- {
21
- /**
22
- * Returns the key for the current cache item.
23
- *
24
- * The key is loaded by the Implementing Library, but should be available to
25
- * the higher level callers when needed.
26
- *
27
- * @return string
28
- */
29
- function getKey();
30
-
31
- /**
32
- * Retrieves the item from the cache associated with this objects key.
33
- *
34
- * Value returned must be identical to the value original stored by set().
35
- *
36
- * If the cache is empty then null should be returned. However, null is also
37
- * a valid cache item, so the isMiss function should be used to check
38
- * validity.
39
- *
40
- * @return mixed
41
- */
42
- function get();
43
-
44
- /**
45
- * Stores a value into the cache.
46
- *
47
- * The $value argument can be any item that can be serialized by PHP,
48
- * although the method of serialization is left up to the Implementing
49
- * Library.
50
- *
51
- * The $ttl can be defined in a number of ways. As an integer or
52
- * DateInverval object the argument defines how long before the cache should
53
- * expire. As a DateTime object the argument defines the actual expiration
54
- * time of the object. Implementations are allowed to use a lower time than
55
- * passed, but should not use a longer one.
56
- *
57
- * If no $ttl is passed then the item can be stored indefinitely or a
58
- * default value can be set by the Implementing Library.
59
- *
60
- * Returns true if the item was successfully stored.
61
- *
62
- * @param mixed $value
63
- * @param int|DateInterval|DateTime $ttl
64
- * @return bool
65
- */
66
- function set($value = null, $ttl = null);
67
-
68
- /**
69
- * Validates the current state of the item in the cache.
70
- *
71
- * Checks the validity of a cache result. If the object is good (is not a
72
- * miss, and meets all the standards set by the Implementing Library) then
73
- * this function returns true.
74
- *
75
- * @return bool
76
- */
77
- function isValid();
78
-
79
- /**
80
- * Removes the current key from the cache.
81
- *
82
- * Returns true if the item is no longer present (either because it was
83
- * removed or was not present to begin with).
84
- *
85
- * @return bool
86
- */
87
- function remove();
88
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/ehough/stash/src/main/php/ehough/stash/Pool.php CHANGED
@@ -15,53 +15,113 @@
15
  * @package Stash
16
  * @author Robert Hafner <tedivm@tedivm.com>
17
  */
18
- class ehough_stash_Pool implements ehough_stash_PoolInterface
19
  {
 
 
 
 
 
 
 
20
  protected $driver;
 
 
21
  protected $isDisabled = false;
22
 
 
 
 
 
 
 
 
 
 
 
 
23
  /**
24
  * The constructor takes a Driver class which is used for persistent
25
  * storage. If no driver is provided then the ehough_stash_driver_Ephemeral driver is used by
26
  * default.
27
  *
28
- * @param ehough_stash_driver_DriverInterface $driver
29
  */
30
- function __construct(ehough_stash_driver_DriverInterface $driver = null)
31
  {
32
  if (isset($driver)) {
33
  $this->setDriver($driver);
 
 
34
  }
35
  }
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  /**
38
  * Takes the same arguments as the Stash->setupKey() function and returns with a new Stash object. If a driver
39
  * has been set for this class then it is used, otherwise the Stash object will be set to use script memory only.
40
  *
41
  * @example $cache = $pool->getItem('permissions', 'user', '4', '2');
42
  *
43
- * @param string|array $key, $key, $key...
44
- * @return ehough_stash_Item
45
  */
46
- function getItem($key)
47
  {
48
  $args = func_get_args();
49
  $argCount = count($args);
50
 
51
  if ($argCount < 1) {
52
- throw new ehough_stash_exception_InvalidArgumentException('Item constructor requires valid key.');
53
  }
 
54
  // check to see if a single array was used instead of multiple arguments
55
  if ($argCount == 1 && is_array($args[0])) {
56
  $args = $args[0];
 
57
  }
58
 
59
- $driver = $this->getDriver();
60
- $cache = new ehough_stash_Item($this->driver, $args);
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
  if($this->isDisabled)
63
  $cache->disable();
64
 
 
 
 
65
  return $cache;
66
  }
67
 
@@ -71,16 +131,15 @@ class ehough_stash_Pool implements ehough_stash_PoolInterface
71
  * Bulk lookups can often by streamlined by backend cache systems. The
72
  * returned iterator will contain a Stash\Item for each key passed.
73
  *
74
- * @param array $keys
75
  * @return Iterator
76
  */
77
- function getItemIterator($keys)
78
  {
79
  // temporarily cheating here by wrapping around single calls.
80
 
81
  $items = array();
82
- foreach($keys as $key)
83
- {
84
  $items[] = $this->getItem($key);
85
  }
86
 
@@ -97,17 +156,21 @@ class ehough_stash_Pool implements ehough_stash_PoolInterface
97
  *
98
  * @return bool success
99
  */
100
- function flush()
101
  {
102
  if($this->isDisabled)
 
103
  return false;
104
 
105
- try{
106
  $results = $this->getDriver()->clear();
107
- }catch(Exception $e){
108
  $this->isDisabled = true;
 
 
109
  return false;
110
  }
 
111
  return $results;
112
  }
113
 
@@ -122,17 +185,21 @@ class ehough_stash_Pool implements ehough_stash_PoolInterface
122
  *
123
  * @return bool success
124
  */
125
- function purge()
126
  {
127
  if($this->isDisabled)
 
128
  return false;
129
 
130
- try{
131
  $results = $this->getDriver()->purge();
132
- }catch(Exception $e){
133
  $this->isDisabled = true;
 
 
134
  return false;
135
  }
 
136
  return $results;
137
  }
138
 
@@ -140,18 +207,37 @@ class ehough_stash_Pool implements ehough_stash_PoolInterface
140
  * Sets a driver for each Stash object created by this class. This allows
141
  * the drivers to be created just once and reused, making it much easier to incorporate caching into any code.
142
  *
143
- * @param ehough_stash_driver_DriverInterface $driver
144
  */
145
- function setDriver(ehough_stash_driver_DriverInterface $driver)
146
  {
147
  $this->driver = $driver;
148
  }
149
 
150
- function getDriver()
151
  {
152
  if(!isset($this->driver))
153
  $this->driver = new ehough_stash_driver_Ephemeral();
154
 
155
  return $this->driver;
156
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  }
15
  * @package Stash
16
  * @author Robert Hafner <tedivm@tedivm.com>
17
  */
18
+ class ehough_stash_Pool implements ehough_stash_interfaces_PoolInterface
19
  {
20
+
21
+ /**
22
+ * The cacheDriver being used by the system. While this class handles all of the higher functions, it's the cache
23
+ * driver here that handles all of the storage/retrieval functionality. This value is set by the constructor.
24
+ *
25
+ * @var ehough_stash_interfaces_DriverInterface
26
+ */
27
  protected $driver;
28
+
29
+
30
  protected $isDisabled = false;
31
 
32
+ /**
33
+ * If set various then errors and exceptions will get passed to the PSR Compliant logging library. This
34
+ * can be set using the setLogger() function in this class.
35
+ *
36
+ * @var Psr\Log\LoggerInterface
37
+ */
38
+ protected $logger;
39
+
40
+ protected $itemClass = 'ehough_stash_Item';
41
+
42
+
43
  /**
44
  * The constructor takes a Driver class which is used for persistent
45
  * storage. If no driver is provided then the ehough_stash_driver_Ephemeral driver is used by
46
  * default.
47
  *
48
+ * @param ehough_stash_interfaces_DriverInterface $driver
49
  */
50
+ public function __construct(ehough_stash_interfaces_DriverInterface $driver = null)
51
  {
52
  if (isset($driver)) {
53
  $this->setDriver($driver);
54
+ } else {
55
+ $this->driver = new ehough_stash_driver_Ephemeral();
56
  }
57
  }
58
 
59
+ /**
60
+ * Changes the specific Item class generated by the Pool object.
61
+ *
62
+ * Using this function developers can have the pool class generate custom
63
+ * Item objects.
64
+ *
65
+ * @param string $class
66
+ */
67
+ public function setItemClass($class)
68
+ {
69
+ if(!class_exists($class))
70
+ throw new InvalidArgumentException('Item class ' . $class
71
+ . ' does not exist');
72
+
73
+ if(!($class instanceof ehough_stash_interfaces_ItemInterface))
74
+ throw new InvalidArgumentException('Item class ' . $class
75
+ . ' must inherit from ehough_stash_interfaces_ItemInterface');
76
+
77
+ $this->itemClass = $class;
78
+ }
79
+
80
  /**
81
  * Takes the same arguments as the Stash->setupKey() function and returns with a new Stash object. If a driver
82
  * has been set for this class then it is used, otherwise the Stash object will be set to use script memory only.
83
  *
84
  * @example $cache = $pool->getItem('permissions', 'user', '4', '2');
85
  *
86
+ * @param string|array $key, $key, $key...
87
+ * @return ehough_stash_interfaces_ItemInterface
88
  */
89
+ public function getItem()
90
  {
91
  $args = func_get_args();
92
  $argCount = count($args);
93
 
94
  if ($argCount < 1) {
95
+ throw new InvalidArgumentException('Item constructor requires a key.');
96
  }
97
+
98
  // check to see if a single array was used instead of multiple arguments
99
  if ($argCount == 1 && is_array($args[0])) {
100
  $args = $args[0];
101
+ $argCount = count($args);
102
  }
103
 
104
+ if ($argCount == 1) {
105
+ $keyString = trim($args[0], '/');
106
+ $key = explode('/', $keyString);
107
+ } else {
108
+ $key = $args;
109
+ }
110
+
111
+ foreach ($key as $node) {
112
+ if (strlen($node) < 1) {
113
+ throw new InvalidArgumentException('Invalid or Empty Node passed to getItem constructor.');
114
+ }
115
+ }
116
+
117
+ $cache = new $this->itemClass($this->driver, $key);
118
 
119
  if($this->isDisabled)
120
  $cache->disable();
121
 
122
+ if(isset($this->logger))
123
+ $cache->setLogger($this->logger);
124
+
125
  return $cache;
126
  }
127
 
131
  * Bulk lookups can often by streamlined by backend cache systems. The
132
  * returned iterator will contain a Stash\Item for each key passed.
133
  *
134
+ * @param array $keys
135
  * @return Iterator
136
  */
137
+ public function getItemIterator($keys)
138
  {
139
  // temporarily cheating here by wrapping around single calls.
140
 
141
  $items = array();
142
+ foreach ($keys as $key) {
 
143
  $items[] = $this->getItem($key);
144
  }
145
 
156
  *
157
  * @return bool success
158
  */
159
+ public function flush()
160
  {
161
  if($this->isDisabled)
162
+
163
  return false;
164
 
165
+ try {
166
  $results = $this->getDriver()->clear();
167
+ } catch(Exception $e){
168
  $this->isDisabled = true;
169
+ $this->logException('Flushing Cache Pool caused exception.', $e);
170
+
171
  return false;
172
  }
173
+
174
  return $results;
175
  }
176
 
185
  *
186
  * @return bool success
187
  */
188
+ public function purge()
189
  {
190
  if($this->isDisabled)
191
+
192
  return false;
193
 
194
+ try {
195
  $results = $this->getDriver()->purge();
196
+ } catch(Exception $e){
197
  $this->isDisabled = true;
198
+ $this->logException('Purging Cache Pool caused exception.', $e);
199
+
200
  return false;
201
  }
202
+
203
  return $results;
204
  }
205
 
207
  * Sets a driver for each Stash object created by this class. This allows
208
  * the drivers to be created just once and reused, making it much easier to incorporate caching into any code.
209
  *
210
+ * @param ehough_stash_interfaces_DriverInterface $driver
211
  */
212
+ public function setDriver(ehough_stash_interfaces_DriverInterface $driver)
213
  {
214
  $this->driver = $driver;
215
  }
216
 
217
+ public function getDriver()
218
  {
219
  if(!isset($this->driver))
220
  $this->driver = new ehough_stash_driver_Ephemeral();
221
 
222
  return $this->driver;
223
  }
224
+
225
+ /**
226
+ * Return true if caching is disabled
227
+ */
228
+ public function setLogger($logger)
229
+ {
230
+ $this->logger = $logger;
231
+ }
232
+
233
+ protected function logException($message, $exception)
234
+ {
235
+ if(!isset($this->logger))
236
+ return false;
237
+
238
+ $this->logger->critical($message,
239
+ array('exception' => $exception));
240
+
241
+ return true;
242
+ }
243
  }
vendor/ehough/stash/src/main/php/ehough/stash/PoolInterface.php DELETED
@@ -1,47 +0,0 @@
1
- <?php
2
- /*
3
- * This file is part of the ehough/stash package.
4
- *
5
- * (c) Eric D. Hough <eric@tubepress.org>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
-
11
- /**
12
- * Cache\Pool generates Cache\Item objects.
13
- */
14
- interface ehough_stash_PoolInterface
15
- {
16
- /**
17
- * Returns objects which implement the Cache\Item interface.
18
- *
19
- * Provided key must be unique for each item in the cache. Implementing
20
- * Libraries are responsible for any encoding or escaping required by their
21
- * backends, but must be able to supply the original key if needed. Keys
22
- * should not contain the special characters listed:
23
- * {}()/\@
24
- *
25
- * @param string $key
26
- * @return ehough_stash_ItemInterface
27
- */
28
- function getItem($key);
29
-
30
- /**
31
- * Returns a group of cache objects as an Iterator
32
- *
33
- * Bulk lookups can often by streamlined by backend cache systems. The
34
- * returned iterator will contain a Cache\Item for each key passed.
35
- *
36
- * @param array $keys
37
- * @return Iterator
38
- */
39
- function getItemIterator($keys);
40
-
41
- /**
42
- * Clears the cache pool of all items.
43
- *
44
- * @return bool
45
- */
46
- function clear();
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/ehough/stash/src/main/php/ehough/stash/Session.php CHANGED
@@ -42,7 +42,6 @@ class ehough_stash_Session implements ehough_stash_session_SessionHandlerInterfa
42
  */
43
  protected $name = '__empty_session_name';
44
 
45
-
46
  /**
47
  * Some options (such as the ttl of a session) can be set by the developers.
48
  *
@@ -50,24 +49,22 @@ class ehough_stash_Session implements ehough_stash_session_SessionHandlerInterfa
50
  */
51
  protected $options = array();
52
 
53
-
54
  /**
55
  * Registers a ehough_stash_Session object with PHP as the session handler. This
56
  * eliminates some boilerplate code from projects while also helping with
57
  * the differences in php versions.
58
  *
59
- * @param ehough_stash_Session $handler
60
  * @return bool
61
  */
62
- static function registerHandler(ehough_stash_Session $handler)
63
  {
64
  // this isn't possible to test with the CLI phpunit test
65
  // @codeCoverageIgnoreStart
66
 
67
- if(version_compare(PHP_VERSION, '5.4.0') >= 0)
68
- {
69
  return session_set_save_handler($handler, true);
70
- }else{
71
  $results = session_set_save_handler(
72
  array($handler, 'open'),
73
  array($handler, 'close'),
@@ -78,6 +75,7 @@ class ehough_stash_Session implements ehough_stash_session_SessionHandlerInterfa
78
  );
79
 
80
  if(!$results)
 
81
  return false;
82
 
83
  // the following prevents unexpected effects when using objects as save handlers
@@ -95,9 +93,9 @@ class ehough_stash_Session implements ehough_stash_session_SessionHandlerInterfa
95
  * drivers or be appropriately namespaced to avoid conflicts with other
96
  * libraries.
97
  *
98
- * @param ehough_stash_Pool pool
99
  */
100
- public function __construct(ehough_stash_Pool $pool)
101
  {
102
  $this->pool = $pool;
103
  $this->options['ttl'] = (int) ini_get('session.gc_maxlifetime');
@@ -108,7 +106,7 @@ class ehough_stash_Session implements ehough_stash_session_SessionHandlerInterfa
108
  * a "ttl" value, which represents the amount of time (in seconds) that each
109
  * session should last.
110
  *
111
- * @param array $options
112
  * @return bool
113
  */
114
  public function setOptions($options = array())
@@ -116,21 +114,18 @@ class ehough_stash_Session implements ehough_stash_session_SessionHandlerInterfa
116
  $this->options = array_merge($this->options, $options);
117
  }
118
 
119
-
120
  /*
121
  * The functions below are all implemented according to the
122
  * SessionHandlerInterface interface.
123
  */
124
 
125
-
126
-
127
  /**
128
  * This function is defined by the SessionHandlerInterface and is for PHP's
129
  * internal use. It takes the saved session path and turns it into a
130
  * namespace.
131
  *
132
- * @param string $save_path
133
- * @param string $session_name
134
  * @return bool
135
  */
136
  public function open($save_path, $session_name)
@@ -159,13 +154,14 @@ class ehough_stash_Session implements ehough_stash_session_SessionHandlerInterfa
159
  * This function is defined by the SessionHandlerInterface and is for PHP's
160
  * internal use. It reads the session data from the caching system.
161
  *
162
- * @param string $session_id
163
  * @return string
164
  */
165
  public function read($session_id)
166
  {
167
  $cache = $this->getCache($session_id);
168
  $data = $cache->get();
 
169
  return $cache->isMiss() ? '' : $data;
170
  }
171
 
@@ -173,13 +169,14 @@ class ehough_stash_Session implements ehough_stash_session_SessionHandlerInterfa
173
  * This function is defined by the SessionHandlerInterface and is for PHP's
174
  * internal use. It writes the session data to the caching system.
175
  *
176
- * @param string $session_id
177
- * @param string $session_data
178
  * @return bool
179
  */
180
  public function write($session_id, $session_data)
181
  {
182
  $cache = $this->getCache($session_id);
 
183
  return $cache->set($session_data, $this->options['ttl']);
184
  }
185
 
@@ -199,12 +196,13 @@ class ehough_stash_Session implements ehough_stash_session_SessionHandlerInterfa
199
  * This function is defined by the SessionHandlerInterface and is for PHP's
200
  * internal use. It clears the current session.
201
  *
202
- * @param string $session_id
203
  * @return bool
204
  */
205
  public function destroy($session_id)
206
  {
207
  $cache = $this->getCache($session_id);
 
208
  return $cache->clear();
209
  }
210
 
@@ -218,7 +216,7 @@ class ehough_stash_Session implements ehough_stash_session_SessionHandlerInterfa
218
  * gc_probability as zero) and call the "purge" function on the ehough_stash_Pool
219
  * class directly.
220
  *
221
- * @param int $maxlifetime
222
  * @return bool
223
  */
224
  public function gc($maxlifetime)
42
  */
43
  protected $name = '__empty_session_name';
44
 
 
45
  /**
46
  * Some options (such as the ttl of a session) can be set by the developers.
47
  *
49
  */
50
  protected $options = array();
51
 
 
52
  /**
53
  * Registers a ehough_stash_Session object with PHP as the session handler. This
54
  * eliminates some boilerplate code from projects while also helping with
55
  * the differences in php versions.
56
  *
57
+ * @param ehough_stash_Session $handler
58
  * @return bool
59
  */
60
+ public static function registerHandler(ehough_stash_Session $handler)
61
  {
62
  // this isn't possible to test with the CLI phpunit test
63
  // @codeCoverageIgnoreStart
64
 
65
+ if (version_compare(PHP_VERSION, '5.4.0') >= 0) {
 
66
  return session_set_save_handler($handler, true);
67
+ } else {
68
  $results = session_set_save_handler(
69
  array($handler, 'open'),
70
  array($handler, 'close'),
75
  );
76
 
77
  if(!$results)
78
+
79
  return false;
80
 
81
  // the following prevents unexpected effects when using objects as save handlers
93
  * drivers or be appropriately namespaced to avoid conflicts with other
94
  * libraries.
95
  *
96
+ * @param ehough_stash_interfaces_PoolInterface $pool
97
  */
98
+ public function __construct(ehough_stash_interfaces_PoolInterface $pool)
99
  {
100
  $this->pool = $pool;
101
  $this->options['ttl'] = (int) ini_get('session.gc_maxlifetime');
106
  * a "ttl" value, which represents the amount of time (in seconds) that each
107
  * session should last.
108
  *
109
+ * @param array $options
110
  * @return bool
111
  */
112
  public function setOptions($options = array())
114
  $this->options = array_merge($this->options, $options);
115
  }
116
 
 
117
  /*
118
  * The functions below are all implemented according to the
119
  * SessionHandlerInterface interface.
120
  */
121
 
 
 
122
  /**
123
  * This function is defined by the SessionHandlerInterface and is for PHP's
124
  * internal use. It takes the saved session path and turns it into a
125
  * namespace.
126
  *
127
+ * @param string $save_path
128
+ * @param string $session_name
129
  * @return bool
130
  */
131
  public function open($save_path, $session_name)
154
  * This function is defined by the SessionHandlerInterface and is for PHP's
155
  * internal use. It reads the session data from the caching system.
156
  *
157
+ * @param string $session_id
158
  * @return string
159
  */
160
  public function read($session_id)
161
  {
162
  $cache = $this->getCache($session_id);
163
  $data = $cache->get();
164
+
165
  return $cache->isMiss() ? '' : $data;
166
  }
167
 
169
  * This function is defined by the SessionHandlerInterface and is for PHP's
170
  * internal use. It writes the session data to the caching system.
171
  *
172
+ * @param string $session_id
173
+ * @param string $session_data
174
  * @return bool
175
  */
176
  public function write($session_id, $session_data)
177
  {
178
  $cache = $this->getCache($session_id);
179
+
180
  return $cache->set($session_data, $this->options['ttl']);
181
  }
182
 
196
  * This function is defined by the SessionHandlerInterface and is for PHP's
197
  * internal use. It clears the current session.
198
  *
199
+ * @param string $session_id
200
  * @return bool
201
  */
202
  public function destroy($session_id)
203
  {
204
  $cache = $this->getCache($session_id);
205
+
206
  return $cache->clear();
207
  }
208
 
216
  * gc_probability as zero) and call the "purge" function on the ehough_stash_Pool
217
  * class directly.
218
  *
219
+ * @param int $maxlifetime
220
  * @return bool
221
  */
222
  public function gc($maxlifetime)
vendor/ehough/stash/src/main/php/ehough/stash/Utilities.php CHANGED
@@ -21,7 +21,7 @@ class ehough_stash_Utilities
21
  * Various drivers use this to define what kind of encoding to use on objects being cached. It needs to be revamped
22
  * a bit.
23
  */
24
- static function encoding($data)
25
  {
26
  if (is_scalar($data)) {
27
  if (is_bool($data)) {
@@ -45,7 +45,7 @@ class ehough_stash_Utilities
45
  /**
46
  * Uses the encoding function to define an encoding and uses it on the data. This system is going to be revamped.
47
  */
48
- static function encode($data)
49
  {
50
  switch (self::encoding($data)) {
51
  case 'bool':
@@ -58,6 +58,7 @@ class ehough_stash_Utilities
58
  case 'none':
59
  default:
60
  }
 
61
  return $data;
62
  }
63
 
@@ -65,7 +66,7 @@ class ehough_stash_Utilities
65
  * Takes a piece of data encoded with the 'encode' function and returns it's actual value.
66
  *
67
  */
68
- static function decode($data, $method)
69
  {
70
  switch ($method) {
71
  case 'bool':
@@ -79,6 +80,7 @@ class ehough_stash_Utilities
79
  case 'none':
80
  default:
81
  }
 
82
  return $data;
83
  }
84
 
@@ -87,10 +89,10 @@ class ehough_stash_Utilities
87
  * of last resort and can cause problems if one library is shared by multiple projects. The directory returned
88
  * resides in the system's temp folder and is specific to each Stash installation and driver.
89
  *
90
- * @param ehough_stash_driver_DriverInterface $driver
91
  * @return string Path for Stash files
92
  */
93
- static function getBaseDirectory(ehough_stash_driver_DriverInterface $driver = null)
94
  {
95
  $tmp = rtrim(sys_get_temp_dir(), '/\\') . '/';
96
 
@@ -109,12 +111,12 @@ class ehough_stash_Utilities
109
  /**
110
  * Deletes a directory and all of its contents.
111
  *
112
- * @param string $file Path to file or directory.
113
- * @return bool Returns true on success, false otherwise.
114
  */
115
- static function deleteRecursive($file)
116
  {
117
- if (substr($file, 0, 1) !== '/' && substr($file, 1, 2) !== ':\\') {
118
  throw new ehough_stash_exception_RuntimeException('deleteRecursive function requires an absolute path.');
119
  }
120
 
@@ -160,7 +162,7 @@ class ehough_stash_Utilities
160
  return false;
161
  }
162
 
163
- static function normalizeKeys($keys, $hash = 'md5')
164
  {
165
  $pKey = array();
166
  foreach ($keys as $keyPiece) {
@@ -169,6 +171,7 @@ class ehough_stash_Utilities
169
  $pKeyPiece = $prefix . $hash($keyPiece);
170
  $pKey[] = $pKeyPiece;
171
  }
 
172
  return $pKey;
173
  }
174
  }
21
  * Various drivers use this to define what kind of encoding to use on objects being cached. It needs to be revamped
22
  * a bit.
23
  */
24
+ public static function encoding($data)
25
  {
26
  if (is_scalar($data)) {
27
  if (is_bool($data)) {
45
  /**
46
  * Uses the encoding function to define an encoding and uses it on the data. This system is going to be revamped.
47
  */
48
+ public static function encode($data)
49
  {
50
  switch (self::encoding($data)) {
51
  case 'bool':
58
  case 'none':
59
  default:
60
  }
61
+
62
  return $data;
63
  }
64
 
66
  * Takes a piece of data encoded with the 'encode' function and returns it's actual value.
67
  *
68
  */
69
+ public static function decode($data, $method)
70
  {
71
  switch ($method) {
72
  case 'bool':
80
  case 'none':
81
  default:
82
  }
83
+
84
  return $data;
85
  }
86
 
89
  * of last resort and can cause problems if one library is shared by multiple projects. The directory returned
90
  * resides in the system's temp folder and is specific to each Stash installation and driver.
91
  *
92
+ * @param ehough_stash_interfaces_DriverInterface $driver
93
  * @return string Path for Stash files
94
  */
95
+ public static function getBaseDirectory(ehough_stash_interfaces_DriverInterface $driver = null)
96
  {
97
  $tmp = rtrim(sys_get_temp_dir(), '/\\') . '/';
98
 
111
  /**
112
  * Deletes a directory and all of its contents.
113
  *
114
+ * @param string $file Path to file or directory.
115
+ * @return bool Returns true on success, false otherwise.
116
  */
117
+ public static function deleteRecursive($file)
118
  {
119
+ if (!preg_match('/^(?:\/|\\\\|\w:\\\\|\w:\/).*$/', $file)) {
120
  throw new ehough_stash_exception_RuntimeException('deleteRecursive function requires an absolute path.');
121
  }
122
 
162
  return false;
163
  }
164
 
165
+ public static function normalizeKeys($keys, $hash = 'md5')
166
  {
167
  $pKey = array();
168
  foreach ($keys as $keyPiece) {
171
  $pKeyPiece = $prefix . $hash($keyPiece);
172
  $pKey[] = $pKeyPiece;
173
  }
174
+
175
  return $pKey;
176
  }
177
  }
vendor/ehough/stash/src/main/php/ehough/stash/driver/Apc.php CHANGED
@@ -15,7 +15,7 @@
15
  * @package Stash
16
  * @author Robert Hafner <tedivm@tedivm.com>
17
  */
18
- class ehough_stash_driver_Apc implements ehough_stash_driver_DriverInterface
19
  {
20
  protected $ttl = 300;
21
  protected $apcNamespace;
@@ -31,12 +31,12 @@ class ehough_stash_driver_Apc implements ehough_stash_driver_DriverInterface
31
  public function __construct(array $options = array())
32
  {
33
  if (isset($options['ttl']) && is_numeric($options['ttl'])) {
34
- $this->ttl = (int)$options['ttl'];
35
  }
36
 
37
  $this->apcNamespace = isset($options['namespace']) ? $options['namespace'] : md5(__FILE__);
38
 
39
- if(!self::isAvailable()) {
40
  throw new ehough_stash_exception_RuntimeException('Extension is not installed.');
41
  }
42
  }
@@ -55,7 +55,7 @@ class ehough_stash_driver_Apc implements ehough_stash_driver_DriverInterface
55
  * is not present. This array should have a value for "createdOn" and for "return", which should be the data the
56
  * main script is trying to store.
57
  *
58
- * @param array $key
59
  * @return array
60
  */
61
  public function getData($key)
@@ -73,14 +73,15 @@ class ehough_stash_driver_Apc implements ehough_stash_driver_DriverInterface
73
  * stored. This function needs to store that data in such a way that it can be retrieved exactly as it was sent. The
74
  * expiration time needs to be stored with this data.
75
  *
76
- * @param array $key
77
- * @param array $data
78
- * @param int $expiration
79
  * @return bool
80
  */
81
  public function storeData($key, $data, $expiration)
82
  {
83
  $life = $this->getCacheTime($expiration);
 
84
  return apc_store($this->makeKey($key), array('data' => $data, 'expiration' => $expiration), $life);
85
  }
86
 
@@ -88,7 +89,7 @@ class ehough_stash_driver_Apc implements ehough_stash_driver_DriverInterface
88
  * This function should clear the cache tree using the key array provided. If called with no arguments the entire
89
  * cache needs to be cleared.
90
  *
91
- * @param null|array $key
92
  * @return bool
93
  */
94
  public function clear($key = null)
@@ -103,6 +104,7 @@ class ehough_stash_driver_Apc implements ehough_stash_driver_DriverInterface
103
  apc_delete($key);
104
  }
105
  }
 
106
  return true;
107
  }
108
 
@@ -134,7 +136,7 @@ class ehough_stash_driver_Apc implements ehough_stash_driver_DriverInterface
134
  *
135
  * @return bool
136
  */
137
- static public function isAvailable()
138
  {
139
  return (extension_loaded('apc') && ini_get('apc.enabled'))
140
  && ((php_sapi_name() !== 'cli') || ini_get('apc.enable_cli'));
15
  * @package Stash
16
  * @author Robert Hafner <tedivm@tedivm.com>
17
  */
18
+ class ehough_stash_driver_Apc implements ehough_stash_interfaces_DriverInterface
19
  {
20
  protected $ttl = 300;
21
  protected $apcNamespace;
31
  public function __construct(array $options = array())
32
  {
33
  if (isset($options['ttl']) && is_numeric($options['ttl'])) {
34
+ $this->ttl = (int) $options['ttl'];
35
  }
36
 
37
  $this->apcNamespace = isset($options['namespace']) ? $options['namespace'] : md5(__FILE__);
38
 
39
+ if (!self::isAvailable()) {
40
  throw new ehough_stash_exception_RuntimeException('Extension is not installed.');
41
  }
42
  }
55
  * is not present. This array should have a value for "createdOn" and for "return", which should be the data the
56
  * main script is trying to store.
57
  *
58
+ * @param array $key
59
  * @return array
60
  */
61
  public function getData($key)
73
  * stored. This function needs to store that data in such a way that it can be retrieved exactly as it was sent. The
74
  * expiration time needs to be stored with this data.
75
  *
76
+ * @param array $key
77
+ * @param array $data
78
+ * @param int $expiration
79
  * @return bool
80
  */
81
  public function storeData($key, $data, $expiration)
82
  {
83
  $life = $this->getCacheTime($expiration);
84
+
85
  return apc_store($this->makeKey($key), array('data' => $data, 'expiration' => $expiration), $life);
86
  }
87
 
89
  * This function should clear the cache tree using the key array provided. If called with no arguments the entire
90
  * cache needs to be cleared.
91
  *
92
+ * @param null|array $key
93
  * @return bool
94
  */
95
  public function clear($key = null)
104
  apc_delete($key);
105
  }
106
  }
107
+
108
  return true;
109
  }
110
 
136
  *
137
  * @return bool
138
  */
139
+ public static function isAvailable()
140
  {
141
  return (extension_loaded('apc') && ini_get('apc.enabled'))
142
  && ((php_sapi_name() !== 'cli') || ini_get('apc.enable_cli'));
vendor/ehough/stash/src/main/php/ehough/stash/driver/BlackHole.php CHANGED
@@ -12,64 +12,62 @@
12
  /**
13
  * This class provides a NULL caching driver, it always takes values, but never saves them
14
  * Can be used as an default save driver
15
- *
16
  * @author Benjamin Zikarsky <benjamin.zikarsky@perbility.de>
17
  */
18
- class ehough_stash_driver_BlackHole implements ehough_stash_driver_DriverInterface
19
  {
20
-
21
- /**
22
- * NOOP constructor
23
- */
24
- public function __construct(array $options = array())
25
- {
26
- // empty
27
- }
28
 
29
-
30
- /*
31
- * (non-PHPdoc)
32
- * @see ehough_stash_driver_DriverInterface::clear()
33
  */
34
  public function clear($key = null)
35
  {
36
  return true;
37
  }
38
 
39
- /*
40
  * (non-PHPdoc)
41
- * @see ehough_stash_driver_DriverInterface::getData()
42
  */
43
  public function getData($key)
44
  {
45
  return false;
46
- }
47
 
48
- /*
49
  * (non-PHPdoc)
50
- * @see ehough_stash_driver_DriverInterface::purge()
51
  */
52
  public function purge()
53
  {
54
- return true;
55
- }
56
 
57
- /*
58
  * (non-PHPdoc)
59
- * @see ehough_stash_driver_DriverInterface::storeData()
60
  */
61
  public function storeData($key, $data, $expiration)
62
  {
63
- return true;
64
  }
65
-
66
- /*
67
  * (non-PHPdoc)
68
- * @see ehough_stash_driver_DriverInterface::isAvailable()
69
  */
70
  public static function isAvailable()
71
  {
72
  return true;
73
  }
74
-
75
- }
12
  /**
13
  * This class provides a NULL caching driver, it always takes values, but never saves them
14
  * Can be used as an default save driver
15
+ *
16
  * @author Benjamin Zikarsky <benjamin.zikarsky@perbility.de>
17
  */
18
+ class ehough_stash_driver_BlackHole implements ehough_stash_interfaces_DriverInterface
19
  {
20
+ /**
21
+ * NOOP constructor
22
+ */
23
+ public function __construct(array $options = array())
24
+ {
25
+ // empty
26
+ }
 
27
 
28
+ /*
29
+ * (non-PHPdoc)
30
+ * @see ehough_stash_interfaces_DriverInterface::clear()
 
31
  */
32
  public function clear($key = null)
33
  {
34
  return true;
35
  }
36
 
37
+ /*
38
  * (non-PHPdoc)
39
+ * @see ehough_stash_interfaces_DriverInterface::getData()
40
  */
41
  public function getData($key)
42
  {
43
  return false;
44
+ }
45
 
46
+ /*
47
  * (non-PHPdoc)
48
+ * @see ehough_stash_interfaces_DriverInterface::purge()
49
  */
50
  public function purge()
51
  {
52
+ return true;
53
+ }
54
 
55
+ /*
56
  * (non-PHPdoc)
57
+ * @see ehough_stash_interfaces_DriverInterface::storeData()
58
  */
59
  public function storeData($key, $data, $expiration)
60
  {
61
+ return true;
62
  }
63
+
64
+ /*
65
  * (non-PHPdoc)
66
+ * @see ehough_stash_interfaces_DriverInterface::isAvailable()
67
  */
68
  public static function isAvailable()
69
  {
70
  return true;
71
  }
72
+
73
+ }
vendor/ehough/stash/src/main/php/ehough/stash/driver/Composite.php CHANGED
@@ -17,7 +17,7 @@
17
  * @package Stash
18
  * @author Robert Hafner <tedivm@tedivm.com>
19
  */
20
- class ehough_stash_driver_Composite implements ehough_stash_driver_DriverInterface
21
  {
22
 
23
  protected $drivers = array();
@@ -34,7 +34,7 @@ class ehough_stash_driver_Composite implements ehough_stash_driver_DriverInterfa
34
  }
35
 
36
  foreach ($options['drivers'] as $driver) {
37
- if (!(is_object($driver) && $driver instanceof ehough_stash_driver_DriverInterface)) {
38
  continue;
39
  }
40
 
@@ -109,7 +109,7 @@ class ehough_stash_driver_Composite implements ehough_stash_driver_DriverInterfa
109
  * This function should clear the cache tree using the key array provided. If called with no arguments the entire
110
  * cache needs to be cleared.
111
  *
112
- * @param null|array $key
113
  * @return bool
114
  */
115
  public function clear($key = null)
@@ -147,7 +147,7 @@ class ehough_stash_driver_Composite implements ehough_stash_driver_DriverInterfa
147
  *
148
  * @return bool true
149
  */
150
- static public function isAvailable()
151
  {
152
  return true;
153
  }
17
  * @package Stash
18
  * @author Robert Hafner <tedivm@tedivm.com>
19
  */
20
+ class ehough_stash_driver_Composite implements ehough_stash_interfaces_DriverInterface
21
  {
22
 
23
  protected $drivers = array();
34
  }
35
 
36
  foreach ($options['drivers'] as $driver) {
37
+ if (!(is_object($driver) && $driver instanceof ehough_stash_interfaces_DriverInterface)) {
38
  continue;
39
  }
40
 
109
  * This function should clear the cache tree using the key array provided. If called with no arguments the entire
110
  * cache needs to be cleared.
111
  *
112
+ * @param null|array $key
113
  * @return bool
114
  */
115
  public function clear($key = null)
147
  *
148
  * @return bool true
149
  */
150
+ public static function isAvailable()
151
  {
152
  return true;
153
  }
vendor/ehough/stash/src/main/php/ehough/stash/driver/Ephemeral.php CHANGED
@@ -16,7 +16,7 @@
16
  * @package Stash
17
  * @author Robert Hafner <tedivm@tedivm.com>
18
  */
19
- class ehough_stash_driver_Ephemeral implements ehough_stash_driver_DriverInterface
20
  {
21
 
22
  protected $store = array();
@@ -49,6 +49,7 @@ class ehough_stash_driver_Ephemeral implements ehough_stash_driver_DriverInterfa
49
  public function storeData($key, $data, $expiration)
50
  {
51
  $this->store[$this->getKeyIndex($key)] = array('data' => $data, 'expiration' => $expiration);
 
52
  return true;
53
  }
54
 
@@ -80,7 +81,7 @@ class ehough_stash_driver_Ephemeral implements ehough_stash_driver_DriverInterfa
80
  return true;
81
  }
82
 
83
- static public function isAvailable()
84
  {
85
  return true;
86
  }
16
  * @package Stash
17
  * @author Robert Hafner <tedivm@tedivm.com>
18
  */
19
+ class ehough_stash_driver_Ephemeral implements ehough_stash_interfaces_DriverInterface
20
  {
21
 
22
  protected $store = array();
49
  public function storeData($key, $data, $expiration)
50
  {
51
  $this->store[$this->getKeyIndex($key)] = array('data' => $data, 'expiration' => $expiration);
52
+
53
  return true;
54
  }
55
 
81
  return true;
82
  }
83
 
84
+ public static function isAvailable()
85
  {
86
  return true;
87
  }
vendor/ehough/stash/src/main/php/ehough/stash/driver/FileSystem.php CHANGED
@@ -17,7 +17,7 @@
17
  * @package Stash
18
  * @author Robert Hafner <tedivm@tedivm.com>
19
  */
20
- class ehough_stash_driver_FileSystem implements ehough_stash_driver_DriverInterface
21
  {
22
  /**
23
  * This is the path to the file which will be used to store the cached item. It is based off of the key.
@@ -70,7 +70,7 @@ class ehough_stash_driver_FileSystem implements ehough_stash_driver_DriverInterf
70
  $options = array_merge($this->defaultOptions, $options);
71
 
72
  $this->cachePath = isset($options['path']) ? $options['path'] : ehough_stash_Utilities::getBaseDirectory($this);
73
- $this->cachePath = rtrim($this->cachePath, '\\/') . '/';
74
 
75
  $this->filePermissions = $options['filePermissions'];
76
  $this->dirPermissions = $options['dirPermissions'];
@@ -79,7 +79,7 @@ class ehough_stash_driver_FileSystem implements ehough_stash_driver_DriverInterf
79
  $options['dirSplit'] = 1;
80
  }
81
 
82
- $this->directorySplit = (int)$options['dirSplit'];
83
 
84
  if (!is_numeric($options['memKeyLimit']) || $options['memKeyLimit'] < 1) {
85
  $options['memKeyLimit'] = 0;
@@ -87,12 +87,11 @@ class ehough_stash_driver_FileSystem implements ehough_stash_driver_DriverInterf
87
 
88
  if (function_exists($options['keyHashFunction'])) {
89
  $this->keyHashFunction = $options['keyHashFunction'];
90
- }
91
- else {
92
  throw new ehough_stash_exception_RuntimeException('Key Hash Function does not exist');
93
  }
94
 
95
- $this->memStoreLimit = (int)$options['memKeyLimit'];
96
 
97
  $this->checkFileSystemPermissions();
98
  }
@@ -111,6 +110,7 @@ class ehough_stash_driver_FileSystem implements ehough_stash_driver_DriverInterf
111
  foreach ($key as $group) {
112
  $keyString .= $group . '/';
113
  }
 
114
  return $keyString;
115
  }
116
 
@@ -126,7 +126,7 @@ class ehough_stash_driver_FileSystem implements ehough_stash_driver_DriverInterf
126
  return self::getDataFromFile($this->makePath($key));
127
  }
128
 
129
- static protected function getDataFromFile($path)
130
  {
131
  if (!file_exists($path)) {
132
  return false;
@@ -142,13 +142,12 @@ class ehough_stash_driver_FileSystem implements ehough_stash_driver_DriverInterf
142
 
143
  // ehough_stash_Item exists
144
  // isset + is_null = true + false = true
145
- if(isset($data))
146
- {
147
  return array('data' => $data, 'expiration' => $expiration);
148
 
149
  // ehough_stash_Item is null
150
  // isset + is_null = false + true = true
151
- }elseif(@is_null($data)){
152
  return array('data' => null, 'expiration' => $expiration);
153
  }
154
 
@@ -162,30 +161,38 @@ class ehough_stash_driver_FileSystem implements ehough_stash_driver_DriverInterf
162
  * This function takes the data and stores it to the path specified. If the directory leading up to the path does
163
  * not exist, it creates it.
164
  *
165
- * @param array $key
166
- * @param array $data
167
- * @param int $expiration
168
  * @return bool
169
  */
170
  public function storeData($key, $data, $expiration)
171
  {
172
- $success = false;
173
-
174
  $path = $this->makePath($key);
175
 
176
  if (!file_exists($path)) {
177
  if (!is_dir(dirname($path))) {
 
 
 
 
 
178
  if (!mkdir(dirname($path), $this->dirPermissions, true)) {
179
  return false;
180
  }
181
  }
182
 
 
 
 
 
 
183
  if (!(touch($path) && chmod($path, $this->filePermissions))) {
184
  return false;
185
  }
186
  }
187
 
188
- $storeString = '<?php ' . PHP_EOL . '/* Cachekey: ' . $this->makeKeyString($key) . ' */' . PHP_EOL . '/* Type: ' . gettype($data) . ' */' . PHP_EOL . '$expiration = ' . $expiration . ';' . PHP_EOL;
189
 
190
  if (is_array($data)) {
191
  $storeString .= "\$data = array();" . PHP_EOL;
@@ -210,7 +217,7 @@ class ehough_stash_driver_FileSystem implements ehough_stash_driver_DriverInterf
210
  {
211
  switch (ehough_stash_Utilities::encoding($data)) {
212
  case 'bool':
213
- $dataString = (bool)$data ? 'true' : 'false';
214
  break;
215
 
216
  case 'serialize':
@@ -224,12 +231,13 @@ class ehough_stash_driver_FileSystem implements ehough_stash_driver_DriverInterf
224
  case 'none':
225
  default :
226
  if (is_numeric($data)) {
227
- $dataString = (string)$data;
228
  } else {
229
  $dataString = 'base64_decode(\'' . base64_encode($data) . '\')';
230
  }
231
  break;
232
  }
 
233
  return $dataString;
234
  }
235
 
@@ -239,7 +247,7 @@ class ehough_stash_driver_FileSystem implements ehough_stash_driver_DriverInterf
239
  * of the array as a directory (after putting the element through md5(), which was the most efficient way to make
240
  * sure it was filesystem safe). The last element of the array gets a php extension attached to it.
241
  *
242
- * @param array $key Null arguments return the base directory.
243
  * @return string
244
  */
245
  protected function makePath($key = null)
@@ -267,14 +275,13 @@ class ehough_stash_driver_FileSystem implements ehough_stash_driver_DriverInterf
267
  if (isset($this->memStore['keys'][$memkey])) {
268
  return $this->memStore['keys'][$memkey];
269
  } else {
270
- $pathPieces = array();
271
  $path = $basePath;
272
  $len = floor(32 / $this->directorySplit);
273
  $key = ehough_stash_Utilities::normalizeKeys($key, $this->keyHashFunction);
274
 
275
- foreach ($key as $index => $value) {
276
  if (strpos($value, '@') === 0) {
277
- $path .= substr($value, 1) . '/';
278
  continue;
279
  }
280
 
@@ -285,11 +292,11 @@ class ehough_stash_driver_FileSystem implements ehough_stash_driver_DriverInterf
285
  if ($i == $this->directorySplit) {
286
  $len = $sLen - $start;
287
  }
288
- $path .= substr($value, $start, $len) . '/';
289
  }
290
  }
291
 
292
- $path = rtrim($path, '/') . '.php';
293
  $this->memStore['keys'][$memkey] = $path;
294
 
295
  // in most cases the key will be used almost immediately or not at all, so it doesn't need to grow too large
@@ -307,7 +314,7 @@ class ehough_stash_driver_FileSystem implements ehough_stash_driver_DriverInterf
307
  * This function clears the data from a key. If a key points to both a directory and a file, both are erased. If
308
  * passed null, the entire cache directory is removed.
309
  *
310
- * @param null|array $key
311
  * @return bool
312
  */
313
  public function clear($key = null)
@@ -364,6 +371,7 @@ class ehough_stash_driver_FileSystem implements ehough_stash_driver_DriverInterf
364
 
365
  }
366
  unset($directoryIt);
 
367
  return true;
368
  }
369
 
@@ -373,19 +381,19 @@ class ehough_stash_driver_FileSystem implements ehough_stash_driver_DriverInterf
373
  */
374
  protected function checkFileSystemPermissions()
375
  {
376
- if(!isset($this->cachePath)) {
377
  throw new ehough_stash_exception_RuntimeException('Cache path was not set correctly.');
378
  }
379
 
380
- if(file_exists($this->cachePath) && !is_dir($this->cachePath)) {
381
  throw new InvalidArgumentException('Cache path is not a directory.');
382
  }
383
 
384
- if(!is_dir($this->cachePath) && !@mkdir( $this->cachePath, $this->dirPermissions, true )) {
385
  throw new ehough_stash_exception_InvalidArgumentException('Failed to create cache path.');
386
  }
387
 
388
- if(!is_writable($this->cachePath)) {
389
  throw new ehough_stash_exception_InvalidArgumentException('Cache path is not writable.');
390
  }
391
  }
@@ -396,7 +404,7 @@ class ehough_stash_driver_FileSystem implements ehough_stash_driver_DriverInterf
396
  *
397
  * @return bool true
398
  */
399
- static public function isAvailable()
400
  {
401
  return true;
402
  }
17
  * @package Stash
18
  * @author Robert Hafner <tedivm@tedivm.com>
19
  */
20
+ class ehough_stash_driver_FileSystem implements ehough_stash_interfaces_DriverInterface
21
  {
22
  /**
23
  * This is the path to the file which will be used to store the cached item. It is based off of the key.
70
  $options = array_merge($this->defaultOptions, $options);
71
 
72
  $this->cachePath = isset($options['path']) ? $options['path'] : ehough_stash_Utilities::getBaseDirectory($this);
73
+ $this->cachePath = rtrim($this->cachePath, '\\/') . DIRECTORY_SEPARATOR;
74
 
75
  $this->filePermissions = $options['filePermissions'];
76
  $this->dirPermissions = $options['dirPermissions'];
79
  $options['dirSplit'] = 1;
80
  }
81
 
82
+ $this->directorySplit = (int) $options['dirSplit'];
83
 
84
  if (!is_numeric($options['memKeyLimit']) || $options['memKeyLimit'] < 1) {
85
  $options['memKeyLimit'] = 0;
87
 
88
  if (function_exists($options['keyHashFunction'])) {
89
  $this->keyHashFunction = $options['keyHashFunction'];
90
+ } else {
 
91
  throw new ehough_stash_exception_RuntimeException('Key Hash Function does not exist');
92
  }
93
 
94
+ $this->memStoreLimit = (int) $options['memKeyLimit'];
95
 
96
  $this->checkFileSystemPermissions();
97
  }
110
  foreach ($key as $group) {
111
  $keyString .= $group . '/';
112
  }
113
+
114
  return $keyString;
115
  }
116
 
126
  return self::getDataFromFile($this->makePath($key));
127
  }
128
 
129
+ protected static function getDataFromFile($path)
130
  {
131
  if (!file_exists($path)) {
132
  return false;
142
 
143
  // ehough_stash_Item exists
144
  // isset + is_null = true + false = true
145
+ if (isset($data)) {
 
146
  return array('data' => $data, 'expiration' => $expiration);
147
 
148
  // ehough_stash_Item is null
149
  // isset + is_null = false + true = true
150
+ } elseif (@is_null($data)) {
151
  return array('data' => null, 'expiration' => $expiration);
152
  }
153
 
161
  * This function takes the data and stores it to the path specified. If the directory leading up to the path does
162
  * not exist, it creates it.
163
  *
164
+ * @param array $key
165
+ * @param array $data
166
+ * @param int $expiration
167
  * @return bool
168
  */
169
  public function storeData($key, $data, $expiration)
170
  {
 
 
171
  $path = $this->makePath($key);
172
 
173
  if (!file_exists($path)) {
174
  if (!is_dir(dirname($path))) {
175
+ // MAX_PATH is 260 - http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx
176
+ if (strlen(dirname($path)) > 259 && stristr(PHP_OS,'WIN')) {
177
+ throw new ehough_stash_exception_WindowsPathMaxLengthException();
178
+ }
179
+
180
  if (!mkdir(dirname($path), $this->dirPermissions, true)) {
181
  return false;
182
  }
183
  }
184
 
185
+ // MAX_PATH is 260 - http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx
186
+ if (strlen($path) > 259 && stristr(PHP_OS,'WIN')) {
187
+ throw new ehough_stash_exception_WindowsPathMaxLengthException();
188
+ }
189
+
190
  if (!(touch($path) && chmod($path, $this->filePermissions))) {
191
  return false;
192
  }
193
  }
194
 
195
+ $storeString = '<?php ' . PHP_EOL . '/* Cachekey: ' . str_replace('*/', '', $this->makeKeyString($key)) . ' */' . PHP_EOL . '/* Type: ' . gettype($data) . ' */' . PHP_EOL . '$expiration = ' . $expiration . ';' . PHP_EOL;
196
 
197
  if (is_array($data)) {
198
  $storeString .= "\$data = array();" . PHP_EOL;
217
  {
218
  switch (ehough_stash_Utilities::encoding($data)) {
219
  case 'bool':
220
+ $dataString = (bool) $data ? 'true' : 'false';
221
  break;
222
 
223
  case 'serialize':
231
  case 'none':
232
  default :
233
  if (is_numeric($data)) {
234
+ $dataString = (string) $data;
235
  } else {
236
  $dataString = 'base64_decode(\'' . base64_encode($data) . '\')';
237
  }
238
  break;
239
  }
240
+
241
  return $dataString;
242
  }
243
 
247
  * of the array as a directory (after putting the element through md5(), which was the most efficient way to make
248
  * sure it was filesystem safe). The last element of the array gets a php extension attached to it.
249
  *
250
+ * @param array $key Null arguments return the base directory.
251
  * @return string
252
  */
253
  protected function makePath($key = null)
275
  if (isset($this->memStore['keys'][$memkey])) {
276
  return $this->memStore['keys'][$memkey];
277
  } else {
 
278
  $path = $basePath;
279
  $len = floor(32 / $this->directorySplit);
280
  $key = ehough_stash_Utilities::normalizeKeys($key, $this->keyHashFunction);
281
 
282
+ foreach ($key as $value) {
283
  if (strpos($value, '@') === 0) {
284
+ $path .= substr($value, 1) . DIRECTORY_SEPARATOR;
285
  continue;
286
  }
287
 
292
  if ($i == $this->directorySplit) {
293
  $len = $sLen - $start;
294
  }
295
+ $path .= substr($value, $start, $len) . DIRECTORY_SEPARATOR;
296
  }
297
  }
298
 
299
+ $path = rtrim($path, DIRECTORY_SEPARATOR) . '.php';
300
  $this->memStore['keys'][$memkey] = $path;
301
 
302
  // in most cases the key will be used almost immediately or not at all, so it doesn't need to grow too large
314
  * This function clears the data from a key. If a key points to both a directory and a file, both are erased. If
315
  * passed null, the entire cache directory is removed.
316
  *
317
+ * @param null|array $key
318
  * @return bool
319
  */
320
  public function clear($key = null)
371
 
372
  }
373
  unset($directoryIt);
374
+
375
  return true;
376
  }
377
 
381
  */
382
  protected function checkFileSystemPermissions()
383
  {
384
+ if (!isset($this->cachePath)) {
385
  throw new ehough_stash_exception_RuntimeException('Cache path was not set correctly.');
386
  }
387
 
388
+ if (file_exists($this->cachePath) && !is_dir($this->cachePath)) {
389
  throw new InvalidArgumentException('Cache path is not a directory.');
390
  }
391
 
392
+ if (!is_dir($this->cachePath) && !@mkdir( $this->cachePath, $this->dirPermissions, true )) {
393
  throw new ehough_stash_exception_InvalidArgumentException('Failed to create cache path.');
394
  }
395
 
396
+ if (!is_writable($this->cachePath)) {
397
  throw new ehough_stash_exception_InvalidArgumentException('Cache path is not writable.');
398
  }
399
  }
404
  *
405
  * @return bool true
406
  */
407
+ public static function isAvailable()
408
  {
409
  return true;
410
  }
vendor/ehough/stash/src/main/php/ehough/stash/driver/Memcache.php CHANGED
@@ -16,7 +16,7 @@
16
  * @package Stash
17
  * @author Robert Hafner <tedivm@tedivm.com>
18
  */
19
- class ehough_stash_driver_Memcache implements ehough_stash_driver_DriverInterface
20
  {
21
  /**
22
  * Memcache subdriver used by this class.
@@ -90,9 +90,9 @@ class ehough_stash_driver_Memcache implements ehough_stash_driver_DriverInterfac
90
 
91
  /**
92
  *
93
- * @param array $key
94
- * @param array $data
95
- * @param int $expiration
96
  * @return bool
97
  */
98
  public function storeData($key, $data, $expiration)
@@ -102,7 +102,7 @@ class ehough_stash_driver_Memcache implements ehough_stash_driver_DriverInterfac
102
 
103
  /**
104
  *
105
- * @param null|array $key
106
  * @return bool
107
  */
108
  public function clear($key = null)
@@ -117,6 +117,7 @@ class ehough_stash_driver_Memcache implements ehough_stash_driver_DriverInterfac
117
  $this->makeKeyString($key);
118
  }
119
  $this->keyCache = array();
 
120
  return true;
121
  }
122
 
@@ -162,7 +163,7 @@ class ehough_stash_driver_Memcache implements ehough_stash_driver_DriverInterfac
162
  return $path ? $pathKey : md5($keyString);
163
  }
164
 
165
- static public function isAvailable()
166
  {
167
  return (ehough_stash_driver_sub_Memcache::isAvailable() || ehough_stash_driver_sub_Memcached::isAvailable());
168
  }
16
  * @package Stash
17
  * @author Robert Hafner <tedivm@tedivm.com>
18
  */
19
+ class ehough_stash_driver_Memcache implements ehough_stash_interfaces_DriverInterface
20
  {
21
  /**
22
  * Memcache subdriver used by this class.
90
 
91
  /**
92
  *
93
+ * @param array $key
94
+ * @param array $data
95
+ * @param int $expiration
96
  * @return bool
97
  */
98
  public function storeData($key, $data, $expiration)
102
 
103
  /**
104
  *
105
+ * @param null|array $key
106
  * @return bool
107
  */
108
  public function clear($key = null)
117
  $this->makeKeyString($key);
118
  }
119
  $this->keyCache = array();
120
+
121
  return true;
122
  }
123
 
163
  return $path ? $pathKey : md5($keyString);
164
  }
165
 
166
+ public static function isAvailable()
167
  {
168
  return (ehough_stash_driver_sub_Memcache::isAvailable() || ehough_stash_driver_sub_Memcached::isAvailable());
169
  }
vendor/ehough/stash/src/main/php/ehough/stash/driver/Redis.php CHANGED
@@ -16,7 +16,7 @@
16
  * @package Stash
17
  * @author Robert Hafner <tedivm@tedivm.com>
18
  */
19
- class ehough_stash_driver_Redis implements \ehough_stash_driver_DriverInterface
20
  {
21
  protected $defaultOptions = array ();
22
  protected $redis;
@@ -32,37 +32,31 @@ class ehough_stash_driver_Redis implements \ehough_stash_driver_DriverInterface
32
  throw new RuntimeException('Unable to load Redis driver without PhpRedis extension.');
33
 
34
  // Normalize Server Options
35
- if(isset($options['servers']))
36
- {
37
  $servers = (is_array($options['servers']))
38
  ? $options['servers']
39
  : array($options['servers']);
40
 
41
  unset($options['servers']);
42
 
43
- }else{
44
  $servers = array(array('server' => '127.0.0.1', 'port' => '6379', 'ttl' => 0.1));
45
  }
46
 
47
  // Merge in default values.
48
  $options = array_merge($this->defaultOptions, $options);
49
 
50
-
51
-
52
-
53
  // this will have to be revisited to support multiple servers, using
54
  // the RedisArray object. That object acts as a proxy object, meaning
55
  // most of the class will be the same even after the changes.
56
 
57
-
58
- if(count($servers) == 1)
59
- {
60
  $server = $servers[0];
61
  $redis = new Redis();
62
 
63
- if(isset($server['socket']) && $server['socket']) {
64
  $redis->connect($server['socket']);
65
- }else{
66
  $port = isset($server['port']) ? $server['port'] : 6379;
67
  $ttl = isset($server['ttl']) ? $server['ttl'] : 0.1;
68
  $redis->connect($server['server'], $port, $ttl);
@@ -74,12 +68,10 @@ class ehough_stash_driver_Redis implements \ehough_stash_driver_DriverInterface
74
 
75
  $this->redis = $redis;
76
 
77
-
78
- }else{
79
 
80
  $serverArray = array();
81
- foreach($servers as $server)
82
- {
83
  $serverString = $server['server'];
84
  if(isset($server['port']))
85
  $serverString .= ':' . $server['port'];
@@ -90,7 +82,6 @@ class ehough_stash_driver_Redis implements \ehough_stash_driver_DriverInterface
90
  $redis = new RedisArray($serverArray);
91
  }
92
 
93
-
94
  // select database
95
  if(isset($options['database']))
96
  $redis->select($options['database']);
@@ -98,10 +89,18 @@ class ehough_stash_driver_Redis implements \ehough_stash_driver_DriverInterface
98
  $this->redis = $redis;
99
  }
100
 
 
 
 
 
 
 
 
 
101
  /**
102
  *
103
  *
104
- * @param array $key
105
  * @return array
106
  */
107
  public function getData($key)
@@ -112,23 +111,23 @@ class ehough_stash_driver_Redis implements \ehough_stash_driver_DriverInterface
112
  /**
113
  *
114
  *
115
- * @param array $key
116
- * @param array $data
117
- * @param int $expiration
118
  * @return bool
119
  */
120
  public function storeData($key, $data, $expiration)
121
  {
122
  $store = serialize(array('data' => $data, 'expiration' => $expiration));
123
- if(is_null($expiration))
124
- {
125
  return $this->redis->setex($this->makeKeyString($key), $store);
126
- }else{
127
  $ttl = $expiration - time();
128
 
129
  // Prevent us from even passing a negative ttl'd item to redis,
130
  // since it will just round up to zero and cache forever.
131
  if($ttl < 1)
 
132
  return true;
133
 
134
  return $this->redis->set($this->makeKeyString($key), $store, $ttl);
@@ -139,14 +138,14 @@ class ehough_stash_driver_Redis implements \ehough_stash_driver_DriverInterface
139
  * Clears the cache tree using the key array provided as the key. If called with no arguments the entire cache gets
140
  * cleared.
141
  *
142
- * @param null|array $key
143
  * @return bool
144
  */
145
  public function clear($key = null)
146
  {
147
- if(is_null($key))
148
- {
149
  $this->redis->flushDB();
 
150
  return true;
151
  }
152
 
@@ -155,6 +154,7 @@ class ehough_stash_driver_Redis implements \ehough_stash_driver_DriverInterface
155
  $this->redis->incr($keyString); // increment index for children items
156
  $this->redis->delete($keyReal); // remove direct item.
157
  $this->keyCache = array();
 
158
  return true;
159
  }
160
 
@@ -165,7 +165,6 @@ class ehough_stash_driver_Redis implements \ehough_stash_driver_DriverInterface
165
  public function purge()
166
  {
167
  // @todo when the RedisArray class is used run the rehash function here
168
-
169
  return true;
170
  }
171
 
@@ -174,7 +173,7 @@ class ehough_stash_driver_Redis implements \ehough_stash_driver_DriverInterface
174
  *
175
  * @return bool
176
  */
177
- static public function isAvailable()
178
  {
179
  return class_exists('Redis', false);
180
  }
@@ -213,5 +212,4 @@ class ehough_stash_driver_Redis implements \ehough_stash_driver_DriverInterface
213
  return $path ? $pathKey : md5($keyString);
214
  }
215
 
216
-
217
  }
16
  * @package Stash
17
  * @author Robert Hafner <tedivm@tedivm.com>
18
  */
19
+ class ehough_stash_driver_Redis implements ehough_stash_interfaces_DriverInterface
20
  {
21
  protected $defaultOptions = array ();
22
  protected $redis;
32
  throw new RuntimeException('Unable to load Redis driver without PhpRedis extension.');
33
 
34
  // Normalize Server Options
35
+ if (isset($options['servers'])) {
 
36
  $servers = (is_array($options['servers']))
37
  ? $options['servers']
38
  : array($options['servers']);
39
 
40
  unset($options['servers']);
41
 
42
+ } else {
43
  $servers = array(array('server' => '127.0.0.1', 'port' => '6379', 'ttl' => 0.1));
44
  }
45
 
46
  // Merge in default values.
47
  $options = array_merge($this->defaultOptions, $options);
48
 
 
 
 
49
  // this will have to be revisited to support multiple servers, using
50
  // the RedisArray object. That object acts as a proxy object, meaning
51
  // most of the class will be the same even after the changes.
52
 
53
+ if (count($servers) == 1) {
 
 
54
  $server = $servers[0];
55
  $redis = new Redis();
56
 
57
+ if (isset($server['socket']) && $server['socket']) {
58
  $redis->connect($server['socket']);
59
+ } else {
60
  $port = isset($server['port']) ? $server['port'] : 6379;
61
  $ttl = isset($server['ttl']) ? $server['ttl'] : 0.1;
62
  $redis->connect($server['server'], $port, $ttl);
68
 
69
  $this->redis = $redis;
70
 
71
+ } else {
 
72
 
73
  $serverArray = array();
74
+ foreach ($servers as $server) {
 
75
  $serverString = $server['server'];
76
  if(isset($server['port']))
77
  $serverString .= ':' . $server['port'];
82
  $redis = new RedisArray($serverArray);
83
  }
84
 
 
85
  // select database
86
  if(isset($options['database']))
87
  $redis->select($options['database']);
89
  $this->redis = $redis;
90
  }
91
 
92
+ /**
93
+ * Properly close the connection
94
+ */
95
+ public function __destruct()
96
+ {
97
+ $this->redis->close();
98
+ }
99
+
100
  /**
101
  *
102
  *
103
+ * @param array $key
104
  * @return array
105
  */
106
  public function getData($key)
111
  /**
112
  *
113
  *
114
+ * @param array $key
115
+ * @param array $data
116
+ * @param int $expiration
117
  * @return bool
118
  */
119
  public function storeData($key, $data, $expiration)
120
  {
121
  $store = serialize(array('data' => $data, 'expiration' => $expiration));
122
+ if (is_null($expiration)) {
 
123
  return $this->redis->setex($this->makeKeyString($key), $store);
124
+ } else {
125
  $ttl = $expiration - time();
126
 
127
  // Prevent us from even passing a negative ttl'd item to redis,
128
  // since it will just round up to zero and cache forever.
129
  if($ttl < 1)
130
+
131
  return true;
132
 
133
  return $this->redis->set($this->makeKeyString($key), $store, $ttl);
138
  * Clears the cache tree using the key array provided as the key. If called with no arguments the entire cache gets
139
  * cleared.
140
  *
141
+ * @param null|array $key
142
  * @return bool
143
  */
144
  public function clear($key = null)
145
  {
146
+ if (is_null($key)) {
 
147
  $this->redis->flushDB();
148
+
149
  return true;
150
  }
151
 
154
  $this->redis->incr($keyString); // increment index for children items
155
  $this->redis->delete($keyReal); // remove direct item.
156
  $this->keyCache = array();
157
+
158
  return true;
159
  }
160
 
165
  public function purge()
166
  {
167
  // @todo when the RedisArray class is used run the rehash function here
 
168
  return true;
169
  }
170
 
173
  *
174
  * @return bool
175
  */
176
+ public static function isAvailable()
177
  {
178
  return class_exists('Redis', false);
179
  }
212
  return $path ? $pathKey : md5($keyString);
213
  }
214
 
 
215
  }
vendor/ehough/stash/src/main/php/ehough/stash/driver/Sqlite.php CHANGED
@@ -17,7 +17,7 @@
17
  * @package Stash
18
  * @author Robert Hafner <tedivm@tedivm.com>
19
  */
20
- class ehough_stash_driver_Sqlite implements ehough_stash_driver_DriverInterface
21
  {
22
  protected $defaultOptions = array('filePermissions' => 0660,
23
  'dirPermissions' => 0770,
@@ -53,23 +53,23 @@ class ehough_stash_driver_Sqlite implements ehough_stash_driver_DriverInterface
53
  $version = isset($options['version']) ? $options['version'] : 'any';
54
 
55
  $subdrivers = array();
56
- if(ehough_stash_driver_sub_SqlitePdo::isAvailable()) {
57
  $subdrivers['pdo'] = 'ehough_stash_driver_sub_SqlitePdo';
58
  }
59
- if(ehough_stash_driver_sub_Sqlite::isAvailable()) {
60
  $subdrivers['sqlite'] = 'ehough_stash_driver_sub_Sqlite';
61
  }
62
- if(ehough_stash_driver_sub_SqlitePdo2::isAvailable()) {
63
  $subdrivers['pdo2'] = 'ehough_stash_driver_sub_SqlitePdo2';
64
  }
65
 
66
- if($extension == 'pdo' && $version != '2' && isset($subdrivers['pdo'])) {
67
  $driver = $subdrivers['pdo'];
68
- } elseif($extension == 'sqlite' && isset($subdrivers['sqlite'])) {
69
  $driver = $subdrivers['sqlite'];
70
- } elseif($extension == 'pdo' && $version != '3' && isset($subdrivers['pdo2'])) {
71
  $driver = $subdrivers['pdo2'];
72
- } elseif(count($subdrivers) > 0 && $extension == 'any') {
73
  $driver = reset($subdrivers);
74
  } else {
75
  throw new ehough_stash_exception_RuntimeException('No sqlite extension available.');
@@ -85,7 +85,7 @@ class ehough_stash_driver_Sqlite implements ehough_stash_driver_DriverInterface
85
  }
86
 
87
  /**
88
- * @param array $key
89
  * @return array
90
  */
91
  public function getData($key)
@@ -106,9 +106,9 @@ class ehough_stash_driver_Sqlite implements ehough_stash_driver_DriverInterface
106
  }
107
 
108
  /**
109
- * @param array $key
110
- * @param array $data
111
- * @param int $expiration
112
  * @return bool
113
  */
114
  public function storeData($key, $data, $expiration)
@@ -127,7 +127,7 @@ class ehough_stash_driver_Sqlite implements ehough_stash_driver_DriverInterface
127
 
128
  /**
129
  *
130
- * @param null|array $key
131
  * @return bool
132
  */
133
  public function clear($key = null)
@@ -164,19 +164,19 @@ class ehough_stash_driver_Sqlite implements ehough_stash_driver_DriverInterface
164
  return true;
165
  }
166
 
167
- $expiration = time();
168
  foreach ($databases as $database) {
169
  if ($driver = $this->getSqliteDriver($database, true)) {
170
  $driver->purge();
171
  }
172
  }
 
173
  return true;
174
  }
175
 
176
  /**
177
  *
178
- * @param null|array $key
179
- * @param bool $name = false
180
  * @return ehough_stash_driver_sub_Sqlite
181
  */
182
  protected function getSqliteDriver($key, $name = false)
@@ -211,11 +211,13 @@ class ehough_stash_driver_Sqlite implements ehough_stash_driver_DriverInterface
211
  $driverClass = $this->driverClass;
212
 
213
  if(is_null($driverClass))
 
214
  return false;
215
 
216
  $driver = new $driverClass($file, $this->dirPerms, $this->filePerms, $this->busyTimeout);
217
 
218
  $this->subDrivers[$file] = $driver;
 
219
  return $driver;
220
  }
221
 
@@ -255,19 +257,19 @@ class ehough_stash_driver_Sqlite implements ehough_stash_driver_DriverInterface
255
  */
256
  protected function checkFileSystemPermissions()
257
  {
258
- if(!isset($this->cachePath)) {
259
  throw new ehough_stash_exception_RuntimeException('Cache path was not set correctly.');
260
  }
261
 
262
- if(file_exists($this->cachePath) && !is_dir($this->cachePath)) {
263
  throw new ehough_stash_exception_InvalidArgumentException('Cache path is not a directory.');
264
  }
265
 
266
- if(!is_dir($this->cachePath) && !@mkdir( $this->cachePath, $this->dirPermissions, true )) {
267
  throw new ehough_stash_exception_InvalidArgumentException('Failed to create cache path.');
268
  }
269
 
270
- if(!is_writable($this->cachePath)) {
271
  throw new ehough_stash_exception_InvalidArgumentException('Cache path is not writable.');
272
  }
273
  }
@@ -279,13 +281,13 @@ class ehough_stash_driver_Sqlite implements ehough_stash_driver_DriverInterface
279
  */
280
  protected function checkStatus()
281
  {
282
- if(!self::isAvailable()) {
283
  throw new ehough_stash_exception_RuntimeException('No Sqlite extension is available.');
284
  }
285
 
286
  $driver = $this->getSqliteDriver(array('_none'));
287
 
288
- if(!$driver) {
289
  throw new ehough_stash_exception_RuntimeException('No Sqlite driver could be loaded.');
290
  }
291
 
@@ -298,7 +300,7 @@ class ehough_stash_driver_Sqlite implements ehough_stash_driver_DriverInterface
298
  *
299
  * @return bool
300
  */
301
- static public function isAvailable()
302
  {
303
  return (ehough_stash_driver_sub_SqlitePdo::isAvailable()) || (ehough_stash_driver_sub_Sqlite::isAvailable()) || (ehough_stash_driver_sub_SqlitePdo2::isAvailable());
304
  }
@@ -308,10 +310,10 @@ class ehough_stash_driver_Sqlite implements ehough_stash_driver_DriverInterface
308
  * array, running the string through sqlite_escape_string() and then combining that string to the keystring with a
309
  * delimiter.
310
  *
311
- * @param array $key
312
  * @return string
313
  */
314
- static function makeSqlKey($key)
315
  {
316
  $key = ehough_stash_Utilities::normalizeKeys($key, 'base64_encode');
317
  $path = '';
17
  * @package Stash
18
  * @author Robert Hafner <tedivm@tedivm.com>
19
  */
20
+ class ehough_stash_driver_Sqlite implements ehough_stash_interfaces_DriverInterface
21
  {
22
  protected $defaultOptions = array('filePermissions' => 0660,
23
  'dirPermissions' => 0770,
53
  $version = isset($options['version']) ? $options['version'] : 'any';
54
 
55
  $subdrivers = array();
56
+ if (ehough_stash_driver_sub_SqlitePdo::isAvailable()) {
57
  $subdrivers['pdo'] = 'ehough_stash_driver_sub_SqlitePdo';
58
  }
59
+ if (ehough_stash_driver_sub_Sqlite::isAvailable()) {
60
  $subdrivers['sqlite'] = 'ehough_stash_driver_sub_Sqlite';
61
  }
62
+ if (ehough_stash_driver_sub_SqlitePdo2::isAvailable()) {
63
  $subdrivers['pdo2'] = 'ehough_stash_driver_sub_SqlitePdo2';
64
  }
65
 
66
+ if ($extension == 'pdo' && $version != '2' && isset($subdrivers['pdo'])) {
67
  $driver = $subdrivers['pdo'];
68
+ } elseif ($extension == 'sqlite' && isset($subdrivers['sqlite'])) {
69
  $driver = $subdrivers['sqlite'];
70
+ } elseif ($extension == 'pdo' && $version != '3' && isset($subdrivers['pdo2'])) {
71
  $driver = $subdrivers['pdo2'];
72
+ } elseif (count($subdrivers) > 0 && $extension == 'any') {
73
  $driver = reset($subdrivers);
74
  } else {
75
  throw new ehough_stash_exception_RuntimeException('No sqlite extension available.');
85
  }
86
 
87
  /**
88
+ * @param array $key
89
  * @return array
90
  */
91
  public function getData($key)
106
  }
107
 
108
  /**
109
+ * @param array $key
110
+ * @param array $data
111
+ * @param int $expiration
112
  * @return bool
113
  */
114
  public function storeData($key, $data, $expiration)
127
 
128
  /**
129
  *
130
+ * @param null|array $key
131
  * @return bool
132
  */
133
  public function clear($key = null)
164
  return true;
165
  }
166
 
 
167
  foreach ($databases as $database) {
168
  if ($driver = $this->getSqliteDriver($database, true)) {
169
  $driver->purge();
170
  }
171
  }
172
+
173
  return true;
174
  }
175
 
176
  /**
177
  *
178
+ * @param null|array $key
179
+ * @param bool $name = false
180
  * @return ehough_stash_driver_sub_Sqlite
181
  */
182
  protected function getSqliteDriver($key, $name = false)
211
  $driverClass = $this->driverClass;
212
 
213
  if(is_null($driverClass))
214
+
215
  return false;
216
 
217
  $driver = new $driverClass($file, $this->dirPerms, $this->filePerms, $this->busyTimeout);
218
 
219
  $this->subDrivers[$file] = $driver;
220
+
221
  return $driver;
222
  }
223
 
257
  */
258
  protected function checkFileSystemPermissions()
259
  {
260
+ if (!isset($this->cachePath)) {
261
  throw new ehough_stash_exception_RuntimeException('Cache path was not set correctly.');
262
  }
263
 
264
+ if (file_exists($this->cachePath) && !is_dir($this->cachePath)) {
265
  throw new ehough_stash_exception_InvalidArgumentException('Cache path is not a directory.');
266
  }
267
 
268
+ if (!is_dir($this->cachePath) && !@mkdir( $this->cachePath, $this->dirPermissions, true )) {
269
  throw new ehough_stash_exception_InvalidArgumentException('Failed to create cache path.');
270
  }
271
 
272
+ if (!is_writable($this->cachePath)) {
273
  throw new ehough_stash_exception_InvalidArgumentException('Cache path is not writable.');
274
  }
275
  }
281
  */
282
  protected function checkStatus()
283
  {
284
+ if (!self::isAvailable()) {
285
  throw new ehough_stash_exception_RuntimeException('No Sqlite extension is available.');
286
  }
287
 
288
  $driver = $this->getSqliteDriver(array('_none'));
289
 
290
+ if (!$driver) {
291
  throw new ehough_stash_exception_RuntimeException('No Sqlite driver could be loaded.');
292
  }
293
 
300
  *
301
  * @return bool
302
  */
303
+ public static function isAvailable()
304
  {
305
  return (ehough_stash_driver_sub_SqlitePdo::isAvailable()) || (ehough_stash_driver_sub_Sqlite::isAvailable()) || (ehough_stash_driver_sub_SqlitePdo2::isAvailable());
306
  }
310
  * array, running the string through sqlite_escape_string() and then combining that string to the keystring with a
311
  * delimiter.
312
  *
313
+ * @param array $key
314
  * @return string
315
  */
316
+ public static function makeSqlKey($key)
317
  {
318
  $key = ehough_stash_Utilities::normalizeKeys($key, 'base64_encode');
319
  $path = '';
vendor/ehough/stash/src/main/php/ehough/stash/driver/Xcache.php CHANGED
@@ -17,7 +17,7 @@
17
  *
18
  * @codeCoverageIgnore Just until I figure out how to get phpunit working over http, or xcache over cli
19
  */
20
- class ehough_stash_driver_Xcache implements ehough_stash_driver_DriverInterface
21
  {
22
  protected $ttl = 300;
23
  protected $user;
@@ -25,7 +25,7 @@ class ehough_stash_driver_Xcache implements ehough_stash_driver_DriverInterface
25
 
26
  public function __construct(array $options = array())
27
  {
28
- if(!self::isAvailable()) {
29
  throw new ehough_stash_exception_RuntimeException('Extension is not installed.');
30
  }
31
 
@@ -38,7 +38,7 @@ class ehough_stash_driver_Xcache implements ehough_stash_driver_DriverInterface
38
  }
39
 
40
  if (isset($options['ttl']) && is_numeric($options['ttl'])) {
41
- $this->ttl = (int)$options['ttl'];
42
  }
43
  }
44
 
@@ -55,7 +55,7 @@ class ehough_stash_driver_Xcache implements ehough_stash_driver_DriverInterface
55
  * is not present. This array should have a value for "createdOn" and for "return", which should be the data the
56
  * main script is trying to store.
57
  *
58
- * @param array $key
59
  * @return array
60
  */
61
  public function getData($key)
@@ -70,6 +70,7 @@ class ehough_stash_driver_Xcache implements ehough_stash_driver_DriverInterface
70
  }
71
 
72
  $data = xcache_get($keyString);
 
73
  return unserialize($data);
74
  }
75
 
@@ -79,8 +80,8 @@ class ehough_stash_driver_Xcache implements ehough_stash_driver_DriverInterface
79
  * stored. This function needs to store that data in such a way that it can be retrieved exactly as it was sent. The
80
  * expiration time needs to be stored with this data.
81
  *
82
- * @param array $data
83
- * @param int $expiration
84
  * @return bool
85
  */
86
  public function storeData($key, $data, $expiration)
@@ -91,15 +92,15 @@ class ehough_stash_driver_Xcache implements ehough_stash_driver_DriverInterface
91
  }
92
 
93
  $cacheTime = $this->getCacheTime($expiration);
 
94
  return xcache_set($keyString, serialize(array('return' => $data, 'expiration' => $expiration)), $cacheTime);
95
  }
96
 
97
-
98
  /**
99
  * This function should clear the cache tree using the key array provided. If called with no arguments the entire
100
  * cache needs to be cleared.
101
  *
102
- * @param null|array $key
103
  * @return bool
104
  */
105
  public function clear($key = null)
@@ -129,14 +130,12 @@ class ehough_stash_driver_Xcache implements ehough_stash_driver_DriverInterface
129
 
130
  // xcache loses points for its login choice, but not as many as it gained for xcache_unset_by_prefix
131
  $original = array();
132
- if(isset($_SERVER['PHP_AUTH_USER']))
133
- {
134
  $original['PHP_AUTH_USER'] = $_SERVER['PHP_AUTH_USER'];
135
  unset($_SERVER['PHP_AUTH_USER']);
136
  }
137
 
138
- if(isset($_SERVER['PHP_AUTH_PW']))
139
- {
140
  $original['PHP_AUTH_PW'] = $_SERVER['PHP_AUTH_PW'];
141
  unset($_SERVER['PHP_AUTH_USER']);
142
  }
@@ -147,39 +146,33 @@ class ehough_stash_driver_Xcache implements ehough_stash_driver_DriverInterface
147
  if(isset($this->password))
148
  $_SERVER['PHP_AUTH_PW'] = $this->password;
149
 
150
- if(isset($key) && function_exists('xcache_unset_by_prefix'))
151
- {
152
  $keyString = self::makeKey($key);
153
- if($keyString = self::makeKey($key))
154
- {
155
  // this is such a sexy function, soooo many points to xcache
156
  $return = xcache_unset_by_prefix($keyString);
157
- }else{
158
  return false;
159
  }
160
- }else{
161
  xcache_clear_cache(XC_TYPE_VAR, 0);
162
  $return = true;
163
  }
164
 
165
- if(isset($original['PHP_AUTH_USER']))
166
- {
167
  $_SERVER['PHP_AUTH_USER'] = $original['PHP_AUTH_USER'];
168
- }elseif(isset($_SERVER['PHP_AUTH_USER'])){
169
  unset($_SERVER['PHP_AUTH_USER']);
170
  }
171
 
172
- if(isset($original['PHP_AUTH_PW']))
173
- {
174
  $_SERVER['PHP_AUTH_PW'] = $original['PHP_AUTH_PW'];
175
- }elseif(isset($_SERVER['PHP_AUTH_PW'])){
176
  unset($_SERVER['PHP_AUTH_PW']);
177
  }
178
 
179
  return $return;
180
 
181
-
182
-
183
  */
184
 
185
  }
@@ -189,7 +182,7 @@ class ehough_stash_driver_Xcache implements ehough_stash_driver_DriverInterface
189
  *
190
  * @return bool true
191
  */
192
- static public function isAvailable()
193
  {
194
  return extension_loaded('xcache') && 'cli' !== php_sapi_name();
195
  }
17
  *
18
  * @codeCoverageIgnore Just until I figure out how to get phpunit working over http, or xcache over cli
19
  */
20
+ class ehough_stash_driver_Xcache implements ehough_stash_interfaces_DriverInterface
21
  {
22
  protected $ttl = 300;
23
  protected $user;
25
 
26
  public function __construct(array $options = array())
27
  {
28
+ if (!self::isAvailable()) {
29
  throw new ehough_stash_exception_RuntimeException('Extension is not installed.');
30
  }
31
 
38
  }
39
 
40
  if (isset($options['ttl']) && is_numeric($options['ttl'])) {
41
+ $this->ttl = (int) $options['ttl'];
42
  }
43
  }
44
 
55
  * is not present. This array should have a value for "createdOn" and for "return", which should be the data the
56
  * main script is trying to store.
57
  *
58
+ * @param array $key
59
  * @return array
60
  */
61
  public function getData($key)
70
  }
71
 
72
  $data = xcache_get($keyString);
73
+
74
  return unserialize($data);
75
  }
76
 
80
  * stored. This function needs to store that data in such a way that it can be retrieved exactly as it was sent. The
81
  * expiration time needs to be stored with this data.
82
  *
83
+ * @param array $data
84
+ * @param int $expiration
85
  * @return bool
86
  */
87
  public function storeData($key, $data, $expiration)
92
  }
93
 
94
  $cacheTime = $this->getCacheTime($expiration);
95
+
96
  return xcache_set($keyString, serialize(array('return' => $data, 'expiration' => $expiration)), $cacheTime);
97
  }
98
 
 
99
  /**
100
  * This function should clear the cache tree using the key array provided. If called with no arguments the entire
101
  * cache needs to be cleared.
102
  *
103
+ * @param null|array $key
104
  * @return bool
105
  */
106
  public function clear($key = null)
130
 
131
  // xcache loses points for its login choice, but not as many as it gained for xcache_unset_by_prefix
132
  $original = array();
133
+ if (isset($_SERVER['PHP_AUTH_USER'])) {
 
134
  $original['PHP_AUTH_USER'] = $_SERVER['PHP_AUTH_USER'];
135
  unset($_SERVER['PHP_AUTH_USER']);
136
  }
137
 
138
+ if (isset($_SERVER['PHP_AUTH_PW'])) {
 
139
  $original['PHP_AUTH_PW'] = $_SERVER['PHP_AUTH_PW'];
140
  unset($_SERVER['PHP_AUTH_USER']);
141
  }
146
  if(isset($this->password))
147
  $_SERVER['PHP_AUTH_PW'] = $this->password;
148
 
149
+ if (isset($key) && function_exists('xcache_unset_by_prefix')) {
 
150
  $keyString = self::makeKey($key);
151
+ if ($keyString = self::makeKey($key)) {
 
152
  // this is such a sexy function, soooo many points to xcache
153
  $return = xcache_unset_by_prefix($keyString);
154
+ } else {
155
  return false;
156
  }
157
+ } else {
158
  xcache_clear_cache(XC_TYPE_VAR, 0);
159
  $return = true;
160
  }
161
 
162
+ if (isset($original['PHP_AUTH_USER'])) {
 
163
  $_SERVER['PHP_AUTH_USER'] = $original['PHP_AUTH_USER'];
164
+ } elseif (isset($_SERVER['PHP_AUTH_USER'])) {
165
  unset($_SERVER['PHP_AUTH_USER']);
166
  }
167
 
168
+ if (isset($original['PHP_AUTH_PW'])) {
 
169
  $_SERVER['PHP_AUTH_PW'] = $original['PHP_AUTH_PW'];
170
+ } elseif (isset($_SERVER['PHP_AUTH_PW'])) {
171
  unset($_SERVER['PHP_AUTH_PW']);
172
  }
173
 
174
  return $return;
175
 
 
 
176
  */
177
 
178
  }
182
  *
183
  * @return bool true
184
  */
185
+ public static function isAvailable()
186
  {
187
  return extension_loaded('xcache') && 'cli' !== php_sapi_name();
188
  }
vendor/ehough/stash/src/main/php/ehough/stash/driver/sub/Memcache.php CHANGED
@@ -20,7 +20,6 @@ class ehough_stash_driver_sub_Memcache
20
  */
21
  protected $memcached;
22
 
23
-
24
  public function initialize($servers, array $options = array())
25
  {
26
  $memcache = new Memcache();
@@ -28,7 +27,7 @@ class ehough_stash_driver_sub_Memcache
28
  foreach ($servers as $server) {
29
  $host = $server[0];
30
  $port = isset($server[1]) ? $server[1] : 11211;
31
- $weight = isset($server[2]) ? (int)$server[2] : null;
32
 
33
  if (is_integer($weight)) {
34
  $memcache->addServer($host, $port, true, $weight);
@@ -42,9 +41,10 @@ class ehough_stash_driver_sub_Memcache
42
 
43
  public function set($key, $value, $expire = null)
44
  {
45
- if(isset($expire) && $expire < time()) {
46
  return true;
47
  }
 
48
  return $this->memcached->set($key, array('data' => $value, 'expiration' => $expire), null, $expire);
49
  }
50
 
@@ -60,12 +60,14 @@ class ehough_stash_driver_sub_Memcache
60
  }
61
 
62
  $this->memcached->set($key, $value);
 
63
  return $value;
64
  }
65
 
66
  public function inc($key)
67
  {
68
  $this->cas($key, 0);
 
69
  return $this->memcached->increment($key);
70
  }
71
 
@@ -74,7 +76,7 @@ class ehough_stash_driver_sub_Memcache
74
  $this->memcached->flush();
75
  }
76
 
77
- static public function isAvailable()
78
  {
79
  return class_exists('Memcache', false);
80
  }
20
  */
21
  protected $memcached;
22
 
 
23
  public function initialize($servers, array $options = array())
24
  {
25
  $memcache = new Memcache();
27
  foreach ($servers as $server) {
28
  $host = $server[0];
29
  $port = isset($server[1]) ? $server[1] : 11211;
30
+ $weight = isset($server[2]) ? (int) $server[2] : null;
31
 
32
  if (is_integer($weight)) {
33
  $memcache->addServer($host, $port, true, $weight);
41
 
42
  public function set($key, $value, $expire = null)
43
  {
44
+ if (isset($expire) && $expire < time()) {
45
  return true;
46
  }
47
+
48
  return $this->memcached->set($key, array('data' => $value, 'expiration' => $expire), null, $expire);
49
  }
50
 
60
  }
61
 
62
  $this->memcached->set($key, $value);
63
+
64
  return $value;
65
  }
66
 
67
  public function inc($key)
68
  {
69
  $this->cas($key, 0);
70
+
71
  return $this->memcached->increment($key);
72
  }
73
 
76
  $this->memcached->flush();
77
  }
78
 
79
+ public static function isAvailable()
80
  {
81
  return class_exists('Memcache', false);
82
  }
vendor/ehough/stash/src/main/php/ehough/stash/driver/sub/Memcached.php CHANGED
@@ -113,7 +113,7 @@ class ehough_stash_driver_sub_Memcached
113
  break;
114
  }
115
 
116
- if(!@$memcached->setOption(constant('Memcached::OPT_' . $name), $value)) {
117
  throw new ehough_stash_exception_RuntimeException('Memcached option Memcached::OPT_' . $name . ' not accepted by memcached extension.');
118
  }
119
  }
@@ -123,9 +123,10 @@ class ehough_stash_driver_sub_Memcached
123
 
124
  public function set($key, $value, $expire = null)
125
  {
126
- if(isset($expire) && $expire < time()) {
127
  return true;
128
  }
 
129
  return $this->memcached->set($key, array('data' => $value, 'expiration' => $expire), $expire);
130
  }
131
 
@@ -150,12 +151,14 @@ class ehough_stash_driver_sub_Memcached
150
  } else {
151
  $this->memcached->cas($token, $key, $value);
152
  }
 
153
  return $value;
154
  }
155
 
156
  public function inc($key)
157
  {
158
  $this->cas($key, 0);
 
159
  return $this->memcached->increment($key);
160
  }
161
 
@@ -164,7 +167,7 @@ class ehough_stash_driver_sub_Memcached
164
  $this->memcached->flush();
165
  }
166
 
167
- static public function isAvailable()
168
  {
169
  return class_exists('Memcached', false);
170
  }
113
  break;
114
  }
115
 
116
+ if (!@$memcached->setOption(constant('Memcached::OPT_' . $name), $value)) {
117
  throw new ehough_stash_exception_RuntimeException('Memcached option Memcached::OPT_' . $name . ' not accepted by memcached extension.');
118
  }
119
  }
123
 
124
  public function set($key, $value, $expire = null)
125
  {
126
+ if (isset($expire) && $expire < time()) {
127
  return true;
128
  }
129
+
130
  return $this->memcached->set($key, array('data' => $value, 'expiration' => $expire), $expire);
131
  }
132
 
151
  } else {
152
  $this->memcached->cas($token, $key, $value);
153
  }
154
+
155
  return $value;
156
  }
157
 
158
  public function inc($key)
159
  {
160
  $this->cas($key, 0);
161
+
162
  return $this->memcached->increment($key);
163
  }
164
 
167
  $this->memcached->flush();
168
  }
169
 
170
+ public static function isAvailable()
171
  {
172
  return class_exists('Memcached', false);
173
  }
vendor/ehough/stash/src/main/php/ehough/stash/driver/sub/Sqlite.php CHANGED
@@ -26,7 +26,6 @@ class ehough_stash_driver_sub_Sqlite
26
  );
27
  CREATE INDEX keyIndex ON cacheStore (key);';
28
 
29
-
30
  protected $filePermissions;
31
  protected $dirPermissions;
32
  protected $busyTimeout;
@@ -72,14 +71,12 @@ class ehough_stash_driver_sub_Sqlite
72
 
73
  $data = base64_encode(serialize($value));
74
 
75
- $resetBusy = false;
76
  $contentLength = strlen($data);
77
  if ($contentLength > 100000) {
78
- $resetBusy = true;
79
  $this->setTimeout($this->busyTimeout * (ceil($contentLength / 100000))); // .5s per 100k
80
  }
81
 
82
- $query = $driver->query("INSERT INTO cacheStore (key, expiration, data)
83
  VALUES ('{$key}', '{$expiration}', '{$data}')");
84
 
85
  return true;
@@ -98,8 +95,9 @@ class ehough_stash_driver_sub_Sqlite
98
  $this->driver = false;
99
  ehough_stash_Utilities::deleteRecursive($this->path);
100
  } else {
101
- $query = $driver->query("DELETE FROM cacheStore WHERE key LIKE '{$key}%'");
102
  }
 
103
  return true;
104
  }
105
 
@@ -111,21 +109,22 @@ class ehough_stash_driver_sub_Sqlite
111
 
112
  $driver->query('DELETE FROM cacheStore WHERE expiration < ' . time());
113
  $driver->query('VACUUM');
 
114
  return true;
115
  }
116
 
117
  public function checkFileSystemPermissions()
118
  {
119
- if(!isset($this->path)) {
120
  throw new ehough_stash_exception_RuntimeException('No cache path is set.');
121
  }
122
 
123
- if(!is_writable($this->path) && !is_writable(dirname($this->path))) {
124
  throw new ehough_stash_exception_InvalidArgumentException('The cache sqlite file is not writable.');
125
  }
126
  }
127
 
128
- static public function isAvailable()
129
  {
130
  return class_exists('SQLiteDatabase', false);
131
  }
@@ -153,13 +152,6 @@ class ehough_stash_driver_sub_Sqlite
153
  $pos2 = strrpos($this->path, '\\');
154
 
155
  if ($pos1 || $pos2) {
156
- if ($pos1 === false) {
157
- $pos = $pos2;
158
- }
159
- if ($pos2 === false) {
160
- $pos = $pos1;
161
- }
162
-
163
  $pos = $pos1 >= $pos2 ? $pos1 : $pos2;
164
  $dir = substr($this->path, 0, $pos);
165
  }
@@ -191,6 +183,7 @@ class ehough_stash_driver_sub_Sqlite
191
  if (!$db = new SQLiteDatabase($this->path, $this->filePermissions, $errorMessage)) {
192
  throw new ehough_stash_exception_RuntimeException('Unable to open SQLite Database: ' . $errorMessage);
193
  }
 
194
  return $db;
195
  }
196
  }
26
  );
27
  CREATE INDEX keyIndex ON cacheStore (key);';
28
 
 
29
  protected $filePermissions;
30
  protected $dirPermissions;
31
  protected $busyTimeout;
71
 
72
  $data = base64_encode(serialize($value));
73
 
 
74
  $contentLength = strlen($data);
75
  if ($contentLength > 100000) {
 
76
  $this->setTimeout($this->busyTimeout * (ceil($contentLength / 100000))); // .5s per 100k
77
  }
78
 
79
+ $driver->query("INSERT INTO cacheStore (key, expiration, data)
80
  VALUES ('{$key}', '{$expiration}', '{$data}')");
81
 
82
  return true;
95
  $this->driver = false;
96
  ehough_stash_Utilities::deleteRecursive($this->path);
97
  } else {
98
+ $driver->query("DELETE FROM cacheStore WHERE key LIKE '{$key}%'");
99
  }
100
+
101
  return true;
102
  }
103
 
109
 
110
  $driver->query('DELETE FROM cacheStore WHERE expiration < ' . time());
111
  $driver->query('VACUUM');
112
+
113
  return true;
114
  }
115
 
116
  public function checkFileSystemPermissions()
117
  {
118
+ if (!isset($this->path)) {
119
  throw new ehough_stash_exception_RuntimeException('No cache path is set.');
120
  }
121
 
122
+ if (!is_writable($this->path) && !is_writable(dirname($this->path))) {
123
  throw new ehough_stash_exception_InvalidArgumentException('The cache sqlite file is not writable.');
124
  }
125
  }
126
 
127
+ public static function isAvailable()
128
  {
129
  return class_exists('SQLiteDatabase', false);
130
  }
152
  $pos2 = strrpos($this->path, '\\');
153
 
154
  if ($pos1 || $pos2) {
 
 
 
 
 
 
 
155
  $pos = $pos1 >= $pos2 ? $pos1 : $pos2;
156
  $dir = substr($this->path, 0, $pos);
157
  }
183
  if (!$db = new SQLiteDatabase($this->path, $this->filePermissions, $errorMessage)) {
184
  throw new ehough_stash_exception_RuntimeException('Unable to open SQLite Database: ' . $errorMessage);
185
  }
186
+
187
  return $db;
188
  }
189
  }
vendor/ehough/stash/src/main/php/ehough/stash/driver/sub/SqlitePdo.php CHANGED
@@ -24,9 +24,10 @@ class ehough_stash_driver_sub_SqlitePdo extends ehough_stash_driver_sub_Sqlite
24
  $this->responseCode = PDO::FETCH_ASSOC;
25
  }
26
 
27
- static public function isAvailable()
28
  {
29
  $drivers = class_exists('PDO', false) ? PDO::getAvailableDrivers() : array();
 
30
  return in_array('sqlite', $drivers);
31
  }
32
 
@@ -43,6 +44,7 @@ class ehough_stash_driver_sub_SqlitePdo extends ehough_stash_driver_sub_Sqlite
43
  protected function buildDriver()
44
  {
45
  $db = new PDO('sqlite:' . $this->path);
 
46
  return $db;
47
  }
48
  }
24
  $this->responseCode = PDO::FETCH_ASSOC;
25
  }
26
 
27
+ public static function isAvailable()
28
  {
29
  $drivers = class_exists('PDO', false) ? PDO::getAvailableDrivers() : array();
30
+
31
  return in_array('sqlite', $drivers);
32
  }
33
 
44
  protected function buildDriver()
45
  {
46
  $db = new PDO('sqlite:' . $this->path);
47
+
48
  return $db;
49
  }
50
  }
vendor/ehough/stash/src/main/php/ehough/stash/driver/sub/SqlitePdo2.php CHANGED
@@ -15,15 +15,17 @@
15
  */
16
  class ehough_stash_driver_sub_SqlitePdo2 extends ehough_stash_driver_sub_SqlitePdo
17
  {
18
- static public function isAvailable()
19
  {
20
  $drivers = class_exists('PDO', false) ? PDO::getAvailableDrivers() : array();
 
21
  return in_array('sqlite2', $drivers);
22
  }
23
 
24
  protected function buildDriver()
25
  {
26
  $db = new PDO('sqlite2:' . $this->path);
 
27
  return $db;
28
  }
29
  }
15
  */
16
  class ehough_stash_driver_sub_SqlitePdo2 extends ehough_stash_driver_sub_SqlitePdo
17
  {
18
+ public static function isAvailable()
19
  {
20
  $drivers = class_exists('PDO', false) ? PDO::getAvailableDrivers() : array();
21
+
22
  return in_array('sqlite2', $drivers);
23
  }
24
 
25
  protected function buildDriver()
26
  {
27
  $db = new PDO('sqlite2:' . $this->path);
28
+
29
  return $db;
30
  }
31
  }
vendor/ehough/stash/src/main/php/ehough/stash/exception/Exception.php CHANGED
@@ -9,8 +9,6 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- //namespace Stash\Exception;
13
-
14
  /**
15
  * Interface for the Stash exceptions.
16
  *
@@ -19,4 +17,4 @@
19
  */
20
  interface ehough_stash_exception_Exception
21
  {
22
- }
9
  * file that was distributed with this source code.
10
  */
11
 
 
 
12
  /**
13
  * Interface for the Stash exceptions.
14
  *
17
  */
18
  interface ehough_stash_exception_Exception
19
  {
20
+ }
vendor/ehough/stash/src/main/php/ehough/stash/exception/InvalidArgumentException.php CHANGED
@@ -9,8 +9,6 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- //namespace Stash\Exception;
13
-
14
  /**
15
  * Exception thrown if an argument does not match with the expected value.
16
  *
@@ -19,4 +17,4 @@
19
  */
20
  class ehough_stash_exception_InvalidArgumentException extends InvalidArgumentException implements ehough_stash_exception_Exception
21
  {
22
- }
9
  * file that was distributed with this source code.
10
  */
11
 
 
 
12
  /**
13
  * Exception thrown if an argument does not match with the expected value.
14
  *
17
  */
18
  class ehough_stash_exception_InvalidArgumentException extends InvalidArgumentException implements ehough_stash_exception_Exception
19
  {
20
+ }
vendor/ehough/stash/src/main/php/ehough/stash/exception/LogicException.php CHANGED
@@ -9,15 +9,13 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- //namespace Stash\Exception;
13
-
14
  /**
15
  * Exception that represents error in the program logic.
16
  * This kind of exceptions should directly lead to a fix in your code.
17
- *
18
  * @package Stash
19
  * @author Robert Hafner <tedivm@tedivm.com>
20
  */
21
  class ehough_stash_exception_LogicException extends LogicException implements ehough_stash_exception_Exception
22
  {
23
- }
9
  * file that was distributed with this source code.
10
  */
11
 
 
 
12
  /**
13
  * Exception that represents error in the program logic.
14
  * This kind of exceptions should directly lead to a fix in your code.
15
+ *
16
  * @package Stash
17
  * @author Robert Hafner <tedivm@tedivm.com>
18
  */
19
  class ehough_stash_exception_LogicException extends LogicException implements ehough_stash_exception_Exception
20
  {
21
+ }
vendor/ehough/stash/src/main/php/ehough/stash/exception/RuntimeException.php CHANGED
@@ -9,8 +9,6 @@
9
  * file that was distributed with this source code.
10
  */
11
 
12
- //namespace Stash\Exception;
13
-
14
  /**
15
  * Exception thrown if an error which can only be found on runtime occurs.
16
  *
@@ -19,4 +17,4 @@
19
  */
20
  class ehough_stash_exception_RuntimeException extends RuntimeException implements ehough_stash_exception_Exception
21
  {
22
- }
9
  * file that was distributed with this source code.
10
  */
11
 
 
 
12
  /**
13
  * Exception thrown if an error which can only be found on runtime occurs.
14
  *
17
  */
18
  class ehough_stash_exception_RuntimeException extends RuntimeException implements ehough_stash_exception_Exception
19
  {
20
+ }
vendor/ehough/stash/src/main/php/ehough/stash/exception/WindowsPathMaxLengthException.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Stash package.
5
+ *
6
+ * (c) Robert Hafner <tedivm@tedivm.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ /**
13
+ * Thrown when path exceeds 260 total Windows PHP character limit.
14
+ *
15
+ * Solutions:
16
+ * 1. Move the cache path to a root directory to reduce path length.
17
+ * 2. Use a different Stash driver, such as SQLite.
18
+ * 3. Use less subkeys to reduce the depth of the cache path.
19
+ * 4. Switch to a shorter hashing algorithm such as crc32 (not recommended as could produce collisions)
20
+ *
21
+ * Reasons we can't fix this:
22
+ * * PHP currently does not and will not support Windows extended length paths (\\?\C:\...)
23
+ * http://www.mail-archive.com/internals@lists.php.net/msg62672.html
24
+ *
25
+ * Class WindowsPathMaxLengthException
26
+ * @package Stash\Exception
27
+ * @author Jonathan Chan <jc@jmccc.com>
28
+ */
29
+ class ehough_stash_exception_WindowsPathMaxLengthException extends Exception implements ehough_stash_exception_Exception
30
+ {
31
+ public function __construct($message="",$code=0,$previous=null)
32
+ {
33
+ parent::__construct("Cache path exceeds Windows PHP MAX_LENGTH of 260 characters. " . $message,$code,$previous);
34
+ }
35
+ }
vendor/ehough/stash/src/main/php/ehough/stash/{driver → interfaces}/DriverInterface.php RENAMED
@@ -10,7 +10,7 @@
10
  */
11
 
12
  /**
13
- * Stash ehough_stash_Drivers are the engines behind the Stash library. These classes handle the low level operations- retrieving,
14
  * storing and deleting items in the persistant cache pool. By creating new drivers developers can add new caching
15
  * methods to their applications with extremely minimal changes to their existing code base. This interface defines the
16
  * standard for those drivers and all of them are required to implement it. When writing new cache storage engines this
@@ -38,7 +38,7 @@
38
  * @author Robert Hafner <tedivm@tedivm.com>
39
  */
40
 
41
- interface ehough_stash_driver_DriverInterface
42
  {
43
  /**
44
  * Takes an array which is used to pass option values to the driver. As this is the only required function that is
@@ -54,7 +54,7 @@ interface ehough_stash_driver_DriverInterface
54
  * two keys- a 'data' key and an 'expiration' key. The 'data' key should be exactly the same as the value passed to
55
  * storeData.
56
  *
57
- * @param array $key
58
  * @return array
59
  */
60
  public function getData($key);
@@ -73,9 +73,9 @@ interface ehough_stash_driver_DriverInterface
73
  * *The third parameter is the expiration date of the item as a timestamp. This should also be stored, as it is
74
  * needed by the getData function.
75
  *
76
- * @param array $key
77
- * @param array $data
78
- * @param int $expiration
79
  * @return bool
80
  */
81
  public function storeData($key, $data, $expiration);
@@ -84,7 +84,7 @@ interface ehough_stash_driver_DriverInterface
84
  * Clears the cache tree using the key array provided as the key. If called with no arguments the entire cache gets
85
  * cleared.
86
  *
87
- * @param null|array $key
88
  * @return bool
89
  */
90
  public function clear($key = null);
@@ -107,5 +107,5 @@ interface ehough_stash_driver_DriverInterface
107
  *
108
  * @return bool
109
  */
110
- static public function isAvailable();
111
  }
10
  */
11
 
12
  /**
13
+ * Stash Drivers are the engines behind the Stash library. These classes handle the low level operations- retrieving,
14
  * storing and deleting items in the persistant cache pool. By creating new drivers developers can add new caching
15
  * methods to their applications with extremely minimal changes to their existing code base. This interface defines the
16
  * standard for those drivers and all of them are required to implement it. When writing new cache storage engines this
38
  * @author Robert Hafner <tedivm@tedivm.com>
39
  */
40
 
41
+ interface ehough_stash_interfaces_DriverInterface
42
  {
43
  /**
44
  * Takes an array which is used to pass option values to the driver. As this is the only required function that is
54
  * two keys- a 'data' key and an 'expiration' key. The 'data' key should be exactly the same as the value passed to
55
  * storeData.
56
  *
57
+ * @param array $key
58
  * @return array
59
  */
60
  public function getData($key);
73
  * *The third parameter is the expiration date of the item as a timestamp. This should also be stored, as it is
74
  * needed by the getData function.
75
  *
76
+ * @param array $key
77
+ * @param array $data
78
+ * @param int $expiration
79
  * @return bool
80
  */
81
  public function storeData($key, $data, $expiration);
84
  * Clears the cache tree using the key array provided as the key. If called with no arguments the entire cache gets
85
  * cleared.
86
  *
87
+ * @param null|array $key
88
  * @return bool
89
  */
90
  public function clear($key = null);
107
  *
108
  * @return bool
109
  */
110
+ public static function isAvailable();
111
  }
vendor/ehough/stash/src/main/php/ehough/stash/interfaces/ItemInterface.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Stash package.
5
+ *
6
+ * (c) Robert Hafner <tedivm@tedivm.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ interface ehough_stash_interfaces_ItemInterface
13
+ {
14
+
15
+ public function disable();
16
+
17
+ public function getKey();
18
+
19
+ public function clear();
20
+
21
+ public function get($invalidation = 0, $arg = null, $arg2 = null);
22
+
23
+ public function isMiss();
24
+
25
+ public function lock($ttl = null);
26
+
27
+ public function set($data, $ttl = null);
28
+
29
+ public function extend($ttl = null);
30
+
31
+ public function isDisabled();
32
+
33
+ public function setLogger($logger);
34
+ }
vendor/ehough/stash/src/main/php/ehough/stash/interfaces/PoolInterface.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Stash package.
5
+ *
6
+ * (c) Robert Hafner <tedivm@tedivm.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ /**
13
+ *
14
+ *
15
+ * @package Stash
16
+ * @author Robert Hafner <tedivm@tedivm.com>
17
+ */
18
+ interface ehough_stash_interfaces_PoolInterface
19
+ {
20
+ public function getItem();
21
+
22
+ public function getItemIterator($keys);
23
+
24
+ public function flush();
25
+
26
+ public function purge();
27
+
28
+ public function setDriver(ehough_stash_interfaces_DriverInterface $driver);
29
+
30
+ public function getDriver();
31
+
32
+ public function setLogger($logger);
33
+ }
vendor/ehough/stash/src/main/php/ehough/stash/interfaces/drivers/ExtendInterface.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Stash package.
5
+ *
6
+ * (c) Robert Hafner <tedivm@tedivm.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ interface ehough_stash_interfaces_drivers_ExtendInterface
13
+ {
14
+ public function extend($ttl);
15
+ }
vendor/ehough/stash/src/main/php/ehough/stash/interfaces/drivers/IncDecInterface.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Stash package.
5
+ *
6
+ * (c) Robert Hafner <tedivm@tedivm.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ interface ehough_stash_interfaces_drivers_IncDecInterface
13
+ {
14
+ public function inc();
15
+
16
+ public function dec();
17
+ }
vendor/ehough/stash/src/main/php/ehough/stash/interfaces/drivers/MultiInterface.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Stash package.
5
+ *
6
+ * (c) Robert Hafner <tedivm@tedivm.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ interface ehough_stash_interfaces_drivers_MultiInterface
13
+ {
14
+ public function multiGet(array $keys);
15
+
16
+ public function multiSet(array $data);
17
+ }
vendor/ehough/stash/src/main/php/ehough/stash/session/SessionHandlerInterface.php CHANGED
@@ -22,9 +22,9 @@
22
  // php versions involved.
23
 
24
  // @codeCoverageIgnoreStart
25
- if(version_compare(phpversion(), '5.4.0', '>=')){
26
  interface ehough_stash_session_SessionHandlerInterface extends SessionHandlerInterface {}
27
- }else{
28
  interface ehough_stash_session_SessionHandlerInterface {}
29
  }
30
- //@codeCoverageIgnoreStart
22
  // php versions involved.
23
 
24
  // @codeCoverageIgnoreStart
25
+ if (version_compare(phpversion(), '5.4.0', '>=')){
26
  interface ehough_stash_session_SessionHandlerInterface extends SessionHandlerInterface {}
27
+ } else {
28
  interface ehough_stash_session_SessionHandlerInterface {}
29
  }
30
+ //@codeCoverageIgnoreStart
vendor/ehough/tickertape/src/main/php/ehough/tickertape/Event.php CHANGED
@@ -76,6 +76,8 @@ class ehough_tickertape_Event
76
  *
77
  * @param ehough_tickertape_EventDispatcherInterface $dispatcher
78
  *
 
 
79
  * @api
80
  */
81
  public function setDispatcher(ehough_tickertape_EventDispatcherInterface $dispatcher)
@@ -88,6 +90,8 @@ class ehough_tickertape_Event
88
  *
89
  * @return ehough_tickertape_EventDispatcherInterface
90
  *
 
 
91
  * @api
92
  */
93
  public function getDispatcher()
@@ -100,6 +104,8 @@ class ehough_tickertape_Event
100
  *
101
  * @return string
102
  *
 
 
103
  * @api
104
  */
105
  public function getName()
@@ -112,6 +118,8 @@ class ehough_tickertape_Event
112
  *
113
  * @param string $name The event name.
114
  *
 
 
115
  * @api
116
  */
117
  public function setName($name)
76
  *
77
  * @param ehough_tickertape_EventDispatcherInterface $dispatcher
78
  *
79
+ * @deprecated Deprecated in 2.4, to be removed in 3.0. The event dispatcher is passed to the listener call.
80
+ *
81
  * @api
82
  */
83
  public function setDispatcher(ehough_tickertape_EventDispatcherInterface $dispatcher)
90
  *
91
  * @return ehough_tickertape_EventDispatcherInterface
92
  *
93
+ * @deprecated Deprecated in 2.4, to be removed in 3.0. The event dispatcher is passed to the listener call.
94
+ *
95
  * @api
96
  */
97
  public function getDispatcher()
104
  *
105
  * @return string
106
  *
107
+ * @deprecated Deprecated in 2.4, to be removed in 3.0. The event name is passed to the listener call.
108
+ *
109
  * @api
110
  */
111
  public function getName()
118
  *
119
  * @param string $name The event name.
120
  *
121
+ * @deprecated Deprecated in 2.4, to be removed in 3.0. The event name is passed to the listener call.
122
+ *
123
  * @api
124
  */
125
  public function setName($name)
vendor/ehough/tickertape/src/main/php/ehough/tickertape/EventDispatcher.php CHANGED
@@ -154,14 +154,14 @@ class ehough_tickertape_EventDispatcher implements ehough_tickertape_EventDispat
154
  * This method can be overridden to add functionality that is executed
155
  * for each listener.
156
  *
157
- * @param array[callback] $listeners The event listeners.
158
- * @param string $eventName The name of the event to dispatch.
159
- * @param ehough_tickertape_Event $event The event object to pass to the event handlers/listeners.
160
  */
161
  protected function doDispatch($listeners, $eventName, ehough_tickertape_Event $event)
162
  {
163
  foreach ($listeners as $listener) {
164
- call_user_func($listener, $event);
165
  if ($event->isPropagationStopped()) {
166
  break;
167
  }
154
  * This method can be overridden to add functionality that is executed
155
  * for each listener.
156
  *
157
+ * @param callable[] $listeners The event listeners.
158
+ * @param string $eventName The name of the event to dispatch.
159
+ * @param ehough_tickertape_Event $event The event object to pass to the event handlers/listeners.
160
  */
161
  protected function doDispatch($listeners, $eventName, ehough_tickertape_Event $event)
162
  {
163
  foreach ($listeners as $listener) {
164
+ call_user_func($listener, $event, $eventName, $this);
165
  if ($event->isPropagationStopped()) {
166
  break;
167
  }
vendor/ehough/tickertape/src/main/php/ehough/tickertape/GenericEvent.php CHANGED
@@ -21,7 +21,7 @@
21
  class ehough_tickertape_GenericEvent extends ehough_tickertape_Event implements ArrayAccess, IteratorAggregate
22
  {
23
  /**
24
- * Observer pattern subject.
25
  *
26
  * @var mixed usually object or callable
27
  */
21
  class ehough_tickertape_GenericEvent extends ehough_tickertape_Event implements ArrayAccess, IteratorAggregate
22
  {
23
  /**
24
+ * Event subject.
25
  *
26
  * @var mixed usually object or callable
27
  */