LiteSpeed Cache - Version 1.2.3.1

Version Description

  • September 20 2017 =
  • [UPDATE] Improved PHP5.3 compatibility.
Download this release

Release Info

Developer LiteSpeedTech
Plugin Icon 128x128 LiteSpeed Cache
Version 1.2.3.1
Comparing to
See all releases

Code changes from version 1.1.6 to 1.2.3.1

Files changed (248) hide show
  1. admin/css/litespeed-btn.css +0 -730
  2. admin/css/litespeed-cache-admin.css +0 -269
  3. admin/css/litespeed-callout.css +0 -63
  4. admin/css/litespeed-checkbox.css +0 -356
  5. admin/css/litespeed-common.css +0 -81
  6. admin/css/litespeed-icon.css +0 -27
  7. admin/css/litespeed-label.css +0 -67
  8. admin/css/litespeed.css +1169 -0
  9. admin/css/snowman.css +0 -685
  10. admin/img/icons/all.svg +65 -0
  11. admin/img/icons/all_transients.svg +33 -0
  12. admin/img/icons/auto_draft.svg +54 -0
  13. admin/img/icons/cross_icon.svg +41 -0
  14. admin/img/icons/db.svg +21 -0
  15. admin/img/icons/empty-cache.svg +60 -0
  16. admin/img/icons/expired_transient.svg +38 -0
  17. admin/img/icons/optimize_tables.svg +30 -0
  18. admin/img/icons/purge-403.svg +47 -0
  19. admin/img/icons/purge-404.svg +41 -0
  20. admin/img/icons/purge-500.svg +46 -0
  21. admin/img/icons/purge-all.svg +46 -0
  22. admin/img/icons/purge-cssjs.svg +50 -0
  23. admin/img/icons/purge-front.svg +32 -0
  24. admin/img/icons/purge-pages.svg +41 -0
  25. admin/img/icons/revision.svg +64 -0
  26. admin/img/icons/spam_comment.svg +38 -0
  27. admin/img/icons/success_icon.svg +42 -0
  28. admin/img/icons/trackback-pingback.svg +30 -0
  29. admin/img/icons/trash_comment.svg +64 -0
  30. admin/img/icons/trash_post.svg +48 -0
  31. admin/js/litespeed-cache-admin.js +24 -3
  32. admin/litespeed-cache-admin-display.class.php +31 -17
  33. admin/litespeed-cache-admin-error.class.php +2 -3
  34. admin/litespeed-cache-admin-optimize.class.php +188 -0
  35. admin/litespeed-cache-admin-report.class.php +2 -3
  36. admin/litespeed-cache-admin-rules.class.php +12 -26
  37. admin/litespeed-cache-admin-settings.class.php +238 -132
  38. admin/litespeed-cache-admin.class.php +4 -5
  39. admin/tpl/crawler.php +23 -24
  40. admin/tpl/edit_htaccess.php +13 -11
  41. admin/tpl/esi_widget_edit.php +49 -15
  42. admin/tpl/info.php +4 -4
  43. admin/tpl/info_common_rewrite.php +6 -6
  44. admin/tpl/info_config.php +4 -4
  45. admin/tpl/info_faqs.php +1 -1
  46. admin/tpl/manage.php +38 -181
  47. admin/tpl/manage_db.php +85 -0
  48. admin/tpl/manage_purge.php +187 -0
  49. admin/tpl/network_settings.php +9 -6
  50. admin/tpl/network_settings_cache.php +1 -1
  51. admin/tpl/network_settings_general.php +1 -1
  52. admin/tpl/network_settings_purge.php +1 -1
  53. admin/tpl/report.php +7 -6
  54. admin/tpl/settings.php +20 -12
  55. admin/tpl/settings_advanced.php +13 -12
  56. admin/tpl/settings_cache.php +1 -1
  57. admin/tpl/settings_cdn.php +104 -0
  58. admin/tpl/settings_crawler.php +30 -30
  59. admin/tpl/settings_debug.php +32 -36
  60. admin/tpl/settings_esi.php +67 -15
  61. admin/tpl/settings_excludes.php +3 -3
  62. admin/tpl/settings_general.php +33 -23
  63. admin/tpl/settings_inc.cache_favicon.php +1 -1
  64. admin/tpl/settings_inc.cache_mobile.php +3 -3
  65. admin/tpl/settings_inc.exclude_cookies.php +1 -1
  66. admin/tpl/settings_inc.exclude_useragent.php +1 -1
  67. admin/tpl/settings_optimize.php +118 -0
  68. admin/tpl/settings_purge.php +10 -12
  69. admin/tpl/snowman.inc.php +0 -86
  70. cli/litespeed-cache-cli-admin.class.php +31 -1
  71. includes/litespeed-cache-api.class.php +26 -0
  72. includes/litespeed-cache-cdn.class.php +388 -0
  73. includes/litespeed-cache-config.class.php +75 -14
  74. includes/litespeed-cache-control.class.php +13 -4
  75. includes/litespeed-cache-crawler-sitemap.class.php +1 -2
  76. includes/litespeed-cache-crawler.class.php +2 -3
  77. includes/litespeed-cache-esi.class.php +50 -35
  78. includes/litespeed-cache-log.class.php +36 -8
  79. includes/litespeed-cache-optimize.class.php +677 -0
  80. includes/litespeed-cache-purge.class.php +16 -14
  81. includes/litespeed-cache-router.class.php +49 -2
  82. includes/litespeed-cache-tag.class.php +2 -2
  83. includes/litespeed-cache-utility.class.php +40 -1
  84. includes/litespeed-cache-vary.class.php +78 -19
  85. includes/litespeed-cache.class.php +53 -31
  86. includes/litespeed.autoload.php +15 -0
  87. languages/litespeed-cache.pot +641 -279
  88. lib/litespeed/litespeed-crawler.class.php +1 -1
  89. lib/litespeed/litespeed-file.class.php +8 -6
  90. lib/vendor/autoload.php +7 -0
  91. lib/vendor/bin/cssmin +37 -0
  92. lib/vendor/composer/ClassLoader.php +445 -0
  93. lib/vendor/composer/LICENSE +21 -0
  94. lib/vendor/composer/autoload_classmap.php +59 -0
  95. lib/vendor/composer/autoload_namespaces.php +12 -0
  96. lib/vendor/composer/autoload_psr4.php +15 -0
  97. lib/vendor/composer/autoload_real.php +52 -0
  98. lib/vendor/composer/autoload_static.php +142 -0
  99. lib/vendor/container-interop/container-interop/LICENSE +20 -0
  100. lib/vendor/container-interop/container-interop/src/Interop/Container/ContainerInterface.php +15 -0
  101. lib/vendor/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php +15 -0
  102. lib/vendor/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php +15 -0
  103. lib/vendor/intervention/httpauth/.travis.yml +11 -0
  104. lib/vendor/intervention/httpauth/LICENSE +9 -0
  105. lib/vendor/intervention/httpauth/src/Intervention/Httpauth/BasicUser.php +63 -0
  106. lib/vendor/intervention/httpauth/src/Intervention/Httpauth/DigestUser.php +134 -0
  107. lib/vendor/intervention/httpauth/src/Intervention/Httpauth/Facades/Httpauth.php +13 -0
  108. lib/vendor/intervention/httpauth/src/Intervention/Httpauth/Httpauth.php +159 -0
  109. lib/vendor/intervention/httpauth/src/Intervention/Httpauth/HttpauthServiceProvider.php +82 -0
  110. lib/vendor/intervention/httpauth/src/Intervention/Httpauth/HttpauthServiceProviderLaravel4.php +30 -0
  111. lib/vendor/intervention/httpauth/src/Intervention/Httpauth/HttpauthServiceProviderLaravel5.php +37 -0
  112. lib/vendor/intervention/httpauth/src/Intervention/Httpauth/UserInterface.php +22 -0
  113. lib/vendor/intervention/httpauth/src/config/config.php +49 -0
  114. lib/vendor/monolog/monolog/.php_cs +59 -0
  115. lib/vendor/monolog/monolog/LICENSE +19 -0
  116. lib/vendor/monolog/monolog/src/Monolog/ErrorHandler.php +230 -0
  117. lib/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php +78 -0
  118. lib/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php +89 -0
  119. lib/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php +116 -0
  120. lib/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php +85 -0
  121. lib/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php +36 -0
  122. lib/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php +138 -0
  123. lib/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php +141 -0
  124. lib/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php +208 -0
  125. lib/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php +179 -0
  126. lib/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php +47 -0
  127. lib/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php +166 -0
  128. lib/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php +105 -0
  129. lib/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php +297 -0
  130. lib/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php +48 -0
  131. lib/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php +113 -0
  132. lib/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php +186 -0
  133. lib/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php +66 -0
  134. lib/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php +101 -0
  135. lib/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php +148 -0
  136. lib/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php +230 -0
  137. lib/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php +117 -0
  138. lib/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php +211 -0
  139. lib/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php +72 -0
  140. lib/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php +151 -0
  141. lib/vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php +57 -0
  142. lib/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php +169 -0
  143. lib/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php +45 -0
  144. lib/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php +107 -0
  145. lib/vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php +128 -0
  146. lib/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php +82 -0
  147. lib/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php +140 -0
  148. lib/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php +28 -0
  149. lib/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php +59 -0
  150. lib/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php +34 -0
  151. lib/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php +163 -0
  152. lib/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php +195 -0
  153. lib/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php +126 -0
  154. lib/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php +127 -0
  155. lib/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php +73 -0
  156. lib/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php +104 -0
  157. lib/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php +90 -0
  158. lib/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php +108 -0
  159. lib/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php +350 -0
  160. lib/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php +69 -0
  161. lib/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php +55 -0
  162. lib/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php +102 -0
  163. lib/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php +67 -0
  164. lib/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php +68 -0
  165. lib/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php +21 -0
  166. lib/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php +59 -0
  167. lib/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php +185 -0
  168. lib/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php +202 -0
  169. lib/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php +45 -0
  170. lib/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php +242 -0
  171. lib/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php +56 -0
  172. lib/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php +185 -0
  173. lib/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php +232 -0
  174. lib/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php +97 -0
  175. lib/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php +132 -0
  176. lib/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php +178 -0
  177. lib/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php +82 -0
  178. lib/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php +294 -0
  179. lib/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php +215 -0
  180. lib/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php +115 -0
  181. lib/vendor/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php +80 -0
  182. lib/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php +346 -0
  183. lib/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php +176 -0
  184. lib/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php +99 -0
  185. lib/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php +67 -0
  186. lib/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php +56 -0
  187. lib/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php +103 -0
  188. lib/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php +154 -0
  189. lib/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php +61 -0
  190. lib/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php +95 -0
  191. lib/vendor/monolog/monolog/src/Monolog/Logger.php +700 -0
  192. lib/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php +64 -0
  193. lib/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php +112 -0
  194. lib/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php +35 -0
  195. lib/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php +63 -0
  196. lib/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php +35 -0
  197. lib/vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php +63 -0
  198. lib/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php +31 -0
  199. lib/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php +48 -0
  200. lib/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php +44 -0
  201. lib/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php +46 -0
  202. lib/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php +113 -0
  203. lib/vendor/monolog/monolog/src/Monolog/Registry.php +134 -0
  204. lib/vendor/mrclay/jsmin-php/.editorconfig +19 -0
  205. lib/vendor/mrclay/jsmin-php/HISTORY.txt +24 -0
  206. lib/vendor/mrclay/jsmin-php/LICENSE.txt +26 -0
  207. lib/vendor/mrclay/jsmin-php/src/JSMin/JSMin.php +454 -0
  208. lib/vendor/mrclay/jsmin-php/src/JSMin/UnterminatedCommentException.php +6 -0
  209. lib/vendor/mrclay/jsmin-php/src/JSMin/UnterminatedRegExpException.php +6 -0
  210. lib/vendor/mrclay/jsmin-php/src/JSMin/UnterminatedStringException.php +6 -0
  211. lib/vendor/mrclay/minify/.htaccess +13 -0
  212. lib/vendor/mrclay/minify/.php_cs +27 -0
  213. lib/vendor/mrclay/minify/.travis.yml +37 -0
  214. lib/vendor/mrclay/minify/LICENSE.txt +26 -0
  215. lib/vendor/mrclay/minify/bootstrap.php +25 -0
  216. lib/vendor/mrclay/minify/config-test.php +10 -0
  217. lib/vendor/mrclay/minify/config.php +201 -0
  218. lib/vendor/mrclay/minify/groupsConfig.php +19 -0
  219. lib/vendor/mrclay/minify/lib/HTTP/ConditionalGet.php +376 -0
  220. lib/vendor/mrclay/minify/lib/HTTP/Encoder.php +335 -0
  221. lib/vendor/mrclay/minify/lib/Minify.php +761 -0
  222. lib/vendor/mrclay/minify/lib/Minify/App.php +282 -0
  223. lib/vendor/mrclay/minify/lib/Minify/Build.php +102 -0
  224. lib/vendor/mrclay/minify/lib/Minify/CSS.php +98 -0
  225. lib/vendor/mrclay/minify/lib/Minify/CSS/Compressor.php +275 -0
  226. lib/vendor/mrclay/minify/lib/Minify/CSS/UriRewriter.php +358 -0
  227. lib/vendor/mrclay/minify/lib/Minify/CSSmin.php +88 -0
  228. lib/vendor/mrclay/minify/lib/Minify/Cache/APC.php +136 -0
  229. lib/vendor/mrclay/minify/lib/Minify/Cache/File.php +183 -0
  230. lib/vendor/mrclay/minify/lib/Minify/Cache/Memcache.php +141 -0
  231. lib/vendor/mrclay/minify/lib/Minify/Cache/Null.php +67 -0
  232. lib/vendor/mrclay/minify/lib/Minify/Cache/WinCache.php +139 -0
  233. lib/vendor/mrclay/minify/lib/Minify/Cache/XCache.php +130 -0
  234. lib/vendor/mrclay/minify/lib/Minify/Cache/ZendPlatform.php +129 -0
  235. lib/vendor/mrclay/minify/lib/Minify/CacheInterface.php +58 -0
  236. lib/vendor/mrclay/minify/lib/Minify/ClosureCompiler.php +240 -0
  237. lib/vendor/mrclay/minify/lib/Minify/CommentPreserver.php +87 -0
  238. lib/vendor/mrclay/minify/lib/Minify/Config.php +78 -0
  239. lib/vendor/mrclay/minify/lib/Minify/Controller/Base.php +81 -0
  240. lib/vendor/mrclay/minify/lib/Minify/Controller/Files.php +71 -0
  241. lib/vendor/mrclay/minify/lib/Minify/Controller/Groups.php +76 -0
  242. lib/vendor/mrclay/minify/lib/Minify/Controller/MinApp.php +196 -0
  243. lib/vendor/mrclay/minify/lib/Minify/Controller/Page.php +69 -0
  244. lib/vendor/mrclay/minify/lib/Minify/ControllerInterface.php +22 -0
  245. lib/vendor/mrclay/minify/lib/Minify/DebugDetector.php +30 -0
  246. lib/vendor/mrclay/minify/lib/Minify/Env.php +127 -0
  247. lib/vendor/mrclay/minify/lib/Minify/HTML.php +258 -0
  248. lib/vendor/mrclay/minify/lib/Minify/HTML/Helper.php +22 -0
admin/css/litespeed-btn.css DELETED
@@ -1,730 +0,0 @@
1
-
2
- /** button style **/
3
- .litespeed-btn {
4
- display: inline-block;
5
- padding: 6px 12px;
6
- margin-bottom: 0;
7
- font-size: 14px;
8
- font-weight: normal;
9
- line-height: 1.42857143;
10
- text-align: center;
11
- white-space: nowrap;
12
- vertical-align: middle;
13
- -ms-touch-action: manipulation;
14
- touch-action: manipulation;
15
- cursor: pointer;
16
- -webkit-user-select: none;
17
- -moz-user-select: none;
18
- -ms-user-select: none;
19
- user-select: none;
20
- background-image: none;
21
- border: 1px solid transparent;
22
- border-radius: 4px;
23
- text-decoration: none;
24
- }
25
- .litespeed-btn:focus,
26
- .litespeed-btn:active:focus,
27
- .litespeed-btn.active:focus,
28
- .litespeed-btn.focus,
29
- .litespeed-btn:active.focus,
30
- .litespeed-btn.active.focus {
31
- outline: 5px auto -webkit-focus-ring-color;
32
- outline-offset: -2px;
33
- }
34
- .litespeed-btn:hover,
35
- .litespeed-btn:focus,
36
- .litespeed-btn.focus {
37
- color: #333;
38
- text-decoration: none;
39
- }
40
- .litespeed-btn:active,
41
- .litespeed-btn.active {
42
- background-image: none;
43
- outline: 0;
44
- -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
45
- box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
46
- }
47
- .litespeed-btn.disabled,
48
- .litespeed-btn[disabled],
49
- fieldset[disabled] .litespeed-btn {
50
- cursor: not-allowed;
51
- filter: alpha(opacity=65);
52
- -webkit-box-shadow: none;
53
- box-shadow: none;
54
- opacity: .65;
55
- }
56
- a.litespeed-btn.disabled,
57
- fieldset[disabled] a.litespeed-btn {
58
- pointer-events: none;
59
- }
60
- .litespeed-btn-default {
61
- color: #333;
62
- background-color: #fff;
63
- border-color: #ccc;
64
- }
65
- .litespeed-btn-default:focus,
66
- .litespeed-btn-default.focus {
67
- color: #333;
68
- background-color: #e6e6e6;
69
- border-color: #8c8c8c;
70
- }
71
- .litespeed-btn-default:hover {
72
- color: #333;
73
- background-color: #e6e6e6;
74
- border-color: #adadad;
75
- }
76
- .litespeed-btn-default:active,
77
- .litespeed-btn-default.active,
78
- .open > .dropdown-toggle.litespeed-btn-default {
79
- color: #333;
80
- background-color: #e6e6e6;
81
- border-color: #adadad;
82
- }
83
- .litespeed-btn-default:active:hover,
84
- .litespeed-btn-default.active:hover,
85
- .open > .dropdown-toggle.litespeed-btn-default:hover,
86
- .litespeed-btn-default:active:focus,
87
- .litespeed-btn-default.active:focus,
88
- .open > .dropdown-toggle.litespeed-btn-default:focus,
89
- .litespeed-btn-default:active.focus,
90
- .litespeed-btn-default.active.focus,
91
- .open > .dropdown-toggle.litespeed-btn-default.focus {
92
- color: #333;
93
- background-color: #d4d4d4;
94
- border-color: #8c8c8c;
95
- }
96
- .litespeed-btn-default:active,
97
- .litespeed-btn-default.active,
98
- .open > .dropdown-toggle.litespeed-btn-default {
99
- background-image: none;
100
- }
101
- .litespeed-btn-default.disabled:hover,
102
- .litespeed-btn-default[disabled]:hover,
103
- fieldset[disabled] .litespeed-btn-default:hover,
104
- .litespeed-btn-default.disabled:focus,
105
- .litespeed-btn-default[disabled]:focus,
106
- fieldset[disabled] .litespeed-btn-default:focus,
107
- .litespeed-btn-default.disabled.focus,
108
- .litespeed-btn-default[disabled].focus,
109
- fieldset[disabled] .litespeed-btn-default.focus {
110
- background-color: #fff;
111
- border-color: #ccc;
112
- }
113
- .litespeed-btn-default .badge {
114
- color: #fff;
115
- background-color: #333;
116
- }
117
- .litespeed-btn-primary {
118
- color: #fff;
119
- background-color: #337ab7;
120
- border-color: #2e6da4;
121
- }
122
- .litespeed-btn-primary:focus,
123
- .litespeed-btn-primary.focus {
124
- color: #fff;
125
- background-color: #286090;
126
- border-color: #122b40;
127
- }
128
- .litespeed-btn-primary:hover {
129
- color: #fff;
130
- background-color: #286090;
131
- border-color: #204d74;
132
- }
133
- .litespeed-btn-primary:active,
134
- .litespeed-btn-primary.active,
135
- .open > .dropdown-toggle.litespeed-btn-primary {
136
- color: #fff;
137
- background-color: #286090;
138
- border-color: #204d74;
139
- }
140
- .litespeed-btn-primary:active:hover,
141
- .litespeed-btn-primary.active:hover,
142
- .open > .dropdown-toggle.litespeed-btn-primary:hover,
143
- .litespeed-btn-primary:active:focus,
144
- .litespeed-btn-primary.active:focus,
145
- .open > .dropdown-toggle.litespeed-btn-primary:focus,
146
- .litespeed-btn-primary:active.focus,
147
- .litespeed-btn-primary.active.focus,
148
- .open > .dropdown-toggle.litespeed-btn-primary.focus {
149
- color: #fff;
150
- background-color: #204d74;
151
- border-color: #122b40;
152
- }
153
- .litespeed-btn-primary:active,
154
- .litespeed-btn-primary.active,
155
- .open > .dropdown-toggle.litespeed-btn-primary {
156
- background-image: none;
157
- }
158
- .litespeed-btn-primary.disabled:hover,
159
- .litespeed-btn-primary[disabled]:hover,
160
- fieldset[disabled] .litespeed-btn-primary:hover,
161
- .litespeed-btn-primary.disabled:focus,
162
- .litespeed-btn-primary[disabled]:focus,
163
- fieldset[disabled] .litespeed-btn-primary:focus,
164
- .litespeed-btn-primary.disabled.focus,
165
- .litespeed-btn-primary[disabled].focus,
166
- fieldset[disabled] .litespeed-btn-primary.focus {
167
- background-color: #337ab7;
168
- border-color: #2e6da4;
169
- }
170
- .litespeed-btn-primary .badge {
171
- color: #337ab7;
172
- background-color: #fff;
173
- }
174
- .litespeed-btn-success {
175
- color: #fff;
176
- background-color: #5cb85c;
177
- border-color: #4cae4c;
178
- }
179
- .litespeed-btn-success:focus,
180
- .litespeed-btn-success.focus {
181
- color: #fff;
182
- background-color: #449d44;
183
- border-color: #255625;
184
- }
185
- .litespeed-btn-success:hover {
186
- color: #fff;
187
- background-color: #449d44;
188
- border-color: #398439;
189
- }
190
- .litespeed-btn-success:active,
191
- .litespeed-btn-success.active,
192
- .open > .dropdown-toggle.litespeed-btn-success {
193
- color: #fff;
194
- background-color: #449d44;
195
- border-color: #398439;
196
- }
197
- .litespeed-btn-success:active:hover,
198
- .litespeed-btn-success.active:hover,
199
- .open > .dropdown-toggle.litespeed-btn-success:hover,
200
- .litespeed-btn-success:active:focus,
201
- .litespeed-btn-success.active:focus,
202
- .open > .dropdown-toggle.litespeed-btn-success:focus,
203
- .litespeed-btn-success:active.focus,
204
- .litespeed-btn-success.active.focus,
205
- .open > .dropdown-toggle.litespeed-btn-success.focus {
206
- color: #fff;
207
- background-color: #398439;
208
- border-color: #255625;
209
- }
210
- .litespeed-btn-success:active,
211
- .litespeed-btn-success.active,
212
- .open > .dropdown-toggle.litespeed-btn-success {
213
- background-image: none;
214
- }
215
- .litespeed-btn-success.disabled:hover,
216
- .litespeed-btn-success[disabled]:hover,
217
- fieldset[disabled] .litespeed-btn-success:hover,
218
- .litespeed-btn-success.disabled:focus,
219
- .litespeed-btn-success[disabled]:focus,
220
- fieldset[disabled] .litespeed-btn-success:focus,
221
- .litespeed-btn-success.disabled.focus,
222
- .litespeed-btn-success[disabled].focus,
223
- fieldset[disabled] .litespeed-btn-success.focus {
224
- background-color: #5cb85c;
225
- border-color: #4cae4c;
226
- }
227
- .litespeed-btn-success .badge {
228
- color: #5cb85c;
229
- background-color: #fff;
230
- }
231
- .litespeed-btn-info {
232
- color: #fff;
233
- background-color: #5bc0de;
234
- border-color: #46b8da;
235
- }
236
- .litespeed-btn-info:focus,
237
- .litespeed-btn-info.focus {
238
- color: #fff;
239
- background-color: #31b0d5;
240
- border-color: #1b6d85;
241
- }
242
- .litespeed-btn-info:hover {
243
- color: #fff;
244
- background-color: #31b0d5;
245
- border-color: #269abc;
246
- }
247
- .litespeed-btn-info:active,
248
- .litespeed-btn-info.active,
249
- .open > .dropdown-toggle.litespeed-btn-info {
250
- color: #fff;
251
- background-color: #31b0d5;
252
- border-color: #269abc;
253
- }
254
- .litespeed-btn-info:active:hover,
255
- .litespeed-btn-info.active:hover,
256
- .open > .dropdown-toggle.litespeed-btn-info:hover,
257
- .litespeed-btn-info:active:focus,
258
- .litespeed-btn-info.active:focus,
259
- .open > .dropdown-toggle.litespeed-btn-info:focus,
260
- .litespeed-btn-info:active.focus,
261
- .litespeed-btn-info.active.focus,
262
- .open > .dropdown-toggle.litespeed-btn-info.focus {
263
- color: #fff;
264
- background-color: #269abc;
265
- border-color: #1b6d85;
266
- }
267
- .litespeed-btn-info:active,
268
- .litespeed-btn-info.active,
269
- .open > .dropdown-toggle.litespeed-btn-info {
270
- background-image: none;
271
- }
272
- .litespeed-btn-info.disabled:hover,
273
- .litespeed-btn-info[disabled]:hover,
274
- fieldset[disabled] .litespeed-btn-info:hover,
275
- .litespeed-btn-info.disabled:focus,
276
- .litespeed-btn-info[disabled]:focus,
277
- fieldset[disabled] .litespeed-btn-info:focus,
278
- .litespeed-btn-info.disabled.focus,
279
- .litespeed-btn-info[disabled].focus,
280
- fieldset[disabled] .litespeed-btn-info.focus {
281
- background-color: #5bc0de;
282
- border-color: #46b8da;
283
- }
284
- .litespeed-btn-info .badge {
285
- color: #5bc0de;
286
- background-color: #fff;
287
- }
288
- .litespeed-btn-warning {
289
- color: #fff;
290
- background-color: #f0ad4e;
291
- border-color: #eea236;
292
- }
293
- .litespeed-btn-warning:focus,
294
- .litespeed-btn-warning.focus {
295
- color: #fff;
296
- background-color: #ec971f;
297
- border-color: #985f0d;
298
- }
299
- .litespeed-btn-warning:hover {
300
- color: #fff;
301
- background-color: #ec971f;
302
- border-color: #d58512;
303
- }
304
- .litespeed-btn-warning:active,
305
- .litespeed-btn-warning.active,
306
- .open > .dropdown-toggle.litespeed-btn-warning {
307
- color: #fff;
308
- background-color: #ec971f;
309
- border-color: #d58512;
310
- }
311
- .litespeed-btn-warning:active:hover,
312
- .litespeed-btn-warning.active:hover,
313
- .open > .dropdown-toggle.litespeed-btn-warning:hover,
314
- .litespeed-btn-warning:active:focus,
315
- .litespeed-btn-warning.active:focus,
316
- .open > .dropdown-toggle.litespeed-btn-warning:focus,
317
- .litespeed-btn-warning:active.focus,
318
- .litespeed-btn-warning.active.focus,
319
- .open > .dropdown-toggle.litespeed-btn-warning.focus {
320
- color: #fff;
321
- background-color: #d58512;
322
- border-color: #985f0d;
323
- }
324
- .litespeed-btn-warning:active,
325
- .litespeed-btn-warning.active,
326
- .open > .dropdown-toggle.litespeed-btn-warning {
327
- background-image: none;
328
- }
329
- .litespeed-btn-warning.disabled:hover,
330
- .litespeed-btn-warning[disabled]:hover,
331
- fieldset[disabled] .litespeed-btn-warning:hover,
332
- .litespeed-btn-warning.disabled:focus,
333
- .litespeed-btn-warning[disabled]:focus,
334
- fieldset[disabled] .litespeed-btn-warning:focus,
335
- .litespeed-btn-warning.disabled.focus,
336
- .litespeed-btn-warning[disabled].focus,
337
- fieldset[disabled] .litespeed-btn-warning.focus {
338
- background-color: #f0ad4e;
339
- border-color: #eea236;
340
- }
341
- .litespeed-btn-warning .badge {
342
- color: #f0ad4e;
343
- background-color: #fff;
344
- }
345
- .litespeed-btn-danger {
346
- color: #fff;
347
- background-color: #d9534f;
348
- border-color: #d43f3a;
349
- }
350
- .litespeed-btn-danger:focus,
351
- .litespeed-btn-danger.focus {
352
- color: #fff;
353
- background-color: #c9302c;
354
- border-color: #761c19;
355
- }
356
- .litespeed-btn-danger:hover {
357
- color: #fff;
358
- background-color: #c9302c;
359
- border-color: #ac2925;
360
- }
361
- .litespeed-btn-danger:active,
362
- .litespeed-btn-danger.active,
363
- .open > .dropdown-toggle.litespeed-btn-danger {
364
- color: #fff;
365
- background-color: #c9302c;
366
- border-color: #ac2925;
367
- }
368
- .litespeed-btn-danger:active:hover,
369
- .litespeed-btn-danger.active:hover,
370
- .open > .dropdown-toggle.litespeed-btn-danger:hover,
371
- .litespeed-btn-danger:active:focus,
372
- .litespeed-btn-danger.active:focus,
373
- .open > .dropdown-toggle.litespeed-btn-danger:focus,
374
- .litespeed-btn-danger:active.focus,
375
- .litespeed-btn-danger.active.focus,
376
- .open > .dropdown-toggle.litespeed-btn-danger.focus {
377
- color: #fff;
378
- background-color: #ac2925;
379
- border-color: #761c19;
380
- }
381
- .litespeed-btn-danger:active,
382
- .litespeed-btn-danger.active,
383
- .open > .dropdown-toggle.litespeed-btn-danger {
384
- background-image: none;
385
- }
386
- .litespeed-btn-danger.disabled:hover,
387
- .litespeed-btn-danger[disabled]:hover,
388
- fieldset[disabled] .litespeed-btn-danger:hover,
389
- .litespeed-btn-danger.disabled:focus,
390
- .litespeed-btn-danger[disabled]:focus,
391
- fieldset[disabled] .litespeed-btn-danger:focus,
392
- .litespeed-btn-danger.disabled.focus,
393
- .litespeed-btn-danger[disabled].focus,
394
- fieldset[disabled] .litespeed-btn-danger.focus {
395
- background-color: #d9534f;
396
- border-color: #d43f3a;
397
- }
398
- .litespeed-btn-danger .badge {
399
- color: #d9534f;
400
- background-color: #fff;
401
- }
402
- .litespeed-btn-lg,
403
- .litespeed-btn-group-lg > .litespeed-btn {
404
- padding: 10px 16px;
405
- font-size: 18px;
406
- line-height: 1.3333333;
407
- border-radius: 6px;
408
- }
409
- .litespeed-btn-sm,
410
- .litespeed-btn-group-sm > .litespeed-btn {
411
- padding: 5px 10px;
412
- font-size: 12px;
413
- line-height: 1.5;
414
- border-radius: 3px;
415
- }
416
- .litespeed-btn-xs,
417
- .litespeed-btn-group-xs > .litespeed-btn {
418
- padding: 1px 5px;
419
- font-size: 12px;
420
- line-height: 1.5;
421
- border-radius: 3px;
422
- }
423
-
424
-
425
- .litespeed-btn-default,
426
- .litespeed-btn-primary,
427
- .litespeed-btn-success,
428
- .litespeed-btn-info,
429
- .litespeed-btn-warning,
430
- .litespeed-btn-danger {
431
- text-shadow: 0 -1px 0 rgba(0, 0, 0, .2);
432
- -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075);
433
- box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 1px 1px rgba(0, 0, 0, .075);
434
- }
435
- .litespeed-btn-default:active,
436
- .litespeed-btn-primary:active,
437
- .litespeed-btn-success:active,
438
- .litespeed-btn-info:active,
439
- .litespeed-btn-warning:active,
440
- .litespeed-btn-danger:active,
441
- .litespeed-btn-default.active,
442
- .litespeed-btn-primary.active,
443
- .litespeed-btn-success.active,
444
- .litespeed-btn-info.active,
445
- .litespeed-btn-warning.active,
446
- .litespeed-btn-danger.active {
447
- -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
448
- box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
449
- }
450
- .litespeed-btn-default.disabled,
451
- .litespeed-btn-primary.disabled,
452
- .litespeed-btn-success.disabled,
453
- .litespeed-btn-info.disabled,
454
- .litespeed-btn-warning.disabled,
455
- .litespeed-btn-danger.disabled,
456
- .litespeed-btn-default[disabled],
457
- .litespeed-btn-primary[disabled],
458
- .litespeed-btn-success[disabled],
459
- .litespeed-btn-info[disabled],
460
- .litespeed-btn-warning[disabled],
461
- .litespeed-btn-danger[disabled],
462
- fieldset[disabled] .litespeed-btn-default,
463
- fieldset[disabled] .litespeed-btn-primary,
464
- fieldset[disabled] .litespeed-btn-success,
465
- fieldset[disabled] .litespeed-btn-info,
466
- fieldset[disabled] .litespeed-btn-warning,
467
- fieldset[disabled] .litespeed-btn-danger {
468
- -webkit-box-shadow: none;
469
- box-shadow: none;
470
- }
471
- .litespeed-btn-default .badge,
472
- .litespeed-btn-primary .badge,
473
- .litespeed-btn-success .badge,
474
- .litespeed-btn-info .badge,
475
- .litespeed-btn-warning .badge,
476
- .litespeed-btn-danger .badge {
477
- text-shadow: none;
478
- }
479
- .litespeed-btn:active,
480
- .litespeed-btn.active {
481
- background-image: none;
482
- }
483
- .litespeed-btn-default {
484
- text-shadow: 0 1px 0 #fff;
485
- background-image: -webkit-linear-gradient(top, #fff 0%, #e0e0e0 100%);
486
- background-image: -o-linear-gradient(top, #fff 0%, #e0e0e0 100%);
487
- background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#e0e0e0));
488
- background-image: linear-gradient(to bottom, #fff 0%, #e0e0e0 100%);
489
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);
490
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
491
- background-repeat: repeat-x;
492
- border-color: #dbdbdb;
493
- border-color: #ccc;
494
- }
495
- .litespeed-btn-default:hover,
496
- .litespeed-btn-default:focus {
497
- background-color: #e0e0e0;
498
- background-position: 0 -15px;
499
- }
500
- .litespeed-btn-default:active,
501
- .litespeed-btn-default.active {
502
- background-color: #e0e0e0;
503
- border-color: #dbdbdb;
504
- }
505
- .litespeed-btn-default.disabled,
506
- .litespeed-btn-default[disabled],
507
- fieldset[disabled] .litespeed-btn-default,
508
- .litespeed-btn-default.disabled:hover,
509
- .litespeed-btn-default[disabled]:hover,
510
- fieldset[disabled] .litespeed-btn-default:hover,
511
- .litespeed-btn-default.disabled:focus,
512
- .litespeed-btn-default[disabled]:focus,
513
- fieldset[disabled] .litespeed-btn-default:focus,
514
- .litespeed-btn-default.disabled.focus,
515
- .litespeed-btn-default[disabled].focus,
516
- fieldset[disabled] .litespeed-btn-default.focus,
517
- .litespeed-btn-default.disabled:active,
518
- .litespeed-btn-default[disabled]:active,
519
- fieldset[disabled] .litespeed-btn-default:active,
520
- .litespeed-btn-default.disabled.active,
521
- .litespeed-btn-default[disabled].active,
522
- fieldset[disabled] .litespeed-btn-default.active {
523
- background-color: #e0e0e0;
524
- background-image: none;
525
- }
526
- .litespeed-btn-primary {
527
- background-image: -webkit-linear-gradient(top, #337ab7 0%, #265a88 100%);
528
- background-image: -o-linear-gradient(top, #337ab7 0%, #265a88 100%);
529
- background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#265a88));
530
- background-image: linear-gradient(to bottom, #337ab7 0%, #265a88 100%);
531
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff337ab7', endColorstr='#ff265a88', GradientType=0);
532
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
533
- background-repeat: repeat-x;
534
- border-color: #245580;
535
- }
536
- .litespeed-btn-primary:hover,
537
- .litespeed-btn-primary:focus {
538
- background-color: #265a88;
539
- background-position: 0 -15px;
540
- }
541
- .litespeed-btn-primary:active,
542
- .litespeed-btn-primary.active {
543
- background-color: #265a88;
544
- border-color: #245580;
545
- }
546
- .litespeed-btn-primary.disabled,
547
- .litespeed-btn-primary[disabled],
548
- fieldset[disabled] .litespeed-btn-primary,
549
- .litespeed-btn-primary.disabled:hover,
550
- .litespeed-btn-primary[disabled]:hover,
551
- fieldset[disabled] .litespeed-btn-primary:hover,
552
- .litespeed-btn-primary.disabled:focus,
553
- .litespeed-btn-primary[disabled]:focus,
554
- fieldset[disabled] .litespeed-btn-primary:focus,
555
- .litespeed-btn-primary.disabled.focus,
556
- .litespeed-btn-primary[disabled].focus,
557
- fieldset[disabled] .litespeed-btn-primary.focus,
558
- .litespeed-btn-primary.disabled:active,
559
- .litespeed-btn-primary[disabled]:active,
560
- fieldset[disabled] .litespeed-btn-primary:active,
561
- .litespeed-btn-primary.disabled.active,
562
- .litespeed-btn-primary[disabled].active,
563
- fieldset[disabled] .litespeed-btn-primary.active {
564
- background-color: #265a88;
565
- background-image: none;
566
- }
567
- .litespeed-btn-success {
568
- background-image: -webkit-linear-gradient(top, #5cb85c 0%, #419641 100%);
569
- background-image: -o-linear-gradient(top, #5cb85c 0%, #419641 100%);
570
- background-image: -webkit-gradient(linear, left top, left bottom, from(#5cb85c), to(#419641));
571
- background-image: linear-gradient(to bottom, #5cb85c 0%, #419641 100%);
572
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);
573
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
574
- background-repeat: repeat-x;
575
- border-color: #3e8f3e;
576
- }
577
- .litespeed-btn-success:hover,
578
- .litespeed-btn-success:focus {
579
- background-color: #419641;
580
- background-position: 0 -15px;
581
- }
582
- .litespeed-btn-success:active,
583
- .litespeed-btn-success.active {
584
- background-color: #419641;
585
- border-color: #3e8f3e;
586
- }
587
- .litespeed-btn-success.disabled,
588
- .litespeed-btn-success[disabled],
589
- fieldset[disabled] .litespeed-btn-success,
590
- .litespeed-btn-success.disabled:hover,
591
- .litespeed-btn-success[disabled]:hover,
592
- fieldset[disabled] .litespeed-btn-success:hover,
593
- .litespeed-btn-success.disabled:focus,
594
- .litespeed-btn-success[disabled]:focus,
595
- fieldset[disabled] .litespeed-btn-success:focus,
596
- .litespeed-btn-success.disabled.focus,
597
- .litespeed-btn-success[disabled].focus,
598
- fieldset[disabled] .litespeed-btn-success.focus,
599
- .litespeed-btn-success.disabled:active,
600
- .litespeed-btn-success[disabled]:active,
601
- fieldset[disabled] .litespeed-btn-success:active,
602
- .litespeed-btn-success.disabled.active,
603
- .litespeed-btn-success[disabled].active,
604
- fieldset[disabled] .litespeed-btn-success.active {
605
- background-color: #419641;
606
- background-image: none;
607
- }
608
- .litespeed-btn-info {
609
- background-image: -webkit-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
610
- background-image: -o-linear-gradient(top, #5bc0de 0%, #2aabd2 100%);
611
- background-image: -webkit-gradient(linear, left top, left bottom, from(#5bc0de), to(#2aabd2));
612
- background-image: linear-gradient(to bottom, #5bc0de 0%, #2aabd2 100%);
613
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);
614
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
615
- background-repeat: repeat-x;
616
- border-color: #28a4c9;
617
- }
618
- .litespeed-btn-info:hover,
619
- .litespeed-btn-info:focus {
620
- background-color: #2aabd2;
621
- background-position: 0 -15px;
622
- }
623
- .litespeed-btn-info:active,
624
- .litespeed-btn-info.active {
625
- background-color: #2aabd2;
626
- border-color: #28a4c9;
627
- }
628
- .litespeed-btn-info.disabled,
629
- .litespeed-btn-info[disabled],
630
- fieldset[disabled] .litespeed-btn-info,
631
- .litespeed-btn-info.disabled:hover,
632
- .litespeed-btn-info[disabled]:hover,
633
- fieldset[disabled] .litespeed-btn-info:hover,
634
- .litespeed-btn-info.disabled:focus,
635
- .litespeed-btn-info[disabled]:focus,
636
- fieldset[disabled] .litespeed-btn-info:focus,
637
- .litespeed-btn-info.disabled.focus,
638
- .litespeed-btn-info[disabled].focus,
639
- fieldset[disabled] .litespeed-btn-info.focus,
640
- .litespeed-btn-info.disabled:active,
641
- .litespeed-btn-info[disabled]:active,
642
- fieldset[disabled] .litespeed-btn-info:active,
643
- .litespeed-btn-info.disabled.active,
644
- .litespeed-btn-info[disabled].active,
645
- fieldset[disabled] .litespeed-btn-info.active {
646
- background-color: #2aabd2;
647
- background-image: none;
648
- }
649
- .litespeed-btn-warning {
650
- background-image: -webkit-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
651
- background-image: -o-linear-gradient(top, #f0ad4e 0%, #eb9316 100%);
652
- background-image: -webkit-gradient(linear, left top, left bottom, from(#f0ad4e), to(#eb9316));
653
- background-image: linear-gradient(to bottom, #f0ad4e 0%, #eb9316 100%);
654
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);
655
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
656
- background-repeat: repeat-x;
657
- border-color: #e38d13;
658
- }
659
- .litespeed-btn-warning:hover,
660
- .litespeed-btn-warning:focus {
661
- background-color: #eb9316;
662
- background-position: 0 -15px;
663
- }
664
- .litespeed-btn-warning:active,
665
- .litespeed-btn-warning.active {
666
- background-color: #eb9316;
667
- border-color: #e38d13;
668
- }
669
- .litespeed-btn-warning.disabled,
670
- .litespeed-btn-warning[disabled],
671
- fieldset[disabled] .litespeed-btn-warning,
672
- .litespeed-btn-warning.disabled:hover,
673
- .litespeed-btn-warning[disabled]:hover,
674
- fieldset[disabled] .litespeed-btn-warning:hover,
675
- .litespeed-btn-warning.disabled:focus,
676
- .litespeed-btn-warning[disabled]:focus,
677
- fieldset[disabled] .litespeed-btn-warning:focus,
678
- .litespeed-btn-warning.disabled.focus,
679
- .litespeed-btn-warning[disabled].focus,
680
- fieldset[disabled] .litespeed-btn-warning.focus,
681
- .litespeed-btn-warning.disabled:active,
682
- .litespeed-btn-warning[disabled]:active,
683
- fieldset[disabled] .litespeed-btn-warning:active,
684
- .litespeed-btn-warning.disabled.active,
685
- .litespeed-btn-warning[disabled].active,
686
- fieldset[disabled] .litespeed-btn-warning.active {
687
- background-color: #eb9316;
688
- background-image: none;
689
- }
690
- .litespeed-btn-danger {
691
- background-image: -webkit-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
692
- background-image: -o-linear-gradient(top, #d9534f 0%, #c12e2a 100%);
693
- background-image: -webkit-gradient(linear, left top, left bottom, from(#d9534f), to(#c12e2a));
694
- background-image: linear-gradient(to bottom, #d9534f 0%, #c12e2a 100%);
695
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);
696
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
697
- background-repeat: repeat-x;
698
- border-color: #b92c28;
699
- }
700
- .litespeed-btn-danger:hover,
701
- .litespeed-btn-danger:focus {
702
- background-color: #c12e2a;
703
- background-position: 0 -15px;
704
- }
705
- .litespeed-btn-danger:active,
706
- .litespeed-btn-danger.active {
707
- background-color: #c12e2a;
708
- border-color: #b92c28;
709
- }
710
- .litespeed-btn-danger.disabled,
711
- .litespeed-btn-danger[disabled],
712
- fieldset[disabled] .litespeed-btn-danger,
713
- .litespeed-btn-danger.disabled:hover,
714
- .litespeed-btn-danger[disabled]:hover,
715
- fieldset[disabled] .litespeed-btn-danger:hover,
716
- .litespeed-btn-danger.disabled:focus,
717
- .litespeed-btn-danger[disabled]:focus,
718
- fieldset[disabled] .litespeed-btn-danger:focus,
719
- .litespeed-btn-danger.disabled.focus,
720
- .litespeed-btn-danger[disabled].focus,
721
- fieldset[disabled] .litespeed-btn-danger.focus,
722
- .litespeed-btn-danger.disabled:active,
723
- .litespeed-btn-danger[disabled]:active,
724
- fieldset[disabled] .litespeed-btn-danger:active,
725
- .litespeed-btn-danger.disabled.active,
726
- .litespeed-btn-danger[disabled].active,
727
- fieldset[disabled] .litespeed-btn-danger.active {
728
- background-color: #c12e2a;
729
- background-image: none;
730
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/css/litespeed-cache-admin.css DELETED
@@ -1,269 +0,0 @@
1
- /**
2
- * All of the CSS for your admin-specific functionality should be
3
- * included in this file.
4
- */
5
- @import "litespeed-common.css";
6
- @import "litespeed-btn.css";
7
- @import "litespeed-checkbox.css";
8
- @import "litespeed-label.css";
9
- @import "litespeed-callout.css";
10
- @import "litespeed-icon.css";
11
-
12
- #litespeedcache-purgeerrors{
13
- margin:5px 0 15px 22px;
14
- }
15
-
16
- .litespeed-cache-welcome-panel .form-table > tbody > tr > th{
17
- padding-left: 10px;
18
- }
19
- .litespeed-cache-welcome-panel .form-table > tbody > tr:nth-of-type(odd){
20
- background-color: #f9f9f9;
21
- }
22
-
23
- .litespeed-cache-advanced-settings{
24
- position: relative;
25
- background: #fff;
26
- font-size: 14px;
27
- line-height: 2.1em;
28
- }
29
-
30
-
31
- .litespeed-cache-advanced-settings h3{
32
- display:inline;
33
- }
34
-
35
- textarea#purgebylist{
36
- height: auto;
37
- min-height: 100%;
38
- width: 100%;
39
- position: relative;
40
- -webkit-font-smoothing: subpixel-antialiased;
41
- }
42
-
43
- /* litespeed new style */
44
- .litespeed-tab{
45
- border-top-left-radius : 8px;
46
- border-top-right-radius : 8px;
47
- }
48
-
49
- .litespeed-tab.nav-tab-active{
50
- background-color: #FFFFFF;
51
- border-bottom-color: #FFFFFF;
52
- }
53
-
54
- .litespeed-cache-welcome-panel{
55
- background: none repeat scroll 0 0 #fff;
56
- border: 1px solid #e5e5e5;
57
- box-shadow: 0 2px 2px rgba(0, 0, 0, 0.05);
58
- font-size: 14px;
59
- /*line-height: 2em;*/
60
- margin: 0px 0px 20px 0;
61
- overflow: auto;
62
- padding: 10px 15px 15px 15px;
63
- position: relative;
64
- border-top: none;
65
- }
66
- .litespeed-cache-welcome-panel p{
67
- font-size: 14px;
68
- margin: 0 0 10px;
69
- }
70
- .litespeed-cache-welcome-panel ul {
71
- list-style: disc outside;
72
- margin-left: 20px;
73
- padding-left: 10px;
74
- }
75
-
76
- .litespeed-input-long{
77
- width:580px;
78
- }
79
-
80
- .litespeed-title{
81
- font-size: 18px;
82
- color: #000;
83
- border-bottom: 1px solid #d8d8d8;
84
- margin-top: 10px;
85
- margin-bottom: 20px;
86
- display: table;
87
- padding-right: 50px;
88
- }
89
-
90
- .litespeed-title:not(:first-of-type){
91
- margin-top: 30px;
92
- }
93
-
94
- .litespeed-expend{
95
- text-decoration: none;
96
- font-size: 21px;
97
- width: 40px;
98
- text-align: center;
99
- display: inline-block;
100
- }
101
-
102
- /* Manage */
103
-
104
- .litespeed-cache-purgeby-text{
105
- font-size: 11px;
106
- font-style: italic;
107
- padding-left: 20px;
108
- display: inline-block;
109
- vertical-align: top;
110
- }
111
-
112
- .litespeed-cache-purgeby-textarea,
113
- .litespeed-cache-blacklist{
114
- margin-top: 10px;
115
- height: auto;
116
- width: 100%;
117
- position: relative;
118
- -webkit-font-smoothing: subpixel-antialiased;
119
- }
120
-
121
- .litespeed-cache-blacklist{
122
- max-width: 600px;
123
- }
124
-
125
- /* FAQ */
126
- .litespeed-question{
127
- background-color: #eee;
128
- border: 1px solid #eee;
129
- border-left: 5px solid #1b809e;
130
- border-radius: 3px;
131
- padding: 20px;
132
- margin: 0 20px 5px 10px;
133
- font-size: 15px;
134
- font-family: inherit;
135
- font-weight: 500;
136
- line-height: 1.1;
137
- }
138
-
139
- .litespeed-question:hover{
140
- opacity: 0.8;
141
- cursor: pointer;
142
- }
143
-
144
- .litespeed-answer{
145
- margin-left: 20px;
146
- padding: 0 20px 20px 20px;
147
- }
148
-
149
- .litespeed-notice{
150
- font-size: 11px;
151
- font-style: italic;
152
- margin-left: 10px;
153
- position: relative;
154
- top: 3px;
155
- color: green;
156
- }
157
-
158
-
159
- /* shell */
160
- .litespeed-shell {
161
- width: 98%;
162
- background: #141414;
163
- margin: 20px auto 0 10px;
164
- box-shadow: 0 0 5px rgba(0,0,0,0.4);
165
- -webkit-border-radius: 3px;
166
- -moz-border-radius: 3px;
167
- border-radius: 3px;
168
- position: relative;
169
- height: 224px;
170
- }
171
-
172
- .litespeed-shell-header {
173
- z-index: 999;
174
- position: absolute;
175
- top: 0;
176
- right: 0;
177
- width: 50px;
178
- height: 34px;
179
- padding: 5px 0;
180
- }
181
-
182
- .litespeed-shell-header-bg {
183
- opacity: 0.4;
184
- background-color: #CCCCCC;
185
- position: absolute;
186
- top: 0;
187
- bottom: 0;
188
- right: 0;
189
- left: 0;
190
- z-index: 4;
191
- -webkit-border-radius: 3px;
192
- -moz-border-radius: 3px;
193
- border-top-radius: 3px;
194
- }
195
-
196
- .litespeed-shell-header-bar {
197
- position: absolute;
198
- top: 0;
199
- left: 0;
200
- z-index: 10;
201
- height: 2px;
202
- background-color: #F48024;
203
- }
204
-
205
- /*.litespeed-shell-header-num{
206
- position: absolute;
207
- bottom: 2px;
208
- right: 2px;
209
- width: 14px;
210
- height: 14px;
211
- text-align: left;
212
- color: #808080;
213
- font-size: 0.85em;
214
- z-index: 5;
215
- display: none;
216
- }*/
217
-
218
- .litespeed-shell-header-icon-container{
219
- position: absolute;
220
- top: 10px;
221
- right: 10px;
222
- width: 29px;
223
- height: 34px;
224
- z-index: 6;
225
- }
226
-
227
- ul.litespeed-shell-body {
228
- position: absolute;
229
- top: 0;
230
- left: 0;
231
- right: 0;
232
- bottom: 0;
233
- overflow-y: scroll;
234
- margin: 0;
235
- padding: 5px;
236
- list-style: none;
237
- background: #141414;
238
- color: #45D40C;
239
- font: 0.8em 'Andale Mono', Consolas, 'Courier New';
240
- line-height: 1.6em;
241
-
242
- -webkit-border-bottom-right-radius: 3px;
243
- -webkit-border-bottom-left-radius: 3px;
244
- -moz-border-radius-bottomright: 3px;
245
- -moz-border-radius-bottomleft: 3px;
246
- border-bottom-right-radius: 3px;
247
- border-bottom-left-radius: 3px;
248
-
249
- }
250
-
251
- .litespeed-shell-body li:before {
252
- content: '>';
253
- position: absolute;
254
- left: 0;
255
- top: 0;
256
- }
257
-
258
- .litespeed-shell-body li {
259
- word-wrap: break-word;
260
- position: relative;
261
- padding: 0 0 0 15px;
262
- margin: 0;
263
- }
264
-
265
- .litespeed-widget-setting{
266
- background-color: #ecebdc;
267
- padding: 5px 14px;
268
- margin: 5px -15px;
269
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/css/litespeed-callout.css DELETED
@@ -1,63 +0,0 @@
1
- /** callout style **/
2
- .litespeed-callout2{
3
- margin: 20px;
4
- border-left: 1px solid #999;
5
- padding-left: 10px;
6
- }
7
-
8
- .litespeed-callout2 h4{
9
- font-size: 2.0em;
10
- margin-bottom: 10px;
11
- }
12
-
13
- .litespeed-callout {
14
- padding: 10px 25px;
15
- margin: 10px 0;
16
- border: 1px solid #eee;
17
- border-left-width: 5px;
18
- border-radius: 3px;
19
- }
20
-
21
- .litespeed-callout+.litespeed-callout {
22
- margin-top: -5px;
23
- }
24
-
25
- .litespeed-callout p:last-child {
26
- margin-bottom: 0;
27
- }
28
-
29
- .litespeed-callout h4 {
30
- margin-top: 0;
31
- margin-bottom: 5px;
32
- margin-left: -10px;
33
- font-size: 14px;
34
- font-family: inherit;
35
- font-weight: 500;
36
- line-height: 1.1;
37
- color: inherit;
38
- }
39
-
40
- .litespeed-callout ol{
41
- margin-bottom: 0;
42
- }
43
-
44
- .litespeed-callout-info{
45
- border-left-color: #1b809e;
46
- }
47
- .litespeed-callout-info h4{
48
- color: #1b809e;
49
- }
50
-
51
- .litespeed-callout-warning{
52
- border-left-color: #aa6708;
53
- }
54
- .litespeed-callout-warning h4{
55
- color: #aa6708;
56
- }
57
-
58
- .litespeed-callout-danger{
59
- border-left-color: #ce4844;
60
- }
61
- .litespeed-callout-danger h4{
62
- color: #ce4844;
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/css/litespeed-checkbox.css DELETED
@@ -1,356 +0,0 @@
1
- .litespeed-radio{
2
- display: inline-block;
3
- margin-right: 5px;
4
- }
5
-
6
- .litespeed-radio label {
7
- min-width: 115px;
8
- border-radius: 3px;
9
- border: 1px solid #D1D3D4;
10
- padding-right: 10px;
11
- }
12
-
13
- .litespeed-radio.litespeed-mini label {
14
- min-width: 75px;
15
- padding-right: 5px;
16
- }
17
-
18
- .litespeed-radio input:checked:before,
19
- .litespeed-radio input:empty {
20
- width: initial;
21
- height: initial;
22
- margin: initial;
23
- min-width: initial;
24
- border: initial;
25
- content: initial;
26
- }
27
-
28
- .litespeed-radio input:empty {
29
- -moz-appearance: none;
30
- -webkit-appearance: none;
31
- appearance: none;
32
- }
33
-
34
- /* style label */
35
- .litespeed-radio input:empty ~ label {
36
- position: relative;
37
- float: left;
38
- line-height: 2.5em;
39
- text-indent: 3.25em;
40
- cursor: pointer;
41
- -webkit-user-select: none;
42
- -moz-user-select: none;
43
- -ms-user-select: none;
44
- user-select: none;
45
- }
46
-
47
- .litespeed-radio.litespeed-mini input:empty ~ label {
48
- line-height: 1.3em;
49
- text-indent: 1.75em;
50
- }
51
-
52
- .litespeed-radio input:empty ~ label:before {
53
- position: absolute;
54
- display: block;
55
- top: 0;
56
- bottom: 0;
57
- left: 0;
58
- content: '';
59
- width: 2.5em;
60
- background: #D1D3D4;
61
- border-radius: 3px 0 0 3px;
62
- }
63
-
64
- .litespeed-radio.litespeed-mini input:empty ~ label:before {
65
- width: 1.3em;
66
- border-radius: 1px 0 0 1px;
67
- }
68
-
69
- .litespeed-radio input:empty ~ label:before {
70
- content:'\2714';
71
- text-indent: .9em;
72
- }
73
-
74
- .litespeed-radio.cross input:empty ~ label:before {
75
- content:'\2716';
76
- }
77
-
78
- .litespeed-radio.litespeed-mini input ~ label:before {
79
- text-indent: .2em;
80
- }
81
-
82
- .litespeed-radio input:not(:checked) ~ label:before {
83
- color: #C2C2C2;
84
- }
85
-
86
- /* toggle hover */
87
- .litespeed-radio input:hover:not(:checked) ~ label:before {
88
- color: #717171;
89
- }
90
-
91
- .litespeed-radio input:hover:not(:checked) ~ label {
92
- color: #777;
93
- }
94
-
95
- /* toggle on */
96
- .litespeed-radio input:checked ~ label:before {
97
- color: #9CE2AE;
98
- background-color: #4DCB6D;
99
- }
100
-
101
- .litespeed-radio.cross input:checked ~ label:before {
102
- color: #faf4d5;
103
- background-color: #f0ad4e;
104
- }
105
-
106
- .litespeed-radio.litespeed-mini input:checked ~ label:before {
107
- text-indent: .2em;
108
- }
109
-
110
- .litespeed-radio input:checked ~ label {
111
- /*color: #888;*/
112
- }
113
-
114
- /* radio focus */
115
- .litespeed-radio input:focus ~ label:before {
116
- /*box-shadow: 0 0 0 3px #999;*/
117
- }
118
-
119
- /******** switch **************/
120
- .litespeed-switch{
121
- display: inline-block;
122
- }
123
-
124
- .litespeed-switch input {
125
- display: none;
126
- }
127
- .litespeed-switch label {
128
- font-size: 13px;
129
- display: inline-block;
130
- min-width: 80px;
131
- background-color: #e4e4e4;
132
- color: #333;
133
- font-weight: normal;
134
- text-align: center;
135
- text-shadow: none;
136
- padding: 4px 9px;
137
- border: 1px solid rgba(0, 0, 0, 0.2);
138
- -webkit-transition: all 0.1s ease-in-out;
139
- -moz-transition: all 0.1s ease-in-out;
140
- -ms-transition: all 0.1s ease-in-out;
141
- -o-transition: all 0.1s ease-in-out;
142
- transition: all 0.1s ease-in-out;
143
- float: left;
144
- cursor: pointer;
145
- -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.1);
146
- box-shadow: inset 0 1px 3px -1px rgba(0, 0, 0, 0.3), inset 0 -1px 3px -1px rgba(0, 0, 0, 0.3);
147
- }
148
-
149
- .litespeed-switch label:hover{
150
- color: #666;
151
- background-color: #dedddd ;
152
- }
153
-
154
- .litespeed-switch label:first-of-type,.litespeed-switch label:last-of-type {
155
- box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.1);
156
- }
157
-
158
- .litespeed-switch label:first-of-type:hover,
159
- .litespeed-switch label:last-of-type:hover {
160
- box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px rgba(255, 255, 255, 0.1);
161
- }
162
-
163
- .litespeed-switch label:first-of-type {
164
- border-radius: 4px 0 0 4px;
165
- }
166
-
167
- .litespeed-switch label:last-of-type {
168
- border-radius: 0 4px 4px 0;
169
- }
170
-
171
- .litespeed-switch input:checked + label {
172
- background-color: #8a8a8a;
173
- -webkit-box-shadow: none;
174
- box-shadow: none;
175
- color: #fff;
176
- }
177
-
178
- .litespeed-switch.litespeed-label-info,
179
- .litespeed-switch.litespeed-label-success,
180
- .litespeed-switch.litespeed-label-warning,
181
- .litespeed-switch.litespeed-label-danger{
182
- background-color: initial;
183
- }
184
-
185
- /* .litespeed-switch.litespeed-label-info label:hover, */
186
- .litespeed-switch.litespeed-label-info input:checked + label {
187
- background-color: #43A6DF;
188
- }
189
-
190
- .litespeed-switch.litespeed-label-info input:checked + label:hover {
191
- background-color: #40a0d8 ;
192
- }
193
-
194
- /*.litespeed-switch.litespeed-label-success label:hover,*/
195
- .litespeed-switch.litespeed-label-success input:checked + label {
196
- background-color: #5cb85c;
197
- }
198
- /*.litespeed-switch.litespeed-label-warning label:hover,*/
199
- .litespeed-switch.litespeed-label-warning input:checked + label {
200
- background-color: #f0ad4e;
201
- }
202
- /*.litespeed-switch.litespeed-label-danger label:hover,*/
203
- .litespeed-switch.litespeed-label-danger input:checked + label {
204
- background-color: #d9534f;
205
- }
206
-
207
- .litespeed-switch.litespeed-mini label{
208
- padding: 1px;
209
- font-size: 12px;
210
- line-height: 1.9em;
211
- }
212
-
213
- /*.litespeed-switch input[disabled] + label:hover {
214
- background-color: #e4e4e4;
215
- color: #333;
216
- -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.1);
217
- box-shadow: inset 0 1px 3px -1px rgba(0, 0, 0, 0.3), inset 0 -1px 3px -1px rgba(0, 0, 0, 0.3);
218
- }
219
-
220
- .litespeed-switch input[disabled] + label:first-of-type:hover,.litespeed-switch input[disabled] + label:last-of-type:hover {
221
- box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.1);
222
- }
223
-
224
- .litespeed-switch input[disabled]:checked + label:hover {
225
- background-color: #8a8a8a;
226
- color: #fff;
227
- }*/
228
-
229
- .litespeed-switch input[disabled]:checked + label {
230
- background-color: #8a8a8a;
231
- }
232
-
233
-
234
- /******** round on/off switch **************/
235
- .litespeed-switch-onoff {
236
- position: relative;
237
- display: block;
238
- vertical-align: top;
239
- width: 100px;
240
- height: 30px;
241
- padding: 3px;
242
- margin:0;
243
- background: linear-gradient(to bottom, #eeeeee, #FFFFFF 25px);
244
- background-image: -webkit-linear-gradient(top, #eeeeee, #FFFFFF 25px);
245
- border-radius: 18px;
246
- box-shadow: inset 0 -1px white, inset 0 1px 1px rgba(0, 0, 0, 0.05);
247
- cursor: pointer;
248
- box-sizing:content-box;
249
- }
250
-
251
- .litespeed-switch-onoff input,
252
- .litespeed-switch-onoff input:disabled {
253
- position: absolute;
254
- top: 0;
255
- left: 0;
256
- opacity: 0;
257
- box-sizing:content-box;
258
- }
259
-
260
- .litespeed-switch-onoff span:first-of-type {
261
- position: relative;
262
- display: block;
263
- height: inherit;
264
- font-size: 10px;
265
- text-transform: uppercase;
266
- background: #eceeef;
267
- border-radius: inherit;
268
- box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12), inset 0 0 2px rgba(0, 0, 0, 0.15);
269
- box-sizing:content-box;
270
- overflow: hidden;
271
- }
272
- .litespeed-switch-onoff span:first-of-type:before, .litespeed-switch-onoff span:first-of-type:after {
273
- position: absolute;
274
- margin-top: -.5em;
275
- line-height: 1;
276
- -webkit-transition: inherit;
277
- -moz-transition: inherit;
278
- -o-transition: inherit;
279
- transition: inherit;
280
- box-sizing:content-box;
281
-
282
- width: 20px;
283
- height: 20px;
284
- top: 4px;
285
- left: 0;
286
- right: 0;
287
- bottom: 0;
288
- padding: 11px 0 0 0;
289
- border-radius: 20px;
290
- box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.2), inset 0 0 3px rgba(0, 0, 0, 0.1);
291
- }
292
- .litespeed-switch-onoff span:first-of-type:before {
293
- content: attr(data-off);
294
- right: 11px;
295
- color: #aaaaaa;
296
- text-shadow: 0 1px rgba(255, 255, 255, 0.5);
297
- background: #eceeef;
298
- text-align: left;
299
- padding-left: 80px;
300
- text-indent: -40px;
301
- }
302
- .litespeed-switch-onoff span:first-of-type:after {
303
- content: attr(data-on);
304
- color: #FFFFFF;
305
- text-shadow: 0 1px rgba(0, 0, 0, 0.2);
306
- text-align: left;
307
- text-indent: 9px;
308
- background: #FF7F50;
309
- left: -100px;
310
- width: 100%;
311
- }
312
- .litespeed-switch-onoff input:checked ~ span:first-of-type {
313
- background: #E1B42B;
314
- box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15), inset 0 0 3px rgba(0, 0, 0, 0.2);
315
- }
316
- .litespeed-switch-onoff input:checked ~ span:first-of-type:before {
317
- left: 100px;
318
- }
319
- .litespeed-switch-onoff input:checked ~ span:first-of-type:after {
320
- left: 0;
321
- }
322
- .litespeed-switch-onoff span:last-of-type {
323
- position: absolute;
324
- top: 4px;
325
- left: 4px;
326
- width: 28px;
327
- height: 28px;
328
- background: linear-gradient(to bottom, #FFFFFF 40%, #f0f0f0);
329
- background-image: -webkit-linear-gradient(top, #FFFFFF 40%, #f0f0f0);
330
- border-radius: 100%;
331
- box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.2);
332
- }
333
- .litespeed-switch-onoff span:last-of-type:before {
334
- content: "";
335
- position: absolute;
336
- top: 50%;
337
- left: 50%;
338
- margin: -6px 0 0 -6px;
339
- width: 12px;
340
- height: 12px;
341
- background: linear-gradient(to bottom, #eeeeee, #FFFFFF);
342
- background-image: -webkit-linear-gradient(top, #eeeeee, #FFFFFF);
343
- border-radius: 6px;
344
- box-shadow: inset 0 1px rgba(0, 0, 0, 0.02);
345
- }
346
- .litespeed-switch-onoff input:checked ~ span:last-of-type {
347
- left: 74px;
348
- box-shadow: -1px 1px 5px rgba(0, 0, 0, 0.2);
349
- }
350
-
351
- .litespeed-switch-onoff span{
352
- transition: All 0.3s ease;
353
- -webkit-transition: All 0.3s ease;
354
- -moz-transition: All 0.3s ease;
355
- -o-transition: All 0.3s ease;
356
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/css/litespeed-common.css DELETED
@@ -1,81 +0,0 @@
1
- /* Litespeed common */
2
- .litespeed-row{
3
- display: block;
4
- margin-top: 5px;
5
- }
6
-
7
- .litespeed-reset{
8
- width: initial;
9
- }
10
-
11
- .litespeed-inline{
12
- display: inline-block;
13
- }
14
-
15
- .litespeed-left{
16
- float: left;
17
- }
18
-
19
- .litespeed-row:before{
20
- content: " ";
21
- }
22
-
23
- .litespeed-row:after,
24
- .litespeed-clearfix:after{
25
- content: " ";
26
- display: block;
27
- clear: both;
28
- }
29
-
30
- .litespeed-desc{
31
- font-size: 12px;
32
- font-weight: normal;
33
- color: #9e9e9e;
34
- margin-top: 5px;
35
- }
36
-
37
- .litespeed-hide{
38
- display: none;
39
- }
40
-
41
- .litespeed-top10{
42
- margin-top: 10px;
43
- }
44
-
45
- .litespeed-top15{
46
- margin-top: 15px;
47
- }
48
-
49
- .litespeed-top20{
50
- margin-top: 20px;
51
- }
52
-
53
- .litespeed-down:after{
54
- content: ' ';
55
- border: solid #16c316;
56
- border-width: 0 3px 3px 0;
57
- display: inline-block;
58
- padding: 3px;
59
- margin-left: 15px;
60
- transform: rotate(45deg);
61
- -webkit-transform: rotate(45deg);
62
- -webkit-transition: all .3s ease;
63
- -moz-transition: all .3s ease;
64
- -ms-transition: all .3s ease;
65
- -o-transition: all .3s ease;
66
- }
67
-
68
- .litespeed-up:after{
69
- content: ' ';
70
- border: solid #16c316;
71
- border-width: 0 3px 3px 0;
72
- display: inline-block;
73
- padding: 3px;
74
- margin-left: 15px;
75
- transform: rotate(-135deg);
76
- -webkit-transform: rotate(-135deg);
77
- -webkit-transition: all .3s ease;
78
- -moz-transition: all .3s ease;
79
- -ms-transition: all .3s ease;
80
- -o-transition: all .3s ease;
81
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/css/litespeed-icon.css DELETED
@@ -1,27 +0,0 @@
1
- @font-face {
2
- font-family: 'litespeedfont';
3
- src: url('fonts/litespeedfont.eot?rs8ttq');
4
- src: url('fonts/litespeedfont.eot?rs8ttq#iefix') format('embedded-opentype'),
5
- url('fonts/litespeedfont.ttf?rs8ttq') format('truetype'),
6
- url('fonts/litespeedfont.woff?rs8ttq') format('woff'),
7
- url('fonts/litespeedfont.svg?rs8ttq#litespeedfont') format('svg');
8
- font-weight: normal;
9
- font-style: normal;
10
- }
11
-
12
- #adminmenu #toplevel_page_lscache-dash .menu-icon-generic div.wp-menu-image:before,
13
- .litespeed-top-toolbar .ab-icon::before{
14
- content: "\e900";
15
- font-family: 'litespeedfont' !important;
16
- speak: none;
17
- font-style: normal;
18
- font-weight: normal;
19
- font-variant: normal;
20
- text-transform: none;
21
- line-height: 1;
22
-
23
- /* Better Font Rendering =========== */
24
- -webkit-font-smoothing: antialiased;
25
- -moz-osx-font-smoothing: grayscale;
26
-
27
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/css/litespeed-label.css DELETED
@@ -1,67 +0,0 @@
1
- .litespeed-label {
2
- display: inline;
3
- padding: .2em .6em .3em;
4
- font-size: 75%;
5
- font-weight: bold;
6
- line-height: 1;
7
- color: #fff;
8
- text-align: center;
9
- white-space: nowrap;
10
- vertical-align: baseline;
11
- border-radius: .25em;
12
- }
13
- a.litespeed-label:hover,
14
- a.litespeed-label:focus {
15
- color: #fff;
16
- text-decoration: none;
17
- cursor: pointer;
18
- }
19
- .litespeed-label:empty {
20
- display: none;
21
- }
22
- .btn .litespeed-label {
23
- position: relative;
24
- top: -1px;
25
- }
26
- .litespeed-label-default {
27
- background-color: #777;
28
- }
29
- .litespeed-label-default[href]:hover,
30
- .litespeed-label-default[href]:focus {
31
- background-color: #5e5e5e;
32
- }
33
- .litespeed-label-primary {
34
- background-color: #337ab7;
35
- }
36
- .litespeed-label-primary[href]:hover,
37
- .litespeed-label-primary[href]:focus {
38
- background-color: #286090;
39
- }
40
- .litespeed-label-success {
41
- background-color: #5cb85c;
42
- }
43
- .litespeed-label-success[href]:hover,
44
- .litespeed-label-success[href]:focus {
45
- background-color: #449d44;
46
- }
47
- .litespeed-label-info {
48
- background-color: #5bc0de;
49
- }
50
- .litespeed-label-info[href]:hover,
51
- .litespeed-label-info[href]:focus {
52
- background-color: #31b0d5;
53
- }
54
- .litespeed-label-warning {
55
- background-color: #f0ad4e;
56
- }
57
- .litespeed-label-warning[href]:hover,
58
- .litespeed-label-warning[href]:focus {
59
- background-color: #ec971f;
60
- }
61
- .litespeed-label-danger {
62
- background-color: #d9534f;
63
- }
64
- .litespeed-label-danger[href]:hover,
65
- .litespeed-label-danger[href]:focus {
66
- background-color: #c9302c;
67
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/css/litespeed.css ADDED
@@ -0,0 +1,1169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /********************************* common *******************************/
2
+ *[litespeed-accesskey]:before {
3
+ content: '[' attr(litespeed-accesskey) '] ';
4
+ }
5
+
6
+ .litespeed-row {
7
+ display: block;
8
+ margin-top: 5px;
9
+ margin-left: 5px;
10
+ }
11
+
12
+ .litespeed-reset{
13
+ width: initial;
14
+ }
15
+
16
+ .litespeed-inline{
17
+ display: inline-block;
18
+ }
19
+
20
+ .litespeed-warning {
21
+ color: #ffc107!important;
22
+ }
23
+
24
+ .litespeed-danger {
25
+ color: #dc3545!important;
26
+ }
27
+
28
+ .litespeed-left10 {
29
+ margin-left: 10px;
30
+ }
31
+
32
+ .litespeed-top10 {
33
+ margin-top: 10px;
34
+ }
35
+
36
+ .litespeed-top20 {
37
+ margin-top: 20px;
38
+ }
39
+
40
+ .litespeed-desc {
41
+ font-size: 12px;
42
+ font-weight: normal;
43
+ color: #9e9e9e;
44
+ color: #7a919e;
45
+ margin: 10px 5px;
46
+ }
47
+
48
+ .litespeed-hide {
49
+ display: none;
50
+ }
51
+
52
+ .litespeed-relative {
53
+ position: relative ;
54
+ }
55
+
56
+ .litespeed-h3{
57
+ font-family: "Open Sans", Arial, sans-serif;
58
+ line-height: 18px;
59
+ color: #264d73;
60
+ font-size: 18px;
61
+ font-weight: 600;
62
+ margin: 2px 0;
63
+ }
64
+
65
+ /********************************* logo *******************************/
66
+ @font-face {
67
+ font-family: 'litespeedfont';
68
+ src: url('fonts/litespeedfont.eot?rs8ttq');
69
+ src: url('fonts/litespeedfont.eot?rs8ttq#iefix') format('embedded-opentype'),
70
+ url('fonts/litespeedfont.ttf?rs8ttq') format('truetype'),
71
+ url('fonts/litespeedfont.woff?rs8ttq') format('woff'),
72
+ url('fonts/litespeedfont.svg?rs8ttq#litespeedfont') format('svg');
73
+ font-weight: normal;
74
+ font-style: normal;
75
+ }
76
+
77
+ #adminmenu #toplevel_page_lscache-dash .menu-icon-generic div.wp-menu-image:before,
78
+ .litespeed-top-toolbar .ab-icon::before{
79
+ content: "\e900";
80
+ font-family: 'litespeedfont' !important;
81
+ speak: none;
82
+ font-style: normal;
83
+ font-weight: normal;
84
+ font-variant: normal;
85
+ text-transform: none;
86
+ line-height: 1;
87
+
88
+ /* Better Font Rendering =========== */
89
+ -webkit-font-smoothing: antialiased;
90
+ -moz-osx-font-smoothing: grayscale;
91
+
92
+ }
93
+
94
+ /********************************* layout *******************************/
95
+ .litespeed-body{
96
+ background: none repeat scroll 0 0 #fff;
97
+ border: 1px solid #6699cc;
98
+ box-shadow: 0 2px 2px rgba(0, 0, 0, 0.05);
99
+ font-size: 14px;
100
+ /*line-height: 2em;*/
101
+ margin: 0px 0px 20px 0;
102
+ overflow: auto;
103
+ padding: 10px 15px 15px 15px;
104
+ position: relative;
105
+ border-top: none;
106
+ color: #264d73;
107
+ }
108
+
109
+ .litespeed-body code{
110
+ color: #998c85 ;
111
+ background-color: #dde9f5;
112
+ border-radius: 3px;
113
+ }
114
+
115
+ .litespeed-body ul{
116
+ margin-left: 2em;
117
+ }
118
+
119
+ .litespeed-body i {
120
+ font-size: 13px;
121
+ line-height: 16px;
122
+ }
123
+
124
+ .litespeed-body p {
125
+ margin: 1em ;
126
+ }
127
+
128
+ .litespeed-desc p {
129
+ margin-left: 0;
130
+ }
131
+
132
+ .litespeed-title {
133
+ font-size: 18px;
134
+ font-weight: 600;
135
+ color: #264d73;
136
+ border-bottom: 1px solid #6699cc;
137
+ margin: 35px 0px 20px 0;
138
+ display: table;
139
+ padding-right: 50px;
140
+ padding-left: 3px;
141
+ }
142
+
143
+ .litespeed-title a {
144
+ text-decoration: none;
145
+ }
146
+
147
+ /********************************* nav tabs *******************************/
148
+ .litespeed-wrap {
149
+ margin: 10px 20px 0 2px;
150
+ }
151
+
152
+ .litespeed-header {
153
+ border-bottom: 1px solid #6699cc;
154
+ margin: 0;
155
+ padding-top: 9px;
156
+ padding-bottom: 0;
157
+ line-height: 24px;
158
+ font-size: 13px;
159
+ font-weight: 600;
160
+ color: #264d73;
161
+ }
162
+
163
+ .litespeed-header:not(.wp-clearfix):after {
164
+ content: "";
165
+ display: table;
166
+ clear: both;
167
+ }
168
+
169
+ .litespeed-tab {
170
+ text-decoration: none;
171
+ float: left;
172
+ border: 1px solid #6699cc;
173
+ border-top-left-radius: 3px;
174
+ border-top-right-radius: 3px;
175
+ font-size: 13px;
176
+ line-height: 24px;
177
+ border-bottom: none;
178
+ margin-left: .5em;
179
+ padding: 2px 9px;
180
+ min-width: 50px;
181
+ background: #f9fafc;
182
+ background: #f1f1f1;
183
+ color: #6699cc;
184
+ text-align: center;
185
+ font-weight: 400;
186
+ -moz-box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25);
187
+ -webkit-box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25);
188
+ box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25);
189
+ }
190
+
191
+ .litespeed-tab-active {
192
+ margin-bottom: -1px;
193
+ color: #264d73;
194
+ border-bottom: 1px solid #fff;
195
+
196
+ }
197
+
198
+ .litespeed-tab-active, .litespeed-tab-active:focus, .litespeed-tab-active:focus:active, .litespeed-tab-active:hover {
199
+ border-bottom: 1px solid #fff;
200
+ background: #fff;
201
+ color: #264d73;
202
+ }
203
+
204
+ .litespeed-tab-active, .litespeed-tab:focus:active {
205
+ -webkit-box-shadow: none;
206
+ box-shadow: none;
207
+ font-size: 13px;
208
+ color: #264d73;
209
+ }
210
+
211
+ .litespeed-tab:focus, .litespeed-tab:hover {
212
+ background-color: #fff;
213
+ color: #264d73;
214
+ -moz-box-shadow: none;
215
+ -webkit-box-shadow: none;
216
+ box-shadow: none;
217
+ font-size: 13px;
218
+ border-bottom: 1px solid #fff;
219
+ margin-bottom: -1px;
220
+ }
221
+
222
+ /********************************* panel *******************************/
223
+ .litespeed-panel-wrapper {
224
+ display: flex;
225
+ width: 100%;
226
+ flex-flow: row wrap;
227
+ justify-content: flex-start;
228
+ }
229
+
230
+ .litespeed-panel {
231
+ text-decoration: none;
232
+ display: flex;
233
+ justify-content: space-between;
234
+ border: 1px solid #6699cc;
235
+ -moz-box-shadow: 0 0 0 1px rgba(102, 153, 204, 0.25);
236
+ -webkit-box-shadow: 0 0 0 1px rgba(102, 153, 204, 0.25);
237
+ box-shadow: 0 0 0 1px rgba(102, 153, 204, 0.25);
238
+ border-radius: 3px;
239
+ background: #f9fafc;
240
+ padding: 6px 0px 4px 5px;
241
+ width: 310px;
242
+ margin: 15px 5px 15px 15px;
243
+ min-height: 75px;
244
+ }
245
+
246
+ .litespeed-panel:hover {
247
+ color: #538ac6;
248
+ border: 1px solid #00a3cc;
249
+ background: #fff;
250
+ -moz-box-shadow: none;
251
+ -webkit-box-shadow: none;
252
+ box-shadow: none;
253
+ }
254
+
255
+ .litespeed-panel-wrapper-icon {
256
+ width: 25%;
257
+ height:100%;
258
+ }
259
+
260
+ [class*="litespeed-panel-icon-"] {
261
+ background-size: contain;
262
+ width: 60px;
263
+ height: 60px;
264
+ margin: 5px;
265
+ background-repeat: no-repeat;
266
+ display: inline-block;
267
+ }
268
+
269
+ .litespeed-panel-icon-all { background-image: url("../img/icons/all.svg") ; }
270
+ .litespeed-panel-icon-revision { background-image: url("../img/icons/revision.svg") ; }
271
+ .litespeed-panel-icon-auto_draft { background-image: url("../img/icons/auto_draft.svg") ; }
272
+ .litespeed-panel-icon-trash_post { background-image: url("../img/icons/trash_post.svg") ; }
273
+ .litespeed-panel-icon-spam_comment { background-image: url("../img/icons/spam_comment.svg") ; }
274
+ .litespeed-panel-icon-trash_comment { background-image: url("../img/icons/trash_comment.svg") ; }
275
+ .litespeed-panel-icon-trackback-pingback{ background-image: url("../img/icons/trackback-pingback.svg") ; }
276
+ .litespeed-panel-icon-expired_transient { background-image: url("../img/icons/expired_transient.svg") ; }
277
+ .litespeed-panel-icon-all_transients { background-image: url("../img/icons/all_transients.svg") ; }
278
+ .litespeed-panel-icon-optimize_tables { background-image: url("../img/icons/optimize_tables.svg") ; }
279
+ .litespeed-panel-icon-purge-front { background-image: url("../img/icons/purge-front.svg") ; }
280
+ .litespeed-panel-icon-purge-pages { background-image: url("../img/icons/purge-pages.svg") ; }
281
+ .litespeed-panel-icon-purge-cssjs { background-image: url("../img/icons/purge-cssjs.svg") ; }
282
+ .litespeed-panel-icon-purge-all { background-image: url("../img/icons/purge-all.svg") ; }
283
+ .litespeed-panel-icon-empty-cache { background-image: url("../img/icons/empty-cache.svg") ; }
284
+ .litespeed-panel-icon-purge-403 { background-image: url("../img/icons/purge-403.svg") ; }
285
+ .litespeed-panel-icon-purge-404 { background-image: url("../img/icons/purge-404.svg") ; }
286
+ .litespeed-panel-icon-purge-500 { background-image: url("../img/icons/purge-500.svg") ; }
287
+ .litespeed-panel-top-right-icon-cross { background-image: url("../img/icons/cross_icon.svg") ; }
288
+ .litespeed-panel-top-right-icon-tick { background-image: url("../img/icons/success_icon.svg") ; }
289
+
290
+
291
+ .litespeed-panel-content {
292
+ width: 75%;
293
+ height:100%;
294
+ margin-top: 10px;
295
+ }
296
+
297
+ .litespeed-panel-para {
298
+ font-family: "Open Sans", Arial, sans-serif;
299
+ line-height: 18px;
300
+ color: #264d73;
301
+ }
302
+
303
+ .litespeed-panel .litespeed-h3{
304
+ font-size: 14px;
305
+ }
306
+
307
+ .litespeed-panel-counter {
308
+ color: #3abfbf;
309
+ }
310
+
311
+ .litespeed-panel-counter-red {
312
+ color: #cc3d6a ;
313
+ }
314
+
315
+ .litespeed-panel-para {
316
+ margin-top: -12px;
317
+ font-size: 13px;
318
+ }
319
+
320
+ .litespeed-panel-wrapper-top-right {
321
+ width: 10%;
322
+ height:100%;
323
+ }
324
+
325
+ .litespeed-panel-top-right-icon-tick,
326
+ .litespeed-panel-top-right-icon-cross {
327
+ background-size: contain;
328
+ width: 20px;
329
+ height: 20px;
330
+ background-repeat: no-repeat;
331
+ display: inline-block;
332
+ }
333
+
334
+ /********************************* btn *******************************/
335
+ .litespeed-body [class*="litespeed-btn-"] {
336
+ padding: 5px 10px;
337
+ font-size: 14px !important;
338
+ font-weight:400;
339
+ border-radius: 3px;
340
+ margin: 15px 5px;
341
+ text-align: center;
342
+ background: #fff;
343
+ min-width: 155px;
344
+ cursor: pointer;
345
+ text-decoration: none;
346
+ display: inline-block;
347
+ height: initial;
348
+ }
349
+
350
+ .litespeed-body [class*="litespeed-btn-"]:hover {
351
+ font-weight: 400;
352
+ color: #fff;
353
+ -moz-box-shadow: none;
354
+ -webkit-box-shadow: none;
355
+ box-shadow: none;
356
+ }
357
+
358
+ .litespeed-body .litespeed-btn-danger {
359
+ color: #cc3d6a;
360
+ border: 1px solid #cc3d6a;
361
+ -moz-box-shadow: 0 0 0 1px rgba(204, 61, 106, 0.25);
362
+ -webkit-box-shadow: 0 0 0 1px rgba(204, 61, 106, 0.25);
363
+ box-shadow: 0 0 0 1px rgba(204, 61, 106, 0.25);
364
+ }
365
+
366
+ .litespeed-body .litespeed-btn-danger:hover {
367
+ background: #cc3d6a;
368
+ }
369
+
370
+ .litespeed-body .litespeed-btn-warning {
371
+ color: #e59544;
372
+ border: 1px solid #e59544;
373
+ -moz-box-shadow: 0 0 0 1px rgba(230, 150, 69, 0.25);
374
+ -webkit-box-shadow: 00 0 0 1px rgba(230, 150, 69, 0.25);
375
+ box-shadow: 0 0 0 1px rgba(230, 150, 69, 0.25);
376
+ }
377
+
378
+ .litespeed-body .litespeed-btn-warning:hover {
379
+ background: #e59544;
380
+ }
381
+
382
+ .litespeed-body .litespeed-btn-success {
383
+ color: #36b0b0;
384
+ border: 1px solid #36b0b0;
385
+ -moz-box-shadow: 0 0 0 1px rgba(54, 176, 176, 0.25);
386
+ -webkit-box-shadow: 0 0 0 1px rgba(54, 176, 176, 0.25);
387
+ box-shadow: 0 0 0 1px rgba(54, 176, 176, 0.25);
388
+ }
389
+
390
+ .litespeed-body .litespeed-btn-success:hover {
391
+ background: #36b0b0;
392
+ }
393
+
394
+ .litespeed-body .litespeed-btn-primary {
395
+ color: #538ac6;
396
+ border: 1px solid #538ac6;
397
+ -moz-box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25);
398
+ -webkit-box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25);
399
+ box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25);
400
+ }
401
+
402
+ .litespeed-body .litespeed-btn-primary:hover {
403
+ background: #538ac6;
404
+ border-color: #538ac6;
405
+ }
406
+
407
+ .litespeed-body .litespeed-btn-xs {
408
+ padding: 1px 8px;
409
+ font-size: 13px;
410
+ line-height: 1.5;
411
+ border-radius: 2px;
412
+ min-width: 100px;
413
+ }
414
+
415
+
416
+ /********************************* switch *******************************/
417
+ .litespeed-switch {
418
+ border: 1px solid #538ac6;
419
+ -moz-box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25);
420
+ -webkit-box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25);
421
+ box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25);
422
+ border-radius: 3px;
423
+ font-size: 14px;
424
+ font-weight: 600;
425
+ margin: 0 0 0 ;
426
+ background-color: #fff;
427
+ padding: -1px;
428
+ display: inline-block;
429
+ }
430
+
431
+ .litespeed-switch input:checked + label {
432
+ background-color: #36b0b0;
433
+ color: #fff;
434
+ font-weight: 600;
435
+ border: 1px solid #36b0b0;
436
+ }
437
+
438
+ .litespeed-switch label {
439
+ font-size: 14px;
440
+ display: inline-block;
441
+ min-width: 75px;
442
+ background-color: #fff;
443
+ color: #6699cc;
444
+ font-weight: 400;
445
+ text-align: center;
446
+ padding: 5px 9px;
447
+ float: left;
448
+ cursor: pointer;
449
+ border: 1px solid #f9fafc;
450
+ }
451
+
452
+ .litespeed-switch label:hover {
453
+ background-color: #f9fafc;
454
+ font-weight: 400;
455
+ color: #538ac6;
456
+ }
457
+
458
+ .litespeed-switch input {
459
+ display: none;
460
+ }
461
+
462
+ .litespeed-cache-purgeby-text {
463
+ font-size: 13px;
464
+ padding-left: 20px;
465
+ display: inline-block;
466
+ vertical-align: top;
467
+ margin-top: 5px;
468
+ }
469
+
470
+
471
+ /********************************* switch drag *******************************/
472
+ .litespeed-switch-drag {
473
+ position: relative;
474
+ width: 100px;
475
+ -webkit-user-select:none;
476
+ -moz-user-select:none;
477
+ -ms-user-select: none;
478
+ border: 1px solid #538ac6;
479
+ -moz-box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25);
480
+ -webkit-box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25);
481
+ box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25);
482
+ border-radius: 3px;
483
+ display: inline-block;
484
+ }
485
+
486
+ .litespeed-switch-drag input {
487
+ display: none;
488
+ }
489
+
490
+ .litespeed-switch-drag-label {
491
+ display: block;
492
+ overflow: hidden;
493
+ cursor: pointer;
494
+ }
495
+
496
+ .litespeed-switch-drag-inner {
497
+ display: block;
498
+ width: 200%;
499
+ margin-left: -100%;
500
+ transition: margin 0.1s ease-in 0s;
501
+ }
502
+
503
+ .litespeed-switch-drag-inner:before, .litespeed-switch-drag-inner:after {
504
+ display: block;
505
+ float: left;
506
+ width: 50%;
507
+ height: 25px;
508
+ padding: 0;
509
+ line-height: 25px;
510
+ font-size: 13px;
511
+ color: #fff;
512
+ font-weight: 600;
513
+ box-sizing: border-box;
514
+ -moz-box-shadow: inset 0 0 1px 2px rgba(38, 77, 115, .15);
515
+ -webkit-box-shadow: inset 0 0 1px 2px rgba(38, 77, 115, .15);
516
+ box-shadow: inset 0 0 1px 2px rgba(38, 77, 115, .15);
517
+ }
518
+
519
+ .litespeed-switch-drag-inner:before {
520
+ content: attr(data-on);
521
+ padding-left: 10px;
522
+ background-color: #36b0b0;
523
+ color: #FFFFFF;
524
+
525
+ }
526
+
527
+ .litespeed-switch-drag-inner:after {
528
+ content: attr(data-off);
529
+ padding-right: 8px;
530
+ background-color: #f9fafc;
531
+ color: #6699cc;
532
+ text-align: right;
533
+ font-weight: 400;
534
+ }
535
+
536
+ .litespeed-switch-drag-switch {
537
+ display: block;
538
+ width: 25px;
539
+ margin: 0px;
540
+ background: #F9FAFC;
541
+ position: absolute;
542
+ top: 0;
543
+ bottom: 0;
544
+ right: 73px;
545
+ border: 1px solid #6699CC;
546
+ border-radius: 2px;
547
+ -moz-box-shadow: 0 0 1px 1px rgba(102, 153, 204, 0.5);
548
+ -webkit-box-shadow: 0 0 1px 1px rgba(102, 153, 204, 0.5);
549
+ box-shadow: 0 0 1px 1px rgba(102, 153, 204, 0.5);
550
+ transition: all 0.1s ease-in 0s;
551
+ }
552
+
553
+ .litespeed-switch-drag input:checked + .litespeed-switch-drag-label .litespeed-switch-drag-inner {
554
+ margin-left: 0;
555
+ }
556
+
557
+ .litespeed-switch-drag input:checked + .litespeed-switch-drag-label .litespeed-switch-drag-switch {
558
+ right: 0px;
559
+ }
560
+
561
+ /********************************* label *******************************/
562
+ [class*="litespeed-label-"] {
563
+ display: inline;
564
+ padding: .2em .6em .3em;
565
+ font-size: 75%;
566
+ font-weight: bold;
567
+ line-height: 1;
568
+ color: #fff;
569
+ text-align: center;
570
+ white-space: nowrap;
571
+ vertical-align: baseline;
572
+ border-radius: .25em;
573
+ }
574
+ [class*="litespeed-label-"]:hover,
575
+ [class*="litespeed-label-"]:focus {
576
+ color: #fff;
577
+ text-decoration: none;
578
+ cursor: pointer;
579
+ }
580
+ [class*="litespeed-label-"]:empty {
581
+ display: none;
582
+ }
583
+ .litespeed-label-default {
584
+ background-color: #777;
585
+ }
586
+ .litespeed-label-default[href]:hover,
587
+ .litespeed-label-default[href]:focus {
588
+ background-color: #5e5e5e;
589
+ }
590
+ .litespeed-label-primary {
591
+ background-color: #337ab7;
592
+ }
593
+ .litespeed-label-primary[href]:hover,
594
+ .litespeed-label-primary[href]:focus {
595
+ background-color: #286090;
596
+ }
597
+ .litespeed-label-success {
598
+ background-color: #5cb85c;
599
+ }
600
+ .litespeed-label-success[href]:hover,
601
+ .litespeed-label-success[href]:focus {
602
+ background-color: #449d44;
603
+ }
604
+ .litespeed-label-info {
605
+ background-color: #5bc0de;
606
+ }
607
+ .litespeed-label-info[href]:hover,
608
+ .litespeed-label-info[href]:focus {
609
+ background-color: #31b0d5;
610
+ }
611
+ .litespeed-label-warning {
612
+ background-color: #f0ad4e;
613
+ }
614
+ .litespeed-label-warning[href]:hover,
615
+ .litespeed-label-warning[href]:focus {
616
+ background-color: #ec971f;
617
+ }
618
+ .litespeed-label-danger {
619
+ background-color: #d9534f;
620
+ }
621
+ .litespeed-label-danger[href]:hover,
622
+ .litespeed-label-danger[href]:focus {
623
+ background-color: #c9302c;
624
+ }
625
+
626
+ /********************************* shell *******************************/
627
+ .litespeed-shell {
628
+ width: 98%;
629
+ background: #141414;
630
+ margin: 20px auto 0 10px;
631
+ box-shadow: 0 0 5px rgba(0,0,0,0.4);
632
+ -webkit-border-radius: 3px;
633
+ -moz-border-radius: 3px;
634
+ border-radius: 3px;
635
+ position: relative;
636
+ height: 224px;
637
+ }
638
+
639
+ .litespeed-shell-header {
640
+ z-index: 999;
641
+ position: absolute;
642
+ top: 0;
643
+ right: 0;
644
+ width: 50px;
645
+ height: 34px;
646
+ padding: 5px 0;
647
+ }
648
+
649
+ .litespeed-shell-header-bg {
650
+ opacity: 0.4;
651
+ background-color: #CCCCCC;
652
+ position: absolute;
653
+ top: 0;
654
+ bottom: 0;
655
+ right: 0;
656
+ left: 0;
657
+ z-index: 4;
658
+ -webkit-border-radius: 3px;
659
+ -moz-border-radius: 3px;
660
+ border-top-radius: 3px;
661
+ }
662
+
663
+ .litespeed-shell-header-bar {
664
+ position: absolute;
665
+ top: 0;
666
+ left: 0;
667
+ z-index: 10;
668
+ height: 2px;
669
+ background-color: #F48024;
670
+ }
671
+
672
+ /*.litespeed-shell-header-num{
673
+ position: absolute;
674
+ bottom: 2px;
675
+ right: 2px;
676
+ width: 14px;
677
+ height: 14px;
678
+ text-align: left;
679
+ color: #808080;
680
+ font-size: 0.85em;
681
+ z-index: 5;
682
+ display: none;
683
+ }*/
684
+
685
+ .litespeed-shell-header-icon-container{
686
+ position: absolute;
687
+ top: 10px;
688
+ right: 10px;
689
+ width: 29px;
690
+ height: 34px;
691
+ z-index: 6;
692
+ }
693
+
694
+ ul.litespeed-shell-body {
695
+ position: absolute;
696
+ top: 0;
697
+ left: 0;
698
+ right: 0;
699
+ bottom: 0;
700
+ overflow-y: scroll;
701
+ margin: 0;
702
+ padding: 5px;
703
+ list-style: none;
704
+ background: #141414;
705
+ color: #45D40C;
706
+ font: 0.8em 'Andale Mono', Consolas, 'Courier New';
707
+ line-height: 1.6em;
708
+
709
+ -webkit-border-bottom-right-radius: 3px;
710
+ -webkit-border-bottom-left-radius: 3px;
711
+ -moz-border-radius-bottomright: 3px;
712
+ -moz-border-radius-bottomleft: 3px;
713
+ border-bottom-right-radius: 3px;
714
+ border-bottom-left-radius: 3px;
715
+
716
+ }
717
+
718
+ .litespeed-shell-body li:before {
719
+ content: '>';
720
+ position: absolute;
721
+ left: 0;
722
+ top: 0;
723
+ }
724
+
725
+ .litespeed-shell-body li {
726
+ word-wrap: break-word;
727
+ position: relative;
728
+ padding: 0 0 0 15px;
729
+ margin: 0;
730
+ }
731
+
732
+ .litespeed-widget-setting{
733
+ background-color: #ecebdc;
734
+ padding: 5px 14px;
735
+ margin: 5px -15px;
736
+ }
737
+
738
+
739
+ /********************************* callout *******************************/
740
+ [class*="litespeed-callout-"] {
741
+ padding: 15px 25px 20px 20px;
742
+ border: 1px solid #6699cc;
743
+ border-radius: 3px;
744
+ line-height: 18px;
745
+ border-left-color: #6699cc;
746
+ border-left-width: 5px;
747
+ color: #538ac6;
748
+ margin: 13px 0;
749
+ background: #fff;
750
+ }
751
+
752
+ [class*="litespeed-callout-"] h4 {
753
+ margin-top: 0;
754
+ margin-bottom: 8px;
755
+ font-size: 14px;
756
+ font-family: inherit;
757
+ font-weight: 500;
758
+ line-height: 1.1;
759
+ }
760
+
761
+ [class*="litespeed-callout-"] p {
762
+ margin-bottom: 0;
763
+ }
764
+
765
+ [class*="litespeed-callout-"] ol {
766
+ padding-left: 15px;
767
+ margin-left: 10px;
768
+ margin-bottom: 0;
769
+ }
770
+
771
+ .litespeed-callout-warning h4 {
772
+ color: #e59544;
773
+ }
774
+
775
+ .litespeed-callout-warning {
776
+ border-left-color: #e59544 !important;
777
+ border-left-width: 5px;
778
+ }
779
+
780
+ .litespeed-callout-danger h4 {
781
+ color: #cc3d6a;
782
+ }
783
+
784
+ .litespeed-callout-danger {
785
+ border-left-color: #cc3d6a !important;
786
+ border-left-width: 5px;
787
+ }
788
+
789
+ /********************************* inline table *******************************/
790
+ .litespeed-body table {
791
+ background: #fff;
792
+ padding: 10px;
793
+ word-wrap: break-word;
794
+ -webkit-font-smoothing: subpixel-antialiased;
795
+ border-spacing: 0;
796
+ width: 100%;
797
+ clear: both;
798
+ }
799
+
800
+ .litespeed-body table thead tr th{
801
+ color: #264d73;
802
+ padding-left: 10px;
803
+ }
804
+
805
+ .litespeed-table {
806
+ border: 1px solid #538ac6;
807
+ border-radius: 3px;
808
+ }
809
+
810
+ /********************************* small table *******************************/
811
+ .litespeed-body .litespeed-vary-table {
812
+ margin-top: -15px;
813
+ padding-left: 0;
814
+ width: 250px;
815
+ }
816
+
817
+ .litespeed-body .litespeed-vary-table tr {
818
+ width: 200px;
819
+ }
820
+
821
+ .litespeed-body .litespeed-vary-table tr:first-child td {
822
+ /* border-top: 1px solid #cccccc; */
823
+ }
824
+ .litespeed-body .litespeed-vary-table .litespeed-vary-title {
825
+ width: 50%;
826
+ /* border-bottom: 1px solid #cccccc;
827
+ border-right: 1px solid #cccccc;*/
828
+ }
829
+ .litespeed-body .litespeed-vary-table .litespeed-vary-val {
830
+ /* border-bottom: 1px solid #cccccc;*/
831
+ }
832
+
833
+
834
+ /********************************* tick checkbox *******************************/
835
+ .litespeed-tick {
836
+ display: inline-block;
837
+ min-width: 125px;
838
+ background: #f9fafc;
839
+ padding: 5px 0 5px 0px;
840
+ border-radius: 3px;
841
+ cursor: pointer;
842
+ margin: 5px;
843
+ }
844
+
845
+ .litespeed-tick input[type="checkbox"] {
846
+ height: 18px;
847
+ width: 18px;
848
+ vertical-align: middle;
849
+ margin: 0 10px 0 20px;
850
+ border: 1px solid #538ac6;
851
+ -webkit-appearance: none;
852
+ -moz-appearance: none;
853
+ appearance: none;
854
+ -webkit-border-radius: 3px;
855
+ border-radius: 3px;
856
+ -moz-box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25);
857
+ -webkit-box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25);
858
+ box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25);
859
+ cursor: pointer;
860
+ }
861
+
862
+ .litespeed-tick input[type="checkbox"]:not(:disabled):hover {
863
+ border-color: #538ac6;
864
+
865
+ }
866
+
867
+ .litespeed-tick input[type="checkbox"]:active:not(:disabled) {
868
+ border-color: #538ac6;
869
+ }
870
+
871
+ .litespeed-tick input[type="checkbox"]:focus {
872
+ outline:none;
873
+ }
874
+
875
+ .litespeed-tick input[type="checkbox"]:checked {
876
+ border-color: #538ac6;
877
+ background-color: #538ac6;
878
+ -moz-box-shadow: none;
879
+ -webkit-box-shadow: none;
880
+ box-shadow: none;
881
+ }
882
+
883
+ .litespeed-tick input[type="checkbox"]:checked:before {
884
+ content: '';
885
+ display: block;
886
+ width: 5px;
887
+ height: 11px;
888
+ border: solid #fff;
889
+ border-width: 0 2px 2px 0;
890
+ -webkit-transform: rotate(45deg);
891
+ transform: rotate(45deg);
892
+ margin-left: 5px;
893
+ margin-top: -1px;
894
+ cursor: pointer;
895
+ }
896
+
897
+ .litespeed-tick label {
898
+ padding: 2px 5px 10px 15px;
899
+ font-size: 14px;
900
+ color: #264d73;
901
+ }
902
+
903
+ .litespeed-tick label:hover {
904
+ min-width: 115px;
905
+ color: #6699cc;
906
+ }
907
+
908
+
909
+ /********************************* vertical radio *******************************/
910
+
911
+ .litespeed-radio-vertical {
912
+ border-left: 1px solid #538ac6;
913
+ height: 100%;
914
+ margin-left: 8px;
915
+ display: inline-block;
916
+ min-width: 150px;
917
+ background: #f9fafc;
918
+ padding: 5px 0 5px 0px;
919
+ border-radius: 3px;
920
+ cursor: pointer;
921
+ }
922
+
923
+ .litespeed-radio-vertical label {
924
+ min-width: 115px;
925
+ padding: 3px 10px 6px 8px;
926
+ }
927
+
928
+ .litespeed-radio-vertical label:hover {
929
+ min-width: 115px;
930
+ color: #6699cc;
931
+ padding: 3px 10px 6px 8px;
932
+ }
933
+
934
+
935
+ .litespeed-radio-vertical-row {
936
+ margin: 20px 10px 25px 0px;
937
+ width: 100%;
938
+ }
939
+
940
+ .litespeed-radio-vertical-row input {
941
+ height: 15.5px;
942
+ min-width: 15px;
943
+ vertical-align: middle;
944
+ margin: -2px 0 0 -8px;
945
+ border: 1px solid #538ac6;
946
+ -webkit-appearance: none;
947
+ -moz-appearance:none;
948
+ appearance: none;
949
+ background: #fff;
950
+ -moz-box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25);
951
+ -webkit-box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25);
952
+ box-shadow: 0 0 0 1px rgba(83, 138, 198, 0.25);
953
+ -webkit-border-radius: 50% !important;
954
+ border-radius: 50% !important;
955
+ cursor: pointer;
956
+ }
957
+
958
+ .litespeed-radio-vertical-row input:not(:disabled):hover {
959
+ border-color: #538ac6;
960
+ -moz-box-shadow: inset 0 0 1px 3px #36b0b0;
961
+ -webkit-box-shadow: inset 0 1px 3px #36b0b0;
962
+ box-shadow: inset 0 0 1px 3px #36b0b0;
963
+
964
+ }
965
+
966
+ .litespeed-radio-vertical-row input:active:not(:disabled) {
967
+ border-color: #538ac6;
968
+ }
969
+
970
+ .litespeed-radio-vertical-row input:focus {
971
+ outline:none;
972
+ }
973
+
974
+ .litespeed-radio-vertical-row input:checked {
975
+ border-color: #538ac6;
976
+ -moz-box-shadow: inset 0 0 0.5px 3px #fff;
977
+ -webkit-box-shadow: inset 0 0 0.5px 3px #fff;
978
+ box-shadow: inset 0 0 0.5px 3px #fff;
979
+ background: #36b0b0;
980
+ }
981
+
982
+ .litespeed-radio-vertical-row input:checked:before {
983
+ /*content: '\25CF';
984
+ font-size: 16px;*/
985
+ text-indent: -9999px;
986
+ -webkit-border-radius: 50px;
987
+ border-radius: 50px;
988
+ font-size: 24px;
989
+ width: 6px;
990
+ height: 6px;
991
+ margin: 4px;
992
+ line-height: 16px;
993
+ }
994
+
995
+ /********************************* Q&A *******************************/
996
+ .litespeed-question:hover {
997
+ color: #6699cc;
998
+ cursor: pointer;
999
+ background: #fff;
1000
+ border-left: 5px solid #6699cc;
1001
+ }
1002
+
1003
+ .litespeed-question {
1004
+ background-color: #f9fafc;
1005
+ border: 1px solid #f9fafc;
1006
+ border-left: 5px solid #538ac6 !important;
1007
+ border-radius: 3px;
1008
+ padding: 20px;
1009
+ margin: 0 20px 5px 5px;
1010
+ font-family: "Open Sans", Arial, sans-serif;
1011
+ font-weight: 600;
1012
+ font-size: 14px;
1013
+ line-height: 1.1;
1014
+ color: #264d73;
1015
+ }
1016
+
1017
+ .litespeed-answer {
1018
+ margin-left: 20px;
1019
+ padding: 0 20px 20px 10px;
1020
+ }
1021
+
1022
+ .litespeed-up:after {
1023
+ content: ' ';
1024
+ border: solid #36b0b0;
1025
+ border-width: 0 2px 2px 0;
1026
+ display: inline-block;
1027
+ padding: 3px;
1028
+ margin-left: 15px;
1029
+ transform: rotate(-135deg);
1030
+ -webkit-transform: rotate(-135deg);
1031
+ -webkit-transition: all .3s ease;
1032
+ -moz-transition: all .3s ease;
1033
+ -ms-transition: all .3s ease;
1034
+ -o-transition: all .3s ease;
1035
+ }
1036
+
1037
+ .litespeed-down:after {
1038
+ content: ' ';
1039
+ border: solid #36b0b0;
1040
+ border-width: 0 2px 2px 0;
1041
+ display: inline-block;
1042
+ padding: 3px;
1043
+ margin-left: 15px;
1044
+ transform: rotate(45deg);
1045
+ -webkit-transform: rotate(45deg);
1046
+ -webkit-transition: all .3s ease;
1047
+ -moz-transition: all .3s ease;
1048
+ -ms-transition: all .3s ease;
1049
+ -o-transition: all .3s ease;
1050
+ }
1051
+
1052
+
1053
+ /********************************* enterprise notice *******************************/
1054
+ .litespeed-ent-notice {
1055
+ position: absolute ;
1056
+ left: 0 ;
1057
+ top: 0 ;
1058
+ right: 0 ;
1059
+ bottom: 0 ;
1060
+ background-color: #333 ;
1061
+ z-index: 999 ;
1062
+ opacity: 0.8 ;
1063
+ text-align: center ;
1064
+ font-size: 3rem ;
1065
+ color: #1865c5 ;
1066
+ }
1067
+
1068
+ .litespeed-ent-notice-desc {
1069
+ position: relative ;
1070
+ top: 30% ;
1071
+ transform: rotate(-20deg) ;
1072
+ text-shadow: 2px 2px 4px #000000 ;
1073
+ }
1074
+
1075
+ /********************************* todo *******************************/
1076
+ /********************************* todo *******************************/
1077
+ /* input field */
1078
+ .litespeed-textarea {
1079
+ width: 60% ;
1080
+ }
1081
+
1082
+ .litespeed-body tbody > tr > th{
1083
+ padding-left: 10px;
1084
+ }
1085
+
1086
+ .litespeed-body tbody > tr:nth-of-type(odd){
1087
+ background-color: #f9f9f9;
1088
+ background-color: #f9fafc;
1089
+ }
1090
+
1091
+ .litespeed-body input[type=radio] {/* todo: to be deleted */
1092
+ margin-top: 0px;
1093
+ margin-right: 4px;
1094
+ float: none;
1095
+ }
1096
+
1097
+ .litespeed-body th {
1098
+ vertical-align: top;
1099
+ text-align: left;
1100
+ padding: 18px 10px 20px 0;
1101
+ width: 200px;
1102
+ font-family: "Open Sans", Arial, sans-serif;
1103
+ font-weight: 600;
1104
+ font-size: 14px;
1105
+ color: #264d73;
1106
+ border-radius: 3px;
1107
+ }
1108
+
1109
+ .litespeed-body td {
1110
+ margin-bottom: 9px;
1111
+ padding: 15px 10px;
1112
+ line-height: 1.3;
1113
+ vertical-align: middle;
1114
+ font-family: "Open Sans", Arial, sans-serif;
1115
+ font-weight: 400;
1116
+ font-size: 14px;
1117
+ color: #264d73;
1118
+ border-radius: 3px;
1119
+ }
1120
+
1121
+
1122
+ .litespeed-body input,.litespeed-body textarea {
1123
+ border: 1px solid #6699cc;
1124
+ border-radius: 3px;
1125
+ background: #fff;
1126
+ color: #264d73;
1127
+ margin-right: 8px;
1128
+ font-size: 14px;
1129
+ font-family: "Open Sans", Arial, sans-serif;
1130
+ }
1131
+
1132
+ .litespeed-regular-text {
1133
+ padding-left: 5px;
1134
+ width: 25em;
1135
+ font-size: 14px;
1136
+ font-family: "Open Sans", Arial, sans-serif;
1137
+ }
1138
+
1139
+ .litespeed-input-long {
1140
+ width: 99%;
1141
+ }
1142
+
1143
+ .litespeed-input-short {
1144
+ width: 45px;
1145
+ padding: 1px 6px;
1146
+ }
1147
+
1148
+ /*text area */
1149
+
1150
+ .litespeed-body textarea {
1151
+ margin-top: 0px;
1152
+ margin-bottom: 0px;
1153
+ z-index: auto;
1154
+ position: relative;
1155
+ line-height: 19.6px;
1156
+ font-size: 14px;
1157
+ transition: none;
1158
+ background: transparent;
1159
+ padding: 5px 10px;
1160
+ box-sizing: border-box;
1161
+ }
1162
+
1163
+ /*text area read only */
1164
+
1165
+ .litespeed-body input[readonly], .litespeed-body textarea[readonly] {
1166
+ background-color: #eee;
1167
+ background-color: #f2f9ff;
1168
+ }
1169
+
admin/css/snowman.css DELETED
@@ -1,685 +0,0 @@
1
- /*body {
2
- background-color: #31a7c3;
3
- *zoom: 1;
4
- filter: progid:DXImageTransform.Microsoft.gradient(gradientType=1, startColorstr='#FFAEE4FB', endColorstr='#FF2A8DC5');
5
- background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHJhZGlhbEdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY3g9IjUwJSIgY3k9IiIgcj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIxMCUiIHN0b3AtY29sb3I9IiNhZWU0ZmIiLz48c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMyYThkYzUiLz48L3JhZGlhbEdyYWRpZW50PjwvZGVmcz48cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI2dyYWQpIiAvPjwvc3ZnPiA=');
6
- background-size: 100%;
7
- background-image: -moz-radial-gradient(center, ellipse cover, #aee4fb 10%, #2a8dc5 100%);
8
- background-image: -webkit-radial-gradient(center, ellipse cover, #aee4fb 10%, #2a8dc5 100%);
9
- background-image: radial-gradient(ellipse cover at center, #aee4fb 10%, #2a8dc5 100%);
10
- }
11
- body .container {
12
- max-width: 550px;
13
- padding: 0;
14
- margin: 0 auto;
15
- min-height: 450px;
16
- }
17
- body .container :before, body .container :after {
18
- position: absolute;
19
- content: "";
20
- width: 0;
21
- height: 0;
22
- }*/
23
-
24
- .olaf-container {
25
- position: absolute;
26
- height: 400px;
27
- width: 120px;
28
- top: calc(50% - 200px);
29
- left: calc(50% - 60px);
30
- margin-top: -15px;
31
- }
32
-
33
- .olaf {
34
- height: 160px;
35
- width: 120px;
36
- margin: 230px auto 0 auto;
37
- position: relative;
38
- }
39
- .olaf * {
40
- position: absolute;
41
- }
42
- .olaf .head {
43
- top: -152px;
44
- left: calc(50% - (96px / 2));
45
- width: 96px;
46
- height: 116px;
47
- background-color: #FFFFFF;
48
- margin-top: 44px;
49
- -moz-border-radius: 20% 20% 50% 50%/15% 15% 85% 85%;
50
- -webkit-border-radius: 20%;
51
- border-radius: 20% 20% 50% 50%/15% 15% 85% 85%;
52
- -moz-box-shadow: inset 10px -2px 35px -5px rgba(0, 0, 0, 0.3), inset 0 -8px 5px -5px rgba(0, 0, 0, 0.2);
53
- -webkit-box-shadow: inset 10px -2px 35px -5px rgba(0, 0, 0, 0.3), inset 0 -8px 5px -5px rgba(0, 0, 0, 0.2);
54
- box-shadow: inset 10px -2px 35px -5px rgba(0, 0, 0, 0.3), inset 0 -8px 5px -5px rgba(0, 0, 0, 0.2);
55
- z-index: 3;
56
- }
57
- .olaf .head .top {
58
- height: 44px;
59
- width: 53px;
60
- top: -41px;
61
- left: calc(50% - (53px / 2));
62
- background: #FFFFFF;
63
- -moz-border-radius: 45% 45% 1% 1%/40% 40% 1% 1%;
64
- -webkit-border-radius: 45%;
65
- border-radius: 45% 45% 1% 1%/40% 40% 1% 1%;
66
- -moz-box-shadow: inset 15px 0px 10px -5px rgba(0, 0, 0, 0.1);
67
- -webkit-box-shadow: inset 15px 0px 10px -5px rgba(0, 0, 0, 0.1);
68
- box-shadow: inset 15px 0px 10px -5px rgba(0, 0, 0, 0.1);
69
- }
70
- .olaf .head .top:before, .olaf .head .top:after {
71
- top: 16px;
72
- height: 20px;
73
- width: 34px;
74
- border-top: 10px solid #FFFFFF;
75
- z-index: 2;
76
- }
77
- .olaf .head .top:before {
78
- border-top-color: #e0e0e0;
79
- -moz-border-radius: 0 50% 0 0;
80
- -webkit-border-radius: 0;
81
- border-radius: 0 50% 0 0;
82
- left: -28px;
83
- -moz-transform: rotate(110deg);
84
- -ms-transform: rotate(110deg);
85
- -webkit-transform: rotate(110deg);
86
- transform: rotate(110deg);
87
- }
88
- .olaf .head .top:after {
89
- -moz-border-radius: 50% 0 0 0;
90
- -webkit-border-radius: 50%;
91
- border-radius: 50% 0 0 0;
92
- right: -28px;
93
- -moz-transform: rotate(-110deg);
94
- -ms-transform: rotate(-110deg);
95
- -webkit-transform: rotate(-110deg);
96
- transform: rotate(-110deg);
97
- }
98
- .olaf .head .top .shadow {
99
- left: calc(52% - 58%);
100
- top: 38px;
101
- height: 30%;
102
- width: 116%;
103
- -moz-box-shadow: inset 0 -2px 8px -4px rgba(0, 0, 0, 0.2);
104
- -webkit-box-shadow: inset 0 -2px 8px -4px rgba(0, 0, 0, 0.2);
105
- box-shadow: inset 0 -2px 8px -4px rgba(0, 0, 0, 0.2);
106
- -moz-border-radius: 1% 1% 45% 45%/1% 1% 40% 40%;
107
- -webkit-border-radius: 1%;
108
- border-radius: 1% 1% 45% 45%/1% 1% 40% 40%;
109
- z-index: 3;
110
- }
111
- .olaf .head .hair {
112
- top: -35px;
113
- left: 38px;
114
- z-index: -1;
115
- }
116
- .olaf .head .hair span {
117
- bottom: 0;
118
- height: 32px;
119
- width: 10px;
120
- border-right: 2px solid #533F38;
121
- }
122
- .olaf .head .hair > span:nth-of-type(1) {
123
- height: 27px;
124
- left: -5px;
125
- -moz-transform: rotate(-10deg);
126
- -ms-transform: rotate(-10deg);
127
- -webkit-transform: rotate(-10deg);
128
- transform: rotate(-10deg);
129
- -moz-border-radius: 10%;
130
- -webkit-border-radius: 10%;
131
- border-radius: 10%;
132
- }
133
- .olaf .head .hair > span:nth-of-type(1) > span:nth-of-type(1) {
134
- left: 0px;
135
- height: 22px;
136
- bottom: 23px;
137
- -moz-transform: rotate(-5deg);
138
- -ms-transform: rotate(-5deg);
139
- -webkit-transform: rotate(-5deg);
140
- transform: rotate(-5deg);
141
- -moz-border-radius: 30%;
142
- -webkit-border-radius: 30%;
143
- border-radius: 30%;
144
- }
145
- .olaf .head .hair > span:nth-of-type(1) > span:nth-of-type(2) {
146
- left: -4px;
147
- bottom: 18px;
148
- height: 22px;
149
- -moz-transform: rotate(-40deg);
150
- -ms-transform: rotate(-40deg);
151
- -webkit-transform: rotate(-40deg);
152
- transform: rotate(-40deg);
153
- -moz-border-radius: 30%;
154
- -webkit-border-radius: 30%;
155
- border-radius: 30%;
156
- }
157
- .olaf .head .hair > span:nth-of-type(1) > span:nth-of-type(2) span {
158
- left: -3px;
159
- bottom: 17px;
160
- height: 16px;
161
- -moz-transform: rotate(-35deg);
162
- -ms-transform: rotate(-35deg);
163
- -webkit-transform: rotate(-35deg);
164
- transform: rotate(-35deg);
165
- -moz-border-radius: 30%;
166
- -webkit-border-radius: 30%;
167
- border-radius: 30%;
168
- }
169
- .olaf .head .hair > span:nth-of-type(2) {
170
- -moz-transform: rotate(-2deg);
171
- -ms-transform: rotate(-2deg);
172
- -webkit-transform: rotate(-2deg);
173
- transform: rotate(-2deg);
174
- -moz-border-radius: 10%;
175
- -webkit-border-radius: 10%;
176
- border-radius: 10%;
177
- }
178
- .olaf .head .hair > span:nth-of-type(2) span {
179
- left: -2px;
180
- height: 27px;
181
- bottom: 30px;
182
- -moz-transform: rotate(-10deg);
183
- -ms-transform: rotate(-10deg);
184
- -webkit-transform: rotate(-10deg);
185
- transform: rotate(-10deg);
186
- -moz-border-radius: 30%;
187
- -webkit-border-radius: 30%;
188
- border-radius: 30%;
189
- }
190
- .olaf .head .hair > span:nth-of-type(2) span span {
191
- left: -4px;
192
- bottom: 22px;
193
- -moz-transform: rotate(-20deg);
194
- -ms-transform: rotate(-20deg);
195
- -webkit-transform: rotate(-20deg);
196
- transform: rotate(-20deg);
197
- }
198
- .olaf .head .hair > span:nth-of-type(3) {
199
- border-right: none;
200
- border-left: 2px solid #533F38;
201
- height: 30px;
202
- left: 14px;
203
- -moz-transform: rotate(5deg);
204
- -ms-transform: rotate(5deg);
205
- -webkit-transform: rotate(5deg);
206
- transform: rotate(5deg);
207
- -moz-border-radius: 10%;
208
- -webkit-border-radius: 10%;
209
- border-radius: 10%;
210
- }
211
- .olaf .head .hair > span:nth-of-type(3) span {
212
- left: 1px;
213
- height: 24px;
214
- bottom: 25px;
215
- border-right: none;
216
- border-left: 2px solid #533F38;
217
- -moz-transform: rotate(15deg);
218
- -ms-transform: rotate(15deg);
219
- -webkit-transform: rotate(15deg);
220
- transform: rotate(15deg);
221
- -moz-border-radius: 30%;
222
- -webkit-border-radius: 30%;
223
- border-radius: 30%;
224
- }
225
- .olaf .head .hair > span:nth-of-type(3) span span:nth-of-type(1) {
226
- left: -3px;
227
- height: 14px;
228
- bottom: 17px;
229
- -moz-transform: rotate(-10deg);
230
- -ms-transform: rotate(-10deg);
231
- -webkit-transform: rotate(-10deg);
232
- transform: rotate(-10deg);
233
- }
234
- .olaf .head .hair > span:nth-of-type(3) span span:nth-of-type(2) {
235
- left: 3px;
236
- bottom: 17px;
237
- -moz-transform: rotate(25deg);
238
- -ms-transform: rotate(25deg);
239
- -webkit-transform: rotate(25deg);
240
- transform: rotate(25deg);
241
- }
242
- .olaf .head .brow {
243
- top: -36px;
244
- height: 5px;
245
- width: 20px;
246
- background: #413121;
247
- }
248
- .olaf .head .brow.left {
249
- left: 26px;
250
- -moz-transform: rotate(-13deg);
251
- -ms-transform: rotate(-13deg);
252
- -webkit-transform: rotate(-13deg);
253
- transform: rotate(-13deg);
254
- }
255
- .olaf .head .brow.right {
256
- right: 26px;
257
- -moz-transform: rotate(13deg);
258
- -ms-transform: rotate(13deg);
259
- -webkit-transform: rotate(13deg);
260
- transform: rotate(13deg);
261
- }
262
- .olaf .head .brow.left {
263
- left: 27px;
264
- -moz-border-radius: 40% 1% 10% 5%/70% 1% 20% 20%;
265
- -webkit-border-radius: 40%;
266
- border-radius: 40% 1% 10% 5%/70% 1% 20% 20%;
267
- }
268
- .olaf .head .brow.left:before {
269
- left: -5px;
270
- -moz-border-radius: 90% 0 0 0/99% 0 0 0;
271
- -webkit-border-radius: 90%;
272
- border-radius: 90% 0 0 0/99% 0 0 0;
273
- -moz-box-shadow: -1px -4px 0 0 #413121;
274
- -webkit-box-shadow: -1px -4px 0 0 #413121;
275
- box-shadow: -1px -4px 0 0 #413121;
276
- -moz-transform: skewX(-10deg);
277
- -ms-transform: skewX(-10deg);
278
- -webkit-transform: skewX(-10deg);
279
- transform: skewX(-10deg);
280
- }
281
- .olaf .head .brow.right {
282
- right: 25px;
283
- -moz-border-radius: 1% 40% 5% 10%/1% 70% 20% 20%;
284
- -webkit-border-radius: 1%;
285
- border-radius: 1% 40% 5% 10%/1% 70% 20% 20%;
286
- }
287
- .olaf .head .brow.right:before {
288
- right: -5px;
289
- -moz-border-radius: 0 90% 0 0/0 99% 0 0;
290
- -webkit-border-radius: 0;
291
- border-radius: 0 90% 0 0/0 99% 0 0;
292
- -moz-box-shadow: 1px -4px 0 0 #413121;
293
- -webkit-box-shadow: 1px -4px 0 0 #413121;
294
- box-shadow: 1px -4px 0 0 #413121;
295
- -moz-transform: skewX(10deg);
296
- -ms-transform: skewX(10deg);
297
- -webkit-transform: skewX(10deg);
298
- transform: skewX(10deg);
299
- }
300
- .olaf .head .brow:before {
301
- top: 4px;
302
- height: 12px;
303
- width: 15px;
304
- }
305
- .olaf .head .eye {
306
- top: -18px;
307
- height: 24px;
308
- width: 20px;
309
- z-index: 5;
310
- background: #FFFFFF;
311
- -moz-box-shadow: 0 -1px 0px 1px #010100, 0 1px 1px 1px rgba(75, 120, 134, 0.8), 0 -3px 0px 2px rgba(36, 82, 94, 0.8), inset 0 -15px 10px -5px rgba(0, 0, 0, 0.2);
312
- -webkit-box-shadow: 0 -1px 0px 1px #010100, 0 1px 1px 1px rgba(75, 120, 134, 0.8), 0 -3px 0px 2px rgba(36, 82, 94, 0.8), inset 0 -15px 10px -5px rgba(0, 0, 0, 0.2);
313
- box-shadow: 0 -1px 0px 1px #010100, 0 1px 1px 1px rgba(75, 120, 134, 0.8), 0 -3px 0px 2px rgba(36, 82, 94, 0.8), inset 0 -15px 10px -5px rgba(0, 0, 0, 0.2);
314
- -moz-border-radius: 50%;
315
- -webkit-border-radius: 50%;
316
- border-radius: 50%;
317
- }
318
- .olaf .head .eye.left {
319
- left: 28px;
320
- }
321
- .olaf .head .eye.left .pupil {
322
- left: 30%;
323
- }
324
- .olaf .head .eye.right {
325
- right: 24px;
326
- }
327
- .olaf .head .eye.right .pupil {
328
- right: 30%;
329
- }
330
- .olaf .head .eye .pupil {
331
- top: 34%;
332
- height: 44%;
333
- width: 52%;
334
- background: #000000;
335
- -moz-border-radius: 50%;
336
- -webkit-border-radius: 50%;
337
- border-radius: 50%;
338
- }
339
- .olaf .head .nose {
340
- top: 0px;
341
- left: 42px;
342
- height: 23px;
343
- width: 28px;
344
- background: #EC622A;
345
- overflow: hidden;
346
- -moz-border-radius: 40% 60% 40% 30%/70% 60% 40% 30%;
347
- -webkit-border-radius: 40%;
348
- border-radius: 40% 60% 40% 30%/70% 60% 40% 30%;
349
- -moz-box-shadow: inset 8px -5px 5px 0 rgba(0, 0, 0, 0.3);
350
- -webkit-box-shadow: inset 8px -5px 5px 0 rgba(0, 0, 0, 0.3);
351
- box-shadow: inset 8px -5px 5px 0 rgba(0, 0, 0, 0.3);
352
- z-index: 6;
353
- }
354
- .olaf .head .nose:before {
355
- top: -5px;
356
- right: 0px;
357
- height: 110%;
358
- width: 60%;
359
- *zoom: 1;
360
- filter: progid:DXImageTransform.Microsoft.gradient(gradientType=1, startColorstr='#FFFFFFFF', endColorstr='#FFFFFFFF');
361
- background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHJhZGlhbEdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY3g9IjUwJSIgY3k9IjcwJSIgcj0iOTAlIj48c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjAuNSIvPjxzdG9wIG9mZnNldD0iOTAlIiBzdG9wLWNvbG9yPSIjZmZmZmZmIiBzdG9wLW9wYWNpdHk9IjAuMCIvPjwvcmFkaWFsR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');
362
- background-size: 100%;
363
- background-image: -moz-radial-gradient(50% 70%, ellipse cover, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 90%);
364
- background-image: -webkit-radial-gradient(50% 70%, ellipse cover, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 90%);
365
- background-image: radial-gradient(ellipse cover at 50% 70%, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 90%);
366
- -moz-transform: rotate(-30deg);
367
- -ms-transform: rotate(-30deg);
368
- -webkit-transform: rotate(-30deg);
369
- transform: rotate(-30deg);
370
- }
371
- .olaf .head .mouth {
372
- top: 14px;
373
- left: calc(50% - (68px / 2) + 2px);
374
- height: 76px;
375
- width: 68px;
376
- -moz-border-radius: 25% 25% 50% 50%/5% 5% 95% 95%;
377
- -webkit-border-radius: 25%;
378
- border-radius: 25% 25% 50% 50%/5% 5% 95% 95%;
379
- background: #234148;
380
- z-index: 2;
381
- }
382
- .olaf .head .top-lip {
383
- top: 10px;
384
- left: calc(50% - (82px / 2) + 2px);
385
- width: 82px;
386
- height: 35px;
387
- background: #FFFFFF;
388
- -moz-box-shadow: -2px 5px 10px -1px rgba(0, 0, 0, 0.2), inset 10px 0px 15px -5px rgba(0, 0, 0, 0.2);
389
- -webkit-box-shadow: -2px 5px 10px -1px rgba(0, 0, 0, 0.2), inset 10px 0px 15px -5px rgba(0, 0, 0, 0.2);
390
- box-shadow: -2px 5px 10px -1px rgba(0, 0, 0, 0.2), inset 10px 0px 15px -5px rgba(0, 0, 0, 0.2);
391
- -moz-border-radius: 20% 20% 40% 60%/10% 20% 70% 90%;
392
- -webkit-border-radius: 20%;
393
- border-radius: 20% 20% 40% 60%/10% 20% 70% 90%;
394
- z-index: 4;
395
- }
396
- .olaf .head .tooth {
397
- left: 40%;
398
- top: 40px;
399
- width: 35px;
400
- height: 16px;
401
- background: #FFFFFF;
402
- -moz-border-radius: 1% 1% 40% 50%/1% 1% 20% 20%;
403
- -webkit-border-radius: 1%;
404
- border-radius: 1% 1% 40% 50%/1% 1% 20% 20%;
405
- z-index: 3;
406
- }
407
- .olaf .head .bottom-lip {
408
- top: 12px;
409
- left: calc(50% - (82px / 2) + 2px);
410
- height: 84px;
411
- width: 82px;
412
- -moz-border-radius: 25% 25% 50% 50%/5% 5% 95% 95%;
413
- -webkit-border-radius: 25%;
414
- border-radius: 25% 25% 50% 50%/5% 5% 95% 95%;
415
- -moz-box-shadow: 0 5px 10px -4px rgba(0, 0, 0, 0.3), inset 2px 0px 10px -5px rgba(0, 0, 0, 0.2);
416
- -webkit-box-shadow: 0 5px 10px -4px rgba(0, 0, 0, 0.3), inset 2px 0px 10px -5px rgba(0, 0, 0, 0.2);
417
- box-shadow: 0 5px 10px -4px rgba(0, 0, 0, 0.3), inset 2px 0px 10px -5px rgba(0, 0, 0, 0.2);
418
- z-index: 1;
419
- }
420
- .olaf .body {
421
- background: #FFFFFF;
422
- -moz-border-radius: 35% 35% 30% 40%/60% 60% 40% 40%;
423
- -webkit-border-radius: 35%;
424
- border-radius: 35% 35% 30% 40%/60% 60% 40% 40%;
425
- -moz-box-shadow: inset 2px 5px 10px -6px rgba(0, 0, 0, 0.2), inset 20px 5px 30px -6px rgba(0, 0, 0, 0.2), inset 0 -5px 15px -2px rgba(0, 0, 0, 0.2);
426
- -webkit-box-shadow: inset 2px 5px 10px -6px rgba(0, 0, 0, 0.2), inset 20px 5px 30px -6px rgba(0, 0, 0, 0.2), inset 0 -5px 15px -2px rgba(0, 0, 0, 0.2);
427
- box-shadow: inset 2px 5px 10px -6px rgba(0, 0, 0, 0.2), inset 20px 5px 30px -6px rgba(0, 0, 0, 0.2), inset 0 -5px 15px -2px rgba(0, 0, 0, 0.2);
428
- top: 0;
429
- left: calc(50% - (120px / 2));
430
- }
431
- .olaf .body.top {
432
- left: calc(50% - (80px /2));
433
- height: 60px;
434
- width: 80px;
435
- z-index: 2;
436
- overflow: hidden;
437
- }
438
- .olaf .body.top:before {
439
- height: 10px;
440
- width: 50%;
441
- left: 20%;
442
- *zoom: 1;
443
- filter: progid:DXImageTransform.Microsoft.gradient(gradientType=1, startColorstr='#FF000000', endColorstr='#FF000000');
444
- background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHJhZGlhbEdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY3g9IjUwJSIgY3k9IiIgcj0iODAlIj48c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjMDAwMDAwIiBzdG9wLW9wYWNpdHk9IjAuMyIvPjxzdG9wIG9mZnNldD0iODAlIiBzdG9wLWNvbG9yPSIjMDAwMDAwIiBzdG9wLW9wYWNpdHk9IjAuMCIvPjwvcmFkaWFsR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');
445
- background-size: 100%;
446
- background-image: -moz-radial-gradient(center, ellipse cover, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 80%);
447
- background-image: -webkit-radial-gradient(center, ellipse cover, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 80%);
448
- background-image: radial-gradient(ellipse cover at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 80%);
449
- }
450
- .olaf .body.bottom {
451
- top: 50px;
452
- height: 90px;
453
- width: 120px;
454
- z-index: 1;
455
- }
456
- .olaf .body .button {
457
- height: 22px;
458
- width: 26px;
459
- top: 20px;
460
- left: calc(50% - (26px) / 2);
461
- background: #222222;
462
- -moz-border-radius: 45% 55% 40% 50%/60% 55% 45% 40%;
463
- -webkit-border-radius: 45%;
464
- border-radius: 45% 55% 40% 50%/60% 55% 45% 40%;
465
- }
466
- .olaf .body .button ~ .button {
467
- top: 55px;
468
- }
469
- .olaf .body .button:before {
470
- right: 8px;
471
- bottom: 7px;
472
- height: 0;
473
- width: 10%;
474
- -moz-box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.4);
475
- -webkit-box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.4);
476
- box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.4);
477
- }
478
- .olaf .arm {
479
- top: 20px;
480
- width: 40px;
481
- height: 10px;
482
- }
483
- .olaf .arm.left {
484
- left: -17px;
485
- -moz-transform-origin: top right;
486
- -ms-transform-origin: top right;
487
- -webkit-transform-origin: top right;
488
- transform-origin: top right;
489
- -moz-transform: rotate(40deg);
490
- -ms-transform: rotate(40deg);
491
- -webkit-transform: rotate(40deg);
492
- transform: rotate(40deg);
493
- }
494
- .olaf .arm.left .lower-arm {
495
- left: -40px;
496
- }
497
- .olaf .arm.left .upper-arm span, .olaf .arm.left .lower-arm span {
498
- right: -2px;
499
- }
500
- .olaf .arm.left .hand {
501
- left: 0px;
502
- }
503
- .olaf .arm.left .hand .fingers {
504
- left: -4px;
505
- }
506
- .olaf .arm.left .hand .fingers span {
507
- -moz-transform-origin: right top;
508
- -ms-transform-origin: right top;
509
- -webkit-transform-origin: right top;
510
- transform-origin: right top;
511
- }
512
- .olaf .arm.left .hand .fingers span:nth-of-type(1) {
513
- right: -7px;
514
- -moz-transform: rotate(45deg);
515
- -ms-transform: rotate(45deg);
516
- -webkit-transform: rotate(45deg);
517
- transform: rotate(45deg);
518
- }
519
- .olaf .arm.right {
520
- right: -17px;
521
- -moz-transform-origin: top left;
522
- -ms-transform-origin: top left;
523
- -webkit-transform-origin: top left;
524
- transform-origin: top left;
525
- -moz-transform: rotate(-40deg);
526
- -ms-transform: rotate(-40deg);
527
- -webkit-transform: rotate(-40deg);
528
- transform: rotate(-40deg);
529
- }
530
- .olaf .arm.right .lower-arm {
531
- right: -40px;
532
- }
533
- .olaf .arm.right .upper-arm span, .olaf .arm.right .lower-arm span {
534
- left: -2px;
535
- }
536
- .olaf .arm.right .hand {
537
- right: 0px;
538
- }
539
- .olaf .arm.right .hand .fingers {
540
- right: -4px;
541
- }
542
- .olaf .arm.right .hand .fingers span {
543
- -moz-transform-origin: left top;
544
- -ms-transform-origin: left top;
545
- -webkit-transform-origin: left top;
546
- transform-origin: left top;
547
- }
548
- .olaf .arm.right .hand .fingers span:nth-of-type(1) {
549
- left: -7px;
550
- -moz-transform: rotate(-45deg);
551
- -ms-transform: rotate(-45deg);
552
- -webkit-transform: rotate(-45deg);
553
- transform: rotate(-45deg);
554
- }
555
- .olaf .arm .lower-arm {
556
- width: 40px;
557
- height: 3px;
558
- background: #533F38;
559
- top: 0px;
560
- }
561
- .olaf .arm .lower-arm > span {
562
- top: -1px;
563
- height: 5px;
564
- width: 7px;
565
- background: #533F38;
566
- -moz-border-radius: 50%;
567
- -webkit-border-radius: 50%;
568
- border-radius: 50%;
569
- }
570
- .olaf .arm .upper-arm {
571
- width: 40px;
572
- height: 3px;
573
- background: #533F38;
574
- top: -3px;
575
- }
576
- .olaf .arm .upper-arm > span {
577
- top: -2px;
578
- height: 7px;
579
- width: 10px;
580
- background: #533F38;
581
- -moz-border-radius: 50%;
582
- -webkit-border-radius: 50%;
583
- border-radius: 50%;
584
- }
585
- .olaf .arm .hand > span {
586
- top: -2px;
587
- height: 7px;
588
- width: 10px;
589
- background: #533F38;
590
- -moz-border-radius: 50%;
591
- -webkit-border-radius: 50%;
592
- border-radius: 50%;
593
- }
594
- .olaf .arm .hand .fingers span {
595
- width: 40px;
596
- height: 3px;
597
- background: #533F38;
598
- width: 15px;
599
- }
600
- .olaf .arm .hand .fingers span:nth-of-type(1) {
601
- width: 10px;
602
- }
603
- .olaf .arm .hand .fingers span:nth-of-type(2) {
604
- -moz-transform: rotate(-30deg);
605
- -ms-transform: rotate(-30deg);
606
- -webkit-transform: rotate(-30deg);
607
- transform: rotate(-30deg);
608
- }
609
- .olaf .arm .hand .fingers span:nth-of-type(4) {
610
- -moz-transform: rotate(30deg);
611
- -ms-transform: rotate(30deg);
612
- -webkit-transform: rotate(30deg);
613
- transform: rotate(30deg);
614
- }
615
- .olaf .leg.left {
616
- left: 20px;
617
- }
618
- .olaf .leg.right {
619
- right: 20px;
620
- }
621
- .olaf .foot {
622
- background: #FFFFFF;
623
- -moz-border-radius: 35% 35% 30% 40%/60% 60% 40% 40%;
624
- -webkit-border-radius: 35%;
625
- border-radius: 35% 35% 30% 40%/60% 60% 40% 40%;
626
- -moz-box-shadow: inset 2px 5px 10px -6px rgba(0, 0, 0, 0.2), inset 20px 5px 30px -6px rgba(0, 0, 0, 0.2), inset 0 -5px 15px -2px rgba(0, 0, 0, 0.2);
627
- -webkit-box-shadow: inset 2px 5px 10px -6px rgba(0, 0, 0, 0.2), inset 20px 5px 30px -6px rgba(0, 0, 0, 0.2), inset 0 -5px 15px -2px rgba(0, 0, 0, 0.2);
628
- box-shadow: inset 2px 5px 10px -6px rgba(0, 0, 0, 0.2), inset 20px 5px 30px -6px rgba(0, 0, 0, 0.2), inset 0 -5px 15px -2px rgba(0, 0, 0, 0.2);
629
- bottom: 0;
630
- height: 32px;
631
- width: 42.85714px;
632
- overflow: hidden;
633
- }
634
- .olaf .foot.left {
635
- left: 12px;
636
- }
637
- .olaf .foot.right {
638
- right: 12px;
639
- }
640
- .olaf .foot.left:before {
641
- top: -3px;
642
- }
643
- .olaf .foot:before {
644
- height: 15px;
645
- width: 100%;
646
- left: -10%;
647
- *zoom: 1;
648
- filter: progid:DXImageTransform.Microsoft.gradient(gradientType=1, startColorstr='#FF000000', endColorstr='#FF000000');
649
- background-image: url('data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4gPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHJhZGlhbEdyYWRpZW50IGlkPSJncmFkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY3g9IjUwJSIgY3k9IiIgcj0iODAlIj48c3RvcCBvZmZzZXQ9IjAlIiBzdG9wLWNvbG9yPSIjMDAwMDAwIiBzdG9wLW9wYWNpdHk9IjAuMyIvPjxzdG9wIG9mZnNldD0iODAlIiBzdG9wLWNvbG9yPSIjMDAwMDAwIiBzdG9wLW9wYWNpdHk9IjAuMCIvPjwvcmFkaWFsR3JhZGllbnQ+PC9kZWZzPjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JhZCkiIC8+PC9zdmc+IA==');
650
- background-size: 100%;
651
- background-image: -moz-radial-gradient(center, ellipse cover, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 80%);
652
- background-image: -webkit-radial-gradient(center, ellipse cover, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 80%);
653
- background-image: radial-gradient(ellipse cover at center, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0) 80%);
654
- }
655
- .olaf > .shadow {
656
- bottom: 0;
657
- left: 50%;
658
- height: 20px;
659
- z-index: -1;
660
- width: 0;
661
- -moz-box-shadow: 0 -27px 40px 30px rgba(0, 0, 0, 0.4);
662
- -webkit-box-shadow: 0 -27px 40px 30px rgba(0, 0, 0, 0.4);
663
- box-shadow: 0 -27px 40px 30px rgba(0, 0, 0, 0.4);
664
- -moz-transform: skewX(65deg);
665
- -ms-transform: skewX(65deg);
666
- -webkit-transform: skewX(65deg);
667
- transform: skewX(65deg);
668
- }
669
-
670
- .logo {
671
- position: fixed;
672
- bottom: 15px;
673
- left: 15px;
674
- }
675
- .logo img {
676
- margin: -15px -10px;
677
- }
678
- .logo h1, .logo h2 {
679
- font-family: "helvetica neue", helvetica, arial, sans-serif;
680
- margin: 0;
681
- font-size: 26px;
682
- letter-spacing: 1px;
683
- color: #FFFFFF;
684
- font-weight: 100;
685
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/img/icons/all.svg ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve">
6
+ <g>
7
+ <path fill="#6699CC" d="M56.164,37.484c-0.059-0.082-0.122-0.162-0.212-0.215c-0.005-0.002-0.01-0.001-0.015-0.004
8
+ c-0.004-0.002-0.005-0.006-0.009-0.008l-2.159-1.183c-0.606-4.582-3.073-8.809-6.781-11.605c-0.079-0.059-0.167-0.093-0.256-0.123
9
+ v-2.987c0-0.135-0.037-0.264-0.104-0.376c-0.021-0.037-0.061-0.057-0.088-0.09c-0.055-0.064-0.102-0.135-0.177-0.179
10
+ c-0.004-0.002-0.009-0.001-0.013-0.003c-0.004-0.002-0.005-0.007-0.009-0.009l-8.482-4.647c-0.225-0.123-0.496-0.123-0.721,0
11
+ l-8.483,4.647c-0.004,0.002-0.005,0.006-0.009,0.008c-0.004,0.002-0.009,0.001-0.013,0.004c-0.075,0.044-0.124,0.115-0.178,0.181
12
+ c-0.026,0.032-0.066,0.053-0.087,0.088c-0.065,0.113-0.103,0.242-0.103,0.376v3.111c-0.087,0.03-0.174,0.063-0.251,0.121
13
+ c-3.66,2.766-6.112,6.938-6.745,11.458l-2.203,1.207c-0.004,0.002-0.005,0.007-0.009,0.009c-0.004,0.002-0.009,0.001-0.013,0.003
14
+ c-0.075,0.044-0.122,0.114-0.176,0.179c-0.027,0.033-0.067,0.053-0.089,0.09c-0.065,0.113-0.103,0.242-0.103,0.376v10.221
15
+ c0,0.272,0.148,0.524,0.387,0.656l8.483,4.695c0.113,0.063,0.238,0.094,0.363,0.094s0.25-0.031,0.363-0.094l2.121-1.174
16
+ c0.097,0.127,0.215,0.239,0.376,0.3c2.006,0.758,4.12,1.143,6.283,1.143c2.454,0,4.83-0.491,7.061-1.459
17
+ c0.079-0.034,0.14-0.089,0.202-0.142l2.406,1.332c0.113,0.063,0.238,0.094,0.363,0.094s0.25-0.031,0.363-0.094l8.482-4.696
18
+ c0.238-0.132,0.387-0.384,0.387-0.656v-10.22c0-0.136-0.039-0.266-0.105-0.379C56.202,37.515,56.179,37.503,56.164,37.484z
19
+ M39.354,47.691v-8.511l6.984,3.824v8.553L39.354,47.691z M47.775,41.328l-0.688,0.376l-6.923-3.79l6.923-3.792l6.92,3.792
20
+ L47.775,41.328z M29.767,22.625l6.983,3.825v8.554l-6.983-3.867V22.625z M38.251,26.449l6.981-3.825v8.512l-6.981,3.867V26.449z
21
+ M37.5,17.566l6.921,3.792L37.5,25.15l-6.922-3.792L37.5,17.566z M28.927,41.148l-1.015,0.556l-6.922-3.79l6.922-3.792l6.921,3.792
22
+ L28.927,41.148z M20.179,39.181l6.983,3.823v8.554l-6.983-3.865V39.181z M28.662,43.004l6.983-3.824v8.513l-6.983,3.865V43.004z
23
+ M32.29,51.265l4.469-2.474c0.239-0.132,0.387-0.384,0.387-0.656V37.914c0-0.136-0.038-0.265-0.104-0.377
24
+ c-0.017-0.028-0.048-0.043-0.068-0.069c-0.057-0.073-0.113-0.149-0.195-0.198c-0.004-0.002-0.01-0.001-0.014-0.004
25
+ c-0.003-0.002-0.005-0.007-0.009-0.009l-8.482-4.647c-0.225-0.123-0.496-0.123-0.721,0l-4.299,2.355
26
+ c0.743-3.207,2.516-6.133,5.015-8.303v4.917c0,0.273,0.148,0.524,0.387,0.656l8.483,4.697c0.113,0.063,0.238,0.094,0.363,0.094
27
+ s0.25-0.031,0.363-0.094l8.482-4.697c0.238-0.132,0.387-0.383,0.387-0.656v-5.045c2.547,2.205,4.339,5.188,5.065,8.46l-4.35-2.384
28
+ c-0.225-0.123-0.496-0.123-0.721,0l-8.484,4.647c-0.004,0.002-0.006,0.007-0.009,0.009c-0.005,0.002-0.01,0.001-0.014,0.004
29
+ c-0.075,0.044-0.123,0.115-0.177,0.18c-0.027,0.032-0.066,0.053-0.087,0.088c-0.065,0.113-0.103,0.242-0.103,0.376v10.22
30
+ c0,0.272,0.148,0.524,0.387,0.656l4.14,2.291C39.143,52.218,35.566,52.28,32.29,51.265z M54.82,47.691l-6.982,3.866v-8.554
31
+ l4.363-2.39l2.619-1.435V47.691z"/>
32
+ <path fill="#6699CC" d="M66.554,43.38l-4.544-3.116c0.121-1.014,0.178-1.903,0.178-2.765c0-0.859-0.057-1.75-0.178-2.769
33
+ l4.543-3.11c0.297-0.203,0.439-0.567,0.358-0.918c-0.412-1.793-0.948-3.472-1.594-4.992c-0.141-0.331-0.435-0.543-0.83-0.532
34
+ l-5.511,0.151c-0.905-1.59-2.004-3.092-3.274-4.478l1.841-5.181c0.121-0.339,0.021-0.717-0.25-0.953
35
+ c-1.303-1.134-2.73-2.171-4.244-3.083c-0.307-0.186-0.699-0.165-0.984,0.056l-4.357,3.352c-1.702-0.773-3.47-1.349-5.269-1.714
36
+ l-1.552-5.281c-0.103-0.346-0.405-0.594-0.765-0.625c-1.425-0.122-3.825-0.122-5.243,0c-0.359,0.031-0.663,0.279-0.764,0.625
37
+ l-1.555,5.281c-1.798,0.365-3.565,0.94-5.266,1.714l-4.355-3.352c-0.286-0.22-0.676-0.243-0.983-0.057
38
+ c-1.515,0.908-2.946,1.945-4.253,3.084c-0.271,0.236-0.37,0.614-0.25,0.953l1.844,5.18c-1.275,1.391-2.375,2.893-3.277,4.478
39
+ l-5.509-0.151c-0.358-0.016-0.689,0.202-0.829,0.533c-0.652,1.535-1.173,3.167-1.593,4.991c-0.081,0.351,0.061,0.715,0.358,0.918
40
+ l4.543,3.11c-0.119,0.998-0.177,1.909-0.177,2.769c0,0.858,0.058,1.768,0.177,2.767L8.446,43.38
41
+ c-0.296,0.203-0.438,0.566-0.358,0.917c0.41,1.786,0.945,3.464,1.593,4.987c0.14,0.332,0.474,0.531,0.829,0.533l5.51-0.151
42
+ c0.902,1.586,2.001,3.09,3.276,4.481l-1.843,5.181c-0.121,0.339-0.021,0.717,0.25,0.953c1.297,1.129,2.727,2.166,4.251,3.084
43
+ c0.309,0.188,0.7,0.164,0.985-0.056l4.356-3.355c1.701,0.775,3.467,1.351,5.265,1.715l1.553,5.28
44
+ c0.102,0.345,0.403,0.593,0.761,0.624c1.039,0.094,1.849,0.135,2.625,0.135c0.776,0,1.585-0.041,2.625-0.135
45
+ c0.357-0.031,0.66-0.279,0.762-0.624l1.552-5.28c1.8-0.365,3.565-0.94,5.263-1.715l4.363,3.355c0.285,0.22,0.677,0.241,0.985,0.056
46
+ c1.521-0.917,2.949-1.955,4.249-3.085c0.271-0.236,0.371-0.614,0.25-0.954l-1.845-5.18c1.272-1.391,2.372-2.895,3.277-4.48
47
+ l5.506,0.151c0.401-0.007,0.688-0.202,0.829-0.532c0.646-1.516,1.182-3.193,1.595-4.987C66.992,43.947,66.85,43.583,66.554,43.38z
48
+ M63.932,48.051l-5.433-0.149c-0.369-0.005-0.637,0.169-0.794,0.459c-0.961,1.778-2.185,3.451-3.637,4.975
49
+ c-0.229,0.238-0.303,0.586-0.191,0.897l1.82,5.112c-0.951,0.792-1.972,1.532-3.045,2.21l-4.307-3.313
50
+ c-0.261-0.202-0.617-0.238-0.913-0.095c-1.871,0.902-3.835,1.542-5.837,1.901c-0.326,0.059-0.592,0.297-0.686,0.614l-1.533,5.217
51
+ c-1.425,0.108-2.333,0.106-3.754,0l-1.535-5.217c-0.093-0.318-0.359-0.556-0.685-0.614c-2-0.358-3.964-0.998-5.839-1.901
52
+ c-0.298-0.145-0.651-0.107-0.914,0.095l-4.3,3.313c-1.076-0.678-2.096-1.418-3.046-2.209l1.819-5.114
53
+ c0.111-0.312,0.037-0.658-0.191-0.897c-1.456-1.523-2.678-3.196-3.634-4.973c-0.157-0.29-0.467-0.472-0.794-0.46l-5.438,0.149
54
+ c-0.44-1.112-0.821-2.308-1.134-3.567l4.489-3.076c0.273-0.187,0.417-0.512,0.373-0.84c-0.155-1.135-0.23-2.139-0.23-3.068
55
+ c0-0.932,0.075-1.937,0.23-3.07c0.044-0.328-0.1-0.653-0.373-0.84l-4.488-3.072c0.318-1.28,0.692-2.458,1.135-3.573l5.437,0.149
56
+ c0.326,0.02,0.637-0.169,0.794-0.459c0.957-1.774,2.18-3.446,3.635-4.969c0.229-0.239,0.303-0.586,0.192-0.898l-1.82-5.114
57
+ c0.956-0.796,1.976-1.536,3.045-2.207l4.299,3.309c0.262,0.202,0.616,0.239,0.913,0.095c1.875-0.902,3.841-1.542,5.842-1.901
58
+ c0.326-0.059,0.591-0.296,0.685-0.614l1.536-5.216c1.131-0.084,2.618-0.084,3.753,0l1.533,5.215
59
+ c0.094,0.318,0.358,0.556,0.685,0.615c2.002,0.36,3.968,1,5.845,1.901c0.297,0.143,0.651,0.106,0.912-0.095l4.301-3.309
60
+ c1.068,0.673,2.087,1.413,3.04,2.207l-1.817,5.114c-0.111,0.312-0.037,0.659,0.191,0.897c1.449,1.516,2.672,3.188,3.632,4.969
61
+ c0.157,0.291,0.414,0.481,0.795,0.459l5.438-0.149c0.44,1.111,0.82,2.308,1.136,3.573l-4.487,3.072
62
+ c-0.272,0.187-0.417,0.511-0.373,0.839c0.157,1.169,0.23,2.146,0.23,3.072c0,0.929-0.073,1.903-0.23,3.067
63
+ c-0.044,0.327,0.1,0.652,0.372,0.839l4.488,3.077C64.752,45.747,64.371,46.943,63.932,48.051z"/>
64
+ </g>
65
+ </svg>
admin/img/icons/all_transients.svg ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve">
6
+ <g>
7
+ <path fill="#6699CC" d="M65.485,21.85c-0.045-0.113-0.106-0.219-0.2-0.308l-8.679-8.336c-0.027-0.026-0.063-0.038-0.096-0.059
8
+ c-0.057-0.043-0.112-0.088-0.18-0.115c-0.068-0.028-0.138-0.033-0.21-0.042c-0.036-0.005-0.068-0.021-0.106-0.021h-0.017h-0.002
9
+ h-2.861c-0.022-0.031-0.037-0.068-0.066-0.096l-5.014-4.817c-0.03-0.029-0.069-0.041-0.103-0.065
10
+ c-0.056-0.04-0.106-0.082-0.171-0.108c-0.069-0.028-0.142-0.034-0.214-0.043c-0.035-0.004-0.066-0.021-0.104-0.021h-0.017
11
+ c-0.001,0-0.001,0-0.002,0h-2.758c-0.045-0.116-0.107-0.226-0.202-0.317l-5.566-5.346c-0.027-0.028-0.063-0.039-0.095-0.062
12
+ c-0.059-0.042-0.112-0.086-0.178-0.113c-0.071-0.029-0.146-0.036-0.222-0.045c-0.032-0.004-0.063-0.02-0.097-0.02h-0.016
13
+ c0,0-0.002,0-0.004,0H12.87c-1.328,0-2.409,1.081-2.409,2.409v52.485c0,1.327,1.081,2.407,2.409,2.407h3.292
14
+ c0.135,0,0.258-0.037,0.373-0.095v4.823c0,1.349,1.097,2.445,2.444,2.445h3.913v4.391c0,1.374,1.118,2.492,2.493,2.492h37.689
15
+ c1.374,0,2.492-1.117,2.492-2.492V22.204C65.566,22.077,65.532,21.959,65.485,21.85z M56.867,15.82l5.768,5.541l-5.768,0.022V15.82
16
+ z M48.315,10.67l2.393,2.298h-2.393V10.67z M39.182,4.769l3.175,3.049h-3.175V4.769z M16.535,10.262v47.348
17
+ c-0.114-0.058-0.238-0.096-0.373-0.096H12.87c-0.389,0-0.705-0.315-0.705-0.703V4.326c0-0.388,0.316-0.705,0.705-0.705h24.607
18
+ v4.197H18.979C17.631,7.818,16.535,8.914,16.535,10.262z M18.979,64.688c-0.408,0-0.74-0.332-0.74-0.741V10.262
19
+ c0-0.407,0.332-0.739,0.74-0.739h27.632v3.446H25.385c-1.375,0-2.493,1.118-2.493,2.493v49.226L18.979,64.688L18.979,64.688z
20
+ M63.862,70.782c0,0.435-0.354,0.788-0.788,0.788H25.385c-0.435,0-0.789-0.353-0.789-0.788V15.461c0-0.435,0.354-0.789,0.789-0.789
21
+ h29.777v6.71c0,0.922,0.752,1.673,1.673,1.673h7.027V70.782z"/>
22
+ <path fill="#6699CC" d="M44.111,31.051c-5.154,0-9.888,2.696-12.542,7.079l-2.011-0.76l0.963,5.869l4.603-3.769l-1.931-0.729
23
+ c2.222-3.477,5.952-5.688,10.066-5.958v0.826c0,0.47,0.382,0.852,0.852,0.852c0.471,0,0.853-0.382,0.853-0.852v-0.811
24
+ c6.473,0.423,11.653,5.604,12.077,12.078H56.3c-0.47,0-0.852,0.381-0.852,0.852c0,0.47,0.382,0.853,0.852,0.853h0.741
25
+ c-0.422,6.433-5.542,11.593-11.959,12.071v-0.85c0-0.472-0.382-0.852-0.853-0.852c-0.47,0-0.852,0.38-0.852,0.852v0.868
26
+ c-5.945-0.335-10.939-4.687-12.017-10.604c-0.084-0.464-0.529-0.767-0.992-0.687c-0.463,0.084-0.77,0.528-0.686,0.991
27
+ c1.27,6.975,7.338,12.036,14.428,12.036c0.031,0,0.063-0.006,0.095-0.006c0.009,0,0.016,0.006,0.023,0.006
28
+ c0.015,0,0.024-0.009,0.04-0.009c8.019-0.086,14.519-6.631,14.519-14.67C58.788,37.636,52.204,31.051,44.111,31.051z"/>
29
+ <path fill="#6699CC" d="M43.238,53.289c0,0.471,0.383,0.852,0.853,0.852s0.853-0.381,0.853-0.852v-7.206l4.024-4.023
30
+ c0.331-0.333,0.333-0.872,0-1.204c-0.334-0.334-0.875-0.334-1.206-0.002l-4.272,4.273c-0.079,0.079-0.142,0.173-0.184,0.277
31
+ c-0.044,0.104-0.066,0.215-0.066,0.325l0,0L43.238,53.289L43.238,53.289z"/>
32
+ </g>
33
+ </svg>
admin/img/icons/auto_draft.svg ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve">
6
+ <g>
7
+ <path fill="#6699CC" d="M61.821,13.089c-0.041-0.114-0.104-0.222-0.197-0.311L51.641,3.19c-0.032-0.03-0.071-0.042-0.104-0.066
8
+ c-0.054-0.039-0.103-0.08-0.166-0.104c-0.07-0.029-0.145-0.036-0.219-0.044c-0.032-0.004-0.063-0.02-0.097-0.02h-0.015
9
+ c-0.002,0-0.004,0-0.004,0H15.826c-1.506,0-2.731,1.224-2.731,2.729v63.631c0,1.505,1.225,2.729,2.731,2.729h43.351
10
+ c1.506,0,2.729-1.225,2.729-2.729V13.441C61.906,13.314,61.872,13.196,61.821,13.089z M51.899,5.776l7.105,6.823h-7.004
11
+ c-0.058,0-0.102-0.044-0.102-0.101V5.776L51.899,5.776z M60.222,69.315c0,0.576-0.47,1.045-1.045,1.045H15.826
12
+ c-0.578,0-1.046-0.469-1.046-1.045V5.684c0-0.576,0.469-1.043,1.046-1.043h34.388v7.857c0,0.985,0.801,1.786,1.785,1.786h8.221
13
+ v55.031H60.222z"/>
14
+ <path fill="#6699CC" d="M42.681,38.698l-7.151-4.129c-0.261-0.15-0.582-0.15-0.843,0c-0.26,0.15-0.421,0.428-0.421,0.73v8.257
15
+ c0,0.302,0.161,0.579,0.421,0.73c0.13,0.074,0.277,0.112,0.422,0.112c0.146,0,0.291-0.038,0.422-0.112l7.152-4.13
16
+ c0.261-0.149,0.424-0.428,0.424-0.729C43.105,39.126,42.94,38.847,42.681,38.698z M35.951,42.096v-5.338l4.624,2.669L35.951,42.096
17
+ z"/>
18
+ <path fill="#6699CC" d="M48.729,29.417l1.035-2.911c0.116-0.326,0.021-0.691-0.239-0.918c-0.797-0.69-1.664-1.32-2.581-1.872
19
+ c-0.297-0.179-0.672-0.157-0.947,0.054l-2.448,1.885c-0.924-0.406-1.877-0.717-2.846-0.928l-0.873-2.968
20
+ c-0.099-0.333-0.39-0.572-0.736-0.601c-0.861-0.074-2.321-0.074-3.185,0c-0.346,0.029-0.637,0.269-0.736,0.601l-0.874,2.968
21
+ c-0.969,0.21-1.923,0.521-2.846,0.928l-2.447-1.885c-0.276-0.212-0.651-0.234-0.948-0.055c-0.92,0.552-1.789,1.183-2.582,1.873
22
+ c-0.261,0.228-0.358,0.592-0.241,0.918l1.036,2.911c-0.678,0.757-1.271,1.568-1.771,2.421l-3.096-0.084
23
+ c-0.34-0.009-0.663,0.193-0.799,0.512c-0.39,0.918-0.716,1.937-0.969,3.03c-0.078,0.338,0.059,0.688,0.345,0.885l2.552,1.747
24
+ c-0.058,0.539-0.085,1.024-0.085,1.499c0,0.474,0.028,0.958,0.085,1.497l-2.552,1.748c-0.287,0.196-0.423,0.546-0.345,0.884
25
+ c0.25,1.089,0.577,2.106,0.968,3.03c0.136,0.32,0.436,0.505,0.8,0.513l3.096-0.085c0.5,0.853,1.093,1.664,1.771,2.422l-1.035,2.912
26
+ c-0.117,0.326-0.02,0.689,0.241,0.918c0.785,0.683,1.653,1.313,2.58,1.872c0.297,0.18,0.675,0.157,0.95-0.055l2.448-1.886
27
+ c0.922,0.405,1.874,0.716,2.844,0.929l0.875,2.968c0.098,0.332,0.39,0.571,0.735,0.602c0.428,0.037,0.996,0.078,1.592,0.078
28
+ c0.596,0,1.163-0.041,1.592-0.078c0.347-0.03,0.638-0.27,0.737-0.602l0.873-2.968c0.969-0.213,1.921-0.521,2.843-0.929l2.45,1.885
29
+ c0.275,0.213,0.653,0.233,0.949,0.056c0.928-0.561,1.798-1.191,2.583-1.876c0.261-0.227,0.356-0.592,0.239-0.916l-1.035-2.91
30
+ c0.677-0.758,1.271-1.569,1.771-2.422l3.098,0.085c0.394-0.011,0.663-0.192,0.798-0.513c0.393-0.926,0.719-1.945,0.969-3.03
31
+ c0.078-0.338-0.06-0.688-0.345-0.884l-2.553-1.749c0.06-0.536,0.087-1.028,0.087-1.496c0-0.476-0.027-0.962-0.086-1.499
32
+ l2.552-1.747c0.286-0.197,0.423-0.547,0.345-0.884c-0.251-1.09-0.577-2.11-0.971-3.031c-0.132-0.311-0.437-0.512-0.775-0.512
33
+ c-0.008,0-0.015,0-0.022,0l-3.098,0.084C49.998,30.983,49.404,30.172,48.729,29.417z M53.587,35.12l-2.494,1.708
34
+ c-0.263,0.18-0.4,0.493-0.358,0.809c0.092,0.676,0.135,1.243,0.135,1.791c0,0.545-0.043,1.114-0.135,1.787
35
+ c-0.042,0.316,0.096,0.629,0.358,0.81l2.494,1.708c-0.152,0.583-0.33,1.141-0.528,1.667l-3.019-0.084
36
+ c-0.352-0.007-0.612,0.163-0.765,0.443c-0.559,1.035-1.271,2.011-2.118,2.896c-0.221,0.229-0.292,0.564-0.184,0.864l1.01,2.841
37
+ c-0.448,0.361-0.926,0.708-1.425,1.03l-2.39-1.839c-0.25-0.193-0.591-0.229-0.878-0.091c-1.092,0.525-2.236,0.899-3.402,1.106
38
+ c-0.314,0.059-0.57,0.287-0.66,0.593l-0.852,2.899c-0.55,0.034-1.203,0.034-1.752,0l-0.854-2.899
39
+ c-0.091-0.306-0.345-0.535-0.66-0.593c-1.167-0.207-2.312-0.581-3.403-1.106c-0.287-0.14-0.626-0.103-0.879,0.091l-2.388,1.84
40
+ c-0.497-0.322-0.974-0.668-1.424-1.03l1.01-2.842c0.107-0.301,0.036-0.635-0.185-0.864c-0.849-0.887-1.562-1.862-2.119-2.896
41
+ c-0.152-0.281-0.438-0.45-0.766-0.444l-3.018,0.084c-0.199-0.526-0.375-1.083-0.528-1.667l2.493-1.706
42
+ c0.263-0.18,0.402-0.492,0.359-0.809c-0.092-0.68-0.135-1.25-0.135-1.79c0-0.544,0.042-1.111,0.135-1.791
43
+ c0.042-0.316-0.097-0.628-0.359-0.808l-2.493-1.707c0.154-0.586,0.33-1.145,0.528-1.667l3.019,0.083
44
+ c0.316,0.025,0.613-0.161,0.765-0.442c0.558-1.035,1.271-2.009,2.12-2.896c0.22-0.229,0.292-0.564,0.185-0.865l-1.011-2.84
45
+ c0.452-0.364,0.928-0.709,1.423-1.03l2.388,1.838c0.253,0.194,0.593,0.229,0.879,0.091c1.093-0.526,2.239-0.9,3.404-1.108
46
+ c0.314-0.057,0.569-0.285,0.66-0.591l0.854-2.898c0.551-0.035,1.199-0.035,1.752,0l0.852,2.898c0.092,0.306,0.345,0.535,0.66,0.591
47
+ c1.165,0.208,2.311,0.582,3.405,1.108c0.285,0.138,0.625,0.102,0.879-0.091l2.387-1.838c0.494,0.321,0.971,0.666,1.423,1.031
48
+ l-1.01,2.84c-0.108,0.301-0.036,0.636,0.184,0.864c0.845,0.882,1.558,1.857,2.12,2.896c0.146,0.274,0.43,0.442,0.741,0.442
49
+ c0.007,0,0.014,0,0.021,0l3.02-0.083C53.257,33.978,53.435,34.536,53.587,35.12z"/>
50
+ <path fill="#6699CC" d="M37.5,29.626c-5.404,0-9.801,4.396-9.801,9.799c0,5.402,4.397,9.803,9.801,9.803s9.8-4.398,9.8-9.803
51
+ C47.3,34.022,42.904,29.626,37.5,29.626z M37.5,47.543c-4.475,0-8.116-3.641-8.116-8.117c0-4.475,3.642-8.114,8.116-8.114
52
+ c4.474,0,8.114,3.639,8.114,8.114S41.974,47.543,37.5,47.543z"/>
53
+ </g>
54
+ </svg>
admin/img/icons/cross_icon.svg ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="20px" height="20px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">
6
+ <g id="Layer_1_1_" display="none">
7
+ <path display="inline" fill="#E8AE4A" d="M10,0C4.477,0,0,4.478,0,10c0,5.521,4.477,10,10,10c5.521,0,10-4.479,10-10
8
+ C20,4.478,15.521,0,10,0z M11.329,16.83c-0.362,0.361-0.804,0.545-1.313,0.545s-0.949-0.184-1.312-0.545
9
+ c-0.361-0.362-0.544-0.805-0.544-1.313c0-0.51,0.18-0.951,0.537-1.316c0.357-0.363,0.802-0.551,1.318-0.551
10
+ c0.512,0,0.953,0.184,1.313,0.543c0.359,0.361,0.542,0.808,0.542,1.324C11.871,16.027,11.688,16.468,11.329,16.83z M11.389,7.468
11
+ l-0.535,2.207c-0.185,0.771-0.321,1.7-0.409,2.763c-0.01,0.111-0.104,0.198-0.216,0.198H9.783c-0.114,0-0.209-0.089-0.216-0.202
12
+ c-0.046-0.754-0.201-1.683-0.46-2.759L8.58,7.467C8.257,6.115,8.099,5.169,8.099,4.572c0-0.576,0.177-1.049,0.527-1.406
13
+ c0.351-0.358,0.813-0.541,1.37-0.541c0.543,0,1.004,0.183,1.363,0.544c0.357,0.36,0.541,0.822,0.541,1.373
14
+ C11.9,5.077,11.734,6.033,11.389,7.468z"/>
15
+ </g>
16
+ <g id="Layer_1_copy_3" display="none">
17
+ <path display="inline" fill="#4675B8" d="M10,0C4.477,0,0,4.478,0,10c0,5.521,4.477,10,10,10c5.521,0,10-4.479,10-10
18
+ C20,4.478,15.521,0,10,0z M11.329,16.83c-0.362,0.361-0.804,0.545-1.313,0.545s-0.949-0.184-1.312-0.545
19
+ c-0.361-0.362-0.544-0.805-0.544-1.313c0-0.51,0.18-0.951,0.537-1.316c0.357-0.363,0.802-0.551,1.318-0.551
20
+ c0.512,0,0.953,0.184,1.313,0.543c0.359,0.361,0.542,0.808,0.542,1.324C11.871,16.027,11.688,16.468,11.329,16.83z M11.389,7.468
21
+ l-0.535,2.207c-0.185,0.771-0.321,1.7-0.409,2.763c-0.01,0.111-0.104,0.198-0.216,0.198H9.783c-0.114,0-0.209-0.089-0.216-0.202
22
+ c-0.046-0.754-0.201-1.683-0.46-2.759L8.58,7.467C8.257,6.115,8.099,5.169,8.099,4.572c0-0.576,0.177-1.049,0.527-1.406
23
+ c0.351-0.358,0.813-0.541,1.37-0.541c0.543,0,1.004,0.183,1.363,0.544c0.357,0.36,0.541,0.822,0.541,1.373
24
+ C11.9,5.077,11.734,6.033,11.389,7.468z"/>
25
+ </g>
26
+ <g id="Layer_1_copy" display="none">
27
+ <path display="inline" fill="#A32430" d="M10,0C4.477,0,0,4.478,0,10c0,5.521,4.477,10,10,10c5.521,0,10-4.479,10-10
28
+ C20,4.478,15.521,0,10,0z M15.159,13.764c0.187,0.188,0.288,0.438,0.288,0.697c0,0.262-0.102,0.51-0.288,0.695
29
+ c-0.185,0.184-0.438,0.289-0.698,0.289c-0.262,0-0.518-0.105-0.697-0.291L10,11.393l-3.764,3.766c-0.361,0.359-1.033,0.359-1.393,0
30
+ c-0.187-0.186-0.29-0.434-0.29-0.695s0.103-0.512,0.289-0.695L8.606,10L4.842,6.234c-0.385-0.384-0.385-1.01,0-1.394
31
+ c0.359-0.361,1.032-0.361,1.394,0L10,8.604l3.766-3.765c0.356-0.359,1.033-0.361,1.396,0c0.188,0.185,0.288,0.433,0.288,0.697
32
+ c0.001,0.264-0.104,0.511-0.288,0.697l-3.767,3.764L15.159,13.764z"/>
33
+ </g>
34
+ <g>
35
+ <circle fill="#CC3D6A" cx="10" cy="10" r="9.967"/>
36
+ </g>
37
+ <path fill="#FFFFFF" d="M11.414,10l3.503-3.503c0.392-0.391,0.392-1.024,0-1.414c-0.392-0.391-1.022-0.391-1.414,0L10,8.586
38
+ L6.497,5.082c-0.391-0.391-1.023-0.391-1.414,0c-0.391,0.39-0.391,1.023,0,1.414L8.586,10l-3.503,3.504
39
+ c-0.391,0.391-0.391,1.023,0,1.414c0.195,0.195,0.451,0.293,0.707,0.293s0.512-0.098,0.707-0.293L10,11.414l3.502,3.503
40
+ c0.195,0.194,0.451,0.293,0.707,0.293s0.512-0.099,0.707-0.293c0.391-0.392,0.391-1.022,0-1.414L11.414,10z"/>
41
+ </svg>
admin/img/icons/db.svg ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve">
6
+ <path fill="#21A0DF" d="M66.478,27.294c0,0,0-0.001,0-0.001V11.727c0-0.054-0.006-0.107-0.017-0.159
7
+ c0-0.001-0.001-0.002-0.001-0.004c0.006-0.089,0.018-0.178,0.018-0.268c0-0.163-0.049-0.313-0.132-0.439
8
+ c-0.628-2.732-3.608-5.213-8.528-7.054c-5.19-1.943-12.039-3.013-19.281-3.013c-7.244,0-14.091,1.07-19.283,3.013
9
+ c-4.92,1.841-7.9,4.322-8.527,7.055c-0.083,0.126-0.132,0.276-0.132,0.438c0,0.089,0.012,0.178,0.017,0.267c0,0.001,0,0.003,0,0.004
10
+ c-0.011,0.052-0.017,0.105-0.017,0.161v50.829c0,0.057,0.006,0.111,0.017,0.164c0.505,6.453,12.718,11.491,27.925,11.491
11
+ c15.204,0,27.415-5.037,27.923-11.489c0.013-0.053,0.019-0.109,0.019-0.166v-17.66c0-0.002,0-0.002,0-0.003v-0.001V27.296
12
+ C66.478,27.296,66.478,27.295,66.478,27.294z M19.813,5.299c5.017-1.878,11.665-2.911,18.723-2.911
13
+ c7.057,0,13.706,1.033,18.722,2.911c4.615,1.727,7.365,4.025,7.598,6.326c-0.5,4.419-10.945,9.024-26.319,9.024
14
+ c-15.375,0-25.821-4.604-26.319-9.024C12.449,9.324,15.199,7.026,19.813,5.299z M38.536,22.248c12.32,0,22.537-2.975,26.343-7.232
15
+ v12.281c-0.004,5.589-12.066,10.311-26.343,10.311c-14.279,0-26.343-4.723-26.343-10.313V15.015
16
+ C15.999,19.272,26.216,22.248,38.536,22.248z M64.879,62.442c-0.004,0.023-0.006,0.047-0.008,0.068
17
+ c-0.142,2.551-2.929,5.097-7.648,6.987c-5.01,2.008-11.646,3.114-18.687,3.114c-7.041,0-13.678-1.106-18.687-3.114
18
+ c-4.72-1.891-7.507-4.437-7.65-6.987c-0.001-0.021-0.003-0.045-0.006-0.067V48.938c3.806,4.631,14.023,7.867,26.343,7.867
19
+ c12.32,0,22.537-3.236,26.343-7.866V62.442z M64.879,44.895c-0.004,5.59-12.066,10.313-26.343,10.313
20
+ c-14.279,0-26.343-4.724-26.343-10.314V31.34c3.806,4.63,14.023,7.865,26.343,7.865c12.32,0,22.537-3.235,26.343-7.865V44.895z"/>
21
+ </svg>
admin/img/icons/empty-cache.svg ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve">
6
+ <g>
7
+ <path fill="#6699CC" d="M61.125,33.733h-1.583V11.637c0-0.003-0.002-0.007-0.002-0.01c-0.001-0.077-0.024-0.151-0.046-0.227
8
+ c-0.01-0.035-0.01-0.074-0.023-0.107c-0.01-0.023-0.029-0.04-0.041-0.062c-0.043-0.079-0.089-0.156-0.152-0.219
9
+ c-0.002-0.002-0.004-0.005-0.006-0.007L50.12,2.247h-0.001l-0.014-0.013c-0.028-0.027-0.065-0.039-0.098-0.061
10
+ c-0.059-0.043-0.113-0.089-0.183-0.116s-0.14-0.033-0.212-0.042C49.575,2.008,49.541,1.99,49.5,1.99H18.478
11
+ c-1.585,0-2.875,1.29-2.875,2.875v28.868h-1.478c-1.585,0-2.875,1.29-2.875,2.875v6.028c0,1.585,1.29,2.875,2.875,2.875h1.876
12
+ c0.037,0,0.067-0.017,0.103-0.021c0.081,3.687-0.345,7.248-0.771,10.725c-0.626,5.098-1.273,10.367-0.339,16.061
13
+ c0.07,0.43,0.441,0.733,0.862,0.733c0.047,0,0.095-0.004,0.143-0.012c0.477-0.078,0.8-0.528,0.722-1.005
14
+ c-0.894-5.446-0.262-10.59,0.349-15.563c0.621-5.06,1.259-10.289,0.356-15.933h1.765c-0.001,0.053-0.014,0.103-0.005,0.155
15
+ c0.893,5.445,0.261,10.588-0.35,15.562c-0.626,5.097-1.274,10.367-0.338,16.062c0.07,0.43,0.441,0.733,0.862,0.733
16
+ c0.047,0,0.095-0.004,0.143-0.012c0.477-0.078,0.8-0.528,0.722-1.005c-0.895-5.446-0.262-10.592,0.349-15.565
17
+ c0.621-5.058,1.26-10.286,0.356-15.93h1.767c-0.001,0.053-0.015,0.103-0.006,0.155c0.893,5.447,0.261,10.591-0.35,15.563
18
+ c-0.626,5.097-1.273,10.366-0.34,16.06c0.07,0.429,0.441,0.732,0.862,0.732c0.047,0,0.095-0.004,0.143-0.012
19
+ c0.477-0.078,0.8-0.528,0.722-1.005c-0.893-5.445-0.261-10.589,0.351-15.562c0.621-5.06,1.26-10.289,0.356-15.935h1.764
20
+ c-0.001,0.053-0.015,0.103-0.006,0.155c0.893,5.445,0.261,10.589-0.35,15.563c-0.626,5.098-1.273,10.367-0.339,16.061
21
+ c0.07,0.43,0.441,0.733,0.862,0.733c0.047,0,0.095-0.004,0.143-0.012c0.477-0.078,0.8-0.528,0.722-1.005
22
+ c-0.894-5.446-0.262-10.59,0.349-15.563c0.621-5.059,1.259-10.288,0.356-15.932H29.7c-0.001,0.053-0.015,0.103-0.006,0.155
23
+ c0.891,5.443,0.259,10.586-0.351,15.559c-0.626,5.1-1.274,10.37-0.339,16.064c0.07,0.429,0.441,0.732,0.862,0.732
24
+ c0.047,0,0.095-0.004,0.143-0.012c0.477-0.078,0.8-0.528,0.722-1.005c-0.894-5.447-0.262-10.593,0.35-15.567
25
+ c0.621-5.057,1.259-10.285,0.357-15.928h1.764c-0.001,0.053-0.015,0.104-0.006,0.156c0.894,5.445,0.262,10.59-0.349,15.563
26
+ c-0.626,5.098-1.274,10.366-0.339,16.059c0.07,0.43,0.441,0.733,0.862,0.733c0.047,0,0.095-0.004,0.143-0.012
27
+ c0.477-0.078,0.8-0.528,0.722-1.005c-0.894-5.445-0.262-10.588,0.35-15.563c0.622-5.059,1.26-10.289,0.355-15.934h1.766
28
+ c-0.001,0.053-0.015,0.104-0.006,0.156c0.893,5.444,0.261,10.59-0.35,15.563c-0.626,5.097-1.273,10.365-0.34,16.058
29
+ c0.07,0.43,0.441,0.733,0.862,0.733c0.047,0,0.095-0.004,0.143-0.012c0.477-0.078,0.8-0.528,0.722-1.005
30
+ c-0.892-5.444-0.261-10.588,0.35-15.563c0.621-5.059,1.259-10.289,0.356-15.934h1.767c-0.001,0.053-0.015,0.103-0.006,0.156
31
+ c0.892,5.443,0.26,10.588-0.351,15.562c-0.625,5.099-1.271,10.368-0.34,16.062c0.07,0.429,0.441,0.732,0.862,0.732
32
+ c0.047,0,0.095-0.004,0.144-0.012c0.477-0.078,0.799-0.527,0.722-1.006c-0.892-5.444-0.261-10.588,0.35-15.563
33
+ c0.62-5.058,1.259-10.288,0.356-15.931h1.765c-0.001,0.053-0.015,0.103-0.006,0.156c0.894,5.444,0.262,10.59-0.349,15.564
34
+ c-0.625,5.096-1.271,10.365-0.34,16.057c0.07,0.43,0.441,0.733,0.862,0.733c0.047,0,0.095-0.004,0.144-0.012
35
+ c0.477-0.078,0.799-0.527,0.722-1.005c-0.892-5.443-0.261-10.588,0.351-15.562c0.619-5.06,1.258-10.29,0.354-15.935h1.765
36
+ c-0.001,0.053-0.015,0.103-0.006,0.156c0.894,5.445,0.263,10.592-0.349,15.567c-0.625,5.097-1.271,10.363-0.342,16.054
37
+ c0.07,0.43,0.441,0.733,0.862,0.733c0.047,0,0.095-0.004,0.144-0.013c0.477-0.077,0.799-0.526,0.722-1.004
38
+ c-0.89-5.442-0.259-10.584,0.351-15.558c0.621-5.061,1.26-10.293,0.355-15.938h1.768c-0.001,0.054-0.015,0.104-0.006,0.156
39
+ c0.891,5.445,0.26,10.59-0.352,15.565c-0.625,5.097-1.271,10.365-0.34,16.058c0.069,0.428,0.44,0.732,0.861,0.732
40
+ c0.047,0,0.096-0.004,0.143-0.012c0.478-0.078,0.801-0.527,0.723-1.006c-0.891-5.442-0.26-10.586,0.352-15.561
41
+ c0.621-5.061,1.258-10.29,0.356-15.936h1.769c-0.002,0.053-0.016,0.103-0.007,0.156c0.89,5.442,0.259,10.586-0.352,15.56
42
+ c-0.626,5.099-1.272,10.37-0.341,16.063c0.07,0.428,0.441,0.732,0.863,0.732c0.047,0,0.094-0.004,0.143-0.012
43
+ c0.477-0.078,0.8-0.527,0.722-1.006c-0.892-5.444-0.261-10.59,0.351-15.566c0.619-5.057,1.258-10.287,0.357-15.928h1.764
44
+ c0,0.052-0.015,0.102-0.006,0.154c0.889,5.443,0.258,10.586-0.352,15.561c-0.626,5.099-1.271,10.369-0.34,16.063
45
+ c0.07,0.43,0.44,0.733,0.861,0.733c0.047,0,0.096-0.004,0.144-0.013c0.477-0.078,0.8-0.526,0.722-1.004
46
+ c-0.893-5.445-0.261-10.592,0.35-15.567c0.434-3.524,0.863-7.14,0.787-10.914h1.236c1.585,0,2.875-1.29,2.875-2.875v-6.028
47
+ C64,35.023,62.71,33.733,61.125,33.733z M50.375,4.913l6.111,5.849H51.5c-0.62,0-1.125-0.505-1.125-1.125V4.913z M17.353,4.865
48
+ c0-0.62,0.505-1.125,1.125-1.125h30.147v5.896c0,1.585,1.29,2.875,2.875,2.875h6.292v21.222H17.353V4.865z M62.25,42.637
49
+ c0,0.62-0.505,1.125-1.125,1.125h-1.313c-0.07-1.085-0.179-2.181-0.356-3.296c0.403-0.077,0.715-0.416,0.715-0.843
50
+ c0-0.482-0.392-0.875-0.875-0.875H15.139c-0.483,0-0.875,0.393-0.875,0.875s0.392,0.875,0.875,0.875h0.548
51
+ c-0.001,0.053-0.015,0.104-0.006,0.156c0.172,1.05,0.273,2.084,0.343,3.111c-0.008,0-0.015-0.005-0.023-0.005h-1.876
52
+ c-0.62,0-1.125-0.505-1.125-1.125v-6.028c0-0.62,0.505-1.125,1.125-1.125h47c0.62,0,1.125,0.505,1.125,1.125V42.637z"/>
53
+ <path fill="#6699CC" d="M21.625,17.888H52.25c0.482,0,0.875-0.392,0.875-0.875s-0.393-0.875-0.875-0.875H21.625
54
+ c-0.483,0-0.875,0.392-0.875,0.875S21.142,17.888,21.625,17.888z"/>
55
+ <path fill="#6699CC" d="M52.25,29.148H21.625c-0.483,0-0.875,0.392-0.875,0.875s0.392,0.875,0.875,0.875H52.25
56
+ c0.482,0,0.875-0.392,0.875-0.875S52.732,29.148,52.25,29.148z"/>
57
+ <path fill="#6699CC" d="M52.25,22.644H21.625c-0.483,0-0.875,0.392-0.875,0.875s0.392,0.875,0.875,0.875H52.25
58
+ c0.482,0,0.875-0.392,0.875-0.875S52.732,22.644,52.25,22.644z"/>
59
+ </g>
60
+ </svg>
admin/img/icons/expired_transient.svg ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve">
6
+ <g>
7
+ <path fill="#6699CC" d="M62.406,13.464c-0.043-0.11-0.104-0.216-0.195-0.303L52.215,3.56c-0.026-0.026-0.062-0.038-0.092-0.059
8
+ c-0.057-0.041-0.109-0.085-0.177-0.111c-0.064-0.026-0.136-0.032-0.204-0.042c-0.035-0.004-0.067-0.021-0.104-0.021h-0.017H51.62
9
+ H15.233c-1.502,0-2.724,1.222-2.724,2.723v63.723c0,1.501,1.222,2.723,2.724,2.723h44.535c1.501,0,2.723-1.222,2.723-2.723V13.818
10
+ C62.491,13.69,62.458,13.573,62.406,13.464z M52.471,6.117l7.151,6.868h-7.041c-0.062,0-0.11-0.049-0.11-0.112V6.117z
11
+ M60.825,69.773c0,0.582-0.475,1.056-1.057,1.056H15.233c-0.583,0-1.057-0.474-1.057-1.056V6.05c0-0.583,0.474-1.057,1.057-1.057
12
+ h35.571v7.879c0,0.98,0.798,1.778,1.776,1.778h8.244V69.773z"/>
13
+ <path fill="#6699CC" d="M48.729,51.256c0-0.625-0.237-1.467-1.205-2.305c-1.33-2.633-2.331-4.074-4.078-6.423
14
+ c-0.821-1.105-1.484-1.938-2.035-2.611c0.551-0.672,1.21-1.505,2.035-2.613c2.146-2.881,3.215-4.476,5.181-8.708
15
+ c0.103-0.222,0.098-0.472,0.002-0.686c0-0.006,0.002-0.012,0.002-0.018c0-3.198-9.991-3.292-11.13-3.292
16
+ s-11.129,0.092-11.129,3.292c0,0.004,0.001,0.008,0.001,0.011c-0.097,0.217-0.103,0.468,0,0.691
17
+ c1.964,4.232,3.034,5.828,5.178,8.709c0.819,1.102,1.481,1.935,2.037,2.611c-0.553,0.675-1.215,1.51-2.037,2.612
18
+ c-1.747,2.35-2.747,3.791-4.079,6.427c-0.961,0.834-1.202,1.675-1.202,2.301c0,0.1,0.022,0.193,0.034,0.291
19
+ c-0.004,0.089,0.006,0.177,0.03,0.261c0.628,2.83,6.047,4.35,11.167,4.35c5.116,0,10.532-1.518,11.165-4.345
20
+ c0.026-0.091,0.039-0.184,0.033-0.279C48.709,51.44,48.729,51.351,48.729,51.256z M41.804,49.128
21
+ c-1.129,1.13-2.541,1.291-4.304,1.291s-3.12-0.108-4.303-1.291c0.818-1.763,1.247-2.388,2.112-3.55
22
+ c0.865-1.164,1.309-1.616,2.19-2.693c0.88,1.077,1.325,1.529,2.189,2.693C40.555,46.742,40.983,47.366,41.804,49.128z
23
+ M32.099,50.228c1.612,1.611,3.474,1.746,5.401,1.746c1.769,0,3.79-0.135,5.4-1.746c0.395-0.395,0.524-0.96,0.387-1.486
24
+ c0.854,0.238,1.614,0.524,2.225,0.852c0.263,0.142,0.489,0.289,0.69,0.438c0.21,0.421,0.428,0.87,0.66,1.365
25
+ c-2.329,2.055-5.235,2.472-9.362,2.472c-3.839,0-6.8-0.185-9.363-2.47c0.233-0.497,0.452-0.946,0.663-1.37
26
+ c0.21-0.155,0.453-0.31,0.732-0.456c0,0,0-0.001,0.001-0.001s0,0,0,0c0.6-0.316,1.345-0.594,2.18-0.827
27
+ C31.576,49.268,31.706,49.833,32.099,50.228z M46.795,27.78c-3.325,1.332-5.402,1.703-9.295,1.703c-3.892,0-5.968-0.37-9.293-1.702
28
+ c0.833-0.623,4.14-1.513,9.294-1.513C42.653,26.267,45.96,27.156,46.795,27.78z M32.887,43.522c1.029-1.38,1.801-2.328,2.421-3.073
29
+ c0.257-0.31,0.257-0.758,0-1.066c-0.622-0.747-1.396-1.698-2.421-3.074c-1.672-2.246-2.638-3.645-3.91-6.153
30
+ c3.044,0.983,7.762,1.026,8.523,1.026s5.476-0.043,8.52-1.025c-1.271,2.509-2.238,3.907-3.911,6.153
31
+ c-1.033,1.388-1.803,2.333-2.42,3.073c-0.257,0.309-0.257,0.757,0,1.066c0.619,0.741,1.391,1.688,2.42,3.073
32
+ c1.122,1.507,1.924,2.636,2.714,3.963c-0.712-0.258-1.497-0.481-2.347-0.656l0,0h-0.004c-0.002,0-0.002-0.001-0.004-0.001
33
+ c0,0,0,0-0.001,0l-0.093-0.02c-0.437-0.782-0.845-1.358-1.438-2.157c-0.606-0.814-1.013-1.292-1.482-1.849
34
+ c-0.225-0.266-0.465-0.548-0.753-0.901c-0.589-0.72-1.814-0.72-2.405,0c-0.289,0.354-0.53,0.64-0.754,0.903
35
+ c-0.469,0.557-0.874,1.034-1.479,1.847c-0.595,0.801-1.002,1.375-1.438,2.157c-0.89,0.179-1.711,0.409-2.452,0.679
36
+ C30.963,46.158,31.766,45.031,32.887,43.522z"/>
37
+ </g>
38
+ </svg>
admin/img/icons/optimize_tables.svg ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve">
6
+ <g>
7
+ <polygon fill="#6699CC" points="33.496,19.622 41.335,23.493 48.044,17.635 49.146,18.897 50.775,14.133 45.835,15.104
8
+ 46.937,16.367 41.075,21.487 33.354,17.676 22.786,24.961 23.741,26.347 "/>
9
+ <path fill="#6699CC" d="M64.08,13.12c-0.041-0.11-0.104-0.216-0.195-0.303L53.709,3.043c-0.027-0.027-0.063-0.039-0.095-0.061
10
+ c-0.057-0.042-0.11-0.084-0.175-0.112c-0.067-0.027-0.138-0.033-0.209-0.042c-0.036-0.004-0.068-0.021-0.104-0.021h-0.017
11
+ c-0.002,0-0.002,0-0.002,0h-39.51c-1.524,0-2.765,1.241-2.765,2.765v64.853c0,1.525,1.24,2.765,2.765,2.765h47.807
12
+ c1.522,0,2.765-1.239,2.765-2.765V13.478C64.167,13.349,64.133,13.229,64.08,13.12z M53.968,5.625l7.3,7.011h-7.18
13
+ c-0.065,0-0.12-0.054-0.12-0.12V5.625z M62.483,70.427c0,0.597-0.484,1.082-1.081,1.082H13.598c-0.597,0-1.082-0.485-1.082-1.082
14
+ V5.574c0-0.596,0.485-1.082,1.082-1.082h38.688v8.025c0,0.995,0.809,1.803,1.803,1.803h8.396V70.427z"/>
15
+ <path fill="#6699CC" d="M17.724,28.494c-0.464,0-0.842,0.377-0.842,0.842v28.058c0,0.465,0.377,0.841,0.842,0.841h39.185
16
+ c0.065,0,0.122-0.023,0.184-0.036c0.061,0.013,0.118,0.036,0.183,0.036c0.464,0,0.842-0.376,0.842-0.841V29.336
17
+ c0-0.465-0.378-0.842-0.842-0.842c-0.064,0-0.122,0.023-0.183,0.037c-0.062-0.014-0.118-0.037-0.184-0.037H17.724z M56.435,37.847
18
+ H41.649v-2.992h14.785V37.847z M18.565,34.854h4.931v2.992h-4.931V34.854z M18.565,39.529h4.931v2.993h-4.931V39.529z
19
+ M39.966,47.199H25.18v-2.994h14.786V47.199z M41.649,44.205h14.785v2.994H41.649V44.205z M25.18,42.522v-2.993h14.786v2.993H25.18
20
+ z M23.497,44.205v2.994h-4.931v-2.994H23.497z M23.497,48.882v2.992h-4.931v-2.992H23.497z M25.18,48.882h14.786v2.992H25.18
21
+ V48.882z M41.649,48.882h14.785v2.992H41.649V48.882z M56.435,42.522H41.649v-2.993h14.785V42.522z M39.966,37.847H25.18v-2.992
22
+ h14.786V37.847z M25.18,33.171v-2.994h14.786v2.994H25.18z M23.497,33.171h-4.931v-2.994h4.931V33.171z M18.565,53.559h4.931v2.993
23
+ h-4.931V53.559z M25.18,53.559h14.786v2.993H25.18V53.559z M41.649,53.559h14.785v2.993H41.649V53.559z M56.435,33.171H41.649
24
+ v-2.994h14.785V33.171z"/>
25
+ <path fill="#6699CC" d="M28.019,37.043h9.289c0.398,0,0.721-0.323,0.721-0.721s-0.323-0.721-0.721-0.721h-9.289
26
+ c-0.398,0-0.721,0.323-0.721,0.721S27.62,37.043,28.019,37.043z"/>
27
+ <path fill="#6699CC" d="M44.5,37.043h9.29c0.397,0,0.721-0.323,0.721-0.721s-0.323-0.721-0.721-0.721H44.5
28
+ c-0.398,0-0.721,0.323-0.721,0.721S44.102,37.043,44.5,37.043z"/>
29
+ </g>
30
+ </svg>
admin/img/icons/purge-403.svg ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve">
6
+ <g>
7
+ <path fill="#6699CC" d="M30.075,34.094H28.1v-9.829c0-0.138-0.112-0.25-0.25-0.25h-1.805c-0.082,0-0.158,0.04-0.205,0.106
8
+ l-7.116,10.142c-0.03,0.042-0.045,0.092-0.045,0.144v1.486c0,0.138,0.112,0.25,0.25,0.25h7.041v3.195c0,0.138,0.112,0.25,0.25,0.25
9
+ h1.63c0.138,0,0.25-0.112,0.25-0.25v-3.195h1.975c0.138,0,0.25-0.112,0.25-0.25v-1.549C30.325,34.206,30.213,34.094,30.075,34.094z
10
+ M25.97,29.361v4.732h-4.857l4.413-6.275c0.16-0.241,0.328-0.517,0.5-0.826C25.988,27.85,25.97,28.644,25.97,29.361z"/>
11
+ <path fill="#6699CC" d="M40.443,37.76c0.839-1.313,1.264-3.31,1.264-5.938c0-2.539-0.439-4.513-1.305-5.867
12
+ c-0.891-1.389-2.209-2.094-3.918-2.094c-1.751,0-3.074,0.677-3.933,2.011c-0.836,1.3-1.26,3.301-1.26,5.95
13
+ c0,2.566,0.438,4.548,1.301,5.892c0.886,1.379,2.195,2.079,3.892,2.079C38.248,39.793,39.58,39.109,40.443,37.76z M38.726,36.452
14
+ c-0.467,0.925-1.2,1.375-2.242,1.375c-1.029,0-1.758-0.443-2.229-1.356c-0.492-0.955-0.741-2.519-0.741-4.648
15
+ c0-2.131,0.25-3.691,0.741-4.638c0.47-0.906,1.199-1.347,2.229-1.347c1.042,0,1.776,0.447,2.243,1.365
16
+ c0.489,0.961,0.737,2.515,0.737,4.619C39.464,33.925,39.216,35.483,38.726,36.452z"/>
17
+ <path fill="#6699CC" d="M53.068,27.874c0-1.234-0.438-2.222-1.301-2.936c-0.85-0.702-2.045-1.057-3.553-1.057
18
+ c-0.913,0-1.794,0.145-2.619,0.43c-0.824,0.283-1.564,0.681-2.201,1.183c-0.107,0.084-0.127,0.238-0.046,0.346l0.861,1.148
19
+ c0.078,0.105,0.224,0.131,0.335,0.061c0.723-0.463,1.371-0.785,1.928-0.956c0.556-0.169,1.155-0.255,1.783-0.255
20
+ c0.798,0,1.432,0.191,1.886,0.567c0.446,0.37,0.663,0.871,0.663,1.53c0,0.84-0.303,1.478-0.926,1.949
21
+ c-0.636,0.48-1.521,0.723-2.629,0.723h-1.496c-0.138,0-0.25,0.112-0.25,0.25v1.467c0,0.138,0.112,0.25,0.25,0.25h1.477
22
+ c2.715,0,4.035,0.811,4.035,2.478c0,1.881-1.189,2.796-3.636,2.796c-0.635,0-1.318-0.083-2.031-0.246
23
+ c-0.713-0.162-1.393-0.402-2.021-0.713c-0.077-0.038-0.17-0.034-0.243,0.012s-0.118,0.126-0.118,0.212v1.619
24
+ c0,0.096,0.055,0.184,0.141,0.225c0.639,0.311,1.308,0.529,1.987,0.652c0.669,0.122,1.417,0.184,2.224,0.184
25
+ c1.873,0,3.346-0.405,4.378-1.206c1.051-0.815,1.583-1.991,1.583-3.494c0-1.06-0.316-1.932-0.939-2.592
26
+ c-0.466-0.493-1.12-0.849-1.951-1.062c0.637-0.243,1.16-0.595,1.563-1.051C52.776,29.735,53.068,28.889,53.068,27.874z"/>
27
+ <path fill="#6699CC" d="M17.361,5h-0.05c-0.483,0-0.85,0.392-0.85,0.875s0.417,0.875,0.9,0.875c0.483,0,0.875-0.392,0.875-0.875
28
+ S17.845,5,17.361,5z"/>
29
+ <path fill="#6699CC" d="M20.898,5h-0.086c-0.483,0-0.832,0.392-0.832,0.875s0.435,0.875,0.918,0.875s0.875-0.392,0.875-0.875
30
+ S21.382,5,20.898,5z"/>
31
+ <path fill="#6699CC" d="M24.398,5h-0.05c-0.483,0-0.85,0.392-0.85,0.875s0.417,0.875,0.9,0.875s0.875-0.392,0.875-0.875
32
+ S24.882,5,24.398,5z"/>
33
+ <path fill="#6699CC" d="M37.626,59.27c0,5.621,4.574,10.195,10.196,10.195c5.623,0,10.197-4.574,10.197-10.195
34
+ c0-5.623-4.574-10.197-10.197-10.197C42.2,49.07,37.626,53.646,37.626,59.27z M56.27,59.27c0,4.656-3.789,8.445-8.446,8.445
35
+ s-8.446-3.789-8.446-8.445c0-4.658,3.789-8.447,8.446-8.447C52.48,50.82,56.27,54.609,56.27,59.27z"/>
36
+ <path fill="#6699CC" d="M42.833,64.257c0.171,0.171,0.396,0.257,0.619,0.257c0.223,0,0.448-0.086,0.618-0.257l3.753-3.752
37
+ l3.752,3.752c0.171,0.171,0.396,0.257,0.618,0.257c0.224,0,0.449-0.086,0.619-0.257c0.342-0.342,0.342-0.896,0-1.237l-3.752-3.752
38
+ l3.752-3.752c0.342-0.343,0.342-0.896,0-1.238s-0.896-0.342-1.237,0l-3.752,3.752l-3.753-3.752c-0.342-0.342-0.896-0.342-1.237,0
39
+ c-0.341,0.342-0.341,0.896,0,1.238l3.752,3.752l-3.752,3.752C42.492,63.361,42.492,63.915,42.833,64.257z"/>
40
+ <path fill="#6699CC" d="M62.77,13.878c-0.041-0.079-0.082-0.158-0.148-0.225L50.535,1.569c-0.004-0.003-0.01-0.004-0.012-0.008
41
+ c-0.08-0.076-0.17-0.138-0.272-0.181c-0.106-0.044-0.222-0.067-0.335-0.067H14.812c-1.585,0-2.875,1.29-2.875,2.875v66.625
42
+ c0,1.586,1.29,2.875,2.875,2.875h45.377c1.584,0,2.875-1.289,2.875-2.875v-56.29C63.063,14.265,62.947,14.039,62.77,13.878z
43
+ M50.791,4.3l9.348,9.348h-8.223c-0.62,0-1.125-0.505-1.125-1.125V4.3z M13.687,4.188c0-0.621,0.504-1.125,1.125-1.125h34.229
44
+ v6.126H13.687V4.188z M61.313,70.813c0,0.621-0.504,1.125-1.125,1.125H14.812c-0.62,0-1.125-0.504-1.125-1.125V10.938h35.354v1.584
45
+ c0,1.585,1.29,2.875,2.875,2.875h9.396V70.813z"/>
46
+ </g>
47
+ </svg>
admin/img/icons/purge-404.svg ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve">
6
+ <g>
7
+ <path fill="#6699CC" d="M30.075,34.093H28.1v-9.829c0-0.138-0.112-0.25-0.25-0.25h-1.805c-0.082,0-0.158,0.04-0.205,0.106
8
+ l-7.116,10.142c-0.03,0.042-0.045,0.092-0.045,0.144v1.486c0,0.138,0.112,0.25,0.25,0.25h7.041v3.195c0,0.138,0.112,0.25,0.25,0.25
9
+ h1.63c0.138,0,0.25-0.112,0.25-0.25v-3.195h1.975c0.138,0,0.25-0.112,0.25-0.25v-1.549C30.325,34.205,30.213,34.093,30.075,34.093z
10
+ M21.113,34.093l4.413-6.275c0.16-0.241,0.328-0.517,0.5-0.826c-0.037,0.857-0.056,1.651-0.056,2.369v4.732H21.113z"/>
11
+ <path fill="#6699CC" d="M40.443,37.759c0.839-1.313,1.264-3.31,1.264-5.938c0-2.539-0.439-4.513-1.305-5.867
12
+ c-0.891-1.389-2.209-2.094-3.918-2.094c-1.751,0-3.074,0.677-3.933,2.011c-0.836,1.3-1.26,3.301-1.26,5.95
13
+ c0,2.566,0.438,4.548,1.301,5.892c0.886,1.379,2.195,2.079,3.892,2.079C38.248,39.792,39.58,39.108,40.443,37.759z M36.484,37.825
14
+ c-1.029,0-1.758-0.443-2.229-1.356c-0.492-0.955-0.741-2.519-0.741-4.648c0-2.131,0.25-3.691,0.741-4.638
15
+ c0.47-0.906,1.199-1.347,2.229-1.347c1.042,0,1.776,0.447,2.243,1.365c0.489,0.961,0.737,2.515,0.737,4.619
16
+ c0,2.103-0.248,3.661-0.738,4.629C38.259,37.375,37.526,37.825,36.484,37.825z"/>
17
+ <path fill="#6699CC" d="M50.061,24.014c-0.081,0-0.158,0.04-0.205,0.106l-7.117,10.142c-0.029,0.042-0.045,0.092-0.045,0.144v1.486
18
+ c0,0.138,0.112,0.25,0.25,0.25h7.041v3.195c0,0.138,0.112,0.25,0.25,0.25h1.631c0.138,0,0.25-0.112,0.25-0.25v-3.195h1.975
19
+ c0.138,0,0.25-0.112,0.25-0.25v-1.549c0-0.138-0.112-0.25-0.25-0.25h-1.975v-9.829c0-0.138-0.112-0.25-0.25-0.25H50.061z
20
+ M45.128,34.093l4.412-6.275c0.16-0.241,0.327-0.517,0.5-0.826c-0.037,0.857-0.056,1.651-0.056,2.369v4.732H45.128z"/>
21
+ <path fill="#6699CC" d="M17.361,5h-0.05c-0.483,0-0.85,0.392-0.85,0.875s0.417,0.875,0.9,0.875c0.483,0,0.875-0.392,0.875-0.875
22
+ S17.845,5,17.361,5z"/>
23
+ <path fill="#6699CC" d="M20.898,5h-0.086c-0.483,0-0.832,0.392-0.832,0.875s0.435,0.875,0.918,0.875s0.875-0.392,0.875-0.875
24
+ S21.382,5,20.898,5z"/>
25
+ <path fill="#6699CC" d="M24.398,5h-0.05c-0.483,0-0.85,0.392-0.85,0.875s0.417,0.875,0.9,0.875s0.875-0.392,0.875-0.875
26
+ S24.882,5,24.398,5z"/>
27
+ <path fill="#6699CC" d="M37.626,59.27c0,5.621,4.574,10.195,10.196,10.195c5.623,0,10.197-4.574,10.197-10.195
28
+ c0-5.623-4.574-10.197-10.197-10.197C42.2,49.07,37.626,53.646,37.626,59.27z M56.27,59.27c0,4.656-3.789,8.445-8.446,8.445
29
+ s-8.446-3.789-8.446-8.445c0-4.658,3.789-8.447,8.446-8.447C52.48,50.82,56.27,54.609,56.27,59.27z"/>
30
+ <path fill="#6699CC" d="M42.833,64.257c0.171,0.171,0.396,0.257,0.619,0.257c0.223,0,0.448-0.086,0.618-0.257l3.753-3.752
31
+ l3.752,3.752c0.171,0.171,0.396,0.257,0.618,0.257c0.224,0,0.449-0.086,0.619-0.257c0.342-0.342,0.342-0.896,0-1.237l-3.752-3.752
32
+ l3.752-3.752c0.342-0.343,0.342-0.896,0-1.238s-0.896-0.342-1.237,0l-3.752,3.752l-3.753-3.752c-0.342-0.342-0.896-0.342-1.237,0
33
+ c-0.341,0.342-0.341,0.896,0,1.238l3.752,3.752l-3.752,3.752C42.492,63.361,42.492,63.915,42.833,64.257z"/>
34
+ <path fill="#6699CC" d="M62.77,13.878c-0.041-0.079-0.082-0.158-0.148-0.225L50.535,1.569c-0.004-0.003-0.01-0.004-0.012-0.008
35
+ c-0.08-0.076-0.17-0.138-0.272-0.181c-0.106-0.044-0.222-0.067-0.335-0.067H14.812c-1.585,0-2.875,1.29-2.875,2.875v66.625
36
+ c0,1.586,1.29,2.875,2.875,2.875h45.377c1.584,0,2.875-1.289,2.875-2.875v-56.29C63.063,14.265,62.947,14.039,62.77,13.878z
37
+ M50.791,4.3l9.348,9.348h-8.223c-0.62,0-1.125-0.505-1.125-1.125V4.3z M13.687,4.188c0-0.621,0.504-1.125,1.125-1.125h34.229
38
+ v6.126H13.687V4.188z M61.313,70.813c0,0.621-0.504,1.125-1.125,1.125H14.812c-0.62,0-1.125-0.504-1.125-1.125V10.938h35.354v1.584
39
+ c0,1.585,1.29,2.875,2.875,2.875h9.396V70.813z"/>
40
+ </g>
41
+ </svg>
admin/img/icons/purge-500.svg ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve">
6
+ <g>
7
+ <path fill="#6699CC" d="M24.2,29.932c-0.686,0-1.381,0.061-2.071,0.18l0.333-3.945h5.769c0.138,0,0.25-0.112,0.25-0.25v-1.569
8
+ c0-0.138-0.112-0.25-0.25-0.25h-7.455c-0.13,0-0.239,0.1-0.249,0.23l-0.564,7.014c-0.008,0.092,0.037,0.181,0.114,0.23l0.882,0.563
9
+ c0.053,0.034,0.118,0.047,0.179,0.036c1.071-0.194,1.932-0.293,2.56-0.293c2.419,0,3.595,0.944,3.595,2.888
10
+ c0,1.005-0.298,1.748-0.912,2.271c-0.617,0.525-1.506,0.791-2.643,0.791c-0.667,0-1.354-0.085-2.042-0.253
11
+ c-0.683-0.168-1.258-0.4-1.708-0.691c-0.078-0.051-0.174-0.053-0.255-0.01c-0.081,0.044-0.13,0.128-0.13,0.22v1.641
12
+ c0,0.087,0.045,0.168,0.12,0.214c0.923,0.562,2.268,0.847,3.996,0.847c1.791,0,3.221-0.466,4.252-1.386
13
+ c1.039-0.928,1.565-2.219,1.565-3.837c0-1.43-0.486-2.576-1.445-3.404C27.143,30.347,25.834,29.932,24.2,29.932z"/>
14
+ <path fill="#6699CC" d="M40.443,37.76c0.839-1.313,1.264-3.31,1.264-5.938c0-2.539-0.439-4.513-1.305-5.867
15
+ c-0.891-1.389-2.209-2.094-3.918-2.094c-1.751,0-3.074,0.677-3.933,2.011c-0.836,1.3-1.26,3.301-1.26,5.95
16
+ c0,2.566,0.438,4.548,1.301,5.892c0.886,1.379,2.195,2.079,3.892,2.079C38.248,39.793,39.58,39.109,40.443,37.76z M36.484,37.826
17
+ c-1.029,0-1.758-0.443-2.229-1.356c-0.492-0.955-0.741-2.519-0.741-4.648c0-2.131,0.25-3.691,0.741-4.638
18
+ c0.47-0.906,1.199-1.347,2.229-1.347c1.042,0,1.776,0.447,2.243,1.365c0.489,0.961,0.737,2.515,0.737,4.619
19
+ c0,2.103-0.248,3.661-0.738,4.629C38.259,37.376,37.526,37.826,36.484,37.826z"/>
20
+ <path fill="#6699CC" d="M48.491,23.861c-1.752,0-3.074,0.677-3.932,2.011c-0.837,1.299-1.261,3.3-1.261,5.95
21
+ c0,2.567,0.438,4.55,1.302,5.892c0.884,1.38,2.193,2.079,3.891,2.079c1.765,0,3.097-0.685,3.959-2.033
22
+ c0.839-1.313,1.265-3.311,1.265-5.938c0-2.538-0.439-4.512-1.306-5.867C51.52,24.566,50.201,23.861,48.491,23.861z M48.491,37.826
23
+ c-1.029,0-1.759-0.443-2.229-1.356c-0.491-0.953-0.741-2.517-0.741-4.648c0-2.132,0.249-3.692,0.741-4.638
24
+ c0.47-0.906,1.198-1.346,2.229-1.346c1.042,0,1.775,0.447,2.243,1.365c0.488,0.96,0.736,2.514,0.736,4.619
25
+ c0,2.104-0.248,3.662-0.736,4.629C50.266,37.376,49.532,37.826,48.491,37.826z"/>
26
+ <path fill="#6699CC" d="M17.361,5h-0.05c-0.483,0-0.85,0.392-0.85,0.875s0.417,0.875,0.9,0.875c0.483,0,0.875-0.392,0.875-0.875
27
+ S17.845,5,17.361,5z"/>
28
+ <path fill="#6699CC" d="M20.898,5h-0.086c-0.483,0-0.832,0.392-0.832,0.875s0.435,0.875,0.918,0.875s0.875-0.392,0.875-0.875
29
+ S21.382,5,20.898,5z"/>
30
+ <path fill="#6699CC" d="M24.398,5h-0.05c-0.483,0-0.85,0.392-0.85,0.875s0.417,0.875,0.9,0.875s0.875-0.392,0.875-0.875
31
+ S24.882,5,24.398,5z"/>
32
+ <path fill="#6699CC" d="M37.626,59.27c0,5.621,4.574,10.195,10.196,10.195c5.623,0,10.197-4.574,10.197-10.195
33
+ c0-5.623-4.574-10.197-10.197-10.197C42.2,49.07,37.626,53.646,37.626,59.27z M56.27,59.27c0,4.656-3.789,8.445-8.446,8.445
34
+ s-8.446-3.789-8.446-8.445c0-4.658,3.789-8.447,8.446-8.447C52.48,50.82,56.27,54.609,56.27,59.27z"/>
35
+ <path fill="#6699CC" d="M42.833,64.257c0.171,0.171,0.396,0.257,0.619,0.257c0.223,0,0.448-0.086,0.618-0.257l3.753-3.752
36
+ l3.752,3.752c0.171,0.171,0.396,0.257,0.618,0.257c0.224,0,0.449-0.086,0.619-0.257c0.342-0.342,0.342-0.896,0-1.237l-3.752-3.752
37
+ l3.752-3.752c0.342-0.343,0.342-0.896,0-1.238s-0.896-0.342-1.237,0l-3.752,3.752l-3.753-3.752c-0.342-0.342-0.896-0.342-1.237,0
38
+ c-0.341,0.342-0.341,0.896,0,1.238l3.752,3.752l-3.752,3.752C42.492,63.361,42.492,63.915,42.833,64.257z"/>
39
+ <path fill="#6699CC" d="M62.77,13.878c-0.041-0.079-0.082-0.158-0.148-0.225L50.535,1.569c-0.004-0.003-0.01-0.004-0.012-0.008
40
+ c-0.08-0.076-0.17-0.138-0.272-0.181c-0.106-0.044-0.222-0.067-0.335-0.067H14.812c-1.585,0-2.875,1.29-2.875,2.875v66.625
41
+ c0,1.586,1.29,2.875,2.875,2.875h45.377c1.584,0,2.875-1.289,2.875-2.875v-56.29C63.063,14.265,62.947,14.039,62.77,13.878z
42
+ M50.791,4.3l9.348,9.348h-8.223c-0.62,0-1.125-0.505-1.125-1.125V4.3z M13.687,4.188c0-0.621,0.504-1.125,1.125-1.125h34.229
43
+ v6.126H13.687V4.188z M61.313,70.813c0,0.621-0.504,1.125-1.125,1.125H14.812c-0.62,0-1.125-0.504-1.125-1.125V10.938h35.354v1.584
44
+ c0,1.585,1.29,2.875,2.875,2.875h9.396V70.813z"/>
45
+ </g>
46
+ </svg>
admin/img/icons/purge-all.svg ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve">
6
+ <g>
7
+ <path fill="#6699CC" d="M50.955,23.981l-17.298-7.355c-0.446-0.19-0.959,0.018-1.147,0.463c-0.189,0.445,0.018,0.958,0.463,1.147
8
+ l17.296,7.355c0.112,0.047,0.229,0.07,0.344,0.07c0.34,0,0.664-0.2,0.806-0.533C51.605,24.684,51.398,24.17,50.955,23.981z"/>
9
+ <path fill="#6699CC" d="M37.581,23.984l-5.931-2.612c-0.443-0.195-0.959,0.006-1.153,0.448c-0.195,0.442,0.006,0.958,0.448,1.153
10
+ l5.931,2.612c0.115,0.05,0.234,0.074,0.352,0.074c0.336,0,0.657-0.195,0.801-0.522C38.225,24.695,38.023,24.179,37.581,23.984z"/>
11
+ <path fill="#6699CC" d="M56.841,27.021h-0.973l2.483-5.843c0.545-1.285-0.057-2.775-1.34-3.322l-2.213-0.94l1.564-5.533
12
+ c0.379-1.344-0.406-2.746-1.75-3.125l-24.202-6.84c-1.341-0.379-2.748,0.405-3.127,1.75l-3.206,11.346
13
+ c-0.021,0.075-0.016,0.149-0.017,0.224l-0.817-0.103c-0.67-0.085-1.336,0.098-1.87,0.513c-0.535,0.416-0.875,1.014-0.958,1.685
14
+ l-1.28,10.189H18.16c-1.549,0-2.809,1.26-2.809,2.809c0,0.034,0.002,0.068,0.006,0.103l4.831,40.993
15
+ c0.03,1.523,1.278,2.753,2.808,2.753h29.007c1.53,0,2.778-1.229,2.808-2.753l4.834-40.993c0.004-0.034,0.006-0.068,0.006-0.103
16
+ C59.648,28.281,58.391,27.021,56.841,27.021z M56.328,19.466c0.396,0.169,0.581,0.631,0.412,1.028l-2.555,6.01
17
+ c-0.072,0.171-0.07,0.348-0.035,0.517H24.933l7.222-16.982c0.082-0.192,0.233-0.341,0.427-0.419c0.195-0.079,0.408-0.077,0.6,0.005
18
+ l20.276,8.621c0.019,0.006,0.03,0.021,0.05,0.026c0.006,0.001,0.012,0.001,0.016,0.002L56.328,19.466z M28.969,3.642
19
+ c0.118-0.416,0.549-0.659,0.968-0.541L54.139,9.94c0.416,0.118,0.658,0.552,0.543,0.967l-1.505,5.318l-19.311-8.21
20
+ c-0.624-0.265-1.312-0.271-1.939-0.018c-0.628,0.253-1.119,0.736-1.383,1.358l-2.517,5.918c-0.062-0.023-0.12-0.054-0.188-0.063
21
+ l-2.065-0.259L28.969,3.642z M22.152,17.049c0.026-0.208,0.131-0.393,0.296-0.521c0.166-0.128,0.374-0.185,0.579-0.159l4.304,0.54
22
+ l-4.037,9.495c-0.087,0.205-0.082,0.421-0.017,0.617H20.9L22.152,17.049z M53.066,70.768c-0.004,0.034-0.006,0.068-0.006,0.104
23
+ c0,0.584-0.475,1.059-1.059,1.059H22.996c-0.583,0-1.059-0.475-1.059-1.059c0-0.034-0.002-0.068-0.006-0.104l-4.829-40.98
24
+ c0.023-0.563,0.489-1.015,1.058-1.015h38.681c0.569,0,1.034,0.451,1.058,1.015L53.066,70.768z"/>
25
+ <path fill="#6699CC" d="M28.884,63.443c-0.48,0.055-0.826,0.486-0.772,0.968l0.326,2.907c0.05,0.447,0.429,0.777,0.869,0.777
26
+ c0.032,0,0.065-0.002,0.099-0.006c0.48-0.054,0.826-0.486,0.772-0.967l-0.326-2.908C29.797,63.734,29.364,63.382,28.884,63.443z"/>
27
+ <path fill="#6699CC" d="M26.532,42.486c0.48-0.055,0.826-0.486,0.772-0.967l-0.759-6.771c-0.054-0.479-0.479-0.819-0.967-0.772
28
+ c-0.48,0.054-0.826,0.487-0.772,0.967l0.759,6.771c0.05,0.447,0.429,0.777,0.869,0.777C26.466,42.492,26.499,42.49,26.532,42.486z"
29
+ />
30
+ <path fill="#6699CC" d="M46.116,63.445c-0.485-0.057-0.914,0.291-0.968,0.771l-0.325,2.906c-0.056,0.48,0.29,0.913,0.771,0.967
31
+ c0.033,0.004,0.066,0.006,0.1,0.006c0.438,0,0.818-0.33,0.867-0.777l0.326-2.905C46.941,63.934,46.598,63.5,46.116,63.445z"/>
32
+ <path fill="#6699CC" d="M49.421,33.976c-0.487-0.052-0.913,0.292-0.967,0.772l-0.731,6.525c-0.056,0.479,0.291,0.912,0.771,0.967
33
+ c0.032,0.004,0.065,0.006,0.099,0.006c0.439,0,0.818-0.33,0.868-0.777l0.731-6.525C50.247,34.463,49.9,34.03,49.421,33.976z"/>
34
+ <path fill="#6699CC" d="M37.306,64.895c-0.483,0-0.875,0.392-0.875,0.875v1.453c0,0.482,0.392,0.875,0.875,0.875
35
+ s0.875-0.393,0.875-0.875V65.77C38.182,65.285,37.789,64.895,37.306,64.895z"/>
36
+ <path fill="#6699CC" d="M37.306,37.75c0.483,0,0.875-0.392,0.875-0.875v-2.029c0-0.483-0.393-0.875-0.875-0.875
37
+ s-0.875,0.392-0.875,0.875v2.029C36.431,37.358,36.822,37.75,37.306,37.75z"/>
38
+ <path fill="#6699CC" d="M37.5,40.496c-6.108,0-11.078,4.97-11.078,11.079c0,6.108,4.97,11.077,11.078,11.077
39
+ c6.109,0,11.079-4.969,11.079-11.077C48.578,45.466,43.607,40.496,37.5,40.496z M37.5,60.902c-5.144,0-9.328-4.185-9.328-9.327
40
+ c0-5.146,4.185-9.329,9.328-9.329c5.145,0,9.329,4.186,9.329,9.329C46.828,56.719,42.645,60.902,37.5,60.902z"/>
41
+ <path fill="#6699CC" d="M38.74,51.574l4.164-4.165c0.341-0.343,0.341-0.896,0-1.238c-0.342-0.342-0.896-0.342-1.238,0L37.5,50.336
42
+ l-4.166-4.165c-0.342-0.342-0.896-0.342-1.237,0c-0.341,0.343-0.342,0.896,0,1.238l4.165,4.165l-4.165,4.165
43
+ c-0.342,0.342-0.342,0.896,0,1.237c0.171,0.172,0.395,0.256,0.619,0.256c0.224,0,0.448-0.084,0.619-0.256l4.166-4.164l4.166,4.164
44
+ c0.171,0.172,0.396,0.256,0.619,0.256c0.223,0,0.448-0.084,0.618-0.256c0.342-0.342,0.342-0.896,0-1.237L38.74,51.574z"/>
45
+ </g>
46
+ </svg>
admin/img/icons/purge-cssjs.svg ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve">
6
+ <g>
7
+ <path fill="#6699CC" d="M47.673,48.495c-5.733,0-10.4,4.666-10.4,10.401c0,5.733,4.667,10.398,10.4,10.398
8
+ c5.735,0,10.401-4.665,10.401-10.398C58.074,53.161,53.408,48.495,47.673,48.495z M47.673,67.546c-4.771,0-8.649-3.88-8.649-8.649
9
+ c0-4.771,3.881-8.65,8.649-8.65c4.771,0,8.651,3.881,8.651,8.65S52.443,67.546,47.673,67.546z"/>
10
+ <path fill="#6699CC" d="M52.758,53.811c-0.34-0.343-0.896-0.341-1.236,0l-3.848,3.848l-3.847-3.848
11
+ c-0.343-0.343-0.897-0.343-1.237,0c-0.342,0.342-0.343,0.896-0.001,1.236l3.849,3.85l-3.849,3.849
12
+ c-0.342,0.341-0.341,0.896,0.001,1.237c0.17,0.17,0.395,0.256,0.618,0.256s0.448-0.086,0.619-0.256l3.847-3.849l3.848,3.849
13
+ c0.17,0.17,0.396,0.256,0.619,0.256c0.223,0,0.447-0.086,0.617-0.256c0.342-0.342,0.344-0.896,0.001-1.237l-3.848-3.849l3.848-3.85
14
+ C53.102,54.706,53.1,54.15,52.758,53.811z"/>
15
+ <path fill="#6699CC" d="M64.165,17.493c-0.044-0.117-0.108-0.228-0.205-0.32l-9.576-9.197c-0.03-0.029-0.067-0.041-0.102-0.064
16
+ c-0.058-0.042-0.111-0.087-0.179-0.114c-0.076-0.031-0.156-0.04-0.236-0.048c-0.031-0.003-0.059-0.018-0.09-0.018h-0.015
17
+ c-0.003,0-0.005,0-0.007,0h-3.189c-0.029-0.041-0.047-0.088-0.086-0.124l-5.531-5.314c-0.03-0.029-0.067-0.04-0.102-0.064
18
+ c-0.058-0.042-0.111-0.087-0.18-0.114c-0.072-0.03-0.148-0.037-0.227-0.046c-0.034-0.004-0.064-0.02-0.101-0.02h-0.016
19
+ c-0.001,0-0.002,0-0.004,0H12.917c-1.451,0-2.632,1.18-2.632,2.631v59.231c0,1.449,1.181,2.631,2.632,2.631h4.382v4.909
20
+ c0,1.479,1.205,2.685,2.685,2.685h41.583c1.479,0,2.684-1.203,2.684-2.685V17.857C64.25,17.726,64.217,17.604,64.165,17.493z
21
+ M54.652,10.661l6.574,6.314l-6.574-0.023V10.661z M45.218,4.979l2.866,2.753h-2.866V4.979z M12.917,64.793
22
+ c-0.486,0-0.882-0.396-0.882-0.881V4.681c0-0.486,0.396-0.881,0.882-0.881h30.551v3.932H19.984c-1.48,0-2.685,1.205-2.685,2.686
23
+ v54.375H12.917z M62.5,71.452c0,0.516-0.419,0.935-0.934,0.935H19.984c-0.516,0-0.935-0.419-0.935-0.935V10.417
24
+ c0-0.516,0.419-0.936,0.935-0.936h32.918v7.469c0,0.982,0.798,1.781,1.779,1.781H62.5V71.452z"/>
25
+ <path fill="#6699CC" d="M28.199,23.273c-0.715,0.622-1.073,1.868-1.073,3.739v3.275c0,1.27-0.229,2.15-0.686,2.641
26
+ c-0.457,0.491-1.287,0.736-2.488,0.736h-0.774v1.333h0.774c1.202,0,2.031,0.246,2.488,0.736c0.457,0.49,0.686,1.371,0.686,2.641
27
+ v3.274c0,1.871,0.357,3.119,1.073,3.746c0.716,0.625,2.126,0.938,4.234,0.938h0.787V45h-0.863c-1.193,0-1.972-0.188-2.336-0.559
28
+ c-0.364-0.373-0.546-1.155-0.546-2.35V38.45c0-1.329-0.208-2.277-0.622-2.844s-1.181-0.995-2.298-1.282
29
+ c1.1-0.254,1.862-0.668,2.285-1.244s0.635-1.532,0.635-2.869v-3.644c0-1.193,0.182-1.976,0.546-2.349s1.143-0.559,2.336-0.559
30
+ h0.863v-1.32h-0.787C30.326,22.34,28.915,22.651,28.199,23.273z"/>
31
+ <path fill="#6699CC" d="M38.425,43.136c0.091,0,0.181-0.024,0.263-0.073c1.3-0.803,2.289-1.768,2.94-2.869
32
+ c0.653-1.102,1.021-2.433,1.092-3.958c0.007-0.136-0.043-0.27-0.138-0.369c-0.094-0.099-0.225-0.155-0.361-0.155H39.72
33
+ c-0.276,0-0.5,0.224-0.5,0.5v0.47c0,1.045-0.172,1.941-0.511,2.662c-0.335,0.713-0.873,1.342-1.596,1.873
34
+ c-0.118,0.088-0.191,0.221-0.203,0.365c-0.012,0.145,0.042,0.288,0.145,0.393l1.016,1.016
35
+ C38.168,43.086,38.296,43.136,38.425,43.136z M39.614,39.77c0.398-0.848,0.603-1.875,0.605-3.058h1.464
36
+ c-0.113,1.14-0.422,2.138-0.916,2.972c-0.513,0.867-1.276,1.646-2.273,2.313l-0.336-0.335
37
+ C38.794,41.109,39.282,40.475,39.614,39.77z"/>
38
+ <path fill="#6699CC" d="M40.914,31.685c0.609,0,1.132-0.214,1.553-0.635c0.422-0.421,0.637-0.944,0.637-1.554
39
+ c0-0.6-0.213-1.119-0.634-1.544c-0.842-0.853-2.264-0.854-3.108-0.009c-0.422,0.422-0.635,0.944-0.635,1.553
40
+ s0.213,1.131,0.635,1.554C39.782,31.471,40.307,31.685,40.914,31.685z M40.066,28.65c0.233-0.234,0.504-0.343,0.848-0.343
41
+ c0.338,0,0.613,0.113,0.844,0.347c0.231,0.235,0.346,0.51,0.346,0.842c0,0.344-0.108,0.612-0.344,0.846
42
+ c-0.464,0.464-1.229,0.464-1.691,0c-0.229-0.23-0.342-0.507-0.342-0.846S39.838,28.88,40.066,28.65z"/>
43
+ <path fill="#6699CC" d="M54.563,27.012c0-1.871-0.354-3.117-1.062-3.739c-0.706-0.622-2.113-0.933-4.221-0.933h-0.8v1.32h0.889
44
+ c1.185,0,1.957,0.184,2.316,0.552s0.539,1.153,0.539,2.355v3.644c0,1.337,0.209,2.293,0.629,2.869
45
+ c0.418,0.576,1.179,0.99,2.278,1.244c-1.108,0.288-1.871,0.715-2.284,1.282c-0.416,0.567-0.623,1.515-0.623,2.844v3.644
46
+ c0,1.202-0.18,1.986-0.539,2.355c-0.359,0.367-1.133,0.552-2.316,0.552H48.48v1.333h0.8c2.106,0,3.515-0.313,4.221-0.939
47
+ c0.707-0.625,1.062-1.875,1.062-3.744v-3.275c0-1.27,0.229-2.15,0.686-2.641c0.457-0.491,1.286-0.736,2.488-0.736h0.787v-1.333
48
+ h-0.787c-1.202,0-2.031-0.246-2.488-0.736c-0.457-0.49-0.686-1.371-0.686-2.641V27.012z"/>
49
+ </g>
50
+ </svg>
admin/img/icons/purge-front.svg ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve">
6
+ <g>
7
+ <path fill="#6699CC" d="M63.657,12.237c-0.046-0.116-0.109-0.227-0.205-0.318L52.954,1.835c-0.028-0.027-0.065-0.039-0.097-0.062
8
+ c-0.06-0.043-0.115-0.089-0.186-0.117c-0.068-0.027-0.143-0.034-0.215-0.043c-0.037-0.005-0.07-0.022-0.109-0.022H52.33h-0.001
9
+ H14.114c-1.577,0-2.86,1.283-2.86,2.859v66.923c0,1.577,1.283,2.859,2.86,2.859h46.773c1.575,0,2.858-1.282,2.858-2.859V12.608
10
+ C63.746,12.474,63.711,12.351,63.657,12.237z M53.223,4.52l7.51,7.213h-7.395c-0.064,0-0.115-0.052-0.115-0.118V4.52z
11
+ M61.996,71.373c0,0.611-0.498,1.109-1.109,1.109H14.114c-0.612,0-1.11-0.498-1.11-1.109V4.45c0-0.612,0.498-1.109,1.11-1.109
12
+ h37.359v8.274c0,1.03,0.836,1.868,1.864,1.868h8.658L61.996,71.373L61.996,71.373z"/>
13
+ <path fill="#6699CC" d="M45.43,44.486c-6.656,0-12.072,5.416-12.072,12.072S38.773,68.63,45.43,68.63
14
+ c6.655,0,12.071-5.415,12.071-12.071S52.085,44.486,45.43,44.486z M45.43,66.881c-5.691,0-10.322-4.63-10.322-10.32
15
+ c0-5.691,4.63-10.322,10.322-10.322c5.69,0,10.321,4.631,10.321,10.322C55.751,62.251,51.12,66.881,45.43,66.881z"/>
16
+ <path fill="#6699CC" d="M51.299,50.689c-0.342-0.342-0.896-0.342-1.238,0L45.43,55.32l-4.631-4.631
17
+ c-0.342-0.342-0.896-0.342-1.238,0c-0.34,0.342-0.34,0.896,0,1.237l4.631,4.632l-4.631,4.631c-0.34,0.342-0.34,0.896,0,1.237
18
+ c0.172,0.171,0.396,0.257,0.619,0.257s0.448-0.086,0.619-0.257l4.631-4.631l4.631,4.631c0.172,0.171,0.396,0.257,0.619,0.257
19
+ s0.448-0.086,0.619-0.257c0.342-0.342,0.342-0.896,0-1.237l-4.631-4.631l4.631-4.632C51.641,51.586,51.641,51.031,51.299,50.689z"
20
+ />
21
+ <path fill="#6699CC" d="M19.826,18.879c0,0.483,0.392,0.875,0.875,0.875h33.598c0.483,0,0.875-0.392,0.875-0.875
22
+ s-0.392-0.875-0.875-0.875H20.701C20.218,18.004,19.826,18.396,19.826,18.879z"/>
23
+ <path fill="#6699CC" d="M20.701,29.511h33.598c0.483,0,0.875-0.392,0.875-0.875c0-0.483-0.392-0.875-0.875-0.875H20.701
24
+ c-0.483,0-0.875,0.392-0.875,0.875C19.826,29.119,20.218,29.511,20.701,29.511z"/>
25
+ <path fill="#6699CC" d="M20.701,39.27h33.598c0.483,0,0.875-0.393,0.875-0.875c0-0.483-0.392-0.875-0.875-0.875H20.701
26
+ c-0.483,0-0.875,0.392-0.875,0.875C19.826,38.877,20.218,39.27,20.701,39.27z"/>
27
+ <path fill="#6699CC" d="M30.125,47.275h-9.423c-0.483,0-0.875,0.393-0.875,0.875c0,0.483,0.392,0.875,0.875,0.875h9.423
28
+ c0.483,0,0.875-0.392,0.875-0.875C31,47.668,30.608,47.275,30.125,47.275z"/>
29
+ <path fill="#6699CC" d="M27.75,57.034h-7.049c-0.483,0-0.875,0.392-0.875,0.875s0.392,0.875,0.875,0.875h7.049
30
+ c0.483,0,0.875-0.392,0.875-0.875S28.233,57.034,27.75,57.034z"/>
31
+ </g>
32
+ </svg>
admin/img/icons/purge-pages.svg ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve">
6
+ <g>
7
+ <path fill="#6699CC" d="M47.423,47.475c-6.108,0-11.078,4.971-11.078,11.08c0,6.107,4.969,11.077,11.078,11.077
8
+ c6.109,0,11.079-4.97,11.079-11.077C58.502,52.443,53.532,47.475,47.423,47.475z M47.423,67.882c-5.144,0-9.327-4.185-9.327-9.327
9
+ c0-5.146,4.184-9.33,9.327-9.33c5.146,0,9.329,4.186,9.329,9.33C56.752,63.697,52.566,67.882,47.423,67.882z"/>
10
+ <path fill="#6699CC" d="M52.827,53.148c-0.343-0.342-0.896-0.342-1.238,0l-4.165,4.166l-4.165-4.166
11
+ c-0.342-0.342-0.896-0.342-1.237,0c-0.342,0.343-0.342,0.896,0,1.238l4.164,4.165l-4.164,4.165c-0.342,0.342-0.342,0.896,0,1.238
12
+ c0.17,0.171,0.396,0.256,0.619,0.256c0.223,0,0.447-0.085,0.618-0.256l4.165-4.165l4.165,4.165
13
+ c0.171,0.171,0.396,0.256,0.619,0.256s0.448-0.085,0.619-0.256c0.341-0.342,0.341-0.896,0-1.238l-4.165-4.165l4.165-4.165
14
+ C53.168,54.046,53.168,53.491,52.827,53.148z"/>
15
+ <path fill="#6699CC" d="M64.166,21.332c-0.045-0.116-0.109-0.225-0.205-0.316l-8.912-8.56c-0.029-0.028-0.066-0.04-0.1-0.063
16
+ c-0.059-0.042-0.113-0.087-0.182-0.115c-0.072-0.029-0.147-0.036-0.225-0.045c-0.035-0.004-0.064-0.021-0.102-0.021h-0.018
17
+ c-0.001,0-0.002,0-0.003,0h-2.938c-0.023-0.032-0.037-0.07-0.067-0.099l-5.149-4.946c-0.031-0.031-0.072-0.044-0.107-0.069
18
+ c-0.057-0.04-0.107-0.083-0.172-0.109c-0.071-0.029-0.146-0.036-0.223-0.045c-0.035-0.004-0.066-0.021-0.104-0.021h-0.018
19
+ c0,0,0,0-0.002,0h-2.832c-0.045-0.119-0.108-0.232-0.207-0.326L36.901,1.12c0,0-0.001,0-0.001-0.001l-0.012-0.012
20
+ c-0.027-0.026-0.061-0.036-0.09-0.057c-0.061-0.046-0.12-0.093-0.191-0.122c-0.064-0.026-0.132-0.03-0.2-0.04
21
+ c-0.042-0.006-0.081-0.025-0.125-0.025H10.139c-1.364,0-2.474,1.11-2.474,2.474V57.23c0,1.362,1.11,2.473,2.474,2.473h3.38
22
+ c0.139,0,0.266-0.039,0.383-0.098v4.953c0,1.385,1.126,2.51,2.51,2.51h4.018v4.509c0,1.411,1.148,2.56,2.56,2.56h38.701
23
+ c1.41,0,2.559-1.147,2.559-2.56V21.695C64.25,21.564,64.217,21.443,64.166,21.332z M55.316,15.14l5.924,5.689l-5.924,0.023V15.14z
24
+ M46.536,9.852l2.457,2.36h-2.457V9.852z M37.157,3.792l3.26,3.131h-3.26V3.792z M13.902,9.432v48.619
25
+ c-0.117-0.059-0.244-0.098-0.383-0.098h-3.38c-0.399,0-0.724-0.324-0.724-0.723V3.337c0-0.399,0.325-0.724,0.724-0.724h25.268v4.31
26
+ H16.413C15.028,6.923,13.902,8.048,13.902,9.432z M16.413,65.318c-0.419,0-0.76-0.34-0.76-0.76V9.432
27
+ c0-0.418,0.341-0.759,0.76-0.759h28.374v3.539H22.99c-1.411,0-2.56,1.148-2.56,2.56V65.32h-4.017V65.318z M62.5,71.577
28
+ c0,0.446-0.361,0.81-0.809,0.81H22.99c-0.446,0-0.81-0.363-0.81-0.81V14.771c0-0.446,0.363-0.81,0.81-0.81h30.576v6.891
29
+ c0,0.947,0.771,1.718,1.718,1.718H62.5V71.577z"/>
30
+ <path fill="#6699CC" d="M27.498,28.501h26.625c0.482,0,0.875-0.392,0.875-0.875s-0.393-0.875-0.875-0.875H27.498
31
+ c-0.483,0-0.875,0.392-0.875,0.875S27.015,28.501,27.498,28.501z"/>
32
+ <path fill="#6699CC" d="M27.498,36.757h26.625c0.482,0,0.875-0.392,0.875-0.875c0-0.483-0.393-0.875-0.875-0.875H27.498
33
+ c-0.483,0-0.875,0.392-0.875,0.875C26.623,36.365,27.015,36.757,27.498,36.757z"/>
34
+ <path fill="#6699CC" d="M27.498,45.014h26.625c0.482,0,0.875-0.393,0.875-0.875c0-0.484-0.393-0.875-0.875-0.875H27.498
35
+ c-0.483,0-0.875,0.391-0.875,0.875C26.623,44.621,27.015,45.014,27.498,45.014z"/>
36
+ <path fill="#6699CC" d="M32.999,51.52h-5.501c-0.483,0-0.875,0.393-0.875,0.875c0,0.483,0.392,0.875,0.875,0.875h5.501
37
+ c0.483,0,0.875-0.392,0.875-0.875C33.874,51.912,33.482,51.52,32.999,51.52z"/>
38
+ <path fill="#6699CC" d="M31.124,59.775h-3.626c-0.483,0-0.875,0.392-0.875,0.875c0,0.482,0.392,0.875,0.875,0.875h3.626
39
+ c0.483,0,0.875-0.393,0.875-0.875C31.999,60.167,31.607,59.775,31.124,59.775z"/>
40
+ </g>
41
+ </svg>
admin/img/icons/revision.svg ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve">
6
+ <g>
7
+ <path fill="#6699CC" d="M60.912,72.441H14.087c-1.493,0-2.708-1.214-2.708-2.708V5.266c0-1.493,1.215-2.708,2.708-2.708h46.827
8
+ c1.492,0,2.708,1.215,2.708,2.708v64.468C63.62,71.228,62.406,72.441,60.912,72.441z M14.087,4.206c-0.584,0-1.06,0.476-1.06,1.06
9
+ v64.468c0,0.584,0.476,1.061,1.06,1.061h46.827c0.583,0,1.06-0.477,1.06-1.061V5.266c0-0.583-0.477-1.06-1.06-1.06H14.087z"/>
10
+ </g>
11
+ <g>
12
+ <path fill="#6699CC" d="M53.625,16.858h-32.25c-0.483,0-0.875-0.392-0.875-0.875s0.392-0.875,0.875-0.875h32.25
13
+ c0.482,0,0.875,0.392,0.875,0.875S54.107,16.858,53.625,16.858z"/>
14
+ </g>
15
+ <g>
16
+ <path fill="#6699CC" d="M53.625,27.617h-32.25c-0.483,0-0.875-0.392-0.875-0.875c0-0.483,0.392-0.875,0.875-0.875h32.25
17
+ c0.482,0,0.875,0.392,0.875,0.875C54.5,27.225,54.107,27.617,53.625,27.617z"/>
18
+ </g>
19
+ <g>
20
+ <path fill="#6699CC" d="M53.625,38.375h-32.25c-0.483,0-0.875-0.392-0.875-0.875s0.392-0.875,0.875-0.875h32.25
21
+ c0.482,0,0.875,0.392,0.875,0.875S54.107,38.375,53.625,38.375z"/>
22
+ </g>
23
+ <g>
24
+ <path fill="#6699CC" d="M29.373,49.133h-7.998c-0.483,0-0.875-0.392-0.875-0.875c0-0.482,0.392-0.875,0.875-0.875h7.998
25
+ c0.483,0,0.875,0.393,0.875,0.875C30.248,48.741,29.856,49.133,29.373,49.133z"/>
26
+ </g>
27
+ <g>
28
+ <path fill="#6699CC" d="M27.763,59.893h-6.388c-0.483,0-0.875-0.392-0.875-0.875c0-0.482,0.392-0.875,0.875-0.875h6.388
29
+ c0.483,0,0.875,0.393,0.875,0.875C28.638,59.501,28.247,59.893,27.763,59.893z"/>
30
+ </g>
31
+ <g>
32
+ <path fill="#6699CC" d="M35.727,49.516"/>
33
+ </g>
34
+ <g>
35
+ <path fill="#6699CC" d="M50.613,64.8"/>
36
+ </g>
37
+ <g>
38
+ <g>
39
+ <path fill="#6699CC" d="M44.561,67.521c-6.457,0-11.709-5.254-11.709-11.711c0-0.719,0.066-1.438,0.195-2.141l1.721,0.318
40
+ c-0.11,0.597-0.166,1.21-0.166,1.822c0,5.491,4.467,9.959,9.959,9.959c1.992,0,3.916-0.586,5.563-1.696l0.979,1.45
41
+ C49.165,66.831,46.902,67.521,44.561,67.521z"/>
42
+ </g>
43
+ <g>
44
+ <g>
45
+ <polygon fill="#6699CC" points="30.879,53.666 35.572,49.759 36.61,55.777 "/>
46
+ </g>
47
+ </g>
48
+ </g>
49
+ <g>
50
+ <g>
51
+ <path fill="#6699CC" d="M56.075,57.952l-1.722-0.316c0.11-0.6,0.166-1.214,0.166-1.823c0-5.492-4.468-9.961-9.959-9.961
52
+ c-1.994,0-3.918,0.588-5.564,1.698l-0.979-1.45c1.937-1.308,4.198-1.998,6.543-1.998c6.457,0,11.709,5.254,11.709,11.711
53
+ C56.271,56.527,56.205,57.248,56.075,57.952z"/>
54
+ </g>
55
+ <g>
56
+ <g>
57
+ <polygon fill="#6699CC" points="58.242,57.958 53.548,61.865 52.512,55.848 "/>
58
+ </g>
59
+ </g>
60
+ </g>
61
+ <g>
62
+ <path fill="#6699CC" d="M38.507,46.824"/>
63
+ </g>
64
+ </svg>
admin/img/icons/spam_comment.svg ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve">
6
+ <g>
7
+ <path fill="#6699CC" d="M65.631,35.152c-0.053-0.112-0.125-0.216-0.227-0.3l-3.545-2.941l2.103-1.267
8
+ c0.263-0.157,0.422-0.438,0.425-0.743c0.002-0.304-0.154-0.588-0.412-0.749l-3.882-2.417l1.966-3.417
9
+ c0.799-1.297,0.395-3.003-0.92-3.815L36.428,5.109c-1.296-0.803-3.003-0.4-3.815,0.913L21.069,25.613
10
+ c-0.146,0.025-0.288,0.074-0.41,0.175l-11.062,9.19c-0.031,0.026-0.046,0.062-0.073,0.09c-0.958,0.463-1.625,1.436-1.625,2.569
11
+ v33.007c0,1.578,1.284,2.862,2.862,2.862h53.477c1.578,0,2.861-1.284,2.861-2.862V37.637
12
+ C67.102,36.567,66.504,35.643,65.631,35.152z M33.131,55.07L9.671,70.753c-0.004-0.037-0.022-0.069-0.022-0.106V37.637
13
+ c0-0.21,0.075-0.396,0.177-0.565c-0.004,0.271,0.101,0.539,0.333,0.714L33.131,55.07z M35.793,55.396
14
+ c0.047-0.032,0.092-0.068,0.132-0.109c0.876-0.875,2.404-0.875,3.277,0c0.041,0.041,0.086,0.078,0.134,0.109L63.87,71.758H11.317
15
+ L35.793,55.396z M65.331,70.63L41.773,54.92l23.502-17.647c0.041,0.115,0.074,0.235,0.074,0.365v33.008v0.002
16
+ C65.343,70.645,65.339,70.635,65.331,70.63z M60.342,32.925l3.71,3.079l-17.312,13l7.267-12.359l6.281-3.786
17
+ C60.309,32.879,60.318,32.906,60.342,32.925z M34.111,6.927c0.295-0.476,0.922-0.623,1.416-0.318l24.709,14.395
18
+ c0.477,0.294,0.625,0.921,0.318,1.42l-2.4,4.171c-0.234,0.409-0.104,0.93,0.296,1.179l3.386,2.108l-8.922,5.377
19
+ c-0.125,0.075-0.229,0.181-0.303,0.306L43.25,51.488c-0.034,0.059-0.044,0.121-0.063,0.185l-2.944,2.21
20
+ c-1.532-1.338-4.009-1.313-5.489,0.104l-0.081,0.055L15.049,39.275L34.111,6.927z M13.642,38.217l-2.431-1.829
21
+ c-0.118-0.089-0.252-0.132-0.389-0.153l7.812-6.489L13.642,38.217z"/>
22
+ <path fill="#6699CC" d="M28.153,46.658c1.823,1.126,3.914,1.721,6.046,1.721c4.031,0,7.701-2.045,9.814-5.47
23
+ c1.617-2.619,2.119-5.711,1.411-8.707s-2.54-5.537-5.159-7.154c-1.822-1.126-3.914-1.721-6.045-1.721
24
+ c-4.03,0-7.699,2.045-9.814,5.47C21.066,36.201,22.747,43.316,28.153,46.658z M42.523,41.989c-1.793,2.905-4.905,4.64-8.325,4.64
25
+ c-1.808,0-3.58-0.505-5.126-1.459c-2.025-1.252-3.431-3.129-4.129-5.229l18.938-4.476C44.21,37.732,43.742,40.02,42.523,41.989z
26
+ M25.894,31.716c1.794-2.905,4.907-4.64,8.326-4.64c1.807,0,3.58,0.505,5.125,1.46c1.973,1.217,3.413,3.053,4.135,5.227
27
+ l-18.938,4.473C24.226,36.048,24.643,33.741,25.894,31.716z"/>
28
+ <path fill="#6699CC" d="M32.743,20.526c0.139,0.082,0.292,0.121,0.442,0.121c0.3,0,0.592-0.154,0.755-0.432l3.168-5.388
29
+ c0.245-0.417,0.105-0.953-0.311-1.198c-0.417-0.247-0.954-0.105-1.198,0.311l-3.168,5.388
30
+ C32.188,19.745,32.327,20.281,32.743,20.526z"/>
31
+ <path fill="#6699CC" d="M42.586,23.268c0.141,0.082,0.292,0.121,0.441,0.121c0.301,0,0.593-0.154,0.756-0.432l1.838-3.125
32
+ c0.245-0.417,0.105-0.953-0.311-1.198c-0.416-0.244-0.953-0.106-1.197,0.311l-1.838,3.125
33
+ C42.029,22.487,42.169,23.023,42.586,23.268z"/>
34
+ <path fill="#6699CC" d="M49.389,31.182c0.139,0.082,0.291,0.121,0.441,0.121c0.3,0,0.592-0.154,0.755-0.432l3.548-6.034
35
+ c0.245-0.417,0.105-0.953-0.311-1.198c-0.418-0.246-0.953-0.105-1.197,0.311l-3.548,6.034
36
+ C48.832,30.401,48.971,30.937,49.389,31.182z"/>
37
+ </g>
38
+ </svg>
admin/img/icons/success_icon.svg ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="20px" height="20px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">
6
+ <g id="Layer_1_1_" display="none">
7
+ <path display="inline" fill="#E8AE4A" d="M10,0C4.477,0,0,4.478,0,10c0,5.521,4.477,10,10,10c5.521,0,10-4.479,10-10
8
+ C20,4.478,15.521,0,10,0z M11.329,16.83c-0.362,0.361-0.804,0.545-1.313,0.545s-0.949-0.184-1.312-0.545
9
+ c-0.361-0.362-0.544-0.805-0.544-1.313c0-0.509,0.18-0.951,0.537-1.316c0.357-0.363,0.802-0.551,1.318-0.551
10
+ c0.512,0,0.953,0.184,1.313,0.543c0.359,0.361,0.542,0.808,0.542,1.324C11.871,16.027,11.688,16.468,11.329,16.83z M11.389,7.468
11
+ l-0.535,2.207c-0.185,0.771-0.322,1.7-0.409,2.763c-0.01,0.111-0.104,0.198-0.216,0.198H9.783c-0.114,0-0.209-0.089-0.216-0.202
12
+ c-0.046-0.754-0.201-1.683-0.46-2.759L8.58,7.467C8.257,6.115,8.099,5.169,8.099,4.572c0-0.576,0.177-1.049,0.527-1.406
13
+ c0.351-0.358,0.813-0.541,1.37-0.541c0.543,0,1.004,0.183,1.363,0.544c0.358,0.36,0.541,0.822,0.541,1.373
14
+ C11.9,5.077,11.734,6.033,11.389,7.468z"/>
15
+ </g>
16
+ <g id="Layer_1_copy_3" display="none">
17
+ <path display="inline" fill="#4675B8" d="M10,0C4.477,0,0,4.478,0,10c0,5.521,4.477,10,10,10c5.521,0,10-4.479,10-10
18
+ C20,4.478,15.521,0,10,0z M11.329,16.83c-0.362,0.361-0.804,0.545-1.313,0.545s-0.949-0.184-1.312-0.545
19
+ c-0.361-0.362-0.544-0.805-0.544-1.313c0-0.509,0.18-0.951,0.537-1.316c0.357-0.363,0.802-0.551,1.318-0.551
20
+ c0.512,0,0.953,0.184,1.313,0.543c0.359,0.361,0.542,0.808,0.542,1.324C11.871,16.027,11.688,16.468,11.329,16.83z M11.389,7.468
21
+ l-0.535,2.207c-0.185,0.771-0.322,1.7-0.409,2.763c-0.01,0.111-0.104,0.198-0.216,0.198H9.783c-0.114,0-0.209-0.089-0.216-0.202
22
+ c-0.046-0.754-0.201-1.683-0.46-2.759L8.58,7.467C8.257,6.115,8.099,5.169,8.099,4.572c0-0.576,0.177-1.049,0.527-1.406
23
+ c0.351-0.358,0.813-0.541,1.37-0.541c0.543,0,1.004,0.183,1.363,0.544c0.358,0.36,0.541,0.822,0.541,1.373
24
+ C11.9,5.077,11.734,6.033,11.389,7.468z"/>
25
+ </g>
26
+ <g id="Layer_1_copy" display="none">
27
+ <path display="inline" fill="#A32430" d="M10,0C4.477,0,0,4.478,0,10c0,5.521,4.477,10,10,10c5.521,0,10-4.479,10-10
28
+ C20,4.478,15.521,0,10,0z M15.159,13.764c0.187,0.188,0.288,0.437,0.288,0.697c0,0.262-0.102,0.51-0.288,0.695
29
+ c-0.185,0.184-0.438,0.289-0.698,0.289c-0.262,0-0.518-0.105-0.697-0.291L10,11.393l-3.764,3.765c-0.361,0.36-1.033,0.36-1.393,0
30
+ c-0.187-0.185-0.29-0.433-0.29-0.695s0.103-0.512,0.289-0.696l3.764-3.767L4.842,6.234c-0.385-0.384-0.385-1.01,0-1.394
31
+ c0.359-0.361,1.032-0.361,1.394,0L10,8.604l3.766-3.765c0.356-0.359,1.033-0.361,1.395,0c0.188,0.185,0.288,0.433,0.288,0.697
32
+ c0.001,0.264-0.103,0.511-0.288,0.697l-3.766,3.764L15.159,13.764z"/>
33
+ </g>
34
+ <g id="Layer_1_copy_2">
35
+ <path fill="#3ABFBF" d="M10,0C4.477,0,0,4.478,0,10c0,5.521,4.477,10,10,10c5.521,0,10-4.479,10-10C20,4.478,15.521,0,10,0z
36
+ M15.458,6.018l-5.944,9.089c-0.031,0.048-0.07,0.088-0.115,0.121l-0.088,0.063c-0.03,0.021-0.063,0.04-0.097,0.053l-0.189,0.075
37
+ c-0.048,0.019-0.1,0.03-0.152,0.032l-0.146,0.004c-0.005,0-0.009,0-0.014,0c-0.026,0-0.052-0.003-0.078-0.008l-0.309-0.096
38
+ c-0.058-0.022-0.11-0.058-0.154-0.101c-0.025-0.017-0.077-0.056-0.099-0.074l-3.381-3.133c-0.185-0.171-0.295-0.405-0.307-0.661
39
+ c-0.01-0.256,0.079-0.497,0.251-0.683c0.357-0.378,0.974-0.398,1.349-0.054l2.597,2.399l5.277-8.069
40
+ c0.277-0.426,0.895-0.558,1.322-0.276c0.211,0.137,0.357,0.352,0.41,0.602C15.645,5.554,15.596,5.807,15.458,6.018z"/>
41
+ </g>
42
+ </svg>
admin/img/icons/trackback-pingback.svg ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve">
6
+ <g>
7
+ <path fill="#6699CC" d="M13.333,10.792c-0.483,0-0.875,0.392-0.875,0.875v2.167c0,0.483,0.392,0.875,0.875,0.875
8
+ s0.875-0.392,0.875-0.875v-2.167C14.208,11.183,13.817,10.792,13.333,10.792z"/>
9
+ <path fill="#6699CC" d="M34.926,34.313V11.001c0-0.167-0.059-0.314-0.141-0.447c-0.044-0.108-0.109-0.21-0.198-0.297l-6.291-6.118
10
+ C28.267,4.111,28.23,4.1,28.199,4.077c-0.161-0.181-0.388-0.301-0.649-0.301H11.926c-1.034,0-1.875,0.841-1.875,1.875v28.662
11
+ c0,1.034,0.841,1.875,1.875,1.875h21.125C34.084,36.188,34.926,35.346,34.926,34.313z M28.425,6.706l3.517,3.42H28.55
12
+ c-0.069,0-0.125-0.056-0.125-0.125V6.706z M11.801,34.313V5.65c0-0.069,0.056-0.125,0.125-0.125h14.749v4.476
13
+ c0,1.034,0.841,1.875,1.875,1.875h4.626v22.437c0,0.069-0.056,0.125-0.125,0.125H11.926C11.857,34.438,11.801,34.381,11.801,34.313
14
+ z"/>
15
+ <path fill="#6699CC" d="M64.809,45.588c-0.045-0.105-0.109-0.207-0.197-0.293l-6.291-6.119c-0.028-0.027-0.064-0.039-0.096-0.062
16
+ c-0.16-0.183-0.389-0.302-0.649-0.302H41.949c-1.034,0-1.875,0.84-1.875,1.875V69.35c0,1.034,0.841,1.875,1.875,1.875h21.125
17
+ c1.033,0,1.875-0.841,1.875-1.875V46.037C64.949,45.869,64.891,45.723,64.809,45.588z M58.449,41.743l3.515,3.419h-3.39
18
+ c-0.069,0-0.125-0.057-0.125-0.125V41.743z M63.199,69.35c0,0.069-0.057,0.125-0.125,0.125H41.949
19
+ c-0.069,0-0.125-0.056-0.125-0.125V40.688c0-0.068,0.056-0.125,0.125-0.125h14.75v4.476c0,1.034,0.841,1.875,1.875,1.875h4.625
20
+ V69.35z"/>
21
+ <path fill="#6699CC" d="M44.533,44.016c-0.483,0-0.875,0.393-0.875,0.875v2.168c0,0.482,0.392,0.875,0.875,0.875
22
+ c0.482,0,0.875-0.393,0.875-0.875v-2.168C45.408,44.407,45.018,44.016,44.533,44.016z"/>
23
+ <path fill="#6699CC" d="M47.535,44.016c-0.483,0-0.875,0.393-0.875,0.875v2.168c0,0.482,0.392,0.875,0.875,0.875
24
+ c0.482,0,0.875-0.393,0.875-0.875v-2.168C48.41,44.407,48.02,44.016,47.535,44.016z"/>
25
+ <polygon fill="#6699CC" points="31.548,44.113 25.648,42.532 27.229,48.432 28.769,46.893 34.5,52.622 35.737,51.384
26
+ 30.007,45.652 "/>
27
+ <polygon fill="#6699CC" points="43.452,30.886 49.352,32.467 47.771,26.567 46.23,28.108 40.501,22.378 39.264,23.616
28
+ 44.992,29.346 "/>
29
+ </g>
30
+ </svg>
admin/img/icons/trash_comment.svg ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve">
6
+ <g>
7
+ <path fill="#6699CC" d="M62.324,17.893l2.085-2.085c0.366-0.367,0.569-0.855,0.569-1.374s-0.203-1.007-0.568-1.374L53.094,1.743
8
+ c-0.365-0.367-0.854-0.57-1.373-0.57c-0.519,0-1.007,0.202-1.373,0.569l-7.883,7.882c-0.064-0.08-0.141-0.154-0.234-0.21
9
+ l-7.519-4.431c-0.447-0.264-0.969-0.338-1.472-0.208c-0.503,0.13-0.924,0.448-1.188,0.896l-3.12,5.293l-1.2-2.208
10
+ c-0.249-0.457-0.66-0.789-1.159-0.936c-0.497-0.146-1.023-0.09-1.476,0.157L11.034,15.62c-0.938,0.511-1.287,1.692-0.778,2.634
11
+ l4.606,8.477c-1.289,0.254-2.264,1.391-2.264,2.753c0,0.034,0.002,0.068,0.006,0.103l4.831,40.993
12
+ c0.03,1.523,1.278,2.753,2.808,2.753H49.25c1.529,0,2.777-1.229,2.809-2.753l4.832-40.993c0.004-0.034,0.006-0.068,0.006-0.103
13
+ c0-1.549-1.26-2.809-2.81-2.809h-0.544l2.629-2.629l8.118-2.356c0.297-0.086,0.526-0.323,0.604-0.623
14
+ c0.076-0.3-0.011-0.618-0.229-0.836L62.324,17.893z M33.561,6.558c0.034-0.057,0.083-0.08,0.118-0.089
15
+ c0.033-0.01,0.087-0.013,0.145,0.021l7.408,4.367l-9.371,9.371c-0.757,0.757-0.756,1.99,0,2.747l3.7,3.701h-3.046l0.714-1.211
16
+ c0.245-0.417,0.106-0.953-0.31-1.198c-0.417-0.245-0.953-0.106-1.198,0.31l-1.163,1.973c-0.024,0.041-0.027,0.085-0.044,0.127
17
+ h-3.032L35.366,13.3c0.245-0.417,0.107-0.953-0.31-1.198s-0.953-0.107-1.198,0.31l-8.307,14.094
18
+ c-0.032,0.054-0.04,0.113-0.059,0.17h-3.789L33.561,6.558z M11.871,17.157l14.066-7.644c0.056-0.031,0.109-0.026,0.144-0.015
19
+ c0.035,0.011,0.083,0.035,0.115,0.093l1.266,2.328c0.138,0.254,0.386,0.397,0.653,0.434l-2.13,3.613l-0.291-0.535
20
+ c-0.23-0.424-0.763-0.582-1.187-0.351c-0.424,0.231-0.582,0.762-0.351,1.187l0.388,0.713c0.127,0.234,0.346,0.381,0.588,0.433
21
+ l-1.715,2.908L21.884,17.5c-0.23-0.424-0.762-0.582-1.187-0.351c-0.424,0.23-0.582,0.762-0.351,1.187l1.535,2.824
22
+ c0.158,0.292,0.459,0.457,0.77,0.457c0.001,0,0.002,0,0.003,0l-1.833,3.109c-0.017-0.077-0.03-0.155-0.07-0.228l-2.677-4.926
23
+ c-0.231-0.424-0.763-0.582-1.187-0.351c-0.424,0.231-0.582,0.762-0.351,1.187l2.677,4.926c0.159,0.292,0.459,0.457,0.77,0.457
24
+ c0.084,0,0.165-0.038,0.248-0.063l-0.269,0.457c-0.091,0.155-0.113,0.325-0.104,0.492h-3.034l-5.03-9.255
25
+ C11.743,17.326,11.778,17.208,11.871,17.157z M55.145,29.44l-4.83,40.981c-0.004,0.034-0.006,0.068-0.006,0.103
26
+ c0,0.584-0.475,1.06-1.059,1.06H20.243c-0.583,0-1.059-0.476-1.059-1.06c0-0.033-0.002-0.067-0.006-0.103l-4.83-40.981
27
+ c0.023-0.563,0.489-1.015,1.058-1.015h38.681C54.656,28.425,55.121,28.876,55.145,29.44z M55.468,22.428
28
+ c-0.142,0.041-0.271,0.117-0.375,0.222l-4.024,4.025h-3.877l10.588-10.586c0.341-0.342,0.341-0.896,0-1.237
29
+ c-0.342-0.342-0.896-0.342-1.238,0l-11.57,11.569c-0.076,0.075-0.128,0.163-0.17,0.254h-6.765l-4.937-4.938
30
+ c-0.075-0.075-0.075-0.197,0-0.272L51.585,2.979c0.047-0.046,0.101-0.056,0.136-0.056c0.036,0,0.088,0.01,0.135,0.057
31
+ l11.317,11.318c0.048,0.046,0.058,0.1,0.058,0.136c0,0.036-0.01,0.089-0.059,0.136l-2.704,2.705
32
+ c-0.163,0.164-0.256,0.387-0.256,0.619s0.093,0.455,0.257,0.619l1.911,1.911L55.468,22.428z"/>
33
+ <path fill="#6699CC" d="M51.648,8.721c-0.342-0.342-0.896-0.342-1.238,0L38.84,20.289c-0.341,0.341-0.341,0.896,0,1.237
34
+ c0.172,0.171,0.396,0.256,0.619,0.256s0.448-0.085,0.619-0.256l11.57-11.568C51.988,9.617,51.99,9.063,51.648,8.721z"/>
35
+ <path fill="#6699CC" d="M53.475,11.787L41.906,23.356c-0.342,0.342-0.342,0.896,0,1.237c0.171,0.171,0.396,0.256,0.619,0.256
36
+ c0.223,0,0.447-0.085,0.619-0.256l11.566-11.569c0.342-0.342,0.341-0.896,0-1.237C54.37,11.445,53.814,11.445,53.475,11.787z"/>
37
+ <path fill="#6699CC" d="M26.256,54.037l1.131,0.652l0.001-4.361l-3.779,2.18l1.131,0.653l-0.326,0.565
38
+ c-0.896,1.549-1.013,3.057-0.329,4.242s2.047,1.84,3.838,1.84h4.415c0.483,0,0.875-0.393,0.875-0.875
39
+ c0-0.483-0.392-0.875-0.875-0.875h-4.415c-1.123,0-1.969-0.353-2.323-0.965c-0.354-0.611-0.234-1.521,0.328-2.492L26.256,54.037z"
40
+ />
41
+ <path fill="#6699CC" d="M29.08,47.398c0.138,0.08,0.289,0.117,0.437,0.117c0.302,0,0.596-0.156,0.758-0.438l2.221-3.844
42
+ c0.371-0.641,0.817-1.09,1.325-1.336c0.454-0.221,0.896-0.222,1.35,0.002c0.506,0.244,0.95,0.692,1.322,1.336l0.366,0.632
43
+ l-1.131,0.653l3.779,2.18l-0.003-4.362l-1.13,0.653l-0.366-0.633c-0.55-0.95-1.248-1.635-2.073-2.034
44
+ c-0.926-0.449-1.946-0.45-2.875-0.003c-0.83,0.402-1.529,1.088-2.078,2.037l-2.221,3.844C28.519,46.622,28.662,47.157,29.08,47.398
45
+ z"/>
46
+ <path fill="#6699CC" d="M36.654,58.934l3.778,2.183v-1.308h0.637c1.791,0,3.154-0.652,3.84-1.84
47
+ c0.684-1.187,0.566-2.693-0.33-4.242l-2.25-3.895c-0.241-0.419-0.776-0.561-1.195-0.32c-0.419,0.242-0.563,0.777-0.32,1.195
48
+ l2.252,3.896c0.562,0.971,0.682,1.879,0.328,2.492c-0.354,0.611-1.199,0.963-2.322,0.963h-0.637v-1.307L36.654,58.934z"/>
49
+ <path fill="#6699CC" d="M26.13,63.1c-0.48,0.053-0.826,0.485-0.772,0.967l0.327,2.906c0.05,0.447,0.429,0.777,0.869,0.777
50
+ c0.033,0,0.065-0.002,0.099-0.006c0.48-0.055,0.826-0.486,0.772-0.967l-0.327-2.907C27.043,63.391,26.613,63.048,26.13,63.1z"/>
51
+ <path fill="#6699CC" d="M24.216,46.914c0.032,0,0.065-0.002,0.099-0.006c0.48-0.055,0.826-0.486,0.772-0.967l-1.294-11.54
52
+ c-0.054-0.479-0.481-0.822-0.967-0.772c-0.48,0.054-0.826,0.487-0.772,0.967l1.294,11.539
53
+ C23.397,46.584,23.776,46.914,24.216,46.914z"/>
54
+ <path fill="#6699CC" d="M43.361,63.1c-0.489-0.06-0.912,0.291-0.967,0.771l-0.326,2.906c-0.055,0.479,0.291,0.912,0.771,0.967
55
+ c0.033,0.004,0.066,0.006,0.1,0.006c0.438,0,0.817-0.33,0.867-0.777l0.326-2.906C44.188,63.586,43.843,63.152,43.361,63.1z"/>
56
+ <path fill="#6699CC" d="M45.176,46.932c0.033,0.004,0.066,0.006,0.1,0.006c0.438,0,0.817-0.33,0.867-0.776l1.297-11.563
57
+ c0.056-0.48-0.291-0.914-0.771-0.967c-0.487-0.049-0.913,0.292-0.967,0.772l-1.298,11.563
58
+ C44.35,46.445,44.695,46.878,45.176,46.932z"/>
59
+ <path fill="#6699CC" d="M34.552,63.125c-0.483,0-0.875,0.393-0.875,0.875v2.875c0,0.482,0.392,0.875,0.875,0.875
60
+ c0.483,0,0.875-0.393,0.875-0.875V64C35.427,63.518,35.036,63.125,34.552,63.125z"/>
61
+ <path fill="#6699CC" d="M34.552,37.187c0.483,0,0.875-0.392,0.875-0.875V34.5c0-0.483-0.392-0.875-0.875-0.875
62
+ c-0.483,0-0.875,0.392-0.875,0.875v1.812C33.677,36.795,34.069,37.187,34.552,37.187z"/>
63
+ </g>
64
+ </svg>
admin/img/icons/trash_post.svg ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
4
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
5
+ width="75px" height="75px" viewBox="0 0 75 75" enable-background="new 0 0 75 75" xml:space="preserve">
6
+ <g>
7
+ <path fill="#6699CC" d="M48.201,23.882l-17.297-7.355c-0.446-0.188-0.959,0.018-1.147,0.463c-0.189,0.445,0.018,0.958,0.463,1.147
8
+ l17.295,7.355c0.112,0.047,0.229,0.07,0.344,0.07c0.34,0,0.664-0.2,0.806-0.533C48.854,24.585,48.646,24.071,48.201,23.882z"/>
9
+ <path fill="#6699CC" d="M34.828,23.886l-5.931-2.612c-0.445-0.195-0.959,0.006-1.153,0.448c-0.195,0.442,0.006,0.958,0.448,1.153
10
+ l5.931,2.612c0.115,0.05,0.234,0.074,0.352,0.074c0.336,0,0.657-0.195,0.801-0.522C35.471,24.597,35.271,24.081,34.828,23.886z"/>
11
+ <path fill="#6699CC" d="M54.087,26.923h-0.974l2.484-5.843c0.545-1.285-0.057-2.775-1.341-3.322l-2.211-0.94l1.563-5.534
12
+ c0.379-1.344-0.405-2.746-1.75-3.125l-24.201-6.84c-1.35-0.379-2.748,0.405-3.127,1.75l-3.207,11.346
13
+ c-0.021,0.075-0.016,0.149-0.017,0.224l-0.816-0.103c-1.38-0.168-2.655,0.812-2.83,2.198l-1.28,10.189h-0.976
14
+ c-1.549,0-2.809,1.26-2.809,2.809c0,0.034,0.002,0.068,0.006,0.103l4.831,40.993c0.03,1.523,1.278,2.753,2.808,2.753H49.25
15
+ c1.529,0,2.777-1.229,2.809-2.753l4.832-40.993c0.004-0.034,0.006-0.068,0.006-0.103C56.896,28.183,55.637,26.923,54.087,26.923z
16
+ M53.986,20.396l-2.555,6.01c-0.072,0.171-0.07,0.348-0.035,0.517H22.179L29.4,9.941c0.169-0.397,0.63-0.584,1.028-0.415
17
+ l20.28,8.623c0.017,0.006,0.028,0.019,0.046,0.024c0.005,0.001,0.01,0,0.016,0.002l2.804,1.192
18
+ C53.971,19.537,54.156,19.999,53.986,20.396z M26.216,3.543c0.118-0.416,0.549-0.661,0.968-0.541l24.201,6.839
19
+ c0.416,0.118,0.659,0.552,0.543,0.967l-1.504,5.318l-19.311-8.21c-1.285-0.547-2.776,0.055-3.323,1.34l-2.517,5.918
20
+ c-0.063-0.023-0.12-0.054-0.188-0.063l-2.065-0.259L26.216,3.543z M19.399,16.952c0.054-0.429,0.439-0.733,0.875-0.68l4.303,0.54
21
+ l-4.037,9.495c-0.087,0.205-0.082,0.421-0.017,0.617h-2.377L19.399,16.952z M50.314,70.669c-0.004,0.034-0.006,0.067-0.006,0.103
22
+ c0,0.584-0.476,1.06-1.06,1.06H20.243c-0.583,0-1.059-0.476-1.059-1.06c0-0.033-0.002-0.067-0.006-0.103l-4.83-40.981
23
+ c0.023-0.563,0.489-1.015,1.058-1.015h38.68c0.568,0,1.034,0.451,1.059,1.015L50.314,70.669z"/>
24
+ <path fill="#6699CC" d="M32.34,58.307h-4.416c-1.123,0-1.969-0.352-2.322-0.964s-0.234-1.521,0.328-2.491l0.327-0.565l1.131,0.653
25
+ l0.001-4.362l-3.779,2.18l1.131,0.653l-0.326,0.564c-0.896,1.551-1.013,3.058-0.329,4.242c0.685,1.188,2.048,1.84,3.838,1.84h4.416
26
+ c0.483,0,0.875-0.392,0.875-0.875C33.215,58.699,32.824,58.307,32.34,58.307z"/>
27
+ <path fill="#6699CC" d="M39.508,46.949l-0.003-4.362l-1.13,0.653l-0.365-0.631c-0.549-0.951-1.248-1.637-2.074-2.035
28
+ c-0.927-0.45-1.947-0.451-2.874-0.004c-0.831,0.402-1.53,1.088-2.079,2.037l-2.222,3.843c-0.242,0.419-0.099,0.954,0.319,1.196
29
+ c0.138,0.078,0.289,0.117,0.437,0.117c0.302,0,0.596-0.156,0.758-0.438l2.222-3.844c0.371-0.642,0.816-1.092,1.325-1.336
30
+ c0.448-0.217,0.902-0.217,1.35,0.002c0.506,0.244,0.951,0.692,1.322,1.336l0.365,0.631l-1.131,0.654L39.508,46.949z"/>
31
+ <path fill="#6699CC" d="M42.328,50.08c-0.241-0.419-0.776-0.561-1.195-0.32c-0.419,0.242-0.563,0.777-0.32,1.195l2.252,3.896
32
+ c0.562,0.971,0.682,1.879,0.328,2.49c-0.354,0.613-1.199,0.965-2.322,0.965h-0.637V57l-3.779,2.182l3.779,2.183v-1.308h0.637
33
+ c1.791,0,3.154-0.652,3.839-1.841c0.684-1.187,0.565-2.692-0.33-4.241L42.328,50.08z"/>
34
+ <path fill="#6699CC" d="M26.13,63.346c-0.48,0.055-0.826,0.486-0.772,0.967l0.327,2.908c0.05,0.447,0.429,0.777,0.869,0.777
35
+ c0.033,0,0.065-0.002,0.099-0.006c0.48-0.055,0.826-0.486,0.772-0.967l-0.327-2.908C27.043,63.637,26.613,63.294,26.13,63.346z"/>
36
+ <path fill="#6699CC" d="M24.216,47.162c0.032,0,0.065-0.002,0.099-0.006c0.48-0.055,0.826-0.486,0.772-0.967l-1.294-11.541
37
+ c-0.054-0.48-0.482-0.826-0.967-0.772c-0.48,0.054-0.826,0.487-0.772,0.967l1.294,11.54C23.398,46.832,23.777,47.162,24.216,47.162
38
+ z"/>
39
+ <path fill="#6699CC" d="M43.361,63.348c-0.489-0.058-0.912,0.291-0.967,0.771l-0.326,2.906c-0.055,0.479,0.291,0.912,0.771,0.967
40
+ c0.033,0.004,0.066,0.006,0.1,0.006c0.438,0,0.817-0.33,0.867-0.777l0.326-2.906C44.188,63.834,43.843,63.4,43.361,63.348z"/>
41
+ <path fill="#6699CC" d="M46.668,33.877c-0.486-0.053-0.913,0.292-0.967,0.772l-1.297,11.563c-0.055,0.479,0.291,0.913,0.771,0.968
42
+ c0.033,0.004,0.066,0.006,0.099,0.006c0.439,0,0.818-0.33,0.869-0.777l1.297-11.563C47.494,34.364,47.148,33.931,46.668,33.877z"/>
43
+ <path fill="#6699CC" d="M34.553,63.373c-0.483,0-0.875,0.393-0.875,0.875v2.875c0,0.482,0.392,0.875,0.875,0.875
44
+ c0.483,0,0.875-0.393,0.875-0.875v-2.875C35.428,63.766,35.037,63.373,34.553,63.373z"/>
45
+ <path fill="#6699CC" d="M34.553,37.435c0.483,0,0.875-0.392,0.875-0.875v-1.813c0-0.483-0.392-0.875-0.875-0.875
46
+ c-0.483,0-0.875,0.392-0.875,0.875v1.813C33.678,37.043,34.07,37.435,34.553,37.435z"/>
47
+ </g>
48
+ </svg>
admin/js/litespeed-cache-admin.js CHANGED
@@ -88,6 +88,7 @@ var _litespeed_dots ;
88
  $('[data-litespeed-tab]').click(function(event) {
89
  litespeed_display_tab($(this).data('litespeed-tab')) ;
90
  document.cookie = 'litespeed_tab='+$(this).data('litespeed-tab') ;
 
91
  }) ;
92
  }
93
 
@@ -159,18 +160,38 @@ var _litespeed_dots ;
159
  $(document).on('click', '.lscwp-notice-ruleconflict .notice-dismiss', function () {
160
  $.get(litespeed_data.ajax_url_dismiss_ruleconflict) ;
161
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  }) ;
163
  })(jQuery) ;
164
 
165
-
 
 
 
 
 
166
 
167
  function litespeed_display_tab(tab) {
168
  // setting page -> display submit button
169
  if ( jQuery('#litespeed-submit').length > 0 ){
170
  jQuery('#litespeed-submit').toggle(tab != 'compatibilities') ;
171
  }
172
- jQuery('[data-litespeed-tab]').removeClass('nav-tab-active') ;
173
- jQuery('[data-litespeed-tab="'+tab+'"]').addClass('nav-tab-active') ;
174
  jQuery('[data-litespeed-layout]').hide() ;
175
  jQuery('[data-litespeed-layout="'+tab+'"]').show() ;
176
  }
88
  $('[data-litespeed-tab]').click(function(event) {
89
  litespeed_display_tab($(this).data('litespeed-tab')) ;
90
  document.cookie = 'litespeed_tab='+$(this).data('litespeed-tab') ;
91
+ $(this).blur() ;
92
  }) ;
93
  }
94
 
160
  $(document).on('click', '.lscwp-notice-ruleconflict .notice-dismiss', function () {
161
  $.get(litespeed_data.ajax_url_dismiss_ruleconflict) ;
162
  });
163
+
164
+ /** Accesskey **/
165
+ $( '[litespeed-accesskey]' ).map( function() {
166
+ var thiskey = $( this ).attr( 'litespeed-accesskey' ) ;
167
+ $( this ).attr( 'title', 'Shortcut : ' + thiskey.toLocaleUpperCase() ) ;
168
+ var that = this ;
169
+ $( document ).on( 'keydown', function( e ) {
170
+ if( $(":input:focus").length > 0 ) return ;
171
+ if( event.metaKey ) return ;
172
+ if( event.ctrlKey ) return ;
173
+ if( event.altKey ) return ;
174
+ if( event.shiftKey ) return ;
175
+ if( litespeed_keycode( thiskey.charCodeAt( 0 ) ) ) $( that )[ 0 ].click() ;
176
+ });
177
+ });
178
  }) ;
179
  })(jQuery) ;
180
 
181
+ function litespeed_keycode( num ) {
182
+ var num = num || 13 ;
183
+ var code = window.event ? event.keyCode : event.which ;
184
+ if( num == code ) return true ;
185
+ return false ;
186
+ }
187
 
188
  function litespeed_display_tab(tab) {
189
  // setting page -> display submit button
190
  if ( jQuery('#litespeed-submit').length > 0 ){
191
  jQuery('#litespeed-submit').toggle(tab != 'compatibilities') ;
192
  }
193
+ jQuery('[data-litespeed-tab]').removeClass('litespeed-tab-active') ;
194
+ jQuery('[data-litespeed-tab="'+tab+'"]').addClass('litespeed-tab-active') ;
195
  jQuery('[data-litespeed-layout]').hide() ;
196
  jQuery('[data-litespeed-layout="'+tab+'"]').show() ;
197
  }
admin/litespeed-cache-admin-display.class.php CHANGED
@@ -31,6 +31,7 @@ class LiteSpeed_Cache_Admin_Display
31
  const RULECONFLICT_ON = 'ExpiresDefault_1' ;
32
  const RULECONFLICT_DISMISSED = 'ExpiresDefault_0' ;
33
 
 
34
  private $messages = array() ;
35
  private $disable_all = false ;
36
  private $default_settings = array() ;
@@ -78,8 +79,10 @@ class LiteSpeed_Cache_Admin_Display
78
  add_action('admin_menu', array($this, 'register_admin_menu')) ;
79
  }
80
 
 
 
81
  // get default setting values
82
- $this->default_settings = LiteSpeed_Cache_Config::get_instance()->get_default_options() ;
83
  }
84
 
85
  /**
@@ -182,7 +185,7 @@ class LiteSpeed_Cache_Admin_Display
182
  */
183
  public function enqueue_style()
184
  {
185
- wp_enqueue_style(LiteSpeed_Cache::PLUGIN_NAME, plugin_dir_url(__FILE__) . 'css/litespeed-cache-admin.css', array(), LiteSpeed_Cache::PLUGIN_VERSION, 'all') ;
186
  }
187
 
188
  /**
@@ -293,9 +296,10 @@ class LiteSpeed_Cache_Admin_Display
293
  * @access public
294
  * @param string $action The LSCWP_CTRL action to do in the url.
295
  * @param string $ajax_action AJAX call's action
 
296
  * @return string The built url.
297
  */
298
- public static function build_url($action, $ajax_action = false)
299
  {
300
  global $pagenow ;
301
  $prefix = '?' ;
@@ -328,6 +332,10 @@ class LiteSpeed_Cache_Admin_Display
328
  }
329
  $url = wp_nonce_url($prenonce, $action, LiteSpeed_Cache::NONCE_NAME) ;
330
 
 
 
 
 
331
  return $url ;
332
  }
333
 
@@ -724,7 +732,7 @@ class LiteSpeed_Cache_Admin_Display
724
  }
725
 
726
  if ( $type == 'text' ) {
727
- $style = "regular-text $style" ;
728
  }
729
 
730
  echo "<input type='$type' class='$style' name='" . LiteSpeed_Cache_Config::OPTION_NAME . "[$id]' value='" . esc_textarea( $val ) ."' $disabled $readonly $id_attr $attrs /> " ;
@@ -745,12 +753,10 @@ class LiteSpeed_Cache_Admin_Display
745
  {
746
  $id_attr_on = $id_attr === null ? null : $id_attr . '_' . LiteSpeed_Cache_Config::VAL_ON ;
747
  $id_attr_off = $id_attr === null ? null : $id_attr . '_' . LiteSpeed_Cache_Config::VAL_OFF ;
748
- $html = '<div class="litespeed-row">
749
- <div class="litespeed-switch litespeed-label-info">' ;
750
- $html .= $this->build_radio($id, LiteSpeed_Cache_Config::VAL_ON, null, $checked, $disabled, $id_attr_on) ;
751
  $html .= $this->build_radio($id, LiteSpeed_Cache_Config::VAL_OFF, null, $checked === null ? null : !$checked, $disabled, $id_attr_off) ;
752
- $html .= ' </div>
753
- </div>' ;
754
 
755
  if ( $return ) {
756
  return $html ;
@@ -774,9 +780,9 @@ class LiteSpeed_Cache_Admin_Display
774
  $checked = $checked ? ' checked ' : '' ;
775
  $is_mini = $is_mini ? ' litespeed-mini ' : '' ;
776
 
777
- echo "<div class='litespeed-radio $is_mini'>
778
- <input type='checkbox' name='" . LiteSpeed_Cache_Config::OPTION_NAME . "[$id]' id='conf_$id' value='1' $checked />
779
  <label for='conf_$id'>$title</label>
 
780
  </div>" ;
781
  }
782
 
@@ -795,7 +801,10 @@ class LiteSpeed_Cache_Admin_Display
795
  {
796
  if ( $checked === null ) {
797
  global $_options ;
798
- $to_be_checked = is_int($val) ? (int)$_options[$id] : $_options[$id] ;
 
 
 
799
 
800
  $checked = $to_be_checked === $val ? true : false ;
801
  }
@@ -809,11 +818,11 @@ class LiteSpeed_Cache_Admin_Display
809
 
810
  if ( $txt === null ){
811
  if ( $val === LiteSpeed_Cache_Config::VAL_ON ){
812
- $txt = __('Enable', 'litespeed-cache') ;
813
  }
814
 
815
  if ( $val === LiteSpeed_Cache_Config::VAL_OFF ){
816
- $txt = __('Disable', 'litespeed-cache') ;
817
  }
818
  }
819
 
@@ -840,7 +849,13 @@ class LiteSpeed_Cache_Admin_Display
840
  public function recommended($id) {
841
  $val = isset($this->default_settings[$id]) ? $this->default_settings[$id] : '' ;
842
  if ( $val ) {
843
- echo sprintf(__('Recommended value: %s.', 'litespeed-cache'), $val) ;
 
 
 
 
 
 
844
  }
845
  }
846
 
@@ -853,9 +868,8 @@ class LiteSpeed_Cache_Admin_Display
853
  */
854
  public static function get_instance()
855
  {
856
- $cls = get_called_class() ;
857
  if ( ! isset(self::$_instance) ) {
858
- self::$_instance = new $cls() ;
859
  }
860
 
861
  return self::$_instance ;
31
  const RULECONFLICT_ON = 'ExpiresDefault_1' ;
32
  const RULECONFLICT_DISMISSED = 'ExpiresDefault_0' ;
33
 
34
+ private $config ;
35
  private $messages = array() ;
36
  private $disable_all = false ;
37
  private $default_settings = array() ;
79
  add_action('admin_menu', array($this, 'register_admin_menu')) ;
80
  }
81
 
82
+ $this->config = LiteSpeed_Cache_Config::get_instance() ;
83
+
84
  // get default setting values
85
+ $this->default_settings = $this->config->get_default_options() ;
86
  }
87
 
88
  /**
185
  */
186
  public function enqueue_style()
187
  {
188
+ wp_enqueue_style(LiteSpeed_Cache::PLUGIN_NAME, plugin_dir_url(__FILE__) . 'css/litespeed.css', array(), LiteSpeed_Cache::PLUGIN_VERSION, 'all') ;
189
  }
190
 
191
  /**
296
  * @access public
297
  * @param string $action The LSCWP_CTRL action to do in the url.
298
  * @param string $ajax_action AJAX call's action
299
+ * @param string $append_str The appending string to url
300
  * @return string The built url.
301
  */
302
+ public static function build_url($action, $ajax_action = false, $append_str = false)
303
  {
304
  global $pagenow ;
305
  $prefix = '?' ;
332
  }
333
  $url = wp_nonce_url($prenonce, $action, LiteSpeed_Cache::NONCE_NAME) ;
334
 
335
+ if ( $append_str ) {
336
+ $url .= '&' . $append_str ;
337
+ }
338
+
339
  return $url ;
340
  }
341
 
732
  }
733
 
734
  if ( $type == 'text' ) {
735
+ $style = "litespeed-regular-text $style" ;
736
  }
737
 
738
  echo "<input type='$type' class='$style' name='" . LiteSpeed_Cache_Config::OPTION_NAME . "[$id]' value='" . esc_textarea( $val ) ."' $disabled $readonly $id_attr $attrs /> " ;
753
  {
754
  $id_attr_on = $id_attr === null ? null : $id_attr . '_' . LiteSpeed_Cache_Config::VAL_ON ;
755
  $id_attr_off = $id_attr === null ? null : $id_attr . '_' . LiteSpeed_Cache_Config::VAL_OFF ;
756
+ $html = '<div class="litespeed-switch">' ;
 
 
757
  $html .= $this->build_radio($id, LiteSpeed_Cache_Config::VAL_OFF, null, $checked === null ? null : !$checked, $disabled, $id_attr_off) ;
758
+ $html .= $this->build_radio($id, LiteSpeed_Cache_Config::VAL_ON, null, $checked, $disabled, $id_attr_on) ;
759
+ $html .= '</div>' ;
760
 
761
  if ( $return ) {
762
  return $html ;
780
  $checked = $checked ? ' checked ' : '' ;
781
  $is_mini = $is_mini ? ' litespeed-mini ' : '' ;
782
 
783
+ echo "<div class='litespeed-tick $is_mini'>
 
784
  <label for='conf_$id'>$title</label>
785
+ <input type='checkbox' name='" . LiteSpeed_Cache_Config::OPTION_NAME . "[$id]' id='conf_$id' value='1' $checked />
786
  </div>" ;
787
  }
788
 
801
  {
802
  if ( $checked === null ) {
803
  global $_options ;
804
+ $to_be_checked = null ;
805
+ if ( isset( $_options[ $id ] ) ) {
806
+ $to_be_checked = is_int( $val ) ? (int)$_options[ $id ] : $_options[ $id ] ;
807
+ }
808
 
809
  $checked = $to_be_checked === $val ? true : false ;
810
  }
818
 
819
  if ( $txt === null ){
820
  if ( $val === LiteSpeed_Cache_Config::VAL_ON ){
821
+ $txt = __( 'ON', 'litespeed-cache' ) ;
822
  }
823
 
824
  if ( $val === LiteSpeed_Cache_Config::VAL_OFF ){
825
+ $txt = __( 'OFF', 'litespeed-cache' ) ;
826
  }
827
  }
828
 
849
  public function recommended($id) {
850
  $val = isset($this->default_settings[$id]) ? $this->default_settings[$id] : '' ;
851
  if ( $val ) {
852
+ if ( ! is_numeric( $val ) && strpos( $val, "\n" ) !== false ) {
853
+ $val = "<textarea readonly rows='5' class='litespeed-left10'>$val</textarea>" ;
854
+ }
855
+ else {
856
+ $val = "<code>$val</code>" ;
857
+ }
858
+ echo sprintf( __( 'Recommended value: %s', 'litespeed-cache' ), $val ) ;
859
  }
860
  }
861
 
868
  */
869
  public static function get_instance()
870
  {
 
871
  if ( ! isset(self::$_instance) ) {
872
+ self::$_instance = new self() ;
873
  }
874
 
875
  return self::$_instance ;
admin/litespeed-cache-admin-error.class.php CHANGED
@@ -229,7 +229,7 @@ class LiteSpeed_Cache_Admin_Error
229
 
230
  // wp-config problem.
231
  case self::E_CONF_WRITE:
232
- $err = sprintf(__('The %1$s file not writeable for %2$s', 'litespeed-cache'), 'wp-config', '\'WP_CACHE\'') ;
233
  break ;
234
 
235
  case self::E_CONF_FIND:
@@ -253,9 +253,8 @@ class LiteSpeed_Cache_Admin_Error
253
  */
254
  public static function get_instance()
255
  {
256
- $cls = get_called_class() ;
257
  if ( ! isset(self::$_instance) ) {
258
- self::$_instance = new $cls() ;
259
  }
260
 
261
  return self::$_instance ;
229
 
230
  // wp-config problem.
231
  case self::E_CONF_WRITE:
232
+ $err = sprintf(__('The %1$s file not writable for %2$s', 'litespeed-cache'), 'wp-config', '\'WP_CACHE\'') ;
233
  break ;
234
 
235
  case self::E_CONF_FIND:
253
  */
254
  public static function get_instance()
255
  {
 
256
  if ( ! isset(self::$_instance) ) {
257
+ self::$_instance = new self() ;
258
  }
259
 
260
  return self::$_instance ;
admin/litespeed-cache-admin-optimize.class.php ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The admin optimize tool
4
+ *
5
+ *
6
+ * @since 1.2.1
7
+ * @package LiteSpeed_Cache
8
+ * @subpackage LiteSpeed_Cache/admin
9
+ * @author LiteSpeed Technologies <info@litespeedtech.com>
10
+ */
11
+ class LiteSpeed_Cache_Admin_Optimize
12
+ {
13
+
14
+ const TYPE = 'ls_opt_type' ;
15
+
16
+ private static $_types = array( 'revision', 'auto_draft', 'trash_post', 'spam_comment', 'trash_comment', 'trackback-pingback', 'expired_transient', 'all_transients' ) ;
17
+
18
+ /**
19
+ * Generate operation URL
20
+ *
21
+ * @since 1.2.1
22
+ * @access public
23
+ * @param string $type The type to proceed
24
+ * @return string The final URL
25
+ */
26
+ public static function generate_url( $type )
27
+ {
28
+ $url = LiteSpeed_Cache_Admin_Display::build_url( LiteSpeed_Cache::ACTION_DB_OPTIMIZE, false, self::TYPE . '=' . $type ) ;
29
+ return $url ;
30
+ }
31
+
32
+ /**
33
+ * Run DB Cleaner
34
+ *
35
+ * @since 1.2.1
36
+ * @access public
37
+ */
38
+ public static function run_db_clean()
39
+ {
40
+ if( empty( $_GET[ self::TYPE ] ) ) {
41
+ return ;
42
+ }
43
+
44
+ $res = '' ;
45
+
46
+ if ( is_multisite() && is_network_admin() ) {
47
+ $blogs = LiteSpeed_Cache_Activation::get_network_ids() ;
48
+ foreach ( $blogs as $blog_id ) {
49
+ switch_to_blog( $blog_id ) ;
50
+ $res = self::db_clean( $_GET[ self::TYPE ] ) ;
51
+ restore_current_blog() ;
52
+ }
53
+ }
54
+ else {
55
+ $res = self::db_clean( $_GET[ self::TYPE ] ) ;
56
+ }
57
+
58
+ return $res ;
59
+
60
+ }
61
+
62
+ /**
63
+ * Clean/Optimize WP tables
64
+ *
65
+ * @since 1.2.1
66
+ * @access public
67
+ * @param string $type The type to clean
68
+ * @param bool $ignore_multisite If ignore multisite check
69
+ * @return int The rows that will be affected
70
+ */
71
+ public static function db_count( $type, $ignore_multisite = false )
72
+ {
73
+ if ( $type === 'all' ) {
74
+ $num = 0 ;
75
+ foreach ( self::$_types as $val ) {
76
+ $num += self::db_count( $val ) ;
77
+ }
78
+ return $num ;
79
+ }
80
+
81
+ if ( ! $ignore_multisite ) {
82
+ if ( is_multisite() && is_network_admin() ) {
83
+ $num = 0 ;
84
+ $blogs = LiteSpeed_Cache_Activation::get_network_ids() ;
85
+ foreach ( $blogs as $blog_id ) {
86
+ switch_to_blog( $blog_id ) ;
87
+ $num += self::db_count( $type, true ) ;
88
+ restore_current_blog() ;
89
+ }
90
+ return $num ;
91
+ }
92
+ }
93
+
94
+ global $wpdb ;
95
+
96
+ switch ( $type ) {
97
+ case 'revision':
98
+ return $wpdb->get_var( "SELECT COUNT(*) FROM `$wpdb->posts` WHERE post_type = 'revision'" ) ;
99
+
100
+ case 'auto_draft':
101
+ return $wpdb->get_var( "SELECT COUNT(*) FROM `$wpdb->posts` WHERE post_status = 'auto-draft'" ) ;
102
+
103
+ case 'trash_post':
104
+ return $wpdb->get_var( "SELECT COUNT(*) FROM `$wpdb->posts` WHERE post_status = 'trash'" ) ;
105
+
106
+ case 'spam_comment':
107
+ return $wpdb->get_var( "SELECT COUNT(*) FROM `$wpdb->comments` WHERE comment_approved = 'spam'" ) ;
108
+
109
+ case 'trash_comment':
110
+ return $wpdb->get_var( "SELECT COUNT(*) FROM `$wpdb->comments` WHERE comment_approved = 'trash'" ) ;
111
+
112
+ case 'trackback-pingback':
113
+ return $wpdb->get_var( "SELECT COUNT(*) FROM `$wpdb->comments` WHERE comment_type = 'trackback' OR comment_type = 'pingback'" ) ;
114
+
115
+ case 'expired_transient':
116
+ return $wpdb->get_var( "SELECT COUNT(*) FROM `$wpdb->options` WHERE option_name LIKE '_transient_timeout%' AND option_value < " . time() ) ;
117
+
118
+ case 'all_transients':
119
+ return $wpdb->get_var( "SELECT COUNT(*) FROM `$wpdb->options` WHERE option_name LIKE '%_transient_%'" ) ;
120
+
121
+ case 'optimize_tables':
122
+ return $wpdb->get_var( "SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = '" . DB_NAME . "' and Engine <> 'InnoDB' and data_free > 0" ) ;
123
+ }
124
+ }
125
+
126
+ /**
127
+ * Clean/Optimize WP tables
128
+ *
129
+ * @since 1.2.1
130
+ * @access public
131
+ * @param string $type The type to clean
132
+ */
133
+ public static function db_clean( $type )
134
+ {
135
+ if ( $type === 'all' ) {
136
+ foreach ( self::$_types as $val ) {
137
+ self::db_clean( $val ) ;
138
+ }
139
+ return __( 'Clean all successfully.', 'litespeed-cache' ) ;
140
+ }
141
+
142
+ global $wpdb ;
143
+ switch ( $type ) {
144
+ case 'revision':
145
+ $wpdb->query( "DELETE FROM `$wpdb->posts` WHERE post_type = 'revision'" ) ;
146
+ return __( 'Clean post revisions successfully.', 'litespeed-cache' ) ;
147
+
148
+ case 'auto_draft':
149
+ $wpdb->query( "DELETE FROM `$wpdb->posts` WHERE post_status = 'auto-draft'" ) ;
150
+ return __( 'Clean auto drafts successfully.', 'litespeed-cache' ) ;
151
+
152
+ case 'trash_post':
153
+ $wpdb->query( "DELETE FROM `$wpdb->posts` WHERE post_status = 'trash'" ) ;
154
+ return __( 'Clean trashed posts and pages successfully.', 'litespeed-cache' ) ;
155
+
156
+ case 'spam_comment':
157
+ $wpdb->query( "DELETE FROM `$wpdb->comments` WHERE comment_approved = 'spam'" ) ;
158
+ return __( 'Clean spam comments successfully.', 'litespeed-cache' ) ;
159
+
160
+ case 'trash_comment':
161
+ $wpdb->query( "DELETE FROM `$wpdb->comments` WHERE comment_approved = 'trash'" ) ;
162
+ return __( 'Clean trashed comments successfully.', 'litespeed-cache' ) ;
163
+
164
+ case 'trackback-pingback':
165
+ $wpdb->query( "DELETE FROM `$wpdb->comments` WHERE comment_type = 'trackback' OR comment_type = 'pingback'" ) ;
166
+ return __( 'Clean trackbacks and pingbacks successfully.', 'litespeed-cache' ) ;
167
+
168
+ case 'expired_transient':
169
+ $wpdb->query( "DELETE FROM `$wpdb->options` WHERE option_name LIKE '_transient_timeout%' AND option_value < " . time() ) ;
170
+ return __( 'Clean expired transients successfully.', 'litespeed-cache' ) ;
171
+
172
+ case 'all_transients':
173
+ $wpdb->query( "DELETE FROM `$wpdb->options` WHERE option_name LIKE '%_transient_%'" ) ;
174
+ return __( 'Clean all transients successfully.', 'litespeed-cache' ) ;
175
+
176
+ case 'optimize_tables':
177
+ $sql = "SELECT table_name, data_free FROM information_schema.tables WHERE table_schema = '" . DB_NAME . "' and Engine <> 'InnoDB' and data_free > 0" ;
178
+ $result = $wpdb->get_results( $sql ) ;
179
+ if ( $result ) {
180
+ foreach ( $result as $row ) {
181
+ $wpdb->query( 'OPTIMIZE TABLE ' . $row->table_name ) ;
182
+ }
183
+ }
184
+ return __( 'Optimized all tables.', 'litespeed-cache' ) ;
185
+ }
186
+
187
+ }
188
+ }
admin/litespeed-cache-admin-report.class.php CHANGED
@@ -170,7 +170,7 @@ class LiteSpeed_Cache_Admin_Report
170
  }
171
 
172
  if ( ! is_string($val) ) {
173
- $buf .= print_r($val, true) ;
174
  }
175
  else {
176
  $buf .= $val ;
@@ -188,9 +188,8 @@ class LiteSpeed_Cache_Admin_Report
188
  */
189
  public static function get_instance()
190
  {
191
- $cls = get_called_class() ;
192
  if ( ! isset(self::$_instance) ) {
193
- self::$_instance = new $cls() ;
194
  }
195
 
196
  return self::$_instance ;
170
  }
171
 
172
  if ( ! is_string($val) ) {
173
+ $buf .= var_export($val, true) ;
174
  }
175
  else {
176
  $buf .= $val ;
188
  */
189
  public static function get_instance()
190
  {
 
191
  if ( ! isset(self::$_instance) ) {
192
+ self::$_instance = new self() ;
193
  }
194
 
195
  return self::$_instance ;
admin/litespeed-cache-admin-rules.class.php CHANGED
@@ -28,9 +28,11 @@ class LiteSpeed_Cache_Admin_Rules
28
  const RW_LOOKUP_PUBLIC = "CacheLookup Public on" ;
29
  const RW_LOOKUP_BOTH = "CacheLookup on" ;
30
  const RW_PRIV_BYPASS_POST_PURGE = "RewriteRule .* - [E=Cache-Control:no-autoflush]" ;
 
31
 
32
  const LS_MODULE_START = '<IfModule LiteSpeed>' ;
33
  const LS_MODULE_END = '</IfModule>' ;
 
34
  private static $LS_MODULE_REWRITE_ON ;
35
  const LS_MODULE_DONOTEDIT = "## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##" ;
36
  const MARKER = 'LSCACHE' ;
@@ -40,10 +42,11 @@ class LiteSpeed_Cache_Admin_Rules
40
  const MARKER_NOCACHE_USER_AGENTS = '### marker NOCACHE USER AGENTS' ;
41
  const MARKER_CACHE_RESOURCE = '### marker CACHE RESOURCE' ;
42
  const MARKER_FAVICON = '### marker FAVICON' ;
 
43
  const MARKER_START = ' start ###' ;
44
  const MARKER_END = ' end ###' ;
45
 
46
- const RW_PATTERN_RES = 'wp-content/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php' ;
47
 
48
  /**
49
  * Initialize the class and set its properties.
@@ -70,7 +73,7 @@ class LiteSpeed_Cache_Admin_Rules
70
  else {
71
  self::$RW_LOOKUP = self::RW_LOOKUP_BOTH ;
72
  }
73
- self::$LS_MODULE_REWRITE_ON = "RewriteEngine on\n" . self::$RW_LOOKUP . "\n" . self::RW_PRIV_BYPASS_POST_PURGE ;
74
 
75
  // backend .htaccess privilege
76
  if ( $this->frontend_htaccess === $this->backend_htaccess ) {
@@ -179,14 +182,7 @@ class LiteSpeed_Cache_Admin_Rules
179
  {
180
  $this->theme_htaccess = LSWCP_CONTENT_DIR ;
181
 
182
- $frontend = rtrim( get_home_path(), '/' ) ; // /home/user/public_html/frontend
183
- // get home path failed. Trac ticket #37668 (e.g. frontend:/blog backend:/wordpress)
184
- if ( ! $frontend ) {
185
- $frontend = parse_url( get_option( 'home' ) ) ;
186
- $frontend = ! empty( $frontend[ 'path' ] ) ? $frontend[ 'path' ] : '' ;
187
- $frontend = $_SERVER["DOCUMENT_ROOT"] . $frontend ;
188
- }
189
- $frontend = realpath( $frontend ) ;
190
  $frontend_htaccess_search = $this->htaccess_search( $frontend ) ;// The existing .htaccess path to be used for frontend .htaccess
191
  $this->frontend_htaccess = ( $frontend_htaccess_search ?: $frontend ) . '/.htaccess' ;
192
 
@@ -363,7 +359,7 @@ class LiteSpeed_Cache_Admin_Rules
363
  return false ;
364
  }
365
 
366
- $res = $zip->open($dir . '/lscache_htaccess_bak.zip', ZipArchive::CREATE | ZipArchive::OVERWRITE) ;
367
  if ( $res !== true ) {
368
  error_log('Warning: Failed to archive wordpress backups in ' . $dir) ;
369
  $ret = copy($path, $path . $bak) ;
@@ -486,14 +482,14 @@ class LiteSpeed_Cache_Admin_Rules
486
  public function check_input_for_rewrite($options, $input, &$errors)
487
  {
488
  $diff = array() ;
489
- $val_check = array(
490
  LiteSpeed_Cache_Config::OPID_CACHE_MOBILE,
491
  LiteSpeed_Cache_Config::OPID_CACHE_FAVICON,
492
- LiteSpeed_Cache_Config::OPID_CACHE_RES
493
  ) ;
494
  $has_error = false ;
495
 
496
- foreach ($val_check as $opt) {
497
  $input[$opt] = LiteSpeed_Cache_Admin_Settings::parse_onoff( $input, $opt ) ;
498
  if ( $input[$opt] || $options[$opt] != $input[$opt] ) {
499
  $diff[$opt] = $input[$opt] ;
@@ -661,7 +657,7 @@ class LiteSpeed_Cache_Admin_Rules
661
  $id = LiteSpeed_Cache_Config::OPID_CACHE_RES ;
662
  if ( isset($diff[$id]) && $diff[$id] ) {
663
  $new_rules[] = $new_rules_backend[] = self::MARKER_CACHE_RESOURCE . self::MARKER_START ;
664
- $new_rules[] = $new_rules_backend[] = 'RewriteRule ' . self::RW_PATTERN_RES . ' - [E=cache-control:max-age=3600]' ;
665
  $new_rules[] = $new_rules_backend[] = self::MARKER_CACHE_RESOURCE . self::MARKER_END ;
666
  $new_rules[] = $new_rules_backend[] = '' ;
667
  }
@@ -690,15 +686,6 @@ class LiteSpeed_Cache_Admin_Rules
690
  $new_rules[] = '' ;
691
  }
692
 
693
- // todo: is this still needed?
694
- // if (!is_null($haystack)) {
695
- // if ( LITESPEED_SERVER_TYPE !== 'LITESPEED_SERVER_OLS' ) {
696
- // $haystack = str_replace(self::RW_LOOKUP_PUBLIC,
697
- // self::RW_LOOKUP_BOTH, $haystack) ;
698
- // }
699
- // $beginning .= $haystack ;
700
- // }
701
-
702
  $this->deprecated_clear_rules() ;
703
  if ( ! $this->insert_wrapper($new_rules) ) {
704
  $errors[] = LiteSpeed_Cache_Admin_Display::get_error(LiteSpeed_Cache_Admin_Error::E_HTA_W) ;
@@ -880,9 +867,8 @@ class LiteSpeed_Cache_Admin_Rules
880
  */
881
  public static function get_instance()
882
  {
883
- $cls = get_called_class() ;
884
  if ( ! isset(self::$_instance) ) {
885
- self::$_instance = new $cls() ;
886
  }
887
 
888
  return self::$_instance ;
28
  const RW_LOOKUP_PUBLIC = "CacheLookup Public on" ;
29
  const RW_LOOKUP_BOTH = "CacheLookup on" ;
30
  const RW_PRIV_BYPASS_POST_PURGE = "RewriteRule .* - [E=Cache-Control:no-autoflush]" ;
31
+ const RW_OPTM_NO_VARY = "RewriteRule min/\w+\.(css|js) - [E=cache-control:no-vary]" ;
32
 
33
  const LS_MODULE_START = '<IfModule LiteSpeed>' ;
34
  const LS_MODULE_END = '</IfModule>' ;
35
+ const LS_MODULE_REWRITE_START = '<IfModule mod_rewrite.c>' ;
36
  private static $LS_MODULE_REWRITE_ON ;
37
  const LS_MODULE_DONOTEDIT = "## LITESPEED WP CACHE PLUGIN - Do not edit the contents of this block! ##" ;
38
  const MARKER = 'LSCACHE' ;
42
  const MARKER_NOCACHE_USER_AGENTS = '### marker NOCACHE USER AGENTS' ;
43
  const MARKER_CACHE_RESOURCE = '### marker CACHE RESOURCE' ;
44
  const MARKER_FAVICON = '### marker FAVICON' ;
45
+ const MARKER_MINIFY = '### marker MINIFY' ;
46
  const MARKER_START = ' start ###' ;
47
  const MARKER_END = ' end ###' ;
48
 
49
+ const RW_PATTERN_RES = '/.*/[^/]*(responsive|css|js|dynamic|loader|fonts)\.php' ;
50
 
51
  /**
52
  * Initialize the class and set its properties.
73
  else {
74
  self::$RW_LOOKUP = self::RW_LOOKUP_BOTH ;
75
  }
76
+ self::$LS_MODULE_REWRITE_ON = "RewriteEngine on\n" . self::$RW_LOOKUP . "\n" . self::RW_PRIV_BYPASS_POST_PURGE . "\n" . self::RW_OPTM_NO_VARY ;
77
 
78
  // backend .htaccess privilege
79
  if ( $this->frontend_htaccess === $this->backend_htaccess ) {
182
  {
183
  $this->theme_htaccess = LSWCP_CONTENT_DIR ;
184
 
185
+ $frontend = LiteSpeed_Cache_Router::frontend_path() ;
 
 
 
 
 
 
 
186
  $frontend_htaccess_search = $this->htaccess_search( $frontend ) ;// The existing .htaccess path to be used for frontend .htaccess
187
  $this->frontend_htaccess = ( $frontend_htaccess_search ?: $frontend ) . '/.htaccess' ;
188
 
359
  return false ;
360
  }
361
 
362
+ $res = $zip->open($dir . '/.lscache_htaccess_bak.zip', ZipArchive::CREATE | ZipArchive::OVERWRITE) ;
363
  if ( $res !== true ) {
364
  error_log('Warning: Failed to archive wordpress backups in ' . $dir) ;
365
  $ret = copy($path, $path . $bak) ;
482
  public function check_input_for_rewrite($options, $input, &$errors)
483
  {
484
  $diff = array() ;
485
+ $opts = array(
486
  LiteSpeed_Cache_Config::OPID_CACHE_MOBILE,
487
  LiteSpeed_Cache_Config::OPID_CACHE_FAVICON,
488
+ LiteSpeed_Cache_Config::OPID_CACHE_RES,
489
  ) ;
490
  $has_error = false ;
491
 
492
+ foreach ($opts as $opt) {
493
  $input[$opt] = LiteSpeed_Cache_Admin_Settings::parse_onoff( $input, $opt ) ;
494
  if ( $input[$opt] || $options[$opt] != $input[$opt] ) {
495
  $diff[$opt] = $input[$opt] ;
657
  $id = LiteSpeed_Cache_Config::OPID_CACHE_RES ;
658
  if ( isset($diff[$id]) && $diff[$id] ) {
659
  $new_rules[] = $new_rules_backend[] = self::MARKER_CACHE_RESOURCE . self::MARKER_START ;
660
+ $new_rules[] = $new_rules_backend[] = 'RewriteRule ' . LSWCP_CONTENT_FOLDER . self::RW_PATTERN_RES . ' - [E=cache-control:max-age=3600]' ;
661
  $new_rules[] = $new_rules_backend[] = self::MARKER_CACHE_RESOURCE . self::MARKER_END ;
662
  $new_rules[] = $new_rules_backend[] = '' ;
663
  }
686
  $new_rules[] = '' ;
687
  }
688
 
 
 
 
 
 
 
 
 
 
689
  $this->deprecated_clear_rules() ;
690
  if ( ! $this->insert_wrapper($new_rules) ) {
691
  $errors[] = LiteSpeed_Cache_Admin_Display::get_error(LiteSpeed_Cache_Admin_Error::E_HTA_W) ;
867
  */
868
  public static function get_instance()
869
  {
 
870
  if ( ! isset(self::$_instance) ) {
871
+ self::$_instance = new self() ;
872
  }
873
 
874
  return self::$_instance ;
admin/litespeed-cache-admin-settings.class.php CHANGED
@@ -24,22 +24,22 @@ class LiteSpeed_Cache_Admin_Settings
24
  * @param number $max Maximum number
25
  * @return bool True if valid, false otherwise.
26
  */
27
- public function validate_ttl($input, $id, $min = false, $max = 2147483647)
28
  {
29
- if ( ! isset($input[ $id ]) ) {
30
  return false ;
31
  }
32
 
33
  $val = $input[ $id ] ;
34
 
35
- $ival = intval($val) ;
36
- $sval = strval($val) ;
37
 
38
  if( $min && $ival < $min ) {
39
  return false ;
40
  }
41
 
42
- return ctype_digit($sval) && $ival >= 0 && $ival < $max ;
43
  }
44
 
45
  /**
@@ -51,7 +51,7 @@ class LiteSpeed_Cache_Admin_Settings
51
  * @param string $location The location string.
52
  * @return string the updated location string.
53
  */
54
- public static function widget_save_err($location)
55
  {
56
  return str_replace('?message=0', '?error=0', $location) ;
57
  }
@@ -68,40 +68,40 @@ class LiteSpeed_Cache_Admin_Settings
68
  * @param WP_Widget $widget The widget
69
  * @return mixed Updated settings on success, false on error.
70
  */
71
- public static function validate_widget_save($instance, $new_instance, $old_instance, $widget)
72
  {
73
- if ( empty($_POST[LiteSpeed_Cache_Config::OPTION_NAME]) ) {
74
  return $instance ;
75
  }
76
- $current = ! empty($old_instance[LiteSpeed_Cache_Config::OPTION_NAME]) ? $old_instance[LiteSpeed_Cache_Config::OPTION_NAME] : false ;
77
- $input = $_POST[LiteSpeed_Cache_Config::OPTION_NAME] ;
78
- $esistr = $input[LiteSpeed_Cache_ESI::WIDGET_OPID_ESIENABLE] ;
79
- $ttlstr = $input[LiteSpeed_Cache_ESI::WIDGET_OPID_TTL] ;
80
 
81
- if ( ! is_numeric($ttlstr) || ! is_numeric($esistr) ) {
82
- add_filter('wp_redirect', 'LiteSpeed_Cache_Admin_Settings::widget_save_err') ;
83
  return false ;
84
  }
85
 
86
- $esi = self::is_checked($esistr) ;
87
- $ttl = intval($ttlstr) ;
88
 
89
  if ( $ttl != 0 && $ttl < 30 ) {
90
  add_filter('wp_redirect', 'LiteSpeed_Cache_Admin_Settings::widget_save_err') ;
91
  return false ; // invalid ttl.
92
  }
93
 
94
- if ( empty($instance[LiteSpeed_Cache_Config::OPTION_NAME]) ) {
95
- $instance[LiteSpeed_Cache_Config::OPTION_NAME] = array() ;
96
  }
97
- $instance[LiteSpeed_Cache_Config::OPTION_NAME][LiteSpeed_Cache_ESI::WIDGET_OPID_ESIENABLE] = $esi ;
98
- $instance[LiteSpeed_Cache_Config::OPTION_NAME][LiteSpeed_Cache_ESI::WIDGET_OPID_TTL] = $ttl ;
99
 
100
- if ( ! $current || $esi != $current[LiteSpeed_Cache_ESI::WIDGET_OPID_ESIENABLE] ) {
101
  LiteSpeed_Cache_Purge::purge_all() ;
102
  }
103
- elseif ( $ttl != 0 && $ttl != $current[LiteSpeed_Cache_ESI::WIDGET_OPID_TTL] ) {
104
- LiteSpeed_Cache_Purge::add(LiteSpeed_Cache_Tag::TYPE_WIDGET . $widget->id) ;
105
  }
106
 
107
  LiteSpeed_Cache_Purge::purge_all() ;
@@ -124,13 +124,13 @@ class LiteSpeed_Cache_Admin_Settings
124
 
125
  // enabled setting
126
  $id = LiteSpeed_Cache_Config::OPID_ENABLED_RADIO ;
127
- if( ! isset($input[ $id ]) ) {
128
  $enabled = 0 ;
129
  }
130
  else {
131
- $options[ $id ] = self::is_checked_radio($input[ $id ]) ;
132
 
133
- if( $options[ $id ] !== LiteSpeed_Cache_Config::VAL_NOTSET ){
134
  $enabled = $options[ $id ] ;
135
  }
136
  else{
@@ -147,7 +147,7 @@ class LiteSpeed_Cache_Admin_Settings
147
  $id = LiteSpeed_Cache_Config::OPID_ENABLED ;
148
  if ( $enabled !== $options[ $id ] ) {
149
  $options[ $id ] = $enabled ;
150
- $ret = LiteSpeed_Cache_Config::wp_cache_var_setter($enabled) ;
151
  if ( $ret !== true ) {
152
  $errors[] = $ret ;
153
  }
@@ -164,63 +164,71 @@ class LiteSpeed_Cache_Admin_Settings
164
  }
165
 
166
  $id = LiteSpeed_Cache_Config::OPID_PUBLIC_TTL ;
167
- if ( ! $this->validate_ttl($input, $id, 30) ) {
168
- $errors[] = sprintf($num_err, __('Default Public Cache', 'litespeed-cache'), 30, $max_ttl) ;
 
 
 
 
 
 
 
 
169
  }
170
  else {
171
  $options[ $id ] = $input[ $id ] ;
172
  }
173
 
174
  $id = LiteSpeed_Cache_Config::OPID_FRONT_PAGE_TTL ;
175
- if ( ! $this->validate_ttl($input, $id, 30) ) {
176
- $errors[] = sprintf($num_err, __('Default Front Page', 'litespeed-cache'), 30, $max_ttl) ;
177
  }
178
  else {
179
  $options[ $id ] = $input[ $id ] ;
180
  }
181
 
182
  $id = LiteSpeed_Cache_Config::OPID_FEED_TTL ;
183
- if ( ! $this->validate_ttl($input, $id) ) {
184
- $errors[] = sprintf($num_err, __('Feed', 'litespeed-cache'), 0, $max_ttl) ;
185
  }
186
  elseif ( $input[ $id ] < 30 ) {
187
  $options[ $id ] = 0 ;
188
  }
189
  else {
190
- $options[ $id ] = intval($input[ $id ]) ;
191
  }
192
 
193
  $id = LiteSpeed_Cache_Config::OPID_404_TTL ;
194
- if ( ! $this->validate_ttl($input, $id) ) {
195
- $errors[] = sprintf($num_err, __('404', 'litespeed-cache'), 0, $max_ttl) ;
196
  }
197
  elseif ( $input[ $id ] < 30 ) {
198
  $options[ $id ] = 0 ;
199
  }
200
  else {
201
- $options[ $id ] = intval($input[ $id ]) ;
202
  }
203
 
204
  $id = LiteSpeed_Cache_Config::OPID_403_TTL ;
205
- if ( ! $this->validate_ttl($input, $id) ) {
206
- $errors[] = sprintf($num_err, __('403', 'litespeed-cache'), 0, $max_ttl) ;
207
  }
208
  elseif ( $input[ $id ] < 30 ) {
209
  $options[ $id ] = 0 ;
210
  }
211
  else {
212
- $options[ $id ] = intval($input[ $id ]) ;
213
  }
214
 
215
  $id = LiteSpeed_Cache_Config::OPID_500_TTL ;
216
- if ( ! $this->validate_ttl($input, $id) ) {
217
- $errors[] = sprintf($num_err, __('500', 'litespeed-cache'), 0, $max_ttl) ;
218
  }
219
  elseif ( $input[ $id ] < 30 ) {
220
  $options[ $id ] = 0 ;
221
  }
222
  else {
223
- $options[ $id ] = intval($input[ $id ]) ;
224
  }
225
 
226
  }
@@ -281,7 +289,7 @@ class LiteSpeed_Cache_Admin_Settings
281
  LiteSpeed_Cache_Config::PURGE_POST_TYPE,
282
  ) ;
283
  $input_purge_options = array() ;
284
- foreach ($pvals as $pval) {
285
  $input_name = 'purge_' . $pval ;
286
  if ( self::parse_onoff( $input, $input_name ) ) {
287
  $input_purge_options[] = $pval ;
@@ -325,25 +333,25 @@ class LiteSpeed_Cache_Admin_Settings
325
  * @param array $options The current options.
326
  * @param array $errors The errors list.
327
  */
328
- private function validate_exclude($input, &$options, &$errors)
329
  {
330
  $id = LiteSpeed_Cache_Config::OPID_EXCLUDES_URI ;
331
- if ( isset($input[ $id ]) ) {
332
  $uri_arr = array_map('trim', explode("\n", $input[ $id ])) ;
333
- $options[ $id ] = implode("\n", array_filter($uri_arr)) ;
334
  }
335
 
336
  $id = LiteSpeed_Cache_Config::OPID_EXCLUDES_CAT ;
337
  $options[ $id ] = '' ;
338
- if ( isset($input[ $id ]) ) {
339
  $cat_ids = array() ;
340
  $cats = explode("\n", $input[ $id ]) ;
341
- foreach ($cats as $cat) {
342
- $cat_name = trim($cat) ;
343
  if ( $cat_name == '' ) {
344
  continue ;
345
  }
346
- $cat_id = get_cat_ID($cat_name) ;
347
  if ( $cat_id == 0 ) {
348
  $errors[] = LiteSpeed_Cache_Admin_Display::get_error(LiteSpeed_Cache_Admin_Error::E_SETTING_CAT, $cat_name) ;
349
  }
@@ -351,18 +359,18 @@ class LiteSpeed_Cache_Admin_Settings
351
  $cat_ids[] = $cat_id ;
352
  }
353
  }
354
- if ( ! empty($cat_ids) ) {
355
  $options[ $id ] = implode(',', $cat_ids) ;
356
  }
357
  }
358
 
359
  $id = LiteSpeed_Cache_Config::OPID_EXCLUDES_TAG ;
360
  $options[ $id ] = '' ;
361
- if ( isset($input[ $id ]) ) {
362
  $tag_ids = array() ;
363
  $tags = explode("\n", $input[ $id ]) ;
364
- foreach ($tags as $tag) {
365
- $tag_name = trim($tag) ;
366
  if ( $tag_name == '' ) {
367
  continue ;
368
  }
@@ -374,12 +382,97 @@ class LiteSpeed_Cache_Admin_Settings
374
  $tag_ids[] = $term->term_id ;
375
  }
376
  }
377
- if ( ! empty($tag_ids) ) {
378
  $options[ $id ] = implode(',', $tag_ids) ;
379
  }
380
  }
381
  }
382
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
383
  /**
384
  * Validates the single site specific settings.
385
  *
@@ -389,27 +482,27 @@ class LiteSpeed_Cache_Admin_Settings
389
  * @param array $options The current options.
390
  * @param array $errors The errors list.
391
  */
392
- private function validate_singlesite($input, &$options, &$errors)
393
  {
394
  $rules = LiteSpeed_Cache_Admin_Rules::get_instance() ;
395
 
396
  $id = LiteSpeed_Cache_Config::OPID_ENABLED ;
397
  if ( $input[ $id ] !== 'changed' ) {
398
- $diff = $rules->check_input_for_rewrite($options, $input, $errors) ;
399
  }
400
  elseif ( $options[ $id ] ) {
401
  $reset = LiteSpeed_Cache_Config::get_rule_reset_options() ;
402
- $added_and_changed = $rules->check_input_for_rewrite($reset, $input, $errors) ;
403
  // Merge to include the newly disabled options
404
- $diff = array_merge($reset, $added_and_changed) ;
405
  }
406
  else {
407
  $rules->clear_rules() ;
408
- $diff = $rules->check_input_for_rewrite($options, $input, $errors) ;
409
  }
410
 
411
- if ( ! empty($diff) && ($options[ $id ] == false || $rules->validate_common_rewrites($diff, $errors) !== false) ) {//todo: check if need to use ===
412
- $options = array_merge($options, $diff) ;
413
  }
414
 
415
  $id = LiteSpeed_Cache_Config::OPID_CHECK_ADVANCEDCACHE ;
@@ -425,18 +518,18 @@ class LiteSpeed_Cache_Admin_Settings
425
  * @param array $options The current options.
426
  * @param array $errors The errors list.
427
  */
428
- private function validate_debug($input, &$options, &$errors)
429
  {
430
  $num_err = LiteSpeed_Cache_Admin_Display::get_error(LiteSpeed_Cache_Admin_Error::E_SETTING_NUMERIC) ;
431
 
432
  $id = LiteSpeed_Cache_Config::OPID_ADMIN_IPS ;
433
- if ( isset($input[ $id ]) ) {
434
- $admin_ips = array_map('trim', explode("\n", trim($input[ $id ]))) ;
435
- $admin_ips = array_filter($admin_ips) ;
436
  $has_err = false ;
437
  if ( $admin_ips ) {
438
- foreach ($admin_ips as $ip) {
439
- if ( ! WP_Http::is_ip_address($ip) ) {
440
  $has_err = true ;
441
  break ;
442
  }
@@ -453,14 +546,14 @@ class LiteSpeed_Cache_Admin_Settings
453
  }
454
 
455
  $id = LiteSpeed_Cache_Config::OPID_TEST_IPS ;
456
- if ( isset($input[ $id ]) ) {
457
  // this feature has not implemented yet
458
- $test_ips = array_map('trim', explode("\n", trim($input[ $id ]))) ;
459
- $test_ips = array_filter($test_ips) ;
460
  $has_err = false ;
461
  if ( $test_ips ) {
462
- foreach ($test_ips as $ip) {
463
- if ( ! WP_Http::is_ip_address($ip) ) {
464
  $has_err = true ;
465
  break ;
466
  }
@@ -477,7 +570,7 @@ class LiteSpeed_Cache_Admin_Settings
477
  }
478
 
479
  $id = LiteSpeed_Cache_Config::OPID_DEBUG ;
480
- $debug_level = self::is_checked_radio($input[ $id ]) ;
481
  if ( $debug_level != $options[ $id ] ){
482
  $options[ $id ] = $debug_level ;
483
  }
@@ -530,7 +623,7 @@ class LiteSpeed_Cache_Admin_Settings
530
  * @param array $options The current options.
531
  * @param array $errors The errors list.
532
  */
533
- private function validate_crawler($input, &$options, &$errors)
534
  {
535
  $num_err = LiteSpeed_Cache_Admin_Display::get_error(LiteSpeed_Cache_Admin_Error::E_SETTING_NUMERIC) ;
536
 
@@ -547,15 +640,15 @@ class LiteSpeed_Cache_Admin_Settings
547
  $options[ $id ] = self::parse_onoff( $input, $id ) ;
548
 
549
  $id = LiteSpeed_Cache_Config::CRWL_EXCLUDES_CPT ;
550
- if ( isset($input[ $id ]) ) {
551
  $arr = array_map('trim', explode("\n", $input[ $id ])) ;
552
- $arr = array_filter($arr) ;
553
  $ori = array_diff(get_post_types( '', 'names' ), array('post', 'page')) ;
554
- $options[ $id ] = implode("\n", array_intersect($arr, $ori)) ;
555
  }
556
 
557
  $id = LiteSpeed_Cache_Config::CRWL_ORDER_LINKS ;
558
- if( ! isset($input[ $id ]) || ! in_array($input[ $id ], array(
559
  LiteSpeed_Cache_Config::CRWL_DATE_DESC,
560
  LiteSpeed_Cache_Config::CRWL_DATE_ASC,
561
  LiteSpeed_Cache_Config::CRWL_ALPHA_DESC,
@@ -566,40 +659,40 @@ class LiteSpeed_Cache_Admin_Settings
566
  $options[ $id ] = $input[ $id ] ;
567
 
568
  $id = LiteSpeed_Cache_Config::CRWL_USLEEP ;
569
- if ( ! $this->validate_ttl($input, $id, 0, 30000) ) {
570
- $errors[] = sprintf($num_err, __('Delay', 'litespeed-cache'), 0, 30000) ;
571
  }
572
  else {
573
  $options[ $id ] = $input[ $id ] ;
574
  }
575
 
576
  $id = LiteSpeed_Cache_Config::CRWL_RUN_DURATION ;
577
- if ( ! $this->validate_ttl($input, $id) ) {
578
- $errors[] = sprintf($num_err, __('Run Duration', 'litespeed-cache'), 0, 2147483647) ;
579
  }
580
  else {
581
  $options[ $id ] = $input[ $id ] ;
582
  }
583
 
584
  $id = LiteSpeed_Cache_Config::CRWL_RUN_INTERVAL ;
585
- if ( ! $this->validate_ttl($input, $id, 60) ) {
586
- $errors[] = sprintf($num_err, __('Cron Interval', 'litespeed-cache'), 60, 2147483647) ;
587
  }
588
  else {
589
  $options[ $id ] = $input[ $id ] ;
590
  }
591
 
592
  $id = LiteSpeed_Cache_Config::CRWL_CRAWL_INTERVAL ;
593
- if ( ! $this->validate_ttl($input, $id) ) {
594
- $errors[] = sprintf($num_err, __('Whole Interval', 'litespeed-cache'), 0, 2147483647) ;
595
  }
596
  else {
597
  $options[ $id ] = $input[ $id ] ;
598
  }
599
 
600
  $id = LiteSpeed_Cache_Config::CRWL_THREADS ;
601
- if ( ! $this->validate_ttl($input, $id, 1) ) {
602
- $errors[] = sprintf($num_err, __('Threads', 'litespeed-cache'), 1, 16) ;
603
  }
604
  else {
605
  $options[ $id ] = $input[ $id ] ;
@@ -609,7 +702,7 @@ class LiteSpeed_Cache_Admin_Settings
609
  $options[ $id ] = $input[ $id ] ;
610
 
611
  $id = LiteSpeed_Cache_Config::CRWL_DOMAIN_IP ;
612
- if ( ! empty($input[ $id ]) && ! WP_Http::is_ip_address($input[ $id ]) ) {
613
  $errors[] = LiteSpeed_Cache_Admin_Display::get_error(LiteSpeed_Cache_Admin_Error::E_SETTING_SITE_IP, $input[ $id ]) ;
614
  }
615
  else {
@@ -617,8 +710,8 @@ class LiteSpeed_Cache_Admin_Settings
617
  }
618
 
619
  $id = LiteSpeed_Cache_Config::CRWL_CUSTOM_SITEMAP ;
620
- if ( ! empty($input[ $id ]) && ($err = $this->validate_custom_sitemap($input[ $id ])) !== true ) {
621
- $errors[] = LiteSpeed_Cache_Admin_Display::get_error($err, $input[ $id ]) ;
622
  }
623
  else {
624
  $options[ $id ] = $input[ $id ] ;
@@ -633,9 +726,9 @@ class LiteSpeed_Cache_Admin_Settings
633
  * @access private
634
  * @param string $url The sitemap url
635
  */
636
- private function validate_custom_sitemap($url)
637
  {
638
- return LiteSpeed_Cache_Crawler::get_instance()->parse_custom_sitemap($url, false) ;
639
  }
640
 
641
  /**
@@ -646,19 +739,19 @@ class LiteSpeed_Cache_Admin_Settings
646
  * @param array $input The input options.
647
  * @param array $options The current options.
648
  */
649
- private function validate_thirdparty($input, $options)
650
  {
651
  $tp_default_options = LiteSpeed_Cache_Config::get_instance()->get_thirdparty_options() ;
652
- if ( empty($tp_default_options) ) {
653
  return $options ;
654
  }
655
- $tp_input = array_intersect_key($input, $tp_default_options) ;
656
- if ( empty($tp_input) ) {
657
  return $options ;
658
  }
659
- $tp_options = apply_filters('litespeed_cache_save_options', array_intersect_key($options, $tp_default_options), $tp_input) ;
660
- if ( ! empty($tp_options) && is_array($tp_options) ) {
661
- $options = array_merge($options, $tp_options) ;
662
  }
663
  return $options ;
664
  }
@@ -672,13 +765,23 @@ class LiteSpeed_Cache_Admin_Settings
672
  * @param array $options The current options.
673
  * @param array $errors The errors list.
674
  */
675
- private function validate_esi($input, &$options, &$errors)
676
  {
677
  $id = LiteSpeed_Cache_Config::OPID_ESI_ENABLE ;
678
  $options[ $id ] = self::parse_onoff( $input, $id ) ;
679
 
680
- $id = LiteSpeed_Cache_Config::OPID_ESI_CACHE ;
681
  $options[ $id ] = self::parse_onoff( $input, $id ) ;
 
 
 
 
 
 
 
 
 
 
682
  }
683
 
684
  /**
@@ -693,7 +796,7 @@ class LiteSpeed_Cache_Admin_Settings
693
  * clicking save.
694
  * @return array The updated configuration options.
695
  */
696
- public function validate_plugin_settings($input)
697
  {
698
  LiteSpeed_Cache_Log::debug('settings->validate_plugin_settings called') ;
699
  $options = LiteSpeed_Cache_Config::get_instance()->get_options() ;
@@ -705,29 +808,33 @@ class LiteSpeed_Cache_Admin_Settings
705
  return $options ;
706
  }
707
 
708
- $this->validate_general($input, $options, $errors) ;
 
 
 
 
709
 
710
- $this->validate_cache($input, $options, $errors) ;
711
 
712
- $this->validate_purge($input, $options, $errors) ;
713
 
714
- $this->validate_exclude($input, $options, $errors) ;
715
 
716
- $this->validate_debug($input, $options, $errors) ;
717
 
718
  if ( ! is_multisite() ) {
719
- $this->validate_singlesite($input, $options, $errors) ;
720
  }
721
 
722
  if ( ! is_network_admin() ) {
723
- $this->validate_crawler($input, $options, $errors) ;
724
  }
725
 
726
  if ( LSWCP_ESI_SUPPORT ) {
727
  $orig_enabled = $options[LiteSpeed_Cache_Config::OPID_ENABLED] ;
728
  $orig_esi_enabled = $options[LiteSpeed_Cache_Config::OPID_ESI_ENABLE] ;
729
 
730
- $this->validate_esi($input, $options, $errors) ;
731
 
732
  $new_enabled = $options[LiteSpeed_Cache_Config::OPID_ENABLED] ;
733
  $new_esi_enabled = $options[LiteSpeed_Cache_Config::OPID_ESI_ENABLE] ;
@@ -737,7 +844,7 @@ class LiteSpeed_Cache_Admin_Settings
737
  }
738
  }
739
 
740
- if ( ! empty($errors) ) {
741
  add_settings_error(LiteSpeed_Cache_Config::OPTION_NAME, LiteSpeed_Cache_Config::OPTION_NAME, implode('<br />', $errors)) ;
742
 
743
  return $options ;
@@ -757,10 +864,10 @@ class LiteSpeed_Cache_Admin_Settings
757
 
758
  // check if need to enable crawler cron
759
  if ( $input[LiteSpeed_Cache_Config::OPID_ENABLED] === 'changed' || $cron_changed ) {
760
- LiteSpeed_Cache_Task::update($options) ;
761
  }
762
 
763
- $options = $this->validate_thirdparty($input, $options) ;
764
 
765
  return $options ;
766
  }
@@ -810,23 +917,23 @@ class LiteSpeed_Cache_Admin_Settings
810
  $rules = LiteSpeed_Cache_Admin_Rules::get_instance() ;
811
 
812
  if ( $input[LiteSpeed_Cache_Config::NETWORK_OPID_ENABLED] !== 'changed' ) {
813
- $diff = $rules->check_input_for_rewrite($options, $input, $errors) ;
814
  }
815
  elseif ( $network_enabled ) {
816
- $added_and_changed = $rules->check_input_for_rewrite($reset, $input, $errors) ;
817
  // Merge to include the newly disabled options
818
- $diff = array_merge($reset, $added_and_changed) ;
819
  }
820
  else {
821
- $rules->validate_common_rewrites($reset, $errors) ;
822
- $diff = $rules->check_input_for_rewrite($options, $input, $errors) ;
823
  }
824
 
825
- if ( ! empty($diff) && ($network_enabled === false || $rules->validate_common_rewrites($diff, $errors) !== false) ) {
826
- $options = array_merge($options, $diff) ;
827
  }
828
 
829
- if ( ! empty($errors) ) {
830
  LiteSpeed_Cache_Admin_Display::add_notice(LiteSpeed_Cache_Admin_Display::NOTICE_RED, $errors) ;
831
  return ;
832
  }
@@ -857,9 +964,9 @@ class LiteSpeed_Cache_Admin_Settings
857
  * @param int $val The checkbox value
858
  * @return bool Filtered value
859
  */
860
- public static function is_checked($val)
861
  {
862
- $val = intval($val) ;
863
 
864
  if( $val === LiteSpeed_Cache_Config::VAL_ON ){
865
  return true ;
@@ -876,16 +983,16 @@ class LiteSpeed_Cache_Admin_Settings
876
  * @param int $val The radio value
877
  * @return int Filtered value
878
  */
879
- public static function is_checked_radio($val)
880
  {
881
- $val = intval($val) ;
882
 
883
  if( $val === LiteSpeed_Cache_Config::VAL_ON ){
884
  return LiteSpeed_Cache_Config::VAL_ON ;
885
  }
886
 
887
- if( $val === LiteSpeed_Cache_Config::VAL_NOTSET ){
888
- return LiteSpeed_Cache_Config::VAL_NOTSET ;
889
  }
890
 
891
  return LiteSpeed_Cache_Config::VAL_OFF ;
@@ -900,9 +1007,8 @@ class LiteSpeed_Cache_Admin_Settings
900
  */
901
  public static function get_instance()
902
  {
903
- $cls = get_called_class() ;
904
  if ( ! isset(self::$_instance) ) {
905
- self::$_instance = new $cls() ;
906
  }
907
 
908
  return self::$_instance ;
24
  * @param number $max Maximum number
25
  * @return bool True if valid, false otherwise.
26
  */
27
+ public function validate_ttl( $input, $id, $min = false, $max = 2147483647)
28
  {
29
+ if ( ! isset( $input[ $id ]) ) {
30
  return false ;
31
  }
32
 
33
  $val = $input[ $id ] ;
34
 
35
+ $ival = intval( $val) ;
36
+ $sval = strval( $val) ;
37
 
38
  if( $min && $ival < $min ) {
39
  return false ;
40
  }
41
 
42
+ return ctype_digit( $sval) && $ival >= 0 && $ival < $max ;
43
  }
44
 
45
  /**
51
  * @param string $location The location string.
52
  * @return string the updated location string.
53
  */
54
+ public static function widget_save_err( $location)
55
  {
56
  return str_replace('?message=0', '?error=0', $location) ;
57
  }
68
  * @param WP_Widget $widget The widget
69
  * @return mixed Updated settings on success, false on error.
70
  */
71
+ public static function validate_widget_save( $instance, $new_instance, $old_instance, $widget)
72
  {
73
+ if ( empty( $_POST[ LiteSpeed_Cache_Config::OPTION_NAME ] ) ) {
74
  return $instance ;
75
  }
76
+ $current = ! empty( $old_instance[ LiteSpeed_Cache_Config::OPTION_NAME ] ) ? $old_instance[ LiteSpeed_Cache_Config::OPTION_NAME ] : false ;
77
+ $input = $_POST[ LiteSpeed_Cache_Config::OPTION_NAME ] ;
78
+ $esistr = $input[ LiteSpeed_Cache_ESI::WIDGET_OPID_ESIENABLE ] ;
79
+ $ttlstr = $input[ LiteSpeed_Cache_ESI::WIDGET_OPID_TTL ] ;
80
 
81
+ if ( ! is_numeric( $ttlstr ) || ! is_numeric( $esistr ) ) {
82
+ add_filter( 'wp_redirect', 'LiteSpeed_Cache_Admin_Settings::widget_save_err' ) ;
83
  return false ;
84
  }
85
 
86
+ $esi = self::is_checked_radio( $esistr) ;
87
+ $ttl = intval( $ttlstr) ;
88
 
89
  if ( $ttl != 0 && $ttl < 30 ) {
90
  add_filter('wp_redirect', 'LiteSpeed_Cache_Admin_Settings::widget_save_err') ;
91
  return false ; // invalid ttl.
92
  }
93
 
94
+ if ( empty( $instance[ LiteSpeed_Cache_Config::OPTION_NAME ] ) ) {
95
+ $instance[ LiteSpeed_Cache_Config::OPTION_NAME ] = array() ;
96
  }
97
+ $instance[ LiteSpeed_Cache_Config::OPTION_NAME ][ LiteSpeed_Cache_ESI::WIDGET_OPID_ESIENABLE ] = $esi ;
98
+ $instance[ LiteSpeed_Cache_Config::OPTION_NAME ][ LiteSpeed_Cache_ESI::WIDGET_OPID_TTL ] = $ttl ;
99
 
100
+ if ( ! $current || $esi != $current[ LiteSpeed_Cache_ESI::WIDGET_OPID_ESIENABLE ] ) {
101
  LiteSpeed_Cache_Purge::purge_all() ;
102
  }
103
+ elseif ( $ttl != 0 && $ttl != $current[ LiteSpeed_Cache_ESI::WIDGET_OPID_TTL ] ) {
104
+ LiteSpeed_Cache_Purge::add( LiteSpeed_Cache_Tag::TYPE_WIDGET . $widget->id ) ;
105
  }
106
 
107
  LiteSpeed_Cache_Purge::purge_all() ;
124
 
125
  // enabled setting
126
  $id = LiteSpeed_Cache_Config::OPID_ENABLED_RADIO ;
127
+ if( ! isset( $input[ $id ]) ) {
128
  $enabled = 0 ;
129
  }
130
  else {
131
+ $options[ $id ] = self::is_checked_radio( $input[ $id ]) ;
132
 
133
+ if( $options[ $id ] !== LiteSpeed_Cache_Config::VAL_ON2 ){
134
  $enabled = $options[ $id ] ;
135
  }
136
  else{
147
  $id = LiteSpeed_Cache_Config::OPID_ENABLED ;
148
  if ( $enabled !== $options[ $id ] ) {
149
  $options[ $id ] = $enabled ;
150
+ $ret = LiteSpeed_Cache_Config::wp_cache_var_setter( $enabled) ;
151
  if ( $ret !== true ) {
152
  $errors[] = $ret ;
153
  }
164
  }
165
 
166
  $id = LiteSpeed_Cache_Config::OPID_PUBLIC_TTL ;
167
+ if ( ! $this->validate_ttl( $input, $id, 30 ) ) {
168
+ $errors[] = sprintf( $num_err, __( 'Default Public Cache', 'litespeed-cache' ), 30, $max_ttl ) ;
169
+ }
170
+ else {
171
+ $options[ $id ] = $input[ $id ] ;
172
+ }
173
+
174
+ $id = LiteSpeed_Cache_Config::OPID_PRIVATE_TTL ;
175
+ if ( ! $this->validate_ttl( $input, $id, 60, 3600 ) ) {
176
+ $errors[] = sprintf( $num_err, __( 'Default Private Cache', 'litespeed-cache' ), 60, 3600 ) ;
177
  }
178
  else {
179
  $options[ $id ] = $input[ $id ] ;
180
  }
181
 
182
  $id = LiteSpeed_Cache_Config::OPID_FRONT_PAGE_TTL ;
183
+ if ( ! $this->validate_ttl( $input, $id, 30) ) {
184
+ $errors[] = sprintf( $num_err, __('Default Front Page', 'litespeed-cache'), 30, $max_ttl) ;
185
  }
186
  else {
187
  $options[ $id ] = $input[ $id ] ;
188
  }
189
 
190
  $id = LiteSpeed_Cache_Config::OPID_FEED_TTL ;
191
+ if ( ! $this->validate_ttl( $input, $id) ) {
192
+ $errors[] = sprintf( $num_err, __('Feed', 'litespeed-cache'), 0, $max_ttl) ;
193
  }
194
  elseif ( $input[ $id ] < 30 ) {
195
  $options[ $id ] = 0 ;
196
  }
197
  else {
198
+ $options[ $id ] = intval( $input[ $id ]) ;
199
  }
200
 
201
  $id = LiteSpeed_Cache_Config::OPID_404_TTL ;
202
+ if ( ! $this->validate_ttl( $input, $id) ) {
203
+ $errors[] = sprintf( $num_err, __('404', 'litespeed-cache'), 0, $max_ttl) ;
204
  }
205
  elseif ( $input[ $id ] < 30 ) {
206
  $options[ $id ] = 0 ;
207
  }
208
  else {
209
+ $options[ $id ] = intval( $input[ $id ]) ;
210
  }
211
 
212
  $id = LiteSpeed_Cache_Config::OPID_403_TTL ;
213
+ if ( ! $this->validate_ttl( $input, $id) ) {
214
+ $errors[] = sprintf( $num_err, __('403', 'litespeed-cache'), 0, $max_ttl) ;
215
  }
216
  elseif ( $input[ $id ] < 30 ) {
217
  $options[ $id ] = 0 ;
218
  }
219
  else {
220
+ $options[ $id ] = intval( $input[ $id ]) ;
221
  }
222
 
223
  $id = LiteSpeed_Cache_Config::OPID_500_TTL ;
224
+ if ( ! $this->validate_ttl( $input, $id) ) {
225
+ $errors[] = sprintf( $num_err, __('500', 'litespeed-cache'), 0, $max_ttl) ;
226
  }
227
  elseif ( $input[ $id ] < 30 ) {
228
  $options[ $id ] = 0 ;
229
  }
230
  else {
231
+ $options[ $id ] = intval( $input[ $id ]) ;
232
  }
233
 
234
  }
289
  LiteSpeed_Cache_Config::PURGE_POST_TYPE,
290
  ) ;
291
  $input_purge_options = array() ;
292
+ foreach ( $pvals as $pval) {
293
  $input_name = 'purge_' . $pval ;
294
  if ( self::parse_onoff( $input, $input_name ) ) {
295
  $input_purge_options[] = $pval ;
333
  * @param array $options The current options.
334
  * @param array $errors The errors list.
335
  */
336
+ private function validate_exclude( $input, &$options, &$errors)
337
  {
338
  $id = LiteSpeed_Cache_Config::OPID_EXCLUDES_URI ;
339
+ if ( isset( $input[ $id ]) ) {
340
  $uri_arr = array_map('trim', explode("\n", $input[ $id ])) ;
341
+ $options[ $id ] = implode("\n", array_filter( $uri_arr)) ;
342
  }
343
 
344
  $id = LiteSpeed_Cache_Config::OPID_EXCLUDES_CAT ;
345
  $options[ $id ] = '' ;
346
+ if ( isset( $input[ $id ]) ) {
347
  $cat_ids = array() ;
348
  $cats = explode("\n", $input[ $id ]) ;
349
+ foreach ( $cats as $cat) {
350
+ $cat_name = trim( $cat) ;
351
  if ( $cat_name == '' ) {
352
  continue ;
353
  }
354
+ $cat_id = get_cat_ID( $cat_name) ;
355
  if ( $cat_id == 0 ) {
356
  $errors[] = LiteSpeed_Cache_Admin_Display::get_error(LiteSpeed_Cache_Admin_Error::E_SETTING_CAT, $cat_name) ;
357
  }
359
  $cat_ids[] = $cat_id ;
360
  }
361
  }
362
+ if ( ! empty( $cat_ids) ) {
363
  $options[ $id ] = implode(',', $cat_ids) ;
364
  }
365
  }
366
 
367
  $id = LiteSpeed_Cache_Config::OPID_EXCLUDES_TAG ;
368
  $options[ $id ] = '' ;
369
+ if ( isset( $input[ $id ]) ) {
370
  $tag_ids = array() ;
371
  $tags = explode("\n", $input[ $id ]) ;
372
+ foreach ( $tags as $tag) {
373
+ $tag_name = trim( $tag) ;
374
  if ( $tag_name == '' ) {
375
  continue ;
376
  }
382
  $tag_ids[] = $term->term_id ;
383
  }
384
  }
385
+ if ( ! empty( $tag_ids) ) {
386
  $options[ $id ] = implode(',', $tag_ids) ;
387
  }
388
  }
389
  }
390
 
391
+ /**
392
+ * Validates the CDN settings.
393
+ *
394
+ * @since 1.2.2
395
+ * @access private
396
+ */
397
+ private function validate_cdn( $input, &$options, &$errors)
398
+ {
399
+ $ids = array(
400
+ LiteSpeed_Cache_Config::OPID_CDN,
401
+ LiteSpeed_Cache_Config::OPID_CDN_INC_IMG,
402
+ LiteSpeed_Cache_Config::OPID_CDN_INC_CSS,
403
+ LiteSpeed_Cache_Config::OPID_CDN_INC_JS,
404
+ );
405
+ foreach ( $ids as $id ) {
406
+ $options[ $id ] = self::parse_onoff( $input, $id ) ;
407
+ }
408
+
409
+ $id = LiteSpeed_Cache_Config::OPID_CDN_ORI ;
410
+ $options[ $id ] = $input[ $id ] ;
411
+ if ( $options[ $id ] ) {
412
+ $tmp = parse_url( $options[ $id ] ) ;
413
+ if ( ! empty( $tmp[ 'scheme' ] ) ) {
414
+ $options[ $id ] = str_replace( $tmp[ 'scheme' ] . ':', '', $options[ $id ] ) ;
415
+ }
416
+ }
417
+
418
+ $id = LiteSpeed_Cache_Config::OPID_CDN_URL ;
419
+ $options[ $id ] = $input[ $id ] ;
420
+
421
+ $ids = array(
422
+ LiteSpeed_Cache_Config::OPID_CDN_FILETYPE,
423
+ LiteSpeed_Cache_Config::OPID_CDN_EXCLUDE,
424
+ ) ;
425
+ foreach ( $ids as $id ) {
426
+ $options[ $id ] = explode( "\n", $input[ $id ] ) ;
427
+ $options[ $id ] = array_map( 'trim', $options[ $id ] ) ;
428
+ $options[ $id ] = array_unique( $options[ $id ] ) ;
429
+ $options[ $id ] = array_filter( $options[ $id ] ) ;
430
+ $options[ $id ] = implode( "\n", $options[ $id ] ) ;
431
+ }
432
+ }
433
+
434
+
435
+ /**
436
+ * Validates the optimize settings.
437
+ *
438
+ * @since 1.2.2
439
+ * @access private
440
+ */
441
+ private function validate_optimize( $input, &$options, &$errors)
442
+ {
443
+ $ids = array(
444
+ LiteSpeed_Cache_Config::OPID_CSS_MINIFY,
445
+ LiteSpeed_Cache_Config::OPID_CSS_COMBINE,
446
+ LiteSpeed_Cache_Config::OPID_CSS_HTTP2,
447
+ LiteSpeed_Cache_Config::OPID_JS_MINIFY,
448
+ LiteSpeed_Cache_Config::OPID_JS_COMBINE,
449
+ LiteSpeed_Cache_Config::OPID_JS_HTTP2,
450
+ LiteSpeed_Cache_Config::OPID_HTML_MINIFY,
451
+ ) ;
452
+ foreach ( $ids as $id ) {
453
+ $options[ $id ] = self::parse_onoff( $input, $id ) ;
454
+ }
455
+
456
+ $ids = array(
457
+ LiteSpeed_Cache_Config::OPID_CSS_EXCLUDES,
458
+ LiteSpeed_Cache_Config::OPID_JS_EXCLUDES,
459
+ ) ;
460
+ foreach ( $ids as $id ) {
461
+ $options[ $id ] = explode( "\n", $input[ $id ] ) ;
462
+ $options[ $id ] = array_map( 'LiteSpeed_Cache_Utility::url2uri', $options[ $id ] ) ;
463
+ $options[ $id ] = array_unique( $options[ $id ] ) ;
464
+ $options[ $id ] = array_filter( $options[ $id ] ) ;
465
+ $options[ $id ] = implode( "\n", $options[ $id ] ) ;
466
+ }
467
+
468
+ $id = LiteSpeed_Cache_Config::OPID_OPTIMIZE_TTL ;
469
+ if ( ! $this->validate_ttl( $input, $id, 3600 ) ) {
470
+ $input[ $id ] = 3600 ;
471
+ }
472
+ $options[ $id ] = $input[ $id ] ;
473
+
474
+ }
475
+
476
  /**
477
  * Validates the single site specific settings.
478
  *
482
  * @param array $options The current options.
483
  * @param array $errors The errors list.
484
  */
485
+ private function validate_singlesite( $input, &$options, &$errors)
486
  {
487
  $rules = LiteSpeed_Cache_Admin_Rules::get_instance() ;
488
 
489
  $id = LiteSpeed_Cache_Config::OPID_ENABLED ;
490
  if ( $input[ $id ] !== 'changed' ) {
491
+ $diff = $rules->check_input_for_rewrite( $options, $input, $errors) ;
492
  }
493
  elseif ( $options[ $id ] ) {
494
  $reset = LiteSpeed_Cache_Config::get_rule_reset_options() ;
495
+ $added_and_changed = $rules->check_input_for_rewrite( $reset, $input, $errors) ;
496
  // Merge to include the newly disabled options
497
+ $diff = array_merge( $reset, $added_and_changed) ;
498
  }
499
  else {
500
  $rules->clear_rules() ;
501
+ $diff = $rules->check_input_for_rewrite( $options, $input, $errors) ;
502
  }
503
 
504
+ if ( ! empty( $diff) && ( $options[ $id ] == false || $rules->validate_common_rewrites( $diff, $errors) !== false) ) {//todo: check if need to use ===
505
+ $options = array_merge( $options, $diff) ;
506
  }
507
 
508
  $id = LiteSpeed_Cache_Config::OPID_CHECK_ADVANCEDCACHE ;
518
  * @param array $options The current options.
519
  * @param array $errors The errors list.
520
  */
521
+ private function validate_debug( $input, &$options, &$errors)
522
  {
523
  $num_err = LiteSpeed_Cache_Admin_Display::get_error(LiteSpeed_Cache_Admin_Error::E_SETTING_NUMERIC) ;
524
 
525
  $id = LiteSpeed_Cache_Config::OPID_ADMIN_IPS ;
526
+ if ( isset( $input[ $id ]) ) {
527
+ $admin_ips = array_map('trim', explode("\n", trim( $input[ $id ]))) ;
528
+ $admin_ips = array_filter( $admin_ips) ;
529
  $has_err = false ;
530
  if ( $admin_ips ) {
531
+ foreach ( $admin_ips as $ip) {
532
+ if ( ! WP_Http::is_ip_address( $ip) ) {
533
  $has_err = true ;
534
  break ;
535
  }
546
  }
547
 
548
  $id = LiteSpeed_Cache_Config::OPID_TEST_IPS ;
549
+ if ( isset( $input[ $id ]) ) {
550
  // this feature has not implemented yet
551
+ $test_ips = array_map('trim', explode("\n", trim( $input[ $id ]))) ;
552
+ $test_ips = array_filter( $test_ips) ;
553
  $has_err = false ;
554
  if ( $test_ips ) {
555
+ foreach ( $test_ips as $ip) {
556
+ if ( ! WP_Http::is_ip_address( $ip) ) {
557
  $has_err = true ;
558
  break ;
559
  }
570
  }
571
 
572
  $id = LiteSpeed_Cache_Config::OPID_DEBUG ;
573
+ $debug_level = self::is_checked_radio( $input[ $id ]) ;
574
  if ( $debug_level != $options[ $id ] ){
575
  $options[ $id ] = $debug_level ;
576
  }
623
  * @param array $options The current options.
624
  * @param array $errors The errors list.
625
  */
626
+ private function validate_crawler( $input, &$options, &$errors)
627
  {
628
  $num_err = LiteSpeed_Cache_Admin_Display::get_error(LiteSpeed_Cache_Admin_Error::E_SETTING_NUMERIC) ;
629
 
640
  $options[ $id ] = self::parse_onoff( $input, $id ) ;
641
 
642
  $id = LiteSpeed_Cache_Config::CRWL_EXCLUDES_CPT ;
643
+ if ( isset( $input[ $id ]) ) {
644
  $arr = array_map('trim', explode("\n", $input[ $id ])) ;
645
+ $arr = array_filter( $arr) ;
646
  $ori = array_diff(get_post_types( '', 'names' ), array('post', 'page')) ;
647
+ $options[ $id ] = implode("\n", array_intersect( $arr, $ori)) ;
648
  }
649
 
650
  $id = LiteSpeed_Cache_Config::CRWL_ORDER_LINKS ;
651
+ if( ! isset( $input[ $id ]) || ! in_array( $input[ $id ], array(
652
  LiteSpeed_Cache_Config::CRWL_DATE_DESC,
653
  LiteSpeed_Cache_Config::CRWL_DATE_ASC,
654
  LiteSpeed_Cache_Config::CRWL_ALPHA_DESC,
659
  $options[ $id ] = $input[ $id ] ;
660
 
661
  $id = LiteSpeed_Cache_Config::CRWL_USLEEP ;
662
+ if ( ! $this->validate_ttl( $input, $id, 0, 30000) ) {
663
+ $errors[] = sprintf( $num_err, __('Delay', 'litespeed-cache'), 0, 30000) ;
664
  }
665
  else {
666
  $options[ $id ] = $input[ $id ] ;
667
  }
668
 
669
  $id = LiteSpeed_Cache_Config::CRWL_RUN_DURATION ;
670
+ if ( ! $this->validate_ttl( $input, $id) ) {
671
+ $errors[] = sprintf( $num_err, __('Run Duration', 'litespeed-cache'), 0, 2147483647) ;
672
  }
673
  else {
674
  $options[ $id ] = $input[ $id ] ;
675
  }
676
 
677
  $id = LiteSpeed_Cache_Config::CRWL_RUN_INTERVAL ;
678
+ if ( ! $this->validate_ttl( $input, $id, 60) ) {
679
+ $errors[] = sprintf( $num_err, __('Cron Interval', 'litespeed-cache'), 60, 2147483647) ;
680
  }
681
  else {
682
  $options[ $id ] = $input[ $id ] ;
683
  }
684
 
685
  $id = LiteSpeed_Cache_Config::CRWL_CRAWL_INTERVAL ;
686
+ if ( ! $this->validate_ttl( $input, $id) ) {
687
+ $errors[] = sprintf( $num_err, __('Whole Interval', 'litespeed-cache'), 0, 2147483647) ;
688
  }
689
  else {
690
  $options[ $id ] = $input[ $id ] ;
691
  }
692
 
693
  $id = LiteSpeed_Cache_Config::CRWL_THREADS ;
694
+ if ( ! $this->validate_ttl( $input, $id, 1) ) {
695
+ $errors[] = sprintf( $num_err, __('Threads', 'litespeed-cache'), 1, 16) ;
696
  }
697
  else {
698
  $options[ $id ] = $input[ $id ] ;
702
  $options[ $id ] = $input[ $id ] ;
703
 
704
  $id = LiteSpeed_Cache_Config::CRWL_DOMAIN_IP ;
705
+ if ( ! empty( $input[ $id ]) && ! WP_Http::is_ip_address( $input[ $id ]) ) {
706
  $errors[] = LiteSpeed_Cache_Admin_Display::get_error(LiteSpeed_Cache_Admin_Error::E_SETTING_SITE_IP, $input[ $id ]) ;
707
  }
708
  else {
710
  }
711
 
712
  $id = LiteSpeed_Cache_Config::CRWL_CUSTOM_SITEMAP ;
713
+ if ( ! empty( $input[ $id ]) && ( $err = $this->validate_custom_sitemap( $input[ $id ])) !== true ) {
714
+ $errors[] = LiteSpeed_Cache_Admin_Display::get_error( $err, $input[ $id ]) ;
715
  }
716
  else {
717
  $options[ $id ] = $input[ $id ] ;
726
  * @access private
727
  * @param string $url The sitemap url
728
  */
729
+ private function validate_custom_sitemap( $url)
730
  {
731
+ return LiteSpeed_Cache_Crawler::get_instance()->parse_custom_sitemap( $url, false) ;
732
  }
733
 
734
  /**
739
  * @param array $input The input options.
740
  * @param array $options The current options.
741
  */
742
+ private function validate_thirdparty( $input, $options)
743
  {
744
  $tp_default_options = LiteSpeed_Cache_Config::get_instance()->get_thirdparty_options() ;
745
+ if ( empty( $tp_default_options) ) {
746
  return $options ;
747
  }
748
+ $tp_input = array_intersect_key( $input, $tp_default_options) ;
749
+ if ( empty( $tp_input) ) {
750
  return $options ;
751
  }
752
+ $tp_options = apply_filters('litespeed_cache_save_options', array_intersect_key( $options, $tp_default_options), $tp_input) ;
753
+ if ( ! empty( $tp_options) && is_array( $tp_options) ) {
754
+ $options = array_merge( $options, $tp_options) ;
755
  }
756
  return $options ;
757
  }
765
  * @param array $options The current options.
766
  * @param array $errors The errors list.
767
  */
768
+ private function validate_esi( $input, &$options, &$errors)
769
  {
770
  $id = LiteSpeed_Cache_Config::OPID_ESI_ENABLE ;
771
  $options[ $id ] = self::parse_onoff( $input, $id ) ;
772
 
773
+ $id = LiteSpeed_Cache_Config::OPID_ESI_CACHE_ADMBAR ;
774
  $options[ $id ] = self::parse_onoff( $input, $id ) ;
775
+
776
+ $id = LiteSpeed_Cache_Config::OPID_ESI_CACHE_COMMFORM ;
777
+ $options[ $id ] = self::parse_onoff( $input, $id ) ;
778
+
779
+ // Save vary group settings
780
+ $vary_groups = $_POST[ LiteSpeed_Cache_Config::VARY_GROUP ] ;
781
+ $vary_groups = array_map( 'trim', $vary_groups ) ;
782
+ $vary_groups = array_filter( $vary_groups ) ;
783
+ update_option( LiteSpeed_Cache_Config::VARY_GROUP, $vary_groups ) ;
784
+
785
  }
786
 
787
  /**
796
  * clicking save.
797
  * @return array The updated configuration options.
798
  */
799
+ public function validate_plugin_settings( $input)
800
  {
801
  LiteSpeed_Cache_Log::debug('settings->validate_plugin_settings called') ;
802
  $options = LiteSpeed_Cache_Config::get_instance()->get_options() ;
808
  return $options ;
809
  }
810
 
811
+ $this->validate_general( $input, $options, $errors) ;
812
+
813
+ $this->validate_cache( $input, $options, $errors) ;
814
+
815
+ $this->validate_purge( $input, $options, $errors) ;
816
 
817
+ $this->validate_exclude( $input, $options, $errors) ;
818
 
819
+ $this->validate_optimize( $input, $options, $errors) ;
820
 
821
+ $this->validate_cdn( $input, $options, $errors) ;
822
 
823
+ $this->validate_debug( $input, $options, $errors) ;
824
 
825
  if ( ! is_multisite() ) {
826
+ $this->validate_singlesite( $input, $options, $errors) ;
827
  }
828
 
829
  if ( ! is_network_admin() ) {
830
+ $this->validate_crawler( $input, $options, $errors) ;
831
  }
832
 
833
  if ( LSWCP_ESI_SUPPORT ) {
834
  $orig_enabled = $options[LiteSpeed_Cache_Config::OPID_ENABLED] ;
835
  $orig_esi_enabled = $options[LiteSpeed_Cache_Config::OPID_ESI_ENABLE] ;
836
 
837
+ $this->validate_esi( $input, $options, $errors) ;
838
 
839
  $new_enabled = $options[LiteSpeed_Cache_Config::OPID_ENABLED] ;
840
  $new_esi_enabled = $options[LiteSpeed_Cache_Config::OPID_ESI_ENABLE] ;
844
  }
845
  }
846
 
847
+ if ( ! empty( $errors) ) {
848
  add_settings_error(LiteSpeed_Cache_Config::OPTION_NAME, LiteSpeed_Cache_Config::OPTION_NAME, implode('<br />', $errors)) ;
849
 
850
  return $options ;
864
 
865
  // check if need to enable crawler cron
866
  if ( $input[LiteSpeed_Cache_Config::OPID_ENABLED] === 'changed' || $cron_changed ) {
867
+ LiteSpeed_Cache_Task::update( $options) ;
868
  }
869
 
870
+ $options = $this->validate_thirdparty( $input, $options) ;
871
 
872
  return $options ;
873
  }
917
  $rules = LiteSpeed_Cache_Admin_Rules::get_instance() ;
918
 
919
  if ( $input[LiteSpeed_Cache_Config::NETWORK_OPID_ENABLED] !== 'changed' ) {
920
+ $diff = $rules->check_input_for_rewrite( $options, $input, $errors) ;
921
  }
922
  elseif ( $network_enabled ) {
923
+ $added_and_changed = $rules->check_input_for_rewrite( $reset, $input, $errors) ;
924
  // Merge to include the newly disabled options
925
+ $diff = array_merge( $reset, $added_and_changed) ;
926
  }
927
  else {
928
+ $rules->validate_common_rewrites( $reset, $errors) ;
929
+ $diff = $rules->check_input_for_rewrite( $options, $input, $errors) ;
930
  }
931
 
932
+ if ( ! empty( $diff) && ( $network_enabled === false || $rules->validate_common_rewrites( $diff, $errors) !== false) ) {
933
+ $options = array_merge( $options, $diff) ;
934
  }
935
 
936
+ if ( ! empty( $errors) ) {
937
  LiteSpeed_Cache_Admin_Display::add_notice(LiteSpeed_Cache_Admin_Display::NOTICE_RED, $errors) ;
938
  return ;
939
  }
964
  * @param int $val The checkbox value
965
  * @return bool Filtered value
966
  */
967
+ public static function is_checked( $val)
968
  {
969
+ $val = intval( $val) ;
970
 
971
  if( $val === LiteSpeed_Cache_Config::VAL_ON ){
972
  return true ;
983
  * @param int $val The radio value
984
  * @return int Filtered value
985
  */
986
+ public static function is_checked_radio( $val)
987
  {
988
+ $val = intval( $val) ;
989
 
990
  if( $val === LiteSpeed_Cache_Config::VAL_ON ){
991
  return LiteSpeed_Cache_Config::VAL_ON ;
992
  }
993
 
994
+ if( $val === LiteSpeed_Cache_Config::VAL_ON2 ){
995
+ return LiteSpeed_Cache_Config::VAL_ON2 ;
996
  }
997
 
998
  return LiteSpeed_Cache_Config::VAL_OFF ;
1007
  */
1008
  public static function get_instance()
1009
  {
 
1010
  if ( ! isset(self::$_instance) ) {
1011
+ self::$_instance = new self() ;
1012
  }
1013
 
1014
  return self::$_instance ;
admin/litespeed-cache-admin.class.php CHANGED
@@ -102,9 +102,9 @@ class LiteSpeed_Cache_Admin
102
 
103
  LiteSpeed_Cache_Control::set_nocache( 'Admin page' ) ;
104
 
105
- if ( LSWCP_ESI_SUPPORT && LiteSpeed_Cache::config(LiteSpeed_Cache_Config::OPID_ESI_ENABLE) ) {
106
- add_action('in_widget_form', array(LiteSpeed_Cache_Admin_Display::get_instance(), 'show_widget_edit'), 100, 3) ;
107
- add_filter('widget_update_callback', 'LiteSpeed_Cache_Admin_Settings::validate_widget_save', 10, 4) ;
108
  }
109
 
110
  // check if WP_CACHE is defined and true in the wp-config.php file.
@@ -267,9 +267,8 @@ class LiteSpeed_Cache_Admin
267
  */
268
  public static function get_instance()
269
  {
270
- $cls = get_called_class() ;
271
  if ( ! isset(self::$_instance) ) {
272
- self::$_instance = new $cls() ;
273
  }
274
 
275
  return self::$_instance ;
102
 
103
  LiteSpeed_Cache_Control::set_nocache( 'Admin page' ) ;
104
 
105
+ if ( LiteSpeed_Cache_Router::esi_enabled() ) {
106
+ add_action( 'in_widget_form', array( $this->display, 'show_widget_edit' ), 100, 3 ) ;
107
+ add_filter( 'widget_update_callback', 'LiteSpeed_Cache_Admin_Settings::validate_widget_save', 10, 4 ) ;
108
  }
109
 
110
  // check if WP_CACHE is defined and true in the wp-config.php file.
267
  */
268
  public static function get_instance()
269
  {
 
270
  if ( ! isset(self::$_instance) ) {
271
+ self::$_instance = new self() ;
272
  }
273
 
274
  return self::$_instance ;
admin/tpl/crawler.php CHANGED
@@ -17,10 +17,10 @@ $disabled = LiteSpeed_Cache_Router::can_crawl() ? '' : 'disabled' ;
17
  </span>
18
  </h2>
19
  </div>
20
- <div class="wrap">
21
- <div class="litespeed-cache-welcome-panel">
22
  <h3 class="litespeed-title"><?php echo __('Crawler File', 'litespeed-cache') ; ?></h3>
23
- <a href="<?php echo $this->build_url(LiteSpeed_Cache::ACTION_CRAWLER_GENERATE_FILE) ; ?>" class="litespeed-btn litespeed-btn-success">
24
  <?php echo __('Generate Crawler File', 'litespeed-cache') ; ?>
25
  </a>
26
 
@@ -59,13 +59,13 @@ $disabled = LiteSpeed_Cache_Router::can_crawl() ? '' : 'disabled' ;
59
  ?>
60
  <h3 class="litespeed-title"><?php echo __('Crawler Cron', 'litespeed-cache') ; ?></h3>
61
  <?php if ( ! LiteSpeed_Cache_Router::can_crawl() ): ?>
62
- <div class="litespeed-callout litespeed-callout-danger">
63
- <p><span class="attention"><?php echo __('WARNING', 'litespeed-cache'); ?></span></p>
64
  <p><?php echo __('The crawler feature is not enabled on the LiteSpeed server. Please consult your server admin.', 'litespeed-cache'); ?></p>
65
  <p><?php echo sprintf(__('See <a %s>Introduction for Enabling the Crawler</a> for detailed infomation.', 'litespeed-cache'), 'href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:enabling_the_crawler" target="_blank"') ; ?></p>
66
  </div>
67
  <?php endif; ?>
68
- <table class="widefat striped">
69
  <thead><tr >
70
  <th scope="col"><?php echo __('Cron Name', 'litespeed-cache') ; ?></th>
71
  <th scope="col"><?php echo __('Run Frequency', 'litespeed-cache') ; ?></th>
@@ -86,15 +86,15 @@ $disabled = LiteSpeed_Cache_Router::can_crawl() ? '' : 'disabled' ;
86
  if ( $meta && $meta->this_full_beginning_time ) {
87
  if ( $is_running ) {
88
  echo sprintf(__('The current sitemap crawl started at %s', 'litespeed-cache'),
89
- date('m/d/Y H:i:s' ,$meta->this_full_beginning_time));
90
 
91
  }
92
  else {
93
  echo sprintf(__('The current sitemap crawl started at %s', 'litespeed-cache'),
94
- date('m/d/Y H:i:s' ,$meta->this_full_beginning_time));
95
  echo "</div><div class='litespeed-desc'>";
96
  echo sprintf(__('The next complete sitemap crawl will start at %s', 'litespeed-cache'),
97
- date('m/d/Y H:i:s',$meta->this_full_beginning_time
98
  + $meta->last_full_time_cost + $_options[LiteSpeed_Cache_Config::CRWL_CRAWL_INTERVAL]));
99
  }
100
 
@@ -117,7 +117,7 @@ $disabled = LiteSpeed_Cache_Router::can_crawl() ? '' : 'disabled' ;
117
  if ( $meta ) {
118
  echo "Size: {$meta->list_size}<br />Position: " . ($meta->last_pos + 1) ;
119
  if ( $is_running ) {
120
- echo "<br /><div class='litespeed-label litespeed-label-success'>" . __('Is running', 'litespeed-cache') . "</div>" ;
121
  }
122
  }
123
  else {
@@ -126,29 +126,28 @@ $disabled = LiteSpeed_Cache_Router::can_crawl() ? '' : 'disabled' ;
126
  ?>
127
  </td>
128
  <td>
129
- <label class="litespeed-switch-onoff">
130
- <input type="checkbox"
131
- name="litespeed_crawler_cron_enable"
132
- id="litespeed_crawler_cron_enable"
133
- value="1"
134
  data-url="<?php echo $this->build_url(LiteSpeed_Cache::ACTION_CRAWLER_CRON_ENABLE, 'cron_enable') ; ?>"
135
  <?php if( $_options[LiteSpeed_Cache_Config::CRWL_CRON_ACTIVE] && LiteSpeed_Cache_Router::can_crawl() ) echo "checked"; ?>
136
  <?php echo $disabled ; ?>
137
  />
138
- <span data-on="<?php echo __('Enable', 'litespeed-cache'); ?>" data-off="<?php echo __('Disable', 'litespeed-cache'); ?>"></span>
139
- <span></span>
140
- </label>
 
 
141
  </td>
142
  <td>
143
  <?php
144
- echo " <a href='" . $this->build_url(LiteSpeed_Cache::ACTION_CRAWLER_RESET_POS) . "' class='litespeed-btn litespeed-btn-warning litespeed-btn-xs'>" . __('Reset position', 'litespeed-cache') . "</a>" ;
145
 
146
  $href = LiteSpeed_Cache_Router::can_crawl() ? $this->build_url(LiteSpeed_Cache::ACTION_DO_CRAWL) : 'javascript:;' ;
147
- echo " <a href='$href' id='litespeed_manual_trigger' target='litespeedHiddenIframe' class='litespeed-btn litespeed-btn-success litespeed-btn-xs' $disabled>" . __('Manually run', 'litespeed-cache') . "</a>" ;
148
  ?>
149
  <?php if ( $meta && $meta->last_start_time ): ?>
150
  <div class='litespeed-desc'>
151
- <?php echo sprintf(__('<b>Last interval:</b> %s', 'litespeed-cache'), date('m/d/Y H:i:s' ,$meta->last_start_time)) ; ?>
152
  </div>
153
  <?php endif ; ?>
154
 
@@ -183,7 +182,7 @@ $disabled = LiteSpeed_Cache_Router::can_crawl() ? '' : 'disabled' ;
183
  if ( $ajaxUrl ):
184
  ?>
185
 
186
- <input type="button" id="litespeed-crawl-url-btn" value="<?php echo __('Show crawler status', 'litespeed-cache') ; ?>" class="litespeed-btn litespeed-btn-primary" data-url="<?php echo $ajaxUrl ; ?>" />
187
 
188
  <div class="litespeed-shell litespeed-hide">
189
  <div class="litespeed-shell-header-bar"></div>
@@ -211,11 +210,11 @@ $disabled = LiteSpeed_Cache_Router::can_crawl() ? '' : 'disabled' ;
211
  <form method="post" action="admin.php?page=lscache-crawler">
212
  <?php $this->form_action(LiteSpeed_Cache::ACTION_BLACKLIST_SAVE); ?>
213
  <p>
214
- <textarea name="<?php echo LiteSpeed_Cache_Crawler::CRWL_BLACKLIST; ?>" rows="10" class="code litespeed-cache-blacklist"><?php echo LiteSpeed_Cache_Crawler::get_instance()->get_blacklist(); ?></textarea>
215
  </p>
216
 
217
  <p>
218
- <button type="submit" class="litespeed-btn litespeed-btn-success"><?php echo __('Save', 'litespeed-cache'); ?></button>
219
  </p>
220
  </form>
221
  <div class="litespeed-desc">
17
  </span>
18
  </h2>
19
  </div>
20
+ <div class="litespeed-wrap">
21
+ <div class="litespeed-body">
22
  <h3 class="litespeed-title"><?php echo __('Crawler File', 'litespeed-cache') ; ?></h3>
23
+ <a href="<?php echo $this->build_url(LiteSpeed_Cache::ACTION_CRAWLER_GENERATE_FILE) ; ?>" class="litespeed-btn-success">
24
  <?php echo __('Generate Crawler File', 'litespeed-cache') ; ?>
25
  </a>
26
 
59
  ?>
60
  <h3 class="litespeed-title"><?php echo __('Crawler Cron', 'litespeed-cache') ; ?></h3>
61
  <?php if ( ! LiteSpeed_Cache_Router::can_crawl() ): ?>
62
+ <div class="litespeed-callout-danger">
63
+ <h4><?php echo __('WARNING', 'litespeed-cache'); ?></h4>
64
  <p><?php echo __('The crawler feature is not enabled on the LiteSpeed server. Please consult your server admin.', 'litespeed-cache'); ?></p>
65
  <p><?php echo sprintf(__('See <a %s>Introduction for Enabling the Crawler</a> for detailed infomation.', 'litespeed-cache'), 'href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:enabling_the_crawler" target="_blank"') ; ?></p>
66
  </div>
67
  <?php endif; ?>
68
+ <table class="litespeed-table">
69
  <thead><tr >
70
  <th scope="col"><?php echo __('Cron Name', 'litespeed-cache') ; ?></th>
71
  <th scope="col"><?php echo __('Run Frequency', 'litespeed-cache') ; ?></th>
86
  if ( $meta && $meta->this_full_beginning_time ) {
87
  if ( $is_running ) {
88
  echo sprintf(__('The current sitemap crawl started at %s', 'litespeed-cache'),
89
+ date('m/d/Y H:i:s' ,$meta->this_full_beginning_time + LITESPEED_TIME_OFFSET ));
90
 
91
  }
92
  else {
93
  echo sprintf(__('The current sitemap crawl started at %s', 'litespeed-cache'),
94
+ date('m/d/Y H:i:s' ,$meta->this_full_beginning_time + LITESPEED_TIME_OFFSET ));
95
  echo "</div><div class='litespeed-desc'>";
96
  echo sprintf(__('The next complete sitemap crawl will start at %s', 'litespeed-cache'),
97
+ date('m/d/Y H:i:s',$meta->this_full_beginning_time + LITESPEED_TIME_OFFSET
98
  + $meta->last_full_time_cost + $_options[LiteSpeed_Cache_Config::CRWL_CRAWL_INTERVAL]));
99
  }
100
 
117
  if ( $meta ) {
118
  echo "Size: {$meta->list_size}<br />Position: " . ($meta->last_pos + 1) ;
119
  if ( $is_running ) {
120
+ echo "<br /><div class='litespeed-label-success'>" . __('Is running', 'litespeed-cache') . "</div>" ;
121
  }
122
  }
123
  else {
126
  ?>
127
  </td>
128
  <td>
129
+ <div class="litespeed-switch-drag">
130
+ <input type="checkbox" name="litespeed_crawler_cron_enable" id="litespeed_crawler_cron_enable" value="1"
 
 
 
131
  data-url="<?php echo $this->build_url(LiteSpeed_Cache::ACTION_CRAWLER_CRON_ENABLE, 'cron_enable') ; ?>"
132
  <?php if( $_options[LiteSpeed_Cache_Config::CRWL_CRON_ACTIVE] && LiteSpeed_Cache_Router::can_crawl() ) echo "checked"; ?>
133
  <?php echo $disabled ; ?>
134
  />
135
+ <label class="litespeed-switch-drag-label" for="litespeed_crawler_cron_enable">
136
+ <span class="litespeed-switch-drag-inner" data-on="<?php echo __('Enable', 'litespeed-cache'); ?>" data-off="<?php echo __('Disable', 'litespeed-cache'); ?>"></span>
137
+ <span class="litespeed-switch-drag-switch"></span>
138
+ </label>
139
+ </div>
140
  </td>
141
  <td>
142
  <?php
143
+ echo " <a href='" . $this->build_url(LiteSpeed_Cache::ACTION_CRAWLER_RESET_POS) . "' class='litespeed-btn-warning litespeed-btn-xs'>" . __('Reset position', 'litespeed-cache') . "</a>" ;
144
 
145
  $href = LiteSpeed_Cache_Router::can_crawl() ? $this->build_url(LiteSpeed_Cache::ACTION_DO_CRAWL) : 'javascript:;' ;
146
+ echo " <a href='$href' id='litespeed_manual_trigger' target='litespeedHiddenIframe' class='litespeed-btn-success litespeed-btn-xs' $disabled>" . __('Manually run', 'litespeed-cache') . "</a>" ;
147
  ?>
148
  <?php if ( $meta && $meta->last_start_time ): ?>
149
  <div class='litespeed-desc'>
150
+ <?php echo sprintf(__('<b>Last interval:</b> %s', 'litespeed-cache'), date('m/d/Y H:i:s' ,$meta->last_start_time+ LITESPEED_TIME_OFFSET )) ; ?>
151
  </div>
152
  <?php endif ; ?>
153
 
182
  if ( $ajaxUrl ):
183
  ?>
184
 
185
+ <input type="button" id="litespeed-crawl-url-btn" value="<?php echo __('Show crawler status', 'litespeed-cache') ; ?>" class="litespeed-btn-primary" data-url="<?php echo $ajaxUrl ; ?>" />
186
 
187
  <div class="litespeed-shell litespeed-hide">
188
  <div class="litespeed-shell-header-bar"></div>
210
  <form method="post" action="admin.php?page=lscache-crawler">
211
  <?php $this->form_action(LiteSpeed_Cache::ACTION_BLACKLIST_SAVE); ?>
212
  <p>
213
+ <textarea name="<?php echo LiteSpeed_Cache_Crawler::CRWL_BLACKLIST; ?>" rows="10" class="litespeed-textarea"><?php echo LiteSpeed_Cache_Crawler::get_instance()->get_blacklist(); ?></textarea>
214
  </p>
215
 
216
  <p>
217
+ <button type="submit" class="litespeed-btn-success"><?php echo __('Save', 'litespeed-cache'); ?></button>
218
  </p>
219
  </form>
220
  <div class="litespeed-desc">
admin/tpl/edit_htaccess.php CHANGED
@@ -34,36 +34,38 @@ if ( LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_ENABLED ) ) {
34
  </span>
35
  </h2>
36
  </div>
37
- <div class="wrap">
38
- <div class="litespeed-cache-welcome-panel">
39
- <div class="litespeed-callout litespeed-callout-danger">
40
- <p><span class="attention"><?php echo __('WARNING: This page is meant for advanced users.', 'litespeed-cache'); ?></span></p>
41
- <?php echo __('Any changes made to the .htaccess file may break the site.', 'litespeed-cache'); ?>
42
- <?php echo __('Please consult the host/server admin before making any changes.', 'litespeed-cache'); ?>
 
 
43
  </div>
44
 
45
  <?php if (defined('DISALLOW_FILE_EDIT') && DISALLOW_FILE_EDIT): ?>
46
- <h3><?php echo __('File editing is disabled in configuration.', 'litespeed-cache'); ?></h3>
47
 
48
  <?php elseif($content === false): ?>
49
- <h3><?php $this->display_messages(); ?></h3>
50
 
51
  <?php else: ?>
52
 
53
  <form method="post" action="admin.php?page=<?php echo LiteSpeed_Cache::PAGE_EDIT_HTACCESS; ?>">
54
  <?php $this->form_action(LiteSpeed_Cache::ACTION_SAVE_HTACCESS); ?>
55
 
56
- <h3><?php echo sprintf(__('Current %s contents:', 'litespeed-cache'), '.htaccess'); ?></h3>
57
 
58
  <!--p><span class="attention"><?php echo sprintf(__('DO NOT EDIT ANYTHING WITHIN %s', 'litespeed-cache'), LiteSpeed_Cache_Admin_Rules::LS_MODULE_DONOTEDIT); ?></span></p-->
59
 
60
  <p><?php echo __('These are added by the LS Cache plugin and may cause problems if they are changed.', 'litespeed-cache'); ?></p>
61
 
62
- <textarea id="wpwrap" name="<?php echo LiteSpeed_Cache_Admin_Rules::EDITOR_TEXTAREA_NAME; ?>" wrap="off" rows="30" class="code"
63
  <?php echo $readonly; ?>
64
  ><?php echo esc_textarea($content); ?></textarea>
65
 
66
- <button type="submit" class="litespeed-btn litespeed-btn-success"><?php echo __('Save', 'litespeed-cache'); ?></button>
67
  </form>
68
 
69
  <?php require LSWCP_DIR . 'admin/tpl/info_common_rewrite.php'; ?>
34
  </span>
35
  </h2>
36
  </div>
37
+ <div class="litespeed-wrap">
38
+ <div class="litespeed-body">
39
+ <div class="litespeed-callout-danger">
40
+ <h4><?php echo __('WARNING: This page is meant for advanced users.', 'litespeed-cache'); ?></h4>
41
+ <p>
42
+ <?php echo __('Any changes made to the .htaccess file may break the site.', 'litespeed-cache'); ?>
43
+ <?php echo __('Please consult the host/server admin before making any changes.', 'litespeed-cache'); ?>
44
+ </p>
45
  </div>
46
 
47
  <?php if (defined('DISALLOW_FILE_EDIT') && DISALLOW_FILE_EDIT): ?>
48
+ <div class="litespeed-h3"><?php echo __('File editing is disabled in configuration.', 'litespeed-cache'); ?></div>
49
 
50
  <?php elseif($content === false): ?>
51
+ <div class="litespeed-h3"><?php $this->display_messages(); ?></div>
52
 
53
  <?php else: ?>
54
 
55
  <form method="post" action="admin.php?page=<?php echo LiteSpeed_Cache::PAGE_EDIT_HTACCESS; ?>">
56
  <?php $this->form_action(LiteSpeed_Cache::ACTION_SAVE_HTACCESS); ?>
57
 
58
+ <div class="litespeed-title"><?php echo sprintf(__('Current %s Contents', 'litespeed-cache'), '.htaccess'); ?></div>
59
 
60
  <!--p><span class="attention"><?php echo sprintf(__('DO NOT EDIT ANYTHING WITHIN %s', 'litespeed-cache'), LiteSpeed_Cache_Admin_Rules::LS_MODULE_DONOTEDIT); ?></span></p-->
61
 
62
  <p><?php echo __('These are added by the LS Cache plugin and may cause problems if they are changed.', 'litespeed-cache'); ?></p>
63
 
64
+ <textarea name="<?php echo LiteSpeed_Cache_Admin_Rules::EDITOR_TEXTAREA_NAME; ?>" wrap="off" rows="30" class="litespeed-input-long"
65
  <?php echo $readonly; ?>
66
  ><?php echo esc_textarea($content); ?></textarea>
67
 
68
+ <button type="submit" class="litespeed-btn-primary"><?php echo __('Save', 'litespeed-cache'); ?></button>
69
  </form>
70
 
71
  <?php require LSWCP_DIR . 'admin/tpl/info_common_rewrite.php'; ?>
admin/tpl/esi_widget_edit.php CHANGED
@@ -2,44 +2,78 @@
2
  if ( !defined('WPINC') ) die;
3
  // $widget, $return, $instance
4
 
5
- $options = LiteSpeed_Cache_ESI::widget_load_get_options($widget) ;
6
- if ( empty($options) ) {
7
  $options = array(
8
- LiteSpeed_Cache_ESI::WIDGET_OPID_ESIENABLE => false,
9
  LiteSpeed_Cache_ESI::WIDGET_OPID_TTL => '28800'
10
  ) ;
11
- $options = apply_filters('litespeed_cache_widget_default_options', $options, $widget) ;
12
  }
13
 
14
- if ( empty($options) ) {
15
- $esi = false ;
16
  $ttl = '28800' ;
17
  }
18
  else {
19
- $esi = $options[LiteSpeed_Cache_ESI::WIDGET_OPID_ESIENABLE] ;
20
- $ttl = $options[LiteSpeed_Cache_ESI::WIDGET_OPID_TTL] ;
21
  }
22
 
 
 
23
  ?>
24
  <div class="litespeed-widget-setting">
25
 
26
  <h4>LiteSpeed Cache:</h4>
27
 
28
- <b><?php echo __('Enable ESI', 'litespeed-cache') ; ?>:</b>
29
  &nbsp;&nbsp;
30
  <div class="litespeed-inline">
31
- <?php LiteSpeed_Cache_Admin_Display::get_instance()->build_switch(LiteSpeed_Cache_ESI::WIDGET_OPID_ESIENABLE, false, false, $esi, 'litespeed-cfg-'.$widget->id) ; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  </div>
33
  <br /><br />
34
 
35
- <b><?php echo __('Widget Cache TTL:', 'litespeed-cache') ; ?></b>
36
  &nbsp;&nbsp;
37
- <?php LiteSpeed_Cache_Admin_Display::get_instance()->build_input(LiteSpeed_Cache_ESI::WIDGET_OPID_TTL, 'litespeed-reset', false, false, null, $ttl, 'size="7"') ; ?>
38
- <?php echo __('seconds', 'litespeed-cache') ; ?>
39
 
40
  <p class="install-help">
41
- <?php echo __('Recommended value: 28800 seconds (8 hours).', 'litespeed-cache') ; ?>
42
- <?php echo __('A TTL of 0 indicates do not cache.', 'litespeed-cache') ; ?>
43
  </p>
44
  </div>
45
 
2
  if ( !defined('WPINC') ) die;
3
  // $widget, $return, $instance
4
 
5
+ $options = LiteSpeed_Cache_ESI::widget_load_get_options( $widget ) ;
6
+ if ( empty( $options ) ) {
7
  $options = array(
8
+ LiteSpeed_Cache_ESI::WIDGET_OPID_ESIENABLE => LiteSpeed_Cache_Config::VAL_OFF,
9
  LiteSpeed_Cache_ESI::WIDGET_OPID_TTL => '28800'
10
  ) ;
11
+ $options = apply_filters( 'litespeed_cache_widget_default_options', $options, $widget ) ;
12
  }
13
 
14
+ if ( empty( $options ) ) {
15
+ $esi = LiteSpeed_Cache_Config::VAL_OFF ;
16
  $ttl = '28800' ;
17
  }
18
  else {
19
+ $esi = $options[ LiteSpeed_Cache_ESI::WIDGET_OPID_ESIENABLE ] ;
20
+ $ttl = $options[ LiteSpeed_Cache_ESI::WIDGET_OPID_TTL ] ;
21
  }
22
 
23
+ $display = LiteSpeed_Cache_Admin_Display::get_instance() ;
24
+
25
  ?>
26
  <div class="litespeed-widget-setting">
27
 
28
  <h4>LiteSpeed Cache:</h4>
29
 
30
+ <b><?php echo __( 'Enable ESI', 'litespeed-cache' ) ; ?>:</b>
31
  &nbsp;&nbsp;
32
  <div class="litespeed-inline">
33
+ <div class="litespeed-switch litespeed-mini">
34
+ <?php
35
+ $id = LiteSpeed_Cache_ESI::WIDGET_OPID_ESIENABLE ;
36
+
37
+ echo $this->build_radio(
38
+ $id,
39
+ LiteSpeed_Cache_Config::VAL_ON,
40
+ __( 'Public', 'litespeed-cache' ),
41
+ $esi === LiteSpeed_Cache_Config::VAL_ON,
42
+ false,
43
+ 'litespeed-cfg-' . $widget->id . '_' . LiteSpeed_Cache_Config::VAL_ON
44
+ );
45
+
46
+ echo $this->build_radio(
47
+ $id,
48
+ LiteSpeed_Cache_Config::VAL_ON2,
49
+ __( 'Private', 'litespeed-cache' ),
50
+ $esi === LiteSpeed_Cache_Config::VAL_ON2,
51
+ false,
52
+ 'litespeed-cfg-' . $widget->id . '_' . LiteSpeed_Cache_Config::VAL_ON2
53
+ );
54
+
55
+ echo $this->build_radio(
56
+ $id,
57
+ LiteSpeed_Cache_Config::VAL_OFF,
58
+ __( 'Disable', 'litespeed-cache' ),
59
+ $esi === LiteSpeed_Cache_Config::VAL_OFF,
60
+ false,
61
+ 'litespeed-cfg-' . $widget->id . '_' . LiteSpeed_Cache_Config::VAL_OFF
62
+ );
63
+ ?>
64
+
65
+ </div>
66
  </div>
67
  <br /><br />
68
 
69
+ <b><?php echo __( 'Widget Cache TTL:', 'litespeed-cache' ) ; ?></b>
70
  &nbsp;&nbsp;
71
+ <?php $display->build_input( LiteSpeed_Cache_ESI::WIDGET_OPID_TTL, 'litespeed-reset', false, false, null, $ttl, 'size="7"' ) ; ?>
72
+ <?php echo __( 'seconds', 'litespeed-cache' ) ; ?>
73
 
74
  <p class="install-help">
75
+ <?php echo __( 'Recommended value: 28800 seconds (8 hours).', 'litespeed-cache' ) ; ?>
76
+ <?php echo __( 'A TTL of 0 indicates do not cache.', 'litespeed-cache' ) ; ?>
77
  </p>
78
  </div>
79
 
admin/tpl/info.php CHANGED
@@ -19,15 +19,15 @@ $menuArr = array(
19
  </span>
20
  </h2>
21
  </div>
22
- <div class="wrap">
23
- <h2 class="nav-tab-wrapper">
24
  <?php
25
  foreach ($menuArr as $tab => $val){
26
- echo "<a class='nav-tab litespeed-tab' href='?page=lscache-info#$tab' data-litespeed-tab='$tab'>$val</a>";
27
  }
28
  ?>
29
  </h2>
30
- <div class="litespeed-cache-welcome-panel">
31
 
32
  <?php
33
  // include all tpl for faster UE
19
  </span>
20
  </h2>
21
  </div>
22
+ <div class="litespeed-wrap">
23
+ <h2 class="litespeed-header">
24
  <?php
25
  foreach ($menuArr as $tab => $val){
26
+ echo "<a class='litespeed-tab' href='?page=lscache-info#$tab' data-litespeed-tab='$tab'>$val</a>";
27
  }
28
  ?>
29
  </h2>
30
+ <div class="litespeed-body">
31
 
32
  <?php
33
  // include all tpl for faster UE
admin/tpl/info_common_rewrite.php CHANGED
@@ -6,13 +6,13 @@ $notice_content = '';
6
 
7
  if ((is_multisite()) && (!is_network_admin())) {
8
  $notice_title = __('NOTE:', 'litespeed-cache');
9
- $notice_content =
10
  '<p>'.__('The following configuration can only be changed by the network admin.', 'litespeed-cache').'</p>'.
11
  '<p>'.__('Please contact the network admin to make any changes.', 'litespeed-cache').'</p>';
12
  }
13
  else {
14
  $notice_title = __('NOTICE:', 'litespeed-cache');
15
- $notice_content =
16
  '<p>'.
17
  __('The following rewrite rules can be configured in the LiteSpeed Cache settings page.', 'litespeed-cache').' '.
18
  __('Please make any needed changes on that page.', 'litespeed-cache').' '.
@@ -23,7 +23,7 @@ else {
23
 
24
  <h3 class="litespeed-title"><?php echo __('LiteSpeed Cache Common Rewrite Rules', 'litespeed-cache'); ?></h3>
25
 
26
- <div class="litespeed-callout litespeed-callout-warning">
27
  <h4><?php echo $notice_title; ?></h4>
28
  <?php echo $notice_content; ?>
29
  </div>
@@ -37,7 +37,7 @@ else {
37
  <p>
38
  <?php echo __('This configuration can be added on the settings page in the General tab.', 'litespeed-cache'); ?>
39
  </p>
40
- <textarea id="wpwrap" rows="2" readonly>RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC]
41
  RewriteRule .* - [E=Cache-Control:vary=ismobile]</textarea>
42
  </div>
43
 
@@ -45,7 +45,7 @@ RewriteRule .* - [E=Cache-Control:vary=ismobile]</textarea>
45
  <div class="litespeed-answer">
46
  <p><?php echo __('Another common rewrite rule is to notify the cache not to cache when it sees a specified cookie name.', 'litespeed-cache'); ?></p>
47
  <p><?php echo __('This configuration can be added on the settings page in the Do Not Cache tab.', 'litespeed-cache'); ?></p>
48
- <textarea id="wpwrap" rows="2" readonly>RewriteCond %{HTTP_COOKIE} dontcachecookie
49
  RewriteRule .* - [E=Cache-Control:no-cache]</textarea>
50
  </div>
51
 
@@ -53,6 +53,6 @@ RewriteRule .* - [E=Cache-Control:no-cache]</textarea>
53
  <div class="litespeed-answer">
54
  <p><?php echo __('A not so commonly used rewrite rule is to notify the cache not to cache when it sees a specified User Agent.', 'litespeed-cache'); ?></p>
55
  <p><?php echo __('This configuration can be added on the settings page in the Do Not Cache tab.', 'litespeed-cache'); ?></p>
56
- <textarea id="wpwrap" rows="2" readonly>RewriteCond %{HTTP_USER_AGENT} dontcacheuseragent
57
  RewriteRule .* - [E=Cache-Control:no-cache]</textarea>
58
  </div>
6
 
7
  if ((is_multisite()) && (!is_network_admin())) {
8
  $notice_title = __('NOTE:', 'litespeed-cache');
9
+ $notice_content =
10
  '<p>'.__('The following configuration can only be changed by the network admin.', 'litespeed-cache').'</p>'.
11
  '<p>'.__('Please contact the network admin to make any changes.', 'litespeed-cache').'</p>';
12
  }
13
  else {
14
  $notice_title = __('NOTICE:', 'litespeed-cache');
15
+ $notice_content =
16
  '<p>'.
17
  __('The following rewrite rules can be configured in the LiteSpeed Cache settings page.', 'litespeed-cache').' '.
18
  __('Please make any needed changes on that page.', 'litespeed-cache').' '.
23
 
24
  <h3 class="litespeed-title"><?php echo __('LiteSpeed Cache Common Rewrite Rules', 'litespeed-cache'); ?></h3>
25
 
26
+ <div class="litespeed-callout-warning">
27
  <h4><?php echo $notice_title; ?></h4>
28
  <?php echo $notice_content; ?>
29
  </div>
37
  <p>
38
  <?php echo __('This configuration can be added on the settings page in the General tab.', 'litespeed-cache'); ?>
39
  </p>
40
+ <textarea class="litespeed-textarea" rows="2" readonly>RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC]
41
  RewriteRule .* - [E=Cache-Control:vary=ismobile]</textarea>
42
  </div>
43
 
45
  <div class="litespeed-answer">
46
  <p><?php echo __('Another common rewrite rule is to notify the cache not to cache when it sees a specified cookie name.', 'litespeed-cache'); ?></p>
47
  <p><?php echo __('This configuration can be added on the settings page in the Do Not Cache tab.', 'litespeed-cache'); ?></p>
48
+ <textarea class="litespeed-textarea" rows="2" readonly>RewriteCond %{HTTP_COOKIE} dontcachecookie
49
  RewriteRule .* - [E=Cache-Control:no-cache]</textarea>
50
  </div>
51
 
53
  <div class="litespeed-answer">
54
  <p><?php echo __('A not so commonly used rewrite rule is to notify the cache not to cache when it sees a specified User Agent.', 'litespeed-cache'); ?></p>
55
  <p><?php echo __('This configuration can be added on the settings page in the Do Not Cache tab.', 'litespeed-cache'); ?></p>
56
+ <textarea class="litespeed-textarea" rows="2" readonly>RewriteCond %{HTTP_USER_AGENT} dontcacheuseragent
57
  RewriteRule .* - [E=Cache-Control:no-cache]</textarea>
58
  </div>
admin/tpl/info_config.php CHANGED
@@ -18,10 +18,10 @@ if (!defined('WPINC')) die;
18
  </p>
19
  <p>
20
  <?php echo __('In the .htaccess file for the WordPress installation, add the following:', 'litespeed-cache'); ?>
21
- <textarea id="wpwrap" rows="3" readonly>&lt;IfModule LiteSpeed&gt;
 
22
  CacheLookup public on
23
  &lt;/IfModule&gt;</textarea>
24
- </p>
25
 
26
 
27
  <h4><?php echo __('Instructions for OpenLiteSpeed', 'litespeed-cache'); ?></h4>
@@ -35,7 +35,7 @@ if (!defined('WPINC')) die;
35
  </p>
36
 
37
 
38
- <h3><?php echo __('How to test the plugin', 'litespeed-cache'); ?></h3>
39
  <p><?php echo __('The LiteSpeed Cache Plugin utilizes LiteSpeed specific response headers.', 'litespeed-cache'); ?></p>
40
  <p>
41
  <?php echo sprintf(__('Visiting a page for the first time should result in a %s or %s response header for the page.', 'litespeed-cache'),
@@ -50,7 +50,7 @@ if (!defined('WPINC')) die;
50
  'href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:installation#testing" rel="noopener noreferrer" target="_blank"'); ?>
51
  </p>
52
 
53
- <h3><?php echo __( 'Cache tag prefix setting', 'litespeed-cache' ) ; ?></h3>
54
  <p>
55
  <?php echo sprintf(
56
  __( 'The value of this wordpress cache tag prefix is %1$s. If you want to change the value to avoid conflicts with multiple sites, please add %2$s to %3$s.', 'litespeed-cache' ),
18
  </p>
19
  <p>
20
  <?php echo __('In the .htaccess file for the WordPress installation, add the following:', 'litespeed-cache'); ?>
21
+ </p>
22
+ <textarea class="litespeed-textarea" rows="3" readonly>&lt;IfModule LiteSpeed&gt;
23
  CacheLookup public on
24
  &lt;/IfModule&gt;</textarea>
 
25
 
26
 
27
  <h4><?php echo __('Instructions for OpenLiteSpeed', 'litespeed-cache'); ?></h4>
35
  </p>
36
 
37
 
38
+ <div class="litespeed-h3"><?php echo __('How to test the plugin', 'litespeed-cache'); ?></div>
39
  <p><?php echo __('The LiteSpeed Cache Plugin utilizes LiteSpeed specific response headers.', 'litespeed-cache'); ?></p>
40
  <p>
41
  <?php echo sprintf(__('Visiting a page for the first time should result in a %s or %s response header for the page.', 'litespeed-cache'),
50
  'href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:installation#testing" rel="noopener noreferrer" target="_blank"'); ?>
51
  </p>
52
 
53
+ <div class="litespeed-h3"><?php echo __( 'Cache tag prefix setting', 'litespeed-cache' ) ; ?></div>
54
  <p>
55
  <?php echo sprintf(
56
  __( 'The value of this wordpress cache tag prefix is %1$s. If you want to change the value to avoid conflicts with multiple sites, please add %2$s to %3$s.', 'litespeed-cache' ),
admin/tpl/info_faqs.php CHANGED
@@ -90,7 +90,7 @@ if (!defined('WPINC')) die;
90
  </li>
91
  <li><?php echo sprintf(__('Replace the ajax query in %1$s with %2$s', 'litespeed-cache'),
92
  '<code>wp-content/plugins/wp-postviews/postviews-cache.js</code>',
93
- '<textarea id="wpwrap" rows="11" readonly>jQuery.ajax({
94
  type:"GET",
95
  url:viewsCacheL10n.admin_ajax_url,
96
  data:"postviews_id="+viewsCacheL10n.post_id+"&amp;action=postviews",
90
  </li>
91
  <li><?php echo sprintf(__('Replace the ajax query in %1$s with %2$s', 'litespeed-cache'),
92
  '<code>wp-content/plugins/wp-postviews/postviews-cache.js</code>',
93
+ '<textarea class="litespeed-textarea" rows="11" readonly>jQuery.ajax({
94
  type:"GET",
95
  url:viewsCacheL10n.admin_ajax_url,
96
  data:"postviews_id="+viewsCacheL10n.post_id+"&amp;action=postviews",
admin/tpl/manage.php CHANGED
@@ -3,199 +3,56 @@ if (!defined('WPINC')) die;
3
 
4
  LiteSpeed_Cache_Admin_Display::get_instance()->check_license();
5
 
 
 
 
 
 
6
  ?>
7
 
8
  <div class="wrap">
9
  <h2>
10
- <?php echo __('LiteSpeed Cache Management', 'litespeed-cache'); ?>
 
 
 
 
 
 
 
11
  <span class="litespeed-desc">
12
  v<?php echo LiteSpeed_Cache::PLUGIN_VERSION ; ?>
13
  </span>
14
  </h2>
15
  </div>
16
- <div class="wrap">
17
- <div class="litespeed-cache-welcome-panel">
18
- <p><?php echo __('From this screen, one can inform the server to purge the selected cached pages or empty the entire cache.', 'litespeed-cache'); ?></p>
19
-
20
-
21
- <table class="form-table"><tbody>
22
- <tr>
23
- <th><?php echo __('Purge the Front Page.', 'litespeed-cache'); ?></th>
24
- <td>
25
- <a href="<?php echo LiteSpeed_Cache_Admin_Display::build_url(LiteSpeed_Cache::ACTION_PURGE_FRONT); ?>" class="litespeed-btn litespeed-btn-success">
26
- <?php echo __('Purge Front Page', 'litespeed-cache'); ?>
27
- </a>
28
- <div class="litespeed-desc">
29
- <?php echo __('This will Purge Front Page only', 'litespeed-cache'); ?>
30
- </div>
31
- </td>
32
- </tr>
33
-
34
- <tr>
35
- <th><?php echo __('Purge Pages.', 'litespeed-cache'); ?></th>
36
- <td>
37
- <a href="<?php echo LiteSpeed_Cache_Admin_Display::build_url(LiteSpeed_Cache::ACTION_PURGE_PAGES); ?>" class="litespeed-btn litespeed-btn-success">
38
- <?php echo __('Purge Pages', 'litespeed-cache'); ?>
39
- </a>
40
- <div class="litespeed-desc">
41
- <?php echo __('This will Purge Pages only', 'litespeed-cache'); ?>
42
- </div>
43
- </td>
44
- </tr>
45
-
46
- <tr>
47
- <th><?php echo __('Purge the error pages.', 'litespeed-cache'); ?></th>
48
- <td>
49
- <form method="post" action="admin.php?page=lscache-dash">
50
- <?php $this->form_action(LiteSpeed_Cache::ACTION_PURGE_ERRORS); ?>
51
-
52
- <div class="litespeed-row">
53
- <?php $this->build_checkbox('include_403', __('Include 403', 'litespeed-cache'), 'checked', 'is_mini'); ?>
54
- <?php $this->build_checkbox('include_404', __('Include 404', 'litespeed-cache'), false, 'is_mini'); ?>
55
- <?php $this->build_checkbox('include_500', __('Include 500s', 'litespeed-cache'), 'checked', 'is_mini'); ?>
56
- </div>
57
-
58
- <div class="litespeed-row">
59
- <button type="submit" class="litespeed-btn litespeed-btn-success">
60
- <?php echo __('Purge Error Pages', 'litespeed-cache'); ?>
61
- </button>
62
- </div>
63
-
64
- <div class="litespeed-desc">
65
- <?php echo __('Purges the error page cache entries created by this plugin.', 'litespeed-cache'); ?>
66
- </div>
67
- </form>
68
- </td>
69
- </tr>
70
-
71
- <tr>
72
- <th><?php echo __('Purge all WordPress pages.', 'litespeed-cache'); ?></th>
73
- <td>
74
- <a href="<?php echo LiteSpeed_Cache_Admin_Display::build_url(LiteSpeed_Cache::ACTION_PURGE_ALL); ?>" class="litespeed-btn litespeed-btn-warning"
75
- <?php if (is_multisite() && is_network_admin()): ?>
76
- data-litespeed-cfm="<?php echo esc_html(__('This will purge everything for all blogs.', 'litespeed-cache')); ?> <?php echo esc_html(__('Are you sure you want to purge all?', 'litespeed-cache')); ?>"
77
- <?php else: ?>
78
- data-litespeed-cfm="<?php echo esc_html(__('Are you sure you want to purge all?', 'litespeed-cache')); ?>"
79
- <?php endif; ?>
80
- >
81
- <?php echo __('Purge All', 'litespeed-cache'); ?>
82
- </a>
83
- <div class="litespeed-desc">
84
- <?php echo __('Purge the cache entries created by this plugin.', 'litespeed-cache'); ?>
85
- </div>
86
- </td>
87
- </tr>
88
-
89
- <?php if (!is_multisite() || is_network_admin()): ?>
90
- <tr>
91
- <th><?php echo __('Clear all cache entries.', 'litespeed-cache'); ?></th>
92
- <td>
93
- <a href="<?php echo LiteSpeed_Cache_Admin_Display::build_url(LiteSpeed_Cache::ACTION_PURGE_EMPTYCACHE); ?>" class="litespeed-btn litespeed-btn-danger" data-litespeed-cfm="
94
- <?php echo esc_html(__('This will clear EVERYTHING inside the cache.', 'litespeed-cache')); ?>
95
- <?php echo esc_html(__('This may cause heavy load on the server.', 'litespeed-cache')); ?>
96
- <?php echo esc_html(__('If only the WordPress site should be purged, use purge all.', 'litespeed-cache')); ?>
97
- ">
98
- <?php echo __('Empty Entire Cache', 'litespeed-cache'); ?>
99
- </a>
100
- <div class="litespeed-desc">
101
- <?php echo __('Clears all cache entries related to this site, <i>including other web applications</i>.', 'litespeed-cache'); ?>
102
- <?php echo __('<b>This action should only be used if things are cached incorrectly.</b>', 'litespeed-cache'); ?>
103
- </div>
104
- </td>
105
- </tr>
106
- <?php endif; ?>
107
- </tbody></table>
108
-
109
- <?php if (!is_multisite() || !is_network_admin()): ?>
110
-
111
- <h3><?php echo __('Purge By...', 'litespeed-cache'); ?></h3>
112
- <hr/>
113
- <p>
114
- <?php echo __('Select below for "Purge by" options.', 'litespeed-cache'); ?>
115
- <?php echo __('Please enter one per line.', 'litespeed-cache'); ?>
116
- </p>
117
-
118
- <?php
119
- $purgeby_option = false;
120
- $_option_field = LiteSpeed_Cache_Admin_Display::PURGEBYOPT_SELECT;
121
- if(!empty($_REQUEST[$_option_field])){
122
- $purgeby_option = $_REQUEST[$_option_field];
123
- }
124
- if( !in_array($purgeby_option, array(
125
- LiteSpeed_Cache_Admin_Display::PURGEBY_CAT,
126
- LiteSpeed_Cache_Admin_Display::PURGEBY_PID,
127
- LiteSpeed_Cache_Admin_Display::PURGEBY_TAG,
128
- LiteSpeed_Cache_Admin_Display::PURGEBY_URL,
129
- )) ) {
130
- $purgeby_option = LiteSpeed_Cache_Admin_Display::PURGEBY_CAT;
131
- }
132
- ?>
133
-
134
- <form method="post" action="admin.php?page=lscache-dash">
135
- <?php $this->form_action(LiteSpeed_Cache::ACTION_PURGE_BY); ?>
136
- <div class="litespeed-row">
137
- <div class="litespeed-switch litespeed-label-info litespeed-mini">
138
- <?php $val = LiteSpeed_Cache_Admin_Display::PURGEBY_CAT;?>
139
- <input type="radio" name="<?php echo $_option_field; ?>" id="purgeby_option_category"
140
- value="<?php echo $val; ?>" <?php if( $purgeby_option == $val ) echo 'checked'; ?>
141
- />
142
- <label for="purgeby_option_category"><?php echo __('Category', 'litespeed-cache'); ?></label>
143
-
144
- <?php $val = LiteSpeed_Cache_Admin_Display::PURGEBY_PID;?>
145
- <input type="radio" name="<?php echo $_option_field; ?>" id="purgeby_option_postid"
146
- value="<?php echo $val; ?>" <?php if( $purgeby_option == $val ) echo 'checked'; ?>
147
- />
148
- <label for="purgeby_option_postid"><?php echo __('Post ID', 'litespeed-cache'); ?></label>
149
-
150
- <?php $val = LiteSpeed_Cache_Admin_Display::PURGEBY_TAG;?>
151
- <input type="radio" name="<?php echo $_option_field; ?>" id="purgeby_option_tag"
152
- value="<?php echo $val; ?>" <?php if( $purgeby_option == $val ) echo 'checked'; ?>
153
- />
154
- <label for="purgeby_option_tag"><?php echo __('Tag', 'litespeed-cache'); ?></label>
155
-
156
- <?php $val = LiteSpeed_Cache_Admin_Display::PURGEBY_URL;?>
157
- <input type="radio" name="<?php echo $_option_field; ?>" id="purgeby_option_url"
158
- value="<?php echo $val; ?>" <?php if( $purgeby_option == $val ) echo 'checked'; ?>
159
- />
160
- <label for="purgeby_option_url"><?php echo __('URL', 'litespeed-cache'); ?></label>
161
- </div>
162
-
163
- <div class="litespeed-cache-purgeby-text">
164
- <div class="<?php if($purgeby_option != LiteSpeed_Cache_Admin_Display::PURGEBY_CAT) echo 'litespeed-hide'; ?>"
165
- data-purgeby="<?php echo LiteSpeed_Cache_Admin_Display::PURGEBY_CAT; ?>">
166
- <?php echo sprintf(__('Purge pages by category name - e.g. %2$s should be used for the URL %1$s.', "litespeed-cache"),
167
- 'http://example.com/category/category-name/', 'category-name'); ?>
168
- </div>
169
- <div class="<?php if($purgeby_option != LiteSpeed_Cache_Admin_Display::PURGEBY_PID) echo 'litespeed-hide'; ?>"
170
- data-purgeby="<?php echo LiteSpeed_Cache_Admin_Display::PURGEBY_PID; ?>">
171
- <?php echo __("Purge pages by post ID.", "litespeed-cache"); ?>
172
- </div>
173
- <div class="<?php if($purgeby_option != LiteSpeed_Cache_Admin_Display::PURGEBY_TAG) echo 'litespeed-hide'; ?>"
174
- data-purgeby="<?php echo LiteSpeed_Cache_Admin_Display::PURGEBY_TAG; ?>">
175
- <?php echo sprintf(__('Purge pages by tag name - e.g. %2$s should be used for the URL %1$s.', "litespeed-cache"),
176
- 'http://example.com/tag/tag-name/', 'tag-name'); ?>
177
- </div>
178
- <div class="<?php if($purgeby_option != LiteSpeed_Cache_Admin_Display::PURGEBY_URL) echo 'litespeed-hide'; ?>"
179
- data-purgeby="<?php echo LiteSpeed_Cache_Admin_Display::PURGEBY_URL; ?>">
180
- <?php echo __('Purge pages by relative or full URL.', 'litespeed-cache'); ?>
181
- <?php echo sprintf(__('e.g. Use %s or %s.', 'litespeed-cache'),
182
- '<b><u>/2016/02/24/hello-world/</u></b>',
183
- '<b><u>http://www.myexamplesite.com/2016/02/24/hello-world/</u></b>'); ?>
184
- </div>
185
- </div>
186
 
187
- </div>
 
 
 
 
188
 
189
- <p>
190
- <textarea name="<?php echo LiteSpeed_Cache_Admin_Display::PURGEBYOPT_LIST; ?>" rows="5" class="code litespeed-cache-purgeby-textarea"></textarea>
191
- </p>
192
 
193
- <p>
194
- <button type="submit" class="litespeed-btn litespeed-btn-success"><?php echo __('Purge List', 'litespeed-cache'); ?></button>
195
- </p>
196
- </form>
197
- <?php endif; ?>
 
198
 
 
199
  </div>
200
  </div>
201
-
3
 
4
  LiteSpeed_Cache_Admin_Display::get_instance()->check_license();
5
 
6
+ $menu_list = array(
7
+ 'purge' => __('Purge', 'litespeed-cache'),
8
+ 'db' => __('DB Optimizer', 'litespeed-cache'),
9
+ ) ;
10
+
11
  ?>
12
 
13
  <div class="wrap">
14
  <h2>
15
+ <?php
16
+ if ( is_network_admin() ) {
17
+ echo __('LiteSpeed Cache Network Management', 'litespeed-cache');
18
+ }
19
+ else {
20
+ echo __('LiteSpeed Cache Management', 'litespeed-cache');
21
+ }
22
+ ?>
23
  <span class="litespeed-desc">
24
  v<?php echo LiteSpeed_Cache::PLUGIN_VERSION ; ?>
25
  </span>
26
  </h2>
27
  </div>
28
+ <div class="litespeed-wrap">
29
+ <h2 class="litespeed-header">
30
+ <?php
31
+ $i = 1 ;
32
+ foreach ($menu_list as $tab => $val){
33
+ $accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '' ;
34
+ echo "<a class='litespeed-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>" ;
35
+ $i ++ ;
36
+ }
37
+ ?>
38
+ </h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
40
+ <?php if ( ! LiteSpeed_Cache_Router::cache_enabled() ) : ?>
41
+ <div class="litespeed-callout-warning">
42
+ <h4><?php echo __('WARNING: LiteSpeed cache is disabled. The functionalities here can not work.', 'litespeed-cache'); ?></h4>
43
+ </div>
44
+ <?php endif ; ?>
45
 
46
+ <div class="litespeed-body">
47
+ <?php
 
48
 
49
+ // include all tpl for faster UE
50
+ foreach ($menu_list as $tab => $val) {
51
+ echo "<div data-litespeed-layout='$tab'>" ;
52
+ require LSWCP_DIR . "admin/tpl/manage_$tab.php" ;
53
+ echo "</div>" ;
54
+ }
55
 
56
+ ?>
57
  </div>
58
  </div>
 
admin/tpl/manage_db.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'WPINC' ) ) die ;
3
+
4
+ $_panels = array(
5
+ 'all' => array(
6
+ 'title' => __( 'Clean All', 'litespeed-cache' ),
7
+ 'desc' => '',
8
+ ),
9
+ 'revision' => array(
10
+ 'title' => __( 'Post Revisions', 'litespeed-cache' ),
11
+ 'desc' => __( 'Clean all post revisions', 'litespeed-cache' ),
12
+ ),
13
+ 'auto_draft' => array(
14
+ 'title' => __( 'Auto Drafts', 'litespeed-cache' ),
15
+ 'desc' => __( 'Clean all auto saved drafts', 'litespeed-cache' ),
16
+ ),
17
+ 'trash_post' => array(
18
+ 'title' => __( 'Trashed Posts', 'litespeed-cache' ),
19
+ 'desc' => __( 'Clean all trashed posts and pages', 'litespeed-cache' ),
20
+ ),
21
+ 'spam_comment' => array(
22
+ 'title' => __( 'Spam Comments', 'litespeed-cache' ),
23
+ 'desc' => __( 'Clean all spam comments', 'litespeed-cache' ),
24
+ ),
25
+ 'trash_comment' => array(
26
+ 'title' => __( 'Trashed Comments', 'litespeed-cache' ),
27
+ 'desc' => __( 'Clean all trashed comments', 'litespeed-cache' ),
28
+ ),
29
+ 'trackback-pingback' => array(
30
+ 'title' => __( 'Trackbacks/Pingbacks', 'litespeed-cache' ),
31
+ 'desc' => __( 'Clean all trackbacks and pingbacks', 'litespeed-cache' ),
32
+ ),
33
+ 'expired_transient' => array(
34
+ 'title' => __( 'Expired Transients', 'litespeed-cache' ),
35
+ 'desc' => __( 'Clean expired transient options', 'litespeed-cache' ),
36
+ ),
37
+ 'all_transients' => array(
38
+ 'title' => __( 'All Transients', 'litespeed-cache' ),
39
+ 'desc' => __( 'Clean all transient options', 'litespeed-cache' ),
40
+ ),
41
+ 'optimize_tables' => array(
42
+ 'title' => __( 'Optimize Tables', 'litespeed-cache' ),
43
+ 'desc' => __( 'Optimize all tables in your database', 'litespeed-cache' ),
44
+ ),
45
+ ) ;
46
+
47
+ $total = 0 ;
48
+ foreach ( $_panels as $tag => $val ) {
49
+ if ( $tag != 'all' ) {
50
+ $_panels[ $tag ][ 'count' ] = LiteSpeed_Cache_Admin_Optimize::db_count( $tag ) ;
51
+ if ( $tag != 'optimize_tables' ) {
52
+ $total += $_panels[ $tag ][ 'count' ] ;
53
+ }
54
+ }
55
+ $_panels[ $tag ][ 'link' ] = LiteSpeed_Cache_Admin_Optimize::generate_url( $tag ) ;
56
+ }
57
+
58
+ $_panels[ 'all' ][ 'count' ] = $total ;
59
+
60
+ ?>
61
+
62
+ <h3 class="litespeed-title"><?php echo __('Database Optimizer', 'litespeed-cache'); ?></h3>
63
+
64
+ <div class="litespeed-panel-wrapper">
65
+
66
+ <?php foreach ( $_panels as $tag => $val ): ?>
67
+
68
+ <a href="<?php echo $val[ 'link' ] ; ?>" class="litespeed-panel">
69
+ <section class="litespeed-panel-wrapper-icon">
70
+ <span class="litespeed-panel-icon-<?php echo $tag ; ?>"></span>
71
+ </section>
72
+ <section class="litespeed-panel-content">
73
+ <div class="litespeed-h3">
74
+ <?php echo $val[ 'title' ] ; ?>
75
+ <span class="litespeed-panel-counter<?php if ( $val[ 'count' ] > 0 ) echo '-red' ; ?>">(<?php echo $val[ 'count' ] ; ?>)</span>
76
+ </div>
77
+ <span class="litespeed-panel-para"><?php echo $val[ 'desc' ] ; ?></span>
78
+ </section>
79
+ <section class="litespeed-panel-wrapper-top-right">
80
+ <span class="litespeed-panel-top-right-icon<?php echo $val[ 'count' ] > 0 ? '-cross' : '-tick' ; ?>"></span>
81
+ </section>
82
+ </a>
83
+ <?php endforeach; ?>
84
+
85
+ </div>
admin/tpl/manage_purge.php ADDED
@@ -0,0 +1,187 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'WPINC' ) ) die ;
3
+
4
+
5
+ $_panels = array(
6
+ array(
7
+ 'title' => __( 'Purge Front Page', 'litespeed-cache' ),
8
+ 'desc' => __( 'This will Purge Front Page only', 'litespeed-cache' ),
9
+ 'tag' => LiteSpeed_Cache::ACTION_PURGE_FRONT,
10
+ 'icon' => 'purge-front',
11
+ ),
12
+ array(
13
+ 'title' => __( 'Purge Pages', 'litespeed-cache' ),
14
+ 'desc' => __( 'This will Purge Pages only', 'litespeed-cache' ),
15
+ 'tag' => LiteSpeed_Cache::ACTION_PURGE_PAGES,
16
+ 'icon' => 'purge-pages',
17
+ ),
18
+ array(
19
+ 'title' => __( 'Purge CSS/JS Cache', 'litespeed-cache' ),
20
+ 'desc' => __( 'This will purge all minified/combined CSS/JS entries only', 'litespeed-cache' ),
21
+ 'tag' => LiteSpeed_Cache::ACTION_PURGE_CSSJS,
22
+ 'icon' => 'purge-cssjs',
23
+ ),
24
+ array(
25
+ 'title' => __( 'Purge 403 Error', 'litespeed-cache' ),
26
+ 'desc' => __( 'Purge error pages, including 403 pages', 'litespeed-cache' ),
27
+ 'tag' => LiteSpeed_Cache::ACTION_PURGE_ERRORS,
28
+ 'icon' => 'purge-403',
29
+ 'append_url' => 'lserr=403',
30
+ ),
31
+ array(
32
+ 'title' => __( 'Purge 404 Error', 'litespeed-cache' ),
33
+ 'desc' => __( 'Purge error pages, including 404 pages', 'litespeed-cache' ),
34
+ 'tag' => LiteSpeed_Cache::ACTION_PURGE_ERRORS,
35
+ 'icon' => 'purge-404',
36
+ 'append_url' => 'lserr=404',
37
+ ),
38
+ array(
39
+ 'title' => __( 'Purge 500 Error', 'litespeed-cache' ),
40
+ 'desc' => __( 'Purge error pages, including 500 pages', 'litespeed-cache' ),
41
+ 'tag' => LiteSpeed_Cache::ACTION_PURGE_ERRORS,
42
+ 'icon' => 'purge-500',
43
+ 'append_url' => 'lserr=500',
44
+ ),
45
+ array(
46
+ 'title' => __( 'Purge All', 'litespeed-cache' ),
47
+ 'desc' => __( 'Purge the cache entries created by this plugin', 'litespeed-cache' ),
48
+ 'tag' => LiteSpeed_Cache::ACTION_PURGE_ALL,
49
+ 'icon' => 'purge-all',
50
+ 'title_cls' => 'litespeed-warning',
51
+ 'cfm' => is_multisite() && is_network_admin() ?
52
+ esc_html( __( 'This will purge everything for all blogs.', 'litespeed-cache' ) ) . ' ' .
53
+ esc_html( __( 'Are you sure you want to purge all?', 'litespeed-cache' ) )
54
+ :
55
+ esc_html( __( 'Are you sure you want to purge all?', 'litespeed-cache' ) )
56
+ ),
57
+ ) ;
58
+
59
+ if ( ! is_multisite() || is_network_admin() ) {
60
+ $_panels[] = array(
61
+ 'title' => __( 'Empty Entire Cache', 'litespeed-cache' ),
62
+ 'desc' => __( 'Clears all cache entries related to this site, <i>including other web applications</i>.', 'litespeed-cache' ) . ' <b>' .
63
+ __('This action should only be used if things are cached incorrectly.', 'litespeed-cache') . '</b>',
64
+ 'tag' => LiteSpeed_Cache::ACTION_PURGE_EMPTYCACHE,
65
+ 'icon' => 'empty-cache',
66
+ 'title_cls' => 'litespeed-danger',
67
+ 'cfm' => esc_html( __( 'This will clear EVERYTHING inside the cache.', 'litespeed-cache' ) ) . ' ' .
68
+ esc_html( __( 'This may cause heavy load on the server.', 'litespeed-cache' ) ) . ' ' .
69
+ esc_html( __( 'If only the WordPress site should be purged, use purge all.', 'litespeed-cache' ) )
70
+ ) ;
71
+ }
72
+
73
+ ?>
74
+
75
+ <h3 class="litespeed-title"><?php echo __('Purge', 'litespeed-cache'); ?></h3>
76
+
77
+ <div class="litespeed-panel-wrapper">
78
+
79
+ <?php foreach ( $_panels as $val ): ?>
80
+
81
+ <a class="litespeed-panel"
82
+ href="<?php echo LiteSpeed_Cache_Admin_Display::build_url( $val[ 'tag' ], false, ! empty( $val[ 'append_url' ] ) ? $val[ 'append_url' ] : false ) ; ?>"
83
+ <?php if ( ! empty( $val[ 'cfm' ] ) ) echo 'data-litespeed-cfm="' . $val[ 'cfm' ] . '"' ; ?>
84
+ >
85
+ <section class="litespeed-panel-wrapper-icon">
86
+ <span class="litespeed-panel-icon-<?php echo $val[ 'icon' ] ; ?>"></span>
87
+ </section>
88
+ <section class="litespeed-panel-content">
89
+ <div class="litespeed-h3 <?php if ( ! empty( $val[ 'title_cls' ] ) ) echo $val[ 'title_cls' ] ; ?>">
90
+ <?php echo $val[ 'title' ] ; ?>
91
+ </div>
92
+ <span class="litespeed-panel-para"><?php echo $val[ 'desc' ] ; ?></span>
93
+ </section>
94
+ </a>
95
+
96
+ <?php endforeach; ?>
97
+
98
+ </div>
99
+
100
+ <?php if (!is_multisite() || !is_network_admin()): ?>
101
+
102
+ <div class="litespeed-title"><?php echo __('Purge By...', 'litespeed-cache'); ?></div>
103
+ <div class="litespeed-desc">
104
+ <?php echo __('Select below for "Purge by" options.', 'litespeed-cache'); ?>
105
+ <?php echo __('Please enter one per line.', 'litespeed-cache'); ?>
106
+ </div>
107
+
108
+ <?php
109
+ $purgeby_option = false;
110
+ $_option_field = LiteSpeed_Cache_Admin_Display::PURGEBYOPT_SELECT;
111
+ if(!empty($_REQUEST[$_option_field])){
112
+ $purgeby_option = $_REQUEST[$_option_field];
113
+ }
114
+ if( !in_array($purgeby_option, array(
115
+ LiteSpeed_Cache_Admin_Display::PURGEBY_CAT,
116
+ LiteSpeed_Cache_Admin_Display::PURGEBY_PID,
117
+ LiteSpeed_Cache_Admin_Display::PURGEBY_TAG,
118
+ LiteSpeed_Cache_Admin_Display::PURGEBY_URL,
119
+ )) ) {
120
+ $purgeby_option = LiteSpeed_Cache_Admin_Display::PURGEBY_CAT;
121
+ }
122
+ ?>
123
+
124
+ <form method="post" action="admin.php?page=lscache-dash">
125
+ <?php $this->form_action(LiteSpeed_Cache::ACTION_PURGE_BY); ?>
126
+ <div class="litespeed-row">
127
+ <div class="litespeed-switch litespeed-mini">
128
+ <?php $val = LiteSpeed_Cache_Admin_Display::PURGEBY_CAT;?>
129
+ <input type="radio" name="<?php echo $_option_field; ?>" id="purgeby_option_category"
130
+ value="<?php echo $val; ?>" <?php if( $purgeby_option == $val ) echo 'checked'; ?>
131
+ />
132
+ <label for="purgeby_option_category"><?php echo __('Category', 'litespeed-cache'); ?></label>
133
+
134
+ <?php $val = LiteSpeed_Cache_Admin_Display::PURGEBY_PID;?>
135
+ <input type="radio" name="<?php echo $_option_field; ?>" id="purgeby_option_postid"
136
+ value="<?php echo $val; ?>" <?php if( $purgeby_option == $val ) echo 'checked'; ?>
137
+ />
138
+ <label for="purgeby_option_postid"><?php echo __('Post ID', 'litespeed-cache'); ?></label>
139
+
140
+ <?php $val = LiteSpeed_Cache_Admin_Display::PURGEBY_TAG;?>
141
+ <input type="radio" name="<?php echo $_option_field; ?>" id="purgeby_option_tag"
142
+ value="<?php echo $val; ?>" <?php if( $purgeby_option == $val ) echo 'checked'; ?>
143
+ />
144
+ <label for="purgeby_option_tag"><?php echo __('Tag', 'litespeed-cache'); ?></label>
145
+
146
+ <?php $val = LiteSpeed_Cache_Admin_Display::PURGEBY_URL;?>
147
+ <input type="radio" name="<?php echo $_option_field; ?>" id="purgeby_option_url"
148
+ value="<?php echo $val; ?>" <?php if( $purgeby_option == $val ) echo 'checked'; ?>
149
+ />
150
+ <label for="purgeby_option_url"><?php echo __('URL', 'litespeed-cache'); ?></label>
151
+ </div>
152
+
153
+ <div class="litespeed-cache-purgeby-text">
154
+ <div class="<?php if($purgeby_option != LiteSpeed_Cache_Admin_Display::PURGEBY_CAT) echo 'litespeed-hide'; ?>"
155
+ data-purgeby="<?php echo LiteSpeed_Cache_Admin_Display::PURGEBY_CAT; ?>">
156
+ <?php echo sprintf(__('Purge pages by category name - e.g. %2$s should be used for the URL %1$s.', "litespeed-cache"),
157
+ 'http://example.com/category/category-name/', 'category-name'); ?>
158
+ </div>
159
+ <div class="<?php if($purgeby_option != LiteSpeed_Cache_Admin_Display::PURGEBY_PID) echo 'litespeed-hide'; ?>"
160
+ data-purgeby="<?php echo LiteSpeed_Cache_Admin_Display::PURGEBY_PID; ?>">
161
+ <?php echo __("Purge pages by post ID.", "litespeed-cache"); ?>
162
+ </div>
163
+ <div class="<?php if($purgeby_option != LiteSpeed_Cache_Admin_Display::PURGEBY_TAG) echo 'litespeed-hide'; ?>"
164
+ data-purgeby="<?php echo LiteSpeed_Cache_Admin_Display::PURGEBY_TAG; ?>">
165
+ <?php echo sprintf(__('Purge pages by tag name - e.g. %2$s should be used for the URL %1$s.', "litespeed-cache"),
166
+ 'http://example.com/tag/tag-name/', 'tag-name'); ?>
167
+ </div>
168
+ <div class="<?php if($purgeby_option != LiteSpeed_Cache_Admin_Display::PURGEBY_URL) echo 'litespeed-hide'; ?>"
169
+ data-purgeby="<?php echo LiteSpeed_Cache_Admin_Display::PURGEBY_URL; ?>">
170
+ <?php echo __('Purge pages by relative or full URL.', 'litespeed-cache'); ?>
171
+ <?php echo sprintf(__('e.g. Use %s or %s.', 'litespeed-cache'),
172
+ '<b><u>/2016/02/24/hello-world/</u></b>',
173
+ '<b><u>http://www.myexamplesite.com/2016/02/24/hello-world/</u></b>'); ?>
174
+ </div>
175
+ </div>
176
+
177
+ </div>
178
+
179
+ <p>
180
+ <textarea name="<?php echo LiteSpeed_Cache_Admin_Display::PURGEBYOPT_LIST; ?>" rows="5" class="litespeed-textarea"></textarea>
181
+ </p>
182
+
183
+ <p>
184
+ <button type="submit" class="litespeed-btn-success"><?php echo __('Purge List', 'litespeed-cache'); ?></button>
185
+ </p>
186
+ </form>
187
+ <?php endif; ?>
admin/tpl/network_settings.php CHANGED
@@ -22,18 +22,21 @@ $_options = LiteSpeed_Cache_Config::get_instance()->get_site_options();
22
  </span>
23
  </h2>
24
  </div>
25
- <div class="wrap">
26
- <h2 class="nav-tab-wrapper">
27
  <?php
 
28
  foreach ($menuArr as $tab => $val){
29
- echo "<a class='nav-tab litespeed-tab' href='#$tab' data-litespeed-tab='$tab'>$val</a>";
 
 
30
  }
31
  ?>
32
  </h2>
33
- <div class="litespeed-cache-welcome-panel">
34
- <form method="post" action="admin.php?page=lscache-settings" id="ls_form_options">
35
  <?php
36
- $this->form_action(LiteSpeed_Cache::ACTION_SAVE_SETTINGS_NETWORK);
37
 
38
  // include all tpl for faster UE
39
  foreach ($menuArr as $tab => $val) {
22
  </span>
23
  </h2>
24
  </div>
25
+ <div class="litespeed-wrap">
26
+ <h2 class="litespeed-header">
27
  <?php
28
+ $i = 1 ;
29
  foreach ($menuArr as $tab => $val){
30
+ $accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '' ;
31
+ echo "<a class='litespeed-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>";
32
+ $i ++ ;
33
  }
34
  ?>
35
  </h2>
36
+ <div class="litespeed-body">
37
+ <form method="post" action="admin.php?page=lscache-settings" id="ls_form_options">
38
  <?php
39
+ $this->form_action(LiteSpeed_Cache::ACTION_SAVE_SETTINGS_NETWORK);
40
 
41
  // include all tpl for faster UE
42
  foreach ($menuArr as $tab => $val) {
admin/tpl/network_settings_cache.php CHANGED
@@ -8,7 +8,7 @@ if ( ! defined( 'WPINC' ) ) die ;
8
  <?php echo __( 'Responsive themes can handle this part automatically.', 'litespeed-cache' ) ; ?>
9
  </p>
10
 
11
- <table class="form-table"><tbody>
12
 
13
  <?php require LSWCP_DIR . 'admin/tpl/settings_inc.cache_favicon.php' ; ?>
14
  <?php require LSWCP_DIR . 'admin/tpl/settings_inc.cache_resources.php' ; ?>
8
  <?php echo __( 'Responsive themes can handle this part automatically.', 'litespeed-cache' ) ; ?>
9
  </p>
10
 
11
+ <table><tbody>
12
 
13
  <?php require LSWCP_DIR . 'admin/tpl/settings_inc.cache_favicon.php' ; ?>
14
  <?php require LSWCP_DIR . 'admin/tpl/settings_inc.cache_resources.php' ; ?>
admin/tpl/network_settings_general.php CHANGED
@@ -6,7 +6,7 @@ if (!defined('WPINC')) die;
6
 
7
  <p><?php echo __('These configuration are only available network wide.', 'litespeed-cache'); ?></p>
8
 
9
- <table class="form-table"><tbody>
10
  <tr>
11
  <th><?php echo __('Network Enable Cache', 'litespeed-cache'); ?></th>
12
  <td>
6
 
7
  <p><?php echo __('These configuration are only available network wide.', 'litespeed-cache'); ?></p>
8
 
9
+ <table><tbody>
10
  <tr>
11
  <th><?php echo __('Network Enable Cache', 'litespeed-cache'); ?></th>
12
  <td>
admin/tpl/network_settings_purge.php CHANGED
@@ -3,7 +3,7 @@ if ( ! defined( 'WPINC' ) ) die ;
3
  ?>
4
  <h3 class="litespeed-title"><?php echo __( 'Purge Network Settings', 'litespeed-cache' ) ; ?></h3>
5
 
6
- <table class="form-table"><tbody>
7
 
8
  <?php require LSWCP_DIR . 'admin/tpl/settings_inc.purge_on_upgrade.php' ; ?>
9
 
3
  ?>
4
  <h3 class="litespeed-title"><?php echo __( 'Purge Network Settings', 'litespeed-cache' ) ; ?></h3>
5
 
6
+ <table><tbody>
7
 
8
  <?php require LSWCP_DIR . 'admin/tpl/settings_inc.purge_on_upgrade.php' ; ?>
9
 
admin/tpl/report.php CHANGED
@@ -2,6 +2,7 @@
2
  if (!defined('WPINC')) die;
3
 
4
  $report = LiteSpeed_Cache_Admin_Report::get_instance()->generate_environment_report();
 
5
  ?>
6
 
7
  <div class="wrap">
@@ -12,15 +13,15 @@ $report = LiteSpeed_Cache_Admin_Report::get_instance()->generate_environment_rep
12
  </span>
13
  </h2>
14
  </div>
15
- <div class="wrap">
16
- <div class="litespeed-cache-welcome-panel">
17
  <ul>
18
  <li><?php echo __('The environment report contains detailed information about the WordPress configuration.', 'litespeed-cache'); ?></li>
19
  <li><?php echo __('If you run into any issues, please include the contents of this text area in your support message.', 'litespeed-cache'); ?></li>
20
  <li><?php echo __('To easily grab the content, click the <b>Select All and Copy to Clipboard</b> button, to select and copy to clipboard.', 'litespeed-cache'); ?></li>
21
  <?php if ( is_writable(LSWCP_DIR) ): ?>
22
  <li><?php echo sprintf(__('Alternatively, this information is also saved in %s.', 'litespeed-cache'),
23
- 'wp-content/plugins/litespeed-cache/environment_report.php'); ?></li>
24
  <?php endif; ?>
25
  </ul>
26
  <p>
@@ -32,14 +33,14 @@ $report = LiteSpeed_Cache_Admin_Report::get_instance()->generate_environment_rep
32
  </span>
33
  </p>
34
  <p>
35
- <button class="litespeed-btn litespeed-btn-primary" id='litespeed_cache_report_copy'>
36
  <?php echo __("Select All and Copy to Clipboard", "litespeed-cache"); ?>
37
  </button>
38
- <span class="litespeed-hide litespeed-notice" id="copy_select_all_span">
39
  <?php echo __("Environment Report copied to Clipboard!", "litespeed-cache"); ?>
40
  </span>
41
  </p>
42
- <textarea id="litespeed-report" rows="20" cols="80" readonly><?php echo $report; ?></textarea>
43
  </div>
44
  </div>
45
 
2
  if (!defined('WPINC')) die;
3
 
4
  $report = LiteSpeed_Cache_Admin_Report::get_instance()->generate_environment_report();
5
+
6
  ?>
7
 
8
  <div class="wrap">
13
  </span>
14
  </h2>
15
  </div>
16
+ <div class="litespeed-wrap">
17
+ <div class="litespeed-body">
18
  <ul>
19
  <li><?php echo __('The environment report contains detailed information about the WordPress configuration.', 'litespeed-cache'); ?></li>
20
  <li><?php echo __('If you run into any issues, please include the contents of this text area in your support message.', 'litespeed-cache'); ?></li>
21
  <li><?php echo __('To easily grab the content, click the <b>Select All and Copy to Clipboard</b> button, to select and copy to clipboard.', 'litespeed-cache'); ?></li>
22
  <?php if ( is_writable(LSWCP_DIR) ): ?>
23
  <li><?php echo sprintf(__('Alternatively, this information is also saved in %s.', 'litespeed-cache'),
24
+ LSWCP_CONTENT_FOLDER . '/plugins/litespeed-cache/environment_report.php'); ?></li>
25
  <?php endif; ?>
26
  </ul>
27
  <p>
33
  </span>
34
  </p>
35
  <p>
36
+ <button class="litespeed-btn-success" id='litespeed_cache_report_copy'>
37
  <?php echo __("Select All and Copy to Clipboard", "litespeed-cache"); ?>
38
  </button>
39
+ <span class="litespeed-hide" id="copy_select_all_span">
40
  <?php echo __("Environment Report copied to Clipboard!", "litespeed-cache"); ?>
41
  </span>
42
  </p>
43
+ <textarea id="litespeed-report" rows="40" cols="80" readonly><?php echo $report; ?></textarea>
44
  </div>
45
  </div>
46
 
admin/tpl/settings.php CHANGED
@@ -8,11 +8,11 @@ $menu_list = array(
8
  'cache' => __('Cache', 'litespeed-cache'),
9
  'purge' => __('Purge', 'litespeed-cache'),
10
  'excludes' => __('Excludes', 'litespeed-cache'),
 
 
11
  ) ;
12
 
13
- if ( LSWCP_ESI_SUPPORT ) {
14
- $menu_list['esi'] = __('ESI', 'litespeed-cache') ;
15
- }
16
 
17
  if (!is_multisite()) {
18
  $menu_list['advanced'] = __('Advanced', 'litespeed-cache') ;
@@ -90,26 +90,34 @@ else {
90
  </span>
91
  </h2>
92
  </div>
93
- <div class="wrap">
94
- <h2 class="nav-tab-wrapper">
95
  <?php
 
96
  foreach ($menu_list as $tab => $val){
97
- echo "<a class='nav-tab litespeed-tab' href='#$tab' data-litespeed-tab='$tab'>$val</a>" ;
 
 
98
  }
99
  foreach ($tp_tabs as $val){
100
- echo "<a class='nav-tab litespeed-tab' href='#$val[slug]' data-litespeed-tab='$val[slug]'>$val[title]</a>" ;
 
 
101
  }
102
  ?>
103
  </h2>
104
- <div class="litespeed-cache-welcome-panel">
105
- <form method="post" action="options.php" id="litespeed_form_options">
106
- <!--input type="hidden" name="<?php echo LiteSpeed_Cache::ACTION_KEY ; ?>" value="<?php echo LiteSpeed_Cache::ACTION_SAVE_SETTINGS ; ?>" /-->
107
 
108
  <?php if ($this->get_disable_all()): ?>
 
 
109
  <p>
110
  <?php echo __('The network admin selected use primary site configs for all subsites.', 'litespeed-cache') ; ?>
111
  <?php echo __('The following options are selected, but are not editable in this settings page.', 'litespeed-cache') ; ?>
112
  </p>
 
113
  <?php endif ; ?>
114
 
115
  <?php
@@ -129,10 +137,10 @@ else {
129
  echo "<div class='litespeed-top20'></div>" ;
130
 
131
  if ($this->get_disable_all()) {
132
- submit_button(__('Save Changes', 'litespeed-cache'), 'primary', 'litespeed-submit', true, array('disabled' => true)) ;
133
  }
134
  else {
135
- submit_button(__('Save Changes', 'litespeed-cache'), 'primary', 'litespeed-submit') ;
136
  }
137
 
138
  ?>
8
  'cache' => __('Cache', 'litespeed-cache'),
9
  'purge' => __('Purge', 'litespeed-cache'),
10
  'excludes' => __('Excludes', 'litespeed-cache'),
11
+ 'optimize' => __('Optimize', 'litespeed-cache'),
12
+ 'cdn' => __('CDN', 'litespeed-cache'),
13
  ) ;
14
 
15
+ $menu_list['esi'] = __('ESI', 'litespeed-cache') ;
 
 
16
 
17
  if (!is_multisite()) {
18
  $menu_list['advanced'] = __('Advanced', 'litespeed-cache') ;
90
  </span>
91
  </h2>
92
  </div>
93
+ <div class="litespeed-wrap">
94
+ <h2 class="litespeed-header">
95
  <?php
96
+ $i = 1 ;
97
  foreach ($menu_list as $tab => $val){
98
+ $accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '' ;
99
+ echo "<a class='litespeed-tab' href='#$tab' data-litespeed-tab='$tab' $accesskey>$val</a>" ;
100
+ $i ++ ;
101
  }
102
  foreach ($tp_tabs as $val){
103
+ $accesskey = $i <= 9 ? "litespeed-accesskey='$i'" : '' ;
104
+ echo "<a class='litespeed-tab' href='#$val[slug]' data-litespeed-tab='$val[slug]' $accesskey>$val[title]</a>" ;
105
+ $i ++ ;
106
  }
107
  ?>
108
  </h2>
109
+ <div class="litespeed-body">
110
+ <form method="post" action="options.php" id="litespeed_form_options">
111
+ <!--input type="hidden" name="<?php echo LiteSpeed_Cache::ACTION_KEY ; ?>" value="<?php echo LiteSpeed_Cache::ACTION_SAVE_SETTINGS ; ?>" /-->
112
 
113
  <?php if ($this->get_disable_all()): ?>
114
+ <div class="litespeed-callout-danger">
115
+ <h4><?php echo __( 'WARNING', 'litespeed-cache' ) ; ?></h4>
116
  <p>
117
  <?php echo __('The network admin selected use primary site configs for all subsites.', 'litespeed-cache') ; ?>
118
  <?php echo __('The following options are selected, but are not editable in this settings page.', 'litespeed-cache') ; ?>
119
  </p>
120
+ </div>
121
  <?php endif ; ?>
122
 
123
  <?php
137
  echo "<div class='litespeed-top20'></div>" ;
138
 
139
  if ($this->get_disable_all()) {
140
+ submit_button(__('Save Changes', 'litespeed-cache'), 'litespeed-btn-primary', 'litespeed-submit', true, array('disabled' => true)) ;
141
  }
142
  else {
143
+ submit_button(__('Save Changes', 'litespeed-cache'), 'litespeed-btn-primary', 'litespeed-submit') ;
144
  }
145
 
146
  ?>
admin/tpl/settings_advanced.php CHANGED
@@ -2,7 +2,7 @@
2
  if (!defined('WPINC')) die;
3
 
4
  ?>
5
- <div class="litespeed-callout litespeed-callout-danger">
6
  <h4><?php echo __('NOTICE:', 'litespeed-cache'); ?></h4>
7
  <ol>
8
  <li><?php echo __('These settings are meant for ADVANCED USERS ONLY.', 'litespeed-cache'); ?></li>
@@ -16,20 +16,21 @@ if (!defined('WPINC')) die;
16
  $id = LiteSpeed_Cache_Config::OPID_CHECK_ADVANCEDCACHE;
17
  $this->build_checkbox($id, __('Include advanced-cache.php', 'litespeed-cache'), $_options[$id]);
18
  ?>
19
- <div class="litespeed-row litespeed-top10">
20
  <?php echo __('The advanced-cache.php file is used by many caching plugins to signal that a cache is active.', 'litespeed-cache'); ?>
21
  <?php echo __('When this option is checked and this file is detected as belonging to another plugin, LiteSpeed Cache will not cache.', 'litespeed-cache'); ?>
22
- </div>
23
- <div class="litespeed-row litespeed-top10">
24
  <i><?php echo __('Uncheck this option only if the other plugin is used for non-caching purposes, such as minifying css/js files.', 'litespeed-cache'); ?></i>
25
- </div>
26
 
27
  <h3 class="litespeed-title"><?php echo __('Login Cookie', 'litespeed-cache'); ?></h3>
28
  <?php
29
 
30
- echo __('SYNTAX: alphanumeric and "_".', 'litespeed-cache')
31
  . ' ' . __('No spaces and case sensitive.', 'litespeed-cache')
32
  . ' ' . __('MUST BE UNIQUE FROM OTHER WEB APPLICATIONS.', 'litespeed-cache')
 
33
  . '<p>'
34
  . sprintf(__('The default login cookie is %s.', 'litespeed-cache'), '_lscache_vary')
35
  . ' ' . __('The server will determine if the user is logged in based on the existance of this cookie.', 'litespeed-cache')
@@ -48,25 +49,25 @@ echo __('SYNTAX: alphanumeric and "_".', 'litespeed-cache')
48
 
49
  $cookie_rule = LiteSpeed_Cache_Admin_Rules::get_instance()->get_rewrite_rule_login_cookie();
50
  if ( $cookie_rule && substr($cookie_rule, 0, 11) !== 'Cache-Vary:' ){
51
- echo '<p class="attention">'
52
  . sprintf(__('Error: invalid login cookie. Please check the %s file', 'litespeed-cache'), '.htaccess')
53
- . '</p>';
54
  }
55
 
56
  $id = LiteSpeed_Cache_Config::OPID_LOGIN_COOKIE;
57
  if ( $_options[LiteSpeed_Cache_Config::OPID_ENABLED] && $_options[$id] ){
58
 
59
  if (!$cookie_rule){
60
- echo '<p class="attention">'
61
  . sprintf(__('Error getting current rules from %s: %s', 'litespeed-cache'), '.htaccess', LiteSpeed_Cache_Admin_Rules::MARKER_LOGIN_COOKIE)
62
- . '</p>';
63
  }
64
  else{
65
  $cookie_rule = substr($cookie_rule, 11);
66
  $cookie_arr = explode(',', $cookie_rule);
67
  if(!in_array($_options[$id], $cookie_arr)) {
68
- echo '<div class="litespeed-callout litespeed-callout-warning">'.
69
- __('WARNING: The .htaccess login cookie and Database login cookie do not match.', 'litespeed-cache').
70
  '</div>';
71
  }
72
  }
2
  if (!defined('WPINC')) die;
3
 
4
  ?>
5
+ <div class="litespeed-callout-danger">
6
  <h4><?php echo __('NOTICE:', 'litespeed-cache'); ?></h4>
7
  <ol>
8
  <li><?php echo __('These settings are meant for ADVANCED USERS ONLY.', 'litespeed-cache'); ?></li>
16
  $id = LiteSpeed_Cache_Config::OPID_CHECK_ADVANCEDCACHE;
17
  $this->build_checkbox($id, __('Include advanced-cache.php', 'litespeed-cache'), $_options[$id]);
18
  ?>
19
+ <p>
20
  <?php echo __('The advanced-cache.php file is used by many caching plugins to signal that a cache is active.', 'litespeed-cache'); ?>
21
  <?php echo __('When this option is checked and this file is detected as belonging to another plugin, LiteSpeed Cache will not cache.', 'litespeed-cache'); ?>
22
+ </p>
23
+ <p>
24
  <i><?php echo __('Uncheck this option only if the other plugin is used for non-caching purposes, such as minifying css/js files.', 'litespeed-cache'); ?></i>
25
+ </p>
26
 
27
  <h3 class="litespeed-title"><?php echo __('Login Cookie', 'litespeed-cache'); ?></h3>
28
  <?php
29
 
30
+ echo '<p>' . __('SYNTAX: alphanumeric and "_".', 'litespeed-cache')
31
  . ' ' . __('No spaces and case sensitive.', 'litespeed-cache')
32
  . ' ' . __('MUST BE UNIQUE FROM OTHER WEB APPLICATIONS.', 'litespeed-cache')
33
+ . '</p>'
34
  . '<p>'
35
  . sprintf(__('The default login cookie is %s.', 'litespeed-cache'), '_lscache_vary')
36
  . ' ' . __('The server will determine if the user is logged in based on the existance of this cookie.', 'litespeed-cache')
49
 
50
  $cookie_rule = LiteSpeed_Cache_Admin_Rules::get_instance()->get_rewrite_rule_login_cookie();
51
  if ( $cookie_rule && substr($cookie_rule, 0, 11) !== 'Cache-Vary:' ){
52
+ echo '<div class="litespeed-callout-danger">'
53
  . sprintf(__('Error: invalid login cookie. Please check the %s file', 'litespeed-cache'), '.htaccess')
54
+ . '</div>';
55
  }
56
 
57
  $id = LiteSpeed_Cache_Config::OPID_LOGIN_COOKIE;
58
  if ( $_options[LiteSpeed_Cache_Config::OPID_ENABLED] && $_options[$id] ){
59
 
60
  if (!$cookie_rule){
61
+ echo '<div class="litespeed-callout-danger">'
62
  . sprintf(__('Error getting current rules from %s: %s', 'litespeed-cache'), '.htaccess', LiteSpeed_Cache_Admin_Rules::MARKER_LOGIN_COOKIE)
63
+ . '</div>';
64
  }
65
  else{
66
  $cookie_rule = substr($cookie_rule, 11);
67
  $cookie_arr = explode(',', $cookie_rule);
68
  if(!in_array($_options[$id], $cookie_arr)) {
69
+ echo '<div class="litespeed-callout-warning">' .
70
+ __( 'WARNING: The .htaccess login cookie and Database login cookie do not match.', 'litespeed-cache' ) .
71
  '</div>';
72
  }
73
  }
admin/tpl/settings_cache.php CHANGED
@@ -3,7 +3,7 @@ if ( ! defined( 'WPINC' ) ) die ;
3
  ?>
4
  <h3 class="litespeed-title"><?php echo __( 'Cache Control Settings', 'litespeed-cache' ) ; ?></h3>
5
 
6
- <table class="form-table"><tbody>
7
  <tr>
8
  <th><?php echo __( 'Cache Logged-in Users', 'litespeed-cache' ) ; ?></th>
9
  <td>
3
  ?>
4
  <h3 class="litespeed-title"><?php echo __( 'Cache Control Settings', 'litespeed-cache' ) ; ?></h3>
5
 
6
+ <table><tbody>
7
  <tr>
8
  <th><?php echo __( 'Cache Logged-in Users', 'litespeed-cache' ) ; ?></th>
9
  <td>
admin/tpl/settings_cdn.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'WPINC' ) ) die ;
3
+
4
+ $home_url = home_url( '/' ) ;
5
+ $parsed = parse_url( $home_url ) ;
6
+ $home_url = str_replace( $parsed[ 'scheme' ] . ':', '', $home_url ) ;
7
+ $cdn_url = 'https://cdn.' . substr( $home_url, 2 ) ;
8
+
9
+ ?>
10
+
11
+ <h3 class="litespeed-title"><?php echo __( 'CDN Settings', 'litespeed-cache' ) ; ?></h3>
12
+
13
+ <table><tbody>
14
+ <tr>
15
+ <th><?php echo __( 'Enable CDN', 'litespeed-cache' ) ; ?></th>
16
+ <td>
17
+ <?php $this->build_switch( LiteSpeed_Cache_Config::OPID_CDN ) ; ?>
18
+ <div class="litespeed-desc">
19
+ <?php echo __( 'Enable Content Delivery Network use.', 'litespeed-cache' ) ; ?>
20
+ </div>
21
+ </td>
22
+ </tr>
23
+
24
+ <tr>
25
+ <th><?php echo __( 'CDN URL', 'litespeed-cache' ) ; ?></th>
26
+ <td>
27
+ <?php $this->build_input( LiteSpeed_Cache_Config::OPID_CDN_URL, 'litespeed-input-long' ) ; ?>
28
+ <div class="litespeed-desc">
29
+ <?php echo sprintf( __( 'CDN URL to be used. For example, %s', 'litespeed-cache' ), '<code>' . $cdn_url . '</code>' ) ; ?>
30
+ </div>
31
+ </td>
32
+ </tr>
33
+
34
+ <tr>
35
+ <th><?php echo __( 'Original URL', 'litespeed-cache' ) ; ?></th>
36
+ <td>
37
+ <?php $this->build_input( LiteSpeed_Cache_Config::OPID_CDN_ORI, 'litespeed-input-long' ) ; ?>
38
+ <div class="litespeed-desc">
39
+ <?php echo sprintf( __( 'Site URL to be served through the CDN. Beginning with %1$s. For example, %2$s', 'litespeed-cache' ), '<code>//</code>', '<code>' . $home_url . '</code>' ) ; ?>
40
+ </div>
41
+ </td>
42
+ </tr>
43
+
44
+ <tr>
45
+ <th><?php echo __( 'Include Images', 'litespeed-cache' ) ; ?></th>
46
+ <td>
47
+ <?php $this->build_switch( LiteSpeed_Cache_Config::OPID_CDN_INC_IMG ) ; ?>
48
+ <div class="litespeed-desc">
49
+ <?php echo sprintf( __( 'Serve all image files through the CDN. This will affect all attachments, HTML %s tags, and CSS %s attributes.', 'litespeed-cache' ), '<code>&lt;img</code>', '<code>url()</code>' ) ; ?>
50
+ </div>
51
+ </td>
52
+ </tr>
53
+
54
+ <tr>
55
+ <th><?php echo __( 'Include CSS', 'litespeed-cache' ) ; ?></th>
56
+ <td>
57
+ <?php $this->build_switch( LiteSpeed_Cache_Config::OPID_CDN_INC_CSS ) ; ?>
58
+ <div class="litespeed-desc">
59
+ <?php echo __( 'Serve all CSS files through the CDN. This will affect all enqueued WP CSS files.', 'litespeed-cache' ) ; ?>
60
+ </div>
61
+ </td>
62
+ </tr>
63
+
64
+ <tr>
65
+ <th><?php echo __( 'Include JS', 'litespeed-cache' ) ; ?></th>
66
+ <td>
67
+ <?php $this->build_switch( LiteSpeed_Cache_Config::OPID_CDN_INC_JS ) ; ?>
68
+ <div class="litespeed-desc">
69
+ <?php echo __( 'Serve all JavaScript files through the CDN. This will affect all enqueued WP JavaScript files.', 'litespeed-cache' ) ; ?>
70
+ </div>
71
+ </td>
72
+ </tr>
73
+
74
+ <tr>
75
+ <th><?php echo __( 'Include File Types', 'litespeed-cache' ) ; ?></th>
76
+ <td>
77
+ <div style="float:left; margin-right: 125px;">
78
+ <?php $id = LiteSpeed_Cache_Config::OPID_CDN_FILETYPE ; ?>
79
+ <?php $this->build_textarea( $id, null, false, 30 ) ; ?>
80
+ <div class="litespeed-desc">
81
+ <p><?php echo __( 'Static file type links to be replaced by CDN links. One per line.', 'litespeed-cache' ) ; ?></p>
82
+ <p><?php echo sprintf( __( 'This will affect all tags containing attributes: %s %s %s.', 'litespeed-cache' ), '<code>src=""</code>', '<code>data-src=""</code>', '<code>href=""</code>' ) ; ?></p>
83
+ </div>
84
+ </div>
85
+ <div style="float:left; display:flex;">
86
+ <div style="display: flex; margin-right: 50px;">
87
+ <?php $this->recommended($id) ; ?>
88
+ </div>
89
+ </div>
90
+ </td>
91
+ </tr>
92
+
93
+ <tr>
94
+ <th><?php echo __( 'Exclude Path', 'litespeed-cache' ) ; ?></th>
95
+ <td>
96
+ <?php $id = LiteSpeed_Cache_Config::OPID_CDN_EXCLUDE ; ?>
97
+ <?php $this->build_textarea( $id ) ; ?>
98
+ <div class="litespeed-desc">
99
+ <?php echo __( 'Paths containing these strings will not be served from the CDN.', 'litespeed-cache' ) ; ?>
100
+ </div>
101
+ </td>
102
+ </tr>
103
+
104
+ </tbody></table>
admin/tpl/settings_crawler.php CHANGED
@@ -5,7 +5,7 @@ if ( !defined('WPINC') ) die;
5
 
6
  <h3 class="litespeed-title"><?php echo __('Crawler Settings', 'litespeed-cache'); ?></h3>
7
 
8
- <table class="form-table"><tbody>
9
  <tr>
10
  <th><?php echo __('Delay', 'litespeed-cache'); ?></th>
11
  <td>
@@ -58,7 +58,7 @@ if ( !defined('WPINC') ) die;
58
  <th><?php echo __('Threads', 'litespeed-cache'); ?></th>
59
  <td>
60
  <?php $id = LiteSpeed_Cache_Config::CRWL_THREADS ; ?>
61
- <?php $this->build_input($id); ?>
62
  <div class="litespeed-desc">
63
  <?php echo __('Specify Number of Threads to use while crawling.', 'litespeed-cache'); ?>
64
  <?php $this->recommended($id) ; ?>
@@ -150,9 +150,11 @@ if ( !defined('WPINC') ) die;
150
  <?php echo __('If you want to exclude certain Custom Post Types in sitemap, add the Custom Post Types in the box, one per line.', 'litespeed-cache'); ?>
151
  </div>
152
 
153
- <div class="litespeed-callout litespeed-callout-warning">
154
  <h4><?php echo __('Available Custom Post Type','litespeed-cache'); ?></h4>
155
- <?php echo implode('<br />', array_diff(get_post_types( '', 'names' ), array('post', 'page'))); ?>
 
 
156
  </div>
157
  </td>
158
  </tr>
@@ -160,32 +162,30 @@ if ( !defined('WPINC') ) die;
160
  <tr data-litespeed-selfsitemap="1">
161
  <th><?php echo __('Order links by', 'litespeed-cache'); ?></th>
162
  <td>
163
- <div class="litespeed-row">
164
- <div class="litespeed-switch litespeed-label-info">
165
- <?php echo $this->build_radio(
166
- LiteSpeed_Cache_Config::CRWL_ORDER_LINKS,
167
- LiteSpeed_Cache_Config::CRWL_DATE_DESC,
168
- __('Date, descending (Default)', 'litespeed-cache')
169
- ); ?>
170
-
171
- <?php echo $this->build_radio(
172
- LiteSpeed_Cache_Config::CRWL_ORDER_LINKS,
173
- LiteSpeed_Cache_Config::CRWL_DATE_ASC,
174
- __('Date, ascending', 'litespeed-cache')
175
- ); ?>
176
-
177
- <?php echo $this->build_radio(
178
- LiteSpeed_Cache_Config::CRWL_ORDER_LINKS,
179
- LiteSpeed_Cache_Config::CRWL_ALPHA_DESC,
180
- __('Alphabetical, descending', 'litespeed-cache')
181
- ); ?>
182
-
183
- <?php echo $this->build_radio(
184
- LiteSpeed_Cache_Config::CRWL_ORDER_LINKS,
185
- LiteSpeed_Cache_Config::CRWL_ALPHA_ASC,
186
- __('Alphabetical, ascending', 'litespeed-cache')
187
- ); ?>
188
- </div>
189
  </div>
190
  <div class="litespeed-desc">
191
  <?php echo __('Please choose one of the above options to set the order in which the sitemap will be parsed.', 'litespeed-cache'); ?>
5
 
6
  <h3 class="litespeed-title"><?php echo __('Crawler Settings', 'litespeed-cache'); ?></h3>
7
 
8
+ <table><tbody>
9
  <tr>
10
  <th><?php echo __('Delay', 'litespeed-cache'); ?></th>
11
  <td>
58
  <th><?php echo __('Threads', 'litespeed-cache'); ?></th>
59
  <td>
60
  <?php $id = LiteSpeed_Cache_Config::CRWL_THREADS ; ?>
61
+ <?php $this->build_input( $id, 'litespeed-input-short' ) ; ?>
62
  <div class="litespeed-desc">
63
  <?php echo __('Specify Number of Threads to use while crawling.', 'litespeed-cache'); ?>
64
  <?php $this->recommended($id) ; ?>
150
  <?php echo __('If you want to exclude certain Custom Post Types in sitemap, add the Custom Post Types in the box, one per line.', 'litespeed-cache'); ?>
151
  </div>
152
 
153
+ <div class="litespeed-callout-warning">
154
  <h4><?php echo __('Available Custom Post Type','litespeed-cache'); ?></h4>
155
+ <p>
156
+ <?php echo implode('<br />', array_diff(get_post_types( '', 'names' ), array('post', 'page'))); ?>
157
+ </p>
158
  </div>
159
  </td>
160
  </tr>
162
  <tr data-litespeed-selfsitemap="1">
163
  <th><?php echo __('Order links by', 'litespeed-cache'); ?></th>
164
  <td>
165
+ <div class="litespeed-switch">
166
+ <?php echo $this->build_radio(
167
+ LiteSpeed_Cache_Config::CRWL_ORDER_LINKS,
168
+ LiteSpeed_Cache_Config::CRWL_DATE_DESC,
169
+ __('Date, descending (Default)', 'litespeed-cache')
170
+ ); ?>
171
+
172
+ <?php echo $this->build_radio(
173
+ LiteSpeed_Cache_Config::CRWL_ORDER_LINKS,
174
+ LiteSpeed_Cache_Config::CRWL_DATE_ASC,
175
+ __('Date, ascending', 'litespeed-cache')
176
+ ); ?>
177
+
178
+ <?php echo $this->build_radio(
179
+ LiteSpeed_Cache_Config::CRWL_ORDER_LINKS,
180
+ LiteSpeed_Cache_Config::CRWL_ALPHA_DESC,
181
+ __('Alphabetical, descending', 'litespeed-cache')
182
+ ); ?>
183
+
184
+ <?php echo $this->build_radio(
185
+ LiteSpeed_Cache_Config::CRWL_ORDER_LINKS,
186
+ LiteSpeed_Cache_Config::CRWL_ALPHA_ASC,
187
+ __('Alphabetical, ascending', 'litespeed-cache')
188
+ ); ?>
 
 
189
  </div>
190
  <div class="litespeed-desc">
191
  <?php echo __('Please choose one of the above options to set the order in which the sitemap will be parsed.', 'litespeed-cache'); ?>
admin/tpl/settings_debug.php CHANGED
@@ -5,30 +5,28 @@ if ( ! defined( 'WPINC' ) ) die ;
5
 
6
  <h3 class="litespeed-title"><?php echo __( 'Developer Testing', 'litespeed-cache' ) ; ?></h3>
7
 
8
- <table class="form-table"><tbody>
9
  <tr>
10
  <th><?php echo __( 'Debug Log', 'litespeed-cache' ) ; ?></th>
11
  <td>
12
- <div class="litespeed-row">
13
- <div class="litespeed-switch litespeed-label-info">
14
- <?php echo $this->build_radio(
15
- LiteSpeed_Cache_Config::OPID_DEBUG,
16
- LiteSpeed_Cache_Config::VAL_OFF,
17
- __( 'Off', 'litespeed-cache' )
18
- ) ; ?>
19
-
20
- <?php echo $this->build_radio(
21
- LiteSpeed_Cache_Config::OPID_DEBUG,
22
- LiteSpeed_Cache_Config::VAL_ON,
23
- __( 'On', 'litespeed-cache' )
24
- ) ; ?>
25
-
26
- <?php echo $this->build_radio(
27
- LiteSpeed_Cache_Config::OPID_DEBUG,
28
- LiteSpeed_Cache_Config::VAL_NOTSET,
29
- __( 'Admin IP only', 'litespeed-cache' )
30
- ) ; ?>
31
- </div>
32
  </div>
33
  <div class="litespeed-desc">
34
  <?php echo __( 'Outputs to WordPress debug log.', 'litespeed-cache' ) ; ?>
@@ -54,20 +52,18 @@ if ( ! defined( 'WPINC' ) ) die ;
54
  <tr>
55
  <th><?php echo __( 'Debug Level', 'litespeed-cache' ) ; ?></th>
56
  <td>
57
- <div class="litespeed-row">
58
- <div class="litespeed-switch litespeed-label-info">
59
- <?php echo $this->build_radio(
60
- LiteSpeed_Cache_Config::OPID_DEBUG_LEVEL,
61
- LiteSpeed_Cache_Config::VAL_OFF,
62
- __( 'Basic', 'litespeed-cache' )
63
- ) ; ?>
64
-
65
- <?php echo $this->build_radio(
66
- LiteSpeed_Cache_Config::OPID_DEBUG_LEVEL,
67
- LiteSpeed_Cache_Config::VAL_ON,
68
- __( 'Advanced', 'litespeed-cache' )
69
- ) ; ?>
70
- </div>
71
  </div>
72
  <div class="litespeed-desc">
73
  <?php echo __( 'Advanced level will log more details.', 'litespeed-cache' ) ; ?>
@@ -79,7 +75,7 @@ if ( ! defined( 'WPINC' ) ) die ;
79
  <th><?php echo __( 'Log File Size Limit', 'litespeed-cache' ) ; ?></th>
80
  <td>
81
  <?php $id = LiteSpeed_Cache_Config::OPID_LOG_FILE_SIZE ; ?>
82
- <?php $this->build_input( $id, 'small-text' ) ; ?> <?php echo __( 'MB', 'litespeed-cache' ) ; ?>
83
  <div class="litespeed-desc">
84
  <?php echo __( 'Specify the maximum size of the log file. Minimum is 3MB. Maximum is 3000MB.', 'litespeed-cache' ) ; ?>
85
  <?php $this->recommended( $id ) ; ?>
5
 
6
  <h3 class="litespeed-title"><?php echo __( 'Developer Testing', 'litespeed-cache' ) ; ?></h3>
7
 
8
+ <table><tbody>
9
  <tr>
10
  <th><?php echo __( 'Debug Log', 'litespeed-cache' ) ; ?></th>
11
  <td>
12
+ <div class="litespeed-switch">
13
+ <?php echo $this->build_radio(
14
+ LiteSpeed_Cache_Config::OPID_DEBUG,
15
+ LiteSpeed_Cache_Config::VAL_OFF,
16
+ __( 'Off', 'litespeed-cache' )
17
+ ) ; ?>
18
+
19
+ <?php echo $this->build_radio(
20
+ LiteSpeed_Cache_Config::OPID_DEBUG,
21
+ LiteSpeed_Cache_Config::VAL_ON,
22
+ __( 'On', 'litespeed-cache' )
23
+ ) ; ?>
24
+
25
+ <?php echo $this->build_radio(
26
+ LiteSpeed_Cache_Config::OPID_DEBUG,
27
+ LiteSpeed_Cache_Config::VAL_ON2,
28
+ __( 'Admin IP only', 'litespeed-cache' )
29
+ ) ; ?>
 
 
30
  </div>
31
  <div class="litespeed-desc">
32
  <?php echo __( 'Outputs to WordPress debug log.', 'litespeed-cache' ) ; ?>
52
  <tr>
53
  <th><?php echo __( 'Debug Level', 'litespeed-cache' ) ; ?></th>
54
  <td>
55
+ <div class="litespeed-switch">
56
+ <?php echo $this->build_radio(
57
+ LiteSpeed_Cache_Config::OPID_DEBUG_LEVEL,
58
+ LiteSpeed_Cache_Config::VAL_OFF,
59
+ __( 'Basic', 'litespeed-cache' )
60
+ ) ; ?>
61
+
62
+ <?php echo $this->build_radio(
63
+ LiteSpeed_Cache_Config::OPID_DEBUG_LEVEL,
64
+ LiteSpeed_Cache_Config::VAL_ON,
65
+ __( 'Advanced', 'litespeed-cache' )
66
+ ) ; ?>
 
 
67
  </div>
68
  <div class="litespeed-desc">
69
  <?php echo __( 'Advanced level will log more details.', 'litespeed-cache' ) ; ?>
75
  <th><?php echo __( 'Log File Size Limit', 'litespeed-cache' ) ; ?></th>
76
  <td>
77
  <?php $id = LiteSpeed_Cache_Config::OPID_LOG_FILE_SIZE ; ?>
78
+ <?php $this->build_input( $id, 'litespeed-input-short' ) ; ?> <?php echo __( 'MB', 'litespeed-cache' ) ; ?>
79
  <div class="litespeed-desc">
80
  <?php echo __( 'Specify the maximum size of the log file. Minimum is 3MB. Maximum is 3000MB.', 'litespeed-cache' ) ; ?>
81
  <?php $this->recommended( $id ) ; ?>
admin/tpl/settings_esi.php CHANGED
@@ -1,38 +1,90 @@
1
  <?php
2
- if ( !defined('WPINC') ) die;
3
- // comments
4
- // comment form
5
- // admin bar
 
 
 
 
 
6
 
7
  ?>
8
 
9
  <h3 class="litespeed-title"><?php echo __('ESI Settings', 'litespeed-cache'); ?></h3>
10
 
11
- <p><?php echo __('ESI enables the capability to cache pages for logged in users/commenters.', 'litespeed-cache'); ?></p>
12
- <p><?php echo __('ESI functions by replacing the private information blocks with an ESI include.', 'litespeed-cache'); ?></p>
13
- <p><?php echo __('When the server sees an ESI include, a sub request is created, containing the private information.', 'litespeed-cache'); ?></p>
 
 
 
 
 
 
 
14
 
15
- <table class="form-table"><tbody>
 
 
 
 
 
 
16
  <tr>
17
  <th><?php echo __('Enable ESI', 'litespeed-cache'); ?></th>
18
  <td>
19
  <?php $this->build_switch(LiteSpeed_Cache_Config::OPID_ESI_ENABLE); ?>
20
  <div class="litespeed-desc">
21
- <?php echo __('Enabling ESI will cache the public page for logged in users.', 'litespeed-cache'); ?>
22
- <?php echo __('The Admin Bar, comments, and comment form will be served via ESI blocks.', 'litespeed-cache'); ?>
23
- <?php echo __('The ESI blocks will not be cached until Cache ESI is checked.', 'litespeed-cache'); ?>
 
 
 
 
 
 
 
 
24
  </div>
25
  </td>
26
  </tr>
27
 
28
  <tr>
29
- <th><?php echo __('Cache ESI', 'litespeed-cache'); ?></th>
30
  <td>
31
- <?php $this->build_switch(LiteSpeed_Cache_Config::OPID_ESI_CACHE); ?>
32
  <div class="litespeed-desc">
33
- <?php echo __('Cache the ESI blocks.', 'litespeed-cache'); ?>
34
  </div>
35
  </td>
36
  </tr>
37
 
38
- </tbody></table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+ if ( ! defined( 'WPINC' ) ) die ;
3
+
4
+ global $wp_roles ;
5
+ if ( !isset( $wp_roles ) ) {
6
+ $wp_roles = new WP_Roles() ;
7
+ }
8
+ $roles = array_keys( $wp_roles->roles ) ;
9
+
10
+ sort( $roles ) ;
11
 
12
  ?>
13
 
14
  <h3 class="litespeed-title"><?php echo __('ESI Settings', 'litespeed-cache'); ?></h3>
15
 
16
+ <div class="litespeed-desc">
17
+ <p><?php echo __('With ESI (Edge Side Includes), pages may be served from cache for logged-in users.', 'litespeed-cache'); ?></p>
18
+ <p><?php echo __('ESI allows you to designate parts of your dynamic page as separate fragments that are then assembled together to make the whole page. In other words, ESI lets you “punch holes” in a page, and then fill those holes with content that may be cached privately, cached publicly with its own TTL, or not cached at all.', 'litespeed-cache'); ?></p>
19
+ <p><?php echo sprintf(
20
+ __( 'Learn more about public cache vs. private cache <a %s>on our blog</a>.', 'litespeed-cache' ),
21
+ 'href="https://blog.litespeedtech.com/2017/08/30/wpw-private-cache-vs-public-cache/" target="_blank"'
22
+ ) ; ?></p>
23
+ </div>
24
+
25
+ <div class="litespeed-relative">
26
 
27
+ <?php if ( ! LSWCP_ESI_SUPPORT ) : ?>
28
+ <div class="litespeed-ent-notice">
29
+ <div class="litespeed-ent-notice-desc"><?php echo __('Available in LiteSpeed Enterprise version', 'litespeed-cache'); ?></div>
30
+ </div>
31
+ <?php endif; ?>
32
+
33
+ <table><tbody>
34
  <tr>
35
  <th><?php echo __('Enable ESI', 'litespeed-cache'); ?></th>
36
  <td>
37
  <?php $this->build_switch(LiteSpeed_Cache_Config::OPID_ESI_ENABLE); ?>
38
  <div class="litespeed-desc">
39
+ <?php echo __('Enable caches public pages for logged in users and serves the Admin Bar and Comment Form via ESI blocks. These two blocks will be uncached unless enabled below.', 'litespeed-cache'); ?>
40
+ </div>
41
+ </td>
42
+ </tr>
43
+
44
+ <tr>
45
+ <th><?php echo __('Cache Admin Bar', 'litespeed-cache'); ?></th>
46
+ <td>
47
+ <?php $this->build_switch(LiteSpeed_Cache_Config::OPID_ESI_CACHE_ADMBAR); ?>
48
+ <div class="litespeed-desc">
49
+ <?php echo __('Cache the build-in Admin Bar ESI block.', 'litespeed-cache'); ?>
50
  </div>
51
  </td>
52
  </tr>
53
 
54
  <tr>
55
+ <th><?php echo __('Cache Comment Form', 'litespeed-cache'); ?></th>
56
  <td>
57
+ <?php $this->build_switch(LiteSpeed_Cache_Config::OPID_ESI_CACHE_COMMFORM); ?>
58
  <div class="litespeed-desc">
59
+ <?php echo __('Cache the build-in Comment Form ESI block.', 'litespeed-cache'); ?>
60
  </div>
61
  </td>
62
  </tr>
63
 
64
+ <tr>
65
+ <th><?php echo __('Vary Group', 'litespeed-cache'); ?></th>
66
+ <td>
67
+ <table class="litespeed-vary-table"><tbody>
68
+ <?php foreach ( $roles as $role ): ?>
69
+ <tr>
70
+ <td class='litespeed-vary-title'><?php echo $role ; ?></td>
71
+ <td class='litespeed-vary-val'>
72
+ <input type="text" class="litespeed-input-short"
73
+ name="<?php echo LiteSpeed_Cache_Config::VARY_GROUP ; ?>[<?php echo $role ; ?>]"
74
+ value="<?php echo $this->config->in_vary_group( $role ) ; ?>" />
75
+ </td>
76
+ </tr>
77
+ <?php endforeach; ?>
78
+ </tbody></table>
79
+ <div class="litespeed-desc">
80
+ <?php echo __( 'If your site contains public content that certain user roles can see but other roles cannot, you can specify a Vary Group for those user roles. For example, specifying an administrator vary group allows there to be a separate publicly-cached page tailored to administrators (with “edit” links, etc), while all other user roles see the default public page.', 'litespeed-cache' ) ; ?>
81
+ </div>
82
+ </td>
83
+ </tr>
84
+
85
+
86
+
87
+
88
+ </tbody></table>
89
+
90
+ </div>
admin/tpl/settings_excludes.php CHANGED
@@ -10,7 +10,7 @@ if (!defined('WPINC')) die;
10
  <li><?php echo __('The urls will be compared to the REQUEST_URI server variable.', 'litespeed-cache'); ?></li>
11
  <li><?php echo __('There should only be one url per line.', 'litespeed-cache'); ?></li>
12
  </ol>
13
- <div class="litespeed-callout litespeed-callout-warning">
14
  <h4><?php echo __('NOTE:', 'litespeed-cache'); ?></h4>
15
  <ol>
16
  <li><?php echo __('URLs must start with a \'/\' to be correctly matched.', 'litespeed-cache'); ?></li>
@@ -36,7 +36,7 @@ if (!defined('WPINC')) die;
36
  <li><b><?php echo __('All categories are cached by default.', 'litespeed-cache'); ?></b></li>
37
  <li><?php echo __('To prevent a category from being cached, enter it in the text area below, one per line.', 'litespeed-cache'); ?></li>
38
  </ol>
39
- <div class="litespeed-callout litespeed-callout-warning">
40
  <h4><?php echo __('NOTE:', 'litespeed-cache'); ?></h4>
41
  <ol>
42
  <li><?php echo __('If the Category ID is not found, the name will be removed on save.', 'litespeed-cache'); ?></li>
@@ -66,7 +66,7 @@ if (!defined('WPINC')) die;
66
  <li><b><?php echo __('All tags are cached by default.', 'litespeed-cache'); ?></b></li>
67
  <li><?php echo __('To prevent tags from being cached, enter the tag in the text area below, one per line.', 'litespeed-cache'); ?></li>
68
  </ol>
69
- <div class="litespeed-callout litespeed-callout-warning">
70
  <h4><?php echo __('NOTE:', 'litespeed-cache'); ?></h4>
71
  <ol>
72
  <li><?php echo __('If the Tag ID is not found, the name will be removed on save.', 'litespeed-cache'); ?></li>
10
  <li><?php echo __('The urls will be compared to the REQUEST_URI server variable.', 'litespeed-cache'); ?></li>
11
  <li><?php echo __('There should only be one url per line.', 'litespeed-cache'); ?></li>
12
  </ol>
13
+ <div class="litespeed-callout-warning">
14
  <h4><?php echo __('NOTE:', 'litespeed-cache'); ?></h4>
15
  <ol>
16
  <li><?php echo __('URLs must start with a \'/\' to be correctly matched.', 'litespeed-cache'); ?></li>
36
  <li><b><?php echo __('All categories are cached by default.', 'litespeed-cache'); ?></b></li>
37
  <li><?php echo __('To prevent a category from being cached, enter it in the text area below, one per line.', 'litespeed-cache'); ?></li>
38
  </ol>
39
+ <div class="litespeed-callout-warning">
40
  <h4><?php echo __('NOTE:', 'litespeed-cache'); ?></h4>
41
  <ol>
42
  <li><?php echo __('If the Category ID is not found, the name will be removed on save.', 'litespeed-cache'); ?></li>
66
  <li><b><?php echo __('All tags are cached by default.', 'litespeed-cache'); ?></b></li>
67
  <li><?php echo __('To prevent tags from being cached, enter the tag in the text area below, one per line.', 'litespeed-cache'); ?></li>
68
  </ol>
69
+ <div class="litespeed-callout-warning">
70
  <h4><?php echo __('NOTE:', 'litespeed-cache'); ?></h4>
71
  <ol>
72
  <li><?php echo __('If the Tag ID is not found, the name will be removed on save.', 'litespeed-cache'); ?></li>
admin/tpl/settings_general.php CHANGED
@@ -4,7 +4,7 @@ if (!defined('WPINC')) die;
4
  ?>
5
  <h3 class="litespeed-title"><?php echo __('General', 'litespeed-cache'); ?></h3>
6
 
7
- <table class="form-table"><tbody>
8
  <tr>
9
  <th><?php echo __('Enable LiteSpeed Cache', 'litespeed-cache'); ?></th>
10
  <td>
@@ -17,30 +17,28 @@ if (!defined('WPINC')) die;
17
  $_options[$id] = 1;
18
  }
19
  ?>
20
- <div class="litespeed-row">
21
- <div class="litespeed-switch litespeed-label-info">
22
- <?php echo $this->build_radio(
23
- $id,
24
- LiteSpeed_Cache_Config::VAL_ON,
25
- __('Enable', 'litespeed-cache')
26
- ); ?>
27
 
28
- <?php echo $this->build_radio(
29
- $id,
30
- LiteSpeed_Cache_Config::VAL_OFF,
31
- __('Disable', 'litespeed-cache')
32
- ); ?>
33
 
34
- <?php
35
- if ( is_multisite() ){
36
- echo $this->build_radio(
37
- $id,
38
- LiteSpeed_Cache_Config::VAL_NOTSET,
39
- __('Use Network Admin Setting', 'litespeed-cache')
40
- );
41
- }
42
- ?>
43
- </div>
44
  </div>
45
  <div class="litespeed-desc">
46
  <?php echo sprintf(__('Please visit the <a %s>Information</a> page on how to test the cache.', 'litespeed-cache'),
@@ -66,6 +64,18 @@ if (!defined('WPINC')) die;
66
  </td>
67
  </tr>
68
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  <tr>
70
  <th><?php echo __('Default Front Page TTL', 'litespeed-cache'); ?></th>
71
  <td>
4
  ?>
5
  <h3 class="litespeed-title"><?php echo __('General', 'litespeed-cache'); ?></h3>
6
 
7
+ <table><tbody>
8
  <tr>
9
  <th><?php echo __('Enable LiteSpeed Cache', 'litespeed-cache'); ?></th>
10
  <td>
17
  $_options[$id] = 1;
18
  }
19
  ?>
20
+ <div class="litespeed-switch">
21
+ <?php echo $this->build_radio(
22
+ $id,
23
+ LiteSpeed_Cache_Config::VAL_OFF,
24
+ __('Disable', 'litespeed-cache')
25
+ ); ?>
 
26
 
27
+ <?php echo $this->build_radio(
28
+ $id,
29
+ LiteSpeed_Cache_Config::VAL_ON,
30
+ __('Enable', 'litespeed-cache')
31
+ ); ?>
32
 
33
+ <?php
34
+ if ( is_multisite() ){
35
+ echo $this->build_radio(
36
+ $id,
37
+ LiteSpeed_Cache_Config::VAL_ON2,
38
+ __('Use Network Admin Setting', 'litespeed-cache')
39
+ );
40
+ }
41
+ ?>
 
42
  </div>
43
  <div class="litespeed-desc">
44
  <?php echo sprintf(__('Please visit the <a %s>Information</a> page on how to test the cache.', 'litespeed-cache'),
64
  </td>
65
  </tr>
66
 
67
+ <tr>
68
+ <th><?php echo __('Default Private Cache TTL', 'litespeed-cache'); ?></th>
69
+ <td>
70
+ <?php $id = LiteSpeed_Cache_Config::OPID_PRIVATE_TTL ; ?>
71
+ <?php $this->build_input($id); ?> <?php echo __('seconds', 'litespeed-cache'); ?>
72
+ <div class="litespeed-desc">
73
+ <?php echo sprintf( __( 'Specify how long, in seconds, private pages are cached. Minimum is %1$s seconds. Maximum is %2$s seconds.', 'litespeed-cache' ), 60, 3600 ) ; ?>
74
+ <?php $this->recommended($id) ; ?>
75
+ </div>
76
+ </td>
77
+ </tr>
78
+
79
  <tr>
80
  <th><?php echo __('Default Front Page TTL', 'litespeed-cache'); ?></th>
81
  <td>
admin/tpl/settings_inc.cache_favicon.php CHANGED
@@ -9,7 +9,7 @@ $file_writable = LiteSpeed_Cache_Admin_Rules::writable();
9
  <?php $this->build_switch(LiteSpeed_Cache_Config::OPID_CACHE_FAVICON);/*, !$file_writable*/ ?>
10
  <div class="litespeed-desc">
11
  <?php echo __('favicon.ico is requested on most pages.', 'litespeed-cache'); ?>
12
- <?php echo __('Caching this recource may improve server performance by avoiding unnecessary PHP calls.', 'litespeed-cache'); ?>
13
  </div>
14
  </td>
15
  </tr>
9
  <?php $this->build_switch(LiteSpeed_Cache_Config::OPID_CACHE_FAVICON);/*, !$file_writable*/ ?>
10
  <div class="litespeed-desc">
11
  <?php echo __('favicon.ico is requested on most pages.', 'litespeed-cache'); ?>
12
+ <?php echo __('Caching this resource may improve server performance by avoiding unnecessary PHP calls.', 'litespeed-cache'); ?>
13
  </div>
14
  </td>
15
  </tr>
admin/tpl/settings_inc.cache_mobile.php CHANGED
@@ -43,16 +43,16 @@ if (!defined('WPINC')) die;
43
  }
44
 
45
  if ( $mobile_agents !== $_options[$id] ){
46
- echo '<p class="attention">'
47
  . __('Htaccess did not match configuration option.', 'litespeed-cache')
48
  . ' ' . __('Please re-enter the mobile view setting.', 'litespeed-cache')
49
  . ' ' . sprintf(__('List in WordPress database is: %s', 'litespeed-cache'), '<b>' . $_options[$id] . '</b>')
50
- . '</p>';
51
  }
52
  }
53
  }
54
 
55
- $this->build_input($id, 'large-text widget ui-draggable-dragging code', false, !$_options[$id], 'litespeed-mobileview-rules', $input_value);
56
  ?>
57
 
58
  <input type="hidden" name="<?php echo LiteSpeed_Cache_Config::OPTION_NAME; ?>[<?php echo $id; ?>__default]"
43
  }
44
 
45
  if ( $mobile_agents !== $_options[$id] ){
46
+ echo '<div class="litespeed-callout-danger">'
47
  . __('Htaccess did not match configuration option.', 'litespeed-cache')
48
  . ' ' . __('Please re-enter the mobile view setting.', 'litespeed-cache')
49
  . ' ' . sprintf(__('List in WordPress database is: %s', 'litespeed-cache'), '<b>' . $_options[$id] . '</b>')
50
+ . '</div>';
51
  }
52
  }
53
  }
54
 
55
+ $this->build_input($id, 'litespeed-input-long', false, !$_options[$id], 'litespeed-mobileview-rules', $input_value);
56
  ?>
57
 
58
  <input type="hidden" name="<?php echo LiteSpeed_Cache_Config::OPTION_NAME; ?>[<?php echo $id; ?>__default]"
admin/tpl/settings_inc.exclude_cookies.php CHANGED
@@ -1,7 +1,7 @@
1
  <!-- build_setting_exclude_cookies -->
2
  <h3 class="litespeed-title"><?php echo __('Cookie List', 'litespeed-cache'); ?></h3>
3
  <p><?php echo __('To prevent cookies from being cached, enter it in the text area below.', 'litespeed-cache'); ?></p>
4
- <div class="litespeed-callout litespeed-callout-warning">
5
  <h4><?php echo __('NOTE:', 'litespeed-cache'); ?></h4>
6
  <ol>
7
  <li><?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?></li>
1
  <!-- build_setting_exclude_cookies -->
2
  <h3 class="litespeed-title"><?php echo __('Cookie List', 'litespeed-cache'); ?></h3>
3
  <p><?php echo __('To prevent cookies from being cached, enter it in the text area below.', 'litespeed-cache'); ?></p>
4
+ <div class="litespeed-callout-warning">
5
  <h4><?php echo __('NOTE:', 'litespeed-cache'); ?></h4>
6
  <ol>
7
  <li><?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?></li>
admin/tpl/settings_inc.exclude_useragent.php CHANGED
@@ -6,7 +6,7 @@ if (!defined('WPINC')) die;
6
  <!-- build_setting_exclude_useragent -->
7
  <h3 class="litespeed-title"><?php echo __('User Agent List', 'litespeed-cache'); ?></h3>
8
  <p><?php echo __('To prevent user agents from being cached, enter it in the text field below.', 'litespeed-cache'); ?></p>
9
- <div class="litespeed-callout litespeed-callout-warning">
10
  <h4><?php echo __('NOTE:', 'litespeed-cache'); ?></h4>
11
  <ol>
12
  <li><?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?></li>
6
  <!-- build_setting_exclude_useragent -->
7
  <h3 class="litespeed-title"><?php echo __('User Agent List', 'litespeed-cache'); ?></h3>
8
  <p><?php echo __('To prevent user agents from being cached, enter it in the text field below.', 'litespeed-cache'); ?></p>
9
+ <div class="litespeed-callout-warning">
10
  <h4><?php echo __('NOTE:', 'litespeed-cache'); ?></h4>
11
  <ol>
12
  <li><?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?></li>
admin/tpl/settings_optimize.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! defined( 'WPINC' ) ) die ;
3
+
4
+
5
+ ?>
6
+
7
+ <h3 class="litespeed-title"><?php echo __( 'Optimization Settings', 'litespeed-cache' ) ; ?></h3>
8
+
9
+ <div class="litespeed-callout-warning">
10
+ <h4><?php echo __( 'NOTICE:', 'litespeed-cache' ) ; ?></h4>
11
+ <p><?php echo __( 'Please test thoroughly when enabling any option in this list. After changing Minify/Combine settings, please do a Purge All action.', 'litespeed-cache' ) ; ?></p>
12
+ </div>
13
+
14
+
15
+ <table><tbody>
16
+ <tr>
17
+ <th><?php echo __( 'CSS Minify', 'litespeed-cache' ) ; ?></th>
18
+ <td>
19
+ <?php $this->build_switch( LiteSpeed_Cache_Config::OPID_CSS_MINIFY ) ; ?>
20
+ <div class="litespeed-desc">
21
+ <?php echo __( 'Minify CSS files.', 'litespeed-cache' ) ; ?>
22
+ </div>
23
+ </td>
24
+ </tr>
25
+
26
+ <tr>
27
+ <th><?php echo __( 'CSS Combine', 'litespeed-cache' ) ; ?></th>
28
+ <td>
29
+ <?php $this->build_switch( LiteSpeed_Cache_Config::OPID_CSS_COMBINE ) ; ?>
30
+ <div class="litespeed-desc">
31
+ <?php echo __( 'Combine CSS files.', 'litespeed-cache' ) ; ?>
32
+ </div>
33
+ </td>
34
+ </tr>
35
+
36
+ <tr>
37
+ <th><?php echo __( 'CSS HTTP/2 Push', 'litespeed-cache' ) ; ?></th>
38
+ <td>
39
+ <?php $this->build_switch( LiteSpeed_Cache_Config::OPID_CSS_HTTP2 ) ; ?>
40
+ <div class="litespeed-desc">
41
+ <?php echo __( 'Pre-send internal CSS files to the browser before they are requested. (Requires the HTTP/2 protocol)', 'litespeed-cache' ) ; ?>
42
+ </div>
43
+ </td>
44
+ </tr>
45
+
46
+ <tr>
47
+ <th><?php echo __( 'CSS Excludes', 'litespeed-cache' ) ; ?></th>
48
+ <td>
49
+ <?php $this->build_textarea(LiteSpeed_Cache_Config::OPID_CSS_EXCLUDES); ?>
50
+ <div class="litespeed-desc">
51
+ <?php echo __( 'Listed CSS files will not be minified/combined. The full URL or a partial string can be used.', 'litespeed-cache' ) ; ?>
52
+ </div>
53
+ </td>
54
+ </tr>
55
+
56
+ <tr>
57
+ <th><?php echo __( 'JS Minify', 'litespeed-cache' ) ; ?></th>
58
+ <td>
59
+ <?php $this->build_switch( LiteSpeed_Cache_Config::OPID_JS_MINIFY ) ; ?>
60
+ <div class="litespeed-desc">
61
+ <?php echo __( 'Minify JS files.', 'litespeed-cache' ) ; ?>
62
+ </div>
63
+ </td>
64
+ </tr>
65
+
66
+ <tr>
67
+ <th><?php echo __( 'JS Combine', 'litespeed-cache' ) ; ?></th>
68
+ <td>
69
+ <?php $this->build_switch( LiteSpeed_Cache_Config::OPID_JS_COMBINE ) ; ?>
70
+ <div class="litespeed-desc">
71
+ <?php echo __( 'Combine JS files.', 'litespeed-cache' ) ; ?>
72
+ </div>
73
+ </td>
74
+ </tr>
75
+
76
+ <tr>
77
+ <th><?php echo __( 'JS HTTP/2 Push', 'litespeed-cache' ) ; ?></th>
78
+ <td>
79
+ <?php $this->build_switch( LiteSpeed_Cache_Config::OPID_JS_HTTP2 ) ; ?>
80
+ <div class="litespeed-desc">
81
+ <?php echo __( 'Pre-send internal JS files to the browser before they are requested. (Requires the HTTP/2 protocol)', 'litespeed-cache' ) ; ?>
82
+ </div>
83
+ </td>
84
+ </tr>
85
+
86
+ <tr>
87
+ <th><?php echo __( 'JS Excludes', 'litespeed-cache' ) ; ?></th>
88
+ <td>
89
+ <?php $this->build_textarea(LiteSpeed_Cache_Config::OPID_JS_EXCLUDES); ?>
90
+ <div class="litespeed-desc">
91
+ <?php echo __( 'Listed JS files will not be minified/combined. The full URL or a partial string can be used.', 'litespeed-cache' ) ; ?>
92
+ </div>
93
+ </td>
94
+ </tr>
95
+
96
+ <tr>
97
+ <th><?php echo __( 'CSS/JS Cache TTL', 'litespeed-cache' ) ; ?></th>
98
+ <td>
99
+ <?php $id = LiteSpeed_Cache_Config::OPID_OPTIMIZE_TTL ; ?>
100
+ <?php $this->build_input( $id ) ; ?> <?php echo __( 'seconds', 'litespeed-cache' ) ; ?>
101
+ <div class="litespeed-desc">
102
+ <?php echo sprintf( __( 'Specify how long, in seconds, CSS/JS files are cached. Minimum is %1$s seconds.', 'litespeed-cache' ), 3600 ) ; ?>
103
+ <?php $this->recommended( $id ) ; ?>
104
+ </div>
105
+ </td>
106
+ </tr>
107
+
108
+ <tr>
109
+ <th><?php echo __( 'HTML Minify', 'litespeed-cache' ) ; ?></th>
110
+ <td>
111
+ <?php $this->build_switch( LiteSpeed_Cache_Config::OPID_HTML_MINIFY ) ; ?>
112
+ <div class="litespeed-desc">
113
+ <?php echo __( 'Minify HTML content.', 'litespeed-cache' ) ; ?>
114
+ </div>
115
+ </td>
116
+ </tr>
117
+
118
+ </tbody></table>
admin/tpl/settings_purge.php CHANGED
@@ -34,7 +34,7 @@ $breakArr = array(
34
 
35
  ?>
36
 
37
- <table class="form-table"><tbody>
38
 
39
  <?php if (!is_multisite()): ?>
40
  <?php require LSWCP_DIR . 'admin/tpl/settings_inc.purge_on_upgrade.php'; ?>
@@ -43,24 +43,22 @@ $breakArr = array(
43
  <tr>
44
  <th><?php echo __('Auto Purge Rules For Publish/Update', 'litespeed-cache'); ?></th>
45
  <td>
46
- <div class="litespeed-desc">
47
- <div class="litespeed-callout litespeed-callout-warning">
48
- <h4><?php echo __('Note:', 'litespeed-cache'); ?></h4>
49
- <i>
50
- <?php echo __('Select "All" if there are dynamic widgets linked to posts on pages other than the front or home pages.', 'litespeed-cache'); ?><br />
51
- <?php echo __('Other checkboxes will be ignored.', 'litespeed-cache'); ?><br />
52
- <?php echo __('Select only the archive types that are currently used, the others can be left unchecked.', 'litespeed-cache'); ?>
53
- </i>
54
- </div>
55
  </div>
56
- <div class="litespeed-row litespeed-top20">
57
  <?php
58
  foreach ($optionArr as $id => $title){
59
 
60
  $this->build_checkbox("purge_$id", $title, in_array($id, $purge_options));
61
 
62
  if ( in_array($id, $breakArr) ){
63
- echo '</div><div class="litespeed-row litespeed-top20">';
64
  }
65
  }
66
  ?>
34
 
35
  ?>
36
 
37
+ <table><tbody>
38
 
39
  <?php if (!is_multisite()): ?>
40
  <?php require LSWCP_DIR . 'admin/tpl/settings_inc.purge_on_upgrade.php'; ?>
43
  <tr>
44
  <th><?php echo __('Auto Purge Rules For Publish/Update', 'litespeed-cache'); ?></th>
45
  <td>
46
+ <div class="litespeed-callout-warning">
47
+ <h4><?php echo __('Note:', 'litespeed-cache'); ?></h4>
48
+ <i>
49
+ <?php echo __('Select "All" if there are dynamic widgets linked to posts on pages other than the front or home pages.', 'litespeed-cache'); ?><br />
50
+ <?php echo __('Other checkboxes will be ignored.', 'litespeed-cache'); ?><br />
51
+ <?php echo __('Select only the archive types that are currently used, the others can be left unchecked.', 'litespeed-cache'); ?>
52
+ </i>
 
 
53
  </div>
54
+ <div class="litespeed-top20">
55
  <?php
56
  foreach ($optionArr as $id => $title){
57
 
58
  $this->build_checkbox("purge_$id", $title, in_array($id, $purge_options));
59
 
60
  if ( in_array($id, $breakArr) ){
61
+ echo '</div><div class="litespeed-top20">';
62
  }
63
  }
64
  ?>
admin/tpl/snowman.inc.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
- wp_enqueue_style('litespeed-cache-snowman', plugin_dir_url(__FILE__) . '../css/snowman.css');
3
- ?>
4
- <div class="olaf">
5
- <div class="head">
6
- <div class="top">
7
- <div class="shadow"></div>
8
- </div>
9
- <div class="hair">
10
- <span>
11
- <span></span>
12
- <span>
13
- <span></span>
14
- </span>
15
- </span>
16
- <span>
17
- <span>
18
- <span></span>
19
- </span>
20
- </span>
21
- <span>
22
- <span>
23
- <span></span>
24
- <span></span>
25
- </span>
26
- </span>
27
- </div>
28
- <div class="brow left"></div>
29
- <div class="brow right"></div>
30
- <div class="eye left">
31
- <div class="pupil"></div>
32
- </div>
33
- <div class="eye right">
34
- <div class="pupil"></div>
35
- </div>
36
- <div class="nose"></div>
37
- <div class="mouth"></div>
38
- <div class="top-lip"></div>
39
- <div class="tooth"></div>
40
- <div class="bottom-lip"></div>
41
- </div>
42
- <div class="body top">
43
- <div class="button"></div>
44
- </div>
45
- <div class="body bottom">
46
- <div class="button"></div>
47
- <div class="button"></div>
48
- </div>
49
- <div class="arm left">
50
- <div class="upper-arm">
51
- <span></span>
52
- <div class="lower-arm">
53
- <span></span>
54
- <div class="hand">
55
- <span></span>
56
- <div class="fingers">
57
- <span></span>
58
- <span></span>
59
- <span></span>
60
- <span></span>
61
- </div>
62
- </div>
63
- </div>
64
- </div>
65
- </div>
66
- <div class="arm right">
67
- <div class="upper-arm">
68
- <span></span>
69
- <div class="lower-arm">
70
- <span></span>
71
- <div class="hand">
72
- <span></span>
73
- <div class="fingers">
74
- <span></span>
75
- <span></span>
76
- <span></span>
77
- <span></span>
78
- </div>
79
- </div>
80
- </div>
81
- </div>
82
- </div>
83
- <div class="foot left"></div>
84
- <div class="foot right"></div>
85
- <div class="shadow"></div>
86
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cli/litespeed-cache-cli-admin.class.php CHANGED
@@ -21,6 +21,9 @@ class LiteSpeed_Cache_Cli_Admin
21
  LiteSpeed_Cache_Config::OPID_CACHE_FAVICON,
22
  LiteSpeed_Cache_Config::OPID_CACHE_RES,
23
  LiteSpeed_Cache_Config::OPID_CHECK_ADVANCEDCACHE,
 
 
 
24
  LiteSpeed_Cache_Config::CRWL_POSTS,
25
  LiteSpeed_Cache_Config::CRWL_PAGES,
26
  LiteSpeed_Cache_Config::CRWL_CATS,
@@ -31,6 +34,19 @@ class LiteSpeed_Cache_Cli_Admin
31
  LiteSpeed_Cache_Config::OPID_DEBUG_COOKIE,
32
  LiteSpeed_Cache_Config::OPID_COLLAPS_QS,
33
  LiteSpeed_Cache_Config::OPID_LOG_FILTERS,
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  ) ;
35
  self::$purges = array(
36
  'purge_' . LiteSpeed_Cache_Config::PURGE_ALL_PAGES => LiteSpeed_Cache_Config::PURGE_ALL_PAGES,
@@ -96,6 +112,9 @@ class LiteSpeed_Cache_Cli_Admin
96
  case LiteSpeed_Cache_Config::OPID_CACHE_FAVICON:
97
  case LiteSpeed_Cache_Config::OPID_CACHE_RES:
98
  case LiteSpeed_Cache_Config::OPID_CHECK_ADVANCEDCACHE:
 
 
 
99
  case LiteSpeed_Cache_Config::CRWL_POSTS:
100
  case LiteSpeed_Cache_Config::CRWL_PAGES:
101
  case LiteSpeed_Cache_Config::CRWL_CATS:
@@ -106,6 +125,17 @@ class LiteSpeed_Cache_Cli_Admin
106
  case LiteSpeed_Cache_Config::OPID_DEBUG_COOKIE:
107
  case LiteSpeed_Cache_Config::OPID_COLLAPS_QS:
108
  case LiteSpeed_Cache_Config::OPID_LOG_FILTERS:
 
 
 
 
 
 
 
 
 
 
 
109
  //checkbox
110
  if ( $val === 'true' ) {
111
  $options[$key] = LiteSpeed_Cache_Config::VAL_ON ;
@@ -313,7 +343,7 @@ class LiteSpeed_Cache_Cli_Admin
313
  $ret = LiteSpeed_Cache_Config::get_instance()->update_options($output) ;
314
 
315
  if ( $ret ) {
316
- WP_CLI::success('Options updated. Please purge the cache. New options: ' . print_r($output, true)) ;
317
  }
318
  else {
319
  WP_CLI::error('No options updated.') ;
21
  LiteSpeed_Cache_Config::OPID_CACHE_FAVICON,
22
  LiteSpeed_Cache_Config::OPID_CACHE_RES,
23
  LiteSpeed_Cache_Config::OPID_CHECK_ADVANCEDCACHE,
24
+ LiteSpeed_Cache_Config::OPID_ESI_ENABLE,
25
+ LiteSpeed_Cache_Config::OPID_ESI_CACHE_ADMBAR,
26
+ LiteSpeed_Cache_Config::OPID_ESI_CACHE_COMMFORM,
27
  LiteSpeed_Cache_Config::CRWL_POSTS,
28
  LiteSpeed_Cache_Config::CRWL_PAGES,
29
  LiteSpeed_Cache_Config::CRWL_CATS,
34
  LiteSpeed_Cache_Config::OPID_DEBUG_COOKIE,
35
  LiteSpeed_Cache_Config::OPID_COLLAPS_QS,
36
  LiteSpeed_Cache_Config::OPID_LOG_FILTERS,
37
+
38
+ LiteSpeed_Cache_Config::OPID_CSS_MINIFY,
39
+ LiteSpeed_Cache_Config::OPID_CSS_COMBINE,
40
+ LiteSpeed_Cache_Config::OPID_CSS_HTTP2,
41
+ LiteSpeed_Cache_Config::OPID_JS_MINIFY,
42
+ LiteSpeed_Cache_Config::OPID_JS_COMBINE,
43
+ LiteSpeed_Cache_Config::OPID_JS_HTTP2,
44
+ LiteSpeed_Cache_Config::OPID_HTML_MINIFY,
45
+
46
+ LiteSpeed_Cache_Config::OPID_CDN,
47
+ LiteSpeed_Cache_Config::OPID_CDN_INC_IMG,
48
+ LiteSpeed_Cache_Config::OPID_CDN_INC_CSS,
49
+ LiteSpeed_Cache_Config::OPID_CDN_INC_JS,
50
  ) ;
51
  self::$purges = array(
52
  'purge_' . LiteSpeed_Cache_Config::PURGE_ALL_PAGES => LiteSpeed_Cache_Config::PURGE_ALL_PAGES,
112
  case LiteSpeed_Cache_Config::OPID_CACHE_FAVICON:
113
  case LiteSpeed_Cache_Config::OPID_CACHE_RES:
114
  case LiteSpeed_Cache_Config::OPID_CHECK_ADVANCEDCACHE:
115
+ case LiteSpeed_Cache_Config::OPID_ESI_ENABLE:
116
+ case LiteSpeed_Cache_Config::OPID_ESI_CACHE_ADMBAR:
117
+ case LiteSpeed_Cache_Config::OPID_ESI_CACHE_COMMFORM:
118
  case LiteSpeed_Cache_Config::CRWL_POSTS:
119
  case LiteSpeed_Cache_Config::CRWL_PAGES:
120
  case LiteSpeed_Cache_Config::CRWL_CATS:
125
  case LiteSpeed_Cache_Config::OPID_DEBUG_COOKIE:
126
  case LiteSpeed_Cache_Config::OPID_COLLAPS_QS:
127
  case LiteSpeed_Cache_Config::OPID_LOG_FILTERS:
128
+
129
+ case LiteSpeed_Cache_Config::OPID_CSS_MINIFY:
130
+ case LiteSpeed_Cache_Config::OPID_CSS_COMBINE:
131
+ case LiteSpeed_Cache_Config::OPID_JS_MINIFY:
132
+ case LiteSpeed_Cache_Config::OPID_JS_COMBINE:
133
+ case LiteSpeed_Cache_Config::OPID_HTML_MINIFY:
134
+
135
+ case LiteSpeed_Cache_Config::OPID_CDN:
136
+ case LiteSpeed_Cache_Config::OPID_CDN_INC_IMG:
137
+ case LiteSpeed_Cache_Config::OPID_CDN_INC_CSS:
138
+ case LiteSpeed_Cache_Config::OPID_CDN_INC_JS:
139
  //checkbox
140
  if ( $val === 'true' ) {
141
  $options[$key] = LiteSpeed_Cache_Config::VAL_ON ;
343
  $ret = LiteSpeed_Cache_Config::get_instance()->update_options($output) ;
344
 
345
  if ( $ret ) {
346
+ WP_CLI::success('Options updated. Please purge the cache. New options: ' . var_export($output, true)) ;
347
  }
348
  else {
349
  WP_CLI::error('No options updated.') ;
includes/litespeed-cache-api.class.php CHANGED
@@ -30,6 +30,10 @@ class LiteSpeed_Cache_API
30
  const WIDGET_OPID_ESIENABLE = LiteSpeed_Cache_ESI::WIDGET_OPID_ESIENABLE ;
31
  const WIDGET_OPID_TTL = LiteSpeed_Cache_ESI::WIDGET_OPID_TTL ;
32
 
 
 
 
 
33
  /**
34
  * Set mobile
35
  *
@@ -52,6 +56,17 @@ class LiteSpeed_Cache_API
52
  LiteSpeed_Cache_Control::set_private() ;
53
  }
54
 
 
 
 
 
 
 
 
 
 
 
 
55
  /**
56
  * Set cache status to not cacheable
57
  *
@@ -335,6 +350,17 @@ class LiteSpeed_Cache_API
335
  LiteSpeed_Cache_Log::debug($info) ;
336
  }
337
 
 
 
 
 
 
 
 
 
 
 
 
338
  /**
339
  * Get cfg setting value
340
  *
30
  const WIDGET_OPID_ESIENABLE = LiteSpeed_Cache_ESI::WIDGET_OPID_ESIENABLE ;
31
  const WIDGET_OPID_TTL = LiteSpeed_Cache_ESI::WIDGET_OPID_TTL ;
32
 
33
+ const VAL_OFF = LiteSpeed_Cache_Config::VAL_OFF ;
34
+ const VAL_ON = LiteSpeed_Cache_Config::VAL_ON ;
35
+ const VAL_ON2 = LiteSpeed_Cache_Config::VAL_ON2 ;
36
+
37
  /**
38
  * Set mobile
39
  *
56
  LiteSpeed_Cache_Control::set_private() ;
57
  }
58
 
59
+ /**
60
+ * Set cache status to no vary
61
+ *
62
+ * @since 1.2.0
63
+ * @access public
64
+ */
65
+ public static function set_cache_no_vary()
66
+ {
67
+ LiteSpeed_Cache_Control::set_no_vary() ;
68
+ }
69
+
70
  /**
71
  * Set cache status to not cacheable
72
  *
350
  LiteSpeed_Cache_Log::debug($info) ;
351
  }
352
 
353
+ /**
354
+ * Get ESI enable setting value
355
+ *
356
+ * @since 1.2.0
357
+ * @access public
358
+ */
359
+ public static function esi_enabled()
360
+ {
361
+ return LiteSpeed_Cache_Router::esi_enabled() ;
362
+ }
363
+
364
  /**
365
  * Get cfg setting value
366
  *
includes/litespeed-cache-cdn.class.php ADDED
@@ -0,0 +1,388 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * The CDN class.
5
+ *
6
+ * @since 1.2.3
7
+ * @package LiteSpeed_Cache
8
+ * @subpackage LiteSpeed_Cache/includes
9
+ * @author LiteSpeed Technologies <info@litespeedtech.com>
10
+ */
11
+
12
+ class LiteSpeed_Cache_CDN
13
+ {
14
+ private static $_instance ;
15
+
16
+ const BYPASS = 'LITESPEED_BYPASS_CDN' ;
17
+
18
+ private $content ;
19
+
20
+ private $cfg_cdn ;
21
+ private $cfg_url_ori ;
22
+ private $cfg_cdn_url ;
23
+ private $cfg_cdn_inc_img ;
24
+ private $cfg_cdn_inc_css ;
25
+ private $cfg_cdn_inc_js ;
26
+ private $cfg_cdn_filetype ;
27
+ private $cfg_cdn_exclude ;
28
+
29
+ /**
30
+ * Init
31
+ *
32
+ * @since 1.2.3
33
+ * @access private
34
+ */
35
+ private function __construct()
36
+ {
37
+ LiteSpeed_Cache_Log::debug2( 'CDN init' ) ;
38
+
39
+ if ( ! $this->can_cdn() ) {
40
+ if ( ! defined( self::BYPASS ) ) {
41
+ define( self::BYPASS, true ) ;
42
+ }
43
+ return ;
44
+ }
45
+
46
+ $this->cfg_cdn = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_CDN ) ;
47
+ if ( ! $this->cfg_cdn ) {
48
+ if ( ! defined( self::BYPASS ) ) {
49
+ define( self::BYPASS, true ) ;
50
+ }
51
+ return ;
52
+ }
53
+
54
+ $this->cfg_url_ori = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_CDN_ORI ) ;
55
+ $this->cfg_cdn_url = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_CDN_URL ) ;
56
+ if ( ! $this->cfg_url_ori || ! $this->cfg_cdn_url ) {
57
+ if ( ! defined( self::BYPASS ) ) {
58
+ define( self::BYPASS, true ) ;
59
+ }
60
+ return ;
61
+ }
62
+
63
+ $this->cfg_cdn_inc_img = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_CDN_INC_IMG ) ;
64
+ $this->cfg_cdn_inc_css = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_CDN_INC_CSS ) ;
65
+ $this->cfg_cdn_inc_js = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_CDN_INC_JS ) ;
66
+ $this->cfg_cdn_filetype = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_CDN_FILETYPE ) ;
67
+ if ( ! $this->cfg_cdn_inc_img && ! $this->cfg_cdn_inc_css && ! $this->cfg_cdn_inc_js && ! $this->cfg_cdn_filetype ) {
68
+ if ( ! defined( self::BYPASS ) ) {
69
+ define( self::BYPASS, true ) ;
70
+ }
71
+ return ;
72
+ }
73
+
74
+ $this->cfg_cdn_filetype = explode( "\n", $this->cfg_cdn_filetype ) ;
75
+
76
+ $this->cfg_cdn_exclude = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_CDN_EXCLUDE ) ;
77
+ $this->cfg_cdn_exclude = explode( "\n", $this->cfg_cdn_exclude ) ;
78
+
79
+ if ( $this->cfg_cdn_inc_img ) {
80
+ // Hook to srcset
81
+ if ( function_exists( 'wp_calculate_image_srcset' ) ) {
82
+ add_filter( 'wp_calculate_image_srcset', __CLASS__ . '::srcset', 999 ) ;
83
+ }
84
+ // Hook to mime icon
85
+ add_filter( 'wp_get_attachment_image_src', __CLASS__ . '::attach_img_src', 999 ) ;
86
+ add_filter( 'wp_get_attachment_url', __CLASS__ . '::url', 999 ) ;
87
+ }
88
+
89
+ if ( $this->cfg_cdn_inc_css ) {
90
+ add_filter( 'style_loader_src', __CLASS__ . '::url', 999 ) ;
91
+ }
92
+
93
+ if ( $this->cfg_cdn_inc_js ) {
94
+ add_filter( 'script_loader_src', __CLASS__ . '::url', 999 ) ;
95
+ }
96
+
97
+ }
98
+
99
+ /**
100
+ * Check if the host is the CDN internal host
101
+ *
102
+ * @since 1.2.3
103
+ *
104
+ */
105
+ public static function internal( $host )
106
+ {
107
+ if ( defined( self::BYPASS ) ) {
108
+ return false ;
109
+ }
110
+
111
+ if ( ! defined( 'LITESPEED_CDN_HOST' ) ) {
112
+ $instance = self::get_instance() ;
113
+ define( 'LITESPEED_CDN_HOST', parse_url( $instance->cfg_cdn_url, PHP_URL_HOST ) ) ;
114
+ }
115
+
116
+ return $host === LITESPEED_CDN_HOST ;
117
+ }
118
+
119
+ /**
120
+ * Run CDN process
121
+ * NOTE: As this is after cache finalized, can NOT set any cache control anymore
122
+ *
123
+ * @since 1.2.3
124
+ * @access public
125
+ * @return string The content that is after optimization
126
+ */
127
+ public static function run( $content )
128
+ {
129
+ $instance = self::get_instance() ;
130
+ $instance->content = $content ;
131
+
132
+ $instance->_process() ;
133
+ return $instance->content ;
134
+ }
135
+
136
+ /**
137
+ * Check if it can use CDN replacement
138
+ *
139
+ * @since 1.2.3
140
+ * @access public
141
+ */
142
+ public function can_cdn()
143
+ {
144
+ if ( is_admin() ) {
145
+ return false ;
146
+ }
147
+
148
+ if ( is_feed() ) {
149
+ return false ;
150
+ }
151
+
152
+ if ( is_preview() ) {
153
+ return false ;
154
+ }
155
+
156
+ return true ;
157
+ }
158
+
159
+ /**
160
+ * Replace CDN url
161
+ *
162
+ * @since 1.2.3
163
+ * @access private
164
+ */
165
+ private function _process()
166
+ {
167
+ if ( defined( self::BYPASS ) ) {
168
+ LiteSpeed_Cache_Log::debug2( 'CDN bypass' ) ;
169
+ return ;
170
+ }
171
+
172
+ LiteSpeed_Cache_Log::debug( 'CDN _process' ) ;
173
+
174
+ // Start replacing img src
175
+ if ( $this->cfg_cdn_inc_img ) {
176
+ $this->_replace_img() ;
177
+ $this->_replace_inline_css() ;
178
+ }
179
+
180
+ if ( $this->cfg_cdn_filetype ) {
181
+ $this->_replace_file_types() ;
182
+ }
183
+
184
+ }
185
+
186
+ /**
187
+ * Parse all file types
188
+ *
189
+ * @since 1.2.3
190
+ * @access private
191
+ */
192
+ private function _replace_file_types()
193
+ {
194
+ preg_match_all( '#(src|data-src|href)\s*=\s*[\'"]([^\'"]+)[\'"]#i', $this->content, $matches ) ;
195
+ if ( empty( $matches[ 2 ] ) ) {
196
+ return ;
197
+ }
198
+ foreach ( $matches[ 2 ] as $k => $url ) {
199
+ $url_parsed = parse_url( $url ) ;
200
+ if ( empty( $url_parsed[ 'path' ] ) ) {
201
+ continue ;
202
+ }
203
+ $postfix = substr( $url_parsed[ 'path' ], strrpos( $url_parsed[ 'path' ], '.' ) ) ;
204
+ if ( ! in_array( $postfix, $this->cfg_cdn_filetype ) ) {
205
+ continue ;
206
+ }
207
+
208
+ LiteSpeed_Cache_Log::debug2( 'CDN matched file_type ' . $postfix . ' : ' . $url ) ;
209
+
210
+ if( ! $url2 = $this->rewrite( $url ) ) {
211
+ continue ;
212
+ }
213
+
214
+ $attr = str_replace( $url, $url2, $matches[ 0 ][ $k ] ) ;
215
+ $this->content = str_replace( $matches[ 0 ][ $k ], $attr, $this->content ) ;
216
+ }
217
+ }
218
+
219
+ /**
220
+ * Parse all images
221
+ *
222
+ * @since 1.2.3
223
+ * @access private
224
+ */
225
+ private function _replace_img()
226
+ {
227
+ preg_match_all( '#<img([^>]+?)src=([\'"\\\]*)([^\'"\s\\\>]+)([\'"\\\]*)([^>]*)>#i', $this->content, $matches ) ;
228
+ foreach ( $matches[ 3 ] as $k => $url ) {
229
+ // Check if is a DATA-URI
230
+ if ( strpos( $url, 'data:image' ) !== false ) {
231
+ continue ;
232
+ }
233
+
234
+ if ( ! $url2 = $this->rewrite( $url ) ) {
235
+ continue ;
236
+ }
237
+
238
+ $html_snippet = sprintf(
239
+ '<img %1$s src=%2$s %3$s>',
240
+ $matches[ 1 ][ $k ],
241
+ $matches[ 2 ][ $k ] . $url2 . $matches[ 4 ][ $k ],
242
+ $matches[ 5 ][ $k ]
243
+ ) ;
244
+ $this->content = str_replace( $matches[ 0 ][ $k ], $html_snippet, $this->content ) ;
245
+ }
246
+ }
247
+
248
+ /**
249
+ * Parse and replace all inline styles containing url()
250
+ *
251
+ * @since 1.2.3
252
+ * @access private
253
+ */
254
+ private function _replace_inline_css()
255
+ {
256
+ // preg_match_all( '/url\s*\(\s*(?!["\']?data:)(?![\'|\"]?[\#|\%|])([^)]+)\s*\)([^;},\s]*)/i', $this->content, $matches ) ;
257
+ preg_match_all( '#url\((?![\'"]?data)[\'"]?([^\)\'"]+)[\'"]?\)#i', $this->content, $matches ) ;
258
+ foreach ( $matches[ 1 ] as $k => $url ) {
259
+ $url = str_replace( array( ' ', '\t', '\n', '\r', '\0', '\x0B', '"', "'", '&quot;', '&#039;' ), '', $url ) ;
260
+
261
+ if ( ! $url2 = $this->rewrite( $url ) ) {
262
+ continue ;
263
+ }
264
+ $attr = str_replace( $matches[ 1 ][ $k ], $url2, $matches[ 0 ][ $k ] ) ;
265
+ $this->content = str_replace( $matches[ 0 ][ $k ], $attr, $this->content ) ;
266
+ }
267
+ }
268
+
269
+ /**
270
+ * Hook to wp_get_attachment_image_src
271
+ *
272
+ * @since 1.2.3
273
+ * @access public
274
+ * @param array $img The URL of the attachment image src, the width, the height
275
+ * @return array
276
+ */
277
+ public static function attach_img_src( $img )
278
+ {
279
+ $instance = self::get_instance() ;
280
+ if ( $img && $url = $instance->rewrite( $img[ 0 ] ) ) {
281
+ $img[ 0 ] = $url ;
282
+ }
283
+ return $img ;
284
+ }
285
+
286
+ /**
287
+ * Try to rewrite one URL with CDN
288
+ *
289
+ * @since 1.2.3
290
+ * @access public
291
+ * @param string $url
292
+ * @return string
293
+ */
294
+ public static function url( $url )
295
+ {
296
+ $instance = self::get_instance() ;
297
+ if ( $url && $url2 = $instance->rewrite( $url ) ) {
298
+ $url = $url2 ;
299
+ }
300
+ return $url ;
301
+ }
302
+
303
+ /**
304
+ * Hook to replace WP responsive images
305
+ *
306
+ * @since 1.2.3
307
+ * @access public
308
+ * @param array $srcs
309
+ * @return array
310
+ */
311
+ public static function srcset( $srcs )
312
+ {
313
+ if ( $srcs ) {
314
+ $instance = self::get_instance() ;
315
+ foreach ( $srcs as $w => $data ) {
316
+ if( ! $url = $instance->rewrite( $data[ 'url' ] ) ) {
317
+ continue ;
318
+ }
319
+ $srcs[ $w ][ 'url' ] = $url ;
320
+ }
321
+ }
322
+ return $srcs ;
323
+ }
324
+
325
+ /**
326
+ * Replace URL to CDN URL
327
+ *
328
+ * @since 1.2.3
329
+ * @access public
330
+ * @param string $url
331
+ * @return string Replaced URL
332
+ */
333
+ public function rewrite( $url )
334
+ {
335
+ $url_parsed = parse_url( $url ) ;
336
+
337
+ // Only images under wp-cotnent/wp-includes can be replaced
338
+ if ( stripos( $url_parsed[ 'path' ], LSWCP_CONTENT_FOLDER ) === false && stripos( $url_parsed[ 'path' ], 'wp-includes' ) === false && stripos( $url_parsed[ 'path' ], '/min/' ) === false ) {
339
+ return false ;
340
+ }
341
+
342
+ // Check if is external url
343
+ if ( ! empty( $url_parsed[ 'host' ] ) && ! LiteSpeed_Cache_Utility::internal( $url_parsed[ 'host' ] ) ) {
344
+ return false ;
345
+ }
346
+
347
+ if ( $this->cfg_cdn_exclude ) {
348
+ foreach ( $this->cfg_cdn_exclude as $exclude ) {
349
+ if ( stripos( $url, $exclude ) !== false ) {
350
+ LiteSpeed_Cache_Log::debug2( 'CDN: Abort excludes ' . $exclude ) ;
351
+ return false ;
352
+ }
353
+ }
354
+ }
355
+
356
+ // Fill complete url before replacement
357
+ if ( empty( $url_parsed[ 'host' ] ) ) {
358
+ $url = home_url( '/' ) . ltrim( $url, '/' ) ;
359
+ }
360
+
361
+ $scheme = ! empty( $url_parsed[ 'scheme' ] ) ? $url_parsed[ 'scheme' ] . ':' : '' ;
362
+
363
+ // Now lets replace CDN url
364
+ $url = str_replace( $scheme . $this->cfg_url_ori, $this->cfg_cdn_url, $url ) ;
365
+
366
+ return $url ;
367
+ }
368
+
369
+ /**
370
+ * Get the current instance object.
371
+ *
372
+ * @since 1.2.3
373
+ * @access public
374
+ * @return Current class instance.
375
+ */
376
+ public static function get_instance()
377
+ {
378
+ if ( ! isset(self::$_instance) ) {
379
+ self::$_instance = new self() ;
380
+ }
381
+
382
+ return self::$_instance ;
383
+ }
384
+
385
+ }
386
+
387
+
388
+
includes/litespeed-cache-config.class.php CHANGED
@@ -14,9 +14,10 @@ class LiteSpeed_Cache_Config
14
  private static $_instance ;
15
 
16
  const OPTION_NAME = 'litespeed-cache-conf' ;
 
17
  const VAL_OFF = 0 ;
18
  const VAL_ON = 1 ;
19
- const VAL_NOTSET = 2 ;
20
 
21
  const LOG_LEVEL_NONE = 0 ;
22
  const LOG_LEVEL_ERROR = 1 ;
@@ -57,6 +58,7 @@ class LiteSpeed_Cache_Config
57
  const OPID_LOG_IGNORE_PART_FILTERS = 'log_ignore_part_filters' ;
58
 
59
  const OPID_PUBLIC_TTL = 'public_ttl' ;
 
60
  const OPID_FRONT_PAGE_TTL = 'front_page_ttl' ;
61
  const OPID_FEED_TTL = 'feed_ttl' ;
62
  const OPID_403_TTL = '403_ttl' ;
@@ -65,7 +67,8 @@ class LiteSpeed_Cache_Config
65
  const OPID_PURGE_BY_POST = 'purge_by_post' ;
66
  const OPID_TEST_IPS = 'test_ips' ;
67
  const OPID_ESI_ENABLE = 'esi_enabled' ;
68
- const OPID_ESI_CACHE = 'esi_cached' ;
 
69
  const PURGE_ALL_PAGES = '-' ;
70
  const PURGE_FRONT_PAGE = 'F' ;
71
  const PURGE_HOME_PAGE = 'H' ;
@@ -81,6 +84,26 @@ class LiteSpeed_Cache_Config
81
  const OPID_EXCLUDES_CAT = 'excludes_cat' ;
82
  const OPID_EXCLUDES_TAG = 'excludes_tag' ;
83
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  const NETWORK_OPID_ENABLED = 'network_enabled' ;
85
  const NETWORK_OPID_USE_PRIMARY = 'use_primary_settings' ;
86
 
@@ -107,8 +130,8 @@ class LiteSpeed_Cache_Config
107
  const CRWL_ALPHA_ASC = 'alpha_asc' ;
108
 
109
  protected $options ;
 
110
  protected $purge_options ;
111
- protected $debug_tag = 'LiteSpeed_Cache' ;
112
 
113
  /**
114
  * Initialize the class and set its properties.
@@ -131,13 +154,8 @@ class LiteSpeed_Cache_Config
131
  define('LSCACHE_ADV_CACHE', true) ;
132
  }
133
 
134
- if (WP_DEBUG /* && $this->options[self::OPID_DEBUG] */ ) {
135
- $msec = microtime() ;
136
- $msec1 = substr($msec, 2, strpos($msec, ' ') - 2) ;
137
- if ( array_key_exists('REMOTE_ADDR', $_SERVER) && array_key_exists('REMOTE_PORT', $_SERVER) ) {
138
- $this->debug_tag .= ' [' . $_SERVER['REMOTE_ADDR'] . ':' . $_SERVER['REMOTE_PORT'] . ':' . $msec1 . '] ' ;
139
- }
140
- }
141
  }
142
 
143
  /**
@@ -234,6 +252,27 @@ class LiteSpeed_Cache_Config
234
  return update_option( self::OPTION_NAME, $this->options ) ;
235
  }
236
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
  /**
238
  * Get the configured purge options.
239
  *
@@ -320,6 +359,7 @@ class LiteSpeed_Cache_Config
320
  self::OPID_LOG_IGNORE_PART_FILTERS => "i18n\nlocale\nsettings\noption",
321
  self::OPID_TEST_IPS => '',
322
  self::OPID_PUBLIC_TTL => 604800,
 
323
  self::OPID_FRONT_PAGE_TTL => 604800,
324
  self::OPID_FEED_TTL => 0,
325
  self::OPID_403_TTL => 3600,
@@ -329,6 +369,27 @@ class LiteSpeed_Cache_Config
329
  self::OPID_EXCLUDES_URI => '',
330
  self::OPID_EXCLUDES_CAT => '',
331
  self::OPID_EXCLUDES_TAG => '',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  self::ID_NOCACHE_COOKIES => '',
333
  self::ID_NOCACHE_USERAGENTS => '',
334
  self::CRWL_POSTS => true,
@@ -350,7 +411,8 @@ class LiteSpeed_Cache_Config
350
 
351
  if ( LSWCP_ESI_SUPPORT ) {
352
  $default_options[self::OPID_ESI_ENABLE] = false ;
353
- $default_options[self::OPID_ESI_CACHE] = false ;
 
354
  }
355
 
356
  if ( is_multisite() ) {
@@ -601,7 +663,7 @@ class LiteSpeed_Cache_Config
601
  if ( ! is_writeable($file) ) {
602
  $file = dirname(ABSPATH) . '/wp-config.php' ;
603
  if ( ! is_writeable($file) ) {
604
- error_log('wp-config file not writeable for \'WP_CACHE\'') ;
605
  return LiteSpeed_Cache_Admin_Error::E_CONF_WRITE ;
606
  }
607
  }
@@ -717,9 +779,8 @@ class LiteSpeed_Cache_Config
717
  */
718
  public static function get_instance()
719
  {
720
- $cls = get_called_class() ;
721
  if ( ! isset(self::$_instance) ) {
722
- self::$_instance = new $cls() ;
723
  }
724
 
725
  return self::$_instance ;
14
  private static $_instance ;
15
 
16
  const OPTION_NAME = 'litespeed-cache-conf' ;
17
+ const VARY_GROUP = 'litespeed-cache-vary-group' ;
18
  const VAL_OFF = 0 ;
19
  const VAL_ON = 1 ;
20
+ const VAL_ON2 = 2 ;
21
 
22
  const LOG_LEVEL_NONE = 0 ;
23
  const LOG_LEVEL_ERROR = 1 ;
58
  const OPID_LOG_IGNORE_PART_FILTERS = 'log_ignore_part_filters' ;
59
 
60
  const OPID_PUBLIC_TTL = 'public_ttl' ;
61
+ const OPID_PRIVATE_TTL = 'private_ttl' ;
62
  const OPID_FRONT_PAGE_TTL = 'front_page_ttl' ;
63
  const OPID_FEED_TTL = 'feed_ttl' ;
64
  const OPID_403_TTL = '403_ttl' ;
67
  const OPID_PURGE_BY_POST = 'purge_by_post' ;
68
  const OPID_TEST_IPS = 'test_ips' ;
69
  const OPID_ESI_ENABLE = 'esi_enabled' ;
70
+ const OPID_ESI_CACHE_ADMBAR = 'esi_cached_admbar' ;
71
+ const OPID_ESI_CACHE_COMMFORM = 'esi_cached_commform' ;
72
  const PURGE_ALL_PAGES = '-' ;
73
  const PURGE_FRONT_PAGE = 'F' ;
74
  const PURGE_HOME_PAGE = 'H' ;
84
  const OPID_EXCLUDES_CAT = 'excludes_cat' ;
85
  const OPID_EXCLUDES_TAG = 'excludes_tag' ;
86
 
87
+ const OPID_CSS_MINIFY = 'css_minify' ;
88
+ const OPID_CSS_COMBINE = 'css_combine' ;
89
+ const OPID_CSS_HTTP2 = 'css_http2' ;
90
+ const OPID_CSS_EXCLUDES = 'css_exclude' ;
91
+ const OPID_JS_MINIFY = 'js_minify' ;
92
+ const OPID_JS_COMBINE = 'js_combine' ;
93
+ const OPID_JS_HTTP2 = 'js_http2' ;
94
+ const OPID_JS_EXCLUDES = 'js_exclude' ;
95
+ const OPID_OPTIMIZE_TTL = 'optimize_ttl' ;
96
+ const OPID_HTML_MINIFY = 'html_minify' ;
97
+
98
+ const OPID_CDN = 'cdn' ;
99
+ const OPID_CDN_ORI = 'cdn_ori' ;
100
+ const OPID_CDN_URL = 'cdn_url' ;
101
+ const OPID_CDN_INC_IMG = 'cdn_inc_img' ;
102
+ const OPID_CDN_INC_CSS = 'cdn_inc_css' ;
103
+ const OPID_CDN_INC_JS = 'cdn_inc_js' ;
104
+ const OPID_CDN_FILETYPE = 'cdn_filetype' ;
105
+ const OPID_CDN_EXCLUDE = 'cdn_exclude' ;
106
+
107
  const NETWORK_OPID_ENABLED = 'network_enabled' ;
108
  const NETWORK_OPID_USE_PRIMARY = 'use_primary_settings' ;
109
 
130
  const CRWL_ALPHA_ASC = 'alpha_asc' ;
131
 
132
  protected $options ;
133
+ protected $vary_groups ;
134
  protected $purge_options ;
 
135
 
136
  /**
137
  * Initialize the class and set its properties.
154
  define('LSCACHE_ADV_CACHE', true) ;
155
  }
156
 
157
+ // Vary group settings
158
+ $this->vary_groups = (array)get_option( self::VARY_GROUP ) ;
 
 
 
 
 
159
  }
160
 
161
  /**
252
  return update_option( self::OPTION_NAME, $this->options ) ;
253
  }
254
 
255
+ /**
256
+ * Check if one user role is in vary group settings
257
+ *
258
+ * @since 1.2.0
259
+ * @access public
260
+ * @param string $role The user role
261
+ * @return int The set value if already set
262
+ */
263
+ public function in_vary_group( $role )
264
+ {
265
+ $group = 0 ;
266
+ if ( array_key_exists( $role, $this->vary_groups ) ) {
267
+ $group = $this->vary_groups[ $role ] ;
268
+ }
269
+ elseif ( $role === 'administrator' ) {
270
+ $group = 99 ;
271
+ }
272
+
273
+ return $group ;
274
+ }
275
+
276
  /**
277
  * Get the configured purge options.
278
  *
359
  self::OPID_LOG_IGNORE_PART_FILTERS => "i18n\nlocale\nsettings\noption",
360
  self::OPID_TEST_IPS => '',
361
  self::OPID_PUBLIC_TTL => 604800,
362
+ self::OPID_PRIVATE_TTL => 1800,
363
  self::OPID_FRONT_PAGE_TTL => 604800,
364
  self::OPID_FEED_TTL => 0,
365
  self::OPID_403_TTL => 3600,
369
  self::OPID_EXCLUDES_URI => '',
370
  self::OPID_EXCLUDES_CAT => '',
371
  self::OPID_EXCLUDES_TAG => '',
372
+
373
+ self::OPID_CSS_MINIFY => false,
374
+ self::OPID_CSS_COMBINE => false,
375
+ self::OPID_CSS_HTTP2 => false,
376
+ self::OPID_CSS_EXCLUDES => '',
377
+ self::OPID_JS_MINIFY => false,
378
+ self::OPID_JS_COMBINE => false,
379
+ self::OPID_JS_HTTP2 => false,
380
+ self::OPID_JS_EXCLUDES => '',
381
+ self::OPID_OPTIMIZE_TTL => 604800,
382
+ self::OPID_HTML_MINIFY => false,
383
+
384
+ self::OPID_CDN => false,
385
+ self::OPID_CDN_ORI => '',
386
+ self::OPID_CDN_URL => '',
387
+ self::OPID_CDN_INC_IMG => false,
388
+ self::OPID_CDN_INC_CSS => false,
389
+ self::OPID_CDN_INC_JS => false,
390
+ self::OPID_CDN_FILETYPE => ".aac\n.css\n.eot\n.gif\n.jpeg\n.js\n.jpg\n.less\n.mp3\n.mp4\n.ogg\n.otf\n.pdf\n.png\n.svg\n.ttf\n.woff",
391
+ self::OPID_CDN_EXCLUDE => '',
392
+
393
  self::ID_NOCACHE_COOKIES => '',
394
  self::ID_NOCACHE_USERAGENTS => '',
395
  self::CRWL_POSTS => true,
411
 
412
  if ( LSWCP_ESI_SUPPORT ) {
413
  $default_options[self::OPID_ESI_ENABLE] = false ;
414
+ $default_options[self::OPID_ESI_CACHE_ADMBAR] = true ;
415
+ $default_options[self::OPID_ESI_CACHE_COMMFORM] = true ;
416
  }
417
 
418
  if ( is_multisite() ) {
663
  if ( ! is_writeable($file) ) {
664
  $file = dirname(ABSPATH) . '/wp-config.php' ;
665
  if ( ! is_writeable($file) ) {
666
+ error_log('wp-config file not writable for \'WP_CACHE\'') ;
667
  return LiteSpeed_Cache_Admin_Error::E_CONF_WRITE ;
668
  }
669
  }
779
  */
780
  public static function get_instance()
781
  {
 
782
  if ( ! isset(self::$_instance) ) {
783
+ self::$_instance = new self() ;
784
  }
785
 
786
  return self::$_instance ;
includes/litespeed-cache-control.class.php CHANGED
@@ -47,7 +47,7 @@ class LiteSpeed_Cache_Control
47
  $cache_res = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_CACHE_RES ) ;
48
  if ( $cache_res ) {
49
  $uri = esc_url( $_SERVER["REQUEST_URI"] ) ;
50
- $pattern = '!' . LiteSpeed_Cache_Admin_Rules::RW_PATTERN_RES . '!' ;
51
  if ( preg_match( $pattern, $uri ) ) {
52
  add_action( 'wp_loaded', 'LiteSpeed_Cache_Control::set_cacheable', 5 ) ;
53
  }
@@ -69,7 +69,7 @@ class LiteSpeed_Cache_Control
69
  return ;
70
  }
71
  self::$_control |= self::BM_NO_VARY ;
72
- LiteSpeed_Cache_Log::debug('X Cache_control -> no_vary') ;
73
  }
74
 
75
  /**
@@ -271,6 +271,11 @@ class LiteSpeed_Cache_Control
271
  }
272
  }
273
 
 
 
 
 
 
274
  if ( is_front_page() ){
275
  return LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_FRONT_PAGE_TTL ) ;
276
  }
@@ -393,6 +398,11 @@ class LiteSpeed_Cache_Control
393
  return ;
394
  }
395
 
 
 
 
 
 
396
  // Check litespeed setting to set cacheable status
397
  if ( ! self::_setting_cacheable() ) {
398
  self::set_nocache() ;
@@ -592,9 +602,8 @@ class LiteSpeed_Cache_Control
592
  */
593
  // public static function get_instance()
594
  // {
595
- // $cls = get_called_class() ;
596
  // if ( ! isset(self::$_instance) ) {
597
- // self::$_instance = new $cls() ;
598
  // }
599
 
600
  // return self::$_instance ;
47
  $cache_res = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_CACHE_RES ) ;
48
  if ( $cache_res ) {
49
  $uri = esc_url( $_SERVER["REQUEST_URI"] ) ;
50
+ $pattern = '!' . LSWCP_CONTENT_FOLDER . LiteSpeed_Cache_Admin_Rules::RW_PATTERN_RES . '!' ;
51
  if ( preg_match( $pattern, $uri ) ) {
52
  add_action( 'wp_loaded', 'LiteSpeed_Cache_Control::set_cacheable', 5 ) ;
53
  }
69
  return ;
70
  }
71
  self::$_control |= self::BM_NO_VARY ;
72
+ LiteSpeed_Cache_Log::debug('X Cache_control -> no-vary') ;
73
  }
74
 
75
  /**
271
  }
272
  }
273
 
274
+ // Private cache uses private ttl setting
275
+ if ( self::is_private() ) {
276
+ return LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_PRIVATE_TTL ) ;
277
+ }
278
+
279
  if ( is_front_page() ){
280
  return LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_FRONT_PAGE_TTL ) ;
281
  }
398
  return ;
399
  }
400
 
401
+ if ( is_preview() ) {
402
+ self::set_nocache( 'preview page' ) ;
403
+ return ;
404
+ }
405
+
406
  // Check litespeed setting to set cacheable status
407
  if ( ! self::_setting_cacheable() ) {
408
  self::set_nocache() ;
602
  */
603
  // public static function get_instance()
604
  // {
 
605
  // if ( ! isset(self::$_instance) ) {
606
+ // self::$_instance = new self() ;
607
  // }
608
 
609
  // return self::$_instance ;
includes/litespeed-cache-crawler-sitemap.class.php CHANGED
@@ -147,9 +147,8 @@ class LiteSpeed_Cache_Crawler_Sitemap
147
  */
148
  public static function get_instance()
149
  {
150
- $cls = get_called_class() ;
151
  if ( ! isset(self::$_instance) ) {
152
- self::$_instance = new $cls() ;
153
  }
154
 
155
  return self::$_instance ;
147
  */
148
  public static function get_instance()
149
  {
 
150
  if ( ! isset(self::$_instance) ) {
151
+ self::$_instance = new self() ;
152
  }
153
 
154
  return self::$_instance ;
includes/litespeed-cache-crawler.class.php CHANGED
@@ -301,7 +301,7 @@ class LiteSpeed_Cache_Crawler
301
  return false ;
302
  }
303
 
304
- $filetime = date('m/d/Y H:i:s', filemtime($this->_sitemap_file)) ;
305
 
306
  return $filetime ;
307
  }
@@ -441,9 +441,8 @@ class LiteSpeed_Cache_Crawler
441
  */
442
  public static function get_instance()
443
  {
444
- $cls = get_called_class() ;
445
  if ( ! isset(self::$_instance) ) {
446
- self::$_instance = new $cls() ;
447
  }
448
 
449
  return self::$_instance ;
301
  return false ;
302
  }
303
 
304
+ $filetime = date('m/d/Y H:i:s', filemtime($this->_sitemap_file) + LITESPEED_TIME_OFFSET ) ;
305
 
306
  return $filetime ;
307
  }
441
  */
442
  public static function get_instance()
443
  {
 
444
  if ( ! isset(self::$_instance) ) {
445
+ self::$_instance = new self() ;
446
  }
447
 
448
  return self::$_instance ;
includes/litespeed-cache-esi.class.php CHANGED
@@ -33,10 +33,14 @@ class LiteSpeed_Cache_ESI
33
  /**
34
  * Constructor of ESI
35
  *
36
- * @since 1.1.3
 
37
  */
38
  private function __construct()
39
  {
 
 
 
40
  }
41
 
42
  /**
@@ -75,7 +79,7 @@ class LiteSpeed_Cache_ESI
75
  public static function esi_template($template)
76
  {
77
  // Add comment forum esi for logged-in user or commenter
78
- if ( LiteSpeed_Cache_Router::is_ajax() && LiteSpeed_Cache_Vary::has_vary() ) {
79
  add_filter( 'comment_form_defaults', array( self::get_instance(), 'register_comment_form_actions' ) ) ;
80
  }
81
 
@@ -85,9 +89,6 @@ class LiteSpeed_Cache_ESI
85
 
86
  self::get_instance()->register_esi_actions() ;
87
 
88
- if ( ! LiteSpeed_Cache::config(LiteSpeed_Cache_Config::OPID_ESI_CACHE) ) {
89
- LiteSpeed_Cache_Control::set_nocache( 'ESI page is not cacheable' ) ;
90
- }
91
  return LSWCP_DIR . 'includes/litespeed-cache-esi.tpl.php' ;
92
  }
93
  self::get_instance()->register_not_esi_actions() ;
@@ -182,13 +183,13 @@ class LiteSpeed_Cache_ESI
182
  if ( !is_array($params) || !is_string($control) ) {
183
  if ( LiteSpeed_Cache_Log::get_enabled() ) {
184
  LiteSpeed_Cache_Log::push("Sub esi hooks returned Params: \n"
185
- . print_r($params, true) . "\ncache control: \n"
186
- . print_r($control, true)) ;
187
  }
188
  return false ;
189
  }
190
 
191
- $url = wp_make_link_relative(home_url()) . '?' . self::QS_ACTION . '=' . self::POSTTYPE . '&' . self::QS_PARAMS . '=' . urlencode(base64_encode(serialize($params))) ;
192
  $output = "<!-- lscwp $wrapper --><esi:include src='$url'" ;
193
  if ( ! empty( $control ) ) {
194
  $output .= " cache-control='$control'" ;
@@ -323,7 +324,7 @@ class LiteSpeed_Cache_ESI
323
  switch ($widget_name) {
324
  case 'WP_Widget_Recent_Posts' :
325
  case 'WP_Widget_Recent_Comments' :
326
- $options[self::WIDGET_OPID_ESIENABLE] = true ;
327
  $options[self::WIDGET_OPID_TTL] = 86400 ;
328
  break ;
329
  default :
@@ -370,19 +371,22 @@ class LiteSpeed_Cache_ESI
370
  * @param array $args Parameter used to build the widget.
371
  * @return mixed Return false if display through esi, instance otherwise.
372
  */
373
- public function sub_widget_block(array $instance, WP_Widget $widget, array $args)
374
  {
375
- $name = get_class($widget) ;
376
- if ( ! isset($instance[LiteSpeed_Cache_Config::OPTION_NAME]) ) {
377
  return $instance ;
378
  }
379
- $options = $instance[LiteSpeed_Cache_Config::OPTION_NAME] ;
380
- if ( ! isset($options) || ! $options[self::WIDGET_OPID_ESIENABLE] ) {
381
  if ( LiteSpeed_Cache_Log::get_enabled() ) {
382
- LiteSpeed_Cache_Log::push('ESI off for widget ' . $name . ' because '. (!isset($options) ? 'options not set' : 'esi disabled for widget')) ;
383
  }
384
  return $instance ;
385
  }
 
 
 
386
  $params = array(
387
  self::PARAM_NAME => $name,
388
  self::PARAM_ID => $widget->id,
@@ -390,7 +394,7 @@ class LiteSpeed_Cache_ESI
390
  self::PARAM_ARGS => $args
391
  ) ;
392
 
393
- self::sub_esi_block('widget', 'widget ' . $name, $params, 'no-vary') ;
394
  return false ;
395
  }
396
 
@@ -469,26 +473,29 @@ class LiteSpeed_Cache_ESI
469
  * @global $wp_widget_factory
470
  * @param array $params Input parameters needed to correctly display widget
471
  */
472
- public function load_widget_block($params)
473
  {
474
  global $wp_widget_factory ;
475
- $widget = $wp_widget_factory->widgets[$params[self::PARAM_NAME]] ;
476
- $option = self::widget_load_get_options($widget) ;
477
  // Since we only reach here via esi, safe to assume setting exists.
478
- $ttl = $option[self::WIDGET_OPID_TTL] ;
479
  if ( LiteSpeed_Cache_Log::get_enabled() ) {
480
- LiteSpeed_Cache_Log::push('ESI widget render: name ' . $params[self::PARAM_NAME] . ', id ' . $params[self::PARAM_ID] . ', ttl ' . $ttl) ;
481
  }
482
  if ( $ttl == 0 ) {
483
  LiteSpeed_Cache_Control::set_nocache( 'ESI Widget time to live set to 0' ) ;
484
  }
485
  else {
486
- LiteSpeed_Cache_Control::set_custom_ttl($ttl) ;
 
 
 
 
487
  LiteSpeed_Cache_Control::set_no_vary() ;
488
- // LiteSpeed_Cache_Control::set_public() ; no need as by default its public
489
- LiteSpeed_Cache_Tag::add(LiteSpeed_Cache_Tag::TYPE_WIDGET . $params[self::PARAM_ID]) ;
490
  }
491
- the_widget($params[self::PARAM_NAME], $params[self::PARAM_INSTANCE], $params[self::PARAM_ARGS]) ;
492
  }
493
 
494
  /**
@@ -500,8 +507,13 @@ class LiteSpeed_Cache_ESI
500
  public function load_admin_bar_block()
501
  {
502
  wp_admin_bar_render() ;
503
- LiteSpeed_Cache_Control::set_private() ;
504
- LiteSpeed_Cache_Control::set_no_vary() ;
 
 
 
 
 
505
  }
506
 
507
 
@@ -516,13 +528,17 @@ class LiteSpeed_Cache_ESI
516
  {
517
  remove_filter('comment_form_defaults', array($this, 'register_comment_form_actions')) ;
518
  comment_form($params[self::PARAM_ARGS], $params[self::PARAM_ID]) ;
519
- if ( LiteSpeed_Cache_Vary::has_vary() ) {
520
- LiteSpeed_Cache_Control::set_private() ;
521
- LiteSpeed_Cache_Control::set_no_vary() ;
 
 
 
 
 
 
 
522
  }
523
- // else {
524
- // LiteSpeed_Cache_Control::set_public() ; no need as by default its public
525
- // }
526
 
527
  }
528
 
@@ -535,9 +551,8 @@ class LiteSpeed_Cache_ESI
535
  */
536
  public static function get_instance()
537
  {
538
- $cls = get_called_class() ;
539
  if ( ! isset(self::$_instance) ) {
540
- self::$_instance = new $cls() ;
541
  }
542
 
543
  return self::$_instance ;
33
  /**
34
  * Constructor of ESI
35
  *
36
+ * @since 1.2.0
37
+ * @access private
38
  */
39
  private function __construct()
40
  {
41
+ add_action( 'template_include', 'LiteSpeed_Cache_ESI::esi_template', 100 ) ;
42
+ add_action( 'load-widgets.php', 'LiteSpeed_Cache_Purge::purge_widget' ) ;
43
+ add_action( 'wp_update_comment_count', 'LiteSpeed_Cache_Purge::purge_comment_widget' ) ;
44
  }
45
 
46
  /**
79
  public static function esi_template($template)
80
  {
81
  // Add comment forum esi for logged-in user or commenter
82
+ if ( ! LiteSpeed_Cache_Router::is_ajax() && LiteSpeed_Cache_Vary::has_vary() ) {
83
  add_filter( 'comment_form_defaults', array( self::get_instance(), 'register_comment_form_actions' ) ) ;
84
  }
85
 
89
 
90
  self::get_instance()->register_esi_actions() ;
91
 
 
 
 
92
  return LSWCP_DIR . 'includes/litespeed-cache-esi.tpl.php' ;
93
  }
94
  self::get_instance()->register_not_esi_actions() ;
183
  if ( !is_array($params) || !is_string($control) ) {
184
  if ( LiteSpeed_Cache_Log::get_enabled() ) {
185
  LiteSpeed_Cache_Log::push("Sub esi hooks returned Params: \n"
186
+ . var_export($params, true) . "\ncache control: \n"
187
+ . var_export($control, true)) ;
188
  }
189
  return false ;
190
  }
191
 
192
+ $url = trailingslashit( wp_make_link_relative( home_url() ) ) . '?' . self::QS_ACTION . '=' . self::POSTTYPE . '&' . self::QS_PARAMS . '=' . urlencode(base64_encode(serialize($params))) ;
193
  $output = "<!-- lscwp $wrapper --><esi:include src='$url'" ;
194
  if ( ! empty( $control ) ) {
195
  $output .= " cache-control='$control'" ;
324
  switch ($widget_name) {
325
  case 'WP_Widget_Recent_Posts' :
326
  case 'WP_Widget_Recent_Comments' :
327
+ $options[self::WIDGET_OPID_ESIENABLE] = LiteSpeed_Cache_Config::VAL_OFF ;
328
  $options[self::WIDGET_OPID_TTL] = 86400 ;
329
  break ;
330
  default :
371
  * @param array $args Parameter used to build the widget.
372
  * @return mixed Return false if display through esi, instance otherwise.
373
  */
374
+ public function sub_widget_block( array $instance, WP_Widget $widget, array $args )
375
  {
376
+ $name = get_class( $widget ) ;
377
+ if ( ! isset( $instance[ LiteSpeed_Cache_Config::OPTION_NAME ] ) ) {
378
  return $instance ;
379
  }
380
+ $options = $instance[ LiteSpeed_Cache_Config::OPTION_NAME ] ;
381
+ if ( ! isset( $options ) || ! $options[ self::WIDGET_OPID_ESIENABLE ] ) {
382
  if ( LiteSpeed_Cache_Log::get_enabled() ) {
383
+ LiteSpeed_Cache_Log::push( 'ESI 0 ' . $name . ': '. ( ! isset( $options ) ? 'not set' : 'set off' ) ) ;
384
  }
385
  return $instance ;
386
  }
387
+
388
+ $esi_private = $options[ self::WIDGET_OPID_ESIENABLE ] === LiteSpeed_Cache_Config::VAL_ON2 ? 'private,' : '' ;
389
+
390
  $params = array(
391
  self::PARAM_NAME => $name,
392
  self::PARAM_ID => $widget->id,
394
  self::PARAM_ARGS => $args
395
  ) ;
396
 
397
+ self::sub_esi_block( 'widget', 'widget ' . $name, $params, $esi_private . 'no-vary' ) ;
398
  return false ;
399
  }
400
 
473
  * @global $wp_widget_factory
474
  * @param array $params Input parameters needed to correctly display widget
475
  */
476
+ public function load_widget_block( $params )
477
  {
478
  global $wp_widget_factory ;
479
+ $widget = $wp_widget_factory->widgets[ $params[ self::PARAM_NAME ] ] ;
480
+ $option = self::widget_load_get_options( $widget ) ;
481
  // Since we only reach here via esi, safe to assume setting exists.
482
+ $ttl = $option[ self::WIDGET_OPID_TTL ] ;
483
  if ( LiteSpeed_Cache_Log::get_enabled() ) {
484
+ LiteSpeed_Cache_Log::push( 'ESI widget render: name ' . $params[ self::PARAM_NAME ] . ', id ' . $params[ self::PARAM_ID ] . ', ttl ' . $ttl ) ;
485
  }
486
  if ( $ttl == 0 ) {
487
  LiteSpeed_Cache_Control::set_nocache( 'ESI Widget time to live set to 0' ) ;
488
  }
489
  else {
490
+ LiteSpeed_Cache_Control::set_custom_ttl( $ttl ) ;
491
+
492
+ if ( $option[ self::WIDGET_OPID_ESIENABLE ] === LiteSpeed_Cache_Config::VAL_ON2 ) {
493
+ LiteSpeed_Cache_Control::set_private() ;
494
+ }
495
  LiteSpeed_Cache_Control::set_no_vary() ;
496
+ LiteSpeed_Cache_Tag::add( LiteSpeed_Cache_Tag::TYPE_WIDGET . $params[ self::PARAM_ID ] ) ;
 
497
  }
498
+ the_widget( $params[ self::PARAM_NAME ], $params[ self::PARAM_INSTANCE ], $params[ self::PARAM_ARGS ] ) ;
499
  }
500
 
501
  /**
507
  public function load_admin_bar_block()
508
  {
509
  wp_admin_bar_render() ;
510
+ if ( ! LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_ESI_CACHE_ADMBAR ) ) {
511
+ LiteSpeed_Cache_Control::set_nocache( 'build-in set to not cacheable' ) ;
512
+ }
513
+ else {
514
+ LiteSpeed_Cache_Control::set_private() ;
515
+ LiteSpeed_Cache_Control::set_no_vary() ;
516
+ }
517
  }
518
 
519
 
528
  {
529
  remove_filter('comment_form_defaults', array($this, 'register_comment_form_actions')) ;
530
  comment_form($params[self::PARAM_ARGS], $params[self::PARAM_ID]) ;
531
+
532
+ if ( ! LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_ESI_CACHE_COMMFORM ) ) {
533
+ LiteSpeed_Cache_Control::set_nocache( 'build-in set to not cacheable' ) ;
534
+ }
535
+ else {
536
+ // by default comment form is public
537
+ if ( LiteSpeed_Cache_Vary::has_vary() ) {
538
+ LiteSpeed_Cache_Control::set_private() ;
539
+ LiteSpeed_Cache_Control::set_no_vary() ;
540
+ }
541
  }
 
 
 
542
 
543
  }
544
 
551
  */
552
  public static function get_instance()
553
  {
 
554
  if ( ! isset(self::$_instance) ) {
555
+ self::$_instance = new self() ;
556
  }
557
 
558
  return self::$_instance ;
includes/litespeed-cache-log.class.php CHANGED
@@ -157,7 +157,8 @@ class LiteSpeed_Cache_Log
157
  }
158
  self::$_prefix = sprintf( " [%s %s %s] ", $addr, LSCWP_LOG_TAG, $unique ) ;
159
  }
160
- return date( 'm/d/y H:i:s' ) . self::$_prefix . $msg . "\n" ;
 
161
  }
162
 
163
  /**
@@ -175,6 +176,24 @@ class LiteSpeed_Cache_Log
175
  }
176
  }
177
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  /**
179
  * Logs a debug message.
180
  *
@@ -187,7 +206,7 @@ class LiteSpeed_Cache_Log
187
  {
188
  // backtrace handler
189
  if ( defined( 'LSCWP_LOG_MORE' ) && $backtrace_limit !== false ) {
190
- $trace = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, $backtrace_limit + 2 ) ;
191
  for ( $i=1 ; $i <= $backtrace_limit + 1 ; $i++ ) {// the 0st item is push()
192
  if ( empty( $trace[$i]['class'] ) ) {
193
  break ;
@@ -242,13 +261,23 @@ class LiteSpeed_Cache_Log
242
  $SERVER = array_merge( $SERVERVARS, $_SERVER ) ;
243
  $params = array() ;
244
 
245
- $params[] = sprintf( '%s %s %s', $SERVER['REQUEST_METHOD'], $SERVER['SERVER_PROTOCOL'], strtok( $SERVER['REQUEST_URI'], '?' ) ) ;
246
 
247
  $qs = ! empty( $SERVER['QUERY_STRING'] ) ? $SERVER['QUERY_STRING'] : '' ;
248
- if ( LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_COLLAPS_QS ) && strlen( $qs ) > 53 ) {
249
- $qs = substr( $qs, 0, 53 ) . '...' ;
 
 
 
 
 
 
250
  }
251
- $params[] = 'Query String: ' . $qs ;
 
 
 
 
252
  if ( defined( 'LSCWP_LOG_MORE' ) ) {
253
  $params[] = 'User Agent: ' . $SERVER[ 'HTTP_USER_AGENT' ] ;
254
  $params[] = 'Accept Encoding: ' . $SERVER['HTTP_ACCEPT_ENCODING'] ;
@@ -283,9 +312,8 @@ class LiteSpeed_Cache_Log
283
  */
284
  public static function get_instance()
285
  {
286
- $cls = get_called_class() ;
287
  if ( ! isset( self::$_instance ) ) {
288
- self::$_instance = new $cls() ;
289
  }
290
 
291
  return self::$_instance ;
157
  }
158
  self::$_prefix = sprintf( " [%s %s %s] ", $addr, LSCWP_LOG_TAG, $unique ) ;
159
  }
160
+ list( $usec, $sec ) = explode(' ', microtime() ) ;
161
+ return date( 'm/d/y H:i:s', $sec + LITESPEED_TIME_OFFSET ) . substr( $usec, 1, 4 ) . self::$_prefix . $msg . "\n" ;
162
  }
163
 
164
  /**
176
  }
177
  }
178
 
179
+ /**
180
+ * Direct call to log an advanced debug message.
181
+ *
182
+ * @since 1.2.0
183
+ * @access public
184
+ * @param string $msg The debug message.
185
+ * @param int $backtrace_limit Backtrace depth.
186
+ */
187
+ public static function debug2( $msg, $backtrace_limit = false )
188
+ {
189
+ if ( ! defined( 'LSCWP_LOG_MORE' ) ) {
190
+ return ;
191
+ }
192
+ if ( self::get_enabled() ) {
193
+ self::push( $msg, $backtrace_limit !== false ? $backtrace_limit+1 : false ) ;
194
+ }
195
+ }
196
+
197
  /**
198
  * Logs a debug message.
199
  *
206
  {
207
  // backtrace handler
208
  if ( defined( 'LSCWP_LOG_MORE' ) && $backtrace_limit !== false ) {
209
+ $trace = version_compare( PHP_VERSION, '5.4.0', '<' ) ? debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ) : debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, $backtrace_limit + 2 ) ;
210
  for ( $i=1 ; $i <= $backtrace_limit + 1 ; $i++ ) {// the 0st item is push()
211
  if ( empty( $trace[$i]['class'] ) ) {
212
  break ;
261
  $SERVER = array_merge( $SERVERVARS, $_SERVER ) ;
262
  $params = array() ;
263
 
264
+ $param = sprintf( '%s %s %s', $SERVER['REQUEST_METHOD'], $SERVER['SERVER_PROTOCOL'], strtok( $SERVER['REQUEST_URI'], '?' ) ) ;
265
 
266
  $qs = ! empty( $SERVER['QUERY_STRING'] ) ? $SERVER['QUERY_STRING'] : '' ;
267
+ if ( LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_COLLAPS_QS ) ) {
268
+ if ( strlen( $qs ) > 53 ) {
269
+ $qs = substr( $qs, 0, 53 ) . '...' ;
270
+ }
271
+ if ( $qs ) {
272
+ $param .= ' ? ' . $qs ;
273
+ }
274
+ $params[] = $param ;
275
  }
276
+ else {
277
+ $params[] = $param ;
278
+ $params[] = 'Query String: ' . $qs ;
279
+ }
280
+
281
  if ( defined( 'LSCWP_LOG_MORE' ) ) {
282
  $params[] = 'User Agent: ' . $SERVER[ 'HTTP_USER_AGENT' ] ;
283
  $params[] = 'Accept Encoding: ' . $SERVER['HTTP_ACCEPT_ENCODING'] ;
312
  */
313
  public static function get_instance()
314
  {
 
315
  if ( ! isset( self::$_instance ) ) {
316
+ self::$_instance = new self() ;
317
  }
318
 
319
  return self::$_instance ;
includes/litespeed-cache-optimize.class.php ADDED
@@ -0,0 +1,677 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * The optimize class.
5
+ *
6
+ * @since 1.2.2
7
+ * @package LiteSpeed_Cache
8
+ * @subpackage LiteSpeed_Cache/includes
9
+ * @author LiteSpeed Technologies <info@litespeedtech.com>
10
+ */
11
+
12
+ class LiteSpeed_Cache_Optimize
13
+ {
14
+ private static $_instance ;
15
+
16
+ const OPTION_OPTIMIZED = 'litespeed-cache-optimized' ;
17
+ const DIR_MIN = '/min' ;
18
+
19
+ private $content ;
20
+ private $http2_headers = array() ;
21
+
22
+ private $cfg_http2_css ;
23
+ private $cfg_http2_js ;
24
+ private $cfg_css_minify ;
25
+ private $cfg_css_combine ;
26
+ private $cfg_js_minify ;
27
+ private $cfg_js_combine ;
28
+ private $cfg_html_minify ;
29
+
30
+ private $minify_cache ;
31
+ private $minify_minify ;
32
+ private $minify_env ;
33
+ private $minify_sourceFactory ;
34
+ private $minify_controller ;
35
+ private $minify_options ;
36
+
37
+ /**
38
+ * Init optimizer
39
+ *
40
+ * @since 1.2.2
41
+ * @access private
42
+ */
43
+ private function __construct()
44
+ {
45
+ $this->cfg_http2_css = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_CSS_HTTP2 ) ;
46
+ $this->cfg_http2_js = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_JS_HTTP2 ) ;
47
+ $this->cfg_css_minify = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_CSS_MINIFY ) ;
48
+ $this->cfg_css_combine = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_CSS_COMBINE ) ;
49
+ $this->cfg_js_minify = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_JS_MINIFY ) ;
50
+ $this->cfg_js_combine = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_JS_COMBINE ) ;
51
+ $this->cfg_html_minify = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_HTML_MINIFY ) ;
52
+
53
+ $this->_request_check() ;
54
+ }
55
+
56
+ /**
57
+ * Check if the request is for static file
58
+ *
59
+ * @since 1.2.2
60
+ * @access private
61
+ * @return string The static file content
62
+ */
63
+ private function _request_check()
64
+ {
65
+ // If not turn on min files
66
+ if ( ! $this->cfg_css_minify && ! $this->cfg_css_combine && ! $this->cfg_js_minify && ! $this->cfg_js_combine ) {
67
+ return ;
68
+ }
69
+
70
+ if ( empty( $_SERVER[ 'REQUEST_URI' ] ) || strpos( $_SERVER[ 'REQUEST_URI' ], self::DIR_MIN . '/' ) === false ) {
71
+ return ;
72
+ }
73
+
74
+ // try to match `http://home_url/min/xx.css
75
+ if ( ! preg_match( '#' . self::DIR_MIN . '/(\w+\.(css|js))#U', $_SERVER[ 'REQUEST_URI' ], $match ) ) {
76
+ return ;
77
+ }
78
+
79
+ LiteSpeed_Cache_Log::debug( 'Optimizer start minifying file' ) ;
80
+
81
+ // Proceed css/js file generation
82
+ define( 'LITESPEED_MIN_FILE', true ) ;
83
+
84
+ $result = $this->_minify( $match[ 1 ] ) ;
85
+
86
+ if ( ! $result ) {
87
+ LiteSpeed_Cache_Control::set_nocache( 'Empty content from optimizer' ) ;
88
+ exit ;
89
+ }
90
+
91
+ foreach ( $result[ 'headers' ] as $key => $val ) {
92
+ if ( in_array( $key, array( 'Content-Length', 'Content-Type' ) ) ) {
93
+ header( $key . ': ' . $val ) ;
94
+ }
95
+ }
96
+
97
+ LiteSpeed_Cache_Control::set_cacheable() ;
98
+ LiteSpeed_Cache_Control::set_no_vary() ;
99
+ LiteSpeed_Cache_Control::set_custom_ttl( LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_OPTIMIZE_TTL ) ) ;
100
+ LiteSpeed_Cache_Tag::add( LiteSpeed_Cache_Tag::TYPE_MIN ) ;
101
+
102
+ echo $result[ 'content' ] ;
103
+ exit ;
104
+ }
105
+
106
+ /**
107
+ * Run optimize process
108
+ * NOTE: As this is after cache finalized, can NOT set any cache control anymore
109
+ *
110
+ * @since 1.2.2
111
+ * @access public
112
+ * @return string The content that is after optimization
113
+ */
114
+ public static function run( $content )
115
+ {
116
+ if ( ! defined( 'LITESPEED_COMMENT_INFO' ) ) {
117
+ LiteSpeed_Cache_Log::debug( 'Optimizer bypass: No footer info' ) ;
118
+ return $content ;
119
+ }
120
+
121
+ LiteSpeed_Cache_Log::debug( 'Optimizer start' ) ;
122
+
123
+ $instance = self::get_instance() ;
124
+ $instance->content = $content ;
125
+
126
+ $instance->_optimize() ;
127
+ return $instance->content ;
128
+ }
129
+
130
+ /**
131
+ * Optimize css src
132
+ *
133
+ * @since 1.2.2
134
+ * @access private
135
+ */
136
+ private function _optimize()
137
+ {
138
+ // The html codes needed to be added to head
139
+ $html_head = '';
140
+ $html_foot = '';
141
+
142
+ if ( $this->cfg_css_minify || $this->cfg_css_combine || $this->cfg_http2_css ) {
143
+ list( $src_list, $html_list ) = $this->_parse_css() ;
144
+
145
+ if ( $src_list ) {
146
+ list( $ignored_html, $src_queue_list ) = $this->_analyse_links( $src_list, $html_list ) ;
147
+
148
+ // IF combine
149
+ if ( $this->cfg_css_combine ) {
150
+ $url = $this->_build_hash_url( $src_queue_list ) ;
151
+
152
+ $html_head .= implode( '', $ignored_html ) . "<link data-minified='1' rel='stylesheet' href='$url' />" ;
153
+ // Move all css to top
154
+ $this->content = str_replace( $html_list, '', $this->content ) ;
155
+
156
+ // Add to HTTP2
157
+ $this->append_http2( $url ) ;
158
+
159
+ }
160
+ // Only minify
161
+ elseif ( $this->cfg_css_minify ) {
162
+ $this->_src_queue_handler( $src_queue_list, $html_list ) ;
163
+ }
164
+ // Only HTTP2 push
165
+ else {
166
+ foreach ( $src_queue_list as $val ) {
167
+ $this->append_http2( $val ) ;
168
+ }
169
+ }
170
+ }
171
+ }
172
+
173
+ if ( $this->cfg_js_minify || $this->cfg_js_combine || $this->cfg_http2_js ) {
174
+ list( $src_list, $html_list, $head_src_list ) = $this->_parse_js() ;
175
+
176
+ if ( $src_list ) {
177
+ list( $ignored_html, $src_queue_list ) = $this->_analyse_links( $src_list, $html_list, 'js' ) ;
178
+
179
+ // IF combine
180
+ if ( $this->cfg_js_combine ) {
181
+ // separate head/foot js/raw html
182
+ $head_js = array() ;
183
+ $head_ignored_html = array() ;
184
+ $foot_js = array() ;
185
+ $foot_ignored_html = array() ;
186
+ foreach ( $src_queue_list as $src ) {
187
+ if ( in_array( $src, $head_src_list ) ) {
188
+ $head_js[] = $src ;
189
+ }
190
+ else {
191
+ $foot_js[] = $src ;
192
+ }
193
+ }
194
+ foreach ( $ignored_html as $src => $html ) {
195
+ if ( in_array( $src, $head_src_list ) ) {
196
+ $head_ignored_html[] = $html ;
197
+ }
198
+ else {
199
+ $foot_ignored_html[] = $html ;
200
+ }
201
+ }
202
+
203
+ $url = $this->_build_hash_url( $head_js, 'js' ) ;
204
+ if ( $url ) {
205
+ $html = "<script data-minified='1' src='$url'></script>" ;
206
+ }
207
+ $html_head .= implode( '', $head_ignored_html ) . $html ;
208
+
209
+ $url = $this->_build_hash_url( $foot_js, 'js' ) ;
210
+ if ( $url ) {
211
+ $html = "<script data-minified='1' src='$url'></script>" ;
212
+ }
213
+ $html_foot .= implode( '', $foot_ignored_html ) . $html ;
214
+
215
+ // Will move all js to top/bottom
216
+ $this->content = str_replace( $html_list, '', $this->content ) ;
217
+
218
+ // Add to HTTP2
219
+ $this->append_http2( $url, 'js' ) ;
220
+
221
+ }
222
+ // Only minify
223
+ elseif ( $this->cfg_js_minify ) {
224
+ $this->_src_queue_handler( $src_queue_list, $html_list, 'js' ) ;
225
+ }
226
+ // Only HTTP2 push
227
+ else {
228
+ foreach ( $src_queue_list as $val ) {
229
+ $this->append_http2( $val ) ;
230
+ }
231
+ }
232
+ }
233
+ }
234
+
235
+ if ( $html_head ) {
236
+ $this->content = preg_replace( '#<head([^>]*)>#isU', '<head$1>' . $html_head , $this->content, 1 ) ;
237
+ }
238
+
239
+ if ( $html_foot ) {
240
+ $this->content = str_replace( '</body>', $html_foot . '</body>' , $this->content ) ;
241
+ }
242
+
243
+ // HTML minify
244
+ if ( $this->cfg_html_minify ) {
245
+ $ori = $this->content ;
246
+
247
+ set_error_handler( 'litespeed_exception_handler' ) ;
248
+ try {
249
+ litespeed_load_vendor() ;
250
+ $this->content = Minify_HTML::minify( $this->content ) ;
251
+ $this->content .= '<!-- Page minified by LiteSpeed Cache on '.date('Y-m-d H:i:s').' -->' ;
252
+
253
+ } catch ( ErrorException $e ) {
254
+ LiteSpeed_Cache_Control::debug( 'Error when optimizing HTML: ' . $e->getMessage() ) ;
255
+ error_log( 'LiteSpeed Optimizer optimizing HTML Error: ' . $e->getMessage() ) ;
256
+ // If failed to minify HTML, restore original content
257
+ $this->content = $ori ;
258
+ }
259
+ restore_error_handler() ;
260
+
261
+ }
262
+
263
+ if ( $this->http2_headers ) {
264
+ @header( 'Link: ' . implode( ',', $this->http2_headers ), false ) ;
265
+ }
266
+ }
267
+
268
+ /**
269
+ * Run minify with src queue list
270
+ *
271
+ * @since 1.2.2
272
+ * @access private
273
+ */
274
+ private function _src_queue_handler( $src_queue_list, $html_list, $file_type = 'css' )
275
+ {
276
+ $tag = $file_type === 'css' ? 'link' : 'script' ;
277
+ foreach ( $src_queue_list as $key => $src ) {
278
+ $url = $this->_build_hash_url( $src, $file_type ) ;
279
+ $html = str_replace( $src, $url, $html_list[ $key ] ) ;
280
+ $html = str_replace( "<$tag ", "<$tag data-minified='1' ", $html ) ;
281
+
282
+ $this->content = str_replace( $html_list[ $key ], $html, $this->content ) ;
283
+
284
+ // Add to HTTP2
285
+ $this->append_http2( $url, $file_type ) ;
286
+ }
287
+ }
288
+
289
+ /**
290
+ * Check if links are internal or external
291
+ *
292
+ * @since 1.2.2
293
+ * @access private
294
+ * @return array Array(Ignored raw html, src needed to be handled list)
295
+ */
296
+ private function _analyse_links( $src_list, $html_list, $file_type = 'css' )
297
+ {
298
+ if ( $file_type == 'css' ) {
299
+ $excludes = apply_filters( 'litespeed_cache_optimize_css_excludes', LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_CSS_EXCLUDES ) ) ;
300
+ }
301
+ else {
302
+ $excludes = apply_filters( 'litespeed_cache_optimize_js_excludes', LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_JS_EXCLUDES ) ) ;
303
+ }
304
+ if ( $excludes ) {
305
+ $excludes = explode( "\n", $excludes ) ;
306
+ }
307
+
308
+ $ignored_html = array() ;
309
+ $src_queue_list = array() ;
310
+
311
+ // Analyse links
312
+ foreach ( $src_list as $key => $src ) {
313
+ LiteSpeed_Cache_Log::debug2( 'Optm: ' . $src ) ;
314
+
315
+ if ( $excludes ) {
316
+ foreach ( $excludes as $exclude ) {
317
+ if ( stripos( $src, $exclude ) !== false ) {
318
+ $ignored_html[] = $html_list[ $key ] ;
319
+ LiteSpeed_Cache_Log::debug2( 'Optm: Abort excludes ' . $exclude ) ;
320
+ continue 2 ;
321
+ }
322
+ }
323
+ }
324
+
325
+ // Check if is external URL
326
+ $url_parsed = parse_url( $src ) ;
327
+ if ( ! $this->_is_file_url( $src ) ) {
328
+ $ignored_html[ $src ] = $html_list[ $key ] ;
329
+ LiteSpeed_Cache_Log::debug2( 'Optm: Abort external/non-exist ' ) ;
330
+ continue ;
331
+ }
332
+
333
+ $src_queue_list[ $key ] = $src ;
334
+ }
335
+
336
+ return array( $ignored_html, $src_queue_list ) ;
337
+ }
338
+
339
+ /**
340
+ * Check if an URL is a internal existing file
341
+ *
342
+ * @since 1.2.2
343
+ * @access private
344
+ * @return string|bool The real path of file OR false
345
+ */
346
+ private function _is_file_url( $url )
347
+ {
348
+ $url_parsed = parse_url( $url ) ;
349
+ if ( isset( $url_parsed[ 'host' ] ) && ! LiteSpeed_Cache_Utility::internal( $url_parsed[ 'host' ] ) ) {
350
+ // Check if is cdn path
351
+ if ( ! LiteSpeed_Cache_CDN::internal( $url_parsed[ 'host' ] ) ) {
352
+ return false ;
353
+ }
354
+ }
355
+
356
+ if ( empty( $url_parsed[ 'path' ] ) ) {
357
+ return false ;
358
+ }
359
+
360
+ // Need to replace child blog path for assets, ref: .htaccess
361
+ if ( is_multisite() && defined( 'PATH_CURRENT_SITE' ) ) {
362
+ $pattern = '#^' . PATH_CURRENT_SITE . '([_0-9a-zA-Z-]+/)(wp-(content|admin|includes))#U' ;
363
+ $replacement = PATH_CURRENT_SITE . '$2' ;
364
+ $url_parsed[ 'path' ] = preg_replace( $pattern, $replacement, $url_parsed[ 'path' ] ) ;
365
+ // $current_blog = (int) get_current_blog_id() ;
366
+ // $main_blog_id = (int) get_network()->site_id ;
367
+ // if ( $current_blog === $main_blog_id ) {
368
+ // define( 'LITESPEED_IS_MAIN_BLOG', true ) ;
369
+ // }
370
+ // else {
371
+ // define( 'LITESPEED_IS_MAIN_BLOG', false ) ;
372
+ // }
373
+ }
374
+
375
+ // Parse file path
376
+ if ( substr( $url_parsed[ 'path' ], 0, 1 ) === '/' ) {
377
+ $file_path = $_SERVER[ 'DOCUMENT_ROOT' ] . $url_parsed[ 'path' ] ;
378
+ }
379
+ else {
380
+ $file_path = LiteSpeed_Cache_Router::frontend_path() . '/' . $url_parsed[ 'path' ] ;
381
+ }
382
+ $file_path = realpath( $file_path ) ;
383
+ if ( ! is_file( $file_path ) ) {
384
+ return false ;
385
+ }
386
+
387
+ return $file_path ;
388
+ }
389
+
390
+ /**
391
+ * Run minify process and return final content
392
+ *
393
+ * @since 1.2.2
394
+ * @access private
395
+ * @return string The final content
396
+ */
397
+ private function _minify( $filename )
398
+ {
399
+ // Search filename in db for src URLs
400
+ $hashes = get_option( self::OPTION_OPTIMIZED ) ;
401
+ if ( ! $hashes || ! is_array( $hashes ) || empty( $hashes[ $filename ] ) ) {
402
+ return false;
403
+ }
404
+
405
+ $urls = $hashes[ $filename ] ;
406
+ $file_type = substr( $filename, strrpos( $filename, '.' ) + 1 ) ;
407
+
408
+ // Parse real file path
409
+ $real_files = array() ;
410
+ foreach ( $urls as $url ) {
411
+ $real_file = $this->_is_file_url( $url ) ;
412
+ if ( ! $real_file ) {
413
+ continue ;
414
+ }
415
+ $real_files[] = $real_file ;
416
+ }
417
+
418
+ if ( ! $real_files ) {
419
+ return false;
420
+ }
421
+
422
+ // Request to minify
423
+ $result = $this->_minify_serve( $real_files, $file_type ) ;
424
+
425
+ if ( empty( $result[ 'success' ] ) ) {
426
+ LiteSpeed_Cache_Log::debug( 'Optm: Lib serve failed ' . $result[ 'statusCode' ] ) ;
427
+ return false ;
428
+ }
429
+
430
+ LiteSpeed_Cache_Log::debug( 'Optm: Generated content' ) ;
431
+
432
+ return $result ;
433
+ }
434
+
435
+ /**
436
+ * Generate full URL path with hash for a list of src
437
+ *
438
+ * @since 1.2.2
439
+ * @access private
440
+ * @return string The final URL
441
+ */
442
+ private function _build_hash_url( $src, $file_type = 'css' )
443
+ {
444
+ if ( ! $src ) {
445
+ return false ;
446
+ }
447
+
448
+ if ( ! is_array( $src ) ) {
449
+ $src = array( $src ) ;
450
+ }
451
+ $src = array_values( $src ) ;
452
+
453
+ $hash = md5( serialize( $src ) ) ;
454
+
455
+ $short = substr( $hash, -5 ) ;
456
+
457
+ $filename = $short ;
458
+
459
+ // Need to check conflicts
460
+ $hashes = get_option( self::OPTION_OPTIMIZED ) ;
461
+ if ( ! is_array( $hashes ) ) {
462
+ $hashes = array() ;
463
+ }
464
+ // If short hash exists
465
+ if ( $hashes && ! empty( $hashes[ $short . '.' . $file_type ] ) ) {
466
+ // If conflicts
467
+ if ( $hashes[ $short . '.' . $file_type ] !== $src ) {
468
+ $hashes[ $hash . '.' . $file_type ] = $src ;
469
+ update_option( self::OPTION_OPTIMIZED, $hashes ) ;
470
+ $filename = $hash ;
471
+ }
472
+ }
473
+ else {
474
+ // Short hash is safe now
475
+ $hashes[ $short . '.' . $file_type ] = $src ;
476
+ update_option( self::OPTION_OPTIMIZED, $hashes ) ;
477
+ }
478
+
479
+ $file_to_save = self::DIR_MIN . '/' . $filename . '.' . $file_type ;
480
+
481
+ return $GLOBALS[ 'wp_rewrite' ]->using_permalinks() ? home_url( $file_to_save ) : home_url() . '/?' . $file_to_save ;
482
+ }
483
+
484
+ /**
485
+ * Parse js src
486
+ *
487
+ * @since 1.2.2
488
+ * @access private
489
+ * @return array All the src & related raw html list
490
+ */
491
+ private function _parse_js()
492
+ {
493
+ $src_list = array() ;
494
+ $html_list = array() ;
495
+ $head_src_list = array() ;
496
+
497
+ $content = preg_replace( '#<!--.*-->#sU', '', $this->content ) ;
498
+ preg_match_all( '#<script\s+([^>]+)>\s*</script>|</head>#isU', $content, $matches, PREG_SET_ORDER ) ;
499
+ $i = 0;
500
+ $is_head = true ;
501
+ foreach ( $matches as $match ) {
502
+ if ( $match[ 0 ] === '</head>' ) {
503
+ $is_head = false ;
504
+ continue ;
505
+ }
506
+ $attrs = $this->_parse_attr( $match[ 1 ] ) ;
507
+
508
+ if ( ! empty( $attrs[ 'data-minified' ] ) ) {
509
+ continue ;
510
+ }
511
+ if ( empty( $attrs[ 'src' ] ) ) {
512
+ continue ;
513
+ }
514
+
515
+ $src_list[] = $attrs[ 'src' ] ;
516
+ $html_list[] = $match[ 0 ] ;
517
+
518
+ if ( $is_head ) {
519
+ $head_src_list[] = $attrs[ 'src' ] ;
520
+ }
521
+ }
522
+
523
+ return array( $src_list, $html_list, $head_src_list ) ;
524
+ }
525
+
526
+ /**
527
+ * Parse css src
528
+ *
529
+ * @since 1.2.2
530
+ * @access private
531
+ * @return array All the src & related raw html list
532
+ */
533
+ private function _parse_css()
534
+ {
535
+ $src_list = array() ;
536
+ $html_list = array() ;
537
+
538
+ // $dom = new PHPHtmlParser\Dom ;
539
+ // $dom->load( $content ) ;return $val;
540
+ // $items = $dom->find( 'link' ) ;
541
+
542
+ $content = preg_replace( '#<!--.*-->#sU', '', $this->content ) ;
543
+ preg_match_all( '#<link\s+([^>]+)/?>#isU', $content, $matches, PREG_SET_ORDER ) ;
544
+ $i = 0;
545
+ foreach ( $matches as $match ) {
546
+ $attrs = $this->_parse_attr( $match[ 1 ] ) ;
547
+
548
+ if ( empty( $attrs[ 'rel' ] ) || $attrs[ 'rel' ] !== 'stylesheet' ) {
549
+ continue ;
550
+ }
551
+ if ( ! empty( $attrs[ 'data-minified' ] ) ) {
552
+ continue ;
553
+ }
554
+ if ( ! empty( $attrs[ 'media' ] ) && strpos( $attrs[ 'media' ], 'print' ) !== false ) {
555
+ continue ;
556
+ }
557
+ if ( empty( $attrs[ 'href' ] ) ) {
558
+ continue ;
559
+ }
560
+
561
+ $src_list[] = $attrs[ 'href' ] ;
562
+ $html_list[] = $match[ 0 ] ;
563
+ }
564
+
565
+ return array( $src_list, $html_list ) ;
566
+ }
567
+
568
+ /**
569
+ * Parse attributes from string
570
+ *
571
+ * @since 1.2.2
572
+ * @access private
573
+ * @param string $str
574
+ * @return array All the attributes
575
+ */
576
+ private function _parse_attr( $str )
577
+ {
578
+ $attrs = array() ;
579
+ preg_match_all( '#(\w+)=["\']([^"\']*)["\']#isU', $str, $matches, PREG_SET_ORDER ) ;
580
+ foreach ( $matches as $match ) {
581
+ $attrs[ $match[ 1 ] ] = trim( $match[ 2 ] ) ;
582
+ }
583
+ return $attrs ;
584
+ }
585
+
586
+ /**
587
+ * Append to HTTP2 header
588
+ *
589
+ * @since 1.2.2
590
+ * @access private
591
+ */
592
+ private function append_http2( $url, $file_type = 'css' )
593
+ {
594
+ if ( ! ( $file_type === 'css' ? $this->cfg_http2_css : $this->cfg_http2_js ) ) {
595
+ return ;
596
+ }
597
+
598
+ $uri = LiteSpeed_Cache_Utility::url2uri( $url ) ;
599
+
600
+ if ( ! $uri ) {
601
+ return ;
602
+ }
603
+
604
+ $this->http2_headers[] = '<' . $uri . '>; rel=preload; as=' . ( $file_type === 'css' ? 'style' : 'script' ) ;
605
+ }
606
+
607
+ /**
608
+ * Run minify serve
609
+ *
610
+ * @since 1.2.2
611
+ * @access private
612
+ * @param array|string $files The file(s) to minify/combine
613
+ * @return string The string after effect
614
+ */
615
+ private function _minify_serve( $files, $file_type )
616
+ {
617
+ set_error_handler( 'litespeed_exception_handler' ) ;
618
+ try {
619
+ litespeed_load_vendor() ;
620
+ if ( ! isset( $this->minify_cache ) ) {
621
+ $this->minify_cache = new Minify_Cache_File() ;
622
+ }
623
+ if ( ! isset( $this->minify_minify ) ) {
624
+ $this->minify_minify = new Minify( $this->minify_cache ) ;
625
+ }
626
+ if ( ! isset( $this->minify_env ) ) {
627
+ $this->minify_env = new Minify_Env() ;
628
+ }
629
+ if ( ! isset( $this->minify_sourceFactory ) ) {
630
+ $this->minify_sourceFactory = new Minify_Source_Factory( $this->minify_env, array(), $this->minify_cache ) ;
631
+ }
632
+ if ( ! isset( $this->minify_controller ) ) {
633
+ $this->minify_controller = new Minify_Controller_Files( $this->minify_env, $this->minify_sourceFactory ) ;
634
+ }
635
+ if ( ! isset( $this->minify_options ) ) {
636
+ $this->minify_options = array(
637
+ 'encodeOutput' => false,
638
+ 'quiet' => true,
639
+ ) ;
640
+ }
641
+
642
+ $this->minify_options[ 'concatOnly' ] = ! ( $file_type === 'css' ? $this->cfg_css_minify : $this->cfg_js_minify ) ;
643
+
644
+ $this->minify_options[ 'files' ] = $files ;
645
+
646
+ $content = $this->minify_minify->serve( $this->minify_controller, $this->minify_options ) ;
647
+
648
+ } catch ( ErrorException $e ) {
649
+ LiteSpeed_Cache_Control::debug( 'Error when serving from optimizer: ' . $e->getMessage() ) ;
650
+ error_log( 'LiteSpeed Optimizer serving Error: ' . $e->getMessage() ) ;
651
+ return false ;
652
+ }
653
+ restore_error_handler() ;
654
+
655
+ return $content ;
656
+ }
657
+
658
+ /**
659
+ * Get the current instance object.
660
+ *
661
+ * @since 1.2.2
662
+ * @access public
663
+ * @return Current class instance.
664
+ */
665
+ public static function get_instance()
666
+ {
667
+ if ( ! isset(self::$_instance) ) {
668
+ self::$_instance = new self() ;
669
+ }
670
+
671
+ return self::$_instance ;
672
+ }
673
+
674
+ }
675
+
676
+
677
+
includes/litespeed-cache-purge.class.php CHANGED
@@ -148,6 +148,17 @@ class LiteSpeed_Cache_Purge
148
  self::add( LiteSpeed_Cache_Tag::TYPE_PAGES ) ;
149
  }
150
 
 
 
 
 
 
 
 
 
 
 
 
151
  /**
152
  * Alerts LiteSpeed Web Server to purge error pages.
153
  *
@@ -157,19 +168,11 @@ class LiteSpeed_Cache_Purge
157
  public static function purge_errors()
158
  {
159
  self::add( LiteSpeed_Cache_Tag::TYPE_ERROR ) ;
160
- if ( ! isset( $_POST[LiteSpeed_Cache_Config::OPTION_NAME] ) ) {
161
  return ;
162
  }
163
- $input = $_POST[LiteSpeed_Cache_Config::OPTION_NAME] ;
164
- if ( isset( $input['include_403'] ) ) {
165
- self::add( LiteSpeed_Cache_Tag::TYPE_ERROR . '403' ) ;
166
- }
167
- if ( isset( $input['include_404'] ) ) {
168
- self::add( LiteSpeed_Cache_Tag::TYPE_ERROR . '404' ) ;
169
- }
170
- if ( isset( $input['include_500'] ) ) {
171
- self::add( LiteSpeed_Cache_Tag::TYPE_ERROR . '500' ) ;
172
- }
173
  }
174
 
175
  /**
@@ -636,7 +639,7 @@ class LiteSpeed_Cache_Purge
636
 
637
  if ( $config->purge_by_post(LiteSpeed_Cache_Config::PURGE_TERM) ) {
638
  $taxonomies = get_object_taxonomies($post_type) ;
639
- //LiteSpeed_Cache_Log::push('purge by post, check tax = ' . print_r($taxonomies, true)) ;
640
  foreach ( $taxonomies as $tax ) {
641
  $terms = get_the_terms($post_id, $tax) ;
642
  if ( ! empty($terms) ) {
@@ -722,9 +725,8 @@ class LiteSpeed_Cache_Purge
722
  */
723
  public static function get_instance()
724
  {
725
- $cls = get_called_class() ;
726
  if ( ! isset(self::$_instance) ) {
727
- self::$_instance = new $cls() ;
728
  }
729
 
730
  return self::$_instance ;
148
  self::add( LiteSpeed_Cache_Tag::TYPE_PAGES ) ;
149
  }
150
 
151
+ /**
152
+ * Alerts LiteSpeed Web Server to purge pages.
153
+ *
154
+ * @since 1.2.2
155
+ * @access public
156
+ */
157
+ public static function purge_cssjs()
158
+ {
159
+ self::add( LiteSpeed_Cache_Tag::TYPE_MIN ) ;
160
+ }
161
+
162
  /**
163
  * Alerts LiteSpeed Web Server to purge error pages.
164
  *
168
  public static function purge_errors()
169
  {
170
  self::add( LiteSpeed_Cache_Tag::TYPE_ERROR ) ;
171
+ if ( ! isset( $_GET[ 'lserr' ] ) || ! in_array( $_GET[ 'lserr' ], array( '403', '404', '500' ) ) ) {
172
  return ;
173
  }
174
+
175
+ self::add( LiteSpeed_Cache_Tag::TYPE_ERROR . $_GET[ 'lserr' ] ) ;
 
 
 
 
 
 
 
 
176
  }
177
 
178
  /**
639
 
640
  if ( $config->purge_by_post(LiteSpeed_Cache_Config::PURGE_TERM) ) {
641
  $taxonomies = get_object_taxonomies($post_type) ;
642
+ //LiteSpeed_Cache_Log::push('purge by post, check tax = ' . var_export($taxonomies, true)) ;
643
  foreach ( $taxonomies as $tax ) {
644
  $terms = get_the_terms($post_id, $tax) ;
645
  if ( ! empty($terms) ) {
725
  */
726
  public static function get_instance()
727
  {
 
728
  if ( ! isset(self::$_instance) ) {
729
+ self::$_instance = new self() ;
730
  }
731
 
732
  return self::$_instance ;
includes/litespeed-cache-router.class.php CHANGED
@@ -14,6 +14,7 @@ class LiteSpeed_Cache_Router
14
  {
15
  private static $_instance ;
16
  private static $_is_enabled ;
 
17
  private static $_is_ajax ;
18
  private static $_is_logged_in ;
19
  private static $_is_cli ;
@@ -24,6 +25,31 @@ class LiteSpeed_Cache_Router
24
  private static $_siteurl ;
25
  private static $_has_whm_msg ;
26
  private static $_has_msg_ruleconflict ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
  /**
29
  * Check if crawler is enabled on server level
@@ -46,6 +72,21 @@ class LiteSpeed_Cache_Router
46
  return self::$_siteurl ;
47
  }
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  /**
50
  * Check if cache is enabled or not
51
  *
@@ -270,6 +311,7 @@ class LiteSpeed_Cache_Router
270
 
271
  case LiteSpeed_Cache::ACTION_PURGE_FRONT:
272
  case LiteSpeed_Cache::ACTION_PURGE_PAGES:
 
273
  case LiteSpeed_Cache::ACTION_PURGE_ERRORS:
274
  case LiteSpeed_Cache::ACTION_PURGE_ALL:
275
  case LiteSpeed_Cache::ACTION_PURGE_BY:
@@ -279,6 +321,12 @@ class LiteSpeed_Cache_Router
279
  }
280
  return ;
281
 
 
 
 
 
 
 
282
  case LiteSpeed_Cache::ACTION_PURGE_EMPTYCACHE:
283
  if ( $_is_enabled
284
  && ( $_can_network_option
@@ -404,9 +452,8 @@ class LiteSpeed_Cache_Router
404
  */
405
  public static function get_instance()
406
  {
407
- $cls = get_called_class() ;
408
  if ( ! isset( self::$_instance ) ) {
409
- self::$_instance = new $cls() ;
410
  }
411
 
412
  return self::$_instance ;
14
  {
15
  private static $_instance ;
16
  private static $_is_enabled ;
17
+ private static $_esi_enabled ;
18
  private static $_is_ajax ;
19
  private static $_is_logged_in ;
20
  private static $_is_cli ;
25
  private static $_siteurl ;
26
  private static $_has_whm_msg ;
27
  private static $_has_msg_ruleconflict ;
28
+ private static $_frontend_path ;
29
+
30
+ /**
31
+ * Get frontend path
32
+ *
33
+ * @since 1.2.2
34
+ * @access public
35
+ * @return boolean
36
+ */
37
+ public static function frontend_path()
38
+ {
39
+ if ( ! isset( self::$_frontend_path ) ) {
40
+ $frontend = rtrim( ABSPATH, '/' ) ; // /home/user/public_html/frontend
41
+ // get home path failed. Trac ticket #37668 (e.g. frontend:/blog backend:/wordpress)
42
+ if ( ! $frontend ) {
43
+ $frontend = parse_url( get_option( 'home' ) ) ;
44
+ $frontend = ! empty( $frontend[ 'path' ] ) ? $frontend[ 'path' ] : '' ;
45
+ $frontend = $_SERVER[ 'DOCUMENT_ROOT' ] . $frontend ;
46
+ }
47
+ $frontend = realpath( $frontend ) ;
48
+
49
+ self::$_frontend_path = $frontend ;
50
+ }
51
+ return self::$_frontend_path ;
52
+ }
53
 
54
  /**
55
  * Check if crawler is enabled on server level
72
  return self::$_siteurl ;
73
  }
74
 
75
+ /**
76
+ * Check if ESI is enabled or not
77
+ *
78
+ * @since 1.2.0
79
+ * @access public
80
+ * @return boolean
81
+ */
82
+ public static function esi_enabled()
83
+ {
84
+ if ( ! isset( self::$_esi_enabled ) ) {
85
+ self::$_esi_enabled = LSWCP_ESI_SUPPORT && LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_ESI_ENABLE ) ;
86
+ }
87
+ return self::$_esi_enabled ;
88
+ }
89
+
90
  /**
91
  * Check if cache is enabled or not
92
  *
311
 
312
  case LiteSpeed_Cache::ACTION_PURGE_FRONT:
313
  case LiteSpeed_Cache::ACTION_PURGE_PAGES:
314
+ case LiteSpeed_Cache::ACTION_PURGE_CSSJS:
315
  case LiteSpeed_Cache::ACTION_PURGE_ERRORS:
316
  case LiteSpeed_Cache::ACTION_PURGE_ALL:
317
  case LiteSpeed_Cache::ACTION_PURGE_BY:
321
  }
322
  return ;
323
 
324
+ case LiteSpeed_Cache::ACTION_DB_OPTIMIZE:
325
+ if ( $_is_enabled && ( $_can_network_option || $_can_option ) ) {
326
+ self::$_action = $action ;
327
+ }
328
+ return ;
329
+
330
  case LiteSpeed_Cache::ACTION_PURGE_EMPTYCACHE:
331
  if ( $_is_enabled
332
  && ( $_can_network_option
452
  */
453
  public static function get_instance()
454
  {
 
455
  if ( ! isset( self::$_instance ) ) {
456
+ self::$_instance = new self() ;
457
  }
458
 
459
  return self::$_instance ;
includes/litespeed-cache-tag.class.php CHANGED
@@ -29,6 +29,7 @@ class LiteSpeed_Cache_Tag
29
  const TYPE_ESI = 'ESI.' ;
30
  const TYPE_REST = 'REST' ;
31
  const TYPE_LIST = 'LIST' ;
 
32
 
33
  const X_HEADER = 'X-LiteSpeed-Tag' ;
34
 
@@ -356,9 +357,8 @@ class LiteSpeed_Cache_Tag
356
  */
357
  // public static function get_instance()
358
  // {
359
- // $cls = get_called_class() ;
360
  // if ( ! isset(self::$_instance) ) {
361
- // self::$_instance = new $cls() ;
362
  // }
363
 
364
  // return self::$_instance ;
29
  const TYPE_ESI = 'ESI.' ;
30
  const TYPE_REST = 'REST' ;
31
  const TYPE_LIST = 'LIST' ;
32
+ const TYPE_MIN = 'MIN' ;
33
 
34
  const X_HEADER = 'X-LiteSpeed-Tag' ;
35
 
357
  */
358
  // public static function get_instance()
359
  // {
 
360
  // if ( ! isset(self::$_instance) ) {
361
+ // self::$_instance = new self() ;
362
  // }
363
 
364
  // return self::$_instance ;
includes/litespeed-cache-utility.class.php CHANGED
@@ -11,6 +11,45 @@
11
  class LiteSpeed_Cache_Utility
12
  {
13
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  /**
15
  * Make URL to be relative
16
  *
@@ -21,7 +60,7 @@ class LiteSpeed_Cache_Utility
21
  {
22
  // replace site_url if the url is full url
23
  // NOTE: for subfolder site_url, need to strip subfolder part (strip anything but scheme and host)
24
- require_once LSWCP_DIR . 'lib/litespeed-php-compatibility.func.php' ;
25
  $site_url_domain = http_build_url( LiteSpeed_Cache_Router::get_siteurl(), array(), HTTP_URL_STRIP_ALL ) ;
26
  if ( strpos( $url, $site_url_domain ) === 0 ) {
27
  $url = substr( $url, strlen( $site_url_domain ) ) ;
11
  class LiteSpeed_Cache_Utility
12
  {
13
 
14
+ /**
15
+ * Improve compatibility to PHP old versions
16
+ *
17
+ * @since 1.2.2
18
+ *
19
+ */
20
+ public static function compatibility()
21
+ {
22
+ require_once LSWCP_DIR . 'lib/litespeed-php-compatibility.func.php' ;
23
+ }
24
+
25
+ /**
26
+ * Check if the host is the internal host
27
+ *
28
+ * @since 1.2.3
29
+ *
30
+ */
31
+ public static function internal( $host )
32
+ {
33
+ if ( ! defined( 'LITESPEED_FRONTEND_HOST' ) ) {
34
+ define( 'LITESPEED_FRONTEND_HOST', parse_url( get_option( 'home' ), PHP_URL_HOST ) ) ;
35
+ }
36
+
37
+ return $host === LITESPEED_FRONTEND_HOST ;
38
+ }
39
+
40
+ /**
41
+ * Convert URL to URI
42
+ *
43
+ * @since 1.2.2
44
+ *
45
+ */
46
+ public static function url2uri( $url )
47
+ {
48
+ $url = trim( $url ) ;
49
+ $uri = @parse_url( $url, PHP_URL_PATH ) ;
50
+ return $uri ;
51
+ }
52
+
53
  /**
54
  * Make URL to be relative
55
  *
60
  {
61
  // replace site_url if the url is full url
62
  // NOTE: for subfolder site_url, need to strip subfolder part (strip anything but scheme and host)
63
+ self::compatibility() ;
64
  $site_url_domain = http_build_url( LiteSpeed_Cache_Router::get_siteurl(), array(), HTTP_URL_STRIP_ALL ) ;
65
  if ( strpos( $url, $site_url_domain ) === 0 ) {
66
  $url = substr( $url, strlen( $site_url_domain ) ) ;
includes/litespeed-cache-vary.class.php CHANGED
@@ -31,7 +31,7 @@ class LiteSpeed_Cache_Vary
31
  self::add_logged_in() ;
32
 
33
  // If not esi, check cache logged-in user setting
34
- if ( ! LSWCP_ESI_SUPPORT || ! LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_ESI_ENABLE ) ) {
35
  // If cache logged-in, then init cacheable to private
36
  if ( LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_CACHE_PRIV ) ) {
37
  add_action( 'wp_logout', 'LiteSpeed_Cache_Purge::purge_on_logout' ) ;
@@ -46,6 +46,7 @@ class LiteSpeed_Cache_Vary
46
  }
47
  // ESI is on, can be public cache
48
  else {
 
49
  LiteSpeed_Cache_Control::init_cacheable() ;
50
  }
51
 
@@ -58,7 +59,7 @@ class LiteSpeed_Cache_Vary
58
  self::remove_logged_in() ;
59
 
60
  // Set vary cookie for logging in user, otherwise the user will hit public with vary=0 (guest version)
61
- add_action( 'set_logged_in_cookie', 'LiteSpeed_Cache_Vary::add_logged_in', 10, 2 ) ;
62
  add_action( 'wp_login', 'LiteSpeed_Cache_Purge::purge_on_logout' ) ;
63
 
64
  LiteSpeed_Cache_Control::init_cacheable() ;
@@ -147,6 +148,7 @@ class LiteSpeed_Cache_Vary
147
  if ( ! $pending ) {
148
  $this->remove_commenter() ;
149
 
 
150
  foreach( $_COOKIE as $cookie_name => $cookie_value ) {
151
  if ( strlen( $cookie_name ) >= 15 && strncmp( $cookie_name, 'comment_author_', 15 ) == 0 ) {
152
  unset( $_COOKIE[ $cookie_name ] ) ;
@@ -174,14 +176,14 @@ class LiteSpeed_Cache_Vary
174
  * Check if default vary has a value
175
  *
176
  * @since 1.1.3
177
- * @access private
178
  */
179
- private static function has_vary()
180
  {
181
  if ( empty( $_COOKIE[ self::$_vary_name ] ) ) {
182
  return false ;
183
  }
184
- return intval( $_COOKIE[ self::$_vary_name ] ) ;
185
  }
186
 
187
  /**
@@ -190,17 +192,19 @@ class LiteSpeed_Cache_Vary
190
  * @since 1.1.3
191
  * @access public
192
  */
193
- public static function add_logged_in($logged_in_cookie = false, $expire = false)
194
  {
195
  // If the cookie is lost somehow, set it
196
- if ( ! self::has_vary() ) {
197
- $_COOKIE[ self::$_vary_name ] = 1 ;
 
 
198
 
199
  // save it
200
  if ( ! $expire ) {
201
  $expire = time() + 2 * DAY_IN_SECONDS ;
202
  }
203
- self::_cookie( $_COOKIE[ self::$_vary_name ], $expire ) ;
204
  LiteSpeed_Cache_Control::set_nocache( 'adding logged in status' ) ;
205
  }
206
  }
@@ -213,16 +217,70 @@ class LiteSpeed_Cache_Vary
213
  */
214
  public static function remove_logged_in()
215
  {
216
- // If the cookie is set, unset it.
217
- if ( self::has_vary() === 1 ) {
 
218
  // remove logged in status from global var
219
- unset( $_COOKIE[ self::$_vary_name ] ) ;
 
220
  // save it
221
  self::_cookie() ;
222
  LiteSpeed_Cache_Control::set_nocache( 'removing logged in status' ) ;
223
  }
224
  }
225
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  /**
227
  * Append user status with commenter
228
  *
@@ -246,11 +304,12 @@ class LiteSpeed_Cache_Vary
246
  private function add_commenter( $from_redirect = false )
247
  {
248
  // If the cookie is lost somehow, set it
249
- if ( self::has_vary() !== 2 ) {
250
- $_COOKIE[ self::$_vary_name ] = 2 ;
 
251
  // save it
252
  // only set commenter status for current domain path
253
- self::_cookie( $_COOKIE[ self::$_vary_name ], time() + apply_filters( 'comment_cookie_lifetime', 30000000 ), self::_relative_path( $from_redirect ) ) ;
254
  LiteSpeed_Cache_Control::set_nocache( 'adding commenter status' ) ;
255
  }
256
  }
@@ -263,9 +322,10 @@ class LiteSpeed_Cache_Vary
263
  */
264
  private function remove_commenter()
265
  {
266
- if ( self::has_vary() === 2 ) {
267
  // remove logged in status from global var
268
- unset( $_COOKIE[ self::$_vary_name ] ) ;
 
269
  // save it
270
  self::_cookie( false, false, self::_relative_path() ) ;
271
  LiteSpeed_Cache_Control::set_nocache( 'removing commenter status' ) ;
@@ -392,9 +452,8 @@ class LiteSpeed_Cache_Vary
392
  */
393
  public static function get_instance()
394
  {
395
- $cls = get_called_class() ;
396
  if ( ! isset(self::$_instance) ) {
397
- self::$_instance = new $cls() ;
398
  }
399
 
400
  return self::$_instance ;
31
  self::add_logged_in() ;
32
 
33
  // If not esi, check cache logged-in user setting
34
+ if ( ! LiteSpeed_Cache_Router::esi_enabled() ) {
35
  // If cache logged-in, then init cacheable to private
36
  if ( LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_CACHE_PRIV ) ) {
37
  add_action( 'wp_logout', 'LiteSpeed_Cache_Purge::purge_on_logout' ) ;
46
  }
47
  // ESI is on, can be public cache
48
  else {
49
+ // Need to make sure vary is using group id
50
  LiteSpeed_Cache_Control::init_cacheable() ;
51
  }
52
 
59
  self::remove_logged_in() ;
60
 
61
  // Set vary cookie for logging in user, otherwise the user will hit public with vary=0 (guest version)
62
+ add_action( 'set_logged_in_cookie', 'LiteSpeed_Cache_Vary::add_logged_in', 10, 4 ) ;
63
  add_action( 'wp_login', 'LiteSpeed_Cache_Purge::purge_on_logout' ) ;
64
 
65
  LiteSpeed_Cache_Control::init_cacheable() ;
148
  if ( ! $pending ) {
149
  $this->remove_commenter() ;
150
 
151
+ // Remove commenter prefilled info if exists, for public cache
152
  foreach( $_COOKIE as $cookie_name => $cookie_value ) {
153
  if ( strlen( $cookie_name ) >= 15 && strncmp( $cookie_name, 'comment_author_', 15 ) == 0 ) {
154
  unset( $_COOKIE[ $cookie_name ] ) ;
176
  * Check if default vary has a value
177
  *
178
  * @since 1.1.3
179
+ * @access public
180
  */
181
+ public static function has_vary()
182
  {
183
  if ( empty( $_COOKIE[ self::$_vary_name ] ) ) {
184
  return false ;
185
  }
186
+ return $_COOKIE[ self::$_vary_name ] ;
187
  }
188
 
189
  /**
192
  * @since 1.1.3
193
  * @access public
194
  */
195
+ public static function add_logged_in( $logged_in_cookie = false, $expire = false, $expiration = false, $user_id = false )
196
  {
197
  // If the cookie is lost somehow, set it
198
+ $vary = self::generate_vary( $user_id ) ;
199
+ $current_vary = self::has_vary() ;
200
+ if ( $current_vary !== $vary && $current_vary !== 'commenter' ) {
201
+ // $_COOKIE[ self::$_vary_name ] = $vary ; // not needed
202
 
203
  // save it
204
  if ( ! $expire ) {
205
  $expire = time() + 2 * DAY_IN_SECONDS ;
206
  }
207
+ self::_cookie( $vary, $expire ) ;
208
  LiteSpeed_Cache_Control::set_nocache( 'adding logged in status' ) ;
209
  }
210
  }
217
  */
218
  public static function remove_logged_in()
219
  {
220
+ // If the cookie is set and not commenter, unset it.
221
+ $current_vary = self::has_vary() ;
222
+ if ( $current_vary && $current_vary !== 'commenter' ) {
223
  // remove logged in status from global var
224
+ // unset( $_COOKIE[ self::$_vary_name ] ) ; // not needed
225
+
226
  // save it
227
  self::_cookie() ;
228
  LiteSpeed_Cache_Control::set_nocache( 'removing logged in status' ) ;
229
  }
230
  }
231
 
232
+ /**
233
+ * Get user vary tag based on admin_bar & role
234
+ *
235
+ * @since 1.2.0
236
+ * @access public
237
+ */
238
+ public static function generate_vary( $user_id )
239
+ {
240
+ if ( ! $user_id ) {
241
+ $user = wp_get_current_user() ;
242
+ $user_id = $user->ID ;
243
+ LiteSpeed_Cache_Log::debug2( 'getting user_id: ' . $user_id ) ;
244
+ }
245
+ $vary = array( 'logged-in' => 1 ) ;
246
+ // get user's group id
247
+ $user = get_userdata( $user_id ) ;
248
+ if ( empty( $user->roles[ 0 ] ) ) {
249
+ // Guest user
250
+ LiteSpeed_Cache_Log::debug( 'Vary role id: failed, guest' ) ;
251
+ return false ;
252
+ }
253
+
254
+ // parge role group from settings
255
+ $gid = $user->roles[ 0 ] ?: 0 ;
256
+ if ( $role_group = LiteSpeed_Cache_Config::get_instance()->in_vary_group( $gid ) ) {
257
+ $vary[ 'role' ] = $role_group ;
258
+ LiteSpeed_Cache_Log::debug2( 'Vary role group: ' . $gid ) ;
259
+ }
260
+
261
+ // Get admin bar set
262
+ // see @_get_admin_bar_pref()
263
+ $pref = get_user_option( 'show_admin_bar_front', $user_id ) ;
264
+ LiteSpeed_Cache_Log::debug2( 'Vary show_admin_bar_front: ' . $pref ) ;
265
+ $admin_bar = $pref === false || $pref === 'true' ;
266
+
267
+ if ( $admin_bar ) {
268
+ $vary[ 'admin_bar' ] = 1 ;
269
+ LiteSpeed_Cache_Log::debug2( 'Vary admin bar : true' ) ;
270
+ }
271
+
272
+ ksort( $vary ) ;
273
+ $res = array() ;
274
+ foreach ( $vary as $key => $val ) {
275
+ $res[] = $key . ':' . $val ;
276
+ }
277
+
278
+ if ( ! $res ) {
279
+ return false ;
280
+ }
281
+ return implode( ';', $res ) ;// Encrypt in production
282
+ }
283
+
284
  /**
285
  * Append user status with commenter
286
  *
304
  private function add_commenter( $from_redirect = false )
305
  {
306
  // If the cookie is lost somehow, set it
307
+ if ( self::has_vary() !== 'commenter' ) {
308
+ // $_COOKIE[ self::$_vary_name ] = 'commenter' ; // not needed
309
+
310
  // save it
311
  // only set commenter status for current domain path
312
+ self::_cookie( 'commenter', time() + apply_filters( 'comment_cookie_lifetime', 30000000 ), self::_relative_path( $from_redirect ) ) ;
313
  LiteSpeed_Cache_Control::set_nocache( 'adding commenter status' ) ;
314
  }
315
  }
322
  */
323
  private function remove_commenter()
324
  {
325
+ if ( self::has_vary() === 'commenter' ) {
326
  // remove logged in status from global var
327
+ // unset( $_COOKIE[ self::$_vary_name ] ) ; // not needed
328
+
329
  // save it
330
  self::_cookie( false, false, self::_relative_path() ) ;
331
  LiteSpeed_Cache_Control::set_nocache( 'removing commenter status' ) ;
452
  */
453
  public static function get_instance()
454
  {
 
455
  if ( ! isset(self::$_instance) ) {
456
+ self::$_instance = new self() ;
457
  }
458
 
459
  return self::$_instance ;
includes/litespeed-cache.class.php CHANGED
@@ -18,7 +18,7 @@ class LiteSpeed_Cache
18
  private static $_instance ;
19
 
20
  const PLUGIN_NAME = 'litespeed-cache' ;
21
- const PLUGIN_VERSION = '1.1.6' ;
22
 
23
  const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
24
 
@@ -31,6 +31,7 @@ class LiteSpeed_Cache
31
  const ACTION_SAVE_SETTINGS_NETWORK = 'save-settings-network' ;
32
  const ACTION_PURGE_ERRORS = 'PURGE_ERRORS' ;
33
  const ACTION_PURGE_PAGES = 'PURGE_PAGES' ;
 
34
  const ACTION_PURGE_BY = 'PURGE_BY' ;
35
  const ACTION_PURGE_FRONT = 'PURGE_FRONT' ;
36
  const ACTION_PURGE_ALL = 'PURGE_ALL' ;
@@ -47,6 +48,8 @@ class LiteSpeed_Cache
47
  const ACTION_DO_CRAWL = 'do-crawl' ;
48
  const ACTION_BLACKLIST_SAVE = 'blacklist-save' ;
49
 
 
 
50
  const WHM_TRANSIENT = 'lscwp_whm_install' ;
51
  const WHM_TRANSIENT_VAL = 'whm_install' ;
52
 
@@ -68,7 +71,7 @@ class LiteSpeed_Cache
68
  // Check if debug is on
69
  if ( self::config(LiteSpeed_Cache_Config::OPID_ENABLED) ) {
70
  $should_debug = intval(self::config(LiteSpeed_Cache_Config::OPID_DEBUG)) ;
71
- if ( $should_debug == LiteSpeed_Cache_Config::VAL_ON || ($should_debug == LiteSpeed_Cache_Config::VAL_NOTSET && LiteSpeed_Cache_Router::is_admin_ip()) ) {
72
  LiteSpeed_Cache_Log::set_enabled() ;
73
  }
74
 
@@ -76,7 +79,7 @@ class LiteSpeed_Cache
76
  include_once LSWCP_DIR . 'thirdparty/lscwp-registry-3rd.php' ;
77
  }
78
 
79
- if ( ! LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_HEARTBEAT ) ) {
80
  add_action( 'init', 'LiteSpeed_Cache_Log::disable_heartbeat', 1 ) ;
81
  }
82
 
@@ -124,10 +127,16 @@ class LiteSpeed_Cache
124
  add_action( 'shutdown', array( $this, 'send_headers' ), 0 ) ;
125
  add_action( 'wp_footer', 'LiteSpeed_Cache::litespeed_comment_info' ) ;
126
 
 
 
 
127
  // 1. Init vary
128
  // 2. Init cacheable status
129
  LiteSpeed_Cache_Vary::get_instance() ;
130
 
 
 
 
131
  // Load public hooks
132
  $this->load_public_actions() ;
133
 
@@ -206,6 +215,11 @@ class LiteSpeed_Cache
206
  $msg = __( 'Notified LiteSpeed Web Server to purge pages.', 'litespeed-cache' ) ;
207
  break ;
208
 
 
 
 
 
 
209
  case LiteSpeed_Cache::ACTION_PURGE_ERRORS:
210
  LiteSpeed_Cache_Purge::purge_errors() ;
211
  $msg = __( 'Notified LiteSpeed Web Server to purge error pages.', 'litespeed-cache' ) ;
@@ -237,6 +251,10 @@ class LiteSpeed_Cache
237
  update_option( LiteSpeed_Cache_Admin_Display::DISMISS_MSG, LiteSpeed_Cache_Admin_Display::RULECONFLICT_DISMISSED ) ;
238
  break ;
239
 
 
 
 
 
240
  default:
241
  break ;
242
  }
@@ -285,14 +303,10 @@ class LiteSpeed_Cache
285
 
286
  // The ESI functionality is an enterprise feature.
287
  // Removing the openlitespeed check will simply break the page.
288
- //todo: make a constant for esiEnable included cfg esi eanbled
289
- if ( LSWCP_ESI_SUPPORT ) {
290
- if ( ! LiteSpeed_Cache_Router::is_ajax() && self::config( LiteSpeed_Cache_Config::OPID_ESI_ENABLE ) ) {
291
- add_action( 'template_include', 'LiteSpeed_Cache_ESI::esi_template', 100 ) ;
292
- add_action( 'load-widgets.php', 'LiteSpeed_Cache_Purge::purge_widget' ) ;
293
- add_action( 'wp_update_comment_count', 'LiteSpeed_Cache_Purge::purge_comment_widget' ) ;
294
- }
295
  }
 
296
  add_action( 'wp_update_comment_count', 'LiteSpeed_Cache_Purge::purge_feeds' ) ;
297
 
298
  // register recent posts widget tag before theme renders it to make it work
@@ -339,6 +353,7 @@ class LiteSpeed_Cache
339
  return ;
340
  }
341
  if ( ! $is_html ) {
 
342
  return ;
343
  }
344
 
@@ -357,7 +372,15 @@ class LiteSpeed_Cache
357
  */
358
  public function send_headers_force( $buffer )
359
  {
 
 
 
 
 
360
  $buffer .= $this->send_headers( true ) ;
 
 
 
361
  return $buffer ;
362
  }
363
 
@@ -406,7 +429,7 @@ class LiteSpeed_Cache
406
  $comment .= '<!-- ' . ( defined( 'LSCACHE_IS_ESI' ) ? 'Block' : 'Page' ) . ' generated by LiteSpeed Cache on '.date('Y-m-d H:i:s').' -->' ;
407
  }
408
  else {
409
- $comment .= '<!-- LiteSpeed Cache on '.date('Y-m-d H:i:s').' -->' ;
410
  }
411
  }
412
 
@@ -472,9 +495,9 @@ class LiteSpeed_Cache
472
  }
473
  }
474
 
475
- LiteSpeed_Cache_Log::debug(
476
- 'End response' . ( $is_forced ? '(forced)' : '' ) . ".\n--------------------------------------------------------------------------------\n"
477
- ) ;
478
 
479
  if ( $comment ) {
480
  if ( $is_forced ) {
@@ -486,23 +509,6 @@ class LiteSpeed_Cache
486
  }
487
  }
488
 
489
- /**
490
- * Get the current instance object.
491
- *
492
- * @since 1.1.0
493
- * @access public
494
- * @return Current class instance.
495
- */
496
- public static function get_instance()
497
- {
498
- $cls = get_called_class() ;
499
- if ( ! isset(self::$_instance) ) {
500
- self::$_instance = new $cls() ;
501
- }
502
-
503
- return self::$_instance ;
504
- }
505
-
506
  /**
507
  * Deprecated calls for backward compatibility to v1.1.2.2
508
  */
@@ -519,4 +525,20 @@ class LiteSpeed_Cache
519
  LiteSpeed_Cache_API::purge_all() ;
520
  }
521
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
522
  }
18
  private static $_instance ;
19
 
20
  const PLUGIN_NAME = 'litespeed-cache' ;
21
+ const PLUGIN_VERSION = '1.2.3.1' ;
22
 
23
  const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
24
 
31
  const ACTION_SAVE_SETTINGS_NETWORK = 'save-settings-network' ;
32
  const ACTION_PURGE_ERRORS = 'PURGE_ERRORS' ;
33
  const ACTION_PURGE_PAGES = 'PURGE_PAGES' ;
34
+ const ACTION_PURGE_CSSJS = 'PURGE_CSSJS' ;
35
  const ACTION_PURGE_BY = 'PURGE_BY' ;
36
  const ACTION_PURGE_FRONT = 'PURGE_FRONT' ;
37
  const ACTION_PURGE_ALL = 'PURGE_ALL' ;
48
  const ACTION_DO_CRAWL = 'do-crawl' ;
49
  const ACTION_BLACKLIST_SAVE = 'blacklist-save' ;
50
 
51
+ const ACTION_DB_OPTIMIZE = 'db_optimize' ;
52
+
53
  const WHM_TRANSIENT = 'lscwp_whm_install' ;
54
  const WHM_TRANSIENT_VAL = 'whm_install' ;
55
 
71
  // Check if debug is on
72
  if ( self::config(LiteSpeed_Cache_Config::OPID_ENABLED) ) {
73
  $should_debug = intval(self::config(LiteSpeed_Cache_Config::OPID_DEBUG)) ;
74
+ if ( $should_debug == LiteSpeed_Cache_Config::VAL_ON || ($should_debug == LiteSpeed_Cache_Config::VAL_ON2 && LiteSpeed_Cache_Router::is_admin_ip()) ) {
75
  LiteSpeed_Cache_Log::set_enabled() ;
76
  }
77
 
79
  include_once LSWCP_DIR . 'thirdparty/lscwp-registry-3rd.php' ;
80
  }
81
 
82
+ if ( ! self::config( LiteSpeed_Cache_Config::OPID_HEARTBEAT ) ) {
83
  add_action( 'init', 'LiteSpeed_Cache_Log::disable_heartbeat', 1 ) ;
84
  }
85
 
127
  add_action( 'shutdown', array( $this, 'send_headers' ), 0 ) ;
128
  add_action( 'wp_footer', 'LiteSpeed_Cache::litespeed_comment_info' ) ;
129
 
130
+ // Check minify file request in the very beginning
131
+ LiteSpeed_Cache_Optimize::get_instance() ;
132
+
133
  // 1. Init vary
134
  // 2. Init cacheable status
135
  LiteSpeed_Cache_Vary::get_instance() ;
136
 
137
+ // Hook cdn for attachements
138
+ LiteSpeed_Cache_CDN::get_instance() ;
139
+
140
  // Load public hooks
141
  $this->load_public_actions() ;
142
 
215
  $msg = __( 'Notified LiteSpeed Web Server to purge pages.', 'litespeed-cache' ) ;
216
  break ;
217
 
218
+ case LiteSpeed_Cache::ACTION_PURGE_CSSJS:
219
+ LiteSpeed_Cache_Purge::purge_cssjs() ;
220
+ $msg = __( 'Notified LiteSpeed Web Server to purge CSS/JS entries.', 'litespeed-cache' ) ;
221
+ break ;
222
+
223
  case LiteSpeed_Cache::ACTION_PURGE_ERRORS:
224
  LiteSpeed_Cache_Purge::purge_errors() ;
225
  $msg = __( 'Notified LiteSpeed Web Server to purge error pages.', 'litespeed-cache' ) ;
251
  update_option( LiteSpeed_Cache_Admin_Display::DISMISS_MSG, LiteSpeed_Cache_Admin_Display::RULECONFLICT_DISMISSED ) ;
252
  break ;
253
 
254
+ case LiteSpeed_Cache::ACTION_DB_OPTIMIZE:
255
+ $msg = LiteSpeed_Cache_Admin_Optimize::run_db_clean() ;
256
+ break ;
257
+
258
  default:
259
  break ;
260
  }
303
 
304
  // The ESI functionality is an enterprise feature.
305
  // Removing the openlitespeed check will simply break the page.
306
+ if ( ! LiteSpeed_Cache_Router::is_ajax() && LiteSpeed_Cache_Router::esi_enabled() ) {
307
+ LiteSpeed_Cache_ESI::get_instance() ;
 
 
 
 
 
308
  }
309
+
310
  add_action( 'wp_update_comment_count', 'LiteSpeed_Cache_Purge::purge_feeds' ) ;
311
 
312
  // register recent posts widget tag before theme renders it to make it work
353
  return ;
354
  }
355
  if ( ! $is_html ) {
356
+ LiteSpeed_Cache_Log::debug( 'Footer check failed: ' . ob_get_level() . '-' . substr( $buffer, 0, 100 ) ) ;
357
  return ;
358
  }
359
 
372
  */
373
  public function send_headers_force( $buffer )
374
  {
375
+ if ( ! defined( 'LITESPEED_MIN_FILE' ) ) {// Must have this to avoid css/js from optimization again
376
+ $buffer = LiteSpeed_Cache_Optimize::run( $buffer ) ;
377
+ }
378
+ $buffer = LiteSpeed_Cache_CDN::run( $buffer ) ;
379
+
380
  $buffer .= $this->send_headers( true ) ;
381
+
382
+ LiteSpeed_Cache_Log::debug( "End response\n--------------------------------------------------------------------------------\n" ) ;
383
+
384
  return $buffer ;
385
  }
386
 
429
  $comment .= '<!-- ' . ( defined( 'LSCACHE_IS_ESI' ) ? 'Block' : 'Page' ) . ' generated by LiteSpeed Cache on '.date('Y-m-d H:i:s').' -->' ;
430
  }
431
  else {
432
+ $comment .= '<!-- Page uncached by LiteSpeed Cache on '.date('Y-m-d H:i:s').' -->' ;
433
  }
434
  }
435
 
495
  }
496
  }
497
 
498
+ if ( $is_forced ) {
499
+ LiteSpeed_Cache_Log::debug( '--forced--' ) ;
500
+ }
501
 
502
  if ( $comment ) {
503
  if ( $is_forced ) {
509
  }
510
  }
511
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
512
  /**
513
  * Deprecated calls for backward compatibility to v1.1.2.2
514
  */
525
  LiteSpeed_Cache_API::purge_all() ;
526
  }
527
 
528
+ /**
529
+ * Get the current instance object.
530
+ *
531
+ * @since 1.1.0
532
+ * @access public
533
+ * @return Current class instance.
534
+ */
535
+ public static function get_instance()
536
+ {
537
+ if ( ! isset(self::$_instance) ) {
538
+ self::$_instance = new self() ;
539
+ }
540
+
541
+ return self::$_instance ;
542
+ }
543
+
544
  }
includes/litespeed.autoload.php CHANGED
@@ -23,12 +23,14 @@ if ( !function_exists('_litespeed_autoload') ) {
23
  'LiteSpeed_Cache' => 'includes/litespeed-cache.class.php',
24
  'LiteSpeed_Cache_Activation' => 'includes/litespeed-cache-activation.class.php',
25
  'LiteSpeed_Cache_API' => 'includes/litespeed-cache-api.class.php',
 
26
  'LiteSpeed_Cache_Config' => 'includes/litespeed-cache-config.class.php',
27
  'LiteSpeed_Cache_Control' => 'includes/litespeed-cache-control.class.php',
28
  'LiteSpeed_Cache_Crawler' => 'includes/litespeed-cache-crawler.class.php',
29
  'LiteSpeed_Cache_Crawler_Sitemap' => 'includes/litespeed-cache-crawler-sitemap.class.php',
30
  'LiteSpeed_Cache_ESI' => 'includes/litespeed-cache-esi.class.php',
31
  'LiteSpeed_Cache_Log' => 'includes/litespeed-cache-log.class.php',
 
32
  'LiteSpeed_Cache_Purge' => 'includes/litespeed-cache-purge.class.php',
33
  'LiteSpeed_Cache_Router' => 'includes/litespeed-cache-router.class.php',
34
  'LiteSpeed_Cache_Tag' => 'includes/litespeed-cache-tag.class.php',
@@ -39,6 +41,7 @@ if ( !function_exists('_litespeed_autoload') ) {
39
  'LiteSpeed_Cache_Admin' => 'admin/litespeed-cache-admin.class.php',
40
  'LiteSpeed_Cache_Admin_Display' => 'admin/litespeed-cache-admin-display.class.php',
41
  'LiteSpeed_Cache_Admin_Error' => 'admin/litespeed-cache-admin-error.class.php',
 
42
  'LiteSpeed_Cache_Admin_Report' => 'admin/litespeed-cache-admin-report.class.php',
43
  'LiteSpeed_Cache_Admin_Rules' => 'admin/litespeed-cache-admin-rules.class.php',
44
  'LiteSpeed_Cache_Admin_Settings' => 'admin/litespeed-cache-admin-settings.class.php',
@@ -55,3 +58,15 @@ if ( !function_exists('_litespeed_autoload') ) {
55
  }
56
 
57
  spl_autoload_register('_litespeed_autoload');
 
 
 
 
 
 
 
 
 
 
 
 
23
  'LiteSpeed_Cache' => 'includes/litespeed-cache.class.php',
24
  'LiteSpeed_Cache_Activation' => 'includes/litespeed-cache-activation.class.php',
25
  'LiteSpeed_Cache_API' => 'includes/litespeed-cache-api.class.php',
26
+ 'LiteSpeed_Cache_CDN' => 'includes/litespeed-cache-cdn.class.php',
27
  'LiteSpeed_Cache_Config' => 'includes/litespeed-cache-config.class.php',
28
  'LiteSpeed_Cache_Control' => 'includes/litespeed-cache-control.class.php',
29
  'LiteSpeed_Cache_Crawler' => 'includes/litespeed-cache-crawler.class.php',
30
  'LiteSpeed_Cache_Crawler_Sitemap' => 'includes/litespeed-cache-crawler-sitemap.class.php',
31
  'LiteSpeed_Cache_ESI' => 'includes/litespeed-cache-esi.class.php',
32
  'LiteSpeed_Cache_Log' => 'includes/litespeed-cache-log.class.php',
33
+ 'LiteSpeed_Cache_Optimize' => 'includes/litespeed-cache-optimize.class.php',
34
  'LiteSpeed_Cache_Purge' => 'includes/litespeed-cache-purge.class.php',
35
  'LiteSpeed_Cache_Router' => 'includes/litespeed-cache-router.class.php',
36
  'LiteSpeed_Cache_Tag' => 'includes/litespeed-cache-tag.class.php',
41
  'LiteSpeed_Cache_Admin' => 'admin/litespeed-cache-admin.class.php',
42
  'LiteSpeed_Cache_Admin_Display' => 'admin/litespeed-cache-admin-display.class.php',
43
  'LiteSpeed_Cache_Admin_Error' => 'admin/litespeed-cache-admin-error.class.php',
44
+ 'LiteSpeed_Cache_Admin_Optimize' => 'admin/litespeed-cache-admin-optimize.class.php',
45
  'LiteSpeed_Cache_Admin_Report' => 'admin/litespeed-cache-admin-report.class.php',
46
  'LiteSpeed_Cache_Admin_Rules' => 'admin/litespeed-cache-admin-rules.class.php',
47
  'LiteSpeed_Cache_Admin_Settings' => 'admin/litespeed-cache-admin-settings.class.php',
58
  }
59
 
60
  spl_autoload_register('_litespeed_autoload');
61
+
62
+ /**
63
+ * Load vendor loader
64
+ *
65
+ * @since 1.2.2
66
+ */
67
+ if ( !function_exists('litespeed_load_vendor') ) {
68
+ function litespeed_load_vendor()
69
+ {
70
+ require_once LSWCP_DIR.'lib/vendor/autoload.php';
71
+ }
72
+ }
languages/litespeed-cache.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the LiteSpeed Cache package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: LiteSpeed Cache 1.1.6\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
- "POT-Creation-Date: 2017-08-23 21:39:09+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -12,58 +12,56 @@ msgstr ""
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
- #: admin/litespeed-cache-admin-display.class.php:137
16
  msgid "Manage"
17
  msgstr ""
18
 
19
- #: admin/litespeed-cache-admin-display.class.php:139
20
- #: admin/litespeed-cache-admin-display.class.php:222
21
  msgid "Settings"
22
  msgstr ""
23
 
24
- #: admin/litespeed-cache-admin-display.class.php:142
25
  msgid "Edit .htaccess"
26
  msgstr ""
27
 
28
- #: admin/litespeed-cache-admin-display.class.php:145
29
  msgid "Information"
30
  msgstr ""
31
 
32
- #: admin/litespeed-cache-admin-display.class.php:147
33
  msgid "Environment Report"
34
  msgstr ""
35
 
36
- #: admin/litespeed-cache-admin-display.class.php:151 admin/tpl/info.php:10
37
  #: admin/tpl/settings.php:27
38
  msgid "Crawler"
39
  msgstr ""
40
 
41
- #: admin/litespeed-cache-admin-display.class.php:155
42
  #: admin/tpl/settings_debug.php:10
43
  msgid "Debug Log"
44
  msgstr ""
45
 
46
- #: admin/litespeed-cache-admin-display.class.php:242
47
  msgid ""
48
  "It is recommended that LiteSpeed Cache be purged after updating a plugin."
49
  msgstr ""
50
 
51
- #: admin/litespeed-cache-admin-display.class.php:282
52
  msgid "LiteSpeed Cache Purge All"
53
  msgstr ""
54
 
55
- #: admin/litespeed-cache-admin-display.class.php:812 admin/tpl/crawler.php:138
56
- #: admin/tpl/settings_general.php:25
57
- msgid "Enable"
58
  msgstr ""
59
 
60
- #: admin/litespeed-cache-admin-display.class.php:816 admin/tpl/crawler.php:138
61
- #: admin/tpl/settings_general.php:31
62
- msgid "Disable"
63
  msgstr ""
64
 
65
- #: admin/litespeed-cache-admin-display.class.php:843
66
- msgid "Recommended value: %s."
67
  msgstr ""
68
 
69
  #: admin/litespeed-cache-admin-error.class.php:87
@@ -275,20 +273,60 @@ msgid "Failed to overwrite %s."
275
  msgstr ""
276
 
277
  #: admin/litespeed-cache-admin-error.class.php:232
278
- msgid "The %1$s file not writeable for %2$s"
279
  msgstr ""
280
 
281
  #: admin/litespeed-cache-admin-error.class.php:236
282
  msgid "%s file did not find a place to insert define."
283
  msgstr ""
284
 
285
- #: admin/litespeed-cache-admin-rules.class.php:728
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  msgid ""
287
  "<p>Please add/replace the following codes into the beginning of %1$s:</p> "
288
  "%2$s"
289
  msgstr ""
290
 
291
- #: admin/litespeed-cache-admin-rules.class.php:863
292
  msgid "File Saved."
293
  msgstr ""
294
 
@@ -297,58 +335,62 @@ msgid "Default Public Cache"
297
  msgstr ""
298
 
299
  #: admin/litespeed-cache-admin-settings.class.php:176
300
- msgid "Default Front Page"
301
  msgstr ""
302
 
303
  #: admin/litespeed-cache-admin-settings.class.php:184
 
 
 
 
304
  msgid "Feed"
305
  msgstr ""
306
 
307
- #: admin/litespeed-cache-admin-settings.class.php:195
308
  msgid "404"
309
  msgstr ""
310
 
311
- #: admin/litespeed-cache-admin-settings.class.php:206
312
  msgid "403"
313
  msgstr ""
314
 
315
- #: admin/litespeed-cache-admin-settings.class.php:217
316
  msgid "500"
317
  msgstr ""
318
 
319
- #: admin/litespeed-cache-admin-settings.class.php:490
320
- #: admin/tpl/settings_debug.php:79
321
  msgid "Log File Size Limit"
322
  msgstr ""
323
 
324
- #: admin/litespeed-cache-admin-settings.class.php:570
325
  #: admin/tpl/settings_crawler.php:10
326
  msgid "Delay"
327
  msgstr ""
328
 
329
- #: admin/litespeed-cache-admin-settings.class.php:578
330
  #: admin/tpl/settings_crawler.php:22
331
  msgid "Run Duration"
332
  msgstr ""
333
 
334
- #: admin/litespeed-cache-admin-settings.class.php:586
335
  msgid "Cron Interval"
336
  msgstr ""
337
 
338
- #: admin/litespeed-cache-admin-settings.class.php:594
339
  msgid "Whole Interval"
340
  msgstr ""
341
 
342
- #: admin/litespeed-cache-admin-settings.class.php:602
343
  #: admin/tpl/settings_crawler.php:58
344
  msgid "Threads"
345
  msgstr ""
346
 
347
- #: admin/litespeed-cache-admin-settings.class.php:703
348
  msgid "'Use primary site settings' set by Network Administrator."
349
  msgstr ""
350
 
351
- #: admin/litespeed-cache-admin-settings.class.php:833
352
  msgid "File saved."
353
  msgstr ""
354
 
@@ -429,7 +471,7 @@ msgstr ""
429
  msgid "Crawler Cron"
430
  msgstr ""
431
 
432
- #: admin/tpl/crawler.php:63
433
  msgid "WARNING"
434
  msgstr ""
435
 
@@ -480,71 +522,80 @@ msgstr ""
480
  msgid "Is running"
481
  msgstr ""
482
 
483
- #: admin/tpl/crawler.php:144
 
 
 
 
 
 
 
 
 
484
  msgid "Reset position"
485
  msgstr ""
486
 
487
- #: admin/tpl/crawler.php:147
488
  msgid "Manually run"
489
  msgstr ""
490
 
491
- #: admin/tpl/crawler.php:151
492
  msgid "<b>Last interval:</b> %s"
493
  msgstr ""
494
 
495
- #: admin/tpl/crawler.php:157
496
  msgid "<b>Ended reason:</b> %s"
497
  msgstr ""
498
 
499
- #: admin/tpl/crawler.php:163
500
  msgid "<b>Last crawled:</b> %s item(s)"
501
  msgstr ""
502
 
503
- #: admin/tpl/crawler.php:171
504
  msgid "Run frequency is set by the Interval Between Runs setting."
505
  msgstr ""
506
 
507
- #: admin/tpl/crawler.php:172
508
  msgid "Only one crawler can run concurrently."
509
  msgstr ""
510
 
511
- #: admin/tpl/crawler.php:173
512
  msgid ""
513
  "If both the cron and manual run start at a similar time, the first one to "
514
  "start will run."
515
  msgstr ""
516
 
517
- #: admin/tpl/crawler.php:174
518
  msgid ""
519
  "Please follow <a %s>Hooking WP-Cron Into the System Task Scheduler</a> to "
520
  "create the system cron task."
521
  msgstr ""
522
 
523
- #: admin/tpl/crawler.php:179
524
  msgid "Watch Crawler Status"
525
  msgstr ""
526
 
527
- #: admin/tpl/crawler.php:186
528
  msgid "Show crawler status"
529
  msgstr ""
530
 
531
- #: admin/tpl/crawler.php:204
532
  msgid "No crawler meta file generated yet"
533
  msgstr ""
534
 
535
- #: admin/tpl/crawler.php:209
536
  msgid "Sitemap Generation Blacklist"
537
  msgstr ""
538
 
539
- #: admin/tpl/crawler.php:218 admin/tpl/edit_htaccess.php:66
540
  msgid "Save"
541
  msgstr ""
542
 
543
- #: admin/tpl/crawler.php:222
544
  msgid "Current blacklist has %s item(s)."
545
  msgstr ""
546
 
547
- #: admin/tpl/crawler.php:223
548
  msgid ""
549
  "All Urls which returned no-cache tags will be added here, after the initial "
550
  "crawling."
@@ -562,53 +613,62 @@ msgstr ""
562
  msgid "WARNING: This page is meant for advanced users."
563
  msgstr ""
564
 
565
- #: admin/tpl/edit_htaccess.php:41
566
  msgid "Any changes made to the .htaccess file may break the site."
567
  msgstr ""
568
 
569
- #: admin/tpl/edit_htaccess.php:42
570
  msgid "Please consult the host/server admin before making any changes."
571
  msgstr ""
572
 
573
- #: admin/tpl/edit_htaccess.php:46
574
  msgid "File editing is disabled in configuration."
575
  msgstr ""
576
 
577
- #: admin/tpl/edit_htaccess.php:56
578
- msgid "Current %s contents:"
579
  msgstr ""
580
 
581
- #: admin/tpl/edit_htaccess.php:58
582
  msgid "DO NOT EDIT ANYTHING WITHIN %s"
583
  msgstr ""
584
 
585
- #: admin/tpl/edit_htaccess.php:60
586
  msgid ""
587
  "These are added by the LS Cache plugin and may cause problems if they are "
588
  "changed."
589
  msgstr ""
590
 
591
- #: admin/tpl/esi_widget_edit.php:28 admin/tpl/settings_esi.php:17
592
  msgid "Enable ESI"
593
  msgstr ""
594
 
595
- #: admin/tpl/esi_widget_edit.php:35
 
 
 
 
 
 
 
 
596
  msgid "Widget Cache TTL:"
597
  msgstr ""
598
 
599
- #: admin/tpl/esi_widget_edit.php:38 admin/tpl/settings_crawler.php:25
600
  #: admin/tpl/settings_crawler.php:37 admin/tpl/settings_crawler.php:49
601
- #: admin/tpl/settings_general.php:61 admin/tpl/settings_general.php:73
602
- #: admin/tpl/settings_general.php:85 admin/tpl/settings_general.php:98
603
- #: admin/tpl/settings_general.php:111 admin/tpl/settings_general.php:124
 
604
  msgid "seconds"
605
  msgstr ""
606
 
607
- #: admin/tpl/esi_widget_edit.php:41
608
  msgid "Recommended value: 28800 seconds (8 hours)."
609
  msgstr ""
610
 
611
- #: admin/tpl/esi_widget_edit.php:42
612
  msgid "A TTL of 0 indicates do not cache."
613
  msgstr ""
614
 
@@ -736,6 +796,7 @@ msgstr ""
736
 
737
  #: admin/tpl/info_common_rewrite.php:14 admin/tpl/settings_advanced.php:6
738
  #: admin/tpl/settings_inc.cache_mobile.php:64
 
739
  msgid "NOTICE:"
740
  msgstr ""
741
 
@@ -1240,165 +1301,248 @@ msgstr ""
1240
  msgid "Purge the cache to use the updated pages."
1241
  msgstr ""
1242
 
1243
- #: admin/tpl/manage.php:10
 
 
 
 
 
 
 
 
 
 
 
 
 
1244
  msgid "LiteSpeed Cache Management"
1245
  msgstr ""
1246
 
1247
- #: admin/tpl/manage.php:18
1248
  msgid ""
1249
- "From this screen, one can inform the server to purge the selected cached "
1250
- "pages or empty the entire cache."
1251
  msgstr ""
1252
 
1253
- #: admin/tpl/manage.php:23
1254
- msgid "Purge the Front Page."
1255
  msgstr ""
1256
 
1257
- #: admin/tpl/manage.php:26
1258
- msgid "Purge Front Page"
1259
  msgstr ""
1260
 
1261
- #: admin/tpl/manage.php:29
1262
- msgid "This will Purge Front Page only"
1263
  msgstr ""
1264
 
1265
- #: admin/tpl/manage.php:35
1266
- msgid "Purge Pages."
1267
  msgstr ""
1268
 
1269
- #: admin/tpl/manage.php:38
1270
- msgid "Purge Pages"
1271
  msgstr ""
1272
 
1273
- #: admin/tpl/manage.php:41
1274
- msgid "This will Purge Pages only"
1275
  msgstr ""
1276
 
1277
- #: admin/tpl/manage.php:47
1278
- msgid "Purge the error pages."
1279
  msgstr ""
1280
 
1281
- #: admin/tpl/manage.php:53
1282
- msgid "Include 403"
1283
  msgstr ""
1284
 
1285
- #: admin/tpl/manage.php:54
1286
- msgid "Include 404"
1287
  msgstr ""
1288
 
1289
- #: admin/tpl/manage.php:55
1290
- msgid "Include 500s"
1291
  msgstr ""
1292
 
1293
- #: admin/tpl/manage.php:60
1294
- msgid "Purge Error Pages"
1295
  msgstr ""
1296
 
1297
- #: admin/tpl/manage.php:65
1298
- msgid "Purges the error page cache entries created by this plugin."
1299
  msgstr ""
1300
 
1301
- #: admin/tpl/manage.php:72
1302
- msgid "Purge all WordPress pages."
1303
  msgstr ""
1304
 
1305
- #: admin/tpl/manage.php:76
1306
- msgid "This will purge everything for all blogs."
1307
  msgstr ""
1308
 
1309
- #: admin/tpl/manage.php:76 admin/tpl/manage.php:78
1310
- msgid "Are you sure you want to purge all?"
1311
  msgstr ""
1312
 
1313
- #: admin/tpl/manage.php:81
1314
- msgid "Purge All"
1315
  msgstr ""
1316
 
1317
- #: admin/tpl/manage.php:84
1318
- msgid "Purge the cache entries created by this plugin."
1319
  msgstr ""
1320
 
1321
- #: admin/tpl/manage.php:91
1322
- msgid "Clear all cache entries."
1323
  msgstr ""
1324
 
1325
- #: admin/tpl/manage.php:94
1326
- msgid "This will clear EVERYTHING inside the cache."
1327
  msgstr ""
1328
 
1329
- #: admin/tpl/manage.php:95
1330
- msgid "This may cause heavy load on the server."
1331
  msgstr ""
1332
 
1333
- #: admin/tpl/manage.php:96
1334
- msgid "If only the WordPress site should be purged, use purge all."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1335
  msgstr ""
1336
 
1337
- #: admin/tpl/manage.php:98
 
 
 
 
1338
  msgid "Empty Entire Cache"
1339
  msgstr ""
1340
 
1341
- #: admin/tpl/manage.php:101
1342
  msgid ""
1343
  "Clears all cache entries related to this site, <i>including other web "
1344
  "applications</i>."
1345
  msgstr ""
1346
 
1347
- #: admin/tpl/manage.php:102
1348
- msgid ""
1349
- "<b>This action should only be used if things are cached incorrectly.</b>"
 
 
 
 
 
 
 
1350
  msgstr ""
1351
 
1352
- #: admin/tpl/manage.php:111
 
 
 
 
1353
  msgid "Purge By..."
1354
  msgstr ""
1355
 
1356
- #: admin/tpl/manage.php:114
1357
  msgid "Select below for \"Purge by\" options."
1358
  msgstr ""
1359
 
1360
- #: admin/tpl/manage.php:115
1361
  msgid "Please enter one per line."
1362
  msgstr ""
1363
 
1364
- #: admin/tpl/manage.php:142
1365
  msgid "Category"
1366
  msgstr ""
1367
 
1368
- #: admin/tpl/manage.php:148
1369
  msgid "Post ID"
1370
  msgstr ""
1371
 
1372
- #: admin/tpl/manage.php:154
1373
  msgid "Tag"
1374
  msgstr ""
1375
 
1376
- #: admin/tpl/manage.php:160
1377
  msgid "URL"
1378
  msgstr ""
1379
 
1380
- #: admin/tpl/manage.php:166
1381
  msgid ""
1382
  "Purge pages by category name - e.g. %2$s should be used for the URL %1$s."
1383
  msgstr ""
1384
 
1385
- #: admin/tpl/manage.php:171
1386
  msgid "Purge pages by post ID."
1387
  msgstr ""
1388
 
1389
- #: admin/tpl/manage.php:175
1390
  msgid "Purge pages by tag name - e.g. %2$s should be used for the URL %1$s."
1391
  msgstr ""
1392
 
1393
- #: admin/tpl/manage.php:180
1394
  msgid "Purge pages by relative or full URL."
1395
  msgstr ""
1396
 
1397
- #: admin/tpl/manage.php:181
1398
  msgid "e.g. Use %s or %s."
1399
  msgstr ""
1400
 
1401
- #: admin/tpl/manage.php:194
1402
  msgid "Purge List"
1403
  msgstr ""
1404
 
@@ -1411,16 +1555,12 @@ msgstr ""
1411
  msgid "Cache"
1412
  msgstr ""
1413
 
1414
- #: admin/tpl/network_settings.php:7 admin/tpl/settings.php:9
1415
- msgid "Purge"
1416
- msgstr ""
1417
-
1418
  #: admin/tpl/network_settings.php:8 admin/tpl/settings.php:10
1419
  msgid "Excludes"
1420
  msgstr ""
1421
 
1422
  #: admin/tpl/network_settings.php:9 admin/tpl/settings.php:18
1423
- #: admin/tpl/settings_debug.php:68
1424
  msgid "Advanced"
1425
  msgstr ""
1426
 
@@ -1492,51 +1632,59 @@ msgstr ""
1492
  msgid "Purge Network Settings"
1493
  msgstr ""
1494
 
1495
- #: admin/tpl/report.php:9
1496
  msgid "LiteSpeed Cache Report"
1497
  msgstr ""
1498
 
1499
- #: admin/tpl/report.php:18
1500
  msgid ""
1501
  "The environment report contains detailed information about the WordPress "
1502
  "configuration."
1503
  msgstr ""
1504
 
1505
- #: admin/tpl/report.php:19
1506
  msgid ""
1507
  "If you run into any issues, please include the contents of this text area in "
1508
  "your support message."
1509
  msgstr ""
1510
 
1511
- #: admin/tpl/report.php:20
1512
  msgid ""
1513
  "To easily grab the content, click the <b>Select All and Copy to Clipboard</"
1514
  "b> button, to select and copy to clipboard."
1515
  msgstr ""
1516
 
1517
- #: admin/tpl/report.php:22
1518
  msgid "Alternatively, this information is also saved in %s."
1519
  msgstr ""
1520
 
1521
- #: admin/tpl/report.php:27
1522
  msgid "The text area below contains the following content:"
1523
  msgstr ""
1524
 
1525
- #: admin/tpl/report.php:31
1526
  msgid ""
1527
  "Server Variables, Plugin Options, WordPress information (version, locale, "
1528
  "active plugins, etc.), and .htaccess file content."
1529
  msgstr ""
1530
 
1531
- #: admin/tpl/report.php:36
1532
  msgid "Select All and Copy to Clipboard"
1533
  msgstr ""
1534
 
1535
- #: admin/tpl/report.php:39
1536
  msgid "Environment Report copied to Clipboard!"
1537
  msgstr ""
1538
 
1539
- #: admin/tpl/settings.php:14
 
 
 
 
 
 
 
 
1540
  msgid "ESI"
1541
  msgstr ""
1542
 
@@ -1560,17 +1708,17 @@ msgstr ""
1560
  msgid "LiteSpeed Cache Settings"
1561
  msgstr ""
1562
 
1563
- #: admin/tpl/settings.php:110
1564
  msgid "The network admin selected use primary site configs for all subsites."
1565
  msgstr ""
1566
 
1567
- #: admin/tpl/settings.php:111
1568
  msgid ""
1569
  "The following options are selected, but are not editable in this settings "
1570
  "page."
1571
  msgstr ""
1572
 
1573
- #: admin/tpl/settings.php:132 admin/tpl/settings.php:135
1574
  msgid "Save Changes"
1575
  msgstr ""
1576
 
@@ -1628,59 +1776,59 @@ msgstr ""
1628
  msgid "MUST BE UNIQUE FROM OTHER WEB APPLICATIONS."
1629
  msgstr ""
1630
 
1631
- #: admin/tpl/settings_advanced.php:34
1632
  msgid "The default login cookie is %s."
1633
  msgstr ""
1634
 
1635
- #: admin/tpl/settings_advanced.php:35
1636
  msgid ""
1637
  "The server will determine if the user is logged in based on the existance of "
1638
  "this cookie."
1639
  msgstr ""
1640
 
1641
- #: admin/tpl/settings_advanced.php:36
1642
  msgid ""
1643
  "This setting is useful for those that have multiple web applications for the "
1644
  "same domain."
1645
  msgstr ""
1646
 
1647
- #: admin/tpl/settings_advanced.php:37
1648
  msgid ""
1649
  "If every web application uses the same cookie, the server may confuse "
1650
  "whether a user is logged in or not."
1651
  msgstr ""
1652
 
1653
- #: admin/tpl/settings_advanced.php:38
1654
  msgid "The cookie set here will be used for this WordPress installation."
1655
  msgstr ""
1656
 
1657
- #: admin/tpl/settings_advanced.php:41
1658
  msgid "Example use case:"
1659
  msgstr ""
1660
 
1661
- #: admin/tpl/settings_advanced.php:43
1662
  msgid "There is a WordPress installed for %s."
1663
  msgstr ""
1664
 
1665
- #: admin/tpl/settings_advanced.php:45
1666
  msgid "Then another WordPress is installed (NOT MULTISITE) at %s"
1667
  msgstr ""
1668
 
1669
- #: admin/tpl/settings_advanced.php:46
1670
  msgid ""
1671
  "The cache needs to distinguish who is logged into which WordPress site in "
1672
  "order to cache correctly."
1673
  msgstr ""
1674
 
1675
- #: admin/tpl/settings_advanced.php:52
1676
  msgid "Error: invalid login cookie. Please check the %s file"
1677
  msgstr ""
1678
 
1679
- #: admin/tpl/settings_advanced.php:61
1680
  msgid "Error getting current rules from %s: %s"
1681
  msgstr ""
1682
 
1683
- #: admin/tpl/settings_advanced.php:69
1684
  msgid ""
1685
  "WARNING: The .htaccess login cookie and Database login cookie do not match."
1686
  msgstr ""
@@ -1723,6 +1871,85 @@ msgstr ""
1723
  msgid "Disabling this option may negatively affect performance."
1724
  msgstr ""
1725
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1726
  #: admin/tpl/settings_compatibilities.php:7
1727
  msgid "Compatibility with WP-PostViews"
1728
  msgstr ""
@@ -1876,23 +2103,23 @@ msgstr ""
1876
  msgid "Available Custom Post Type"
1877
  msgstr ""
1878
 
1879
- #: admin/tpl/settings_crawler.php:161
1880
  msgid "Order links by"
1881
  msgstr ""
1882
 
1883
- #: admin/tpl/settings_crawler.php:168
1884
  msgid "Date, descending (Default)"
1885
  msgstr ""
1886
 
1887
- #: admin/tpl/settings_crawler.php:174
1888
  msgid "Date, ascending"
1889
  msgstr ""
1890
 
1891
- #: admin/tpl/settings_crawler.php:180
1892
  msgid "Alphabetical, descending"
1893
  msgstr ""
1894
 
1895
- #: admin/tpl/settings_crawler.php:186
1896
  msgid "Alphabetical, ascending"
1897
  msgstr ""
1898
 
@@ -1906,168 +2133,189 @@ msgstr ""
1906
  msgid "Developer Testing"
1907
  msgstr ""
1908
 
1909
- #: admin/tpl/settings_debug.php:17
1910
  msgid "Off"
1911
  msgstr ""
1912
 
1913
- #: admin/tpl/settings_debug.php:23
1914
  msgid "On"
1915
  msgstr ""
1916
 
1917
- #: admin/tpl/settings_debug.php:29
1918
  msgid "Admin IP only"
1919
  msgstr ""
1920
 
1921
- #: admin/tpl/settings_debug.php:34
1922
  msgid "Outputs to WordPress debug log."
1923
  msgstr ""
1924
 
1925
- #: admin/tpl/settings_debug.php:35
1926
  msgid ""
1927
  "This should be set to off once everything is working to prevent filling the "
1928
  "disk."
1929
  msgstr ""
1930
 
1931
- #: admin/tpl/settings_debug.php:36
1932
  msgid ""
1933
  "The Admin IP option will only output log messages on requests from admin IPs."
1934
  msgstr ""
1935
 
1936
- #: admin/tpl/settings_debug.php:37
1937
  msgid ""
1938
  "The logs will be outputted to the debug.log in the wp-content directory."
1939
  msgstr ""
1940
 
1941
- #: admin/tpl/settings_debug.php:43
1942
  msgid "Admin IPs"
1943
  msgstr ""
1944
 
1945
- #: admin/tpl/settings_debug.php:47
1946
  msgid ""
1947
  "Allows listed IPs (one per line) to perform certain actions from their "
1948
  "browsers."
1949
  msgstr ""
1950
 
1951
- #: admin/tpl/settings_debug.php:48
1952
  msgid ""
1953
  "More information about the available commands can be found <a href=\"%s"
1954
  "\">here</a>."
1955
  msgstr ""
1956
 
1957
- #: admin/tpl/settings_debug.php:55
1958
  msgid "Debug Level"
1959
  msgstr ""
1960
 
1961
- #: admin/tpl/settings_debug.php:62
1962
  msgid "Basic"
1963
  msgstr ""
1964
 
1965
- #: admin/tpl/settings_debug.php:73
1966
  msgid "Advanced level will log more details."
1967
  msgstr ""
1968
 
1969
- #: admin/tpl/settings_debug.php:82
1970
  msgid "MB"
1971
  msgstr ""
1972
 
1973
- #: admin/tpl/settings_debug.php:84
1974
  msgid ""
1975
  "Specify the maximum size of the log file. Minimum is 3MB. Maximum is 3000MB."
1976
  msgstr ""
1977
 
1978
- #: admin/tpl/settings_debug.php:91
1979
  msgid "Heartbeat"
1980
  msgstr ""
1981
 
1982
- #: admin/tpl/settings_debug.php:95
1983
  msgid ""
1984
  "Disable WordPress heartbeat to prevent AJAX calls from breaking debug "
1985
  "logging. WARNING: Disabling this may cause WordPress tasks triggered by AJAX "
1986
  "to stop working."
1987
  msgstr ""
1988
 
1989
- #: admin/tpl/settings_debug.php:101
1990
  msgid "Log Cookies"
1991
  msgstr ""
1992
 
1993
- #: admin/tpl/settings_debug.php:105
1994
  msgid "Log request cookie values."
1995
  msgstr ""
1996
 
1997
- #: admin/tpl/settings_debug.php:111
1998
  msgid "Collapse Query Strings"
1999
  msgstr ""
2000
 
2001
- #: admin/tpl/settings_debug.php:115
2002
  msgid "Shorten query strings in the debug log to improve readability."
2003
  msgstr ""
2004
 
2005
- #: admin/tpl/settings_debug.php:121
2006
  msgid "Log Filters"
2007
  msgstr ""
2008
 
2009
- #: admin/tpl/settings_debug.php:125
2010
  msgid ""
2011
  "Log all WordPress filter hooks. WARNING: Enabling this option will cause log "
2012
  "file size to grow quickly."
2013
  msgstr ""
2014
 
2015
- #: admin/tpl/settings_debug.php:131
2016
  msgid "Exclude Filters"
2017
  msgstr ""
2018
 
2019
- #: admin/tpl/settings_debug.php:135
2020
  msgid "Listed filters (one per line) will not be logged."
2021
  msgstr ""
2022
 
2023
- #: admin/tpl/settings_debug.php:141
2024
  msgid "Exclude Part Filters"
2025
  msgstr ""
2026
 
2027
- #: admin/tpl/settings_debug.php:145
2028
  msgid "Filters containing these strings (one per line) will not be logged."
2029
  msgstr ""
2030
 
2031
- #: admin/tpl/settings_esi.php:9
2032
  msgid "ESI Settings"
2033
  msgstr ""
2034
 
2035
- #: admin/tpl/settings_esi.php:11
2036
  msgid ""
2037
- "ESI enables the capability to cache pages for logged in users/commenters."
 
2038
  msgstr ""
2039
 
2040
- #: admin/tpl/settings_esi.php:12
2041
  msgid ""
2042
- "ESI functions by replacing the private information blocks with an ESI "
2043
- "include."
 
 
 
2044
  msgstr ""
2045
 
2046
- #: admin/tpl/settings_esi.php:13
2047
- msgid ""
2048
- "When the server sees an ESI include, a sub request is created, containing "
2049
- "the private information."
2050
  msgstr ""
2051
 
2052
- #: admin/tpl/settings_esi.php:21
2053
- msgid "Enabling ESI will cache the public page for logged in users."
2054
  msgstr ""
2055
 
2056
- #: admin/tpl/settings_esi.php:22
2057
  msgid ""
2058
- "The Admin Bar, comments, and comment form will be served via ESI blocks."
 
 
2059
  msgstr ""
2060
 
2061
- #: admin/tpl/settings_esi.php:23
2062
- msgid "The ESI blocks will not be cached until Cache ESI is checked."
2063
  msgstr ""
2064
 
2065
- #: admin/tpl/settings_esi.php:29
2066
- msgid "Cache ESI"
 
 
 
 
 
 
 
 
2067
  msgstr ""
2068
 
2069
- #: admin/tpl/settings_esi.php:33
2070
- msgid "Cache the ESI blocks."
 
 
 
 
 
 
 
 
 
2071
  msgstr ""
2072
 
2073
  #: admin/tpl/settings_excludes.php:7
@@ -2163,91 +2411,101 @@ msgstr ""
2163
  msgid "Enable LiteSpeed Cache"
2164
  msgstr ""
2165
 
2166
- #: admin/tpl/settings_general.php:39
2167
  msgid "Use Network Admin Setting"
2168
  msgstr ""
2169
 
2170
- #: admin/tpl/settings_general.php:46
2171
  msgid "Please visit the <a %s>Information</a> page on how to test the cache."
2172
  msgstr ""
2173
 
2174
- #: admin/tpl/settings_general.php:49
2175
  msgid "NOTICE"
2176
  msgstr ""
2177
 
2178
- #: admin/tpl/settings_general.php:49
2179
  msgid ""
2180
  "When disabling the cache, all cached entries for this blog will be purged."
2181
  msgstr ""
2182
 
2183
- #: admin/tpl/settings_general.php:51
2184
  msgid "The network admin setting can be overridden here."
2185
  msgstr ""
2186
 
2187
- #: admin/tpl/settings_general.php:58
2188
  msgid "Default Public Cache TTL"
2189
  msgstr ""
2190
 
2191
- #: admin/tpl/settings_general.php:63
2192
  msgid ""
2193
  "Specify how long, in seconds, public pages are cached. Minimum is 30 seconds."
2194
  msgstr ""
2195
 
2196
- #: admin/tpl/settings_general.php:70
 
 
 
 
 
 
 
 
 
 
2197
  msgid "Default Front Page TTL"
2198
  msgstr ""
2199
 
2200
- #: admin/tpl/settings_general.php:75
2201
  msgid ""
2202
  "Specify how long, in seconds, the front page is cached. Minimum is 30 "
2203
  "seconds."
2204
  msgstr ""
2205
 
2206
- #: admin/tpl/settings_general.php:82
2207
  msgid "Default Feed TTL"
2208
  msgstr ""
2209
 
2210
- #: admin/tpl/settings_general.php:87
2211
  msgid "Specify how long, in seconds, feeds are cached."
2212
  msgstr ""
2213
 
2214
- #: admin/tpl/settings_general.php:88
2215
  msgid "If this is set to a number less than 30, feeds will not be cached."
2216
  msgstr ""
2217
 
2218
- #: admin/tpl/settings_general.php:95
2219
  msgid "Default 404 Page TTL"
2220
  msgstr ""
2221
 
2222
- #: admin/tpl/settings_general.php:100
2223
  msgid "Specify how long, in seconds, 404 pages are cached."
2224
  msgstr ""
2225
 
2226
- #: admin/tpl/settings_general.php:101
2227
  msgid "If this is set to a number less than 30, 404 pages will not be cached."
2228
  msgstr ""
2229
 
2230
- #: admin/tpl/settings_general.php:108
2231
  msgid "Default 403 Page TTL"
2232
  msgstr ""
2233
 
2234
- #: admin/tpl/settings_general.php:113
2235
  msgid "Specify how long, in seconds, 403 pages are cached."
2236
  msgstr ""
2237
 
2238
- #: admin/tpl/settings_general.php:114
2239
  msgid "If this is set to a number less than 30, 403 pages will not be cached."
2240
  msgstr ""
2241
 
2242
- #: admin/tpl/settings_general.php:121
2243
  msgid "Default 500 Page TTL"
2244
  msgstr ""
2245
 
2246
- #: admin/tpl/settings_general.php:126
2247
  msgid "Specify how long, in seconds, 500 pages are cached."
2248
  msgstr ""
2249
 
2250
- #: admin/tpl/settings_general.php:127
2251
  msgid "If this is set to a number less than 30, 500 pages will not be cached."
2252
  msgstr ""
2253
 
@@ -2261,7 +2519,7 @@ msgstr ""
2261
 
2262
  #: admin/tpl/settings_inc.cache_favicon.php:12
2263
  msgid ""
2264
- "Caching this recource may improve server performance by avoiding unnecessary "
2265
  "PHP calls."
2266
  msgstr ""
2267
 
@@ -2370,6 +2628,106 @@ msgid ""
2370
  "or WordPress core is upgraded."
2371
  msgstr ""
2372
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2373
  #: admin/tpl/settings_purge.php:5
2374
  msgid "Purge Settings"
2375
  msgstr ""
@@ -2422,56 +2780,56 @@ msgstr ""
2422
  msgid "Auto Purge Rules For Publish/Update"
2423
  msgstr ""
2424
 
2425
- #: admin/tpl/settings_purge.php:48
2426
- #: thirdparty/lscwp-3rd-woocommerce.cls.php:647
2427
  msgid "Note:"
2428
  msgstr ""
2429
 
2430
- #: admin/tpl/settings_purge.php:50
2431
  msgid ""
2432
  "Select \"All\" if there are dynamic widgets linked to posts on pages other "
2433
  "than the front or home pages."
2434
  msgstr ""
2435
 
2436
- #: admin/tpl/settings_purge.php:51
2437
  msgid "Other checkboxes will be ignored."
2438
  msgstr ""
2439
 
2440
- #: admin/tpl/settings_purge.php:52
2441
  msgid ""
2442
  "Select only the archive types that are currently used, the others can be "
2443
  "left unchecked."
2444
  msgstr ""
2445
 
2446
- #: admin/tpl/settings_purge.php:69
2447
  msgid ""
2448
  "Select which pages will be automatically purged when posts are published/"
2449
  "updated."
2450
  msgstr ""
2451
 
2452
- #: admin/tpl/settings_purge.php:75 admin/tpl/settings_purge.php:91
2453
  msgid "Scheduled Purge URLs"
2454
  msgstr ""
2455
 
2456
- #: admin/tpl/settings_purge.php:79
2457
  msgid ""
2458
  "The URLs here (one per line) will be purged automatically at the time set in "
2459
  "the option \"%s\"."
2460
  msgstr ""
2461
 
2462
- #: admin/tpl/settings_purge.php:79 admin/tpl/settings_purge.php:86
2463
  msgid "Scheduled Purge Time"
2464
  msgstr ""
2465
 
2466
- #: admin/tpl/settings_purge.php:80
2467
  msgid "Both %1$s and %2$s are acceptable."
2468
  msgstr ""
2469
 
2470
- #: admin/tpl/settings_purge.php:91
2471
  msgid "Specify the time to purge the \"%s\" list."
2472
  msgstr ""
2473
 
2474
- #: admin/tpl/settings_purge.php:92
2475
  msgid "Current server time is %s."
2476
  msgstr ""
2477
 
@@ -2595,19 +2953,19 @@ msgstr ""
2595
  msgid "Reached end of sitemap file. Crawling completed."
2596
  msgstr ""
2597
 
2598
- #: includes/litespeed-cache-purge.class.php:199
2599
  msgid "Purge category %s"
2600
  msgstr ""
2601
 
2602
- #: includes/litespeed-cache-purge.class.php:226
2603
  msgid "Purge Post ID %s"
2604
  msgstr ""
2605
 
2606
- #: includes/litespeed-cache-purge.class.php:255
2607
  msgid "Purge tag %s"
2608
  msgstr ""
2609
 
2610
- #: includes/litespeed-cache-purge.class.php:289
2611
  msgid "Purge url %s"
2612
  msgstr ""
2613
 
@@ -2615,31 +2973,35 @@ msgstr ""
2615
  msgid "LiteSpeed Cache Custom Cron"
2616
  msgstr ""
2617
 
2618
- #: includes/litespeed-cache.class.php:196
2619
  msgid "Crawler blacklist is saved."
2620
  msgstr ""
2621
 
2622
- #: includes/litespeed-cache.class.php:201
2623
  msgid "Notified LiteSpeed Web Server to purge the front page."
2624
  msgstr ""
2625
 
2626
- #: includes/litespeed-cache.class.php:206
2627
  msgid "Notified LiteSpeed Web Server to purge pages."
2628
  msgstr ""
2629
 
2630
- #: includes/litespeed-cache.class.php:211
 
 
 
 
2631
  msgid "Notified LiteSpeed Web Server to purge error pages."
2632
  msgstr ""
2633
 
2634
- #: includes/litespeed-cache.class.php:217
2635
  msgid "Notified LiteSpeed Web Server to purge all caches."
2636
  msgstr ""
2637
 
2638
- #: includes/litespeed-cache.class.php:224
2639
  msgid "Notified LiteSpeed Web Server to purge everything."
2640
  msgstr ""
2641
 
2642
- #: includes/litespeed-cache.class.php:229
2643
  msgid "Notified LiteSpeed Web Server to purge the list."
2644
  msgstr ""
2645
 
@@ -2675,88 +3037,88 @@ msgstr ""
2675
  msgid "Cannot read meta file: %s"
2676
  msgstr ""
2677
 
2678
- #: lib/litespeed/litespeed-file.class.php:113
2679
  msgid "Folder does not exist: %s"
2680
  msgstr ""
2681
 
2682
- #: lib/litespeed/litespeed-file.class.php:122
2683
  msgid "Can not create folder: %1$s. Error: %2$s"
2684
  msgstr ""
2685
 
2686
- #: lib/litespeed/litespeed-file.class.php:130
2687
  msgid "Folder is not writable: %s."
2688
  msgstr ""
2689
 
2690
- #: lib/litespeed/litespeed-file.class.php:137
2691
- #: lib/litespeed/litespeed-file.class.php:142
2692
  msgid "File %s is not writable."
2693
  msgstr ""
2694
 
2695
- #: lib/litespeed/litespeed-file.class.php:147
2696
  msgid "Failed to write to %s."
2697
  msgstr ""
2698
 
2699
- #: thirdparty/lscwp-3rd-woocommerce.cls.php:592
2700
  msgid "WooCommerce"
2701
  msgstr ""
2702
 
2703
- #: thirdparty/lscwp-3rd-woocommerce.cls.php:595
2704
  msgid "Purge product on changes to the quantity or stock status."
2705
  msgstr ""
2706
 
2707
- #: thirdparty/lscwp-3rd-woocommerce.cls.php:596
2708
  msgid "Purge categories only when stock status changes."
2709
  msgstr ""
2710
 
2711
- #: thirdparty/lscwp-3rd-woocommerce.cls.php:597
2712
  msgid "Purge product and categories only when the stock status changes."
2713
  msgstr ""
2714
 
2715
- #: thirdparty/lscwp-3rd-woocommerce.cls.php:598
2716
  msgid "Purge product only when the stock status changes."
2717
  msgstr ""
2718
 
2719
- #: thirdparty/lscwp-3rd-woocommerce.cls.php:599
2720
  msgid "Do not purge categories on changes to the quantity or stock status."
2721
  msgstr ""
2722
 
2723
- #: thirdparty/lscwp-3rd-woocommerce.cls.php:600
2724
  msgid ""
2725
  "Always purge both product and categories on changes to the quantity or stock "
2726
  "status."
2727
  msgstr ""
2728
 
2729
- #: thirdparty/lscwp-3rd-woocommerce.cls.php:603
2730
  msgid ""
2731
  "Determines how changes in product quantity and product stock status affect "
2732
  "product pages and their associated category pages."
2733
  msgstr ""
2734
 
2735
- #: thirdparty/lscwp-3rd-woocommerce.cls.php:604
2736
  msgid ""
2737
  "Checking this option will force the shop page to use the front page TTL "
2738
  "setting."
2739
  msgstr ""
2740
 
2741
- #: thirdparty/lscwp-3rd-woocommerce.cls.php:605
2742
  msgid ""
2743
  "For example, if the homepage for the site is located at %1$s, the shop page "
2744
  "may be located at %2$s."
2745
  msgstr ""
2746
 
2747
- #: thirdparty/lscwp-3rd-woocommerce.cls.php:632
2748
  msgid "Product Update Interval"
2749
  msgstr ""
2750
 
2751
- #: thirdparty/lscwp-3rd-woocommerce.cls.php:639
2752
  msgid "Use Front Page TTL for the Shop Page"
2753
  msgstr ""
2754
 
2755
- #: thirdparty/lscwp-3rd-woocommerce.cls.php:649
2756
  msgid "After verifying that the cache works in general, please test the cart."
2757
  msgstr ""
2758
 
2759
- #: thirdparty/lscwp-3rd-woocommerce.cls.php:650
2760
  msgid "To test the cart, visit the %s."
2761
  msgstr ""
2762
 
2
  # This file is distributed under the same license as the LiteSpeed Cache package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: LiteSpeed Cache 1.2.3\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
+ "POT-Creation-Date: 2017-09-20 16:04:18+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
+ #: admin/litespeed-cache-admin-display.class.php:140
16
  msgid "Manage"
17
  msgstr ""
18
 
19
+ #: admin/litespeed-cache-admin-display.class.php:142
20
+ #: admin/litespeed-cache-admin-display.class.php:225
21
  msgid "Settings"
22
  msgstr ""
23
 
24
+ #: admin/litespeed-cache-admin-display.class.php:145
25
  msgid "Edit .htaccess"
26
  msgstr ""
27
 
28
+ #: admin/litespeed-cache-admin-display.class.php:148
29
  msgid "Information"
30
  msgstr ""
31
 
32
+ #: admin/litespeed-cache-admin-display.class.php:150
33
  msgid "Environment Report"
34
  msgstr ""
35
 
36
+ #: admin/litespeed-cache-admin-display.class.php:154 admin/tpl/info.php:10
37
  #: admin/tpl/settings.php:27
38
  msgid "Crawler"
39
  msgstr ""
40
 
41
+ #: admin/litespeed-cache-admin-display.class.php:158
42
  #: admin/tpl/settings_debug.php:10
43
  msgid "Debug Log"
44
  msgstr ""
45
 
46
+ #: admin/litespeed-cache-admin-display.class.php:245
47
  msgid ""
48
  "It is recommended that LiteSpeed Cache be purged after updating a plugin."
49
  msgstr ""
50
 
51
+ #: admin/litespeed-cache-admin-display.class.php:285
52
  msgid "LiteSpeed Cache Purge All"
53
  msgstr ""
54
 
55
+ #: admin/litespeed-cache-admin-display.class.php:821
56
+ msgid "ON"
 
57
  msgstr ""
58
 
59
+ #: admin/litespeed-cache-admin-display.class.php:825
60
+ msgid "OFF"
 
61
  msgstr ""
62
 
63
+ #: admin/litespeed-cache-admin-display.class.php:858
64
+ msgid "Recommended value: %s"
65
  msgstr ""
66
 
67
  #: admin/litespeed-cache-admin-error.class.php:87
273
  msgstr ""
274
 
275
  #: admin/litespeed-cache-admin-error.class.php:232
276
+ msgid "The %1$s file not writable for %2$s"
277
  msgstr ""
278
 
279
  #: admin/litespeed-cache-admin-error.class.php:236
280
  msgid "%s file did not find a place to insert define."
281
  msgstr ""
282
 
283
+ #: admin/litespeed-cache-admin-optimize.class.php:139
284
+ msgid "Clean all successfully."
285
+ msgstr ""
286
+
287
+ #: admin/litespeed-cache-admin-optimize.class.php:146
288
+ msgid "Clean post revisions successfully."
289
+ msgstr ""
290
+
291
+ #: admin/litespeed-cache-admin-optimize.class.php:150
292
+ msgid "Clean auto drafts successfully."
293
+ msgstr ""
294
+
295
+ #: admin/litespeed-cache-admin-optimize.class.php:154
296
+ msgid "Clean trashed posts and pages successfully."
297
+ msgstr ""
298
+
299
+ #: admin/litespeed-cache-admin-optimize.class.php:158
300
+ msgid "Clean spam comments successfully."
301
+ msgstr ""
302
+
303
+ #: admin/litespeed-cache-admin-optimize.class.php:162
304
+ msgid "Clean trashed comments successfully."
305
+ msgstr ""
306
+
307
+ #: admin/litespeed-cache-admin-optimize.class.php:166
308
+ msgid "Clean trackbacks and pingbacks successfully."
309
+ msgstr ""
310
+
311
+ #: admin/litespeed-cache-admin-optimize.class.php:170
312
+ msgid "Clean expired transients successfully."
313
+ msgstr ""
314
+
315
+ #: admin/litespeed-cache-admin-optimize.class.php:174
316
+ msgid "Clean all transients successfully."
317
+ msgstr ""
318
+
319
+ #: admin/litespeed-cache-admin-optimize.class.php:184
320
+ msgid "Optimized all tables."
321
+ msgstr ""
322
+
323
+ #: admin/litespeed-cache-admin-rules.class.php:715
324
  msgid ""
325
  "<p>Please add/replace the following codes into the beginning of %1$s:</p> "
326
  "%2$s"
327
  msgstr ""
328
 
329
+ #: admin/litespeed-cache-admin-rules.class.php:850
330
  msgid "File Saved."
331
  msgstr ""
332
 
335
  msgstr ""
336
 
337
  #: admin/litespeed-cache-admin-settings.class.php:176
338
+ msgid "Default Private Cache"
339
  msgstr ""
340
 
341
  #: admin/litespeed-cache-admin-settings.class.php:184
342
+ msgid "Default Front Page"
343
+ msgstr ""
344
+
345
+ #: admin/litespeed-cache-admin-settings.class.php:192
346
  msgid "Feed"
347
  msgstr ""
348
 
349
+ #: admin/litespeed-cache-admin-settings.class.php:203
350
  msgid "404"
351
  msgstr ""
352
 
353
+ #: admin/litespeed-cache-admin-settings.class.php:214
354
  msgid "403"
355
  msgstr ""
356
 
357
+ #: admin/litespeed-cache-admin-settings.class.php:225
358
  msgid "500"
359
  msgstr ""
360
 
361
+ #: admin/litespeed-cache-admin-settings.class.php:583
362
+ #: admin/tpl/settings_debug.php:75
363
  msgid "Log File Size Limit"
364
  msgstr ""
365
 
366
+ #: admin/litespeed-cache-admin-settings.class.php:663
367
  #: admin/tpl/settings_crawler.php:10
368
  msgid "Delay"
369
  msgstr ""
370
 
371
+ #: admin/litespeed-cache-admin-settings.class.php:671
372
  #: admin/tpl/settings_crawler.php:22
373
  msgid "Run Duration"
374
  msgstr ""
375
 
376
+ #: admin/litespeed-cache-admin-settings.class.php:679
377
  msgid "Cron Interval"
378
  msgstr ""
379
 
380
+ #: admin/litespeed-cache-admin-settings.class.php:687
381
  msgid "Whole Interval"
382
  msgstr ""
383
 
384
+ #: admin/litespeed-cache-admin-settings.class.php:695
385
  #: admin/tpl/settings_crawler.php:58
386
  msgid "Threads"
387
  msgstr ""
388
 
389
+ #: admin/litespeed-cache-admin-settings.class.php:806
390
  msgid "'Use primary site settings' set by Network Administrator."
391
  msgstr ""
392
 
393
+ #: admin/litespeed-cache-admin-settings.class.php:940
394
  msgid "File saved."
395
  msgstr ""
396
 
471
  msgid "Crawler Cron"
472
  msgstr ""
473
 
474
+ #: admin/tpl/crawler.php:63 admin/tpl/settings.php:115
475
  msgid "WARNING"
476
  msgstr ""
477
 
522
  msgid "Is running"
523
  msgstr ""
524
 
525
+ #: admin/tpl/crawler.php:136 admin/tpl/settings_general.php:30
526
+ msgid "Enable"
527
+ msgstr ""
528
+
529
+ #: admin/tpl/crawler.php:136 admin/tpl/esi_widget_edit.php:58
530
+ #: admin/tpl/settings_general.php:24
531
+ msgid "Disable"
532
+ msgstr ""
533
+
534
+ #: admin/tpl/crawler.php:143
535
  msgid "Reset position"
536
  msgstr ""
537
 
538
+ #: admin/tpl/crawler.php:146
539
  msgid "Manually run"
540
  msgstr ""
541
 
542
+ #: admin/tpl/crawler.php:150
543
  msgid "<b>Last interval:</b> %s"
544
  msgstr ""
545
 
546
+ #: admin/tpl/crawler.php:156
547
  msgid "<b>Ended reason:</b> %s"
548
  msgstr ""
549
 
550
+ #: admin/tpl/crawler.php:162
551
  msgid "<b>Last crawled:</b> %s item(s)"
552
  msgstr ""
553
 
554
+ #: admin/tpl/crawler.php:170
555
  msgid "Run frequency is set by the Interval Between Runs setting."
556
  msgstr ""
557
 
558
+ #: admin/tpl/crawler.php:171
559
  msgid "Only one crawler can run concurrently."
560
  msgstr ""
561
 
562
+ #: admin/tpl/crawler.php:172
563
  msgid ""
564
  "If both the cron and manual run start at a similar time, the first one to "
565
  "start will run."
566
  msgstr ""
567
 
568
+ #: admin/tpl/crawler.php:173
569
  msgid ""
570
  "Please follow <a %s>Hooking WP-Cron Into the System Task Scheduler</a> to "
571
  "create the system cron task."
572
  msgstr ""
573
 
574
+ #: admin/tpl/crawler.php:178
575
  msgid "Watch Crawler Status"
576
  msgstr ""
577
 
578
+ #: admin/tpl/crawler.php:185
579
  msgid "Show crawler status"
580
  msgstr ""
581
 
582
+ #: admin/tpl/crawler.php:203
583
  msgid "No crawler meta file generated yet"
584
  msgstr ""
585
 
586
+ #: admin/tpl/crawler.php:208
587
  msgid "Sitemap Generation Blacklist"
588
  msgstr ""
589
 
590
+ #: admin/tpl/crawler.php:217 admin/tpl/edit_htaccess.php:68
591
  msgid "Save"
592
  msgstr ""
593
 
594
+ #: admin/tpl/crawler.php:221
595
  msgid "Current blacklist has %s item(s)."
596
  msgstr ""
597
 
598
+ #: admin/tpl/crawler.php:222
599
  msgid ""
600
  "All Urls which returned no-cache tags will be added here, after the initial "
601
  "crawling."
613
  msgid "WARNING: This page is meant for advanced users."
614
  msgstr ""
615
 
616
+ #: admin/tpl/edit_htaccess.php:42
617
  msgid "Any changes made to the .htaccess file may break the site."
618
  msgstr ""
619
 
620
+ #: admin/tpl/edit_htaccess.php:43
621
  msgid "Please consult the host/server admin before making any changes."
622
  msgstr ""
623
 
624
+ #: admin/tpl/edit_htaccess.php:48
625
  msgid "File editing is disabled in configuration."
626
  msgstr ""
627
 
628
+ #: admin/tpl/edit_htaccess.php:58
629
+ msgid "Current %s Contents"
630
  msgstr ""
631
 
632
+ #: admin/tpl/edit_htaccess.php:60
633
  msgid "DO NOT EDIT ANYTHING WITHIN %s"
634
  msgstr ""
635
 
636
+ #: admin/tpl/edit_htaccess.php:62
637
  msgid ""
638
  "These are added by the LS Cache plugin and may cause problems if they are "
639
  "changed."
640
  msgstr ""
641
 
642
+ #: admin/tpl/esi_widget_edit.php:30 admin/tpl/settings_esi.php:35
643
  msgid "Enable ESI"
644
  msgstr ""
645
 
646
+ #: admin/tpl/esi_widget_edit.php:40
647
+ msgid "Public"
648
+ msgstr ""
649
+
650
+ #: admin/tpl/esi_widget_edit.php:49
651
+ msgid "Private"
652
+ msgstr ""
653
+
654
+ #: admin/tpl/esi_widget_edit.php:69
655
  msgid "Widget Cache TTL:"
656
  msgstr ""
657
 
658
+ #: admin/tpl/esi_widget_edit.php:72 admin/tpl/settings_crawler.php:25
659
  #: admin/tpl/settings_crawler.php:37 admin/tpl/settings_crawler.php:49
660
+ #: admin/tpl/settings_general.php:59 admin/tpl/settings_general.php:71
661
+ #: admin/tpl/settings_general.php:83 admin/tpl/settings_general.php:95
662
+ #: admin/tpl/settings_general.php:108 admin/tpl/settings_general.php:121
663
+ #: admin/tpl/settings_general.php:134 admin/tpl/settings_optimize.php:100
664
  msgid "seconds"
665
  msgstr ""
666
 
667
+ #: admin/tpl/esi_widget_edit.php:75
668
  msgid "Recommended value: 28800 seconds (8 hours)."
669
  msgstr ""
670
 
671
+ #: admin/tpl/esi_widget_edit.php:76
672
  msgid "A TTL of 0 indicates do not cache."
673
  msgstr ""
674
 
796
 
797
  #: admin/tpl/info_common_rewrite.php:14 admin/tpl/settings_advanced.php:6
798
  #: admin/tpl/settings_inc.cache_mobile.php:64
799
+ #: admin/tpl/settings_optimize.php:10
800
  msgid "NOTICE:"
801
  msgstr ""
802
 
1301
  msgid "Purge the cache to use the updated pages."
1302
  msgstr ""
1303
 
1304
+ #: admin/tpl/manage.php:7 admin/tpl/manage_purge.php:75
1305
+ #: admin/tpl/network_settings.php:7 admin/tpl/settings.php:9
1306
+ msgid "Purge"
1307
+ msgstr ""
1308
+
1309
+ #: admin/tpl/manage.php:8
1310
+ msgid "DB Optimizer"
1311
+ msgstr ""
1312
+
1313
+ #: admin/tpl/manage.php:17
1314
+ msgid "LiteSpeed Cache Network Management"
1315
+ msgstr ""
1316
+
1317
+ #: admin/tpl/manage.php:20
1318
  msgid "LiteSpeed Cache Management"
1319
  msgstr ""
1320
 
1321
+ #: admin/tpl/manage.php:42
1322
  msgid ""
1323
+ "WARNING: LiteSpeed cache is disabled. The functionalities here can not work."
 
1324
  msgstr ""
1325
 
1326
+ #: admin/tpl/manage_db.php:6
1327
+ msgid "Clean All"
1328
  msgstr ""
1329
 
1330
+ #: admin/tpl/manage_db.php:10
1331
+ msgid "Post Revisions"
1332
  msgstr ""
1333
 
1334
+ #: admin/tpl/manage_db.php:11
1335
+ msgid "Clean all post revisions"
1336
  msgstr ""
1337
 
1338
+ #: admin/tpl/manage_db.php:14
1339
+ msgid "Auto Drafts"
1340
  msgstr ""
1341
 
1342
+ #: admin/tpl/manage_db.php:15
1343
+ msgid "Clean all auto saved drafts"
1344
  msgstr ""
1345
 
1346
+ #: admin/tpl/manage_db.php:18
1347
+ msgid "Trashed Posts"
1348
  msgstr ""
1349
 
1350
+ #: admin/tpl/manage_db.php:19
1351
+ msgid "Clean all trashed posts and pages"
1352
  msgstr ""
1353
 
1354
+ #: admin/tpl/manage_db.php:22
1355
+ msgid "Spam Comments"
1356
  msgstr ""
1357
 
1358
+ #: admin/tpl/manage_db.php:23
1359
+ msgid "Clean all spam comments"
1360
  msgstr ""
1361
 
1362
+ #: admin/tpl/manage_db.php:26
1363
+ msgid "Trashed Comments"
1364
  msgstr ""
1365
 
1366
+ #: admin/tpl/manage_db.php:27
1367
+ msgid "Clean all trashed comments"
1368
  msgstr ""
1369
 
1370
+ #: admin/tpl/manage_db.php:30
1371
+ msgid "Trackbacks/Pingbacks"
1372
  msgstr ""
1373
 
1374
+ #: admin/tpl/manage_db.php:31
1375
+ msgid "Clean all trackbacks and pingbacks"
1376
  msgstr ""
1377
 
1378
+ #: admin/tpl/manage_db.php:34
1379
+ msgid "Expired Transients"
1380
  msgstr ""
1381
 
1382
+ #: admin/tpl/manage_db.php:35
1383
+ msgid "Clean expired transient options"
1384
  msgstr ""
1385
 
1386
+ #: admin/tpl/manage_db.php:38
1387
+ msgid "All Transients"
1388
  msgstr ""
1389
 
1390
+ #: admin/tpl/manage_db.php:39
1391
+ msgid "Clean all transient options"
1392
  msgstr ""
1393
 
1394
+ #: admin/tpl/manage_db.php:42
1395
+ msgid "Optimize Tables"
1396
  msgstr ""
1397
 
1398
+ #: admin/tpl/manage_db.php:43
1399
+ msgid "Optimize all tables in your database"
1400
  msgstr ""
1401
 
1402
+ #: admin/tpl/manage_db.php:62
1403
+ msgid "Database Optimizer"
1404
  msgstr ""
1405
 
1406
+ #: admin/tpl/manage_purge.php:7
1407
+ msgid "Purge Front Page"
1408
+ msgstr ""
1409
+
1410
+ #: admin/tpl/manage_purge.php:8
1411
+ msgid "This will Purge Front Page only"
1412
+ msgstr ""
1413
+
1414
+ #: admin/tpl/manage_purge.php:13
1415
+ msgid "Purge Pages"
1416
+ msgstr ""
1417
+
1418
+ #: admin/tpl/manage_purge.php:14
1419
+ msgid "This will Purge Pages only"
1420
+ msgstr ""
1421
+
1422
+ #: admin/tpl/manage_purge.php:19
1423
+ msgid "Purge CSS/JS Cache"
1424
+ msgstr ""
1425
+
1426
+ #: admin/tpl/manage_purge.php:20
1427
+ msgid "This will purge all minified/combined CSS/JS entries only"
1428
+ msgstr ""
1429
+
1430
+ #: admin/tpl/manage_purge.php:25
1431
+ msgid "Purge 403 Error"
1432
+ msgstr ""
1433
+
1434
+ #: admin/tpl/manage_purge.php:26
1435
+ msgid "Purge error pages, including 403 pages"
1436
+ msgstr ""
1437
+
1438
+ #: admin/tpl/manage_purge.php:32
1439
+ msgid "Purge 404 Error"
1440
+ msgstr ""
1441
+
1442
+ #: admin/tpl/manage_purge.php:33
1443
+ msgid "Purge error pages, including 404 pages"
1444
+ msgstr ""
1445
+
1446
+ #: admin/tpl/manage_purge.php:39
1447
+ msgid "Purge 500 Error"
1448
+ msgstr ""
1449
+
1450
+ #: admin/tpl/manage_purge.php:40
1451
+ msgid "Purge error pages, including 500 pages"
1452
+ msgstr ""
1453
+
1454
+ #: admin/tpl/manage_purge.php:46
1455
+ msgid "Purge All"
1456
+ msgstr ""
1457
+
1458
+ #: admin/tpl/manage_purge.php:47
1459
+ msgid "Purge the cache entries created by this plugin"
1460
+ msgstr ""
1461
+
1462
+ #: admin/tpl/manage_purge.php:52
1463
+ msgid "This will purge everything for all blogs."
1464
  msgstr ""
1465
 
1466
+ #: admin/tpl/manage_purge.php:53 admin/tpl/manage_purge.php:55
1467
+ msgid "Are you sure you want to purge all?"
1468
+ msgstr ""
1469
+
1470
+ #: admin/tpl/manage_purge.php:61
1471
  msgid "Empty Entire Cache"
1472
  msgstr ""
1473
 
1474
+ #: admin/tpl/manage_purge.php:62
1475
  msgid ""
1476
  "Clears all cache entries related to this site, <i>including other web "
1477
  "applications</i>."
1478
  msgstr ""
1479
 
1480
+ #: admin/tpl/manage_purge.php:63
1481
+ msgid "This action should only be used if things are cached incorrectly."
1482
+ msgstr ""
1483
+
1484
+ #: admin/tpl/manage_purge.php:67
1485
+ msgid "This will clear EVERYTHING inside the cache."
1486
+ msgstr ""
1487
+
1488
+ #: admin/tpl/manage_purge.php:68
1489
+ msgid "This may cause heavy load on the server."
1490
  msgstr ""
1491
 
1492
+ #: admin/tpl/manage_purge.php:69
1493
+ msgid "If only the WordPress site should be purged, use purge all."
1494
+ msgstr ""
1495
+
1496
+ #: admin/tpl/manage_purge.php:102
1497
  msgid "Purge By..."
1498
  msgstr ""
1499
 
1500
+ #: admin/tpl/manage_purge.php:104
1501
  msgid "Select below for \"Purge by\" options."
1502
  msgstr ""
1503
 
1504
+ #: admin/tpl/manage_purge.php:105
1505
  msgid "Please enter one per line."
1506
  msgstr ""
1507
 
1508
+ #: admin/tpl/manage_purge.php:132
1509
  msgid "Category"
1510
  msgstr ""
1511
 
1512
+ #: admin/tpl/manage_purge.php:138
1513
  msgid "Post ID"
1514
  msgstr ""
1515
 
1516
+ #: admin/tpl/manage_purge.php:144
1517
  msgid "Tag"
1518
  msgstr ""
1519
 
1520
+ #: admin/tpl/manage_purge.php:150
1521
  msgid "URL"
1522
  msgstr ""
1523
 
1524
+ #: admin/tpl/manage_purge.php:156
1525
  msgid ""
1526
  "Purge pages by category name - e.g. %2$s should be used for the URL %1$s."
1527
  msgstr ""
1528
 
1529
+ #: admin/tpl/manage_purge.php:161
1530
  msgid "Purge pages by post ID."
1531
  msgstr ""
1532
 
1533
+ #: admin/tpl/manage_purge.php:165
1534
  msgid "Purge pages by tag name - e.g. %2$s should be used for the URL %1$s."
1535
  msgstr ""
1536
 
1537
+ #: admin/tpl/manage_purge.php:170
1538
  msgid "Purge pages by relative or full URL."
1539
  msgstr ""
1540
 
1541
+ #: admin/tpl/manage_purge.php:171
1542
  msgid "e.g. Use %s or %s."
1543
  msgstr ""
1544
 
1545
+ #: admin/tpl/manage_purge.php:184
1546
  msgid "Purge List"
1547
  msgstr ""
1548
 
1555
  msgid "Cache"
1556
  msgstr ""
1557
 
 
 
 
 
1558
  #: admin/tpl/network_settings.php:8 admin/tpl/settings.php:10
1559
  msgid "Excludes"
1560
  msgstr ""
1561
 
1562
  #: admin/tpl/network_settings.php:9 admin/tpl/settings.php:18
1563
+ #: admin/tpl/settings_debug.php:65
1564
  msgid "Advanced"
1565
  msgstr ""
1566
 
1632
  msgid "Purge Network Settings"
1633
  msgstr ""
1634
 
1635
+ #: admin/tpl/report.php:10
1636
  msgid "LiteSpeed Cache Report"
1637
  msgstr ""
1638
 
1639
+ #: admin/tpl/report.php:19
1640
  msgid ""
1641
  "The environment report contains detailed information about the WordPress "
1642
  "configuration."
1643
  msgstr ""
1644
 
1645
+ #: admin/tpl/report.php:20
1646
  msgid ""
1647
  "If you run into any issues, please include the contents of this text area in "
1648
  "your support message."
1649
  msgstr ""
1650
 
1651
+ #: admin/tpl/report.php:21
1652
  msgid ""
1653
  "To easily grab the content, click the <b>Select All and Copy to Clipboard</"
1654
  "b> button, to select and copy to clipboard."
1655
  msgstr ""
1656
 
1657
+ #: admin/tpl/report.php:23
1658
  msgid "Alternatively, this information is also saved in %s."
1659
  msgstr ""
1660
 
1661
+ #: admin/tpl/report.php:28
1662
  msgid "The text area below contains the following content:"
1663
  msgstr ""
1664
 
1665
+ #: admin/tpl/report.php:32
1666
  msgid ""
1667
  "Server Variables, Plugin Options, WordPress information (version, locale, "
1668
  "active plugins, etc.), and .htaccess file content."
1669
  msgstr ""
1670
 
1671
+ #: admin/tpl/report.php:37
1672
  msgid "Select All and Copy to Clipboard"
1673
  msgstr ""
1674
 
1675
+ #: admin/tpl/report.php:40
1676
  msgid "Environment Report copied to Clipboard!"
1677
  msgstr ""
1678
 
1679
+ #: admin/tpl/settings.php:11
1680
+ msgid "Optimize"
1681
+ msgstr ""
1682
+
1683
+ #: admin/tpl/settings.php:12
1684
+ msgid "CDN"
1685
+ msgstr ""
1686
+
1687
+ #: admin/tpl/settings.php:15
1688
  msgid "ESI"
1689
  msgstr ""
1690
 
1708
  msgid "LiteSpeed Cache Settings"
1709
  msgstr ""
1710
 
1711
+ #: admin/tpl/settings.php:117
1712
  msgid "The network admin selected use primary site configs for all subsites."
1713
  msgstr ""
1714
 
1715
+ #: admin/tpl/settings.php:118
1716
  msgid ""
1717
  "The following options are selected, but are not editable in this settings "
1718
  "page."
1719
  msgstr ""
1720
 
1721
+ #: admin/tpl/settings.php:140 admin/tpl/settings.php:143
1722
  msgid "Save Changes"
1723
  msgstr ""
1724
 
1776
  msgid "MUST BE UNIQUE FROM OTHER WEB APPLICATIONS."
1777
  msgstr ""
1778
 
1779
+ #: admin/tpl/settings_advanced.php:35
1780
  msgid "The default login cookie is %s."
1781
  msgstr ""
1782
 
1783
+ #: admin/tpl/settings_advanced.php:36
1784
  msgid ""
1785
  "The server will determine if the user is logged in based on the existance of "
1786
  "this cookie."
1787
  msgstr ""
1788
 
1789
+ #: admin/tpl/settings_advanced.php:37
1790
  msgid ""
1791
  "This setting is useful for those that have multiple web applications for the "
1792
  "same domain."
1793
  msgstr ""
1794
 
1795
+ #: admin/tpl/settings_advanced.php:38
1796
  msgid ""
1797
  "If every web application uses the same cookie, the server may confuse "
1798
  "whether a user is logged in or not."
1799
  msgstr ""
1800
 
1801
+ #: admin/tpl/settings_advanced.php:39
1802
  msgid "The cookie set here will be used for this WordPress installation."
1803
  msgstr ""
1804
 
1805
+ #: admin/tpl/settings_advanced.php:42
1806
  msgid "Example use case:"
1807
  msgstr ""
1808
 
1809
+ #: admin/tpl/settings_advanced.php:44
1810
  msgid "There is a WordPress installed for %s."
1811
  msgstr ""
1812
 
1813
+ #: admin/tpl/settings_advanced.php:46
1814
  msgid "Then another WordPress is installed (NOT MULTISITE) at %s"
1815
  msgstr ""
1816
 
1817
+ #: admin/tpl/settings_advanced.php:47
1818
  msgid ""
1819
  "The cache needs to distinguish who is logged into which WordPress site in "
1820
  "order to cache correctly."
1821
  msgstr ""
1822
 
1823
+ #: admin/tpl/settings_advanced.php:53
1824
  msgid "Error: invalid login cookie. Please check the %s file"
1825
  msgstr ""
1826
 
1827
+ #: admin/tpl/settings_advanced.php:62
1828
  msgid "Error getting current rules from %s: %s"
1829
  msgstr ""
1830
 
1831
+ #: admin/tpl/settings_advanced.php:70
1832
  msgid ""
1833
  "WARNING: The .htaccess login cookie and Database login cookie do not match."
1834
  msgstr ""
1871
  msgid "Disabling this option may negatively affect performance."
1872
  msgstr ""
1873
 
1874
+ #: admin/tpl/settings_cdn.php:11
1875
+ msgid "CDN Settings"
1876
+ msgstr ""
1877
+
1878
+ #: admin/tpl/settings_cdn.php:15
1879
+ msgid "Enable CDN"
1880
+ msgstr ""
1881
+
1882
+ #: admin/tpl/settings_cdn.php:19
1883
+ msgid "Enable Content Delivery Network use."
1884
+ msgstr ""
1885
+
1886
+ #: admin/tpl/settings_cdn.php:25
1887
+ msgid "Original URL"
1888
+ msgstr ""
1889
+
1890
+ #: admin/tpl/settings_cdn.php:29
1891
+ msgid ""
1892
+ "Site URL to be served through the CDN. Beginning with %1$s. For example, %2$s"
1893
+ msgstr ""
1894
+
1895
+ #: admin/tpl/settings_cdn.php:35
1896
+ msgid "CDN URL"
1897
+ msgstr ""
1898
+
1899
+ #: admin/tpl/settings_cdn.php:39
1900
+ msgid "CDN URL to be used. For example, %s"
1901
+ msgstr ""
1902
+
1903
+ #: admin/tpl/settings_cdn.php:45
1904
+ msgid "Include Images"
1905
+ msgstr ""
1906
+
1907
+ #: admin/tpl/settings_cdn.php:49
1908
+ msgid ""
1909
+ "Serve all image files through the CDN. This will affect all attachments, "
1910
+ "HTML %s tags, and CSS %s attributes."
1911
+ msgstr ""
1912
+
1913
+ #: admin/tpl/settings_cdn.php:55
1914
+ msgid "Include CSS"
1915
+ msgstr ""
1916
+
1917
+ #: admin/tpl/settings_cdn.php:59
1918
+ msgid ""
1919
+ "Serve all CSS files through the CDN. This will affect all enqueued WP CSS "
1920
+ "files."
1921
+ msgstr ""
1922
+
1923
+ #: admin/tpl/settings_cdn.php:65
1924
+ msgid "Include JS"
1925
+ msgstr ""
1926
+
1927
+ #: admin/tpl/settings_cdn.php:69
1928
+ msgid ""
1929
+ "Serve all JavaScript files through the CDN. This will affect all enqueued WP "
1930
+ "JavaScript files."
1931
+ msgstr ""
1932
+
1933
+ #: admin/tpl/settings_cdn.php:75
1934
+ msgid "Include File Types"
1935
+ msgstr ""
1936
+
1937
+ #: admin/tpl/settings_cdn.php:81
1938
+ msgid "Static file type links to be replaced by CDN links. One per line."
1939
+ msgstr ""
1940
+
1941
+ #: admin/tpl/settings_cdn.php:82
1942
+ msgid "This will affect all tags containing attributes: %s %s %s."
1943
+ msgstr ""
1944
+
1945
+ #: admin/tpl/settings_cdn.php:94
1946
+ msgid "Exclude Path"
1947
+ msgstr ""
1948
+
1949
+ #: admin/tpl/settings_cdn.php:99
1950
+ msgid "Paths containing these strings will not be served from the CDN."
1951
+ msgstr ""
1952
+
1953
  #: admin/tpl/settings_compatibilities.php:7
1954
  msgid "Compatibility with WP-PostViews"
1955
  msgstr ""
2103
  msgid "Available Custom Post Type"
2104
  msgstr ""
2105
 
2106
+ #: admin/tpl/settings_crawler.php:163
2107
  msgid "Order links by"
2108
  msgstr ""
2109
 
2110
+ #: admin/tpl/settings_crawler.php:169
2111
  msgid "Date, descending (Default)"
2112
  msgstr ""
2113
 
2114
+ #: admin/tpl/settings_crawler.php:175
2115
  msgid "Date, ascending"
2116
  msgstr ""
2117
 
2118
+ #: admin/tpl/settings_crawler.php:181
2119
  msgid "Alphabetical, descending"
2120
  msgstr ""
2121
 
2122
+ #: admin/tpl/settings_crawler.php:187
2123
  msgid "Alphabetical, ascending"
2124
  msgstr ""
2125
 
2133
  msgid "Developer Testing"
2134
  msgstr ""
2135
 
2136
+ #: admin/tpl/settings_debug.php:16
2137
  msgid "Off"
2138
  msgstr ""
2139
 
2140
+ #: admin/tpl/settings_debug.php:22
2141
  msgid "On"
2142
  msgstr ""
2143
 
2144
+ #: admin/tpl/settings_debug.php:28
2145
  msgid "Admin IP only"
2146
  msgstr ""
2147
 
2148
+ #: admin/tpl/settings_debug.php:32
2149
  msgid "Outputs to WordPress debug log."
2150
  msgstr ""
2151
 
2152
+ #: admin/tpl/settings_debug.php:33
2153
  msgid ""
2154
  "This should be set to off once everything is working to prevent filling the "
2155
  "disk."
2156
  msgstr ""
2157
 
2158
+ #: admin/tpl/settings_debug.php:34
2159
  msgid ""
2160
  "The Admin IP option will only output log messages on requests from admin IPs."
2161
  msgstr ""
2162
 
2163
+ #: admin/tpl/settings_debug.php:35
2164
  msgid ""
2165
  "The logs will be outputted to the debug.log in the wp-content directory."
2166
  msgstr ""
2167
 
2168
+ #: admin/tpl/settings_debug.php:41
2169
  msgid "Admin IPs"
2170
  msgstr ""
2171
 
2172
+ #: admin/tpl/settings_debug.php:45
2173
  msgid ""
2174
  "Allows listed IPs (one per line) to perform certain actions from their "
2175
  "browsers."
2176
  msgstr ""
2177
 
2178
+ #: admin/tpl/settings_debug.php:46
2179
  msgid ""
2180
  "More information about the available commands can be found <a href=\"%s"
2181
  "\">here</a>."
2182
  msgstr ""
2183
 
2184
+ #: admin/tpl/settings_debug.php:53
2185
  msgid "Debug Level"
2186
  msgstr ""
2187
 
2188
+ #: admin/tpl/settings_debug.php:59
2189
  msgid "Basic"
2190
  msgstr ""
2191
 
2192
+ #: admin/tpl/settings_debug.php:69
2193
  msgid "Advanced level will log more details."
2194
  msgstr ""
2195
 
2196
+ #: admin/tpl/settings_debug.php:78
2197
  msgid "MB"
2198
  msgstr ""
2199
 
2200
+ #: admin/tpl/settings_debug.php:80
2201
  msgid ""
2202
  "Specify the maximum size of the log file. Minimum is 3MB. Maximum is 3000MB."
2203
  msgstr ""
2204
 
2205
+ #: admin/tpl/settings_debug.php:87
2206
  msgid "Heartbeat"
2207
  msgstr ""
2208
 
2209
+ #: admin/tpl/settings_debug.php:91
2210
  msgid ""
2211
  "Disable WordPress heartbeat to prevent AJAX calls from breaking debug "
2212
  "logging. WARNING: Disabling this may cause WordPress tasks triggered by AJAX "
2213
  "to stop working."
2214
  msgstr ""
2215
 
2216
+ #: admin/tpl/settings_debug.php:97
2217
  msgid "Log Cookies"
2218
  msgstr ""
2219
 
2220
+ #: admin/tpl/settings_debug.php:101
2221
  msgid "Log request cookie values."
2222
  msgstr ""
2223
 
2224
+ #: admin/tpl/settings_debug.php:107
2225
  msgid "Collapse Query Strings"
2226
  msgstr ""
2227
 
2228
+ #: admin/tpl/settings_debug.php:111
2229
  msgid "Shorten query strings in the debug log to improve readability."
2230
  msgstr ""
2231
 
2232
+ #: admin/tpl/settings_debug.php:117
2233
  msgid "Log Filters"
2234
  msgstr ""
2235
 
2236
+ #: admin/tpl/settings_debug.php:121
2237
  msgid ""
2238
  "Log all WordPress filter hooks. WARNING: Enabling this option will cause log "
2239
  "file size to grow quickly."
2240
  msgstr ""
2241
 
2242
+ #: admin/tpl/settings_debug.php:127
2243
  msgid "Exclude Filters"
2244
  msgstr ""
2245
 
2246
+ #: admin/tpl/settings_debug.php:131
2247
  msgid "Listed filters (one per line) will not be logged."
2248
  msgstr ""
2249
 
2250
+ #: admin/tpl/settings_debug.php:137
2251
  msgid "Exclude Part Filters"
2252
  msgstr ""
2253
 
2254
+ #: admin/tpl/settings_debug.php:141
2255
  msgid "Filters containing these strings (one per line) will not be logged."
2256
  msgstr ""
2257
 
2258
+ #: admin/tpl/settings_esi.php:14
2259
  msgid "ESI Settings"
2260
  msgstr ""
2261
 
2262
+ #: admin/tpl/settings_esi.php:17
2263
  msgid ""
2264
+ "With ESI (Edge Side Includes), pages may be served from cache for logged-in "
2265
+ "users."
2266
  msgstr ""
2267
 
2268
+ #: admin/tpl/settings_esi.php:18
2269
  msgid ""
2270
+ "ESI allows you to designate parts of your dynamic page as separate fragments "
2271
+ "that are then assembled together to make the whole page. In other words, ESI "
2272
+ "lets you “punch holes” in a page, and then fill those holes with content "
2273
+ "that may be cached privately, cached publicly with its own TTL, or not "
2274
+ "cached at all."
2275
  msgstr ""
2276
 
2277
+ #: admin/tpl/settings_esi.php:20
2278
+ msgid "Learn more about public cache vs. private cache <a %s>on our blog</a>."
 
 
2279
  msgstr ""
2280
 
2281
+ #: admin/tpl/settings_esi.php:29
2282
+ msgid "Available in LiteSpeed Enterprise version"
2283
  msgstr ""
2284
 
2285
+ #: admin/tpl/settings_esi.php:39
2286
  msgid ""
2287
+ "Enable caches public pages for logged in users and serves the Admin Bar and "
2288
+ "Comment Form via ESI blocks. These two blocks will be uncached unless "
2289
+ "enabled below."
2290
  msgstr ""
2291
 
2292
+ #: admin/tpl/settings_esi.php:45
2293
+ msgid "Cache Admin Bar"
2294
  msgstr ""
2295
 
2296
+ #: admin/tpl/settings_esi.php:49
2297
+ msgid "Cache the build-in Admin Bar ESI block."
2298
+ msgstr ""
2299
+
2300
+ #: admin/tpl/settings_esi.php:55
2301
+ msgid "Cache Comment Form"
2302
+ msgstr ""
2303
+
2304
+ #: admin/tpl/settings_esi.php:59
2305
+ msgid "Cache the build-in Comment Form ESI block."
2306
  msgstr ""
2307
 
2308
+ #: admin/tpl/settings_esi.php:65
2309
+ msgid "Vary Group"
2310
+ msgstr ""
2311
+
2312
+ #: admin/tpl/settings_esi.php:80
2313
+ msgid ""
2314
+ "If your site contains public content that certain user roles can see but "
2315
+ "other roles cannot, you can specify a Vary Group for those user roles. For "
2316
+ "example, specifying an administrator vary group allows there to be a "
2317
+ "separate publicly-cached page tailored to administrators (with “edit” links, "
2318
+ "etc), while all other user roles see the default public page."
2319
  msgstr ""
2320
 
2321
  #: admin/tpl/settings_excludes.php:7
2411
  msgid "Enable LiteSpeed Cache"
2412
  msgstr ""
2413
 
2414
+ #: admin/tpl/settings_general.php:38
2415
  msgid "Use Network Admin Setting"
2416
  msgstr ""
2417
 
2418
+ #: admin/tpl/settings_general.php:44
2419
  msgid "Please visit the <a %s>Information</a> page on how to test the cache."
2420
  msgstr ""
2421
 
2422
+ #: admin/tpl/settings_general.php:47
2423
  msgid "NOTICE"
2424
  msgstr ""
2425
 
2426
+ #: admin/tpl/settings_general.php:47
2427
  msgid ""
2428
  "When disabling the cache, all cached entries for this blog will be purged."
2429
  msgstr ""
2430
 
2431
+ #: admin/tpl/settings_general.php:49
2432
  msgid "The network admin setting can be overridden here."
2433
  msgstr ""
2434
 
2435
+ #: admin/tpl/settings_general.php:56
2436
  msgid "Default Public Cache TTL"
2437
  msgstr ""
2438
 
2439
+ #: admin/tpl/settings_general.php:61
2440
  msgid ""
2441
  "Specify how long, in seconds, public pages are cached. Minimum is 30 seconds."
2442
  msgstr ""
2443
 
2444
+ #: admin/tpl/settings_general.php:68
2445
+ msgid "Default Private Cache TTL"
2446
+ msgstr ""
2447
+
2448
+ #: admin/tpl/settings_general.php:73
2449
+ msgid ""
2450
+ "Specify how long, in seconds, private pages are cached. Minimum is %1$s "
2451
+ "seconds. Maximum is %2$s seconds."
2452
+ msgstr ""
2453
+
2454
+ #: admin/tpl/settings_general.php:80
2455
  msgid "Default Front Page TTL"
2456
  msgstr ""
2457
 
2458
+ #: admin/tpl/settings_general.php:85
2459
  msgid ""
2460
  "Specify how long, in seconds, the front page is cached. Minimum is 30 "
2461
  "seconds."
2462
  msgstr ""
2463
 
2464
+ #: admin/tpl/settings_general.php:92
2465
  msgid "Default Feed TTL"
2466
  msgstr ""
2467
 
2468
+ #: admin/tpl/settings_general.php:97
2469
  msgid "Specify how long, in seconds, feeds are cached."
2470
  msgstr ""
2471
 
2472
+ #: admin/tpl/settings_general.php:98
2473
  msgid "If this is set to a number less than 30, feeds will not be cached."
2474
  msgstr ""
2475
 
2476
+ #: admin/tpl/settings_general.php:105
2477
  msgid "Default 404 Page TTL"
2478
  msgstr ""
2479
 
2480
+ #: admin/tpl/settings_general.php:110
2481
  msgid "Specify how long, in seconds, 404 pages are cached."
2482
  msgstr ""
2483
 
2484
+ #: admin/tpl/settings_general.php:111
2485
  msgid "If this is set to a number less than 30, 404 pages will not be cached."
2486
  msgstr ""
2487
 
2488
+ #: admin/tpl/settings_general.php:118
2489
  msgid "Default 403 Page TTL"
2490
  msgstr ""
2491
 
2492
+ #: admin/tpl/settings_general.php:123
2493
  msgid "Specify how long, in seconds, 403 pages are cached."
2494
  msgstr ""
2495
 
2496
+ #: admin/tpl/settings_general.php:124
2497
  msgid "If this is set to a number less than 30, 403 pages will not be cached."
2498
  msgstr ""
2499
 
2500
+ #: admin/tpl/settings_general.php:131
2501
  msgid "Default 500 Page TTL"
2502
  msgstr ""
2503
 
2504
+ #: admin/tpl/settings_general.php:136
2505
  msgid "Specify how long, in seconds, 500 pages are cached."
2506
  msgstr ""
2507
 
2508
+ #: admin/tpl/settings_general.php:137
2509
  msgid "If this is set to a number less than 30, 500 pages will not be cached."
2510
  msgstr ""
2511
 
2519
 
2520
  #: admin/tpl/settings_inc.cache_favicon.php:12
2521
  msgid ""
2522
+ "Caching this resource may improve server performance by avoiding unnecessary "
2523
  "PHP calls."
2524
  msgstr ""
2525
 
2628
  "or WordPress core is upgraded."
2629
  msgstr ""
2630
 
2631
+ #: admin/tpl/settings_optimize.php:7
2632
+ msgid "Optimization Settings"
2633
+ msgstr ""
2634
+
2635
+ #: admin/tpl/settings_optimize.php:11
2636
+ msgid ""
2637
+ "Please test thoroughly when enabling any option in this list. After changing "
2638
+ "Minify/Combine settings, please do a Purge All action."
2639
+ msgstr ""
2640
+
2641
+ #: admin/tpl/settings_optimize.php:17
2642
+ msgid "CSS Minify"
2643
+ msgstr ""
2644
+
2645
+ #: admin/tpl/settings_optimize.php:21
2646
+ msgid "Minify CSS files."
2647
+ msgstr ""
2648
+
2649
+ #: admin/tpl/settings_optimize.php:27
2650
+ msgid "CSS Combine"
2651
+ msgstr ""
2652
+
2653
+ #: admin/tpl/settings_optimize.php:31
2654
+ msgid "Combine CSS files."
2655
+ msgstr ""
2656
+
2657
+ #: admin/tpl/settings_optimize.php:37
2658
+ msgid "CSS HTTP/2 Push"
2659
+ msgstr ""
2660
+
2661
+ #: admin/tpl/settings_optimize.php:41
2662
+ msgid ""
2663
+ "Pre-send internal CSS files to the browser before they are requested. "
2664
+ "(Requires the HTTP/2 protocol)"
2665
+ msgstr ""
2666
+
2667
+ #: admin/tpl/settings_optimize.php:47
2668
+ msgid "CSS Excludes"
2669
+ msgstr ""
2670
+
2671
+ #: admin/tpl/settings_optimize.php:51
2672
+ msgid ""
2673
+ "Listed CSS files will not be minified/combined. The full URL or a partial "
2674
+ "string can be used."
2675
+ msgstr ""
2676
+
2677
+ #: admin/tpl/settings_optimize.php:57
2678
+ msgid "JS Minify"
2679
+ msgstr ""
2680
+
2681
+ #: admin/tpl/settings_optimize.php:61
2682
+ msgid "Minify JS files."
2683
+ msgstr ""
2684
+
2685
+ #: admin/tpl/settings_optimize.php:67
2686
+ msgid "JS Combine"
2687
+ msgstr ""
2688
+
2689
+ #: admin/tpl/settings_optimize.php:71
2690
+ msgid "Combine JS files."
2691
+ msgstr ""
2692
+
2693
+ #: admin/tpl/settings_optimize.php:77
2694
+ msgid "JS HTTP/2 Push"
2695
+ msgstr ""
2696
+
2697
+ #: admin/tpl/settings_optimize.php:81
2698
+ msgid ""
2699
+ "Pre-send internal JS files to the browser before they are requested. "
2700
+ "(Requires the HTTP/2 protocol)"
2701
+ msgstr ""
2702
+
2703
+ #: admin/tpl/settings_optimize.php:87
2704
+ msgid "JS Excludes"
2705
+ msgstr ""
2706
+
2707
+ #: admin/tpl/settings_optimize.php:91
2708
+ msgid ""
2709
+ "Listed JS files will not be minified/combined. The full URL or a partial "
2710
+ "string can be used."
2711
+ msgstr ""
2712
+
2713
+ #: admin/tpl/settings_optimize.php:97
2714
+ msgid "CSS/JS Cache TTL"
2715
+ msgstr ""
2716
+
2717
+ #: admin/tpl/settings_optimize.php:102
2718
+ msgid ""
2719
+ "Specify how long, in seconds, CSS/JS files are cached. Minimum is %1$s "
2720
+ "seconds."
2721
+ msgstr ""
2722
+
2723
+ #: admin/tpl/settings_optimize.php:109
2724
+ msgid "HTML Minify"
2725
+ msgstr ""
2726
+
2727
+ #: admin/tpl/settings_optimize.php:113
2728
+ msgid "Minify HTML content."
2729
+ msgstr ""
2730
+
2731
  #: admin/tpl/settings_purge.php:5
2732
  msgid "Purge Settings"
2733
  msgstr ""
2780
  msgid "Auto Purge Rules For Publish/Update"
2781
  msgstr ""
2782
 
2783
+ #: admin/tpl/settings_purge.php:47
2784
+ #: thirdparty/lscwp-3rd-woocommerce.cls.php:654
2785
  msgid "Note:"
2786
  msgstr ""
2787
 
2788
+ #: admin/tpl/settings_purge.php:49
2789
  msgid ""
2790
  "Select \"All\" if there are dynamic widgets linked to posts on pages other "
2791
  "than the front or home pages."
2792
  msgstr ""
2793
 
2794
+ #: admin/tpl/settings_purge.php:50
2795
  msgid "Other checkboxes will be ignored."
2796
  msgstr ""
2797
 
2798
+ #: admin/tpl/settings_purge.php:51
2799
  msgid ""
2800
  "Select only the archive types that are currently used, the others can be "
2801
  "left unchecked."
2802
  msgstr ""
2803
 
2804
+ #: admin/tpl/settings_purge.php:67
2805
  msgid ""
2806
  "Select which pages will be automatically purged when posts are published/"
2807
  "updated."
2808
  msgstr ""
2809
 
2810
+ #: admin/tpl/settings_purge.php:73 admin/tpl/settings_purge.php:89
2811
  msgid "Scheduled Purge URLs"
2812
  msgstr ""
2813
 
2814
+ #: admin/tpl/settings_purge.php:77
2815
  msgid ""
2816
  "The URLs here (one per line) will be purged automatically at the time set in "
2817
  "the option \"%s\"."
2818
  msgstr ""
2819
 
2820
+ #: admin/tpl/settings_purge.php:77 admin/tpl/settings_purge.php:84
2821
  msgid "Scheduled Purge Time"
2822
  msgstr ""
2823
 
2824
+ #: admin/tpl/settings_purge.php:78
2825
  msgid "Both %1$s and %2$s are acceptable."
2826
  msgstr ""
2827
 
2828
+ #: admin/tpl/settings_purge.php:89
2829
  msgid "Specify the time to purge the \"%s\" list."
2830
  msgstr ""
2831
 
2832
+ #: admin/tpl/settings_purge.php:90
2833
  msgid "Current server time is %s."
2834
  msgstr ""
2835
 
2953
  msgid "Reached end of sitemap file. Crawling completed."
2954
  msgstr ""
2955
 
2956
+ #: includes/litespeed-cache-purge.class.php:202
2957
  msgid "Purge category %s"
2958
  msgstr ""
2959
 
2960
+ #: includes/litespeed-cache-purge.class.php:229
2961
  msgid "Purge Post ID %s"
2962
  msgstr ""
2963
 
2964
+ #: includes/litespeed-cache-purge.class.php:258
2965
  msgid "Purge tag %s"
2966
  msgstr ""
2967
 
2968
+ #: includes/litespeed-cache-purge.class.php:292
2969
  msgid "Purge url %s"
2970
  msgstr ""
2971
 
2973
  msgid "LiteSpeed Cache Custom Cron"
2974
  msgstr ""
2975
 
2976
+ #: includes/litespeed-cache.class.php:205
2977
  msgid "Crawler blacklist is saved."
2978
  msgstr ""
2979
 
2980
+ #: includes/litespeed-cache.class.php:210
2981
  msgid "Notified LiteSpeed Web Server to purge the front page."
2982
  msgstr ""
2983
 
2984
+ #: includes/litespeed-cache.class.php:215
2985
  msgid "Notified LiteSpeed Web Server to purge pages."
2986
  msgstr ""
2987
 
2988
+ #: includes/litespeed-cache.class.php:220
2989
+ msgid "Notified LiteSpeed Web Server to purge CSS/JS entries."
2990
+ msgstr ""
2991
+
2992
+ #: includes/litespeed-cache.class.php:225
2993
  msgid "Notified LiteSpeed Web Server to purge error pages."
2994
  msgstr ""
2995
 
2996
+ #: includes/litespeed-cache.class.php:231
2997
  msgid "Notified LiteSpeed Web Server to purge all caches."
2998
  msgstr ""
2999
 
3000
+ #: includes/litespeed-cache.class.php:238
3001
  msgid "Notified LiteSpeed Web Server to purge everything."
3002
  msgstr ""
3003
 
3004
+ #: includes/litespeed-cache.class.php:243
3005
  msgid "Notified LiteSpeed Web Server to purge the list."
3006
  msgstr ""
3007
 
3037
  msgid "Cannot read meta file: %s"
3038
  msgstr ""
3039
 
3040
+ #: lib/litespeed/litespeed-file.class.php:115
3041
  msgid "Folder does not exist: %s"
3042
  msgstr ""
3043
 
3044
+ #: lib/litespeed/litespeed-file.class.php:124
3045
  msgid "Can not create folder: %1$s. Error: %2$s"
3046
  msgstr ""
3047
 
3048
+ #: lib/litespeed/litespeed-file.class.php:132
3049
  msgid "Folder is not writable: %s."
3050
  msgstr ""
3051
 
3052
+ #: lib/litespeed/litespeed-file.class.php:139
3053
+ #: lib/litespeed/litespeed-file.class.php:144
3054
  msgid "File %s is not writable."
3055
  msgstr ""
3056
 
3057
+ #: lib/litespeed/litespeed-file.class.php:149
3058
  msgid "Failed to write to %s."
3059
  msgstr ""
3060
 
3061
+ #: thirdparty/lscwp-3rd-woocommerce.cls.php:598
3062
  msgid "WooCommerce"
3063
  msgstr ""
3064
 
3065
+ #: thirdparty/lscwp-3rd-woocommerce.cls.php:601
3066
  msgid "Purge product on changes to the quantity or stock status."
3067
  msgstr ""
3068
 
3069
+ #: thirdparty/lscwp-3rd-woocommerce.cls.php:602
3070
  msgid "Purge categories only when stock status changes."
3071
  msgstr ""
3072
 
3073
+ #: thirdparty/lscwp-3rd-woocommerce.cls.php:603
3074
  msgid "Purge product and categories only when the stock status changes."
3075
  msgstr ""
3076
 
3077
+ #: thirdparty/lscwp-3rd-woocommerce.cls.php:604
3078
  msgid "Purge product only when the stock status changes."
3079
  msgstr ""
3080
 
3081
+ #: thirdparty/lscwp-3rd-woocommerce.cls.php:605
3082
  msgid "Do not purge categories on changes to the quantity or stock status."
3083
  msgstr ""
3084
 
3085
+ #: thirdparty/lscwp-3rd-woocommerce.cls.php:606
3086
  msgid ""
3087
  "Always purge both product and categories on changes to the quantity or stock "
3088
  "status."
3089
  msgstr ""
3090
 
3091
+ #: thirdparty/lscwp-3rd-woocommerce.cls.php:609
3092
  msgid ""
3093
  "Determines how changes in product quantity and product stock status affect "
3094
  "product pages and their associated category pages."
3095
  msgstr ""
3096
 
3097
+ #: thirdparty/lscwp-3rd-woocommerce.cls.php:610
3098
  msgid ""
3099
  "Checking this option will force the shop page to use the front page TTL "
3100
  "setting."
3101
  msgstr ""
3102
 
3103
+ #: thirdparty/lscwp-3rd-woocommerce.cls.php:611
3104
  msgid ""
3105
  "For example, if the homepage for the site is located at %1$s, the shop page "
3106
  "may be located at %2$s."
3107
  msgstr ""
3108
 
3109
+ #: thirdparty/lscwp-3rd-woocommerce.cls.php:639
3110
  msgid "Product Update Interval"
3111
  msgstr ""
3112
 
3113
+ #: thirdparty/lscwp-3rd-woocommerce.cls.php:646
3114
  msgid "Use Front Page TTL for the Shop Page"
3115
  msgstr ""
3116
 
3117
+ #: thirdparty/lscwp-3rd-woocommerce.cls.php:656
3118
  msgid "After verifying that the cache works in general, please test the cart."
3119
  msgstr ""
3120
 
3121
+ #: thirdparty/lscwp-3rd-woocommerce.cls.php:657
3122
  msgid "To test the cart, visit the %s."
3123
  msgstr ""
3124
 
lib/litespeed/litespeed-crawler.class.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * @since 1.1.0
6
  */
7
- require_once LSWCP_DIR . 'lib/litespeed-php-compatibility.func.php' ;
8
 
9
  class Litespeed_Crawler
10
  {
4
  *
5
  * @since 1.1.0
6
  */
7
+ LiteSpeed_Cache_Utility::compatibility() ;
8
 
9
  class Litespeed_Crawler
10
  {
lib/litespeed/litespeed-file.class.php CHANGED
@@ -6,9 +6,11 @@
6
  * @since 1.1.0
7
  */
8
 
9
- function litespeed_exception_error_handler($errno, $errstr, $errfile, $errline )
10
- {
11
- throw new ErrorException($errstr, 0, $errno, $errfile, $errline) ;
 
 
12
  }
13
 
14
  class Litespeed_File
@@ -113,7 +115,7 @@ class Litespeed_File
113
  return $silence ? false : sprintf( __( 'Folder does not exist: %s', 'litespeed-cache' ), $folder ) ;
114
  }
115
 
116
- set_error_handler( 'litespeed_exception_error_handler' ) ;
117
 
118
  try {
119
  mkdir( $folder, 0755, true ) ;
@@ -129,7 +131,7 @@ class Litespeed_File
129
  if ( ! is_writable( $folder ) ) {
130
  return $silence ? false : sprintf( __( 'Folder is not writable: %s.', 'litespeed-cache' ), $folder ) ;
131
  }
132
- set_error_handler( 'litespeed_exception_error_handler' ) ;
133
  try {
134
  touch( $filename ) ;
135
  }
@@ -295,7 +297,7 @@ class Litespeed_File
295
  if ( ! is_writable( dirname($filename) ) ) {
296
  return false ;
297
  }
298
- set_error_handler("litespeed_exception_error_handler") ;
299
  try {
300
  touch($filename) ;
301
  }
6
  * @since 1.1.0
7
  */
8
 
9
+ if ( ! function_exists( 'litespeed_exception_handler' ) ) {
10
+ function litespeed_exception_handler( $errno, $errstr, $errfile, $errline )
11
+ {
12
+ throw new ErrorException($errstr, 0, $errno, $errfile, $errline) ;
13
+ }
14
  }
15
 
16
  class Litespeed_File
115
  return $silence ? false : sprintf( __( 'Folder does not exist: %s', 'litespeed-cache' ), $folder ) ;
116
  }
117
 
118
+ set_error_handler( 'litespeed_exception_handler' ) ;
119
 
120
  try {
121
  mkdir( $folder, 0755, true ) ;
131
  if ( ! is_writable( $folder ) ) {
132
  return $silence ? false : sprintf( __( 'Folder is not writable: %s.', 'litespeed-cache' ), $folder ) ;
133
  }
134
+ set_error_handler( 'litespeed_exception_handler' ) ;
135
  try {
136
  touch( $filename ) ;
137
  }
297
  if ( ! is_writable( dirname($filename) ) ) {
298
  return false ;
299
  }
300
+ set_error_handler("litespeed_exception_handler") ;
301
  try {
302
  touch($filename) ;
303
  }
lib/vendor/autoload.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload.php @generated by Composer
4
+
5
+ require_once __DIR__ . '/composer/autoload_real.php';
6
+
7
+ return ComposerAutoloaderInit0249c86755a3b6966adbcca521d25c22::getLoader();
lib/vendor/bin/cssmin ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env php
2
+ <?php
3
+
4
+ use tubalmartin\CssMin\Command;
5
+
6
+ $autoloadPath = null;
7
+ $autoloadPaths = array(
8
+ __DIR__ . '/../../autoload.php',
9
+ __DIR__ . '/../vendor/autoload.php',
10
+ __DIR__ . '/vendor/autoload.php'
11
+ );
12
+
13
+ foreach ($autoloadPaths as $file) {
14
+ if (file_exists($file)) {
15
+ $autoloadPath = $file;
16
+ break;
17
+ }
18
+ }
19
+
20
+ unset($file);
21
+ unset($autoloadPaths);
22
+
23
+ if (is_null($autoloadPath)) {
24
+ fwrite(
25
+ STDERR,
26
+ 'You need to set up the project dependencies using Composer:' . PHP_EOL . PHP_EOL .
27
+ ' composer install' . PHP_EOL . PHP_EOL .
28
+ 'You can learn all about Composer on https://getcomposer.org/.' . PHP_EOL
29
+ );
30
+ die(1);
31
+ }
32
+
33
+ require $autoloadPath;
34
+
35
+ unset($autoloadPath);
36
+
37
+ Command::main();
lib/vendor/composer/ClassLoader.php ADDED
@@ -0,0 +1,445 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of Composer.
5
+ *
6
+ * (c) Nils Adermann <naderman@naderman.de>
7
+ * Jordi Boggiano <j.boggiano@seld.be>
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
+
13
+ namespace Composer\Autoload;
14
+
15
+ /**
16
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
17
+ *
18
+ * $loader = new \Composer\Autoload\ClassLoader();
19
+ *
20
+ * // register classes with namespaces
21
+ * $loader->add('Symfony\Component', __DIR__.'/component');
22
+ * $loader->add('Symfony', __DIR__.'/framework');
23
+ *
24
+ * // activate the autoloader
25
+ * $loader->register();
26
+ *
27
+ * // to enable searching the include path (eg. for PEAR packages)
28
+ * $loader->setUseIncludePath(true);
29
+ *
30
+ * In this example, if you try to use a class in the Symfony\Component
31
+ * namespace or one of its children (Symfony\Component\Console for instance),
32
+ * the autoloader will first look for the class under the component/
33
+ * directory, and it will then fallback to the framework/ directory if not
34
+ * found before giving up.
35
+ *
36
+ * This class is loosely based on the Symfony UniversalClassLoader.
37
+ *
38
+ * @author Fabien Potencier <fabien@symfony.com>
39
+ * @author Jordi Boggiano <j.boggiano@seld.be>
40
+ * @see http://www.php-fig.org/psr/psr-0/
41
+ * @see http://www.php-fig.org/psr/psr-4/
42
+ */
43
+ class ClassLoader
44
+ {
45
+ // PSR-4
46
+ private $prefixLengthsPsr4 = array();
47
+ private $prefixDirsPsr4 = array();
48
+ private $fallbackDirsPsr4 = array();
49
+
50
+ // PSR-0
51
+ private $prefixesPsr0 = array();
52
+ private $fallbackDirsPsr0 = array();
53
+
54
+ private $useIncludePath = false;
55
+ private $classMap = array();
56
+ private $classMapAuthoritative = false;
57
+ private $missingClasses = array();
58
+ private $apcuPrefix;
59
+
60
+ public function getPrefixes()
61
+ {
62
+ if (!empty($this->prefixesPsr0)) {
63
+ return call_user_func_array('array_merge', $this->prefixesPsr0);
64
+ }
65
+
66
+ return array();
67
+ }
68
+
69
+ public function getPrefixesPsr4()
70
+ {
71
+ return $this->prefixDirsPsr4;
72
+ }
73
+
74
+ public function getFallbackDirs()
75
+ {
76
+ return $this->fallbackDirsPsr0;
77
+ }
78
+
79
+ public function getFallbackDirsPsr4()
80
+ {
81
+ return $this->fallbackDirsPsr4;
82
+ }
83
+
84
+ public function getClassMap()
85
+ {
86
+ return $this->classMap;
87
+ }
88
+
89
+ /**
90
+ * @param array $classMap Class to filename map
91
+ */
92
+ public function addClassMap(array $classMap)
93
+ {
94
+ if ($this->classMap) {
95
+ $this->classMap = array_merge($this->classMap, $classMap);
96
+ } else {
97
+ $this->classMap = $classMap;
98
+ }
99
+ }
100
+
101
+ /**
102
+ * Registers a set of PSR-0 directories for a given prefix, either
103
+ * appending or prepending to the ones previously set for this prefix.
104
+ *
105
+ * @param string $prefix The prefix
106
+ * @param array|string $paths The PSR-0 root directories
107
+ * @param bool $prepend Whether to prepend the directories
108
+ */
109
+ public function add($prefix, $paths, $prepend = false)
110
+ {
111
+ if (!$prefix) {
112
+ if ($prepend) {
113
+ $this->fallbackDirsPsr0 = array_merge(
114
+ (array) $paths,
115
+ $this->fallbackDirsPsr0
116
+ );
117
+ } else {
118
+ $this->fallbackDirsPsr0 = array_merge(
119
+ $this->fallbackDirsPsr0,
120
+ (array) $paths
121
+ );
122
+ }
123
+
124
+ return;
125
+ }
126
+
127
+ $first = $prefix[0];
128
+ if (!isset($this->prefixesPsr0[$first][$prefix])) {
129
+ $this->prefixesPsr0[$first][$prefix] = (array) $paths;
130
+
131
+ return;
132
+ }
133
+ if ($prepend) {
134
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
135
+ (array) $paths,
136
+ $this->prefixesPsr0[$first][$prefix]
137
+ );
138
+ } else {
139
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
140
+ $this->prefixesPsr0[$first][$prefix],
141
+ (array) $paths
142
+ );
143
+ }
144
+ }
145
+
146
+ /**
147
+ * Registers a set of PSR-4 directories for a given namespace, either
148
+ * appending or prepending to the ones previously set for this namespace.
149
+ *
150
+ * @param string $prefix The prefix/namespace, with trailing '\\'
151
+ * @param array|string $paths The PSR-4 base directories
152
+ * @param bool $prepend Whether to prepend the directories
153
+ *
154
+ * @throws \InvalidArgumentException
155
+ */
156
+ public function addPsr4($prefix, $paths, $prepend = false)
157
+ {
158
+ if (!$prefix) {
159
+ // Register directories for the root namespace.
160
+ if ($prepend) {
161
+ $this->fallbackDirsPsr4 = array_merge(
162
+ (array) $paths,
163
+ $this->fallbackDirsPsr4
164
+ );
165
+ } else {
166
+ $this->fallbackDirsPsr4 = array_merge(
167
+ $this->fallbackDirsPsr4,
168
+ (array) $paths
169
+ );
170
+ }
171
+ } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
172
+ // Register directories for a new namespace.
173
+ $length = strlen($prefix);
174
+ if ('\\' !== $prefix[$length - 1]) {
175
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
176
+ }
177
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
178
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
179
+ } elseif ($prepend) {
180
+ // Prepend directories for an already registered namespace.
181
+ $this->prefixDirsPsr4[$prefix] = array_merge(
182
+ (array) $paths,
183
+ $this->prefixDirsPsr4[$prefix]
184
+ );
185
+ } else {
186
+ // Append directories for an already registered namespace.
187
+ $this->prefixDirsPsr4[$prefix] = array_merge(
188
+ $this->prefixDirsPsr4[$prefix],
189
+ (array) $paths
190
+ );
191
+ }
192
+ }
193
+
194
+ /**
195
+ * Registers a set of PSR-0 directories for a given prefix,
196
+ * replacing any others previously set for this prefix.
197
+ *
198
+ * @param string $prefix The prefix
199
+ * @param array|string $paths The PSR-0 base directories
200
+ */
201
+ public function set($prefix, $paths)
202
+ {
203
+ if (!$prefix) {
204
+ $this->fallbackDirsPsr0 = (array) $paths;
205
+ } else {
206
+ $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
207
+ }
208
+ }
209
+
210
+ /**
211
+ * Registers a set of PSR-4 directories for a given namespace,
212
+ * replacing any others previously set for this namespace.
213
+ *
214
+ * @param string $prefix The prefix/namespace, with trailing '\\'
215
+ * @param array|string $paths The PSR-4 base directories
216
+ *
217
+ * @throws \InvalidArgumentException
218
+ */
219
+ public function setPsr4($prefix, $paths)
220
+ {
221
+ if (!$prefix) {
222
+ $this->fallbackDirsPsr4 = (array) $paths;
223
+ } else {
224
+ $length = strlen($prefix);
225
+ if ('\\' !== $prefix[$length - 1]) {
226
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
227
+ }
228
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
229
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
230
+ }
231
+ }
232
+
233
+ /**
234
+ * Turns on searching the include path for class files.
235
+ *
236
+ * @param bool $useIncludePath
237
+ */
238
+ public function setUseIncludePath($useIncludePath)
239
+ {
240
+ $this->useIncludePath = $useIncludePath;
241
+ }
242
+
243
+ /**
244
+ * Can be used to check if the autoloader uses the include path to check
245
+ * for classes.
246
+ *
247
+ * @return bool
248
+ */
249
+ public function getUseIncludePath()
250
+ {
251
+ return $this->useIncludePath;
252
+ }
253
+
254
+ /**
255
+ * Turns off searching the prefix and fallback directories for classes
256
+ * that have not been registered with the class map.
257
+ *
258
+ * @param bool $classMapAuthoritative
259
+ */
260
+ public function setClassMapAuthoritative($classMapAuthoritative)
261
+ {
262
+ $this->classMapAuthoritative = $classMapAuthoritative;
263
+ }
264
+
265
+ /**
266
+ * Should class lookup fail if not found in the current class map?
267
+ *
268
+ * @return bool
269
+ */
270
+ public function isClassMapAuthoritative()
271
+ {
272
+ return $this->classMapAuthoritative;
273
+ }
274
+
275
+ /**
276
+ * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
277
+ *
278
+ * @param string|null $apcuPrefix
279
+ */
280
+ public function setApcuPrefix($apcuPrefix)
281
+ {
282
+ $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
283
+ }
284
+
285
+ /**
286
+ * The APCu prefix in use, or null if APCu caching is not enabled.
287
+ *
288
+ * @return string|null
289
+ */
290
+ public function getApcuPrefix()
291
+ {
292
+ return $this->apcuPrefix;
293
+ }
294
+
295
+ /**
296
+ * Registers this instance as an autoloader.
297
+ *
298
+ * @param bool $prepend Whether to prepend the autoloader or not
299
+ */
300
+ public function register($prepend = false)
301
+ {
302
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
303
+ }
304
+
305
+ /**
306
+ * Unregisters this instance as an autoloader.
307
+ */
308
+ public function unregister()
309
+ {
310
+ spl_autoload_unregister(array($this, 'loadClass'));
311
+ }
312
+
313
+ /**
314
+ * Loads the given class or interface.
315
+ *
316
+ * @param string $class The name of the class
317
+ * @return bool|null True if loaded, null otherwise
318
+ */
319
+ public function loadClass($class)
320
+ {
321
+ if ($file = $this->findFile($class)) {
322
+ includeFile($file);
323
+
324
+ return true;
325
+ }
326
+ }
327
+
328
+ /**
329
+ * Finds the path to the file where the class is defined.
330
+ *
331
+ * @param string $class The name of the class
332
+ *
333
+ * @return string|false The path if found, false otherwise
334
+ */
335
+ public function findFile($class)
336
+ {
337
+ // class map lookup
338
+ if (isset($this->classMap[$class])) {
339
+ return $this->classMap[$class];
340
+ }
341
+ if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
342
+ return false;
343
+ }
344
+ if (null !== $this->apcuPrefix) {
345
+ $file = apcu_fetch($this->apcuPrefix.$class, $hit);
346
+ if ($hit) {
347
+ return $file;
348
+ }
349
+ }
350
+
351
+ $file = $this->findFileWithExtension($class, '.php');
352
+
353
+ // Search for Hack files if we are running on HHVM
354
+ if (false === $file && defined('HHVM_VERSION')) {
355
+ $file = $this->findFileWithExtension($class, '.hh');
356
+ }
357
+
358
+ if (null !== $this->apcuPrefix) {
359
+ apcu_add($this->apcuPrefix.$class, $file);
360
+ }
361
+
362
+ if (false === $file) {
363
+ // Remember that this class does not exist.
364
+ $this->missingClasses[$class] = true;
365
+ }
366
+
367
+ return $file;
368
+ }
369
+
370
+ private function findFileWithExtension($class, $ext)
371
+ {
372
+ // PSR-4 lookup
373
+ $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
374
+
375
+ $first = $class[0];
376
+ if (isset($this->prefixLengthsPsr4[$first])) {
377
+ $subPath = $class;
378
+ while (false !== $lastPos = strrpos($subPath, '\\')) {
379
+ $subPath = substr($subPath, 0, $lastPos);
380
+ $search = $subPath.'\\';
381
+ if (isset($this->prefixDirsPsr4[$search])) {
382
+ foreach ($this->prefixDirsPsr4[$search] as $dir) {
383
+ $length = $this->prefixLengthsPsr4[$first][$search];
384
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
385
+ return $file;
386
+ }
387
+ }
388
+ }
389
+ }
390
+ }
391
+
392
+ // PSR-4 fallback dirs
393
+ foreach ($this->fallbackDirsPsr4 as $dir) {
394
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
395
+ return $file;
396
+ }
397
+ }
398
+
399
+ // PSR-0 lookup
400
+ if (false !== $pos = strrpos($class, '\\')) {
401
+ // namespaced class name
402
+ $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
403
+ . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
404
+ } else {
405
+ // PEAR-like class name
406
+ $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
407
+ }
408
+
409
+ if (isset($this->prefixesPsr0[$first])) {
410
+ foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
411
+ if (0 === strpos($class, $prefix)) {
412
+ foreach ($dirs as $dir) {
413
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
414
+ return $file;
415
+ }
416
+ }
417
+ }
418
+ }
419
+ }
420
+
421
+ // PSR-0 fallback dirs
422
+ foreach ($this->fallbackDirsPsr0 as $dir) {
423
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
424
+ return $file;
425
+ }
426
+ }
427
+
428
+ // PSR-0 include paths.
429
+ if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
430
+ return $file;
431
+ }
432
+
433
+ return false;
434
+ }
435
+ }
436
+
437
+ /**
438
+ * Scope isolated include.
439
+ *
440
+ * Prevents access to $this/self from included files.
441
+ */
442
+ function includeFile($file)
443
+ {
444
+ include $file;
445
+ }
lib/vendor/composer/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Copyright (c) Nils Adermann, Jordi Boggiano
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished
9
+ to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ THE SOFTWARE.
21
+
lib/vendor/composer/autoload_classmap.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_classmap.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ 'HTTP_ConditionalGet' => $vendorDir . '/mrclay/minify/lib/HTTP/ConditionalGet.php',
10
+ 'HTTP_Encoder' => $vendorDir . '/mrclay/minify/lib/HTTP/Encoder.php',
11
+ 'Minify' => $vendorDir . '/mrclay/minify/lib/Minify.php',
12
+ 'Minify\\App' => $vendorDir . '/mrclay/minify/lib/Minify/App.php',
13
+ 'Minify\\Config' => $vendorDir . '/mrclay/minify/lib/Minify/Config.php',
14
+ 'Minify\\JS\\JShrink' => $vendorDir . '/mrclay/minify/lib/Minify/JS/JShrink.php',
15
+ 'Minify\\Logger\\LegacyHandler' => $vendorDir . '/mrclay/minify/lib/Minify/Logger/LegacyHandler.php',
16
+ 'Minify_Build' => $vendorDir . '/mrclay/minify/lib/Minify/Build.php',
17
+ 'Minify_CSS' => $vendorDir . '/mrclay/minify/lib/Minify/CSS.php',
18
+ 'Minify_CSS_Compressor' => $vendorDir . '/mrclay/minify/lib/Minify/CSS/Compressor.php',
19
+ 'Minify_CSS_UriRewriter' => $vendorDir . '/mrclay/minify/lib/Minify/CSS/UriRewriter.php',
20
+ 'Minify_CSSmin' => $vendorDir . '/mrclay/minify/lib/Minify/CSSmin.php',
21
+ 'Minify_CacheInterface' => $vendorDir . '/mrclay/minify/lib/Minify/CacheInterface.php',
22
+ 'Minify_Cache_APC' => $vendorDir . '/mrclay/minify/lib/Minify/Cache/APC.php',
23
+ 'Minify_Cache_File' => $vendorDir . '/mrclay/minify/lib/Minify/Cache/File.php',
24
+ 'Minify_Cache_Memcache' => $vendorDir . '/mrclay/minify/lib/Minify/Cache/Memcache.php',
25
+ 'Minify_Cache_Null' => $vendorDir . '/mrclay/minify/lib/Minify/Cache/Null.php',
26
+ 'Minify_Cache_WinCache' => $vendorDir . '/mrclay/minify/lib/Minify/Cache/WinCache.php',
27
+ 'Minify_Cache_XCache' => $vendorDir . '/mrclay/minify/lib/Minify/Cache/XCache.php',
28
+ 'Minify_Cache_ZendPlatform' => $vendorDir . '/mrclay/minify/lib/Minify/Cache/ZendPlatform.php',
29
+ 'Minify_ClosureCompiler' => $vendorDir . '/mrclay/minify/lib/Minify/ClosureCompiler.php',
30
+ 'Minify_ClosureCompiler_Exception' => $vendorDir . '/mrclay/minify/lib/Minify/ClosureCompiler.php',
31
+ 'Minify_CommentPreserver' => $vendorDir . '/mrclay/minify/lib/Minify/CommentPreserver.php',
32
+ 'Minify_ControllerInterface' => $vendorDir . '/mrclay/minify/lib/Minify/ControllerInterface.php',
33
+ 'Minify_Controller_Base' => $vendorDir . '/mrclay/minify/lib/Minify/Controller/Base.php',
34
+ 'Minify_Controller_Files' => $vendorDir . '/mrclay/minify/lib/Minify/Controller/Files.php',
35
+ 'Minify_Controller_Groups' => $vendorDir . '/mrclay/minify/lib/Minify/Controller/Groups.php',
36
+ 'Minify_Controller_MinApp' => $vendorDir . '/mrclay/minify/lib/Minify/Controller/MinApp.php',
37
+ 'Minify_Controller_Page' => $vendorDir . '/mrclay/minify/lib/Minify/Controller/Page.php',
38
+ 'Minify_DebugDetector' => $vendorDir . '/mrclay/minify/lib/Minify/DebugDetector.php',
39
+ 'Minify_Env' => $vendorDir . '/mrclay/minify/lib/Minify/Env.php',
40
+ 'Minify_HTML' => $vendorDir . '/mrclay/minify/lib/Minify/HTML.php',
41
+ 'Minify_HTML_Helper' => $vendorDir . '/mrclay/minify/lib/Minify/HTML/Helper.php',
42
+ 'Minify_ImportProcessor' => $vendorDir . '/mrclay/minify/lib/Minify/ImportProcessor.php',
43
+ 'Minify_JS_ClosureCompiler' => $vendorDir . '/mrclay/minify/lib/Minify/JS/ClosureCompiler.php',
44
+ 'Minify_JS_ClosureCompiler_Exception' => $vendorDir . '/mrclay/minify/lib/Minify/JS/ClosureCompiler.php',
45
+ 'Minify_LessCssSource' => $vendorDir . '/mrclay/minify/lib/Minify/LessCssSource.php',
46
+ 'Minify_Lines' => $vendorDir . '/mrclay/minify/lib/Minify/Lines.php',
47
+ 'Minify_NailgunClosureCompiler' => $vendorDir . '/mrclay/minify/lib/Minify/NailgunClosureCompiler.php',
48
+ 'Minify_Packer' => $vendorDir . '/mrclay/minify/lib/Minify/Packer.php',
49
+ 'Minify_ScssCssSource' => $vendorDir . '/mrclay/minify/lib/Minify/ScssCssSource.php',
50
+ 'Minify_ServeConfiguration' => $vendorDir . '/mrclay/minify/lib/Minify/ServeConfiguration.php',
51
+ 'Minify_Source' => $vendorDir . '/mrclay/minify/lib/Minify/Source.php',
52
+ 'Minify_SourceInterface' => $vendorDir . '/mrclay/minify/lib/Minify/SourceInterface.php',
53
+ 'Minify_SourceSet' => $vendorDir . '/mrclay/minify/lib/Minify/SourceSet.php',
54
+ 'Minify_Source_Factory' => $vendorDir . '/mrclay/minify/lib/Minify/Source/Factory.php',
55
+ 'Minify_Source_FactoryException' => $vendorDir . '/mrclay/minify/lib/Minify/Source/FactoryException.php',
56
+ 'Minify_YUICompressor' => $vendorDir . '/mrclay/minify/lib/Minify/YUICompressor.php',
57
+ 'MrClay\\Cli' => $vendorDir . '/mrclay/minify/lib/MrClay/Cli.php',
58
+ 'MrClay\\Cli\\Arg' => $vendorDir . '/mrclay/minify/lib/MrClay/Cli/Arg.php',
59
+ );
lib/vendor/composer/autoload_namespaces.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_namespaces.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ 'Props\\' => array($vendorDir . '/mrclay/props-dic/src', $vendorDir . '/mrclay/props-dic/test'),
10
+ 'Pimple' => array($vendorDir . '/pimple/pimple/src'),
11
+ 'JSMin\\' => array($vendorDir . '/mrclay/jsmin-php/src'),
12
+ );
lib/vendor/composer/autoload_psr4.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_psr4.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ 'tubalmartin\\CssMin\\' => array($vendorDir . '/tubalmartin/cssmin/src'),
10
+ 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
11
+ 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
12
+ 'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'),
13
+ 'Intervention\\Httpauth\\' => array($vendorDir . '/intervention/httpauth/src/Intervention/Httpauth'),
14
+ 'Interop\\Container\\' => array($vendorDir . '/container-interop/container-interop/src/Interop/Container'),
15
+ );
lib/vendor/composer/autoload_real.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_real.php @generated by Composer
4
+
5
+ class ComposerAutoloaderInit0249c86755a3b6966adbcca521d25c22
6
+ {
7
+ private static $loader;
8
+
9
+ public static function loadClassLoader($class)
10
+ {
11
+ if ('Composer\Autoload\ClassLoader' === $class) {
12
+ require __DIR__ . '/ClassLoader.php';
13
+ }
14
+ }
15
+
16
+ public static function getLoader()
17
+ {
18
+ if (null !== self::$loader) {
19
+ return self::$loader;
20
+ }
21
+
22
+ spl_autoload_register(array('ComposerAutoloaderInit0249c86755a3b6966adbcca521d25c22', 'loadClassLoader'), true, true);
23
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit0249c86755a3b6966adbcca521d25c22', 'loadClassLoader'));
25
+
26
+ $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
+ if ($useStaticLoader) {
28
+ require_once __DIR__ . '/autoload_static.php';
29
+
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit0249c86755a3b6966adbcca521d25c22::getInitializer($loader));
31
+ } else {
32
+ $map = require __DIR__ . '/autoload_namespaces.php';
33
+ foreach ($map as $namespace => $path) {
34
+ $loader->set($namespace, $path);
35
+ }
36
+
37
+ $map = require __DIR__ . '/autoload_psr4.php';
38
+ foreach ($map as $namespace => $path) {
39
+ $loader->setPsr4($namespace, $path);
40
+ }
41
+
42
+ $classMap = require __DIR__ . '/autoload_classmap.php';
43
+ if ($classMap) {
44
+ $loader->addClassMap($classMap);
45
+ }
46
+ }
47
+
48
+ $loader->register(true);
49
+
50
+ return $loader;
51
+ }
52
+ }
lib/vendor/composer/autoload_static.php ADDED
@@ -0,0 +1,142 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_static.php @generated by Composer
4
+
5
+ namespace Composer\Autoload;
6
+
7
+ class ComposerStaticInit0249c86755a3b6966adbcca521d25c22
8
+ {
9
+ public static $prefixLengthsPsr4 = array (
10
+ 't' =>
11
+ array (
12
+ 'tubalmartin\\CssMin\\' => 19,
13
+ ),
14
+ 'P' =>
15
+ array (
16
+ 'Psr\\Log\\' => 8,
17
+ 'Psr\\Container\\' => 14,
18
+ ),
19
+ 'M' =>
20
+ array (
21
+ 'Monolog\\' => 8,
22
+ ),
23
+ 'I' =>
24
+ array (
25
+ 'Intervention\\Httpauth\\' => 22,
26
+ 'Interop\\Container\\' => 18,
27
+ ),
28
+ );
29
+
30
+ public static $prefixDirsPsr4 = array (
31
+ 'tubalmartin\\CssMin\\' =>
32
+ array (
33
+ 0 => __DIR__ . '/..' . '/tubalmartin/cssmin/src',
34
+ ),
35
+ 'Psr\\Log\\' =>
36
+ array (
37
+ 0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
38
+ ),
39
+ 'Psr\\Container\\' =>
40
+ array (
41
+ 0 => __DIR__ . '/..' . '/psr/container/src',
42
+ ),
43
+ 'Monolog\\' =>
44
+ array (
45
+ 0 => __DIR__ . '/..' . '/monolog/monolog/src/Monolog',
46
+ ),
47
+ 'Intervention\\Httpauth\\' =>
48
+ array (
49
+ 0 => __DIR__ . '/..' . '/intervention/httpauth/src/Intervention/Httpauth',
50
+ ),
51
+ 'Interop\\Container\\' =>
52
+ array (
53
+ 0 => __DIR__ . '/..' . '/container-interop/container-interop/src/Interop/Container',
54
+ ),
55
+ );
56
+
57
+ public static $prefixesPsr0 = array (
58
+ 'P' =>
59
+ array (
60
+ 'Props\\' =>
61
+ array (
62
+ 0 => __DIR__ . '/..' . '/mrclay/props-dic/src',
63
+ 1 => __DIR__ . '/..' . '/mrclay/props-dic/test',
64
+ ),
65
+ 'Pimple' =>
66
+ array (
67
+ 0 => __DIR__ . '/..' . '/pimple/pimple/src',
68
+ ),
69
+ ),
70
+ 'J' =>
71
+ array (
72
+ 'JSMin\\' =>
73
+ array (
74
+ 0 => __DIR__ . '/..' . '/mrclay/jsmin-php/src',
75
+ ),
76
+ ),
77
+ );
78
+
79
+ public static $classMap = array (
80
+ 'HTTP_ConditionalGet' => __DIR__ . '/..' . '/mrclay/minify/lib/HTTP/ConditionalGet.php',
81
+ 'HTTP_Encoder' => __DIR__ . '/..' . '/mrclay/minify/lib/HTTP/Encoder.php',
82
+ 'Minify' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify.php',
83
+ 'Minify\\App' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/App.php',
84
+ 'Minify\\Config' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Config.php',
85
+ 'Minify\\JS\\JShrink' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/JS/JShrink.php',
86
+ 'Minify\\Logger\\LegacyHandler' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Logger/LegacyHandler.php',
87
+ 'Minify_Build' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Build.php',
88
+ 'Minify_CSS' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/CSS.php',
89
+ 'Minify_CSS_Compressor' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/CSS/Compressor.php',
90
+ 'Minify_CSS_UriRewriter' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/CSS/UriRewriter.php',
91
+ 'Minify_CSSmin' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/CSSmin.php',
92
+ 'Minify_CacheInterface' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/CacheInterface.php',
93
+ 'Minify_Cache_APC' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Cache/APC.php',
94
+ 'Minify_Cache_File' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Cache/File.php',
95
+ 'Minify_Cache_Memcache' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Cache/Memcache.php',
96
+ 'Minify_Cache_Null' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Cache/Null.php',
97
+ 'Minify_Cache_WinCache' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Cache/WinCache.php',
98
+ 'Minify_Cache_XCache' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Cache/XCache.php',
99
+ 'Minify_Cache_ZendPlatform' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Cache/ZendPlatform.php',
100
+ 'Minify_ClosureCompiler' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/ClosureCompiler.php',
101
+ 'Minify_ClosureCompiler_Exception' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/ClosureCompiler.php',
102
+ 'Minify_CommentPreserver' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/CommentPreserver.php',
103
+ 'Minify_ControllerInterface' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/ControllerInterface.php',
104
+ 'Minify_Controller_Base' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Controller/Base.php',
105
+ 'Minify_Controller_Files' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Controller/Files.php',
106
+ 'Minify_Controller_Groups' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Controller/Groups.php',
107
+ 'Minify_Controller_MinApp' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Controller/MinApp.php',
108
+ 'Minify_Controller_Page' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Controller/Page.php',
109
+ 'Minify_DebugDetector' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/DebugDetector.php',
110
+ 'Minify_Env' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Env.php',
111
+ 'Minify_HTML' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/HTML.php',
112
+ 'Minify_HTML_Helper' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/HTML/Helper.php',
113
+ 'Minify_ImportProcessor' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/ImportProcessor.php',
114
+ 'Minify_JS_ClosureCompiler' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/JS/ClosureCompiler.php',
115
+ 'Minify_JS_ClosureCompiler_Exception' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/JS/ClosureCompiler.php',
116
+ 'Minify_LessCssSource' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/LessCssSource.php',
117
+ 'Minify_Lines' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Lines.php',
118
+ 'Minify_NailgunClosureCompiler' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/NailgunClosureCompiler.php',
119
+ 'Minify_Packer' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Packer.php',
120
+ 'Minify_ScssCssSource' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/ScssCssSource.php',
121
+ 'Minify_ServeConfiguration' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/ServeConfiguration.php',
122
+ 'Minify_Source' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Source.php',
123
+ 'Minify_SourceInterface' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/SourceInterface.php',
124
+ 'Minify_SourceSet' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/SourceSet.php',
125
+ 'Minify_Source_Factory' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Source/Factory.php',
126
+ 'Minify_Source_FactoryException' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/Source/FactoryException.php',
127
+ 'Minify_YUICompressor' => __DIR__ . '/..' . '/mrclay/minify/lib/Minify/YUICompressor.php',
128
+ 'MrClay\\Cli' => __DIR__ . '/..' . '/mrclay/minify/lib/MrClay/Cli.php',
129
+ 'MrClay\\Cli\\Arg' => __DIR__ . '/..' . '/mrclay/minify/lib/MrClay/Cli/Arg.php',
130
+ );
131
+
132
+ public static function getInitializer(ClassLoader $loader)
133
+ {
134
+ return \Closure::bind(function () use ($loader) {
135
+ $loader->prefixLengthsPsr4 = ComposerStaticInit0249c86755a3b6966adbcca521d25c22::$prefixLengthsPsr4;
136
+ $loader->prefixDirsPsr4 = ComposerStaticInit0249c86755a3b6966adbcca521d25c22::$prefixDirsPsr4;
137
+ $loader->prefixesPsr0 = ComposerStaticInit0249c86755a3b6966adbcca521d25c22::$prefixesPsr0;
138
+ $loader->classMap = ComposerStaticInit0249c86755a3b6966adbcca521d25c22::$classMap;
139
+
140
+ }, null, ClassLoader::class);
141
+ }
142
+ }
lib/vendor/container-interop/container-interop/LICENSE ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 container-interop
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
lib/vendor/container-interop/container-interop/src/Interop/Container/ContainerInterface.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4
+ */
5
+
6
+ namespace Interop\Container;
7
+
8
+ use Psr\Container\ContainerInterface as PsrContainerInterface;
9
+
10
+ /**
11
+ * Describes the interface of a container that exposes methods to read its entries.
12
+ */
13
+ interface ContainerInterface extends PsrContainerInterface
14
+ {
15
+ }
lib/vendor/container-interop/container-interop/src/Interop/Container/Exception/ContainerException.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4
+ */
5
+
6
+ namespace Interop\Container\Exception;
7
+
8
+ use Psr\Container\ContainerExceptionInterface as PsrContainerException;
9
+
10
+ /**
11
+ * Base interface representing a generic exception in a container.
12
+ */
13
+ interface ContainerException extends PsrContainerException
14
+ {
15
+ }
lib/vendor/container-interop/container-interop/src/Interop/Container/Exception/NotFoundException.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4
+ */
5
+
6
+ namespace Interop\Container\Exception;
7
+
8
+ use Psr\Container\NotFoundExceptionInterface as PsrNotFoundException;
9
+
10
+ /**
11
+ * No entry was found in the container.
12
+ */
13
+ interface NotFoundException extends ContainerException, PsrNotFoundException
14
+ {
15
+ }
lib/vendor/intervention/httpauth/.travis.yml ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ language: php
2
+
3
+ php:
4
+ - 5.3
5
+ - 5.4
6
+
7
+ before_script:
8
+ - curl -s http://getcomposer.org/installer | php
9
+ - php composer.phar install --dev
10
+
11
+ script: phpunit
lib/vendor/intervention/httpauth/LICENSE ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 Oliver Vogel
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
lib/vendor/intervention/httpauth/src/Intervention/Httpauth/BasicUser.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Intervention\Httpauth;
4
+
5
+ class BasicUser implements UserInterface
6
+ {
7
+ /**
8
+ * The loginname of the user
9
+ *
10
+ * @var string
11
+ */
12
+ private $name;
13
+
14
+ /**
15
+ * The password of the user
16
+ *
17
+ * @var password
18
+ */
19
+ private $password;
20
+
21
+ /**
22
+ * Creates a new instance
23
+ */
24
+ public function __construct()
25
+ {
26
+ $this->parse();
27
+ }
28
+
29
+ /**
30
+ * Checks for valid username & password
31
+ *
32
+ * @param string $name
33
+ * @param string $password
34
+ * @return boolean
35
+ */
36
+ public function isValid($name, $password, $realm = null)
37
+ {
38
+ return ($name == $this->name) && ($password == $this->password);
39
+ }
40
+
41
+ /**
42
+ * Parses the User Information from server variables
43
+
44
+ * @return void
45
+ */
46
+ public function parse()
47
+ {
48
+ if(array_key_exists('PHP_AUTH_USER', $_SERVER)) { // mod_php
49
+
50
+ $this->name = $_SERVER['PHP_AUTH_USER'];
51
+ $this->password = array_key_exists('PHP_AUTH_PW', $_SERVER) ? $_SERVER['PHP_AUTH_PW'] : null;
52
+
53
+ } elseif(array_key_exists('HTTP_AUTHENTICATION', $_SERVER)) { // most other servers
54
+
55
+ if(strpos(strtolower($_SERVER['HTTP_AUTHENTICATION']), 'basic') === 0) {
56
+
57
+ $userdata = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHENTICATION'], 6)));
58
+ list($this->name, $this->password) = $userdata;
59
+
60
+ }
61
+ }
62
+ }
63
+ }
lib/vendor/intervention/httpauth/src/Intervention/Httpauth/DigestUser.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Intervention\Httpauth;
4
+
5
+ class DigestUser implements UserInterface
6
+ {
7
+ /**
8
+ * Nonce to discourage cryptanalysis
9
+ *
10
+ * @var string
11
+ */
12
+ private $nonce;
13
+
14
+ /**
15
+ * nc
16
+ * @var string
17
+ */
18
+ private $nc;
19
+
20
+ /**
21
+ * cnonce
22
+ * @var string
23
+ */
24
+ private $cnonce;
25
+
26
+ /**
27
+ * quality of protection
28
+ *
29
+ * @var string
30
+ */
31
+ private $qop;
32
+
33
+ /**
34
+ * Name of user
35
+ *
36
+ * @var string
37
+ */
38
+ private $username;
39
+
40
+ /**
41
+ * Requested uri
42
+ *
43
+ * @var string
44
+ */
45
+ private $uri;
46
+
47
+ /**
48
+ * Response
49
+ *
50
+ * @var string
51
+ */
52
+ private $response;
53
+
54
+ /**
55
+ * Creates a new instance
56
+ */
57
+ public function __construct()
58
+ {
59
+ $this->parse();
60
+ }
61
+
62
+ /**
63
+ * Checks for valid username & password
64
+ *
65
+ * @param string $name
66
+ * @param string $password
67
+ * @return boolean
68
+ */
69
+ public function isValid($name, $password, $realm)
70
+ {
71
+ $request_method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'GET';
72
+ $u1 = md5(sprintf('%s:%s:%s', $this->username, $realm, $password));
73
+ $u2 = md5(sprintf('%s:%s', $request_method, $this->uri));
74
+ $response = md5(sprintf('%s:%s:%s:%s:%s:%s', $u1, $this->nonce, $this->nc, $this->cnonce, $this->qop, $u2));
75
+
76
+ return ($response == $this->response) && ($name == $this->username);
77
+ }
78
+
79
+ /**
80
+ * Parses the User Information from server variables
81
+
82
+ * @return void
83
+ */
84
+ public function parse()
85
+ {
86
+ $digest = $this->getDigest();
87
+ $user = array();
88
+ $required = array('nonce' => 1, 'nc' => 1, 'cnonce' => 1, 'qop' => 1, 'username' => 1, 'uri' => 1, 'response' => 1);
89
+
90
+ preg_match_all('@(\w+)=(?:(?:")([^"]+)"|([^\s,$]+))@', $digest, $matches, PREG_SET_ORDER);
91
+
92
+ if (is_array($matches)) {
93
+ foreach ($matches as $m) {
94
+ $key = $m[1];
95
+ $user[$key] = $m[2] ? $m[2] : $m[3];
96
+ unset($required[$key]);
97
+ }
98
+
99
+ if (count($required) == 0) {
100
+ $this->nonce = $user['nonce'];
101
+ $this->nc = $user['nc'];
102
+ $this->cnonce = $user['cnonce'];
103
+ $this->qop = $user['qop'];
104
+ $this->username = $user['username'];
105
+ $this->uri = $user['uri'];
106
+ $this->response = $user['response'];
107
+ }
108
+ }
109
+ }
110
+
111
+ /**
112
+ * Fetch digest data from environment information
113
+ *
114
+ * @return string
115
+ */
116
+ public function getDigest()
117
+ {
118
+ $digest = null;
119
+
120
+ if (isset($_SERVER['PHP_AUTH_DIGEST'])) {
121
+
122
+ $digest = $_SERVER['PHP_AUTH_DIGEST'];
123
+
124
+ } elseif (isset($_SERVER['HTTP_AUTHORIZATION'])) {
125
+
126
+ if (strpos(strtolower($_SERVER['HTTP_AUTHORIZATION']), 'digest') === 0) {
127
+
128
+ $digest = substr($_SERVER['HTTP_AUTHORIZATION'], 7);
129
+ }
130
+ }
131
+
132
+ return $digest;
133
+ }
134
+ }
lib/vendor/intervention/httpauth/src/Intervention/Httpauth/Facades/Httpauth.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Intervention\Httpauth\Facades;
4
+
5
+ use Illuminate\Support\Facades\Facade;
6
+
7
+ class Httpauth extends Facade
8
+ {
9
+ protected static function getFacadeAccessor()
10
+ {
11
+ return 'httpauth';
12
+ }
13
+ }
lib/vendor/intervention/httpauth/src/Intervention/Httpauth/Httpauth.php ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Intervention\Httpauth;
4
+
5
+ use Exception;
6
+
7
+ class Httpauth
8
+ {
9
+ /**
10
+ * Type of HTTP Authentication
11
+ *
12
+ * @var string
13
+ */
14
+ public $type = 'basic';
15
+
16
+ /**
17
+ * Realm of HTTP Authentication
18
+ *
19
+ * @var string
20
+ */
21
+ public $realm = 'Secured resource';
22
+
23
+ /**
24
+ * Username of HTTP Authentication
25
+ *
26
+ * @var string
27
+ */
28
+ private $username;
29
+
30
+ /**
31
+ * Password of HTTP Authentication
32
+ *
33
+ * @var string
34
+ */
35
+ private $password;
36
+
37
+ /**
38
+ * Creates new instance of Httpauth
39
+ *
40
+ * @param array $parameters set realm, username and/or password as key
41
+ */
42
+
43
+ public function __construct($parameters = null)
44
+ {
45
+ // overwrite settings with runtime parameters (optional)
46
+ if (is_array($parameters)) {
47
+
48
+ if (array_key_exists('type', $parameters)) {
49
+ $this->type = $parameters['type'];
50
+ }
51
+
52
+ if (array_key_exists('realm', $parameters)) {
53
+ $this->realm = $parameters['realm'];
54
+ }
55
+
56
+ if (array_key_exists('username', $parameters)) {
57
+ $this->username = $parameters['username'];
58
+ }
59
+
60
+ if (array_key_exists('password', $parameters)) {
61
+ $this->password = $parameters['password'];
62
+ }
63
+ }
64
+
65
+ // check if at leat username and password is set
66
+ if ( ! $this->username || ! $this->password) {
67
+ throw new Exception('No username or password set for HttpAuthentication.');
68
+ }
69
+ }
70
+
71
+ /**
72
+ * Creates new instance of Httpaccess with given parameters
73
+ *
74
+ * @param array $parameters set realm, username and/or password
75
+ * @return Intervention\Httpauth\Httpauth
76
+ */
77
+ public static function make($parameters = null)
78
+ {
79
+ return new Httpauth($parameters);
80
+ }
81
+
82
+ /**
83
+ * Denies access for not-authenticated users
84
+ *
85
+ * @return void
86
+ */
87
+ public function secure()
88
+ {
89
+ if ( ! $this->validateUser($this->getUser())) {
90
+ $this->denyAccess();
91
+ }
92
+ }
93
+
94
+ /**
95
+ * Checks for valid user
96
+ *
97
+ * @param User $user
98
+ * @return bool
99
+ */
100
+ private function validateUser(UserInterface $user)
101
+ {
102
+ return $user->isValid($this->username, $this->password, $this->realm);
103
+ }
104
+
105
+ /**
106
+ * Checks if username/password combination matches
107
+ *
108
+ * @param string $username
109
+ * @param string $password
110
+ * @return boolean
111
+ */
112
+ public function isValid($username, $password)
113
+ {
114
+ return ($username == $this->username) && ($password == $this->password);
115
+ }
116
+
117
+ /**
118
+ * Sends HTTP 401 Header
119
+ *
120
+ * @return void
121
+ */
122
+ private function denyAccess()
123
+ {
124
+ header('HTTP/1.0 401 Unauthorized');
125
+
126
+ switch (strtolower($this->type)) {
127
+
128
+ case 'digest':
129
+ header('WWW-Authenticate: Digest realm="' . $this->realm .'",qop="auth",nonce="' . uniqid() . '",opaque="' . md5($this->realm) . '"');
130
+ break;
131
+
132
+ default:
133
+ header('WWW-Authenticate: Basic realm="'.$this->realm.'"');
134
+ break;
135
+ }
136
+
137
+ die('<strong>HTTP/1.0 401 Unauthorized</strong>');
138
+ }
139
+
140
+ /**
141
+ * Get User according to current auth type
142
+ *
143
+ * @return Intervention\Httpauth\UserInterface
144
+ */
145
+ private function getUser()
146
+ {
147
+ // set user based on authentication type
148
+ switch (strtolower($this->type)) {
149
+
150
+ case 'digest':
151
+ return new DigestUser;
152
+ break;
153
+
154
+ default:
155
+ return new BasicUser;
156
+ break;
157
+ }
158
+ }
159
+ }
lib/vendor/intervention/httpauth/src/Intervention/Httpauth/HttpauthServiceProvider.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Intervention\Httpauth;
4
+
5
+ use Illuminate\Support\ServiceProvider;
6
+
7
+ class HttpauthServiceProvider extends ServiceProvider
8
+ {
9
+ /**
10
+ * Indicates if loading of the provider is deferred.
11
+ *
12
+ * @var bool
13
+ */
14
+ protected $defer = false;
15
+
16
+ /**
17
+ * Actual provider
18
+ *
19
+ * @var \Illuminate\Support\ServiceProvider
20
+ */
21
+ protected $provider;
22
+
23
+ /**
24
+ * Create a new service provider instance.
25
+ *
26
+ * @param \Illuminate\Contracts\Foundation\Application $app
27
+ * @return void
28
+ */
29
+ public function __construct($app)
30
+ {
31
+ parent::__construct($app);
32
+
33
+ $this->provider = $this->getProvider();
34
+ }
35
+
36
+ /**
37
+ * Return ServiceProvider according to Laravel version
38
+ *
39
+ * @return \Intervention\Httpauth\Provider\ProviderInterface
40
+ */
41
+ private function getProvider()
42
+ {
43
+ $app = $this->app;
44
+ $version = intval($app::VERSION);
45
+ $provider = sprintf(
46
+ '\Intervention\Httpauth\HttpauthServiceProviderLaravel%d', $version
47
+ );
48
+
49
+ return new $provider($app);
50
+ }
51
+
52
+ /**
53
+ * Bootstrap the application events.
54
+ *
55
+ * @return void
56
+ */
57
+ public function boot()
58
+ {
59
+ return $this->provider->boot();
60
+ }
61
+
62
+ /**
63
+ * Register the service provider.
64
+ *
65
+ * @return void
66
+ */
67
+ public function register()
68
+ {
69
+ return $this->provider->register();
70
+ }
71
+
72
+ /**
73
+ * Get the services provided by the provider.
74
+ *
75
+ * @return array
76
+ */
77
+ public function provides()
78
+ {
79
+ return array('httpauth');
80
+ }
81
+
82
+ }
lib/vendor/intervention/httpauth/src/Intervention/Httpauth/HttpauthServiceProviderLaravel4.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Intervention\Httpauth;
4
+
5
+ use Illuminate\Support\ServiceProvider;
6
+
7
+ class HttpauthServiceProviderLaravel4 extends ServiceProvider
8
+ {
9
+ /**
10
+ * Bootstrap the application events.
11
+ *
12
+ * @return void
13
+ */
14
+ public function boot()
15
+ {
16
+ $this->package('intervention/httpauth');
17
+ }
18
+
19
+ /**
20
+ * Register the service provider.
21
+ *
22
+ * @return void
23
+ */
24
+ public function register()
25
+ {
26
+ $this->app['httpauth'] = $this->app->share(function($app) {
27
+ return new Httpauth($app['config']->get('httpauth::config'));
28
+ });
29
+ }
30
+ }
lib/vendor/intervention/httpauth/src/Intervention/Httpauth/HttpauthServiceProviderLaravel5.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Intervention\Httpauth;
4
+
5
+ use Illuminate\Support\ServiceProvider;
6
+
7
+ class HttpauthServiceProviderLaravel5 extends ServiceProvider
8
+ {
9
+ /**
10
+ * Bootstrap the application events.
11
+ *
12
+ * @return void
13
+ */
14
+ public function boot()
15
+ {
16
+ $this->publishes(array(
17
+ __DIR__.'/../../config/config.php' => config_path('httpauth.php')
18
+ ));
19
+ }
20
+
21
+ /**
22
+ * Register the service provider.
23
+ *
24
+ * @return void
25
+ */
26
+ public function register()
27
+ {
28
+ // merge default config
29
+ $this->mergeConfigFrom(
30
+ __DIR__.'/../../config/config.php', 'httpauth'
31
+ );
32
+
33
+ $this->app->singleton('httpauth', function ($app) {
34
+ return new Httpauth($app['config']->get('httpauth'));
35
+ });
36
+ }
37
+ }
lib/vendor/intervention/httpauth/src/Intervention/Httpauth/UserInterface.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Intervention\Httpauth;
4
+
5
+ interface UserInterface
6
+ {
7
+ /**
8
+ * Checks for valid username & password
9
+ *
10
+ * @param array $credentials
11
+ * @return boolean
12
+ */
13
+ public function isValid($name, $password, $realm);
14
+
15
+ /**
16
+ * Parses the User Information from server variables
17
+
18
+ * @return void
19
+ */
20
+ public function parse();
21
+
22
+ }
lib/vendor/intervention/httpauth/src/config/config.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ return array(
4
+
5
+ /*
6
+ |--------------------------------------------------------------------------
7
+ | Authentication type
8
+ |--------------------------------------------------------------------------
9
+ |
10
+ | Intervention Httpauth supports "basic" and "digest" authentication
11
+ | implementations. "Basic" is the simplest technique, while "Digest" applies
12
+ | hash functions to the password before sending it over the network.
13
+ |
14
+ | Supported: "basic", "digest"
15
+ |
16
+ */
17
+ 'type' => 'basic',
18
+
19
+ /*
20
+ |--------------------------------------------------------------------------
21
+ | Authentication realm
22
+ |--------------------------------------------------------------------------
23
+ |
24
+ | Clients must authenticate itself to each realm.
25
+ |
26
+ */
27
+ 'realm' => 'Secured',
28
+
29
+ /*
30
+ |--------------------------------------------------------------------------
31
+ | Authentication username
32
+ |--------------------------------------------------------------------------
33
+ |
34
+ | Username to access the secured realm in combination with a password.
35
+ |
36
+ */
37
+ 'username' => 'admin',
38
+
39
+ /*
40
+ |--------------------------------------------------------------------------
41
+ | Password
42
+ |--------------------------------------------------------------------------
43
+ |
44
+ | Password to access the secured realm in combination with the username.
45
+ |
46
+ */
47
+ 'password' => '1234'
48
+
49
+ );
lib/vendor/monolog/monolog/.php_cs ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $header = <<<EOF
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
+ EOF;
11
+
12
+ $finder = Symfony\CS\Finder::create()
13
+ ->files()
14
+ ->name('*.php')
15
+ ->exclude('Fixtures')
16
+ ->in(__DIR__.'/src')
17
+ ->in(__DIR__.'/tests')
18
+ ;
19
+
20
+ return Symfony\CS\Config::create()
21
+ ->setUsingCache(true)
22
+ //->setUsingLinter(false)
23
+ ->setRiskyAllowed(true)
24
+ ->setRules(array(
25
+ '@PSR2' => true,
26
+ 'binary_operator_spaces' => true,
27
+ 'blank_line_before_return' => true,
28
+ 'header_comment' => array('header' => $header),
29
+ 'include' => true,
30
+ 'long_array_syntax' => true,
31
+ 'method_separation' => true,
32
+ 'no_blank_lines_after_class_opening' => true,
33
+ 'no_blank_lines_after_phpdoc' => true,
34
+ 'no_blank_lines_between_uses' => true,
35
+ 'no_duplicate_semicolons' => true,
36
+ 'no_extra_consecutive_blank_lines' => true,
37
+ 'no_leading_import_slash' => true,
38
+ 'no_leading_namespace_whitespace' => true,
39
+ 'no_trailing_comma_in_singleline_array' => true,
40
+ 'no_unused_imports' => true,
41
+ 'object_operator_without_whitespace' => true,
42
+ 'phpdoc_align' => true,
43
+ 'phpdoc_indent' => true,
44
+ 'phpdoc_no_access' => true,
45
+ 'phpdoc_no_package' => true,
46
+ 'phpdoc_order' => true,
47
+ 'phpdoc_scalar' => true,
48
+ 'phpdoc_trim' => true,
49
+ 'phpdoc_type_to_var' => true,
50
+ 'psr0' => true,
51
+ 'single_blank_line_before_namespace' => true,
52
+ 'spaces_cast' => true,
53
+ 'standardize_not_equals' => true,
54
+ 'ternary_operator_spaces' => true,
55
+ 'trailing_comma_in_multiline_array' => true,
56
+ 'whitespacy_lines' => true,
57
+ ))
58
+ ->finder($finder)
59
+ ;
lib/vendor/monolog/monolog/LICENSE ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2011-2016 Jordi Boggiano
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is furnished
8
+ to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
lib/vendor/monolog/monolog/src/Monolog/ErrorHandler.php ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog;
13
+
14
+ use Psr\Log\LoggerInterface;
15
+ use Psr\Log\LogLevel;
16
+ use Monolog\Handler\AbstractHandler;
17
+
18
+ /**
19
+ * Monolog error handler
20
+ *
21
+ * A facility to enable logging of runtime errors, exceptions and fatal errors.
22
+ *
23
+ * Quick setup: <code>ErrorHandler::register($logger);</code>
24
+ *
25
+ * @author Jordi Boggiano <j.boggiano@seld.be>
26
+ */
27
+ class ErrorHandler
28
+ {
29
+ private $logger;
30
+
31
+ private $previousExceptionHandler;
32
+ private $uncaughtExceptionLevel;
33
+
34
+ private $previousErrorHandler;
35
+ private $errorLevelMap;
36
+ private $handleOnlyReportedErrors;
37
+
38
+ private $hasFatalErrorHandler;
39
+ private $fatalLevel;
40
+ private $reservedMemory;
41
+ private static $fatalErrors = array(E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR);
42
+
43
+ public function __construct(LoggerInterface $logger)
44
+ {
45
+ $this->logger = $logger;
46
+ }
47
+
48
+ /**
49
+ * Registers a new ErrorHandler for a given Logger
50
+ *
51
+ * By default it will handle errors, exceptions and fatal errors
52
+ *
53
+ * @param LoggerInterface $logger
54
+ * @param array|false $errorLevelMap an array of E_* constant to LogLevel::* constant mapping, or false to disable error handling
55
+ * @param int|false $exceptionLevel a LogLevel::* constant, or false to disable exception handling
56
+ * @param int|false $fatalLevel a LogLevel::* constant, or false to disable fatal error handling
57
+ * @return ErrorHandler
58
+ */
59
+ public static function register(LoggerInterface $logger, $errorLevelMap = array(), $exceptionLevel = null, $fatalLevel = null)
60
+ {
61
+ //Forces the autoloader to run for LogLevel. Fixes an autoload issue at compile-time on PHP5.3. See https://github.com/Seldaek/monolog/pull/929
62
+ class_exists('\\Psr\\Log\\LogLevel', true);
63
+
64
+ $handler = new static($logger);
65
+ if ($errorLevelMap !== false) {
66
+ $handler->registerErrorHandler($errorLevelMap);
67
+ }
68
+ if ($exceptionLevel !== false) {
69
+ $handler->registerExceptionHandler($exceptionLevel);
70
+ }
71
+ if ($fatalLevel !== false) {
72
+ $handler->registerFatalHandler($fatalLevel);
73
+ }
74
+
75
+ return $handler;
76
+ }
77
+
78
+ public function registerExceptionHandler($level = null, $callPrevious = true)
79
+ {
80
+ $prev = set_exception_handler(array($this, 'handleException'));
81
+ $this->uncaughtExceptionLevel = $level;
82
+ if ($callPrevious && $prev) {
83
+ $this->previousExceptionHandler = $prev;
84
+ }
85
+ }
86
+
87
+ public function registerErrorHandler(array $levelMap = array(), $callPrevious = true, $errorTypes = -1, $handleOnlyReportedErrors = true)
88
+ {
89
+ $prev = set_error_handler(array($this, 'handleError'), $errorTypes);
90
+ $this->errorLevelMap = array_replace($this->defaultErrorLevelMap(), $levelMap);
91
+ if ($callPrevious) {
92
+ $this->previousErrorHandler = $prev ?: true;
93
+ }
94
+
95
+ $this->handleOnlyReportedErrors = $handleOnlyReportedErrors;
96
+ }
97
+
98
+ public function registerFatalHandler($level = null, $reservedMemorySize = 20)
99
+ {
100
+ register_shutdown_function(array($this, 'handleFatalError'));
101
+
102
+ $this->reservedMemory = str_repeat(' ', 1024 * $reservedMemorySize);
103
+ $this->fatalLevel = $level;
104
+ $this->hasFatalErrorHandler = true;
105
+ }
106
+
107
+ protected function defaultErrorLevelMap()
108
+ {
109
+ return array(
110
+ E_ERROR => LogLevel::CRITICAL,
111
+ E_WARNING => LogLevel::WARNING,
112
+ E_PARSE => LogLevel::ALERT,
113
+ E_NOTICE => LogLevel::NOTICE,
114
+ E_CORE_ERROR => LogLevel::CRITICAL,
115
+ E_CORE_WARNING => LogLevel::WARNING,
116
+ E_COMPILE_ERROR => LogLevel::ALERT,
117
+ E_COMPILE_WARNING => LogLevel::WARNING,
118
+ E_USER_ERROR => LogLevel::ERROR,
119
+ E_USER_WARNING => LogLevel::WARNING,
120
+ E_USER_NOTICE => LogLevel::NOTICE,
121
+ E_STRICT => LogLevel::NOTICE,
122
+ E_RECOVERABLE_ERROR => LogLevel::ERROR,
123
+ E_DEPRECATED => LogLevel::NOTICE,
124
+ E_USER_DEPRECATED => LogLevel::NOTICE,
125
+ );
126
+ }
127
+
128
+ /**
129
+ * @private
130
+ */
131
+ public function handleException($e)
132
+ {
133
+ $this->logger->log(
134
+ $this->uncaughtExceptionLevel === null ? LogLevel::ERROR : $this->uncaughtExceptionLevel,
135
+ sprintf('Uncaught Exception %s: "%s" at %s line %s', get_class($e), $e->getMessage(), $e->getFile(), $e->getLine()),
136
+ array('exception' => $e)
137
+ );
138
+
139
+ if ($this->previousExceptionHandler) {
140
+ call_user_func($this->previousExceptionHandler, $e);
141
+ }
142
+
143
+ exit(255);
144
+ }
145
+
146
+ /**
147
+ * @private
148
+ */
149
+ public function handleError($code, $message, $file = '', $line = 0, $context = array())
150
+ {
151
+ if ($this->handleOnlyReportedErrors && !(error_reporting() & $code)) {
152
+ return;
153
+ }
154
+
155
+ // fatal error codes are ignored if a fatal error handler is present as well to avoid duplicate log entries
156
+ if (!$this->hasFatalErrorHandler || !in_array($code, self::$fatalErrors, true)) {
157
+ $level = isset($this->errorLevelMap[$code]) ? $this->errorLevelMap[$code] : LogLevel::CRITICAL;
158
+ $this->logger->log($level, self::codeToString($code).': '.$message, array('code' => $code, 'message' => $message, 'file' => $file, 'line' => $line));
159
+ }
160
+
161
+ if ($this->previousErrorHandler === true) {
162
+ return false;
163
+ } elseif ($this->previousErrorHandler) {
164
+ return call_user_func($this->previousErrorHandler, $code, $message, $file, $line, $context);
165
+ }
166
+ }
167
+
168
+ /**
169
+ * @private
170
+ */
171
+ public function handleFatalError()
172
+ {
173
+ $this->reservedMemory = null;
174
+
175
+ $lastError = error_get_last();
176
+ if ($lastError && in_array($lastError['type'], self::$fatalErrors, true)) {
177
+ $this->logger->log(
178
+ $this->fatalLevel === null ? LogLevel::ALERT : $this->fatalLevel,
179
+ 'Fatal Error ('.self::codeToString($lastError['type']).'): '.$lastError['message'],
180
+ array('code' => $lastError['type'], 'message' => $lastError['message'], 'file' => $lastError['file'], 'line' => $lastError['line'])
181
+ );
182
+
183
+ if ($this->logger instanceof Logger) {
184
+ foreach ($this->logger->getHandlers() as $handler) {
185
+ if ($handler instanceof AbstractHandler) {
186
+ $handler->close();
187
+ }
188
+ }
189
+ }
190
+ }
191
+ }
192
+
193
+ private static function codeToString($code)
194
+ {
195
+ switch ($code) {
196
+ case E_ERROR:
197
+ return 'E_ERROR';
198
+ case E_WARNING:
199
+ return 'E_WARNING';
200
+ case E_PARSE:
201
+ return 'E_PARSE';
202
+ case E_NOTICE:
203
+ return 'E_NOTICE';
204
+ case E_CORE_ERROR:
205
+ return 'E_CORE_ERROR';
206
+ case E_CORE_WARNING:
207
+ return 'E_CORE_WARNING';
208
+ case E_COMPILE_ERROR:
209
+ return 'E_COMPILE_ERROR';
210
+ case E_COMPILE_WARNING:
211
+ return 'E_COMPILE_WARNING';
212
+ case E_USER_ERROR:
213
+ return 'E_USER_ERROR';
214
+ case E_USER_WARNING:
215
+ return 'E_USER_WARNING';
216
+ case E_USER_NOTICE:
217
+ return 'E_USER_NOTICE';
218
+ case E_STRICT:
219
+ return 'E_STRICT';
220
+ case E_RECOVERABLE_ERROR:
221
+ return 'E_RECOVERABLE_ERROR';
222
+ case E_DEPRECATED:
223
+ return 'E_DEPRECATED';
224
+ case E_USER_DEPRECATED:
225
+ return 'E_USER_DEPRECATED';
226
+ }
227
+
228
+ return 'Unknown PHP error';
229
+ }
230
+ }
lib/vendor/monolog/monolog/src/Monolog/Formatter/ChromePHPFormatter.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Formatter;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Formats a log message according to the ChromePHP array format
18
+ *
19
+ * @author Christophe Coevoet <stof@notk.org>
20
+ */
21
+ class ChromePHPFormatter implements FormatterInterface
22
+ {
23
+ /**
24
+ * Translates Monolog log levels to Wildfire levels.
25
+ */
26
+ private $logLevels = array(
27
+ Logger::DEBUG => 'log',
28
+ Logger::INFO => 'info',
29
+ Logger::NOTICE => 'info',
30
+ Logger::WARNING => 'warn',
31
+ Logger::ERROR => 'error',
32
+ Logger::CRITICAL => 'error',
33
+ Logger::ALERT => 'error',
34
+ Logger::EMERGENCY => 'error',
35
+ );
36
+
37
+ /**
38
+ * {@inheritdoc}
39
+ */
40
+ public function format(array $record)
41
+ {
42
+ // Retrieve the line and file if set and remove them from the formatted extra
43
+ $backtrace = 'unknown';
44
+ if (isset($record['extra']['file'], $record['extra']['line'])) {
45
+ $backtrace = $record['extra']['file'].' : '.$record['extra']['line'];
46
+ unset($record['extra']['file'], $record['extra']['line']);
47
+ }
48
+
49
+ $message = array('message' => $record['message']);
50
+ if ($record['context']) {
51
+ $message['context'] = $record['context'];
52
+ }
53
+ if ($record['extra']) {
54
+ $message['extra'] = $record['extra'];
55
+ }
56
+ if (count($message) === 1) {
57
+ $message = reset($message);
58
+ }
59
+
60
+ return array(
61
+ $record['channel'],
62
+ $message,
63
+ $backtrace,
64
+ $this->logLevels[$record['level']],
65
+ );
66
+ }
67
+
68
+ public function formatBatch(array $records)
69
+ {
70
+ $formatted = array();
71
+
72
+ foreach ($records as $record) {
73
+ $formatted[] = $this->format($record);
74
+ }
75
+
76
+ return $formatted;
77
+ }
78
+ }
lib/vendor/monolog/monolog/src/Monolog/Formatter/ElasticaFormatter.php ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Formatter;
13
+
14
+ use Elastica\Document;
15
+
16
+ /**
17
+ * Format a log message into an Elastica Document
18
+ *
19
+ * @author Jelle Vink <jelle.vink@gmail.com>
20
+ */
21
+ class ElasticaFormatter extends NormalizerFormatter
22
+ {
23
+ /**
24
+ * @var string Elastic search index name
25
+ */
26
+ protected $index;
27
+
28
+ /**
29
+ * @var string Elastic search document type
30
+ */
31
+ protected $type;
32
+
33
+ /**
34
+ * @param string $index Elastic Search index name
35
+ * @param string $type Elastic Search document type
36
+ */
37
+ public function __construct($index, $type)
38
+ {
39
+ // elasticsearch requires a ISO 8601 format date with optional millisecond precision.
40
+ parent::__construct('Y-m-d\TH:i:s.uP');
41
+
42
+ $this->index = $index;
43
+ $this->type = $type;
44
+ }
45
+
46
+ /**
47
+ * {@inheritdoc}
48
+ */
49
+ public function format(array $record)
50
+ {
51
+ $record = parent::format($record);
52
+
53
+ return $this->getDocument($record);
54
+ }
55
+
56
+ /**
57
+ * Getter index
58
+ * @return string
59
+ */
60
+ public function getIndex()
61
+ {
62
+ return $this->index;
63
+ }
64
+
65
+ /**
66
+ * Getter type
67
+ * @return string
68
+ */
69
+ public function getType()
70
+ {
71
+ return $this->type;
72
+ }
73
+
74
+ /**
75
+ * Convert a log message into an Elastica Document
76
+ *
77
+ * @param array $record Log message
78
+ * @return Document
79
+ */
80
+ protected function getDocument($record)
81
+ {
82
+ $document = new Document();
83
+ $document->setData($record);
84
+ $document->setType($this->type);
85
+ $document->setIndex($this->index);
86
+
87
+ return $document;
88
+ }
89
+ }
lib/vendor/monolog/monolog/src/Monolog/Formatter/FlowdockFormatter.php ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Formatter;
13
+
14
+ /**
15
+ * formats the record to be used in the FlowdockHandler
16
+ *
17
+ * @author Dominik Liebler <liebler.dominik@gmail.com>
18
+ */
19
+ class FlowdockFormatter implements FormatterInterface
20
+ {
21
+ /**
22
+ * @var string
23
+ */
24
+ private $source;
25
+
26
+ /**
27
+ * @var string
28
+ */
29
+ private $sourceEmail;
30
+
31
+ /**
32
+ * @param string $source
33
+ * @param string $sourceEmail
34
+ */
35
+ public function __construct($source, $sourceEmail)
36
+ {
37
+ $this->source = $source;
38
+ $this->sourceEmail = $sourceEmail;
39
+ }
40
+
41
+ /**
42
+ * {@inheritdoc}
43
+ */
44
+ public function format(array $record)
45
+ {
46
+ $tags = array(
47
+ '#logs',
48
+ '#' . strtolower($record['level_name']),
49
+ '#' . $record['channel'],
50
+ );
51
+
52
+ foreach ($record['extra'] as $value) {
53
+ $tags[] = '#' . $value;
54
+ }
55
+
56
+ $subject = sprintf(
57
+ 'in %s: %s - %s',
58
+ $this->source,
59
+ $record['level_name'],
60
+ $this->getShortMessage($record['message'])
61
+ );
62
+
63
+ $record['flowdock'] = array(
64
+ 'source' => $this->source,
65
+ 'from_address' => $this->sourceEmail,
66
+ 'subject' => $subject,
67
+ 'content' => $record['message'],
68
+ 'tags' => $tags,
69
+ 'project' => $this->source,
70
+ );
71
+
72
+ return $record;
73
+ }
74
+
75
+ /**
76
+ * {@inheritdoc}
77
+ */
78
+ public function formatBatch(array $records)
79
+ {
80
+ $formatted = array();
81
+
82
+ foreach ($records as $record) {
83
+ $formatted[] = $this->format($record);
84
+ }
85
+
86
+ return $formatted;
87
+ }
88
+
89
+ /**
90
+ * @param string $message
91
+ *
92
+ * @return string
93
+ */
94
+ public function getShortMessage($message)
95
+ {
96
+ static $hasMbString;
97
+
98
+ if (null === $hasMbString) {
99
+ $hasMbString = function_exists('mb_strlen');
100
+ }
101
+
102
+ $maxLength = 45;
103
+
104
+ if ($hasMbString) {
105
+ if (mb_strlen($message, 'UTF-8') > $maxLength) {
106
+ $message = mb_substr($message, 0, $maxLength - 4, 'UTF-8') . ' ...';
107
+ }
108
+ } else {
109
+ if (strlen($message) > $maxLength) {
110
+ $message = substr($message, 0, $maxLength - 4) . ' ...';
111
+ }
112
+ }
113
+
114
+ return $message;
115
+ }
116
+ }
lib/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Formatter;
13
+
14
+ /**
15
+ * Class FluentdFormatter
16
+ *
17
+ * Serializes a log message to Fluentd unix socket protocol
18
+ *
19
+ * Fluentd config:
20
+ *
21
+ * <source>
22
+ * type unix
23
+ * path /var/run/td-agent/td-agent.sock
24
+ * </source>
25
+ *
26
+ * Monolog setup:
27
+ *
28
+ * $logger = new Monolog\Logger('fluent.tag');
29
+ * $fluentHandler = new Monolog\Handler\SocketHandler('unix:///var/run/td-agent/td-agent.sock');
30
+ * $fluentHandler->setFormatter(new Monolog\Formatter\FluentdFormatter());
31
+ * $logger->pushHandler($fluentHandler);
32
+ *
33
+ * @author Andrius Putna <fordnox@gmail.com>
34
+ */
35
+ class FluentdFormatter implements FormatterInterface
36
+ {
37
+ /**
38
+ * @var bool $levelTag should message level be a part of the fluentd tag
39
+ */
40
+ protected $levelTag = false;
41
+
42
+ public function __construct($levelTag = false)
43
+ {
44
+ if (!function_exists('json_encode')) {
45
+ throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s FluentdUnixFormatter');
46
+ }
47
+
48
+ $this->levelTag = (bool) $levelTag;
49
+ }
50
+
51
+ public function isUsingLevelsInTag()
52
+ {
53
+ return $this->levelTag;
54
+ }
55
+
56
+ public function format(array $record)
57
+ {
58
+ $tag = $record['channel'];
59
+ if ($this->levelTag) {
60
+ $tag .= '.' . strtolower($record['level_name']);
61
+ }
62
+
63
+ $message = array(
64
+ 'message' => $record['message'],
65
+ 'extra' => $record['extra'],
66
+ );
67
+
68
+ if (!$this->levelTag) {
69
+ $message['level'] = $record['level'];
70
+ $message['level_name'] = $record['level_name'];
71
+ }
72
+
73
+ return json_encode(array($tag, $record['datetime']->getTimestamp(), $message));
74
+ }
75
+
76
+ public function formatBatch(array $records)
77
+ {
78
+ $message = '';
79
+ foreach ($records as $record) {
80
+ $message .= $this->format($record);
81
+ }
82
+
83
+ return $message;
84
+ }
85
+ }
lib/vendor/monolog/monolog/src/Monolog/Formatter/FormatterInterface.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Formatter;
13
+
14
+ /**
15
+ * Interface for formatters
16
+ *
17
+ * @author Jordi Boggiano <j.boggiano@seld.be>
18
+ */
19
+ interface FormatterInterface
20
+ {
21
+ /**
22
+ * Formats a log record.
23
+ *
24
+ * @param array $record A record to format
25
+ * @return mixed The formatted record
26
+ */
27
+ public function format(array $record);
28
+
29
+ /**
30
+ * Formats a set of log records.
31
+ *
32
+ * @param array $records A set of records to format
33
+ * @return mixed The formatted set of records
34
+ */
35
+ public function formatBatch(array $records);
36
+ }
lib/vendor/monolog/monolog/src/Monolog/Formatter/GelfMessageFormatter.php ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Formatter;
13
+
14
+ use Monolog\Logger;
15
+ use Gelf\Message;
16
+
17
+ /**
18
+ * Serializes a log message to GELF
19
+ * @see http://www.graylog2.org/about/gelf
20
+ *
21
+ * @author Matt Lehner <mlehner@gmail.com>
22
+ */
23
+ class GelfMessageFormatter extends NormalizerFormatter
24
+ {
25
+ const DEFAULT_MAX_LENGTH = 32766;
26
+
27
+ /**
28
+ * @var string the name of the system for the Gelf log message
29
+ */
30
+ protected $systemName;
31
+
32
+ /**
33
+ * @var string a prefix for 'extra' fields from the Monolog record (optional)
34
+ */
35
+ protected $extraPrefix;
36
+
37
+ /**
38
+ * @var string a prefix for 'context' fields from the Monolog record (optional)
39
+ */
40
+ protected $contextPrefix;
41
+
42
+ /**
43
+ * @var int max length per field
44
+ */
45
+ protected $maxLength;
46
+
47
+ /**
48
+ * Translates Monolog log levels to Graylog2 log priorities.
49
+ */
50
+ private $logLevels = array(
51
+ Logger::DEBUG => 7,
52
+ Logger::INFO => 6,
53
+ Logger::NOTICE => 5,
54
+ Logger::WARNING => 4,
55
+ Logger::ERROR => 3,
56
+ Logger::CRITICAL => 2,
57
+ Logger::ALERT => 1,
58
+ Logger::EMERGENCY => 0,
59
+ );
60
+
61
+ public function __construct($systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_', $maxLength = null)
62
+ {
63
+ parent::__construct('U.u');
64
+
65
+ $this->systemName = $systemName ?: gethostname();
66
+
67
+ $this->extraPrefix = $extraPrefix;
68
+ $this->contextPrefix = $contextPrefix;
69
+ $this->maxLength = is_null($maxLength) ? self::DEFAULT_MAX_LENGTH : $maxLength;
70
+ }
71
+
72
+ /**
73
+ * {@inheritdoc}
74
+ */
75
+ public function format(array $record)
76
+ {
77
+ $record = parent::format($record);
78
+
79
+ if (!isset($record['datetime'], $record['message'], $record['level'])) {
80
+ throw new \InvalidArgumentException('The record should at least contain datetime, message and level keys, '.var_export($record, true).' given');
81
+ }
82
+
83
+ $message = new Message();
84
+ $message
85
+ ->setTimestamp($record['datetime'])
86
+ ->setShortMessage((string) $record['message'])
87
+ ->setHost($this->systemName)
88
+ ->setLevel($this->logLevels[$record['level']]);
89
+
90
+ // message length + system name length + 200 for padding / metadata
91
+ $len = 200 + strlen((string) $record['message']) + strlen($this->systemName);
92
+
93
+ if ($len > $this->maxLength) {
94
+ $message->setShortMessage(substr($record['message'], 0, $this->maxLength));
95
+ }
96
+
97
+ if (isset($record['channel'])) {
98
+ $message->setFacility($record['channel']);
99
+ }
100
+ if (isset($record['extra']['line'])) {
101
+ $message->setLine($record['extra']['line']);
102
+ unset($record['extra']['line']);
103
+ }
104
+ if (isset($record['extra']['file'])) {
105
+ $message->setFile($record['extra']['file']);
106
+ unset($record['extra']['file']);
107
+ }
108
+
109
+ foreach ($record['extra'] as $key => $val) {
110
+ $val = is_scalar($val) || null === $val ? $val : $this->toJson($val);
111
+ $len = strlen($this->extraPrefix . $key . $val);
112
+ if ($len > $this->maxLength) {
113
+ $message->setAdditional($this->extraPrefix . $key, substr($val, 0, $this->maxLength));
114
+ break;
115
+ }
116
+ $message->setAdditional($this->extraPrefix . $key, $val);
117
+ }
118
+
119
+ foreach ($record['context'] as $key => $val) {
120
+ $val = is_scalar($val) || null === $val ? $val : $this->toJson($val);
121
+ $len = strlen($this->contextPrefix . $key . $val);
122
+ if ($len > $this->maxLength) {
123
+ $message->setAdditional($this->contextPrefix . $key, substr($val, 0, $this->maxLength));
124
+ break;
125
+ }
126
+ $message->setAdditional($this->contextPrefix . $key, $val);
127
+ }
128
+
129
+ if (null === $message->getFile() && isset($record['context']['exception']['file'])) {
130
+ if (preg_match("/^(.+):([0-9]+)$/", $record['context']['exception']['file'], $matches)) {
131
+ $message->setFile($matches[1]);
132
+ $message->setLine($matches[2]);
133
+ }
134
+ }
135
+
136
+ return $message;
137
+ }
138
+ }
lib/vendor/monolog/monolog/src/Monolog/Formatter/HtmlFormatter.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * This file is part of the Monolog package.
4
+ *
5
+ * (c) Jordi Boggiano <j.boggiano@seld.be>
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
+ namespace Monolog\Formatter;
12
+
13
+ use Monolog\Logger;
14
+
15
+ /**
16
+ * Formats incoming records into an HTML table
17
+ *
18
+ * This is especially useful for html email logging
19
+ *
20
+ * @author Tiago Brito <tlfbrito@gmail.com>
21
+ */
22
+ class HtmlFormatter extends NormalizerFormatter
23
+ {
24
+ /**
25
+ * Translates Monolog log levels to html color priorities.
26
+ */
27
+ protected $logLevels = array(
28
+ Logger::DEBUG => '#cccccc',
29
+ Logger::INFO => '#468847',
30
+ Logger::NOTICE => '#3a87ad',
31
+ Logger::WARNING => '#c09853',
32
+ Logger::ERROR => '#f0ad4e',
33
+ Logger::CRITICAL => '#FF7708',
34
+ Logger::ALERT => '#C12A19',
35
+ Logger::EMERGENCY => '#000000',
36
+ );
37
+
38
+ /**
39
+ * @param string $dateFormat The format of the timestamp: one supported by DateTime::format
40
+ */
41
+ public function __construct($dateFormat = null)
42
+ {
43
+ parent::__construct($dateFormat);
44
+ }
45
+
46
+ /**
47
+ * Creates an HTML table row
48
+ *
49
+ * @param string $th Row header content
50
+ * @param string $td Row standard cell content
51
+ * @param bool $escapeTd false if td content must not be html escaped
52
+ * @return string
53
+ */
54
+ protected function addRow($th, $td = ' ', $escapeTd = true)
55
+ {
56
+ $th = htmlspecialchars($th, ENT_NOQUOTES, 'UTF-8');
57
+ if ($escapeTd) {
58
+ $td = '<pre>'.htmlspecialchars($td, ENT_NOQUOTES, 'UTF-8').'</pre>';
59
+ }
60
+
61
+ return "<tr style=\"padding: 4px;spacing: 0;text-align: left;\">\n<th style=\"background: #cccccc\" width=\"100px\">$th:</th>\n<td style=\"padding: 4px;spacing: 0;text-align: left;background: #eeeeee\">".$td."</td>\n</tr>";
62
+ }
63
+
64
+ /**
65
+ * Create a HTML h1 tag
66
+ *
67
+ * @param string $title Text to be in the h1
68
+ * @param int $level Error level
69
+ * @return string
70
+ */
71
+ protected function addTitle($title, $level)
72
+ {
73
+ $title = htmlspecialchars($title, ENT_NOQUOTES, 'UTF-8');
74
+
75
+ return '<h1 style="background: '.$this->logLevels[$level].';color: #ffffff;padding: 5px;" class="monolog-output">'.$title.'</h1>';
76
+ }
77
+
78
+ /**
79
+ * Formats a log record.
80
+ *
81
+ * @param array $record A record to format
82
+ * @return mixed The formatted record
83
+ */
84
+ public function format(array $record)
85
+ {
86
+ $output = $this->addTitle($record['level_name'], $record['level']);
87
+ $output .= '<table cellspacing="1" width="100%" class="monolog-output">';
88
+
89
+ $output .= $this->addRow('Message', (string) $record['message']);
90
+ $output .= $this->addRow('Time', $record['datetime']->format($this->dateFormat));
91
+ $output .= $this->addRow('Channel', $record['channel']);
92
+ if ($record['context']) {
93
+ $embeddedTable = '<table cellspacing="1" width="100%">';
94
+ foreach ($record['context'] as $key => $value) {
95
+ $embeddedTable .= $this->addRow($key, $this->convertToString($value));
96
+ }
97
+ $embeddedTable .= '</table>';
98
+ $output .= $this->addRow('Context', $embeddedTable, false);
99
+ }
100
+ if ($record['extra']) {
101
+ $embeddedTable = '<table cellspacing="1" width="100%">';
102
+ foreach ($record['extra'] as $key => $value) {
103
+ $embeddedTable .= $this->addRow($key, $this->convertToString($value));
104
+ }
105
+ $embeddedTable .= '</table>';
106
+ $output .= $this->addRow('Extra', $embeddedTable, false);
107
+ }
108
+
109
+ return $output.'</table>';
110
+ }
111
+
112
+ /**
113
+ * Formats a set of log records.
114
+ *
115
+ * @param array $records A set of records to format
116
+ * @return mixed The formatted set of records
117
+ */
118
+ public function formatBatch(array $records)
119
+ {
120
+ $message = '';
121
+ foreach ($records as $record) {
122
+ $message .= $this->format($record);
123
+ }
124
+
125
+ return $message;
126
+ }
127
+
128
+ protected function convertToString($data)
129
+ {
130
+ if (null === $data || is_scalar($data)) {
131
+ return (string) $data;
132
+ }
133
+
134
+ $data = $this->normalize($data);
135
+ if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
136
+ return json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
137
+ }
138
+
139
+ return str_replace('\\/', '/', json_encode($data));
140
+ }
141
+ }
lib/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Formatter;
13
+
14
+ use Exception;
15
+ use Throwable;
16
+
17
+ /**
18
+ * Encodes whatever record data is passed to it as json
19
+ *
20
+ * This can be useful to log to databases or remote APIs
21
+ *
22
+ * @author Jordi Boggiano <j.boggiano@seld.be>
23
+ */
24
+ class JsonFormatter extends NormalizerFormatter
25
+ {
26
+ const BATCH_MODE_JSON = 1;
27
+ const BATCH_MODE_NEWLINES = 2;
28
+
29
+ protected $batchMode;
30
+ protected $appendNewline;
31
+
32
+ /**
33
+ * @var bool
34
+ */
35
+ protected $includeStacktraces = false;
36
+
37
+ /**
38
+ * @param int $batchMode
39
+ * @param bool $appendNewline
40
+ */
41
+ public function __construct($batchMode = self::BATCH_MODE_JSON, $appendNewline = true)
42
+ {
43
+ $this->batchMode = $batchMode;
44
+ $this->appendNewline = $appendNewline;
45
+ }
46
+
47
+ /**
48
+ * The batch mode option configures the formatting style for
49
+ * multiple records. By default, multiple records will be
50
+ * formatted as a JSON-encoded array. However, for
51
+ * compatibility with some API endpoints, alternative styles
52
+ * are available.
53
+ *
54
+ * @return int
55
+ */
56
+ public function getBatchMode()
57
+ {
58
+ return $this->batchMode;
59
+ }
60
+
61
+ /**
62
+ * True if newlines are appended to every formatted record
63
+ *
64
+ * @return bool
65
+ */
66
+ public function isAppendingNewlines()
67
+ {
68
+ return $this->appendNewline;
69
+ }
70
+
71
+ /**
72
+ * {@inheritdoc}
73
+ */
74
+ public function format(array $record)
75
+ {
76
+ return $this->toJson($this->normalize($record), true) . ($this->appendNewline ? "\n" : '');
77
+ }
78
+
79
+ /**
80
+ * {@inheritdoc}
81
+ */
82
+ public function formatBatch(array $records)
83
+ {
84
+ switch ($this->batchMode) {
85
+ case static::BATCH_MODE_NEWLINES:
86
+ return $this->formatBatchNewlines($records);
87
+
88
+ case static::BATCH_MODE_JSON:
89
+ default:
90
+ return $this->formatBatchJson($records);
91
+ }
92
+ }
93
+
94
+ /**
95
+ * @param bool $include
96
+ */
97
+ public function includeStacktraces($include = true)
98
+ {
99
+ $this->includeStacktraces = $include;
100
+ }
101
+
102
+ /**
103
+ * Return a JSON-encoded array of records.
104
+ *
105
+ * @param array $records
106
+ * @return string
107
+ */
108
+ protected function formatBatchJson(array $records)
109
+ {
110
+ return $this->toJson($this->normalize($records), true);
111
+ }
112
+
113
+ /**
114
+ * Use new lines to separate records instead of a
115
+ * JSON-encoded array.
116
+ *
117
+ * @param array $records
118
+ * @return string
119
+ */
120
+ protected function formatBatchNewlines(array $records)
121
+ {
122
+ $instance = $this;
123
+
124
+ $oldNewline = $this->appendNewline;
125
+ $this->appendNewline = false;
126
+ array_walk($records, function (&$value, $key) use ($instance) {
127
+ $value = $instance->format($value);
128
+ });
129
+ $this->appendNewline = $oldNewline;
130
+
131
+ return implode("\n", $records);
132
+ }
133
+
134
+ /**
135
+ * Normalizes given $data.
136
+ *
137
+ * @param mixed $data
138
+ *
139
+ * @return mixed
140
+ */
141
+ protected function normalize($data)
142
+ {
143
+ if (is_array($data) || $data instanceof \Traversable) {
144
+ $normalized = array();
145
+
146
+ $count = 1;
147
+ foreach ($data as $key => $value) {
148
+ if ($count++ >= 1000) {
149
+ $normalized['...'] = 'Over 1000 items, aborting normalization';
150
+ break;
151
+ }
152
+ $normalized[$key] = $this->normalize($value);
153
+ }
154
+
155
+ return $normalized;
156
+ }
157
+
158
+ if ($data instanceof Exception || $data instanceof Throwable) {
159
+ return $this->normalizeException($data);
160
+ }
161
+
162
+ return $data;
163
+ }
164
+
165
+ /**
166
+ * Normalizes given exception with or without its own stack trace based on
167
+ * `includeStacktraces` property.
168
+ *
169
+ * @param Exception|Throwable $e
170
+ *
171
+ * @return array
172
+ */
173
+ protected function normalizeException($e)
174
+ {
175
+ // TODO 2.0 only check for Throwable
176
+ if (!$e instanceof Exception && !$e instanceof Throwable) {
177
+ throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.get_class($e));
178
+ }
179
+
180
+ $data = array(
181
+ 'class' => get_class($e),
182
+ 'message' => $e->getMessage(),
183
+ 'code' => $e->getCode(),
184
+ 'file' => $e->getFile().':'.$e->getLine(),
185
+ );
186
+
187
+ if ($this->includeStacktraces) {
188
+ $trace = $e->getTrace();
189
+ foreach ($trace as $frame) {
190
+ if (isset($frame['file'])) {
191
+ $data['trace'][] = $frame['file'].':'.$frame['line'];
192
+ } elseif (isset($frame['function']) && $frame['function'] === '{closure}') {
193
+ // We should again normalize the frames, because it might contain invalid items
194
+ $data['trace'][] = $frame['function'];
195
+ } else {
196
+ // We should again normalize the frames, because it might contain invalid items
197
+ $data['trace'][] = $this->normalize($frame);
198
+ }
199
+ }
200
+ }
201
+
202
+ if ($previous = $e->getPrevious()) {
203
+ $data['previous'] = $this->normalizeException($previous);
204
+ }
205
+
206
+ return $data;
207
+ }
208
+ }
lib/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Formatter;
13
+
14
+ /**
15
+ * Formats incoming records into a one-line string
16
+ *
17
+ * This is especially useful for logging to files
18
+ *
19
+ * @author Jordi Boggiano <j.boggiano@seld.be>
20
+ * @author Christophe Coevoet <stof@notk.org>
21
+ */
22
+ class LineFormatter extends NormalizerFormatter
23
+ {
24
+ const SIMPLE_FORMAT = "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n";
25
+
26
+ protected $format;
27
+ protected $allowInlineLineBreaks;
28
+ protected $ignoreEmptyContextAndExtra;
29
+ protected $includeStacktraces;
30
+
31
+ /**
32
+ * @param string $format The format of the message
33
+ * @param string $dateFormat The format of the timestamp: one supported by DateTime::format
34
+ * @param bool $allowInlineLineBreaks Whether to allow inline line breaks in log entries
35
+ * @param bool $ignoreEmptyContextAndExtra
36
+ */
37
+ public function __construct($format = null, $dateFormat = null, $allowInlineLineBreaks = false, $ignoreEmptyContextAndExtra = false)
38
+ {
39
+ $this->format = $format ?: static::SIMPLE_FORMAT;
40
+ $this->allowInlineLineBreaks = $allowInlineLineBreaks;
41
+ $this->ignoreEmptyContextAndExtra = $ignoreEmptyContextAndExtra;
42
+ parent::__construct($dateFormat);
43
+ }
44
+
45
+ public function includeStacktraces($include = true)
46
+ {
47
+ $this->includeStacktraces = $include;
48
+ if ($this->includeStacktraces) {
49
+ $this->allowInlineLineBreaks = true;
50
+ }
51
+ }
52
+
53
+ public function allowInlineLineBreaks($allow = true)
54
+ {
55
+ $this->allowInlineLineBreaks = $allow;
56
+ }
57
+
58
+ public function ignoreEmptyContextAndExtra($ignore = true)
59
+ {
60
+ $this->ignoreEmptyContextAndExtra = $ignore;
61
+ }
62
+
63
+ /**
64
+ * {@inheritdoc}
65
+ */
66
+ public function format(array $record)
67
+ {
68
+ $vars = parent::format($record);
69
+
70
+ $output = $this->format;
71
+
72
+ foreach ($vars['extra'] as $var => $val) {
73
+ if (false !== strpos($output, '%extra.'.$var.'%')) {
74
+ $output = str_replace('%extra.'.$var.'%', $this->stringify($val), $output);
75
+ unset($vars['extra'][$var]);
76
+ }
77
+ }
78
+
79
+
80
+ foreach ($vars['context'] as $var => $val) {
81
+ if (false !== strpos($output, '%context.'.$var.'%')) {
82
+ $output = str_replace('%context.'.$var.'%', $this->stringify($val), $output);
83
+ unset($vars['context'][$var]);
84
+ }
85
+ }
86
+
87
+ if ($this->ignoreEmptyContextAndExtra) {
88
+ if (empty($vars['context'])) {
89
+ unset($vars['context']);
90
+ $output = str_replace('%context%', '', $output);
91
+ }
92
+
93
+ if (empty($vars['extra'])) {
94
+ unset($vars['extra']);
95
+ $output = str_replace('%extra%', '', $output);
96
+ }
97
+ }
98
+
99
+ foreach ($vars as $var => $val) {
100
+ if (false !== strpos($output, '%'.$var.'%')) {
101
+ $output = str_replace('%'.$var.'%', $this->stringify($val), $output);
102
+ }
103
+ }
104
+
105
+ // remove leftover %extra.xxx% and %context.xxx% if any
106
+ if (false !== strpos($output, '%')) {
107
+ $output = preg_replace('/%(?:extra|context)\..+?%/', '', $output);
108
+ }
109
+
110
+ return $output;
111
+ }
112
+
113
+ public function formatBatch(array $records)
114
+ {
115
+ $message = '';
116
+ foreach ($records as $record) {
117
+ $message .= $this->format($record);
118
+ }
119
+
120
+ return $message;
121
+ }
122
+
123
+ public function stringify($value)
124
+ {
125
+ return $this->replaceNewlines($this->convertToString($value));
126
+ }
127
+
128
+ protected function normalizeException($e)
129
+ {
130
+ // TODO 2.0 only check for Throwable
131
+ if (!$e instanceof \Exception && !$e instanceof \Throwable) {
132
+ throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.get_class($e));
133
+ }
134
+
135
+ $previousText = '';
136
+ if ($previous = $e->getPrevious()) {
137
+ do {
138
+ $previousText .= ', '.get_class($previous).'(code: '.$previous->getCode().'): '.$previous->getMessage().' at '.$previous->getFile().':'.$previous->getLine();
139
+ } while ($previous = $previous->getPrevious());
140
+ }
141
+
142
+ $str = '[object] ('.get_class($e).'(code: '.$e->getCode().'): '.$e->getMessage().' at '.$e->getFile().':'.$e->getLine().$previousText.')';
143
+ if ($this->includeStacktraces) {
144
+ $str .= "\n[stacktrace]\n".$e->getTraceAsString()."\n";
145
+ }
146
+
147
+ return $str;
148
+ }
149
+
150
+ protected function convertToString($data)
151
+ {
152
+ if (null === $data || is_bool($data)) {
153
+ return var_export($data, true);
154
+ }
155
+
156
+ if (is_scalar($data)) {
157
+ return (string) $data;
158
+ }
159
+
160
+ if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
161
+ return $this->toJson($data, true);
162
+ }
163
+
164
+ return str_replace('\\/', '/', @json_encode($data));
165
+ }
166
+
167
+ protected function replaceNewlines($str)
168
+ {
169
+ if ($this->allowInlineLineBreaks) {
170
+ if (0 === strpos($str, '{')) {
171
+ return str_replace(array('\r', '\n'), array("\r", "\n"), $str);
172
+ }
173
+
174
+ return $str;
175
+ }
176
+
177
+ return str_replace(array("\r\n", "\r", "\n"), ' ', $str);
178
+ }
179
+ }
lib/vendor/monolog/monolog/src/Monolog/Formatter/LogglyFormatter.php ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Formatter;
13
+
14
+ /**
15
+ * Encodes message information into JSON in a format compatible with Loggly.
16
+ *
17
+ * @author Adam Pancutt <adam@pancutt.com>
18
+ */
19
+ class LogglyFormatter extends JsonFormatter
20
+ {
21
+ /**
22
+ * Overrides the default batch mode to new lines for compatibility with the
23
+ * Loggly bulk API.
24
+ *
25
+ * @param int $batchMode
26
+ */
27
+ public function __construct($batchMode = self::BATCH_MODE_NEWLINES, $appendNewline = false)
28
+ {
29
+ parent::__construct($batchMode, $appendNewline);
30
+ }
31
+
32
+ /**
33
+ * Appends the 'timestamp' parameter for indexing by Loggly.
34
+ *
35
+ * @see https://www.loggly.com/docs/automated-parsing/#json
36
+ * @see \Monolog\Formatter\JsonFormatter::format()
37
+ */
38
+ public function format(array $record)
39
+ {
40
+ if (isset($record["datetime"]) && ($record["datetime"] instanceof \DateTime)) {
41
+ $record["timestamp"] = $record["datetime"]->format("Y-m-d\TH:i:s.uO");
42
+ // TODO 2.0 unset the 'datetime' parameter, retained for BC
43
+ }
44
+
45
+ return parent::format($record);
46
+ }
47
+ }
lib/vendor/monolog/monolog/src/Monolog/Formatter/LogstashFormatter.php ADDED
@@ -0,0 +1,166 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Formatter;
13
+
14
+ /**
15
+ * Serializes a log message to Logstash Event Format
16
+ *
17
+ * @see http://logstash.net/
18
+ * @see https://github.com/logstash/logstash/blob/master/lib/logstash/event.rb
19
+ *
20
+ * @author Tim Mower <timothy.mower@gmail.com>
21
+ */
22
+ class LogstashFormatter extends NormalizerFormatter
23
+ {
24
+ const V0 = 0;
25
+ const V1 = 1;
26
+
27
+ /**
28
+ * @var string the name of the system for the Logstash log message, used to fill the @source field
29
+ */
30
+ protected $systemName;
31
+
32
+ /**
33
+ * @var string an application name for the Logstash log message, used to fill the @type field
34
+ */
35
+ protected $applicationName;
36
+
37
+ /**
38
+ * @var string a prefix for 'extra' fields from the Monolog record (optional)
39
+ */
40
+ protected $extraPrefix;
41
+
42
+ /**
43
+ * @var string a prefix for 'context' fields from the Monolog record (optional)
44
+ */
45
+ protected $contextPrefix;
46
+
47
+ /**
48
+ * @var int logstash format version to use
49
+ */
50
+ protected $version;
51
+
52
+ /**
53
+ * @param string $applicationName the application that sends the data, used as the "type" field of logstash
54
+ * @param string $systemName the system/machine name, used as the "source" field of logstash, defaults to the hostname of the machine
55
+ * @param string $extraPrefix prefix for extra keys inside logstash "fields"
56
+ * @param string $contextPrefix prefix for context keys inside logstash "fields", defaults to ctxt_
57
+ * @param int $version the logstash format version to use, defaults to 0
58
+ */
59
+ public function __construct($applicationName, $systemName = null, $extraPrefix = null, $contextPrefix = 'ctxt_', $version = self::V0)
60
+ {
61
+ // logstash requires a ISO 8601 format date with optional millisecond precision.
62
+ parent::__construct('Y-m-d\TH:i:s.uP');
63
+
64
+ $this->systemName = $systemName ?: gethostname();
65
+ $this->applicationName = $applicationName;
66
+ $this->extraPrefix = $extraPrefix;
67
+ $this->contextPrefix = $contextPrefix;
68
+ $this->version = $version;
69
+ }
70
+
71
+ /**
72
+ * {@inheritdoc}
73
+ */
74
+ public function format(array $record)
75
+ {
76
+ $record = parent::format($record);
77
+
78
+ if ($this->version === self::V1) {
79
+ $message = $this->formatV1($record);
80
+ } else {
81
+ $message = $this->formatV0($record);
82
+ }
83
+
84
+ return $this->toJson($message) . "\n";
85
+ }
86
+
87
+ protected function formatV0(array $record)
88
+ {
89
+ if (empty($record['datetime'])) {
90
+ $record['datetime'] = gmdate('c');
91
+ }
92
+ $message = array(
93
+ '@timestamp' => $record['datetime'],
94
+ '@source' => $this->systemName,
95
+ '@fields' => array(),
96
+ );
97
+ if (isset($record['message'])) {
98
+ $message['@message'] = $record['message'];
99
+ }
100
+ if (isset($record['channel'])) {
101
+ $message['@tags'] = array($record['channel']);
102
+ $message['@fields']['channel'] = $record['channel'];
103
+ }
104
+ if (isset($record['level'])) {
105
+ $message['@fields']['level'] = $record['level'];
106
+ }
107
+ if ($this->applicationName) {
108
+ $message['@type'] = $this->applicationName;
109
+ }
110
+ if (isset($record['extra']['server'])) {
111
+ $message['@source_host'] = $record['extra']['server'];
112
+ }
113
+ if (isset($record['extra']['url'])) {
114
+ $message['@source_path'] = $record['extra']['url'];
115
+ }
116
+ if (!empty($record['extra'])) {
117
+ foreach ($record['extra'] as $key => $val) {
118
+ $message['@fields'][$this->extraPrefix . $key] = $val;
119
+ }
120
+ }
121
+ if (!empty($record['context'])) {
122
+ foreach ($record['context'] as $key => $val) {
123
+ $message['@fields'][$this->contextPrefix . $key] = $val;
124
+ }
125
+ }
126
+
127
+ return $message;
128
+ }
129
+
130
+ protected function formatV1(array $record)
131
+ {
132
+ if (empty($record['datetime'])) {
133
+ $record['datetime'] = gmdate('c');
134
+ }
135
+ $message = array(
136
+ '@timestamp' => $record['datetime'],
137
+ '@version' => 1,
138
+ 'host' => $this->systemName,
139
+ );
140
+ if (isset($record['message'])) {
141
+ $message['message'] = $record['message'];
142
+ }
143
+ if (isset($record['channel'])) {
144
+ $message['type'] = $record['channel'];
145
+ $message['channel'] = $record['channel'];
146
+ }
147
+ if (isset($record['level_name'])) {
148
+ $message['level'] = $record['level_name'];
149
+ }
150
+ if ($this->applicationName) {
151
+ $message['type'] = $this->applicationName;
152
+ }
153
+ if (!empty($record['extra'])) {
154
+ foreach ($record['extra'] as $key => $val) {
155
+ $message[$this->extraPrefix . $key] = $val;
156
+ }
157
+ }
158
+ if (!empty($record['context'])) {
159
+ foreach ($record['context'] as $key => $val) {
160
+ $message[$this->contextPrefix . $key] = $val;
161
+ }
162
+ }
163
+
164
+ return $message;
165
+ }
166
+ }
lib/vendor/monolog/monolog/src/Monolog/Formatter/MongoDBFormatter.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Formatter;
13
+
14
+ /**
15
+ * Formats a record for use with the MongoDBHandler.
16
+ *
17
+ * @author Florian Plattner <me@florianplattner.de>
18
+ */
19
+ class MongoDBFormatter implements FormatterInterface
20
+ {
21
+ private $exceptionTraceAsString;
22
+ private $maxNestingLevel;
23
+
24
+ /**
25
+ * @param int $maxNestingLevel 0 means infinite nesting, the $record itself is level 1, $record['context'] is 2
26
+ * @param bool $exceptionTraceAsString set to false to log exception traces as a sub documents instead of strings
27
+ */
28
+ public function __construct($maxNestingLevel = 3, $exceptionTraceAsString = true)
29
+ {
30
+ $this->maxNestingLevel = max($maxNestingLevel, 0);
31
+ $this->exceptionTraceAsString = (bool) $exceptionTraceAsString;
32
+ }
33
+
34
+ /**
35
+ * {@inheritDoc}
36
+ */
37
+ public function format(array $record)
38
+ {
39
+ return $this->formatArray($record);
40
+ }
41
+
42
+ /**
43
+ * {@inheritDoc}
44
+ */
45
+ public function formatBatch(array $records)
46
+ {
47
+ foreach ($records as $key => $record) {
48
+ $records[$key] = $this->format($record);
49
+ }
50
+
51
+ return $records;
52
+ }
53
+
54
+ protected function formatArray(array $record, $nestingLevel = 0)
55
+ {
56
+ if ($this->maxNestingLevel == 0 || $nestingLevel <= $this->maxNestingLevel) {
57
+ foreach ($record as $name => $value) {
58
+ if ($value instanceof \DateTime) {
59
+ $record[$name] = $this->formatDate($value, $nestingLevel + 1);
60
+ } elseif ($value instanceof \Exception) {
61
+ $record[$name] = $this->formatException($value, $nestingLevel + 1);
62
+ } elseif (is_array($value)) {
63
+ $record[$name] = $this->formatArray($value, $nestingLevel + 1);
64
+ } elseif (is_object($value)) {
65
+ $record[$name] = $this->formatObject($value, $nestingLevel + 1);
66
+ }
67
+ }
68
+ } else {
69
+ $record = '[...]';
70
+ }
71
+
72
+ return $record;
73
+ }
74
+
75
+ protected function formatObject($value, $nestingLevel)
76
+ {
77
+ $objectVars = get_object_vars($value);
78
+ $objectVars['class'] = get_class($value);
79
+
80
+ return $this->formatArray($objectVars, $nestingLevel);
81
+ }
82
+
83
+ protected function formatException(\Exception $exception, $nestingLevel)
84
+ {
85
+ $formattedException = array(
86
+ 'class' => get_class($exception),
87
+ 'message' => $exception->getMessage(),
88
+ 'code' => $exception->getCode(),
89
+ 'file' => $exception->getFile() . ':' . $exception->getLine(),
90
+ );
91
+
92
+ if ($this->exceptionTraceAsString === true) {
93
+ $formattedException['trace'] = $exception->getTraceAsString();
94
+ } else {
95
+ $formattedException['trace'] = $exception->getTrace();
96
+ }
97
+
98
+ return $this->formatArray($formattedException, $nestingLevel);
99
+ }
100
+
101
+ protected function formatDate(\DateTime $value, $nestingLevel)
102
+ {
103
+ return new \MongoDate($value->getTimestamp());
104
+ }
105
+ }
lib/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php ADDED
@@ -0,0 +1,297 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Formatter;
13
+
14
+ use Exception;
15
+
16
+ /**
17
+ * Normalizes incoming records to remove objects/resources so it's easier to dump to various targets
18
+ *
19
+ * @author Jordi Boggiano <j.boggiano@seld.be>
20
+ */
21
+ class NormalizerFormatter implements FormatterInterface
22
+ {
23
+ const SIMPLE_DATE = "Y-m-d H:i:s";
24
+
25
+ protected $dateFormat;
26
+
27
+ /**
28
+ * @param string $dateFormat The format of the timestamp: one supported by DateTime::format
29
+ */
30
+ public function __construct($dateFormat = null)
31
+ {
32
+ $this->dateFormat = $dateFormat ?: static::SIMPLE_DATE;
33
+ if (!function_exists('json_encode')) {
34
+ throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s NormalizerFormatter');
35
+ }
36
+ }
37
+
38
+ /**
39
+ * {@inheritdoc}
40
+ */
41
+ public function format(array $record)
42
+ {
43
+ return $this->normalize($record);
44
+ }
45
+
46
+ /**
47
+ * {@inheritdoc}
48
+ */
49
+ public function formatBatch(array $records)
50
+ {
51
+ foreach ($records as $key => $record) {
52
+ $records[$key] = $this->format($record);
53
+ }
54
+
55
+ return $records;
56
+ }
57
+
58
+ protected function normalize($data)
59
+ {
60
+ if (null === $data || is_scalar($data)) {
61
+ if (is_float($data)) {
62
+ if (is_infinite($data)) {
63
+ return ($data > 0 ? '' : '-') . 'INF';
64
+ }
65
+ if (is_nan($data)) {
66
+ return 'NaN';
67
+ }
68
+ }
69
+
70
+ return $data;
71
+ }
72
+
73
+ if (is_array($data)) {
74
+ $normalized = array();
75
+
76
+ $count = 1;
77
+ foreach ($data as $key => $value) {
78
+ if ($count++ >= 1000) {
79
+ $normalized['...'] = 'Over 1000 items ('.count($data).' total), aborting normalization';
80
+ break;
81
+ }
82
+ $normalized[$key] = $this->normalize($value);
83
+ }
84
+
85
+ return $normalized;
86
+ }
87
+
88
+ if ($data instanceof \DateTime) {
89
+ return $data->format($this->dateFormat);
90
+ }
91
+
92
+ if (is_object($data)) {
93
+ // TODO 2.0 only check for Throwable
94
+ if ($data instanceof Exception || (PHP_VERSION_ID > 70000 && $data instanceof \Throwable)) {
95
+ return $this->normalizeException($data);
96
+ }
97
+
98
+ // non-serializable objects that implement __toString stringified
99
+ if (method_exists($data, '__toString') && !$data instanceof \JsonSerializable) {
100
+ $value = $data->__toString();
101
+ } else {
102
+ // the rest is json-serialized in some way
103
+ $value = $this->toJson($data, true);
104
+ }
105
+
106
+ return sprintf("[object] (%s: %s)", get_class($data), $value);
107
+ }
108
+
109
+ if (is_resource($data)) {
110
+ return sprintf('[resource] (%s)', get_resource_type($data));
111
+ }
112
+
113
+ return '[unknown('.gettype($data).')]';
114
+ }
115
+
116
+ protected function normalizeException($e)
117
+ {
118
+ // TODO 2.0 only check for Throwable
119
+ if (!$e instanceof Exception && !$e instanceof \Throwable) {
120
+ throw new \InvalidArgumentException('Exception/Throwable expected, got '.gettype($e).' / '.get_class($e));
121
+ }
122
+
123
+ $data = array(
124
+ 'class' => get_class($e),
125
+ 'message' => $e->getMessage(),
126
+ 'code' => $e->getCode(),
127
+ 'file' => $e->getFile().':'.$e->getLine(),
128
+ );
129
+
130
+ if ($e instanceof \SoapFault) {
131
+ if (isset($e->faultcode)) {
132
+ $data['faultcode'] = $e->faultcode;
133
+ }
134
+
135
+ if (isset($e->faultactor)) {
136
+ $data['faultactor'] = $e->faultactor;
137
+ }
138
+
139
+ if (isset($e->detail)) {
140
+ $data['detail'] = $e->detail;
141
+ }
142
+ }
143
+
144
+ $trace = $e->getTrace();
145
+ foreach ($trace as $frame) {
146
+ if (isset($frame['file'])) {
147
+ $data['trace'][] = $frame['file'].':'.$frame['line'];
148
+ } elseif (isset($frame['function']) && $frame['function'] === '{closure}') {
149
+ // We should again normalize the frames, because it might contain invalid items
150
+ $data['trace'][] = $frame['function'];
151
+ } else {
152
+ // We should again normalize the frames, because it might contain invalid items
153
+ $data['trace'][] = $this->toJson($this->normalize($frame), true);
154
+ }
155
+ }
156
+
157
+ if ($previous = $e->getPrevious()) {
158
+ $data['previous'] = $this->normalizeException($previous);
159
+ }
160
+
161
+ return $data;
162
+ }
163
+
164
+ /**
165
+ * Return the JSON representation of a value
166
+ *
167
+ * @param mixed $data
168
+ * @param bool $ignoreErrors
169
+ * @throws \RuntimeException if encoding fails and errors are not ignored
170
+ * @return string
171
+ */
172
+ protected function toJson($data, $ignoreErrors = false)
173
+ {
174
+ // suppress json_encode errors since it's twitchy with some inputs
175
+ if ($ignoreErrors) {
176
+ return @$this->jsonEncode($data);
177
+ }
178
+
179
+ $json = $this->jsonEncode($data);
180
+
181
+ if ($json === false) {
182
+ $json = $this->handleJsonError(json_last_error(), $data);
183
+ }
184
+
185
+ return $json;
186
+ }
187
+
188
+ /**
189
+ * @param mixed $data
190
+ * @return string JSON encoded data or null on failure
191
+ */
192
+ private function jsonEncode($data)
193
+ {
194
+ if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
195
+ return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
196
+ }
197
+
198
+ return json_encode($data);
199
+ }
200
+
201
+ /**
202
+ * Handle a json_encode failure.
203
+ *
204
+ * If the failure is due to invalid string encoding, try to clean the
205
+ * input and encode again. If the second encoding attempt fails, the
206
+ * inital error is not encoding related or the input can't be cleaned then
207
+ * raise a descriptive exception.
208
+ *
209
+ * @param int $code return code of json_last_error function
210
+ * @param mixed $data data that was meant to be encoded
211
+ * @throws \RuntimeException if failure can't be corrected
212
+ * @return string JSON encoded data after error correction
213
+ */
214
+ private function handleJsonError($code, $data)
215
+ {
216
+ if ($code !== JSON_ERROR_UTF8) {
217
+ $this->throwEncodeError($code, $data);
218
+ }
219
+
220
+ if (is_string($data)) {
221
+ $this->detectAndCleanUtf8($data);
222
+ } elseif (is_array($data)) {
223
+ array_walk_recursive($data, array($this, 'detectAndCleanUtf8'));
224
+ } else {
225
+ $this->throwEncodeError($code, $data);
226
+ }
227
+
228
+ $json = $this->jsonEncode($data);
229
+
230
+ if ($json === false) {
231
+ $this->throwEncodeError(json_last_error(), $data);
232
+ }
233
+
234
+ return $json;
235
+ }
236
+
237
+ /**
238
+ * Throws an exception according to a given code with a customized message
239
+ *
240
+ * @param int $code return code of json_last_error function
241
+ * @param mixed $data data that was meant to be encoded
242
+ * @throws \RuntimeException
243
+ */
244
+ private function throwEncodeError($code, $data)
245
+ {
246
+ switch ($code) {
247
+ case JSON_ERROR_DEPTH:
248
+ $msg = 'Maximum stack depth exceeded';
249
+ break;
250
+ case JSON_ERROR_STATE_MISMATCH:
251
+ $msg = 'Underflow or the modes mismatch';
252
+ break;
253
+ case JSON_ERROR_CTRL_CHAR:
254
+ $msg = 'Unexpected control character found';
255
+ break;
256
+ case JSON_ERROR_UTF8:
257
+ $msg = 'Malformed UTF-8 characters, possibly incorrectly encoded';
258
+ break;
259
+ default:
260
+ $msg = 'Unknown error';
261
+ }
262
+
263
+ throw new \RuntimeException('JSON encoding failed: '.$msg.'. Encoding: '.var_export($data, true));
264
+ }
265
+
266
+ /**
267
+ * Detect invalid UTF-8 string characters and convert to valid UTF-8.
268
+ *
269
+ * Valid UTF-8 input will be left unmodified, but strings containing
270
+ * invalid UTF-8 codepoints will be reencoded as UTF-8 with an assumed
271
+ * original encoding of ISO-8859-15. This conversion may result in
272
+ * incorrect output if the actual encoding was not ISO-8859-15, but it
273
+ * will be clean UTF-8 output and will not rely on expensive and fragile
274
+ * detection algorithms.
275
+ *
276
+ * Function converts the input in place in the passed variable so that it
277
+ * can be used as a callback for array_walk_recursive.
278
+ *
279
+ * @param mixed &$data Input to check and convert if needed
280
+ * @private
281
+ */
282
+ public function detectAndCleanUtf8(&$data)
283
+ {
284
+ if (is_string($data) && !preg_match('//u', $data)) {
285
+ $data = preg_replace_callback(
286
+ '/[\x80-\xFF]+/',
287
+ function ($m) { return utf8_encode($m[0]); },
288
+ $data
289
+ );
290
+ $data = str_replace(
291
+ array('¤', '¦', '¨', '´', '¸', '¼', '½', '¾'),
292
+ array('€', 'Š', 'š', 'Ž', 'ž', 'Œ', 'œ', 'Ÿ'),
293
+ $data
294
+ );
295
+ }
296
+ }
297
+ }
lib/vendor/monolog/monolog/src/Monolog/Formatter/ScalarFormatter.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Formatter;
13
+
14
+ /**
15
+ * Formats data into an associative array of scalar values.
16
+ * Objects and arrays will be JSON encoded.
17
+ *
18
+ * @author Andrew Lawson <adlawson@gmail.com>
19
+ */
20
+ class ScalarFormatter extends NormalizerFormatter
21
+ {
22
+ /**
23
+ * {@inheritdoc}
24
+ */
25
+ public function format(array $record)
26
+ {
27
+ foreach ($record as $key => $value) {
28
+ $record[$key] = $this->normalizeValue($value);
29
+ }
30
+
31
+ return $record;
32
+ }
33
+
34
+ /**
35
+ * @param mixed $value
36
+ * @return mixed
37
+ */
38
+ protected function normalizeValue($value)
39
+ {
40
+ $normalized = $this->normalize($value);
41
+
42
+ if (is_array($normalized) || is_object($normalized)) {
43
+ return $this->toJson($normalized, true);
44
+ }
45
+
46
+ return $normalized;
47
+ }
48
+ }
lib/vendor/monolog/monolog/src/Monolog/Formatter/WildfireFormatter.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Formatter;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Serializes a log message according to Wildfire's header requirements
18
+ *
19
+ * @author Eric Clemmons (@ericclemmons) <eric@uxdriven.com>
20
+ * @author Christophe Coevoet <stof@notk.org>
21
+ * @author Kirill chEbba Chebunin <iam@chebba.org>
22
+ */
23
+ class WildfireFormatter extends NormalizerFormatter
24
+ {
25
+ const TABLE = 'table';
26
+
27
+ /**
28
+ * Translates Monolog log levels to Wildfire levels.
29
+ */
30
+ private $logLevels = array(
31
+ Logger::DEBUG => 'LOG',
32
+ Logger::INFO => 'INFO',
33
+ Logger::NOTICE => 'INFO',
34
+ Logger::WARNING => 'WARN',
35
+ Logger::ERROR => 'ERROR',
36
+ Logger::CRITICAL => 'ERROR',
37
+ Logger::ALERT => 'ERROR',
38
+ Logger::EMERGENCY => 'ERROR',
39
+ );
40
+
41
+ /**
42
+ * {@inheritdoc}
43
+ */
44
+ public function format(array $record)
45
+ {
46
+ // Retrieve the line and file if set and remove them from the formatted extra
47
+ $file = $line = '';
48
+ if (isset($record['extra']['file'])) {
49
+ $file = $record['extra']['file'];
50
+ unset($record['extra']['file']);
51
+ }
52
+ if (isset($record['extra']['line'])) {
53
+ $line = $record['extra']['line'];
54
+ unset($record['extra']['line']);
55
+ }
56
+
57
+ $record = $this->normalize($record);
58
+ $message = array('message' => $record['message']);
59
+ $handleError = false;
60
+ if ($record['context']) {
61
+ $message['context'] = $record['context'];
62
+ $handleError = true;
63
+ }
64
+ if ($record['extra']) {
65
+ $message['extra'] = $record['extra'];
66
+ $handleError = true;
67
+ }
68
+ if (count($message) === 1) {
69
+ $message = reset($message);
70
+ }
71
+
72
+ if (isset($record['context'][self::TABLE])) {
73
+ $type = 'TABLE';
74
+ $label = $record['channel'] .': '. $record['message'];
75
+ $message = $record['context'][self::TABLE];
76
+ } else {
77
+ $type = $this->logLevels[$record['level']];
78
+ $label = $record['channel'];
79
+ }
80
+
81
+ // Create JSON object describing the appearance of the message in the console
82
+ $json = $this->toJson(array(
83
+ array(
84
+ 'Type' => $type,
85
+ 'File' => $file,
86
+ 'Line' => $line,
87
+ 'Label' => $label,
88
+ ),
89
+ $message,
90
+ ), $handleError);
91
+
92
+ // The message itself is a serialization of the above JSON object + it's length
93
+ return sprintf(
94
+ '%s|%s|',
95
+ strlen($json),
96
+ $json
97
+ );
98
+ }
99
+
100
+ public function formatBatch(array $records)
101
+ {
102
+ throw new \BadMethodCallException('Batch formatting does not make sense for the WildfireFormatter');
103
+ }
104
+
105
+ protected function normalize($data)
106
+ {
107
+ if (is_object($data) && !$data instanceof \DateTime) {
108
+ return $data;
109
+ }
110
+
111
+ return parent::normalize($data);
112
+ }
113
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+ use Monolog\Formatter\FormatterInterface;
16
+ use Monolog\Formatter\LineFormatter;
17
+
18
+ /**
19
+ * Base Handler class providing the Handler structure
20
+ *
21
+ * @author Jordi Boggiano <j.boggiano@seld.be>
22
+ */
23
+ abstract class AbstractHandler implements HandlerInterface
24
+ {
25
+ protected $level = Logger::DEBUG;
26
+ protected $bubble = true;
27
+
28
+ /**
29
+ * @var FormatterInterface
30
+ */
31
+ protected $formatter;
32
+ protected $processors = array();
33
+
34
+ /**
35
+ * @param int $level The minimum logging level at which this handler will be triggered
36
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
37
+ */
38
+ public function __construct($level = Logger::DEBUG, $bubble = true)
39
+ {
40
+ $this->setLevel($level);
41
+ $this->bubble = $bubble;
42
+ }
43
+
44
+ /**
45
+ * {@inheritdoc}
46
+ */
47
+ public function isHandling(array $record)
48
+ {
49
+ return $record['level'] >= $this->level;
50
+ }
51
+
52
+ /**
53
+ * {@inheritdoc}
54
+ */
55
+ public function handleBatch(array $records)
56
+ {
57
+ foreach ($records as $record) {
58
+ $this->handle($record);
59
+ }
60
+ }
61
+
62
+ /**
63
+ * Closes the handler.
64
+ *
65
+ * This will be called automatically when the object is destroyed
66
+ */
67
+ public function close()
68
+ {
69
+ }
70
+
71
+ /**
72
+ * {@inheritdoc}
73
+ */
74
+ public function pushProcessor($callback)
75
+ {
76
+ if (!is_callable($callback)) {
77
+ throw new \InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given');
78
+ }
79
+ array_unshift($this->processors, $callback);
80
+
81
+ return $this;
82
+ }
83
+
84
+ /**
85
+ * {@inheritdoc}
86
+ */
87
+ public function popProcessor()
88
+ {
89
+ if (!$this->processors) {
90
+ throw new \LogicException('You tried to pop from an empty processor stack.');
91
+ }
92
+
93
+ return array_shift($this->processors);
94
+ }
95
+
96
+ /**
97
+ * {@inheritdoc}
98
+ */
99
+ public function setFormatter(FormatterInterface $formatter)
100
+ {
101
+ $this->formatter = $formatter;
102
+
103
+ return $this;
104
+ }
105
+
106
+ /**
107
+ * {@inheritdoc}
108
+ */
109
+ public function getFormatter()
110
+ {
111
+ if (!$this->formatter) {
112
+ $this->formatter = $this->getDefaultFormatter();
113
+ }
114
+
115
+ return $this->formatter;
116
+ }
117
+
118
+ /**
119
+ * Sets minimum logging level at which this handler will be triggered.
120
+ *
121
+ * @param int|string $level Level or level name
122
+ * @return self
123
+ */
124
+ public function setLevel($level)
125
+ {
126
+ $this->level = Logger::toMonologLevel($level);
127
+
128
+ return $this;
129
+ }
130
+
131
+ /**
132
+ * Gets minimum logging level at which this handler will be triggered.
133
+ *
134
+ * @return int
135
+ */
136
+ public function getLevel()
137
+ {
138
+ return $this->level;
139
+ }
140
+
141
+ /**
142
+ * Sets the bubbling behavior.
143
+ *
144
+ * @param Boolean $bubble true means that this handler allows bubbling.
145
+ * false means that bubbling is not permitted.
146
+ * @return self
147
+ */
148
+ public function setBubble($bubble)
149
+ {
150
+ $this->bubble = $bubble;
151
+
152
+ return $this;
153
+ }
154
+
155
+ /**
156
+ * Gets the bubbling behavior.
157
+ *
158
+ * @return Boolean true means that this handler allows bubbling.
159
+ * false means that bubbling is not permitted.
160
+ */
161
+ public function getBubble()
162
+ {
163
+ return $this->bubble;
164
+ }
165
+
166
+ public function __destruct()
167
+ {
168
+ try {
169
+ $this->close();
170
+ } catch (\Exception $e) {
171
+ // do nothing
172
+ } catch (\Throwable $e) {
173
+ // do nothing
174
+ }
175
+ }
176
+
177
+ /**
178
+ * Gets the default formatter.
179
+ *
180
+ * @return FormatterInterface
181
+ */
182
+ protected function getDefaultFormatter()
183
+ {
184
+ return new LineFormatter();
185
+ }
186
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ /**
15
+ * Base Handler class providing the Handler structure
16
+ *
17
+ * Classes extending it should (in most cases) only implement write($record)
18
+ *
19
+ * @author Jordi Boggiano <j.boggiano@seld.be>
20
+ * @author Christophe Coevoet <stof@notk.org>
21
+ */
22
+ abstract class AbstractProcessingHandler extends AbstractHandler
23
+ {
24
+ /**
25
+ * {@inheritdoc}
26
+ */
27
+ public function handle(array $record)
28
+ {
29
+ if (!$this->isHandling($record)) {
30
+ return false;
31
+ }
32
+
33
+ $record = $this->processRecord($record);
34
+
35
+ $record['formatted'] = $this->getFormatter()->format($record);
36
+
37
+ $this->write($record);
38
+
39
+ return false === $this->bubble;
40
+ }
41
+
42
+ /**
43
+ * Writes the record down to the log of the implementing handler
44
+ *
45
+ * @param array $record
46
+ * @return void
47
+ */
48
+ abstract protected function write(array $record);
49
+
50
+ /**
51
+ * Processes a record.
52
+ *
53
+ * @param array $record
54
+ * @return array
55
+ */
56
+ protected function processRecord(array $record)
57
+ {
58
+ if ($this->processors) {
59
+ foreach ($this->processors as $processor) {
60
+ $record = call_user_func($processor, $record);
61
+ }
62
+ }
63
+
64
+ return $record;
65
+ }
66
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/AbstractSyslogHandler.php ADDED
@@ -0,0 +1,101 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+ use Monolog\Formatter\LineFormatter;
16
+
17
+ /**
18
+ * Common syslog functionality
19
+ */
20
+ abstract class AbstractSyslogHandler extends AbstractProcessingHandler
21
+ {
22
+ protected $facility;
23
+
24
+ /**
25
+ * Translates Monolog log levels to syslog log priorities.
26
+ */
27
+ protected $logLevels = array(
28
+ Logger::DEBUG => LOG_DEBUG,
29
+ Logger::INFO => LOG_INFO,
30
+ Logger::NOTICE => LOG_NOTICE,
31
+ Logger::WARNING => LOG_WARNING,
32
+ Logger::ERROR => LOG_ERR,
33
+ Logger::CRITICAL => LOG_CRIT,
34
+ Logger::ALERT => LOG_ALERT,
35
+ Logger::EMERGENCY => LOG_EMERG,
36
+ );
37
+
38
+ /**
39
+ * List of valid log facility names.
40
+ */
41
+ protected $facilities = array(
42
+ 'auth' => LOG_AUTH,
43
+ 'authpriv' => LOG_AUTHPRIV,
44
+ 'cron' => LOG_CRON,
45
+ 'daemon' => LOG_DAEMON,
46
+ 'kern' => LOG_KERN,
47
+ 'lpr' => LOG_LPR,
48
+ 'mail' => LOG_MAIL,
49
+ 'news' => LOG_NEWS,
50
+ 'syslog' => LOG_SYSLOG,
51
+ 'user' => LOG_USER,
52
+ 'uucp' => LOG_UUCP,
53
+ );
54
+
55
+ /**
56
+ * @param mixed $facility
57
+ * @param int $level The minimum logging level at which this handler will be triggered
58
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
59
+ */
60
+ public function __construct($facility = LOG_USER, $level = Logger::DEBUG, $bubble = true)
61
+ {
62
+ parent::__construct($level, $bubble);
63
+
64
+ if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
65
+ $this->facilities['local0'] = LOG_LOCAL0;
66
+ $this->facilities['local1'] = LOG_LOCAL1;
67
+ $this->facilities['local2'] = LOG_LOCAL2;
68
+ $this->facilities['local3'] = LOG_LOCAL3;
69
+ $this->facilities['local4'] = LOG_LOCAL4;
70
+ $this->facilities['local5'] = LOG_LOCAL5;
71
+ $this->facilities['local6'] = LOG_LOCAL6;
72
+ $this->facilities['local7'] = LOG_LOCAL7;
73
+ } else {
74
+ $this->facilities['local0'] = 128; // LOG_LOCAL0
75
+ $this->facilities['local1'] = 136; // LOG_LOCAL1
76
+ $this->facilities['local2'] = 144; // LOG_LOCAL2
77
+ $this->facilities['local3'] = 152; // LOG_LOCAL3
78
+ $this->facilities['local4'] = 160; // LOG_LOCAL4
79
+ $this->facilities['local5'] = 168; // LOG_LOCAL5
80
+ $this->facilities['local6'] = 176; // LOG_LOCAL6
81
+ $this->facilities['local7'] = 184; // LOG_LOCAL7
82
+ }
83
+
84
+ // convert textual description of facility to syslog constant
85
+ if (array_key_exists(strtolower($facility), $this->facilities)) {
86
+ $facility = $this->facilities[strtolower($facility)];
87
+ } elseif (!in_array($facility, array_values($this->facilities), true)) {
88
+ throw new \UnexpectedValueException('Unknown facility value "'.$facility.'" given');
89
+ }
90
+
91
+ $this->facility = $facility;
92
+ }
93
+
94
+ /**
95
+ * {@inheritdoc}
96
+ */
97
+ protected function getDefaultFormatter()
98
+ {
99
+ return new LineFormatter('%channel%.%level_name%: %message% %context% %extra%');
100
+ }
101
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/AmqpHandler.php ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+ use Monolog\Formatter\JsonFormatter;
16
+ use PhpAmqpLib\Message\AMQPMessage;
17
+ use PhpAmqpLib\Channel\AMQPChannel;
18
+ use AMQPExchange;
19
+
20
+ class AmqpHandler extends AbstractProcessingHandler
21
+ {
22
+ /**
23
+ * @var AMQPExchange|AMQPChannel $exchange
24
+ */
25
+ protected $exchange;
26
+
27
+ /**
28
+ * @var string
29
+ */
30
+ protected $exchangeName;
31
+
32
+ /**
33
+ * @param AMQPExchange|AMQPChannel $exchange AMQPExchange (php AMQP ext) or PHP AMQP lib channel, ready for use
34
+ * @param string $exchangeName
35
+ * @param int $level
36
+ * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
37
+ */
38
+ public function __construct($exchange, $exchangeName = 'log', $level = Logger::DEBUG, $bubble = true)
39
+ {
40
+ if ($exchange instanceof AMQPExchange) {
41
+ $exchange->setName($exchangeName);
42
+ } elseif ($exchange instanceof AMQPChannel) {
43
+ $this->exchangeName = $exchangeName;
44
+ } else {
45
+ throw new \InvalidArgumentException('PhpAmqpLib\Channel\AMQPChannel or AMQPExchange instance required');
46
+ }
47
+ $this->exchange = $exchange;
48
+
49
+ parent::__construct($level, $bubble);
50
+ }
51
+
52
+ /**
53
+ * {@inheritDoc}
54
+ */
55
+ protected function write(array $record)
56
+ {
57
+ $data = $record["formatted"];
58
+ $routingKey = $this->getRoutingKey($record);
59
+
60
+ if ($this->exchange instanceof AMQPExchange) {
61
+ $this->exchange->publish(
62
+ $data,
63
+ $routingKey,
64
+ 0,
65
+ array(
66
+ 'delivery_mode' => 2,
67
+ 'content_type' => 'application/json',
68
+ )
69
+ );
70
+ } else {
71
+ $this->exchange->basic_publish(
72
+ $this->createAmqpMessage($data),
73
+ $this->exchangeName,
74
+ $routingKey
75
+ );
76
+ }
77
+ }
78
+
79
+ /**
80
+ * {@inheritDoc}
81
+ */
82
+ public function handleBatch(array $records)
83
+ {
84
+ if ($this->exchange instanceof AMQPExchange) {
85
+ parent::handleBatch($records);
86
+
87
+ return;
88
+ }
89
+
90
+ foreach ($records as $record) {
91
+ if (!$this->isHandling($record)) {
92
+ continue;
93
+ }
94
+
95
+ $record = $this->processRecord($record);
96
+ $data = $this->getFormatter()->format($record);
97
+
98
+ $this->exchange->batch_basic_publish(
99
+ $this->createAmqpMessage($data),
100
+ $this->exchangeName,
101
+ $this->getRoutingKey($record)
102
+ );
103
+ }
104
+
105
+ $this->exchange->publish_batch();
106
+ }
107
+
108
+ /**
109
+ * Gets the routing key for the AMQP exchange
110
+ *
111
+ * @param array $record
112
+ * @return string
113
+ */
114
+ protected function getRoutingKey(array $record)
115
+ {
116
+ $routingKey = sprintf(
117
+ '%s.%s',
118
+ // TODO 2.0 remove substr call
119
+ substr($record['level_name'], 0, 4),
120
+ $record['channel']
121
+ );
122
+
123
+ return strtolower($routingKey);
124
+ }
125
+
126
+ /**
127
+ * @param string $data
128
+ * @return AMQPMessage
129
+ */
130
+ private function createAmqpMessage($data)
131
+ {
132
+ return new AMQPMessage(
133
+ (string) $data,
134
+ array(
135
+ 'delivery_mode' => 2,
136
+ 'content_type' => 'application/json',
137
+ )
138
+ );
139
+ }
140
+
141
+ /**
142
+ * {@inheritDoc}
143
+ */
144
+ protected function getDefaultFormatter()
145
+ {
146
+ return new JsonFormatter(JsonFormatter::BATCH_MODE_JSON, false);
147
+ }
148
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/BrowserConsoleHandler.php ADDED
@@ -0,0 +1,230 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Formatter\LineFormatter;
15
+
16
+ /**
17
+ * Handler sending logs to browser's javascript console with no browser extension required
18
+ *
19
+ * @author Olivier Poitrey <rs@dailymotion.com>
20
+ */
21
+ class BrowserConsoleHandler extends AbstractProcessingHandler
22
+ {
23
+ protected static $initialized = false;
24
+ protected static $records = array();
25
+
26
+ /**
27
+ * {@inheritDoc}
28
+ *
29
+ * Formatted output may contain some formatting markers to be transferred to `console.log` using the %c format.
30
+ *
31
+ * Example of formatted string:
32
+ *
33
+ * You can do [[blue text]]{color: blue} or [[green background]]{background-color: green; color: white}
34
+ */
35
+ protected function getDefaultFormatter()
36
+ {
37
+ return new LineFormatter('[[%channel%]]{macro: autolabel} [[%level_name%]]{font-weight: bold} %message%');
38
+ }
39
+
40
+ /**
41
+ * {@inheritDoc}
42
+ */
43
+ protected function write(array $record)
44
+ {
45
+ // Accumulate records
46
+ self::$records[] = $record;
47
+
48
+ // Register shutdown handler if not already done
49
+ if (!self::$initialized) {
50
+ self::$initialized = true;
51
+ $this->registerShutdownFunction();
52
+ }
53
+ }
54
+
55
+ /**
56
+ * Convert records to javascript console commands and send it to the browser.
57
+ * This method is automatically called on PHP shutdown if output is HTML or Javascript.
58
+ */
59
+ public static function send()
60
+ {
61
+ $format = self::getResponseFormat();
62
+ if ($format === 'unknown') {
63
+ return;
64
+ }
65
+
66
+ if (count(self::$records)) {
67
+ if ($format === 'html') {
68
+ self::writeOutput('<script>' . self::generateScript() . '</script>');
69
+ } elseif ($format === 'js') {
70
+ self::writeOutput(self::generateScript());
71
+ }
72
+ self::reset();
73
+ }
74
+ }
75
+
76
+ /**
77
+ * Forget all logged records
78
+ */
79
+ public static function reset()
80
+ {
81
+ self::$records = array();
82
+ }
83
+
84
+ /**
85
+ * Wrapper for register_shutdown_function to allow overriding
86
+ */
87
+ protected function registerShutdownFunction()
88
+ {
89
+ if (PHP_SAPI !== 'cli') {
90
+ register_shutdown_function(array('Monolog\Handler\BrowserConsoleHandler', 'send'));
91
+ }
92
+ }
93
+
94
+ /**
95
+ * Wrapper for echo to allow overriding
96
+ *
97
+ * @param string $str
98
+ */
99
+ protected static function writeOutput($str)
100
+ {
101
+ echo $str;
102
+ }
103
+
104
+ /**
105
+ * Checks the format of the response
106
+ *
107
+ * If Content-Type is set to application/javascript or text/javascript -> js
108
+ * If Content-Type is set to text/html, or is unset -> html
109
+ * If Content-Type is anything else -> unknown
110
+ *
111
+ * @return string One of 'js', 'html' or 'unknown'
112
+ */
113
+ protected static function getResponseFormat()
114
+ {
115
+ // Check content type
116
+ foreach (headers_list() as $header) {
117
+ if (stripos($header, 'content-type:') === 0) {
118
+ // This handler only works with HTML and javascript outputs
119
+ // text/javascript is obsolete in favour of application/javascript, but still used
120
+ if (stripos($header, 'application/javascript') !== false || stripos($header, 'text/javascript') !== false) {
121
+ return 'js';
122
+ }
123
+ if (stripos($header, 'text/html') === false) {
124
+ return 'unknown';
125
+ }
126
+ break;
127
+ }
128
+ }
129
+
130
+ return 'html';
131
+ }
132
+
133
+ private static function generateScript()
134
+ {
135
+ $script = array();
136
+ foreach (self::$records as $record) {
137
+ $context = self::dump('Context', $record['context']);
138
+ $extra = self::dump('Extra', $record['extra']);
139
+
140
+ if (empty($context) && empty($extra)) {
141
+ $script[] = self::call_array('log', self::handleStyles($record['formatted']));
142
+ } else {
143
+ $script = array_merge($script,
144
+ array(self::call_array('groupCollapsed', self::handleStyles($record['formatted']))),
145
+ $context,
146
+ $extra,
147
+ array(self::call('groupEnd'))
148
+ );
149
+ }
150
+ }
151
+
152
+ return "(function (c) {if (c && c.groupCollapsed) {\n" . implode("\n", $script) . "\n}})(console);";
153
+ }
154
+
155
+ private static function handleStyles($formatted)
156
+ {
157
+ $args = array(self::quote('font-weight: normal'));
158
+ $format = '%c' . $formatted;
159
+ preg_match_all('/\[\[(.*?)\]\]\{([^}]*)\}/s', $format, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
160
+
161
+ foreach (array_reverse($matches) as $match) {
162
+ $args[] = self::quote(self::handleCustomStyles($match[2][0], $match[1][0]));
163
+ $args[] = '"font-weight: normal"';
164
+
165
+ $pos = $match[0][1];
166
+ $format = substr($format, 0, $pos) . '%c' . $match[1][0] . '%c' . substr($format, $pos + strlen($match[0][0]));
167
+ }
168
+
169
+ array_unshift($args, self::quote($format));
170
+
171
+ return $args;
172
+ }
173
+
174
+ private static function handleCustomStyles($style, $string)
175
+ {
176
+ static $colors = array('blue', 'green', 'red', 'magenta', 'orange', 'black', 'grey');
177
+ static $labels = array();
178
+
179
+ return preg_replace_callback('/macro\s*:(.*?)(?:;|$)/', function ($m) use ($string, &$colors, &$labels) {
180
+ if (trim($m[1]) === 'autolabel') {
181
+ // Format the string as a label with consistent auto assigned background color
182
+ if (!isset($labels[$string])) {
183
+ $labels[$string] = $colors[count($labels) % count($colors)];
184
+ }
185
+ $color = $labels[$string];
186
+
187
+ return "background-color: $color; color: white; border-radius: 3px; padding: 0 2px 0 2px";
188
+ }
189
+
190
+ return $m[1];
191
+ }, $style);
192
+ }
193
+
194
+ private static function dump($title, array $dict)
195
+ {
196
+ $script = array();
197
+ $dict = array_filter($dict);
198
+ if (empty($dict)) {
199
+ return $script;
200
+ }
201
+ $script[] = self::call('log', self::quote('%c%s'), self::quote('font-weight: bold'), self::quote($title));
202
+ foreach ($dict as $key => $value) {
203
+ $value = json_encode($value);
204
+ if (empty($value)) {
205
+ $value = self::quote('');
206
+ }
207
+ $script[] = self::call('log', self::quote('%s: %o'), self::quote($key), $value);
208
+ }
209
+
210
+ return $script;
211
+ }
212
+
213
+ private static function quote($arg)
214
+ {
215
+ return '"' . addcslashes($arg, "\"\n\\") . '"';
216
+ }
217
+
218
+ private static function call()
219
+ {
220
+ $args = func_get_args();
221
+ $method = array_shift($args);
222
+
223
+ return self::call_array($method, $args);
224
+ }
225
+
226
+ private static function call_array($method, array $args)
227
+ {
228
+ return 'c.' . $method . '(' . implode(', ', $args) . ');';
229
+ }
230
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/BufferHandler.php ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Buffers all records until closing the handler and then pass them as batch.
18
+ *
19
+ * This is useful for a MailHandler to send only one mail per request instead of
20
+ * sending one per log message.
21
+ *
22
+ * @author Christophe Coevoet <stof@notk.org>
23
+ */
24
+ class BufferHandler extends AbstractHandler
25
+ {
26
+ protected $handler;
27
+ protected $bufferSize = 0;
28
+ protected $bufferLimit;
29
+ protected $flushOnOverflow;
30
+ protected $buffer = array();
31
+ protected $initialized = false;
32
+
33
+ /**
34
+ * @param HandlerInterface $handler Handler.
35
+ * @param int $bufferLimit How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
36
+ * @param int $level The minimum logging level at which this handler will be triggered
37
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
38
+ * @param Boolean $flushOnOverflow If true, the buffer is flushed when the max size has been reached, by default oldest entries are discarded
39
+ */
40
+ public function __construct(HandlerInterface $handler, $bufferLimit = 0, $level = Logger::DEBUG, $bubble = true, $flushOnOverflow = false)
41
+ {
42
+ parent::__construct($level, $bubble);
43
+ $this->handler = $handler;
44
+ $this->bufferLimit = (int) $bufferLimit;
45
+ $this->flushOnOverflow = $flushOnOverflow;
46
+ }
47
+
48
+ /**
49
+ * {@inheritdoc}
50
+ */
51
+ public function handle(array $record)
52
+ {
53
+ if ($record['level'] < $this->level) {
54
+ return false;
55
+ }
56
+
57
+ if (!$this->initialized) {
58
+ // __destructor() doesn't get called on Fatal errors
59
+ register_shutdown_function(array($this, 'close'));
60
+ $this->initialized = true;
61
+ }
62
+
63
+ if ($this->bufferLimit > 0 && $this->bufferSize === $this->bufferLimit) {
64
+ if ($this->flushOnOverflow) {
65
+ $this->flush();
66
+ } else {
67
+ array_shift($this->buffer);
68
+ $this->bufferSize--;
69
+ }
70
+ }
71
+
72
+ if ($this->processors) {
73
+ foreach ($this->processors as $processor) {
74
+ $record = call_user_func($processor, $record);
75
+ }
76
+ }
77
+
78
+ $this->buffer[] = $record;
79
+ $this->bufferSize++;
80
+
81
+ return false === $this->bubble;
82
+ }
83
+
84
+ public function flush()
85
+ {
86
+ if ($this->bufferSize === 0) {
87
+ return;
88
+ }
89
+
90
+ $this->handler->handleBatch($this->buffer);
91
+ $this->clear();
92
+ }
93
+
94
+ public function __destruct()
95
+ {
96
+ // suppress the parent behavior since we already have register_shutdown_function()
97
+ // to call close(), and the reference contained there will prevent this from being
98
+ // GC'd until the end of the request
99
+ }
100
+
101
+ /**
102
+ * {@inheritdoc}
103
+ */
104
+ public function close()
105
+ {
106
+ $this->flush();
107
+ }
108
+
109
+ /**
110
+ * Clears the buffer without flushing any messages down to the wrapped handler.
111
+ */
112
+ public function clear()
113
+ {
114
+ $this->bufferSize = 0;
115
+ $this->buffer = array();
116
+ }
117
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Formatter\ChromePHPFormatter;
15
+ use Monolog\Logger;
16
+
17
+ /**
18
+ * Handler sending logs to the ChromePHP extension (http://www.chromephp.com/)
19
+ *
20
+ * This also works out of the box with Firefox 43+
21
+ *
22
+ * @author Christophe Coevoet <stof@notk.org>
23
+ */
24
+ class ChromePHPHandler extends AbstractProcessingHandler
25
+ {
26
+ /**
27
+ * Version of the extension
28
+ */
29
+ const VERSION = '4.0';
30
+
31
+ /**
32
+ * Header name
33
+ */
34
+ const HEADER_NAME = 'X-ChromeLogger-Data';
35
+
36
+ /**
37
+ * Regular expression to detect supported browsers (matches any Chrome, or Firefox 43+)
38
+ */
39
+ const USER_AGENT_REGEX = '{\b(?:Chrome/\d+(?:\.\d+)*|HeadlessChrome|Firefox/(?:4[3-9]|[5-9]\d|\d{3,})(?:\.\d)*)\b}';
40
+
41
+ protected static $initialized = false;
42
+
43
+ /**
44
+ * Tracks whether we sent too much data
45
+ *
46
+ * Chrome limits the headers to 256KB, so when we sent 240KB we stop sending
47
+ *
48
+ * @var Boolean
49
+ */
50
+ protected static $overflowed = false;
51
+
52
+ protected static $json = array(
53
+ 'version' => self::VERSION,
54
+ 'columns' => array('label', 'log', 'backtrace', 'type'),
55
+ 'rows' => array(),
56
+ );
57
+
58
+ protected static $sendHeaders = true;
59
+
60
+ /**
61
+ * @param int $level The minimum logging level at which this handler will be triggered
62
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
63
+ */
64
+ public function __construct($level = Logger::DEBUG, $bubble = true)
65
+ {
66
+ parent::__construct($level, $bubble);
67
+ if (!function_exists('json_encode')) {
68
+ throw new \RuntimeException('PHP\'s json extension is required to use Monolog\'s ChromePHPHandler');
69
+ }
70
+ }
71
+
72
+ /**
73
+ * {@inheritdoc}
74
+ */
75
+ public function handleBatch(array $records)
76
+ {
77
+ $messages = array();
78
+
79
+ foreach ($records as $record) {
80
+ if ($record['level'] < $this->level) {
81
+ continue;
82
+ }
83
+ $messages[] = $this->processRecord($record);
84
+ }
85
+
86
+ if (!empty($messages)) {
87
+ $messages = $this->getFormatter()->formatBatch($messages);
88
+ self::$json['rows'] = array_merge(self::$json['rows'], $messages);
89
+ $this->send();
90
+ }
91
+ }
92
+
93
+ /**
94
+ * {@inheritDoc}
95
+ */
96
+ protected function getDefaultFormatter()
97
+ {
98
+ return new ChromePHPFormatter();
99
+ }
100
+
101
+ /**
102
+ * Creates & sends header for a record
103
+ *
104
+ * @see sendHeader()
105
+ * @see send()
106
+ * @param array $record
107
+ */
108
+ protected function write(array $record)
109
+ {
110
+ self::$json['rows'][] = $record['formatted'];
111
+
112
+ $this->send();
113
+ }
114
+
115
+ /**
116
+ * Sends the log header
117
+ *
118
+ * @see sendHeader()
119
+ */
120
+ protected function send()
121
+ {
122
+ if (self::$overflowed || !self::$sendHeaders) {
123
+ return;
124
+ }
125
+
126
+ if (!self::$initialized) {
127
+ self::$initialized = true;
128
+
129
+ self::$sendHeaders = $this->headersAccepted();
130
+ if (!self::$sendHeaders) {
131
+ return;
132
+ }
133
+
134
+ self::$json['request_uri'] = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
135
+ }
136
+
137
+ $json = @json_encode(self::$json);
138
+ $data = base64_encode(utf8_encode($json));
139
+ if (strlen($data) > 240 * 1024) {
140
+ self::$overflowed = true;
141
+
142
+ $record = array(
143
+ 'message' => 'Incomplete logs, chrome header size limit reached',
144
+ 'context' => array(),
145
+ 'level' => Logger::WARNING,
146
+ 'level_name' => Logger::getLevelName(Logger::WARNING),
147
+ 'channel' => 'monolog',
148
+ 'datetime' => new \DateTime(),
149
+ 'extra' => array(),
150
+ );
151
+ self::$json['rows'][count(self::$json['rows']) - 1] = $this->getFormatter()->format($record);
152
+ $json = @json_encode(self::$json);
153
+ $data = base64_encode(utf8_encode($json));
154
+ }
155
+
156
+ if (trim($data) !== '') {
157
+ $this->sendHeader(self::HEADER_NAME, $data);
158
+ }
159
+ }
160
+
161
+ /**
162
+ * Send header string to the client
163
+ *
164
+ * @param string $header
165
+ * @param string $content
166
+ */
167
+ protected function sendHeader($header, $content)
168
+ {
169
+ if (!headers_sent() && self::$sendHeaders) {
170
+ header(sprintf('%s: %s', $header, $content));
171
+ }
172
+ }
173
+
174
+ /**
175
+ * Verifies if the headers are accepted by the current user agent
176
+ *
177
+ * @return Boolean
178
+ */
179
+ protected function headersAccepted()
180
+ {
181
+ if (empty($_SERVER['HTTP_USER_AGENT'])) {
182
+ return false;
183
+ }
184
+
185
+ return preg_match(self::USER_AGENT_REGEX, $_SERVER['HTTP_USER_AGENT']);
186
+ }
187
+
188
+ /**
189
+ * BC getter for the sendHeaders property that has been made static
190
+ */
191
+ public function __get($property)
192
+ {
193
+ if ('sendHeaders' !== $property) {
194
+ throw new \InvalidArgumentException('Undefined property '.$property);
195
+ }
196
+
197
+ return static::$sendHeaders;
198
+ }
199
+
200
+ /**
201
+ * BC setter for the sendHeaders property that has been made static
202
+ */
203
+ public function __set($property, $value)
204
+ {
205
+ if ('sendHeaders' !== $property) {
206
+ throw new \InvalidArgumentException('Undefined property '.$property);
207
+ }
208
+
209
+ static::$sendHeaders = $value;
210
+ }
211
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/CouchDBHandler.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Formatter\JsonFormatter;
15
+ use Monolog\Logger;
16
+
17
+ /**
18
+ * CouchDB handler
19
+ *
20
+ * @author Markus Bachmann <markus.bachmann@bachi.biz>
21
+ */
22
+ class CouchDBHandler extends AbstractProcessingHandler
23
+ {
24
+ private $options;
25
+
26
+ public function __construct(array $options = array(), $level = Logger::DEBUG, $bubble = true)
27
+ {
28
+ $this->options = array_merge(array(
29
+ 'host' => 'localhost',
30
+ 'port' => 5984,
31
+ 'dbname' => 'logger',
32
+ 'username' => null,
33
+ 'password' => null,
34
+ ), $options);
35
+
36
+ parent::__construct($level, $bubble);
37
+ }
38
+
39
+ /**
40
+ * {@inheritDoc}
41
+ */
42
+ protected function write(array $record)
43
+ {
44
+ $basicAuth = null;
45
+ if ($this->options['username']) {
46
+ $basicAuth = sprintf('%s:%s@', $this->options['username'], $this->options['password']);
47
+ }
48
+
49
+ $url = 'http://'.$basicAuth.$this->options['host'].':'.$this->options['port'].'/'.$this->options['dbname'];
50
+ $context = stream_context_create(array(
51
+ 'http' => array(
52
+ 'method' => 'POST',
53
+ 'content' => $record['formatted'],
54
+ 'ignore_errors' => true,
55
+ 'max_redirects' => 0,
56
+ 'header' => 'Content-type: application/json',
57
+ ),
58
+ ));
59
+
60
+ if (false === @file_get_contents($url, null, $context)) {
61
+ throw new \RuntimeException(sprintf('Could not connect to %s', $url));
62
+ }
63
+ }
64
+
65
+ /**
66
+ * {@inheritDoc}
67
+ */
68
+ protected function getDefaultFormatter()
69
+ {
70
+ return new JsonFormatter(JsonFormatter::BATCH_MODE_JSON, false);
71
+ }
72
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/CubeHandler.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Logs to Cube.
18
+ *
19
+ * @link http://square.github.com/cube/
20
+ * @author Wan Chen <kami@kamisama.me>
21
+ */
22
+ class CubeHandler extends AbstractProcessingHandler
23
+ {
24
+ private $udpConnection;
25
+ private $httpConnection;
26
+ private $scheme;
27
+ private $host;
28
+ private $port;
29
+ private $acceptedSchemes = array('http', 'udp');
30
+
31
+ /**
32
+ * Create a Cube handler
33
+ *
34
+ * @throws \UnexpectedValueException when given url is not a valid url.
35
+ * A valid url must consist of three parts : protocol://host:port
36
+ * Only valid protocols used by Cube are http and udp
37
+ */
38
+ public function __construct($url, $level = Logger::DEBUG, $bubble = true)
39
+ {
40
+ $urlInfo = parse_url($url);
41
+
42
+ if (!isset($urlInfo['scheme'], $urlInfo['host'], $urlInfo['port'])) {
43
+ throw new \UnexpectedValueException('URL "'.$url.'" is not valid');
44
+ }
45
+
46
+ if (!in_array($urlInfo['scheme'], $this->acceptedSchemes)) {
47
+ throw new \UnexpectedValueException(
48
+ 'Invalid protocol (' . $urlInfo['scheme'] . ').'
49
+ . ' Valid options are ' . implode(', ', $this->acceptedSchemes));
50
+ }
51
+
52
+ $this->scheme = $urlInfo['scheme'];
53
+ $this->host = $urlInfo['host'];
54
+ $this->port = $urlInfo['port'];
55
+
56
+ parent::__construct($level, $bubble);
57
+ }
58
+
59
+ /**
60
+ * Establish a connection to an UDP socket
61
+ *
62
+ * @throws \LogicException when unable to connect to the socket
63
+ * @throws MissingExtensionException when there is no socket extension
64
+ */
65
+ protected function connectUdp()
66
+ {
67
+ if (!extension_loaded('sockets')) {
68
+ throw new MissingExtensionException('The sockets extension is required to use udp URLs with the CubeHandler');
69
+ }
70
+
71
+ $this->udpConnection = socket_create(AF_INET, SOCK_DGRAM, 0);
72
+ if (!$this->udpConnection) {
73
+ throw new \LogicException('Unable to create a socket');
74
+ }
75
+
76
+ if (!socket_connect($this->udpConnection, $this->host, $this->port)) {
77
+ throw new \LogicException('Unable to connect to the socket at ' . $this->host . ':' . $this->port);
78
+ }
79
+ }
80
+
81
+ /**
82
+ * Establish a connection to a http server
83
+ * @throws \LogicException when no curl extension
84
+ */
85
+ protected function connectHttp()
86
+ {
87
+ if (!extension_loaded('curl')) {
88
+ throw new \LogicException('The curl extension is needed to use http URLs with the CubeHandler');
89
+ }
90
+
91
+ $this->httpConnection = curl_init('http://'.$this->host.':'.$this->port.'/1.0/event/put');
92
+
93
+ if (!$this->httpConnection) {
94
+ throw new \LogicException('Unable to connect to ' . $this->host . ':' . $this->port);
95
+ }
96
+
97
+ curl_setopt($this->httpConnection, CURLOPT_CUSTOMREQUEST, "POST");
98
+ curl_setopt($this->httpConnection, CURLOPT_RETURNTRANSFER, true);
99
+ }
100
+
101
+ /**
102
+ * {@inheritdoc}
103
+ */
104
+ protected function write(array $record)
105
+ {
106
+ $date = $record['datetime'];
107
+
108
+ $data = array('time' => $date->format('Y-m-d\TH:i:s.uO'));
109
+ unset($record['datetime']);
110
+
111
+ if (isset($record['context']['type'])) {
112
+ $data['type'] = $record['context']['type'];
113
+ unset($record['context']['type']);
114
+ } else {
115
+ $data['type'] = $record['channel'];
116
+ }
117
+
118
+ $data['data'] = $record['context'];
119
+ $data['data']['level'] = $record['level'];
120
+
121
+ if ($this->scheme === 'http') {
122
+ $this->writeHttp(json_encode($data));
123
+ } else {
124
+ $this->writeUdp(json_encode($data));
125
+ }
126
+ }
127
+
128
+ private function writeUdp($data)
129
+ {
130
+ if (!$this->udpConnection) {
131
+ $this->connectUdp();
132
+ }
133
+
134
+ socket_send($this->udpConnection, $data, strlen($data), 0);
135
+ }
136
+
137
+ private function writeHttp($data)
138
+ {
139
+ if (!$this->httpConnection) {
140
+ $this->connectHttp();
141
+ }
142
+
143
+ curl_setopt($this->httpConnection, CURLOPT_POSTFIELDS, '['.$data.']');
144
+ curl_setopt($this->httpConnection, CURLOPT_HTTPHEADER, array(
145
+ 'Content-Type: application/json',
146
+ 'Content-Length: ' . strlen('['.$data.']'),
147
+ ));
148
+
149
+ Curl\Util::execute($this->httpConnection, 5, false);
150
+ }
151
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/Curl/Util.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler\Curl;
13
+
14
+ class Util
15
+ {
16
+ private static $retriableErrorCodes = array(
17
+ CURLE_COULDNT_RESOLVE_HOST,
18
+ CURLE_COULDNT_CONNECT,
19
+ CURLE_HTTP_NOT_FOUND,
20
+ CURLE_READ_ERROR,
21
+ CURLE_OPERATION_TIMEOUTED,
22
+ CURLE_HTTP_POST_ERROR,
23
+ CURLE_SSL_CONNECT_ERROR,
24
+ );
25
+
26
+ /**
27
+ * Executes a CURL request with optional retries and exception on failure
28
+ *
29
+ * @param resource $ch curl handler
30
+ * @throws \RuntimeException
31
+ */
32
+ public static function execute($ch, $retries = 5, $closeAfterDone = true)
33
+ {
34
+ while ($retries--) {
35
+ if (curl_exec($ch) === false) {
36
+ $curlErrno = curl_errno($ch);
37
+
38
+ if (false === in_array($curlErrno, self::$retriableErrorCodes, true) || !$retries) {
39
+ $curlError = curl_error($ch);
40
+
41
+ if ($closeAfterDone) {
42
+ curl_close($ch);
43
+ }
44
+
45
+ throw new \RuntimeException(sprintf('Curl error (code %s): %s', $curlErrno, $curlError));
46
+ }
47
+
48
+ continue;
49
+ }
50
+
51
+ if ($closeAfterDone) {
52
+ curl_close($ch);
53
+ }
54
+ break;
55
+ }
56
+ }
57
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/DeduplicationHandler.php ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Simple handler wrapper that deduplicates log records across multiple requests
18
+ *
19
+ * It also includes the BufferHandler functionality and will buffer
20
+ * all messages until the end of the request or flush() is called.
21
+ *
22
+ * This works by storing all log records' messages above $deduplicationLevel
23
+ * to the file specified by $deduplicationStore. When further logs come in at the end of the
24
+ * request (or when flush() is called), all those above $deduplicationLevel are checked
25
+ * against the existing stored logs. If they match and the timestamps in the stored log is
26
+ * not older than $time seconds, the new log record is discarded. If no log record is new, the
27
+ * whole data set is discarded.
28
+ *
29
+ * This is mainly useful in combination with Mail handlers or things like Slack or HipChat handlers
30
+ * that send messages to people, to avoid spamming with the same message over and over in case of
31
+ * a major component failure like a database server being down which makes all requests fail in the
32
+ * same way.
33
+ *
34
+ * @author Jordi Boggiano <j.boggiano@seld.be>
35
+ */
36
+ class DeduplicationHandler extends BufferHandler
37
+ {
38
+ /**
39
+ * @var string
40
+ */
41
+ protected $deduplicationStore;
42
+
43
+ /**
44
+ * @var int
45
+ */
46
+ protected $deduplicationLevel;
47
+
48
+ /**
49
+ * @var int
50
+ */
51
+ protected $time;
52
+
53
+ /**
54
+ * @var bool
55
+ */
56
+ private $gc = false;
57
+
58
+ /**
59
+ * @param HandlerInterface $handler Handler.
60
+ * @param string $deduplicationStore The file/path where the deduplication log should be kept
61
+ * @param int $deduplicationLevel The minimum logging level for log records to be looked at for deduplication purposes
62
+ * @param int $time The period (in seconds) during which duplicate entries should be suppressed after a given log is sent through
63
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
64
+ */
65
+ public function __construct(HandlerInterface $handler, $deduplicationStore = null, $deduplicationLevel = Logger::ERROR, $time = 60, $bubble = true)
66
+ {
67
+ parent::__construct($handler, 0, Logger::DEBUG, $bubble, false);
68
+
69
+ $this->deduplicationStore = $deduplicationStore === null ? sys_get_temp_dir() . '/monolog-dedup-' . substr(md5(__FILE__), 0, 20) .'.log' : $deduplicationStore;
70
+ $this->deduplicationLevel = Logger::toMonologLevel($deduplicationLevel);
71
+ $this->time = $time;
72
+ }
73
+
74
+ public function flush()
75
+ {
76
+ if ($this->bufferSize === 0) {
77
+ return;
78
+ }
79
+
80
+ $passthru = null;
81
+
82
+ foreach ($this->buffer as $record) {
83
+ if ($record['level'] >= $this->deduplicationLevel) {
84
+
85
+ $passthru = $passthru || !$this->isDuplicate($record);
86
+ if ($passthru) {
87
+ $this->appendRecord($record);
88
+ }
89
+ }
90
+ }
91
+
92
+ // default of null is valid as well as if no record matches duplicationLevel we just pass through
93
+ if ($passthru === true || $passthru === null) {
94
+ $this->handler->handleBatch($this->buffer);
95
+ }
96
+
97
+ $this->clear();
98
+
99
+ if ($this->gc) {
100
+ $this->collectLogs();
101
+ }
102
+ }
103
+
104
+ private function isDuplicate(array $record)
105
+ {
106
+ if (!file_exists($this->deduplicationStore)) {
107
+ return false;
108
+ }
109
+
110
+ $store = file($this->deduplicationStore, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
111
+ if (!is_array($store)) {
112
+ return false;
113
+ }
114
+
115
+ $yesterday = time() - 86400;
116
+ $timestampValidity = $record['datetime']->getTimestamp() - $this->time;
117
+ $expectedMessage = preg_replace('{[\r\n].*}', '', $record['message']);
118
+
119
+ for ($i = count($store) - 1; $i >= 0; $i--) {
120
+ list($timestamp, $level, $message) = explode(':', $store[$i], 3);
121
+
122
+ if ($level === $record['level_name'] && $message === $expectedMessage && $timestamp > $timestampValidity) {
123
+ return true;
124
+ }
125
+
126
+ if ($timestamp < $yesterday) {
127
+ $this->gc = true;
128
+ }
129
+ }
130
+
131
+ return false;
132
+ }
133
+
134
+ private function collectLogs()
135
+ {
136
+ if (!file_exists($this->deduplicationStore)) {
137
+ return false;
138
+ }
139
+
140
+ $handle = fopen($this->deduplicationStore, 'rw+');
141
+ flock($handle, LOCK_EX);
142
+ $validLogs = array();
143
+
144
+ $timestampValidity = time() - $this->time;
145
+
146
+ while (!feof($handle)) {
147
+ $log = fgets($handle);
148
+ if (substr($log, 0, 10) >= $timestampValidity) {
149
+ $validLogs[] = $log;
150
+ }
151
+ }
152
+
153
+ ftruncate($handle, 0);
154
+ rewind($handle);
155
+ foreach ($validLogs as $log) {
156
+ fwrite($handle, $log);
157
+ }
158
+
159
+ flock($handle, LOCK_UN);
160
+ fclose($handle);
161
+
162
+ $this->gc = false;
163
+ }
164
+
165
+ private function appendRecord(array $record)
166
+ {
167
+ file_put_contents($this->deduplicationStore, $record['datetime']->getTimestamp() . ':' . $record['level_name'] . ':' . preg_replace('{[\r\n].*}', '', $record['message']) . "\n", FILE_APPEND);
168
+ }
169
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/DoctrineCouchDBHandler.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+ use Monolog\Formatter\NormalizerFormatter;
16
+ use Doctrine\CouchDB\CouchDBClient;
17
+
18
+ /**
19
+ * CouchDB handler for Doctrine CouchDB ODM
20
+ *
21
+ * @author Markus Bachmann <markus.bachmann@bachi.biz>
22
+ */
23
+ class DoctrineCouchDBHandler extends AbstractProcessingHandler
24
+ {
25
+ private $client;
26
+
27
+ public function __construct(CouchDBClient $client, $level = Logger::DEBUG, $bubble = true)
28
+ {
29
+ $this->client = $client;
30
+ parent::__construct($level, $bubble);
31
+ }
32
+
33
+ /**
34
+ * {@inheritDoc}
35
+ */
36
+ protected function write(array $record)
37
+ {
38
+ $this->client->postDocument($record['formatted']);
39
+ }
40
+
41
+ protected function getDefaultFormatter()
42
+ {
43
+ return new NormalizerFormatter;
44
+ }
45
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/DynamoDbHandler.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Aws\Sdk;
15
+ use Aws\DynamoDb\DynamoDbClient;
16
+ use Aws\DynamoDb\Marshaler;
17
+ use Monolog\Formatter\ScalarFormatter;
18
+ use Monolog\Logger;
19
+
20
+ /**
21
+ * Amazon DynamoDB handler (http://aws.amazon.com/dynamodb/)
22
+ *
23
+ * @link https://github.com/aws/aws-sdk-php/
24
+ * @author Andrew Lawson <adlawson@gmail.com>
25
+ */
26
+ class DynamoDbHandler extends AbstractProcessingHandler
27
+ {
28
+ const DATE_FORMAT = 'Y-m-d\TH:i:s.uO';
29
+
30
+ /**
31
+ * @var DynamoDbClient
32
+ */
33
+ protected $client;
34
+
35
+ /**
36
+ * @var string
37
+ */
38
+ protected $table;
39
+
40
+ /**
41
+ * @var int
42
+ */
43
+ protected $version;
44
+
45
+ /**
46
+ * @var Marshaler
47
+ */
48
+ protected $marshaler;
49
+
50
+ /**
51
+ * @param DynamoDbClient $client
52
+ * @param string $table
53
+ * @param int $level
54
+ * @param bool $bubble
55
+ */
56
+ public function __construct(DynamoDbClient $client, $table, $level = Logger::DEBUG, $bubble = true)
57
+ {
58
+ if (defined('Aws\Sdk::VERSION') && version_compare(Sdk::VERSION, '3.0', '>=')) {
59
+ $this->version = 3;
60
+ $this->marshaler = new Marshaler;
61
+ } else {
62
+ $this->version = 2;
63
+ }
64
+
65
+ $this->client = $client;
66
+ $this->table = $table;
67
+
68
+ parent::__construct($level, $bubble);
69
+ }
70
+
71
+ /**
72
+ * {@inheritdoc}
73
+ */
74
+ protected function write(array $record)
75
+ {
76
+ $filtered = $this->filterEmptyFields($record['formatted']);
77
+ if ($this->version === 3) {
78
+ $formatted = $this->marshaler->marshalItem($filtered);
79
+ } else {
80
+ $formatted = $this->client->formatAttributes($filtered);
81
+ }
82
+
83
+ $this->client->putItem(array(
84
+ 'TableName' => $this->table,
85
+ 'Item' => $formatted,
86
+ ));
87
+ }
88
+
89
+ /**
90
+ * @param array $record
91
+ * @return array
92
+ */
93
+ protected function filterEmptyFields(array $record)
94
+ {
95
+ return array_filter($record, function ($value) {
96
+ return !empty($value) || false === $value || 0 === $value;
97
+ });
98
+ }
99
+
100
+ /**
101
+ * {@inheritdoc}
102
+ */
103
+ protected function getDefaultFormatter()
104
+ {
105
+ return new ScalarFormatter(self::DATE_FORMAT);
106
+ }
107
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Formatter\FormatterInterface;
15
+ use Monolog\Formatter\ElasticaFormatter;
16
+ use Monolog\Logger;
17
+ use Elastica\Client;
18
+ use Elastica\Exception\ExceptionInterface;
19
+
20
+ /**
21
+ * Elastic Search handler
22
+ *
23
+ * Usage example:
24
+ *
25
+ * $client = new \Elastica\Client();
26
+ * $options = array(
27
+ * 'index' => 'elastic_index_name',
28
+ * 'type' => 'elastic_doc_type',
29
+ * );
30
+ * $handler = new ElasticSearchHandler($client, $options);
31
+ * $log = new Logger('application');
32
+ * $log->pushHandler($handler);
33
+ *
34
+ * @author Jelle Vink <jelle.vink@gmail.com>
35
+ */
36
+ class ElasticSearchHandler extends AbstractProcessingHandler
37
+ {
38
+ /**
39
+ * @var Client
40
+ */
41
+ protected $client;
42
+
43
+ /**
44
+ * @var array Handler config options
45
+ */
46
+ protected $options = array();
47
+
48
+ /**
49
+ * @param Client $client Elastica Client object
50
+ * @param array $options Handler configuration
51
+ * @param int $level The minimum logging level at which this handler will be triggered
52
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
53
+ */
54
+ public function __construct(Client $client, array $options = array(), $level = Logger::DEBUG, $bubble = true)
55
+ {
56
+ parent::__construct($level, $bubble);
57
+ $this->client = $client;
58
+ $this->options = array_merge(
59
+ array(
60
+ 'index' => 'monolog', // Elastic index name
61
+ 'type' => 'record', // Elastic document type
62
+ 'ignore_error' => false, // Suppress Elastica exceptions
63
+ ),
64
+ $options
65
+ );
66
+ }
67
+
68
+ /**
69
+ * {@inheritDoc}
70
+ */
71
+ protected function write(array $record)
72
+ {
73
+ $this->bulkSend(array($record['formatted']));
74
+ }
75
+
76
+ /**
77
+ * {@inheritdoc}
78
+ */
79
+ public function setFormatter(FormatterInterface $formatter)
80
+ {
81
+ if ($formatter instanceof ElasticaFormatter) {
82
+ return parent::setFormatter($formatter);
83
+ }
84
+ throw new \InvalidArgumentException('ElasticSearchHandler is only compatible with ElasticaFormatter');
85
+ }
86
+
87
+ /**
88
+ * Getter options
89
+ * @return array
90
+ */
91
+ public function getOptions()
92
+ {
93
+ return $this->options;
94
+ }
95
+
96
+ /**
97
+ * {@inheritDoc}
98
+ */
99
+ protected function getDefaultFormatter()
100
+ {
101
+ return new ElasticaFormatter($this->options['index'], $this->options['type']);
102
+ }
103
+
104
+ /**
105
+ * {@inheritdoc}
106
+ */
107
+ public function handleBatch(array $records)
108
+ {
109
+ $documents = $this->getFormatter()->formatBatch($records);
110
+ $this->bulkSend($documents);
111
+ }
112
+
113
+ /**
114
+ * Use Elasticsearch bulk API to send list of documents
115
+ * @param array $documents
116
+ * @throws \RuntimeException
117
+ */
118
+ protected function bulkSend(array $documents)
119
+ {
120
+ try {
121
+ $this->client->addDocuments($documents);
122
+ } catch (ExceptionInterface $e) {
123
+ if (!$this->options['ignore_error']) {
124
+ throw new \RuntimeException("Error sending messages to Elasticsearch", 0, $e);
125
+ }
126
+ }
127
+ }
128
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/ErrorLogHandler.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Formatter\LineFormatter;
15
+ use Monolog\Logger;
16
+
17
+ /**
18
+ * Stores to PHP error_log() handler.
19
+ *
20
+ * @author Elan Ruusamäe <glen@delfi.ee>
21
+ */
22
+ class ErrorLogHandler extends AbstractProcessingHandler
23
+ {
24
+ const OPERATING_SYSTEM = 0;
25
+ const SAPI = 4;
26
+
27
+ protected $messageType;
28
+ protected $expandNewlines;
29
+
30
+ /**
31
+ * @param int $messageType Says where the error should go.
32
+ * @param int $level The minimum logging level at which this handler will be triggered
33
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
34
+ * @param Boolean $expandNewlines If set to true, newlines in the message will be expanded to be take multiple log entries
35
+ */
36
+ public function __construct($messageType = self::OPERATING_SYSTEM, $level = Logger::DEBUG, $bubble = true, $expandNewlines = false)
37
+ {
38
+ parent::__construct($level, $bubble);
39
+
40
+ if (false === in_array($messageType, self::getAvailableTypes())) {
41
+ $message = sprintf('The given message type "%s" is not supported', var_export($messageType, true));
42
+ throw new \InvalidArgumentException($message);
43
+ }
44
+
45
+ $this->messageType = $messageType;
46
+ $this->expandNewlines = $expandNewlines;
47
+ }
48
+
49
+ /**
50
+ * @return array With all available types
51
+ */
52
+ public static function getAvailableTypes()
53
+ {
54
+ return array(
55
+ self::OPERATING_SYSTEM,
56
+ self::SAPI,
57
+ );
58
+ }
59
+
60
+ /**
61
+ * {@inheritDoc}
62
+ */
63
+ protected function getDefaultFormatter()
64
+ {
65
+ return new LineFormatter('[%datetime%] %channel%.%level_name%: %message% %context% %extra%');
66
+ }
67
+
68
+ /**
69
+ * {@inheritdoc}
70
+ */
71
+ protected function write(array $record)
72
+ {
73
+ if ($this->expandNewlines) {
74
+ $lines = preg_split('{[\r\n]+}', (string) $record['formatted']);
75
+ foreach ($lines as $line) {
76
+ error_log($line, $this->messageType);
77
+ }
78
+ } else {
79
+ error_log((string) $record['formatted'], $this->messageType);
80
+ }
81
+ }
82
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/FilterHandler.php ADDED
@@ -0,0 +1,140 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Simple handler wrapper that filters records based on a list of levels
18
+ *
19
+ * It can be configured with an exact list of levels to allow, or a min/max level.
20
+ *
21
+ * @author Hennadiy Verkh
22
+ * @author Jordi Boggiano <j.boggiano@seld.be>
23
+ */
24
+ class FilterHandler extends AbstractHandler
25
+ {
26
+ /**
27
+ * Handler or factory callable($record, $this)
28
+ *
29
+ * @var callable|\Monolog\Handler\HandlerInterface
30
+ */
31
+ protected $handler;
32
+
33
+ /**
34
+ * Minimum level for logs that are passed to handler
35
+ *
36
+ * @var int[]
37
+ */
38
+ protected $acceptedLevels;
39
+
40
+ /**
41
+ * Whether the messages that are handled can bubble up the stack or not
42
+ *
43
+ * @var Boolean
44
+ */
45
+ protected $bubble;
46
+
47
+ /**
48
+ * @param callable|HandlerInterface $handler Handler or factory callable($record, $this).
49
+ * @param int|array $minLevelOrList A list of levels to accept or a minimum level if maxLevel is provided
50
+ * @param int $maxLevel Maximum level to accept, only used if $minLevelOrList is not an array
51
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
52
+ */
53
+ public function __construct($handler, $minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY, $bubble = true)
54
+ {
55
+ $this->handler = $handler;
56
+ $this->bubble = $bubble;
57
+ $this->setAcceptedLevels($minLevelOrList, $maxLevel);
58
+
59
+ if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) {
60
+ throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object");
61
+ }
62
+ }
63
+
64
+ /**
65
+ * @return array
66
+ */
67
+ public function getAcceptedLevels()
68
+ {
69
+ return array_flip($this->acceptedLevels);
70
+ }
71
+
72
+ /**
73
+ * @param int|string|array $minLevelOrList A list of levels to accept or a minimum level or level name if maxLevel is provided
74
+ * @param int|string $maxLevel Maximum level or level name to accept, only used if $minLevelOrList is not an array
75
+ */
76
+ public function setAcceptedLevels($minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY)
77
+ {
78
+ if (is_array($minLevelOrList)) {
79
+ $acceptedLevels = array_map('Monolog\Logger::toMonologLevel', $minLevelOrList);
80
+ } else {
81
+ $minLevelOrList = Logger::toMonologLevel($minLevelOrList);
82
+ $maxLevel = Logger::toMonologLevel($maxLevel);
83
+ $acceptedLevels = array_values(array_filter(Logger::getLevels(), function ($level) use ($minLevelOrList, $maxLevel) {
84
+ return $level >= $minLevelOrList && $level <= $maxLevel;
85
+ }));
86
+ }
87
+ $this->acceptedLevels = array_flip($acceptedLevels);
88
+ }
89
+
90
+ /**
91
+ * {@inheritdoc}
92
+ */
93
+ public function isHandling(array $record)
94
+ {
95
+ return isset($this->acceptedLevels[$record['level']]);
96
+ }
97
+
98
+ /**
99
+ * {@inheritdoc}
100
+ */
101
+ public function handle(array $record)
102
+ {
103
+ if (!$this->isHandling($record)) {
104
+ return false;
105
+ }
106
+
107
+ // The same logic as in FingersCrossedHandler
108
+ if (!$this->handler instanceof HandlerInterface) {
109
+ $this->handler = call_user_func($this->handler, $record, $this);
110
+ if (!$this->handler instanceof HandlerInterface) {
111
+ throw new \RuntimeException("The factory callable should return a HandlerInterface");
112
+ }
113
+ }
114
+
115
+ if ($this->processors) {
116
+ foreach ($this->processors as $processor) {
117
+ $record = call_user_func($processor, $record);
118
+ }
119
+ }
120
+
121
+ $this->handler->handle($record);
122
+
123
+ return false === $this->bubble;
124
+ }
125
+
126
+ /**
127
+ * {@inheritdoc}
128
+ */
129
+ public function handleBatch(array $records)
130
+ {
131
+ $filtered = array();
132
+ foreach ($records as $record) {
133
+ if ($this->isHandling($record)) {
134
+ $filtered[] = $record;
135
+ }
136
+ }
137
+
138
+ $this->handler->handleBatch($filtered);
139
+ }
140
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ActivationStrategyInterface.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler\FingersCrossed;
13
+
14
+ /**
15
+ * Interface for activation strategies for the FingersCrossedHandler.
16
+ *
17
+ * @author Johannes M. Schmitt <schmittjoh@gmail.com>
18
+ */
19
+ interface ActivationStrategyInterface
20
+ {
21
+ /**
22
+ * Returns whether the given record activates the handler.
23
+ *
24
+ * @param array $record
25
+ * @return Boolean
26
+ */
27
+ public function isHandlerActivated(array $record);
28
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ChannelLevelActivationStrategy.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler\FingersCrossed;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Channel and Error level based monolog activation strategy. Allows to trigger activation
18
+ * based on level per channel. e.g. trigger activation on level 'ERROR' by default, except
19
+ * for records of the 'sql' channel; those should trigger activation on level 'WARN'.
20
+ *
21
+ * Example:
22
+ *
23
+ * <code>
24
+ * $activationStrategy = new ChannelLevelActivationStrategy(
25
+ * Logger::CRITICAL,
26
+ * array(
27
+ * 'request' => Logger::ALERT,
28
+ * 'sensitive' => Logger::ERROR,
29
+ * )
30
+ * );
31
+ * $handler = new FingersCrossedHandler(new StreamHandler('php://stderr'), $activationStrategy);
32
+ * </code>
33
+ *
34
+ * @author Mike Meessen <netmikey@gmail.com>
35
+ */
36
+ class ChannelLevelActivationStrategy implements ActivationStrategyInterface
37
+ {
38
+ private $defaultActionLevel;
39
+ private $channelToActionLevel;
40
+
41
+ /**
42
+ * @param int $defaultActionLevel The default action level to be used if the record's category doesn't match any
43
+ * @param array $channelToActionLevel An array that maps channel names to action levels.
44
+ */
45
+ public function __construct($defaultActionLevel, $channelToActionLevel = array())
46
+ {
47
+ $this->defaultActionLevel = Logger::toMonologLevel($defaultActionLevel);
48
+ $this->channelToActionLevel = array_map('Monolog\Logger::toMonologLevel', $channelToActionLevel);
49
+ }
50
+
51
+ public function isHandlerActivated(array $record)
52
+ {
53
+ if (isset($this->channelToActionLevel[$record['channel']])) {
54
+ return $record['level'] >= $this->channelToActionLevel[$record['channel']];
55
+ }
56
+
57
+ return $record['level'] >= $this->defaultActionLevel;
58
+ }
59
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossed/ErrorLevelActivationStrategy.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler\FingersCrossed;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Error level based activation strategy.
18
+ *
19
+ * @author Johannes M. Schmitt <schmittjoh@gmail.com>
20
+ */
21
+ class ErrorLevelActivationStrategy implements ActivationStrategyInterface
22
+ {
23
+ private $actionLevel;
24
+
25
+ public function __construct($actionLevel)
26
+ {
27
+ $this->actionLevel = Logger::toMonologLevel($actionLevel);
28
+ }
29
+
30
+ public function isHandlerActivated(array $record)
31
+ {
32
+ return $record['level'] >= $this->actionLevel;
33
+ }
34
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy;
15
+ use Monolog\Handler\FingersCrossed\ActivationStrategyInterface;
16
+ use Monolog\Logger;
17
+
18
+ /**
19
+ * Buffers all records until a certain level is reached
20
+ *
21
+ * The advantage of this approach is that you don't get any clutter in your log files.
22
+ * Only requests which actually trigger an error (or whatever your actionLevel is) will be
23
+ * in the logs, but they will contain all records, not only those above the level threshold.
24
+ *
25
+ * You can find the various activation strategies in the
26
+ * Monolog\Handler\FingersCrossed\ namespace.
27
+ *
28
+ * @author Jordi Boggiano <j.boggiano@seld.be>
29
+ */
30
+ class FingersCrossedHandler extends AbstractHandler
31
+ {
32
+ protected $handler;
33
+ protected $activationStrategy;
34
+ protected $buffering = true;
35
+ protected $bufferSize;
36
+ protected $buffer = array();
37
+ protected $stopBuffering;
38
+ protected $passthruLevel;
39
+
40
+ /**
41
+ * @param callable|HandlerInterface $handler Handler or factory callable($record, $fingersCrossedHandler).
42
+ * @param int|ActivationStrategyInterface $activationStrategy Strategy which determines when this handler takes action
43
+ * @param int $bufferSize How many entries should be buffered at most, beyond that the oldest items are removed from the buffer.
44
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
45
+ * @param Boolean $stopBuffering Whether the handler should stop buffering after being triggered (default true)
46
+ * @param int $passthruLevel Minimum level to always flush to handler on close, even if strategy not triggered
47
+ */
48
+ public function __construct($handler, $activationStrategy = null, $bufferSize = 0, $bubble = true, $stopBuffering = true, $passthruLevel = null)
49
+ {
50
+ if (null === $activationStrategy) {
51
+ $activationStrategy = new ErrorLevelActivationStrategy(Logger::WARNING);
52
+ }
53
+
54
+ // convert simple int activationStrategy to an object
55
+ if (!$activationStrategy instanceof ActivationStrategyInterface) {
56
+ $activationStrategy = new ErrorLevelActivationStrategy($activationStrategy);
57
+ }
58
+
59
+ $this->handler = $handler;
60
+ $this->activationStrategy = $activationStrategy;
61
+ $this->bufferSize = $bufferSize;
62
+ $this->bubble = $bubble;
63
+ $this->stopBuffering = $stopBuffering;
64
+
65
+ if ($passthruLevel !== null) {
66
+ $this->passthruLevel = Logger::toMonologLevel($passthruLevel);
67
+ }
68
+
69
+ if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) {
70
+ throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object");
71
+ }
72
+ }
73
+
74
+ /**
75
+ * {@inheritdoc}
76
+ */
77
+ public function isHandling(array $record)
78
+ {
79
+ return true;
80
+ }
81
+
82
+ /**
83
+ * Manually activate this logger regardless of the activation strategy
84
+ */
85
+ public function activate()
86
+ {
87
+ if ($this->stopBuffering) {
88
+ $this->buffering = false;
89
+ }
90
+ if (!$this->handler instanceof HandlerInterface) {
91
+ $record = end($this->buffer) ?: null;
92
+
93
+ $this->handler = call_user_func($this->handler, $record, $this);
94
+ if (!$this->handler instanceof HandlerInterface) {
95
+ throw new \RuntimeException("The factory callable should return a HandlerInterface");
96
+ }
97
+ }
98
+ $this->handler->handleBatch($this->buffer);
99
+ $this->buffer = array();
100
+ }
101
+
102
+ /**
103
+ * {@inheritdoc}
104
+ */
105
+ public function handle(array $record)
106
+ {
107
+ if ($this->processors) {
108
+ foreach ($this->processors as $processor) {
109
+ $record = call_user_func($processor, $record);
110
+ }
111
+ }
112
+
113
+ if ($this->buffering) {
114
+ $this->buffer[] = $record;
115
+ if ($this->bufferSize > 0 && count($this->buffer) > $this->bufferSize) {
116
+ array_shift($this->buffer);
117
+ }
118
+ if ($this->activationStrategy->isHandlerActivated($record)) {
119
+ $this->activate();
120
+ }
121
+ } else {
122
+ $this->handler->handle($record);
123
+ }
124
+
125
+ return false === $this->bubble;
126
+ }
127
+
128
+ /**
129
+ * {@inheritdoc}
130
+ */
131
+ public function close()
132
+ {
133
+ if (null !== $this->passthruLevel) {
134
+ $level = $this->passthruLevel;
135
+ $this->buffer = array_filter($this->buffer, function ($record) use ($level) {
136
+ return $record['level'] >= $level;
137
+ });
138
+ if (count($this->buffer) > 0) {
139
+ $this->handler->handleBatch($this->buffer);
140
+ $this->buffer = array();
141
+ }
142
+ }
143
+ }
144
+
145
+ /**
146
+ * Resets the state of the handler. Stops forwarding records to the wrapped handler.
147
+ */
148
+ public function reset()
149
+ {
150
+ $this->buffering = true;
151
+ }
152
+
153
+ /**
154
+ * Clears the buffer without flushing any messages down to the wrapped handler.
155
+ *
156
+ * It also resets the handler to its initial buffering state.
157
+ */
158
+ public function clear()
159
+ {
160
+ $this->buffer = array();
161
+ $this->reset();
162
+ }
163
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/FirePHPHandler.php ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Formatter\WildfireFormatter;
15
+
16
+ /**
17
+ * Simple FirePHP Handler (http://www.firephp.org/), which uses the Wildfire protocol.
18
+ *
19
+ * @author Eric Clemmons (@ericclemmons) <eric@uxdriven.com>
20
+ */
21
+ class FirePHPHandler extends AbstractProcessingHandler
22
+ {
23
+ /**
24
+ * WildFire JSON header message format
25
+ */
26
+ const PROTOCOL_URI = 'http://meta.wildfirehq.org/Protocol/JsonStream/0.2';
27
+
28
+ /**
29
+ * FirePHP structure for parsing messages & their presentation
30
+ */
31
+ const STRUCTURE_URI = 'http://meta.firephp.org/Wildfire/Structure/FirePHP/FirebugConsole/0.1';
32
+
33
+ /**
34
+ * Must reference a "known" plugin, otherwise headers won't display in FirePHP
35
+ */
36
+ const PLUGIN_URI = 'http://meta.firephp.org/Wildfire/Plugin/FirePHP/Library-FirePHPCore/0.3';
37
+
38
+ /**
39
+ * Header prefix for Wildfire to recognize & parse headers
40
+ */
41
+ const HEADER_PREFIX = 'X-Wf';
42
+
43
+ /**
44
+ * Whether or not Wildfire vendor-specific headers have been generated & sent yet
45
+ */
46
+ protected static $initialized = false;
47
+
48
+ /**
49
+ * Shared static message index between potentially multiple handlers
50
+ * @var int
51
+ */
52
+ protected static $messageIndex = 1;
53
+
54
+ protected static $sendHeaders = true;
55
+
56
+ /**
57
+ * Base header creation function used by init headers & record headers
58
+ *
59
+ * @param array $meta Wildfire Plugin, Protocol & Structure Indexes
60
+ * @param string $message Log message
61
+ * @return array Complete header string ready for the client as key and message as value
62
+ */
63
+ protected function createHeader(array $meta, $message)
64
+ {
65
+ $header = sprintf('%s-%s', self::HEADER_PREFIX, join('-', $meta));
66
+
67
+ return array($header => $message);
68
+ }
69
+
70
+ /**
71
+ * Creates message header from record
72
+ *
73
+ * @see createHeader()
74
+ * @param array $record
75
+ * @return string
76
+ */
77
+ protected function createRecordHeader(array $record)
78
+ {
79
+ // Wildfire is extensible to support multiple protocols & plugins in a single request,
80
+ // but we're not taking advantage of that (yet), so we're using "1" for simplicity's sake.
81
+ return $this->createHeader(
82
+ array(1, 1, 1, self::$messageIndex++),
83
+ $record['formatted']
84
+ );
85
+ }
86
+
87
+ /**
88
+ * {@inheritDoc}
89
+ */
90
+ protected function getDefaultFormatter()
91
+ {
92
+ return new WildfireFormatter();
93
+ }
94
+
95
+ /**
96
+ * Wildfire initialization headers to enable message parsing
97
+ *
98
+ * @see createHeader()
99
+ * @see sendHeader()
100
+ * @return array
101
+ */
102
+ protected function getInitHeaders()
103
+ {
104
+ // Initial payload consists of required headers for Wildfire
105
+ return array_merge(
106
+ $this->createHeader(array('Protocol', 1), self::PROTOCOL_URI),
107
+ $this->createHeader(array(1, 'Structure', 1), self::STRUCTURE_URI),
108
+ $this->createHeader(array(1, 'Plugin', 1), self::PLUGIN_URI)
109
+ );
110
+ }
111
+
112
+ /**
113
+ * Send header string to the client
114
+ *
115
+ * @param string $header
116
+ * @param string $content
117
+ */
118
+ protected function sendHeader($header, $content)
119
+ {
120
+ if (!headers_sent() && self::$sendHeaders) {
121
+ header(sprintf('%s: %s', $header, $content));
122
+ }
123
+ }
124
+
125
+ /**
126
+ * Creates & sends header for a record, ensuring init headers have been sent prior
127
+ *
128
+ * @see sendHeader()
129
+ * @see sendInitHeaders()
130
+ * @param array $record
131
+ */
132
+ protected function write(array $record)
133
+ {
134
+ if (!self::$sendHeaders) {
135
+ return;
136
+ }
137
+
138
+ // WildFire-specific headers must be sent prior to any messages
139
+ if (!self::$initialized) {
140
+ self::$initialized = true;
141
+
142
+ self::$sendHeaders = $this->headersAccepted();
143
+ if (!self::$sendHeaders) {
144
+ return;
145
+ }
146
+
147
+ foreach ($this->getInitHeaders() as $header => $content) {
148
+ $this->sendHeader($header, $content);
149
+ }
150
+ }
151
+
152
+ $header = $this->createRecordHeader($record);
153
+ if (trim(current($header)) !== '') {
154
+ $this->sendHeader(key($header), current($header));
155
+ }
156
+ }
157
+
158
+ /**
159
+ * Verifies if the headers are accepted by the current user agent
160
+ *
161
+ * @return Boolean
162
+ */
163
+ protected function headersAccepted()
164
+ {
165
+ if (!empty($_SERVER['HTTP_USER_AGENT']) && preg_match('{\bFirePHP/\d+\.\d+\b}', $_SERVER['HTTP_USER_AGENT'])) {
166
+ return true;
167
+ }
168
+
169
+ return isset($_SERVER['HTTP_X_FIREPHP_VERSION']);
170
+ }
171
+
172
+ /**
173
+ * BC getter for the sendHeaders property that has been made static
174
+ */
175
+ public function __get($property)
176
+ {
177
+ if ('sendHeaders' !== $property) {
178
+ throw new \InvalidArgumentException('Undefined property '.$property);
179
+ }
180
+
181
+ return static::$sendHeaders;
182
+ }
183
+
184
+ /**
185
+ * BC setter for the sendHeaders property that has been made static
186
+ */
187
+ public function __set($property, $value)
188
+ {
189
+ if ('sendHeaders' !== $property) {
190
+ throw new \InvalidArgumentException('Undefined property '.$property);
191
+ }
192
+
193
+ static::$sendHeaders = $value;
194
+ }
195
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Formatter\LineFormatter;
15
+ use Monolog\Logger;
16
+
17
+ /**
18
+ * Sends logs to Fleep.io using Webhook integrations
19
+ *
20
+ * You'll need a Fleep.io account to use this handler.
21
+ *
22
+ * @see https://fleep.io/integrations/webhooks/ Fleep Webhooks Documentation
23
+ * @author Ando Roots <ando@sqroot.eu>
24
+ */
25
+ class FleepHookHandler extends SocketHandler
26
+ {
27
+ const FLEEP_HOST = 'fleep.io';
28
+
29
+ const FLEEP_HOOK_URI = '/hook/';
30
+
31
+ /**
32
+ * @var string Webhook token (specifies the conversation where logs are sent)
33
+ */
34
+ protected $token;
35
+
36
+ /**
37
+ * Construct a new Fleep.io Handler.
38
+ *
39
+ * For instructions on how to create a new web hook in your conversations
40
+ * see https://fleep.io/integrations/webhooks/
41
+ *
42
+ * @param string $token Webhook token
43
+ * @param bool|int $level The minimum logging level at which this handler will be triggered
44
+ * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
45
+ * @throws MissingExtensionException
46
+ */
47
+ public function __construct($token, $level = Logger::DEBUG, $bubble = true)
48
+ {
49
+ if (!extension_loaded('openssl')) {
50
+ throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FleepHookHandler');
51
+ }
52
+
53
+ $this->token = $token;
54
+
55
+ $connectionString = 'ssl://' . self::FLEEP_HOST . ':443';
56
+ parent::__construct($connectionString, $level, $bubble);
57
+ }
58
+
59
+ /**
60
+ * Returns the default formatter to use with this handler
61
+ *
62
+ * Overloaded to remove empty context and extra arrays from the end of the log message.
63
+ *
64
+ * @return LineFormatter
65
+ */
66
+ protected function getDefaultFormatter()
67
+ {
68
+ return new LineFormatter(null, null, true, true);
69
+ }
70
+
71
+ /**
72
+ * Handles a log record
73
+ *
74
+ * @param array $record
75
+ */
76
+ public function write(array $record)
77
+ {
78
+ parent::write($record);
79
+ $this->closeSocket();
80
+ }
81
+
82
+ /**
83
+ * {@inheritdoc}
84
+ *
85
+ * @param array $record
86
+ * @return string
87
+ */
88
+ protected function generateDataStream($record)
89
+ {
90
+ $content = $this->buildContent($record);
91
+
92
+ return $this->buildHeader($content) . $content;
93
+ }
94
+
95
+ /**
96
+ * Builds the header of the API Call
97
+ *
98
+ * @param string $content
99
+ * @return string
100
+ */
101
+ private function buildHeader($content)
102
+ {
103
+ $header = "POST " . self::FLEEP_HOOK_URI . $this->token . " HTTP/1.1\r\n";
104
+ $header .= "Host: " . self::FLEEP_HOST . "\r\n";
105
+ $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
106
+ $header .= "Content-Length: " . strlen($content) . "\r\n";
107
+ $header .= "\r\n";
108
+
109
+ return $header;
110
+ }
111
+
112
+ /**
113
+ * Builds the body of API call
114
+ *
115
+ * @param array $record
116
+ * @return string
117
+ */
118
+ private function buildContent($record)
119
+ {
120
+ $dataArray = array(
121
+ 'message' => $record['formatted'],
122
+ );
123
+
124
+ return http_build_query($dataArray);
125
+ }
126
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/FlowdockHandler.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+ use Monolog\Formatter\FlowdockFormatter;
16
+ use Monolog\Formatter\FormatterInterface;
17
+
18
+ /**
19
+ * Sends notifications through the Flowdock push API
20
+ *
21
+ * This must be configured with a FlowdockFormatter instance via setFormatter()
22
+ *
23
+ * Notes:
24
+ * API token - Flowdock API token
25
+ *
26
+ * @author Dominik Liebler <liebler.dominik@gmail.com>
27
+ * @see https://www.flowdock.com/api/push
28
+ */
29
+ class FlowdockHandler extends SocketHandler
30
+ {
31
+ /**
32
+ * @var string
33
+ */
34
+ protected $apiToken;
35
+
36
+ /**
37
+ * @param string $apiToken
38
+ * @param bool|int $level The minimum logging level at which this handler will be triggered
39
+ * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
40
+ *
41
+ * @throws MissingExtensionException if OpenSSL is missing
42
+ */
43
+ public function __construct($apiToken, $level = Logger::DEBUG, $bubble = true)
44
+ {
45
+ if (!extension_loaded('openssl')) {
46
+ throw new MissingExtensionException('The OpenSSL PHP extension is required to use the FlowdockHandler');
47
+ }
48
+
49
+ parent::__construct('ssl://api.flowdock.com:443', $level, $bubble);
50
+ $this->apiToken = $apiToken;
51
+ }
52
+
53
+ /**
54
+ * {@inheritdoc}
55
+ */
56
+ public function setFormatter(FormatterInterface $formatter)
57
+ {
58
+ if (!$formatter instanceof FlowdockFormatter) {
59
+ throw new \InvalidArgumentException('The FlowdockHandler requires an instance of Monolog\Formatter\FlowdockFormatter to function correctly');
60
+ }
61
+
62
+ return parent::setFormatter($formatter);
63
+ }
64
+
65
+ /**
66
+ * Gets the default formatter.
67
+ *
68
+ * @return FormatterInterface
69
+ */
70
+ protected function getDefaultFormatter()
71
+ {
72
+ throw new \InvalidArgumentException('The FlowdockHandler must be configured (via setFormatter) with an instance of Monolog\Formatter\FlowdockFormatter to function correctly');
73
+ }
74
+
75
+ /**
76
+ * {@inheritdoc}
77
+ *
78
+ * @param array $record
79
+ */
80
+ protected function write(array $record)
81
+ {
82
+ parent::write($record);
83
+
84
+ $this->closeSocket();
85
+ }
86
+
87
+ /**
88
+ * {@inheritdoc}
89
+ *
90
+ * @param array $record
91
+ * @return string
92
+ */
93
+ protected function generateDataStream($record)
94
+ {
95
+ $content = $this->buildContent($record);
96
+
97
+ return $this->buildHeader($content) . $content;
98
+ }
99
+
100
+ /**
101
+ * Builds the body of API call
102
+ *
103
+ * @param array $record
104
+ * @return string
105
+ */
106
+ private function buildContent($record)
107
+ {
108
+ return json_encode($record['formatted']['flowdock']);
109
+ }
110
+
111
+ /**
112
+ * Builds the header of the API Call
113
+ *
114
+ * @param string $content
115
+ * @return string
116
+ */
117
+ private function buildHeader($content)
118
+ {
119
+ $header = "POST /v1/messages/team_inbox/" . $this->apiToken . " HTTP/1.1\r\n";
120
+ $header .= "Host: api.flowdock.com\r\n";
121
+ $header .= "Content-Type: application/json\r\n";
122
+ $header .= "Content-Length: " . strlen($content) . "\r\n";
123
+ $header .= "\r\n";
124
+
125
+ return $header;
126
+ }
127
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/GelfHandler.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Gelf\IMessagePublisher;
15
+ use Gelf\PublisherInterface;
16
+ use Gelf\Publisher;
17
+ use InvalidArgumentException;
18
+ use Monolog\Logger;
19
+ use Monolog\Formatter\GelfMessageFormatter;
20
+
21
+ /**
22
+ * Handler to send messages to a Graylog2 (http://www.graylog2.org) server
23
+ *
24
+ * @author Matt Lehner <mlehner@gmail.com>
25
+ * @author Benjamin Zikarsky <benjamin@zikarsky.de>
26
+ */
27
+ class GelfHandler extends AbstractProcessingHandler
28
+ {
29
+ /**
30
+ * @var Publisher the publisher object that sends the message to the server
31
+ */
32
+ protected $publisher;
33
+
34
+ /**
35
+ * @param PublisherInterface|IMessagePublisher|Publisher $publisher a publisher object
36
+ * @param int $level The minimum logging level at which this handler will be triggered
37
+ * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
38
+ */
39
+ public function __construct($publisher, $level = Logger::DEBUG, $bubble = true)
40
+ {
41
+ parent::__construct($level, $bubble);
42
+
43
+ if (!$publisher instanceof Publisher && !$publisher instanceof IMessagePublisher && !$publisher instanceof PublisherInterface) {
44
+ throw new InvalidArgumentException('Invalid publisher, expected a Gelf\Publisher, Gelf\IMessagePublisher or Gelf\PublisherInterface instance');
45
+ }
46
+
47
+ $this->publisher = $publisher;
48
+ }
49
+
50
+ /**
51
+ * {@inheritdoc}
52
+ */
53
+ public function close()
54
+ {
55
+ $this->publisher = null;
56
+ }
57
+
58
+ /**
59
+ * {@inheritdoc}
60
+ */
61
+ protected function write(array $record)
62
+ {
63
+ $this->publisher->publish($record['formatted']);
64
+ }
65
+
66
+ /**
67
+ * {@inheritDoc}
68
+ */
69
+ protected function getDefaultFormatter()
70
+ {
71
+ return new GelfMessageFormatter();
72
+ }
73
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/GroupHandler.php ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Formatter\FormatterInterface;
15
+
16
+ /**
17
+ * Forwards records to multiple handlers
18
+ *
19
+ * @author Lenar Lõhmus <lenar@city.ee>
20
+ */
21
+ class GroupHandler extends AbstractHandler
22
+ {
23
+ protected $handlers;
24
+
25
+ /**
26
+ * @param array $handlers Array of Handlers.
27
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
28
+ */
29
+ public function __construct(array $handlers, $bubble = true)
30
+ {
31
+ foreach ($handlers as $handler) {
32
+ if (!$handler instanceof HandlerInterface) {
33
+ throw new \InvalidArgumentException('The first argument of the GroupHandler must be an array of HandlerInterface instances.');
34
+ }
35
+ }
36
+
37
+ $this->handlers = $handlers;
38
+ $this->bubble = $bubble;
39
+ }
40
+
41
+ /**
42
+ * {@inheritdoc}
43
+ */
44
+ public function isHandling(array $record)
45
+ {
46
+ foreach ($this->handlers as $handler) {
47
+ if ($handler->isHandling($record)) {
48
+ return true;
49
+ }
50
+ }
51
+
52
+ return false;
53
+ }
54
+
55
+ /**
56
+ * {@inheritdoc}
57
+ */
58
+ public function handle(array $record)
59
+ {
60
+ if ($this->processors) {
61
+ foreach ($this->processors as $processor) {
62
+ $record = call_user_func($processor, $record);
63
+ }
64
+ }
65
+
66
+ foreach ($this->handlers as $handler) {
67
+ $handler->handle($record);
68
+ }
69
+
70
+ return false === $this->bubble;
71
+ }
72
+
73
+ /**
74
+ * {@inheritdoc}
75
+ */
76
+ public function handleBatch(array $records)
77
+ {
78
+ if ($this->processors) {
79
+ $processed = array();
80
+ foreach ($records as $record) {
81
+ foreach ($this->processors as $processor) {
82
+ $processed[] = call_user_func($processor, $record);
83
+ }
84
+ }
85
+ $records = $processed;
86
+ }
87
+
88
+ foreach ($this->handlers as $handler) {
89
+ $handler->handleBatch($records);
90
+ }
91
+ }
92
+
93
+ /**
94
+ * {@inheritdoc}
95
+ */
96
+ public function setFormatter(FormatterInterface $formatter)
97
+ {
98
+ foreach ($this->handlers as $handler) {
99
+ $handler->setFormatter($formatter);
100
+ }
101
+
102
+ return $this;
103
+ }
104
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/HandlerInterface.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Formatter\FormatterInterface;
15
+
16
+ /**
17
+ * Interface that all Monolog Handlers must implement
18
+ *
19
+ * @author Jordi Boggiano <j.boggiano@seld.be>
20
+ */
21
+ interface HandlerInterface
22
+ {
23
+ /**
24
+ * Checks whether the given record will be handled by this handler.
25
+ *
26
+ * This is mostly done for performance reasons, to avoid calling processors for nothing.
27
+ *
28
+ * Handlers should still check the record levels within handle(), returning false in isHandling()
29
+ * is no guarantee that handle() will not be called, and isHandling() might not be called
30
+ * for a given record.
31
+ *
32
+ * @param array $record Partial log record containing only a level key
33
+ *
34
+ * @return Boolean
35
+ */
36
+ public function isHandling(array $record);
37
+
38
+ /**
39
+ * Handles a record.
40
+ *
41
+ * All records may be passed to this method, and the handler should discard
42
+ * those that it does not want to handle.
43
+ *
44
+ * The return value of this function controls the bubbling process of the handler stack.
45
+ * Unless the bubbling is interrupted (by returning true), the Logger class will keep on
46
+ * calling further handlers in the stack with a given log record.
47
+ *
48
+ * @param array $record The record to handle
49
+ * @return Boolean true means that this handler handled the record, and that bubbling is not permitted.
50
+ * false means the record was either not processed or that this handler allows bubbling.
51
+ */
52
+ public function handle(array $record);
53
+
54
+ /**
55
+ * Handles a set of records at once.
56
+ *
57
+ * @param array $records The records to handle (an array of record arrays)
58
+ */
59
+ public function handleBatch(array $records);
60
+
61
+ /**
62
+ * Adds a processor in the stack.
63
+ *
64
+ * @param callable $callback
65
+ * @return self
66
+ */
67
+ public function pushProcessor($callback);
68
+
69
+ /**
70
+ * Removes the processor on top of the stack and returns it.
71
+ *
72
+ * @return callable
73
+ */
74
+ public function popProcessor();
75
+
76
+ /**
77
+ * Sets the formatter.
78
+ *
79
+ * @param FormatterInterface $formatter
80
+ * @return self
81
+ */
82
+ public function setFormatter(FormatterInterface $formatter);
83
+
84
+ /**
85
+ * Gets the formatter.
86
+ *
87
+ * @return FormatterInterface
88
+ */
89
+ public function getFormatter();
90
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/HandlerWrapper.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Formatter\FormatterInterface;
15
+
16
+ /**
17
+ * This simple wrapper class can be used to extend handlers functionality.
18
+ *
19
+ * Example: A custom filtering that can be applied to any handler.
20
+ *
21
+ * Inherit from this class and override handle() like this:
22
+ *
23
+ * public function handle(array $record)
24
+ * {
25
+ * if ($record meets certain conditions) {
26
+ * return false;
27
+ * }
28
+ * return $this->handler->handle($record);
29
+ * }
30
+ *
31
+ * @author Alexey Karapetov <alexey@karapetov.com>
32
+ */
33
+ class HandlerWrapper implements HandlerInterface
34
+ {
35
+ /**
36
+ * @var HandlerInterface
37
+ */
38
+ protected $handler;
39
+
40
+ /**
41
+ * HandlerWrapper constructor.
42
+ * @param HandlerInterface $handler
43
+ */
44
+ public function __construct(HandlerInterface $handler)
45
+ {
46
+ $this->handler = $handler;
47
+ }
48
+
49
+ /**
50
+ * {@inheritdoc}
51
+ */
52
+ public function isHandling(array $record)
53
+ {
54
+ return $this->handler->isHandling($record);
55
+ }
56
+
57
+ /**
58
+ * {@inheritdoc}
59
+ */
60
+ public function handle(array $record)
61
+ {
62
+ return $this->handler->handle($record);
63
+ }
64
+
65
+ /**
66
+ * {@inheritdoc}
67
+ */
68
+ public function handleBatch(array $records)
69
+ {
70
+ return $this->handler->handleBatch($records);
71
+ }
72
+
73
+ /**
74
+ * {@inheritdoc}
75
+ */
76
+ public function pushProcessor($callback)
77
+ {
78
+ $this->handler->pushProcessor($callback);
79
+
80
+ return $this;
81
+ }
82
+
83
+ /**
84
+ * {@inheritdoc}
85
+ */
86
+ public function popProcessor()
87
+ {
88
+ return $this->handler->popProcessor();
89
+ }
90
+
91
+ /**
92
+ * {@inheritdoc}
93
+ */
94
+ public function setFormatter(FormatterInterface $formatter)
95
+ {
96
+ $this->handler->setFormatter($formatter);
97
+
98
+ return $this;
99
+ }
100
+
101
+ /**
102
+ * {@inheritdoc}
103
+ */
104
+ public function getFormatter()
105
+ {
106
+ return $this->handler->getFormatter();
107
+ }
108
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/HipChatHandler.php ADDED
@@ -0,0 +1,350 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Sends notifications through the hipchat api to a hipchat room
18
+ *
19
+ * Notes:
20
+ * API token - HipChat API token
21
+ * Room - HipChat Room Id or name, where messages are sent
22
+ * Name - Name used to send the message (from)
23
+ * notify - Should the message trigger a notification in the clients
24
+ * version - The API version to use (HipChatHandler::API_V1 | HipChatHandler::API_V2)
25
+ *
26
+ * @author Rafael Dohms <rafael@doh.ms>
27
+ * @see https://www.hipchat.com/docs/api
28
+ */
29
+ class HipChatHandler extends SocketHandler
30
+ {
31
+ /**
32
+ * Use API version 1
33
+ */
34
+ const API_V1 = 'v1';
35
+
36
+ /**
37
+ * Use API version v2
38
+ */
39
+ const API_V2 = 'v2';
40
+
41
+ /**
42
+ * The maximum allowed length for the name used in the "from" field.
43
+ */
44
+ const MAXIMUM_NAME_LENGTH = 15;
45
+
46
+ /**
47
+ * The maximum allowed length for the message.
48
+ */
49
+ const MAXIMUM_MESSAGE_LENGTH = 9500;
50
+
51
+ /**
52
+ * @var string
53
+ */
54
+ private $token;
55
+
56
+ /**
57
+ * @var string
58
+ */
59
+ private $room;
60
+
61
+ /**
62
+ * @var string
63
+ */
64
+ private $name;
65
+
66
+ /**
67
+ * @var bool
68
+ */
69
+ private $notify;
70
+
71
+ /**
72
+ * @var string
73
+ */
74
+ private $format;
75
+
76
+ /**
77
+ * @var string
78
+ */
79
+ private $host;
80
+
81
+ /**
82
+ * @var string
83
+ */
84
+ private $version;
85
+
86
+ /**
87
+ * @param string $token HipChat API Token
88
+ * @param string $room The room that should be alerted of the message (Id or Name)
89
+ * @param string $name Name used in the "from" field.
90
+ * @param bool $notify Trigger a notification in clients or not
91
+ * @param int $level The minimum logging level at which this handler will be triggered
92
+ * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
93
+ * @param bool $useSSL Whether to connect via SSL.
94
+ * @param string $format The format of the messages (default to text, can be set to html if you have html in the messages)
95
+ * @param string $host The HipChat server hostname.
96
+ * @param string $version The HipChat API version (default HipChatHandler::API_V1)
97
+ */
98
+ public function __construct($token, $room, $name = 'Monolog', $notify = false, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $format = 'text', $host = 'api.hipchat.com', $version = self::API_V1)
99
+ {
100
+ if ($version == self::API_V1 && !$this->validateStringLength($name, static::MAXIMUM_NAME_LENGTH)) {
101
+ throw new \InvalidArgumentException('The supplied name is too long. HipChat\'s v1 API supports names up to 15 UTF-8 characters.');
102
+ }
103
+
104
+ $connectionString = $useSSL ? 'ssl://'.$host.':443' : $host.':80';
105
+ parent::__construct($connectionString, $level, $bubble);
106
+
107
+ $this->token = $token;
108
+ $this->name = $name;
109
+ $this->notify = $notify;
110
+ $this->room = $room;
111
+ $this->format = $format;
112
+ $this->host = $host;
113
+ $this->version = $version;
114
+ }
115
+
116
+ /**
117
+ * {@inheritdoc}
118
+ *
119
+ * @param array $record
120
+ * @return string
121
+ */
122
+ protected function generateDataStream($record)
123
+ {
124
+ $content = $this->buildContent($record);
125
+
126
+ return $this->buildHeader($content) . $content;
127
+ }
128
+
129
+ /**
130
+ * Builds the body of API call
131
+ *
132
+ * @param array $record
133
+ * @return string
134
+ */
135
+ private function buildContent($record)
136
+ {
137
+ $dataArray = array(
138
+ 'notify' => $this->version == self::API_V1 ?
139
+ ($this->notify ? 1 : 0) :
140
+ ($this->notify ? 'true' : 'false'),
141
+ 'message' => $record['formatted'],
142
+ 'message_format' => $this->format,
143
+ 'color' => $this->getAlertColor($record['level']),
144
+ );
145
+
146
+ if (!$this->validateStringLength($dataArray['message'], static::MAXIMUM_MESSAGE_LENGTH)) {
147
+ if (function_exists('mb_substr')) {
148
+ $dataArray['message'] = mb_substr($dataArray['message'], 0, static::MAXIMUM_MESSAGE_LENGTH).' [truncated]';
149
+ } else {
150
+ $dataArray['message'] = substr($dataArray['message'], 0, static::MAXIMUM_MESSAGE_LENGTH).' [truncated]';
151
+ }
152
+ }
153
+
154
+ // if we are using the legacy API then we need to send some additional information
155
+ if ($this->version == self::API_V1) {
156
+ $dataArray['room_id'] = $this->room;
157
+ }
158
+
159
+ // append the sender name if it is set
160
+ // always append it if we use the v1 api (it is required in v1)
161
+ if ($this->version == self::API_V1 || $this->name !== null) {
162
+ $dataArray['from'] = (string) $this->name;
163
+ }
164
+
165
+ return http_build_query($dataArray);
166
+ }
167
+
168
+ /**
169
+ * Builds the header of the API Call
170
+ *
171
+ * @param string $content
172
+ * @return string
173
+ */
174
+ private function buildHeader($content)
175
+ {
176
+ if ($this->version == self::API_V1) {
177
+ $header = "POST /v1/rooms/message?format=json&auth_token={$this->token} HTTP/1.1\r\n";
178
+ } else {
179
+ // needed for rooms with special (spaces, etc) characters in the name
180
+ $room = rawurlencode($this->room);
181
+ $header = "POST /v2/room/{$room}/notification?auth_token={$this->token} HTTP/1.1\r\n";
182
+ }
183
+
184
+ $header .= "Host: {$this->host}\r\n";
185
+ $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
186
+ $header .= "Content-Length: " . strlen($content) . "\r\n";
187
+ $header .= "\r\n";
188
+
189
+ return $header;
190
+ }
191
+
192
+ /**
193
+ * Assigns a color to each level of log records.
194
+ *
195
+ * @param int $level
196
+ * @return string
197
+ */
198
+ protected function getAlertColor($level)
199
+ {
200
+ switch (true) {
201
+ case $level >= Logger::ERROR:
202
+ return 'red';
203
+ case $level >= Logger::WARNING:
204
+ return 'yellow';
205
+ case $level >= Logger::INFO:
206
+ return 'green';
207
+ case $level == Logger::DEBUG:
208
+ return 'gray';
209
+ default:
210
+ return 'yellow';
211
+ }
212
+ }
213
+
214
+ /**
215
+ * {@inheritdoc}
216
+ *
217
+ * @param array $record
218
+ */
219
+ protected function write(array $record)
220
+ {
221
+ parent::write($record);
222
+ $this->closeSocket();
223
+ }
224
+
225
+ /**
226
+ * {@inheritdoc}
227
+ */
228
+ public function handleBatch(array $records)
229
+ {
230
+ if (count($records) == 0) {
231
+ return true;
232
+ }
233
+
234
+ $batchRecords = $this->combineRecords($records);
235
+
236
+ $handled = false;
237
+ foreach ($batchRecords as $batchRecord) {
238
+ if ($this->isHandling($batchRecord)) {
239
+ $this->write($batchRecord);
240
+ $handled = true;
241
+ }
242
+ }
243
+
244
+ if (!$handled) {
245
+ return false;
246
+ }
247
+
248
+ return false === $this->bubble;
249
+ }
250
+
251
+ /**
252
+ * Combines multiple records into one. Error level of the combined record
253
+ * will be the highest level from the given records. Datetime will be taken
254
+ * from the first record.
255
+ *
256
+ * @param $records
257
+ * @return array
258
+ */
259
+ private function combineRecords($records)
260
+ {
261
+ $batchRecord = null;
262
+ $batchRecords = array();
263
+ $messages = array();
264
+ $formattedMessages = array();
265
+ $level = 0;
266
+ $levelName = null;
267
+ $datetime = null;
268
+
269
+ foreach ($records as $record) {
270
+ $record = $this->processRecord($record);
271
+
272
+ if ($record['level'] > $level) {
273
+ $level = $record['level'];
274
+ $levelName = $record['level_name'];
275
+ }
276
+
277
+ if (null === $datetime) {
278
+ $datetime = $record['datetime'];
279
+ }
280
+
281
+ $messages[] = $record['message'];
282
+ $messageStr = implode(PHP_EOL, $messages);
283
+ $formattedMessages[] = $this->getFormatter()->format($record);
284
+ $formattedMessageStr = implode('', $formattedMessages);
285
+
286
+ $batchRecord = array(
287
+ 'message' => $messageStr,
288
+ 'formatted' => $formattedMessageStr,
289
+ 'context' => array(),
290
+ 'extra' => array(),
291
+ );
292
+
293
+ if (!$this->validateStringLength($batchRecord['formatted'], static::MAXIMUM_MESSAGE_LENGTH)) {
294
+ // Pop the last message and implode the remaining messages
295
+ $lastMessage = array_pop($messages);
296
+ $lastFormattedMessage = array_pop($formattedMessages);
297
+ $batchRecord['message'] = implode(PHP_EOL, $messages);
298
+ $batchRecord['formatted'] = implode('', $formattedMessages);
299
+
300
+ $batchRecords[] = $batchRecord;
301
+ $messages = array($lastMessage);
302
+ $formattedMessages = array($lastFormattedMessage);
303
+
304
+ $batchRecord = null;
305
+ }
306
+ }
307
+
308
+ if (null !== $batchRecord) {
309
+ $batchRecords[] = $batchRecord;
310
+ }
311
+
312
+ // Set the max level and datetime for all records
313
+ foreach ($batchRecords as &$batchRecord) {
314
+ $batchRecord = array_merge(
315
+ $batchRecord,
316
+ array(
317
+ 'level' => $level,
318
+ 'level_name' => $levelName,
319
+ 'datetime' => $datetime,
320
+ )
321
+ );
322
+ }
323
+
324
+ return $batchRecords;
325
+ }
326
+
327
+ /**
328
+ * Validates the length of a string.
329
+ *
330
+ * If the `mb_strlen()` function is available, it will use that, as HipChat
331
+ * allows UTF-8 characters. Otherwise, it will fall back to `strlen()`.
332
+ *
333
+ * Note that this might cause false failures in the specific case of using
334
+ * a valid name with less than 16 characters, but 16 or more bytes, on a
335
+ * system where `mb_strlen()` is unavailable.
336
+ *
337
+ * @param string $str
338
+ * @param int $length
339
+ *
340
+ * @return bool
341
+ */
342
+ private function validateStringLength($str, $length)
343
+ {
344
+ if (function_exists('mb_strlen')) {
345
+ return (mb_strlen($str) <= $length);
346
+ }
347
+
348
+ return (strlen($str) <= $length);
349
+ }
350
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/IFTTTHandler.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * IFTTTHandler uses cURL to trigger IFTTT Maker actions
18
+ *
19
+ * Register a secret key and trigger/event name at https://ifttt.com/maker
20
+ *
21
+ * value1 will be the channel from monolog's Logger constructor,
22
+ * value2 will be the level name (ERROR, WARNING, ..)
23
+ * value3 will be the log record's message
24
+ *
25
+ * @author Nehal Patel <nehal@nehalpatel.me>
26
+ */
27
+ class IFTTTHandler extends AbstractProcessingHandler
28
+ {
29
+ private $eventName;
30
+ private $secretKey;
31
+
32
+ /**
33
+ * @param string $eventName The name of the IFTTT Maker event that should be triggered
34
+ * @param string $secretKey A valid IFTTT secret key
35
+ * @param int $level The minimum logging level at which this handler will be triggered
36
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
37
+ */
38
+ public function __construct($eventName, $secretKey, $level = Logger::ERROR, $bubble = true)
39
+ {
40
+ $this->eventName = $eventName;
41
+ $this->secretKey = $secretKey;
42
+
43
+ parent::__construct($level, $bubble);
44
+ }
45
+
46
+ /**
47
+ * {@inheritdoc}
48
+ */
49
+ public function write(array $record)
50
+ {
51
+ $postData = array(
52
+ "value1" => $record["channel"],
53
+ "value2" => $record["level_name"],
54
+ "value3" => $record["message"],
55
+ );
56
+ $postString = json_encode($postData);
57
+
58
+ $ch = curl_init();
59
+ curl_setopt($ch, CURLOPT_URL, "https://maker.ifttt.com/trigger/" . $this->eventName . "/with/key/" . $this->secretKey);
60
+ curl_setopt($ch, CURLOPT_POST, true);
61
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
62
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
63
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array(
64
+ "Content-Type: application/json",
65
+ ));
66
+
67
+ Curl\Util::execute($ch);
68
+ }
69
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/LogEntriesHandler.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * @author Robert Kaufmann III <rok3@rok3.me>
18
+ */
19
+ class LogEntriesHandler extends SocketHandler
20
+ {
21
+ /**
22
+ * @var string
23
+ */
24
+ protected $logToken;
25
+
26
+ /**
27
+ * @param string $token Log token supplied by LogEntries
28
+ * @param bool $useSSL Whether or not SSL encryption should be used.
29
+ * @param int $level The minimum logging level to trigger this handler
30
+ * @param bool $bubble Whether or not messages that are handled should bubble up the stack.
31
+ *
32
+ * @throws MissingExtensionException If SSL encryption is set to true and OpenSSL is missing
33
+ */
34
+ public function __construct($token, $useSSL = true, $level = Logger::DEBUG, $bubble = true)
35
+ {
36
+ if ($useSSL && !extension_loaded('openssl')) {
37
+ throw new MissingExtensionException('The OpenSSL PHP plugin is required to use SSL encrypted connection for LogEntriesHandler');
38
+ }
39
+
40
+ $endpoint = $useSSL ? 'ssl://data.logentries.com:443' : 'data.logentries.com:80';
41
+ parent::__construct($endpoint, $level, $bubble);
42
+ $this->logToken = $token;
43
+ }
44
+
45
+ /**
46
+ * {@inheritdoc}
47
+ *
48
+ * @param array $record
49
+ * @return string
50
+ */
51
+ protected function generateDataStream($record)
52
+ {
53
+ return $this->logToken . ' ' . $record['formatted'];
54
+ }
55
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/LogglyHandler.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+ use Monolog\Formatter\LogglyFormatter;
16
+
17
+ /**
18
+ * Sends errors to Loggly.
19
+ *
20
+ * @author Przemek Sobstel <przemek@sobstel.org>
21
+ * @author Adam Pancutt <adam@pancutt.com>
22
+ * @author Gregory Barchard <gregory@barchard.net>
23
+ */
24
+ class LogglyHandler extends AbstractProcessingHandler
25
+ {
26
+ const HOST = 'logs-01.loggly.com';
27
+ const ENDPOINT_SINGLE = 'inputs';
28
+ const ENDPOINT_BATCH = 'bulk';
29
+
30
+ protected $token;
31
+
32
+ protected $tag = array();
33
+
34
+ public function __construct($token, $level = Logger::DEBUG, $bubble = true)
35
+ {
36
+ if (!extension_loaded('curl')) {
37
+ throw new \LogicException('The curl extension is needed to use the LogglyHandler');
38
+ }
39
+
40
+ $this->token = $token;
41
+
42
+ parent::__construct($level, $bubble);
43
+ }
44
+
45
+ public function setTag($tag)
46
+ {
47
+ $tag = !empty($tag) ? $tag : array();
48
+ $this->tag = is_array($tag) ? $tag : array($tag);
49
+ }
50
+
51
+ public function addTag($tag)
52
+ {
53
+ if (!empty($tag)) {
54
+ $tag = is_array($tag) ? $tag : array($tag);
55
+ $this->tag = array_unique(array_merge($this->tag, $tag));
56
+ }
57
+ }
58
+
59
+ protected function write(array $record)
60
+ {
61
+ $this->send($record["formatted"], self::ENDPOINT_SINGLE);
62
+ }
63
+
64
+ public function handleBatch(array $records)
65
+ {
66
+ $level = $this->level;
67
+
68
+ $records = array_filter($records, function ($record) use ($level) {
69
+ return ($record['level'] >= $level);
70
+ });
71
+
72
+ if ($records) {
73
+ $this->send($this->getFormatter()->formatBatch($records), self::ENDPOINT_BATCH);
74
+ }
75
+ }
76
+
77
+ protected function send($data, $endpoint)
78
+ {
79
+ $url = sprintf("https://%s/%s/%s/", self::HOST, $endpoint, $this->token);
80
+
81
+ $headers = array('Content-Type: application/json');
82
+
83
+ if (!empty($this->tag)) {
84
+ $headers[] = 'X-LOGGLY-TAG: '.implode(',', $this->tag);
85
+ }
86
+
87
+ $ch = curl_init();
88
+
89
+ curl_setopt($ch, CURLOPT_URL, $url);
90
+ curl_setopt($ch, CURLOPT_POST, true);
91
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
92
+ curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
93
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
94
+
95
+ Curl\Util::execute($ch);
96
+ }
97
+
98
+ protected function getDefaultFormatter()
99
+ {
100
+ return new LogglyFormatter();
101
+ }
102
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/MailHandler.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ /**
15
+ * Base class for all mail handlers
16
+ *
17
+ * @author Gyula Sallai
18
+ */
19
+ abstract class MailHandler extends AbstractProcessingHandler
20
+ {
21
+ /**
22
+ * {@inheritdoc}
23
+ */
24
+ public function handleBatch(array $records)
25
+ {
26
+ $messages = array();
27
+
28
+ foreach ($records as $record) {
29
+ if ($record['level'] < $this->level) {
30
+ continue;
31
+ }
32
+ $messages[] = $this->processRecord($record);
33
+ }
34
+
35
+ if (!empty($messages)) {
36
+ $this->send((string) $this->getFormatter()->formatBatch($messages), $messages);
37
+ }
38
+ }
39
+
40
+ /**
41
+ * Send a mail with the given content
42
+ *
43
+ * @param string $content formatted email body to be sent
44
+ * @param array $records the array of log records that formed this content
45
+ */
46
+ abstract protected function send($content, array $records);
47
+
48
+ /**
49
+ * {@inheritdoc}
50
+ */
51
+ protected function write(array $record)
52
+ {
53
+ $this->send((string) $record['formatted'], array($record));
54
+ }
55
+
56
+ protected function getHighestRecord(array $records)
57
+ {
58
+ $highestRecord = null;
59
+ foreach ($records as $record) {
60
+ if ($highestRecord === null || $highestRecord['level'] < $record['level']) {
61
+ $highestRecord = $record;
62
+ }
63
+ }
64
+
65
+ return $highestRecord;
66
+ }
67
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/MandrillHandler.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * MandrillHandler uses cURL to send the emails to the Mandrill API
18
+ *
19
+ * @author Adam Nicholson <adamnicholson10@gmail.com>
20
+ */
21
+ class MandrillHandler extends MailHandler
22
+ {
23
+ protected $message;
24
+ protected $apiKey;
25
+
26
+ /**
27
+ * @param string $apiKey A valid Mandrill API key
28
+ * @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced
29
+ * @param int $level The minimum logging level at which this handler will be triggered
30
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
31
+ */
32
+ public function __construct($apiKey, $message, $level = Logger::ERROR, $bubble = true)
33
+ {
34
+ parent::__construct($level, $bubble);
35
+
36
+ if (!$message instanceof \Swift_Message && is_callable($message)) {
37
+ $message = call_user_func($message);
38
+ }
39
+ if (!$message instanceof \Swift_Message) {
40
+ throw new \InvalidArgumentException('You must provide either a Swift_Message instance or a callable returning it');
41
+ }
42
+ $this->message = $message;
43
+ $this->apiKey = $apiKey;
44
+ }
45
+
46
+ /**
47
+ * {@inheritdoc}
48
+ */
49
+ protected function send($content, array $records)
50
+ {
51
+ $message = clone $this->message;
52
+ $message->setBody($content);
53
+ $message->setDate(time());
54
+
55
+ $ch = curl_init();
56
+
57
+ curl_setopt($ch, CURLOPT_URL, 'https://mandrillapp.com/api/1.0/messages/send-raw.json');
58
+ curl_setopt($ch, CURLOPT_POST, 1);
59
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
60
+ curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array(
61
+ 'key' => $this->apiKey,
62
+ 'raw_message' => (string) $message,
63
+ 'async' => false,
64
+ )));
65
+
66
+ Curl\Util::execute($ch);
67
+ }
68
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/MissingExtensionException.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ /**
15
+ * Exception can be thrown if an extension for an handler is missing
16
+ *
17
+ * @author Christian Bergau <cbergau86@gmail.com>
18
+ */
19
+ class MissingExtensionException extends \Exception
20
+ {
21
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/MongoDBHandler.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+ use Monolog\Formatter\NormalizerFormatter;
16
+
17
+ /**
18
+ * Logs to a MongoDB database.
19
+ *
20
+ * usage example:
21
+ *
22
+ * $log = new Logger('application');
23
+ * $mongodb = new MongoDBHandler(new \Mongo("mongodb://localhost:27017"), "logs", "prod");
24
+ * $log->pushHandler($mongodb);
25
+ *
26
+ * @author Thomas Tourlourat <thomas@tourlourat.com>
27
+ */
28
+ class MongoDBHandler extends AbstractProcessingHandler
29
+ {
30
+ protected $mongoCollection;
31
+
32
+ public function __construct($mongo, $database, $collection, $level = Logger::DEBUG, $bubble = true)
33
+ {
34
+ if (!($mongo instanceof \MongoClient || $mongo instanceof \Mongo || $mongo instanceof \MongoDB\Client)) {
35
+ throw new \InvalidArgumentException('MongoClient, Mongo or MongoDB\Client instance required');
36
+ }
37
+
38
+ $this->mongoCollection = $mongo->selectCollection($database, $collection);
39
+
40
+ parent::__construct($level, $bubble);
41
+ }
42
+
43
+ protected function write(array $record)
44
+ {
45
+ if ($this->mongoCollection instanceof \MongoDB\Collection) {
46
+ $this->mongoCollection->insertOne($record["formatted"]);
47
+ } else {
48
+ $this->mongoCollection->save($record["formatted"]);
49
+ }
50
+ }
51
+
52
+ /**
53
+ * {@inheritDoc}
54
+ */
55
+ protected function getDefaultFormatter()
56
+ {
57
+ return new NormalizerFormatter();
58
+ }
59
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/NativeMailerHandler.php ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+ use Monolog\Formatter\LineFormatter;
16
+
17
+ /**
18
+ * NativeMailerHandler uses the mail() function to send the emails
19
+ *
20
+ * @author Christophe Coevoet <stof@notk.org>
21
+ * @author Mark Garrett <mark@moderndeveloperllc.com>
22
+ */
23
+ class NativeMailerHandler extends MailHandler
24
+ {
25
+ /**
26
+ * The email addresses to which the message will be sent
27
+ * @var array
28
+ */
29
+ protected $to;
30
+
31
+ /**
32
+ * The subject of the email
33
+ * @var string
34
+ */
35
+ protected $subject;
36
+
37
+ /**
38
+ * Optional headers for the message
39
+ * @var array
40
+ */
41
+ protected $headers = array();
42
+
43
+ /**
44
+ * Optional parameters for the message
45
+ * @var array
46
+ */
47
+ protected $parameters = array();
48
+
49
+ /**
50
+ * The wordwrap length for the message
51
+ * @var int
52
+ */
53
+ protected $maxColumnWidth;
54
+
55
+ /**
56
+ * The Content-type for the message
57
+ * @var string
58
+ */
59
+ protected $contentType = 'text/plain';
60
+
61
+ /**
62
+ * The encoding for the message
63
+ * @var string
64
+ */
65
+ protected $encoding = 'utf-8';
66
+
67
+ /**
68
+ * @param string|array $to The receiver of the mail
69
+ * @param string $subject The subject of the mail
70
+ * @param string $from The sender of the mail
71
+ * @param int $level The minimum logging level at which this handler will be triggered
72
+ * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
73
+ * @param int $maxColumnWidth The maximum column width that the message lines will have
74
+ */
75
+ public function __construct($to, $subject, $from, $level = Logger::ERROR, $bubble = true, $maxColumnWidth = 70)
76
+ {
77
+ parent::__construct($level, $bubble);
78
+ $this->to = is_array($to) ? $to : array($to);
79
+ $this->subject = $subject;
80
+ $this->addHeader(sprintf('From: %s', $from));
81
+ $this->maxColumnWidth = $maxColumnWidth;
82
+ }
83
+
84
+ /**
85
+ * Add headers to the message
86
+ *
87
+ * @param string|array $headers Custom added headers
88
+ * @return self
89
+ */
90
+ public function addHeader($headers)
91
+ {
92
+ foreach ((array) $headers as $header) {
93
+ if (strpos($header, "\n") !== false || strpos($header, "\r") !== false) {
94
+ throw new \InvalidArgumentException('Headers can not contain newline characters for security reasons');
95
+ }
96
+ $this->headers[] = $header;
97
+ }
98
+
99
+ return $this;
100
+ }
101
+
102
+ /**
103
+ * Add parameters to the message
104
+ *
105
+ * @param string|array $parameters Custom added parameters
106
+ * @return self
107
+ */
108
+ public function addParameter($parameters)
109
+ {
110
+ $this->parameters = array_merge($this->parameters, (array) $parameters);
111
+
112
+ return $this;
113
+ }
114
+
115
+ /**
116
+ * {@inheritdoc}
117
+ */
118
+ protected function send($content, array $records)
119
+ {
120
+ $content = wordwrap($content, $this->maxColumnWidth);
121
+ $headers = ltrim(implode("\r\n", $this->headers) . "\r\n", "\r\n");
122
+ $headers .= 'Content-type: ' . $this->getContentType() . '; charset=' . $this->getEncoding() . "\r\n";
123
+ if ($this->getContentType() == 'text/html' && false === strpos($headers, 'MIME-Version:')) {
124
+ $headers .= 'MIME-Version: 1.0' . "\r\n";
125
+ }
126
+
127
+ $subject = $this->subject;
128
+ if ($records) {
129
+ $subjectFormatter = new LineFormatter($this->subject);
130
+ $subject = $subjectFormatter->format($this->getHighestRecord($records));
131
+ }
132
+
133
+ $parameters = implode(' ', $this->parameters);
134
+ foreach ($this->to as $to) {
135
+ mail($to, $subject, $content, $headers, $parameters);
136
+ }
137
+ }
138
+
139
+ /**
140
+ * @return string $contentType
141
+ */
142
+ public function getContentType()
143
+ {
144
+ return $this->contentType;
145
+ }
146
+
147
+ /**
148
+ * @return string $encoding
149
+ */
150
+ public function getEncoding()
151
+ {
152
+ return $this->encoding;
153
+ }
154
+
155
+ /**
156
+ * @param string $contentType The content type of the email - Defaults to text/plain. Use text/html for HTML
157
+ * messages.
158
+ * @return self
159
+ */
160
+ public function setContentType($contentType)
161
+ {
162
+ if (strpos($contentType, "\n") !== false || strpos($contentType, "\r") !== false) {
163
+ throw new \InvalidArgumentException('The content type can not contain newline characters to prevent email header injection');
164
+ }
165
+
166
+ $this->contentType = $contentType;
167
+
168
+ return $this;
169
+ }
170
+
171
+ /**
172
+ * @param string $encoding
173
+ * @return self
174
+ */
175
+ public function setEncoding($encoding)
176
+ {
177
+ if (strpos($encoding, "\n") !== false || strpos($encoding, "\r") !== false) {
178
+ throw new \InvalidArgumentException('The encoding can not contain newline characters to prevent email header injection');
179
+ }
180
+
181
+ $this->encoding = $encoding;
182
+
183
+ return $this;
184
+ }
185
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/NewRelicHandler.php ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+ use Monolog\Formatter\NormalizerFormatter;
16
+
17
+ /**
18
+ * Class to record a log on a NewRelic application.
19
+ * Enabling New Relic High Security mode may prevent capture of useful information.
20
+ *
21
+ * @see https://docs.newrelic.com/docs/agents/php-agent
22
+ * @see https://docs.newrelic.com/docs/accounts-partnerships/accounts/security/high-security
23
+ */
24
+ class NewRelicHandler extends AbstractProcessingHandler
25
+ {
26
+ /**
27
+ * Name of the New Relic application that will receive logs from this handler.
28
+ *
29
+ * @var string
30
+ */
31
+ protected $appName;
32
+
33
+ /**
34
+ * Name of the current transaction
35
+ *
36
+ * @var string
37
+ */
38
+ protected $transactionName;
39
+
40
+ /**
41
+ * Some context and extra data is passed into the handler as arrays of values. Do we send them as is
42
+ * (useful if we are using the API), or explode them for display on the NewRelic RPM website?
43
+ *
44
+ * @var bool
45
+ */
46
+ protected $explodeArrays;
47
+
48
+ /**
49
+ * {@inheritDoc}
50
+ *
51
+ * @param string $appName
52
+ * @param bool $explodeArrays
53
+ * @param string $transactionName
54
+ */
55
+ public function __construct(
56
+ $level = Logger::ERROR,
57
+ $bubble = true,
58
+ $appName = null,
59
+ $explodeArrays = false,
60
+ $transactionName = null
61
+ ) {
62
+ parent::__construct($level, $bubble);
63
+
64
+ $this->appName = $appName;
65
+ $this->explodeArrays = $explodeArrays;
66
+ $this->transactionName = $transactionName;
67
+ }
68
+
69
+ /**
70
+ * {@inheritDoc}
71
+ */
72
+ protected function write(array $record)
73
+ {
74
+ if (!$this->isNewRelicEnabled()) {
75
+ throw new MissingExtensionException('The newrelic PHP extension is required to use the NewRelicHandler');
76
+ }
77
+
78
+ if ($appName = $this->getAppName($record['context'])) {
79
+ $this->setNewRelicAppName($appName);
80
+ }
81
+
82
+ if ($transactionName = $this->getTransactionName($record['context'])) {
83
+ $this->setNewRelicTransactionName($transactionName);
84
+ unset($record['formatted']['context']['transaction_name']);
85
+ }
86
+
87
+ if (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Exception) {
88
+ newrelic_notice_error($record['message'], $record['context']['exception']);
89
+ unset($record['formatted']['context']['exception']);
90
+ } else {
91
+ newrelic_notice_error($record['message']);
92
+ }
93
+
94
+ if (isset($record['formatted']['context']) && is_array($record['formatted']['context'])) {
95
+ foreach ($record['formatted']['context'] as $key => $parameter) {
96
+ if (is_array($parameter) && $this->explodeArrays) {
97
+ foreach ($parameter as $paramKey => $paramValue) {
98
+ $this->setNewRelicParameter('context_' . $key . '_' . $paramKey, $paramValue);
99
+ }
100
+ } else {
101
+ $this->setNewRelicParameter('context_' . $key, $parameter);
102
+ }
103
+ }
104
+ }
105
+
106
+ if (isset($record['formatted']['extra']) && is_array($record['formatted']['extra'])) {
107
+ foreach ($record['formatted']['extra'] as $key => $parameter) {
108
+ if (is_array($parameter) && $this->explodeArrays) {
109
+ foreach ($parameter as $paramKey => $paramValue) {
110
+ $this->setNewRelicParameter('extra_' . $key . '_' . $paramKey, $paramValue);
111
+ }
112
+ } else {
113
+ $this->setNewRelicParameter('extra_' . $key, $parameter);
114
+ }
115
+ }
116
+ }
117
+ }
118
+
119
+ /**
120
+ * Checks whether the NewRelic extension is enabled in the system.
121
+ *
122
+ * @return bool
123
+ */
124
+ protected function isNewRelicEnabled()
125
+ {
126
+ return extension_loaded('newrelic');
127
+ }
128
+
129
+ /**
130
+ * Returns the appname where this log should be sent. Each log can override the default appname, set in this
131
+ * handler's constructor, by providing the appname in it's context.
132
+ *
133
+ * @param array $context
134
+ * @return null|string
135
+ */
136
+ protected function getAppName(array $context)
137
+ {
138
+ if (isset($context['appname'])) {
139
+ return $context['appname'];
140
+ }
141
+
142
+ return $this->appName;
143
+ }
144
+
145
+ /**
146
+ * Returns the name of the current transaction. Each log can override the default transaction name, set in this
147
+ * handler's constructor, by providing the transaction_name in it's context
148
+ *
149
+ * @param array $context
150
+ *
151
+ * @return null|string
152
+ */
153
+ protected function getTransactionName(array $context)
154
+ {
155
+ if (isset($context['transaction_name'])) {
156
+ return $context['transaction_name'];
157
+ }
158
+
159
+ return $this->transactionName;
160
+ }
161
+
162
+ /**
163
+ * Sets the NewRelic application that should receive this log.
164
+ *
165
+ * @param string $appName
166
+ */
167
+ protected function setNewRelicAppName($appName)
168
+ {
169
+ newrelic_set_appname($appName);
170
+ }
171
+
172
+ /**
173
+ * Overwrites the name of the current transaction
174
+ *
175
+ * @param string $transactionName
176
+ */
177
+ protected function setNewRelicTransactionName($transactionName)
178
+ {
179
+ newrelic_name_transaction($transactionName);
180
+ }
181
+
182
+ /**
183
+ * @param string $key
184
+ * @param mixed $value
185
+ */
186
+ protected function setNewRelicParameter($key, $value)
187
+ {
188
+ if (null === $value || is_scalar($value)) {
189
+ newrelic_add_custom_parameter($key, $value);
190
+ } else {
191
+ newrelic_add_custom_parameter($key, @json_encode($value));
192
+ }
193
+ }
194
+
195
+ /**
196
+ * {@inheritDoc}
197
+ */
198
+ protected function getDefaultFormatter()
199
+ {
200
+ return new NormalizerFormatter();
201
+ }
202
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Blackhole
18
+ *
19
+ * Any record it can handle will be thrown away. This can be used
20
+ * to put on top of an existing stack to override it temporarily.
21
+ *
22
+ * @author Jordi Boggiano <j.boggiano@seld.be>
23
+ */
24
+ class NullHandler extends AbstractHandler
25
+ {
26
+ /**
27
+ * @param int $level The minimum logging level at which this handler will be triggered
28
+ */
29
+ public function __construct($level = Logger::DEBUG)
30
+ {
31
+ parent::__construct($level, false);
32
+ }
33
+
34
+ /**
35
+ * {@inheritdoc}
36
+ */
37
+ public function handle(array $record)
38
+ {
39
+ if ($record['level'] < $this->level) {
40
+ return false;
41
+ }
42
+
43
+ return true;
44
+ }
45
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/PHPConsoleHandler.php ADDED
@@ -0,0 +1,242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Exception;
15
+ use Monolog\Formatter\LineFormatter;
16
+ use Monolog\Logger;
17
+ use PhpConsole\Connector;
18
+ use PhpConsole\Handler;
19
+ use PhpConsole\Helper;
20
+
21
+ /**
22
+ * Monolog handler for Google Chrome extension "PHP Console"
23
+ *
24
+ * Display PHP error/debug log messages in Google Chrome console and notification popups, executes PHP code remotely
25
+ *
26
+ * Usage:
27
+ * 1. Install Google Chrome extension https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef
28
+ * 2. See overview https://github.com/barbushin/php-console#overview
29
+ * 3. Install PHP Console library https://github.com/barbushin/php-console#installation
30
+ * 4. Example (result will looks like http://i.hizliresim.com/vg3Pz4.png)
31
+ *
32
+ * $logger = new \Monolog\Logger('all', array(new \Monolog\Handler\PHPConsoleHandler()));
33
+ * \Monolog\ErrorHandler::register($logger);
34
+ * echo $undefinedVar;
35
+ * $logger->addDebug('SELECT * FROM users', array('db', 'time' => 0.012));
36
+ * PC::debug($_SERVER); // PHP Console debugger for any type of vars
37
+ *
38
+ * @author Sergey Barbushin https://www.linkedin.com/in/barbushin
39
+ */
40
+ class PHPConsoleHandler extends AbstractProcessingHandler
41
+ {
42
+ private $options = array(
43
+ 'enabled' => true, // bool Is PHP Console server enabled
44
+ 'classesPartialsTraceIgnore' => array('Monolog\\'), // array Hide calls of classes started with...
45
+ 'debugTagsKeysInContext' => array(0, 'tag'), // bool Is PHP Console server enabled
46
+ 'useOwnErrorsHandler' => false, // bool Enable errors handling
47
+ 'useOwnExceptionsHandler' => false, // bool Enable exceptions handling
48
+ 'sourcesBasePath' => null, // string Base path of all project sources to strip in errors source paths
49
+ 'registerHelper' => true, // bool Register PhpConsole\Helper that allows short debug calls like PC::debug($var, 'ta.g.s')
50
+ 'serverEncoding' => null, // string|null Server internal encoding
51
+ 'headersLimit' => null, // int|null Set headers size limit for your web-server
52
+ 'password' => null, // string|null Protect PHP Console connection by password
53
+ 'enableSslOnlyMode' => false, // bool Force connection by SSL for clients with PHP Console installed
54
+ 'ipMasks' => array(), // array Set IP masks of clients that will be allowed to connect to PHP Console: array('192.168.*.*', '127.0.0.1')
55
+ 'enableEvalListener' => false, // bool Enable eval request to be handled by eval dispatcher(if enabled, 'password' option is also required)
56
+ 'dumperDetectCallbacks' => false, // bool Convert callback items in dumper vars to (callback SomeClass::someMethod) strings
57
+ 'dumperLevelLimit' => 5, // int Maximum dumped vars array or object nested dump level
58
+ 'dumperItemsCountLimit' => 100, // int Maximum dumped var same level array items or object properties number
59
+ 'dumperItemSizeLimit' => 5000, // int Maximum length of any string or dumped array item
60
+ 'dumperDumpSizeLimit' => 500000, // int Maximum approximate size of dumped vars result formatted in JSON
61
+ 'detectDumpTraceAndSource' => false, // bool Autodetect and append trace data to debug
62
+ 'dataStorage' => null, // PhpConsole\Storage|null Fixes problem with custom $_SESSION handler(see http://goo.gl/Ne8juJ)
63
+ );
64
+
65
+ /** @var Connector */
66
+ private $connector;
67
+
68
+ /**
69
+ * @param array $options See \Monolog\Handler\PHPConsoleHandler::$options for more details
70
+ * @param Connector|null $connector Instance of \PhpConsole\Connector class (optional)
71
+ * @param int $level
72
+ * @param bool $bubble
73
+ * @throws Exception
74
+ */
75
+ public function __construct(array $options = array(), Connector $connector = null, $level = Logger::DEBUG, $bubble = true)
76
+ {
77
+ if (!class_exists('PhpConsole\Connector')) {
78
+ throw new Exception('PHP Console library not found. See https://github.com/barbushin/php-console#installation');
79
+ }
80
+ parent::__construct($level, $bubble);
81
+ $this->options = $this->initOptions($options);
82
+ $this->connector = $this->initConnector($connector);
83
+ }
84
+
85
+ private function initOptions(array $options)
86
+ {
87
+ $wrongOptions = array_diff(array_keys($options), array_keys($this->options));
88
+ if ($wrongOptions) {
89
+ throw new Exception('Unknown options: ' . implode(', ', $wrongOptions));
90
+ }
91
+
92
+ return array_replace($this->options, $options);
93
+ }
94
+
95
+ private function initConnector(Connector $connector = null)
96
+ {
97
+ if (!$connector) {
98
+ if ($this->options['dataStorage']) {
99
+ Connector::setPostponeStorage($this->options['dataStorage']);
100
+ }
101
+ $connector = Connector::getInstance();
102
+ }
103
+
104
+ if ($this->options['registerHelper'] && !Helper::isRegistered()) {
105
+ Helper::register();
106
+ }
107
+
108
+ if ($this->options['enabled'] && $connector->isActiveClient()) {
109
+ if ($this->options['useOwnErrorsHandler'] || $this->options['useOwnExceptionsHandler']) {
110
+ $handler = Handler::getInstance();
111
+ $handler->setHandleErrors($this->options['useOwnErrorsHandler']);
112
+ $handler->setHandleExceptions($this->options['useOwnExceptionsHandler']);
113
+ $handler->start();
114
+ }
115
+ if ($this->options['sourcesBasePath']) {
116
+ $connector->setSourcesBasePath($this->options['sourcesBasePath']);
117
+ }
118
+ if ($this->options['serverEncoding']) {
119
+ $connector->setServerEncoding($this->options['serverEncoding']);
120
+ }
121
+ if ($this->options['password']) {
122
+ $connector->setPassword($this->options['password']);
123
+ }
124
+ if ($this->options['enableSslOnlyMode']) {
125
+ $connector->enableSslOnlyMode();
126
+ }
127
+ if ($this->options['ipMasks']) {
128
+ $connector->setAllowedIpMasks($this->options['ipMasks']);
129
+ }
130
+ if ($this->options['headersLimit']) {
131
+ $connector->setHeadersLimit($this->options['headersLimit']);
132
+ }
133
+ if ($this->options['detectDumpTraceAndSource']) {
134
+ $connector->getDebugDispatcher()->detectTraceAndSource = true;
135
+ }
136
+ $dumper = $connector->getDumper();
137
+ $dumper->levelLimit = $this->options['dumperLevelLimit'];
138
+ $dumper->itemsCountLimit = $this->options['dumperItemsCountLimit'];
139
+ $dumper->itemSizeLimit = $this->options['dumperItemSizeLimit'];
140
+ $dumper->dumpSizeLimit = $this->options['dumperDumpSizeLimit'];
141
+ $dumper->detectCallbacks = $this->options['dumperDetectCallbacks'];
142
+ if ($this->options['enableEvalListener']) {
143
+ $connector->startEvalRequestsListener();
144
+ }
145
+ }
146
+
147
+ return $connector;
148
+ }
149
+
150
+ public function getConnector()
151
+ {
152
+ return $this->connector;
153
+ }
154
+
155
+ public function getOptions()
156
+ {
157
+ return $this->options;
158
+ }
159
+
160
+ public function handle(array $record)
161
+ {
162
+ if ($this->options['enabled'] && $this->connector->isActiveClient()) {
163
+ return parent::handle($record);
164
+ }
165
+
166
+ return !$this->bubble;
167
+ }
168
+
169
+ /**
170
+ * Writes the record down to the log of the implementing handler
171
+ *
172
+ * @param array $record
173
+ * @return void
174
+ */
175
+ protected function write(array $record)
176
+ {
177
+ if ($record['level'] < Logger::NOTICE) {
178
+ $this->handleDebugRecord($record);
179
+ } elseif (isset($record['context']['exception']) && $record['context']['exception'] instanceof Exception) {
180
+ $this->handleExceptionRecord($record);
181
+ } else {
182
+ $this->handleErrorRecord($record);
183
+ }
184
+ }
185
+
186
+ private function handleDebugRecord(array $record)
187
+ {
188
+ $tags = $this->getRecordTags($record);
189
+ $message = $record['message'];
190
+ if ($record['context']) {
191
+ $message .= ' ' . json_encode($this->connector->getDumper()->dump(array_filter($record['context'])));
192
+ }
193
+ $this->connector->getDebugDispatcher()->dispatchDebug($message, $tags, $this->options['classesPartialsTraceIgnore']);
194
+ }
195
+
196
+ private function handleExceptionRecord(array $record)
197
+ {
198
+ $this->connector->getErrorsDispatcher()->dispatchException($record['context']['exception']);
199
+ }
200
+
201
+ private function handleErrorRecord(array $record)
202
+ {
203
+ $context = $record['context'];
204
+
205
+ $this->connector->getErrorsDispatcher()->dispatchError(
206
+ isset($context['code']) ? $context['code'] : null,
207
+ isset($context['message']) ? $context['message'] : $record['message'],
208
+ isset($context['file']) ? $context['file'] : null,
209
+ isset($context['line']) ? $context['line'] : null,
210
+ $this->options['classesPartialsTraceIgnore']
211
+ );
212
+ }
213
+
214
+ private function getRecordTags(array &$record)
215
+ {
216
+ $tags = null;
217
+ if (!empty($record['context'])) {
218
+ $context = & $record['context'];
219
+ foreach ($this->options['debugTagsKeysInContext'] as $key) {
220
+ if (!empty($context[$key])) {
221
+ $tags = $context[$key];
222
+ if ($key === 0) {
223
+ array_shift($context);
224
+ } else {
225
+ unset($context[$key]);
226
+ }
227
+ break;
228
+ }
229
+ }
230
+ }
231
+
232
+ return $tags ?: strtolower($record['level_name']);
233
+ }
234
+
235
+ /**
236
+ * {@inheritDoc}
237
+ */
238
+ protected function getDefaultFormatter()
239
+ {
240
+ return new LineFormatter('%message%');
241
+ }
242
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/PsrHandler.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+ use Psr\Log\LoggerInterface;
16
+
17
+ /**
18
+ * Proxies log messages to an existing PSR-3 compliant logger.
19
+ *
20
+ * @author Michael Moussa <michael.moussa@gmail.com>
21
+ */
22
+ class PsrHandler extends AbstractHandler
23
+ {
24
+ /**
25
+ * PSR-3 compliant logger
26
+ *
27
+ * @var LoggerInterface
28
+ */
29
+ protected $logger;
30
+
31
+ /**
32
+ * @param LoggerInterface $logger The underlying PSR-3 compliant logger to which messages will be proxied
33
+ * @param int $level The minimum logging level at which this handler will be triggered
34
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
35
+ */
36
+ public function __construct(LoggerInterface $logger, $level = Logger::DEBUG, $bubble = true)
37
+ {
38
+ parent::__construct($level, $bubble);
39
+
40
+ $this->logger = $logger;
41
+ }
42
+
43
+ /**
44
+ * {@inheritDoc}
45
+ */
46
+ public function handle(array $record)
47
+ {
48
+ if (!$this->isHandling($record)) {
49
+ return false;
50
+ }
51
+
52
+ $this->logger->log(strtolower($record['level_name']), $record['message'], $record['context']);
53
+
54
+ return false === $this->bubble;
55
+ }
56
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/PushoverHandler.php ADDED
@@ -0,0 +1,185 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Sends notifications through the pushover api to mobile phones
18
+ *
19
+ * @author Sebastian Göttschkes <sebastian.goettschkes@googlemail.com>
20
+ * @see https://www.pushover.net/api
21
+ */
22
+ class PushoverHandler extends SocketHandler
23
+ {
24
+ private $token;
25
+ private $users;
26
+ private $title;
27
+ private $user;
28
+ private $retry;
29
+ private $expire;
30
+
31
+ private $highPriorityLevel;
32
+ private $emergencyLevel;
33
+ private $useFormattedMessage = false;
34
+
35
+ /**
36
+ * All parameters that can be sent to Pushover
37
+ * @see https://pushover.net/api
38
+ * @var array
39
+ */
40
+ private $parameterNames = array(
41
+ 'token' => true,
42
+ 'user' => true,
43
+ 'message' => true,
44
+ 'device' => true,
45
+ 'title' => true,
46
+ 'url' => true,
47
+ 'url_title' => true,
48
+ 'priority' => true,
49
+ 'timestamp' => true,
50
+ 'sound' => true,
51
+ 'retry' => true,
52
+ 'expire' => true,
53
+ 'callback' => true,
54
+ );
55
+
56
+ /**
57
+ * Sounds the api supports by default
58
+ * @see https://pushover.net/api#sounds
59
+ * @var array
60
+ */
61
+ private $sounds = array(
62
+ 'pushover', 'bike', 'bugle', 'cashregister', 'classical', 'cosmic', 'falling', 'gamelan', 'incoming',
63
+ 'intermission', 'magic', 'mechanical', 'pianobar', 'siren', 'spacealarm', 'tugboat', 'alien', 'climb',
64
+ 'persistent', 'echo', 'updown', 'none',
65
+ );
66
+
67
+ /**
68
+ * @param string $token Pushover api token
69
+ * @param string|array $users Pushover user id or array of ids the message will be sent to
70
+ * @param string $title Title sent to the Pushover API
71
+ * @param int $level The minimum logging level at which this handler will be triggered
72
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
73
+ * @param Boolean $useSSL Whether to connect via SSL. Required when pushing messages to users that are not
74
+ * the pushover.net app owner. OpenSSL is required for this option.
75
+ * @param int $highPriorityLevel The minimum logging level at which this handler will start
76
+ * sending "high priority" requests to the Pushover API
77
+ * @param int $emergencyLevel The minimum logging level at which this handler will start
78
+ * sending "emergency" requests to the Pushover API
79
+ * @param int $retry The retry parameter specifies how often (in seconds) the Pushover servers will send the same notification to the user.
80
+ * @param int $expire The expire parameter specifies how many seconds your notification will continue to be retried for (every retry seconds).
81
+ */
82
+ public function __construct($token, $users, $title = null, $level = Logger::CRITICAL, $bubble = true, $useSSL = true, $highPriorityLevel = Logger::CRITICAL, $emergencyLevel = Logger::EMERGENCY, $retry = 30, $expire = 25200)
83
+ {
84
+ $connectionString = $useSSL ? 'ssl://api.pushover.net:443' : 'api.pushover.net:80';
85
+ parent::__construct($connectionString, $level, $bubble);
86
+
87
+ $this->token = $token;
88
+ $this->users = (array) $users;
89
+ $this->title = $title ?: gethostname();
90
+ $this->highPriorityLevel = Logger::toMonologLevel($highPriorityLevel);
91
+ $this->emergencyLevel = Logger::toMonologLevel($emergencyLevel);
92
+ $this->retry = $retry;
93
+ $this->expire = $expire;
94
+ }
95
+
96
+ protected function generateDataStream($record)
97
+ {
98
+ $content = $this->buildContent($record);
99
+
100
+ return $this->buildHeader($content) . $content;
101
+ }
102
+
103
+ private function buildContent($record)
104
+ {
105
+ // Pushover has a limit of 512 characters on title and message combined.
106
+ $maxMessageLength = 512 - strlen($this->title);
107
+
108
+ $message = ($this->useFormattedMessage) ? $record['formatted'] : $record['message'];
109
+ $message = substr($message, 0, $maxMessageLength);
110
+
111
+ $timestamp = $record['datetime']->getTimestamp();
112
+
113
+ $dataArray = array(
114
+ 'token' => $this->token,
115
+ 'user' => $this->user,
116
+ 'message' => $message,
117
+ 'title' => $this->title,
118
+ 'timestamp' => $timestamp,
119
+ );
120
+
121
+ if (isset($record['level']) && $record['level'] >= $this->emergencyLevel) {
122
+ $dataArray['priority'] = 2;
123
+ $dataArray['retry'] = $this->retry;
124
+ $dataArray['expire'] = $this->expire;
125
+ } elseif (isset($record['level']) && $record['level'] >= $this->highPriorityLevel) {
126
+ $dataArray['priority'] = 1;
127
+ }
128
+
129
+ // First determine the available parameters
130
+ $context = array_intersect_key($record['context'], $this->parameterNames);
131
+ $extra = array_intersect_key($record['extra'], $this->parameterNames);
132
+
133
+ // Least important info should be merged with subsequent info
134
+ $dataArray = array_merge($extra, $context, $dataArray);
135
+
136
+ // Only pass sounds that are supported by the API
137
+ if (isset($dataArray['sound']) && !in_array($dataArray['sound'], $this->sounds)) {
138
+ unset($dataArray['sound']);
139
+ }
140
+
141
+ return http_build_query($dataArray);
142
+ }
143
+
144
+ private function buildHeader($content)
145
+ {
146
+ $header = "POST /1/messages.json HTTP/1.1\r\n";
147
+ $header .= "Host: api.pushover.net\r\n";
148
+ $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
149
+ $header .= "Content-Length: " . strlen($content) . "\r\n";
150
+ $header .= "\r\n";
151
+
152
+ return $header;
153
+ }
154
+
155
+ protected function write(array $record)
156
+ {
157
+ foreach ($this->users as $user) {
158
+ $this->user = $user;
159
+
160
+ parent::write($record);
161
+ $this->closeSocket();
162
+ }
163
+
164
+ $this->user = null;
165
+ }
166
+
167
+ public function setHighPriorityLevel($value)
168
+ {
169
+ $this->highPriorityLevel = $value;
170
+ }
171
+
172
+ public function setEmergencyLevel($value)
173
+ {
174
+ $this->emergencyLevel = $value;
175
+ }
176
+
177
+ /**
178
+ * Use the formatted message?
179
+ * @param bool $value
180
+ */
181
+ public function useFormattedMessage($value)
182
+ {
183
+ $this->useFormattedMessage = (boolean) $value;
184
+ }
185
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/RavenHandler.php ADDED
@@ -0,0 +1,232 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Formatter\LineFormatter;
15
+ use Monolog\Formatter\FormatterInterface;
16
+ use Monolog\Logger;
17
+ use Raven_Client;
18
+
19
+ /**
20
+ * Handler to send messages to a Sentry (https://github.com/getsentry/sentry) server
21
+ * using raven-php (https://github.com/getsentry/raven-php)
22
+ *
23
+ * @author Marc Abramowitz <marc@marc-abramowitz.com>
24
+ */
25
+ class RavenHandler extends AbstractProcessingHandler
26
+ {
27
+ /**
28
+ * Translates Monolog log levels to Raven log levels.
29
+ */
30
+ private $logLevels = array(
31
+ Logger::DEBUG => Raven_Client::DEBUG,
32
+ Logger::INFO => Raven_Client::INFO,
33
+ Logger::NOTICE => Raven_Client::INFO,
34
+ Logger::WARNING => Raven_Client::WARNING,
35
+ Logger::ERROR => Raven_Client::ERROR,
36
+ Logger::CRITICAL => Raven_Client::FATAL,
37
+ Logger::ALERT => Raven_Client::FATAL,
38
+ Logger::EMERGENCY => Raven_Client::FATAL,
39
+ );
40
+
41
+ /**
42
+ * @var string should represent the current version of the calling
43
+ * software. Can be any string (git commit, version number)
44
+ */
45
+ private $release;
46
+
47
+ /**
48
+ * @var Raven_Client the client object that sends the message to the server
49
+ */
50
+ protected $ravenClient;
51
+
52
+ /**
53
+ * @var LineFormatter The formatter to use for the logs generated via handleBatch()
54
+ */
55
+ protected $batchFormatter;
56
+
57
+ /**
58
+ * @param Raven_Client $ravenClient
59
+ * @param int $level The minimum logging level at which this handler will be triggered
60
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
61
+ */
62
+ public function __construct(Raven_Client $ravenClient, $level = Logger::DEBUG, $bubble = true)
63
+ {
64
+ parent::__construct($level, $bubble);
65
+
66
+ $this->ravenClient = $ravenClient;
67
+ }
68
+
69
+ /**
70
+ * {@inheritdoc}
71
+ */
72
+ public function handleBatch(array $records)
73
+ {
74
+ $level = $this->level;
75
+
76
+ // filter records based on their level
77
+ $records = array_filter($records, function ($record) use ($level) {
78
+ return $record['level'] >= $level;
79
+ });
80
+
81
+ if (!$records) {
82
+ return;
83
+ }
84
+
85
+ // the record with the highest severity is the "main" one
86
+ $record = array_reduce($records, function ($highest, $record) {
87
+ if ($record['level'] > $highest['level']) {
88
+ return $record;
89
+ }
90
+
91
+ return $highest;
92
+ });
93
+
94
+ // the other ones are added as a context item
95
+ $logs = array();
96
+ foreach ($records as $r) {
97
+ $logs[] = $this->processRecord($r);
98
+ }
99
+
100
+ if ($logs) {
101
+ $record['context']['logs'] = (string) $this->getBatchFormatter()->formatBatch($logs);
102
+ }
103
+
104
+ $this->handle($record);
105
+ }
106
+
107
+ /**
108
+ * Sets the formatter for the logs generated by handleBatch().
109
+ *
110
+ * @param FormatterInterface $formatter
111
+ */
112
+ public function setBatchFormatter(FormatterInterface $formatter)
113
+ {
114
+ $this->batchFormatter = $formatter;
115
+ }
116
+
117
+ /**
118
+ * Gets the formatter for the logs generated by handleBatch().
119
+ *
120
+ * @return FormatterInterface
121
+ */
122
+ public function getBatchFormatter()
123
+ {
124
+ if (!$this->batchFormatter) {
125
+ $this->batchFormatter = $this->getDefaultBatchFormatter();
126
+ }
127
+
128
+ return $this->batchFormatter;
129
+ }
130
+
131
+ /**
132
+ * {@inheritdoc}
133
+ */
134
+ protected function write(array $record)
135
+ {
136
+ $previousUserContext = false;
137
+ $options = array();
138
+ $options['level'] = $this->logLevels[$record['level']];
139
+ $options['tags'] = array();
140
+ if (!empty($record['extra']['tags'])) {
141
+ $options['tags'] = array_merge($options['tags'], $record['extra']['tags']);
142
+ unset($record['extra']['tags']);
143
+ }
144
+ if (!empty($record['context']['tags'])) {
145
+ $options['tags'] = array_merge($options['tags'], $record['context']['tags']);
146
+ unset($record['context']['tags']);
147
+ }
148
+ if (!empty($record['context']['fingerprint'])) {
149
+ $options['fingerprint'] = $record['context']['fingerprint'];
150
+ unset($record['context']['fingerprint']);
151
+ }
152
+ if (!empty($record['context']['logger'])) {
153
+ $options['logger'] = $record['context']['logger'];
154
+ unset($record['context']['logger']);
155
+ } else {
156
+ $options['logger'] = $record['channel'];
157
+ }
158
+ foreach ($this->getExtraParameters() as $key) {
159
+ foreach (array('extra', 'context') as $source) {
160
+ if (!empty($record[$source][$key])) {
161
+ $options[$key] = $record[$source][$key];
162
+ unset($record[$source][$key]);
163
+ }
164
+ }
165
+ }
166
+ if (!empty($record['context'])) {
167
+ $options['extra']['context'] = $record['context'];
168
+ if (!empty($record['context']['user'])) {
169
+ $previousUserContext = $this->ravenClient->context->user;
170
+ $this->ravenClient->user_context($record['context']['user']);
171
+ unset($options['extra']['context']['user']);
172
+ }
173
+ }
174
+ if (!empty($record['extra'])) {
175
+ $options['extra']['extra'] = $record['extra'];
176
+ }
177
+
178
+ if (!empty($this->release) && !isset($options['release'])) {
179
+ $options['release'] = $this->release;
180
+ }
181
+
182
+ if (isset($record['context']['exception']) && ($record['context']['exception'] instanceof \Exception || (PHP_VERSION_ID >= 70000 && $record['context']['exception'] instanceof \Throwable))) {
183
+ $options['extra']['message'] = $record['formatted'];
184
+ $this->ravenClient->captureException($record['context']['exception'], $options);
185
+ } else {
186
+ $this->ravenClient->captureMessage($record['formatted'], array(), $options);
187
+ }
188
+
189
+ if ($previousUserContext !== false) {
190
+ $this->ravenClient->user_context($previousUserContext);
191
+ }
192
+ }
193
+
194
+ /**
195
+ * {@inheritDoc}
196
+ */
197
+ protected function getDefaultFormatter()
198
+ {
199
+ return new LineFormatter('[%channel%] %message%');
200
+ }
201
+
202
+ /**
203
+ * Gets the default formatter for the logs generated by handleBatch().
204
+ *
205
+ * @return FormatterInterface
206
+ */
207
+ protected function getDefaultBatchFormatter()
208
+ {
209
+ return new LineFormatter();
210
+ }
211
+
212
+ /**
213
+ * Gets extra parameters supported by Raven that can be found in "extra" and "context"
214
+ *
215
+ * @return array
216
+ */
217
+ protected function getExtraParameters()
218
+ {
219
+ return array('checksum', 'release', 'event_id');
220
+ }
221
+
222
+ /**
223
+ * @param string $value
224
+ * @return self
225
+ */
226
+ public function setRelease($value)
227
+ {
228
+ $this->release = $value;
229
+
230
+ return $this;
231
+ }
232
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/RedisHandler.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Formatter\LineFormatter;
15
+ use Monolog\Logger;
16
+
17
+ /**
18
+ * Logs to a Redis key using rpush
19
+ *
20
+ * usage example:
21
+ *
22
+ * $log = new Logger('application');
23
+ * $redis = new RedisHandler(new Predis\Client("tcp://localhost:6379"), "logs", "prod");
24
+ * $log->pushHandler($redis);
25
+ *
26
+ * @author Thomas Tourlourat <thomas@tourlourat.com>
27
+ */
28
+ class RedisHandler extends AbstractProcessingHandler
29
+ {
30
+ private $redisClient;
31
+ private $redisKey;
32
+ protected $capSize;
33
+
34
+ /**
35
+ * @param \Predis\Client|\Redis $redis The redis instance
36
+ * @param string $key The key name to push records to
37
+ * @param int $level The minimum logging level at which this handler will be triggered
38
+ * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
39
+ * @param int $capSize Number of entries to limit list size to
40
+ */
41
+ public function __construct($redis, $key, $level = Logger::DEBUG, $bubble = true, $capSize = false)
42
+ {
43
+ if (!(($redis instanceof \Predis\Client) || ($redis instanceof \Redis))) {
44
+ throw new \InvalidArgumentException('Predis\Client or Redis instance required');
45
+ }
46
+
47
+ $this->redisClient = $redis;
48
+ $this->redisKey = $key;
49
+ $this->capSize = $capSize;
50
+
51
+ parent::__construct($level, $bubble);
52
+ }
53
+
54
+ /**
55
+ * {@inheritDoc}
56
+ */
57
+ protected function write(array $record)
58
+ {
59
+ if ($this->capSize) {
60
+ $this->writeCapped($record);
61
+ } else {
62
+ $this->redisClient->rpush($this->redisKey, $record["formatted"]);
63
+ }
64
+ }
65
+
66
+ /**
67
+ * Write and cap the collection
68
+ * Writes the record to the redis list and caps its
69
+ *
70
+ * @param array $record associative record array
71
+ * @return void
72
+ */
73
+ protected function writeCapped(array $record)
74
+ {
75
+ if ($this->redisClient instanceof \Redis) {
76
+ $this->redisClient->multi()
77
+ ->rpush($this->redisKey, $record["formatted"])
78
+ ->ltrim($this->redisKey, -$this->capSize, -1)
79
+ ->exec();
80
+ } else {
81
+ $redisKey = $this->redisKey;
82
+ $capSize = $this->capSize;
83
+ $this->redisClient->transaction(function ($tx) use ($record, $redisKey, $capSize) {
84
+ $tx->rpush($redisKey, $record["formatted"]);
85
+ $tx->ltrim($redisKey, -$capSize, -1);
86
+ });
87
+ }
88
+ }
89
+
90
+ /**
91
+ * {@inheritDoc}
92
+ */
93
+ protected function getDefaultFormatter()
94
+ {
95
+ return new LineFormatter();
96
+ }
97
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use RollbarNotifier;
15
+ use Exception;
16
+ use Monolog\Logger;
17
+
18
+ /**
19
+ * Sends errors to Rollbar
20
+ *
21
+ * If the context data contains a `payload` key, that is used as an array
22
+ * of payload options to RollbarNotifier's report_message/report_exception methods.
23
+ *
24
+ * Rollbar's context info will contain the context + extra keys from the log record
25
+ * merged, and then on top of that a few keys:
26
+ *
27
+ * - level (rollbar level name)
28
+ * - monolog_level (monolog level name, raw level, as rollbar only has 5 but monolog 8)
29
+ * - channel
30
+ * - datetime (unix timestamp)
31
+ *
32
+ * @author Paul Statezny <paulstatezny@gmail.com>
33
+ */
34
+ class RollbarHandler extends AbstractProcessingHandler
35
+ {
36
+ /**
37
+ * Rollbar notifier
38
+ *
39
+ * @var RollbarNotifier
40
+ */
41
+ protected $rollbarNotifier;
42
+
43
+ protected $levelMap = array(
44
+ Logger::DEBUG => 'debug',
45
+ Logger::INFO => 'info',
46
+ Logger::NOTICE => 'info',
47
+ Logger::WARNING => 'warning',
48
+ Logger::ERROR => 'error',
49
+ Logger::CRITICAL => 'critical',
50
+ Logger::ALERT => 'critical',
51
+ Logger::EMERGENCY => 'critical',
52
+ );
53
+
54
+ /**
55
+ * Records whether any log records have been added since the last flush of the rollbar notifier
56
+ *
57
+ * @var bool
58
+ */
59
+ private $hasRecords = false;
60
+
61
+ protected $initialized = false;
62
+
63
+ /**
64
+ * @param RollbarNotifier $rollbarNotifier RollbarNotifier object constructed with valid token
65
+ * @param int $level The minimum logging level at which this handler will be triggered
66
+ * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
67
+ */
68
+ public function __construct(RollbarNotifier $rollbarNotifier, $level = Logger::ERROR, $bubble = true)
69
+ {
70
+ $this->rollbarNotifier = $rollbarNotifier;
71
+
72
+ parent::__construct($level, $bubble);
73
+ }
74
+
75
+ /**
76
+ * {@inheritdoc}
77
+ */
78
+ protected function write(array $record)
79
+ {
80
+ if (!$this->initialized) {
81
+ // __destructor() doesn't get called on Fatal errors
82
+ register_shutdown_function(array($this, 'close'));
83
+ $this->initialized = true;
84
+ }
85
+
86
+ $context = $record['context'];
87
+ $payload = array();
88
+ if (isset($context['payload'])) {
89
+ $payload = $context['payload'];
90
+ unset($context['payload']);
91
+ }
92
+ $context = array_merge($context, $record['extra'], array(
93
+ 'level' => $this->levelMap[$record['level']],
94
+ 'monolog_level' => $record['level_name'],
95
+ 'channel' => $record['channel'],
96
+ 'datetime' => $record['datetime']->format('U'),
97
+ ));
98
+
99
+ if (isset($context['exception']) && $context['exception'] instanceof Exception) {
100
+ $payload['level'] = $context['level'];
101
+ $exception = $context['exception'];
102
+ unset($context['exception']);
103
+
104
+ $this->rollbarNotifier->report_exception($exception, $context, $payload);
105
+ } else {
106
+ $this->rollbarNotifier->report_message(
107
+ $record['message'],
108
+ $context['level'],
109
+ $context,
110
+ $payload
111
+ );
112
+ }
113
+
114
+ $this->hasRecords = true;
115
+ }
116
+
117
+ public function flush()
118
+ {
119
+ if ($this->hasRecords) {
120
+ $this->rollbarNotifier->flush();
121
+ $this->hasRecords = false;
122
+ }
123
+ }
124
+
125
+ /**
126
+ * {@inheritdoc}
127
+ */
128
+ public function close()
129
+ {
130
+ $this->flush();
131
+ }
132
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/RotatingFileHandler.php ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Stores logs to files that are rotated every day and a limited number of files are kept.
18
+ *
19
+ * This rotation is only intended to be used as a workaround. Using logrotate to
20
+ * handle the rotation is strongly encouraged when you can use it.
21
+ *
22
+ * @author Christophe Coevoet <stof@notk.org>
23
+ * @author Jordi Boggiano <j.boggiano@seld.be>
24
+ */
25
+ class RotatingFileHandler extends StreamHandler
26
+ {
27
+ const FILE_PER_DAY = 'Y-m-d';
28
+ const FILE_PER_MONTH = 'Y-m';
29
+ const FILE_PER_YEAR = 'Y';
30
+
31
+ protected $filename;
32
+ protected $maxFiles;
33
+ protected $mustRotate;
34
+ protected $nextRotation;
35
+ protected $filenameFormat;
36
+ protected $dateFormat;
37
+
38
+ /**
39
+ * @param string $filename
40
+ * @param int $maxFiles The maximal amount of files to keep (0 means unlimited)
41
+ * @param int $level The minimum logging level at which this handler will be triggered
42
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
43
+ * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write)
44
+ * @param Boolean $useLocking Try to lock log file before doing any writes
45
+ */
46
+ public function __construct($filename, $maxFiles = 0, $level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false)
47
+ {
48
+ $this->filename = $filename;
49
+ $this->maxFiles = (int) $maxFiles;
50
+ $this->nextRotation = new \DateTime('tomorrow');
51
+ $this->filenameFormat = '{filename}-{date}';
52
+ $this->dateFormat = 'Y-m-d';
53
+
54
+ parent::__construct($this->getTimedFilename(), $level, $bubble, $filePermission, $useLocking);
55
+ }
56
+
57
+ /**
58
+ * {@inheritdoc}
59
+ */
60
+ public function close()
61
+ {
62
+ parent::close();
63
+
64
+ if (true === $this->mustRotate) {
65
+ $this->rotate();
66
+ }
67
+ }
68
+
69
+ public function setFilenameFormat($filenameFormat, $dateFormat)
70
+ {
71
+ if (!preg_match('{^Y(([/_.-]?m)([/_.-]?d)?)?$}', $dateFormat)) {
72
+ trigger_error(
73
+ 'Invalid date format - format must be one of '.
74
+ 'RotatingFileHandler::FILE_PER_DAY ("Y-m-d"), RotatingFileHandler::FILE_PER_MONTH ("Y-m") '.
75
+ 'or RotatingFileHandler::FILE_PER_YEAR ("Y"), or you can set one of the '.
76
+ 'date formats using slashes, underscores and/or dots instead of dashes.',
77
+ E_USER_DEPRECATED
78
+ );
79
+ }
80
+ if (substr_count($filenameFormat, '{date}') === 0) {
81
+ trigger_error(
82
+ 'Invalid filename format - format should contain at least `{date}`, because otherwise rotating is impossible.',
83
+ E_USER_DEPRECATED
84
+ );
85
+ }
86
+ $this->filenameFormat = $filenameFormat;
87
+ $this->dateFormat = $dateFormat;
88
+ $this->url = $this->getTimedFilename();
89
+ $this->close();
90
+ }
91
+
92
+ /**
93
+ * {@inheritdoc}
94
+ */
95
+ protected function write(array $record)
96
+ {
97
+ // on the first record written, if the log is new, we should rotate (once per day)
98
+ if (null === $this->mustRotate) {
99
+ $this->mustRotate = !file_exists($this->url);
100
+ }
101
+
102
+ if ($this->nextRotation < $record['datetime']) {
103
+ $this->mustRotate = true;
104
+ $this->close();
105
+ }
106
+
107
+ parent::write($record);
108
+ }
109
+
110
+ /**
111
+ * Rotates the files.
112
+ */
113
+ protected function rotate()
114
+ {
115
+ // update filename
116
+ $this->url = $this->getTimedFilename();
117
+ $this->nextRotation = new \DateTime('tomorrow');
118
+
119
+ // skip GC of old logs if files are unlimited
120
+ if (0 === $this->maxFiles) {
121
+ return;
122
+ }
123
+
124
+ $logFiles = glob($this->getGlobPattern());
125
+ if ($this->maxFiles >= count($logFiles)) {
126
+ // no files to remove
127
+ return;
128
+ }
129
+
130
+ // Sorting the files by name to remove the older ones
131
+ usort($logFiles, function ($a, $b) {
132
+ return strcmp($b, $a);
133
+ });
134
+
135
+ foreach (array_slice($logFiles, $this->maxFiles) as $file) {
136
+ if (is_writable($file)) {
137
+ // suppress errors here as unlink() might fail if two processes
138
+ // are cleaning up/rotating at the same time
139
+ set_error_handler(function ($errno, $errstr, $errfile, $errline) {});
140
+ unlink($file);
141
+ restore_error_handler();
142
+ }
143
+ }
144
+
145
+ $this->mustRotate = false;
146
+ }
147
+
148
+ protected function getTimedFilename()
149
+ {
150
+ $fileInfo = pathinfo($this->filename);
151
+ $timedFilename = str_replace(
152
+ array('{filename}', '{date}'),
153
+ array($fileInfo['filename'], date($this->dateFormat)),
154
+ $fileInfo['dirname'] . '/' . $this->filenameFormat
155
+ );
156
+
157
+ if (!empty($fileInfo['extension'])) {
158
+ $timedFilename .= '.'.$fileInfo['extension'];
159
+ }
160
+
161
+ return $timedFilename;
162
+ }
163
+
164
+ protected function getGlobPattern()
165
+ {
166
+ $fileInfo = pathinfo($this->filename);
167
+ $glob = str_replace(
168
+ array('{filename}', '{date}'),
169
+ array($fileInfo['filename'], '*'),
170
+ $fileInfo['dirname'] . '/' . $this->filenameFormat
171
+ );
172
+ if (!empty($fileInfo['extension'])) {
173
+ $glob .= '.'.$fileInfo['extension'];
174
+ }
175
+
176
+ return $glob;
177
+ }
178
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/SamplingHandler.php ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ /**
15
+ * Sampling handler
16
+ *
17
+ * A sampled event stream can be useful for logging high frequency events in
18
+ * a production environment where you only need an idea of what is happening
19
+ * and are not concerned with capturing every occurrence. Since the decision to
20
+ * handle or not handle a particular event is determined randomly, the
21
+ * resulting sampled log is not guaranteed to contain 1/N of the events that
22
+ * occurred in the application, but based on the Law of large numbers, it will
23
+ * tend to be close to this ratio with a large number of attempts.
24
+ *
25
+ * @author Bryan Davis <bd808@wikimedia.org>
26
+ * @author Kunal Mehta <legoktm@gmail.com>
27
+ */
28
+ class SamplingHandler extends AbstractHandler
29
+ {
30
+ /**
31
+ * @var callable|HandlerInterface $handler
32
+ */
33
+ protected $handler;
34
+
35
+ /**
36
+ * @var int $factor
37
+ */
38
+ protected $factor;
39
+
40
+ /**
41
+ * @param callable|HandlerInterface $handler Handler or factory callable($record, $fingersCrossedHandler).
42
+ * @param int $factor Sample factor
43
+ */
44
+ public function __construct($handler, $factor)
45
+ {
46
+ parent::__construct();
47
+ $this->handler = $handler;
48
+ $this->factor = $factor;
49
+
50
+ if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) {
51
+ throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object");
52
+ }
53
+ }
54
+
55
+ public function isHandling(array $record)
56
+ {
57
+ return $this->handler->isHandling($record);
58
+ }
59
+
60
+ public function handle(array $record)
61
+ {
62
+ if ($this->isHandling($record) && mt_rand(1, $this->factor) === 1) {
63
+ // The same logic as in FingersCrossedHandler
64
+ if (!$this->handler instanceof HandlerInterface) {
65
+ $this->handler = call_user_func($this->handler, $record, $this);
66
+ if (!$this->handler instanceof HandlerInterface) {
67
+ throw new \RuntimeException("The factory callable should return a HandlerInterface");
68
+ }
69
+ }
70
+
71
+ if ($this->processors) {
72
+ foreach ($this->processors as $processor) {
73
+ $record = call_user_func($processor, $record);
74
+ }
75
+ }
76
+
77
+ $this->handler->handle($record);
78
+ }
79
+
80
+ return false === $this->bubble;
81
+ }
82
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php ADDED
@@ -0,0 +1,294 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler\Slack;
13
+
14
+ use Monolog\Logger;
15
+ use Monolog\Formatter\NormalizerFormatter;
16
+ use Monolog\Formatter\FormatterInterface;
17
+
18
+ /**
19
+ * Slack record utility helping to log to Slack webhooks or API.
20
+ *
21
+ * @author Greg Kedzierski <greg@gregkedzierski.com>
22
+ * @author Haralan Dobrev <hkdobrev@gmail.com>
23
+ * @see https://api.slack.com/incoming-webhooks
24
+ * @see https://api.slack.com/docs/message-attachments
25
+ */
26
+ class SlackRecord
27
+ {
28
+ const COLOR_DANGER = 'danger';
29
+
30
+ const COLOR_WARNING = 'warning';
31
+
32
+ const COLOR_GOOD = 'good';
33
+
34
+ const COLOR_DEFAULT = '#e3e4e6';
35
+
36
+ /**
37
+ * Slack channel (encoded ID or name)
38
+ * @var string|null
39
+ */
40
+ private $channel;
41
+
42
+ /**
43
+ * Name of a bot
44
+ * @var string|null
45
+ */
46
+ private $username;
47
+
48
+ /**
49
+ * User icon e.g. 'ghost', 'http://example.com/user.png'
50
+ * @var string
51
+ */
52
+ private $userIcon;
53
+
54
+ /**
55
+ * Whether the message should be added to Slack as attachment (plain text otherwise)
56
+ * @var bool
57
+ */
58
+ private $useAttachment;
59
+
60
+ /**
61
+ * Whether the the context/extra messages added to Slack as attachments are in a short style
62
+ * @var bool
63
+ */
64
+ private $useShortAttachment;
65
+
66
+ /**
67
+ * Whether the attachment should include context and extra data
68
+ * @var bool
69
+ */
70
+ private $includeContextAndExtra;
71
+
72
+ /**
73
+ * Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2']
74
+ * @var array
75
+ */
76
+ private $excludeFields;
77
+
78
+ /**
79
+ * @var FormatterInterface
80
+ */
81
+ private $formatter;
82
+
83
+ /**
84
+ * @var NormalizerFormatter
85
+ */
86
+ private $normalizerFormatter;
87
+
88
+ public function __construct($channel = null, $username = null, $useAttachment = true, $userIcon = null, $useShortAttachment = false, $includeContextAndExtra = false, array $excludeFields = array(), FormatterInterface $formatter = null)
89
+ {
90
+ $this->channel = $channel;
91
+ $this->username = $username;
92
+ $this->userIcon = trim($userIcon, ':');
93
+ $this->useAttachment = $useAttachment;
94
+ $this->useShortAttachment = $useShortAttachment;
95
+ $this->includeContextAndExtra = $includeContextAndExtra;
96
+ $this->excludeFields = $excludeFields;
97
+ $this->formatter = $formatter;
98
+
99
+ if ($this->includeContextAndExtra) {
100
+ $this->normalizerFormatter = new NormalizerFormatter();
101
+ }
102
+ }
103
+
104
+ public function getSlackData(array $record)
105
+ {
106
+ $dataArray = array();
107
+ $record = $this->excludeFields($record);
108
+
109
+ if ($this->username) {
110
+ $dataArray['username'] = $this->username;
111
+ }
112
+
113
+ if ($this->channel) {
114
+ $dataArray['channel'] = $this->channel;
115
+ }
116
+
117
+ if ($this->formatter && !$this->useAttachment) {
118
+ $message = $this->formatter->format($record);
119
+ } else {
120
+ $message = $record['message'];
121
+ }
122
+
123
+ if ($this->useAttachment) {
124
+ $attachment = array(
125
+ 'fallback' => $message,
126
+ 'text' => $message,
127
+ 'color' => $this->getAttachmentColor($record['level']),
128
+ 'fields' => array(),
129
+ 'mrkdwn_in' => array('fields'),
130
+ 'ts' => $record['datetime']->getTimestamp()
131
+ );
132
+
133
+ if ($this->useShortAttachment) {
134
+ $attachment['title'] = $record['level_name'];
135
+ } else {
136
+ $attachment['title'] = 'Message';
137
+ $attachment['fields'][] = $this->generateAttachmentField('Level', $record['level_name']);
138
+ }
139
+
140
+
141
+ if ($this->includeContextAndExtra) {
142
+ foreach (array('extra', 'context') as $key) {
143
+ if (empty($record[$key])) {
144
+ continue;
145
+ }
146
+
147
+ if ($this->useShortAttachment) {
148
+ $attachment['fields'][] = $this->generateAttachmentField(
149
+ ucfirst($key),
150
+ $record[$key]
151
+ );
152
+ } else {
153
+ // Add all extra fields as individual fields in attachment
154
+ $attachment['fields'] = array_merge(
155
+ $attachment['fields'],
156
+ $this->generateAttachmentFields($record[$key])
157
+ );
158
+ }
159
+ }
160
+ }
161
+
162
+ $dataArray['attachments'] = array($attachment);
163
+ } else {
164
+ $dataArray['text'] = $message;
165
+ }
166
+
167
+ if ($this->userIcon) {
168
+ if (filter_var($this->userIcon, FILTER_VALIDATE_URL)) {
169
+ $dataArray['icon_url'] = $this->userIcon;
170
+ } else {
171
+ $dataArray['icon_emoji'] = ":{$this->userIcon}:";
172
+ }
173
+ }
174
+
175
+ return $dataArray;
176
+ }
177
+
178
+ /**
179
+ * Returned a Slack message attachment color associated with
180
+ * provided level.
181
+ *
182
+ * @param int $level
183
+ * @return string
184
+ */
185
+ public function getAttachmentColor($level)
186
+ {
187
+ switch (true) {
188
+ case $level >= Logger::ERROR:
189
+ return self::COLOR_DANGER;
190
+ case $level >= Logger::WARNING:
191
+ return self::COLOR_WARNING;
192
+ case $level >= Logger::INFO:
193
+ return self::COLOR_GOOD;
194
+ default:
195
+ return self::COLOR_DEFAULT;
196
+ }
197
+ }
198
+
199
+ /**
200
+ * Stringifies an array of key/value pairs to be used in attachment fields
201
+ *
202
+ * @param array $fields
203
+ *
204
+ * @return string
205
+ */
206
+ public function stringify($fields)
207
+ {
208
+ $normalized = $this->normalizerFormatter->format($fields);
209
+ $prettyPrintFlag = defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 128;
210
+
211
+ $hasSecondDimension = count(array_filter($normalized, 'is_array'));
212
+ $hasNonNumericKeys = !count(array_filter(array_keys($normalized), 'is_numeric'));
213
+
214
+ return $hasSecondDimension || $hasNonNumericKeys
215
+ ? json_encode($normalized, $prettyPrintFlag)
216
+ : json_encode($normalized);
217
+ }
218
+
219
+ /**
220
+ * Sets the formatter
221
+ *
222
+ * @param FormatterInterface $formatter
223
+ */
224
+ public function setFormatter(FormatterInterface $formatter)
225
+ {
226
+ $this->formatter = $formatter;
227
+ }
228
+
229
+ /**
230
+ * Generates attachment field
231
+ *
232
+ * @param string $title
233
+ * @param string|array $value\
234
+ *
235
+ * @return array
236
+ */
237
+ private function generateAttachmentField($title, $value)
238
+ {
239
+ $value = is_array($value)
240
+ ? sprintf('```%s```', $this->stringify($value))
241
+ : $value;
242
+
243
+ return array(
244
+ 'title' => $title,
245
+ 'value' => $value,
246
+ 'short' => false
247
+ );
248
+ }
249
+
250
+ /**
251
+ * Generates a collection of attachment fields from array
252
+ *
253
+ * @param array $data
254
+ *
255
+ * @return array
256
+ */
257
+ private function generateAttachmentFields(array $data)
258
+ {
259
+ $fields = array();
260
+ foreach ($data as $key => $value) {
261
+ $fields[] = $this->generateAttachmentField($key, $value);
262
+ }
263
+
264
+ return $fields;
265
+ }
266
+
267
+ /**
268
+ * Get a copy of record with fields excluded according to $this->excludeFields
269
+ *
270
+ * @param array $record
271
+ *
272
+ * @return array
273
+ */
274
+ private function excludeFields(array $record)
275
+ {
276
+ foreach ($this->excludeFields as $field) {
277
+ $keys = explode('.', $field);
278
+ $node = &$record;
279
+ $lastKey = end($keys);
280
+ foreach ($keys as $key) {
281
+ if (!isset($node[$key])) {
282
+ break;
283
+ }
284
+ if ($lastKey === $key) {
285
+ unset($node[$key]);
286
+ break;
287
+ }
288
+ $node = &$node[$key];
289
+ }
290
+ }
291
+
292
+ return $record;
293
+ }
294
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/SlackHandler.php ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Formatter\FormatterInterface;
15
+ use Monolog\Logger;
16
+ use Monolog\Handler\Slack\SlackRecord;
17
+
18
+ /**
19
+ * Sends notifications through Slack API
20
+ *
21
+ * @author Greg Kedzierski <greg@gregkedzierski.com>
22
+ * @see https://api.slack.com/
23
+ */
24
+ class SlackHandler extends SocketHandler
25
+ {
26
+ /**
27
+ * Slack API token
28
+ * @var string
29
+ */
30
+ private $token;
31
+
32
+ /**
33
+ * Instance of the SlackRecord util class preparing data for Slack API.
34
+ * @var SlackRecord
35
+ */
36
+ private $slackRecord;
37
+
38
+ /**
39
+ * @param string $token Slack API token
40
+ * @param string $channel Slack channel (encoded ID or name)
41
+ * @param string|null $username Name of a bot
42
+ * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise)
43
+ * @param string|null $iconEmoji The emoji name to use (or null)
44
+ * @param int $level The minimum logging level at which this handler will be triggered
45
+ * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
46
+ * @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style
47
+ * @param bool $includeContextAndExtra Whether the attachment should include context and extra data
48
+ * @param array $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2']
49
+ * @throws MissingExtensionException If no OpenSSL PHP extension configured
50
+ */
51
+ public function __construct($token, $channel, $username = null, $useAttachment = true, $iconEmoji = null, $level = Logger::CRITICAL, $bubble = true, $useShortAttachment = false, $includeContextAndExtra = false, array $excludeFields = array())
52
+ {
53
+ if (!extension_loaded('openssl')) {
54
+ throw new MissingExtensionException('The OpenSSL PHP extension is required to use the SlackHandler');
55
+ }
56
+
57
+ parent::__construct('ssl://slack.com:443', $level, $bubble);
58
+
59
+ $this->slackRecord = new SlackRecord(
60
+ $channel,
61
+ $username,
62
+ $useAttachment,
63
+ $iconEmoji,
64
+ $useShortAttachment,
65
+ $includeContextAndExtra,
66
+ $excludeFields,
67
+ $this->formatter
68
+ );
69
+
70
+ $this->token = $token;
71
+ }
72
+
73
+ public function getSlackRecord()
74
+ {
75
+ return $this->slackRecord;
76
+ }
77
+
78
+ /**
79
+ * {@inheritdoc}
80
+ *
81
+ * @param array $record
82
+ * @return string
83
+ */
84
+ protected function generateDataStream($record)
85
+ {
86
+ $content = $this->buildContent($record);
87
+
88
+ return $this->buildHeader($content) . $content;
89
+ }
90
+
91
+ /**
92
+ * Builds the body of API call
93
+ *
94
+ * @param array $record
95
+ * @return string
96
+ */
97
+ private function buildContent($record)
98
+ {
99
+ $dataArray = $this->prepareContentData($record);
100
+
101
+ return http_build_query($dataArray);
102
+ }
103
+
104
+ /**
105
+ * Prepares content data
106
+ *
107
+ * @param array $record
108
+ * @return array
109
+ */
110
+ protected function prepareContentData($record)
111
+ {
112
+ $dataArray = $this->slackRecord->getSlackData($record);
113
+ $dataArray['token'] = $this->token;
114
+
115
+ if (!empty($dataArray['attachments'])) {
116
+ $dataArray['attachments'] = json_encode($dataArray['attachments']);
117
+ }
118
+
119
+ return $dataArray;
120
+ }
121
+
122
+ /**
123
+ * Builds the header of the API Call
124
+ *
125
+ * @param string $content
126
+ * @return string
127
+ */
128
+ private function buildHeader($content)
129
+ {
130
+ $header = "POST /api/chat.postMessage HTTP/1.1\r\n";
131
+ $header .= "Host: slack.com\r\n";
132
+ $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
133
+ $header .= "Content-Length: " . strlen($content) . "\r\n";
134
+ $header .= "\r\n";
135
+
136
+ return $header;
137
+ }
138
+
139
+ /**
140
+ * {@inheritdoc}
141
+ *
142
+ * @param array $record
143
+ */
144
+ protected function write(array $record)
145
+ {
146
+ parent::write($record);
147
+ $this->finalizeWrite();
148
+ }
149
+
150
+ /**
151
+ * Finalizes the request by reading some bytes and then closing the socket
152
+ *
153
+ * If we do not read some but close the socket too early, slack sometimes
154
+ * drops the request entirely.
155
+ */
156
+ protected function finalizeWrite()
157
+ {
158
+ $res = $this->getResource();
159
+ if (is_resource($res)) {
160
+ @fread($res, 2048);
161
+ }
162
+ $this->closeSocket();
163
+ }
164
+
165
+ /**
166
+ * Returned a Slack message attachment color associated with
167
+ * provided level.
168
+ *
169
+ * @param int $level
170
+ * @return string
171
+ * @deprecated Use underlying SlackRecord instead
172
+ */
173
+ protected function getAttachmentColor($level)
174
+ {
175
+ trigger_error(
176
+ 'SlackHandler::getAttachmentColor() is deprecated. Use underlying SlackRecord instead.',
177
+ E_USER_DEPRECATED
178
+ );
179
+
180
+ return $this->slackRecord->getAttachmentColor($level);
181
+ }
182
+
183
+ /**
184
+ * Stringifies an array of key/value pairs to be used in attachment fields
185
+ *
186
+ * @param array $fields
187
+ * @return string
188
+ * @deprecated Use underlying SlackRecord instead
189
+ */
190
+ protected function stringify($fields)
191
+ {
192
+ trigger_error(
193
+ 'SlackHandler::stringify() is deprecated. Use underlying SlackRecord instead.',
194
+ E_USER_DEPRECATED
195
+ );
196
+
197
+ return $this->slackRecord->stringify($fields);
198
+ }
199
+
200
+ public function setFormatter(FormatterInterface $formatter)
201
+ {
202
+ parent::setFormatter($formatter);
203
+ $this->slackRecord->setFormatter($formatter);
204
+
205
+ return $this;
206
+ }
207
+
208
+ public function getFormatter()
209
+ {
210
+ $formatter = parent::getFormatter();
211
+ $this->slackRecord->setFormatter($formatter);
212
+
213
+ return $formatter;
214
+ }
215
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/SlackWebhookHandler.php ADDED
@@ -0,0 +1,115 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Formatter\FormatterInterface;
15
+ use Monolog\Logger;
16
+ use Monolog\Handler\Slack\SlackRecord;
17
+
18
+ /**
19
+ * Sends notifications through Slack Webhooks
20
+ *
21
+ * @author Haralan Dobrev <hkdobrev@gmail.com>
22
+ * @see https://api.slack.com/incoming-webhooks
23
+ */
24
+ class SlackWebhookHandler extends AbstractProcessingHandler
25
+ {
26
+ /**
27
+ * Slack Webhook token
28
+ * @var string
29
+ */
30
+ private $webhookUrl;
31
+
32
+ /**
33
+ * Instance of the SlackRecord util class preparing data for Slack API.
34
+ * @var SlackRecord
35
+ */
36
+ private $slackRecord;
37
+
38
+ /**
39
+ * @param string $webhookUrl Slack Webhook URL
40
+ * @param string|null $channel Slack channel (encoded ID or name)
41
+ * @param string|null $username Name of a bot
42
+ * @param bool $useAttachment Whether the message should be added to Slack as attachment (plain text otherwise)
43
+ * @param string|null $iconEmoji The emoji name to use (or null)
44
+ * @param bool $useShortAttachment Whether the the context/extra messages added to Slack as attachments are in a short style
45
+ * @param bool $includeContextAndExtra Whether the attachment should include context and extra data
46
+ * @param int $level The minimum logging level at which this handler will be triggered
47
+ * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
48
+ * @param array $excludeFields Dot separated list of fields to exclude from slack message. E.g. ['context.field1', 'extra.field2']
49
+ */
50
+ public function __construct($webhookUrl, $channel = null, $username = null, $useAttachment = true, $iconEmoji = null, $useShortAttachment = false, $includeContextAndExtra = false, $level = Logger::CRITICAL, $bubble = true, array $excludeFields = array())
51
+ {
52
+ parent::__construct($level, $bubble);
53
+
54
+ $this->webhookUrl = $webhookUrl;
55
+
56
+ $this->slackRecord = new SlackRecord(
57
+ $channel,
58
+ $username,
59
+ $useAttachment,
60
+ $iconEmoji,
61
+ $useShortAttachment,
62
+ $includeContextAndExtra,
63
+ $excludeFields,
64
+ $this->formatter
65
+ );
66
+ }
67
+
68
+ public function getSlackRecord()
69
+ {
70
+ return $this->slackRecord;
71
+ }
72
+
73
+ /**
74
+ * {@inheritdoc}
75
+ *
76
+ * @param array $record
77
+ */
78
+ protected function write(array $record)
79
+ {
80
+ $postData = $this->slackRecord->getSlackData($record);
81
+ $postString = json_encode($postData);
82
+
83
+ $ch = curl_init();
84
+ $options = array(
85
+ CURLOPT_URL => $this->webhookUrl,
86
+ CURLOPT_POST => true,
87
+ CURLOPT_RETURNTRANSFER => true,
88
+ CURLOPT_HTTPHEADER => array('Content-type: application/json'),
89
+ CURLOPT_POSTFIELDS => $postString
90
+ );
91
+ if (defined('CURLOPT_SAFE_UPLOAD')) {
92
+ $options[CURLOPT_SAFE_UPLOAD] = true;
93
+ }
94
+
95
+ curl_setopt_array($ch, $options);
96
+
97
+ Curl\Util::execute($ch);
98
+ }
99
+
100
+ public function setFormatter(FormatterInterface $formatter)
101
+ {
102
+ parent::setFormatter($formatter);
103
+ $this->slackRecord->setFormatter($formatter);
104
+
105
+ return $this;
106
+ }
107
+
108
+ public function getFormatter()
109
+ {
110
+ $formatter = parent::getFormatter();
111
+ $this->slackRecord->setFormatter($formatter);
112
+
113
+ return $formatter;
114
+ }
115
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/SlackbotHandler.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Sends notifications through Slack's Slackbot
18
+ *
19
+ * @author Haralan Dobrev <hkdobrev@gmail.com>
20
+ * @see https://slack.com/apps/A0F81R8ET-slackbot
21
+ */
22
+ class SlackbotHandler extends AbstractProcessingHandler
23
+ {
24
+ /**
25
+ * The slug of the Slack team
26
+ * @var string
27
+ */
28
+ private $slackTeam;
29
+
30
+ /**
31
+ * Slackbot token
32
+ * @var string
33
+ */
34
+ private $token;
35
+
36
+ /**
37
+ * Slack channel name
38
+ * @var string
39
+ */
40
+ private $channel;
41
+
42
+ /**
43
+ * @param string $slackTeam Slack team slug
44
+ * @param string $token Slackbot token
45
+ * @param string $channel Slack channel (encoded ID or name)
46
+ * @param int $level The minimum logging level at which this handler will be triggered
47
+ * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
48
+ */
49
+ public function __construct($slackTeam, $token, $channel, $level = Logger::CRITICAL, $bubble = true)
50
+ {
51
+ parent::__construct($level, $bubble);
52
+
53
+ $this->slackTeam = $slackTeam;
54
+ $this->token = $token;
55
+ $this->channel = $channel;
56
+ }
57
+
58
+ /**
59
+ * {@inheritdoc}
60
+ *
61
+ * @param array $record
62
+ */
63
+ protected function write(array $record)
64
+ {
65
+ $slackbotUrl = sprintf(
66
+ 'https://%s.slack.com/services/hooks/slackbot?token=%s&channel=%s',
67
+ $this->slackTeam,
68
+ $this->token,
69
+ $this->channel
70
+ );
71
+
72
+ $ch = curl_init();
73
+ curl_setopt($ch, CURLOPT_URL, $slackbotUrl);
74
+ curl_setopt($ch, CURLOPT_POST, true);
75
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
76
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $record['message']);
77
+
78
+ Curl\Util::execute($ch);
79
+ }
80
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Stores to any socket - uses fsockopen() or pfsockopen().
18
+ *
19
+ * @author Pablo de Leon Belloc <pablolb@gmail.com>
20
+ * @see http://php.net/manual/en/function.fsockopen.php
21
+ */
22
+ class SocketHandler extends AbstractProcessingHandler
23
+ {
24
+ private $connectionString;
25
+ private $connectionTimeout;
26
+ private $resource;
27
+ private $timeout = 0;
28
+ private $writingTimeout = 10;
29
+ private $lastSentBytes = null;
30
+ private $persistent = false;
31
+ private $errno;
32
+ private $errstr;
33
+ private $lastWritingAt;
34
+
35
+ /**
36
+ * @param string $connectionString Socket connection string
37
+ * @param int $level The minimum logging level at which this handler will be triggered
38
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
39
+ */
40
+ public function __construct($connectionString, $level = Logger::DEBUG, $bubble = true)
41
+ {
42
+ parent::__construct($level, $bubble);
43
+ $this->connectionString = $connectionString;
44
+ $this->connectionTimeout = (float) ini_get('default_socket_timeout');
45
+ }
46
+
47
+ /**
48
+ * Connect (if necessary) and write to the socket
49
+ *
50
+ * @param array $record
51
+ *
52
+ * @throws \UnexpectedValueException
53
+ * @throws \RuntimeException
54
+ */
55
+ protected function write(array $record)
56
+ {
57
+ $this->connectIfNotConnected();
58
+ $data = $this->generateDataStream($record);
59
+ $this->writeToSocket($data);
60
+ }
61
+
62
+ /**
63
+ * We will not close a PersistentSocket instance so it can be reused in other requests.
64
+ */
65
+ public function close()
66
+ {
67
+ if (!$this->isPersistent()) {
68
+ $this->closeSocket();
69
+ }
70
+ }
71
+
72
+ /**
73
+ * Close socket, if open
74
+ */
75
+ public function closeSocket()
76
+ {
77
+ if (is_resource($this->resource)) {
78
+ fclose($this->resource);
79
+ $this->resource = null;
80
+ }
81
+ }
82
+
83
+ /**
84
+ * Set socket connection to nbe persistent. It only has effect before the connection is initiated.
85
+ *
86
+ * @param bool $persistent
87
+ */
88
+ public function setPersistent($persistent)
89
+ {
90
+ $this->persistent = (boolean) $persistent;
91
+ }
92
+
93
+ /**
94
+ * Set connection timeout. Only has effect before we connect.
95
+ *
96
+ * @param float $seconds
97
+ *
98
+ * @see http://php.net/manual/en/function.fsockopen.php
99
+ */
100
+ public function setConnectionTimeout($seconds)
101
+ {
102
+ $this->validateTimeout($seconds);
103
+ $this->connectionTimeout = (float) $seconds;
104
+ }
105
+
106
+ /**
107
+ * Set write timeout. Only has effect before we connect.
108
+ *
109
+ * @param float $seconds
110
+ *
111
+ * @see http://php.net/manual/en/function.stream-set-timeout.php
112
+ */
113
+ public function setTimeout($seconds)
114
+ {
115
+ $this->validateTimeout($seconds);
116
+ $this->timeout = (float) $seconds;
117
+ }
118
+
119
+ /**
120
+ * Set writing timeout. Only has effect during connection in the writing cycle.
121
+ *
122
+ * @param float $seconds 0 for no timeout
123
+ */
124
+ public function setWritingTimeout($seconds)
125
+ {
126
+ $this->validateTimeout($seconds);
127
+ $this->writingTimeout = (float) $seconds;
128
+ }
129
+
130
+ /**
131
+ * Get current connection string
132
+ *
133
+ * @return string
134
+ */
135
+ public function getConnectionString()
136
+ {
137
+ return $this->connectionString;
138
+ }
139
+
140
+ /**
141
+ * Get persistent setting
142
+ *
143
+ * @return bool
144
+ */
145
+ public function isPersistent()
146
+ {
147
+ return $this->persistent;
148
+ }
149
+
150
+ /**
151
+ * Get current connection timeout setting
152
+ *
153
+ * @return float
154
+ */
155
+ public function getConnectionTimeout()
156
+ {
157
+ return $this->connectionTimeout;
158
+ }
159
+
160
+ /**
161
+ * Get current in-transfer timeout
162
+ *
163
+ * @return float
164
+ */
165
+ public function getTimeout()
166
+ {
167
+ return $this->timeout;
168
+ }
169
+
170
+ /**
171
+ * Get current local writing timeout
172
+ *
173
+ * @return float
174
+ */
175
+ public function getWritingTimeout()
176
+ {
177
+ return $this->writingTimeout;
178
+ }
179
+
180
+ /**
181
+ * Check to see if the socket is currently available.
182
+ *
183
+ * UDP might appear to be connected but might fail when writing. See http://php.net/fsockopen for details.
184
+ *
185
+ * @return bool
186
+ */
187
+ public function isConnected()
188
+ {
189
+ return is_resource($this->resource)
190
+ && !feof($this->resource); // on TCP - other party can close connection.
191
+ }
192
+
193
+ /**
194
+ * Wrapper to allow mocking
195
+ */
196
+ protected function pfsockopen()
197
+ {
198
+ return @pfsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout);
199
+ }
200
+
201
+ /**
202
+ * Wrapper to allow mocking
203
+ */
204
+ protected function fsockopen()
205
+ {
206
+ return @fsockopen($this->connectionString, -1, $this->errno, $this->errstr, $this->connectionTimeout);
207
+ }
208
+
209
+ /**
210
+ * Wrapper to allow mocking
211
+ *
212
+ * @see http://php.net/manual/en/function.stream-set-timeout.php
213
+ */
214
+ protected function streamSetTimeout()
215
+ {
216
+ $seconds = floor($this->timeout);
217
+ $microseconds = round(($this->timeout - $seconds) * 1e6);
218
+
219
+ return stream_set_timeout($this->resource, $seconds, $microseconds);
220
+ }
221
+
222
+ /**
223
+ * Wrapper to allow mocking
224
+ */
225
+ protected function fwrite($data)
226
+ {
227
+ return @fwrite($this->resource, $data);
228
+ }
229
+
230
+ /**
231
+ * Wrapper to allow mocking
232
+ */
233
+ protected function streamGetMetadata()
234
+ {
235
+ return stream_get_meta_data($this->resource);
236
+ }
237
+
238
+ private function validateTimeout($value)
239
+ {
240
+ $ok = filter_var($value, FILTER_VALIDATE_FLOAT);
241
+ if ($ok === false || $value < 0) {
242
+ throw new \InvalidArgumentException("Timeout must be 0 or a positive float (got $value)");
243
+ }
244
+ }
245
+
246
+ private function connectIfNotConnected()
247
+ {
248
+ if ($this->isConnected()) {
249
+ return;
250
+ }
251
+ $this->connect();
252
+ }
253
+
254
+ protected function generateDataStream($record)
255
+ {
256
+ return (string) $record['formatted'];
257
+ }
258
+
259
+ /**
260
+ * @return resource|null
261
+ */
262
+ protected function getResource()
263
+ {
264
+ return $this->resource;
265
+ }
266
+
267
+ private function connect()
268
+ {
269
+ $this->createSocketResource();
270
+ $this->setSocketTimeout();
271
+ }
272
+
273
+ private function createSocketResource()
274
+ {
275
+ if ($this->isPersistent()) {
276
+ $resource = $this->pfsockopen();
277
+ } else {
278
+ $resource = $this->fsockopen();
279
+ }
280
+ if (!$resource) {
281
+ throw new \UnexpectedValueException("Failed connecting to $this->connectionString ($this->errno: $this->errstr)");
282
+ }
283
+ $this->resource = $resource;
284
+ }
285
+
286
+ private function setSocketTimeout()
287
+ {
288
+ if (!$this->streamSetTimeout()) {
289
+ throw new \UnexpectedValueException("Failed setting timeout with stream_set_timeout()");
290
+ }
291
+ }
292
+
293
+ private function writeToSocket($data)
294
+ {
295
+ $length = strlen($data);
296
+ $sent = 0;
297
+ $this->lastSentBytes = $sent;
298
+ while ($this->isConnected() && $sent < $length) {
299
+ if (0 == $sent) {
300
+ $chunk = $this->fwrite($data);
301
+ } else {
302
+ $chunk = $this->fwrite(substr($data, $sent));
303
+ }
304
+ if ($chunk === false) {
305
+ throw new \RuntimeException("Could not write to socket");
306
+ }
307
+ $sent += $chunk;
308
+ $socketInfo = $this->streamGetMetadata();
309
+ if ($socketInfo['timed_out']) {
310
+ throw new \RuntimeException("Write timed-out");
311
+ }
312
+
313
+ if ($this->writingIsTimedOut($sent)) {
314
+ throw new \RuntimeException("Write timed-out, no data sent for `{$this->writingTimeout}` seconds, probably we got disconnected (sent $sent of $length)");
315
+ }
316
+ }
317
+ if (!$this->isConnected() && $sent < $length) {
318
+ throw new \RuntimeException("End-of-file reached, probably we got disconnected (sent $sent of $length)");
319
+ }
320
+ }
321
+
322
+ private function writingIsTimedOut($sent)
323
+ {
324
+ $writingTimeout = (int) floor($this->writingTimeout);
325
+ if (0 === $writingTimeout) {
326
+ return false;
327
+ }
328
+
329
+ if ($sent !== $this->lastSentBytes) {
330
+ $this->lastWritingAt = time();
331
+ $this->lastSentBytes = $sent;
332
+
333
+ return false;
334
+ } else {
335
+ usleep(100);
336
+ }
337
+
338
+ if ((time() - $this->lastWritingAt) >= $writingTimeout) {
339
+ $this->closeSocket();
340
+
341
+ return true;
342
+ }
343
+
344
+ return false;
345
+ }
346
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Stores to any stream resource
18
+ *
19
+ * Can be used to store into php://stderr, remote and local files, etc.
20
+ *
21
+ * @author Jordi Boggiano <j.boggiano@seld.be>
22
+ */
23
+ class StreamHandler extends AbstractProcessingHandler
24
+ {
25
+ protected $stream;
26
+ protected $url;
27
+ private $errorMessage;
28
+ protected $filePermission;
29
+ protected $useLocking;
30
+ private $dirCreated;
31
+
32
+ /**
33
+ * @param resource|string $stream
34
+ * @param int $level The minimum logging level at which this handler will be triggered
35
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
36
+ * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write)
37
+ * @param Boolean $useLocking Try to lock log file before doing any writes
38
+ *
39
+ * @throws \Exception If a missing directory is not buildable
40
+ * @throws \InvalidArgumentException If stream is not a resource or string
41
+ */
42
+ public function __construct($stream, $level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false)
43
+ {
44
+ parent::__construct($level, $bubble);
45
+ if (is_resource($stream)) {
46
+ $this->stream = $stream;
47
+ } elseif (is_string($stream)) {
48
+ $this->url = $stream;
49
+ } else {
50
+ throw new \InvalidArgumentException('A stream must either be a resource or a string.');
51
+ }
52
+
53
+ $this->filePermission = $filePermission;
54
+ $this->useLocking = $useLocking;
55
+ }
56
+
57
+ /**
58
+ * {@inheritdoc}
59
+ */
60
+ public function close()
61
+ {
62
+ if ($this->url && is_resource($this->stream)) {
63
+ fclose($this->stream);
64
+ }
65
+ $this->stream = null;
66
+ }
67
+
68
+ /**
69
+ * Return the currently active stream if it is open
70
+ *
71
+ * @return resource|null
72
+ */
73
+ public function getStream()
74
+ {
75
+ return $this->stream;
76
+ }
77
+
78
+ /**
79
+ * Return the stream URL if it was configured with a URL and not an active resource
80
+ *
81
+ * @return string|null
82
+ */
83
+ public function getUrl()
84
+ {
85
+ return $this->url;
86
+ }
87
+
88
+ /**
89
+ * {@inheritdoc}
90
+ */
91
+ protected function write(array $record)
92
+ {
93
+ if (!is_resource($this->stream)) {
94
+ if (null === $this->url || '' === $this->url) {
95
+ throw new \LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().');
96
+ }
97
+ $this->createDir();
98
+ $this->errorMessage = null;
99
+ set_error_handler(array($this, 'customErrorHandler'));
100
+ $this->stream = fopen($this->url, 'a');
101
+ if ($this->filePermission !== null) {
102
+ @chmod($this->url, $this->filePermission);
103
+ }
104
+ restore_error_handler();
105
+ if (!is_resource($this->stream)) {
106
+ $this->stream = null;
107
+ throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened: '.$this->errorMessage, $this->url));
108
+ }
109
+ }
110
+
111
+ if ($this->useLocking) {
112
+ // ignoring errors here, there's not much we can do about them
113
+ flock($this->stream, LOCK_EX);
114
+ }
115
+
116
+ $this->streamWrite($this->stream, $record);
117
+
118
+ if ($this->useLocking) {
119
+ flock($this->stream, LOCK_UN);
120
+ }
121
+ }
122
+
123
+ /**
124
+ * Write to stream
125
+ * @param resource $stream
126
+ * @param array $record
127
+ */
128
+ protected function streamWrite($stream, array $record)
129
+ {
130
+ fwrite($stream, (string) $record['formatted']);
131
+ }
132
+
133
+ private function customErrorHandler($code, $msg)
134
+ {
135
+ $this->errorMessage = preg_replace('{^(fopen|mkdir)\(.*?\): }', '', $msg);
136
+ }
137
+
138
+ /**
139
+ * @param string $stream
140
+ *
141
+ * @return null|string
142
+ */
143
+ private function getDirFromStream($stream)
144
+ {
145
+ $pos = strpos($stream, '://');
146
+ if ($pos === false) {
147
+ return dirname($stream);
148
+ }
149
+
150
+ if ('file://' === substr($stream, 0, 7)) {
151
+ return dirname(substr($stream, 7));
152
+ }
153
+
154
+ return;
155
+ }
156
+
157
+ private function createDir()
158
+ {
159
+ // Do not try to create dir if it has already been tried.
160
+ if ($this->dirCreated) {
161
+ return;
162
+ }
163
+
164
+ $dir = $this->getDirFromStream($this->url);
165
+ if (null !== $dir && !is_dir($dir)) {
166
+ $this->errorMessage = null;
167
+ set_error_handler(array($this, 'customErrorHandler'));
168
+ $status = mkdir($dir, 0777, true);
169
+ restore_error_handler();
170
+ if (false === $status) {
171
+ throw new \UnexpectedValueException(sprintf('There is no existing directory at "%s" and its not buildable: '.$this->errorMessage, $dir));
172
+ }
173
+ }
174
+ $this->dirCreated = true;
175
+ }
176
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/SwiftMailerHandler.php ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+ use Monolog\Formatter\LineFormatter;
16
+ use Swift;
17
+
18
+ /**
19
+ * SwiftMailerHandler uses Swift_Mailer to send the emails
20
+ *
21
+ * @author Gyula Sallai
22
+ */
23
+ class SwiftMailerHandler extends MailHandler
24
+ {
25
+ protected $mailer;
26
+ private $messageTemplate;
27
+
28
+ /**
29
+ * @param \Swift_Mailer $mailer The mailer to use
30
+ * @param callable|\Swift_Message $message An example message for real messages, only the body will be replaced
31
+ * @param int $level The minimum logging level at which this handler will be triggered
32
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
33
+ */
34
+ public function __construct(\Swift_Mailer $mailer, $message, $level = Logger::ERROR, $bubble = true)
35
+ {
36
+ parent::__construct($level, $bubble);
37
+
38
+ $this->mailer = $mailer;
39
+ $this->messageTemplate = $message;
40
+ }
41
+
42
+ /**
43
+ * {@inheritdoc}
44
+ */
45
+ protected function send($content, array $records)
46
+ {
47
+ $this->mailer->send($this->buildMessage($content, $records));
48
+ }
49
+
50
+ /**
51
+ * Creates instance of Swift_Message to be sent
52
+ *
53
+ * @param string $content formatted email body to be sent
54
+ * @param array $records Log records that formed the content
55
+ * @return \Swift_Message
56
+ */
57
+ protected function buildMessage($content, array $records)
58
+ {
59
+ $message = null;
60
+ if ($this->messageTemplate instanceof \Swift_Message) {
61
+ $message = clone $this->messageTemplate;
62
+ $message->generateId();
63
+ } elseif (is_callable($this->messageTemplate)) {
64
+ $message = call_user_func($this->messageTemplate, $content, $records);
65
+ }
66
+
67
+ if (!$message instanceof \Swift_Message) {
68
+ throw new \InvalidArgumentException('Could not resolve message as instance of Swift_Message or a callable returning it');
69
+ }
70
+
71
+ if ($records) {
72
+ $subjectFormatter = new LineFormatter($message->getSubject());
73
+ $message->setSubject($subjectFormatter->format($this->getHighestRecord($records)));
74
+ }
75
+
76
+ $message->setBody($content);
77
+ if (version_compare(Swift::VERSION, '6.0.0', '>=')) {
78
+ $message->setDate(new \DateTimeImmutable());
79
+ } else {
80
+ $message->setDate(time());
81
+ }
82
+
83
+ return $message;
84
+ }
85
+
86
+ /**
87
+ * BC getter, to be removed in 2.0
88
+ */
89
+ public function __get($name)
90
+ {
91
+ if ($name === 'message') {
92
+ trigger_error('SwiftMailerHandler->message is deprecated, use ->buildMessage() instead to retrieve the message', E_USER_DEPRECATED);
93
+
94
+ return $this->buildMessage(null, array());
95
+ }
96
+
97
+ throw new \InvalidArgumentException('Invalid property '.$name);
98
+ }
99
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Logs to syslog service.
18
+ *
19
+ * usage example:
20
+ *
21
+ * $log = new Logger('application');
22
+ * $syslog = new SyslogHandler('myfacility', 'local6');
23
+ * $formatter = new LineFormatter("%channel%.%level_name%: %message% %extra%");
24
+ * $syslog->setFormatter($formatter);
25
+ * $log->pushHandler($syslog);
26
+ *
27
+ * @author Sven Paulus <sven@karlsruhe.org>
28
+ */
29
+ class SyslogHandler extends AbstractSyslogHandler
30
+ {
31
+ protected $ident;
32
+ protected $logopts;
33
+
34
+ /**
35
+ * @param string $ident
36
+ * @param mixed $facility
37
+ * @param int $level The minimum logging level at which this handler will be triggered
38
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
39
+ * @param int $logopts Option flags for the openlog() call, defaults to LOG_PID
40
+ */
41
+ public function __construct($ident, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true, $logopts = LOG_PID)
42
+ {
43
+ parent::__construct($facility, $level, $bubble);
44
+
45
+ $this->ident = $ident;
46
+ $this->logopts = $logopts;
47
+ }
48
+
49
+ /**
50
+ * {@inheritdoc}
51
+ */
52
+ public function close()
53
+ {
54
+ closelog();
55
+ }
56
+
57
+ /**
58
+ * {@inheritdoc}
59
+ */
60
+ protected function write(array $record)
61
+ {
62
+ if (!openlog($this->ident, $this->logopts, $this->facility)) {
63
+ throw new \LogicException('Can\'t open syslog for ident "'.$this->ident.'" and facility "'.$this->facility.'"');
64
+ }
65
+ syslog($this->logLevels[$record['level']], (string) $record['formatted']);
66
+ }
67
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler\SyslogUdp;
13
+
14
+ class UdpSocket
15
+ {
16
+ const DATAGRAM_MAX_LENGTH = 65023;
17
+
18
+ protected $ip;
19
+ protected $port;
20
+ protected $socket;
21
+
22
+ public function __construct($ip, $port = 514)
23
+ {
24
+ $this->ip = $ip;
25
+ $this->port = $port;
26
+ $this->socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
27
+ }
28
+
29
+ public function write($line, $header = "")
30
+ {
31
+ $this->send($this->assembleMessage($line, $header));
32
+ }
33
+
34
+ public function close()
35
+ {
36
+ if (is_resource($this->socket)) {
37
+ socket_close($this->socket);
38
+ $this->socket = null;
39
+ }
40
+ }
41
+
42
+ protected function send($chunk)
43
+ {
44
+ if (!is_resource($this->socket)) {
45
+ throw new \LogicException('The UdpSocket to '.$this->ip.':'.$this->port.' has been closed and can not be written to anymore');
46
+ }
47
+ socket_sendto($this->socket, $chunk, strlen($chunk), $flags = 0, $this->ip, $this->port);
48
+ }
49
+
50
+ protected function assembleMessage($line, $header)
51
+ {
52
+ $chunkSize = self::DATAGRAM_MAX_LENGTH - strlen($header);
53
+
54
+ return $header . substr($line, 0, $chunkSize);
55
+ }
56
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ use Monolog\Logger;
15
+ use Monolog\Handler\SyslogUdp\UdpSocket;
16
+
17
+ /**
18
+ * A Handler for logging to a remote syslogd server.
19
+ *
20
+ * @author Jesper Skovgaard Nielsen <nulpunkt@gmail.com>
21
+ */
22
+ class SyslogUdpHandler extends AbstractSyslogHandler
23
+ {
24
+ protected $socket;
25
+ protected $ident;
26
+
27
+ /**
28
+ * @param string $host
29
+ * @param int $port
30
+ * @param mixed $facility
31
+ * @param int $level The minimum logging level at which this handler will be triggered
32
+ * @param Boolean $bubble Whether the messages that are handled can bubble up the stack or not
33
+ * @param string $ident Program name or tag for each log message.
34
+ */
35
+ public function __construct($host, $port = 514, $facility = LOG_USER, $level = Logger::DEBUG, $bubble = true, $ident = 'php')
36
+ {
37
+ parent::__construct($facility, $level, $bubble);
38
+
39
+ $this->ident = $ident;
40
+
41
+ $this->socket = new UdpSocket($host, $port ?: 514);
42
+ }
43
+
44
+ protected function write(array $record)
45
+ {
46
+ $lines = $this->splitMessageIntoLines($record['formatted']);
47
+
48
+ $header = $this->makeCommonSyslogHeader($this->logLevels[$record['level']]);
49
+
50
+ foreach ($lines as $line) {
51
+ $this->socket->write($line, $header);
52
+ }
53
+ }
54
+
55
+ public function close()
56
+ {
57
+ $this->socket->close();
58
+ }
59
+
60
+ private function splitMessageIntoLines($message)
61
+ {
62
+ if (is_array($message)) {
63
+ $message = implode("\n", $message);
64
+ }
65
+
66
+ return preg_split('/$\R?^/m', $message, -1, PREG_SPLIT_NO_EMPTY);
67
+ }
68
+
69
+ /**
70
+ * Make common syslog header (see rfc5424)
71
+ */
72
+ protected function makeCommonSyslogHeader($severity)
73
+ {
74
+ $priority = $severity + $this->facility;
75
+
76
+ if (!$pid = getmypid()) {
77
+ $pid = '-';
78
+ }
79
+
80
+ if (!$hostname = gethostname()) {
81
+ $hostname = '-';
82
+ }
83
+
84
+ return "<$priority>1 " .
85
+ $this->getDateTime() . " " .
86
+ $hostname . " " .
87
+ $this->ident . " " .
88
+ $pid . " - - ";
89
+ }
90
+
91
+ protected function getDateTime()
92
+ {
93
+ return date(\DateTime::RFC3339);
94
+ }
95
+
96
+ /**
97
+ * Inject your own socket, mainly used for testing
98
+ */
99
+ public function setSocket($socket)
100
+ {
101
+ $this->socket = $socket;
102
+ }
103
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/TestHandler.php ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ /**
15
+ * Used for testing purposes.
16
+ *
17
+ * It records all records and gives you access to them for verification.
18
+ *
19
+ * @author Jordi Boggiano <j.boggiano@seld.be>
20
+ *
21
+ * @method bool hasEmergency($record)
22
+ * @method bool hasAlert($record)
23
+ * @method bool hasCritical($record)
24
+ * @method bool hasError($record)
25
+ * @method bool hasWarning($record)
26
+ * @method bool hasNotice($record)
27
+ * @method bool hasInfo($record)
28
+ * @method bool hasDebug($record)
29
+ *
30
+ * @method bool hasEmergencyRecords()
31
+ * @method bool hasAlertRecords()
32
+ * @method bool hasCriticalRecords()
33
+ * @method bool hasErrorRecords()
34
+ * @method bool hasWarningRecords()
35
+ * @method bool hasNoticeRecords()
36
+ * @method bool hasInfoRecords()
37
+ * @method bool hasDebugRecords()
38
+ *
39
+ * @method bool hasEmergencyThatContains($message)
40
+ * @method bool hasAlertThatContains($message)
41
+ * @method bool hasCriticalThatContains($message)
42
+ * @method bool hasErrorThatContains($message)
43
+ * @method bool hasWarningThatContains($message)
44
+ * @method bool hasNoticeThatContains($message)
45
+ * @method bool hasInfoThatContains($message)
46
+ * @method bool hasDebugThatContains($message)
47
+ *
48
+ * @method bool hasEmergencyThatMatches($message)
49
+ * @method bool hasAlertThatMatches($message)
50
+ * @method bool hasCriticalThatMatches($message)
51
+ * @method bool hasErrorThatMatches($message)
52
+ * @method bool hasWarningThatMatches($message)
53
+ * @method bool hasNoticeThatMatches($message)
54
+ * @method bool hasInfoThatMatches($message)
55
+ * @method bool hasDebugThatMatches($message)
56
+ *
57
+ * @method bool hasEmergencyThatPasses($message)
58
+ * @method bool hasAlertThatPasses($message)
59
+ * @method bool hasCriticalThatPasses($message)
60
+ * @method bool hasErrorThatPasses($message)
61
+ * @method bool hasWarningThatPasses($message)
62
+ * @method bool hasNoticeThatPasses($message)
63
+ * @method bool hasInfoThatPasses($message)
64
+ * @method bool hasDebugThatPasses($message)
65
+ */
66
+ class TestHandler extends AbstractProcessingHandler
67
+ {
68
+ protected $records = array();
69
+ protected $recordsByLevel = array();
70
+
71
+ public function getRecords()
72
+ {
73
+ return $this->records;
74
+ }
75
+
76
+ public function clear()
77
+ {
78
+ $this->records = array();
79
+ $this->recordsByLevel = array();
80
+ }
81
+
82
+ public function hasRecords($level)
83
+ {
84
+ return isset($this->recordsByLevel[$level]);
85
+ }
86
+
87
+ public function hasRecord($record, $level)
88
+ {
89
+ if (is_array($record)) {
90
+ $record = $record['message'];
91
+ }
92
+
93
+ return $this->hasRecordThatPasses(function ($rec) use ($record) {
94
+ return $rec['message'] === $record;
95
+ }, $level);
96
+ }
97
+
98
+ public function hasRecordThatContains($message, $level)
99
+ {
100
+ return $this->hasRecordThatPasses(function ($rec) use ($message) {
101
+ return strpos($rec['message'], $message) !== false;
102
+ }, $level);
103
+ }
104
+
105
+ public function hasRecordThatMatches($regex, $level)
106
+ {
107
+ return $this->hasRecordThatPasses(function ($rec) use ($regex) {
108
+ return preg_match($regex, $rec['message']) > 0;
109
+ }, $level);
110
+ }
111
+
112
+ public function hasRecordThatPasses($predicate, $level)
113
+ {
114
+ if (!is_callable($predicate)) {
115
+ throw new \InvalidArgumentException("Expected a callable for hasRecordThatSucceeds");
116
+ }
117
+
118
+ if (!isset($this->recordsByLevel[$level])) {
119
+ return false;
120
+ }
121
+
122
+ foreach ($this->recordsByLevel[$level] as $i => $rec) {
123
+ if (call_user_func($predicate, $rec, $i)) {
124
+ return true;
125
+ }
126
+ }
127
+
128
+ return false;
129
+ }
130
+
131
+ /**
132
+ * {@inheritdoc}
133
+ */
134
+ protected function write(array $record)
135
+ {
136
+ $this->recordsByLevel[$record['level']][] = $record;
137
+ $this->records[] = $record;
138
+ }
139
+
140
+ public function __call($method, $args)
141
+ {
142
+ if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) {
143
+ $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3];
144
+ $level = constant('Monolog\Logger::' . strtoupper($matches[2]));
145
+ if (method_exists($this, $genericMethod)) {
146
+ $args[] = $level;
147
+
148
+ return call_user_func_array(array($this, $genericMethod), $args);
149
+ }
150
+ }
151
+
152
+ throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()');
153
+ }
154
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/WhatFailureGroupHandler.php ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Handler;
13
+
14
+ /**
15
+ * Forwards records to multiple handlers suppressing failures of each handler
16
+ * and continuing through to give every handler a chance to succeed.
17
+ *
18
+ * @author Craig D'Amelio <craig@damelio.ca>
19
+ */
20
+ class WhatFailureGroupHandler extends GroupHandler
21
+ {
22
+ /**
23
+ * {@inheritdoc}
24
+ */
25
+ public function handle(array $record)
26
+ {
27
+ if ($this->processors) {
28
+ foreach ($this->processors as $processor) {
29
+ $record = call_user_func($processor, $record);
30
+ }
31
+ }
32
+
33
+ foreach ($this->handlers as $handler) {
34
+ try {
35
+ $handler->handle($record);
36
+ } catch (\Exception $e) {
37
+ // What failure?
38
+ } catch (\Throwable $e) {
39
+ // What failure?
40
+ }
41
+ }
42
+
43
+ return false === $this->bubble;
44
+ }
45
+
46
+ /**
47
+ * {@inheritdoc}
48
+ */
49
+ public function handleBatch(array $records)
50
+ {
51
+ foreach ($this->handlers as $handler) {
52
+ try {
53
+ $handler->handleBatch($records);
54
+ } catch (\Exception $e) {
55
+ // What failure?
56
+ } catch (\Throwable $e) {
57
+ // What failure?
58
+ }
59
+ }
60
+ }
61
+ }
lib/vendor/monolog/monolog/src/Monolog/Handler/ZendMonitorHandler.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * This file is part of the Monolog package.
4
+ *
5
+ * (c) Jordi Boggiano <j.boggiano@seld.be>
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
+ namespace Monolog\Handler;
12
+
13
+ use Monolog\Formatter\NormalizerFormatter;
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Handler sending logs to Zend Monitor
18
+ *
19
+ * @author Christian Bergau <cbergau86@gmail.com>
20
+ */
21
+ class ZendMonitorHandler extends AbstractProcessingHandler
22
+ {
23
+ /**
24
+ * Monolog level / ZendMonitor Custom Event priority map
25
+ *
26
+ * @var array
27
+ */
28
+ protected $levelMap = array(
29
+ Logger::DEBUG => 1,
30
+ Logger::INFO => 2,
31
+ Logger::NOTICE => 3,
32
+ Logger::WARNING => 4,
33
+ Logger::ERROR => 5,
34
+ Logger::CRITICAL => 6,
35
+ Logger::ALERT => 7,
36
+ Logger::EMERGENCY => 0,
37
+ );
38
+
39
+ /**
40
+ * Construct
41
+ *
42
+ * @param int $level
43
+ * @param bool $bubble
44
+ * @throws MissingExtensionException
45
+ */
46
+ public function __construct($level = Logger::DEBUG, $bubble = true)
47
+ {
48
+ if (!function_exists('zend_monitor_custom_event')) {
49
+ throw new MissingExtensionException('You must have Zend Server installed in order to use this handler');
50
+ }
51
+ parent::__construct($level, $bubble);
52
+ }
53
+
54
+ /**
55
+ * {@inheritdoc}
56
+ */
57
+ protected function write(array $record)
58
+ {
59
+ $this->writeZendMonitorCustomEvent(
60
+ $this->levelMap[$record['level']],
61
+ $record['message'],
62
+ $record['formatted']
63
+ );
64
+ }
65
+
66
+ /**
67
+ * Write a record to Zend Monitor
68
+ *
69
+ * @param int $level
70
+ * @param string $message
71
+ * @param array $formatted
72
+ */
73
+ protected function writeZendMonitorCustomEvent($level, $message, $formatted)
74
+ {
75
+ zend_monitor_custom_event($level, $message, $formatted);
76
+ }
77
+
78
+ /**
79
+ * {@inheritdoc}
80
+ */
81
+ public function getDefaultFormatter()
82
+ {
83
+ return new NormalizerFormatter();
84
+ }
85
+
86
+ /**
87
+ * Get the level map
88
+ *
89
+ * @return array
90
+ */
91
+ public function getLevelMap()
92
+ {
93
+ return $this->levelMap;
94
+ }
95
+ }
lib/vendor/monolog/monolog/src/Monolog/Logger.php ADDED
@@ -0,0 +1,700 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog;
13
+
14
+ use Monolog\Handler\HandlerInterface;
15
+ use Monolog\Handler\StreamHandler;
16
+ use Psr\Log\LoggerInterface;
17
+ use Psr\Log\InvalidArgumentException;
18
+
19
+ /**
20
+ * Monolog log channel
21
+ *
22
+ * It contains a stack of Handlers and a stack of Processors,
23
+ * and uses them to store records that are added to it.
24
+ *
25
+ * @author Jordi Boggiano <j.boggiano@seld.be>
26
+ */
27
+ class Logger implements LoggerInterface
28
+ {
29
+ /**
30
+ * Detailed debug information
31
+ */
32
+ const DEBUG = 100;
33
+
34
+ /**
35
+ * Interesting events
36
+ *
37
+ * Examples: User logs in, SQL logs.
38
+ */
39
+ const INFO = 200;
40
+
41
+ /**
42
+ * Uncommon events
43
+ */
44
+ const NOTICE = 250;
45
+
46
+ /**
47
+ * Exceptional occurrences that are not errors
48
+ *
49
+ * Examples: Use of deprecated APIs, poor use of an API,
50
+ * undesirable things that are not necessarily wrong.
51
+ */
52
+ const WARNING = 300;
53
+
54
+ /**
55
+ * Runtime errors
56
+ */
57
+ const ERROR = 400;
58
+
59
+ /**
60
+ * Critical conditions
61
+ *
62
+ * Example: Application component unavailable, unexpected exception.
63
+ */
64
+ const CRITICAL = 500;
65
+
66
+ /**
67
+ * Action must be taken immediately
68
+ *
69
+ * Example: Entire website down, database unavailable, etc.
70
+ * This should trigger the SMS alerts and wake you up.
71
+ */
72
+ const ALERT = 550;
73
+
74
+ /**
75
+ * Urgent alert.
76
+ */
77
+ const EMERGENCY = 600;
78
+
79
+ /**
80
+ * Monolog API version
81
+ *
82
+ * This is only bumped when API breaks are done and should
83
+ * follow the major version of the library
84
+ *
85
+ * @var int
86
+ */
87
+ const API = 1;
88
+
89
+ /**
90
+ * Logging levels from syslog protocol defined in RFC 5424
91
+ *
92
+ * @var array $levels Logging levels
93
+ */
94
+ protected static $levels = array(
95
+ self::DEBUG => 'DEBUG',
96
+ self::INFO => 'INFO',
97
+ self::NOTICE => 'NOTICE',
98
+ self::WARNING => 'WARNING',
99
+ self::ERROR => 'ERROR',
100
+ self::CRITICAL => 'CRITICAL',
101
+ self::ALERT => 'ALERT',
102
+ self::EMERGENCY => 'EMERGENCY',
103
+ );
104
+
105
+ /**
106
+ * @var \DateTimeZone
107
+ */
108
+ protected static $timezone;
109
+
110
+ /**
111
+ * @var string
112
+ */
113
+ protected $name;
114
+
115
+ /**
116
+ * The handler stack
117
+ *
118
+ * @var HandlerInterface[]
119
+ */
120
+ protected $handlers;
121
+
122
+ /**
123
+ * Processors that will process all log records
124
+ *
125
+ * To process records of a single handler instead, add the processor on that specific handler
126
+ *
127
+ * @var callable[]
128
+ */
129
+ protected $processors;
130
+
131
+ /**
132
+ * @var bool
133
+ */
134
+ protected $microsecondTimestamps = true;
135
+
136
+ /**
137
+ * @param string $name The logging channel
138
+ * @param HandlerInterface[] $handlers Optional stack of handlers, the first one in the array is called first, etc.
139
+ * @param callable[] $processors Optional array of processors
140
+ */
141
+ public function __construct($name, array $handlers = array(), array $processors = array())
142
+ {
143
+ $this->name = $name;
144
+ $this->handlers = $handlers;
145
+ $this->processors = $processors;
146
+ }
147
+
148
+ /**
149
+ * @return string
150
+ */
151
+ public function getName()
152
+ {
153
+ return $this->name;
154
+ }
155
+
156
+ /**
157
+ * Return a new cloned instance with the name changed
158
+ *
159
+ * @return static
160
+ */
161
+ public function withName($name)
162
+ {
163
+ $new = clone $this;
164
+ $new->name = $name;
165
+
166
+ return $new;
167
+ }
168
+
169
+ /**
170
+ * Pushes a handler on to the stack.
171
+ *
172
+ * @param HandlerInterface $handler
173
+ * @return $this
174
+ */
175
+ public function pushHandler(HandlerInterface $handler)
176
+ {
177
+ array_unshift($this->handlers, $handler);
178
+
179
+ return $this;
180
+ }
181
+
182
+ /**
183
+ * Pops a handler from the stack
184
+ *
185
+ * @return HandlerInterface
186
+ */
187
+ public function popHandler()
188
+ {
189
+ if (!$this->handlers) {
190
+ throw new \LogicException('You tried to pop from an empty handler stack.');
191
+ }
192
+
193
+ return array_shift($this->handlers);
194
+ }
195
+
196
+ /**
197
+ * Set handlers, replacing all existing ones.
198
+ *
199
+ * If a map is passed, keys will be ignored.
200
+ *
201
+ * @param HandlerInterface[] $handlers
202
+ * @return $this
203
+ */
204
+ public function setHandlers(array $handlers)
205
+ {
206
+ $this->handlers = array();
207
+ foreach (array_reverse($handlers) as $handler) {
208
+ $this->pushHandler($handler);
209
+ }
210
+
211
+ return $this;
212
+ }
213
+
214
+ /**
215
+ * @return HandlerInterface[]
216
+ */
217
+ public function getHandlers()
218
+ {
219
+ return $this->handlers;
220
+ }
221
+
222
+ /**
223
+ * Adds a processor on to the stack.
224
+ *
225
+ * @param callable $callback
226
+ * @return $this
227
+ */
228
+ public function pushProcessor($callback)
229
+ {
230
+ if (!is_callable($callback)) {
231
+ throw new \InvalidArgumentException('Processors must be valid callables (callback or object with an __invoke method), '.var_export($callback, true).' given');
232
+ }
233
+ array_unshift($this->processors, $callback);
234
+
235
+ return $this;
236
+ }
237
+
238
+ /**
239
+ * Removes the processor on top of the stack and returns it.
240
+ *
241
+ * @return callable
242
+ */
243
+ public function popProcessor()
244
+ {
245
+ if (!$this->processors) {
246
+ throw new \LogicException('You tried to pop from an empty processor stack.');
247
+ }
248
+
249
+ return array_shift($this->processors);
250
+ }
251
+
252
+ /**
253
+ * @return callable[]
254
+ */
255
+ public function getProcessors()
256
+ {
257
+ return $this->processors;
258
+ }
259
+
260
+ /**
261
+ * Control the use of microsecond resolution timestamps in the 'datetime'
262
+ * member of new records.
263
+ *
264
+ * Generating microsecond resolution timestamps by calling
265
+ * microtime(true), formatting the result via sprintf() and then parsing
266
+ * the resulting string via \DateTime::createFromFormat() can incur
267
+ * a measurable runtime overhead vs simple usage of DateTime to capture
268
+ * a second resolution timestamp in systems which generate a large number
269
+ * of log events.
270
+ *
271
+ * @param bool $micro True to use microtime() to create timestamps
272
+ */
273
+ public function useMicrosecondTimestamps($micro)
274
+ {
275
+ $this->microsecondTimestamps = (bool) $micro;
276
+ }
277
+
278
+ /**
279
+ * Adds a log record.
280
+ *
281
+ * @param int $level The logging level
282
+ * @param string $message The log message
283
+ * @param array $context The log context
284
+ * @return Boolean Whether the record has been processed
285
+ */
286
+ public function addRecord($level, $message, array $context = array())
287
+ {
288
+ if (!$this->handlers) {
289
+ $this->pushHandler(new StreamHandler('php://stderr', static::DEBUG));
290
+ }
291
+
292
+ $levelName = static::getLevelName($level);
293
+
294
+ // check if any handler will handle this message so we can return early and save cycles
295
+ $handlerKey = null;
296
+ reset($this->handlers);
297
+ while ($handler = current($this->handlers)) {
298
+ if ($handler->isHandling(array('level' => $level))) {
299
+ $handlerKey = key($this->handlers);
300
+ break;
301
+ }
302
+
303
+ next($this->handlers);
304
+ }
305
+
306
+ if (null === $handlerKey) {
307
+ return false;
308
+ }
309
+
310
+ if (!static::$timezone) {
311
+ static::$timezone = new \DateTimeZone(date_default_timezone_get() ?: 'UTC');
312
+ }
313
+
314
+ // php7.1+ always has microseconds enabled, so we do not need this hack
315
+ if ($this->microsecondTimestamps && PHP_VERSION_ID < 70100) {
316
+ $ts = \DateTime::createFromFormat('U.u', sprintf('%.6F', microtime(true)), static::$timezone);
317
+ } else {
318
+ $ts = new \DateTime(null, static::$timezone);
319
+ }
320
+ $ts->setTimezone(static::$timezone);
321
+
322
+ $record = array(
323
+ 'message' => (string) $message,
324
+ 'context' => $context,
325
+ 'level' => $level,
326
+ 'level_name' => $levelName,
327
+ 'channel' => $this->name,
328
+ 'datetime' => $ts,
329
+ 'extra' => array(),
330
+ );
331
+
332
+ foreach ($this->processors as $processor) {
333
+ $record = call_user_func($processor, $record);
334
+ }
335
+
336
+ while ($handler = current($this->handlers)) {
337
+ if (true === $handler->handle($record)) {
338
+ break;
339
+ }
340
+
341
+ next($this->handlers);
342
+ }
343
+
344
+ return true;
345
+ }
346
+
347
+ /**
348
+ * Adds a log record at the DEBUG level.
349
+ *
350
+ * @param string $message The log message
351
+ * @param array $context The log context
352
+ * @return Boolean Whether the record has been processed
353
+ */
354
+ public function addDebug($message, array $context = array())
355
+ {
356
+ return $this->addRecord(static::DEBUG, $message, $context);
357
+ }
358
+
359
+ /**
360
+ * Adds a log record at the INFO level.
361
+ *
362
+ * @param string $message The log message
363
+ * @param array $context The log context
364
+ * @return Boolean Whether the record has been processed
365
+ */
366
+ public function addInfo($message, array $context = array())
367
+ {
368
+ return $this->addRecord(static::INFO, $message, $context);
369
+ }
370
+
371
+ /**
372
+ * Adds a log record at the NOTICE level.
373
+ *
374
+ * @param string $message The log message
375
+ * @param array $context The log context
376
+ * @return Boolean Whether the record has been processed
377
+ */
378
+ public function addNotice($message, array $context = array())
379
+ {
380
+ return $this->addRecord(static::NOTICE, $message, $context);
381
+ }
382
+
383
+ /**
384
+ * Adds a log record at the WARNING level.
385
+ *
386
+ * @param string $message The log message
387
+ * @param array $context The log context
388
+ * @return Boolean Whether the record has been processed
389
+ */
390
+ public function addWarning($message, array $context = array())
391
+ {
392
+ return $this->addRecord(static::WARNING, $message, $context);
393
+ }
394
+
395
+ /**
396
+ * Adds a log record at the ERROR level.
397
+ *
398
+ * @param string $message The log message
399
+ * @param array $context The log context
400
+ * @return Boolean Whether the record has been processed
401
+ */
402
+ public function addError($message, array $context = array())
403
+ {
404
+ return $this->addRecord(static::ERROR, $message, $context);
405
+ }
406
+
407
+ /**
408
+ * Adds a log record at the CRITICAL level.
409
+ *
410
+ * @param string $message The log message
411
+ * @param array $context The log context
412
+ * @return Boolean Whether the record has been processed
413
+ */
414
+ public function addCritical($message, array $context = array())
415
+ {
416
+ return $this->addRecord(static::CRITICAL, $message, $context);
417
+ }
418
+
419
+ /**
420
+ * Adds a log record at the ALERT level.
421
+ *
422
+ * @param string $message The log message
423
+ * @param array $context The log context
424
+ * @return Boolean Whether the record has been processed
425
+ */
426
+ public function addAlert($message, array $context = array())
427
+ {
428
+ return $this->addRecord(static::ALERT, $message, $context);
429
+ }
430
+
431
+ /**
432
+ * Adds a log record at the EMERGENCY level.
433
+ *
434
+ * @param string $message The log message
435
+ * @param array $context The log context
436
+ * @return Boolean Whether the record has been processed
437
+ */
438
+ public function addEmergency($message, array $context = array())
439
+ {
440
+ return $this->addRecord(static::EMERGENCY, $message, $context);
441
+ }
442
+
443
+ /**
444
+ * Gets all supported logging levels.
445
+ *
446
+ * @return array Assoc array with human-readable level names => level codes.
447
+ */
448
+ public static function getLevels()
449
+ {
450
+ return array_flip(static::$levels);
451
+ }
452
+
453
+ /**
454
+ * Gets the name of the logging level.
455
+ *
456
+ * @param int $level
457
+ * @return string
458
+ */
459
+ public static function getLevelName($level)
460
+ {
461
+ if (!isset(static::$levels[$level])) {
462
+ throw new InvalidArgumentException('Level "'.$level.'" is not defined, use one of: '.implode(', ', array_keys(static::$levels)));
463
+ }
464
+
465
+ return static::$levels[$level];
466
+ }
467
+
468
+ /**
469
+ * Converts PSR-3 levels to Monolog ones if necessary
470
+ *
471
+ * @param string|int Level number (monolog) or name (PSR-3)
472
+ * @return int
473
+ */
474
+ public static function toMonologLevel($level)
475
+ {
476
+ if (is_string($level) && defined(__CLASS__.'::'.strtoupper($level))) {
477
+ return constant(__CLASS__.'::'.strtoupper($level));
478
+ }
479
+
480
+ return $level;
481
+ }
482
+
483
+ /**
484
+ * Checks whether the Logger has a handler that listens on the given level
485
+ *
486
+ * @param int $level
487
+ * @return Boolean
488
+ */
489
+ public function isHandling($level)
490
+ {
491
+ $record = array(
492
+ 'level' => $level,
493
+ );
494
+
495
+ foreach ($this->handlers as $handler) {
496
+ if ($handler->isHandling($record)) {
497
+ return true;
498
+ }
499
+ }
500
+
501
+ return false;
502
+ }
503
+
504
+ /**
505
+ * Adds a log record at an arbitrary level.
506
+ *
507
+ * This method allows for compatibility with common interfaces.
508
+ *
509
+ * @param mixed $level The log level
510
+ * @param string $message The log message
511
+ * @param array $context The log context
512
+ * @return Boolean Whether the record has been processed
513
+ */
514
+ public function log($level, $message, array $context = array())
515
+ {
516
+ $level = static::toMonologLevel($level);
517
+
518
+ return $this->addRecord($level, $message, $context);
519
+ }
520
+
521
+ /**
522
+ * Adds a log record at the DEBUG level.
523
+ *
524
+ * This method allows for compatibility with common interfaces.
525
+ *
526
+ * @param string $message The log message
527
+ * @param array $context The log context
528
+ * @return Boolean Whether the record has been processed
529
+ */
530
+ public function debug($message, array $context = array())
531
+ {
532
+ return $this->addRecord(static::DEBUG, $message, $context);
533
+ }
534
+
535
+ /**
536
+ * Adds a log record at the INFO level.
537
+ *
538
+ * This method allows for compatibility with common interfaces.
539
+ *
540
+ * @param string $message The log message
541
+ * @param array $context The log context
542
+ * @return Boolean Whether the record has been processed
543
+ */
544
+ public function info($message, array $context = array())
545
+ {
546
+ return $this->addRecord(static::INFO, $message, $context);
547
+ }
548
+
549
+ /**
550
+ * Adds a log record at the NOTICE level.
551
+ *
552
+ * This method allows for compatibility with common interfaces.
553
+ *
554
+ * @param string $message The log message
555
+ * @param array $context The log context
556
+ * @return Boolean Whether the record has been processed
557
+ */
558
+ public function notice($message, array $context = array())
559
+ {
560
+ return $this->addRecord(static::NOTICE, $message, $context);
561
+ }
562
+
563
+ /**
564
+ * Adds a log record at the WARNING level.
565
+ *
566
+ * This method allows for compatibility with common interfaces.
567
+ *
568
+ * @param string $message The log message
569
+ * @param array $context The log context
570
+ * @return Boolean Whether the record has been processed
571
+ */
572
+ public function warn($message, array $context = array())
573
+ {
574
+ return $this->addRecord(static::WARNING, $message, $context);
575
+ }
576
+
577
+ /**
578
+ * Adds a log record at the WARNING level.
579
+ *
580
+ * This method allows for compatibility with common interfaces.
581
+ *
582
+ * @param string $message The log message
583
+ * @param array $context The log context
584
+ * @return Boolean Whether the record has been processed
585
+ */
586
+ public function warning($message, array $context = array())
587
+ {
588
+ return $this->addRecord(static::WARNING, $message, $context);
589
+ }
590
+
591
+ /**
592
+ * Adds a log record at the ERROR level.
593
+ *
594
+ * This method allows for compatibility with common interfaces.
595
+ *
596
+ * @param string $message The log message
597
+ * @param array $context The log context
598
+ * @return Boolean Whether the record has been processed
599
+ */
600
+ public function err($message, array $context = array())
601
+ {
602
+ return $this->addRecord(static::ERROR, $message, $context);
603
+ }
604
+
605
+ /**
606
+ * Adds a log record at the ERROR level.
607
+ *
608
+ * This method allows for compatibility with common interfaces.
609
+ *
610
+ * @param string $message The log message
611
+ * @param array $context The log context
612
+ * @return Boolean Whether the record has been processed
613
+ */
614
+ public function error($message, array $context = array())
615
+ {
616
+ return $this->addRecord(static::ERROR, $message, $context);
617
+ }
618
+
619
+ /**
620
+ * Adds a log record at the CRITICAL level.
621
+ *
622
+ * This method allows for compatibility with common interfaces.
623
+ *
624
+ * @param string $message The log message
625
+ * @param array $context The log context
626
+ * @return Boolean Whether the record has been processed
627
+ */
628
+ public function crit($message, array $context = array())
629
+ {
630
+ return $this->addRecord(static::CRITICAL, $message, $context);
631
+ }
632
+
633
+ /**
634
+ * Adds a log record at the CRITICAL level.
635
+ *
636
+ * This method allows for compatibility with common interfaces.
637
+ *
638
+ * @param string $message The log message
639
+ * @param array $context The log context
640
+ * @return Boolean Whether the record has been processed
641
+ */
642
+ public function critical($message, array $context = array())
643
+ {
644
+ return $this->addRecord(static::CRITICAL, $message, $context);
645
+ }
646
+
647
+ /**
648
+ * Adds a log record at the ALERT level.
649
+ *
650
+ * This method allows for compatibility with common interfaces.
651
+ *
652
+ * @param string $message The log message
653
+ * @param array $context The log context
654
+ * @return Boolean Whether the record has been processed
655
+ */
656
+ public function alert($message, array $context = array())
657
+ {
658
+ return $this->addRecord(static::ALERT, $message, $context);
659
+ }
660
+
661
+ /**
662
+ * Adds a log record at the EMERGENCY level.
663
+ *
664
+ * This method allows for compatibility with common interfaces.
665
+ *
666
+ * @param string $message The log message
667
+ * @param array $context The log context
668
+ * @return Boolean Whether the record has been processed
669
+ */
670
+ public function emerg($message, array $context = array())
671
+ {
672
+ return $this->addRecord(static::EMERGENCY, $message, $context);
673
+ }
674
+
675
+ /**
676
+ * Adds a log record at the EMERGENCY level.
677
+ *
678
+ * This method allows for compatibility with common interfaces.
679
+ *
680
+ * @param string $message The log message
681
+ * @param array $context The log context
682
+ * @return Boolean Whether the record has been processed
683
+ */
684
+ public function emergency($message, array $context = array())
685
+ {
686
+ return $this->addRecord(static::EMERGENCY, $message, $context);
687
+ }
688
+
689
+ /**
690
+ * Set the timezone to be used for the timestamp of log records.
691
+ *
692
+ * This is stored globally for all Logger instances
693
+ *
694
+ * @param \DateTimeZone $tz Timezone object
695
+ */
696
+ public static function setTimezone(\DateTimeZone $tz)
697
+ {
698
+ self::$timezone = $tz;
699
+ }
700
+ }
lib/vendor/monolog/monolog/src/Monolog/Processor/GitProcessor.php ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Processor;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Injects Git branch and Git commit SHA in all records
18
+ *
19
+ * @author Nick Otter
20
+ * @author Jordi Boggiano <j.boggiano@seld.be>
21
+ */
22
+ class GitProcessor
23
+ {
24
+ private $level;
25
+ private static $cache;
26
+
27
+ public function __construct($level = Logger::DEBUG)
28
+ {
29
+ $this->level = Logger::toMonologLevel($level);
30
+ }
31
+
32
+ /**
33
+ * @param array $record
34
+ * @return array
35
+ */
36
+ public function __invoke(array $record)
37
+ {
38
+ // return if the level is not high enough
39
+ if ($record['level'] < $this->level) {
40
+ return $record;
41
+ }
42
+
43
+ $record['extra']['git'] = self::getGitInfo();
44
+
45
+ return $record;
46
+ }
47
+
48
+ private static function getGitInfo()
49
+ {
50
+ if (self::$cache) {
51
+ return self::$cache;
52
+ }
53
+
54
+ $branches = `git branch -v --no-abbrev`;
55
+ if (preg_match('{^\* (.+?)\s+([a-f0-9]{40})(?:\s|$)}m', $branches, $matches)) {
56
+ return self::$cache = array(
57
+ 'branch' => $matches[1],
58
+ 'commit' => $matches[2],
59
+ );
60
+ }
61
+
62
+ return self::$cache = array();
63
+ }
64
+ }
lib/vendor/monolog/monolog/src/Monolog/Processor/IntrospectionProcessor.php ADDED
@@ -0,0 +1,112 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Processor;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Injects line/file:class/function where the log message came from
18
+ *
19
+ * Warning: This only works if the handler processes the logs directly.
20
+ * If you put the processor on a handler that is behind a FingersCrossedHandler
21
+ * for example, the processor will only be called once the trigger level is reached,
22
+ * and all the log records will have the same file/line/.. data from the call that
23
+ * triggered the FingersCrossedHandler.
24
+ *
25
+ * @author Jordi Boggiano <j.boggiano@seld.be>
26
+ */
27
+ class IntrospectionProcessor
28
+ {
29
+ private $level;
30
+
31
+ private $skipClassesPartials;
32
+
33
+ private $skipStackFramesCount;
34
+
35
+ private $skipFunctions = array(
36
+ 'call_user_func',
37
+ 'call_user_func_array',
38
+ );
39
+
40
+ public function __construct($level = Logger::DEBUG, array $skipClassesPartials = array(), $skipStackFramesCount = 0)
41
+ {
42
+ $this->level = Logger::toMonologLevel($level);
43
+ $this->skipClassesPartials = array_merge(array('Monolog\\'), $skipClassesPartials);
44
+ $this->skipStackFramesCount = $skipStackFramesCount;
45
+ }
46
+
47
+ /**
48
+ * @param array $record
49
+ * @return array
50
+ */
51
+ public function __invoke(array $record)
52
+ {
53
+ // return if the level is not high enough
54
+ if ($record['level'] < $this->level) {
55
+ return $record;
56
+ }
57
+
58
+ /*
59
+ * http://php.net/manual/en/function.debug-backtrace.php
60
+ * As of 5.3.6, DEBUG_BACKTRACE_IGNORE_ARGS option was added.
61
+ * Any version less than 5.3.6 must use the DEBUG_BACKTRACE_IGNORE_ARGS constant value '2'.
62
+ */
63
+ $trace = debug_backtrace((PHP_VERSION_ID < 50306) ? 2 : DEBUG_BACKTRACE_IGNORE_ARGS);
64
+
65
+ // skip first since it's always the current method
66
+ array_shift($trace);
67
+ // the call_user_func call is also skipped
68
+ array_shift($trace);
69
+
70
+ $i = 0;
71
+
72
+ while ($this->isTraceClassOrSkippedFunction($trace, $i)) {
73
+ if (isset($trace[$i]['class'])) {
74
+ foreach ($this->skipClassesPartials as $part) {
75
+ if (strpos($trace[$i]['class'], $part) !== false) {
76
+ $i++;
77
+ continue 2;
78
+ }
79
+ }
80
+ } elseif (in_array($trace[$i]['function'], $this->skipFunctions)) {
81
+ $i++;
82
+ continue;
83
+ }
84
+
85
+ break;
86
+ }
87
+
88
+ $i += $this->skipStackFramesCount;
89
+
90
+ // we should have the call source now
91
+ $record['extra'] = array_merge(
92
+ $record['extra'],
93
+ array(
94
+ 'file' => isset($trace[$i - 1]['file']) ? $trace[$i - 1]['file'] : null,
95
+ 'line' => isset($trace[$i - 1]['line']) ? $trace[$i - 1]['line'] : null,
96
+ 'class' => isset($trace[$i]['class']) ? $trace[$i]['class'] : null,
97
+ 'function' => isset($trace[$i]['function']) ? $trace[$i]['function'] : null,
98
+ )
99
+ );
100
+
101
+ return $record;
102
+ }
103
+
104
+ private function isTraceClassOrSkippedFunction(array $trace, $index)
105
+ {
106
+ if (!isset($trace[$index])) {
107
+ return false;
108
+ }
109
+
110
+ return isset($trace[$index]['class']) || in_array($trace[$index]['function'], $this->skipFunctions);
111
+ }
112
+ }
lib/vendor/monolog/monolog/src/Monolog/Processor/MemoryPeakUsageProcessor.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Processor;
13
+
14
+ /**
15
+ * Injects memory_get_peak_usage in all records
16
+ *
17
+ * @see Monolog\Processor\MemoryProcessor::__construct() for options
18
+ * @author Rob Jensen
19
+ */
20
+ class MemoryPeakUsageProcessor extends MemoryProcessor
21
+ {
22
+ /**
23
+ * @param array $record
24
+ * @return array
25
+ */
26
+ public function __invoke(array $record)
27
+ {
28
+ $bytes = memory_get_peak_usage($this->realUsage);
29
+ $formatted = $this->formatBytes($bytes);
30
+
31
+ $record['extra']['memory_peak_usage'] = $formatted;
32
+
33
+ return $record;
34
+ }
35
+ }
lib/vendor/monolog/monolog/src/Monolog/Processor/MemoryProcessor.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Processor;
13
+
14
+ /**
15
+ * Some methods that are common for all memory processors
16
+ *
17
+ * @author Rob Jensen
18
+ */
19
+ abstract class MemoryProcessor
20
+ {
21
+ /**
22
+ * @var bool If true, get the real size of memory allocated from system. Else, only the memory used by emalloc() is reported.
23
+ */
24
+ protected $realUsage;
25
+
26
+ /**
27
+ * @var bool If true, then format memory size to human readable string (MB, KB, B depending on size)
28
+ */
29
+ protected $useFormatting;
30
+
31
+ /**
32
+ * @param bool $realUsage Set this to true to get the real size of memory allocated from system.
33
+ * @param bool $useFormatting If true, then format memory size to human readable string (MB, KB, B depending on size)
34
+ */
35
+ public function __construct($realUsage = true, $useFormatting = true)
36
+ {
37
+ $this->realUsage = (boolean) $realUsage;
38
+ $this->useFormatting = (boolean) $useFormatting;
39
+ }
40
+
41
+ /**
42
+ * Formats bytes into a human readable string if $this->useFormatting is true, otherwise return $bytes as is
43
+ *
44
+ * @param int $bytes
45
+ * @return string|int Formatted string if $this->useFormatting is true, otherwise return $bytes as is
46
+ */
47
+ protected function formatBytes($bytes)
48
+ {
49
+ $bytes = (int) $bytes;
50
+
51
+ if (!$this->useFormatting) {
52
+ return $bytes;
53
+ }
54
+
55
+ if ($bytes > 1024 * 1024) {
56
+ return round($bytes / 1024 / 1024, 2).' MB';
57
+ } elseif ($bytes > 1024) {
58
+ return round($bytes / 1024, 2).' KB';
59
+ }
60
+
61
+ return $bytes . ' B';
62
+ }
63
+ }
lib/vendor/monolog/monolog/src/Monolog/Processor/MemoryUsageProcessor.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Processor;
13
+
14
+ /**
15
+ * Injects memory_get_usage in all records
16
+ *
17
+ * @see Monolog\Processor\MemoryProcessor::__construct() for options
18
+ * @author Rob Jensen
19
+ */
20
+ class MemoryUsageProcessor extends MemoryProcessor
21
+ {
22
+ /**
23
+ * @param array $record
24
+ * @return array
25
+ */
26
+ public function __invoke(array $record)
27
+ {
28
+ $bytes = memory_get_usage($this->realUsage);
29
+ $formatted = $this->formatBytes($bytes);
30
+
31
+ $record['extra']['memory_usage'] = $formatted;
32
+
33
+ return $record;
34
+ }
35
+ }
lib/vendor/monolog/monolog/src/Monolog/Processor/MercurialProcessor.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Monolog package.
5
+ *
6
+ * (c) Jonathan A. Schweder <jonathanschweder@gmail.com>
7
+ *
8
+ * For the full copyright and license information, please view the LICENSE
9
+ * file that was distributed with this source code.
10
+ */
11
+
12
+ namespace Monolog\Processor;
13
+
14
+ use Monolog\Logger;
15
+
16
+ /**
17
+ * Injects Hg branch and Hg revision number in all records
18
+ *
19
+ * @author Jonathan A. Schweder <jonathanschweder@gmail.com>
20
+ */
21
+ class MercurialProcessor
22
+ {
23
+ private $level;
24
+ private static $cache;
25
+
26
+ public function __construct($level = Logger::DEBUG)
27
+ {
28
+ $this->level = Logger::toMonologLevel($level);
29
+ }
30
+
31
+ /**
32
+ * @param array $record
33
+ * @return array
34
+ */
35
+ public function __invoke(array $record)
36
+ {
37
+ // return if the level is not high enough
38
+ if ($record['level'] < $this->level) {
39
+ return $record;
40
+ }
41
+
42
+ $record['extra']['hg'] = self::getMercurialInfo();
43
+
44
+ return $record;
45
+ }
46
+
47
+ private static function getMercurialInfo()
48
+ {
49
+ if (self::$cache) {
50
+ return self::$cache;
51
+ }
52
+
53
+ $result = explode(' ', trim(`hg id -nb`));
54
+ if (count($result) >= 3) {
55
+ return self::$cache = array(
56
+ 'branch' => $result[1],
57
+ 'revision' => $result[2],
58
+ );
59
+ }
60
+
61
+ return self::$cache = array();
62
+ }
63
+ }
lib/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Processor;
13
+
14
+ /**
15
+ * Adds value of getmypid into records
16
+ *
17
+ * @author Andreas Hörnicke
18
+ */
19
+ class ProcessIdProcessor
20
+ {
21
+ /**
22
+ * @param array $record
23
+ * @return array
24
+ */
25
+ public function __invoke(array $record)
26
+ {
27
+ $record['extra']['process_id'] = getmypid();
28
+
29
+ return $record;
30
+ }
31
+ }
lib/vendor/monolog/monolog/src/Monolog/Processor/PsrLogMessageProcessor.php ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Processor;
13
+
14
+ /**
15
+ * Processes a record's message according to PSR-3 rules
16
+ *
17
+ * It replaces {foo} with the value from $context['foo']
18
+ *
19
+ * @author Jordi Boggiano <j.boggiano@seld.be>
20
+ */
21
+ class PsrLogMessageProcessor
22
+ {
23
+ /**
24
+ * @param array $record
25
+ * @return array
26
+ */
27
+ public function __invoke(array $record)
28
+ {
29
+ if (false === strpos($record['message'], '{')) {
30
+ return $record;
31
+ }
32
+
33
+ $replacements = array();
34
+ foreach ($record['context'] as $key => $val) {
35
+ if (is_null($val) || is_scalar($val) || (is_object($val) && method_exists($val, "__toString"))) {
36
+ $replacements['{'.$key.'}'] = $val;
37
+ } elseif (is_object($val)) {
38
+ $replacements['{'.$key.'}'] = '[object '.get_class($val).']';
39
+ } else {
40
+ $replacements['{'.$key.'}'] = '['.gettype($val).']';
41
+ }
42
+ }
43
+
44
+ $record['message'] = strtr($record['message'], $replacements);
45
+
46
+ return $record;
47
+ }
48
+ }
lib/vendor/monolog/monolog/src/Monolog/Processor/TagProcessor.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Processor;
13
+
14
+ /**
15
+ * Adds a tags array into record
16
+ *
17
+ * @author Martijn Riemers
18
+ */
19
+ class TagProcessor
20
+ {
21
+ private $tags;
22
+
23
+ public function __construct(array $tags = array())
24
+ {
25
+ $this->setTags($tags);
26
+ }
27
+
28
+ public function addTags(array $tags = array())
29
+ {
30
+ $this->tags = array_merge($this->tags, $tags);
31
+ }
32
+
33
+ public function setTags(array $tags = array())
34
+ {
35
+ $this->tags = $tags;
36
+ }
37
+
38
+ public function __invoke(array $record)
39
+ {
40
+ $record['extra']['tags'] = $this->tags;
41
+
42
+ return $record;
43
+ }
44
+ }
lib/vendor/monolog/monolog/src/Monolog/Processor/UidProcessor.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Processor;
13
+
14
+ /**
15
+ * Adds a unique identifier into records
16
+ *
17
+ * @author Simon Mönch <sm@webfactory.de>
18
+ */
19
+ class UidProcessor
20
+ {
21
+ private $uid;
22
+
23
+ public function __construct($length = 7)
24
+ {
25
+ if (!is_int($length) || $length > 32 || $length < 1) {
26
+ throw new \InvalidArgumentException('The uid length must be an integer between 1 and 32');
27
+ }
28
+
29
+ $this->uid = substr(hash('md5', uniqid('', true)), 0, $length);
30
+ }
31
+
32
+ public function __invoke(array $record)
33
+ {
34
+ $record['extra']['uid'] = $this->uid;
35
+
36
+ return $record;
37
+ }
38
+
39
+ /**
40
+ * @return string
41
+ */
42
+ public function getUid()
43
+ {
44
+ return $this->uid;
45
+ }
46
+ }
lib/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog\Processor;
13
+
14
+ /**
15
+ * Injects url/method and remote IP of the current web request in all records
16
+ *
17
+ * @author Jordi Boggiano <j.boggiano@seld.be>
18
+ */
19
+ class WebProcessor
20
+ {
21
+ /**
22
+ * @var array|\ArrayAccess
23
+ */
24
+ protected $serverData;
25
+
26
+ /**
27
+ * Default fields
28
+ *
29
+ * Array is structured as [key in record.extra => key in $serverData]
30
+ *
31
+ * @var array
32
+ */
33
+ protected $extraFields = array(
34
+ 'url' => 'REQUEST_URI',
35
+ 'ip' => 'REMOTE_ADDR',
36
+ 'http_method' => 'REQUEST_METHOD',
37
+ 'server' => 'SERVER_NAME',
38
+ 'referrer' => 'HTTP_REFERER',
39
+ );
40
+
41
+ /**
42
+ * @param array|\ArrayAccess $serverData Array or object w/ ArrayAccess that provides access to the $_SERVER data
43
+ * @param array|null $extraFields Field names and the related key inside $serverData to be added. If not provided it defaults to: url, ip, http_method, server, referrer
44
+ */
45
+ public function __construct($serverData = null, array $extraFields = null)
46
+ {
47
+ if (null === $serverData) {
48
+ $this->serverData = &$_SERVER;
49
+ } elseif (is_array($serverData) || $serverData instanceof \ArrayAccess) {
50
+ $this->serverData = $serverData;
51
+ } else {
52
+ throw new \UnexpectedValueException('$serverData must be an array or object implementing ArrayAccess.');
53
+ }
54
+
55
+ if (null !== $extraFields) {
56
+ if (isset($extraFields[0])) {
57
+ foreach (array_keys($this->extraFields) as $fieldName) {
58
+ if (!in_array($fieldName, $extraFields)) {
59
+ unset($this->extraFields[$fieldName]);
60
+ }
61
+ }
62
+ } else {
63
+ $this->extraFields = $extraFields;
64
+ }
65
+ }
66
+ }
67
+
68
+ /**
69
+ * @param array $record
70
+ * @return array
71
+ */
72
+ public function __invoke(array $record)
73
+ {
74
+ // skip processing if for some reason request data
75
+ // is not present (CLI or wonky SAPIs)
76
+ if (!isset($this->serverData['REQUEST_URI'])) {
77
+ return $record;
78
+ }
79
+
80
+ $record['extra'] = $this->appendExtraFields($record['extra']);
81
+
82
+ return $record;
83
+ }
84
+
85
+ /**
86
+ * @param string $extraName
87
+ * @param string $serverName
88
+ * @return $this
89
+ */
90
+ public function addExtraField($extraName, $serverName)
91
+ {
92
+ $this->extraFields[$extraName] = $serverName;
93
+
94
+ return $this;
95
+ }
96
+
97
+ /**
98
+ * @param array $extra
99
+ * @return array
100
+ */
101
+ private function appendExtraFields(array $extra)
102
+ {
103
+ foreach ($this->extraFields as $extraName => $serverName) {
104
+ $extra[$extraName] = isset($this->serverData[$serverName]) ? $this->serverData[$serverName] : null;
105
+ }
106
+
107
+ if (isset($this->serverData['UNIQUE_ID'])) {
108
+ $extra['unique_id'] = $this->serverData['UNIQUE_ID'];
109
+ }
110
+
111
+ return $extra;
112
+ }
113
+ }
lib/vendor/monolog/monolog/src/Monolog/Registry.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ namespace Monolog;
13
+
14
+ use InvalidArgumentException;
15
+
16
+ /**
17
+ * Monolog log registry
18
+ *
19
+ * Allows to get `Logger` instances in the global scope
20
+ * via static method calls on this class.
21
+ *
22
+ * <code>
23
+ * $application = new Monolog\Logger('application');
24
+ * $api = new Monolog\Logger('api');
25
+ *
26
+ * Monolog\Registry::addLogger($application);
27
+ * Monolog\Registry::addLogger($api);
28
+ *
29
+ * function testLogger()
30
+ * {
31
+ * Monolog\Registry::api()->addError('Sent to $api Logger instance');
32
+ * Monolog\Registry::application()->addError('Sent to $application Logger instance');
33
+ * }
34
+ * </code>
35
+ *
36
+ * @author Tomas Tatarko <tomas@tatarko.sk>
37
+ */
38
+ class Registry
39
+ {
40
+ /**
41
+ * List of all loggers in the registry (by named indexes)
42
+ *
43
+ * @var Logger[]
44
+ */
45
+ private static $loggers = array();
46
+
47
+ /**
48
+ * Adds new logging channel to the registry
49
+ *
50
+ * @param Logger $logger Instance of the logging channel
51
+ * @param string|null $name Name of the logging channel ($logger->getName() by default)
52
+ * @param bool $overwrite Overwrite instance in the registry if the given name already exists?
53
+ * @throws \InvalidArgumentException If $overwrite set to false and named Logger instance already exists
54
+ */
55
+ public static function addLogger(Logger $logger, $name = null, $overwrite = false)
56
+ {
57
+ $name = $name ?: $logger->getName();
58
+
59
+ if (isset(self::$loggers[$name]) && !$overwrite) {
60
+ throw new InvalidArgumentException('Logger with the given name already exists');
61
+ }
62
+
63
+ self::$loggers[$name] = $logger;
64
+ }
65
+
66
+ /**
67
+ * Checks if such logging channel exists by name or instance
68
+ *
69
+ * @param string|Logger $logger Name or logger instance
70
+ */
71
+ public static function hasLogger($logger)
72
+ {
73
+ if ($logger instanceof Logger) {
74
+ $index = array_search($logger, self::$loggers, true);
75
+
76
+ return false !== $index;
77
+ } else {
78
+ return isset(self::$loggers[$logger]);
79
+ }
80
+ }
81
+
82
+ /**
83
+ * Removes instance from registry by name or instance
84
+ *
85
+ * @param string|Logger $logger Name or logger instance
86
+ */
87
+ public static function removeLogger($logger)
88
+ {
89
+ if ($logger instanceof Logger) {
90
+ if (false !== ($idx = array_search($logger, self::$loggers, true))) {
91
+ unset(self::$loggers[$idx]);
92
+ }
93
+ } else {
94
+ unset(self::$loggers[$logger]);
95
+ }
96
+ }
97
+
98
+ /**
99
+ * Clears the registry
100
+ */
101
+ public static function clear()
102
+ {
103
+ self::$loggers = array();
104
+ }
105
+
106
+ /**
107
+ * Gets Logger instance from the registry
108
+ *
109
+ * @param string $name Name of the requested Logger instance
110
+ * @throws \InvalidArgumentException If named Logger instance is not in the registry
111
+ * @return Logger Requested instance of Logger
112
+ */
113
+ public static function getInstance($name)
114
+ {
115
+ if (!isset(self::$loggers[$name])) {
116
+ throw new InvalidArgumentException(sprintf('Requested "%s" logger instance is not in the registry', $name));
117
+ }
118
+
119
+ return self::$loggers[$name];
120
+ }
121
+
122
+ /**
123
+ * Gets Logger instance from the registry via static method call
124
+ *
125
+ * @param string $name Name of the requested Logger instance
126
+ * @param array $arguments Arguments passed to static method call
127
+ * @throws \InvalidArgumentException If named Logger instance is not in the registry
128
+ * @return Logger Requested instance of Logger
129
+ */
130
+ public static function __callStatic($name, $arguments)
131
+ {
132
+ return self::getInstance($name);
133
+ }
134
+ }
lib/vendor/mrclay/jsmin-php/.editorconfig ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # top-most EditorConfig file
2
+ root = true
3
+
4
+ [*]
5
+ charset = utf-8
6
+ end_of_line = lf
7
+
8
+ ; temporary
9
+ trim_trailing_whitespace = false
10
+
11
+ [*.php]
12
+ indent_style = space
13
+ indent_size = 4
14
+ insert_final_newline = true
15
+
16
+ [vendor/**]
17
+ ; Use editor default (possible autodetection).
18
+ indent_style =
19
+ indent_size =
lib/vendor/mrclay/jsmin-php/HISTORY.txt ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ JSMin fixes (from Minify)
2
+
3
+ Version 2.3.0
4
+ * Removes leading UTF-8 BOM
5
+
6
+ Version 2.2.0
7
+ * Fix handling of RegEx in certain situations in JSMin
8
+ * Fix bug in JSMin exceptions
9
+
10
+ Version 2.1.6
11
+ * JSMin fixes
12
+
13
+ Version 2.1.4
14
+ * JSMin won't choke on common Closure compiler syntaxes (i+ ++j)
15
+ * mbstring.func_overload usage is safer
16
+
17
+ Version 2.1.2
18
+ * quote characters inside RegExp literals no longer cause exception
19
+
20
+ Version 2.1.0
21
+ * JS: preserves IE conditional comments
22
+
23
+ Version 1.0.1 (2007-05-05)
24
+ * Replaced old JSMin library with a much faster custom implementation.
lib/vendor/mrclay/jsmin-php/LICENSE.txt ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2008 Ryan Grove <ryan@wonko.com>
2
+ Copyright (c) 2008 Steve Clay <steve@mrclay.org>
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ * Redistributions of source code must retain the above copyright notice,
9
+ this list of conditions and the following disclaimer.
10
+ * Redistributions in binary form must reproduce the above copyright notice,
11
+ this list of conditions and the following disclaimer in the documentation
12
+ and/or other materials provided with the distribution.
13
+ * Neither the name of this project nor the names of its contributors may be
14
+ used to endorse or promote products derived from this software without
15
+ specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
21
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
lib/vendor/mrclay/jsmin-php/src/JSMin/JSMin.php ADDED
@@ -0,0 +1,454 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace JSMin;
4
+
5
+ /**
6
+ * JSMin.php - modified PHP implementation of Douglas Crockford's JSMin.
7
+ *
8
+ * <code>
9
+ * $minifiedJs = JSMin::minify($js);
10
+ * </code>
11
+ *
12
+ * This is a modified port of jsmin.c. Improvements:
13
+ *
14
+ * Does not choke on some regexp literals containing quote characters. E.g. /'/
15
+ *
16
+ * Spaces are preserved after some add/sub operators, so they are not mistakenly
17
+ * converted to post-inc/dec. E.g. a + ++b -> a+ ++b
18
+ *
19
+ * Preserves multi-line comments that begin with /*!
20
+ *
21
+ * PHP 5 or higher is required.
22
+ *
23
+ * Permission is hereby granted to use this version of the library under the
24
+ * same terms as jsmin.c, which has the following license:
25
+ *
26
+ * --
27
+ * Copyright (c) 2002 Douglas Crockford (www.crockford.com)
28
+ *
29
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
30
+ * this software and associated documentation files (the "Software"), to deal in
31
+ * the Software without restriction, including without limitation the rights to
32
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
33
+ * of the Software, and to permit persons to whom the Software is furnished to do
34
+ * so, subject to the following conditions:
35
+ *
36
+ * The above copyright notice and this permission notice shall be included in all
37
+ * copies or substantial portions of the Software.
38
+ *
39
+ * The Software shall be used for Good, not Evil.
40
+ *
41
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
44
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
46
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
47
+ * SOFTWARE.
48
+ * --
49
+ *
50
+ * @package JSMin
51
+ * @author Ryan Grove <ryan@wonko.com> (PHP port)
52
+ * @author Steve Clay <steve@mrclay.org> (modifications + cleanup)
53
+ * @author Andrea Giammarchi <http://www.3site.eu> (spaceBeforeRegExp)
54
+ * @copyright 2002 Douglas Crockford <douglas@crockford.com> (jsmin.c)
55
+ * @copyright 2008 Ryan Grove <ryan@wonko.com> (PHP port)
56
+ * @license http://opensource.org/licenses/mit-license.php MIT License
57
+ * @link http://code.google.com/p/jsmin-php/
58
+ */
59
+ class JSMin {
60
+ const ORD_LF = 10;
61
+ const ORD_SPACE = 32;
62
+ const ACTION_KEEP_A = 1;
63
+ const ACTION_DELETE_A = 2;
64
+ const ACTION_DELETE_A_B = 3;
65
+
66
+ protected $a = "\n";
67
+ protected $b = '';
68
+ protected $input = '';
69
+ protected $inputIndex = 0;
70
+ protected $inputLength = 0;
71
+ protected $lookAhead = null;
72
+ protected $output = '';
73
+ protected $lastByteOut = '';
74
+ protected $keptComment = '';
75
+
76
+ /**
77
+ * Minify Javascript.
78
+ *
79
+ * @param string $js Javascript to be minified
80
+ *
81
+ * @return string
82
+ */
83
+ public static function minify($js)
84
+ {
85
+ $jsmin = new JSMin($js);
86
+ return $jsmin->min();
87
+ }
88
+
89
+ /**
90
+ * @param string $input
91
+ */
92
+ public function __construct($input)
93
+ {
94
+ $this->input = $input;
95
+ }
96
+
97
+ /**
98
+ * Perform minification, return result
99
+ *
100
+ * @return string
101
+ */
102
+ public function min()
103
+ {
104
+ if ($this->output !== '') { // min already run
105
+ return $this->output;
106
+ }
107
+
108
+ $mbIntEnc = null;
109
+ if (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)) {
110
+ $mbIntEnc = mb_internal_encoding();
111
+ mb_internal_encoding('8bit');
112
+ }
113
+
114
+ if (isset($this->input[0]) && $this->input[0] === "\xef") {
115
+ $this->input = substr($this->input, 3);
116
+ }
117
+
118
+ $this->input = str_replace("\r\n", "\n", $this->input);
119
+ $this->inputLength = strlen($this->input);
120
+
121
+ $this->action(self::ACTION_DELETE_A_B);
122
+
123
+ while ($this->a !== null) {
124
+ // determine next command
125
+ $command = self::ACTION_KEEP_A; // default
126
+ if ($this->a === ' ') {
127
+ if (($this->lastByteOut === '+' || $this->lastByteOut === '-')
128
+ && ($this->b === $this->lastByteOut)) {
129
+ // Don't delete this space. If we do, the addition/subtraction
130
+ // could be parsed as a post-increment
131
+ } elseif (! $this->isAlphaNum($this->b)) {
132
+ $command = self::ACTION_DELETE_A;
133
+ }
134
+ } elseif ($this->a === "\n") {
135
+ if ($this->b === ' ') {
136
+ $command = self::ACTION_DELETE_A_B;
137
+
138
+ // in case of mbstring.func_overload & 2, must check for null b,
139
+ // otherwise mb_strpos will give WARNING
140
+ } elseif ($this->b === null
141
+ || (false === strpos('{[(+-!~', $this->b)
142
+ && ! $this->isAlphaNum($this->b))) {
143
+ $command = self::ACTION_DELETE_A;
144
+ }
145
+ } elseif (! $this->isAlphaNum($this->a)) {
146
+ if ($this->b === ' '
147
+ || ($this->b === "\n"
148
+ && (false === strpos('}])+-"\'', $this->a)))) {
149
+ $command = self::ACTION_DELETE_A_B;
150
+ }
151
+ }
152
+ $this->action($command);
153
+ }
154
+ $this->output = trim($this->output);
155
+
156
+ if ($mbIntEnc !== null) {
157
+ mb_internal_encoding($mbIntEnc);
158
+ }
159
+ return $this->output;
160
+ }
161
+
162
+ /**
163
+ * ACTION_KEEP_A = Output A. Copy B to A. Get the next B.
164
+ * ACTION_DELETE_A = Copy B to A. Get the next B.
165
+ * ACTION_DELETE_A_B = Get the next B.
166
+ *
167
+ * @param int $command
168
+ * @throws UnterminatedRegExpException|UnterminatedStringException
169
+ */
170
+ protected function action($command)
171
+ {
172
+ // make sure we don't compress "a + ++b" to "a+++b", etc.
173
+ if ($command === self::ACTION_DELETE_A_B
174
+ && $this->b === ' '
175
+ && ($this->a === '+' || $this->a === '-')) {
176
+ // Note: we're at an addition/substraction operator; the inputIndex
177
+ // will certainly be a valid index
178
+ if ($this->input[$this->inputIndex] === $this->a) {
179
+ // This is "+ +" or "- -". Don't delete the space.
180
+ $command = self::ACTION_KEEP_A;
181
+ }
182
+ }
183
+
184
+ switch ($command) {
185
+ case self::ACTION_KEEP_A: // 1
186
+ $this->output .= $this->a;
187
+
188
+ if ($this->keptComment) {
189
+ $this->output = rtrim($this->output, "\n");
190
+ $this->output .= $this->keptComment;
191
+ $this->keptComment = '';
192
+ }
193
+
194
+ $this->lastByteOut = $this->a;
195
+
196
+ // fallthrough intentional
197
+ case self::ACTION_DELETE_A: // 2
198
+ $this->a = $this->b;
199
+ if ($this->a === "'" || $this->a === '"') { // string literal
200
+ $str = $this->a; // in case needed for exception
201
+ for(;;) {
202
+ $this->output .= $this->a;
203
+ $this->lastByteOut = $this->a;
204
+
205
+ $this->a = $this->get();
206
+ if ($this->a === $this->b) { // end quote
207
+ break;
208
+ }
209
+ if ($this->isEOF($this->a)) {
210
+ $byte = $this->inputIndex - 1;
211
+ throw new UnterminatedStringException(
212
+ "JSMin: Unterminated String at byte {$byte}: {$str}");
213
+ }
214
+ $str .= $this->a;
215
+ if ($this->a === '\\') {
216
+ $this->output .= $this->a;
217
+ $this->lastByteOut = $this->a;
218
+
219
+ $this->a = $this->get();
220
+ $str .= $this->a;
221
+ }
222
+ }
223
+ }
224
+
225
+ // fallthrough intentional
226
+ case self::ACTION_DELETE_A_B: // 3
227
+ $this->b = $this->next();
228
+ if ($this->b === '/' && $this->isRegexpLiteral()) {
229
+ $this->output .= $this->a . $this->b;
230
+ $pattern = '/'; // keep entire pattern in case we need to report it in the exception
231
+ for(;;) {
232
+ $this->a = $this->get();
233
+ $pattern .= $this->a;
234
+ if ($this->a === '[') {
235
+ for(;;) {
236
+ $this->output .= $this->a;
237
+ $this->a = $this->get();
238
+ $pattern .= $this->a;
239
+ if ($this->a === ']') {
240
+ break;
241
+ }
242
+ if ($this->a === '\\') {
243
+ $this->output .= $this->a;
244
+ $this->a = $this->get();
245
+ $pattern .= $this->a;
246
+ }
247
+ if ($this->isEOF($this->a)) {
248
+ throw new UnterminatedRegExpException(
249
+ "JSMin: Unterminated set in RegExp at byte "
250
+ . $this->inputIndex .": {$pattern}");
251
+ }
252
+ }
253
+ }
254
+
255
+ if ($this->a === '/') { // end pattern
256
+ break; // while (true)
257
+ } elseif ($this->a === '\\') {
258
+ $this->output .= $this->a;
259
+ $this->a = $this->get();
260
+ $pattern .= $this->a;
261
+ } elseif ($this->isEOF($this->a)) {
262
+ $byte = $this->inputIndex - 1;
263
+ throw new UnterminatedRegExpException(
264
+ "JSMin: Unterminated RegExp at byte {$byte}: {$pattern}");
265
+ }
266
+ $this->output .= $this->a;
267
+ $this->lastByteOut = $this->a;
268
+ }
269
+ $this->b = $this->next();
270
+ }
271
+ // end case ACTION_DELETE_A_B
272
+ }
273
+ }
274
+
275
+ /**
276
+ * @return bool
277
+ */
278
+ protected function isRegexpLiteral()
279
+ {
280
+ if (false !== strpos("(,=:[!&|?+-~*{;", $this->a)) {
281
+ // we can't divide after these tokens
282
+ return true;
283
+ }
284
+
285
+ // check if first non-ws token is "/" (see starts-regex.js)
286
+ $length = strlen($this->output);
287
+ if ($this->a === ' ' || $this->a === "\n") {
288
+ if ($length < 2) { // weird edge case
289
+ return true;
290
+ }
291
+ }
292
+
293
+ // if the "/" follows a keyword, it must be a regexp, otherwise it's best to assume division
294
+
295
+ $subject = $this->output . trim($this->a);
296
+ if (!preg_match('/(?:case|else|in|return|typeof)$/', $subject, $m)) {
297
+ // not a keyword
298
+ return false;
299
+ }
300
+
301
+ // can't be sure it's a keyword yet (see not-regexp.js)
302
+ $charBeforeKeyword = substr($subject, 0 - strlen($m[0]) - 1, 1);
303
+ if ($this->isAlphaNum($charBeforeKeyword)) {
304
+ // this is really an identifier ending in a keyword, e.g. "xreturn"
305
+ return false;
306
+ }
307
+
308
+ // it's a regexp. Remove unneeded whitespace after keyword
309
+ if ($this->a === ' ' || $this->a === "\n") {
310
+ $this->a = '';
311
+ }
312
+
313
+ return true;
314
+ }
315
+
316
+ /**
317
+ * Return the next character from stdin. Watch out for lookahead. If the character is a control character,
318
+ * translate it to a space or linefeed.
319
+ *
320
+ * @return string
321
+ */
322
+ protected function get()
323
+ {
324
+ $c = $this->lookAhead;
325
+ $this->lookAhead = null;
326
+ if ($c === null) {
327
+ // getc(stdin)
328
+ if ($this->inputIndex < $this->inputLength) {
329
+ $c = $this->input[$this->inputIndex];
330
+ $this->inputIndex += 1;
331
+ } else {
332
+ $c = null;
333
+ }
334
+ }
335
+ if (ord($c) >= self::ORD_SPACE || $c === "\n" || $c === null) {
336
+ return $c;
337
+ }
338
+ if ($c === "\r") {
339
+ return "\n";
340
+ }
341
+ return ' ';
342
+ }
343
+
344
+ /**
345
+ * Does $a indicate end of input?
346
+ *
347
+ * @param string $a
348
+ * @return bool
349
+ */
350
+ protected function isEOF($a)
351
+ {
352
+ return ord($a) <= self::ORD_LF;
353
+ }
354
+
355
+ /**
356
+ * Get next char (without getting it). If is ctrl character, translate to a space or newline.
357
+ *
358
+ * @return string
359
+ */
360
+ protected function peek()
361
+ {
362
+ $this->lookAhead = $this->get();
363
+ return $this->lookAhead;
364
+ }
365
+
366
+ /**
367
+ * Return true if the character is a letter, digit, underscore, dollar sign, or non-ASCII character.
368
+ *
369
+ * @param string $c
370
+ *
371
+ * @return bool
372
+ */
373
+ protected function isAlphaNum($c)
374
+ {
375
+ return (preg_match('/^[a-z0-9A-Z_\\$\\\\]$/', $c) || ord($c) > 126);
376
+ }
377
+
378
+ /**
379
+ * Consume a single line comment from input (possibly retaining it)
380
+ */
381
+ protected function consumeSingleLineComment()
382
+ {
383
+ $comment = '';
384
+ while (true) {
385
+ $get = $this->get();
386
+ $comment .= $get;
387
+ if (ord($get) <= self::ORD_LF) { // end of line reached
388
+ // if IE conditional comment
389
+ if (preg_match('/^\\/@(?:cc_on|if|elif|else|end)\\b/', $comment)) {
390
+ $this->keptComment .= "/{$comment}";
391
+ }
392
+ return;
393
+ }
394
+ }
395
+ }
396
+
397
+ /**
398
+ * Consume a multiple line comment from input (possibly retaining it)
399
+ *
400
+ * @throws UnterminatedCommentException
401
+ */
402
+ protected function consumeMultipleLineComment()
403
+ {
404
+ $this->get();
405
+ $comment = '';
406
+ for(;;) {
407
+ $get = $this->get();
408
+ if ($get === '*') {
409
+ if ($this->peek() === '/') { // end of comment reached
410
+ $this->get();
411
+ if (0 === strpos($comment, '!')) {
412
+ // preserved by YUI Compressor
413
+ if (!$this->keptComment) {
414
+ // don't prepend a newline if two comments right after one another
415
+ $this->keptComment = "\n";
416
+ }
417
+ $this->keptComment .= "/*!" . substr($comment, 1) . "*/\n";
418
+ } else if (preg_match('/^@(?:cc_on|if|elif|else|end)\\b/', $comment)) {
419
+ // IE conditional
420
+ $this->keptComment .= "/*{$comment}*/";
421
+ }
422
+ return;
423
+ }
424
+ } elseif ($get === null) {
425
+ throw new UnterminatedCommentException(
426
+ "JSMin: Unterminated comment at byte {$this->inputIndex}: /*{$comment}");
427
+ }
428
+ $comment .= $get;
429
+ }
430
+ }
431
+
432
+ /**
433
+ * Get the next character, skipping over comments. Some comments may be preserved.
434
+ *
435
+ * @return string
436
+ */
437
+ protected function next()
438
+ {
439
+ $get = $this->get();
440
+ if ($get === '/') {
441
+ switch ($this->peek()) {
442
+ case '/':
443
+ $this->consumeSingleLineComment();
444
+ $get = "\n";
445
+ break;
446
+ case '*':
447
+ $this->consumeMultipleLineComment();
448
+ $get = ' ';
449
+ break;
450
+ }
451
+ }
452
+ return $get;
453
+ }
454
+ }
lib/vendor/mrclay/jsmin-php/src/JSMin/UnterminatedCommentException.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace JSMin;
4
+
5
+ class UnterminatedCommentException extends \Exception {
6
+ }
lib/vendor/mrclay/jsmin-php/src/JSMin/UnterminatedRegExpException.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace JSMin;
4
+
5
+ class UnterminatedRegExpException extends \Exception {
6
+ }
lib/vendor/mrclay/jsmin-php/src/JSMin/UnterminatedStringException.php ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace JSMin;
4
+
5
+ class UnterminatedStringException extends \Exception {
6
+ }
lib/vendor/mrclay/minify/.htaccess ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <IfModule mod_rewrite.c>
2
+ RewriteEngine on
3
+
4
+ # You may need RewriteBase on some servers
5
+ #RewriteBase /min
6
+
7
+ # rewrite URLs like "/min/f=..." to "/min/?f=..."
8
+ RewriteRule ^([bfg]=.*) index.php?$1 [L,NE]
9
+ </IfModule>
10
+ <IfModule mod_env.c>
11
+ # In case AddOutputFilterByType has been added
12
+ SetEnv no-gzip
13
+ </IfModule>
lib/vendor/mrclay/minify/.php_cs ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $finder = Symfony\CS\Finder\DefaultFinder::create()
4
+ ->in(__DIR__ . '/lib')
5
+ ;
6
+
7
+ return Symfony\CS\Config\Config::create()
8
+ ->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
9
+ ->setUsingCache(true)
10
+ ->fixers(array(
11
+ 'linefeed',
12
+ 'trailing_spaces',
13
+ 'unused_use',
14
+ 'short_tag',
15
+ 'return',
16
+ 'visibility',
17
+ 'php_closing_tag',
18
+ 'extra_empty_lines',
19
+ 'function_declaration',
20
+ 'include',
21
+ 'controls_spaces',
22
+ 'elseif',
23
+ '-eof_ending',
24
+ '-method_argument_space',
25
+ ))
26
+ ->finder($finder)
27
+ ;
lib/vendor/mrclay/minify/.travis.yml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ language: php
2
+ sudo: false
3
+
4
+ php:
5
+ - 7.0
6
+ - 5.6
7
+ - 5.5
8
+ - 5.4
9
+ - hhvm
10
+
11
+ env:
12
+ - CLOSURE_VERSION: 20161024
13
+
14
+ matrix:
15
+ allow_failures:
16
+ - php: hhvm
17
+ - php: 7.0
18
+
19
+ services:
20
+ - memcached
21
+
22
+ cache:
23
+ directories:
24
+ - $HOME/.composer/cache
25
+ - vendor
26
+
27
+ install:
28
+ - composer update --no-interaction --prefer-source
29
+
30
+ before_script:
31
+ - tests/dl-closure.sh
32
+
33
+ script:
34
+ - composer validate
35
+ - phpunit --verbose
36
+
37
+ # vim:ts=2:sw=2:et
lib/vendor/mrclay/minify/LICENSE.txt ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2008 Ryan Grove <ryan@wonko.com>
2
+ Copyright (c) 2008 Steve Clay <steve@mrclay.org>
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ * Redistributions of source code must retain the above copyright notice,
9
+ this list of conditions and the following disclaimer.
10
+ * Redistributions in binary form must reproduce the above copyright notice,
11
+ this list of conditions and the following disclaimer in the documentation
12
+ and/or other materials provided with the distribution.
13
+ * Neither the name of this project nor the names of its contributors may be
14
+ used to endorse or promote products derived from this software without
15
+ specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
21
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
lib/vendor/mrclay/minify/bootstrap.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Sets up autoloading and returns the Minify\App
4
+ */
5
+
6
+ call_user_func(function () {
7
+ if (is_dir(__DIR__ . '/../../../vendor')) {
8
+ // Used as a composer library
9
+ $vendorDir = __DIR__ . '/../../../vendor';
10
+ } else {
11
+ $vendorDir = __DIR__ . '/vendor';
12
+ }
13
+
14
+ $file = $vendorDir . '/autoload.php';
15
+ if (!is_file($file)) {
16
+ echo 'You must set up the project dependencies, run the following commands:'.PHP_EOL.
17
+ 'curl -sS https://getcomposer.org/installer | php'.PHP_EOL.
18
+ 'php composer.phar install'.PHP_EOL;
19
+ exit(1);
20
+ }
21
+
22
+ require $file;
23
+ });
24
+
25
+ return new \Minify\App(__DIR__);
lib/vendor/mrclay/minify/config-test.php ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Additional configuration applied when the variable "test" is added to the querystring.
4
+ *
5
+ * To test config options, place them in this file and add "&test" to your Minify URL.
6
+ * Note that if this is on a public server, anyone can execute your test.
7
+ *
8
+ * @package Minify
9
+ */
10
+
lib/vendor/mrclay/minify/config.php ADDED
@@ -0,0 +1,201 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Configuration for "min", the default application built with the Minify
4
+ * library
5
+ *
6
+ * @package Minify
7
+ */
8
+
9
+
10
+ /**
11
+ * Enable the static serving feature
12
+ */
13
+ $min_enableStatic = false;
14
+
15
+
16
+ /**
17
+ * Allow use of the Minify URI Builder app. Only set this to true while you need it.
18
+ */
19
+ $min_enableBuilder = false;
20
+
21
+
22
+ /**
23
+ * Concatenate but do not minify the files. This can be used for testing.
24
+ */
25
+ $min_concatOnly = false;
26
+
27
+
28
+ /**
29
+ * If non-empty, the Builder will be protected with HTTP Digest auth.
30
+ * The username is "admin".
31
+ */
32
+ $min_builderPassword = 'admin';
33
+
34
+
35
+ /**
36
+ * Set to true to log messages to FirePHP (Firefox Firebug addon) and PHP's error_log
37
+ * Set to false for no error logging (Minify may be slightly faster).
38
+ */
39
+ $min_errorLogger = false;
40
+
41
+
42
+ /**
43
+ * To allow debug mode output, you must set this option to true.
44
+ *
45
+ * Once true, you can send the cookie minDebug to request debug mode output. The
46
+ * cookie value should match the URIs you'd like to debug. E.g. to debug
47
+ * /min/f=file1.js send the cookie minDebug=file1.js
48
+ * You can manually enable debugging by appending "&debug" to a URI.
49
+ * E.g. /min/?f=script1.js,script2.js&debug
50
+ *
51
+ * In 'debug' mode, Minify combines files with no minification and adds comments
52
+ * to indicate line #s of the original files.
53
+ */
54
+ $min_allowDebugFlag = false;
55
+
56
+
57
+ /**
58
+ * For best performance, specify your temp directory here. Otherwise Minify
59
+ * will have to load extra code to guess. Some examples below:
60
+ */
61
+ //$min_cachePath = 'c:\\WINDOWS\\Temp';
62
+ //$min_cachePath = '/tmp';
63
+ //$min_cachePath = preg_replace('/^\\d+;/', '', session_save_path());
64
+
65
+
66
+ /**
67
+ * To use APC/Memcache/ZendPlatform for cache storage, require the class and
68
+ * set $min_cachePath to an instance. Example below:
69
+ */
70
+ //$min_cachePath = new Minify_Cache_APC();
71
+
72
+
73
+ /**
74
+ * Leave an empty string to use PHP's $_SERVER['DOCUMENT_ROOT'].
75
+ *
76
+ * On some servers, this value may be misconfigured or missing. If so, set this
77
+ * to your full document root path with no trailing slash.
78
+ * E.g. '/home/accountname/public_html' or 'c:\\xampp\\htdocs'
79
+ *
80
+ * If /min/ is directly inside your document root, just uncomment the
81
+ * second line. The third line might work on some Apache servers.
82
+ */
83
+ $min_documentRoot = '';
84
+ //$min_documentRoot = dirname(dirname(__DIR__));
85
+ //$min_documentRoot = substr(__FILE__, 0, -15);
86
+ //$min_documentRoot = $_SERVER['SUBDOMAIN_DOCUMENT_ROOT'];
87
+
88
+
89
+ /**
90
+ * Cache file locking. Set to false if filesystem is NFS. On at least one
91
+ * NFS system flock-ing attempts stalled PHP for 30 seconds!
92
+ */
93
+ $min_cacheFileLocking = true;
94
+
95
+
96
+ /**
97
+ * Combining multiple CSS files can place @import declarations after rules, which
98
+ * is invalid. Minify will attempt to detect when this happens and place a
99
+ * warning comment at the top of the CSS output. To resolve this you can either
100
+ * move the @imports within your CSS files, or enable this option, which will
101
+ * move all @imports to the top of the output. Note that moving @imports could
102
+ * affect CSS values (which is why this option is disabled by default).
103
+ */
104
+ $min_serveOptions['bubbleCssImports'] = false;
105
+
106
+
107
+ /**
108
+ * Cache-Control: max-age value sent to browser (in seconds). After this period,
109
+ * the browser will send another conditional GET. Use a longer period for lower
110
+ * traffic but you may want to shorten this before making changes if it's crucial
111
+ * those changes are seen immediately.
112
+ *
113
+ * Note: Despite this setting, if you include a number at the end of the
114
+ * querystring, maxAge will be set to one year. E.g. /min/f=hello.css&123456
115
+ */
116
+ $min_serveOptions['maxAge'] = 1800;
117
+
118
+
119
+ /**
120
+ * To use the CSS compressor that shipped with 2.x, uncomment the following line:
121
+ */
122
+ //$min_serveOptions['minifiers'][Minify::TYPE_CSS] = array('Minify_CSS', 'minify');
123
+
124
+
125
+ /**
126
+ * To use Google's Closure Compiler API to minify Javascript (falling back to JSMin
127
+ * on failure), uncomment the following line:
128
+ */
129
+ //$min_serveOptions['minifiers']['application/x-javascript'] = array('Minify_JS_ClosureCompiler', 'minify');
130
+
131
+
132
+ /**
133
+ * If you'd like to restrict the "f" option to files within/below
134
+ * particular directories below DOCUMENT_ROOT, set this here.
135
+ * You will still need to include the directory in the
136
+ * f or b GET parameters.
137
+ *
138
+ * // = shortcut for DOCUMENT_ROOT
139
+ */
140
+ //$min_serveOptions['minApp']['allowDirs'] = array('//js', '//css');
141
+
142
+ /**
143
+ * Set to true to disable the "f" GET parameter for specifying files.
144
+ * Only the "g" parameter will be considered.
145
+ */
146
+ $min_serveOptions['minApp']['groupsOnly'] = false;
147
+
148
+
149
+ /**
150
+ * By default, Minify will not minify files with names containing .min or -min
151
+ * before the extension. E.g. myFile.min.js will not be processed by JSMin
152
+ *
153
+ * To minify all files, set this option to null. You could also specify your
154
+ * own pattern that is matched against the filename.
155
+ */
156
+ //$min_serveOptions['minApp']['noMinPattern'] = '@[-\\.]min\\.(?:js|css)$@i';
157
+
158
+
159
+ /**
160
+ * If you minify CSS files stored in symlink-ed directories, the URI rewriting
161
+ * algorithm can fail. To prevent this, provide an array of link paths to
162
+ * target paths, where the link paths are within the document root.
163
+ *
164
+ * Because paths need to be normalized for this to work, use "//" to substitute
165
+ * the doc root in the link paths (the array keys). E.g.:
166
+ * <code>
167
+ * array('//symlink' => '/real/target/path') // unix
168
+ * array('//static' => 'D:\\staticStorage') // Windows
169
+ * </code>
170
+ */
171
+ $min_symlinks = array();
172
+
173
+
174
+ /**
175
+ * If you upload files from Windows to a non-Windows server, Windows may report
176
+ * incorrect mtimes for the files. This may cause Minify to keep serving stale
177
+ * cache files when source file changes are made too frequently (e.g. more than
178
+ * once an hour).
179
+ *
180
+ * Immediately after modifying and uploading a file, use the touch command to
181
+ * update the mtime on the server. If the mtime jumps ahead by a number of hours,
182
+ * set this variable to that number. If the mtime moves back, this should not be
183
+ * needed.
184
+ *
185
+ * In the Windows SFTP client WinSCP, there's an option that may fix this
186
+ * issue without changing the variable below. Under login > environment,
187
+ * select the option "Adjust remote timestamp with DST".
188
+ * @link http://winscp.net/eng/docs/ui_login_environment#daylight_saving_time
189
+ */
190
+ $min_uploaderHoursBehind = 0;
191
+
192
+
193
+ /**
194
+ * Advanced: you can replace some of the PHP classes Minify uses to serve requests.
195
+ * To do this, assign a callable to one of the elements of the $min_factories array.
196
+ *
197
+ * You can see the default implementations (and what gets passed in) in index.php.
198
+ */
199
+ //$min_factories['minify'] = ... a callable accepting a Minify\App object
200
+ //$min_factories['controller'] = ... a callable accepting a Minify\App object
201
+
lib/vendor/mrclay/minify/groupsConfig.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Groups configuration for default Minify implementation
4
+ * @package Minify
5
+ */
6
+
7
+ /**
8
+ * You may wish to use the Minify URI Builder app to suggest
9
+ * changes. http://yourdomain/min/builder/
10
+ *
11
+ * See https://github.com/mrclay/minify/blob/master/docs/CustomServer.wiki.md for other ideas
12
+ **/
13
+
14
+ return array(
15
+ // 'testJs' => array('//minify/quick-test.js'),
16
+ // 'testCss' => array('//minify/quick-test.css'),
17
+ // 'js' => array('//js/file1.js', '//js/file2.js'),
18
+ // 'css' => array('//css/file1.css', '//css/file2.css'),
19
+ );
lib/vendor/mrclay/minify/lib/HTTP/ConditionalGet.php ADDED
@@ -0,0 +1,376 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class HTTP_ConditionalGet
4
+ * @package Minify
5
+ * @subpackage HTTP
6
+ */
7
+
8
+ /**
9
+ * Implement conditional GET via a timestamp or hash of content
10
+ *
11
+ * E.g. Content from DB with update time:
12
+ * <code>
13
+ * list($updateTime, $content) = getDbUpdateAndContent();
14
+ * $cg = new HTTP_ConditionalGet(array(
15
+ * 'lastModifiedTime' => $updateTime
16
+ * ,'isPublic' => true
17
+ * ));
18
+ * $cg->sendHeaders();
19
+ * if ($cg->cacheIsValid) {
20
+ * exit();
21
+ * }
22
+ * echo $content;
23
+ * </code>
24
+ *
25
+ * E.g. Shortcut for the above
26
+ * <code>
27
+ * HTTP_ConditionalGet::check($updateTime, true); // exits if client has cache
28
+ * echo $content;
29
+ * </code>
30
+ *
31
+ * E.g. Content from DB with no update time:
32
+ * <code>
33
+ * $content = getContentFromDB();
34
+ * $cg = new HTTP_ConditionalGet(array(
35
+ * 'contentHash' => md5($content)
36
+ * ));
37
+ * $cg->sendHeaders();
38
+ * if ($cg->cacheIsValid) {
39
+ * exit();
40
+ * }
41
+ * echo $content;
42
+ * </code>
43
+ *
44
+ * E.g. Static content with some static includes:
45
+ * <code>
46
+ * // before content
47
+ * $cg = new HTTP_ConditionalGet(array(
48
+ * 'lastUpdateTime' => max(
49
+ * filemtime(__FILE__)
50
+ * ,filemtime('/path/to/header.inc')
51
+ * ,filemtime('/path/to/footer.inc')
52
+ * )
53
+ * ));
54
+ * $cg->sendHeaders();
55
+ * if ($cg->cacheIsValid) {
56
+ * exit();
57
+ * }
58
+ * </code>
59
+ * @package Minify
60
+ * @subpackage HTTP
61
+ * @author Stephen Clay <steve@mrclay.org>
62
+ */
63
+ class HTTP_ConditionalGet
64
+ {
65
+
66
+ /**
67
+ * Does the client have a valid copy of the requested resource?
68
+ *
69
+ * You'll want to check this after instantiating the object. If true, do
70
+ * not send content, just call sendHeaders() if you haven't already.
71
+ *
72
+ * @var bool
73
+ */
74
+ public $cacheIsValid = null;
75
+
76
+ /**
77
+ * @param array $spec options
78
+ *
79
+ * 'isPublic': (bool) if false, the Cache-Control header will contain
80
+ * "private", allowing only browser caching. (default false)
81
+ *
82
+ * 'lastModifiedTime': (int) if given, both ETag AND Last-Modified headers
83
+ * will be sent with content. This is recommended.
84
+ *
85
+ * 'encoding': (string) if set, the header "Vary: Accept-Encoding" will
86
+ * always be sent and a truncated version of the encoding will be appended
87
+ * to the ETag. E.g. "pub123456;gz". This will also trigger a more lenient
88
+ * checking of the client's If-None-Match header, as the encoding portion of
89
+ * the ETag will be stripped before comparison.
90
+ *
91
+ * 'contentHash': (string) if given, only the ETag header can be sent with
92
+ * content (only HTTP1.1 clients can conditionally GET). The given string
93
+ * should be short with no quote characters and always change when the
94
+ * resource changes (recommend md5()). This is not needed/used if
95
+ * lastModifiedTime is given.
96
+ *
97
+ * 'eTag': (string) if given, this will be used as the ETag header rather
98
+ * than values based on lastModifiedTime or contentHash. Also the encoding
99
+ * string will not be appended to the given value as described above.
100
+ *
101
+ * 'invalidate': (bool) if true, the client cache will be considered invalid
102
+ * without testing. Effectively this disables conditional GET.
103
+ * (default false)
104
+ *
105
+ * 'maxAge': (int) if given, this will set the Cache-Control max-age in
106
+ * seconds, and also set the Expires header to the equivalent GMT date.
107
+ * After the max-age period has passed, the browser will again send a
108
+ * conditional GET to revalidate its cache.
109
+ */
110
+ public function __construct($spec)
111
+ {
112
+ $scope = (isset($spec['isPublic']) && $spec['isPublic'])
113
+ ? 'public'
114
+ : 'private';
115
+ $maxAge = 0;
116
+ // backwards compatibility (can be removed later)
117
+ if (isset($spec['setExpires'])
118
+ && is_numeric($spec['setExpires'])
119
+ && ! isset($spec['maxAge'])) {
120
+ $spec['maxAge'] = $spec['setExpires'] - $_SERVER['REQUEST_TIME'];
121
+ }
122
+ if (isset($spec['maxAge'])) {
123
+ $maxAge = $spec['maxAge'];
124
+ $this->_headers['Expires'] = self::gmtDate(
125
+ $_SERVER['REQUEST_TIME'] + $spec['maxAge']
126
+ );
127
+ }
128
+ $etagAppend = '';
129
+ if (isset($spec['encoding'])) {
130
+ $this->_stripEtag = true;
131
+ $this->_headers['Vary'] = 'Accept-Encoding';
132
+ if ('' !== $spec['encoding']) {
133
+ if (0 === strpos($spec['encoding'], 'x-')) {
134
+ $spec['encoding'] = substr($spec['encoding'], 2);
135
+ }
136
+ $etagAppend = ';' . substr($spec['encoding'], 0, 2);
137
+ }
138
+ }
139
+ if (isset($spec['lastModifiedTime'])) {
140
+ $this->_setLastModified($spec['lastModifiedTime']);
141
+ if (isset($spec['eTag'])) { // Use it
142
+ $this->_setEtag($spec['eTag'], $scope);
143
+ } else { // base both headers on time
144
+ $this->_setEtag($spec['lastModifiedTime'] . $etagAppend, $scope);
145
+ }
146
+ } elseif (isset($spec['eTag'])) { // Use it
147
+ $this->_setEtag($spec['eTag'], $scope);
148
+ } elseif (isset($spec['contentHash'])) { // Use the hash as the ETag
149
+ $this->_setEtag($spec['contentHash'] . $etagAppend, $scope);
150
+ }
151
+ $privacy = ($scope === 'private')
152
+ ? ', private'
153
+ : '';
154
+ $this->_headers['Cache-Control'] = "max-age={$maxAge}{$privacy}";
155
+ // invalidate cache if disabled, otherwise check
156
+ $this->cacheIsValid = (isset($spec['invalidate']) && $spec['invalidate'])
157
+ ? false
158
+ : $this->_isCacheValid();
159
+ }
160
+
161
+ /**
162
+ * Get array of output headers to be sent
163
+ *
164
+ * In the case of 304 responses, this array will only contain the response
165
+ * code header: array('_responseCode' => 'HTTP/1.0 304 Not Modified')
166
+ *
167
+ * Otherwise something like:
168
+ * <code>
169
+ * array(
170
+ * 'Cache-Control' => 'max-age=0, public'
171
+ * ,'ETag' => '"foobar"'
172
+ * )
173
+ * </code>
174
+ *
175
+ * @return array
176
+ */
177
+ public function getHeaders()
178
+ {
179
+ return $this->_headers;
180
+ }
181
+
182
+ /**
183
+ * Set the Content-Length header in bytes
184
+ *
185
+ * With most PHP configs, as long as you don't flush() output, this method
186
+ * is not needed and PHP will buffer all output and set Content-Length for
187
+ * you. Otherwise you'll want to call this to let the client know up front.
188
+ *
189
+ * @param int $bytes
190
+ *
191
+ * @return int copy of input $bytes
192
+ */
193
+ public function setContentLength($bytes)
194
+ {
195
+ return $this->_headers['Content-Length'] = $bytes;
196
+ }
197
+
198
+ /**
199
+ * Send headers
200
+ *
201
+ * @see getHeaders()
202
+ *
203
+ * Note this doesn't "clear" the headers. Calling sendHeaders() will
204
+ * call header() again (but probably have not effect) and getHeaders() will
205
+ * still return the headers.
206
+ *
207
+ * @return null
208
+ */
209
+ public function sendHeaders()
210
+ {
211
+ $headers = $this->_headers;
212
+ if (array_key_exists('_responseCode', $headers)) {
213
+ // FastCGI environments require 3rd arg to header() to be set
214
+ list(, $code) = explode(' ', $headers['_responseCode'], 3);
215
+ header($headers['_responseCode'], true, $code);
216
+ unset($headers['_responseCode']);
217
+ }
218
+ foreach ($headers as $name => $val) {
219
+ header($name . ': ' . $val);
220
+ }
221
+ }
222
+
223
+ /**
224
+ * Exit if the client's cache is valid for this resource
225
+ *
226
+ * This is a convenience method for common use of the class
227
+ *
228
+ * @param int $lastModifiedTime if given, both ETag AND Last-Modified headers
229
+ * will be sent with content. This is recommended.
230
+ *
231
+ * @param bool $isPublic (default false) if true, the Cache-Control header
232
+ * will contain "public", allowing proxies to cache the content. Otherwise
233
+ * "private" will be sent, allowing only browser caching.
234
+ *
235
+ * @param array $options (default empty) additional options for constructor
236
+ */
237
+ public static function check($lastModifiedTime = null, $isPublic = false, $options = array())
238
+ {
239
+ if (null !== $lastModifiedTime) {
240
+ $options['lastModifiedTime'] = (int)$lastModifiedTime;
241
+ }
242
+ $options['isPublic'] = (bool)$isPublic;
243
+ $cg = new HTTP_ConditionalGet($options);
244
+ $cg->sendHeaders();
245
+ if ($cg->cacheIsValid) {
246
+ exit();
247
+ }
248
+ }
249
+
250
+ /**
251
+ * Get a GMT formatted date for use in HTTP headers
252
+ *
253
+ * <code>
254
+ * header('Expires: ' . HTTP_ConditionalGet::gmtdate($time));
255
+ * </code>
256
+ *
257
+ * @param int $time unix timestamp
258
+ *
259
+ * @return string
260
+ */
261
+ public static function gmtDate($time)
262
+ {
263
+ return gmdate('D, d M Y H:i:s \G\M\T', $time);
264
+ }
265
+
266
+ protected $_headers = array();
267
+ protected $_lmTime = null;
268
+ protected $_etag = null;
269
+ protected $_stripEtag = false;
270
+
271
+ /**
272
+ * @param string $hash
273
+ *
274
+ * @param string $scope
275
+ */
276
+ protected function _setEtag($hash, $scope)
277
+ {
278
+ $this->_etag = '"' . substr($scope, 0, 3) . $hash . '"';
279
+ $this->_headers['ETag'] = $this->_etag;
280
+ }
281
+
282
+ /**
283
+ * @param int $time
284
+ */
285
+ protected function _setLastModified($time)
286
+ {
287
+ $this->_lmTime = (int)$time;
288
+ $this->_headers['Last-Modified'] = self::gmtDate($time);
289
+ }
290
+
291
+ /**
292
+ * Determine validity of client cache and queue 304 header if valid
293
+ *
294
+ * @return bool
295
+ */
296
+ protected function _isCacheValid()
297
+ {
298
+ if (null === $this->_etag) {
299
+ // lmTime is copied to ETag, so this condition implies that the
300
+ // server sent neither ETag nor Last-Modified, so the client can't
301
+ // possibly has a valid cache.
302
+ return false;
303
+ }
304
+ $isValid = ($this->resourceMatchedEtag() || $this->resourceNotModified());
305
+ if ($isValid) {
306
+ $this->_headers['_responseCode'] = 'HTTP/1.0 304 Not Modified';
307
+ }
308
+
309
+ return $isValid;
310
+ }
311
+
312
+ /**
313
+ * @return bool
314
+ */
315
+ protected function resourceMatchedEtag()
316
+ {
317
+ if (!isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
318
+ return false;
319
+ }
320
+ $clientEtagList = get_magic_quotes_gpc()
321
+ ? stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])
322
+ : $_SERVER['HTTP_IF_NONE_MATCH'];
323
+ $clientEtags = explode(',', $clientEtagList);
324
+
325
+ $compareTo = $this->normalizeEtag($this->_etag);
326
+ foreach ($clientEtags as $clientEtag) {
327
+ if ($this->normalizeEtag($clientEtag) === $compareTo) {
328
+ // respond with the client's matched ETag, even if it's not what
329
+ // we would've sent by default
330
+ $this->_headers['ETag'] = trim($clientEtag);
331
+
332
+ return true;
333
+ }
334
+ }
335
+
336
+ return false;
337
+ }
338
+
339
+ /**
340
+ * @param string $etag
341
+ *
342
+ * @return string
343
+ */
344
+ protected function normalizeEtag($etag)
345
+ {
346
+ $etag = trim($etag);
347
+
348
+ return $this->_stripEtag
349
+ ? preg_replace('/;\\w\\w"$/', '"', $etag)
350
+ : $etag;
351
+ }
352
+
353
+ /**
354
+ * @return bool
355
+ */
356
+ protected function resourceNotModified()
357
+ {
358
+ if (!isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
359
+ return false;
360
+ }
361
+ // strip off IE's extra data (semicolon)
362
+ list($ifModifiedSince) = explode(';', $_SERVER['HTTP_IF_MODIFIED_SINCE'], 2);
363
+
364
+ $date = new DateTime($ifModifiedSince, new DateTimeZone('UTC'));
365
+
366
+ if ($date->getTimestamp() >= $this->_lmTime) {
367
+ // Apache 2.2's behavior. If there was no ETag match, send the
368
+ // non-encoded version of the ETag value.
369
+ $this->_headers['ETag'] = $this->normalizeEtag($this->_etag);
370
+
371
+ return true;
372
+ }
373
+
374
+ return false;
375
+ }
376
+ }
lib/vendor/mrclay/minify/lib/HTTP/Encoder.php ADDED
@@ -0,0 +1,335 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class HTTP_Encoder
4
+ * @package Minify
5
+ * @subpackage HTTP
6
+ */
7
+
8
+ /**
9
+ * Encode and send gzipped/deflated content
10
+ *
11
+ * The "Vary: Accept-Encoding" header is sent. If the client allows encoding,
12
+ * Content-Encoding and Content-Length are added.
13
+ *
14
+ * <code>
15
+ * // Send a CSS file, compressed if possible
16
+ * $he = new HTTP_Encoder(array(
17
+ * 'content' => file_get_contents($cssFile)
18
+ * ,'type' => 'text/css'
19
+ * ));
20
+ * $he->encode();
21
+ * $he->sendAll();
22
+ * </code>
23
+ *
24
+ * <code>
25
+ * // Shortcut to encoding output
26
+ * header('Content-Type: text/css'); // needed if not HTML
27
+ * HTTP_Encoder::output($css);
28
+ * </code>
29
+ *
30
+ * <code>
31
+ * // Just sniff for the accepted encoding
32
+ * $encoding = HTTP_Encoder::getAcceptedEncoding();
33
+ * </code>
34
+ *
35
+ * For more control over headers, use getHeaders() and getData() and send your
36
+ * own output.
37
+ *
38
+ * Note: If you don't need header mgmt, use PHP's native gzencode, gzdeflate,
39
+ * and gzcompress functions for gzip, deflate, and compress-encoding
40
+ * respectively.
41
+ *
42
+ * @package Minify
43
+ * @subpackage HTTP
44
+ * @author Stephen Clay <steve@mrclay.org>
45
+ */
46
+ class HTTP_Encoder
47
+ {
48
+
49
+ /**
50
+ * Should the encoder allow HTTP encoding to IE6?
51
+ *
52
+ * If you have many IE6 users and the bandwidth savings is worth troubling
53
+ * some of them, set this to true.
54
+ *
55
+ * By default, encoding is only offered to IE7+. When this is true,
56
+ * getAcceptedEncoding() will return an encoding for IE6 if its user agent
57
+ * string contains "SV1". This has been documented in many places as "safe",
58
+ * but there seem to be remaining, intermittent encoding bugs in patched
59
+ * IE6 on the wild web.
60
+ *
61
+ * @var bool
62
+ */
63
+ public static $encodeToIe6 = true;
64
+
65
+ /**
66
+ * Default compression level for zlib operations
67
+ *
68
+ * This level is used if encode() is not given a $compressionLevel
69
+ *
70
+ * @var int
71
+ */
72
+ public static $compressionLevel = 6;
73
+
74
+ /**
75
+ * Get an HTTP Encoder object
76
+ *
77
+ * @param array $spec options
78
+ *
79
+ * 'content': (string required) content to be encoded
80
+ *
81
+ * 'type': (string) if set, the Content-Type header will have this value.
82
+ *
83
+ * 'method: (string) only set this if you are forcing a particular encoding
84
+ * method. If not set, the best method will be chosen by getAcceptedEncoding()
85
+ * The available methods are 'gzip', 'deflate', 'compress', and '' (no
86
+ * encoding)
87
+ */
88
+ public function __construct($spec)
89
+ {
90
+ $this->_useMbStrlen = (function_exists('mb_strlen')
91
+ && (ini_get('mbstring.func_overload') !== '')
92
+ && ((int)ini_get('mbstring.func_overload') & 2));
93
+ $this->_content = $spec['content'];
94
+ $this->_headers['Content-Length'] = $this->_useMbStrlen
95
+ ? (string)mb_strlen($this->_content, '8bit')
96
+ : (string)strlen($this->_content);
97
+ if (isset($spec['type'])) {
98
+ $this->_headers['Content-Type'] = $spec['type'];
99
+ }
100
+ if (isset($spec['method'])
101
+ && in_array($spec['method'], array('gzip', 'deflate', 'compress', ''))) {
102
+ $this->_encodeMethod = array($spec['method'], $spec['method']);
103
+ } else {
104
+ $this->_encodeMethod = self::getAcceptedEncoding();
105
+ }
106
+ }
107
+
108
+ /**
109
+ * Get content in current form
110
+ *
111
+ * Call after encode() for encoded content.
112
+ *
113
+ * @return string
114
+ */
115
+ public function getContent()
116
+ {
117
+ return $this->_content;
118
+ }
119
+
120
+ /**
121
+ * Get array of output headers to be sent
122
+ *
123
+ * E.g.
124
+ * <code>
125
+ * array(
126
+ * 'Content-Length' => '615'
127
+ * ,'Content-Encoding' => 'x-gzip'
128
+ * ,'Vary' => 'Accept-Encoding'
129
+ * )
130
+ * </code>
131
+ *
132
+ * @return array
133
+ */
134
+ public function getHeaders()
135
+ {
136
+ return $this->_headers;
137
+ }
138
+
139
+ /**
140
+ * Send output headers
141
+ *
142
+ * You must call this before headers are sent and it probably cannot be
143
+ * used in conjunction with zlib output buffering / mod_gzip. Errors are
144
+ * not handled purposefully.
145
+ *
146
+ * @see getHeaders()
147
+ */
148
+ public function sendHeaders()
149
+ {
150
+ foreach ($this->_headers as $name => $val) {
151
+ header($name . ': ' . $val);
152
+ }
153
+ }
154
+
155
+ /**
156
+ * Send output headers and content
157
+ *
158
+ * A shortcut for sendHeaders() and echo getContent()
159
+ *
160
+ * You must call this before headers are sent and it probably cannot be
161
+ * used in conjunction with zlib output buffering / mod_gzip. Errors are
162
+ * not handled purposefully.
163
+ */
164
+ public function sendAll()
165
+ {
166
+ $this->sendHeaders();
167
+ echo $this->_content;
168
+ }
169
+
170
+ /**
171
+ * Determine the client's best encoding method from the HTTP Accept-Encoding
172
+ * header.
173
+ *
174
+ * If no Accept-Encoding header is set, or the browser is IE before v6 SP2,
175
+ * this will return ('', ''), the "identity" encoding.
176
+ *
177
+ * A syntax-aware scan is done of the Accept-Encoding, so the method must
178
+ * be non 0. The methods are favored in order of gzip, deflate, then
179
+ * compress. Deflate is always smallest and generally faster, but is
180
+ * rarely sent by servers, so client support could be buggier.
181
+ *
182
+ * @param bool $allowCompress allow the older compress encoding
183
+ *
184
+ * @param bool $allowDeflate allow the more recent deflate encoding
185
+ *
186
+ * @return array two values, 1st is the actual encoding method, 2nd is the
187
+ * alias of that method to use in the Content-Encoding header (some browsers
188
+ * call gzip "x-gzip" etc.)
189
+ */
190
+ public static function getAcceptedEncoding($allowCompress = true, $allowDeflate = true)
191
+ {
192
+ // @link http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
193
+
194
+ if (! isset($_SERVER['HTTP_ACCEPT_ENCODING'])
195
+ || self::isBuggyIe()) {
196
+ return array('', '');
197
+ }
198
+ $ae = $_SERVER['HTTP_ACCEPT_ENCODING'];
199
+ // gzip checks (quick)
200
+ if (0 === strpos($ae, 'gzip,') // most browsers
201
+ || 0 === strpos($ae, 'deflate, gzip,') // opera
202
+ ) {
203
+ return array('gzip', 'gzip');
204
+ }
205
+ // gzip checks (slow)
206
+ if (preg_match(
207
+ '@(?:^|,)\\s*((?:x-)?gzip)\\s*(?:$|,|;\\s*q=(?:0\\.|1))@'
208
+ ,$ae
209
+ ,$m)) {
210
+ return array('gzip', $m[1]);
211
+ }
212
+ if ($allowDeflate) {
213
+ // deflate checks
214
+ $aeRev = strrev($ae);
215
+ if (0 === strpos($aeRev, 'etalfed ,') // ie, webkit
216
+ || 0 === strpos($aeRev, 'etalfed,') // gecko
217
+ || 0 === strpos($ae, 'deflate,') // opera
218
+ // slow parsing
219
+ || preg_match(
220
+ '@(?:^|,)\\s*deflate\\s*(?:$|,|;\\s*q=(?:0\\.|1))@', $ae)) {
221
+ return array('deflate', 'deflate');
222
+ }
223
+ }
224
+ if ($allowCompress && preg_match(
225
+ '@(?:^|,)\\s*((?:x-)?compress)\\s*(?:$|,|;\\s*q=(?:0\\.|1))@'
226
+ ,$ae
227
+ ,$m)) {
228
+ return array('compress', $m[1]);
229
+ }
230
+
231
+ return array('', '');
232
+ }
233
+
234
+ /**
235
+ * Encode (compress) the content
236
+ *
237
+ * If the encode method is '' (none) or compression level is 0, or the 'zlib'
238
+ * extension isn't loaded, we return false.
239
+ *
240
+ * Then the appropriate gz_* function is called to compress the content. If
241
+ * this fails, false is returned.
242
+ *
243
+ * The header "Vary: Accept-Encoding" is added. If encoding is successful,
244
+ * the Content-Length header is updated, and Content-Encoding is also added.
245
+ *
246
+ * @param int $compressionLevel given to zlib functions. If not given, the
247
+ * class default will be used.
248
+ *
249
+ * @return bool success true if the content was actually compressed
250
+ */
251
+ public function encode($compressionLevel = null)
252
+ {
253
+ if (! self::isBuggyIe()) {
254
+ $this->_headers['Vary'] = 'Accept-Encoding';
255
+ }
256
+ if (null === $compressionLevel) {
257
+ $compressionLevel = self::$compressionLevel;
258
+ }
259
+ if ('' === $this->_encodeMethod[0]
260
+ || ($compressionLevel == 0)
261
+ || !extension_loaded('zlib')) {
262
+ return false;
263
+ }
264
+ if ($this->_encodeMethod[0] === 'deflate') {
265
+ $encoded = gzdeflate($this->_content, $compressionLevel);
266
+ } elseif ($this->_encodeMethod[0] === 'gzip') {
267
+ $encoded = gzencode($this->_content, $compressionLevel);
268
+ } else {
269
+ $encoded = gzcompress($this->_content, $compressionLevel);
270
+ }
271
+ if (false === $encoded) {
272
+ return false;
273
+ }
274
+ $this->_headers['Content-Length'] = $this->_useMbStrlen
275
+ ? (string)mb_strlen($encoded, '8bit')
276
+ : (string)strlen($encoded);
277
+ $this->_headers['Content-Encoding'] = $this->_encodeMethod[1];
278
+ $this->_content = $encoded;
279
+
280
+ return true;
281
+ }
282
+
283
+ /**
284
+ * Encode and send appropriate headers and content
285
+ *
286
+ * This is a convenience method for common use of the class
287
+ *
288
+ * @param string $content
289
+ *
290
+ * @param int $compressionLevel given to zlib functions. If not given, the
291
+ * class default will be used.
292
+ *
293
+ * @return bool success true if the content was actually compressed
294
+ */
295
+ public static function output($content, $compressionLevel = null)
296
+ {
297
+ if (null === $compressionLevel) {
298
+ $compressionLevel = self::$compressionLevel;
299
+ }
300
+ $he = new HTTP_Encoder(array('content' => $content));
301
+ $ret = $he->encode($compressionLevel);
302
+ $he->sendAll();
303
+
304
+ return $ret;
305
+ }
306
+
307
+ /**
308
+ * Is the browser an IE version earlier than 6 SP2?
309
+ *
310
+ * @return bool
311
+ */
312
+ public static function isBuggyIe()
313
+ {
314
+ if (empty($_SERVER['HTTP_USER_AGENT'])) {
315
+ return false;
316
+ }
317
+ $ua = $_SERVER['HTTP_USER_AGENT'];
318
+ // quick escape for non-IEs
319
+ if (0 !== strpos($ua, 'Mozilla/4.0 (compatible; MSIE ')
320
+ || false !== strpos($ua, 'Opera')) {
321
+ return false;
322
+ }
323
+ // no regex = faaast
324
+ $version = (float)substr($ua, 30);
325
+
326
+ return self::$encodeToIe6
327
+ ? ($version < 6 || ($version == 6 && false === strpos($ua, 'SV1')))
328
+ : ($version < 7);
329
+ }
330
+
331
+ protected $_content = '';
332
+ protected $_headers = array();
333
+ protected $_encodeMethod = array('', '');
334
+ protected $_useMbStrlen = false;
335
+ }
lib/vendor/mrclay/minify/lib/Minify.php ADDED
@@ -0,0 +1,761 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify
4
+ * @package Minify
5
+ */
6
+
7
+ use Psr\Log\LoggerInterface;
8
+
9
+ /**
10
+ * Minify - Combines, minifies, and caches JavaScript and CSS files on demand.
11
+ *
12
+ * See README for usage instructions (for now).
13
+ *
14
+ * This library was inspired by {@link mailto:flashkot@mail.ru jscsscomp by Maxim Martynyuk}
15
+ * and by the article {@link http://www.hunlock.com/blogs/Supercharged_Javascript "Supercharged JavaScript" by Patrick Hunlock}.
16
+ *
17
+ * Requires PHP 5.1.0.
18
+ * Tested on PHP 5.1.6.
19
+ *
20
+ * @package Minify
21
+ * @author Ryan Grove <ryan@wonko.com>
22
+ * @author Stephen Clay <steve@mrclay.org>
23
+ * @copyright 2008 Ryan Grove, Stephen Clay. All rights reserved.
24
+ * @license http://opensource.org/licenses/bsd-license.php New BSD License
25
+ * @link https://github.com/mrclay/minify
26
+ */
27
+ class Minify
28
+ {
29
+
30
+ /**
31
+ * API version
32
+ *
33
+ * This is only bumped when API breaks are done and should follow the major version of the library
34
+ *
35
+ * @var int
36
+ */
37
+ const VERSION = 3;
38
+
39
+ const TYPE_CSS = 'text/css';
40
+ const TYPE_HTML = 'text/html';
41
+ // there is some debate over the ideal JS Content-Type, but this is the
42
+ // Apache default and what Yahoo! uses..
43
+ const TYPE_JS = 'application/x-javascript';
44
+ const URL_DEBUG = 'https://github.com/mrclay/minify/blob/master/docs/Debugging.wiki.md';
45
+
46
+ /**
47
+ * Any Minify_Cache_* object or null (i.e. no server cache is used)
48
+ *
49
+ * @var Minify_CacheInterface
50
+ */
51
+ private $cache = null;
52
+
53
+ /**
54
+ * Active controller for current request
55
+ *
56
+ * @var Minify_Controller_Base
57
+ */
58
+ protected $controller = null;
59
+
60
+ /**
61
+ * @var Minify_Env
62
+ */
63
+ protected $env;
64
+
65
+ /**
66
+ * @var Minify_SourceInterface[]
67
+ */
68
+ protected $sources;
69
+
70
+ /**
71
+ * @var string
72
+ */
73
+ protected $selectionId;
74
+
75
+ /**
76
+ * Options for current request
77
+ *
78
+ * @var array
79
+ */
80
+ protected $options = null;
81
+
82
+ /**
83
+ * @var LoggerInterface|null
84
+ */
85
+ protected $logger = null;
86
+
87
+ /**
88
+ * @param Minify_CacheInterface $cache
89
+ * @param LoggerInterface $logger
90
+ */
91
+ public function __construct(Minify_CacheInterface $cache, LoggerInterface $logger = null)
92
+ {
93
+ $this->cache = $cache;
94
+ $this->logger = $logger;
95
+ }
96
+
97
+ /**
98
+ * Get default Minify options.
99
+ *
100
+ * @return array options for Minify
101
+ */
102
+ public function getDefaultOptions()
103
+ {
104
+ return array(
105
+ 'isPublic' => true,
106
+ 'encodeOutput' => function_exists('gzdeflate'),
107
+ 'encodeMethod' => null, // determine later
108
+ 'encodeLevel' => 9,
109
+
110
+ 'minifiers' => array(
111
+ Minify::TYPE_JS => array('JSMin\\JSMin', 'minify'),
112
+ Minify::TYPE_CSS => array('Minify_CSSmin', 'minify'),
113
+ Minify::TYPE_HTML => array('Minify_HTML', 'minify'),
114
+ ),
115
+ 'minifierOptions' => array(), // no minifier options
116
+
117
+ 'contentTypeCharset' => 'utf-8',
118
+ 'maxAge' => 1800, // 30 minutes
119
+ 'rewriteCssUris' => true,
120
+ 'bubbleCssImports' => false,
121
+ 'quiet' => false, // serve() will send headers and output
122
+ 'debug' => false,
123
+ 'concatOnly' => false,
124
+
125
+ // if you override these, the response codes MUST be directly after
126
+ // the first space.
127
+ 'badRequestHeader' => 'HTTP/1.0 400 Bad Request',
128
+ 'errorHeader' => 'HTTP/1.0 500 Internal Server Error',
129
+
130
+ // callback function to see/modify content of all sources
131
+ 'postprocessor' => null,
132
+ // file to require to load preprocessor
133
+ 'postprocessorRequire' => null,
134
+
135
+ /**
136
+ * If this string is not empty AND the serve() option 'bubbleCssImports' is
137
+ * NOT set, then serve() will check CSS files for @import declarations that
138
+ * appear too late in the combined stylesheet. If found, serve() will prepend
139
+ * the output with this warning.
140
+ */
141
+ 'importWarning' => "/* See https://github.com/mrclay/minify/blob/master/docs/CommonProblems.wiki.md#imports-can-appear-in-invalid-locations-in-combined-css-files */\n"
142
+ );
143
+ }
144
+
145
+ /**
146
+ * Serve a request for a minified file.
147
+ *
148
+ * Here are the available options and defaults:
149
+ *
150
+ * 'isPublic' : send "public" instead of "private" in Cache-Control
151
+ * headers, allowing shared caches to cache the output. (default true)
152
+ *
153
+ * 'quiet' : set to true to have serve() return an array rather than sending
154
+ * any headers/output (default false)
155
+ *
156
+ * 'encodeOutput' : set to false to disable content encoding, and not send
157
+ * the Vary header (default true)
158
+ *
159
+ * 'encodeMethod' : generally you should let this be determined by
160
+ * HTTP_Encoder (leave null), but you can force a particular encoding
161
+ * to be returned, by setting this to 'gzip' or '' (no encoding)
162
+ *
163
+ * 'encodeLevel' : level of encoding compression (0 to 9, default 9)
164
+ *
165
+ * 'contentTypeCharset' : appended to the Content-Type header sent. Set to a falsey
166
+ * value to remove. (default 'utf-8')
167
+ *
168
+ * 'maxAge' : set this to the number of seconds the client should use its cache
169
+ * before revalidating with the server. This sets Cache-Control: max-age and the
170
+ * Expires header. Unlike the old 'setExpires' setting, this setting will NOT
171
+ * prevent conditional GETs. Note this has nothing to do with server-side caching.
172
+ *
173
+ * 'rewriteCssUris' : If true, serve() will automatically set the 'currentDir'
174
+ * minifier option to enable URI rewriting in CSS files (default true)
175
+ *
176
+ * 'bubbleCssImports' : If true, all @import declarations in combined CSS
177
+ * files will be move to the top. Note this may alter effective CSS values
178
+ * due to a change in order. (default false)
179
+ *
180
+ * 'debug' : set to true to minify all sources with the 'Lines' controller, which
181
+ * eases the debugging of combined files. This also prevents 304 responses.
182
+ * @see Minify_Lines::minify()
183
+ *
184
+ * 'concatOnly' : set to true to disable minification and simply concatenate the files.
185
+ * For JS, no minifier will be used. For CSS, only URI rewriting is still performed.
186
+ *
187
+ * 'minifiers' : to override Minify's default choice of minifier function for
188
+ * a particular content-type, specify your callback under the key of the
189
+ * content-type:
190
+ * <code>
191
+ * // call customCssMinifier($css) for all CSS minification
192
+ * $options['minifiers'][Minify::TYPE_CSS] = 'customCssMinifier';
193
+ *
194
+ * // don't minify Javascript at all
195
+ * $options['minifiers'][Minify::TYPE_JS] = 'Minify::nullMinifier';
196
+ * </code>
197
+ *
198
+ * 'minifierOptions' : to send options to the minifier function, specify your options
199
+ * under the key of the content-type. E.g. To send the CSS minifier an option:
200
+ * <code>
201
+ * // give CSS minifier array('optionName' => 'optionValue') as 2nd argument
202
+ * $options['minifierOptions'][Minify::TYPE_CSS]['optionName'] = 'optionValue';
203
+ * </code>
204
+ *
205
+ * 'contentType' : (optional) this is only needed if your file extension is not
206
+ * js/css/html. The given content-type will be sent regardless of source file
207
+ * extension, so this should not be used in a Groups config with other
208
+ * Javascript/CSS files.
209
+ *
210
+ * 'importWarning' : serve() will check CSS files for @import declarations that
211
+ * appear too late in the combined stylesheet. If found, serve() will prepend
212
+ * the output with this warning. To disable this, set this option to empty string.
213
+ *
214
+ * Any controller options are documented in that controller's createConfiguration() method.
215
+ *
216
+ * @param Minify_ControllerInterface $controller instance of subclass of Minify_Controller_Base
217
+ *
218
+ * @param array $options controller/serve options
219
+ *
220
+ * @return null|array if the 'quiet' option is set to true, an array
221
+ * with keys "success" (bool), "statusCode" (int), "content" (string), and
222
+ * "headers" (array).
223
+ *
224
+ * @throws Exception
225
+ */
226
+ public function serve(Minify_ControllerInterface $controller, $options = array())
227
+ {
228
+ $this->env = $controller->getEnv();
229
+
230
+ $options = array_merge($this->getDefaultOptions(), $options);
231
+
232
+ $config = $controller->createConfiguration($options);
233
+
234
+ $this->sources = $config->getSources();
235
+ $this->selectionId = $config->getSelectionId();
236
+ $this->options = $this->analyzeSources($config->getOptions());
237
+
238
+ if (!$this->options['quiet'] && !headers_sent()) {
239
+ ini_set('zlib.output_compression', '0');
240
+ }
241
+
242
+ // check request validity
243
+ if (!$this->sources) {
244
+ // invalid request!
245
+ if (! $this->options['quiet']) {
246
+ $this->errorExit($this->options['badRequestHeader'], self::URL_DEBUG);
247
+ } else {
248
+ list(,$statusCode) = explode(' ', $this->options['badRequestHeader']);
249
+
250
+ return array(
251
+ 'success' => false,
252
+ 'statusCode' => (int)$statusCode,
253
+ 'content' => '',
254
+ 'headers' => array(),
255
+ );
256
+ }
257
+ }
258
+
259
+ $this->controller = $controller;
260
+
261
+ if ($this->options['debug']) {
262
+ $this->setupDebug();
263
+ $this->options['maxAge'] = 0;
264
+ }
265
+
266
+ // determine encoding
267
+ if ($this->options['encodeOutput']) {
268
+ $sendVary = true;
269
+ if ($this->options['encodeMethod'] !== null) {
270
+ // controller specifically requested this
271
+ $contentEncoding = $this->options['encodeMethod'];
272
+ } else {
273
+ // sniff request header
274
+ // depending on what the client accepts, $contentEncoding may be
275
+ // 'x-gzip' while our internal encodeMethod is 'gzip'. Calling
276
+ // getAcceptedEncoding(false, false) leaves out compress and deflate as options.
277
+ $list = HTTP_Encoder::getAcceptedEncoding(false, false);
278
+ list($this->options['encodeMethod'], $contentEncoding) = $list;
279
+ $sendVary = ! HTTP_Encoder::isBuggyIe();
280
+ }
281
+ } else {
282
+ $this->options['encodeMethod'] = ''; // identity (no encoding)
283
+ }
284
+
285
+ // check client cache
286
+ $cgOptions = array(
287
+ 'lastModifiedTime' => $this->options['lastModifiedTime'],
288
+ 'isPublic' => $this->options['isPublic'],
289
+ 'encoding' => $this->options['encodeMethod'],
290
+ );
291
+
292
+ if ($this->options['maxAge'] > 0) {
293
+ $cgOptions['maxAge'] = $this->options['maxAge'];
294
+ } elseif ($this->options['debug']) {
295
+ $cgOptions['invalidate'] = true;
296
+ }
297
+
298
+ $cg = new HTTP_ConditionalGet($cgOptions);
299
+ if ($cg->cacheIsValid) {
300
+ // client's cache is valid
301
+ if (! $this->options['quiet']) {
302
+ $cg->sendHeaders();
303
+
304
+ return;
305
+ } else {
306
+ return array(
307
+ 'success' => true,
308
+ 'statusCode' => 304,
309
+ 'content' => '',
310
+ 'headers' => $cg->getHeaders(),
311
+ );
312
+ }
313
+ } else {
314
+ // client will need output
315
+ $headers = $cg->getHeaders();
316
+ unset($cg);
317
+ }
318
+
319
+ if ($this->options['contentType'] === self::TYPE_CSS && $this->options['rewriteCssUris']) {
320
+ $this->setupUriRewrites();
321
+ }
322
+
323
+ if ($this->options['concatOnly']) {
324
+ $this->options['minifiers'][self::TYPE_JS] = false;
325
+ foreach ($this->sources as $key => $source) {
326
+ if ($this->options['contentType'] === self::TYPE_JS) {
327
+ $source->setMinifier('Minify::nullMinifier');
328
+ } elseif ($this->options['contentType'] === self::TYPE_CSS) {
329
+ $source->setMinifier(array('Minify_CSSmin', 'minify'));
330
+ $sourceOpts = $source->getMinifierOptions();
331
+ $sourceOpts['compress'] = false;
332
+ $source->setMinifierOptions($sourceOpts);
333
+ }
334
+ }
335
+ }
336
+
337
+ // check server cache
338
+ if (! $this->options['debug']) {
339
+ // using cache
340
+ // the goal is to use only the cache methods to sniff the length and
341
+ // output the content, as they do not require ever loading the file into
342
+ // memory.
343
+ $cacheId = $this->_getCacheId();
344
+ $fullCacheId = ($this->options['encodeMethod']) ? $cacheId . '.gz' : $cacheId;
345
+
346
+ // check cache for valid entry
347
+ $cacheIsReady = $this->cache->isValid($fullCacheId, $this->options['lastModifiedTime']);
348
+ if ($cacheIsReady) {
349
+ $cacheContentLength = $this->cache->getSize($fullCacheId);
350
+ } else {
351
+ // generate & cache content
352
+ try {
353
+ $content = $this->combineMinify();
354
+ } catch (Exception $e) {
355
+ $this->logger && $this->logger->critical($e->getMessage());
356
+ if (! $this->options['quiet']) {
357
+ $this->errorExit($this->options['errorHeader'], self::URL_DEBUG);
358
+ }
359
+ throw $e;
360
+ }
361
+ $this->cache->store($cacheId, $content);
362
+ if (function_exists('gzencode') && $this->options['encodeMethod']) {
363
+ $this->cache->store($cacheId . '.gz', gzencode($content, $this->options['encodeLevel']));
364
+ }
365
+ }
366
+ } else {
367
+ // no cache
368
+ $cacheIsReady = false;
369
+ try {
370
+ $content = $this->combineMinify();
371
+ } catch (Exception $e) {
372
+ $this->logger && $this->logger->critical($e->getMessage());
373
+ if (! $this->options['quiet']) {
374
+ $this->errorExit($this->options['errorHeader'], self::URL_DEBUG);
375
+ }
376
+ throw $e;
377
+ }
378
+ }
379
+ if (! $cacheIsReady && $this->options['encodeMethod']) {
380
+ // still need to encode
381
+ $content = gzencode($content, $this->options['encodeLevel']);
382
+ }
383
+
384
+ // add headers
385
+ if ($cacheIsReady) {
386
+ $headers['Content-Length'] = $cacheContentLength;
387
+ } else {
388
+ if (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)) {
389
+ $headers['Content-Length'] = mb_strlen($content, '8bit');
390
+ } else {
391
+ $headers['Content-Length'] = strlen($content);
392
+ }
393
+ }
394
+
395
+ $headers['Content-Type'] = $this->options['contentType'];
396
+ if ($this->options['contentTypeCharset']) {
397
+ $headers['Content-Type'] .= '; charset=' . $this->options['contentTypeCharset'];
398
+ }
399
+
400
+ if ($this->options['encodeMethod'] !== '') {
401
+ $headers['Content-Encoding'] = $contentEncoding;
402
+ }
403
+ if ($this->options['encodeOutput'] && $sendVary) {
404
+ $headers['Vary'] = 'Accept-Encoding';
405
+ }
406
+
407
+ if (! $this->options['quiet']) {
408
+ // output headers & content
409
+ foreach ($headers as $name => $val) {
410
+ header($name . ': ' . $val);
411
+ }
412
+ if ($cacheIsReady) {
413
+ $this->cache->display($fullCacheId);
414
+ } else {
415
+ echo $content;
416
+ }
417
+ } else {
418
+ return array(
419
+ 'success' => true,
420
+ 'statusCode' => 200,
421
+ 'content' => $cacheIsReady ? $this->cache->fetch($fullCacheId) : $content,
422
+ 'headers' => $headers,
423
+ );
424
+ }
425
+ }
426
+
427
+ /**
428
+ * Return combined minified content for a set of sources
429
+ *
430
+ * No internal caching will be used and the content will not be HTTP encoded.
431
+ *
432
+ * @param array $sources array of filepaths and/or Minify_Source objects
433
+ *
434
+ * @param array $options (optional) array of options for serve.
435
+ *
436
+ * @return string
437
+ */
438
+ public function combine($sources, $options = array())
439
+ {
440
+ $tmpCache = $this->cache;
441
+ $this->cache = new Minify_Cache_Null();
442
+
443
+ $env = new Minify_Env();
444
+ $sourceFactory = new Minify_Source_Factory($env, array(
445
+ 'checkAllowDirs' => false,
446
+ ), $this->cache);
447
+ $controller = new Minify_Controller_Files($env, $sourceFactory, $this->logger);
448
+
449
+ $options = array_merge($options, array(
450
+ 'files' => (array)$sources,
451
+ 'quiet' => true,
452
+ 'encodeMethod' => '',
453
+ 'lastModifiedTime' => 0,
454
+ ));
455
+ $out = $this->serve($controller, $options);
456
+
457
+ $this->cache = $tmpCache;
458
+
459
+ return $out['content'];
460
+ }
461
+
462
+ /**
463
+ * Show an error page
464
+ *
465
+ * @param string $header Full header. E.g. 'HTTP/1.0 500 Internal Server Error'
466
+ * @param string $url URL to direct the user to
467
+ * @param string $msgHtml HTML message for the client
468
+ *
469
+ * @return void
470
+ * @internal This is not part of the public API and is subject to change
471
+ * @access private
472
+ */
473
+ public function errorExit($header, $url = '', $msgHtml = '')
474
+ {
475
+ $url = htmlspecialchars($url, ENT_QUOTES);
476
+ list(,$h1) = explode(' ', $header, 2);
477
+ $h1 = htmlspecialchars($h1);
478
+ // FastCGI environments require 3rd arg to header() to be set
479
+ list(, $code) = explode(' ', $header, 3);
480
+ header($header, true, $code);
481
+ header('Content-Type: text/html; charset=utf-8');
482
+ echo "<h1>$h1</h1>";
483
+ if ($msgHtml) {
484
+ echo $msgHtml;
485
+ }
486
+ if ($url) {
487
+ echo "<p>Please see <a href='$url'>$url</a>.</p>";
488
+ }
489
+ exit;
490
+ }
491
+
492
+ /**
493
+ * Default minifier for .min or -min JS files.
494
+ *
495
+ * @param string $content
496
+ * @return string
497
+ */
498
+ public static function nullMinifier($content)
499
+ {
500
+ if (isset($content[0]) && $content[0] === "\xef") {
501
+ $content = substr($content, 3);
502
+ }
503
+ $content = str_replace("\r\n", "\n", $content);
504
+
505
+ return trim($content);
506
+ }
507
+
508
+ /**
509
+ * Setup CSS sources for URI rewriting
510
+ */
511
+ protected function setupUriRewrites()
512
+ {
513
+ foreach ($this->sources as $key => $source) {
514
+ $file = $this->env->normalizePath($source->getFilePath());
515
+ $minifyOptions = $source->getMinifierOptions();
516
+
517
+ if ($file
518
+ && !isset($minifyOptions['currentDir'])
519
+ && !isset($minifyOptions['prependRelativePath'])) {
520
+ $minifyOptions['currentDir'] = dirname($file);
521
+ $source->setMinifierOptions($minifyOptions);
522
+ }
523
+ }
524
+ }
525
+
526
+ /**
527
+ * Set up sources to use Minify_Lines
528
+ */
529
+ protected function setupDebug()
530
+ {
531
+ foreach ($this->sources as $source) {
532
+ $source->setMinifier(array('Minify_Lines', 'minify'));
533
+ $id = $source->getId();
534
+ $source->setMinifierOptions(array(
535
+ 'id' => (is_file($id) ? basename($id) : $id),
536
+ ));
537
+ }
538
+ }
539
+
540
+ /**
541
+ * Combines sources and minifies the result.
542
+ *
543
+ * @return string
544
+ *
545
+ * @throws Exception
546
+ */
547
+ protected function combineMinify()
548
+ {
549
+ $type = $this->options['contentType']; // ease readability
550
+
551
+ // when combining scripts, make sure all statements separated and
552
+ // trailing single line comment is terminated
553
+ $implodeSeparator = ($type === self::TYPE_JS) ? "\n;" : '';
554
+
555
+ // allow the user to pass a particular array of options to each
556
+ // minifier (designated by type). source objects may still override
557
+ // these
558
+ if (isset($this->options['minifierOptions'][$type])) {
559
+ $defaultOptions = $this->options['minifierOptions'][$type];
560
+ } else {
561
+ $defaultOptions = array();
562
+ }
563
+
564
+ // if minifier not set, default is no minification. source objects
565
+ // may still override this
566
+ if (isset($this->options['minifiers'][$type])) {
567
+ $defaultMinifier = $this->options['minifiers'][$type];
568
+ } else {
569
+ $defaultMinifier = false;
570
+ }
571
+
572
+ // process groups of sources with identical minifiers/options
573
+ $content = array();
574
+ $i = 0;
575
+ $l = count($this->sources);
576
+ $groupToProcessTogether = array();
577
+ $lastMinifier = null;
578
+ $lastOptions = null;
579
+ do {
580
+ // get next source
581
+ $source = null;
582
+ if ($i < $l) {
583
+ $source = $this->sources[$i];
584
+ $sourceContent = $source->getContent();
585
+
586
+ // allow the source to override our minifier and options
587
+ $minifier = $source->getMinifier();
588
+ if (!$minifier) {
589
+ $minifier = $defaultMinifier;
590
+ }
591
+ $options = array_merge($defaultOptions, $source->getMinifierOptions());
592
+ }
593
+ // do we need to process our group right now?
594
+ if ($i > 0 // yes, we have at least the first group populated
595
+ && (
596
+ ! $source // yes, we ran out of sources
597
+ || $type === self::TYPE_CSS // yes, to process CSS individually (avoiding PCRE bugs/limits)
598
+ || $minifier !== $lastMinifier // yes, minifier changed
599
+ || $options !== $lastOptions)) { // yes, options changed
600
+ // minify previous sources with last settings
601
+ $imploded = implode($implodeSeparator, $groupToProcessTogether);
602
+ $groupToProcessTogether = array();
603
+ if ($lastMinifier) {
604
+ try {
605
+ $content[] = call_user_func($lastMinifier, $imploded, $lastOptions);
606
+ } catch (Exception $e) {
607
+ throw new Exception("Exception in minifier: " . $e->getMessage());
608
+ }
609
+ } else {
610
+ $content[] = $imploded;
611
+ }
612
+ }
613
+ // add content to the group
614
+ if ($source) {
615
+ $groupToProcessTogether[] = $sourceContent;
616
+ $lastMinifier = $minifier;
617
+ $lastOptions = $options;
618
+ }
619
+ $i++;
620
+ } while ($source);
621
+
622
+ $content = implode($implodeSeparator, $content);
623
+
624
+ if ($type === self::TYPE_CSS && false !== strpos($content, '@import')) {
625
+ $content = $this->handleCssImports($content);
626
+ }
627
+
628
+ // do any post-processing (esp. for editing build URIs)
629
+ if ($this->options['postprocessorRequire']) {
630
+ require_once $this->options['postprocessorRequire'];
631
+ }
632
+ if ($this->options['postprocessor']) {
633
+ $content = call_user_func($this->options['postprocessor'], $content, $type);
634
+ }
635
+
636
+ return $content;
637
+ }
638
+
639
+ /**
640
+ * Make a unique cache id for for this request.
641
+ *
642
+ * Any settings that could affect output are taken into consideration
643
+ *
644
+ * @param string $prefix
645
+ *
646
+ * @return string
647
+ */
648
+ protected function _getCacheId($prefix = 'minify')
649
+ {
650
+ $name = preg_replace('/[^a-zA-Z0-9\\.=_,]/', '', $this->selectionId);
651
+ $name = preg_replace('/\\.+/', '.', $name);
652
+ $name = substr($name, 0, 100 - 34 - strlen($prefix));
653
+ $md5 = md5(serialize(array(
654
+ Minify_SourceSet::getDigest($this->sources),
655
+ $this->options['minifiers'],
656
+ $this->options['minifierOptions'],
657
+ $this->options['postprocessor'],
658
+ $this->options['bubbleCssImports'],
659
+ Minify::VERSION,
660
+ )));
661
+
662
+ return "{$prefix}_{$name}_{$md5}";
663
+ }
664
+
665
+ /**
666
+ * Bubble CSS @imports to the top or prepend a warning if an import is detected not at the top.
667
+ *
668
+ * @param string $css
669
+ *
670
+ * @return string
671
+ */
672
+ protected function handleCssImports($css)
673
+ {
674
+ if ($this->options['bubbleCssImports']) {
675
+ // bubble CSS imports
676
+ preg_match_all('/@import.*?;/', $css, $imports);
677
+ $css = implode('', $imports[0]) . preg_replace('/@import.*?;/', '', $css);
678
+
679
+ return $css;
680
+ }
681
+
682
+ if ('' === $this->options['importWarning']) {
683
+ return $css;
684
+ }
685
+
686
+ // remove comments so we don't mistake { in a comment as a block
687
+ $noCommentCss = preg_replace('@/\\*[\\s\\S]*?\\*/@', '', $css);
688
+ $lastImportPos = strrpos($noCommentCss, '@import');
689
+ $firstBlockPos = strpos($noCommentCss, '{');
690
+ if (false !== $lastImportPos
691
+ && false !== $firstBlockPos
692
+ && $firstBlockPos < $lastImportPos
693
+ ) {
694
+ // { appears before @import : prepend warning
695
+ $css = $this->options['importWarning'] . $css;
696
+ }
697
+
698
+ return $css;
699
+ }
700
+
701
+ /**
702
+ * Analyze sources (if there are any) and set $options 'contentType'
703
+ * and 'lastModifiedTime' if they already aren't.
704
+ *
705
+ * @param array $options options for Minify
706
+ *
707
+ * @return array options for Minify
708
+ */
709
+ protected function analyzeSources($options = array())
710
+ {
711
+ if (!$this->sources) {
712
+ return $options;
713
+ }
714
+
715
+ $type = null;
716
+ foreach ($this->sources as $source) {
717
+ $sourceType = $source->getContentType();
718
+
719
+ if (!empty($options['contentType'])) {
720
+ // just verify sources have null content type or match the options
721
+ if ($sourceType !== null && $sourceType !== $options['contentType']) {
722
+ $this->logger && $this->logger->warning("ContentType mismatch: '{$sourceType}' != '{$options['contentType']}'");
723
+
724
+ $this->sources = array();
725
+
726
+ return $options;
727
+ }
728
+
729
+ continue;
730
+ }
731
+
732
+ if ($type === null) {
733
+ $type = $sourceType;
734
+ } elseif ($sourceType !== $type) {
735
+ $this->logger && $this->logger->warning("ContentType mismatch: '{$sourceType}' != '{$type}'");
736
+
737
+ $this->sources = array();
738
+
739
+ return $options;
740
+ }
741
+ }
742
+
743
+ if (empty($options['contentType'])) {
744
+ if (null === $type) {
745
+ $type = 'text/plain';
746
+ }
747
+ $options['contentType'] = $type;
748
+ }
749
+
750
+ // last modified is needed for caching, even if setExpires is set
751
+ if (!isset($options['lastModifiedTime'])) {
752
+ $max = 0;
753
+ foreach ($this->sources as $source) {
754
+ $max = max($source->getLastModified(), $max);
755
+ }
756
+ $options['lastModifiedTime'] = $max;
757
+ }
758
+
759
+ return $options;
760
+ }
761
+ }
lib/vendor/mrclay/minify/lib/Minify/App.php ADDED
@@ -0,0 +1,282 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Minify;
4
+
5
+ use Props\Container;
6
+
7
+ /**
8
+ * @property \Minify_CacheInterface $cache
9
+ * @property \Minify\Config $config
10
+ * @property string $configPath
11
+ * @property \Minify_ControllerInterface $controller
12
+ * @property string $dir
13
+ * @property string $docRoot
14
+ * @property \Minify_Env $env
15
+ * @property \Monolog\Handler\ErrorLogHandler $errorLogHandler
16
+ * @property array $groupsConfig
17
+ * @property string $groupsConfigPath
18
+ * @property \Psr\Log\LoggerInterface $logger
19
+ * @property \Minify $minify
20
+ * @property array $serveOptions
21
+ * @property \Minify_Source_Factory $sourceFactory
22
+ * @property array $sourceFactoryOptions
23
+ */
24
+ class App extends Container
25
+ {
26
+
27
+ /**
28
+ * Constructor
29
+ *
30
+ * @param string $dir Directory containing config files
31
+ */
32
+ public function __construct($dir)
33
+ {
34
+ $that = $this;
35
+
36
+ $this->dir = rtrim($dir, '/\\');
37
+
38
+ $this->cache = function (App $app) use ($that) {
39
+ $config = $app->config;
40
+
41
+ if ($config->cachePath instanceof \Minify_CacheInterface) {
42
+ return $config->cachePath;
43
+ }
44
+
45
+ if (!$config->cachePath || is_string($config->cachePath)) {
46
+ return new \Minify_Cache_File($config->cachePath, $config->cacheFileLocking, $app->logger);
47
+ }
48
+
49
+ $type = $that->typeOf($config->cachePath);
50
+ throw new \RuntimeException('$min_cachePath must be a path or implement Minify_CacheInterface.'
51
+ . " Given $type");
52
+ };
53
+
54
+ $this->config = function (App $app) {
55
+ $config = (require $app->configPath);
56
+
57
+ if ($config instanceof \Minify\Config) {
58
+ return $config;
59
+ }
60
+
61
+ // copy from vars into properties
62
+
63
+ $config = new \Minify\Config();
64
+
65
+ $propNames = array_keys(get_object_vars($config));
66
+
67
+ $prefixer = function ($name) {
68
+ return "min_$name";
69
+ };
70
+ $varNames = array_map($prefixer, $propNames);
71
+
72
+ $vars = compact($varNames);
73
+
74
+ foreach ($varNames as $varName) {
75
+ if (isset($vars[$varName])) {
76
+ $config->{substr($varName, 4)} = $vars[$varName];
77
+ }
78
+ }
79
+
80
+ if ($config->documentRoot) {
81
+ // copy into env
82
+ if (empty($config->envArgs['server'])) {
83
+ $config->envArgs['server'] = $_SERVER;
84
+ }
85
+ $config->envArgs['server']['DOCUMENT_ROOT'] = $config->documentRoot;
86
+ }
87
+
88
+ return $config;
89
+ };
90
+
91
+ $this->configPath = "{$this->dir}/config.php";
92
+
93
+ $this->controller = function (App $app) use ($that) {
94
+ $config = $app->config;
95
+
96
+ if (empty($config->factories['controller'])) {
97
+ $ctrl = new \Minify_Controller_MinApp($app->env, $app->sourceFactory, $app->logger);
98
+ } else {
99
+ $ctrl = call_user_func($config->factories['controller'], $app);
100
+ }
101
+
102
+ if ($ctrl instanceof \Minify_ControllerInterface) {
103
+ return $ctrl;
104
+ }
105
+
106
+ $type = $that->typeOf($ctrl);
107
+ throw new \RuntimeException('$min_factories["controller"] callable must return an implementation'
108
+ ." of Minify_CacheInterface. Returned $type");
109
+ };
110
+
111
+ $this->docRoot = function (App $app) {
112
+ $config = $app->config;
113
+ if (empty($config->documentRoot)) {
114
+ return $app->env->getDocRoot();
115
+ }
116
+
117
+ return $app->env->normalizePath($config->documentRoot);
118
+ };
119
+
120
+ $this->env = function (App $app) {
121
+ return new \Minify_Env($app->config->envArgs);
122
+ };
123
+
124
+ $this->errorLogHandler = function (App $app) {
125
+ $format = "%channel%.%level_name%: %message% %context% %extra%";
126
+ $handler = new \Monolog\Handler\ErrorLogHandler();
127
+ $handler->setFormatter(new \Monolog\Formatter\LineFormatter($format));
128
+
129
+ return $handler;
130
+ };
131
+
132
+ $this->groupsConfig = function (App $app) {
133
+ return (require $app->groupsConfigPath);
134
+ };
135
+
136
+ $this->groupsConfigPath = "{$this->dir}/groupsConfig.php";
137
+
138
+ $this->logger = function (App $app) use ($that) {
139
+ $value = $app->config->errorLogger;
140
+
141
+ if ($value instanceof \Psr\Log\LoggerInterface) {
142
+ return $value;
143
+ }
144
+
145
+ $logger = new \Monolog\Logger('minify');
146
+
147
+ if (!$value) {
148
+ return $logger;
149
+ }
150
+
151
+ if ($value === true || $value instanceof \FirePHP) {
152
+ $logger->pushHandler($app->errorLogHandler);
153
+ $logger->pushHandler(new \Monolog\Handler\FirePHPHandler());
154
+
155
+ return $logger;
156
+ }
157
+
158
+ if ($value instanceof \Monolog\Handler\HandlerInterface) {
159
+ $logger->pushHandler($value);
160
+
161
+ return $logger;
162
+ }
163
+
164
+ // BC
165
+ if (is_object($value) && is_callable(array($value, 'log'))) {
166
+ $handler = new \Minify\Logger\LegacyHandler($value);
167
+ $logger->pushHandler($handler);
168
+
169
+ return $logger;
170
+ }
171
+
172
+ $type = $that->typeOf($value);
173
+ throw new \RuntimeException('If set, $min_errorLogger must be a PSR-3 logger or a Monolog handler.'
174
+ ." Given $type");
175
+ };
176
+
177
+ $this->minify = function (App $app) use ($that) {
178
+ $config = $app->config;
179
+
180
+ if (empty($config->factories['minify'])) {
181
+ return new \Minify($app->cache, $app->logger);
182
+ }
183
+
184
+ $minify = call_user_func($config->factories['minify'], $app);
185
+ if ($minify instanceof \Minify) {
186
+ return $minify;
187
+ }
188
+
189
+ $type = $that->typeOf($minify);
190
+ throw new \RuntimeException('$min_factories["minify"] callable must return a Minify object.'
191
+ ." Returned $type");
192
+ };
193
+
194
+ $this->serveOptions = function (App $app) {
195
+ $config = $app->config;
196
+ $env = $app->env;
197
+
198
+ $ret = $config->serveOptions;
199
+
200
+ $ret['minifierOptions']['text/css']['docRoot'] = $app->docRoot;
201
+ $ret['minifierOptions']['text/css']['symlinks'] = $config->symlinks;
202
+ $ret['minApp']['symlinks'] = $config->symlinks;
203
+
204
+ // auto-add targets to allowDirs
205
+ foreach ($config->symlinks as $uri => $target) {
206
+ $ret['minApp']['allowDirs'][] = $target;
207
+ }
208
+
209
+ if ($config->allowDebugFlag) {
210
+ $ret['debug'] = \Minify_DebugDetector::shouldDebugRequest($env);
211
+ }
212
+
213
+ if ($config->concatOnly) {
214
+ $ret['concatOnly'] = true;
215
+ }
216
+
217
+ // check for URI versioning
218
+ if ($env->get('v') !== null || preg_match('/&\\d/', $app->env->server('QUERY_STRING'))) {
219
+ $ret['maxAge'] = 31536000;
220
+ }
221
+
222
+ // need groups config?
223
+ if ($env->get('g') !== null) {
224
+ $ret['minApp']['groups'] = $app->groupsConfig;
225
+ }
226
+
227
+ return $ret;
228
+ };
229
+
230
+ $this->sourceFactory = function (App $app) {
231
+ return new \Minify_Source_Factory($app->env, $app->sourceFactoryOptions, $app->cache);
232
+ };
233
+
234
+ $this->sourceFactoryOptions = function (App $app) {
235
+ $serveOptions = $app->serveOptions;
236
+ $ret = array();
237
+
238
+ // translate legacy setting to option for source factory
239
+ if (isset($serveOptions['minApp']['noMinPattern'])) {
240
+ $ret['noMinPattern'] = $serveOptions['minApp']['noMinPattern'];
241
+ }
242
+
243
+ if (isset($serveOptions['minApp']['allowDirs'])) {
244
+ $ret['allowDirs'] = $serveOptions['minApp']['allowDirs'];
245
+ }
246
+
247
+ if (isset($serveOptions['checkAllowDirs'])) {
248
+ $ret['checkAllowDirs'] = $serveOptions['checkAllowDirs'];
249
+ }
250
+
251
+ if (is_numeric($app->config->uploaderHoursBehind)) {
252
+ $ret['uploaderHoursBehind'] = $app->config->uploaderHoursBehind;
253
+ }
254
+
255
+ return $ret;
256
+ };
257
+ }
258
+
259
+ public function runServer()
260
+ {
261
+ if (!$this->env->get('f') && $this->env->get('g') === null) {
262
+ // no spec given
263
+ $msg = '<p>No "f" or "g" parameters were detected.</p>';
264
+ $url = 'https://github.com/mrclay/minify/blob/master/docs/CommonProblems.wiki.md#long-url-parameters-are-ignored';
265
+ $defaults = $this->minify->getDefaultOptions();
266
+ $this->minify->errorExit($defaults['badRequestHeader'], $url, $msg);
267
+ }
268
+
269
+ $this->minify->serve($this->controller, $this->serveOptions);
270
+ }
271
+
272
+ /**
273
+ * @param mixed $var
274
+ * @return string
275
+ */
276
+ private function typeOf($var)
277
+ {
278
+ $type = gettype($var);
279
+
280
+ return $type === 'object' ? get_class($var) : $type;
281
+ }
282
+ }
lib/vendor/mrclay/minify/lib/Minify/Build.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_Build
4
+ * @package Minify
5
+ */
6
+
7
+ /**
8
+ * Maintain a single last modification time for a group of Minify sources to
9
+ * allow use of far off Expires headers in Minify.
10
+ *
11
+ * <code>
12
+ * // in config file
13
+ * $groupSources = array(
14
+ * 'js' => array('file1.js', 'file2.js')
15
+ * ,'css' => array('file1.css', 'file2.css', 'file3.css')
16
+ * )
17
+ *
18
+ * // during HTML generation
19
+ * $jsBuild = new Minify_Build($groupSources['js']);
20
+ * $cssBuild = new Minify_Build($groupSources['css']);
21
+ *
22
+ * $script = "<script type='text/javascript' src='"
23
+ * . $jsBuild->uri('/min.php/js') . "'></script>";
24
+ * $link = "<link rel='stylesheet' type='text/css' href='"
25
+ * . $cssBuild->uri('/min.php/css') . "'>";
26
+ *
27
+ * // in min.php
28
+ * Minify::serve('Groups', array(
29
+ * 'groups' => $groupSources
30
+ * ,'setExpires' => (time() + 86400 * 365)
31
+ * ));
32
+ * </code>
33
+ *
34
+ * @package Minify
35
+ * @author Stephen Clay <steve@mrclay.org>
36
+ */
37
+ class Minify_Build
38
+ {
39
+
40
+ /**
41
+ * Last modification time of all files in the build
42
+ *
43
+ * @var int
44
+ */
45
+ public $lastModified = 0;
46
+
47
+ /**
48
+ * String to use as ampersand in uri(). Set this to '&' if
49
+ * you are not HTML-escaping URIs.
50
+ *
51
+ * @var string
52
+ */
53
+ public static $ampersand = '&amp;';
54
+
55
+ /**
56
+ * Get a time-stamped URI
57
+ *
58
+ * <code>
59
+ * echo $b->uri('/site.js');
60
+ * // outputs "/site.js?1678242"
61
+ *
62
+ * echo $b->uri('/scriptaculous.js?load=effects');
63
+ * // outputs "/scriptaculous.js?load=effects&amp1678242"
64
+ * </code>
65
+ *
66
+ * @param string $uri
67
+ * @param boolean $forceAmpersand (default = false) Force the use of ampersand to
68
+ * append the timestamp to the URI.
69
+ * @return string
70
+ */
71
+ public function uri($uri, $forceAmpersand = false)
72
+ {
73
+ $sep = ($forceAmpersand || strpos($uri, '?') !== false) ? self::$ampersand : '?';
74
+
75
+ return "{$uri}{$sep}{$this->lastModified}";
76
+ }
77
+
78
+ /**
79
+ * Create a build object
80
+ *
81
+ * @param array $sources array of Minify_Source objects and/or file paths
82
+ *
83
+ * @return null
84
+ */
85
+ public function __construct($sources)
86
+ {
87
+ $max = 0;
88
+ foreach ((array)$sources as $source) {
89
+ if ($source instanceof Minify_Source) {
90
+ $max = max($max, $source->getLastModified());
91
+ } elseif (is_string($source)) {
92
+ if (0 === strpos($source, '//')) {
93
+ $source = $_SERVER['DOCUMENT_ROOT'] . substr($source, 1);
94
+ }
95
+ if (is_file($source)) {
96
+ $max = max($max, filemtime($source));
97
+ }
98
+ }
99
+ }
100
+ $this->lastModified = $max;
101
+ }
102
+ }
lib/vendor/mrclay/minify/lib/Minify/CSS.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_CSS
4
+ * @package Minify
5
+ */
6
+
7
+ /**
8
+ * Minify CSS
9
+ *
10
+ * This class uses Minify_CSS_Compressor and Minify_CSS_UriRewriter to
11
+ * minify CSS and rewrite relative URIs.
12
+ *
13
+ * @package Minify
14
+ * @author Stephen Clay <steve@mrclay.org>
15
+ * @author http://code.google.com/u/1stvamp/ (Issue 64 patch)
16
+ *
17
+ * @deprecated Use Minify_CSSmin
18
+ */
19
+ class Minify_CSS
20
+ {
21
+
22
+ /**
23
+ * Minify a CSS string
24
+ *
25
+ * @param string $css
26
+ *
27
+ * @param array $options available options:
28
+ *
29
+ * 'preserveComments': (default true) multi-line comments that begin
30
+ * with "/*!" will be preserved with newlines before and after to
31
+ * enhance readability.
32
+ *
33
+ * 'removeCharsets': (default true) remove all @charset at-rules
34
+ *
35
+ * 'prependRelativePath': (default null) if given, this string will be
36
+ * prepended to all relative URIs in import/url declarations
37
+ *
38
+ * 'currentDir': (default null) if given, this is assumed to be the
39
+ * directory of the current CSS file. Using this, minify will rewrite
40
+ * all relative URIs in import/url declarations to correctly point to
41
+ * the desired files. For this to work, the files *must* exist and be
42
+ * visible by the PHP process.
43
+ *
44
+ * 'symlinks': (default = array()) If the CSS file is stored in
45
+ * a symlink-ed directory, provide an array of link paths to
46
+ * target paths, where the link paths are within the document root. Because
47
+ * paths need to be normalized for this to work, use "//" to substitute
48
+ * the doc root in the link paths (the array keys). E.g.:
49
+ * <code>
50
+ * array('//symlink' => '/real/target/path') // unix
51
+ * array('//static' => 'D:\\staticStorage') // Windows
52
+ * </code>
53
+ *
54
+ * 'docRoot': (default = $_SERVER['DOCUMENT_ROOT'])
55
+ * see Minify_CSS_UriRewriter::rewrite
56
+ *
57
+ * @return string
58
+ */
59
+ public static function minify($css, $options = array())
60
+ {
61
+ $options = array_merge(array(
62
+ 'compress' => true,
63
+ 'removeCharsets' => true,
64
+ 'preserveComments' => true,
65
+ 'currentDir' => null,
66
+ 'docRoot' => $_SERVER['DOCUMENT_ROOT'],
67
+ 'prependRelativePath' => null,
68
+ 'symlinks' => array(),
69
+ ), $options);
70
+
71
+ if ($options['removeCharsets']) {
72
+ $css = preg_replace('/@charset[^;]+;\\s*/', '', $css);
73
+ }
74
+
75
+ if ($options['compress']) {
76
+ if (! $options['preserveComments']) {
77
+ $css = Minify_CSS_Compressor::process($css, $options);
78
+ } else {
79
+ $processor = array('Minify_CSS_Compressor', 'process');
80
+ $css = Minify_CommentPreserver::process($css, $processor, array($options));
81
+ }
82
+ }
83
+
84
+ if (! $options['currentDir'] && ! $options['prependRelativePath']) {
85
+ return $css;
86
+ }
87
+
88
+ if ($options['currentDir']) {
89
+ $currentDir = $options['currentDir'];
90
+ $docRoot = $options['docRoot'];
91
+ $symlinks = $options['symlinks'];
92
+
93
+ return Minify_CSS_UriRewriter::rewrite($css, $currentDir, $docRoot, $symlinks);
94
+ } else {
95
+ return Minify_CSS_UriRewriter::prepend($css, $options['prependRelativePath']);
96
+ }
97
+ }
98
+ }
lib/vendor/mrclay/minify/lib/Minify/CSS/Compressor.php ADDED
@@ -0,0 +1,275 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_CSS_Compressor
4
+ * @package Minify
5
+ */
6
+
7
+ /**
8
+ * Compress CSS
9
+ *
10
+ * This is a heavy regex-based removal of whitespace, unnecessary
11
+ * comments and tokens, and some CSS value minimization, where practical.
12
+ * Many steps have been taken to avoid breaking comment-based hacks,
13
+ * including the ie5/mac filter (and its inversion), but expect tricky
14
+ * hacks involving comment tokens in 'content' value strings to break
15
+ * minimization badly. A test suite is available.
16
+ *
17
+ * Note: This replaces a lot of spaces with line breaks. It's rumored
18
+ * (https://github.com/yui/yuicompressor/blob/master/README.md#global-options)
19
+ * that some source control tools and old browsers don't like very long lines.
20
+ * Compressed files with shorter lines are also easier to diff. If this is
21
+ * unacceptable please use CSSmin instead.
22
+ *
23
+ * @package Minify
24
+ * @author Stephen Clay <steve@mrclay.org>
25
+ * @author http://code.google.com/u/1stvamp/ (Issue 64 patch)
26
+ *
27
+ * @deprecated Use CSSmin (tubalmartin/cssmin)
28
+ */
29
+ class Minify_CSS_Compressor
30
+ {
31
+
32
+ /**
33
+ * Minify a CSS string
34
+ *
35
+ * @param string $css
36
+ *
37
+ * @param array $options (currently ignored)
38
+ *
39
+ * @return string
40
+ */
41
+ public static function process($css, $options = array())
42
+ {
43
+ $obj = new Minify_CSS_Compressor($options);
44
+
45
+ return $obj->_process($css);
46
+ }
47
+
48
+ /**
49
+ * @var array
50
+ */
51
+ protected $_options = null;
52
+
53
+ /**
54
+ * Are we "in" a hack? I.e. are some browsers targetted until the next comment?
55
+ *
56
+ * @var bool
57
+ */
58
+ protected $_inHack = false;
59
+
60
+ /**
61
+ * Constructor
62
+ *
63
+ * @param array $options (currently ignored)
64
+ */
65
+ private function __construct($options)
66
+ {
67
+ $this->_options = $options;
68
+ }
69
+
70
+ /**
71
+ * Minify a CSS string
72
+ *
73
+ * @param string $css
74
+ *
75
+ * @return string
76
+ */
77
+ protected function _process($css)
78
+ {
79
+ $css = str_replace("\r\n", "\n", $css);
80
+
81
+ // preserve empty comment after '>'
82
+ // http://www.webdevout.net/css-hacks#in_css-selectors
83
+ $css = preg_replace('@>/\\*\\s*\\*/@', '>/*keep*/', $css);
84
+
85
+ // preserve empty comment between property and value
86
+ // http://css-discuss.incutio.com/?page=BoxModelHack
87
+ $css = preg_replace('@/\\*\\s*\\*/\\s*:@', '/*keep*/:', $css);
88
+ $css = preg_replace('@:\\s*/\\*\\s*\\*/@', ':/*keep*/', $css);
89
+
90
+ // apply callback to all valid comments (and strip out surrounding ws
91
+ $pattern = '@\\s*/\\*([\\s\\S]*?)\\*/\\s*@';
92
+ $css = preg_replace_callback($pattern, array($this, '_commentCB'), $css);
93
+
94
+ // remove ws around { } and last semicolon in declaration block
95
+ $css = preg_replace('/\\s*{\\s*/', '{', $css);
96
+ $css = preg_replace('/;?\\s*}\\s*/', '}', $css);
97
+
98
+ // remove ws surrounding semicolons
99
+ $css = preg_replace('/\\s*;\\s*/', ';', $css);
100
+
101
+ // remove ws around urls
102
+ $pattern = '/
103
+ url\\( # url(
104
+ \\s*
105
+ ([^\\)]+?) # 1 = the URL (really just a bunch of non right parenthesis)
106
+ \\s*
107
+ \\) # )
108
+ /x';
109
+ $css = preg_replace($pattern, 'url($1)', $css);
110
+
111
+ // remove ws between rules and colons
112
+ $pattern = '/
113
+ \\s*
114
+ ([{;]) # 1 = beginning of block or rule separator
115
+ \\s*
116
+ ([\\*_]?[\\w\\-]+) # 2 = property (and maybe IE filter)
117
+ \\s*
118
+ :
119
+ \\s*
120
+ (\\b|[#\'"-]) # 3 = first character of a value
121
+ /x';
122
+ $css = preg_replace($pattern, '$1$2:$3', $css);
123
+
124
+ // remove ws in selectors
125
+ $pattern = '/
126
+ (?: # non-capture
127
+ \\s*
128
+ [^~>+,\\s]+ # selector part
129
+ \\s*
130
+ [,>+~] # combinators
131
+ )+
132
+ \\s*
133
+ [^~>+,\\s]+ # selector part
134
+ { # open declaration block
135
+ /x';
136
+ $css = preg_replace_callback($pattern, array($this, '_selectorsCB'), $css);
137
+
138
+ // minimize hex colors
139
+ $pattern = '/([^=])#([a-f\\d])\\2([a-f\\d])\\3([a-f\\d])\\4([\\s;\\}])/i';
140
+ $css = preg_replace($pattern, '$1#$2$3$4$5', $css);
141
+
142
+ // remove spaces between font families
143
+ $pattern = '/font-family:([^;}]+)([;}])/';
144
+ $css = preg_replace_callback($pattern, array($this, '_fontFamilyCB'), $css);
145
+
146
+ $css = preg_replace('/@import\\s+url/', '@import url', $css);
147
+
148
+ // replace any ws involving newlines with a single newline
149
+ $css = preg_replace('/[ \\t]*\\n+\\s*/', "\n", $css);
150
+
151
+ // separate common descendent selectors w/ newlines (to limit line lengths)
152
+ $pattern = '/([\\w#\\.\\*]+)\\s+([\\w#\\.\\*]+){/';
153
+ $css = preg_replace($pattern, "$1\n$2{", $css);
154
+
155
+ // Use newline after 1st numeric value (to limit line lengths).
156
+ $pattern = '/
157
+ ((?:padding|margin|border|outline):\\d+(?:px|em)?) # 1 = prop : 1st numeric value
158
+ \\s+
159
+ /x';
160
+ $css = preg_replace($pattern, "$1\n", $css);
161
+
162
+ // prevent triggering IE6 bug: http://www.crankygeek.com/ie6pebug/
163
+ $css = preg_replace('/:first-l(etter|ine)\\{/', ':first-l$1 {', $css);
164
+
165
+ return trim($css);
166
+ }
167
+
168
+ /**
169
+ * Replace what looks like a set of selectors
170
+ *
171
+ * @param array $m regex matches
172
+ *
173
+ * @return string
174
+ */
175
+ protected function _selectorsCB($m)
176
+ {
177
+ // remove ws around the combinators
178
+ return preg_replace('/\\s*([,>+~])\\s*/', '$1', $m[0]);
179
+ }
180
+
181
+ /**
182
+ * Process a comment and return a replacement
183
+ *
184
+ * @param array $m regex matches
185
+ *
186
+ * @return string
187
+ */
188
+ protected function _commentCB($m)
189
+ {
190
+ $hasSurroundingWs = (trim($m[0]) !== $m[1]);
191
+ $m = $m[1];
192
+ // $m is the comment content w/o the surrounding tokens,
193
+ // but the return value will replace the entire comment.
194
+ if ($m === 'keep') {
195
+ return '/**/';
196
+ }
197
+
198
+ if ($m === '" "') {
199
+ // component of http://tantek.com/CSS/Examples/midpass.html
200
+ return '/*" "*/';
201
+ }
202
+
203
+ if (preg_match('@";\\}\\s*\\}/\\*\\s+@', $m)) {
204
+ // component of http://tantek.com/CSS/Examples/midpass.html
205
+ return '/*";}}/* */';
206
+ }
207
+
208
+ if ($this->_inHack) {
209
+ // inversion: feeding only to one browser
210
+ $pattern = '@
211
+ ^/ # comment started like /*/
212
+ \\s*
213
+ (\\S[\\s\\S]+?) # has at least some non-ws content
214
+ \\s*
215
+ /\\* # ends like /*/ or /**/
216
+ @x';
217
+ if (preg_match($pattern, $m, $n)) {
218
+ // end hack mode after this comment, but preserve the hack and comment content
219
+ $this->_inHack = false;
220
+
221
+ return "/*/{$n[1]}/**/";
222
+ }
223
+ }
224
+
225
+ if (substr($m, -1) === '\\') { // comment ends like \*/
226
+ // begin hack mode and preserve hack
227
+ $this->_inHack = true;
228
+
229
+ return '/*\\*/';
230
+ }
231
+
232
+ if ($m !== '' && $m[0] === '/') { // comment looks like /*/ foo */
233
+ // begin hack mode and preserve hack
234
+ $this->_inHack = true;
235
+
236
+ return '/*/*/';
237
+ }
238
+
239
+ if ($this->_inHack) {
240
+ // a regular comment ends hack mode but should be preserved
241
+ $this->_inHack = false;
242
+
243
+ return '/**/';
244
+ }
245
+
246
+ // Issue 107: if there's any surrounding whitespace, it may be important, so
247
+ // replace the comment with a single space
248
+ return $hasSurroundingWs ? ' ' : ''; // remove all other comments
249
+ }
250
+
251
+ /**
252
+ * Process a font-family listing and return a replacement
253
+ *
254
+ * @param array $m regex matches
255
+ *
256
+ * @return string
257
+ */
258
+ protected function _fontFamilyCB($m)
259
+ {
260
+ // Issue 210: must not eliminate WS between words in unquoted families
261
+ $flags = PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY;
262
+ $pieces = preg_split('/(\'[^\']+\'|"[^"]+")/', $m[1], null, $flags);
263
+ $out = 'font-family:';
264
+
265
+ while (null !== ($piece = array_shift($pieces))) {
266
+ if ($piece[0] !== '"' && $piece[0] !== "'") {
267
+ $piece = preg_replace('/\\s+/', ' ', $piece);
268
+ $piece = preg_replace('/\\s?,\\s?/', ',', $piece);
269
+ }
270
+ $out .= $piece;
271
+ }
272
+
273
+ return $out . $m[2];
274
+ }
275
+ }
lib/vendor/mrclay/minify/lib/Minify/CSS/UriRewriter.php ADDED
@@ -0,0 +1,358 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_CSS_UriRewriter
4
+ * @package Minify
5
+ */
6
+
7
+ /**
8
+ * Rewrite file-relative URIs as root-relative in CSS files
9
+ *
10
+ * @package Minify
11
+ * @author Stephen Clay <steve@mrclay.org>
12
+ */
13
+ class Minify_CSS_UriRewriter
14
+ {
15
+
16
+ /**
17
+ * rewrite() and rewriteRelative() append debugging information here
18
+ *
19
+ * @var string
20
+ */
21
+ public static $debugText = '';
22
+
23
+ /**
24
+ * In CSS content, rewrite file relative URIs as root relative
25
+ *
26
+ * @param string $css
27
+ *
28
+ * @param string $currentDir The directory of the current CSS file.
29
+ *
30
+ * @param string $docRoot The document root of the web site in which
31
+ * the CSS file resides (default = $_SERVER['DOCUMENT_ROOT']).
32
+ *
33
+ * @param array $symlinks (default = array()) If the CSS file is stored in
34
+ * a symlink-ed directory, provide an array of link paths to
35
+ * target paths, where the link paths are within the document root. Because
36
+ * paths need to be normalized for this to work, use "//" to substitute
37
+ * the doc root in the link paths (the array keys). E.g.:
38
+ * <code>
39
+ * array('//symlink' => '/real/target/path') // unix
40
+ * array('//static' => 'D:\\staticStorage') // Windows
41
+ * </code>
42
+ *
43
+ * @return string
44
+ */
45
+ public static function rewrite($css, $currentDir, $docRoot = null, $symlinks = array())
46
+ {
47
+ self::$_docRoot = self::_realpath(
48
+ $docRoot ? $docRoot : $_SERVER['DOCUMENT_ROOT']
49
+ );
50
+ self::$_currentDir = self::_realpath($currentDir);
51
+ self::$_symlinks = array();
52
+
53
+ // normalize symlinks in order to map to link
54
+ foreach ($symlinks as $link => $target) {
55
+ $link = ($link === '//') ? self::$_docRoot : str_replace('//', self::$_docRoot . '/', $link);
56
+ $link = strtr($link, '/', DIRECTORY_SEPARATOR);
57
+
58
+ self::$_symlinks[$link] = self::_realpath($target);
59
+ }
60
+
61
+ self::$debugText .= "docRoot : " . self::$_docRoot . "\n"
62
+ . "currentDir : " . self::$_currentDir . "\n";
63
+ if (self::$_symlinks) {
64
+ self::$debugText .= "symlinks : " . var_export(self::$_symlinks, 1) . "\n";
65
+ }
66
+ self::$debugText .= "\n";
67
+
68
+ $css = self::_trimUrls($css);
69
+
70
+ $css = self::_owlifySvgPaths($css);
71
+
72
+ // rewrite
73
+ $pattern = '/@import\\s+([\'"])(.*?)[\'"]/';
74
+ $css = preg_replace_callback($pattern, array(self::$className, '_processUriCB'), $css);
75
+
76
+ $pattern = '/url\\(\\s*([\'"](.*?)[\'"]|[^\\)\\s]+)\\s*\\)/';
77
+ $css = preg_replace_callback($pattern, array(self::$className, '_processUriCB'), $css);
78
+
79
+ $css = self::_unOwlify($css);
80
+
81
+ return $css;
82
+ }
83
+
84
+ /**
85
+ * In CSS content, prepend a path to relative URIs
86
+ *
87
+ * @param string $css
88
+ *
89
+ * @param string $path The path to prepend.
90
+ *
91
+ * @return string
92
+ */
93
+ public static function prepend($css, $path)
94
+ {
95
+ self::$_prependPath = $path;
96
+
97
+ $css = self::_trimUrls($css);
98
+
99
+ $css = self::_owlifySvgPaths($css);
100
+
101
+ // append
102
+ $pattern = '/@import\\s+([\'"])(.*?)[\'"]/';
103
+ $css = preg_replace_callback($pattern, array(self::$className, '_processUriCB'), $css);
104
+
105
+ $pattern = '/url\\(\\s*([\'"](.*?)[\'"]|[^\\)\\s]+)\\s*\\)/';
106
+ $css = preg_replace_callback($pattern, array(self::$className, '_processUriCB'), $css);
107
+
108
+ $css = self::_unOwlify($css);
109
+
110
+ self::$_prependPath = null;
111
+
112
+ return $css;
113
+ }
114
+
115
+ /**
116
+ * Get a root relative URI from a file relative URI
117
+ *
118
+ * <code>
119
+ * Minify_CSS_UriRewriter::rewriteRelative(
120
+ * '../img/hello.gif'
121
+ * , '/home/user/www/css' // path of CSS file
122
+ * , '/home/user/www' // doc root
123
+ * );
124
+ * // returns '/img/hello.gif'
125
+ *
126
+ * // example where static files are stored in a symlinked directory
127
+ * Minify_CSS_UriRewriter::rewriteRelative(
128
+ * 'hello.gif'
129
+ * , '/var/staticFiles/theme'
130
+ * , '/home/user/www'
131
+ * , array('/home/user/www/static' => '/var/staticFiles')
132
+ * );
133
+ * // returns '/static/theme/hello.gif'
134
+ * </code>
135
+ *
136
+ * @param string $uri file relative URI
137
+ *
138
+ * @param string $realCurrentDir realpath of the current file's directory.
139
+ *
140
+ * @param string $realDocRoot realpath of the site document root.
141
+ *
142
+ * @param array $symlinks (default = array()) If the file is stored in
143
+ * a symlink-ed directory, provide an array of link paths to
144
+ * real target paths, where the link paths "appear" to be within the document
145
+ * root. E.g.:
146
+ * <code>
147
+ * array('/home/foo/www/not/real/path' => '/real/target/path') // unix
148
+ * array('C:\\htdocs\\not\\real' => 'D:\\real\\target\\path') // Windows
149
+ * </code>
150
+ *
151
+ * @return string
152
+ */
153
+ public static function rewriteRelative($uri, $realCurrentDir, $realDocRoot, $symlinks = array())
154
+ {
155
+ // prepend path with current dir separator (OS-independent)
156
+ $path = strtr($realCurrentDir, '/', DIRECTORY_SEPARATOR);
157
+ $path .= DIRECTORY_SEPARATOR . strtr($uri, '/', DIRECTORY_SEPARATOR);
158
+
159
+ self::$debugText .= "file-relative URI : {$uri}\n"
160
+ . "path prepended : {$path}\n";
161
+
162
+ // "unresolve" a symlink back to doc root
163
+ foreach ($symlinks as $link => $target) {
164
+ if (0 === strpos($path, $target)) {
165
+ // replace $target with $link
166
+ $path = $link . substr($path, strlen($target));
167
+
168
+ self::$debugText .= "symlink unresolved : {$path}\n";
169
+
170
+ break;
171
+ }
172
+ }
173
+ // strip doc root
174
+ $path = substr($path, strlen($realDocRoot));
175
+
176
+ self::$debugText .= "docroot stripped : {$path}\n";
177
+
178
+ // fix to root-relative URI
179
+ $uri = strtr($path, '/\\', '//');
180
+ $uri = self::removeDots($uri);
181
+
182
+ self::$debugText .= "traversals removed : {$uri}\n\n";
183
+
184
+ return $uri;
185
+ }
186
+
187
+ /**
188
+ * Remove instances of "./" and "../" where possible from a root-relative URI
189
+ *
190
+ * @param string $uri
191
+ *
192
+ * @return string
193
+ */
194
+ public static function removeDots($uri)
195
+ {
196
+ $uri = str_replace('/./', '/', $uri);
197
+ // inspired by patch from Oleg Cherniy
198
+ do {
199
+ $uri = preg_replace('@/[^/]+/\\.\\./@', '/', $uri, 1, $changed);
200
+ } while ($changed);
201
+
202
+ return $uri;
203
+ }
204
+
205
+ /**
206
+ * Defines which class to call as part of callbacks, change this
207
+ * if you extend Minify_CSS_UriRewriter
208
+ *
209
+ * @var string
210
+ */
211
+ protected static $className = 'Minify_CSS_UriRewriter';
212
+
213
+ /**
214
+ * Get realpath with any trailing slash removed. If realpath() fails,
215
+ * just remove the trailing slash.
216
+ *
217
+ * @param string $path
218
+ *
219
+ * @return mixed path with no trailing slash
220
+ */
221
+ protected static function _realpath($path)
222
+ {
223
+ $realPath = realpath($path);
224
+ if ($realPath !== false) {
225
+ $path = $realPath;
226
+ }
227
+
228
+ return rtrim($path, '/\\');
229
+ }
230
+
231
+ /**
232
+ * Directory of this stylesheet
233
+ *
234
+ * @var string
235
+ */
236
+ private static $_currentDir = '';
237
+
238
+ /**
239
+ * DOC_ROOT
240
+ *
241
+ * @var string
242
+ */
243
+ private static $_docRoot = '';
244
+
245
+ /**
246
+ * directory replacements to map symlink targets back to their
247
+ * source (within the document root) E.g. '/var/www/symlink' => '/var/realpath'
248
+ *
249
+ * @var array
250
+ */
251
+ private static $_symlinks = array();
252
+
253
+ /**
254
+ * Path to prepend
255
+ *
256
+ * @var string
257
+ */
258
+ private static $_prependPath = null;
259
+
260
+ /**
261
+ * @param string $css
262
+ *
263
+ * @return string
264
+ */
265
+ private static function _trimUrls($css)
266
+ {
267
+ $pattern = '/
268
+ url\\( # url(
269
+ \\s*
270
+ ([^\\)]+?) # 1 = URI (assuming does not contain ")")
271
+ \\s*
272
+ \\) # )
273
+ /x';
274
+
275
+ return preg_replace($pattern, 'url($1)', $css);
276
+ }
277
+
278
+ /**
279
+ * @param array $m
280
+ *
281
+ * @return string
282
+ */
283
+ private static function _processUriCB($m)
284
+ {
285
+ // $m matched either '/@import\\s+([\'"])(.*?)[\'"]/' or '/url\\(\\s*([^\\)\\s]+)\\s*\\)/'
286
+ $isImport = ($m[0][0] === '@');
287
+ // determine URI and the quote character (if any)
288
+ if ($isImport) {
289
+ $quoteChar = $m[1];
290
+ $uri = $m[2];
291
+ } else {
292
+ // $m[1] is either quoted or not
293
+ $quoteChar = ($m[1][0] === "'" || $m[1][0] === '"') ? $m[1][0] : '';
294
+
295
+ $uri = ($quoteChar === '') ? $m[1] : substr($m[1], 1, strlen($m[1]) - 2);
296
+ }
297
+
298
+ if ($uri === '') {
299
+ return $m[0];
300
+ }
301
+
302
+ // if not root/scheme relative and not starts with scheme
303
+ if (!preg_match('~^(/|[a-z]+\:)~', $uri)) {
304
+ // URI is file-relative: rewrite depending on options
305
+ if (self::$_prependPath === null) {
306
+ $uri = self::rewriteRelative($uri, self::$_currentDir, self::$_docRoot, self::$_symlinks);
307
+ } else {
308
+ $uri = self::$_prependPath . $uri;
309
+ if ($uri[0] === '/') {
310
+ $root = '';
311
+ $rootRelative = $uri;
312
+ $uri = $root . self::removeDots($rootRelative);
313
+ } elseif (preg_match('@^((https?\:)?//([^/]+))/@', $uri, $m) && (false !== strpos($m[3], '.'))) {
314
+ $root = $m[1];
315
+ $rootRelative = substr($uri, strlen($root));
316
+ $uri = $root . self::removeDots($rootRelative);
317
+ }
318
+ }
319
+ }
320
+
321
+ if ($isImport) {
322
+ return "@import {$quoteChar}{$uri}{$quoteChar}";
323
+ } else {
324
+ return "url({$quoteChar}{$uri}{$quoteChar})";
325
+ }
326
+ }
327
+
328
+ /**
329
+ * Mungs some inline SVG URL declarations so they won't be touched
330
+ *
331
+ * @link https://github.com/mrclay/minify/issues/517
332
+ * @see _unOwlify
333
+ *
334
+ * @param string $css
335
+ * @return string
336
+ */
337
+ private static function _owlifySvgPaths($css)
338
+ {
339
+ $pattern = '~\b((?:clip-path|mask|-webkit-mask)\s*\:\s*)url(\(\s*#\w+\s*\))~';
340
+
341
+ return preg_replace($pattern, '$1owl$2', $css);
342
+ }
343
+
344
+ /**
345
+ * Undo work of _owlify
346
+ *
347
+ * @see _owlifySvgPaths
348
+ *
349
+ * @param string $css
350
+ * @return string
351
+ */
352
+ private static function _unOwlify($css)
353
+ {
354
+ $pattern = '~\b((?:clip-path|mask|-webkit-mask)\s*\:\s*)owl~';
355
+
356
+ return preg_replace($pattern, '$1url', $css);
357
+ }
358
+ }
lib/vendor/mrclay/minify/lib/Minify/CSSmin.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_CSSmin
4
+ * @package Minify
5
+ */
6
+
7
+ use tubalmartin\CssMin\Minifier as CSSmin;
8
+
9
+ /**
10
+ * Wrapper for CSSmin
11
+ *
12
+ * This class uses CSSmin and Minify_CSS_UriRewriter to minify CSS and rewrite relative URIs.
13
+ *
14
+ * @package Minify
15
+ * @author Stephen Clay <steve@mrclay.org>
16
+ */
17
+ class Minify_CSSmin
18
+ {
19
+
20
+ /**
21
+ * Minify a CSS string
22
+ *
23
+ * @param string $css
24
+ *
25
+ * @param array $options available options:
26
+ *
27
+ * 'removeCharsets': (default true) remove all @charset at-rules
28
+ *
29
+ * 'prependRelativePath': (default null) if given, this string will be
30
+ * prepended to all relative URIs in import/url declarations
31
+ *
32
+ * 'currentDir': (default null) if given, this is assumed to be the
33
+ * directory of the current CSS file. Using this, minify will rewrite
34
+ * all relative URIs in import/url declarations to correctly point to
35
+ * the desired files. For this to work, the files *must* exist and be
36
+ * visible by the PHP process.
37
+ *
38
+ * 'symlinks': (default = array()) If the CSS file is stored in
39
+ * a symlink-ed directory, provide an array of link paths to
40
+ * target paths, where the link paths are within the document root. Because
41
+ * paths need to be normalized for this to work, use "//" to substitute
42
+ * the doc root in the link paths (the array keys). E.g.:
43
+ * <code>
44
+ * array('//symlink' => '/real/target/path') // unix
45
+ * array('//static' => 'D:\\staticStorage') // Windows
46
+ * </code>
47
+ *
48
+ * 'docRoot': (default = $_SERVER['DOCUMENT_ROOT'])
49
+ * see Minify_CSS_UriRewriter::rewrite
50
+ *
51
+ * @return string
52
+ */
53
+ public static function minify($css, $options = array())
54
+ {
55
+ $options = array_merge(array(
56
+ 'compress' => true,
57
+ 'removeCharsets' => true,
58
+ 'currentDir' => null,
59
+ 'docRoot' => $_SERVER['DOCUMENT_ROOT'],
60
+ 'prependRelativePath' => null,
61
+ 'symlinks' => array(),
62
+ ), $options);
63
+
64
+ if ($options['removeCharsets']) {
65
+ $css = preg_replace('/@charset[^;]+;\\s*/', '', $css);
66
+ }
67
+ if ($options['compress']) {
68
+ $obj = new CSSmin();
69
+ $css = $obj->run($css);
70
+ }
71
+ if (! $options['currentDir'] && ! $options['prependRelativePath']) {
72
+ return $css;
73
+ }
74
+ if ($options['currentDir']) {
75
+ return Minify_CSS_UriRewriter::rewrite(
76
+ $css
77
+ ,$options['currentDir']
78
+ ,$options['docRoot']
79
+ ,$options['symlinks']
80
+ );
81
+ } else {
82
+ return Minify_CSS_UriRewriter::prepend(
83
+ $css
84
+ ,$options['prependRelativePath']
85
+ );
86
+ }
87
+ }
88
+ }
lib/vendor/mrclay/minify/lib/Minify/Cache/APC.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_Cache_APC
4
+ * @package Minify
5
+ */
6
+
7
+ /**
8
+ * APC-based cache class for Minify
9
+ *
10
+ * <code>
11
+ * Minify::setCache(new Minify_Cache_APC());
12
+ * </code>
13
+ *
14
+ * @package Minify
15
+ * @author Chris Edwards
16
+ **/
17
+ class Minify_Cache_APC implements Minify_CacheInterface
18
+ {
19
+
20
+ /**
21
+ * Create a Minify_Cache_APC object, to be passed to
22
+ * Minify::setCache().
23
+ *
24
+ *
25
+ * @param int $expire seconds until expiration (default = 0
26
+ * meaning the item will not get an expiration date)
27
+ *
28
+ * @return null
29
+ */
30
+ public function __construct($expire = 0)
31
+ {
32
+ $this->_exp = $expire;
33
+ }
34
+
35
+ /**
36
+ * Write data to cache.
37
+ *
38
+ * @param string $id cache id
39
+ *
40
+ * @param string $data
41
+ *
42
+ * @return bool success
43
+ */
44
+ public function store($id, $data)
45
+ {
46
+ return apc_store($id, "{$_SERVER['REQUEST_TIME']}|{$data}", $this->_exp);
47
+ }
48
+
49
+ /**
50
+ * Get the size of a cache entry
51
+ *
52
+ * @param string $id cache id
53
+ *
54
+ * @return int size in bytes
55
+ */
56
+ public function getSize($id)
57
+ {
58
+ if (! $this->_fetch($id)) {
59
+ return false;
60
+ }
61
+
62
+ if (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)) {
63
+ return mb_strlen($this->_data, '8bit');
64
+ } else {
65
+ return strlen($this->_data);
66
+ }
67
+ }
68
+
69
+ /**
70
+ * Does a valid cache entry exist?
71
+ *
72
+ * @param string $id cache id
73
+ *
74
+ * @param int $srcMtime mtime of the original source file(s)
75
+ *
76
+ * @return bool exists
77
+ */
78
+ public function isValid($id, $srcMtime)
79
+ {
80
+ return ($this->_fetch($id) && ($this->_lm >= $srcMtime));
81
+ }
82
+
83
+ /**
84
+ * Send the cached content to output
85
+ *
86
+ * @param string $id cache id
87
+ */
88
+ public function display($id)
89
+ {
90
+ echo $this->_fetch($id) ? $this->_data : '';
91
+ }
92
+
93
+ /**
94
+ * Fetch the cached content
95
+ *
96
+ * @param string $id cache id
97
+ *
98
+ * @return string
99
+ */
100
+ public function fetch($id)
101
+ {
102
+ return $this->_fetch($id) ? $this->_data : '';
103
+ }
104
+
105
+ private $_exp = null;
106
+
107
+ // cache of most recently fetched id
108
+ private $_lm = null;
109
+ private $_data = null;
110
+ private $_id = null;
111
+
112
+ /**
113
+ * Fetch data and timestamp from apc, store in instance
114
+ *
115
+ * @param string $id
116
+ *
117
+ * @return bool success
118
+ */
119
+ private function _fetch($id)
120
+ {
121
+ if ($this->_id === $id) {
122
+ return true;
123
+ }
124
+ $ret = apc_fetch($id);
125
+ if (false === $ret) {
126
+ $this->_id = null;
127
+
128
+ return false;
129
+ }
130
+
131
+ list($this->_lm, $this->_data) = explode('|', $ret, 2);
132
+ $this->_id = $id;
133
+
134
+ return true;
135
+ }
136
+ }
lib/vendor/mrclay/minify/lib/Minify/Cache/File.php ADDED
@@ -0,0 +1,183 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_Cache_File
4
+ * @package Minify
5
+ */
6
+
7
+ use Psr\Log\LoggerInterface;
8
+
9
+ class Minify_Cache_File implements Minify_CacheInterface
10
+ {
11
+
12
+ /**
13
+ * @var string
14
+ */
15
+ private $path;
16
+
17
+ /**
18
+ * @var bool
19
+ */
20
+ private $locking;
21
+
22
+ /**
23
+ * @var LoggerInterface
24
+ */
25
+ private $logger;
26
+
27
+ /**
28
+ * @param string $path
29
+ * @param bool $fileLocking
30
+ * @param LoggerInterface $logger
31
+ */
32
+ public function __construct($path = '', $fileLocking = false, LoggerInterface $logger = null)
33
+ {
34
+ if (! $path) {
35
+ $path = sys_get_temp_dir();
36
+ }
37
+ $this->locking = $fileLocking;
38
+ $this->path = $path;
39
+
40
+ if (!$logger) {
41
+ $logger = new \Monolog\Logger('minify');
42
+ }
43
+ $this->logger = $logger;
44
+ }
45
+
46
+ /**
47
+ * Write data to cache.
48
+ *
49
+ * @param string $id cache id (e.g. a filename)
50
+ *
51
+ * @param string $data
52
+ *
53
+ * @return bool success
54
+ */
55
+ public function store($id, $data)
56
+ {
57
+ $flag = $this->locking ? LOCK_EX : null;
58
+ $file = $this->path . '/' . $id;
59
+
60
+ if (! @file_put_contents($file, $data, $flag)) {
61
+ $this->logger->warning("Minify_Cache_File: Write failed to '$file'");
62
+ }
63
+
64
+ // write control
65
+ if ($data !== $this->fetch($id)) {
66
+ @unlink($file);
67
+ $this->logger->warning("Minify_Cache_File: Post-write read failed for '$file'");
68
+
69
+ return false;
70
+ }
71
+
72
+ return true;
73
+ }
74
+
75
+ /**
76
+ * Get the size of a cache entry
77
+ *
78
+ * @param string $id cache id (e.g. a filename)
79
+ *
80
+ * @return int size in bytes
81
+ */
82
+ public function getSize($id)
83
+ {
84
+ return filesize($this->path . '/' . $id);
85
+ }
86
+
87
+ /**
88
+ * Does a valid cache entry exist?
89
+ *
90
+ * @param string $id cache id (e.g. a filename)
91
+ *
92
+ * @param int $srcMtime mtime of the original source file(s)
93
+ *
94
+ * @return bool exists
95
+ */
96
+ public function isValid($id, $srcMtime)
97
+ {
98
+ $file = $this->path . '/' . $id;
99
+
100
+ return (is_file($file) && (filemtime($file) >= $srcMtime));
101
+ }
102
+
103
+ /**
104
+ * Send the cached content to output
105
+ *
106
+ * @param string $id cache id (e.g. a filename)
107
+ */
108
+ public function display($id)
109
+ {
110
+ if (!$this->locking) {
111
+ readfile($this->path . '/' . $id);
112
+
113
+ return;
114
+ }
115
+
116
+ $fp = fopen($this->path . '/' . $id, 'rb');
117
+ flock($fp, LOCK_SH);
118
+ fpassthru($fp);
119
+ flock($fp, LOCK_UN);
120
+ fclose($fp);
121
+ }
122
+
123
+ /**
124
+ * Fetch the cached content
125
+ *
126
+ * @param string $id cache id (e.g. a filename)
127
+ *
128
+ * @return string
129
+ */
130
+ public function fetch($id)
131
+ {
132
+ if (!$this->locking) {
133
+ return file_get_contents($this->path . '/' . $id);
134
+ }
135
+
136
+ $fp = fopen($this->path . '/' . $id, 'rb');
137
+ if (!$fp) {
138
+ return false;
139
+ }
140
+
141
+ flock($fp, LOCK_SH);
142
+ $ret = stream_get_contents($fp);
143
+ flock($fp, LOCK_UN);
144
+ fclose($fp);
145
+
146
+ return $ret;
147
+ }
148
+
149
+ /**
150
+ * Fetch the cache path used
151
+ *
152
+ * @return string
153
+ */
154
+ public function getPath()
155
+ {
156
+ return $this->path;
157
+ }
158
+
159
+ /**
160
+ * Get a usable temp directory
161
+ *
162
+ * @return string
163
+ * @deprecated
164
+ */
165
+ public static function tmp()
166
+ {
167
+ trigger_error(__METHOD__ . ' is deprecated in Minfy 3.0', E_USER_DEPRECATED);
168
+
169
+ return sys_get_temp_dir();
170
+ }
171
+
172
+ /**
173
+ * Send message to the Minify logger
174
+ * @param string $msg
175
+ * @return null
176
+ * @deprecated Use $this->logger
177
+ */
178
+ protected function _log($msg)
179
+ {
180
+ trigger_error(__METHOD__ . ' is deprecated in Minify 3.0.', E_USER_DEPRECATED);
181
+ $this->logger->warning($msg);
182
+ }
183
+ }
lib/vendor/mrclay/minify/lib/Minify/Cache/Memcache.php ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_Cache_Memcache
4
+ * @package Minify
5
+ */
6
+
7
+ /**
8
+ * Memcache-based cache class for Minify
9
+ *
10
+ * <code>
11
+ * // fall back to disk caching if memcache can't connect
12
+ * $memcache = new Memcache;
13
+ * if ($memcache->connect('localhost', 11211)) {
14
+ * Minify::setCache(new Minify_Cache_Memcache($memcache));
15
+ * } else {
16
+ * Minify::setCache();
17
+ * }
18
+ * </code>
19
+ **/
20
+ class Minify_Cache_Memcache implements Minify_CacheInterface
21
+ {
22
+
23
+ /**
24
+ * Create a Minify_Cache_Memcache object, to be passed to
25
+ * Minify::setCache().
26
+ *
27
+ * @param Memcache $memcache already-connected instance
28
+ *
29
+ * @param int $expire seconds until expiration (default = 0
30
+ * meaning the item will not get an expiration date)
31
+ */
32
+ public function __construct($memcache, $expire = 0)
33
+ {
34
+ $this->_mc = $memcache;
35
+ $this->_exp = $expire;
36
+ }
37
+
38
+ /**
39
+ * Write data to cache.
40
+ *
41
+ * @param string $id cache id
42
+ *
43
+ * @param string $data
44
+ *
45
+ * @return bool success
46
+ */
47
+ public function store($id, $data)
48
+ {
49
+ return $this->_mc->set($id, "{$_SERVER['REQUEST_TIME']}|{$data}", 0, $this->_exp);
50
+ }
51
+
52
+ /**
53
+ * Get the size of a cache entry
54
+ *
55
+ * @param string $id cache id
56
+ *
57
+ * @return int size in bytes
58
+ */
59
+ public function getSize($id)
60
+ {
61
+ if (! $this->_fetch($id)) {
62
+ return false;
63
+ }
64
+
65
+ if (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)) {
66
+ return mb_strlen($this->_data, '8bit');
67
+ } else {
68
+ return strlen($this->_data);
69
+ }
70
+ }
71
+
72
+ /**
73
+ * Does a valid cache entry exist?
74
+ *
75
+ * @param string $id cache id
76
+ *
77
+ * @param int $srcMtime mtime of the original source file(s)
78
+ *
79
+ * @return bool exists
80
+ */
81
+ public function isValid($id, $srcMtime)
82
+ {
83
+ return ($this->_fetch($id) && ($this->_lm >= $srcMtime));
84
+ }
85
+
86
+ /**
87
+ * Send the cached content to output
88
+ *
89
+ * @param string $id cache id
90
+ */
91
+ public function display($id)
92
+ {
93
+ echo $this->_fetch($id) ? $this->_data : '';
94
+ }
95
+
96
+ /**
97
+ * Fetch the cached content
98
+ *
99
+ * @param string $id cache id
100
+ *
101
+ * @return string
102
+ */
103
+ public function fetch($id)
104
+ {
105
+ return $this->_fetch($id) ? $this->_data : '';
106
+ }
107
+
108
+ private $_mc = null;
109
+ private $_exp = null;
110
+
111
+ // cache of most recently fetched id
112
+ private $_lm = null;
113
+ private $_data = null;
114
+ private $_id = null;
115
+
116
+ /**
117
+ * Fetch data and timestamp from memcache, store in instance
118
+ *
119
+ * @param string $id
120
+ *
121
+ * @return bool success
122
+ */
123
+ private function _fetch($id)
124
+ {
125
+ if ($this->_id === $id) {
126
+ return true;
127
+ }
128
+
129
+ $ret = $this->_mc->get($id);
130
+ if (false === $ret) {
131
+ $this->_id = null;
132
+
133
+ return false;
134
+ }
135
+
136
+ list($this->_lm, $this->_data) = explode('|', $ret, 2);
137
+ $this->_id = $id;
138
+
139
+ return true;
140
+ }
141
+ }
lib/vendor/mrclay/minify/lib/Minify/Cache/Null.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Class Minify_Cache_Null
5
+ *
6
+ * If this is used, Minify will not use a cache and, for each 200 response, will
7
+ * need to recombine files, minify and encode the output.
8
+ *
9
+ * @package Minify
10
+ */
11
+ class Minify_Cache_Null implements Minify_CacheInterface
12
+ {
13
+ /**
14
+ * Write data to cache.
15
+ *
16
+ * @param string $id cache id (e.g. a filename)
17
+ * @param string $data
18
+ *
19
+ * @return bool success
20
+ */
21
+ public function store($id, $data)
22
+ {
23
+ }
24
+
25
+ /**
26
+ * Get the size of a cache entry
27
+ *
28
+ * @param string $id cache id (e.g. a filename)
29
+ *
30
+ * @return int size in bytes
31
+ */
32
+ public function getSize($id)
33
+ {
34
+ }
35
+
36
+ /**
37
+ * Does a valid cache entry exist?
38
+ *
39
+ * @param string $id cache id (e.g. a filename)
40
+ * @param int $srcMtime mtime of the original source file(s)
41
+ *
42
+ * @return bool exists
43
+ */
44
+ public function isValid($id, $srcMtime)
45
+ {
46
+ }
47
+
48
+ /**
49
+ * Send the cached content to output
50
+ *
51
+ * @param string $id cache id (e.g. a filename)
52
+ */
53
+ public function display($id)
54
+ {
55
+ }
56
+
57
+ /**
58
+ * Fetch the cached content
59
+ *
60
+ * @param string $id cache id (e.g. a filename)
61
+ *
62
+ * @return string
63
+ */
64
+ public function fetch($id)
65
+ {
66
+ }
67
+ }
lib/vendor/mrclay/minify/lib/Minify/Cache/WinCache.php ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_Cache_Wincache
4
+ * @package Minify
5
+ */
6
+
7
+ /**
8
+ * WinCache-based cache class for Minify
9
+ *
10
+ * <code>
11
+ * Minify::setCache(new Minify_Cache_WinCache());
12
+ * </code>
13
+ *
14
+ * @package Minify
15
+ * @author Matthias Fax
16
+ **/
17
+ class Minify_Cache_WinCache implements Minify_CacheInterface
18
+ {
19
+ /**
20
+ * Create a Minify_Cache_Wincache object, to be passed to
21
+ * Minify::setCache().
22
+ *
23
+ * @param int $expire seconds until expiration (default = 0
24
+ * meaning the item will not get an expiration date)
25
+ *
26
+ * @throws Exception
27
+ */
28
+ public function __construct($expire = 0)
29
+ {
30
+ if (!function_exists('wincache_ucache_info')) {
31
+ throw new Exception("WinCache for PHP is not installed to be able to use Minify_Cache_WinCache!");
32
+ }
33
+ $this->_exp = $expire;
34
+ }
35
+
36
+ /**
37
+ * Write data to cache.
38
+ *
39
+ * @param string $id cache id
40
+ *
41
+ * @param string $data
42
+ *
43
+ * @return bool success
44
+ */
45
+ public function store($id, $data)
46
+ {
47
+ return wincache_ucache_set($id, "{$_SERVER['REQUEST_TIME']}|{$data}", $this->_exp);
48
+ }
49
+
50
+ /**
51
+ * Get the size of a cache entry
52
+ *
53
+ * @param string $id cache id
54
+ *
55
+ * @return int size in bytes
56
+ */
57
+ public function getSize($id)
58
+ {
59
+ if (!$this->_fetch($id)) {
60
+ return false;
61
+ }
62
+
63
+ if (function_exists('mb_strlen') && ((int) ini_get('mbstring.func_overload') & 2)) {
64
+ return mb_strlen($this->_data, '8bit');
65
+ } else {
66
+ return strlen($this->_data);
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Does a valid cache entry exist?
72
+ *
73
+ * @param string $id cache id
74
+ *
75
+ * @param int $srcMtime mtime of the original source file(s)
76
+ *
77
+ * @return bool exists
78
+ */
79
+ public function isValid($id, $srcMtime)
80
+ {
81
+ return ($this->_fetch($id) && ($this->_lm >= $srcMtime));
82
+ }
83
+
84
+ /**
85
+ * Send the cached content to output
86
+ *
87
+ * @param string $id cache id
88
+ */
89
+ public function display($id)
90
+ {
91
+ echo $this->_fetch($id) ? $this->_data : '';
92
+ }
93
+
94
+ /**
95
+ * Fetch the cached content
96
+ *
97
+ * @param string $id cache id
98
+ *
99
+ * @return string
100
+ */
101
+ public function fetch($id)
102
+ {
103
+ return $this->_fetch($id) ? $this->_data : '';
104
+ }
105
+
106
+ private $_exp = null;
107
+
108
+ // cache of most recently fetched id
109
+ private $_lm = null;
110
+ private $_data = null;
111
+ private $_id = null;
112
+
113
+ /**
114
+ * Fetch data and timestamp from WinCache, store in instance
115
+ *
116
+ * @param string $id
117
+ *
118
+ * @return bool success
119
+ */
120
+ private function _fetch($id)
121
+ {
122
+ if ($this->_id === $id) {
123
+ return true;
124
+ }
125
+
126
+ $suc = false;
127
+ $ret = wincache_ucache_get($id, $suc);
128
+ if (!$suc) {
129
+ $this->_id = null;
130
+
131
+ return false;
132
+ }
133
+
134
+ list($this->_lm, $this->_data) = explode('|', $ret, 2);
135
+ $this->_id = $id;
136
+
137
+ return true;
138
+ }
139
+ }
lib/vendor/mrclay/minify/lib/Minify/Cache/XCache.php ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_Cache_XCache
4
+ *
5
+ * @link http://xcache.lighttpd.net/
6
+ * @package Minify
7
+ */
8
+
9
+ /**
10
+ * XCache-based cache class for Minify
11
+ * {@see http://xcache.lighttpd.net/wiki/XcacheApi XCache API}
12
+ *
13
+ * <code>
14
+ * Minify::setCache(new Minify_Cache_XCache());
15
+ * </code>
16
+ *
17
+ * @package Minify
18
+ * @author Elan Ruusamäe <glen@delfi.ee>
19
+ **/
20
+ class Minify_Cache_XCache implements Minify_CacheInterface
21
+ {
22
+
23
+ /**
24
+ * Create a Minify_Cache_XCache object, to be passed to
25
+ * Minify::setCache().
26
+ *
27
+ * @param int $expire seconds until expiration (default = 0
28
+ * meaning the item will not get an expiration date)
29
+ */
30
+ public function __construct($expire = 0)
31
+ {
32
+ $this->_exp = $expire;
33
+ }
34
+
35
+ /**
36
+ * Write data to cache.
37
+ *
38
+ * @param string $id cache id
39
+ * @param string $data
40
+ * @return bool success
41
+ */
42
+ public function store($id, $data)
43
+ {
44
+ return xcache_set($id, "{$_SERVER['REQUEST_TIME']}|{$data}", $this->_exp);
45
+ }
46
+
47
+ /**
48
+ * Get the size of a cache entry
49
+ *
50
+ * @param string $id cache id
51
+ * @return int size in bytes
52
+ */
53
+ public function getSize($id)
54
+ {
55
+ if (! $this->_fetch($id)) {
56
+ return false;
57
+ }
58
+
59
+ if (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)) {
60
+ return mb_strlen($this->_data, '8bit');
61
+ } else {
62
+ return strlen($this->_data);
63
+ }
64
+ }
65
+
66
+ /**
67
+ * Does a valid cache entry exist?
68
+ *
69
+ * @param string $id cache id
70
+ * @param int $srcMtime mtime of the original source file(s)
71
+ * @return bool exists
72
+ */
73
+ public function isValid($id, $srcMtime)
74
+ {
75
+ return ($this->_fetch($id) && ($this->_lm >= $srcMtime));
76
+ }
77
+
78
+ /**
79
+ * Send the cached content to output
80
+ *
81
+ * @param string $id cache id
82
+ */
83
+ public function display($id)
84
+ {
85
+ echo $this->_fetch($id) ? $this->_data : '';
86
+ }
87
+
88
+ /**
89
+ * Fetch the cached content
90
+ *
91
+ * @param string $id cache id
92
+ * @return string
93
+ */
94
+ public function fetch($id)
95
+ {
96
+ return $this->_fetch($id) ? $this->_data : '';
97
+ }
98
+
99
+ private $_exp = null;
100
+
101
+ // cache of most recently fetched id
102
+ private $_lm = null;
103
+ private $_data = null;
104
+ private $_id = null;
105
+
106
+ /**
107
+ * Fetch data and timestamp from xcache, store in instance
108
+ *
109
+ * @param string $id
110
+ * @return bool success
111
+ */
112
+ private function _fetch($id)
113
+ {
114
+ if ($this->_id === $id) {
115
+ return true;
116
+ }
117
+
118
+ $ret = xcache_get($id);
119
+ if (false === $ret) {
120
+ $this->_id = null;
121
+
122
+ return false;
123
+ }
124
+
125
+ list($this->_lm, $this->_data) = explode('|', $ret, 2);
126
+ $this->_id = $id;
127
+
128
+ return true;
129
+ }
130
+ }
lib/vendor/mrclay/minify/lib/Minify/Cache/ZendPlatform.php ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_Cache_ZendPlatform
4
+ * @package Minify
5
+ */
6
+
7
+ /**
8
+ * ZendPlatform-based cache class for Minify
9
+ *
10
+ * Based on Minify_Cache_APC, uses output_cache_get/put (currently deprecated)
11
+ *
12
+ * <code>
13
+ * Minify::setCache(new Minify_Cache_ZendPlatform());
14
+ * </code>
15
+ *
16
+ * @package Minify
17
+ * @author Patrick van Dissel
18
+ */
19
+ class Minify_Cache_ZendPlatform implements Minify_CacheInterface
20
+ {
21
+
22
+ /**
23
+ * Create a Minify_Cache_ZendPlatform object, to be passed to
24
+ * Minify::setCache().
25
+ *
26
+ * @param int $expire seconds until expiration (default = 0
27
+ * meaning the item will not get an expiration date)
28
+ *
29
+ */
30
+ public function __construct($expire = 0)
31
+ {
32
+ $this->_exp = $expire;
33
+ }
34
+
35
+ /**
36
+ * Write data to cache.
37
+ *
38
+ * @param string $id cache id
39
+ *
40
+ * @param string $data
41
+ *
42
+ * @return bool success
43
+ */
44
+ public function store($id, $data)
45
+ {
46
+ return output_cache_put($id, "{$_SERVER['REQUEST_TIME']}|{$data}");
47
+ }
48
+
49
+ /**
50
+ * Get the size of a cache entry
51
+ *
52
+ * @param string $id cache id
53
+ *
54
+ * @return int size in bytes
55
+ */
56
+ public function getSize($id)
57
+ {
58
+ return $this->_fetch($id) ? strlen($this->_data) : false;
59
+ }
60
+
61
+ /**
62
+ * Does a valid cache entry exist?
63
+ *
64
+ * @param string $id cache id
65
+ *
66
+ * @param int $srcMtime mtime of the original source file(s)
67
+ *
68
+ * @return bool exists
69
+ */
70
+ public function isValid($id, $srcMtime)
71
+ {
72
+ return ($this->_fetch($id) && ($this->_lm >= $srcMtime));
73
+ }
74
+
75
+ /**
76
+ * Send the cached content to output
77
+ *
78
+ * @param string $id cache id
79
+ */
80
+ public function display($id)
81
+ {
82
+ echo $this->_fetch($id) ? $this->_data : '';
83
+ }
84
+
85
+ /**
86
+ * Fetch the cached content
87
+ *
88
+ * @param string $id cache id
89
+ *
90
+ * @return string
91
+ */
92
+ public function fetch($id)
93
+ {
94
+ return $this->_fetch($id) ? $this->_data : '';
95
+ }
96
+
97
+ private $_exp = null;
98
+
99
+ // cache of most recently fetched id
100
+ private $_lm = null;
101
+ private $_data = null;
102
+ private $_id = null;
103
+
104
+ /**
105
+ * Fetch data and timestamp from ZendPlatform, store in instance
106
+ *
107
+ * @param string $id
108
+ *
109
+ * @return bool success
110
+ */
111
+ private function _fetch($id)
112
+ {
113
+ if ($this->_id === $id) {
114
+ return true;
115
+ }
116
+
117
+ $ret = output_cache_get($id, $this->_exp);
118
+ if (false === $ret) {
119
+ $this->_id = null;
120
+
121
+ return false;
122
+ }
123
+
124
+ list($this->_lm, $this->_data) = explode('|', $ret, 2);
125
+ $this->_id = $id;
126
+
127
+ return true;
128
+ }
129
+ }
lib/vendor/mrclay/minify/lib/Minify/CacheInterface.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Interface Minify_CacheInterface
4
+ * @package Minify
5
+ */
6
+
7
+ /**
8
+ * Interface for Minify cache adapters
9
+ *
10
+ * @package Minify
11
+ */
12
+ interface Minify_CacheInterface
13
+ {
14
+ /**
15
+ * Write data to cache.
16
+ *
17
+ * @param string $id cache id (e.g. a filename)
18
+ * @param string $data
19
+ *
20
+ * @return bool success
21
+ */
22
+ public function store($id, $data);
23
+
24
+ /**
25
+ * Get the size of a cache entry
26
+ *
27
+ * @param string $id cache id (e.g. a filename)
28
+ *
29
+ * @return int size in bytes
30
+ */
31
+ public function getSize($id);
32
+
33
+ /**
34
+ * Does a valid cache entry exist?
35
+ *
36
+ * @param string $id cache id (e.g. a filename)
37
+ * @param int $srcMtime mtime of the original source file(s)
38
+ *
39
+ * @return bool exists
40
+ */
41
+ public function isValid($id, $srcMtime);
42
+
43
+ /**
44
+ * Send the cached content to output
45
+ *
46
+ * @param string $id cache id (e.g. a filename)
47
+ */
48
+ public function display($id);
49
+
50
+ /**
51
+ * Fetch the cached content
52
+ *
53
+ * @param string $id cache id (e.g. a filename)
54
+ *
55
+ * @return string
56
+ */
57
+ public function fetch($id);
58
+ }
lib/vendor/mrclay/minify/lib/Minify/ClosureCompiler.php ADDED
@@ -0,0 +1,240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_ClosureCompiler
4
+ * @package Minify
5
+ */
6
+
7
+ /**
8
+ * Compress Javascript using the Closure Compiler
9
+ *
10
+ * You must set $jarFile and $tempDir before calling the minify functions.
11
+ * Also, depending on your shell's environment, you may need to specify
12
+ * the full path to java in $javaExecutable or use putenv() to setup the
13
+ * Java environment.
14
+ *
15
+ * <code>
16
+ * Minify_ClosureCompiler::$jarFile = '/path/to/closure-compiler-20120123.jar';
17
+ * Minify_ClosureCompiler::$tempDir = '/tmp';
18
+ * $code = Minify_ClosureCompiler::minify(
19
+ * $code,
20
+ * array('compilation_level' => 'SIMPLE_OPTIMIZATIONS')
21
+ * );
22
+ *
23
+ * --compilation_level WHITESPACE_ONLY, SIMPLE_OPTIMIZATIONS, ADVANCED_OPTIMIZATIONS
24
+ *
25
+ * </code>
26
+ *
27
+ * @package Minify
28
+ * @author Stephen Clay <steve@mrclay.org>
29
+ * @author Elan Ruusamäe <glen@delfi.ee>
30
+ */
31
+ class Minify_ClosureCompiler
32
+ {
33
+ public static $isDebug = false;
34
+
35
+ /**
36
+ * Filepath of the Closure Compiler jar file. This must be set before
37
+ * calling minifyJs().
38
+ *
39
+ * @var string
40
+ */
41
+ public static $jarFile = null;
42
+
43
+ /**
44
+ * Writable temp directory. This must be set before calling minifyJs().
45
+ *
46
+ * @var string
47
+ */
48
+ public static $tempDir = null;
49
+
50
+ /**
51
+ * Filepath of "java" executable (may be needed if not in shell's PATH)
52
+ *
53
+ * @var string
54
+ */
55
+ public static $javaExecutable = 'java';
56
+
57
+ /**
58
+ * Default command line options passed to closure-compiler
59
+ *
60
+ * @var array
61
+ */
62
+ public static $defaultOptions = array(
63
+ 'charset' => 'utf-8',
64
+ 'compilation_level' => 'SIMPLE_OPTIMIZATIONS',
65
+ 'warning_level' => 'QUIET',
66
+ );
67
+
68
+ /**
69
+ * Minify a Javascript string
70
+ *
71
+ * @param string $js
72
+ * @param array $options (verbose is ignored)
73
+ * @see https://code.google.com/p/closure-compiler/source/browse/trunk/README
74
+ * @return string
75
+ * @throws Minify_ClosureCompiler_Exception
76
+ */
77
+ public static function minify($js, $options = array())
78
+ {
79
+ $min = new static();
80
+
81
+ return $min->process($js, $options);
82
+ }
83
+
84
+ /**
85
+ * Process $js using $options.
86
+ *
87
+ * @param string $js
88
+ * @param array $options
89
+ * @return string
90
+ * @throws Exception
91
+ * @throws Minify_ClosureCompiler_Exception
92
+ */
93
+ public function process($js, $options)
94
+ {
95
+ $tmpFile = $this->dumpFile(self::$tempDir, $js);
96
+ try {
97
+ $result = $this->compile($tmpFile, $options);
98
+ } catch (Exception $e) {
99
+ unlink($tmpFile);
100
+ throw $e;
101
+ }
102
+ unlink($tmpFile);
103
+
104
+ return $result;
105
+ }
106
+
107
+ /**
108
+ * @param string $tmpFile
109
+ * @param array $options
110
+ * @return string
111
+ * @throws Minify_ClosureCompiler_Exception
112
+ */
113
+ protected function compile($tmpFile, $options)
114
+ {
115
+ $command = $this->getCommand($options, $tmpFile);
116
+
117
+ return implode("\n", $this->shell($command));
118
+ }
119
+
120
+ /**
121
+ * @param array $userOptions
122
+ * @param string $tmpFile
123
+ * @return string
124
+ */
125
+ protected function getCommand($userOptions, $tmpFile)
126
+ {
127
+ $args = array_merge(
128
+ $this->getCompilerCommandLine(),
129
+ $this->getOptionsCommandLine($userOptions)
130
+ );
131
+
132
+ return join(' ', $args) . ' ' . escapeshellarg($tmpFile);
133
+ }
134
+
135
+ /**
136
+ * @return array
137
+ * @throws Minify_ClosureCompiler_Exception
138
+ */
139
+ protected function getCompilerCommandLine()
140
+ {
141
+ $this->checkJar(self::$jarFile);
142
+ $server = array(
143
+ self::$javaExecutable,
144
+ '-jar',
145
+ escapeshellarg(self::$jarFile)
146
+ );
147
+
148
+ return $server;
149
+ }
150
+
151
+ /**
152
+ * @param array $userOptions
153
+ * @return array
154
+ */
155
+ protected function getOptionsCommandLine($userOptions)
156
+ {
157
+ $args = array();
158
+
159
+ $options = array_merge(
160
+ static::$defaultOptions,
161
+ $userOptions
162
+ );
163
+
164
+ foreach ($options as $key => $value) {
165
+ $args[] = "--{$key} " . escapeshellarg($value);
166
+ }
167
+
168
+ return $args;
169
+ }
170
+
171
+ /**
172
+ * @param string $jarFile
173
+ * @throws Minify_ClosureCompiler_Exception
174
+ */
175
+ protected function checkJar($jarFile)
176
+ {
177
+ if (!is_file($jarFile)) {
178
+ throw new Minify_ClosureCompiler_Exception('$jarFile(' . $jarFile . ') is not a valid file.');
179
+ }
180
+ if (!is_readable($jarFile)) {
181
+ throw new Minify_ClosureCompiler_Exception('$jarFile(' . $jarFile . ') is not readable.');
182
+ }
183
+ }
184
+
185
+ /**
186
+ * @param string $tempDir
187
+ * @throws Minify_ClosureCompiler_Exception
188
+ */
189
+ protected function checkTempdir($tempDir)
190
+ {
191
+ if (!is_dir($tempDir)) {
192
+ throw new Minify_ClosureCompiler_Exception('$tempDir(' . $tempDir . ') is not a valid direcotry.');
193
+ }
194
+ if (!is_writable($tempDir)) {
195
+ throw new Minify_ClosureCompiler_Exception('$tempDir(' . $tempDir . ') is not writable.');
196
+ }
197
+ }
198
+
199
+ /**
200
+ * Write $content to a temporary file residing in $dir.
201
+ *
202
+ * @param string $dir
203
+ * @param string $content
204
+ * @return string
205
+ * @throws Minify_ClosureCompiler_Exception
206
+ */
207
+ protected function dumpFile($dir, $content)
208
+ {
209
+ $this->checkTempdir($dir);
210
+ $tmpFile = tempnam($dir, 'cc_');
211
+ if (!$tmpFile) {
212
+ throw new Minify_ClosureCompiler_Exception('Could not create temp file in "' . $dir . '".');
213
+ }
214
+ file_put_contents($tmpFile, $content);
215
+
216
+ return $tmpFile;
217
+ }
218
+
219
+ /**
220
+ * Execute command, throw if exit code is not in $expectedCodes array
221
+ *
222
+ * @param string $command
223
+ * @param array $expectedCodes
224
+ * @return mixed
225
+ * @throws Minify_ClosureCompiler_Exception
226
+ */
227
+ protected function shell($command, $expectedCodes = array(0))
228
+ {
229
+ exec($command, $output, $result_code);
230
+ if (!in_array($result_code, $expectedCodes)) {
231
+ throw new Minify_ClosureCompiler_Exception("Unpexpected return code: $result_code");
232
+ }
233
+
234
+ return $output;
235
+ }
236
+ }
237
+
238
+ class Minify_ClosureCompiler_Exception extends Exception
239
+ {
240
+ }
lib/vendor/mrclay/minify/lib/Minify/CommentPreserver.php ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_CommentPreserver
4
+ * @package Minify
5
+ */
6
+
7
+ /**
8
+ * Process a string in pieces preserving C-style comments that begin with "/*!"
9
+ *
10
+ * @package Minify
11
+ * @author Stephen Clay <steve@mrclay.org>
12
+ */
13
+ class Minify_CommentPreserver
14
+ {
15
+
16
+ /**
17
+ * String to be prepended to each preserved comment
18
+ *
19
+ * @var string
20
+ */
21
+ public static $prepend = "\n";
22
+
23
+ /**
24
+ * String to be appended to each preserved comment
25
+ *
26
+ * @var string
27
+ */
28
+ public static $append = "\n";
29
+
30
+ /**
31
+ * Process a string outside of C-style comments that begin with "/*!"
32
+ *
33
+ * On each non-empty string outside these comments, the given processor
34
+ * function will be called. The comments will be surrounded by
35
+ * Minify_CommentPreserver::$preprend and Minify_CommentPreserver::$append.
36
+ *
37
+ * @param string $content
38
+ * @param callback $processor function
39
+ * @param array $args array of extra arguments to pass to the processor
40
+ * function (default = array())
41
+ * @return string
42
+ */
43
+ public static function process($content, $processor, $args = array())
44
+ {
45
+ $ret = '';
46
+ while (true) {
47
+ list($beforeComment, $comment, $afterComment) = self::_nextComment($content);
48
+ if ('' !== $beforeComment) {
49
+ $callArgs = $args;
50
+ array_unshift($callArgs, $beforeComment);
51
+ $ret .= call_user_func_array($processor, $callArgs);
52
+ }
53
+ if (false === $comment) {
54
+ break;
55
+ }
56
+ $ret .= $comment;
57
+ $content = $afterComment;
58
+ }
59
+
60
+ return $ret;
61
+ }
62
+
63
+ /**
64
+ * Extract comments that YUI Compressor preserves.
65
+ *
66
+ * @param string $in input
67
+ *
68
+ * @return array 3 elements are returned. If a YUI comment is found, the
69
+ * 2nd element is the comment and the 1st and 3rd are the surrounding
70
+ * strings. If no comment is found, the entire string is returned as the
71
+ * 1st element and the other two are false.
72
+ */
73
+ private static function _nextComment($in)
74
+ {
75
+ if (false === ($start = strpos($in, '/*!')) || false === ($end = strpos($in, '*/', $start + 3))) {
76
+ return array($in, false, false);
77
+ }
78
+
79
+ $beforeComment = substr($in, 0, $start);
80
+ $comment = self::$prepend . '/*!' . substr($in, $start + 3, $end - $start - 1) . self::$append;
81
+
82
+ $endChars = (strlen($in) - $end - 2);
83
+ $afterComment = (0 === $endChars) ? '' : substr($in, -$endChars);
84
+
85
+ return array($beforeComment, $comment, $afterComment);
86
+ }
87
+ }
lib/vendor/mrclay/minify/lib/Minify/Config.php ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Minify;
4
+
5
+ use Minify_CacheInterface;
6
+
7
+ class Config
8
+ {
9
+ /**
10
+ * @var bool
11
+ */
12
+ public $enableBuilder = false;
13
+
14
+ /**
15
+ * @var bool
16
+ */
17
+ public $enableStatic = false;
18
+
19
+ /**
20
+ * @var bool
21
+ */
22
+ public $concatOnly = false;
23
+
24
+ /**
25
+ * @var string
26
+ */
27
+ public $builderPassword = 'admin';
28
+
29
+ /**
30
+ * @var bool|object
31
+ */
32
+ public $errorLogger = false;
33
+
34
+ /**
35
+ * @var bool
36
+ */
37
+ public $allowDebugFlag = false;
38
+
39
+ /**
40
+ * @var string|Minify_CacheInterface
41
+ */
42
+ public $cachePath = '';
43
+
44
+ /**
45
+ * @var string
46
+ */
47
+ public $documentRoot = '';
48
+
49
+ /**
50
+ * @var bool
51
+ */
52
+ public $cacheFileLocking = true;
53
+
54
+ /**
55
+ * @var array
56
+ */
57
+ public $serveOptions = array();
58
+
59
+ /**
60
+ * @var array
61
+ */
62
+ public $symlinks = array();
63
+
64
+ /**
65
+ * @var int
66
+ */
67
+ public $uploaderHoursBehind = 0;
68
+
69
+ /**
70
+ * @var array
71
+ */
72
+ public $envArgs = array();
73
+
74
+ /**
75
+ * @var callable[]
76
+ */
77
+ public $factories = array();
78
+ }
lib/vendor/mrclay/minify/lib/Minify/Controller/Base.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_Controller_Base
4
+ * @package Minify
5
+ */
6
+
7
+ use Psr\Log\LoggerInterface;
8
+ use Monolog\Logger;
9
+
10
+ /**
11
+ * Base class for Minify controller
12
+ *
13
+ * The controller class validates a request and uses it to create a configuration for Minify::serve().
14
+ *
15
+ * @package Minify
16
+ * @author Stephen Clay <steve@mrclay.org>
17
+ */
18
+ abstract class Minify_Controller_Base implements Minify_ControllerInterface
19
+ {
20
+
21
+ /**
22
+ * @var Minify_Env
23
+ */
24
+ protected $env;
25
+
26
+ /**
27
+ * @var Minify_Source_Factory
28
+ */
29
+ protected $sourceFactory;
30
+
31
+ /**
32
+ * @var LoggerInterface
33
+ */
34
+ protected $logger;
35
+
36
+ /**
37
+ * @param Minify_Env $env
38
+ * @param Minify_Source_Factory $sourceFactory
39
+ * @param LoggerInterface $logger
40
+ */
41
+ public function __construct(Minify_Env $env, Minify_Source_Factory $sourceFactory, LoggerInterface $logger = null)
42
+ {
43
+ $this->env = $env;
44
+ $this->sourceFactory = $sourceFactory;
45
+ if (!$logger) {
46
+ $logger = new Logger('minify');
47
+ }
48
+ $this->logger = $logger;
49
+ }
50
+
51
+ /**
52
+ * Create controller sources and options for Minify::serve()
53
+ *
54
+ * @param array $options controller and Minify options
55
+ *
56
+ * @return Minify_ServeConfiguration
57
+ */
58
+ abstract public function createConfiguration(array $options);
59
+
60
+ /**
61
+ * Send message to the Minify logger
62
+ *
63
+ * @param string $msg
64
+ *
65
+ * @return null
66
+ * @deprecated use $this->logger
67
+ */
68
+ public function log($msg)
69
+ {
70
+ trigger_error(__METHOD__ . ' is deprecated in Minify 3.0.', E_USER_DEPRECATED);
71
+ $this->logger->info($msg);
72
+ }
73
+
74
+ /**
75
+ * {@inheritdoc}
76
+ */
77
+ public function getEnv()
78
+ {
79
+ return $this->env;
80
+ }
81
+ }
lib/vendor/mrclay/minify/lib/Minify/Controller/Files.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_Controller_Files
4
+ * @package Minify
5
+ */
6
+
7
+ use Monolog\Logger;
8
+
9
+ /**
10
+ * Controller class for minifying a set of files
11
+ *
12
+ * E.g. the following would serve the minified Javascript for a site
13
+ * <code>
14
+ * $options = [
15
+ * 'checkAllowDirs' => false, // allow files to be anywhere
16
+ * ];
17
+ * $sourceFactory = new Minify_Source_Factory($env, $options, $cache);
18
+ * $controller = new Minify_Controller_Files($env, $sourceFactory);
19
+ * $minify->serve($controller, [
20
+ * 'files' => [
21
+ * '//js/jquery.js',
22
+ * '//js/plugins.js',
23
+ * '/home/username/file.js',
24
+ * ],
25
+ * ]);
26
+ * </code>
27
+ *
28
+ * @package Minify
29
+ * @author Stephen Clay <steve@mrclay.org>
30
+ */
31
+ class Minify_Controller_Files extends Minify_Controller_Base
32
+ {
33
+
34
+ /**
35
+ * Set up file sources
36
+ *
37
+ * @param array $options controller and Minify options
38
+ * @return Minify_ServeConfiguration
39
+ *
40
+ * Controller options:
41
+ *
42
+ * 'files': (required) array of complete file paths, or a single path
43
+ */
44
+ public function createConfiguration(array $options)
45
+ {
46
+ // strip controller options
47
+
48
+ $files = $options['files'];
49
+ // if $files is a single object, casting will break it
50
+ if (is_object($files)) {
51
+ $files = array($files);
52
+ } elseif (! is_array($files)) {
53
+ $files = (array)$files;
54
+ }
55
+ unset($options['files']);
56
+
57
+ $sources = array();
58
+ foreach ($files as $file) {
59
+ try {
60
+ $sources[] = $this->sourceFactory->makeSource($file);
61
+ } catch (Minify_Source_FactoryException $e) {
62
+ $this->logger->error($e->getMessage());
63
+
64
+ return new Minify_ServeConfiguration($options);
65
+ }
66
+ }
67
+
68
+ return new Minify_ServeConfiguration($options, $sources);
69
+ }
70
+ }
71
+
lib/vendor/mrclay/minify/lib/Minify/Controller/Groups.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_Controller_Groups
4
+ * @package Minify
5
+ */
6
+
7
+ /**
8
+ * Controller class for serving predetermined groups of minimized sets, selected
9
+ * by PATH_INFO
10
+ *
11
+ * <code>
12
+ * Minify::serve('Groups', array(
13
+ * 'groups' => array(
14
+ * 'css' => array('//css/type.css', '//css/layout.css')
15
+ * ,'js' => array('//js/jquery.js', '//js/site.js')
16
+ * )
17
+ * ));
18
+ * </code>
19
+ *
20
+ * If the above code were placed in /serve.php, it would enable the URLs
21
+ * /serve.php/js and /serve.php/css
22
+ *
23
+ * @package Minify
24
+ * @author Stephen Clay <steve@mrclay.org>
25
+ */
26
+ class Minify_Controller_Groups extends Minify_Controller_Files
27
+ {
28
+
29
+ /**
30
+ * Set up groups of files as sources
31
+ *
32
+ * @param array $options controller and Minify options
33
+ *
34
+ * 'groups': (required) array mapping PATH_INFO strings to arrays
35
+ * of complete file paths. @see Minify_Controller_Groups
36
+ *
37
+ * @return array Minify options
38
+ */
39
+ public function createConfiguration(array $options)
40
+ {
41
+ // strip controller options
42
+ $groups = $options['groups'];
43
+ unset($options['groups']);
44
+
45
+ $server = $this->env->server();
46
+
47
+ // mod_fcgid places PATH_INFO in ORIG_PATH_INFO
48
+ if (isset($server['ORIG_PATH_INFO'])) {
49
+ $pathInfo = substr($server['ORIG_PATH_INFO'], 1);
50
+ } elseif (isset($server['PATH_INFO'])) {
51
+ $pathInfo = substr($server['PATH_INFO'], 1);
52
+ } else {
53
+ $pathInfo = false;
54
+ }
55
+
56
+ if (false === $pathInfo || ! isset($groups[$pathInfo])) {
57
+ // no PATH_INFO or not a valid group
58
+ $this->logger->info("Missing PATH_INFO or no group set for \"$pathInfo\"");
59
+
60
+ return new Minify_ServeConfiguration($options);
61
+ }
62
+
63
+ $files = $groups[$pathInfo];
64
+ // if $files is a single object, casting will break it
65
+ if (is_object($files)) {
66
+ $files = array($files);
67
+ } elseif (! is_array($files)) {
68
+ $files = (array)$files;
69
+ }
70
+
71
+ $options['files'] = $files;
72
+
73
+ return parent::createConfiguration($options);
74
+ }
75
+ }
76
+
lib/vendor/mrclay/minify/lib/Minify/Controller/MinApp.php ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_Controller_MinApp
4
+ * @package Minify
5
+ */
6
+
7
+ /**
8
+ * Controller class for requests to /min/index.php
9
+ *
10
+ * @package Minify
11
+ * @author Stephen Clay <steve@mrclay.org>
12
+ */
13
+ class Minify_Controller_MinApp extends Minify_Controller_Base
14
+ {
15
+
16
+ /**
17
+ * Set up groups of files as sources
18
+ *
19
+ * @param array $options controller and Minify options
20
+ *
21
+ * @return array Minify options
22
+ */
23
+ public function createConfiguration(array $options)
24
+ {
25
+ // PHP insecure by default: realpath() and other FS functions can't handle null bytes.
26
+ $get = $this->env->get();
27
+ foreach (array('g', 'b', 'f') as $key) {
28
+ if (isset($get[$key])) {
29
+ $get[$key] = str_replace("\x00", '', (string)$get[$key]);
30
+ }
31
+ }
32
+
33
+ // filter controller options
34
+ $defaults = array(
35
+ 'groupsOnly' => false,
36
+ 'groups' => array(),
37
+ 'symlinks' => array(),
38
+ );
39
+ $minApp = isset($options['minApp']) ? $options['minApp'] : array();
40
+ $localOptions = array_merge($defaults, $minApp);
41
+
42
+ unset($options['minApp']);
43
+
44
+ // normalize $symlinks in order to map to target
45
+ $symlinks = array();
46
+ foreach ($localOptions['symlinks'] as $link => $target) {
47
+ if (0 === strpos($link, '//')) {
48
+ $link = rtrim(substr($link, 1), '/') . '/';
49
+ $target = rtrim($target, '/\\');
50
+ $symlinks[$link] = $target;
51
+ }
52
+ }
53
+
54
+ $sources = array();
55
+ $selectionId = '';
56
+ $firstMissing = null;
57
+
58
+ if (isset($get['g'])) {
59
+ // add group(s)
60
+ $selectionId .= 'g=' . $get['g'];
61
+ $keys = explode(',', $get['g']);
62
+ if ($keys != array_unique($keys)) {
63
+ $this->logger->info("Duplicate group key found.");
64
+
65
+ return new Minify_ServeConfiguration($options);
66
+ }
67
+ foreach ($keys as $key) {
68
+ if (! isset($localOptions['groups'][$key])) {
69
+ $this->logger->info("A group configuration for \"{$key}\" was not found");
70
+
71
+ return new Minify_ServeConfiguration($options);
72
+ }
73
+ $files = $localOptions['groups'][$key];
74
+ // if $files is a single object, casting will break it
75
+ if (is_object($files)) {
76
+ $files = array($files);
77
+ } elseif (! is_array($files)) {
78
+ $files = (array)$files;
79
+ }
80
+ foreach ($files as $file) {
81
+ try {
82
+ $source = $this->sourceFactory->makeSource($file);
83
+ $sources[] = $source;
84
+ } catch (Minify_Source_FactoryException $e) {
85
+ $this->logger->error($e->getMessage());
86
+ if (null === $firstMissing) {
87
+ $firstMissing = basename($file);
88
+ continue;
89
+ } else {
90
+ $secondMissing = basename($file);
91
+ $this->logger->info("More than one file was missing: '$firstMissing', '$secondMissing'");
92
+
93
+ return new Minify_ServeConfiguration($options);
94
+ }
95
+ }
96
+ }
97
+ }
98
+ }
99
+ if (! $localOptions['groupsOnly'] && isset($get['f'])) {
100
+ // try user files
101
+ // The following restrictions are to limit the URLs that minify will
102
+ // respond to.
103
+
104
+ // verify at least one file, files are single comma separated, and are all same extension
105
+ $validPattern = preg_match('/^[^,]+\\.(css|less|scss|js)(?:,[^,]+\\.\\1)*$/', $get['f'], $m);
106
+ $hasComment = strpos($get['f'], '//') !== false;
107
+ $hasEscape = strpos($get['f'], '\\') !== false;
108
+
109
+ if (!$validPattern || $hasComment || $hasEscape) {
110
+ $this->logger->info("GET param 'f' was invalid");
111
+
112
+ return new Minify_ServeConfiguration($options);
113
+ }
114
+
115
+ $ext = ".{$m[1]}";
116
+ $files = explode(',', $get['f']);
117
+ if ($files != array_unique($files)) {
118
+ $this->logger->info("Duplicate files were specified");
119
+
120
+ return new Minify_ServeConfiguration($options);
121
+ }
122
+
123
+ if (isset($get['b'])) {
124
+ // check for validity
125
+ $isValidBase = preg_match('@^[^/]+(?:/[^/]+)*$@', $get['b']);
126
+ $hasDots = false !== strpos($get['b'], '..');
127
+ $isDot = $get['b'] === '.';
128
+
129
+ if ($isValidBase && !$hasDots && !$isDot) {
130
+ // valid base
131
+ $base = "/{$get['b']}/";
132
+ } else {
133
+ $this->logger->info("GET param 'b' was invalid");
134
+
135
+ return new Minify_ServeConfiguration($options);
136
+ }
137
+ } else {
138
+ $base = '/';
139
+ }
140
+
141
+ $basenames = array(); // just for cache id
142
+ foreach ($files as $file) {
143
+ $uri = $base . $file;
144
+ $path = $this->env->getDocRoot() . $uri;
145
+
146
+ // try to rewrite path
147
+ foreach ($symlinks as $link => $target) {
148
+ if (0 === strpos($uri, $link)) {
149
+ $path = $target . DIRECTORY_SEPARATOR . substr($uri, strlen($link));
150
+ break;
151
+ }
152
+ }
153
+
154
+ try {
155
+ $source = $this->sourceFactory->makeSource($path);
156
+ $sources[] = $source;
157
+ $basenames[] = basename($path, $ext);
158
+ } catch (Minify_Source_FactoryException $e) {
159
+ $this->logger->error($e->getMessage());
160
+ if (null === $firstMissing) {
161
+ $firstMissing = $uri;
162
+ continue;
163
+ } else {
164
+ $secondMissing = $uri;
165
+ $this->logger->info("More than one file was missing: '$firstMissing', '$secondMissing`'");
166
+
167
+ return new Minify_ServeConfiguration($options);
168
+ }
169
+ }
170
+ }
171
+ if ($selectionId) {
172
+ $selectionId .= '_f=';
173
+ }
174
+ $selectionId .= implode(',', $basenames) . $ext;
175
+ }
176
+
177
+ if (!$sources) {
178
+ $this->logger->info("No sources to serve");
179
+
180
+ return new Minify_ServeConfiguration($options);
181
+ }
182
+
183
+ if (null !== $firstMissing) {
184
+ array_unshift($sources, new Minify_Source(array(
185
+ 'id' => 'missingFile',
186
+ // should not cause cache invalidation
187
+ 'lastModified' => 0,
188
+ // due to caching, filename is unreliable.
189
+ 'content' => "/* Minify: at least one missing file. See " . Minify::URL_DEBUG . " */\n",
190
+ 'minifier' => 'Minify::nullMinifier',
191
+ )));
192
+ }
193
+
194
+ return new Minify_ServeConfiguration($options, $sources, $selectionId);
195
+ }
196
+ }
lib/vendor/mrclay/minify/lib/Minify/Controller/Page.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_Controller_Page
4
+ * @package Minify
5
+ */
6
+
7
+ /**
8
+ * Controller class for serving a single HTML page
9
+ *
10
+ * @link http://code.google.com/p/minify/source/browse/trunk/web/examples/1/index.php#59
11
+ * @package Minify
12
+ * @author Stephen Clay <steve@mrclay.org>
13
+ */
14
+ class Minify_Controller_Page extends Minify_Controller_Base
15
+ {
16
+
17
+ /**
18
+ * Set up source of HTML content
19
+ *
20
+ * @param array $options controller and Minify options
21
+ * @return array Minify options
22
+ *
23
+ * Controller options:
24
+ *
25
+ * 'content': (required) HTML markup
26
+ *
27
+ * 'id': (required) id of page (string for use in server-side caching)
28
+ *
29
+ * 'lastModifiedTime': timestamp of when this content changed. This
30
+ * is recommended to allow both server and client-side caching.
31
+ *
32
+ * 'minifyAll': should all CSS and Javascript blocks be individually
33
+ * minified? (default false)
34
+ */
35
+ public function createConfiguration(array $options)
36
+ {
37
+ if (isset($options['file'])) {
38
+ $sourceSpec = array(
39
+ 'filepath' => $options['file']
40
+ );
41
+ $f = $options['file'];
42
+ } else {
43
+ // strip controller options
44
+ $sourceSpec = array(
45
+ 'content' => $options['content'],
46
+ 'id' => $options['id'],
47
+ );
48
+ $f = $options['id'];
49
+ unset($options['content'], $options['id']);
50
+ }
51
+ // something like "builder,index.php" or "directory,file.html"
52
+ $selectionId = strtr(substr($f, 1 + strlen(dirname(dirname($f)))), '/\\', ',,');
53
+
54
+ if (isset($options['minifyAll'])) {
55
+ // this will be the 2nd argument passed to Minify_HTML::minify()
56
+ $sourceSpec['minifyOptions'] = array(
57
+ 'cssMinifier' => array('Minify_CSSmin', 'minify'),
58
+ 'jsMinifier' => array('JSMin\\JSMin', 'minify'),
59
+ );
60
+ unset($options['minifyAll']);
61
+ }
62
+
63
+ $sourceSpec['contentType'] = Minify::TYPE_HTML;
64
+ $sources[] = new Minify_Source($sourceSpec);
65
+
66
+ return new Minify_ServeConfiguration($options, $sources, $selectionId);
67
+ }
68
+ }
69
+
lib/vendor/mrclay/minify/lib/Minify/ControllerInterface.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ interface Minify_ControllerInterface
5
+ {
6
+
7
+ /**
8
+ * Create controller sources and options for Minify::serve()
9
+ *
10
+ * @param array $options controller and Minify options
11
+ *
12
+ * @return Minify_ServeConfiguration
13
+ */
14
+ public function createConfiguration(array $options);
15
+
16
+ /**
17
+ * Get the Env component
18
+ *
19
+ * @return Minify_Env
20
+ */
21
+ public function getEnv();
22
+ }
lib/vendor/mrclay/minify/lib/Minify/DebugDetector.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Detect whether request should be debugged
5
+ *
6
+ * @package Minify
7
+ * @author Stephen Clay <steve@mrclay.org>
8
+ */
9
+ class Minify_DebugDetector
10
+ {
11
+ public static function shouldDebugRequest(Minify_Env $env)
12
+ {
13
+ if ($env->get('debug') !== null) {
14
+ return true;
15
+ }
16
+
17
+ $cookieValue = $env->cookie('minifyDebug');
18
+ if ($cookieValue) {
19
+ foreach (preg_split('/\\s+/', $cookieValue) as $debugUri) {
20
+ $pattern = '@' . preg_quote($debugUri, '@') . '@i';
21
+ $pattern = str_replace(array('\\*', '\\?'), array('.*', '.'), $pattern);
22
+ if (preg_match($pattern, $env->getRequestUri())) {
23
+ return true;
24
+ }
25
+ }
26
+ }
27
+
28
+ return false;
29
+ }
30
+ }
lib/vendor/mrclay/minify/lib/Minify/Env.php ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Minify_Env
4
+ {
5
+
6
+ /**
7
+ * @return string
8
+ */
9
+ public function getDocRoot()
10
+ {
11
+ return $this->server['DOCUMENT_ROOT'];
12
+ }
13
+
14
+ /**
15
+ * @return string
16
+ */
17
+ public function getRequestUri()
18
+ {
19
+ return $this->server['REQUEST_URI'];
20
+ }
21
+
22
+ public function __construct($options = array())
23
+ {
24
+ $options = array_merge(array(
25
+ 'server' => $_SERVER,
26
+ 'get' => $_GET,
27
+ 'post' => $_POST,
28
+ 'cookie' => $_COOKIE,
29
+ ), $options);
30
+
31
+ $this->server = $options['server'];
32
+ if (empty($this->server['DOCUMENT_ROOT'])) {
33
+ $this->server['DOCUMENT_ROOT'] = $this->computeDocRoot($options['server']);
34
+ } else {
35
+ $this->server['DOCUMENT_ROOT'] = rtrim($this->server['DOCUMENT_ROOT'], '/\\');
36
+ }
37
+
38
+ $this->server['DOCUMENT_ROOT'] = $this->normalizePath($this->server['DOCUMENT_ROOT']);
39
+ $this->get = $options['get'];
40
+ $this->post = $options['post'];
41
+ $this->cookie = $options['cookie'];
42
+ }
43
+
44
+ public function server($key = null)
45
+ {
46
+ if (null === $key) {
47
+ return $this->server;
48
+ }
49
+
50
+ return isset($this->server[$key]) ? $this->server[$key] : null;
51
+ }
52
+
53
+ public function cookie($key = null, $default = null)
54
+ {
55
+ if (null === $key) {
56
+ return $this->cookie;
57
+ }
58
+
59
+ return isset($this->cookie[$key]) ? $this->cookie[$key] : $default;
60
+ }
61
+
62
+ public function get($key = null, $default = null)
63
+ {
64
+ if (null === $key) {
65
+ return $this->get;
66
+ }
67
+
68
+ return isset($this->get[$key]) ? $this->get[$key] : $default;
69
+ }
70
+
71
+ public function post($key = null, $default = null)
72
+ {
73
+ if (null === $key) {
74
+ return $this->post;
75
+ }
76
+
77
+ return isset($this->post[$key]) ? $this->post[$key] : $default;
78
+ }
79
+
80
+ /**
81
+ * turn windows-style slashes into unix-style,
82
+ * remove trailing slash
83
+ * and lowercase drive letter
84
+ *
85
+ * @param string $path absolute path
86
+ *
87
+ * @return string
88
+ */
89
+ public function normalizePath($path)
90
+ {
91
+ $realpath = realpath($path);
92
+ if ($realpath) {
93
+ $path = $realpath;
94
+ }
95
+
96
+ $path = str_replace('\\', '/', $path);
97
+ $path = rtrim($path, '/');
98
+ if (substr($path, 1, 1) === ':') {
99
+ $path = lcfirst($path);
100
+ }
101
+
102
+ return $path;
103
+ }
104
+
105
+ protected $server = null;
106
+ protected $get = null;
107
+ protected $post = null;
108
+ protected $cookie = null;
109
+
110
+ /**
111
+ * Compute $_SERVER['DOCUMENT_ROOT'] for IIS using SCRIPT_FILENAME and SCRIPT_NAME.
112
+ *
113
+ * @param array $server
114
+ * @return string
115
+ */
116
+ protected function computeDocRoot(array $server)
117
+ {
118
+ if (isset($server['SERVER_SOFTWARE']) && 0 !== strpos($server['SERVER_SOFTWARE'], 'Microsoft-IIS/')) {
119
+ throw new InvalidArgumentException('DOCUMENT_ROOT is not provided and could not be computed');
120
+ }
121
+
122
+ $substrLength = strlen($server['SCRIPT_FILENAME']) - strlen($server['SCRIPT_NAME']);
123
+ $docRoot = substr($server['SCRIPT_FILENAME'], 0, $substrLength);
124
+
125
+ return rtrim($docRoot, '\\');
126
+ }
127
+ }
lib/vendor/mrclay/minify/lib/Minify/HTML.php ADDED
@@ -0,0 +1,258 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_HTML
4
+ * @package Minify
5
+ */
6
+
7
+ /**
8
+ * Compress HTML
9
+ *
10
+ * This is a heavy regex-based removal of whitespace, unnecessary comments and
11
+ * tokens. IE conditional comments are preserved. There are also options to have
12
+ * STYLE and SCRIPT blocks compressed by callback functions.
13
+ *
14
+ * A test suite is available.
15
+ *
16
+ * @package Minify
17
+ * @author Stephen Clay <steve@mrclay.org>
18
+ */
19
+ class Minify_HTML
20
+ {
21
+ /**
22
+ * @var boolean
23
+ */
24
+ protected $_jsCleanComments = true;
25
+
26
+ /**
27
+ * "Minify" an HTML page
28
+ *
29
+ * @param string $html
30
+ *
31
+ * @param array $options
32
+ *
33
+ * 'cssMinifier' : (optional) callback function to process content of STYLE
34
+ * elements.
35
+ *
36
+ * 'jsMinifier' : (optional) callback function to process content of SCRIPT
37
+ * elements. Note: the type attribute is ignored.
38
+ *
39
+ * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
40
+ * unset, minify will sniff for an XHTML doctype.
41
+ *
42
+ * @return string
43
+ */
44
+ public static function minify($html, $options = array())
45
+ {
46
+ $min = new self($html, $options);
47
+
48
+ return $min->process();
49
+ }
50
+
51
+ /**
52
+ * Create a minifier object
53
+ *
54
+ * @param string $html
55
+ *
56
+ * @param array $options
57
+ *
58
+ * 'cssMinifier' : (optional) callback function to process content of STYLE
59
+ * elements.
60
+ *
61
+ * 'jsMinifier' : (optional) callback function to process content of SCRIPT
62
+ * elements. Note: the type attribute is ignored.
63
+ *
64
+ * 'jsCleanComments' : (optional) whether to remove HTML comments beginning and end of script block
65
+ *
66
+ * 'xhtml' : (optional boolean) should content be treated as XHTML1.0? If
67
+ * unset, minify will sniff for an XHTML doctype.
68
+ */
69
+ public function __construct($html, $options = array())
70
+ {
71
+ $this->_html = str_replace("\r\n", "\n", trim($html));
72
+ if (isset($options['xhtml'])) {
73
+ $this->_isXhtml = (bool)$options['xhtml'];
74
+ }
75
+ if (isset($options['cssMinifier'])) {
76
+ $this->_cssMinifier = $options['cssMinifier'];
77
+ }
78
+ if (isset($options['jsMinifier'])) {
79
+ $this->_jsMinifier = $options['jsMinifier'];
80
+ }
81
+ if (isset($options['jsCleanComments'])) {
82
+ $this->_jsCleanComments = (bool)$options['jsCleanComments'];
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Minify the markeup given in the constructor
88
+ *
89
+ * @return string
90
+ */
91
+ public function process()
92
+ {
93
+ if ($this->_isXhtml === null) {
94
+ $this->_isXhtml = (false !== strpos($this->_html, '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML'));
95
+ }
96
+
97
+ $this->_replacementHash = 'MINIFYHTML' . md5($_SERVER['REQUEST_TIME']);
98
+ $this->_placeholders = array();
99
+
100
+ // replace SCRIPTs (and minify) with placeholders
101
+ $this->_html = preg_replace_callback(
102
+ '/(\\s*)<script(\\b[^>]*?>)([\\s\\S]*?)<\\/script>(\\s*)/i'
103
+ ,array($this, '_removeScriptCB')
104
+ ,$this->_html);
105
+
106
+ // replace STYLEs (and minify) with placeholders
107
+ $this->_html = preg_replace_callback(
108
+ '/\\s*<style(\\b[^>]*>)([\\s\\S]*?)<\\/style>\\s*/i'
109
+ ,array($this, '_removeStyleCB')
110
+ ,$this->_html);
111
+
112
+ // remove HTML comments (not containing IE conditional comments).
113
+ $this->_html = preg_replace_callback(
114
+ '/<!--([\\s\\S]*?)-->/'
115
+ ,array($this, '_commentCB')
116
+ ,$this->_html);
117
+
118
+ // replace PREs with placeholders
119
+ $this->_html = preg_replace_callback('/\\s*<pre(\\b[^>]*?>[\\s\\S]*?<\\/pre>)\\s*/i'
120
+ ,array($this, '_removePreCB')
121
+ ,$this->_html);
122
+
123
+ // replace TEXTAREAs with placeholders
124
+ $this->_html = preg_replace_callback(
125
+ '/\\s*<textarea(\\b[^>]*?>[\\s\\S]*?<\\/textarea>)\\s*/i'
126
+ ,array($this, '_removeTextareaCB')
127
+ ,$this->_html);
128
+
129
+ // trim each line.
130
+ // @todo take into account attribute values that span multiple lines.
131
+ $this->_html = preg_replace('/^\\s+|\\s+$/m', '', $this->_html);
132
+
133
+ // remove ws around block/undisplayed elements
134
+ $this->_html = preg_replace('/\\s+(<\\/?(?:area|article|aside|base(?:font)?|blockquote|body'
135
+ .'|canvas|caption|center|col(?:group)?|dd|dir|div|dl|dt|fieldset|figcaption|figure|footer|form'
136
+ .'|frame(?:set)?|h[1-6]|head|header|hgroup|hr|html|legend|li|link|main|map|menu|meta|nav'
137
+ .'|ol|opt(?:group|ion)|output|p|param|section|t(?:able|body|head|d|h||r|foot|itle)'
138
+ .'|ul|video)\\b[^>]*>)/i', '$1', $this->_html);
139
+
140
+ // remove ws outside of all elements
141
+ $this->_html = preg_replace(
142
+ '/>(\\s(?:\\s*))?([^<]+)(\\s(?:\s*))?</'
143
+ ,'>$1$2$3<'
144
+ ,$this->_html);
145
+
146
+ // use newlines before 1st attribute in open tags (to limit line lengths)
147
+ // $this->_html = preg_replace('/(<[a-z\\-]+)\\s+([^>]+>)/i', "$1\n$2", $this->_html);
148
+
149
+ // fill placeholders
150
+ $this->_html = str_replace(
151
+ array_keys($this->_placeholders)
152
+ ,array_values($this->_placeholders)
153
+ ,$this->_html
154
+ );
155
+ // issue 229: multi-pass to catch scripts that didn't get replaced in textareas
156
+ $this->_html = str_replace(
157
+ array_keys($this->_placeholders)
158
+ ,array_values($this->_placeholders)
159
+ ,$this->_html
160
+ );
161
+
162
+ return $this->_html;
163
+ }
164
+
165
+ protected function _commentCB($m)
166
+ {
167
+ return (0 === strpos($m[1], '[') || false !== strpos($m[1], '<!['))
168
+ ? $m[0]
169
+ : '';
170
+ }
171
+
172
+ protected function _reservePlace($content)
173
+ {
174
+ $placeholder = '%' . $this->_replacementHash . count($this->_placeholders) . '%';
175
+ $this->_placeholders[$placeholder] = $content;
176
+
177
+ return $placeholder;
178
+ }
179
+
180
+ protected $_isXhtml = null;
181
+ protected $_replacementHash = null;
182
+ protected $_placeholders = array();
183
+ protected $_cssMinifier = null;
184
+ protected $_jsMinifier = null;
185
+
186
+ protected function _removePreCB($m)
187
+ {
188
+ return $this->_reservePlace("<pre{$m[1]}");
189
+ }
190
+
191
+ protected function _removeTextareaCB($m)
192
+ {
193
+ return $this->_reservePlace("<textarea{$m[1]}");
194
+ }
195
+
196
+ protected function _removeStyleCB($m)
197
+ {
198
+ $openStyle = "<style{$m[1]}";
199
+ $css = $m[2];
200
+ // remove HTML comments
201
+ $css = preg_replace('/(?:^\\s*<!--|-->\\s*$)/', '', $css);
202
+
203
+ // remove CDATA section markers
204
+ $css = $this->_removeCdata($css);
205
+
206
+ // minify
207
+ $minifier = $this->_cssMinifier
208
+ ? $this->_cssMinifier
209
+ : 'trim';
210
+ $css = call_user_func($minifier, $css);
211
+
212
+ return $this->_reservePlace($this->_needsCdata($css)
213
+ ? "{$openStyle}/*<![CDATA[*/{$css}/*]]>*/</style>"
214
+ : "{$openStyle}{$css}</style>"
215
+ );
216
+ }
217
+
218
+ protected function _removeScriptCB($m)
219
+ {
220
+ $openScript = "<script{$m[2]}";
221
+ $js = $m[3];
222
+
223
+ // whitespace surrounding? preserve at least one space
224
+ $ws1 = ($m[1] === '') ? '' : ' ';
225
+ $ws2 = ($m[4] === '') ? '' : ' ';
226
+
227
+ // remove HTML comments (and ending "//" if present)
228
+ if ($this->_jsCleanComments) {
229
+ $js = preg_replace('/(?:^\\s*<!--\\s*|\\s*(?:\\/\\/)?\\s*-->\\s*$)/', '', $js);
230
+ }
231
+
232
+ // remove CDATA section markers
233
+ $js = $this->_removeCdata($js);
234
+
235
+ // minify
236
+ $minifier = $this->_jsMinifier
237
+ ? $this->_jsMinifier
238
+ : 'trim';
239
+ $js = call_user_func($minifier, $js);
240
+
241
+ return $this->_reservePlace($this->_needsCdata($js)
242
+ ? "{$ws1}{$openScript}/*<![CDATA[*/{$js}/*]]>*/</script>{$ws2}"
243
+ : "{$ws1}{$openScript}{$js}</script>{$ws2}"
244
+ );
245
+ }
246
+
247
+ protected function _removeCdata($str)
248
+ {
249
+ return (false !== strpos($str, '<![CDATA['))
250
+ ? str_replace(array('<![CDATA[', ']]>'), '', $str)
251
+ : $str;
252
+ }
253
+
254
+ protected function _needsCdata($str)
255
+ {
256
+ return ($this->_isXhtml && preg_match('/(?:[<&]|\\-\\-|\\]\\]>)/', $str));
257
+ }
258
+ }
lib/vendor/mrclay/minify/lib/Minify/HTML/Helper.php ADDED
@@ -0,0 +1,250 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class Minify_HTML_Helper
4
+ * @package Minify
5
+ */
6
+
7
+ /**
8
+ * Helpers for writing Minify URIs into HTML
9
+ *
10
+ * @package Minify
11
+ * @author Stephen Clay <steve@mrclay.org>
12
+ */
13
+ class Minify_HTML_Helper
14
+ {
15
+ public $rewriteWorks = true;
16
+ public $minAppUri = '/min';
17
+ public $groupsConfigFile = '';
18
+
19
+ /**
20
+ * Get an HTML-escaped Minify URI for a group or set of files
21
+ *
22
+ * @param string|array $ke