summaryrefslogtreecommitdiffstats
path: root/library/vendor/Zend
diff options
context:
space:
mode:
Diffstat (limited to 'library/vendor/Zend')
-rw-r--r--library/vendor/Zend/Cache.php245
-rw-r--r--library/vendor/Zend/Cache/Backend.php285
-rw-r--r--library/vendor/Zend/Cache/Backend/Apc.php353
-rw-r--r--library/vendor/Zend/Cache/Backend/BlackHole.php248
-rw-r--r--library/vendor/Zend/Cache/Backend/ExtendedInterface.php125
-rw-r--r--library/vendor/Zend/Cache/Backend/File.php1035
-rw-r--r--library/vendor/Zend/Cache/Backend/Interface.php99
-rw-r--r--library/vendor/Zend/Cache/Backend/Libmemcached.php482
-rw-r--r--library/vendor/Zend/Cache/Backend/Memcached.php507
-rw-r--r--library/vendor/Zend/Cache/Backend/Sqlite.php676
-rw-r--r--library/vendor/Zend/Cache/Backend/Static.php577
-rw-r--r--library/vendor/Zend/Cache/Backend/Test.php414
-rw-r--r--library/vendor/Zend/Cache/Backend/TwoLevels.php546
-rw-r--r--library/vendor/Zend/Cache/Backend/WinCache.php347
-rw-r--r--library/vendor/Zend/Cache/Backend/Xcache.php219
-rw-r--r--library/vendor/Zend/Cache/Backend/ZendPlatform.php315
-rw-r--r--library/vendor/Zend/Cache/Backend/ZendServer.php205
-rw-r--r--library/vendor/Zend/Cache/Backend/ZendServer/Disk.php99
-rw-r--r--library/vendor/Zend/Cache/Backend/ZendServer/ShMem.php99
-rw-r--r--library/vendor/Zend/Cache/Core.php762
-rw-r--r--library/vendor/Zend/Cache/Exception.php31
-rw-r--r--library/vendor/Zend/Cache/Frontend/Capture.php87
-rw-r--r--library/vendor/Zend/Cache/Frontend/Class.php274
-rw-r--r--library/vendor/Zend/Cache/Frontend/File.php221
-rw-r--r--library/vendor/Zend/Cache/Frontend/Function.php178
-rw-r--r--library/vendor/Zend/Cache/Frontend/Output.php104
-rw-r--r--library/vendor/Zend/Cache/Frontend/Page.php403
-rw-r--r--library/vendor/Zend/Cache/Manager.php304
-rw-r--r--library/vendor/Zend/Config.php481
-rw-r--r--library/vendor/Zend/Config/Exception.php32
-rw-r--r--library/vendor/Zend/Config/Ini.php301
-rw-r--r--library/vendor/Zend/Config/Writer.php101
-rw-r--r--library/vendor/Zend/Config/Writer/Array.php54
-rw-r--r--library/vendor/Zend/Config/Writer/FileAbstract.php130
-rw-r--r--library/vendor/Zend/Config/Writer/Ini.php191
-rw-r--r--library/vendor/Zend/Controller/Action.php789
-rw-r--r--library/vendor/Zend/Controller/Action/Exception.php37
-rw-r--r--library/vendor/Zend/Controller/Action/Helper/Abstract.php155
-rw-r--r--library/vendor/Zend/Controller/Action/Helper/ActionStack.php133
-rw-r--r--library/vendor/Zend/Controller/Action/Helper/AjaxContext.php79
-rw-r--r--library/vendor/Zend/Controller/Action/Helper/AutoComplete/Abstract.php146
-rw-r--r--library/vendor/Zend/Controller/Action/Helper/Cache.php286
-rw-r--r--library/vendor/Zend/Controller/Action/Helper/ContextSwitch.php1377
-rw-r--r--library/vendor/Zend/Controller/Action/Helper/Json.php130
-rw-r--r--library/vendor/Zend/Controller/Action/Helper/Redirector.php531
-rw-r--r--library/vendor/Zend/Controller/Action/Helper/Url.php116
-rw-r--r--library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php996
-rw-r--r--library/vendor/Zend/Controller/Action/HelperBroker.php373
-rw-r--r--library/vendor/Zend/Controller/Action/HelperBroker/PriorityStack.php272
-rw-r--r--library/vendor/Zend/Controller/Action/Interface.php69
-rw-r--r--library/vendor/Zend/Controller/Dispatcher/Abstract.php435
-rw-r--r--library/vendor/Zend/Controller/Dispatcher/Exception.php36
-rw-r--r--library/vendor/Zend/Controller/Dispatcher/Interface.php204
-rw-r--r--library/vendor/Zend/Controller/Dispatcher/Standard.php504
-rw-r--r--library/vendor/Zend/Controller/Exception.php34
-rw-r--r--library/vendor/Zend/Controller/Front.php977
-rw-r--r--library/vendor/Zend/Controller/Plugin/Abstract.php151
-rw-r--r--library/vendor/Zend/Controller/Plugin/ActionStack.php277
-rw-r--r--library/vendor/Zend/Controller/Plugin/Broker.php361
-rw-r--r--library/vendor/Zend/Controller/Plugin/ErrorHandler.php299
-rw-r--r--library/vendor/Zend/Controller/Plugin/PutHandler.php58
-rw-r--r--library/vendor/Zend/Controller/Request/Abstract.php356
-rw-r--r--library/vendor/Zend/Controller/Request/Apache404.php80
-rw-r--r--library/vendor/Zend/Controller/Request/Exception.php36
-rw-r--r--library/vendor/Zend/Controller/Request/Http.php1087
-rw-r--r--library/vendor/Zend/Controller/Request/HttpTestCase.php275
-rw-r--r--library/vendor/Zend/Controller/Request/Simple.php54
-rw-r--r--library/vendor/Zend/Controller/Response/Abstract.php790
-rw-r--r--library/vendor/Zend/Controller/Response/Cli.php67
-rw-r--r--library/vendor/Zend/Controller/Response/Exception.php35
-rw-r--r--library/vendor/Zend/Controller/Response/Http.php37
-rw-r--r--library/vendor/Zend/Controller/Response/HttpTestCase.php129
-rw-r--r--library/vendor/Zend/Controller/Router/Abstract.php176
-rw-r--r--library/vendor/Zend/Controller/Router/Exception.php34
-rw-r--r--library/vendor/Zend/Controller/Router/Interface.php123
-rw-r--r--library/vendor/Zend/Controller/Router/Rewrite.php542
-rw-r--r--library/vendor/Zend/Controller/Router/Route.php603
-rw-r--r--library/vendor/Zend/Controller/Router/Route/Abstract.php119
-rw-r--r--library/vendor/Zend/Controller/Router/Route/Chain.php228
-rw-r--r--library/vendor/Zend/Controller/Router/Route/Hostname.php377
-rw-r--r--library/vendor/Zend/Controller/Router/Route/Interface.php38
-rw-r--r--library/vendor/Zend/Controller/Router/Route/Module.php322
-rw-r--r--library/vendor/Zend/Controller/Router/Route/Regex.php316
-rw-r--r--library/vendor/Zend/Controller/Router/Route/Static.php148
-rw-r--r--library/vendor/Zend/Crypt.php167
-rw-r--r--library/vendor/Zend/Crypt/DiffieHellman.php378
-rw-r--r--library/vendor/Zend/Crypt/DiffieHellman/Exception.php35
-rw-r--r--library/vendor/Zend/Crypt/Exception.php34
-rw-r--r--library/vendor/Zend/Crypt/Hmac.php178
-rw-r--r--library/vendor/Zend/Crypt/Hmac/Exception.php35
-rw-r--r--library/vendor/Zend/Crypt/Math.php186
-rw-r--r--library/vendor/Zend/Crypt/Math/BigInteger.php113
-rw-r--r--library/vendor/Zend/Crypt/Math/BigInteger/Bcmath.php226
-rw-r--r--library/vendor/Zend/Crypt/Math/BigInteger/Exception.php35
-rw-r--r--library/vendor/Zend/Crypt/Math/BigInteger/Gmp.php219
-rw-r--r--library/vendor/Zend/Crypt/Math/BigInteger/Interface.php51
-rw-r--r--library/vendor/Zend/Crypt/Math/Exception.php35
-rw-r--r--library/vendor/Zend/Crypt/Rsa.php334
-rw-r--r--library/vendor/Zend/Crypt/Rsa/Exception.php35
-rw-r--r--library/vendor/Zend/Crypt/Rsa/Key.php94
-rw-r--r--library/vendor/Zend/Crypt/Rsa/Key/Private.php72
-rw-r--r--library/vendor/Zend/Crypt/Rsa/Key/Public.php72
-rw-r--r--library/vendor/Zend/Date.php4872
-rw-r--r--library/vendor/Zend/Date/Cities.php321
-rw-r--r--library/vendor/Zend/Date/DateObject.php1094
-rw-r--r--library/vendor/Zend/Date/Exception.php48
-rw-r--r--library/vendor/Zend/Db.php282
-rw-r--r--library/vendor/Zend/Db/Adapter/Abstract.php1267
-rw-r--r--library/vendor/Zend/Db/Adapter/Db2.php827
-rw-r--r--library/vendor/Zend/Db/Adapter/Db2/Exception.php44
-rw-r--r--library/vendor/Zend/Db/Adapter/Exception.php56
-rw-r--r--library/vendor/Zend/Db/Adapter/Mysqli.php543
-rw-r--r--library/vendor/Zend/Db/Adapter/Mysqli/Exception.php39
-rw-r--r--library/vendor/Zend/Db/Adapter/Oracle.php631
-rw-r--r--library/vendor/Zend/Db/Adapter/Oracle/Exception.php59
-rw-r--r--library/vendor/Zend/Db/Adapter/Pdo/Abstract.php397
-rw-r--r--library/vendor/Zend/Db/Adapter/Pdo/Ibm.php354
-rw-r--r--library/vendor/Zend/Db/Adapter/Pdo/Ibm/Db2.php224
-rw-r--r--library/vendor/Zend/Db/Adapter/Pdo/Ibm/Ids.php297
-rw-r--r--library/vendor/Zend/Db/Adapter/Pdo/Mssql.php435
-rw-r--r--library/vendor/Zend/Db/Adapter/Pdo/Mysql.php269
-rw-r--r--library/vendor/Zend/Db/Adapter/Pdo/Oci.php375
-rw-r--r--library/vendor/Zend/Db/Adapter/Pdo/Pgsql.php333
-rw-r--r--library/vendor/Zend/Db/Adapter/Pdo/Sqlite.php305
-rw-r--r--library/vendor/Zend/Db/Adapter/Sqlsrv.php662
-rw-r--r--library/vendor/Zend/Db/Adapter/Sqlsrv/Exception.php62
-rw-r--r--library/vendor/Zend/Db/Exception.php34
-rw-r--r--library/vendor/Zend/Db/Expr.php77
-rw-r--r--library/vendor/Zend/Db/Profiler.php469
-rw-r--r--library/vendor/Zend/Db/Profiler/Exception.php39
-rw-r--r--library/vendor/Zend/Db/Profiler/Query.php213
-rw-r--r--library/vendor/Zend/Db/Select.php1368
-rw-r--r--library/vendor/Zend/Db/Select/Exception.php38
-rw-r--r--library/vendor/Zend/Db/Statement.php488
-rw-r--r--library/vendor/Zend/Db/Statement/Db2.php354
-rw-r--r--library/vendor/Zend/Db/Statement/Db2/Exception.php57
-rw-r--r--library/vendor/Zend/Db/Statement/Exception.php55
-rw-r--r--library/vendor/Zend/Db/Statement/Interface.php203
-rw-r--r--library/vendor/Zend/Db/Statement/Mysqli.php356
-rw-r--r--library/vendor/Zend/Db/Statement/Mysqli/Exception.php37
-rw-r--r--library/vendor/Zend/Db/Statement/Oracle.php561
-rw-r--r--library/vendor/Zend/Db/Statement/Oracle/Exception.php58
-rw-r--r--library/vendor/Zend/Db/Statement/Pdo.php426
-rw-r--r--library/vendor/Zend/Db/Statement/Pdo/Ibm.php92
-rw-r--r--library/vendor/Zend/Db/Statement/Pdo/Oci.php90
-rw-r--r--library/vendor/Zend/Db/Statement/Sqlsrv.php430
-rw-r--r--library/vendor/Zend/Db/Statement/Sqlsrv/Exception.php60
-rw-r--r--library/vendor/Zend/Db/Table.php77
-rw-r--r--library/vendor/Zend/Db/Table/Abstract.php1599
-rw-r--r--library/vendor/Zend/Db/Table/Definition.php131
-rw-r--r--library/vendor/Zend/Db/Table/Exception.php37
-rw-r--r--library/vendor/Zend/Db/Table/Row.php41
-rw-r--r--library/vendor/Zend/Db/Table/Row/Abstract.php1160
-rw-r--r--library/vendor/Zend/Db/Table/Row/Exception.php37
-rw-r--r--library/vendor/Zend/Db/Table/Rowset.php42
-rw-r--r--library/vendor/Zend/Db/Table/Rowset/Abstract.php443
-rw-r--r--library/vendor/Zend/Db/Table/Rowset/Exception.php36
-rw-r--r--library/vendor/Zend/Db/Table/Select.php221
-rw-r--r--library/vendor/Zend/Db/Table/Select/Exception.php38
-rw-r--r--library/vendor/Zend/Exception.php96
-rw-r--r--library/vendor/Zend/File/ClassFileLocator.php177
-rw-r--r--library/vendor/Zend/File/PhpClassFile.php56
-rw-r--r--library/vendor/Zend/File/Transfer.php122
-rw-r--r--library/vendor/Zend/File/Transfer/Adapter/Abstract.php1548
-rw-r--r--library/vendor/Zend/File/Transfer/Adapter/Http.php480
-rw-r--r--library/vendor/Zend/File/Transfer/Exception.php54
-rw-r--r--library/vendor/Zend/Filter.php236
-rw-r--r--library/vendor/Zend/Filter/Alnum.php144
-rw-r--r--library/vendor/Zend/Filter/Alpha.php144
-rw-r--r--library/vendor/Zend/Filter/BaseName.php49
-rw-r--r--library/vendor/Zend/Filter/Boolean.php369
-rw-r--r--library/vendor/Zend/Filter/Callback.php149
-rw-r--r--library/vendor/Zend/Filter/Compress.php192
-rw-r--r--library/vendor/Zend/Filter/Compress/Bz2.php181
-rw-r--r--library/vendor/Zend/Filter/Compress/CompressAbstract.php88
-rw-r--r--library/vendor/Zend/Filter/Compress/CompressInterface.php54
-rw-r--r--library/vendor/Zend/Filter/Compress/Gz.php220
-rw-r--r--library/vendor/Zend/Filter/Compress/Lzf.php87
-rw-r--r--library/vendor/Zend/Filter/Compress/Rar.php243
-rw-r--r--library/vendor/Zend/Filter/Compress/Tar.php234
-rw-r--r--library/vendor/Zend/Filter/Compress/Zip.php343
-rw-r--r--library/vendor/Zend/Filter/Decompress.php48
-rw-r--r--library/vendor/Zend/Filter/Decrypt.php48
-rw-r--r--library/vendor/Zend/Filter/Digits.php81
-rw-r--r--library/vendor/Zend/Filter/Dir.php49
-rw-r--r--library/vendor/Zend/Filter/Encrypt.php134
-rw-r--r--library/vendor/Zend/Filter/Encrypt/Interface.php47
-rw-r--r--library/vendor/Zend/Filter/Encrypt/Mcrypt.php352
-rw-r--r--library/vendor/Zend/Filter/Encrypt/Openssl.php480
-rw-r--r--library/vendor/Zend/Filter/Exception.php36
-rw-r--r--library/vendor/Zend/Filter/File/Decrypt.php101
-rw-r--r--library/vendor/Zend/Filter/File/Encrypt.php101
-rw-r--r--library/vendor/Zend/Filter/File/LowerCase.php79
-rw-r--r--library/vendor/Zend/Filter/File/Rename.php304
-rw-r--r--library/vendor/Zend/Filter/File/UpperCase.php79
-rw-r--r--library/vendor/Zend/Filter/HtmlEntities.php213
-rw-r--r--library/vendor/Zend/Filter/Inflector.php523
-rw-r--r--library/vendor/Zend/Filter/Input.php1196
-rw-r--r--library/vendor/Zend/Filter/Int.php49
-rw-r--r--library/vendor/Zend/Filter/Interface.php40
-rw-r--r--library/vendor/Zend/Filter/LocalizedToNormalized.php110
-rw-r--r--library/vendor/Zend/Filter/NormalizedToLocalized.php108
-rw-r--r--library/vendor/Zend/Filter/Null.php181
-rw-r--r--library/vendor/Zend/Filter/PregReplace.php172
-rw-r--r--library/vendor/Zend/Filter/RealPath.php133
-rw-r--r--library/vendor/Zend/Filter/StringToLower.php118
-rw-r--r--library/vendor/Zend/Filter/StringToUpper.php118
-rw-r--r--library/vendor/Zend/Filter/StringTrim.php123
-rw-r--r--library/vendor/Zend/Filter/StripNewlines.php47
-rw-r--r--library/vendor/Zend/Filter/StripTags.php351
-rw-r--r--library/vendor/Zend/Filter/Word/CamelCaseToDash.php43
-rw-r--r--library/vendor/Zend/Filter/Word/CamelCaseToSeparator.php48
-rw-r--r--library/vendor/Zend/Filter/Word/CamelCaseToUnderscore.php43
-rw-r--r--library/vendor/Zend/Filter/Word/DashToCamelCase.php43
-rw-r--r--library/vendor/Zend/Filter/Word/DashToSeparator.php41
-rw-r--r--library/vendor/Zend/Filter/Word/DashToUnderscore.php44
-rw-r--r--library/vendor/Zend/Filter/Word/Separator/Abstract.php74
-rw-r--r--library/vendor/Zend/Filter/Word/SeparatorToCamelCase.php63
-rw-r--r--library/vendor/Zend/Filter/Word/SeparatorToDash.php45
-rw-r--r--library/vendor/Zend/Filter/Word/SeparatorToSeparator.php127
-rw-r--r--library/vendor/Zend/Filter/Word/UnderscoreToCamelCase.php43
-rw-r--r--library/vendor/Zend/Filter/Word/UnderscoreToDash.php44
-rw-r--r--library/vendor/Zend/Filter/Word/UnderscoreToSeparator.php44
-rw-r--r--library/vendor/Zend/Form.php3472
-rw-r--r--library/vendor/Zend/Form/Decorator/Abstract.php251
-rw-r--r--library/vendor/Zend/Form/Decorator/Callback.php126
-rw-r--r--library/vendor/Zend/Form/Decorator/Captcha.php71
-rw-r--r--library/vendor/Zend/Form/Decorator/Description.php197
-rw-r--r--library/vendor/Zend/Form/Decorator/DtDdWrapper.php69
-rw-r--r--library/vendor/Zend/Form/Decorator/Errors.php76
-rw-r--r--library/vendor/Zend/Form/Decorator/Exception.php36
-rw-r--r--library/vendor/Zend/Form/Decorator/Fieldset.php156
-rw-r--r--library/vendor/Zend/Form/Decorator/File.php140
-rw-r--r--library/vendor/Zend/Form/Decorator/Form.php133
-rw-r--r--library/vendor/Zend/Form/Decorator/FormElements.php140
-rw-r--r--library/vendor/Zend/Form/Decorator/FormErrors.php514
-rw-r--r--library/vendor/Zend/Form/Decorator/HtmlTag.php253
-rw-r--r--library/vendor/Zend/Form/Decorator/Image.php152
-rw-r--r--library/vendor/Zend/Form/Decorator/Interface.php123
-rw-r--r--library/vendor/Zend/Form/Decorator/Label.php461
-rw-r--r--library/vendor/Zend/Form/Decorator/Marker/File/Interface.php33
-rw-r--r--library/vendor/Zend/Form/Decorator/PrepareElements.php89
-rw-r--r--library/vendor/Zend/Form/Decorator/Tooltip.php57
-rw-r--r--library/vendor/Zend/Form/Decorator/ViewHelper.php266
-rw-r--r--library/vendor/Zend/Form/Decorator/ViewScript.php190
-rw-r--r--library/vendor/Zend/Form/DisplayGroup.php1172
-rw-r--r--library/vendor/Zend/Form/Element.php2280
-rw-r--r--library/vendor/Zend/Form/Element/Button.php55
-rw-r--r--library/vendor/Zend/Form/Element/Checkbox.php202
-rw-r--r--library/vendor/Zend/Form/Element/Exception.php36
-rw-r--r--library/vendor/Zend/Form/Element/File.php910
-rw-r--r--library/vendor/Zend/Form/Element/Hidden.php41
-rw-r--r--library/vendor/Zend/Form/Element/Image.php131
-rw-r--r--library/vendor/Zend/Form/Element/Multi.php316
-rw-r--r--library/vendor/Zend/Form/Element/MultiCheckbox.php72
-rw-r--r--library/vendor/Zend/Form/Element/Multiselect.php53
-rw-r--r--library/vendor/Zend/Form/Element/Note.php63
-rw-r--r--library/vendor/Zend/Form/Element/Password.php87
-rw-r--r--library/vendor/Zend/Form/Element/Radio.php65
-rw-r--r--library/vendor/Zend/Form/Element/Reset.php41
-rw-r--r--library/vendor/Zend/Form/Element/Select.php47
-rw-r--r--library/vendor/Zend/Form/Element/Submit.php126
-rw-r--r--library/vendor/Zend/Form/Element/Text.php41
-rw-r--r--library/vendor/Zend/Form/Element/Textarea.php41
-rw-r--r--library/vendor/Zend/Form/Element/Xhtml.php36
-rw-r--r--library/vendor/Zend/Form/Exception.php34
-rw-r--r--library/vendor/Zend/Form/SubForm.php60
-rw-r--r--library/vendor/Zend/Json.php433
-rw-r--r--library/vendor/Zend/Json/Decoder.php570
-rw-r--r--library/vendor/Zend/Json/Encoder.php576
-rw-r--r--library/vendor/Zend/Json/Exception.php36
-rw-r--r--library/vendor/Zend/Json/Expr.php80
-rw-r--r--library/vendor/Zend/LICENSE.txt27
-rw-r--r--library/vendor/Zend/Layout.php788
-rw-r--r--library/vendor/Zend/Layout/Controller/Action/Helper/Layout.php181
-rw-r--r--library/vendor/Zend/Layout/Controller/Plugin/Layout.php155
-rw-r--r--library/vendor/Zend/Layout/Exception.php34
-rw-r--r--library/vendor/Zend/Loader.php338
-rw-r--r--library/vendor/Zend/Loader/Autoloader.php589
-rw-r--r--library/vendor/Zend/Loader/Autoloader/Interface.php43
-rw-r--r--library/vendor/Zend/Loader/Exception.php34
-rw-r--r--library/vendor/Zend/Loader/Exception/InvalidArgumentException.php33
-rw-r--r--library/vendor/Zend/Loader/PluginLoader.php497
-rw-r--r--library/vendor/Zend/Loader/PluginLoader/Exception.php38
-rw-r--r--library/vendor/Zend/Loader/PluginLoader/Interface.php75
-rw-r--r--library/vendor/Zend/Locale.php1996
-rw-r--r--library/vendor/Zend/Locale/Data.php1609
-rw-r--r--library/vendor/Zend/Locale/Data/Translation.php285
-rw-r--r--library/vendor/Zend/Locale/Exception.php36
-rw-r--r--library/vendor/Zend/Locale/Format.php1321
-rw-r--r--library/vendor/Zend/Locale/Math.php354
-rw-r--r--library/vendor/Zend/Locale/Math/Exception.php52
-rw-r--r--library/vendor/Zend/Locale/Math/PhpMath.php239
-rw-r--r--library/vendor/Zend/Log.php645
-rw-r--r--library/vendor/Zend/Log/Exception.php32
-rw-r--r--library/vendor/Zend/Log/FactoryInterface.php38
-rw-r--r--library/vendor/Zend/Log/Filter/Abstract.php57
-rw-r--r--library/vendor/Zend/Log/Filter/Interface.php40
-rw-r--r--library/vendor/Zend/Log/Filter/Message.php83
-rw-r--r--library/vendor/Zend/Log/Filter/Priority.php99
-rw-r--r--library/vendor/Zend/Log/Filter/Suppress.php76
-rw-r--r--library/vendor/Zend/Log/Formatter/Abstract.php38
-rw-r--r--library/vendor/Zend/Log/Formatter/Interface.php41
-rw-r--r--library/vendor/Zend/Log/Formatter/Simple.php106
-rw-r--r--library/vendor/Zend/Log/Formatter/Xml.php164
-rw-r--r--library/vendor/Zend/Log/Writer/Abstract.php138
-rw-r--r--library/vendor/Zend/Log/Writer/Db.php144
-rw-r--r--library/vendor/Zend/Log/Writer/Mail.php426
-rw-r--r--library/vendor/Zend/Log/Writer/Mock.php80
-rw-r--r--library/vendor/Zend/Log/Writer/Null.php55
-rw-r--r--library/vendor/Zend/Log/Writer/Stream.php132
-rw-r--r--library/vendor/Zend/Log/Writer/Syslog.php263
-rw-r--r--library/vendor/Zend/Log/Writer/ZendMonitor.php130
-rw-r--r--library/vendor/Zend/Mail.php1265
-rw-r--r--library/vendor/Zend/Mail/Exception.php36
-rw-r--r--library/vendor/Zend/Mail/Header/HeaderName.php91
-rw-r--r--library/vendor/Zend/Mail/Header/HeaderValue.php135
-rw-r--r--library/vendor/Zend/Mail/Message.php110
-rw-r--r--library/vendor/Zend/Mail/Message/File.php94
-rw-r--r--library/vendor/Zend/Mail/Message/Interface.php55
-rw-r--r--library/vendor/Zend/Mail/Part.php590
-rw-r--r--library/vendor/Zend/Mail/Part/File.php191
-rw-r--r--library/vendor/Zend/Mail/Part/Interface.php136
-rw-r--r--library/vendor/Zend/Mail/Protocol/Abstract.php436
-rw-r--r--library/vendor/Zend/Mail/Protocol/Exception.php38
-rw-r--r--library/vendor/Zend/Mail/Protocol/Imap.php830
-rw-r--r--library/vendor/Zend/Mail/Protocol/Pop3.php466
-rw-r--r--library/vendor/Zend/Mail/Protocol/Smtp.php433
-rw-r--r--library/vendor/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php107
-rw-r--r--library/vendor/Zend/Mail/Protocol/Smtp/Auth/Login.php97
-rw-r--r--library/vendor/Zend/Mail/Protocol/Smtp/Auth/Plain.php95
-rw-r--r--library/vendor/Zend/Mail/Storage.php40
-rw-r--r--library/vendor/Zend/Mail/Storage/Abstract.php364
-rw-r--r--library/vendor/Zend/Mail/Storage/Exception.php38
-rw-r--r--library/vendor/Zend/Mail/Storage/Folder.php235
-rw-r--r--library/vendor/Zend/Mail/Storage/Folder/Interface.php60
-rw-r--r--library/vendor/Zend/Mail/Storage/Folder/Maildir.php255
-rw-r--r--library/vendor/Zend/Mail/Storage/Folder/Mbox.php255
-rw-r--r--library/vendor/Zend/Mail/Storage/Imap.php620
-rw-r--r--library/vendor/Zend/Mail/Storage/Maildir.php462
-rw-r--r--library/vendor/Zend/Mail/Storage/Mbox.php437
-rw-r--r--library/vendor/Zend/Mail/Storage/Pop3.php321
-rw-r--r--library/vendor/Zend/Mail/Storage/Writable/Interface.php108
-rw-r--r--library/vendor/Zend/Mail/Storage/Writable/Maildir.php1014
-rw-r--r--library/vendor/Zend/Mail/Transport/Abstract.php345
-rw-r--r--library/vendor/Zend/Mail/Transport/Exception.php38
-rw-r--r--library/vendor/Zend/Mail/Transport/File.php131
-rw-r--r--library/vendor/Zend/Mail/Transport/Sendmail.php214
-rw-r--r--library/vendor/Zend/Mail/Transport/Smtp.php238
-rw-r--r--library/vendor/Zend/Mime.php670
-rw-r--r--library/vendor/Zend/Mime/Decode.php275
-rw-r--r--library/vendor/Zend/Mime/Exception.php35
-rw-r--r--library/vendor/Zend/Mime/Message.php302
-rw-r--r--library/vendor/Zend/Mime/Part.php329
-rw-r--r--library/vendor/Zend/Paginator.php1164
-rw-r--r--library/vendor/Zend/Paginator/Adapter/Array.php80
-rw-r--r--library/vendor/Zend/Paginator/Adapter/DbSelect.php285
-rw-r--r--library/vendor/Zend/Paginator/Adapter/DbTableSelect.php47
-rw-r--r--library/vendor/Zend/Paginator/Adapter/Interface.php40
-rw-r--r--library/vendor/Zend/Paginator/Adapter/Iterator.php99
-rw-r--r--library/vendor/Zend/Paginator/Adapter/Null.php79
-rw-r--r--library/vendor/Zend/Paginator/AdapterAggregate.php40
-rw-r--r--library/vendor/Zend/Paginator/Exception.php34
-rw-r--r--library/vendor/Zend/Paginator/ScrollingStyle/All.php49
-rw-r--r--library/vendor/Zend/Paginator/ScrollingStyle/Elastic.php62
-rw-r--r--library/vendor/Zend/Paginator/ScrollingStyle/Interface.php38
-rw-r--r--library/vendor/Zend/Paginator/ScrollingStyle/Jumping.php62
-rw-r--r--library/vendor/Zend/Paginator/ScrollingStyle/Sliding.php77
-rw-r--r--library/vendor/Zend/Paginator/SerializableLimitIterator.php159
-rw-r--r--library/vendor/Zend/ProgressBar.php207
-rw-r--r--library/vendor/Zend/ProgressBar/Adapter.php113
-rw-r--r--library/vendor/Zend/ProgressBar/Adapter/Exception.php37
-rw-r--r--library/vendor/Zend/ProgressBar/Adapter/JsPull.php115
-rw-r--r--library/vendor/Zend/ProgressBar/Adapter/JsPush.php146
-rw-r--r--library/vendor/Zend/ProgressBar/Exception.php37
-rw-r--r--library/vendor/Zend/README.md8
-rw-r--r--library/vendor/Zend/Registry.php192
-rw-r--r--library/vendor/Zend/Server/Abstract.php235
-rw-r--r--library/vendor/Zend/Server/Cache.php147
-rw-r--r--library/vendor/Zend/Server/Definition.php263
-rw-r--r--library/vendor/Zend/Server/Exception.php34
-rw-r--r--library/vendor/Zend/Server/Interface.php118
-rw-r--r--library/vendor/Zend/Server/Method/Callback.php204
-rw-r--r--library/vendor/Zend/Server/Method/Definition.php288
-rw-r--r--library/vendor/Zend/Server/Method/Parameter.php214
-rw-r--r--library/vendor/Zend/Server/Method/Prototype.php207
-rw-r--r--library/vendor/Zend/Server/Reflection.php105
-rw-r--r--library/vendor/Zend/Server/Reflection/Class.php195
-rw-r--r--library/vendor/Zend/Server/Reflection/Exception.php37
-rw-r--r--library/vendor/Zend/Server/Reflection/Function.php38
-rw-r--r--library/vendor/Zend/Server/Reflection/Function/Abstract.php506
-rw-r--r--library/vendor/Zend/Server/Reflection/Method.php109
-rw-r--r--library/vendor/Zend/Server/Reflection/Node.php201
-rw-r--r--library/vendor/Zend/Server/Reflection/Parameter.php158
-rw-r--r--library/vendor/Zend/Server/Reflection/Prototype.php99
-rw-r--r--library/vendor/Zend/Server/Reflection/ReturnValue.php108
-rw-r--r--library/vendor/Zend/Session.php895
-rw-r--r--library/vendor/Zend/Session/Abstract.php182
-rw-r--r--library/vendor/Zend/Session/Exception.php73
-rw-r--r--library/vendor/Zend/Session/Namespace.php511
-rw-r--r--library/vendor/Zend/Session/SaveHandler/DbTable.php579
-rw-r--r--library/vendor/Zend/Session/SaveHandler/Exception.php36
-rw-r--r--library/vendor/Zend/Session/SaveHandler/Interface.php81
-rw-r--r--library/vendor/Zend/Session/Validator/Abstract.php70
-rw-r--r--library/vendor/Zend/Session/Validator/Exception.php42
-rw-r--r--library/vendor/Zend/Session/Validator/HttpUserAgent.php65
-rw-r--r--library/vendor/Zend/Session/Validator/Interface.php52
-rw-r--r--library/vendor/Zend/Soap/AutoDiscover.php597
-rw-r--r--library/vendor/Zend/Soap/AutoDiscover/Exception.php33
-rw-r--r--library/vendor/Zend/Soap/Client.php1223
-rw-r--r--library/vendor/Zend/Soap/Client/Common.php76
-rw-r--r--library/vendor/Zend/Soap/Client/DotNet.php93
-rw-r--r--library/vendor/Zend/Soap/Client/Exception.php34
-rw-r--r--library/vendor/Zend/Soap/Client/Local.php97
-rw-r--r--library/vendor/Zend/Soap/Server.php999
-rw-r--r--library/vendor/Zend/Soap/Server/Exception.php36
-rw-r--r--library/vendor/Zend/Soap/Server/Proxy.php75
-rw-r--r--library/vendor/Zend/Soap/Wsdl.php661
-rw-r--r--library/vendor/Zend/Soap/Wsdl/Exception.php36
-rw-r--r--library/vendor/Zend/Soap/Wsdl/Strategy/Abstract.php65
-rw-r--r--library/vendor/Zend/Soap/Wsdl/Strategy/AnyType.php58
-rw-r--r--library/vendor/Zend/Soap/Wsdl/Strategy/ArrayOfTypeComplex.php142
-rw-r--r--library/vendor/Zend/Soap/Wsdl/Strategy/ArrayOfTypeSequence.php154
-rw-r--r--library/vendor/Zend/Soap/Wsdl/Strategy/Composite.php183
-rw-r--r--library/vendor/Zend/Soap/Wsdl/Strategy/DefaultComplexType.php89
-rw-r--r--library/vendor/Zend/Soap/Wsdl/Strategy/Interface.php48
-rw-r--r--library/vendor/Zend/TimeSync.php296
-rw-r--r--library/vendor/Zend/TimeSync/Exception.php63
-rw-r--r--library/vendor/Zend/TimeSync/Ntp.php430
-rw-r--r--library/vendor/Zend/TimeSync/Protocol.php148
-rw-r--r--library/vendor/Zend/TimeSync/Sntp.php118
-rw-r--r--library/vendor/Zend/Translate.php220
-rw-r--r--library/vendor/Zend/Translate/Adapter.php988
-rw-r--r--library/vendor/Zend/Translate/Exception.php36
-rw-r--r--library/vendor/Zend/Translate/Plural.php223
-rw-r--r--library/vendor/Zend/Uri.php201
-rw-r--r--library/vendor/Zend/Uri/Exception.php36
-rw-r--r--library/vendor/Zend/Uri/Http.php745
-rw-r--r--library/vendor/Zend/VERSION1
-rw-r--r--library/vendor/Zend/Validate.php283
-rw-r--r--library/vendor/Zend/Validate/Abstract.php477
-rw-r--r--library/vendor/Zend/Validate/Alnum.php147
-rw-r--r--library/vendor/Zend/Validate/Alpha.php147
-rw-r--r--library/vendor/Zend/Validate/Barcode.php222
-rw-r--r--library/vendor/Zend/Validate/Barcode/AdapterAbstract.php314
-rw-r--r--library/vendor/Zend/Validate/Barcode/AdapterInterface.php68
-rw-r--r--library/vendor/Zend/Validate/Barcode/Code25.php61
-rw-r--r--library/vendor/Zend/Validate/Barcode/Code25interleaved.php61
-rw-r--r--library/vendor/Zend/Validate/Barcode/Code39.php97
-rw-r--r--library/vendor/Zend/Validate/Barcode/Code39ext.php55
-rw-r--r--library/vendor/Zend/Validate/Barcode/Code93.php117
-rw-r--r--library/vendor/Zend/Validate/Barcode/Code93ext.php55
-rw-r--r--library/vendor/Zend/Validate/Barcode/Ean12.php51
-rw-r--r--library/vendor/Zend/Validate/Barcode/Ean13.php51
-rw-r--r--library/vendor/Zend/Validate/Barcode/Ean14.php51
-rw-r--r--library/vendor/Zend/Validate/Barcode/Ean18.php51
-rw-r--r--library/vendor/Zend/Validate/Barcode/Ean2.php55
-rw-r--r--library/vendor/Zend/Validate/Barcode/Ean5.php55
-rw-r--r--library/vendor/Zend/Validate/Barcode/Ean8.php68
-rw-r--r--library/vendor/Zend/Validate/Barcode/Gtin12.php51
-rw-r--r--library/vendor/Zend/Validate/Barcode/Gtin13.php51
-rw-r--r--library/vendor/Zend/Validate/Barcode/Gtin14.php51
-rw-r--r--library/vendor/Zend/Validate/Barcode/Identcode.php51
-rw-r--r--library/vendor/Zend/Validate/Barcode/Intelligentmail.php55
-rw-r--r--library/vendor/Zend/Validate/Barcode/Issn.php118
-rw-r--r--library/vendor/Zend/Validate/Barcode/Itf14.php51
-rw-r--r--library/vendor/Zend/Validate/Barcode/Leitcode.php51
-rw-r--r--library/vendor/Zend/Validate/Barcode/Planet.php51
-rw-r--r--library/vendor/Zend/Validate/Barcode/Postnet.php51
-rw-r--r--library/vendor/Zend/Validate/Barcode/Royalmail.php120
-rw-r--r--library/vendor/Zend/Validate/Barcode/Sscc.php51
-rw-r--r--library/vendor/Zend/Validate/Barcode/Upca.php51
-rw-r--r--library/vendor/Zend/Validate/Barcode/Upce.php68
-rw-r--r--library/vendor/Zend/Validate/Between.php222
-rw-r--r--library/vendor/Zend/Validate/Callback.php170
-rw-r--r--library/vendor/Zend/Validate/Ccnum.php110
-rw-r--r--library/vendor/Zend/Validate/CreditCard.php316
-rw-r--r--library/vendor/Zend/Validate/Date.php253
-rw-r--r--library/vendor/Zend/Validate/Db/Abstract.php350
-rw-r--r--library/vendor/Zend/Validate/Db/NoRecordExists.php50
-rw-r--r--library/vendor/Zend/Validate/Db/RecordExists.php50
-rw-r--r--library/vendor/Zend/Validate/Digits.php89
-rw-r--r--library/vendor/Zend/Validate/EmailAddress.php571
-rw-r--r--library/vendor/Zend/Validate/Exception.php33
-rw-r--r--library/vendor/Zend/Validate/File/Count.php279
-rw-r--r--library/vendor/Zend/Validate/File/Crc32.php177
-rw-r--r--library/vendor/Zend/Validate/File/ExcludeExtension.php92
-rw-r--r--library/vendor/Zend/Validate/File/ExcludeMimeType.php99
-rw-r--r--library/vendor/Zend/Validate/File/Exists.php201
-rw-r--r--library/vendor/Zend/Validate/File/Extension.php235
-rw-r--r--library/vendor/Zend/Validate/File/FilesSize.php161
-rw-r--r--library/vendor/Zend/Validate/File/Hash.php190
-rw-r--r--library/vendor/Zend/Validate/File/ImageSize.php357
-rw-r--r--library/vendor/Zend/Validate/File/IsCompressed.php148
-rw-r--r--library/vendor/Zend/Validate/File/IsImage.php171
-rw-r--r--library/vendor/Zend/Validate/File/Md5.php179
-rw-r--r--library/vendor/Zend/Validate/File/MimeType.php468
-rw-r--r--library/vendor/Zend/Validate/File/NotExists.php83
-rw-r--r--library/vendor/Zend/Validate/File/Sha1.php179
-rw-r--r--library/vendor/Zend/Validate/File/Size.php398
-rw-r--r--library/vendor/Zend/Validate/File/Upload.php249
-rw-r--r--library/vendor/Zend/Validate/File/WordCount.php99
-rw-r--r--library/vendor/Zend/Validate/Float.php131
-rw-r--r--library/vendor/Zend/Validate/GreaterThan.php122
-rw-r--r--library/vendor/Zend/Validate/Hex.php71
-rw-r--r--library/vendor/Zend/Validate/Hostname.php1987
-rw-r--r--library/vendor/Zend/Validate/Hostname/Biz.php2917
-rw-r--r--library/vendor/Zend/Validate/Hostname/Cn.php2199
-rw-r--r--library/vendor/Zend/Validate/Hostname/Com.php196
-rw-r--r--library/vendor/Zend/Validate/Hostname/Jp.php739
-rw-r--r--library/vendor/Zend/Validate/Iban.php246
-rw-r--r--library/vendor/Zend/Validate/Identical.php163
-rw-r--r--library/vendor/Zend/Validate/InArray.php202
-rw-r--r--library/vendor/Zend/Validate/Int.php145
-rw-r--r--library/vendor/Zend/Validate/Interface.php54
-rw-r--r--library/vendor/Zend/Validate/Ip.php190
-rw-r--r--library/vendor/Zend/Validate/Isbn.php274
-rw-r--r--library/vendor/Zend/Validate/LessThan.php120
-rw-r--r--library/vendor/Zend/Validate/NotEmpty.php277
-rw-r--r--library/vendor/Zend/Validate/PostCode.php202
-rw-r--r--library/vendor/Zend/Validate/Regex.php143
-rw-r--r--library/vendor/Zend/Validate/Sitemap/Changefreq.php94
-rw-r--r--library/vendor/Zend/Validate/Sitemap/Lastmod.php87
-rw-r--r--library/vendor/Zend/Validate/Sitemap/Loc.php85
-rw-r--r--library/vendor/Zend/Validate/Sitemap/Priority.php81
-rw-r--r--library/vendor/Zend/Validate/StringLength.php263
-rw-r--r--library/vendor/Zend/View.php158
-rw-r--r--library/vendor/Zend/View/Abstract.php1186
-rw-r--r--library/vendor/Zend/View/Exception.php50
-rw-r--r--library/vendor/Zend/View/Helper/Abstract.php63
-rw-r--r--library/vendor/Zend/View/Helper/Action.php161
-rw-r--r--library/vendor/Zend/View/Helper/BaseUrl.php114
-rw-r--r--library/vendor/Zend/View/Helper/Cycle.php225
-rw-r--r--library/vendor/Zend/View/Helper/DeclareVars.php94
-rw-r--r--library/vendor/Zend/View/Helper/Doctype.php239
-rw-r--r--library/vendor/Zend/View/Helper/Fieldset.php78
-rw-r--r--library/vendor/Zend/View/Helper/Form.php85
-rw-r--r--library/vendor/Zend/View/Helper/FormButton.php104
-rw-r--r--library/vendor/Zend/View/Helper/FormCheckbox.php163
-rw-r--r--library/vendor/Zend/View/Helper/FormElement.php202
-rw-r--r--library/vendor/Zend/View/Helper/FormErrors.php166
-rw-r--r--library/vendor/Zend/View/Helper/FormFile.php74
-rw-r--r--library/vendor/Zend/View/Helper/FormHidden.php65
-rw-r--r--library/vendor/Zend/View/Helper/FormImage.php94
-rw-r--r--library/vendor/Zend/View/Helper/FormLabel.php71
-rw-r--r--library/vendor/Zend/View/Helper/FormMultiCheckbox.php73
-rw-r--r--library/vendor/Zend/View/Helper/FormNote.php60
-rw-r--r--library/vendor/Zend/View/Helper/FormPassword.php88
-rw-r--r--library/vendor/Zend/View/Helper/FormRadio.php185
-rw-r--r--library/vendor/Zend/View/Helper/FormReset.php81
-rw-r--r--library/vendor/Zend/View/Helper/FormSelect.php199
-rw-r--r--library/vendor/Zend/View/Helper/FormSubmit.php80
-rw-r--r--library/vendor/Zend/View/Helper/FormText.php77
-rw-r--r--library/vendor/Zend/View/Helper/FormTextarea.php103
-rw-r--r--library/vendor/Zend/View/Helper/Gravatar.php361
-rw-r--r--library/vendor/Zend/View/Helper/HeadLink.php471
-rw-r--r--library/vendor/Zend/View/Helper/HeadMeta.php440
-rw-r--r--library/vendor/Zend/View/Helper/HeadScript.php512
-rw-r--r--library/vendor/Zend/View/Helper/HeadStyle.php426
-rw-r--r--library/vendor/Zend/View/Helper/HeadTitle.php218
-rw-r--r--library/vendor/Zend/View/Helper/HtmlElement.php165
-rw-r--r--library/vendor/Zend/View/Helper/HtmlFlash.php59
-rw-r--r--library/vendor/Zend/View/Helper/HtmlList.php88
-rw-r--r--library/vendor/Zend/View/Helper/HtmlObject.php79
-rw-r--r--library/vendor/Zend/View/Helper/HtmlPage.php74
-rw-r--r--library/vendor/Zend/View/Helper/HtmlQuicktime.php81
-rw-r--r--library/vendor/Zend/View/Helper/InlineScript.php60
-rw-r--r--library/vendor/Zend/View/Helper/Interface.php46
-rw-r--r--library/vendor/Zend/View/Helper/Json.php86
-rw-r--r--library/vendor/Zend/View/Helper/Layout.php79
-rw-r--r--library/vendor/Zend/View/Helper/PaginationControl.php142
-rw-r--r--library/vendor/Zend/View/Helper/Partial.php150
-rw-r--r--library/vendor/Zend/View/Helper/Partial/Exception.php38
-rw-r--r--library/vendor/Zend/View/Helper/PartialLoop.php98
-rw-r--r--library/vendor/Zend/View/Helper/Placeholder.php85
-rw-r--r--library/vendor/Zend/View/Helper/Placeholder/Container.php35
-rw-r--r--library/vendor/Zend/View/Helper/Placeholder/Container/Abstract.php384
-rw-r--r--library/vendor/Zend/View/Helper/Placeholder/Container/Exception.php38
-rw-r--r--library/vendor/Zend/View/Helper/Placeholder/Container/Standalone.php322
-rw-r--r--library/vendor/Zend/View/Helper/Placeholder/Registry.php183
-rw-r--r--library/vendor/Zend/View/Helper/Placeholder/Registry/Exception.php38
-rw-r--r--library/vendor/Zend/View/Helper/RenderToPlaceholder.php52
-rw-r--r--library/vendor/Zend/View/Helper/ServerUrl.php148
-rw-r--r--library/vendor/Zend/View/Helper/Translate.php174
-rw-r--r--library/vendor/Zend/View/Helper/Url.php50
-rw-r--r--library/vendor/Zend/View/Interface.php137
-rw-r--r--library/vendor/Zend/View/Stream.php183
-rw-r--r--library/vendor/Zend/Xml/Exception.php35
-rw-r--r--library/vendor/Zend/Xml/Security.php486
589 files changed, 148200 insertions, 0 deletions
diff --git a/library/vendor/Zend/Cache.php b/library/vendor/Zend/Cache.php
new file mode 100644
index 0000000..272cd0b
--- /dev/null
+++ b/library/vendor/Zend/Cache.php
@@ -0,0 +1,245 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @package Zend_Cache
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Cache
+{
+
+ /**
+ * Standard frontends
+ *
+ * @var array
+ */
+ public static $standardFrontends = array('Core', 'Output', 'Class', 'File', 'Function', 'Page');
+
+ /**
+ * Standard backends
+ *
+ * @var array
+ */
+ public static $standardBackends = array('File', 'Sqlite', 'Memcached', 'Libmemcached', 'Apc', 'ZendPlatform',
+ 'Xcache', 'TwoLevels', 'WinCache', 'ZendServer_Disk', 'ZendServer_ShMem');
+
+ /**
+ * Standard backends which implement the ExtendedInterface
+ *
+ * @var array
+ */
+ public static $standardExtendedBackends = array('File', 'Apc', 'TwoLevels', 'Memcached', 'Libmemcached', 'Sqlite', 'WinCache');
+
+ /**
+ * Only for backward compatibility (may be removed in next major release)
+ *
+ * @var array
+ * @deprecated
+ */
+ public static $availableFrontends = array('Core', 'Output', 'Class', 'File', 'Function', 'Page');
+
+ /**
+ * Only for backward compatibility (may be removed in next major release)
+ *
+ * @var array
+ * @deprecated
+ */
+ public static $availableBackends = array('File', 'Sqlite', 'Memcached', 'Libmemcached', 'Apc', 'ZendPlatform', 'Xcache', 'WinCache', 'TwoLevels');
+
+ /**
+ * Consts for clean() method
+ */
+ const CLEANING_MODE_ALL = 'all';
+ const CLEANING_MODE_OLD = 'old';
+ const CLEANING_MODE_MATCHING_TAG = 'matchingTag';
+ const CLEANING_MODE_NOT_MATCHING_TAG = 'notMatchingTag';
+ const CLEANING_MODE_MATCHING_ANY_TAG = 'matchingAnyTag';
+
+ /**
+ * Factory
+ *
+ * @param mixed $frontend frontend name (string) or Zend_Cache_Frontend_ object
+ * @param mixed $backend backend name (string) or Zend_Cache_Backend_ object
+ * @param array $frontendOptions associative array of options for the corresponding frontend constructor
+ * @param array $backendOptions associative array of options for the corresponding backend constructor
+ * @param boolean $customFrontendNaming if true, the frontend argument is used as a complete class name ; if false, the frontend argument is used as the end of "Zend_Cache_Frontend_[...]" class name
+ * @param boolean $customBackendNaming if true, the backend argument is used as a complete class name ; if false, the backend argument is used as the end of "Zend_Cache_Backend_[...]" class name
+ * @param boolean $autoload if true, there will no require_once for backend and frontend (useful only for custom backends/frontends)
+ * @throws Zend_Cache_Exception
+ * @return Zend_Cache_Core|Zend_Cache_Frontend
+ */
+ public static function factory($frontend, $backend, $frontendOptions = array(), $backendOptions = array(), $customFrontendNaming = false, $customBackendNaming = false, $autoload = false)
+ {
+ if (is_string($backend)) {
+ $backendObject = self::_makeBackend($backend, $backendOptions, $customBackendNaming, $autoload);
+ } else {
+ if ((is_object($backend)) && (in_array('Zend_Cache_Backend_Interface', class_implements($backend)))) {
+ $backendObject = $backend;
+ } else {
+ self::throwException('backend must be a backend name (string) or an object which implements Zend_Cache_Backend_Interface');
+ }
+ }
+ if (is_string($frontend)) {
+ $frontendObject = self::_makeFrontend($frontend, $frontendOptions, $customFrontendNaming, $autoload);
+ } else {
+ if (is_object($frontend)) {
+ $frontendObject = $frontend;
+ } else {
+ self::throwException('frontend must be a frontend name (string) or an object');
+ }
+ }
+ $frontendObject->setBackend($backendObject);
+ return $frontendObject;
+ }
+
+ /**
+ * Backend Constructor
+ *
+ * @param string $backend
+ * @param array $backendOptions
+ * @param boolean $customBackendNaming
+ * @param boolean $autoload
+ * @return Zend_Cache_Backend
+ */
+ public static function _makeBackend($backend, $backendOptions, $customBackendNaming = false, $autoload = false)
+ {
+ if (!$customBackendNaming) {
+ $backend = self::_normalizeName($backend);
+ }
+ if (in_array($backend, Zend_Cache::$standardBackends)) {
+ // we use a standard backend
+ $backendClass = 'Zend_Cache_Backend_' . $backend;
+ // security controls are explicit
+ } else {
+ // we use a custom backend
+ if (!preg_match('~^[\w\\\\]+$~D', $backend)) {
+ Zend_Cache::throwException("Invalid backend name [$backend]");
+ }
+ if (!$customBackendNaming) {
+ // we use this boolean to avoid an API break
+ $backendClass = 'Zend_Cache_Backend_' . $backend;
+ } else {
+ $backendClass = $backend;
+ }
+ if (!$autoload) {
+ $file = str_replace('_', DIRECTORY_SEPARATOR, $backendClass) . '.php';
+ if (!(self::_isReadable($file))) {
+ self::throwException("file $file not found in include_path");
+ }
+ }
+ }
+ return new $backendClass($backendOptions);
+ }
+
+ /**
+ * Frontend Constructor
+ *
+ * @param string $frontend
+ * @param array $frontendOptions
+ * @param boolean $customFrontendNaming
+ * @param boolean $autoload
+ * @return Zend_Cache_Core|Zend_Cache_Frontend
+ */
+ public static function _makeFrontend($frontend, $frontendOptions = array(), $customFrontendNaming = false, $autoload = false)
+ {
+ if (!$customFrontendNaming) {
+ $frontend = self::_normalizeName($frontend);
+ }
+ if (in_array($frontend, self::$standardFrontends)) {
+ // we use a standard frontend
+ // For perfs reasons, with frontend == 'Core', we can interact with the Core itself
+ $frontendClass = 'Zend_Cache_' . ($frontend != 'Core' ? 'Frontend_' : '') . $frontend;
+ // security controls are explicit
+ } else {
+ // we use a custom frontend
+ if (!preg_match('~^[\w\\\\]+$~D', $frontend)) {
+ Zend_Cache::throwException("Invalid frontend name [$frontend]");
+ }
+ if (!$customFrontendNaming) {
+ // we use this boolean to avoid an API break
+ $frontendClass = 'Zend_Cache_Frontend_' . $frontend;
+ } else {
+ $frontendClass = $frontend;
+ }
+ if (!$autoload) {
+ $file = str_replace('_', DIRECTORY_SEPARATOR, $frontendClass) . '.php';
+ if (!(self::_isReadable($file))) {
+ self::throwException("file $file not found in include_path");
+ }
+ }
+ }
+ return new $frontendClass($frontendOptions);
+ }
+
+ /**
+ * Throw an exception
+ *
+ * Note : for perf reasons, the "load" of Zend/Cache/Exception is dynamic
+ * @param string $msg Message for the exception
+ * @throws Zend_Cache_Exception
+ */
+ public static function throwException($msg, Exception $e = null)
+ {
+ // For perfs reasons, we use this dynamic inclusion
+ throw new Zend_Cache_Exception($msg, 0, $e);
+ }
+
+ /**
+ * Normalize frontend and backend names to allow multiple words TitleCased
+ *
+ * @param string $name Name to normalize
+ * @return string
+ */
+ protected static function _normalizeName($name)
+ {
+ $name = ucfirst(strtolower($name));
+ $name = str_replace(array('-', '_', '.'), ' ', $name);
+ $name = ucwords($name);
+ $name = str_replace(' ', '', $name);
+ if (stripos($name, 'ZendServer') === 0) {
+ $name = 'ZendServer_' . substr($name, strlen('ZendServer'));
+ }
+
+ return $name;
+ }
+
+ /**
+ * Returns TRUE if the $filename is readable, or FALSE otherwise.
+ * This function uses the PHP include_path, where PHP's is_readable()
+ * does not.
+ *
+ * Note : this method comes from Zend_Loader (see #ZF-2891 for details)
+ *
+ * @param string $filename
+ * @return boolean
+ */
+ private static function _isReadable($filename)
+ {
+ if (!$fh = @fopen($filename, 'r', true)) {
+ return false;
+ }
+ @fclose($fh);
+ return true;
+ }
+
+}
diff --git a/library/vendor/Zend/Cache/Backend.php b/library/vendor/Zend/Cache/Backend.php
new file mode 100644
index 0000000..6e1efde
--- /dev/null
+++ b/library/vendor/Zend/Cache/Backend.php
@@ -0,0 +1,285 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Backend
+{
+ /**
+ * Frontend or Core directives
+ *
+ * =====> (int) lifetime :
+ * - Cache lifetime (in seconds)
+ * - If null, the cache is valid forever
+ *
+ * =====> (int) logging :
+ * - if set to true, a logging is activated throw Zend_Log
+ *
+ * @var array directives
+ */
+ protected $_directives = array(
+ 'lifetime' => 3600,
+ 'logging' => false,
+ 'logger' => null
+ );
+
+ /**
+ * Available options
+ *
+ * @var array available options
+ */
+ protected $_options = array();
+
+ /**
+ * Constructor
+ *
+ * @param array $options Associative array of options
+ */
+ public function __construct(array $options = array())
+ {
+ foreach ($options as $name => $value) {
+ $this->setOption($name, $value);
+ }
+ }
+
+ /**
+ * Set the frontend directives
+ *
+ * @param array $directives Assoc of directives
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ public function setDirectives($directives)
+ {
+ if (!is_array($directives)) Zend_Cache::throwException('Directives parameter must be an array');
+ while (list($name, $value) = each($directives)) {
+ if (!is_string($name)) {
+ Zend_Cache::throwException("Incorrect option name : $name");
+ }
+ $name = strtolower($name);
+ if (array_key_exists($name, $this->_directives)) {
+ $this->_directives[$name] = $value;
+ }
+
+ }
+
+ $this->_loggerSanity();
+ }
+
+ /**
+ * Set an option
+ *
+ * @param string $name
+ * @param mixed $value
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ public function setOption($name, $value)
+ {
+ if (!is_string($name)) {
+ Zend_Cache::throwException("Incorrect option name : $name");
+ }
+ $name = strtolower($name);
+ if (array_key_exists($name, $this->_options)) {
+ $this->_options[$name] = $value;
+ }
+ }
+
+ /**
+ * Returns an option
+ *
+ * @param string $name Optional, the options name to return
+ * @throws Zend_Cache_Exceptions
+ * @return mixed
+ */
+ public function getOption($name)
+ {
+ $name = strtolower($name);
+
+ if (array_key_exists($name, $this->_options)) {
+ return $this->_options[$name];
+ }
+
+ if (array_key_exists($name, $this->_directives)) {
+ return $this->_directives[$name];
+ }
+
+ Zend_Cache::throwException("Incorrect option name : {$name}");
+ }
+
+ /**
+ * Get the life time
+ *
+ * if $specificLifetime is not false, the given specific life time is used
+ * else, the global lifetime is used
+ *
+ * @param int $specificLifetime
+ * @return int Cache life time
+ */
+ public function getLifetime($specificLifetime)
+ {
+ if ($specificLifetime === false) {
+ return $this->_directives['lifetime'];
+ }
+ return $specificLifetime;
+ }
+
+ /**
+ * Return true if the automatic cleaning is available for the backend
+ *
+ * DEPRECATED : use getCapabilities() instead
+ *
+ * @deprecated
+ * @return boolean
+ */
+ public function isAutomaticCleaningAvailable()
+ {
+ return true;
+ }
+
+ /**
+ * Determine system TMP directory and detect if we have read access
+ *
+ * inspired from Zend_File_Transfer_Adapter_Abstract
+ *
+ * @return string
+ * @throws Zend_Cache_Exception if unable to determine directory
+ */
+ public function getTmpDir()
+ {
+ $tmpdir = array();
+ foreach (array($_ENV, $_SERVER) as $tab) {
+ foreach (array('TMPDIR', 'TEMP', 'TMP', 'windir', 'SystemRoot') as $key) {
+ if (isset($tab[$key]) && is_string($tab[$key])) {
+ if (($key == 'windir') or ($key == 'SystemRoot')) {
+ $dir = realpath($tab[$key] . '\\temp');
+ } else {
+ $dir = realpath($tab[$key]);
+ }
+ if ($this->_isGoodTmpDir($dir)) {
+ return $dir;
+ }
+ }
+ }
+ }
+ $upload = ini_get('upload_tmp_dir');
+ if ($upload) {
+ $dir = realpath($upload);
+ if ($this->_isGoodTmpDir($dir)) {
+ return $dir;
+ }
+ }
+ if (function_exists('sys_get_temp_dir')) {
+ $dir = sys_get_temp_dir();
+ if ($this->_isGoodTmpDir($dir)) {
+ return $dir;
+ }
+ }
+ // Attemp to detect by creating a temporary file
+ $tempFile = tempnam(md5(uniqid(rand(), TRUE)), '');
+ if ($tempFile) {
+ $dir = realpath(dirname($tempFile));
+ unlink($tempFile);
+ if ($this->_isGoodTmpDir($dir)) {
+ return $dir;
+ }
+ }
+ if ($this->_isGoodTmpDir('/tmp')) {
+ return '/tmp';
+ }
+ if ($this->_isGoodTmpDir('\\temp')) {
+ return '\\temp';
+ }
+ Zend_Cache::throwException('Could not determine temp directory, please specify a cache_dir manually');
+ }
+
+ /**
+ * Verify if the given temporary directory is readable and writable
+ *
+ * @param string $dir temporary directory
+ * @return boolean true if the directory is ok
+ */
+ protected function _isGoodTmpDir($dir)
+ {
+ if (is_readable($dir)) {
+ if (is_writable($dir)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Make sure if we enable logging that the Zend_Log class
+ * is available.
+ * Create a default log object if none is set.
+ *
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ protected function _loggerSanity()
+ {
+ if (!isset($this->_directives['logging']) || !$this->_directives['logging']) {
+ return;
+ }
+
+ if (isset($this->_directives['logger'])) {
+ if ($this->_directives['logger'] instanceof Zend_Log) {
+ return;
+ }
+ Zend_Cache::throwException('Logger object is not an instance of Zend_Log class.');
+ }
+
+ // Create a default logger to the standard output stream
+ $logger = new Zend_Log(new Zend_Log_Writer_Stream('php://output'));
+ $logger->addFilter(new Zend_Log_Filter_Priority(Zend_Log::WARN, '<='));
+ $this->_directives['logger'] = $logger;
+ }
+
+ /**
+ * Log a message at the WARN (4) priority.
+ *
+ * @param string $message
+ * @param int $priority
+ * @return void
+ */
+ protected function _log($message, $priority = 4)
+ {
+ if (!$this->_directives['logging']) {
+ return;
+ }
+
+ if (!isset($this->_directives['logger'])) {
+ Zend_Cache::throwException('Logging is enabled but logger is not set.');
+ }
+ $logger = $this->_directives['logger'];
+ if (!$logger instanceof Zend_Log) {
+ Zend_Cache::throwException('Logger object is not an instance of Zend_Log class.');
+ }
+ $logger->log($message, $priority);
+ }
+}
diff --git a/library/vendor/Zend/Cache/Backend/Apc.php b/library/vendor/Zend/Cache/Backend/Apc.php
new file mode 100644
index 0000000..9605323
--- /dev/null
+++ b/library/vendor/Zend/Cache/Backend/Apc.php
@@ -0,0 +1,353 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Cache_Backend_Interface
+ */
+
+/**
+ * @see Zend_Cache_Backend
+ */
+
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Backend_Apc extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface
+{
+ /**
+ * Log message
+ */
+ const TAGS_UNSUPPORTED_BY_CLEAN_OF_APC_BACKEND = 'Zend_Cache_Backend_Apc::clean() : tags are unsupported by the Apc backend';
+ const TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND = 'Zend_Cache_Backend_Apc::save() : tags are unsupported by the Apc backend';
+
+ /**
+ * Constructor
+ *
+ * @param array $options associative array of options
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ public function __construct(array $options = array())
+ {
+ if (!extension_loaded('apc')) {
+ Zend_Cache::throwException('The apc extension must be loaded for using this backend !');
+ }
+ parent::__construct($options);
+ }
+
+ /**
+ * Test if a cache is available for the given id and (if yes) return it (false else)
+ *
+ * WARNING $doNotTestCacheValidity=true is unsupported by the Apc backend
+ *
+ * @param string $id cache id
+ * @param boolean $doNotTestCacheValidity if set to true, the cache validity won't be tested
+ * @return string cached datas (or false)
+ */
+ public function load($id, $doNotTestCacheValidity = false)
+ {
+ $tmp = apc_fetch($id);
+ if (is_array($tmp)) {
+ return $tmp[0];
+ }
+ return false;
+ }
+
+ /**
+ * Test if a cache is available or not (for the given id)
+ *
+ * @param string $id cache id
+ * @return mixed false (a cache is not available) or "last modified" timestamp (int) of the available cache record
+ */
+ public function test($id)
+ {
+ $tmp = apc_fetch($id);
+ if (is_array($tmp)) {
+ return $tmp[1];
+ }
+ return false;
+ }
+
+ /**
+ * Save some string datas into a cache record
+ *
+ * Note : $data is always "string" (serialization is done by the
+ * core not by the backend)
+ *
+ * @param string $data datas to cache
+ * @param string $id cache id
+ * @param array $tags array of strings, the cache record will be tagged by each string entry
+ * @param int $specificLifetime if != false, set a specific lifetime for this cache record (null => infinite lifetime)
+ * @return boolean true if no problem
+ */
+ public function save($data, $id, $tags = array(), $specificLifetime = false)
+ {
+ $lifetime = $this->getLifetime($specificLifetime);
+ $result = apc_store($id, array($data, time(), $lifetime), $lifetime);
+ if (count($tags) > 0) {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND);
+ }
+ return $result;
+ }
+
+ /**
+ * Remove a cache record
+ *
+ * @param string $id cache id
+ * @return boolean true if no problem
+ */
+ public function remove($id)
+ {
+ return apc_delete($id);
+ }
+
+ /**
+ * Clean some cache records
+ *
+ * Available modes are :
+ * 'all' (default) => remove all cache entries ($tags is not used)
+ * 'old' => unsupported
+ * 'matchingTag' => unsupported
+ * 'notMatchingTag' => unsupported
+ * 'matchingAnyTag' => unsupported
+ *
+ * @param string $mode clean mode
+ * @param array $tags array of tags
+ * @throws Zend_Cache_Exception
+ * @return boolean true if no problem
+ */
+ public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
+ {
+ switch ($mode) {
+ case Zend_Cache::CLEANING_MODE_ALL:
+ return apc_clear_cache('user');
+ break;
+ case Zend_Cache::CLEANING_MODE_OLD:
+ $this->_log("Zend_Cache_Backend_Apc::clean() : CLEANING_MODE_OLD is unsupported by the Apc backend");
+ break;
+ case Zend_Cache::CLEANING_MODE_MATCHING_TAG:
+ case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG:
+ case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG:
+ $this->_log(self::TAGS_UNSUPPORTED_BY_CLEAN_OF_APC_BACKEND);
+ break;
+ default:
+ Zend_Cache::throwException('Invalid mode for clean() method');
+ break;
+ }
+ }
+
+ /**
+ * Return true if the automatic cleaning is available for the backend
+ *
+ * DEPRECATED : use getCapabilities() instead
+ *
+ * @deprecated
+ * @return boolean
+ */
+ public function isAutomaticCleaningAvailable()
+ {
+ return false;
+ }
+
+ /**
+ * Return the filling percentage of the backend storage
+ *
+ * @throws Zend_Cache_Exception
+ * @return int integer between 0 and 100
+ */
+ public function getFillingPercentage()
+ {
+ $mem = apc_sma_info(true);
+ $memSize = $mem['num_seg'] * $mem['seg_size'];
+ $memAvailable= $mem['avail_mem'];
+ $memUsed = $memSize - $memAvailable;
+ if ($memSize == 0) {
+ Zend_Cache::throwException('can\'t get apc memory size');
+ }
+ if ($memUsed > $memSize) {
+ return 100;
+ }
+ return ((int) (100. * ($memUsed / $memSize)));
+ }
+
+ /**
+ * Return an array of stored tags
+ *
+ * @return array array of stored tags (string)
+ */
+ public function getTags()
+ {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND);
+ return array();
+ }
+
+ /**
+ * Return an array of stored cache ids which match given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of matching cache ids (string)
+ */
+ public function getIdsMatchingTags($tags = array())
+ {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND);
+ return array();
+ }
+
+ /**
+ * Return an array of stored cache ids which don't match given tags
+ *
+ * In case of multiple tags, a logical OR is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of not matching cache ids (string)
+ */
+ public function getIdsNotMatchingTags($tags = array())
+ {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND);
+ return array();
+ }
+
+ /**
+ * Return an array of stored cache ids which match any given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of any matching cache ids (string)
+ */
+ public function getIdsMatchingAnyTags($tags = array())
+ {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND);
+ return array();
+ }
+
+ /**
+ * Return an array of stored cache ids
+ *
+ * @return array array of stored cache ids (string)
+ */
+ public function getIds()
+ {
+ $ids = array();
+ $iterator = new APCIterator('user', null, APC_ITER_KEY);
+ foreach ($iterator as $item) {
+ $ids[] = $item['key'];
+ }
+
+ return $ids;
+ }
+
+ /**
+ * Return an array of metadatas for the given cache id
+ *
+ * The array must include these keys :
+ * - expire : the expire timestamp
+ * - tags : a string array of tags
+ * - mtime : timestamp of last modification time
+ *
+ * @param string $id cache id
+ * @return array array of metadatas (false if the cache id is not found)
+ */
+ public function getMetadatas($id)
+ {
+ $tmp = apc_fetch($id);
+ if (is_array($tmp)) {
+ $data = $tmp[0];
+ $mtime = $tmp[1];
+ if (!isset($tmp[2])) {
+ // because this record is only with 1.7 release
+ // if old cache records are still there...
+ return false;
+ }
+ $lifetime = $tmp[2];
+ return array(
+ 'expire' => $mtime + $lifetime,
+ 'tags' => array(),
+ 'mtime' => $mtime
+ );
+ }
+ return false;
+ }
+
+ /**
+ * Give (if possible) an extra lifetime to the given cache id
+ *
+ * @param string $id cache id
+ * @param int $extraLifetime
+ * @return boolean true if ok
+ */
+ public function touch($id, $extraLifetime)
+ {
+ $tmp = apc_fetch($id);
+ if (is_array($tmp)) {
+ $data = $tmp[0];
+ $mtime = $tmp[1];
+ if (!isset($tmp[2])) {
+ // because this record is only with 1.7 release
+ // if old cache records are still there...
+ return false;
+ }
+ $lifetime = $tmp[2];
+ $newLifetime = $lifetime - (time() - $mtime) + $extraLifetime;
+ if ($newLifetime <=0) {
+ return false;
+ }
+ apc_store($id, array($data, time(), $newLifetime), $newLifetime);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Return an associative array of capabilities (booleans) of the backend
+ *
+ * The array must include these keys :
+ * - automatic_cleaning (is automating cleaning necessary)
+ * - tags (are tags supported)
+ * - expired_read (is it possible to read expired cache records
+ * (for doNotTestCacheValidity option for example))
+ * - priority does the backend deal with priority when saving
+ * - infinite_lifetime (is infinite lifetime can work with this backend)
+ * - get_list (is it possible to get the list of cache ids and the complete list of tags)
+ *
+ * @return array associative of with capabilities
+ */
+ public function getCapabilities()
+ {
+ return array(
+ 'automatic_cleaning' => false,
+ 'tags' => false,
+ 'expired_read' => false,
+ 'priority' => false,
+ 'infinite_lifetime' => false,
+ 'get_list' => true
+ );
+ }
+
+}
diff --git a/library/vendor/Zend/Cache/Backend/BlackHole.php b/library/vendor/Zend/Cache/Backend/BlackHole.php
new file mode 100644
index 0000000..8732c19
--- /dev/null
+++ b/library/vendor/Zend/Cache/Backend/BlackHole.php
@@ -0,0 +1,248 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Cache_Backend_Interface
+ */
+
+/**
+ * @see Zend_Cache_Backend
+ */
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Backend_BlackHole
+ extends Zend_Cache_Backend
+ implements Zend_Cache_Backend_ExtendedInterface
+{
+ /**
+ * Test if a cache is available for the given id and (if yes) return it (false else)
+ *
+ * @param string $id cache id
+ * @param boolean $doNotTestCacheValidity if set to true, the cache validity won't be tested
+ * @return string|false cached datas
+ */
+ public function load($id, $doNotTestCacheValidity = false)
+ {
+ return false;
+ }
+
+ /**
+ * Test if a cache is available or not (for the given id)
+ *
+ * @param string $id cache id
+ * @return mixed false (a cache is not available) or "last modified" timestamp (int) of the available cache record
+ */
+ public function test($id)
+ {
+ return false;
+ }
+
+ /**
+ * Save some string datas into a cache record
+ *
+ * Note : $data is always "string" (serialization is done by the
+ * core not by the backend)
+ *
+ * @param string $data Datas to cache
+ * @param string $id Cache id
+ * @param array $tags Array of strings, the cache record will be tagged by each string entry
+ * @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
+ * @return boolean true if no problem
+ */
+ public function save($data, $id, $tags = array(), $specificLifetime = false)
+ {
+ return true;
+ }
+
+ /**
+ * Remove a cache record
+ *
+ * @param string $id cache id
+ * @return boolean true if no problem
+ */
+ public function remove($id)
+ {
+ return true;
+ }
+
+ /**
+ * Clean some cache records
+ *
+ * Available modes are :
+ * 'all' (default) => remove all cache entries ($tags is not used)
+ * 'old' => remove too old cache entries ($tags is not used)
+ * 'matchingTag' => remove cache entries matching all given tags
+ * ($tags can be an array of strings or a single string)
+ * 'notMatchingTag' => remove cache entries not matching one of the given tags
+ * ($tags can be an array of strings or a single string)
+ * 'matchingAnyTag' => remove cache entries matching any given tags
+ * ($tags can be an array of strings or a single string)
+ *
+ * @param string $mode clean mode
+ * @param tags array $tags array of tags
+ * @return boolean true if no problem
+ */
+ public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
+ {
+ return true;
+ }
+
+ /**
+ * Return an array of stored cache ids
+ *
+ * @return array array of stored cache ids (string)
+ */
+ public function getIds()
+ {
+ return array();
+ }
+
+ /**
+ * Return an array of stored tags
+ *
+ * @return array array of stored tags (string)
+ */
+ public function getTags()
+ {
+ return array();
+ }
+
+ /**
+ * Return an array of stored cache ids which match given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of matching cache ids (string)
+ */
+ public function getIdsMatchingTags($tags = array())
+ {
+ return array();
+ }
+
+ /**
+ * Return an array of stored cache ids which don't match given tags
+ *
+ * In case of multiple tags, a logical OR is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of not matching cache ids (string)
+ */
+ public function getIdsNotMatchingTags($tags = array())
+ {
+ return array();
+ }
+
+ /**
+ * Return an array of stored cache ids which match any given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of any matching cache ids (string)
+ */
+ public function getIdsMatchingAnyTags($tags = array())
+ {
+ return array();
+ }
+
+ /**
+ * Return the filling percentage of the backend storage
+ *
+ * @return int integer between 0 and 100
+ * @throws Zend_Cache_Exception
+ */
+ public function getFillingPercentage()
+ {
+ return 0;
+ }
+
+ /**
+ * Return an array of metadatas for the given cache id
+ *
+ * The array must include these keys :
+ * - expire : the expire timestamp
+ * - tags : a string array of tags
+ * - mtime : timestamp of last modification time
+ *
+ * @param string $id cache id
+ * @return array array of metadatas (false if the cache id is not found)
+ */
+ public function getMetadatas($id)
+ {
+ return false;
+ }
+
+ /**
+ * Give (if possible) an extra lifetime to the given cache id
+ *
+ * @param string $id cache id
+ * @param int $extraLifetime
+ * @return boolean true if ok
+ */
+ public function touch($id, $extraLifetime)
+ {
+ return false;
+ }
+
+ /**
+ * Return an associative array of capabilities (booleans) of the backend
+ *
+ * The array must include these keys :
+ * - automatic_cleaning (is automating cleaning necessary)
+ * - tags (are tags supported)
+ * - expired_read (is it possible to read expired cache records
+ * (for doNotTestCacheValidity option for example))
+ * - priority does the backend deal with priority when saving
+ * - infinite_lifetime (is infinite lifetime can work with this backend)
+ * - get_list (is it possible to get the list of cache ids and the complete list of tags)
+ *
+ * @return array associative of with capabilities
+ */
+ public function getCapabilities()
+ {
+ return array(
+ 'automatic_cleaning' => true,
+ 'tags' => true,
+ 'expired_read' => true,
+ 'priority' => true,
+ 'infinite_lifetime' => true,
+ 'get_list' => true,
+ );
+ }
+
+ /**
+ * PUBLIC METHOD FOR UNIT TESTING ONLY !
+ *
+ * Force a cache record to expire
+ *
+ * @param string $id cache id
+ */
+ public function ___expire($id)
+ {
+ }
+}
diff --git a/library/vendor/Zend/Cache/Backend/ExtendedInterface.php b/library/vendor/Zend/Cache/Backend/ExtendedInterface.php
new file mode 100644
index 0000000..2f0f526
--- /dev/null
+++ b/library/vendor/Zend/Cache/Backend/ExtendedInterface.php
@@ -0,0 +1,125 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Cache_Backend_Interface
+ */
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Cache_Backend_ExtendedInterface extends Zend_Cache_Backend_Interface
+{
+
+ /**
+ * Return an array of stored cache ids
+ *
+ * @return array array of stored cache ids (string)
+ */
+ public function getIds();
+
+ /**
+ * Return an array of stored tags
+ *
+ * @return array array of stored tags (string)
+ */
+ public function getTags();
+
+ /**
+ * Return an array of stored cache ids which match given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of matching cache ids (string)
+ */
+ public function getIdsMatchingTags($tags = array());
+
+ /**
+ * Return an array of stored cache ids which don't match given tags
+ *
+ * In case of multiple tags, a logical OR is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of not matching cache ids (string)
+ */
+ public function getIdsNotMatchingTags($tags = array());
+
+ /**
+ * Return an array of stored cache ids which match any given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of any matching cache ids (string)
+ */
+ public function getIdsMatchingAnyTags($tags = array());
+
+ /**
+ * Return the filling percentage of the backend storage
+ *
+ * @return int integer between 0 and 100
+ */
+ public function getFillingPercentage();
+
+ /**
+ * Return an array of metadatas for the given cache id
+ *
+ * The array must include these keys :
+ * - expire : the expire timestamp
+ * - tags : a string array of tags
+ * - mtime : timestamp of last modification time
+ *
+ * @param string $id cache id
+ * @return array array of metadatas (false if the cache id is not found)
+ */
+ public function getMetadatas($id);
+
+ /**
+ * Give (if possible) an extra lifetime to the given cache id
+ *
+ * @param string $id cache id
+ * @param int $extraLifetime
+ * @return boolean true if ok
+ */
+ public function touch($id, $extraLifetime);
+
+ /**
+ * Return an associative array of capabilities (booleans) of the backend
+ *
+ * The array must include these keys :
+ * - automatic_cleaning (is automating cleaning necessary)
+ * - tags (are tags supported)
+ * - expired_read (is it possible to read expired cache records
+ * (for doNotTestCacheValidity option for example))
+ * - priority does the backend deal with priority when saving
+ * - infinite_lifetime (is infinite lifetime can work with this backend)
+ * - get_list (is it possible to get the list of cache ids and the complete list of tags)
+ *
+ * @return array associative of with capabilities
+ */
+ public function getCapabilities();
+
+}
diff --git a/library/vendor/Zend/Cache/Backend/File.php b/library/vendor/Zend/Cache/Backend/File.php
new file mode 100644
index 0000000..0fe5475
--- /dev/null
+++ b/library/vendor/Zend/Cache/Backend/File.php
@@ -0,0 +1,1035 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Cache_Backend_Interface
+ */
+
+/**
+ * @see Zend_Cache_Backend
+ */
+
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface
+{
+ /**
+ * Available options
+ *
+ * =====> (string) cache_dir :
+ * - Directory where to put the cache files
+ *
+ * =====> (boolean) file_locking :
+ * - Enable / disable file_locking
+ * - Can avoid cache corruption under bad circumstances but it doesn't work on multithread
+ * webservers and on NFS filesystems for example
+ *
+ * =====> (boolean) read_control :
+ * - Enable / disable read control
+ * - If enabled, a control key is embeded in cache file and this key is compared with the one
+ * calculated after the reading.
+ *
+ * =====> (string) read_control_type :
+ * - Type of read control (only if read control is enabled). Available values are :
+ * 'md5' for a md5 hash control (best but slowest)
+ * 'crc32' for a crc32 hash control (lightly less safe but faster, better choice)
+ * 'adler32' for an adler32 hash control (excellent choice too, faster than crc32)
+ * 'strlen' for a length only test (fastest)
+ *
+ * =====> (int) hashed_directory_level :
+ * - Hashed directory level
+ * - Set the hashed directory structure level. 0 means "no hashed directory
+ * structure", 1 means "one level of directory", 2 means "two levels"...
+ * This option can speed up the cache only when you have many thousands of
+ * cache file. Only specific benchs can help you to choose the perfect value
+ * for you. Maybe, 1 or 2 is a good start.
+ *
+ * =====> (int) hashed_directory_umask :
+ * - deprecated
+ * - Permissions for hashed directory structure
+ *
+ * =====> (int) hashed_directory_perm :
+ * - Permissions for hashed directory structure
+ *
+ * =====> (string) file_name_prefix :
+ * - prefix for cache files
+ * - be really carefull with this option because a too generic value in a system cache dir
+ * (like /tmp) can cause disasters when cleaning the cache
+ *
+ * =====> (int) cache_file_umask :
+ * - deprecated
+ * - Permissions for cache files
+ *
+ * =====> (int) cache_file_perm :
+ * - Permissions for cache files
+ *
+ * =====> (int) metatadatas_array_max_size :
+ * - max size for the metadatas array (don't change this value unless you
+ * know what you are doing)
+ *
+ * @var array available options
+ */
+ protected $_options = array(
+ 'cache_dir' => null,
+ 'file_locking' => true,
+ 'read_control' => true,
+ 'read_control_type' => 'crc32',
+ 'hashed_directory_level' => 0,
+ 'hashed_directory_perm' => 0700,
+ 'file_name_prefix' => 'zend_cache',
+ 'cache_file_perm' => 0600,
+ 'metadatas_array_max_size' => 100
+ );
+
+ /**
+ * Array of metadatas (each item is an associative array)
+ *
+ * @var array
+ */
+ protected $_metadatasArray = array();
+
+
+ /**
+ * Constructor
+ *
+ * @param array $options associative array of options
+ * @throws Zend_Cache_Exception
+ */
+ public function __construct(array $options = array())
+ {
+ parent::__construct($options);
+ if ($this->_options['cache_dir'] !== null) { // particular case for this option
+ $this->setCacheDir($this->_options['cache_dir']);
+ } else {
+ $this->setCacheDir(self::getTmpDir() . DIRECTORY_SEPARATOR, false);
+ }
+ if (isset($this->_options['file_name_prefix'])) { // particular case for this option
+ if (!preg_match('~^[a-zA-Z0-9_]+$~D', $this->_options['file_name_prefix'])) {
+ Zend_Cache::throwException('Invalid file_name_prefix : must use only [a-zA-Z0-9_]');
+ }
+ }
+ if ($this->_options['metadatas_array_max_size'] < 10) {
+ Zend_Cache::throwException('Invalid metadatas_array_max_size, must be > 10');
+ }
+
+ if (isset($options['hashed_directory_umask'])) {
+ // See #ZF-12047
+ trigger_error("'hashed_directory_umask' is deprecated -> please use 'hashed_directory_perm' instead", E_USER_NOTICE);
+ if (!isset($options['hashed_directory_perm'])) {
+ $options['hashed_directory_perm'] = $options['hashed_directory_umask'];
+ }
+ }
+ if (isset($options['hashed_directory_perm']) && is_string($options['hashed_directory_perm'])) {
+ // See #ZF-4422
+ $this->_options['hashed_directory_perm'] = octdec($this->_options['hashed_directory_perm']);
+ }
+
+ if (isset($options['cache_file_umask'])) {
+ // See #ZF-12047
+ trigger_error("'cache_file_umask' is deprecated -> please use 'cache_file_perm' instead", E_USER_NOTICE);
+ if (!isset($options['cache_file_perm'])) {
+ $options['cache_file_perm'] = $options['cache_file_umask'];
+ }
+ }
+ if (isset($options['cache_file_perm']) && is_string($options['cache_file_perm'])) {
+ // See #ZF-4422
+ $this->_options['cache_file_perm'] = octdec($this->_options['cache_file_perm']);
+ }
+ }
+
+ /**
+ * Set the cache_dir (particular case of setOption() method)
+ *
+ * @param string $value
+ * @param boolean $trailingSeparator If true, add a trailing separator is necessary
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ public function setCacheDir($value, $trailingSeparator = true)
+ {
+ if (!is_dir($value)) {
+ Zend_Cache::throwException(sprintf('cache_dir "%s" must be a directory', $value));
+ }
+ if (!is_writable($value)) {
+ Zend_Cache::throwException(sprintf('cache_dir "%s" is not writable', $value));
+ }
+ if ($trailingSeparator) {
+ // add a trailing DIRECTORY_SEPARATOR if necessary
+ $value = rtrim(realpath($value), '\\/') . DIRECTORY_SEPARATOR;
+ }
+ $this->_options['cache_dir'] = $value;
+ }
+
+ /**
+ * Test if a cache is available for the given id and (if yes) return it (false else)
+ *
+ * @param string $id cache id
+ * @param boolean $doNotTestCacheValidity if set to true, the cache validity won't be tested
+ * @return string|false cached datas
+ */
+ public function load($id, $doNotTestCacheValidity = false)
+ {
+ if (!($this->_test($id, $doNotTestCacheValidity))) {
+ // The cache is not hit !
+ return false;
+ }
+ $metadatas = $this->_getMetadatas($id);
+ $file = $this->_file($id);
+ $data = $this->_fileGetContents($file);
+ if ($this->_options['read_control']) {
+ $hashData = $this->_hash($data, $this->_options['read_control_type']);
+ $hashControl = $metadatas['hash'];
+ if ($hashData != $hashControl) {
+ // Problem detected by the read control !
+ $this->_log('Zend_Cache_Backend_File::load() / read_control : stored hash and computed hash do not match');
+ $this->remove($id);
+ return false;
+ }
+ }
+ return $data;
+ }
+
+ /**
+ * Test if a cache is available or not (for the given id)
+ *
+ * @param string $id cache id
+ * @return mixed false (a cache is not available) or "last modified" timestamp (int) of the available cache record
+ */
+ public function test($id)
+ {
+ clearstatcache();
+ return $this->_test($id, false);
+ }
+
+ /**
+ * Save some string datas into a cache record
+ *
+ * Note : $data is always "string" (serialization is done by the
+ * core not by the backend)
+ *
+ * @param string $data Datas to cache
+ * @param string $id Cache id
+ * @param array $tags Array of strings, the cache record will be tagged by each string entry
+ * @param boolean|int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
+ * @return boolean true if no problem
+ */
+ public function save($data, $id, $tags = array(), $specificLifetime = false)
+ {
+ clearstatcache();
+ $file = $this->_file($id);
+ $path = $this->_path($id);
+ if ($this->_options['hashed_directory_level'] > 0) {
+ if (!is_writable($path)) {
+ // maybe, we just have to build the directory structure
+ $this->_recursiveMkdirAndChmod($id);
+ }
+ if (!is_writable($path)) {
+ return false;
+ }
+ }
+ if ($this->_options['read_control']) {
+ $hash = $this->_hash($data, $this->_options['read_control_type']);
+ } else {
+ $hash = '';
+ }
+ $metadatas = array(
+ 'hash' => $hash,
+ 'mtime' => time(),
+ 'expire' => $this->_expireTime($this->getLifetime($specificLifetime)),
+ 'tags' => $tags
+ );
+ $res = $this->_setMetadatas($id, $metadatas);
+ if (!$res) {
+ $this->_log('Zend_Cache_Backend_File::save() / error on saving metadata');
+ return false;
+ }
+ $res = $this->_filePutContents($file, $data);
+ return $res;
+ }
+
+ /**
+ * Remove a cache record
+ *
+ * @param string $id cache id
+ * @return boolean true if no problem
+ */
+ public function remove($id)
+ {
+ $file = $this->_file($id);
+ $boolRemove = $this->_remove($file);
+ $boolMetadata = $this->_delMetadatas($id);
+ return $boolMetadata && $boolRemove;
+ }
+
+ /**
+ * Clean some cache records
+ *
+ * Available modes are :
+ *
+ * Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)
+ * Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used)
+ * Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags
+ * ($tags can be an array of strings or a single string)
+ * Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags}
+ * ($tags can be an array of strings or a single string)
+ * Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags
+ * ($tags can be an array of strings or a single string)
+ *
+ * @param string $mode clean mode
+ * @param array $tags array of tags
+ * @return boolean true if no problem
+ */
+ public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
+ {
+ // We use this protected method to hide the recursive stuff
+ clearstatcache();
+ return $this->_clean($this->_options['cache_dir'], $mode, $tags);
+ }
+
+ /**
+ * Return an array of stored cache ids
+ *
+ * @return array array of stored cache ids (string)
+ */
+ public function getIds()
+ {
+ return $this->_get($this->_options['cache_dir'], 'ids', array());
+ }
+
+ /**
+ * Return an array of stored tags
+ *
+ * @return array array of stored tags (string)
+ */
+ public function getTags()
+ {
+ return $this->_get($this->_options['cache_dir'], 'tags', array());
+ }
+
+ /**
+ * Return an array of stored cache ids which match given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of matching cache ids (string)
+ */
+ public function getIdsMatchingTags($tags = array())
+ {
+ return $this->_get($this->_options['cache_dir'], 'matching', $tags);
+ }
+
+ /**
+ * Return an array of stored cache ids which don't match given tags
+ *
+ * In case of multiple tags, a logical OR is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of not matching cache ids (string)
+ */
+ public function getIdsNotMatchingTags($tags = array())
+ {
+ return $this->_get($this->_options['cache_dir'], 'notMatching', $tags);
+ }
+
+ /**
+ * Return an array of stored cache ids which match any given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of any matching cache ids (string)
+ */
+ public function getIdsMatchingAnyTags($tags = array())
+ {
+ return $this->_get($this->_options['cache_dir'], 'matchingAny', $tags);
+ }
+
+ /**
+ * Return the filling percentage of the backend storage
+ *
+ * @throws Zend_Cache_Exception
+ * @return int integer between 0 and 100
+ */
+ public function getFillingPercentage()
+ {
+ $free = disk_free_space($this->_options['cache_dir']);
+ $total = disk_total_space($this->_options['cache_dir']);
+ if ($total == 0) {
+ Zend_Cache::throwException('can\'t get disk_total_space');
+ } else {
+ if ($free >= $total) {
+ return 100;
+ }
+ return ((int) (100. * ($total - $free) / $total));
+ }
+ }
+
+ /**
+ * Return an array of metadatas for the given cache id
+ *
+ * The array must include these keys :
+ * - expire : the expire timestamp
+ * - tags : a string array of tags
+ * - mtime : timestamp of last modification time
+ *
+ * @param string $id cache id
+ * @return array array of metadatas (false if the cache id is not found)
+ */
+ public function getMetadatas($id)
+ {
+ $metadatas = $this->_getMetadatas($id);
+ if (!$metadatas) {
+ return false;
+ }
+ if (time() > $metadatas['expire']) {
+ return false;
+ }
+ return array(
+ 'expire' => $metadatas['expire'],
+ 'tags' => $metadatas['tags'],
+ 'mtime' => $metadatas['mtime']
+ );
+ }
+
+ /**
+ * Give (if possible) an extra lifetime to the given cache id
+ *
+ * @param string $id cache id
+ * @param int $extraLifetime
+ * @return boolean true if ok
+ */
+ public function touch($id, $extraLifetime)
+ {
+ $metadatas = $this->_getMetadatas($id);
+ if (!$metadatas) {
+ return false;
+ }
+ if (time() > $metadatas['expire']) {
+ return false;
+ }
+ $newMetadatas = array(
+ 'hash' => $metadatas['hash'],
+ 'mtime' => time(),
+ 'expire' => $metadatas['expire'] + $extraLifetime,
+ 'tags' => $metadatas['tags']
+ );
+ $res = $this->_setMetadatas($id, $newMetadatas);
+ if (!$res) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Return an associative array of capabilities (booleans) of the backend
+ *
+ * The array must include these keys :
+ * - automatic_cleaning (is automating cleaning necessary)
+ * - tags (are tags supported)
+ * - expired_read (is it possible to read expired cache records
+ * (for doNotTestCacheValidity option for example))
+ * - priority does the backend deal with priority when saving
+ * - infinite_lifetime (is infinite lifetime can work with this backend)
+ * - get_list (is it possible to get the list of cache ids and the complete list of tags)
+ *
+ * @return array associative of with capabilities
+ */
+ public function getCapabilities()
+ {
+ return array(
+ 'automatic_cleaning' => true,
+ 'tags' => true,
+ 'expired_read' => true,
+ 'priority' => false,
+ 'infinite_lifetime' => true,
+ 'get_list' => true
+ );
+ }
+
+ /**
+ * PUBLIC METHOD FOR UNIT TESTING ONLY !
+ *
+ * Force a cache record to expire
+ *
+ * @param string $id cache id
+ */
+ public function ___expire($id)
+ {
+ $metadatas = $this->_getMetadatas($id);
+ if ($metadatas) {
+ $metadatas['expire'] = 1;
+ $this->_setMetadatas($id, $metadatas);
+ }
+ }
+
+ /**
+ * Get a metadatas record
+ *
+ * @param string $id Cache id
+ * @return array|false Associative array of metadatas
+ */
+ protected function _getMetadatas($id)
+ {
+ if (isset($this->_metadatasArray[$id])) {
+ return $this->_metadatasArray[$id];
+ } else {
+ $metadatas = $this->_loadMetadatas($id);
+ if (!$metadatas) {
+ return false;
+ }
+ $this->_setMetadatas($id, $metadatas, false);
+ return $metadatas;
+ }
+ }
+
+ /**
+ * Set a metadatas record
+ *
+ * @param string $id Cache id
+ * @param array $metadatas Associative array of metadatas
+ * @param boolean $save optional pass false to disable saving to file
+ * @return boolean True if no problem
+ */
+ protected function _setMetadatas($id, $metadatas, $save = true)
+ {
+ if (count($this->_metadatasArray) >= $this->_options['metadatas_array_max_size']) {
+ $n = (int) ($this->_options['metadatas_array_max_size'] / 10);
+ $this->_metadatasArray = array_slice($this->_metadatasArray, $n);
+ }
+ if ($save) {
+ $result = $this->_saveMetadatas($id, $metadatas);
+ if (!$result) {
+ return false;
+ }
+ }
+ $this->_metadatasArray[$id] = $metadatas;
+ return true;
+ }
+
+ /**
+ * Drop a metadata record
+ *
+ * @param string $id Cache id
+ * @return boolean True if no problem
+ */
+ protected function _delMetadatas($id)
+ {
+ if (isset($this->_metadatasArray[$id])) {
+ unset($this->_metadatasArray[$id]);
+ }
+ $file = $this->_metadatasFile($id);
+ return $this->_remove($file);
+ }
+
+ /**
+ * Clear the metadatas array
+ *
+ * @return void
+ */
+ protected function _cleanMetadatas()
+ {
+ $this->_metadatasArray = array();
+ }
+
+ /**
+ * Load metadatas from disk
+ *
+ * @param string $id Cache id
+ * @return array|false Metadatas associative array
+ */
+ protected function _loadMetadatas($id)
+ {
+ $file = $this->_metadatasFile($id);
+ $result = $this->_fileGetContents($file);
+ if (!$result) {
+ return false;
+ }
+ $tmp = @unserialize($result);
+ return $tmp;
+ }
+
+ /**
+ * Save metadatas to disk
+ *
+ * @param string $id Cache id
+ * @param array $metadatas Associative array
+ * @return boolean True if no problem
+ */
+ protected function _saveMetadatas($id, $metadatas)
+ {
+ $file = $this->_metadatasFile($id);
+ $result = $this->_filePutContents($file, serialize($metadatas));
+ if (!$result) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Make and return a file name (with path) for metadatas
+ *
+ * @param string $id Cache id
+ * @return string Metadatas file name (with path)
+ */
+ protected function _metadatasFile($id)
+ {
+ $path = $this->_path($id);
+ $fileName = $this->_idToFileName('internal-metadatas---' . $id);
+ return $path . $fileName;
+ }
+
+ /**
+ * Check if the given filename is a metadatas one
+ *
+ * @param string $fileName File name
+ * @return boolean True if it's a metadatas one
+ */
+ protected function _isMetadatasFile($fileName)
+ {
+ $id = $this->_fileNameToId($fileName);
+ if (substr($id, 0, 21) == 'internal-metadatas---') {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Remove a file
+ *
+ * If we can't remove the file (because of locks or any problem), we will touch
+ * the file to invalidate it
+ *
+ * @param string $file Complete file path
+ * @return boolean True if ok
+ */
+ protected function _remove($file)
+ {
+ if (!is_file($file)) {
+ return false;
+ }
+ if (!@unlink($file)) {
+ # we can't remove the file (because of locks or any problem)
+ $this->_log("Zend_Cache_Backend_File::_remove() : we can't remove $file");
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Clean some cache records (protected method used for recursive stuff)
+ *
+ * Available modes are :
+ * Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)
+ * Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used)
+ * Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags
+ * ($tags can be an array of strings or a single string)
+ * Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags}
+ * ($tags can be an array of strings or a single string)
+ * Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags
+ * ($tags can be an array of strings or a single string)
+ *
+ * @param string $dir Directory to clean
+ * @param string $mode Clean mode
+ * @param array $tags Array of tags
+ * @throws Zend_Cache_Exception
+ * @return boolean True if no problem
+ */
+ protected function _clean($dir, $mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
+ {
+ if (!is_dir($dir)) {
+ return false;
+ }
+ $result = true;
+ $prefix = $this->_options['file_name_prefix'];
+ $glob = @glob($dir . $prefix . '--*');
+ if ($glob === false) {
+ // On some systems it is impossible to distinguish between empty match and an error.
+ return true;
+ }
+ $metadataFiles = array();
+ foreach ($glob as $file) {
+ if (is_file($file)) {
+ $fileName = basename($file);
+ if ($this->_isMetadatasFile($fileName)) {
+ // In CLEANING_MODE_ALL, we drop anything, even remainings old metadatas files.
+ // To do that, we need to save the list of the metadata files first.
+ if ($mode == Zend_Cache::CLEANING_MODE_ALL) {
+ $metadataFiles[] = $file;
+ }
+ continue;
+ }
+ $id = $this->_fileNameToId($fileName);
+ $metadatas = $this->_getMetadatas($id);
+ if ($metadatas === FALSE) {
+ $metadatas = array('expire' => 1, 'tags' => array());
+ }
+ switch ($mode) {
+ case Zend_Cache::CLEANING_MODE_ALL:
+ $result = $result && $this->remove($id);
+ break;
+ case Zend_Cache::CLEANING_MODE_OLD:
+ if (time() > $metadatas['expire']) {
+ $result = $this->remove($id) && $result;
+ }
+ break;
+ case Zend_Cache::CLEANING_MODE_MATCHING_TAG:
+ $matching = true;
+ foreach ($tags as $tag) {
+ if (!in_array($tag, $metadatas['tags'])) {
+ $matching = false;
+ break;
+ }
+ }
+ if ($matching) {
+ $result = $this->remove($id) && $result;
+ }
+ break;
+ case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG:
+ $matching = false;
+ foreach ($tags as $tag) {
+ if (in_array($tag, $metadatas['tags'])) {
+ $matching = true;
+ break;
+ }
+ }
+ if (!$matching) {
+ $result = $this->remove($id) && $result;
+ }
+ break;
+ case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG:
+ $matching = false;
+ foreach ($tags as $tag) {
+ if (in_array($tag, $metadatas['tags'])) {
+ $matching = true;
+ break;
+ }
+ }
+ if ($matching) {
+ $result = $this->remove($id) && $result;
+ }
+ break;
+ default:
+ Zend_Cache::throwException('Invalid mode for clean() method');
+ break;
+ }
+ }
+ if ((is_dir($file)) and ($this->_options['hashed_directory_level']>0)) {
+ // Recursive call
+ $result = $this->_clean($file . DIRECTORY_SEPARATOR, $mode, $tags) && $result;
+ if ($mode == Zend_Cache::CLEANING_MODE_ALL) {
+ // we try to drop the structure too
+ @rmdir($file);
+ }
+ }
+ }
+
+ // cycle through metadataFiles and delete orphaned ones
+ foreach ($metadataFiles as $file) {
+ if (file_exists($file)) {
+ $result = $this->_remove($file) && $result;
+ }
+ }
+
+ return $result;
+ }
+
+ protected function _get($dir, $mode, $tags = array())
+ {
+ if (!is_dir($dir)) {
+ return false;
+ }
+ $result = array();
+ $prefix = $this->_options['file_name_prefix'];
+ $glob = @glob($dir . $prefix . '--*');
+ if ($glob === false) {
+ // On some systems it is impossible to distinguish between empty match and an error.
+ return array();
+ }
+ foreach ($glob as $file) {
+ if (is_file($file)) {
+ $fileName = basename($file);
+ $id = $this->_fileNameToId($fileName);
+ $metadatas = $this->_getMetadatas($id);
+ if ($metadatas === FALSE) {
+ continue;
+ }
+ if (time() > $metadatas['expire']) {
+ continue;
+ }
+ switch ($mode) {
+ case 'ids':
+ $result[] = $id;
+ break;
+ case 'tags':
+ $result = array_unique(array_merge($result, $metadatas['tags']));
+ break;
+ case 'matching':
+ $matching = true;
+ foreach ($tags as $tag) {
+ if (!in_array($tag, $metadatas['tags'])) {
+ $matching = false;
+ break;
+ }
+ }
+ if ($matching) {
+ $result[] = $id;
+ }
+ break;
+ case 'notMatching':
+ $matching = false;
+ foreach ($tags as $tag) {
+ if (in_array($tag, $metadatas['tags'])) {
+ $matching = true;
+ break;
+ }
+ }
+ if (!$matching) {
+ $result[] = $id;
+ }
+ break;
+ case 'matchingAny':
+ $matching = false;
+ foreach ($tags as $tag) {
+ if (in_array($tag, $metadatas['tags'])) {
+ $matching = true;
+ break;
+ }
+ }
+ if ($matching) {
+ $result[] = $id;
+ }
+ break;
+ default:
+ Zend_Cache::throwException('Invalid mode for _get() method');
+ break;
+ }
+ }
+ if ((is_dir($file)) and ($this->_options['hashed_directory_level']>0)) {
+ // Recursive call
+ $recursiveRs = $this->_get($file . DIRECTORY_SEPARATOR, $mode, $tags);
+ if ($recursiveRs === false) {
+ $this->_log('Zend_Cache_Backend_File::_get() / recursive call : can\'t list entries of "'.$file.'"');
+ } else {
+ $result = array_unique(array_merge($result, $recursiveRs));
+ }
+ }
+ }
+ return array_unique($result);
+ }
+
+ /**
+ * Compute & return the expire time
+ *
+ * @param int $lifetime
+ * @return int expire time (unix timestamp)
+ */
+ protected function _expireTime($lifetime)
+ {
+ if ($lifetime === null) {
+ return 9999999999;
+ }
+ return time() + $lifetime;
+ }
+
+ /**
+ * Make a control key with the string containing datas
+ *
+ * @param string $data Data
+ * @param string $controlType Type of control 'md5', 'crc32' or 'strlen'
+ * @throws Zend_Cache_Exception
+ * @return string Control key
+ */
+ protected function _hash($data, $controlType)
+ {
+ switch ($controlType) {
+ case 'md5':
+ return md5($data);
+ case 'crc32':
+ return crc32($data);
+ case 'strlen':
+ return strlen($data);
+ case 'adler32':
+ return hash('adler32', $data);
+ default:
+ Zend_Cache::throwException("Incorrect hash function : $controlType");
+ }
+ }
+
+ /**
+ * Transform a cache id into a file name and return it
+ *
+ * @param string $id Cache id
+ * @return string File name
+ */
+ protected function _idToFileName($id)
+ {
+ $prefix = $this->_options['file_name_prefix'];
+ $result = $prefix . '---' . $id;
+ return $result;
+ }
+
+ /**
+ * Make and return a file name (with path)
+ *
+ * @param string $id Cache id
+ * @return string File name (with path)
+ */
+ protected function _file($id)
+ {
+ $path = $this->_path($id);
+ $fileName = $this->_idToFileName($id);
+ return $path . $fileName;
+ }
+
+ /**
+ * Return the complete directory path of a filename (including hashedDirectoryStructure)
+ *
+ * @param string $id Cache id
+ * @param boolean $parts if true, returns array of directory parts instead of single string
+ * @return string Complete directory path
+ */
+ protected function _path($id, $parts = false)
+ {
+ $partsArray = array();
+ $root = $this->_options['cache_dir'];
+ $prefix = $this->_options['file_name_prefix'];
+ if ($this->_options['hashed_directory_level']>0) {
+ $hash = hash('adler32', $id);
+ for ($i=0 ; $i < $this->_options['hashed_directory_level'] ; $i++) {
+ $root = $root . $prefix . '--' . substr($hash, 0, $i + 1) . DIRECTORY_SEPARATOR;
+ $partsArray[] = $root;
+ }
+ }
+ if ($parts) {
+ return $partsArray;
+ } else {
+ return $root;
+ }
+ }
+
+ /**
+ * Make the directory strucuture for the given id
+ *
+ * @param string $id cache id
+ * @return boolean true
+ */
+ protected function _recursiveMkdirAndChmod($id)
+ {
+ if ($this->_options['hashed_directory_level'] <=0) {
+ return true;
+ }
+ $partsArray = $this->_path($id, true);
+ foreach ($partsArray as $part) {
+ if (!is_dir($part)) {
+ @mkdir($part, $this->_options['hashed_directory_perm']);
+ @chmod($part, $this->_options['hashed_directory_perm']); // see #ZF-320 (this line is required in some configurations)
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Test if the given cache id is available (and still valid as a cache record)
+ *
+ * @param string $id Cache id
+ * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
+ * @return boolean|mixed false (a cache is not available) or "last modified" timestamp (int) of the available cache record
+ */
+ protected function _test($id, $doNotTestCacheValidity)
+ {
+ $metadatas = $this->_getMetadatas($id);
+ if (!$metadatas) {
+ return false;
+ }
+ if ($doNotTestCacheValidity || (time() <= $metadatas['expire'])) {
+ return $metadatas['mtime'];
+ }
+ return false;
+ }
+
+ /**
+ * Return the file content of the given file
+ *
+ * @param string $file File complete path
+ * @return string File content (or false if problem)
+ */
+ protected function _fileGetContents($file)
+ {
+ $result = false;
+ if (!is_file($file)) {
+ return false;
+ }
+ $f = @fopen($file, 'rb');
+ if ($f) {
+ if ($this->_options['file_locking']) @flock($f, LOCK_SH);
+ $result = stream_get_contents($f);
+ if ($this->_options['file_locking']) @flock($f, LOCK_UN);
+ @fclose($f);
+ }
+ return $result;
+ }
+
+ /**
+ * Put the given string into the given file
+ *
+ * @param string $file File complete path
+ * @param string $string String to put in file
+ * @return boolean true if no problem
+ */
+ protected function _filePutContents($file, $string)
+ {
+ $result = false;
+ $f = @fopen($file, 'ab+');
+ if ($f) {
+ if ($this->_options['file_locking']) @flock($f, LOCK_EX);
+ fseek($f, 0);
+ ftruncate($f, 0);
+ $tmp = @fwrite($f, $string);
+ if (!($tmp === FALSE)) {
+ $result = true;
+ }
+ @fclose($f);
+ }
+ @chmod($file, $this->_options['cache_file_perm']);
+ return $result;
+ }
+
+ /**
+ * Transform a file name into cache id and return it
+ *
+ * @param string $fileName File name
+ * @return string Cache id
+ */
+ protected function _fileNameToId($fileName)
+ {
+ $prefix = $this->_options['file_name_prefix'];
+ return preg_replace('~^' . $prefix . '---(.*)$~', '$1', $fileName);
+ }
+
+}
diff --git a/library/vendor/Zend/Cache/Backend/Interface.php b/library/vendor/Zend/Cache/Backend/Interface.php
new file mode 100644
index 0000000..1bd72d8
--- /dev/null
+++ b/library/vendor/Zend/Cache/Backend/Interface.php
@@ -0,0 +1,99 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Cache_Backend_Interface
+{
+ /**
+ * Set the frontend directives
+ *
+ * @param array $directives assoc of directives
+ */
+ public function setDirectives($directives);
+
+ /**
+ * Test if a cache is available for the given id and (if yes) return it (false else)
+ *
+ * Note : return value is always "string" (unserialization is done by the core not by the backend)
+ *
+ * @param string $id Cache id
+ * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
+ * @return string|false cached datas
+ */
+ public function load($id, $doNotTestCacheValidity = false);
+
+ /**
+ * Test if a cache is available or not (for the given id)
+ *
+ * @param string $id cache id
+ * @return mixed|false (a cache is not available) or "last modified" timestamp (int) of the available cache record
+ */
+ public function test($id);
+
+ /**
+ * Save some string datas into a cache record
+ *
+ * Note : $data is always "string" (serialization is done by the
+ * core not by the backend)
+ *
+ * @param string $data Datas to cache
+ * @param string $id Cache id
+ * @param array $tags Array of strings, the cache record will be tagged by each string entry
+ * @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
+ * @return boolean true if no problem
+ */
+ public function save($data, $id, $tags = array(), $specificLifetime = false);
+
+ /**
+ * Remove a cache record
+ *
+ * @param string $id Cache id
+ * @return boolean True if no problem
+ */
+ public function remove($id);
+
+ /**
+ * Clean some cache records
+ *
+ * Available modes are :
+ * Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)
+ * Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used)
+ * Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags
+ * ($tags can be an array of strings or a single string)
+ * Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags}
+ * ($tags can be an array of strings or a single string)
+ * Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags
+ * ($tags can be an array of strings or a single string)
+ *
+ * @param string $mode Clean mode
+ * @param array $tags Array of tags
+ * @return boolean true if no problem
+ */
+ public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array());
+
+}
diff --git a/library/vendor/Zend/Cache/Backend/Libmemcached.php b/library/vendor/Zend/Cache/Backend/Libmemcached.php
new file mode 100644
index 0000000..ca1f695
--- /dev/null
+++ b/library/vendor/Zend/Cache/Backend/Libmemcached.php
@@ -0,0 +1,482 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Cache_Backend_Interface
+ */
+
+/**
+ * @see Zend_Cache_Backend
+ */
+
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Backend_Libmemcached extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface
+{
+ /**
+ * Default Server Values
+ */
+ const DEFAULT_HOST = '127.0.0.1';
+ const DEFAULT_PORT = 11211;
+ const DEFAULT_WEIGHT = 1;
+
+ /**
+ * Log message
+ */
+ const TAGS_UNSUPPORTED_BY_CLEAN_OF_LIBMEMCACHED_BACKEND = 'Zend_Cache_Backend_Libmemcached::clean() : tags are unsupported by the Libmemcached backend';
+ const TAGS_UNSUPPORTED_BY_SAVE_OF_LIBMEMCACHED_BACKEND = 'Zend_Cache_Backend_Libmemcached::save() : tags are unsupported by the Libmemcached backend';
+
+ /**
+ * Available options
+ *
+ * =====> (array) servers :
+ * an array of memcached server ; each memcached server is described by an associative array :
+ * 'host' => (string) : the name of the memcached server
+ * 'port' => (int) : the port of the memcached server
+ * 'weight' => (int) : number of buckets to create for this server which in turn control its
+ * probability of it being selected. The probability is relative to the total
+ * weight of all servers.
+ * =====> (array) client :
+ * an array of memcached client options ; the memcached client is described by an associative array :
+ * @see http://php.net/manual/memcached.constants.php
+ * - The option name can be the name of the constant without the prefix 'OPT_'
+ * or the integer value of this option constant
+ *
+ * @var array available options
+ */
+ protected $_options = array(
+ 'servers' => array(array(
+ 'host' => self::DEFAULT_HOST,
+ 'port' => self::DEFAULT_PORT,
+ 'weight' => self::DEFAULT_WEIGHT,
+ )),
+ 'client' => array()
+ );
+
+ /**
+ * Memcached object
+ *
+ * @var mixed memcached object
+ */
+ protected $_memcache = null;
+
+ /**
+ * Constructor
+ *
+ * @param array $options associative array of options
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ public function __construct(array $options = array())
+ {
+ if (!extension_loaded('memcached')) {
+ Zend_Cache::throwException('The memcached extension must be loaded for using this backend !');
+ }
+
+ // override default client options
+ $this->_options['client'] = array(
+ Memcached::OPT_DISTRIBUTION => Memcached::DISTRIBUTION_CONSISTENT,
+ Memcached::OPT_HASH => Memcached::HASH_MD5,
+ Memcached::OPT_LIBKETAMA_COMPATIBLE => true,
+ );
+
+ parent::__construct($options);
+
+ if (isset($this->_options['servers'])) {
+ $value = $this->_options['servers'];
+ if (isset($value['host'])) {
+ // in this case, $value seems to be a simple associative array (one server only)
+ $value = array(0 => $value); // let's transform it into a classical array of associative arrays
+ }
+ $this->setOption('servers', $value);
+ }
+ $this->_memcache = new Memcached;
+
+ // setup memcached client options
+ foreach ($this->_options['client'] as $name => $value) {
+ $optId = null;
+ if (is_int($name)) {
+ $optId = $name;
+ } else {
+ $optConst = 'Memcached::OPT_' . strtoupper($name);
+ if (defined($optConst)) {
+ $optId = constant($optConst);
+ } else {
+ $this->_log("Unknown memcached client option '{$name}' ({$optConst})");
+ }
+ }
+ if (null !== $optId) {
+ if (!$this->_memcache->setOption($optId, $value)) {
+ $this->_log("Setting memcached client option '{$optId}' failed");
+ }
+ }
+ }
+
+ // setup memcached servers
+ $servers = array();
+ foreach ($this->_options['servers'] as $server) {
+ if (!array_key_exists('port', $server)) {
+ $server['port'] = self::DEFAULT_PORT;
+ }
+ if (!array_key_exists('weight', $server)) {
+ $server['weight'] = self::DEFAULT_WEIGHT;
+ }
+
+ $servers[] = array($server['host'], $server['port'], $server['weight']);
+ }
+ $this->_memcache->addServers($servers);
+ }
+
+ /**
+ * Test if a cache is available for the given id and (if yes) return it (false else)
+ *
+ * @param string $id Cache id
+ * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
+ * @return string|false cached datas
+ */
+ public function load($id, $doNotTestCacheValidity = false)
+ {
+ $tmp = $this->_memcache->get($id);
+ if (isset($tmp[0])) {
+ return $tmp[0];
+ }
+ return false;
+ }
+
+ /**
+ * Test if a cache is available or not (for the given id)
+ *
+ * @param string $id Cache id
+ * @return int|false (a cache is not available) or "last modified" timestamp (int) of the available cache record
+ */
+ public function test($id)
+ {
+ $tmp = $this->_memcache->get($id);
+ if (isset($tmp[0], $tmp[1])) {
+ return (int)$tmp[1];
+ }
+ return false;
+ }
+
+ /**
+ * Save some string datas into a cache record
+ *
+ * Note : $data is always "string" (serialization is done by the
+ * core not by the backend)
+ *
+ * @param string $data Datas to cache
+ * @param string $id Cache id
+ * @param array $tags Array of strings, the cache record will be tagged by each string entry
+ * @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
+ * @return boolean True if no problem
+ */
+ public function save($data, $id, $tags = array(), $specificLifetime = false)
+ {
+ $lifetime = $this->getLifetime($specificLifetime);
+
+ // ZF-8856: using set because add needs a second request if item already exists
+ $result = @$this->_memcache->set($id, array($data, time(), $lifetime), $lifetime);
+ if ($result === false) {
+ $rsCode = $this->_memcache->getResultCode();
+ $rsMsg = $this->_memcache->getResultMessage();
+ $this->_log("Memcached::set() failed: [{$rsCode}] {$rsMsg}");
+ }
+
+ if (count($tags) > 0) {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_LIBMEMCACHED_BACKEND);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Remove a cache record
+ *
+ * @param string $id Cache id
+ * @return boolean True if no problem
+ */
+ public function remove($id)
+ {
+ return $this->_memcache->delete($id);
+ }
+
+ /**
+ * Clean some cache records
+ *
+ * Available modes are :
+ * 'all' (default) => remove all cache entries ($tags is not used)
+ * 'old' => unsupported
+ * 'matchingTag' => unsupported
+ * 'notMatchingTag' => unsupported
+ * 'matchingAnyTag' => unsupported
+ *
+ * @param string $mode Clean mode
+ * @param array $tags Array of tags
+ * @throws Zend_Cache_Exception
+ * @return boolean True if no problem
+ */
+ public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
+ {
+ switch ($mode) {
+ case Zend_Cache::CLEANING_MODE_ALL:
+ return $this->_memcache->flush();
+ break;
+ case Zend_Cache::CLEANING_MODE_OLD:
+ $this->_log("Zend_Cache_Backend_Libmemcached::clean() : CLEANING_MODE_OLD is unsupported by the Libmemcached backend");
+ break;
+ case Zend_Cache::CLEANING_MODE_MATCHING_TAG:
+ case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG:
+ case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG:
+ $this->_log(self::TAGS_UNSUPPORTED_BY_CLEAN_OF_LIBMEMCACHED_BACKEND);
+ break;
+ default:
+ Zend_Cache::throwException('Invalid mode for clean() method');
+ break;
+ }
+ }
+
+ /**
+ * Return true if the automatic cleaning is available for the backend
+ *
+ * @return boolean
+ */
+ public function isAutomaticCleaningAvailable()
+ {
+ return false;
+ }
+
+ /**
+ * Set the frontend directives
+ *
+ * @param array $directives Assoc of directives
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ public function setDirectives($directives)
+ {
+ parent::setDirectives($directives);
+ $lifetime = $this->getLifetime(false);
+ if ($lifetime > 2592000) {
+ // #ZF-3490 : For the memcached backend, there is a lifetime limit of 30 days (2592000 seconds)
+ $this->_log('memcached backend has a limit of 30 days (2592000 seconds) for the lifetime');
+ }
+ if ($lifetime === null) {
+ // #ZF-4614 : we tranform null to zero to get the maximal lifetime
+ parent::setDirectives(array('lifetime' => 0));
+ }
+ }
+
+ /**
+ * Return an array of stored cache ids
+ *
+ * @return array array of stored cache ids (string)
+ */
+ public function getIds()
+ {
+ $this->_log("Zend_Cache_Backend_Libmemcached::save() : getting the list of cache ids is unsupported by the Libmemcached backend");
+ return array();
+ }
+
+ /**
+ * Return an array of stored tags
+ *
+ * @return array array of stored tags (string)
+ */
+ public function getTags()
+ {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_LIBMEMCACHED_BACKEND);
+ return array();
+ }
+
+ /**
+ * Return an array of stored cache ids which match given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of matching cache ids (string)
+ */
+ public function getIdsMatchingTags($tags = array())
+ {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_LIBMEMCACHED_BACKEND);
+ return array();
+ }
+
+ /**
+ * Return an array of stored cache ids which don't match given tags
+ *
+ * In case of multiple tags, a logical OR is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of not matching cache ids (string)
+ */
+ public function getIdsNotMatchingTags($tags = array())
+ {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_LIBMEMCACHED_BACKEND);
+ return array();
+ }
+
+ /**
+ * Return an array of stored cache ids which match any given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of any matching cache ids (string)
+ */
+ public function getIdsMatchingAnyTags($tags = array())
+ {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_LIBMEMCACHED_BACKEND);
+ return array();
+ }
+
+ /**
+ * Return the filling percentage of the backend storage
+ *
+ * @throws Zend_Cache_Exception
+ * @return int integer between 0 and 100
+ */
+ public function getFillingPercentage()
+ {
+ $mems = $this->_memcache->getStats();
+ if ($mems === false) {
+ return 0;
+ }
+
+ $memSize = null;
+ $memUsed = null;
+ foreach ($mems as $key => $mem) {
+ if ($mem === false) {
+ $this->_log('can\'t get stat from ' . $key);
+ continue;
+ }
+
+ $eachSize = $mem['limit_maxbytes'];
+ $eachUsed = $mem['bytes'];
+ if ($eachUsed > $eachSize) {
+ $eachUsed = $eachSize;
+ }
+
+ $memSize += $eachSize;
+ $memUsed += $eachUsed;
+ }
+
+ if ($memSize === null || $memUsed === null) {
+ Zend_Cache::throwException('Can\'t get filling percentage');
+ }
+
+ return ((int) (100. * ($memUsed / $memSize)));
+ }
+
+ /**
+ * Return an array of metadatas for the given cache id
+ *
+ * The array must include these keys :
+ * - expire : the expire timestamp
+ * - tags : a string array of tags
+ * - mtime : timestamp of last modification time
+ *
+ * @param string $id cache id
+ * @return array array of metadatas (false if the cache id is not found)
+ */
+ public function getMetadatas($id)
+ {
+ $tmp = $this->_memcache->get($id);
+ if (isset($tmp[0], $tmp[1], $tmp[2])) {
+ $data = $tmp[0];
+ $mtime = $tmp[1];
+ $lifetime = $tmp[2];
+ return array(
+ 'expire' => $mtime + $lifetime,
+ 'tags' => array(),
+ 'mtime' => $mtime
+ );
+ }
+
+ return false;
+ }
+
+ /**
+ * Give (if possible) an extra lifetime to the given cache id
+ *
+ * @param string $id cache id
+ * @param int $extraLifetime
+ * @return boolean true if ok
+ */
+ public function touch($id, $extraLifetime)
+ {
+ $tmp = $this->_memcache->get($id);
+ if (isset($tmp[0], $tmp[1], $tmp[2])) {
+ $data = $tmp[0];
+ $mtime = $tmp[1];
+ $lifetime = $tmp[2];
+ $newLifetime = $lifetime - (time() - $mtime) + $extraLifetime;
+ if ($newLifetime <=0) {
+ return false;
+ }
+ // #ZF-5702 : we try replace() first becase set() seems to be slower
+ if (!($result = $this->_memcache->replace($id, array($data, time(), $newLifetime), $newLifetime))) {
+ $result = $this->_memcache->set($id, array($data, time(), $newLifetime), $newLifetime);
+ if ($result === false) {
+ $rsCode = $this->_memcache->getResultCode();
+ $rsMsg = $this->_memcache->getResultMessage();
+ $this->_log("Memcached::set() failed: [{$rsCode}] {$rsMsg}");
+ }
+ }
+ return $result;
+ }
+ return false;
+ }
+
+ /**
+ * Return an associative array of capabilities (booleans) of the backend
+ *
+ * The array must include these keys :
+ * - automatic_cleaning (is automating cleaning necessary)
+ * - tags (are tags supported)
+ * - expired_read (is it possible to read expired cache records
+ * (for doNotTestCacheValidity option for example))
+ * - priority does the backend deal with priority when saving
+ * - infinite_lifetime (is infinite lifetime can work with this backend)
+ * - get_list (is it possible to get the list of cache ids and the complete list of tags)
+ *
+ * @return array associative of with capabilities
+ */
+ public function getCapabilities()
+ {
+ return array(
+ 'automatic_cleaning' => false,
+ 'tags' => false,
+ 'expired_read' => false,
+ 'priority' => false,
+ 'infinite_lifetime' => false,
+ 'get_list' => false
+ );
+ }
+
+}
diff --git a/library/vendor/Zend/Cache/Backend/Memcached.php b/library/vendor/Zend/Cache/Backend/Memcached.php
new file mode 100644
index 0000000..61ddfdc
--- /dev/null
+++ b/library/vendor/Zend/Cache/Backend/Memcached.php
@@ -0,0 +1,507 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Cache_Backend_Interface
+ */
+
+/**
+ * @see Zend_Cache_Backend
+ */
+
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Backend_Memcached extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface
+{
+ /**
+ * Default Values
+ */
+ const DEFAULT_HOST = '127.0.0.1';
+ const DEFAULT_PORT = 11211;
+ const DEFAULT_PERSISTENT = true;
+ const DEFAULT_WEIGHT = 1;
+ const DEFAULT_TIMEOUT = 1;
+ const DEFAULT_RETRY_INTERVAL = 15;
+ const DEFAULT_STATUS = true;
+ const DEFAULT_FAILURE_CALLBACK = null;
+
+ /**
+ * Log message
+ */
+ const TAGS_UNSUPPORTED_BY_CLEAN_OF_MEMCACHED_BACKEND = 'Zend_Cache_Backend_Memcached::clean() : tags are unsupported by the Memcached backend';
+ const TAGS_UNSUPPORTED_BY_SAVE_OF_MEMCACHED_BACKEND = 'Zend_Cache_Backend_Memcached::save() : tags are unsupported by the Memcached backend';
+
+ /**
+ * Available options
+ *
+ * =====> (array) servers :
+ * an array of memcached server ; each memcached server is described by an associative array :
+ * 'host' => (string) : the name of the memcached server
+ * 'port' => (int) : the port of the memcached server
+ * 'persistent' => (bool) : use or not persistent connections to this memcached server
+ * 'weight' => (int) : number of buckets to create for this server which in turn control its
+ * probability of it being selected. The probability is relative to the total
+ * weight of all servers.
+ * 'timeout' => (int) : value in seconds which will be used for connecting to the daemon. Think twice
+ * before changing the default value of 1 second - you can lose all the
+ * advantages of caching if your connection is too slow.
+ * 'retry_interval' => (int) : controls how often a failed server will be retried, the default value
+ * is 15 seconds. Setting this parameter to -1 disables automatic retry.
+ * 'status' => (bool) : controls if the server should be flagged as online.
+ * 'failure_callback' => (callback) : Allows the user to specify a callback function to run upon
+ * encountering an error. The callback is run before failover
+ * is attempted. The function takes two parameters, the hostname
+ * and port of the failed server.
+ *
+ * =====> (boolean) compression :
+ * true if you want to use on-the-fly compression
+ *
+ * =====> (boolean) compatibility :
+ * true if you use old memcache server or extension
+ *
+ * @var array available options
+ */
+ protected $_options = array(
+ 'servers' => array(array(
+ 'host' => self::DEFAULT_HOST,
+ 'port' => self::DEFAULT_PORT,
+ 'persistent' => self::DEFAULT_PERSISTENT,
+ 'weight' => self::DEFAULT_WEIGHT,
+ 'timeout' => self::DEFAULT_TIMEOUT,
+ 'retry_interval' => self::DEFAULT_RETRY_INTERVAL,
+ 'status' => self::DEFAULT_STATUS,
+ 'failure_callback' => self::DEFAULT_FAILURE_CALLBACK
+ )),
+ 'compression' => false,
+ 'compatibility' => false,
+ );
+
+ /**
+ * Memcache object
+ *
+ * @var mixed memcache object
+ */
+ protected $_memcache = null;
+
+ /**
+ * Constructor
+ *
+ * @param array $options associative array of options
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ public function __construct(array $options = array())
+ {
+ if (!extension_loaded('memcache')) {
+ Zend_Cache::throwException('The memcache extension must be loaded for using this backend !');
+ }
+ parent::__construct($options);
+ if (isset($this->_options['servers'])) {
+ $value= $this->_options['servers'];
+ if (isset($value['host'])) {
+ // in this case, $value seems to be a simple associative array (one server only)
+ $value = array(0 => $value); // let's transform it into a classical array of associative arrays
+ }
+ $this->setOption('servers', $value);
+ }
+ $this->_memcache = new Memcache;
+ foreach ($this->_options['servers'] as $server) {
+ if (!array_key_exists('port', $server)) {
+ $server['port'] = self::DEFAULT_PORT;
+ }
+ if (!array_key_exists('persistent', $server)) {
+ $server['persistent'] = self::DEFAULT_PERSISTENT;
+ }
+ if (!array_key_exists('weight', $server)) {
+ $server['weight'] = self::DEFAULT_WEIGHT;
+ }
+ if (!array_key_exists('timeout', $server)) {
+ $server['timeout'] = self::DEFAULT_TIMEOUT;
+ }
+ if (!array_key_exists('retry_interval', $server)) {
+ $server['retry_interval'] = self::DEFAULT_RETRY_INTERVAL;
+ }
+ if (!array_key_exists('status', $server)) {
+ $server['status'] = self::DEFAULT_STATUS;
+ }
+ if (!array_key_exists('failure_callback', $server)) {
+ $server['failure_callback'] = self::DEFAULT_FAILURE_CALLBACK;
+ }
+ if ($this->_options['compatibility']) {
+ // No status for compatibility mode (#ZF-5887)
+ $this->_memcache->addServer($server['host'], $server['port'], $server['persistent'],
+ $server['weight'], $server['timeout'],
+ $server['retry_interval']);
+ } else {
+ $this->_memcache->addServer($server['host'], $server['port'], $server['persistent'],
+ $server['weight'], $server['timeout'],
+ $server['retry_interval'],
+ $server['status'], $server['failure_callback']);
+ }
+ }
+ }
+
+ /**
+ * Test if a cache is available for the given id and (if yes) return it (false else)
+ *
+ * @param string $id Cache id
+ * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
+ * @return string|false cached datas
+ */
+ public function load($id, $doNotTestCacheValidity = false)
+ {
+ $tmp = $this->_memcache->get($id);
+ if (is_array($tmp) && isset($tmp[0])) {
+ return $tmp[0];
+ }
+ return false;
+ }
+
+ /**
+ * Test if a cache is available or not (for the given id)
+ *
+ * @param string $id Cache id
+ * @return mixed|false (a cache is not available) or "last modified" timestamp (int) of the available cache record
+ */
+ public function test($id)
+ {
+ $tmp = $this->_memcache->get($id);
+ if (is_array($tmp)) {
+ return $tmp[1];
+ }
+ return false;
+ }
+
+ /**
+ * Save some string datas into a cache record
+ *
+ * Note : $data is always "string" (serialization is done by the
+ * core not by the backend)
+ *
+ * @param string $data Datas to cache
+ * @param string $id Cache id
+ * @param array $tags Array of strings, the cache record will be tagged by each string entry
+ * @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
+ * @return boolean True if no problem
+ */
+ public function save($data, $id, $tags = array(), $specificLifetime = false)
+ {
+ $lifetime = $this->getLifetime($specificLifetime);
+ if ($this->_options['compression']) {
+ $flag = MEMCACHE_COMPRESSED;
+ } else {
+ $flag = 0;
+ }
+
+ // ZF-8856: using set because add needs a second request if item already exists
+ $result = @$this->_memcache->set($id, array($data, time(), $lifetime), $flag, $lifetime);
+
+ if (count($tags) > 0) {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_MEMCACHED_BACKEND);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Remove a cache record
+ *
+ * @param string $id Cache id
+ * @return boolean True if no problem
+ */
+ public function remove($id)
+ {
+ return $this->_memcache->delete($id, 0);
+ }
+
+ /**
+ * Clean some cache records
+ *
+ * Available modes are :
+ * 'all' (default) => remove all cache entries ($tags is not used)
+ * 'old' => unsupported
+ * 'matchingTag' => unsupported
+ * 'notMatchingTag' => unsupported
+ * 'matchingAnyTag' => unsupported
+ *
+ * @param string $mode Clean mode
+ * @param array $tags Array of tags
+ * @throws Zend_Cache_Exception
+ * @return boolean True if no problem
+ */
+ public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
+ {
+ switch ($mode) {
+ case Zend_Cache::CLEANING_MODE_ALL:
+ return $this->_memcache->flush();
+ break;
+ case Zend_Cache::CLEANING_MODE_OLD:
+ $this->_log("Zend_Cache_Backend_Memcached::clean() : CLEANING_MODE_OLD is unsupported by the Memcached backend");
+ break;
+ case Zend_Cache::CLEANING_MODE_MATCHING_TAG:
+ case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG:
+ case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG:
+ $this->_log(self::TAGS_UNSUPPORTED_BY_CLEAN_OF_MEMCACHED_BACKEND);
+ break;
+ default:
+ Zend_Cache::throwException('Invalid mode for clean() method');
+ break;
+ }
+ }
+
+ /**
+ * Return true if the automatic cleaning is available for the backend
+ *
+ * @return boolean
+ */
+ public function isAutomaticCleaningAvailable()
+ {
+ return false;
+ }
+
+ /**
+ * Set the frontend directives
+ *
+ * @param array $directives Assoc of directives
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ public function setDirectives($directives)
+ {
+ parent::setDirectives($directives);
+ $lifetime = $this->getLifetime(false);
+ if ($lifetime > 2592000) {
+ // #ZF-3490 : For the memcached backend, there is a lifetime limit of 30 days (2592000 seconds)
+ $this->_log('memcached backend has a limit of 30 days (2592000 seconds) for the lifetime');
+ }
+ if ($lifetime === null) {
+ // #ZF-4614 : we tranform null to zero to get the maximal lifetime
+ parent::setDirectives(array('lifetime' => 0));
+ }
+ }
+
+ /**
+ * Return an array of stored cache ids
+ *
+ * @return array array of stored cache ids (string)
+ */
+ public function getIds()
+ {
+ $this->_log("Zend_Cache_Backend_Memcached::save() : getting the list of cache ids is unsupported by the Memcache backend");
+ return array();
+ }
+
+ /**
+ * Return an array of stored tags
+ *
+ * @return array array of stored tags (string)
+ */
+ public function getTags()
+ {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_MEMCACHED_BACKEND);
+ return array();
+ }
+
+ /**
+ * Return an array of stored cache ids which match given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of matching cache ids (string)
+ */
+ public function getIdsMatchingTags($tags = array())
+ {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_MEMCACHED_BACKEND);
+ return array();
+ }
+
+ /**
+ * Return an array of stored cache ids which don't match given tags
+ *
+ * In case of multiple tags, a logical OR is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of not matching cache ids (string)
+ */
+ public function getIdsNotMatchingTags($tags = array())
+ {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_MEMCACHED_BACKEND);
+ return array();
+ }
+
+ /**
+ * Return an array of stored cache ids which match any given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of any matching cache ids (string)
+ */
+ public function getIdsMatchingAnyTags($tags = array())
+ {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_MEMCACHED_BACKEND);
+ return array();
+ }
+
+ /**
+ * Return the filling percentage of the backend storage
+ *
+ * @throws Zend_Cache_Exception
+ * @return int integer between 0 and 100
+ */
+ public function getFillingPercentage()
+ {
+ $mems = $this->_memcache->getExtendedStats();
+
+ $memSize = null;
+ $memUsed = null;
+ foreach ($mems as $key => $mem) {
+ if ($mem === false) {
+ $this->_log('can\'t get stat from ' . $key);
+ continue;
+ }
+
+ $eachSize = $mem['limit_maxbytes'];
+
+ /**
+ * Couchbase 1.x uses 'mem_used' instead of 'bytes'
+ * @see https://www.couchbase.com/issues/browse/MB-3466
+ */
+ $eachUsed = isset($mem['bytes']) ? $mem['bytes'] : $mem['mem_used'];
+ if ($eachUsed > $eachSize) {
+ $eachUsed = $eachSize;
+ }
+
+ $memSize += $eachSize;
+ $memUsed += $eachUsed;
+ }
+
+ if ($memSize === null || $memUsed === null) {
+ Zend_Cache::throwException('Can\'t get filling percentage');
+ }
+
+ return ((int) (100. * ($memUsed / $memSize)));
+ }
+
+ /**
+ * Return an array of metadatas for the given cache id
+ *
+ * The array must include these keys :
+ * - expire : the expire timestamp
+ * - tags : a string array of tags
+ * - mtime : timestamp of last modification time
+ *
+ * @param string $id cache id
+ * @return array array of metadatas (false if the cache id is not found)
+ */
+ public function getMetadatas($id)
+ {
+ $tmp = $this->_memcache->get($id);
+ if (is_array($tmp)) {
+ $data = $tmp[0];
+ $mtime = $tmp[1];
+ if (!isset($tmp[2])) {
+ // because this record is only with 1.7 release
+ // if old cache records are still there...
+ return false;
+ }
+ $lifetime = $tmp[2];
+ return array(
+ 'expire' => $mtime + $lifetime,
+ 'tags' => array(),
+ 'mtime' => $mtime
+ );
+ }
+ return false;
+ }
+
+ /**
+ * Give (if possible) an extra lifetime to the given cache id
+ *
+ * @param string $id cache id
+ * @param int $extraLifetime
+ * @return boolean true if ok
+ */
+ public function touch($id, $extraLifetime)
+ {
+ if ($this->_options['compression']) {
+ $flag = MEMCACHE_COMPRESSED;
+ } else {
+ $flag = 0;
+ }
+ $tmp = $this->_memcache->get($id);
+ if (is_array($tmp)) {
+ $data = $tmp[0];
+ $mtime = $tmp[1];
+ if (!isset($tmp[2])) {
+ // because this record is only with 1.7 release
+ // if old cache records are still there...
+ return false;
+ }
+ $lifetime = $tmp[2];
+ $newLifetime = $lifetime - (time() - $mtime) + $extraLifetime;
+ if ($newLifetime <=0) {
+ return false;
+ }
+ // #ZF-5702 : we try replace() first becase set() seems to be slower
+ if (!($result = $this->_memcache->replace($id, array($data, time(), $newLifetime), $flag, $newLifetime))) {
+ $result = $this->_memcache->set($id, array($data, time(), $newLifetime), $flag, $newLifetime);
+ }
+ return $result;
+ }
+ return false;
+ }
+
+ /**
+ * Return an associative array of capabilities (booleans) of the backend
+ *
+ * The array must include these keys :
+ * - automatic_cleaning (is automating cleaning necessary)
+ * - tags (are tags supported)
+ * - expired_read (is it possible to read expired cache records
+ * (for doNotTestCacheValidity option for example))
+ * - priority does the backend deal with priority when saving
+ * - infinite_lifetime (is infinite lifetime can work with this backend)
+ * - get_list (is it possible to get the list of cache ids and the complete list of tags)
+ *
+ * @return array associative of with capabilities
+ */
+ public function getCapabilities()
+ {
+ return array(
+ 'automatic_cleaning' => false,
+ 'tags' => false,
+ 'expired_read' => false,
+ 'priority' => false,
+ 'infinite_lifetime' => false,
+ 'get_list' => false
+ );
+ }
+
+}
diff --git a/library/vendor/Zend/Cache/Backend/Sqlite.php b/library/vendor/Zend/Cache/Backend/Sqlite.php
new file mode 100644
index 0000000..fa6be7d
--- /dev/null
+++ b/library/vendor/Zend/Cache/Backend/Sqlite.php
@@ -0,0 +1,676 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Cache_Backend_Interface
+ */
+
+/**
+ * @see Zend_Cache_Backend
+ */
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Backend_Sqlite extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface
+{
+ /**
+ * Available options
+ *
+ * =====> (string) cache_db_complete_path :
+ * - the complete path (filename included) of the SQLITE database
+ *
+ * ====> (int) automatic_vacuum_factor :
+ * - Disable / Tune the automatic vacuum process
+ * - The automatic vacuum process defragment the database file (and make it smaller)
+ * when a clean() or delete() is called
+ * 0 => no automatic vacuum
+ * 1 => systematic vacuum (when delete() or clean() methods are called)
+ * x (integer) > 1 => automatic vacuum randomly 1 times on x clean() or delete()
+ *
+ * @var array Available options
+ */
+ protected $_options = array(
+ 'cache_db_complete_path' => null,
+ 'automatic_vacuum_factor' => 10
+ );
+
+ /**
+ * DB ressource
+ *
+ * @var mixed $_db
+ */
+ private $_db = null;
+
+ /**
+ * Boolean to store if the structure has benn checked or not
+ *
+ * @var boolean $_structureChecked
+ */
+ private $_structureChecked = false;
+
+ /**
+ * Constructor
+ *
+ * @param array $options Associative array of options
+ * @throws Zend_cache_Exception
+ * @return void
+ */
+ public function __construct(array $options = array())
+ {
+ parent::__construct($options);
+ if ($this->_options['cache_db_complete_path'] === null) {
+ Zend_Cache::throwException('cache_db_complete_path option has to set');
+ }
+ if (!extension_loaded('sqlite')) {
+ Zend_Cache::throwException("Cannot use SQLite storage because the 'sqlite' extension is not loaded in the current PHP environment");
+ }
+ $this->_getConnection();
+ }
+
+ /**
+ * Destructor
+ *
+ * @return void
+ */
+ public function __destruct()
+ {
+ @sqlite_close($this->_getConnection());
+ }
+
+ /**
+ * Test if a cache is available for the given id and (if yes) return it (false else)
+ *
+ * @param string $id Cache id
+ * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
+ * @return string|false Cached datas
+ */
+ public function load($id, $doNotTestCacheValidity = false)
+ {
+ $this->_checkAndBuildStructure();
+ $sql = "SELECT content FROM cache WHERE id='$id'";
+ if (!$doNotTestCacheValidity) {
+ $sql = $sql . " AND (expire=0 OR expire>" . time() . ')';
+ }
+ $result = $this->_query($sql);
+ $row = @sqlite_fetch_array($result);
+ if ($row) {
+ return $row['content'];
+ }
+ return false;
+ }
+
+ /**
+ * Test if a cache is available or not (for the given id)
+ *
+ * @param string $id Cache id
+ * @return mixed|false (a cache is not available) or "last modified" timestamp (int) of the available cache record
+ */
+ public function test($id)
+ {
+ $this->_checkAndBuildStructure();
+ $sql = "SELECT lastModified FROM cache WHERE id='$id' AND (expire=0 OR expire>" . time() . ')';
+ $result = $this->_query($sql);
+ $row = @sqlite_fetch_array($result);
+ if ($row) {
+ return ((int) $row['lastModified']);
+ }
+ return false;
+ }
+
+ /**
+ * Save some string datas into a cache record
+ *
+ * Note : $data is always "string" (serialization is done by the
+ * core not by the backend)
+ *
+ * @param string $data Datas to cache
+ * @param string $id Cache id
+ * @param array $tags Array of strings, the cache record will be tagged by each string entry
+ * @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
+ * @throws Zend_Cache_Exception
+ * @return boolean True if no problem
+ */
+ public function save($data, $id, $tags = array(), $specificLifetime = false)
+ {
+ $this->_checkAndBuildStructure();
+ $lifetime = $this->getLifetime($specificLifetime);
+ $data = @sqlite_escape_string($data);
+ $mktime = time();
+ if ($lifetime === null) {
+ $expire = 0;
+ } else {
+ $expire = $mktime + $lifetime;
+ }
+ $this->_query("DELETE FROM cache WHERE id='$id'");
+ $sql = "INSERT INTO cache (id, content, lastModified, expire) VALUES ('$id', '$data', $mktime, $expire)";
+ $res = $this->_query($sql);
+ if (!$res) {
+ $this->_log("Zend_Cache_Backend_Sqlite::save() : impossible to store the cache id=$id");
+ return false;
+ }
+ $res = true;
+ foreach ($tags as $tag) {
+ $res = $this->_registerTag($id, $tag) && $res;
+ }
+ return $res;
+ }
+
+ /**
+ * Remove a cache record
+ *
+ * @param string $id Cache id
+ * @return boolean True if no problem
+ */
+ public function remove($id)
+ {
+ $this->_checkAndBuildStructure();
+ $res = $this->_query("SELECT COUNT(*) AS nbr FROM cache WHERE id='$id'");
+ $result1 = @sqlite_fetch_single($res);
+ $result2 = $this->_query("DELETE FROM cache WHERE id='$id'");
+ $result3 = $this->_query("DELETE FROM tag WHERE id='$id'");
+ $this->_automaticVacuum();
+ return ($result1 && $result2 && $result3);
+ }
+
+ /**
+ * Clean some cache records
+ *
+ * Available modes are :
+ * Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)
+ * Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used)
+ * Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags
+ * ($tags can be an array of strings or a single string)
+ * Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags}
+ * ($tags can be an array of strings or a single string)
+ * Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags
+ * ($tags can be an array of strings or a single string)
+ *
+ * @param string $mode Clean mode
+ * @param array $tags Array of tags
+ * @return boolean True if no problem
+ */
+ public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
+ {
+ $this->_checkAndBuildStructure();
+ $return = $this->_clean($mode, $tags);
+ $this->_automaticVacuum();
+ return $return;
+ }
+
+ /**
+ * Return an array of stored cache ids
+ *
+ * @return array array of stored cache ids (string)
+ */
+ public function getIds()
+ {
+ $this->_checkAndBuildStructure();
+ $res = $this->_query("SELECT id FROM cache WHERE (expire=0 OR expire>" . time() . ")");
+ $result = array();
+ while ($id = @sqlite_fetch_single($res)) {
+ $result[] = $id;
+ }
+ return $result;
+ }
+
+ /**
+ * Return an array of stored tags
+ *
+ * @return array array of stored tags (string)
+ */
+ public function getTags()
+ {
+ $this->_checkAndBuildStructure();
+ $res = $this->_query("SELECT DISTINCT(name) AS name FROM tag");
+ $result = array();
+ while ($id = @sqlite_fetch_single($res)) {
+ $result[] = $id;
+ }
+ return $result;
+ }
+
+ /**
+ * Return an array of stored cache ids which match given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of matching cache ids (string)
+ */
+ public function getIdsMatchingTags($tags = array())
+ {
+ $first = true;
+ $ids = array();
+ foreach ($tags as $tag) {
+ $res = $this->_query("SELECT DISTINCT(id) AS id FROM tag WHERE name='$tag'");
+ if (!$res) {
+ return array();
+ }
+ $rows = @sqlite_fetch_all($res, SQLITE_ASSOC);
+ $ids2 = array();
+ foreach ($rows as $row) {
+ $ids2[] = $row['id'];
+ }
+ if ($first) {
+ $ids = $ids2;
+ $first = false;
+ } else {
+ $ids = array_intersect($ids, $ids2);
+ }
+ }
+ $result = array();
+ foreach ($ids as $id) {
+ $result[] = $id;
+ }
+ return $result;
+ }
+
+ /**
+ * Return an array of stored cache ids which don't match given tags
+ *
+ * In case of multiple tags, a logical OR is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of not matching cache ids (string)
+ */
+ public function getIdsNotMatchingTags($tags = array())
+ {
+ $res = $this->_query("SELECT id FROM cache");
+ $rows = @sqlite_fetch_all($res, SQLITE_ASSOC);
+ $result = array();
+ foreach ($rows as $row) {
+ $id = $row['id'];
+ $matching = false;
+ foreach ($tags as $tag) {
+ $res = $this->_query("SELECT COUNT(*) AS nbr FROM tag WHERE name='$tag' AND id='$id'");
+ if (!$res) {
+ return array();
+ }
+ $nbr = (int) @sqlite_fetch_single($res);
+ if ($nbr > 0) {
+ $matching = true;
+ }
+ }
+ if (!$matching) {
+ $result[] = $id;
+ }
+ }
+ return $result;
+ }
+
+ /**
+ * Return an array of stored cache ids which match any given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of any matching cache ids (string)
+ */
+ public function getIdsMatchingAnyTags($tags = array())
+ {
+ $first = true;
+ $ids = array();
+ foreach ($tags as $tag) {
+ $res = $this->_query("SELECT DISTINCT(id) AS id FROM tag WHERE name='$tag'");
+ if (!$res) {
+ return array();
+ }
+ $rows = @sqlite_fetch_all($res, SQLITE_ASSOC);
+ $ids2 = array();
+ foreach ($rows as $row) {
+ $ids2[] = $row['id'];
+ }
+ if ($first) {
+ $ids = $ids2;
+ $first = false;
+ } else {
+ $ids = array_merge($ids, $ids2);
+ }
+ }
+ $result = array();
+ foreach ($ids as $id) {
+ $result[] = $id;
+ }
+ return $result;
+ }
+
+ /**
+ * Return the filling percentage of the backend storage
+ *
+ * @throws Zend_Cache_Exception
+ * @return int integer between 0 and 100
+ */
+ public function getFillingPercentage()
+ {
+ $dir = dirname($this->_options['cache_db_complete_path']);
+ $free = disk_free_space($dir);
+ $total = disk_total_space($dir);
+ if ($total == 0) {
+ Zend_Cache::throwException('can\'t get disk_total_space');
+ } else {
+ if ($free >= $total) {
+ return 100;
+ }
+ return ((int) (100. * ($total - $free) / $total));
+ }
+ }
+
+ /**
+ * Return an array of metadatas for the given cache id
+ *
+ * The array must include these keys :
+ * - expire : the expire timestamp
+ * - tags : a string array of tags
+ * - mtime : timestamp of last modification time
+ *
+ * @param string $id cache id
+ * @return array array of metadatas (false if the cache id is not found)
+ */
+ public function getMetadatas($id)
+ {
+ $tags = array();
+ $res = $this->_query("SELECT name FROM tag WHERE id='$id'");
+ if ($res) {
+ $rows = @sqlite_fetch_all($res, SQLITE_ASSOC);
+ foreach ($rows as $row) {
+ $tags[] = $row['name'];
+ }
+ }
+ $this->_query('CREATE TABLE cache (id TEXT PRIMARY KEY, content BLOB, lastModified INTEGER, expire INTEGER)');
+ $res = $this->_query("SELECT lastModified,expire FROM cache WHERE id='$id'");
+ if (!$res) {
+ return false;
+ }
+ $row = @sqlite_fetch_array($res, SQLITE_ASSOC);
+ return array(
+ 'tags' => $tags,
+ 'mtime' => $row['lastModified'],
+ 'expire' => $row['expire']
+ );
+ }
+
+ /**
+ * Give (if possible) an extra lifetime to the given cache id
+ *
+ * @param string $id cache id
+ * @param int $extraLifetime
+ * @return boolean true if ok
+ */
+ public function touch($id, $extraLifetime)
+ {
+ $sql = "SELECT expire FROM cache WHERE id='$id' AND (expire=0 OR expire>" . time() . ')';
+ $res = $this->_query($sql);
+ if (!$res) {
+ return false;
+ }
+ $expire = @sqlite_fetch_single($res);
+ $newExpire = $expire + $extraLifetime;
+ $res = $this->_query("UPDATE cache SET lastModified=" . time() . ", expire=$newExpire WHERE id='$id'");
+ if ($res) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Return an associative array of capabilities (booleans) of the backend
+ *
+ * The array must include these keys :
+ * - automatic_cleaning (is automating cleaning necessary)
+ * - tags (are tags supported)
+ * - expired_read (is it possible to read expired cache records
+ * (for doNotTestCacheValidity option for example))
+ * - priority does the backend deal with priority when saving
+ * - infinite_lifetime (is infinite lifetime can work with this backend)
+ * - get_list (is it possible to get the list of cache ids and the complete list of tags)
+ *
+ * @return array associative of with capabilities
+ */
+ public function getCapabilities()
+ {
+ return array(
+ 'automatic_cleaning' => true,
+ 'tags' => true,
+ 'expired_read' => true,
+ 'priority' => false,
+ 'infinite_lifetime' => true,
+ 'get_list' => true
+ );
+ }
+
+ /**
+ * PUBLIC METHOD FOR UNIT TESTING ONLY !
+ *
+ * Force a cache record to expire
+ *
+ * @param string $id Cache id
+ */
+ public function ___expire($id)
+ {
+ $time = time() - 1;
+ $this->_query("UPDATE cache SET lastModified=$time, expire=$time WHERE id='$id'");
+ }
+
+ /**
+ * Return the connection resource
+ *
+ * If we are not connected, the connection is made
+ *
+ * @throws Zend_Cache_Exception
+ * @return resource Connection resource
+ */
+ private function _getConnection()
+ {
+ if (is_resource($this->_db)) {
+ return $this->_db;
+ } else {
+ $this->_db = @sqlite_open($this->_options['cache_db_complete_path']);
+ if (!(is_resource($this->_db))) {
+ Zend_Cache::throwException("Impossible to open " . $this->_options['cache_db_complete_path'] . " cache DB file");
+ }
+ return $this->_db;
+ }
+ }
+
+ /**
+ * Execute an SQL query silently
+ *
+ * @param string $query SQL query
+ * @return mixed|false query results
+ */
+ private function _query($query)
+ {
+ $db = $this->_getConnection();
+ if (is_resource($db)) {
+ $res = @sqlite_query($db, $query);
+ if ($res === false) {
+ return false;
+ } else {
+ return $res;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Deal with the automatic vacuum process
+ *
+ * @return void
+ */
+ private function _automaticVacuum()
+ {
+ if ($this->_options['automatic_vacuum_factor'] > 0) {
+ $rand = rand(1, $this->_options['automatic_vacuum_factor']);
+ if ($rand == 1) {
+ $this->_query('VACUUM');
+ }
+ }
+ }
+
+ /**
+ * Register a cache id with the given tag
+ *
+ * @param string $id Cache id
+ * @param string $tag Tag
+ * @return boolean True if no problem
+ */
+ private function _registerTag($id, $tag) {
+ $res = $this->_query("DELETE FROM TAG WHERE name='$tag' AND id='$id'");
+ $res = $this->_query("INSERT INTO tag (name, id) VALUES ('$tag', '$id')");
+ if (!$res) {
+ $this->_log("Zend_Cache_Backend_Sqlite::_registerTag() : impossible to register tag=$tag on id=$id");
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Build the database structure
+ *
+ * @return false
+ */
+ private function _buildStructure()
+ {
+ $this->_query('DROP INDEX tag_id_index');
+ $this->_query('DROP INDEX tag_name_index');
+ $this->_query('DROP INDEX cache_id_expire_index');
+ $this->_query('DROP TABLE version');
+ $this->_query('DROP TABLE cache');
+ $this->_query('DROP TABLE tag');
+ $this->_query('CREATE TABLE version (num INTEGER PRIMARY KEY)');
+ $this->_query('CREATE TABLE cache (id TEXT PRIMARY KEY, content BLOB, lastModified INTEGER, expire INTEGER)');
+ $this->_query('CREATE TABLE tag (name TEXT, id TEXT)');
+ $this->_query('CREATE INDEX tag_id_index ON tag(id)');
+ $this->_query('CREATE INDEX tag_name_index ON tag(name)');
+ $this->_query('CREATE INDEX cache_id_expire_index ON cache(id, expire)');
+ $this->_query('INSERT INTO version (num) VALUES (1)');
+ }
+
+ /**
+ * Check if the database structure is ok (with the good version)
+ *
+ * @return boolean True if ok
+ */
+ private function _checkStructureVersion()
+ {
+ $result = $this->_query("SELECT num FROM version");
+ if (!$result) return false;
+ $row = @sqlite_fetch_array($result);
+ if (!$row) {
+ return false;
+ }
+ if (((int) $row['num']) != 1) {
+ // old cache structure
+ $this->_log('Zend_Cache_Backend_Sqlite::_checkStructureVersion() : old cache structure version detected => the cache is going to be dropped');
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Clean some cache records
+ *
+ * Available modes are :
+ * Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)
+ * Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used)
+ * Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags
+ * ($tags can be an array of strings or a single string)
+ * Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags}
+ * ($tags can be an array of strings or a single string)
+ * Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags
+ * ($tags can be an array of strings or a single string)
+ *
+ * @param string $mode Clean mode
+ * @param array $tags Array of tags
+ * @return boolean True if no problem
+ */
+ private function _clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
+ {
+ switch ($mode) {
+ case Zend_Cache::CLEANING_MODE_ALL:
+ $res1 = $this->_query('DELETE FROM cache');
+ $res2 = $this->_query('DELETE FROM tag');
+ return $res1 && $res2;
+ break;
+ case Zend_Cache::CLEANING_MODE_OLD:
+ $mktime = time();
+ $res1 = $this->_query("DELETE FROM tag WHERE id IN (SELECT id FROM cache WHERE expire>0 AND expire<=$mktime)");
+ $res2 = $this->_query("DELETE FROM cache WHERE expire>0 AND expire<=$mktime");
+ return $res1 && $res2;
+ break;
+ case Zend_Cache::CLEANING_MODE_MATCHING_TAG:
+ $ids = $this->getIdsMatchingTags($tags);
+ $result = true;
+ foreach ($ids as $id) {
+ $result = $this->remove($id) && $result;
+ }
+ return $result;
+ break;
+ case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG:
+ $ids = $this->getIdsNotMatchingTags($tags);
+ $result = true;
+ foreach ($ids as $id) {
+ $result = $this->remove($id) && $result;
+ }
+ return $result;
+ break;
+ case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG:
+ $ids = $this->getIdsMatchingAnyTags($tags);
+ $result = true;
+ foreach ($ids as $id) {
+ $result = $this->remove($id) && $result;
+ }
+ return $result;
+ break;
+ default:
+ break;
+ }
+ return false;
+ }
+
+ /**
+ * Check if the database structure is ok (with the good version), if no : build it
+ *
+ * @throws Zend_Cache_Exception
+ * @return boolean True if ok
+ */
+ private function _checkAndBuildStructure()
+ {
+ if (!($this->_structureChecked)) {
+ if (!$this->_checkStructureVersion()) {
+ $this->_buildStructure();
+ if (!$this->_checkStructureVersion()) {
+ Zend_Cache::throwException("Impossible to build cache structure in " . $this->_options['cache_db_complete_path']);
+ }
+ }
+ $this->_structureChecked = true;
+ }
+ return true;
+ }
+
+}
diff --git a/library/vendor/Zend/Cache/Backend/Static.php b/library/vendor/Zend/Cache/Backend/Static.php
new file mode 100644
index 0000000..9203020
--- /dev/null
+++ b/library/vendor/Zend/Cache/Backend/Static.php
@@ -0,0 +1,577 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Cache_Backend_Interface
+ */
+
+/**
+ * @see Zend_Cache_Backend
+ */
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Backend_Static
+ extends Zend_Cache_Backend
+ implements Zend_Cache_Backend_Interface
+{
+ const INNER_CACHE_NAME = 'zend_cache_backend_static_tagcache';
+
+ /**
+ * Static backend options
+ * @var array
+ */
+ protected $_options = array(
+ 'public_dir' => null,
+ 'sub_dir' => 'html',
+ 'file_extension' => '.html',
+ 'index_filename' => 'index',
+ 'file_locking' => true,
+ 'cache_file_perm' => 0600,
+ 'cache_directory_perm' => 0700,
+ 'debug_header' => false,
+ 'tag_cache' => null,
+ 'disable_caching' => false
+ );
+
+ /**
+ * Cache for handling tags
+ * @var Zend_Cache_Core
+ */
+ protected $_tagCache = null;
+
+ /**
+ * Tagged items
+ * @var array
+ */
+ protected $_tagged = null;
+
+ /**
+ * Interceptor child method to handle the case where an Inner
+ * Cache object is being set since it's not supported by the
+ * standard backend interface
+ *
+ * @param string $name
+ * @param mixed $value
+ * @return Zend_Cache_Backend_Static
+ */
+ public function setOption($name, $value)
+ {
+ if ($name == 'tag_cache') {
+ $this->setInnerCache($value);
+ } else {
+ // See #ZF-12047 and #GH-91
+ if ($name == 'cache_file_umask') {
+ trigger_error(
+ "'cache_file_umask' is deprecated -> please use 'cache_file_perm' instead",
+ E_USER_NOTICE
+ );
+
+ $name = 'cache_file_perm';
+ }
+ if ($name == 'cache_directory_umask') {
+ trigger_error(
+ "'cache_directory_umask' is deprecated -> please use 'cache_directory_perm' instead",
+ E_USER_NOTICE
+ );
+
+ $name = 'cache_directory_perm';
+ }
+
+ parent::setOption($name, $value);
+ }
+ return $this;
+ }
+
+ /**
+ * Retrieve any option via interception of the parent's statically held
+ * options including the local option for a tag cache.
+ *
+ * @param string $name
+ * @return mixed
+ */
+ public function getOption($name)
+ {
+ $name = strtolower($name);
+
+ if ($name == 'tag_cache') {
+ return $this->getInnerCache();
+ }
+
+ return parent::getOption($name);
+ }
+
+ /**
+ * Test if a cache is available for the given id and (if yes) return it (false else)
+ *
+ * Note : return value is always "string" (unserialization is done by the core not by the backend)
+ *
+ * @param string $id Cache id
+ * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
+ * @return string|false cached datas
+ */
+ public function load($id, $doNotTestCacheValidity = false)
+ {
+ if (($id = (string)$id) === '') {
+ $id = $this->_detectId();
+ } else {
+ $id = $this->_decodeId($id);
+ }
+ if (!$this->_verifyPath($id)) {
+ Zend_Cache::throwException('Invalid cache id: does not match expected public_dir path');
+ }
+ if ($doNotTestCacheValidity) {
+ $this->_log("Zend_Cache_Backend_Static::load() : \$doNotTestCacheValidity=true is unsupported by the Static backend");
+ }
+
+ $fileName = basename($id);
+ if ($fileName === '') {
+ $fileName = $this->_options['index_filename'];
+ }
+ $pathName = $this->_options['public_dir'] . dirname($id);
+ $file = rtrim($pathName, '/') . '/' . $fileName . $this->_options['file_extension'];
+ if (file_exists($file)) {
+ $content = file_get_contents($file);
+ return $content;
+ }
+
+ return false;
+ }
+
+ /**
+ * Test if a cache is available or not (for the given id)
+ *
+ * @param string $id cache id
+ * @return bool
+ */
+ public function test($id)
+ {
+ $id = $this->_decodeId($id);
+ if (!$this->_verifyPath($id)) {
+ Zend_Cache::throwException('Invalid cache id: does not match expected public_dir path');
+ }
+
+ $fileName = basename($id);
+ if ($fileName === '') {
+ $fileName = $this->_options['index_filename'];
+ }
+ if ($this->_tagged === null && $tagged = $this->getInnerCache()->load(self::INNER_CACHE_NAME)) {
+ $this->_tagged = $tagged;
+ } elseif (!$this->_tagged) {
+ return false;
+ }
+ $pathName = $this->_options['public_dir'] . dirname($id);
+
+ // Switch extension if needed
+ if (isset($this->_tagged[$id])) {
+ $extension = $this->_tagged[$id]['extension'];
+ } else {
+ $extension = $this->_options['file_extension'];
+ }
+ $file = $pathName . '/' . $fileName . $extension;
+ if (file_exists($file)) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Save some string datas into a cache record
+ *
+ * Note : $data is always "string" (serialization is done by the
+ * core not by the backend)
+ *
+ * @param string $data Datas to cache
+ * @param string $id Cache id
+ * @param array $tags Array of strings, the cache record will be tagged by each string entry
+ * @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
+ * @return boolean true if no problem
+ */
+ public function save($data, $id, $tags = array(), $specificLifetime = false)
+ {
+ if ($this->_options['disable_caching']) {
+ return true;
+ }
+ $extension = null;
+ if ($this->_isSerialized($data)) {
+ $data = unserialize($data);
+ $extension = '.' . ltrim($data[1], '.');
+ $data = $data[0];
+ }
+
+ clearstatcache();
+ if (($id = (string)$id) === '') {
+ $id = $this->_detectId();
+ } else {
+ $id = $this->_decodeId($id);
+ }
+
+ $fileName = basename($id);
+ if ($fileName === '') {
+ $fileName = $this->_options['index_filename'];
+ }
+
+ $pathName = realpath($this->_options['public_dir']) . dirname($id);
+ $this->_createDirectoriesFor($pathName);
+
+ if ($id === null || strlen($id) == 0) {
+ $dataUnserialized = unserialize($data);
+ $data = $dataUnserialized['data'];
+ }
+ $ext = $this->_options['file_extension'];
+ if ($extension) $ext = $extension;
+ $file = rtrim($pathName, '/') . '/' . $fileName . $ext;
+ if ($this->_options['file_locking']) {
+ $result = file_put_contents($file, $data, LOCK_EX);
+ } else {
+ $result = file_put_contents($file, $data);
+ }
+ @chmod($file, $this->_octdec($this->_options['cache_file_perm']));
+
+ if ($this->_tagged === null && $tagged = $this->getInnerCache()->load(self::INNER_CACHE_NAME)) {
+ $this->_tagged = $tagged;
+ } elseif ($this->_tagged === null) {
+ $this->_tagged = array();
+ }
+ if (!isset($this->_tagged[$id])) {
+ $this->_tagged[$id] = array();
+ }
+ if (!isset($this->_tagged[$id]['tags'])) {
+ $this->_tagged[$id]['tags'] = array();
+ }
+ $this->_tagged[$id]['tags'] = array_unique(array_merge($this->_tagged[$id]['tags'], $tags));
+ $this->_tagged[$id]['extension'] = $ext;
+ $this->getInnerCache()->save($this->_tagged, self::INNER_CACHE_NAME);
+ return (bool) $result;
+ }
+
+ /**
+ * Recursively create the directories needed to write the static file
+ */
+ protected function _createDirectoriesFor($path)
+ {
+ if (!is_dir($path)) {
+ $oldUmask = umask(0);
+ if ( !@mkdir($path, $this->_octdec($this->_options['cache_directory_perm']), true)) {
+ $lastErr = error_get_last();
+ umask($oldUmask);
+ Zend_Cache::throwException("Can't create directory: {$lastErr['message']}");
+ }
+ umask($oldUmask);
+ }
+ }
+
+ /**
+ * Detect serialization of data (cannot predict since this is the only way
+ * to obey the interface yet pass in another parameter).
+ *
+ * In future, ZF 2.0, check if we can just avoid the interface restraints.
+ *
+ * This format is the only valid one possible for the class, so it's simple
+ * to just run a regular expression for the starting serialized format.
+ */
+ protected function _isSerialized($data)
+ {
+ return preg_match("/a:2:\{i:0;s:\d+:\"/", $data);
+ }
+
+ /**
+ * Remove a cache record
+ *
+ * @param string $id Cache id
+ * @return boolean True if no problem
+ */
+ public function remove($id)
+ {
+ if (!$this->_verifyPath($id)) {
+ Zend_Cache::throwException('Invalid cache id: does not match expected public_dir path');
+ }
+ $fileName = basename($id);
+ if ($this->_tagged === null && $tagged = $this->getInnerCache()->load(self::INNER_CACHE_NAME)) {
+ $this->_tagged = $tagged;
+ } elseif (!$this->_tagged) {
+ return false;
+ }
+ if (isset($this->_tagged[$id])) {
+ $extension = $this->_tagged[$id]['extension'];
+ } else {
+ $extension = $this->_options['file_extension'];
+ }
+ if ($fileName === '') {
+ $fileName = $this->_options['index_filename'];
+ }
+ $pathName = $this->_options['public_dir'] . dirname($id);
+ $file = realpath($pathName) . '/' . $fileName . $extension;
+ if (!file_exists($file)) {
+ return false;
+ }
+ return unlink($file);
+ }
+
+ /**
+ * Remove a cache record recursively for the given directory matching a
+ * REQUEST_URI based relative path (deletes the actual file matching this
+ * in addition to the matching directory)
+ *
+ * @param string $id Cache id
+ * @return boolean True if no problem
+ */
+ public function removeRecursively($id)
+ {
+ if (!$this->_verifyPath($id)) {
+ Zend_Cache::throwException('Invalid cache id: does not match expected public_dir path');
+ }
+ $fileName = basename($id);
+ if ($fileName === '') {
+ $fileName = $this->_options['index_filename'];
+ }
+ $pathName = $this->_options['public_dir'] . dirname($id);
+ $file = $pathName . '/' . $fileName . $this->_options['file_extension'];
+ $directory = $pathName . '/' . $fileName;
+ if (file_exists($directory)) {
+ if (!is_writable($directory)) {
+ return false;
+ }
+ if (is_dir($directory)) {
+ foreach (new DirectoryIterator($directory) as $file) {
+ if (true === $file->isFile()) {
+ if (false === unlink($file->getPathName())) {
+ return false;
+ }
+ }
+ }
+ }
+ rmdir($directory);
+ }
+ if (file_exists($file)) {
+ if (!is_writable($file)) {
+ return false;
+ }
+ return unlink($file);
+ }
+ return true;
+ }
+
+ /**
+ * Clean some cache records
+ *
+ * Available modes are :
+ * Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)
+ * Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used)
+ * Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags
+ * ($tags can be an array of strings or a single string)
+ * Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags}
+ * ($tags can be an array of strings or a single string)
+ * Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags
+ * ($tags can be an array of strings or a single string)
+ *
+ * @param string $mode Clean mode
+ * @param array $tags Array of tags
+ * @return boolean true if no problem
+ * @throws Zend_Exception
+ */
+ public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
+ {
+ $result = false;
+ switch ($mode) {
+ case Zend_Cache::CLEANING_MODE_MATCHING_TAG:
+ case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG:
+ if (empty($tags)) {
+ throw new Zend_Exception('Cannot use tag matching modes as no tags were defined');
+ }
+ if ($this->_tagged === null && $tagged = $this->getInnerCache()->load(self::INNER_CACHE_NAME)) {
+ $this->_tagged = $tagged;
+ } elseif (!$this->_tagged) {
+ return true;
+ }
+ foreach ($tags as $tag) {
+ $urls = array_keys($this->_tagged);
+ foreach ($urls as $url) {
+ if (isset($this->_tagged[$url]['tags']) && in_array($tag, $this->_tagged[$url]['tags'])) {
+ $this->remove($url);
+ unset($this->_tagged[$url]);
+ }
+ }
+ }
+ $this->getInnerCache()->save($this->_tagged, self::INNER_CACHE_NAME);
+ $result = true;
+ break;
+ case Zend_Cache::CLEANING_MODE_ALL:
+ if ($this->_tagged === null) {
+ $tagged = $this->getInnerCache()->load(self::INNER_CACHE_NAME);
+ $this->_tagged = $tagged;
+ }
+ if ($this->_tagged === null || empty($this->_tagged)) {
+ return true;
+ }
+ $urls = array_keys($this->_tagged);
+ foreach ($urls as $url) {
+ $this->remove($url);
+ unset($this->_tagged[$url]);
+ }
+ $this->getInnerCache()->save($this->_tagged, self::INNER_CACHE_NAME);
+ $result = true;
+ break;
+ case Zend_Cache::CLEANING_MODE_OLD:
+ $this->_log("Zend_Cache_Backend_Static : Selected Cleaning Mode Currently Unsupported By This Backend");
+ break;
+ case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG:
+ if (empty($tags)) {
+ throw new Zend_Exception('Cannot use tag matching modes as no tags were defined');
+ }
+ if ($this->_tagged === null) {
+ $tagged = $this->getInnerCache()->load(self::INNER_CACHE_NAME);
+ $this->_tagged = $tagged;
+ }
+ if ($this->_tagged === null || empty($this->_tagged)) {
+ return true;
+ }
+ $urls = array_keys($this->_tagged);
+ foreach ($urls as $url) {
+ $difference = array_diff($tags, $this->_tagged[$url]['tags']);
+ if (count($tags) == count($difference)) {
+ $this->remove($url);
+ unset($this->_tagged[$url]);
+ }
+ }
+ $this->getInnerCache()->save($this->_tagged, self::INNER_CACHE_NAME);
+ $result = true;
+ break;
+ default:
+ Zend_Cache::throwException('Invalid mode for clean() method');
+ break;
+ }
+ return $result;
+ }
+
+ /**
+ * Set an Inner Cache, used here primarily to store Tags associated
+ * with caches created by this backend. Note: If Tags are lost, the cache
+ * should be completely cleaned as the mapping of tags to caches will
+ * have been irrevocably lost.
+ *
+ * @param Zend_Cache_Core
+ * @return void
+ */
+ public function setInnerCache(Zend_Cache_Core $cache)
+ {
+ $this->_tagCache = $cache;
+ $this->_options['tag_cache'] = $cache;
+ }
+
+ /**
+ * Get the Inner Cache if set
+ *
+ * @return Zend_Cache_Core
+ */
+ public function getInnerCache()
+ {
+ if ($this->_tagCache === null) {
+ Zend_Cache::throwException('An Inner Cache has not been set; use setInnerCache()');
+ }
+ return $this->_tagCache;
+ }
+
+ /**
+ * Verify path exists and is non-empty
+ *
+ * @param string $path
+ * @return bool
+ */
+ protected function _verifyPath($path)
+ {
+ $path = realpath($path);
+ $base = realpath($this->_options['public_dir']);
+ return strncmp($path, $base, strlen($base)) !== 0;
+ }
+
+ /**
+ * Determine the page to save from the request
+ *
+ * @return string
+ */
+ protected function _detectId()
+ {
+ return $_SERVER['REQUEST_URI'];
+ }
+
+ /**
+ * Validate a cache id or a tag (security, reliable filenames, reserved prefixes...)
+ *
+ * Throw an exception if a problem is found
+ *
+ * @param string $string Cache id or tag
+ * @throws Zend_Cache_Exception
+ * @return void
+ * @deprecated Not usable until perhaps ZF 2.0
+ */
+ protected static function _validateIdOrTag($string)
+ {
+ if (!is_string($string)) {
+ Zend_Cache::throwException('Invalid id or tag : must be a string');
+ }
+
+ // Internal only checked in Frontend - not here!
+ if (substr($string, 0, 9) == 'internal-') {
+ return;
+ }
+
+ // Validation assumes no query string, fragments or scheme included - only the path
+ if (!preg_match(
+ '/^(?:\/(?:(?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*\'()\[\]:@&=+$,;])*)?)+$/',
+ $string
+ )
+ ) {
+ Zend_Cache::throwException("Invalid id or tag '$string' : must be a valid URL path");
+ }
+ }
+
+ /**
+ * Detect an octal string and return its octal value for file permission ops
+ * otherwise return the non-string (assumed octal or decimal int already)
+ *
+ * @param string $val The potential octal in need of conversion
+ * @return int
+ */
+ protected function _octdec($val)
+ {
+ if (is_string($val) && decoct(octdec($val)) == $val) {
+ return octdec($val);
+ }
+ return $val;
+ }
+
+ /**
+ * Decode a request URI from the provided ID
+ *
+ * @param string $id
+ * @return string
+ */
+ protected function _decodeId($id)
+ {
+ return pack('H*', $id);
+ }
+}
diff --git a/library/vendor/Zend/Cache/Backend/Test.php b/library/vendor/Zend/Cache/Backend/Test.php
new file mode 100644
index 0000000..c06f959
--- /dev/null
+++ b/library/vendor/Zend/Cache/Backend/Test.php
@@ -0,0 +1,414 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Cache_Backend_Interface
+ */
+
+/**
+ * @see Zend_Cache_Backend
+ */
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Backend_Test extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface
+{
+ /**
+ * Available options
+ *
+ * @var array available options
+ */
+ protected $_options = array();
+
+ /**
+ * Frontend or Core directives
+ *
+ * @var array directives
+ */
+ protected $_directives = array();
+
+ /**
+ * Array to log actions
+ *
+ * @var array $_log
+ */
+ private $_log = array();
+
+ /**
+ * Current index for log array
+ *
+ * @var int $_index
+ */
+ private $_index = 0;
+
+ /**
+ * Constructor
+ *
+ * @param array $options associative array of options
+ * @return void
+ */
+ public function __construct($options = array())
+ {
+ $this->_addLog('construct', array($options));
+ }
+
+ /**
+ * Set the frontend directives
+ *
+ * @param array $directives assoc of directives
+ * @return void
+ */
+ public function setDirectives($directives)
+ {
+ $this->_addLog('setDirectives', array($directives));
+ }
+
+ /**
+ * Test if a cache is available for the given id and (if yes) return it (false else)
+ *
+ * For this test backend only, if $id == 'false', then the method will return false
+ * if $id == 'serialized', the method will return a serialized array
+ * ('foo' else)
+ *
+ * @param string $id Cache id
+ * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
+ * @return string Cached datas (or false)
+ */
+ public function load($id, $doNotTestCacheValidity = false)
+ {
+ $this->_addLog('get', array($id, $doNotTestCacheValidity));
+
+ if ( $id == 'false'
+ || $id == 'd8523b3ee441006261eeffa5c3d3a0a7'
+ || $id == 'e83249ea22178277d5befc2c5e2e9ace'
+ || $id == '40f649b94977c0a6e76902e2a0b43587'
+ || $id == '88161989b73a4cbfd0b701c446115a99'
+ || $id == '205fc79cba24f0f0018eb92c7c8b3ba4'
+ || $id == '170720e35f38150b811f68a937fb042d')
+ {
+ return false;
+ }
+ if ($id=='serialized') {
+ return serialize(array('foo'));
+ }
+ if ($id=='serialized2') {
+ return serialize(array('headers' => array(), 'data' => 'foo'));
+ }
+ if ( $id == '71769f39054f75894288e397df04e445' || $id == '615d222619fb20b527168340cebd0578'
+ || $id == '8a02d218a5165c467e7a5747cc6bd4b6' || $id == '648aca1366211d17cbf48e65dc570bee'
+ || $id == '4a923ef02d7f997ca14d56dfeae25ea7') {
+ return serialize(array('foo', 'bar'));
+ }
+ if ( $id == 'f53c7d912cc523d9a65834c8286eceb9') {
+ return serialize(array('foobar'));
+ }
+ return 'foo';
+ }
+
+ /**
+ * Test if a cache is available or not (for the given id)
+ *
+ * For this test backend only, if $id == 'false', then the method will return false
+ * (123456 else)
+ *
+ * @param string $id Cache id
+ * @return mixed|false false (a cache is not available) or "last modified" timestamp (int) of the available cache record
+ */
+ public function test($id)
+ {
+ $this->_addLog('test', array($id));
+ if ($id=='false') {
+ return false;
+ }
+ if (($id=='3c439c922209e2cb0b54d6deffccd75a')) {
+ return false;
+ }
+ return 123456;
+ }
+
+ /**
+ * Save some string datas into a cache record
+ *
+ * For this test backend only, if $id == 'false', then the method will return false
+ * (true else)
+ *
+ * @param string $data Datas to cache
+ * @param string $id Cache id
+ * @param array $tags Array of strings, the cache record will be tagged by each string entry
+ * @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
+ * @return boolean True if no problem
+ */
+ public function save($data, $id, $tags = array(), $specificLifetime = false)
+ {
+ $this->_addLog('save', array($data, $id, $tags));
+ if (substr($id,-5)=='false') {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Remove a cache record
+ *
+ * For this test backend only, if $id == 'false', then the method will return false
+ * (true else)
+ *
+ * @param string $id Cache id
+ * @return boolean True if no problem
+ */
+ public function remove($id)
+ {
+ $this->_addLog('remove', array($id));
+ if (substr($id,-5)=='false') {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Clean some cache records
+ *
+ * For this test backend only, if $mode == 'false', then the method will return false
+ * (true else)
+ *
+ * Available modes are :
+ * Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)
+ * Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used)
+ * Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags
+ * ($tags can be an array of strings or a single string)
+ * Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags}
+ * ($tags can be an array of strings or a single string)
+ *
+ * @param string $mode Clean mode
+ * @param array $tags Array of tags
+ * @return boolean True if no problem
+ */
+ public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
+ {
+ $this->_addLog('clean', array($mode, $tags));
+ if ($mode=='false') {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Get the last log
+ *
+ * @return string The last log
+ */
+ public function getLastLog()
+ {
+ return $this->_log[$this->_index - 1];
+ }
+
+ /**
+ * Get the log index
+ *
+ * @return int Log index
+ */
+ public function getLogIndex()
+ {
+ return $this->_index;
+ }
+
+ /**
+ * Get the complete log array
+ *
+ * @return array Complete log array
+ */
+ public function getAllLogs()
+ {
+ return $this->_log;
+ }
+
+ /**
+ * Return true if the automatic cleaning is available for the backend
+ *
+ * @return boolean
+ */
+ public function isAutomaticCleaningAvailable()
+ {
+ return true;
+ }
+
+ /**
+ * Return an array of stored cache ids
+ *
+ * @return array array of stored cache ids (string)
+ */
+ public function getIds()
+ {
+ return array(
+ 'prefix_id1', 'prefix_id2'
+ );
+ }
+
+ /**
+ * Return an array of stored tags
+ *
+ * @return array array of stored tags (string)
+ */
+ public function getTags()
+ {
+ return array(
+ 'tag1', 'tag2'
+ );
+ }
+
+ /**
+ * Return an array of stored cache ids which match given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of matching cache ids (string)
+ */
+ public function getIdsMatchingTags($tags = array())
+ {
+ if ($tags == array('tag1', 'tag2')) {
+ return array('prefix_id1', 'prefix_id2');
+ }
+
+ return array();
+ }
+
+ /**
+ * Return an array of stored cache ids which don't match given tags
+ *
+ * In case of multiple tags, a logical OR is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of not matching cache ids (string)
+ */
+ public function getIdsNotMatchingTags($tags = array())
+ {
+ if ($tags == array('tag3', 'tag4')) {
+ return array('prefix_id3', 'prefix_id4');
+ }
+
+ return array();
+ }
+
+ /**
+ * Return an array of stored cache ids which match any given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of any matching cache ids (string)
+ */
+ public function getIdsMatchingAnyTags($tags = array())
+ {
+ if ($tags == array('tag5', 'tag6')) {
+ return array('prefix_id5', 'prefix_id6');
+ }
+
+ return array();
+ }
+
+ /**
+ * Return the filling percentage of the backend storage
+ *
+ * @return int integer between 0 and 100
+ */
+ public function getFillingPercentage()
+ {
+ return 50;
+ }
+
+ /**
+ * Return an array of metadatas for the given cache id
+ *
+ * The array must include these keys :
+ * - expire : the expire timestamp
+ * - tags : a string array of tags
+ * - mtime : timestamp of last modification time
+ *
+ * @param string $id cache id
+ * @return array array of metadatas (false if the cache id is not found)
+ */
+ public function getMetadatas($id)
+ {
+ return false;
+ }
+
+ /**
+ * Give (if possible) an extra lifetime to the given cache id
+ *
+ * @param string $id cache id
+ * @param int $extraLifetime
+ * @return boolean true if ok
+ */
+ public function touch($id, $extraLifetime)
+ {
+ return true;
+ }
+
+ /**
+ * Return an associative array of capabilities (booleans) of the backend
+ *
+ * The array must include these keys :
+ * - automatic_cleaning (is automating cleaning necessary)
+ * - tags (are tags supported)
+ * - expired_read (is it possible to read expired cache records
+ * (for doNotTestCacheValidity option for example))
+ * - priority does the backend deal with priority when saving
+ * - infinite_lifetime (is infinite lifetime can work with this backend)
+ * - get_list (is it possible to get the list of cache ids and the complete list of tags)
+ *
+ * @return array associative of with capabilities
+ */
+ public function getCapabilities()
+ {
+ return array(
+ 'automatic_cleaning' => true,
+ 'tags' => true,
+ 'expired_read' => false,
+ 'priority' => true,
+ 'infinite_lifetime' => true,
+ 'get_list' => true
+ );
+ }
+
+ /**
+ * Add an event to the log array
+ *
+ * @param string $methodName MethodName
+ * @param array $args Arguments
+ * @return void
+ */
+ private function _addLog($methodName, $args)
+ {
+ $this->_log[$this->_index] = array(
+ 'methodName' => $methodName,
+ 'args' => $args
+ );
+ $this->_index = $this->_index + 1;
+ }
+
+}
diff --git a/library/vendor/Zend/Cache/Backend/TwoLevels.php b/library/vendor/Zend/Cache/Backend/TwoLevels.php
new file mode 100644
index 0000000..1e6792b
--- /dev/null
+++ b/library/vendor/Zend/Cache/Backend/TwoLevels.php
@@ -0,0 +1,546 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Cache_Backend_ExtendedInterface
+ */
+
+/**
+ * @see Zend_Cache_Backend
+ */
+
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+class Zend_Cache_Backend_TwoLevels extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface
+{
+ /**
+ * Available options
+ *
+ * =====> (string) slow_backend :
+ * - Slow backend name
+ * - Must implement the Zend_Cache_Backend_ExtendedInterface
+ * - Should provide a big storage
+ *
+ * =====> (string) fast_backend :
+ * - Flow backend name
+ * - Must implement the Zend_Cache_Backend_ExtendedInterface
+ * - Must be much faster than slow_backend
+ *
+ * =====> (array) slow_backend_options :
+ * - Slow backend options (see corresponding backend)
+ *
+ * =====> (array) fast_backend_options :
+ * - Fast backend options (see corresponding backend)
+ *
+ * =====> (int) stats_update_factor :
+ * - Disable / Tune the computation of the fast backend filling percentage
+ * - When saving a record into cache :
+ * 1 => systematic computation of the fast backend filling percentage
+ * x (integer) > 1 => computation of the fast backend filling percentage randomly 1 times on x cache write
+ *
+ * =====> (boolean) slow_backend_custom_naming :
+ * =====> (boolean) fast_backend_custom_naming :
+ * =====> (boolean) slow_backend_autoload :
+ * =====> (boolean) fast_backend_autoload :
+ * - See Zend_Cache::factory() method
+ *
+ * =====> (boolean) auto_fill_fast_cache
+ * - If true, automatically fill the fast cache when a cache record was not found in fast cache, but did
+ * exist in slow cache. This can be usefull when a non-persistent cache like APC or Memcached got
+ * purged for whatever reason.
+ *
+ * =====> (boolean) auto_refresh_fast_cache
+ * - If true, auto refresh the fast cache when a cache record is hit
+ *
+ * @var array available options
+ */
+ protected $_options = array(
+ 'slow_backend' => 'File',
+ 'fast_backend' => 'Apc',
+ 'slow_backend_options' => array(),
+ 'fast_backend_options' => array(),
+ 'stats_update_factor' => 10,
+ 'slow_backend_custom_naming' => false,
+ 'fast_backend_custom_naming' => false,
+ 'slow_backend_autoload' => false,
+ 'fast_backend_autoload' => false,
+ 'auto_fill_fast_cache' => true,
+ 'auto_refresh_fast_cache' => true
+ );
+
+ /**
+ * Slow Backend
+ *
+ * @var Zend_Cache_Backend_ExtendedInterface
+ */
+ protected $_slowBackend;
+
+ /**
+ * Fast Backend
+ *
+ * @var Zend_Cache_Backend_ExtendedInterface
+ */
+ protected $_fastBackend;
+
+ /**
+ * Cache for the fast backend filling percentage
+ *
+ * @var int
+ */
+ protected $_fastBackendFillingPercentage = null;
+
+ /**
+ * Constructor
+ *
+ * @param array $options Associative array of options
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ public function __construct(array $options = array())
+ {
+ parent::__construct($options);
+
+ if ($this->_options['slow_backend'] === null) {
+ Zend_Cache::throwException('slow_backend option has to set');
+ } elseif ($this->_options['slow_backend'] instanceof Zend_Cache_Backend_ExtendedInterface) {
+ $this->_slowBackend = $this->_options['slow_backend'];
+ } else {
+ $this->_slowBackend = Zend_Cache::_makeBackend(
+ $this->_options['slow_backend'],
+ $this->_options['slow_backend_options'],
+ $this->_options['slow_backend_custom_naming'],
+ $this->_options['slow_backend_autoload']
+ );
+ if (!in_array('Zend_Cache_Backend_ExtendedInterface', class_implements($this->_slowBackend))) {
+ Zend_Cache::throwException('slow_backend must implement the Zend_Cache_Backend_ExtendedInterface interface');
+ }
+ }
+
+ if ($this->_options['fast_backend'] === null) {
+ Zend_Cache::throwException('fast_backend option has to set');
+ } elseif ($this->_options['fast_backend'] instanceof Zend_Cache_Backend_ExtendedInterface) {
+ $this->_fastBackend = $this->_options['fast_backend'];
+ } else {
+ $this->_fastBackend = Zend_Cache::_makeBackend(
+ $this->_options['fast_backend'],
+ $this->_options['fast_backend_options'],
+ $this->_options['fast_backend_custom_naming'],
+ $this->_options['fast_backend_autoload']
+ );
+ if (!in_array('Zend_Cache_Backend_ExtendedInterface', class_implements($this->_fastBackend))) {
+ Zend_Cache::throwException('fast_backend must implement the Zend_Cache_Backend_ExtendedInterface interface');
+ }
+ }
+
+ $this->_slowBackend->setDirectives($this->_directives);
+ $this->_fastBackend->setDirectives($this->_directives);
+ }
+
+ /**
+ * Test if a cache is available or not (for the given id)
+ *
+ * @param string $id cache id
+ * @return mixed|false (a cache is not available) or "last modified" timestamp (int) of the available cache record
+ */
+ public function test($id)
+ {
+ $fastTest = $this->_fastBackend->test($id);
+ if ($fastTest) {
+ return $fastTest;
+ } else {
+ return $this->_slowBackend->test($id);
+ }
+ }
+
+ /**
+ * Save some string datas into a cache record
+ *
+ * Note : $data is always "string" (serialization is done by the
+ * core not by the backend)
+ *
+ * @param string $data Datas to cache
+ * @param string $id Cache id
+ * @param array $tags Array of strings, the cache record will be tagged by each string entry
+ * @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
+ * @param int $priority integer between 0 (very low priority) and 10 (maximum priority) used by some particular backends
+ * @return boolean true if no problem
+ */
+ public function save($data, $id, $tags = array(), $specificLifetime = false, $priority = 8)
+ {
+ $usage = $this->_getFastFillingPercentage('saving');
+ $boolFast = true;
+ $lifetime = $this->getLifetime($specificLifetime);
+ $preparedData = $this->_prepareData($data, $lifetime, $priority);
+ if (($priority > 0) && (10 * $priority >= $usage)) {
+ $fastLifetime = $this->_getFastLifetime($lifetime, $priority);
+ $boolFast = $this->_fastBackend->save($preparedData, $id, array(), $fastLifetime);
+ $boolSlow = $this->_slowBackend->save($preparedData, $id, $tags, $lifetime);
+ } else {
+ $boolSlow = $this->_slowBackend->save($preparedData, $id, $tags, $lifetime);
+ if ($boolSlow === true) {
+ $boolFast = $this->_fastBackend->remove($id);
+ if (!$boolFast && !$this->_fastBackend->test($id)) {
+ // some backends return false on remove() even if the key never existed. (and it won't if fast is full)
+ // all we care about is that the key doesn't exist now
+ $boolFast = true;
+ }
+ }
+ }
+
+ return ($boolFast && $boolSlow);
+ }
+
+ /**
+ * Test if a cache is available for the given id and (if yes) return it (false else)
+ *
+ * Note : return value is always "string" (unserialization is done by the core not by the backend)
+ *
+ * @param string $id Cache id
+ * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
+ * @return string|false cached datas
+ */
+ public function load($id, $doNotTestCacheValidity = false)
+ {
+ $resultFast = $this->_fastBackend->load($id, $doNotTestCacheValidity);
+ if ($resultFast === false) {
+ $resultSlow = $this->_slowBackend->load($id, $doNotTestCacheValidity);
+ if ($resultSlow === false) {
+ // there is no cache at all for this id
+ return false;
+ }
+ }
+ $array = $resultFast !== false ? unserialize($resultFast) : unserialize($resultSlow);
+
+ //In case no cache entry was found in the FastCache and auto-filling is enabled, copy data to FastCache
+ if ($resultFast === false && $this->_options['auto_fill_fast_cache']) {
+ $preparedData = $this->_prepareData($array['data'], $array['lifetime'], $array['priority']);
+ $this->_fastBackend->save($preparedData, $id, array(), $array['lifetime']);
+ }
+ // maybe, we have to refresh the fast cache ?
+ elseif ($this->_options['auto_refresh_fast_cache']) {
+ if ($array['priority'] == 10) {
+ // no need to refresh the fast cache with priority = 10
+ return $array['data'];
+ }
+ $newFastLifetime = $this->_getFastLifetime($array['lifetime'], $array['priority'], time() - $array['expire']);
+ // we have the time to refresh the fast cache
+ $usage = $this->_getFastFillingPercentage('loading');
+ if (($array['priority'] > 0) && (10 * $array['priority'] >= $usage)) {
+ // we can refresh the fast cache
+ $preparedData = $this->_prepareData($array['data'], $array['lifetime'], $array['priority']);
+ $this->_fastBackend->save($preparedData, $id, array(), $newFastLifetime);
+ }
+ }
+ return $array['data'];
+ }
+
+ /**
+ * Remove a cache record
+ *
+ * @param string $id Cache id
+ * @return boolean True if no problem
+ */
+ public function remove($id)
+ {
+ $boolFast = $this->_fastBackend->remove($id);
+ $boolSlow = $this->_slowBackend->remove($id);
+ return $boolFast && $boolSlow;
+ }
+
+ /**
+ * Clean some cache records
+ *
+ * Available modes are :
+ * Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)
+ * Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used)
+ * Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags
+ * ($tags can be an array of strings or a single string)
+ * Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => remove cache entries not {matching one of the given tags}
+ * ($tags can be an array of strings or a single string)
+ * Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags
+ * ($tags can be an array of strings or a single string)
+ *
+ * @param string $mode Clean mode
+ * @param array $tags Array of tags
+ * @throws Zend_Cache_Exception
+ * @return boolean true if no problem
+ */
+ public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
+ {
+ switch($mode) {
+ case Zend_Cache::CLEANING_MODE_ALL:
+ $boolFast = $this->_fastBackend->clean(Zend_Cache::CLEANING_MODE_ALL);
+ $boolSlow = $this->_slowBackend->clean(Zend_Cache::CLEANING_MODE_ALL);
+ return $boolFast && $boolSlow;
+ break;
+ case Zend_Cache::CLEANING_MODE_OLD:
+ return $this->_slowBackend->clean(Zend_Cache::CLEANING_MODE_OLD);
+ case Zend_Cache::CLEANING_MODE_MATCHING_TAG:
+ $ids = $this->_slowBackend->getIdsMatchingTags($tags);
+ $res = true;
+ foreach ($ids as $id) {
+ $bool = $this->remove($id);
+ $res = $res && $bool;
+ }
+ return $res;
+ break;
+ case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG:
+ $ids = $this->_slowBackend->getIdsNotMatchingTags($tags);
+ $res = true;
+ foreach ($ids as $id) {
+ $bool = $this->remove($id);
+ $res = $res && $bool;
+ }
+ return $res;
+ break;
+ case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG:
+ $ids = $this->_slowBackend->getIdsMatchingAnyTags($tags);
+ $res = true;
+ foreach ($ids as $id) {
+ $bool = $this->remove($id);
+ $res = $res && $bool;
+ }
+ return $res;
+ break;
+ default:
+ Zend_Cache::throwException('Invalid mode for clean() method');
+ break;
+ }
+ }
+
+ /**
+ * Return an array of stored cache ids
+ *
+ * @return array array of stored cache ids (string)
+ */
+ public function getIds()
+ {
+ return $this->_slowBackend->getIds();
+ }
+
+ /**
+ * Return an array of stored tags
+ *
+ * @return array array of stored tags (string)
+ */
+ public function getTags()
+ {
+ return $this->_slowBackend->getTags();
+ }
+
+ /**
+ * Return an array of stored cache ids which match given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of matching cache ids (string)
+ */
+ public function getIdsMatchingTags($tags = array())
+ {
+ return $this->_slowBackend->getIdsMatchingTags($tags);
+ }
+
+ /**
+ * Return an array of stored cache ids which don't match given tags
+ *
+ * In case of multiple tags, a logical OR is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of not matching cache ids (string)
+ */
+ public function getIdsNotMatchingTags($tags = array())
+ {
+ return $this->_slowBackend->getIdsNotMatchingTags($tags);
+ }
+
+ /**
+ * Return an array of stored cache ids which match any given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of any matching cache ids (string)
+ */
+ public function getIdsMatchingAnyTags($tags = array())
+ {
+ return $this->_slowBackend->getIdsMatchingAnyTags($tags);
+ }
+
+ /**
+ * Return the filling percentage of the backend storage
+ *
+ * @return int integer between 0 and 100
+ */
+ public function getFillingPercentage()
+ {
+ return $this->_slowBackend->getFillingPercentage();
+ }
+
+ /**
+ * Return an array of metadatas for the given cache id
+ *
+ * The array must include these keys :
+ * - expire : the expire timestamp
+ * - tags : a string array of tags
+ * - mtime : timestamp of last modification time
+ *
+ * @param string $id cache id
+ * @return array array of metadatas (false if the cache id is not found)
+ */
+ public function getMetadatas($id)
+ {
+ return $this->_slowBackend->getMetadatas($id);
+ }
+
+ /**
+ * Give (if possible) an extra lifetime to the given cache id
+ *
+ * @param string $id cache id
+ * @param int $extraLifetime
+ * @return boolean true if ok
+ */
+ public function touch($id, $extraLifetime)
+ {
+ return $this->_slowBackend->touch($id, $extraLifetime);
+ }
+
+ /**
+ * Return an associative array of capabilities (booleans) of the backend
+ *
+ * The array must include these keys :
+ * - automatic_cleaning (is automating cleaning necessary)
+ * - tags (are tags supported)
+ * - expired_read (is it possible to read expired cache records
+ * (for doNotTestCacheValidity option for example))
+ * - priority does the backend deal with priority when saving
+ * - infinite_lifetime (is infinite lifetime can work with this backend)
+ * - get_list (is it possible to get the list of cache ids and the complete list of tags)
+ *
+ * @return array associative of with capabilities
+ */
+ public function getCapabilities()
+ {
+ $slowBackendCapabilities = $this->_slowBackend->getCapabilities();
+ return array(
+ 'automatic_cleaning' => $slowBackendCapabilities['automatic_cleaning'],
+ 'tags' => $slowBackendCapabilities['tags'],
+ 'expired_read' => $slowBackendCapabilities['expired_read'],
+ 'priority' => $slowBackendCapabilities['priority'],
+ 'infinite_lifetime' => $slowBackendCapabilities['infinite_lifetime'],
+ 'get_list' => $slowBackendCapabilities['get_list']
+ );
+ }
+
+ /**
+ * Prepare a serialized array to store datas and metadatas informations
+ *
+ * @param string $data data to store
+ * @param int $lifetime original lifetime
+ * @param int $priority priority
+ * @return string serialize array to store into cache
+ */
+ private function _prepareData($data, $lifetime, $priority)
+ {
+ $lt = $lifetime;
+ if ($lt === null) {
+ $lt = 9999999999;
+ }
+ return serialize(array(
+ 'data' => $data,
+ 'lifetime' => $lifetime,
+ 'expire' => time() + $lt,
+ 'priority' => $priority
+ ));
+ }
+
+ /**
+ * Compute and return the lifetime for the fast backend
+ *
+ * @param int $lifetime original lifetime
+ * @param int $priority priority
+ * @param int $maxLifetime maximum lifetime
+ * @return int lifetime for the fast backend
+ */
+ private function _getFastLifetime($lifetime, $priority, $maxLifetime = null)
+ {
+ if ($lifetime <= 0) {
+ // if no lifetime, we have an infinite lifetime
+ // we need to use arbitrary lifetimes
+ $fastLifetime = (int) (2592000 / (11 - $priority));
+ } else {
+ // prevent computed infinite lifetime (0) by ceil
+ $fastLifetime = (int) ceil($lifetime / (11 - $priority));
+ }
+
+ if ($maxLifetime >= 0 && $fastLifetime > $maxLifetime) {
+ return $maxLifetime;
+ }
+
+ return $fastLifetime;
+ }
+
+ /**
+ * PUBLIC METHOD FOR UNIT TESTING ONLY !
+ *
+ * Force a cache record to expire
+ *
+ * @param string $id cache id
+ */
+ public function ___expire($id)
+ {
+ $this->_fastBackend->remove($id);
+ $this->_slowBackend->___expire($id);
+ }
+
+ private function _getFastFillingPercentage($mode)
+ {
+
+ if ($mode == 'saving') {
+ // mode saving
+ if ($this->_fastBackendFillingPercentage === null) {
+ $this->_fastBackendFillingPercentage = $this->_fastBackend->getFillingPercentage();
+ } else {
+ $rand = rand(1, $this->_options['stats_update_factor']);
+ if ($rand == 1) {
+ // we force a refresh
+ $this->_fastBackendFillingPercentage = $this->_fastBackend->getFillingPercentage();
+ }
+ }
+ } else {
+ // mode loading
+ // we compute the percentage only if it's not available in cache
+ if ($this->_fastBackendFillingPercentage === null) {
+ $this->_fastBackendFillingPercentage = $this->_fastBackend->getFillingPercentage();
+ }
+ }
+ return $this->_fastBackendFillingPercentage;
+ }
+
+}
diff --git a/library/vendor/Zend/Cache/Backend/WinCache.php b/library/vendor/Zend/Cache/Backend/WinCache.php
new file mode 100644
index 0000000..c922280
--- /dev/null
+++ b/library/vendor/Zend/Cache/Backend/WinCache.php
@@ -0,0 +1,347 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Cache_Backend_Interface
+ */
+
+/**
+ * @see Zend_Cache_Backend
+ */
+
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Backend_WinCache extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface
+{
+ /**
+ * Log message
+ */
+ const TAGS_UNSUPPORTED_BY_CLEAN_OF_WINCACHE_BACKEND = 'Zend_Cache_Backend_WinCache::clean() : tags are unsupported by the WinCache backend';
+ const TAGS_UNSUPPORTED_BY_SAVE_OF_WINCACHE_BACKEND = 'Zend_Cache_Backend_WinCache::save() : tags are unsupported by the WinCache backend';
+
+ /**
+ * Constructor
+ *
+ * @param array $options associative array of options
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ public function __construct(array $options = array())
+ {
+ if (!extension_loaded('wincache')) {
+ Zend_Cache::throwException('The wincache extension must be loaded for using this backend !');
+ }
+ parent::__construct($options);
+ }
+
+ /**
+ * Test if a cache is available for the given id and (if yes) return it (false else)
+ *
+ * WARNING $doNotTestCacheValidity=true is unsupported by the WinCache backend
+ *
+ * @param string $id cache id
+ * @param boolean $doNotTestCacheValidity if set to true, the cache validity won't be tested
+ * @return string cached datas (or false)
+ */
+ public function load($id, $doNotTestCacheValidity = false)
+ {
+ $tmp = wincache_ucache_get($id);
+ if (is_array($tmp)) {
+ return $tmp[0];
+ }
+ return false;
+ }
+
+ /**
+ * Test if a cache is available or not (for the given id)
+ *
+ * @param string $id cache id
+ * @return mixed false (a cache is not available) or "last modified" timestamp (int) of the available cache record
+ */
+ public function test($id)
+ {
+ $tmp = wincache_ucache_get($id);
+ if (is_array($tmp)) {
+ return $tmp[1];
+ }
+ return false;
+ }
+
+ /**
+ * Save some string datas into a cache record
+ *
+ * Note : $data is always "string" (serialization is done by the
+ * core not by the backend)
+ *
+ * @param string $data datas to cache
+ * @param string $id cache id
+ * @param array $tags array of strings, the cache record will be tagged by each string entry
+ * @param int $specificLifetime if != false, set a specific lifetime for this cache record (null => infinite lifetime)
+ * @return boolean true if no problem
+ */
+ public function save($data, $id, $tags = array(), $specificLifetime = false)
+ {
+ $lifetime = $this->getLifetime($specificLifetime);
+ $result = wincache_ucache_set($id, array($data, time(), $lifetime), $lifetime);
+ if (count($tags) > 0) {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_WINCACHE_BACKEND);
+ }
+ return $result;
+ }
+
+ /**
+ * Remove a cache record
+ *
+ * @param string $id cache id
+ * @return boolean true if no problem
+ */
+ public function remove($id)
+ {
+ return wincache_ucache_delete($id);
+ }
+
+ /**
+ * Clean some cache records
+ *
+ * Available modes are :
+ * 'all' (default) => remove all cache entries ($tags is not used)
+ * 'old' => unsupported
+ * 'matchingTag' => unsupported
+ * 'notMatchingTag' => unsupported
+ * 'matchingAnyTag' => unsupported
+ *
+ * @param string $mode clean mode
+ * @param array $tags array of tags
+ * @throws Zend_Cache_Exception
+ * @return boolean true if no problem
+ */
+ public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
+ {
+ switch ($mode) {
+ case Zend_Cache::CLEANING_MODE_ALL:
+ return wincache_ucache_clear();
+ break;
+ case Zend_Cache::CLEANING_MODE_OLD:
+ $this->_log("Zend_Cache_Backend_WinCache::clean() : CLEANING_MODE_OLD is unsupported by the WinCache backend");
+ break;
+ case Zend_Cache::CLEANING_MODE_MATCHING_TAG:
+ case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG:
+ case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG:
+ $this->_log(self::TAGS_UNSUPPORTED_BY_CLEAN_OF_WINCACHE_BACKEND);
+ break;
+ default:
+ Zend_Cache::throwException('Invalid mode for clean() method');
+ break;
+ }
+ }
+
+ /**
+ * Return true if the automatic cleaning is available for the backend
+ *
+ * DEPRECATED : use getCapabilities() instead
+ *
+ * @deprecated
+ * @return boolean
+ */
+ public function isAutomaticCleaningAvailable()
+ {
+ return false;
+ }
+
+ /**
+ * Return the filling percentage of the backend storage
+ *
+ * @throws Zend_Cache_Exception
+ * @return int integer between 0 and 100
+ */
+ public function getFillingPercentage()
+ {
+ $mem = wincache_ucache_meminfo();
+ $memSize = $mem['memory_total'];
+ $memUsed = $memSize - $mem['memory_free'];
+ if ($memSize == 0) {
+ Zend_Cache::throwException('can\'t get WinCache memory size');
+ }
+ if ($memUsed > $memSize) {
+ return 100;
+ }
+ return ((int) (100. * ($memUsed / $memSize)));
+ }
+
+ /**
+ * Return an array of stored tags
+ *
+ * @return array array of stored tags (string)
+ */
+ public function getTags()
+ {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_WINCACHE_BACKEND);
+ return array();
+ }
+
+ /**
+ * Return an array of stored cache ids which match given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of matching cache ids (string)
+ */
+ public function getIdsMatchingTags($tags = array())
+ {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_WINCACHE_BACKEND);
+ return array();
+ }
+
+ /**
+ * Return an array of stored cache ids which don't match given tags
+ *
+ * In case of multiple tags, a logical OR is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of not matching cache ids (string)
+ */
+ public function getIdsNotMatchingTags($tags = array())
+ {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_WINCACHE_BACKEND);
+ return array();
+ }
+
+ /**
+ * Return an array of stored cache ids which match any given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of any matching cache ids (string)
+ */
+ public function getIdsMatchingAnyTags($tags = array())
+ {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_WINCACHE_BACKEND);
+ return array();
+ }
+
+ /**
+ * Return an array of stored cache ids
+ *
+ * @return array array of stored cache ids (string)
+ */
+ public function getIds()
+ {
+ $res = array();
+ $array = wincache_ucache_info();
+ $records = $array['ucache_entries'];
+ foreach ($records as $record) {
+ $res[] = $record['key_name'];
+ }
+ return $res;
+ }
+
+ /**
+ * Return an array of metadatas for the given cache id
+ *
+ * The array must include these keys :
+ * - expire : the expire timestamp
+ * - tags : a string array of tags
+ * - mtime : timestamp of last modification time
+ *
+ * @param string $id cache id
+ * @return array array of metadatas (false if the cache id is not found)
+ */
+ public function getMetadatas($id)
+ {
+ $tmp = wincache_ucache_get($id);
+ if (is_array($tmp)) {
+ $data = $tmp[0];
+ $mtime = $tmp[1];
+ if (!isset($tmp[2])) {
+ return false;
+ }
+ $lifetime = $tmp[2];
+ return array(
+ 'expire' => $mtime + $lifetime,
+ 'tags' => array(),
+ 'mtime' => $mtime
+ );
+ }
+ return false;
+ }
+
+ /**
+ * Give (if possible) an extra lifetime to the given cache id
+ *
+ * @param string $id cache id
+ * @param int $extraLifetime
+ * @return boolean true if ok
+ */
+ public function touch($id, $extraLifetime)
+ {
+ $tmp = wincache_ucache_get($id);
+ if (is_array($tmp)) {
+ $data = $tmp[0];
+ $mtime = $tmp[1];
+ if (!isset($tmp[2])) {
+ return false;
+ }
+ $lifetime = $tmp[2];
+ $newLifetime = $lifetime - (time() - $mtime) + $extraLifetime;
+ if ($newLifetime <=0) {
+ return false;
+ }
+ return wincache_ucache_set($id, array($data, time(), $newLifetime), $newLifetime);
+ }
+ return false;
+ }
+
+ /**
+ * Return an associative array of capabilities (booleans) of the backend
+ *
+ * The array must include these keys :
+ * - automatic_cleaning (is automating cleaning necessary)
+ * - tags (are tags supported)
+ * - expired_read (is it possible to read expired cache records
+ * (for doNotTestCacheValidity option for example))
+ * - priority does the backend deal with priority when saving
+ * - infinite_lifetime (is infinite lifetime can work with this backend)
+ * - get_list (is it possible to get the list of cache ids and the complete list of tags)
+ *
+ * @return array associative of with capabilities
+ */
+ public function getCapabilities()
+ {
+ return array(
+ 'automatic_cleaning' => false,
+ 'tags' => false,
+ 'expired_read' => false,
+ 'priority' => false,
+ 'infinite_lifetime' => false,
+ 'get_list' => true
+ );
+ }
+
+}
diff --git a/library/vendor/Zend/Cache/Backend/Xcache.php b/library/vendor/Zend/Cache/Backend/Xcache.php
new file mode 100644
index 0000000..d78d52d
--- /dev/null
+++ b/library/vendor/Zend/Cache/Backend/Xcache.php
@@ -0,0 +1,219 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Cache_Backend_Interface
+ */
+
+/**
+ * @see Zend_Cache_Backend
+ */
+
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Backend_Xcache extends Zend_Cache_Backend implements Zend_Cache_Backend_Interface
+{
+
+ /**
+ * Log message
+ */
+ const TAGS_UNSUPPORTED_BY_CLEAN_OF_XCACHE_BACKEND = 'Zend_Cache_Backend_Xcache::clean() : tags are unsupported by the Xcache backend';
+ const TAGS_UNSUPPORTED_BY_SAVE_OF_XCACHE_BACKEND = 'Zend_Cache_Backend_Xcache::save() : tags are unsupported by the Xcache backend';
+
+ /**
+ * Available options
+ *
+ * =====> (string) user :
+ * xcache.admin.user (necessary for the clean() method)
+ *
+ * =====> (string) password :
+ * xcache.admin.pass (clear, not MD5) (necessary for the clean() method)
+ *
+ * @var array available options
+ */
+ protected $_options = array(
+ 'user' => null,
+ 'password' => null
+ );
+
+ /**
+ * Constructor
+ *
+ * @param array $options associative array of options
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ public function __construct(array $options = array())
+ {
+ if (!extension_loaded('xcache')) {
+ Zend_Cache::throwException('The xcache extension must be loaded for using this backend !');
+ }
+ parent::__construct($options);
+ }
+
+ /**
+ * Test if a cache is available for the given id and (if yes) return it (false else)
+ *
+ * WARNING $doNotTestCacheValidity=true is unsupported by the Xcache backend
+ *
+ * @param string $id cache id
+ * @param boolean $doNotTestCacheValidity if set to true, the cache validity won't be tested
+ * @return string cached datas (or false)
+ */
+ public function load($id, $doNotTestCacheValidity = false)
+ {
+ if ($doNotTestCacheValidity) {
+ $this->_log("Zend_Cache_Backend_Xcache::load() : \$doNotTestCacheValidity=true is unsupported by the Xcache backend");
+ }
+ $tmp = xcache_get($id);
+ if (is_array($tmp)) {
+ return $tmp[0];
+ }
+ return false;
+ }
+
+ /**
+ * Test if a cache is available or not (for the given id)
+ *
+ * @param string $id cache id
+ * @return mixed false (a cache is not available) or "last modified" timestamp (int) of the available cache record
+ */
+ public function test($id)
+ {
+ if (xcache_isset($id)) {
+ $tmp = xcache_get($id);
+ if (is_array($tmp)) {
+ return $tmp[1];
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Save some string datas into a cache record
+ *
+ * Note : $data is always "string" (serialization is done by the
+ * core not by the backend)
+ *
+ * @param string $data datas to cache
+ * @param string $id cache id
+ * @param array $tags array of strings, the cache record will be tagged by each string entry
+ * @param int $specificLifetime if != false, set a specific lifetime for this cache record (null => infinite lifetime)
+ * @return boolean true if no problem
+ */
+ public function save($data, $id, $tags = array(), $specificLifetime = false)
+ {
+ $lifetime = $this->getLifetime($specificLifetime);
+ $result = xcache_set($id, array($data, time()), $lifetime);
+ if (count($tags) > 0) {
+ $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_XCACHE_BACKEND);
+ }
+ return $result;
+ }
+
+ /**
+ * Remove a cache record
+ *
+ * @param string $id cache id
+ * @return boolean true if no problem
+ */
+ public function remove($id)
+ {
+ return xcache_unset($id);
+ }
+
+ /**
+ * Clean some cache records
+ *
+ * Available modes are :
+ * 'all' (default) => remove all cache entries ($tags is not used)
+ * 'old' => unsupported
+ * 'matchingTag' => unsupported
+ * 'notMatchingTag' => unsupported
+ * 'matchingAnyTag' => unsupported
+ *
+ * @param string $mode clean mode
+ * @param array $tags array of tags
+ * @throws Zend_Cache_Exception
+ * @return boolean true if no problem
+ */
+ public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
+ {
+ switch ($mode) {
+ case Zend_Cache::CLEANING_MODE_ALL:
+ // Necessary because xcache_clear_cache() need basic authentification
+ $backup = array();
+ if (isset($_SERVER['PHP_AUTH_USER'])) {
+ $backup['PHP_AUTH_USER'] = $_SERVER['PHP_AUTH_USER'];
+ }
+ if (isset($_SERVER['PHP_AUTH_PW'])) {
+ $backup['PHP_AUTH_PW'] = $_SERVER['PHP_AUTH_PW'];
+ }
+ if ($this->_options['user']) {
+ $_SERVER['PHP_AUTH_USER'] = $this->_options['user'];
+ }
+ if ($this->_options['password']) {
+ $_SERVER['PHP_AUTH_PW'] = $this->_options['password'];
+ }
+
+ $cnt = xcache_count(XC_TYPE_VAR);
+ for ($i=0; $i < $cnt; $i++) {
+ xcache_clear_cache(XC_TYPE_VAR, $i);
+ }
+
+ if (isset($backup['PHP_AUTH_USER'])) {
+ $_SERVER['PHP_AUTH_USER'] = $backup['PHP_AUTH_USER'];
+ $_SERVER['PHP_AUTH_PW'] = $backup['PHP_AUTH_PW'];
+ }
+ return true;
+ break;
+ case Zend_Cache::CLEANING_MODE_OLD:
+ $this->_log("Zend_Cache_Backend_Xcache::clean() : CLEANING_MODE_OLD is unsupported by the Xcache backend");
+ break;
+ case Zend_Cache::CLEANING_MODE_MATCHING_TAG:
+ case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG:
+ case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG:
+ $this->_log(self::TAGS_UNSUPPORTED_BY_CLEAN_OF_XCACHE_BACKEND);
+ break;
+ default:
+ Zend_Cache::throwException('Invalid mode for clean() method');
+ break;
+ }
+ }
+
+ /**
+ * Return true if the automatic cleaning is available for the backend
+ *
+ * @return boolean
+ */
+ public function isAutomaticCleaningAvailable()
+ {
+ return false;
+ }
+
+}
diff --git a/library/vendor/Zend/Cache/Backend/ZendPlatform.php b/library/vendor/Zend/Cache/Backend/ZendPlatform.php
new file mode 100644
index 0000000..8e6f460
--- /dev/null
+++ b/library/vendor/Zend/Cache/Backend/ZendPlatform.php
@@ -0,0 +1,315 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Cache_Backend_Interface
+ */
+
+/**
+ * @see Zend_Cache_Backend_Interface
+ */
+
+
+/**
+ * Impementation of Zend Cache Backend using the Zend Platform (Output Content Caching)
+ *
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Backend_ZendPlatform extends Zend_Cache_Backend implements Zend_Cache_Backend_Interface
+{
+ /**
+ * internal ZP prefix
+ */
+ const TAGS_PREFIX = "internal_ZPtag:";
+
+ /**
+ * Constructor
+ * Validate that the Zend Platform is loaded and licensed
+ *
+ * @param array $options Associative array of options
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ public function __construct(array $options = array())
+ {
+ if (!function_exists('accelerator_license_info')) {
+ Zend_Cache::throwException('The Zend Platform extension must be loaded for using this backend !');
+ }
+ if (!function_exists('accelerator_get_configuration')) {
+ $licenseInfo = accelerator_license_info();
+ Zend_Cache::throwException('The Zend Platform extension is not loaded correctly: '.$licenseInfo['failure_reason']);
+ }
+ $accConf = accelerator_get_configuration();
+ if (@!$accConf['output_cache_licensed']) {
+ Zend_Cache::throwException('The Zend Platform extension does not have the proper license to use content caching features');
+ }
+ if (@!$accConf['output_cache_enabled']) {
+ Zend_Cache::throwException('The Zend Platform content caching feature must be enabled for using this backend, set the \'zend_accelerator.output_cache_enabled\' directive to On !');
+ }
+ if (!is_writable($accConf['output_cache_dir'])) {
+ Zend_Cache::throwException('The cache copies directory \''. ini_get('zend_accelerator.output_cache_dir') .'\' must be writable !');
+ }
+ parent:: __construct($options);
+ }
+
+ /**
+ * Test if a cache is available for the given id and (if yes) return it (false else)
+ *
+ * @param string $id Cache id
+ * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
+ * @return string Cached data (or false)
+ */
+ public function load($id, $doNotTestCacheValidity = false)
+ {
+ // doNotTestCacheValidity implemented by giving zero lifetime to the cache
+ if ($doNotTestCacheValidity) {
+ $lifetime = 0;
+ } else {
+ $lifetime = $this->_directives['lifetime'];
+ }
+ $res = output_cache_get($id, $lifetime);
+ if($res) {
+ return $res[0];
+ } else {
+ return false;
+ }
+ }
+
+
+ /**
+ * Test if a cache is available or not (for the given id)
+ *
+ * @param string $id Cache id
+ * @return mixed|false false (a cache is not available) or "last modified" timestamp (int) of the available cache record
+ */
+ public function test($id)
+ {
+ $result = output_cache_get($id, $this->_directives['lifetime']);
+ if ($result) {
+ return $result[1];
+ }
+ return false;
+ }
+
+ /**
+ * Save some string datas into a cache record
+ *
+ * Note : $data is always "string" (serialization is done by the
+ * core not by the backend)
+ *
+ * @param string $data Data to cache
+ * @param string $id Cache id
+ * @param array $tags Array of strings, the cache record will be tagged by each string entry
+ * @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
+ * @return boolean true if no problem
+ */
+ public function save($data, $id, $tags = array(), $specificLifetime = false)
+ {
+ if (!($specificLifetime === false)) {
+ $this->_log("Zend_Cache_Backend_ZendPlatform::save() : non false specifc lifetime is unsuported for this backend");
+ }
+
+ $lifetime = $this->_directives['lifetime'];
+ $result1 = output_cache_put($id, array($data, time()));
+ $result2 = (count($tags) == 0);
+
+ foreach ($tags as $tag) {
+ $tagid = self::TAGS_PREFIX.$tag;
+ $old_tags = output_cache_get($tagid, $lifetime);
+ if ($old_tags === false) {
+ $old_tags = array();
+ }
+ $old_tags[$id] = $id;
+ output_cache_remove_key($tagid);
+ $result2 = output_cache_put($tagid, $old_tags);
+ }
+
+ return $result1 && $result2;
+ }
+
+
+ /**
+ * Remove a cache record
+ *
+ * @param string $id Cache id
+ * @return boolean True if no problem
+ */
+ public function remove($id)
+ {
+ return output_cache_remove_key($id);
+ }
+
+
+ /**
+ * Clean some cache records
+ *
+ * Available modes are :
+ * Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used)
+ * Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used)
+ * This mode is not supported in this backend
+ * Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags
+ * ($tags can be an array of strings or a single string)
+ * Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG => unsupported
+ * Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG => remove cache entries matching any given tags
+ * ($tags can be an array of strings or a single string)
+ *
+ * @param string $mode Clean mode
+ * @param array $tags Array of tags
+ * @throws Zend_Cache_Exception
+ * @return boolean True if no problem
+ */
+ public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
+ {
+ switch ($mode) {
+ case Zend_Cache::CLEANING_MODE_ALL:
+ case Zend_Cache::CLEANING_MODE_OLD:
+ $cache_dir = ini_get('zend_accelerator.output_cache_dir');
+ if (!$cache_dir) {
+ return false;
+ }
+ $cache_dir .= '/.php_cache_api/';
+ return $this->_clean($cache_dir, $mode);
+ break;
+ case Zend_Cache::CLEANING_MODE_MATCHING_TAG:
+ $idlist = null;
+ foreach ($tags as $tag) {
+ $next_idlist = output_cache_get(self::TAGS_PREFIX.$tag, $this->_directives['lifetime']);
+ if ($idlist) {
+ $idlist = array_intersect_assoc($idlist, $next_idlist);
+ } else {
+ $idlist = $next_idlist;
+ }
+ if (count($idlist) == 0) {
+ // if ID list is already empty - we may skip checking other IDs
+ $idlist = null;
+ break;
+ }
+ }
+ if ($idlist) {
+ foreach ($idlist as $id) {
+ output_cache_remove_key($id);
+ }
+ }
+ return true;
+ break;
+ case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG:
+ $this->_log("Zend_Cache_Backend_ZendPlatform::clean() : CLEANING_MODE_NOT_MATCHING_TAG is not supported by the Zend Platform backend");
+ return false;
+ break;
+ case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG:
+ $idlist = null;
+ foreach ($tags as $tag) {
+ $next_idlist = output_cache_get(self::TAGS_PREFIX.$tag, $this->_directives['lifetime']);
+ if ($idlist) {
+ $idlist = array_merge_recursive($idlist, $next_idlist);
+ } else {
+ $idlist = $next_idlist;
+ }
+ if (count($idlist) == 0) {
+ // if ID list is already empty - we may skip checking other IDs
+ $idlist = null;
+ break;
+ }
+ }
+ if ($idlist) {
+ foreach ($idlist as $id) {
+ output_cache_remove_key($id);
+ }
+ }
+ return true;
+ break;
+ default:
+ Zend_Cache::throwException('Invalid mode for clean() method');
+ break;
+ }
+ }
+
+ /**
+ * Clean a directory and recursivly go over it's subdirectories
+ *
+ * Remove all the cached files that need to be cleaned (according to mode and files mtime)
+ *
+ * @param string $dir Path of directory ot clean
+ * @param string $mode The same parameter as in Zend_Cache_Backend_ZendPlatform::clean()
+ * @return boolean True if ok
+ */
+ private function _clean($dir, $mode)
+ {
+ $d = @dir($dir);
+ if (!$d) {
+ return false;
+ }
+ $result = true;
+ while (false !== ($file = $d->read())) {
+ if ($file == '.' || $file == '..') {
+ continue;
+ }
+ $file = $d->path . $file;
+ if (is_dir($file)) {
+ $result = ($this->_clean($file .'/', $mode)) && ($result);
+ } else {
+ if ($mode == Zend_Cache::CLEANING_MODE_ALL) {
+ $result = ($this->_remove($file)) && ($result);
+ } else if ($mode == Zend_Cache::CLEANING_MODE_OLD) {
+ // Files older than lifetime get deleted from cache
+ if ($this->_directives['lifetime'] !== null) {
+ if ((time() - @filemtime($file)) > $this->_directives['lifetime']) {
+ $result = ($this->_remove($file)) && ($result);
+ }
+ }
+ }
+ }
+ }
+ $d->close();
+ return $result;
+ }
+
+ /**
+ * Remove a file
+ *
+ * If we can't remove the file (because of locks or any problem), we will touch
+ * the file to invalidate it
+ *
+ * @param string $file Complete file path
+ * @return boolean True if ok
+ */
+ private function _remove($file)
+ {
+ if (!@unlink($file)) {
+ # If we can't remove the file (because of locks or any problem), we will touch
+ # the file to invalidate it
+ $this->_log("Zend_Cache_Backend_ZendPlatform::_remove() : we can't remove $file => we are going to try to invalidate it");
+ if ($this->_directives['lifetime'] === null) {
+ return false;
+ }
+ if (!file_exists($file)) {
+ return false;
+ }
+ return @touch($file, time() - 2*abs($this->_directives['lifetime']));
+ }
+ return true;
+ }
+
+}
diff --git a/library/vendor/Zend/Cache/Backend/ZendServer.php b/library/vendor/Zend/Cache/Backend/ZendServer.php
new file mode 100644
index 0000000..6243d86
--- /dev/null
+++ b/library/vendor/Zend/Cache/Backend/ZendServer.php
@@ -0,0 +1,205 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/** @see Zend_Cache_Backend_Interface */
+
+/** @see Zend_Cache_Backend */
+
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Cache_Backend_ZendServer extends Zend_Cache_Backend implements Zend_Cache_Backend_Interface
+{
+ /**
+ * Available options
+ *
+ * =====> (string) namespace :
+ * Namespace to be used for chaching operations
+ *
+ * @var array available options
+ */
+ protected $_options = array(
+ 'namespace' => 'zendframework'
+ );
+
+ /**
+ * Store data
+ *
+ * @param mixed $data Object to store
+ * @param string $id Cache id
+ * @param int $timeToLive Time to live in seconds
+ * @throws Zend_Cache_Exception
+ */
+ abstract protected function _store($data, $id, $timeToLive);
+
+ /**
+ * Fetch data
+ *
+ * @param string $id Cache id
+ * @throws Zend_Cache_Exception
+ */
+ abstract protected function _fetch($id);
+
+ /**
+ * Unset data
+ *
+ * @param string $id Cache id
+ */
+ abstract protected function _unset($id);
+
+ /**
+ * Clear cache
+ */
+ abstract protected function _clear();
+
+ /**
+ * Test if a cache is available for the given id and (if yes) return it (false else)
+ *
+ * @param string $id cache id
+ * @param boolean $doNotTestCacheValidity if set to true, the cache validity won't be tested
+ * @return string cached datas (or false)
+ */
+ public function load($id, $doNotTestCacheValidity = false)
+ {
+ $tmp = $this->_fetch($id);
+ if ($tmp !== null) {
+ return $tmp;
+ }
+ return false;
+ }
+
+ /**
+ * Test if a cache is available or not (for the given id)
+ *
+ * @param string $id cache id
+ * @return mixed false (a cache is not available) or "last modified" timestamp (int) of the available cache record
+ * @throws Zend_Cache_Exception
+ */
+ public function test($id)
+ {
+ $tmp = $this->_fetch('internal-metadatas---' . $id);
+ if ($tmp !== false) {
+ if (!is_array($tmp) || !isset($tmp['mtime'])) {
+ Zend_Cache::throwException('Cache metadata for \'' . $id . '\' id is corrupted' );
+ }
+ return $tmp['mtime'];
+ }
+ return false;
+ }
+
+ /**
+ * Compute & return the expire time
+ *
+ * @return int expire time (unix timestamp)
+ */
+ private function _expireTime($lifetime)
+ {
+ if ($lifetime === null) {
+ return 9999999999;
+ }
+ return time() + $lifetime;
+ }
+
+ /**
+ * Save some string datas into a cache record
+ *
+ * Note : $data is always "string" (serialization is done by the
+ * core not by the backend)
+ *
+ * @param string $data datas to cache
+ * @param string $id cache id
+ * @param array $tags array of strings, the cache record will be tagged by each string entry
+ * @param int $specificLifetime if != false, set a specific lifetime for this cache record (null => infinite lifetime)
+ * @return boolean true if no problem
+ */
+ public function save($data, $id, $tags = array(), $specificLifetime = false)
+ {
+ $lifetime = $this->getLifetime($specificLifetime);
+ $metadatas = array(
+ 'mtime' => time(),
+ 'expire' => $this->_expireTime($lifetime),
+ );
+
+ if (count($tags) > 0) {
+ $this->_log('Zend_Cache_Backend_ZendServer::save() : tags are unsupported by the ZendServer backends');
+ }
+
+ return $this->_store($data, $id, $lifetime) &&
+ $this->_store($metadatas, 'internal-metadatas---' . $id, $lifetime);
+ }
+
+ /**
+ * Remove a cache record
+ *
+ * @param string $id cache id
+ * @return boolean true if no problem
+ */
+ public function remove($id)
+ {
+ $result1 = $this->_unset($id);
+ $result2 = $this->_unset('internal-metadatas---' . $id);
+
+ return $result1 && $result2;
+ }
+
+ /**
+ * Clean some cache records
+ *
+ * Available modes are :
+ * 'all' (default) => remove all cache entries ($tags is not used)
+ * 'old' => unsupported
+ * 'matchingTag' => unsupported
+ * 'notMatchingTag' => unsupported
+ * 'matchingAnyTag' => unsupported
+ *
+ * @param string $mode clean mode
+ * @param array $tags array of tags
+ * @throws Zend_Cache_Exception
+ * @return boolean true if no problem
+ */
+ public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array())
+ {
+ switch ($mode) {
+ case Zend_Cache::CLEANING_MODE_ALL:
+ $this->_clear();
+ return true;
+ break;
+ case Zend_Cache::CLEANING_MODE_OLD:
+ $this->_log("Zend_Cache_Backend_ZendServer::clean() : CLEANING_MODE_OLD is unsupported by the Zend Server backends.");
+ break;
+ case Zend_Cache::CLEANING_MODE_MATCHING_TAG:
+ case Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG:
+ case Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG:
+ $this->_clear();
+ $this->_log('Zend_Cache_Backend_ZendServer::clean() : tags are unsupported by the Zend Server backends.');
+ break;
+ default:
+ Zend_Cache::throwException('Invalid mode for clean() method');
+ break;
+ }
+ }
+}
diff --git a/library/vendor/Zend/Cache/Backend/ZendServer/Disk.php b/library/vendor/Zend/Cache/Backend/ZendServer/Disk.php
new file mode 100644
index 0000000..09cd126
--- /dev/null
+++ b/library/vendor/Zend/Cache/Backend/ZendServer/Disk.php
@@ -0,0 +1,99 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/** @see Zend_Cache_Backend_Interface */
+
+/** @see Zend_Cache_Backend_ZendServer */
+
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Backend_ZendServer_Disk extends Zend_Cache_Backend_ZendServer implements Zend_Cache_Backend_Interface
+{
+ /**
+ * Constructor
+ *
+ * @param array $options associative array of options
+ * @throws Zend_Cache_Exception
+ */
+ public function __construct(array $options = array())
+ {
+ if (!function_exists('zend_disk_cache_store')) {
+ Zend_Cache::throwException('Zend_Cache_ZendServer_Disk backend has to be used within Zend Server environment.');
+ }
+ parent::__construct($options);
+ }
+
+ /**
+ * Store data
+ *
+ * @param mixed $data Object to store
+ * @param string $id Cache id
+ * @param int $timeToLive Time to live in seconds
+ * @return boolean true if no problem
+ */
+ protected function _store($data, $id, $timeToLive)
+ {
+ if (zend_disk_cache_store($this->_options['namespace'] . '::' . $id,
+ $data,
+ $timeToLive) === false) {
+ $this->_log('Store operation failed.');
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Fetch data
+ *
+ * @param string $id Cache id
+ * @return mixed|null
+ */
+ protected function _fetch($id)
+ {
+ return zend_disk_cache_fetch($this->_options['namespace'] . '::' . $id);
+ }
+
+ /**
+ * Unset data
+ *
+ * @param string $id Cache id
+ * @return boolean true if no problem
+ */
+ protected function _unset($id)
+ {
+ return zend_disk_cache_delete($this->_options['namespace'] . '::' . $id);
+ }
+
+ /**
+ * Clear cache
+ */
+ protected function _clear()
+ {
+ zend_disk_cache_clear($this->_options['namespace']);
+ }
+}
diff --git a/library/vendor/Zend/Cache/Backend/ZendServer/ShMem.php b/library/vendor/Zend/Cache/Backend/ZendServer/ShMem.php
new file mode 100644
index 0000000..5fe1894
--- /dev/null
+++ b/library/vendor/Zend/Cache/Backend/ZendServer/ShMem.php
@@ -0,0 +1,99 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/** @see Zend_Cache_Backend_Interface */
+
+/** @see Zend_Cache_Backend_ZendServer */
+
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Backend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Backend_ZendServer_ShMem extends Zend_Cache_Backend_ZendServer implements Zend_Cache_Backend_Interface
+{
+ /**
+ * Constructor
+ *
+ * @param array $options associative array of options
+ * @throws Zend_Cache_Exception
+ */
+ public function __construct(array $options = array())
+ {
+ if (!function_exists('zend_shm_cache_store')) {
+ Zend_Cache::throwException('Zend_Cache_ZendServer_ShMem backend has to be used within Zend Server environment.');
+ }
+ parent::__construct($options);
+ }
+
+ /**
+ * Store data
+ *
+ * @param mixed $data Object to store
+ * @param string $id Cache id
+ * @param int $timeToLive Time to live in seconds
+ * @return bool
+ */
+ protected function _store($data, $id, $timeToLive)
+ {
+ if (zend_shm_cache_store($this->_options['namespace'] . '::' . $id,
+ $data,
+ $timeToLive) === false) {
+ $this->_log('Store operation failed.');
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Fetch data
+ *
+ * @param string $id Cache id
+ * @return mixed|null
+ */
+ protected function _fetch($id)
+ {
+ return zend_shm_cache_fetch($this->_options['namespace'] . '::' . $id);
+ }
+
+ /**
+ * Unset data
+ *
+ * @param string $id Cache id
+ * @return boolean true if no problem
+ */
+ protected function _unset($id)
+ {
+ return zend_shm_cache_delete($this->_options['namespace'] . '::' . $id);
+ }
+
+ /**
+ * Clear cache
+ */
+ protected function _clear()
+ {
+ zend_shm_cache_clear($this->_options['namespace']);
+ }
+}
diff --git a/library/vendor/Zend/Cache/Core.php b/library/vendor/Zend/Cache/Core.php
new file mode 100644
index 0000000..833f247
--- /dev/null
+++ b/library/vendor/Zend/Cache/Core.php
@@ -0,0 +1,762 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @package Zend_Cache
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Core
+{
+ /**
+ * Messages
+ */
+ const BACKEND_NOT_SUPPORTS_TAG = 'tags are not supported by the current backend';
+ const BACKEND_NOT_IMPLEMENTS_EXTENDED_IF = 'Current backend doesn\'t implement the Zend_Cache_Backend_ExtendedInterface, so this method is not available';
+
+ /**
+ * Backend Object
+ *
+ * @var Zend_Cache_Backend_Interface $_backend
+ */
+ protected $_backend = null;
+
+ /**
+ * Available options
+ *
+ * ====> (boolean) write_control :
+ * - Enable / disable write control (the cache is read just after writing to detect corrupt entries)
+ * - Enable write control will lightly slow the cache writing but not the cache reading
+ * Write control can detect some corrupt cache files but maybe it's not a perfect control
+ *
+ * ====> (boolean) caching :
+ * - Enable / disable caching
+ * (can be very useful for the debug of cached scripts)
+ *
+ * =====> (string) cache_id_prefix :
+ * - prefix for cache ids (namespace)
+ *
+ * ====> (boolean) automatic_serialization :
+ * - Enable / disable automatic serialization
+ * - It can be used to save directly datas which aren't strings (but it's slower)
+ *
+ * ====> (int) automatic_cleaning_factor :
+ * - Disable / Tune the automatic cleaning process
+ * - The automatic cleaning process destroy too old (for the given life time)
+ * cache files when a new cache file is written :
+ * 0 => no automatic cache cleaning
+ * 1 => systematic cache cleaning
+ * x (integer) > 1 => automatic cleaning randomly 1 times on x cache write
+ *
+ * ====> (int) lifetime :
+ * - Cache lifetime (in seconds)
+ * - If null, the cache is valid forever.
+ *
+ * ====> (boolean) logging :
+ * - If set to true, logging is activated (but the system is slower)
+ *
+ * ====> (boolean) ignore_user_abort
+ * - If set to true, the core will set the ignore_user_abort PHP flag inside the
+ * save() method to avoid cache corruptions in some cases (default false)
+ *
+ * @var array $_options available options
+ */
+ protected $_options = array(
+ 'write_control' => true,
+ 'caching' => true,
+ 'cache_id_prefix' => null,
+ 'automatic_serialization' => false,
+ 'automatic_cleaning_factor' => 10,
+ 'lifetime' => 3600,
+ 'logging' => false,
+ 'logger' => null,
+ 'ignore_user_abort' => false
+ );
+
+ /**
+ * Array of options which have to be transfered to backend
+ *
+ * @var array $_directivesList
+ */
+ protected static $_directivesList = array('lifetime', 'logging', 'logger');
+
+ /**
+ * Not used for the core, just a sort a hint to get a common setOption() method (for the core and for frontends)
+ *
+ * @var array $_specificOptions
+ */
+ protected $_specificOptions = array();
+
+ /**
+ * Last used cache id
+ *
+ * @var string $_lastId
+ */
+ private $_lastId = null;
+
+ /**
+ * True if the backend implements Zend_Cache_Backend_ExtendedInterface
+ *
+ * @var boolean $_extendedBackend
+ */
+ protected $_extendedBackend = false;
+
+ /**
+ * Array of capabilities of the backend (only if it implements Zend_Cache_Backend_ExtendedInterface)
+ *
+ * @var array
+ */
+ protected $_backendCapabilities = array();
+
+ /**
+ * Constructor
+ *
+ * @param array|Zend_Config $options Associative array of options or Zend_Config instance
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ public function __construct($options = array())
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ }
+ if (!is_array($options)) {
+ Zend_Cache::throwException("Options passed were not an array"
+ . " or Zend_Config instance.");
+ }
+ foreach ($options as $name => $value) {
+ $this->setOption($name, $value);
+ }
+ $this->_loggerSanity();
+ }
+
+ /**
+ * Set options using an instance of type Zend_Config
+ *
+ * @param Zend_Config $config
+ * @return Zend_Cache_Core
+ */
+ public function setConfig(Zend_Config $config)
+ {
+ $options = $config->toArray();
+ foreach ($options as $name => $value) {
+ $this->setOption($name, $value);
+ }
+ return $this;
+ }
+
+ /**
+ * Set the backend
+ *
+ * @param Zend_Cache_Backend $backendObject
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ public function setBackend(Zend_Cache_Backend $backendObject)
+ {
+ $this->_backend= $backendObject;
+ // some options (listed in $_directivesList) have to be given
+ // to the backend too (even if they are not "backend specific")
+ $directives = array();
+ foreach (Zend_Cache_Core::$_directivesList as $directive) {
+ $directives[$directive] = $this->_options[$directive];
+ }
+ $this->_backend->setDirectives($directives);
+ if (in_array('Zend_Cache_Backend_ExtendedInterface', class_implements($this->_backend))) {
+ $this->_extendedBackend = true;
+ $this->_backendCapabilities = $this->_backend->getCapabilities();
+ }
+
+ }
+
+ /**
+ * Returns the backend
+ *
+ * @return Zend_Cache_Backend backend object
+ */
+ public function getBackend()
+ {
+ return $this->_backend;
+ }
+
+ /**
+ * Public frontend to set an option
+ *
+ * There is an additional validation (relatively to the protected _setOption method)
+ *
+ * @param string $name Name of the option
+ * @param mixed $value Value of the option
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ public function setOption($name, $value)
+ {
+ if (!is_string($name)) {
+ Zend_Cache::throwException("Incorrect option name!");
+ }
+ $name = strtolower($name);
+ if (array_key_exists($name, $this->_options)) {
+ // This is a Core option
+ $this->_setOption($name, $value);
+ return;
+ }
+ if (array_key_exists($name, $this->_specificOptions)) {
+ // This a specic option of this frontend
+ $this->_specificOptions[$name] = $value;
+ return;
+ }
+ }
+
+ /**
+ * Public frontend to get an option value
+ *
+ * @param string $name Name of the option
+ * @throws Zend_Cache_Exception
+ * @return mixed option value
+ */
+ public function getOption($name)
+ {
+ $name = strtolower($name);
+
+ if (array_key_exists($name, $this->_options)) {
+ // This is a Core option
+ return $this->_options[$name];
+ }
+
+ if (array_key_exists($name, $this->_specificOptions)) {
+ // This a specic option of this frontend
+ return $this->_specificOptions[$name];
+ }
+
+ Zend_Cache::throwException("Incorrect option name : $name");
+ }
+
+ /**
+ * Set an option
+ *
+ * @param string $name Name of the option
+ * @param mixed $value Value of the option
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ private function _setOption($name, $value)
+ {
+ if (!is_string($name) || !array_key_exists($name, $this->_options)) {
+ Zend_Cache::throwException("Incorrect option name : $name");
+ }
+ if ($name == 'lifetime' && empty($value)) {
+ $value = null;
+ }
+ $this->_options[$name] = $value;
+ }
+
+ /**
+ * Force a new lifetime
+ *
+ * The new value is set for the core/frontend but for the backend too (directive)
+ *
+ * @param int $newLifetime New lifetime (in seconds)
+ * @return void
+ */
+ public function setLifetime($newLifetime)
+ {
+ $this->_options['lifetime'] = $newLifetime;
+ $this->_backend->setDirectives(array(
+ 'lifetime' => $newLifetime
+ ));
+ }
+
+ /**
+ * Test if a cache is available for the given id and (if yes) return it (false else)
+ *
+ * @param string $id Cache id
+ * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
+ * @param boolean $doNotUnserialize Do not serialize (even if automatic_serialization is true) => for internal use
+ * @return mixed|false Cached datas
+ */
+ public function load($id, $doNotTestCacheValidity = false, $doNotUnserialize = false)
+ {
+ if (!$this->_options['caching']) {
+ return false;
+ }
+ $id = $this->_id($id); // cache id may need prefix
+ $this->_lastId = $id;
+ $this->_validateIdOrTag($id);
+
+ $this->_log("Zend_Cache_Core: load item '{$id}'", 7);
+ $data = $this->_backend->load($id, $doNotTestCacheValidity);
+ if ($data===false) {
+ // no cache available
+ return false;
+ }
+ if ((!$doNotUnserialize) && $this->_options['automatic_serialization']) {
+ // we need to unserialize before sending the result
+ return unserialize($data);
+ }
+ return $data;
+ }
+
+ /**
+ * Test if a cache is available for the given id
+ *
+ * @param string $id Cache id
+ * @return int|false Last modified time of cache entry if it is available, false otherwise
+ */
+ public function test($id)
+ {
+ if (!$this->_options['caching']) {
+ return false;
+ }
+ $id = $this->_id($id); // cache id may need prefix
+ $this->_validateIdOrTag($id);
+ $this->_lastId = $id;
+
+ $this->_log("Zend_Cache_Core: test item '{$id}'", 7);
+ return $this->_backend->test($id);
+ }
+
+ /**
+ * Save some data in a cache
+ *
+ * @param mixed $data Data to put in cache (can be another type than string if automatic_serialization is on)
+ * @param string $id Cache id (if not set, the last cache id will be used)
+ * @param array $tags Cache tags
+ * @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
+ * @param int $priority integer between 0 (very low priority) and 10 (maximum priority) used by some particular backends
+ * @throws Zend_Cache_Exception
+ * @return boolean True if no problem
+ */
+ public function save($data, $id = null, $tags = array(), $specificLifetime = false, $priority = 8)
+ {
+ if (!$this->_options['caching']) {
+ return true;
+ }
+ if ($id === null) {
+ $id = $this->_lastId;
+ } else {
+ $id = $this->_id($id);
+ }
+ $this->_validateIdOrTag($id);
+ $this->_validateTagsArray($tags);
+ if ($this->_options['automatic_serialization']) {
+ // we need to serialize datas before storing them
+ $data = serialize($data);
+ } else {
+ if (!is_string($data)) {
+ Zend_Cache::throwException("Datas must be string or set automatic_serialization = true");
+ }
+ }
+
+ // automatic cleaning
+ if ($this->_options['automatic_cleaning_factor'] > 0) {
+ $rand = rand(1, $this->_options['automatic_cleaning_factor']);
+ if ($rand==1) {
+ // new way || deprecated way
+ if ($this->_extendedBackend || method_exists($this->_backend, 'isAutomaticCleaningAvailable')) {
+ $this->_log("Zend_Cache_Core::save(): automatic cleaning running", 7);
+ $this->clean(Zend_Cache::CLEANING_MODE_OLD);
+ } else {
+ $this->_log("Zend_Cache_Core::save(): automatic cleaning is not available/necessary with current backend", 4);
+ }
+ }
+ }
+
+ $this->_log("Zend_Cache_Core: save item '{$id}'", 7);
+ if ($this->_options['ignore_user_abort']) {
+ $abort = ignore_user_abort(true);
+ }
+ if (($this->_extendedBackend) && ($this->_backendCapabilities['priority'])) {
+ $result = $this->_backend->save($data, $id, $tags, $specificLifetime, $priority);
+ } else {
+ $result = $this->_backend->save($data, $id, $tags, $specificLifetime);
+ }
+ if ($this->_options['ignore_user_abort']) {
+ ignore_user_abort($abort);
+ }
+
+ if (!$result) {
+ // maybe the cache is corrupted, so we remove it !
+ $this->_log("Zend_Cache_Core::save(): failed to save item '{$id}' -> removing it", 4);
+ $this->_backend->remove($id);
+ return false;
+ }
+
+ if ($this->_options['write_control']) {
+ $data2 = $this->_backend->load($id, true);
+ if ($data!=$data2) {
+ $this->_log("Zend_Cache_Core::save(): write control of item '{$id}' failed -> removing it", 4);
+ $this->_backend->remove($id);
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Remove a cache
+ *
+ * @param string $id Cache id to remove
+ * @return boolean True if ok
+ */
+ public function remove($id)
+ {
+ if (!$this->_options['caching']) {
+ return true;
+ }
+ $id = $this->_id($id); // cache id may need prefix
+ $this->_validateIdOrTag($id);
+
+ $this->_log("Zend_Cache_Core: remove item '{$id}'", 7);
+ return $this->_backend->remove($id);
+ }
+
+ /**
+ * Clean cache entries
+ *
+ * Available modes are :
+ * 'all' (default) => remove all cache entries ($tags is not used)
+ * 'old' => remove too old cache entries ($tags is not used)
+ * 'matchingTag' => remove cache entries matching all given tags
+ * ($tags can be an array of strings or a single string)
+ * 'notMatchingTag' => remove cache entries not matching one of the given tags
+ * ($tags can be an array of strings or a single string)
+ * 'matchingAnyTag' => remove cache entries matching any given tags
+ * ($tags can be an array of strings or a single string)
+ *
+ * @param string $mode
+ * @param array|string $tags
+ * @throws Zend_Cache_Exception
+ * @return boolean True if ok
+ */
+ public function clean($mode = 'all', $tags = array())
+ {
+ if (!$this->_options['caching']) {
+ return true;
+ }
+ if (!in_array($mode, array(Zend_Cache::CLEANING_MODE_ALL,
+ Zend_Cache::CLEANING_MODE_OLD,
+ Zend_Cache::CLEANING_MODE_MATCHING_TAG,
+ Zend_Cache::CLEANING_MODE_NOT_MATCHING_TAG,
+ Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG))) {
+ Zend_Cache::throwException('Invalid cleaning mode');
+ }
+ $this->_validateTagsArray($tags);
+
+ return $this->_backend->clean($mode, $tags);
+ }
+
+ /**
+ * Return an array of stored cache ids which match given tags
+ *
+ * In case of multiple tags, a logical AND is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of matching cache ids (string)
+ */
+ public function getIdsMatchingTags($tags = array())
+ {
+ if (!$this->_extendedBackend) {
+ Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF);
+ }
+ if (!($this->_backendCapabilities['tags'])) {
+ Zend_Cache::throwException(self::BACKEND_NOT_SUPPORTS_TAG);
+ }
+
+ $ids = $this->_backend->getIdsMatchingTags($tags);
+
+ // we need to remove cache_id_prefix from ids (see #ZF-6178, #ZF-7600)
+ if (isset($this->_options['cache_id_prefix']) && $this->_options['cache_id_prefix'] !== '') {
+ $prefix = & $this->_options['cache_id_prefix'];
+ $prefixLen = strlen($prefix);
+ foreach ($ids as &$id) {
+ if (strpos($id, $prefix) === 0) {
+ $id = substr($id, $prefixLen);
+ }
+ }
+ }
+
+ return $ids;
+ }
+
+ /**
+ * Return an array of stored cache ids which don't match given tags
+ *
+ * In case of multiple tags, a logical OR is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of not matching cache ids (string)
+ */
+ public function getIdsNotMatchingTags($tags = array())
+ {
+ if (!$this->_extendedBackend) {
+ Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF);
+ }
+ if (!($this->_backendCapabilities['tags'])) {
+ Zend_Cache::throwException(self::BACKEND_NOT_SUPPORTS_TAG);
+ }
+
+ $ids = $this->_backend->getIdsNotMatchingTags($tags);
+
+ // we need to remove cache_id_prefix from ids (see #ZF-6178, #ZF-7600)
+ if (isset($this->_options['cache_id_prefix']) && $this->_options['cache_id_prefix'] !== '') {
+ $prefix = & $this->_options['cache_id_prefix'];
+ $prefixLen = strlen($prefix);
+ foreach ($ids as &$id) {
+ if (strpos($id, $prefix) === 0) {
+ $id = substr($id, $prefixLen);
+ }
+ }
+ }
+
+ return $ids;
+ }
+
+ /**
+ * Return an array of stored cache ids which match any given tags
+ *
+ * In case of multiple tags, a logical OR is made between tags
+ *
+ * @param array $tags array of tags
+ * @return array array of matching any cache ids (string)
+ */
+ public function getIdsMatchingAnyTags($tags = array())
+ {
+ if (!$this->_extendedBackend) {
+ Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF);
+ }
+ if (!($this->_backendCapabilities['tags'])) {
+ Zend_Cache::throwException(self::BACKEND_NOT_SUPPORTS_TAG);
+ }
+
+ $ids = $this->_backend->getIdsMatchingAnyTags($tags);
+
+ // we need to remove cache_id_prefix from ids (see #ZF-6178, #ZF-7600)
+ if (isset($this->_options['cache_id_prefix']) && $this->_options['cache_id_prefix'] !== '') {
+ $prefix = & $this->_options['cache_id_prefix'];
+ $prefixLen = strlen($prefix);
+ foreach ($ids as &$id) {
+ if (strpos($id, $prefix) === 0) {
+ $id = substr($id, $prefixLen);
+ }
+ }
+ }
+
+ return $ids;
+ }
+
+ /**
+ * Return an array of stored cache ids
+ *
+ * @return array array of stored cache ids (string)
+ */
+ public function getIds()
+ {
+ if (!$this->_extendedBackend) {
+ Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF);
+ }
+
+ $ids = $this->_backend->getIds();
+
+ // we need to remove cache_id_prefix from ids (see #ZF-6178, #ZF-7600)
+ if (isset($this->_options['cache_id_prefix']) && $this->_options['cache_id_prefix'] !== '') {
+ $prefix = & $this->_options['cache_id_prefix'];
+ $prefixLen = strlen($prefix);
+ foreach ($ids as &$id) {
+ if (strpos($id, $prefix) === 0) {
+ $id = substr($id, $prefixLen);
+ }
+ }
+ }
+
+ return $ids;
+ }
+
+ /**
+ * Return an array of stored tags
+ *
+ * @return array array of stored tags (string)
+ */
+ public function getTags()
+ {
+ if (!$this->_extendedBackend) {
+ Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF);
+ }
+ if (!($this->_backendCapabilities['tags'])) {
+ Zend_Cache::throwException(self::BACKEND_NOT_SUPPORTS_TAG);
+ }
+ return $this->_backend->getTags();
+ }
+
+ /**
+ * Return the filling percentage of the backend storage
+ *
+ * @return int integer between 0 and 100
+ */
+ public function getFillingPercentage()
+ {
+ if (!$this->_extendedBackend) {
+ Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF);
+ }
+ return $this->_backend->getFillingPercentage();
+ }
+
+ /**
+ * Return an array of metadatas for the given cache id
+ *
+ * The array will include these keys :
+ * - expire : the expire timestamp
+ * - tags : a string array of tags
+ * - mtime : timestamp of last modification time
+ *
+ * @param string $id cache id
+ * @return array array of metadatas (false if the cache id is not found)
+ */
+ public function getMetadatas($id)
+ {
+ if (!$this->_extendedBackend) {
+ Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF);
+ }
+ $id = $this->_id($id); // cache id may need prefix
+ return $this->_backend->getMetadatas($id);
+ }
+
+ /**
+ * Give (if possible) an extra lifetime to the given cache id
+ *
+ * @param string $id cache id
+ * @param int $extraLifetime
+ * @return boolean true if ok
+ */
+ public function touch($id, $extraLifetime)
+ {
+ if (!$this->_extendedBackend) {
+ Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF);
+ }
+ $id = $this->_id($id); // cache id may need prefix
+
+ $this->_log("Zend_Cache_Core: touch item '{$id}'", 7);
+ return $this->_backend->touch($id, $extraLifetime);
+ }
+
+ /**
+ * Validate a cache id or a tag (security, reliable filenames, reserved prefixes...)
+ *
+ * Throw an exception if a problem is found
+ *
+ * @param string $string Cache id or tag
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ protected function _validateIdOrTag($string)
+ {
+ if (!is_string($string)) {
+ Zend_Cache::throwException('Invalid id or tag : must be a string');
+ }
+ if (substr($string, 0, 9) == 'internal-') {
+ Zend_Cache::throwException('"internal-*" ids or tags are reserved');
+ }
+ if (!preg_match('~^[a-zA-Z0-9_]+$~D', $string)) {
+ Zend_Cache::throwException("Invalid id or tag '$string' : must use only [a-zA-Z0-9_]");
+ }
+ }
+
+ /**
+ * Validate a tags array (security, reliable filenames, reserved prefixes...)
+ *
+ * Throw an exception if a problem is found
+ *
+ * @param array $tags Array of tags
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ protected function _validateTagsArray($tags)
+ {
+ if (!is_array($tags)) {
+ Zend_Cache::throwException('Invalid tags array : must be an array');
+ }
+ foreach($tags as $tag) {
+ $this->_validateIdOrTag($tag);
+ }
+ reset($tags);
+ }
+
+ /**
+ * Make sure if we enable logging that the Zend_Log class
+ * is available.
+ * Create a default log object if none is set.
+ *
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ protected function _loggerSanity()
+ {
+ if (!isset($this->_options['logging']) || !$this->_options['logging']) {
+ return;
+ }
+
+ if (isset($this->_options['logger']) && $this->_options['logger'] instanceof Zend_Log) {
+ return;
+ }
+
+ // Create a default logger to the standard output stream
+ $logger = new Zend_Log(new Zend_Log_Writer_Stream('php://output'));
+ $logger->addFilter(new Zend_Log_Filter_Priority(Zend_Log::WARN, '<='));
+ $this->_options['logger'] = $logger;
+ }
+
+ /**
+ * Log a message at the WARN (4) priority.
+ *
+ * @param string $message
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ protected function _log($message, $priority = 4)
+ {
+ if (!$this->_options['logging']) {
+ return;
+ }
+ if (!(isset($this->_options['logger']) || $this->_options['logger'] instanceof Zend_Log)) {
+ Zend_Cache::throwException('Logging is enabled but logger is not set');
+ }
+ $logger = $this->_options['logger'];
+ $logger->log($message, $priority);
+ }
+
+ /**
+ * Make and return a cache id
+ *
+ * Checks 'cache_id_prefix' and returns new id with prefix or simply the id if null
+ *
+ * @param string $id Cache id
+ * @return string Cache id (with or without prefix)
+ */
+ protected function _id($id)
+ {
+ if (($id !== null) && isset($this->_options['cache_id_prefix'])) {
+ return $this->_options['cache_id_prefix'] . $id; // return with prefix
+ }
+ return $id; // no prefix, just return the $id passed
+ }
+
+}
diff --git a/library/vendor/Zend/Cache/Exception.php b/library/vendor/Zend/Cache/Exception.php
new file mode 100644
index 0000000..bc3c815
--- /dev/null
+++ b/library/vendor/Zend/Cache/Exception.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Exception
+ */
+
+/**
+ * @package Zend_Cache
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Exception extends Zend_Exception {}
diff --git a/library/vendor/Zend/Cache/Frontend/Capture.php b/library/vendor/Zend/Cache/Frontend/Capture.php
new file mode 100644
index 0000000..4b70da4
--- /dev/null
+++ b/library/vendor/Zend/Cache/Frontend/Capture.php
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Frontend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Cache_Core
+ */
+
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Frontend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Frontend_Capture extends Zend_Cache_Core
+{
+ /**
+ * Page identifiers
+ * @var array
+ */
+ protected $_idStack = array();
+
+ /**
+ * Tags
+ * @var array
+ */
+ protected $_tags = array();
+
+ protected $_extension = null;
+
+ /**
+ * Start the cache
+ *
+ * @param string $id Cache id
+ * @return mixed True if the cache is hit (false else) with $echoData=true (default) ; string else (datas)
+ */
+ public function start($id, array $tags, $extension = null)
+ {
+ $this->_tags = $tags;
+ $this->_extension = $extension;
+ ob_start(array($this, '_flush'));
+ ob_implicit_flush(false);
+ $this->_idStack[] = $id;
+ return false;
+ }
+
+ /**
+ * callback for output buffering
+ * (shouldn't really be called manually)
+ *
+ * @param string $data Buffered output
+ * @return string Data to send to browser
+ */
+ public function _flush($data)
+ {
+ $id = array_pop($this->_idStack);
+ if ($id === null) {
+ Zend_Cache::throwException('use of _flush() without a start()');
+ }
+ if ($this->_extension) {
+ $this->save(serialize(array($data, $this->_extension)), $id, $this->_tags);
+ } else {
+ $this->save($data, $id, $this->_tags);
+ }
+ return $data;
+ }
+}
diff --git a/library/vendor/Zend/Cache/Frontend/Class.php b/library/vendor/Zend/Cache/Frontend/Class.php
new file mode 100644
index 0000000..c7208a1
--- /dev/null
+++ b/library/vendor/Zend/Cache/Frontend/Class.php
@@ -0,0 +1,274 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Frontend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Cache_Core
+ */
+
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Frontend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Frontend_Class extends Zend_Cache_Core
+{
+ /**
+ * Available options
+ *
+ * ====> (mixed) cached_entity :
+ * - if set to a class name, we will cache an abstract class and will use only static calls
+ * - if set to an object, we will cache this object methods
+ *
+ * ====> (boolean) cache_by_default :
+ * - if true, method calls will be cached by default
+ *
+ * ====> (array) cached_methods :
+ * - an array of method names which will be cached (even if cache_by_default = false)
+ *
+ * ====> (array) non_cached_methods :
+ * - an array of method names which won't be cached (even if cache_by_default = true)
+ *
+ * @var array available options
+ */
+ protected $_specificOptions = array(
+ 'cached_entity' => null,
+ 'cache_by_default' => true,
+ 'cached_methods' => array(),
+ 'non_cached_methods' => array()
+ );
+
+ /**
+ * Tags array
+ *
+ * @var array
+ */
+ protected $_tags = array();
+
+ /**
+ * SpecificLifetime value
+ *
+ * false => no specific life time
+ *
+ * @var bool|int
+ */
+ protected $_specificLifetime = false;
+
+ /**
+ * The cached object or the name of the cached abstract class
+ *
+ * @var mixed
+ */
+ protected $_cachedEntity = null;
+
+ /**
+ * The class name of the cached object or cached abstract class
+ *
+ * Used to differentiate between different classes with the same method calls.
+ *
+ * @var string
+ */
+ protected $_cachedEntityLabel = '';
+
+ /**
+ * Priority (used by some particular backends)
+ *
+ * @var int
+ */
+ protected $_priority = 8;
+
+ /**
+ * Constructor
+ *
+ * @param array $options Associative array of options
+ * @throws Zend_Cache_Exception
+ */
+ public function __construct(array $options = array())
+ {
+ foreach ($options as $name => $value) {
+ $this->setOption($name, $value);
+ }
+ if ($this->_specificOptions['cached_entity'] === null) {
+ Zend_Cache::throwException('cached_entity must be set !');
+ }
+ $this->setCachedEntity($this->_specificOptions['cached_entity']);
+ $this->setOption('automatic_serialization', true);
+ }
+
+ /**
+ * Set a specific life time
+ *
+ * @param bool|int $specificLifetime
+ * @return void
+ */
+ public function setSpecificLifetime($specificLifetime = false)
+ {
+ $this->_specificLifetime = $specificLifetime;
+ }
+
+ /**
+ * Set the priority (used by some particular backends)
+ *
+ * @param int $priority integer between 0 (very low priority) and 10 (maximum priority)
+ */
+ public function setPriority($priority)
+ {
+ $this->_priority = $priority;
+ }
+
+ /**
+ * Public frontend to set an option
+ *
+ * Just a wrapper to get a specific behaviour for cached_entity
+ *
+ * @param string $name Name of the option
+ * @param mixed $value Value of the option
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ public function setOption($name, $value)
+ {
+ if ($name == 'cached_entity') {
+ $this->setCachedEntity($value);
+ } else {
+ parent::setOption($name, $value);
+ }
+ }
+
+ /**
+ * Specific method to set the cachedEntity
+ *
+ * if set to a class name, we will cache an abstract class and will use only static calls
+ * if set to an object, we will cache this object methods
+ *
+ * @param mixed $cachedEntity
+ */
+ public function setCachedEntity($cachedEntity)
+ {
+ if (!is_string($cachedEntity) && !is_object($cachedEntity)) {
+ Zend_Cache::throwException(
+ 'cached_entity must be an object or a class name'
+ );
+ }
+
+ $this->_cachedEntity = $cachedEntity;
+ $this->_specificOptions['cached_entity'] = $cachedEntity;
+
+ if (is_string($this->_cachedEntity)) {
+ $this->_cachedEntityLabel = $this->_cachedEntity;
+ } else {
+ $ro = new ReflectionObject($this->_cachedEntity);
+ $this->_cachedEntityLabel = $ro->getName();
+ }
+ }
+
+ /**
+ * Set the cache array
+ *
+ * @param array $tags
+ * @return void
+ */
+ public function setTagsArray($tags = array())
+ {
+ $this->_tags = $tags;
+ }
+
+ /**
+ * Main method : call the specified method or get the result from cache
+ *
+ * @param string $name Method name
+ * @param array $parameters Method parameters
+ * @return mixed Result
+ * @throws Exception
+ */
+ public function __call($name, $parameters)
+ {
+ $callback = array($this->_cachedEntity, $name);
+
+ if (!is_callable($callback, false)) {
+ Zend_Cache::throwException('Invalid callback');
+ }
+
+ $cacheBool1 = $this->_specificOptions['cache_by_default'];
+ $cacheBool2 = in_array($name, $this->_specificOptions['cached_methods']);
+ $cacheBool3 = in_array($name, $this->_specificOptions['non_cached_methods']);
+ $cache = (($cacheBool1 || $cacheBool2) && (!$cacheBool3));
+
+ if (!$cache) {
+ // We do not have not cache
+ return call_user_func_array($callback, $parameters);
+ }
+
+ $id = $this->makeId($name, $parameters);
+ if (($rs = $this->load($id)) && (array_key_exists(0, $rs))
+ && (array_key_exists(1, $rs))
+ ) {
+ // A cache is available
+ $output = $rs[0];
+ $return = $rs[1];
+ } else {
+ // A cache is not available (or not valid for this frontend)
+ ob_start();
+ ob_implicit_flush(false);
+
+ try {
+ $return = call_user_func_array($callback, $parameters);
+ $output = ob_get_clean();
+ $data = array($output, $return);
+
+ $this->save(
+ $data, $id, $this->_tags, $this->_specificLifetime,
+ $this->_priority
+ );
+ } catch (Exception $e) {
+ ob_end_clean();
+ throw $e;
+ }
+ }
+
+ echo $output;
+ return $return;
+ }
+
+ /**
+ * ZF-9970
+ *
+ * @deprecated
+ */
+ private function _makeId($name, $args)
+ {
+ return $this->makeId($name, $args);
+ }
+
+ /**
+ * Make a cache id from the method name and parameters
+ *
+ * @param string $name Method name
+ * @param array $args Method parameters
+ * @return string Cache id
+ */
+ public function makeId($name, array $args = array())
+ {
+ return md5($this->_cachedEntityLabel . '__' . $name . '__' . serialize($args));
+ }
+}
diff --git a/library/vendor/Zend/Cache/Frontend/File.php b/library/vendor/Zend/Cache/Frontend/File.php
new file mode 100644
index 0000000..98cd5a3
--- /dev/null
+++ b/library/vendor/Zend/Cache/Frontend/File.php
@@ -0,0 +1,221 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Frontend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Cache_Core
+ */
+
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Frontend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Frontend_File extends Zend_Cache_Core
+{
+
+ /**
+ * Consts for master_files_mode
+ */
+ const MODE_AND = 'AND';
+ const MODE_OR = 'OR';
+
+ /**
+ * Available options
+ *
+ * ====> (string) master_file :
+ * - a complete path of the master file
+ * - deprecated (see master_files)
+ *
+ * ====> (array) master_files :
+ * - an array of complete path of master files
+ * - this option has to be set !
+ *
+ * ====> (string) master_files_mode :
+ * - Zend_Cache_Frontend_File::MODE_AND or Zend_Cache_Frontend_File::MODE_OR
+ * - if MODE_AND, then all master files have to be touched to get a cache invalidation
+ * - if MODE_OR (default), then a single touched master file is enough to get a cache invalidation
+ *
+ * ====> (boolean) ignore_missing_master_files
+ * - if set to true, missing master files are ignored silently
+ * - if set to false (default), an exception is thrown if there is a missing master file
+ * @var array available options
+ */
+ protected $_specificOptions = array(
+ 'master_file' => null,
+ 'master_files' => null,
+ 'master_files_mode' => 'OR',
+ 'ignore_missing_master_files' => false
+ );
+
+ /**
+ * Master file mtimes
+ *
+ * Array of int
+ *
+ * @var array
+ */
+ private $_masterFile_mtimes = null;
+
+ /**
+ * Constructor
+ *
+ * @param array $options Associative array of options
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ public function __construct(array $options = array())
+ {
+ foreach ($options as $name => $value) {
+ $this->setOption($name, $value);
+ }
+ if (!isset($this->_specificOptions['master_files'])) {
+ Zend_Cache::throwException('master_files option must be set');
+ }
+ }
+
+ /**
+ * Change the master_files option
+ *
+ * @param array $masterFiles the complete paths and name of the master files
+ */
+ public function setMasterFiles(array $masterFiles)
+ {
+ $this->_specificOptions['master_file'] = null; // to keep a compatibility
+ $this->_specificOptions['master_files'] = null;
+ $this->_masterFile_mtimes = array();
+
+ clearstatcache();
+ $i = 0;
+ foreach ($masterFiles as $masterFile) {
+ if (file_exists($masterFile)) {
+ $mtime = filemtime($masterFile);
+ } else {
+ $mtime = false;
+ }
+
+ if (!$this->_specificOptions['ignore_missing_master_files'] && !$mtime) {
+ Zend_Cache::throwException('Unable to read master_file : ' . $masterFile);
+ }
+
+ $this->_masterFile_mtimes[$i] = $mtime;
+ $this->_specificOptions['master_files'][$i] = $masterFile;
+ if ($i === 0) { // to keep a compatibility
+ $this->_specificOptions['master_file'] = $masterFile;
+ }
+
+ $i++;
+ }
+ }
+
+ /**
+ * Change the master_file option
+ *
+ * To keep the compatibility
+ *
+ * @deprecated
+ * @param string $masterFile the complete path and name of the master file
+ */
+ public function setMasterFile($masterFile)
+ {
+ $this->setMasterFiles(array($masterFile));
+ }
+
+ /**
+ * Public frontend to set an option
+ *
+ * Just a wrapper to get a specific behaviour for master_file
+ *
+ * @param string $name Name of the option
+ * @param mixed $value Value of the option
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ public function setOption($name, $value)
+ {
+ if ($name == 'master_file') {
+ $this->setMasterFile($value);
+ } else if ($name == 'master_files') {
+ $this->setMasterFiles($value);
+ } else {
+ parent::setOption($name, $value);
+ }
+ }
+
+ /**
+ * Test if a cache is available for the given id and (if yes) return it (false else)
+ *
+ * @param string $id Cache id
+ * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
+ * @param boolean $doNotUnserialize Do not serialize (even if automatic_serialization is true) => for internal use
+ * @return mixed|false Cached datas
+ */
+ public function load($id, $doNotTestCacheValidity = false, $doNotUnserialize = false)
+ {
+ if (!$doNotTestCacheValidity) {
+ if ($this->test($id)) {
+ return parent::load($id, true, $doNotUnserialize);
+ }
+ return false;
+ }
+ return parent::load($id, true, $doNotUnserialize);
+ }
+
+ /**
+ * Test if a cache is available for the given id
+ *
+ * @param string $id Cache id
+ * @return int|false Last modified time of cache entry if it is available, false otherwise
+ */
+ public function test($id)
+ {
+ $lastModified = parent::test($id);
+ if ($lastModified) {
+ if ($this->_specificOptions['master_files_mode'] == self::MODE_AND) {
+ // MODE_AND
+ foreach($this->_masterFile_mtimes as $masterFileMTime) {
+ if ($masterFileMTime) {
+ if ($lastModified > $masterFileMTime) {
+ return $lastModified;
+ }
+ }
+ }
+ } else {
+ // MODE_OR
+ $res = true;
+ foreach($this->_masterFile_mtimes as $masterFileMTime) {
+ if ($masterFileMTime) {
+ if ($lastModified <= $masterFileMTime) {
+ return false;
+ }
+ }
+ }
+ return $lastModified;
+ }
+ }
+ return false;
+ }
+
+}
+
diff --git a/library/vendor/Zend/Cache/Frontend/Function.php b/library/vendor/Zend/Cache/Frontend/Function.php
new file mode 100644
index 0000000..3dc7fd8
--- /dev/null
+++ b/library/vendor/Zend/Cache/Frontend/Function.php
@@ -0,0 +1,178 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Frontend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Cache_Core
+ */
+
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Frontend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Frontend_Function extends Zend_Cache_Core
+{
+ /**
+ * This frontend specific options
+ *
+ * ====> (boolean) cache_by_default :
+ * - if true, function calls will be cached by default
+ *
+ * ====> (array) cached_functions :
+ * - an array of function names which will be cached (even if cache_by_default = false)
+ *
+ * ====> (array) non_cached_functions :
+ * - an array of function names which won't be cached (even if cache_by_default = true)
+ *
+ * @var array options
+ */
+ protected $_specificOptions = array(
+ 'cache_by_default' => true,
+ 'cached_functions' => array(),
+ 'non_cached_functions' => array()
+ );
+
+ /**
+ * Constructor
+ *
+ * @param array $options Associative array of options
+ * @return void
+ */
+ public function __construct(array $options = array())
+ {
+ foreach ($options as $name => $value) {
+ $this->setOption($name, $value);
+ }
+ $this->setOption('automatic_serialization', true);
+ }
+
+ /**
+ * Main method : call the specified function or get the result from cache
+ *
+ * @param callback $callback A valid callback
+ * @param array $parameters Function parameters
+ * @param array $tags Cache tags
+ * @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
+ * @param int $priority integer between 0 (very low priority) and 10 (maximum priority) used by some particular backends
+ * @return mixed Result
+ */
+ public function call($callback, array $parameters = array(), $tags = array(), $specificLifetime = false, $priority = 8)
+ {
+ if (!is_callable($callback, true, $name)) {
+ Zend_Cache::throwException('Invalid callback');
+ }
+
+ $cacheBool1 = $this->_specificOptions['cache_by_default'];
+ $cacheBool2 = in_array($name, $this->_specificOptions['cached_functions']);
+ $cacheBool3 = in_array($name, $this->_specificOptions['non_cached_functions']);
+ $cache = (($cacheBool1 || $cacheBool2) && (!$cacheBool3));
+ if (!$cache) {
+ // Caching of this callback is disabled
+ return call_user_func_array($callback, $parameters);
+ }
+
+ $id = $this->_makeId($callback, $parameters);
+ if ( ($rs = $this->load($id)) && isset($rs[0], $rs[1])) {
+ // A cache is available
+ $output = $rs[0];
+ $return = $rs[1];
+ } else {
+ // A cache is not available (or not valid for this frontend)
+ ob_start();
+ ob_implicit_flush(false);
+ $return = call_user_func_array($callback, $parameters);
+ $output = ob_get_clean();
+ $data = array($output, $return);
+ $this->save($data, $id, $tags, $specificLifetime, $priority);
+ }
+
+ echo $output;
+ return $return;
+ }
+
+ /**
+ * ZF-9970
+ *
+ * @deprecated
+ */
+ private function _makeId($callback, array $args)
+ {
+ return $this->makeId($callback, $args);
+ }
+
+ /**
+ * Make a cache id from the function name and parameters
+ *
+ * @param callback $callback A valid callback
+ * @param array $args Function parameters
+ * @throws Zend_Cache_Exception
+ * @return string Cache id
+ */
+ public function makeId($callback, array $args = array())
+ {
+ if (!is_callable($callback, true, $name)) {
+ Zend_Cache::throwException('Invalid callback');
+ }
+
+ // functions, methods and classnames are case-insensitive
+ $name = strtolower($name);
+
+ // generate a unique id for object callbacks
+ if (is_object($callback)) { // Closures & __invoke
+ $object = $callback;
+ } elseif (isset($callback[0])) { // array($object, 'method')
+ $object = $callback[0];
+ }
+ if (isset($object)) {
+ try {
+ $tmp = @serialize($callback);
+ } catch (Exception $e) {
+ Zend_Cache::throwException($e->getMessage());
+ }
+ if (!$tmp) {
+ $lastErr = error_get_last();
+ Zend_Cache::throwException("Can't serialize callback object to generate id: {$lastErr['message']}");
+ }
+ $name.= '__' . $tmp;
+ }
+
+ // generate a unique id for arguments
+ $argsStr = '';
+ if ($args) {
+ try {
+ $argsStr = @serialize(array_values($args));
+ } catch (Exception $e) {
+ Zend_Cache::throwException($e->getMessage());
+ }
+ if (!$argsStr) {
+ $lastErr = error_get_last();
+ throw Zend_Cache::throwException("Can't serialize arguments to generate id: {$lastErr['message']}");
+ }
+ }
+
+ return md5($name . $argsStr);
+ }
+
+}
diff --git a/library/vendor/Zend/Cache/Frontend/Output.php b/library/vendor/Zend/Cache/Frontend/Output.php
new file mode 100644
index 0000000..dd8fe8d
--- /dev/null
+++ b/library/vendor/Zend/Cache/Frontend/Output.php
@@ -0,0 +1,104 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Frontend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Cache_Core
+ */
+
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Frontend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Frontend_Output extends Zend_Cache_Core
+{
+
+ private $_idStack = array();
+
+ /**
+ * Constructor
+ *
+ * @param array $options Associative array of options
+ * @return void
+ */
+ public function __construct(array $options = array())
+ {
+ parent::__construct($options);
+ $this->_idStack = array();
+ }
+
+ /**
+ * Start the cache
+ *
+ * @param string $id Cache id
+ * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
+ * @param boolean $echoData If set to true, datas are sent to the browser if the cache is hit (simply returned else)
+ * @return mixed True if the cache is hit (false else) with $echoData=true (default) ; string else (datas)
+ */
+ public function start($id, $doNotTestCacheValidity = false, $echoData = true)
+ {
+ $data = $this->load($id, $doNotTestCacheValidity);
+ if ($data !== false) {
+ if ( $echoData ) {
+ echo($data);
+ return true;
+ } else {
+ return $data;
+ }
+ }
+ ob_start();
+ ob_implicit_flush(false);
+ $this->_idStack[] = $id;
+ return false;
+ }
+
+ /**
+ * Stop the cache
+ *
+ * @param array $tags Tags array
+ * @param int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
+ * @param string $forcedDatas If not null, force written datas with this
+ * @param boolean $echoData If set to true, datas are sent to the browser
+ * @param int $priority integer between 0 (very low priority) and 10 (maximum priority) used by some particular backends
+ * @return void
+ */
+ public function end($tags = array(), $specificLifetime = false, $forcedDatas = null, $echoData = true, $priority = 8)
+ {
+ if ($forcedDatas === null) {
+ $data = ob_get_clean();
+ } else {
+ $data =& $forcedDatas;
+ }
+ $id = array_pop($this->_idStack);
+ if ($id === null) {
+ Zend_Cache::throwException('use of end() without a start()');
+ }
+ $this->save($data, $id, $tags, $specificLifetime, $priority);
+ if ($echoData) {
+ echo($data);
+ }
+ }
+
+}
diff --git a/library/vendor/Zend/Cache/Frontend/Page.php b/library/vendor/Zend/Cache/Frontend/Page.php
new file mode 100644
index 0000000..8326281
--- /dev/null
+++ b/library/vendor/Zend/Cache/Frontend/Page.php
@@ -0,0 +1,403 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Frontend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Cache_Core
+ */
+
+
+/**
+ * @package Zend_Cache
+ * @subpackage Zend_Cache_Frontend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Frontend_Page extends Zend_Cache_Core
+{
+ /**
+ * This frontend specific options
+ *
+ * ====> (boolean) http_conditional :
+ * - if true, http conditional mode is on
+ * WARNING : http_conditional OPTION IS NOT IMPLEMENTED FOR THE MOMENT (TODO)
+ *
+ * ====> (boolean) debug_header :
+ * - if true, a debug text is added before each cached pages
+ *
+ * ====> (boolean) content_type_memorization :
+ * - deprecated => use memorize_headers instead
+ * - if the Content-Type header is sent after the cache was started, the
+ * corresponding value can be memorized and replayed when the cache is hit
+ * (if false (default), the frontend doesn't take care of Content-Type header)
+ *
+ * ====> (array) memorize_headers :
+ * - an array of strings corresponding to some HTTP headers name. Listed headers
+ * will be stored with cache datas and "replayed" when the cache is hit
+ *
+ * ====> (array) default_options :
+ * - an associative array of default options :
+ * - (boolean) cache : cache is on by default if true
+ * - (boolean) cacheWithXXXVariables (XXXX = 'Get', 'Post', 'Session', 'Files' or 'Cookie') :
+ * if true, cache is still on even if there are some variables in this superglobal array
+ * if false, cache is off if there are some variables in this superglobal array
+ * - (boolean) makeIdWithXXXVariables (XXXX = 'Get', 'Post', 'Session', 'Files' or 'Cookie') :
+ * if true, we have to use the content of this superglobal array to make a cache id
+ * if false, the cache id won't be dependent of the content of this superglobal array
+ * - (int) specific_lifetime : cache specific lifetime
+ * (false => global lifetime is used, null => infinite lifetime,
+ * integer => this lifetime is used), this "lifetime" is probably only
+ * usefull when used with "regexps" array
+ * - (array) tags : array of tags (strings)
+ * - (int) priority : integer between 0 (very low priority) and 10 (maximum priority) used by
+ * some particular backends
+ *
+ * ====> (array) regexps :
+ * - an associative array to set options only for some REQUEST_URI
+ * - keys are (pcre) regexps
+ * - values are associative array with specific options to set if the regexp matchs on $_SERVER['REQUEST_URI']
+ * (see default_options for the list of available options)
+ * - if several regexps match the $_SERVER['REQUEST_URI'], only the last one will be used
+ *
+ * @var array options
+ */
+ protected $_specificOptions = array(
+ 'http_conditional' => false,
+ 'debug_header' => false,
+ 'content_type_memorization' => false,
+ 'memorize_headers' => array(),
+ 'default_options' => array(
+ 'cache_with_get_variables' => false,
+ 'cache_with_post_variables' => false,
+ 'cache_with_session_variables' => false,
+ 'cache_with_files_variables' => false,
+ 'cache_with_cookie_variables' => false,
+ 'make_id_with_get_variables' => true,
+ 'make_id_with_post_variables' => true,
+ 'make_id_with_session_variables' => true,
+ 'make_id_with_files_variables' => true,
+ 'make_id_with_cookie_variables' => true,
+ 'cache' => true,
+ 'specific_lifetime' => false,
+ 'tags' => array(),
+ 'priority' => null
+ ),
+ 'regexps' => array()
+ );
+
+ /**
+ * Internal array to store some options
+ *
+ * @var array associative array of options
+ */
+ protected $_activeOptions = array();
+
+ /**
+ * If true, the page won't be cached
+ *
+ * @var boolean
+ */
+ protected $_cancel = false;
+
+ /**
+ * Constructor
+ *
+ * @param array $options Associative array of options
+ * @param boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ public function __construct(array $options = array())
+ {
+ foreach ($options as $name => $value) {
+ $name = strtolower($name);
+ switch ($name) {
+ case 'regexps':
+ $this->_setRegexps($value);
+ break;
+ case 'default_options':
+ $this->_setDefaultOptions($value);
+ break;
+ case 'content_type_memorization':
+ $this->_setContentTypeMemorization($value);
+ break;
+ default:
+ $this->setOption($name, $value);
+ }
+ }
+ if (isset($this->_specificOptions['http_conditional'])) {
+ if ($this->_specificOptions['http_conditional']) {
+ Zend_Cache::throwException('http_conditional is not implemented for the moment !');
+ }
+ }
+ $this->setOption('automatic_serialization', true);
+ }
+
+ /**
+ * Specific setter for the 'default_options' option (with some additional tests)
+ *
+ * @param array $options Associative array
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ protected function _setDefaultOptions($options)
+ {
+ if (!is_array($options)) {
+ Zend_Cache::throwException('default_options must be an array !');
+ }
+ foreach ($options as $key=>$value) {
+ if (!is_string($key)) {
+ Zend_Cache::throwException("invalid option [$key] !");
+ }
+ $key = strtolower($key);
+ if (isset($this->_specificOptions['default_options'][$key])) {
+ $this->_specificOptions['default_options'][$key] = $value;
+ }
+ }
+ }
+
+ /**
+ * Set the deprecated contentTypeMemorization option
+ *
+ * @param boolean $value value
+ * @return void
+ * @deprecated
+ */
+ protected function _setContentTypeMemorization($value)
+ {
+ $found = null;
+ foreach ($this->_specificOptions['memorize_headers'] as $key => $value) {
+ if (strtolower($value) == 'content-type') {
+ $found = $key;
+ }
+ }
+ if ($value) {
+ if (!$found) {
+ $this->_specificOptions['memorize_headers'][] = 'Content-Type';
+ }
+ } else {
+ if ($found) {
+ unset($this->_specificOptions['memorize_headers'][$found]);
+ }
+ }
+ }
+
+ /**
+ * Specific setter for the 'regexps' option (with some additional tests)
+ *
+ * @param array $options Associative array
+ * @throws Zend_Cache_Exception
+ * @return void
+ */
+ protected function _setRegexps($regexps)
+ {
+ if (!is_array($regexps)) {
+ Zend_Cache::throwException('regexps option must be an array !');
+ }
+ foreach ($regexps as $regexp=>$conf) {
+ if (!is_array($conf)) {
+ Zend_Cache::throwException('regexps option must be an array of arrays !');
+ }
+ $validKeys = array_keys($this->_specificOptions['default_options']);
+ foreach ($conf as $key=>$value) {
+ if (!is_string($key)) {
+ Zend_Cache::throwException("unknown option [$key] !");
+ }
+ $key = strtolower($key);
+ if (!in_array($key, $validKeys)) {
+ unset($regexps[$regexp][$key]);
+ }
+ }
+ }
+ $this->setOption('regexps', $regexps);
+ }
+
+ /**
+ * Start the cache
+ *
+ * @param string $id (optional) A cache id (if you set a value here, maybe you have to use Output frontend instead)
+ * @param boolean $doNotDie For unit testing only !
+ * @return boolean True if the cache is hit (false else)
+ */
+ public function start($id = false, $doNotDie = false)
+ {
+ $this->_cancel = false;
+ $lastMatchingRegexp = null;
+ if (isset($_SERVER['REQUEST_URI'])) {
+ foreach ($this->_specificOptions['regexps'] as $regexp => $conf) {
+ if (preg_match("`$regexp`", $_SERVER['REQUEST_URI'])) {
+ $lastMatchingRegexp = $regexp;
+ }
+ }
+ }
+ $this->_activeOptions = $this->_specificOptions['default_options'];
+ if ($lastMatchingRegexp !== null) {
+ $conf = $this->_specificOptions['regexps'][$lastMatchingRegexp];
+ foreach ($conf as $key=>$value) {
+ $this->_activeOptions[$key] = $value;
+ }
+ }
+ if (!($this->_activeOptions['cache'])) {
+ return false;
+ }
+ if (!$id) {
+ $id = $this->_makeId();
+ if (!$id) {
+ return false;
+ }
+ }
+ $array = $this->load($id);
+ if ($array !== false) {
+ $data = $array['data'];
+ $headers = $array['headers'];
+ if (!headers_sent()) {
+ foreach ($headers as $key=>$headerCouple) {
+ $name = $headerCouple[0];
+ $value = $headerCouple[1];
+ header("$name: $value");
+ }
+ }
+ if ($this->_specificOptions['debug_header']) {
+ echo 'DEBUG HEADER : This is a cached page !';
+ }
+ echo $data;
+ if ($doNotDie) {
+ return true;
+ }
+ die();
+ }
+ ob_start(array($this, '_flush'));
+ ob_implicit_flush(false);
+ return false;
+ }
+
+ /**
+ * Cancel the current caching process
+ */
+ public function cancel()
+ {
+ $this->_cancel = true;
+ }
+
+ /**
+ * callback for output buffering
+ * (shouldn't really be called manually)
+ *
+ * @param string $data Buffered output
+ * @return string Data to send to browser
+ */
+ public function _flush($data)
+ {
+ if ($this->_cancel) {
+ return $data;
+ }
+ $contentType = null;
+ $storedHeaders = array();
+ $headersList = headers_list();
+ foreach($this->_specificOptions['memorize_headers'] as $key=>$headerName) {
+ foreach ($headersList as $headerSent) {
+ $tmp = explode(':', $headerSent);
+ $headerSentName = trim(array_shift($tmp));
+ if (strtolower($headerName) == strtolower($headerSentName)) {
+ $headerSentValue = trim(implode(':', $tmp));
+ $storedHeaders[] = array($headerSentName, $headerSentValue);
+ }
+ }
+ }
+ $array = array(
+ 'data' => $data,
+ 'headers' => $storedHeaders
+ );
+ $this->save($array, null, $this->_activeOptions['tags'], $this->_activeOptions['specific_lifetime'], $this->_activeOptions['priority']);
+ return $data;
+ }
+
+ /**
+ * Make an id depending on REQUEST_URI and superglobal arrays (depending on options)
+ *
+ * @return mixed|false a cache id (string), false if the cache should have not to be used
+ */
+ protected function _makeId()
+ {
+ $tmp = $_SERVER['REQUEST_URI'];
+ $array = explode('?', $tmp, 2);
+ $tmp = $array[0];
+ foreach (array('Get', 'Post', 'Session', 'Files', 'Cookie') as $arrayName) {
+ $tmp2 = $this->_makePartialId($arrayName, $this->_activeOptions['cache_with_' . strtolower($arrayName) . '_variables'], $this->_activeOptions['make_id_with_' . strtolower($arrayName) . '_variables']);
+ if ($tmp2===false) {
+ return false;
+ }
+ $tmp = $tmp . $tmp2;
+ }
+ return md5($tmp);
+ }
+
+ /**
+ * Make a partial id depending on options
+ *
+ * @param string $arrayName Superglobal array name
+ * @param bool $bool1 If true, cache is still on even if there are some variables in the superglobal array
+ * @param bool $bool2 If true, we have to use the content of the superglobal array to make a partial id
+ * @return mixed|false Partial id (string) or false if the cache should have not to be used
+ */
+ protected function _makePartialId($arrayName, $bool1, $bool2)
+ {
+ switch ($arrayName) {
+ case 'Get':
+ $var = $_GET;
+ break;
+ case 'Post':
+ $var = $_POST;
+ break;
+ case 'Session':
+ if (isset($_SESSION)) {
+ $var = $_SESSION;
+ } else {
+ $var = null;
+ }
+ break;
+ case 'Cookie':
+ if (isset($_COOKIE)) {
+ $var = $_COOKIE;
+ } else {
+ $var = null;
+ }
+ break;
+ case 'Files':
+ $var = $_FILES;
+ break;
+ default:
+ return false;
+ }
+ if ($bool1) {
+ if ($bool2) {
+ return serialize($var);
+ }
+ return '';
+ }
+ if (count($var) > 0) {
+ return false;
+ }
+ return '';
+ }
+
+}
diff --git a/library/vendor/Zend/Cache/Manager.php b/library/vendor/Zend/Cache/Manager.php
new file mode 100644
index 0000000..5196c19
--- /dev/null
+++ b/library/vendor/Zend/Cache/Manager.php
@@ -0,0 +1,304 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Cache
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** @see Zend_Cache_Exception */
+
+/** @see Zend_Cache */
+
+/**
+ * @category Zend
+ * @package Zend_Cache
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Cache_Manager
+{
+ /**
+ * Constant holding reserved name for default Page Cache
+ */
+ const PAGECACHE = 'page';
+
+ /**
+ * Constant holding reserved name for default Page Tag Cache
+ */
+ const PAGETAGCACHE = 'pagetag';
+
+ /**
+ * Array of caches stored by the Cache Manager instance
+ *
+ * @var array
+ */
+ protected $_caches = array();
+
+ /**
+ * Array of ready made configuration templates for lazy
+ * loading caches.
+ *
+ * @var array
+ */
+ protected $_optionTemplates = array(
+ // Simple Common Default
+ 'default' => array(
+ 'frontend' => array(
+ 'name' => 'Core',
+ 'options' => array(
+ 'automatic_serialization' => true,
+ ),
+ ),
+ 'backend' => array(
+ 'name' => 'File',
+ 'options' => array(
+ // use system temp dir by default of file backend
+ // 'cache_dir' => '../cache',
+ ),
+ ),
+ ),
+
+ // Static Page HTML Cache
+ 'page' => array(
+ 'frontend' => array(
+ 'name' => 'Capture',
+ 'options' => array(
+ 'ignore_user_abort' => true,
+ ),
+ ),
+ 'backend' => array(
+ 'name' => 'Static',
+ 'options' => array(
+ 'public_dir' => '../public',
+ ),
+ ),
+ ),
+
+ // Tag Cache
+ 'pagetag' => array(
+ 'frontend' => array(
+ 'name' => 'Core',
+ 'options' => array(
+ 'automatic_serialization' => true,
+ 'lifetime' => null
+ ),
+ ),
+ 'backend' => array(
+ 'name' => 'File',
+ 'options' => array(
+ // use system temp dir by default of file backend
+ // 'cache_dir' => '../cache',
+ // use default umask of file backend
+ // 'cache_file_umask' => 0644
+ ),
+ ),
+ ),
+ );
+
+ /**
+ * Set a new cache for the Cache Manager to contain
+ *
+ * @param string $name
+ * @param Zend_Cache_Core $cache
+ * @return Zend_Cache_Manager
+ */
+ public function setCache($name, Zend_Cache_Core $cache)
+ {
+ $this->_caches[$name] = $cache;
+ return $this;
+ }
+
+ /**
+ * Check if the Cache Manager contains the named cache object, or a named
+ * configuration template to lazy load the cache object
+ *
+ * @param string $name
+ * @return bool
+ */
+ public function hasCache($name)
+ {
+ if (isset($this->_caches[$name])
+ || $this->hasCacheTemplate($name)
+ ) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Fetch the named cache object, or instantiate and return a cache object
+ * using a named configuration template
+ *
+ * @param string $name
+ * @return Zend_Cache_Core
+ */
+ public function getCache($name)
+ {
+ if (isset($this->_caches[$name])) {
+ return $this->_caches[$name];
+ }
+ if (isset($this->_optionTemplates[$name])) {
+ if ($name == self::PAGECACHE
+ && (!isset($this->_optionTemplates[$name]['backend']['options']['tag_cache'])
+ || !$this->_optionTemplates[$name]['backend']['options']['tag_cache'] instanceof Zend_Cache_Core)
+ ) {
+ $this->_optionTemplates[$name]['backend']['options']['tag_cache']
+ = $this->getCache(self::PAGETAGCACHE);
+ }
+
+ $this->_caches[$name] = Zend_Cache::factory(
+ $this->_optionTemplates[$name]['frontend']['name'],
+ $this->_optionTemplates[$name]['backend']['name'],
+ isset($this->_optionTemplates[$name]['frontend']['options']) ? $this->_optionTemplates[$name]['frontend']['options'] : array(),
+ isset($this->_optionTemplates[$name]['backend']['options']) ? $this->_optionTemplates[$name]['backend']['options'] : array(),
+ isset($this->_optionTemplates[$name]['frontend']['customFrontendNaming']) ? $this->_optionTemplates[$name]['frontend']['customFrontendNaming'] : false,
+ isset($this->_optionTemplates[$name]['backend']['customBackendNaming']) ? $this->_optionTemplates[$name]['backend']['customBackendNaming'] : false,
+ isset($this->_optionTemplates[$name]['frontendBackendAutoload']) ? $this->_optionTemplates[$name]['frontendBackendAutoload'] : false
+ );
+
+ return $this->_caches[$name];
+ }
+ }
+
+ /**
+ * Fetch all available caches
+ *
+ * @return array An array of all available caches with it's names as key
+ */
+ public function getCaches()
+ {
+ $caches = $this->_caches;
+ foreach ($this->_optionTemplates as $name => $tmp) {
+ if (!isset($caches[$name])) {
+ $caches[$name] = $this->getCache($name);
+ }
+ }
+ return $caches;
+ }
+
+ /**
+ * Set a named configuration template from which a cache object can later
+ * be lazy loaded
+ *
+ * @param string $name
+ * @param array $options
+ * @return Zend_Cache_Manager
+ * @throws Zend_Cache_Exception
+ */
+ public function setCacheTemplate($name, $options)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } elseif (!is_array($options)) {
+ throw new Zend_Cache_Exception('Options passed must be in'
+ . ' an associative array or instance of Zend_Config');
+ }
+ $this->_optionTemplates[$name] = $options;
+ return $this;
+ }
+
+ /**
+ * Check if the named configuration template
+ *
+ * @param string $name
+ * @return bool
+ */
+ public function hasCacheTemplate($name)
+ {
+ if (isset($this->_optionTemplates[$name])) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Get the named configuration template
+ *
+ * @param string $name
+ * @return array
+ */
+ public function getCacheTemplate($name)
+ {
+ if (isset($this->_optionTemplates[$name])) {
+ return $this->_optionTemplates[$name];
+ }
+ }
+
+ /**
+ * Pass an array containing changes to be applied to a named
+ * configuration
+ * template
+ *
+ * @param string $name
+ * @param array $options
+ * @return Zend_Cache_Manager
+ * @throws Zend_Cache_Exception for invalid options format or if option templates do not have $name
+ */
+ public function setTemplateOptions($name, $options)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } elseif (!is_array($options)) {
+ throw new Zend_Cache_Exception('Options passed must be in'
+ . ' an associative array or instance of Zend_Config');
+ }
+ if (!isset($this->_optionTemplates[$name])) {
+ throw new Zend_Cache_Exception('A cache configuration template'
+ . 'does not exist with the name "' . $name . '"');
+ }
+ $this->_optionTemplates[$name]
+ = $this->_mergeOptions($this->_optionTemplates[$name], $options);
+ return $this;
+ }
+
+ /**
+ * Simple method to merge two configuration arrays
+ *
+ * @param array $current
+ * @param array $options
+ * @return array
+ */
+ protected function _mergeOptions(array $current, array $options)
+ {
+ if (isset($options['frontend']['name'])) {
+ $current['frontend']['name'] = $options['frontend']['name'];
+ }
+ if (isset($options['backend']['name'])) {
+ $current['backend']['name'] = $options['backend']['name'];
+ }
+ if (isset($options['frontend']['options'])) {
+ foreach ($options['frontend']['options'] as $key => $value) {
+ $current['frontend']['options'][$key] = $value;
+ }
+ }
+ if (isset($options['backend']['options'])) {
+ foreach ($options['backend']['options'] as $key => $value) {
+ $current['backend']['options'][$key] = $value;
+ }
+ }
+ if (isset($options['frontend']['customFrontendNaming'])) {
+ $current['frontend']['customFrontendNaming'] = $options['frontend']['customFrontendNaming'];
+ }
+ if (isset($options['backend']['customBackendNaming'])) {
+ $current['backend']['customBackendNaming'] = $options['backend']['customBackendNaming'];
+ }
+ if (isset($options['frontendBackendAutoload'])) {
+ $current['frontendBackendAutoload'] = $options['frontendBackendAutoload'];
+ }
+ return $current;
+ }
+}
diff --git a/library/vendor/Zend/Config.php b/library/vendor/Zend/Config.php
new file mode 100644
index 0000000..59c3265
--- /dev/null
+++ b/library/vendor/Zend/Config.php
@@ -0,0 +1,481 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Config
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Config
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Config implements Countable, Iterator
+{
+ /**
+ * Whether in-memory modifications to configuration data are allowed
+ *
+ * @var boolean
+ */
+ protected $_allowModifications;
+
+ /**
+ * Iteration index
+ *
+ * @var integer
+ */
+ protected $_index;
+
+ /**
+ * Number of elements in configuration data
+ *
+ * @var integer
+ */
+ protected $_count;
+
+ /**
+ * Contains array of configuration data
+ *
+ * @var array
+ */
+ protected $_data;
+
+ /**
+ * Used when unsetting values during iteration to ensure we do not skip
+ * the next element
+ *
+ * @var boolean
+ */
+ protected $_skipNextIteration;
+
+ /**
+ * Contains which config file sections were loaded. This is null
+ * if all sections were loaded, a string name if one section is loaded
+ * and an array of string names if multiple sections were loaded.
+ *
+ * @var mixed
+ */
+ protected $_loadedSection;
+
+ /**
+ * This is used to track section inheritance. The keys are names of sections that
+ * extend other sections, and the values are the extended sections.
+ *
+ * @var array
+ */
+ protected $_extends = array();
+
+ /**
+ * Load file error string.
+ *
+ * Is null if there was no error while file loading
+ *
+ * @var string
+ */
+ protected $_loadFileErrorStr = null;
+
+ /**
+ * Zend_Config provides a property based interface to
+ * an array. The data are read-only unless $allowModifications
+ * is set to true on construction.
+ *
+ * Zend_Config also implements Countable and Iterator to
+ * facilitate easy access to the data.
+ *
+ * @param array $array
+ * @param boolean $allowModifications
+ * @return void
+ */
+ public function __construct(array $array, $allowModifications = false)
+ {
+ $this->_allowModifications = (boolean) $allowModifications;
+ $this->_loadedSection = null;
+ $this->_index = 0;
+ $this->_data = array();
+ foreach ($array as $key => $value) {
+ if (is_array($value)) {
+ $this->_data[$key] = new self($value, $this->_allowModifications);
+ } else {
+ $this->_data[$key] = $value;
+ }
+ }
+ $this->_count = count($this->_data);
+ }
+
+ /**
+ * Retrieve a value and return $default if there is no element set.
+ *
+ * @param string $name
+ * @param mixed $default
+ * @return mixed
+ */
+ public function get($name, $default = null)
+ {
+ $result = $default;
+ if (array_key_exists($name, $this->_data)) {
+ $result = $this->_data[$name];
+ }
+ return $result;
+ }
+
+ /**
+ * Magic function so that $obj->value will work.
+ *
+ * @param string $name
+ * @return mixed
+ */
+ public function __get($name)
+ {
+ return $this->get($name);
+ }
+
+ /**
+ * Only allow setting of a property if $allowModifications
+ * was set to true on construction. Otherwise, throw an exception.
+ *
+ * @param string $name
+ * @param mixed $value
+ * @throws Zend_Config_Exception
+ * @return void
+ */
+ public function __set($name, $value)
+ {
+ if ($this->_allowModifications) {
+ if (is_array($value)) {
+ $this->_data[$name] = new self($value, true);
+ } else {
+ $this->_data[$name] = $value;
+ }
+ $this->_count = count($this->_data);
+ } else {
+ /** @see Zend_Config_Exception */
+ throw new Zend_Config_Exception('Zend_Config is read only');
+ }
+ }
+
+ /**
+ * Deep clone of this instance to ensure that nested Zend_Configs
+ * are also cloned.
+ *
+ * @return void
+ */
+ public function __clone()
+ {
+ $array = array();
+ foreach ($this->_data as $key => $value) {
+ if ($value instanceof Zend_Config) {
+ $array[$key] = clone $value;
+ } else {
+ $array[$key] = $value;
+ }
+ }
+ $this->_data = $array;
+ }
+
+ /**
+ * Return an associative array of the stored data.
+ *
+ * @return array
+ */
+ public function toArray()
+ {
+ $array = array();
+ $data = $this->_data;
+ foreach ($data as $key => $value) {
+ if ($value instanceof Zend_Config) {
+ $array[$key] = $value->toArray();
+ } else {
+ $array[$key] = $value;
+ }
+ }
+ return $array;
+ }
+
+ /**
+ * Support isset() overloading on PHP 5.1
+ *
+ * @param string $name
+ * @return boolean
+ */
+ public function __isset($name)
+ {
+ return isset($this->_data[$name]);
+ }
+
+ /**
+ * Support unset() overloading on PHP 5.1
+ *
+ * @param string $name
+ * @throws Zend_Config_Exception
+ * @return void
+ */
+ public function __unset($name)
+ {
+ if ($this->_allowModifications) {
+ unset($this->_data[$name]);
+ $this->_count = count($this->_data);
+ $this->_skipNextIteration = true;
+ } else {
+ /** @see Zend_Config_Exception */
+ throw new Zend_Config_Exception('Zend_Config is read only');
+ }
+
+ }
+
+ /**
+ * Defined by Countable interface
+ *
+ * @return int
+ */
+ public function count()
+ {
+ return $this->_count;
+ }
+
+ /**
+ * Defined by Iterator interface
+ *
+ * @return mixed
+ */
+ public function current()
+ {
+ $this->_skipNextIteration = false;
+ return current($this->_data);
+ }
+
+ /**
+ * Defined by Iterator interface
+ *
+ * @return mixed
+ */
+ public function key()
+ {
+ return key($this->_data);
+ }
+
+ /**
+ * Defined by Iterator interface
+ *
+ */
+ public function next()
+ {
+ if ($this->_skipNextIteration) {
+ $this->_skipNextIteration = false;
+ return;
+ }
+ next($this->_data);
+ $this->_index++;
+ }
+
+ /**
+ * Defined by Iterator interface
+ *
+ */
+ public function rewind()
+ {
+ $this->_skipNextIteration = false;
+ reset($this->_data);
+ $this->_index = 0;
+ }
+
+ /**
+ * Defined by Iterator interface
+ *
+ * @return boolean
+ */
+ public function valid()
+ {
+ return $this->_index < $this->_count;
+ }
+
+ /**
+ * Returns the section name(s) loaded.
+ *
+ * @return mixed
+ */
+ public function getSectionName()
+ {
+ if(is_array($this->_loadedSection) && count($this->_loadedSection) == 1) {
+ $this->_loadedSection = $this->_loadedSection[0];
+ }
+ return $this->_loadedSection;
+ }
+
+ /**
+ * Returns true if all sections were loaded
+ *
+ * @return boolean
+ */
+ public function areAllSectionsLoaded()
+ {
+ return $this->_loadedSection === null;
+ }
+
+
+ /**
+ * Merge another Zend_Config with this one. The items
+ * in $merge will override the same named items in
+ * the current config.
+ *
+ * @param Zend_Config $merge
+ * @return Zend_Config
+ */
+ public function merge(Zend_Config $merge)
+ {
+ foreach($merge as $key => $item) {
+ if(array_key_exists($key, $this->_data)) {
+ if($item instanceof Zend_Config && $this->$key instanceof Zend_Config) {
+ $this->$key = $this->$key->merge(new Zend_Config($item->toArray(), !$this->readOnly()));
+ } else {
+ $this->$key = $item;
+ }
+ } else {
+ if($item instanceof Zend_Config) {
+ $this->$key = new Zend_Config($item->toArray(), !$this->readOnly());
+ } else {
+ $this->$key = $item;
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Prevent any more modifications being made to this instance. Useful
+ * after merge() has been used to merge multiple Zend_Config objects
+ * into one object which should then not be modified again.
+ *
+ */
+ public function setReadOnly()
+ {
+ $this->_allowModifications = false;
+ foreach ($this->_data as $key => $value) {
+ if ($value instanceof Zend_Config) {
+ $value->setReadOnly();
+ }
+ }
+ }
+
+ /**
+ * Returns if this Zend_Config object is read only or not.
+ *
+ * @return boolean
+ */
+ public function readOnly()
+ {
+ return !$this->_allowModifications;
+ }
+
+ /**
+ * Get the current extends
+ *
+ * @return array
+ */
+ public function getExtends()
+ {
+ return $this->_extends;
+ }
+
+ /**
+ * Set an extend for Zend_Config_Writer
+ *
+ * @param string $extendingSection
+ * @param string $extendedSection
+ * @return void
+ */
+ public function setExtend($extendingSection, $extendedSection = null)
+ {
+ if ($extendedSection === null && isset($this->_extends[$extendingSection])) {
+ unset($this->_extends[$extendingSection]);
+ } else if ($extendedSection !== null) {
+ $this->_extends[$extendingSection] = $extendedSection;
+ }
+ }
+
+ /**
+ * Throws an exception if $extendingSection may not extend $extendedSection,
+ * and tracks the section extension if it is valid.
+ *
+ * @param string $extendingSection
+ * @param string $extendedSection
+ * @throws Zend_Config_Exception
+ * @return void
+ */
+ protected function _assertValidExtend($extendingSection, $extendedSection)
+ {
+ // detect circular section inheritance
+ $extendedSectionCurrent = $extendedSection;
+ while (array_key_exists($extendedSectionCurrent, $this->_extends)) {
+ if ($this->_extends[$extendedSectionCurrent] == $extendingSection) {
+ /** @see Zend_Config_Exception */
+ throw new Zend_Config_Exception('Illegal circular inheritance detected');
+ }
+ $extendedSectionCurrent = $this->_extends[$extendedSectionCurrent];
+ }
+ // remember that this section extends another section
+ $this->_extends[$extendingSection] = $extendedSection;
+ }
+
+ /**
+ * Handle any errors from simplexml_load_file or parse_ini_file
+ *
+ * @param integer $errno
+ * @param string $errstr
+ * @param string $errfile
+ * @param integer $errline
+ */
+ public function _loadFileErrorHandler($errno, $errstr, $errfile, $errline)
+ {
+ if ($this->_loadFileErrorStr === null) {
+ $this->_loadFileErrorStr = $errstr;
+ } else {
+ $this->_loadFileErrorStr .= (PHP_EOL . $errstr);
+ }
+ }
+
+ /**
+ * Merge two arrays recursively, overwriting keys of the same name
+ * in $firstArray with the value in $secondArray.
+ *
+ * @param mixed $firstArray First array
+ * @param mixed $secondArray Second array to merge into first array
+ * @return array
+ */
+ protected function _arrayMergeRecursive($firstArray, $secondArray)
+ {
+ if (is_array($firstArray) && is_array($secondArray)) {
+ foreach ($secondArray as $key => $value) {
+ if (isset($firstArray[$key])) {
+ $firstArray[$key] = $this->_arrayMergeRecursive($firstArray[$key], $value);
+ } else {
+ if($key === 0) {
+ $firstArray= array(0=>$this->_arrayMergeRecursive($firstArray, $value));
+ } else {
+ $firstArray[$key] = $value;
+ }
+ }
+ }
+ } else {
+ $firstArray = $secondArray;
+ }
+
+ return $firstArray;
+ }
+}
diff --git a/library/vendor/Zend/Config/Exception.php b/library/vendor/Zend/Config/Exception.php
new file mode 100644
index 0000000..abffe5b
--- /dev/null
+++ b/library/vendor/Zend/Config/Exception.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Config
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Exception
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Config
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Config_Exception extends Zend_Exception {}
diff --git a/library/vendor/Zend/Config/Ini.php b/library/vendor/Zend/Config/Ini.php
new file mode 100644
index 0000000..55ca56f
--- /dev/null
+++ b/library/vendor/Zend/Config/Ini.php
@@ -0,0 +1,301 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Config
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Config
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Config
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Config_Ini extends Zend_Config
+{
+ /**
+ * String that separates nesting levels of configuration data identifiers
+ *
+ * @var string
+ */
+ protected $_nestSeparator = '.';
+
+ /**
+ * String that separates the parent section name
+ *
+ * @var string
+ */
+ protected $_sectionSeparator = ':';
+
+ /**
+ * Whether to skip extends or not
+ *
+ * @var boolean
+ */
+ protected $_skipExtends = false;
+
+ /**
+ * Loads the section $section from the config file $filename for
+ * access facilitated by nested object properties.
+ *
+ * If the section name contains a ":" then the section name to the right
+ * is loaded and included into the properties. Note that the keys in
+ * this $section will override any keys of the same
+ * name in the sections that have been included via ":".
+ *
+ * If the $section is null, then all sections in the ini file are loaded.
+ *
+ * If any key includes a ".", then this will act as a separator to
+ * create a sub-property.
+ *
+ * example ini file:
+ * [all]
+ * db.connection = database
+ * hostname = live
+ *
+ * [staging : all]
+ * hostname = staging
+ *
+ * after calling $data = new Zend_Config_Ini($file, 'staging'); then
+ * $data->hostname === "staging"
+ * $data->db->connection === "database"
+ *
+ * The $options parameter may be provided as either a boolean or an array.
+ * If provided as a boolean, this sets the $allowModifications option of
+ * Zend_Config. If provided as an array, there are three configuration
+ * directives that may be set. For example:
+ *
+ * $options = array(
+ * 'allowModifications' => false,
+ * 'nestSeparator' => ':',
+ * 'skipExtends' => false,
+ * );
+ *
+ * @param string $filename
+ * @param mixed $section
+ * @param boolean|array $options
+ * @throws Zend_Config_Exception
+ * @return void
+ */
+ public function __construct($filename, $section = null, $options = false)
+ {
+ if (empty($filename)) {
+ /**
+ * @see Zend_Config_Exception
+ */
+ throw new Zend_Config_Exception('Filename is not set');
+ }
+
+ $allowModifications = false;
+ if (is_bool($options)) {
+ $allowModifications = $options;
+ } elseif (is_array($options)) {
+ if (isset($options['allowModifications'])) {
+ $allowModifications = (bool) $options['allowModifications'];
+ }
+ if (isset($options['nestSeparator'])) {
+ $this->_nestSeparator = (string) $options['nestSeparator'];
+ }
+ if (isset($options['skipExtends'])) {
+ $this->_skipExtends = (bool) $options['skipExtends'];
+ }
+ }
+
+ $iniArray = $this->_loadIniFile($filename);
+
+ if (null === $section) {
+ // Load entire file
+ $dataArray = array();
+ foreach ($iniArray as $sectionName => $sectionData) {
+ if(!is_array($sectionData)) {
+ $dataArray = $this->_arrayMergeRecursive($dataArray, $this->_processKey(array(), $sectionName, $sectionData));
+ } else {
+ $dataArray[$sectionName] = $this->_processSection($iniArray, $sectionName);
+ }
+ }
+ parent::__construct($dataArray, $allowModifications);
+ } else {
+ // Load one or more sections
+ if (!is_array($section)) {
+ $section = array($section);
+ }
+ $dataArray = array();
+ foreach ($section as $sectionName) {
+ if (!isset($iniArray[$sectionName])) {
+ /**
+ * @see Zend_Config_Exception
+ */
+ throw new Zend_Config_Exception("Section '$sectionName' cannot be found in $filename");
+ }
+ $dataArray = $this->_arrayMergeRecursive($this->_processSection($iniArray, $sectionName), $dataArray);
+
+ }
+ parent::__construct($dataArray, $allowModifications);
+ }
+
+ $this->_loadedSection = $section;
+ }
+
+ /**
+ * Load the INI file from disk using parse_ini_file(). Use a private error
+ * handler to convert any loading errors into a Zend_Config_Exception
+ *
+ * @param string $filename
+ * @throws Zend_Config_Exception
+ * @return array
+ */
+ protected function _parseIniFile($filename)
+ {
+ set_error_handler(array($this, '_loadFileErrorHandler'));
+ $iniArray = parse_ini_file($filename, true); // Warnings and errors are suppressed
+ restore_error_handler();
+
+ // Check if there was a error while loading file
+ if ($this->_loadFileErrorStr !== null) {
+ /**
+ * @see Zend_Config_Exception
+ */
+ throw new Zend_Config_Exception($this->_loadFileErrorStr);
+ }
+
+ return $iniArray;
+ }
+
+ /**
+ * Load the ini file and preprocess the section separator (':' in the
+ * section name (that is used for section extension) so that the resultant
+ * array has the correct section names and the extension information is
+ * stored in a sub-key called ';extends'. We use ';extends' as this can
+ * never be a valid key name in an INI file that has been loaded using
+ * parse_ini_file().
+ *
+ * @param string $filename
+ * @throws Zend_Config_Exception
+ * @return array
+ */
+ protected function _loadIniFile($filename)
+ {
+ $loaded = $this->_parseIniFile($filename);
+ $iniArray = array();
+ foreach ($loaded as $key => $data)
+ {
+ $pieces = explode($this->_sectionSeparator, $key);
+ $thisSection = trim($pieces[0]);
+ switch (count($pieces)) {
+ case 1:
+ $iniArray[$thisSection] = $data;
+ break;
+
+ case 2:
+ $extendedSection = trim($pieces[1]);
+ $iniArray[$thisSection] = array_merge(array(';extends'=>$extendedSection), $data);
+ break;
+
+ default:
+ /**
+ * @see Zend_Config_Exception
+ */
+ throw new Zend_Config_Exception("Section '$thisSection' may not extend multiple sections in $filename");
+ }
+ }
+
+ return $iniArray;
+ }
+
+ /**
+ * Process each element in the section and handle the ";extends" inheritance
+ * key. Passes control to _processKey() to handle the nest separator
+ * sub-property syntax that may be used within the key name.
+ *
+ * @param array $iniArray
+ * @param string $section
+ * @param array $config
+ * @throws Zend_Config_Exception
+ * @return array
+ */
+ protected function _processSection($iniArray, $section, $config = array())
+ {
+ $thisSection = $iniArray[$section];
+
+ foreach ($thisSection as $key => $value) {
+ if (strtolower($key) == ';extends') {
+ if (isset($iniArray[$value])) {
+ $this->_assertValidExtend($section, $value);
+
+ if (!$this->_skipExtends) {
+ $config = $this->_processSection($iniArray, $value, $config);
+ }
+ } else {
+ /**
+ * @see Zend_Config_Exception
+ */
+ throw new Zend_Config_Exception("Parent section '$section' cannot be found");
+ }
+ } else {
+ $config = $this->_processKey($config, $key, $value);
+ }
+ }
+ return $config;
+ }
+
+ /**
+ * Assign the key's value to the property list. Handles the
+ * nest separator for sub-properties.
+ *
+ * @param array $config
+ * @param string $key
+ * @param string $value
+ * @throws Zend_Config_Exception
+ * @return array
+ */
+ protected function _processKey($config, $key, $value)
+ {
+ if (strpos($key, $this->_nestSeparator) !== false) {
+ $pieces = explode($this->_nestSeparator, $key, 2);
+ if (strlen($pieces[0]) && strlen($pieces[1])) {
+ if (!isset($config[$pieces[0]])) {
+ if ($pieces[0] === '0' && !empty($config)) {
+ // convert the current values in $config into an array
+ $config = array($pieces[0] => $config);
+ } else {
+ $config[$pieces[0]] = array();
+ }
+ } elseif (!is_array($config[$pieces[0]])) {
+ /**
+ * @see Zend_Config_Exception
+ */
+ throw new Zend_Config_Exception("Cannot create sub-key for '{$pieces[0]}' as key already exists");
+ }
+ $config[$pieces[0]] = $this->_processKey($config[$pieces[0]], $pieces[1], $value);
+ } else {
+ /**
+ * @see Zend_Config_Exception
+ */
+ throw new Zend_Config_Exception("Invalid key '$key'");
+ }
+ } else {
+ $config[$key] = $value;
+ }
+ return $config;
+ }
+}
diff --git a/library/vendor/Zend/Config/Writer.php b/library/vendor/Zend/Config/Writer.php
new file mode 100644
index 0000000..8c255b3
--- /dev/null
+++ b/library/vendor/Zend/Config/Writer.php
@@ -0,0 +1,101 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Config
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Config
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Config_Writer
+{
+ /**
+ * Option keys to skip when calling setOptions()
+ *
+ * @var array
+ */
+ protected $_skipOptions = array(
+ 'options'
+ );
+
+ /**
+ * Config object to write
+ *
+ * @var Zend_Config
+ */
+ protected $_config = null;
+
+ /**
+ * Create a new adapter
+ *
+ * $options can only be passed as array or be omitted
+ *
+ * @param null|array $options
+ */
+ public function __construct(array $options = null)
+ {
+ if (is_array($options)) {
+ $this->setOptions($options);
+ }
+ }
+
+ /**
+ * Set options via a Zend_Config instance
+ *
+ * @param Zend_Config $config
+ * @return Zend_Config_Writer
+ */
+ public function setConfig(Zend_Config $config)
+ {
+ $this->_config = $config;
+
+ return $this;
+ }
+
+ /**
+ * Set options via an array
+ *
+ * @param array $options
+ * @return Zend_Config_Writer
+ */
+ public function setOptions(array $options)
+ {
+ foreach ($options as $key => $value) {
+ if (in_array(strtolower($key), $this->_skipOptions)) {
+ continue;
+ }
+
+ $method = 'set' . ucfirst($key);
+ if (method_exists($this, $method)) {
+ $this->$method($value);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Write a Zend_Config object to it's target
+ *
+ * @return void
+ */
+ abstract public function write();
+}
diff --git a/library/vendor/Zend/Config/Writer/Array.php b/library/vendor/Zend/Config/Writer/Array.php
new file mode 100644
index 0000000..f7cd502
--- /dev/null
+++ b/library/vendor/Zend/Config/Writer/Array.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Config
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Config_Writer
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Config
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Config_Writer_Array extends Zend_Config_Writer_FileAbstract
+{
+ /**
+ * Render a Zend_Config into a PHP Array config string.
+ *
+ * @since 1.10
+ * @return string
+ */
+ public function render()
+ {
+ $data = $this->_config->toArray();
+ $sectionName = $this->_config->getSectionName();
+
+ if (is_string($sectionName)) {
+ $data = array($sectionName => $data);
+ }
+
+ $arrayString = "<?php\n"
+ . "return " . var_export($data, true) . ";\n";
+
+ return $arrayString;
+ }
+}
diff --git a/library/vendor/Zend/Config/Writer/FileAbstract.php b/library/vendor/Zend/Config/Writer/FileAbstract.php
new file mode 100644
index 0000000..242b49d
--- /dev/null
+++ b/library/vendor/Zend/Config/Writer/FileAbstract.php
@@ -0,0 +1,130 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Config
+ * @package Writer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+
+/**
+ * Abstract File Writer
+ *
+ * @category Zend
+ * @package Zend_package
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Config_Writer_FileAbstract extends Zend_Config_Writer
+{
+ /**
+ * Filename to write to
+ *
+ * @var string
+ */
+ protected $_filename = null;
+
+ /**
+ * Wether to exclusively lock the file or not
+ *
+ * @var boolean
+ */
+ protected $_exclusiveLock = false;
+
+ /**
+ * Set the target filename
+ *
+ * @param string $filename
+ * @return Zend_Config_Writer_Array
+ */
+ public function setFilename($filename)
+ {
+ $this->_filename = $filename;
+
+ return $this;
+ }
+
+ /**
+ * Set wether to exclusively lock the file or not
+ *
+ * @param boolean $exclusiveLock
+ * @return Zend_Config_Writer_Array
+ */
+ public function setExclusiveLock($exclusiveLock)
+ {
+ $this->_exclusiveLock = $exclusiveLock;
+
+ return $this;
+ }
+
+ /**
+ * Write configuration to file.
+ *
+ * @param string $filename
+ * @param Zend_Config $config
+ * @param bool $exclusiveLock
+ * @return void
+ */
+ public function write($filename = null, Zend_Config $config = null, $exclusiveLock = null)
+ {
+ if ($filename !== null) {
+ $this->setFilename($filename);
+ }
+
+ if ($config !== null) {
+ $this->setConfig($config);
+ }
+
+ if ($exclusiveLock !== null) {
+ $this->setExclusiveLock($exclusiveLock);
+ }
+
+ if ($this->_filename === null) {
+ throw new Zend_Config_Exception('No filename was set');
+ }
+
+ if ($this->_config === null) {
+ throw new Zend_Config_Exception('No config was set');
+ }
+
+ $configString = $this->render();
+
+ $flags = 0;
+
+ if ($this->_exclusiveLock) {
+ $flags |= LOCK_EX;
+ }
+
+ $result = @file_put_contents($this->_filename, $configString, $flags);
+
+ if ($result === false) {
+ throw new Zend_Config_Exception('Could not write to file "' . $this->_filename . '"');
+ }
+ }
+
+ /**
+ * Render a Zend_Config into a config file string.
+ *
+ * @since 1.10
+ * @todo For 2.0 this should be redone into an abstract method.
+ * @return string
+ */
+ public function render()
+ {
+ return "";
+ }
+}
diff --git a/library/vendor/Zend/Config/Writer/Ini.php b/library/vendor/Zend/Config/Writer/Ini.php
new file mode 100644
index 0000000..67aaf89
--- /dev/null
+++ b/library/vendor/Zend/Config/Writer/Ini.php
@@ -0,0 +1,191 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Config
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Config_Writer
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Config
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Config_Writer_Ini extends Zend_Config_Writer_FileAbstract
+{
+ /**
+ * String that separates nesting levels of configuration data identifiers
+ *
+ * @var string
+ */
+ protected $_nestSeparator = '.';
+
+ /**
+ * If true the ini string is rendered in the global namespace without sections.
+ *
+ * @var bool
+ */
+ protected $_renderWithoutSections = false;
+
+ /**
+ * Set the nest separator
+ *
+ * @param string $filename
+ * @return Zend_Config_Writer_Ini
+ */
+ public function setNestSeparator($separator)
+ {
+ $this->_nestSeparator = $separator;
+
+ return $this;
+ }
+
+ /**
+ * Set if rendering should occour without sections or not.
+ *
+ * If set to true, the INI file is rendered without sections completely
+ * into the global namespace of the INI file.
+ *
+ * @param bool $withoutSections
+ * @return Zend_Config_Writer_Ini
+ */
+ public function setRenderWithoutSections($withoutSections=true)
+ {
+ $this->_renderWithoutSections = (bool)$withoutSections;
+ return $this;
+ }
+
+ /**
+ * Render a Zend_Config into a INI config string.
+ *
+ * @since 1.10
+ * @return string
+ */
+ public function render()
+ {
+ $iniString = '';
+ $extends = $this->_config->getExtends();
+ $sectionName = $this->_config->getSectionName();
+
+ if($this->_renderWithoutSections == true) {
+ $iniString .= $this->_addBranch($this->_config);
+ } else if (is_string($sectionName)) {
+ $iniString .= '[' . $sectionName . ']' . "\n"
+ . $this->_addBranch($this->_config)
+ . "\n";
+ } else {
+ $config = $this->_sortRootElements($this->_config);
+ foreach ($config as $sectionName => $data) {
+ if (!($data instanceof Zend_Config)) {
+ $iniString .= $sectionName
+ . ' = '
+ . $this->_prepareValue($data)
+ . "\n";
+ } else {
+ if (isset($extends[$sectionName])) {
+ $sectionName .= ' : ' . $extends[$sectionName];
+ }
+
+ $iniString .= '[' . $sectionName . ']' . "\n"
+ . $this->_addBranch($data)
+ . "\n";
+ }
+ }
+ }
+
+ return $iniString;
+ }
+
+ /**
+ * Add a branch to an INI string recursively
+ *
+ * @param Zend_Config $config
+ * @return void
+ */
+ protected function _addBranch(Zend_Config $config, $parents = array())
+ {
+ $iniString = '';
+
+ foreach ($config as $key => $value) {
+ $group = array_merge($parents, array($key));
+
+ if ($value instanceof Zend_Config) {
+ $iniString .= $this->_addBranch($value, $group);
+ } else {
+ $iniString .= implode($this->_nestSeparator, $group)
+ . ' = '
+ . $this->_prepareValue($value)
+ . "\n";
+ }
+ }
+
+ return $iniString;
+ }
+
+ /**
+ * Prepare a value for INI
+ *
+ * @param mixed $value
+ * @return string
+ */
+ protected function _prepareValue($value)
+ {
+ if (is_integer($value) || is_float($value)) {
+ return $value;
+ } elseif (is_bool($value)) {
+ return ($value ? 'true' : 'false');
+ } elseif (strpos($value, '"') === false) {
+ return '"' . $value . '"';
+ } else {
+ /** @see Zend_Config_Exception */
+ throw new Zend_Config_Exception('Value can not contain double quotes "');
+ }
+ }
+
+ /**
+ * Root elements that are not assigned to any section needs to be
+ * on the top of config.
+ *
+ * @see http://framework.zend.com/issues/browse/ZF-6289
+ * @param Zend_Config
+ * @return Zend_Config
+ */
+ protected function _sortRootElements(Zend_Config $config)
+ {
+ $configArray = $config->toArray();
+ $sections = array();
+
+ // remove sections from config array
+ foreach ($configArray as $key => $value) {
+ if (is_array($value)) {
+ $sections[$key] = $value;
+ unset($configArray[$key]);
+ }
+ }
+
+ // readd sections to the end
+ foreach ($sections as $key => $value) {
+ $configArray[$key] = $value;
+ }
+
+ return new Zend_Config($configArray);
+ }
+}
diff --git a/library/vendor/Zend/Controller/Action.php b/library/vendor/Zend/Controller/Action.php
new file mode 100644
index 0000000..35c450a
--- /dev/null
+++ b/library/vendor/Zend/Controller/Action.php
@@ -0,0 +1,789 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Controller_Action_HelperBroker
+ */
+
+/**
+ * @see Zend_Controller_Action_Interface
+ */
+
+/**
+ * @see Zend_Controller_Front
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Controller
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Controller_Action implements Zend_Controller_Action_Interface
+{
+ /**
+ * @var array of existing class methods
+ */
+ protected $_classMethods;
+
+ /**
+ * Word delimiters (used for normalizing view script paths)
+ * @var array
+ */
+ protected $_delimiters;
+
+ /**
+ * Array of arguments provided to the constructor, minus the
+ * {@link $_request Request object}.
+ * @var array
+ */
+ protected $_invokeArgs = array();
+
+ /**
+ * Front controller instance
+ * @var Zend_Controller_Front
+ */
+ protected $_frontController;
+
+ /**
+ * Zend_Controller_Request_Abstract object wrapping the request environment
+ * @var Zend_Controller_Request_Abstract
+ */
+ protected $_request = null;
+
+ /**
+ * Zend_Controller_Response_Abstract object wrapping the response
+ * @var Zend_Controller_Response_Abstract
+ */
+ protected $_response = null;
+
+ /**
+ * View script suffix; defaults to 'phtml'
+ * @see {render()}
+ * @var string
+ */
+ public $viewSuffix = 'phtml';
+
+ /**
+ * View object
+ * @var Zend_View_Interface
+ */
+ public $view;
+
+ /**
+ * Helper Broker to assist in routing help requests to the proper object
+ *
+ * @var Zend_Controller_Action_HelperBroker
+ */
+ protected $_helper = null;
+
+ /**
+ * Class constructor
+ *
+ * The request and response objects should be registered with the
+ * controller, as should be any additional optional arguments; these will be
+ * available via {@link getRequest()}, {@link getResponse()}, and
+ * {@link getInvokeArgs()}, respectively.
+ *
+ * When overriding the constructor, please consider this usage as a best
+ * practice and ensure that each is registered appropriately; the easiest
+ * way to do so is to simply call parent::__construct($request, $response,
+ * $invokeArgs).
+ *
+ * After the request, response, and invokeArgs are set, the
+ * {@link $_helper helper broker} is initialized.
+ *
+ * Finally, {@link init()} is called as the final action of
+ * instantiation, and may be safely overridden to perform initialization
+ * tasks; as a general rule, override {@link init()} instead of the
+ * constructor to customize an action controller's instantiation.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @param Zend_Controller_Response_Abstract $response
+ * @param array $invokeArgs Any additional invocation arguments
+ * @return void
+ */
+ public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
+ {
+ $this->setRequest($request)
+ ->setResponse($response)
+ ->_setInvokeArgs($invokeArgs);
+ $this->_helper = new Zend_Controller_Action_HelperBroker($this);
+ $this->init();
+ }
+
+ /**
+ * Initialize object
+ *
+ * Called from {@link __construct()} as final step of object instantiation.
+ *
+ * @return void
+ */
+ public function init()
+ {
+ }
+
+ /**
+ * Initialize View object
+ *
+ * Initializes {@link $view} if not otherwise a Zend_View_Interface.
+ *
+ * If {@link $view} is not otherwise set, instantiates a new Zend_View
+ * object, using the 'views' subdirectory at the same level as the
+ * controller directory for the current module as the base directory.
+ * It uses this to set the following:
+ * - script path = views/scripts/
+ * - helper path = views/helpers/
+ * - filter path = views/filters/
+ *
+ * @return Zend_View_Interface
+ * @throws Zend_Controller_Exception if base view directory does not exist
+ */
+ public function initView()
+ {
+ if (!$this->getInvokeArg('noViewRenderer') && $this->_helper->hasHelper('viewRenderer')) {
+ return $this->view;
+ }
+
+ if (isset($this->view) && ($this->view instanceof Zend_View_Interface)) {
+ return $this->view;
+ }
+
+ $request = $this->getRequest();
+ $module = $request->getModuleName();
+ $dirs = $this->getFrontController()->getControllerDirectory();
+ if (empty($module) || !isset($dirs[$module])) {
+ $module = $this->getFrontController()->getDispatcher()->getDefaultModule();
+ }
+ $baseDir = dirname($dirs[$module]) . DIRECTORY_SEPARATOR . 'views';
+ if (!file_exists($baseDir) || !is_dir($baseDir)) {
+ throw new Zend_Controller_Exception('Missing base view directory ("' . $baseDir . '")');
+ }
+
+ $this->view = new Zend_View(array('basePath' => $baseDir));
+
+ return $this->view;
+ }
+
+ /**
+ * Render a view
+ *
+ * Renders a view. By default, views are found in the view script path as
+ * <controller>/<action>.phtml. You may change the script suffix by
+ * resetting {@link $viewSuffix}. You may omit the controller directory
+ * prefix by specifying boolean true for $noController.
+ *
+ * By default, the rendered contents are appended to the response. You may
+ * specify the named body content segment to set by specifying a $name.
+ *
+ * @see Zend_Controller_Response_Abstract::appendBody()
+ * @param string|null $action Defaults to action registered in request object
+ * @param string|null $name Response object named path segment to use; defaults to null
+ * @param bool $noController Defaults to false; i.e. use controller name as subdir in which to search for view script
+ * @return void
+ */
+ public function render($action = null, $name = null, $noController = false)
+ {
+ if (!$this->getInvokeArg('noViewRenderer') && $this->_helper->hasHelper('viewRenderer')) {
+ return $this->_helper->viewRenderer->render($action, $name, $noController);
+ }
+
+ $view = $this->initView();
+ $script = $this->getViewScript($action, $noController);
+
+ $this->getResponse()->appendBody(
+ $view->render($script),
+ $name
+ );
+ }
+
+ /**
+ * Render a given view script
+ *
+ * Similar to {@link render()}, this method renders a view script. Unlike render(),
+ * however, it does not autodetermine the view script via {@link getViewScript()},
+ * but instead renders the script passed to it. Use this if you know the
+ * exact view script name and path you wish to use, or if using paths that do not
+ * conform to the spec defined with getViewScript().
+ *
+ * By default, the rendered contents are appended to the response. You may
+ * specify the named body content segment to set by specifying a $name.
+ *
+ * @param string $script
+ * @param string $name
+ * @return void
+ */
+ public function renderScript($script, $name = null)
+ {
+ if (!$this->getInvokeArg('noViewRenderer') && $this->_helper->hasHelper('viewRenderer')) {
+ return $this->_helper->viewRenderer->renderScript($script, $name);
+ }
+
+ $view = $this->initView();
+ $this->getResponse()->appendBody(
+ $view->render($script),
+ $name
+ );
+ }
+
+ /**
+ * Construct view script path
+ *
+ * Used by render() to determine the path to the view script.
+ *
+ * @param string $action Defaults to action registered in request object
+ * @param bool $noController Defaults to false; i.e. use controller name as subdir in which to search for view script
+ * @return string
+ * @throws Zend_Controller_Exception with bad $action
+ */
+ public function getViewScript($action = null, $noController = null)
+ {
+ if (!$this->getInvokeArg('noViewRenderer') && $this->_helper->hasHelper('viewRenderer')) {
+ $viewRenderer = $this->_helper->getHelper('viewRenderer');
+ if (null !== $noController) {
+ $viewRenderer->setNoController($noController);
+ }
+ return $viewRenderer->getViewScript($action);
+ }
+
+ $request = $this->getRequest();
+ if (null === $action) {
+ $action = $request->getActionName();
+ } elseif (!is_string($action)) {
+ throw new Zend_Controller_Exception('Invalid action specifier for view render');
+ }
+
+ if (null === $this->_delimiters) {
+ $dispatcher = Zend_Controller_Front::getInstance()->getDispatcher();
+ $wordDelimiters = $dispatcher->getWordDelimiter();
+ $pathDelimiters = $dispatcher->getPathDelimiter();
+ $this->_delimiters = array_unique(array_merge($wordDelimiters, (array) $pathDelimiters));
+ }
+
+ $action = str_replace($this->_delimiters, '-', $action);
+ $script = $action . '.' . $this->viewSuffix;
+
+ if (!$noController) {
+ $controller = $request->getControllerName();
+ $controller = str_replace($this->_delimiters, '-', $controller);
+ $script = $controller . DIRECTORY_SEPARATOR . $script;
+ }
+
+ return $script;
+ }
+
+ /**
+ * Return the Request object
+ *
+ * @return Zend_Controller_Request_Abstract
+ */
+ public function getRequest()
+ {
+ return $this->_request;
+ }
+
+ /**
+ * Set the Request object
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return Zend_Controller_Action
+ */
+ public function setRequest(Zend_Controller_Request_Abstract $request)
+ {
+ $this->_request = $request;
+ return $this;
+ }
+
+ /**
+ * Return the Response object
+ *
+ * @return Zend_Controller_Response_Abstract
+ */
+ public function getResponse()
+ {
+ return $this->_response;
+ }
+
+ /**
+ * Set the Response object
+ *
+ * @param Zend_Controller_Response_Abstract $response
+ * @return Zend_Controller_Action
+ */
+ public function setResponse(Zend_Controller_Response_Abstract $response)
+ {
+ $this->_response = $response;
+ return $this;
+ }
+
+ /**
+ * Set invocation arguments
+ *
+ * @param array $args
+ * @return Zend_Controller_Action
+ */
+ protected function _setInvokeArgs(array $args = array())
+ {
+ $this->_invokeArgs = $args;
+ return $this;
+ }
+
+ /**
+ * Return the array of constructor arguments (minus the Request object)
+ *
+ * @return array
+ */
+ public function getInvokeArgs()
+ {
+ return $this->_invokeArgs;
+ }
+
+ /**
+ * Return a single invocation argument
+ *
+ * @param string $key
+ * @return mixed
+ */
+ public function getInvokeArg($key)
+ {
+ if (isset($this->_invokeArgs[$key])) {
+ return $this->_invokeArgs[$key];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get a helper by name
+ *
+ * @param string $helperName
+ * @return Zend_Controller_Action_Helper_Abstract
+ */
+ public function getHelper($helperName)
+ {
+ return $this->_helper->{$helperName};
+ }
+
+ /**
+ * Get a clone of a helper by name
+ *
+ * @param string $helperName
+ * @return Zend_Controller_Action_Helper_Abstract
+ */
+ public function getHelperCopy($helperName)
+ {
+ return clone $this->_helper->{$helperName};
+ }
+
+ /**
+ * Set the front controller instance
+ *
+ * @param Zend_Controller_Front $front
+ * @return Zend_Controller_Action
+ */
+ public function setFrontController(Zend_Controller_Front $front)
+ {
+ $this->_frontController = $front;
+ return $this;
+ }
+
+ /**
+ * Retrieve Front Controller
+ *
+ * @return Zend_Controller_Front
+ */
+ public function getFrontController()
+ {
+ // Used cache version if found
+ if (null !== $this->_frontController) {
+ return $this->_frontController;
+ }
+
+ // Grab singleton instance, if class has been loaded
+ if (class_exists('Zend_Controller_Front')) {
+ $this->_frontController = Zend_Controller_Front::getInstance();
+ return $this->_frontController;
+ }
+
+ // Throw exception in all other cases
+ throw new Zend_Controller_Exception('Front controller class has not been loaded');
+ }
+
+ /**
+ * Pre-dispatch routines
+ *
+ * Called before action method. If using class with
+ * {@link Zend_Controller_Front}, it may modify the
+ * {@link $_request Request object} and reset its dispatched flag in order
+ * to skip processing the current action.
+ *
+ * @return void
+ */
+ public function preDispatch()
+ {
+ }
+
+ /**
+ * Post-dispatch routines
+ *
+ * Called after action method execution. If using class with
+ * {@link Zend_Controller_Front}, it may modify the
+ * {@link $_request Request object} and reset its dispatched flag in order
+ * to process an additional action.
+ *
+ * Common usages for postDispatch() include rendering content in a sitewide
+ * template, link url correction, setting headers, etc.
+ *
+ * @return void
+ */
+ public function postDispatch()
+ {
+ }
+
+ /**
+ * Proxy for undefined methods. Default behavior is to throw an
+ * exception on undefined methods, however this function can be
+ * overridden to implement magic (dynamic) actions, or provide run-time
+ * dispatching.
+ *
+ * @param string $methodName
+ * @param array $args
+ * @return void
+ * @throws Zend_Controller_Action_Exception
+ */
+ public function __call($methodName, $args)
+ {
+ if ('Action' == substr($methodName, -6)) {
+ $action = substr($methodName, 0, strlen($methodName) - 6);
+ throw new Zend_Controller_Action_Exception(sprintf('Action "%s" does not exist and was not trapped in __call()', $action), 404);
+ }
+
+ throw new Zend_Controller_Action_Exception(sprintf('Method "%s" does not exist and was not trapped in __call()', $methodName), 500);
+ }
+
+ /**
+ * Dispatch the requested action
+ *
+ * @param string $action Method name of action
+ * @return void
+ */
+ public function dispatch($action)
+ {
+ // Notify helpers of action preDispatch state
+ $this->_helper->notifyPreDispatch();
+
+ $this->preDispatch();
+ if ($this->getRequest()->isDispatched()) {
+ if (null === $this->_classMethods) {
+ $this->_classMethods = get_class_methods($this);
+ }
+
+ // If pre-dispatch hooks introduced a redirect then stop dispatch
+ // @see ZF-7496
+ if (!($this->getResponse()->isRedirect())) {
+ // preDispatch() didn't change the action, so we can continue
+ if ($this->getInvokeArg('useCaseSensitiveActions') || in_array($action, $this->_classMethods)) {
+ if ($this->getInvokeArg('useCaseSensitiveActions')) {
+ trigger_error('Using case sensitive actions without word separators is deprecated; please do not rely on this "feature"');
+ }
+ $this->$action();
+ } else {
+ $this->__call($action, array());
+ }
+ }
+ $this->postDispatch();
+ }
+
+ // whats actually important here is that this action controller is
+ // shutting down, regardless of dispatching; notify the helpers of this
+ // state
+ $this->_helper->notifyPostDispatch();
+ }
+
+ /**
+ * Call the action specified in the request object, and return a response
+ *
+ * Not used in the Action Controller implementation, but left for usage in
+ * Page Controller implementations. Dispatches a method based on the
+ * request.
+ *
+ * Returns a Zend_Controller_Response_Abstract object, instantiating one
+ * prior to execution if none exists in the controller.
+ *
+ * {@link preDispatch()} is called prior to the action,
+ * {@link postDispatch()} is called following it.
+ *
+ * @param null|Zend_Controller_Request_Abstract $request Optional request
+ * object to use
+ * @param null|Zend_Controller_Response_Abstract $response Optional response
+ * object to use
+ * @return Zend_Controller_Response_Abstract
+ */
+ public function run(Zend_Controller_Request_Abstract $request = null, Zend_Controller_Response_Abstract $response = null)
+ {
+ if (null !== $request) {
+ $this->setRequest($request);
+ } else {
+ $request = $this->getRequest();
+ }
+
+ if (null !== $response) {
+ $this->setResponse($response);
+ }
+
+ $action = $request->getActionName();
+ if (empty($action)) {
+ $action = 'index';
+ }
+ $action = $action . 'Action';
+
+ $request->setDispatched(true);
+ $this->dispatch($action);
+
+ return $this->getResponse();
+ }
+
+ /**
+ * Gets a parameter from the {@link $_request Request object}. If the
+ * parameter does not exist, NULL will be returned.
+ *
+ * If the parameter does not exist and $default is set, then
+ * $default will be returned instead of NULL.
+ *
+ * @param string $paramName
+ * @param mixed $default
+ * @return mixed
+ */
+ protected function _getParam($paramName, $default = null)
+ {
+ return $this->getParam($paramName, $default);
+ }
+
+ /**
+ * Gets a parameter from the {@link $_request Request object}. If the
+ * parameter does not exist, NULL will be returned.
+ *
+ * If the parameter does not exist and $default is set, then
+ * $default will be returned instead of NULL.
+ *
+ * @param string $paramName
+ * @param mixed $default
+ * @return mixed
+ */
+ public function getParam($paramName, $default = null)
+ {
+ $value = $this->getRequest()->getParam($paramName);
+ if ((null === $value || '' === $value) && (null !== $default)) {
+ $value = $default;
+ }
+
+ return $value;
+ }
+
+ /**
+ * Set a parameter in the {@link $_request Request object}.
+ *
+ * @param string $paramName
+ * @param mixed $value
+ * @return Zend_Controller_Action
+ * @deprecated Deprecated as of Zend Framework 1.7. Use
+ * setParam() instead.
+ */
+ protected function _setParam($paramName, $value)
+ {
+ return $this->setParam($paramName, $value);
+ }
+
+ /**
+ * Set a parameter in the {@link $_request Request object}.
+ *
+ * @param string $paramName
+ * @param mixed $value
+ * @return Zend_Controller_Action
+ */
+ public function setParam($paramName, $value)
+ {
+ $this->getRequest()->setParam($paramName, $value);
+
+ return $this;
+ }
+
+ /**
+ * Determine whether a given parameter exists in the
+ * {@link $_request Request object}.
+ *
+ * @param string $paramName
+ * @return boolean
+ * @deprecated Deprecated as of Zend Framework 1.7. Use
+ * hasParam() instead.
+ */
+ protected function _hasParam($paramName)
+ {
+ return $this->hasParam($paramName);
+ }
+
+ /**
+ * Determine whether a given parameter exists in the
+ * {@link $_request Request object}.
+ *
+ * @param string $paramName
+ * @return boolean
+ */
+ public function hasParam($paramName)
+ {
+ return null !== $this->getRequest()->getParam($paramName);
+ }
+
+ /**
+ * Return all parameters in the {@link $_request Request object}
+ * as an associative array.
+ *
+ * @return array
+ * @deprecated Deprecated as of Zend Framework 1.7. Use
+ * getAllParams() instead.
+ */
+ protected function _getAllParams()
+ {
+ return $this->getAllParams();
+ }
+
+ /**
+ * Return all parameters in the {@link $_request Request object}
+ * as an associative array.
+ *
+ * @return array
+ */
+ public function getAllParams()
+ {
+ return $this->getRequest()->getParams();
+ }
+
+
+ /**
+ * Forward to another controller/action.
+ *
+ * It is important to supply the unformatted names, i.e. "article"
+ * rather than "ArticleController". The dispatcher will do the
+ * appropriate formatting when the request is received.
+ *
+ * If only an action name is provided, forwards to that action in this
+ * controller.
+ *
+ * If an action and controller are specified, forwards to that action and
+ * controller in this module.
+ *
+ * Specifying an action, controller, and module is the most specific way to
+ * forward.
+ *
+ * A fourth argument, $params, will be used to set the request parameters.
+ * If either the controller or module are unnecessary for forwarding,
+ * simply pass null values for them before specifying the parameters.
+ *
+ * @param string $action
+ * @param string $controller
+ * @param string $module
+ * @param array $params
+ * @return void
+ * @deprecated Deprecated as of Zend Framework 1.7. Use
+ * forward() instead.
+ */
+ final protected function _forward($action, $controller = null, $module = null, array $params = null)
+ {
+ $this->forward($action, $controller, $module, $params);
+ }
+
+ /**
+ * Forward to another controller/action.
+ *
+ * It is important to supply the unformatted names, i.e. "article"
+ * rather than "ArticleController". The dispatcher will do the
+ * appropriate formatting when the request is received.
+ *
+ * If only an action name is provided, forwards to that action in this
+ * controller.
+ *
+ * If an action and controller are specified, forwards to that action and
+ * controller in this module.
+ *
+ * Specifying an action, controller, and module is the most specific way to
+ * forward.
+ *
+ * A fourth argument, $params, will be used to set the request parameters.
+ * If either the controller or module are unnecessary for forwarding,
+ * simply pass null values for them before specifying the parameters.
+ *
+ * @param string $action
+ * @param string $controller
+ * @param string $module
+ * @param array $params
+ * @return void
+ */
+ final public function forward($action, $controller = null, $module = null, array $params = null)
+ {
+ $request = $this->getRequest();
+
+ if (null !== $params) {
+ $request->setParams($params);
+ }
+
+ if (null !== $controller) {
+ $request->setControllerName($controller);
+
+ // Module should only be reset if controller has been specified
+ if (null !== $module) {
+ $request->setModuleName($module);
+ }
+ }
+
+ $request->setActionName($action)
+ ->setDispatched(false);
+ }
+
+ /**
+ * Redirect to another URL
+ *
+ * Proxies to {@link Zend_Controller_Action_Helper_Redirector::gotoUrl()}.
+ *
+ * @param string $url
+ * @param array $options Options to be used when redirecting
+ * @return void
+ * @deprecated Deprecated as of Zend Framework 1.7. Use
+ * redirect() instead.
+ */
+ protected function _redirect($url, array $options = array())
+ {
+ $this->redirect($url, $options);
+ }
+
+ /**
+ * Redirect to another URL
+ *
+ * Proxies to {@link Zend_Controller_Action_Helper_Redirector::gotoUrl()}.
+ *
+ * @param string $url
+ * @param array $options Options to be used when redirecting
+ * @return void
+ */
+ public function redirect($url, array $options = array())
+ {
+ $this->_helper->redirector->gotoUrl($url, $options);
+ }
+}
diff --git a/library/vendor/Zend/Controller/Action/Exception.php b/library/vendor/Zend/Controller/Action/Exception.php
new file mode 100644
index 0000000..1c3438d
--- /dev/null
+++ b/library/vendor/Zend/Controller/Action/Exception.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Controller_Exception
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Action_Exception extends Zend_Controller_Exception
+{}
diff --git a/library/vendor/Zend/Controller/Action/Helper/Abstract.php b/library/vendor/Zend/Controller/Action/Helper/Abstract.php
new file mode 100644
index 0000000..e630be3
--- /dev/null
+++ b/library/vendor/Zend/Controller/Action/Helper/Abstract.php
@@ -0,0 +1,155 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action_Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Controller_Action
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action_Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Controller_Action_Helper_Abstract
+{
+ /**
+ * $_actionController
+ *
+ * @var Zend_Controller_Action $_actionController
+ */
+ protected $_actionController = null;
+
+ /**
+ * @var mixed $_frontController
+ */
+ protected $_frontController = null;
+
+ /**
+ * setActionController()
+ *
+ * @param Zend_Controller_Action $actionController
+ * @return Zend_Controller_ActionHelper_Abstract Provides a fluent interface
+ */
+ public function setActionController(Zend_Controller_Action $actionController = null)
+ {
+ $this->_actionController = $actionController;
+ return $this;
+ }
+
+ /**
+ * Retrieve current action controller
+ *
+ * @return Zend_Controller_Action
+ */
+ public function getActionController()
+ {
+ return $this->_actionController;
+ }
+
+ /**
+ * Retrieve front controller instance
+ *
+ * @return Zend_Controller_Front
+ */
+ public function getFrontController()
+ {
+ return Zend_Controller_Front::getInstance();
+ }
+
+ /**
+ * Hook into action controller initialization
+ *
+ * @return void
+ */
+ public function init()
+ {
+ }
+
+ /**
+ * Hook into action controller preDispatch() workflow
+ *
+ * @return void
+ */
+ public function preDispatch()
+ {
+ }
+
+ /**
+ * Hook into action controller postDispatch() workflow
+ *
+ * @return void
+ */
+ public function postDispatch()
+ {
+ }
+
+ /**
+ * getRequest() -
+ *
+ * @return Zend_Controller_Request_Abstract $request
+ */
+ public function getRequest()
+ {
+ $controller = $this->getActionController();
+ if (null === $controller) {
+ $controller = $this->getFrontController();
+ }
+
+ return $controller->getRequest();
+ }
+
+ /**
+ * getResponse() -
+ *
+ * @return Zend_Controller_Response_Abstract $response
+ */
+ public function getResponse()
+ {
+ $controller = $this->getActionController();
+ if (null === $controller) {
+ $controller = $this->getFrontController();
+ }
+
+ return $controller->getResponse();
+ }
+
+ /**
+ * getName()
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ $fullClassName = get_class($this);
+ if (strpos($fullClassName, '_') !== false) {
+ $helperName = strrchr($fullClassName, '_');
+ return ltrim($helperName, '_');
+ } elseif (strpos($fullClassName, '\\') !== false) {
+ $helperName = strrchr($fullClassName, '\\');
+ return ltrim($helperName, '\\');
+ } else {
+ return $fullClassName;
+ }
+ }
+}
diff --git a/library/vendor/Zend/Controller/Action/Helper/ActionStack.php b/library/vendor/Zend/Controller/Action/Helper/ActionStack.php
new file mode 100644
index 0000000..30fb633
--- /dev/null
+++ b/library/vendor/Zend/Controller/Action/Helper/ActionStack.php
@@ -0,0 +1,133 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action_Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Controller_Action_Helper_Abstract
+ */
+
+/**
+ * Add to action stack
+ *
+ * @uses Zend_Controller_Action_Helper_Abstract
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action_Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Action_Helper_ActionStack extends Zend_Controller_Action_Helper_Abstract
+{
+ /**
+ * @var Zend_Controller_Plugin_ActionStack
+ */
+ protected $_actionStack;
+
+ /**
+ * Constructor
+ *
+ * Register action stack plugin
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ $front = Zend_Controller_Front::getInstance();
+ if (!$front->hasPlugin('Zend_Controller_Plugin_ActionStack')) {
+ /**
+ * @see Zend_Controller_Plugin_ActionStack
+ */
+ $this->_actionStack = new Zend_Controller_Plugin_ActionStack();
+ $front->registerPlugin($this->_actionStack, 97);
+ } else {
+ $this->_actionStack = $front->getPlugin('Zend_Controller_Plugin_ActionStack');
+ }
+ }
+
+ /**
+ * Push onto the stack
+ *
+ * @param Zend_Controller_Request_Abstract $next
+ * @return Zend_Controller_Action_Helper_ActionStack Provides a fluent interface
+ */
+ public function pushStack(Zend_Controller_Request_Abstract $next)
+ {
+ $this->_actionStack->pushStack($next);
+ return $this;
+ }
+
+ /**
+ * Push a new action onto the stack
+ *
+ * @param string $action
+ * @param string $controller
+ * @param string $module
+ * @param array $params
+ * @throws Zend_Controller_Action_Exception
+ * @return Zend_Controller_Action_Helper_ActionStack
+ */
+ public function actionToStack($action, $controller = null, $module = null, array $params = array())
+ {
+ if ($action instanceof Zend_Controller_Request_Abstract) {
+ return $this->pushStack($action);
+ } elseif (!is_string($action)) {
+ /**
+ * @see Zend_Controller_Action_Exception
+ */
+ throw new Zend_Controller_Action_Exception('ActionStack requires either a request object or minimally a string action');
+ }
+
+ $request = $this->getRequest();
+
+ if ($request instanceof Zend_Controller_Request_Abstract === false){
+ /**
+ * @see Zend_Controller_Action_Exception
+ */
+ throw new Zend_Controller_Action_Exception('Request object not set yet');
+ }
+
+ $controller = (null === $controller) ? $request->getControllerName() : $controller;
+ $module = (null === $module) ? $request->getModuleName() : $module;
+
+ /**
+ * @see Zend_Controller_Request_Simple
+ */
+ $newRequest = new Zend_Controller_Request_Simple($action, $controller, $module, $params);
+
+ return $this->pushStack($newRequest);
+ }
+
+ /**
+ * Perform helper when called as $this->_helper->actionStack() from an action controller
+ *
+ * Proxies to {@link simple()}
+ *
+ * @param string $action
+ * @param string $controller
+ * @param string $module
+ * @param array $params
+ * @return boolean
+ */
+ public function direct($action, $controller = null, $module = null, array $params = array())
+ {
+ return $this->actionToStack($action, $controller, $module, $params);
+ }
+}
diff --git a/library/vendor/Zend/Controller/Action/Helper/AjaxContext.php b/library/vendor/Zend/Controller/Action/Helper/AjaxContext.php
new file mode 100644
index 0000000..3074a40
--- /dev/null
+++ b/library/vendor/Zend/Controller/Action/Helper/AjaxContext.php
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action_Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Controller_Action_Helper_ContextSwitch
+ */
+
+/**
+ * Simplify AJAX context switching based on requested format
+ *
+ * @uses Zend_Controller_Action_Helper_Abstract
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action_Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Action_Helper_AjaxContext extends Zend_Controller_Action_Helper_ContextSwitch
+{
+ /**
+ * Controller property to utilize for context switching
+ * @var string
+ */
+ protected $_contextKey = 'ajaxable';
+
+ /**
+ * Constructor
+ *
+ * Add HTML context
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->addContext('html', array('suffix' => 'ajax'));
+ }
+
+ /**
+ * Initialize AJAX context switching
+ *
+ * Checks for XHR requests; if detected, attempts to perform context switch.
+ *
+ * @param string $format
+ * @return void
+ */
+ public function initContext($format = null)
+ {
+ $this->_currentContext = null;
+
+ $request = $this->getRequest();
+ if (!method_exists($request, 'isXmlHttpRequest') ||
+ !$this->getRequest()->isXmlHttpRequest())
+ {
+ return;
+ }
+
+ return parent::initContext($format);
+ }
+}
diff --git a/library/vendor/Zend/Controller/Action/Helper/AutoComplete/Abstract.php b/library/vendor/Zend/Controller/Action/Helper/AutoComplete/Abstract.php
new file mode 100644
index 0000000..7cd4ad0
--- /dev/null
+++ b/library/vendor/Zend/Controller/Action/Helper/AutoComplete/Abstract.php
@@ -0,0 +1,146 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action_Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Controller_Action_Helper_Abstract
+ */
+
+/**
+ * Create and send autocompletion lists
+ *
+ * @uses Zend_Controller_Action_Helper_Abstract
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action_Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Controller_Action_Helper_AutoComplete_Abstract extends Zend_Controller_Action_Helper_Abstract
+{
+ /**
+ * Suppress exit when sendJson() called
+ *
+ * @var boolean
+ */
+ public $suppressExit = false;
+
+ /**
+ * Validate autocompletion data
+ *
+ * @param mixed $data
+ * @return boolean
+ */
+ abstract public function validateData($data);
+
+ /**
+ * Prepare autocompletion data
+ *
+ * @param mixed $data
+ * @param boolean $keepLayouts
+ * @return mixed
+ */
+ abstract public function prepareAutoCompletion($data, $keepLayouts = false);
+
+ /**
+ * Disable layouts and view renderer
+ *
+ * @return Zend_Controller_Action_Helper_AutoComplete_Abstract Provides a fluent interface
+ */
+ public function disableLayouts()
+ {
+ /**
+ * @see Zend_Layout
+ */
+ if (null !== ($layout = Zend_Layout::getMvcInstance())) {
+ $layout->disableLayout();
+ }
+
+ Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->setNoRender(true);
+
+ return $this;
+ }
+
+ /**
+ * Encode data to JSON
+ *
+ * @param mixed $data
+ * @param bool $keepLayouts
+ * @throws Zend_Controller_Action_Exception
+ * @return string
+ */
+ public function encodeJson($data, $keepLayouts = false)
+ {
+ if ($this->validateData($data)) {
+ return Zend_Controller_Action_HelperBroker::getStaticHelper('Json')->encodeJson($data, $keepLayouts);
+ }
+
+ /**
+ * @see Zend_Controller_Action_Exception
+ */
+ throw new Zend_Controller_Action_Exception('Invalid data passed for autocompletion');
+ }
+
+ /**
+ * Send autocompletion data
+ *
+ * Calls prepareAutoCompletion, populates response body with this
+ * information, and sends response.
+ *
+ * @param mixed $data
+ * @param bool $keepLayouts
+ * @return string|void
+ */
+ public function sendAutoCompletion($data, $keepLayouts = false)
+ {
+ $data = $this->prepareAutoCompletion($data, $keepLayouts);
+
+ $response = $this->getResponse();
+ $response->setBody($data);
+
+ if (!$this->suppressExit) {
+ $response->sendResponse();
+ exit;
+ }
+
+ return $data;
+ }
+
+ /**
+ * Strategy pattern: allow calling helper as broker method
+ *
+ * Prepares autocompletion data and, if $sendNow is true, immediately sends
+ * response.
+ *
+ * @param mixed $data
+ * @param bool $sendNow
+ * @param bool $keepLayouts
+ * @return string|void
+ */
+ public function direct($data, $sendNow = true, $keepLayouts = false)
+ {
+ if ($sendNow) {
+ return $this->sendAutoCompletion($data, $keepLayouts);
+ }
+
+ return $this->prepareAutoCompletion($data, $keepLayouts);
+ }
+}
diff --git a/library/vendor/Zend/Controller/Action/Helper/Cache.php b/library/vendor/Zend/Controller/Action/Helper/Cache.php
new file mode 100644
index 0000000..32afc77
--- /dev/null
+++ b/library/vendor/Zend/Controller/Action/Helper/Cache.php
@@ -0,0 +1,286 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Controller_Action_Helper_Abstract
+ */
+
+/**
+ * @see Zend_Controller_Action_Exception
+ */
+
+/**
+ * @see Zend_Cache_Manager
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Controller
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Action_Helper_Cache
+ extends Zend_Controller_Action_Helper_Abstract
+{
+
+ /**
+ * Local Cache Manager object used by Helper
+ *
+ * @var Zend_Cache_Manager
+ */
+ protected $_manager = null;
+
+ /**
+ * Indexed map of Actions to attempt Page caching on by Controller
+ *
+ * @var array
+ */
+ protected $_caching = array();
+
+ /**
+ * Indexed map of Tags by Controller and Action
+ *
+ * @var array
+ */
+ protected $_tags = array();
+
+ /**
+ * Indexed map of Extensions by Controller and Action
+ *
+ * @var array
+ */
+ protected $_extensions = array();
+
+ /**
+ * Track output buffering condition
+ */
+ protected $_obStarted = false;
+
+ /**
+ * Tell the helper which actions are cacheable and under which
+ * tags (if applicable) they should be recorded with
+ *
+ * @param array $actions
+ * @param array $tags
+ * @return void
+ */
+ public function direct(array $actions, array $tags = array(), $extension = null)
+ {
+ $controller = $this->getRequest()->getControllerName();
+ $actions = array_unique($actions);
+ if (!isset($this->_caching[$controller])) {
+ $this->_caching[$controller] = array();
+ }
+ if (!empty($tags)) {
+ $tags = array_unique($tags);
+ if (!isset($this->_tags[$controller])) {
+ $this->_tags[$controller] = array();
+ }
+ }
+ foreach ($actions as $action) {
+ $this->_caching[$controller][] = $action;
+ if (!empty($tags)) {
+ $this->_tags[$controller][$action] = array();
+ foreach ($tags as $tag) {
+ $this->_tags[$controller][$action][] = $tag;
+ }
+ }
+ }
+ if ($extension) {
+ if (!isset($this->_extensions[$controller])) {
+ $this->_extensions[$controller] = array();
+ }
+ foreach ($actions as $action) {
+ $this->_extensions[$controller][$action] = $extension;
+ }
+ }
+ }
+
+ /**
+ * Remove a specific page cache static file based on its
+ * relative URL from the application's public directory.
+ * The file extension is not required here; usually matches
+ * the original REQUEST_URI that was cached.
+ *
+ * @param string $relativeUrl
+ * @param bool $recursive
+ * @return mixed
+ */
+ public function removePage($relativeUrl, $recursive = false)
+ {
+ $cache = $this->getCache(Zend_Cache_Manager::PAGECACHE);
+ $encodedCacheId = $this->_encodeCacheId($relativeUrl);
+
+ if ($recursive) {
+ $backend = $cache->getBackend();
+ if (($backend instanceof Zend_Cache_Backend)
+ && method_exists($backend, 'removeRecursively')
+ ) {
+ $result = $backend->removeRecursively($encodedCacheId);
+ if (is_null($result) ) {
+ $result = $backend->removeRecursively($relativeUrl);
+ }
+ return $result;
+ }
+ }
+
+ $result = $cache->remove($encodedCacheId);
+ if (is_null($result) ) {
+ $result = $cache->remove($relativeUrl);
+ }
+ return $result;
+ }
+
+ /**
+ * Remove a specific page cache static file based on its
+ * relative URL from the application's public directory.
+ * The file extension is not required here; usually matches
+ * the original REQUEST_URI that was cached.
+ *
+ * @param array $tags
+ * @return mixed
+ */
+ public function removePagesTagged(array $tags)
+ {
+ return $this->getCache(Zend_Cache_Manager::PAGECACHE)
+ ->clean(Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, $tags);
+ }
+
+ /**
+ * Commence page caching for any cacheable actions
+ *
+ * @return void
+ */
+ public function preDispatch()
+ {
+ $controller = $this->getRequest()->getControllerName();
+ $action = $this->getRequest()->getActionName();
+ $stats = ob_get_status(true);
+ foreach ($stats as $status) {
+ if ($status['name'] == 'Zend_Cache_Frontend_Page::_flush'
+ || $status['name'] == 'Zend_Cache_Frontend_Capture::_flush') {
+ $obStarted = true;
+ }
+ }
+ if (!isset($obStarted) && isset($this->_caching[$controller]) &&
+ in_array($action, $this->_caching[$controller])) {
+ $reqUri = $this->getRequest()->getRequestUri();
+ $tags = array();
+ if (isset($this->_tags[$controller][$action])
+ && !empty($this->_tags[$controller][$action])) {
+ $tags = array_unique($this->_tags[$controller][$action]);
+ }
+ $extension = null;
+ if (isset($this->_extensions[$controller][$action])) {
+ $extension = $this->_extensions[$controller][$action];
+ }
+ $this->getCache(Zend_Cache_Manager::PAGECACHE)
+ ->start($this->_encodeCacheId($reqUri), $tags, $extension);
+ }
+ }
+
+ /**
+ * Encode a Cache ID as hexadecimal. This is a workaround because Backend ID validation
+ * is trapped in the Frontend classes. Will try to get this reversed for ZF 2.0
+ * because it's a major annoyance to have IDs so restricted!
+ *
+ * @return string
+ * @param string $requestUri
+ */
+ protected function _encodeCacheId($requestUri)
+ {
+ return bin2hex($requestUri);
+ }
+
+ /**
+ * Set an instance of the Cache Manager for this helper
+ *
+ * @param Zend_Cache_Manager $manager
+ * @return void
+ */
+ public function setManager(Zend_Cache_Manager $manager)
+ {
+ $this->_manager = $manager;
+ return $this;
+ }
+
+ /**
+ * Get the Cache Manager instance or instantiate the object if not
+ * exists. Attempts to load from bootstrap if available.
+ *
+ * @return Zend_Cache_Manager
+ */
+ public function getManager()
+ {
+ if ($this->_manager !== null) {
+ return $this->_manager;
+ }
+ $front = Zend_Controller_Front::getInstance();
+ if ($front->getParam('bootstrap')
+ && $front->getParam('bootstrap')->getResource('CacheManager')) {
+ return $front->getParam('bootstrap')
+ ->getResource('CacheManager');
+ }
+ $this->_manager = new Zend_Cache_Manager;
+ return $this->_manager;
+ }
+
+ /**
+ * Return a list of actions for the current Controller marked for
+ * caching
+ *
+ * @return array
+ */
+ public function getCacheableActions()
+ {
+ return $this->_caching;
+ }
+
+ /**
+ * Return a list of tags set for all cacheable actions
+ *
+ * @return array
+ */
+ public function getCacheableTags()
+ {
+ return $this->_tags;
+ }
+
+ /**
+ * Proxy non-matched methods back to Zend_Cache_Manager where
+ * appropriate
+ *
+ * @param string $method
+ * @param array $args
+ * @return mixed
+ */
+ public function __call($method, $args)
+ {
+ if (method_exists($this->getManager(), $method)) {
+ return call_user_func_array(
+ array($this->getManager(), $method), $args
+ );
+ }
+ throw new Zend_Controller_Action_Exception('Method does not exist:'
+ . $method);
+ }
+
+}
diff --git a/library/vendor/Zend/Controller/Action/Helper/ContextSwitch.php b/library/vendor/Zend/Controller/Action/Helper/ContextSwitch.php
new file mode 100644
index 0000000..6caeec9
--- /dev/null
+++ b/library/vendor/Zend/Controller/Action/Helper/ContextSwitch.php
@@ -0,0 +1,1377 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action_Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Controller_Action_Helper_Abstract
+ */
+
+/**
+ * Simplify context switching based on requested format
+ *
+ * @uses Zend_Controller_Action_Helper_Abstract
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action_Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Action_Helper_ContextSwitch extends Zend_Controller_Action_Helper_Abstract
+{
+ /**
+ * Trigger type constants
+ */
+ const TRIGGER_INIT = 'TRIGGER_INIT';
+ const TRIGGER_POST = 'TRIGGER_POST';
+
+ /**
+ * Supported contexts
+ * @var array
+ */
+ protected $_contexts = array();
+
+ /**
+ * JSON auto-serialization flag
+ * @var boolean
+ */
+ protected $_autoJsonSerialization = true;
+
+ /**
+ * Controller property key to utilize for context switching
+ * @var string
+ */
+ protected $_contextKey = 'contexts';
+
+ /**
+ * Request parameter containing requested context
+ * @var string
+ */
+ protected $_contextParam = 'format';
+
+ /**
+ * Current context
+ * @var string
+ */
+ protected $_currentContext;
+
+ /**
+ * Default context (xml)
+ * @var string
+ */
+ protected $_defaultContext = 'xml';
+
+ /**
+ * Whether or not to disable layouts when switching contexts
+ * @var boolean
+ */
+ protected $_disableLayout = true;
+
+ /**
+ * Methods that require special configuration
+ * @var array
+ */
+ protected $_specialConfig = array(
+ 'setSuffix',
+ 'setHeaders',
+ 'setCallbacks',
+ );
+
+ /**
+ * Methods that are not configurable via setOptions and setConfig
+ * @var array
+ */
+ protected $_unconfigurable = array(
+ 'setOptions',
+ 'setConfig',
+ 'setHeader',
+ 'setCallback',
+ 'setContext',
+ 'setActionContext',
+ 'setActionContexts',
+ );
+
+ /**
+ * @var Zend_Controller_Action_Helper_ViewRenderer
+ */
+ protected $_viewRenderer;
+
+ /**
+ * Original view suffix prior to detecting context switch
+ * @var string
+ */
+ protected $_viewSuffixOrig;
+
+ /**
+ * Constructor
+ *
+ * @param array|Zend_Config $options
+ * @return void
+ */
+ public function __construct($options = null)
+ {
+ if ($options instanceof Zend_Config) {
+ $this->setConfig($options);
+ } elseif (is_array($options)) {
+ $this->setOptions($options);
+ }
+
+ if (empty($this->_contexts)) {
+ $this->addContexts(array(
+ 'json' => array(
+ 'suffix' => 'json',
+ 'headers' => array('Content-Type' => 'application/json'),
+ 'callbacks' => array(
+ 'init' => 'initJsonContext',
+ 'post' => 'postJsonContext'
+ )
+ ),
+ 'xml' => array(
+ 'suffix' => 'xml',
+ 'headers' => array('Content-Type' => 'application/xml'),
+ )
+ ));
+ }
+
+ $this->init();
+ }
+
+ /**
+ * Initialize at start of action controller
+ *
+ * Reset the view script suffix to the original state, or store the
+ * original state.
+ *
+ * @return void
+ */
+ public function init()
+ {
+ if (null === $this->_viewSuffixOrig) {
+ $this->_viewSuffixOrig = $this->_getViewRenderer()->getViewSuffix();
+ } else {
+ $this->_getViewRenderer()->setViewSuffix($this->_viewSuffixOrig);
+ }
+ }
+
+ /**
+ * Configure object from array of options
+ *
+ * @param array $options
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function setOptions(array $options)
+ {
+ if (isset($options['contexts'])) {
+ $this->setContexts($options['contexts']);
+ unset($options['contexts']);
+ }
+
+ foreach ($options as $key => $value) {
+ $method = 'set' . ucfirst($key);
+ if (in_array($method, $this->_unconfigurable)) {
+ continue;
+ }
+
+ if (in_array($method, $this->_specialConfig)) {
+ $method = '_' . $method;
+ }
+
+ if (method_exists($this, $method)) {
+ $this->$method($value);
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Set object state from config object
+ *
+ * @param Zend_Config $config
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function setConfig(Zend_Config $config)
+ {
+ return $this->setOptions($config->toArray());
+ }
+
+ /**
+ * Strategy pattern: return object
+ *
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function direct()
+ {
+ return $this;
+ }
+
+ /**
+ * Initialize context detection and switching
+ *
+ * @param mixed $format
+ * @throws Zend_Controller_Action_Exception
+ * @return void
+ */
+ public function initContext($format = null)
+ {
+ $this->_currentContext = null;
+
+ $controller = $this->getActionController();
+ $request = $this->getRequest();
+ $action = $request->getActionName();
+
+ // Return if no context switching enabled, or no context switching
+ // enabled for this action
+ $contexts = $this->getActionContexts($action);
+ if (empty($contexts)) {
+ return;
+ }
+
+ // Return if no context parameter provided
+ if (!$context = $request->getParam($this->getContextParam())) {
+ if ($format === null) {
+ return;
+ }
+ $context = $format;
+ $format = null;
+ }
+
+ // Check if context allowed by action controller
+ if (!$this->hasActionContext($action, $context)) {
+ return;
+ }
+
+ // Return if invalid context parameter provided and no format or invalid
+ // format provided
+ if (!$this->hasContext($context)) {
+ if (empty($format) || !$this->hasContext($format)) {
+
+ return;
+ }
+ }
+
+ // Use provided format if passed
+ if (!empty($format) && $this->hasContext($format)) {
+ $context = $format;
+ }
+
+ $suffix = $this->getSuffix($context);
+
+ $this->_getViewRenderer()->setViewSuffix($suffix);
+
+ $headers = $this->getHeaders($context);
+ if (!empty($headers)) {
+ $response = $this->getResponse();
+ foreach ($headers as $header => $content) {
+ $response->setHeader($header, $content);
+ }
+ }
+
+ if ($this->getAutoDisableLayout()) {
+ /**
+ * @see Zend_Layout
+ */
+ $layout = Zend_Layout::getMvcInstance();
+ if (null !== $layout) {
+ $layout->disableLayout();
+ }
+ }
+
+ if (null !== ($callback = $this->getCallback($context, self::TRIGGER_INIT))) {
+ if (is_string($callback) && method_exists($this, $callback)) {
+ $this->$callback();
+ } elseif (is_string($callback) && function_exists($callback)) {
+ $callback();
+ } elseif (is_array($callback)) {
+ call_user_func($callback);
+ } else {
+ /**
+ * @see Zend_Controller_Action_Exception
+ */
+ throw new Zend_Controller_Action_Exception(sprintf('Invalid context callback registered for context "%s"', $context));
+ }
+ }
+
+ $this->_currentContext = $context;
+ }
+
+ /**
+ * JSON context extra initialization
+ *
+ * Turns off viewRenderer auto-rendering
+ *
+ * @return void
+ */
+ public function initJsonContext()
+ {
+ if (!$this->getAutoJsonSerialization()) {
+ return;
+ }
+
+ $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
+ $view = $viewRenderer->view;
+ if ($view instanceof Zend_View_Interface) {
+ $viewRenderer->setNoRender(true);
+ }
+ }
+
+ /**
+ * Should JSON contexts auto-serialize?
+ *
+ * @param boolean $flag
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function setAutoJsonSerialization($flag)
+ {
+ $this->_autoJsonSerialization = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Get JSON context auto-serialization flag
+ *
+ * @return boolean
+ */
+ public function getAutoJsonSerialization()
+ {
+ return $this->_autoJsonSerialization;
+ }
+
+ /**
+ * Set suffix from array
+ *
+ * @param array $spec
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ protected function _setSuffix(array $spec)
+ {
+ foreach ($spec as $context => $suffixInfo) {
+ if (!is_string($context)) {
+ $context = null;
+ }
+
+ if (is_string($suffixInfo)) {
+ $this->setSuffix($context, $suffixInfo);
+ continue;
+ } elseif (is_array($suffixInfo)) {
+ if (isset($suffixInfo['suffix'])) {
+ $suffix = $suffixInfo['suffix'];
+ $prependViewRendererSuffix = true;
+
+ if ((null === $context) && isset($suffixInfo['context'])) {
+ $context = $suffixInfo['context'];
+ }
+
+ if (isset($suffixInfo['prependViewRendererSuffix'])) {
+ $prependViewRendererSuffix = $suffixInfo['prependViewRendererSuffix'];
+ }
+
+ $this->setSuffix($context, $suffix, $prependViewRendererSuffix);
+ continue;
+ }
+
+ $count = count($suffixInfo);
+ switch (true) {
+ case (($count < 2) && (null === $context)):
+ /**
+ * @see Zend_Controller_Action_Exception
+ */
+ throw new Zend_Controller_Action_Exception('Invalid suffix information provided in config');
+ case ($count < 2):
+ $suffix = array_shift($suffixInfo);
+ $this->setSuffix($context, $suffix);
+ break;
+ case (($count < 3) && (null === $context)):
+ $context = array_shift($suffixInfo);
+ $suffix = array_shift($suffixInfo);
+ $this->setSuffix($context, $suffix);
+ break;
+ case (($count == 3) && (null === $context)):
+ $context = array_shift($suffixInfo);
+ $suffix = array_shift($suffixInfo);
+ $prependViewRendererSuffix = array_shift($suffixInfo);
+ $this->setSuffix($context, $suffix, $prependViewRendererSuffix);
+ break;
+ case ($count >= 2):
+ $suffix = array_shift($suffixInfo);
+ $prependViewRendererSuffix = array_shift($suffixInfo);
+ $this->setSuffix($context, $suffix, $prependViewRendererSuffix);
+ break;
+ }
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Customize view script suffix to use when switching context.
+ *
+ * Passing an empty suffix value to the setters disables the view script
+ * suffix change.
+ *
+ * @param string $context Context type for which to set suffix
+ * @param string $suffix Suffix to use
+ * @param boolean $prependViewRendererSuffix Whether or not to prepend the new suffix to the viewrenderer suffix
+ * @throws Zend_Controller_Action_Exception
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function setSuffix($context, $suffix, $prependViewRendererSuffix = true)
+ {
+ if (!isset($this->_contexts[$context])) {
+ /**
+ * @see Zend_Controller_Action_Exception
+ */
+ throw new Zend_Controller_Action_Exception(sprintf('Cannot set suffix; invalid context type "%s"', $context));
+ }
+
+ if (empty($suffix)) {
+ $suffix = '';
+ }
+
+ if (is_array($suffix)) {
+ if (isset($suffix['prependViewRendererSuffix'])) {
+ $prependViewRendererSuffix = $suffix['prependViewRendererSuffix'];
+ }
+ if (isset($suffix['suffix'])) {
+ $suffix = $suffix['suffix'];
+ } else {
+ $suffix = '';
+ }
+ }
+
+ $suffix = (string) $suffix;
+
+ if ($prependViewRendererSuffix) {
+ if (empty($suffix)) {
+ $suffix = $this->_getViewRenderer()->getViewSuffix();
+ } else {
+ $suffix .= '.' . $this->_getViewRenderer()->getViewSuffix();
+ }
+ }
+
+ $this->_contexts[$context]['suffix'] = $suffix;
+ return $this;
+ }
+
+ /**
+ * Retrieve suffix for given context type
+ *
+ * @param string $type Context type
+ * @throws Zend_Controller_Action_Exception
+ * @return string
+ */
+ public function getSuffix($type)
+ {
+ if (!isset($this->_contexts[$type])) {
+ /**
+ * @see Zend_Controller_Action_Exception
+ */
+ throw new Zend_Controller_Action_Exception(sprintf('Cannot retrieve suffix; invalid context type "%s"', $type));
+ }
+
+ return $this->_contexts[$type]['suffix'];
+ }
+
+ /**
+ * Does the given context exist?
+ *
+ * @param string $context
+ * @param boolean $throwException
+ * @throws Zend_Controller_Action_Exception if context does not exist and throwException is true
+ * @return bool
+ */
+ public function hasContext($context, $throwException = false)
+ {
+ if (is_string($context)) {
+ if (isset($this->_contexts[$context])) {
+ return true;
+ }
+ } elseif (is_array($context)) {
+ $error = false;
+ foreach ($context as $test) {
+ if (!isset($this->_contexts[$test])) {
+ $error = (string) $test;
+ break;
+ }
+ }
+ if (false === $error) {
+ return true;
+ }
+ $context = $error;
+ } elseif (true === $context) {
+ return true;
+ }
+
+ if ($throwException) {
+ /**
+ * @see Zend_Controller_Action_Exception
+ */
+ throw new Zend_Controller_Action_Exception(sprintf('Context "%s" does not exist', $context));
+ }
+
+ return false;
+ }
+
+ /**
+ * Add header to context
+ *
+ * @param string $context
+ * @param string $header
+ * @param string $content
+ * @throws Zend_Controller_Action_Exception
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function addHeader($context, $header, $content)
+ {
+ $context = (string) $context;
+ $this->hasContext($context, true);
+
+ $header = (string) $header;
+ $content = (string) $content;
+
+ if (isset($this->_contexts[$context]['headers'][$header])) {
+ /**
+ * @see Zend_Controller_Action_Exception
+ */
+ throw new Zend_Controller_Action_Exception(sprintf('Cannot add "%s" header to context "%s": already exists', $header, $context));
+ }
+
+ $this->_contexts[$context]['headers'][$header] = $content;
+ return $this;
+ }
+
+ /**
+ * Customize response header to use when switching context
+ *
+ * Passing an empty header value to the setters disables the response
+ * header.
+ *
+ * @param string $type Context type for which to set suffix
+ * @param string $header Header to set
+ * @param string $content Header content
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function setHeader($context, $header, $content)
+ {
+ $this->hasContext($context, true);
+ $context = (string) $context;
+ $header = (string) $header;
+ $content = (string) $content;
+
+ $this->_contexts[$context]['headers'][$header] = $content;
+ return $this;
+ }
+
+ /**
+ * Add multiple headers at once for a given context
+ *
+ * @param string $context
+ * @param array $headers
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function addHeaders($context, array $headers)
+ {
+ foreach ($headers as $header => $content) {
+ $this->addHeader($context, $header, $content);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set headers from context => headers pairs
+ *
+ * @param array $options
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ protected function _setHeaders(array $options)
+ {
+ foreach ($options as $context => $headers) {
+ if (!is_array($headers)) {
+ continue;
+ }
+ $this->setHeaders($context, $headers);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set multiple headers at once for a given context
+ *
+ * @param string $context
+ * @param array $headers
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function setHeaders($context, array $headers)
+ {
+ $this->clearHeaders($context);
+ foreach ($headers as $header => $content) {
+ $this->setHeader($context, $header, $content);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Retrieve context header
+ *
+ * Returns the value of a given header for a given context type
+ *
+ * @param string $context
+ * @param string $header
+ * @return string|null
+ */
+ public function getHeader($context, $header)
+ {
+ $this->hasContext($context, true);
+ $context = (string) $context;
+ $header = (string) $header;
+ if (isset($this->_contexts[$context]['headers'][$header])) {
+ return $this->_contexts[$context]['headers'][$header];
+ }
+
+ return null;
+ }
+
+ /**
+ * Retrieve context headers
+ *
+ * Returns all headers for a context as key/value pairs
+ *
+ * @param string $context
+ * @return array
+ */
+ public function getHeaders($context)
+ {
+ $this->hasContext($context, true);
+ $context = (string) $context;
+ return $this->_contexts[$context]['headers'];
+ }
+
+ /**
+ * Remove a single header from a context
+ *
+ * @param string $context
+ * @param string $header
+ * @return boolean
+ */
+ public function removeHeader($context, $header)
+ {
+ $this->hasContext($context, true);
+ $context = (string) $context;
+ $header = (string) $header;
+ if (isset($this->_contexts[$context]['headers'][$header])) {
+ unset($this->_contexts[$context]['headers'][$header]);
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Clear all headers for a given context
+ *
+ * @param string $context
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function clearHeaders($context)
+ {
+ $this->hasContext($context, true);
+ $context = (string) $context;
+ $this->_contexts[$context]['headers'] = array();
+ return $this;
+ }
+
+ /**
+ * Validate trigger and return in normalized form
+ *
+ * @param string $trigger
+ * @throws Zend_Controller_Action_Exception
+ * @return string
+ */
+ protected function _validateTrigger($trigger)
+ {
+ $trigger = strtoupper($trigger);
+ if ('TRIGGER_' !== substr($trigger, 0, 8)) {
+ $trigger = 'TRIGGER_' . $trigger;
+ }
+
+ if (!in_array($trigger, array(self::TRIGGER_INIT, self::TRIGGER_POST))) {
+ /**
+ * @see Zend_Controller_Action_Exception
+ */
+ throw new Zend_Controller_Action_Exception(sprintf('Invalid trigger "%s"', $trigger));
+ }
+
+ return $trigger;
+ }
+
+ /**
+ * Set a callback for a given context and trigger
+ *
+ * @param string $context
+ * @param string $trigger
+ * @param string|array $callback
+ * @throws Zend_Controller_Action_Exception
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function setCallback($context, $trigger, $callback)
+ {
+ $this->hasContext($context, true);
+ $trigger = $this->_validateTrigger($trigger);
+
+ if (!is_string($callback)) {
+ if (!is_array($callback) || (2 != count($callback))) {
+ /**
+ * @see Zend_Controller_Action_Exception
+ */
+ throw new Zend_Controller_Action_Exception('Invalid callback specified');
+ }
+ }
+
+ $this->_contexts[$context]['callbacks'][$trigger] = $callback;
+ return $this;
+ }
+
+ /**
+ * Set callbacks from array of context => callbacks pairs
+ *
+ * @param array $options
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ protected function _setCallbacks(array $options)
+ {
+ foreach ($options as $context => $callbacks) {
+ if (!is_array($callbacks)) {
+ continue;
+ }
+
+ $this->setCallbacks($context, $callbacks);
+ }
+ return $this;
+ }
+
+ /**
+ * Set callbacks for a given context
+ *
+ * Callbacks should be in trigger/callback pairs.
+ *
+ * @param string $context
+ * @param array $callbacks
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function setCallbacks($context, array $callbacks)
+ {
+ $this->hasContext($context, true);
+ $context = (string) $context;
+ if (!isset($this->_contexts[$context]['callbacks'])) {
+ $this->_contexts[$context]['callbacks'] = array();
+ }
+
+ foreach ($callbacks as $trigger => $callback) {
+ $this->setCallback($context, $trigger, $callback);
+ }
+ return $this;
+ }
+
+ /**
+ * Get a single callback for a given context and trigger
+ *
+ * @param string $context
+ * @param string $trigger
+ * @return string|array|null
+ */
+ public function getCallback($context, $trigger)
+ {
+ $this->hasContext($context, true);
+ $trigger = $this->_validateTrigger($trigger);
+ if (isset($this->_contexts[$context]['callbacks'][$trigger])) {
+ return $this->_contexts[$context]['callbacks'][$trigger];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get all callbacks for a given context
+ *
+ * @param string $context
+ * @return array
+ */
+ public function getCallbacks($context)
+ {
+ $this->hasContext($context, true);
+ return $this->_contexts[$context]['callbacks'];
+ }
+
+ /**
+ * Clear a callback for a given context and trigger
+ *
+ * @param string $context
+ * @param string $trigger
+ * @return boolean
+ */
+ public function removeCallback($context, $trigger)
+ {
+ $this->hasContext($context, true);
+ $trigger = $this->_validateTrigger($trigger);
+ if (isset($this->_contexts[$context]['callbacks'][$trigger])) {
+ unset($this->_contexts[$context]['callbacks'][$trigger]);
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Clear all callbacks for a given context
+ *
+ * @param string $context
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function clearCallbacks($context)
+ {
+ $this->hasContext($context, true);
+ $this->_contexts[$context]['callbacks'] = array();
+ return $this;
+ }
+
+ /**
+ * Set name of parameter to use when determining context format
+ *
+ * @param string $name
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function setContextParam($name)
+ {
+ $this->_contextParam = (string) $name;
+ return $this;
+ }
+
+ /**
+ * Return context format request parameter name
+ *
+ * @return string
+ */
+ public function getContextParam()
+ {
+ return $this->_contextParam;
+ }
+
+ /**
+ * Indicate default context to use when no context format provided
+ *
+ * @param string $type
+ * @throws Zend_Controller_Action_Exception
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function setDefaultContext($type)
+ {
+ if (!isset($this->_contexts[$type])) {
+ /**
+ * @see Zend_Controller_Action_Exception
+ */
+ throw new Zend_Controller_Action_Exception(sprintf('Cannot set default context; invalid context type "%s"', $type));
+ }
+
+ $this->_defaultContext = $type;
+ return $this;
+ }
+
+ /**
+ * Return default context
+ *
+ * @return string
+ */
+ public function getDefaultContext()
+ {
+ return $this->_defaultContext;
+ }
+
+ /**
+ * Set flag indicating if layout should be disabled
+ *
+ * @param boolean $flag
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function setAutoDisableLayout($flag)
+ {
+ $this->_disableLayout = ($flag) ? true : false;
+ return $this;
+ }
+
+ /**
+ * Retrieve auto layout disable flag
+ *
+ * @return boolean
+ */
+ public function getAutoDisableLayout()
+ {
+ return $this->_disableLayout;
+ }
+
+ /**
+ * Add new context
+ *
+ * @param string $context Context type
+ * @param array $spec Context specification
+ * @throws Zend_Controller_Action_Exception
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function addContext($context, array $spec)
+ {
+ if ($this->hasContext($context)) {
+ /**
+ * @see Zend_Controller_Action_Exception
+ */
+ throw new Zend_Controller_Action_Exception(sprintf('Cannot add context "%s"; already exists', $context));
+ }
+ $context = (string) $context;
+
+ $this->_contexts[$context] = array();
+
+ $this->setSuffix($context, (isset($spec['suffix']) ? $spec['suffix'] : ''))
+ ->setHeaders($context, (isset($spec['headers']) ? $spec['headers'] : array()))
+ ->setCallbacks($context, (isset($spec['callbacks']) ? $spec['callbacks'] : array()));
+ return $this;
+ }
+
+ /**
+ * Overwrite existing context
+ *
+ * @param string $context Context type
+ * @param array $spec Context specification
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function setContext($context, array $spec)
+ {
+ $this->removeContext($context);
+ return $this->addContext($context, $spec);
+ }
+
+ /**
+ * Add multiple contexts
+ *
+ * @param array $contexts
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function addContexts(array $contexts)
+ {
+ foreach ($contexts as $context => $spec) {
+ $this->addContext($context, $spec);
+ }
+ return $this;
+ }
+
+ /**
+ * Set multiple contexts, after first removing all
+ *
+ * @param array $contexts
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function setContexts(array $contexts)
+ {
+ $this->clearContexts();
+ foreach ($contexts as $context => $spec) {
+ $this->addContext($context, $spec);
+ }
+ return $this;
+ }
+
+ /**
+ * Retrieve context specification
+ *
+ * @param string $context
+ * @return array|null
+ */
+ public function getContext($context)
+ {
+ if ($this->hasContext($context)) {
+ return $this->_contexts[(string) $context];
+ }
+ return null;
+ }
+
+ /**
+ * Retrieve context definitions
+ *
+ * @return array
+ */
+ public function getContexts()
+ {
+ return $this->_contexts;
+ }
+
+ /**
+ * Remove a context
+ *
+ * @param string $context
+ * @return boolean
+ */
+ public function removeContext($context)
+ {
+ if ($this->hasContext($context)) {
+ unset($this->_contexts[(string) $context]);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Remove all contexts
+ *
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function clearContexts()
+ {
+ $this->_contexts = array();
+ return $this;
+ }
+
+ /**
+ * Return current context, if any
+ *
+ * @return null|string
+ */
+ public function getCurrentContext()
+ {
+ return $this->_currentContext;
+ }
+
+ /**
+ * Post dispatch processing
+ *
+ * Execute postDispatch callback for current context, if available
+ *
+ * @throws Zend_Controller_Action_Exception
+ * @return void
+ */
+ public function postDispatch()
+ {
+ $context = $this->getCurrentContext();
+ if (null !== $context) {
+ if (null !== ($callback = $this->getCallback($context, self::TRIGGER_POST))) {
+ if (is_string($callback) && method_exists($this, $callback)) {
+ $this->$callback();
+ } elseif (is_string($callback) && function_exists($callback)) {
+ $callback();
+ } elseif (is_array($callback)) {
+ call_user_func($callback);
+ } else {
+ /**
+ * @see Zend_Controller_Action_Exception
+ */
+ throw new Zend_Controller_Action_Exception(sprintf('Invalid postDispatch context callback registered for context "%s"', $context));
+ }
+ }
+ }
+ }
+
+ /**
+ * JSON post processing
+ *
+ * JSON serialize view variables to response body
+ *
+ * @return void
+ */
+ public function postJsonContext()
+ {
+ if (!$this->getAutoJsonSerialization()) {
+ return;
+ }
+
+ $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
+ $view = $viewRenderer->view;
+ if ($view instanceof Zend_View_Interface) {
+ /**
+ * @see Zend_Json
+ */
+ if(method_exists($view, 'getVars')) {
+ $vars = Zend_Json::encode($view->getVars());
+ $this->getResponse()->setBody($vars);
+ } else {
+ throw new Zend_Controller_Action_Exception('View does not implement the getVars() method needed to encode the view into JSON');
+ }
+ }
+ }
+
+ /**
+ * Add one or more contexts to an action
+ *
+ * @param string $action
+ * @param string|array $context
+ * @return Zend_Controller_Action_Helper_ContextSwitch|void Provides a fluent interface
+ */
+ public function addActionContext($action, $context)
+ {
+ $this->hasContext($context, true);
+ $controller = $this->getActionController();
+ if (null === $controller) {
+ return;
+ }
+ $action = (string) $action;
+ $contextKey = $this->_contextKey;
+
+ if (!isset($controller->$contextKey)) {
+ $controller->$contextKey = array();
+ }
+
+ if (true === $context) {
+ $contexts = $this->getContexts();
+ $controller->{$contextKey}[$action] = array_keys($contexts);
+ return $this;
+ }
+
+ $context = (array) $context;
+ if (!isset($controller->{$contextKey}[$action])) {
+ $controller->{$contextKey}[$action] = $context;
+ } else {
+ $controller->{$contextKey}[$action] = array_merge(
+ $controller->{$contextKey}[$action],
+ $context
+ );
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set a context as available for a given controller action
+ *
+ * @param string $action
+ * @param string|array $context
+ * @return Zend_Controller_Action_Helper_ContextSwitch|void Provides a fluent interface
+ */
+ public function setActionContext($action, $context)
+ {
+ $this->hasContext($context, true);
+ $controller = $this->getActionController();
+ if (null === $controller) {
+ return;
+ }
+ $action = (string) $action;
+ $contextKey = $this->_contextKey;
+
+ if (!isset($controller->$contextKey)) {
+ $controller->$contextKey = array();
+ }
+
+ if (true === $context) {
+ $contexts = $this->getContexts();
+ $controller->{$contextKey}[$action] = array_keys($contexts);
+ } else {
+ $controller->{$contextKey}[$action] = (array) $context;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Add multiple action/context pairs at once
+ *
+ * @param array $contexts
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function addActionContexts(array $contexts)
+ {
+ foreach ($contexts as $action => $context) {
+ $this->addActionContext($action, $context);
+ }
+ return $this;
+ }
+
+ /**
+ * Overwrite and set multiple action contexts at once
+ *
+ * @param array $contexts
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function setActionContexts(array $contexts)
+ {
+ foreach ($contexts as $action => $context) {
+ $this->setActionContext($action, $context);
+ }
+ return $this;
+ }
+
+ /**
+ * Does a particular controller action have the given context(s)?
+ *
+ * @param string $action
+ * @param string|array $context
+ * @throws Zend_Controller_Action_Exception
+ * @return boolean
+ */
+ public function hasActionContext($action, $context)
+ {
+ $this->hasContext($context, true);
+ $controller = $this->getActionController();
+ if (null === $controller) {
+ return false;
+ }
+ $action = (string) $action;
+ $contextKey = $this->_contextKey;
+
+ if (!isset($controller->{$contextKey})) {
+ return false;
+ }
+
+ $allContexts = $controller->{$contextKey};
+
+ if (!is_array($allContexts)) {
+ /**
+ * @see Zend_Controller_Action_Exception
+ */
+ throw new Zend_Controller_Action_Exception("Invalid contexts found for controller");
+ }
+
+ if (!isset($allContexts[$action])) {
+ return false;
+ }
+
+ if (true === $allContexts[$action]) {
+ return true;
+ }
+
+ $contexts = $allContexts[$action];
+
+ if (!is_array($contexts)) {
+ /**
+ * @see Zend_Controller_Action_Exception
+ */
+ throw new Zend_Controller_Action_Exception(sprintf("Invalid contexts found for action '%s'", $action));
+ }
+
+ if (is_string($context) && in_array($context, $contexts)) {
+ return true;
+ } elseif (is_array($context)) {
+ $found = true;
+ foreach ($context as $test) {
+ if (!in_array($test, $contexts)) {
+ $found = false;
+ break;
+ }
+ }
+ return $found;
+ }
+
+ return false;
+ }
+
+ /**
+ * Get contexts for a given action or all actions in the controller
+ *
+ * @param string $action
+ * @return array
+ */
+ public function getActionContexts($action = null)
+ {
+ $controller = $this->getActionController();
+ if (null === $controller) {
+ return array();
+ }
+ $contextKey = $this->_contextKey;
+
+ if (!isset($controller->$contextKey)) {
+ return array();
+ }
+
+ if (null !== $action) {
+ $action = (string) $action;
+ if (isset($controller->{$contextKey}[$action])) {
+ return $controller->{$contextKey}[$action];
+ } else {
+ return array();
+ }
+ }
+
+ return $controller->$contextKey;
+ }
+
+ /**
+ * Remove one or more contexts for a given controller action
+ *
+ * @param string $action
+ * @param string|array $context
+ * @return boolean
+ */
+ public function removeActionContext($action, $context)
+ {
+ if ($this->hasActionContext($action, $context)) {
+ $controller = $this->getActionController();
+ $contextKey = $this->_contextKey;
+ $action = (string) $action;
+ $contexts = $controller->$contextKey;
+ $actionContexts = $contexts[$action];
+ $contexts = (array) $context;
+ foreach ($contexts as $context) {
+ $index = array_search($context, $actionContexts);
+ if (false !== $index) {
+ unset($controller->{$contextKey}[$action][$index]);
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Clear all contexts for a given controller action or all actions
+ *
+ * @param string $action
+ * @return Zend_Controller_Action_Helper_ContextSwitch Provides a fluent interface
+ */
+ public function clearActionContexts($action = null)
+ {
+ $controller = $this->getActionController();
+ $contextKey = $this->_contextKey;
+
+ if (!isset($controller->$contextKey) || empty($controller->$contextKey)) {
+ return $this;
+ }
+
+ if (null === $action) {
+ $controller->$contextKey = array();
+ return $this;
+ }
+
+ $action = (string) $action;
+ if (isset($controller->{$contextKey}[$action])) {
+ unset($controller->{$contextKey}[$action]);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Retrieve ViewRenderer
+ *
+ * @return Zend_Controller_Action_Helper_ViewRenderer Provides a fluent interface
+ */
+ protected function _getViewRenderer()
+ {
+ if (null === $this->_viewRenderer) {
+ $this->_viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
+ }
+
+ return $this->_viewRenderer;
+ }
+}
+
diff --git a/library/vendor/Zend/Controller/Action/Helper/Json.php b/library/vendor/Zend/Controller/Action/Helper/Json.php
new file mode 100644
index 0000000..5b77f12
--- /dev/null
+++ b/library/vendor/Zend/Controller/Action/Helper/Json.php
@@ -0,0 +1,130 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action_Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Controller_Action_Helper_Abstract
+ */
+
+/**
+ * Simplify AJAX context switching based on requested format
+ *
+ * @uses Zend_Controller_Action_Helper_Abstract
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action_Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Action_Helper_Json extends Zend_Controller_Action_Helper_Abstract
+{
+ /**
+ * Suppress exit when sendJson() called
+ * @var boolean
+ */
+ public $suppressExit = false;
+
+ /**
+ * Create JSON response
+ *
+ * Encodes and returns data to JSON. Content-Type header set to
+ * 'application/json', and disables layouts and viewRenderer (if being
+ * used).
+ *
+ * @param mixed $data
+ * @param boolean $keepLayouts
+ * @param boolean|array $keepLayouts
+ * @param boolean $encodeData Provided data is already JSON
+ * NOTE: if boolean, establish $keepLayouts to true|false
+ * if array, admit params for Zend_Json::encode as enableJsonExprFinder=>true|false
+ * if $keepLayouts and parmas for Zend_Json::encode are required
+ * then, the array can contains a 'keepLayout'=>true|false and/or 'encodeData'=>true|false
+ * that will not be passed to Zend_Json::encode method but will be passed
+ * to Zend_View_Helper_Json
+ * @throws Zend_Controller_Action_Helper_Json
+ * @return string
+ */
+ public function encodeJson($data, $keepLayouts = false, $encodeData = true)
+ {
+ /**
+ * @see Zend_View_Helper_Json
+ */
+ $jsonHelper = new Zend_View_Helper_Json();
+ $data = $jsonHelper->json($data, $keepLayouts, $encodeData);
+
+ if (!$keepLayouts) {
+ /**
+ * @see Zend_Controller_Action_HelperBroker
+ */
+ Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer')->setNoRender(true);
+ }
+
+ return $data;
+ }
+
+ /**
+ * Encode JSON response and immediately send
+ *
+ * @param mixed $data
+ * @param boolean|array $keepLayouts
+ * @param $encodeData Encode $data as JSON?
+ * NOTE: if boolean, establish $keepLayouts to true|false
+ * if array, admit params for Zend_Json::encode as enableJsonExprFinder=>true|false
+ * if $keepLayouts and parmas for Zend_Json::encode are required
+ * then, the array can contains a 'keepLayout'=>true|false and/or 'encodeData'=>true|false
+ * that will not be passed to Zend_Json::encode method but will be passed
+ * to Zend_View_Helper_Json
+ * @return string|void
+ */
+ public function sendJson($data, $keepLayouts = false, $encodeData = true)
+ {
+ $data = $this->encodeJson($data, $keepLayouts, $encodeData);
+ $response = $this->getResponse();
+ $response->setBody($data);
+
+ if (!$this->suppressExit) {
+ $response->sendResponse();
+ exit;
+ }
+
+ return $data;
+ }
+
+ /**
+ * Strategy pattern: call helper as helper broker method
+ *
+ * Allows encoding JSON. If $sendNow is true, immediately sends JSON
+ * response.
+ *
+ * @param mixed $data
+ * @param boolean $sendNow
+ * @param boolean $keepLayouts
+ * @param boolean $encodeData Encode $data as JSON?
+ * @return string|void
+ */
+ public function direct($data, $sendNow = true, $keepLayouts = false, $encodeData = true)
+ {
+ if ($sendNow) {
+ return $this->sendJson($data, $keepLayouts, $encodeData);
+ }
+ return $this->encodeJson($data, $keepLayouts, $encodeData);
+ }
+}
diff --git a/library/vendor/Zend/Controller/Action/Helper/Redirector.php b/library/vendor/Zend/Controller/Action/Helper/Redirector.php
new file mode 100644
index 0000000..8ff7c3e
--- /dev/null
+++ b/library/vendor/Zend/Controller/Action/Helper/Redirector.php
@@ -0,0 +1,531 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action_Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Controller_Action_Helper_Abstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action_Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Action_Helper_Redirector extends Zend_Controller_Action_Helper_Abstract
+{
+ /**
+ * HTTP status code for redirects
+ * @var int
+ */
+ protected $_code = 302;
+
+ /**
+ * Whether or not calls to _redirect() should exit script execution
+ * @var boolean
+ */
+ protected $_exit = true;
+
+ /**
+ * Whether or not _redirect() should attempt to prepend the base URL to the
+ * passed URL (if it's a relative URL)
+ * @var boolean
+ */
+ protected $_prependBase = true;
+
+ /**
+ * Url to which to redirect
+ * @var string
+ */
+ protected $_redirectUrl = null;
+
+ /**
+ * Whether or not to use an absolute URI when redirecting
+ * @var boolean
+ */
+ protected $_useAbsoluteUri = false;
+
+ /**
+ * Whether or not to close the session before exiting
+ * @var boolean
+ */
+ protected $_closeSessionOnExit = true;
+
+ /**
+ * Retrieve HTTP status code to emit on {@link _redirect()} call
+ *
+ * @return int
+ */
+ public function getCode()
+ {
+ return $this->_code;
+ }
+
+ /**
+ * Validate HTTP status redirect code
+ *
+ * @param int $code
+ * @throws Zend_Controller_Action_Exception on invalid HTTP status code
+ * @return true
+ */
+ protected function _checkCode($code)
+ {
+ $code = (int)$code;
+ if ((300 > $code) || (307 < $code) || (304 == $code) || (306 == $code)) {
+ throw new Zend_Controller_Action_Exception('Invalid redirect HTTP status code (' . $code . ')');
+ }
+
+ return true;
+ }
+
+ /**
+ * Set HTTP status code for {@link _redirect()} behaviour
+ *
+ * @param int $code
+ * @return Zend_Controller_Action_Helper_Redirector Provides a fluent interface
+ */
+ public function setCode($code)
+ {
+ $this->_checkCode($code);
+ $this->_code = $code;
+ return $this;
+ }
+
+ /**
+ * Retrieve flag for whether or not {@link _redirect()} will exit when finished.
+ *
+ * @return boolean
+ */
+ public function getExit()
+ {
+ return $this->_exit;
+ }
+
+ /**
+ * Set exit flag for {@link _redirect()} behaviour
+ *
+ * @param boolean $flag
+ * @return Zend_Controller_Action_Helper_Redirector Provides a fluent interface
+ */
+ public function setExit($flag)
+ {
+ $this->_exit = ($flag) ? true : false;
+ return $this;
+ }
+
+ /**
+ * Retrieve flag for whether or not {@link _redirect()} will prepend the
+ * base URL on relative URLs
+ *
+ * @return boolean
+ */
+ public function getPrependBase()
+ {
+ return $this->_prependBase;
+ }
+
+ /**
+ * Set 'prepend base' flag for {@link _redirect()} behaviour
+ *
+ * @param boolean $flag
+ * @return Zend_Controller_Action_Helper_Redirector Provides a fluent interface
+ */
+ public function setPrependBase($flag)
+ {
+ $this->_prependBase = ($flag) ? true : false;
+ return $this;
+ }
+
+ /**
+ * Retrieve flag for whether or not {@link redirectAndExit()} shall close the session before
+ * exiting.
+ *
+ * @return boolean
+ */
+ public function getCloseSessionOnExit()
+ {
+ return $this->_closeSessionOnExit;
+ }
+
+ /**
+ * Set flag for whether or not {@link redirectAndExit()} shall close the session before exiting.
+ *
+ * @param boolean $flag
+ * @return Zend_Controller_Action_Helper_Redirector Provides a fluent interface
+ */
+ public function setCloseSessionOnExit($flag)
+ {
+ $this->_closeSessionOnExit = ($flag) ? true : false;
+ return $this;
+ }
+
+ /**
+ * Return use absolute URI flag
+ *
+ * @return boolean
+ */
+ public function getUseAbsoluteUri()
+ {
+ return $this->_useAbsoluteUri;
+ }
+
+ /**
+ * Set use absolute URI flag
+ *
+ * @param boolean $flag
+ * @return Zend_Controller_Action_Helper_Redirector Provides a fluent interface
+ */
+ public function setUseAbsoluteUri($flag = true)
+ {
+ $this->_useAbsoluteUri = ($flag) ? true : false;
+ return $this;
+ }
+
+ /**
+ * Set redirect in response object
+ *
+ * @return void
+ */
+ protected function _redirect($url)
+ {
+ if ($this->getUseAbsoluteUri() && !preg_match('#^(https?|ftp)://#', $url)) {
+ $host = (isset($_SERVER['HTTP_HOST'])?$_SERVER['HTTP_HOST']:'');
+ $proto = (isset($_SERVER['HTTPS'])&&$_SERVER['HTTPS']!=="off") ? 'https' : 'http';
+ $port = (isset($_SERVER['SERVER_PORT'])?$_SERVER['SERVER_PORT']:80);
+ $uri = $proto . '://' . $host;
+ if ((('http' == $proto) && (80 != $port)) || (('https' == $proto) && (443 != $port))) {
+ // do not append if HTTP_HOST already contains port
+ if (strrchr($host, ':') === false) {
+ $uri .= ':' . $port;
+ }
+ }
+ $url = $uri . '/' . ltrim($url, '/');
+ }
+ $this->_redirectUrl = $url;
+ $this->getResponse()->setRedirect($url, $this->getCode());
+ }
+
+ /**
+ * Retrieve currently set URL for redirect
+ *
+ * @return string
+ */
+ public function getRedirectUrl()
+ {
+ return $this->_redirectUrl;
+ }
+
+ /**
+ * Determine if the baseUrl should be prepended, and prepend if necessary
+ *
+ * @param string $url
+ * @return string
+ */
+ protected function _prependBase($url)
+ {
+ if ($this->getPrependBase()) {
+ $request = $this->getRequest();
+ if ($request instanceof Zend_Controller_Request_Http) {
+ $base = rtrim($request->getBaseUrl(), '/');
+ if (!empty($base) && ('/' != $base)) {
+ $url = $base . '/' . ltrim($url, '/');
+ } else {
+ $url = '/' . ltrim($url, '/');
+ }
+ }
+ }
+
+ return $url;
+ }
+
+ /**
+ * Set a redirect URL of the form /module/controller/action/params
+ *
+ * @param string $action
+ * @param string $controller
+ * @param string $module
+ * @param array $params
+ * @return void
+ */
+ public function setGotoSimple($action, $controller = null, $module = null, array $params = array())
+ {
+ $dispatcher = $this->getFrontController()->getDispatcher();
+ $request = $this->getRequest();
+ $curModule = $request->getModuleName();
+ $useDefaultController = false;
+
+ if (null === $controller && null !== $module) {
+ $useDefaultController = true;
+ }
+
+ if (null === $module) {
+ $module = $curModule;
+ }
+
+ if ($module == $dispatcher->getDefaultModule()) {
+ $module = '';
+ }
+
+ if (null === $controller && !$useDefaultController) {
+ $controller = $request->getControllerName();
+ if (empty($controller)) {
+ $controller = $dispatcher->getDefaultControllerName();
+ }
+ }
+
+ $params[$request->getModuleKey()] = $module;
+ $params[$request->getControllerKey()] = $controller;
+ $params[$request->getActionKey()] = $action;
+
+ $router = $this->getFrontController()->getRouter();
+ $url = $router->assemble($params, 'default', true);
+
+ $this->_redirect($url);
+ }
+
+ /**
+ * Build a URL based on a route
+ *
+ * @param array $urlOptions
+ * @param string $name Route name
+ * @param boolean $reset
+ * @param boolean $encode
+ * @return void
+ */
+ public function setGotoRoute(array $urlOptions = array(), $name = null, $reset = false, $encode = true)
+ {
+ $router = $this->getFrontController()->getRouter();
+ $url = $router->assemble($urlOptions, $name, $reset, $encode);
+
+ $this->_redirect($url);
+ }
+
+ /**
+ * Set a redirect URL string
+ *
+ * By default, emits a 302 HTTP status header, prepends base URL as defined
+ * in request object if url is relative, and halts script execution by
+ * calling exit().
+ *
+ * $options is an optional associative array that can be used to control
+ * redirect behaviour. The available option keys are:
+ * - exit: boolean flag indicating whether or not to halt script execution when done
+ * - prependBase: boolean flag indicating whether or not to prepend the base URL when a relative URL is provided
+ * - code: integer HTTP status code to use with redirect. Should be between 300 and 307.
+ *
+ * _redirect() sets the Location header in the response object. If you set
+ * the exit flag to false, you can override this header later in code
+ * execution.
+ *
+ * If the exit flag is true (true by default), _redirect() will write and
+ * close the current session, if any.
+ *
+ * @param string $url
+ * @param array $options
+ * @return void
+ */
+ public function setGotoUrl($url, array $options = array())
+ {
+ // prevent header injections
+ $url = str_replace(array("\n", "\r"), '', $url);
+
+ if (null !== $options) {
+ if (isset($options['exit'])) {
+ $this->setExit(($options['exit']) ? true : false);
+ }
+ if (isset($options['prependBase'])) {
+ $this->setPrependBase(($options['prependBase']) ? true : false);
+ }
+ if (isset($options['code'])) {
+ $this->setCode($options['code']);
+ }
+ }
+
+ // If relative URL, decide if we should prepend base URL
+ if (!preg_match('|^[a-z]+://|', $url)) {
+ $url = $this->_prependBase($url);
+ }
+
+ $this->_redirect($url);
+ }
+
+ /**
+ * Perform a redirect to an action/controller/module with params
+ *
+ * @param string $action
+ * @param string $controller
+ * @param string $module
+ * @param array $params
+ * @return void
+ */
+ public function gotoSimple($action, $controller = null, $module = null, array $params = array())
+ {
+ $this->setGotoSimple($action, $controller, $module, $params);
+
+ if ($this->getExit()) {
+ $this->redirectAndExit();
+ }
+ }
+
+ /**
+ * Perform a redirect to an action/controller/module with params, forcing an immdiate exit
+ *
+ * @param mixed $action
+ * @param mixed $controller
+ * @param mixed $module
+ * @param array $params
+ * @return void
+ */
+ public function gotoSimpleAndExit($action, $controller = null, $module = null, array $params = array())
+ {
+ $this->setGotoSimple($action, $controller, $module, $params);
+ $this->redirectAndExit();
+ }
+
+ /**
+ * Redirect to a route-based URL
+ *
+ * Uses route's assemble method to build the URL; route is specified by $name;
+ * default route is used if none provided.
+ *
+ * @param array $urlOptions Array of key/value pairs used to assemble URL
+ * @param string $name
+ * @param boolean $reset
+ * @param boolean $encode
+ * @return void
+ */
+ public function gotoRoute(array $urlOptions = array(), $name = null, $reset = false, $encode = true)
+ {
+ $this->setGotoRoute($urlOptions, $name, $reset, $encode);
+
+ if ($this->getExit()) {
+ $this->redirectAndExit();
+ }
+ }
+
+ /**
+ * Redirect to a route-based URL, and immediately exit
+ *
+ * Uses route's assemble method to build the URL; route is specified by $name;
+ * default route is used if none provided.
+ *
+ * @param array $urlOptions Array of key/value pairs used to assemble URL
+ * @param string $name
+ * @param boolean $reset
+ * @return void
+ */
+ public function gotoRouteAndExit(array $urlOptions = array(), $name = null, $reset = false)
+ {
+ $this->setGotoRoute($urlOptions, $name, $reset);
+ $this->redirectAndExit();
+ }
+
+ /**
+ * Perform a redirect to a url
+ *
+ * @param string $url
+ * @param array $options
+ * @return void
+ */
+ public function gotoUrl($url, array $options = array())
+ {
+ $this->setGotoUrl($url, $options);
+
+ if ($this->getExit()) {
+ $this->redirectAndExit();
+ }
+ }
+
+ /**
+ * Set a URL string for a redirect, perform redirect, and immediately exit
+ *
+ * @param string $url
+ * @param array $options
+ * @return void
+ */
+ public function gotoUrlAndExit($url, array $options = array())
+ {
+ $this->setGotoUrl($url, $options);
+ $this->redirectAndExit();
+ }
+
+ /**
+ * exit(): Perform exit for redirector
+ *
+ * @return void
+ */
+ public function redirectAndExit()
+ {
+ if ($this->getCloseSessionOnExit()) {
+ // Close session, if started
+ if (class_exists('Zend_Session', false) && Zend_Session::isStarted()) {
+ Zend_Session::writeClose();
+ } elseif (isset($_SESSION)) {
+ session_write_close();
+ }
+ }
+
+ $this->getResponse()->sendHeaders();
+ exit();
+ }
+
+ /**
+ * direct(): Perform helper when called as
+ * $this->_helper->redirector($action, $controller, $module, $params)
+ *
+ * @param string $action
+ * @param string $controller
+ * @param string $module
+ * @param array $params
+ * @return void
+ */
+ public function direct($action, $controller = null, $module = null, array $params = array())
+ {
+ $this->gotoSimple($action, $controller, $module, $params);
+ }
+
+ /**
+ * Overloading
+ *
+ * Overloading for old 'goto', 'setGoto', and 'gotoAndExit' methods
+ *
+ * @param string $method
+ * @param array $args
+ * @return mixed
+ * @throws Zend_Controller_Action_Exception for invalid methods
+ */
+ public function __call($method, $args)
+ {
+ $method = strtolower($method);
+ if ('goto' == $method) {
+ return call_user_func_array(array($this, 'gotoSimple'), $args);
+ }
+ if ('setgoto' == $method) {
+ return call_user_func_array(array($this, 'setGotoSimple'), $args);
+ }
+ if ('gotoandexit' == $method) {
+ return call_user_func_array(array($this, 'gotoSimpleAndExit'), $args);
+ }
+
+ throw new Zend_Controller_Action_Exception(sprintf('Invalid method "%s" called on redirector', $method));
+ }
+}
diff --git a/library/vendor/Zend/Controller/Action/Helper/Url.php b/library/vendor/Zend/Controller/Action/Helper/Url.php
new file mode 100644
index 0000000..f98bfa5
--- /dev/null
+++ b/library/vendor/Zend/Controller/Action/Helper/Url.php
@@ -0,0 +1,116 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action_Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Controller_Action_Helper_Abstract
+ */
+
+/**
+ * Helper for creating URLs for redirects and other tasks
+ *
+ * @uses Zend_Controller_Action_Helper_Abstract
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action_Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Action_Helper_Url extends Zend_Controller_Action_Helper_Abstract
+{
+ /**
+ * Create URL based on default route
+ *
+ * @param string $action
+ * @param string $controller
+ * @param string $module
+ * @param array $params
+ * @return string
+ */
+ public function simple($action, $controller = null, $module = null, array $params = null)
+ {
+ $request = $this->getRequest();
+
+ if (null === $controller) {
+ $controller = $request->getControllerName();
+ }
+
+ if (null === $module) {
+ $module = $request->getModuleName();
+ }
+
+ $url = $controller . '/' . $action;
+ if ($module != $this->getFrontController()->getDispatcher()->getDefaultModule()) {
+ $url = $module . '/' . $url;
+ }
+
+ if ('' !== ($baseUrl = $this->getFrontController()->getBaseUrl())) {
+ $url = $baseUrl . '/' . $url;
+ }
+
+ if (null !== $params) {
+ $paramPairs = array();
+ foreach ($params as $key => $value) {
+ $paramPairs[] = urlencode($key) . '/' . urlencode($value);
+ }
+ $paramString = implode('/', $paramPairs);
+ $url .= '/' . $paramString;
+ }
+
+ $url = '/' . ltrim($url, '/');
+
+ return $url;
+ }
+
+ /**
+ * Assembles a URL based on a given route
+ *
+ * This method will typically be used for more complex operations, as it
+ * ties into the route objects registered with the router.
+ *
+ * @param array $urlOptions Options passed to the assemble method of the Route object.
+ * @param mixed $name The name of a Route to use. If null it will use the current Route
+ * @param boolean $reset
+ * @param boolean $encode
+ * @return string Url for the link href attribute.
+ */
+ public function url($urlOptions = array(), $name = null, $reset = false, $encode = true)
+ {
+ $router = $this->getFrontController()->getRouter();
+ return $router->assemble($urlOptions, $name, $reset, $encode);
+ }
+
+ /**
+ * Perform helper when called as $this->_helper->url() from an action controller
+ *
+ * Proxies to {@link simple()}
+ *
+ * @param string $action
+ * @param string $controller
+ * @param string $module
+ * @param array $params
+ * @return string
+ */
+ public function direct($action, $controller = null, $module = null, array $params = null)
+ {
+ return $this->simple($action, $controller, $module, $params);
+ }
+}
diff --git a/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php b/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php
new file mode 100644
index 0000000..948ecc4
--- /dev/null
+++ b/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php
@@ -0,0 +1,996 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action_Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Controller_Action_Helper_Abstract
+ */
+
+/**
+ * @see Zend_View
+ */
+
+/**
+ * View script integration
+ *
+ * Zend_Controller_Action_Helper_ViewRenderer provides transparent view
+ * integration for action controllers. It allows you to create a view object
+ * once, and populate it throughout all actions. Several global options may be
+ * set:
+ *
+ * - noController: if set true, render() will not look for view scripts in
+ * subdirectories named after the controller
+ * - viewSuffix: what view script filename suffix to use
+ *
+ * The helper autoinitializes the action controller view preDispatch(). It
+ * determines the path to the class file, and then determines the view base
+ * directory from there. It also uses the module name as a class prefix for
+ * helpers and views such that if your module name is 'Search', it will set the
+ * helper class prefix to 'Search_View_Helper' and the filter class prefix to ;
+ * 'Search_View_Filter'.
+ *
+ * Usage:
+ * <code>
+ * // In your bootstrap:
+ * Zend_Controller_Action_HelperBroker::addHelper(new Zend_Controller_Action_Helper_ViewRenderer());
+ *
+ * // In your action controller methods:
+ * $viewHelper = $this->_helper->getHelper('view');
+ *
+ * // Don't use controller subdirectories
+ * $viewHelper->setNoController(true);
+ *
+ * // Specify a different script to render:
+ * $this->_helper->viewRenderer('form');
+ *
+ * </code>
+ *
+ * @uses Zend_Controller_Action_Helper_Abstract
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action_Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Action_Helper_ViewRenderer extends Zend_Controller_Action_Helper_Abstract
+{
+ /**
+ * @var Zend_View_Interface
+ */
+ public $view;
+
+ /**
+ * Word delimiters
+ * @var array
+ */
+ protected $_delimiters;
+
+ /**
+ * @var Zend_Filter_Inflector
+ */
+ protected $_inflector;
+
+ /**
+ * Inflector target
+ * @var string
+ */
+ protected $_inflectorTarget = '';
+
+ /**
+ * Current module directory
+ * @var string
+ */
+ protected $_moduleDir = '';
+
+ /**
+ * Whether or not to autorender using controller name as subdirectory;
+ * global setting (not reset at next invocation)
+ * @var boolean
+ */
+ protected $_neverController = false;
+
+ /**
+ * Whether or not to autorender postDispatch; global setting (not reset at
+ * next invocation)
+ * @var boolean
+ */
+ protected $_neverRender = false;
+
+ /**
+ * Whether or not to use a controller name as a subdirectory when rendering
+ * @var boolean
+ */
+ protected $_noController = false;
+
+ /**
+ * Whether or not to autorender postDispatch; per controller/action setting (reset
+ * at next invocation)
+ * @var boolean
+ */
+ protected $_noRender = false;
+
+ /**
+ * Characters representing path delimiters in the controller
+ * @var string|array
+ */
+ protected $_pathDelimiters;
+
+ /**
+ * Which named segment of the response to utilize
+ * @var string
+ */
+ protected $_responseSegment = null;
+
+ /**
+ * Which action view script to render
+ * @var string
+ */
+ protected $_scriptAction = null;
+
+ /**
+ * View object basePath
+ * @var string
+ */
+ protected $_viewBasePathSpec = ':moduleDir/views';
+
+ /**
+ * View script path specification string
+ * @var string
+ */
+ protected $_viewScriptPathSpec = ':controller/:action.:suffix';
+
+ /**
+ * View script path specification string, minus controller segment
+ * @var string
+ */
+ protected $_viewScriptPathNoControllerSpec = ':action.:suffix';
+
+ /**
+ * View script suffix
+ * @var string
+ */
+ protected $_viewSuffix = 'phtml';
+
+ /**
+ * Constructor
+ *
+ * Optionally set view object and options.
+ *
+ * @param Zend_View_Interface $view
+ * @param array $options
+ * @return void
+ */
+ public function __construct(Zend_View_Interface $view = null, array $options = array())
+ {
+ if (null !== $view) {
+ $this->setView($view);
+ }
+
+ if (!empty($options)) {
+ $this->_setOptions($options);
+ }
+ }
+
+ /**
+ * Clone - also make sure the view is cloned.
+ *
+ * @return void
+ */
+ public function __clone()
+ {
+ if (isset($this->view) && $this->view instanceof Zend_View_Interface) {
+ $this->view = clone $this->view;
+
+ }
+ }
+
+ /**
+ * Set the view object
+ *
+ * @param Zend_View_Interface $view
+ * @return Zend_Controller_Action_Helper_ViewRenderer Provides a fluent interface
+ */
+ public function setView(Zend_View_Interface $view)
+ {
+ $this->view = $view;
+ return $this;
+ }
+
+ /**
+ * Get current module name
+ *
+ * @return string
+ */
+ public function getModule()
+ {
+ $request = $this->getRequest();
+ $module = $request->getModuleName();
+ if (null === $module) {
+ $module = $this->getFrontController()->getDispatcher()->getDefaultModule();
+ }
+
+ return $module;
+ }
+
+ /**
+ * Get module directory
+ *
+ * @throws Zend_Controller_Action_Exception
+ * @return string
+ */
+ public function getModuleDirectory()
+ {
+ $module = $this->getModule();
+ $moduleDir = $this->getFrontController()->getControllerDirectory($module);
+ if ((null === $moduleDir) || is_array($moduleDir)) {
+ /**
+ * @see Zend_Controller_Action_Exception
+ */
+ throw new Zend_Controller_Action_Exception('ViewRenderer cannot locate module directory for module "' . $module . '"');
+ }
+ $this->_moduleDir = dirname($moduleDir);
+ return $this->_moduleDir;
+ }
+
+ /**
+ * Get inflector
+ *
+ * @return Zend_Filter_Inflector
+ */
+ public function getInflector()
+ {
+ if (null === $this->_inflector) {
+ /**
+ * @see Zend_Filter_Inflector
+ */
+ /**
+ * @see Zend_Filter_PregReplace
+ */
+ /**
+ * @see Zend_Filter_Word_UnderscoreToSeparator
+ */
+ $this->_inflector = new Zend_Filter_Inflector();
+ $this->_inflector->setStaticRuleReference('moduleDir', $this->_moduleDir) // moduleDir must be specified before the less specific 'module'
+ ->addRules(array(
+ ':module' => array('Word_CamelCaseToDash', 'StringToLower'),
+ ':controller' => array('Word_CamelCaseToDash', new Zend_Filter_Word_UnderscoreToSeparator('/'), 'StringToLower', new Zend_Filter_PregReplace('/\./', '-')),
+ ':action' => array('Word_CamelCaseToDash', new Zend_Filter_PregReplace('#[^a-z0-9' . preg_quote('/', '#') . ']+#i', '-'), 'StringToLower'),
+ ))
+ ->setStaticRuleReference('suffix', $this->_viewSuffix)
+ ->setTargetReference($this->_inflectorTarget);
+ }
+
+ // Ensure that module directory is current
+ $this->getModuleDirectory();
+
+ return $this->_inflector;
+ }
+
+ /**
+ * Set inflector
+ *
+ * @param Zend_Filter_Inflector $inflector
+ * @param boolean $reference Whether the moduleDir, target, and suffix should be set as references to ViewRenderer properties
+ * @return Zend_Controller_Action_Helper_ViewRenderer Provides a fluent interface
+ */
+ public function setInflector(Zend_Filter_Inflector $inflector, $reference = false)
+ {
+ $this->_inflector = $inflector;
+ if ($reference) {
+ $this->_inflector->setStaticRuleReference('suffix', $this->_viewSuffix)
+ ->setStaticRuleReference('moduleDir', $this->_moduleDir)
+ ->setTargetReference($this->_inflectorTarget);
+ }
+ return $this;
+ }
+
+ /**
+ * Set inflector target
+ *
+ * @param string $target
+ * @return void
+ */
+ protected function _setInflectorTarget($target)
+ {
+ $this->_inflectorTarget = (string) $target;
+ }
+
+ /**
+ * Set internal module directory representation
+ *
+ * @param string $dir
+ * @return void
+ */
+ protected function _setModuleDir($dir)
+ {
+ $this->_moduleDir = (string) $dir;
+ }
+
+ /**
+ * Get internal module directory representation
+ *
+ * @return string
+ */
+ protected function _getModuleDir()
+ {
+ return $this->_moduleDir;
+ }
+
+ /**
+ * Generate a class prefix for helper and filter classes
+ *
+ * @return string
+ */
+ protected function _generateDefaultPrefix()
+ {
+ $default = 'Zend_View';
+ if (null === $this->_actionController) {
+ return $default;
+ }
+
+ $class = get_class($this->_actionController);
+
+ if (!strstr($class, '_')) {
+ return $default;
+ }
+
+ $module = $this->getModule();
+ if ('default' == $module) {
+ return $default;
+ }
+
+ $prefix = substr($class, 0, strpos($class, '_')) . '_View';
+
+ return $prefix;
+ }
+
+ /**
+ * Retrieve base path based on location of current action controller
+ *
+ * @return string
+ */
+ protected function _getBasePath()
+ {
+ if (null === $this->_actionController) {
+ return './views';
+ }
+
+ $inflector = $this->getInflector();
+ $this->_setInflectorTarget($this->getViewBasePathSpec());
+
+ $dispatcher = $this->getFrontController()->getDispatcher();
+ $request = $this->getRequest();
+
+ $parts = array(
+ 'module' => (($moduleName = $request->getModuleName()) != '') ? $dispatcher->formatModuleName($moduleName) : $moduleName,
+ 'controller' => $request->getControllerName(),
+ 'action' => $dispatcher->formatActionName($request->getActionName())
+ );
+
+ $path = $inflector->filter($parts);
+ return $path;
+ }
+
+ /**
+ * Set options
+ *
+ * @param array $options
+ * @return Zend_Controller_Action_Helper_ViewRenderer Provides a fluent interface
+ */
+ protected function _setOptions(array $options)
+ {
+ foreach ($options as $key => $value)
+ {
+ switch ($key) {
+ case 'neverRender':
+ case 'neverController':
+ case 'noController':
+ case 'noRender':
+ $property = '_' . $key;
+ $this->{$property} = ($value) ? true : false;
+ break;
+ case 'responseSegment':
+ case 'scriptAction':
+ case 'viewBasePathSpec':
+ case 'viewScriptPathSpec':
+ case 'viewScriptPathNoControllerSpec':
+ case 'viewSuffix':
+ $property = '_' . $key;
+ $this->{$property} = (string) $value;
+ break;
+ default:
+ break;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Initialize the view object
+ *
+ * $options may contain the following keys:
+ * - neverRender - flag dis/enabling postDispatch() autorender (affects all subsequent calls)
+ * - noController - flag indicating whether or not to look for view scripts in subdirectories named after the controller
+ * - noRender - flag indicating whether or not to autorender postDispatch()
+ * - responseSegment - which named response segment to render a view script to
+ * - scriptAction - what action script to render
+ * - viewBasePathSpec - specification to use for determining view base path
+ * - viewScriptPathSpec - specification to use for determining view script paths
+ * - viewScriptPathNoControllerSpec - specification to use for determining view script paths when noController flag is set
+ * - viewSuffix - what view script filename suffix to use
+ *
+ * @param string $path
+ * @param string $prefix
+ * @param array $options
+ * @throws Zend_Controller_Action_Exception
+ * @return void
+ */
+ public function initView($path = null, $prefix = null, array $options = array())
+ {
+ if (null === $this->view) {
+ $this->setView(new Zend_View());
+ }
+
+ // Reset some flags every time
+ $options['noController'] = (isset($options['noController'])) ? $options['noController'] : false;
+ $options['noRender'] = (isset($options['noRender'])) ? $options['noRender'] : false;
+ $this->_scriptAction = null;
+ $this->_responseSegment = null;
+
+ // Set options first; may be used to determine other initializations
+ $this->_setOptions($options);
+
+ // Get base view path
+ if (empty($path)) {
+ $path = $this->_getBasePath();
+ if (empty($path)) {
+ /**
+ * @see Zend_Controller_Action_Exception
+ */
+ throw new Zend_Controller_Action_Exception('ViewRenderer initialization failed: retrieved view base path is empty');
+ }
+ }
+
+ if (null === $prefix) {
+ $prefix = $this->_generateDefaultPrefix();
+ }
+
+ // Determine if this path has already been registered
+ $currentPaths = $this->view->getScriptPaths();
+ $path = str_replace(array('/', '\\'), '/', $path);
+ $pathExists = false;
+ foreach ($currentPaths as $tmpPath) {
+ $tmpPath = str_replace(array('/', '\\'), '/', $tmpPath);
+ if (strstr($tmpPath, $path)) {
+ $pathExists = true;
+ break;
+ }
+ }
+ if (!$pathExists) {
+ $this->view->addBasePath($path, $prefix);
+ }
+
+ // Register view with action controller (unless already registered)
+ if ((null !== $this->_actionController) && (null === $this->_actionController->view)) {
+ $this->_actionController->view = $this->view;
+ $this->_actionController->viewSuffix = $this->_viewSuffix;
+ }
+ }
+
+ /**
+ * init - initialize view
+ *
+ * @return void
+ */
+ public function init()
+ {
+ if ($this->getFrontController()->getParam('noViewRenderer')) {
+ return;
+ }
+
+ $this->initView();
+ }
+
+ /**
+ * Set view basePath specification
+ *
+ * Specification can contain one or more of the following:
+ * - :moduleDir - current module directory
+ * - :controller - name of current controller in the request
+ * - :action - name of current action in the request
+ * - :module - name of current module in the request
+ *
+ * @param string $path
+ * @return Zend_Controller_Action_Helper_ViewRenderer Provides a fluent interface
+ */
+ public function setViewBasePathSpec($path)
+ {
+ $this->_viewBasePathSpec = (string) $path;
+ return $this;
+ }
+
+ /**
+ * Retrieve the current view basePath specification string
+ *
+ * @return string
+ */
+ public function getViewBasePathSpec()
+ {
+ return $this->_viewBasePathSpec;
+ }
+
+ /**
+ * Set view script path specification
+ *
+ * Specification can contain one or more of the following:
+ * - :moduleDir - current module directory
+ * - :controller - name of current controller in the request
+ * - :action - name of current action in the request
+ * - :module - name of current module in the request
+ *
+ * @param string $path
+ * @return Zend_Controller_Action_Helper_ViewRenderer Provides a fluent interface
+ */
+ public function setViewScriptPathSpec($path)
+ {
+ $this->_viewScriptPathSpec = (string) $path;
+ return $this;
+ }
+
+ /**
+ * Retrieve the current view script path specification string
+ *
+ * @return string
+ */
+ public function getViewScriptPathSpec()
+ {
+ return $this->_viewScriptPathSpec;
+ }
+
+ /**
+ * Set view script path specification (no controller variant)
+ *
+ * Specification can contain one or more of the following:
+ * - :moduleDir - current module directory
+ * - :controller - name of current controller in the request
+ * - :action - name of current action in the request
+ * - :module - name of current module in the request
+ *
+ * :controller will likely be ignored in this variant.
+ *
+ * @param string $path
+ * @return Zend_Controller_Action_Helper_ViewRenderer Provides a fluent interface
+ */
+ public function setViewScriptPathNoControllerSpec($path)
+ {
+ $this->_viewScriptPathNoControllerSpec = (string) $path;
+ return $this;
+ }
+
+ /**
+ * Retrieve the current view script path specification string (no controller variant)
+ *
+ * @return string
+ */
+ public function getViewScriptPathNoControllerSpec()
+ {
+ return $this->_viewScriptPathNoControllerSpec;
+ }
+
+ /**
+ * Get a view script based on an action and/or other variables
+ *
+ * Uses values found in current request if no values passed in $vars.
+ *
+ * If {@link $_noController} is set, uses {@link $_viewScriptPathNoControllerSpec};
+ * otherwise, uses {@link $_viewScriptPathSpec}.
+ *
+ * @param string $action
+ * @param array $vars
+ * @return string
+ */
+ public function getViewScript($action = null, array $vars = array())
+ {
+ $request = $this->getRequest();
+ if ((null === $action) && (!isset($vars['action']))) {
+ $action = $this->getScriptAction();
+ if (null === $action) {
+ $action = $request->getActionName();
+ }
+ $vars['action'] = $action;
+ } elseif (null !== $action) {
+ $vars['action'] = $action;
+ }
+
+ $replacePattern = array('/[^a-z0-9]+$/i', '/^[^a-z0-9]+/i');
+ $vars['action'] = preg_replace($replacePattern, '', $vars['action']);
+
+ $inflector = $this->getInflector();
+ if ($this->getNoController() || $this->getNeverController()) {
+ $this->_setInflectorTarget($this->getViewScriptPathNoControllerSpec());
+ } else {
+ $this->_setInflectorTarget($this->getViewScriptPathSpec());
+ }
+ return $this->_translateSpec($vars);
+ }
+
+ /**
+ * Set the neverRender flag (i.e., globally dis/enable autorendering)
+ *
+ * @param boolean $flag
+ * @return Zend_Controller_Action_Helper_ViewRenderer Provides a fluent interface
+ */
+ public function setNeverRender($flag = true)
+ {
+ $this->_neverRender = ($flag) ? true : false;
+ return $this;
+ }
+
+ /**
+ * Retrieve neverRender flag value
+ *
+ * @return boolean
+ */
+ public function getNeverRender()
+ {
+ return $this->_neverRender;
+ }
+
+ /**
+ * Set the noRender flag (i.e., whether or not to autorender)
+ *
+ * @param boolean $flag
+ * @return Zend_Controller_Action_Helper_ViewRenderer Provides a fluent interface
+ */
+ public function setNoRender($flag = true)
+ {
+ $this->_noRender = ($flag) ? true : false;
+ return $this;
+ }
+
+ /**
+ * Retrieve noRender flag value
+ *
+ * @return boolean
+ */
+ public function getNoRender()
+ {
+ return $this->_noRender;
+ }
+
+ /**
+ * Set the view script to use
+ *
+ * @param string $name
+ * @return Zend_Controller_Action_Helper_ViewRenderer Provides a fluent interface
+ */
+ public function setScriptAction($name)
+ {
+ $this->_scriptAction = (string) $name;
+ return $this;
+ }
+
+ /**
+ * Retrieve view script name
+ *
+ * @return string
+ */
+ public function getScriptAction()
+ {
+ return $this->_scriptAction;
+ }
+
+ /**
+ * Set the response segment name
+ *
+ * @param string $name
+ * @return Zend_Controller_Action_Helper_ViewRenderer Provides a fluent interface
+ */
+ public function setResponseSegment($name)
+ {
+ if (null === $name) {
+ $this->_responseSegment = null;
+ } else {
+ $this->_responseSegment = (string) $name;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Retrieve named response segment name
+ *
+ * @return string
+ */
+ public function getResponseSegment()
+ {
+ return $this->_responseSegment;
+ }
+
+ /**
+ * Set the noController flag (i.e., whether or not to render into controller subdirectories)
+ *
+ * @param boolean $flag
+ * @return Zend_Controller_Action_Helper_ViewRenderer Provides a fluent interface
+ */
+ public function setNoController($flag = true)
+ {
+ $this->_noController = ($flag) ? true : false;
+ return $this;
+ }
+
+ /**
+ * Retrieve noController flag value
+ *
+ * @return boolean
+ */
+ public function getNoController()
+ {
+ return $this->_noController;
+ }
+
+ /**
+ * Set the neverController flag (i.e., whether or not to render into controller subdirectories)
+ *
+ * @param boolean $flag
+ * @return Zend_Controller_Action_Helper_ViewRenderer Provides a fluent interface
+ */
+ public function setNeverController($flag = true)
+ {
+ $this->_neverController = ($flag) ? true : false;
+ return $this;
+ }
+
+ /**
+ * Retrieve neverController flag value
+ *
+ * @return boolean
+ */
+ public function getNeverController()
+ {
+ return $this->_neverController;
+ }
+
+ /**
+ * Set view script suffix
+ *
+ * @param string $suffix
+ * @return Zend_Controller_Action_Helper_ViewRenderer Provides a fluent interface
+ */
+ public function setViewSuffix($suffix)
+ {
+ $this->_viewSuffix = (string) $suffix;
+ return $this;
+ }
+
+ /**
+ * Get view script suffix
+ *
+ * @return string
+ */
+ public function getViewSuffix()
+ {
+ return $this->_viewSuffix;
+ }
+
+ /**
+ * Set options for rendering a view script
+ *
+ * @param string $action View script to render
+ * @param string $name Response named segment to render to
+ * @param boolean $noController Whether or not to render within a subdirectory named after the controller
+ * @return Zend_Controller_Action_Helper_ViewRenderer Provides a fluent interface
+ */
+ public function setRender($action = null, $name = null, $noController = null)
+ {
+ if (null !== $action) {
+ $this->setScriptAction($action);
+ }
+
+ if (null !== $name) {
+ $this->setResponseSegment($name);
+ }
+
+ if (null !== $noController) {
+ $this->setNoController($noController);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Inflect based on provided vars
+ *
+ * Allowed variables are:
+ * - :moduleDir - current module directory
+ * - :module - current module name
+ * - :controller - current controller name
+ * - :action - current action name
+ * - :suffix - view script file suffix
+ *
+ * @param array $vars
+ * @return string
+ */
+ protected function _translateSpec(array $vars = array())
+ {
+ $inflector = $this->getInflector();
+ $request = $this->getRequest();
+ $dispatcher = $this->getFrontController()->getDispatcher();
+
+ // Format module name
+ $module = $dispatcher->formatModuleName($request->getModuleName());
+
+ // Format controller name
+ $filter = new Zend_Filter_Word_CamelCaseToDash();
+ $controller = $filter->filter($request->getControllerName());
+ $controller = $dispatcher->formatControllerName($controller);
+ if ('Controller' == substr($controller, -10)) {
+ $controller = substr($controller, 0, -10);
+ }
+
+ // Format action name
+ $action = $dispatcher->formatActionName($request->getActionName());
+
+ $params = compact('module', 'controller', 'action');
+ foreach ($vars as $key => $value) {
+ switch ($key) {
+ case 'module':
+ case 'controller':
+ case 'action':
+ case 'moduleDir':
+ case 'suffix':
+ $params[$key] = (string) $value;
+ break;
+ default:
+ break;
+ }
+ }
+
+ if (isset($params['suffix'])) {
+ $origSuffix = $this->getViewSuffix();
+ $this->setViewSuffix($params['suffix']);
+ }
+ if (isset($params['moduleDir'])) {
+ $origModuleDir = $this->_getModuleDir();
+ $this->_setModuleDir($params['moduleDir']);
+ }
+
+ $filtered = $inflector->filter($params);
+
+ if (isset($params['suffix'])) {
+ $this->setViewSuffix($origSuffix);
+ }
+ if (isset($params['moduleDir'])) {
+ $this->_setModuleDir($origModuleDir);
+ }
+
+ return $filtered;
+ }
+
+ /**
+ * Render a view script (optionally to a named response segment)
+ *
+ * Sets the noRender flag to true when called.
+ *
+ * @param string $script
+ * @param string $name
+ * @return void
+ */
+ public function renderScript($script, $name = null)
+ {
+ if (null === $name) {
+ $name = $this->getResponseSegment();
+ }
+
+ $this->getResponse()->appendBody(
+ $this->view->render($script),
+ $name
+ );
+
+ $this->setNoRender();
+ }
+
+ /**
+ * Render a view based on path specifications
+ *
+ * Renders a view based on the view script path specifications.
+ *
+ * @param string $action
+ * @param string $name
+ * @param boolean $noController
+ * @return void
+ */
+ public function render($action = null, $name = null, $noController = null)
+ {
+ $this->setRender($action, $name, $noController);
+ $path = $this->getViewScript();
+ $this->renderScript($path, $name);
+ }
+
+ /**
+ * Render a script based on specification variables
+ *
+ * Pass an action, and one or more specification variables (view script suffix)
+ * to determine the view script path, and render that script.
+ *
+ * @param string $action
+ * @param array $vars
+ * @param string $name
+ * @return void
+ */
+ public function renderBySpec($action = null, array $vars = array(), $name = null)
+ {
+ if (null !== $name) {
+ $this->setResponseSegment($name);
+ }
+
+ $path = $this->getViewScript($action, $vars);
+
+ $this->renderScript($path);
+ }
+
+ /**
+ * postDispatch - auto render a view
+ *
+ * Only autorenders if:
+ * - _noRender is false
+ * - action controller is present
+ * - request has not been re-dispatched (i.e., _forward() has not been called)
+ * - response is not a redirect
+ *
+ * @return void
+ */
+ public function postDispatch()
+ {
+ if ($this->_shouldRender()) {
+ $this->render();
+ }
+ }
+
+ /**
+ * Should the ViewRenderer render a view script?
+ *
+ * @return boolean
+ */
+ protected function _shouldRender()
+ {
+ return (!$this->getFrontController()->getParam('noViewRenderer')
+ && !$this->_neverRender
+ && !$this->_noRender
+ && (null !== $this->_actionController)
+ && $this->getRequest()->isDispatched()
+ && !$this->getResponse()->isRedirect()
+ );
+ }
+
+ /**
+ * Use this helper as a method; proxies to setRender()
+ *
+ * @param string $action
+ * @param string $name
+ * @param boolean $noController
+ * @return void
+ */
+ public function direct($action = null, $name = null, $noController = null)
+ {
+ $this->setRender($action, $name, $noController);
+ }
+}
diff --git a/library/vendor/Zend/Controller/Action/HelperBroker.php b/library/vendor/Zend/Controller/Action/HelperBroker.php
new file mode 100644
index 0000000..ff94dca
--- /dev/null
+++ b/library/vendor/Zend/Controller/Action/HelperBroker.php
@@ -0,0 +1,373 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Controller_Action_HelperBroker_PriorityStack
+ */
+
+/**
+ * @see Zend_Loader
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Action_HelperBroker
+{
+ /**
+ * $_actionController - ActionController reference
+ *
+ * @var Zend_Controller_Action
+ */
+ protected $_actionController;
+
+ /**
+ * @var Zend_Loader_PluginLoader_Interface
+ */
+ protected static $_pluginLoader;
+
+ /**
+ * $_helpers - Helper array
+ *
+ * @var Zend_Controller_Action_HelperBroker_PriorityStack
+ */
+ protected static $_stack = null;
+
+ /**
+ * Set PluginLoader for use with broker
+ *
+ * @param Zend_Loader_PluginLoader_Interface $loader
+ * @return void
+ */
+ public static function setPluginLoader($loader)
+ {
+ if ((null !== $loader) && (!$loader instanceof Zend_Loader_PluginLoader_Interface)) {
+ throw new Zend_Controller_Action_Exception('Invalid plugin loader provided to HelperBroker');
+ }
+ self::$_pluginLoader = $loader;
+ }
+
+ /**
+ * Retrieve PluginLoader
+ *
+ * @return Zend_Loader_PluginLoader
+ */
+ public static function getPluginLoader()
+ {
+ if (null === self::$_pluginLoader) {
+ self::$_pluginLoader = new Zend_Loader_PluginLoader(array(
+ 'Zend_Controller_Action_Helper' => 'Zend/Controller/Action/Helper/',
+ ));
+ }
+ return self::$_pluginLoader;
+ }
+
+ /**
+ * addPrefix() - Add repository of helpers by prefix
+ *
+ * @param string $prefix
+ */
+ static public function addPrefix($prefix)
+ {
+ $prefix = rtrim($prefix, '_');
+ $path = str_replace('_', DIRECTORY_SEPARATOR, $prefix);
+ self::getPluginLoader()->addPrefixPath($prefix, $path);
+ }
+
+ /**
+ * addPath() - Add path to repositories where Action_Helpers could be found.
+ *
+ * @param string $path
+ * @param string $prefix Optional; defaults to 'Zend_Controller_Action_Helper'
+ * @return void
+ */
+ static public function addPath($path, $prefix = 'Zend_Controller_Action_Helper')
+ {
+ self::getPluginLoader()->addPrefixPath($prefix, $path);
+ }
+
+ /**
+ * addHelper() - Add helper objects
+ *
+ * @param Zend_Controller_Action_Helper_Abstract $helper
+ * @return void
+ */
+ static public function addHelper(Zend_Controller_Action_Helper_Abstract $helper)
+ {
+ self::getStack()->push($helper);
+ return;
+ }
+
+ /**
+ * resetHelpers()
+ *
+ * @return void
+ */
+ static public function resetHelpers()
+ {
+ self::$_stack = null;
+ return;
+ }
+
+ /**
+ * Retrieve or initialize a helper statically
+ *
+ * Retrieves a helper object statically, loading on-demand if the helper
+ * does not already exist in the stack. Always returns a helper, unless
+ * the helper class cannot be found.
+ *
+ * @param string $name
+ * @return Zend_Controller_Action_Helper_Abstract
+ */
+ public static function getStaticHelper($name)
+ {
+ $name = self::_normalizeHelperName($name);
+ $stack = self::getStack();
+
+ if (!isset($stack->{$name})) {
+ self::_loadHelper($name);
+ }
+
+ return $stack->{$name};
+ }
+
+ /**
+ * getExistingHelper() - get helper by name
+ *
+ * Static method to retrieve helper object. Only retrieves helpers already
+ * initialized with the broker (either via addHelper() or on-demand loading
+ * via getHelper()).
+ *
+ * Throws an exception if the referenced helper does not exist in the
+ * stack; use {@link hasHelper()} to check if the helper is registered
+ * prior to retrieving it.
+ *
+ * @param string $name
+ * @return Zend_Controller_Action_Helper_Abstract
+ * @throws Zend_Controller_Action_Exception
+ */
+ public static function getExistingHelper($name)
+ {
+ $name = self::_normalizeHelperName($name);
+ $stack = self::getStack();
+
+ if (!isset($stack->{$name})) {
+ throw new Zend_Controller_Action_Exception('Action helper "' . $name . '" has not been registered with the helper broker');
+ }
+
+ return $stack->{$name};
+ }
+
+ /**
+ * Return all registered helpers as helper => object pairs
+ *
+ * @return array
+ */
+ public static function getExistingHelpers()
+ {
+ return self::getStack()->getHelpersByName();
+ }
+
+ /**
+ * Is a particular helper loaded in the broker?
+ *
+ * @param string $name
+ * @return boolean
+ */
+ public static function hasHelper($name)
+ {
+ $name = self::_normalizeHelperName($name);
+ return isset(self::getStack()->{$name});
+ }
+
+ /**
+ * Remove a particular helper from the broker
+ *
+ * @param string $name
+ * @return boolean
+ */
+ public static function removeHelper($name)
+ {
+ $name = self::_normalizeHelperName($name);
+ $stack = self::getStack();
+ if (isset($stack->{$name})) {
+ unset($stack->{$name});
+ }
+
+ return false;
+ }
+
+ /**
+ * Lazy load the priority stack and return it
+ *
+ * @return Zend_Controller_Action_HelperBroker_PriorityStack
+ */
+ public static function getStack()
+ {
+ if (self::$_stack == null) {
+ self::$_stack = new Zend_Controller_Action_HelperBroker_PriorityStack();
+ }
+
+ return self::$_stack;
+ }
+
+ /**
+ * Constructor
+ *
+ * @param Zend_Controller_Action $actionController
+ * @return void
+ */
+ public function __construct(Zend_Controller_Action $actionController)
+ {
+ $this->_actionController = $actionController;
+ foreach (self::getStack() as $helper) {
+ $helper->setActionController($actionController);
+ $helper->init();
+ }
+ }
+
+ /**
+ * notifyPreDispatch() - called by action controller dispatch method
+ *
+ * @return void
+ */
+ public function notifyPreDispatch()
+ {
+ foreach (self::getStack() as $helper) {
+ $helper->preDispatch();
+ }
+ }
+
+ /**
+ * notifyPostDispatch() - called by action controller dispatch method
+ *
+ * @return void
+ */
+ public function notifyPostDispatch()
+ {
+ foreach (self::getStack() as $helper) {
+ $helper->postDispatch();
+ }
+ }
+
+ /**
+ * getHelper() - get helper by name
+ *
+ * @param string $name
+ * @return Zend_Controller_Action_Helper_Abstract
+ */
+ public function getHelper($name)
+ {
+ $name = self::_normalizeHelperName($name);
+ $stack = self::getStack();
+
+ if (!isset($stack->{$name})) {
+ self::_loadHelper($name);
+ }
+
+ $helper = $stack->{$name};
+
+ $initialize = false;
+ if (null === ($actionController = $helper->getActionController())) {
+ $initialize = true;
+ } elseif ($actionController !== $this->_actionController) {
+ $initialize = true;
+ }
+
+ if ($initialize) {
+ $helper->setActionController($this->_actionController)
+ ->init();
+ }
+
+ return $helper;
+ }
+
+ /**
+ * Method overloading
+ *
+ * @param string $method
+ * @param array $args
+ * @return mixed
+ * @throws Zend_Controller_Action_Exception if helper does not have a direct() method
+ */
+ public function __call($method, $args)
+ {
+ $helper = $this->getHelper($method);
+ if (!method_exists($helper, 'direct')) {
+ throw new Zend_Controller_Action_Exception('Helper "' . $method . '" does not support overloading via direct()');
+ }
+ return call_user_func_array(array($helper, 'direct'), $args);
+ }
+
+ /**
+ * Retrieve helper by name as object property
+ *
+ * @param string $name
+ * @return Zend_Controller_Action_Helper_Abstract
+ */
+ public function __get($name)
+ {
+ return $this->getHelper($name);
+ }
+
+ /**
+ * Normalize helper name for lookups
+ *
+ * @param string $name
+ * @return string
+ */
+ protected static function _normalizeHelperName($name)
+ {
+ if (strpos($name, '_') !== false) {
+ $name = str_replace(' ', '', ucwords(str_replace('_', ' ', $name)));
+ }
+
+ return ucfirst($name);
+ }
+
+ /**
+ * Load a helper
+ *
+ * @param string $name
+ * @return void
+ */
+ protected static function _loadHelper($name)
+ {
+ try {
+ $class = self::getPluginLoader()->load($name);
+ } catch (Zend_Loader_PluginLoader_Exception $e) {
+ throw new Zend_Controller_Action_Exception('Action Helper by name ' . $name . ' not found', 0, $e);
+ }
+
+ $helper = new $class();
+
+ if (!$helper instanceof Zend_Controller_Action_Helper_Abstract) {
+ throw new Zend_Controller_Action_Exception('Helper name ' . $name . ' -> class ' . $class . ' is not of type Zend_Controller_Action_Helper_Abstract');
+ }
+
+ self::getStack()->push($helper);
+ }
+}
diff --git a/library/vendor/Zend/Controller/Action/HelperBroker/PriorityStack.php b/library/vendor/Zend/Controller/Action/HelperBroker/PriorityStack.php
new file mode 100644
index 0000000..c957b10
--- /dev/null
+++ b/library/vendor/Zend/Controller/Action/HelperBroker/PriorityStack.php
@@ -0,0 +1,272 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Action_HelperBroker_PriorityStack implements IteratorAggregate, ArrayAccess, Countable
+{
+
+ protected $_helpersByPriority = array();
+ protected $_helpersByNameRef = array();
+ protected $_nextDefaultPriority = 1;
+
+ /**
+ * Magic property overloading for returning helper by name
+ *
+ * @param string $helperName The helper name
+ * @return Zend_Controller_Action_Helper_Abstract
+ */
+ public function __get($helperName)
+ {
+ if (!array_key_exists($helperName, $this->_helpersByNameRef)) {
+ return false;
+ }
+
+ return $this->_helpersByNameRef[$helperName];
+ }
+
+ /**
+ * Magic property overloading for returning if helper is set by name
+ *
+ * @param string $helperName The helper name
+ * @return Zend_Controller_Action_Helper_Abstract
+ */
+ public function __isset($helperName)
+ {
+ return array_key_exists($helperName, $this->_helpersByNameRef);
+ }
+
+ /**
+ * Magic property overloading for unsetting if helper is exists by name
+ *
+ * @param string $helperName The helper name
+ */
+ public function __unset($helperName)
+ {
+ $this->offsetUnset($helperName);
+ }
+
+ /**
+ * push helper onto the stack
+ *
+ * @param Zend_Controller_Action_Helper_Abstract $helper
+ * @return Zend_Controller_Action_HelperBroker_PriorityStack
+ */
+ public function push(Zend_Controller_Action_Helper_Abstract $helper)
+ {
+ $this->offsetSet($this->getNextFreeHigherPriority(), $helper);
+ return $this;
+ }
+
+ /**
+ * Return something iterable
+ *
+ * @return Traversable
+ */
+ public function getIterator(): Traversable
+ {
+ return new ArrayObject($this->_helpersByPriority);
+ }
+
+ /**
+ * offsetExists()
+ *
+ * @param int|string $priorityOrHelperName
+ * @return bool
+ */
+ public function offsetExists($priorityOrHelperName): bool
+ {
+ if (is_string($priorityOrHelperName)) {
+ return array_key_exists($priorityOrHelperName, $this->_helpersByNameRef);
+ } else {
+ return array_key_exists($priorityOrHelperName, $this->_helpersByPriority);
+ }
+ }
+
+ /**
+ * offsetGet()
+ *
+ * @param int|string $priorityOrHelperName
+ * @return Zend_Controller_Action_Helper_Abstract
+ */
+ public function offsetGet($priorityOrHelperName): Zend_Controller_Action_Helper_Abstract
+ {
+ if (!$this->offsetExists($priorityOrHelperName)) {
+ throw new Zend_Controller_Action_Exception('A helper with priority ' . $priorityOrHelperName . ' does not exist.');
+ }
+
+ if (is_string($priorityOrHelperName)) {
+ return $this->_helpersByNameRef[$priorityOrHelperName];
+ } else {
+ return $this->_helpersByPriority[$priorityOrHelperName];
+ }
+ }
+
+ /**
+ * offsetSet()
+ *
+ * @param int $priority
+ * @param Zend_Controller_Action_Helper_Abstract $helper
+ */
+ public function offsetSet($priority, $helper): void
+ {
+ $priority = (int) $priority;
+
+ if (!$helper instanceof Zend_Controller_Action_Helper_Abstract) {
+ throw new Zend_Controller_Action_Exception('$helper must extend Zend_Controller_Action_Helper_Abstract.');
+ }
+
+ if (array_key_exists($helper->getName(), $this->_helpersByNameRef)) {
+ // remove any object with the same name to retain BC compailitbility
+ // @todo At ZF 2.0 time throw an exception here.
+ $this->offsetUnset($helper->getName());
+ }
+
+ if (array_key_exists($priority, $this->_helpersByPriority)) {
+ $priority = $this->getNextFreeHigherPriority($priority); // ensures LIFO
+ trigger_error("A helper with the same priority already exists, reassigning to $priority", E_USER_WARNING);
+ }
+
+ $this->_helpersByPriority[$priority] = $helper;
+ $this->_helpersByNameRef[$helper->getName()] = $helper;
+
+ if ($priority == ($nextFreeDefault = $this->getNextFreeHigherPriority($this->_nextDefaultPriority))) {
+ $this->_nextDefaultPriority = $nextFreeDefault;
+ }
+
+ krsort($this->_helpersByPriority); // always make sure priority and LIFO are both enforced
+ }
+
+ /**
+ * offsetUnset()
+ *
+ * @param int|string $priorityOrHelperName Priority integer or the helper name
+ */
+ public function offsetUnset($priorityOrHelperName): void
+ {
+ if (!$this->offsetExists($priorityOrHelperName)) {
+ throw new Zend_Controller_Action_Exception('A helper with priority or name ' . $priorityOrHelperName . ' does not exist.');
+ }
+
+ if (is_string($priorityOrHelperName)) {
+ $helperName = $priorityOrHelperName;
+ $helper = $this->_helpersByNameRef[$helperName];
+ $priority = array_search($helper, $this->_helpersByPriority, true);
+ } else {
+ $priority = $priorityOrHelperName;
+ $helperName = $this->_helpersByPriority[$priorityOrHelperName]->getName();
+ }
+
+ unset($this->_helpersByNameRef[$helperName]);
+ unset($this->_helpersByPriority[$priority]);
+ }
+
+ /**
+ * return the count of helpers
+ *
+ * @return int
+ */
+ public function count(): int
+ {
+ return count($this->_helpersByPriority);
+ }
+
+ /**
+ * Find the next free higher priority. If an index is given, it will
+ * find the next free highest priority after it.
+ *
+ * @param int $indexPriority OPTIONAL
+ * @return int
+ */
+ public function getNextFreeHigherPriority($indexPriority = null)
+ {
+ if ($indexPriority == null) {
+ $indexPriority = $this->_nextDefaultPriority;
+ }
+
+ $priorities = array_keys($this->_helpersByPriority);
+
+ while (in_array($indexPriority, $priorities)) {
+ $indexPriority++;
+ }
+
+ return $indexPriority;
+ }
+
+ /**
+ * Find the next free lower priority. If an index is given, it will
+ * find the next free lower priority before it.
+ *
+ * @param int $indexPriority
+ * @return int
+ */
+ public function getNextFreeLowerPriority($indexPriority = null)
+ {
+ if ($indexPriority == null) {
+ $indexPriority = $this->_nextDefaultPriority;
+ }
+
+ $priorities = array_keys($this->_helpersByPriority);
+
+ while (in_array($indexPriority, $priorities)) {
+ $indexPriority--;
+ }
+
+ return $indexPriority;
+ }
+
+ /**
+ * return the highest priority
+ *
+ * @return int
+ */
+ public function getHighestPriority()
+ {
+ return max(array_keys($this->_helpersByPriority));
+ }
+
+ /**
+ * return the lowest priority
+ *
+ * @return int
+ */
+ public function getLowestPriority()
+ {
+ return min(array_keys($this->_helpersByPriority));
+ }
+
+ /**
+ * return the helpers referenced by name
+ *
+ * @return array
+ */
+ public function getHelpersByName()
+ {
+ return $this->_helpersByNameRef;
+ }
+
+}
diff --git a/library/vendor/Zend/Controller/Action/Interface.php b/library/vendor/Zend/Controller/Action/Interface.php
new file mode 100644
index 0000000..db35463
--- /dev/null
+++ b/library/vendor/Zend/Controller/Action/Interface.php
@@ -0,0 +1,69 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Controller_Action_Interface
+{
+ /**
+ * Class constructor
+ *
+ * The request and response objects should be registered with the
+ * controller, as should be any additional optional arguments; these will be
+ * available via {@link getRequest()}, {@link getResponse()}, and
+ * {@link getInvokeArgs()}, respectively.
+ *
+ * When overriding the constructor, please consider this usage as a best
+ * practice and ensure that each is registered appropriately; the easiest
+ * way to do so is to simply call parent::__construct($request, $response,
+ * $invokeArgs).
+ *
+ * After the request, response, and invokeArgs are set, the
+ * {@link $_helper helper broker} is initialized.
+ *
+ * Finally, {@link init()} is called as the final action of
+ * instantiation, and may be safely overridden to perform initialization
+ * tasks; as a general rule, override {@link init()} instead of the
+ * constructor to customize an action controller's instantiation.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @param Zend_Controller_Response_Abstract $response
+ * @param array $invokeArgs Any additional invocation arguments
+ * @return void
+ */
+ public function __construct(Zend_Controller_Request_Abstract $request,
+ Zend_Controller_Response_Abstract $response,
+ array $invokeArgs = array());
+
+ /**
+ * Dispatch the requested action
+ *
+ * @param string $action Method name of action
+ * @return void
+ */
+ public function dispatch($action);
+}
diff --git a/library/vendor/Zend/Controller/Dispatcher/Abstract.php b/library/vendor/Zend/Controller/Dispatcher/Abstract.php
new file mode 100644
index 0000000..7c87289
--- /dev/null
+++ b/library/vendor/Zend/Controller/Dispatcher/Abstract.php
@@ -0,0 +1,435 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Dispatcher
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Controller_Dispatcher_Interface */
+
+/**
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Dispatcher
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Controller_Dispatcher_Abstract implements Zend_Controller_Dispatcher_Interface
+{
+ /**
+ * Default action
+ * @var string
+ */
+ protected $_defaultAction = 'index';
+
+ /**
+ * Default controller
+ * @var string
+ */
+ protected $_defaultController = 'index';
+
+ /**
+ * Default module
+ * @var string
+ */
+ protected $_defaultModule = 'default';
+
+ /**
+ * Front Controller instance
+ * @var Zend_Controller_Front
+ */
+ protected $_frontController;
+
+ /**
+ * Array of invocation parameters to use when instantiating action
+ * controllers
+ * @var array
+ */
+ protected $_invokeParams = array();
+
+ /**
+ * Path delimiter character
+ * @var string
+ */
+ protected $_pathDelimiter = '_';
+
+ /**
+ * Response object to pass to action controllers, if any
+ * @var Zend_Controller_Response_Abstract|null
+ */
+ protected $_response = null;
+
+ /**
+ * Word delimiter characters
+ * @var array
+ */
+ protected $_wordDelimiter = array('-', '.');
+
+ /**
+ * Constructor
+ *
+ * @return void
+ */
+ public function __construct(array $params = array())
+ {
+ $this->setParams($params);
+ }
+
+ /**
+ * Formats a string into a controller name. This is used to take a raw
+ * controller name, such as one stored inside a Zend_Controller_Request_Abstract
+ * object, and reformat it to a proper class name that a class extending
+ * Zend_Controller_Action would use.
+ *
+ * @param string $unformatted
+ * @return string
+ */
+ public function formatControllerName($unformatted)
+ {
+ return ucfirst($this->_formatName($unformatted)) . 'Controller';
+ }
+
+ /**
+ * Formats a string into an action name. This is used to take a raw
+ * action name, such as one that would be stored inside a Zend_Controller_Request_Abstract
+ * object, and reformat into a proper method name that would be found
+ * inside a class extending Zend_Controller_Action.
+ *
+ * @param string $unformatted
+ * @return string
+ */
+ public function formatActionName($unformatted)
+ {
+ $formatted = $this->_formatName($unformatted, true);
+ return strtolower(substr($formatted, 0, 1)) . substr($formatted, 1) . 'Action';
+ }
+
+ /**
+ * Verify delimiter
+ *
+ * Verify a delimiter to use in controllers or actions. May be a single
+ * string or an array of strings.
+ *
+ * @param string|array $spec
+ * @return array
+ * @throws Zend_Controller_Dispatcher_Exception with invalid delimiters
+ */
+ public function _verifyDelimiter($spec)
+ {
+ if (is_string($spec)) {
+ return (array) $spec;
+ } elseif (is_array($spec)) {
+ $allStrings = true;
+ foreach ($spec as $delim) {
+ if (!is_string($delim)) {
+ $allStrings = false;
+ break;
+ }
+ }
+
+ if (!$allStrings) {
+ throw new Zend_Controller_Dispatcher_Exception('Word delimiter array must contain only strings');
+ }
+
+ return $spec;
+ }
+
+ throw new Zend_Controller_Dispatcher_Exception('Invalid word delimiter');
+ }
+
+ /**
+ * Retrieve the word delimiter character(s) used in
+ * controller or action names
+ *
+ * @return array
+ */
+ public function getWordDelimiter()
+ {
+ return $this->_wordDelimiter;
+ }
+
+ /**
+ * Set word delimiter
+ *
+ * Set the word delimiter to use in controllers and actions. May be a
+ * single string or an array of strings.
+ *
+ * @param string|array $spec
+ * @return Zend_Controller_Dispatcher_Abstract
+ */
+ public function setWordDelimiter($spec)
+ {
+ $spec = $this->_verifyDelimiter($spec);
+ $this->_wordDelimiter = $spec;
+
+ return $this;
+ }
+
+ /**
+ * Retrieve the path delimiter character(s) used in
+ * controller names
+ *
+ * @return array
+ */
+ public function getPathDelimiter()
+ {
+ return $this->_pathDelimiter;
+ }
+
+ /**
+ * Set path delimiter
+ *
+ * Set the path delimiter to use in controllers. May be a single string or
+ * an array of strings.
+ *
+ * @param string $spec
+ * @return Zend_Controller_Dispatcher_Abstract
+ */
+ public function setPathDelimiter($spec)
+ {
+ if (!is_string($spec)) {
+ throw new Zend_Controller_Dispatcher_Exception('Invalid path delimiter');
+ }
+ $this->_pathDelimiter = $spec;
+
+ return $this;
+ }
+
+ /**
+ * Formats a string from a URI into a PHP-friendly name.
+ *
+ * By default, replaces words separated by the word separator character(s)
+ * with camelCaps. If $isAction is false, it also preserves replaces words
+ * separated by the path separation character with an underscore, making
+ * the following word Title cased. All non-alphanumeric characters are
+ * removed.
+ *
+ * @param string $unformatted
+ * @param boolean $isAction Defaults to false
+ * @return string
+ */
+ protected function _formatName($unformatted, $isAction = false)
+ {
+ // preserve directories
+ if (!$isAction) {
+ $segments = explode($this->getPathDelimiter(), $unformatted);
+ } else {
+ $segments = (array) $unformatted;
+ }
+
+ foreach ($segments as $key => $segment) {
+ $segment = str_replace($this->getWordDelimiter(), ' ', strtolower($segment));
+ $segment = preg_replace('/[^a-z0-9 ]/', '', $segment);
+ $segments[$key] = str_replace(' ', '', ucwords($segment));
+ }
+
+ return implode('_', $segments);
+ }
+
+ /**
+ * Retrieve front controller instance
+ *
+ * @return Zend_Controller_Front
+ */
+ public function getFrontController()
+ {
+ if (null === $this->_frontController) {
+ $this->_frontController = Zend_Controller_Front::getInstance();
+ }
+
+ return $this->_frontController;
+ }
+
+ /**
+ * Set front controller instance
+ *
+ * @param Zend_Controller_Front $controller
+ * @return Zend_Controller_Dispatcher_Abstract
+ */
+ public function setFrontController(Zend_Controller_Front $controller)
+ {
+ $this->_frontController = $controller;
+ return $this;
+ }
+
+ /**
+ * Add or modify a parameter to use when instantiating an action controller
+ *
+ * @param string $name
+ * @param mixed $value
+ * @return Zend_Controller_Dispatcher_Abstract
+ */
+ public function setParam($name, $value)
+ {
+ $name = (string) $name;
+ $this->_invokeParams[$name] = $value;
+ return $this;
+ }
+
+ /**
+ * Set parameters to pass to action controller constructors
+ *
+ * @param array $params
+ * @return Zend_Controller_Dispatcher_Abstract
+ */
+ public function setParams(array $params)
+ {
+ $this->_invokeParams = array_merge($this->_invokeParams, $params);
+ return $this;
+ }
+
+ /**
+ * Retrieve a single parameter from the controller parameter stack
+ *
+ * @param string $name
+ * @return mixed
+ */
+ public function getParam($name)
+ {
+ if(isset($this->_invokeParams[$name])) {
+ return $this->_invokeParams[$name];
+ }
+
+ return null;
+ }
+
+ /**
+ * Retrieve action controller instantiation parameters
+ *
+ * @return array
+ */
+ public function getParams()
+ {
+ return $this->_invokeParams;
+ }
+
+ /**
+ * Clear the controller parameter stack
+ *
+ * By default, clears all parameters. If a parameter name is given, clears
+ * only that parameter; if an array of parameter names is provided, clears
+ * each.
+ *
+ * @param null|string|array single key or array of keys for params to clear
+ * @return Zend_Controller_Dispatcher_Abstract
+ */
+ public function clearParams($name = null)
+ {
+ if (null === $name) {
+ $this->_invokeParams = array();
+ } elseif (is_string($name) && isset($this->_invokeParams[$name])) {
+ unset($this->_invokeParams[$name]);
+ } elseif (is_array($name)) {
+ foreach ($name as $key) {
+ if (is_string($key) && isset($this->_invokeParams[$key])) {
+ unset($this->_invokeParams[$key]);
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set response object to pass to action controllers
+ *
+ * @param Zend_Controller_Response_Abstract|null $response
+ * @return Zend_Controller_Dispatcher_Abstract
+ */
+ public function setResponse(Zend_Controller_Response_Abstract $response = null)
+ {
+ $this->_response = $response;
+ return $this;
+ }
+
+ /**
+ * Return the registered response object
+ *
+ * @return Zend_Controller_Response_Abstract|null
+ */
+ public function getResponse()
+ {
+ return $this->_response;
+ }
+
+ /**
+ * Set the default controller (minus any formatting)
+ *
+ * @param string $controller
+ * @return Zend_Controller_Dispatcher_Abstract
+ */
+ public function setDefaultControllerName($controller)
+ {
+ $this->_defaultController = (string) $controller;
+ return $this;
+ }
+
+ /**
+ * Retrieve the default controller name (minus formatting)
+ *
+ * @return string
+ */
+ public function getDefaultControllerName()
+ {
+ return $this->_defaultController;
+ }
+
+ /**
+ * Set the default action (minus any formatting)
+ *
+ * @param string $action
+ * @return Zend_Controller_Dispatcher_Abstract
+ */
+ public function setDefaultAction($action)
+ {
+ $this->_defaultAction = (string) $action;
+ return $this;
+ }
+
+ /**
+ * Retrieve the default action name (minus formatting)
+ *
+ * @return string
+ */
+ public function getDefaultAction()
+ {
+ return $this->_defaultAction;
+ }
+
+ /**
+ * Set the default module
+ *
+ * @param string $module
+ * @return Zend_Controller_Dispatcher_Abstract
+ */
+ public function setDefaultModule($module)
+ {
+ $this->_defaultModule = (string) $module;
+ return $this;
+ }
+
+ /**
+ * Retrieve the default module
+ *
+ * @return string
+ */
+ public function getDefaultModule()
+ {
+ return $this->_defaultModule;
+ }
+}
diff --git a/library/vendor/Zend/Controller/Dispatcher/Exception.php b/library/vendor/Zend/Controller/Dispatcher/Exception.php
new file mode 100644
index 0000000..298dfdb
--- /dev/null
+++ b/library/vendor/Zend/Controller/Dispatcher/Exception.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Dispatcher
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/** Zend_Controller_Exception */
+
+
+/**
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Dispatcher
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Dispatcher_Exception extends Zend_Controller_Exception
+{}
+
diff --git a/library/vendor/Zend/Controller/Dispatcher/Interface.php b/library/vendor/Zend/Controller/Dispatcher/Interface.php
new file mode 100644
index 0000000..1f18df7
--- /dev/null
+++ b/library/vendor/Zend/Controller/Dispatcher/Interface.php
@@ -0,0 +1,204 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Dispatcher
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Controller_Request_Abstract
+ */
+
+/**
+ * Zend_Controller_Response_Abstract
+ */
+
+/**
+ * @package Zend_Controller
+ * @subpackage Dispatcher
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Controller_Dispatcher_Interface
+{
+ /**
+ * Formats a string into a controller name. This is used to take a raw
+ * controller name, such as one that would be packaged inside a request
+ * object, and reformat it to a proper class name that a class extending
+ * Zend_Controller_Action would use.
+ *
+ * @param string $unformatted
+ * @return string
+ */
+ public function formatControllerName($unformatted);
+
+ /**
+ * Formats a string into a module name. This is used to take a raw
+ * module name, such as one that would be packaged inside a request
+ * object, and reformat it to a proper directory/class name that a class extending
+ * Zend_Controller_Action would use.
+ *
+ * @param string $unformatted
+ * @return string
+ */
+ public function formatModuleName($unformatted);
+
+ /**
+ * Formats a string into an action name. This is used to take a raw
+ * action name, such as one that would be packaged inside a request
+ * object, and reformat into a proper method name that would be found
+ * inside a class extending Zend_Controller_Action.
+ *
+ * @param string $unformatted
+ * @return string
+ */
+ public function formatActionName($unformatted);
+
+ /**
+ * Returns TRUE if an action can be dispatched, or FALSE otherwise.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return boolean
+ */
+ public function isDispatchable(Zend_Controller_Request_Abstract $request);
+
+ /**
+ * Add or modify a parameter with which to instantiate an Action Controller
+ *
+ * @param string $name
+ * @param mixed $value
+ * @return Zend_Controller_Dispatcher_Interface
+ */
+ public function setParam($name, $value);
+
+ /**
+ * Set an array of a parameters to pass to the Action Controller constructor
+ *
+ * @param array $params
+ * @return Zend_Controller_Dispatcher_Interface
+ */
+ public function setParams(array $params);
+
+ /**
+ * Retrieve a single parameter from the controller parameter stack
+ *
+ * @param string $name
+ * @return mixed
+ */
+ public function getParam($name);
+
+ /**
+ * Retrieve the parameters to pass to the Action Controller constructor
+ *
+ * @return array
+ */
+ public function getParams();
+
+ /**
+ * Clear the controller parameter stack
+ *
+ * By default, clears all parameters. If a parameter name is given, clears
+ * only that parameter; if an array of parameter names is provided, clears
+ * each.
+ *
+ * @param null|string|array single key or array of keys for params to clear
+ * @return Zend_Controller_Dispatcher_Interface
+ */
+ public function clearParams($name = null);
+
+ /**
+ * Set the response object to use, if any
+ *
+ * @param Zend_Controller_Response_Abstract|null $response
+ * @return void
+ */
+ public function setResponse(Zend_Controller_Response_Abstract $response = null);
+
+ /**
+ * Retrieve the response object, if any
+ *
+ * @return Zend_Controller_Response_Abstract|null
+ */
+ public function getResponse();
+
+ /**
+ * Add a controller directory to the controller directory stack
+ *
+ * @param string $path
+ * @param string $args
+ * @return Zend_Controller_Dispatcher_Interface
+ */
+ public function addControllerDirectory($path, $args = null);
+
+ /**
+ * Set the directory where controller files are stored
+ *
+ * Specify a string or an array; if an array is specified, all paths will be
+ * added.
+ *
+ * @param string|array $dir
+ * @return Zend_Controller_Dispatcher_Interface
+ */
+ public function setControllerDirectory($path);
+
+ /**
+ * Return the currently set directory(ies) for controller file lookup
+ *
+ * @return array
+ */
+ public function getControllerDirectory();
+
+ /**
+ * Dispatches a request object to a controller/action. If the action
+ * requests a forward to another action, a new request will be returned.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @param Zend_Controller_Response_Abstract $response
+ * @return void
+ */
+ public function dispatch(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response);
+
+ /**
+ * Whether or not a given module is valid
+ *
+ * @param string $module
+ * @return boolean
+ */
+ public function isValidModule($module);
+
+ /**
+ * Retrieve the default module name
+ *
+ * @return string
+ */
+ public function getDefaultModule();
+
+ /**
+ * Retrieve the default controller name
+ *
+ * @return string
+ */
+ public function getDefaultControllerName();
+
+ /**
+ * Retrieve the default action
+ *
+ * @return string
+ */
+ public function getDefaultAction();
+}
diff --git a/library/vendor/Zend/Controller/Dispatcher/Standard.php b/library/vendor/Zend/Controller/Dispatcher/Standard.php
new file mode 100644
index 0000000..d9449c4
--- /dev/null
+++ b/library/vendor/Zend/Controller/Dispatcher/Standard.php
@@ -0,0 +1,504 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Dispatcher
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Loader */
+
+/** Zend_Controller_Dispatcher_Abstract */
+
+/**
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Dispatcher
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Dispatcher_Standard extends Zend_Controller_Dispatcher_Abstract
+{
+ /**
+ * Current dispatchable directory
+ * @var string
+ */
+ protected $_curDirectory;
+
+ /**
+ * Current module (formatted)
+ * @var string
+ */
+ protected $_curModule;
+
+ /**
+ * Controller directory(ies)
+ * @var array
+ */
+ protected $_controllerDirectory = array();
+
+ /**
+ * Constructor: Set current module to default value
+ *
+ * @param array $params
+ * @return void
+ */
+ public function __construct(array $params = array())
+ {
+ parent::__construct($params);
+ $this->_curModule = $this->getDefaultModule();
+ }
+
+ /**
+ * Add a single path to the controller directory stack
+ *
+ * @param string $path
+ * @param string $module
+ * @return Zend_Controller_Dispatcher_Standard
+ */
+ public function addControllerDirectory($path, $module = null)
+ {
+ if (null === $module) {
+ $module = $this->_defaultModule;
+ }
+
+ $module = (string) $module;
+ $path = rtrim((string) $path, '/\\');
+
+ $this->_controllerDirectory[$module] = $path;
+ return $this;
+ }
+
+ /**
+ * Set controller directory
+ *
+ * @param array|string $directory
+ * @return Zend_Controller_Dispatcher_Standard
+ */
+ public function setControllerDirectory($directory, $module = null)
+ {
+ $this->_controllerDirectory = array();
+
+ if (is_string($directory)) {
+ $this->addControllerDirectory($directory, $module);
+ } elseif (is_array($directory)) {
+ foreach ((array) $directory as $module => $path) {
+ $this->addControllerDirectory($path, $module);
+ }
+ } else {
+ throw new Zend_Controller_Exception('Controller directory spec must be either a string or an array');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Return the currently set directories for Zend_Controller_Action class
+ * lookup
+ *
+ * If a module is specified, returns just that directory.
+ *
+ * @param string $module Module name
+ * @return array|string Returns array of all directories by default, single
+ * module directory if module argument provided
+ */
+ public function getControllerDirectory($module = null)
+ {
+ if (null === $module) {
+ return $this->_controllerDirectory;
+ }
+
+ $module = (string) $module;
+ if (array_key_exists($module, $this->_controllerDirectory)) {
+ return $this->_controllerDirectory[$module];
+ }
+
+ return null;
+ }
+
+ /**
+ * Remove a controller directory by module name
+ *
+ * @param string $module
+ * @return bool
+ */
+ public function removeControllerDirectory($module)
+ {
+ $module = (string) $module;
+ if (array_key_exists($module, $this->_controllerDirectory)) {
+ unset($this->_controllerDirectory[$module]);
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Format the module name.
+ *
+ * @param string $unformatted
+ * @return string
+ */
+ public function formatModuleName($unformatted)
+ {
+ if (($this->_defaultModule == $unformatted) && !$this->getParam('prefixDefaultModule')) {
+ return $unformatted;
+ }
+
+ return ucfirst($this->_formatName($unformatted));
+ }
+
+ /**
+ * Format action class name
+ *
+ * @param string $moduleName Name of the current module
+ * @param string $className Name of the action class
+ * @return string Formatted class name
+ */
+ public function formatClassName($moduleName, $className)
+ {
+ return $this->formatModuleName($moduleName) . '_' . $className;
+ }
+
+ /**
+ * Convert a class name to a filename
+ *
+ * @param string $class
+ * @return string
+ */
+ public function classToFilename($class)
+ {
+ return str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
+ }
+
+ /**
+ * Returns TRUE if the Zend_Controller_Request_Abstract object can be
+ * dispatched to a controller.
+ *
+ * Use this method wisely. By default, the dispatcher will fall back to the
+ * default controller (either in the module specified or the global default)
+ * if a given controller does not exist. This method returning false does
+ * not necessarily indicate the dispatcher will not still dispatch the call.
+ *
+ * @param Zend_Controller_Request_Abstract $action
+ * @return boolean
+ */
+ public function isDispatchable(Zend_Controller_Request_Abstract $request)
+ {
+ $className = $this->getControllerClass($request);
+ if (!$className) {
+ return false;
+ }
+
+ $finalClass = $className;
+ if (($this->_defaultModule != $this->_curModule)
+ || $this->getParam('prefixDefaultModule'))
+ {
+ $finalClass = $this->formatClassName($this->_curModule, $className);
+ }
+ if (class_exists($finalClass, false)) {
+ return true;
+ }
+
+ $fileSpec = $this->classToFilename($className);
+ $dispatchDir = $this->getDispatchDirectory();
+ $test = $dispatchDir . DIRECTORY_SEPARATOR . $fileSpec;
+ return Zend_Loader::isReadable($test);
+ }
+
+ /**
+ * Dispatch to a controller/action
+ *
+ * By default, if a controller is not dispatchable, dispatch() will throw
+ * an exception. If you wish to use the default controller instead, set the
+ * param 'useDefaultControllerAlways' via {@link setParam()}.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @param Zend_Controller_Response_Abstract $response
+ * @return void
+ * @throws Zend_Controller_Dispatcher_Exception
+ */
+ public function dispatch(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response)
+ {
+ $this->setResponse($response);
+
+ /**
+ * Get controller class
+ */
+ if (!$this->isDispatchable($request)) {
+ $controller = $request->getControllerName();
+ if (!$this->getParam('useDefaultControllerAlways') && !empty($controller)) {
+ throw new Zend_Controller_Dispatcher_Exception('Invalid controller specified (' . $request->getControllerName() . ')');
+ }
+
+ $className = $this->getDefaultControllerClass($request);
+ } else {
+ $className = $this->getControllerClass($request);
+ if (!$className) {
+ $className = $this->getDefaultControllerClass($request);
+ }
+ }
+
+ /**
+ * If we're in a module or prefixDefaultModule is on, we must add the module name
+ * prefix to the contents of $className, as getControllerClass does not do that automatically.
+ * We must keep a separate variable because modules are not strictly PSR-0: We need the no-module-prefix
+ * class name to do the class->file mapping, but the full class name to insantiate the controller
+ */
+ $moduleClassName = $className;
+ if (($this->_defaultModule != $this->_curModule)
+ || $this->getParam('prefixDefaultModule'))
+ {
+ $moduleClassName = $this->formatClassName($this->_curModule, $className);
+ }
+
+ /**
+ * Load the controller class file
+ */
+ $className = $this->loadClass($className);
+
+ /**
+ * Instantiate controller with request, response, and invocation
+ * arguments; throw exception if it's not an action controller
+ */
+ $controller = new $moduleClassName($request, $this->getResponse(), $this->getParams());
+ if (!($controller instanceof Zend_Controller_Action_Interface) &&
+ !($controller instanceof Zend_Controller_Action)) {
+ throw new Zend_Controller_Dispatcher_Exception(
+ 'Controller "' . $moduleClassName . '" is not an instance of Zend_Controller_Action_Interface'
+ );
+ }
+
+ /**
+ * Retrieve the action name
+ */
+ $action = $this->getActionMethod($request);
+
+ /**
+ * Dispatch the method call
+ */
+ $request->setDispatched(true);
+
+ // by default, buffer output
+ $disableOb = $this->getParam('disableOutputBuffering');
+ $obLevel = ob_get_level();
+ if (empty($disableOb)) {
+ ob_start();
+ }
+
+ try {
+ $controller->dispatch($action);
+ } catch (Exception $e) {
+ // Clean output buffer on error
+ $curObLevel = ob_get_level();
+ if ($curObLevel > $obLevel) {
+ do {
+ ob_get_clean();
+ $curObLevel = ob_get_level();
+ } while ($curObLevel > $obLevel);
+ }
+ throw $e;
+ }
+
+ if (empty($disableOb)) {
+ $content = ob_get_clean();
+ $response->appendBody($content);
+ }
+
+ // Destroy the page controller instance and reflection objects
+ $controller = null;
+ }
+
+ /**
+ * Load a controller class
+ *
+ * Attempts to load the controller class file from
+ * {@link getControllerDirectory()}. If the controller belongs to a
+ * module, looks for the module prefix to the controller class.
+ *
+ * @param string $className
+ * @return string Class name loaded
+ * @throws Zend_Controller_Dispatcher_Exception if class not loaded
+ */
+ public function loadClass($className)
+ {
+ $finalClass = $className;
+ if (($this->_defaultModule != $this->_curModule)
+ || $this->getParam('prefixDefaultModule'))
+ {
+ $finalClass = $this->formatClassName($this->_curModule, $className);
+ }
+ if (class_exists($finalClass, false)) {
+ return $finalClass;
+ }
+
+ $dispatchDir = $this->getDispatchDirectory();
+ $loadFile = $dispatchDir . DIRECTORY_SEPARATOR . $this->classToFilename($className);
+
+ if (Zend_Loader::isReadable($loadFile)) {
+ include_once $loadFile;
+ } else {
+ throw new Zend_Controller_Dispatcher_Exception('Cannot load controller class "' . $className . '" from file "' . $loadFile . "'");
+ }
+
+ if (!class_exists($finalClass, false)) {
+ throw new Zend_Controller_Dispatcher_Exception('Invalid controller class ("' . $finalClass . '")');
+ }
+
+ return $finalClass;
+ }
+
+ /**
+ * Get controller class name
+ *
+ * Try request first; if not found, try pulling from request parameter;
+ * if still not found, fallback to default
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return string|false Returns class name on success
+ */
+ public function getControllerClass(Zend_Controller_Request_Abstract $request)
+ {
+ $controllerName = $request->getControllerName();
+ if (empty($controllerName)) {
+ if (!$this->getParam('useDefaultControllerAlways')) {
+ return false;
+ }
+ $controllerName = $this->getDefaultControllerName();
+ $request->setControllerName($controllerName);
+ }
+
+ $className = $this->formatControllerName($controllerName);
+
+ $controllerDirs = $this->getControllerDirectory();
+ $module = $request->getModuleName();
+ if ($this->isValidModule($module)) {
+ $this->_curModule = $module;
+ $this->_curDirectory = $controllerDirs[$module];
+ } elseif ($this->isValidModule($this->_defaultModule)) {
+ $request->setModuleName($this->_defaultModule);
+ $this->_curModule = $this->_defaultModule;
+ $this->_curDirectory = $controllerDirs[$this->_defaultModule];
+ } else {
+ throw new Zend_Controller_Exception('No default module defined for this application');
+ }
+
+ return $className;
+ }
+
+ /**
+ * Determine if a given module is valid
+ *
+ * @param string $module
+ * @return bool
+ */
+ public function isValidModule($module)
+ {
+ if (!is_string($module)) {
+ return false;
+ }
+
+ $module = strtolower($module);
+ $controllerDir = $this->getControllerDirectory();
+ foreach (array_keys($controllerDir) as $moduleName) {
+ if ($module == strtolower($moduleName)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Retrieve default controller class
+ *
+ * Determines whether the default controller to use lies within the
+ * requested module, or if the global default should be used.
+ *
+ * By default, will only use the module default unless that controller does
+ * not exist; if this is the case, it falls back to the default controller
+ * in the default module.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return string
+ */
+ public function getDefaultControllerClass(Zend_Controller_Request_Abstract $request)
+ {
+ $controller = $this->getDefaultControllerName();
+ $default = $this->formatControllerName($controller);
+ $request->setControllerName($controller)
+ ->setActionName(null);
+
+ $module = $request->getModuleName();
+ $controllerDirs = $this->getControllerDirectory();
+ $this->_curModule = $this->_defaultModule;
+ $this->_curDirectory = $controllerDirs[$this->_defaultModule];
+ if ($this->isValidModule($module)) {
+ $found = false;
+ if (class_exists($default, false)) {
+ $found = true;
+ } else {
+ $moduleDir = $controllerDirs[$module];
+ $fileSpec = $moduleDir . DIRECTORY_SEPARATOR . $this->classToFilename($default);
+ if (Zend_Loader::isReadable($fileSpec)) {
+ $found = true;
+ $this->_curDirectory = $moduleDir;
+ }
+ }
+ if ($found) {
+ $request->setModuleName($module);
+ $this->_curModule = $this->formatModuleName($module);
+ }
+ } else {
+ $request->setModuleName($this->_defaultModule);
+ }
+
+ return $default;
+ }
+
+ /**
+ * Return the value of the currently selected dispatch directory (as set by
+ * {@link getController()})
+ *
+ * @return string
+ */
+ public function getDispatchDirectory()
+ {
+ return $this->_curDirectory;
+ }
+
+ /**
+ * Determine the action name
+ *
+ * First attempt to retrieve from request; then from request params
+ * using action key; default to default action
+ *
+ * Returns formatted action name
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return string
+ */
+ public function getActionMethod(Zend_Controller_Request_Abstract $request)
+ {
+ $action = $request->getActionName();
+ if (empty($action)) {
+ $action = $this->getDefaultAction();
+ $request->setActionName($action);
+ }
+
+ return $this->formatActionName($action);
+ }
+}
diff --git a/library/vendor/Zend/Controller/Exception.php b/library/vendor/Zend/Controller/Exception.php
new file mode 100644
index 0000000..861289f
--- /dev/null
+++ b/library/vendor/Zend/Controller/Exception.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/** Zend_Exception */
+
+
+/**
+ * @category Zend
+ * @package Zend_Controller
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Exception extends Zend_Exception
+{}
+
diff --git a/library/vendor/Zend/Controller/Front.php b/library/vendor/Zend/Controller/Front.php
new file mode 100644
index 0000000..e5bb40a
--- /dev/null
+++ b/library/vendor/Zend/Controller/Front.php
@@ -0,0 +1,977 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/** Zend_Loader */
+
+/** Zend_Controller_Action_HelperBroker */
+
+/** Zend_Controller_Plugin_Broker */
+
+/**
+ * @category Zend
+ * @package Zend_Controller
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Front
+{
+ /**
+ * Base URL
+ * @var string
+ */
+ protected $_baseUrl = null;
+
+ /**
+ * Directory|ies where controllers are stored
+ *
+ * @var string|array
+ */
+ protected $_controllerDir = null;
+
+ /**
+ * Instance of Zend_Controller_Dispatcher_Interface
+ * @var Zend_Controller_Dispatcher_Interface
+ */
+ protected $_dispatcher = null;
+
+ /**
+ * Singleton instance
+ *
+ * Marked only as protected to allow extension of the class. To extend,
+ * simply override {@link getInstance()}.
+ *
+ * @var Zend_Controller_Front
+ */
+ protected static $_instance = null;
+
+ /**
+ * Array of invocation parameters to use when instantiating action
+ * controllers
+ * @var array
+ */
+ protected $_invokeParams = array();
+
+ /**
+ * Subdirectory within a module containing controllers; defaults to 'controllers'
+ * @var string
+ */
+ protected $_moduleControllerDirectoryName = 'controllers';
+
+ /**
+ * Instance of Zend_Controller_Plugin_Broker
+ * @var Zend_Controller_Plugin_Broker
+ */
+ protected $_plugins = null;
+
+ /**
+ * Instance of Zend_Controller_Request_Abstract
+ * @var Zend_Controller_Request_Abstract
+ */
+ protected $_request = null;
+
+ /**
+ * Instance of Zend_Controller_Response_Abstract
+ * @var Zend_Controller_Response_Abstract
+ */
+ protected $_response = null;
+
+ /**
+ * Whether or not to return the response prior to rendering output while in
+ * {@link dispatch()}; default is to send headers and render output.
+ * @var boolean
+ */
+ protected $_returnResponse = false;
+
+ /**
+ * Instance of Zend_Controller_Router_Interface
+ * @var Zend_Controller_Router_Interface
+ */
+ protected $_router = null;
+
+ /**
+ * Whether or not exceptions encountered in {@link dispatch()} should be
+ * thrown or trapped in the response object
+ * @var boolean
+ */
+ protected $_throwExceptions = false;
+
+ /**
+ * Constructor
+ *
+ * Instantiate using {@link getInstance()}; front controller is a singleton
+ * object.
+ *
+ * Instantiates the plugin broker.
+ *
+ * @return void
+ */
+ protected function __construct()
+ {
+ $this->_plugins = new Zend_Controller_Plugin_Broker();
+ }
+
+ /**
+ * Enforce singleton; disallow cloning
+ *
+ * @return void
+ */
+ private function __clone()
+ {
+ }
+
+ /**
+ * Singleton instance
+ *
+ * @return Zend_Controller_Front
+ */
+ public static function getInstance()
+ {
+ if (null === self::$_instance) {
+ self::$_instance = new self();
+ }
+
+ return self::$_instance;
+ }
+
+ /**
+ * Resets all object properties of the singleton instance
+ *
+ * Primarily used for testing; could be used to chain front controllers.
+ *
+ * Also resets action helper broker, clearing all registered helpers.
+ *
+ * @return void
+ */
+ public function resetInstance()
+ {
+ $reflection = new ReflectionObject($this);
+ foreach ($reflection->getProperties() as $property) {
+ $name = $property->getName();
+ switch ($name) {
+ case '_instance':
+ break;
+ case '_controllerDir':
+ case '_invokeParams':
+ $this->{$name} = array();
+ break;
+ case '_plugins':
+ $this->{$name} = new Zend_Controller_Plugin_Broker();
+ break;
+ case '_throwExceptions':
+ case '_returnResponse':
+ $this->{$name} = false;
+ break;
+ case '_moduleControllerDirectoryName':
+ $this->{$name} = 'controllers';
+ break;
+ default:
+ $this->{$name} = null;
+ break;
+ }
+ }
+ Zend_Controller_Action_HelperBroker::resetHelpers();
+ }
+
+ /**
+ * Convenience feature, calls setControllerDirectory()->setRouter()->dispatch()
+ *
+ * In PHP 5.1.x, a call to a static method never populates $this -- so run()
+ * may actually be called after setting up your front controller.
+ *
+ * @param string|array $controllerDirectory Path to Zend_Controller_Action
+ * controller classes or array of such paths
+ * @return void
+ * @throws Zend_Controller_Exception if called from an object instance
+ */
+ public static function run($controllerDirectory)
+ {
+ self::getInstance()
+ ->setControllerDirectory($controllerDirectory)
+ ->dispatch();
+ }
+
+ /**
+ * Add a controller directory to the controller directory stack
+ *
+ * If $args is presented and is a string, uses it for the array key mapping
+ * to the directory specified.
+ *
+ * @param string $directory
+ * @param string $module Optional argument; module with which to associate directory. If none provided, assumes 'default'
+ * @return Zend_Controller_Front
+ * @throws Zend_Controller_Exception if directory not found or readable
+ */
+ public function addControllerDirectory($directory, $module = null)
+ {
+ $this->getDispatcher()->addControllerDirectory($directory, $module);
+ return $this;
+ }
+
+ /**
+ * Set controller directory
+ *
+ * Stores controller directory(ies) in dispatcher. May be an array of
+ * directories or a string containing a single directory.
+ *
+ * @param string|array $directory Path to Zend_Controller_Action controller
+ * classes or array of such paths
+ * @param string $module Optional module name to use with string $directory
+ * @return Zend_Controller_Front
+ */
+ public function setControllerDirectory($directory, $module = null)
+ {
+ $this->getDispatcher()->setControllerDirectory($directory, $module);
+ return $this;
+ }
+
+ /**
+ * Retrieve controller directory
+ *
+ * Retrieves:
+ * - Array of all controller directories if no $name passed
+ * - String path if $name passed and exists as a key in controller directory array
+ * - null if $name passed but does not exist in controller directory keys
+ *
+ * @param string $name Default null
+ * @return array|string|null
+ */
+ public function getControllerDirectory($name = null)
+ {
+ return $this->getDispatcher()->getControllerDirectory($name);
+ }
+
+ /**
+ * Remove a controller directory by module name
+ *
+ * @param string $module
+ * @return bool
+ */
+ public function removeControllerDirectory($module)
+ {
+ return $this->getDispatcher()->removeControllerDirectory($module);
+ }
+
+ /**
+ * Specify a directory as containing modules
+ *
+ * Iterates through the directory, adding any subdirectories as modules;
+ * the subdirectory within each module named after {@link $_moduleControllerDirectoryName}
+ * will be used as the controller directory path.
+ *
+ * @param string $path
+ * @return Zend_Controller_Front
+ */
+ public function addModuleDirectory($path)
+ {
+ try{
+ $dir = new DirectoryIterator($path);
+ } catch(Exception $e) {
+ throw new Zend_Controller_Exception("Directory $path not readable", 0, $e);
+ }
+ foreach ($dir as $file) {
+ if ($file->isDot() || !$file->isDir()) {
+ continue;
+ }
+
+ $module = $file->getFilename();
+
+ // Don't use SCCS directories as modules
+ if (preg_match('/^[^a-z]/i', $module) || ('CVS' == $module)) {
+ continue;
+ }
+
+ $moduleDir = $file->getPathname() . DIRECTORY_SEPARATOR . $this->getModuleControllerDirectoryName();
+ $this->addControllerDirectory($moduleDir, $module);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Return the path to a module directory (but not the controllers directory within)
+ *
+ * @param string $module
+ * @return string|null
+ */
+ public function getModuleDirectory($module = null)
+ {
+ if (null === $module) {
+ $request = $this->getRequest();
+ if (null !== $request) {
+ $module = $this->getRequest()->getModuleName();
+ }
+ if (empty($module)) {
+ $module = $this->getDispatcher()->getDefaultModule();
+ }
+ }
+
+ $controllerDir = $this->getControllerDirectory($module);
+
+ if ((null === $controllerDir) || !is_string($controllerDir)) {
+ return null;
+ }
+
+ return dirname($controllerDir);
+ }
+
+ /**
+ * Set the directory name within a module containing controllers
+ *
+ * @param string $name
+ * @return Zend_Controller_Front
+ */
+ public function setModuleControllerDirectoryName($name = 'controllers')
+ {
+ $this->_moduleControllerDirectoryName = (string) $name;
+
+ return $this;
+ }
+
+ /**
+ * Return the directory name within a module containing controllers
+ *
+ * @return string
+ */
+ public function getModuleControllerDirectoryName()
+ {
+ return $this->_moduleControllerDirectoryName;
+ }
+
+ /**
+ * Set the default controller (unformatted string)
+ *
+ * @param string $controller
+ * @return Zend_Controller_Front
+ */
+ public function setDefaultControllerName($controller)
+ {
+ $dispatcher = $this->getDispatcher();
+ $dispatcher->setDefaultControllerName($controller);
+ return $this;
+ }
+
+ /**
+ * Retrieve the default controller (unformatted string)
+ *
+ * @return string
+ */
+ public function getDefaultControllerName()
+ {
+ return $this->getDispatcher()->getDefaultControllerName();
+ }
+
+ /**
+ * Set the default action (unformatted string)
+ *
+ * @param string $action
+ * @return Zend_Controller_Front
+ */
+ public function setDefaultAction($action)
+ {
+ $dispatcher = $this->getDispatcher();
+ $dispatcher->setDefaultAction($action);
+ return $this;
+ }
+
+ /**
+ * Retrieve the default action (unformatted string)
+ *
+ * @return string
+ */
+ public function getDefaultAction()
+ {
+ return $this->getDispatcher()->getDefaultAction();
+ }
+
+ /**
+ * Set the default module name
+ *
+ * @param string $module
+ * @return Zend_Controller_Front
+ */
+ public function setDefaultModule($module)
+ {
+ $dispatcher = $this->getDispatcher();
+ $dispatcher->setDefaultModule($module);
+ return $this;
+ }
+
+ /**
+ * Retrieve the default module
+ *
+ * @return string
+ */
+ public function getDefaultModule()
+ {
+ return $this->getDispatcher()->getDefaultModule();
+ }
+
+ /**
+ * Set request class/object
+ *
+ * Set the request object. The request holds the request environment.
+ *
+ * If a class name is provided, it will instantiate it
+ *
+ * @param string|Zend_Controller_Request_Abstract $request
+ * @throws Zend_Controller_Exception if invalid request class
+ * @return Zend_Controller_Front
+ */
+ public function setRequest($request)
+ {
+ if (is_string($request)) {
+ if (!class_exists($request)) {
+ Zend_Loader::loadClass($request);
+ }
+ $request = new $request();
+ }
+ if (!$request instanceof Zend_Controller_Request_Abstract) {
+ throw new Zend_Controller_Exception('Invalid request class');
+ }
+
+ $this->_request = $request;
+
+ return $this;
+ }
+
+ /**
+ * Return the request object.
+ *
+ * @return null|Zend_Controller_Request_Abstract
+ */
+ public function getRequest()
+ {
+ return $this->_request;
+ }
+
+ /**
+ * Set router class/object
+ *
+ * Set the router object. The router is responsible for mapping
+ * the request to a controller and action.
+ *
+ * If a class name is provided, instantiates router with any parameters
+ * registered via {@link setParam()} or {@link setParams()}.
+ *
+ * @param string|Zend_Controller_Router_Interface $router
+ * @throws Zend_Controller_Exception if invalid router class
+ * @return Zend_Controller_Front
+ */
+ public function setRouter($router)
+ {
+ if (is_string($router)) {
+ if (!class_exists($router)) {
+ Zend_Loader::loadClass($router);
+ }
+ $router = new $router();
+ }
+
+ if (!$router instanceof Zend_Controller_Router_Interface) {
+ throw new Zend_Controller_Exception('Invalid router class');
+ }
+
+ $router->setFrontController($this);
+ $this->_router = $router;
+
+ return $this;
+ }
+
+ /**
+ * Return the router object.
+ *
+ * Instantiates a Zend_Controller_Router_Rewrite object if no router currently set.
+ *
+ * @return Zend_Controller_Router_Interface
+ */
+ public function getRouter()
+ {
+ if (null == $this->_router) {
+ $this->setRouter(new Zend_Controller_Router_Rewrite());
+ }
+
+ return $this->_router;
+ }
+
+ /**
+ * Set the base URL used for requests
+ *
+ * Use to set the base URL segment of the REQUEST_URI to use when
+ * determining PATH_INFO, etc. Examples:
+ * - /admin
+ * - /myapp
+ * - /subdir/index.php
+ *
+ * Note that the URL should not include the full URI. Do not use:
+ * - http://example.com/admin
+ * - http://example.com/myapp
+ * - http://example.com/subdir/index.php
+ *
+ * If a null value is passed, this can be used as well for autodiscovery (default).
+ *
+ * @param string $base
+ * @return Zend_Controller_Front
+ * @throws Zend_Controller_Exception for non-string $base
+ */
+ public function setBaseUrl($base = null)
+ {
+ if (!is_string($base) && (null !== $base)) {
+ throw new Zend_Controller_Exception('Rewrite base must be a string');
+ }
+
+ $this->_baseUrl = $base;
+
+ if ((null !== ($request = $this->getRequest())) && (method_exists($request, 'setBaseUrl'))) {
+ $request->setBaseUrl($base);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Retrieve the currently set base URL
+ *
+ * @return string
+ */
+ public function getBaseUrl()
+ {
+ $request = $this->getRequest();
+ if ((null !== $request) && method_exists($request, 'getBaseUrl')) {
+ return $request->getBaseUrl();
+ }
+
+ return $this->_baseUrl;
+ }
+
+ /**
+ * Set the dispatcher object. The dispatcher is responsible for
+ * taking a Zend_Controller_Dispatcher_Token object, instantiating the controller, and
+ * call the action method of the controller.
+ *
+ * @param Zend_Controller_Dispatcher_Interface $dispatcher
+ * @return Zend_Controller_Front
+ */
+ public function setDispatcher(Zend_Controller_Dispatcher_Interface $dispatcher)
+ {
+ $this->_dispatcher = $dispatcher;
+ return $this;
+ }
+
+ /**
+ * Return the dispatcher object.
+ *
+ * @return Zend_Controller_Dispatcher_Interface
+ */
+ public function getDispatcher()
+ {
+ /**
+ * Instantiate the default dispatcher if one was not set.
+ */
+ if (!$this->_dispatcher instanceof Zend_Controller_Dispatcher_Interface) {
+ $this->_dispatcher = new Zend_Controller_Dispatcher_Standard();
+ }
+ return $this->_dispatcher;
+ }
+
+ /**
+ * Set response class/object
+ *
+ * Set the response object. The response is a container for action
+ * responses and headers. Usage is optional.
+ *
+ * If a class name is provided, instantiates a response object.
+ *
+ * @param string|Zend_Controller_Response_Abstract $response
+ * @throws Zend_Controller_Exception if invalid response class
+ * @return Zend_Controller_Front
+ */
+ public function setResponse($response)
+ {
+ if (is_string($response)) {
+ if (!class_exists($response)) {
+ Zend_Loader::loadClass($response);
+ }
+ $response = new $response();
+ }
+ if (!$response instanceof Zend_Controller_Response_Abstract) {
+ throw new Zend_Controller_Exception('Invalid response class');
+ }
+
+ $this->_response = $response;
+
+ return $this;
+ }
+
+ /**
+ * Return the response object.
+ *
+ * @return null|Zend_Controller_Response_Abstract
+ */
+ public function getResponse()
+ {
+ return $this->_response;
+ }
+
+ /**
+ * Add or modify a parameter to use when instantiating an action controller
+ *
+ * @param string $name
+ * @param mixed $value
+ * @return Zend_Controller_Front
+ */
+ public function setParam($name, $value)
+ {
+ $name = (string) $name;
+ $this->_invokeParams[$name] = $value;
+ return $this;
+ }
+
+ /**
+ * Set parameters to pass to action controller constructors
+ *
+ * @param array $params
+ * @return Zend_Controller_Front
+ */
+ public function setParams(array $params)
+ {
+ $this->_invokeParams = array_merge($this->_invokeParams, $params);
+ return $this;
+ }
+
+ /**
+ * Retrieve a single parameter from the controller parameter stack
+ *
+ * @param string $name
+ * @return mixed
+ */
+ public function getParam($name)
+ {
+ if(isset($this->_invokeParams[$name])) {
+ return $this->_invokeParams[$name];
+ }
+
+ return null;
+ }
+
+ /**
+ * Retrieve action controller instantiation parameters
+ *
+ * @return array
+ */
+ public function getParams()
+ {
+ return $this->_invokeParams;
+ }
+
+ /**
+ * Clear the controller parameter stack
+ *
+ * By default, clears all parameters. If a parameter name is given, clears
+ * only that parameter; if an array of parameter names is provided, clears
+ * each.
+ *
+ * @param null|string|array single key or array of keys for params to clear
+ * @return Zend_Controller_Front
+ */
+ public function clearParams($name = null)
+ {
+ if (null === $name) {
+ $this->_invokeParams = array();
+ } elseif (is_string($name) && isset($this->_invokeParams[$name])) {
+ unset($this->_invokeParams[$name]);
+ } elseif (is_array($name)) {
+ foreach ($name as $key) {
+ if (is_string($key) && isset($this->_invokeParams[$key])) {
+ unset($this->_invokeParams[$key]);
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Register a plugin.
+ *
+ * @param Zend_Controller_Plugin_Abstract $plugin
+ * @param int $stackIndex Optional; stack index for plugin
+ * @return Zend_Controller_Front
+ */
+ public function registerPlugin(Zend_Controller_Plugin_Abstract $plugin, $stackIndex = null)
+ {
+ $this->_plugins->registerPlugin($plugin, $stackIndex);
+ return $this;
+ }
+
+ /**
+ * Unregister a plugin.
+ *
+ * @param string|Zend_Controller_Plugin_Abstract $plugin Plugin class or object to unregister
+ * @return Zend_Controller_Front
+ */
+ public function unregisterPlugin($plugin)
+ {
+ $this->_plugins->unregisterPlugin($plugin);
+ return $this;
+ }
+
+ /**
+ * Is a particular plugin registered?
+ *
+ * @param string $class
+ * @return bool
+ */
+ public function hasPlugin($class)
+ {
+ return $this->_plugins->hasPlugin($class);
+ }
+
+ /**
+ * Retrieve a plugin or plugins by class
+ *
+ * @param string $class
+ * @return false|Zend_Controller_Plugin_Abstract|array
+ */
+ public function getPlugin($class)
+ {
+ return $this->_plugins->getPlugin($class);
+ }
+
+ /**
+ * Retrieve all plugins
+ *
+ * @return array
+ */
+ public function getPlugins()
+ {
+ return $this->_plugins->getPlugins();
+ }
+
+ /**
+ * Set the throwExceptions flag and retrieve current status
+ *
+ * Set whether exceptions encounted in the dispatch loop should be thrown
+ * or caught and trapped in the response object.
+ *
+ * Default behaviour is to trap them in the response object; call this
+ * method to have them thrown.
+ *
+ * Passing no value will return the current value of the flag; passing a
+ * boolean true or false value will set the flag and return the current
+ * object instance.
+ *
+ * @param boolean $flag Defaults to null (return flag state)
+ * @return boolean|Zend_Controller_Front Used as a setter, returns object; as a getter, returns boolean
+ */
+ public function throwExceptions($flag = null)
+ {
+ if ($flag !== null) {
+ $this->_throwExceptions = (bool) $flag;
+ return $this;
+ }
+
+ return $this->_throwExceptions;
+ }
+
+ /**
+ * Set whether {@link dispatch()} should return the response without first
+ * rendering output. By default, output is rendered and dispatch() returns
+ * nothing.
+ *
+ * @param boolean $flag
+ * @return boolean|Zend_Controller_Front Used as a setter, returns object; as a getter, returns boolean
+ */
+ public function returnResponse($flag = null)
+ {
+ if (true === $flag) {
+ $this->_returnResponse = true;
+ return $this;
+ } elseif (false === $flag) {
+ $this->_returnResponse = false;
+ return $this;
+ }
+
+ return $this->_returnResponse;
+ }
+
+ /**
+ * Dispatch an HTTP request to a controller/action.
+ *
+ * @param Zend_Controller_Request_Abstract|null $request
+ * @param Zend_Controller_Response_Abstract|null $response
+ * @return void|Zend_Controller_Response_Abstract Returns response object if returnResponse() is true
+ */
+ public function dispatch(Zend_Controller_Request_Abstract $request = null, Zend_Controller_Response_Abstract $response = null)
+ {
+ if (!$this->getParam('noErrorHandler') && !$this->_plugins->hasPlugin('Zend_Controller_Plugin_ErrorHandler')) {
+ // Register with stack index of 100
+ $this->_plugins->registerPlugin(new Zend_Controller_Plugin_ErrorHandler(), 100);
+ }
+
+ if (!$this->getParam('noViewRenderer') && !Zend_Controller_Action_HelperBroker::hasHelper('viewRenderer')) {
+ Zend_Controller_Action_HelperBroker::getStack()->offsetSet(-80, new Zend_Controller_Action_Helper_ViewRenderer());
+ }
+
+ /**
+ * Instantiate default request object (HTTP version) if none provided
+ */
+ if (null !== $request) {
+ $this->setRequest($request);
+ } elseif ((null === $request) && (null === ($request = $this->getRequest()))) {
+ $request = new Zend_Controller_Request_Http();
+ $this->setRequest($request);
+ }
+
+ /**
+ * Set base URL of request object, if available
+ */
+ if (is_callable(array($this->_request, 'setBaseUrl'))) {
+ if (null !== $this->_baseUrl) {
+ $this->_request->setBaseUrl($this->_baseUrl);
+ }
+ }
+
+ /**
+ * Instantiate default response object (HTTP version) if none provided
+ */
+ if (null !== $response) {
+ $this->setResponse($response);
+ } elseif ((null === $this->_response) && (null === ($this->_response = $this->getResponse()))) {
+ $response = new Zend_Controller_Response_Http();
+ $this->setResponse($response);
+ }
+
+ /**
+ * Register request and response objects with plugin broker
+ */
+ $this->_plugins
+ ->setRequest($this->_request)
+ ->setResponse($this->_response);
+
+ /**
+ * Initialize router
+ */
+ $router = $this->getRouter();
+ $router->setParams($this->getParams());
+
+ /**
+ * Initialize dispatcher
+ */
+ $dispatcher = $this->getDispatcher();
+ $dispatcher->setParams($this->getParams())
+ ->setResponse($this->_response);
+
+ // Begin dispatch
+ try {
+ /**
+ * Route request to controller/action, if a router is provided
+ */
+
+ /**
+ * Notify plugins of router startup
+ */
+ $this->_plugins->routeStartup($this->_request);
+
+ try {
+ $router->route($this->_request);
+ } catch (Exception $e) {
+ if ($this->throwExceptions()) {
+ throw $e;
+ }
+
+ $this->_response->setException($e);
+ }
+
+ /**
+ * Notify plugins of router completion
+ */
+ $this->_plugins->routeShutdown($this->_request);
+
+ /**
+ * Notify plugins of dispatch loop startup
+ */
+ $this->_plugins->dispatchLoopStartup($this->_request);
+
+ /**
+ * Attempt to dispatch the controller/action. If the $this->_request
+ * indicates that it needs to be dispatched, move to the next
+ * action in the request.
+ */
+ do {
+ $this->_request->setDispatched(true);
+
+ /**
+ * Notify plugins of dispatch startup
+ */
+ $this->_plugins->preDispatch($this->_request);
+
+ /**
+ * Skip requested action if preDispatch() has reset it
+ */
+ if (!$this->_request->isDispatched()) {
+ continue;
+ }
+
+ /**
+ * Dispatch request
+ */
+ try {
+ $dispatcher->dispatch($this->_request, $this->_response);
+ } catch (Exception $e) {
+ if ($this->throwExceptions()) {
+ throw $e;
+ }
+ $this->_response->setException($e);
+ }
+
+ /**
+ * Notify plugins of dispatch completion
+ */
+ $this->_plugins->postDispatch($this->_request);
+ } while (!$this->_request->isDispatched());
+ } catch (Exception $e) {
+ if ($this->throwExceptions()) {
+ throw $e;
+ }
+
+ $this->_response->setException($e);
+ }
+
+ /**
+ * Notify plugins of dispatch loop completion
+ */
+ try {
+ $this->_plugins->dispatchLoopShutdown();
+ } catch (Exception $e) {
+ if ($this->throwExceptions()) {
+ throw $e;
+ }
+
+ $this->_response->setException($e);
+ }
+
+ if ($this->returnResponse()) {
+ return $this->_response;
+ }
+
+ $this->_response->sendResponse();
+ }
+}
diff --git a/library/vendor/Zend/Controller/Plugin/Abstract.php b/library/vendor/Zend/Controller/Plugin/Abstract.php
new file mode 100644
index 0000000..7e590b7
--- /dev/null
+++ b/library/vendor/Zend/Controller/Plugin/Abstract.php
@@ -0,0 +1,151 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Plugins
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Plugins
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Controller_Plugin_Abstract
+{
+ /**
+ * @var Zend_Controller_Request_Abstract
+ */
+ protected $_request;
+
+ /**
+ * @var Zend_Controller_Response_Abstract
+ */
+ protected $_response;
+
+ /**
+ * Set request object
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return Zend_Controller_Plugin_Abstract
+ */
+ public function setRequest(Zend_Controller_Request_Abstract $request)
+ {
+ $this->_request = $request;
+ return $this;
+ }
+
+ /**
+ * Get request object
+ *
+ * @return Zend_Controller_Request_Abstract $request
+ */
+ public function getRequest()
+ {
+ return $this->_request;
+ }
+
+ /**
+ * Set response object
+ *
+ * @param Zend_Controller_Response_Abstract $response
+ * @return Zend_Controller_Plugin_Abstract
+ */
+ public function setResponse(Zend_Controller_Response_Abstract $response)
+ {
+ $this->_response = $response;
+ return $this;
+ }
+
+ /**
+ * Get response object
+ *
+ * @return Zend_Controller_Response_Abstract $response
+ */
+ public function getResponse()
+ {
+ return $this->_response;
+ }
+
+ /**
+ * Called before Zend_Controller_Front begins evaluating the
+ * request against its routes.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return void
+ */
+ public function routeStartup(Zend_Controller_Request_Abstract $request)
+ {}
+
+ /**
+ * Called after Zend_Controller_Router exits.
+ *
+ * Called after Zend_Controller_Front exits from the router.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return void
+ */
+ public function routeShutdown(Zend_Controller_Request_Abstract $request)
+ {}
+
+ /**
+ * Called before Zend_Controller_Front enters its dispatch loop.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return void
+ */
+ public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
+ {}
+
+ /**
+ * Called before an action is dispatched by Zend_Controller_Dispatcher.
+ *
+ * This callback allows for proxy or filter behavior. By altering the
+ * request and resetting its dispatched flag (via
+ * {@link Zend_Controller_Request_Abstract::setDispatched() setDispatched(false)}),
+ * the current action may be skipped.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return void
+ */
+ public function preDispatch(Zend_Controller_Request_Abstract $request)
+ {}
+
+ /**
+ * Called after an action is dispatched by Zend_Controller_Dispatcher.
+ *
+ * This callback allows for proxy or filter behavior. By altering the
+ * request and resetting its dispatched flag (via
+ * {@link Zend_Controller_Request_Abstract::setDispatched() setDispatched(false)}),
+ * a new action may be specified for dispatching.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return void
+ */
+ public function postDispatch(Zend_Controller_Request_Abstract $request)
+ {}
+
+ /**
+ * Called before Zend_Controller_Front exits its dispatch loop.
+ *
+ * @return void
+ */
+ public function dispatchLoopShutdown()
+ {}
+}
diff --git a/library/vendor/Zend/Controller/Plugin/ActionStack.php b/library/vendor/Zend/Controller/Plugin/ActionStack.php
new file mode 100644
index 0000000..c654a6c
--- /dev/null
+++ b/library/vendor/Zend/Controller/Plugin/ActionStack.php
@@ -0,0 +1,277 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Plugins
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Controller_Plugin_Abstract */
+
+/** Zend_Registry */
+
+/**
+ * Manage a stack of actions
+ *
+ * @uses Zend_Controller_Plugin_Abstract
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Plugins
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Controller_Plugin_ActionStack extends Zend_Controller_Plugin_Abstract
+{
+ /** @var Zend_Registry */
+ protected $_registry;
+
+ /**
+ * Registry key under which actions are stored
+ * @var string
+ */
+ protected $_registryKey = 'Zend_Controller_Plugin_ActionStack';
+
+ /**
+ * Valid keys for stack items
+ * @var array
+ */
+ protected $_validKeys = array(
+ 'module',
+ 'controller',
+ 'action',
+ 'params'
+ );
+
+ /**
+ * Flag to determine whether request parameters are cleared between actions, or whether new parameters
+ * are added to existing request parameters.
+ *
+ * @var Bool
+ */
+ protected $_clearRequestParams = false;
+
+ /**
+ * Constructor
+ *
+ * @param Zend_Registry $registry
+ * @param string $key
+ * @return void
+ */
+ public function __construct(Zend_Registry $registry = null, $key = null)
+ {
+ if (null === $registry) {
+ $registry = Zend_Registry::getInstance();
+ }
+ $this->setRegistry($registry);
+
+ if (null !== $key) {
+ $this->setRegistryKey($key);
+ } else {
+ $key = $this->getRegistryKey();
+ }
+
+ $registry[$key] = array();
+ }
+
+ /**
+ * Set registry object
+ *
+ * @param Zend_Registry $registry
+ * @return Zend_Controller_Plugin_ActionStack
+ */
+ public function setRegistry(Zend_Registry $registry)
+ {
+ $this->_registry = $registry;
+ return $this;
+ }
+
+ /**
+ * Retrieve registry object
+ *
+ * @return Zend_Registry
+ */
+ public function getRegistry()
+ {
+ return $this->_registry;
+ }
+
+ /**
+ * Retrieve registry key
+ *
+ * @return string
+ */
+ public function getRegistryKey()
+ {
+ return $this->_registryKey;
+ }
+
+ /**
+ * Set registry key
+ *
+ * @param string $key
+ * @return Zend_Controller_Plugin_ActionStack
+ */
+ public function setRegistryKey($key)
+ {
+ $this->_registryKey = (string) $key;
+ return $this;
+ }
+
+ /**
+ * Set clearRequestParams flag
+ *
+ * @param bool $clearRequestParams
+ * @return Zend_Controller_Plugin_ActionStack
+ */
+ public function setClearRequestParams($clearRequestParams)
+ {
+ $this->_clearRequestParams = (bool) $clearRequestParams;
+ return $this;
+ }
+
+ /**
+ * Retrieve clearRequestParams flag
+ *
+ * @return bool
+ */
+ public function getClearRequestParams()
+ {
+ return $this->_clearRequestParams;
+ }
+
+ /**
+ * Retrieve action stack
+ *
+ * @return array
+ */
+ public function getStack()
+ {
+ $registry = $this->getRegistry();
+ $stack = $registry[$this->getRegistryKey()];
+ return $stack;
+ }
+
+ /**
+ * Save stack to registry
+ *
+ * @param array $stack
+ * @return Zend_Controller_Plugin_ActionStack
+ */
+ protected function _saveStack(array $stack)
+ {
+ $registry = $this->getRegistry();
+ $registry[$this->getRegistryKey()] = $stack;
+ return $this;
+ }
+
+ /**
+ * Push an item onto the stack
+ *
+ * @param Zend_Controller_Request_Abstract $next
+ * @return Zend_Controller_Plugin_ActionStack
+ */
+ public function pushStack(Zend_Controller_Request_Abstract $next)
+ {
+ $stack = $this->getStack();
+ array_push($stack, $next);
+ return $this->_saveStack($stack);
+ }
+
+ /**
+ * Pop an item off the action stack
+ *
+ * @return false|Zend_Controller_Request_Abstract
+ */
+ public function popStack()
+ {
+ $stack = $this->getStack();
+ if (0 == count($stack)) {
+ return false;
+ }
+
+ $next = array_pop($stack);
+ $this->_saveStack($stack);
+
+ if (!$next instanceof Zend_Controller_Request_Abstract) {
+ throw new Zend_Controller_Exception('ArrayStack should only contain request objects');
+ }
+ $action = $next->getActionName();
+ if (empty($action)) {
+ return $this->popStack($stack);
+ }
+
+ $request = $this->getRequest();
+ $controller = $next->getControllerName();
+ if (empty($controller)) {
+ $next->setControllerName($request->getControllerName());
+ }
+
+ $module = $next->getModuleName();
+ if (empty($module)) {
+ $next->setModuleName($request->getModuleName());
+ }
+
+ return $next;
+ }
+
+ /**
+ * postDispatch() plugin hook -- check for actions in stack, and dispatch if any found
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return void
+ */
+ public function postDispatch(Zend_Controller_Request_Abstract $request)
+ {
+ // Don't move on to next request if this is already an attempt to
+ // forward
+ if (!$request->isDispatched()) {
+ return;
+ }
+
+ $this->setRequest($request);
+ $stack = $this->getStack();
+ if (empty($stack)) {
+ return;
+ }
+ $next = $this->popStack();
+ if (!$next) {
+ return;
+ }
+
+ $this->forward($next);
+ }
+
+ /**
+ * Forward request with next action
+ *
+ * @param array $next
+ * @return void
+ */
+ public function forward(Zend_Controller_Request_Abstract $next)
+ {
+ $request = $this->getRequest();
+ if ($this->getClearRequestParams()) {
+ $request->clearParams();
+ }
+
+ $request->setModuleName($next->getModuleName())
+ ->setControllerName($next->getControllerName())
+ ->setActionName($next->getActionName())
+ ->setParams($next->getParams())
+ ->setDispatched(false);
+ }
+}
diff --git a/library/vendor/Zend/Controller/Plugin/Broker.php b/library/vendor/Zend/Controller/Plugin/Broker.php
new file mode 100644
index 0000000..eec9809
--- /dev/null
+++ b/library/vendor/Zend/Controller/Plugin/Broker.php
@@ -0,0 +1,361 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Plugins
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Controller_Plugin_Abstract */
+
+/**
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Plugins
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Plugin_Broker extends Zend_Controller_Plugin_Abstract
+{
+
+ /**
+ * Array of instance of objects extending Zend_Controller_Plugin_Abstract
+ *
+ * @var array
+ */
+ protected $_plugins = array();
+
+
+ /**
+ * Register a plugin.
+ *
+ * @param Zend_Controller_Plugin_Abstract $plugin
+ * @param int $stackIndex
+ * @return Zend_Controller_Plugin_Broker
+ */
+ public function registerPlugin(Zend_Controller_Plugin_Abstract $plugin, $stackIndex = null)
+ {
+ if (false !== array_search($plugin, $this->_plugins, true)) {
+ throw new Zend_Controller_Exception('Plugin already registered');
+ }
+
+ $stackIndex = (int) $stackIndex;
+
+ if ($stackIndex) {
+ if (isset($this->_plugins[$stackIndex])) {
+ throw new Zend_Controller_Exception('Plugin with stackIndex "' . $stackIndex . '" already registered');
+ }
+ $this->_plugins[$stackIndex] = $plugin;
+ } else {
+ $stackIndex = count($this->_plugins);
+ while (isset($this->_plugins[$stackIndex])) {
+ ++$stackIndex;
+ }
+ $this->_plugins[$stackIndex] = $plugin;
+ }
+
+ $request = $this->getRequest();
+ if ($request) {
+ $this->_plugins[$stackIndex]->setRequest($request);
+ }
+ $response = $this->getResponse();
+ if ($response) {
+ $this->_plugins[$stackIndex]->setResponse($response);
+ }
+
+ ksort($this->_plugins);
+
+ return $this;
+ }
+
+ /**
+ * Unregister a plugin.
+ *
+ * @param string|Zend_Controller_Plugin_Abstract $plugin Plugin object or class name
+ * @return Zend_Controller_Plugin_Broker
+ */
+ public function unregisterPlugin($plugin)
+ {
+ if ($plugin instanceof Zend_Controller_Plugin_Abstract) {
+ // Given a plugin object, find it in the array
+ $key = array_search($plugin, $this->_plugins, true);
+ if (false === $key) {
+ throw new Zend_Controller_Exception('Plugin never registered.');
+ }
+ unset($this->_plugins[$key]);
+ } elseif (is_string($plugin)) {
+ // Given a plugin class, find all plugins of that class and unset them
+ foreach ($this->_plugins as $key => $_plugin) {
+ $type = get_class($_plugin);
+ if ($plugin == $type) {
+ unset($this->_plugins[$key]);
+ }
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Is a plugin of a particular class registered?
+ *
+ * @param string $class
+ * @return bool
+ */
+ public function hasPlugin($class)
+ {
+ foreach ($this->_plugins as $plugin) {
+ $type = get_class($plugin);
+ if ($class == $type) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Retrieve a plugin or plugins by class
+ *
+ * @param string $class Class name of plugin(s) desired
+ * @return false|Zend_Controller_Plugin_Abstract|array Returns false if none found, plugin if only one found, and array of plugins if multiple plugins of same class found
+ */
+ public function getPlugin($class)
+ {
+ $found = array();
+ foreach ($this->_plugins as $plugin) {
+ $type = get_class($plugin);
+ if ($class == $type) {
+ $found[] = $plugin;
+ }
+ }
+
+ switch (count($found)) {
+ case 0:
+ return false;
+ case 1:
+ return $found[0];
+ default:
+ return $found;
+ }
+ }
+
+ /**
+ * Retrieve all plugins
+ *
+ * @return array
+ */
+ public function getPlugins()
+ {
+ return $this->_plugins;
+ }
+
+ /**
+ * Set request object, and register with each plugin
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return Zend_Controller_Plugin_Broker
+ */
+ public function setRequest(Zend_Controller_Request_Abstract $request)
+ {
+ $this->_request = $request;
+
+ foreach ($this->_plugins as $plugin) {
+ $plugin->setRequest($request);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get request object
+ *
+ * @return Zend_Controller_Request_Abstract $request
+ */
+ public function getRequest()
+ {
+ return $this->_request;
+ }
+
+ /**
+ * Set response object
+ *
+ * @param Zend_Controller_Response_Abstract $response
+ * @return Zend_Controller_Plugin_Broker
+ */
+ public function setResponse(Zend_Controller_Response_Abstract $response)
+ {
+ $this->_response = $response;
+
+ foreach ($this->_plugins as $plugin) {
+ $plugin->setResponse($response);
+ }
+
+
+ return $this;
+ }
+
+ /**
+ * Get response object
+ *
+ * @return Zend_Controller_Response_Abstract $response
+ */
+ public function getResponse()
+ {
+ return $this->_response;
+ }
+
+
+ /**
+ * Called before Zend_Controller_Front begins evaluating the
+ * request against its routes.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return void
+ */
+ public function routeStartup(Zend_Controller_Request_Abstract $request)
+ {
+ foreach ($this->_plugins as $plugin) {
+ try {
+ $plugin->routeStartup($request);
+ } catch (Exception $e) {
+ if (Zend_Controller_Front::getInstance()->throwExceptions()) {
+ throw new Zend_Controller_Exception($e->getMessage() . $e->getTraceAsString(), $e->getCode(), $e);
+ } else {
+ $this->getResponse()->setException($e);
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Called before Zend_Controller_Front exits its iterations over
+ * the route set.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return void
+ */
+ public function routeShutdown(Zend_Controller_Request_Abstract $request)
+ {
+ foreach ($this->_plugins as $plugin) {
+ try {
+ $plugin->routeShutdown($request);
+ } catch (Exception $e) {
+ if (Zend_Controller_Front::getInstance()->throwExceptions()) {
+ throw new Zend_Controller_Exception($e->getMessage() . $e->getTraceAsString(), $e->getCode(), $e);
+ } else {
+ $this->getResponse()->setException($e);
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Called before Zend_Controller_Front enters its dispatch loop.
+ *
+ * During the dispatch loop, Zend_Controller_Front keeps a
+ * Zend_Controller_Request_Abstract object, and uses
+ * Zend_Controller_Dispatcher to dispatch the
+ * Zend_Controller_Request_Abstract object to controllers/actions.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return void
+ */
+ public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
+ {
+ foreach ($this->_plugins as $plugin) {
+ try {
+ $plugin->dispatchLoopStartup($request);
+ } catch (Exception $e) {
+ if (Zend_Controller_Front::getInstance()->throwExceptions()) {
+ throw new Zend_Controller_Exception($e->getMessage() . $e->getTraceAsString(), $e->getCode(), $e);
+ } else {
+ $this->getResponse()->setException($e);
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Called before an action is dispatched by Zend_Controller_Dispatcher.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return void
+ */
+ public function preDispatch(Zend_Controller_Request_Abstract $request)
+ {
+ foreach ($this->_plugins as $plugin) {
+ try {
+ $plugin->preDispatch($request);
+ } catch (Exception $e) {
+ if (Zend_Controller_Front::getInstance()->throwExceptions()) {
+ throw new Zend_Controller_Exception($e->getMessage() . $e->getTraceAsString(), $e->getCode(), $e);
+ } else {
+ $this->getResponse()->setException($e);
+ // skip rendering of normal dispatch give the error handler a try
+ $this->getRequest()->setDispatched(false);
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Called after an action is dispatched by Zend_Controller_Dispatcher.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return void
+ */
+ public function postDispatch(Zend_Controller_Request_Abstract $request)
+ {
+ foreach ($this->_plugins as $plugin) {
+ try {
+ $plugin->postDispatch($request);
+ } catch (Exception $e) {
+ if (Zend_Controller_Front::getInstance()->throwExceptions()) {
+ throw new Zend_Controller_Exception($e->getMessage() . $e->getTraceAsString(), $e->getCode(), $e);
+ } else {
+ $this->getResponse()->setException($e);
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Called before Zend_Controller_Front exits its dispatch loop.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return void
+ */
+ public function dispatchLoopShutdown()
+ {
+ foreach ($this->_plugins as $plugin) {
+ try {
+ $plugin->dispatchLoopShutdown();
+ } catch (Exception $e) {
+ if (Zend_Controller_Front::getInstance()->throwExceptions()) {
+ throw new Zend_Controller_Exception($e->getMessage() . $e->getTraceAsString(), $e->getCode(), $e);
+ } else {
+ $this->getResponse()->setException($e);
+ }
+ }
+ }
+ }
+}
diff --git a/library/vendor/Zend/Controller/Plugin/ErrorHandler.php b/library/vendor/Zend/Controller/Plugin/ErrorHandler.php
new file mode 100644
index 0000000..cd0e4f7
--- /dev/null
+++ b/library/vendor/Zend/Controller/Plugin/ErrorHandler.php
@@ -0,0 +1,299 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Plugins
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Controller_Plugin_Abstract */
+
+/**
+ * Handle exceptions that bubble up based on missing controllers, actions, or
+ * application errors, and forward to an error handler.
+ *
+ * @uses Zend_Controller_Plugin_Abstract
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Plugins
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Controller_Plugin_ErrorHandler extends Zend_Controller_Plugin_Abstract
+{
+ /**
+ * Const - No controller exception; controller does not exist
+ */
+ const EXCEPTION_NO_CONTROLLER = 'EXCEPTION_NO_CONTROLLER';
+
+ /**
+ * Const - No action exception; controller exists, but action does not
+ */
+ const EXCEPTION_NO_ACTION = 'EXCEPTION_NO_ACTION';
+
+ /**
+ * Const - No route exception; no routing was possible
+ */
+ const EXCEPTION_NO_ROUTE = 'EXCEPTION_NO_ROUTE';
+
+ /**
+ * Const - Other Exception; exceptions thrown by application controllers
+ */
+ const EXCEPTION_OTHER = 'EXCEPTION_OTHER';
+
+ /**
+ * Module to use for errors; defaults to default module in dispatcher
+ * @var string
+ */
+ protected $_errorModule;
+
+ /**
+ * Controller to use for errors; defaults to 'error'
+ * @var string
+ */
+ protected $_errorController = 'error';
+
+ /**
+ * Action to use for errors; defaults to 'error'
+ * @var string
+ */
+ protected $_errorAction = 'error';
+
+ /**
+ * Flag; are we already inside the error handler loop?
+ * @var bool
+ */
+ protected $_isInsideErrorHandlerLoop = false;
+
+ /**
+ * Exception count logged at first invocation of plugin
+ * @var int
+ */
+ protected $_exceptionCountAtFirstEncounter = 0;
+
+ /**
+ * Constructor
+ *
+ * Options may include:
+ * - module
+ * - controller
+ * - action
+ *
+ * @param Array $options
+ * @return void
+ */
+ public function __construct(Array $options = array())
+ {
+ $this->setErrorHandler($options);
+ }
+
+ /**
+ * setErrorHandler() - setup the error handling options
+ *
+ * @param array $options
+ * @return Zend_Controller_Plugin_ErrorHandler
+ */
+ public function setErrorHandler(Array $options = array())
+ {
+ if (isset($options['module'])) {
+ $this->setErrorHandlerModule($options['module']);
+ }
+ if (isset($options['controller'])) {
+ $this->setErrorHandlerController($options['controller']);
+ }
+ if (isset($options['action'])) {
+ $this->setErrorHandlerAction($options['action']);
+ }
+ return $this;
+ }
+
+ /**
+ * Set the module name for the error handler
+ *
+ * @param string $module
+ * @return Zend_Controller_Plugin_ErrorHandler
+ */
+ public function setErrorHandlerModule($module)
+ {
+ $this->_errorModule = (string) $module;
+ return $this;
+ }
+
+ /**
+ * Retrieve the current error handler module
+ *
+ * @return string
+ */
+ public function getErrorHandlerModule()
+ {
+ if (null === $this->_errorModule) {
+ $this->_errorModule = Zend_Controller_Front::getInstance()->getDispatcher()->getDefaultModule();
+ }
+ return $this->_errorModule;
+ }
+
+ /**
+ * Set the controller name for the error handler
+ *
+ * @param string $controller
+ * @return Zend_Controller_Plugin_ErrorHandler
+ */
+ public function setErrorHandlerController($controller)
+ {
+ $this->_errorController = (string) $controller;
+ return $this;
+ }
+
+ /**
+ * Retrieve the current error handler controller
+ *
+ * @return string
+ */
+ public function getErrorHandlerController()
+ {
+ return $this->_errorController;
+ }
+
+ /**
+ * Set the action name for the error handler
+ *
+ * @param string $action
+ * @return Zend_Controller_Plugin_ErrorHandler
+ */
+ public function setErrorHandlerAction($action)
+ {
+ $this->_errorAction = (string) $action;
+ return $this;
+ }
+
+ /**
+ * Retrieve the current error handler action
+ *
+ * @return string
+ */
+ public function getErrorHandlerAction()
+ {
+ return $this->_errorAction;
+ }
+
+ /**
+ * Route shutdown hook -- Ccheck for router exceptions
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ */
+ public function routeShutdown(Zend_Controller_Request_Abstract $request)
+ {
+ $this->_handleError($request);
+ }
+
+ /**
+ * Pre dispatch hook -- check for exceptions and dispatch error handler if
+ * necessary
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ */
+ public function preDispatch(Zend_Controller_Request_Abstract $request)
+ {
+ $this->_handleError($request);
+ }
+
+ /**
+ * Post dispatch hook -- check for exceptions and dispatch error handler if
+ * necessary
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ */
+ public function postDispatch(Zend_Controller_Request_Abstract $request)
+ {
+ $this->_handleError($request);
+ }
+
+ /**
+ * Handle errors and exceptions
+ *
+ * If the 'noErrorHandler' front controller flag has been set,
+ * returns early.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return void
+ */
+ protected function _handleError(Zend_Controller_Request_Abstract $request)
+ {
+ $frontController = Zend_Controller_Front::getInstance();
+ if ($frontController->getParam('noErrorHandler')) {
+ return;
+ }
+
+ $response = $this->getResponse();
+
+ if ($this->_isInsideErrorHandlerLoop) {
+ $exceptions = $response->getException();
+ if (count($exceptions) > $this->_exceptionCountAtFirstEncounter) {
+ // Exception thrown by error handler; tell the front controller to throw it
+ $frontController->throwExceptions(true);
+ throw array_pop($exceptions);
+ }
+ }
+
+ // check for an exception AND allow the error handler controller the option to forward
+ if (($response->isException()) && (!$this->_isInsideErrorHandlerLoop)) {
+ $this->_isInsideErrorHandlerLoop = true;
+
+ // Get exception information
+ $error = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS);
+ $exceptions = $response->getException();
+ $exception = $exceptions[0];
+ $exceptionType = get_class($exception);
+ $error->exception = $exception;
+ switch ($exceptionType) {
+ case 'Zend_Controller_Router_Exception':
+ if (404 == $exception->getCode()) {
+ $error->type = self::EXCEPTION_NO_ROUTE;
+ } else {
+ $error->type = self::EXCEPTION_OTHER;
+ }
+ break;
+ case 'Zend_Controller_Dispatcher_Exception':
+ $error->type = self::EXCEPTION_NO_CONTROLLER;
+ break;
+ case 'Zend_Controller_Action_Exception':
+ if (404 == $exception->getCode()) {
+ $error->type = self::EXCEPTION_NO_ACTION;
+ } else {
+ $error->type = self::EXCEPTION_OTHER;
+ }
+ break;
+ default:
+ $error->type = self::EXCEPTION_OTHER;
+ break;
+ }
+
+ // Keep a copy of the original request
+ $error->request = clone $request;
+
+ // get a count of the number of exceptions encountered
+ $this->_exceptionCountAtFirstEncounter = count($exceptions);
+
+ // Forward to the error handler
+ $request->setParam('error_handler', $error)
+ ->setModuleName($this->getErrorHandlerModule())
+ ->setControllerName($this->getErrorHandlerController())
+ ->setActionName($this->getErrorHandlerAction())
+ ->setDispatched(false);
+ }
+ }
+}
diff --git a/library/vendor/Zend/Controller/Plugin/PutHandler.php b/library/vendor/Zend/Controller/Plugin/PutHandler.php
new file mode 100644
index 0000000..3bf7a67
--- /dev/null
+++ b/library/vendor/Zend/Controller/Plugin/PutHandler.php
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Plugin
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Controller_Plugin_Abstract
+ */
+
+/**
+ * @see Zend_Controller_Request_Http
+ */
+
+/**
+ * Plugin to digest PUT request body and make params available just like POST
+ *
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Plugin
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Plugin_PutHandler extends Zend_Controller_Plugin_Abstract
+{
+ /**
+ * Before dispatching, digest PUT request body and set params
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ */
+ public function preDispatch(Zend_Controller_Request_Abstract $request)
+ {
+ if (!$request instanceof Zend_Controller_Request_Http) {
+ return;
+ }
+
+ if ($this->_request->isPut()) {
+ $putParams = array();
+ parse_str($this->_request->getRawBody(), $putParams);
+ $request->setParams($putParams);
+ }
+ }
+}
diff --git a/library/vendor/Zend/Controller/Request/Abstract.php b/library/vendor/Zend/Controller/Request/Abstract.php
new file mode 100644
index 0000000..d57238f
--- /dev/null
+++ b/library/vendor/Zend/Controller/Request/Abstract.php
@@ -0,0 +1,356 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Controller
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Controller_Request_Abstract
+{
+ /**
+ * Has the action been dispatched?
+ * @var boolean
+ */
+ protected $_dispatched = false;
+
+ /**
+ * Module
+ * @var string
+ */
+ protected $_module;
+
+ /**
+ * Module key for retrieving module from params
+ * @var string
+ */
+ protected $_moduleKey = 'module';
+
+ /**
+ * Controller
+ * @var string
+ */
+ protected $_controller;
+
+ /**
+ * Controller key for retrieving controller from params
+ * @var string
+ */
+ protected $_controllerKey = 'controller';
+
+ /**
+ * Action
+ * @var string
+ */
+ protected $_action;
+
+ /**
+ * Action key for retrieving action from params
+ * @var string
+ */
+ protected $_actionKey = 'action';
+
+ /**
+ * Request parameters
+ * @var array
+ */
+ protected $_params = array();
+
+ /**
+ * Retrieve the module name
+ *
+ * @return string
+ */
+ public function getModuleName()
+ {
+ if (null === $this->_module) {
+ $this->_module = $this->getParam($this->getModuleKey());
+ }
+
+ return $this->_module;
+ }
+
+ /**
+ * Set the module name to use
+ *
+ * @param string $value
+ * @return Zend_Controller_Request_Abstract
+ */
+ public function setModuleName($value)
+ {
+ $this->_module = $value;
+ return $this;
+ }
+
+ /**
+ * Retrieve the controller name
+ *
+ * @return string
+ */
+ public function getControllerName()
+ {
+ if (null === $this->_controller) {
+ $this->_controller = $this->getParam($this->getControllerKey());
+ }
+
+ return $this->_controller;
+ }
+
+ /**
+ * Set the controller name to use
+ *
+ * @param string $value
+ * @return Zend_Controller_Request_Abstract
+ */
+ public function setControllerName($value)
+ {
+ $this->_controller = $value;
+ return $this;
+ }
+
+ /**
+ * Retrieve the action name
+ *
+ * @return string
+ */
+ public function getActionName()
+ {
+ if (null === $this->_action) {
+ $this->_action = $this->getParam($this->getActionKey());
+ }
+
+ return $this->_action;
+ }
+
+ /**
+ * Set the action name
+ *
+ * @param string $value
+ * @return Zend_Controller_Request_Abstract
+ */
+ public function setActionName($value)
+ {
+ $this->_action = $value;
+ /**
+ * @see ZF-3465
+ */
+ if (null === $value) {
+ $this->setParam($this->getActionKey(), $value);
+ }
+ return $this;
+ }
+
+ /**
+ * Retrieve the module key
+ *
+ * @return string
+ */
+ public function getModuleKey()
+ {
+ return $this->_moduleKey;
+ }
+
+ /**
+ * Set the module key
+ *
+ * @param string $key
+ * @return Zend_Controller_Request_Abstract
+ */
+ public function setModuleKey($key)
+ {
+ $this->_moduleKey = (string) $key;
+ return $this;
+ }
+
+ /**
+ * Retrieve the controller key
+ *
+ * @return string
+ */
+ public function getControllerKey()
+ {
+ return $this->_controllerKey;
+ }
+
+ /**
+ * Set the controller key
+ *
+ * @param string $key
+ * @return Zend_Controller_Request_Abstract
+ */
+ public function setControllerKey($key)
+ {
+ $this->_controllerKey = (string) $key;
+ return $this;
+ }
+
+ /**
+ * Retrieve the action key
+ *
+ * @return string
+ */
+ public function getActionKey()
+ {
+ return $this->_actionKey;
+ }
+
+ /**
+ * Set the action key
+ *
+ * @param string $key
+ * @return Zend_Controller_Request_Abstract
+ */
+ public function setActionKey($key)
+ {
+ $this->_actionKey = (string) $key;
+ return $this;
+ }
+
+ /**
+ * Get an action parameter
+ *
+ * @param string $key
+ * @param mixed $default Default value to use if key not found
+ * @return mixed
+ */
+ public function getParam($key, $default = null)
+ {
+ $key = (string) $key;
+ if (isset($this->_params[$key])) {
+ return $this->_params[$key];
+ }
+
+ return $default;
+ }
+
+ /**
+ * Retrieve only user params (i.e, any param specific to the object and not the environment)
+ *
+ * @return array
+ */
+ public function getUserParams()
+ {
+ return $this->_params;
+ }
+
+ /**
+ * Retrieve a single user param (i.e, a param specific to the object and not the environment)
+ *
+ * @param string $key
+ * @param string $default Default value to use if key not found
+ * @return mixed
+ */
+ public function getUserParam($key, $default = null)
+ {
+ if (isset($this->_params[$key])) {
+ return $this->_params[$key];
+ }
+
+ return $default;
+ }
+
+ /**
+ * Set an action parameter
+ *
+ * A $value of null will unset the $key if it exists
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return Zend_Controller_Request_Abstract
+ */
+ public function setParam($key, $value)
+ {
+ $key = (string) $key;
+
+ if ((null === $value) && isset($this->_params[$key])) {
+ unset($this->_params[$key]);
+ } elseif (null !== $value) {
+ $this->_params[$key] = $value;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get all action parameters
+ *
+ * @return array
+ */
+ public function getParams()
+ {
+ return $this->_params;
+ }
+
+ /**
+ * Set action parameters en masse; does not overwrite
+ *
+ * Null values will unset the associated key.
+ *
+ * @param array $array
+ * @return Zend_Controller_Request_Abstract
+ */
+ public function setParams(array $array)
+ {
+ $this->_params = $this->_params + (array) $array;
+
+ foreach ($array as $key => $value) {
+ if (null === $value) {
+ unset($this->_params[$key]);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Unset all user parameters
+ *
+ * @return Zend_Controller_Request_Abstract
+ */
+ public function clearParams()
+ {
+ $this->_params = array();
+ return $this;
+ }
+
+ /**
+ * Set flag indicating whether or not request has been dispatched
+ *
+ * @param boolean $flag
+ * @return Zend_Controller_Request_Abstract
+ */
+ public function setDispatched($flag = true)
+ {
+ $this->_dispatched = $flag ? true : false;
+ return $this;
+ }
+
+ /**
+ * Determine if the request has been dispatched
+ *
+ * @return boolean
+ */
+ public function isDispatched()
+ {
+ return $this->_dispatched;
+ }
+}
diff --git a/library/vendor/Zend/Controller/Request/Apache404.php b/library/vendor/Zend/Controller/Request/Apache404.php
new file mode 100644
index 0000000..87d1d83
--- /dev/null
+++ b/library/vendor/Zend/Controller/Request/Apache404.php
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Controller_Request_Http */
+
+/** Zend_Uri */
+
+/**
+ * Zend_Controller_Request_Apache404
+ *
+ * HTTP request object for use with Zend_Controller family. Extends basic HTTP
+ * request object to allow for two edge cases when using Apache:
+ * - Using Apache's 404 handler instead of mod_rewrite to direct requests
+ * - Using the PT flag in rewrite rules
+ *
+ * In each case, the URL to check against is found in REDIRECT_URL, not
+ * REQUEST_URI.
+ *
+ * @uses Zend_Controller_Request_Http
+ * @package Zend_Controller
+ * @subpackage Request
+ */
+class Zend_Controller_Request_Apache404 extends Zend_Controller_Request_Http
+{
+ public function setRequestUri($requestUri = null)
+ {
+ $parseUriGetVars = false;
+ if ($requestUri === null) {
+ if (isset($_SERVER['HTTP_X_REWRITE_URL'])) { // check this first so IIS will catch
+ $requestUri = $_SERVER['HTTP_X_REWRITE_URL'];
+ } elseif (isset($_SERVER['REDIRECT_URL'])) { // Check if using mod_rewrite
+ $requestUri = $_SERVER['REDIRECT_URL'];
+ if (isset($_SERVER['REDIRECT_QUERY_STRING'])) {
+ $parseUriGetVars = $_SERVER['REDIRECT_QUERY_STRING'];
+ }
+ } elseif (isset($_SERVER['REQUEST_URI'])) {
+ $requestUri = $_SERVER['REQUEST_URI'];
+ } elseif (isset($_SERVER['ORIG_PATH_INFO'])) { // IIS 5.0, PHP as CGI
+ $requestUri = $_SERVER['ORIG_PATH_INFO'];
+ if (!empty($_SERVER['QUERY_STRING'])) {
+ $requestUri .= '?' . $_SERVER['QUERY_STRING'];
+ }
+ } else {
+ return $this;
+ }
+ } elseif (!is_string($requestUri)) {
+ return $this;
+ } else {
+ if (false !== ($pos = strpos($requestUri, '?'))) {
+ $parseUriGetVars = substr($requestUri, $pos + 1);
+ }
+ }
+
+ if ($parseUriGetVars) {
+ // Set GET items, if available
+ parse_str($parseUriGetVars, $_GET);
+ }
+
+ $this->_requestUri = $requestUri;
+ return $this;
+ }
+}
diff --git a/library/vendor/Zend/Controller/Request/Exception.php b/library/vendor/Zend/Controller/Request/Exception.php
new file mode 100644
index 0000000..89e8856
--- /dev/null
+++ b/library/vendor/Zend/Controller/Request/Exception.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Request
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/** Zend_Controller_Exception */
+
+
+/**
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Request
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Request_Exception extends Zend_Controller_Exception
+{}
+
diff --git a/library/vendor/Zend/Controller/Request/Http.php b/library/vendor/Zend/Controller/Request/Http.php
new file mode 100644
index 0000000..de61e36
--- /dev/null
+++ b/library/vendor/Zend/Controller/Request/Http.php
@@ -0,0 +1,1087 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** @see Zend_Controller_Request_Abstract */
+
+/** @see Zend_Uri */
+
+/**
+ * Zend_Controller_Request_Http
+ *
+ * HTTP request object for use with Zend_Controller family.
+ *
+ * @uses Zend_Controller_Request_Abstract
+ * @package Zend_Controller
+ * @subpackage Request
+ */
+class Zend_Controller_Request_Http extends Zend_Controller_Request_Abstract
+{
+ /**
+ * Scheme for http
+ *
+ */
+ const SCHEME_HTTP = 'http';
+
+ /**
+ * Scheme for https
+ *
+ */
+ const SCHEME_HTTPS = 'https';
+
+ /**
+ * Allowed parameter sources
+ * @var array
+ */
+ protected $_paramSources = array('_GET', '_POST');
+
+ /**
+ * REQUEST_URI
+ * @var string;
+ */
+ protected $_requestUri;
+
+ /**
+ * Base URL of request
+ * @var string
+ */
+ protected $_baseUrl = null;
+
+ /**
+ * Base path of request
+ * @var string
+ */
+ protected $_basePath = null;
+
+ /**
+ * PATH_INFO
+ * @var string
+ */
+ protected $_pathInfo = '';
+
+ /**
+ * Instance parameters
+ * @var array
+ */
+ protected $_params = array();
+
+ /**
+ * Raw request body
+ * @var string|false
+ */
+ protected $_rawBody;
+
+ /**
+ * Alias keys for request parameters
+ * @var array
+ */
+ protected $_aliases = array();
+
+ /**
+ * Constructor
+ *
+ * If a $uri is passed, the object will attempt to populate itself using
+ * that information.
+ *
+ * @param string|Zend_Uri $uri
+ * @return void
+ * @throws Zend_Controller_Request_Exception when invalid URI passed
+ */
+ public function __construct($uri = null)
+ {
+ if (null !== $uri) {
+ if (!$uri instanceof Zend_Uri) {
+ $uri = Zend_Uri::factory($uri);
+ }
+ if ($uri->valid()) {
+ $path = $uri->getPath();
+ $query = $uri->getQuery();
+ if (!empty($query)) {
+ $path .= '?' . $query;
+ }
+
+ $this->setRequestUri($path);
+ } else {
+ throw new Zend_Controller_Request_Exception('Invalid URI provided to constructor');
+ }
+ } else {
+ $this->setRequestUri();
+ }
+ }
+
+ /**
+ * Access values contained in the superglobals as public members
+ * Order of precedence: 1. GET, 2. POST, 3. COOKIE, 4. SERVER, 5. ENV
+ *
+ * @see http://msdn.microsoft.com/en-us/library/system.web.httprequest.item.aspx
+ * @param string $key
+ * @return mixed
+ */
+ public function __get($key)
+ {
+ switch (true) {
+ case isset($this->_params[$key]):
+ return $this->_params[$key];
+ case isset($_GET[$key]):
+ return $_GET[$key];
+ case isset($_POST[$key]):
+ return $_POST[$key];
+ case isset($_COOKIE[$key]):
+ return $_COOKIE[$key];
+ case ($key == 'REQUEST_URI'):
+ return $this->getRequestUri();
+ case ($key == 'PATH_INFO'):
+ return $this->getPathInfo();
+ case isset($_SERVER[$key]):
+ return $_SERVER[$key];
+ case isset($_ENV[$key]):
+ return $_ENV[$key];
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Alias to __get
+ *
+ * @param string $key
+ * @return mixed
+ */
+ public function get($key)
+ {
+ return $this->__get($key);
+ }
+
+ /**
+ * Set values
+ *
+ * In order to follow {@link __get()}, which operates on a number of
+ * superglobals, setting values through overloading is not allowed and will
+ * raise an exception. Use setParam() instead.
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return void
+ * @throws Zend_Controller_Request_Exception
+ */
+ public function __set($key, $value)
+ {
+ throw new Zend_Controller_Request_Exception('Setting values in superglobals not allowed; please use setParam()');
+ }
+
+ /**
+ * Alias to __set()
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return void
+ */
+ public function set($key, $value)
+ {
+ return $this->__set($key, $value);
+ }
+
+ /**
+ * Check to see if a property is set
+ *
+ * @param string $key
+ * @return boolean
+ */
+ public function __isset($key)
+ {
+ switch (true) {
+ case isset($this->_params[$key]):
+ return true;
+ case isset($_GET[$key]):
+ return true;
+ case isset($_POST[$key]):
+ return true;
+ case isset($_COOKIE[$key]):
+ return true;
+ case isset($_SERVER[$key]):
+ return true;
+ case isset($_ENV[$key]):
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ /**
+ * Alias to __isset()
+ *
+ * @param string $key
+ * @return boolean
+ */
+ public function has($key)
+ {
+ return $this->__isset($key);
+ }
+
+ /**
+ * Set GET values
+ *
+ * @param string|array $spec
+ * @param null|mixed $value
+ * @return Zend_Controller_Request_Http
+ */
+ public function setQuery($spec, $value = null)
+ {
+ if ((null === $value) && !is_array($spec)) {
+ throw new Zend_Controller_Exception('Invalid value passed to setQuery(); must be either array of values or key/value pair');
+ }
+ if ((null === $value) && is_array($spec)) {
+ foreach ($spec as $key => $value) {
+ $this->setQuery($key, $value);
+ }
+ return $this;
+ }
+ $_GET[(string) $spec] = $value;
+ return $this;
+ }
+
+ /**
+ * Retrieve a member of the $_GET superglobal
+ *
+ * If no $key is passed, returns the entire $_GET array.
+ *
+ * @todo How to retrieve from nested arrays
+ * @param string $key
+ * @param mixed $default Default value to use if key not found
+ * @return mixed Returns null if key does not exist
+ */
+ public function getQuery($key = null, $default = null)
+ {
+ if (null === $key) {
+ return $_GET;
+ }
+
+ return (isset($_GET[$key])) ? $_GET[$key] : $default;
+ }
+
+ /**
+ * Set POST values
+ *
+ * @param string|array $spec
+ * @param null|mixed $value
+ * @return Zend_Controller_Request_Http
+ */
+ public function setPost($spec, $value = null)
+ {
+ if ((null === $value) && !is_array($spec)) {
+ throw new Zend_Controller_Exception('Invalid value passed to setPost(); must be either array of values or key/value pair');
+ }
+ if ((null === $value) && is_array($spec)) {
+ foreach ($spec as $key => $value) {
+ $this->setPost($key, $value);
+ }
+ return $this;
+ }
+ $_POST[(string) $spec] = $value;
+ return $this;
+ }
+
+ /**
+ * Retrieve a member of the $_POST superglobal
+ *
+ * If no $key is passed, returns the entire $_POST array.
+ *
+ * @todo How to retrieve from nested arrays
+ * @param string $key
+ * @param mixed $default Default value to use if key not found
+ * @return mixed Returns null if key does not exist
+ */
+ public function getPost($key = null, $default = null)
+ {
+ if (null === $key) {
+ return $_POST;
+ }
+
+ return (isset($_POST[$key])) ? $_POST[$key] : $default;
+ }
+
+ /**
+ * Retrieve a member of the $_COOKIE superglobal
+ *
+ * If no $key is passed, returns the entire $_COOKIE array.
+ *
+ * @todo How to retrieve from nested arrays
+ * @param string $key
+ * @param mixed $default Default value to use if key not found
+ * @return mixed Returns null if key does not exist
+ */
+ public function getCookie($key = null, $default = null)
+ {
+ if (null === $key) {
+ return $_COOKIE;
+ }
+
+ return (isset($_COOKIE[$key])) ? $_COOKIE[$key] : $default;
+ }
+
+ /**
+ * Retrieve a member of the $_SERVER superglobal
+ *
+ * If no $key is passed, returns the entire $_SERVER array.
+ *
+ * @param string $key
+ * @param mixed $default Default value to use if key not found
+ * @return mixed Returns null if key does not exist
+ */
+ public function getServer($key = null, $default = null)
+ {
+ if (null === $key) {
+ return $_SERVER;
+ }
+
+ return (isset($_SERVER[$key])) ? $_SERVER[$key] : $default;
+ }
+
+ /**
+ * Retrieve a member of the $_ENV superglobal
+ *
+ * If no $key is passed, returns the entire $_ENV array.
+ *
+ * @param string $key
+ * @param mixed $default Default value to use if key not found
+ * @return mixed Returns null if key does not exist
+ */
+ public function getEnv($key = null, $default = null)
+ {
+ if (null === $key) {
+ return $_ENV;
+ }
+
+ return (isset($_ENV[$key])) ? $_ENV[$key] : $default;
+ }
+
+ /**
+ * Set the REQUEST_URI on which the instance operates
+ *
+ * If no request URI is passed, uses the value in $_SERVER['REQUEST_URI'],
+ * $_SERVER['HTTP_X_REWRITE_URL'], or $_SERVER['ORIG_PATH_INFO'] + $_SERVER['QUERY_STRING'].
+ *
+ * @param string $requestUri
+ * @return Zend_Controller_Request_Http
+ */
+ public function setRequestUri($requestUri = null)
+ {
+ if ($requestUri === null) {
+ if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) {
+ // IIS with Microsoft Rewrite Module
+ $requestUri = $_SERVER['HTTP_X_ORIGINAL_URL'];
+ } elseif (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
+ // IIS with ISAPI_Rewrite
+ $requestUri = $_SERVER['HTTP_X_REWRITE_URL'];
+ } elseif (
+ // IIS7 with URL Rewrite: make sure we get the unencoded url (double slash problem)
+ isset($_SERVER['IIS_WasUrlRewritten'])
+ && $_SERVER['IIS_WasUrlRewritten'] == '1'
+ && isset($_SERVER['UNENCODED_URL'])
+ && $_SERVER['UNENCODED_URL'] != ''
+ ) {
+ $requestUri = $_SERVER['UNENCODED_URL'];
+ } elseif (isset($_SERVER['REQUEST_URI'])) {
+ $requestUri = $_SERVER['REQUEST_URI'];
+ // Http proxy reqs setup request uri with scheme and host [and port] + the url path, only use url path
+ $schemeAndHttpHost = $this->getScheme() . '://' . $this->getHttpHost();
+ if (strpos($requestUri, $schemeAndHttpHost) === 0) {
+ $requestUri = substr($requestUri, strlen($schemeAndHttpHost));
+ }
+ } elseif (isset($_SERVER['ORIG_PATH_INFO'])) { // IIS 5.0, PHP as CGI
+ $requestUri = $_SERVER['ORIG_PATH_INFO'];
+ if (!empty($_SERVER['QUERY_STRING'])) {
+ $requestUri .= '?' . $_SERVER['QUERY_STRING'];
+ }
+ } else {
+ return $this;
+ }
+ } elseif (!is_string($requestUri)) {
+ return $this;
+ } else {
+ // Set GET items, if available
+ if (false !== ($pos = strpos($requestUri, '?'))) {
+ // Get key => value pairs and set $_GET
+ $query = substr($requestUri, $pos + 1);
+ parse_str($query, $vars);
+ $this->setQuery($vars);
+ }
+ }
+
+ $this->_requestUri = $requestUri;
+ return $this;
+ }
+
+ /**
+ * Returns the REQUEST_URI taking into account
+ * platform differences between Apache and IIS
+ *
+ * @return string
+ */
+ public function getRequestUri()
+ {
+ if (empty($this->_requestUri)) {
+ $this->setRequestUri();
+ }
+
+ return $this->_requestUri;
+ }
+
+ /**
+ * Set the base URL of the request; i.e., the segment leading to the script name
+ *
+ * E.g.:
+ * - /admin
+ * - /myapp
+ * - /subdir/index.php
+ *
+ * Do not use the full URI when providing the base. The following are
+ * examples of what not to use:
+ * - http://example.com/admin (should be just /admin)
+ * - http://example.com/subdir/index.php (should be just /subdir/index.php)
+ *
+ * If no $baseUrl is provided, attempts to determine the base URL from the
+ * environment, using SCRIPT_FILENAME, SCRIPT_NAME, PHP_SELF, and
+ * ORIG_SCRIPT_NAME in its determination.
+ *
+ * @param mixed $baseUrl
+ * @return Zend_Controller_Request_Http
+ */
+ public function setBaseUrl($baseUrl = null)
+ {
+ if ((null !== $baseUrl) && !is_string($baseUrl)) {
+ return $this;
+ }
+
+ if ($baseUrl === null) {
+ $filename = (isset($_SERVER['SCRIPT_FILENAME'])) ? basename($_SERVER['SCRIPT_FILENAME']) : '';
+
+ if (isset($_SERVER['SCRIPT_NAME']) && basename($_SERVER['SCRIPT_NAME']) === $filename) {
+ $baseUrl = $_SERVER['SCRIPT_NAME'];
+ } elseif (isset($_SERVER['PHP_SELF']) && basename($_SERVER['PHP_SELF']) === $filename) {
+ $baseUrl = $_SERVER['PHP_SELF'];
+ } elseif (isset($_SERVER['ORIG_SCRIPT_NAME']) && basename($_SERVER['ORIG_SCRIPT_NAME']) === $filename) {
+ $baseUrl = $_SERVER['ORIG_SCRIPT_NAME']; // 1and1 shared hosting compatibility
+ } else {
+ // Backtrack up the script_filename to find the portion matching
+ // php_self
+ $path = isset($_SERVER['PHP_SELF']) ? $_SERVER['PHP_SELF'] : '';
+ $file = isset($_SERVER['SCRIPT_FILENAME']) ? $_SERVER['SCRIPT_FILENAME'] : '';
+ $segs = explode('/', trim($file, '/'));
+ $segs = array_reverse($segs);
+ $index = 0;
+ $last = count($segs);
+ $baseUrl = '';
+ do {
+ $seg = $segs[$index];
+ $baseUrl = '/' . $seg . $baseUrl;
+ ++$index;
+ } while (($last > $index) && (false !== ($pos = strpos($path, $baseUrl))) && (0 != $pos));
+ }
+
+ // Does the baseUrl have anything in common with the request_uri?
+ $requestUri = $this->getRequestUri();
+
+ if (0 === strpos($requestUri, $baseUrl)) {
+ // full $baseUrl matches
+ $this->_baseUrl = $baseUrl;
+ return $this;
+ }
+
+ if (0 === strpos($requestUri, dirname($baseUrl))) {
+ // directory portion of $baseUrl matches
+ $this->_baseUrl = rtrim(dirname($baseUrl), '/');
+ return $this;
+ }
+
+ $truncatedRequestUri = $requestUri;
+ if (($pos = strpos($requestUri, '?')) !== false) {
+ $truncatedRequestUri = substr($requestUri, 0, $pos);
+ }
+
+ $basename = basename($baseUrl);
+ if (empty($basename) || !strpos($truncatedRequestUri, $basename)) {
+ // no match whatsoever; set it blank
+ $this->_baseUrl = '';
+ return $this;
+ }
+
+ // If using mod_rewrite or ISAPI_Rewrite strip the script filename
+ // out of baseUrl. $pos !== 0 makes sure it is not matching a value
+ // from PATH_INFO or QUERY_STRING
+ if ((strlen($requestUri) >= strlen($baseUrl))
+ && ((false !== ($pos = strpos($requestUri, $baseUrl))) && ($pos !== 0)))
+ {
+ $baseUrl = substr($requestUri, 0, $pos + strlen($baseUrl));
+ }
+ }
+
+ $this->_baseUrl = rtrim($baseUrl, '/');
+ return $this;
+ }
+
+ /**
+ * Everything in REQUEST_URI before PATH_INFO
+ * <form action="<?=$baseUrl?>/news/submit" method="POST"/>
+ *
+ * @return string
+ */
+ public function getBaseUrl($raw = false)
+ {
+ if (null === $this->_baseUrl) {
+ $this->setBaseUrl();
+ }
+
+ return (($raw == false) ? urldecode($this->_baseUrl) : $this->_baseUrl);
+ }
+
+ /**
+ * Set the base path for the URL
+ *
+ * @param string|null $basePath
+ * @return Zend_Controller_Request_Http
+ */
+ public function setBasePath($basePath = null)
+ {
+ if ($basePath === null) {
+ $filename = (isset($_SERVER['SCRIPT_FILENAME']))
+ ? basename($_SERVER['SCRIPT_FILENAME'])
+ : '';
+
+ $baseUrl = $this->getBaseUrl();
+ if (empty($baseUrl)) {
+ $this->_basePath = '';
+ return $this;
+ }
+
+ if (basename($baseUrl) === $filename) {
+ $basePath = dirname($baseUrl);
+ } else {
+ $basePath = $baseUrl;
+ }
+ }
+
+ if (substr(PHP_OS, 0, 3) === 'WIN') {
+ $basePath = str_replace('\\', '/', $basePath);
+ }
+
+ $this->_basePath = rtrim($basePath, '/');
+ return $this;
+ }
+
+ /**
+ * Everything in REQUEST_URI before PATH_INFO not including the filename
+ * <img src="<?=$basePath?>/images/zend.png"/>
+ *
+ * @return string
+ */
+ public function getBasePath()
+ {
+ if (null === $this->_basePath) {
+ $this->setBasePath();
+ }
+
+ return $this->_basePath;
+ }
+
+ /**
+ * Set the PATH_INFO string
+ *
+ * @param string|null $pathInfo
+ * @return Zend_Controller_Request_Http
+ */
+ public function setPathInfo($pathInfo = null)
+ {
+ if ($pathInfo === null) {
+ $baseUrl = $this->getBaseUrl(); // this actually calls setBaseUrl() & setRequestUri()
+ $baseUrlRaw = $this->getBaseUrl(false);
+ $baseUrlEncoded = urlencode($baseUrlRaw);
+
+ if (null === ($requestUri = $this->getRequestUri())) {
+ return $this;
+ }
+
+ // Remove the query string from REQUEST_URI
+ if ($pos = strpos($requestUri, '?')) {
+ $requestUri = substr($requestUri, 0, $pos);
+ }
+
+ if (!empty($baseUrl) || !empty($baseUrlRaw)) {
+ if (strpos($requestUri, $baseUrl) === 0) {
+ $pathInfo = substr($requestUri, strlen($baseUrl));
+ } elseif (strpos($requestUri, $baseUrlRaw) === 0) {
+ $pathInfo = substr($requestUri, strlen($baseUrlRaw));
+ } elseif (strpos($requestUri, $baseUrlEncoded) === 0) {
+ $pathInfo = substr($requestUri, strlen($baseUrlEncoded));
+ } else {
+ $pathInfo = $requestUri;
+ }
+ } else {
+ $pathInfo = $requestUri;
+ }
+
+ }
+
+ $this->_pathInfo = (string) $pathInfo;
+ return $this;
+ }
+
+ /**
+ * Returns everything between the BaseUrl and QueryString.
+ * This value is calculated instead of reading PATH_INFO
+ * directly from $_SERVER due to cross-platform differences.
+ *
+ * @return string
+ */
+ public function getPathInfo()
+ {
+ if (empty($this->_pathInfo)) {
+ $this->setPathInfo();
+ }
+
+ return $this->_pathInfo;
+ }
+
+ /**
+ * Set allowed parameter sources
+ *
+ * Can be empty array, or contain one or more of '_GET' or '_POST'.
+ *
+ * @param array $paramSoures
+ * @return Zend_Controller_Request_Http
+ */
+ public function setParamSources(array $paramSources = array())
+ {
+ $this->_paramSources = $paramSources;
+ return $this;
+ }
+
+ /**
+ * Get list of allowed parameter sources
+ *
+ * @return array
+ */
+ public function getParamSources()
+ {
+ return $this->_paramSources;
+ }
+
+ /**
+ * Set a userland parameter
+ *
+ * Uses $key to set a userland parameter. If $key is an alias, the actual
+ * key will be retrieved and used to set the parameter.
+ *
+ * @param mixed $key
+ * @param mixed $value
+ * @return Zend_Controller_Request_Http
+ */
+ public function setParam($key, $value)
+ {
+ $key = (null !== ($alias = $this->getAlias($key))) ? $alias : $key;
+ parent::setParam($key, $value);
+ return $this;
+ }
+
+ /**
+ * Retrieve a parameter
+ *
+ * Retrieves a parameter from the instance. Priority is in the order of
+ * userland parameters (see {@link setParam()}), $_GET, $_POST. If a
+ * parameter matching the $key is not found, null is returned.
+ *
+ * If the $key is an alias, the actual key aliased will be used.
+ *
+ * @param mixed $key
+ * @param mixed $default Default value to use if key not found
+ * @return mixed
+ */
+ public function getParam($key, $default = null)
+ {
+ $keyName = (null !== ($alias = $this->getAlias($key))) ? $alias : $key;
+
+ $paramSources = $this->getParamSources();
+ if (isset($this->_params[$keyName])) {
+ return $this->_params[$keyName];
+ } elseif (in_array('_GET', $paramSources) && (isset($_GET[$keyName]))) {
+ return $_GET[$keyName];
+ } elseif (in_array('_POST', $paramSources) && (isset($_POST[$keyName]))) {
+ return $_POST[$keyName];
+ }
+
+ return $default;
+ }
+
+ /**
+ * Retrieve an array of parameters
+ *
+ * Retrieves a merged array of parameters, with precedence of userland
+ * params (see {@link setParam()}), $_GET, $_POST (i.e., values in the
+ * userland params will take precedence over all others).
+ *
+ * @return array
+ */
+ public function getParams()
+ {
+ $return = $this->_params;
+ $paramSources = $this->getParamSources();
+ if (in_array('_GET', $paramSources)
+ && isset($_GET)
+ && is_array($_GET)
+ ) {
+ $return += $_GET;
+ }
+ if (in_array('_POST', $paramSources)
+ && isset($_POST)
+ && is_array($_POST)
+ ) {
+ $return += $_POST;
+ }
+ return $return;
+ }
+
+ /**
+ * Set parameters
+ *
+ * Set one or more parameters. Parameters are set as userland parameters,
+ * using the keys specified in the array.
+ *
+ * @param array $params
+ * @return Zend_Controller_Request_Http
+ */
+ public function setParams(array $params)
+ {
+ foreach ($params as $key => $value) {
+ $this->setParam($key, $value);
+ }
+ return $this;
+ }
+
+ /**
+ * Set a key alias
+ *
+ * Set an alias used for key lookups. $name specifies the alias, $target
+ * specifies the actual key to use.
+ *
+ * @param string $name
+ * @param string $target
+ * @return Zend_Controller_Request_Http
+ */
+ public function setAlias($name, $target)
+ {
+ $this->_aliases[$name] = $target;
+ return $this;
+ }
+
+ /**
+ * Retrieve an alias
+ *
+ * Retrieve the actual key represented by the alias $name.
+ *
+ * @param string $name
+ * @return string|null Returns null when no alias exists
+ */
+ public function getAlias($name)
+ {
+ if (isset($this->_aliases[$name])) {
+ return $this->_aliases[$name];
+ }
+
+ return null;
+ }
+
+ /**
+ * Retrieve the list of all aliases
+ *
+ * @return array
+ */
+ public function getAliases()
+ {
+ return $this->_aliases;
+ }
+
+ /**
+ * Return the method by which the request was made
+ *
+ * @return string
+ */
+ public function getMethod()
+ {
+ return $this->getServer('REQUEST_METHOD');
+ }
+
+ /**
+ * Was the request made by POST?
+ *
+ * @return boolean
+ */
+ public function isPost()
+ {
+ if ('POST' == $this->getMethod()) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Was the request made by GET?
+ *
+ * @return boolean
+ */
+ public function isGet()
+ {
+ if ('GET' == $this->getMethod()) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Was the request made by PUT?
+ *
+ * @return boolean
+ */
+ public function isPut()
+ {
+ if ('PUT' == $this->getMethod()) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Was the request made by DELETE?
+ *
+ * @return boolean
+ */
+ public function isDelete()
+ {
+ if ('DELETE' == $this->getMethod()) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Was the request made by HEAD?
+ *
+ * @return boolean
+ */
+ public function isHead()
+ {
+ if ('HEAD' == $this->getMethod()) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Was the request made by OPTIONS?
+ *
+ * @return boolean
+ */
+ public function isOptions()
+ {
+ if ('OPTIONS' == $this->getMethod()) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Was the request made by PATCH?
+ *
+ * @return boolean
+ */
+ public function isPatch()
+ {
+ if ('PATCH' == $this->getMethod()) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Is the request a Javascript XMLHttpRequest?
+ *
+ * Should work with Prototype/Script.aculo.us, possibly others.
+ *
+ * @return boolean
+ */
+ public function isXmlHttpRequest()
+ {
+ return ($this->getHeader('X_REQUESTED_WITH') == 'XMLHttpRequest');
+ }
+
+ /**
+ * Is this a Flash request?
+ *
+ * @return boolean
+ */
+ public function isFlashRequest()
+ {
+ $header = strtolower($this->getHeader('USER_AGENT'));
+ return (strstr($header, ' flash')) ? true : false;
+ }
+
+ /**
+ * Is https secure request
+ *
+ * @return boolean
+ */
+ public function isSecure()
+ {
+ return ($this->getScheme() === self::SCHEME_HTTPS);
+ }
+
+ /**
+ * Return the raw body of the request, if present
+ *
+ * @return string|false Raw body, or false if not present
+ */
+ public function getRawBody()
+ {
+ if (null === $this->_rawBody) {
+ $body = file_get_contents('php://input');
+
+ if (strlen(trim($body)) > 0) {
+ $this->_rawBody = $body;
+ } else {
+ $this->_rawBody = false;
+ }
+ }
+ return $this->_rawBody;
+ }
+
+ /**
+ * Return the value of the given HTTP header. Pass the header name as the
+ * plain, HTTP-specified header name. Ex.: Ask for 'Accept' to get the
+ * Accept header, 'Accept-Encoding' to get the Accept-Encoding header.
+ *
+ * @param string $header HTTP header name
+ * @return string|false HTTP header value, or false if not found
+ * @throws Zend_Controller_Request_Exception
+ */
+ public function getHeader($header)
+ {
+ if (empty($header)) {
+ throw new Zend_Controller_Request_Exception('An HTTP header name is required');
+ }
+
+ // Try to get it from the $_SERVER array first
+ $temp = strtoupper(str_replace('-', '_', $header));
+ if (isset($_SERVER['HTTP_' . $temp])) {
+ return $_SERVER['HTTP_' . $temp];
+ }
+
+ /*
+ * Try to get it from the $_SERVER array on POST request or CGI environment
+ * @see https://www.ietf.org/rfc/rfc3875 (4.1.2. and 4.1.3.)
+ */
+ if (isset($_SERVER[$temp])
+ && in_array($temp, array('CONTENT_TYPE', 'CONTENT_LENGTH'))
+ ) {
+ return $_SERVER[$temp];
+ }
+
+ // This seems to be the only way to get the Authorization header on
+ // Apache
+ if (function_exists('apache_request_headers')) {
+ $headers = apache_request_headers();
+ if (isset($headers[$header])) {
+ return $headers[$header];
+ }
+ $header = strtolower($header);
+ foreach ($headers as $key => $value) {
+ if (strtolower($key) == $header) {
+ return $value;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Get the request URI scheme
+ *
+ * @return string
+ */
+ public function getScheme()
+ {
+ return ($this->getServer('HTTPS') == 'on') ? self::SCHEME_HTTPS : self::SCHEME_HTTP;
+ }
+
+ /**
+ * Get the HTTP host.
+ *
+ * "Host" ":" host [ ":" port ] ; Section 3.2.2
+ * Note the HTTP Host header is not the same as the URI host.
+ * It includes the port while the URI host doesn't.
+ *
+ * @return string
+ */
+ public function getHttpHost()
+ {
+ $host = $this->getServer('HTTP_HOST');
+ if (!empty($host)) {
+ return $host;
+ }
+
+ $scheme = $this->getScheme();
+ $name = $this->getServer('SERVER_NAME');
+ $port = $this->getServer('SERVER_PORT');
+
+ if(null === $name) {
+ return '';
+ }
+ elseif (($scheme == self::SCHEME_HTTP && $port == 80) || ($scheme == self::SCHEME_HTTPS && $port == 443)) {
+ return $name;
+ } else {
+ return $name . ':' . $port;
+ }
+ }
+
+ /**
+ * Get the client's IP addres
+ *
+ * @param boolean $checkProxy
+ * @return string
+ */
+ public function getClientIp($checkProxy = true)
+ {
+ if ($checkProxy && $this->getServer('HTTP_CLIENT_IP') != null) {
+ $ip = $this->getServer('HTTP_CLIENT_IP');
+ } else if ($checkProxy && $this->getServer('HTTP_X_FORWARDED_FOR') != null) {
+ $ip = $this->getServer('HTTP_X_FORWARDED_FOR');
+ } else {
+ $ip = $this->getServer('REMOTE_ADDR');
+ }
+
+ return $ip;
+ }
+}
diff --git a/library/vendor/Zend/Controller/Request/HttpTestCase.php b/library/vendor/Zend/Controller/Request/HttpTestCase.php
new file mode 100644
index 0000000..414c95e
--- /dev/null
+++ b/library/vendor/Zend/Controller/Request/HttpTestCase.php
@@ -0,0 +1,275 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Controller_Request_Http
+ */
+
+/**
+ * Zend_Controller_Request_HttpTestCase
+ *
+ * HTTP request object for use with Zend_Controller family.
+ *
+ * @uses Zend_Controller_Request_Http
+ * @package Zend_Controller
+ * @subpackage Request
+ */
+class Zend_Controller_Request_HttpTestCase extends Zend_Controller_Request_Http
+{
+ /**
+ * Request headers
+ * @var array
+ */
+ protected $_headers = array();
+
+ /**
+ * Request method
+ * @var string
+ */
+ protected $_method = 'GET';
+
+ /**
+ * Raw POST body
+ * @var string|null
+ */
+ protected $_rawBody;
+
+ /**
+ * Valid request method types
+ * @var array
+ */
+ protected $_validMethodTypes = array(
+ 'DELETE',
+ 'GET',
+ 'HEAD',
+ 'OPTIONS',
+ 'PATCH',
+ 'POST',
+ 'PUT',
+ );
+
+ /**
+ * Clear GET values
+ *
+ * @return Zend_Controller_Request_HttpTestCase
+ */
+ public function clearQuery()
+ {
+ $_GET = array();
+ return $this;
+ }
+
+ /**
+ * Clear POST values
+ *
+ * @return Zend_Controller_Request_HttpTestCase
+ */
+ public function clearPost()
+ {
+ $_POST = array();
+ return $this;
+ }
+
+ /**
+ * Set raw POST body
+ *
+ * @param string $content
+ * @return Zend_Controller_Request_HttpTestCase
+ */
+ public function setRawBody($content)
+ {
+ $this->_rawBody = (string) $content;
+ return $this;
+ }
+
+ /**
+ * Get RAW POST body
+ *
+ * @return string|null
+ */
+ public function getRawBody()
+ {
+ return $this->_rawBody;
+ }
+
+ /**
+ * Clear raw POST body
+ *
+ * @return Zend_Controller_Request_HttpTestCase
+ */
+ public function clearRawBody()
+ {
+ $this->_rawBody = null;
+ return $this;
+ }
+
+ /**
+ * Set a cookie
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return Zend_Controller_Request_HttpTestCase
+ */
+ public function setCookie($key, $value)
+ {
+ $_COOKIE[(string) $key] = $value;
+ return $this;
+ }
+
+ /**
+ * Set multiple cookies at once
+ *
+ * @param array $cookies
+ * @return void
+ */
+ public function setCookies(array $cookies)
+ {
+ foreach ($cookies as $key => $value) {
+ $_COOKIE[$key] = $value;
+ }
+ return $this;
+ }
+
+ /**
+ * Clear all cookies
+ *
+ * @return Zend_Controller_Request_HttpTestCase
+ */
+ public function clearCookies()
+ {
+ $_COOKIE = array();
+ return $this;
+ }
+
+ /**
+ * Set request method
+ *
+ * @param string $type
+ * @return Zend_Controller_Request_HttpTestCase
+ */
+ public function setMethod($type)
+ {
+ $type = strtoupper(trim((string) $type));
+ if (!in_array($type, $this->_validMethodTypes)) {
+ throw new Zend_Controller_Exception('Invalid request method specified');
+ }
+ $this->_method = $type;
+ return $this;
+ }
+
+ /**
+ * Get request method
+ *
+ * @return string|null
+ */
+ public function getMethod()
+ {
+ return $this->_method;
+ }
+
+ /**
+ * Set a request header
+ *
+ * @param string $key
+ * @param string $value
+ * @return Zend_Controller_Request_HttpTestCase
+ */
+ public function setHeader($key, $value)
+ {
+ $key = $this->_normalizeHeaderName($key);
+ $this->_headers[$key] = (string) $value;
+ return $this;
+ }
+
+ /**
+ * Set request headers
+ *
+ * @param array $headers
+ * @return Zend_Controller_Request_HttpTestCase
+ */
+ public function setHeaders(array $headers)
+ {
+ foreach ($headers as $key => $value) {
+ $this->setHeader($key, $value);
+ }
+ return $this;
+ }
+
+ /**
+ * Get request header
+ *
+ * @param string $header
+ * @param mixed $default
+ * @return string|null
+ */
+ public function getHeader($header, $default = null)
+ {
+ $header = $this->_normalizeHeaderName($header);
+ if (array_key_exists($header, $this->_headers)) {
+ return $this->_headers[$header];
+ }
+ return $default;
+ }
+
+ /**
+ * Get all request headers
+ *
+ * @return array
+ */
+ public function getHeaders()
+ {
+ return $this->_headers;
+ }
+
+ /**
+ * Clear request headers
+ *
+ * @return Zend_Controller_Request_HttpTestCase
+ */
+ public function clearHeaders()
+ {
+ $this->_headers = array();
+ return $this;
+ }
+
+ /**
+ * Get REQUEST_URI
+ *
+ * @return null|string
+ */
+ public function getRequestUri()
+ {
+ return $this->_requestUri;
+ }
+
+ /**
+ * Normalize a header name for setting and retrieval
+ *
+ * @param string $name
+ * @return string
+ */
+ protected function _normalizeHeaderName($name)
+ {
+ $name = strtoupper((string) $name);
+ $name = str_replace('-', '_', $name);
+ return $name;
+ }
+}
diff --git a/library/vendor/Zend/Controller/Request/Simple.php b/library/vendor/Zend/Controller/Request/Simple.php
new file mode 100644
index 0000000..f804107
--- /dev/null
+++ b/library/vendor/Zend/Controller/Request/Simple.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Request
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Controller_Request_Abstract */
+
+/**
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Request
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Request_Simple extends Zend_Controller_Request_Abstract
+{
+
+ public function __construct($action = null, $controller = null, $module = null, array $params = array())
+ {
+ if ($action) {
+ $this->setActionName($action);
+ }
+
+ if ($controller) {
+ $this->setControllerName($controller);
+ }
+
+ if ($module) {
+ $this->setModuleName($module);
+ }
+
+ if ($params) {
+ $this->setParams($params);
+ }
+ }
+
+}
diff --git a/library/vendor/Zend/Controller/Response/Abstract.php b/library/vendor/Zend/Controller/Response/Abstract.php
new file mode 100644
index 0000000..0649694
--- /dev/null
+++ b/library/vendor/Zend/Controller/Response/Abstract.php
@@ -0,0 +1,790 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Controller_Response_Abstract
+ *
+ * Base class for Zend_Controller responses
+ *
+ * @package Zend_Controller
+ * @subpackage Response
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Controller_Response_Abstract
+{
+ /**
+ * Body content
+ * @var array
+ */
+ protected $_body = array();
+
+ /**
+ * Exception stack
+ * @var Exception
+ */
+ protected $_exceptions = array();
+
+ /**
+ * Array of headers. Each header is an array with keys 'name' and 'value'
+ * @var array
+ */
+ protected $_headers = array();
+
+ /**
+ * Array of raw headers. Each header is a single string, the entire header to emit
+ * @var array
+ */
+ protected $_headersRaw = array();
+
+ /**
+ * HTTP response code to use in headers
+ * @var int
+ */
+ protected $_httpResponseCode = 200;
+
+ /**
+ * Flag; is this response a redirect?
+ * @var boolean
+ */
+ protected $_isRedirect = false;
+
+ /**
+ * Whether or not to render exceptions; off by default
+ * @var boolean
+ */
+ protected $_renderExceptions = false;
+
+ /**
+ * Flag; if true, when header operations are called after headers have been
+ * sent, an exception will be raised; otherwise, processing will continue
+ * as normal. Defaults to true.
+ *
+ * @see canSendHeaders()
+ * @var boolean
+ */
+ public $headersSentThrowsException = true;
+
+ /**
+ * Normalize a header name
+ *
+ * Normalizes a header name to X-Capitalized-Names
+ *
+ * @param string $name
+ * @return string
+ */
+ protected function _normalizeHeader($name)
+ {
+ $filtered = str_replace(array('-', '_'), ' ', (string) $name);
+ $filtered = ucwords(strtolower($filtered));
+ $filtered = str_replace(' ', '-', $filtered);
+ return $filtered;
+ }
+
+ /**
+ * Set a header
+ *
+ * If $replace is true, replaces any headers already defined with that
+ * $name.
+ *
+ * @param string $name
+ * @param string $value
+ * @param boolean $replace
+ * @return Zend_Controller_Response_Abstract
+ */
+ public function setHeader($name, $value, $replace = false)
+ {
+ $this->canSendHeaders(true);
+ $name = $this->_normalizeHeader($name);
+ $value = (string) $value;
+
+ if ($replace) {
+ foreach ($this->_headers as $key => $header) {
+ if ($name == $header['name']) {
+ unset($this->_headers[$key]);
+ }
+ }
+ }
+
+ $this->_headers[] = array(
+ 'name' => $name,
+ 'value' => $value,
+ 'replace' => $replace
+ );
+
+ return $this;
+ }
+
+ /**
+ * Set redirect URL
+ *
+ * Sets Location header and response code. Forces replacement of any prior
+ * redirects.
+ *
+ * @param string $url
+ * @param int $code
+ * @return Zend_Controller_Response_Abstract
+ */
+ public function setRedirect($url, $code = 302)
+ {
+ $this->canSendHeaders(true);
+ $this->setHeader('Location', $url, true)
+ ->setHttpResponseCode($code);
+
+ return $this;
+ }
+
+ /**
+ * Is this a redirect?
+ *
+ * @return boolean
+ */
+ public function isRedirect()
+ {
+ return $this->_isRedirect;
+ }
+
+ /**
+ * Return array of headers; see {@link $_headers} for format
+ *
+ * @return array
+ */
+ public function getHeaders()
+ {
+ return $this->_headers;
+ }
+
+ /**
+ * Clear headers
+ *
+ * @return Zend_Controller_Response_Abstract
+ */
+ public function clearHeaders()
+ {
+ $this->_headers = array();
+
+ return $this;
+ }
+
+ /**
+ * Clears the specified HTTP header
+ *
+ * @param string $name
+ * @return Zend_Controller_Response_Abstract
+ */
+ public function clearHeader($name)
+ {
+ if (! count($this->_headers)) {
+ return $this;
+ }
+
+ foreach ($this->_headers as $index => $header) {
+ if ($name == $header['name']) {
+ unset($this->_headers[$index]);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set raw HTTP header
+ *
+ * Allows setting non key => value headers, such as status codes
+ *
+ * @param string $value
+ * @return Zend_Controller_Response_Abstract
+ */
+ public function setRawHeader($value)
+ {
+ $this->canSendHeaders(true);
+ if ('Location' == substr($value, 0, 8)) {
+ $this->_isRedirect = true;
+ }
+ $this->_headersRaw[] = (string) $value;
+ return $this;
+ }
+
+ /**
+ * Retrieve all {@link setRawHeader() raw HTTP headers}
+ *
+ * @return array
+ */
+ public function getRawHeaders()
+ {
+ return $this->_headersRaw;
+ }
+
+ /**
+ * Clear all {@link setRawHeader() raw HTTP headers}
+ *
+ * @return Zend_Controller_Response_Abstract
+ */
+ public function clearRawHeaders()
+ {
+ $this->_headersRaw = array();
+ return $this;
+ }
+
+ /**
+ * Clears the specified raw HTTP header
+ *
+ * @param string $headerRaw
+ * @return Zend_Controller_Response_Abstract
+ */
+ public function clearRawHeader($headerRaw)
+ {
+ if (! count($this->_headersRaw)) {
+ return $this;
+ }
+
+ $key = array_search($headerRaw, $this->_headersRaw);
+ if ($key !== false) {
+ unset($this->_headersRaw[$key]);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Clear all headers, normal and raw
+ *
+ * @return Zend_Controller_Response_Abstract
+ */
+ public function clearAllHeaders()
+ {
+ return $this->clearHeaders()
+ ->clearRawHeaders();
+ }
+
+ /**
+ * Set HTTP response code to use with headers
+ *
+ * @param int $code
+ * @return Zend_Controller_Response_Abstract
+ */
+ public function setHttpResponseCode($code)
+ {
+ if (!is_int($code) || (100 > $code) || (599 < $code)) {
+ throw new Zend_Controller_Response_Exception('Invalid HTTP response code');
+ }
+
+ if ((300 <= $code) && (307 >= $code)) {
+ $this->_isRedirect = true;
+ } else {
+ $this->_isRedirect = false;
+ }
+
+ $this->_httpResponseCode = $code;
+ return $this;
+ }
+
+ /**
+ * Retrieve HTTP response code
+ *
+ * @return int
+ */
+ public function getHttpResponseCode()
+ {
+ return $this->_httpResponseCode;
+ }
+
+ /**
+ * Can we send headers?
+ *
+ * @param boolean $throw Whether or not to throw an exception if headers have been sent; defaults to false
+ * @return boolean
+ * @throws Zend_Controller_Response_Exception
+ */
+ public function canSendHeaders($throw = false)
+ {
+ $ok = headers_sent($file, $line);
+ if ($ok && $throw && $this->headersSentThrowsException) {
+ throw new Zend_Controller_Response_Exception('Cannot send headers; headers already sent in ' . $file . ', line ' . $line);
+ }
+
+ return !$ok;
+ }
+
+ /**
+ * Send all headers
+ *
+ * Sends any headers specified. If an {@link setHttpResponseCode() HTTP response code}
+ * has been specified, it is sent with the first header.
+ *
+ * @return Zend_Controller_Response_Abstract
+ */
+ public function sendHeaders()
+ {
+ // Only check if we can send headers if we have headers to send
+ if (count($this->_headersRaw) || count($this->_headers) || (200 != $this->_httpResponseCode)) {
+ $this->canSendHeaders(true);
+ } elseif (200 == $this->_httpResponseCode) {
+ // Haven't changed the response code, and we have no headers
+ return $this;
+ }
+
+ $httpCodeSent = false;
+
+ foreach ($this->_headersRaw as $header) {
+ if (!$httpCodeSent && $this->_httpResponseCode) {
+ header($header, true, $this->_httpResponseCode);
+ $httpCodeSent = true;
+ } else {
+ header($header);
+ }
+ }
+
+ foreach ($this->_headers as $header) {
+ if (!$httpCodeSent && $this->_httpResponseCode) {
+ header($header['name'] . ': ' . $header['value'], $header['replace'], $this->_httpResponseCode);
+ $httpCodeSent = true;
+ } else {
+ header($header['name'] . ': ' . $header['value'], $header['replace']);
+ }
+ }
+
+ if (!$httpCodeSent) {
+ header('HTTP/1.1 ' . $this->_httpResponseCode);
+ $httpCodeSent = true;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set body content
+ *
+ * If $name is not passed, or is not a string, resets the entire body and
+ * sets the 'default' key to $content.
+ *
+ * If $name is a string, sets the named segment in the body array to
+ * $content.
+ *
+ * @param string $content
+ * @param null|string $name
+ * @return Zend_Controller_Response_Abstract
+ */
+ public function setBody($content, $name = null)
+ {
+ if ((null === $name) || !is_string($name)) {
+ $this->_body = array('default' => (string) $content);
+ } else {
+ $this->_body[$name] = (string) $content;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Append content to the body content
+ *
+ * @param string $content
+ * @param null|string $name
+ * @return Zend_Controller_Response_Abstract
+ */
+ public function appendBody($content, $name = null)
+ {
+ if ((null === $name) || !is_string($name)) {
+ if (isset($this->_body['default'])) {
+ $this->_body['default'] .= (string) $content;
+ } else {
+ return $this->append('default', $content);
+ }
+ } elseif (isset($this->_body[$name])) {
+ $this->_body[$name] .= (string) $content;
+ } else {
+ return $this->append($name, $content);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Clear body array
+ *
+ * With no arguments, clears the entire body array. Given a $name, clears
+ * just that named segment; if no segment matching $name exists, returns
+ * false to indicate an error.
+ *
+ * @param string $name Named segment to clear
+ * @return boolean
+ */
+ public function clearBody($name = null)
+ {
+ if (null !== $name) {
+ $name = (string) $name;
+ if (isset($this->_body[$name])) {
+ unset($this->_body[$name]);
+ return true;
+ }
+
+ return false;
+ }
+
+ $this->_body = array();
+ return true;
+ }
+
+ /**
+ * Return the body content
+ *
+ * If $spec is false, returns the concatenated values of the body content
+ * array. If $spec is boolean true, returns the body content array. If
+ * $spec is a string and matches a named segment, returns the contents of
+ * that segment; otherwise, returns null.
+ *
+ * @param boolean $spec
+ * @return string|array|null
+ */
+ public function getBody($spec = false)
+ {
+ if (false === $spec) {
+ ob_start();
+ $this->outputBody();
+ return ob_get_clean();
+ } elseif (true === $spec) {
+ return $this->_body;
+ } elseif (is_string($spec) && isset($this->_body[$spec])) {
+ return $this->_body[$spec];
+ }
+
+ return null;
+ }
+
+ /**
+ * Append a named body segment to the body content array
+ *
+ * If segment already exists, replaces with $content and places at end of
+ * array.
+ *
+ * @param string $name
+ * @param string $content
+ * @return Zend_Controller_Response_Abstract
+ */
+ public function append($name, $content)
+ {
+ if (!is_string($name)) {
+ throw new Zend_Controller_Response_Exception('Invalid body segment key ("' . gettype($name) . '")');
+ }
+
+ if (isset($this->_body[$name])) {
+ unset($this->_body[$name]);
+ }
+ $this->_body[$name] = (string) $content;
+ return $this;
+ }
+
+ /**
+ * Prepend a named body segment to the body content array
+ *
+ * If segment already exists, replaces with $content and places at top of
+ * array.
+ *
+ * @param string $name
+ * @param string $content
+ * @return void
+ */
+ public function prepend($name, $content)
+ {
+ if (!is_string($name)) {
+ throw new Zend_Controller_Response_Exception('Invalid body segment key ("' . gettype($name) . '")');
+ }
+
+ if (isset($this->_body[$name])) {
+ unset($this->_body[$name]);
+ }
+
+ $new = array($name => (string) $content);
+ $this->_body = $new + $this->_body;
+
+ return $this;
+ }
+
+ /**
+ * Insert a named segment into the body content array
+ *
+ * @param string $name
+ * @param string $content
+ * @param string $parent
+ * @param boolean $before Whether to insert the new segment before or
+ * after the parent. Defaults to false (after)
+ * @return Zend_Controller_Response_Abstract
+ */
+ public function insert($name, $content, $parent = null, $before = false)
+ {
+ if (!is_string($name)) {
+ throw new Zend_Controller_Response_Exception('Invalid body segment key ("' . gettype($name) . '")');
+ }
+
+ if ((null !== $parent) && !is_string($parent)) {
+ throw new Zend_Controller_Response_Exception('Invalid body segment parent key ("' . gettype($parent) . '")');
+ }
+
+ if (isset($this->_body[$name])) {
+ unset($this->_body[$name]);
+ }
+
+ if ((null === $parent) || !isset($this->_body[$parent])) {
+ return $this->append($name, $content);
+ }
+
+ $ins = array($name => (string) $content);
+ $keys = array_keys($this->_body);
+ $loc = array_search($parent, $keys);
+ if (!$before) {
+ // Increment location if not inserting before
+ ++$loc;
+ }
+
+ if (0 === $loc) {
+ // If location of key is 0, we're prepending
+ $this->_body = $ins + $this->_body;
+ } elseif ($loc >= (count($this->_body))) {
+ // If location of key is maximal, we're appending
+ $this->_body = $this->_body + $ins;
+ } else {
+ // Otherwise, insert at location specified
+ $pre = array_slice($this->_body, 0, $loc);
+ $post = array_slice($this->_body, $loc);
+ $this->_body = $pre + $ins + $post;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Echo the body segments
+ *
+ * @return void
+ */
+ public function outputBody()
+ {
+ $body = implode('', $this->_body);
+ echo $body;
+ }
+
+ /**
+ * Register an exception with the response
+ *
+ * @param Exception $e
+ * @return Zend_Controller_Response_Abstract
+ */
+ public function setException(Exception $e)
+ {
+ $this->_exceptions[] = $e;
+ return $this;
+ }
+
+ /**
+ * Retrieve the exception stack
+ *
+ * @return array
+ */
+ public function getException()
+ {
+ return $this->_exceptions;
+ }
+
+ /**
+ * Has an exception been registered with the response?
+ *
+ * @return boolean
+ */
+ public function isException()
+ {
+ return !empty($this->_exceptions);
+ }
+
+ /**
+ * Does the response object contain an exception of a given type?
+ *
+ * @param string $type
+ * @return boolean
+ */
+ public function hasExceptionOfType($type)
+ {
+ foreach ($this->_exceptions as $e) {
+ if ($e instanceof $type) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Does the response object contain an exception with a given message?
+ *
+ * @param string $message
+ * @return boolean
+ */
+ public function hasExceptionOfMessage($message)
+ {
+ foreach ($this->_exceptions as $e) {
+ if ($message == $e->getMessage()) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Does the response object contain an exception with a given code?
+ *
+ * @param int $code
+ * @return boolean
+ */
+ public function hasExceptionOfCode($code)
+ {
+ $code = (int) $code;
+ foreach ($this->_exceptions as $e) {
+ if ($code == $e->getCode()) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Retrieve all exceptions of a given type
+ *
+ * @param string $type
+ * @return false|array
+ */
+ public function getExceptionByType($type)
+ {
+ $exceptions = array();
+ foreach ($this->_exceptions as $e) {
+ if ($e instanceof $type) {
+ $exceptions[] = $e;
+ }
+ }
+
+ if (empty($exceptions)) {
+ $exceptions = false;
+ }
+
+ return $exceptions;
+ }
+
+ /**
+ * Retrieve all exceptions of a given message
+ *
+ * @param string $message
+ * @return false|array
+ */
+ public function getExceptionByMessage($message)
+ {
+ $exceptions = array();
+ foreach ($this->_exceptions as $e) {
+ if ($message == $e->getMessage()) {
+ $exceptions[] = $e;
+ }
+ }
+
+ if (empty($exceptions)) {
+ $exceptions = false;
+ }
+
+ return $exceptions;
+ }
+
+ /**
+ * Retrieve all exceptions of a given code
+ *
+ * @param mixed $code
+ * @return void
+ */
+ public function getExceptionByCode($code)
+ {
+ $code = (int) $code;
+ $exceptions = array();
+ foreach ($this->_exceptions as $e) {
+ if ($code == $e->getCode()) {
+ $exceptions[] = $e;
+ }
+ }
+
+ if (empty($exceptions)) {
+ $exceptions = false;
+ }
+
+ return $exceptions;
+ }
+
+ /**
+ * Whether or not to render exceptions (off by default)
+ *
+ * If called with no arguments or a null argument, returns the value of the
+ * flag; otherwise, sets it and returns the current value.
+ *
+ * @param boolean $flag Optional
+ * @return boolean
+ */
+ public function renderExceptions($flag = null)
+ {
+ if (null !== $flag) {
+ $this->_renderExceptions = $flag ? true : false;
+ }
+
+ return $this->_renderExceptions;
+ }
+
+ /**
+ * Send the response, including all headers, rendering exceptions if so
+ * requested.
+ *
+ * @return void
+ */
+ public function sendResponse()
+ {
+ $this->sendHeaders();
+
+ if ($this->isException() && $this->renderExceptions()) {
+ $exceptions = '';
+ foreach ($this->getException() as $e) {
+ $exceptions .= $e->__toString() . "\n";
+ }
+ echo $exceptions;
+ return;
+ }
+
+ $this->outputBody();
+ }
+
+ /**
+ * Magic __toString functionality
+ *
+ * Proxies to {@link sendResponse()} and returns response value as string
+ * using output buffering.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ ob_start();
+ $this->sendResponse();
+ return ob_get_clean();
+ }
+}
diff --git a/library/vendor/Zend/Controller/Response/Cli.php b/library/vendor/Zend/Controller/Response/Cli.php
new file mode 100644
index 0000000..5177d56
--- /dev/null
+++ b/library/vendor/Zend/Controller/Response/Cli.php
@@ -0,0 +1,67 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/** Zend_Controller_Response_Abstract */
+
+
+/**
+ * Zend_Controller_Response_Cli
+ *
+ * CLI response for controllers
+ *
+ * @uses Zend_Controller_Response_Abstract
+ * @package Zend_Controller
+ * @subpackage Response
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Response_Cli extends Zend_Controller_Response_Abstract
+{
+ /**
+ * Flag; if true, when header operations are called after headers have been
+ * sent, an exception will be raised; otherwise, processing will continue
+ * as normal. Defaults to false.
+ *
+ * @see canSendHeaders()
+ * @var boolean
+ */
+ public $headersSentThrowsException = false;
+
+
+ /**
+ * Magic __toString functionality
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ if ($this->isException() && $this->renderExceptions()) {
+ $exceptions = '';
+ foreach ($this->getException() as $e) {
+ $exceptions .= $e->__toString() . "\n";
+ }
+ return $exceptions;
+ }
+
+ return $this->_body;
+ }
+}
diff --git a/library/vendor/Zend/Controller/Response/Exception.php b/library/vendor/Zend/Controller/Response/Exception.php
new file mode 100644
index 0000000..8750ef3
--- /dev/null
+++ b/library/vendor/Zend/Controller/Response/Exception.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Request
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/** Zend_Controller_Exception */
+
+
+/**
+ * @package Zend_Controller
+ * @subpackage Response
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Response_Exception extends Zend_Controller_Exception
+{}
+
diff --git a/library/vendor/Zend/Controller/Response/Http.php b/library/vendor/Zend/Controller/Response/Http.php
new file mode 100644
index 0000000..e7656c0
--- /dev/null
+++ b/library/vendor/Zend/Controller/Response/Http.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/** Zend_Controller_Response_Abstract */
+
+
+/**
+ * Zend_Controller_Response_Http
+ *
+ * HTTP response for controllers
+ *
+ * @uses Zend_Controller_Response_Abstract
+ * @package Zend_Controller
+ * @subpackage Response
+ */
+class Zend_Controller_Response_Http extends Zend_Controller_Response_Abstract
+{
+}
diff --git a/library/vendor/Zend/Controller/Response/HttpTestCase.php b/library/vendor/Zend/Controller/Response/HttpTestCase.php
new file mode 100644
index 0000000..f115af9
--- /dev/null
+++ b/library/vendor/Zend/Controller/Response/HttpTestCase.php
@@ -0,0 +1,129 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Controller_Response_Http
+ */
+
+/**
+ * Zend_Controller_Response_HttpTestCase
+ *
+ * @uses Zend_Controller_Response_Http
+ * @package Zend_Controller
+ * @subpackage Response
+ */
+class Zend_Controller_Response_HttpTestCase extends Zend_Controller_Response_Http
+{
+ /**
+ * "send" headers by returning array of all headers that would be sent
+ *
+ * @return array
+ */
+ public function sendHeaders()
+ {
+ $headers = array();
+ foreach ($this->_headersRaw as $header) {
+ $headers[] = $header;
+ }
+ foreach ($this->_headers as $header) {
+ $name = $header['name'];
+ $key = strtolower($name);
+ if (array_key_exists($name, $headers)) {
+ if ($header['replace']) {
+ $headers[$key] = $header['name'] . ': ' . $header['value'];
+ }
+ } else {
+ $headers[$key] = $header['name'] . ': ' . $header['value'];
+ }
+ }
+ return $headers;
+ }
+
+ /**
+ * Can we send headers?
+ *
+ * @param bool $throw
+ * @return void
+ */
+ public function canSendHeaders($throw = false)
+ {
+ return true;
+ }
+
+ /**
+ * Return the concatenated body segments
+ *
+ * @return string
+ */
+ public function outputBody()
+ {
+ $fullContent = '';
+ foreach ($this->_body as $content) {
+ $fullContent .= $content;
+ }
+ return $fullContent;
+ }
+
+ /**
+ * Get body and/or body segments
+ *
+ * @param bool|string $spec
+ * @return string|array|null
+ */
+ public function getBody($spec = false)
+ {
+ if (false === $spec) {
+ return $this->outputBody();
+ } elseif (true === $spec) {
+ return $this->_body;
+ } elseif (is_string($spec) && isset($this->_body[$spec])) {
+ return $this->_body[$spec];
+ }
+
+ return null;
+ }
+
+ /**
+ * "send" Response
+ *
+ * Concats all response headers, and then final body (separated by two
+ * newlines)
+ *
+ * @return string
+ */
+ public function sendResponse()
+ {
+ $headers = $this->sendHeaders();
+ $content = implode("\n", $headers) . "\n\n";
+
+ if ($this->isException() && $this->renderExceptions()) {
+ $exceptions = '';
+ foreach ($this->getException() as $e) {
+ $exceptions .= $e->__toString() . "\n";
+ }
+ $content .= $exceptions;
+ } else {
+ $content .= $this->outputBody();
+ }
+
+ return $content;
+ }
+}
diff --git a/library/vendor/Zend/Controller/Router/Abstract.php b/library/vendor/Zend/Controller/Router/Abstract.php
new file mode 100644
index 0000000..7709caf
--- /dev/null
+++ b/library/vendor/Zend/Controller/Router/Abstract.php
@@ -0,0 +1,176 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Controller_Router_Interface */
+
+/**
+ * Simple first implementation of a router, to be replaced
+ * with rules-based URI processor.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Controller_Router_Abstract implements Zend_Controller_Router_Interface
+{
+ /**
+ * URI delimiter
+ */
+ const URI_DELIMITER = '/';
+
+ /**
+ * Front controller instance
+ *
+ * @var Zend_Controller_Front
+ */
+ protected $_frontController;
+
+ /**
+ * Array of invocation parameters to use when instantiating action
+ * controllers
+ *
+ * @var array
+ */
+ protected $_invokeParams = array();
+
+ /**
+ * Constructor
+ *
+ * @param array $params
+ */
+ public function __construct(array $params = array())
+ {
+ $this->setParams($params);
+ }
+
+ /**
+ * Add or modify a parameter to use when instantiating an action controller
+ *
+ * @param string $name
+ * @param mixed $value
+ * @return Zend_Controller_Router_Abstract
+ */
+ public function setParam($name, $value)
+ {
+ $name = (string)$name;
+ $this->_invokeParams[$name] = $value;
+
+ return $this;
+ }
+
+ /**
+ * Set parameters to pass to action controller constructors
+ *
+ * @param array $params
+ * @return Zend_Controller_Router_Abstract
+ */
+ public function setParams(array $params)
+ {
+ $this->_invokeParams = array_merge($this->_invokeParams, $params);
+
+ return $this;
+ }
+
+ /**
+ * Retrieve a single parameter from the controller parameter stack
+ *
+ * @param string $name
+ * @return mixed
+ */
+ public function getParam($name)
+ {
+ if (isset($this->_invokeParams[$name])) {
+ return $this->_invokeParams[$name];
+ }
+
+ return null;
+ }
+
+ /**
+ * Retrieve action controller instantiation parameters
+ *
+ * @return array
+ */
+ public function getParams()
+ {
+ return $this->_invokeParams;
+ }
+
+ /**
+ * Clear the controller parameter stack
+ *
+ * By default, clears all parameters. If a parameter name is given, clears
+ * only that parameter; if an array of parameter names is provided, clears
+ * each.
+ *
+ * @param null|string|array single key or array of keys for params to clear
+ * @return Zend_Controller_Router_Abstract
+ */
+ public function clearParams($name = null)
+ {
+ if (null === $name) {
+ $this->_invokeParams = array();
+ } elseif (is_string($name) && isset($this->_invokeParams[$name])) {
+ unset($this->_invokeParams[$name]);
+ } elseif (is_array($name)) {
+ foreach ($name as $key) {
+ if (is_string($key) && isset($this->_invokeParams[$key])) {
+ unset($this->_invokeParams[$key]);
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Retrieve Front Controller
+ *
+ * @return Zend_Controller_Front
+ */
+ public function getFrontController()
+ {
+ // Used cache version if found
+ if (null !== $this->_frontController) {
+ return $this->_frontController;
+ }
+
+ $this->_frontController = Zend_Controller_Front::getInstance();
+
+ return $this->_frontController;
+ }
+
+ /**
+ * Set Front Controller
+ *
+ * @param Zend_Controller_Front $controller
+ * @return Zend_Controller_Router_Interface
+ */
+ public function setFrontController(Zend_Controller_Front $controller)
+ {
+ $this->_frontController = $controller;
+
+ return $this;
+ }
+}
diff --git a/library/vendor/Zend/Controller/Router/Exception.php b/library/vendor/Zend/Controller/Router/Exception.php
new file mode 100644
index 0000000..8bdb7ff
--- /dev/null
+++ b/library/vendor/Zend/Controller/Router/Exception.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Controller_Exception */
+
+/**
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Router_Exception extends Zend_Controller_Exception
+{
+}
+
diff --git a/library/vendor/Zend/Controller/Router/Interface.php b/library/vendor/Zend/Controller/Router/Interface.php
new file mode 100644
index 0000000..920286d
--- /dev/null
+++ b/library/vendor/Zend/Controller/Router/Interface.php
@@ -0,0 +1,123 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Controller_Router_Interface
+{
+ /**
+ * Processes a request and sets its controller and action. If
+ * no route was possible, an exception is thrown.
+ *
+ * @param Zend_Controller_Request_Abstract
+ * @throws Zend_Controller_Router_Exception
+ * @return Zend_Controller_Request_Abstract|boolean
+ */
+ public function route(Zend_Controller_Request_Abstract $dispatcher);
+
+ /**
+ * Generates a URL path that can be used in URL creation, redirection, etc.
+ *
+ * May be passed user params to override ones from URI, Request or even defaults.
+ * If passed parameter has a value of null, it's URL variable will be reset to
+ * default.
+ *
+ * If null is passed as a route name assemble will use the current Route or 'default'
+ * if current is not yet set.
+ *
+ * Reset is used to signal that all parameters should be reset to it's defaults.
+ * Ignoring all URL specified values. User specified params still get precedence.
+ *
+ * Encode tells to url encode resulting path parts.
+ *
+ * @param array $userParams Options passed by a user used to override parameters
+ * @param mixed $name The name of a Route to use
+ * @param bool $reset Whether to reset to the route defaults ignoring URL params
+ * @param bool $encode Tells to encode URL parts on output
+ * @throws Zend_Controller_Router_Exception
+ * @return string Resulting URL path
+ */
+ public function assemble($userParams, $name = null, $reset = false, $encode = true);
+
+ /**
+ * Retrieve Front Controller
+ *
+ * @return Zend_Controller_Front
+ */
+ public function getFrontController();
+
+ /**
+ * Set Front Controller
+ *
+ * @param Zend_Controller_Front $controller
+ * @return Zend_Controller_Router_Interface
+ */
+ public function setFrontController(Zend_Controller_Front $controller);
+
+ /**
+ * Add or modify a parameter with which to instantiate any helper objects
+ *
+ * @param string $name
+ * @param mixed $value
+ * @return Zend_Controller_Router_Interface
+ */
+ public function setParam($name, $value);
+
+ /**
+ * Set an array of a parameters to pass to helper object constructors
+ *
+ * @param array $params
+ * @return Zend_Controller_Router_Interface
+ */
+ public function setParams(array $params);
+
+ /**
+ * Retrieve a single parameter from the controller parameter stack
+ *
+ * @param string $name
+ * @return mixed
+ */
+ public function getParam($name);
+
+ /**
+ * Retrieve the parameters to pass to helper object constructors
+ *
+ * @return array
+ */
+ public function getParams();
+
+ /**
+ * Clear the controller parameter stack
+ *
+ * By default, clears all parameters. If a parameter name is given, clears
+ * only that parameter; if an array of parameter names is provided, clears
+ * each.
+ *
+ * @param null|string|array single key or array of keys for params to clear
+ * @return Zend_Controller_Router_Interface
+ */
+ public function clearParams($name = null);
+}
diff --git a/library/vendor/Zend/Controller/Router/Rewrite.php b/library/vendor/Zend/Controller/Router/Rewrite.php
new file mode 100644
index 0000000..bfc3972
--- /dev/null
+++ b/library/vendor/Zend/Controller/Router/Rewrite.php
@@ -0,0 +1,542 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Controller_Router_Abstract */
+
+/** Zend_Controller_Router_Route */
+
+/**
+ * Ruby routing based Router.
+ *
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @see http://manuals.rubyonrails.com/read/chapter/65
+ */
+class Zend_Controller_Router_Rewrite extends Zend_Controller_Router_Abstract
+{
+
+ /**
+ * Whether or not to use default routes
+ *
+ * @var boolean
+ */
+ protected $_useDefaultRoutes = true;
+
+ /**
+ * Array of routes to match against
+ *
+ * @var array
+ */
+ protected $_routes = array();
+
+ /**
+ * Currently matched route
+ *
+ * @var string
+ */
+ protected $_currentRoute = null;
+
+ /**
+ * Global parameters given to all routes
+ *
+ * @var array
+ */
+ protected $_globalParams = array();
+
+ /**
+ * Separator to use with chain names
+ *
+ * @var string
+ */
+ protected $_chainNameSeparator = '-';
+
+ /**
+ * Determines if request parameters should be used as global parameters
+ * inside this router.
+ *
+ * @var boolean
+ */
+ protected $_useCurrentParamsAsGlobal = false;
+
+ /**
+ * Add default routes which are used to mimic basic router behaviour
+ *
+ * @return Zend_Controller_Router_Rewrite
+ */
+ public function addDefaultRoutes()
+ {
+ if (!$this->hasRoute('default')) {
+ $dispatcher = $this->getFrontController()->getDispatcher();
+ $request = $this->getFrontController()->getRequest();
+
+ $compat = new Zend_Controller_Router_Route_Module(array(), $dispatcher, $request);
+
+ $this->_routes = array('default' => $compat) + $this->_routes;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Add route to the route chain
+ *
+ * If route contains method setRequest(), it is initialized with a request object
+ *
+ * @param string $name Name of the route
+ * @param Zend_Controller_Router_Route_Interface $route Instance of the route
+ * @return Zend_Controller_Router_Rewrite
+ */
+ public function addRoute($name, Zend_Controller_Router_Route_Interface $route)
+ {
+ if (method_exists($route, 'setRequest')) {
+ $route->setRequest($this->getFrontController()->getRequest());
+ }
+
+ $this->_routes[$name] = $route;
+
+ return $this;
+ }
+
+ /**
+ * Add routes to the route chain
+ *
+ * @param array $routes Array of routes with names as keys and routes as values
+ * @return Zend_Controller_Router_Rewrite
+ */
+ public function addRoutes($routes)
+ {
+ foreach ($routes as $name => $route) {
+ $this->addRoute($name, $route);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Create routes out of Zend_Config configuration
+ *
+ * Example INI:
+ * routes.archive.route = "archive/:year/*"
+ * routes.archive.defaults.controller = archive
+ * routes.archive.defaults.action = show
+ * routes.archive.defaults.year = 2000
+ * routes.archive.reqs.year = "\d+"
+ *
+ * routes.news.type = "Zend_Controller_Router_Route_Static"
+ * routes.news.route = "news"
+ * routes.news.defaults.controller = "news"
+ * routes.news.defaults.action = "list"
+ *
+ * And finally after you have created a Zend_Config with above ini:
+ * $router = new Zend_Controller_Router_Rewrite();
+ * $router->addConfig($config, 'routes');
+ *
+ * @param Zend_Config $config Configuration object
+ * @param string $section Name of the config section containing route's definitions
+ * @throws Zend_Controller_Router_Exception
+ * @return Zend_Controller_Router_Rewrite
+ */
+ public function addConfig(Zend_Config $config, $section = null)
+ {
+ if ($section !== null) {
+ if ($config->{$section} === null) {
+ throw new Zend_Controller_Router_Exception("No route configuration in section '{$section}'");
+ }
+
+ $config = $config->{$section};
+ }
+
+ foreach ($config as $name => $info) {
+ $route = $this->_getRouteFromConfig($info);
+
+ if ($route instanceof Zend_Controller_Router_Route_Chain) {
+ if (!isset($info->chain)) {
+ throw new Zend_Controller_Router_Exception("No chain defined");
+ }
+
+ if ($info->chain instanceof Zend_Config) {
+ $childRouteNames = $info->chain;
+ } else {
+ $childRouteNames = explode(',', $info->chain);
+ }
+
+ foreach ($childRouteNames as $childRouteName) {
+ $childRoute = $this->getRoute(trim($childRouteName));
+ $route->chain($childRoute);
+ }
+
+ $this->addRoute($name, $route);
+ } elseif (isset($info->chains) && $info->chains instanceof Zend_Config) {
+ $this->_addChainRoutesFromConfig($name, $route, $info->chains);
+ } else {
+ $this->addRoute($name, $route);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get a route frm a config instance
+ *
+ * @param Zend_Config $info
+ * @return Zend_Controller_Router_Route_Interface
+ */
+ protected function _getRouteFromConfig(Zend_Config $info)
+ {
+ $class = (isset($info->type)) ? $info->type : 'Zend_Controller_Router_Route';
+ if (!class_exists($class)) {
+ Zend_Loader::loadClass($class);
+ }
+
+ $route = call_user_func(
+ array(
+ $class,
+ 'getInstance'
+ ), $info
+ );
+
+ if (isset($info->abstract) && $info->abstract && method_exists($route, 'isAbstract')) {
+ $route->isAbstract(true);
+ }
+
+ return $route;
+ }
+
+ /**
+ * Add chain routes from a config route
+ *
+ * @param string $name
+ * @param Zend_Controller_Router_Route_Interface $route
+ * @param Zend_Config $childRoutesInfo
+ * @return void
+ */
+ protected function _addChainRoutesFromConfig(
+ $name,
+ Zend_Controller_Router_Route_Interface $route,
+ Zend_Config $childRoutesInfo
+ )
+ {
+ foreach ($childRoutesInfo as $childRouteName => $childRouteInfo) {
+ if (is_string($childRouteInfo)) {
+ $childRouteName = $childRouteInfo;
+ $childRoute = $this->getRoute($childRouteName);
+ } else {
+ $childRoute = $this->_getRouteFromConfig($childRouteInfo);
+ }
+
+ if ($route instanceof Zend_Controller_Router_Route_Chain) {
+ $chainRoute = clone $route;
+ $chainRoute->chain($childRoute);
+ } else {
+ $chainRoute = $route->chain($childRoute);
+ }
+
+ $chainName = $name . $this->_chainNameSeparator . $childRouteName;
+
+ if (isset($childRouteInfo->chains)) {
+ $this->_addChainRoutesFromConfig($chainName, $chainRoute, $childRouteInfo->chains);
+ } else {
+ $this->addRoute($chainName, $chainRoute);
+ }
+ }
+ }
+
+ /**
+ * Remove a route from the route chain
+ *
+ * @param string $name Name of the route
+ * @throws Zend_Controller_Router_Exception
+ * @return Zend_Controller_Router_Rewrite
+ */
+ public function removeRoute($name)
+ {
+ if (!isset($this->_routes[$name])) {
+ throw new Zend_Controller_Router_Exception("Route $name is not defined");
+ }
+
+ unset($this->_routes[$name]);
+
+ return $this;
+ }
+
+ /**
+ * Remove all standard default routes
+ *
+ * @return Zend_Controller_Router_Rewrite
+ */
+ public function removeDefaultRoutes()
+ {
+ $this->_useDefaultRoutes = false;
+
+ return $this;
+ }
+
+ /**
+ * Check if named route exists
+ *
+ * @param string $name Name of the route
+ * @return boolean
+ */
+ public function hasRoute($name)
+ {
+ return isset($this->_routes[$name]);
+ }
+
+ /**
+ * Retrieve a named route
+ *
+ * @param string $name Name of the route
+ * @throws Zend_Controller_Router_Exception
+ * @return Zend_Controller_Router_Route_Interface Route object
+ */
+ public function getRoute($name)
+ {
+ if (!isset($this->_routes[$name])) {
+ throw new Zend_Controller_Router_Exception("Route $name is not defined");
+ }
+
+ return $this->_routes[$name];
+ }
+
+ /**
+ * Retrieve a currently matched route
+ *
+ * @throws Zend_Controller_Router_Exception
+ * @return Zend_Controller_Router_Route_Interface Route object
+ */
+ public function getCurrentRoute()
+ {
+ if (!isset($this->_currentRoute)) {
+ throw new Zend_Controller_Router_Exception("Current route is not defined");
+ }
+
+ return $this->getRoute($this->_currentRoute);
+ }
+
+ /**
+ * Retrieve a name of currently matched route
+ *
+ * @throws Zend_Controller_Router_Exception
+ * @return string Route name
+ */
+ public function getCurrentRouteName()
+ {
+ if (!isset($this->_currentRoute)) {
+ throw new Zend_Controller_Router_Exception("Current route is not defined");
+ }
+
+ return $this->_currentRoute;
+ }
+
+ /**
+ * Retrieve an array of routes added to the route chain
+ *
+ * @return array All of the defined routes
+ */
+ public function getRoutes()
+ {
+ return $this->_routes;
+ }
+
+ /**
+ * Find a matching route to the current PATH_INFO and inject
+ * returning values to the Request object.
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @throws Zend_Controller_Router_Exception
+ * @return Zend_Controller_Request_Abstract Request object
+ */
+ public function route(Zend_Controller_Request_Abstract $request)
+ {
+ if (!$request instanceof Zend_Controller_Request_Http) {
+ throw new Zend_Controller_Router_Exception(
+ 'Zend_Controller_Router_Rewrite requires a Zend_Controller_Request_Http-based request object'
+ );
+ }
+
+ if ($this->_useDefaultRoutes) {
+ $this->addDefaultRoutes();
+ }
+
+ // Find the matching route
+ $routeMatched = false;
+
+ foreach (array_reverse($this->_routes, true) as $name => $route) {
+ // TODO: Should be an interface method. Hack for 1.0 BC
+ if (method_exists($route, 'isAbstract') && $route->isAbstract()) {
+ continue;
+ }
+
+ // TODO: Should be an interface method. Hack for 1.0 BC
+ if (!method_exists($route, 'getVersion') || $route->getVersion() == 1) {
+ $match = $request->getPathInfo();
+ } else {
+ $match = $request;
+ }
+
+ if ($params = $route->match($match)) {
+ $this->_setRequestParams($request, $params);
+ $this->_currentRoute = $name;
+ $routeMatched = true;
+ break;
+ }
+ }
+
+ if (!$routeMatched) {
+ throw new Zend_Controller_Router_Exception('No route matched the request', 404);
+ }
+
+ if ($this->_useCurrentParamsAsGlobal) {
+ $params = $request->getParams();
+ foreach ($params as $param => $value) {
+ $this->setGlobalParam($param, $value);
+ }
+ }
+
+ return $request;
+ }
+
+ /**
+ * Sets parameters for request object
+ *
+ * Module name, controller name and action name
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @param array $params
+ */
+ protected function _setRequestParams($request, $params)
+ {
+ foreach ($params as $param => $value) {
+
+ $request->setParam($param, $value);
+
+ if ($param === $request->getModuleKey()) {
+ $request->setModuleName($value);
+ }
+ if ($param === $request->getControllerKey()) {
+ $request->setControllerName($value);
+ }
+ if ($param === $request->getActionKey()) {
+ $request->setActionName($value);
+ }
+ }
+ }
+
+ /**
+ * Generates a URL path that can be used in URL creation, redirection, etc.
+ *
+ * @param array $userParams Options passed by a user used to override parameters
+ * @param mixed $name The name of a Route to use
+ * @param bool $reset Whether to reset to the route defaults ignoring URL params
+ * @param bool $encode Tells to encode URL parts on output
+ * @throws Zend_Controller_Router_Exception
+ * @return string Resulting absolute URL path
+ */
+ public function assemble($userParams, $name = null, $reset = false, $encode = true)
+ {
+ if (!is_array($userParams)) {
+ throw new Zend_Controller_Router_Exception('userParams must be an array');
+ }
+
+ if ($name == null) {
+ try {
+ $name = $this->getCurrentRouteName();
+ } catch (Zend_Controller_Router_Exception $e) {
+ $name = 'default';
+ }
+ }
+
+ // Use UNION (+) in order to preserve numeric keys
+ $params = $userParams + $this->_globalParams;
+
+ $route = $this->getRoute($name);
+ $url = $route->assemble($params, $reset, $encode);
+
+ if (!preg_match('|^[a-z]+://|', $url)) {
+ $url = rtrim($this->getFrontController()->getBaseUrl(), self::URI_DELIMITER) . self::URI_DELIMITER . $url;
+ }
+
+ return $url;
+ }
+
+ /**
+ * Set a global parameter
+ *
+ * @param string $name
+ * @param mixed $value
+ * @return Zend_Controller_Router_Rewrite
+ */
+ public function setGlobalParam($name, $value)
+ {
+ $this->_globalParams[$name] = $value;
+
+ return $this;
+ }
+
+ /**
+ * Set the separator to use with chain names
+ *
+ * @param string $separator The separator to use
+ * @return Zend_Controller_Router_Rewrite
+ */
+ public function setChainNameSeparator($separator)
+ {
+ $this->_chainNameSeparator = $separator;
+
+ return $this;
+ }
+
+ /**
+ * Get the separator to use for chain names
+ *
+ * @return string
+ */
+ public function getChainNameSeparator()
+ {
+ return $this->_chainNameSeparator;
+ }
+
+ /**
+ * Determines/returns whether to use the request parameters as global parameters.
+ *
+ * @param boolean|null $use
+ * Null/unset when you want to retrieve the current state.
+ * True when request parameters should be global, false otherwise
+ * @return boolean|Zend_Controller_Router_Rewrite
+ * Returns a boolean if first param isn't set, returns an
+ * instance of Zend_Controller_Router_Rewrite otherwise.
+ *
+ */
+ public function useRequestParametersAsGlobal($use = null)
+ {
+ if ($use === null) {
+ return $this->_useCurrentParamsAsGlobal;
+ }
+
+ $this->_useCurrentParamsAsGlobal = (bool)$use;
+
+ return $this;
+ }
+}
diff --git a/library/vendor/Zend/Controller/Router/Route.php b/library/vendor/Zend/Controller/Router/Route.php
new file mode 100644
index 0000000..e001a49
--- /dev/null
+++ b/library/vendor/Zend/Controller/Router/Route.php
@@ -0,0 +1,603 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Controller_Router_Route_Abstract */
+
+/**
+ * Route
+ *
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @see http://manuals.rubyonrails.com/read/chapter/65
+ */
+class Zend_Controller_Router_Route extends Zend_Controller_Router_Route_Abstract
+{
+
+ /**
+ * Default translator
+ *
+ * @var Zend_Translate
+ */
+ protected static $_defaultTranslator;
+
+ /**
+ * Translator
+ *
+ * @var Zend_Translate
+ */
+ protected $_translator;
+
+ /**
+ * Default locale
+ *
+ * @var mixed
+ */
+ protected static $_defaultLocale;
+
+ /**
+ * Locale
+ *
+ * @var mixed
+ */
+ protected $_locale;
+
+ /**
+ * Wether this is a translated route or not
+ *
+ * @var boolean
+ */
+ protected $_isTranslated = false;
+
+ /**
+ * Translatable variables
+ *
+ * @var array
+ */
+ protected $_translatable = array();
+
+ protected $_urlVariable = ':';
+
+ protected $_urlDelimiter = self::URI_DELIMITER;
+
+ protected $_regexDelimiter = '#';
+
+ protected $_defaultRegex = null;
+
+ /**
+ * Holds names of all route's pattern variable names. Array index holds a position in URL.
+ *
+ * @var array
+ */
+ protected $_variables = array();
+
+ /**
+ * Holds Route patterns for all URL parts. In case of a variable it stores it's regex
+ * requirement or null. In case of a static part, it holds only it's direct value.
+ * In case of a wildcard, it stores an asterisk (*)
+ *
+ * @var array
+ */
+ protected $_parts = array();
+
+ /**
+ * Holds user submitted default values for route's variables. Name and value pairs.
+ *
+ * @var array
+ */
+ protected $_defaults = array();
+
+ /**
+ * Holds user submitted regular expression patterns for route's variables' values.
+ * Name and value pairs.
+ *
+ * @var array
+ */
+ protected $_requirements = array();
+
+ /**
+ * Associative array filled on match() that holds matched path values
+ * for given variable names.
+ *
+ * @var array
+ */
+ protected $_values = array();
+
+ /**
+ * Associative array filled on match() that holds wildcard variable
+ * names and values.
+ *
+ * @var array
+ */
+ protected $_wildcardData = array();
+
+ /**
+ * Helper var that holds a count of route pattern's static parts
+ * for validation
+ *
+ * @var int
+ */
+ protected $_staticCount = 0;
+
+ public function getVersion()
+ {
+ return 1;
+ }
+
+ /**
+ * Instantiates route based on passed Zend_Config structure
+ *
+ * @param Zend_Config $config Configuration object
+ * @return Zend_Controller_Router_Route
+ */
+ public static function getInstance(Zend_Config $config)
+ {
+ $reqs = ($config->reqs instanceof Zend_Config) ? $config->reqs->toArray() : array();
+ $defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : array();
+
+ return new self($config->route, $defs, $reqs);
+ }
+
+ /**
+ * Prepares the route for mapping by splitting (exploding) it
+ * to a corresponding atomic parts. These parts are assigned
+ * a position which is later used for matching and preparing values.
+ *
+ * @param string $route Map used to match with later submitted URL path
+ * @param array $defaults Defaults for map variables with keys as variable names
+ * @param array $reqs Regular expression requirements for variables (keys as variable names)
+ * @param Zend_Translate $translator Translator to use for this instance
+ * @param mixed|null $locale
+ */
+ public function __construct(
+ $route, $defaults = array(), $reqs = array(), Zend_Translate $translator = null, $locale = null
+ )
+ {
+ $route = trim($route, $this->_urlDelimiter);
+ $this->_defaults = (array)$defaults;
+ $this->_requirements = (array)$reqs;
+ $this->_translator = $translator;
+ $this->_locale = $locale;
+
+ if ($route !== '') {
+ foreach (explode($this->_urlDelimiter, $route) as $pos => $part) {
+ if (substr($part, 0, 1) == $this->_urlVariable && substr($part, 1, 1) != $this->_urlVariable) {
+ $name = substr($part, 1);
+
+ if (substr($name, 0, 1) === '@' && substr($name, 1, 1) !== '@') {
+ $name = substr($name, 1);
+ $this->_translatable[] = $name;
+ $this->_isTranslated = true;
+ }
+
+ $this->_parts[$pos] = (isset($reqs[$name]) ? $reqs[$name] : $this->_defaultRegex);
+ $this->_variables[$pos] = $name;
+ } else {
+ if (substr($part, 0, 1) == $this->_urlVariable) {
+ $part = substr($part, 1);
+ }
+
+ if (substr($part, 0, 1) === '@' && substr($part, 1, 1) !== '@') {
+ $this->_isTranslated = true;
+ }
+
+ $this->_parts[$pos] = $part;
+
+ if ($part !== '*') {
+ $this->_staticCount++;
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Matches a user submitted path with parts defined by a map. Assigns and
+ * returns an array of variables on a successful match.
+ *
+ * @param string $path Path used to match against this routing map
+ * @param boolean $partial
+ * @throws Zend_Controller_Router_Exception
+ * @return array|false An array of assigned values or a false on a mismatch
+ */
+ public function match($path, $partial = false)
+ {
+ if ($this->_isTranslated) {
+ $translateMessages = $this->getTranslator()->getMessages();
+ }
+
+ $pathStaticCount = 0;
+ $values = array();
+ $matchedPath = '';
+
+ if (!$partial) {
+ $path = trim($path, $this->_urlDelimiter);
+ }
+
+ if ($path !== '') {
+ $path = explode($this->_urlDelimiter, $path);
+
+ foreach ($path as $pos => $pathPart) {
+ // Path is longer than a route, it's not a match
+ if (!array_key_exists($pos, $this->_parts)) {
+ if ($partial) {
+ break;
+ } else {
+ return false;
+ }
+ }
+
+ $matchedPath .= $pathPart . $this->_urlDelimiter;
+
+ // If it's a wildcard, get the rest of URL as wildcard data and stop matching
+ if ($this->_parts[$pos] == '*') {
+ $count = count($path);
+ for ($i = $pos; $i < $count; $i += 2) {
+ $var = urldecode($path[$i]);
+ if (!isset($this->_wildcardData[$var]) && !isset($this->_defaults[$var])
+ && !isset($values[$var])
+ ) {
+ $this->_wildcardData[$var] = (isset($path[$i + 1])) ? urldecode($path[$i + 1]) : null;
+ }
+ }
+
+ $matchedPath = implode($this->_urlDelimiter, $path);
+ break;
+ }
+
+ $name = isset($this->_variables[$pos]) ? $this->_variables[$pos] : null;
+ $pathPart = urldecode($pathPart);
+
+ // Translate value if required
+ $part = $this->_parts[$pos];
+ if ($this->_isTranslated
+ && $part !== null
+ && (substr($part, 0, 1) === '@' && substr($part, 1, 1) !== '@'
+ && $name === null)
+ || $name !== null && in_array($name, $this->_translatable)
+ ) {
+ if ($part && substr($part, 0, 1) === '@') {
+ $part = substr($part, 1);
+ }
+
+ if (($originalPathPart = array_search($pathPart, $translateMessages)) !== false) {
+ $pathPart = $originalPathPart;
+ }
+ }
+
+ if ($part && substr($part, 0, 2) === '@@') {
+ $part = substr($part, 1);
+ }
+
+ // If it's a static part, match directly
+ if ($name === null && $part != $pathPart) {
+ return false;
+ }
+
+ // If it's a variable with requirement, match a regex. If not - everything matches
+ if ($part !== null
+ && !preg_match(
+ $this->_regexDelimiter . '^' . $part . '$' . $this->_regexDelimiter . 'iu', $pathPart
+ )
+ ) {
+ return false;
+ }
+
+ // If it's a variable store it's value for later
+ if ($name !== null) {
+ $values[$name] = $pathPart;
+ } else {
+ $pathStaticCount++;
+ }
+ }
+ }
+
+ // Check if all static mappings have been matched
+ if ($this->_staticCount != $pathStaticCount) {
+ return false;
+ }
+
+ $return = $values + $this->_wildcardData + $this->_defaults;
+
+ // Check if all map variables have been initialized
+ foreach ($this->_variables as $var) {
+ if (!array_key_exists($var, $return)) {
+ return false;
+ } elseif ($return[$var] == '' || $return[$var] === null) {
+ // Empty variable? Replace with the default value.
+ $return[$var] = $this->_defaults[$var];
+ }
+ }
+
+ $this->setMatchedPath(rtrim($matchedPath, $this->_urlDelimiter));
+
+ $this->_values = $values;
+
+ return $return;
+ }
+
+ /**
+ * Assembles user submitted parameters forming a URL path defined by this route
+ *
+ * @param array $data An array of variable and value pairs used as parameters
+ * @param boolean $reset Whether or not to set route defaults with those provided in $data
+ * @param boolean $encode
+ * @param boolean $partial
+ * @throws Zend_Controller_Router_Exception
+ * @return string Route path with user submitted parameters
+ */
+ public function assemble($data = array(), $reset = false, $encode = false, $partial = false)
+ {
+ if ($this->_isTranslated) {
+ $translator = $this->getTranslator();
+
+ if (isset($data['@locale'])) {
+ $locale = $data['@locale'];
+ unset($data['@locale']);
+ } else {
+ $locale = $this->getLocale();
+ }
+ }
+
+ $url = array();
+ $flag = false;
+
+ foreach ($this->_parts as $key => $part) {
+ $name = isset($this->_variables[$key]) ? $this->_variables[$key] : null;
+
+ $useDefault = false;
+ if (isset($name) && array_key_exists($name, $data) && $data[$name] === null) {
+ $useDefault = true;
+ }
+
+ if (isset($name)) {
+ if (isset($data[$name]) && !$useDefault) {
+ $value = $data[$name];
+ unset($data[$name]);
+ } elseif (!$reset && !$useDefault && isset($this->_values[$name])) {
+ $value = $this->_values[$name];
+ } elseif (!$reset && !$useDefault && isset($this->_wildcardData[$name])) {
+ $value = $this->_wildcardData[$name];
+ } elseif (array_key_exists($name, $this->_defaults)) {
+ $value = $this->_defaults[$name];
+ } else {
+ throw new Zend_Controller_Router_Exception($name . ' is not specified');
+ }
+
+ if ($this->_isTranslated && in_array($name, $this->_translatable)) {
+ $url[$key] = $translator->translate($value, $locale);
+ } else {
+ $url[$key] = $value;
+ }
+ } elseif ($part != '*') {
+ if ($this->_isTranslated && substr($part, 0, 1) === '@') {
+ if (substr($part, 1, 1) !== '@') {
+ $url[$key] = $translator->translate(substr($part, 1), $locale);
+ } else {
+ $url[$key] = substr($part, 1);
+ }
+ } else {
+ if (substr($part, 0, 2) === '@@') {
+ $part = substr($part, 1);
+ }
+
+ $url[$key] = $part;
+ }
+ } else {
+ if (!$reset) {
+ $data += $this->_wildcardData;
+ }
+ $defaults = $this->getDefaults();
+ foreach ($data as $var => $value) {
+ if ($value !== null && (!isset($defaults[$var]) || $value != $defaults[$var])) {
+ $url[$key++] = $var;
+ $url[$key++] = $value;
+ $flag = true;
+ }
+ }
+ }
+ }
+
+ $return = '';
+
+ foreach (array_reverse($url, true) as $key => $value) {
+ $defaultValue = null;
+
+ if (isset($this->_variables[$key])) {
+ $defaultValue = $this->getDefault($this->_variables[$key]);
+
+ if ($this->_isTranslated && $defaultValue !== null
+ && isset($this->_translatable[$this->_variables[$key]])
+ ) {
+ $defaultValue = $translator->translate($defaultValue, $locale);
+ }
+ }
+
+ if ($flag || $value !== $defaultValue || $partial) {
+ if ($encode) {
+ $value = urlencode($value);
+ }
+ $return = $this->_urlDelimiter . $value . $return;
+ $flag = true;
+ }
+ }
+
+ return trim($return, $this->_urlDelimiter);
+ }
+
+ /**
+ * Return a single parameter of route's defaults
+ *
+ * @param string $name Array key of the parameter
+ * @return string Previously set default
+ */
+ public function getDefault($name)
+ {
+ if (isset($this->_defaults[$name])) {
+ return $this->_defaults[$name];
+ }
+
+ return null;
+ }
+
+ /**
+ * Return an array of defaults
+ *
+ * @return array Route defaults
+ */
+ public function getDefaults()
+ {
+ return $this->_defaults;
+ }
+
+ /**
+ * Get all variables which are used by the route
+ *
+ * @return array
+ */
+ public function getVariables()
+ {
+ return $this->_variables;
+ }
+
+ /**
+ * Set a default translator
+ *
+ * @param Zend_Translate $translator
+ * @return void
+ */
+ public static function setDefaultTranslator(Zend_Translate $translator = null)
+ {
+ self::$_defaultTranslator = $translator;
+ }
+
+ /**
+ * Get the default translator
+ *
+ * @return Zend_Translate
+ */
+ public static function getDefaultTranslator()
+ {
+ return self::$_defaultTranslator;
+ }
+
+ /**
+ * Set a translator
+ *
+ * @param Zend_Translate $translator
+ * @return void
+ */
+ public function setTranslator(Zend_Translate $translator)
+ {
+ $this->_translator = $translator;
+ }
+
+ /**
+ * Get the translator
+ *
+ * @throws Zend_Controller_Router_Exception When no translator can be found
+ * @return Zend_Translate
+ */
+ public function getTranslator()
+ {
+ if ($this->_translator !== null) {
+ return $this->_translator;
+ } else {
+ if (($translator = self::getDefaultTranslator()) !== null) {
+ return $translator;
+ } else {
+ try {
+ $translator = Zend_Registry::get('Zend_Translate');
+ } catch (Zend_Exception $e) {
+ $translator = null;
+ }
+
+ if ($translator instanceof Zend_Translate) {
+ return $translator;
+ }
+ }
+ }
+
+ throw new Zend_Controller_Router_Exception('Could not find a translator');
+ }
+
+ /**
+ * Set a default locale
+ *
+ * @param mixed $locale
+ * @return void
+ */
+ public static function setDefaultLocale($locale = null)
+ {
+ self::$_defaultLocale = $locale;
+ }
+
+ /**
+ * Get the default locale
+ *
+ * @return mixed
+ */
+ public static function getDefaultLocale()
+ {
+ return self::$_defaultLocale;
+ }
+
+ /**
+ * Set a locale
+ *
+ * @param mixed $locale
+ * @return void
+ */
+ public function setLocale($locale)
+ {
+ $this->_locale = $locale;
+ }
+
+ /**
+ * Get the locale
+ *
+ * @return mixed
+ */
+ public function getLocale()
+ {
+ if ($this->_locale !== null) {
+ return $this->_locale;
+ } else {
+ if (($locale = self::getDefaultLocale()) !== null) {
+ return $locale;
+ } else {
+ try {
+ $locale = Zend_Registry::get('Zend_Locale');
+ } catch (Zend_Exception $e) {
+ $locale = null;
+ }
+
+ if ($locale !== null) {
+ return $locale;
+ }
+ }
+ }
+
+ return null;
+ }
+}
diff --git a/library/vendor/Zend/Controller/Router/Route/Abstract.php b/library/vendor/Zend/Controller/Router/Route/Abstract.php
new file mode 100644
index 0000000..7ec1e30
--- /dev/null
+++ b/library/vendor/Zend/Controller/Router/Route/Abstract.php
@@ -0,0 +1,119 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * @see Zend_Controller_Router_Route_Interface
+ */
+
+/**
+ * Abstract Route
+ *
+ * Implements interface and provides convenience methods
+ *
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Controller_Router_Route_Abstract implements Zend_Controller_Router_Route_Interface
+{
+ /**
+ * URI delimiter
+ */
+ const URI_DELIMITER = '/';
+
+ /**
+ * Wether this route is abstract or not
+ *
+ * @var boolean
+ */
+ protected $_isAbstract = false;
+
+ /**
+ * Path matched by this route
+ *
+ * @var string
+ */
+ protected $_matchedPath = null;
+
+ /**
+ * Get the version of the route
+ *
+ * @return integer
+ */
+ public function getVersion()
+ {
+ return 2;
+ }
+
+ /**
+ * Set partially matched path
+ *
+ * @param string $path
+ * @return void
+ */
+ public function setMatchedPath($path)
+ {
+ $this->_matchedPath = $path;
+ }
+
+ /**
+ * Get partially matched path
+ *
+ * @return string
+ */
+ public function getMatchedPath()
+ {
+ return $this->_matchedPath;
+ }
+
+ /**
+ * Check or set wether this is an abstract route or not
+ *
+ * @param boolean $flag
+ * @return boolean
+ */
+ public function isAbstract($flag = null)
+ {
+ if ($flag !== null) {
+ $this->_isAbstract = $flag;
+ }
+
+ return $this->_isAbstract;
+ }
+
+ /**
+ * Create a new chain
+ *
+ * @param Zend_Controller_Router_Route_Abstract $route
+ * @param string $separator
+ * @return Zend_Controller_Router_Route_Chain
+ */
+ public function chain(Zend_Controller_Router_Route_Abstract $route, $separator = '/')
+ {
+
+ $chain = new Zend_Controller_Router_Route_Chain();
+ $chain->chain($this)->chain($route, $separator);
+
+ return $chain;
+ }
+}
diff --git a/library/vendor/Zend/Controller/Router/Route/Chain.php b/library/vendor/Zend/Controller/Router/Route/Chain.php
new file mode 100644
index 0000000..a4414bd
--- /dev/null
+++ b/library/vendor/Zend/Controller/Router/Route/Chain.php
@@ -0,0 +1,228 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Controller_Router_Route_Abstract */
+
+/**
+ * Chain route is used for managing route chaining.
+ *
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Router_Route_Chain extends Zend_Controller_Router_Route_Abstract
+{
+
+ /**
+ * Routes
+ *
+ * @var array
+ */
+ protected $_routes = array();
+
+ /**
+ * Separators
+ *
+ * @var array
+ */
+ protected $_separators = array();
+
+ /**
+ * Instantiates route based on passed Zend_Config structure
+ *
+ * @param Zend_Config $config Configuration object
+ * @return Zend_Controller_Router_Route_Chain
+ */
+ public static function getInstance(Zend_Config $config)
+ {
+ $defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : array();
+
+ return new self($config->route, $defs);
+ }
+
+ /**
+ * Add a route to this chain
+ *
+ * @param Zend_Controller_Router_Route_Abstract $route
+ * @param string $separator
+ * @return Zend_Controller_Router_Route_Chain
+ */
+ public function chain(Zend_Controller_Router_Route_Abstract $route, $separator = self::URI_DELIMITER)
+ {
+ $this->_routes[] = $route;
+ $this->_separators[] = $separator;
+
+ return $this;
+ }
+
+ /**
+ * Matches a user submitted path with a previously defined route.
+ * Assigns and returns an array of defaults on a successful match.
+ *
+ * @param Zend_Controller_Request_Http $request Request to get the path info from
+ * @param null $partial
+ * @return array|false An array of assigned values or a false on a mismatch
+ */
+ public function match($request, $partial = null)
+ {
+ $rawPath = $request->getPathInfo();
+ $path = trim($request->getPathInfo(), self::URI_DELIMITER);
+ $subPath = $path;
+ $values = array();
+ $matchedPath = null;
+
+ foreach ($this->_routes as $key => $route) {
+ if ($key > 0
+ && $matchedPath !== null
+ && $subPath !== ''
+ && $subPath !== false
+ ) {
+ $separator = substr($subPath, 0, strlen($this->_separators[$key]));
+
+ if ($separator !== $this->_separators[$key]) {
+ $request->setPathInfo($rawPath);
+ return false;
+ }
+
+ $subPath = substr($subPath, strlen($separator));
+ }
+ // TODO: Should be an interface method. Hack for 1.0 BC
+ if (!method_exists($route, 'getVersion') || $route->getVersion() == 1) {
+ $match = $subPath;
+ } else {
+ $request->setPathInfo($subPath);
+ $match = $request;
+ }
+
+ $res = $route->match($match, true);
+
+ if ($res === false) {
+ $request->setPathInfo($rawPath);
+ return false;
+ }
+
+ $matchedPath = $route->getMatchedPath();
+
+ if ($matchedPath !== null) {
+ $subPath = substr($subPath, strlen($matchedPath));
+ }
+
+ $values = $res + $values;
+ }
+
+ $request->setPathInfo($path);
+
+ if ($subPath !== '' && $subPath !== false) {
+ return false;
+ }
+
+ return $values;
+ }
+
+ /**
+ * Assembles a URL path defined by this route
+ *
+ * @param array $data An array of variable and value pairs used as parameters
+ * @param bool $reset
+ * @param bool $encode
+ * @return string Route path with user submitted parameters
+ */
+ public function assemble($data = array(), $reset = false, $encode = false)
+ {
+ $value = '';
+ $numRoutes = count($this->_routes);
+
+ foreach ($this->_routes as $key => $route) {
+ if ($key > 0) {
+ $value .= $this->_separators[$key];
+ }
+
+ $value .= $route->assemble($data, $reset, $encode, (($numRoutes - 1) > $key));
+
+ if (method_exists($route, 'getVariables')) {
+ $variables = $route->getVariables();
+
+ foreach ($variables as $variable) {
+ $data[$variable] = null;
+ }
+ }
+ }
+
+ return $value;
+ }
+
+ /**
+ * Set the request object for this and the child routes
+ *
+ * @param Zend_Controller_Request_Abstract|null $request
+ * @return void
+ */
+ public function setRequest(Zend_Controller_Request_Abstract $request = null)
+ {
+ $this->_request = $request;
+
+ foreach ($this->_routes as $route) {
+ if (method_exists($route, 'setRequest')) {
+ $route->setRequest($request);
+ }
+ }
+ }
+
+ /**
+ * Return a single parameter of route's defaults
+ *
+ * @param string $name Array key of the parameter
+ * @return string Previously set default
+ */
+ public function getDefault($name)
+ {
+ $default = null;
+ foreach ($this->_routes as $route) {
+ if (method_exists($route, 'getDefault')) {
+ $current = $route->getDefault($name);
+ if (null !== $current) {
+ $default = $current;
+ }
+ }
+ }
+
+ return $default;
+ }
+
+ /**
+ * Return an array of defaults
+ *
+ * @return array Route defaults
+ */
+ public function getDefaults()
+ {
+ $defaults = array();
+ foreach ($this->_routes as $route) {
+ if (method_exists($route, 'getDefaults')) {
+ $defaults = array_merge($defaults, $route->getDefaults());
+ }
+ }
+
+ return $defaults;
+ }
+}
diff --git a/library/vendor/Zend/Controller/Router/Route/Hostname.php b/library/vendor/Zend/Controller/Router/Route/Hostname.php
new file mode 100644
index 0000000..b2be1c1
--- /dev/null
+++ b/library/vendor/Zend/Controller/Router/Route/Hostname.php
@@ -0,0 +1,377 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Controller_Router_Route_Abstract */
+
+/**
+ * Hostname Route
+ *
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @see http://manuals.rubyonrails.com/read/chapter/65
+ */
+class Zend_Controller_Router_Route_Hostname extends Zend_Controller_Router_Route_Abstract
+{
+
+ /**
+ * Host variable
+ *
+ * @var string
+ */
+ protected $_hostVariable = ':';
+
+ /**
+ * Regex delimiter
+ *
+ * @var string
+ */
+ protected $_regexDelimiter = '#';
+
+ /**
+ * Default regex string
+ *
+ * @var string|null
+ */
+ protected $_defaultRegex = null;
+
+ /**
+ * Holds names of all route's pattern variable names. Array index holds a position in host.
+ *
+ * @var array
+ */
+ protected $_variables = array();
+
+ /**
+ * Holds Route patterns for all host parts. In case of a variable it stores it's regex
+ * requirement or null. In case of a static part, it holds only it's direct value.
+ *
+ * @var array
+ */
+ protected $_parts = array();
+
+ /**
+ * Holds user submitted default values for route's variables. Name and value pairs.
+ *
+ * @var array
+ */
+ protected $_defaults = array();
+
+ /**
+ * Holds user submitted regular expression patterns for route's variables' values.
+ * Name and value pairs.
+ *
+ * @var array
+ */
+ protected $_requirements = array();
+
+ /**
+ * Default scheme
+ *
+ * @var string
+ */
+ protected $_scheme = null;
+
+ /**
+ * Associative array filled on match() that holds matched path values
+ * for given variable names.
+ *
+ * @var array
+ */
+ protected $_values = array();
+
+ /**
+ * Current request object
+ *
+ * @var Zend_Controller_Request_Abstract
+ */
+ protected $_request;
+
+ /**
+ * Helper var that holds a count of route pattern's static parts
+ * for validation
+ *
+ * @var int
+ */
+ private $_staticCount = 0;
+
+ /**
+ * Set the request object
+ *
+ * @param Zend_Controller_Request_Abstract|null $request
+ */
+ public function setRequest(Zend_Controller_Request_Abstract $request = null)
+ {
+ $this->_request = $request;
+ }
+
+ /**
+ * Get the request object
+ *
+ * @return Zend_Controller_Request_Abstract $request
+ */
+ public function getRequest()
+ {
+ if ($this->_request === null) {
+ $this->_request = Zend_Controller_Front::getInstance()->getRequest();
+ }
+
+ return $this->_request;
+ }
+
+ /**
+ * Instantiates route based on passed Zend_Config structure
+ *
+ * @param Zend_Config $config Configuration object
+ * @return Zend_Controller_Router_Route_Hostname
+ */
+ public static function getInstance(Zend_Config $config)
+ {
+ $reqs = ($config->reqs instanceof Zend_Config) ? $config->reqs->toArray() : array();
+ $defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : array();
+ $scheme = (isset($config->scheme)) ? $config->scheme : null;
+
+ return new self($config->route, $defs, $reqs, $scheme);
+ }
+
+ /**
+ * Prepares the route for mapping by splitting (exploding) it
+ * to a corresponding atomic parts. These parts are assigned
+ * a position which is later used for matching and preparing values.
+ *
+ * @param string $route Map used to match with later submitted hostname
+ * @param array $defaults Defaults for map variables with keys as variable names
+ * @param array $reqs Regular expression requirements for variables (keys as variable names)
+ * @param string $scheme
+ */
+ public function __construct($route, $defaults = array(), $reqs = array(), $scheme = null)
+ {
+ $route = trim($route, '.');
+ $this->_defaults = (array) $defaults;
+ $this->_requirements = (array) $reqs;
+ $this->_scheme = $scheme;
+
+ if ($route != '') {
+ foreach (explode('.', $route) as $pos => $part) {
+ if (substr($part, 0, 1) == $this->_hostVariable) {
+ $name = substr($part, 1);
+ $this->_parts[$pos] = (isset($reqs[$name]) ? $reqs[$name] : $this->_defaultRegex);
+ $this->_variables[$pos] = $name;
+ } else {
+ $this->_parts[$pos] = $part;
+ $this->_staticCount++;
+ }
+ }
+ }
+ }
+
+ /**
+ * Matches a user submitted path with parts defined by a map. Assigns and
+ * returns an array of variables on a successful match.
+ *
+ * @param Zend_Controller_Request_Http $request Request to get the host from
+ * @return array|false An array of assigned values or a false on a mismatch
+ */
+ public function match($request)
+ {
+ // Check the scheme if required
+ if ($this->_scheme !== null) {
+ $scheme = $request->getScheme();
+
+ if ($scheme !== $this->_scheme) {
+ return false;
+ }
+ }
+
+ // Get the host and remove unnecessary port information
+ $host = $request->getHttpHost();
+ if (preg_match('#:\d+$#', $host, $result) === 1) {
+ $host = substr($host, 0, -strlen($result[0]));
+ }
+
+ $hostStaticCount = 0;
+ $values = array();
+
+ $host = trim($host, '.');
+
+ if ($host != '') {
+ $host = explode('.', $host);
+
+ foreach ($host as $pos => $hostPart) {
+ // Host is longer than a route, it's not a match
+ if (!array_key_exists($pos, $this->_parts)) {
+ return false;
+ }
+
+ $name = isset($this->_variables[$pos]) ? $this->_variables[$pos] : null;
+ $hostPart = urldecode($hostPart);
+
+ // If it's a static part, match directly
+ if ($name === null && $this->_parts[$pos] != $hostPart) {
+ return false;
+ }
+
+ // If it's a variable with requirement, match a regex. If not - everything matches
+ if ($this->_parts[$pos] !== null
+ && !preg_match(
+ $this->_regexDelimiter . '^' . $this->_parts[$pos] . '$' . $this->_regexDelimiter . 'iu',
+ $hostPart
+ )
+ ) {
+ return false;
+ }
+
+ // If it's a variable store it's value for later
+ if ($name !== null) {
+ $values[$name] = $hostPart;
+ } else {
+ $hostStaticCount++;
+ }
+ }
+ }
+
+ // Check if all static mappings have been matched
+ if ($this->_staticCount != $hostStaticCount) {
+ return false;
+ }
+
+ $return = $values + $this->_defaults;
+
+ // Check if all map variables have been initialized
+ foreach ($this->_variables as $var) {
+ if (!array_key_exists($var, $return)) {
+ return false;
+ }
+ }
+
+ $this->_values = $values;
+
+ return $return;
+ }
+
+ /**
+ * Assembles user submitted parameters forming a hostname defined by this route
+ *
+ * @param array $data An array of variable and value pairs used as parameters
+ * @param boolean $reset Whether or not to set route defaults with those provided in $data
+ * @param boolean $encode
+ * @param boolean $partial
+ * @throws Zend_Controller_Router_Exception
+ * @return string Route path with user submitted parameters
+ */
+ public function assemble($data = array(), $reset = false, $encode = false, $partial = false)
+ {
+ $host = array();
+ $flag = false;
+
+ foreach ($this->_parts as $key => $part) {
+ $name = isset($this->_variables[$key]) ? $this->_variables[$key] : null;
+
+ $useDefault = false;
+ if (isset($name) && array_key_exists($name, $data) && $data[$name] === null) {
+ $useDefault = true;
+ }
+
+ if (isset($name)) {
+ if (isset($data[$name]) && !$useDefault) {
+ $host[$key] = $data[$name];
+ unset($data[$name]);
+ } elseif (!$reset && !$useDefault && isset($this->_values[$name])) {
+ $host[$key] = $this->_values[$name];
+ } elseif (isset($this->_defaults[$name])) {
+ $host[$key] = $this->_defaults[$name];
+ } else {
+ throw new Zend_Controller_Router_Exception($name . ' is not specified');
+ }
+ } else {
+ $host[$key] = $part;
+ }
+ }
+
+ $return = '';
+
+ foreach (array_reverse($host, true) as $key => $value) {
+ if ($flag || !isset($this->_variables[$key]) || $value !== $this->getDefault($this->_variables[$key])
+ || $partial
+ ) {
+ if ($encode) {
+ $value = urlencode($value);
+ }
+ $return = '.' . $value . $return;
+ $flag = true;
+ }
+ }
+
+ $url = trim($return, '.');
+
+ if ($this->_scheme !== null) {
+ $scheme = $this->_scheme;
+ } else {
+ $request = $this->getRequest();
+ if ($request instanceof Zend_Controller_Request_Http) {
+ $scheme = $request->getScheme();
+ } else {
+ $scheme = 'http';
+ }
+ }
+
+ $url = $scheme . '://' . $url;
+
+ return $url;
+ }
+
+ /**
+ * Return a single parameter of route's defaults
+ *
+ * @param string $name Array key of the parameter
+ * @return string Previously set default
+ */
+ public function getDefault($name)
+ {
+ if (isset($this->_defaults[$name])) {
+ return $this->_defaults[$name];
+ }
+
+ return null;
+ }
+
+ /**
+ * Return an array of defaults
+ *
+ * @return array Route defaults
+ */
+ public function getDefaults()
+ {
+ return $this->_defaults;
+ }
+
+ /**
+ * Get all variables which are used by the route
+ *
+ * @return array
+ */
+ public function getVariables()
+ {
+ return $this->_variables;
+ }
+}
diff --git a/library/vendor/Zend/Controller/Router/Route/Interface.php b/library/vendor/Zend/Controller/Router/Route/Interface.php
new file mode 100644
index 0000000..6a14f9d
--- /dev/null
+++ b/library/vendor/Zend/Controller/Router/Route/Interface.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Config */
+
+/**
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Controller_Router_Route_Interface
+{
+ public function match($path);
+
+ public function assemble($data = array(), $reset = false, $encode = false);
+
+ public static function getInstance(Zend_Config $config);
+} \ No newline at end of file
diff --git a/library/vendor/Zend/Controller/Router/Route/Module.php b/library/vendor/Zend/Controller/Router/Route/Module.php
new file mode 100644
index 0000000..2227495
--- /dev/null
+++ b/library/vendor/Zend/Controller/Router/Route/Module.php
@@ -0,0 +1,322 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Controller_Router_Route_Abstract */
+
+/**
+ * Module Route
+ *
+ * Default route for module functionality
+ *
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @see http://manuals.rubyonrails.com/read/chapter/65
+ */
+class Zend_Controller_Router_Route_Module extends Zend_Controller_Router_Route_Abstract
+{
+
+ /**
+ * Default values for the route (ie. module, controller, action, params)
+ *
+ * @var array
+ */
+ protected $_defaults;
+
+ /**
+ * Default values for the route (ie. module, controller, action, params)
+ *
+ * @var array
+ */
+ protected $_values = array();
+
+ /**
+ * @var boolean
+ */
+ protected $_moduleValid = false;
+
+ /**
+ * @var boolean
+ */
+ protected $_keysSet = false;
+
+ /**#@+
+ * Array keys to use for module, controller, and action. Should be taken out of request.
+ *
+ * @var string
+ */
+ protected $_moduleKey = 'module';
+ protected $_controllerKey = 'controller';
+ protected $_actionKey = 'action';
+ /**#@-*/
+
+ /**
+ * @var Zend_Controller_Dispatcher_Interface
+ */
+ protected $_dispatcher;
+
+ /**
+ * @var Zend_Controller_Request_Abstract
+ */
+ protected $_request;
+
+ /**
+ * Get the version of the route
+ *
+ * @return int
+ */
+ public function getVersion()
+ {
+ return 1;
+ }
+
+ /**
+ * Instantiates route based on passed Zend_Config structure
+ *
+ * @param Zend_Config $config
+ * @return Zend_Controller_Router_Route_Module
+ */
+ public static function getInstance(Zend_Config $config)
+ {
+ $frontController = Zend_Controller_Front::getInstance();
+
+ $defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : array();
+ $dispatcher = $frontController->getDispatcher();
+ $request = $frontController->getRequest();
+
+ return new self($defs, $dispatcher, $request);
+ }
+
+ /**
+ * Constructor
+ *
+ * @param array $defaults Defaults for map variables with keys as variable names
+ * @param Zend_Controller_Dispatcher_Interface $dispatcher Dispatcher object
+ * @param Zend_Controller_Request_Abstract $request Request object
+ */
+ public function __construct(
+ array $defaults = array(),
+ Zend_Controller_Dispatcher_Interface $dispatcher = null,
+ Zend_Controller_Request_Abstract $request = null
+ )
+ {
+ $this->_defaults = $defaults;
+
+ if (isset($request)) {
+ $this->_request = $request;
+ }
+
+ if (isset($dispatcher)) {
+ $this->_dispatcher = $dispatcher;
+ }
+ }
+
+ /**
+ * Set request keys based on values in request object
+ *
+ * @return void
+ */
+ protected function _setRequestKeys()
+ {
+ if (null !== $this->_request) {
+ $this->_moduleKey = $this->_request->getModuleKey();
+ $this->_controllerKey = $this->_request->getControllerKey();
+ $this->_actionKey = $this->_request->getActionKey();
+ }
+
+ if (null !== $this->_dispatcher) {
+ $this->_defaults += array(
+ $this->_controllerKey => $this->_dispatcher->getDefaultControllerName(),
+ $this->_actionKey => $this->_dispatcher->getDefaultAction(),
+ $this->_moduleKey => $this->_dispatcher->getDefaultModule()
+ );
+ }
+
+ $this->_keysSet = true;
+ }
+
+ /**
+ * Matches a user submitted path. Assigns and returns an array of variables
+ * on a successful match.
+ *
+ * If a request object is registered, it uses its setModuleName(),
+ * setControllerName(), and setActionName() accessors to set those values.
+ * Always returns the values as an array.
+ *
+ * @param string $path Path used to match against this routing map
+ * @param boolean $partial
+ * @return array An array of assigned values or a false on a mismatch
+ */
+ public function match($path, $partial = false)
+ {
+ $this->_setRequestKeys();
+
+ $values = array();
+ $params = array();
+
+ if (!$partial) {
+ $path = trim($path, self::URI_DELIMITER);
+ } else {
+ $matchedPath = $path;
+ }
+
+ if ($path != '') {
+ $path = explode(self::URI_DELIMITER, $path);
+
+ if ($this->_dispatcher && $this->_dispatcher->isValidModule($path[0])) {
+ $values[$this->_moduleKey] = array_shift($path);
+ $this->_moduleValid = true;
+ }
+
+ if (count($path) && !empty($path[0])) {
+ $values[$this->_controllerKey] = array_shift($path);
+ }
+
+ if (count($path) && !empty($path[0])) {
+ $values[$this->_actionKey] = array_shift($path);
+ }
+
+ if ($numSegs = count($path)) {
+ for ($i = 0; $i < $numSegs; $i = $i + 2) {
+ $key = urldecode($path[$i]);
+ $val = isset($path[$i + 1]) ? urldecode($path[$i + 1]) : null;
+ $params[$key] = (isset($params[$key]) ? (array_merge((array)$params[$key], array($val))) : $val);
+ }
+ }
+ }
+
+ if ($partial) {
+ $this->setMatchedPath($matchedPath);
+ }
+
+ $this->_values = $values + $params;
+
+ return $this->_values + $this->_defaults;
+ }
+
+ /**
+ * Assembles user submitted parameters forming a URL path defined by this route
+ *
+ * @param array $data An array of variable and value pairs used as parameters
+ * @param boolean $reset Weither to reset the current params
+ * @param boolean $encode
+ * @param boolean $partial
+ * @return string Route path with user submitted parameters
+ */
+ public function assemble($data = array(), $reset = false, $encode = true, $partial = false)
+ {
+ if (!$this->_keysSet) {
+ $this->_setRequestKeys();
+ }
+
+ $params = (!$reset) ? $this->_values : array();
+
+ foreach ($data as $key => $value) {
+ if ($value !== null) {
+ $params[$key] = $value;
+ } elseif (isset($params[$key])) {
+ unset($params[$key]);
+ }
+ }
+
+ $params += $this->_defaults;
+
+ $url = '';
+
+ if ($this->_moduleValid || array_key_exists($this->_moduleKey, $data)) {
+ if ($params[$this->_moduleKey] != $this->_defaults[$this->_moduleKey]) {
+ $module = $params[$this->_moduleKey];
+ }
+ }
+ unset($params[$this->_moduleKey]);
+
+ $controller = $params[$this->_controllerKey];
+ unset($params[$this->_controllerKey]);
+
+ $action = $params[$this->_actionKey];
+ unset($params[$this->_actionKey]);
+
+ foreach ($params as $key => $value) {
+ $key = ($encode) ? urlencode($key) : $key;
+ if (is_array($value)) {
+ foreach ($value as $arrayValue) {
+ $arrayValue = ($encode) ? urlencode($arrayValue) : $arrayValue;
+ $url .= self::URI_DELIMITER . $key;
+ $url .= self::URI_DELIMITER . $arrayValue;
+ }
+ } else {
+ if ($encode) {
+ $value = urlencode($value);
+ }
+ $url .= self::URI_DELIMITER . $key;
+ $url .= self::URI_DELIMITER . $value;
+ }
+ }
+
+ if (!empty($url) || $action !== $this->_defaults[$this->_actionKey]) {
+ if ($encode) {
+ $action = urlencode($action);
+ }
+ $url = self::URI_DELIMITER . $action . $url;
+ }
+
+ if (!empty($url) || $controller !== $this->_defaults[$this->_controllerKey]) {
+ if ($encode) {
+ $controller = urlencode($controller);
+ }
+ $url = self::URI_DELIMITER . $controller . $url;
+ }
+
+ if (isset($module)) {
+ if ($encode) {
+ $module = urlencode($module);
+ }
+ $url = self::URI_DELIMITER . $module . $url;
+ }
+
+ return ltrim($url, self::URI_DELIMITER);
+ }
+
+ /**
+ * Return a single parameter of route's defaults
+ *
+ * @param string $name Array key of the parameter
+ * @return string Previously set default
+ */
+ public function getDefault($name)
+ {
+ if (isset($this->_defaults[$name])) {
+ return $this->_defaults[$name];
+ }
+ }
+
+ /**
+ * Return an array of defaults
+ *
+ * @return array Route defaults
+ */
+ public function getDefaults()
+ {
+ return $this->_defaults;
+ }
+}
diff --git a/library/vendor/Zend/Controller/Router/Route/Regex.php b/library/vendor/Zend/Controller/Router/Route/Regex.php
new file mode 100644
index 0000000..8dea1c0
--- /dev/null
+++ b/library/vendor/Zend/Controller/Router/Route/Regex.php
@@ -0,0 +1,316 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Controller_Router_Route_Abstract */
+
+/**
+ * Regex Route
+ *
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Router_Route_Regex extends Zend_Controller_Router_Route_Abstract
+{
+
+ /**
+ * Regex string
+ *
+ * @var string|null
+ */
+ protected $_regex = null;
+
+ /**
+ * Default values for the route (ie. module, controller, action, params)
+ *
+ * @var array
+ */
+ protected $_defaults = array();
+
+ /**
+ * Reverse
+ *
+ * @var string|null
+ */
+ protected $_reverse = null;
+
+ /**
+ * Map
+ *
+ * @var array
+ */
+ protected $_map = array();
+
+ /**
+ * Values
+ *
+ * @var array
+ */
+ protected $_values = array();
+
+ /**
+ * Instantiates route based on passed Zend_Config structure
+ *
+ * @param Zend_Config $config Configuration object
+ * @return Zend_Controller_Router_Route_Regex
+ */
+ public static function getInstance(Zend_Config $config)
+ {
+ $defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : array();
+ $map = ($config->map instanceof Zend_Config) ? $config->map->toArray() : array();
+ $reverse = (isset($config->reverse)) ? $config->reverse : null;
+
+ return new self($config->route, $defs, $map, $reverse);
+ }
+
+ /**
+ * Constructor
+ *
+ * @param $route
+ * @param array $defaults
+ * @param array $map
+ * @param null $reverse
+ */
+ public function __construct($route, $defaults = array(), $map = array(), $reverse = null)
+ {
+ $this->_regex = $route;
+ $this->_defaults = (array) $defaults;
+ $this->_map = (array) $map;
+ $this->_reverse = $reverse;
+ }
+
+ /**
+ * Get the version of the route
+ *
+ * @return int
+ */
+ public function getVersion()
+ {
+ return 1;
+ }
+
+ /**
+ * Matches a user submitted path with a previously defined route.
+ * Assigns and returns an array of defaults on a successful match.
+ *
+ * @param string $path Path used to match against this routing map
+ * @return array|false An array of assigned values or a false on a mismatch
+ */
+ public function match($path, $partial = false)
+ {
+ if (!$partial) {
+ $path = trim(urldecode($path), self::URI_DELIMITER);
+ $regex = '#^' . $this->_regex . '$#i';
+ } else {
+ $regex = '#^' . $this->_regex . '#i';
+ }
+
+ $res = preg_match($regex, $path, $values);
+
+ if ($res === 0) {
+ return false;
+ }
+
+ if ($partial) {
+ $this->setMatchedPath($values[0]);
+ }
+
+ // array_filter_key()? Why isn't this in a standard PHP function set yet? :)
+ foreach ($values as $i => $value) {
+ if (!is_int($i) || $i === 0) {
+ unset($values[$i]);
+ }
+ }
+
+ $this->_values = $values;
+
+ $values = $this->_getMappedValues($values);
+ $defaults = $this->_getMappedValues($this->_defaults, false, true);
+ $return = $values + $defaults;
+
+ return $return;
+ }
+
+ /**
+ * Maps numerically indexed array values to it's associative mapped counterpart.
+ * Or vice versa. Uses user provided map array which consists of index => name
+ * parameter mapping. If map is not found, it returns original array.
+ *
+ * Method strips destination type of keys form source array. Ie. if source array is
+ * indexed numerically then every associative key will be stripped. Vice versa if reversed
+ * is set to true.
+ *
+ * @param array $values Indexed or associative array of values to map
+ * @param boolean $reversed False means translation of index to association. True means reverse.
+ * @param boolean $preserve Should wrong type of keys be preserved or stripped.
+ * @return array An array of mapped values
+ */
+ protected function _getMappedValues($values, $reversed = false, $preserve = false)
+ {
+ if (count($this->_map) == 0) {
+ return $values;
+ }
+
+ $return = array();
+
+ foreach ($values as $key => $value) {
+ if (is_int($key) && !$reversed) {
+ if (array_key_exists($key, $this->_map)) {
+ $index = $this->_map[$key];
+ } elseif (false === ($index = array_search($key, $this->_map))) {
+ $index = $key;
+ }
+ $return[$index] = $values[$key];
+ } elseif ($reversed) {
+ $index = $key;
+ if (!is_int($key)) {
+ if (array_key_exists($key, $this->_map)) {
+ $index = $this->_map[$key];
+ } else {
+ $index = array_search($key, $this->_map, true);
+ }
+ }
+ if (false !== $index) {
+ $return[$index] = $values[$key];
+ }
+ } elseif ($preserve) {
+ $return[$key] = $value;
+ }
+ }
+
+ return $return;
+ }
+
+ /**
+ * Assembles a URL path defined by this route
+ *
+ * @param array $data An array of name (or index) and value pairs used as parameters
+ * @param boolean $reset
+ * @param boolean $encode
+ * @param boolean $partial
+ * @throws Zend_Controller_Router_Exception
+ * @return string Route path with user submitted parameters
+ */
+ public function assemble($data = array(), $reset = false, $encode = false, $partial = false)
+ {
+ if ($this->_reverse === null) {
+ throw new Zend_Controller_Router_Exception('Cannot assemble. Reversed route is not specified.');
+ }
+
+ $defaultValuesMapped = $this->_getMappedValues($this->_defaults, true, false);
+ $matchedValuesMapped = $this->_getMappedValues($this->_values, true, false);
+ $dataValuesMapped = $this->_getMappedValues($data, true, false);
+
+ // handle resets, if so requested (By null value) to do so
+ if (($resetKeys = array_search(null, $dataValuesMapped, true)) !== false) {
+ foreach ((array)$resetKeys as $resetKey) {
+ if (isset($matchedValuesMapped[$resetKey])) {
+ unset($matchedValuesMapped[$resetKey]);
+ unset($dataValuesMapped[$resetKey]);
+ }
+ }
+ }
+
+ // merge all the data together, first defaults, then values matched, then supplied
+ $mergedData = $defaultValuesMapped;
+ $mergedData = $this->_arrayMergeNumericKeys($mergedData, $matchedValuesMapped);
+ $mergedData = $this->_arrayMergeNumericKeys($mergedData, $dataValuesMapped);
+
+ if ($encode) {
+ foreach ($mergedData as $key => &$value) {
+ $value = urlencode($value);
+ }
+ }
+
+ ksort($mergedData);
+
+ $return = @vsprintf($this->_reverse, $mergedData);
+
+ if ($return === false) {
+ throw new Zend_Controller_Router_Exception('Cannot assemble. Too few arguments?');
+ }
+
+ return $return;
+ }
+
+ /**
+ * Return a single parameter of route's defaults
+ *
+ * @param string $name Array key of the parameter
+ * @return string Previously set default
+ */
+ public function getDefault($name)
+ {
+ if (isset($this->_defaults[$name])) {
+ return $this->_defaults[$name];
+ }
+ }
+
+ /**
+ * Return an array of defaults
+ *
+ * @return array Route defaults
+ */
+ public function getDefaults()
+ {
+ return $this->_defaults;
+ }
+
+ /**
+ * Get all variables which are used by the route
+ *
+ * @return array
+ */
+ public function getVariables()
+ {
+ $variables = array();
+
+ foreach ($this->_map as $key => $value) {
+ if (is_numeric($key)) {
+ $variables[] = $value;
+ } else {
+ $variables[] = $key;
+ }
+ }
+
+ return $variables;
+ }
+
+ /**
+ * _arrayMergeNumericKeys() - allows for a strict key (numeric's included) array_merge.
+ * php's array_merge() lacks the ability to merge with numeric keys.
+ *
+ * @param array $array1
+ * @param array $array2
+ * @return array
+ */
+ protected function _arrayMergeNumericKeys(Array $array1, Array $array2)
+ {
+ $returnArray = $array1;
+ foreach ($array2 as $array2Index => $array2Value) {
+ $returnArray[$array2Index] = $array2Value;
+ }
+
+ return $returnArray;
+ }
+}
diff --git a/library/vendor/Zend/Controller/Router/Route/Static.php b/library/vendor/Zend/Controller/Router/Route/Static.php
new file mode 100644
index 0000000..86363da
--- /dev/null
+++ b/library/vendor/Zend/Controller/Router/Route/Static.php
@@ -0,0 +1,148 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Controller_Router_Route_Abstract */
+
+/**
+ * StaticRoute is used for managing static URIs.
+ *
+ * It's a lot faster compared to the standard Route implementation.
+ *
+ * @package Zend_Controller
+ * @subpackage Router
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Controller_Router_Route_Static extends Zend_Controller_Router_Route_Abstract
+{
+
+ /**
+ * Route
+ *
+ * @var string|null
+ */
+ protected $_route = null;
+
+ /**
+ * Default values for the route (ie. module, controller, action, params)
+ *
+ * @var array
+ */
+ protected $_defaults = array();
+
+ /**
+ * Get the version of the route
+ *
+ * @return int
+ */
+ public function getVersion()
+ {
+ return 1;
+ }
+
+ /**
+ * Instantiates route based on passed Zend_Config structure
+ *
+ * @param Zend_Config $config Configuration object
+ * @return Zend_Controller_Router_Route_Static
+ */
+ public static function getInstance(Zend_Config $config)
+ {
+ $defs = ($config->defaults instanceof Zend_Config) ? $config->defaults->toArray() : array();
+
+ return new self($config->route, $defs);
+ }
+
+ /**
+ * Prepares the route for mapping.
+ *
+ * @param string $route Map used to match with later submitted URL path
+ * @param array $defaults Defaults for map variables with keys as variable names
+ */
+ public function __construct($route, $defaults = array())
+ {
+ $this->_route = trim($route, self::URI_DELIMITER);
+ $this->_defaults = (array) $defaults;
+ }
+
+ /**
+ * Matches a user submitted path with a previously defined route.
+ * Assigns and returns an array of defaults on a successful match.
+ *
+ * @param string $path Path used to match against this routing map
+ * @return array|false An array of assigned values or a false on a mismatch
+ */
+ public function match($path, $partial = false)
+ {
+ if ($partial) {
+ if ((empty($path) && empty($this->_route))
+ || (substr($path, 0, strlen($this->_route)) === $this->_route)
+ ) {
+ $this->setMatchedPath($this->_route);
+
+ return $this->_defaults;
+ }
+ } else {
+ if (trim($path, self::URI_DELIMITER) == $this->_route) {
+ return $this->_defaults;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Assembles a URL path defined by this route
+ *
+ * @param array $data An array of variable and value pairs used as parameters
+ * @return string Route path with user submitted parameters
+ */
+ public function assemble($data = array(), $reset = false, $encode = false, $partial = false)
+ {
+ return $this->_route;
+ }
+
+ /**
+ * Return a single parameter of route's defaults
+ *
+ * @param string $name Array key of the parameter
+ * @return string Previously set default
+ */
+ public function getDefault($name)
+ {
+ if (isset($this->_defaults[$name])) {
+ return $this->_defaults[$name];
+ }
+
+ return null;
+ }
+
+ /**
+ * Return an array of defaults
+ *
+ * @return array Route defaults
+ */
+ public function getDefaults()
+ {
+ return $this->_defaults;
+ }
+}
diff --git a/library/vendor/Zend/Crypt.php b/library/vendor/Zend/Crypt.php
new file mode 100644
index 0000000..391a5fa
--- /dev/null
+++ b/library/vendor/Zend/Crypt.php
@@ -0,0 +1,167 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Crypt
+{
+
+ const TYPE_OPENSSL = 'openssl';
+ const TYPE_HASH = 'hash';
+ const TYPE_MHASH = 'mhash';
+
+ protected static $_type = null;
+
+ /**
+ * @var array
+ */
+ protected static $_supportedAlgosOpenssl = array(
+ 'md2',
+ 'md4',
+ 'mdc2',
+ 'rmd160',
+ 'sha',
+ 'sha1',
+ 'sha224',
+ 'sha256',
+ 'sha384',
+ 'sha512'
+ );
+
+ /**
+ * @var array
+ */
+ protected static $_supportedAlgosMhash = array(
+ 'adler32',
+ 'crc32',
+ 'crc32b',
+ 'gost',
+ 'haval128',
+ 'haval160',
+ 'haval192',
+ 'haval256',
+ 'md4',
+ 'md5',
+ 'ripemd160',
+ 'sha1',
+ 'sha256',
+ 'tiger',
+ 'tiger128',
+ 'tiger160'
+ );
+
+ /**
+ * @param string $algorithm
+ * @param string $data
+ * @param bool $binaryOutput
+ * @return unknown
+ */
+ public static function hash($algorithm, $data, $binaryOutput = false)
+ {
+ $algorithm = strtolower($algorithm);
+ if (function_exists($algorithm)) {
+ return $algorithm($data, $binaryOutput);
+ }
+ self::_detectHashSupport($algorithm);
+ $supportedMethod = '_digest' . ucfirst(self::$_type);
+ $result = self::$supportedMethod($algorithm, $data, $binaryOutput);
+ return $result;
+ }
+
+ /**
+ * @param string $algorithm
+ * @throws Zend_Crypt_Exception
+ */
+ protected static function _detectHashSupport($algorithm)
+ {
+ if (function_exists('hash')) {
+ self::$_type = self::TYPE_HASH;
+ if (in_array($algorithm, hash_algos())) {
+ return;
+ }
+ }
+ if (function_exists('mhash')) {
+ self::$_type = self::TYPE_MHASH;
+ if (in_array($algorithm, self::$_supportedAlgosMhash)) {
+ return;
+ }
+ }
+ if (function_exists('openssl_digest')) {
+ if ($algorithm == 'ripemd160') {
+ $algorithm = 'rmd160';
+ }
+ self::$_type = self::TYPE_OPENSSL;
+ if (in_array($algorithm, self::$_supportedAlgosOpenssl)) {
+ return;
+ }
+ }
+ /**
+ * @see Zend_Crypt_Exception
+ */
+ throw new Zend_Crypt_Exception('\'' . $algorithm . '\' is not supported by any available extension or native function');
+ }
+
+ /**
+ * @param string $algorithm
+ * @param string $data
+ * @param bool $binaryOutput
+ * @return string
+ */
+ protected static function _digestHash($algorithm, $data, $binaryOutput)
+ {
+ return hash($algorithm, $data, $binaryOutput);
+ }
+
+ /**
+ * @param string $algorithm
+ * @param string $data
+ * @param bool $binaryOutput
+ * @return string
+ */
+ protected static function _digestMhash($algorithm, $data, $binaryOutput)
+ {
+ $constant = constant('MHASH_' . strtoupper($algorithm));
+ $binary = mhash($constant, $data);
+ if ($binaryOutput) {
+ return $binary;
+ }
+ return bin2hex($binary);
+ }
+
+ /**
+ * @param string $algorithm
+ * @param string $data
+ * @param bool $binaryOutput
+ * @return string
+ */
+ protected static function _digestOpenssl($algorithm, $data, $binaryOutput)
+ {
+ if ($algorithm == 'ripemd160') {
+ $algorithm = 'rmd160';
+ }
+ return openssl_digest($data, $algorithm, $binaryOutput);
+ }
+
+}
diff --git a/library/vendor/Zend/Crypt/DiffieHellman.php b/library/vendor/Zend/Crypt/DiffieHellman.php
new file mode 100644
index 0000000..851f871
--- /dev/null
+++ b/library/vendor/Zend/Crypt/DiffieHellman.php
@@ -0,0 +1,378 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @subpackage DiffieHellman
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * PHP implementation of the Diffie-Hellman public key encryption algorithm.
+ * Allows two unassociated parties to establish a joint shared secret key
+ * to be used in encrypting subsequent communications.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Crypt_DiffieHellman
+{
+
+ /**
+ * Static flag to select whether to use PHP5.3's openssl extension
+ * if available.
+ *
+ * @var boolean
+ */
+ public static $useOpenssl = true;
+
+ /**
+ * Default large prime number; required by the algorithm.
+ *
+ * @var string
+ */
+ private $_prime = null;
+
+ /**
+ * The default generator number. This number must be greater than 0 but
+ * less than the prime number set.
+ *
+ * @var string
+ */
+ private $_generator = null;
+
+ /**
+ * A private number set by the local user. It's optional and will
+ * be generated if not set.
+ *
+ * @var string
+ */
+ private $_privateKey = null;
+
+ /**
+ * BigInteger support object courtesy of Zend_Crypt_Math
+ *
+ * @var Zend_Crypt_Math_BigInteger
+ */
+ private $_math = null;
+
+ /**
+ * The public key generated by this instance after calling generateKeys().
+ *
+ * @var string
+ */
+ private $_publicKey = null;
+
+ /**
+ * The shared secret key resulting from a completed Diffie Hellman
+ * exchange
+ *
+ * @var string
+ */
+ private $_secretKey = null;
+
+ /**
+ * Constants
+ */
+ const BINARY = 'binary';
+ const NUMBER = 'number';
+ const BTWOC = 'btwoc';
+
+ /**
+ * Constructor; if set construct the object using the parameter array to
+ * set values for Prime, Generator and Private.
+ * If a Private Key is not set, one will be generated at random.
+ *
+ * @param string $prime
+ * @param string $generator
+ * @param string $privateKey
+ * @param string $privateKeyType
+ */
+ public function __construct($prime, $generator, $privateKey = null, $privateKeyType = self::NUMBER)
+ {
+ $this->setPrime($prime);
+ $this->setGenerator($generator);
+ if ($privateKey !== null) {
+ $this->setPrivateKey($privateKey, $privateKeyType);
+ }
+ $this->setBigIntegerMath();
+ }
+
+ /**
+ * Generate own public key. If a private number has not already been
+ * set, one will be generated at this stage.
+ *
+ * @return Zend_Crypt_DiffieHellman
+ */
+ public function generateKeys()
+ {
+ if (function_exists('openssl_dh_compute_key') && self::$useOpenssl !== false) {
+ $details = array();
+ $details['p'] = $this->getPrime();
+ $details['g'] = $this->getGenerator();
+ if ($this->hasPrivateKey()) {
+ $details['priv_key'] = $this->getPrivateKey();
+ }
+ $opensslKeyResource = openssl_pkey_new( array('dh' => $details) );
+ $data = openssl_pkey_get_details($opensslKeyResource);
+ $this->setPrivateKey($data['dh']['priv_key'], self::BINARY);
+ $this->setPublicKey($data['dh']['pub_key'], self::BINARY);
+ } else {
+ // Private key is lazy generated in the absence of PHP 5.3's ext/openssl
+ $publicKey = $this->_math->powmod($this->getGenerator(), $this->getPrivateKey(), $this->getPrime());
+ $this->setPublicKey($publicKey);
+ }
+ return $this;
+ }
+
+ /**
+ * Setter for the value of the public number
+ *
+ * @param string $number
+ * @param string $type
+ * @throws Zend_Crypt_DiffieHellman_Exception
+ * @return Zend_Crypt_DiffieHellman
+ */
+ public function setPublicKey($number, $type = self::NUMBER)
+ {
+ if ($type == self::BINARY) {
+ $number = $this->_math->fromBinary($number);
+ }
+ if (!preg_match("/^\d+$/", $number)) {
+ throw new Zend_Crypt_DiffieHellman_Exception('invalid parameter; not a positive natural number');
+ }
+ $this->_publicKey = (string) $number;
+ return $this;
+ }
+
+ /**
+ * Returns own public key for communication to the second party to this
+ * transaction.
+ *
+ * @param string $type
+ * @throws Zend_Crypt_DiffieHellman_Exception
+ * @return string
+ */
+ public function getPublicKey($type = self::NUMBER)
+ {
+ if ($this->_publicKey === null) {
+ throw new Zend_Crypt_DiffieHellman_Exception('A public key has not yet been generated using a prior call to generateKeys()');
+ }
+ if ($type == self::BINARY) {
+ return $this->_math->toBinary($this->_publicKey);
+ } elseif ($type == self::BTWOC) {
+ return $this->_math->btwoc($this->_math->toBinary($this->_publicKey));
+ }
+ return $this->_publicKey;
+ }
+
+ /**
+ * Compute the shared secret key based on the public key received from the
+ * the second party to this transaction. This should agree to the secret
+ * key the second party computes on our own public key.
+ * Once in agreement, the key is known to only to both parties.
+ * By default, the function expects the public key to be in binary form
+ * which is the typical format when being transmitted.
+ *
+ * If you need the binary form of the shared secret key, call
+ * getSharedSecretKey() with the optional parameter for Binary output.
+ *
+ * @param string $publicKey
+ * @param string $type
+ * @param string $output
+ * @throws Zend_Crypt_DiffieHellman_Exception
+ * @return mixed
+ */
+ public function computeSecretKey($publicKey, $type = self::NUMBER, $output = self::NUMBER)
+ {
+ if ($type == self::BINARY) {
+ $publicKey = $this->_math->fromBinary($publicKey);
+ }
+ if (!preg_match("/^\d+$/", $publicKey)) {
+ throw new Zend_Crypt_DiffieHellman_Exception('invalid parameter; not a positive natural number');
+ }
+ if (function_exists('openssl_dh_compute_key') && self::$useOpenssl !== false) {
+ $this->_secretKey = openssl_dh_compute_key($publicKey, $this->getPublicKey());
+ } else {
+ $this->_secretKey = $this->_math->powmod($publicKey, $this->getPrivateKey(), $this->getPrime());
+ }
+ return $this->getSharedSecretKey($output);
+ }
+
+ /**
+ * Return the computed shared secret key from the DiffieHellman transaction
+ *
+ * @param string $type
+ * @throws Zend_Crypt_DiffieHellman_Exception
+ * @return string
+ */
+ public function getSharedSecretKey($type = self::NUMBER)
+ {
+ if (!isset($this->_secretKey)) {
+ throw new Zend_Crypt_DiffieHellman_Exception('A secret key has not yet been computed; call computeSecretKey()');
+ }
+ if ($type == self::BINARY) {
+ return $this->_math->toBinary($this->_secretKey);
+ } elseif ($type == self::BTWOC) {
+ return $this->_math->btwoc($this->_math->toBinary($this->_secretKey));
+ }
+ return $this->_secretKey;
+ }
+
+ /**
+ * Setter for the value of the prime number
+ *
+ * @param string $number
+ * @throws Zend_Crypt_DiffieHellman_Exception
+ * @return Zend_Crypt_DiffieHellman
+ */
+ public function setPrime($number)
+ {
+ if (!preg_match("/^\d+$/", $number) || $number < 11) {
+ throw new Zend_Crypt_DiffieHellman_Exception('invalid parameter; not a positive natural number or too small: should be a large natural number prime');
+ }
+ $this->_prime = (string) $number;
+ return $this;
+ }
+
+ /**
+ * Getter for the value of the prime number
+ *
+ * @throws Zend_Crypt_DiffieHellman_Exception
+ * @return string
+ */
+ public function getPrime()
+ {
+ if (!isset($this->_prime)) {
+ throw new Zend_Crypt_DiffieHellman_Exception('No prime number has been set');
+ }
+ return $this->_prime;
+ }
+
+ /**
+ * Setter for the value of the generator number
+ *
+ * @param string $number
+ * @throws Zend_Crypt_DiffieHellman_Exception
+ * @return Zend_Crypt_DiffieHellman
+ */
+ public function setGenerator($number)
+ {
+ if (!preg_match("/^\d+$/", $number) || $number < 2) {
+ throw new Zend_Crypt_DiffieHellman_Exception('invalid parameter; not a positive natural number greater than 1');
+ }
+ $this->_generator = (string) $number;
+ return $this;
+ }
+
+ /**
+ * Getter for the value of the generator number
+ *
+ * @throws Zend_Crypt_DiffieHellman_Exception
+ * @return string
+ */
+ public function getGenerator()
+ {
+ if (!isset($this->_generator)) {
+ throw new Zend_Crypt_DiffieHellman_Exception('No generator number has been set');
+ }
+ return $this->_generator;
+ }
+
+ /**
+ * Setter for the value of the private number
+ *
+ * @param string $number
+ * @param string $type
+ * @throws Zend_Crypt_DiffieHellman_Exception
+ * @return Zend_Crypt_DiffieHellman
+ */
+ public function setPrivateKey($number, $type = self::NUMBER)
+ {
+ if ($type == self::BINARY) {
+ $number = $this->_math->fromBinary($number);
+ }
+ if (!preg_match("/^\d+$/", $number)) {
+ throw new Zend_Crypt_DiffieHellman_Exception('invalid parameter; not a positive natural number');
+ }
+ $this->_privateKey = (string) $number;
+ return $this;
+ }
+
+ /**
+ * Getter for the value of the private number
+ *
+ * @param string $type
+ * @return string
+ */
+ public function getPrivateKey($type = self::NUMBER)
+ {
+ if (!$this->hasPrivateKey()) {
+ $this->setPrivateKey($this->_generatePrivateKey(), self::BINARY);
+ }
+ if ($type == self::BINARY) {
+ return $this->_math->toBinary($this->_privateKey);
+ } elseif ($type == self::BTWOC) {
+ return $this->_math->btwoc($this->_math->toBinary($this->_privateKey));
+ }
+ return $this->_privateKey;
+ }
+
+ /**
+ * Check whether a private key currently exists.
+ *
+ * @return boolean
+ */
+ public function hasPrivateKey()
+ {
+ return isset($this->_privateKey);
+ }
+
+ /**
+ * Setter to pass an extension parameter which is used to create
+ * a specific BigInteger instance for a specific extension type.
+ * Allows manual setting of the class in case of an extension
+ * problem or bug.
+ *
+ * @param string $extension
+ * @return void
+ */
+ public function setBigIntegerMath($extension = null)
+ {
+ /**
+ * @see Zend_Crypt_Math
+ */
+ $this->_math = new Zend_Crypt_Math($extension);
+ }
+
+ /**
+ * In the event a private number/key has not been set by the user,
+ * or generated by ext/openssl, a best attempt will be made to
+ * generate a random key. Having a random number generator installed
+ * on linux/bsd is highly recommended! The alternative is not recommended
+ * for production unless without any other option.
+ *
+ * @return string
+ */
+ protected function _generatePrivateKey()
+ {
+ $rand = $this->_math->rand($this->getGenerator(), $this->getPrime());
+ return $rand;
+ }
+
+}
diff --git a/library/vendor/Zend/Crypt/DiffieHellman/Exception.php b/library/vendor/Zend/Crypt/DiffieHellman/Exception.php
new file mode 100644
index 0000000..7a84526
--- /dev/null
+++ b/library/vendor/Zend/Crypt/DiffieHellman/Exception.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @subpackage DiffieHellman
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Crypt_Exception
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Crypt_DiffieHellman_Exception extends Zend_Crypt_Exception
+{
+}
diff --git a/library/vendor/Zend/Crypt/Exception.php b/library/vendor/Zend/Crypt/Exception.php
new file mode 100644
index 0000000..826f9f1
--- /dev/null
+++ b/library/vendor/Zend/Crypt/Exception.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Exception
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Crypt_Exception extends Zend_Exception
+{
+}
diff --git a/library/vendor/Zend/Crypt/Hmac.php b/library/vendor/Zend/Crypt/Hmac.php
new file mode 100644
index 0000000..bd8814d
--- /dev/null
+++ b/library/vendor/Zend/Crypt/Hmac.php
@@ -0,0 +1,178 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @subpackage Hmac
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Crypt
+ */
+
+/**
+ * PHP implementation of the RFC 2104 Hash based Message Authentication Code
+ * algorithm.
+ *
+ * @todo Patch for refactoring failed tests (key block sizes >80 using internal algo)
+ * @todo Check if mhash() is a required alternative (will be PECL-only soon)
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Crypt_Hmac extends Zend_Crypt
+{
+
+ /**
+ * The key to use for the hash
+ *
+ * @var string
+ */
+ protected static $_key = null;
+
+ /**
+ * pack() format to be used for current hashing method
+ *
+ * @var string
+ */
+ protected static $_packFormat = null;
+
+ /**
+ * Hashing algorithm; can be the md5/sha1 functions or any algorithm name
+ * listed in the output of PHP 5.1.2+ hash_algos().
+ *
+ * @var string
+ */
+ protected static $_hashAlgorithm = 'md5';
+
+ /**
+ * List of algorithms supported my mhash()
+ *
+ * @var array
+ */
+ protected static $_supportedMhashAlgorithms = array('adler32',' crc32', 'crc32b', 'gost',
+ 'haval128', 'haval160', 'haval192', 'haval256', 'md4', 'md5', 'ripemd160',
+ 'sha1', 'sha256', 'tiger', 'tiger128', 'tiger160');
+
+ /**
+ * Constants representing the output mode of the hash algorithm
+ */
+ const STRING = 'string';
+ const BINARY = 'binary';
+
+ /**
+ * Performs a HMAC computation given relevant details such as Key, Hashing
+ * algorithm, the data to compute MAC of, and an output format of String,
+ * Binary notation or BTWOC.
+ *
+ * @param string $key
+ * @param string $hash
+ * @param string $data
+ * @param string $output
+ * @throws Zend_Crypt_Hmac_Exception
+ * @return string
+ */
+ public static function compute($key, $hash, $data, $output = self::STRING)
+ {
+ // set the key
+ if (!isset($key) || empty($key)) {
+ throw new Zend_Crypt_Hmac_Exception('provided key is null or empty');
+ }
+ self::$_key = $key;
+
+ // set the hash
+ self::_setHashAlgorithm($hash);
+
+ // perform hashing and return
+ return self::_hash($data, $output);
+ }
+
+ /**
+ * Setter for the hash method.
+ *
+ * @param string $hash
+ * @throws Zend_Crypt_Hmac_Exception
+ * @return Zend_Crypt_Hmac
+ */
+ protected static function _setHashAlgorithm($hash)
+ {
+ if (!isset($hash) || empty($hash)) {
+ throw new Zend_Crypt_Hmac_Exception('provided hash string is null or empty');
+ }
+
+ $hash = strtolower($hash);
+ $hashSupported = false;
+
+ if (function_exists('hash_algos') && in_array($hash, hash_algos())) {
+ $hashSupported = true;
+ }
+
+ if ($hashSupported === false && function_exists('mhash') && in_array($hash, self::$_supportedAlgosMhash)) {
+ $hashSupported = true;
+ }
+
+ if ($hashSupported === false) {
+ throw new Zend_Crypt_Hmac_Exception('hash algorithm provided is not supported on this PHP installation; please enable the hash or mhash extensions');
+ }
+ self::$_hashAlgorithm = $hash;
+ }
+
+ /**
+ * Perform HMAC and return the keyed data
+ *
+ * @param string $data
+ * @param string $output
+ * @param bool $internal Option to not use hash() functions for testing
+ * @return string
+ */
+ protected static function _hash($data, $output = self::STRING, $internal = false)
+ {
+ if (function_exists('hash_hmac')) {
+ if ($output == self::BINARY) {
+ return hash_hmac(self::$_hashAlgorithm, $data, self::$_key, true);
+ }
+ return hash_hmac(self::$_hashAlgorithm, $data, self::$_key);
+ }
+
+ if (function_exists('mhash')) {
+ if ($output == self::BINARY) {
+ return mhash(self::_getMhashDefinition(self::$_hashAlgorithm), $data, self::$_key);
+ }
+ $bin = mhash(self::_getMhashDefinition(self::$_hashAlgorithm), $data, self::$_key);
+ return bin2hex($bin);
+ }
+ }
+
+ /**
+ * Since MHASH accepts an integer constant representing the hash algorithm
+ * we need to make a small detour to get the correct integer matching our
+ * algorithm's name.
+ *
+ * @param string $hashAlgorithm
+ * @return integer
+ */
+ protected static function _getMhashDefinition($hashAlgorithm)
+ {
+ for ($i = 0; $i <= mhash_count(); $i++)
+ {
+ $types[mhash_get_hash_name($i)] = $i;
+ }
+ return $types[strtoupper($hashAlgorithm)];
+ }
+
+}
diff --git a/library/vendor/Zend/Crypt/Hmac/Exception.php b/library/vendor/Zend/Crypt/Hmac/Exception.php
new file mode 100644
index 0000000..9f266e0
--- /dev/null
+++ b/library/vendor/Zend/Crypt/Hmac/Exception.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @subpackage Hmac
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Crypt_Exception
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Crypt_Hmac_Exception extends Zend_Crypt_Exception
+{
+}
diff --git a/library/vendor/Zend/Crypt/Math.php b/library/vendor/Zend/Crypt/Math.php
new file mode 100644
index 0000000..f39ac16
--- /dev/null
+++ b/library/vendor/Zend/Crypt/Math.php
@@ -0,0 +1,186 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @subpackage Math
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Crypt_Math_BigInteger
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Crypt_Math extends Zend_Crypt_Math_BigInteger
+{
+
+ /**
+ * Generate a pseudorandom number within the given range.
+ * Will attempt to read from a systems RNG if it exists or else utilises
+ * a simple random character to maximum length process. Simplicity
+ * is a factor better left for development...
+ *
+ * @param string|int $minimum
+ * @param string|int $maximum
+ * @return string
+ */
+ public function rand($minimum, $maximum)
+ {
+ if (file_exists('/dev/urandom')) {
+ $frandom = fopen('/dev/urandom', 'r');
+ if ($frandom !== false) {
+ return fread($frandom, strlen($maximum) - 1);
+ }
+ }
+ if (strlen($maximum) < 4) {
+ return mt_rand($minimum, $maximum - 1);
+ }
+ $rand = '';
+ $i2 = strlen($maximum) - 1;
+ for ($i = 1; $i < $i2; $i++) {
+ $rand .= mt_rand(0, 9);
+ }
+ $rand .= mt_rand(0, 9);
+ return $rand;
+ }
+
+ /**
+ * Return a random strings of $length bytes
+ *
+ * @param integer $length
+ * @param boolean $strong
+ * @return string
+ */
+ public static function randBytes($length, $strong = false)
+ {
+ $length = (int) $length;
+ if ($length <= 0) {
+ return false;
+ }
+ if (function_exists('random_bytes')) { // available in PHP 7
+ return random_bytes($length);
+ }
+ if (function_exists('mcrypt_create_iv')) {
+ $bytes = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM);
+ if ($bytes !== false && strlen($bytes) === $length) {
+ return $bytes;
+ }
+ }
+ if (file_exists('/dev/urandom') && is_readable('/dev/urandom')) {
+ $frandom = fopen('/dev/urandom', 'r');
+ if ($frandom !== false) {
+ return fread($frandom, $length);
+ }
+ }
+ if (true === $strong) {
+ throw new Zend_Crypt_Exception(
+ 'This PHP environment doesn\'t support secure random number generation. ' .
+ 'Please consider installing the OpenSSL and/or Mcrypt extensions'
+ );
+ }
+ $rand = '';
+ for ($i = 0; $i < $length; $i++) {
+ $rand .= chr(mt_rand(0, 255));
+ }
+ return $rand;
+ }
+
+ /**
+ * Return a random integer between $min and $max
+ *
+ * @param integer $min
+ * @param integer $max
+ * @param boolean $strong
+ * @return integer
+ */
+ public static function randInteger($min, $max, $strong = false)
+ {
+ if ($min > $max) {
+ throw new Zend_Crypt_Exception(
+ 'The min parameter must be lower than max parameter'
+ );
+ }
+ $range = $max - $min;
+ if ($range == 0) {
+ return $max;
+ } elseif ($range > PHP_INT_MAX || is_float($range)) {
+ throw new Zend_Crypt_Exception(
+ 'The supplied range is too great to generate'
+ );
+ }
+ if (function_exists('random_int')) { // available in PHP 7
+ return random_int($min, $max);
+ }
+ // calculate number of bits required to store range on this machine
+ $r = $range;
+ $bits = 0;
+ while ($r) {
+ $bits++;
+ $r >>= 1;
+ }
+ $bits = (int) max($bits, 1);
+ $bytes = (int) max(ceil($bits / 8), 1);
+ $filter = (int) ((1 << $bits) - 1);
+ do {
+ $rnd = hexdec(bin2hex(self::randBytes($bytes, $strong)));
+ $rnd &= $filter;
+ } while ($rnd > $range);
+ return ($min + $rnd);
+ }
+
+ /**
+ * Get the big endian two's complement of a given big integer in
+ * binary notation
+ *
+ * @param string $long
+ * @return string
+ */
+ public function btwoc($long)
+ {
+ if (ord($long[0]) > 127) {
+ return "\x00" . $long;
+ }
+ return $long;
+ }
+
+ /**
+ * Translate a binary form into a big integer string
+ *
+ * @param string $binary
+ * @return string
+ */
+ public function fromBinary($binary)
+ {
+ return $this->_math->binaryToInteger($binary);
+ }
+
+ /**
+ * Translate a big integer string into a binary form
+ *
+ * @param string $integer
+ * @return string
+ */
+ public function toBinary($integer)
+ {
+ return $this->_math->integerToBinary($integer);
+ }
+}
diff --git a/library/vendor/Zend/Crypt/Math/BigInteger.php b/library/vendor/Zend/Crypt/Math/BigInteger.php
new file mode 100644
index 0000000..0b98cec
--- /dev/null
+++ b/library/vendor/Zend/Crypt/Math/BigInteger.php
@@ -0,0 +1,113 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @subpackage Math
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Support for arbitrary precision mathematics in PHP.
+ *
+ * Zend_Crypt_Math_BigInteger is a wrapper across three PHP extensions: bcmath, gmp
+ * and big_int. Since each offer similar functionality, but availability of
+ * each differs across installations of PHP, this wrapper attempts to select
+ * the fastest option available and encapsulate a subset of its functionality
+ * which all extensions share in common.
+ *
+ * This class requires one of the three extensions to be available. BCMATH
+ * while the slowest, is available by default under Windows, and under Unix
+ * if PHP is compiled with the flag "--enable-bcmath". GMP requires the gmp
+ * library from http://www.swox.com/gmp/ and PHP compiled with the "--with-gmp"
+ * flag. BIG_INT support is available from a big_int PHP library available from
+ * only from PECL (a Windows port is not available).
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Crypt_Math_BigInteger
+{
+
+ /**
+ * Holds an instance of one of the three arbitrary precision wrappers.
+ *
+ * @var Zend_Crypt_Math_BigInteger_Interface
+ */
+ protected $_math = null;
+
+ /**
+ * Constructor; a Factory which detects a suitable PHP extension for
+ * arbitrary precision math and instantiates the suitable wrapper
+ * object.
+ *
+ * @param string $extension
+ * @throws Zend_Crypt_Math_BigInteger_Exception
+ */
+ public function __construct($extension = null)
+ {
+ if ($extension !== null && !in_array($extension, array('bcmath', 'gmp', 'bigint'))) {
+ throw new Zend_Crypt_Math_BigInteger_Exception('Invalid extension type; please use one of bcmath, gmp or bigint');
+ }
+ $this->_loadAdapter($extension);
+ }
+
+ /**
+ * Redirect all public method calls to the wrapped extension object.
+ *
+ * @param string $methodName
+ * @param array $args
+ * @return mixed
+ * @throws Zend_Crypt_Math_BigInteger_Exception
+ */
+ public function __call($methodName, $args)
+ {
+ if(!method_exists($this->_math, $methodName)) {
+ throw new Zend_Crypt_Math_BigInteger_Exception('invalid method call: ' . get_class($this->_math) . '::' . $methodName . '() does not exist');
+ }
+ return call_user_func_array(array($this->_math, $methodName), $args);
+ }
+
+ /**
+ * @param string $extension
+ * @throws Zend_Crypt_Math_BigInteger_Exception
+ */
+ protected function _loadAdapter($extension = null)
+ {
+ if ($extension === null) {
+ if (extension_loaded('gmp')) {
+ $extension = 'gmp';
+ //} elseif (extension_loaded('big_int')) {
+ // $extension = 'big_int';
+ } else {
+ $extension = 'bcmath';
+ }
+ }
+ if($extension == 'gmp' && extension_loaded('gmp')) {
+ $this->_math = new Zend_Crypt_Math_BigInteger_Gmp();
+ //} elseif($extension == 'bigint' && extension_loaded('big_int')) {
+ // require_once 'Zend/Crypt_Math/BigInteger/Bigint.php';
+ // $this->_math = new Zend_Crypt_Math_BigInteger_Bigint();
+ } elseif ($extension == 'bcmath' && extension_loaded('bcmath')) {
+ $this->_math = new Zend_Crypt_Math_BigInteger_Bcmath();
+ } else {
+ throw new Zend_Crypt_Math_BigInteger_Exception($extension . ' big integer precision math support not detected');
+ }
+ }
+
+}
diff --git a/library/vendor/Zend/Crypt/Math/BigInteger/Bcmath.php b/library/vendor/Zend/Crypt/Math/BigInteger/Bcmath.php
new file mode 100644
index 0000000..2fb4a67
--- /dev/null
+++ b/library/vendor/Zend/Crypt/Math/BigInteger/Bcmath.php
@@ -0,0 +1,226 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @subpackage Math
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Crypt_Math_BigInteger_Interface
+ */
+
+/**
+ * Support for arbitrary precision mathematics in PHP.
+ *
+ * Zend_Crypt_Math_BigInteger_Bcmath is a wrapper across the PHP BCMath
+ * extension.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Crypt_Math_BigInteger_Bcmath implements Zend_Crypt_Math_BigInteger_Interface
+{
+
+ /**
+ * Initialise a big integer into an extension specific type. This is not
+ * applicable to BCMath.
+ *
+ * @param string $operand
+ * @param int $base
+ * @return string
+ */
+ public function init($operand, $base = 10)
+ {
+ return $operand;
+ }
+
+ /**
+ * Adds two arbitrary precision numbers
+ *
+ * @param string $left_operand
+ * @param string $right_operand
+ * @return string
+ */
+ public function add($left_operand, $right_operand)
+ {
+ return bcadd($left_operand, $right_operand);
+ }
+
+ /**
+ * Subtract one arbitrary precision number from another
+ *
+ * @param string $left_operand
+ * @param string $right_operand
+ * @return string
+ */
+ public function subtract($left_operand, $right_operand)
+ {
+ return bcsub($left_operand, $right_operand);
+ }
+
+ /**
+ * Compare two big integers and returns result as an integer where 0 means
+ * both are identical, 1 that left_operand is larger, or -1 that
+ * right_operand is larger.
+ *
+ * @param string $left_operand
+ * @param string $right_operand
+ * @return int
+ */
+ public function compare($left_operand, $right_operand)
+ {
+ return bccomp($left_operand, $right_operand);
+ }
+
+ /**
+ * Divide two big integers and return result or NULL if the denominator
+ * is zero.
+ *
+ * @param string $left_operand
+ * @param string $right_operand
+ * @return string|null
+ */
+ public function divide($left_operand, $right_operand)
+ {
+ return bcdiv($left_operand, $right_operand);
+ }
+
+ /**
+ * Get modulus of an arbitrary precision number
+ *
+ * @param string $left_operand
+ * @param string $modulus
+ * @return string
+ */
+ public function modulus($left_operand, $modulus)
+ {
+ return bcmod($left_operand, $modulus);
+ }
+
+ /**
+ * Multiply two arbitrary precision numbers
+ *
+ * @param string $left_operand
+ * @param string $right_operand
+ * @return string
+ */
+ public function multiply($left_operand, $right_operand)
+ {
+ return bcmul($left_operand, $right_operand);
+ }
+
+ /**
+ * Raise an arbitrary precision number to another
+ *
+ * @param string $left_operand
+ * @param string $right_operand
+ * @return string
+ */
+ public function pow($left_operand, $right_operand)
+ {
+ return bcpow($left_operand, $right_operand);
+ }
+
+ /**
+ * Raise an arbitrary precision number to another, reduced by a specified
+ * modulus
+ *
+ * @param string $left_operand
+ * @param string $right_operand
+ * @param string $modulus
+ * @return string
+ */
+ public function powmod($left_operand, $right_operand, $modulus)
+ {
+ return bcpowmod($left_operand, $right_operand, $modulus);
+ }
+
+ /**
+ * Get the square root of an arbitrary precision number
+ *
+ * @param string $operand
+ * @return string
+ */
+ public function sqrt($operand)
+ {
+ return bcsqrt($operand);
+ }
+
+ /**
+ * @param string $operand
+ * @return string
+ */
+ public function binaryToInteger($operand)
+ {
+ $result = '0';
+ while (strlen($operand)) {
+ $ord = ord(substr($operand, 0, 1));
+ $result = bcadd(bcmul($result, 256), $ord);
+ $operand = substr($operand, 1);
+ }
+ return $result;
+ }
+
+ /**
+ * @param string $operand
+ * @return string
+ */
+ public function integerToBinary($operand)
+ {
+ $cmp = bccomp($operand, 0);
+ $return = '';
+ if ($cmp == 0) {
+ return "\0";
+ }
+ while (bccomp($operand, 0) > 0) {
+ $return = chr(bcmod($operand, 256)) . $return;
+ $operand = bcdiv($operand, 256);
+ }
+ if (ord($return[0]) > 127) {
+ $return = "\0" . $return;
+ }
+ return $return;
+ }
+
+ /**public function integerToBinary($operand)
+ {
+ $return = '';
+ while(bccomp($operand, '0')) {
+ $return .= chr(bcmod($operand, '256'));
+ $operand = bcdiv($operand, '256');
+ }
+ return $return;
+ }**/ // Prior version for referenced offset
+
+ /**
+ * @param string $operand
+ * @return string
+ */
+ public function hexToDecimal($operand)
+ {
+ $return = '0';
+ while(strlen($hex)) {
+ $hex = hexdec(substr($operand, 0, 4));
+ $dec = bcadd(bcmul($return, 65536), $hex);
+ $operand = substr($operand, 4);
+ }
+ return $return;
+ }
+}
diff --git a/library/vendor/Zend/Crypt/Math/BigInteger/Exception.php b/library/vendor/Zend/Crypt/Math/BigInteger/Exception.php
new file mode 100644
index 0000000..c1c865d
--- /dev/null
+++ b/library/vendor/Zend/Crypt/Math/BigInteger/Exception.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @subpackage Math
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Crypt_Math_Exception
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Crypt_Math_BigInteger_Exception extends Zend_Crypt_Math_Exception
+{
+}
diff --git a/library/vendor/Zend/Crypt/Math/BigInteger/Gmp.php b/library/vendor/Zend/Crypt/Math/BigInteger/Gmp.php
new file mode 100644
index 0000000..1912be7
--- /dev/null
+++ b/library/vendor/Zend/Crypt/Math/BigInteger/Gmp.php
@@ -0,0 +1,219 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @subpackage Math
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Crypt_Math_BigInteger_Interface
+ */
+
+/**
+ * Support for arbitrary precision mathematics in PHP.
+ *
+ * Zend_Crypt_Math_BigInteger_Gmp is a wrapper across the PHP BCMath
+ * extension.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Crypt_Math_BigInteger_Gmp implements Zend_Crypt_Math_BigInteger_Interface
+{
+
+ /**
+ * Initialise a big integer into an extension specific type.
+ * @param string $operand
+ * @param int $base
+ * @return string
+ */
+ public function init($operand, $base = 10)
+ {
+ return $operand;
+ }
+
+ /**
+ * Adds two arbitrary precision numbers
+ *
+ * @param resource $left_operand
+ * @param resource $right_operand
+ * @return string
+ */
+ public function add($left_operand, $right_operand)
+ {
+ $result = gmp_add($left_operand, $right_operand);
+ return gmp_strval($result);
+ }
+
+ /**
+ * Subtract numbers
+ *
+ * @param resource $left_operand
+ * @param resource $right_operand
+ * @return string
+ */
+ public function subtract($left_operand, $right_operand)
+ {
+ $result = gmp_sub($left_operand, $right_operand);
+ return gmp_strval($result);
+ }
+
+ /**
+ * Compare two big integers and returns result as an integer where 0 means
+ * both are identical, 1 that left_operand is larger, or -1 that
+ * right_operand is larger.
+ *
+ * @param resource $left_operand
+ * @param resource $right_operand
+ * @return int
+ */
+ public function compare($left_operand, $right_operand)
+ {
+ $result = gmp_cmp($left_operand, $right_operand);
+ return gmp_strval($result);
+ }
+
+ /**
+ * Divide two big integers and return result or NULL if the denominator
+ * is zero.
+ *
+ * @param resource $left_operand
+ * @param resource $right_operand
+ * @return string|null
+ */
+ public function divide($left_operand, $right_operand)
+ {
+ $result = gmp_div($left_operand, $right_operand);
+ return gmp_strval($result);
+ }
+
+ /**
+ * Modulo operation
+ *
+ * @param resource $left_operand
+ * @param resource $modulus
+ * @internal param string $right_operand
+ * @return string
+ */
+ public function modulus($left_operand, $modulus)
+ {
+ $result = gmp_mod($left_operand, $modulus);
+ return gmp_strval($result);
+ }
+
+ /**
+ * Multiply numbers
+ *
+ * @param resource $left_operand
+ * @param resource $right_operand
+ * @return string
+ */
+ public function multiply($left_operand, $right_operand)
+ {
+ $result = gmp_mul($left_operand, $right_operand);
+ return gmp_strval($result);
+ }
+
+ /**
+ * Raise number into power
+ *
+ * @param resource $left_operand
+ * @param int $right_operand
+ * @return string
+ */
+ public function pow($left_operand, $right_operand)
+ {
+ $result = gmp_pow($left_operand, $right_operand);
+ return gmp_strval($result);
+ }
+
+ /**
+ * Raise number into power with modulo
+ *
+ * @param resource $left_operand
+ * @param resource $right_operand
+ * @param resource $modulus
+ * @return string
+ */
+ public function powmod($left_operand, $right_operand, $modulus)
+ {
+ $result = gmp_powm($left_operand, $right_operand, $modulus);
+ return gmp_strval($result);
+ }
+
+ /**
+ * Calculate square root
+ *
+ * @param $operand
+ * @return string
+ */
+ public function sqrt($operand)
+ {
+ $result = gmp_sqrt($operand);
+ return gmp_strval($result);
+ }
+
+ /**
+ * @param string $operand
+ * @return string
+ */
+ public function binaryToInteger($operand)
+ {
+ $result = '0';
+ while (strlen($operand)) {
+ $ord = ord(substr($operand, 0, 1));
+ $result = gmp_add(gmp_mul($result, 256), $ord);
+ $operand = substr($operand, 1);
+ }
+ return gmp_strval($result);
+ }
+
+ /**
+ * @param resource $operand GMP number resource
+ * @return string
+ */
+ public function integerToBinary($operand)
+ {
+ $bigInt = gmp_strval($operand, 16);
+ if (strlen($bigInt) % 2 != 0) {
+ $bigInt = '0' . $bigInt;
+ } else if ($bigInt[0] > '7') {
+ $bigInt = '00' . $bigInt;
+ }
+ $return = pack("H*", $bigInt);
+ return $return;
+ }
+
+ /**
+ * @param string $operand
+ * @return string
+ */
+ public function hexToDecimal($operand)
+ {
+ $return = '0';
+ while(strlen($hex)) {
+ $hex = hexdec(substr($operand, 0, 4));
+ $dec = gmp_add(gmp_mul($return, 65536), $hex);
+ $operand = substr($operand, 4);
+ }
+ return $return;
+ }
+
+}
diff --git a/library/vendor/Zend/Crypt/Math/BigInteger/Interface.php b/library/vendor/Zend/Crypt/Math/BigInteger/Interface.php
new file mode 100644
index 0000000..9fa9281
--- /dev/null
+++ b/library/vendor/Zend/Crypt/Math/BigInteger/Interface.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @subpackage Math
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Support for arbitrary precision mathematics in PHP.
+ *
+ * Interface for a wrapper across any PHP extension supporting arbitrary
+ * precision maths.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Crypt_Math_BigInteger_Interface
+{
+
+ public function init($operand, $base = 10);
+ public function add($left_operand, $right_operand);
+ public function subtract($left_operand, $right_operand);
+ public function compare($left_operand, $right_operand);
+ public function divide($left_operand, $right_operand);
+ public function modulus($left_operand, $modulus);
+ public function multiply($left_operand, $right_operand);
+ public function pow($left_operand, $right_operand);
+ public function powmod($left_operand, $right_operand, $modulus);
+ public function sqrt($operand);
+ public function binaryToInteger($operand);
+ public function integerToBinary($operand);
+ public function hexToDecimal($operand);
+
+}
diff --git a/library/vendor/Zend/Crypt/Math/Exception.php b/library/vendor/Zend/Crypt/Math/Exception.php
new file mode 100644
index 0000000..066da03
--- /dev/null
+++ b/library/vendor/Zend/Crypt/Math/Exception.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @subpackage Math
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Crypt_Exception
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Crypt_Math_Exception extends Zend_Crypt_Exception
+{
+}
diff --git a/library/vendor/Zend/Crypt/Rsa.php b/library/vendor/Zend/Crypt/Rsa.php
new file mode 100644
index 0000000..2523bbf
--- /dev/null
+++ b/library/vendor/Zend/Crypt/Rsa.php
@@ -0,0 +1,334 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @subpackage Rsa
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Crypt_Rsa_Key_Private
+ */
+
+/**
+ * @see Zend_Crypt_Rsa_Key_Public
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Crypt_Rsa
+{
+
+ const BINARY = 'binary';
+ const BASE64 = 'base64';
+
+ protected $_privateKey;
+
+ protected $_publicKey;
+
+ /**
+ * @var string
+ */
+ protected $_pemString;
+
+ protected $_pemPath;
+
+ protected $_certificateString;
+
+ protected $_certificatePath;
+
+ protected $_hashAlgorithm;
+
+ protected $_passPhrase;
+
+ /**
+ * Class constructor
+ *
+ * @param array $options
+ * @throws Zend_Crypt_Rsa_Exception
+ */
+ public function __construct(array $options = null)
+ {
+ if (!extension_loaded('openssl')) {
+ throw new Zend_Crypt_Rsa_Exception('Zend_Crypt_Rsa requires openssl extension to be loaded.');
+ }
+
+ // Set _hashAlgorithm property when we are sure, that openssl extension is loaded
+ // and OPENSSL_ALGO_SHA1 constant is available
+ $this->_hashAlgorithm = OPENSSL_ALGO_SHA1;
+
+ if (isset($options)) {
+ $this->setOptions($options);
+ }
+ }
+
+ public function setOptions(array $options)
+ {
+ if (isset($options['passPhrase'])) {
+ $this->_passPhrase = $options['passPhrase'];
+ }
+ foreach ($options as $option=>$value) {
+ switch ($option) {
+ case 'pemString':
+ $this->setPemString($value);
+ break;
+ case 'pemPath':
+ $this->setPemPath($value);
+ break;
+ case 'certificateString':
+ $this->setCertificateString($value);
+ break;
+ case 'certificatePath':
+ $this->setCertificatePath($value);
+ break;
+ case 'hashAlgorithm':
+ $this->setHashAlgorithm($value);
+ break;
+ }
+ }
+ }
+
+ public function getPrivateKey()
+ {
+ return $this->_privateKey;
+ }
+
+ public function getPublicKey()
+ {
+ return $this->_publicKey;
+ }
+
+ /**
+ * @param string $data
+ * @param Zend_Crypt_Rsa_Key_Private $privateKey
+ * @param string $format
+ * @return string
+ */
+ public function sign($data, Zend_Crypt_Rsa_Key_Private $privateKey = null, $format = null)
+ {
+ $signature = '';
+ if (isset($privateKey)) {
+ $opensslKeyResource = $privateKey->getOpensslKeyResource();
+ } else {
+ $opensslKeyResource = $this->_privateKey->getOpensslKeyResource();
+ }
+ $result = openssl_sign(
+ $data, $signature,
+ $opensslKeyResource,
+ $this->getHashAlgorithm()
+ );
+ if ($format == self::BASE64) {
+ return base64_encode($signature);
+ }
+ return $signature;
+ }
+
+ /**
+ * @param string $data
+ * @param string $signature
+ * @param string $format
+ * @return string
+ */
+ public function verifySignature($data, $signature, $format = null)
+ {
+ if ($format == self::BASE64) {
+ $signature = base64_decode($signature);
+ }
+ $result = openssl_verify($data, $signature,
+ $this->getPublicKey()->getOpensslKeyResource(),
+ $this->getHashAlgorithm());
+ return $result;
+ }
+
+ /**
+ * @param string $data
+ * @param Zend_Crypt_Rsa_Key $key
+ * @param string $format
+ * @return string
+ */
+ public function encrypt($data, Zend_Crypt_Rsa_Key $key, $format = null)
+ {
+ $encrypted = '';
+ $function = 'openssl_public_encrypt';
+ if ($key instanceof Zend_Crypt_Rsa_Key_Private) {
+ $function = 'openssl_private_encrypt';
+ }
+ $function($data, $encrypted, $key->getOpensslKeyResource());
+ if ($format == self::BASE64) {
+ return base64_encode($encrypted);
+ }
+ return $encrypted;
+ }
+
+ /**
+ * @param string $data
+ * @param Zend_Crypt_Rsa_Key $key
+ * @param string $format
+ * @return string
+ */
+ public function decrypt($data, Zend_Crypt_Rsa_Key $key, $format = null)
+ {
+ $decrypted = '';
+ if ($format == self::BASE64) {
+ $data = base64_decode($data);
+ }
+ $function = 'openssl_private_decrypt';
+ if ($key instanceof Zend_Crypt_Rsa_Key_Public) {
+ $function = 'openssl_public_decrypt';
+ }
+ $function($data, $decrypted, $key->getOpensslKeyResource());
+ return $decrypted;
+ }
+
+ /**
+ * @param array $configargs
+ *
+ * @throws Zend_Crypt_Rsa_Exception
+ *
+ * @return ArrayObject
+ */
+ public function generateKeys(array $configargs = null)
+ {
+ $config = null;
+ $passPhrase = null;
+ if ($configargs !== null) {
+ if (isset($configargs['passPhrase'])) {
+ $passPhrase = $configargs['passPhrase'];
+ unset($configargs['passPhrase']);
+ }
+ $config = $this->_parseConfigArgs($configargs);
+ }
+ $privateKey = null;
+ $publicKey = null;
+ $resource = openssl_pkey_new($config);
+ if (!$resource) {
+ throw new Zend_Crypt_Rsa_Exception('Failed to generate a new private key');
+ }
+ // above fails on PHP 5.3
+ openssl_pkey_export($resource, $private, $passPhrase);
+ $privateKey = new Zend_Crypt_Rsa_Key_Private($private, $passPhrase);
+ $details = openssl_pkey_get_details($resource);
+ $publicKey = new Zend_Crypt_Rsa_Key_Public($details['key']);
+ $return = new ArrayObject(array(
+ 'privateKey'=>$privateKey,
+ 'publicKey'=>$publicKey
+ ), ArrayObject::ARRAY_AS_PROPS);
+ return $return;
+ }
+
+ /**
+ * @param string $value
+ */
+ public function setPemString($value)
+ {
+ $this->_pemString = $value;
+ try {
+ $this->_privateKey = new Zend_Crypt_Rsa_Key_Private($this->_pemString, $this->_passPhrase);
+ $this->_publicKey = $this->_privateKey->getPublicKey();
+ } catch (Zend_Crypt_Exception $e) {
+ $this->_privateKey = null;
+ $this->_publicKey = new Zend_Crypt_Rsa_Key_Public($this->_pemString);
+ }
+ }
+
+ public function setPemPath($value)
+ {
+ $this->_pemPath = $value;
+ $this->setPemString(file_get_contents($this->_pemPath));
+ }
+
+ public function setCertificateString($value)
+ {
+ $this->_certificateString = $value;
+ $this->_publicKey = new Zend_Crypt_Rsa_Key_Public($this->_certificateString, $this->_passPhrase);
+ }
+
+ public function setCertificatePath($value)
+ {
+ $this->_certificatePath = $value;
+ $this->setCertificateString(file_get_contents($this->_certificatePath));
+ }
+
+ public function setHashAlgorithm($name)
+ {
+ switch (strtolower($name)) {
+ case 'md2':
+ $this->_hashAlgorithm = OPENSSL_ALGO_MD2;
+ break;
+ case 'md4':
+ $this->_hashAlgorithm = OPENSSL_ALGO_MD4;
+ break;
+ case 'md5':
+ $this->_hashAlgorithm = OPENSSL_ALGO_MD5;
+ break;
+ case 'sha1':
+ $this->_hashAlgorithm = OPENSSL_ALGO_SHA1;
+ break;
+ case 'dss1':
+ $this->_hashAlgorithm = OPENSSL_ALGO_DSS1;
+ break;
+ }
+ }
+
+ /**
+ * @return string
+ */
+ public function getPemString()
+ {
+ return $this->_pemString;
+ }
+
+ public function getPemPath()
+ {
+ return $this->_pemPath;
+ }
+
+ public function getCertificateString()
+ {
+ return $this->_certificateString;
+ }
+
+ public function getCertificatePath()
+ {
+ return $this->_certificatePath;
+ }
+
+ public function getHashAlgorithm()
+ {
+ return $this->_hashAlgorithm;
+ }
+
+ protected function _parseConfigArgs(array $config = null)
+ {
+ $configs = array();
+ if (isset($config['private_key_bits'])) {
+ $configs['private_key_bits'] = $config['private_key_bits'];
+ }
+ if (isset($config['privateKeyBits'])) {
+ $configs['private_key_bits'] = $config['privateKeyBits'];
+ }
+ if (!empty($configs)) {
+ return $configs;
+ }
+ return null;
+ }
+
+}
diff --git a/library/vendor/Zend/Crypt/Rsa/Exception.php b/library/vendor/Zend/Crypt/Rsa/Exception.php
new file mode 100644
index 0000000..3b3944f
--- /dev/null
+++ b/library/vendor/Zend/Crypt/Rsa/Exception.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @subpackage Math
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id: Exception.php 20096 2010-01-06 02:05:09Z bkarwin $
+ */
+
+/**
+ * @see Zend_Crypt_Exception
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Crypt_Rsa_Exception extends Zend_Crypt_Exception
+{
+}
diff --git a/library/vendor/Zend/Crypt/Rsa/Key.php b/library/vendor/Zend/Crypt/Rsa/Key.php
new file mode 100644
index 0000000..cfd9d15
--- /dev/null
+++ b/library/vendor/Zend/Crypt/Rsa/Key.php
@@ -0,0 +1,94 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @subpackage Rsa
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Crypt_Rsa_Key implements Countable
+{
+ /**
+ * @var string
+ */
+ protected $_pemString = null;
+
+ /**
+ * Bits, key string and type of key
+ *
+ * @var array
+ */
+ protected $_details = array();
+
+ /**
+ * Key Resource
+ *
+ * @var resource
+ */
+ protected $_opensslKeyResource = null;
+
+ /**
+ * Retrieves key resource
+ *
+ * @return resource
+ */
+ public function getOpensslKeyResource()
+ {
+ return $this->_opensslKeyResource;
+ }
+
+ /**
+ * @return string
+ * @throws Zend_Crypt_Exception
+ */
+ public function toString()
+ {
+ if (!empty($this->_pemString)) {
+ return $this->_pemString;
+ } elseif (!empty($this->_certificateString)) {
+ return $this->_certificateString;
+ }
+ /**
+ * @see Zend_Crypt_Exception
+ */
+ throw new Zend_Crypt_Exception('No public key string representation is available');
+ }
+
+ /**
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->toString();
+ }
+
+ public function count()
+ {
+ return $this->_details['bits'];
+ }
+
+ public function getType()
+ {
+ return $this->_details['type'];
+ }
+}
diff --git a/library/vendor/Zend/Crypt/Rsa/Key/Private.php b/library/vendor/Zend/Crypt/Rsa/Key/Private.php
new file mode 100644
index 0000000..b736b58
--- /dev/null
+++ b/library/vendor/Zend/Crypt/Rsa/Key/Private.php
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @subpackage Rsa
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Crypt_Rsa_Key
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Crypt_Rsa_Key_Private extends Zend_Crypt_Rsa_Key
+{
+
+ protected $_publicKey = null;
+
+ public function __construct($pemString, $passPhrase = null)
+ {
+ $this->_pemString = $pemString;
+ $this->_parse($passPhrase);
+ }
+
+ /**
+ * @param string $passPhrase
+ * @throws Zend_Crypt_Exception
+ */
+ protected function _parse($passPhrase)
+ {
+ $result = openssl_get_privatekey($this->_pemString, $passPhrase);
+ if (!$result) {
+ /**
+ * @see Zend_Crypt_Exception
+ */
+ throw new Zend_Crypt_Exception('Unable to load private key');
+ }
+ $this->_opensslKeyResource = $result;
+ $this->_details = openssl_pkey_get_details($this->_opensslKeyResource);
+ }
+
+ public function getPublicKey()
+ {
+ if ($this->_publicKey === null) {
+ /**
+ * @see Zend_Crypt_Rsa_Key_Public
+ */
+ $this->_publicKey = new Zend_Crypt_Rsa_Key_Public($this->_details['key']);
+ }
+ return $this->_publicKey;
+ }
+
+}
diff --git a/library/vendor/Zend/Crypt/Rsa/Key/Public.php b/library/vendor/Zend/Crypt/Rsa/Key/Public.php
new file mode 100644
index 0000000..85b2eb6
--- /dev/null
+++ b/library/vendor/Zend/Crypt/Rsa/Key/Public.php
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Crypt
+ * @subpackage Rsa
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Crypt_Rsa_Key
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Crypt
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Crypt_Rsa_Key_Public extends Zend_Crypt_Rsa_Key
+{
+
+ protected $_certificateString = null;
+
+ public function __construct($string)
+ {
+ $this->_parse($string);
+ }
+
+ /**
+ * @param string $string
+ * @throws Zend_Crypt_Exception
+ */
+ protected function _parse($string)
+ {
+ if (preg_match("/^-----BEGIN CERTIFICATE-----/", $string)) {
+ $this->_certificateString = $string;
+ } else {
+ $this->_pemString = $string;
+ }
+ $result = openssl_get_publickey($string);
+ if (!$result) {
+ /**
+ * @see Zend_Crypt_Exception
+ */
+ throw new Zend_Crypt_Exception('Unable to load public key');
+ }
+ //openssl_pkey_export($result, $public);
+ //$this->_pemString = $public;
+ $this->_opensslKeyResource = $result;
+ $this->_details = openssl_pkey_get_details($this->_opensslKeyResource);
+ }
+
+ public function getCertificate()
+ {
+ return $this->_certificateString;
+ }
+
+}
diff --git a/library/vendor/Zend/Date.php b/library/vendor/Zend/Date.php
new file mode 100644
index 0000000..6223f36
--- /dev/null
+++ b/library/vendor/Zend/Date.php
@@ -0,0 +1,4872 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Date
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Include needed Date classes
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Date
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Date extends Zend_Date_DateObject
+{
+ private $_locale = null;
+
+ // Fractional second variables
+ private $_fractional = 0;
+ private $_precision = 3;
+
+ private static $_options = array(
+ 'format_type' => 'iso', // format for date strings 'iso' or 'php'
+ 'fix_dst' => true, // fix dst on summer/winter time change
+ 'extend_month' => false, // false - addMonth like SQL, true like excel
+ 'cache' => null, // cache to set
+ 'timesync' => null // timesync server to set
+ );
+
+ // Class wide Date Constants
+ const DAY = 'dd';
+ const DAY_SHORT = 'd';
+ const DAY_SUFFIX = 'SS';
+ const DAY_OF_YEAR = 'D';
+ const WEEKDAY = 'EEEE';
+ const WEEKDAY_SHORT = 'EEE';
+ const WEEKDAY_NARROW = 'E';
+ const WEEKDAY_NAME = 'EE';
+ const WEEKDAY_8601 = 'eee';
+ const WEEKDAY_DIGIT = 'e';
+ const WEEK = 'ww';
+ const MONTH = 'MM';
+ const MONTH_SHORT = 'M';
+ const MONTH_DAYS = 'ddd';
+ const MONTH_NAME = 'MMMM';
+ const MONTH_NAME_SHORT = 'MMM';
+ const MONTH_NAME_NARROW = 'MMMMM';
+ const YEAR = 'y';
+ const YEAR_SHORT = 'yy';
+ const YEAR_8601 = 'Y';
+ const YEAR_SHORT_8601 = 'YY';
+ const LEAPYEAR = 'l';
+ const MERIDIEM = 'a';
+ const SWATCH = 'B';
+ const HOUR = 'HH';
+ const HOUR_SHORT = 'H';
+ const HOUR_AM = 'hh';
+ const HOUR_SHORT_AM = 'h';
+ const MINUTE = 'mm';
+ const MINUTE_SHORT = 'm';
+ const SECOND = 'ss';
+ const SECOND_SHORT = 's';
+ const MILLISECOND = 'S';
+ const TIMEZONE_NAME = 'zzzz';
+ const DAYLIGHT = 'I';
+ const GMT_DIFF = 'Z';
+ const GMT_DIFF_SEP = 'ZZZZ';
+ const TIMEZONE = 'z';
+ const TIMEZONE_SECS = 'X';
+ const ISO_8601 = 'c';
+ const RFC_2822 = 'r';
+ const TIMESTAMP = 'U';
+ const ERA = 'G';
+ const ERA_NAME = 'GGGG';
+ const ERA_NARROW = 'GGGGG';
+ const DATES = 'F';
+ const DATE_FULL = 'FFFFF';
+ const DATE_LONG = 'FFFF';
+ const DATE_MEDIUM = 'FFF';
+ const DATE_SHORT = 'FF';
+ const TIMES = 'WW';
+ const TIME_FULL = 'TTTTT';
+ const TIME_LONG = 'TTTT';
+ const TIME_MEDIUM = 'TTT';
+ const TIME_SHORT = 'TT';
+ const DATETIME = 'K';
+ const DATETIME_FULL = 'KKKKK';
+ const DATETIME_LONG = 'KKKK';
+ const DATETIME_MEDIUM = 'KKK';
+ const DATETIME_SHORT = 'KK';
+ const ATOM = 'OOO';
+ const COOKIE = 'CCC';
+ const RFC_822 = 'R';
+ const RFC_850 = 'RR';
+ const RFC_1036 = 'RRR';
+ const RFC_1123 = 'RRRR';
+ const RFC_3339 = 'RRRRR';
+ const RSS = 'SSS';
+ const W3C = 'WWW';
+
+ /**
+ * Generates the standard date object, could be a unix timestamp, localized date,
+ * string, integer, array and so on. Also parts of dates or time are supported
+ * Always set the default timezone: http://php.net/date_default_timezone_set
+ * For example, in your bootstrap: date_default_timezone_set('America/Los_Angeles');
+ * For detailed instructions please look in the docu.
+ *
+ * @param string|integer|Zend_Date|array $date OPTIONAL Date value or value of date part to set
+ * ,depending on $part. If null the actual time is set
+ * @param string $part OPTIONAL Defines the input format of $date
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date
+ * @throws Zend_Date_Exception
+ */
+ public function __construct($date = null, $part = null, $locale = null)
+ {
+ if (is_object($date) and !($date instanceof Zend_TimeSync_Protocol) and
+ !($date instanceof Zend_Date)) {
+ if ($locale instanceof Zend_Locale) {
+ $locale = $date;
+ $date = null;
+ $part = null;
+ } else {
+ $date = (string) $date;
+ }
+ }
+
+ if (($date !== null) and !is_array($date) and !($date instanceof Zend_TimeSync_Protocol) and
+ !($date instanceof Zend_Date) and !defined($date) and Zend_Locale::isLocale($date, true, false)) {
+ $locale = $date;
+ $date = null;
+ $part = null;
+ } else if (($part !== null) and !defined($part) and Zend_Locale::isLocale($part, true, false)) {
+ $locale = $part;
+ $part = null;
+ }
+
+ $this->setLocale($locale);
+ if (is_string($date) && ($part === null) && (strlen($date) <= 5)) {
+ $part = $date;
+ $date = null;
+ }
+
+ if ($date === null) {
+ if ($part === null) {
+ $date = time();
+ } else if ($part !== self::TIMESTAMP) {
+ $date = self::now($locale);
+ $date = $date->get($part);
+ }
+ }
+
+ if ($date instanceof Zend_TimeSync_Protocol) {
+ $date = $date->getInfo();
+ $date = $this->_getTime($date['offset']);
+ $part = null;
+ } else if (parent::$_defaultOffset != 0) {
+ $date = $this->_getTime(parent::$_defaultOffset);
+ }
+
+ // set the timezone and offset for $this
+ $zone = @date_default_timezone_get();
+ $this->setTimezone($zone);
+
+ // try to get timezone from date-string
+ if (!is_int($date)) {
+ $zone = $this->getTimezoneFromString($date);
+ $this->setTimezone($zone);
+ }
+
+ // set datepart
+ if (($part !== null && $part !== self::TIMESTAMP) or (!is_numeric($date))) {
+ // switch off dst handling for value setting
+ $this->setUnixTimestamp($this->getGmtOffset());
+ $this->set($date, $part, $this->_locale);
+
+ // DST fix
+ if (is_array($date) === true) {
+ if (!isset($date['hour'])) {
+ $date['hour'] = 0;
+ }
+
+ $hour = $this->toString('H', 'iso', true);
+ $hour = $date['hour'] - $hour;
+ switch ($hour) {
+ case 1 :
+ case -23 :
+ $this->addTimestamp(3600);
+ break;
+ case -1 :
+ case 23 :
+ $this->subTimestamp(3600);
+ break;
+ case 2 :
+ case -22 :
+ $this->addTimestamp(7200);
+ break;
+ case -2 :
+ case 22 :
+ $this->subTimestamp(7200);
+ break;
+ }
+ }
+ } else {
+ $this->setUnixTimestamp($date);
+ }
+ }
+
+ /**
+ * Sets class wide options, if no option was given, the actual set options will be returned
+ *
+ * @param array $options Options to set
+ * @throws Zend_Date_Exception
+ * @return Options array if no option was given
+ */
+ public static function setOptions(array $options = array())
+ {
+ if (empty($options)) {
+ return self::$_options;
+ }
+
+ foreach ($options as $name => $value) {
+ $name = strtolower($name);
+
+ if (array_key_exists($name, self::$_options)) {
+ switch($name) {
+ case 'format_type' :
+ if ((strtolower($value) != 'php') && (strtolower($value) != 'iso')) {
+ throw new Zend_Date_Exception("Unknown format type ($value) for dates, only 'iso' and 'php' supported", 0, null, $value);
+ }
+ break;
+ case 'fix_dst' :
+ if (!is_bool($value)) {
+ throw new Zend_Date_Exception("'fix_dst' has to be boolean", 0, null, $value);
+ }
+ break;
+ case 'extend_month' :
+ if (!is_bool($value)) {
+ throw new Zend_Date_Exception("'extend_month' has to be boolean", 0, null, $value);
+ }
+ break;
+ case 'cache' :
+ if ($value === null) {
+ parent::$_cache = null;
+ } else {
+ if (!$value instanceof Zend_Cache_Core) {
+ throw new Zend_Date_Exception("Instance of Zend_Cache expected");
+ }
+
+ parent::$_cache = $value;
+ parent::$_cacheTags = Zend_Date_DateObject::_getTagSupportForCache();
+ Zend_Locale_Data::setCache($value);
+ }
+ break;
+ case 'timesync' :
+ if ($value === null) {
+ parent::$_defaultOffset = 0;
+ } else {
+ if (!$value instanceof Zend_TimeSync_Protocol) {
+ throw new Zend_Date_Exception("Instance of Zend_TimeSync expected");
+ }
+
+ $date = $value->getInfo();
+ parent::$_defaultOffset = $date['offset'];
+ }
+ break;
+ }
+ self::$_options[$name] = $value;
+ }
+ else {
+ throw new Zend_Date_Exception("Unknown option: $name = $value");
+ }
+ }
+ }
+
+ /**
+ * Returns this object's internal UNIX timestamp (equivalent to Zend_Date::TIMESTAMP).
+ * If the timestamp is too large for integers, then the return value will be a string.
+ * This function does not return the timestamp as an object.
+ * Use clone() or copyPart() instead.
+ *
+ * @return integer|string UNIX timestamp
+ */
+ public function getTimestamp()
+ {
+ return $this->getUnixTimestamp();
+ }
+
+ /**
+ * Returns the calculated timestamp
+ * HINT: timestamps are always GMT
+ *
+ * @param string $calc Type of calculation to make
+ * @param string|integer|array|Zend_Date $stamp Timestamp to calculate, when null the actual timestamp is calculated
+ * @return Zend_Date|integer
+ * @throws Zend_Date_Exception
+ */
+ private function _timestamp($calc, $stamp)
+ {
+ if ($stamp instanceof Zend_Date) {
+ // extract timestamp from object
+ $stamp = $stamp->getTimestamp();
+ }
+
+ if (is_array($stamp)) {
+ if (isset($stamp['timestamp']) === true) {
+ $stamp = $stamp['timestamp'];
+ } else {
+ throw new Zend_Date_Exception('no timestamp given in array');
+ }
+ }
+
+ if ($calc === 'set') {
+ $return = $this->setUnixTimestamp($stamp);
+ } else {
+ $return = $this->_calcdetail($calc, $stamp, self::TIMESTAMP, null);
+ }
+ if ($calc != 'cmp') {
+ return $this;
+ }
+ return $return;
+ }
+
+ /**
+ * Sets a new timestamp
+ *
+ * @param integer|string|array|Zend_Date $timestamp Timestamp to set
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function setTimestamp($timestamp)
+ {
+ return $this->_timestamp('set', $timestamp);
+ }
+
+ /**
+ * Adds a timestamp
+ *
+ * @param integer|string|array|Zend_Date $timestamp Timestamp to add
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function addTimestamp($timestamp)
+ {
+ return $this->_timestamp('add', $timestamp);
+ }
+
+ /**
+ * Subtracts a timestamp
+ *
+ * @param integer|string|array|Zend_Date $timestamp Timestamp to sub
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function subTimestamp($timestamp)
+ {
+ return $this->_timestamp('sub', $timestamp);
+ }
+
+ /**
+ * Compares two timestamps, returning the difference as integer
+ *
+ * @param integer|string|array|Zend_Date $timestamp Timestamp to compare
+ * @return integer 0 = equal, 1 = later, -1 = earlier
+ * @throws Zend_Date_Exception
+ */
+ public function compareTimestamp($timestamp)
+ {
+ return $this->_timestamp('cmp', $timestamp);
+ }
+
+ /**
+ * Returns a string representation of the object
+ * Supported format tokens are:
+ * G - era, y - year, Y - ISO year, M - month, w - week of year, D - day of year, d - day of month
+ * E - day of week, e - number of weekday (1-7), h - hour 1-12, H - hour 0-23, m - minute, s - second
+ * A - milliseconds of day, z - timezone, Z - timezone offset, S - fractional second, a - period of day
+ *
+ * Additionally format tokens but non ISO conform are:
+ * SS - day suffix, eee - php number of weekday(0-6), ddd - number of days per month
+ * l - Leap year, B - swatch internet time, I - daylight saving time, X - timezone offset in seconds
+ * r - RFC2822 format, U - unix timestamp
+ *
+ * Not supported ISO tokens are
+ * u - extended year, Q - quarter, q - quarter, L - stand alone month, W - week of month
+ * F - day of week of month, g - modified julian, c - stand alone weekday, k - hour 0-11, K - hour 1-24
+ * v - wall zone
+ *
+ * @param string $format OPTIONAL Rule for formatting output. If null the default date format is used
+ * @param string $type OPTIONAL Type for the format string which overrides the standard setting
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return string
+ */
+ public function toString($format = null, $type = null, $locale = null)
+ {
+ if (is_object($format)) {
+ if ($format instanceof Zend_Locale) {
+ $locale = $format;
+ $format = null;
+ } else {
+ $format = (string) $format;
+ }
+ }
+
+ if (is_object($type)) {
+ if ($type instanceof Zend_Locale) {
+ $locale = $type;
+ $type = null;
+ } else {
+ $type = (string) $type;
+ }
+ }
+
+ if (($format !== null) && !defined($format)
+ && ($format != 'ee') && ($format != 'ss') && ($format != 'GG') && ($format != 'MM') && ($format != 'EE') && ($format != 'TT')
+ && Zend_Locale::isLocale($format, null, false)) {
+ $locale = $format;
+ $format = null;
+ }
+
+ if (($type !== null) and ($type != 'php') and ($type != 'iso') and
+ Zend_Locale::isLocale($type, null, false)) {
+ $locale = $type;
+ $type = null;
+ }
+
+ if ($locale === null) {
+ $locale = $this->getLocale();
+ }
+
+ if ($format === null) {
+ $format = Zend_Locale_Format::getDateFormat($locale) . ' ' . Zend_Locale_Format::getTimeFormat($locale);
+ } else if (((self::$_options['format_type'] == 'php') && ($type === null)) or ($type == 'php')) {
+ $format = Zend_Locale_Format::convertPhpToIsoFormat($format);
+ }
+
+ return $this->date($this->_toToken($format, $locale), $this->getUnixTimestamp(), false);
+ }
+
+ /**
+ * Returns a string representation of the date which is equal with the timestamp
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->toString(null, $this->_locale);
+ }
+
+ /**
+ * Returns a integer representation of the object
+ * But returns false when the given part is no value f.e. Month-Name
+ *
+ * @param string|integer|Zend_Date $part OPTIONAL Defines the date or datepart to return as integer
+ * @return integer|false
+ */
+ public function toValue($part = null)
+ {
+ $result = $this->get($part);
+ if (is_numeric($result)) {
+ return intval("$result");
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Returns an array representation of the object
+ *
+ * @return array
+ */
+ public function toArray()
+ {
+ return array('day' => $this->toString(self::DAY_SHORT, 'iso'),
+ 'month' => $this->toString(self::MONTH_SHORT, 'iso'),
+ 'year' => $this->toString(self::YEAR, 'iso'),
+ 'hour' => $this->toString(self::HOUR_SHORT, 'iso'),
+ 'minute' => $this->toString(self::MINUTE_SHORT, 'iso'),
+ 'second' => $this->toString(self::SECOND_SHORT, 'iso'),
+ 'timezone' => $this->toString(self::TIMEZONE, 'iso'),
+ 'timestamp' => $this->toString(self::TIMESTAMP, 'iso'),
+ 'weekday' => $this->toString(self::WEEKDAY_8601, 'iso'),
+ 'dayofyear' => $this->toString(self::DAY_OF_YEAR, 'iso'),
+ 'week' => $this->toString(self::WEEK, 'iso'),
+ 'gmtsecs' => $this->toString(self::TIMEZONE_SECS, 'iso'));
+ }
+
+ /**
+ * Returns a representation of a date or datepart
+ * This could be for example a localized monthname, the time without date,
+ * the era or only the fractional seconds. There are about 50 different supported date parts.
+ * For a complete list of supported datepart values look into the docu
+ *
+ * @param string $part OPTIONAL Part of the date to return, if null the timestamp is returned
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return string date or datepart
+ */
+ public function get($part = null, $locale = null)
+ {
+ if ($locale === null) {
+ $locale = $this->getLocale();
+ }
+
+ if (($part !== null) && !defined($part)
+ && ($part != 'ee') && ($part != 'ss') && ($part != 'GG') && ($part != 'MM') && ($part != 'EE') && ($part != 'TT')
+ && Zend_Locale::isLocale($part, null, false)) {
+ $locale = $part;
+ $part = null;
+ }
+
+ if ($part === null) {
+ $part = self::TIMESTAMP;
+ } else if (self::$_options['format_type'] == 'php') {
+ $part = Zend_Locale_Format::convertPhpToIsoFormat($part);
+ }
+
+ return $this->date($this->_toToken($part, $locale), $this->getUnixTimestamp(), false);
+ }
+
+ /**
+ * Internal method to apply tokens
+ *
+ * @param string $part
+ * @param string $locale
+ * @return string
+ */
+ private function _toToken($part, $locale) {
+ // get format tokens
+ $comment = false;
+ $format = '';
+ $orig = '';
+ for ($i = 0; isset($part[$i]); ++$i) {
+ if ($part[$i] == "'") {
+ $comment = $comment ? false : true;
+ if (isset($part[$i+1]) && ($part[$i+1] == "'")) {
+ $comment = $comment ? false : true;
+ $format .= "\\'";
+ ++$i;
+ }
+
+ $orig = '';
+ continue;
+ }
+
+ if ($comment) {
+ $format .= '\\' . $part[$i];
+ $orig = '';
+ } else {
+ $orig .= $part[$i];
+ if (!isset($part[$i+1]) || (isset($orig[0]) && ($orig[0] != $part[$i+1]))) {
+ $format .= $this->_parseIsoToDate($orig, $locale);
+ $orig = '';
+ }
+ }
+ }
+
+ return $format;
+ }
+
+ /**
+ * Internal parsing method
+ *
+ * @param string $token
+ * @param string $locale
+ * @return string
+ */
+ private function _parseIsoToDate($token, $locale) {
+ switch($token) {
+ case self::DAY :
+ return 'd';
+ break;
+
+ case self::WEEKDAY_SHORT :
+ $weekday = strtolower($this->date('D', $this->getUnixTimestamp(), false));
+ $day = Zend_Locale_Data::getContent($locale, 'day', array('gregorian', 'format', 'wide', $weekday));
+ return $this->_toComment(iconv_substr($day, 0, 3, 'UTF-8'));
+ break;
+
+ case self::DAY_SHORT :
+ return 'j';
+ break;
+
+ case self::WEEKDAY :
+ $weekday = strtolower($this->date('D', $this->getUnixTimestamp(), false));
+ return $this->_toComment(Zend_Locale_Data::getContent($locale, 'day', array('gregorian', 'format', 'wide', $weekday)));
+ break;
+
+ case self::WEEKDAY_8601 :
+ return 'N';
+ break;
+
+ case 'ee' :
+ return $this->_toComment(str_pad($this->date('N', $this->getUnixTimestamp(), false), 2, '0', STR_PAD_LEFT));
+ break;
+
+ case self::DAY_SUFFIX :
+ return 'S';
+ break;
+
+ case self::WEEKDAY_DIGIT :
+ return 'w';
+ break;
+
+ case self::DAY_OF_YEAR :
+ return 'z';
+ break;
+
+ case 'DDD' :
+ return $this->_toComment(str_pad($this->date('z', $this->getUnixTimestamp(), false), 3, '0', STR_PAD_LEFT));
+ break;
+
+ case 'DD' :
+ return $this->_toComment(str_pad($this->date('z', $this->getUnixTimestamp(), false), 2, '0', STR_PAD_LEFT));
+ break;
+
+ case self::WEEKDAY_NARROW :
+ case 'EEEEE' :
+ $weekday = strtolower($this->date('D', $this->getUnixTimestamp(), false));
+ $day = Zend_Locale_Data::getContent($locale, 'day', array('gregorian', 'format', 'abbreviated', $weekday));
+ return $this->_toComment(iconv_substr($day, 0, 1, 'UTF-8'));
+ break;
+
+ case self::WEEKDAY_NAME :
+ $weekday = strtolower($this->date('D', $this->getUnixTimestamp(), false));
+ return $this->_toComment(Zend_Locale_Data::getContent($locale, 'day', array('gregorian', 'format', 'abbreviated', $weekday)));
+ break;
+
+ case 'w' :
+ $week = $this->date('W', $this->getUnixTimestamp(), false);
+ return $this->_toComment(($week[0] == '0') ? $week[1] : $week);
+ break;
+
+ case self::WEEK :
+ return 'W';
+ break;
+
+ case self::MONTH_NAME :
+ $month = $this->date('n', $this->getUnixTimestamp(), false);
+ return $this->_toComment(Zend_Locale_Data::getContent($locale, 'month', array('gregorian', 'format', 'wide', $month)));
+ break;
+
+ case self::MONTH :
+ return 'm';
+ break;
+
+ case self::MONTH_NAME_SHORT :
+ $month = $this->date('n', $this->getUnixTimestamp(), false);
+ return $this->_toComment(Zend_Locale_Data::getContent($locale, 'month', array('gregorian', 'format', 'abbreviated', $month)));
+ break;
+
+ case self::MONTH_SHORT :
+ return 'n';
+ break;
+
+ case self::MONTH_DAYS :
+ return 't';
+ break;
+
+ case self::MONTH_NAME_NARROW :
+ $month = $this->date('n', $this->getUnixTimestamp(), false);
+ $mon = Zend_Locale_Data::getContent($locale, 'month', array('gregorian', 'format', 'abbreviated', $month));
+ return $this->_toComment(iconv_substr($mon, 0, 1, 'UTF-8'));
+ break;
+
+ case self::LEAPYEAR :
+ return 'L';
+ break;
+
+ case self::YEAR_8601 :
+ return 'o';
+ break;
+
+ case self::YEAR :
+ return 'Y';
+ break;
+
+ case self::YEAR_SHORT :
+ return 'y';
+ break;
+
+ case self::YEAR_SHORT_8601 :
+ return $this->_toComment(substr($this->date('o', $this->getUnixTimestamp(), false), -2, 2));
+ break;
+
+ case self::MERIDIEM :
+ $am = $this->date('a', $this->getUnixTimestamp(), false);
+ if ($am == 'am') {
+ return $this->_toComment(Zend_Locale_Data::getContent($locale, 'am'));
+ }
+
+ return $this->_toComment(Zend_Locale_Data::getContent($locale, 'pm'));
+ break;
+
+ case self::SWATCH :
+ return 'B';
+ break;
+
+ case self::HOUR_SHORT_AM :
+ return 'g';
+ break;
+
+ case self::HOUR_SHORT :
+ return 'G';
+ break;
+
+ case self::HOUR_AM :
+ return 'h';
+ break;
+
+ case self::HOUR :
+ return 'H';
+ break;
+
+ case self::MINUTE :
+ return $this->_toComment(str_pad($this->date('i', $this->getUnixTimestamp(), false), 2, '0', STR_PAD_LEFT));
+ break;
+
+ case self::SECOND :
+ return $this->_toComment(str_pad($this->date('s', $this->getUnixTimestamp(), false), 2, '0', STR_PAD_LEFT));
+ break;
+
+ case self::MINUTE_SHORT :
+ return 'i';
+ break;
+
+ case self::SECOND_SHORT :
+ return 's';
+ break;
+
+ case self::MILLISECOND :
+ return $this->_toComment($this->getMilliSecond());
+ break;
+
+ case self::TIMEZONE_NAME :
+ case 'vvvv' :
+ return 'e';
+ break;
+
+ case self::DAYLIGHT :
+ return 'I';
+ break;
+
+ case self::GMT_DIFF :
+ case 'ZZ' :
+ case 'ZZZ' :
+ return 'O';
+ break;
+
+ case self::GMT_DIFF_SEP :
+ return 'P';
+ break;
+
+ case self::TIMEZONE :
+ case 'v' :
+ case 'zz' :
+ case 'zzz' :
+ return 'T';
+ break;
+
+ case self::TIMEZONE_SECS :
+ return 'Z';
+ break;
+
+ case self::ISO_8601 :
+ return 'c';
+ break;
+
+ case self::RFC_2822 :
+ return 'r';
+ break;
+
+ case self::TIMESTAMP :
+ return 'U';
+ break;
+
+ case self::ERA :
+ case 'GG' :
+ case 'GGG' :
+ $year = $this->date('Y', $this->getUnixTimestamp(), false);
+ if ($year < 0) {
+ return $this->_toComment(Zend_Locale_Data::getContent($locale, 'era', array('gregorian', 'Abbr', '0')));
+ }
+
+ return $this->_toComment(Zend_Locale_Data::getContent($locale, 'era', array('gregorian', 'Abbr', '1')));
+ break;
+
+ case self::ERA_NARROW :
+ $year = $this->date('Y', $this->getUnixTimestamp(), false);
+ if ($year < 0) {
+ return $this->_toComment(iconv_substr(Zend_Locale_Data::getContent($locale, 'era', array('gregorian', 'Abbr', '0')), 0, 1, 'UTF-8')) . '.';
+ }
+
+ return $this->_toComment(iconv_substr(Zend_Locale_Data::getContent($locale, 'era', array('gregorian', 'Abbr', '1')), 0, 1, 'UTF-8')) . '.';
+ break;
+
+ case self::ERA_NAME :
+ $year = $this->date('Y', $this->getUnixTimestamp(), false);
+ if ($year < 0) {
+ return $this->_toComment(Zend_Locale_Data::getContent($locale, 'era', array('gregorian', 'Names', '0')));
+ }
+
+ return $this->_toComment(Zend_Locale_Data::getContent($locale, 'era', array('gregorian', 'Names', '1')));
+ break;
+
+ case self::DATES :
+ return $this->_toToken(Zend_Locale_Format::getDateFormat($locale), $locale);
+ break;
+
+ case self::DATE_FULL :
+ return $this->_toToken(Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'full')), $locale);
+ break;
+
+ case self::DATE_LONG :
+ return $this->_toToken(Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'long')), $locale);
+ break;
+
+ case self::DATE_MEDIUM :
+ return $this->_toToken(Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'medium')), $locale);
+ break;
+
+ case self::DATE_SHORT :
+ return $this->_toToken(Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'short')), $locale);
+ break;
+
+ case self::TIMES :
+ return $this->_toToken(Zend_Locale_Format::getTimeFormat($locale), $locale);
+ break;
+
+ case self::TIME_FULL :
+ return $this->_toToken(Zend_Locale_Data::getContent($locale, 'time', 'full'), $locale);
+ break;
+
+ case self::TIME_LONG :
+ return $this->_toToken(Zend_Locale_Data::getContent($locale, 'time', 'long'), $locale);
+ break;
+
+ case self::TIME_MEDIUM :
+ return $this->_toToken(Zend_Locale_Data::getContent($locale, 'time', 'medium'), $locale);
+ break;
+
+ case self::TIME_SHORT :
+ return $this->_toToken(Zend_Locale_Data::getContent($locale, 'time', 'short'), $locale);
+ break;
+
+ case self::DATETIME :
+ return $this->_toToken(Zend_Locale_Format::getDateTimeFormat($locale), $locale);
+ break;
+
+ case self::DATETIME_FULL :
+ return $this->_toToken(Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'full')), $locale);
+ break;
+
+ case self::DATETIME_LONG :
+ return $this->_toToken(Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'long')), $locale);
+ break;
+
+ case self::DATETIME_MEDIUM :
+ return $this->_toToken(Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'medium')), $locale);
+ break;
+
+ case self::DATETIME_SHORT :
+ return $this->_toToken(Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'short')), $locale);
+ break;
+
+ case self::ATOM :
+ return 'Y\-m\-d\TH\:i\:sP';
+ break;
+
+ case self::COOKIE :
+ return 'l\, d\-M\-y H\:i\:s e';
+ break;
+
+ case self::RFC_822 :
+ return 'D\, d M y H\:i\:s O';
+ break;
+
+ case self::RFC_850 :
+ return 'l\, d\-M\-y H\:i\:s e';
+ break;
+
+ case self::RFC_1036 :
+ return 'D\, d M y H\:i\:s O';
+ break;
+
+ case self::RFC_1123 :
+ return 'D\, d M Y H\:i\:s O';
+ break;
+
+ case self::RFC_3339 :
+ return 'Y\-m\-d\TH\:i\:sP';
+ break;
+
+ case self::RSS :
+ return 'D\, d M Y H\:i\:s O';
+ break;
+
+ case self::W3C :
+ return 'Y\-m\-d\TH\:i\:sP';
+ break;
+ }
+
+ if ($token == '') {
+ return '';
+ }
+
+ switch ($token[0]) {
+ case 'y' :
+ if ((strlen($token) == 4) && (abs($this->getUnixTimestamp()) <= 0x7FFFFFFF)) {
+ return 'Y';
+ }
+
+ $length = iconv_strlen($token, 'UTF-8');
+ return $this->_toComment(str_pad($this->date('Y', $this->getUnixTimestamp(), false), $length, '0', STR_PAD_LEFT));
+ break;
+
+ case 'Y' :
+ if ((strlen($token) == 4) && (abs($this->getUnixTimestamp()) <= 0x7FFFFFFF)) {
+ return 'o';
+ }
+
+ $length = iconv_strlen($token, 'UTF-8');
+ return $this->_toComment(str_pad($this->date('o', $this->getUnixTimestamp(), false), $length, '0', STR_PAD_LEFT));
+ break;
+
+ case 'A' :
+ $length = iconv_strlen($token, 'UTF-8');
+ $result = substr($this->getMilliSecond(), 0, 3);
+ $result += $this->date('s', $this->getUnixTimestamp(), false) * 1000;
+ $result += $this->date('i', $this->getUnixTimestamp(), false) * 60000;
+ $result += $this->date('H', $this->getUnixTimestamp(), false) * 3600000;
+
+ return $this->_toComment(str_pad($result, $length, '0', STR_PAD_LEFT));
+ break;
+ }
+
+ return $this->_toComment($token);
+ }
+
+ /**
+ * Private function to make a comment of a token
+ *
+ * @param string $token
+ * @return string
+ */
+ private function _toComment($token)
+ {
+ $token = str_split($token);
+ $result = '';
+ foreach ($token as $tok) {
+ $result .= '\\' . $tok;
+ }
+
+ return $result;
+ }
+
+ /**
+ * Return digit from standard names (english)
+ * Faster implementation than locale aware searching
+ *
+ * @param string $name
+ * @return integer Number of this month
+ * @throws Zend_Date_Exception
+ */
+ private function _getDigitFromName($name)
+ {
+ switch($name) {
+ case "Jan":
+ return 1;
+
+ case "Feb":
+ return 2;
+
+ case "Mar":
+ return 3;
+
+ case "Apr":
+ return 4;
+
+ case "May":
+ return 5;
+
+ case "Jun":
+ return 6;
+
+ case "Jul":
+ return 7;
+
+ case "Aug":
+ return 8;
+
+ case "Sep":
+ return 9;
+
+ case "Oct":
+ return 10;
+
+ case "Nov":
+ return 11;
+
+ case "Dec":
+ return 12;
+
+ default:
+ throw new Zend_Date_Exception('Month ($name) is not a known month');
+ }
+ }
+
+ /**
+ * Counts the exact year number
+ * < 70 - 2000 added, >70 < 100 - 1900, others just returned
+ *
+ * @param integer $value year number
+ * @return integer Number of year
+ */
+ public static function getFullYear($value)
+ {
+ if ($value >= 0) {
+ if ($value < 70) {
+ $value += 2000;
+ } else if ($value < 100) {
+ $value += 1900;
+ }
+ }
+ return $value;
+ }
+
+ /**
+ * Sets the given date as new date or a given datepart as new datepart returning the new datepart
+ * This could be for example a localized dayname, the date without time,
+ * the month or only the seconds. There are about 50 different supported date parts.
+ * For a complete list of supported datepart values look into the docu
+ *
+ * @param string|integer|array|Zend_Date $date Date or datepart to set
+ * @param string $part OPTIONAL Part of the date to set, if null the timestamp is set
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function set($date, $part = null, $locale = null)
+ {
+ if (self::$_options['format_type'] == 'php') {
+ $part = Zend_Locale_Format::convertPhpToIsoFormat($part);
+ }
+
+ $zone = $this->getTimezoneFromString($date);
+ $this->setTimezone($zone);
+
+ $this->_calculate('set', $date, $part, $locale);
+ return $this;
+ }
+
+ /**
+ * Adds a date or datepart to the existing date, by extracting $part from $date,
+ * and modifying this object by adding that part. The $part is then extracted from
+ * this object and returned as an integer or numeric string (for large values, or $part's
+ * corresponding to pre-defined formatted date strings).
+ * This could be for example a ISO 8601 date, the hour the monthname or only the minute.
+ * There are about 50 different supported date parts.
+ * For a complete list of supported datepart values look into the docu.
+ *
+ * @param string|integer|array|Zend_Date $date Date or datepart to add
+ * @param string $part OPTIONAL Part of the date to add, if null the timestamp is added
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function add($date, $part = self::TIMESTAMP, $locale = null)
+ {
+ if (self::$_options['format_type'] == 'php') {
+ $part = Zend_Locale_Format::convertPhpToIsoFormat($part);
+ }
+
+ $this->_calculate('add', $date, $part, $locale);
+ return $this;
+ }
+
+ /**
+ * Subtracts a date from another date.
+ * This could be for example a RFC2822 date, the time,
+ * the year or only the timestamp. There are about 50 different supported date parts.
+ * For a complete list of supported datepart values look into the docu
+ * Be aware: Adding -2 Months is not equal to Subtracting 2 Months !!!
+ *
+ * @param string|integer|array|Zend_Date $date Date or datepart to subtract
+ * @param string $part OPTIONAL Part of the date to sub, if null the timestamp is subtracted
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function sub($date, $part = self::TIMESTAMP, $locale = null)
+ {
+ if (self::$_options['format_type'] == 'php') {
+ $part = Zend_Locale_Format::convertPhpToIsoFormat($part);
+ }
+
+ $this->_calculate('sub', $date, $part, $locale);
+ return $this;
+ }
+
+ /**
+ * Compares a date or datepart with the existing one.
+ * Returns -1 if earlier, 0 if equal and 1 if later.
+ *
+ * @param string|integer|array|Zend_Date $date Date or datepart to compare with the date object
+ * @param string $part OPTIONAL Part of the date to compare, if null the timestamp is subtracted
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return integer 0 = equal, 1 = later, -1 = earlier
+ * @throws Zend_Date_Exception
+ */
+ public function compare($date, $part = self::TIMESTAMP, $locale = null)
+ {
+ if (self::$_options['format_type'] == 'php') {
+ $part = Zend_Locale_Format::convertPhpToIsoFormat($part);
+ }
+
+ $compare = $this->_calculate('cmp', $date, $part, $locale);
+
+ if ($compare > 0) {
+ return 1;
+ } else if ($compare < 0) {
+ return -1;
+ }
+ return 0;
+ }
+
+ /**
+ * Returns a new instance of Zend_Date with the selected part copied.
+ * To make an exact copy, use PHP's clone keyword.
+ * For a complete list of supported date part values look into the docu.
+ * If a date part is copied, all other date parts are set to standard values.
+ * For example: If only YEAR is copied, the returned date object is equal to
+ * 01-01-YEAR 00:00:00 (01-01-1970 00:00:00 is equal to timestamp 0)
+ * If only HOUR is copied, the returned date object is equal to
+ * 01-01-1970 HOUR:00:00 (so $this contains a timestamp equal to a timestamp of 0 plus HOUR).
+ *
+ * @param string $part Part of the date to compare, if null the timestamp is subtracted
+ * @param string|Zend_Locale $locale OPTIONAL New object's locale. No adjustments to timezone are made.
+ * @return Zend_Date New clone with requested part
+ */
+ public function copyPart($part, $locale = null)
+ {
+ $clone = clone $this; // copy all instance variables
+ $clone->setUnixTimestamp(0); // except the timestamp
+ if ($locale != null) {
+ $clone->setLocale($locale); // set an other locale if selected
+ }
+ $clone->set($this, $part);
+ return $clone;
+ }
+
+ /**
+ * Internal function, returns the offset of a given timezone
+ *
+ * @param string $zone
+ * @return integer
+ */
+ public function getTimezoneFromString($zone)
+ {
+ if (is_array($zone)) {
+ return $this->getTimezone();
+ }
+
+ if ($zone instanceof Zend_Date) {
+ return $zone->getTimezone();
+ }
+
+ $match = array();
+ preg_match('/\dZ$/', $zone, $match);
+ if (!empty($match)) {
+ return "Etc/UTC";
+ }
+
+ preg_match('/([+-]\d{2}):{0,1}\d{2}/', $zone, $match);
+ if (!empty($match) and ($match[count($match) - 1] <= 14) and ($match[count($match) - 1] >= -12)) {
+ $zone = "Etc/GMT";
+ $zone .= ($match[count($match) - 1] < 0) ? "+" : "-";
+ $zone .= (int) abs($match[count($match) - 1]);
+ return $zone;
+ }
+
+ preg_match('/([[:alpha:]\/_]{3,30})(?!.*([[:alpha:]\/]{3,30}))/', $zone, $match);
+ try {
+ if (!empty($match) and (!is_int($match[count($match) - 1]))) {
+ $oldzone = $this->getTimezone();
+ $this->setTimezone($match[count($match) - 1]);
+ $result = $this->getTimezone();
+ $this->setTimezone($oldzone);
+ if ($result !== $oldzone) {
+ return $match[count($match) - 1];
+ }
+ }
+ } catch (Exception $e) {
+ // fall through
+ }
+
+ return $this->getTimezone();
+ }
+
+ /**
+ * Calculates the date or object
+ *
+ * @param string $calc Calculation to make
+ * @param string|integer $date Date for calculation
+ * @param string|integer $comp Second date for calculation
+ * @param boolean|integer $dst Use dst correction if option is set
+ * @return integer|string|Zend_Date new timestamp or Zend_Date depending on calculation
+ */
+ private function _assign($calc, $date, $comp = 0, $dst = false)
+ {
+ switch ($calc) {
+ case 'set' :
+ if (!empty($comp)) {
+ $this->setUnixTimestamp(call_user_func(Zend_Locale_Math::$sub, $this->getUnixTimestamp(), $comp));
+ }
+ $this->setUnixTimestamp(call_user_func(Zend_Locale_Math::$add, $this->getUnixTimestamp(), $date));
+ $value = $this->getUnixTimestamp();
+ break;
+ case 'add' :
+ $this->setUnixTimestamp(call_user_func(Zend_Locale_Math::$add, $this->getUnixTimestamp(), $date));
+ $value = $this->getUnixTimestamp();
+ break;
+ case 'sub' :
+ $this->setUnixTimestamp(call_user_func(Zend_Locale_Math::$sub, $this->getUnixTimestamp(), $date));
+ $value = $this->getUnixTimestamp();
+ break;
+ default :
+ // cmp - compare
+ return call_user_func(Zend_Locale_Math::$comp, $comp, $date);
+ break;
+ }
+
+ // dst-correction if 'fix_dst' = true and dst !== false but only for non UTC and non GMT
+ if ((self::$_options['fix_dst'] === true) and ($dst !== false) and ($this->_dst === true)) {
+ $hour = $this->toString(self::HOUR, 'iso');
+ if ($hour != $dst) {
+ if (($dst == ($hour + 1)) or ($dst == ($hour - 23))) {
+ $value += 3600;
+ } else if (($dst == ($hour - 1)) or ($dst == ($hour + 23))) {
+ $value -= 3600;
+ }
+ $this->setUnixTimestamp($value);
+ }
+ }
+ return $this->getUnixTimestamp();
+ }
+
+
+ /**
+ * Calculates the date or object
+ *
+ * @param string $calc Calculation to make, one of: 'add'|'sub'|'cmp'|'copy'|'set'
+ * @param string|integer|array|Zend_Date $date Date or datepart to calculate with
+ * @param string $part Part of the date to calculate, if null the timestamp is used
+ * @param string|Zend_Locale $locale Locale for parsing input
+ * @return integer|string|Zend_Date new timestamp
+ * @throws Zend_Date_Exception
+ */
+ private function _calculate($calc, $date, $part, $locale)
+ {
+ if ($date === null) {
+ throw new Zend_Date_Exception('parameter $date must be set, null is not allowed');
+ }
+
+ if (($part !== null) && (strlen($part) !== 2) && (Zend_Locale::isLocale($part, null, false))) {
+ $locale = $part;
+ $part = null;
+ }
+
+ if ($locale === null) {
+ $locale = $this->getLocale();
+ }
+
+ $locale = (string) $locale;
+
+ // Create date parts
+ $year = $this->toString(self::YEAR, 'iso');
+ $month = $this->toString(self::MONTH_SHORT, 'iso');
+ $day = $this->toString(self::DAY_SHORT, 'iso');
+ $hour = $this->toString(self::HOUR_SHORT, 'iso');
+ $minute = $this->toString(self::MINUTE_SHORT, 'iso');
+ $second = $this->toString(self::SECOND_SHORT, 'iso');
+ // If object extract value
+ if ($date instanceof Zend_Date) {
+ $date = $date->toString($part, 'iso', $locale);
+ }
+
+ if (is_array($date) === true) {
+ if (empty($part) === false) {
+ switch($part) {
+ // Fall through
+ case self::DAY:
+ case self::DAY_SHORT:
+ if (isset($date['day']) === true) {
+ $date = $date['day'];
+ }
+ break;
+ // Fall through
+ case self::WEEKDAY_SHORT:
+ case self::WEEKDAY:
+ case self::WEEKDAY_8601:
+ case self::WEEKDAY_DIGIT:
+ case self::WEEKDAY_NARROW:
+ case self::WEEKDAY_NAME:
+ if (isset($date['weekday']) === true) {
+ $date = $date['weekday'];
+ $part = self::WEEKDAY_DIGIT;
+ }
+ break;
+ case self::DAY_OF_YEAR:
+ if (isset($date['day_of_year']) === true) {
+ $date = $date['day_of_year'];
+ }
+ break;
+ // Fall through
+ case self::MONTH:
+ case self::MONTH_SHORT:
+ case self::MONTH_NAME:
+ case self::MONTH_NAME_SHORT:
+ case self::MONTH_NAME_NARROW:
+ if (isset($date['month']) === true) {
+ $date = $date['month'];
+ }
+ break;
+ // Fall through
+ case self::YEAR:
+ case self::YEAR_SHORT:
+ case self::YEAR_8601:
+ case self::YEAR_SHORT_8601:
+ if (isset($date['year']) === true) {
+ $date = $date['year'];
+ }
+ break;
+ // Fall through
+ case self::HOUR:
+ case self::HOUR_AM:
+ case self::HOUR_SHORT:
+ case self::HOUR_SHORT_AM:
+ if (isset($date['hour']) === true) {
+ $date = $date['hour'];
+ }
+ break;
+ // Fall through
+ case self::MINUTE:
+ case self::MINUTE_SHORT:
+ if (isset($date['minute']) === true) {
+ $date = $date['minute'];
+ }
+ break;
+ // Fall through
+ case self::SECOND:
+ case self::SECOND_SHORT:
+ if (isset($date['second']) === true) {
+ $date = $date['second'];
+ }
+ break;
+ // Fall through
+ case self::TIMEZONE:
+ case self::TIMEZONE_NAME:
+ if (isset($date['timezone']) === true) {
+ $date = $date['timezone'];
+ }
+ break;
+ case self::TIMESTAMP:
+ if (isset($date['timestamp']) === true) {
+ $date = $date['timestamp'];
+ }
+ break;
+ case self::WEEK:
+ if (isset($date['week']) === true) {
+ $date = $date['week'];
+ }
+ break;
+ case self::TIMEZONE_SECS:
+ if (isset($date['gmtsecs']) === true) {
+ $date = $date['gmtsecs'];
+ }
+ break;
+ default:
+ throw new Zend_Date_Exception("datepart for part ($part) not found in array");
+ break;
+ }
+ } else {
+ $hours = 0;
+ if (isset($date['hour']) === true) {
+ $hours = $date['hour'];
+ }
+ $minutes = 0;
+ if (isset($date['minute']) === true) {
+ $minutes = $date['minute'];
+ }
+ $seconds = 0;
+ if (isset($date['second']) === true) {
+ $seconds = $date['second'];
+ }
+ $months = 0;
+ if (isset($date['month']) === true) {
+ $months = $date['month'];
+ }
+ $days = 0;
+ if (isset($date['day']) === true) {
+ $days = $date['day'];
+ }
+ $years = 0;
+ if (isset($date['year']) === true) {
+ $years = $date['year'];
+ }
+ return $this->_assign($calc, $this->mktime($hours, $minutes, $seconds, $months, $days, $years, true),
+ $this->mktime($hour, $minute, $second, $month, $day, $year, true), $hour);
+ }
+ }
+
+ // $date as object, part of foreign date as own date
+ switch($part) {
+
+ // day formats
+ case self::DAY:
+ if (is_numeric($date)) {
+ return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + intval($date), 1970, true),
+ $this->mktime(0, 0, 0, 1, 1 + intval($day), 1970, true), $hour);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, day expected", 0, null, $date);
+ break;
+
+ case self::WEEKDAY_SHORT:
+ $daylist = Zend_Locale_Data::getList($locale, 'day');
+ $weekday = (int) $this->toString(self::WEEKDAY_DIGIT, 'iso', $locale);
+ $cnt = 0;
+
+ foreach ($daylist as $key => $value) {
+ if (strtoupper(iconv_substr($value, 0, 3, 'UTF-8')) == strtoupper($date)) {
+ $found = $cnt;
+ break;
+ }
+ ++$cnt;
+ }
+
+ // Weekday found
+ if ($cnt < 7) {
+ return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + $found, 1970, true),
+ $this->mktime(0, 0, 0, 1, 1 + $weekday, 1970, true), $hour);
+ }
+
+ // Weekday not found
+ throw new Zend_Date_Exception("invalid date ($date) operand, weekday expected", 0, null, $date);
+ break;
+
+ case self::DAY_SHORT:
+ if (is_numeric($date)) {
+ return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + intval($date), 1970, true),
+ $this->mktime(0, 0, 0, 1, 1 + intval($day), 1970, true), $hour);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, day expected", 0, null, $date);
+ break;
+
+ case self::WEEKDAY:
+ $daylist = Zend_Locale_Data::getList($locale, 'day');
+ $weekday = (int) $this->toString(self::WEEKDAY_DIGIT, 'iso', $locale);
+ $cnt = 0;
+
+ foreach ($daylist as $key => $value) {
+ if (strtoupper($value) == strtoupper($date)) {
+ $found = $cnt;
+ break;
+ }
+ ++$cnt;
+ }
+
+ // Weekday found
+ if ($cnt < 7) {
+ return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + $found, 1970, true),
+ $this->mktime(0, 0, 0, 1, 1 + $weekday, 1970, true), $hour);
+ }
+
+ // Weekday not found
+ throw new Zend_Date_Exception("invalid date ($date) operand, weekday expected", 0, null, $date);
+ break;
+
+ case self::WEEKDAY_8601:
+ $weekday = (int) $this->toString(self::WEEKDAY_8601, 'iso', $locale);
+ if ((intval($date) > 0) and (intval($date) < 8)) {
+ return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + intval($date), 1970, true),
+ $this->mktime(0, 0, 0, 1, 1 + $weekday, 1970, true), $hour);
+ }
+
+ // Weekday not found
+ throw new Zend_Date_Exception("invalid date ($date) operand, weekday expected", 0, null, $date);
+ break;
+
+ case self::DAY_SUFFIX:
+ throw new Zend_Date_Exception('day suffix not supported', 0, null, $date);
+ break;
+
+ case self::WEEKDAY_DIGIT:
+ $weekday = (int) $this->toString(self::WEEKDAY_DIGIT, 'iso', $locale);
+ if (is_numeric($date) and (intval($date) >= 0) and (intval($date) < 7)) {
+ return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + $date, 1970, true),
+ $this->mktime(0, 0, 0, 1, 1 + $weekday, 1970, true), $hour);
+ }
+
+ // Weekday not found
+ throw new Zend_Date_Exception("invalid date ($date) operand, weekday expected", 0, null, $date);
+ break;
+
+ case self::DAY_OF_YEAR:
+ if (is_numeric($date)) {
+ if (($calc == 'add') || ($calc == 'sub')) {
+ $year = 1970;
+ ++$date;
+ ++$day;
+ }
+
+ return $this->_assign($calc, $this->mktime(0, 0, 0, 1, $date, $year, true),
+ $this->mktime(0, 0, 0, $month, $day, $year, true), $hour);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, day expected", 0, null, $date);
+ break;
+
+ case self::WEEKDAY_NARROW:
+ $daylist = Zend_Locale_Data::getList($locale, 'day', array('gregorian', 'format', 'abbreviated'));
+ $weekday = (int) $this->toString(self::WEEKDAY_DIGIT, 'iso', $locale);
+ $cnt = 0;
+ foreach ($daylist as $key => $value) {
+ if (strtoupper(iconv_substr($value, 0, 1, 'UTF-8')) == strtoupper($date)) {
+ $found = $cnt;
+ break;
+ }
+ ++$cnt;
+ }
+
+ // Weekday found
+ if ($cnt < 7) {
+ return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + $found, 1970, true),
+ $this->mktime(0, 0, 0, 1, 1 + $weekday, 1970, true), $hour);
+ }
+
+ // Weekday not found
+ throw new Zend_Date_Exception("invalid date ($date) operand, weekday expected", 0, null, $date);
+ break;
+
+ case self::WEEKDAY_NAME:
+ $daylist = Zend_Locale_Data::getList($locale, 'day', array('gregorian', 'format', 'abbreviated'));
+ $weekday = (int) $this->toString(self::WEEKDAY_DIGIT, 'iso', $locale);
+ $cnt = 0;
+ foreach ($daylist as $key => $value) {
+ if (strtoupper($value) == strtoupper($date)) {
+ $found = $cnt;
+ break;
+ }
+ ++$cnt;
+ }
+
+ // Weekday found
+ if ($cnt < 7) {
+ return $this->_assign($calc, $this->mktime(0, 0, 0, 1, 1 + $found, 1970, true),
+ $this->mktime(0, 0, 0, 1, 1 + $weekday, 1970, true), $hour);
+ }
+
+ // Weekday not found
+ throw new Zend_Date_Exception("invalid date ($date) operand, weekday expected", 0, null, $date);
+ break;
+
+ // week formats
+ case self::WEEK:
+ if (is_numeric($date)) {
+ $week = (int) $this->toString(self::WEEK, 'iso', $locale);
+ return $this->_assign($calc, parent::mktime(0, 0, 0, 1, 1 + ($date * 7), 1970, true),
+ parent::mktime(0, 0, 0, 1, 1 + ($week * 7), 1970, true), $hour);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, week expected", 0, null, $date);
+ break;
+
+ // month formats
+ case self::MONTH_NAME:
+ $monthlist = Zend_Locale_Data::getList($locale, 'month');
+ $cnt = 0;
+ foreach ($monthlist as $key => $value) {
+ if (strtoupper($value) == strtoupper($date)) {
+ $found = $key;
+ break;
+ }
+ ++$cnt;
+ }
+ $date = array_search($date, $monthlist);
+
+ // Monthname found
+ if ($cnt < 12) {
+ $fixday = 0;
+ if ($calc == 'add') {
+ $date += $found;
+ $calc = 'set';
+ if (self::$_options['extend_month'] == false) {
+ $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false));
+ if ($parts['mday'] != $day) {
+ $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day);
+ }
+ }
+ } else if ($calc == 'sub') {
+ $date = $month - $found;
+ $calc = 'set';
+ if (self::$_options['extend_month'] == false) {
+ $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false));
+ if ($parts['mday'] != $day) {
+ $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day);
+ }
+ }
+ }
+ return $this->_assign($calc, $this->mktime(0, 0, 0, $date, $day + $fixday, $year, true),
+ $this->mktime(0, 0, 0, $month, $day, $year, true), $hour);
+ }
+
+ // Monthname not found
+ throw new Zend_Date_Exception("invalid date ($date) operand, month expected", 0, null, $date);
+ break;
+
+ case self::MONTH:
+ if (is_numeric($date)) {
+ $fixday = 0;
+ if ($calc == 'add') {
+ $date += $month;
+ $calc = 'set';
+ if (self::$_options['extend_month'] == false) {
+ $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false));
+ if ($parts['mday'] != $day) {
+ $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day);
+ }
+ }
+ } else if ($calc == 'sub') {
+ $date = $month - $date;
+ $calc = 'set';
+ if (self::$_options['extend_month'] == false) {
+ $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false));
+ if ($parts['mday'] != $day) {
+ $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day);
+ }
+ }
+ }
+ return $this->_assign($calc, $this->mktime(0, 0, 0, $date, $day + $fixday, $year, true),
+ $this->mktime(0, 0, 0, $month, $day, $year, true), $hour);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, month expected", 0, null, $date);
+ break;
+
+ case self::MONTH_NAME_SHORT:
+ $monthlist = Zend_Locale_Data::getList($locale, 'month', array('gregorian', 'format', 'abbreviated'));
+ $cnt = 0;
+ foreach ($monthlist as $key => $value) {
+ if (strtoupper($value) == strtoupper($date)) {
+ $found = $key;
+ break;
+ }
+ ++$cnt;
+ }
+ $date = array_search($date, $monthlist);
+
+ // Monthname found
+ if ($cnt < 12) {
+ $fixday = 0;
+ if ($calc == 'add') {
+ $date += $found;
+ $calc = 'set';
+ if (self::$_options['extend_month'] === false) {
+ $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false));
+ if ($parts['mday'] != $day) {
+ $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day);
+ }
+ }
+ } else if ($calc == 'sub') {
+ $date = $month - $found;
+ $calc = 'set';
+ if (self::$_options['extend_month'] === false) {
+ $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false));
+ if ($parts['mday'] != $day) {
+ $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day);
+ }
+ }
+ }
+ return $this->_assign($calc, $this->mktime(0, 0, 0, $date, $day + $fixday, $year, true),
+ $this->mktime(0, 0, 0, $month, $day, $year, true), $hour);
+ }
+
+ // Monthname not found
+ throw new Zend_Date_Exception("invalid date ($date) operand, month expected", 0, null, $date);
+ break;
+
+ case self::MONTH_SHORT:
+ if (is_numeric($date) === true) {
+ $fixday = 0;
+ if ($calc === 'add') {
+ $date += $month;
+ $calc = 'set';
+ if (self::$_options['extend_month'] === false) {
+ $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false));
+ if ($parts['mday'] != $day) {
+ $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day);
+ }
+ }
+ } else if ($calc === 'sub') {
+ $date = $month - $date;
+ $calc = 'set';
+ if (self::$_options['extend_month'] === false) {
+ $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false));
+ if ($parts['mday'] != $day) {
+ $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day);
+ }
+ }
+ }
+
+ return $this->_assign($calc, $this->mktime(0, 0, 0, $date, $day + $fixday, $year, true),
+ $this->mktime(0, 0, 0, $month, $day, $year, true), $hour);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, month expected", 0, null, $date);
+ break;
+
+ case self::MONTH_DAYS:
+ throw new Zend_Date_Exception('month days not supported', 0, null, $date);
+ break;
+
+ case self::MONTH_NAME_NARROW:
+ $monthlist = Zend_Locale_Data::getList($locale, 'month', array('gregorian', 'stand-alone', 'narrow'));
+ $cnt = 0;
+ foreach ($monthlist as $key => $value) {
+ if (strtoupper($value) === strtoupper($date)) {
+ $found = $key;
+ break;
+ }
+ ++$cnt;
+ }
+ $date = array_search($date, $monthlist);
+
+ // Monthname found
+ if ($cnt < 12) {
+ $fixday = 0;
+ if ($calc === 'add') {
+ $date += $found;
+ $calc = 'set';
+ if (self::$_options['extend_month'] === false) {
+ $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false));
+ if ($parts['mday'] != $day) {
+ $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day);
+ }
+ }
+ } else if ($calc === 'sub') {
+ $date = $month - $found;
+ $calc = 'set';
+ if (self::$_options['extend_month'] === false) {
+ $parts = $this->getDateParts($this->mktime($hour, $minute, $second, $date, $day, $year, false));
+ if ($parts['mday'] != $day) {
+ $fixday = ($parts['mday'] < $day) ? -$parts['mday'] : ($parts['mday'] - $day);
+ }
+ }
+ }
+ return $this->_assign($calc, $this->mktime(0, 0, 0, $date, $day + $fixday, $year, true),
+ $this->mktime(0, 0, 0, $month, $day, $year, true), $hour);
+ }
+
+ // Monthname not found
+ throw new Zend_Date_Exception("invalid date ($date) operand, month expected", 0, null, $date);
+ break;
+
+ // year formats
+ case self::LEAPYEAR:
+ throw new Zend_Date_Exception('leap year not supported', 0, null, $date);
+ break;
+
+ case self::YEAR_8601:
+ if (is_numeric($date)) {
+ if ($calc === 'add') {
+ $date += $year;
+ $calc = 'set';
+ } else if ($calc === 'sub') {
+ $date = $year - $date;
+ $calc = 'set';
+ }
+
+ return $this->_assign($calc, $this->mktime(0, 0, 0, $month, $day, intval($date), true),
+ $this->mktime(0, 0, 0, $month, $day, $year, true), false);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, year expected", 0, null, $date);
+ break;
+
+ case self::YEAR:
+ if (is_numeric($date)) {
+ if ($calc === 'add') {
+ $date += $year;
+ $calc = 'set';
+ } else if ($calc === 'sub') {
+ $date = $year - $date;
+ $calc = 'set';
+ }
+
+ return $this->_assign($calc, $this->mktime(0, 0, 0, $month, $day, intval($date), true),
+ $this->mktime(0, 0, 0, $month, $day, $year, true), false);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, year expected", 0, null, $date);
+ break;
+
+ case self::YEAR_SHORT:
+ if (is_numeric($date)) {
+ $date = intval($date);
+ if (($calc == 'set') || ($calc == 'cmp')) {
+ $date = self::getFullYear($date);
+ }
+ if ($calc === 'add') {
+ $date += $year;
+ $calc = 'set';
+ } else if ($calc === 'sub') {
+ $date = $year - $date;
+ $calc = 'set';
+ }
+
+ return $this->_assign($calc, $this->mktime(0, 0, 0, $month, $day, $date, true),
+ $this->mktime(0, 0, 0, $month, $day, $year, true), false);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, year expected", 0, null, $date);
+ break;
+
+ case self::YEAR_SHORT_8601:
+ if (is_numeric($date)) {
+ $date = intval($date);
+ if (($calc === 'set') || ($calc === 'cmp')) {
+ $date = self::getFullYear($date);
+ }
+ if ($calc === 'add') {
+ $date += $year;
+ $calc = 'set';
+ } else if ($calc === 'sub') {
+ $date = $year - $date;
+ $calc = 'set';
+ }
+
+ return $this->_assign($calc, $this->mktime(0, 0, 0, $month, $day, $date, true),
+ $this->mktime(0, 0, 0, $month, $day, $year, true), false);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, year expected", 0, null, $date);
+ break;
+
+ // time formats
+ case self::MERIDIEM:
+ throw new Zend_Date_Exception('meridiem not supported', 0, null, $date);
+ break;
+
+ case self::SWATCH:
+ if (is_numeric($date)) {
+ $rest = intval($date);
+ $hours = floor($rest * 24 / 1000);
+ $rest = $rest - ($hours * 1000 / 24);
+ $minutes = floor($rest * 1440 / 1000);
+ $rest = $rest - ($minutes * 1000 / 1440);
+ $seconds = floor($rest * 86400 / 1000);
+ return $this->_assign($calc, $this->mktime($hours, $minutes, $seconds, 1, 1, 1970, true),
+ $this->mktime($hour, $minute, $second, 1, 1, 1970, true), false);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, swatchstamp expected", 0, null, $date);
+ break;
+
+ case self::HOUR_SHORT_AM:
+ if (is_numeric($date)) {
+ return $this->_assign($calc, $this->mktime(intval($date), 0, 0, 1, 1, 1970, true),
+ $this->mktime($hour, 0, 0, 1, 1, 1970, true), false);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, hour expected", 0, null, $date);
+ break;
+
+ case self::HOUR_SHORT:
+ if (is_numeric($date)) {
+ return $this->_assign($calc, $this->mktime(intval($date), 0, 0, 1, 1, 1970, true),
+ $this->mktime($hour, 0, 0, 1, 1, 1970, true), false);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, hour expected", 0, null, $date);
+ break;
+
+ case self::HOUR_AM:
+ if (is_numeric($date)) {
+ return $this->_assign($calc, $this->mktime(intval($date), 0, 0, 1, 1, 1970, true),
+ $this->mktime($hour, 0, 0, 1, 1, 1970, true), false);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, hour expected", 0, null, $date);
+ break;
+
+ case self::HOUR:
+ if (is_numeric($date)) {
+ return $this->_assign($calc, $this->mktime(intval($date), 0, 0, 1, 1, 1970, true),
+ $this->mktime($hour, 0, 0, 1, 1, 1970, true), false);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, hour expected", 0, null, $date);
+ break;
+
+ case self::MINUTE:
+ if (is_numeric($date)) {
+ return $this->_assign($calc, $this->mktime(0, intval($date), 0, 1, 1, 1970, true),
+ $this->mktime(0, $minute, 0, 1, 1, 1970, true), false);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, minute expected", 0, null, $date);
+ break;
+
+ case self::SECOND:
+ if (is_numeric($date)) {
+ return $this->_assign($calc, $this->mktime(0, 0, intval($date), 1, 1, 1970, true),
+ $this->mktime(0, 0, $second, 1, 1, 1970, true), false);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, second expected", 0, null, $date);
+ break;
+
+ case self::MILLISECOND:
+ if (is_numeric($date)) {
+ switch($calc) {
+ case 'set' :
+ return $this->setMillisecond($date);
+ break;
+ case 'add' :
+ return $this->addMillisecond($date);
+ break;
+ case 'sub' :
+ return $this->subMillisecond($date);
+ break;
+ }
+
+ return $this->compareMillisecond($date);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, milliseconds expected", 0, null, $date);
+ break;
+
+ case self::MINUTE_SHORT:
+ if (is_numeric($date)) {
+ return $this->_assign($calc, $this->mktime(0, intval($date), 0, 1, 1, 1970, true),
+ $this->mktime(0, $minute, 0, 1, 1, 1970, true), false);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, minute expected", 0, null, $date);
+ break;
+
+ case self::SECOND_SHORT:
+ if (is_numeric($date)) {
+ return $this->_assign($calc, $this->mktime(0, 0, intval($date), 1, 1, 1970, true),
+ $this->mktime(0, 0, $second, 1, 1, 1970, true), false);
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, second expected", 0, null, $date);
+ break;
+
+ // timezone formats
+ // break intentionally omitted
+ case self::TIMEZONE_NAME:
+ case self::TIMEZONE:
+ case self::TIMEZONE_SECS:
+ throw new Zend_Date_Exception('timezone not supported', 0, null, $date);
+ break;
+
+ case self::DAYLIGHT:
+ throw new Zend_Date_Exception('daylight not supported', 0, null, $date);
+ break;
+
+ case self::GMT_DIFF:
+ case self::GMT_DIFF_SEP:
+ throw new Zend_Date_Exception('gmtdiff not supported', 0, null, $date);
+ break;
+
+ // date strings
+ case self::ISO_8601:
+ // (-)YYYY-MM-dd
+ preg_match('/^(-{0,1}\d{4})-(\d{2})-(\d{2})/', $date, $datematch);
+ // (-)YY-MM-dd
+ if (empty($datematch)) {
+ preg_match('/^(-{0,1}\d{2})-(\d{2})-(\d{2})/', $date, $datematch);
+ }
+ // (-)YYYYMMdd
+ if (empty($datematch)) {
+ preg_match('/^(-{0,1}\d{4})(\d{2})(\d{2})/', $date, $datematch);
+ }
+ // (-)YYMMdd
+ if (empty($datematch)) {
+ preg_match('/^(-{0,1}\d{2})(\d{2})(\d{2})/', $date, $datematch);
+ }
+ $tmpdate = $date;
+ if (!empty($datematch)) {
+ $dateMatchCharCount = iconv_strlen($datematch[0], 'UTF-8');
+ $tmpdate = iconv_substr($date,
+ $dateMatchCharCount,
+ iconv_strlen($date, 'UTF-8') - $dateMatchCharCount,
+ 'UTF-8');
+ }
+ // (T)hh:mm:ss
+ preg_match('/[T,\s]{0,1}(\d{2}):(\d{2}):(\d{2})/', $tmpdate, $timematch);
+ // (T)hhmmss
+ if (empty($timematch)) {
+ preg_match('/[T,\s]{0,1}(\d{2})(\d{2})(\d{2})/', $tmpdate, $timematch);
+ }
+ // (T)hh:mm
+ if (empty($timematch)) {
+ preg_match('/[T,\s]{0,1}(\d{2}):(\d{2})/', $tmpdate, $timematch);
+ }
+ // (T)hhmm
+ if (empty($timematch)) {
+ preg_match('/[T,\s]{0,1}(\d{2})(\d{2})/', $tmpdate, $timematch);
+ }
+ if (empty($datematch) and empty($timematch)) {
+ throw new Zend_Date_Exception("unsupported ISO8601 format ($date)", 0, null, $date);
+ }
+ if (!empty($timematch)) {
+ $timeMatchCharCount = iconv_strlen($timematch[0], 'UTF-8');
+ $tmpdate = iconv_substr($tmpdate,
+ $timeMatchCharCount,
+ iconv_strlen($tmpdate, 'UTF-8') - $timeMatchCharCount,
+ 'UTF-8');
+ }
+ if (empty($datematch)) {
+ $datematch[1] = 1970;
+ $datematch[2] = 1;
+ $datematch[3] = 1;
+ } else if (iconv_strlen($datematch[1], 'UTF-8') == 2) {
+ $datematch[1] = self::getFullYear($datematch[1]);
+ }
+ if (empty($timematch)) {
+ $timematch[1] = 0;
+ $timematch[2] = 0;
+ $timematch[3] = 0;
+ }
+ if (!isset($timematch[3])) {
+ $timematch[3] = 0;
+ }
+
+ if (($calc == 'set') || ($calc == 'cmp')) {
+ --$datematch[2];
+ --$month;
+ --$datematch[3];
+ --$day;
+ $datematch[1] -= 1970;
+ $year -= 1970;
+ }
+ return $this->_assign($calc, $this->mktime($timematch[1], $timematch[2], $timematch[3], 1 + $datematch[2], 1 + $datematch[3], 1970 + $datematch[1], false),
+ $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, false), false);
+ break;
+
+ case self::RFC_2822:
+ $result = preg_match('/^\w{3},\s(\d{1,2})\s(\w{3})\s(\d{4})\s'
+ . '(\d{2}):(\d{2}):{0,1}(\d{0,2})\s([+-]'
+ . '{1}\d{4}|\w{1,20})$/', $date, $match);
+
+ if (!$result) {
+ throw new Zend_Date_Exception("no RFC 2822 format ($date)", 0, null, $date);
+ }
+
+ $months = $this->_getDigitFromName($match[2]);
+
+ if (($calc == 'set') || ($calc == 'cmp')) {
+ --$months;
+ --$month;
+ --$match[1];
+ --$day;
+ $match[3] -= 1970;
+ $year -= 1970;
+ }
+ return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $months, 1 + $match[1], 1970 + $match[3], false),
+ $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, false), false);
+ break;
+
+ case self::TIMESTAMP:
+ if (is_numeric($date)) {
+ return $this->_assign($calc, $date, $this->getUnixTimestamp());
+ }
+
+ throw new Zend_Date_Exception("invalid date ($date) operand, timestamp expected", 0, null, $date);
+ break;
+
+ // additional formats
+ // break intentionally omitted
+ case self::ERA:
+ case self::ERA_NAME:
+ throw new Zend_Date_Exception('era not supported', 0, null, $date);
+ break;
+
+ case self::DATES:
+ try {
+ $parsed = Zend_Locale_Format::getDate($date, array('locale' => $locale, 'format_type' => 'iso', 'fix_date' => true));
+
+ if (($calc == 'set') || ($calc == 'cmp')) {
+ --$parsed['month'];
+ --$month;
+ --$parsed['day'];
+ --$day;
+ $parsed['year'] -= 1970;
+ $year -= 1970;
+ }
+
+ return $this->_assign($calc, $this->mktime(0, 0, 0, 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true),
+ $this->mktime(0, 0, 0, 1 + $month, 1 + $day, 1970 + $year, true), $hour);
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date);
+ }
+ break;
+
+ case self::DATE_FULL:
+ try {
+ $format = Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'full'));
+ $parsed = Zend_Locale_Format::getDate($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale));
+
+ if (($calc == 'set') || ($calc == 'cmp')) {
+ --$parsed['month'];
+ --$month;
+ --$parsed['day'];
+ --$day;
+ $parsed['year'] -= 1970;
+ $year -= 1970;
+ }
+ return $this->_assign($calc, $this->mktime(0, 0, 0, 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true),
+ $this->mktime(0, 0, 0, 1 + $month, 1 + $day, 1970 + $year, true), $hour);
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date);
+ }
+ break;
+
+ case self::DATE_LONG:
+ try {
+ $format = Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'long'));
+ $parsed = Zend_Locale_Format::getDate($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale));
+
+ if (($calc == 'set') || ($calc == 'cmp')){
+ --$parsed['month'];
+ --$month;
+ --$parsed['day'];
+ --$day;
+ $parsed['year'] -= 1970;
+ $year -= 1970;
+ }
+ return $this->_assign($calc, $this->mktime(0, 0, 0, 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true),
+ $this->mktime(0, 0, 0, 1 + $month, 1 + $day, 1970 + $year, true), $hour);
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date);
+ }
+ break;
+
+ case self::DATE_MEDIUM:
+ try {
+ $format = Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'medium'));
+ $parsed = Zend_Locale_Format::getDate($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale));
+
+ if (($calc == 'set') || ($calc == 'cmp')) {
+ --$parsed['month'];
+ --$month;
+ --$parsed['day'];
+ --$day;
+ $parsed['year'] -= 1970;
+ $year -= 1970;
+ }
+ return $this->_assign($calc, $this->mktime(0, 0, 0, 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true),
+ $this->mktime(0, 0, 0, 1 + $month, 1 + $day, 1970 + $year, true), $hour);
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date);
+ }
+ break;
+
+ case self::DATE_SHORT:
+ try {
+ $format = Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'short'));
+ $parsed = Zend_Locale_Format::getDate($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale));
+
+ $parsed['year'] = self::getFullYear($parsed['year']);
+
+ if (($calc == 'set') || ($calc == 'cmp')) {
+ --$parsed['month'];
+ --$month;
+ --$parsed['day'];
+ --$day;
+ $parsed['year'] -= 1970;
+ $year -= 1970;
+ }
+ return $this->_assign($calc, $this->mktime(0, 0, 0, 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true),
+ $this->mktime(0, 0, 0, 1 + $month, 1 + $day, 1970 + $year, true), $hour);
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date);
+ }
+ break;
+
+ case self::TIMES:
+ try {
+ if ($calc != 'set') {
+ $month = 1;
+ $day = 1;
+ $year = 1970;
+ }
+ $parsed = Zend_Locale_Format::getTime($date, array('locale' => $locale, 'format_type' => 'iso', 'fix_date' => true));
+ return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], $month, $day, $year, true),
+ $this->mktime($hour, $minute, $second, $month, $day, $year, true), false);
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date);
+ }
+ break;
+
+ case self::TIME_FULL:
+ try {
+ $format = Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'full'));
+ $parsed = Zend_Locale_Format::getTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale));
+ if ($calc != 'set') {
+ $month = 1;
+ $day = 1;
+ $year = 1970;
+ }
+
+ if (!isset($parsed['second'])) {
+ $parsed['second'] = 0;
+ }
+
+ return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], $month, $day, $year, true),
+ $this->mktime($hour, $minute, $second, $month, $day, $year, true), false);
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date);
+ }
+ break;
+
+ case self::TIME_LONG:
+ try {
+ $format = Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'long'));
+ $parsed = Zend_Locale_Format::getTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale));
+ if ($calc != 'set') {
+ $month = 1;
+ $day = 1;
+ $year = 1970;
+ }
+ return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], $month, $day, $year, true),
+ $this->mktime($hour, $minute, $second, $month, $day, $year, true), false);
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date);
+ }
+ break;
+
+ case self::TIME_MEDIUM:
+ try {
+ $format = Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'medium'));
+ $parsed = Zend_Locale_Format::getTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale));
+ if ($calc != 'set') {
+ $month = 1;
+ $day = 1;
+ $year = 1970;
+ }
+ return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], $month, $day, $year, true),
+ $this->mktime($hour, $minute, $second, $month, $day, $year, true), false);
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date);
+ }
+ break;
+
+ case self::TIME_SHORT:
+ try {
+ $format = Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'short'));
+ $parsed = Zend_Locale_Format::getTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale));
+ if ($calc != 'set') {
+ $month = 1;
+ $day = 1;
+ $year = 1970;
+ }
+
+ if (!isset($parsed['second'])) {
+ $parsed['second'] = 0;
+ }
+
+ return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], $month, $day, $year, true),
+ $this->mktime($hour, $minute, $second, $month, $day, $year, true), false);
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date);
+ }
+ break;
+
+ case self::DATETIME:
+ try {
+ $parsed = Zend_Locale_Format::getDateTime($date, array('locale' => $locale, 'format_type' => 'iso', 'fix_date' => true));
+ if (($calc == 'set') || ($calc == 'cmp')) {
+ --$parsed['month'];
+ --$month;
+ --$parsed['day'];
+ --$day;
+ $parsed['year'] -= 1970;
+ $year -= 1970;
+ }
+ return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true),
+ $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), $hour);
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date);
+ }
+ break;
+
+ case self::DATETIME_FULL:
+ try {
+ $format = Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'full'));
+ $parsed = Zend_Locale_Format::getDateTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale));
+
+ if (($calc == 'set') || ($calc == 'cmp')) {
+ --$parsed['month'];
+ --$month;
+ --$parsed['day'];
+ --$day;
+ $parsed['year'] -= 1970;
+ $year -= 1970;
+ }
+
+ if (!isset($parsed['second'])) {
+ $parsed['second'] = 0;
+ }
+
+ return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true),
+ $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), $hour);
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date);
+ }
+ break;
+
+ case self::DATETIME_LONG:
+ try {
+ $format = Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'long'));
+ $parsed = Zend_Locale_Format::getDateTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale));
+
+ if (($calc == 'set') || ($calc == 'cmp')){
+ --$parsed['month'];
+ --$month;
+ --$parsed['day'];
+ --$day;
+ $parsed['year'] -= 1970;
+ $year -= 1970;
+ }
+ return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true),
+ $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), $hour);
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date);
+ }
+ break;
+
+ case self::DATETIME_MEDIUM:
+ try {
+ $format = Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'medium'));
+ $parsed = Zend_Locale_Format::getDateTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale));
+ if (($calc == 'set') || ($calc == 'cmp')) {
+ --$parsed['month'];
+ --$month;
+ --$parsed['day'];
+ --$day;
+ $parsed['year'] -= 1970;
+ $year -= 1970;
+ }
+ return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true),
+ $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), $hour);
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date);
+ }
+ break;
+
+ case self::DATETIME_SHORT:
+ try {
+ $format = Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'short'));
+ $parsed = Zend_Locale_Format::getDateTime($date, array('date_format' => $format, 'format_type' => 'iso', 'locale' => $locale));
+
+ $parsed['year'] = self::getFullYear($parsed['year']);
+
+ if (($calc == 'set') || ($calc == 'cmp')) {
+ --$parsed['month'];
+ --$month;
+ --$parsed['day'];
+ --$day;
+ $parsed['year'] -= 1970;
+ $year -= 1970;
+ }
+
+ if (!isset($parsed['second'])) {
+ $parsed['second'] = 0;
+ }
+
+ return $this->_assign($calc, $this->mktime($parsed['hour'], $parsed['minute'], $parsed['second'], 1 + $parsed['month'], 1 + $parsed['day'], 1970 + $parsed['year'], true),
+ $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), $hour);
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date);
+ }
+ break;
+
+ // ATOM and RFC_3339 are identical
+ case self::ATOM:
+ case self::RFC_3339:
+ $result = preg_match('/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\d{0,4}([+-]{1}\d{2}:\d{2}|Z)$/', $date, $match);
+ if (!$result) {
+ throw new Zend_Date_Exception("invalid date ($date) operand, ATOM format expected", 0, null, $date);
+ }
+
+ if (($calc == 'set') || ($calc == 'cmp')) {
+ --$match[2];
+ --$month;
+ --$match[3];
+ --$day;
+ $match[1] -= 1970;
+ $year -= 1970;
+ }
+ return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $match[2], 1 + $match[3], 1970 + $match[1], true),
+ $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), false);
+ break;
+
+ case self::COOKIE:
+ $result = preg_match("/^\w{6,9},\s(\d{2})-(\w{3})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})\s.{3,20}$/", $date, $match);
+ if (!$result) {
+ throw new Zend_Date_Exception("invalid date ($date) operand, COOKIE format expected", 0, null, $date);
+ }
+ $matchStartPos = iconv_strpos($match[0], ' ', 0, 'UTF-8') + 1;
+ $match[0] = iconv_substr($match[0],
+ $matchStartPos,
+ iconv_strlen($match[0], 'UTF-8') - $matchStartPos,
+ 'UTF-8');
+
+ $months = $this->_getDigitFromName($match[2]);
+ $match[3] = self::getFullYear($match[3]);
+
+ if (($calc == 'set') || ($calc == 'cmp')) {
+ --$months;
+ --$month;
+ --$match[1];
+ --$day;
+ $match[3] -= 1970;
+ $year -= 1970;
+ }
+ return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $months, 1 + $match[1], 1970 + $match[3], true),
+ $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), false);
+ break;
+
+ case self::RFC_822:
+ case self::RFC_1036:
+ // new RFC 822 format, identical to RFC 1036 standard
+ $result = preg_match('/^\w{0,3},{0,1}\s{0,1}(\d{1,2})\s(\w{3})\s(\d{2})\s(\d{2}):(\d{2}):{0,1}(\d{0,2})\s([+-]{1}\d{4}|\w{1,20})$/', $date, $match);
+ if (!$result) {
+ throw new Zend_Date_Exception("invalid date ($date) operand, RFC 822 date format expected", 0, null, $date);
+ }
+
+ $months = $this->_getDigitFromName($match[2]);
+ $match[3] = self::getFullYear($match[3]);
+
+ if (($calc == 'set') || ($calc == 'cmp')) {
+ --$months;
+ --$month;
+ --$match[1];
+ --$day;
+ $match[3] -= 1970;
+ $year -= 1970;
+ }
+ return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $months, 1 + $match[1], 1970 + $match[3], false),
+ $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, false), false);
+ break;
+
+ case self::RFC_850:
+ $result = preg_match('/^\w{6,9},\s(\d{2})-(\w{3})-(\d{2})\s(\d{2}):(\d{2}):(\d{2})\s.{3,21}$/', $date, $match);
+ if (!$result) {
+ throw new Zend_Date_Exception("invalid date ($date) operand, RFC 850 date format expected", 0, null, $date);
+ }
+
+ $months = $this->_getDigitFromName($match[2]);
+ $match[3] = self::getFullYear($match[3]);
+
+ if (($calc == 'set') || ($calc == 'cmp')) {
+ --$months;
+ --$month;
+ --$match[1];
+ --$day;
+ $match[3] -= 1970;
+ $year -= 1970;
+ }
+ return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $months, 1 + $match[1], 1970 + $match[3], true),
+ $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), false);
+ break;
+
+ case self::RFC_1123:
+ $result = preg_match('/^\w{0,3},{0,1}\s{0,1}(\d{1,2})\s(\w{3})\s(\d{2,4})\s(\d{2}):(\d{2}):{0,1}(\d{0,2})\s([+-]{1}\d{4}|\w{1,20})$/', $date, $match);
+ if (!$result) {
+ throw new Zend_Date_Exception("invalid date ($date) operand, RFC 1123 date format expected", 0, null, $date);
+ }
+
+ $months = $this->_getDigitFromName($match[2]);
+
+ if (($calc == 'set') || ($calc == 'cmp')) {
+ --$months;
+ --$month;
+ --$match[1];
+ --$day;
+ $match[3] -= 1970;
+ $year -= 1970;
+ }
+ return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $months, 1 + $match[1], 1970 + $match[3], true),
+ $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), false);
+ break;
+
+ case self::RSS:
+ $result = preg_match('/^\w{3},\s(\d{2})\s(\w{3})\s(\d{2,4})\s(\d{1,2}):(\d{2}):(\d{2})\s.{1,21}$/', $date, $match);
+ if (!$result) {
+ throw new Zend_Date_Exception("invalid date ($date) operand, RSS date format expected", 0, null, $date);
+ }
+
+ $months = $this->_getDigitFromName($match[2]);
+ $match[3] = self::getFullYear($match[3]);
+
+ if (($calc == 'set') || ($calc == 'cmp')) {
+ --$months;
+ --$month;
+ --$match[1];
+ --$day;
+ $match[3] -= 1970;
+ $year -= 1970;
+ }
+ return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $months, 1 + $match[1], 1970 + $match[3], true),
+ $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), false);
+ break;
+
+ case self::W3C:
+ $result = preg_match('/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})[+-]{1}\d{2}:\d{2}$/', $date, $match);
+ if (!$result) {
+ throw new Zend_Date_Exception("invalid date ($date) operand, W3C date format expected", 0, null, $date);
+ }
+
+ if (($calc == 'set') || ($calc == 'cmp')) {
+ --$match[2];
+ --$month;
+ --$match[3];
+ --$day;
+ $match[1] -= 1970;
+ $year -= 1970;
+ }
+ return $this->_assign($calc, $this->mktime($match[4], $match[5], $match[6], 1 + $match[2], 1 + $match[3], 1970 + $match[1], true),
+ $this->mktime($hour, $minute, $second, 1 + $month, 1 + $day, 1970 + $year, true), false);
+ break;
+
+ default:
+ if (!is_numeric($date) || !empty($part)) {
+ try {
+ if (empty($part)) {
+ $part = Zend_Locale_Format::getDateFormat($locale) . " ";
+ $part .= Zend_Locale_Format::getTimeFormat($locale);
+ }
+
+ $parsed = Zend_Locale_Format::getDate($date, array('date_format' => $part, 'locale' => $locale, 'fix_date' => true, 'format_type' => 'iso'));
+ if ((strpos(strtoupper($part), 'YY') !== false) and (strpos(strtoupper($part), 'YYYY') === false)) {
+ $parsed['year'] = self::getFullYear($parsed['year']);
+ }
+
+ if (($calc == 'set') || ($calc == 'cmp')) {
+ if (isset($parsed['month'])) {
+ --$parsed['month'];
+ } else {
+ $parsed['month'] = 0;
+ }
+
+ if (isset($parsed['day'])) {
+ --$parsed['day'];
+ } else {
+ $parsed['day'] = 0;
+ }
+
+ if (!isset($parsed['year'])) {
+ $parsed['year'] = 1970;
+ }
+ }
+
+ return $this->_assign($calc, $this->mktime(
+ isset($parsed['hour']) ? $parsed['hour'] : 0,
+ isset($parsed['minute']) ? $parsed['minute'] : 0,
+ isset($parsed['second']) ? $parsed['second'] : 0,
+ isset($parsed['month']) ? (1 + $parsed['month']) : 1,
+ isset($parsed['day']) ? (1 + $parsed['day']) : 1,
+ $parsed['year'],
+ false), $this->getUnixTimestamp(), false);
+ } catch (Zend_Locale_Exception $e) {
+ if (!is_numeric($date)) {
+ throw new Zend_Date_Exception($e->getMessage(), 0, $e, $date);
+ }
+ }
+ }
+
+ return $this->_assign($calc, $date, $this->getUnixTimestamp(), false);
+ break;
+ }
+ }
+
+ /**
+ * Returns true when both date objects or date parts are equal.
+ * For example:
+ * 15.May.2000 <-> 15.June.2000 Equals only for Day or Year... all other will return false
+ *
+ * @param string|integer|array|Zend_Date $date Date or datepart to equal with
+ * @param string $part OPTIONAL Part of the date to compare, if null the timestamp is used
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return boolean
+ * @throws Zend_Date_Exception
+ */
+ public function equals($date, $part = self::TIMESTAMP, $locale = null)
+ {
+ $result = $this->compare($date, $part, $locale);
+
+ if ($result == 0) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns if the given date or datepart is earlier
+ * For example:
+ * 15.May.2000 <-> 13.June.1999 will return true for day, year and date, but not for month
+ *
+ * @param string|integer|array|Zend_Date $date Date or datepart to compare with
+ * @param string $part OPTIONAL Part of the date to compare, if null the timestamp is used
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return boolean
+ * @throws Zend_Date_Exception
+ */
+ public function isEarlier($date, $part = null, $locale = null)
+ {
+ $result = $this->compare($date, $part, $locale);
+
+ if ($result == -1) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns if the given date or datepart is later
+ * For example:
+ * 15.May.2000 <-> 13.June.1999 will return true for month but false for day, year and date
+ * Returns if the given date is later
+ *
+ * @param string|integer|array|Zend_Date $date Date or datepart to compare with
+ * @param string $part OPTIONAL Part of the date to compare, if null the timestamp is used
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return boolean
+ * @throws Zend_Date_Exception
+ */
+ public function isLater($date, $part = null, $locale = null)
+ {
+ $result = $this->compare($date, $part, $locale);
+
+ if ($result == 1) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns only the time of the date as new Zend_Date object
+ * For example:
+ * 15.May.2000 10:11:23 will return a dateobject equal to 01.Jan.1970 10:11:23
+ *
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date
+ */
+ public function getTime($locale = null)
+ {
+ if (self::$_options['format_type'] == 'php') {
+ $format = 'H:i:s';
+ } else {
+ $format = self::TIME_MEDIUM;
+ }
+
+ return $this->copyPart($format, $locale);
+ }
+
+ /**
+ * Returns the calculated time
+ *
+ * @param string $calc Calculation to make
+ * @param string|integer|array|Zend_Date $time Time to calculate with, if null the actual time is taken
+ * @param string $format Timeformat for parsing input
+ * @param string|Zend_Locale $locale Locale for parsing input
+ * @return integer|Zend_Date new time
+ * @throws Zend_Date_Exception
+ */
+ private function _time($calc, $time, $format, $locale)
+ {
+ if ($time === null) {
+ throw new Zend_Date_Exception('parameter $time must be set, null is not allowed');
+ }
+
+ if ($time instanceof Zend_Date) {
+ // extract time from object
+ $time = $time->toString('HH:mm:ss', 'iso');
+ } else {
+ if (is_array($time)) {
+ if ((isset($time['hour']) === true) or (isset($time['minute']) === true) or
+ (isset($time['second']) === true)) {
+ $parsed = $time;
+ } else {
+ throw new Zend_Date_Exception("no hour, minute or second given in array");
+ }
+ } else {
+ if (self::$_options['format_type'] == 'php') {
+ $format = Zend_Locale_Format::convertPhpToIsoFormat($format);
+ }
+ try {
+ if ($locale === null) {
+ $locale = $this->getLocale();
+ }
+
+ $parsed = Zend_Locale_Format::getTime($time, array('date_format' => $format, 'locale' => $locale, 'format_type' => 'iso'));
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Date_Exception($e->getMessage(), 0, $e);
+ }
+ }
+
+ if (!array_key_exists('hour', $parsed)) {
+ $parsed['hour'] = 0;
+ }
+
+ if (!array_key_exists('minute', $parsed)) {
+ $parsed['minute'] = 0;
+ }
+
+ if (!array_key_exists('second', $parsed)) {
+ $parsed['second'] = 0;
+ }
+
+ $time = str_pad($parsed['hour'], 2, '0', STR_PAD_LEFT) . ":";
+ $time .= str_pad($parsed['minute'], 2, '0', STR_PAD_LEFT) . ":";
+ $time .= str_pad($parsed['second'], 2, '0', STR_PAD_LEFT);
+ }
+
+ $return = $this->_calcdetail($calc, $time, self::TIMES, 'de');
+ if ($calc != 'cmp') {
+ return $this;
+ }
+
+ return $return;
+ }
+
+
+ /**
+ * Sets a new time for the date object. Format defines how to parse the time string.
+ * Also a complete date can be given, but only the time is used for setting.
+ * For example: dd.MMMM.yyTHH:mm' and 'ss sec'-> 10.May.07T25:11 and 44 sec => 1h11min44sec + 1 day
+ * Returned is the new date object and the existing date is left as it was before
+ *
+ * @param string|integer|array|Zend_Date $time Time to set
+ * @param string $format OPTIONAL Timeformat for parsing input
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function setTime($time, $format = null, $locale = null)
+ {
+ return $this->_time('set', $time, $format, $locale);
+ }
+
+
+ /**
+ * Adds a time to the existing date. Format defines how to parse the time string.
+ * If only parts are given the other parts are set to 0.
+ * If no format is given, the standardformat of this locale is used.
+ * For example: HH:mm:ss -> 10 -> +10 hours
+ *
+ * @param string|integer|array|Zend_Date $time Time to add
+ * @param string $format OPTIONAL Timeformat for parsing input
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function addTime($time, $format = null, $locale = null)
+ {
+ return $this->_time('add', $time, $format, $locale);
+ }
+
+
+ /**
+ * Subtracts a time from the existing date. Format defines how to parse the time string.
+ * If only parts are given the other parts are set to 0.
+ * If no format is given, the standardformat of this locale is used.
+ * For example: HH:mm:ss -> 10 -> -10 hours
+ *
+ * @param string|integer|array|Zend_Date $time Time to sub
+ * @param string $format OPTIONAL Timeformat for parsing input
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent inteface
+ * @throws Zend_Date_Exception
+ */
+ public function subTime($time, $format = null, $locale = null)
+ {
+ return $this->_time('sub', $time, $format, $locale);
+ }
+
+
+ /**
+ * Compares the time from the existing date. Format defines how to parse the time string.
+ * If only parts are given the other parts are set to default.
+ * If no format us given, the standardformat of this locale is used.
+ * For example: HH:mm:ss -> 10 -> 10 hours
+ *
+ * @param string|integer|array|Zend_Date $time Time to compare
+ * @param string $format OPTIONAL Timeformat for parsing input
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return integer 0 = equal, 1 = later, -1 = earlier
+ * @throws Zend_Date_Exception
+ */
+ public function compareTime($time, $format = null, $locale = null)
+ {
+ return $this->_time('cmp', $time, $format, $locale);
+ }
+
+ /**
+ * Returns a clone of $this, with the time part set to 00:00:00.
+ *
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date
+ */
+ public function getDate($locale = null)
+ {
+ $orig = self::$_options['format_type'];
+ if (self::$_options['format_type'] == 'php') {
+ self::$_options['format_type'] = 'iso';
+ }
+
+ $date = $this->copyPart(self::DATE_MEDIUM, $locale);
+ $date->addTimestamp($this->getGmtOffset());
+ self::$_options['format_type'] = $orig;
+
+ return $date;
+ }
+
+ /**
+ * Returns the calculated date
+ *
+ * @param string $calc Calculation to make
+ * @param string|integer|array|Zend_Date $date Date to calculate with, if null the actual date is taken
+ * @param string $format Date format for parsing
+ * @param string|Zend_Locale $locale Locale for parsing input
+ * @return integer|Zend_Date new date
+ * @throws Zend_Date_Exception
+ */
+ private function _date($calc, $date, $format, $locale)
+ {
+ if ($date === null) {
+ throw new Zend_Date_Exception('parameter $date must be set, null is not allowed');
+ }
+
+ if ($date instanceof Zend_Date) {
+ // extract date from object
+ $date = $date->toString('d.M.y', 'iso');
+ } else {
+ if (is_array($date)) {
+ if ((isset($date['year']) === true) or (isset($date['month']) === true) or
+ (isset($date['day']) === true)) {
+ $parsed = $date;
+ } else {
+ throw new Zend_Date_Exception("no day,month or year given in array");
+ }
+ } else {
+ if ((self::$_options['format_type'] == 'php') && !defined($format)) {
+ $format = Zend_Locale_Format::convertPhpToIsoFormat($format);
+ }
+ try {
+ if ($locale === null) {
+ $locale = $this->getLocale();
+ }
+
+ $parsed = Zend_Locale_Format::getDate($date, array('date_format' => $format, 'locale' => $locale, 'format_type' => 'iso'));
+ if ((strpos(strtoupper($format), 'YY') !== false) and (strpos(strtoupper($format), 'YYYY') === false)) {
+ $parsed['year'] = self::getFullYear($parsed['year']);
+ }
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Date_Exception($e->getMessage(), 0, $e);
+ }
+ }
+
+ if (!array_key_exists('day', $parsed)) {
+ $parsed['day'] = 1;
+ }
+
+ if (!array_key_exists('month', $parsed)) {
+ $parsed['month'] = 1;
+ }
+
+ if (!array_key_exists('year', $parsed)) {
+ $parsed['year'] = 0;
+ }
+
+ $date = $parsed['day'] . "." . $parsed['month'] . "." . $parsed['year'];
+ }
+
+ $return = $this->_calcdetail($calc, $date, self::DATE_MEDIUM, 'de');
+ if ($calc != 'cmp') {
+ return $this;
+ }
+ return $return;
+ }
+
+
+ /**
+ * Sets a new date for the date object. Format defines how to parse the date string.
+ * Also a complete date with time can be given, but only the date is used for setting.
+ * For example: MMMM.yy HH:mm-> May.07 22:11 => 01.May.07 00:00
+ * Returned is the new date object and the existing time is left as it was before
+ *
+ * @param string|integer|array|Zend_Date $date Date to set
+ * @param string $format OPTIONAL Date format for parsing
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function setDate($date, $format = null, $locale = null)
+ {
+ return $this->_date('set', $date, $format, $locale);
+ }
+
+
+ /**
+ * Adds a date to the existing date object. Format defines how to parse the date string.
+ * If only parts are given the other parts are set to 0.
+ * If no format is given, the standardformat of this locale is used.
+ * For example: MM.dd.YYYY -> 10 -> +10 months
+ *
+ * @param string|integer|array|Zend_Date $date Date to add
+ * @param string $format OPTIONAL Date format for parsing input
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function addDate($date, $format = null, $locale = null)
+ {
+ return $this->_date('add', $date, $format, $locale);
+ }
+
+
+ /**
+ * Subtracts a date from the existing date object. Format defines how to parse the date string.
+ * If only parts are given the other parts are set to 0.
+ * If no format is given, the standardformat of this locale is used.
+ * For example: MM.dd.YYYY -> 10 -> -10 months
+ * Be aware: Subtracting 2 months is not equal to Adding -2 months !!!
+ *
+ * @param string|integer|array|Zend_Date $date Date to sub
+ * @param string $format OPTIONAL Date format for parsing input
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function subDate($date, $format = null, $locale = null)
+ {
+ return $this->_date('sub', $date, $format, $locale);
+ }
+
+
+ /**
+ * Compares the date from the existing date object, ignoring the time.
+ * Format defines how to parse the date string.
+ * If only parts are given the other parts are set to 0.
+ * If no format is given, the standardformat of this locale is used.
+ * For example: 10.01.2000 => 10.02.1999 -> false
+ *
+ * @param string|integer|array|Zend_Date $date Date to compare
+ * @param string $format OPTIONAL Date format for parsing input
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return integer 0 = equal, 1 = later, -1 = earlier
+ * @throws Zend_Date_Exception
+ */
+ public function compareDate($date, $format = null, $locale = null)
+ {
+ return $this->_date('cmp', $date, $format, $locale);
+ }
+
+
+ /**
+ * Returns the full ISO 8601 date from the date object.
+ * Always the complete ISO 8601 specifiction is used. If an other ISO date is needed
+ * (ISO 8601 defines several formats) use toString() instead.
+ * This function does not return the ISO date as object. Use copy() instead.
+ *
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return string
+ */
+ public function getIso($locale = null)
+ {
+ return $this->toString(self::ISO_8601, 'iso', $locale);
+ }
+
+
+ /**
+ * Sets a new date for the date object. Not given parts are set to default.
+ * Only supported ISO 8601 formats are accepted.
+ * For example: 050901 -> 01.Sept.2005 00:00:00, 20050201T10:00:30 -> 01.Feb.2005 10h00m30s
+ * Returned is the new date object
+ *
+ * @param string|integer|Zend_Date $date ISO Date to set
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function setIso($date, $locale = null)
+ {
+ return $this->_calcvalue('set', $date, 'iso', self::ISO_8601, $locale);
+ }
+
+
+ /**
+ * Adds a ISO date to the date object. Not given parts are set to default.
+ * Only supported ISO 8601 formats are accepted.
+ * For example: 050901 -> + 01.Sept.2005 00:00:00, 10:00:00 -> +10h
+ * Returned is the new date object
+ *
+ * @param string|integer|Zend_Date $date ISO Date to add
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function addIso($date, $locale = null)
+ {
+ return $this->_calcvalue('add', $date, 'iso', self::ISO_8601, $locale);
+ }
+
+
+ /**
+ * Subtracts a ISO date from the date object. Not given parts are set to default.
+ * Only supported ISO 8601 formats are accepted.
+ * For example: 050901 -> - 01.Sept.2005 00:00:00, 10:00:00 -> -10h
+ * Returned is the new date object
+ *
+ * @param string|integer|Zend_Date $date ISO Date to sub
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function subIso($date, $locale = null)
+ {
+ return $this->_calcvalue('sub', $date, 'iso', self::ISO_8601, $locale);
+ }
+
+
+ /**
+ * Compares a ISO date with the date object. Not given parts are set to default.
+ * Only supported ISO 8601 formats are accepted.
+ * For example: 050901 -> - 01.Sept.2005 00:00:00, 10:00:00 -> -10h
+ * Returns if equal, earlier or later
+ *
+ * @param string|integer|Zend_Date $date ISO Date to sub
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return integer 0 = equal, 1 = later, -1 = earlier
+ * @throws Zend_Date_Exception
+ */
+ public function compareIso($date, $locale = null)
+ {
+ return $this->_calcvalue('cmp', $date, 'iso', self::ISO_8601, $locale);
+ }
+
+
+ /**
+ * Returns a RFC 822 compilant datestring from the date object.
+ * This function does not return the RFC date as object. Use copy() instead.
+ *
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return string
+ */
+ public function getArpa($locale = null)
+ {
+ if (self::$_options['format_type'] == 'php') {
+ $format = 'D\, d M y H\:i\:s O';
+ } else {
+ $format = self::RFC_822;
+ }
+
+ return $this->toString($format, 'iso', $locale);
+ }
+
+
+ /**
+ * Sets a RFC 822 date as new date for the date object.
+ * Only RFC 822 compilant date strings are accepted.
+ * For example: Sat, 14 Feb 09 00:31:30 +0100
+ * Returned is the new date object
+ *
+ * @param string|integer|Zend_Date $date RFC 822 to set
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function setArpa($date, $locale = null)
+ {
+ return $this->_calcvalue('set', $date, 'arpa', self::RFC_822, $locale);
+ }
+
+
+ /**
+ * Adds a RFC 822 date to the date object.
+ * ARPA messages are used in emails or HTTP Headers.
+ * Only RFC 822 compilant date strings are accepted.
+ * For example: Sat, 14 Feb 09 00:31:30 +0100
+ * Returned is the new date object
+ *
+ * @param string|integer|Zend_Date $date RFC 822 Date to add
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function addArpa($date, $locale = null)
+ {
+ return $this->_calcvalue('add', $date, 'arpa', self::RFC_822, $locale);
+ }
+
+
+ /**
+ * Subtracts a RFC 822 date from the date object.
+ * ARPA messages are used in emails or HTTP Headers.
+ * Only RFC 822 compilant date strings are accepted.
+ * For example: Sat, 14 Feb 09 00:31:30 +0100
+ * Returned is the new date object
+ *
+ * @param string|integer|Zend_Date $date RFC 822 Date to sub
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function subArpa($date, $locale = null)
+ {
+ return $this->_calcvalue('sub', $date, 'arpa', self::RFC_822, $locale);
+ }
+
+
+ /**
+ * Compares a RFC 822 compilant date with the date object.
+ * ARPA messages are used in emails or HTTP Headers.
+ * Only RFC 822 compilant date strings are accepted.
+ * For example: Sat, 14 Feb 09 00:31:30 +0100
+ * Returns if equal, earlier or later
+ *
+ * @param string|integer|Zend_Date $date RFC 822 Date to sub
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return integer 0 = equal, 1 = later, -1 = earlier
+ * @throws Zend_Date_Exception
+ */
+ public function compareArpa($date, $locale = null)
+ {
+ return $this->_calcvalue('cmp', $date, 'arpa', self::RFC_822, $locale);
+ }
+
+ /**
+ * Check if location is supported
+ *
+ * @param array $location locations array
+ * @throws Zend_Date_Exception
+ * @return float $horizon float
+ */
+ private function _checkLocation($location)
+ {
+ if (!isset($location['longitude']) or !isset($location['latitude'])) {
+ throw new Zend_Date_Exception('Location must include \'longitude\' and \'latitude\'', 0, null, $location);
+ }
+ if (($location['longitude'] > 180) or ($location['longitude'] < -180)) {
+ throw new Zend_Date_Exception('Longitude must be between -180 and 180', 0, null, $location);
+ }
+ if (($location['latitude'] > 90) or ($location['latitude'] < -90)) {
+ throw new Zend_Date_Exception('Latitude must be between -90 and 90', 0, null, $location);
+ }
+
+ if (!isset($location['horizon'])){
+ $location['horizon'] = 'effective';
+ }
+
+ switch ($location['horizon']) {
+ case 'civil' :
+ return -0.104528;
+ break;
+ case 'nautic' :
+ return -0.207912;
+ break;
+ case 'astronomic' :
+ return -0.309017;
+ break;
+ default :
+ return -0.0145439;
+ break;
+ }
+ }
+
+
+ /**
+ * Returns the time of sunrise for this date and a given location as new date object
+ * For a list of cities and correct locations use the class Zend_Date_Cities
+ *
+ * @param array $location location of sunrise
+ * ['horizon'] -> civil, nautic, astronomical, effective (default)
+ * ['longitude'] -> longitude of location
+ * ['latitude'] -> latitude of location
+ * @return Zend_Date
+ * @throws Zend_Date_Exception
+ */
+ public function getSunrise($location)
+ {
+ $horizon = $this->_checkLocation($location);
+ $result = clone $this;
+ $result->set($this->calcSun($location, $horizon, true), self::TIMESTAMP);
+ return $result;
+ }
+
+
+ /**
+ * Returns the time of sunset for this date and a given location as new date object
+ * For a list of cities and correct locations use the class Zend_Date_Cities
+ *
+ * @param array $location location of sunset
+ * ['horizon'] -> civil, nautic, astronomical, effective (default)
+ * ['longitude'] -> longitude of location
+ * ['latitude'] -> latitude of location
+ * @return Zend_Date
+ * @throws Zend_Date_Exception
+ */
+ public function getSunset($location)
+ {
+ $horizon = $this->_checkLocation($location);
+ $result = clone $this;
+ $result->set($this->calcSun($location, $horizon, false), self::TIMESTAMP);
+ return $result;
+ }
+
+
+ /**
+ * Returns an array with the sunset and sunrise dates for all horizon types
+ * For a list of cities and correct locations use the class Zend_Date_Cities
+ *
+ * @param array $location location of suninfo
+ * ['horizon'] -> civil, nautic, astronomical, effective (default)
+ * ['longitude'] -> longitude of location
+ * ['latitude'] -> latitude of location
+ * @return array - [sunset|sunrise][effective|civil|nautic|astronomic]
+ * @throws Zend_Date_Exception
+ */
+ public function getSunInfo($location)
+ {
+ $suninfo = array();
+ for ($i = 0; $i < 4; ++$i) {
+ switch ($i) {
+ case 0 :
+ $location['horizon'] = 'effective';
+ break;
+ case 1 :
+ $location['horizon'] = 'civil';
+ break;
+ case 2 :
+ $location['horizon'] = 'nautic';
+ break;
+ case 3 :
+ $location['horizon'] = 'astronomic';
+ break;
+ }
+ $horizon = $this->_checkLocation($location);
+ $result = clone $this;
+ $result->set($this->calcSun($location, $horizon, true), self::TIMESTAMP);
+ $suninfo['sunrise'][$location['horizon']] = $result;
+ $result = clone $this;
+ $result->set($this->calcSun($location, $horizon, false), self::TIMESTAMP);
+ $suninfo['sunset'][$location['horizon']] = $result;
+ }
+ return $suninfo;
+ }
+
+ /**
+ * Check a given year for leap year.
+ *
+ * @param integer|array|Zend_Date $year Year to check
+ * @throws Zend_Date_Exception
+ * @return boolean
+ */
+ public static function checkLeapYear($year)
+ {
+ if ($year instanceof Zend_Date) {
+ $year = (int) $year->toString(self::YEAR, 'iso');
+ }
+
+ if (is_array($year)) {
+ if (isset($year['year']) === true) {
+ $year = $year['year'];
+ } else {
+ throw new Zend_Date_Exception("no year given in array");
+ }
+ }
+
+ if (!is_numeric($year)) {
+ throw new Zend_Date_Exception("year ($year) has to be integer for checkLeapYear()", 0, null, $year);
+ }
+
+ return (bool) parent::isYearLeapYear($year);
+ }
+
+
+ /**
+ * Returns true, if the year is a leap year.
+ *
+ * @return boolean
+ */
+ public function isLeapYear()
+ {
+ return self::checkLeapYear($this);
+ }
+
+
+ /**
+ * Returns if the set date is todays date
+ *
+ * @return boolean
+ */
+ public function isToday()
+ {
+ $today = $this->date('Ymd', $this->_getTime());
+ $day = $this->date('Ymd', $this->getUnixTimestamp());
+ return ($today == $day);
+ }
+
+
+ /**
+ * Returns if the set date is yesterdays date
+ *
+ * @return boolean
+ */
+ public function isYesterday()
+ {
+ list($year, $month, $day) = explode('-', $this->date('Y-m-d', $this->_getTime()));
+ // adjusts for leap days and DST changes that are timezone specific
+ $yesterday = $this->date('Ymd', $this->mktime(0, 0, 0, $month, $day -1, $year));
+ $day = $this->date('Ymd', $this->getUnixTimestamp());
+ return $day == $yesterday;
+ }
+
+
+ /**
+ * Returns if the set date is tomorrows date
+ *
+ * @return boolean
+ */
+ public function isTomorrow()
+ {
+ list($year, $month, $day) = explode('-', $this->date('Y-m-d', $this->_getTime()));
+ // adjusts for leap days and DST changes that are timezone specific
+ $tomorrow = $this->date('Ymd', $this->mktime(0, 0, 0, $month, $day +1, $year));
+ $day = $this->date('Ymd', $this->getUnixTimestamp());
+ return $day == $tomorrow;
+ }
+
+ /**
+ * Returns the actual date as new date object
+ *
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date
+ */
+ public static function now($locale = null)
+ {
+ return new Zend_Date(time(), self::TIMESTAMP, $locale);
+ }
+
+ /**
+ * Calculate date details
+ *
+ * @param string $calc Calculation to make
+ * @param string|integer|array|Zend_Date $date Date or Part to calculate
+ * @param string $type Datepart for Calculation
+ * @param string|Zend_Locale $locale Locale for parsing input
+ * @return integer|string new date
+ * @throws Zend_Date_Exception
+ */
+ private function _calcdetail($calc, $date, $type, $locale)
+ {
+ $old = false;
+ if (self::$_options['format_type'] == 'php') {
+ self::$_options['format_type'] = 'iso';
+ $old = true;
+ }
+
+ switch($calc) {
+ case 'set' :
+ $return = $this->set($date, $type, $locale);
+ break;
+ case 'add' :
+ $return = $this->add($date, $type, $locale);
+ break;
+ case 'sub' :
+ $return = $this->sub($date, $type, $locale);
+ break;
+ default :
+ $return = $this->compare($date, $type, $locale);
+ break;
+ }
+
+ if ($old) {
+ self::$_options['format_type'] = 'php';
+ }
+
+ return $return;
+ }
+
+ /**
+ * Internal calculation, returns the requested date type
+ *
+ * @param string $calc Calculation to make
+ * @param string|integer|Zend_Date $value Datevalue to calculate with, if null the actual value is taken
+ * @param string $type
+ * @param string $parameter
+ * @param string|Zend_Locale $locale Locale for parsing input
+ * @throws Zend_Date_Exception
+ * @return integer|Zend_Date new date
+ */
+ private function _calcvalue($calc, $value, $type, $parameter, $locale)
+ {
+ if ($value === null) {
+ throw new Zend_Date_Exception("parameter $type must be set, null is not allowed");
+ }
+
+ if ($locale === null) {
+ $locale = $this->getLocale();
+ }
+
+ if ($value instanceof Zend_Date) {
+ // extract value from object
+ $value = $value->toString($parameter, 'iso', $locale);
+ } else if (!is_array($value) && !is_numeric($value) && ($type != 'iso') && ($type != 'arpa')) {
+ throw new Zend_Date_Exception("invalid $type ($value) operand", 0, null, $value);
+ }
+
+ $return = $this->_calcdetail($calc, $value, $parameter, $locale);
+ if ($calc != 'cmp') {
+ return $this;
+ }
+ return $return;
+ }
+
+
+ /**
+ * Returns only the year from the date object as new object.
+ * For example: 10.May.2000 10:30:00 -> 01.Jan.2000 00:00:00
+ *
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date
+ */
+ public function getYear($locale = null)
+ {
+ if (self::$_options['format_type'] == 'php') {
+ $format = 'Y';
+ } else {
+ $format = self::YEAR;
+ }
+
+ return $this->copyPart($format, $locale);
+ }
+
+
+ /**
+ * Sets a new year
+ * If the year is between 0 and 69, 2000 will be set (2000-2069)
+ * If the year if between 70 and 99, 1999 will be set (1970-1999)
+ * 3 or 4 digit years are set as expected. If you need to set year 0-99
+ * use set() instead.
+ * Returned is the new date object
+ *
+ * @param string|integer|array|Zend_Date $year Year to set
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function setYear($year, $locale = null)
+ {
+ return $this->_calcvalue('set', $year, 'year', self::YEAR, $locale);
+ }
+
+
+ /**
+ * Adds the year to the existing date object
+ * If the year is between 0 and 69, 2000 will be added (2000-2069)
+ * If the year if between 70 and 99, 1999 will be added (1970-1999)
+ * 3 or 4 digit years are added as expected. If you need to add years from 0-99
+ * use add() instead.
+ * Returned is the new date object
+ *
+ * @param string|integer|array|Zend_Date $year Year to add
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function addYear($year, $locale = null)
+ {
+ return $this->_calcvalue('add', $year, 'year', self::YEAR, $locale);
+ }
+
+
+ /**
+ * Subs the year from the existing date object
+ * If the year is between 0 and 69, 2000 will be subtracted (2000-2069)
+ * If the year if between 70 and 99, 1999 will be subtracted (1970-1999)
+ * 3 or 4 digit years are subtracted as expected. If you need to subtract years from 0-99
+ * use sub() instead.
+ * Returned is the new date object
+ *
+ * @param string|integer|array|Zend_Date $year Year to sub
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function subYear($year, $locale = null)
+ {
+ return $this->_calcvalue('sub', $year, 'year', self::YEAR, $locale);
+ }
+
+
+ /**
+ * Compares the year with the existing date object, ignoring other date parts.
+ * For example: 10.03.2000 -> 15.02.2000 -> true
+ * Returns if equal, earlier or later
+ *
+ * @param string|integer|array|Zend_Date $year Year to compare
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return integer 0 = equal, 1 = later, -1 = earlier
+ * @throws Zend_Date_Exception
+ */
+ public function compareYear($year, $locale = null)
+ {
+ return $this->_calcvalue('cmp', $year, 'year', self::YEAR, $locale);
+ }
+
+
+ /**
+ * Returns only the month from the date object as new object.
+ * For example: 10.May.2000 10:30:00 -> 01.May.1970 00:00:00
+ *
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date
+ */
+ public function getMonth($locale = null)
+ {
+ if (self::$_options['format_type'] == 'php') {
+ $format = 'm';
+ } else {
+ $format = self::MONTH;
+ }
+
+ return $this->copyPart($format, $locale);
+ }
+
+
+ /**
+ * Returns the calculated month
+ *
+ * @param string $calc Calculation to make
+ * @param string|integer|array|Zend_Date $month Month to calculate with, if null the actual month is taken
+ * @param string|Zend_Locale $locale Locale for parsing input
+ * @return integer|Zend_Date new time
+ * @throws Zend_Date_Exception
+ */
+ private function _month($calc, $month, $locale)
+ {
+ if ($month === null) {
+ throw new Zend_Date_Exception('parameter $month must be set, null is not allowed');
+ }
+
+ if ($locale === null) {
+ $locale = $this->getLocale();
+ }
+
+ if ($month instanceof Zend_Date) {
+ // extract month from object
+ $found = $month->toString(self::MONTH_SHORT, 'iso', $locale);
+ } else {
+ if (is_numeric($month)) {
+ $found = $month;
+ } else if (is_array($month)) {
+ if (isset($month['month']) === true) {
+ $month = $month['month'];
+ } else {
+ throw new Zend_Date_Exception("no month given in array");
+ }
+ } else {
+ $monthlist = Zend_Locale_Data::getList($locale, 'month');
+ $monthlist2 = Zend_Locale_Data::getList($locale, 'month', array('gregorian', 'format', 'abbreviated'));
+
+ $monthlist = array_merge($monthlist, $monthlist2);
+ $found = 0;
+ $cnt = 0;
+ foreach ($monthlist as $key => $value) {
+ if (strtoupper($value) == strtoupper($month)) {
+ $found = ($key % 12) + 1;
+ break;
+ }
+ ++$cnt;
+ }
+ if ($found == 0) {
+ foreach ($monthlist2 as $key => $value) {
+ if (strtoupper(iconv_substr($value, 0, 1, 'UTF-8')) == strtoupper($month)) {
+ $found = $key + 1;
+ break;
+ }
+ ++$cnt;
+ }
+ }
+ if ($found == 0) {
+ throw new Zend_Date_Exception("unknown month name ($month)", 0, null, $month);
+ }
+ }
+ }
+ $return = $this->_calcdetail($calc, $found, self::MONTH_SHORT, $locale);
+ if ($calc != 'cmp') {
+ return $this;
+ }
+ return $return;
+ }
+
+
+ /**
+ * Sets a new month
+ * The month can be a number or a string. Setting months lower then 0 and greater then 12
+ * will result in adding or subtracting the relevant year. (12 months equal one year)
+ * If a localized monthname is given it will be parsed with the default locale or the optional
+ * set locale.
+ * Returned is the new date object
+ *
+ * @param string|integer|array|Zend_Date $month Month to set
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function setMonth($month, $locale = null)
+ {
+ return $this->_month('set', $month, $locale);
+ }
+
+
+ /**
+ * Adds months to the existing date object.
+ * The month can be a number or a string. Adding months lower then 0 and greater then 12
+ * will result in adding or subtracting the relevant year. (12 months equal one year)
+ * If a localized monthname is given it will be parsed with the default locale or the optional
+ * set locale.
+ * Returned is the new date object
+ *
+ * @param string|integer|array|Zend_Date $month Month to add
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function addMonth($month, $locale = null)
+ {
+ return $this->_month('add', $month, $locale);
+ }
+
+
+ /**
+ * Subtracts months from the existing date object.
+ * The month can be a number or a string. Subtracting months lower then 0 and greater then 12
+ * will result in adding or subtracting the relevant year. (12 months equal one year)
+ * If a localized monthname is given it will be parsed with the default locale or the optional
+ * set locale.
+ * Returned is the new date object
+ *
+ * @param string|integer|array|Zend_Date $month Month to sub
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function subMonth($month, $locale = null)
+ {
+ return $this->_month('sub', $month, $locale);
+ }
+
+
+ /**
+ * Compares the month with the existing date object, ignoring other date parts.
+ * For example: 10.03.2000 -> 15.03.1950 -> true
+ * Returns if equal, earlier or later
+ *
+ * @param string|integer|array|Zend_Date $month Month to compare
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return integer 0 = equal, 1 = later, -1 = earlier
+ * @throws Zend_Date_Exception
+ */
+ public function compareMonth($month, $locale = null)
+ {
+ return $this->_month('cmp', $month, $locale);
+ }
+
+
+ /**
+ * Returns the day as new date object
+ * Example: 20.May.1986 -> 20.Jan.1970 00:00:00
+ *
+ * @param Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date
+ */
+ public function getDay($locale = null)
+ {
+ return $this->copyPart(self::DAY_SHORT, $locale);
+ }
+
+ /**
+ * Returns the calculated day
+ *
+ * @param string $calc Type of calculation to make
+ * @param Zend_Date $day Day to calculate, when null the actual day is calculated
+ * @param Zend_Locale $locale Locale for parsing input
+ * @throws Zend_Date_Exception
+ * @return Zend_Date|integer
+ */
+ private function _day($calc, $day, $locale)
+ {
+ if ($day === null) {
+ throw new Zend_Date_Exception('parameter $day must be set, null is not allowed');
+ }
+
+ if ($locale === null) {
+ $locale = $this->getLocale();
+ }
+
+ if ($day instanceof Zend_Date) {
+ $day = $day->toString(self::DAY_SHORT, 'iso', $locale);
+ }
+
+ if (is_numeric($day)) {
+ $type = self::DAY_SHORT;
+ } else if (is_array($day)) {
+ if (isset($day['day']) === true) {
+ $day = $day['day'];
+ $type = self::WEEKDAY;
+ } else {
+ throw new Zend_Date_Exception("no day given in array");
+ }
+ } else {
+ switch (iconv_strlen($day, 'UTF-8')) {
+ case 1 :
+ $type = self::WEEKDAY_NARROW;
+ break;
+ case 2:
+ $type = self::WEEKDAY_NAME;
+ break;
+ case 3:
+ $type = self::WEEKDAY_SHORT;
+ break;
+ default:
+ $type = self::WEEKDAY;
+ break;
+ }
+ }
+ $return = $this->_calcdetail($calc, $day, $type, $locale);
+ if ($calc != 'cmp') {
+ return $this;
+ }
+ return $return;
+ }
+
+
+ /**
+ * Sets a new day
+ * The day can be a number or a string. Setting days lower then 0 or greater than the number of this months days
+ * will result in adding or subtracting the relevant month.
+ * If a localized dayname is given it will be parsed with the default locale or the optional
+ * set locale.
+ * Returned is the new date object
+ * Example: setDay('Montag', 'de_AT'); will set the monday of this week as day.
+ *
+ * @param string|integer|array|Zend_Date $day Day to set
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function setDay($day, $locale = null)
+ {
+ return $this->_day('set', $day, $locale);
+ }
+
+
+ /**
+ * Adds days to the existing date object.
+ * The day can be a number or a string. Adding days lower then 0 or greater than the number of this months days
+ * will result in adding or subtracting the relevant month.
+ * If a localized dayname is given it will be parsed with the default locale or the optional
+ * set locale.
+ *
+ * @param string|integer|array|Zend_Date $day Day to add
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function addDay($day, $locale = null)
+ {
+ return $this->_day('add', $day, $locale);
+ }
+
+
+ /**
+ * Subtracts days from the existing date object.
+ * The day can be a number or a string. Subtracting days lower then 0 or greater than the number of this months days
+ * will result in adding or subtracting the relevant month.
+ * If a localized dayname is given it will be parsed with the default locale or the optional
+ * set locale.
+ *
+ * @param string|integer|array|Zend_Date $day Day to sub
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function subDay($day, $locale = null)
+ {
+ return $this->_day('sub', $day, $locale);
+ }
+
+
+ /**
+ * Compares the day with the existing date object, ignoring other date parts.
+ * For example: 'Monday', 'en' -> 08.Jan.2007 -> 0
+ * Returns if equal, earlier or later
+ *
+ * @param string|integer|array|Zend_Date $day Day to compare
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return integer 0 = equal, 1 = later, -1 = earlier
+ * @throws Zend_Date_Exception
+ */
+ public function compareDay($day, $locale = null)
+ {
+ return $this->_day('cmp', $day, $locale);
+ }
+
+
+ /**
+ * Returns the weekday as new date object
+ * Weekday is always from 1-7
+ * Example: 09-Jan-2007 -> 2 = Tuesday -> 02-Jan-1970 (when 02.01.1970 is also Tuesday)
+ *
+ * @param Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date
+ */
+ public function getWeekday($locale = null)
+ {
+ if (self::$_options['format_type'] == 'php') {
+ $format = 'l';
+ } else {
+ $format = self::WEEKDAY;
+ }
+
+ return $this->copyPart($format, $locale);
+ }
+
+
+ /**
+ * Returns the calculated weekday
+ *
+ * @param string $calc Type of calculation to make
+ * @param Zend_Date $weekday Weekday to calculate, when null the actual weekday is calculated
+ * @param Zend_Locale $locale Locale for parsing input
+ * @return Zend_Date|integer
+ * @throws Zend_Date_Exception
+ */
+ private function _weekday($calc, $weekday, $locale)
+ {
+ if ($weekday === null) {
+ throw new Zend_Date_Exception('parameter $weekday must be set, null is not allowed');
+ }
+
+ if ($locale === null) {
+ $locale = $this->getLocale();
+ }
+
+ if ($weekday instanceof Zend_Date) {
+ $weekday = $weekday->toString(self::WEEKDAY_8601, 'iso', $locale);
+ }
+
+ if (is_numeric($weekday)) {
+ $type = self::WEEKDAY_8601;
+ } else if (is_array($weekday)) {
+ if (isset($weekday['weekday']) === true) {
+ $weekday = $weekday['weekday'];
+ $type = self::WEEKDAY;
+ } else {
+ throw new Zend_Date_Exception("no weekday given in array");
+ }
+ } else {
+ switch(iconv_strlen($weekday, 'UTF-8')) {
+ case 1:
+ $type = self::WEEKDAY_NARROW;
+ break;
+ case 2:
+ $type = self::WEEKDAY_NAME;
+ break;
+ case 3:
+ $type = self::WEEKDAY_SHORT;
+ break;
+ default:
+ $type = self::WEEKDAY;
+ break;
+ }
+ }
+ $return = $this->_calcdetail($calc, $weekday, $type, $locale);
+ if ($calc != 'cmp') {
+ return $this;
+ }
+ return $return;
+ }
+
+
+ /**
+ * Sets a new weekday
+ * The weekday can be a number or a string. If a localized weekday name is given,
+ * then it will be parsed as a date in $locale (defaults to the same locale as $this).
+ * Returned is the new date object.
+ * Example: setWeekday(3); will set the wednesday of this week as day.
+ *
+ * @param string|integer|array|Zend_Date $weekday Weekday to set
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function setWeekday($weekday, $locale = null)
+ {
+ return $this->_weekday('set', $weekday, $locale);
+ }
+
+
+ /**
+ * Adds weekdays to the existing date object.
+ * The weekday can be a number or a string.
+ * If a localized dayname is given it will be parsed with the default locale or the optional
+ * set locale.
+ * Returned is the new date object
+ * Example: addWeekday(3); will add the difference of days from the begining of the month until
+ * wednesday.
+ *
+ * @param string|integer|array|Zend_Date $weekday Weekday to add
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function addWeekday($weekday, $locale = null)
+ {
+ return $this->_weekday('add', $weekday, $locale);
+ }
+
+
+ /**
+ * Subtracts weekdays from the existing date object.
+ * The weekday can be a number or a string.
+ * If a localized dayname is given it will be parsed with the default locale or the optional
+ * set locale.
+ * Returned is the new date object
+ * Example: subWeekday(3); will subtract the difference of days from the begining of the month until
+ * wednesday.
+ *
+ * @param string|integer|array|Zend_Date $weekday Weekday to sub
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function subWeekday($weekday, $locale = null)
+ {
+ return $this->_weekday('sub', $weekday, $locale);
+ }
+
+
+ /**
+ * Compares the weekday with the existing date object, ignoring other date parts.
+ * For example: 'Monday', 'en' -> 08.Jan.2007 -> 0
+ * Returns if equal, earlier or later
+ *
+ * @param string|integer|array|Zend_Date $weekday Weekday to compare
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return integer 0 = equal, 1 = later, -1 = earlier
+ * @throws Zend_Date_Exception
+ */
+ public function compareWeekday($weekday, $locale = null)
+ {
+ return $this->_weekday('cmp', $weekday, $locale);
+ }
+
+
+ /**
+ * Returns the day of year as new date object
+ * Example: 02.Feb.1986 10:00:00 -> 02.Feb.1970 00:00:00
+ *
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date
+ */
+ public function getDayOfYear($locale = null)
+ {
+ if (self::$_options['format_type'] == 'php') {
+ $format = 'D';
+ } else {
+ $format = self::DAY_OF_YEAR;
+ }
+
+ return $this->copyPart($format, $locale);
+ }
+
+
+ /**
+ * Sets a new day of year
+ * The day of year is always a number.
+ * Returned is the new date object
+ * Example: 04.May.2004 -> setDayOfYear(10) -> 10.Jan.2004
+ *
+ * @param string|integer|array|Zend_Date $day Day of Year to set
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function setDayOfYear($day, $locale = null)
+ {
+ return $this->_calcvalue('set', $day, 'day of year', self::DAY_OF_YEAR, $locale);
+ }
+
+
+ /**
+ * Adds a day of year to the existing date object.
+ * The day of year is always a number.
+ * Returned is the new date object
+ * Example: addDayOfYear(10); will add 10 days to the existing date object.
+ *
+ * @param string|integer|array|Zend_Date $day Day of Year to add
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function addDayOfYear($day, $locale = null)
+ {
+ return $this->_calcvalue('add', $day, 'day of year', self::DAY_OF_YEAR, $locale);
+ }
+
+
+ /**
+ * Subtracts a day of year from the existing date object.
+ * The day of year is always a number.
+ * Returned is the new date object
+ * Example: subDayOfYear(10); will subtract 10 days from the existing date object.
+ *
+ * @param string|integer|array|Zend_Date $day Day of Year to sub
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function subDayOfYear($day, $locale = null)
+ {
+ return $this->_calcvalue('sub', $day, 'day of year', self::DAY_OF_YEAR, $locale);
+ }
+
+
+ /**
+ * Compares the day of year with the existing date object.
+ * For example: compareDayOfYear(33) -> 02.Feb.2007 -> 0
+ * Returns if equal, earlier or later
+ *
+ * @param string|integer|array|Zend_Date $day Day of Year to compare
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return integer 0 = equal, 1 = later, -1 = earlier
+ * @throws Zend_Date_Exception
+ */
+ public function compareDayOfYear($day, $locale = null)
+ {
+ return $this->_calcvalue('cmp', $day, 'day of year', self::DAY_OF_YEAR, $locale);
+ }
+
+
+ /**
+ * Returns the hour as new date object
+ * Example: 02.Feb.1986 10:30:25 -> 01.Jan.1970 10:00:00
+ *
+ * @param Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date
+ */
+ public function getHour($locale = null)
+ {
+ return $this->copyPart(self::HOUR, $locale);
+ }
+
+
+ /**
+ * Sets a new hour
+ * The hour is always a number.
+ * Returned is the new date object
+ * Example: 04.May.1993 13:07:25 -> setHour(7); -> 04.May.1993 07:07:25
+ *
+ * @param string|integer|array|Zend_Date $hour Hour to set
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function setHour($hour, $locale = null)
+ {
+ return $this->_calcvalue('set', $hour, 'hour', self::HOUR_SHORT, $locale);
+ }
+
+
+ /**
+ * Adds hours to the existing date object.
+ * The hour is always a number.
+ * Returned is the new date object
+ * Example: 04.May.1993 13:07:25 -> addHour(12); -> 05.May.1993 01:07:25
+ *
+ * @param string|integer|array|Zend_Date $hour Hour to add
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function addHour($hour, $locale = null)
+ {
+ return $this->_calcvalue('add', $hour, 'hour', self::HOUR_SHORT, $locale);
+ }
+
+
+ /**
+ * Subtracts hours from the existing date object.
+ * The hour is always a number.
+ * Returned is the new date object
+ * Example: 04.May.1993 13:07:25 -> subHour(6); -> 05.May.1993 07:07:25
+ *
+ * @param string|integer|array|Zend_Date $hour Hour to sub
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function subHour($hour, $locale = null)
+ {
+ return $this->_calcvalue('sub', $hour, 'hour', self::HOUR_SHORT, $locale);
+ }
+
+
+ /**
+ * Compares the hour with the existing date object.
+ * For example: 10:30:25 -> compareHour(10) -> 0
+ * Returns if equal, earlier or later
+ *
+ * @param string|integer|array|Zend_Date $hour Hour to compare
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return integer 0 = equal, 1 = later, -1 = earlier
+ * @throws Zend_Date_Exception
+ */
+ public function compareHour($hour, $locale = null)
+ {
+ return $this->_calcvalue('cmp', $hour, 'hour', self::HOUR_SHORT, $locale);
+ }
+
+
+ /**
+ * Returns the minute as new date object
+ * Example: 02.Feb.1986 10:30:25 -> 01.Jan.1970 00:30:00
+ *
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date
+ */
+ public function getMinute($locale = null)
+ {
+ if (self::$_options['format_type'] == 'php') {
+ $format = 'i';
+ } else {
+ $format = self::MINUTE;
+ }
+
+ return $this->copyPart($format, $locale);
+ }
+
+
+ /**
+ * Sets a new minute
+ * The minute is always a number.
+ * Returned is the new date object
+ * Example: 04.May.1993 13:07:25 -> setMinute(29); -> 04.May.1993 13:29:25
+ *
+ * @param string|integer|array|Zend_Date $minute Minute to set
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function setMinute($minute, $locale = null)
+ {
+ return $this->_calcvalue('set', $minute, 'minute', self::MINUTE_SHORT, $locale);
+ }
+
+
+ /**
+ * Adds minutes to the existing date object.
+ * The minute is always a number.
+ * Returned is the new date object
+ * Example: 04.May.1993 13:07:25 -> addMinute(65); -> 04.May.1993 13:12:25
+ *
+ * @param string|integer|array|Zend_Date $minute Minute to add
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function addMinute($minute, $locale = null)
+ {
+ return $this->_calcvalue('add', $minute, 'minute', self::MINUTE_SHORT, $locale);
+ }
+
+
+ /**
+ * Subtracts minutes from the existing date object.
+ * The minute is always a number.
+ * Returned is the new date object
+ * Example: 04.May.1993 13:07:25 -> subMinute(9); -> 04.May.1993 12:58:25
+ *
+ * @param string|integer|array|Zend_Date $minute Minute to sub
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function subMinute($minute, $locale = null)
+ {
+ return $this->_calcvalue('sub', $minute, 'minute', self::MINUTE_SHORT, $locale);
+ }
+
+
+ /**
+ * Compares the minute with the existing date object.
+ * For example: 10:30:25 -> compareMinute(30) -> 0
+ * Returns if equal, earlier or later
+ *
+ * @param string|integer|array|Zend_Date $minute Hour to compare
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return integer 0 = equal, 1 = later, -1 = earlier
+ * @throws Zend_Date_Exception
+ */
+ public function compareMinute($minute, $locale = null)
+ {
+ return $this->_calcvalue('cmp', $minute, 'minute', self::MINUTE_SHORT, $locale);
+ }
+
+
+ /**
+ * Returns the second as new date object
+ * Example: 02.Feb.1986 10:30:25 -> 01.Jan.1970 00:00:25
+ *
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date
+ */
+ public function getSecond($locale = null)
+ {
+ if (self::$_options['format_type'] == 'php') {
+ $format = 's';
+ } else {
+ $format = self::SECOND;
+ }
+
+ return $this->copyPart($format, $locale);
+ }
+
+
+ /**
+ * Sets new seconds to the existing date object.
+ * The second is always a number.
+ * Returned is the new date object
+ * Example: 04.May.1993 13:07:25 -> setSecond(100); -> 04.May.1993 13:08:40
+ *
+ * @param string|integer|array|Zend_Date $second Second to set
+ * @param string|Zend_Locale $locale (Optional) Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function setSecond($second, $locale = null)
+ {
+ return $this->_calcvalue('set', $second, 'second', self::SECOND_SHORT, $locale);
+ }
+
+
+ /**
+ * Adds seconds to the existing date object.
+ * The second is always a number.
+ * Returned is the new date object
+ * Example: 04.May.1993 13:07:25 -> addSecond(65); -> 04.May.1993 13:08:30
+ *
+ * @param string|integer|array|Zend_Date $second Second to add
+ * @param string|Zend_Locale $locale (Optional) Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function addSecond($second, $locale = null)
+ {
+ return $this->_calcvalue('add', $second, 'second', self::SECOND_SHORT, $locale);
+ }
+
+
+ /**
+ * Subtracts seconds from the existing date object.
+ * The second is always a number.
+ * Returned is the new date object
+ * Example: 04.May.1993 13:07:25 -> subSecond(10); -> 04.May.1993 13:07:15
+ *
+ * @param string|integer|array|Zend_Date $second Second to sub
+ * @param string|Zend_Locale $locale (Optional) Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function subSecond($second, $locale = null)
+ {
+ return $this->_calcvalue('sub', $second, 'second', self::SECOND_SHORT, $locale);
+ }
+
+
+ /**
+ * Compares the second with the existing date object.
+ * For example: 10:30:25 -> compareSecond(25) -> 0
+ * Returns if equal, earlier or later
+ *
+ * @param string|integer|array|Zend_Date $second Second to compare
+ * @param string|Zend_Locale $locale (Optional) Locale for parsing input
+ * @return integer 0 = equal, 1 = later, -1 = earlier
+ * @throws Zend_Date_Exception
+ */
+ public function compareSecond($second, $locale = null)
+ {
+ return $this->_calcvalue('cmp', $second, 'second', self::SECOND_SHORT, $locale);
+ }
+
+
+ /**
+ * Returns the precision for fractional seconds
+ *
+ * @return integer
+ */
+ public function getFractionalPrecision()
+ {
+ return $this->_precision;
+ }
+
+
+ /**
+ * Sets a new precision for fractional seconds
+ *
+ * @param integer $precision Precision for the fractional datepart 3 = milliseconds
+ * @throws Zend_Date_Exception
+ * @return Zend_Date Provides a fluent interface
+ */
+ public function setFractionalPrecision($precision)
+ {
+ if (!intval($precision) or ($precision < 0) or ($precision > 9)) {
+ throw new Zend_Date_Exception("precision ($precision) must be a positive integer less than 10", 0, null, $precision);
+ }
+
+ $this->_precision = (int) $precision;
+ if ($this->_precision < strlen($this->_fractional)) {
+ $this->_fractional = substr($this->_fractional, 0, $this->_precision);
+ } else {
+ $this->_fractional = str_pad($this->_fractional, $this->_precision, '0', STR_PAD_RIGHT);
+ }
+
+ return $this;
+ }
+
+
+ /**
+ * Returns the milliseconds of the date object
+ *
+ * @return string
+ */
+ public function getMilliSecond()
+ {
+ return $this->_fractional;
+ }
+
+ /**
+ * Sets new milliseconds for the date object
+ * Example: setMilliSecond(550, 2) -> equals +5 Sec +50 MilliSec
+ *
+ * @param integer|Zend_Date $milli (Optional) Millisecond to set, when null the actual millisecond is set
+ * @param integer $precision (Optional) Fraction precision of the given milliseconds
+ * @throws Zend_Date_Exception
+ * @return Zend_Date Provides a fluent interface
+ */
+ public function setMilliSecond($milli = null, $precision = null)
+ {
+ if ($milli === null) {
+ list($milli, $time) = explode(" ", microtime());
+ $milli = intval($milli);
+ $precision = 6;
+ } else if (!is_numeric($milli)) {
+ throw new Zend_Date_Exception("invalid milli second ($milli) operand", 0, null, $milli);
+ }
+
+ if ($precision === null) {
+ $precision = $this->_precision;
+ }
+
+ if (!is_int($precision) || $precision < 1 || $precision > 9) {
+ throw new Zend_Date_Exception("precision ($precision) must be a positive integer less than 10", 0, null, $precision);
+ }
+
+ $this->_fractional = 0;
+ $this->addMilliSecond($milli, $precision);
+ return $this;
+ }
+
+ /**
+ * Adds milliseconds to the date object
+ *
+ * @param integer|Zend_Date $milli (Optional) Millisecond to add, when null the actual millisecond is added
+ * @param integer $precision (Optional) Fractional precision for the given milliseconds
+ * @throws Zend_Date_Exception
+ * @return Zend_Date Provides a fluent interface
+ */
+ public function addMilliSecond($milli = null, $precision = null)
+ {
+ if ($milli === null) {
+ list($milli, $time) = explode(" ", microtime());
+ $milli = intval($milli);
+ } else if (!is_numeric($milli)) {
+ throw new Zend_Date_Exception("invalid milli second ($milli) operand", 0, null, $milli);
+ }
+
+ if ($precision === null) {
+ // Use internal default precision
+ // Is not as logic as using the length of the input. But this would break tests and maybe other things
+ // as an input value of integer 10, which is used in tests, must be parsed as 10 milliseconds (real milliseconds, precision 3)
+ // but with auto-detect of precision, 100 milliseconds would be added.
+ $precision = $this->_precision;
+ }
+
+ if (!is_int($precision) || $precision < 1 || $precision > 9) {
+ throw new Zend_Date_Exception(
+ "precision ($precision) must be a positive integer less than 10", 0, null, $precision
+ );
+ }
+
+ if ($this->_precision > $precision) {
+ $milli = $milli * pow(10, $this->_precision - $precision);
+ } elseif ($this->_precision < $precision) {
+ $milli = round($milli / pow(10, $precision - $this->_precision));
+ }
+
+ $this->_fractional += $milli;
+
+ // Add/sub milliseconds + add/sub seconds
+ $max = pow(10, $this->_precision);
+ // Milli includes seconds
+ if ($this->_fractional >= $max) {
+ while ($this->_fractional >= $max) {
+ $this->addSecond(1);
+ $this->_fractional -= $max;
+ }
+ }
+
+ if ($this->_fractional < 0) {
+ while ($this->_fractional < 0) {
+ $this->subSecond(1);
+ $this->_fractional += $max;
+ }
+ }
+
+ if ($this->_precision > strlen($this->_fractional)) {
+ $this->_fractional = str_pad($this->_fractional, $this->_precision, '0', STR_PAD_LEFT);
+ }
+
+ return $this;
+ }
+
+
+ /**
+ * Subtracts a millisecond
+ *
+ * @param integer|Zend_Date $milli (Optional) Millisecond to sub, when null the actual millisecond is subtracted
+ * @param integer $precision (Optional) Fractional precision for the given milliseconds
+ * @return Zend_Date Provides a fluent interface
+ */
+ public function subMilliSecond($milli = null, $precision = null)
+ {
+ $this->addMilliSecond(0 - $milli, $precision);
+ return $this;
+ }
+
+ /**
+ * Compares only the millisecond part, returning the difference
+ *
+ * @param integer|Zend_Date $milli OPTIONAL Millisecond to compare, when null the actual millisecond is compared
+ * @param integer $precision OPTIONAL Fractional precision for the given milliseconds
+ * @throws Zend_Date_Exception On invalid input
+ * @return integer 0 = equal, 1 = later, -1 = earlier
+ */
+ public function compareMilliSecond($milli = null, $precision = null)
+ {
+ if ($milli === null) {
+ list($milli, $time) = explode(" ", microtime());
+ $milli = intval($milli);
+ } else if (is_numeric($milli) === false) {
+ throw new Zend_Date_Exception("invalid milli second ($milli) operand", 0, null, $milli);
+ }
+
+ if ($precision === null) {
+ $precision = strlen($milli);
+ } else if (!is_int($precision) || $precision < 1 || $precision > 9) {
+ throw new Zend_Date_Exception("precision ($precision) must be a positive integer less than 10", 0, null, $precision);
+ }
+
+ if ($precision === 0) {
+ throw new Zend_Date_Exception('precision is 0');
+ }
+
+ if ($precision != $this->_precision) {
+ if ($precision > $this->_precision) {
+ $diff = $precision - $this->_precision;
+ $milli = (int) ($milli / (10 * $diff));
+ } else {
+ $diff = $this->_precision - $precision;
+ $milli = (int) ($milli * (10 * $diff));
+ }
+ }
+
+ $comp = $this->_fractional - $milli;
+ if ($comp < 0) {
+ return -1;
+ } else if ($comp > 0) {
+ return 1;
+ }
+ return 0;
+ }
+
+ /**
+ * Returns the week as new date object using monday as begining of the week
+ * Example: 12.Jan.2007 -> 08.Jan.1970 00:00:00
+ *
+ * @param Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date
+ */
+ public function getWeek($locale = null)
+ {
+ if (self::$_options['format_type'] == 'php') {
+ $format = 'W';
+ } else {
+ $format = self::WEEK;
+ }
+
+ return $this->copyPart($format, $locale);
+ }
+
+ /**
+ * Sets a new week. The week is always a number. The day of week is not changed.
+ * Returned is the new date object
+ * Example: 09.Jan.2007 13:07:25 -> setWeek(1); -> 02.Jan.2007 13:07:25
+ *
+ * @param string|integer|array|Zend_Date $week Week to set
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function setWeek($week, $locale = null)
+ {
+ return $this->_calcvalue('set', $week, 'week', self::WEEK, $locale);
+ }
+
+ /**
+ * Adds a week. The week is always a number. The day of week is not changed.
+ * Returned is the new date object
+ * Example: 09.Jan.2007 13:07:25 -> addWeek(1); -> 16.Jan.2007 13:07:25
+ *
+ * @param string|integer|array|Zend_Date $week Week to add
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function addWeek($week, $locale = null)
+ {
+ return $this->_calcvalue('add', $week, 'week', self::WEEK, $locale);
+ }
+
+ /**
+ * Subtracts a week. The week is always a number. The day of week is not changed.
+ * Returned is the new date object
+ * Example: 09.Jan.2007 13:07:25 -> subWeek(1); -> 02.Jan.2007 13:07:25
+ *
+ * @param string|integer|array|Zend_Date $week Week to sub
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return Zend_Date Provides a fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function subWeek($week, $locale = null)
+ {
+ return $this->_calcvalue('sub', $week, 'week', self::WEEK, $locale);
+ }
+
+ /**
+ * Compares only the week part, returning the difference
+ * Returned is the new date object
+ * Returns if equal, earlier or later
+ * Example: 09.Jan.2007 13:07:25 -> compareWeek(2); -> 0
+ *
+ * @param string|integer|array|Zend_Date $week Week to compare
+ * @param string|Zend_Locale $locale OPTIONAL Locale for parsing input
+ * @return integer 0 = equal, 1 = later, -1 = earlier
+ */
+ public function compareWeek($week, $locale = null)
+ {
+ return $this->_calcvalue('cmp', $week, 'week', self::WEEK, $locale);
+ }
+
+ /**
+ * Sets a new standard locale for the date object.
+ * This locale will be used for all functions
+ * Returned is the really set locale.
+ * Example: 'de_XX' will be set to 'de' because 'de_XX' does not exist
+ * 'xx_YY' will be set to 'root' because 'xx' does not exist
+ *
+ * @param string|Zend_Locale $locale (Optional) Locale for parsing input
+ * @throws Zend_Date_Exception When the given locale does not exist
+ * @return Zend_Date Provides fluent interface
+ */
+ public function setLocale($locale = null)
+ {
+ try {
+ $this->_locale = Zend_Locale::findLocale($locale);
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Date_Exception($e->getMessage(), 0, $e);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns the actual set locale
+ *
+ * @return string
+ */
+ public function getLocale()
+ {
+ return $this->_locale;
+ }
+
+ /**
+ * Checks if the given date is a real date or datepart.
+ * Returns false if a expected datepart is missing or a datepart exceeds its possible border.
+ * But the check will only be done for the expected dateparts which are given by format.
+ * If no format is given the standard dateformat for the actual locale is used.
+ * f.e. 30.February.2007 will return false if format is 'dd.MMMM.YYYY'
+ *
+ * @param string|array|Zend_Date $date Date to parse for correctness
+ * @param string $format (Optional) Format for parsing the date string
+ * @param string|Zend_Locale $locale (Optional) Locale for parsing date parts
+ * @return boolean True when all date parts are correct
+ */
+ public static function isDate($date, $format = null, $locale = null)
+ {
+ if (!is_string($date) && !is_numeric($date) && !($date instanceof Zend_Date) &&
+ !is_array($date)) {
+ return false;
+ }
+
+ if (($format !== null) && ($format != 'ee') && ($format != 'ss') && ($format != 'GG') && ($format != 'MM') && ($format != 'EE') && ($format != 'TT')
+ && (Zend_Locale::isLocale($format, null, false))) {
+ $locale = $format;
+ $format = null;
+ }
+
+ $locale = Zend_Locale::findLocale($locale);
+
+ if ($format === null) {
+ $format = Zend_Locale_Format::getDateFormat($locale);
+ } else if ((self::$_options['format_type'] == 'php') && !defined($format)) {
+ $format = Zend_Locale_Format::convertPhpToIsoFormat($format);
+ }
+
+ $format = self::_getLocalizedToken($format, $locale);
+ if (!is_array($date)) {
+ try {
+ $parsed = Zend_Locale_Format::getDate($date, array('locale' => $locale,
+ 'date_format' => $format, 'format_type' => 'iso',
+ 'fix_date' => false));
+ } catch (Zend_Locale_Exception $e) {
+ // Date can not be parsed
+ return false;
+ }
+ } else {
+ $parsed = $date;
+ }
+
+ if (((strpos($format, 'Y') !== false) or (strpos($format, 'y') !== false)) and
+ (!isset($parsed['year']))) {
+ // Year expected but not found
+ return false;
+ }
+
+ if ((strpos($format, 'M') !== false) and (!isset($parsed['month']))) {
+ // Month expected but not found
+ return false;
+ }
+
+ if ((strpos($format, 'd') !== false) and (!isset($parsed['day']))) {
+ // Day expected but not found
+ return false;
+ }
+
+ if (((strpos($format, 'H') !== false) or (strpos($format, 'h') !== false)) and
+ (!isset($parsed['hour']))) {
+ // Hour expected but not found
+ return false;
+ }
+
+ if ((strpos($format, 'm') !== false) and (!isset($parsed['minute']))) {
+ // Minute expected but not found
+ return false;
+ }
+
+ if ((strpos($format, 's') !== false) and (!isset($parsed['second']))) {
+ // Second expected but not found
+ return false;
+ }
+
+ // Set not given dateparts
+ if (isset($parsed['hour']) === false) {
+ $parsed['hour'] = 12;
+ }
+
+ if (isset($parsed['minute']) === false) {
+ $parsed['minute'] = 0;
+ }
+
+ if (isset($parsed['second']) === false) {
+ $parsed['second'] = 0;
+ }
+
+ if (isset($parsed['month']) === false) {
+ $parsed['month'] = 1;
+ }
+
+ if (isset($parsed['day']) === false) {
+ $parsed['day'] = 1;
+ }
+
+ if (isset($parsed['year']) === false) {
+ $parsed['year'] = 1970;
+ }
+
+ if (self::isYearLeapYear($parsed['year'])) {
+ $parsed['year'] = 1972;
+ } else {
+ $parsed['year'] = 1971;
+ }
+
+ $date = new self($parsed, null, $locale);
+ $timestamp = $date->mktime($parsed['hour'], $parsed['minute'], $parsed['second'],
+ $parsed['month'], $parsed['day'], $parsed['year']);
+
+ if ($parsed['year'] != $date->date('Y', $timestamp)) {
+ // Given year differs from parsed year
+ return false;
+ }
+
+ if ($parsed['month'] != $date->date('n', $timestamp)) {
+ // Given month differs from parsed month
+ return false;
+ }
+
+ if ($parsed['day'] != $date->date('j', $timestamp)) {
+ // Given day differs from parsed day
+ return false;
+ }
+
+ if ($parsed['hour'] != $date->date('G', $timestamp)) {
+ // Given hour differs from parsed hour
+ return false;
+ }
+
+ if ($parsed['minute'] != $date->date('i', $timestamp)) {
+ // Given minute differs from parsed minute
+ return false;
+ }
+
+ if ($parsed['second'] != $date->date('s', $timestamp)) {
+ // Given second differs from parsed second
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns the ISO Token for all localized constants
+ *
+ * @param string $token Token to normalize
+ * @param string $locale Locale to search
+ * @return string
+ */
+ protected static function _getLocalizedToken($token, $locale)
+ {
+ switch($token) {
+ case self::ISO_8601 :
+ return "yyyy-MM-ddThh:mm:ss";
+ break;
+ case self::RFC_2822 :
+ return "EEE, dd MMM yyyy HH:mm:ss";
+ break;
+ case self::DATES :
+ return Zend_Locale_Data::getContent($locale, 'date');
+ break;
+ case self::DATE_FULL :
+ return Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'full'));
+ break;
+ case self::DATE_LONG :
+ return Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'long'));
+ break;
+ case self::DATE_MEDIUM :
+ return Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'medium'));
+ break;
+ case self::DATE_SHORT :
+ return Zend_Locale_Data::getContent($locale, 'date', array('gregorian', 'short'));
+ break;
+ case self::TIMES :
+ return Zend_Locale_Data::getContent($locale, 'time');
+ break;
+ case self::TIME_FULL :
+ return Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'full'));
+ break;
+ case self::TIME_LONG :
+ return Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'long'));
+ break;
+ case self::TIME_MEDIUM :
+ return Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'medium'));
+ break;
+ case self::TIME_SHORT :
+ return Zend_Locale_Data::getContent($locale, 'time', array('gregorian', 'short'));
+ break;
+ case self::DATETIME :
+ return Zend_Locale_Data::getContent($locale, 'datetime');
+ break;
+ case self::DATETIME_FULL :
+ return Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'full'));
+ break;
+ case self::DATETIME_LONG :
+ return Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'long'));
+ break;
+ case self::DATETIME_MEDIUM :
+ return Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'medium'));
+ break;
+ case self::DATETIME_SHORT :
+ return Zend_Locale_Data::getContent($locale, 'datetime', array('gregorian', 'short'));
+ break;
+ case self::ATOM :
+ case self::RFC_3339 :
+ case self::W3C :
+ return "yyyy-MM-DD HH:mm:ss";
+ break;
+ case self::COOKIE :
+ case self::RFC_850 :
+ return "EEEE, dd-MM-yyyy HH:mm:ss";
+ break;
+ case self::RFC_822 :
+ case self::RFC_1036 :
+ case self::RFC_1123 :
+ case self::RSS :
+ return "EEE, dd MM yyyy HH:mm:ss";
+ break;
+ }
+
+ return $token;
+ }
+}
diff --git a/library/vendor/Zend/Date/Cities.php b/library/vendor/Zend/Date/Cities.php
new file mode 100644
index 0000000..7b5f59a
--- /dev/null
+++ b/library/vendor/Zend/Date/Cities.php
@@ -0,0 +1,321 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Date
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Additional data for sunset/sunrise calculations
+ *
+ * Holds the geographical data for all capital cities and many others worldwide
+ * Original data from http://www.fallingrain.com/world/
+ *
+ * @category Zend
+ * @package Zend_Date
+ * @subpackage Zend_Date_Cities
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Date_Cities
+{
+ /**
+ * Array Collection of known cities
+ *
+ * The array contains 'latitude' and 'longitude' for every known city
+ *
+ * @var Array
+ */
+ public static $cities = array(
+ 'Abidjan' => array('latitude' => 5.3411111, 'longitude' => -4.0280556),
+ 'Abu Dhabi' => array('latitude' => 24.4666667, 'longitude' => 54.3666667),
+ 'Abuja' => array('latitude' => 9.1758333, 'longitude' => 7.1808333),
+ 'Accra' => array('latitude' => 5.55, 'longitude' => -0.2166667),
+ 'Adamstown' => array('latitude' => -25.0666667, 'longitude' => -130.0833333),
+ 'Addis Ababa' => array('latitude' => 9.0333333, 'longitude' => 38.7),
+ 'Adelaide' => array('latitude' => -34.9333333, 'longitude' => 138.6),
+ 'Algiers' => array('latitude' => 36.7630556, 'longitude' => 3.0505556),
+ 'Alofi' => array('latitude' => -19.0166667, 'longitude' => -169.9166667),
+ 'Amman' => array('latitude' => 31.95, 'longitude' => 35.9333333),
+ 'Amsterdam' => array('latitude' => 52.35, 'longitude' => 4.9166667),
+ 'Andorra la Vella' => array('latitude' => 42.5, 'longitude' => 1.5166667),
+ 'Ankara' => array('latitude' => 39.9272222, 'longitude' => 32.8644444),
+ 'Antananarivo' => array('latitude' => -18.9166667, 'longitude' => 47.5166667),
+ 'Apia' => array('latitude' => -13.8333333, 'longitude' => -171.7333333),
+ 'Ashgabat' => array('latitude' => 37.95, 'longitude' => 58.3833333),
+ 'Asmara' => array('latitude' => 15.3333333, 'longitude' => 38.9333333),
+ 'Astana' => array('latitude' => 51.1811111, 'longitude' => 71.4277778),
+ 'Asunción' => array('latitude' => -25.2666667, 'longitude' => -57.6666667),
+ 'Athens' => array('latitude' => 37.9833333, 'longitude' => 23.7333333),
+ 'Auckland' => array('latitude' => -36.8666667, 'longitude' => 174.7666667),
+ 'Avarua' => array('latitude' => -21.2, 'longitude' => -159.7666667),
+ 'Baghdad' => array('latitude' => 33.3386111, 'longitude' => 44.3938889),
+ 'Baku' => array('latitude' => 40.3952778, 'longitude' => 49.8822222),
+ 'Bamako' => array('latitude' => 12.65, 'longitude' => -8),
+ 'Bandar Seri Begawan' => array('latitude' => 4.8833333, 'longitude' => 114.9333333),
+ 'Bankok' => array('latitude' => 13.5833333, 'longitude' => 100.2166667),
+ 'Bangui' => array('latitude' => 4.3666667, 'longitude' => 18.5833333),
+ 'Banjul' => array('latitude' => 13.4530556, 'longitude' => -16.5775),
+ 'Basel' => array('latitude' => 47.5666667, 'longitude' => 7.6),
+ 'Basseterre' => array('latitude' => 17.3, 'longitude' => -62.7166667),
+ 'Beijing' => array('latitude' => 39.9288889, 'longitude' => 116.3883333),
+ 'Beirut' => array('latitude' => 33.8719444, 'longitude' => 35.5097222),
+ 'Belgrade' => array('latitude' => 44.8186111, 'longitude' => 20.4680556),
+ 'Belmopan' => array('latitude' => 17.25, 'longitude' => -88.7666667),
+ 'Berlin' => array('latitude' => 52.5166667, 'longitude' => 13.4),
+ 'Bern' => array('latitude' => 46.9166667, 'longitude' => 7.4666667),
+ 'Bishkek' => array('latitude' => 42.8730556, 'longitude' => 74.6002778),
+ 'Bissau' => array('latitude' => 11.85, 'longitude' => -15.5833333),
+ 'Bloemfontein' => array('latitude' => -29.1333333, 'longitude' => 26.2),
+ 'Bogotá' => array('latitude' => 4.6, 'longitude' => -74.0833333),
+ 'Brasilia' => array('latitude' => -15.7833333, 'longitude' => -47.9166667),
+ 'Bratislava' => array('latitude' => 48.15, 'longitude' => 17.1166667),
+ 'Brazzaville' => array('latitude' => -4.2591667, 'longitude' => 15.2847222),
+ 'Bridgetown' => array('latitude' => 13.1, 'longitude' => -59.6166667),
+ 'Brisbane' => array('latitude' => -27.5, 'longitude' => 153.0166667),
+ 'Brussels' => array('latitude' => 50.8333333, 'longitude' => 4.3333333),
+ 'Bucharest' => array('latitude' => 44.4333333, 'longitude' => 26.1),
+ 'Budapest' => array('latitude' => 47.5, 'longitude' => 19.0833333),
+ 'Buenos Aires' => array('latitude' => -34.5875, 'longitude' => -58.6725),
+ 'Bujumbura' => array('latitude' => -3.3761111, 'longitude' => 29.36),
+ 'Cairo' => array('latitude' => 30.05, 'longitude' => 31.25),
+ 'Calgary' => array('latitude' => 51.0833333, 'longitude' => -114.0833333),
+ 'Canberra' => array('latitude' => -35.2833333, 'longitude' => 149.2166667),
+ 'Cape Town' => array('latitude' => -33.9166667, 'longitude' => 18.4166667),
+ 'Caracas' => array('latitude' => 10.5, 'longitude' => -66.9166667),
+ 'Castries' => array('latitude' => 14, 'longitude' => -61),
+ 'Charlotte Amalie' => array('latitude' => 18.34389, 'longitude' => -64.93111),
+ 'Chicago' => array('latitude' => 41.85, 'longitude' => -87.65),
+ 'Chisinau' => array('latitude' => 47.055556, 'longitude' => 28.8575),
+ 'Cockburn Town' => array('latitude' => 21.4666667, 'longitude' => -71.1333333),
+ 'Colombo' => array('latitude' => 6.9319444, 'longitude' => 79.8477778),
+ 'Conakry' => array('latitude' => 9.5091667, 'longitude' => -13.7122222),
+ 'Copenhagen' => array('latitude' => 55.6666667, 'longitude' => 12.5833333),
+ 'Cotonou' => array('latitude' => 6.35, 'longitude' => 2.4333333),
+ 'Dakar' => array('latitude' => 14.6708333, 'longitude' => -17.4380556),
+ 'Damascus' => array('latitude' => 33.5, 'longitude' => 36.3),
+ 'Dar es Salaam' => array('latitude' => -6.8, 'longitude' => 39.2833333),
+ 'Dhaka' => array('latitude' => 23.7230556, 'longitude' => 90.4086111),
+ 'Dili' => array('latitude' => -8.5586111, 'longitude' => 125.5736111),
+ 'Djibouti' => array('latitude' => 11.595, 'longitude' => 43.1480556),
+ 'Dodoma' => array('latitude' => -6.1833333, 'longitude' => 35.75),
+ 'Doha' => array('latitude' => 25.2866667, 'longitude' => 51.5333333),
+ 'Dubai' => array('latitude' => 25.2522222, 'longitude' => 55.28),
+ 'Dublin' => array('latitude' => 53.3330556, 'longitude' => -6.2488889),
+ 'Dushanbe' => array('latitude' => 38.56, 'longitude' => 68.7738889 ),
+ 'Fagatogo' => array('latitude' => -14.2825, 'longitude' => -170.69),
+ 'Fongafale' => array('latitude' => -8.5166667, 'longitude' => 179.2166667),
+ 'Freetown' => array('latitude' => 8.49, 'longitude' => -13.2341667),
+ 'Gaborone' => array('latitude' => -24.6463889, 'longitude' => 25.9119444),
+ 'Geneva' => array('latitude' => 46.2, 'longitude' => 6.1666667),
+ 'George Town' => array('latitude' => 19.3, 'longitude' => -81.3833333),
+ 'Georgetown' => array('latitude' => 6.8, 'longitude' => -58.1666667),
+ 'Gibraltar' => array('latitude' => 36.1333333, 'longitude' => -5.35),
+ 'Glasgow' => array('latitude' => 55.8333333, 'longitude' => -4.25),
+ 'Guatemala la Nueva' => array('latitude' => 14.6211111, 'longitude' => -90.5269444),
+ 'Hagatna' => array('latitude' => 13.47417, 'longitude' => 144.74778),
+ 'The Hague' => array('latitude' => 52.0833333, 'longitude' => 4.3),
+ 'Hamilton' => array('latitude' => 32.2941667, 'longitude' => -64.7838889),
+ 'Hanoi' => array('latitude' => 21.0333333, 'longitude' => 105.85),
+ 'Harare' => array('latitude' => -17.8177778, 'longitude' => 31.0447222),
+ 'Havana' => array('latitude' => 23.1319444, 'longitude' => -82.3641667),
+ 'Helsinki' => array('latitude' => 60.1755556, 'longitude' => 24.9341667),
+ 'Honiara' => array('latitude' => -9.4333333, 'longitude' => 159.95),
+ 'Islamabad' => array('latitude' => 30.8486111, 'longitude' => 72.4944444),
+ 'Istanbul' => array('latitude' => 41.0186111, 'longitude' => 28.9647222),
+ 'Jakarta' => array('latitude' => -6.1744444, 'longitude' => 106.8294444),
+ 'Jamestown' => array('latitude' => -15.9333333, 'longitude' => -5.7166667),
+ 'Jerusalem' => array('latitude' => 31.7666667, 'longitude' => 35.2333333),
+ 'Johannesburg' => array('latitude' => -26.2, 'longitude' => 28.0833333),
+ 'Kabul' => array('latitude' => 34.5166667, 'longitude' => 69.1833333),
+ 'Kampala' => array('latitude' => 0.3155556, 'longitude' => 32.5655556),
+ 'Kathmandu' => array('latitude' => 27.7166667, 'longitude' => 85.3166667),
+ 'Khartoum' => array('latitude' => 15.5880556, 'longitude' => 32.5341667),
+ 'Kigali' => array('latitude' => -1.9536111, 'longitude' => 30.0605556),
+ 'Kingston' => array('latitude' => -29.05, 'longitude' => 167.95),
+ 'Kingstown' => array('latitude' => 13.1333333, 'longitude' => -61.2166667),
+ 'Kinshasa' => array('latitude' => -4.3, 'longitude' => 15.3),
+ 'Kolkata' => array('latitude' => 22.5697222, 'longitude' => 88.3697222),
+ 'Kuala Lumpur' => array('latitude' => 3.1666667, 'longitude' => 101.7),
+ 'Kuwait City' => array('latitude' => 29.3697222, 'longitude' => 47.9783333),
+ 'Kiev' => array('latitude' => 50.4333333, 'longitude' => 30.5166667),
+ 'La Paz' => array('latitude' => -16.5, 'longitude' => -68.15),
+ 'Libreville' => array('latitude' => 0.3833333, 'longitude' => 9.45),
+ 'Lilongwe' => array('latitude' => -13.9833333, 'longitude' => 33.7833333),
+ 'Lima' => array('latitude' => -12.05, 'longitude' => -77.05),
+ 'Lisbon' => array('latitude' => 38.7166667, 'longitude' => -9.1333333),
+ 'Ljubljana' => array('latitude' => 46.0552778, 'longitude' => 14.5144444),
+ 'Lobamba' => array('latitude' => -26.4666667, 'longitude' => 31.2),
+ 'Lomé' => array('latitude' => 9.7166667, 'longitude' => 38.3),
+ 'London' => array('latitude' => 51.5, 'longitude' => -0.1166667),
+ 'Los Angeles' => array('latitude' => 34.05222, 'longitude' => -118.24278),
+ 'Luanda' => array('latitude' => -8.8383333, 'longitude' => 13.2344444),
+ 'Lusaka' => array('latitude' => -15.4166667, 'longitude' => 28.2833333),
+ 'Luxembourg' => array('latitude' => 49.6116667, 'longitude' => 6.13),
+ 'Madrid' => array('latitude' => 40.4, 'longitude' => -3.6833333),
+ 'Majuro' => array('latitude' => 7.1, 'longitude' => 171.3833333),
+ 'Malabo' => array('latitude' => 3.75, 'longitude' => 8.7833333),
+ 'Managua' => array('latitude' => 12.1508333, 'longitude' => -86.2683333),
+ 'Manama' => array('latitude' => 26.2361111, 'longitude' => 50.5830556),
+ 'Manila' => array('latitude' => 14.6041667, 'longitude' => 120.9822222),
+ 'Maputo' => array('latitude' => -25.9652778, 'longitude' => 32.5891667),
+ 'Maseru' => array('latitude' => -29.3166667, 'longitude' => 27.4833333),
+ 'Mbabane' => array('latitude' => -26.3166667, 'longitude' => 31.1333333),
+ 'Melbourne' => array('latitude' => -37.8166667, 'longitude' => 144.9666667),
+ 'Melekeok' => array('latitude' => 7.4933333, 'longitude' => 134.6341667),
+ 'Mexiko City' => array('latitude' => 19.4341667, 'longitude' => -99.1386111),
+ 'Minsk' => array('latitude' => 53.9, 'longitude' => 27.5666667),
+ 'Mogadishu' => array('latitude' => 2.0666667, 'longitude' => 45.3666667),
+ 'Monaco' => array('latitude' => 43.7333333, 'longitude' => 7.4166667),
+ 'Monrovia' => array('latitude' => 6.3105556, 'longitude' => -10.8047222),
+ 'Montevideo' => array('latitude' => -34.8580556, 'longitude' => -56.1708333),
+ 'Montreal' => array('latitude' => 45.5, 'longitude' => -73.5833333),
+ 'Moroni' => array('latitude' => -11.7041667, 'longitude' => 43.2402778),
+ 'Moscow' => array('latitude' => 55.7522222, 'longitude' => 37.6155556),
+ 'Muscat' => array('latitude' => 23.6133333, 'longitude' => 58.5933333),
+ 'Nairobi' => array('latitude' => -1.3166667, 'longitude' => 36.8333333),
+ 'Nassau' => array('latitude' => 25.0833333, 'longitude' => -77.35),
+ 'N´Djamena' => array('latitude' => 12.1130556, 'longitude' => 15.0491667),
+ 'New Dehli' => array('latitude' => 28.6, 'longitude' => 77.2),
+ 'New York' => array('latitude' => 40.71417, 'longitude' => -74.00639),
+ 'Newcastle' => array('latitude' => -32.9166667, 'longitude' => 151.75),
+ 'Niamey' => array('latitude' => 13.6666667, 'longitude' => 1.7833333),
+ 'Nicosia' => array('latitude' => 35.1666667, 'longitude' => 33.3666667),
+ 'Nouakchott' => array('latitude' => 18.0863889, 'longitude' => -15.9752778),
+ 'Noumea' => array('latitude' => -22.2666667, 'longitude' => 166.45),
+ 'Nuku´alofa' => array('latitude' => -21.1333333, 'longitude' => -175.2),
+ 'Nuuk' => array('latitude' => 64.1833333, 'longitude' => -51.75),
+ 'Oranjestad' => array('latitude' => 12.5166667, 'longitude' => -70.0333333),
+ 'Oslo' => array('latitude' => 59.9166667, 'longitude' => 10.75),
+ 'Ouagadougou' => array('latitude' => 12.3702778, 'longitude' => -1.5247222),
+ 'Palikir' => array('latitude' => 6.9166667, 'longitude' => 158.15),
+ 'Panama City' => array('latitude' => 8.9666667, 'longitude' => -79.5333333),
+ 'Papeete' => array('latitude' => -17.5333333, 'longitude' => -149.5666667),
+ 'Paramaribo' => array('latitude' => 5.8333333, 'longitude' => -55.1666667),
+ 'Paris' => array('latitude' => 48.8666667, 'longitude' => 2.3333333),
+ 'Perth' => array('latitude' => -31.9333333, 'longitude' => 115.8333333),
+ 'Phnom Penh' => array('latitude' => 11.55, 'longitude' => 104.9166667),
+ 'Podgorica' => array('latitude' => 43.7752778, 'longitude' => 19.6827778),
+ 'Port Louis' => array('latitude' => -20.1666667, 'longitude' => 57.5),
+ 'Port Moresby' => array('latitude' => -9.4647222, 'longitude' => 147.1925),
+ 'Port-au-Prince' => array('latitude' => 18.5391667, 'longitude' => -72.335),
+ 'Port of Spain' => array('latitude' => 10.6666667, 'longitude' => -61.5),
+ 'Porto-Novo' => array('latitude' => 6.4833333, 'longitude' => 2.6166667),
+ 'Prague' => array('latitude' => 50.0833333, 'longitude' => 14.4666667),
+ 'Praia' => array('latitude' => 14.9166667, 'longitude' => -23.5166667),
+ 'Pretoria' => array('latitude' => -25.7069444, 'longitude' => 28.2294444),
+ 'Pyongyang' => array('latitude' => 39.0194444, 'longitude' => 125.7547222),
+ 'Quito' => array('latitude' => -0.2166667, 'longitude' => -78.5),
+ 'Rabat' => array('latitude' => 34.0252778, 'longitude' => -6.8361111),
+ 'Reykjavik' => array('latitude' => 64.15, 'longitude' => -21.95),
+ 'Riga' => array('latitude' => 56.95, 'longitude' => 24.1),
+ 'Rio de Janero' => array('latitude' => -22.9, 'longitude' => -43.2333333),
+ 'Road Town' => array('latitude' => 18.4166667, 'longitude' => -64.6166667),
+ 'Rome' => array('latitude' => 41.9, 'longitude' => 12.4833333),
+ 'Roseau' => array('latitude' => 15.3, 'longitude' => -61.4),
+ 'Rotterdam' => array('latitude' => 51.9166667, 'longitude' => 4.5),
+ 'Salvador' => array('latitude' => -12.9833333, 'longitude' => -38.5166667),
+ 'San José' => array('latitude' => 9.9333333, 'longitude' => -84.0833333),
+ 'San Juan' => array('latitude' => 18.46833, 'longitude' => -66.10611),
+ 'San Marino' => array('latitude' => 43.5333333, 'longitude' => 12.9666667),
+ 'San Salvador' => array('latitude' => 13.7086111, 'longitude' => -89.2030556),
+ 'Sanaá' => array('latitude' => 15.3547222, 'longitude' => 44.2066667),
+ 'Santa Cruz' => array('latitude' => -17.8, 'longitude' => -63.1666667),
+ 'Santiago' => array('latitude' => -33.45, 'longitude' => -70.6666667),
+ 'Santo Domingo' => array('latitude' => 18.4666667, 'longitude' => -69.9),
+ 'Sao Paulo' => array('latitude' => -23.5333333, 'longitude' => -46.6166667),
+ 'Sarajevo' => array('latitude' => 43.85, 'longitude' => 18.3833333),
+ 'Seoul' => array('latitude' => 37.5663889, 'longitude' => 126.9997222),
+ 'Shanghai' => array('latitude' => 31.2222222, 'longitude' => 121.4580556),
+ 'Sydney' => array('latitude' => -33.8833333, 'longitude' => 151.2166667),
+ 'Singapore' => array('latitude' => 1.2930556, 'longitude' => 103.8558333),
+ 'Skopje' => array('latitude' => 42, 'longitude' => 21.4333333),
+ 'Sofia' => array('latitude' => 42.6833333, 'longitude' => 23.3166667),
+ 'St. George´s' => array('latitude' => 12.05, 'longitude' => -61.75),
+ 'St. John´s' => array('latitude' => 17.1166667, 'longitude' => -61.85),
+ 'Stanley' => array('latitude' => -51.7, 'longitude' => -57.85),
+ 'Stockholm' => array('latitude' => 59.3333333, 'longitude' => 18.05),
+ 'Suva' => array('latitude' => -18.1333333, 'longitude' => 178.4166667),
+ 'Taipei' => array('latitude' => 25.0166667, 'longitude' => 121.45),
+ 'Tallinn' => array('latitude' => 59.4338889, 'longitude' => 24.7280556),
+ 'Tashkent' => array('latitude' => 41.3166667, 'longitude' => 69.25),
+ 'Tbilisi' => array('latitude' => 41.725, 'longitude' => 44.7908333),
+ 'Tegucigalpa' => array('latitude' => 14.1, 'longitude' => -87.2166667),
+ 'Tehran' => array('latitude' => 35.6719444, 'longitude' => 51.4244444),
+ 'The Hague' => array('latitude' => 52.0833333, 'longitude' => 4.3),
+ 'Thimphu' => array('latitude' => 27.4833333, 'longitude' => 89.6),
+ 'Tirana' => array('latitude' => 41.3275, 'longitude' => 19.8188889),
+ 'Tiraspol' => array('latitude' => 46.8402778, 'longitude' => 29.6433333),
+ 'Tokyo' => array('latitude' => 35.685, 'longitude' => 139.7513889),
+ 'Toronto' => array('latitude' => 43.6666667, 'longitude' => -79.4166667),
+ 'Tórshavn' => array('latitude' => 62.0166667, 'longitude' => -6.7666667),
+ 'Tripoli' => array('latitude' => 32.8925, 'longitude' => 13.18),
+ 'Tunis' => array('latitude' => 36.8027778, 'longitude' => 10.1797222),
+ 'Ulaanbaatar' => array('latitude' => 47.9166667, 'longitude' => 106.9166667),
+ 'Vaduz' => array('latitude' => 47.1333333, 'longitude' => 9.5166667),
+ 'Valletta' => array('latitude' => 35.8997222, 'longitude' => 14.5147222),
+ 'Valparaiso' => array('latitude' => -33.0477778, 'longitude' => -71.6011111),
+ 'Vancouver' => array('latitude' => 49.25, 'longitude' => -123.1333333),
+ 'Vatican City' => array('latitude' => 41.9, 'longitude' => 12.4833333),
+ 'Victoria' => array('latitude' => -4.6166667, 'longitude' => 55.45),
+ 'Vienna' => array('latitude' => 48.2, 'longitude' => 16.3666667),
+ 'Vientaine' => array('latitude' => 17.9666667, 'longitude' => 102.6),
+ 'Vilnius' => array('latitude' => 54.6833333, 'longitude' => 25.3166667),
+ 'Warsaw' => array('latitude' => 52.25, 'longitude' => 21),
+ 'Washington dc' => array('latitude' => 38.895, 'longitude' => -77.03667),
+ 'Wellington' => array('latitude' => -41.3, 'longitude' => 174.7833333),
+ 'Willemstad' => array('latitude' => 12.1, 'longitude' => -68.9166667),
+ 'Windhoek' => array('latitude' => -22.57, 'longitude' => 17.0836111),
+ 'Yamoussoukro' => array('latitude' => 6.8166667, 'longitude' => -5.2833333),
+ 'Yaoundé' => array('latitude' => 3.8666667, 'longitude' => 11.5166667),
+ 'Yerevan' => array('latitude' => 40.1811111, 'longitude' => 44.5136111),
+ 'Zürich' => array('latitude' => 47.3666667, 'longitude' => 8.55),
+ 'Zagreb' => array('latitude' => 45.8, 'longitude' => 16)
+ );
+
+ /**
+ * Returns the location from the selected city
+ *
+ * @param string $city City to get location for
+ * @param string $horizon Horizon to use :
+ * default: effective
+ * others are civil, nautic, astronomic
+ * @return array
+ * @throws Zend_Date_Exception When city is unknown
+ */
+ public static function City($city, $horizon = false)
+ {
+ foreach (self::$cities as $key => $value) {
+ if (strtolower($key) === strtolower($city)) {
+ $return = $value;
+ $return['horizon'] = $horizon;
+ return $return;
+ }
+ }
+ throw new Zend_Date_Exception('unknown city');
+ }
+
+ /**
+ * Return a list with all known cities
+ *
+ * @return array
+ */
+ public static function getCityList()
+ {
+ return array_keys(self::$cities);
+ }
+}
diff --git a/library/vendor/Zend/Date/DateObject.php b/library/vendor/Zend/Date/DateObject.php
new file mode 100644
index 0000000..5c01d15
--- /dev/null
+++ b/library/vendor/Zend/Date/DateObject.php
@@ -0,0 +1,1094 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Date
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Date
+ * @subpackage Zend_Date_DateObject
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Date_DateObject {
+
+ /**
+ * UNIX Timestamp
+ */
+ private $_unixTimestamp;
+ protected static $_cache = null;
+ protected static $_cacheTags = false;
+ protected static $_defaultOffset = 0;
+
+ /**
+ * active timezone
+ */
+ private $_timezone = 'UTC';
+ private $_offset = 0;
+ private $_syncronised = 0;
+
+ // turn off DST correction if UTC or GMT
+ protected $_dst = true;
+
+ /**
+ * Table of Monthdays
+ */
+ private static $_monthTable = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
+
+ /**
+ * Table of Years
+ */
+ private static $_yearTable = array(
+ 1970 => 0, 1960 => -315619200, 1950 => -631152000,
+ 1940 => -946771200, 1930 => -1262304000, 1920 => -1577923200,
+ 1910 => -1893456000, 1900 => -2208988800, 1890 => -2524521600,
+ 1880 => -2840140800, 1870 => -3155673600, 1860 => -3471292800,
+ 1850 => -3786825600, 1840 => -4102444800, 1830 => -4417977600,
+ 1820 => -4733596800, 1810 => -5049129600, 1800 => -5364662400,
+ 1790 => -5680195200, 1780 => -5995814400, 1770 => -6311347200,
+ 1760 => -6626966400, 1750 => -6942499200, 1740 => -7258118400,
+ 1730 => -7573651200, 1720 => -7889270400, 1710 => -8204803200,
+ 1700 => -8520336000, 1690 => -8835868800, 1680 => -9151488000,
+ 1670 => -9467020800, 1660 => -9782640000, 1650 => -10098172800,
+ 1640 => -10413792000, 1630 => -10729324800, 1620 => -11044944000,
+ 1610 => -11360476800, 1600 => -11676096000);
+
+ /**
+ * Set this object to have a new UNIX timestamp.
+ *
+ * @param string|integer $timestamp OPTIONAL timestamp; defaults to local time using time()
+ * @return string|integer old timestamp
+ * @throws Zend_Date_Exception
+ */
+ protected function setUnixTimestamp($timestamp = null)
+ {
+ $old = $this->_unixTimestamp;
+
+ if (is_numeric($timestamp)) {
+ $this->_unixTimestamp = $timestamp;
+ } else if ($timestamp === null) {
+ $this->_unixTimestamp = time();
+ } else {
+ throw new Zend_Date_Exception('\'' . $timestamp . '\' is not a valid UNIX timestamp', 0, null, $timestamp);
+ }
+
+ return $old;
+ }
+
+ /**
+ * Returns this object's UNIX timestamp
+ * A timestamp greater then the integer range will be returned as string
+ * This function does not return the timestamp as object. Use copy() instead.
+ *
+ * @return integer|string timestamp
+ */
+ protected function getUnixTimestamp()
+ {
+ if ($this->_unixTimestamp === intval($this->_unixTimestamp)) {
+ return (int) $this->_unixTimestamp;
+ } else {
+ return (string) $this->_unixTimestamp;
+ }
+ }
+
+ /**
+ * Internal function.
+ * Returns time(). This method exists to allow unit tests to work-around methods that might otherwise
+ * be hard-coded to use time(). For example, this makes it possible to test isYesterday() in Date.php.
+ *
+ * @param integer $sync OPTIONAL time syncronisation value
+ * @return integer timestamp
+ */
+ protected function _getTime($sync = null)
+ {
+ if ($sync !== null) {
+ $this->_syncronised = round($sync);
+ }
+ return (time() + $this->_syncronised);
+ }
+
+ /**
+ * Internal mktime function used by Zend_Date.
+ * The timestamp returned by mktime() can exceed the precision of traditional UNIX timestamps,
+ * by allowing PHP to auto-convert to using a float value.
+ *
+ * Returns a timestamp relative to 1970/01/01 00:00:00 GMT/UTC.
+ * DST (Summer/Winter) is depriciated since php 5.1.0.
+ * Year has to be 4 digits otherwise it would be recognised as
+ * year 70 AD instead of 1970 AD as expected !!
+ *
+ * @param integer $hour
+ * @param integer $minute
+ * @param integer $second
+ * @param integer $month
+ * @param integer $day
+ * @param integer $year
+ * @param boolean $gmt OPTIONAL true = other arguments are for UTC time, false = arguments are for local time/date
+ * @return integer|float timestamp (number of seconds elapsed relative to 1970/01/01 00:00:00 GMT/UTC)
+ */
+ protected function mktime($hour, $minute, $second, $month, $day, $year, $gmt = false)
+ {
+ // complete date but in 32bit timestamp - use PHP internal
+ if ((1901 < $year) and ($year < 2038)) {
+
+ $oldzone = @date_default_timezone_get();
+ // Timezone also includes DST settings, therefor substracting the GMT offset is not enough
+ // We have to set the correct timezone to get the right value
+ if (($this->_timezone != $oldzone) and ($gmt === false)) {
+ date_default_timezone_set($this->_timezone);
+ }
+ $result = ($gmt) ? @gmmktime($hour, $minute, $second, $month, $day, $year)
+ : @mktime($hour, $minute, $second, $month, $day, $year);
+ date_default_timezone_set($oldzone);
+
+ return $result;
+ }
+
+ if ($gmt !== true) {
+ $second += $this->_offset;
+ }
+
+ if (isset(self::$_cache)) {
+ $id = strtr('Zend_DateObject_mkTime_' . $this->_offset . '_' . $year.$month.$day.'_'.$hour.$minute.$second . '_'.(int)$gmt, '-','_');
+ if ($result = self::$_cache->load($id)) {
+ return unserialize($result);
+ }
+ }
+
+ // date to integer
+ $day = intval($day);
+ $month = intval($month);
+ $year = intval($year);
+
+ // correct months > 12 and months < 1
+ if ($month > 12) {
+ $overlap = floor($month / 12);
+ $year += $overlap;
+ $month -= $overlap * 12;
+ } else {
+ $overlap = ceil((1 - $month) / 12);
+ $year -= $overlap;
+ $month += $overlap * 12;
+ }
+
+ $date = 0;
+ if ($year >= 1970) {
+
+ // Date is after UNIX epoch
+ // go through leapyears
+ // add months from latest given year
+ for ($count = 1970; $count <= $year; $count++) {
+
+ $leapyear = self::isYearLeapYear($count);
+ if ($count < $year) {
+
+ $date += 365;
+ if ($leapyear === true) {
+ $date++;
+ }
+
+ } else {
+
+ for ($mcount = 0; $mcount < ($month - 1); $mcount++) {
+ $date += self::$_monthTable[$mcount];
+ if (($leapyear === true) and ($mcount == 1)) {
+ $date++;
+ }
+
+ }
+ }
+ }
+
+ $date += $day - 1;
+ $date = (($date * 86400) + ($hour * 3600) + ($minute * 60) + $second);
+ } else {
+
+ // Date is before UNIX epoch
+ // go through leapyears
+ // add months from latest given year
+ for ($count = 1969; $count >= $year; $count--) {
+
+ $leapyear = self::isYearLeapYear($count);
+ if ($count > $year)
+ {
+ $date += 365;
+ if ($leapyear === true)
+ $date++;
+ } else {
+
+ for ($mcount = 11; $mcount > ($month - 1); $mcount--) {
+ $date += self::$_monthTable[$mcount];
+ if (($leapyear === true) and ($mcount == 2)) {
+ $date++;
+ }
+
+ }
+ }
+ }
+
+ $date += (self::$_monthTable[$month - 1] - $day);
+ $date = -(($date * 86400) + (86400 - (($hour * 3600) + ($minute * 60) + $second)));
+
+ // gregorian correction for 5.Oct.1582
+ if ($date < -12220185600) {
+ $date += 864000;
+ } else if ($date < -12219321600) {
+ $date = -12219321600;
+ }
+ }
+
+ if (isset(self::$_cache)) {
+ if (self::$_cacheTags) {
+ self::$_cache->save( serialize($date), $id, array('Zend_Date'));
+ } else {
+ self::$_cache->save( serialize($date), $id);
+ }
+ }
+
+ return $date;
+ }
+
+ /**
+ * Returns true, if given $year is a leap year.
+ *
+ * @param integer $year
+ * @return boolean true, if year is leap year
+ */
+ protected static function isYearLeapYear($year)
+ {
+ // all leapyears can be divided through 4
+ if (($year % 4) != 0) {
+ return false;
+ }
+
+ // all leapyears can be divided through 400
+ if ($year % 400 == 0) {
+ return true;
+ } else if (($year > 1582) and ($year % 100 == 0)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Internal mktime function used by Zend_Date for handling 64bit timestamps.
+ *
+ * Returns a formatted date for a given timestamp.
+ *
+ * @param string $format format for output
+ * @param mixed $timestamp
+ * @param boolean $gmt OPTIONAL true = other arguments are for UTC time, false = arguments are for local time/date
+ * @return string
+ */
+ protected function date($format, $timestamp = null, $gmt = false)
+ {
+ $oldzone = @date_default_timezone_get();
+ if ($this->_timezone != $oldzone) {
+ date_default_timezone_set($this->_timezone);
+ }
+
+ if ($timestamp === null) {
+ $result = ($gmt) ? @gmdate($format) : @date($format);
+ date_default_timezone_set($oldzone);
+ return $result;
+ }
+
+ if (abs($timestamp) <= 0x7FFFFFFF) {
+ // See ZF-11992
+ // "o" will sometimes resolve to the previous year (see
+ // http://php.net/date ; it's part of the ISO 8601
+ // standard). However, this is not desired, so replacing
+ // all occurrences of "o" not preceded by a backslash
+ // with "Y"
+ $format = preg_replace('/(?<!\\\\)o/', 'Y', $format);
+ $result = ($gmt) ? @gmdate($format, $timestamp) : @date($format, $timestamp);
+ date_default_timezone_set($oldzone);
+ return $result;
+ }
+
+ $jump = false;
+ $origstamp = $timestamp;
+ if (isset(self::$_cache)) {
+ $idstamp = strtr('Zend_DateObject_date_' . $this->_offset . '_'. $timestamp . '_'.(int)$gmt, '-','_');
+ if ($result2 = self::$_cache->load($idstamp)) {
+ $timestamp = unserialize($result2);
+ $jump = true;
+ }
+ }
+
+ // check on false or null alone fails
+ if (empty($gmt) and empty($jump)) {
+ $tempstamp = $timestamp;
+ if ($tempstamp > 0) {
+ while (abs($tempstamp) > 0x7FFFFFFF) {
+ $tempstamp -= (86400 * 23376);
+ }
+
+ $dst = date("I", $tempstamp);
+ if ($dst === 1) {
+ $timestamp += 3600;
+ }
+
+ $temp = date('Z', $tempstamp);
+ $timestamp += $temp;
+ }
+
+ if (isset(self::$_cache)) {
+ if (self::$_cacheTags) {
+ self::$_cache->save( serialize($timestamp), $idstamp, array('Zend_Date'));
+ } else {
+ self::$_cache->save( serialize($timestamp), $idstamp);
+ }
+ }
+ }
+
+ if (($timestamp < 0) and ($gmt !== true)) {
+ $timestamp -= $this->_offset;
+ }
+
+ date_default_timezone_set($oldzone);
+ $date = $this->getDateParts($timestamp, true);
+ $length = strlen($format);
+ $output = '';
+
+ for ($i = 0; $i < $length; $i++) {
+ switch($format[$i]) {
+ // day formats
+ case 'd': // day of month, 2 digits, with leading zero, 01 - 31
+ $output .= (($date['mday'] < 10) ? '0' . $date['mday'] : $date['mday']);
+ break;
+
+ case 'D': // day of week, 3 letters, Mon - Sun
+ $output .= date('D', 86400 * (3 + self::dayOfWeek($date['year'], $date['mon'], $date['mday'])));
+ break;
+
+ case 'j': // day of month, without leading zero, 1 - 31
+ $output .= $date['mday'];
+ break;
+
+ case 'l': // day of week, full string name, Sunday - Saturday
+ $output .= date('l', 86400 * (3 + self::dayOfWeek($date['year'], $date['mon'], $date['mday'])));
+ break;
+
+ case 'N': // ISO 8601 numeric day of week, 1 - 7
+ $day = self::dayOfWeek($date['year'], $date['mon'], $date['mday']);
+ if ($day == 0) {
+ $day = 7;
+ }
+ $output .= $day;
+ break;
+
+ case 'S': // english suffix for day of month, st nd rd th
+ if (($date['mday'] % 10) == 1) {
+ $output .= 'st';
+ } else if ((($date['mday'] % 10) == 2) and ($date['mday'] != 12)) {
+ $output .= 'nd';
+ } else if (($date['mday'] % 10) == 3) {
+ $output .= 'rd';
+ } else {
+ $output .= 'th';
+ }
+ break;
+
+ case 'w': // numeric day of week, 0 - 6
+ $output .= self::dayOfWeek($date['year'], $date['mon'], $date['mday']);
+ break;
+
+ case 'z': // day of year, 0 - 365
+ $output .= $date['yday'];
+ break;
+
+
+ // week formats
+ case 'W': // ISO 8601, week number of year
+ $output .= $this->weekNumber($date['year'], $date['mon'], $date['mday']);
+ break;
+
+
+ // month formats
+ case 'F': // string month name, january - december
+ $output .= date('F', mktime(0, 0, 0, $date['mon'], 2, 1971));
+ break;
+
+ case 'm': // number of month, with leading zeros, 01 - 12
+ $output .= (($date['mon'] < 10) ? '0' . $date['mon'] : $date['mon']);
+ break;
+
+ case 'M': // 3 letter month name, Jan - Dec
+ $output .= date('M',mktime(0, 0, 0, $date['mon'], 2, 1971));
+ break;
+
+ case 'n': // number of month, without leading zeros, 1 - 12
+ $output .= $date['mon'];
+ break;
+
+ case 't': // number of day in month
+ $output .= self::$_monthTable[$date['mon'] - 1];
+ break;
+
+
+ // year formats
+ case 'L': // is leap year ?
+ $output .= (self::isYearLeapYear($date['year'])) ? '1' : '0';
+ break;
+
+ case 'o': // ISO 8601 year number
+ $week = $this->weekNumber($date['year'], $date['mon'], $date['mday']);
+ if (($week > 50) and ($date['mon'] == 1)) {
+ $output .= ($date['year'] - 1);
+ } else {
+ $output .= $date['year'];
+ }
+ break;
+
+ case 'Y': // year number, 4 digits
+ $output .= $date['year'];
+ break;
+
+ case 'y': // year number, 2 digits
+ $output .= substr($date['year'], strlen($date['year']) - 2, 2);
+ break;
+
+
+ // time formats
+ case 'a': // lower case am/pm
+ $output .= (($date['hours'] >= 12) ? 'pm' : 'am');
+ break;
+
+ case 'A': // upper case am/pm
+ $output .= (($date['hours'] >= 12) ? 'PM' : 'AM');
+ break;
+
+ case 'B': // swatch internet time
+ $dayseconds = ($date['hours'] * 3600) + ($date['minutes'] * 60) + $date['seconds'];
+ if ($gmt === true) {
+ $dayseconds += 3600;
+ }
+ $output .= (int) (($dayseconds % 86400) / 86.4);
+ break;
+
+ case 'g': // hours without leading zeros, 12h format
+ if ($date['hours'] > 12) {
+ $hour = $date['hours'] - 12;
+ } else {
+ if ($date['hours'] == 0) {
+ $hour = '12';
+ } else {
+ $hour = $date['hours'];
+ }
+ }
+ $output .= $hour;
+ break;
+
+ case 'G': // hours without leading zeros, 24h format
+ $output .= $date['hours'];
+ break;
+
+ case 'h': // hours with leading zeros, 12h format
+ if ($date['hours'] > 12) {
+ $hour = $date['hours'] - 12;
+ } else {
+ if ($date['hours'] == 0) {
+ $hour = '12';
+ } else {
+ $hour = $date['hours'];
+ }
+ }
+ $output .= (($hour < 10) ? '0'.$hour : $hour);
+ break;
+
+ case 'H': // hours with leading zeros, 24h format
+ $output .= (($date['hours'] < 10) ? '0' . $date['hours'] : $date['hours']);
+ break;
+
+ case 'i': // minutes with leading zeros
+ $output .= (($date['minutes'] < 10) ? '0' . $date['minutes'] : $date['minutes']);
+ break;
+
+ case 's': // seconds with leading zeros
+ $output .= (($date['seconds'] < 10) ? '0' . $date['seconds'] : $date['seconds']);
+ break;
+
+
+ // timezone formats
+ case 'e': // timezone identifier
+ if ($gmt === true) {
+ $output .= gmdate('e', mktime($date['hours'], $date['minutes'], $date['seconds'],
+ $date['mon'], $date['mday'], 2000));
+ } else {
+ $output .= date('e', mktime($date['hours'], $date['minutes'], $date['seconds'],
+ $date['mon'], $date['mday'], 2000));
+ }
+ break;
+
+ case 'I': // daylight saving time or not
+ if ($gmt === true) {
+ $output .= gmdate('I', mktime($date['hours'], $date['minutes'], $date['seconds'],
+ $date['mon'], $date['mday'], 2000));
+ } else {
+ $output .= date('I', mktime($date['hours'], $date['minutes'], $date['seconds'],
+ $date['mon'], $date['mday'], 2000));
+ }
+ break;
+
+ case 'O': // difference to GMT in hours
+ $gmtstr = ($gmt === true) ? 0 : $this->getGmtOffset();
+ $output .= sprintf('%s%04d', ($gmtstr <= 0) ? '+' : '-', abs($gmtstr) / 36);
+ break;
+
+ case 'P': // difference to GMT with colon
+ $gmtstr = ($gmt === true) ? 0 : $this->getGmtOffset();
+ $gmtstr = sprintf('%s%04d', ($gmtstr <= 0) ? '+' : '-', abs($gmtstr) / 36);
+ $output = $output . substr($gmtstr, 0, 3) . ':' . substr($gmtstr, 3);
+ break;
+
+ case 'T': // timezone settings
+ if ($gmt === true) {
+ $output .= gmdate('T', mktime($date['hours'], $date['minutes'], $date['seconds'],
+ $date['mon'], $date['mday'], 2000));
+ } else {
+ $output .= date('T', mktime($date['hours'], $date['minutes'], $date['seconds'],
+ $date['mon'], $date['mday'], 2000));
+ }
+ break;
+
+ case 'Z': // timezone offset in seconds
+ $output .= ($gmt === true) ? 0 : -$this->getGmtOffset();
+ break;
+
+
+ // complete time formats
+ case 'c': // ISO 8601 date format
+ $difference = $this->getGmtOffset();
+ $difference = sprintf('%s%04d', ($difference <= 0) ? '+' : '-', abs($difference) / 36);
+ $difference = substr($difference, 0, 3) . ':' . substr($difference, 3);
+ $output .= $date['year'] . '-'
+ . (($date['mon'] < 10) ? '0' . $date['mon'] : $date['mon']) . '-'
+ . (($date['mday'] < 10) ? '0' . $date['mday'] : $date['mday']) . 'T'
+ . (($date['hours'] < 10) ? '0' . $date['hours'] : $date['hours']) . ':'
+ . (($date['minutes'] < 10) ? '0' . $date['minutes'] : $date['minutes']) . ':'
+ . (($date['seconds'] < 10) ? '0' . $date['seconds'] : $date['seconds'])
+ . $difference;
+ break;
+
+ case 'r': // RFC 2822 date format
+ $difference = $this->getGmtOffset();
+ $difference = sprintf('%s%04d', ($difference <= 0) ? '+' : '-', abs($difference) / 36);
+ $output .= gmdate('D', 86400 * (3 + self::dayOfWeek($date['year'], $date['mon'], $date['mday']))) . ', '
+ . (($date['mday'] < 10) ? '0' . $date['mday'] : $date['mday']) . ' '
+ . date('M', mktime(0, 0, 0, $date['mon'], 2, 1971)) . ' '
+ . $date['year'] . ' '
+ . (($date['hours'] < 10) ? '0' . $date['hours'] : $date['hours']) . ':'
+ . (($date['minutes'] < 10) ? '0' . $date['minutes'] : $date['minutes']) . ':'
+ . (($date['seconds'] < 10) ? '0' . $date['seconds'] : $date['seconds']) . ' '
+ . $difference;
+ break;
+
+ case 'U': // Unix timestamp
+ $output .= $origstamp;
+ break;
+
+
+ // special formats
+ case "\\": // next letter to print with no format
+ $i++;
+ if ($i < $length) {
+ $output .= $format[$i];
+ }
+ break;
+
+ default: // letter is no format so add it direct
+ $output .= $format[$i];
+ break;
+ }
+ }
+
+ return (string) $output;
+ }
+
+ /**
+ * Returns the day of week for a Gregorian calendar date.
+ * 0 = sunday, 6 = saturday
+ *
+ * @param integer $year
+ * @param integer $month
+ * @param integer $day
+ * @return integer dayOfWeek
+ */
+ protected static function dayOfWeek($year, $month, $day)
+ {
+ if ((1901 < $year) and ($year < 2038)) {
+ return (int) date('w', mktime(0, 0, 0, $month, $day, $year));
+ }
+
+ // gregorian correction
+ $correction = 0;
+ if (($year < 1582) or (($year == 1582) and (($month < 10) or (($month == 10) && ($day < 15))))) {
+ $correction = 3;
+ }
+
+ if ($month > 2) {
+ $month -= 2;
+ } else {
+ $month += 10;
+ $year--;
+ }
+
+ $day = floor((13 * $month - 1) / 5) + $day + ($year % 100) + floor(($year % 100) / 4);
+ $day += floor(($year / 100) / 4) - 2 * floor($year / 100) + 77 + $correction;
+
+ return (int) ($day - 7 * floor($day / 7));
+ }
+
+ /**
+ * Internal getDateParts function for handling 64bit timestamps, similar to:
+ * http://www.php.net/getdate
+ *
+ * Returns an array of date parts for $timestamp, relative to 1970/01/01 00:00:00 GMT/UTC.
+ *
+ * $fast specifies ALL date parts should be returned (slower)
+ * Default is false, and excludes $dayofweek, weekday, month and timestamp from parts returned.
+ *
+ * @param mixed $timestamp
+ * @param boolean $fast OPTIONAL defaults to fast (false), resulting in fewer date parts
+ * @return array
+ */
+ protected function getDateParts($timestamp = null, $fast = null)
+ {
+
+ // actual timestamp
+ if (!is_numeric($timestamp)) {
+ return getdate();
+ }
+
+ // 32bit timestamp
+ if (abs($timestamp) <= 0x7FFFFFFF) {
+ return @getdate((int) $timestamp);
+ }
+
+ if (isset(self::$_cache)) {
+ $id = strtr('Zend_DateObject_getDateParts_' . $timestamp.'_'.(int)$fast, '-','_');
+ if ($result = self::$_cache->load($id)) {
+ return unserialize($result);
+ }
+ }
+
+ $otimestamp = $timestamp;
+ $numday = 0;
+ $month = 0;
+ // gregorian correction
+ if ($timestamp < -12219321600) {
+ $timestamp -= 864000;
+ }
+
+ // timestamp lower 0
+ if ($timestamp < 0) {
+ $sec = 0;
+ $act = 1970;
+
+ // iterate through 10 years table, increasing speed
+ foreach(self::$_yearTable as $year => $seconds) {
+ if ($timestamp >= $seconds) {
+ $i = $act;
+ break;
+ }
+ $sec = $seconds;
+ $act = $year;
+ }
+
+ $timestamp -= $sec;
+ if (!isset($i)) {
+ $i = $act;
+ }
+
+ // iterate the max last 10 years
+ do {
+ --$i;
+ $day = $timestamp;
+
+ $timestamp += 31536000;
+ $leapyear = self::isYearLeapYear($i);
+ if ($leapyear === true) {
+ $timestamp += 86400;
+ }
+
+ if ($timestamp >= 0) {
+ $year = $i;
+ break;
+ }
+ } while ($timestamp < 0);
+
+ $secondsPerYear = 86400 * ($leapyear ? 366 : 365) + $day;
+
+ $timestamp = $day;
+ // iterate through months
+ for ($i = 12; --$i >= 0;) {
+ $day = $timestamp;
+
+ $timestamp += self::$_monthTable[$i] * 86400;
+ if (($leapyear === true) and ($i == 1)) {
+ $timestamp += 86400;
+ }
+
+ if ($timestamp >= 0) {
+ $month = $i;
+ $numday = self::$_monthTable[$i];
+ if (($leapyear === true) and ($i == 1)) {
+ ++$numday;
+ }
+ break;
+ }
+ }
+
+ $timestamp = $day;
+ $numberdays = $numday + ceil(($timestamp + 1) / 86400);
+
+ $timestamp += ($numday - $numberdays + 1) * 86400;
+ $hours = floor($timestamp / 3600);
+ } else {
+
+ // iterate through years
+ for ($i = 1970;;$i++) {
+ $day = $timestamp;
+
+ $timestamp -= 31536000;
+ $leapyear = self::isYearLeapYear($i);
+ if ($leapyear === true) {
+ $timestamp -= 86400;
+ }
+
+ if ($timestamp < 0) {
+ $year = $i;
+ break;
+ }
+ }
+
+ $secondsPerYear = $day;
+
+ $timestamp = $day;
+ // iterate through months
+ for ($i = 0; $i <= 11; $i++) {
+ $day = $timestamp;
+ $timestamp -= self::$_monthTable[$i] * 86400;
+
+ if (($leapyear === true) and ($i == 1)) {
+ $timestamp -= 86400;
+ }
+
+ if ($timestamp < 0) {
+ $month = $i;
+ $numday = self::$_monthTable[$i];
+ if (($leapyear === true) and ($i == 1)) {
+ ++$numday;
+ }
+ break;
+ }
+ }
+
+ $timestamp = $day;
+ $numberdays = ceil(($timestamp + 1) / 86400);
+ $timestamp = $timestamp - ($numberdays - 1) * 86400;
+ $hours = floor($timestamp / 3600);
+ }
+
+ $timestamp -= $hours * 3600;
+
+ $month += 1;
+ $minutes = floor($timestamp / 60);
+ $seconds = $timestamp - $minutes * 60;
+
+ if ($fast === true) {
+ $array = array(
+ 'seconds' => $seconds,
+ 'minutes' => $minutes,
+ 'hours' => $hours,
+ 'mday' => $numberdays,
+ 'mon' => $month,
+ 'year' => $year,
+ 'yday' => floor($secondsPerYear / 86400),
+ );
+ } else {
+
+ $dayofweek = self::dayOfWeek($year, $month, $numberdays);
+ $array = array(
+ 'seconds' => $seconds,
+ 'minutes' => $minutes,
+ 'hours' => $hours,
+ 'mday' => $numberdays,
+ 'wday' => $dayofweek,
+ 'mon' => $month,
+ 'year' => $year,
+ 'yday' => floor($secondsPerYear / 86400),
+ 'weekday' => gmdate('l', 86400 * (3 + $dayofweek)),
+ 'month' => gmdate('F', mktime(0, 0, 0, $month, 1, 1971)),
+ 0 => $otimestamp
+ );
+ }
+
+ if (isset(self::$_cache)) {
+ if (self::$_cacheTags) {
+ self::$_cache->save( serialize($array), $id, array('Zend_Date'));
+ } else {
+ self::$_cache->save( serialize($array), $id);
+ }
+ }
+
+ return $array;
+ }
+
+ /**
+ * Internal getWeekNumber function for handling 64bit timestamps
+ *
+ * Returns the ISO 8601 week number of a given date
+ *
+ * @param integer $year
+ * @param integer $month
+ * @param integer $day
+ * @return integer
+ */
+ protected function weekNumber($year, $month, $day)
+ {
+ if ((1901 < $year) and ($year < 2038)) {
+ return (int) date('W', mktime(0, 0, 0, $month, $day, $year));
+ }
+
+ $dayofweek = self::dayOfWeek($year, $month, $day);
+ $firstday = self::dayOfWeek($year, 1, 1);
+ if (($month == 1) and (($firstday < 1) or ($firstday > 4)) and ($day < 4)) {
+ $firstday = self::dayOfWeek($year - 1, 1, 1);
+ $month = 12;
+ $day = 31;
+
+ } else if (($month == 12) and ((self::dayOfWeek($year + 1, 1, 1) < 5) and
+ (self::dayOfWeek($year + 1, 1, 1) > 0))) {
+ return 1;
+ }
+
+ return intval (((self::dayOfWeek($year, 1, 1) < 5) and (self::dayOfWeek($year, 1, 1) > 0)) +
+ 4 * ($month - 1) + (2 * ($month - 1) + ($day - 1) + $firstday - $dayofweek + 6) * 36 / 256);
+ }
+
+ /**
+ * Internal _range function
+ * Sets the value $a to be in the range of [0, $b]
+ *
+ * @param float $a - value to correct
+ * @param float $b - maximum range to set
+ */
+ private function _range($a, $b) {
+ while ($a < 0) {
+ $a += $b;
+ }
+ while ($a >= $b) {
+ $a -= $b;
+ }
+ return $a;
+ }
+
+ /**
+ * Calculates the sunrise or sunset based on a location
+ *
+ * @param array $location Location for calculation MUST include 'latitude', 'longitude', 'horizon'
+ * @param bool $horizon true: sunrise; false: sunset
+ * @return mixed - false: midnight sun, integer:
+ */
+ protected function calcSun($location, $horizon, $rise = false)
+ {
+ // timestamp within 32bit
+ if (abs($this->_unixTimestamp) <= 0x7FFFFFFF) {
+ if ($rise === false) {
+ return date_sunset($this->_unixTimestamp, SUNFUNCS_RET_TIMESTAMP, $location['latitude'],
+ $location['longitude'], 90 + $horizon, $this->getGmtOffset() / 3600);
+ }
+ return date_sunrise($this->_unixTimestamp, SUNFUNCS_RET_TIMESTAMP, $location['latitude'],
+ $location['longitude'], 90 + $horizon, $this->getGmtOffset() / 3600);
+ }
+
+ // self calculation - timestamp bigger than 32bit
+ // fix circle values
+ $quarterCircle = 0.5 * M_PI;
+ $halfCircle = M_PI;
+ $threeQuarterCircle = 1.5 * M_PI;
+ $fullCircle = 2 * M_PI;
+
+ // radiant conversion for coordinates
+ $radLatitude = $location['latitude'] * $halfCircle / 180;
+ $radLongitude = $location['longitude'] * $halfCircle / 180;
+
+ // get solar coordinates
+ $tmpRise = $rise ? $quarterCircle : $threeQuarterCircle;
+ $radDay = $this->date('z',$this->_unixTimestamp) + ($tmpRise - $radLongitude) / $fullCircle;
+
+ // solar anomoly and longitude
+ $solAnomoly = $radDay * 0.017202 - 0.0574039;
+ $solLongitude = $solAnomoly + 0.0334405 * sin($solAnomoly);
+ $solLongitude += 4.93289 + 3.49066E-4 * sin(2 * $solAnomoly);
+
+ // get quadrant
+ $solLongitude = $this->_range($solLongitude, $fullCircle);
+
+ if (($solLongitude / $quarterCircle) - intval($solLongitude / $quarterCircle) == 0) {
+ $solLongitude += 4.84814E-6;
+ }
+
+ // solar ascension
+ $solAscension = sin($solLongitude) / cos($solLongitude);
+ $solAscension = atan2(0.91746 * $solAscension, 1);
+
+ // adjust quadrant
+ if ($solLongitude > $threeQuarterCircle) {
+ $solAscension += $fullCircle;
+ } else if ($solLongitude > $quarterCircle) {
+ $solAscension += $halfCircle;
+ }
+
+ // solar declination
+ $solDeclination = 0.39782 * sin($solLongitude);
+ $solDeclination /= sqrt(-$solDeclination * $solDeclination + 1);
+ $solDeclination = atan2($solDeclination, 1);
+
+ $solHorizon = $horizon - sin($solDeclination) * sin($radLatitude);
+ $solHorizon /= cos($solDeclination) * cos($radLatitude);
+
+ // midnight sun, always night
+ if (abs($solHorizon) > 1) {
+ return false;
+ }
+
+ $solHorizon /= sqrt(-$solHorizon * $solHorizon + 1);
+ $solHorizon = $quarterCircle - atan2($solHorizon, 1);
+
+ if ($rise) {
+ $solHorizon = $fullCircle - $solHorizon;
+ }
+
+ // time calculation
+ $localTime = $solHorizon + $solAscension - 0.0172028 * $radDay - 1.73364;
+ $universalTime = $localTime - $radLongitude;
+
+ // determinate quadrant
+ $universalTime = $this->_range($universalTime, $fullCircle);
+
+ // radiant to hours
+ $universalTime *= 24 / $fullCircle;
+
+ // convert to time
+ $hour = intval($universalTime);
+ $universalTime = ($universalTime - $hour) * 60;
+ $min = intval($universalTime);
+ $universalTime = ($universalTime - $min) * 60;
+ $sec = intval($universalTime);
+
+ return $this->mktime($hour, $min, $sec, $this->date('m', $this->_unixTimestamp),
+ $this->date('j', $this->_unixTimestamp), $this->date('Y', $this->_unixTimestamp),
+ -1, true);
+ }
+
+ /**
+ * Sets a new timezone for calculation of $this object's gmt offset.
+ * For a list of supported timezones look here: http://php.net/timezones
+ * If no timezone can be detected or the given timezone is wrong UTC will be set.
+ *
+ * @param string $zone OPTIONAL timezone for date calculation; defaults to date_default_timezone_get()
+ * @return Zend_Date_DateObject Provides fluent interface
+ * @throws Zend_Date_Exception
+ */
+ public function setTimezone($zone = null)
+ {
+ $oldzone = @date_default_timezone_get();
+ if ($zone === null) {
+ $zone = $oldzone;
+ }
+
+ // throw an error on false input, but only if the new date extension is available
+ if (function_exists('timezone_open')) {
+ if (!@timezone_open($zone)) {
+ throw new Zend_Date_Exception("timezone ($zone) is not a known timezone", 0, null, $zone);
+ }
+ }
+ // this can generate an error if the date extension is not available and a false timezone is given
+ $result = @date_default_timezone_set($zone);
+ if ($result === true) {
+ $this->_offset = mktime(0, 0, 0, 1, 2, 1970) - gmmktime(0, 0, 0, 1, 2, 1970);
+ $this->_timezone = $zone;
+ }
+ date_default_timezone_set($oldzone);
+
+ if (($zone == 'UTC') or ($zone == 'GMT')) {
+ $this->_dst = false;
+ } else {
+ $this->_dst = true;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Return the timezone of $this object.
+ * The timezone is initially set when the object is instantiated.
+ *
+ * @return string actual set timezone string
+ */
+ public function getTimezone()
+ {
+ return $this->_timezone;
+ }
+
+ /**
+ * Return the offset to GMT of $this object's timezone.
+ * The offset to GMT is initially set when the object is instantiated using the currently,
+ * in effect, default timezone for PHP functions.
+ *
+ * @return integer seconds difference between GMT timezone and timezone when object was instantiated
+ */
+ public function getGmtOffset()
+ {
+ $date = $this->getDateParts($this->getUnixTimestamp(), true);
+ $zone = @date_default_timezone_get();
+ $result = @date_default_timezone_set($this->_timezone);
+ if ($result === true) {
+ $offset = $this->mktime($date['hours'], $date['minutes'], $date['seconds'],
+ $date['mon'], $date['mday'], $date['year'], false)
+ - $this->mktime($date['hours'], $date['minutes'], $date['seconds'],
+ $date['mon'], $date['mday'], $date['year'], true);
+ }
+ date_default_timezone_set($zone);
+
+ return $offset;
+ }
+
+ /**
+ * Internal method to check if the given cache supports tags
+ *
+ * @param Zend_Cache $cache
+ */
+ protected static function _getTagSupportForCache()
+ {
+ $backend = self::$_cache->getBackend();
+ if ($backend instanceof Zend_Cache_Backend_ExtendedInterface) {
+ $cacheOptions = $backend->getCapabilities();
+ self::$_cacheTags = $cacheOptions['tags'];
+ } else {
+ self::$_cacheTags = false;
+ }
+
+ return self::$_cacheTags;
+ }
+}
diff --git a/library/vendor/Zend/Date/Exception.php b/library/vendor/Zend/Date/Exception.php
new file mode 100644
index 0000000..2585d0b
--- /dev/null
+++ b/library/vendor/Zend/Date/Exception.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Date
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+
+/**
+ * Zend_Exception
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Date
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Date_Exception extends Zend_Exception
+{
+ protected $operand = null;
+
+ public function __construct($message, $code = 0, $e = null, $op = null)
+ {
+ $this->operand = $op;
+ parent::__construct($message, $code, $e);
+ }
+
+ public function getOperand()
+ {
+ return $this->operand;
+ }
+}
diff --git a/library/vendor/Zend/Db.php b/library/vendor/Zend/Db.php
new file mode 100644
index 0000000..1712929
--- /dev/null
+++ b/library/vendor/Zend/Db.php
@@ -0,0 +1,282 @@
+<?php
+
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Class for connecting to SQL databases and performing common operations.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db
+{
+
+ /**
+ * Use the PROFILER constant in the config of a Zend_Db_Adapter.
+ */
+ const PROFILER = 'profiler';
+
+ /**
+ * Use the CASE_FOLDING constant in the config of a Zend_Db_Adapter.
+ */
+ const CASE_FOLDING = 'caseFolding';
+
+ /**
+ * Use the FETCH_MODE constant in the config of a Zend_Db_Adapter.
+ */
+ const FETCH_MODE = 'fetchMode';
+
+ /**
+ * Use the AUTO_QUOTE_IDENTIFIERS constant in the config of a Zend_Db_Adapter.
+ */
+ const AUTO_QUOTE_IDENTIFIERS = 'autoQuoteIdentifiers';
+
+ /**
+ * Use the ALLOW_SERIALIZATION constant in the config of a Zend_Db_Adapter.
+ */
+ const ALLOW_SERIALIZATION = 'allowSerialization';
+
+ /**
+ * Use the AUTO_RECONNECT_ON_UNSERIALIZE constant in the config of a Zend_Db_Adapter.
+ */
+ const AUTO_RECONNECT_ON_UNSERIALIZE = 'autoReconnectOnUnserialize';
+
+ /**
+ * Use the INT_TYPE, BIGINT_TYPE, and FLOAT_TYPE with the quote() method.
+ */
+ const INT_TYPE = 0;
+ const BIGINT_TYPE = 1;
+ const FLOAT_TYPE = 2;
+
+ /**
+ * PDO constant values discovered by this script result:
+ *
+ * $list = array(
+ * 'PARAM_BOOL', 'PARAM_NULL', 'PARAM_INT', 'PARAM_STR', 'PARAM_LOB',
+ * 'PARAM_STMT', 'PARAM_INPUT_OUTPUT', 'FETCH_LAZY', 'FETCH_ASSOC',
+ * 'FETCH_NUM', 'FETCH_BOTH', 'FETCH_OBJ', 'FETCH_BOUND',
+ * 'FETCH_COLUMN', 'FETCH_CLASS', 'FETCH_INTO', 'FETCH_FUNC',
+ * 'FETCH_GROUP', 'FETCH_UNIQUE', 'FETCH_CLASSTYPE', 'FETCH_SERIALIZE',
+ * 'FETCH_NAMED', 'ATTR_AUTOCOMMIT', 'ATTR_PREFETCH', 'ATTR_TIMEOUT',
+ * 'ATTR_ERRMODE', 'ATTR_SERVER_VERSION', 'ATTR_CLIENT_VERSION',
+ * 'ATTR_SERVER_INFO', 'ATTR_CONNECTION_STATUS', 'ATTR_CASE',
+ * 'ATTR_CURSOR_NAME', 'ATTR_CURSOR', 'ATTR_ORACLE_NULLS',
+ * 'ATTR_PERSISTENT', 'ATTR_STATEMENT_CLASS', 'ATTR_FETCH_TABLE_NAMES',
+ * 'ATTR_FETCH_CATALOG_NAMES', 'ATTR_DRIVER_NAME',
+ * 'ATTR_STRINGIFY_FETCHES', 'ATTR_MAX_COLUMN_LEN', 'ERRMODE_SILENT',
+ * 'ERRMODE_WARNING', 'ERRMODE_EXCEPTION', 'CASE_NATURAL',
+ * 'CASE_LOWER', 'CASE_UPPER', 'NULL_NATURAL', 'NULL_EMPTY_STRING',
+ * 'NULL_TO_STRING', 'ERR_NONE', 'FETCH_ORI_NEXT',
+ * 'FETCH_ORI_PRIOR', 'FETCH_ORI_FIRST', 'FETCH_ORI_LAST',
+ * 'FETCH_ORI_ABS', 'FETCH_ORI_REL', 'CURSOR_FWDONLY', 'CURSOR_SCROLL',
+ * 'ERR_CANT_MAP', 'ERR_SYNTAX', 'ERR_CONSTRAINT', 'ERR_NOT_FOUND',
+ * 'ERR_ALREADY_EXISTS', 'ERR_NOT_IMPLEMENTED', 'ERR_MISMATCH',
+ * 'ERR_TRUNCATED', 'ERR_DISCONNECTED', 'ERR_NO_PERM',
+ * );
+ *
+ * $const = array();
+ * foreach ($list as $name) {
+ * $const[$name] = constant("PDO::$name");
+ * }
+ * var_export($const);
+ */
+ const ATTR_AUTOCOMMIT = 0;
+ const ATTR_CASE = 8;
+ const ATTR_CLIENT_VERSION = 5;
+ const ATTR_CONNECTION_STATUS = 7;
+ const ATTR_CURSOR = 10;
+ const ATTR_CURSOR_NAME = 9;
+ const ATTR_DRIVER_NAME = 16;
+ const ATTR_ERRMODE = 3;
+ const ATTR_FETCH_CATALOG_NAMES = 15;
+ const ATTR_FETCH_TABLE_NAMES = 14;
+ const ATTR_MAX_COLUMN_LEN = 18;
+ const ATTR_ORACLE_NULLS = 11;
+ const ATTR_PERSISTENT = 12;
+ const ATTR_PREFETCH = 1;
+ const ATTR_SERVER_INFO = 6;
+ const ATTR_SERVER_VERSION = 4;
+ const ATTR_STATEMENT_CLASS = 13;
+ const ATTR_STRINGIFY_FETCHES = 17;
+ const ATTR_TIMEOUT = 2;
+ const CASE_LOWER = 2;
+ const CASE_NATURAL = 0;
+ const CASE_UPPER = 1;
+ const CURSOR_FWDONLY = 0;
+ const CURSOR_SCROLL = 1;
+ const ERR_ALREADY_EXISTS = NULL;
+ const ERR_CANT_MAP = NULL;
+ const ERR_CONSTRAINT = NULL;
+ const ERR_DISCONNECTED = NULL;
+ const ERR_MISMATCH = NULL;
+ const ERR_NO_PERM = NULL;
+ const ERR_NONE = '00000';
+ const ERR_NOT_FOUND = NULL;
+ const ERR_NOT_IMPLEMENTED = NULL;
+ const ERR_SYNTAX = NULL;
+ const ERR_TRUNCATED = NULL;
+ const ERRMODE_EXCEPTION = 2;
+ const ERRMODE_SILENT = 0;
+ const ERRMODE_WARNING = 1;
+ const FETCH_ASSOC = 2;
+ const FETCH_BOTH = 4;
+ const FETCH_BOUND = 6;
+ const FETCH_CLASS = 8;
+ const FETCH_CLASSTYPE = 262144;
+ const FETCH_COLUMN = 7;
+ const FETCH_FUNC = 10;
+ const FETCH_GROUP = 65536;
+ const FETCH_INTO = 9;
+ const FETCH_LAZY = 1;
+ const FETCH_NAMED = 11;
+ const FETCH_NUM = 3;
+ const FETCH_OBJ = 5;
+ const FETCH_ORI_ABS = 4;
+ const FETCH_ORI_FIRST = 2;
+ const FETCH_ORI_LAST = 3;
+ const FETCH_ORI_NEXT = 0;
+ const FETCH_ORI_PRIOR = 1;
+ const FETCH_ORI_REL = 5;
+ const FETCH_SERIALIZE = 524288;
+ const FETCH_UNIQUE = 196608;
+ const NULL_EMPTY_STRING = 1;
+ const NULL_NATURAL = 0;
+ const NULL_TO_STRING = NULL;
+ const PARAM_BOOL = 5;
+ const PARAM_INPUT_OUTPUT = -2147483648;
+ const PARAM_INT = 1;
+ const PARAM_LOB = 3;
+ const PARAM_NULL = 0;
+ const PARAM_STMT = 4;
+ const PARAM_STR = 2;
+
+ /**
+ * Factory for Zend_Db_Adapter_Abstract classes.
+ *
+ * First argument may be a string containing the base of the adapter class
+ * name, e.g. 'Mysqli' corresponds to class Zend_Db_Adapter_Mysqli. This
+ * name is currently case-insensitive, but is not ideal to rely on this behavior.
+ * If your class is named 'My_Company_Pdo_Mysql', where 'My_Company' is the namespace
+ * and 'Pdo_Mysql' is the adapter name, it is best to use the name exactly as it
+ * is defined in the class. This will ensure proper use of the factory API.
+ *
+ * First argument may alternatively be an object of type Zend_Config.
+ * The adapter class base name is read from the 'adapter' property.
+ * The adapter config parameters are read from the 'params' property.
+ *
+ * Second argument is optional and may be an associative array of key-value
+ * pairs. This is used as the argument to the adapter constructor.
+ *
+ * If the first argument is of type Zend_Config, it is assumed to contain
+ * all parameters, and the second argument is ignored.
+ *
+ * @param mixed $adapter String name of base adapter class, or Zend_Config object.
+ * @param mixed $config OPTIONAL; an array or Zend_Config object with adapter parameters.
+ * @return Zend_Db_Adapter_Abstract
+ * @throws Zend_Db_Exception
+ */
+ public static function factory($adapter, $config = array())
+ {
+ if ($config instanceof Zend_Config) {
+ $config = $config->toArray();
+ }
+
+ /*
+ * Convert Zend_Config argument to plain string
+ * adapter name and separate config object.
+ */
+ if ($adapter instanceof Zend_Config) {
+ if (isset($adapter->params)) {
+ $config = $adapter->params->toArray();
+ }
+ if (isset($adapter->adapter)) {
+ $adapter = (string) $adapter->adapter;
+ } else {
+ $adapter = null;
+ }
+ }
+
+ /*
+ * Verify that adapter parameters are in an array.
+ */
+ if (!is_array($config)) {
+ /**
+ * @see Zend_Db_Exception
+ */
+ throw new Zend_Db_Exception('Adapter parameters must be in an array or a Zend_Config object');
+ }
+
+ /*
+ * Verify that an adapter name has been specified.
+ */
+ if (!is_string($adapter) || empty($adapter)) {
+ /**
+ * @see Zend_Db_Exception
+ */
+ throw new Zend_Db_Exception('Adapter name must be specified in a string');
+ }
+
+ /*
+ * Form full adapter class name
+ */
+ $adapterNamespace = 'Zend_Db_Adapter';
+ if (isset($config['adapterNamespace'])) {
+ if ($config['adapterNamespace'] != '') {
+ $adapterNamespace = $config['adapterNamespace'];
+ }
+ unset($config['adapterNamespace']);
+ }
+
+ // Adapter no longer normalized- see http://framework.zend.com/issues/browse/ZF-5606
+ $adapterName = $adapterNamespace . '_';
+ $adapterName .= str_replace(' ', '_', ucwords(str_replace('_', ' ', strtolower($adapter))));
+
+ /*
+ * Load the adapter class. This throws an exception
+ * if the specified class cannot be loaded.
+ */
+ if (!class_exists($adapterName)) {
+ Zend_Loader::loadClass($adapterName);
+ }
+
+ /*
+ * Create an instance of the adapter class.
+ * Pass the config to the adapter class constructor.
+ */
+ $dbAdapter = new $adapterName($config);
+
+ /*
+ * Verify that the object created is a descendent of the abstract adapter type.
+ */
+ if (! $dbAdapter instanceof Zend_Db_Adapter_Abstract) {
+ /**
+ * @see Zend_Db_Exception
+ */
+ throw new Zend_Db_Exception("Adapter class '$adapterName' does not extend Zend_Db_Adapter_Abstract");
+ }
+
+ return $dbAdapter;
+ }
+
+}
diff --git a/library/vendor/Zend/Db/Adapter/Abstract.php b/library/vendor/Zend/Db/Adapter/Abstract.php
new file mode 100644
index 0000000..cc00ea1
--- /dev/null
+++ b/library/vendor/Zend/Db/Adapter/Abstract.php
@@ -0,0 +1,1267 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Db
+ */
+
+/**
+ * @see Zend_Db_Select
+ */
+
+/**
+ * Class for connecting to SQL databases and performing common operations.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Db_Adapter_Abstract
+{
+
+ /**
+ * User-provided configuration
+ *
+ * @var array
+ */
+ protected $_config = array();
+
+ /**
+ * Fetch mode
+ *
+ * @var integer
+ */
+ protected $_fetchMode = Zend_Db::FETCH_ASSOC;
+
+ /**
+ * Query profiler object, of type Zend_Db_Profiler
+ * or a subclass of that.
+ *
+ * @var Zend_Db_Profiler
+ */
+ protected $_profiler;
+
+ /**
+ * Default class name for a DB statement.
+ *
+ * @var string
+ */
+ protected $_defaultStmtClass = 'Zend_Db_Statement';
+
+ /**
+ * Default class name for the profiler object.
+ *
+ * @var string
+ */
+ protected $_defaultProfilerClass = 'Zend_Db_Profiler';
+
+ /**
+ * Database connection
+ *
+ * @var object|resource|null
+ */
+ protected $_connection = null;
+
+ /**
+ * Specifies the case of column names retrieved in queries
+ * Options
+ * Zend_Db::CASE_NATURAL (default)
+ * Zend_Db::CASE_LOWER
+ * Zend_Db::CASE_UPPER
+ *
+ * @var integer
+ */
+ protected $_caseFolding = Zend_Db::CASE_NATURAL;
+
+ /**
+ * Specifies whether the adapter automatically quotes identifiers.
+ * If true, most SQL generated by Zend_Db classes applies
+ * identifier quoting automatically.
+ * If false, developer must quote identifiers themselves
+ * by calling quoteIdentifier().
+ *
+ * @var bool
+ */
+ protected $_autoQuoteIdentifiers = true;
+
+ /**
+ * Keys are UPPERCASE SQL datatypes or the constants
+ * Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE, or Zend_Db::FLOAT_TYPE.
+ *
+ * Values are:
+ * 0 = 32-bit integer
+ * 1 = 64-bit integer
+ * 2 = float or decimal
+ *
+ * @var array Associative array of datatypes to values 0, 1, or 2.
+ */
+ protected $_numericDataTypes = array(
+ Zend_Db::INT_TYPE => Zend_Db::INT_TYPE,
+ Zend_Db::BIGINT_TYPE => Zend_Db::BIGINT_TYPE,
+ Zend_Db::FLOAT_TYPE => Zend_Db::FLOAT_TYPE
+ );
+
+ /** Weither or not that object can get serialized
+ *
+ * @var bool
+ */
+ protected $_allowSerialization = true;
+
+ /**
+ * Weither or not the database should be reconnected
+ * to that adapter when waking up
+ *
+ * @var bool
+ */
+ protected $_autoReconnectOnUnserialize = false;
+
+ /**
+ * Constructor.
+ *
+ * $config is an array of key/value pairs or an instance of Zend_Config
+ * containing configuration options. These options are common to most adapters:
+ *
+ * dbname => (string) The name of the database to user
+ * username => (string) Connect to the database as this username.
+ * password => (string) Password associated with the username.
+ * host => (string) What host to connect to, defaults to localhost
+ *
+ * Some options are used on a case-by-case basis by adapters:
+ *
+ * port => (string) The port of the database
+ * persistent => (boolean) Whether to use a persistent connection or not, defaults to false
+ * protocol => (string) The network protocol, defaults to TCPIP
+ * caseFolding => (int) style of case-alteration used for identifiers
+ * socket => (string) The socket or named pipe that should be used
+ *
+ * @param array|Zend_Config $config An array or instance of Zend_Config having configuration data
+ * @throws Zend_Db_Adapter_Exception
+ */
+ public function __construct($config)
+ {
+ /*
+ * Verify that adapter parameters are in an array.
+ */
+ if (!is_array($config)) {
+ /*
+ * Convert Zend_Config argument to a plain array.
+ */
+ if ($config instanceof Zend_Config) {
+ $config = $config->toArray();
+ } else {
+ /**
+ * @see Zend_Db_Adapter_Exception
+ */
+ throw new Zend_Db_Adapter_Exception('Adapter parameters must be in an array or a Zend_Config object');
+ }
+ }
+
+ $this->_checkRequiredOptions($config);
+
+ $options = array(
+ Zend_Db::CASE_FOLDING => $this->_caseFolding,
+ Zend_Db::AUTO_QUOTE_IDENTIFIERS => $this->_autoQuoteIdentifiers,
+ Zend_Db::FETCH_MODE => $this->_fetchMode,
+ );
+ $driverOptions = array();
+
+ /*
+ * normalize the config and merge it with the defaults
+ */
+ if (array_key_exists('options', $config)) {
+ // can't use array_merge() because keys might be integers
+ foreach ((array) $config['options'] as $key => $value) {
+ $options[$key] = $value;
+ }
+ }
+ if (array_key_exists('driver_options', $config)) {
+ if (!empty($config['driver_options'])) {
+ // can't use array_merge() because keys might be integers
+ foreach ((array) $config['driver_options'] as $key => $value) {
+ $driverOptions[$key] = $value;
+ }
+ }
+ }
+
+ if (!isset($config['charset'])) {
+ $config['charset'] = null;
+ }
+
+ if (!isset($config['persistent'])) {
+ $config['persistent'] = false;
+ }
+
+ $this->_config = array_merge($this->_config, $config);
+ $this->_config['options'] = $options;
+ $this->_config['driver_options'] = $driverOptions;
+
+
+ // obtain the case setting, if there is one
+ if (array_key_exists(Zend_Db::CASE_FOLDING, $options)) {
+ $case = (int) $options[Zend_Db::CASE_FOLDING];
+ switch ($case) {
+ case Zend_Db::CASE_LOWER:
+ case Zend_Db::CASE_UPPER:
+ case Zend_Db::CASE_NATURAL:
+ $this->_caseFolding = $case;
+ break;
+ default:
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception('Case must be one of the following constants: '
+ . 'Zend_Db::CASE_NATURAL, Zend_Db::CASE_LOWER, Zend_Db::CASE_UPPER');
+ }
+ }
+
+ if (array_key_exists(Zend_Db::FETCH_MODE, $options)) {
+ if (is_string($options[Zend_Db::FETCH_MODE])) {
+ $constant = 'Zend_Db::FETCH_' . strtoupper($options[Zend_Db::FETCH_MODE]);
+ if(defined($constant)) {
+ $options[Zend_Db::FETCH_MODE] = constant($constant);
+ }
+ }
+ $this->setFetchMode((int) $options[Zend_Db::FETCH_MODE]);
+ }
+
+ // obtain quoting property if there is one
+ if (array_key_exists(Zend_Db::AUTO_QUOTE_IDENTIFIERS, $options)) {
+ $this->_autoQuoteIdentifiers = (bool) $options[Zend_Db::AUTO_QUOTE_IDENTIFIERS];
+ }
+
+ // obtain allow serialization property if there is one
+ if (array_key_exists(Zend_Db::ALLOW_SERIALIZATION, $options)) {
+ $this->_allowSerialization = (bool) $options[Zend_Db::ALLOW_SERIALIZATION];
+ }
+
+ // obtain auto reconnect on unserialize property if there is one
+ if (array_key_exists(Zend_Db::AUTO_RECONNECT_ON_UNSERIALIZE, $options)) {
+ $this->_autoReconnectOnUnserialize = (bool) $options[Zend_Db::AUTO_RECONNECT_ON_UNSERIALIZE];
+ }
+
+ // create a profiler object
+ $profiler = false;
+ if (array_key_exists(Zend_Db::PROFILER, $this->_config)) {
+ $profiler = $this->_config[Zend_Db::PROFILER];
+ unset($this->_config[Zend_Db::PROFILER]);
+ }
+ $this->setProfiler($profiler);
+ }
+
+ /**
+ * Check for config options that are mandatory.
+ * Throw exceptions if any are missing.
+ *
+ * @param array $config
+ * @throws Zend_Db_Adapter_Exception
+ */
+ protected function _checkRequiredOptions(array $config)
+ {
+ // we need at least a dbname
+ if (! array_key_exists('dbname', $config)) {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception("Configuration array must have a key for 'dbname' that names the database instance");
+ }
+
+ if (! array_key_exists('password', $config)) {
+ /**
+ * @see Zend_Db_Adapter_Exception
+ */
+ throw new Zend_Db_Adapter_Exception("Configuration array must have a key for 'password' for login credentials");
+ }
+
+ if (! array_key_exists('username', $config)) {
+ /**
+ * @see Zend_Db_Adapter_Exception
+ */
+ throw new Zend_Db_Adapter_Exception("Configuration array must have a key for 'username' for login credentials");
+ }
+ }
+
+ /**
+ * Returns the underlying database connection object or resource.
+ * If not presently connected, this initiates the connection.
+ *
+ * @return object|resource|null
+ */
+ public function getConnection()
+ {
+ $this->_connect();
+ return $this->_connection;
+ }
+
+ /**
+ * Returns the configuration variables in this adapter.
+ *
+ * @return array
+ */
+ public function getConfig()
+ {
+ return $this->_config;
+ }
+
+ /**
+ * Set the adapter's profiler object.
+ *
+ * The argument may be a boolean, an associative array, an instance of
+ * Zend_Db_Profiler, or an instance of Zend_Config.
+ *
+ * A boolean argument sets the profiler to enabled if true, or disabled if
+ * false. The profiler class is the adapter's default profiler class,
+ * Zend_Db_Profiler.
+ *
+ * An instance of Zend_Db_Profiler sets the adapter's instance to that
+ * object. The profiler is enabled and disabled separately.
+ *
+ * An associative array argument may contain any of the keys 'enabled',
+ * 'class', and 'instance'. The 'enabled' and 'instance' keys correspond to the
+ * boolean and object types documented above. The 'class' key is used to name a
+ * class to use for a custom profiler. The class must be Zend_Db_Profiler or a
+ * subclass. The class is instantiated with no constructor arguments. The 'class'
+ * option is ignored when the 'instance' option is supplied.
+ *
+ * An object of type Zend_Config may contain the properties 'enabled', 'class', and
+ * 'instance', just as if an associative array had been passed instead.
+ *
+ * @param Zend_Db_Profiler|Zend_Config|array|boolean $profiler
+ * @return Zend_Db_Adapter_Abstract Provides a fluent interface
+ * @throws Zend_Db_Profiler_Exception if the object instance or class specified
+ * is not Zend_Db_Profiler or an extension of that class.
+ */
+ public function setProfiler($profiler)
+ {
+ $enabled = null;
+ $profilerClass = $this->_defaultProfilerClass;
+ $profilerInstance = null;
+
+ if ($profilerIsObject = is_object($profiler)) {
+ if ($profiler instanceof Zend_Db_Profiler) {
+ $profilerInstance = $profiler;
+ } else if ($profiler instanceof Zend_Config) {
+ $profiler = $profiler->toArray();
+ } else {
+ /**
+ * @see Zend_Db_Profiler_Exception
+ */
+ throw new Zend_Db_Profiler_Exception('Profiler argument must be an instance of either Zend_Db_Profiler'
+ . ' or Zend_Config when provided as an object');
+ }
+ }
+
+ if (is_array($profiler)) {
+ if (isset($profiler['enabled'])) {
+ $enabled = (bool) $profiler['enabled'];
+ }
+ if (isset($profiler['class'])) {
+ $profilerClass = $profiler['class'];
+ }
+ if (isset($profiler['instance'])) {
+ $profilerInstance = $profiler['instance'];
+ }
+ } else if (!$profilerIsObject) {
+ $enabled = (bool) $profiler;
+ }
+
+ if ($profilerInstance === null) {
+ if (!class_exists($profilerClass)) {
+ Zend_Loader::loadClass($profilerClass);
+ }
+ $profilerInstance = new $profilerClass();
+ }
+
+ if (!$profilerInstance instanceof Zend_Db_Profiler) {
+ /** @see Zend_Db_Profiler_Exception */
+ throw new Zend_Db_Profiler_Exception('Class ' . get_class($profilerInstance) . ' does not extend '
+ . 'Zend_Db_Profiler');
+ }
+
+ if (null !== $enabled) {
+ $profilerInstance->setEnabled($enabled);
+ }
+
+ $this->_profiler = $profilerInstance;
+
+ return $this;
+ }
+
+
+ /**
+ * Returns the profiler for this adapter.
+ *
+ * @return Zend_Db_Profiler
+ */
+ public function getProfiler()
+ {
+ return $this->_profiler;
+ }
+
+ /**
+ * Get the default statement class.
+ *
+ * @return string
+ */
+ public function getStatementClass()
+ {
+ return $this->_defaultStmtClass;
+ }
+
+ /**
+ * Set the default statement class.
+ *
+ * @return Zend_Db_Adapter_Abstract Fluent interface
+ */
+ public function setStatementClass($class)
+ {
+ $this->_defaultStmtClass = $class;
+ return $this;
+ }
+
+ /**
+ * Prepares and executes an SQL statement with bound data.
+ *
+ * @param mixed $sql The SQL statement with placeholders.
+ * May be a string or Zend_Db_Select.
+ * @param mixed $bind An array of data to bind to the placeholders.
+ * @return Zend_Db_Statement_Interface
+ */
+ public function query($sql, $bind = array())
+ {
+ // connect to the database if needed
+ $this->_connect();
+
+ // is the $sql a Zend_Db_Select object?
+ if ($sql instanceof Zend_Db_Select) {
+ if (empty($bind)) {
+ $bind = $sql->getBind();
+ }
+
+ $sql = $sql->assemble();
+ }
+
+ // make sure $bind to an array;
+ // don't use (array) typecasting because
+ // because $bind may be a Zend_Db_Expr object
+ if (!is_array($bind)) {
+ $bind = array($bind);
+ }
+
+ // prepare and execute the statement with profiling
+ $stmt = $this->prepare($sql);
+ $stmt->execute($bind);
+
+ // return the results embedded in the prepared statement object
+ $stmt->setFetchMode($this->_fetchMode);
+ return $stmt;
+ }
+
+ /**
+ * Leave autocommit mode and begin a transaction.
+ *
+ * @return Zend_Db_Adapter_Abstract
+ */
+ public function beginTransaction()
+ {
+ $this->_connect();
+ $q = $this->_profiler->queryStart('begin', Zend_Db_Profiler::TRANSACTION);
+ $this->_beginTransaction();
+ $this->_profiler->queryEnd($q);
+ return $this;
+ }
+
+ /**
+ * Commit a transaction and return to autocommit mode.
+ *
+ * @return Zend_Db_Adapter_Abstract
+ */
+ public function commit()
+ {
+ $this->_connect();
+ $q = $this->_profiler->queryStart('commit', Zend_Db_Profiler::TRANSACTION);
+ $this->_commit();
+ $this->_profiler->queryEnd($q);
+ return $this;
+ }
+
+ /**
+ * Roll back a transaction and return to autocommit mode.
+ *
+ * @return Zend_Db_Adapter_Abstract
+ */
+ public function rollBack()
+ {
+ $this->_connect();
+ $q = $this->_profiler->queryStart('rollback', Zend_Db_Profiler::TRANSACTION);
+ $this->_rollBack();
+ $this->_profiler->queryEnd($q);
+ return $this;
+ }
+
+ /**
+ * Inserts a table row with specified data.
+ *
+ * @param mixed $table The table to insert data into.
+ * @param array $bind Column-value pairs.
+ * @return int The number of affected rows.
+ * @throws Zend_Db_Adapter_Exception
+ */
+ public function insert($table, array $bind)
+ {
+ // extract and quote col names from the array keys
+ $cols = array();
+ $vals = array();
+ $i = 0;
+ foreach ($bind as $col => $val) {
+ $cols[] = $this->quoteIdentifier($col, true);
+ if ($val instanceof Zend_Db_Expr) {
+ $vals[] = $val->__toString();
+ unset($bind[$col]);
+ } else {
+ if ($this->supportsParameters('positional')) {
+ $vals[] = '?';
+ } else {
+ if ($this->supportsParameters('named')) {
+ unset($bind[$col]);
+ $bind[':col'.$i] = $val;
+ $vals[] = ':col'.$i;
+ $i++;
+ } else {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception(get_class($this) ." doesn't support positional or named binding");
+ }
+ }
+ }
+ }
+
+ // build the statement
+ $sql = "INSERT INTO "
+ . $this->quoteIdentifier($table, true)
+ . ' (' . implode(', ', $cols) . ') '
+ . 'VALUES (' . implode(', ', $vals) . ')';
+
+ // execute the statement and return the number of affected rows
+ if ($this->supportsParameters('positional')) {
+ $bind = array_values($bind);
+ }
+ $stmt = $this->query($sql, $bind);
+ $result = $stmt->rowCount();
+ return $result;
+ }
+
+ /**
+ * Updates table rows with specified data based on a WHERE clause.
+ *
+ * @param mixed $table The table to update.
+ * @param array $bind Column-value pairs.
+ * @param mixed $where UPDATE WHERE clause(s).
+ * @return int The number of affected rows.
+ * @throws Zend_Db_Adapter_Exception
+ */
+ public function update($table, array $bind, $where = '')
+ {
+ /**
+ * Build "col = ?" pairs for the statement,
+ * except for Zend_Db_Expr which is treated literally.
+ */
+ $set = array();
+ $i = 0;
+ foreach ($bind as $col => $val) {
+ if ($val instanceof Zend_Db_Expr) {
+ $val = $val->__toString();
+ unset($bind[$col]);
+ } else {
+ if ($this->supportsParameters('positional')) {
+ $val = '?';
+ } else {
+ if ($this->supportsParameters('named')) {
+ unset($bind[$col]);
+ $bind[':col'.$i] = $val;
+ $val = ':col'.$i;
+ $i++;
+ } else {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception(get_class($this) ." doesn't support positional or named binding");
+ }
+ }
+ }
+ $set[] = $this->quoteIdentifier($col, true) . ' = ' . $val;
+ }
+
+ $where = $this->_whereExpr($where);
+
+ /**
+ * Build the UPDATE statement
+ */
+ $sql = "UPDATE "
+ . $this->quoteIdentifier($table, true)
+ . ' SET ' . implode(', ', $set)
+ . (($where) ? " WHERE $where" : '');
+
+ /**
+ * Execute the statement and return the number of affected rows
+ */
+ if ($this->supportsParameters('positional')) {
+ $stmt = $this->query($sql, array_values($bind));
+ } else {
+ $stmt = $this->query($sql, $bind);
+ }
+ $result = $stmt->rowCount();
+ return $result;
+ }
+
+ /**
+ * Deletes table rows based on a WHERE clause.
+ *
+ * @param mixed $table The table to update.
+ * @param mixed $where DELETE WHERE clause(s).
+ * @return int The number of affected rows.
+ */
+ public function delete($table, $where = '')
+ {
+ $where = $this->_whereExpr($where);
+
+ /**
+ * Build the DELETE statement
+ */
+ $sql = "DELETE FROM "
+ . $this->quoteIdentifier($table, true)
+ . (($where) ? " WHERE $where" : '');
+
+ /**
+ * Execute the statement and return the number of affected rows
+ */
+ $stmt = $this->query($sql);
+ $result = $stmt->rowCount();
+ return $result;
+ }
+
+ /**
+ * Convert an array, string, or Zend_Db_Expr object
+ * into a string to put in a WHERE clause.
+ *
+ * @param mixed $where
+ * @return string
+ */
+ protected function _whereExpr($where)
+ {
+ if (empty($where)) {
+ return $where;
+ }
+ if (!is_array($where)) {
+ $where = array($where);
+ }
+ foreach ($where as $cond => &$term) {
+ // is $cond an int? (i.e. Not a condition)
+ if (is_int($cond)) {
+ // $term is the full condition
+ if ($term instanceof Zend_Db_Expr) {
+ $term = $term->__toString();
+ }
+ } else {
+ // $cond is the condition with placeholder,
+ // and $term is quoted into the condition
+ $term = $this->quoteInto($cond, $term);
+ }
+ $term = '(' . $term . ')';
+ }
+
+ $where = implode(' AND ', $where);
+ return $where;
+ }
+
+ /**
+ * Creates and returns a new Zend_Db_Select object for this adapter.
+ *
+ * @return Zend_Db_Select
+ */
+ public function select()
+ {
+ return new Zend_Db_Select($this);
+ }
+
+ /**
+ * Get the fetch mode.
+ *
+ * @return int
+ */
+ public function getFetchMode()
+ {
+ return $this->_fetchMode;
+ }
+
+ /**
+ * Fetches all SQL result rows as a sequential array.
+ * Uses the current fetchMode for the adapter.
+ *
+ * @param string|Zend_Db_Select $sql An SQL SELECT statement.
+ * @param mixed $bind Data to bind into SELECT placeholders.
+ * @param mixed $fetchMode Override current fetch mode.
+ * @return array
+ */
+ public function fetchAll($sql, $bind = array(), $fetchMode = null)
+ {
+ if ($fetchMode === null) {
+ $fetchMode = $this->_fetchMode;
+ }
+ $stmt = $this->query($sql, $bind);
+ $result = $stmt->fetchAll($fetchMode);
+ return $result;
+ }
+
+ /**
+ * Fetches the first row of the SQL result.
+ * Uses the current fetchMode for the adapter.
+ *
+ * @param string|Zend_Db_Select $sql An SQL SELECT statement.
+ * @param mixed $bind Data to bind into SELECT placeholders.
+ * @param mixed $fetchMode Override current fetch mode.
+ * @return mixed Array, object, or scalar depending on fetch mode.
+ */
+ public function fetchRow($sql, $bind = array(), $fetchMode = null)
+ {
+ if ($fetchMode === null) {
+ $fetchMode = $this->_fetchMode;
+ }
+ $stmt = $this->query($sql, $bind);
+ $result = $stmt->fetch($fetchMode);
+ return $result;
+ }
+
+ /**
+ * Fetches all SQL result rows as an associative array.
+ *
+ * The first column is the key, the entire row array is the
+ * value. You should construct the query to be sure that
+ * the first column contains unique values, or else
+ * rows with duplicate values in the first column will
+ * overwrite previous data.
+ *
+ * @param string|Zend_Db_Select $sql An SQL SELECT statement.
+ * @param mixed $bind Data to bind into SELECT placeholders.
+ * @return array
+ */
+ public function fetchAssoc($sql, $bind = array())
+ {
+ $stmt = $this->query($sql, $bind);
+ $data = array();
+ while ($row = $stmt->fetch(Zend_Db::FETCH_ASSOC)) {
+ $tmp = array_values(array_slice($row, 0, 1));
+ $data[$tmp[0]] = $row;
+ }
+ return $data;
+ }
+
+ /**
+ * Fetches the first column of all SQL result rows as an array.
+ *
+ * @param string|Zend_Db_Select $sql An SQL SELECT statement.
+ * @param mixed $bind Data to bind into SELECT placeholders.
+ * @return array
+ */
+ public function fetchCol($sql, $bind = array())
+ {
+ $stmt = $this->query($sql, $bind);
+ $result = $stmt->fetchAll(Zend_Db::FETCH_COLUMN, 0);
+ return $result;
+ }
+
+ /**
+ * Fetches all SQL result rows as an array of key-value pairs.
+ *
+ * The first column is the key, the second column is the
+ * value.
+ *
+ * @param string|Zend_Db_Select $sql An SQL SELECT statement.
+ * @param mixed $bind Data to bind into SELECT placeholders.
+ * @return array
+ */
+ public function fetchPairs($sql, $bind = array())
+ {
+ $stmt = $this->query($sql, $bind);
+ $data = array();
+ while ($row = $stmt->fetch(Zend_Db::FETCH_NUM)) {
+ $data[$row[0]] = $row[1];
+ }
+ return $data;
+ }
+
+ /**
+ * Fetches the first column of the first row of the SQL result.
+ *
+ * @param string|Zend_Db_Select $sql An SQL SELECT statement.
+ * @param mixed $bind Data to bind into SELECT placeholders.
+ * @return string
+ */
+ public function fetchOne($sql, $bind = array())
+ {
+ $stmt = $this->query($sql, $bind);
+ $result = $stmt->fetchColumn(0);
+ return $result;
+ }
+
+ /**
+ * Quote a raw string.
+ *
+ * @param string $value Raw string
+ * @return string Quoted string
+ */
+ protected function _quote($value)
+ {
+ if (is_int($value)) {
+ return $value;
+ } elseif (is_float($value)) {
+ return sprintf('%F', $value);
+ }
+ return "'" . addcslashes($value, "\000\n\r\\'\"\032") . "'";
+ }
+
+ /**
+ * Safely quotes a value for an SQL statement.
+ *
+ * If an array is passed as the value, the array values are quoted
+ * and then returned as a comma-separated string.
+ *
+ * @param mixed $value The value to quote.
+ * @param mixed $type OPTIONAL the SQL datatype name, or constant, or null.
+ * @return mixed An SQL-safe quoted value (or string of separated values).
+ */
+ public function quote($value, $type = null)
+ {
+ $this->_connect();
+
+ if ($value instanceof Zend_Db_Select) {
+ return '(' . $value->assemble() . ')';
+ }
+
+ if ($value instanceof Zend_Db_Expr) {
+ return $value->__toString();
+ }
+
+ if (is_array($value)) {
+ foreach ($value as &$val) {
+ $val = $this->quote($val, $type);
+ }
+ return implode(', ', $value);
+ }
+
+ if ($type !== null && array_key_exists($type = strtoupper($type), $this->_numericDataTypes)) {
+ $quotedValue = '0';
+ switch ($this->_numericDataTypes[$type]) {
+ case Zend_Db::INT_TYPE: // 32-bit integer
+ $quotedValue = (string) intval($value);
+ break;
+ case Zend_Db::BIGINT_TYPE: // 64-bit integer
+ // ANSI SQL-style hex literals (e.g. x'[\dA-F]+')
+ // are not supported here, because these are string
+ // literals, not numeric literals.
+ if (preg_match('/^(
+ [+-]? # optional sign
+ (?:
+ 0[Xx][\da-fA-F]+ # ODBC-style hexadecimal
+ |\d+ # decimal or octal, or MySQL ZEROFILL decimal
+ (?:[eE][+-]?\d+)? # optional exponent on decimals or octals
+ )
+ )/x',
+ (string) $value, $matches)) {
+ $quotedValue = $matches[1];
+ }
+ break;
+ case Zend_Db::FLOAT_TYPE: // float or decimal
+ $quotedValue = sprintf('%F', $value);
+ }
+ return $quotedValue;
+ }
+
+ return $this->_quote($value);
+ }
+
+ /**
+ * Quotes a value and places into a piece of text at a placeholder.
+ *
+ * The placeholder is a question-mark; all placeholders will be replaced
+ * with the quoted value. For example:
+ *
+ * <code>
+ * $text = "WHERE date < ?";
+ * $date = "2005-01-02";
+ * $safe = $sql->quoteInto($text, $date);
+ * // $safe = "WHERE date < '2005-01-02'"
+ * </code>
+ *
+ * @param string $text The text with a placeholder.
+ * @param mixed $value The value to quote.
+ * @param string $type OPTIONAL SQL datatype
+ * @param integer $count OPTIONAL count of placeholders to replace
+ * @return string An SQL-safe quoted value placed into the original text.
+ */
+ public function quoteInto($text, $value, $type = null, $count = null)
+ {
+ if ($count === null) {
+ return str_replace('?', $this->quote($value, $type), $text);
+ } else {
+ return implode($this->quote($value, $type), explode('?', $text, $count + 1));
+ }
+ }
+
+ /**
+ * Quotes an identifier.
+ *
+ * Accepts a string representing a qualified indentifier. For Example:
+ * <code>
+ * $adapter->quoteIdentifier('myschema.mytable')
+ * </code>
+ * Returns: "myschema"."mytable"
+ *
+ * Or, an array of one or more identifiers that may form a qualified identifier:
+ * <code>
+ * $adapter->quoteIdentifier(array('myschema','my.table'))
+ * </code>
+ * Returns: "myschema"."my.table"
+ *
+ * The actual quote character surrounding the identifiers may vary depending on
+ * the adapter.
+ *
+ * @param string|array|Zend_Db_Expr $ident The identifier.
+ * @param boolean $auto If true, heed the AUTO_QUOTE_IDENTIFIERS config option.
+ * @return string The quoted identifier.
+ */
+ public function quoteIdentifier($ident, $auto=false)
+ {
+ return $this->_quoteIdentifierAs($ident, null, $auto);
+ }
+
+ /**
+ * Quote a column identifier and alias.
+ *
+ * @param string|array|Zend_Db_Expr $ident The identifier or expression.
+ * @param string $alias An alias for the column.
+ * @param boolean $auto If true, heed the AUTO_QUOTE_IDENTIFIERS config option.
+ * @return string The quoted identifier and alias.
+ */
+ public function quoteColumnAs($ident, $alias, $auto=false)
+ {
+ return $this->_quoteIdentifierAs($ident, $alias, $auto);
+ }
+
+ /**
+ * Quote a table identifier and alias.
+ *
+ * @param string|array|Zend_Db_Expr $ident The identifier or expression.
+ * @param string $alias An alias for the table.
+ * @param boolean $auto If true, heed the AUTO_QUOTE_IDENTIFIERS config option.
+ * @return string The quoted identifier and alias.
+ */
+ public function quoteTableAs($ident, $alias = null, $auto = false)
+ {
+ return $this->_quoteIdentifierAs($ident, $alias, $auto);
+ }
+
+ /**
+ * Quote an identifier and an optional alias.
+ *
+ * @param string|array|Zend_Db_Expr $ident The identifier or expression.
+ * @param string $alias An optional alias.
+ * @param boolean $auto If true, heed the AUTO_QUOTE_IDENTIFIERS config option.
+ * @param string $as The string to add between the identifier/expression and the alias.
+ * @return string The quoted identifier and alias.
+ */
+ protected function _quoteIdentifierAs($ident, $alias = null, $auto = false, $as = ' AS ')
+ {
+ if ($ident instanceof Zend_Db_Expr) {
+ $quoted = $ident->__toString();
+ } elseif ($ident instanceof Zend_Db_Select) {
+ $quoted = '(' . $ident->assemble() . ')';
+ } else {
+ if (is_string($ident)) {
+ $ident = explode('.', $ident);
+ }
+ if (is_array($ident)) {
+ $segments = array();
+ foreach ($ident as $segment) {
+ if ($segment instanceof Zend_Db_Expr) {
+ $segments[] = $segment->__toString();
+ } else {
+ $segments[] = $this->_quoteIdentifier($segment, $auto);
+ }
+ }
+ if ($alias !== null && end($ident) == $alias) {
+ $alias = null;
+ }
+ $quoted = implode('.', $segments);
+ } else {
+ $quoted = $this->_quoteIdentifier($ident, $auto);
+ }
+ }
+ if ($alias !== null) {
+ $quoted .= $as . $this->_quoteIdentifier($alias, $auto);
+ }
+ return $quoted;
+ }
+
+ /**
+ * Quote an identifier.
+ *
+ * @param string $value The identifier or expression.
+ * @param boolean $auto If true, heed the AUTO_QUOTE_IDENTIFIERS config option.
+ * @return string The quoted identifier and alias.
+ */
+ protected function _quoteIdentifier($value, $auto=false)
+ {
+ if ($auto === false || $this->_autoQuoteIdentifiers === true) {
+ $q = $this->getQuoteIdentifierSymbol();
+ return ($q . str_replace("$q", "$q$q", $value) . $q);
+ }
+ return $value;
+ }
+
+ /**
+ * Returns the symbol the adapter uses for delimited identifiers.
+ *
+ * @return string
+ */
+ public function getQuoteIdentifierSymbol()
+ {
+ return '"';
+ }
+
+ /**
+ * Return the most recent value from the specified sequence in the database.
+ * This is supported only on RDBMS brands that support sequences
+ * (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.
+ *
+ * @param string $sequenceName
+ * @return string
+ */
+ public function lastSequenceId($sequenceName)
+ {
+ return null;
+ }
+
+ /**
+ * Generate a new value from the specified sequence in the database, and return it.
+ * This is supported only on RDBMS brands that support sequences
+ * (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.
+ *
+ * @param string $sequenceName
+ * @return string
+ */
+ public function nextSequenceId($sequenceName)
+ {
+ return null;
+ }
+
+ /**
+ * Helper method to change the case of the strings used
+ * when returning result sets in FETCH_ASSOC and FETCH_BOTH
+ * modes.
+ *
+ * This is not intended to be used by application code,
+ * but the method must be public so the Statement class
+ * can invoke it.
+ *
+ * @param string $key
+ * @return string
+ */
+ public function foldCase($key)
+ {
+ switch ($this->_caseFolding) {
+ case Zend_Db::CASE_LOWER:
+ $value = strtolower((string) $key);
+ break;
+ case Zend_Db::CASE_UPPER:
+ $value = strtoupper((string) $key);
+ break;
+ case Zend_Db::CASE_NATURAL:
+ default:
+ $value = (string) $key;
+ }
+ return $value;
+ }
+
+ /**
+ * called when object is getting serialized
+ * This disconnects the DB object that cant be serialized
+ *
+ * @throws Zend_Db_Adapter_Exception
+ * @return array
+ */
+ public function __sleep()
+ {
+ if ($this->_allowSerialization == false) {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception(
+ get_class($this) . ' is not allowed to be serialized'
+ );
+ }
+ $this->_connection = null;
+
+ return array_keys(
+ array_diff_key(get_object_vars($this), array('_connection' => null))
+ );
+ }
+
+ /**
+ * called when object is getting unserialized
+ *
+ * @return void
+ */
+ public function __wakeup()
+ {
+ if ($this->_autoReconnectOnUnserialize == true) {
+ $this->getConnection();
+ }
+ }
+
+ /**
+ * Abstract Methods
+ */
+
+ /**
+ * Returns a list of the tables in the database.
+ *
+ * @return array
+ */
+ abstract public function listTables();
+
+ /**
+ * Returns the column descriptions for a table.
+ *
+ * The return value is an associative array keyed by the column name,
+ * as returned by the RDBMS.
+ *
+ * The value of each array element is an associative array
+ * with the following keys:
+ *
+ * SCHEMA_NAME => string; name of database or schema
+ * TABLE_NAME => string;
+ * COLUMN_NAME => string; column name
+ * COLUMN_POSITION => number; ordinal position of column in table
+ * DATA_TYPE => string; SQL datatype name of column
+ * DEFAULT => string; default expression of column, null if none
+ * NULLABLE => boolean; true if column can have nulls
+ * LENGTH => number; length of CHAR/VARCHAR
+ * SCALE => number; scale of NUMERIC/DECIMAL
+ * PRECISION => number; precision of NUMERIC/DECIMAL
+ * UNSIGNED => boolean; unsigned property of an integer type
+ * PRIMARY => boolean; true if column is part of the primary key
+ * PRIMARY_POSITION => integer; position of column in primary key
+ *
+ * @param string $tableName
+ * @param string $schemaName OPTIONAL
+ * @return array
+ */
+ abstract public function describeTable($tableName, $schemaName = null);
+
+ /**
+ * Creates a connection to the database.
+ *
+ * @return void
+ */
+ abstract protected function _connect();
+
+ /**
+ * Test if a connection is active
+ *
+ * @return boolean
+ */
+ abstract public function isConnected();
+
+ /**
+ * Force the connection to close.
+ *
+ * @return void
+ */
+ abstract public function closeConnection();
+
+ /**
+ * Prepare a statement and return a PDOStatement-like object.
+ *
+ * @param string|Zend_Db_Select $sql SQL query
+ * @return Zend_Db_Statement|PDOStatement
+ */
+ abstract public function prepare($sql);
+
+ /**
+ * Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.
+ *
+ * As a convention, on RDBMS brands that support sequences
+ * (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence
+ * from the arguments and returns the last id generated by that sequence.
+ * On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method
+ * returns the last value generated for such a column, and the table name
+ * argument is disregarded.
+ *
+ * @param string $tableName OPTIONAL Name of table.
+ * @param string $primaryKey OPTIONAL Name of primary key column.
+ * @return string
+ */
+ abstract public function lastInsertId($tableName = null, $primaryKey = null);
+
+ /**
+ * Begin a transaction.
+ */
+ abstract protected function _beginTransaction();
+
+ /**
+ * Commit a transaction.
+ */
+ abstract protected function _commit();
+
+ /**
+ * Roll-back a transaction.
+ */
+ abstract protected function _rollBack();
+
+ /**
+ * Set the fetch mode.
+ *
+ * @param integer $mode
+ * @return void
+ * @throws Zend_Db_Adapter_Exception
+ */
+ abstract public function setFetchMode($mode);
+
+ /**
+ * Adds an adapter-specific LIMIT clause to the SELECT statement.
+ *
+ * @param mixed $sql
+ * @param integer $count
+ * @param integer $offset
+ * @return string
+ */
+ abstract public function limit($sql, $count, $offset = 0);
+
+ /**
+ * Check if the adapter supports real SQL parameters.
+ *
+ * @param string $type 'positional' or 'named'
+ * @return bool
+ */
+ abstract public function supportsParameters($type);
+
+ /**
+ * Retrieve server version in PHP style
+ *
+ * @return string
+ */
+ abstract public function getServerVersion();
+}
diff --git a/library/vendor/Zend/Db/Adapter/Db2.php b/library/vendor/Zend/Db/Adapter/Db2.php
new file mode 100644
index 0000000..28793d1
--- /dev/null
+++ b/library/vendor/Zend/Db/Adapter/Db2.php
@@ -0,0 +1,827 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ *
+ */
+
+/**
+ * @see Zend_Db
+ */
+
+/**
+ * @see Zend_Db_Adapter_Abstract
+ */
+
+/**
+ * @see Zend_Db_Statement_Db2
+ */
+
+
+/**
+ * @package Zend_Db
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+class Zend_Db_Adapter_Db2 extends Zend_Db_Adapter_Abstract
+{
+ /**
+ * User-provided configuration.
+ *
+ * Basic keys are:
+ *
+ * username => (string) Connect to the database as this username.
+ * password => (string) Password associated with the username.
+ * host => (string) What host to connect to (default 127.0.0.1)
+ * dbname => (string) The name of the database to user
+ * protocol => (string) Protocol to use, defaults to "TCPIP"
+ * port => (integer) Port number to use for TCP/IP if protocol is "TCPIP"
+ * persistent => (boolean) Set TRUE to use a persistent connection (db2_pconnect)
+ * os => (string) This should be set to 'i5' if the db is on an os400/i5
+ * schema => (string) The default schema the connection should use
+ *
+ * @var array
+ */
+ protected $_config = array(
+ 'dbname' => null,
+ 'username' => null,
+ 'password' => null,
+ 'host' => 'localhost',
+ 'port' => '50000',
+ 'protocol' => 'TCPIP',
+ 'persistent' => false,
+ 'os' => null,
+ 'schema' => null
+ );
+
+ /**
+ * Execution mode
+ *
+ * @var int execution flag (DB2_AUTOCOMMIT_ON or DB2_AUTOCOMMIT_OFF)
+ */
+ protected $_execute_mode = DB2_AUTOCOMMIT_ON;
+
+ /**
+ * Default class name for a DB statement.
+ *
+ * @var string
+ */
+ protected $_defaultStmtClass = 'Zend_Db_Statement_Db2';
+ protected $_isI5 = false;
+
+ /**
+ * Keys are UPPERCASE SQL datatypes or the constants
+ * Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE, or Zend_Db::FLOAT_TYPE.
+ *
+ * Values are:
+ * 0 = 32-bit integer
+ * 1 = 64-bit integer
+ * 2 = float or decimal
+ *
+ * @var array Associative array of datatypes to values 0, 1, or 2.
+ */
+ protected $_numericDataTypes = array(
+ Zend_Db::INT_TYPE => Zend_Db::INT_TYPE,
+ Zend_Db::BIGINT_TYPE => Zend_Db::BIGINT_TYPE,
+ Zend_Db::FLOAT_TYPE => Zend_Db::FLOAT_TYPE,
+ 'INTEGER' => Zend_Db::INT_TYPE,
+ 'SMALLINT' => Zend_Db::INT_TYPE,
+ 'BIGINT' => Zend_Db::BIGINT_TYPE,
+ 'DECIMAL' => Zend_Db::FLOAT_TYPE,
+ 'NUMERIC' => Zend_Db::FLOAT_TYPE
+ );
+
+ /**
+ * Creates a connection resource.
+ *
+ * @return void
+ */
+ protected function _connect()
+ {
+ if (is_resource($this->_connection)) {
+ // connection already exists
+ return;
+ }
+
+ if (!extension_loaded('ibm_db2')) {
+ /**
+ * @see Zend_Db_Adapter_Db2_Exception
+ */
+ throw new Zend_Db_Adapter_Db2_Exception('The IBM DB2 extension is required for this adapter but the extension is not loaded');
+ }
+
+ $this->_determineI5();
+ if ($this->_config['persistent']) {
+ // use persistent connection
+ $conn_func_name = 'db2_pconnect';
+ } else {
+ // use "normal" connection
+ $conn_func_name = 'db2_connect';
+ }
+
+ if (!isset($this->_config['driver_options']['autocommit'])) {
+ // set execution mode
+ $this->_config['driver_options']['autocommit'] = &$this->_execute_mode;
+ }
+
+ if (isset($this->_config['options'][Zend_Db::CASE_FOLDING])) {
+ $caseAttrMap = array(
+ Zend_Db::CASE_NATURAL => DB2_CASE_NATURAL,
+ Zend_Db::CASE_UPPER => DB2_CASE_UPPER,
+ Zend_Db::CASE_LOWER => DB2_CASE_LOWER
+ );
+ $this->_config['driver_options']['DB2_ATTR_CASE'] = $caseAttrMap[$this->_config['options'][Zend_Db::CASE_FOLDING]];
+ }
+
+ if ($this->_isI5 && isset($this->_config['driver_options']['i5_naming'])) {
+ if ($this->_config['driver_options']['i5_naming']) {
+ $this->_config['driver_options']['i5_naming'] = DB2_I5_NAMING_ON;
+ } else {
+ $this->_config['driver_options']['i5_naming'] = DB2_I5_NAMING_OFF;
+ }
+ }
+
+ if ($this->_config['host'] !== 'localhost' && !$this->_isI5) {
+ // if the host isn't localhost, use extended connection params
+ $dbname = 'DRIVER={IBM DB2 ODBC DRIVER}' .
+ ';DATABASE=' . $this->_config['dbname'] .
+ ';HOSTNAME=' . $this->_config['host'] .
+ ';PORT=' . $this->_config['port'] .
+ ';PROTOCOL=' . $this->_config['protocol'] .
+ ';UID=' . $this->_config['username'] .
+ ';PWD=' . $this->_config['password'] .';';
+ $this->_connection = $conn_func_name(
+ $dbname,
+ null,
+ null,
+ $this->_config['driver_options']
+ );
+ } else {
+ // host is localhost, so use standard connection params
+ $this->_connection = $conn_func_name(
+ $this->_config['dbname'],
+ $this->_config['username'],
+ $this->_config['password'],
+ $this->_config['driver_options']
+ );
+ }
+
+ // check the connection
+ if (!$this->_connection) {
+ /**
+ * @see Zend_Db_Adapter_Db2_Exception
+ */
+ throw new Zend_Db_Adapter_Db2_Exception(db2_conn_errormsg(), db2_conn_error());
+ }
+ }
+
+ /**
+ * Test if a connection is active
+ *
+ * @return boolean
+ */
+ public function isConnected()
+ {
+ return ((bool) (is_resource($this->_connection)
+ && get_resource_type($this->_connection) == 'DB2 Connection'));
+ }
+
+ /**
+ * Force the connection to close.
+ *
+ * @return void
+ */
+ public function closeConnection()
+ {
+ if ($this->isConnected()) {
+ db2_close($this->_connection);
+ }
+ $this->_connection = null;
+ }
+
+ /**
+ * Returns an SQL statement for preparation.
+ *
+ * @param string $sql The SQL statement with placeholders.
+ * @return Zend_Db_Statement_Db2
+ */
+ public function prepare($sql)
+ {
+ $this->_connect();
+ $stmtClass = $this->_defaultStmtClass;
+ if (!class_exists($stmtClass)) {
+ Zend_Loader::loadClass($stmtClass);
+ }
+ $stmt = new $stmtClass($this, $sql);
+ $stmt->setFetchMode($this->_fetchMode);
+ return $stmt;
+ }
+
+ /**
+ * Gets the execution mode
+ *
+ * @return int the execution mode (DB2_AUTOCOMMIT_ON or DB2_AUTOCOMMIT_OFF)
+ */
+ public function _getExecuteMode()
+ {
+ return $this->_execute_mode;
+ }
+
+ /**
+ * @param integer $mode
+ * @return void
+ */
+ public function _setExecuteMode($mode)
+ {
+ switch ($mode) {
+ case DB2_AUTOCOMMIT_OFF:
+ case DB2_AUTOCOMMIT_ON:
+ $this->_execute_mode = $mode;
+ db2_autocommit($this->_connection, $mode);
+ break;
+ default:
+ /**
+ * @see Zend_Db_Adapter_Db2_Exception
+ */
+ throw new Zend_Db_Adapter_Db2_Exception("execution mode not supported");
+ break;
+ }
+ }
+
+ /**
+ * Quote a raw string.
+ *
+ * @param string $value Raw string
+ * @return string Quoted string
+ */
+ protected function _quote($value)
+ {
+ if (is_int($value) || is_float($value)) {
+ return $value;
+ }
+ /**
+ * Use db2_escape_string() if it is present in the IBM DB2 extension.
+ * But some supported versions of PHP do not include this function,
+ * so fall back to default quoting in the parent class.
+ */
+ if (function_exists('db2_escape_string')) {
+ return "'" . db2_escape_string($value) . "'";
+ }
+ return parent::_quote($value);
+ }
+
+ /**
+ * @return string
+ */
+ public function getQuoteIdentifierSymbol()
+ {
+ $this->_connect();
+ $info = db2_server_info($this->_connection);
+ if ($info) {
+ $identQuote = $info->IDENTIFIER_QUOTE_CHAR;
+ } else {
+ // db2_server_info() does not return result on some i5 OS version
+ if ($this->_isI5) {
+ $identQuote ="'";
+ }
+ }
+ return $identQuote;
+ }
+
+ /**
+ * Returns a list of the tables in the database.
+ * @param string $schema OPTIONAL
+ * @return array
+ */
+ public function listTables($schema = null)
+ {
+ $this->_connect();
+
+ if ($schema === null && $this->_config['schema'] != null) {
+ $schema = $this->_config['schema'];
+ }
+
+ $tables = array();
+
+ if (!$this->_isI5) {
+ if ($schema) {
+ $stmt = db2_tables($this->_connection, null, $schema);
+ } else {
+ $stmt = db2_tables($this->_connection);
+ }
+ while ($row = db2_fetch_assoc($stmt)) {
+ $tables[] = $row['TABLE_NAME'];
+ }
+ } else {
+ $tables = $this->_i5listTables($schema);
+ }
+
+ return $tables;
+ }
+
+
+ /**
+ * Returns the column descriptions for a table.
+ *
+ * The return value is an associative array keyed by the column name,
+ * as returned by the RDBMS.
+ *
+ * The value of each array element is an associative array
+ * with the following keys:
+ *
+ * SCHEMA_NAME => string; name of database or schema
+ * TABLE_NAME => string;
+ * COLUMN_NAME => string; column name
+ * COLUMN_POSITION => number; ordinal position of column in table
+ * DATA_TYPE => string; SQL datatype name of column
+ * DEFAULT => string; default expression of column, null if none
+ * NULLABLE => boolean; true if column can have nulls
+ * LENGTH => number; length of CHAR/VARCHAR
+ * SCALE => number; scale of NUMERIC/DECIMAL
+ * PRECISION => number; precision of NUMERIC/DECIMAL
+ * UNSIGNED => boolean; unsigned property of an integer type
+ * DB2 not supports UNSIGNED integer.
+ * PRIMARY => boolean; true if column is part of the primary key
+ * PRIMARY_POSITION => integer; position of column in primary key
+ * IDENTITY => integer; true if column is auto-generated with unique values
+ *
+ * @param string $tableName
+ * @param string $schemaName OPTIONAL
+ * @return array
+ */
+ public function describeTable($tableName, $schemaName = null)
+ {
+ // Ensure the connection is made so that _isI5 is set
+ $this->_connect();
+
+ if ($schemaName === null && $this->_config['schema'] != null) {
+ $schemaName = $this->_config['schema'];
+ }
+
+ if (!$this->_isI5) {
+
+ $sql = "SELECT DISTINCT c.tabschema, c.tabname, c.colname, c.colno,
+ c.typename, c.default, c.nulls, c.length, c.scale,
+ c.identity, tc.type AS tabconsttype, k.colseq
+ FROM syscat.columns c
+ LEFT JOIN (syscat.keycoluse k JOIN syscat.tabconst tc
+ ON (k.tabschema = tc.tabschema
+ AND k.tabname = tc.tabname
+ AND tc.type = 'P'))
+ ON (c.tabschema = k.tabschema
+ AND c.tabname = k.tabname
+ AND c.colname = k.colname)
+ WHERE "
+ . $this->quoteInto('UPPER(c.tabname) = UPPER(?)', $tableName);
+
+ if ($schemaName) {
+ $sql .= $this->quoteInto(' AND UPPER(c.tabschema) = UPPER(?)', $schemaName);
+ }
+
+ $sql .= " ORDER BY c.colno";
+
+ } else {
+
+ // DB2 On I5 specific query
+ $sql = "SELECT DISTINCT C.TABLE_SCHEMA, C.TABLE_NAME, C.COLUMN_NAME, C.ORDINAL_POSITION,
+ C.DATA_TYPE, C.COLUMN_DEFAULT, C.NULLS ,C.LENGTH, C.SCALE, LEFT(C.IDENTITY,1),
+ LEFT(tc.TYPE, 1) AS tabconsttype, k.COLSEQ
+ FROM QSYS2.SYSCOLUMNS C
+ LEFT JOIN (QSYS2.syskeycst k JOIN QSYS2.SYSCST tc
+ ON (k.TABLE_SCHEMA = tc.TABLE_SCHEMA
+ AND k.TABLE_NAME = tc.TABLE_NAME
+ AND LEFT(tc.type,1) = 'P'))
+ ON (C.TABLE_SCHEMA = k.TABLE_SCHEMA
+ AND C.TABLE_NAME = k.TABLE_NAME
+ AND C.COLUMN_NAME = k.COLUMN_NAME)
+ WHERE "
+ . $this->quoteInto('UPPER(C.TABLE_NAME) = UPPER(?)', $tableName);
+
+ if ($schemaName) {
+ $sql .= $this->quoteInto(' AND UPPER(C.TABLE_SCHEMA) = UPPER(?)', $schemaName);
+ }
+
+ $sql .= " ORDER BY C.ORDINAL_POSITION FOR FETCH ONLY";
+ }
+
+ $desc = array();
+ $stmt = $this->query($sql);
+
+ /**
+ * To avoid case issues, fetch using FETCH_NUM
+ */
+ $result = $stmt->fetchAll(Zend_Db::FETCH_NUM);
+
+ /**
+ * The ordering of columns is defined by the query so we can map
+ * to variables to improve readability
+ */
+ $tabschema = 0;
+ $tabname = 1;
+ $colname = 2;
+ $colno = 3;
+ $typename = 4;
+ $default = 5;
+ $nulls = 6;
+ $length = 7;
+ $scale = 8;
+ $identityCol = 9;
+ $tabconstType = 10;
+ $colseq = 11;
+
+ foreach ($result as $key => $row) {
+ list ($primary, $primaryPosition, $identity) = array(false, null, false);
+ if ($row[$tabconstType] == 'P') {
+ $primary = true;
+ $primaryPosition = $row[$colseq];
+ }
+ /**
+ * In IBM DB2, an column can be IDENTITY
+ * even if it is not part of the PRIMARY KEY.
+ */
+ if ($row[$identityCol] == 'Y') {
+ $identity = true;
+ }
+
+ // only colname needs to be case adjusted
+ $desc[$this->foldCase($row[$colname])] = array(
+ 'SCHEMA_NAME' => $this->foldCase($row[$tabschema]),
+ 'TABLE_NAME' => $this->foldCase($row[$tabname]),
+ 'COLUMN_NAME' => $this->foldCase($row[$colname]),
+ 'COLUMN_POSITION' => (!$this->_isI5) ? $row[$colno]+1 : $row[$colno],
+ 'DATA_TYPE' => $row[$typename],
+ 'DEFAULT' => $row[$default],
+ 'NULLABLE' => (bool) ($row[$nulls] == 'Y'),
+ 'LENGTH' => $row[$length],
+ 'SCALE' => $row[$scale],
+ 'PRECISION' => ($row[$typename] == 'DECIMAL' ? $row[$length] : 0),
+ 'UNSIGNED' => false,
+ 'PRIMARY' => $primary,
+ 'PRIMARY_POSITION' => $primaryPosition,
+ 'IDENTITY' => $identity
+ );
+ }
+
+ return $desc;
+ }
+
+ /**
+ * Return the most recent value from the specified sequence in the database.
+ * This is supported only on RDBMS brands that support sequences
+ * (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.
+ *
+ * @param string $sequenceName
+ * @return string
+ */
+ public function lastSequenceId($sequenceName)
+ {
+ $this->_connect();
+
+ if (!$this->_isI5) {
+ $quotedSequenceName = $this->quoteIdentifier($sequenceName, true);
+ $sql = 'SELECT PREVVAL FOR ' . $quotedSequenceName . ' AS VAL FROM SYSIBM.SYSDUMMY1';
+ } else {
+ $quotedSequenceName = $sequenceName;
+ $sql = 'SELECT PREVVAL FOR ' . $this->quoteIdentifier($sequenceName, true) . ' AS VAL FROM QSYS2.QSQPTABL';
+ }
+
+ $value = $this->fetchOne($sql);
+ return (string) $value;
+ }
+
+ /**
+ * Generate a new value from the specified sequence in the database, and return it.
+ * This is supported only on RDBMS brands that support sequences
+ * (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.
+ *
+ * @param string $sequenceName
+ * @return string
+ */
+ public function nextSequenceId($sequenceName)
+ {
+ $this->_connect();
+ $sql = 'SELECT NEXTVAL FOR '.$this->quoteIdentifier($sequenceName, true).' AS VAL FROM SYSIBM.SYSDUMMY1';
+ $value = $this->fetchOne($sql);
+ return (string) $value;
+ }
+
+ /**
+ * Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.
+ *
+ * As a convention, on RDBMS brands that support sequences
+ * (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence
+ * from the arguments and returns the last id generated by that sequence.
+ * On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method
+ * returns the last value generated for such a column, and the table name
+ * argument is disregarded.
+ *
+ * The IDENTITY_VAL_LOCAL() function gives the last generated identity value
+ * in the current process, even if it was for a GENERATED column.
+ *
+ * @param string $tableName OPTIONAL
+ * @param string $primaryKey OPTIONAL
+ * @param string $idType OPTIONAL used for i5 platform to define sequence/idenity unique value
+ * @return string
+ */
+
+ public function lastInsertId($tableName = null, $primaryKey = null, $idType = null)
+ {
+ $this->_connect();
+
+ if ($this->_isI5) {
+ return (string) $this->_i5LastInsertId($tableName, $idType);
+ }
+
+ if ($tableName !== null) {
+ $sequenceName = $tableName;
+ if ($primaryKey) {
+ $sequenceName .= "_$primaryKey";
+ }
+ $sequenceName .= '_seq';
+ return $this->lastSequenceId($sequenceName);
+ }
+
+ $sql = 'SELECT IDENTITY_VAL_LOCAL() AS VAL FROM SYSIBM.SYSDUMMY1';
+ $value = $this->fetchOne($sql);
+ return (string) $value;
+ }
+
+ /**
+ * Begin a transaction.
+ *
+ * @return void
+ */
+ protected function _beginTransaction()
+ {
+ $this->_setExecuteMode(DB2_AUTOCOMMIT_OFF);
+ }
+
+ /**
+ * Commit a transaction.
+ *
+ * @return void
+ */
+ protected function _commit()
+ {
+ if (!db2_commit($this->_connection)) {
+ /**
+ * @see Zend_Db_Adapter_Db2_Exception
+ */
+ throw new Zend_Db_Adapter_Db2_Exception(
+ db2_conn_errormsg($this->_connection),
+ db2_conn_error($this->_connection));
+ }
+
+ $this->_setExecuteMode(DB2_AUTOCOMMIT_ON);
+ }
+
+ /**
+ * Rollback a transaction.
+ *
+ * @return void
+ */
+ protected function _rollBack()
+ {
+ if (!db2_rollback($this->_connection)) {
+ /**
+ * @see Zend_Db_Adapter_Db2_Exception
+ */
+ throw new Zend_Db_Adapter_Db2_Exception(
+ db2_conn_errormsg($this->_connection),
+ db2_conn_error($this->_connection));
+ }
+ $this->_setExecuteMode(DB2_AUTOCOMMIT_ON);
+ }
+
+ /**
+ * Set the fetch mode.
+ *
+ * @param integer $mode
+ * @return void
+ * @throws Zend_Db_Adapter_Db2_Exception
+ */
+ public function setFetchMode($mode)
+ {
+ switch ($mode) {
+ case Zend_Db::FETCH_NUM: // seq array
+ case Zend_Db::FETCH_ASSOC: // assoc array
+ case Zend_Db::FETCH_BOTH: // seq+assoc array
+ case Zend_Db::FETCH_OBJ: // object
+ $this->_fetchMode = $mode;
+ break;
+ case Zend_Db::FETCH_BOUND: // bound to PHP variable
+ /**
+ * @see Zend_Db_Adapter_Db2_Exception
+ */
+ throw new Zend_Db_Adapter_Db2_Exception('FETCH_BOUND is not supported yet');
+ break;
+ default:
+ /**
+ * @see Zend_Db_Adapter_Db2_Exception
+ */
+ throw new Zend_Db_Adapter_Db2_Exception("Invalid fetch mode '$mode' specified");
+ break;
+ }
+ }
+
+ /**
+ * Adds an adapter-specific LIMIT clause to the SELECT statement.
+ *
+ * @param string $sql
+ * @param integer $count
+ * @param integer $offset OPTIONAL
+ * @return string
+ */
+ public function limit($sql, $count, $offset = 0)
+ {
+ $count = intval($count);
+ if ($count <= 0) {
+ /**
+ * @see Zend_Db_Adapter_Db2_Exception
+ */
+ throw new Zend_Db_Adapter_Db2_Exception("LIMIT argument count=$count is not valid");
+ }
+
+ $offset = intval($offset);
+ if ($offset < 0) {
+ /**
+ * @see Zend_Db_Adapter_Db2_Exception
+ */
+ throw new Zend_Db_Adapter_Db2_Exception("LIMIT argument offset=$offset is not valid");
+ }
+
+ if ($offset == 0) {
+ $limit_sql = $sql . " FETCH FIRST $count ROWS ONLY";
+ return $limit_sql;
+ }
+
+ /**
+ * DB2 does not implement the LIMIT clause as some RDBMS do.
+ * We have to simulate it with subqueries and ROWNUM.
+ * Unfortunately because we use the column wildcard "*",
+ * this puts an extra column into the query result set.
+ */
+ $limit_sql = "SELECT z2.*
+ FROM (
+ SELECT ROW_NUMBER() OVER() AS \"ZEND_DB_ROWNUM\", z1.*
+ FROM (
+ " . $sql . "
+ ) z1
+ ) z2
+ WHERE z2.zend_db_rownum BETWEEN " . ($offset+1) . " AND " . ($offset+$count);
+ return $limit_sql;
+ }
+
+ /**
+ * Check if the adapter supports real SQL parameters.
+ *
+ * @param string $type 'positional' or 'named'
+ * @return bool
+ */
+ public function supportsParameters($type)
+ {
+ if ($type == 'positional') {
+ return true;
+ }
+
+ // if its 'named' or anything else
+ return false;
+ }
+
+ /**
+ * Retrieve server version in PHP style
+ *
+ * @return string
+ */
+ public function getServerVersion()
+ {
+ $this->_connect();
+ $server_info = db2_server_info($this->_connection);
+ if ($server_info !== false) {
+ $version = $server_info->DBMS_VER;
+ if ($this->_isI5) {
+ $version = (int) substr($version, 0, 2) . '.' . (int) substr($version, 2, 2) . '.' . (int) substr($version, 4);
+ }
+ return $version;
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * Return whether or not this is running on i5
+ *
+ * @return bool
+ */
+ public function isI5()
+ {
+ if ($this->_isI5 === null) {
+ $this->_determineI5();
+ }
+
+ return (bool) $this->_isI5;
+ }
+
+ /**
+ * Check the connection parameters according to verify
+ * type of used OS
+ *
+ * @return void
+ */
+ protected function _determineI5()
+ {
+ // first us the compiled flag.
+ $this->_isI5 = (php_uname('s') == 'OS400') ? true : false;
+
+ // if this is set, then us it
+ if (isset($this->_config['os'])){
+ if (strtolower($this->_config['os']) === 'i5') {
+ $this->_isI5 = true;
+ } else {
+ // any other value passed in, its null
+ $this->_isI5 = false;
+ }
+ }
+
+ }
+
+ /**
+ * Db2 On I5 specific method
+ *
+ * Returns a list of the tables in the database .
+ * Used only for DB2/400.
+ *
+ * @return array
+ */
+ protected function _i5listTables($schema = null)
+ {
+ //list of i5 libraries.
+ $tables = array();
+ if ($schema) {
+ $tablesStatement = db2_tables($this->_connection, null, $schema);
+ while ($rowTables = db2_fetch_assoc($tablesStatement) ) {
+ if ($rowTables['TABLE_NAME'] !== null) {
+ $tables[] = $rowTables['TABLE_NAME'];
+ }
+ }
+ } else {
+ $schemaStatement = db2_tables($this->_connection);
+ while ($schema = db2_fetch_assoc($schemaStatement)) {
+ if ($schema['TABLE_SCHEM'] !== null) {
+ // list of the tables which belongs to the selected library
+ $tablesStatement = db2_tables($this->_connection, NULL, $schema['TABLE_SCHEM']);
+ if (is_resource($tablesStatement)) {
+ while ($rowTables = db2_fetch_assoc($tablesStatement) ) {
+ if ($rowTables['TABLE_NAME'] !== null) {
+ $tables[] = $rowTables['TABLE_NAME'];
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return $tables;
+ }
+
+ protected function _i5LastInsertId($objectName = null, $idType = null)
+ {
+
+ if ($objectName === null) {
+ $sql = 'SELECT IDENTITY_VAL_LOCAL() AS VAL FROM QSYS2.QSQPTABL';
+ $value = $this->fetchOne($sql);
+ return $value;
+ }
+
+ if (strtoupper($idType) === 'S'){
+ //check i5_lib option
+ $sequenceName = $objectName;
+ return $this->lastSequenceId($sequenceName);
+ }
+
+ //returns last identity value for the specified table
+ //if (strtoupper($idType) === 'I') {
+ $tableName = $objectName;
+ return $this->fetchOne('SELECT IDENTITY_VAL_LOCAL() from ' . $this->quoteIdentifier($tableName));
+ }
+
+}
+
+
diff --git a/library/vendor/Zend/Db/Adapter/Db2/Exception.php b/library/vendor/Zend/Db/Adapter/Db2/Exception.php
new file mode 100644
index 0000000..d12dc48
--- /dev/null
+++ b/library/vendor/Zend/Db/Adapter/Db2/Exception.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Db_Adapter_Exception
+ */
+
+/**
+ * Zend_Db_Adapter_Db2_Exception
+ *
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Adapter_Db2_Exception extends Zend_Db_Adapter_Exception
+{
+ protected $code = '00000';
+ protected $message = 'unknown exception';
+
+ function __construct($message = 'unknown exception', $code = '00000', Exception $e = null)
+ {
+ parent::__construct($message, $code, $e);
+ }
+}
diff --git a/library/vendor/Zend/Db/Adapter/Exception.php b/library/vendor/Zend/Db/Adapter/Exception.php
new file mode 100644
index 0000000..c302bc7
--- /dev/null
+++ b/library/vendor/Zend/Db/Adapter/Exception.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Db_Exception
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Adapter_Exception extends Zend_Db_Exception
+{
+ protected $_chainedException = null;
+
+ public function __construct($message = '', $code = 0, Exception $e = null)
+ {
+ if ($e && (0 === $code)) {
+ $code = $e->getCode();
+ }
+ parent::__construct($message, $code, $e);
+ }
+
+ public function hasChainedException()
+ {
+ return ($this->getPrevious() !== null);
+ }
+
+ public function getChainedException()
+ {
+ return $this->getPrevious();
+ }
+
+}
diff --git a/library/vendor/Zend/Db/Adapter/Mysqli.php b/library/vendor/Zend/Db/Adapter/Mysqli.php
new file mode 100644
index 0000000..087d3ac
--- /dev/null
+++ b/library/vendor/Zend/Db/Adapter/Mysqli.php
@@ -0,0 +1,543 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Db_Adapter_Abstract
+ */
+
+/**
+ * @see Zend_Db_Profiler
+ */
+
+/**
+ * @see Zend_Db_Select
+ */
+
+/**
+ * @see Zend_Db_Statement_Mysqli
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Adapter_Mysqli extends Zend_Db_Adapter_Abstract
+{
+
+ /**
+ * Keys are UPPERCASE SQL datatypes or the constants
+ * Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE, or Zend_Db::FLOAT_TYPE.
+ *
+ * Values are:
+ * 0 = 32-bit integer
+ * 1 = 64-bit integer
+ * 2 = float or decimal
+ *
+ * @var array Associative array of datatypes to values 0, 1, or 2.
+ */
+ protected $_numericDataTypes = array(
+ Zend_Db::INT_TYPE => Zend_Db::INT_TYPE,
+ Zend_Db::BIGINT_TYPE => Zend_Db::BIGINT_TYPE,
+ Zend_Db::FLOAT_TYPE => Zend_Db::FLOAT_TYPE,
+ 'INT' => Zend_Db::INT_TYPE,
+ 'INTEGER' => Zend_Db::INT_TYPE,
+ 'MEDIUMINT' => Zend_Db::INT_TYPE,
+ 'SMALLINT' => Zend_Db::INT_TYPE,
+ 'TINYINT' => Zend_Db::INT_TYPE,
+ 'BIGINT' => Zend_Db::BIGINT_TYPE,
+ 'SERIAL' => Zend_Db::BIGINT_TYPE,
+ 'DEC' => Zend_Db::FLOAT_TYPE,
+ 'DECIMAL' => Zend_Db::FLOAT_TYPE,
+ 'DOUBLE' => Zend_Db::FLOAT_TYPE,
+ 'DOUBLE PRECISION' => Zend_Db::FLOAT_TYPE,
+ 'FIXED' => Zend_Db::FLOAT_TYPE,
+ 'FLOAT' => Zend_Db::FLOAT_TYPE
+ );
+
+ /**
+ * @var Zend_Db_Statement_Mysqli
+ */
+ protected $_stmt = null;
+
+ /**
+ * Default class name for a DB statement.
+ *
+ * @var string
+ */
+ protected $_defaultStmtClass = 'Zend_Db_Statement_Mysqli';
+
+ /**
+ * Quote a raw string.
+ *
+ * @param mixed $value Raw string
+ *
+ * @return string Quoted string
+ */
+ protected function _quote($value)
+ {
+ if (is_int($value) || is_float($value)) {
+ return $value;
+ }
+ $this->_connect();
+ return "'" . $this->_connection->real_escape_string($value) . "'";
+ }
+
+ /**
+ * Returns the symbol the adapter uses for delimiting identifiers.
+ *
+ * @return string
+ */
+ public function getQuoteIdentifierSymbol()
+ {
+ return "`";
+ }
+
+ /**
+ * Returns a list of the tables in the database.
+ *
+ * @return array
+ */
+ public function listTables()
+ {
+ $result = array();
+ // Use mysqli extension API, because SHOW doesn't work
+ // well as a prepared statement on MySQL 4.1.
+ $sql = 'SHOW TABLES';
+ if ($queryResult = $this->getConnection()->query($sql)) {
+ while ($row = $queryResult->fetch_row()) {
+ $result[] = $row[0];
+ }
+ $queryResult->close();
+ } else {
+ /**
+ * @see Zend_Db_Adapter_Mysqli_Exception
+ */
+ throw new Zend_Db_Adapter_Mysqli_Exception($this->getConnection()->error);
+ }
+ return $result;
+ }
+
+ /**
+ * Returns the column descriptions for a table.
+ *
+ * The return value is an associative array keyed by the column name,
+ * as returned by the RDBMS.
+ *
+ * The value of each array element is an associative array
+ * with the following keys:
+ *
+ * SCHEMA_NAME => string; name of database or schema
+ * TABLE_NAME => string;
+ * COLUMN_NAME => string; column name
+ * COLUMN_POSITION => number; ordinal position of column in table
+ * DATA_TYPE => string; SQL datatype name of column
+ * DEFAULT => string; default expression of column, null if none
+ * NULLABLE => boolean; true if column can have nulls
+ * LENGTH => number; length of CHAR/VARCHAR
+ * SCALE => number; scale of NUMERIC/DECIMAL
+ * PRECISION => number; precision of NUMERIC/DECIMAL
+ * UNSIGNED => boolean; unsigned property of an integer type
+ * PRIMARY => boolean; true if column is part of the primary key
+ * PRIMARY_POSITION => integer; position of column in primary key
+ * IDENTITY => integer; true if column is auto-generated with unique values
+ *
+ * @param string $tableName
+ * @param string $schemaName OPTIONAL
+ * @return array
+ */
+ public function describeTable($tableName, $schemaName = null)
+ {
+ /**
+ * @todo use INFORMATION_SCHEMA someday when
+ * MySQL's implementation isn't too slow.
+ */
+
+ if ($schemaName) {
+ $sql = 'DESCRIBE ' . $this->quoteIdentifier("$schemaName.$tableName", true);
+ } else {
+ $sql = 'DESCRIBE ' . $this->quoteIdentifier($tableName, true);
+ }
+
+ /**
+ * Use mysqli extension API, because DESCRIBE doesn't work
+ * well as a prepared statement on MySQL 4.1.
+ */
+ if ($queryResult = $this->getConnection()->query($sql)) {
+ while ($row = $queryResult->fetch_assoc()) {
+ $result[] = $row;
+ }
+ $queryResult->close();
+ } else {
+ /**
+ * @see Zend_Db_Adapter_Mysqli_Exception
+ */
+ throw new Zend_Db_Adapter_Mysqli_Exception($this->getConnection()->error);
+ }
+
+ $desc = array();
+
+ $row_defaults = array(
+ 'Length' => null,
+ 'Scale' => null,
+ 'Precision' => null,
+ 'Unsigned' => null,
+ 'Primary' => false,
+ 'PrimaryPosition' => null,
+ 'Identity' => false
+ );
+ $i = 1;
+ $p = 1;
+ foreach ($result as $key => $row) {
+ $row = array_merge($row_defaults, $row);
+ if (preg_match('/unsigned/', $row['Type'])) {
+ $row['Unsigned'] = true;
+ }
+ if (preg_match('/^((?:var)?char)\((\d+)\)/', $row['Type'], $matches)) {
+ $row['Type'] = $matches[1];
+ $row['Length'] = $matches[2];
+ } else if (preg_match('/^decimal\((\d+),(\d+)\)/', $row['Type'], $matches)) {
+ $row['Type'] = 'decimal';
+ $row['Precision'] = $matches[1];
+ $row['Scale'] = $matches[2];
+ } else if (preg_match('/^float\((\d+),(\d+)\)/', $row['Type'], $matches)) {
+ $row['Type'] = 'float';
+ $row['Precision'] = $matches[1];
+ $row['Scale'] = $matches[2];
+ } else if (preg_match('/^((?:big|medium|small|tiny)?int)\((\d+)\)/', $row['Type'], $matches)) {
+ $row['Type'] = $matches[1];
+ /**
+ * The optional argument of a MySQL int type is not precision
+ * or length; it is only a hint for display width.
+ */
+ }
+ if (strtoupper($row['Key']) == 'PRI') {
+ $row['Primary'] = true;
+ $row['PrimaryPosition'] = $p;
+ if ($row['Extra'] == 'auto_increment') {
+ $row['Identity'] = true;
+ } else {
+ $row['Identity'] = false;
+ }
+ ++$p;
+ }
+ $desc[$this->foldCase($row['Field'])] = array(
+ 'SCHEMA_NAME' => null, // @todo
+ 'TABLE_NAME' => $this->foldCase($tableName),
+ 'COLUMN_NAME' => $this->foldCase($row['Field']),
+ 'COLUMN_POSITION' => $i,
+ 'DATA_TYPE' => $row['Type'],
+ 'DEFAULT' => $row['Default'],
+ 'NULLABLE' => (bool) ($row['Null'] == 'YES'),
+ 'LENGTH' => $row['Length'],
+ 'SCALE' => $row['Scale'],
+ 'PRECISION' => $row['Precision'],
+ 'UNSIGNED' => $row['Unsigned'],
+ 'PRIMARY' => $row['Primary'],
+ 'PRIMARY_POSITION' => $row['PrimaryPosition'],
+ 'IDENTITY' => $row['Identity']
+ );
+ ++$i;
+ }
+ return $desc;
+ }
+
+ /**
+ * Creates a connection to the database.
+ *
+ * @return void
+ * @throws Zend_Db_Adapter_Mysqli_Exception
+ */
+ protected function _connect()
+ {
+ if ($this->_connection) {
+ return;
+ }
+
+ if (!extension_loaded('mysqli')) {
+ /**
+ * @see Zend_Db_Adapter_Mysqli_Exception
+ */
+ throw new Zend_Db_Adapter_Mysqli_Exception('The Mysqli extension is required for this adapter but the extension is not loaded');
+ }
+
+ if (isset($this->_config['port'])) {
+ $port = (integer) $this->_config['port'];
+ } else {
+ $port = null;
+ }
+
+ if (isset($this->_config['socket'])) {
+ $socket = $this->_config['socket'];
+ } else {
+ $socket = null;
+ }
+
+ $this->_connection = mysqli_init();
+
+ if(!empty($this->_config['driver_options'])) {
+ foreach($this->_config['driver_options'] as $option=>$value) {
+ if(is_string($option)) {
+ // Suppress warnings here
+ // Ignore it if it's not a valid constant
+ $option = @constant(strtoupper($option));
+ if($option === null)
+ continue;
+ }
+ mysqli_options($this->_connection, $option, $value);
+ }
+ }
+
+ // Suppress connection warnings here.
+ // Throw an exception instead.
+ $_isConnected = @mysqli_real_connect(
+ $this->_connection,
+ $this->_config['host'],
+ $this->_config['username'],
+ $this->_config['password'],
+ $this->_config['dbname'],
+ $port,
+ $socket
+ );
+
+ if ($_isConnected === false || mysqli_connect_errno()) {
+
+ $this->closeConnection();
+ /**
+ * @see Zend_Db_Adapter_Mysqli_Exception
+ */
+ throw new Zend_Db_Adapter_Mysqli_Exception(mysqli_connect_error());
+ }
+
+ if (!empty($this->_config['charset'])) {
+ mysqli_set_charset($this->_connection, $this->_config['charset']);
+ }
+ }
+
+ /**
+ * Test if a connection is active
+ *
+ * @return boolean
+ */
+ public function isConnected()
+ {
+ return ((bool) ($this->_connection instanceof mysqli));
+ }
+
+ /**
+ * Force the connection to close.
+ *
+ * @return void
+ */
+ public function closeConnection()
+ {
+ if ($this->isConnected()) {
+ $this->_connection->close();
+ }
+ $this->_connection = null;
+ }
+
+ /**
+ * Prepare a statement and return a PDOStatement-like object.
+ *
+ * @param string $sql SQL query
+ * @return Zend_Db_Statement_Mysqli
+ */
+ public function prepare($sql)
+ {
+ $this->_connect();
+ if ($this->_stmt) {
+ $this->_stmt->close();
+ }
+ $stmtClass = $this->_defaultStmtClass;
+ if (!class_exists($stmtClass)) {
+ Zend_Loader::loadClass($stmtClass);
+ }
+ $stmt = new $stmtClass($this, $sql);
+ if ($stmt === false) {
+ return false;
+ }
+ $stmt->setFetchMode($this->_fetchMode);
+ $this->_stmt = $stmt;
+ return $stmt;
+ }
+
+ /**
+ * Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.
+ *
+ * As a convention, on RDBMS brands that support sequences
+ * (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence
+ * from the arguments and returns the last id generated by that sequence.
+ * On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method
+ * returns the last value generated for such a column, and the table name
+ * argument is disregarded.
+ *
+ * MySQL does not support sequences, so $tableName and $primaryKey are ignored.
+ *
+ * @param string $tableName OPTIONAL Name of table.
+ * @param string $primaryKey OPTIONAL Name of primary key column.
+ * @return string
+ * @todo Return value should be int?
+ */
+ public function lastInsertId($tableName = null, $primaryKey = null)
+ {
+ $mysqli = $this->_connection;
+ return (string) $mysqli->insert_id;
+ }
+
+ /**
+ * Begin a transaction.
+ *
+ * @return void
+ */
+ protected function _beginTransaction()
+ {
+ $this->_connect();
+ $this->_connection->autocommit(false);
+ }
+
+ /**
+ * Commit a transaction.
+ *
+ * @return void
+ */
+ protected function _commit()
+ {
+ $this->_connect();
+ $this->_connection->commit();
+ $this->_connection->autocommit(true);
+ }
+
+ /**
+ * Roll-back a transaction.
+ *
+ * @return void
+ */
+ protected function _rollBack()
+ {
+ $this->_connect();
+ $this->_connection->rollback();
+ $this->_connection->autocommit(true);
+ }
+
+ /**
+ * Set the fetch mode.
+ *
+ * @param int $mode
+ * @return void
+ * @throws Zend_Db_Adapter_Mysqli_Exception
+ */
+ public function setFetchMode($mode)
+ {
+ switch ($mode) {
+ case Zend_Db::FETCH_LAZY:
+ case Zend_Db::FETCH_ASSOC:
+ case Zend_Db::FETCH_NUM:
+ case Zend_Db::FETCH_BOTH:
+ case Zend_Db::FETCH_NAMED:
+ case Zend_Db::FETCH_OBJ:
+ $this->_fetchMode = $mode;
+ break;
+ case Zend_Db::FETCH_BOUND: // bound to PHP variable
+ /**
+ * @see Zend_Db_Adapter_Mysqli_Exception
+ */
+ throw new Zend_Db_Adapter_Mysqli_Exception('FETCH_BOUND is not supported yet');
+ break;
+ default:
+ /**
+ * @see Zend_Db_Adapter_Mysqli_Exception
+ */
+ throw new Zend_Db_Adapter_Mysqli_Exception("Invalid fetch mode '$mode' specified");
+ }
+ }
+
+ /**
+ * Adds an adapter-specific LIMIT clause to the SELECT statement.
+ *
+ * @param string $sql
+ * @param int $count
+ * @param int $offset OPTIONAL
+ * @return string
+ */
+ public function limit($sql, $count, $offset = 0)
+ {
+ $count = intval($count);
+ if ($count <= 0) {
+ /**
+ * @see Zend_Db_Adapter_Mysqli_Exception
+ */
+ throw new Zend_Db_Adapter_Mysqli_Exception("LIMIT argument count=$count is not valid");
+ }
+
+ $offset = intval($offset);
+ if ($offset < 0) {
+ /**
+ * @see Zend_Db_Adapter_Mysqli_Exception
+ */
+ throw new Zend_Db_Adapter_Mysqli_Exception("LIMIT argument offset=$offset is not valid");
+ }
+
+ $sql .= " LIMIT $count";
+ if ($offset > 0) {
+ $sql .= " OFFSET $offset";
+ }
+
+ return $sql;
+ }
+
+ /**
+ * Check if the adapter supports real SQL parameters.
+ *
+ * @param string $type 'positional' or 'named'
+ * @return bool
+ */
+ public function supportsParameters($type)
+ {
+ switch ($type) {
+ case 'positional':
+ return true;
+ case 'named':
+ default:
+ return false;
+ }
+ }
+
+ /**
+ * Retrieve server version in PHP style
+ *
+ *@return string
+ */
+ public function getServerVersion()
+ {
+ $this->_connect();
+ $version = $this->_connection->server_version;
+ $major = (int) ($version / 10000);
+ $minor = (int) ($version % 10000 / 100);
+ $revision = (int) ($version % 100);
+ return $major . '.' . $minor . '.' . $revision;
+ }
+}
diff --git a/library/vendor/Zend/Db/Adapter/Mysqli/Exception.php b/library/vendor/Zend/Db/Adapter/Mysqli/Exception.php
new file mode 100644
index 0000000..9c94adc
--- /dev/null
+++ b/library/vendor/Zend/Db/Adapter/Mysqli/Exception.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ *
+ */
+
+/**
+ * Zend
+ */
+
+/**
+ * Zend_Db_Adapter_Mysqli_Exception
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Adapter_Mysqli_Exception extends Zend_Db_Adapter_Exception
+{
+}
diff --git a/library/vendor/Zend/Db/Adapter/Oracle.php b/library/vendor/Zend/Db/Adapter/Oracle.php
new file mode 100644
index 0000000..9ed8fb6
--- /dev/null
+++ b/library/vendor/Zend/Db/Adapter/Oracle.php
@@ -0,0 +1,631 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Db_Adapter_Abstract
+ */
+
+/**
+ * @see Zend_Db_Statement_Oracle
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Adapter_Oracle extends Zend_Db_Adapter_Abstract
+{
+ /**
+ * User-provided configuration.
+ *
+ * Basic keys are:
+ *
+ * username => (string) Connect to the database as this username.
+ * password => (string) Password associated with the username.
+ * dbname => Either the name of the local Oracle instance, or the
+ * name of the entry in tnsnames.ora to which you want to connect.
+ * persistent => (boolean) Set TRUE to use a persistent connection
+ * @var array
+ */
+ protected $_config = array(
+ 'dbname' => null,
+ 'username' => null,
+ 'password' => null,
+ 'persistent' => false
+ );
+
+ /**
+ * Keys are UPPERCASE SQL datatypes or the constants
+ * Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE, or Zend_Db::FLOAT_TYPE.
+ *
+ * Values are:
+ * 0 = 32-bit integer
+ * 1 = 64-bit integer
+ * 2 = float or decimal
+ *
+ * @var array Associative array of datatypes to values 0, 1, or 2.
+ */
+ protected $_numericDataTypes = array(
+ Zend_Db::INT_TYPE => Zend_Db::INT_TYPE,
+ Zend_Db::BIGINT_TYPE => Zend_Db::BIGINT_TYPE,
+ Zend_Db::FLOAT_TYPE => Zend_Db::FLOAT_TYPE,
+ 'BINARY_DOUBLE' => Zend_Db::FLOAT_TYPE,
+ 'BINARY_FLOAT' => Zend_Db::FLOAT_TYPE,
+ 'NUMBER' => Zend_Db::FLOAT_TYPE,
+ );
+
+ /**
+ * @var integer
+ */
+ protected $_execute_mode = null;
+
+ /**
+ * Default class name for a DB statement.
+ *
+ * @var string
+ */
+ protected $_defaultStmtClass = 'Zend_Db_Statement_Oracle';
+
+ /**
+ * Check if LOB field are returned as string
+ * instead of OCI-Lob object
+ *
+ * @var boolean
+ */
+ protected $_lobAsString = null;
+
+ /**
+ * Creates a connection resource.
+ *
+ * @return void
+ * @throws Zend_Db_Adapter_Oracle_Exception
+ */
+ protected function _connect()
+ {
+ if (is_resource($this->_connection)) {
+ // connection already exists
+ return;
+ }
+
+ if (!extension_loaded('oci8')) {
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Adapter_Oracle_Exception('The OCI8 extension is required for this adapter but the extension is not loaded');
+ }
+
+ $this->_setExecuteMode(OCI_COMMIT_ON_SUCCESS);
+
+ $connectionFuncName = ($this->_config['persistent'] == true) ? 'oci_pconnect' : 'oci_connect';
+
+ $this->_connection = @$connectionFuncName(
+ $this->_config['username'],
+ $this->_config['password'],
+ $this->_config['dbname'],
+ $this->_config['charset']);
+
+ // check the connection
+ if (!$this->_connection) {
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Adapter_Oracle_Exception(oci_error());
+ }
+ }
+
+ /**
+ * Test if a connection is active
+ *
+ * @return boolean
+ */
+ public function isConnected()
+ {
+ return ((bool) (is_resource($this->_connection)
+ && (get_resource_type($this->_connection) == 'oci8 connection'
+ || get_resource_type($this->_connection) == 'oci8 persistent connection')));
+ }
+
+ /**
+ * Force the connection to close.
+ *
+ * @return void
+ */
+ public function closeConnection()
+ {
+ if ($this->isConnected()) {
+ oci_close($this->_connection);
+ }
+ $this->_connection = null;
+ }
+
+ /**
+ * Activate/deactivate return of LOB as string
+ *
+ * @param string $lob_as_string
+ * @return Zend_Db_Adapter_Oracle
+ */
+ public function setLobAsString($lobAsString)
+ {
+ $this->_lobAsString = (bool) $lobAsString;
+ return $this;
+ }
+
+ /**
+ * Return whether or not LOB are returned as string
+ *
+ * @return boolean
+ */
+ public function getLobAsString()
+ {
+ if ($this->_lobAsString === null) {
+ // if never set by user, we use driver option if it exists otherwise false
+ if (isset($this->_config['driver_options']) &&
+ isset($this->_config['driver_options']['lob_as_string'])) {
+ $this->_lobAsString = (bool) $this->_config['driver_options']['lob_as_string'];
+ } else {
+ $this->_lobAsString = false;
+ }
+ }
+ return $this->_lobAsString;
+ }
+
+ /**
+ * Returns an SQL statement for preparation.
+ *
+ * @param string $sql The SQL statement with placeholders.
+ * @return Zend_Db_Statement_Oracle
+ */
+ public function prepare($sql)
+ {
+ $this->_connect();
+ $stmtClass = $this->_defaultStmtClass;
+ if (!class_exists($stmtClass)) {
+ Zend_Loader::loadClass($stmtClass);
+ }
+ $stmt = new $stmtClass($this, $sql);
+ if ($stmt instanceof Zend_Db_Statement_Oracle) {
+ $stmt->setLobAsString($this->getLobAsString());
+ }
+ $stmt->setFetchMode($this->_fetchMode);
+ return $stmt;
+ }
+
+ /**
+ * Quote a raw string.
+ *
+ * @param string $value Raw string
+ * @return string Quoted string
+ */
+ protected function _quote($value)
+ {
+ if (is_int($value) || is_float($value)) {
+ return $value;
+ }
+ $value = str_replace("'", "''", $value);
+ return "'" . addcslashes($value, "\000\n\r\\\032") . "'";
+ }
+
+ /**
+ * Quote a table identifier and alias.
+ *
+ * @param string|array|Zend_Db_Expr $ident The identifier or expression.
+ * @param string $alias An alias for the table.
+ * @param boolean $auto If true, heed the AUTO_QUOTE_IDENTIFIERS config option.
+ * @return string The quoted identifier and alias.
+ */
+ public function quoteTableAs($ident, $alias = null, $auto = false)
+ {
+ // Oracle doesn't allow the 'AS' keyword between the table identifier/expression and alias.
+ return $this->_quoteIdentifierAs($ident, $alias, $auto, ' ');
+ }
+
+ /**
+ * Return the most recent value from the specified sequence in the database.
+ * This is supported only on RDBMS brands that support sequences
+ * (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.
+ *
+ * @param string $sequenceName
+ * @return string
+ */
+ public function lastSequenceId($sequenceName)
+ {
+ $this->_connect();
+ $sql = 'SELECT '.$this->quoteIdentifier($sequenceName, true).'.CURRVAL FROM dual';
+ $value = $this->fetchOne($sql);
+ return $value;
+ }
+
+ /**
+ * Generate a new value from the specified sequence in the database, and return it.
+ * This is supported only on RDBMS brands that support sequences
+ * (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.
+ *
+ * @param string $sequenceName
+ * @return string
+ */
+ public function nextSequenceId($sequenceName)
+ {
+ $this->_connect();
+ $sql = 'SELECT '.$this->quoteIdentifier($sequenceName, true).'.NEXTVAL FROM dual';
+ $value = $this->fetchOne($sql);
+ return $value;
+ }
+
+ /**
+ * Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.
+ *
+ * As a convention, on RDBMS brands that support sequences
+ * (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence
+ * from the arguments and returns the last id generated by that sequence.
+ * On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method
+ * returns the last value generated for such a column, and the table name
+ * argument is disregarded.
+ *
+ * Oracle does not support IDENTITY columns, so if the sequence is not
+ * specified, this method returns null.
+ *
+ * @param string $tableName OPTIONAL Name of table.
+ * @param string $primaryKey OPTIONAL Name of primary key column.
+ * @return string
+ */
+ public function lastInsertId($tableName = null, $primaryKey = null)
+ {
+ if ($tableName !== null) {
+ $sequenceName = $tableName;
+ if ($primaryKey) {
+ $sequenceName .= "_$primaryKey";
+ }
+ $sequenceName .= '_seq';
+ return $this->lastSequenceId($sequenceName);
+ }
+
+ // No support for IDENTITY columns; return null
+ return null;
+ }
+
+ /**
+ * Returns a list of the tables in the database.
+ *
+ * @return array
+ */
+ public function listTables()
+ {
+ $this->_connect();
+ $data = $this->fetchCol('SELECT table_name FROM all_tables');
+ return $data;
+ }
+
+ /**
+ * Returns the column descriptions for a table.
+ *
+ * The return value is an associative array keyed by the column name,
+ * as returned by the RDBMS.
+ *
+ * The value of each array element is an associative array
+ * with the following keys:
+ *
+ * SCHEMA_NAME => string; name of schema
+ * TABLE_NAME => string;
+ * COLUMN_NAME => string; column name
+ * COLUMN_POSITION => number; ordinal position of column in table
+ * DATA_TYPE => string; SQL datatype name of column
+ * DEFAULT => string; default expression of column, null if none
+ * NULLABLE => boolean; true if column can have nulls
+ * LENGTH => number; length of CHAR/VARCHAR
+ * SCALE => number; scale of NUMERIC/DECIMAL
+ * PRECISION => number; precision of NUMERIC/DECIMAL
+ * UNSIGNED => boolean; unsigned property of an integer type
+ * PRIMARY => boolean; true if column is part of the primary key
+ * PRIMARY_POSITION => integer; position of column in primary key
+ * IDENTITY => integer; true if column is auto-generated with unique values
+ *
+ * @todo Discover integer unsigned property.
+ *
+ * @param string $tableName
+ * @param string $schemaName OPTIONAL
+ * @return array
+ */
+ public function describeTable($tableName, $schemaName = null)
+ {
+ $version = $this->getServerVersion();
+ if (($version === null) || version_compare($version, '9.0.0', '>=')) {
+ $sql = "SELECT TC.TABLE_NAME, TC.OWNER, TC.COLUMN_NAME, TC.DATA_TYPE,
+ TC.DATA_DEFAULT, TC.NULLABLE, TC.COLUMN_ID, TC.DATA_LENGTH,
+ TC.DATA_SCALE, TC.DATA_PRECISION, C.CONSTRAINT_TYPE, CC.POSITION
+ FROM ALL_TAB_COLUMNS TC
+ LEFT JOIN (ALL_CONS_COLUMNS CC JOIN ALL_CONSTRAINTS C
+ ON (CC.CONSTRAINT_NAME = C.CONSTRAINT_NAME AND CC.TABLE_NAME = C.TABLE_NAME AND CC.OWNER = C.OWNER AND C.CONSTRAINT_TYPE = 'P'))
+ ON TC.TABLE_NAME = CC.TABLE_NAME AND TC.COLUMN_NAME = CC.COLUMN_NAME
+ WHERE UPPER(TC.TABLE_NAME) = UPPER(:TBNAME)";
+ $bind[':TBNAME'] = $tableName;
+ if ($schemaName) {
+ $sql .= ' AND UPPER(TC.OWNER) = UPPER(:SCNAME)';
+ $bind[':SCNAME'] = $schemaName;
+ }
+ $sql .= ' ORDER BY TC.COLUMN_ID';
+ } else {
+ $subSql="SELECT AC.OWNER, AC.TABLE_NAME, ACC.COLUMN_NAME, AC.CONSTRAINT_TYPE, ACC.POSITION
+ from ALL_CONSTRAINTS AC, ALL_CONS_COLUMNS ACC
+ WHERE ACC.CONSTRAINT_NAME = AC.CONSTRAINT_NAME
+ AND ACC.TABLE_NAME = AC.TABLE_NAME
+ AND ACC.OWNER = AC.OWNER
+ AND AC.CONSTRAINT_TYPE = 'P'
+ AND UPPER(AC.TABLE_NAME) = UPPER(:TBNAME)";
+ $bind[':TBNAME'] = $tableName;
+ if ($schemaName) {
+ $subSql .= ' AND UPPER(ACC.OWNER) = UPPER(:SCNAME)';
+ $bind[':SCNAME'] = $schemaName;
+ }
+ $sql="SELECT TC.TABLE_NAME, TC.OWNER, TC.COLUMN_NAME, TC.DATA_TYPE,
+ TC.DATA_DEFAULT, TC.NULLABLE, TC.COLUMN_ID, TC.DATA_LENGTH,
+ TC.DATA_SCALE, TC.DATA_PRECISION, CC.CONSTRAINT_TYPE, CC.POSITION
+ FROM ALL_TAB_COLUMNS TC, ($subSql) CC
+ WHERE UPPER(TC.TABLE_NAME) = UPPER(:TBNAME)
+ AND TC.OWNER = CC.OWNER(+) AND TC.TABLE_NAME = CC.TABLE_NAME(+) AND TC.COLUMN_NAME = CC.COLUMN_NAME(+)";
+ if ($schemaName) {
+ $sql .= ' AND UPPER(TC.OWNER) = UPPER(:SCNAME)';
+ }
+ $sql .= ' ORDER BY TC.COLUMN_ID';
+ }
+
+ $stmt = $this->query($sql, $bind);
+
+ /**
+ * Use FETCH_NUM so we are not dependent on the CASE attribute of the PDO connection
+ */
+ $result = $stmt->fetchAll(Zend_Db::FETCH_NUM);
+
+ $table_name = 0;
+ $owner = 1;
+ $column_name = 2;
+ $data_type = 3;
+ $data_default = 4;
+ $nullable = 5;
+ $column_id = 6;
+ $data_length = 7;
+ $data_scale = 8;
+ $data_precision = 9;
+ $constraint_type = 10;
+ $position = 11;
+
+ $desc = array();
+ foreach ($result as $key => $row) {
+ list ($primary, $primaryPosition, $identity) = array(false, null, false);
+ if ($row[$constraint_type] == 'P') {
+ $primary = true;
+ $primaryPosition = $row[$position];
+ /**
+ * Oracle does not support auto-increment keys.
+ */
+ $identity = false;
+ }
+ $desc[$this->foldCase($row[$column_name])] = array(
+ 'SCHEMA_NAME' => $this->foldCase($row[$owner]),
+ 'TABLE_NAME' => $this->foldCase($row[$table_name]),
+ 'COLUMN_NAME' => $this->foldCase($row[$column_name]),
+ 'COLUMN_POSITION' => $row[$column_id],
+ 'DATA_TYPE' => $row[$data_type],
+ 'DEFAULT' => $row[$data_default],
+ 'NULLABLE' => (bool) ($row[$nullable] == 'Y'),
+ 'LENGTH' => $row[$data_length],
+ 'SCALE' => $row[$data_scale],
+ 'PRECISION' => $row[$data_precision],
+ 'UNSIGNED' => null, // @todo
+ 'PRIMARY' => $primary,
+ 'PRIMARY_POSITION' => $primaryPosition,
+ 'IDENTITY' => $identity
+ );
+ }
+ return $desc;
+ }
+
+ /**
+ * Leave autocommit mode and begin a transaction.
+ *
+ * @return void
+ */
+ protected function _beginTransaction()
+ {
+ $this->_setExecuteMode(OCI_DEFAULT);
+ }
+
+ /**
+ * Commit a transaction and return to autocommit mode.
+ *
+ * @return void
+ * @throws Zend_Db_Adapter_Oracle_Exception
+ */
+ protected function _commit()
+ {
+ if (!oci_commit($this->_connection)) {
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Adapter_Oracle_Exception(oci_error($this->_connection));
+ }
+ $this->_setExecuteMode(OCI_COMMIT_ON_SUCCESS);
+ }
+
+ /**
+ * Roll back a transaction and return to autocommit mode.
+ *
+ * @return void
+ * @throws Zend_Db_Adapter_Oracle_Exception
+ */
+ protected function _rollBack()
+ {
+ if (!oci_rollback($this->_connection)) {
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Adapter_Oracle_Exception(oci_error($this->_connection));
+ }
+ $this->_setExecuteMode(OCI_COMMIT_ON_SUCCESS);
+ }
+
+ /**
+ * Set the fetch mode.
+ *
+ * @todo Support FETCH_CLASS and FETCH_INTO.
+ *
+ * @param integer $mode A fetch mode.
+ * @return void
+ * @throws Zend_Db_Adapter_Oracle_Exception
+ */
+ public function setFetchMode($mode)
+ {
+ switch ($mode) {
+ case Zend_Db::FETCH_NUM: // seq array
+ case Zend_Db::FETCH_ASSOC: // assoc array
+ case Zend_Db::FETCH_BOTH: // seq+assoc array
+ case Zend_Db::FETCH_OBJ: // object
+ $this->_fetchMode = $mode;
+ break;
+ case Zend_Db::FETCH_BOUND: // bound to PHP variable
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Adapter_Oracle_Exception('FETCH_BOUND is not supported yet');
+ break;
+ default:
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Adapter_Oracle_Exception("Invalid fetch mode '$mode' specified");
+ break;
+ }
+ }
+
+ /**
+ * Adds an adapter-specific LIMIT clause to the SELECT statement.
+ *
+ * @param string $sql
+ * @param integer $count
+ * @param integer $offset OPTIONAL
+ * @return string
+ * @throws Zend_Db_Adapter_Oracle_Exception
+ */
+ public function limit($sql, $count, $offset = 0)
+ {
+ $count = intval($count);
+ if ($count <= 0) {
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Adapter_Oracle_Exception("LIMIT argument count=$count is not valid");
+ }
+
+ $offset = intval($offset);
+ if ($offset < 0) {
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Adapter_Oracle_Exception("LIMIT argument offset=$offset is not valid");
+ }
+
+ /**
+ * Oracle does not implement the LIMIT clause as some RDBMS do.
+ * We have to simulate it with subqueries and ROWNUM.
+ * Unfortunately because we use the column wildcard "*",
+ * this puts an extra column into the query result set.
+ */
+ $limit_sql = "SELECT z2.*
+ FROM (
+ SELECT z1.*, ROWNUM AS \"zend_db_rownum\"
+ FROM (
+ " . $sql . "
+ ) z1
+ ) z2
+ WHERE z2.\"zend_db_rownum\" BETWEEN " . ($offset+1) . " AND " . ($offset+$count);
+ return $limit_sql;
+ }
+
+ /**
+ * @param integer $mode
+ * @throws Zend_Db_Adapter_Oracle_Exception
+ */
+ private function _setExecuteMode($mode)
+ {
+ switch($mode) {
+ case OCI_COMMIT_ON_SUCCESS:
+ case OCI_DEFAULT:
+ case OCI_DESCRIBE_ONLY:
+ $this->_execute_mode = $mode;
+ break;
+ default:
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Adapter_Oracle_Exception("Invalid execution mode '$mode' specified");
+ break;
+ }
+ }
+
+ /**
+ * @return int
+ */
+ public function _getExecuteMode()
+ {
+ return $this->_execute_mode;
+ }
+
+ /**
+ * Check if the adapter supports real SQL parameters.
+ *
+ * @param string $type 'positional' or 'named'
+ * @return bool
+ */
+ public function supportsParameters($type)
+ {
+ switch ($type) {
+ case 'named':
+ return true;
+ case 'positional':
+ default:
+ return false;
+ }
+ }
+
+ /**
+ * Retrieve server version in PHP style
+ *
+ * @return string
+ */
+ public function getServerVersion()
+ {
+ $this->_connect();
+ $version = oci_server_version($this->_connection);
+ if ($version !== false) {
+ $matches = null;
+ if (preg_match('/((?:[0-9]{1,2}\.){1,3}[0-9]{1,2})/', $version, $matches)) {
+ return $matches[1];
+ } else {
+ return null;
+ }
+ } else {
+ return null;
+ }
+ }
+}
diff --git a/library/vendor/Zend/Db/Adapter/Oracle/Exception.php b/library/vendor/Zend/Db/Adapter/Oracle/Exception.php
new file mode 100644
index 0000000..6b7d914
--- /dev/null
+++ b/library/vendor/Zend/Db/Adapter/Oracle/Exception.php
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Db_Adapter_Exception
+ */
+
+/**
+ * Zend_Db_Adapter_Oracle_Exception
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Adapter_Oracle_Exception extends Zend_Db_Adapter_Exception
+{
+ protected $message = 'Unknown exception';
+ protected $code = 0;
+
+ function __construct($error = null, $code = 0) {
+ if (is_array($error)) {
+ if (!isset($error['offset'])) {
+ $this->message = $error['code'] .' '. $error['message'];
+ } else {
+ $this->message = $error['code'] .' '. $error['message']." "
+ . substr($error['sqltext'], 0, $error['offset'])
+ . "*"
+ . substr($error['sqltext'], $error['offset']);
+ }
+ $this->code = $error['code'];
+ } else if (is_string($error)) {
+ $this->message = $error;
+ }
+ if (!$this->code && $code) {
+ $this->code = $code;
+ }
+ }
+}
diff --git a/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php b/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php
new file mode 100644
index 0000000..3a0e13e
--- /dev/null
+++ b/library/vendor/Zend/Db/Adapter/Pdo/Abstract.php
@@ -0,0 +1,397 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Db_Adapter_Abstract
+ */
+
+
+/**
+ * @see Zend_Db_Statement_Pdo
+ */
+
+
+/**
+ * Class for connecting to SQL databases and performing common operations using PDO.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Db_Adapter_Pdo_Abstract extends Zend_Db_Adapter_Abstract
+{
+
+ /**
+ * Default class name for a DB statement.
+ *
+ * @var string
+ */
+ protected $_defaultStmtClass = 'Zend_Db_Statement_Pdo';
+
+ /**
+ * Creates a PDO DSN for the adapter from $this->_config settings.
+ *
+ * @return string
+ */
+ protected function _dsn()
+ {
+ // baseline of DSN parts
+ $dsn = $this->_config;
+
+ // don't pass the username, password, charset, persistent and driver_options in the DSN
+ unset($dsn['username']);
+ unset($dsn['password']);
+ unset($dsn['options']);
+ unset($dsn['charset']);
+ unset($dsn['persistent']);
+ unset($dsn['driver_options']);
+
+ // use all remaining parts in the DSN
+ foreach ($dsn as $key => $val) {
+ $dsn[$key] = "$key=$val";
+ }
+
+ return $this->_pdoType . ':' . implode(';', $dsn);
+ }
+
+ /**
+ * Creates a PDO object and connects to the database.
+ *
+ * @return void
+ * @throws Zend_Db_Adapter_Exception
+ */
+ protected function _connect()
+ {
+ // if we already have a PDO object, no need to re-connect.
+ if ($this->_connection) {
+ return;
+ }
+
+ // get the dsn first, because some adapters alter the $_pdoType
+ $dsn = $this->_dsn();
+
+ // check for PDO extension
+ if (!extension_loaded('pdo')) {
+ /**
+ * @see Zend_Db_Adapter_Exception
+ */
+ throw new Zend_Db_Adapter_Exception('The PDO extension is required for this adapter but the extension is not loaded');
+ }
+
+ // check the PDO driver is available
+ if (!in_array($this->_pdoType, PDO::getAvailableDrivers())) {
+ /**
+ * @see Zend_Db_Adapter_Exception
+ */
+ throw new Zend_Db_Adapter_Exception('The ' . $this->_pdoType . ' driver is not currently installed');
+ }
+
+ // create PDO connection
+ $q = $this->_profiler->queryStart('connect', Zend_Db_Profiler::CONNECT);
+
+ // add the persistence flag if we find it in our config array
+ if (isset($this->_config['persistent']) && ($this->_config['persistent'] == true)) {
+ $this->_config['driver_options'][PDO::ATTR_PERSISTENT] = true;
+ }
+
+ try {
+ $this->_connection = new PDO(
+ $dsn,
+ $this->_config['username'],
+ $this->_config['password'],
+ $this->_config['driver_options']
+ );
+
+ $this->_profiler->queryEnd($q);
+
+ // set the PDO connection to perform case-folding on array keys, or not
+ $this->_connection->setAttribute(PDO::ATTR_CASE, $this->_caseFolding);
+
+ // always use exceptions.
+ $this->_connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+
+ } catch (PDOException $e) {
+ $message = $e->getMessage();
+ if ($e->getPrevious() !== null && preg_match('~^SQLSTATE\[HY000\] \[\d{1,4}\]\s$~', $message)) {
+ // See https://bugs.php.net/bug.php?id=76604
+ $message .= $e->getPrevious()->getMessage();
+ }
+
+ /**
+ * @see Zend_Db_Adapter_Exception
+ */
+ throw new Zend_Db_Adapter_Exception($message, $e->getCode(), $e);
+ }
+
+ }
+
+ /**
+ * Test if a connection is active
+ *
+ * @return boolean
+ */
+ public function isConnected()
+ {
+ return ((bool) ($this->_connection instanceof PDO));
+ }
+
+ /**
+ * Force the connection to close.
+ *
+ * @return void
+ */
+ public function closeConnection()
+ {
+ $this->_connection = null;
+ }
+
+ /**
+ * Prepares an SQL statement.
+ *
+ * @param string $sql The SQL statement with placeholders.
+ * @param array $bind An array of data to bind to the placeholders.
+ * @return PDOStatement
+ */
+ public function prepare($sql)
+ {
+ $this->_connect();
+ $stmtClass = $this->_defaultStmtClass;
+ if (!class_exists($stmtClass)) {
+ Zend_Loader::loadClass($stmtClass);
+ }
+ $stmt = new $stmtClass($this, $sql);
+ $stmt->setFetchMode($this->_fetchMode);
+ return $stmt;
+ }
+
+ /**
+ * Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.
+ *
+ * As a convention, on RDBMS brands that support sequences
+ * (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence
+ * from the arguments and returns the last id generated by that sequence.
+ * On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method
+ * returns the last value generated for such a column, and the table name
+ * argument is disregarded.
+ *
+ * On RDBMS brands that don't support sequences, $tableName and $primaryKey
+ * are ignored.
+ *
+ * @param string $tableName OPTIONAL Name of table.
+ * @param string $primaryKey OPTIONAL Name of primary key column.
+ * @return string
+ */
+ public function lastInsertId($tableName = null, $primaryKey = null)
+ {
+ $this->_connect();
+ return $this->_connection->lastInsertId();
+ }
+
+ /**
+ * Special handling for PDO query().
+ * All bind parameter names must begin with ':'
+ *
+ * @param string|Zend_Db_Select $sql The SQL statement with placeholders.
+ * @param array $bind An array of data to bind to the placeholders.
+ * @return Zend_Db_Statement_Pdo
+ * @throws Zend_Db_Adapter_Exception To re-throw PDOException.
+ */
+ public function query($sql, $bind = array())
+ {
+ if (empty($bind) && $sql instanceof Zend_Db_Select) {
+ $bind = $sql->getBind();
+ }
+
+ if (is_array($bind)) {
+ foreach ($bind as $name => $value) {
+ if (!is_int($name) && !preg_match('/^:/', $name)) {
+ $newName = ":$name";
+ unset($bind[$name]);
+ $bind[$newName] = $value;
+ }
+ }
+ }
+
+ try {
+ return parent::query($sql, $bind);
+ } catch (PDOException $e) {
+ /**
+ * @see Zend_Db_Statement_Exception
+ */
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Executes an SQL statement and return the number of affected rows
+ *
+ * @param mixed $sql The SQL statement with placeholders.
+ * May be a string or Zend_Db_Select.
+ * @return integer Number of rows that were modified
+ * or deleted by the SQL statement
+ */
+ public function exec($sql)
+ {
+ if ($sql instanceof Zend_Db_Select) {
+ $sql = $sql->assemble();
+ }
+
+ try {
+ $affected = $this->getConnection()->exec($sql);
+
+ if ($affected === false) {
+ $errorInfo = $this->getConnection()->errorInfo();
+ /**
+ * @see Zend_Db_Adapter_Exception
+ */
+ throw new Zend_Db_Adapter_Exception($errorInfo[2]);
+ }
+
+ return $affected;
+ } catch (PDOException $e) {
+ /**
+ * @see Zend_Db_Adapter_Exception
+ */
+ throw new Zend_Db_Adapter_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Quote a raw string.
+ *
+ * @param string $value Raw string
+ * @return string Quoted string
+ */
+ protected function _quote($value)
+ {
+ if ($value === null) {
+ $value = '';
+ } elseif (is_int($value) || is_float($value)) {
+ return $value;
+ }
+ $this->_connect();
+ return $this->_connection->quote($value);
+ }
+
+ /**
+ * Begin a transaction.
+ */
+ protected function _beginTransaction()
+ {
+ $this->_connect();
+ $this->_connection->beginTransaction();
+ }
+
+ /**
+ * Commit a transaction.
+ */
+ protected function _commit()
+ {
+ $this->_connect();
+ $this->_connection->commit();
+ }
+
+ /**
+ * Roll-back a transaction.
+ */
+ protected function _rollBack() {
+ $this->_connect();
+ $this->_connection->rollBack();
+ }
+
+ /**
+ * Set the PDO fetch mode.
+ *
+ * @todo Support FETCH_CLASS and FETCH_INTO.
+ *
+ * @param int $mode A PDO fetch mode.
+ * @return void
+ * @throws Zend_Db_Adapter_Exception
+ */
+ public function setFetchMode($mode)
+ {
+ //check for PDO extension
+ if (!extension_loaded('pdo')) {
+ /**
+ * @see Zend_Db_Adapter_Exception
+ */
+ throw new Zend_Db_Adapter_Exception('The PDO extension is required for this adapter but the extension is not loaded');
+ }
+ switch ($mode) {
+ case PDO::FETCH_LAZY:
+ case PDO::FETCH_ASSOC:
+ case PDO::FETCH_NUM:
+ case PDO::FETCH_BOTH:
+ case PDO::FETCH_NAMED:
+ case PDO::FETCH_OBJ:
+ $this->_fetchMode = $mode;
+ break;
+ default:
+ /**
+ * @see Zend_Db_Adapter_Exception
+ */
+ throw new Zend_Db_Adapter_Exception("Invalid fetch mode '$mode' specified");
+ break;
+ }
+ }
+
+ /**
+ * Check if the adapter supports real SQL parameters.
+ *
+ * @param string $type 'positional' or 'named'
+ * @return bool
+ */
+ public function supportsParameters($type)
+ {
+ switch ($type) {
+ case 'positional':
+ case 'named':
+ default:
+ return true;
+ }
+ }
+
+ /**
+ * Retrieve server version in PHP style
+ *
+ * @return string
+ */
+ public function getServerVersion()
+ {
+ $this->_connect();
+ try {
+ $version = $this->_connection->getAttribute(PDO::ATTR_SERVER_VERSION);
+ } catch (PDOException $e) {
+ // In case of the driver doesn't support getting attributes
+ return null;
+ }
+ $matches = null;
+ if (preg_match('/((?:[0-9]{1,2}\.){1,3}[0-9]{1,2})/', $version, $matches)) {
+ return $matches[1];
+ } else {
+ return null;
+ }
+ }
+}
diff --git a/library/vendor/Zend/Db/Adapter/Pdo/Ibm.php b/library/vendor/Zend/Db/Adapter/Pdo/Ibm.php
new file mode 100644
index 0000000..cfb11a3
--- /dev/null
+++ b/library/vendor/Zend/Db/Adapter/Pdo/Ibm.php
@@ -0,0 +1,354 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/** @see Zend_Db_Adapter_Pdo_Abstract */
+
+/** @see Zend_Db_Abstract_Pdo_Ibm_Db2 */
+
+/** @see Zend_Db_Abstract_Pdo_Ibm_Ids */
+
+/** @see Zend_Db_Statement_Pdo_Ibm */
+
+
+/**
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Adapter_Pdo_Ibm extends Zend_Db_Adapter_Pdo_Abstract
+{
+ /**
+ * PDO type.
+ *
+ * @var string
+ */
+ protected $_pdoType = 'ibm';
+
+ /**
+ * The IBM data server connected to
+ *
+ * @var string
+ */
+ protected $_serverType = null;
+
+ /**
+ * Keys are UPPERCASE SQL datatypes or the constants
+ * Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE, or Zend_Db::FLOAT_TYPE.
+ *
+ * Values are:
+ * 0 = 32-bit integer
+ * 1 = 64-bit integer
+ * 2 = float or decimal
+ *
+ * @var array Associative array of datatypes to values 0, 1, or 2.
+ */
+ protected $_numericDataTypes = array(
+ Zend_Db::INT_TYPE => Zend_Db::INT_TYPE,
+ Zend_Db::BIGINT_TYPE => Zend_Db::BIGINT_TYPE,
+ Zend_Db::FLOAT_TYPE => Zend_Db::FLOAT_TYPE,
+ 'INTEGER' => Zend_Db::INT_TYPE,
+ 'SMALLINT' => Zend_Db::INT_TYPE,
+ 'BIGINT' => Zend_Db::BIGINT_TYPE,
+ 'DECIMAL' => Zend_Db::FLOAT_TYPE,
+ 'DEC' => Zend_Db::FLOAT_TYPE,
+ 'REAL' => Zend_Db::FLOAT_TYPE,
+ 'NUMERIC' => Zend_Db::FLOAT_TYPE,
+ 'DOUBLE PRECISION' => Zend_Db::FLOAT_TYPE,
+ 'FLOAT' => Zend_Db::FLOAT_TYPE
+ );
+
+ /**
+ * Creates a PDO object and connects to the database.
+ *
+ * The IBM data server is set.
+ * Current options are DB2 or IDS
+ * @todo also differentiate between z/OS and i/5
+ *
+ * @return void
+ * @throws Zend_Db_Adapter_Exception
+ */
+ public function _connect()
+ {
+ if ($this->_connection) {
+ return;
+ }
+ parent::_connect();
+
+ $this->getConnection()->setAttribute(Zend_Db::ATTR_STRINGIFY_FETCHES, true);
+
+ try {
+ if ($this->_serverType === null) {
+ $server = substr($this->getConnection()->getAttribute(PDO::ATTR_SERVER_INFO), 0, 3);
+
+ switch ($server) {
+ case 'DB2':
+ $this->_serverType = new Zend_Db_Adapter_Pdo_Ibm_Db2($this);
+
+ // Add DB2-specific numeric types
+ $this->_numericDataTypes['DECFLOAT'] = Zend_Db::FLOAT_TYPE;
+ $this->_numericDataTypes['DOUBLE'] = Zend_Db::FLOAT_TYPE;
+ $this->_numericDataTypes['NUM'] = Zend_Db::FLOAT_TYPE;
+
+ break;
+ case 'IDS':
+ $this->_serverType = new Zend_Db_Adapter_Pdo_Ibm_Ids($this);
+
+ // Add IDS-specific numeric types
+ $this->_numericDataTypes['SERIAL'] = Zend_Db::INT_TYPE;
+ $this->_numericDataTypes['SERIAL8'] = Zend_Db::BIGINT_TYPE;
+ $this->_numericDataTypes['INT8'] = Zend_Db::BIGINT_TYPE;
+ $this->_numericDataTypes['SMALLFLOAT'] = Zend_Db::FLOAT_TYPE;
+ $this->_numericDataTypes['MONEY'] = Zend_Db::FLOAT_TYPE;
+
+ break;
+ }
+ }
+ } catch (PDOException $e) {
+ /** @see Zend_Db_Adapter_Exception */
+ $error = strpos($e->getMessage(), 'driver does not support that attribute');
+ if ($error) {
+ throw new Zend_Db_Adapter_Exception("PDO_IBM driver extension is downlevel. Please use driver release version 1.2.1 or later", 0, $e);
+ } else {
+ throw new Zend_Db_Adapter_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+ }
+
+ /**
+ * Creates a PDO DSN for the adapter from $this->_config settings.
+ *
+ * @return string
+ */
+ protected function _dsn()
+ {
+ $this->_checkRequiredOptions($this->_config);
+
+ // check if using full connection string
+ if (array_key_exists('host', $this->_config)) {
+ $dsn = ';DATABASE=' . $this->_config['dbname']
+ . ';HOSTNAME=' . $this->_config['host']
+ . ';PORT=' . $this->_config['port']
+ // PDO_IBM supports only DB2 TCPIP protocol
+ . ';PROTOCOL=' . 'TCPIP;';
+ } else {
+ // catalogued connection
+ $dsn = $this->_config['dbname'];
+ }
+ return $this->_pdoType . ': ' . $dsn;
+ }
+
+ /**
+ * Checks required options
+ *
+ * @param array $config
+ * @throws Zend_Db_Adapter_Exception
+ * @return void
+ */
+ protected function _checkRequiredOptions(array $config)
+ {
+ parent::_checkRequiredOptions($config);
+
+ if (array_key_exists('host', $this->_config) &&
+ !array_key_exists('port', $config)) {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception("Configuration must have a key for 'port' when 'host' is specified");
+ }
+ }
+
+ /**
+ * Prepares an SQL statement.
+ *
+ * @param string $sql The SQL statement with placeholders.
+ * @param array $bind An array of data to bind to the placeholders.
+ * @return PDOStatement
+ */
+ public function prepare($sql)
+ {
+ $this->_connect();
+ $stmtClass = $this->_defaultStmtClass;
+ $stmt = new $stmtClass($this, $sql);
+ $stmt->setFetchMode($this->_fetchMode);
+ return $stmt;
+ }
+
+ /**
+ * Returns a list of the tables in the database.
+ *
+ * @return array
+ */
+ public function listTables()
+ {
+ $this->_connect();
+ return $this->_serverType->listTables();
+ }
+
+ /**
+ * Returns the column descriptions for a table.
+ *
+ * The return value is an associative array keyed by the column name,
+ * as returned by the RDBMS.
+ *
+ * The value of each array element is an associative array
+ * with the following keys:
+ *
+ * SCHEMA_NAME => string; name of database or schema
+ * TABLE_NAME => string;
+ * COLUMN_NAME => string; column name
+ * COLUMN_POSITION => number; ordinal position of column in table
+ * DATA_TYPE => string; SQL datatype name of column
+ * DEFAULT => string; default expression of column, null if none
+ * NULLABLE => boolean; true if column can have nulls
+ * LENGTH => number; length of CHAR/VARCHAR
+ * SCALE => number; scale of NUMERIC/DECIMAL
+ * PRECISION => number; precision of NUMERIC/DECIMAL
+ * UNSIGNED => boolean; unsigned property of an integer type
+ * PRIMARY => boolean; true if column is part of the primary key
+ * PRIMARY_POSITION => integer; position of column in primary key
+ *
+ * @todo Discover integer unsigned property.
+ *
+ * @param string $tableName
+ * @param string $schemaName OPTIONAL
+ * @return array
+ */
+ public function describeTable($tableName, $schemaName = null)
+ {
+ $this->_connect();
+ return $this->_serverType->describeTable($tableName, $schemaName);
+ }
+
+ /**
+ * Inserts a table row with specified data.
+ * Special handling for PDO_IBM
+ * remove empty slots
+ *
+ * @param mixed $table The table to insert data into.
+ * @param array $bind Column-value pairs.
+ * @return int The number of affected rows.
+ */
+ public function insert($table, array $bind)
+ {
+ $this->_connect();
+ $newbind = array();
+ if (is_array($bind)) {
+ foreach ($bind as $name => $value) {
+ if($value !== null) {
+ $newbind[$name] = $value;
+ }
+ }
+ }
+
+ return parent::insert($table, $newbind);
+ }
+
+ /**
+ * Adds an adapter-specific LIMIT clause to the SELECT statement.
+ *
+ * @param string $sql
+ * @param integer $count
+ * @param integer $offset OPTIONAL
+ * @return string
+ */
+ public function limit($sql, $count, $offset = 0)
+ {
+ $this->_connect();
+ return $this->_serverType->limit($sql, $count, $offset);
+ }
+
+ /**
+ * Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT
+ * column.
+ *
+ * @param string $tableName OPTIONAL
+ * @param string $primaryKey OPTIONAL
+ * @return integer
+ */
+ public function lastInsertId($tableName = null, $primaryKey = null)
+ {
+ $this->_connect();
+
+ if ($tableName !== null) {
+ $sequenceName = $tableName;
+ if ($primaryKey) {
+ $sequenceName .= "_$primaryKey";
+ }
+ $sequenceName .= '_seq';
+ return $this->lastSequenceId($sequenceName);
+ }
+
+ $id = $this->getConnection()->lastInsertId();
+
+ return $id;
+ }
+
+ /**
+ * Return the most recent value from the specified sequence in the database.
+ *
+ * @param string $sequenceName
+ * @return integer
+ */
+ public function lastSequenceId($sequenceName)
+ {
+ $this->_connect();
+ return $this->_serverType->lastSequenceId($sequenceName);
+ }
+
+ /**
+ * Generate a new value from the specified sequence in the database,
+ * and return it.
+ *
+ * @param string $sequenceName
+ * @return integer
+ */
+ public function nextSequenceId($sequenceName)
+ {
+ $this->_connect();
+ return $this->_serverType->nextSequenceId($sequenceName);
+ }
+
+ /**
+ * Retrieve server version in PHP style
+ * Pdo_Idm doesn't support getAttribute(PDO::ATTR_SERVER_VERSION)
+ * @return string
+ */
+ public function getServerVersion()
+ {
+ try {
+ $stmt = $this->query('SELECT service_level, fixpack_num FROM TABLE (sysproc.env_get_inst_info()) as INSTANCEINFO');
+ $result = $stmt->fetchAll(Zend_Db::FETCH_NUM);
+ if (count($result)) {
+ $matches = null;
+ if (preg_match('/((?:[0-9]{1,2}\.){1,3}[0-9]{1,2})/', $result[0][0], $matches)) {
+ return $matches[1];
+ } else {
+ return null;
+ }
+ }
+ return null;
+ } catch (PDOException $e) {
+ return null;
+ }
+ }
+}
diff --git a/library/vendor/Zend/Db/Adapter/Pdo/Ibm/Db2.php b/library/vendor/Zend/Db/Adapter/Pdo/Ibm/Db2.php
new file mode 100644
index 0000000..1c11c8b
--- /dev/null
+++ b/library/vendor/Zend/Db/Adapter/Pdo/Ibm/Db2.php
@@ -0,0 +1,224 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/** @see Zend_Db_Adapter_Pdo_Ibm */
+
+/** @see Zend_Db_Statement_Pdo_Ibm */
+
+
+/**
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Adapter_Pdo_Ibm_Db2
+{
+ /**
+ * @var Zend_Db_Adapter_Abstract
+ */
+ protected $_adapter = null;
+
+ /**
+ * Construct the data server class.
+ *
+ * It will be used to generate non-generic SQL
+ * for a particular data server
+ *
+ * @param Zend_Db_Adapter_Abstract $adapter
+ */
+ public function __construct($adapter)
+ {
+ $this->_adapter = $adapter;
+ }
+
+ /**
+ * Returns a list of the tables in the database.
+ *
+ * @return array
+ */
+ public function listTables()
+ {
+ $sql = "SELECT tabname "
+ . "FROM SYSCAT.TABLES ";
+ return $this->_adapter->fetchCol($sql);
+ }
+
+ /**
+ * DB2 catalog lookup for describe table
+ *
+ * @param string $tableName
+ * @param string $schemaName OPTIONAL
+ * @return array
+ */
+ public function describeTable($tableName, $schemaName = null)
+ {
+ $sql = "SELECT DISTINCT c.tabschema, c.tabname, c.colname, c.colno,
+ c.typename, c.default, c.nulls, c.length, c.scale,
+ c.identity, tc.type AS tabconsttype, k.colseq
+ FROM syscat.columns c
+ LEFT JOIN (syscat.keycoluse k JOIN syscat.tabconst tc
+ ON (k.tabschema = tc.tabschema
+ AND k.tabname = tc.tabname
+ AND tc.type = 'P'))
+ ON (c.tabschema = k.tabschema
+ AND c.tabname = k.tabname
+ AND c.colname = k.colname)
+ WHERE "
+ . $this->_adapter->quoteInto('UPPER(c.tabname) = UPPER(?)', $tableName);
+ if ($schemaName) {
+ $sql .= $this->_adapter->quoteInto(' AND UPPER(c.tabschema) = UPPER(?)', $schemaName);
+ }
+ $sql .= " ORDER BY c.colno";
+
+ $desc = array();
+ $stmt = $this->_adapter->query($sql);
+
+ /**
+ * To avoid case issues, fetch using FETCH_NUM
+ */
+ $result = $stmt->fetchAll(Zend_Db::FETCH_NUM);
+
+ /**
+ * The ordering of columns is defined by the query so we can map
+ * to variables to improve readability
+ */
+ $tabschema = 0;
+ $tabname = 1;
+ $colname = 2;
+ $colno = 3;
+ $typename = 4;
+ $default = 5;
+ $nulls = 6;
+ $length = 7;
+ $scale = 8;
+ $identityCol = 9;
+ $tabconstype = 10;
+ $colseq = 11;
+
+ foreach ($result as $key => $row) {
+ list ($primary, $primaryPosition, $identity) = array(false, null, false);
+ if ($row[$tabconstype] == 'P') {
+ $primary = true;
+ $primaryPosition = $row[$colseq];
+ }
+ /**
+ * In IBM DB2, an column can be IDENTITY
+ * even if it is not part of the PRIMARY KEY.
+ */
+ if ($row[$identityCol] == 'Y') {
+ $identity = true;
+ }
+
+ $desc[$this->_adapter->foldCase($row[$colname])] = array(
+ 'SCHEMA_NAME' => $this->_adapter->foldCase($row[$tabschema]),
+ 'TABLE_NAME' => $this->_adapter->foldCase($row[$tabname]),
+ 'COLUMN_NAME' => $this->_adapter->foldCase($row[$colname]),
+ 'COLUMN_POSITION' => $row[$colno]+1,
+ 'DATA_TYPE' => $row[$typename],
+ 'DEFAULT' => $row[$default],
+ 'NULLABLE' => (bool) ($row[$nulls] == 'Y'),
+ 'LENGTH' => $row[$length],
+ 'SCALE' => $row[$scale],
+ 'PRECISION' => ($row[$typename] == 'DECIMAL' ? $row[$length] : 0),
+ 'UNSIGNED' => false,
+ 'PRIMARY' => $primary,
+ 'PRIMARY_POSITION' => $primaryPosition,
+ 'IDENTITY' => $identity
+ );
+ }
+
+ return $desc;
+ }
+
+ /**
+ * Adds a DB2-specific LIMIT clause to the SELECT statement.
+ *
+ * @param string $sql
+ * @param integer $count
+ * @param integer $offset OPTIONAL
+ * @throws Zend_Db_Adapter_Exception
+ * @return string
+ */
+ public function limit($sql, $count, $offset = 0)
+ {
+ $count = intval($count);
+ if ($count < 0) {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception("LIMIT argument count=$count is not valid");
+ } else {
+ $offset = intval($offset);
+ if ($offset < 0) {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception("LIMIT argument offset=$offset is not valid");
+ }
+
+ if ($offset == 0 && $count > 0) {
+ $limit_sql = $sql . " FETCH FIRST $count ROWS ONLY";
+ return $limit_sql;
+ }
+ /**
+ * DB2 does not implement the LIMIT clause as some RDBMS do.
+ * We have to simulate it with subqueries and ROWNUM.
+ * Unfortunately because we use the column wildcard "*",
+ * this puts an extra column into the query result set.
+ */
+ $limit_sql = "SELECT z2.*
+ FROM (
+ SELECT ROW_NUMBER() OVER() AS \"ZEND_DB_ROWNUM\", z1.*
+ FROM (
+ " . $sql . "
+ ) z1
+ ) z2
+ WHERE z2.zend_db_rownum BETWEEN " . ($offset+1) . " AND " . ($offset+$count);
+ }
+ return $limit_sql;
+ }
+
+ /**
+ * DB2-specific last sequence id
+ *
+ * @param string $sequenceName
+ * @return integer
+ */
+ public function lastSequenceId($sequenceName)
+ {
+ $sql = 'SELECT PREVVAL FOR '.$this->_adapter->quoteIdentifier($sequenceName).' AS VAL FROM SYSIBM.SYSDUMMY1';
+ $value = $this->_adapter->fetchOne($sql);
+ return $value;
+ }
+
+ /**
+ * DB2-specific sequence id value
+ *
+ * @param string $sequenceName
+ * @return integer
+ */
+ public function nextSequenceId($sequenceName)
+ {
+ $sql = 'SELECT NEXTVAL FOR '.$this->_adapter->quoteIdentifier($sequenceName).' AS VAL FROM SYSIBM.SYSDUMMY1';
+ $value = $this->_adapter->fetchOne($sql);
+ return $value;
+ }
+}
diff --git a/library/vendor/Zend/Db/Adapter/Pdo/Ibm/Ids.php b/library/vendor/Zend/Db/Adapter/Pdo/Ibm/Ids.php
new file mode 100644
index 0000000..eeec43f
--- /dev/null
+++ b/library/vendor/Zend/Db/Adapter/Pdo/Ibm/Ids.php
@@ -0,0 +1,297 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/** @see Zend_Db_Adapter_Pdo_Ibm */
+
+/** @see Zend_Db_Statement_Pdo_Ibm */
+
+
+/**
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Adapter_Pdo_Ibm_Ids
+{
+ /**
+ * @var Zend_Db_Adapter_Abstract
+ */
+ protected $_adapter = null;
+
+ /**
+ * Construct the data server class.
+ *
+ * It will be used to generate non-generic SQL
+ * for a particular data server
+ *
+ * @param Zend_Db_Adapter_Abstract $adapter
+ */
+ public function __construct($adapter)
+ {
+ $this->_adapter = $adapter;
+ }
+
+ /**
+ * Returns a list of the tables in the database.
+ *
+ * @return array
+ */
+ public function listTables()
+ {
+ $sql = "SELECT tabname "
+ . "FROM systables ";
+
+ return $this->_adapter->fetchCol($sql);
+ }
+
+ /**
+ * IDS catalog lookup for describe table
+ *
+ * @param string $tableName
+ * @param string $schemaName OPTIONAL
+ * @return array
+ */
+ public function describeTable($tableName, $schemaName = null)
+ {
+ // this is still a work in progress
+
+ $sql= "SELECT DISTINCT t.owner, t.tabname, c.colname, c.colno, c.coltype,
+ d.default, c.collength, t.tabid
+ FROM syscolumns c
+ JOIN systables t ON c.tabid = t.tabid
+ LEFT JOIN sysdefaults d ON c.tabid = d.tabid AND c.colno = d.colno
+ WHERE "
+ . $this->_adapter->quoteInto('UPPER(t.tabname) = UPPER(?)', $tableName);
+ if ($schemaName) {
+ $sql .= $this->_adapter->quoteInto(' AND UPPER(t.owner) = UPPER(?)', $schemaName);
+ }
+ $sql .= " ORDER BY c.colno";
+
+ $desc = array();
+ $stmt = $this->_adapter->query($sql);
+
+ $result = $stmt->fetchAll(Zend_Db::FETCH_NUM);
+
+ /**
+ * The ordering of columns is defined by the query so we can map
+ * to variables to improve readability
+ */
+ $tabschema = 0;
+ $tabname = 1;
+ $colname = 2;
+ $colno = 3;
+ $typename = 4;
+ $default = 5;
+ $length = 6;
+ $tabid = 7;
+
+ $primaryCols = null;
+
+ foreach ($result as $key => $row) {
+ $primary = false;
+ $primaryPosition = null;
+
+ if (!$primaryCols) {
+ $primaryCols = $this->_getPrimaryInfo($row[$tabid]);
+ }
+
+ if (array_key_exists($row[$colno], $primaryCols)) {
+ $primary = true;
+ $primaryPosition = $primaryCols[$row[$colno]];
+ }
+
+ $identity = false;
+ if ($row[$typename] == 6 + 256 ||
+ $row[$typename] == 18 + 256) {
+ $identity = true;
+ }
+
+ $desc[$this->_adapter->foldCase($row[$colname])] = array (
+ 'SCHEMA_NAME' => $this->_adapter->foldCase($row[$tabschema]),
+ 'TABLE_NAME' => $this->_adapter->foldCase($row[$tabname]),
+ 'COLUMN_NAME' => $this->_adapter->foldCase($row[$colname]),
+ 'COLUMN_POSITION' => $row[$colno],
+ 'DATA_TYPE' => $this->_getDataType($row[$typename]),
+ 'DEFAULT' => $row[$default],
+ 'NULLABLE' => (bool) !($row[$typename] - 256 >= 0),
+ 'LENGTH' => $row[$length],
+ 'SCALE' => ($row[$typename] == 5 ? $row[$length]&255 : 0),
+ 'PRECISION' => ($row[$typename] == 5 ? (int)($row[$length]/256) : 0),
+ 'UNSIGNED' => false,
+ 'PRIMARY' => $primary,
+ 'PRIMARY_POSITION' => $primaryPosition,
+ 'IDENTITY' => $identity
+ );
+ }
+
+ return $desc;
+ }
+
+ /**
+ * Map number representation of a data type
+ * to a string
+ *
+ * @param int $typeNo
+ * @return string
+ */
+ protected function _getDataType($typeNo)
+ {
+ $typemap = array(
+ 0 => "CHAR",
+ 1 => "SMALLINT",
+ 2 => "INTEGER",
+ 3 => "FLOAT",
+ 4 => "SMALLFLOAT",
+ 5 => "DECIMAL",
+ 6 => "SERIAL",
+ 7 => "DATE",
+ 8 => "MONEY",
+ 9 => "NULL",
+ 10 => "DATETIME",
+ 11 => "BYTE",
+ 12 => "TEXT",
+ 13 => "VARCHAR",
+ 14 => "INTERVAL",
+ 15 => "NCHAR",
+ 16 => "NVARCHAR",
+ 17 => "INT8",
+ 18 => "SERIAL8",
+ 19 => "SET",
+ 20 => "MULTISET",
+ 21 => "LIST",
+ 22 => "Unnamed ROW",
+ 40 => "Variable-length opaque type",
+ 4118 => "Named ROW"
+ );
+
+ if ($typeNo - 256 >= 0) {
+ $typeNo = $typeNo - 256;
+ }
+
+ return $typemap[$typeNo];
+ }
+
+ /**
+ * Helper method to retrieve primary key column
+ * and column location
+ *
+ * @param int $tabid
+ * @return array
+ */
+ protected function _getPrimaryInfo($tabid)
+ {
+ $sql = "SELECT i.part1, i.part2, i.part3, i.part4, i.part5, i.part6,
+ i.part7, i.part8, i.part9, i.part10, i.part11, i.part12,
+ i.part13, i.part14, i.part15, i.part16
+ FROM sysindexes i
+ JOIN sysconstraints c ON c.idxname = i.idxname
+ WHERE i.tabid = " . $tabid . " AND c.constrtype = 'P'";
+
+ $stmt = $this->_adapter->query($sql);
+ $results = $stmt->fetchAll();
+
+ $cols = array();
+
+ // this should return only 1 row
+ // unless there is no primary key,
+ // in which case, the empty array is returned
+ if ($results) {
+ $row = $results[0];
+ } else {
+ return $cols;
+ }
+
+ $position = 0;
+ foreach ($row as $key => $colno) {
+ $position++;
+ if ($colno == 0) {
+ return $cols;
+ } else {
+ $cols[$colno] = $position;
+ }
+ }
+ }
+
+ /**
+ * Adds an IDS-specific LIMIT clause to the SELECT statement.
+ *
+ * @param string $sql
+ * @param integer $count
+ * @param integer $offset OPTIONAL
+ * @throws Zend_Db_Adapter_Exception
+ * @return string
+ */
+ public function limit($sql, $count, $offset = 0)
+ {
+ $count = intval($count);
+ if ($count < 0) {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception("LIMIT argument count=$count is not valid");
+ } else if ($count == 0) {
+ $limit_sql = str_ireplace("SELECT", "SELECT * FROM (SELECT", $sql);
+ $limit_sql .= ") WHERE 0 = 1";
+ } else {
+ $offset = intval($offset);
+ if ($offset < 0) {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception("LIMIT argument offset=$offset is not valid");
+ }
+ if ($offset == 0) {
+ $limit_sql = str_ireplace("SELECT", "SELECT FIRST $count", $sql);
+ } else {
+ $limit_sql = str_ireplace("SELECT", "SELECT SKIP $offset LIMIT $count", $sql);
+ }
+ }
+ return $limit_sql;
+ }
+
+ /**
+ * IDS-specific last sequence id
+ *
+ * @param string $sequenceName
+ * @return integer
+ */
+ public function lastSequenceId($sequenceName)
+ {
+ $sql = 'SELECT '.$this->_adapter->quoteIdentifier($sequenceName).'.CURRVAL FROM '
+ .'systables WHERE tabid = 1';
+ $value = $this->_adapter->fetchOne($sql);
+ return $value;
+ }
+
+ /**
+ * IDS-specific sequence id value
+ *
+ * @param string $sequenceName
+ * @return integer
+ */
+ public function nextSequenceId($sequenceName)
+ {
+ $sql = 'SELECT '.$this->_adapter->quoteIdentifier($sequenceName).'.NEXTVAL FROM '
+ .'systables WHERE tabid = 1';
+ $value = $this->_adapter->fetchOne($sql);
+ return $value;
+ }
+}
diff --git a/library/vendor/Zend/Db/Adapter/Pdo/Mssql.php b/library/vendor/Zend/Db/Adapter/Pdo/Mssql.php
new file mode 100644
index 0000000..7c7c1cd
--- /dev/null
+++ b/library/vendor/Zend/Db/Adapter/Pdo/Mssql.php
@@ -0,0 +1,435 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Db_Adapter_Pdo_Abstract
+ */
+
+
+/**
+ * Class for connecting to Microsoft SQL Server databases and performing common operations.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Adapter_Pdo_Mssql extends Zend_Db_Adapter_Pdo_Abstract
+{
+ /**
+ * PDO type.
+ *
+ * @var string
+ */
+ protected $_pdoType = 'mssql';
+
+ /**
+ * Keys are UPPERCASE SQL datatypes or the constants
+ * Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE, or Zend_Db::FLOAT_TYPE.
+ *
+ * Values are:
+ * 0 = 32-bit integer
+ * 1 = 64-bit integer
+ * 2 = float or decimal
+ *
+ * @var array Associative array of datatypes to values 0, 1, or 2.
+ */
+ protected $_numericDataTypes = array(
+ Zend_Db::INT_TYPE => Zend_Db::INT_TYPE,
+ Zend_Db::BIGINT_TYPE => Zend_Db::BIGINT_TYPE,
+ Zend_Db::FLOAT_TYPE => Zend_Db::FLOAT_TYPE,
+ 'INT' => Zend_Db::INT_TYPE,
+ 'SMALLINT' => Zend_Db::INT_TYPE,
+ 'TINYINT' => Zend_Db::INT_TYPE,
+ 'BIGINT' => Zend_Db::BIGINT_TYPE,
+ 'DECIMAL' => Zend_Db::FLOAT_TYPE,
+ 'FLOAT' => Zend_Db::FLOAT_TYPE,
+ 'MONEY' => Zend_Db::FLOAT_TYPE,
+ 'NUMERIC' => Zend_Db::FLOAT_TYPE,
+ 'REAL' => Zend_Db::FLOAT_TYPE,
+ 'SMALLMONEY' => Zend_Db::FLOAT_TYPE
+ );
+
+ /**
+ * Creates a PDO DSN for the adapter from $this->_config settings.
+ *
+ * @return string
+ */
+ protected function _dsn()
+ {
+ // baseline of DSN parts
+ $dsn = $this->_config;
+
+ // don't pass the username and password in the DSN
+ unset($dsn['username']);
+ unset($dsn['password']);
+ unset($dsn['options']);
+ unset($dsn['persistent']);
+ unset($dsn['driver_options']);
+
+ if (isset($dsn['port'])) {
+ $seperator = ':';
+ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
+ $seperator = ',';
+ }
+ $dsn['host'] .= $seperator . $dsn['port'];
+ unset($dsn['port']);
+ }
+
+ // this driver supports multiple DSN prefixes
+ // @see http://www.php.net/manual/en/ref.pdo-dblib.connection.php
+ if (isset($dsn['pdoType'])) {
+ switch (strtolower($dsn['pdoType'])) {
+ case 'freetds':
+ case 'sybase':
+ $this->_pdoType = 'sybase';
+ break;
+ case 'mssql':
+ $this->_pdoType = 'mssql';
+ break;
+ case 'dblib':
+ default:
+ $this->_pdoType = 'dblib';
+ break;
+ }
+ unset($dsn['pdoType']);
+ }
+
+ // use all remaining parts in the DSN
+ foreach ($dsn as $key => $val) {
+ $dsn[$key] = "$key=$val";
+ }
+
+ $dsn = $this->_pdoType . ':' . implode(';', $dsn);
+ return $dsn;
+ }
+
+ /**
+ * @return void
+ */
+ protected function _connect()
+ {
+ if ($this->_connection) {
+ return;
+ }
+ parent::_connect();
+ $this->_connection->exec('SET QUOTED_IDENTIFIER ON');
+ }
+
+ /**
+ * Begin a transaction.
+ *
+ * It is necessary to override the abstract PDO transaction functions here, as
+ * the PDO driver for MSSQL does not support transactions.
+ */
+ protected function _beginTransaction()
+ {
+ $this->_connect();
+ $this->_connection->exec('BEGIN TRANSACTION');
+ return true;
+ }
+
+ /**
+ * Commit a transaction.
+ *
+ * It is necessary to override the abstract PDO transaction functions here, as
+ * the PDO driver for MSSQL does not support transactions.
+ */
+ protected function _commit()
+ {
+ $this->_connect();
+ $this->_connection->exec('COMMIT TRANSACTION');
+ return true;
+ }
+
+ /**
+ * Roll-back a transaction.
+ *
+ * It is necessary to override the abstract PDO transaction functions here, as
+ * the PDO driver for MSSQL does not support transactions.
+ */
+ protected function _rollBack() {
+ $this->_connect();
+ $this->_connection->exec('ROLLBACK TRANSACTION');
+ return true;
+ }
+
+ /**
+ * Returns a list of the tables in the database.
+ *
+ * @return array
+ */
+ public function listTables()
+ {
+ $sql = "SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name";
+ return $this->fetchCol($sql);
+ }
+
+ /**
+ * Returns the column descriptions for a table.
+ *
+ * The return value is an associative array keyed by the column name,
+ * as returned by the RDBMS.
+ *
+ * The value of each array element is an associative array
+ * with the following keys:
+ *
+ * SCHEMA_NAME => string; name of database or schema
+ * TABLE_NAME => string;
+ * COLUMN_NAME => string; column name
+ * COLUMN_POSITION => number; ordinal position of column in table
+ * DATA_TYPE => string; SQL datatype name of column
+ * DEFAULT => string; default expression of column, null if none
+ * NULLABLE => boolean; true if column can have nulls
+ * LENGTH => number; length of CHAR/VARCHAR
+ * SCALE => number; scale of NUMERIC/DECIMAL
+ * PRECISION => number; precision of NUMERIC/DECIMAL
+ * UNSIGNED => boolean; unsigned property of an integer type
+ * PRIMARY => boolean; true if column is part of the primary key
+ * PRIMARY_POSITION => integer; position of column in primary key
+ * PRIMARY_AUTO => integer; position of auto-generated column in primary key
+ *
+ * @todo Discover column primary key position.
+ * @todo Discover integer unsigned property.
+ *
+ * @param string $tableName
+ * @param string $schemaName OPTIONAL
+ * @return array
+ */
+ public function describeTable($tableName, $schemaName = null)
+ {
+ if ($schemaName != null) {
+ if (strpos($schemaName, '.') !== false) {
+ $result = explode('.', $schemaName);
+ $schemaName = $result[1];
+ }
+ }
+ /**
+ * Discover metadata information about this table.
+ */
+ $sql = "exec sp_columns @table_name = " . $this->quoteIdentifier($tableName, true);
+ if ($schemaName != null) {
+ $sql .= ", @table_owner = " . $this->quoteIdentifier($schemaName, true);
+ }
+
+ $stmt = $this->query($sql);
+ $result = $stmt->fetchAll(Zend_Db::FETCH_NUM);
+
+ $table_name = 2;
+ $column_name = 3;
+ $type_name = 5;
+ $precision = 6;
+ $length = 7;
+ $scale = 8;
+ $nullable = 10;
+ $column_def = 12;
+ $column_position = 16;
+
+ /**
+ * Discover primary key column(s) for this table.
+ */
+ $sql = "exec sp_pkeys @table_name = " . $this->quoteIdentifier($tableName, true);
+ if ($schemaName != null) {
+ $sql .= ", @table_owner = " . $this->quoteIdentifier($schemaName, true);
+ }
+
+ $stmt = $this->query($sql);
+ $primaryKeysResult = $stmt->fetchAll(Zend_Db::FETCH_NUM);
+ $primaryKeyColumn = array();
+ $pkey_column_name = 3;
+ $pkey_key_seq = 4;
+ foreach ($primaryKeysResult as $pkeysRow) {
+ $primaryKeyColumn[$pkeysRow[$pkey_column_name]] = $pkeysRow[$pkey_key_seq];
+ }
+
+ $desc = array();
+ $p = 1;
+ foreach ($result as $key => $row) {
+ $identity = false;
+ $words = explode(' ', $row[$type_name], 2);
+ if (isset($words[0])) {
+ $type = $words[0];
+ if (isset($words[1])) {
+ $identity = (bool) preg_match('/identity/', $words[1]);
+ }
+ }
+
+ $isPrimary = array_key_exists($row[$column_name], $primaryKeyColumn);
+ if ($isPrimary) {
+ $primaryPosition = $primaryKeyColumn[$row[$column_name]];
+ } else {
+ $primaryPosition = null;
+ }
+
+ $desc[$this->foldCase($row[$column_name])] = array(
+ 'SCHEMA_NAME' => null, // @todo
+ 'TABLE_NAME' => $this->foldCase($row[$table_name]),
+ 'COLUMN_NAME' => $this->foldCase($row[$column_name]),
+ 'COLUMN_POSITION' => (int) $row[$column_position],
+ 'DATA_TYPE' => $type,
+ 'DEFAULT' => $row[$column_def],
+ 'NULLABLE' => (bool) $row[$nullable],
+ 'LENGTH' => $row[$length],
+ 'SCALE' => $row[$scale],
+ 'PRECISION' => $row[$precision],
+ 'UNSIGNED' => null, // @todo
+ 'PRIMARY' => $isPrimary,
+ 'PRIMARY_POSITION' => $primaryPosition,
+ 'IDENTITY' => $identity
+ );
+ }
+ return $desc;
+ }
+
+ /**
+ * Adds an adapter-specific LIMIT clause to the SELECT statement.
+ *
+ * @link http://lists.bestpractical.com/pipermail/rt-devel/2005-June/007339.html
+ *
+ * @param string $sql
+ * @param integer $count
+ * @param integer $offset OPTIONAL
+ * @throws Zend_Db_Adapter_Exception
+ * @return string
+ */
+ public function limit($sql, $count, $offset = 0)
+ {
+ $count = intval($count);
+ if ($count <= 0) {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception("LIMIT argument count=$count is not valid");
+ }
+
+ $offset = intval($offset);
+ if ($offset < 0) {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception("LIMIT argument offset=$offset is not valid");
+ }
+
+ $sql = preg_replace(
+ '/^SELECT\s+(DISTINCT\s)?/i',
+ 'SELECT $1TOP ' . ($count+$offset) . ' ',
+ $sql
+ );
+
+ if ($offset > 0) {
+ $orderby = stristr($sql, 'ORDER BY');
+
+ if ($orderby !== false) {
+ $orderParts = explode(',', substr($orderby, 8));
+ $pregReplaceCount = null;
+ $orderbyInverseParts = array();
+ foreach ($orderParts as $orderPart) {
+ $orderPart = rtrim($orderPart);
+ $inv = preg_replace('/\s+desc$/i', ' ASC', $orderPart, 1, $pregReplaceCount);
+ if ($pregReplaceCount) {
+ $orderbyInverseParts[] = $inv;
+ continue;
+ }
+ $inv = preg_replace('/\s+asc$/i', ' DESC', $orderPart, 1, $pregReplaceCount);
+ if ($pregReplaceCount) {
+ $orderbyInverseParts[] = $inv;
+ continue;
+ } else {
+ $orderbyInverseParts[] = $orderPart . ' DESC';
+ }
+ }
+
+ $orderbyInverse = 'ORDER BY ' . implode(', ', $orderbyInverseParts);
+ }
+
+
+
+
+ $sql = 'SELECT * FROM (SELECT TOP ' . $count . ' * FROM (' . $sql . ') AS inner_tbl';
+ if ($orderby !== false) {
+ $sql .= ' ' . $orderbyInverse . ' ';
+ }
+ $sql .= ') AS outer_tbl';
+ if ($orderby !== false) {
+ $sql .= ' ' . $orderby;
+ }
+ }
+
+ return $sql;
+ }
+
+ /**
+ * Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.
+ *
+ * As a convention, on RDBMS brands that support sequences
+ * (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence
+ * from the arguments and returns the last id generated by that sequence.
+ * On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method
+ * returns the last value generated for such a column, and the table name
+ * argument is disregarded.
+ *
+ * Microsoft SQL Server does not support sequences, so the arguments to
+ * this method are ignored.
+ *
+ * @param string $tableName OPTIONAL Name of table.
+ * @param string $primaryKey OPTIONAL Name of primary key column.
+ * @return string
+ * @throws Zend_Db_Adapter_Exception
+ */
+ public function lastInsertId($tableName = null, $primaryKey = null)
+ {
+ $sql = 'SELECT SCOPE_IDENTITY()';
+ return (int)$this->fetchOne($sql);
+ }
+
+ /**
+ * Retrieve server version in PHP style
+ * Pdo_Mssql doesn't support getAttribute(PDO::ATTR_SERVER_VERSION)
+ * @return string
+ */
+ public function getServerVersion()
+ {
+ try {
+ $stmt = $this->query("SELECT CAST(SERVERPROPERTY('productversion') AS VARCHAR)");
+ $result = $stmt->fetchAll(Zend_Db::FETCH_NUM);
+ if (count($result)) {
+ return $result[0][0];
+ }
+ return null;
+ } catch (PDOException $e) {
+ return null;
+ }
+ }
+
+ /**
+ * Quote a raw string.
+ *
+ * @param string $value Raw string
+ * @return string Quoted string
+ */
+ protected function _quote($value)
+ {
+ if (!is_int($value) && !is_float($value)) {
+ // Fix for null-byte injection
+ $value = addcslashes($value, "\000\032");
+ }
+ return parent::_quote($value);
+ }
+}
diff --git a/library/vendor/Zend/Db/Adapter/Pdo/Mysql.php b/library/vendor/Zend/Db/Adapter/Pdo/Mysql.php
new file mode 100644
index 0000000..951d665
--- /dev/null
+++ b/library/vendor/Zend/Db/Adapter/Pdo/Mysql.php
@@ -0,0 +1,269 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Db_Adapter_Pdo_Abstract
+ */
+
+
+/**
+ * Class for connecting to MySQL databases and performing common operations.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Adapter_Pdo_Mysql extends Zend_Db_Adapter_Pdo_Abstract
+{
+
+ /**
+ * PDO type.
+ *
+ * @var string
+ */
+ protected $_pdoType = 'mysql';
+
+ /**
+ * Keys are UPPERCASE SQL datatypes or the constants
+ * Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE, or Zend_Db::FLOAT_TYPE.
+ *
+ * Values are:
+ * 0 = 32-bit integer
+ * 1 = 64-bit integer
+ * 2 = float or decimal
+ *
+ * @var array Associative array of datatypes to values 0, 1, or 2.
+ */
+ protected $_numericDataTypes = array(
+ Zend_Db::INT_TYPE => Zend_Db::INT_TYPE,
+ Zend_Db::BIGINT_TYPE => Zend_Db::BIGINT_TYPE,
+ Zend_Db::FLOAT_TYPE => Zend_Db::FLOAT_TYPE,
+ 'INT' => Zend_Db::INT_TYPE,
+ 'INTEGER' => Zend_Db::INT_TYPE,
+ 'MEDIUMINT' => Zend_Db::INT_TYPE,
+ 'SMALLINT' => Zend_Db::INT_TYPE,
+ 'TINYINT' => Zend_Db::INT_TYPE,
+ 'BIGINT' => Zend_Db::BIGINT_TYPE,
+ 'SERIAL' => Zend_Db::BIGINT_TYPE,
+ 'DEC' => Zend_Db::FLOAT_TYPE,
+ 'DECIMAL' => Zend_Db::FLOAT_TYPE,
+ 'DOUBLE' => Zend_Db::FLOAT_TYPE,
+ 'DOUBLE PRECISION' => Zend_Db::FLOAT_TYPE,
+ 'FIXED' => Zend_Db::FLOAT_TYPE,
+ 'FLOAT' => Zend_Db::FLOAT_TYPE
+ );
+
+ /**
+ * Override _dsn() and ensure that charset is incorporated in mysql
+ * @see Zend_Db_Adapter_Pdo_Abstract::_dsn()
+ */
+ protected function _dsn()
+ {
+ $dsn = parent::_dsn();
+ if (isset($this->_config['charset'])) {
+ $dsn .= ';charset=' . $this->_config['charset'];
+ }
+ return $dsn;
+ }
+
+ /**
+ * Creates a PDO object and connects to the database.
+ *
+ * @return void
+ * @throws Zend_Db_Adapter_Exception
+ */
+ protected function _connect()
+ {
+ if ($this->_connection) {
+ return;
+ }
+
+ if (!empty($this->_config['charset'])
+ && version_compare(PHP_VERSION, '5.3.6', '<')
+ ) {
+ $initCommand = "SET NAMES '" . $this->_config['charset'] . "'";
+ $this->_config['driver_options'][1002] = $initCommand; // 1002 = PDO::MYSQL_ATTR_INIT_COMMAND
+ }
+
+ parent::_connect();
+ }
+
+ /**
+ * @return string
+ */
+ public function getQuoteIdentifierSymbol()
+ {
+ return "`";
+ }
+
+ /**
+ * Returns a list of the tables in the database.
+ *
+ * @return array
+ */
+ public function listTables()
+ {
+ return $this->fetchCol('SHOW TABLES');
+ }
+
+ /**
+ * Returns the column descriptions for a table.
+ *
+ * The return value is an associative array keyed by the column name,
+ * as returned by the RDBMS.
+ *
+ * The value of each array element is an associative array
+ * with the following keys:
+ *
+ * SCHEMA_NAME => string; name of database or schema
+ * TABLE_NAME => string;
+ * COLUMN_NAME => string; column name
+ * COLUMN_POSITION => number; ordinal position of column in table
+ * DATA_TYPE => string; SQL datatype name of column
+ * DEFAULT => string; default expression of column, null if none
+ * NULLABLE => boolean; true if column can have nulls
+ * LENGTH => number; length of CHAR/VARCHAR
+ * SCALE => number; scale of NUMERIC/DECIMAL
+ * PRECISION => number; precision of NUMERIC/DECIMAL
+ * UNSIGNED => boolean; unsigned property of an integer type
+ * PRIMARY => boolean; true if column is part of the primary key
+ * PRIMARY_POSITION => integer; position of column in primary key
+ * IDENTITY => integer; true if column is auto-generated with unique values
+ *
+ * @param string $tableName
+ * @param string $schemaName OPTIONAL
+ * @return array
+ */
+ public function describeTable($tableName, $schemaName = null)
+ {
+ // @todo use INFORMATION_SCHEMA someday when MySQL's
+ // implementation has reasonably good performance and
+ // the version with this improvement is in wide use.
+
+ if ($schemaName) {
+ $sql = 'DESCRIBE ' . $this->quoteIdentifier("$schemaName.$tableName", true);
+ } else {
+ $sql = 'DESCRIBE ' . $this->quoteIdentifier($tableName, true);
+ }
+ $stmt = $this->query($sql);
+
+ // Use FETCH_NUM so we are not dependent on the CASE attribute of the PDO connection
+ $result = $stmt->fetchAll(Zend_Db::FETCH_NUM);
+
+ $field = 0;
+ $type = 1;
+ $null = 2;
+ $key = 3;
+ $default = 4;
+ $extra = 5;
+
+ $desc = array();
+ $i = 1;
+ $p = 1;
+ foreach ($result as $row) {
+ list($length, $scale, $precision, $unsigned, $primary, $primaryPosition, $identity)
+ = array(null, null, null, null, false, null, false);
+ if (preg_match('/unsigned/', $row[$type])) {
+ $unsigned = true;
+ }
+ if (preg_match('/^((?:var)?char)\((\d+)\)/', $row[$type], $matches)) {
+ $row[$type] = $matches[1];
+ $length = $matches[2];
+ } else if (preg_match('/^decimal\((\d+),(\d+)\)/', $row[$type], $matches)) {
+ $row[$type] = 'decimal';
+ $precision = $matches[1];
+ $scale = $matches[2];
+ } else if (preg_match('/^float\((\d+),(\d+)\)/', $row[$type], $matches)) {
+ $row[$type] = 'float';
+ $precision = $matches[1];
+ $scale = $matches[2];
+ } else if (preg_match('/^((?:big|medium|small|tiny)?int)\((\d+)\)/', $row[$type], $matches)) {
+ $row[$type] = $matches[1];
+ // The optional argument of a MySQL int type is not precision
+ // or length; it is only a hint for display width.
+ }
+ if (strtoupper($row[$key]) == 'PRI') {
+ $primary = true;
+ $primaryPosition = $p;
+ if ($row[$extra] == 'auto_increment') {
+ $identity = true;
+ } else {
+ $identity = false;
+ }
+ ++$p;
+ }
+ $desc[$this->foldCase($row[$field])] = array(
+ 'SCHEMA_NAME' => null, // @todo
+ 'TABLE_NAME' => $this->foldCase($tableName),
+ 'COLUMN_NAME' => $this->foldCase($row[$field]),
+ 'COLUMN_POSITION' => $i,
+ 'DATA_TYPE' => $row[$type],
+ 'DEFAULT' => $row[$default],
+ 'NULLABLE' => (bool) ($row[$null] == 'YES'),
+ 'LENGTH' => $length,
+ 'SCALE' => $scale,
+ 'PRECISION' => $precision,
+ 'UNSIGNED' => $unsigned,
+ 'PRIMARY' => $primary,
+ 'PRIMARY_POSITION' => $primaryPosition,
+ 'IDENTITY' => $identity
+ );
+ ++$i;
+ }
+ return $desc;
+ }
+
+ /**
+ * Adds an adapter-specific LIMIT clause to the SELECT statement.
+ *
+ * @param string $sql
+ * @param integer $count
+ * @param integer $offset OPTIONAL
+ * @throws Zend_Db_Adapter_Exception
+ * @return string
+ */
+ public function limit($sql, $count, $offset = 0)
+ {
+ $count = intval($count);
+ if ($count <= 0) {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception("LIMIT argument count=$count is not valid");
+ }
+
+ $offset = intval($offset);
+ if ($offset < 0) {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception("LIMIT argument offset=$offset is not valid");
+ }
+
+ $sql .= " LIMIT $count";
+ if ($offset > 0) {
+ $sql .= " OFFSET $offset";
+ }
+
+ return $sql;
+ }
+
+}
diff --git a/library/vendor/Zend/Db/Adapter/Pdo/Oci.php b/library/vendor/Zend/Db/Adapter/Pdo/Oci.php
new file mode 100644
index 0000000..eb4e6fc
--- /dev/null
+++ b/library/vendor/Zend/Db/Adapter/Pdo/Oci.php
@@ -0,0 +1,375 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Db_Adapter_Pdo_Abstract
+ */
+
+
+/**
+ * Class for connecting to Oracle databases and performing common operations.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Adapter_Pdo_Oci extends Zend_Db_Adapter_Pdo_Abstract
+{
+
+ /**
+ * PDO type.
+ *
+ * @var string
+ */
+ protected $_pdoType = 'oci';
+
+ /**
+ * Default class name for a DB statement.
+ *
+ * @var string
+ */
+ protected $_defaultStmtClass = 'Zend_Db_Statement_Pdo_Oci';
+
+ /**
+ * Keys are UPPERCASE SQL datatypes or the constants
+ * Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE, or Zend_Db::FLOAT_TYPE.
+ *
+ * Values are:
+ * 0 = 32-bit integer
+ * 1 = 64-bit integer
+ * 2 = float or decimal
+ *
+ * @var array Associative array of datatypes to values 0, 1, or 2.
+ */
+ protected $_numericDataTypes = array(
+ Zend_Db::INT_TYPE => Zend_Db::INT_TYPE,
+ Zend_Db::BIGINT_TYPE => Zend_Db::BIGINT_TYPE,
+ Zend_Db::FLOAT_TYPE => Zend_Db::FLOAT_TYPE,
+ 'BINARY_DOUBLE' => Zend_Db::FLOAT_TYPE,
+ 'BINARY_FLOAT' => Zend_Db::FLOAT_TYPE,
+ 'NUMBER' => Zend_Db::FLOAT_TYPE
+ );
+
+ /**
+ * Creates a PDO DSN for the adapter from $this->_config settings.
+ *
+ * @return string
+ */
+ protected function _dsn()
+ {
+ // baseline of DSN parts
+ $dsn = $this->_config;
+
+ if (isset($dsn['host'])) {
+ $tns = 'dbname=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)' .
+ '(HOST=' . $dsn['host'] . ')';
+
+ if (isset($dsn['port'])) {
+ $tns .= '(PORT=' . $dsn['port'] . ')';
+ } else {
+ $tns .= '(PORT=1521)';
+ }
+
+ $tns .= '))(CONNECT_DATA=(SID=' . $dsn['dbname'] . ')))';
+ } else {
+ $tns = 'dbname=' . $dsn['dbname'];
+ }
+
+ if (isset($dsn['charset'])) {
+ $tns .= ';charset=' . $dsn['charset'];
+ }
+
+ return $this->_pdoType . ':' . $tns;
+ }
+
+ /**
+ * Quote a raw string.
+ * Most PDO drivers have an implementation for the quote() method,
+ * but the Oracle OCI driver must use the same implementation as the
+ * Zend_Db_Adapter_Abstract class.
+ *
+ * @param string $value Raw string
+ * @return string Quoted string
+ */
+ protected function _quote($value)
+ {
+ if (is_int($value) || is_float($value)) {
+ return $value;
+ }
+ $value = str_replace("'", "''", $value);
+ return "'" . addcslashes($value, "\000\n\r\\\032") . "'";
+ }
+
+ /**
+ * Quote a table identifier and alias.
+ *
+ * @param string|array|Zend_Db_Expr $ident The identifier or expression.
+ * @param string $alias An alias for the table.
+ * @return string The quoted identifier and alias.
+ */
+ public function quoteTableAs($ident, $alias = null, $auto = false)
+ {
+ // Oracle doesn't allow the 'AS' keyword between the table identifier/expression and alias.
+ return $this->_quoteIdentifierAs($ident, $alias, $auto, ' ');
+ }
+
+ /**
+ * Returns a list of the tables in the database.
+ *
+ * @return array
+ */
+ public function listTables()
+ {
+ $data = $this->fetchCol('SELECT table_name FROM all_tables');
+ return $data;
+ }
+
+ /**
+ * Returns the column descriptions for a table.
+ *
+ * The return value is an associative array keyed by the column name,
+ * as returned by the RDBMS.
+ *
+ * The value of each array element is an associative array
+ * with the following keys:
+ *
+ * SCHEMA_NAME => string; name of schema
+ * TABLE_NAME => string;
+ * COLUMN_NAME => string; column name
+ * COLUMN_POSITION => number; ordinal position of column in table
+ * DATA_TYPE => string; SQL datatype name of column
+ * DEFAULT => string; default expression of column, null if none
+ * NULLABLE => boolean; true if column can have nulls
+ * LENGTH => number; length of CHAR/VARCHAR
+ * SCALE => number; scale of NUMERIC/DECIMAL
+ * PRECISION => number; precision of NUMERIC/DECIMAL
+ * UNSIGNED => boolean; unsigned property of an integer type
+ * PRIMARY => boolean; true if column is part of the primary key
+ * PRIMARY_POSITION => integer; position of column in primary key
+ * IDENTITY => integer; true if column is auto-generated with unique values
+ *
+ * @todo Discover integer unsigned property.
+ *
+ * @param string $tableName
+ * @param string $schemaName OPTIONAL
+ * @return array
+ */
+ public function describeTable($tableName, $schemaName = null)
+ {
+ $version = $this->getServerVersion();
+ if (($version === null) || version_compare($version, '9.0.0', '>=')) {
+ $sql = "SELECT TC.TABLE_NAME, TC.OWNER, TC.COLUMN_NAME, TC.DATA_TYPE,
+ TC.DATA_DEFAULT, TC.NULLABLE, TC.COLUMN_ID, TC.DATA_LENGTH,
+ TC.DATA_SCALE, TC.DATA_PRECISION, C.CONSTRAINT_TYPE, CC.POSITION
+ FROM ALL_TAB_COLUMNS TC
+ LEFT JOIN (ALL_CONS_COLUMNS CC JOIN ALL_CONSTRAINTS C
+ ON (CC.CONSTRAINT_NAME = C.CONSTRAINT_NAME AND CC.TABLE_NAME = C.TABLE_NAME AND CC.OWNER = C.OWNER AND C.CONSTRAINT_TYPE = 'P'))
+ ON TC.TABLE_NAME = CC.TABLE_NAME AND TC.COLUMN_NAME = CC.COLUMN_NAME
+ WHERE UPPER(TC.TABLE_NAME) = UPPER(:TBNAME)";
+ $bind[':TBNAME'] = $tableName;
+ if ($schemaName) {
+ $sql .= ' AND UPPER(TC.OWNER) = UPPER(:SCNAME)';
+ $bind[':SCNAME'] = $schemaName;
+ }
+ $sql .= ' ORDER BY TC.COLUMN_ID';
+ } else {
+ $subSql="SELECT AC.OWNER, AC.TABLE_NAME, ACC.COLUMN_NAME, AC.CONSTRAINT_TYPE, ACC.POSITION
+ from ALL_CONSTRAINTS AC, ALL_CONS_COLUMNS ACC
+ WHERE ACC.CONSTRAINT_NAME = AC.CONSTRAINT_NAME
+ AND ACC.TABLE_NAME = AC.TABLE_NAME
+ AND ACC.OWNER = AC.OWNER
+ AND AC.CONSTRAINT_TYPE = 'P'
+ AND UPPER(AC.TABLE_NAME) = UPPER(:TBNAME)";
+ $bind[':TBNAME'] = $tableName;
+ if ($schemaName) {
+ $subSql .= ' AND UPPER(ACC.OWNER) = UPPER(:SCNAME)';
+ $bind[':SCNAME'] = $schemaName;
+ }
+ $sql="SELECT TC.TABLE_NAME, TC.OWNER, TC.COLUMN_NAME, TC.DATA_TYPE,
+ TC.DATA_DEFAULT, TC.NULLABLE, TC.COLUMN_ID, TC.DATA_LENGTH,
+ TC.DATA_SCALE, TC.DATA_PRECISION, CC.CONSTRAINT_TYPE, CC.POSITION
+ FROM ALL_TAB_COLUMNS TC, ($subSql) CC
+ WHERE UPPER(TC.TABLE_NAME) = UPPER(:TBNAME)
+ AND TC.OWNER = CC.OWNER(+) AND TC.TABLE_NAME = CC.TABLE_NAME(+) AND TC.COLUMN_NAME = CC.COLUMN_NAME(+)";
+ if ($schemaName) {
+ $sql .= ' AND UPPER(TC.OWNER) = UPPER(:SCNAME)';
+ }
+ $sql .= ' ORDER BY TC.COLUMN_ID';
+ }
+
+ $stmt = $this->query($sql, $bind);
+
+ /**
+ * Use FETCH_NUM so we are not dependent on the CASE attribute of the PDO connection
+ */
+ $result = $stmt->fetchAll(Zend_Db::FETCH_NUM);
+
+ $table_name = 0;
+ $owner = 1;
+ $column_name = 2;
+ $data_type = 3;
+ $data_default = 4;
+ $nullable = 5;
+ $column_id = 6;
+ $data_length = 7;
+ $data_scale = 8;
+ $data_precision = 9;
+ $constraint_type = 10;
+ $position = 11;
+
+ $desc = array();
+ foreach ($result as $key => $row) {
+ list ($primary, $primaryPosition, $identity) = array(false, null, false);
+ if ($row[$constraint_type] == 'P') {
+ $primary = true;
+ $primaryPosition = $row[$position];
+ /**
+ * Oracle does not support auto-increment keys.
+ */
+ $identity = false;
+ }
+ $desc[$this->foldCase($row[$column_name])] = array(
+ 'SCHEMA_NAME' => $this->foldCase($row[$owner]),
+ 'TABLE_NAME' => $this->foldCase($row[$table_name]),
+ 'COLUMN_NAME' => $this->foldCase($row[$column_name]),
+ 'COLUMN_POSITION' => $row[$column_id],
+ 'DATA_TYPE' => $row[$data_type],
+ 'DEFAULT' => $row[$data_default],
+ 'NULLABLE' => (bool) ($row[$nullable] == 'Y'),
+ 'LENGTH' => $row[$data_length],
+ 'SCALE' => $row[$data_scale],
+ 'PRECISION' => $row[$data_precision],
+ 'UNSIGNED' => null, // @todo
+ 'PRIMARY' => $primary,
+ 'PRIMARY_POSITION' => $primaryPosition,
+ 'IDENTITY' => $identity
+ );
+ }
+ return $desc;
+ }
+
+ /**
+ * Return the most recent value from the specified sequence in the database.
+ * This is supported only on RDBMS brands that support sequences
+ * (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.
+ *
+ * @param string $sequenceName
+ * @return integer
+ */
+ public function lastSequenceId($sequenceName)
+ {
+ $this->_connect();
+ $value = $this->fetchOne('SELECT '.$this->quoteIdentifier($sequenceName, true).'.CURRVAL FROM dual');
+ return $value;
+ }
+
+ /**
+ * Generate a new value from the specified sequence in the database, and return it.
+ * This is supported only on RDBMS brands that support sequences
+ * (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.
+ *
+ * @param string $sequenceName
+ * @return integer
+ */
+ public function nextSequenceId($sequenceName)
+ {
+ $this->_connect();
+ $value = $this->fetchOne('SELECT '.$this->quoteIdentifier($sequenceName, true).'.NEXTVAL FROM dual');
+ return $value;
+ }
+
+ /**
+ * Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.
+ *
+ * As a convention, on RDBMS brands that support sequences
+ * (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence
+ * from the arguments and returns the last id generated by that sequence.
+ * On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method
+ * returns the last value generated for such a column, and the table name
+ * argument is disregarded.
+ *
+ * Oracle does not support IDENTITY columns, so if the sequence is not
+ * specified, this method returns null.
+ *
+ * @param string $tableName OPTIONAL Name of table.
+ * @param string $primaryKey OPTIONAL Name of primary key column.
+ * @return string
+ * @throws Zend_Db_Adapter_Oracle_Exception
+ */
+ public function lastInsertId($tableName = null, $primaryKey = null)
+ {
+ if ($tableName !== null) {
+ $sequenceName = $tableName;
+ if ($primaryKey) {
+ $sequenceName .= $this->foldCase("_$primaryKey");
+ }
+ $sequenceName .= $this->foldCase('_seq');
+ return $this->lastSequenceId($sequenceName);
+ }
+ // No support for IDENTITY columns; return null
+ return null;
+ }
+
+ /**
+ * Adds an adapter-specific LIMIT clause to the SELECT statement.
+ *
+ * @param string $sql
+ * @param integer $count
+ * @param integer $offset
+ * @throws Zend_Db_Adapter_Exception
+ * @return string
+ */
+ public function limit($sql, $count, $offset = 0)
+ {
+ $count = intval($count);
+ if ($count <= 0) {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception("LIMIT argument count=$count is not valid");
+ }
+
+ $offset = intval($offset);
+ if ($offset < 0) {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception("LIMIT argument offset=$offset is not valid");
+ }
+
+ /**
+ * Oracle does not implement the LIMIT clause as some RDBMS do.
+ * We have to simulate it with subqueries and ROWNUM.
+ * Unfortunately because we use the column wildcard "*",
+ * this puts an extra column into the query result set.
+ */
+ $limit_sql = "SELECT z2.*
+ FROM (
+ SELECT z1.*, ROWNUM AS \"zend_db_rownum\"
+ FROM (
+ " . $sql . "
+ ) z1
+ ) z2
+ WHERE z2.\"zend_db_rownum\" BETWEEN " . ($offset+1) . " AND " . ($offset+$count);
+ return $limit_sql;
+ }
+
+}
diff --git a/library/vendor/Zend/Db/Adapter/Pdo/Pgsql.php b/library/vendor/Zend/Db/Adapter/Pdo/Pgsql.php
new file mode 100644
index 0000000..060ed28
--- /dev/null
+++ b/library/vendor/Zend/Db/Adapter/Pdo/Pgsql.php
@@ -0,0 +1,333 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Db_Adapter_Pdo_Abstract
+ */
+
+
+/**
+ * Class for connecting to PostgreSQL databases and performing common operations.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Adapter_Pdo_Pgsql extends Zend_Db_Adapter_Pdo_Abstract
+{
+
+ /**
+ * PDO type.
+ *
+ * @var string
+ */
+ protected $_pdoType = 'pgsql';
+
+ /**
+ * Keys are UPPERCASE SQL datatypes or the constants
+ * Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE, or Zend_Db::FLOAT_TYPE.
+ *
+ * Values are:
+ * 0 = 32-bit integer
+ * 1 = 64-bit integer
+ * 2 = float or decimal
+ *
+ * @var array Associative array of datatypes to values 0, 1, or 2.
+ */
+ protected $_numericDataTypes = array(
+ Zend_Db::INT_TYPE => Zend_Db::INT_TYPE,
+ Zend_Db::BIGINT_TYPE => Zend_Db::BIGINT_TYPE,
+ Zend_Db::FLOAT_TYPE => Zend_Db::FLOAT_TYPE,
+ 'INTEGER' => Zend_Db::INT_TYPE,
+ 'SERIAL' => Zend_Db::INT_TYPE,
+ 'SMALLINT' => Zend_Db::INT_TYPE,
+ 'BIGINT' => Zend_Db::BIGINT_TYPE,
+ 'BIGSERIAL' => Zend_Db::BIGINT_TYPE,
+ 'DECIMAL' => Zend_Db::FLOAT_TYPE,
+ 'DOUBLE PRECISION' => Zend_Db::FLOAT_TYPE,
+ 'NUMERIC' => Zend_Db::FLOAT_TYPE,
+ 'REAL' => Zend_Db::FLOAT_TYPE
+ );
+
+ /**
+ * Creates a PDO object and connects to the database.
+ *
+ * @return void
+ * @throws Zend_Db_Adapter_Exception
+ */
+ protected function _connect()
+ {
+ if ($this->_connection) {
+ return;
+ }
+
+ parent::_connect();
+
+ if (!empty($this->_config['charset'])) {
+ $sql = "SET NAMES '" . $this->_config['charset'] . "'";
+ $this->_connection->exec($sql);
+ }
+ }
+
+ /**
+ * Returns a list of the tables in the database.
+ *
+ * @return array
+ */
+ public function listTables()
+ {
+ // @todo use a better query with joins instead of subqueries
+ $sql = "SELECT c.relname AS table_name "
+ . "FROM pg_class c, pg_user u "
+ . "WHERE c.relowner = u.usesysid AND c.relkind = 'r' "
+ . "AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) "
+ . "AND c.relname !~ '^(pg_|sql_)' "
+ . "UNION "
+ . "SELECT c.relname AS table_name "
+ . "FROM pg_class c "
+ . "WHERE c.relkind = 'r' "
+ . "AND NOT EXISTS (SELECT 1 FROM pg_views WHERE viewname = c.relname) "
+ . "AND NOT EXISTS (SELECT 1 FROM pg_user WHERE usesysid = c.relowner) "
+ . "AND c.relname !~ '^pg_'";
+
+ return $this->fetchCol($sql);
+ }
+
+ /**
+ * Returns the column descriptions for a table.
+ *
+ * The return value is an associative array keyed by the column name,
+ * as returned by the RDBMS.
+ *
+ * The value of each array element is an associative array
+ * with the following keys:
+ *
+ * SCHEMA_NAME => string; name of database or schema
+ * TABLE_NAME => string;
+ * COLUMN_NAME => string; column name
+ * COLUMN_POSITION => number; ordinal position of column in table
+ * DATA_TYPE => string; SQL datatype name of column
+ * DEFAULT => string; default expression of column, null if none
+ * NULLABLE => boolean; true if column can have nulls
+ * LENGTH => number; length of CHAR/VARCHAR
+ * SCALE => number; scale of NUMERIC/DECIMAL
+ * PRECISION => number; precision of NUMERIC/DECIMAL
+ * UNSIGNED => boolean; unsigned property of an integer type
+ * PRIMARY => boolean; true if column is part of the primary key
+ * PRIMARY_POSITION => integer; position of column in primary key
+ * IDENTITY => integer; true if column is auto-generated with unique values
+ *
+ * @todo Discover integer unsigned property.
+ *
+ * @param string $tableName
+ * @param string $schemaName OPTIONAL
+ * @return array
+ */
+ public function describeTable($tableName, $schemaName = null)
+ {
+ $sql = "SELECT
+ a.attnum,
+ n.nspname,
+ c.relname,
+ a.attname AS colname,
+ t.typname AS type,
+ a.atttypmod,
+ FORMAT_TYPE(a.atttypid, a.atttypmod) AS complete_type,
+ d.adsrc AS default_value,
+ a.attnotnull AS notnull,
+ a.attlen AS length,
+ co.contype,
+ ARRAY_TO_STRING(co.conkey, ',') AS conkey
+ FROM pg_attribute AS a
+ JOIN pg_class AS c ON a.attrelid = c.oid
+ JOIN pg_namespace AS n ON c.relnamespace = n.oid
+ JOIN pg_type AS t ON a.atttypid = t.oid
+ LEFT OUTER JOIN pg_constraint AS co ON (co.conrelid = c.oid
+ AND a.attnum = ANY(co.conkey) AND co.contype = 'p')
+ LEFT OUTER JOIN pg_attrdef AS d ON d.adrelid = c.oid AND d.adnum = a.attnum
+ WHERE a.attnum > 0 AND c.relname = ".$this->quote($tableName);
+ if ($schemaName) {
+ $sql .= " AND n.nspname = ".$this->quote($schemaName);
+ }
+ $sql .= ' ORDER BY a.attnum';
+
+ $stmt = $this->query($sql);
+
+ // Use FETCH_NUM so we are not dependent on the CASE attribute of the PDO connection
+ $result = $stmt->fetchAll(Zend_Db::FETCH_NUM);
+
+ $attnum = 0;
+ $nspname = 1;
+ $relname = 2;
+ $colname = 3;
+ $type = 4;
+ $atttypemod = 5;
+ $complete_type = 6;
+ $default_value = 7;
+ $notnull = 8;
+ $length = 9;
+ $contype = 10;
+ $conkey = 11;
+
+ $desc = array();
+ foreach ($result as $key => $row) {
+ $defaultValue = $row[$default_value];
+ if ($row[$type] == 'varchar' || $row[$type] == 'bpchar' ) {
+ if (preg_match('/character(?: varying)?(?:\((\d+)\))?/', $row[$complete_type], $matches)) {
+ if (isset($matches[1])) {
+ $row[$length] = $matches[1];
+ } else {
+ $row[$length] = null; // unlimited
+ }
+ }
+ if (preg_match("/^'(.*?)'::(?:character varying|bpchar)$/", $defaultValue, $matches)) {
+ $defaultValue = $matches[1];
+ }
+ }
+ list($primary, $primaryPosition, $identity) = array(false, null, false);
+ if ($row[$contype] == 'p') {
+ $primary = true;
+ $primaryPosition = array_search($row[$attnum], explode(',', $row[$conkey])) + 1;
+ $identity = (bool) (preg_match('/^nextval/', $row[$default_value]));
+ }
+ $desc[$this->foldCase($row[$colname])] = array(
+ 'SCHEMA_NAME' => $this->foldCase($row[$nspname]),
+ 'TABLE_NAME' => $this->foldCase($row[$relname]),
+ 'COLUMN_NAME' => $this->foldCase($row[$colname]),
+ 'COLUMN_POSITION' => $row[$attnum],
+ 'DATA_TYPE' => $row[$type],
+ 'DEFAULT' => $defaultValue,
+ 'NULLABLE' => (bool) ($row[$notnull] != 't'),
+ 'LENGTH' => $row[$length],
+ 'SCALE' => null, // @todo
+ 'PRECISION' => null, // @todo
+ 'UNSIGNED' => null, // @todo
+ 'PRIMARY' => $primary,
+ 'PRIMARY_POSITION' => $primaryPosition,
+ 'IDENTITY' => $identity
+ );
+ }
+ return $desc;
+ }
+
+
+ /**
+ * Adds an adapter-specific LIMIT clause to the SELECT statement.
+ *
+ * @param string $sql
+ * @param integer $count
+ * @param integer $offset OPTIONAL
+ * @return string
+ */
+ public function limit($sql, $count, $offset = 0)
+ {
+ $count = intval($count);
+ if ($count <= 0) {
+ /**
+ * @see Zend_Db_Adapter_Exception
+ */
+ throw new Zend_Db_Adapter_Exception("LIMIT argument count=$count is not valid");
+ }
+
+ $offset = intval($offset);
+ if ($offset < 0) {
+ /**
+ * @see Zend_Db_Adapter_Exception
+ */
+ throw new Zend_Db_Adapter_Exception("LIMIT argument offset=$offset is not valid");
+ }
+
+ $sql .= " LIMIT $count";
+ if ($offset > 0) {
+ $sql .= " OFFSET $offset";
+ }
+
+ return $sql;
+ }
+
+ /**
+ * Return the most recent value from the specified sequence in the database.
+ * This is supported only on RDBMS brands that support sequences
+ * (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.
+ *
+ * @param string $sequenceName
+ * @return string
+ */
+ public function lastSequenceId($sequenceName)
+ {
+ $this->_connect();
+ $sequenceName = str_replace($this->getQuoteIdentifierSymbol(), '', (string) $sequenceName);
+ $value = $this->fetchOne("SELECT CURRVAL("
+ . $this->quote($this->quoteIdentifier($sequenceName, true))
+ . ")");
+ return $value;
+ }
+
+ /**
+ * Generate a new value from the specified sequence in the database, and return it.
+ * This is supported only on RDBMS brands that support sequences
+ * (e.g. Oracle, PostgreSQL, DB2). Other RDBMS brands return null.
+ *
+ * @param string $sequenceName
+ * @return string
+ */
+ public function nextSequenceId($sequenceName)
+ {
+ $this->_connect();
+ $sequenceName = str_replace($this->getQuoteIdentifierSymbol(), '', (string) $sequenceName);
+ $value = $this->fetchOne("SELECT NEXTVAL("
+ . $this->quote($this->quoteIdentifier($sequenceName, true))
+ . ")");
+ return $value;
+ }
+
+ /**
+ * Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.
+ *
+ * As a convention, on RDBMS brands that support sequences
+ * (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence
+ * from the arguments and returns the last id generated by that sequence.
+ * On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method
+ * returns the last value generated for such a column, and the table name
+ * argument is disregarded.
+ *
+ * @param string $tableName OPTIONAL Name of table.
+ * @param string $primaryKey OPTIONAL Name of primary key column.
+ * @return string
+ */
+ public function lastInsertId($tableName = null, $primaryKey = null)
+ {
+ if ($tableName !== null) {
+ $sequenceName = $tableName;
+ if ($primaryKey) {
+ $sequenceName .= "_$primaryKey";
+ }
+ $sequenceName .= '_seq';
+ return $this->lastSequenceId($sequenceName);
+ }
+ return $this->_connection->lastInsertId($tableName);
+ }
+
+}
diff --git a/library/vendor/Zend/Db/Adapter/Pdo/Sqlite.php b/library/vendor/Zend/Db/Adapter/Pdo/Sqlite.php
new file mode 100644
index 0000000..6453339
--- /dev/null
+++ b/library/vendor/Zend/Db/Adapter/Pdo/Sqlite.php
@@ -0,0 +1,305 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Db_Adapter_Pdo_Abstract
+ */
+
+
+/**
+ * Class for connecting to SQLite2 and SQLite3 databases and performing common operations.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Adapter_Pdo_Sqlite extends Zend_Db_Adapter_Pdo_Abstract
+{
+
+ /**
+ * PDO type
+ *
+ * @var string
+ */
+ protected $_pdoType = 'sqlite';
+
+ /**
+ * Keys are UPPERCASE SQL datatypes or the constants
+ * Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE, or Zend_Db::FLOAT_TYPE.
+ *
+ * Values are:
+ * 0 = 32-bit integer
+ * 1 = 64-bit integer
+ * 2 = float or decimal
+ *
+ * @var array Associative array of datatypes to values 0, 1, or 2.
+ */
+ protected $_numericDataTypes = array(
+ Zend_Db::INT_TYPE => Zend_Db::INT_TYPE,
+ Zend_Db::BIGINT_TYPE => Zend_Db::BIGINT_TYPE,
+ Zend_Db::FLOAT_TYPE => Zend_Db::FLOAT_TYPE,
+ 'INTEGER' => Zend_Db::BIGINT_TYPE,
+ 'REAL' => Zend_Db::FLOAT_TYPE
+ );
+
+ /**
+ * Constructor.
+ *
+ * $config is an array of key/value pairs containing configuration
+ * options. Note that the SQLite options are different than most of
+ * the other PDO adapters in that no username or password are needed.
+ * Also, an extra config key "sqlite2" specifies compatibility mode.
+ *
+ * dbname => (string) The name of the database to user (required,
+ * use :memory: for memory-based database)
+ *
+ * sqlite2 => (boolean) PDO_SQLITE defaults to SQLite 3. For compatibility
+ * with an older SQLite 2 database, set this to TRUE.
+ *
+ * @param array $config An array of configuration keys.
+ */
+ public function __construct(array $config = array())
+ {
+ if (isset($config['sqlite2']) && $config['sqlite2']) {
+ $this->_pdoType = 'sqlite2';
+ }
+
+ // SQLite uses no username/password. Stub to satisfy parent::_connect()
+ $this->_config['username'] = null;
+ $this->_config['password'] = null;
+
+ return parent::__construct($config);
+ }
+
+ /**
+ * Check for config options that are mandatory.
+ * Throw exceptions if any are missing.
+ *
+ * @param array $config
+ * @throws Zend_Db_Adapter_Exception
+ */
+ protected function _checkRequiredOptions(array $config)
+ {
+ // we need at least a dbname
+ if (! array_key_exists('dbname', $config)) {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception("Configuration array must have a key for 'dbname' that names the database instance");
+ }
+ }
+
+ /**
+ * DSN builder
+ */
+ protected function _dsn()
+ {
+ return $this->_pdoType .':'. $this->_config['dbname'];
+ }
+
+ /**
+ * Special configuration for SQLite behavior: make sure that result sets
+ * contain keys like 'column' instead of 'table.column'.
+ *
+ * @throws Zend_Db_Adapter_Exception
+ */
+ protected function _connect()
+ {
+ /**
+ * if we already have a PDO object, no need to re-connect.
+ */
+ if ($this->_connection) {
+ return;
+ }
+
+ parent::_connect();
+
+ $retval = $this->_connection->exec('PRAGMA full_column_names=0');
+ if ($retval === false) {
+ $error = $this->_connection->errorInfo();
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception($error[2]);
+ }
+
+ $retval = $this->_connection->exec('PRAGMA short_column_names=1');
+ if ($retval === false) {
+ $error = $this->_connection->errorInfo();
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception($error[2]);
+ }
+ }
+
+ /**
+ * Returns a list of the tables in the database.
+ *
+ * @return array
+ */
+ public function listTables()
+ {
+ $sql = "SELECT name FROM sqlite_master WHERE type='table' "
+ . "UNION ALL SELECT name FROM sqlite_temp_master "
+ . "WHERE type='table' ORDER BY name";
+
+ return $this->fetchCol($sql);
+ }
+
+ /**
+ * Returns the column descriptions for a table.
+ *
+ * The return value is an associative array keyed by the column name,
+ * as returned by the RDBMS.
+ *
+ * The value of each array element is an associative array
+ * with the following keys:
+ *
+ * SCHEMA_NAME => string; name of database or schema
+ * TABLE_NAME => string;
+ * COLUMN_NAME => string; column name
+ * COLUMN_POSITION => number; ordinal position of column in table
+ * DATA_TYPE => string; SQL datatype name of column
+ * DEFAULT => string; default expression of column, null if none
+ * NULLABLE => boolean; true if column can have nulls
+ * LENGTH => number; length of CHAR/VARCHAR
+ * SCALE => number; scale of NUMERIC/DECIMAL
+ * PRECISION => number; precision of NUMERIC/DECIMAL
+ * UNSIGNED => boolean; unsigned property of an integer type
+ * PRIMARY => boolean; true if column is part of the primary key
+ * PRIMARY_POSITION => integer; position of column in primary key
+ * IDENTITY => integer; true if column is auto-generated with unique values
+ *
+ * @param string $tableName
+ * @param string $schemaName OPTIONAL
+ * @return array
+ */
+ public function describeTable($tableName, $schemaName = null)
+ {
+ $sql = 'PRAGMA ';
+
+ if ($schemaName) {
+ $sql .= $this->quoteIdentifier($schemaName) . '.';
+ }
+
+ $sql .= 'table_info('.$this->quoteIdentifier($tableName).')';
+
+ $stmt = $this->query($sql);
+
+ /**
+ * Use FETCH_NUM so we are not dependent on the CASE attribute of the PDO connection
+ */
+ $result = $stmt->fetchAll(Zend_Db::FETCH_NUM);
+
+ $cid = 0;
+ $name = 1;
+ $type = 2;
+ $notnull = 3;
+ $dflt_value = 4;
+ $pk = 5;
+
+ $desc = array();
+
+ $p = 1;
+ foreach ($result as $key => $row) {
+ list($length, $scale, $precision, $primary, $primaryPosition, $identity) =
+ array(null, null, null, false, null, false);
+ if (preg_match('/^((?:var)?char)\((\d+)\)/i', $row[$type], $matches)) {
+ $row[$type] = $matches[1];
+ $length = $matches[2];
+ } else if (preg_match('/^decimal\((\d+),(\d+)\)/i', $row[$type], $matches)) {
+ $row[$type] = 'DECIMAL';
+ $precision = $matches[1];
+ $scale = $matches[2];
+ }
+ if ((bool) $row[$pk]) {
+ $primary = true;
+ $primaryPosition = $p;
+ /**
+ * SQLite INTEGER primary key is always auto-increment.
+ */
+ $identity = (bool) ($row[$type] == 'INTEGER');
+ ++$p;
+ }
+ $desc[$this->foldCase($row[$name])] = array(
+ 'SCHEMA_NAME' => $this->foldCase($schemaName),
+ 'TABLE_NAME' => $this->foldCase($tableName),
+ 'COLUMN_NAME' => $this->foldCase($row[$name]),
+ 'COLUMN_POSITION' => $row[$cid]+1,
+ 'DATA_TYPE' => $row[$type],
+ 'DEFAULT' => $row[$dflt_value],
+ 'NULLABLE' => ! (bool) $row[$notnull],
+ 'LENGTH' => $length,
+ 'SCALE' => $scale,
+ 'PRECISION' => $precision,
+ 'UNSIGNED' => null, // Sqlite3 does not support unsigned data
+ 'PRIMARY' => $primary,
+ 'PRIMARY_POSITION' => $primaryPosition,
+ 'IDENTITY' => $identity
+ );
+ }
+ return $desc;
+ }
+
+ /**
+ * Adds an adapter-specific LIMIT clause to the SELECT statement.
+ *
+ * @param string $sql
+ * @param integer $count
+ * @param integer $offset OPTIONAL
+ * @return string
+ */
+ public function limit($sql, $count, $offset = 0)
+ {
+ $count = intval($count);
+ if ($count <= 0) {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception("LIMIT argument count=$count is not valid");
+ }
+
+ $offset = intval($offset);
+ if ($offset < 0) {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception("LIMIT argument offset=$offset is not valid");
+ }
+
+ $sql .= " LIMIT $count";
+ if ($offset > 0) {
+ $sql .= " OFFSET $offset";
+ }
+
+ return $sql;
+ }
+
+ /**
+ * Quote a raw string.
+ *
+ * @param string $value Raw string
+ * @return string Quoted string
+ */
+ protected function _quote($value)
+ {
+ if (!is_int($value) && !is_float($value)) {
+ // Fix for null-byte injection
+ $value = addcslashes($value, "\000\032");
+ }
+ return parent::_quote($value);
+ }
+}
diff --git a/library/vendor/Zend/Db/Adapter/Sqlsrv.php b/library/vendor/Zend/Db/Adapter/Sqlsrv.php
new file mode 100644
index 0000000..ce3324f
--- /dev/null
+++ b/library/vendor/Zend/Db/Adapter/Sqlsrv.php
@@ -0,0 +1,662 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Db_Adapter_Abstract
+ */
+
+/**
+ * @see Zend_Db_Statement_Sqlsrv
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Adapter_Sqlsrv extends Zend_Db_Adapter_Abstract
+{
+ /**
+ * User-provided configuration.
+ *
+ * Basic keys are:
+ *
+ * username => (string) Connect to the database as this username.
+ * password => (string) Password associated with the username.
+ * dbname => The name of the local SQL Server instance
+ *
+ * @var array
+ */
+ protected $_config = array(
+ 'dbname' => null,
+ 'username' => null,
+ 'password' => null,
+ );
+
+ /**
+ * Last insert id from INSERT query
+ *
+ * @var int
+ */
+ protected $_lastInsertId;
+
+ /**
+ * Query used to fetch last insert id
+ *
+ * @var string
+ */
+ protected $_lastInsertSQL = 'SELECT SCOPE_IDENTITY() as Current_Identity';
+
+ /**
+ * Keys are UPPERCASE SQL datatypes or the constants
+ * Zend_Db::INT_TYPE, Zend_Db::BIGINT_TYPE, or Zend_Db::FLOAT_TYPE.
+ *
+ * Values are:
+ * 0 = 32-bit integer
+ * 1 = 64-bit integer
+ * 2 = float or decimal
+ *
+ * @var array Associative array of datatypes to values 0, 1, or 2.
+ */
+ protected $_numericDataTypes = array(
+ Zend_Db::INT_TYPE => Zend_Db::INT_TYPE,
+ Zend_Db::BIGINT_TYPE => Zend_Db::BIGINT_TYPE,
+ Zend_Db::FLOAT_TYPE => Zend_Db::FLOAT_TYPE,
+ 'INT' => Zend_Db::INT_TYPE,
+ 'SMALLINT' => Zend_Db::INT_TYPE,
+ 'TINYINT' => Zend_Db::INT_TYPE,
+ 'BIGINT' => Zend_Db::BIGINT_TYPE,
+ 'DECIMAL' => Zend_Db::FLOAT_TYPE,
+ 'FLOAT' => Zend_Db::FLOAT_TYPE,
+ 'MONEY' => Zend_Db::FLOAT_TYPE,
+ 'NUMERIC' => Zend_Db::FLOAT_TYPE,
+ 'REAL' => Zend_Db::FLOAT_TYPE,
+ 'SMALLMONEY' => Zend_Db::FLOAT_TYPE,
+ );
+
+ /**
+ * Default class name for a DB statement.
+ *
+ * @var string
+ */
+ protected $_defaultStmtClass = 'Zend_Db_Statement_Sqlsrv';
+
+ /**
+ * Creates a connection resource.
+ *
+ * @return void
+ * @throws Zend_Db_Adapter_Sqlsrv_Exception
+ */
+ protected function _connect()
+ {
+ if (is_resource($this->_connection)) {
+ // connection already exists
+ return;
+ }
+
+ if (!extension_loaded('sqlsrv')) {
+ /**
+ * @see Zend_Db_Adapter_Sqlsrv_Exception
+ */
+ throw new Zend_Db_Adapter_Sqlsrv_Exception('The Sqlsrv extension is required for this adapter but the extension is not loaded');
+ }
+
+ $serverName = $this->_config['host'];
+ if (isset($this->_config['port'])) {
+ $port = (integer) $this->_config['port'];
+ $serverName .= ', ' . $port;
+ }
+
+ $connectionInfo = array(
+ 'Database' => $this->_config['dbname'],
+ );
+
+ if (isset($this->_config['username']) && isset($this->_config['password']))
+ {
+ $connectionInfo += array(
+ 'UID' => $this->_config['username'],
+ 'PWD' => $this->_config['password'],
+ );
+ }
+ // else - windows authentication
+
+ if (!empty($this->_config['driver_options'])) {
+ foreach ($this->_config['driver_options'] as $option => $value) {
+ // A value may be a constant.
+ if (is_string($value)) {
+ $constantName = strtoupper($value);
+ if (defined($constantName)) {
+ $connectionInfo[$option] = constant($constantName);
+ } else {
+ $connectionInfo[$option] = $value;
+ }
+ }
+ }
+ }
+
+ $this->_connection = sqlsrv_connect($serverName, $connectionInfo);
+
+ if (!$this->_connection) {
+ /**
+ * @see Zend_Db_Adapter_Sqlsrv_Exception
+ */
+ throw new Zend_Db_Adapter_Sqlsrv_Exception(sqlsrv_errors());
+ }
+ }
+
+ /**
+ * Check for config options that are mandatory.
+ * Throw exceptions if any are missing.
+ *
+ * @param array $config
+ * @throws Zend_Db_Adapter_Exception
+ */
+ protected function _checkRequiredOptions(array $config)
+ {
+ // we need at least a dbname
+ if (! array_key_exists('dbname', $config)) {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception("Configuration array must have a key for 'dbname' that names the database instance");
+ }
+
+ if (! array_key_exists('password', $config) && array_key_exists('username', $config)) {
+ /**
+ * @see Zend_Db_Adapter_Exception
+ */
+ throw new Zend_Db_Adapter_Exception("Configuration array must have a key for 'password' for login credentials.
+ If Windows Authentication is desired, both keys 'username' and 'password' should be ommited from config.");
+ }
+
+ if (array_key_exists('password', $config) && !array_key_exists('username', $config)) {
+ /**
+ * @see Zend_Db_Adapter_Exception
+ */
+ throw new Zend_Db_Adapter_Exception("Configuration array must have a key for 'username' for login credentials.
+ If Windows Authentication is desired, both keys 'username' and 'password' should be ommited from config.");
+ }
+ }
+
+ /**
+ * Set the transaction isoltion level.
+ *
+ * @param integer|null $level A fetch mode from SQLSRV_TXN_*.
+ * @return true
+ * @throws Zend_Db_Adapter_Sqlsrv_Exception
+ */
+ public function setTransactionIsolationLevel($level = null)
+ {
+ $this->_connect();
+ $sql = null;
+
+ // Default transaction level in sql server
+ if ($level === null)
+ {
+ $level = SQLSRV_TXN_READ_COMMITTED;
+ }
+
+ switch ($level) {
+ case SQLSRV_TXN_READ_UNCOMMITTED:
+ $sql = "READ UNCOMMITTED";
+ break;
+ case SQLSRV_TXN_READ_COMMITTED:
+ $sql = "READ COMMITTED";
+ break;
+ case SQLSRV_TXN_REPEATABLE_READ:
+ $sql = "REPEATABLE READ";
+ break;
+ case SQLSRV_TXN_SNAPSHOT:
+ $sql = "SNAPSHOT";
+ break;
+ case SQLSRV_TXN_SERIALIZABLE:
+ $sql = "SERIALIZABLE";
+ break;
+ default:
+ throw new Zend_Db_Adapter_Sqlsrv_Exception("Invalid transaction isolation level mode '$level' specified");
+ }
+
+ if (!sqlsrv_query($this->_connection, "SET TRANSACTION ISOLATION LEVEL $sql;")) {
+ throw new Zend_Db_Adapter_Sqlsrv_Exception("Transaction cannot be changed to '$level'");
+ }
+
+ return true;
+ }
+
+ /**
+ * Test if a connection is active
+ *
+ * @return boolean
+ */
+ public function isConnected()
+ {
+ return (is_resource($this->_connection)
+ && (get_resource_type($this->_connection) == 'SQL Server Connection')
+ );
+ }
+
+ /**
+ * Force the connection to close.
+ *
+ * @return void
+ */
+ public function closeConnection()
+ {
+ if ($this->isConnected()) {
+ sqlsrv_close($this->_connection);
+ }
+ $this->_connection = null;
+ }
+
+ /**
+ * Returns an SQL statement for preparation.
+ *
+ * @param string $sql The SQL statement with placeholders.
+ * @return Zend_Db_Statement_Sqlsrv
+ */
+ public function prepare($sql)
+ {
+ $this->_connect();
+ $stmtClass = $this->_defaultStmtClass;
+
+ if (!class_exists($stmtClass)) {
+ /**
+ * @see Zend_Loader
+ */
+ Zend_Loader::loadClass($stmtClass);
+ }
+
+ $stmt = new $stmtClass($this, $sql);
+ $stmt->setFetchMode($this->_fetchMode);
+ return $stmt;
+ }
+
+ /**
+ * Quote a raw string.
+ *
+ * @param string $value Raw string
+ * @return string Quoted string
+ */
+ protected function _quote($value)
+ {
+ if (is_int($value)) {
+ return $value;
+ } elseif (is_float($value)) {
+ return sprintf('%F', $value);
+ }
+
+ $value = addcslashes($value, "\000\032");
+ return "'" . str_replace("'", "''", $value) . "'";
+ }
+
+ /**
+ * Gets the last ID generated automatically by an IDENTITY/AUTOINCREMENT column.
+ *
+ * As a convention, on RDBMS brands that support sequences
+ * (e.g. Oracle, PostgreSQL, DB2), this method forms the name of a sequence
+ * from the arguments and returns the last id generated by that sequence.
+ * On RDBMS brands that support IDENTITY/AUTOINCREMENT columns, this method
+ * returns the last value generated for such a column, and the table name
+ * argument is disregarded.
+ *
+ * @param string $tableName OPTIONAL Name of table.
+ * @param string $primaryKey OPTIONAL Name of primary key column.
+ * @return string
+ */
+ public function lastInsertId($tableName = null, $primaryKey = null)
+ {
+ if ($tableName) {
+ $tableName = $this->quote($tableName);
+ $sql = 'SELECT IDENT_CURRENT (' . $tableName . ') as Current_Identity';
+ return (string) $this->fetchOne($sql);
+ }
+
+ if ($this->_lastInsertId > 0) {
+ return (string) $this->_lastInsertId;
+ }
+
+ $sql = $this->_lastInsertSQL;
+ return (string) $this->fetchOne($sql);
+ }
+
+ /**
+ * Inserts a table row with specified data.
+ *
+ * @param mixed $table The table to insert data into.
+ * @param array $bind Column-value pairs.
+ * @return int The number of affected rows.
+ */
+ public function insert($table, array $bind)
+ {
+ // extract and quote col names from the array keys
+ $cols = array();
+ $vals = array();
+ foreach ($bind as $col => $val) {
+ $cols[] = $this->quoteIdentifier($col, true);
+ if ($val instanceof Zend_Db_Expr) {
+ $vals[] = $val->__toString();
+ unset($bind[$col]);
+ } else {
+ $vals[] = '?';
+ }
+ }
+
+ // build the statement
+ $sql = "INSERT INTO "
+ . $this->quoteIdentifier($table, true)
+ . ' (' . implode(', ', $cols) . ') '
+ . 'VALUES (' . implode(', ', $vals) . ')'
+ . ' ' . $this->_lastInsertSQL;
+
+ // execute the statement and return the number of affected rows
+ $stmt = $this->query($sql, array_values($bind));
+ $result = $stmt->rowCount();
+
+ $stmt->nextRowset();
+
+ $this->_lastInsertId = $stmt->fetchColumn();
+
+ return $result;
+ }
+
+ /**
+ * Returns a list of the tables in the database.
+ *
+ * @return array
+ */
+ public function listTables()
+ {
+ $this->_connect();
+ $sql = "SELECT name FROM sysobjects WHERE type = 'U' ORDER BY name";
+ return $this->fetchCol($sql);
+ }
+
+ /**
+ * Returns the column descriptions for a table.
+ *
+ * The return value is an associative array keyed by the column name,
+ * as returned by the RDBMS.
+ *
+ * The value of each array element is an associative array
+ * with the following keys:
+ *
+ * SCHEMA_NAME => string; name of schema
+ * TABLE_NAME => string;
+ * COLUMN_NAME => string; column name
+ * COLUMN_POSITION => number; ordinal position of column in table
+ * DATA_TYPE => string; SQL datatype name of column
+ * DEFAULT => string; default expression of column, null if none
+ * NULLABLE => boolean; true if column can have nulls
+ * LENGTH => number; length of CHAR/VARCHAR
+ * SCALE => number; scale of NUMERIC/DECIMAL
+ * PRECISION => number; precision of NUMERIC/DECIMAL
+ * UNSIGNED => boolean; unsigned property of an integer type
+ * PRIMARY => boolean; true if column is part of the primary key
+ * PRIMARY_POSITION => integer; position of column in primary key
+ * IDENTITY => integer; true if column is auto-generated with unique values
+ *
+ * @todo Discover integer unsigned property.
+ *
+ * @param string $tableName
+ * @param string $schemaName OPTIONAL
+ * @return array
+ */
+ public function describeTable($tableName, $schemaName = null)
+ {
+ /**
+ * Discover metadata information about this table.
+ */
+ $sql = "exec sp_columns @table_name = " . $this->quoteIdentifier($tableName, true);
+ $stmt = $this->query($sql);
+ $result = $stmt->fetchAll(Zend_Db::FETCH_NUM);
+
+ // ZF-7698
+ $stmt->closeCursor();
+
+ if (count($result) == 0) {
+ return array();
+ }
+
+ $owner = 1;
+ $table_name = 2;
+ $column_name = 3;
+ $type_name = 5;
+ $precision = 6;
+ $length = 7;
+ $scale = 8;
+ $nullable = 10;
+ $column_def = 12;
+ $column_position = 16;
+
+ /**
+ * Discover primary key column(s) for this table.
+ */
+ $tableOwner = $result[0][$owner];
+ $sql = "exec sp_pkeys @table_owner = " . $tableOwner
+ . ", @table_name = " . $this->quoteIdentifier($tableName, true);
+ $stmt = $this->query($sql);
+
+ $primaryKeysResult = $stmt->fetchAll(Zend_Db::FETCH_NUM);
+ $primaryKeyColumn = array();
+
+ // Per http://msdn.microsoft.com/en-us/library/ms189813.aspx,
+ // results from sp_keys stored procedure are:
+ // 0=TABLE_QUALIFIER 1=TABLE_OWNER 2=TABLE_NAME 3=COLUMN_NAME 4=KEY_SEQ 5=PK_NAME
+
+ $pkey_column_name = 3;
+ $pkey_key_seq = 4;
+ foreach ($primaryKeysResult as $pkeysRow) {
+ $primaryKeyColumn[$pkeysRow[$pkey_column_name]] = $pkeysRow[$pkey_key_seq];
+ }
+
+ $desc = array();
+ $p = 1;
+ foreach ($result as $key => $row) {
+ $identity = false;
+ $words = explode(' ', $row[$type_name], 2);
+ if (isset($words[0])) {
+ $type = $words[0];
+ if (isset($words[1])) {
+ $identity = (bool) preg_match('/identity/', $words[1]);
+ }
+ }
+
+ $isPrimary = array_key_exists($row[$column_name], $primaryKeyColumn);
+ if ($isPrimary) {
+ $primaryPosition = $primaryKeyColumn[$row[$column_name]];
+ } else {
+ $primaryPosition = null;
+ }
+
+ $desc[$this->foldCase($row[$column_name])] = array(
+ 'SCHEMA_NAME' => null, // @todo
+ 'TABLE_NAME' => $this->foldCase($row[$table_name]),
+ 'COLUMN_NAME' => $this->foldCase($row[$column_name]),
+ 'COLUMN_POSITION' => (int) $row[$column_position],
+ 'DATA_TYPE' => $type,
+ 'DEFAULT' => $row[$column_def],
+ 'NULLABLE' => (bool) $row[$nullable],
+ 'LENGTH' => $row[$length],
+ 'SCALE' => $row[$scale],
+ 'PRECISION' => $row[$precision],
+ 'UNSIGNED' => null, // @todo
+ 'PRIMARY' => $isPrimary,
+ 'PRIMARY_POSITION' => $primaryPosition,
+ 'IDENTITY' => $identity,
+ );
+ }
+
+ return $desc;
+ }
+
+ /**
+ * Leave autocommit mode and begin a transaction.
+ *
+ * @return void
+ * @throws Zend_Db_Adapter_Sqlsrv_Exception
+ */
+ protected function _beginTransaction()
+ {
+ if (!sqlsrv_begin_transaction($this->_connection)) {
+ throw new Zend_Db_Adapter_Sqlsrv_Exception(sqlsrv_errors());
+ }
+ }
+
+ /**
+ * Commit a transaction and return to autocommit mode.
+ *
+ * @return void
+ * @throws Zend_Db_Adapter_Sqlsrv_Exception
+ */
+ protected function _commit()
+ {
+ if (!sqlsrv_commit($this->_connection)) {
+ throw new Zend_Db_Adapter_Sqlsrv_Exception(sqlsrv_errors());
+ }
+ }
+
+ /**
+ * Roll back a transaction and return to autocommit mode.
+ *
+ * @return void
+ * @throws Zend_Db_Adapter_Sqlsrv_Exception
+ */
+ protected function _rollBack()
+ {
+ if (!sqlsrv_rollback($this->_connection)) {
+ throw new Zend_Db_Adapter_Sqlsrv_Exception(sqlsrv_errors());
+ }
+ }
+
+ /**
+ * Set the fetch mode.
+ *
+ * @todo Support FETCH_CLASS and FETCH_INTO.
+ *
+ * @param integer $mode A fetch mode.
+ * @return void
+ * @throws Zend_Db_Adapter_Sqlsrv_Exception
+ */
+ public function setFetchMode($mode)
+ {
+ switch ($mode) {
+ case Zend_Db::FETCH_NUM: // seq array
+ case Zend_Db::FETCH_ASSOC: // assoc array
+ case Zend_Db::FETCH_BOTH: // seq+assoc array
+ case Zend_Db::FETCH_OBJ: // object
+ $this->_fetchMode = $mode;
+ break;
+ case Zend_Db::FETCH_BOUND: // bound to PHP variable
+ throw new Zend_Db_Adapter_Sqlsrv_Exception('FETCH_BOUND is not supported yet');
+ break;
+ default:
+ throw new Zend_Db_Adapter_Sqlsrv_Exception("Invalid fetch mode '$mode' specified");
+ break;
+ }
+ }
+
+ /**
+ * Adds an adapter-specific LIMIT clause to the SELECT statement.
+ *
+ * @param string $sql
+ * @param integer $count
+ * @param integer $offset OPTIONAL
+ * @return string
+ * @throws Zend_Db_Adapter_Sqlsrv_Exception
+ */
+ public function limit($sql, $count, $offset = 0)
+ {
+ $count = intval($count);
+ if ($count <= 0) {
+ throw new Zend_Db_Adapter_Exception("LIMIT argument count=$count is not valid");
+ }
+
+ $offset = intval($offset);
+ if ($offset < 0) {
+ /** @see Zend_Db_Adapter_Exception */
+ throw new Zend_Db_Adapter_Exception("LIMIT argument offset=$offset is not valid");
+ }
+
+ if ($offset == 0) {
+ $sql = preg_replace('/^SELECT\s/i', 'SELECT TOP ' . $count . ' ', $sql);
+ } else {
+ $orderby = stristr($sql, 'ORDER BY');
+
+ if (!$orderby) {
+ $over = 'ORDER BY (SELECT 0)';
+ } else {
+ $over = preg_replace('/\"[^,]*\".\"([^,]*)\"/i', '"inner_tbl"."$1"', $orderby);
+ }
+
+ // Remove ORDER BY clause from $sql
+ $sql = preg_replace('/\s+ORDER BY(.*)/', '', $sql);
+
+ // Add ORDER BY clause as an argument for ROW_NUMBER()
+ $sql = "SELECT ROW_NUMBER() OVER ($over) AS \"ZEND_DB_ROWNUM\", * FROM ($sql) AS inner_tbl";
+
+ $start = $offset + 1;
+
+ if ($count == PHP_INT_MAX) {
+ $sql = "WITH outer_tbl AS ($sql) SELECT * FROM outer_tbl WHERE \"ZEND_DB_ROWNUM\" >= $start";
+ }
+ else {
+ $end = $offset + $count;
+ $sql = "WITH outer_tbl AS ($sql) SELECT * FROM outer_tbl WHERE \"ZEND_DB_ROWNUM\" BETWEEN $start AND $end";
+ }
+ }
+
+ return $sql;
+ }
+
+ /**
+ * Check if the adapter supports real SQL parameters.
+ *
+ * @param string $type 'positional' or 'named'
+ * @return bool
+ */
+ public function supportsParameters($type)
+ {
+ if ($type == 'positional') {
+ return true;
+ }
+
+ // if its 'named' or anything else
+ return false;
+ }
+
+ /**
+ * Retrieve server version in PHP style
+ *
+ * @return string
+ */
+ public function getServerVersion()
+ {
+ $this->_connect();
+ $serverInfo = sqlsrv_server_info($this->_connection);
+
+ if ($serverInfo !== false) {
+ return $serverInfo['SQLServerVersion'];
+ }
+
+ return null;
+ }
+}
diff --git a/library/vendor/Zend/Db/Adapter/Sqlsrv/Exception.php b/library/vendor/Zend/Db/Adapter/Sqlsrv/Exception.php
new file mode 100644
index 0000000..2bbc84d
--- /dev/null
+++ b/library/vendor/Zend/Db/Adapter/Sqlsrv/Exception.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Db_Adapter_Exception
+ */
+
+/**
+ * Zend_Db_Adapter_Sqlsrv_Exception
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Adapter_Sqlsrv_Exception extends Zend_Db_Adapter_Exception
+{
+ /**
+ * Constructor
+ *
+ * If $message is an array, the assumption is that the return value of
+ * sqlsrv_errors() was provided. If so, it then retrieves the most recent
+ * error from that stack, and sets the message and code based on it.
+ *
+ * @param null|array|string $message
+ * @param null|int $code
+ */
+ public function __construct($message = null, $code = 0)
+ {
+ if (is_array($message)) {
+ // Error should be array of errors
+ // We only need first one (?)
+ if (isset($message[0])) {
+ $message = $message[0];
+ }
+
+ $code = (int) $message['code'];
+ $message = (string) $message['message'];
+ }
+ parent::__construct($message, $code, new Exception($message, $code));
+ }
+}
diff --git a/library/vendor/Zend/Db/Exception.php b/library/vendor/Zend/Db/Exception.php
new file mode 100644
index 0000000..837c473
--- /dev/null
+++ b/library/vendor/Zend/Db/Exception.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Exception
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Db
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Exception extends Zend_Exception
+{
+}
diff --git a/library/vendor/Zend/Db/Expr.php b/library/vendor/Zend/Db/Expr.php
new file mode 100644
index 0000000..d8843a4
--- /dev/null
+++ b/library/vendor/Zend/Db/Expr.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Expr
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Class for SQL SELECT fragments.
+ *
+ * This class simply holds a string, so that fragments of SQL statements can be
+ * distinguished from identifiers and values that should be implicitly quoted
+ * when interpolated into SQL statements.
+ *
+ * For example, when specifying a primary key value when inserting into a new
+ * row, some RDBMS brands may require you to use an expression to generate the
+ * new value of a sequence. If this expression is treated as an identifier,
+ * it will be quoted and the expression will not be evaluated. Another example
+ * is that you can use Zend_Db_Expr in the Zend_Db_Select::order() method to
+ * order by an expression instead of simply a column name.
+ *
+ * The way this works is that in each context in which a column name can be
+ * specified to methods of Zend_Db classes, if the value is an instance of
+ * Zend_Db_Expr instead of a plain string, then the expression is not quoted.
+ * If it is a plain string, it is assumed to be a plain column name.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Expr
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Expr
+{
+ /**
+ * Storage for the SQL expression.
+ *
+ * @var string
+ */
+ protected $_expression;
+
+ /**
+ * Instantiate an expression, which is just a string stored as
+ * an instance member variable.
+ *
+ * @param string $expression The string containing a SQL expression.
+ */
+ public function __construct($expression)
+ {
+ $this->_expression = (string) $expression;
+ }
+
+ /**
+ * @return string The string of the SQL expression stored in this object.
+ */
+ public function __toString()
+ {
+ return $this->_expression;
+ }
+
+}
diff --git a/library/vendor/Zend/Db/Profiler.php b/library/vendor/Zend/Db/Profiler.php
new file mode 100644
index 0000000..c80ec5d
--- /dev/null
+++ b/library/vendor/Zend/Db/Profiler.php
@@ -0,0 +1,469 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Profiler
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Profiler
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Profiler
+{
+
+ /**
+ * A connection operation or selecting a database.
+ */
+ const CONNECT = 1;
+
+ /**
+ * Any general database query that does not fit into the other constants.
+ */
+ const QUERY = 2;
+
+ /**
+ * Adding new data to the database, such as SQL's INSERT.
+ */
+ const INSERT = 4;
+
+ /**
+ * Updating existing information in the database, such as SQL's UPDATE.
+ *
+ */
+ const UPDATE = 8;
+
+ /**
+ * An operation related to deleting data in the database,
+ * such as SQL's DELETE.
+ */
+ const DELETE = 16;
+
+ /**
+ * Retrieving information from the database, such as SQL's SELECT.
+ */
+ const SELECT = 32;
+
+ /**
+ * Transactional operation, such as start transaction, commit, or rollback.
+ */
+ const TRANSACTION = 64;
+
+ /**
+ * Inform that a query is stored (in case of filtering)
+ */
+ const STORED = 'stored';
+
+ /**
+ * Inform that a query is ignored (in case of filtering)
+ */
+ const IGNORED = 'ignored';
+
+ /**
+ * Array of Zend_Db_Profiler_Query objects.
+ *
+ * @var array
+ */
+ protected $_queryProfiles = array();
+
+ /**
+ * Stores enabled state of the profiler. If set to False, calls to
+ * queryStart() will simply be ignored.
+ *
+ * @var boolean
+ */
+ protected $_enabled = false;
+
+ /**
+ * Stores the number of seconds to filter. NULL if filtering by time is
+ * disabled. If an integer is stored here, profiles whose elapsed time
+ * is less than this value in seconds will be unset from
+ * the self::$_queryProfiles array.
+ *
+ * @var integer
+ */
+ protected $_filterElapsedSecs = null;
+
+ /**
+ * Logical OR of any of the filter constants. NULL if filtering by query
+ * type is disable. If an integer is stored here, it is the logical OR of
+ * any of the query type constants. When the query ends, if it is not
+ * one of the types specified, it will be unset from the
+ * self::$_queryProfiles array.
+ *
+ * @var integer
+ */
+ protected $_filterTypes = null;
+
+ /**
+ * Class constructor. The profiler is disabled by default unless it is
+ * specifically enabled by passing in $enabled here or calling setEnabled().
+ *
+ * @param boolean $enabled
+ * @return void
+ */
+ public function __construct($enabled = false)
+ {
+ $this->setEnabled($enabled);
+ }
+
+ /**
+ * Enable or disable the profiler. If $enable is false, the profiler
+ * is disabled and will not log any queries sent to it.
+ *
+ * @param boolean $enable
+ * @return Zend_Db_Profiler Provides a fluent interface
+ */
+ public function setEnabled($enable)
+ {
+ $this->_enabled = (boolean) $enable;
+
+ return $this;
+ }
+
+ /**
+ * Get the current state of enable. If True is returned,
+ * the profiler is enabled.
+ *
+ * @return boolean
+ */
+ public function getEnabled()
+ {
+ return $this->_enabled;
+ }
+
+ /**
+ * Sets a minimum number of seconds for saving query profiles. If this
+ * is set, only those queries whose elapsed time is equal or greater than
+ * $minimumSeconds will be saved. To save all queries regardless of
+ * elapsed time, set $minimumSeconds to null.
+ *
+ * @param integer $minimumSeconds OPTIONAL
+ * @return Zend_Db_Profiler Provides a fluent interface
+ */
+ public function setFilterElapsedSecs($minimumSeconds = null)
+ {
+ if (null === $minimumSeconds) {
+ $this->_filterElapsedSecs = null;
+ } else {
+ $this->_filterElapsedSecs = (integer) $minimumSeconds;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns the minimum number of seconds for saving query profiles, or null if
+ * query profiles are saved regardless of elapsed time.
+ *
+ * @return integer|null
+ */
+ public function getFilterElapsedSecs()
+ {
+ return $this->_filterElapsedSecs;
+ }
+
+ /**
+ * Sets the types of query profiles to save. Set $queryType to one of
+ * the Zend_Db_Profiler::* constants to only save profiles for that type of
+ * query. To save more than one type, logical OR them together. To
+ * save all queries regardless of type, set $queryType to null.
+ *
+ * @param integer $queryTypes OPTIONAL
+ * @return Zend_Db_Profiler Provides a fluent interface
+ */
+ public function setFilterQueryType($queryTypes = null)
+ {
+ $this->_filterTypes = $queryTypes;
+
+ return $this;
+ }
+
+ /**
+ * Returns the types of query profiles saved, or null if queries are saved regardless
+ * of their types.
+ *
+ * @return integer|null
+ * @see Zend_Db_Profiler::setFilterQueryType()
+ */
+ public function getFilterQueryType()
+ {
+ return $this->_filterTypes;
+ }
+
+ /**
+ * Clears the history of any past query profiles. This is relentless
+ * and will even clear queries that were started and may not have
+ * been marked as ended.
+ *
+ * @return Zend_Db_Profiler Provides a fluent interface
+ */
+ public function clear()
+ {
+ $this->_queryProfiles = array();
+
+ return $this;
+ }
+
+ /**
+ * Clone a profiler query
+ *
+ * @param Zend_Db_Profiler_Query $query
+ * @return integer or null
+ */
+ public function queryClone(Zend_Db_Profiler_Query $query)
+ {
+ $this->_queryProfiles[] = clone $query;
+
+ end($this->_queryProfiles);
+
+ return key($this->_queryProfiles);
+ }
+
+ /**
+ * Starts a query. Creates a new query profile object (Zend_Db_Profiler_Query)
+ * and returns the "query profiler handle". Run the query, then call
+ * queryEnd() and pass it this handle to make the query as ended and
+ * record the time. If the profiler is not enabled, this takes no
+ * action and immediately returns null.
+ *
+ * @param string $queryText SQL statement
+ * @param integer $queryType OPTIONAL Type of query, one of the Zend_Db_Profiler::* constants
+ * @return integer|null
+ */
+ public function queryStart($queryText, $queryType = null)
+ {
+ if (!$this->_enabled) {
+ return null;
+ }
+
+ // make sure we have a query type
+ if (null === $queryType) {
+ switch (strtolower(substr(ltrim($queryText), 0, 6))) {
+ case 'insert':
+ $queryType = self::INSERT;
+ break;
+ case 'update':
+ $queryType = self::UPDATE;
+ break;
+ case 'delete':
+ $queryType = self::DELETE;
+ break;
+ case 'select':
+ $queryType = self::SELECT;
+ break;
+ default:
+ $queryType = self::QUERY;
+ break;
+ }
+ }
+
+ /**
+ * @see Zend_Db_Profiler_Query
+ */
+ $this->_queryProfiles[] = new Zend_Db_Profiler_Query($queryText, $queryType);
+
+ end($this->_queryProfiles);
+
+ return key($this->_queryProfiles);
+ }
+
+ /**
+ * Ends a query. Pass it the handle that was returned by queryStart().
+ * This will mark the query as ended and save the time.
+ *
+ * @param integer $queryId
+ * @throws Zend_Db_Profiler_Exception
+ * @return string Inform that a query is stored or ignored.
+ */
+ public function queryEnd($queryId)
+ {
+ // Don't do anything if the Zend_Db_Profiler is not enabled.
+ if (!$this->_enabled) {
+ return self::IGNORED;
+ }
+
+ // Check for a valid query handle.
+ if (!isset($this->_queryProfiles[$queryId])) {
+ /**
+ * @see Zend_Db_Profiler_Exception
+ */
+ throw new Zend_Db_Profiler_Exception("Profiler has no query with handle '$queryId'.");
+ }
+
+ $qp = $this->_queryProfiles[$queryId];
+
+ // Ensure that the query profile has not already ended
+ if ($qp->hasEnded()) {
+ /**
+ * @see Zend_Db_Profiler_Exception
+ */
+ throw new Zend_Db_Profiler_Exception("Query with profiler handle '$queryId' has already ended.");
+ }
+
+ // End the query profile so that the elapsed time can be calculated.
+ $qp->end();
+
+ /**
+ * If filtering by elapsed time is enabled, only keep the profile if
+ * it ran for the minimum time.
+ */
+ if (null !== $this->_filterElapsedSecs && $qp->getElapsedSecs() < $this->_filterElapsedSecs) {
+ unset($this->_queryProfiles[$queryId]);
+ return self::IGNORED;
+ }
+
+ /**
+ * If filtering by query type is enabled, only keep the query if
+ * it was one of the allowed types.
+ */
+ if (null !== $this->_filterTypes && !($qp->getQueryType() & $this->_filterTypes)) {
+ unset($this->_queryProfiles[$queryId]);
+ return self::IGNORED;
+ }
+
+ return self::STORED;
+ }
+
+ /**
+ * Get a profile for a query. Pass it the same handle that was returned
+ * by queryStart() and it will return a Zend_Db_Profiler_Query object.
+ *
+ * @param integer $queryId
+ * @throws Zend_Db_Profiler_Exception
+ * @return Zend_Db_Profiler_Query
+ */
+ public function getQueryProfile($queryId)
+ {
+ if (!array_key_exists($queryId, $this->_queryProfiles)) {
+ /**
+ * @see Zend_Db_Profiler_Exception
+ */
+ throw new Zend_Db_Profiler_Exception("Query handle '$queryId' not found in profiler log.");
+ }
+
+ return $this->_queryProfiles[$queryId];
+ }
+
+ /**
+ * Get an array of query profiles (Zend_Db_Profiler_Query objects). If $queryType
+ * is set to one of the Zend_Db_Profiler::* constants then only queries of that
+ * type will be returned. Normally, queries that have not yet ended will
+ * not be returned unless $showUnfinished is set to True. If no
+ * queries were found, False is returned. The returned array is indexed by the query
+ * profile handles.
+ *
+ * @param integer $queryType
+ * @param boolean $showUnfinished
+ * @return array|false
+ */
+ public function getQueryProfiles($queryType = null, $showUnfinished = false)
+ {
+ $queryProfiles = array();
+ foreach ($this->_queryProfiles as $key => $qp) {
+ if ($queryType === null) {
+ $condition = true;
+ } else {
+ $condition = ($qp->getQueryType() & $queryType);
+ }
+
+ if (($qp->hasEnded() || $showUnfinished) && $condition) {
+ $queryProfiles[$key] = $qp;
+ }
+ }
+
+ if (empty($queryProfiles)) {
+ $queryProfiles = false;
+ }
+
+ return $queryProfiles;
+ }
+
+ /**
+ * Get the total elapsed time (in seconds) of all of the profiled queries.
+ * Only queries that have ended will be counted. If $queryType is set to
+ * one or more of the Zend_Db_Profiler::* constants, the elapsed time will be calculated
+ * only for queries of the given type(s).
+ *
+ * @param integer $queryType OPTIONAL
+ * @return float
+ */
+ public function getTotalElapsedSecs($queryType = null)
+ {
+ $elapsedSecs = 0;
+ foreach ($this->_queryProfiles as $key => $qp) {
+ if (null === $queryType) {
+ $condition = true;
+ } else {
+ $condition = ($qp->getQueryType() & $queryType);
+ }
+ if (($qp->hasEnded()) && $condition) {
+ $elapsedSecs += $qp->getElapsedSecs();
+ }
+ }
+ return $elapsedSecs;
+ }
+
+ /**
+ * Get the total number of queries that have been profiled. Only queries that have ended will
+ * be counted. If $queryType is set to one of the Zend_Db_Profiler::* constants, only queries of
+ * that type will be counted.
+ *
+ * @param integer $queryType OPTIONAL
+ * @return integer
+ */
+ public function getTotalNumQueries($queryType = null)
+ {
+ if (null === $queryType) {
+ return count($this->_queryProfiles);
+ }
+
+ $numQueries = 0;
+ foreach ($this->_queryProfiles as $qp) {
+ if ($qp->hasEnded() && ($qp->getQueryType() & $queryType)) {
+ $numQueries++;
+ }
+ }
+
+ return $numQueries;
+ }
+
+ /**
+ * Get the Zend_Db_Profiler_Query object for the last query that was run, regardless if it has
+ * ended or not. If the query has not ended, its end time will be null. If no queries have
+ * been profiled, false is returned.
+ *
+ * @return Zend_Db_Profiler_Query|false
+ */
+ public function getLastQueryProfile()
+ {
+ if (empty($this->_queryProfiles)) {
+ return false;
+ }
+
+ end($this->_queryProfiles);
+
+ return current($this->_queryProfiles);
+ }
+
+}
+
diff --git a/library/vendor/Zend/Db/Profiler/Exception.php b/library/vendor/Zend/Db/Profiler/Exception.php
new file mode 100644
index 0000000..c2f76fa
--- /dev/null
+++ b/library/vendor/Zend/Db/Profiler/Exception.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Profiler
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Db_Exception
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Profiler
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Profiler_Exception extends Zend_Db_Exception
+{
+}
+
diff --git a/library/vendor/Zend/Db/Profiler/Query.php b/library/vendor/Zend/Db/Profiler/Query.php
new file mode 100644
index 0000000..97a7fef
--- /dev/null
+++ b/library/vendor/Zend/Db/Profiler/Query.php
@@ -0,0 +1,213 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Profiler
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Profiler
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Profiler_Query
+{
+
+ /**
+ * SQL query string or user comment, set by $query argument in constructor.
+ *
+ * @var string
+ */
+ protected $_query = '';
+
+ /**
+ * One of the Zend_Db_Profiler constants for query type, set by $queryType argument in constructor.
+ *
+ * @var integer
+ */
+ protected $_queryType = 0;
+
+ /**
+ * Unix timestamp with microseconds when instantiated.
+ *
+ * @var float
+ */
+ protected $_startedMicrotime = null;
+
+ /**
+ * Unix timestamp with microseconds when self::queryEnd() was called.
+ *
+ * @var integer
+ */
+ protected $_endedMicrotime = null;
+
+ /**
+ * @var array
+ */
+ protected $_boundParams = array();
+
+ /**
+ * @var array
+ */
+
+ /**
+ * Class constructor. A query is about to be started, save the query text ($query) and its
+ * type (one of the Zend_Db_Profiler::* constants).
+ *
+ * @param string $query
+ * @param integer $queryType
+ * @return void
+ */
+ public function __construct($query, $queryType)
+ {
+ $this->_query = $query;
+ $this->_queryType = $queryType;
+ // by default, and for backward-compatibility, start the click ticking
+ $this->start();
+ }
+
+ /**
+ * Clone handler for the query object.
+ * @return void
+ */
+ public function __clone()
+ {
+ $this->_boundParams = array();
+ $this->_endedMicrotime = null;
+ $this->start();
+ }
+
+ /**
+ * Starts the elapsed time click ticking.
+ * This can be called subsequent to object creation,
+ * to restart the clock. For instance, this is useful
+ * right before executing a prepared query.
+ *
+ * @return void
+ */
+ public function start()
+ {
+ $this->_startedMicrotime = microtime(true);
+ }
+
+ /**
+ * Ends the query and records the time so that the elapsed time can be determined later.
+ *
+ * @return void
+ */
+ public function end()
+ {
+ $this->_endedMicrotime = microtime(true);
+ }
+
+ /**
+ * Returns true if and only if the query has ended.
+ *
+ * @return boolean
+ */
+ public function hasEnded()
+ {
+ return $this->_endedMicrotime !== null;
+ }
+
+ /**
+ * Get the original SQL text of the query.
+ *
+ * @return string
+ */
+ public function getQuery()
+ {
+ return $this->_query;
+ }
+
+ /**
+ * Get the type of this query (one of the Zend_Db_Profiler::* constants)
+ *
+ * @return integer
+ */
+ public function getQueryType()
+ {
+ return $this->_queryType;
+ }
+
+ /**
+ * @param string $param
+ * @param mixed $variable
+ * @return void
+ */
+ public function bindParam($param, $variable)
+ {
+ $this->_boundParams[$param] = $variable;
+ }
+
+ /**
+ * @param array $param
+ * @return void
+ */
+ public function bindParams(array $params)
+ {
+ if (array_key_exists(0, $params)) {
+ array_unshift($params, null);
+ unset($params[0]);
+ }
+ foreach ($params as $param => $value) {
+ $this->bindParam($param, $value);
+ }
+ }
+
+ /**
+ * @return array
+ */
+ public function getQueryParams()
+ {
+ return $this->_boundParams;
+ }
+
+ /**
+ * Get the elapsed time (in seconds) that the query ran.
+ * If the query has not yet ended, false is returned.
+ *
+ * @return float|false
+ */
+ public function getElapsedSecs()
+ {
+ if (null === $this->_endedMicrotime) {
+ return false;
+ }
+
+ return $this->_endedMicrotime - $this->_startedMicrotime;
+ }
+
+ /**
+ * Get the time (in seconds) when the profiler started running.
+ *
+ * @return bool|float
+ */
+ public function getStartedMicrotime()
+ {
+ if(null === $this->_startedMicrotime) {
+ return false;
+ }
+
+ return $this->_startedMicrotime;
+ }
+}
+
diff --git a/library/vendor/Zend/Db/Select.php b/library/vendor/Zend/Db/Select.php
new file mode 100644
index 0000000..64908e3
--- /dev/null
+++ b/library/vendor/Zend/Db/Select.php
@@ -0,0 +1,1368 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Select
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Db_Adapter_Abstract
+ */
+
+/**
+ * @see Zend_Db_Expr
+ */
+
+
+/**
+ * Class for SQL SELECT generation and results.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Select
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Select
+{
+
+ const DISTINCT = 'distinct';
+ const COLUMNS = 'columns';
+ const FROM = 'from';
+ const UNION = 'union';
+ const WHERE = 'where';
+ const GROUP = 'group';
+ const HAVING = 'having';
+ const ORDER = 'order';
+ const LIMIT_COUNT = 'limitcount';
+ const LIMIT_OFFSET = 'limitoffset';
+ const FOR_UPDATE = 'forupdate';
+
+ const INNER_JOIN = 'inner join';
+ const LEFT_JOIN = 'left join';
+ const RIGHT_JOIN = 'right join';
+ const FULL_JOIN = 'full join';
+ const CROSS_JOIN = 'cross join';
+ const NATURAL_JOIN = 'natural join';
+
+ const SQL_WILDCARD = '*';
+ const SQL_SELECT = 'SELECT';
+ const SQL_UNION = 'UNION';
+ const SQL_UNION_ALL = 'UNION ALL';
+ const SQL_FROM = 'FROM';
+ const SQL_WHERE = 'WHERE';
+ const SQL_DISTINCT = 'DISTINCT';
+ const SQL_GROUP_BY = 'GROUP BY';
+ const SQL_ORDER_BY = 'ORDER BY';
+ const SQL_HAVING = 'HAVING';
+ const SQL_FOR_UPDATE = 'FOR UPDATE';
+ const SQL_AND = 'AND';
+ const SQL_AS = 'AS';
+ const SQL_OR = 'OR';
+ const SQL_ON = 'ON';
+ const SQL_ASC = 'ASC';
+ const SQL_DESC = 'DESC';
+
+ const REGEX_COLUMN_EXPR = '/^([\w]*\s*\(([^\(\)]|(?1))*\))$/';
+ const REGEX_COLUMN_EXPR_ORDER = '/^([\w]+\s*\(([^\(\)]|(?1))*\))$/';
+ const REGEX_COLUMN_EXPR_GROUP = '/^([\w]+\s*\(([^\(\)]|(?1))*\))$/';
+
+ // @see http://stackoverflow.com/a/13823184/2028814
+ const REGEX_SQL_COMMENTS = '@
+ (([\'"]).*?[^\\\]\2) # $1 : Skip single & double quoted expressions
+ |( # $3 : Match comments
+ (?:\#|--).*?$ # - Single line comments
+ | # - Multi line (nested) comments
+ /\* # . comment open marker
+ (?: [^/*] # . non comment-marker characters
+ |/(?!\*) # . ! not a comment open
+ |\*(?!/) # . ! not a comment close
+ |(?R) # . recursive case
+ )* # . repeat eventually
+ \*\/ # . comment close marker
+ )\s* # Trim after comments
+ |(?<=;)\s+ # Trim after semi-colon
+ @msx';
+
+ /**
+ * Bind variables for query
+ *
+ * @var array
+ */
+ protected $_bind = array();
+
+ /**
+ * Zend_Db_Adapter_Abstract object.
+ *
+ * @var Zend_Db_Adapter_Abstract
+ */
+ protected $_adapter;
+
+ /**
+ * The initial values for the $_parts array.
+ * NOTE: It is important for the 'FOR_UPDATE' part to be last to ensure
+ * meximum compatibility with database adapters.
+ *
+ * @var array
+ */
+ protected static $_partsInit = array(
+ self::DISTINCT => false,
+ self::COLUMNS => array(),
+ self::UNION => array(),
+ self::FROM => array(),
+ self::WHERE => array(),
+ self::GROUP => array(),
+ self::HAVING => array(),
+ self::ORDER => array(),
+ self::LIMIT_COUNT => null,
+ self::LIMIT_OFFSET => null,
+ self::FOR_UPDATE => false
+ );
+
+ /**
+ * Specify legal join types.
+ *
+ * @var array
+ */
+ protected static $_joinTypes = array(
+ self::INNER_JOIN,
+ self::LEFT_JOIN,
+ self::RIGHT_JOIN,
+ self::FULL_JOIN,
+ self::CROSS_JOIN,
+ self::NATURAL_JOIN,
+ );
+
+ /**
+ * Specify legal union types.
+ *
+ * @var array
+ */
+ protected static $_unionTypes = array(
+ self::SQL_UNION,
+ self::SQL_UNION_ALL
+ );
+
+ /**
+ * The component parts of a SELECT statement.
+ * Initialized to the $_partsInit array in the constructor.
+ *
+ * @var array
+ */
+ protected $_parts = array();
+
+ /**
+ * Tracks which columns are being select from each table and join.
+ *
+ * @var array
+ */
+ protected $_tableCols = array();
+
+ /**
+ * Class constructor
+ *
+ * @param Zend_Db_Adapter_Abstract $adapter
+ */
+ public function __construct(Zend_Db_Adapter_Abstract $adapter)
+ {
+ $this->_adapter = $adapter;
+ $this->_parts = self::$_partsInit;
+ }
+
+ /**
+ * Get bind variables
+ *
+ * @return array
+ */
+ public function getBind()
+ {
+ return $this->_bind;
+ }
+
+ /**
+ * Set bind variables
+ *
+ * @param mixed $bind
+ * @return Zend_Db_Select
+ */
+ public function bind($bind)
+ {
+ $this->_bind = $bind;
+
+ return $this;
+ }
+
+ /**
+ * Makes the query SELECT DISTINCT.
+ *
+ * @param bool $flag Whether or not the SELECT is DISTINCT (default true).
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function distinct($flag = true)
+ {
+ $this->_parts[self::DISTINCT] = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Adds a FROM table and optional columns to the query.
+ *
+ * The first parameter $name can be a simple string, in which case the
+ * correlation name is generated automatically. If you want to specify
+ * the correlation name, the first parameter must be an associative
+ * array in which the key is the correlation name, and the value is
+ * the physical table name. For example, array('alias' => 'table').
+ * The correlation name is prepended to all columns fetched for this
+ * table.
+ *
+ * The second parameter can be a single string or Zend_Db_Expr object,
+ * or else an array of strings or Zend_Db_Expr objects.
+ *
+ * The first parameter can be null or an empty string, in which case
+ * no correlation name is generated or prepended to the columns named
+ * in the second parameter.
+ *
+ * @param array|string|Zend_Db_Expr $name The table name or an associative array
+ * relating correlation name to table name.
+ * @param array|string|Zend_Db_Expr $cols The columns to select from this table.
+ * @param string $schema The schema name to specify, if any.
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function from($name, $cols = '*', $schema = null)
+ {
+ return $this->_join(self::FROM, $name, null, $cols, $schema);
+ }
+
+ /**
+ * Specifies the columns used in the FROM clause.
+ *
+ * The parameter can be a single string or Zend_Db_Expr object,
+ * or else an array of strings or Zend_Db_Expr objects.
+ *
+ * @param array|string|Zend_Db_Expr $cols The columns to select from this table.
+ * @param string $correlationName Correlation name of target table. OPTIONAL
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function columns($cols = '*', $correlationName = null)
+ {
+ if ($correlationName === null && count($this->_parts[self::FROM])) {
+ $correlationNameKeys = array_keys($this->_parts[self::FROM]);
+ $correlationName = current($correlationNameKeys);
+ }
+
+ if (!array_key_exists($correlationName, $this->_parts[self::FROM])) {
+ /**
+ * @see Zend_Db_Select_Exception
+ */
+ throw new Zend_Db_Select_Exception("No table has been specified for the FROM clause");
+ }
+
+ $this->_tableCols($correlationName, $cols);
+
+ return $this;
+ }
+
+ /**
+ * Adds a UNION clause to the query.
+ *
+ * The first parameter has to be an array of Zend_Db_Select or
+ * sql query strings.
+ *
+ * <code>
+ * $sql1 = $db->select();
+ * $sql2 = "SELECT ...";
+ * $select = $db->select()
+ * ->union(array($sql1, $sql2))
+ * ->order("id");
+ * </code>
+ *
+ * @param array $select Array of select clauses for the union.
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function union($select = array(), $type = self::SQL_UNION)
+ {
+ if (!is_array($select)) {
+ throw new Zend_Db_Select_Exception(
+ "union() only accepts an array of Zend_Db_Select instances of sql query strings."
+ );
+ }
+
+ if (!in_array($type, self::$_unionTypes)) {
+ throw new Zend_Db_Select_Exception("Invalid union type '{$type}'");
+ }
+
+ foreach ($select as $target) {
+ $this->_parts[self::UNION][] = array($target, $type);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Adds a JOIN table and columns to the query.
+ *
+ * The $name and $cols parameters follow the same logic
+ * as described in the from() method.
+ *
+ * @param array|string|Zend_Db_Expr $name The table name.
+ * @param string $cond Join on this condition.
+ * @param array|string $cols The columns to select from the joined table.
+ * @param string $schema The database name to specify, if any.
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function join($name, $cond, $cols = self::SQL_WILDCARD, $schema = null)
+ {
+ return $this->joinInner($name, $cond, $cols, $schema);
+ }
+
+ /**
+ * Add an INNER JOIN table and colums to the query
+ * Rows in both tables are matched according to the expression
+ * in the $cond argument. The result set is comprised
+ * of all cases where rows from the left table match
+ * rows from the right table.
+ *
+ * The $name and $cols parameters follow the same logic
+ * as described in the from() method.
+ *
+ * @param array|string|Zend_Db_Expr $name The table name.
+ * @param string $cond Join on this condition.
+ * @param array|string $cols The columns to select from the joined table.
+ * @param string $schema The database name to specify, if any.
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function joinInner($name, $cond, $cols = self::SQL_WILDCARD, $schema = null)
+ {
+ return $this->_join(self::INNER_JOIN, $name, $cond, $cols, $schema);
+ }
+
+ /**
+ * Add a LEFT OUTER JOIN table and colums to the query
+ * All rows from the left operand table are included,
+ * matching rows from the right operand table included,
+ * and the columns from the right operand table are filled
+ * with NULLs if no row exists matching the left table.
+ *
+ * The $name and $cols parameters follow the same logic
+ * as described in the from() method.
+ *
+ * @param array|string|Zend_Db_Expr $name The table name.
+ * @param string $cond Join on this condition.
+ * @param array|string $cols The columns to select from the joined table.
+ * @param string $schema The database name to specify, if any.
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function joinLeft($name, $cond, $cols = self::SQL_WILDCARD, $schema = null)
+ {
+ return $this->_join(self::LEFT_JOIN, $name, $cond, $cols, $schema);
+ }
+
+ /**
+ * Add a RIGHT OUTER JOIN table and colums to the query.
+ * Right outer join is the complement of left outer join.
+ * All rows from the right operand table are included,
+ * matching rows from the left operand table included,
+ * and the columns from the left operand table are filled
+ * with NULLs if no row exists matching the right table.
+ *
+ * The $name and $cols parameters follow the same logic
+ * as described in the from() method.
+ *
+ * @param array|string|Zend_Db_Expr $name The table name.
+ * @param string $cond Join on this condition.
+ * @param array|string $cols The columns to select from the joined table.
+ * @param string $schema The database name to specify, if any.
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function joinRight($name, $cond, $cols = self::SQL_WILDCARD, $schema = null)
+ {
+ return $this->_join(self::RIGHT_JOIN, $name, $cond, $cols, $schema);
+ }
+
+ /**
+ * Add a FULL OUTER JOIN table and colums to the query.
+ * A full outer join is like combining a left outer join
+ * and a right outer join. All rows from both tables are
+ * included, paired with each other on the same row of the
+ * result set if they satisfy the join condition, and otherwise
+ * paired with NULLs in place of columns from the other table.
+ *
+ * The $name and $cols parameters follow the same logic
+ * as described in the from() method.
+ *
+ * @param array|string|Zend_Db_Expr $name The table name.
+ * @param string $cond Join on this condition.
+ * @param array|string $cols The columns to select from the joined table.
+ * @param string $schema The database name to specify, if any.
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function joinFull($name, $cond, $cols = self::SQL_WILDCARD, $schema = null)
+ {
+ return $this->_join(self::FULL_JOIN, $name, $cond, $cols, $schema);
+ }
+
+ /**
+ * Add a CROSS JOIN table and colums to the query.
+ * A cross join is a cartesian product; there is no join condition.
+ *
+ * The $name and $cols parameters follow the same logic
+ * as described in the from() method.
+ *
+ * @param array|string|Zend_Db_Expr $name The table name.
+ * @param array|string $cols The columns to select from the joined table.
+ * @param string $schema The database name to specify, if any.
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function joinCross($name, $cols = self::SQL_WILDCARD, $schema = null)
+ {
+ return $this->_join(self::CROSS_JOIN, $name, null, $cols, $schema);
+ }
+
+ /**
+ * Add a NATURAL JOIN table and colums to the query.
+ * A natural join assumes an equi-join across any column(s)
+ * that appear with the same name in both tables.
+ * Only natural inner joins are supported by this API,
+ * even though SQL permits natural outer joins as well.
+ *
+ * The $name and $cols parameters follow the same logic
+ * as described in the from() method.
+ *
+ * @param array|string|Zend_Db_Expr $name The table name.
+ * @param array|string $cols The columns to select from the joined table.
+ * @param string $schema The database name to specify, if any.
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function joinNatural($name, $cols = self::SQL_WILDCARD, $schema = null)
+ {
+ return $this->_join(self::NATURAL_JOIN, $name, null, $cols, $schema);
+ }
+
+ /**
+ * Adds a WHERE condition to the query by AND.
+ *
+ * If a value is passed as the second param, it will be quoted
+ * and replaced into the condition wherever a question-mark
+ * appears. Array values are quoted and comma-separated.
+ *
+ * <code>
+ * // simplest but non-secure
+ * $select->where("id = $id");
+ *
+ * // secure (ID is quoted but matched anyway)
+ * $select->where('id = ?', $id);
+ *
+ * // alternatively, with named binding
+ * $select->where('id = :id');
+ * </code>
+ *
+ * Note that it is more correct to use named bindings in your
+ * queries for values other than strings. When you use named
+ * bindings, don't forget to pass the values when actually
+ * making a query:
+ *
+ * <code>
+ * $db->fetchAll($select, array('id' => 5));
+ * </code>
+ *
+ * @param string $cond The WHERE condition.
+ * @param mixed $value OPTIONAL The value to quote into the condition.
+ * @param int $type OPTIONAL The type of the given value
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function where($cond, $value = null, $type = null)
+ {
+ $this->_parts[self::WHERE][] = $this->_where($cond, $value, $type, true);
+
+ return $this;
+ }
+
+ /**
+ * Adds a WHERE condition to the query by OR.
+ *
+ * Otherwise identical to where().
+ *
+ * @param string $cond The WHERE condition.
+ * @param mixed $value OPTIONAL The value to quote into the condition.
+ * @param int $type OPTIONAL The type of the given value
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ *
+ * @see where()
+ */
+ public function orWhere($cond, $value = null, $type = null)
+ {
+ $this->_parts[self::WHERE][] = $this->_where($cond, $value, $type, false);
+
+ return $this;
+ }
+
+ /**
+ * Adds grouping to the query.
+ *
+ * @param array|string $spec The column(s) to group by.
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function group($spec)
+ {
+ if (!is_array($spec)) {
+ $spec = array($spec);
+ }
+
+ foreach ($spec as $val) {
+ // Remove comments from SQL statement
+ $noComments = preg_replace(self::REGEX_SQL_COMMENTS, '$1', (string) $val);
+ if (preg_match(self::REGEX_COLUMN_EXPR_GROUP, $noComments)) {
+ $val = new Zend_Db_Expr($val);
+ }
+ $this->_parts[self::GROUP][] = $val;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Adds a HAVING condition to the query by AND.
+ *
+ * If a value is passed as the second param, it will be quoted
+ * and replaced into the condition wherever a question-mark
+ * appears. See {@link where()} for an example
+ *
+ * @param string $cond The HAVING condition.
+ * @param mixed $value OPTIONAL The value to quote into the condition.
+ * @param int $type OPTIONAL The type of the given value
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function having($cond, $value = null, $type = null)
+ {
+ if ($value !== null) {
+ $cond = $this->_adapter->quoteInto($cond, $value, $type);
+ }
+
+ if ($this->_parts[self::HAVING]) {
+ $this->_parts[self::HAVING][] = self::SQL_AND . " ($cond)";
+ } else {
+ $this->_parts[self::HAVING][] = "($cond)";
+ }
+
+ return $this;
+ }
+
+ /**
+ * Adds a HAVING condition to the query by OR.
+ *
+ * Otherwise identical to orHaving().
+ *
+ * @param string $cond The HAVING condition.
+ * @param mixed $value OPTIONAL The value to quote into the condition.
+ * @param int $type OPTIONAL The type of the given value
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ *
+ * @see having()
+ */
+ public function orHaving($cond, $value = null, $type = null)
+ {
+ if ($value !== null) {
+ $cond = $this->_adapter->quoteInto($cond, $value, $type);
+ }
+
+ if ($this->_parts[self::HAVING]) {
+ $this->_parts[self::HAVING][] = self::SQL_OR . " ($cond)";
+ } else {
+ $this->_parts[self::HAVING][] = "($cond)";
+ }
+
+ return $this;
+ }
+
+ /**
+ * Adds a row order to the query.
+ *
+ * @param mixed $spec The column(s) and direction to order by.
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function order($spec)
+ {
+ if (!is_array($spec)) {
+ $spec = array($spec);
+ }
+
+ // force 'ASC' or 'DESC' on each order spec, default is ASC.
+ foreach ($spec as $val) {
+ if ($val instanceof Zend_Db_Expr) {
+ $expr = $val->__toString();
+ if (empty($expr)) {
+ continue;
+ }
+ $this->_parts[self::ORDER][] = $val;
+ } else {
+ if (empty($val)) {
+ continue;
+ }
+ $direction = self::SQL_ASC;
+ if (preg_match('/(.*\W)(' . self::SQL_ASC . '|' . self::SQL_DESC . ')\b/si', $val, $matches)) {
+ $val = trim($matches[1]);
+ $direction = $matches[2];
+ }
+ // Remove comments from SQL statement
+ $noComments = preg_replace(self::REGEX_SQL_COMMENTS, '$1', (string) $val);
+ if (preg_match(self::REGEX_COLUMN_EXPR_ORDER, $noComments)) {
+ $val = new Zend_Db_Expr($val);
+ }
+ $this->_parts[self::ORDER][] = array($val, $direction);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Sets a limit count and offset to the query.
+ *
+ * @param int $count OPTIONAL The number of rows to return.
+ * @param int $offset OPTIONAL Start returning after this many rows.
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function limit($count = null, $offset = null)
+ {
+ $this->_parts[self::LIMIT_COUNT] = (int) $count;
+ $this->_parts[self::LIMIT_OFFSET] = (int) $offset;
+ return $this;
+ }
+
+ /**
+ * Sets the limit and count by page number.
+ *
+ * @param int $page Limit results to this page number.
+ * @param int $rowCount Use this many rows per page.
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function limitPage($page, $rowCount)
+ {
+ $page = ($page > 0) ? $page : 1;
+ $rowCount = ($rowCount > 0) ? $rowCount : 1;
+ $this->_parts[self::LIMIT_COUNT] = (int) $rowCount;
+ $this->_parts[self::LIMIT_OFFSET] = (int) $rowCount * ($page - 1);
+ return $this;
+ }
+
+ /**
+ * Makes the query SELECT FOR UPDATE.
+ *
+ * @param bool $flag Whether or not the SELECT is FOR UPDATE (default true).
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function forUpdate($flag = true)
+ {
+ $this->_parts[self::FOR_UPDATE] = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Get part of the structured information for the current query.
+ *
+ * @param string $part
+ * @return mixed
+ * @throws Zend_Db_Select_Exception
+ */
+ public function getPart($part)
+ {
+ $part = strtolower($part);
+ if (!array_key_exists($part, $this->_parts)) {
+ throw new Zend_Db_Select_Exception("Invalid Select part '$part'");
+ }
+ return $this->_parts[$part];
+ }
+
+ /**
+ * Executes the current select object and returns the result
+ *
+ * @param integer $fetchMode OPTIONAL
+ * @param mixed $bind An array of data to bind to the placeholders.
+ * @return PDO_Statement|Zend_Db_Statement
+ */
+ public function query($fetchMode = null, $bind = array())
+ {
+ if (!empty($bind)) {
+ $this->bind($bind);
+ }
+
+ $stmt = $this->_adapter->query($this);
+ if ($fetchMode == null) {
+ $fetchMode = $this->_adapter->getFetchMode();
+ }
+ $stmt->setFetchMode($fetchMode);
+ return $stmt;
+ }
+
+ /**
+ * Converts this object to an SQL SELECT string.
+ *
+ * @return string|null This object as a SELECT string. (or null if a string cannot be produced.)
+ */
+ public function assemble()
+ {
+ $sql = self::SQL_SELECT;
+ foreach (array_keys(self::$_partsInit) as $part) {
+ $method = '_render' . ucfirst($part);
+ if (method_exists($this, $method)) {
+ $sql = $this->$method($sql);
+ }
+ }
+ return $sql;
+ }
+
+ /**
+ * Clear parts of the Select object, or an individual part.
+ *
+ * @param string $part OPTIONAL
+ * @return Zend_Db_Select
+ */
+ public function reset($part = null)
+ {
+ if ($part == null) {
+ $this->_parts = self::$_partsInit;
+ } elseif (array_key_exists($part, self::$_partsInit)) {
+ $this->_parts[$part] = self::$_partsInit[$part];
+ }
+ return $this;
+ }
+
+ /**
+ * Gets the Zend_Db_Adapter_Abstract for this
+ * particular Zend_Db_Select object.
+ *
+ * @return Zend_Db_Adapter_Abstract
+ */
+ public function getAdapter()
+ {
+ return $this->_adapter;
+ }
+
+ /**
+ * Populate the {@link $_parts} 'join' key
+ *
+ * Does the dirty work of populating the join key.
+ *
+ * The $name and $cols parameters follow the same logic
+ * as described in the from() method.
+ *
+ * @param null|string $type Type of join; inner, left, and null are currently supported
+ * @param array|string|Zend_Db_Expr $name Table name
+ * @param string $cond Join on this condition
+ * @param array|string $cols The columns to select from the joined table
+ * @param string $schema The database name to specify, if any.
+ * @return Zend_Db_Select This Zend_Db_Select object
+ * @throws Zend_Db_Select_Exception
+ */
+ protected function _join($type, $name, $cond, $cols, $schema = null)
+ {
+ if (!in_array($type, self::$_joinTypes) && $type != self::FROM) {
+ /**
+ * @see Zend_Db_Select_Exception
+ */
+ throw new Zend_Db_Select_Exception("Invalid join type '$type'");
+ }
+
+ if (count($this->_parts[self::UNION])) {
+ throw new Zend_Db_Select_Exception("Invalid use of table with " . self::SQL_UNION);
+ }
+
+ if (empty($name)) {
+ $correlationName = $tableName = '';
+ } elseif (is_array($name)) {
+ // Must be array($correlationName => $tableName) or array($ident, ...)
+ foreach ($name as $_correlationName => $_tableName) {
+ if (is_string($_correlationName)) {
+ // We assume the key is the correlation name and value is the table name
+ $tableName = $_tableName;
+ $correlationName = $_correlationName;
+ } else {
+ // We assume just an array of identifiers, with no correlation name
+ $tableName = $_tableName;
+ $correlationName = $this->_uniqueCorrelation($tableName);
+ }
+ break;
+ }
+ } elseif ($name instanceof Zend_Db_Expr|| $name instanceof Zend_Db_Select) {
+ $tableName = $name;
+ $correlationName = $this->_uniqueCorrelation('t');
+ } elseif (preg_match('/^(.+)\s+AS\s+(.+)$/i', $name, $m)) {
+ $tableName = $m[1];
+ $correlationName = $m[2];
+ } else {
+ $tableName = $name;
+ $correlationName = $this->_uniqueCorrelation($tableName);
+ }
+
+ // Schema from table name overrides schema argument
+ if (!is_object($tableName) && false !== strpos($tableName, '.')) {
+ list($schema, $tableName) = explode('.', $tableName);
+ }
+
+ $lastFromCorrelationName = null;
+ if (!empty($correlationName)) {
+ if (array_key_exists($correlationName, $this->_parts[self::FROM])) {
+ /**
+ * @see Zend_Db_Select_Exception
+ */
+ throw new Zend_Db_Select_Exception("You cannot define a correlation name '$correlationName' more than once");
+ }
+
+ if ($type == self::FROM) {
+ // append this from after the last from joinType
+ $tmpFromParts = $this->_parts[self::FROM];
+ $this->_parts[self::FROM] = array();
+ // move all the froms onto the stack
+ while ($tmpFromParts) {
+ $currentCorrelationName = key($tmpFromParts);
+ if ($tmpFromParts[$currentCorrelationName]['joinType'] != self::FROM) {
+ break;
+ }
+ $lastFromCorrelationName = $currentCorrelationName;
+ $this->_parts[self::FROM][$currentCorrelationName] = array_shift($tmpFromParts);
+ }
+ } else {
+ $tmpFromParts = array();
+ }
+ $this->_parts[self::FROM][$correlationName] = array(
+ 'joinType' => $type,
+ 'schema' => $schema,
+ 'tableName' => $tableName,
+ 'joinCondition' => $cond
+ );
+ while ($tmpFromParts) {
+ $currentCorrelationName = key($tmpFromParts);
+ $this->_parts[self::FROM][$currentCorrelationName] = array_shift($tmpFromParts);
+ }
+ }
+
+ // add to the columns from this joined table
+ if ($type == self::FROM && $lastFromCorrelationName == null) {
+ $lastFromCorrelationName = true;
+ }
+ $this->_tableCols($correlationName, $cols, $lastFromCorrelationName);
+
+ return $this;
+ }
+
+ /**
+ * Handle JOIN... USING... syntax
+ *
+ * This is functionality identical to the existing JOIN methods, however
+ * the join condition can be passed as a single column name. This method
+ * then completes the ON condition by using the same field for the FROM
+ * table and the JOIN table.
+ *
+ * <code>
+ * $select = $db->select()->from('table1')
+ * ->joinUsing('table2', 'column1');
+ *
+ * // SELECT * FROM table1 JOIN table2 ON table1.column1 = table2.column2
+ * </code>
+ *
+ * These joins are called by the developer simply by adding 'Using' to the
+ * method name. E.g.
+ * * joinUsing
+ * * joinInnerUsing
+ * * joinFullUsing
+ * * joinRightUsing
+ * * joinLeftUsing
+ *
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function _joinUsing($type, $name, $cond, $cols = '*', $schema = null)
+ {
+ if (empty($this->_parts[self::FROM])) {
+ throw new Zend_Db_Select_Exception("You can only perform a joinUsing after specifying a FROM table");
+ }
+
+ $join = $this->_adapter->quoteIdentifier(key($this->_parts[self::FROM]), true);
+ $from = $this->_adapter->quoteIdentifier($this->_uniqueCorrelation($name), true);
+
+ $joinCond = array();
+ foreach ((array)$cond as $fieldName) {
+ $cond1 = $from . '.' . $fieldName;
+ $cond2 = $join . '.' . $fieldName;
+ $joinCond[] = $cond1 . ' = ' . $cond2;
+ }
+ $cond = implode(' '.self::SQL_AND.' ', $joinCond);
+
+ return $this->_join($type, $name, $cond, $cols, $schema);
+ }
+
+ /**
+ * Generate a unique correlation name
+ *
+ * @param string|array $name A qualified identifier.
+ * @return string A unique correlation name.
+ */
+ private function _uniqueCorrelation($name)
+ {
+ if (is_array($name)) {
+ $k = key($name);
+ $c = is_string($k) ? $k : end($name);
+ } else {
+ // Extract just the last name of a qualified table name
+ $dot = strrpos($name,'.');
+ $c = ($dot === false) ? $name : substr($name, $dot+1);
+ }
+ for ($i = 2; array_key_exists($c, $this->_parts[self::FROM]); ++$i) {
+ $c = $name . '_' . (string) $i;
+ }
+ return $c;
+ }
+
+ /**
+ * Adds to the internal table-to-column mapping array.
+ *
+ * @param string $tbl The table/join the columns come from.
+ * @param array|string $cols The list of columns; preferably as
+ * an array, but possibly as a string containing one column.
+ * @param bool|string True if it should be prepended, a correlation name if it should be inserted
+ * @return void
+ */
+ protected function _tableCols($correlationName, $cols, $afterCorrelationName = null)
+ {
+ if (!is_array($cols)) {
+ $cols = array($cols);
+ }
+
+ if ($correlationName == null) {
+ $correlationName = '';
+ }
+
+ $columnValues = array();
+
+ foreach (array_filter($cols) as $alias => $col) {
+ $currentCorrelationName = $correlationName;
+ if (is_string($col)) {
+ // Check for a column matching "<column> AS <alias>" and extract the alias name
+ $col = trim(str_replace("\n", ' ', $col));
+ if (preg_match('/^(.+)\s+' . self::SQL_AS . '\s+(.+)$/i', $col, $m)) {
+ $col = $m[1];
+ $alias = $m[2];
+ }
+ // Check for columns that look like functions and convert to Zend_Db_Expr
+ if (preg_match(self::REGEX_COLUMN_EXPR, (string) $col)) {
+ $col = new Zend_Db_Expr($col);
+ } elseif (preg_match('/(.+)\.(.+)/', $col, $m)) {
+ $currentCorrelationName = $m[1];
+ $col = $m[2];
+ }
+ }
+ $columnValues[] = array($currentCorrelationName, $col, is_string($alias) ? $alias : null);
+ }
+
+ if ($columnValues) {
+
+ // should we attempt to prepend or insert these values?
+ if ($afterCorrelationName === true || is_string($afterCorrelationName)) {
+ $tmpColumns = $this->_parts[self::COLUMNS];
+ $this->_parts[self::COLUMNS] = array();
+ } else {
+ $tmpColumns = array();
+ }
+
+ // find the correlation name to insert after
+ if (is_string($afterCorrelationName)) {
+ while ($tmpColumns) {
+ $this->_parts[self::COLUMNS][] = $currentColumn = array_shift($tmpColumns);
+ if ($currentColumn[0] == $afterCorrelationName) {
+ break;
+ }
+ }
+ }
+
+ // apply current values to current stack
+ foreach ($columnValues as $columnValue) {
+ array_push($this->_parts[self::COLUMNS], $columnValue);
+ }
+
+ // finish ensuring that all previous values are applied (if they exist)
+ while ($tmpColumns) {
+ array_push($this->_parts[self::COLUMNS], array_shift($tmpColumns));
+ }
+ }
+ }
+
+ /**
+ * Internal function for creating the where clause
+ *
+ * @param string $condition
+ * @param mixed $value optional
+ * @param string $type optional
+ * @param boolean $bool true = AND, false = OR
+ * @return string clause
+ */
+ protected function _where($condition, $value = null, $type = null, $bool = true)
+ {
+ if (count($this->_parts[self::UNION])) {
+ throw new Zend_Db_Select_Exception("Invalid use of where clause with " . self::SQL_UNION);
+ }
+
+ if ($value !== null) {
+ $condition = $this->_adapter->quoteInto($condition, $value, $type);
+ }
+
+ $cond = "";
+ if ($this->_parts[self::WHERE]) {
+ if ($bool === true) {
+ $cond = self::SQL_AND . ' ';
+ } else {
+ $cond = self::SQL_OR . ' ';
+ }
+ }
+
+ return $cond . "($condition)";
+ }
+
+ /**
+ * @return array
+ */
+ protected function _getDummyTable()
+ {
+ return array();
+ }
+
+ /**
+ * Return a quoted schema name
+ *
+ * @param string $schema The schema name OPTIONAL
+ * @return string|null
+ */
+ protected function _getQuotedSchema($schema = null)
+ {
+ if ($schema === null) {
+ return null;
+ }
+ return $this->_adapter->quoteIdentifier($schema, true) . '.';
+ }
+
+ /**
+ * Return a quoted table name
+ *
+ * @param string $tableName The table name
+ * @param string $correlationName The correlation name OPTIONAL
+ * @return string
+ */
+ protected function _getQuotedTable($tableName, $correlationName = null)
+ {
+ return $this->_adapter->quoteTableAs($tableName, $correlationName, true);
+ }
+
+ /**
+ * Render DISTINCT clause
+ *
+ * @param string $sql SQL query
+ * @return string
+ */
+ protected function _renderDistinct($sql)
+ {
+ if ($this->_parts[self::DISTINCT]) {
+ $sql .= ' ' . self::SQL_DISTINCT;
+ }
+
+ return $sql;
+ }
+
+ /**
+ * Render DISTINCT clause
+ *
+ * @param string $sql SQL query
+ * @return string|null
+ */
+ protected function _renderColumns($sql)
+ {
+ if (!count($this->_parts[self::COLUMNS])) {
+ return null;
+ }
+
+ $columns = array();
+ foreach ($this->_parts[self::COLUMNS] as $columnEntry) {
+ list($correlationName, $column, $alias) = $columnEntry;
+ if ($column instanceof Zend_Db_Expr) {
+ $columns[] = $this->_adapter->quoteColumnAs($column, $alias, true);
+ } else {
+ if ($column == self::SQL_WILDCARD) {
+ $column = new Zend_Db_Expr(self::SQL_WILDCARD);
+ $alias = null;
+ }
+ if (empty($correlationName)) {
+ $columns[] = $this->_adapter->quoteColumnAs($column, $alias, true);
+ } else {
+ $columns[] = $this->_adapter->quoteColumnAs(array($correlationName, $column), $alias, true);
+ }
+ }
+ }
+
+ return $sql . ' ' . implode(', ', $columns);
+ }
+
+ /**
+ * Render FROM clause
+ *
+ * @param string $sql SQL query
+ * @return string
+ */
+ protected function _renderFrom($sql)
+ {
+ /*
+ * If no table specified, use RDBMS-dependent solution
+ * for table-less query. e.g. DUAL in Oracle.
+ */
+ if (empty($this->_parts[self::FROM])) {
+ $this->_parts[self::FROM] = $this->_getDummyTable();
+ }
+
+ $from = array();
+
+ foreach ($this->_parts[self::FROM] as $correlationName => $table) {
+ $tmp = '';
+
+ $joinType = ($table['joinType'] == self::FROM) ? self::INNER_JOIN : $table['joinType'];
+
+ // Add join clause (if applicable)
+ if (! empty($from)) {
+ $tmp .= ' ' . strtoupper($joinType) . ' ';
+ }
+
+ $tmp .= $this->_getQuotedSchema($table['schema']);
+ $tmp .= $this->_getQuotedTable($table['tableName'], $correlationName);
+
+ // Add join conditions (if applicable)
+ if (!empty($from) && ! empty($table['joinCondition'])) {
+ $tmp .= ' ' . self::SQL_ON . ' ' . $table['joinCondition'];
+ }
+
+ // Add the table name and condition add to the list
+ $from[] = $tmp;
+ }
+
+ // Add the list of all joins
+ if (!empty($from)) {
+ $sql .= ' ' . self::SQL_FROM . ' ' . implode("\n", $from);
+ }
+
+ return $sql;
+ }
+
+ /**
+ * Render UNION query
+ *
+ * @param string $sql SQL query
+ * @return string
+ */
+ protected function _renderUnion($sql)
+ {
+ if ($this->_parts[self::UNION]) {
+ $parts = count($this->_parts[self::UNION]);
+ foreach ($this->_parts[self::UNION] as $cnt => $union) {
+ list($target, $type) = $union;
+ if ($target instanceof Zend_Db_Select) {
+ $target = $target->assemble();
+ }
+ $sql .= $target;
+ if ($cnt < $parts - 1) {
+ $sql .= ' ' . $type . ' ';
+ }
+ }
+ }
+
+ return $sql;
+ }
+
+ /**
+ * Render WHERE clause
+ *
+ * @param string $sql SQL query
+ * @return string
+ */
+ protected function _renderWhere($sql)
+ {
+ if ($this->_parts[self::FROM] && $this->_parts[self::WHERE]) {
+ $sql .= ' ' . self::SQL_WHERE . ' ' . implode(' ', $this->_parts[self::WHERE]);
+ }
+
+ return $sql;
+ }
+
+ /**
+ * Render GROUP clause
+ *
+ * @param string $sql SQL query
+ * @return string
+ */
+ protected function _renderGroup($sql)
+ {
+ if ($this->_parts[self::FROM] && $this->_parts[self::GROUP]) {
+ $group = array();
+ foreach ($this->_parts[self::GROUP] as $term) {
+ $group[] = $this->_adapter->quoteIdentifier($term, true);
+ }
+ $sql .= ' ' . self::SQL_GROUP_BY . ' ' . implode(",\n\t", $group);
+ }
+
+ return $sql;
+ }
+
+ /**
+ * Render HAVING clause
+ *
+ * @param string $sql SQL query
+ * @return string
+ */
+ protected function _renderHaving($sql)
+ {
+ if ($this->_parts[self::FROM] && $this->_parts[self::HAVING]) {
+ $sql .= ' ' . self::SQL_HAVING . ' ' . implode(' ', $this->_parts[self::HAVING]);
+ }
+
+ return $sql;
+ }
+
+ /**
+ * Render ORDER clause
+ *
+ * @param string $sql SQL query
+ * @return string
+ */
+ protected function _renderOrder($sql)
+ {
+ if ($this->_parts[self::ORDER]) {
+ $order = array();
+ foreach ($this->_parts[self::ORDER] as $term) {
+ if (is_array($term)) {
+ if(is_numeric($term[0]) && strval(intval($term[0])) == $term[0]) {
+ $order[] = (int)trim($term[0]) . ' ' . $term[1];
+ } else {
+ $order[] = $this->_adapter->quoteIdentifier($term[0], true) . ' ' . $term[1];
+ }
+ } elseif (is_numeric($term) && strval(intval($term)) == $term) {
+ $order[] = (int)trim($term);
+ } else {
+ $order[] = $this->_adapter->quoteIdentifier($term, true);
+ }
+ }
+ $sql .= ' ' . self::SQL_ORDER_BY . ' ' . implode(', ', $order);
+ }
+
+ return $sql;
+ }
+
+ /**
+ * Render LIMIT OFFSET clause
+ *
+ * @param string $sql SQL query
+ * @return string
+ */
+ protected function _renderLimitoffset($sql)
+ {
+ $count = 0;
+ $offset = 0;
+
+ if (!empty($this->_parts[self::LIMIT_OFFSET])) {
+ $offset = (int) $this->_parts[self::LIMIT_OFFSET];
+ $count = PHP_INT_MAX;
+ }
+
+ if (!empty($this->_parts[self::LIMIT_COUNT])) {
+ $count = (int) $this->_parts[self::LIMIT_COUNT];
+ }
+
+ /*
+ * Add limits clause
+ */
+ if ($count > 0) {
+ $sql = trim($this->_adapter->limit($sql, $count, $offset));
+ }
+
+ return $sql;
+ }
+
+ /**
+ * Render FOR UPDATE clause
+ *
+ * @param string $sql SQL query
+ * @return string
+ */
+ protected function _renderForupdate($sql)
+ {
+ if ($this->_parts[self::FOR_UPDATE]) {
+ $sql .= ' ' . self::SQL_FOR_UPDATE;
+ }
+
+ return $sql;
+ }
+
+ /**
+ * Turn magic function calls into non-magic function calls
+ * for joinUsing syntax
+ *
+ * @param string $method
+ * @param array $args OPTIONAL Zend_Db_Table_Select query modifier
+ * @return Zend_Db_Select
+ * @throws Zend_Db_Select_Exception If an invalid method is called.
+ */
+ public function __call($method, array $args)
+ {
+ $matches = array();
+
+ /**
+ * Recognize methods for Has-Many cases:
+ * findParent<Class>()
+ * findParent<Class>By<Rule>()
+ * Use the non-greedy pattern repeat modifier e.g. \w+?
+ */
+ if (preg_match('/^join([a-zA-Z]*?)Using$/', $method, $matches)) {
+ $type = strtolower($matches[1]);
+ if ($type) {
+ $type .= ' join';
+ if (!in_array($type, self::$_joinTypes)) {
+ throw new Zend_Db_Select_Exception("Unrecognized method '$method()'");
+ }
+ if (in_array($type, array(self::CROSS_JOIN, self::NATURAL_JOIN))) {
+ throw new Zend_Db_Select_Exception("Cannot perform a joinUsing with method '$method()'");
+ }
+ } else {
+ $type = self::INNER_JOIN;
+ }
+ array_unshift($args, $type);
+ return call_user_func_array(array($this, '_joinUsing'), $args);
+ }
+
+ throw new Zend_Db_Select_Exception("Unrecognized method '$method()'");
+ }
+
+ /**
+ * Implements magic method.
+ *
+ * @return string This object as a SELECT string.
+ */
+ public function __toString()
+ {
+ try {
+ $sql = $this->assemble();
+ } catch (Exception $e) {
+ trigger_error($e->getMessage(), E_USER_WARNING);
+ $sql = '';
+ }
+ return (string)$sql;
+ }
+
+}
diff --git a/library/vendor/Zend/Db/Select/Exception.php b/library/vendor/Zend/Db/Select/Exception.php
new file mode 100644
index 0000000..6e7bfac
--- /dev/null
+++ b/library/vendor/Zend/Db/Select/Exception.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Select
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Db_Exception
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Select
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+class Zend_Db_Select_Exception extends Zend_Db_Exception
+{
+}
+
diff --git a/library/vendor/Zend/Db/Statement.php b/library/vendor/Zend/Db/Statement.php
new file mode 100644
index 0000000..4eb761c
--- /dev/null
+++ b/library/vendor/Zend/Db/Statement.php
@@ -0,0 +1,488 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Db
+ */
+
+/**
+ * @see Zend_Db_Statement_Interface
+ */
+
+/**
+ * Abstract class to emulate a PDOStatement for native database adapters.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Db_Statement implements Zend_Db_Statement_Interface
+{
+
+ /**
+ * @var resource|object The driver level statement object/resource
+ */
+ protected $_stmt = null;
+
+ /**
+ * @var Zend_Db_Adapter_Abstract
+ */
+ protected $_adapter = null;
+
+ /**
+ * The current fetch mode.
+ *
+ * @var integer
+ */
+ protected $_fetchMode = Zend_Db::FETCH_ASSOC;
+
+ /**
+ * Attributes.
+ *
+ * @var array
+ */
+ protected $_attribute = array();
+
+ /**
+ * Column result bindings.
+ *
+ * @var array
+ */
+ protected $_bindColumn = array();
+
+ /**
+ * Query parameter bindings; covers bindParam() and bindValue().
+ *
+ * @var array
+ */
+ protected $_bindParam = array();
+
+ /**
+ * SQL string split into an array at placeholders.
+ *
+ * @var array
+ */
+ protected $_sqlSplit = array();
+
+ /**
+ * Parameter placeholders in the SQL string by position in the split array.
+ *
+ * @var array
+ */
+ protected $_sqlParam = array();
+
+ /**
+ * @var Zend_Db_Profiler_Query
+ */
+ protected $_queryId = null;
+
+ /**
+ * Constructor for a statement.
+ *
+ * @param Zend_Db_Adapter_Abstract $adapter
+ * @param mixed $sql Either a string or Zend_Db_Select.
+ */
+ public function __construct($adapter, $sql)
+ {
+ $this->_adapter = $adapter;
+ if ($sql instanceof Zend_Db_Select) {
+ $sql = $sql->assemble();
+ }
+ $this->_parseParameters($sql);
+ $this->_prepare($sql);
+
+ $this->_queryId = $this->_adapter->getProfiler()->queryStart($sql);
+ }
+
+ /**
+ * Internal method called by abstract statment constructor to setup
+ * the driver level statement
+ *
+ * @return void
+ */
+ protected function _prepare($sql)
+ {
+ return;
+ }
+
+ /**
+ * @param string $sql
+ * @return void
+ */
+ protected function _parseParameters($sql)
+ {
+ $sql = $this->_stripQuoted($sql);
+
+ // split into text and params
+ $this->_sqlSplit = empty($sql) ? [] : preg_split('/(\?|\:[a-zA-Z0-9_]+)/',
+ $sql, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
+
+ // map params
+ $this->_sqlParam = array();
+ foreach ($this->_sqlSplit as $key => $val) {
+ if ($val == '?') {
+ if ($this->_adapter->supportsParameters('positional') === false) {
+ /**
+ * @see Zend_Db_Statement_Exception
+ */
+ throw new Zend_Db_Statement_Exception("Invalid bind-variable position '$val'");
+ }
+ } else if ($val[0] == ':') {
+ if ($this->_adapter->supportsParameters('named') === false) {
+ /**
+ * @see Zend_Db_Statement_Exception
+ */
+ throw new Zend_Db_Statement_Exception("Invalid bind-variable name '$val'");
+ }
+ }
+ $this->_sqlParam[] = $val;
+ }
+
+ // set up for binding
+ $this->_bindParam = array();
+ }
+
+ /**
+ * Remove parts of a SQL string that contain quoted strings
+ * of values or identifiers.
+ *
+ * @param string $sql
+ * @return string
+ */
+ protected function _stripQuoted($sql)
+ {
+
+ // get the character for value quoting
+ // this should be '
+ $q = $this->_adapter->quote('a');
+ $q = $q[0];
+ // get the value used as an escaped quote,
+ // e.g. \' or ''
+ $qe = $this->_adapter->quote($q);
+ $qe = substr($qe, 1, 2);
+ $qe = preg_quote($qe);
+ $escapeChar = substr($qe,0,1);
+ // remove 'foo\'bar'
+ if (!empty($q)) {
+ $escapeChar = preg_quote($escapeChar);
+ if ($sql !== null) {
+ // this segfaults only after 65,000 characters instead of 9,000
+ $sql = preg_replace("/$q([^$q{$escapeChar}]*|($qe)*)*$q/s", '', $sql);
+ }
+ }
+
+ // get a version of the SQL statement with all quoted
+ // values and delimited identifiers stripped out
+ // remove "foo\"bar"
+ if ($sql !== null) {
+ $sql = preg_replace("/\"(\\\\\"|[^\"])*\"/Us", '', $sql);
+ }
+
+ // get the character for delimited id quotes,
+ // this is usually " but in MySQL is `
+ $d = $this->_adapter->quoteIdentifier('a');
+ $d = $d[0];
+ // get the value used as an escaped delimited id quote,
+ // e.g. \" or "" or \`
+ $de = $this->_adapter->quoteIdentifier($d);
+ $de = substr($de, 1, 2);
+ $de = preg_quote($de);
+ // Note: $de and $d where never used..., now they are:
+ if ($sql !== null) {
+ $sql = preg_replace("/$d($de|\\\\{2}|[^$d])*$d/Us", '', $sql);
+ }
+
+ return $sql;
+ }
+
+ /**
+ * Bind a column of the statement result set to a PHP variable.
+ *
+ * @param string $column Name the column in the result set, either by
+ * position or by name.
+ * @param mixed $param Reference to the PHP variable containing the value.
+ * @param mixed $type OPTIONAL
+ * @return bool
+ */
+ public function bindColumn($column, &$param, $type = null)
+ {
+ $this->_bindColumn[$column] =& $param;
+ return true;
+ }
+
+ /**
+ * Binds a parameter to the specified variable name.
+ *
+ * @param mixed $parameter Name the parameter, either integer or string.
+ * @param mixed $variable Reference to PHP variable containing the value.
+ * @param mixed $type OPTIONAL Datatype of SQL parameter.
+ * @param mixed $length OPTIONAL Length of SQL parameter.
+ * @param mixed $options OPTIONAL Other options.
+ * @return bool
+ */
+ public function bindParam($parameter, &$variable, $type = null, $length = null, $options = null)
+ {
+ if (!is_int($parameter) && !is_string($parameter)) {
+ /**
+ * @see Zend_Db_Statement_Exception
+ */
+ throw new Zend_Db_Statement_Exception('Invalid bind-variable position');
+ }
+
+ $position = null;
+ if (($intval = (int) $parameter) > 0 && $this->_adapter->supportsParameters('positional')) {
+ if ($intval >= 1 || $intval <= count($this->_sqlParam)) {
+ $position = $intval;
+ }
+ } else if ($this->_adapter->supportsParameters('named')) {
+ if ($parameter[0] != ':') {
+ $parameter = ':' . $parameter;
+ }
+ if (in_array($parameter, $this->_sqlParam) !== false) {
+ $position = $parameter;
+ }
+ }
+
+ if ($position === null) {
+ /**
+ * @see Zend_Db_Statement_Exception
+ */
+ throw new Zend_Db_Statement_Exception("Invalid bind-variable position '$parameter'");
+ }
+
+ // Finally we are assured that $position is valid
+ $this->_bindParam[$position] =& $variable;
+ return $this->_bindParam($position, $variable, $type, $length, $options);
+ }
+
+ /**
+ * Binds a value to a parameter.
+ *
+ * @param mixed $parameter Name the parameter, either integer or string.
+ * @param mixed $value Scalar value to bind to the parameter.
+ * @param mixed $type OPTIONAL Datatype of the parameter.
+ * @return bool
+ */
+ public function bindValue($parameter, $value, $type = null)
+ {
+ return $this->bindParam($parameter, $value, $type);
+ }
+
+ /**
+ * Executes a prepared statement.
+ *
+ * @param array $params OPTIONAL Values to bind to parameter placeholders.
+ * @return bool
+ */
+ public function execute(array $params = null)
+ {
+ /*
+ * Simple case - no query profiler to manage.
+ */
+ if ($this->_queryId === null) {
+ return $this->_execute($params);
+ }
+
+ /*
+ * Do the same thing, but with query profiler
+ * management before and after the execute.
+ */
+ $prof = $this->_adapter->getProfiler();
+ $qp = $prof->getQueryProfile($this->_queryId);
+ if ($qp->hasEnded()) {
+ $this->_queryId = $prof->queryClone($qp);
+ $qp = $prof->getQueryProfile($this->_queryId);
+ }
+ if ($params !== null) {
+ $qp->bindParams($params);
+ } else {
+ $qp->bindParams($this->_bindParam);
+ }
+ $qp->start($this->_queryId);
+
+ $retval = $this->_execute($params);
+
+ $prof->queryEnd($this->_queryId);
+
+ return $retval;
+ }
+
+ /**
+ * Returns an array containing all of the result set rows.
+ *
+ * @param int $style OPTIONAL Fetch mode.
+ * @param int $col OPTIONAL Column number, if fetch mode is by column.
+ * @return array Collection of rows, each in a format by the fetch mode.
+ */
+ public function fetchAll($style = null, $col = null)
+ {
+ $data = array();
+ if ($style === Zend_Db::FETCH_COLUMN && $col === null) {
+ $col = 0;
+ }
+ if ($col === null) {
+ while ($row = $this->fetch($style)) {
+ $data[] = $row;
+ }
+ } else {
+ while (false !== ($val = $this->fetchColumn($col))) {
+ $data[] = $val;
+ }
+ }
+ return $data;
+ }
+
+ /**
+ * Returns a single column from the next row of a result set.
+ *
+ * @param int $col OPTIONAL Position of the column to fetch.
+ * @return string One value from the next row of result set, or false.
+ */
+ public function fetchColumn($col = 0)
+ {
+ $data = array();
+ $col = (int) $col;
+ $row = $this->fetch(Zend_Db::FETCH_NUM);
+ if (!is_array($row)) {
+ return false;
+ }
+ return $row[$col];
+ }
+
+ /**
+ * Fetches the next row and returns it as an object.
+ *
+ * @param string $class OPTIONAL Name of the class to create.
+ * @param array $config OPTIONAL Constructor arguments for the class.
+ * @return mixed One object instance of the specified class, or false.
+ */
+ public function fetchObject($class = 'stdClass', array $config = array())
+ {
+ $obj = new $class($config);
+ $row = $this->fetch(Zend_Db::FETCH_ASSOC);
+ if (!is_array($row)) {
+ return false;
+ }
+ foreach ($row as $key => $val) {
+ $obj->$key = $val;
+ }
+ return $obj;
+ }
+
+ /**
+ * Retrieve a statement attribute.
+ *
+ * @param string $key Attribute name.
+ * @return mixed Attribute value.
+ */
+ public function getAttribute($key)
+ {
+ if (array_key_exists($key, $this->_attribute)) {
+ return $this->_attribute[$key];
+ }
+ }
+
+ /**
+ * Set a statement attribute.
+ *
+ * @param string $key Attribute name.
+ * @param mixed $val Attribute value.
+ * @return bool
+ */
+ public function setAttribute($key, $val)
+ {
+ $this->_attribute[$key] = $val;
+ }
+
+ /**
+ * Set the default fetch mode for this statement.
+ *
+ * @param int $mode The fetch mode.
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function setFetchMode($mode)
+ {
+ switch ($mode) {
+ case Zend_Db::FETCH_NUM:
+ case Zend_Db::FETCH_ASSOC:
+ case Zend_Db::FETCH_BOTH:
+ case Zend_Db::FETCH_OBJ:
+ $this->_fetchMode = $mode;
+ break;
+ case Zend_Db::FETCH_BOUND:
+ default:
+ $this->closeCursor();
+ /**
+ * @see Zend_Db_Statement_Exception
+ */
+ throw new Zend_Db_Statement_Exception('invalid fetch mode');
+ break;
+ }
+ }
+
+ /**
+ * Helper function to map retrieved row
+ * to bound column variables
+ *
+ * @param array $row
+ * @return bool True
+ */
+ public function _fetchBound($row)
+ {
+ foreach ($row as $key => $value) {
+ // bindColumn() takes 1-based integer positions
+ // but fetch() returns 0-based integer indexes
+ if (is_int($key)) {
+ $key++;
+ }
+ // set results only to variables that were bound previously
+ if (isset($this->_bindColumn[$key])) {
+ $this->_bindColumn[$key] = $value;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Gets the Zend_Db_Adapter_Abstract for this
+ * particular Zend_Db_Statement object.
+ *
+ * @return Zend_Db_Adapter_Abstract
+ */
+ public function getAdapter()
+ {
+ return $this->_adapter;
+ }
+
+ /**
+ * Gets the resource or object setup by the
+ * _parse
+ * @return unknown_type
+ */
+ public function getDriverStatement()
+ {
+ return $this->_stmt;
+ }
+}
diff --git a/library/vendor/Zend/Db/Statement/Db2.php b/library/vendor/Zend/Db/Statement/Db2.php
new file mode 100644
index 0000000..b817864
--- /dev/null
+++ b/library/vendor/Zend/Db/Statement/Db2.php
@@ -0,0 +1,354 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Db_Statement
+ */
+
+/**
+ * Extends for DB2 native adapter.
+ *
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Statement_Db2 extends Zend_Db_Statement
+{
+
+ /**
+ * Column names.
+ */
+ protected $_keys;
+
+ /**
+ * Fetched result values.
+ */
+ protected $_values;
+
+ /**
+ * Prepare a statement handle.
+ *
+ * @param string $sql
+ * @return void
+ * @throws Zend_Db_Statement_Db2_Exception
+ */
+ public function _prepare($sql)
+ {
+ $connection = $this->_adapter->getConnection();
+
+ // db2_prepare on i5 emits errors, these need to be
+ // suppressed so that proper exceptions can be thrown
+ $this->_stmt = @db2_prepare($connection, $sql);
+
+ if (!$this->_stmt) {
+ /**
+ * @see Zend_Db_Statement_Db2_Exception
+ */
+ throw new Zend_Db_Statement_Db2_Exception(
+ db2_stmt_errormsg(),
+ db2_stmt_error()
+ );
+ }
+ }
+
+ /**
+ * Binds a parameter to the specified variable name.
+ *
+ * @param mixed $parameter Name the parameter, either integer or string.
+ * @param mixed $variable Reference to PHP variable containing the value.
+ * @param mixed $type OPTIONAL Datatype of SQL parameter.
+ * @param mixed $length OPTIONAL Length of SQL parameter.
+ * @param mixed $options OPTIONAL Other options.
+ * @return bool
+ * @throws Zend_Db_Statement_Db2_Exception
+ */
+ public function _bindParam($parameter, &$variable, $type = null, $length = null, $options = null)
+ {
+ if ($type === null) {
+ $type = DB2_PARAM_IN;
+ }
+
+ if (isset($options['data-type'])) {
+ $datatype = $options['data-type'];
+ } else {
+ $datatype = DB2_CHAR;
+ }
+
+ if (!db2_bind_param($this->_stmt, $parameter, "variable", $type, $datatype)) {
+ /**
+ * @see Zend_Db_Statement_Db2_Exception
+ */
+ throw new Zend_Db_Statement_Db2_Exception(
+ db2_stmt_errormsg(),
+ db2_stmt_error()
+ );
+ }
+
+ return true;
+ }
+
+ /**
+ * Closes the cursor, allowing the statement to be executed again.
+ *
+ * @return bool
+ */
+ public function closeCursor()
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+ db2_free_stmt($this->_stmt);
+ $this->_stmt = false;
+ return true;
+ }
+
+
+ /**
+ * Returns the number of columns in the result set.
+ * Returns null if the statement has no result set metadata.
+ *
+ * @return int The number of columns.
+ */
+ public function columnCount()
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+ return db2_num_fields($this->_stmt);
+ }
+
+ /**
+ * Retrieves the error code, if any, associated with the last operation on
+ * the statement handle.
+ *
+ * @return string error code.
+ */
+ public function errorCode()
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ $error = db2_stmt_error();
+ if ($error === '') {
+ return false;
+ }
+
+ return $error;
+ }
+
+ /**
+ * Retrieves an array of error information, if any, associated with the
+ * last operation on the statement handle.
+ *
+ * @return array
+ */
+ public function errorInfo()
+ {
+ $error = $this->errorCode();
+ if ($error === false){
+ return false;
+ }
+
+ /*
+ * Return three-valued array like PDO. But DB2 does not distinguish
+ * between SQLCODE and native RDBMS error code, so repeat the SQLCODE.
+ */
+ return array(
+ $error,
+ $error,
+ db2_stmt_errormsg()
+ );
+ }
+
+ /**
+ * Executes a prepared statement.
+ *
+ * @param array $params OPTIONAL Values to bind to parameter placeholders.
+ * @return bool
+ * @throws Zend_Db_Statement_Db2_Exception
+ */
+ public function _execute(array $params = null)
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ $retval = true;
+ if ($params !== null) {
+ $retval = @db2_execute($this->_stmt, $params);
+ } else {
+ $retval = @db2_execute($this->_stmt);
+ }
+
+ if ($retval === false) {
+ /**
+ * @see Zend_Db_Statement_Db2_Exception
+ */
+ throw new Zend_Db_Statement_Db2_Exception(
+ db2_stmt_errormsg(),
+ db2_stmt_error());
+ }
+
+ $this->_keys = array();
+ if ($field_num = $this->columnCount()) {
+ for ($i = 0; $i < $field_num; $i++) {
+ $name = db2_field_name($this->_stmt, $i);
+ $this->_keys[] = $name;
+ }
+ }
+
+ $this->_values = array();
+ if ($this->_keys) {
+ $this->_values = array_fill(0, count($this->_keys), null);
+ }
+
+ return $retval;
+ }
+
+ /**
+ * Fetches a row from the result set.
+ *
+ * @param int $style OPTIONAL Fetch mode for this fetch operation.
+ * @param int $cursor OPTIONAL Absolute, relative, or other.
+ * @param int $offset OPTIONAL Number for absolute or relative cursors.
+ * @return mixed Array, object, or scalar depending on fetch mode.
+ * @throws Zend_Db_Statement_Db2_Exception
+ */
+ public function fetch($style = null, $cursor = null, $offset = null)
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ if ($style === null) {
+ $style = $this->_fetchMode;
+ }
+
+ switch ($style) {
+ case Zend_Db::FETCH_NUM :
+ $row = db2_fetch_array($this->_stmt);
+ break;
+ case Zend_Db::FETCH_ASSOC :
+ $row = db2_fetch_assoc($this->_stmt);
+ break;
+ case Zend_Db::FETCH_BOTH :
+ $row = db2_fetch_both($this->_stmt);
+ break;
+ case Zend_Db::FETCH_OBJ :
+ $row = db2_fetch_object($this->_stmt);
+ break;
+ case Zend_Db::FETCH_BOUND:
+ $row = db2_fetch_both($this->_stmt);
+ if ($row !== false) {
+ return $this->_fetchBound($row);
+ }
+ break;
+ default:
+ /**
+ * @see Zend_Db_Statement_Db2_Exception
+ */
+ throw new Zend_Db_Statement_Db2_Exception("Invalid fetch mode '$style' specified");
+ break;
+ }
+
+ return $row;
+ }
+
+ /**
+ * Fetches the next row and returns it as an object.
+ *
+ * @param string $class OPTIONAL Name of the class to create.
+ * @param array $config OPTIONAL Constructor arguments for the class.
+ * @return mixed One object instance of the specified class.
+ */
+ public function fetchObject($class = 'stdClass', array $config = array())
+ {
+ $obj = $this->fetch(Zend_Db::FETCH_OBJ);
+ return $obj;
+ }
+
+ /**
+ * Retrieves the next rowset (result set) for a SQL statement that has
+ * multiple result sets. An example is a stored procedure that returns
+ * the results of multiple queries.
+ *
+ * @return bool
+ * @throws Zend_Db_Statement_Db2_Exception
+ */
+ public function nextRowset()
+ {
+ /**
+ * @see Zend_Db_Statement_Db2_Exception
+ */
+ throw new Zend_Db_Statement_Db2_Exception(__FUNCTION__ . '() is not implemented');
+ }
+
+ /**
+ * Returns the number of rows affected by the execution of the
+ * last INSERT, DELETE, or UPDATE statement executed by this
+ * statement object.
+ *
+ * @return int The number of rows affected.
+ */
+ public function rowCount()
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ $num = @db2_num_rows($this->_stmt);
+
+ if ($num === false) {
+ return 0;
+ }
+
+ return $num;
+ }
+
+ /**
+ * Returns an array containing all of the result set rows.
+ *
+ * @param int $style OPTIONAL Fetch mode.
+ * @param int $col OPTIONAL Column number, if fetch mode is by column.
+ * @return array Collection of rows, each in a format by the fetch mode.
+ *
+ * Behaves like parent, but if limit()
+ * is used, the final result removes the extra column
+ * 'zend_db_rownum'
+ */
+ public function fetchAll($style = null, $col = null)
+ {
+ $data = parent::fetchAll($style, $col);
+ $results = array();
+ $remove = $this->_adapter->foldCase('ZEND_DB_ROWNUM');
+
+ foreach ($data as $row) {
+ if (is_array($row) && array_key_exists($remove, $row)) {
+ unset($row[$remove]);
+ }
+ $results[] = $row;
+ }
+ return $results;
+ }
+}
diff --git a/library/vendor/Zend/Db/Statement/Db2/Exception.php b/library/vendor/Zend/Db/Statement/Db2/Exception.php
new file mode 100644
index 0000000..d598a85
--- /dev/null
+++ b/library/vendor/Zend/Db/Statement/Db2/Exception.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Db_Statement_Exception
+ */
+
+/**
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+class Zend_Db_Statement_Db2_Exception extends Zend_Db_Statement_Exception
+{
+ /**
+ * @var string
+ */
+ protected $code = '00000';
+
+ /**
+ * @var string
+ */
+ protected $message = 'unknown exception';
+
+ /**
+ * @param string $msg
+ * @param string $state
+ */
+ function __construct($msg = 'unknown exception', $state = '00000')
+ {
+ $this->message = $msg;
+ $this->code = $state;
+ }
+
+}
+
diff --git a/library/vendor/Zend/Db/Statement/Exception.php b/library/vendor/Zend/Db/Statement/Exception.php
new file mode 100644
index 0000000..af58699
--- /dev/null
+++ b/library/vendor/Zend/Db/Statement/Exception.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Db_Exception
+ */
+
+/**
+ * Zend_Db_Statement_Exception
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Statement_Exception extends Zend_Db_Exception
+{
+ /**
+ * Check if this general exception has a specific database driver specific exception nested inside.
+ *
+ * @return bool
+ */
+ public function hasChainedException()
+ {
+ return ($this->getPrevious() !== null);
+ }
+
+ /**
+ * @return Exception|null
+ */
+ public function getChainedException()
+ {
+ return $this->getPrevious();
+ }
+}
diff --git a/library/vendor/Zend/Db/Statement/Interface.php b/library/vendor/Zend/Db/Statement/Interface.php
new file mode 100644
index 0000000..7154d91
--- /dev/null
+++ b/library/vendor/Zend/Db/Statement/Interface.php
@@ -0,0 +1,203 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Emulates a PDOStatement for native database adapters.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Db_Statement_Interface
+{
+
+ /**
+ * Bind a column of the statement result set to a PHP variable.
+ *
+ * @param string $column Name the column in the result set, either by
+ * position or by name.
+ * @param mixed $param Reference to the PHP variable containing the value.
+ * @param mixed $type OPTIONAL
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function bindColumn($column, &$param, $type = null);
+
+ /**
+ * Binds a parameter to the specified variable name.
+ *
+ * @param mixed $parameter Name the parameter, either integer or string.
+ * @param mixed $variable Reference to PHP variable containing the value.
+ * @param mixed $type OPTIONAL Datatype of SQL parameter.
+ * @param mixed $length OPTIONAL Length of SQL parameter.
+ * @param mixed $options OPTIONAL Other options.
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function bindParam($parameter, &$variable, $type = null, $length = null, $options = null);
+
+ /**
+ * Binds a value to a parameter.
+ *
+ * @param mixed $parameter Name the parameter, either integer or string.
+ * @param mixed $value Scalar value to bind to the parameter.
+ * @param mixed $type OPTIONAL Datatype of the parameter.
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function bindValue($parameter, $value, $type = null);
+
+ /**
+ * Closes the cursor, allowing the statement to be executed again.
+ *
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function closeCursor();
+
+ /**
+ * Returns the number of columns in the result set.
+ * Returns null if the statement has no result set metadata.
+ *
+ * @return int The number of columns.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function columnCount();
+
+ /**
+ * Retrieves the error code, if any, associated with the last operation on
+ * the statement handle.
+ *
+ * @return string error code.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function errorCode();
+
+ /**
+ * Retrieves an array of error information, if any, associated with the
+ * last operation on the statement handle.
+ *
+ * @return array
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function errorInfo();
+
+ /**
+ * Executes a prepared statement.
+ *
+ * @param array $params OPTIONAL Values to bind to parameter placeholders.
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function execute(array $params = array());
+
+ /**
+ * Fetches a row from the result set.
+ *
+ * @param int $style OPTIONAL Fetch mode for this fetch operation.
+ * @param int $cursor OPTIONAL Absolute, relative, or other.
+ * @param int $offset OPTIONAL Number for absolute or relative cursors.
+ * @return mixed Array, object, or scalar depending on fetch mode.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function fetch($style = null, $cursor = null, $offset = null);
+
+ /**
+ * Returns an array containing all of the result set rows.
+ *
+ * @param int $style OPTIONAL Fetch mode.
+ * @param int $col OPTIONAL Column number, if fetch mode is by column.
+ * @return array Collection of rows, each in a format by the fetch mode.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function fetchAll($style = null, $col = null);
+
+ /**
+ * Returns a single column from the next row of a result set.
+ *
+ * @param int $col OPTIONAL Position of the column to fetch.
+ * @return string
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function fetchColumn($col = 0);
+
+ /**
+ * Fetches the next row and returns it as an object.
+ *
+ * @param string $class OPTIONAL Name of the class to create.
+ * @param array $config OPTIONAL Constructor arguments for the class.
+ * @return mixed One object instance of the specified class.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function fetchObject($class = 'stdClass', array $config = array());
+
+ /**
+ * Retrieve a statement attribute.
+ *
+ * @param string $key Attribute name.
+ * @return mixed Attribute value.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function getAttribute($key);
+
+ /**
+ * Retrieves the next rowset (result set) for a SQL statement that has
+ * multiple result sets. An example is a stored procedure that returns
+ * the results of multiple queries.
+ *
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function nextRowset();
+
+ /**
+ * Returns the number of rows affected by the execution of the
+ * last INSERT, DELETE, or UPDATE statement executed by this
+ * statement object.
+ *
+ * @return int The number of rows affected.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function rowCount();
+
+ /**
+ * Set a statement attribute.
+ *
+ * @param string $key Attribute name.
+ * @param mixed $val Attribute value.
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function setAttribute($key, $val);
+
+ /**
+ * Set the default fetch mode for this statement.
+ *
+ * @param int $mode The fetch mode.
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function setFetchMode($mode);
+
+}
diff --git a/library/vendor/Zend/Db/Statement/Mysqli.php b/library/vendor/Zend/Db/Statement/Mysqli.php
new file mode 100644
index 0000000..366d9bf
--- /dev/null
+++ b/library/vendor/Zend/Db/Statement/Mysqli.php
@@ -0,0 +1,356 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Db_Statement
+ */
+
+
+/**
+ * Extends for Mysqli
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Statement_Mysqli extends Zend_Db_Statement
+{
+
+ /**
+ * Column names.
+ *
+ * @var array
+ */
+ protected $_keys;
+
+ /**
+ * Fetched result values.
+ *
+ * @var array
+ */
+ protected $_values;
+
+ /**
+ * @var array
+ */
+ protected $_meta = null;
+
+ /**
+ * @param string $sql
+ * @return void
+ * @throws Zend_Db_Statement_Mysqli_Exception
+ */
+ public function _prepare($sql)
+ {
+ $mysqli = $this->_adapter->getConnection();
+
+ $this->_stmt = $mysqli->prepare($sql);
+
+ if ($this->_stmt === false || $mysqli->errno) {
+ /**
+ * @see Zend_Db_Statement_Mysqli_Exception
+ */
+ throw new Zend_Db_Statement_Mysqli_Exception("Mysqli prepare error: " . $mysqli->error, $mysqli->errno);
+ }
+ }
+
+ /**
+ * Binds a parameter to the specified variable name.
+ *
+ * @param mixed $parameter Name the parameter, either integer or string.
+ * @param mixed $variable Reference to PHP variable containing the value.
+ * @param mixed $type OPTIONAL Datatype of SQL parameter.
+ * @param mixed $length OPTIONAL Length of SQL parameter.
+ * @param mixed $options OPTIONAL Other options.
+ * @return bool
+ * @throws Zend_Db_Statement_Mysqli_Exception
+ */
+ protected function _bindParam($parameter, &$variable, $type = null, $length = null, $options = null)
+ {
+ return true;
+ }
+
+ /**
+ * Closes the cursor and the statement.
+ *
+ * @return bool
+ */
+ public function close()
+ {
+ if ($this->_stmt) {
+ $r = $this->_stmt->close();
+ $this->_stmt = null;
+ return $r;
+ }
+ return false;
+ }
+
+ /**
+ * Closes the cursor, allowing the statement to be executed again.
+ *
+ * @return bool
+ */
+ public function closeCursor()
+ {
+ if ($stmt = $this->_stmt) {
+ $mysqli = $this->_adapter->getConnection();
+ while ($mysqli->more_results()) {
+ $mysqli->next_result();
+ }
+ $this->_stmt->free_result();
+ return $this->_stmt->reset();
+ }
+ return false;
+ }
+
+ /**
+ * Returns the number of columns in the result set.
+ * Returns null if the statement has no result set metadata.
+ *
+ * @return int The number of columns.
+ */
+ public function columnCount()
+ {
+ if (isset($this->_meta) && $this->_meta) {
+ return $this->_meta->field_count;
+ }
+ return 0;
+ }
+
+ /**
+ * Retrieves the error code, if any, associated with the last operation on
+ * the statement handle.
+ *
+ * @return string error code.
+ */
+ public function errorCode()
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+ return substr($this->_stmt->sqlstate, 0, 5);
+ }
+
+ /**
+ * Retrieves an array of error information, if any, associated with the
+ * last operation on the statement handle.
+ *
+ * @return array
+ */
+ public function errorInfo()
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+ return array(
+ substr($this->_stmt->sqlstate, 0, 5),
+ $this->_stmt->errno,
+ $this->_stmt->error,
+ );
+ }
+
+ /**
+ * Executes a prepared statement.
+ *
+ * @param array $params OPTIONAL Values to bind to parameter placeholders.
+ * @return bool
+ * @throws Zend_Db_Statement_Mysqli_Exception
+ */
+ public function _execute(array $params = null)
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ // if no params were given as an argument to execute(),
+ // then default to the _bindParam array
+ if ($params === null) {
+ $params = $this->_bindParam;
+ }
+ // send $params as input parameters to the statement
+ if ($params) {
+ array_unshift($params, str_repeat('s', count($params)));
+ $stmtParams = array();
+ foreach ($params as $k => &$value) {
+ $stmtParams[$k] = &$value;
+ }
+ call_user_func_array(
+ array($this->_stmt, 'bind_param'),
+ $stmtParams
+ );
+ }
+
+ // execute the statement
+ $retval = $this->_stmt->execute();
+ if ($retval === false) {
+ /**
+ * @see Zend_Db_Statement_Mysqli_Exception
+ */
+ throw new Zend_Db_Statement_Mysqli_Exception("Mysqli statement execute error : " . $this->_stmt->error, $this->_stmt->errno);
+ }
+
+
+ // retain metadata
+ if ($this->_meta === null) {
+ $this->_meta = $this->_stmt->result_metadata();
+ if ($this->_stmt->errno) {
+ /**
+ * @see Zend_Db_Statement_Mysqli_Exception
+ */
+ throw new Zend_Db_Statement_Mysqli_Exception("Mysqli statement metadata error: " . $this->_stmt->error, $this->_stmt->errno);
+ }
+ }
+
+ // statements that have no result set do not return metadata
+ if ($this->_meta !== false) {
+
+ // get the column names that will result
+ $this->_keys = array();
+ foreach ($this->_meta->fetch_fields() as $col) {
+ $this->_keys[] = $this->_adapter->foldCase($col->name);
+ }
+
+ // set up a binding space for result variables
+ $this->_values = array_fill(0, count($this->_keys), null);
+
+ // set up references to the result binding space.
+ // just passing $this->_values in the call_user_func_array()
+ // below won't work, you need references.
+ $refs = array();
+ foreach ($this->_values as $i => &$f) {
+ $refs[$i] = &$f;
+ }
+
+ $this->_stmt->store_result();
+ // bind to the result variables
+ call_user_func_array(
+ array($this->_stmt, 'bind_result'),
+ $this->_values
+ );
+ }
+ return $retval;
+ }
+
+
+ /**
+ * Fetches a row from the result set.
+ *
+ * @param int $style OPTIONAL Fetch mode for this fetch operation.
+ * @param int $cursor OPTIONAL Absolute, relative, or other.
+ * @param int $offset OPTIONAL Number for absolute or relative cursors.
+ * @return mixed Array, object, or scalar depending on fetch mode.
+ * @throws Zend_Db_Statement_Mysqli_Exception
+ */
+ public function fetch($style = null, $cursor = null, $offset = null)
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+ // fetch the next result
+ $retval = $this->_stmt->fetch();
+ switch ($retval) {
+ case null: // end of data
+ case false: // error occurred
+ $this->_stmt->reset();
+ return false;
+ default:
+ // fallthrough
+ }
+
+ // make sure we have a fetch mode
+ if ($style === null) {
+ $style = $this->_fetchMode;
+ }
+
+ // dereference the result values, otherwise things like fetchAll()
+ // return the same values for every entry (because of the reference).
+ $values = array();
+ foreach ($this->_values as $key => $val) {
+ $values[] = $val;
+ }
+
+ $row = false;
+ switch ($style) {
+ case Zend_Db::FETCH_NUM:
+ $row = $values;
+ break;
+ case Zend_Db::FETCH_ASSOC:
+ $row = array_combine($this->_keys, $values);
+ break;
+ case Zend_Db::FETCH_BOTH:
+ $assoc = array_combine($this->_keys, $values);
+ $row = array_merge($values, $assoc);
+ break;
+ case Zend_Db::FETCH_OBJ:
+ $row = (object) array_combine($this->_keys, $values);
+ break;
+ case Zend_Db::FETCH_BOUND:
+ $assoc = array_combine($this->_keys, $values);
+ $row = array_merge($values, $assoc);
+ return $this->_fetchBound($row);
+ break;
+ default:
+ /**
+ * @see Zend_Db_Statement_Mysqli_Exception
+ */
+ throw new Zend_Db_Statement_Mysqli_Exception("Invalid fetch mode '$style' specified");
+ break;
+ }
+ return $row;
+ }
+
+ /**
+ * Retrieves the next rowset (result set) for a SQL statement that has
+ * multiple result sets. An example is a stored procedure that returns
+ * the results of multiple queries.
+ *
+ * @return bool
+ * @throws Zend_Db_Statement_Mysqli_Exception
+ */
+ public function nextRowset()
+ {
+ /**
+ * @see Zend_Db_Statement_Mysqli_Exception
+ */
+ throw new Zend_Db_Statement_Mysqli_Exception(__FUNCTION__.'() is not implemented');
+ }
+
+ /**
+ * Returns the number of rows affected by the execution of the
+ * last INSERT, DELETE, or UPDATE statement executed by this
+ * statement object.
+ *
+ * @return int The number of rows affected.
+ */
+ public function rowCount()
+ {
+ if (!$this->_adapter) {
+ return false;
+ }
+ $mysqli = $this->_adapter->getConnection();
+ return $mysqli->affected_rows;
+ }
+
+}
diff --git a/library/vendor/Zend/Db/Statement/Mysqli/Exception.php b/library/vendor/Zend/Db/Statement/Mysqli/Exception.php
new file mode 100644
index 0000000..89c74ec
--- /dev/null
+++ b/library/vendor/Zend/Db/Statement/Mysqli/Exception.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Db_Statement_Exception
+ */
+
+/**
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+class Zend_Db_Statement_Mysqli_Exception extends Zend_Db_Statement_Exception
+{
+}
+
diff --git a/library/vendor/Zend/Db/Statement/Oracle.php b/library/vendor/Zend/Db/Statement/Oracle.php
new file mode 100644
index 0000000..58a6c28
--- /dev/null
+++ b/library/vendor/Zend/Db/Statement/Oracle.php
@@ -0,0 +1,561 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Db_Statement
+ */
+
+/**
+ * Extends for Oracle.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Statement_Oracle extends Zend_Db_Statement
+{
+
+ /**
+ * Column names.
+ */
+ protected $_keys;
+
+ /**
+ * Fetched result values.
+ */
+ protected $_values;
+
+ /**
+ * Check if LOB field are returned as string
+ * instead of OCI-Lob object
+ *
+ * @var boolean
+ */
+ protected $_lobAsString = false;
+
+ /**
+ * Activate/deactivate return of LOB as string
+ *
+ * @param string $lob_as_string
+ * @return Zend_Db_Statement_Oracle
+ */
+ public function setLobAsString($lob_as_string)
+ {
+ $this->_lobAsString = (bool) $lob_as_string;
+ return $this;
+ }
+
+ /**
+ * Return whether or not LOB are returned as string
+ *
+ * @return boolean
+ */
+ public function getLobAsString()
+ {
+ return $this->_lobAsString;
+ }
+
+ /**
+ * Prepares statement handle
+ *
+ * @param string $sql
+ * @return void
+ * @throws Zend_Db_Statement_Oracle_Exception
+ */
+ protected function _prepare($sql)
+ {
+ $connection = $this->_adapter->getConnection();
+ $this->_stmt = @oci_parse($connection, $sql);
+ if (!$this->_stmt) {
+ /**
+ * @see Zend_Db_Statement_Oracle_Exception
+ */
+ throw new Zend_Db_Statement_Oracle_Exception(oci_error($connection));
+ }
+ }
+
+ /**
+ * Binds a parameter to the specified variable name.
+ *
+ * @param mixed $parameter Name the parameter, either integer or string.
+ * @param mixed $variable Reference to PHP variable containing the value.
+ * @param mixed $type OPTIONAL Datatype of SQL parameter.
+ * @param mixed $length OPTIONAL Length of SQL parameter.
+ * @param mixed $options OPTIONAL Other options.
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ protected function _bindParam($parameter, &$variable, $type = null, $length = null, $options = null)
+ {
+ // default value
+ if ($type === NULL) {
+ $type = SQLT_CHR;
+ }
+
+ // default value
+ if ($length === NULL) {
+ $length = -1;
+ }
+
+ $retval = @oci_bind_by_name($this->_stmt, $parameter, $variable, $length, $type);
+ if ($retval === false) {
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Statement_Oracle_Exception(oci_error($this->_stmt));
+ }
+
+ return true;
+ }
+
+ /**
+ * Closes the cursor, allowing the statement to be executed again.
+ *
+ * @return bool
+ */
+ public function closeCursor()
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ oci_free_statement($this->_stmt);
+ $this->_stmt = false;
+ return true;
+ }
+
+ /**
+ * Returns the number of columns in the result set.
+ * Returns null if the statement has no result set metadata.
+ *
+ * @return int The number of columns.
+ */
+ public function columnCount()
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ return oci_num_fields($this->_stmt);
+ }
+
+
+ /**
+ * Retrieves the error code, if any, associated with the last operation on
+ * the statement handle.
+ *
+ * @return string error code.
+ */
+ public function errorCode()
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ $error = oci_error($this->_stmt);
+
+ if (!$error) {
+ return false;
+ }
+
+ return $error['code'];
+ }
+
+
+ /**
+ * Retrieves an array of error information, if any, associated with the
+ * last operation on the statement handle.
+ *
+ * @return array
+ */
+ public function errorInfo()
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ $error = oci_error($this->_stmt);
+ if (!$error) {
+ return false;
+ }
+
+ if (isset($error['sqltext'])) {
+ return array(
+ $error['code'],
+ $error['message'],
+ $error['offset'],
+ $error['sqltext'],
+ );
+ } else {
+ return array(
+ $error['code'],
+ $error['message'],
+ );
+ }
+ }
+
+
+ /**
+ * Executes a prepared statement.
+ *
+ * @param array $params OPTIONAL Values to bind to parameter placeholders.
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function _execute(array $params = null)
+ {
+ $connection = $this->_adapter->getConnection();
+
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ if ($params !== null) {
+ if (!is_array($params)) {
+ $params = array($params);
+ }
+ $error = false;
+ foreach (array_keys($params) as $name) {
+ if (!$this->bindParam($name, $params[$name], null, -1)) {
+ $error = true;
+ break;
+ }
+ }
+ if ($error) {
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Statement_Oracle_Exception(oci_error($this->_stmt));
+ }
+ }
+
+ $retval = @oci_execute($this->_stmt, $this->_adapter->_getExecuteMode());
+ if ($retval === false) {
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Statement_Oracle_Exception(oci_error($this->_stmt));
+ }
+
+ $this->_keys = Array();
+ if ($field_num = oci_num_fields($this->_stmt)) {
+ for ($i = 1; $i <= $field_num; $i++) {
+ $name = oci_field_name($this->_stmt, $i);
+ $this->_keys[] = $name;
+ }
+ }
+
+ $this->_values = Array();
+ if ($this->_keys) {
+ $this->_values = array_fill(0, count($this->_keys), null);
+ }
+
+ return $retval;
+ }
+
+ /**
+ * Fetches a row from the result set.
+ *
+ * @param int $style OPTIONAL Fetch mode for this fetch operation.
+ * @param int $cursor OPTIONAL Absolute, relative, or other.
+ * @param int $offset OPTIONAL Number for absolute or relative cursors.
+ * @return mixed Array, object, or scalar depending on fetch mode.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function fetch($style = null, $cursor = null, $offset = null)
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ if ($style === null) {
+ $style = $this->_fetchMode;
+ }
+
+ $lob_as_string = $this->getLobAsString() ? OCI_RETURN_LOBS : 0;
+
+ switch ($style) {
+ case Zend_Db::FETCH_NUM:
+ $row = oci_fetch_array($this->_stmt, OCI_NUM | OCI_RETURN_NULLS | $lob_as_string);
+ break;
+ case Zend_Db::FETCH_ASSOC:
+ $row = oci_fetch_array($this->_stmt, OCI_ASSOC | OCI_RETURN_NULLS | $lob_as_string);
+ break;
+ case Zend_Db::FETCH_BOTH:
+ $row = oci_fetch_array($this->_stmt, OCI_BOTH | OCI_RETURN_NULLS | $lob_as_string);
+ break;
+ case Zend_Db::FETCH_OBJ:
+ $row = oci_fetch_object($this->_stmt);
+ break;
+ case Zend_Db::FETCH_BOUND:
+ $row = oci_fetch_array($this->_stmt, OCI_BOTH | OCI_RETURN_NULLS | $lob_as_string);
+ if ($row !== false) {
+ return $this->_fetchBound($row);
+ }
+ break;
+ default:
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Statement_Oracle_Exception(
+ array(
+ 'code' => 'HYC00',
+ 'message' => "Invalid fetch mode '$style' specified"
+ )
+ );
+ break;
+ }
+
+ if (! $row && $error = oci_error($this->_stmt)) {
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Statement_Oracle_Exception($error);
+ }
+
+ if (is_array($row) && array_key_exists('zend_db_rownum', $row)) {
+ unset($row['zend_db_rownum']);
+ }
+
+ return $row;
+ }
+
+ /**
+ * Returns an array containing all of the result set rows.
+ *
+ * @param int $style OPTIONAL Fetch mode.
+ * @param int $col OPTIONAL Column number, if fetch mode is by column.
+ * @return array Collection of rows, each in a format by the fetch mode.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function fetchAll($style = null, $col = 0)
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ // make sure we have a fetch mode
+ if ($style === null) {
+ $style = $this->_fetchMode;
+ }
+
+ $flags = OCI_FETCHSTATEMENT_BY_ROW;
+
+ switch ($style) {
+ case Zend_Db::FETCH_BOTH:
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Statement_Oracle_Exception(
+ array(
+ 'code' => 'HYC00',
+ 'message' => "OCI8 driver does not support fetchAll(FETCH_BOTH), use fetch() in a loop instead"
+ )
+ );
+ // notreached
+ $flags |= OCI_NUM;
+ $flags |= OCI_ASSOC;
+ break;
+ case Zend_Db::FETCH_NUM:
+ $flags |= OCI_NUM;
+ break;
+ case Zend_Db::FETCH_ASSOC:
+ $flags |= OCI_ASSOC;
+ break;
+ case Zend_Db::FETCH_OBJ:
+ break;
+ case Zend_Db::FETCH_COLUMN:
+ $flags = $flags &~ OCI_FETCHSTATEMENT_BY_ROW;
+ $flags |= OCI_FETCHSTATEMENT_BY_COLUMN;
+ $flags |= OCI_NUM;
+ break;
+ default:
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Statement_Oracle_Exception(
+ array(
+ 'code' => 'HYC00',
+ 'message' => "Invalid fetch mode '$style' specified"
+ )
+ );
+ break;
+ }
+
+ $result = Array();
+ if ($flags != OCI_FETCHSTATEMENT_BY_ROW) { /* not Zend_Db::FETCH_OBJ */
+ if (! ($rows = oci_fetch_all($this->_stmt, $result, 0, -1, $flags) )) {
+ if ($error = oci_error($this->_stmt)) {
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Statement_Oracle_Exception($error);
+ }
+ if (!$rows) {
+ return array();
+ }
+ }
+ if ($style == Zend_Db::FETCH_COLUMN) {
+ $result = $result[$col];
+ }
+ foreach ($result as &$row) {
+ if (is_array($row) && array_key_exists('zend_db_rownum', $row)) {
+ unset($row['zend_db_rownum']);
+ }
+ }
+ } else {
+ while (($row = oci_fetch_object($this->_stmt)) !== false) {
+ $result [] = $row;
+ }
+ if ($error = oci_error($this->_stmt)) {
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Statement_Oracle_Exception($error);
+ }
+ }
+
+ return $result;
+ }
+
+
+ /**
+ * Returns a single column from the next row of a result set.
+ *
+ * @param int $col OPTIONAL Position of the column to fetch.
+ * @return string
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function fetchColumn($col = 0)
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ if (!oci_fetch($this->_stmt)) {
+ // if no error, there is simply no record
+ if (!$error = oci_error($this->_stmt)) {
+ return false;
+ }
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Statement_Oracle_Exception($error);
+ }
+
+ $data = oci_result($this->_stmt, $col+1); //1-based
+ if ($data === false) {
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Statement_Oracle_Exception(oci_error($this->_stmt));
+ }
+
+ if ($this->getLobAsString()) {
+ // instanceof doesn't allow '-', we must use a temporary string
+ $type = 'OCI-Lob';
+ if ($data instanceof $type) {
+ $data = $data->read($data->size());
+ }
+ }
+
+ return $data;
+ }
+
+ /**
+ * Fetches the next row and returns it as an object.
+ *
+ * @param string $class OPTIONAL Name of the class to create.
+ * @param array $config OPTIONAL Constructor arguments for the class.
+ * @return mixed One object instance of the specified class.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function fetchObject($class = 'stdClass', array $config = array())
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ $obj = oci_fetch_object($this->_stmt);
+
+ if ($error = oci_error($this->_stmt)) {
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Statement_Oracle_Exception($error);
+ }
+
+ /* @todo XXX handle parameters */
+
+ return $obj;
+ }
+
+ /**
+ * Retrieves the next rowset (result set) for a SQL statement that has
+ * multiple result sets. An example is a stored procedure that returns
+ * the results of multiple queries.
+ *
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function nextRowset()
+ {
+ /**
+ * @see Zend_Db_Statement_Oracle_Exception
+ */
+ throw new Zend_Db_Statement_Oracle_Exception(
+ array(
+ 'code' => 'HYC00',
+ 'message' => 'Optional feature not implemented'
+ )
+ );
+ }
+
+ /**
+ * Returns the number of rows affected by the execution of the
+ * last INSERT, DELETE, or UPDATE statement executed by this
+ * statement object.
+ *
+ * @return int The number of rows affected.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function rowCount()
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ $num_rows = oci_num_rows($this->_stmt);
+
+ if ($num_rows === false) {
+ /**
+ * @see Zend_Db_Adapter_Oracle_Exception
+ */
+ throw new Zend_Db_Statement_Oracle_Exception(oci_error($this->_stmt));
+ }
+
+ return $num_rows;
+ }
+
+}
diff --git a/library/vendor/Zend/Db/Statement/Oracle/Exception.php b/library/vendor/Zend/Db/Statement/Oracle/Exception.php
new file mode 100644
index 0000000..feaa4cb
--- /dev/null
+++ b/library/vendor/Zend/Db/Statement/Oracle/Exception.php
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Db_Statement_Exception
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+class Zend_Db_Statement_Oracle_Exception extends Zend_Db_Statement_Exception
+{
+ protected $message = 'Unknown exception';
+ protected $code = 0;
+
+ function __construct($error = null, $code = 0)
+ {
+ if (is_array($error)) {
+ if (!isset($error['offset'])) {
+ $this->message = $error['code']." ".$error['message'];
+ } else {
+ $this->message = $error['code']." ".$error['message']." ";
+ $this->message .= substr($error['sqltext'], 0, $error['offset']);
+ $this->message .= "*";
+ $this->message .= substr($error['sqltext'], $error['offset']);
+ }
+ $this->code = $error['code'];
+ }
+ if (!$this->code && $code) {
+ $this->code = $code;
+ }
+ }
+}
+
diff --git a/library/vendor/Zend/Db/Statement/Pdo.php b/library/vendor/Zend/Db/Statement/Pdo.php
new file mode 100644
index 0000000..47f9031
--- /dev/null
+++ b/library/vendor/Zend/Db/Statement/Pdo.php
@@ -0,0 +1,426 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Db_Statement
+ */
+
+/**
+ * Proxy class to wrap a PDOStatement object.
+ * Matches the interface of PDOStatement. All methods simply proxy to the
+ * matching method in PDOStatement. PDOExceptions thrown by PDOStatement
+ * are re-thrown as Zend_Db_Statement_Exception.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Statement_Pdo extends Zend_Db_Statement implements IteratorAggregate
+{
+
+ /**
+ * @var int
+ */
+ protected $_fetchMode = PDO::FETCH_ASSOC;
+
+ /**
+ * Prepare a string SQL statement and create a statement object.
+ *
+ * @param string $sql
+ * @return void
+ * @throws Zend_Db_Statement_Exception
+ */
+ protected function _prepare($sql)
+ {
+ try {
+ $this->_stmt = $this->_adapter->getConnection()->prepare($sql);
+ } catch (PDOException $e) {
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Bind a column of the statement result set to a PHP variable.
+ *
+ * @param string $column Name the column in the result set, either by
+ * position or by name.
+ * @param mixed $param Reference to the PHP variable containing the value.
+ * @param mixed $type OPTIONAL
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function bindColumn($column, &$param, $type = null)
+ {
+ try {
+ if ($type === null) {
+ return $this->_stmt->bindColumn($column, $param);
+ } else {
+ return $this->_stmt->bindColumn($column, $param, $type);
+ }
+ } catch (PDOException $e) {
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Binds a parameter to the specified variable name.
+ *
+ * @param mixed $parameter Name the parameter, either integer or string.
+ * @param mixed $variable Reference to PHP variable containing the value.
+ * @param mixed $type OPTIONAL Datatype of SQL parameter.
+ * @param mixed $length OPTIONAL Length of SQL parameter.
+ * @param mixed $options OPTIONAL Other options.
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ protected function _bindParam($parameter, &$variable, $type = null, $length = null, $options = null)
+ {
+ try {
+ if ($type === null) {
+ if (is_bool($variable)) {
+ $type = PDO::PARAM_BOOL;
+ } elseif ($variable === null) {
+ $type = PDO::PARAM_NULL;
+ } elseif (is_integer($variable)) {
+ $type = PDO::PARAM_INT;
+ } else {
+ $type = PDO::PARAM_STR;
+ }
+ }
+ return $this->_stmt->bindParam($parameter, $variable, $type, $length, $options);
+ } catch (PDOException $e) {
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Binds a value to a parameter.
+ *
+ * @param mixed $parameter Name the parameter, either integer or string.
+ * @param mixed $value Scalar value to bind to the parameter.
+ * @param mixed $type OPTIONAL Datatype of the parameter.
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function bindValue($parameter, $value, $type = null)
+ {
+ if (is_string($parameter) && $parameter[0] != ':') {
+ $parameter = ":$parameter";
+ }
+
+ $this->_bindParam[$parameter] = $value;
+
+ try {
+ if ($type === null) {
+ return $this->_stmt->bindValue($parameter, $value);
+ } else {
+ return $this->_stmt->bindValue($parameter, $value, $type);
+ }
+ } catch (PDOException $e) {
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Closes the cursor, allowing the statement to be executed again.
+ *
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function closeCursor()
+ {
+ try {
+ return $this->_stmt->closeCursor();
+ } catch (PDOException $e) {
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Returns the number of columns in the result set.
+ * Returns null if the statement has no result set metadata.
+ *
+ * @return int The number of columns.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function columnCount()
+ {
+ try {
+ return $this->_stmt->columnCount();
+ } catch (PDOException $e) {
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Retrieves the error code, if any, associated with the last operation on
+ * the statement handle.
+ *
+ * @return string error code.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function errorCode()
+ {
+ try {
+ return $this->_stmt->errorCode();
+ } catch (PDOException $e) {
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Retrieves an array of error information, if any, associated with the
+ * last operation on the statement handle.
+ *
+ * @return array
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function errorInfo()
+ {
+ try {
+ return $this->_stmt->errorInfo();
+ } catch (PDOException $e) {
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Executes a prepared statement.
+ *
+ * @param array $params OPTIONAL Values to bind to parameter placeholders.
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function _execute(array $params = null)
+ {
+ try {
+ if ($params !== null) {
+ return $this->_stmt->execute($params);
+ } else {
+ return $this->_stmt->execute();
+ }
+ } catch (PDOException $e) {
+ $message = sprintf('%s, query was: %s', $e->getMessage(), $this->_stmt->queryString);
+ throw new Zend_Db_Statement_Exception($message, (int) $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Fetches a row from the result set.
+ *
+ * @param int $style OPTIONAL Fetch mode for this fetch operation.
+ * @param int $cursor OPTIONAL Absolute, relative, or other.
+ * @param int $offset OPTIONAL Number for absolute or relative cursors.
+ * @return mixed Array, object, or scalar depending on fetch mode.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function fetch($style = null, $cursor = null, $offset = null)
+ {
+ if ($style === null) {
+ $style = $this->_fetchMode;
+ }
+ if ($cursor === null) {
+ $cursor = PDO::FETCH_ORI_NEXT;
+ }
+ if ($offset === null) {
+ $offset = 0;
+ }
+ try {
+ return $this->_stmt->fetch($style, $cursor, $offset);
+ } catch (PDOException $e) {
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Required by IteratorAggregate interface
+ *
+ * @return IteratorIterator
+ */
+ public function getIterator(): Traversable
+ {
+ return new IteratorIterator($this->_stmt);
+ }
+
+ /**
+ * Returns an array containing all of the result set rows.
+ *
+ * @param int $style OPTIONAL Fetch mode.
+ * @param int $col OPTIONAL Column number, if fetch mode is by column.
+ * @return array Collection of rows, each in a format by the fetch mode.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function fetchAll($style = null, $col = null)
+ {
+ if ($style === null) {
+ $style = $this->_fetchMode;
+ }
+ try {
+ if ($style == PDO::FETCH_COLUMN) {
+ if ($col === null) {
+ $col = 0;
+ }
+ return $this->_stmt->fetchAll($style, $col);
+ } else {
+ return $this->_stmt->fetchAll($style);
+ }
+ } catch (PDOException $e) {
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Returns a single column from the next row of a result set.
+ *
+ * @param int $col OPTIONAL Position of the column to fetch.
+ * @return string
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function fetchColumn($col = 0)
+ {
+ try {
+ return $this->_stmt->fetchColumn($col);
+ } catch (PDOException $e) {
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Fetches the next row and returns it as an object.
+ *
+ * @param string $class OPTIONAL Name of the class to create.
+ * @param array $config OPTIONAL Constructor arguments for the class.
+ * @return mixed One object instance of the specified class.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function fetchObject($class = 'stdClass', array $config = array())
+ {
+ try {
+ return $this->_stmt->fetchObject($class, $config);
+ } catch (PDOException $e) {
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Retrieve a statement attribute.
+ *
+ * @param integer $key Attribute name.
+ * @return mixed Attribute value.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function getAttribute($key)
+ {
+ try {
+ return $this->_stmt->getAttribute($key);
+ } catch (PDOException $e) {
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Returns metadata for a column in a result set.
+ *
+ * @param int $column
+ * @return mixed
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function getColumnMeta($column)
+ {
+ try {
+ return $this->_stmt->getColumnMeta($column);
+ } catch (PDOException $e) {
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Retrieves the next rowset (result set) for a SQL statement that has
+ * multiple result sets. An example is a stored procedure that returns
+ * the results of multiple queries.
+ *
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function nextRowset()
+ {
+ try {
+ return $this->_stmt->nextRowset();
+ } catch (PDOException $e) {
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Returns the number of rows affected by the execution of the
+ * last INSERT, DELETE, or UPDATE statement executed by this
+ * statement object.
+ *
+ * @return int The number of rows affected.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function rowCount()
+ {
+ try {
+ return $this->_stmt->rowCount();
+ } catch (PDOException $e) {
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Set a statement attribute.
+ *
+ * @param string $key Attribute name.
+ * @param mixed $val Attribute value.
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function setAttribute($key, $val)
+ {
+ try {
+ return $this->_stmt->setAttribute($key, $val);
+ } catch (PDOException $e) {
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ /**
+ * Set the default fetch mode for this statement.
+ *
+ * @param int $mode The fetch mode.
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function setFetchMode($mode)
+ {
+ $this->_fetchMode = $mode;
+ try {
+ return $this->_stmt->setFetchMode($mode);
+ } catch (PDOException $e) {
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+}
diff --git a/library/vendor/Zend/Db/Statement/Pdo/Ibm.php b/library/vendor/Zend/Db/Statement/Pdo/Ibm.php
new file mode 100644
index 0000000..84f265e
--- /dev/null
+++ b/library/vendor/Zend/Db/Statement/Pdo/Ibm.php
@@ -0,0 +1,92 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Db_Statement_Pdo
+ */
+
+/**
+ * Proxy class to wrap a PDOStatement object for IBM Databases.
+ * Matches the interface of PDOStatement. All methods simply proxy to the
+ * matching method in PDOStatement. PDOExceptions thrown by PDOStatement
+ * are re-thrown as Zend_Db_Statement_Exception.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Statement_Pdo_Ibm extends Zend_Db_Statement_Pdo
+{
+ /**
+ * Returns an array containing all of the result set rows.
+ *
+ * Behaves like parent, but if limit()
+ * is used, the final result removes the extra column
+ * 'zend_db_rownum'
+ *
+ * @param int $style OPTIONAL Fetch mode.
+ * @param int $col OPTIONAL Column number, if fetch mode is by column.
+ * @return array Collection of rows, each in a format by the fetch mode.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function fetchAll($style = null, $col = null)
+ {
+ $data = parent::fetchAll($style, $col);
+ $results = array();
+ $remove = $this->_adapter->foldCase('ZEND_DB_ROWNUM');
+
+ foreach ($data as $row) {
+ if (is_array($row) && array_key_exists($remove, $row)) {
+ unset($row[$remove]);
+ }
+ $results[] = $row;
+ }
+ return $results;
+ }
+
+ /**
+ * Binds a parameter to the specified variable name.
+ *
+ * @param mixed $parameter Name the parameter, either integer or string.
+ * @param mixed $variable Reference to PHP variable containing the value.
+ * @param mixed $type OPTIONAL Datatype of SQL parameter.
+ * @param mixed $length OPTIONAL Length of SQL parameter.
+ * @param mixed $options OPTIONAL Other options.
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function _bindParam($parameter, &$variable, $type = null, $length = null, $options = null)
+ {
+ try {
+ if (($type === null) && ($length === null) && ($options === null)) {
+ return $this->_stmt->bindParam($parameter, $variable);
+ } else {
+ return $this->_stmt->bindParam($parameter, $variable, $type, $length, $options);
+ }
+ } catch (PDOException $e) {
+ throw new Zend_Db_Statement_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+}
diff --git a/library/vendor/Zend/Db/Statement/Pdo/Oci.php b/library/vendor/Zend/Db/Statement/Pdo/Oci.php
new file mode 100644
index 0000000..79334ad
--- /dev/null
+++ b/library/vendor/Zend/Db/Statement/Pdo/Oci.php
@@ -0,0 +1,90 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Db_Statement_Pdo
+ */
+
+/**
+ * Proxy class to wrap a PDOStatement object for IBM Databases.
+ * Matches the interface of PDOStatement. All methods simply proxy to the
+ * matching method in PDOStatement. PDOExceptions thrown by PDOStatement
+ * are re-thrown as Zend_Db_Statement_Exception.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Statement_Pdo_Oci extends Zend_Db_Statement_Pdo
+{
+
+ /**
+ * Returns an array containing all of the result set rows.
+ *
+ * Behaves like parent, but if limit()
+ * is used, the final result removes the extra column
+ * 'zend_db_rownum'
+ *
+ * @param int $style OPTIONAL Fetch mode.
+ * @param int $col OPTIONAL Column number, if fetch mode is by column.
+ * @return array Collection of rows, each in a format by the fetch mode.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function fetchAll($style = null, $col = null)
+ {
+ $data = parent::fetchAll($style, $col);
+ $results = array();
+ $remove = $this->_adapter->foldCase('zend_db_rownum');
+
+ foreach ($data as $row) {
+ if (is_array($row) && array_key_exists($remove, $row)) {
+ unset($row[$remove]);
+ }
+ $results[] = $row;
+ }
+ return $results;
+ }
+
+
+ /**
+ * Fetches a row from the result set.
+ *
+ * @param int $style OPTIONAL Fetch mode for this fetch operation.
+ * @param int $cursor OPTIONAL Absolute, relative, or other.
+ * @param int $offset OPTIONAL Number for absolute or relative cursors.
+ * @return mixed Array, object, or scalar depending on fetch mode.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function fetch($style = null, $cursor = null, $offset = null)
+ {
+ $row = parent::fetch($style, $cursor, $offset);
+
+ $remove = $this->_adapter->foldCase('zend_db_rownum');
+ if (is_array($row) && array_key_exists($remove, $row)) {
+ unset($row[$remove]);
+ }
+
+ return $row;
+ }
+}
diff --git a/library/vendor/Zend/Db/Statement/Sqlsrv.php b/library/vendor/Zend/Db/Statement/Sqlsrv.php
new file mode 100644
index 0000000..84294e8
--- /dev/null
+++ b/library/vendor/Zend/Db/Statement/Sqlsrv.php
@@ -0,0 +1,430 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Db_Statement
+ */
+
+/**
+ * Extends for Microsoft SQL Server Driver for PHP
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Statement_Sqlsrv extends Zend_Db_Statement
+{
+
+ /**
+ * The connection_stmt object original string.
+ */
+ protected $_originalSQL;
+
+ /**
+ * Column names.
+ */
+ protected $_keys;
+
+ /**
+ * Query executed
+ */
+ protected $_executed = false;
+
+ /**
+ * Prepares statement handle
+ *
+ * @param string $sql
+ * @return void
+ * @throws Zend_Db_Statement_Sqlsrv_Exception
+ */
+ protected function _prepare($sql)
+ {
+ $connection = $this->_adapter->getConnection();
+
+ $this->_stmt = sqlsrv_prepare($connection, $sql);
+
+ if (!$this->_stmt) {
+ throw new Zend_Db_Statement_Sqlsrv_Exception(sqlsrv_errors());
+ }
+
+ $this->_originalSQL = $sql;
+ }
+
+ /**
+ * Binds a parameter to the specified variable name.
+ *
+ * @param mixed $parameter Name the parameter, either integer or string.
+ * @param mixed $variable Reference to PHP variable containing the value.
+ * @param mixed $type OPTIONAL Datatype of SQL parameter.
+ * @param mixed $length OPTIONAL Length of SQL parameter.
+ * @param mixed $options OPTIONAL Other options.
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ protected function _bindParam($parameter, &$variable, $type = null, $length = null, $options = null)
+ {
+ //Sql server doesn't support bind by name
+ return true;
+ }
+
+ /**
+ * Closes the cursor, allowing the statement to be executed again.
+ *
+ * @return bool
+ */
+ public function closeCursor()
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ sqlsrv_free_stmt($this->_stmt);
+ $this->_stmt = false;
+ return true;
+ }
+
+ /**
+ * Returns the number of columns in the result set.
+ * Returns null if the statement has no result set metadata.
+ *
+ * @return int The number of columns.
+ */
+ public function columnCount()
+ {
+ if ($this->_stmt && $this->_executed) {
+ return sqlsrv_num_fields($this->_stmt);
+ }
+
+ return 0;
+ }
+
+
+ /**
+ * Retrieves the error code, if any, associated with the last operation on
+ * the statement handle.
+ *
+ * @return string error code.
+ */
+ public function errorCode()
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ $error = sqlsrv_errors();
+ if (!$error) {
+ return false;
+ }
+
+ return $error[0]['code'];
+ }
+
+
+ /**
+ * Retrieves an array of error information, if any, associated with the
+ * last operation on the statement handle.
+ *
+ * @return array
+ */
+ public function errorInfo()
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ $error = sqlsrv_errors();
+ if (!$error) {
+ return false;
+ }
+
+ return array(
+ $error[0]['code'],
+ $error[0]['message'],
+ );
+ }
+
+
+ /**
+ * Executes a prepared statement.
+ *
+ * @param array $params OPTIONAL Values to bind to parameter placeholders.
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function _execute(array $params = null)
+ {
+ $connection = $this->_adapter->getConnection();
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ if ($params !== null) {
+ if (!is_array($params)) {
+ $params = array($params);
+ }
+ $error = false;
+
+ // make all params passed by reference
+ $params_ = array();
+ $temp = array();
+ $i = 1;
+ foreach ($params as $param) {
+ $temp[$i] = $param;
+ $params_[] = &$temp[$i];
+ $i++;
+ }
+ $params = $params_;
+ }
+
+ $this->_stmt = sqlsrv_query($connection, $this->_originalSQL, $params);
+
+ if (!$this->_stmt) {
+ throw new Zend_Db_Statement_Sqlsrv_Exception(sqlsrv_errors());
+ }
+
+ $this->_executed = true;
+
+ return (!$this->_stmt);
+ }
+
+ /**
+ * Fetches a row from the result set.
+ *
+ * @param int $style OPTIONAL Fetch mode for this fetch operation.
+ * @param int $cursor OPTIONAL Absolute, relative, or other.
+ * @param int $offset OPTIONAL Number for absolute or relative cursors.
+ * @return mixed Array, object, or scalar depending on fetch mode.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function fetch($style = null, $cursor = null, $offset = null)
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ if (null === $style) {
+ $style = $this->_fetchMode;
+ }
+
+ $values = sqlsrv_fetch_array($this->_stmt, SQLSRV_FETCH_ASSOC);
+
+ if (!$values && (null !== $error = sqlsrv_errors())) {
+ throw new Zend_Db_Statement_Sqlsrv_Exception($error);
+ }
+
+ if (null === $values) {
+ return null;
+ }
+
+ if (!$this->_keys) {
+ foreach ($values as $key => $value) {
+ $this->_keys[] = $this->_adapter->foldCase($key);
+ }
+ }
+
+ $values = array_values($values);
+
+ $row = false;
+ switch ($style) {
+ case Zend_Db::FETCH_NUM:
+ $row = $values;
+ break;
+ case Zend_Db::FETCH_ASSOC:
+ $row = array_combine($this->_keys, $values);
+ break;
+ case Zend_Db::FETCH_BOTH:
+ $assoc = array_combine($this->_keys, $values);
+ $row = array_merge($values, $assoc);
+ break;
+ case Zend_Db::FETCH_OBJ:
+ $row = (object) array_combine($this->_keys, $values);
+ break;
+ case Zend_Db::FETCH_BOUND:
+ $assoc = array_combine($this->_keys, $values);
+ $row = array_merge($values, $assoc);
+ $row = $this->_fetchBound($row);
+ break;
+ default:
+ throw new Zend_Db_Statement_Sqlsrv_Exception("Invalid fetch mode '$style' specified");
+ break;
+ }
+
+ return $row;
+ }
+
+ /**
+ * Returns a single column from the next row of a result set.
+ *
+ * @param int $col OPTIONAL Position of the column to fetch.
+ * @return string
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function fetchColumn($col = 0)
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ if (!sqlsrv_fetch($this->_stmt)) {
+ if (null !== $error = sqlsrv_errors()) {
+ throw new Zend_Db_Statement_Sqlsrv_Exception($error);
+ }
+
+ // If no error, there is simply no record
+ return false;
+ }
+
+ $data = sqlsrv_get_field($this->_stmt, $col); //0-based
+ if ($data === false) {
+ throw new Zend_Db_Statement_Sqlsrv_Exception(sqlsrv_errors());
+ }
+
+ return $data;
+ }
+
+ /**
+ * Fetches the next row and returns it as an object.
+ *
+ * @param string $class OPTIONAL Name of the class to create.
+ * @param array $config OPTIONAL Constructor arguments for the class.
+ * @return mixed One object instance of the specified class.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function fetchObject($class = 'stdClass', array $config = array())
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ $obj = sqlsrv_fetch_object($this->_stmt);
+
+ if ($error = sqlsrv_errors()) {
+ throw new Zend_Db_Statement_Sqlsrv_Exception($error);
+ }
+
+ /* @todo XXX handle parameters */
+
+ if (null === $obj) {
+ return false;
+ }
+
+ return $obj;
+ }
+
+ /**
+ * Returns metadata for a column in a result set.
+ *
+ * @param int $column
+ * @return mixed
+ * @throws Zend_Db_Statement_Sqlsrv_Exception
+ */
+ public function getColumnMeta($column)
+ {
+ $fields = sqlsrv_field_metadata($this->_stmt);
+
+ if (!$fields) {
+ throw new Zend_Db_Statement_Sqlsrv_Exception('Column metadata can not be fetched');
+ }
+
+ if (!isset($fields[$column])) {
+ throw new Zend_Db_Statement_Sqlsrv_Exception('Column index does not exist in statement');
+ }
+
+ return $fields[$column];
+ }
+
+ /**
+ * Retrieves the next rowset (result set) for a SQL statement that has
+ * multiple result sets. An example is a stored procedure that returns
+ * the results of multiple queries.
+ *
+ * @return bool
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function nextRowset()
+ {
+ if (sqlsrv_next_result($this->_stmt) === false) {
+ throw new Zend_Db_Statement_Sqlsrv_Exception(sqlsrv_errors());
+ }
+
+ // reset column keys
+ $this->_keys = null;
+
+ return true;
+ }
+
+ /**
+ * Returns the number of rows affected by the execution of the
+ * last INSERT, DELETE, or UPDATE statement executed by this
+ * statement object.
+ *
+ * @return int The number of rows affected.
+ * @throws Zend_Db_Statement_Exception
+ */
+ public function rowCount()
+ {
+ if (!$this->_stmt) {
+ return false;
+ }
+
+ if (!$this->_executed) {
+ return 0;
+ }
+
+ $num_rows = sqlsrv_rows_affected($this->_stmt);
+
+ // Strict check is necessary; 0 is a valid return value
+ if ($num_rows === false) {
+ throw new Zend_Db_Statement_Sqlsrv_Exception(sqlsrv_errors());
+ }
+
+ return $num_rows;
+ }
+
+ /**
+ * Returns an array containing all of the result set rows.
+ *
+ * @param int $style OPTIONAL Fetch mode.
+ * @param int $col OPTIONAL Column number, if fetch mode is by column.
+ * @return array Collection of rows, each in a format by the fetch mode.
+ *
+ * Behaves like parent, but if limit()
+ * is used, the final result removes the extra column
+ * 'zend_db_rownum'
+ */
+ public function fetchAll($style = null, $col = null)
+ {
+ $data = parent::fetchAll($style, $col);
+ $results = array();
+ $remove = $this->_adapter->foldCase('ZEND_DB_ROWNUM');
+
+ foreach ($data as $row) {
+ if (is_array($row) && array_key_exists($remove, $row)) {
+ unset($row[$remove]);
+ }
+ $results[] = $row;
+ }
+ return $results;
+ }
+}
diff --git a/library/vendor/Zend/Db/Statement/Sqlsrv/Exception.php b/library/vendor/Zend/Db/Statement/Sqlsrv/Exception.php
new file mode 100644
index 0000000..3358f3b
--- /dev/null
+++ b/library/vendor/Zend/Db/Statement/Sqlsrv/Exception.php
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Db_Statement_Exception
+ */
+
+/**
+ * @package Zend_Db
+ * @subpackage Statement
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Statement_Sqlsrv_Exception extends Zend_Db_Statement_Exception
+{
+ /**
+ * Constructor
+ *
+ * If $message is an array, the assumption is that the return value of
+ * sqlsrv_errors() was provided. If so, it then retrieves the most recent
+ * error from that stack, and sets the message and code based on it.
+ *
+ * @param null|array|string $message
+ * @param null|int $code
+ */
+ public function __construct($message = null, $code = 0)
+ {
+ if (is_array($message)) {
+ // Error should be array of errors
+ // We only need first one (?)
+ if (isset($message[0])) {
+ $message = $message[0];
+ }
+
+ $code = (int) $message['code'];
+ $message = (string) $message['message'];
+ }
+ parent::__construct($message, $code);
+ }
+}
+
diff --git a/library/vendor/Zend/Db/Table.php b/library/vendor/Zend/Db/Table.php
new file mode 100644
index 0000000..0dbfe8c
--- /dev/null
+++ b/library/vendor/Zend/Db/Table.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Db_Table_Abstract
+ */
+
+/**
+ * @see Zend_Db_Table_Definition
+ */
+
+/**
+ * Class for SQL table interface.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Table extends Zend_Db_Table_Abstract
+{
+
+ /**
+ * __construct() - For concrete implementation of Zend_Db_Table
+ *
+ * @param string|array $config string can reference a Zend_Registry key for a db adapter
+ * OR it can reference the name of a table
+ * @param array|Zend_Db_Table_Definition $definition
+ */
+ public function __construct($config = array(), $definition = null)
+ {
+ if ($definition !== null && is_array($definition)) {
+ $definition = new Zend_Db_Table_Definition($definition);
+ }
+
+ if (is_string($config)) {
+ if (Zend_Registry::isRegistered($config)) {
+ trigger_error(__CLASS__ . '::' . __METHOD__ . '(\'registryName\') is not valid usage of Zend_Db_Table, '
+ . 'try extending Zend_Db_Table_Abstract in your extending classes.',
+ E_USER_NOTICE
+ );
+ $config = array(self::ADAPTER => $config);
+ } else {
+ // process this as table with or without a definition
+ if ($definition instanceof Zend_Db_Table_Definition
+ && $definition->hasTableConfig($config)) {
+ // this will have DEFINITION_CONFIG_NAME & DEFINITION
+ $config = $definition->getTableConfig($config);
+ } else {
+ $config = array(self::NAME => $config);
+ }
+ }
+ }
+
+ parent::__construct($config);
+ }
+}
diff --git a/library/vendor/Zend/Db/Table/Abstract.php b/library/vendor/Zend/Db/Table/Abstract.php
new file mode 100644
index 0000000..ea393f2
--- /dev/null
+++ b/library/vendor/Zend/Db/Table/Abstract.php
@@ -0,0 +1,1599 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Db_Adapter_Abstract
+ */
+
+/**
+ * @see Zend_Db_Adapter_Abstract
+ */
+
+/**
+ * @see Zend_Db
+ */
+
+/**
+ * Class for SQL table interface.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Db_Table_Abstract
+{
+
+ const ADAPTER = 'db';
+ const DEFINITION = 'definition';
+ const DEFINITION_CONFIG_NAME = 'definitionConfigName';
+ const SCHEMA = 'schema';
+ const NAME = 'name';
+ const PRIMARY = 'primary';
+ const COLS = 'cols';
+ const METADATA = 'metadata';
+ const METADATA_CACHE = 'metadataCache';
+ const METADATA_CACHE_IN_CLASS = 'metadataCacheInClass';
+ const ROW_CLASS = 'rowClass';
+ const ROWSET_CLASS = 'rowsetClass';
+ const REFERENCE_MAP = 'referenceMap';
+ const DEPENDENT_TABLES = 'dependentTables';
+ const SEQUENCE = 'sequence';
+
+ const COLUMNS = 'columns';
+ const REF_TABLE_CLASS = 'refTableClass';
+ const REF_COLUMNS = 'refColumns';
+ const ON_DELETE = 'onDelete';
+ const ON_UPDATE = 'onUpdate';
+
+ const CASCADE = 'cascade';
+ const CASCADE_RECURSE = 'cascadeRecurse';
+ const RESTRICT = 'restrict';
+ const SET_NULL = 'setNull';
+
+ const DEFAULT_NONE = 'defaultNone';
+ const DEFAULT_CLASS = 'defaultClass';
+ const DEFAULT_DB = 'defaultDb';
+
+ const SELECT_WITH_FROM_PART = true;
+ const SELECT_WITHOUT_FROM_PART = false;
+
+ /**
+ * Default Zend_Db_Adapter_Abstract object.
+ *
+ * @var Zend_Db_Adapter_Abstract
+ */
+ protected static $_defaultDb;
+
+ /**
+ * Optional Zend_Db_Table_Definition object
+ *
+ * @var unknown_type
+ */
+ protected $_definition = null;
+
+ /**
+ * Optional definition config name used in concrete implementation
+ *
+ * @var string
+ */
+ protected $_definitionConfigName = null;
+
+ /**
+ * Default cache for information provided by the adapter's describeTable() method.
+ *
+ * @var Zend_Cache_Core
+ */
+ protected static $_defaultMetadataCache = null;
+
+ /**
+ * Zend_Db_Adapter_Abstract object.
+ *
+ * @var Zend_Db_Adapter_Abstract
+ */
+ protected $_db;
+
+ /**
+ * The schema name (default null means current schema)
+ *
+ * @var array
+ */
+ protected $_schema = null;
+
+ /**
+ * The table name.
+ *
+ * @var string
+ */
+ protected $_name = null;
+
+ /**
+ * The table column names derived from Zend_Db_Adapter_Abstract::describeTable().
+ *
+ * @var array
+ */
+ protected $_cols;
+
+ /**
+ * The primary key column or columns.
+ * A compound key should be declared as an array.
+ * You may declare a single-column primary key
+ * as a string.
+ *
+ * @var mixed
+ */
+ protected $_primary = null;
+
+ /**
+ * If your primary key is a compound key, and one of the columns uses
+ * an auto-increment or sequence-generated value, set _identity
+ * to the ordinal index in the $_primary array for that column.
+ * Note this index is the position of the column in the primary key,
+ * not the position of the column in the table. The primary key
+ * array is 1-based.
+ *
+ * @var integer
+ */
+ protected $_identity = 1;
+
+ /**
+ * Define the logic for new values in the primary key.
+ * May be a string, boolean true, or boolean false.
+ *
+ * @var mixed
+ */
+ protected $_sequence = true;
+
+ /**
+ * Information provided by the adapter's describeTable() method.
+ *
+ * @var array
+ */
+ protected $_metadata = array();
+
+ /**
+ * Cache for information provided by the adapter's describeTable() method.
+ *
+ * @var Zend_Cache_Core
+ */
+ protected $_metadataCache = null;
+
+ /**
+ * Flag: whether or not to cache metadata in the class
+ * @var bool
+ */
+ protected $_metadataCacheInClass = true;
+
+ /**
+ * Classname for row
+ *
+ * @var string
+ */
+ protected $_rowClass = 'Zend_Db_Table_Row';
+
+ /**
+ * Classname for rowset
+ *
+ * @var string
+ */
+ protected $_rowsetClass = 'Zend_Db_Table_Rowset';
+
+ /**
+ * Associative array map of declarative referential integrity rules.
+ * This array has one entry per foreign key in the current table.
+ * Each key is a mnemonic name for one reference rule.
+ *
+ * Each value is also an associative array, with the following keys:
+ * - columns = array of names of column(s) in the child table.
+ * - refTableClass = class name of the parent table.
+ * - refColumns = array of names of column(s) in the parent table,
+ * in the same order as those in the 'columns' entry.
+ * - onDelete = "cascade" means that a delete in the parent table also
+ * causes a delete of referencing rows in the child table.
+ * - onUpdate = "cascade" means that an update of primary key values in
+ * the parent table also causes an update of referencing
+ * rows in the child table.
+ *
+ * @var array
+ */
+ protected $_referenceMap = array();
+
+ /**
+ * Simple array of class names of tables that are "children" of the current
+ * table, in other words tables that contain a foreign key to this one.
+ * Array elements are not table names; they are class names of classes that
+ * extend Zend_Db_Table_Abstract.
+ *
+ * @var array
+ */
+ protected $_dependentTables = array();
+
+
+ protected $_defaultSource = self::DEFAULT_NONE;
+ protected $_defaultValues = array();
+
+ /**
+ * Constructor.
+ *
+ * Supported params for $config are:
+ * - db = user-supplied instance of database connector,
+ * or key name of registry instance.
+ * - name = table name.
+ * - primary = string or array of primary key(s).
+ * - rowClass = row class name.
+ * - rowsetClass = rowset class name.
+ * - referenceMap = array structure to declare relationship
+ * to parent tables.
+ * - dependentTables = array of child tables.
+ * - metadataCache = cache for information from adapter describeTable().
+ *
+ * @param mixed $config Array of user-specified config options, or just the Db Adapter.
+ * @return void
+ */
+ public function __construct($config = array())
+ {
+ /**
+ * Allow a scalar argument to be the Adapter object or Registry key.
+ */
+ if (!is_array($config)) {
+ $config = array(self::ADAPTER => $config);
+ }
+
+ if ($config) {
+ $this->setOptions($config);
+ }
+
+ $this->_setup();
+ $this->init();
+ }
+
+ /**
+ * setOptions()
+ *
+ * @param array $options
+ * @return Zend_Db_Table_Abstract
+ */
+ public function setOptions(Array $options)
+ {
+ foreach ($options as $key => $value) {
+ switch ($key) {
+ case self::ADAPTER:
+ $this->_setAdapter($value);
+ break;
+ case self::DEFINITION:
+ $this->setDefinition($value);
+ break;
+ case self::DEFINITION_CONFIG_NAME:
+ $this->setDefinitionConfigName($value);
+ break;
+ case self::SCHEMA:
+ $this->_schema = (string) $value;
+ break;
+ case self::NAME:
+ $this->_name = (string) $value;
+ break;
+ case self::PRIMARY:
+ $this->_primary = (array) $value;
+ break;
+ case self::ROW_CLASS:
+ $this->setRowClass($value);
+ break;
+ case self::ROWSET_CLASS:
+ $this->setRowsetClass($value);
+ break;
+ case self::REFERENCE_MAP:
+ $this->setReferences($value);
+ break;
+ case self::DEPENDENT_TABLES:
+ $this->setDependentTables($value);
+ break;
+ case self::METADATA_CACHE:
+ $this->_setMetadataCache($value);
+ break;
+ case self::METADATA_CACHE_IN_CLASS:
+ $this->setMetadataCacheInClass($value);
+ break;
+ case self::SEQUENCE:
+ $this->_setSequence($value);
+ break;
+ default:
+ // ignore unrecognized configuration directive
+ break;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * setDefinition()
+ *
+ * @param Zend_Db_Table_Definition $definition
+ * @return Zend_Db_Table_Abstract
+ */
+ public function setDefinition(Zend_Db_Table_Definition $definition)
+ {
+ $this->_definition = $definition;
+ return $this;
+ }
+
+ /**
+ * getDefinition()
+ *
+ * @return Zend_Db_Table_Definition|null
+ */
+ public function getDefinition()
+ {
+ return $this->_definition;
+ }
+
+ /**
+ * setDefinitionConfigName()
+ *
+ * @param string $definition
+ * @return Zend_Db_Table_Abstract
+ */
+ public function setDefinitionConfigName($definitionConfigName)
+ {
+ $this->_definitionConfigName = $definitionConfigName;
+ return $this;
+ }
+
+ /**
+ * getDefinitionConfigName()
+ *
+ * @return string
+ */
+ public function getDefinitionConfigName()
+ {
+ return $this->_definitionConfigName;
+ }
+
+ /**
+ * @param string $classname
+ * @return Zend_Db_Table_Abstract Provides a fluent interface
+ */
+ public function setRowClass($classname)
+ {
+ $this->_rowClass = (string) $classname;
+
+ return $this;
+ }
+
+ /**
+ * @return string
+ */
+ public function getRowClass()
+ {
+ return $this->_rowClass;
+ }
+
+ /**
+ * @param string $classname
+ * @return Zend_Db_Table_Abstract Provides a fluent interface
+ */
+ public function setRowsetClass($classname)
+ {
+ $this->_rowsetClass = (string) $classname;
+
+ return $this;
+ }
+
+ /**
+ * @return string
+ */
+ public function getRowsetClass()
+ {
+ return $this->_rowsetClass;
+ }
+
+ /**
+ * Add a reference to the reference map
+ *
+ * @param string $ruleKey
+ * @param string|array $columns
+ * @param string $refTableClass
+ * @param string|array $refColumns
+ * @param string $onDelete
+ * @param string $onUpdate
+ * @return Zend_Db_Table_Abstract
+ */
+ public function addReference($ruleKey, $columns, $refTableClass, $refColumns,
+ $onDelete = null, $onUpdate = null)
+ {
+ $reference = array(self::COLUMNS => (array) $columns,
+ self::REF_TABLE_CLASS => $refTableClass,
+ self::REF_COLUMNS => (array) $refColumns);
+
+ if (!empty($onDelete)) {
+ $reference[self::ON_DELETE] = $onDelete;
+ }
+
+ if (!empty($onUpdate)) {
+ $reference[self::ON_UPDATE] = $onUpdate;
+ }
+
+ $this->_referenceMap[$ruleKey] = $reference;
+
+ return $this;
+ }
+
+ /**
+ * @param array $referenceMap
+ * @return Zend_Db_Table_Abstract Provides a fluent interface
+ */
+ public function setReferences(array $referenceMap)
+ {
+ $this->_referenceMap = $referenceMap;
+
+ return $this;
+ }
+
+ /**
+ * @param string $tableClassname
+ * @param string $ruleKey OPTIONAL
+ * @return array
+ * @throws Zend_Db_Table_Exception
+ */
+ public function getReference($tableClassname, $ruleKey = null)
+ {
+ $thisClass = get_class($this);
+ if ($thisClass === 'Zend_Db_Table') {
+ $thisClass = $this->_definitionConfigName;
+ }
+ $refMap = $this->_getReferenceMapNormalized();
+ if ($ruleKey !== null) {
+ if (!isset($refMap[$ruleKey])) {
+ throw new Zend_Db_Table_Exception("No reference rule \"$ruleKey\" from table $thisClass to table $tableClassname");
+ }
+ if ($refMap[$ruleKey][self::REF_TABLE_CLASS] != $tableClassname) {
+ throw new Zend_Db_Table_Exception("Reference rule \"$ruleKey\" does not reference table $tableClassname");
+ }
+ return $refMap[$ruleKey];
+ }
+ foreach ($refMap as $reference) {
+ if ($reference[self::REF_TABLE_CLASS] == $tableClassname) {
+ return $reference;
+ }
+ }
+ throw new Zend_Db_Table_Exception("No reference from table $thisClass to table $tableClassname");
+ }
+
+ /**
+ * @param array $dependentTables
+ * @return Zend_Db_Table_Abstract Provides a fluent interface
+ */
+ public function setDependentTables(array $dependentTables)
+ {
+ $this->_dependentTables = $dependentTables;
+
+ return $this;
+ }
+
+ /**
+ * @return array
+ */
+ public function getDependentTables()
+ {
+ return $this->_dependentTables;
+ }
+
+ /**
+ * set the defaultSource property - this tells the table class where to find default values
+ *
+ * @param string $defaultSource
+ * @return Zend_Db_Table_Abstract
+ */
+ public function setDefaultSource($defaultSource = self::DEFAULT_NONE)
+ {
+ if (!in_array($defaultSource, array(self::DEFAULT_CLASS, self::DEFAULT_DB, self::DEFAULT_NONE))) {
+ $defaultSource = self::DEFAULT_NONE;
+ }
+
+ $this->_defaultSource = $defaultSource;
+ return $this;
+ }
+
+ /**
+ * returns the default source flag that determines where defaultSources come from
+ *
+ * @return unknown
+ */
+ public function getDefaultSource()
+ {
+ return $this->_defaultSource;
+ }
+
+ /**
+ * set the default values for the table class
+ *
+ * @param array $defaultValues
+ * @return Zend_Db_Table_Abstract
+ */
+ public function setDefaultValues(Array $defaultValues)
+ {
+ foreach ($defaultValues as $defaultName => $defaultValue) {
+ if (array_key_exists($defaultName, $this->_metadata)) {
+ $this->_defaultValues[$defaultName] = $defaultValue;
+ }
+ }
+ return $this;
+ }
+
+ public function getDefaultValues()
+ {
+ return $this->_defaultValues;
+ }
+
+
+ /**
+ * Sets the default Zend_Db_Adapter_Abstract for all Zend_Db_Table objects.
+ *
+ * @param mixed $db Either an Adapter object, or a string naming a Registry key
+ * @return void
+ */
+ public static function setDefaultAdapter($db = null)
+ {
+ self::$_defaultDb = self::_setupAdapter($db);
+ }
+
+ /**
+ * Gets the default Zend_Db_Adapter_Abstract for all Zend_Db_Table objects.
+ *
+ * @return Zend_Db_Adapter_Abstract or null
+ */
+ public static function getDefaultAdapter()
+ {
+ return self::$_defaultDb;
+ }
+
+ /**
+ * @param mixed $db Either an Adapter object, or a string naming a Registry key
+ * @return Zend_Db_Table_Abstract Provides a fluent interface
+ */
+ protected function _setAdapter($db)
+ {
+ $this->_db = self::_setupAdapter($db);
+ return $this;
+ }
+
+ /**
+ * Gets the Zend_Db_Adapter_Abstract for this particular Zend_Db_Table object.
+ *
+ * @return Zend_Db_Adapter_Abstract
+ */
+ public function getAdapter()
+ {
+ return $this->_db;
+ }
+
+ /**
+ * @param mixed $db Either an Adapter object, or a string naming a Registry key
+ * @return Zend_Db_Adapter_Abstract
+ * @throws Zend_Db_Table_Exception
+ */
+ protected static function _setupAdapter($db)
+ {
+ if ($db === null) {
+ return null;
+ }
+ if (is_string($db)) {
+ $db = Zend_Registry::get($db);
+ }
+ if (!$db instanceof Zend_Db_Adapter_Abstract) {
+ throw new Zend_Db_Table_Exception('Argument must be of type Zend_Db_Adapter_Abstract, or a Registry key where a Zend_Db_Adapter_Abstract object is stored');
+ }
+ return $db;
+ }
+
+ /**
+ * Sets the default metadata cache for information returned by Zend_Db_Adapter_Abstract::describeTable().
+ *
+ * If $defaultMetadataCache is null, then no metadata cache is used by default.
+ *
+ * @param mixed $metadataCache Either a Cache object, or a string naming a Registry key
+ * @return void
+ */
+ public static function setDefaultMetadataCache($metadataCache = null)
+ {
+ self::$_defaultMetadataCache = self::_setupMetadataCache($metadataCache);
+ }
+
+ /**
+ * Gets the default metadata cache for information returned by Zend_Db_Adapter_Abstract::describeTable().
+ *
+ * @return Zend_Cache_Core or null
+ */
+ public static function getDefaultMetadataCache()
+ {
+ return self::$_defaultMetadataCache;
+ }
+
+ /**
+ * Sets the metadata cache for information returned by Zend_Db_Adapter_Abstract::describeTable().
+ *
+ * If $metadataCache is null, then no metadata cache is used. Since there is no opportunity to reload metadata
+ * after instantiation, this method need not be public, particularly because that it would have no effect
+ * results in unnecessary API complexity. To configure the metadata cache, use the metadataCache configuration
+ * option for the class constructor upon instantiation.
+ *
+ * @param mixed $metadataCache Either a Cache object, or a string naming a Registry key
+ * @return Zend_Db_Table_Abstract Provides a fluent interface
+ */
+ protected function _setMetadataCache($metadataCache)
+ {
+ $this->_metadataCache = self::_setupMetadataCache($metadataCache);
+ return $this;
+ }
+
+ /**
+ * Gets the metadata cache for information returned by Zend_Db_Adapter_Abstract::describeTable().
+ *
+ * @return Zend_Cache_Core or null
+ */
+ public function getMetadataCache()
+ {
+ return $this->_metadataCache;
+ }
+
+ /**
+ * Indicate whether metadata should be cached in the class for the duration
+ * of the instance
+ *
+ * @param bool $flag
+ * @return Zend_Db_Table_Abstract
+ */
+ public function setMetadataCacheInClass($flag)
+ {
+ $this->_metadataCacheInClass = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Retrieve flag indicating if metadata should be cached for duration of
+ * instance
+ *
+ * @return bool
+ */
+ public function metadataCacheInClass()
+ {
+ return $this->_metadataCacheInClass;
+ }
+
+ /**
+ * @param mixed $metadataCache Either a Cache object, or a string naming a Registry key
+ * @return Zend_Cache_Core
+ * @throws Zend_Db_Table_Exception
+ */
+ protected static function _setupMetadataCache($metadataCache)
+ {
+ if ($metadataCache === null) {
+ return null;
+ }
+ if (is_string($metadataCache)) {
+ $metadataCache = Zend_Registry::get($metadataCache);
+ }
+ if (!$metadataCache instanceof Zend_Cache_Core) {
+ throw new Zend_Db_Table_Exception('Argument must be of type Zend_Cache_Core, or a Registry key where a Zend_Cache_Core object is stored');
+ }
+ return $metadataCache;
+ }
+
+ /**
+ * Sets the sequence member, which defines the behavior for generating
+ * primary key values in new rows.
+ * - If this is a string, then the string names the sequence object.
+ * - If this is boolean true, then the key uses an auto-incrementing
+ * or identity mechanism.
+ * - If this is boolean false, then the key is user-defined.
+ * Use this for natural keys, for example.
+ *
+ * @param mixed $sequence
+ * @return Zend_Db_Table_Adapter_Abstract Provides a fluent interface
+ */
+ protected function _setSequence($sequence)
+ {
+ $this->_sequence = $sequence;
+
+ return $this;
+ }
+
+ /**
+ * Turnkey for initialization of a table object.
+ * Calls other protected methods for individual tasks, to make it easier
+ * for a subclass to override part of the setup logic.
+ *
+ * @return void
+ */
+ protected function _setup()
+ {
+ $this->_setupDatabaseAdapter();
+ $this->_setupTableName();
+ }
+
+ /**
+ * Initialize database adapter.
+ *
+ * @return void
+ * @throws Zend_Db_Table_Exception
+ */
+ protected function _setupDatabaseAdapter()
+ {
+ if (! $this->_db) {
+ $this->_db = self::getDefaultAdapter();
+ if (!$this->_db instanceof Zend_Db_Adapter_Abstract) {
+ throw new Zend_Db_Table_Exception('No adapter found for ' . get_class($this));
+ }
+ }
+ }
+
+ /**
+ * Initialize table and schema names.
+ *
+ * If the table name is not set in the class definition,
+ * use the class name itself as the table name.
+ *
+ * A schema name provided with the table name (e.g., "schema.table") overrides
+ * any existing value for $this->_schema.
+ *
+ * @return void
+ */
+ protected function _setupTableName()
+ {
+ if (! $this->_name) {
+ $this->_name = get_class($this);
+ } else if (strpos($this->_name, '.')) {
+ list($this->_schema, $this->_name) = explode('.', $this->_name);
+ }
+ }
+
+ /**
+ * Initializes metadata.
+ *
+ * If metadata cannot be loaded from cache, adapter's describeTable() method is called to discover metadata
+ * information. Returns true if and only if the metadata are loaded from cache.
+ *
+ * @return boolean
+ * @throws Zend_Db_Table_Exception
+ */
+ protected function _setupMetadata()
+ {
+ if ($this->metadataCacheInClass() && (count($this->_metadata) > 0)) {
+ return true;
+ }
+
+ // Assume that metadata will be loaded from cache
+ $isMetadataFromCache = true;
+
+ // If $this has no metadata cache but the class has a default metadata cache
+ if (null === $this->_metadataCache && null !== self::$_defaultMetadataCache) {
+ // Make $this use the default metadata cache of the class
+ $this->_setMetadataCache(self::$_defaultMetadataCache);
+ }
+
+ // If $this has a metadata cache
+ if (null !== $this->_metadataCache) {
+ // Define the cache identifier where the metadata are saved
+
+ //get db configuration
+ $dbConfig = $this->_db->getConfig();
+
+ $port = isset($dbConfig['options']['port'])
+ ? ':'.$dbConfig['options']['port']
+ : (isset($dbConfig['port'])
+ ? ':'.$dbConfig['port']
+ : null);
+
+ $host = isset($dbConfig['options']['host'])
+ ? ':'.$dbConfig['options']['host']
+ : (isset($dbConfig['host'])
+ ? ':'.$dbConfig['host']
+ : null);
+
+ // Define the cache identifier where the metadata are saved
+ $cacheId = md5( // port:host/dbname:schema.table (based on availabilty)
+ $port . $host . '/'. $dbConfig['dbname'] . ':'
+ . $this->_schema. '.' . $this->_name
+ );
+ }
+
+ // If $this has no metadata cache or metadata cache misses
+ if (null === $this->_metadataCache || !($metadata = $this->_metadataCache->load($cacheId))) {
+ // Metadata are not loaded from cache
+ $isMetadataFromCache = false;
+ // Fetch metadata from the adapter's describeTable() method
+ $metadata = $this->_db->describeTable($this->_name, $this->_schema);
+ // If $this has a metadata cache, then cache the metadata
+ if (null !== $this->_metadataCache && !$this->_metadataCache->save($metadata, $cacheId)) {
+ trigger_error('Failed saving metadata to metadataCache', E_USER_NOTICE);
+ }
+ }
+
+ // Assign the metadata to $this
+ $this->_metadata = $metadata;
+
+ // Return whether the metadata were loaded from cache
+ return $isMetadataFromCache;
+ }
+
+ /**
+ * Retrieve table columns
+ *
+ * @return array
+ */
+ protected function _getCols()
+ {
+ if (null === $this->_cols) {
+ $this->_setupMetadata();
+ $this->_cols = array_keys($this->_metadata);
+ }
+ return $this->_cols;
+ }
+
+ /**
+ * Initialize primary key from metadata.
+ * If $_primary is not defined, discover primary keys
+ * from the information returned by describeTable().
+ *
+ * @return void
+ * @throws Zend_Db_Table_Exception
+ */
+ protected function _setupPrimaryKey()
+ {
+ if (!$this->_primary) {
+ $this->_setupMetadata();
+ $this->_primary = array();
+ foreach ($this->_metadata as $col) {
+ if ($col['PRIMARY']) {
+ $this->_primary[ $col['PRIMARY_POSITION'] ] = $col['COLUMN_NAME'];
+ if ($col['IDENTITY']) {
+ $this->_identity = $col['PRIMARY_POSITION'];
+ }
+ }
+ }
+ // if no primary key was specified and none was found in the metadata
+ // then throw an exception.
+ if (empty($this->_primary)) {
+ throw new Zend_Db_Table_Exception("A table must have a primary key, but none was found for table '{$this->_name}'");
+ }
+ } else if (!is_array($this->_primary)) {
+ $this->_primary = array(1 => $this->_primary);
+ } else if (isset($this->_primary[0])) {
+ array_unshift($this->_primary, null);
+ unset($this->_primary[0]);
+ }
+
+ $cols = $this->_getCols();
+ if (! array_intersect((array) $this->_primary, $cols) == (array) $this->_primary) {
+ throw new Zend_Db_Table_Exception("Primary key column(s) ("
+ . implode(',', (array) $this->_primary)
+ . ") are not columns in this table ("
+ . implode(',', $cols)
+ . ")");
+ }
+
+ $primary = (array) $this->_primary;
+ $pkIdentity = $primary[(int) $this->_identity];
+
+ /**
+ * Special case for PostgreSQL: a SERIAL key implicitly uses a sequence
+ * object whose name is "<table>_<column>_seq".
+ */
+ if ($this->_sequence === true && $this->_db instanceof Zend_Db_Adapter_Pdo_Pgsql) {
+ $this->_sequence = $this->_db->quoteIdentifier("{$this->_name}_{$pkIdentity}_seq");
+ if ($this->_schema) {
+ $this->_sequence = $this->_db->quoteIdentifier($this->_schema) . '.' . $this->_sequence;
+ }
+ }
+ }
+
+ /**
+ * Returns a normalized version of the reference map
+ *
+ * @return array
+ */
+ protected function _getReferenceMapNormalized()
+ {
+ $referenceMapNormalized = array();
+
+ foreach ($this->_referenceMap as $rule => $map) {
+
+ $referenceMapNormalized[$rule] = array();
+
+ foreach ($map as $key => $value) {
+ switch ($key) {
+
+ // normalize COLUMNS and REF_COLUMNS to arrays
+ case self::COLUMNS:
+ case self::REF_COLUMNS:
+ if (!is_array($value)) {
+ $referenceMapNormalized[$rule][$key] = array($value);
+ } else {
+ $referenceMapNormalized[$rule][$key] = $value;
+ }
+ break;
+
+ // other values are copied as-is
+ default:
+ $referenceMapNormalized[$rule][$key] = $value;
+ break;
+ }
+ }
+ }
+
+ return $referenceMapNormalized;
+ }
+
+ /**
+ * Initialize object
+ *
+ * Called from {@link __construct()} as final step of object instantiation.
+ *
+ * @return void
+ */
+ public function init()
+ {
+ }
+
+ /**
+ * Returns table information.
+ *
+ * You can elect to return only a part of this information by supplying its key name,
+ * otherwise all information is returned as an array.
+ *
+ * @param string $key The specific info part to return OPTIONAL
+ * @return mixed
+ * @throws Zend_Db_Table_Exception
+ */
+ public function info($key = null)
+ {
+ $this->_setupPrimaryKey();
+
+ $info = array(
+ self::SCHEMA => $this->_schema,
+ self::NAME => $this->_name,
+ self::COLS => $this->_getCols(),
+ self::PRIMARY => (array) $this->_primary,
+ self::METADATA => $this->_metadata,
+ self::ROW_CLASS => $this->getRowClass(),
+ self::ROWSET_CLASS => $this->getRowsetClass(),
+ self::REFERENCE_MAP => $this->_referenceMap,
+ self::DEPENDENT_TABLES => $this->_dependentTables,
+ self::SEQUENCE => $this->_sequence
+ );
+
+ if ($key === null) {
+ return $info;
+ }
+
+ if (!array_key_exists($key, $info)) {
+ throw new Zend_Db_Table_Exception('There is no table information for the key "' . $key . '"');
+ }
+
+ return $info[$key];
+ }
+
+ /**
+ * Returns an instance of a Zend_Db_Table_Select object.
+ *
+ * @param bool $withFromPart Whether or not to include the from part of the select based on the table
+ * @return Zend_Db_Table_Select
+ */
+ public function select($withFromPart = self::SELECT_WITHOUT_FROM_PART)
+ {
+ $select = new Zend_Db_Table_Select($this);
+ if ($withFromPart == self::SELECT_WITH_FROM_PART) {
+ $select->from($this->info(self::NAME), Zend_Db_Table_Select::SQL_WILDCARD, $this->info(self::SCHEMA));
+ }
+ return $select;
+ }
+
+ /**
+ * Inserts a new row.
+ *
+ * @param array $data Column-value pairs.
+ * @return mixed The primary key of the row inserted.
+ */
+ public function insert(array $data)
+ {
+ $this->_setupPrimaryKey();
+
+ /**
+ * Zend_Db_Table assumes that if you have a compound primary key
+ * and one of the columns in the key uses a sequence,
+ * it's the _first_ column in the compound key.
+ */
+ $primary = (array) $this->_primary;
+ $pkIdentity = $primary[(int)$this->_identity];
+
+
+ /**
+ * If the primary key can be generated automatically, and no value was
+ * specified in the user-supplied data, then omit it from the tuple.
+ *
+ * Note: this checks for sensible values in the supplied primary key
+ * position of the data. The following values are considered empty:
+ * null, false, true, '', array()
+ */
+ if (array_key_exists($pkIdentity, $data)) {
+ if ($data[$pkIdentity] === null // null
+ || $data[$pkIdentity] === '' // empty string
+ || is_bool($data[$pkIdentity]) // boolean
+ || (is_array($data[$pkIdentity]) && empty($data[$pkIdentity]))) { // empty array
+ unset($data[$pkIdentity]);
+ }
+ }
+
+ /**
+ * If this table uses a database sequence object and the data does not
+ * specify a value, then get the next ID from the sequence and add it
+ * to the row. We assume that only the first column in a compound
+ * primary key takes a value from a sequence.
+ */
+ if (is_string($this->_sequence) && !isset($data[$pkIdentity])) {
+ $data[$pkIdentity] = $this->_db->nextSequenceId($this->_sequence);
+ }
+
+ /**
+ * INSERT the new row.
+ */
+ $tableSpec = ($this->_schema ? $this->_schema . '.' : '') . $this->_name;
+ $this->_db->insert($tableSpec, $data);
+
+ /**
+ * Fetch the most recent ID generated by an auto-increment
+ * or IDENTITY column, unless the user has specified a value,
+ * overriding the auto-increment mechanism.
+ */
+ if ($this->_sequence === true && !isset($data[$pkIdentity])) {
+ $data[$pkIdentity] = $this->_db->lastInsertId();
+ }
+
+ /**
+ * Return the primary key value if the PK is a single column,
+ * else return an associative array of the PK column/value pairs.
+ */
+ $pkData = array_intersect_key($data, array_flip($primary));
+ if (count($primary) == 1) {
+ reset($pkData);
+ return current($pkData);
+ }
+
+ return $pkData;
+ }
+
+ /**
+ * Check if the provided column is an identity of the table
+ *
+ * @param string $column
+ * @throws Zend_Db_Table_Exception
+ * @return boolean
+ */
+ public function isIdentity($column)
+ {
+ $this->_setupPrimaryKey();
+
+ if (!isset($this->_metadata[$column])) {
+ /**
+ * @see Zend_Db_Table_Exception
+ */
+
+ throw new Zend_Db_Table_Exception('Column "' . $column . '" not found in table.');
+ }
+
+ return (bool) $this->_metadata[$column]['IDENTITY'];
+ }
+
+ /**
+ * Updates existing rows.
+ *
+ * @param array $data Column-value pairs.
+ * @param array|string $where An SQL WHERE clause, or an array of SQL WHERE clauses.
+ * @return int The number of rows updated.
+ */
+ public function update(array $data, $where)
+ {
+ $tableSpec = ($this->_schema ? $this->_schema . '.' : '') . $this->_name;
+ return $this->_db->update($tableSpec, $data, $where);
+ }
+
+ /**
+ * Called by a row object for the parent table's class during save() method.
+ *
+ * @param string $parentTableClassname
+ * @param array $oldPrimaryKey
+ * @param array $newPrimaryKey
+ * @return int
+ */
+ public function _cascadeUpdate($parentTableClassname, array $oldPrimaryKey, array $newPrimaryKey)
+ {
+ $this->_setupMetadata();
+ $rowsAffected = 0;
+ foreach ($this->_getReferenceMapNormalized() as $map) {
+ if ($map[self::REF_TABLE_CLASS] == $parentTableClassname && isset($map[self::ON_UPDATE])) {
+ switch ($map[self::ON_UPDATE]) {
+ case self::CASCADE:
+ $newRefs = array();
+ $where = array();
+ for ($i = 0; $i < count($map[self::COLUMNS]); ++$i) {
+ $col = $this->_db->foldCase($map[self::COLUMNS][$i]);
+ $refCol = $this->_db->foldCase($map[self::REF_COLUMNS][$i]);
+ if (array_key_exists($refCol, $newPrimaryKey)) {
+ $newRefs[$col] = $newPrimaryKey[$refCol];
+ }
+ $type = $this->_metadata[$col]['DATA_TYPE'];
+ $where[] = $this->_db->quoteInto(
+ $this->_db->quoteIdentifier($col, true) . ' = ?',
+ $oldPrimaryKey[$refCol], $type);
+ }
+ $rowsAffected += $this->update($newRefs, $where);
+ break;
+ default:
+ // no action
+ break;
+ }
+ }
+ }
+ return $rowsAffected;
+ }
+
+ /**
+ * Deletes existing rows.
+ *
+ * @param array|string $where SQL WHERE clause(s).
+ * @return int The number of rows deleted.
+ */
+ public function delete($where)
+ {
+ $depTables = $this->getDependentTables();
+ if (!empty($depTables)) {
+ $resultSet = $this->fetchAll($where);
+ if (count($resultSet) > 0 ) {
+ foreach ($resultSet as $row) {
+ /**
+ * Execute cascading deletes against dependent tables
+ */
+ foreach ($depTables as $tableClass) {
+ $t = self::getTableFromString($tableClass, $this);
+ $t->_cascadeDelete(
+ get_class($this), $row->getPrimaryKey()
+ );
+ }
+ }
+ }
+ }
+
+ $tableSpec = ($this->_schema ? $this->_schema . '.' : '') . $this->_name;
+ return $this->_db->delete($tableSpec, $where);
+ }
+
+ /**
+ * Called by parent table's class during delete() method.
+ *
+ * @param string $parentTableClassname
+ * @param array $primaryKey
+ * @return int Number of affected rows
+ */
+ public function _cascadeDelete($parentTableClassname, array $primaryKey)
+ {
+ // setup metadata
+ $this->_setupMetadata();
+
+ // get this class name
+ $thisClass = get_class($this);
+ if ($thisClass === 'Zend_Db_Table') {
+ $thisClass = $this->_definitionConfigName;
+ }
+
+ $rowsAffected = 0;
+
+ foreach ($this->_getReferenceMapNormalized() as $map) {
+ if ($map[self::REF_TABLE_CLASS] == $parentTableClassname && isset($map[self::ON_DELETE])) {
+
+ $where = array();
+
+ // CASCADE or CASCADE_RECURSE
+ if (in_array($map[self::ON_DELETE], array(self::CASCADE, self::CASCADE_RECURSE))) {
+ for ($i = 0; $i < count($map[self::COLUMNS]); ++$i) {
+ $col = $this->_db->foldCase($map[self::COLUMNS][$i]);
+ $refCol = $this->_db->foldCase($map[self::REF_COLUMNS][$i]);
+ $type = $this->_metadata[$col]['DATA_TYPE'];
+ $where[] = $this->_db->quoteInto(
+ $this->_db->quoteIdentifier($col, true) . ' = ?',
+ $primaryKey[$refCol], $type);
+ }
+ }
+
+ // CASCADE_RECURSE
+ if ($map[self::ON_DELETE] == self::CASCADE_RECURSE) {
+
+ /**
+ * Execute cascading deletes against dependent tables
+ */
+ $depTables = $this->getDependentTables();
+ if (!empty($depTables)) {
+ foreach ($depTables as $tableClass) {
+ $t = self::getTableFromString($tableClass, $this);
+ foreach ($this->fetchAll($where) as $depRow) {
+ $rowsAffected += $t->_cascadeDelete($thisClass, $depRow->getPrimaryKey());
+ }
+ }
+ }
+ }
+
+ // CASCADE or CASCADE_RECURSE
+ if (in_array($map[self::ON_DELETE], array(self::CASCADE, self::CASCADE_RECURSE))) {
+ $rowsAffected += $this->delete($where);
+ }
+
+ }
+ }
+ return $rowsAffected;
+ }
+
+ /**
+ * Fetches rows by primary key. The argument specifies one or more primary
+ * key value(s). To find multiple rows by primary key, the argument must
+ * be an array.
+ *
+ * This method accepts a variable number of arguments. If the table has a
+ * multi-column primary key, the number of arguments must be the same as
+ * the number of columns in the primary key. To find multiple rows in a
+ * table with a multi-column primary key, each argument must be an array
+ * with the same number of elements.
+ *
+ * The find() method always returns a Rowset object, even if only one row
+ * was found.
+ *
+ * @param mixed $key The value(s) of the primary keys.
+ * @return Zend_Db_Table_Rowset_Abstract Row(s) matching the criteria.
+ * @throws Zend_Db_Table_Exception
+ */
+ public function find()
+ {
+ $this->_setupPrimaryKey();
+ $args = func_get_args();
+ $keyNames = array_values((array) $this->_primary);
+
+ if (count($args) < count($keyNames)) {
+ throw new Zend_Db_Table_Exception("Too few columns for the primary key");
+ }
+
+ if (count($args) > count($keyNames)) {
+ throw new Zend_Db_Table_Exception("Too many columns for the primary key");
+ }
+
+ $whereList = array();
+ $numberTerms = 0;
+ foreach ($args as $keyPosition => $keyValues) {
+ $keyValuesCount = count($keyValues);
+ // Coerce the values to an array.
+ // Don't simply typecast to array, because the values
+ // might be Zend_Db_Expr objects.
+ if (!is_array($keyValues)) {
+ $keyValues = array($keyValues);
+ }
+ if ($numberTerms == 0) {
+ $numberTerms = $keyValuesCount;
+ } else if ($keyValuesCount != $numberTerms) {
+ throw new Zend_Db_Table_Exception("Missing value(s) for the primary key");
+ }
+ $keyValues = array_values($keyValues);
+ for ($i = 0; $i < $keyValuesCount; ++$i) {
+ if (!isset($whereList[$i])) {
+ $whereList[$i] = array();
+ }
+ $whereList[$i][$keyPosition] = $keyValues[$i];
+ }
+ }
+
+ $whereClause = null;
+ if (count($whereList)) {
+ $whereOrTerms = array();
+ $tableName = $this->_db->quoteTableAs($this->_name, null, true);
+ foreach ($whereList as $keyValueSets) {
+ $whereAndTerms = array();
+ foreach ($keyValueSets as $keyPosition => $keyValue) {
+ $type = $this->_metadata[$keyNames[$keyPosition]]['DATA_TYPE'];
+ $columnName = $this->_db->quoteIdentifier($keyNames[$keyPosition], true);
+ $whereAndTerms[] = $this->_db->quoteInto(
+ $tableName . '.' . $columnName . ' = ?',
+ $keyValue, $type);
+ }
+ $whereOrTerms[] = '(' . implode(' AND ', $whereAndTerms) . ')';
+ }
+ $whereClause = '(' . implode(' OR ', $whereOrTerms) . ')';
+ }
+
+ // issue ZF-5775 (empty where clause should return empty rowset)
+ if ($whereClause == null) {
+ $rowsetClass = $this->getRowsetClass();
+ if (!class_exists($rowsetClass)) {
+ Zend_Loader::loadClass($rowsetClass);
+ }
+ return new $rowsetClass(array('table' => $this, 'rowClass' => $this->getRowClass(), 'stored' => true));
+ }
+
+ return $this->fetchAll($whereClause);
+ }
+
+ /**
+ * Fetches all rows.
+ *
+ * Honors the Zend_Db_Adapter fetch mode.
+ *
+ * @param string|array|Zend_Db_Table_Select $where OPTIONAL An SQL WHERE clause or Zend_Db_Table_Select object.
+ * @param string|array $order OPTIONAL An SQL ORDER clause.
+ * @param int $count OPTIONAL An SQL LIMIT count.
+ * @param int $offset OPTIONAL An SQL LIMIT offset.
+ * @return Zend_Db_Table_Rowset_Abstract The row results per the Zend_Db_Adapter fetch mode.
+ */
+ public function fetchAll($where = null, $order = null, $count = null, $offset = null)
+ {
+ if (!($where instanceof Zend_Db_Table_Select)) {
+ $select = $this->select();
+
+ if ($where !== null) {
+ $this->_where($select, $where);
+ }
+
+ if ($order !== null) {
+ $this->_order($select, $order);
+ }
+
+ if ($count !== null || $offset !== null) {
+ $select->limit($count, $offset);
+ }
+
+ } else {
+ $select = $where;
+ }
+
+ $rows = $this->_fetch($select);
+
+ $data = array(
+ 'table' => $this,
+ 'data' => $rows,
+ 'readOnly' => $select->isReadOnly(),
+ 'rowClass' => $this->getRowClass(),
+ 'stored' => true
+ );
+
+ $rowsetClass = $this->getRowsetClass();
+ if (!class_exists($rowsetClass)) {
+ Zend_Loader::loadClass($rowsetClass);
+ }
+ return new $rowsetClass($data);
+ }
+
+ /**
+ * Fetches one row in an object of type Zend_Db_Table_Row_Abstract,
+ * or returns null if no row matches the specified criteria.
+ *
+ * @param string|array|Zend_Db_Table_Select $where OPTIONAL An SQL WHERE clause or Zend_Db_Table_Select object.
+ * @param string|array $order OPTIONAL An SQL ORDER clause.
+ * @param int $offset OPTIONAL An SQL OFFSET value.
+ * @return Zend_Db_Table_Row_Abstract|null The row results per the
+ * Zend_Db_Adapter fetch mode, or null if no row found.
+ */
+ public function fetchRow($where = null, $order = null, $offset = null)
+ {
+ if (!($where instanceof Zend_Db_Table_Select)) {
+ $select = $this->select();
+
+ if ($where !== null) {
+ $this->_where($select, $where);
+ }
+
+ if ($order !== null) {
+ $this->_order($select, $order);
+ }
+
+ $select->limit(1, ((is_numeric($offset)) ? (int) $offset : null));
+
+ } else {
+ $select = $where->limit(1, $where->getPart(Zend_Db_Select::LIMIT_OFFSET));
+ }
+
+ $rows = $this->_fetch($select);
+
+ if (count($rows) == 0) {
+ return null;
+ }
+
+ $data = array(
+ 'table' => $this,
+ 'data' => $rows[0],
+ 'readOnly' => $select->isReadOnly(),
+ 'stored' => true
+ );
+
+ $rowClass = $this->getRowClass();
+ if (!class_exists($rowClass)) {
+ Zend_Loader::loadClass($rowClass);
+ }
+ return new $rowClass($data);
+ }
+
+ /**
+ * Fetches a new blank row (not from the database).
+ *
+ * @return Zend_Db_Table_Row_Abstract
+ * @deprecated since 0.9.3 - use createRow() instead.
+ */
+ public function fetchNew()
+ {
+ return $this->createRow();
+ }
+
+ /**
+ * Fetches a new blank row (not from the database).
+ *
+ * @param array $data OPTIONAL data to populate in the new row.
+ * @param string $defaultSource OPTIONAL flag to force default values into new row
+ * @return Zend_Db_Table_Row_Abstract
+ */
+ public function createRow(array $data = array(), $defaultSource = null)
+ {
+ $cols = $this->_getCols();
+ $defaults = array_combine($cols, array_fill(0, count($cols), null));
+
+ // nothing provided at call-time, take the class value
+ if ($defaultSource == null) {
+ $defaultSource = $this->_defaultSource;
+ }
+
+ if (!in_array($defaultSource, array(self::DEFAULT_CLASS, self::DEFAULT_DB, self::DEFAULT_NONE))) {
+ $defaultSource = self::DEFAULT_NONE;
+ }
+
+ if ($defaultSource == self::DEFAULT_DB) {
+ foreach ($this->_metadata as $metadataName => $metadata) {
+ if (($metadata['DEFAULT'] != null) &&
+ ($metadata['NULLABLE'] !== true || ($metadata['NULLABLE'] === true && isset($this->_defaultValues[$metadataName]) && $this->_defaultValues[$metadataName] === true)) &&
+ (!(isset($this->_defaultValues[$metadataName]) && $this->_defaultValues[$metadataName] === false))) {
+ $defaults[$metadataName] = $metadata['DEFAULT'];
+ }
+ }
+ } elseif ($defaultSource == self::DEFAULT_CLASS && $this->_defaultValues) {
+ foreach ($this->_defaultValues as $defaultName => $defaultValue) {
+ if (array_key_exists($defaultName, $defaults)) {
+ $defaults[$defaultName] = $defaultValue;
+ }
+ }
+ }
+
+ $config = array(
+ 'table' => $this,
+ 'data' => $defaults,
+ 'readOnly' => false,
+ 'stored' => false
+ );
+
+ $rowClass = $this->getRowClass();
+ if (!class_exists($rowClass)) {
+ Zend_Loader::loadClass($rowClass);
+ }
+ $row = new $rowClass($config);
+ $row->setFromArray($data);
+ return $row;
+ }
+
+ /**
+ * Generate WHERE clause from user-supplied string or array
+ *
+ * @param string|array $where OPTIONAL An SQL WHERE clause.
+ * @return Zend_Db_Table_Select
+ */
+ protected function _where(Zend_Db_Table_Select $select, $where)
+ {
+ $where = (array) $where;
+
+ foreach ($where as $key => $val) {
+ // is $key an int?
+ if (is_int($key)) {
+ // $val is the full condition
+ $select->where($val);
+ } else {
+ // $key is the condition with placeholder,
+ // and $val is quoted into the condition
+ $select->where($key, $val);
+ }
+ }
+
+ return $select;
+ }
+
+ /**
+ * Generate ORDER clause from user-supplied string or array
+ *
+ * @param string|array $order OPTIONAL An SQL ORDER clause.
+ * @return Zend_Db_Table_Select
+ */
+ protected function _order(Zend_Db_Table_Select $select, $order)
+ {
+ if (!is_array($order)) {
+ $order = array($order);
+ }
+
+ foreach ($order as $val) {
+ $select->order($val);
+ }
+
+ return $select;
+ }
+
+ /**
+ * Support method for fetching rows.
+ *
+ * @param Zend_Db_Table_Select $select query options.
+ * @return array An array containing the row results in FETCH_ASSOC mode.
+ */
+ protected function _fetch(Zend_Db_Table_Select $select)
+ {
+ $stmt = $this->_db->query($select);
+ $data = $stmt->fetchAll(Zend_Db::FETCH_ASSOC);
+ return $data;
+ }
+
+ /**
+ * Get table gateway object from string
+ *
+ * @param string $tableName
+ * @param Zend_Db_Table_Abstract $referenceTable
+ * @throws Zend_Db_Table_Row_Exception
+ * @return Zend_Db_Table_Abstract
+ */
+ public static function getTableFromString($tableName, Zend_Db_Table_Abstract $referenceTable = null)
+ {
+ if ($referenceTable instanceof Zend_Db_Table_Abstract) {
+ $tableDefinition = $referenceTable->getDefinition();
+
+ if ($tableDefinition !== null && $tableDefinition->hasTableConfig($tableName)) {
+ return new Zend_Db_Table($tableName, $tableDefinition);
+ }
+ }
+
+ // assume the tableName is the class name
+ if (!class_exists($tableName)) {
+ try {
+ Zend_Loader::loadClass($tableName);
+ } catch (Zend_Exception $e) {
+ throw new Zend_Db_Table_Row_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+
+ $options = array();
+
+ if ($referenceTable instanceof Zend_Db_Table_Abstract) {
+ $options['db'] = $referenceTable->getAdapter();
+ }
+
+ if (isset($tableDefinition) && $tableDefinition !== null) {
+ $options[Zend_Db_Table_Abstract::DEFINITION] = $tableDefinition;
+ }
+
+ return new $tableName($options);
+ }
+
+}
diff --git a/library/vendor/Zend/Db/Table/Definition.php b/library/vendor/Zend/Db/Table/Definition.php
new file mode 100644
index 0000000..76265ae
--- /dev/null
+++ b/library/vendor/Zend/Db/Table/Definition.php
@@ -0,0 +1,131 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Class for SQL table interface.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Table_Definition
+{
+
+ /**
+ * @var array
+ */
+ protected $_tableConfigs = array();
+
+ /**
+ * __construct()
+ *
+ * @param array|Zend_Config $options
+ */
+ public function __construct($options = null)
+ {
+ if ($options instanceof Zend_Config) {
+ $this->setConfig($options);
+ } elseif (is_array($options)) {
+ $this->setOptions($options);
+ }
+ }
+
+ /**
+ * setConfig()
+ *
+ * @param Zend_Config $config
+ * @return Zend_Db_Table_Definition
+ */
+ public function setConfig(Zend_Config $config)
+ {
+ $this->setOptions($config->toArray());
+ return $this;
+ }
+
+ /**
+ * setOptions()
+ *
+ * @param array $options
+ * @return Zend_Db_Table_Definition
+ */
+ public function setOptions(Array $options)
+ {
+ foreach ($options as $optionName => $optionValue) {
+ $this->setTableConfig($optionName, $optionValue);
+ }
+ return $this;
+ }
+
+ /**
+ * @param string $tableName
+ * @param array $tableConfig
+ * @return Zend_Db_Table_Definition
+ */
+ public function setTableConfig($tableName, array $tableConfig)
+ {
+ // @todo logic here
+ $tableConfig[Zend_Db_Table::DEFINITION_CONFIG_NAME] = $tableName;
+ $tableConfig[Zend_Db_Table::DEFINITION] = $this;
+
+ if (!isset($tableConfig[Zend_Db_Table::NAME])) {
+ $tableConfig[Zend_Db_Table::NAME] = $tableName;
+ }
+
+ $this->_tableConfigs[$tableName] = $tableConfig;
+ return $this;
+ }
+
+ /**
+ * getTableConfig()
+ *
+ * @param string $tableName
+ * @return array
+ */
+ public function getTableConfig($tableName)
+ {
+ return $this->_tableConfigs[$tableName];
+ }
+
+ /**
+ * removeTableConfig()
+ *
+ * @param string $tableName
+ */
+ public function removeTableConfig($tableName)
+ {
+ unset($this->_tableConfigs[$tableName]);
+ }
+
+ /**
+ * hasTableConfig()
+ *
+ * @param string $tableName
+ * @return bool
+ */
+ public function hasTableConfig($tableName)
+ {
+ return (isset($this->_tableConfigs[$tableName]));
+ }
+
+}
diff --git a/library/vendor/Zend/Db/Table/Exception.php b/library/vendor/Zend/Db/Table/Exception.php
new file mode 100644
index 0000000..e1599a0
--- /dev/null
+++ b/library/vendor/Zend/Db/Table/Exception.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Db_Exception
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Table_Exception extends Zend_Db_Exception
+{
+}
+
diff --git a/library/vendor/Zend/Db/Table/Row.php b/library/vendor/Zend/Db/Table/Row.php
new file mode 100644
index 0000000..adf00d4
--- /dev/null
+++ b/library/vendor/Zend/Db/Table/Row.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Db_Table_Row_Abstract
+ */
+
+
+/**
+ * Reference concrete class that extends Zend_Db_Table_Row_Abstract.
+ * Developers may also create their own classes that extend the abstract class.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Table_Row extends Zend_Db_Table_Row_Abstract
+{
+}
diff --git a/library/vendor/Zend/Db/Table/Row/Abstract.php b/library/vendor/Zend/Db/Table/Row/Abstract.php
new file mode 100644
index 0000000..e9c60b0
--- /dev/null
+++ b/library/vendor/Zend/Db/Table/Row/Abstract.php
@@ -0,0 +1,1160 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Db
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Db_Table_Row_Abstract implements ArrayAccess, IteratorAggregate
+{
+
+ /**
+ * The data for each column in the row (column_name => value).
+ * The keys must match the physical names of columns in the
+ * table for which this row is defined.
+ *
+ * @var array
+ */
+ protected $_data = array();
+
+ /**
+ * This is set to a copy of $_data when the data is fetched from
+ * a database, specified as a new tuple in the constructor, or
+ * when dirty data is posted to the database with save().
+ *
+ * @var array
+ */
+ protected $_cleanData = array();
+
+ /**
+ * Tracks columns where data has been updated. Allows more specific insert and
+ * update operations.
+ *
+ * @var array
+ */
+ protected $_modifiedFields = array();
+
+ /**
+ * Zend_Db_Table_Abstract parent class or instance.
+ *
+ * @var Zend_Db_Table_Abstract
+ */
+ protected $_table = null;
+
+ /**
+ * Connected is true if we have a reference to a live
+ * Zend_Db_Table_Abstract object.
+ * This is false after the Rowset has been deserialized.
+ *
+ * @var boolean
+ */
+ protected $_connected = true;
+
+ /**
+ * A row is marked read only if it contains columns that are not physically represented within
+ * the database schema (e.g. evaluated columns/Zend_Db_Expr columns). This can also be passed
+ * as a run-time config options as a means of protecting row data.
+ *
+ * @var boolean
+ */
+ protected $_readOnly = false;
+
+ /**
+ * Name of the class of the Zend_Db_Table_Abstract object.
+ *
+ * @var string
+ */
+ protected $_tableClass = null;
+
+ /**
+ * Primary row key(s).
+ *
+ * @var array
+ */
+ protected $_primary;
+
+ /**
+ * Constructor.
+ *
+ * Supported params for $config are:-
+ * - table = class name or object of type Zend_Db_Table_Abstract
+ * - data = values of columns in this row.
+ *
+ * @param array $config OPTIONAL Array of user-specified config options.
+ * @return void
+ * @throws Zend_Db_Table_Row_Exception
+ */
+ public function __construct(array $config = array())
+ {
+ if (isset($config['table']) && $config['table'] instanceof Zend_Db_Table_Abstract) {
+ $this->_table = $config['table'];
+ $this->_tableClass = get_class($this->_table);
+ } elseif ($this->_tableClass !== null) {
+ $this->_table = $this->_getTableFromString($this->_tableClass);
+ }
+
+ if (isset($config['data'])) {
+ if (!is_array($config['data'])) {
+ throw new Zend_Db_Table_Row_Exception('Data must be an array');
+ }
+ $this->_data = $config['data'];
+ }
+ if (isset($config['stored']) && $config['stored'] === true) {
+ $this->_cleanData = $this->_data;
+ }
+
+ if (isset($config['readOnly']) && $config['readOnly'] === true) {
+ $this->setReadOnly(true);
+ }
+
+ // Retrieve primary keys from table schema
+ if (($table = $this->_getTable())) {
+ $info = $table->info();
+ $this->_primary = (array) $info['primary'];
+ }
+
+ $this->init();
+ }
+
+ /**
+ * Transform a column name from the user-specified form
+ * to the physical form used in the database.
+ * You can override this method in a custom Row class
+ * to implement column name mappings, for example inflection.
+ *
+ * @param string $columnName Column name given.
+ * @return string The column name after transformation applied (none by default).
+ * @throws Zend_Db_Table_Row_Exception if the $columnName is not a string.
+ */
+ protected function _transformColumn($columnName)
+ {
+ if (!is_string($columnName)) {
+ throw new Zend_Db_Table_Row_Exception('Specified column is not a string');
+ }
+ // Perform no transformation by default
+ return $columnName;
+ }
+
+ /**
+ * Retrieve row field value
+ *
+ * @param string $columnName The user-specified column name.
+ * @return string The corresponding column value.
+ * @throws Zend_Db_Table_Row_Exception if the $columnName is not a column in the row.
+ */
+ public function __get($columnName)
+ {
+ $columnName = $this->_transformColumn($columnName);
+ if (!array_key_exists($columnName, $this->_data)) {
+ throw new Zend_Db_Table_Row_Exception("Specified column \"$columnName\" is not in the row");
+ }
+ return $this->_data[$columnName];
+ }
+
+ /**
+ * Set row field value
+ *
+ * @param string $columnName The column key.
+ * @param mixed $value The value for the property.
+ * @return void
+ * @throws Zend_Db_Table_Row_Exception
+ */
+ public function __set($columnName, $value)
+ {
+ $columnName = $this->_transformColumn($columnName);
+ if (!array_key_exists($columnName, $this->_data)) {
+ throw new Zend_Db_Table_Row_Exception("Specified column \"$columnName\" is not in the row");
+ }
+ $this->_data[$columnName] = $value;
+ $this->_modifiedFields[$columnName] = true;
+ }
+
+ /**
+ * Unset row field value
+ *
+ * @param string $columnName The column key.
+ * @return Zend_Db_Table_Row_Abstract
+ * @throws Zend_Db_Table_Row_Exception
+ */
+ public function __unset($columnName)
+ {
+ $columnName = $this->_transformColumn($columnName);
+ if (!array_key_exists($columnName, $this->_data)) {
+ throw new Zend_Db_Table_Row_Exception("Specified column \"$columnName\" is not in the row");
+ }
+ if ($this->isConnected() && in_array($columnName, $this->_table->info('primary'))) {
+ throw new Zend_Db_Table_Row_Exception("Specified column \"$columnName\" is a primary key and should not be unset");
+ }
+ unset($this->_data[$columnName]);
+ return $this;
+ }
+
+ /**
+ * Test existence of row field
+ *
+ * @param string $columnName The column key.
+ * @return boolean
+ */
+ public function __isset($columnName)
+ {
+ $columnName = $this->_transformColumn($columnName);
+ return array_key_exists($columnName, $this->_data);
+ }
+
+ /**
+ * Store table, primary key and data in serialized object
+ *
+ * @return array
+ */
+ public function __sleep()
+ {
+ return array('_tableClass', '_primary', '_data', '_cleanData', '_readOnly' ,'_modifiedFields');
+ }
+
+ /**
+ * Setup to do on wakeup.
+ * A de-serialized Row should not be assumed to have access to a live
+ * database connection, so set _connected = false.
+ *
+ * @return void
+ */
+ public function __wakeup()
+ {
+ $this->_connected = false;
+ }
+
+ /**
+ * Proxy to __isset
+ * Required by the ArrayAccess implementation
+ *
+ * @param string $offset
+ * @return boolean
+ */
+ public function offsetExists($offset)
+ {
+ return $this->__isset($offset);
+ }
+
+ /**
+ * Proxy to __get
+ * Required by the ArrayAccess implementation
+ *
+ * @param string $offset
+ * @return string
+ */
+ public function offsetGet($offset)
+ {
+ return $this->__get($offset);
+ }
+
+ /**
+ * Proxy to __set
+ * Required by the ArrayAccess implementation
+ *
+ * @param string $offset
+ * @param mixed $value
+ */
+ public function offsetSet($offset, $value)
+ {
+ $this->__set($offset, $value);
+ }
+
+ /**
+ * Proxy to __unset
+ * Required by the ArrayAccess implementation
+ *
+ * @param string $offset
+ */
+ public function offsetUnset($offset)
+ {
+ return $this->__unset($offset);
+ }
+
+ /**
+ * Initialize object
+ *
+ * Called from {@link __construct()} as final step of object instantiation.
+ *
+ * @return void
+ */
+ public function init()
+ {
+ }
+
+ /**
+ * Returns the table object, or null if this is disconnected row
+ *
+ * @return Zend_Db_Table_Abstract|null
+ */
+ public function getTable()
+ {
+ return $this->_table;
+ }
+
+ /**
+ * Set the table object, to re-establish a live connection
+ * to the database for a Row that has been de-serialized.
+ *
+ * @param Zend_Db_Table_Abstract $table
+ * @return boolean
+ * @throws Zend_Db_Table_Row_Exception
+ */
+ public function setTable(Zend_Db_Table_Abstract $table = null)
+ {
+ if ($table == null) {
+ $this->_table = null;
+ $this->_connected = false;
+ return false;
+ }
+
+ $tableClass = get_class($table);
+ if (! $table instanceof $this->_tableClass) {
+ throw new Zend_Db_Table_Row_Exception("The specified Table is of class $tableClass, expecting class to be instance of $this->_tableClass");
+ }
+
+ $this->_table = $table;
+ $this->_tableClass = $tableClass;
+
+ $info = $this->_table->info();
+
+ if ($info['cols'] != array_keys($this->_data)) {
+ throw new Zend_Db_Table_Row_Exception('The specified Table does not have the same columns as the Row');
+ }
+
+ if (! array_intersect((array) $this->_primary, $info['primary']) == (array) $this->_primary) {
+
+ throw new Zend_Db_Table_Row_Exception("The specified Table '$tableClass' does not have the same primary key as the Row");
+ }
+
+ $this->_connected = true;
+ return true;
+ }
+
+ /**
+ * Query the class name of the Table object for which this
+ * Row was created.
+ *
+ * @return string
+ */
+ public function getTableClass()
+ {
+ return $this->_tableClass;
+ }
+
+ /**
+ * Test the connected status of the row.
+ *
+ * @return boolean
+ */
+ public function isConnected()
+ {
+ return $this->_connected;
+ }
+
+ /**
+ * Test the read-only status of the row.
+ *
+ * @return boolean
+ */
+ public function isReadOnly()
+ {
+ return $this->_readOnly;
+ }
+
+ /**
+ * Set the read-only status of the row.
+ *
+ * @param boolean $flag
+ * @return boolean
+ */
+ public function setReadOnly($flag)
+ {
+ $this->_readOnly = (bool) $flag;
+ }
+
+ /**
+ * Returns an instance of the parent table's Zend_Db_Table_Select object.
+ *
+ * @return Zend_Db_Table_Select
+ */
+ public function select()
+ {
+ return $this->getTable()->select();
+ }
+
+ /**
+ * Saves the properties to the database.
+ *
+ * This performs an intelligent insert/update, and reloads the
+ * properties with fresh data from the table on success.
+ *
+ * @return mixed The primary key value(s), as an associative array if the
+ * key is compound, or a scalar if the key is single-column.
+ */
+ public function save()
+ {
+ /**
+ * If the _cleanData array is empty,
+ * this is an INSERT of a new row.
+ * Otherwise it is an UPDATE.
+ */
+ if (empty($this->_cleanData)) {
+ return $this->_doInsert();
+ } else {
+ return $this->_doUpdate();
+ }
+ }
+
+ /**
+ * @return mixed The primary key value(s), as an associative array if the
+ * key is compound, or a scalar if the key is single-column.
+ */
+ protected function _doInsert()
+ {
+ /**
+ * A read-only row cannot be saved.
+ */
+ if ($this->_readOnly === true) {
+ throw new Zend_Db_Table_Row_Exception('This row has been marked read-only');
+ }
+
+ /**
+ * Run pre-INSERT logic
+ */
+ $this->_insert();
+
+ /**
+ * Execute the INSERT (this may throw an exception)
+ */
+ $data = array_intersect_key($this->_data, $this->_modifiedFields);
+ $primaryKey = $this->_getTable()->insert($data);
+
+ /**
+ * Normalize the result to an array indexed by primary key column(s).
+ * The table insert() method may return a scalar.
+ */
+ if (is_array($primaryKey)) {
+ $newPrimaryKey = $primaryKey;
+ } else {
+ //ZF-6167 Use tempPrimaryKey temporary to avoid that zend encoding fails.
+ $tempPrimaryKey = (array) $this->_primary;
+ $newPrimaryKey = array(current($tempPrimaryKey) => $primaryKey);
+ }
+
+ /**
+ * Save the new primary key value in _data. The primary key may have
+ * been generated by a sequence or auto-increment mechanism, and this
+ * merge should be done before the _postInsert() method is run, so the
+ * new values are available for logging, etc.
+ */
+ $this->_data = array_merge($this->_data, $newPrimaryKey);
+
+ /**
+ * Run post-INSERT logic
+ */
+ $this->_postInsert();
+
+ /**
+ * Update the _cleanData to reflect that the data has been inserted.
+ */
+ $this->_refresh();
+
+ return $primaryKey;
+ }
+
+ /**
+ * @return mixed The primary key value(s), as an associative array if the
+ * key is compound, or a scalar if the key is single-column.
+ */
+ protected function _doUpdate()
+ {
+ /**
+ * A read-only row cannot be saved.
+ */
+ if ($this->_readOnly === true) {
+ throw new Zend_Db_Table_Row_Exception('This row has been marked read-only');
+ }
+
+ /**
+ * Get expressions for a WHERE clause
+ * based on the primary key value(s).
+ */
+ $where = $this->_getWhereQuery(false);
+
+ /**
+ * Run pre-UPDATE logic
+ */
+ $this->_update();
+
+ /**
+ * Compare the data to the modified fields array to discover
+ * which columns have been changed.
+ */
+ $diffData = array_intersect_key($this->_data, $this->_modifiedFields);
+
+ /**
+ * Were any of the changed columns part of the primary key?
+ */
+ $pkDiffData = array_intersect_key($diffData, array_flip((array)$this->_primary));
+
+ /**
+ * Execute cascading updates against dependent tables.
+ * Do this only if primary key value(s) were changed.
+ */
+ if (count($pkDiffData) > 0) {
+ $depTables = $this->_getTable()->getDependentTables();
+ if (!empty($depTables)) {
+ $pkNew = $this->_getPrimaryKey(true);
+ $pkOld = $this->_getPrimaryKey(false);
+ foreach ($depTables as $tableClass) {
+ $t = $this->_getTableFromString($tableClass);
+ $t->_cascadeUpdate($this->getTableClass(), $pkOld, $pkNew);
+ }
+ }
+ }
+
+ /**
+ * Execute the UPDATE (this may throw an exception)
+ * Do this only if data values were changed.
+ * Use the $diffData variable, so the UPDATE statement
+ * includes SET terms only for data values that changed.
+ */
+ if (count($diffData) > 0) {
+ $this->_getTable()->update($diffData, $where);
+ }
+
+ /**
+ * Run post-UPDATE logic. Do this before the _refresh()
+ * so the _postUpdate() function can tell the difference
+ * between changed data and clean (pre-changed) data.
+ */
+ $this->_postUpdate();
+
+ /**
+ * Refresh the data just in case triggers in the RDBMS changed
+ * any columns. Also this resets the _cleanData.
+ */
+ $this->_refresh();
+
+ /**
+ * Return the primary key value(s) as an array
+ * if the key is compound or a scalar if the key
+ * is a scalar.
+ */
+ $primaryKey = $this->_getPrimaryKey(true);
+ if (count($primaryKey) == 1) {
+ return current($primaryKey);
+ }
+
+ return $primaryKey;
+ }
+
+ /**
+ * Deletes existing rows.
+ *
+ * @return int The number of rows deleted.
+ */
+ public function delete()
+ {
+ /**
+ * A read-only row cannot be deleted.
+ */
+ if ($this->_readOnly === true) {
+ throw new Zend_Db_Table_Row_Exception('This row has been marked read-only');
+ }
+
+ $where = $this->_getWhereQuery();
+
+ /**
+ * Execute pre-DELETE logic
+ */
+ $this->_delete();
+
+ /**
+ * Execute cascading deletes against dependent tables
+ */
+ $depTables = $this->_getTable()->getDependentTables();
+ if (!empty($depTables)) {
+ $pk = $this->_getPrimaryKey();
+ foreach ($depTables as $tableClass) {
+ $t = $this->_getTableFromString($tableClass);
+ $t->_cascadeDelete($this->getTableClass(), $pk);
+ }
+ }
+
+ /**
+ * Execute the DELETE (this may throw an exception)
+ */
+ $result = $this->_getTable()->delete($where);
+
+ /**
+ * Execute post-DELETE logic
+ */
+ $this->_postDelete();
+
+ /**
+ * Reset all fields to null to indicate that the row is not there
+ */
+ $this->_data = array_combine(
+ array_keys($this->_data),
+ array_fill(0, count($this->_data), null)
+ );
+
+ return $result;
+ }
+
+ public function getIterator()
+ {
+ return new ArrayIterator((array) $this->_data);
+ }
+
+ /**
+ * Returns the column/value data as an array.
+ *
+ * @return array
+ */
+ public function toArray()
+ {
+ return (array)$this->_data;
+ }
+
+ /**
+ * Sets all data in the row from an array.
+ *
+ * @param array $data
+ * @return Zend_Db_Table_Row_Abstract Provides a fluent interface
+ */
+ public function setFromArray(array $data)
+ {
+ $data = array_intersect_key($data, $this->_data);
+
+ foreach ($data as $columnName => $value) {
+ $this->__set($columnName, $value);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Refreshes properties from the database.
+ *
+ * @return void
+ */
+ public function refresh()
+ {
+ return $this->_refresh();
+ }
+
+ /**
+ * Retrieves an instance of the parent table.
+ *
+ * @return Zend_Db_Table_Abstract
+ */
+ protected function _getTable()
+ {
+ if (!$this->_connected) {
+ throw new Zend_Db_Table_Row_Exception('Cannot save a Row unless it is connected');
+ }
+ return $this->_table;
+ }
+
+ /**
+ * Retrieves an associative array of primary keys.
+ *
+ * @param bool $useDirty
+ * @return array
+ */
+ protected function _getPrimaryKey($useDirty = true)
+ {
+ if (!is_array($this->_primary)) {
+ throw new Zend_Db_Table_Row_Exception("The primary key must be set as an array");
+ }
+
+ $primary = array_flip($this->_primary);
+ if ($useDirty) {
+ $array = array_intersect_key($this->_data, $primary);
+ } else {
+ $array = array_intersect_key($this->_cleanData, $primary);
+ }
+ if (count($primary) != count($array)) {
+ throw new Zend_Db_Table_Row_Exception("The specified Table '$this->_tableClass' does not have the same primary key as the Row");
+ }
+ return $array;
+ }
+
+ /**
+ * Retrieves an associative array of primary keys.
+ *
+ * @param bool $useDirty
+ * @return array
+ */
+ public function getPrimaryKey($useDirty = true)
+ {
+ return $this->_getPrimaryKey($useDirty);
+ }
+
+ /**
+ * Constructs where statement for retrieving row(s).
+ *
+ * @param bool $useDirty
+ * @return array
+ */
+ protected function _getWhereQuery($useDirty = true)
+ {
+ $where = array();
+ $db = $this->_getTable()->getAdapter();
+ $primaryKey = $this->_getPrimaryKey($useDirty);
+ $info = $this->_getTable()->info();
+ $metadata = $info[Zend_Db_Table_Abstract::METADATA];
+
+ // retrieve recently updated row using primary keys
+ $where = array();
+ foreach ($primaryKey as $column => $value) {
+ $tableName = $db->quoteIdentifier($info[Zend_Db_Table_Abstract::NAME], true);
+ $type = $metadata[$column]['DATA_TYPE'];
+ $columnName = $db->quoteIdentifier($column, true);
+ $where[] = $db->quoteInto("{$tableName}.{$columnName} = ?", $value, $type);
+ }
+ return $where;
+ }
+
+ /**
+ * Refreshes properties from the database.
+ *
+ * @return void
+ */
+ protected function _refresh()
+ {
+ $where = $this->_getWhereQuery();
+ $row = $this->_getTable()->fetchRow($where);
+
+ if (null === $row) {
+ throw new Zend_Db_Table_Row_Exception('Cannot refresh row as parent is missing');
+ }
+
+ $this->_data = $row->toArray();
+ $this->_cleanData = $this->_data;
+ $this->_modifiedFields = array();
+ }
+
+ /**
+ * Allows pre-insert logic to be applied to row.
+ * Subclasses may override this method.
+ *
+ * @return void
+ */
+ protected function _insert()
+ {
+ }
+
+ /**
+ * Allows post-insert logic to be applied to row.
+ * Subclasses may override this method.
+ *
+ * @return void
+ */
+ protected function _postInsert()
+ {
+ }
+
+ /**
+ * Allows pre-update logic to be applied to row.
+ * Subclasses may override this method.
+ *
+ * @return void
+ */
+ protected function _update()
+ {
+ }
+
+ /**
+ * Allows post-update logic to be applied to row.
+ * Subclasses may override this method.
+ *
+ * @return void
+ */
+ protected function _postUpdate()
+ {
+ }
+
+ /**
+ * Allows pre-delete logic to be applied to row.
+ * Subclasses may override this method.
+ *
+ * @return void
+ */
+ protected function _delete()
+ {
+ }
+
+ /**
+ * Allows post-delete logic to be applied to row.
+ * Subclasses may override this method.
+ *
+ * @return void
+ */
+ protected function _postDelete()
+ {
+ }
+
+ /**
+ * Prepares a table reference for lookup.
+ *
+ * Ensures all reference keys are set and properly formatted.
+ *
+ * @param Zend_Db_Table_Abstract $dependentTable
+ * @param Zend_Db_Table_Abstract $parentTable
+ * @param string $ruleKey
+ * @return array
+ */
+ protected function _prepareReference(Zend_Db_Table_Abstract $dependentTable, Zend_Db_Table_Abstract $parentTable, $ruleKey)
+ {
+ $parentTableName = (get_class($parentTable) === 'Zend_Db_Table') ? $parentTable->getDefinitionConfigName() : get_class($parentTable);
+ $map = $dependentTable->getReference($parentTableName, $ruleKey);
+
+ if (!isset($map[Zend_Db_Table_Abstract::REF_COLUMNS])) {
+ $parentInfo = $parentTable->info();
+ $map[Zend_Db_Table_Abstract::REF_COLUMNS] = array_values((array) $parentInfo['primary']);
+ }
+
+ $map[Zend_Db_Table_Abstract::COLUMNS] = (array) $map[Zend_Db_Table_Abstract::COLUMNS];
+ $map[Zend_Db_Table_Abstract::REF_COLUMNS] = (array) $map[Zend_Db_Table_Abstract::REF_COLUMNS];
+
+ return $map;
+ }
+
+ /**
+ * Query a dependent table to retrieve rows matching the current row.
+ *
+ * @param string|Zend_Db_Table_Abstract $dependentTable
+ * @param string OPTIONAL $ruleKey
+ * @param Zend_Db_Table_Select OPTIONAL $select
+ * @return Zend_Db_Table_Rowset_Abstract Query result from $dependentTable
+ * @throws Zend_Db_Table_Row_Exception If $dependentTable is not a table or is not loadable.
+ */
+ public function findDependentRowset($dependentTable, $ruleKey = null, Zend_Db_Table_Select $select = null)
+ {
+ $db = $this->_getTable()->getAdapter();
+
+ if (is_string($dependentTable)) {
+ $dependentTable = $this->_getTableFromString($dependentTable);
+ }
+
+ if (!$dependentTable instanceof Zend_Db_Table_Abstract) {
+ $type = gettype($dependentTable);
+ if ($type == 'object') {
+ $type = get_class($dependentTable);
+ }
+ throw new Zend_Db_Table_Row_Exception("Dependent table must be a Zend_Db_Table_Abstract, but it is $type");
+ }
+
+ // even if we are interacting between a table defined in a class and a
+ // table via extension, ensure to persist the definition
+ if (($tableDefinition = $this->_table->getDefinition()) !== null
+ && ($dependentTable->getDefinition() == null)) {
+ $dependentTable->setOptions(array(Zend_Db_Table_Abstract::DEFINITION => $tableDefinition));
+ }
+
+ if ($select === null) {
+ $select = $dependentTable->select();
+ } else {
+ $select->setTable($dependentTable);
+ }
+
+ $map = $this->_prepareReference($dependentTable, $this->_getTable(), $ruleKey);
+
+ for ($i = 0; $i < count($map[Zend_Db_Table_Abstract::COLUMNS]); ++$i) {
+ $parentColumnName = $db->foldCase($map[Zend_Db_Table_Abstract::REF_COLUMNS][$i]);
+ $value = $this->_data[$parentColumnName];
+ // Use adapter from dependent table to ensure correct query construction
+ $dependentDb = $dependentTable->getAdapter();
+ $dependentColumnName = $dependentDb->foldCase($map[Zend_Db_Table_Abstract::COLUMNS][$i]);
+ $dependentColumn = $dependentDb->quoteIdentifier($dependentColumnName, true);
+ $dependentInfo = $dependentTable->info();
+ $type = $dependentInfo[Zend_Db_Table_Abstract::METADATA][$dependentColumnName]['DATA_TYPE'];
+ $select->where("$dependentColumn = ?", $value, $type);
+ }
+
+ return $dependentTable->fetchAll($select);
+ }
+
+ /**
+ * Query a parent table to retrieve the single row matching the current row.
+ *
+ * @param string|Zend_Db_Table_Abstract $parentTable
+ * @param string OPTIONAL $ruleKey
+ * @param Zend_Db_Table_Select OPTIONAL $select
+ * @return Zend_Db_Table_Row_Abstract Query result from $parentTable
+ * @throws Zend_Db_Table_Row_Exception If $parentTable is not a table or is not loadable.
+ */
+ public function findParentRow($parentTable, $ruleKey = null, Zend_Db_Table_Select $select = null)
+ {
+ $db = $this->_getTable()->getAdapter();
+
+ if (is_string($parentTable)) {
+ $parentTable = $this->_getTableFromString($parentTable);
+ }
+
+ if (!$parentTable instanceof Zend_Db_Table_Abstract) {
+ $type = gettype($parentTable);
+ if ($type == 'object') {
+ $type = get_class($parentTable);
+ }
+ throw new Zend_Db_Table_Row_Exception("Parent table must be a Zend_Db_Table_Abstract, but it is $type");
+ }
+
+ // even if we are interacting between a table defined in a class and a
+ // table via extension, ensure to persist the definition
+ if (($tableDefinition = $this->_table->getDefinition()) !== null
+ && ($parentTable->getDefinition() == null)) {
+ $parentTable->setOptions(array(Zend_Db_Table_Abstract::DEFINITION => $tableDefinition));
+ }
+
+ if ($select === null) {
+ $select = $parentTable->select();
+ } else {
+ $select->setTable($parentTable);
+ }
+
+ $map = $this->_prepareReference($this->_getTable(), $parentTable, $ruleKey);
+
+ // iterate the map, creating the proper wheres
+ for ($i = 0; $i < count($map[Zend_Db_Table_Abstract::COLUMNS]); ++$i) {
+ $dependentColumnName = $db->foldCase($map[Zend_Db_Table_Abstract::COLUMNS][$i]);
+ $value = $this->_data[$dependentColumnName];
+ // Use adapter from parent table to ensure correct query construction
+ $parentDb = $parentTable->getAdapter();
+ $parentColumnName = $parentDb->foldCase($map[Zend_Db_Table_Abstract::REF_COLUMNS][$i]);
+ $parentColumn = $parentDb->quoteIdentifier($parentColumnName, true);
+ $parentInfo = $parentTable->info();
+
+ // determine where part
+ $type = $parentInfo[Zend_Db_Table_Abstract::METADATA][$parentColumnName]['DATA_TYPE'];
+ $nullable = $parentInfo[Zend_Db_Table_Abstract::METADATA][$parentColumnName]['NULLABLE'];
+ if ($value === null && $nullable == true) {
+ $select->where("$parentColumn IS NULL");
+ } elseif ($value === null && $nullable == false) {
+ return null;
+ } else {
+ $select->where("$parentColumn = ?", $value, $type);
+ }
+
+ }
+
+ return $parentTable->fetchRow($select);
+ }
+
+ /**
+ * @param string|Zend_Db_Table_Abstract $matchTable
+ * @param string|Zend_Db_Table_Abstract $intersectionTable
+ * @param string OPTIONAL $callerRefRule
+ * @param string OPTIONAL $matchRefRule
+ * @param Zend_Db_Table_Select OPTIONAL $select
+ * @return Zend_Db_Table_Rowset_Abstract Query result from $matchTable
+ * @throws Zend_Db_Table_Row_Exception If $matchTable or $intersectionTable is not a table class or is not loadable.
+ */
+ public function findManyToManyRowset($matchTable, $intersectionTable, $callerRefRule = null,
+ $matchRefRule = null, Zend_Db_Table_Select $select = null)
+ {
+ $db = $this->_getTable()->getAdapter();
+
+ if (is_string($intersectionTable)) {
+ $intersectionTable = $this->_getTableFromString($intersectionTable);
+ }
+
+ if (!$intersectionTable instanceof Zend_Db_Table_Abstract) {
+ $type = gettype($intersectionTable);
+ if ($type == 'object') {
+ $type = get_class($intersectionTable);
+ }
+ throw new Zend_Db_Table_Row_Exception("Intersection table must be a Zend_Db_Table_Abstract, but it is $type");
+ }
+
+ // even if we are interacting between a table defined in a class and a
+ // table via extension, ensure to persist the definition
+ if (($tableDefinition = $this->_table->getDefinition()) !== null
+ && ($intersectionTable->getDefinition() == null)) {
+ $intersectionTable->setOptions(array(Zend_Db_Table_Abstract::DEFINITION => $tableDefinition));
+ }
+
+ if (is_string($matchTable)) {
+ $matchTable = $this->_getTableFromString($matchTable);
+ }
+
+ if (! $matchTable instanceof Zend_Db_Table_Abstract) {
+ $type = gettype($matchTable);
+ if ($type == 'object') {
+ $type = get_class($matchTable);
+ }
+ throw new Zend_Db_Table_Row_Exception("Match table must be a Zend_Db_Table_Abstract, but it is $type");
+ }
+
+ // even if we are interacting between a table defined in a class and a
+ // table via extension, ensure to persist the definition
+ if (($tableDefinition = $this->_table->getDefinition()) !== null
+ && ($matchTable->getDefinition() == null)) {
+ $matchTable->setOptions(array(Zend_Db_Table_Abstract::DEFINITION => $tableDefinition));
+ }
+
+ if ($select === null) {
+ $select = $matchTable->select();
+ } else {
+ $select->setTable($matchTable);
+ }
+
+ // Use adapter from intersection table to ensure correct query construction
+ $interInfo = $intersectionTable->info();
+ $interDb = $intersectionTable->getAdapter();
+ $interName = $interInfo['name'];
+ $interSchema = isset($interInfo['schema']) ? $interInfo['schema'] : null;
+ $matchInfo = $matchTable->info();
+ $matchName = $matchInfo['name'];
+ $matchSchema = isset($matchInfo['schema']) ? $matchInfo['schema'] : null;
+
+ $matchMap = $this->_prepareReference($intersectionTable, $matchTable, $matchRefRule);
+
+ for ($i = 0; $i < count($matchMap[Zend_Db_Table_Abstract::COLUMNS]); ++$i) {
+ $interCol = $interDb->quoteIdentifier('i' . '.' . $matchMap[Zend_Db_Table_Abstract::COLUMNS][$i], true);
+ $matchCol = $interDb->quoteIdentifier('m' . '.' . $matchMap[Zend_Db_Table_Abstract::REF_COLUMNS][$i], true);
+ $joinCond[] = "$interCol = $matchCol";
+ }
+ $joinCond = implode(' AND ', $joinCond);
+
+ $select->from(array('i' => $interName), array(), $interSchema)
+ ->joinInner(array('m' => $matchName), $joinCond, Zend_Db_Select::SQL_WILDCARD, $matchSchema)
+ ->setIntegrityCheck(false);
+
+ $callerMap = $this->_prepareReference($intersectionTable, $this->_getTable(), $callerRefRule);
+
+ for ($i = 0; $i < count($callerMap[Zend_Db_Table_Abstract::COLUMNS]); ++$i) {
+ $callerColumnName = $db->foldCase($callerMap[Zend_Db_Table_Abstract::REF_COLUMNS][$i]);
+ $value = $this->_data[$callerColumnName];
+ $interColumnName = $interDb->foldCase($callerMap[Zend_Db_Table_Abstract::COLUMNS][$i]);
+ $interCol = $interDb->quoteIdentifier("i.$interColumnName", true);
+ $interInfo = $intersectionTable->info();
+ $type = $interInfo[Zend_Db_Table_Abstract::METADATA][$interColumnName]['DATA_TYPE'];
+ $select->where($interDb->quoteInto("$interCol = ?", $value, $type));
+ }
+
+ $stmt = $select->query();
+
+ $config = array(
+ 'table' => $matchTable,
+ 'data' => $stmt->fetchAll(Zend_Db::FETCH_ASSOC),
+ 'rowClass' => $matchTable->getRowClass(),
+ 'readOnly' => false,
+ 'stored' => true
+ );
+
+ $rowsetClass = $matchTable->getRowsetClass();
+ if (!class_exists($rowsetClass)) {
+ try {
+ Zend_Loader::loadClass($rowsetClass);
+ } catch (Zend_Exception $e) {
+ throw new Zend_Db_Table_Row_Exception($e->getMessage(), $e->getCode(), $e);
+ }
+ }
+ $rowset = new $rowsetClass($config);
+ return $rowset;
+ }
+
+ /**
+ * Turn magic function calls into non-magic function calls
+ * to the above methods.
+ *
+ * @param string $method
+ * @param array $args OPTIONAL Zend_Db_Table_Select query modifier
+ * @return Zend_Db_Table_Row_Abstract|Zend_Db_Table_Rowset_Abstract
+ * @throws Zend_Db_Table_Row_Exception If an invalid method is called.
+ */
+ public function __call($method, array $args)
+ {
+ $matches = array();
+
+ if (count($args) && $args[0] instanceof Zend_Db_Table_Select) {
+ $select = $args[0];
+ } else {
+ $select = null;
+ }
+
+ /**
+ * Recognize methods for Has-Many cases:
+ * findParent<Class>()
+ * findParent<Class>By<Rule>()
+ * Use the non-greedy pattern repeat modifier e.g. \w+?
+ */
+ if (preg_match('/^findParent(\w+?)(?:By(\w+))?$/', $method, $matches)) {
+ $class = $matches[1];
+ $ruleKey1 = isset($matches[2]) ? $matches[2] : null;
+ return $this->findParentRow($class, $ruleKey1, $select);
+ }
+
+ /**
+ * Recognize methods for Many-to-Many cases:
+ * find<Class1>Via<Class2>()
+ * find<Class1>Via<Class2>By<Rule>()
+ * find<Class1>Via<Class2>By<Rule1>And<Rule2>()
+ * Use the non-greedy pattern repeat modifier e.g. \w+?
+ */
+ if (preg_match('/^find(\w+?)Via(\w+?)(?:By(\w+?)(?:And(\w+))?)?$/', $method, $matches)) {
+ $class = $matches[1];
+ $viaClass = $matches[2];
+ $ruleKey1 = isset($matches[3]) ? $matches[3] : null;
+ $ruleKey2 = isset($matches[4]) ? $matches[4] : null;
+ return $this->findManyToManyRowset($class, $viaClass, $ruleKey1, $ruleKey2, $select);
+ }
+
+ /**
+ * Recognize methods for Belongs-To cases:
+ * find<Class>()
+ * find<Class>By<Rule>()
+ * Use the non-greedy pattern repeat modifier e.g. \w+?
+ */
+ if (preg_match('/^find(\w+?)(?:By(\w+))?$/', $method, $matches)) {
+ $class = $matches[1];
+ $ruleKey1 = isset($matches[2]) ? $matches[2] : null;
+ return $this->findDependentRowset($class, $ruleKey1, $select);
+ }
+
+ throw new Zend_Db_Table_Row_Exception("Unrecognized method '$method()'");
+ }
+
+
+ /**
+ * _getTableFromString
+ *
+ * @param string $tableName
+ * @return Zend_Db_Table_Abstract
+ */
+ protected function _getTableFromString($tableName)
+ {
+ return Zend_Db_Table_Abstract::getTableFromString($tableName, $this->_table);
+ }
+
+}
diff --git a/library/vendor/Zend/Db/Table/Row/Exception.php b/library/vendor/Zend/Db/Table/Row/Exception.php
new file mode 100644
index 0000000..fe23d66
--- /dev/null
+++ b/library/vendor/Zend/Db/Table/Row/Exception.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Db_Table_Exception
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Table_Row_Exception extends Zend_Db_Table_Exception
+{
+}
+
diff --git a/library/vendor/Zend/Db/Table/Rowset.php b/library/vendor/Zend/Db/Table/Rowset.php
new file mode 100644
index 0000000..ce20a58
--- /dev/null
+++ b/library/vendor/Zend/Db/Table/Rowset.php
@@ -0,0 +1,42 @@
+<?php
+
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Db_Table_Rowset_Abstract
+ */
+
+
+/**
+ * Reference concrete class that extends Zend_Db_Table_Rowset_Abstract.
+ * Developers may also create their own classes that extend the abstract class.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Table_Rowset extends Zend_Db_Table_Rowset_Abstract
+{
+}
diff --git a/library/vendor/Zend/Db/Table/Rowset/Abstract.php b/library/vendor/Zend/Db/Table/Rowset/Abstract.php
new file mode 100644
index 0000000..205fe1b
--- /dev/null
+++ b/library/vendor/Zend/Db/Table/Rowset/Abstract.php
@@ -0,0 +1,443 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Db_Table_Rowset_Abstract implements SeekableIterator, Countable, ArrayAccess
+{
+ /**
+ * The original data for each row.
+ *
+ * @var array
+ */
+ protected $_data = array();
+
+ /**
+ * Zend_Db_Table_Abstract object.
+ *
+ * @var Zend_Db_Table_Abstract
+ */
+ protected $_table;
+
+ /**
+ * Connected is true if we have a reference to a live
+ * Zend_Db_Table_Abstract object.
+ * This is false after the Rowset has been deserialized.
+ *
+ * @var boolean
+ */
+ protected $_connected = true;
+
+ /**
+ * Zend_Db_Table_Abstract class name.
+ *
+ * @var string
+ */
+ protected $_tableClass;
+
+ /**
+ * Zend_Db_Table_Row_Abstract class name.
+ *
+ * @var string
+ */
+ protected $_rowClass = 'Zend_Db_Table_Row';
+
+ /**
+ * Iterator pointer.
+ *
+ * @var integer
+ */
+ protected $_pointer = 0;
+
+ /**
+ * How many data rows there are.
+ *
+ * @var integer
+ */
+ protected $_count;
+
+ /**
+ * Collection of instantiated Zend_Db_Table_Row objects.
+ *
+ * @var array
+ */
+ protected $_rows = array();
+
+ /**
+ * @var boolean
+ */
+ protected $_stored = false;
+
+ /**
+ * @var boolean
+ */
+ protected $_readOnly = false;
+
+ /**
+ * Constructor.
+ *
+ * @param array $config
+ */
+ public function __construct(array $config)
+ {
+ if (isset($config['table'])) {
+ $this->_table = $config['table'];
+ $this->_tableClass = get_class($this->_table);
+ }
+ if (isset($config['rowClass'])) {
+ $this->_rowClass = $config['rowClass'];
+ }
+ if (!class_exists($this->_rowClass)) {
+ Zend_Loader::loadClass($this->_rowClass);
+ }
+ if (isset($config['data'])) {
+ $this->_data = $config['data'];
+ }
+ if (isset($config['readOnly'])) {
+ $this->_readOnly = $config['readOnly'];
+ }
+ if (isset($config['stored'])) {
+ $this->_stored = $config['stored'];
+ }
+
+ // set the count of rows
+ $this->_count = count($this->_data);
+
+ $this->init();
+ }
+
+ /**
+ * Store data, class names, and state in serialized object
+ *
+ * @return array
+ */
+ public function __sleep()
+ {
+ return array('_data', '_tableClass', '_rowClass', '_pointer', '_count', '_rows', '_stored',
+ '_readOnly');
+ }
+
+ /**
+ * Setup to do on wakeup.
+ * A de-serialized Rowset should not be assumed to have access to a live
+ * database connection, so set _connected = false.
+ *
+ * @return void
+ */
+ public function __wakeup()
+ {
+ $this->_connected = false;
+ }
+
+ /**
+ * Initialize object
+ *
+ * Called from {@link __construct()} as final step of object instantiation.
+ *
+ * @return void
+ */
+ public function init()
+ {
+ }
+
+ /**
+ * Return the connected state of the rowset.
+ *
+ * @return boolean
+ */
+ public function isConnected()
+ {
+ return $this->_connected;
+ }
+
+ /**
+ * Returns the table object, or null if this is disconnected rowset
+ *
+ * @return Zend_Db_Table_Abstract
+ */
+ public function getTable()
+ {
+ return $this->_table;
+ }
+
+ /**
+ * Set the table object, to re-establish a live connection
+ * to the database for a Rowset that has been de-serialized.
+ *
+ * @param Zend_Db_Table_Abstract $table
+ * @return boolean
+ * @throws Zend_Db_Table_Row_Exception
+ */
+ public function setTable(Zend_Db_Table_Abstract $table)
+ {
+ $this->_table = $table;
+ $this->_connected = false;
+ // @todo This works only if we have iterated through
+ // the result set once to instantiate the rows.
+ foreach ($this as $row) {
+ $connected = $row->setTable($table);
+ if ($connected == true) {
+ $this->_connected = true;
+ }
+ }
+ $this->rewind();
+ return $this->_connected;
+ }
+
+ /**
+ * Query the class name of the Table object for which this
+ * Rowset was created.
+ *
+ * @return string
+ */
+ public function getTableClass()
+ {
+ return $this->_tableClass;
+ }
+
+ /**
+ * Rewind the Iterator to the first element.
+ * Similar to the reset() function for arrays in PHP.
+ * Required by interface Iterator.
+ *
+ * @return Zend_Db_Table_Rowset_Abstract Fluent interface.
+ */
+ public function rewind()
+ {
+ $this->_pointer = 0;
+ return $this;
+ }
+
+ /**
+ * Return the current element.
+ * Similar to the current() function for arrays in PHP
+ * Required by interface Iterator.
+ *
+ * @return Zend_Db_Table_Row_Abstract current element from the collection
+ */
+ public function current()
+ {
+ if ($this->valid() === false) {
+ return null;
+ }
+
+ // return the row object
+ return $this->_loadAndReturnRow($this->_pointer);
+ }
+
+ /**
+ * Return the identifying key of the current element.
+ * Similar to the key() function for arrays in PHP.
+ * Required by interface Iterator.
+ *
+ * @return int
+ */
+ public function key()
+ {
+ return $this->_pointer;
+ }
+
+ /**
+ * Move forward to next element.
+ * Similar to the next() function for arrays in PHP.
+ * Required by interface Iterator.
+ *
+ * @return void
+ */
+ public function next()
+ {
+ ++$this->_pointer;
+ }
+
+ /**
+ * Check if there is a current element after calls to rewind() or next().
+ * Used to check if we've iterated to the end of the collection.
+ * Required by interface Iterator.
+ *
+ * @return bool False if there's nothing more to iterate over
+ */
+ public function valid()
+ {
+ return $this->_pointer >= 0 && $this->_pointer < $this->_count;
+ }
+
+ /**
+ * Returns the number of elements in the collection.
+ *
+ * Implements Countable::count()
+ *
+ * @return int
+ */
+ public function count()
+ {
+ return $this->_count;
+ }
+
+ /**
+ * Take the Iterator to position $position
+ * Required by interface SeekableIterator.
+ *
+ * @param int $position the position to seek to
+ * @return Zend_Db_Table_Rowset_Abstract
+ * @throws Zend_Db_Table_Rowset_Exception
+ */
+ public function seek($position)
+ {
+ $position = (int) $position;
+ if ($position < 0 || $position >= $this->_count) {
+ throw new Zend_Db_Table_Rowset_Exception("Illegal index $position");
+ }
+ $this->_pointer = $position;
+ return $this;
+ }
+
+ /**
+ * Check if an offset exists
+ * Required by the ArrayAccess implementation
+ *
+ * @param string $offset
+ * @return boolean
+ */
+ public function offsetExists($offset)
+ {
+ return isset($this->_data[(int) $offset]);
+ }
+
+ /**
+ * Get the row for the given offset
+ * Required by the ArrayAccess implementation
+ *
+ * @param string $offset
+ * @return Zend_Db_Table_Row_Abstract
+ */
+ public function offsetGet($offset)
+ {
+ $offset = (int) $offset;
+ if ($offset < 0 || $offset >= $this->_count) {
+ throw new Zend_Db_Table_Rowset_Exception("Illegal index $offset");
+ }
+ $this->_pointer = $offset;
+
+ return $this->current();
+ }
+
+ /**
+ * Does nothing
+ * Required by the ArrayAccess implementation
+ *
+ * @param string $offset
+ * @param mixed $value
+ */
+ public function offsetSet($offset, $value)
+ {
+ }
+
+ /**
+ * Does nothing
+ * Required by the ArrayAccess implementation
+ *
+ * @param string $offset
+ */
+ public function offsetUnset($offset)
+ {
+ }
+
+ /**
+ * Returns a Zend_Db_Table_Row from a known position into the Iterator
+ *
+ * @param int $position the position of the row expected
+ * @param bool $seek wether or not seek the iterator to that position after
+ * @return Zend_Db_Table_Row
+ * @throws Zend_Db_Table_Rowset_Exception
+ */
+ public function getRow($position, $seek = false)
+ {
+ try {
+ $row = $this->_loadAndReturnRow($position);
+ } catch (Zend_Db_Table_Rowset_Exception $e) {
+ throw new Zend_Db_Table_Rowset_Exception('No row could be found at position ' . (int) $position, 0, $e);
+ }
+
+ if ($seek == true) {
+ $this->seek($position);
+ }
+
+ return $row;
+ }
+
+ /**
+ * Returns all data as an array.
+ *
+ * Updates the $_data property with current row object values.
+ *
+ * @return array
+ */
+ public function toArray()
+ {
+ // @todo This works only if we have iterated through
+ // the result set once to instantiate the rows.
+ foreach ($this->_rows as $i => $row) {
+ $this->_data[$i] = $row->toArray();
+ }
+ return $this->_data;
+ }
+
+ protected function _loadAndReturnRow($position)
+ {
+ if (!isset($this->_data[$position])) {
+ throw new Zend_Db_Table_Rowset_Exception("Data for provided position does not exist");
+ }
+
+ // do we already have a row object for this position?
+ if (empty($this->_rows[$position])) {
+ $this->_rows[$position] = new $this->_rowClass(
+ array(
+ 'table' => $this->_table,
+ 'data' => $this->_data[$position],
+ 'stored' => $this->_stored,
+ 'readOnly' => $this->_readOnly
+ )
+ );
+
+ if ( $this->_table instanceof Zend_Db_Table_Abstract ) {
+ $info = $this->_table->info();
+
+ if ( $this->_rows[$position] instanceof Zend_Db_Table_Row_Abstract ) {
+ if ($info['cols'] == array_keys($this->_data[$position])) {
+ $this->_rows[$position]->setTable($this->getTable());
+ }
+ }
+ } else {
+ $this->_rows[$position]->setTable(null);
+ }
+ }
+
+ // return the row object
+ return $this->_rows[$position];
+ }
+
+}
diff --git a/library/vendor/Zend/Db/Table/Rowset/Exception.php b/library/vendor/Zend/Db/Table/Rowset/Exception.php
new file mode 100644
index 0000000..9879113
--- /dev/null
+++ b/library/vendor/Zend/Db/Table/Rowset/Exception.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Db_Table_Exception
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Table_Rowset_Exception extends Zend_Db_Table_Exception
+{
+}
diff --git a/library/vendor/Zend/Db/Table/Select.php b/library/vendor/Zend/Db/Table/Select.php
new file mode 100644
index 0000000..fade302
--- /dev/null
+++ b/library/vendor/Zend/Db/Table/Select.php
@@ -0,0 +1,221 @@
+<?php
+
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Select
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Db_Select
+ */
+
+
+/**
+ * @see Zend_Db_Table_Abstract
+ */
+
+
+/**
+ * Class for SQL SELECT query manipulation for the Zend_Db_Table component.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Db_Table_Select extends Zend_Db_Select
+{
+ /**
+ * Table schema for parent Zend_Db_Table.
+ *
+ * @var array
+ */
+ protected $_info;
+
+ /**
+ * Table integrity override.
+ *
+ * @var array
+ */
+ protected $_integrityCheck = true;
+
+ /**
+ * Table instance that created this select object
+ *
+ * @var Zend_Db_Table_Abstract
+ */
+ protected $_table;
+
+ /**
+ * Class constructor
+ *
+ * @param Zend_Db_Table_Abstract $adapter
+ */
+ public function __construct(Zend_Db_Table_Abstract $table)
+ {
+ parent::__construct($table->getAdapter());
+
+ $this->setTable($table);
+ }
+
+ /**
+ * Return the table that created this select object
+ *
+ * @return Zend_Db_Table_Abstract
+ */
+ public function getTable()
+ {
+ return $this->_table;
+ }
+
+ /**
+ * Sets the primary table name and retrieves the table schema.
+ *
+ * @param Zend_Db_Table_Abstract $adapter
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function setTable(Zend_Db_Table_Abstract $table)
+ {
+ $this->_adapter = $table->getAdapter();
+ $this->_info = $table->info();
+ $this->_table = $table;
+
+ return $this;
+ }
+
+ /**
+ * Sets the integrity check flag.
+ *
+ * Setting this flag to false skips the checks for table joins, allowing
+ * 'hybrid' table rows to be created.
+ *
+ * @param Zend_Db_Table_Abstract $adapter
+ * @return Zend_Db_Select This Zend_Db_Select object.
+ */
+ public function setIntegrityCheck($flag = true)
+ {
+ $this->_integrityCheck = $flag;
+ return $this;
+ }
+
+ /**
+ * Tests query to determine if expressions or aliases columns exist.
+ *
+ * @return boolean
+ */
+ public function isReadOnly()
+ {
+ $readOnly = false;
+ $fields = $this->getPart(Zend_Db_Table_Select::COLUMNS);
+ $cols = $this->_info[Zend_Db_Table_Abstract::COLS];
+
+ if (!count($fields)) {
+ return $readOnly;
+ }
+
+ foreach ($fields as $columnEntry) {
+ $column = $columnEntry[1];
+ $alias = $columnEntry[2];
+
+ if ($alias !== null) {
+ $column = $alias;
+ }
+
+ switch (true) {
+ case ($column == self::SQL_WILDCARD):
+ break;
+
+ case ($column instanceof Zend_Db_Expr):
+ case (!in_array($column, $cols)):
+ $readOnly = true;
+ break 2;
+ }
+ }
+
+ return $readOnly;
+ }
+
+ /**
+ * Adds a FROM table and optional columns to the query.
+ *
+ * The table name can be expressed
+ *
+ * @param array|string|Zend_Db_Expr|Zend_Db_Table_Abstract $name The table name or an
+ associative array relating
+ table name to correlation
+ name.
+ * @param array|string|Zend_Db_Expr $cols The columns to select from this table.
+ * @param string $schema The schema name to specify, if any.
+ * @return Zend_Db_Table_Select This Zend_Db_Table_Select object.
+ */
+ public function from($name, $cols = self::SQL_WILDCARD, $schema = null)
+ {
+ if ($name instanceof Zend_Db_Table_Abstract) {
+ $info = $name->info();
+ $name = $info[Zend_Db_Table_Abstract::NAME];
+ if (isset($info[Zend_Db_Table_Abstract::SCHEMA])) {
+ $schema = $info[Zend_Db_Table_Abstract::SCHEMA];
+ }
+ }
+
+ return $this->joinInner($name, null, $cols, $schema);
+ }
+
+ /**
+ * Performs a validation on the select query before passing back to the parent class.
+ * Ensures that only columns from the primary Zend_Db_Table are returned in the result.
+ *
+ * @return string|null This object as a SELECT string (or null if a string cannot be produced)
+ */
+ public function assemble()
+ {
+ $fields = $this->getPart(Zend_Db_Table_Select::COLUMNS);
+ $primary = $this->_info[Zend_Db_Table_Abstract::NAME];
+ $schema = $this->_info[Zend_Db_Table_Abstract::SCHEMA];
+
+
+ if (count($this->_parts[self::UNION]) == 0) {
+
+ // If no fields are specified we assume all fields from primary table
+ if (!count($fields)) {
+ $this->from($primary, self::SQL_WILDCARD, $schema);
+ $fields = $this->getPart(Zend_Db_Table_Select::COLUMNS);
+ }
+
+ $from = $this->getPart(Zend_Db_Table_Select::FROM);
+
+ if ($this->_integrityCheck !== false) {
+ foreach ($fields as $columnEntry) {
+ list($table, $column) = $columnEntry;
+
+ // Check each column to ensure it only references the primary table
+ if ($column) {
+ if (!isset($from[$table]) || $from[$table]['tableName'] != $primary) {
+ throw new Zend_Db_Table_Select_Exception('Select query cannot join with another table');
+ }
+ }
+ }
+ }
+ }
+
+ return parent::assemble();
+ }
+}
diff --git a/library/vendor/Zend/Db/Table/Select/Exception.php b/library/vendor/Zend/Db/Table/Select/Exception.php
new file mode 100644
index 0000000..7ed15be
--- /dev/null
+++ b/library/vendor/Zend/Db/Table/Select/Exception.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Select
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Db_Exception
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Db
+ * @subpackage Table
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+class Zend_Db_Table_Select_Exception extends Zend_Db_Select_Exception
+{
+}
+
diff --git a/library/vendor/Zend/Exception.php b/library/vendor/Zend/Exception.php
new file mode 100644
index 0000000..d97acb0
--- /dev/null
+++ b/library/vendor/Zend/Exception.php
@@ -0,0 +1,96 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+* @category Zend
+* @package Zend
+* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+* @license http://framework.zend.com/license/new-bsd New BSD License
+*/
+class Zend_Exception extends Exception
+{
+ /**
+ * @var null|Exception
+ */
+ private $_previous = null;
+
+ /**
+ * Construct the exception
+ *
+ * @param string $msg
+ * @param int $code
+ * @param Exception $previous
+ * @return void
+ */
+ public function __construct($msg = '', $code = 0, Exception $previous = null)
+ {
+ if (version_compare(PHP_VERSION, '5.3.0', '<')) {
+ parent::__construct($msg, (int) $code);
+ $this->_previous = $previous;
+ } else {
+ parent::__construct($msg, (int) $code, $previous);
+ }
+ }
+
+ /**
+ * Overloading
+ *
+ * For PHP < 5.3.0, provides access to the getPrevious() method.
+ *
+ * @param string $method
+ * @param array $args
+ * @return mixed
+ */
+ public function __call($method, array $args)
+ {
+ if ('getprevious' == strtolower($method)) {
+ return $this->_getPrevious();
+ }
+ return null;
+ }
+
+ /**
+ * String representation of the exception
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ if (version_compare(PHP_VERSION, '5.3.0', '<')) {
+ if (null !== ($e = $this->getPrevious())) {
+ return $e->__toString()
+ . "\n\nNext "
+ . parent::__toString();
+ }
+ }
+ return parent::__toString();
+ }
+
+ /**
+ * Returns previous Exception
+ *
+ * @return Exception|null
+ */
+ protected function _getPrevious()
+ {
+ return $this->_previous;
+ }
+}
diff --git a/library/vendor/Zend/File/ClassFileLocator.php b/library/vendor/Zend/File/ClassFileLocator.php
new file mode 100644
index 0000000..24e0541
--- /dev/null
+++ b/library/vendor/Zend/File/ClassFileLocator.php
@@ -0,0 +1,177 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_File
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+
+/**
+ * Locate files containing PHP classes, interfaces, or abstracts
+ *
+ * @package Zend_File
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license New BSD {@link http://framework.zend.com/license/new-bsd}
+ */
+class Zend_File_ClassFileLocator extends FilterIterator
+{
+ /**
+ * Create an instance of the locator iterator
+ *
+ * Expects either a directory, or a DirectoryIterator (or its recursive variant)
+ * instance.
+ *
+ * @param string|DirectoryIterator $dirOrIterator
+ */
+ public function __construct($dirOrIterator = '.')
+ {
+ if (is_string($dirOrIterator)) {
+ if (!is_dir($dirOrIterator)) {
+ throw new InvalidArgumentException('Expected a valid directory name');
+ }
+
+ $dirOrIterator = new RecursiveDirectoryIterator($dirOrIterator);
+ }
+ if (!$dirOrIterator instanceof DirectoryIterator) {
+ throw new InvalidArgumentException('Expected a DirectoryIterator');
+ }
+
+ if ($dirOrIterator instanceof RecursiveIterator) {
+ $iterator = new RecursiveIteratorIterator($dirOrIterator);
+ } else {
+ $iterator = $dirOrIterator;
+ }
+
+ parent::__construct($iterator);
+ $this->setInfoClass('Zend_File_PhpClassFile');
+
+ // Forward-compat with PHP 5.3
+ if (version_compare(PHP_VERSION, '5.3.0', '<')) {
+ if (!defined('T_NAMESPACE')) {
+ define('T_NAMESPACE', 'namespace');
+ }
+ if (!defined('T_NS_SEPARATOR')) {
+ define('T_NS_SEPARATOR', '\\');
+ }
+ }
+ }
+
+ /**
+ * Filter for files containing PHP classes, interfaces, or abstracts
+ *
+ * @return bool
+ */
+ public function accept()
+ {
+ $file = $this->getInnerIterator()->current();
+ // If we somehow have something other than an SplFileInfo object, just
+ // return false
+ if (!$file instanceof SplFileInfo) {
+ return false;
+ }
+
+ // If we have a directory, it's not a file, so return false
+ if (!$file->isFile()) {
+ return false;
+ }
+
+ // If not a PHP file, skip
+ if ($file->getBasename('.php') == $file->getBasename()) {
+ return false;
+ }
+
+ $contents = file_get_contents($file->getRealPath());
+ $tokens = token_get_all($contents);
+ $count = count($tokens);
+ $t_trait = defined('T_TRAIT') ? T_TRAIT : -1; // For preserve PHP 5.3 compatibility
+ for ($i = 0; $i < $count; $i++) {
+ $token = $tokens[$i];
+ if (!is_array($token)) {
+ // single character token found; skip
+ $i++;
+ continue;
+ }
+ switch ($token[0]) {
+ case T_NAMESPACE:
+ // Namespace found; grab it for later
+ $namespace = '';
+ for ($i++; $i < $count; $i++) {
+ $token = $tokens[$i];
+ if (is_string($token)) {
+ if (';' === $token) {
+ $saveNamespace = false;
+ break;
+ }
+ if ('{' === $token) {
+ $saveNamespace = true;
+ break;
+ }
+ continue;
+ }
+ list($type, $content, $line) = $token;
+ switch ($type) {
+ case T_STRING:
+ case T_NS_SEPARATOR:
+ $namespace .= $content;
+ break;
+ }
+ }
+ if ($saveNamespace) {
+ $savedNamespace = $namespace;
+ }
+ break;
+ case $t_trait:
+ case T_CLASS:
+ case T_INTERFACE:
+ // Abstract class, class, interface or trait found
+
+ // Get the classname
+ for ($i++; $i < $count; $i++) {
+ $token = $tokens[$i];
+ if (is_string($token)) {
+ continue;
+ }
+ list($type, $content, $line) = $token;
+ if (T_STRING == $type) {
+ // If a classname was found, set it in the object, and
+ // return boolean true (found)
+ if (!isset($namespace) || null === $namespace) {
+ if (isset($saveNamespace) && $saveNamespace) {
+ $namespace = $savedNamespace;
+ } else {
+ $namespace = null;
+ }
+
+ }
+ $class = (null === $namespace) ? $content : $namespace . '\\' . $content;
+ $file->addClass($class);
+ $namespace = null;
+ break;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ $classes = $file->getClasses();
+ if (!empty($classes)) {
+ return true;
+ }
+ // No class-type tokens found; return false
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/File/PhpClassFile.php b/library/vendor/Zend/File/PhpClassFile.php
new file mode 100644
index 0000000..0edf340
--- /dev/null
+++ b/library/vendor/Zend/File/PhpClassFile.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_File
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * Locate files containing PHP classes, interfaces, abstracts or traits
+ *
+ * @package Zend_File
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license New BSD {@link http://framework.zend.com/license/new-bsd}
+ */
+class Zend_File_PhpClassFile extends SplFileInfo
+{
+ /**
+ * @var array
+ */
+ protected $classes;
+
+ /**
+ * Get classes
+ *
+ * @return array
+ */
+ public function getClasses()
+ {
+ return $this->classes;
+ }
+
+ /**
+ * Add class
+ *
+ * @param string $class
+ * @return Zend_File_PhpClassFile
+ */
+ public function addClass($class)
+ {
+ $this->classes[] = $class;
+ return $this;
+ }
+}
diff --git a/library/vendor/Zend/File/Transfer.php b/library/vendor/Zend/File/Transfer.php
new file mode 100644
index 0000000..4ff0763
--- /dev/null
+++ b/library/vendor/Zend/File/Transfer.php
@@ -0,0 +1,122 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_File_Transfer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Loader
+ */
+
+/**
+ * Base class for all protocols supporting file transfers
+ *
+ * @category Zend
+ * @package Zend_File_Transfer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_File_Transfer
+{
+ /**
+ * Array holding all directions
+ *
+ * @var array
+ */
+ protected $_adapter = array();
+
+ /**
+ * Creates a file processing handler
+ *
+ * @param string $adapter Adapter to use
+ * @param boolean $direction OPTIONAL False means Download, true means upload
+ * @param array $options OPTIONAL Options to set for this adapter
+ * @throws Zend_File_Transfer_Exception
+ */
+ public function __construct($adapter = 'Http', $direction = false, $options = array())
+ {
+ $this->setAdapter($adapter, $direction, $options);
+ }
+
+ /**
+ * Sets a new adapter
+ *
+ * @param string $adapter Adapter to use
+ * @param boolean $direction OPTIONAL False means Download, true means upload
+ * @param array $options OPTIONAL Options to set for this adapter
+ * @throws Zend_File_Transfer_Exception
+ */
+ public function setAdapter($adapter, $direction = false, $options = array())
+ {
+ if (Zend_Loader::isReadable('Zend/File/Transfer/Adapter/' . ucfirst($adapter). '.php')) {
+ $adapter = 'Zend_File_Transfer_Adapter_' . ucfirst($adapter);
+ }
+
+ if (!class_exists($adapter)) {
+ Zend_Loader::loadClass($adapter);
+ }
+
+ $direction = (integer) $direction;
+ $this->_adapter[$direction] = new $adapter($options);
+ if (!$this->_adapter[$direction] instanceof Zend_File_Transfer_Adapter_Abstract) {
+ throw new Zend_File_Transfer_Exception("Adapter " . $adapter . " does not extend Zend_File_Transfer_Adapter_Abstract");
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns all set adapters
+ *
+ * @param boolean $direction On null, all directions are returned
+ * On false, download direction is returned
+ * On true, upload direction is returned
+ * @return array|Zend_File_Transfer_Adapter
+ */
+ public function getAdapter($direction = null)
+ {
+ if ($direction === null) {
+ return $this->_adapter;
+ }
+
+ $direction = (integer) $direction;
+ return $this->_adapter[$direction];
+ }
+
+ /**
+ * Calls all methods from the adapter
+ *
+ * @param string $method Method to call
+ * @param array $options Options for this method
+ * @return mixed
+ */
+ public function __call($method, array $options)
+ {
+ if (array_key_exists('direction', $options)) {
+ $direction = (integer) $options['direction'];
+ } else {
+ $direction = 0;
+ }
+
+ if (method_exists($this->_adapter[$direction], $method)) {
+ return call_user_func_array(array($this->_adapter[$direction], $method), $options);
+ }
+
+ throw new Zend_File_Transfer_Exception("Unknown method '" . $method . "' called!");
+ }
+}
diff --git a/library/vendor/Zend/File/Transfer/Adapter/Abstract.php b/library/vendor/Zend/File/Transfer/Adapter/Abstract.php
new file mode 100644
index 0000000..0a6b76c
--- /dev/null
+++ b/library/vendor/Zend/File/Transfer/Adapter/Abstract.php
@@ -0,0 +1,1548 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_File_Transfer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Abstract class for file transfers (Downloads and Uploads)
+ *
+ * @category Zend
+ * @package Zend_File_Transfer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_File_Transfer_Adapter_Abstract
+{
+ /**@+
+ * Plugin loader Constants
+ */
+ const FILTER = 'FILTER';
+ const VALIDATE = 'VALIDATE';
+ /**@-*/
+
+ /**
+ * Internal list of breaks
+ *
+ * @var array
+ */
+ protected $_break = array();
+
+ /**
+ * Internal list of filters
+ *
+ * @var array
+ */
+ protected $_filters = array();
+
+ /**
+ * Plugin loaders for filter and validation chains
+ *
+ * @var array
+ */
+ protected $_loaders = array();
+
+ /**
+ * Internal list of messages
+ *
+ * @var array
+ */
+ protected $_messages = array();
+
+ /**
+ * @var Zend_Translate
+ */
+ protected $_translator;
+
+ /**
+ * Is translation disabled?
+ *
+ * @var bool
+ */
+ protected $_translatorDisabled = false;
+
+ /**
+ * Internal list of validators
+ * @var array
+ */
+ protected $_validators = array();
+
+ /**
+ * Internal list of files
+ * This array looks like this:
+ * array(form => array( - Form is the name within the form or, if not set the filename
+ * name, - Original name of this file
+ * type, - Mime type of this file
+ * size, - Filesize in bytes
+ * tmp_name, - Internalally temporary filename for uploaded files
+ * error, - Error which has occured
+ * destination, - New destination for this file
+ * validators, - Set validator names for this file
+ * files - Set file names for this file
+ * ))
+ *
+ * @var array
+ */
+ protected $_files = array();
+
+ /**
+ * TMP directory
+ * @var string
+ */
+ protected $_tmpDir;
+
+ /**
+ * Available options for file transfers
+ */
+ protected $_options = array(
+ 'ignoreNoFile' => false,
+ 'useByteString' => true,
+ 'magicFile' => null,
+ 'detectInfos' => true,
+ );
+
+ /**
+ * Send file
+ *
+ * @param mixed $options
+ * @return bool
+ */
+ abstract public function send($options = null);
+
+ /**
+ * Receive file
+ *
+ * @param mixed $options
+ * @return bool
+ */
+ abstract public function receive($options = null);
+
+ /**
+ * Is file sent?
+ *
+ * @param array|string|null $files
+ * @return bool
+ */
+ abstract public function isSent($files = null);
+
+ /**
+ * Is file received?
+ *
+ * @param array|string|null $files
+ * @return bool
+ */
+ abstract public function isReceived($files = null);
+
+ /**
+ * Has a file been uploaded ?
+ *
+ * @param array|string|null $files
+ * @return bool
+ */
+ abstract public function isUploaded($files = null);
+
+ /**
+ * Has the file been filtered ?
+ *
+ * @param array|string|null $files
+ * @return bool
+ */
+ abstract public function isFiltered($files = null);
+
+ /**
+ * Retrieve progress of transfer
+ *
+ * @return float
+ */
+ public static function getProgress()
+ {
+ throw new Zend_File_Transfer_Exception('Method must be implemented within the adapter');
+ }
+
+ /**
+ * Set plugin loader to use for validator or filter chain
+ *
+ * @param Zend_Loader_PluginLoader_Interface $loader
+ * @param string $type 'filter', or 'validate'
+ * @return Zend_File_Transfer_Adapter_Abstract
+ * @throws Zend_File_Transfer_Exception on invalid type
+ */
+ public function setPluginLoader(Zend_Loader_PluginLoader_Interface $loader, $type)
+ {
+ $type = strtoupper($type);
+ switch ($type) {
+ case self::FILTER:
+ case self::VALIDATE:
+ $this->_loaders[$type] = $loader;
+ return $this;
+ default:
+ throw new Zend_File_Transfer_Exception(sprintf('Invalid type "%s" provided to setPluginLoader()', $type));
+ }
+ }
+
+ /**
+ * Retrieve plugin loader for validator or filter chain
+ *
+ * Instantiates with default rules if none available for that type. Use
+ * 'filter' or 'validate' for $type.
+ *
+ * @param string $type
+ * @return Zend_Loader_PluginLoader
+ * @throws Zend_File_Transfer_Exception on invalid type.
+ */
+ public function getPluginLoader($type)
+ {
+ $type = strtoupper($type);
+ switch ($type) {
+ case self::FILTER:
+ case self::VALIDATE:
+ $prefixSegment = ucfirst(strtolower($type));
+ $pathSegment = $prefixSegment;
+ if (!isset($this->_loaders[$type])) {
+ $paths = array(
+ 'Zend_' . $prefixSegment . '_' => 'Zend/' . $pathSegment . '/',
+ 'Zend_' . $prefixSegment . '_File' => 'Zend/' . $pathSegment . '/File',
+ );
+
+ $this->_loaders[$type] = new Zend_Loader_PluginLoader($paths);
+ } else {
+ $loader = $this->_loaders[$type];
+ $prefix = 'Zend_' . $prefixSegment . '_File_';
+ if (!$loader->getPaths($prefix)) {
+ $loader->addPrefixPath($prefix, str_replace('_', '/', $prefix));
+ }
+ }
+ return $this->_loaders[$type];
+ default:
+ throw new Zend_File_Transfer_Exception(sprintf('Invalid type "%s" provided to getPluginLoader()', $type));
+ }
+ }
+
+ /**
+ * Add prefix path for plugin loader
+ *
+ * If no $type specified, assumes it is a base path for both filters and
+ * validators, and sets each according to the following rules:
+ * - filters: $prefix = $prefix . '_Filter'
+ * - validators: $prefix = $prefix . '_Validate'
+ *
+ * Otherwise, the path prefix is set on the appropriate plugin loader.
+ *
+ * @param string $prefix
+ * @param string $path
+ * @param string $type
+ * @return Zend_File_Transfer_Adapter_Abstract
+ * @throws Zend_File_Transfer_Exception for invalid type
+ */
+ public function addPrefixPath($prefix, $path, $type = null)
+ {
+ $type = strtoupper($type);
+ switch ($type) {
+ case self::FILTER:
+ case self::VALIDATE:
+ $loader = $this->getPluginLoader($type);
+ $loader->addPrefixPath($prefix, $path);
+ return $this;
+ case null:
+ $prefix = rtrim($prefix, '_');
+ $path = rtrim($path, DIRECTORY_SEPARATOR);
+ foreach (array(self::FILTER, self::VALIDATE) as $type) {
+ $cType = ucfirst(strtolower($type));
+ $pluginPath = $path . DIRECTORY_SEPARATOR . $cType . DIRECTORY_SEPARATOR;
+ $pluginPrefix = $prefix . '_' . $cType;
+ $loader = $this->getPluginLoader($type);
+ $loader->addPrefixPath($pluginPrefix, $pluginPath);
+ }
+ return $this;
+ default:
+ throw new Zend_File_Transfer_Exception(sprintf('Invalid type "%s" provided to getPluginLoader()', $type));
+ }
+ }
+
+ /**
+ * Add many prefix paths at once
+ *
+ * @param array $spec
+ * @return Zend_File_Transfer_Exception
+ */
+ public function addPrefixPaths(array $spec)
+ {
+ if (isset($spec['prefix']) && isset($spec['path'])) {
+ return $this->addPrefixPath($spec['prefix'], $spec['path']);
+ }
+ foreach ($spec as $type => $paths) {
+ if (is_numeric($type) && is_array($paths)) {
+ $type = null;
+ if (isset($paths['prefix']) && isset($paths['path'])) {
+ if (isset($paths['type'])) {
+ $type = $paths['type'];
+ }
+ $this->addPrefixPath($paths['prefix'], $paths['path'], $type);
+ }
+ } elseif (!is_numeric($type)) {
+ if (!isset($paths['prefix']) || !isset($paths['path'])) {
+ foreach ($paths as $prefix => $spec) {
+ if (is_array($spec)) {
+ foreach ($spec as $path) {
+ if (!is_string($path)) {
+ continue;
+ }
+ $this->addPrefixPath($prefix, $path, $type);
+ }
+ } elseif (is_string($spec)) {
+ $this->addPrefixPath($prefix, $spec, $type);
+ }
+ }
+ } else {
+ $this->addPrefixPath($paths['prefix'], $paths['path'], $type);
+ }
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Adds a new validator for this class
+ *
+ * @param string|array $validator Type of validator to add
+ * @param boolean $breakChainOnFailure If the validation chain should stop an failure
+ * @param string|array $options Options to set for the validator
+ * @param string|array $files Files to limit this validator to
+ * @return Zend_File_Transfer_Adapter
+ */
+ public function addValidator($validator, $breakChainOnFailure = false, $options = null, $files = null)
+ {
+ if ($validator instanceof Zend_Validate_Interface) {
+ $name = get_class($validator);
+ } elseif (is_string($validator)) {
+ $name = $this->getPluginLoader(self::VALIDATE)->load($validator);
+ $validator = new $name($options);
+ if (is_array($options) && isset($options['messages'])) {
+ if (is_array($options['messages'])) {
+ $validator->setMessages($options['messages']);
+ } elseif (is_string($options['messages'])) {
+ $validator->setMessage($options['messages']);
+ }
+
+ unset($options['messages']);
+ }
+ } else {
+ throw new Zend_File_Transfer_Exception('Invalid validator provided to addValidator; must be string or Zend_Validate_Interface');
+ }
+
+ $this->_validators[$name] = $validator;
+ $this->_break[$name] = $breakChainOnFailure;
+ $files = $this->_getFiles($files, true, true);
+ foreach ($files as $file) {
+ if ($name == 'NotEmpty') {
+ $temp = $this->_files[$file]['validators'];
+ $this->_files[$file]['validators'] = array($name);
+ $this->_files[$file]['validators'] += $temp;
+ } else {
+ $this->_files[$file]['validators'][] = $name;
+ }
+
+ $this->_files[$file]['validated'] = false;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Add Multiple validators at once
+ *
+ * @param array $validators
+ * @param string|array $files
+ * @return Zend_File_Transfer_Adapter_Abstract
+ */
+ public function addValidators(array $validators, $files = null)
+ {
+ foreach ($validators as $name => $validatorInfo) {
+ if ($validatorInfo instanceof Zend_Validate_Interface) {
+ $this->addValidator($validatorInfo, null, null, $files);
+ } else if (is_string($validatorInfo)) {
+ if (!is_int($name)) {
+ $this->addValidator($name, null, $validatorInfo, $files);
+ } else {
+ $this->addValidator($validatorInfo, null, null, $files);
+ }
+ } else if (is_array($validatorInfo)) {
+ $argc = count($validatorInfo);
+ $breakChainOnFailure = false;
+ $options = array();
+ if (isset($validatorInfo['validator'])) {
+ $validator = $validatorInfo['validator'];
+ if (isset($validatorInfo['breakChainOnFailure'])) {
+ $breakChainOnFailure = $validatorInfo['breakChainOnFailure'];
+ }
+
+ if (isset($validatorInfo['options'])) {
+ $options = $validatorInfo['options'];
+ }
+
+ $this->addValidator($validator, $breakChainOnFailure, $options, $files);
+ } else {
+ if (is_string($name)) {
+ $validator = $name;
+ $options = $validatorInfo;
+ $this->addValidator($validator, $breakChainOnFailure, $options, $files);
+ } else {
+ $file = $files;
+ switch (true) {
+ case (0 == $argc):
+ break;
+ case (1 <= $argc):
+ $validator = array_shift($validatorInfo);
+ case (2 <= $argc):
+ $breakChainOnFailure = array_shift($validatorInfo);
+ case (3 <= $argc):
+ $options = array_shift($validatorInfo);
+ case (4 <= $argc):
+ if (!empty($validatorInfo)) {
+ $file = array_shift($validatorInfo);
+ }
+ default:
+ $this->addValidator($validator, $breakChainOnFailure, $options, $file);
+ break;
+ }
+ }
+ }
+ } else {
+ throw new Zend_File_Transfer_Exception('Invalid validator passed to addValidators()');
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Sets a validator for the class, erasing all previous set
+ *
+ * @param string|array $validator Validator to set
+ * @param string|array $files Files to limit this validator to
+ * @return Zend_File_Transfer_Adapter
+ */
+ public function setValidators(array $validators, $files = null)
+ {
+ $this->clearValidators();
+ return $this->addValidators($validators, $files);
+ }
+
+ /**
+ * Determine if a given validator has already been registered
+ *
+ * @param string $name
+ * @return bool
+ */
+ public function hasValidator($name)
+ {
+ return (false !== $this->_getValidatorIdentifier($name));
+ }
+
+ /**
+ * Retrieve individual validator
+ *
+ * @param string $name
+ * @return Zend_Validate_Interface|null
+ */
+ public function getValidator($name)
+ {
+ if (false === ($identifier = $this->_getValidatorIdentifier($name))) {
+ return null;
+ }
+ return $this->_validators[$identifier];
+ }
+
+ /**
+ * Returns all set validators
+ *
+ * @param string|array $files (Optional) Returns the validator for this files
+ * @return null|array List of set validators
+ */
+ public function getValidators($files = null)
+ {
+ if ($files == null) {
+ return $this->_validators;
+ }
+
+ $files = $this->_getFiles($files, true, true);
+ $validators = array();
+ foreach ($files as $file) {
+ if (!empty($this->_files[$file]['validators'])) {
+ $validators += $this->_files[$file]['validators'];
+ }
+ }
+
+ $validators = array_unique($validators);
+ $result = array();
+ foreach ($validators as $validator) {
+ $result[$validator] = $this->_validators[$validator];
+ }
+
+ return $result;
+ }
+
+ /**
+ * Remove an individual validator
+ *
+ * @param string $name
+ * @return Zend_File_Transfer_Adapter_Abstract
+ */
+ public function removeValidator($name)
+ {
+ if (false === ($key = $this->_getValidatorIdentifier($name))) {
+ return $this;
+ }
+
+ unset($this->_validators[$key]);
+ foreach (array_keys($this->_files) as $file) {
+ if (empty($this->_files[$file]['validators'])) {
+ continue;
+ }
+
+ $index = array_search($key, $this->_files[$file]['validators']);
+ if ($index === false) {
+ continue;
+ }
+
+ unset($this->_files[$file]['validators'][$index]);
+ $this->_files[$file]['validated'] = false;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Remove all validators
+ *
+ * @return Zend_File_Transfer_Adapter_Abstract
+ */
+ public function clearValidators()
+ {
+ $this->_validators = array();
+ foreach (array_keys($this->_files) as $file) {
+ $this->_files[$file]['validators'] = array();
+ $this->_files[$file]['validated'] = false;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Sets Options for adapters
+ *
+ * @param array $options Options to set
+ * @param array $files (Optional) Files to set the options for
+ * @return Zend_File_Transfer_Adapter_Abstract
+ */
+ public function setOptions($options = array(), $files = null) {
+ $file = $this->_getFiles($files, false, true);
+
+ if (is_array($options)) {
+ if (empty($file)) {
+ $this->_options = array_merge($this->_options, $options);
+ }
+
+ foreach ($options as $name => $value) {
+ foreach ($file as $key => $content) {
+ switch ($name) {
+ case 'magicFile' :
+ $this->_files[$key]['options'][$name] = (string) $value;
+ break;
+
+ case 'ignoreNoFile' :
+ case 'useByteString' :
+ case 'detectInfos' :
+ $this->_files[$key]['options'][$name] = (boolean) $value;
+ break;
+
+ default:
+ throw new Zend_File_Transfer_Exception("Unknown option: $name = $value");
+ }
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns set options for adapters or files
+ *
+ * @param array $files (Optional) Files to return the options for
+ * @return array Options for given files
+ */
+ public function getOptions($files = null) {
+ $file = $this->_getFiles($files, false, true);
+
+ foreach ($file as $key => $content) {
+ if (isset($this->_files[$key]['options'])) {
+ $options[$key] = $this->_files[$key]['options'];
+ } else {
+ $options[$key] = array();
+ }
+ }
+
+ return $options;
+ }
+
+ /**
+ * Checks if the files are valid
+ *
+ * @param string|array $files (Optional) Files to check
+ * @return boolean True if all checks are valid
+ */
+ public function isValid($files = null)
+ {
+ $check = $this->_getFiles($files, false, true);
+ if (empty($check)) {
+ return false;
+ }
+
+ $translator = $this->getTranslator();
+ $this->_messages = array();
+ $break = false;
+ foreach($check as $key => $content) {
+ if (array_key_exists('validators', $content) &&
+ in_array('Zend_Validate_File_Count', $content['validators'])) {
+ $validator = $this->_validators['Zend_Validate_File_Count'];
+ $count = $content;
+ if (empty($content['tmp_name'])) {
+ continue;
+ }
+
+ if (array_key_exists('destination', $content)) {
+ $checkit = $content['destination'];
+ } else {
+ $checkit = dirname($content['tmp_name']);
+ }
+
+ $checkit .= DIRECTORY_SEPARATOR . $content['name'];
+ $validator->addFile($checkit);
+ }
+ }
+
+ if (isset($count)) {
+ if (!$validator->isValid($count['tmp_name'], $count)) {
+ $this->_messages += $validator->getMessages();
+ }
+ }
+
+ foreach ($check as $key => $content) {
+ $fileerrors = array();
+ if (array_key_exists('validators', $content) && $content['validated']) {
+ continue;
+ }
+
+ if (array_key_exists('validators', $content)) {
+ foreach ($content['validators'] as $class) {
+ $validator = $this->_validators[$class];
+ if (method_exists($validator, 'setTranslator')) {
+ $validator->setTranslator($translator);
+ }
+
+ if (($class === 'Zend_Validate_File_Upload') and (empty($content['tmp_name']))) {
+ $tocheck = $key;
+ } else {
+ $tocheck = $content['tmp_name'];
+ }
+
+ if (!$validator->isValid($tocheck, $content)) {
+ $fileerrors += $validator->getMessages();
+ }
+
+ if (!empty($content['options']['ignoreNoFile']) and (isset($fileerrors['fileUploadErrorNoFile']))) {
+ unset($fileerrors['fileUploadErrorNoFile']);
+ break;
+ }
+
+ if (($class === 'Zend_Validate_File_Upload') and (count($fileerrors) > 0)) {
+ break;
+ }
+
+ if (($this->_break[$class]) and (count($fileerrors) > 0)) {
+ $break = true;
+ break;
+ }
+ }
+ }
+
+ if (count($fileerrors) > 0) {
+ $this->_files[$key]['validated'] = false;
+ } else {
+ $this->_files[$key]['validated'] = true;
+ }
+
+ $this->_messages += $fileerrors;
+ if ($break) {
+ break;
+ }
+ }
+
+ if (count($this->_messages) > 0) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns found validation messages
+ *
+ * @return array
+ */
+ public function getMessages()
+ {
+ return $this->_messages;
+ }
+
+ /**
+ * Retrieve error codes
+ *
+ * @return array
+ */
+ public function getErrors()
+ {
+ return array_keys($this->_messages);
+ }
+
+ /**
+ * Are there errors registered?
+ *
+ * @return boolean
+ */
+ public function hasErrors()
+ {
+ return (!empty($this->_messages));
+ }
+
+ /**
+ * Adds a new filter for this class
+ *
+ * @param string|array $filter Type of filter to add
+ * @param string|array $options Options to set for the filter
+ * @param string|array $files Files to limit this filter to
+ * @return Zend_File_Transfer_Adapter
+ */
+ public function addFilter($filter, $options = null, $files = null)
+ {
+ if ($filter instanceof Zend_Filter_Interface) {
+ $class = get_class($filter);
+ } elseif (is_string($filter)) {
+ $class = $this->getPluginLoader(self::FILTER)->load($filter);
+ $filter = new $class($options);
+ } else {
+ throw new Zend_File_Transfer_Exception('Invalid filter specified');
+ }
+
+ $this->_filters[$class] = $filter;
+ $files = $this->_getFiles($files, true, true);
+ foreach ($files as $file) {
+ $this->_files[$file]['filters'][] = $class;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Add Multiple filters at once
+ *
+ * @param array $filters
+ * @param string|array $files
+ * @return Zend_File_Transfer_Adapter_Abstract
+ */
+ public function addFilters(array $filters, $files = null)
+ {
+ foreach ($filters as $key => $spec) {
+ if ($spec instanceof Zend_Filter_Interface) {
+ $this->addFilter($spec, null, $files);
+ continue;
+ }
+
+ if (is_string($key)) {
+ $this->addFilter($key, $spec, $files);
+ continue;
+ }
+
+ if (is_int($key)) {
+ if (is_string($spec)) {
+ $this->addFilter($spec, null, $files);
+ continue;
+ }
+
+ if (is_array($spec)) {
+ if (!array_key_exists('filter', $spec)) {
+ continue;
+ }
+
+ $filter = $spec['filter'];
+ unset($spec['filter']);
+ $this->addFilter($filter, $spec, $files);
+ continue;
+ }
+
+ continue;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Sets a filter for the class, erasing all previous set
+ *
+ * @param string|array $filter Filter to set
+ * @param string|array $files Files to limit this filter to
+ * @return Zend_File_Transfer_Adapter
+ */
+ public function setFilters(array $filters, $files = null)
+ {
+ $this->clearFilters();
+ return $this->addFilters($filters, $files);
+ }
+
+ /**
+ * Determine if a given filter has already been registered
+ *
+ * @param string $name
+ * @return bool
+ */
+ public function hasFilter($name)
+ {
+ return (false !== $this->_getFilterIdentifier($name));
+ }
+
+ /**
+ * Retrieve individual filter
+ *
+ * @param string $name
+ * @return Zend_Filter_Interface|null
+ */
+ public function getFilter($name)
+ {
+ if (false === ($identifier = $this->_getFilterIdentifier($name))) {
+ return null;
+ }
+ return $this->_filters[$identifier];
+ }
+
+ /**
+ * Returns all set filters
+ *
+ * @param string|array $files (Optional) Returns the filter for this files
+ * @return array List of set filters
+ * @throws Zend_File_Transfer_Exception When file not found
+ */
+ public function getFilters($files = null)
+ {
+ if ($files === null) {
+ return $this->_filters;
+ }
+
+ $files = $this->_getFiles($files, true, true);
+ $filters = array();
+ foreach ($files as $file) {
+ if (!empty($this->_files[$file]['filters'])) {
+ $filters += $this->_files[$file]['filters'];
+ }
+ }
+
+ $filters = array_unique($filters);
+ $result = array();
+ foreach ($filters as $filter) {
+ $result[] = $this->_filters[$filter];
+ }
+
+ return $result;
+ }
+
+ /**
+ * Remove an individual filter
+ *
+ * @param string $name
+ * @return Zend_File_Transfer_Adapter_Abstract
+ */
+ public function removeFilter($name)
+ {
+ if (false === ($key = $this->_getFilterIdentifier($name))) {
+ return $this;
+ }
+
+ unset($this->_filters[$key]);
+ foreach (array_keys($this->_files) as $file) {
+ if (empty($this->_files[$file]['filters'])) {
+ continue;
+ }
+
+ $index = array_search($key, $this->_files[$file]['filters']);
+ if ($index === false) {
+ continue;
+ }
+
+ unset($this->_files[$file]['filters'][$index]);
+ }
+ return $this;
+ }
+
+ /**
+ * Remove all filters
+ *
+ * @return Zend_File_Transfer_Adapter_Abstract
+ */
+ public function clearFilters()
+ {
+ $this->_filters = array();
+ foreach (array_keys($this->_files) as $file) {
+ $this->_files[$file]['filters'] = array();
+ }
+ return $this;
+ }
+
+ /**
+ * Returns all set files
+ *
+ * @return array List of set files
+ * @throws Zend_File_Transfer_Exception Not implemented
+ */
+ public function getFile()
+ {
+ throw new Zend_File_Transfer_Exception('Method not implemented');
+ }
+
+ /**
+ * Retrieves the filename of transferred files.
+ *
+ * @param string|null $file
+ * @param boolean $path (Optional) Should the path also be returned ?
+ * @return string|array
+ */
+ public function getFileName($file = null, $path = true)
+ {
+ $files = $this->_getFiles($file, true, true);
+ $result = array();
+ $directory = "";
+ foreach($files as $file) {
+ if (empty($this->_files[$file]['name'])) {
+ continue;
+ }
+
+ if ($path === true) {
+ $directory = $this->getDestination($file) . DIRECTORY_SEPARATOR;
+ }
+
+ $result[$file] = $directory . $this->_files[$file]['name'];
+ }
+
+ if (count($result) == 1) {
+ return current($result);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Retrieve additional internal file informations for files
+ *
+ * @param string $file (Optional) File to get informations for
+ * @return array
+ */
+ public function getFileInfo($file = null)
+ {
+ return $this->_getFiles($file);
+ }
+
+ /**
+ * Adds one or more files
+ *
+ * @param string|array $file File to add
+ * @param string|array $validator Validators to use for this file, must be set before
+ * @param string|array $filter Filters to use for this file, must be set before
+ * @return Zend_File_Transfer_Adapter_Abstract
+ * @throws Zend_File_Transfer_Exception Not implemented
+ */
+ public function addFile($file, $validator = null, $filter = null)
+ {
+ throw new Zend_File_Transfer_Exception('Method not implemented');
+ }
+
+ /**
+ * Returns all set types
+ *
+ * @return array List of set types
+ * @throws Zend_File_Transfer_Exception Not implemented
+ */
+ public function getType()
+ {
+ throw new Zend_File_Transfer_Exception('Method not implemented');
+ }
+
+ /**
+ * Adds one or more type of files
+ *
+ * @param string|array $type Type of files to add
+ * @param string|array $validator Validators to use for this file, must be set before
+ * @param string|array $filter Filters to use for this file, must be set before
+ * @return Zend_File_Transfer_Adapter_Abstract
+ * @throws Zend_File_Transfer_Exception Not implemented
+ */
+ public function addType($type, $validator = null, $filter = null)
+ {
+ throw new Zend_File_Transfer_Exception('Method not implemented');
+ }
+
+ /**
+ * Sets a new destination for the given files
+ *
+ * @deprecated Will be changed to be a filter!!!
+ * @param string $destination New destination directory
+ * @param string|array $files Files to set the new destination for
+ * @return Zend_File_Transfer_Abstract
+ * @throws Zend_File_Transfer_Exception when the given destination is not a directory or does not exist
+ */
+ public function setDestination($destination, $files = null)
+ {
+ $orig = $files;
+ $destination = rtrim($destination, "/\\");
+ if (!is_dir($destination)) {
+ throw new Zend_File_Transfer_Exception(
+ 'The given destination is not a directory or does not exist'
+ );
+ }
+
+ if (!$this->_isPathWriteable($destination)) {
+ throw new Zend_File_Transfer_Exception(
+ 'The given destination is not writable'
+ );
+ }
+
+ if ($files === null) {
+ foreach ($this->_files as $file => $content) {
+ $this->_files[$file]['destination'] = $destination;
+ }
+ } else {
+ $files = $this->_getFiles($files, true, true);
+ if (empty($files) and is_string($orig)) {
+ $this->_files[$orig]['destination'] = $destination;
+ }
+
+ foreach ($files as $file) {
+ $this->_files[$file]['destination'] = $destination;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Retrieve destination directory value
+ *
+ * @param null|string|array $files
+ * @return null|string|array
+ * @throws Zend_File_Transfer_Exception
+ */
+ public function getDestination($files = null)
+ {
+ $orig = $files;
+ $files = $this->_getFiles($files, false, true);
+ $destinations = array();
+ if (empty($files) and is_string($orig)) {
+ if (isset($this->_files[$orig]['destination'])) {
+ $destinations[$orig] = $this->_files[$orig]['destination'];
+ } else {
+ throw new Zend_File_Transfer_Exception(sprintf('The file transfer adapter can not find "%s"', $orig));
+ }
+ }
+
+ foreach ($files as $key => $content) {
+ if (isset($this->_files[$key]['destination'])) {
+ $destinations[$key] = $this->_files[$key]['destination'];
+ } else {
+ $tmpdir = $this->_getTmpDir();
+ $this->setDestination($tmpdir, $key);
+ $destinations[$key] = $tmpdir;
+ }
+ }
+
+ if (empty($destinations)) {
+ $destinations = $this->_getTmpDir();
+ } else if (count($destinations) == 1) {
+ $destinations = current($destinations);
+ }
+
+ return $destinations;
+ }
+
+ /**
+ * Set translator object for localization
+ *
+ * @param Zend_Translate|null $translator
+ * @return Zend_File_Transfer_Abstract
+ * @throws Zend_File_Transfer_Exception
+ */
+ public function setTranslator($translator = null)
+ {
+ if (null === $translator) {
+ $this->_translator = null;
+ } elseif ($translator instanceof Zend_Translate_Adapter) {
+ $this->_translator = $translator;
+ } elseif ($translator instanceof Zend_Translate) {
+ $this->_translator = $translator->getAdapter();
+ } else {
+ throw new Zend_File_Transfer_Exception('Invalid translator specified');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Retrieve localization translator object
+ *
+ * @return Zend_Translate_Adapter|null
+ */
+ public function getTranslator()
+ {
+ if ($this->translatorIsDisabled()) {
+ return null;
+ }
+
+ return $this->_translator;
+ }
+
+ /**
+ * Indicate whether or not translation should be disabled
+ *
+ * @param bool $flag
+ * @return Zend_File_Transfer_Abstract
+ */
+ public function setDisableTranslator($flag)
+ {
+ $this->_translatorDisabled = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Is translation disabled?
+ *
+ * @return bool
+ */
+ public function translatorIsDisabled()
+ {
+ return $this->_translatorDisabled;
+ }
+
+ /**
+ * Returns the hash for a given file
+ *
+ * @param string $hash Hash algorithm to use
+ * @param string|array $files Files to return the hash for
+ * @return string|array Hashstring
+ * @throws Zend_File_Transfer_Exception On unknown hash algorithm
+ */
+ public function getHash($hash = 'crc32', $files = null)
+ {
+ if (!in_array($hash, hash_algos())) {
+ throw new Zend_File_Transfer_Exception('Unknown hash algorithm');
+ }
+
+ $files = $this->_getFiles($files);
+ $result = array();
+ foreach($files as $key => $value) {
+ if (file_exists($value['name'])) {
+ $result[$key] = hash_file($hash, $value['name']);
+ } else if (file_exists($value['tmp_name'])) {
+ $result[$key] = hash_file($hash, $value['tmp_name']);
+ } else if (empty($value['options']['ignoreNoFile'])) {
+ throw new Zend_File_Transfer_Exception("The file '{$value['name']}' does not exist");
+ }
+ }
+
+ if (count($result) == 1) {
+ return current($result);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Returns the real filesize of the file
+ *
+ * @param string|array $files Files to get the filesize from
+ * @throws Zend_File_Transfer_Exception When the file does not exist
+ * @return string|array Filesize
+ */
+ public function getFileSize($files = null)
+ {
+ $files = $this->_getFiles($files);
+ $result = array();
+ foreach($files as $key => $value) {
+ if (file_exists($value['name']) || file_exists($value['tmp_name'])) {
+ if ($value['options']['useByteString']) {
+ $result[$key] = self::_toByteString($value['size']);
+ } else {
+ $result[$key] = $value['size'];
+ }
+ } else if (empty($value['options']['ignoreNoFile'])) {
+ throw new Zend_File_Transfer_Exception("The file '{$value['name']}' does not exist");
+ } else {
+ continue;
+ }
+ }
+
+ if (count($result) == 1) {
+ return current($result);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Internal method to detect the size of a file
+ *
+ * @param array $value File infos
+ * @return string Filesize of given file
+ */
+ protected function _detectFileSize($value)
+ {
+ if (file_exists($value['name'])) {
+ $result = sprintf("%u", @filesize($value['name']));
+ } else if (file_exists($value['tmp_name'])) {
+ $result = sprintf("%u", @filesize($value['tmp_name']));
+ } else {
+ return null;
+ }
+
+ return $result;
+ }
+
+ /**
+ * Returns the real mimetype of the file
+ * Uses fileinfo, when not available mime_magic and as last fallback a manual given mimetype
+ *
+ * @param string|array $files Files to get the mimetype from
+ * @throws Zend_File_Transfer_Exception When the file does not exist
+ * @return string|array MimeType
+ */
+ public function getMimeType($files = null)
+ {
+ $files = $this->_getFiles($files);
+ $result = array();
+ foreach($files as $key => $value) {
+ if (file_exists($value['name']) || file_exists($value['tmp_name'])) {
+ $result[$key] = $value['type'];
+ } else if (empty($value['options']['ignoreNoFile'])) {
+ throw new Zend_File_Transfer_Exception("The file '{$value['name']}' does not exist");
+ } else {
+ continue;
+ }
+ }
+
+ if (count($result) == 1) {
+ return current($result);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Internal method to detect the mime type of a file
+ *
+ * @param array $value File infos
+ * @return string Mimetype of given file
+ */
+ protected function _detectMimeType($value)
+ {
+ if (file_exists($value['name'])) {
+ $file = $value['name'];
+ } else if (file_exists($value['tmp_name'])) {
+ $file = $value['tmp_name'];
+ } else {
+ return null;
+ }
+
+ if (class_exists('finfo', false)) {
+ $const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME;
+ if (!empty($value['options']['magicFile'])) {
+ $mime = @finfo_open($const, $value['options']['magicFile']);
+ }
+
+ if (empty($mime)) {
+ $mime = @finfo_open($const);
+ }
+
+ if (!empty($mime)) {
+ $result = finfo_file($mime, $file);
+ }
+
+ unset($mime);
+ }
+
+ if (empty($result) && (function_exists('mime_content_type')
+ && ini_get('mime_magic.magicfile'))) {
+ $result = mime_content_type($file);
+ }
+
+ if (empty($result)) {
+ $result = 'application/octet-stream';
+ }
+
+ return $result;
+ }
+
+ /**
+ * Returns the formatted size
+ *
+ * @param integer $size
+ * @return string
+ */
+ protected static function _toByteString($size)
+ {
+ $sizes = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
+ for ($i=0; $size >= 1024 && $i < 9; $i++) {
+ $size /= 1024;
+ }
+
+ return round($size, 2) . $sizes[$i];
+ }
+
+ /**
+ * Internal function to filter all given files
+ *
+ * @param string|array $files (Optional) Files to check
+ * @return boolean False on error
+ */
+ protected function _filter($files = null)
+ {
+ $check = $this->_getFiles($files);
+ foreach ($check as $name => $content) {
+ if (array_key_exists('filters', $content)) {
+ foreach ($content['filters'] as $class) {
+ $filter = $this->_filters[$class];
+ try {
+ $result = $filter->filter($this->getFileName($name));
+
+ $this->_files[$name]['destination'] = dirname($result);
+ $this->_files[$name]['name'] = basename($result);
+ } catch (Zend_Filter_Exception $e) {
+ $this->_messages += array($e->getMessage());
+ }
+ }
+ }
+ }
+
+ if (count($this->_messages) > 0) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Determine system TMP directory and detect if we have read access
+ *
+ * @return string
+ * @throws Zend_File_Transfer_Exception if unable to determine directory
+ */
+ protected function _getTmpDir()
+ {
+ if (null === $this->_tmpDir) {
+ $tmpdir = array();
+ if (function_exists('sys_get_temp_dir')) {
+ $tmpdir[] = sys_get_temp_dir();
+ }
+
+ if (!empty($_ENV['TMP'])) {
+ $tmpdir[] = realpath($_ENV['TMP']);
+ }
+
+ if (!empty($_ENV['TMPDIR'])) {
+ $tmpdir[] = realpath($_ENV['TMPDIR']);
+ }
+
+ if (!empty($_ENV['TEMP'])) {
+ $tmpdir[] = realpath($_ENV['TEMP']);
+ }
+
+ $upload = ini_get('upload_tmp_dir');
+ if ($upload) {
+ $tmpdir[] = realpath($upload);
+ }
+
+ foreach($tmpdir as $directory) {
+ if ($this->_isPathWriteable($directory)) {
+ $this->_tmpDir = $directory;
+ }
+ }
+
+ if (empty($this->_tmpDir)) {
+ // Attemp to detect by creating a temporary file
+ $tempFile = tempnam(md5(uniqid(rand(), TRUE)), '');
+ if ($tempFile) {
+ $this->_tmpDir = realpath(dirname($tempFile));
+ unlink($tempFile);
+ } else {
+ throw new Zend_File_Transfer_Exception('Could not determine a temporary directory');
+ }
+ }
+
+ $this->_tmpDir = rtrim($this->_tmpDir, "/\\");
+ }
+ return $this->_tmpDir;
+ }
+
+ /**
+ * Tries to detect if we can read and write to the given path
+ *
+ * @param string $path
+ * @return bool
+ */
+ protected function _isPathWriteable($path)
+ {
+ $tempFile = rtrim($path, "/\\");
+ $tempFile .= '/' . 'test.1';
+
+ $result = @file_put_contents($tempFile, 'TEST');
+
+ if ($result == false) {
+ return false;
+ }
+
+ $result = @unlink($tempFile);
+
+ if ($result == false) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns found files based on internal file array and given files
+ *
+ * @param string|array $files (Optional) Files to return
+ * @param boolean $names (Optional) Returns only names on true, else complete info
+ * @param boolean $noexception (Optional) Allows throwing an exception, otherwise returns an empty array
+ * @return array Found files
+ * @throws Zend_File_Transfer_Exception On false filename
+ */
+ protected function _getFiles($files, $names = false, $noexception = false)
+ {
+ $check = array();
+
+ if (is_string($files)) {
+ $files = array($files);
+ }
+
+ if (is_array($files)) {
+ foreach ($files as $find) {
+ $found = array();
+ foreach ($this->_files as $file => $content) {
+ if (!isset($content['name'])) {
+ continue;
+ }
+
+ if (($content['name'] === $find) && isset($content['multifiles'])) {
+ foreach ($content['multifiles'] as $multifile) {
+ $found[] = $multifile;
+ }
+ break;
+ }
+
+ if ($file === $find) {
+ $found[] = $file;
+ break;
+ }
+
+ if ($content['name'] === $find) {
+ $found[] = $file;
+ break;
+ }
+ }
+
+ if (empty($found)) {
+ if ($noexception !== false) {
+ return array();
+ }
+
+ throw new Zend_File_Transfer_Exception(sprintf('The file transfer adapter can not find "%s"', $find));
+ }
+
+ foreach ($found as $checked) {
+ $check[$checked] = $this->_files[$checked];
+ }
+ }
+ }
+
+ if ($files === null) {
+ $check = $this->_files;
+ $keys = array_keys($check);
+ foreach ($keys as $key) {
+ if (isset($check[$key]['multifiles'])) {
+ unset($check[$key]);
+ }
+ }
+ }
+
+ if ($names) {
+ $check = array_keys($check);
+ }
+
+ return $check;
+ }
+
+ /**
+ * Retrieve internal identifier for a named validator
+ *
+ * @param string $name
+ * @return string
+ */
+ protected function _getValidatorIdentifier($name)
+ {
+ if (array_key_exists($name, $this->_validators)) {
+ return $name;
+ }
+
+ foreach (array_keys($this->_validators) as $test) {
+ if (preg_match('/' . preg_quote($name) . '$/i', $test)) {
+ return $test;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Retrieve internal identifier for a named filter
+ *
+ * @param string $name
+ * @return string
+ */
+ protected function _getFilterIdentifier($name)
+ {
+ if (array_key_exists($name, $this->_filters)) {
+ return $name;
+ }
+
+ foreach (array_keys($this->_filters) as $test) {
+ if (preg_match('/' . preg_quote($name) . '$/i', $test)) {
+ return $test;
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/File/Transfer/Adapter/Http.php b/library/vendor/Zend/File/Transfer/Adapter/Http.php
new file mode 100644
index 0000000..08e56c0
--- /dev/null
+++ b/library/vendor/Zend/File/Transfer/Adapter/Http.php
@@ -0,0 +1,480 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_File_Transfer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_File_Transfer_Adapter_Abstract
+ */
+
+/**
+ * File transfer adapter class for the HTTP protocol
+ *
+ * @category Zend
+ * @package Zend_File_Transfer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_File_Transfer_Adapter_Http extends Zend_File_Transfer_Adapter_Abstract
+{
+ protected static $_callbackApc = 'apc_fetch';
+ protected static $_callbackUploadProgress = 'uploadprogress_get_info';
+
+ /**
+ * Constructor for Http File Transfers
+ *
+ * @param array $options OPTIONAL Options to set
+ */
+ public function __construct($options = array())
+ {
+ if (ini_get('file_uploads') == false) {
+ throw new Zend_File_Transfer_Exception('File uploads are not allowed in your php config!');
+ }
+
+ $this->setOptions($options);
+ $this->_prepareFiles();
+ $this->addValidator('Upload', false, $this->_files);
+ }
+
+ /**
+ * Sets a validator for the class, erasing all previous set
+ *
+ * @param string|array $validator Validator to set
+ * @param string|array $files Files to limit this validator to
+ * @return Zend_File_Transfer_Adapter
+ */
+ public function setValidators(array $validators, $files = null)
+ {
+ $this->clearValidators();
+ return $this->addValidators($validators, $files);
+ }
+
+ /**
+ * Remove an individual validator
+ *
+ * @param string $name
+ * @return Zend_File_Transfer_Adapter_Abstract
+ */
+ public function removeValidator($name)
+ {
+ if ($name == 'Upload') {
+ return $this;
+ }
+
+ return parent::removeValidator($name);
+ }
+
+ /**
+ * Remove an individual validator
+ *
+ * @param string $name
+ * @return Zend_File_Transfer_Adapter_Abstract
+ */
+ public function clearValidators()
+ {
+ parent::clearValidators();
+ $this->addValidator('Upload', false, $this->_files);
+
+ return $this;
+ }
+
+ /**
+ * Send the file to the client (Download)
+ *
+ * @param string|array $options Options for the file(s) to send
+ * @return void
+ * @throws Zend_File_Transfer_Exception Not implemented
+ */
+ public function send($options = null)
+ {
+ throw new Zend_File_Transfer_Exception('Method not implemented');
+ }
+
+ /**
+ * Checks if the files are valid
+ *
+ * @param string|array $files (Optional) Files to check
+ * @return boolean True if all checks are valid
+ */
+ public function isValid($files = null)
+ {
+ // Workaround for WebServer not conforming HTTP and omitting CONTENT_LENGTH
+ $content = 0;
+ if (isset($_SERVER['CONTENT_LENGTH'])) {
+ $content = $_SERVER['CONTENT_LENGTH'];
+ } else if (!empty($_POST)) {
+ $content = serialize($_POST);
+ }
+
+ // Workaround for a PHP error returning empty $_FILES when form data exceeds php settings
+ if (empty($this->_files) && ($content > 0)) {
+ if (is_array($files)) {
+ if (0 === count($files)) {
+ return false;
+ }
+
+ $files = current($files);
+ }
+
+ $temp = array($files => array(
+ 'name' => $files,
+ 'error' => 1));
+ $validator = $this->_validators['Zend_Validate_File_Upload'];
+ $validator->setFiles($temp)
+ ->isValid($files, null);
+ $this->_messages += $validator->getMessages();
+ return false;
+ }
+
+ return parent::isValid($files);
+ }
+
+ /**
+ * Receive the file from the client (Upload)
+ *
+ * @param string|array $files (Optional) Files to receive
+ * @return bool
+ */
+ public function receive($files = null)
+ {
+ if (!$this->isValid($files)) {
+ return false;
+ }
+
+ $check = $this->_getFiles($files);
+ foreach ($check as $file => $content) {
+ if (!$content['received']) {
+ $directory = '';
+ $destination = $this->getDestination($file);
+ if ($destination !== null) {
+ $directory = $destination . DIRECTORY_SEPARATOR;
+ }
+
+ $filename = $directory . $content['name'];
+ $rename = $this->getFilter('Rename');
+ if ($rename !== null) {
+ $tmp = $rename->getNewName($content['tmp_name']);
+ if ($tmp != $content['tmp_name']) {
+ $filename = $tmp;
+ }
+
+ if (dirname($filename) == '.') {
+ $filename = $directory . $filename;
+ }
+
+ $key = array_search(get_class($rename), $this->_files[$file]['filters']);
+ unset($this->_files[$file]['filters'][$key]);
+ }
+
+ // Should never return false when it's tested by the upload validator
+ if (!move_uploaded_file($content['tmp_name'], $filename)) {
+ if ($content['options']['ignoreNoFile']) {
+ $this->_files[$file]['received'] = true;
+ $this->_files[$file]['filtered'] = true;
+ continue;
+ }
+
+ $this->_files[$file]['received'] = false;
+ return false;
+ }
+
+ if ($rename !== null) {
+ $this->_files[$file]['destination'] = dirname($filename);
+ $this->_files[$file]['name'] = basename($filename);
+ }
+
+ $this->_files[$file]['tmp_name'] = $filename;
+ $this->_files[$file]['received'] = true;
+ }
+
+ if (!$content['filtered']) {
+ if (!$this->_filter($file)) {
+ $this->_files[$file]['filtered'] = false;
+ return false;
+ }
+
+ $this->_files[$file]['filtered'] = true;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Checks if the file was already sent
+ *
+ * @param string|array $file Files to check
+ * @return bool
+ * @throws Zend_File_Transfer_Exception Not implemented
+ */
+ public function isSent($files = null)
+ {
+ throw new Zend_File_Transfer_Exception('Method not implemented');
+ }
+
+ /**
+ * Checks if the file was already received
+ *
+ * @param string|array $files (Optional) Files to check
+ * @return bool
+ */
+ public function isReceived($files = null)
+ {
+ $files = $this->_getFiles($files, false, true);
+ if (empty($files)) {
+ return false;
+ }
+
+ foreach ($files as $content) {
+ if ($content['received'] !== true) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Checks if the file was already filtered
+ *
+ * @param string|array $files (Optional) Files to check
+ * @return bool
+ */
+ public function isFiltered($files = null)
+ {
+ $files = $this->_getFiles($files, false, true);
+ if (empty($files)) {
+ return false;
+ }
+
+ foreach ($files as $content) {
+ if ($content['filtered'] !== true) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Has a file been uploaded ?
+ *
+ * @param array|string|null $file
+ * @return bool
+ */
+ public function isUploaded($files = null)
+ {
+ $files = $this->_getFiles($files, false, true);
+ if (empty($files)) {
+ return false;
+ }
+
+ foreach ($files as $file) {
+ if (empty($file['name'])) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns the actual progress of file up-/downloads
+ *
+ * @param string $id The upload to get the progress for
+ * @return array|null
+ */
+ public static function getProgress($id = null)
+ {
+ if (!function_exists('apc_fetch') and !function_exists('uploadprogress_get_info')) {
+ throw new Zend_File_Transfer_Exception('Neither APC nor uploadprogress extension installed');
+ }
+
+ $session = 'Zend_File_Transfer_Adapter_Http_ProgressBar';
+ $status = array(
+ 'total' => 0,
+ 'current' => 0,
+ 'rate' => 0,
+ 'message' => '',
+ 'done' => false
+ );
+
+ if (is_array($id)) {
+ if (isset($id['progress'])) {
+ $adapter = $id['progress'];
+ }
+
+ if (isset($id['session'])) {
+ $session = $id['session'];
+ }
+
+ if (isset($id['id'])) {
+ $id = $id['id'];
+ } else {
+ unset($id);
+ }
+ }
+
+ if (!empty($id) && (($id instanceof Zend_ProgressBar_Adapter) || ($id instanceof Zend_ProgressBar))) {
+ $adapter = $id;
+ unset($id);
+ }
+
+ if (empty($id)) {
+ if (!isset($_GET['progress_key'])) {
+ $status['message'] = 'No upload in progress';
+ $status['done'] = true;
+ } else {
+ $id = $_GET['progress_key'];
+ }
+ }
+
+ if (!empty($id)) {
+ if (self::isApcAvailable()) {
+
+ $call = call_user_func(self::$_callbackApc, ini_get('apc.rfc1867_prefix') . $id);
+ if (is_array($call)) {
+ $status = $call + $status;
+ }
+ } else if (self::isUploadProgressAvailable()) {
+ $call = call_user_func(self::$_callbackUploadProgress, $id);
+ if (is_array($call)) {
+ $status = $call + $status;
+ $status['total'] = $status['bytes_total'];
+ $status['current'] = $status['bytes_uploaded'];
+ $status['rate'] = $status['speed_average'];
+ if ($status['total'] == $status['current']) {
+ $status['done'] = true;
+ }
+ }
+ }
+
+ if (!is_array($call)) {
+ $status['done'] = true;
+ $status['message'] = 'Failure while retrieving the upload progress';
+ } else if (!empty($status['cancel_upload'])) {
+ $status['done'] = true;
+ $status['message'] = 'The upload has been canceled';
+ } else {
+ $status['message'] = self::_toByteString($status['current']) . " - " . self::_toByteString($status['total']);
+ }
+
+ $status['id'] = $id;
+ }
+
+ if (isset($adapter) && isset($status['id'])) {
+ if ($adapter instanceof Zend_ProgressBar_Adapter) {
+ $adapter = new Zend_ProgressBar($adapter, 0, $status['total'], $session);
+ }
+
+ if (!($adapter instanceof Zend_ProgressBar)) {
+ throw new Zend_File_Transfer_Exception('Unknown Adapter given');
+ }
+
+ if ($status['done']) {
+ $adapter->finish();
+ } else {
+ $adapter->update($status['current'], $status['message']);
+ }
+
+ $status['progress'] = $adapter;
+ }
+
+ return $status;
+ }
+
+ /**
+ * Checks the APC extension for progress information
+ *
+ * @return boolean
+ */
+ public static function isApcAvailable()
+ {
+ return (bool) ini_get('apc.enabled') && (bool) ini_get('apc.rfc1867') && is_callable(self::$_callbackApc);
+ }
+
+ /**
+ * Checks the UploadProgress extension for progress information
+ *
+ * @return boolean
+ */
+ public static function isUploadProgressAvailable()
+ {
+ return is_callable(self::$_callbackUploadProgress);
+ }
+
+ /**
+ * Prepare the $_FILES array to match the internal syntax of one file per entry
+ *
+ * @param array $files
+ * @return array
+ */
+ protected function _prepareFiles()
+ {
+ $this->_files = array();
+ foreach ($_FILES as $form => $content) {
+ if (is_array($content['name'])) {
+ foreach ($content as $param => $file) {
+ foreach ($file as $number => $target) {
+ $this->_files[$form . '_' . $number . '_'][$param] = $target;
+ $this->_files[$form]['multifiles'][$number] = $form . '_' . $number . '_';
+ }
+ }
+
+ $this->_files[$form]['name'] = $form;
+ foreach($this->_files[$form]['multifiles'] as $key => $value) {
+ $this->_files[$value]['options'] = $this->_options;
+ $this->_files[$value]['validated'] = false;
+ $this->_files[$value]['received'] = false;
+ $this->_files[$value]['filtered'] = false;
+
+ $mimetype = $this->_detectMimeType($this->_files[$value]);
+ $this->_files[$value]['type'] = $mimetype;
+
+ $filesize = $this->_detectFileSize($this->_files[$value]);
+ $this->_files[$value]['size'] = $filesize;
+
+ if ($this->_options['detectInfos']) {
+ $_FILES[$form]['type'][$key] = $mimetype;
+ $_FILES[$form]['size'][$key] = $filesize;
+ }
+ }
+ } else {
+ $this->_files[$form] = $content;
+ $this->_files[$form]['options'] = $this->_options;
+ $this->_files[$form]['validated'] = false;
+ $this->_files[$form]['received'] = false;
+ $this->_files[$form]['filtered'] = false;
+
+ $mimetype = $this->_detectMimeType($this->_files[$form]);
+ $this->_files[$form]['type'] = $mimetype;
+
+ $filesize = $this->_detectFileSize($this->_files[$form]);
+ $this->_files[$form]['size'] = $filesize;
+
+ if ($this->_options['detectInfos']) {
+ $_FILES[$form]['type'] = $mimetype;
+ $_FILES[$form]['size'] = $filesize;
+ }
+ }
+ }
+
+ return $this;
+ }
+}
diff --git a/library/vendor/Zend/File/Transfer/Exception.php b/library/vendor/Zend/File/Transfer/Exception.php
new file mode 100644
index 0000000..27f030c
--- /dev/null
+++ b/library/vendor/Zend/File/Transfer/Exception.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_File_Transfer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Exception
+ */
+
+/**
+ * Exception class for Zend_File_Transfer
+ *
+ * @category Zend
+ * @package Zend_File_Transfer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_File_Transfer_Exception extends Zend_Exception
+{
+ protected $_fileerror = null;
+
+ public function __construct($message, $fileerror = 0)
+ {
+ $this->_fileerror = $fileerror;
+ parent::__construct($message);
+ }
+
+ /**
+ * Returns the transfer error code for the exception
+ * This is not the exception code !!!
+ *
+ * @return integer
+ */
+ public function getFileError()
+ {
+ return $this->_fileerror;
+ }
+}
diff --git a/library/vendor/Zend/Filter.php b/library/vendor/Zend/Filter.php
new file mode 100644
index 0000000..d05bdf8
--- /dev/null
+++ b/library/vendor/Zend/Filter.php
@@ -0,0 +1,236 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter implements Zend_Filter_Interface
+{
+
+ const CHAIN_APPEND = 'append';
+ const CHAIN_PREPEND = 'prepend';
+
+ /**
+ * Filter chain
+ *
+ * @var array
+ */
+ protected $_filters = array();
+
+ /**
+ * Default Namespaces
+ *
+ * @var array
+ */
+ protected static $_defaultNamespaces = array();
+
+ /**
+ * Adds a filter to the chain
+ *
+ * @param Zend_Filter_Interface $filter
+ * @param string $placement
+ * @return Zend_Filter Provides a fluent interface
+ */
+ public function addFilter(Zend_Filter_Interface $filter, $placement = self::CHAIN_APPEND)
+ {
+ if ($placement == self::CHAIN_PREPEND) {
+ array_unshift($this->_filters, $filter);
+ } else {
+ $this->_filters[] = $filter;
+ }
+ return $this;
+ }
+
+ /**
+ * Add a filter to the end of the chain
+ *
+ * @param Zend_Filter_Interface $filter
+ * @return Zend_Filter Provides a fluent interface
+ */
+ public function appendFilter(Zend_Filter_Interface $filter)
+ {
+ return $this->addFilter($filter, self::CHAIN_APPEND);
+ }
+
+ /**
+ * Add a filter to the start of the chain
+ *
+ * @param Zend_Filter_Interface $filter
+ * @return Zend_Filter Provides a fluent interface
+ */
+ public function prependFilter(Zend_Filter_Interface $filter)
+ {
+ return $this->addFilter($filter, self::CHAIN_PREPEND);
+ }
+
+ /**
+ * Get all the filters
+ *
+ * @return array
+ */
+ public function getFilters()
+ {
+ return $this->_filters;
+ }
+
+ /**
+ * Returns $value filtered through each filter in the chain
+ *
+ * Filters are run in the order in which they were added to the chain (FIFO)
+ *
+ * @param mixed $value
+ * @return mixed
+ */
+ public function filter($value)
+ {
+ $valueFiltered = $value;
+ foreach ($this->_filters as $filter) {
+ $valueFiltered = $filter->filter($valueFiltered);
+ }
+ return $valueFiltered;
+ }
+
+ /**
+ * Returns the set default namespaces
+ *
+ * @return array
+ */
+ public static function getDefaultNamespaces()
+ {
+ return self::$_defaultNamespaces;
+ }
+
+ /**
+ * Sets new default namespaces
+ *
+ * @param array|string $namespace
+ * @return null
+ */
+ public static function setDefaultNamespaces($namespace)
+ {
+ if (!is_array($namespace)) {
+ $namespace = array((string) $namespace);
+ }
+
+ self::$_defaultNamespaces = $namespace;
+ }
+
+ /**
+ * Adds a new default namespace
+ *
+ * @param array|string $namespace
+ * @return null
+ */
+ public static function addDefaultNamespaces($namespace)
+ {
+ if (!is_array($namespace)) {
+ $namespace = array((string) $namespace);
+ }
+
+ self::$_defaultNamespaces = array_unique(array_merge(self::$_defaultNamespaces, $namespace));
+ }
+
+ /**
+ * Returns true when defaultNamespaces are set
+ *
+ * @return boolean
+ */
+ public static function hasDefaultNamespaces()
+ {
+ return (!empty(self::$_defaultNamespaces));
+ }
+
+ /**
+ * @deprecated
+ * @see Zend_Filter::filterStatic()
+ *
+ * @param mixed $value
+ * @param string $classBaseName
+ * @param array $args OPTIONAL
+ * @param array|string $namespaces OPTIONAL
+ * @return mixed
+ * @throws Zend_Filter_Exception
+ */
+ public static function get($value, $classBaseName, array $args = array(), $namespaces = array())
+ {
+ trigger_error(
+ 'Zend_Filter::get() is deprecated as of 1.9.0; please update your code to utilize Zend_Filter::filterStatic()',
+ E_USER_NOTICE
+ );
+
+ return self::filterStatic($value, $classBaseName, $args, $namespaces);
+ }
+
+ /**
+ * Returns a value filtered through a specified filter class, without requiring separate
+ * instantiation of the filter object.
+ *
+ * The first argument of this method is a data input value, that you would have filtered.
+ * The second argument is a string, which corresponds to the basename of the filter class,
+ * relative to the Zend_Filter namespace. This method automatically loads the class,
+ * creates an instance, and applies the filter() method to the data input. You can also pass
+ * an array of constructor arguments, if they are needed for the filter class.
+ *
+ * @param mixed $value
+ * @param string $classBaseName
+ * @param array $args OPTIONAL
+ * @param array|string $namespaces OPTIONAL
+ * @return mixed
+ * @throws Zend_Filter_Exception
+ */
+ public static function filterStatic($value, $classBaseName, array $args = array(), $namespaces = array())
+ {
+ $namespaces = array_merge((array) $namespaces, self::$_defaultNamespaces, array('Zend_Filter'));
+ foreach ($namespaces as $namespace) {
+ $className = $namespace . '_' . ucfirst($classBaseName);
+ if (!class_exists($className, false)) {
+ try {
+ $file = str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';
+ if (Zend_Loader::isReadable($file)) {
+ Zend_Loader::loadClass($className);
+ } else {
+ continue;
+ }
+ } catch (Zend_Exception $ze) {
+ continue;
+ }
+ }
+
+ $class = new ReflectionClass($className);
+ if ($class->implementsInterface('Zend_Filter_Interface')) {
+ if ($class->hasMethod('__construct')) {
+ $object = $class->newInstanceArgs(array_values($args));
+ } else {
+ $object = $class->newInstance();
+ }
+ return $object->filter($value);
+ }
+ }
+ throw new Zend_Filter_Exception("Filter class not found from basename '$classBaseName'");
+ }
+}
diff --git a/library/vendor/Zend/Filter/Alnum.php b/library/vendor/Zend/Filter/Alnum.php
new file mode 100644
index 0000000..c3928a0
--- /dev/null
+++ b/library/vendor/Zend/Filter/Alnum.php
@@ -0,0 +1,144 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+/**
+ * @see Zend_Locale
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Alnum implements Zend_Filter_Interface
+{
+ /**
+ * Whether to allow white space characters; off by default
+ *
+ * @var boolean
+ * @deprecated
+ */
+ public $allowWhiteSpace;
+
+ /**
+ * Is PCRE is compiled with UTF-8 and Unicode support
+ *
+ * @var mixed
+ **/
+ protected static $_unicodeEnabled;
+
+ /**
+ * Locale in browser.
+ *
+ * @var Zend_Locale object
+ */
+ protected $_locale;
+
+ /**
+ * The Alphabet means english alphabet.
+ *
+ * @var boolean
+ */
+ protected static $_meansEnglishAlphabet;
+
+ /**
+ * Sets default option values for this instance
+ *
+ * @param boolean $allowWhiteSpace
+ * @return void
+ */
+ public function __construct($allowWhiteSpace = false)
+ {
+ if ($allowWhiteSpace instanceof Zend_Config) {
+ $allowWhiteSpace = $allowWhiteSpace->toArray();
+ } else if (is_array($allowWhiteSpace)) {
+ if (array_key_exists('allowwhitespace', $allowWhiteSpace)) {
+ $allowWhiteSpace = $allowWhiteSpace['allowwhitespace'];
+ } else {
+ $allowWhiteSpace = false;
+ }
+ }
+
+ $this->allowWhiteSpace = (boolean) $allowWhiteSpace;
+ if (null === self::$_unicodeEnabled) {
+ self::$_unicodeEnabled = (@preg_match('/\pL/u', 'a')) ? true : false;
+ }
+
+ if (null === self::$_meansEnglishAlphabet) {
+ $this->_locale = new Zend_Locale('auto');
+ self::$_meansEnglishAlphabet = in_array($this->_locale->getLanguage(),
+ array('ja', 'ko', 'zh')
+ );
+ }
+
+ }
+
+ /**
+ * Returns the allowWhiteSpace option
+ *
+ * @return boolean
+ */
+ public function getAllowWhiteSpace()
+ {
+ return $this->allowWhiteSpace;
+ }
+
+ /**
+ * Sets the allowWhiteSpace option
+ *
+ * @param boolean $allowWhiteSpace
+ * @return Zend_Filter_Alnum Provides a fluent interface
+ */
+ public function setAllowWhiteSpace($allowWhiteSpace)
+ {
+ $this->allowWhiteSpace = (boolean) $allowWhiteSpace;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Returns the string $value, removing all but alphabetic and digit characters
+ *
+ * @param string $value
+ * @return string
+ */
+ public function filter($value)
+ {
+ $whiteSpace = $this->allowWhiteSpace ? '\s' : '';
+ if (!self::$_unicodeEnabled) {
+ // POSIX named classes are not supported, use alternative a-zA-Z0-9 match
+ $pattern = '/[^a-zA-Z0-9' . $whiteSpace . ']/';
+ } else if (self::$_meansEnglishAlphabet) {
+ //The Alphabet means english alphabet.
+ $pattern = '/[^a-zA-Z0-9' . $whiteSpace . ']/u';
+ } else {
+ //The Alphabet means each language's alphabet.
+ $pattern = '/[^\p{L}\p{N}' . $whiteSpace . ']/u';
+ }
+
+ return preg_replace($pattern, '', (string) $value);
+ }
+}
diff --git a/library/vendor/Zend/Filter/Alpha.php b/library/vendor/Zend/Filter/Alpha.php
new file mode 100644
index 0000000..5c1a22c
--- /dev/null
+++ b/library/vendor/Zend/Filter/Alpha.php
@@ -0,0 +1,144 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+/**
+ * @see Zend_Locale
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Alpha implements Zend_Filter_Interface
+{
+ /**
+ * Whether to allow white space characters; off by default
+ *
+ * @var boolean
+ * @deprecated
+ */
+ public $allowWhiteSpace;
+
+ /**
+ * Is PCRE is compiled with UTF-8 and Unicode support
+ *
+ * @var mixed
+ **/
+ protected static $_unicodeEnabled;
+
+ /**
+ * Locale in browser.
+ *
+ * @var Zend_Locale object
+ */
+ protected $_locale;
+
+ /**
+ * The Alphabet means english alphabet.
+ *
+ * @var boolean
+ */
+ protected static $_meansEnglishAlphabet;
+
+ /**
+ * Sets default option values for this instance
+ *
+ * @param boolean $allowWhiteSpace
+ * @return void
+ */
+ public function __construct($allowWhiteSpace = false)
+ {
+ if ($allowWhiteSpace instanceof Zend_Config) {
+ $allowWhiteSpace = $allowWhiteSpace->toArray();
+ } else if (is_array($allowWhiteSpace)) {
+ if (array_key_exists('allowwhitespace', $allowWhiteSpace)) {
+ $allowWhiteSpace = $allowWhiteSpace['allowwhitespace'];
+ } else {
+ $allowWhiteSpace = false;
+ }
+ }
+
+ $this->allowWhiteSpace = (boolean) $allowWhiteSpace;
+ if (null === self::$_unicodeEnabled) {
+ self::$_unicodeEnabled = (@preg_match('/\pL/u', 'a')) ? true : false;
+ }
+
+ if (null === self::$_meansEnglishAlphabet) {
+ $this->_locale = new Zend_Locale('auto');
+ self::$_meansEnglishAlphabet = in_array($this->_locale->getLanguage(),
+ array('ja', 'ko', 'zh')
+ );
+ }
+
+ }
+
+ /**
+ * Returns the allowWhiteSpace option
+ *
+ * @return boolean
+ */
+ public function getAllowWhiteSpace()
+ {
+ return $this->allowWhiteSpace;
+ }
+
+ /**
+ * Sets the allowWhiteSpace option
+ *
+ * @param boolean $allowWhiteSpace
+ * @return Zend_Filter_Alpha Provides a fluent interface
+ */
+ public function setAllowWhiteSpace($allowWhiteSpace)
+ {
+ $this->allowWhiteSpace = (boolean) $allowWhiteSpace;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Returns the string $value, removing all but alphabetic characters
+ *
+ * @param string $value
+ * @return string
+ */
+ public function filter($value)
+ {
+ $whiteSpace = $this->allowWhiteSpace ? '\s' : '';
+ if (!self::$_unicodeEnabled) {
+ // POSIX named classes are not supported, use alternative a-zA-Z match
+ $pattern = '/[^a-zA-Z' . $whiteSpace . ']/';
+ } else if (self::$_meansEnglishAlphabet) {
+ //The Alphabet means english alphabet.
+ $pattern = '/[^a-zA-Z' . $whiteSpace . ']/u';
+ } else {
+ //The Alphabet means each language's alphabet.
+ $pattern = '/[^\p{L}' . $whiteSpace . ']/u';
+ }
+
+ return preg_replace($pattern, '', (string) $value);
+ }
+}
diff --git a/library/vendor/Zend/Filter/BaseName.php b/library/vendor/Zend/Filter/BaseName.php
new file mode 100644
index 0000000..41ab68a
--- /dev/null
+++ b/library/vendor/Zend/Filter/BaseName.php
@@ -0,0 +1,49 @@
+<?php
+
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_BaseName implements Zend_Filter_Interface
+{
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Returns basename($value)
+ *
+ * @param string $value
+ * @return string
+ */
+ public function filter($value)
+ {
+ return basename((string) $value);
+ }
+}
diff --git a/library/vendor/Zend/Filter/Boolean.php b/library/vendor/Zend/Filter/Boolean.php
new file mode 100644
index 0000000..c48a3d6
--- /dev/null
+++ b/library/vendor/Zend/Filter/Boolean.php
@@ -0,0 +1,369 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Boolean implements Zend_Filter_Interface
+{
+ const BOOLEAN = 1;
+ const INTEGER = 2;
+ const FLOAT = 4;
+ const STRING = 8;
+ const ZERO = 16;
+ const EMPTY_ARRAY = 32;
+ const NULL = 64;
+ const PHP = 127;
+ const FALSE_STRING = 128;
+ const YES = 256;
+ const ALL = 511;
+
+ protected $_constants = array(
+ self::BOOLEAN => 'boolean',
+ self::INTEGER => 'integer',
+ self::FLOAT => 'float',
+ self::STRING => 'string',
+ self::ZERO => 'zero',
+ self::EMPTY_ARRAY => 'array',
+ self::NULL => 'null',
+ self::PHP => 'php',
+ self::FALSE_STRING => 'false',
+ self::YES => 'yes',
+ self::ALL => 'all',
+ );
+
+ /**
+ * Internal type to detect
+ *
+ * @var integer
+ */
+ protected $_type = self::PHP;
+
+ /**
+ * Internal locale
+ *
+ * @var array
+ */
+ protected $_locale = array('auto');
+
+ /**
+ * Internal mode
+ *
+ * @var boolean
+ */
+ protected $_casting = true;
+
+ /**
+ * Constructor
+ *
+ * @param string|array|Zend_Config $options OPTIONAL
+ */
+ public function __construct($options = null)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } elseif (!is_array($options)) {
+ $options = func_get_args();
+ $temp = array();
+ if (!empty($options)) {
+ $temp['type'] = array_shift($options);
+ }
+
+ if (!empty($options)) {
+ $temp['casting'] = array_shift($options);
+ }
+
+ if (!empty($options)) {
+ $temp['locale'] = array_shift($options);
+ }
+
+ $options = $temp;
+ }
+
+ if (array_key_exists('type', $options)) {
+ $this->setType($options['type']);
+ }
+
+ if (array_key_exists('casting', $options)) {
+ $this->setCasting($options['casting']);
+ }
+
+ if (array_key_exists('locale', $options)) {
+ $this->setLocale($options['locale']);
+ }
+ }
+
+ /**
+ * Returns the set null types
+ *
+ * @return int
+ */
+ public function getType()
+ {
+ return $this->_type;
+ }
+
+ /**
+ * Set the null types
+ *
+ * @param integer|array $type
+ * @throws Zend_Filter_Exception
+ * @return Zend_Filter_Boolean
+ */
+ public function setType($type = null)
+ {
+ if (is_array($type)) {
+ $detected = 0;
+ foreach($type as $value) {
+ if (is_int($value)) {
+ $detected += $value;
+ } elseif (in_array($value, $this->_constants)) {
+ $detected += array_search($value, $this->_constants);
+ }
+ }
+
+ $type = $detected;
+ } elseif (is_string($type) && in_array($type, $this->_constants)) {
+ $type = array_search($type, $this->_constants);
+ }
+
+ if (!is_int($type) || ($type < 0) || ($type > self::ALL)) {
+ throw new Zend_Filter_Exception('Unknown type');
+ }
+
+ $this->_type = $type;
+ return $this;
+ }
+
+ /**
+ * Returns the set locale
+ *
+ * @return array
+ */
+ public function getLocale()
+ {
+ return $this->_locale;
+ }
+
+ /**
+ * Set the locales which are accepted
+ *
+ * @param string|array|Zend_Locale $locale
+ * @throws Zend_Filter_Exception
+ * @return Zend_Filter_Boolean
+ */
+ public function setLocale($locale = null)
+ {
+ if (is_string($locale)) {
+ $locale = array($locale);
+ } elseif ($locale instanceof Zend_Locale) {
+ $locale = array($locale->toString());
+ } elseif (!is_array($locale)) {
+ throw new Zend_Filter_Exception('Locale has to be string, array or an instance of Zend_Locale');
+ }
+
+ foreach ($locale as $single) {
+ if (!Zend_Locale::isLocale($single)) {
+ throw new Zend_Filter_Exception("Unknown locale '$single'");
+ }
+ }
+
+ $this->_locale = $locale;
+ return $this;
+ }
+
+ /**
+ * Returns the casting option
+ *
+ * @return boolean
+ */
+ public function getCasting()
+ {
+ return $this->_casting;
+ }
+
+ /**
+ * Set the working mode
+ *
+ * @param boolean $locale When true this filter works like cast
+ * When false it recognises only true and false
+ * and all other values are returned as is
+ * @throws Zend_Filter_Exception
+ * @return Zend_Filter_Boolean
+ */
+ public function setCasting($casting = true)
+ {
+ $this->_casting = (boolean) $casting;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Returns a boolean representation of $value
+ *
+ * @param string $value
+ * @return string
+ */
+ public function filter($value)
+ {
+ $type = $this->getType();
+ $casting = $this->getCasting();
+
+ // STRING YES (Localized)
+ if ($type >= self::YES) {
+ $type -= self::YES;
+ if (is_string($value)) {
+ $locales = $this->getLocale();
+ foreach ($locales as $locale) {
+ if ($this->_getLocalizedQuestion($value, false, $locale) === false) {
+ return false;
+ }
+
+ if (!$casting && ($this->_getLocalizedQuestion($value, true, $locale) === true)) {
+ return true;
+ }
+ }
+ }
+ }
+
+ // STRING FALSE ('false')
+ if ($type >= self::FALSE_STRING) {
+ $type -= self::FALSE_STRING;
+ if (is_string($value) && (strtolower($value) == 'false')) {
+ return false;
+ }
+
+ if ((!$casting) && is_string($value) && (strtolower($value) == 'true')) {
+ return true;
+ }
+ }
+
+ // NULL (null)
+ if ($type >= self::NULL) {
+ $type -= self::NULL;
+ if ($value === null) {
+ return false;
+ }
+ }
+
+ // EMPTY_ARRAY (array())
+ if ($type >= self::EMPTY_ARRAY) {
+ $type -= self::EMPTY_ARRAY;
+ if (is_array($value) && ($value == array())) {
+ return false;
+ }
+ }
+
+ // ZERO ('0')
+ if ($type >= self::ZERO) {
+ $type -= self::ZERO;
+ if (is_string($value) && ($value == '0')) {
+ return false;
+ }
+
+ if ((!$casting) && (is_string($value)) && ($value == '1')) {
+ return true;
+ }
+ }
+
+ // STRING ('')
+ if ($type >= self::STRING) {
+ $type -= self::STRING;
+ if (is_string($value) && ($value == '')) {
+ return false;
+ }
+ }
+
+ // FLOAT (0.0)
+ if ($type >= self::FLOAT) {
+ $type -= self::FLOAT;
+ if (is_float($value) && ($value == 0.0)) {
+ return false;
+ }
+
+ if ((!$casting) && is_float($value) && ($value == 1.0)) {
+ return true;
+ }
+ }
+
+ // INTEGER (0)
+ if ($type >= self::INTEGER) {
+ $type -= self::INTEGER;
+ if (is_int($value) && ($value == 0)) {
+ return false;
+ }
+
+ if ((!$casting) && is_int($value) && ($value == 1)) {
+ return true;
+ }
+ }
+
+ // BOOLEAN (false)
+ if ($type >= self::BOOLEAN) {
+ $type -= self::BOOLEAN;
+ if (is_bool($value)) {
+ return $value;
+ }
+ }
+
+ if ($casting) {
+ return true;
+ }
+
+ return $value;
+ }
+
+ /**
+ * Determine the value of a localized string, and compare it to a given value
+ *
+ * @param string $value
+ * @param boolean $yes
+ * @param array $locale
+ * @return boolean
+ */
+ protected function _getLocalizedQuestion($value, $yes, $locale)
+ {
+ if ($yes == true) {
+ $question = 'yes';
+ $return = true;
+ } else {
+ $question = 'no';
+ $return = false;
+ }
+ $str = Zend_Locale::getTranslation($question, 'question', $locale);
+ $str = explode(':', $str);
+ if (!empty($str)) {
+ foreach($str as $no) {
+ if (($no == $value) || (strtolower($no) == strtolower($value))) {
+ return $return;
+ }
+ }
+ }
+ }
+}
diff --git a/library/vendor/Zend/Filter/Callback.php b/library/vendor/Zend/Filter/Callback.php
new file mode 100644
index 0000000..0553edc
--- /dev/null
+++ b/library/vendor/Zend/Filter/Callback.php
@@ -0,0 +1,149 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Callback implements Zend_Filter_Interface
+{
+ /**
+ * Callback in a call_user_func format
+ *
+ * @var string|array
+ */
+ protected $_callback = null;
+
+ /**
+ * Default options to set for the filter
+ *
+ * @var mixed
+ */
+ protected $_options = null;
+
+ /**
+ * Constructor
+ *
+ * @param string|array $callback Callback in a call_user_func format
+ * @param mixed $options (Optional) Default options for this filter
+ */
+ public function __construct($options)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (!is_array($options) || !array_key_exists('callback', $options)) {
+ $options = func_get_args();
+ $temp['callback'] = array_shift($options);
+ if (!empty($options)) {
+ $temp['options'] = array_shift($options);
+ }
+
+ $options = $temp;
+ }
+
+ if (!array_key_exists('callback', $options)) {
+ throw new Zend_Filter_Exception('Missing callback to use');
+ }
+
+ $this->setCallback($options['callback']);
+ if (array_key_exists('options', $options)) {
+ $this->setOptions($options['options']);
+ }
+ }
+
+ /**
+ * Returns the set callback
+ *
+ * @return string|array Set callback
+ */
+ public function getCallback()
+ {
+ return $this->_callback;
+ }
+
+ /**
+ * Sets a new callback for this filter
+ *
+ * @param unknown_type $callback
+ * @return unknown
+ */
+ public function setCallback($callback, $options = null)
+ {
+ if (!is_callable($callback)) {
+ throw new Zend_Filter_Exception('Callback can not be accessed');
+ }
+
+ $this->_callback = $callback;
+ $this->setOptions($options);
+ return $this;
+ }
+
+ /**
+ * Returns the set default options
+ *
+ * @return mixed
+ */
+ public function getOptions()
+ {
+ return $this->_options;
+ }
+
+ /**
+ * Sets new default options to the callback filter
+ *
+ * @param mixed $options Default options to set
+ * @return Zend_Filter_Callback
+ */
+ public function setOptions($options)
+ {
+ $this->_options = $options;
+ return $this;
+ }
+
+ /**
+ * Calls the filter per callback
+ *
+ * @param mixed $value Options for the set callback
+ * @return mixed Result from the filter which was callbacked
+ */
+ public function filter($value)
+ {
+ $options = array();
+
+ if ($this->_options !== null) {
+ if (!is_array($this->_options)) {
+ $options = array($this->_options);
+ } else {
+ $options = $this->_options;
+ }
+ }
+
+ array_unshift($options, $value);
+
+ return call_user_func_array($this->_callback, $options);
+ }
+}
diff --git a/library/vendor/Zend/Filter/Compress.php b/library/vendor/Zend/Filter/Compress.php
new file mode 100644
index 0000000..7502966
--- /dev/null
+++ b/library/vendor/Zend/Filter/Compress.php
@@ -0,0 +1,192 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * Compresses a given string
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Compress implements Zend_Filter_Interface
+{
+ /**
+ * Compression adapter
+ */
+ protected $_adapter = 'Gz';
+
+ /**
+ * Compression adapter constructor options
+ */
+ protected $_adapterOptions = array();
+
+ /**
+ * Class constructor
+ *
+ * @param string|array $options (Optional) Options to set
+ */
+ public function __construct($options = null)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ }
+ if (is_string($options)) {
+ $this->setAdapter($options);
+ } elseif ($options instanceof Zend_Filter_Compress_CompressInterface) {
+ $this->setAdapter($options);
+ } elseif (is_array($options)) {
+ $this->setOptions($options);
+ }
+ }
+
+ /**
+ * Set filter setate
+ *
+ * @param array $options
+ * @return Zend_Filter_Compress
+ */
+ public function setOptions(array $options)
+ {
+ foreach ($options as $key => $value) {
+ if ($key == 'options') {
+ $key = 'adapterOptions';
+ }
+ $method = 'set' . ucfirst($key);
+ if (method_exists($this, $method)) {
+ $this->$method($value);
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Returns the current adapter, instantiating it if necessary
+ *
+ * @return string
+ */
+ public function getAdapter()
+ {
+ if ($this->_adapter instanceof Zend_Filter_Compress_CompressInterface) {
+ return $this->_adapter;
+ }
+
+ $adapter = $this->_adapter;
+ $options = $this->getAdapterOptions();
+ if (!class_exists($adapter)) {
+ if (Zend_Loader::isReadable('Zend/Filter/Compress/' . ucfirst($adapter) . '.php')) {
+ $adapter = 'Zend_Filter_Compress_' . ucfirst($adapter);
+ }
+ Zend_Loader::loadClass($adapter);
+ }
+
+ $this->_adapter = new $adapter($options);
+ if (!$this->_adapter instanceof Zend_Filter_Compress_CompressInterface) {
+ throw new Zend_Filter_Exception("Compression adapter '" . $adapter . "' does not implement Zend_Filter_Compress_CompressInterface");
+ }
+ return $this->_adapter;
+ }
+
+ /**
+ * Retrieve adapter name
+ *
+ * @return string
+ */
+ public function getAdapterName()
+ {
+ return $this->getAdapter()->toString();
+ }
+
+ /**
+ * Sets compression adapter
+ *
+ * @param string|Zend_Filter_Compress_CompressInterface $adapter Adapter to use
+ * @return Zend_Filter_Compress
+ */
+ public function setAdapter($adapter)
+ {
+ if ($adapter instanceof Zend_Filter_Compress_CompressInterface) {
+ $this->_adapter = $adapter;
+ return $this;
+ }
+ if (!is_string($adapter)) {
+ throw new Zend_Filter_Exception('Invalid adapter provided; must be string or instance of Zend_Filter_Compress_CompressInterface');
+ }
+ $this->_adapter = $adapter;
+
+ return $this;
+ }
+
+ /**
+ * Retrieve adapter options
+ *
+ * @return array
+ */
+ public function getAdapterOptions()
+ {
+ return $this->_adapterOptions;
+ }
+
+ /**
+ * Set adapter options
+ *
+ * @param array $options
+ * @return void
+ */
+ public function setAdapterOptions(array $options)
+ {
+ $this->_adapterOptions = $options;
+ return $this;
+ }
+
+ /**
+ * Calls adapter methods
+ *
+ * @param string $method Method to call
+ * @param string|array $options Options for this method
+ */
+ public function __call($method, $options)
+ {
+ $adapter = $this->getAdapter();
+ if (!method_exists($adapter, $method)) {
+ throw new Zend_Filter_Exception("Unknown method '{$method}'");
+ }
+
+ return call_user_func_array(array($adapter, $method), $options);
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Compresses the content $value with the defined settings
+ *
+ * @param string $value Content to compress
+ * @return string The compressed content
+ */
+ public function filter($value)
+ {
+ return $this->getAdapter()->compress($value);
+ }
+}
diff --git a/library/vendor/Zend/Filter/Compress/Bz2.php b/library/vendor/Zend/Filter/Compress/Bz2.php
new file mode 100644
index 0000000..d1aab17
--- /dev/null
+++ b/library/vendor/Zend/Filter/Compress/Bz2.php
@@ -0,0 +1,181 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Compress_CompressAbstract
+ */
+
+/**
+ * Compression adapter for Bz2
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Compress_Bz2 extends Zend_Filter_Compress_CompressAbstract
+{
+ /**
+ * Compression Options
+ * array(
+ * 'blocksize' => Blocksize to use from 0-9
+ * 'archive' => Archive to use
+ * )
+ *
+ * @var array
+ */
+ protected $_options = array(
+ 'blocksize' => 4,
+ 'archive' => null,
+ );
+
+ /**
+ * Class constructor
+ *
+ * @param array|Zend_Config $options (Optional) Options to set
+ */
+ public function __construct($options = null)
+ {
+ if (!extension_loaded('bz2')) {
+ throw new Zend_Filter_Exception('This filter needs the bz2 extension');
+ }
+ parent::__construct($options);
+ }
+
+ /**
+ * Returns the set blocksize
+ *
+ * @return integer
+ */
+ public function getBlocksize()
+ {
+ return $this->_options['blocksize'];
+ }
+
+ /**
+ * Sets a new blocksize
+ *
+ * @param integer $level
+ * @return Zend_Filter_Compress_Bz2
+ */
+ public function setBlocksize($blocksize)
+ {
+ if (($blocksize < 0) || ($blocksize > 9)) {
+ throw new Zend_Filter_Exception('Blocksize must be between 0 and 9');
+ }
+
+ $this->_options['blocksize'] = (int) $blocksize;
+ return $this;
+ }
+
+ /**
+ * Returns the set archive
+ *
+ * @return string
+ */
+ public function getArchive()
+ {
+ return $this->_options['archive'];
+ }
+
+ /**
+ * Sets the archive to use for de-/compression
+ *
+ * @param string $archive Archive to use
+ * @return Zend_Filter_Compress_Bz2
+ */
+ public function setArchive($archive)
+ {
+ $this->_options['archive'] = (string) $archive;
+ return $this;
+ }
+
+ /**
+ * Compresses the given content
+ *
+ * @param string $content
+ * @return string
+ */
+ public function compress($content)
+ {
+ $archive = $this->getArchive();
+ if (!empty($archive)) {
+ $file = bzopen($archive, 'w');
+ if (!$file) {
+ throw new Zend_Filter_Exception("Error opening the archive '" . $archive . "'");
+ }
+
+ bzwrite($file, $content);
+ bzclose($file);
+ $compressed = true;
+ } else {
+ $compressed = bzcompress($content, $this->getBlocksize());
+ }
+
+ if (is_int($compressed)) {
+ throw new Zend_Filter_Exception('Error during compression');
+ }
+
+ return $compressed;
+ }
+
+ /**
+ * Decompresses the given content
+ *
+ * @param string $content
+ * @return string
+ */
+ public function decompress($content)
+ {
+ $archive = $this->getArchive();
+ if (@file_exists($content)) {
+ $archive = $content;
+ }
+
+ if (@file_exists($archive)) {
+ $file = bzopen($archive, 'r');
+ if (!$file) {
+ throw new Zend_Filter_Exception("Error opening the archive '" . $content . "'");
+ }
+
+ $compressed = bzread($file);
+ bzclose($file);
+ } else {
+ $compressed = bzdecompress($content);
+ }
+
+ if (is_int($compressed)) {
+ throw new Zend_Filter_Exception('Error during decompression');
+ }
+
+ return $compressed;
+ }
+
+ /**
+ * Returns the adapter name
+ *
+ * @return string
+ */
+ public function toString()
+ {
+ return 'Bz2';
+ }
+}
diff --git a/library/vendor/Zend/Filter/Compress/CompressAbstract.php b/library/vendor/Zend/Filter/Compress/CompressAbstract.php
new file mode 100644
index 0000000..4b0813c
--- /dev/null
+++ b/library/vendor/Zend/Filter/Compress/CompressAbstract.php
@@ -0,0 +1,88 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Compress_CompressInterface
+ */
+
+/**
+ * Abstract compression adapter
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Filter_Compress_CompressAbstract implements Zend_Filter_Compress_CompressInterface
+{
+ /**
+ * Class constructor
+ *
+ * @param array|Zend_Config $options (Optional) Options to set
+ */
+ public function __construct($options = null)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ }
+
+ if (is_array($options)) {
+ $this->setOptions($options);
+ }
+ }
+
+ /**
+ * Returns one or all set options
+ *
+ * @param string $option (Optional) Option to return
+ * @return mixed
+ */
+ public function getOptions($option = null)
+ {
+ if ($option === null) {
+ return $this->_options;
+ }
+
+ if (!array_key_exists($option, $this->_options)) {
+ return null;
+ }
+
+ return $this->_options[$option];
+ }
+
+ /**
+ * Sets all or one option
+ *
+ * @param array $options
+ * @return Zend_Filter_Compress_Bz2
+ */
+ public function setOptions(array $options)
+ {
+ foreach ($options as $key => $option) {
+ $method = 'set' . $key;
+ if (method_exists($this, $method)) {
+ $this->$method($option);
+ }
+ }
+
+ return $this;
+ }
+}
diff --git a/library/vendor/Zend/Filter/Compress/CompressInterface.php b/library/vendor/Zend/Filter/Compress/CompressInterface.php
new file mode 100644
index 0000000..75f0a40
--- /dev/null
+++ b/library/vendor/Zend/Filter/Compress/CompressInterface.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Compression interface
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Filter_Compress_CompressInterface
+{
+ /**
+ * Compresses $value with the defined settings
+ *
+ * @param string $value Data to compress
+ * @return string The compressed data
+ */
+ public function compress($value);
+
+ /**
+ * Decompresses $value with the defined settings
+ *
+ * @param string $value Data to decompress
+ * @return string The decompressed data
+ */
+ public function decompress($value);
+
+ /**
+ * Return the adapter name
+ *
+ * @return string
+ */
+ public function toString();
+}
diff --git a/library/vendor/Zend/Filter/Compress/Gz.php b/library/vendor/Zend/Filter/Compress/Gz.php
new file mode 100644
index 0000000..e799a90
--- /dev/null
+++ b/library/vendor/Zend/Filter/Compress/Gz.php
@@ -0,0 +1,220 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Compress_CompressAbstract
+ */
+
+/**
+ * Compression adapter for Gzip (ZLib)
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Compress_Gz extends Zend_Filter_Compress_CompressAbstract
+{
+ /**
+ * Compression Options
+ * array(
+ * 'level' => Compression level 0-9
+ * 'mode' => Compression mode, can be 'compress', 'deflate'
+ * 'archive' => Archive to use
+ * )
+ *
+ * @var array
+ */
+ protected $_options = array(
+ 'level' => 9,
+ 'mode' => 'compress',
+ 'archive' => null,
+ );
+
+ /**
+ * Class constructor
+ *
+ * @param array|Zend_Config|null $options (Optional) Options to set
+ */
+ public function __construct($options = null)
+ {
+ if (!extension_loaded('zlib')) {
+ throw new Zend_Filter_Exception('This filter needs the zlib extension');
+ }
+ parent::__construct($options);
+ }
+
+ /**
+ * Returns the set compression level
+ *
+ * @return integer
+ */
+ public function getLevel()
+ {
+ return $this->_options['level'];
+ }
+
+ /**
+ * Sets a new compression level
+ *
+ * @param integer $level
+ * @return Zend_Filter_Compress_Gz
+ */
+ public function setLevel($level)
+ {
+ if (($level < 0) || ($level > 9)) {
+ throw new Zend_Filter_Exception('Level must be between 0 and 9');
+ }
+
+ $this->_options['level'] = (int) $level;
+ return $this;
+ }
+
+ /**
+ * Returns the set compression mode
+ *
+ * @return string
+ */
+ public function getMode()
+ {
+ return $this->_options['mode'];
+ }
+
+ /**
+ * Sets a new compression mode
+ *
+ * @param string $mode Supported are 'compress', 'deflate' and 'file'
+ */
+ public function setMode($mode)
+ {
+ if (($mode != 'compress') && ($mode != 'deflate')) {
+ throw new Zend_Filter_Exception('Given compression mode not supported');
+ }
+
+ $this->_options['mode'] = $mode;
+ return $this;
+ }
+
+ /**
+ * Returns the set archive
+ *
+ * @return string
+ */
+ public function getArchive()
+ {
+ return $this->_options['archive'];
+ }
+
+ /**
+ * Sets the archive to use for de-/compression
+ *
+ * @param string $archive Archive to use
+ * @return Zend_Filter_Compress_Gz
+ */
+ public function setArchive($archive)
+ {
+ $this->_options['archive'] = (string) $archive;
+ return $this;
+ }
+
+ /**
+ * Compresses the given content
+ *
+ * @param string $content
+ * @return string
+ */
+ public function compress($content)
+ {
+ $archive = $this->getArchive();
+ if (!empty($archive)) {
+ $file = gzopen($archive, 'w' . $this->getLevel());
+ if (!$file) {
+ throw new Zend_Filter_Exception("Error opening the archive '" . $this->_options['archive'] . "'");
+ }
+
+ gzwrite($file, $content);
+ gzclose($file);
+ $compressed = true;
+ } else if ($this->_options['mode'] == 'deflate') {
+ $compressed = gzdeflate($content, $this->getLevel());
+ } else {
+ $compressed = gzcompress($content, $this->getLevel());
+ }
+
+ if (!$compressed) {
+ throw new Zend_Filter_Exception('Error during compression');
+ }
+
+ return $compressed;
+ }
+
+ /**
+ * Decompresses the given content
+ *
+ * @param string $content
+ * @return string
+ */
+ public function decompress($content)
+ {
+ $archive = $this->getArchive();
+ $mode = $this->getMode();
+ if (@file_exists($content)) {
+ $archive = $content;
+ }
+
+ if (@file_exists($archive)) {
+ $handler = fopen($archive, "rb");
+ if (!$handler) {
+ throw new Zend_Filter_Exception("Error opening the archive '" . $archive . "'");
+ }
+
+ fseek($handler, -4, SEEK_END);
+ $packet = fread($handler, 4);
+ $bytes = unpack("V", $packet);
+ $size = end($bytes);
+ fclose($handler);
+
+ $file = gzopen($archive, 'r');
+ $compressed = gzread($file, $size);
+ gzclose($file);
+ } else if ($mode == 'deflate') {
+ $compressed = gzinflate($content);
+ } else {
+ $compressed = gzuncompress($content);
+ }
+
+ if (!$compressed) {
+ throw new Zend_Filter_Exception('Error during compression');
+ }
+
+ return $compressed;
+ }
+
+ /**
+ * Returns the adapter name
+ *
+ * @return string
+ */
+ public function toString()
+ {
+ return 'Gz';
+ }
+}
diff --git a/library/vendor/Zend/Filter/Compress/Lzf.php b/library/vendor/Zend/Filter/Compress/Lzf.php
new file mode 100644
index 0000000..15ecb47
--- /dev/null
+++ b/library/vendor/Zend/Filter/Compress/Lzf.php
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Compress_CompressInterface
+ */
+
+/**
+ * Compression adapter for Lzf
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Compress_Lzf implements Zend_Filter_Compress_CompressInterface
+{
+ /**
+ * Class constructor
+ */
+ public function __construct()
+ {
+ if (!extension_loaded('lzf')) {
+ throw new Zend_Filter_Exception('This filter needs the lzf extension');
+ }
+ }
+
+ /**
+ * Compresses the given content
+ *
+ * @param string $content
+ * @return string
+ */
+ public function compress($content)
+ {
+ $compressed = lzf_compress($content);
+ if (!$compressed) {
+ throw new Zend_Filter_Exception('Error during compression');
+ }
+
+ return $compressed;
+ }
+
+ /**
+ * Decompresses the given content
+ *
+ * @param string $content
+ * @return string
+ */
+ public function decompress($content)
+ {
+ $compressed = lzf_decompress($content);
+ if (!$compressed) {
+ throw new Zend_Filter_Exception('Error during compression');
+ }
+
+ return $compressed;
+ }
+
+ /**
+ * Returns the adapter name
+ *
+ * @return string
+ */
+ public function toString()
+ {
+ return 'Lzf';
+ }
+}
diff --git a/library/vendor/Zend/Filter/Compress/Rar.php b/library/vendor/Zend/Filter/Compress/Rar.php
new file mode 100644
index 0000000..7a76af7
--- /dev/null
+++ b/library/vendor/Zend/Filter/Compress/Rar.php
@@ -0,0 +1,243 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Compress_CompressAbstract
+ */
+
+/**
+ * Compression adapter for Rar
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Compress_Rar extends Zend_Filter_Compress_CompressAbstract
+{
+ /**
+ * Compression Options
+ * array(
+ * 'callback' => Callback for compression
+ * 'archive' => Archive to use
+ * 'password' => Password to use
+ * 'target' => Target to write the files to
+ * )
+ *
+ * @var array
+ */
+ protected $_options = array(
+ 'callback' => null,
+ 'archive' => null,
+ 'password' => null,
+ 'target' => '.',
+ );
+
+ /**
+ * Class constructor
+ *
+ * @param array $options (Optional) Options to set
+ */
+ public function __construct($options = null)
+ {
+ if (!extension_loaded('rar')) {
+ throw new Zend_Filter_Exception('This filter needs the rar extension');
+ }
+ parent::__construct($options);
+ }
+
+ /**
+ * Returns the set callback for compression
+ *
+ * @return string
+ */
+ public function getCallback()
+ {
+ return $this->_options['callback'];
+ }
+
+ /**
+ * Sets the callback to use
+ *
+ * @param string $callback
+ * @return Zend_Filter_Compress_Rar
+ */
+ public function setCallback($callback)
+ {
+ if (!is_callable($callback)) {
+ throw new Zend_Filter_Exception('Callback can not be accessed');
+ }
+
+ $this->_options['callback'] = $callback;
+ return $this;
+ }
+
+ /**
+ * Returns the set archive
+ *
+ * @return string
+ */
+ public function getArchive()
+ {
+ return $this->_options['archive'];
+ }
+
+ /**
+ * Sets the archive to use for de-/compression
+ *
+ * @param string $archive Archive to use
+ * @return Zend_Filter_Compress_Rar
+ */
+ public function setArchive($archive)
+ {
+ $archive = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $archive);
+ $this->_options['archive'] = (string) $archive;
+
+ return $this;
+ }
+
+ /**
+ * Returns the set password
+ *
+ * @return string
+ */
+ public function getPassword()
+ {
+ return $this->_options['password'];
+ }
+
+ /**
+ * Sets the password to use
+ *
+ * @param string $password
+ * @return Zend_Filter_Compress_Rar
+ */
+ public function setPassword($password)
+ {
+ $this->_options['password'] = (string) $password;
+ return $this;
+ }
+
+ /**
+ * Returns the set targetpath
+ *
+ * @return string
+ */
+ public function getTarget()
+ {
+ return $this->_options['target'];
+ }
+
+ /**
+ * Sets the targetpath to use
+ *
+ * @param string $target
+ * @return Zend_Filter_Compress_Rar
+ */
+ public function setTarget($target)
+ {
+ if (!file_exists(dirname($target))) {
+ throw new Zend_Filter_Exception("The directory '$target' does not exist");
+ }
+
+ $target = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $target);
+ $this->_options['target'] = (string) $target;
+ return $this;
+ }
+
+ /**
+ * Compresses the given content
+ *
+ * @param string|array $content
+ * @return string
+ */
+ public function compress($content)
+ {
+ $callback = $this->getCallback();
+ if ($callback === null) {
+ throw new Zend_Filter_Exception('No compression callback available');
+ }
+
+ $options = $this->getOptions();
+ unset($options['callback']);
+
+ $result = call_user_func($callback, $options, $content);
+ if ($result !== true) {
+ throw new Zend_Filter_Exception('Error compressing the RAR Archive');
+ }
+
+ return $this->getArchive();
+ }
+
+ /**
+ * Decompresses the given content
+ *
+ * @param string $content
+ * @return boolean
+ */
+ public function decompress($content)
+ {
+ $archive = $this->getArchive();
+ if (file_exists($content)) {
+ $archive = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, realpath($content));
+ } elseif (empty($archive) || !file_exists($archive)) {
+ throw new Zend_Filter_Exception('RAR Archive not found');
+ }
+
+ $password = $this->getPassword();
+ if ($password !== null) {
+ $archive = rar_open($archive, $password);
+ } else {
+ $archive = rar_open($archive);
+ }
+
+ if (!$archive) {
+ throw new Zend_Filter_Exception("Error opening the RAR Archive");
+ }
+
+ $target = $this->getTarget();
+ if (!is_dir($target)) {
+ $target = dirname($target);
+ }
+
+ $filelist = rar_list($archive);
+ if (!$filelist) {
+ throw new Zend_Filter_Exception("Error reading the RAR Archive");
+ }
+
+ foreach($filelist as $file) {
+ $file->extract($target);
+ }
+
+ rar_close($archive);
+ return true;
+ }
+
+ /**
+ * Returns the adapter name
+ *
+ * @return string
+ */
+ public function toString()
+ {
+ return 'Rar';
+ }
+}
diff --git a/library/vendor/Zend/Filter/Compress/Tar.php b/library/vendor/Zend/Filter/Compress/Tar.php
new file mode 100644
index 0000000..4359b64
--- /dev/null
+++ b/library/vendor/Zend/Filter/Compress/Tar.php
@@ -0,0 +1,234 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Compress_CompressAbstract
+ */
+
+/**
+ * Compression adapter for Tar
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Compress_Tar extends Zend_Filter_Compress_CompressAbstract
+{
+ /**
+ * Compression Options
+ * array(
+ * 'archive' => Archive to use
+ * 'target' => Target to write the files to
+ * )
+ *
+ * @var array
+ */
+ protected $_options = array(
+ 'archive' => null,
+ 'target' => '.',
+ 'mode' => null,
+ );
+
+ /**
+ * Class constructor
+ *
+ * @param array $options (Optional) Options to set
+ */
+ public function __construct($options = null)
+ {
+ if (!class_exists('Archive_Tar')) {
+ try {
+ Zend_Loader::loadClass('Archive_Tar');
+ } catch (Zend_Exception $e) {
+ throw new Zend_Filter_Exception('This filter needs PEARs Archive_Tar', 0, $e);
+ }
+ }
+
+ parent::__construct($options);
+ }
+
+ /**
+ * Returns the set archive
+ *
+ * @return string
+ */
+ public function getArchive()
+ {
+ return $this->_options['archive'];
+ }
+
+ /**
+ * Sets the archive to use for de-/compression
+ *
+ * @param string $archive Archive to use
+ * @return Zend_Filter_Compress_Tar
+ */
+ public function setArchive($archive)
+ {
+ $archive = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $archive);
+ $this->_options['archive'] = (string) $archive;
+
+ return $this;
+ }
+
+ /**
+ * Returns the set targetpath
+ *
+ * @return string
+ */
+ public function getTarget()
+ {
+ return $this->_options['target'];
+ }
+
+ /**
+ * Sets the targetpath to use
+ *
+ * @param string $target
+ * @return Zend_Filter_Compress_Tar
+ */
+ public function setTarget($target)
+ {
+ if (!file_exists(dirname($target))) {
+ throw new Zend_Filter_Exception("The directory '$target' does not exist");
+ }
+
+ $target = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $target);
+ $this->_options['target'] = (string) $target;
+ return $this;
+ }
+
+ /**
+ * Returns the set compression mode
+ */
+ public function getMode()
+ {
+ return $this->_options['mode'];
+ }
+
+ /**
+ * Compression mode to use
+ * Eighter Gz or Bz2
+ *
+ * @param string $mode
+ */
+ public function setMode($mode)
+ {
+ $mode = ucfirst(strtolower($mode));
+ if (($mode != 'Bz2') && ($mode != 'Gz')) {
+ throw new Zend_Filter_Exception("The mode '$mode' is unknown");
+ }
+
+ if (($mode == 'Bz2') && (!extension_loaded('bz2'))) {
+ throw new Zend_Filter_Exception('This mode needs the bz2 extension');
+ }
+
+ if (($mode == 'Gz') && (!extension_loaded('zlib'))) {
+ throw new Zend_Filter_Exception('This mode needs the zlib extension');
+ }
+ }
+
+ /**
+ * Compresses the given content
+ *
+ * @param string $content
+ * @return string
+ */
+ public function compress($content)
+ {
+ $archive = new Archive_Tar($this->getArchive(), $this->getMode());
+ if (!file_exists($content)) {
+ $file = $this->getTarget();
+ if (is_dir($file)) {
+ $file .= DIRECTORY_SEPARATOR . "tar.tmp";
+ }
+
+ $result = file_put_contents($file, $content);
+ if ($result === false) {
+ throw new Zend_Filter_Exception('Error creating the temporary file');
+ }
+
+ $content = $file;
+ }
+
+ if (is_dir($content)) {
+ // collect all file infos
+ foreach (new RecursiveIteratorIterator(
+ new RecursiveDirectoryIterator($content, RecursiveDirectoryIterator::KEY_AS_PATHNAME),
+ RecursiveIteratorIterator::SELF_FIRST
+ ) as $directory => $info
+ ) {
+ if ($info->isFile()) {
+ $file[] = $directory;
+ }
+ }
+
+ $content = $file;
+ }
+
+ $result = $archive->create($content);
+ if ($result === false) {
+ throw new Zend_Filter_Exception('Error creating the Tar archive');
+ }
+
+ return $this->getArchive();
+ }
+
+ /**
+ * Decompresses the given content
+ *
+ * @param string $content
+ * @return boolean
+ */
+ public function decompress($content)
+ {
+ $archive = $this->getArchive();
+ if (file_exists($content)) {
+ $archive = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, realpath($content));
+ } elseif (empty($archive) || !file_exists($archive)) {
+ throw new Zend_Filter_Exception('Tar Archive not found');
+ }
+
+ $archive = new Archive_Tar($archive, $this->getMode());
+ $target = $this->getTarget();
+ if (!is_dir($target)) {
+ $target = dirname($target);
+ }
+
+ $result = $archive->extract($target);
+ if ($result === false) {
+ throw new Zend_Filter_Exception('Error while extracting the Tar archive');
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns the adapter name
+ *
+ * @return string
+ */
+ public function toString()
+ {
+ return 'Tar';
+ }
+}
diff --git a/library/vendor/Zend/Filter/Compress/Zip.php b/library/vendor/Zend/Filter/Compress/Zip.php
new file mode 100644
index 0000000..055645d
--- /dev/null
+++ b/library/vendor/Zend/Filter/Compress/Zip.php
@@ -0,0 +1,343 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Compress_CompressAbstract
+ */
+
+/**
+ * Compression adapter for zip
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Compress_Zip extends Zend_Filter_Compress_CompressAbstract
+{
+ /**
+ * Compression Options
+ * array(
+ * 'archive' => Archive to use
+ * 'password' => Password to use
+ * 'target' => Target to write the files to
+ * )
+ *
+ * @var array
+ */
+ protected $_options = array(
+ 'archive' => null,
+ 'target' => null,
+ );
+
+ /**
+ * Class constructor
+ *
+ * @param string|array $options (Optional) Options to set
+ */
+ public function __construct($options = null)
+ {
+ if (!extension_loaded('zip')) {
+ throw new Zend_Filter_Exception('This filter needs the zip extension');
+ }
+ parent::__construct($options);
+ }
+
+ /**
+ * Returns the set archive
+ *
+ * @return string
+ */
+ public function getArchive()
+ {
+ return $this->_options['archive'];
+ }
+
+ /**
+ * Sets the archive to use for de-/compression
+ *
+ * @param string $archive Archive to use
+ * @return Zend_Filter_Compress_Rar
+ */
+ public function setArchive($archive)
+ {
+ $archive = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $archive);
+ $this->_options['archive'] = (string) $archive;
+
+ return $this;
+ }
+
+ /**
+ * Returns the set targetpath
+ *
+ * @return string
+ */
+ public function getTarget()
+ {
+ return $this->_options['target'];
+ }
+
+ /**
+ * Sets the target to use
+ *
+ * @param string $target
+ * @return Zend_Filter_Compress_Rar
+ */
+ public function setTarget($target)
+ {
+ if (!file_exists(dirname($target))) {
+ throw new Zend_Filter_Exception("The directory '$target' does not exist");
+ }
+
+ $target = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, $target);
+ $this->_options['target'] = (string) $target;
+ return $this;
+ }
+
+ /**
+ * Compresses the given content
+ *
+ * @param string $content
+ * @return string Compressed archive
+ */
+ public function compress($content)
+ {
+ $zip = new ZipArchive();
+ $res = $zip->open($this->getArchive(), ZipArchive::CREATE | ZipArchive::OVERWRITE);
+
+ if ($res !== true) {
+ throw new Zend_Filter_Exception($this->_errorString($res));
+ }
+
+ if (file_exists($content)) {
+ $content = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, realpath($content));
+ $basename = substr($content, strrpos($content, DIRECTORY_SEPARATOR) + 1);
+ if (is_dir($content)) {
+ $index = strrpos($content, DIRECTORY_SEPARATOR) + 1;
+ $content .= DIRECTORY_SEPARATOR;
+ $stack = array($content);
+ while (!empty($stack)) {
+ $current = array_pop($stack);
+ $files = array();
+
+ $dir = dir($current);
+ while (false !== ($node = $dir->read())) {
+ if (($node == '.') || ($node == '..')) {
+ continue;
+ }
+
+ if (is_dir($current . $node)) {
+ array_push($stack, $current . $node . DIRECTORY_SEPARATOR);
+ }
+
+ if (is_file($current . $node)) {
+ $files[] = $node;
+ }
+ }
+
+ $local = substr($current, $index);
+ $zip->addEmptyDir(substr($local, 0, -1));
+
+ foreach ($files as $file) {
+ $zip->addFile($current . $file, $local . $file);
+ if ($res !== true) {
+ throw new Zend_Filter_Exception($this->_errorString($res));
+ }
+ }
+ }
+ } else {
+ $res = $zip->addFile($content, $basename);
+ if ($res !== true) {
+ throw new Zend_Filter_Exception($this->_errorString($res));
+ }
+ }
+ } else {
+ $file = $this->getTarget();
+ if (!is_dir($file)) {
+ $file = basename($file);
+ } else {
+ $file = "zip.tmp";
+ }
+
+ $res = $zip->addFromString($file, $content);
+ if ($res !== true) {
+ throw new Zend_Filter_Exception($this->_errorString($res));
+ }
+ }
+
+ $zip->close();
+ return $this->_options['archive'];
+ }
+
+ /**
+ * Decompresses the given content
+ *
+ * @param string $content
+ * @return string
+ */
+ public function decompress($content)
+ {
+ $archive = $this->getArchive();
+ if (file_exists($content)) {
+ $archive = str_replace(array('/', '\\'), DIRECTORY_SEPARATOR, realpath($content));
+ } elseif (empty($archive) || !file_exists($archive)) {
+ throw new Zend_Filter_Exception('ZIP Archive not found');
+ }
+
+ $zip = new ZipArchive();
+ $res = $zip->open($archive);
+
+ $target = $this->getTarget();
+
+ if (!empty($target) && !is_dir($target)) {
+ $target = dirname($target);
+ }
+
+ if (!empty($target)) {
+ $target = rtrim($target, '/\\') . DIRECTORY_SEPARATOR;
+ }
+
+ if (empty($target) || !is_dir($target)) {
+ throw new Zend_Filter_Exception('No target for ZIP decompression set');
+ }
+
+ if ($res !== true) {
+ throw new Zend_Filter_Exception($this->_errorString($res));
+ }
+
+ if (version_compare(PHP_VERSION, '5.2.8', '<')) {
+ for ($i = 0; $i < $zip->numFiles; $i++) {
+ $statIndex = $zip->statIndex($i);
+ $currName = $statIndex['name'];
+ if (($currName[0] == '/') ||
+ (substr($currName, 0, 2) == '..') ||
+ (substr($currName, 0, 4) == './..')
+ )
+ {
+ throw new Zend_Filter_Exception('Upward directory traversal was detected inside ' . $archive
+ . ' please use PHP 5.2.8 or greater to take advantage of path resolution features of '
+ . 'the zip extension in this decompress() method.'
+ );
+ }
+ }
+ }
+
+ $res = @$zip->extractTo($target);
+ if ($res !== true) {
+ throw new Zend_Filter_Exception($this->_errorString($res));
+ }
+
+ $zip->close();
+ return $target;
+ }
+
+ /**
+ * Returns the proper string based on the given error constant
+ *
+ * @param string $error
+ */
+ protected function _errorString($error)
+ {
+ switch($error) {
+ case ZipArchive::ER_MULTIDISK :
+ return 'Multidisk ZIP Archives not supported';
+
+ case ZipArchive::ER_RENAME :
+ return 'Failed to rename the temporary file for ZIP';
+
+ case ZipArchive::ER_CLOSE :
+ return 'Failed to close the ZIP Archive';
+
+ case ZipArchive::ER_SEEK :
+ return 'Failure while seeking the ZIP Archive';
+
+ case ZipArchive::ER_READ :
+ return 'Failure while reading the ZIP Archive';
+
+ case ZipArchive::ER_WRITE :
+ return 'Failure while writing the ZIP Archive';
+
+ case ZipArchive::ER_CRC :
+ return 'CRC failure within the ZIP Archive';
+
+ case ZipArchive::ER_ZIPCLOSED :
+ return 'ZIP Archive already closed';
+
+ case ZipArchive::ER_NOENT :
+ return 'No such file within the ZIP Archive';
+
+ case ZipArchive::ER_EXISTS :
+ return 'ZIP Archive already exists';
+
+ case ZipArchive::ER_OPEN :
+ return 'Can not open ZIP Archive';
+
+ case ZipArchive::ER_TMPOPEN :
+ return 'Failure creating temporary ZIP Archive';
+
+ case ZipArchive::ER_ZLIB :
+ return 'ZLib Problem';
+
+ case ZipArchive::ER_MEMORY :
+ return 'Memory allocation problem while working on a ZIP Archive';
+
+ case ZipArchive::ER_CHANGED :
+ return 'ZIP Entry has been changed';
+
+ case ZipArchive::ER_COMPNOTSUPP :
+ return 'Compression method not supported within ZLib';
+
+ case ZipArchive::ER_EOF :
+ return 'Premature EOF within ZIP Archive';
+
+ case ZipArchive::ER_INVAL :
+ return 'Invalid argument for ZLIB';
+
+ case ZipArchive::ER_NOZIP :
+ return 'Given file is no zip archive';
+
+ case ZipArchive::ER_INTERNAL :
+ return 'Internal error while working on a ZIP Archive';
+
+ case ZipArchive::ER_INCONS :
+ return 'Inconsistent ZIP archive';
+
+ case ZipArchive::ER_REMOVE :
+ return 'Can not remove ZIP Archive';
+
+ case ZipArchive::ER_DELETED :
+ return 'ZIP Entry has been deleted';
+
+ default :
+ return 'Unknown error within ZIP Archive';
+ }
+ }
+
+ /**
+ * Returns the adapter name
+ *
+ * @return string
+ */
+ public function toString()
+ {
+ return 'Zip';
+ }
+}
diff --git a/library/vendor/Zend/Filter/Decompress.php b/library/vendor/Zend/Filter/Decompress.php
new file mode 100644
index 0000000..553c677
--- /dev/null
+++ b/library/vendor/Zend/Filter/Decompress.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Compress
+ */
+
+/**
+ * Decompresses a given string
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Decompress extends Zend_Filter_Compress
+{
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Decompresses the content $value with the defined settings
+ *
+ * @param string $value Content to decompress
+ * @return string The decompressed content
+ */
+ public function filter($value)
+ {
+ return $this->getAdapter()->decompress($value);
+ }
+}
diff --git a/library/vendor/Zend/Filter/Decrypt.php b/library/vendor/Zend/Filter/Decrypt.php
new file mode 100644
index 0000000..a17dc46
--- /dev/null
+++ b/library/vendor/Zend/Filter/Decrypt.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Encrypt
+ */
+
+/**
+ * Decrypts a given string
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Decrypt extends Zend_Filter_Encrypt
+{
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Decrypts the content $value with the defined settings
+ *
+ * @param string $value Content to decrypt
+ * @return string The decrypted content
+ */
+ public function filter($value)
+ {
+ return $this->_adapter->decrypt($value);
+ }
+}
diff --git a/library/vendor/Zend/Filter/Digits.php b/library/vendor/Zend/Filter/Digits.php
new file mode 100644
index 0000000..83881d7
--- /dev/null
+++ b/library/vendor/Zend/Filter/Digits.php
@@ -0,0 +1,81 @@
+<?php
+
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Digits implements Zend_Filter_Interface
+{
+ /**
+ * Is PCRE is compiled with UTF-8 and Unicode support
+ *
+ * @var mixed
+ **/
+ protected static $_unicodeEnabled;
+
+ /**
+ * Class constructor
+ *
+ * Checks if PCRE is compiled with UTF-8 and Unicode support
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ if (null === self::$_unicodeEnabled) {
+ self::$_unicodeEnabled = (@preg_match('/\pL/u', 'a')) ? true : false;
+ }
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Returns the string $value, removing all but digit characters
+ *
+ * @param string $value
+ * @return string
+ */
+ public function filter($value)
+ {
+ if (!self::$_unicodeEnabled) {
+ // POSIX named classes are not supported, use alternative 0-9 match
+ $pattern = '/[^0-9]/';
+ } else if (extension_loaded('mbstring')) {
+ // Filter for the value with mbstring
+ $pattern = '/[^[:digit:]]/';
+ } else {
+ // Filter for the value without mbstring
+ $pattern = '/[\p{^N}]/';
+ }
+
+ return preg_replace($pattern, '', (string) $value);
+ }
+}
diff --git a/library/vendor/Zend/Filter/Dir.php b/library/vendor/Zend/Filter/Dir.php
new file mode 100644
index 0000000..96b180f
--- /dev/null
+++ b/library/vendor/Zend/Filter/Dir.php
@@ -0,0 +1,49 @@
+<?php
+
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Dir implements Zend_Filter_Interface
+{
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Returns dirname($value)
+ *
+ * @param string $value
+ * @return string
+ */
+ public function filter($value)
+ {
+ return dirname((string) $value);
+ }
+}
diff --git a/library/vendor/Zend/Filter/Encrypt.php b/library/vendor/Zend/Filter/Encrypt.php
new file mode 100644
index 0000000..0dca4c1
--- /dev/null
+++ b/library/vendor/Zend/Filter/Encrypt.php
@@ -0,0 +1,134 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * @see Zend_Loader
+ */
+
+/**
+ * Encrypts a given string
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Encrypt implements Zend_Filter_Interface
+{
+ /**
+ * Encryption adapter
+ */
+ protected $_adapter;
+
+ /**
+ * Class constructor
+ *
+ * @param string|array $options (Optional) Options to set, if null mcrypt is used
+ */
+ public function __construct($options = null)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ }
+
+ $this->setAdapter($options);
+ }
+
+ /**
+ * Returns the name of the set adapter
+ *
+ * @return string
+ */
+ public function getAdapter()
+ {
+ return $this->_adapter->toString();
+ }
+
+ /**
+ * Sets new encryption options
+ *
+ * @param string|array $options (Optional) Encryption options
+ * @return Zend_Filter_Encrypt
+ */
+ public function setAdapter($options = null)
+ {
+ if (is_string($options)) {
+ $adapter = $options;
+ } else if (isset($options['adapter'])) {
+ $adapter = $options['adapter'];
+ unset($options['adapter']);
+ } else {
+ $adapter = 'Mcrypt';
+ }
+
+ if (!is_array($options)) {
+ $options = array();
+ }
+
+ if (Zend_Loader::isReadable('Zend/Filter/Encrypt/' . ucfirst($adapter). '.php')) {
+ $adapter = 'Zend_Filter_Encrypt_' . ucfirst($adapter);
+ }
+
+ if (!class_exists($adapter)) {
+ Zend_Loader::loadClass($adapter);
+ }
+
+ $this->_adapter = new $adapter($options);
+ if (!$this->_adapter instanceof Zend_Filter_Encrypt_Interface) {
+ throw new Zend_Filter_Exception("Encoding adapter '" . $adapter . "' does not implement Zend_Filter_Encrypt_Interface");
+ }
+
+ return $this;
+ }
+
+ /**
+ * Calls adapter methods
+ *
+ * @param string $method Method to call
+ * @param string|array $options Options for this method
+ */
+ public function __call($method, $options)
+ {
+ $part = substr($method, 0, 3);
+ if ((($part != 'get') and ($part != 'set')) or !method_exists($this->_adapter, $method)) {
+ throw new Zend_Filter_Exception("Unknown method '{$method}'");
+ }
+
+ return call_user_func_array(array($this->_adapter, $method), $options);
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Encrypts the content $value with the defined settings
+ *
+ * @param string $value Content to encrypt
+ * @return string The encrypted content
+ */
+ public function filter($value)
+ {
+ return $this->_adapter->encrypt($value);
+ }
+}
diff --git a/library/vendor/Zend/Filter/Encrypt/Interface.php b/library/vendor/Zend/Filter/Encrypt/Interface.php
new file mode 100644
index 0000000..1510e7f
--- /dev/null
+++ b/library/vendor/Zend/Filter/Encrypt/Interface.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Encryption interface
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Filter_Encrypt_Interface
+{
+ /**
+ * Encrypts $value with the defined settings
+ *
+ * @param string $value Data to encrypt
+ * @return string The encrypted data
+ */
+ public function encrypt($value);
+
+ /**
+ * Decrypts $value with the defined settings
+ *
+ * @param string $value Data to decrypt
+ * @return string The decrypted data
+ */
+ public function decrypt($value);
+}
diff --git a/library/vendor/Zend/Filter/Encrypt/Mcrypt.php b/library/vendor/Zend/Filter/Encrypt/Mcrypt.php
new file mode 100644
index 0000000..ee7a45b
--- /dev/null
+++ b/library/vendor/Zend/Filter/Encrypt/Mcrypt.php
@@ -0,0 +1,352 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Encrypt_Interface
+ */
+
+/** @see Zend_Crypt_Math */
+
+/**
+ * Encryption adapter for mcrypt
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Encrypt_Mcrypt implements Zend_Filter_Encrypt_Interface
+{
+ /**
+ * Definitions for encryption
+ * array(
+ * 'key' => encryption key string
+ * 'algorithm' => algorithm to use
+ * 'algorithm_directory' => directory where to find the algorithm
+ * 'mode' => encryption mode to use
+ * 'modedirectory' => directory where to find the mode
+ * )
+ */
+ protected $_encryption = array(
+ 'key' => 'ZendFramework',
+ 'algorithm' => 'blowfish',
+ 'algorithm_directory' => '',
+ 'mode' => 'cbc',
+ 'mode_directory' => '',
+ 'vector' => null,
+ 'salt' => false
+ );
+
+ /**
+ * Internal compression
+ *
+ * @var array
+ */
+ protected $_compression;
+
+ protected static $_srandCalled = false;
+
+ /**
+ * Class constructor
+ *
+ * @param string|array|Zend_Config $options Cryption Options
+ */
+ public function __construct($options)
+ {
+ if (!extension_loaded('mcrypt')) {
+ throw new Zend_Filter_Exception('This filter needs the mcrypt extension');
+ }
+
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } elseif (is_string($options)) {
+ $options = array('key' => $options);
+ } elseif (!is_array($options)) {
+ throw new Zend_Filter_Exception('Invalid options argument provided to filter');
+ }
+
+ if (array_key_exists('compression', $options)) {
+ $this->setCompression($options['compression']);
+ unset($options['compress']);
+ }
+
+ $this->setEncryption($options);
+ }
+
+ /**
+ * Returns the set encryption options
+ *
+ * @return array
+ */
+ public function getEncryption()
+ {
+ return $this->_encryption;
+ }
+
+ /**
+ * Sets new encryption options
+ *
+ * @param string|array $options Encryption options
+ * @return Zend_Filter_File_Encryption
+ */
+ public function setEncryption($options)
+ {
+ if (is_string($options)) {
+ $options = array('key' => $options);
+ }
+
+ if (!is_array($options)) {
+ throw new Zend_Filter_Exception('Invalid options argument provided to filter');
+ }
+
+ $options = $options + $this->getEncryption();
+ $algorithms = mcrypt_list_algorithms($options['algorithm_directory']);
+ if (!in_array($options['algorithm'], $algorithms)) {
+ throw new Zend_Filter_Exception("The algorithm '{$options['algorithm']}' is not supported");
+ }
+
+ $modes = mcrypt_list_modes($options['mode_directory']);
+ if (!in_array($options['mode'], $modes)) {
+ throw new Zend_Filter_Exception("The mode '{$options['mode']}' is not supported");
+ }
+
+ if (!mcrypt_module_self_test($options['algorithm'], $options['algorithm_directory'])) {
+ throw new Zend_Filter_Exception('The given algorithm can not be used due an internal mcrypt problem');
+ }
+
+ if (!isset($options['vector'])) {
+ $options['vector'] = null;
+ }
+
+ $this->_encryption = $options;
+ $this->setVector($options['vector']);
+
+ return $this;
+ }
+
+ /**
+ * Returns the set vector
+ *
+ * @return string
+ */
+ public function getVector()
+ {
+ return $this->_encryption['vector'];
+ }
+
+ /**
+ * Sets the initialization vector
+ *
+ * @param string $vector (Optional) Vector to set
+ * @return Zend_Filter_Encrypt_Mcrypt
+ */
+ public function setVector($vector = null)
+ {
+ $cipher = $this->_openCipher();
+ $size = mcrypt_enc_get_iv_size($cipher);
+ if (empty($vector)) {
+ $this->_srand();
+ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' && version_compare(PHP_VERSION, '5.3.0', '<')) {
+ $method = MCRYPT_RAND;
+ } else {
+ if (file_exists('/dev/urandom') || (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')) {
+ $method = MCRYPT_DEV_URANDOM;
+ } elseif (file_exists('/dev/random')) {
+ $method = MCRYPT_DEV_RANDOM;
+ } else {
+ $method = MCRYPT_RAND;
+ }
+ }
+ $vector = mcrypt_create_iv($size, $method);
+ } else if (strlen($vector) != $size) {
+ throw new Zend_Filter_Exception('The given vector has a wrong size for the set algorithm');
+ }
+
+ $this->_encryption['vector'] = $vector;
+ $this->_closeCipher($cipher);
+
+ return $this;
+ }
+
+ /**
+ * Returns the compression
+ *
+ * @return array
+ */
+ public function getCompression()
+ {
+ return $this->_compression;
+ }
+
+ /**
+ * Sets a internal compression for values to encrypt
+ *
+ * @param string|array $compression
+ * @return Zend_Filter_Encrypt_Mcrypt
+ */
+ public function setCompression($compression)
+ {
+ if (is_string($this->_compression)) {
+ $compression = array('adapter' => $compression);
+ }
+
+ $this->_compression = $compression;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Encrypts $value with the defined settings
+ *
+ * @param string $value The content to encrypt
+ * @return string The encrypted content
+ */
+ public function encrypt($value)
+ {
+ // compress prior to encryption
+ if (!empty($this->_compression)) {
+ $compress = new Zend_Filter_Compress($this->_compression);
+ $value = $compress->filter($value);
+ }
+
+ $cipher = $this->_openCipher();
+ $this->_initCipher($cipher);
+ $encrypted = mcrypt_generic($cipher, $value);
+ mcrypt_generic_deinit($cipher);
+ $this->_closeCipher($cipher);
+
+ return $encrypted;
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Decrypts $value with the defined settings
+ *
+ * @param string $value Content to decrypt
+ * @return string The decrypted content
+ */
+ public function decrypt($value)
+ {
+ $cipher = $this->_openCipher();
+ $this->_initCipher($cipher);
+ $decrypted = mdecrypt_generic($cipher, $value);
+ mcrypt_generic_deinit($cipher);
+ $this->_closeCipher($cipher);
+
+ // decompress after decryption
+ if (!empty($this->_compression)) {
+ $decompress = new Zend_Filter_Decompress($this->_compression);
+ $decrypted = $decompress->filter($decrypted);
+ }
+
+ return $decrypted;
+ }
+
+ /**
+ * Returns the adapter name
+ *
+ * @return string
+ */
+ public function toString()
+ {
+ return 'Mcrypt';
+ }
+
+ /**
+ * Open a cipher
+ *
+ * @throws Zend_Filter_Exception When the cipher can not be opened
+ * @return resource Returns the opened cipher
+ */
+ protected function _openCipher()
+ {
+ $cipher = mcrypt_module_open(
+ $this->_encryption['algorithm'],
+ $this->_encryption['algorithm_directory'],
+ $this->_encryption['mode'],
+ $this->_encryption['mode_directory']);
+
+ if ($cipher === false) {
+ throw new Zend_Filter_Exception('Mcrypt can not be opened with your settings');
+ }
+
+ return $cipher;
+ }
+
+ /**
+ * Close a cipher
+ *
+ * @param resource $cipher Cipher to close
+ * @return Zend_Filter_Encrypt_Mcrypt
+ */
+ protected function _closeCipher($cipher)
+ {
+ mcrypt_module_close($cipher);
+
+ return $this;
+ }
+
+ /**
+ * Initialises the cipher with the set key
+ *
+ * @param resource $cipher
+ * @throws
+ * @return resource
+ */
+ protected function _initCipher($cipher)
+ {
+ $key = $this->_encryption['key'];
+
+ $keysizes = mcrypt_enc_get_supported_key_sizes($cipher);
+ if (empty($keysizes) || ($this->_encryption['salt'] == true)) {
+ $this->_srand();
+ $keysize = mcrypt_enc_get_key_size($cipher);
+ $key = substr(md5($key), 0, $keysize);
+ } else if (!in_array(strlen($key), $keysizes)) {
+ throw new Zend_Filter_Exception('The given key has a wrong size for the set algorithm');
+ }
+
+ $result = mcrypt_generic_init($cipher, $key, $this->_encryption['vector']);
+ if ($result < 0) {
+ throw new Zend_Filter_Exception('Mcrypt could not be initialize with the given setting');
+ }
+
+ return $this;
+ }
+
+ /**
+ * _srand() interception
+ *
+ * @see ZF-8742
+ */
+ protected function _srand()
+ {
+ if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
+ return;
+ }
+ if (!self::$_srandCalled) {
+ srand(Zend_Crypt_Math::randInteger(0, PHP_INT_MAX));
+ self::$_srandCalled = true;
+ }
+ }
+}
diff --git a/library/vendor/Zend/Filter/Encrypt/Openssl.php b/library/vendor/Zend/Filter/Encrypt/Openssl.php
new file mode 100644
index 0000000..7a46b8e
--- /dev/null
+++ b/library/vendor/Zend/Filter/Encrypt/Openssl.php
@@ -0,0 +1,480 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Encrypt_Interface
+ */
+
+/**
+ * Encryption adapter for openssl
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Encrypt_Openssl implements Zend_Filter_Encrypt_Interface
+{
+ /**
+ * Definitions for encryption
+ * array(
+ * 'public' => public keys
+ * 'private' => private keys
+ * 'envelope' => resulting envelope keys
+ * )
+ */
+ protected $_keys = array(
+ 'public' => array(),
+ 'private' => array(),
+ 'envelope' => array()
+ );
+
+ /**
+ * Internal passphrase
+ *
+ * @var string
+ */
+ protected $_passphrase;
+
+ /**
+ * Internal compression
+ *
+ * @var array
+ */
+ protected $_compression;
+
+ /**
+ * Internal create package
+ *
+ * @var boolean
+ */
+ protected $_package = false;
+
+ /**
+ * Class constructor
+ * Available options
+ * 'public' => public key
+ * 'private' => private key
+ * 'envelope' => envelope key
+ * 'passphrase' => passphrase
+ * 'compression' => compress value with this compression adapter
+ * 'package' => pack envelope keys into encrypted string, simplifies decryption
+ *
+ * @param string|array $options Options for this adapter
+ */
+ public function __construct($options = array())
+ {
+ if (!extension_loaded('openssl')) {
+ throw new Zend_Filter_Exception('This filter needs the openssl extension');
+ }
+
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ }
+
+ if (!is_array($options)) {
+ $options = array('public' => $options);
+ }
+
+ if (array_key_exists('passphrase', $options)) {
+ $this->setPassphrase($options['passphrase']);
+ unset($options['passphrase']);
+ }
+
+ if (array_key_exists('compression', $options)) {
+ $this->setCompression($options['compression']);
+ unset($options['compress']);
+ }
+
+ if (array_key_exists('package', $options)) {
+ $this->setPackage($options['package']);
+ unset($options['package']);
+ }
+
+ $this->_setKeys($options);
+ }
+
+ /**
+ * Sets the encryption keys
+ *
+ * @param string|array $keys Key with type association
+ * @return Zend_Filter_Encrypt_Openssl
+ */
+ protected function _setKeys($keys)
+ {
+ if (!is_array($keys)) {
+ throw new Zend_Filter_Exception('Invalid options argument provided to filter');
+ }
+
+ foreach ($keys as $type => $key) {
+ if (ctype_print($key) && is_file(realpath($key)) && is_readable($key)) {
+ $file = fopen($key, 'r');
+ $cert = fread($file, 8192);
+ fclose($file);
+ } else {
+ $cert = $key;
+ $key = count($this->_keys[$type]);
+ }
+
+ switch ($type) {
+ case 'public':
+ $test = openssl_pkey_get_public($cert);
+ if ($test === false) {
+ throw new Zend_Filter_Exception("Public key '{$cert}' not valid");
+ }
+
+ openssl_free_key($test);
+ $this->_keys['public'][$key] = $cert;
+ break;
+ case 'private':
+ $test = openssl_pkey_get_private($cert, $this->_passphrase);
+ if ($test === false) {
+ throw new Zend_Filter_Exception("Private key '{$cert}' not valid");
+ }
+
+ openssl_free_key($test);
+ $this->_keys['private'][$key] = $cert;
+ break;
+ case 'envelope':
+ $this->_keys['envelope'][$key] = $cert;
+ break;
+ default:
+ break;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns all public keys
+ *
+ * @return array
+ */
+ public function getPublicKey()
+ {
+ $key = $this->_keys['public'];
+ return $key;
+ }
+
+ /**
+ * Sets public keys
+ *
+ * @param string|array $key Public keys
+ * @return Zend_Filter_Encrypt_Openssl
+ */
+ public function setPublicKey($key)
+ {
+ if (is_array($key)) {
+ foreach($key as $type => $option) {
+ if ($type !== 'public') {
+ $key['public'] = $option;
+ unset($key[$type]);
+ }
+ }
+ } else {
+ $key = array('public' => $key);
+ }
+
+ return $this->_setKeys($key);
+ }
+
+ /**
+ * Returns all private keys
+ *
+ * @return array
+ */
+ public function getPrivateKey()
+ {
+ $key = $this->_keys['private'];
+ return $key;
+ }
+
+ /**
+ * Sets private keys
+ *
+ * @param string $key Private key
+ * @param string $passphrase
+ * @return Zend_Filter_Encrypt_Openssl
+ */
+ public function setPrivateKey($key, $passphrase = null)
+ {
+ if (is_array($key)) {
+ foreach($key as $type => $option) {
+ if ($type !== 'private') {
+ $key['private'] = $option;
+ unset($key[$type]);
+ }
+ }
+ } else {
+ $key = array('private' => $key);
+ }
+
+ if ($passphrase !== null) {
+ $this->setPassphrase($passphrase);
+ }
+
+ return $this->_setKeys($key);
+ }
+
+ /**
+ * Returns all envelope keys
+ *
+ * @return array
+ */
+ public function getEnvelopeKey()
+ {
+ $key = $this->_keys['envelope'];
+ return $key;
+ }
+
+ /**
+ * Sets envelope keys
+ *
+ * @param string|array $options Envelope keys
+ * @return Zend_Filter_Encrypt_Openssl
+ */
+ public function setEnvelopeKey($key)
+ {
+ if (is_array($key)) {
+ foreach($key as $type => $option) {
+ if ($type !== 'envelope') {
+ $key['envelope'] = $option;
+ unset($key[$type]);
+ }
+ }
+ } else {
+ $key = array('envelope' => $key);
+ }
+
+ return $this->_setKeys($key);
+ }
+
+ /**
+ * Returns the passphrase
+ *
+ * @return string
+ */
+ public function getPassphrase()
+ {
+ return $this->_passphrase;
+ }
+
+ /**
+ * Sets a new passphrase
+ *
+ * @param string $passphrase
+ * @return Zend_Filter_Encrypt_Openssl
+ */
+ public function setPassphrase($passphrase)
+ {
+ $this->_passphrase = $passphrase;
+ return $this;
+ }
+
+ /**
+ * Returns the compression
+ *
+ * @return array
+ */
+ public function getCompression()
+ {
+ return $this->_compression;
+ }
+
+ /**
+ * Sets a internal compression for values to encrypt
+ *
+ * @param string|array $compression
+ * @return Zend_Filter_Encrypt_Openssl
+ */
+ public function setCompression($compression)
+ {
+ if (is_string($this->_compression)) {
+ $compression = array('adapter' => $compression);
+ }
+
+ $this->_compression = $compression;
+ return $this;
+ }
+
+ /**
+ * Returns if header should be packaged
+ *
+ * @return boolean
+ */
+ public function getPackage()
+ {
+ return $this->_package;
+ }
+
+ /**
+ * Sets if the envelope keys should be included in the encrypted value
+ *
+ * @param boolean $package
+ * @return Zend_Filter_Encrypt_Openssl
+ */
+ public function setPackage($package)
+ {
+ $this->_package = (boolean) $package;
+ return $this;
+ }
+
+ /**
+ * Encrypts $value with the defined settings
+ * Note that you also need the "encrypted" keys to be able to decrypt
+ *
+ * @param string $value Content to encrypt
+ * @return string The encrypted content
+ * @throws Zend_Filter_Exception
+ */
+ public function encrypt($value)
+ {
+ $encrypted = array();
+ $encryptedkeys = array();
+
+ if (count($this->_keys['public']) == 0) {
+ throw new Zend_Filter_Exception('Openssl can not encrypt without public keys');
+ }
+
+ $keys = array();
+ $fingerprints = array();
+ $count = -1;
+ foreach($this->_keys['public'] as $key => $cert) {
+ $keys[$key] = openssl_pkey_get_public($cert);
+ if ($this->_package) {
+ $details = openssl_pkey_get_details($keys[$key]);
+ if ($details === false) {
+ $details = array('key' => 'ZendFramework');
+ }
+
+ ++$count;
+ $fingerprints[$count] = md5($details['key']);
+ }
+ }
+
+ // compress prior to encryption
+ if (!empty($this->_compression)) {
+ $compress = new Zend_Filter_Compress($this->_compression);
+ $value = $compress->filter($value);
+ }
+
+ $crypt = openssl_seal($value, $encrypted, $encryptedkeys, $keys);
+ foreach ($keys as $key) {
+ openssl_free_key($key);
+ }
+
+ if ($crypt === false) {
+ throw new Zend_Filter_Exception('Openssl was not able to encrypt your content with the given options');
+ }
+
+ $this->_keys['envelope'] = $encryptedkeys;
+
+ // Pack data and envelope keys into single string
+ if ($this->_package) {
+ $header = pack('n', count($this->_keys['envelope']));
+ foreach($this->_keys['envelope'] as $key => $envKey) {
+ $header .= pack('H32n', $fingerprints[$key], strlen($envKey)) . $envKey;
+ }
+
+ $encrypted = $header . $encrypted;
+ }
+
+ return $encrypted;
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Decrypts $value with the defined settings
+ *
+ * @param string $value Content to decrypt
+ * @return string The decrypted content
+ * @throws Zend_Filter_Exception
+ */
+ public function decrypt($value)
+ {
+ $decrypted = "";
+ $envelope = current($this->getEnvelopeKey());
+
+ if (count($this->_keys['private']) !== 1) {
+ throw new Zend_Filter_Exception('Please give a private key for decryption with Openssl');
+ }
+
+ if (!$this->_package && empty($envelope)) {
+ throw new Zend_Filter_Exception('Please give a envelope key for decryption with Openssl');
+ }
+
+ foreach($this->_keys['private'] as $key => $cert) {
+ $keys = openssl_pkey_get_private($cert, $this->getPassphrase());
+ }
+
+ if ($this->_package) {
+ $details = openssl_pkey_get_details($keys);
+ if ($details !== false) {
+ $fingerprint = md5($details['key']);
+ } else {
+ $fingerprint = md5("ZendFramework");
+ }
+
+ $count = unpack('ncount', $value);
+ $count = $count['count'];
+ $length = 2;
+ for($i = $count; $i > 0; --$i) {
+ $header = unpack('H32print/nsize', substr($value, $length, 18));
+ $length += 18;
+ if ($header['print'] == $fingerprint) {
+ $envelope = substr($value, $length, $header['size']);
+ }
+
+ $length += $header['size'];
+ }
+
+ // remainder of string is the value to decrypt
+ $value = substr($value, $length);
+ }
+
+ $crypt = openssl_open($value, $decrypted, $envelope, $keys);
+ openssl_free_key($keys);
+
+ if ($crypt === false) {
+ throw new Zend_Filter_Exception('Openssl was not able to decrypt you content with the given options');
+ }
+
+ // decompress after decryption
+ if (!empty($this->_compression)) {
+ $decompress = new Zend_Filter_Decompress($this->_compression);
+ $decrypted = $decompress->filter($decrypted);
+ }
+
+ return $decrypted;
+ }
+
+ /**
+ * Returns the adapter name
+ *
+ * @return string
+ */
+ public function toString()
+ {
+ return 'Openssl';
+ }
+}
diff --git a/library/vendor/Zend/Filter/Exception.php b/library/vendor/Zend/Filter/Exception.php
new file mode 100644
index 0000000..d56145a
--- /dev/null
+++ b/library/vendor/Zend/Filter/Exception.php
@@ -0,0 +1,36 @@
+<?php
+
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Exception
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Exception extends Zend_Exception
+{}
diff --git a/library/vendor/Zend/Filter/File/Decrypt.php b/library/vendor/Zend/Filter/File/Decrypt.php
new file mode 100644
index 0000000..a7468aa
--- /dev/null
+++ b/library/vendor/Zend/Filter/File/Decrypt.php
@@ -0,0 +1,101 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Decrypt
+ */
+
+/**
+ * Decrypts a given file and stores the decrypted file content
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_File_Decrypt extends Zend_Filter_Decrypt
+{
+ /**
+ * New filename to set
+ *
+ * @var string
+ */
+ protected $_filename;
+
+ /**
+ * Returns the new filename where the content will be stored
+ *
+ * @return string
+ */
+ public function getFilename()
+ {
+ return $this->_filename;
+ }
+
+ /**
+ * Sets the new filename where the content will be stored
+ *
+ * @param string $filename (Optional) New filename to set
+ * @return Zend_Filter_File_Encryt
+ */
+ public function setFilename($filename = null)
+ {
+ $this->_filename = $filename;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Decrypts the file $value with the defined settings
+ *
+ * @param string $value Full path of file to change
+ * @return string The filename which has been set, or false when there were errors
+ */
+ public function filter($value)
+ {
+ if (!file_exists($value)) {
+ throw new Zend_Filter_Exception("File '$value' not found");
+ }
+
+ if (!isset($this->_filename)) {
+ $this->_filename = $value;
+ }
+
+ if (file_exists($this->_filename) and !is_writable($this->_filename)) {
+ throw new Zend_Filter_Exception("File '{$this->_filename}' is not writable");
+ }
+
+ $content = file_get_contents($value);
+ if (!$content) {
+ throw new Zend_Filter_Exception("Problem while reading file '$value'");
+ }
+
+ $decrypted = parent::filter($content);
+ $result = file_put_contents($this->_filename, $decrypted);
+
+ if (!$result) {
+ throw new Zend_Filter_Exception("Problem while writing file '{$this->_filename}'");
+ }
+
+ return $this->_filename;
+ }
+}
diff --git a/library/vendor/Zend/Filter/File/Encrypt.php b/library/vendor/Zend/Filter/File/Encrypt.php
new file mode 100644
index 0000000..16be9df
--- /dev/null
+++ b/library/vendor/Zend/Filter/File/Encrypt.php
@@ -0,0 +1,101 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Encrypt
+ */
+
+/**
+ * Encrypts a given file and stores the encrypted file content
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_File_Encrypt extends Zend_Filter_Encrypt
+{
+ /**
+ * New filename to set
+ *
+ * @var string
+ */
+ protected $_filename;
+
+ /**
+ * Returns the new filename where the content will be stored
+ *
+ * @return string
+ */
+ public function getFilename()
+ {
+ return $this->_filename;
+ }
+
+ /**
+ * Sets the new filename where the content will be stored
+ *
+ * @param string $filename (Optional) New filename to set
+ * @return Zend_Filter_File_Encryt
+ */
+ public function setFilename($filename = null)
+ {
+ $this->_filename = $filename;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Encrypts the file $value with the defined settings
+ *
+ * @param string $value Full path of file to change
+ * @return string The filename which has been set, or false when there were errors
+ */
+ public function filter($value)
+ {
+ if (!file_exists($value)) {
+ throw new Zend_Filter_Exception("File '$value' not found");
+ }
+
+ if (!isset($this->_filename)) {
+ $this->_filename = $value;
+ }
+
+ if (file_exists($this->_filename) and !is_writable($this->_filename)) {
+ throw new Zend_Filter_Exception("File '{$this->_filename}' is not writable");
+ }
+
+ $content = file_get_contents($value);
+ if (!$content) {
+ throw new Zend_Filter_Exception("Problem while reading file '$value'");
+ }
+
+ $encrypted = parent::filter($content);
+ $result = file_put_contents($this->_filename, $encrypted);
+
+ if (!$result) {
+ throw new Zend_Filter_Exception("Problem while writing file '{$this->_filename}'");
+ }
+
+ return $this->_filename;
+ }
+}
diff --git a/library/vendor/Zend/Filter/File/LowerCase.php b/library/vendor/Zend/Filter/File/LowerCase.php
new file mode 100644
index 0000000..681332b
--- /dev/null
+++ b/library/vendor/Zend/Filter/File/LowerCase.php
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_StringToLower
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_File_LowerCase extends Zend_Filter_StringToLower
+{
+ /**
+ * Adds options to the filter at initiation
+ *
+ * @param string $options
+ */
+ public function __construct($options = null)
+ {
+ if (!empty($options)) {
+ $this->setEncoding($options);
+ }
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Does a lowercase on the content of the given file
+ *
+ * @param string $value Full path of file to change
+ * @return string The given $value
+ * @throws Zend_Filter_Exception
+ */
+ public function filter($value)
+ {
+ if (!file_exists($value)) {
+ throw new Zend_Filter_Exception("File '$value' not found");
+ }
+
+ if (!is_writable($value)) {
+ throw new Zend_Filter_Exception("File '$value' is not writable");
+ }
+
+ $content = file_get_contents($value);
+ if (!$content) {
+ throw new Zend_Filter_Exception("Problem while reading file '$value'");
+ }
+
+ $content = parent::filter($content);
+ $result = file_put_contents($value, $content);
+
+ if (!$result) {
+ throw new Zend_Filter_Exception("Problem while writing file '$value'");
+ }
+
+ return $value;
+ }
+}
diff --git a/library/vendor/Zend/Filter/File/Rename.php b/library/vendor/Zend/Filter/File/Rename.php
new file mode 100644
index 0000000..1bf5650
--- /dev/null
+++ b/library/vendor/Zend/Filter/File/Rename.php
@@ -0,0 +1,304 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_File_Rename implements Zend_Filter_Interface
+{
+ /**
+ * Internal array of array(source, target, overwrite)
+ */
+ protected $_files = array();
+
+ /**
+ * Class constructor
+ *
+ * Options argument may be either a string, a Zend_Config object, or an array.
+ * If an array or Zend_Config object, it accepts the following keys:
+ * 'source' => Source filename or directory which will be renamed
+ * 'target' => Target filename or directory, the new name of the sourcefile
+ * 'overwrite' => Shall existing files be overwritten ?
+ *
+ * @param string|array $options Target file or directory to be renamed
+ * @param string $target Source filename or directory (deprecated)
+ * @param bool $overwrite Should existing files be overwritten (deprecated)
+ * @return void
+ */
+ public function __construct($options)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } elseif (is_string($options)) {
+ $options = array('target' => $options);
+ } elseif (!is_array($options)) {
+ throw new Zend_Filter_Exception('Invalid options argument provided to filter');
+ }
+
+ if (1 < func_num_args()) {
+ $argv = func_get_args();
+ array_shift($argv);
+ $source = array_shift($argv);
+ $overwrite = false;
+ if (!empty($argv)) {
+ $overwrite = array_shift($argv);
+ }
+ $options['source'] = $source;
+ $options['overwrite'] = $overwrite;
+ }
+
+ $this->setFile($options);
+ }
+
+ /**
+ * Returns the files to rename and their new name and location
+ *
+ * @return array
+ */
+ public function getFile()
+ {
+ return $this->_files;
+ }
+
+ /**
+ * Sets a new file or directory as target, deleting existing ones
+ *
+ * Array accepts the following keys:
+ * 'source' => Source filename or directory which will be renamed
+ * 'target' => Target filename or directory, the new name of the sourcefile
+ * 'overwrite' => Shall existing files be overwritten ?
+ *
+ * @param string|array $options Old file or directory to be rewritten
+ * @return Zend_Filter_File_Rename
+ */
+ public function setFile($options)
+ {
+ $this->_files = array();
+ $this->addFile($options);
+
+ return $this;
+ }
+
+ /**
+ * Adds a new file or directory as target to the existing ones
+ *
+ * Array accepts the following keys:
+ * 'source' => Source filename or directory which will be renamed
+ * 'target' => Target filename or directory, the new name of the sourcefile
+ * 'overwrite' => Shall existing files be overwritten ?
+ *
+ * @param string|array $options Old file or directory to be rewritten
+ * @return Zend_Filter_File_Rename
+ */
+ public function addFile($options)
+ {
+ if (is_string($options)) {
+ $options = array('target' => $options);
+ } elseif (!is_array($options)) {
+ throw new Zend_Filter_Exception ('Invalid options to rename filter provided');
+ }
+
+ $this->_convertOptions($options);
+
+ return $this;
+ }
+
+ /**
+ * Returns only the new filename without moving it
+ * But existing files will be erased when the overwrite option is true
+ *
+ * @param string $value Full path of file to change
+ * @param boolean $source Return internal informations
+ * @return string The new filename which has been set
+ */
+ public function getNewName($value, $source = false)
+ {
+ $file = $this->_getFileName($value);
+
+ if (!is_array($file) || !array_key_exists('source', $file) || !array_key_exists('target', $file)) {
+ return $value;
+ }
+
+ if ($file['source'] == $file['target']) {
+ return $value;
+ }
+
+ if (!file_exists($file['source'])) {
+ return $value;
+ }
+
+ if (($file['overwrite'] == true) && (file_exists($file['target']))) {
+ unlink($file['target']);
+ }
+
+ if (file_exists($file['target'])) {
+ throw new Zend_Filter_Exception(sprintf("File '%s' could not be renamed. It already exists.", $value));
+ }
+
+ if ($source) {
+ return $file;
+ }
+
+ return $file['target'];
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Renames the file $value to the new name set before
+ * Returns the file $value, removing all but digit characters
+ *
+ * @param string $value Full path of file to change
+ * @throws Zend_Filter_Exception
+ * @return string The new filename which has been set, or false when there were errors
+ */
+ public function filter($value)
+ {
+ $file = $this->getNewName($value, true);
+ if (is_string($file)) {
+ return $file;
+ }
+
+ $result = rename($file['source'], $file['target']);
+
+ if ($result === true) {
+ return $file['target'];
+ }
+
+ throw new Zend_Filter_Exception(sprintf("File '%s' could not be renamed. An error occured while processing the file.", $value));
+ }
+
+ /**
+ * Internal method for creating the file array
+ * Supports single and nested arrays
+ *
+ * @param array $options
+ * @return array
+ */
+ protected function _convertOptions($options) {
+ $files = array();
+ foreach ($options as $key => $value) {
+ if (is_array($value)) {
+ $this->_convertOptions($value);
+ continue;
+ }
+
+ switch ($key) {
+ case "source":
+ $files['source'] = (string) $value;
+ break;
+
+ case 'target' :
+ $files['target'] = (string) $value;
+ break;
+
+ case 'overwrite' :
+ $files['overwrite'] = (boolean) $value;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (empty($files)) {
+ return $this;
+ }
+
+ if (empty($files['source'])) {
+ $files['source'] = '*';
+ }
+
+ if (empty($files['target'])) {
+ $files['target'] = '*';
+ }
+
+ if (empty($files['overwrite'])) {
+ $files['overwrite'] = false;
+ }
+
+ $found = false;
+ foreach ($this->_files as $key => $value) {
+ if ($value['source'] == $files['source']) {
+ $this->_files[$key] = $files;
+ $found = true;
+ }
+ }
+
+ if (!$found) {
+ $count = count($this->_files);
+ $this->_files[$count] = $files;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Internal method to resolve the requested source
+ * and return all other related parameters
+ *
+ * @param string $file Filename to get the informations for
+ * @return array
+ */
+ protected function _getFileName($file)
+ {
+ $rename = array();
+ foreach ($this->_files as $value) {
+ if ($value['source'] == '*') {
+ if (!isset($rename['source'])) {
+ $rename = $value;
+ $rename['source'] = $file;
+ }
+ }
+
+ if ($value['source'] == $file) {
+ $rename = $value;
+ }
+ }
+
+ if (!isset($rename['source'])) {
+ return $file;
+ }
+
+ if (!isset($rename['target']) or ($rename['target'] == '*')) {
+ $rename['target'] = $rename['source'];
+ }
+
+ if (is_dir($rename['target'])) {
+ $name = basename($rename['source']);
+ $last = $rename['target'][strlen($rename['target']) - 1];
+ if (($last != '/') and ($last != '\\')) {
+ $rename['target'] .= DIRECTORY_SEPARATOR;
+ }
+
+ $rename['target'] .= $name;
+ }
+
+ return $rename;
+ }
+}
diff --git a/library/vendor/Zend/Filter/File/UpperCase.php b/library/vendor/Zend/Filter/File/UpperCase.php
new file mode 100644
index 0000000..318e33e
--- /dev/null
+++ b/library/vendor/Zend/Filter/File/UpperCase.php
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_StringToUpper
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_File_UpperCase extends Zend_Filter_StringToUpper
+{
+ /**
+ * Adds options to the filter at initiation
+ *
+ * @param string $options
+ */
+ public function __construct($options = null)
+ {
+ if (!empty($options)) {
+ $this->setEncoding($options);
+ }
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Does a lowercase on the content of the given file
+ *
+ * @param string $value Full path of file to change
+ * @return string The given $value
+ * @throws Zend_Filter_Exception
+ */
+ public function filter($value)
+ {
+ if (!file_exists($value)) {
+ throw new Zend_Filter_Exception("File '$value' not found");
+ }
+
+ if (!is_writable($value)) {
+ throw new Zend_Filter_Exception("File '$value' is not writable");
+ }
+
+ $content = file_get_contents($value);
+ if (!$content) {
+ throw new Zend_Filter_Exception("Problem while reading file '$value'");
+ }
+
+ $content = parent::filter($content);
+ $result = file_put_contents($value, $content);
+
+ if (!$result) {
+ throw new Zend_Filter_Exception("Problem while writing file '$value'");
+ }
+
+ return $value;
+ }
+}
diff --git a/library/vendor/Zend/Filter/HtmlEntities.php b/library/vendor/Zend/Filter/HtmlEntities.php
new file mode 100644
index 0000000..5ba7ad8
--- /dev/null
+++ b/library/vendor/Zend/Filter/HtmlEntities.php
@@ -0,0 +1,213 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_HtmlEntities implements Zend_Filter_Interface
+{
+ /**
+ * Corresponds to the second htmlentities() argument
+ *
+ * @var integer
+ */
+ protected $_quoteStyle;
+
+ /**
+ * Corresponds to the third htmlentities() argument
+ *
+ * @var string
+ */
+ protected $_encoding;
+
+ /**
+ * Corresponds to the forth htmlentities() argument
+ *
+ * @var unknown_type
+ */
+ protected $_doubleQuote;
+
+ /**
+ * Sets filter options
+ *
+ * @param integer|array $quoteStyle
+ * @param string $charSet
+ * @return void
+ */
+ public function __construct($options = array())
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (!is_array($options)) {
+ $options = func_get_args();
+ $temp['quotestyle'] = array_shift($options);
+ if (!empty($options)) {
+ $temp['charset'] = array_shift($options);
+ }
+
+ $options = $temp;
+ }
+
+ if (!isset($options['quotestyle'])) {
+ $options['quotestyle'] = ENT_COMPAT;
+ }
+
+ if (!isset($options['encoding'])) {
+ $options['encoding'] = 'UTF-8';
+ }
+ if (isset($options['charset'])) {
+ $options['encoding'] = $options['charset'];
+ }
+
+ if (!isset($options['doublequote'])) {
+ $options['doublequote'] = true;
+ }
+
+ $this->setQuoteStyle($options['quotestyle']);
+ $this->setEncoding($options['encoding']);
+ $this->setDoubleQuote($options['doublequote']);
+ }
+
+ /**
+ * Returns the quoteStyle option
+ *
+ * @return integer
+ */
+ public function getQuoteStyle()
+ {
+ return $this->_quoteStyle;
+ }
+
+ /**
+ * Sets the quoteStyle option
+ *
+ * @param integer $quoteStyle
+ * @return Zend_Filter_HtmlEntities Provides a fluent interface
+ */
+ public function setQuoteStyle($quoteStyle)
+ {
+ $this->_quoteStyle = $quoteStyle;
+ return $this;
+ }
+
+
+ /**
+ * Get encoding
+ *
+ * @return string
+ */
+ public function getEncoding()
+ {
+ return $this->_encoding;
+ }
+
+ /**
+ * Set encoding
+ *
+ * @param string $value
+ * @return Zend_Filter_HtmlEntities
+ */
+ public function setEncoding($value)
+ {
+ $this->_encoding = (string) $value;
+ return $this;
+ }
+
+ /**
+ * Returns the charSet option
+ *
+ * Proxies to {@link getEncoding()}
+ *
+ * @return string
+ */
+ public function getCharSet()
+ {
+ return $this->getEncoding();
+ }
+
+ /**
+ * Sets the charSet option
+ *
+ * Proxies to {@link setEncoding()}
+ *
+ * @param string $charSet
+ * @return Zend_Filter_HtmlEntities Provides a fluent interface
+ */
+ public function setCharSet($charSet)
+ {
+ return $this->setEncoding($charSet);
+ }
+
+ /**
+ * Returns the doubleQuote option
+ *
+ * @return boolean
+ */
+ public function getDoubleQuote()
+ {
+ return $this->_doubleQuote;
+ }
+
+ /**
+ * Sets the doubleQuote option
+ *
+ * @param boolean $doubleQuote
+ * @return Zend_Filter_HtmlEntities Provides a fluent interface
+ */
+ public function setDoubleQuote($doubleQuote)
+ {
+ $this->_doubleQuote = (boolean) $doubleQuote;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Returns the string $value, converting characters to their corresponding HTML entity
+ * equivalents where they exist
+ *
+ * @param string $value
+ * @return string
+ */
+ public function filter($value)
+ {
+ $filtered = htmlentities((string) $value, $this->getQuoteStyle(), $this->getEncoding(), $this->getDoubleQuote());
+ if (strlen((string) $value) && !strlen($filtered)) {
+ if (!function_exists('iconv')) {
+ throw new Zend_Filter_Exception('Encoding mismatch has resulted in htmlentities errors');
+ }
+ $enc = $this->getEncoding();
+ $value = iconv('', $enc . '//IGNORE', (string) $value);
+ $filtered = htmlentities($value, $this->getQuoteStyle(), $enc, $this->getDoubleQuote());
+ if (!strlen($filtered)) {
+ throw new Zend_Filter_Exception('Encoding mismatch has resulted in htmlentities errors');
+ }
+ }
+ return $filtered;
+ }
+}
diff --git a/library/vendor/Zend/Filter/Inflector.php b/library/vendor/Zend/Filter/Inflector.php
new file mode 100644
index 0000000..2192f84
--- /dev/null
+++ b/library/vendor/Zend/Filter/Inflector.php
@@ -0,0 +1,523 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * @see Zend_Loader_PluginLoader
+ */
+
+/**
+ * Filter chain for string inflection
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Inflector implements Zend_Filter_Interface
+{
+ /**
+ * @var Zend_Loader_PluginLoader_Interface
+ */
+ protected $_pluginLoader = null;
+
+ /**
+ * @var string
+ */
+ protected $_target = null;
+
+ /**
+ * @var bool
+ */
+ protected $_throwTargetExceptionsOn = true;
+
+ /**
+ * @var string
+ */
+ protected $_targetReplacementIdentifier = ':';
+
+ /**
+ * @var array
+ */
+ protected $_rules = array();
+
+ /**
+ * Constructor
+ *
+ * @param string|array $options Options to set
+ */
+ public function __construct($options = null)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (!is_array($options)) {
+ $options = func_get_args();
+ $temp = array();
+
+ if (!empty($options)) {
+ $temp['target'] = array_shift($options);
+ }
+
+ if (!empty($options)) {
+ $temp['rules'] = array_shift($options);
+ }
+
+ if (!empty($options)) {
+ $temp['throwTargetExceptionsOn'] = array_shift($options);
+ }
+
+ if (!empty($options)) {
+ $temp['targetReplacementIdentifier'] = array_shift($options);
+ }
+
+ $options = $temp;
+ }
+
+ $this->setOptions($options);
+ }
+
+ /**
+ * Retreive PluginLoader
+ *
+ * @return Zend_Loader_PluginLoader_Interface
+ */
+ public function getPluginLoader()
+ {
+ if (!$this->_pluginLoader instanceof Zend_Loader_PluginLoader_Interface) {
+ $this->_pluginLoader = new Zend_Loader_PluginLoader(array('Zend_Filter_' => 'Zend/Filter/'), __CLASS__);
+ }
+
+ return $this->_pluginLoader;
+ }
+
+ /**
+ * Set PluginLoader
+ *
+ * @param Zend_Loader_PluginLoader_Interface $pluginLoader
+ * @return Zend_Filter_Inflector
+ */
+ public function setPluginLoader(Zend_Loader_PluginLoader_Interface $pluginLoader)
+ {
+ $this->_pluginLoader = $pluginLoader;
+ return $this;
+ }
+
+ /**
+ * Use Zend_Config object to set object state
+ *
+ * @deprecated Use setOptions() instead
+ * @param Zend_Config $config
+ * @return Zend_Filter_Inflector
+ */
+ public function setConfig(Zend_Config $config)
+ {
+ return $this->setOptions($config);
+ }
+
+ /**
+ * Set options
+ *
+ * @param array $options
+ * @return Zend_Filter_Inflector
+ */
+ public function setOptions($options) {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ }
+
+ // Set Präfix Path
+ if (array_key_exists('filterPrefixPath', $options)) {
+ if (!is_scalar($options['filterPrefixPath'])) {
+ foreach ($options['filterPrefixPath'] as $prefix => $path) {
+ $this->addFilterPrefixPath($prefix, $path);
+ }
+ }
+ }
+
+ if (array_key_exists('throwTargetExceptionsOn', $options)) {
+ $this->setThrowTargetExceptionsOn($options['throwTargetExceptionsOn']);
+ }
+
+ if (array_key_exists('targetReplacementIdentifier', $options)) {
+ $this->setTargetReplacementIdentifier($options['targetReplacementIdentifier']);
+ }
+
+ if (array_key_exists('target', $options)) {
+ $this->setTarget($options['target']);
+ }
+
+ if (array_key_exists('rules', $options)) {
+ $this->addRules($options['rules']);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Convienence method to add prefix and path to PluginLoader
+ *
+ * @param string $prefix
+ * @param string $path
+ * @return Zend_Filter_Inflector
+ */
+ public function addFilterPrefixPath($prefix, $path)
+ {
+ $this->getPluginLoader()->addPrefixPath($prefix, $path);
+ return $this;
+ }
+
+ /**
+ * Set Whether or not the inflector should throw an exception when a replacement
+ * identifier is still found within an inflected target.
+ *
+ * @param bool $throwTargetExceptions
+ * @return Zend_Filter_Inflector
+ */
+ public function setThrowTargetExceptionsOn($throwTargetExceptionsOn)
+ {
+ $this->_throwTargetExceptionsOn = ($throwTargetExceptionsOn == true) ? true : false;
+ return $this;
+ }
+
+ /**
+ * Will exceptions be thrown?
+ *
+ * @return bool
+ */
+ public function isThrowTargetExceptionsOn()
+ {
+ return $this->_throwTargetExceptionsOn;
+ }
+
+ /**
+ * Set the Target Replacement Identifier, by default ':'
+ *
+ * @param string $targetReplacementIdentifier
+ * @return Zend_Filter_Inflector
+ */
+ public function setTargetReplacementIdentifier($targetReplacementIdentifier)
+ {
+ if ($targetReplacementIdentifier) {
+ $this->_targetReplacementIdentifier = (string) $targetReplacementIdentifier;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Target Replacement Identifier
+ *
+ * @return string
+ */
+ public function getTargetReplacementIdentifier()
+ {
+ return $this->_targetReplacementIdentifier;
+ }
+
+ /**
+ * Set a Target
+ * ex: 'scripts/:controller/:action.:suffix'
+ *
+ * @param string
+ * @return Zend_Filter_Inflector
+ */
+ public function setTarget($target)
+ {
+ $this->_target = (string) $target;
+ return $this;
+ }
+
+ /**
+ * Retrieve target
+ *
+ * @return string
+ */
+ public function getTarget()
+ {
+ return $this->_target;
+ }
+
+ /**
+ * Set Target Reference
+ *
+ * @param reference $target
+ * @return Zend_Filter_Inflector
+ */
+ public function setTargetReference(&$target)
+ {
+ $this->_target =& $target;
+ return $this;
+ }
+
+ /**
+ * SetRules() is the same as calling addRules() with the exception that it
+ * clears the rules before adding them.
+ *
+ * @param array $rules
+ * @return Zend_Filter_Inflector
+ */
+ public function setRules(Array $rules)
+ {
+ $this->clearRules();
+ $this->addRules($rules);
+ return $this;
+ }
+
+ /**
+ * AddRules(): multi-call to setting filter rules.
+ *
+ * If prefixed with a ":" (colon), a filter rule will be added. If not
+ * prefixed, a static replacement will be added.
+ *
+ * ex:
+ * array(
+ * ':controller' => array('CamelCaseToUnderscore','StringToLower'),
+ * ':action' => array('CamelCaseToUnderscore','StringToLower'),
+ * 'suffix' => 'phtml'
+ * );
+ *
+ * @param array
+ * @return Zend_Filter_Inflector
+ */
+ public function addRules(Array $rules)
+ {
+ $keys = array_keys($rules);
+ foreach ($keys as $spec) {
+ if ($spec[0] == ':') {
+ $this->addFilterRule($spec, $rules[$spec]);
+ } else {
+ $this->setStaticRule($spec, $rules[$spec]);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get rules
+ *
+ * By default, returns all rules. If a $spec is provided, will return those
+ * rules if found, false otherwise.
+ *
+ * @param string $spec
+ * @return array|false
+ */
+ public function getRules($spec = null)
+ {
+ if (null !== $spec) {
+ $spec = $this->_normalizeSpec($spec);
+ if (isset($this->_rules[$spec])) {
+ return $this->_rules[$spec];
+ }
+ return false;
+ }
+
+ return $this->_rules;
+ }
+
+ /**
+ * getRule() returns a rule set by setFilterRule(), a numeric index must be provided
+ *
+ * @param string $spec
+ * @param int $index
+ * @return Zend_Filter_Interface|false
+ */
+ public function getRule($spec, $index)
+ {
+ $spec = $this->_normalizeSpec($spec);
+ if (isset($this->_rules[$spec]) && is_array($this->_rules[$spec])) {
+ if (isset($this->_rules[$spec][$index])) {
+ return $this->_rules[$spec][$index];
+ }
+ }
+ return false;
+ }
+
+ /**
+ * ClearRules() clears the rules currently in the inflector
+ *
+ * @return Zend_Filter_Inflector
+ */
+ public function clearRules()
+ {
+ $this->_rules = array();
+ return $this;
+ }
+
+ /**
+ * Set a filtering rule for a spec. $ruleSet can be a string, Filter object
+ * or an array of strings or filter objects.
+ *
+ * @param string $spec
+ * @param array|string|Zend_Filter_Interface $ruleSet
+ * @return Zend_Filter_Inflector
+ */
+ public function setFilterRule($spec, $ruleSet)
+ {
+ $spec = $this->_normalizeSpec($spec);
+ $this->_rules[$spec] = array();
+ return $this->addFilterRule($spec, $ruleSet);
+ }
+
+ /**
+ * Add a filter rule for a spec
+ *
+ * @param mixed $spec
+ * @param mixed $ruleSet
+ * @return void
+ */
+ public function addFilterRule($spec, $ruleSet)
+ {
+ $spec = $this->_normalizeSpec($spec);
+ if (!isset($this->_rules[$spec])) {
+ $this->_rules[$spec] = array();
+ }
+
+ if (!is_array($ruleSet)) {
+ $ruleSet = array($ruleSet);
+ }
+
+ if (is_string($this->_rules[$spec])) {
+ $temp = $this->_rules[$spec];
+ $this->_rules[$spec] = array();
+ $this->_rules[$spec][] = $temp;
+ }
+
+ foreach ($ruleSet as $rule) {
+ $this->_rules[$spec][] = $this->_getRule($rule);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set a static rule for a spec. This is a single string value
+ *
+ * @param string $name
+ * @param string $value
+ * @return Zend_Filter_Inflector
+ */
+ public function setStaticRule($name, $value)
+ {
+ $name = $this->_normalizeSpec($name);
+ $this->_rules[$name] = (string) $value;
+ return $this;
+ }
+
+ /**
+ * Set Static Rule Reference.
+ *
+ * This allows a consuming class to pass a property or variable
+ * in to be referenced when its time to build the output string from the
+ * target.
+ *
+ * @param string $name
+ * @param mixed $reference
+ * @return Zend_Filter_Inflector
+ */
+ public function setStaticRuleReference($name, &$reference)
+ {
+ $name = $this->_normalizeSpec($name);
+ $this->_rules[$name] =& $reference;
+ return $this;
+ }
+
+ /**
+ * Inflect
+ *
+ * @param string|array $source
+ * @return string
+ */
+ public function filter($source)
+ {
+ // clean source
+ foreach ( (array) $source as $sourceName => $sourceValue) {
+ $source[ltrim($sourceName, ':')] = $sourceValue;
+ }
+
+ $pregQuotedTargetReplacementIdentifier = preg_quote($this->_targetReplacementIdentifier, '#');
+ $processedParts = array();
+
+ foreach ($this->_rules as $ruleName => $ruleValue) {
+ if (isset($source[$ruleName])) {
+ if (is_string($ruleValue)) {
+ // overriding the set rule
+ $processedParts['#'.$pregQuotedTargetReplacementIdentifier.$ruleName.'#'] = str_replace('\\', '\\\\', $source[$ruleName]);
+ } elseif (is_array($ruleValue)) {
+ $processedPart = $source[$ruleName];
+ foreach ($ruleValue as $ruleFilter) {
+ $processedPart = $ruleFilter->filter($processedPart);
+ }
+ $processedParts['#'.$pregQuotedTargetReplacementIdentifier.$ruleName.'#'] = str_replace('\\', '\\\\', $processedPart);
+ }
+ } elseif (is_string($ruleValue)) {
+ $processedParts['#'.$pregQuotedTargetReplacementIdentifier.$ruleName.'#'] = str_replace('\\', '\\\\', $ruleValue);
+ }
+ }
+
+ // all of the values of processedParts would have been str_replace('\\', '\\\\', ..)'d to disable preg_replace backreferences
+ $inflectedTarget = preg_replace(array_keys($processedParts), array_values($processedParts), $this->_target);
+
+ if ($this->_throwTargetExceptionsOn && (preg_match('#(?='.$pregQuotedTargetReplacementIdentifier.'[A-Za-z]{1})#', $inflectedTarget) == true)) {
+ throw new Zend_Filter_Exception('A replacement identifier ' . $this->_targetReplacementIdentifier . ' was found inside the inflected target, perhaps a rule was not satisfied with a target source? Unsatisfied inflected target: ' . $inflectedTarget);
+ }
+
+ return $inflectedTarget;
+ }
+
+ /**
+ * Normalize spec string
+ *
+ * @param string $spec
+ * @return string
+ */
+ protected function _normalizeSpec($spec)
+ {
+ return ltrim((string) $spec, ':&');
+ }
+
+ /**
+ * Resolve named filters and convert them to filter objects.
+ *
+ * @param string $rule
+ * @return Zend_Filter_Interface
+ */
+ protected function _getRule($rule)
+ {
+ if ($rule instanceof Zend_Filter_Interface) {
+ return $rule;
+ }
+
+ $rule = (string) $rule;
+
+ $className = $this->getPluginLoader()->load($rule);
+ $ruleObject = new $className();
+ if (!$ruleObject instanceof Zend_Filter_Interface) {
+ throw new Zend_Filter_Exception('No class named ' . $rule . ' implementing Zend_Filter_Interface could be found');
+ }
+
+ return $ruleObject;
+ }
+}
diff --git a/library/vendor/Zend/Filter/Input.php b/library/vendor/Zend/Filter/Input.php
new file mode 100644
index 0000000..0c245a1
--- /dev/null
+++ b/library/vendor/Zend/Filter/Input.php
@@ -0,0 +1,1196 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Loader
+ */
+
+/**
+ * @see Zend_Filter
+ */
+
+/**
+ * @see Zend_Validate
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Input
+{
+
+ const ALLOW_EMPTY = 'allowEmpty';
+ const BREAK_CHAIN = 'breakChainOnFailure';
+ const DEFAULT_VALUE = 'default';
+ const MESSAGES = 'messages';
+ const ESCAPE_FILTER = 'escapeFilter';
+ const FIELDS = 'fields';
+ const FILTER = 'filter';
+ const FILTER_CHAIN = 'filterChain';
+ const MISSING_MESSAGE = 'missingMessage';
+ const INPUT_NAMESPACE = 'inputNamespace';
+ const VALIDATOR_NAMESPACE = 'validatorNamespace';
+ const FILTER_NAMESPACE = 'filterNamespace';
+ const NOT_EMPTY_MESSAGE = 'notEmptyMessage';
+ const PRESENCE = 'presence';
+ const PRESENCE_OPTIONAL = 'optional';
+ const PRESENCE_REQUIRED = 'required';
+ const RULE = 'rule';
+ const RULE_WILDCARD = '*';
+ const VALIDATE = 'validate';
+ const VALIDATOR = 'validator';
+ const VALIDATOR_CHAIN = 'validatorChain';
+ const VALIDATOR_CHAIN_COUNT = 'validatorChainCount';
+
+ /**
+ * @var array Input data, before processing.
+ */
+ protected $_data = array();
+
+ /**
+ * @var array Association of rules to filters.
+ */
+ protected $_filterRules = array();
+
+ /**
+ * @var array Association of rules to validators.
+ */
+ protected $_validatorRules = array();
+
+ /**
+ * @var array After processing data, this contains mapping of valid fields
+ * to field values.
+ */
+ protected $_validFields = array();
+
+ /**
+ * @var array After processing data, this contains mapping of validation
+ * rules that did not pass validation to the array of messages returned
+ * by the validator chain.
+ */
+ protected $_invalidMessages = array();
+
+ /**
+ * @var array After processing data, this contains mapping of validation
+ * rules that did not pass validation to the array of error identifiers
+ * returned by the validator chain.
+ */
+ protected $_invalidErrors = array();
+
+ /**
+ * @var array After processing data, this contains mapping of validation
+ * rules in which some fields were missing to the array of messages
+ * indicating which fields were missing.
+ */
+ protected $_missingFields = array();
+
+ /**
+ * @var array After processing, this contains a copy of $_data elements
+ * that were not mentioned in any validation rule.
+ */
+ protected $_unknownFields = array();
+
+ /**
+ * @var Zend_Filter_Interface The filter object that is run on values
+ * returned by the getEscaped() method.
+ */
+ protected $_defaultEscapeFilter = null;
+
+ /**
+ * Plugin loaders
+ * @var array
+ */
+ protected $_loaders = array();
+
+ /**
+ * @var array Default values to use when processing filters and validators.
+ */
+ protected $_defaults = array(
+ self::ALLOW_EMPTY => false,
+ self::BREAK_CHAIN => false,
+ self::ESCAPE_FILTER => 'HtmlEntities',
+ self::MISSING_MESSAGE => "Field '%field%' is required by rule '%rule%', but the field is missing",
+ self::NOT_EMPTY_MESSAGE => "You must give a non-empty value for field '%field%'",
+ self::PRESENCE => self::PRESENCE_OPTIONAL
+ );
+
+ /**
+ * @var boolean Set to False initially, this is set to True after the
+ * input data have been processed. Reset to False in setData() method.
+ */
+ protected $_processed = false;
+
+ /**
+ * Translation object
+ * @var Zend_Translate
+ */
+ protected $_translator;
+
+ /**
+ * Is translation disabled?
+ * @var Boolean
+ */
+ protected $_translatorDisabled = false;
+
+ /**
+ * @param array $filterRules
+ * @param array $validatorRules
+ * @param array $data OPTIONAL
+ * @param array $options OPTIONAL
+ */
+ public function __construct($filterRules, $validatorRules, array $data = null, array $options = null)
+ {
+ if ($options) {
+ $this->setOptions($options);
+ }
+
+ $this->_filterRules = (array) $filterRules;
+ $this->_validatorRules = (array) $validatorRules;
+
+ if ($data) {
+ $this->setData($data);
+ }
+ }
+
+ /**
+ * @param mixed $namespaces
+ * @return Zend_Filter_Input
+ * @deprecated since 1.5.0RC1 - use addFilterPrefixPath() or addValidatorPrefixPath instead.
+ */
+ public function addNamespace($namespaces)
+ {
+ if (!is_array($namespaces)) {
+ $namespaces = array($namespaces);
+ }
+
+ foreach ($namespaces as $namespace) {
+ $prefix = $namespace;
+ $path = str_replace('_', DIRECTORY_SEPARATOR, $prefix);
+ $this->addFilterPrefixPath($prefix, $path);
+ $this->addValidatorPrefixPath($prefix, $path);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Add prefix path for all elements
+ *
+ * @param string $prefix
+ * @param string $path
+ * @return Zend_Filter_Input
+ */
+ public function addFilterPrefixPath($prefix, $path)
+ {
+ $this->getPluginLoader(self::FILTER)->addPrefixPath($prefix, $path);
+
+ return $this;
+ }
+
+ /**
+ * Add prefix path for all elements
+ *
+ * @param string $prefix
+ * @param string $path
+ * @return Zend_Filter_Input
+ */
+ public function addValidatorPrefixPath($prefix, $path)
+ {
+ $this->getPluginLoader(self::VALIDATE)->addPrefixPath($prefix, $path);
+
+ return $this;
+ }
+
+ /**
+ * Set plugin loaders for use with decorators and elements
+ *
+ * @param Zend_Loader_PluginLoader_Interface $loader
+ * @param string $type 'filter' or 'validate'
+ * @return Zend_Filter_Input
+ * @throws Zend_Filter_Exception on invalid type
+ */
+ public function setPluginLoader(Zend_Loader_PluginLoader_Interface $loader, $type)
+ {
+ $type = strtolower($type);
+ switch ($type) {
+ case self::FILTER:
+ case self::VALIDATE:
+ $this->_loaders[$type] = $loader;
+ return $this;
+ default:
+ throw new Zend_Filter_Exception(sprintf('Invalid type "%s" provided to setPluginLoader()', $type));
+ }
+
+ return $this;
+ }
+
+ /**
+ * Retrieve plugin loader for given type
+ *
+ * $type may be one of:
+ * - filter
+ * - validator
+ *
+ * If a plugin loader does not exist for the given type, defaults are
+ * created.
+ *
+ * @param string $type 'filter' or 'validate'
+ * @return Zend_Loader_PluginLoader_Interface
+ * @throws Zend_Filter_Exception on invalid type
+ */
+ public function getPluginLoader($type)
+ {
+ $type = strtolower($type);
+ if (!isset($this->_loaders[$type])) {
+ switch ($type) {
+ case self::FILTER:
+ $prefixSegment = 'Zend_Filter_';
+ $pathSegment = 'Zend/Filter/';
+ break;
+ case self::VALIDATE:
+ $prefixSegment = 'Zend_Validate_';
+ $pathSegment = 'Zend/Validate/';
+ break;
+ default:
+ throw new Zend_Filter_Exception(sprintf('Invalid type "%s" provided to getPluginLoader()', $type));
+ }
+
+ $this->_loaders[$type] = new Zend_Loader_PluginLoader(
+ array($prefixSegment => $pathSegment)
+ );
+ }
+
+ return $this->_loaders[$type];
+ }
+
+ /**
+ * @return array
+ */
+ public function getMessages()
+ {
+ $this->_process();
+ return array_merge($this->_invalidMessages, $this->_missingFields);
+ }
+
+ /**
+ * @return array
+ */
+ public function getErrors()
+ {
+ $this->_process();
+ return $this->_invalidErrors;
+ }
+
+ /**
+ * @return array
+ */
+ public function getInvalid()
+ {
+ $this->_process();
+ return $this->_invalidMessages;
+ }
+
+ /**
+ * @return array
+ */
+ public function getMissing()
+ {
+ $this->_process();
+ return $this->_missingFields;
+ }
+
+ /**
+ * @return array
+ */
+ public function getUnknown()
+ {
+ $this->_process();
+ return $this->_unknownFields;
+ }
+
+ /**
+ * @param string $fieldName OPTIONAL
+ * @return mixed
+ */
+ public function getEscaped($fieldName = null)
+ {
+ $this->_process();
+ $this->_getDefaultEscapeFilter();
+
+ if ($fieldName === null) {
+ return $this->_escapeRecursive($this->_validFields);
+ }
+ if (array_key_exists($fieldName, $this->_validFields)) {
+ return $this->_escapeRecursive($this->_validFields[$fieldName]);
+ }
+ return null;
+ }
+
+ /**
+ * @param mixed $value
+ * @return mixed
+ */
+ protected function _escapeRecursive($data)
+ {
+ if($data === null) {
+ return $data;
+ }
+
+ if (!is_array($data)) {
+ return $this->_getDefaultEscapeFilter()->filter($data);
+ }
+ foreach ($data as &$element) {
+ $element = $this->_escapeRecursive($element);
+ }
+ return $data;
+ }
+
+ /**
+ * @param string $fieldName OPTIONAL
+ * @return mixed
+ */
+ public function getUnescaped($fieldName = null)
+ {
+ $this->_process();
+ if ($fieldName === null) {
+ return $this->_validFields;
+ }
+ if (array_key_exists($fieldName, $this->_validFields)) {
+ return $this->_validFields[$fieldName];
+ }
+ return null;
+ }
+
+ /**
+ * @param string $fieldName
+ * @return mixed
+ */
+ public function __get($fieldName)
+ {
+ return $this->getEscaped($fieldName);
+ }
+
+ /**
+ * @return boolean
+ */
+ public function hasInvalid()
+ {
+ $this->_process();
+ return !(empty($this->_invalidMessages));
+ }
+
+ /**
+ * @return boolean
+ */
+ public function hasMissing()
+ {
+ $this->_process();
+ return !(empty($this->_missingFields));
+ }
+
+ /**
+ * @return boolean
+ */
+ public function hasUnknown()
+ {
+ $this->_process();
+ return !(empty($this->_unknownFields));
+ }
+
+ /**
+ * @return boolean
+ */
+ public function hasValid()
+ {
+ $this->_process();
+ return !(empty($this->_validFields));
+ }
+
+ /**
+ * @param string $fieldName
+ * @return boolean
+ */
+ public function isValid($fieldName = null)
+ {
+ $this->_process();
+ if ($fieldName === null) {
+ return !($this->hasMissing() || $this->hasInvalid());
+ }
+ return array_key_exists($fieldName, $this->_validFields);
+ }
+
+ /**
+ * @param string $fieldName
+ * @return boolean
+ */
+ public function __isset($fieldName)
+ {
+ $this->_process();
+ return isset($this->_validFields[$fieldName]);
+ }
+
+ /**
+ * @return Zend_Filter_Input
+ * @throws Zend_Filter_Exception
+ */
+ public function process()
+ {
+ $this->_process();
+ if ($this->hasInvalid()) {
+ throw new Zend_Filter_Exception("Input has invalid fields");
+ }
+ if ($this->hasMissing()) {
+ throw new Zend_Filter_Exception("Input has missing fields");
+ }
+
+ return $this;
+ }
+
+ /**
+ * @param array $data
+ * @return Zend_Filter_Input
+ */
+ public function setData(array $data)
+ {
+ $this->_data = $data;
+
+ /**
+ * Reset to initial state
+ */
+ $this->_validFields = array();
+ $this->_invalidMessages = array();
+ $this->_invalidErrors = array();
+ $this->_missingFields = array();
+ $this->_unknownFields = array();
+
+ $this->_processed = false;
+
+ return $this;
+ }
+
+ /**
+ * @param mixed $escapeFilter
+ * @return Zend_Filter_Interface
+ */
+ public function setDefaultEscapeFilter($escapeFilter)
+ {
+ if (is_string($escapeFilter) || is_array($escapeFilter)) {
+ $escapeFilter = $this->_getFilter($escapeFilter);
+ }
+ if (!$escapeFilter instanceof Zend_Filter_Interface) {
+ throw new Zend_Filter_Exception('Escape filter specified does not implement Zend_Filter_Interface');
+ }
+ $this->_defaultEscapeFilter = $escapeFilter;
+ return $escapeFilter;
+ }
+
+ /**
+ * @param array $options
+ * @return Zend_Filter_Input
+ * @throws Zend_Filter_Exception if an unknown option is given
+ */
+ public function setOptions(array $options)
+ {
+ foreach ($options as $option => $value) {
+ switch ($option) {
+ case self::ESCAPE_FILTER:
+ $this->setDefaultEscapeFilter($value);
+ break;
+ case self::INPUT_NAMESPACE:
+ $this->addNamespace($value);
+ break;
+ case self::VALIDATOR_NAMESPACE:
+ if(is_string($value)) {
+ $value = array($value);
+ }
+
+ foreach($value AS $prefix) {
+ $this->addValidatorPrefixPath(
+ $prefix,
+ str_replace('_', DIRECTORY_SEPARATOR, $prefix)
+ );
+ }
+ break;
+ case self::FILTER_NAMESPACE:
+ if(is_string($value)) {
+ $value = array($value);
+ }
+
+ foreach($value AS $prefix) {
+ $this->addFilterPrefixPath(
+ $prefix,
+ str_replace('_', DIRECTORY_SEPARATOR, $prefix)
+ );
+ }
+ break;
+ case self::ALLOW_EMPTY:
+ case self::BREAK_CHAIN:
+ case self::MISSING_MESSAGE:
+ case self::NOT_EMPTY_MESSAGE:
+ case self::PRESENCE:
+ $this->_defaults[$option] = $value;
+ break;
+ default:
+ throw new Zend_Filter_Exception("Unknown option '$option'");
+ break;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set translation object
+ *
+ * @param Zend_Translate|Zend_Translate_Adapter|null $translator
+ * @return Zend_Filter_Input
+ */
+ public function setTranslator($translator = null)
+ {
+ if ((null === $translator) || ($translator instanceof Zend_Translate_Adapter)) {
+ $this->_translator = $translator;
+ } elseif ($translator instanceof Zend_Translate) {
+ $this->_translator = $translator->getAdapter();
+ } else {
+ throw new Zend_Validate_Exception('Invalid translator specified');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Return translation object
+ *
+ * @return Zend_Translate_Adapter|null
+ */
+ public function getTranslator()
+ {
+ if ($this->translatorIsDisabled()) {
+ return null;
+ }
+
+ if ($this->_translator === null) {
+ if (Zend_Registry::isRegistered('Zend_Translate')) {
+ $translator = Zend_Registry::get('Zend_Translate');
+ if ($translator instanceof Zend_Translate_Adapter) {
+ return $translator;
+ } elseif ($translator instanceof Zend_Translate) {
+ return $translator->getAdapter();
+ }
+ }
+ }
+
+ return $this->_translator;
+ }
+
+ /**
+ * Indicate whether or not translation should be disabled
+ *
+ * @param bool $flag
+ * @return Zend_Filter_Input
+ */
+ public function setDisableTranslator($flag)
+ {
+ $this->_translatorDisabled = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Is translation disabled?
+ *
+ * @return bool
+ */
+ public function translatorIsDisabled()
+ {
+ return $this->_translatorDisabled;
+ }
+
+ /*
+ * Protected methods
+ */
+
+ /**
+ * @return void
+ */
+ protected function _filter()
+ {
+ foreach ($this->_filterRules as $ruleName => &$filterRule) {
+ /**
+ * Make sure we have an array representing this filter chain.
+ * Don't typecast to (array) because it might be a Zend_Filter object
+ */
+ if (!is_array($filterRule)) {
+ $filterRule = array($filterRule);
+ }
+
+ /**
+ * Filters are indexed by integer, metacommands are indexed by string.
+ * Pick out the filters.
+ */
+ $filterList = array();
+ foreach ($filterRule as $key => $value) {
+ if (is_int($key)) {
+ $filterList[] = $value;
+ }
+ }
+
+ /**
+ * Use defaults for filter metacommands.
+ */
+ $filterRule[self::RULE] = $ruleName;
+ if (!isset($filterRule[self::FIELDS])) {
+ $filterRule[self::FIELDS] = $ruleName;
+ }
+
+ /**
+ * Load all the filter classes and add them to the chain.
+ */
+ if (!isset($filterRule[self::FILTER_CHAIN])) {
+ $filterRule[self::FILTER_CHAIN] = new Zend_Filter();
+ foreach ($filterList as $filter) {
+ if (is_string($filter) || is_array($filter)) {
+ $filter = $this->_getFilter($filter);
+ }
+ $filterRule[self::FILTER_CHAIN]->addFilter($filter);
+ }
+ }
+
+ /**
+ * If the ruleName is the special wildcard rule,
+ * then apply the filter chain to all input data.
+ * Else just process the field named by the rule.
+ */
+ if ($ruleName == self::RULE_WILDCARD) {
+ foreach (array_keys($this->_data) as $field) {
+ $this->_filterRule(array_merge($filterRule, array(self::FIELDS => $field)));
+ }
+ } else {
+ $this->_filterRule($filterRule);
+ }
+ }
+ }
+
+ /**
+ * @param array $filterRule
+ * @return void
+ */
+ protected function _filterRule(array $filterRule)
+ {
+ $field = $filterRule[self::FIELDS];
+ if (!array_key_exists($field, $this->_data)) {
+ return;
+ }
+ if (is_array($this->_data[$field])) {
+ foreach ($this->_data[$field] as $key => $value) {
+ $this->_data[$field][$key] = $filterRule[self::FILTER_CHAIN]->filter($value);
+ }
+ } else {
+ $this->_data[$field] =
+ $filterRule[self::FILTER_CHAIN]->filter($this->_data[$field]);
+ }
+ }
+
+ /**
+ * @return Zend_Filter_Interface
+ */
+ protected function _getDefaultEscapeFilter()
+ {
+ if ($this->_defaultEscapeFilter !== null) {
+ return $this->_defaultEscapeFilter;
+ }
+ return $this->setDefaultEscapeFilter($this->_defaults[self::ESCAPE_FILTER]);
+ }
+
+ /**
+ * @param string $rule
+ * @param string $field
+ * @return string
+ */
+ protected function _getMissingMessage($rule, $field)
+ {
+ $message = $this->_defaults[self::MISSING_MESSAGE];
+
+ if (null !== ($translator = $this->getTranslator())) {
+ if ($translator->isTranslated(self::MISSING_MESSAGE)) {
+ $message = $translator->translate(self::MISSING_MESSAGE);
+ } else {
+ $message = $translator->translate($message);
+ }
+ }
+
+ $message = str_replace('%rule%', $rule, $message);
+ $message = str_replace('%field%', $field, $message);
+ return $message;
+ }
+
+ /**
+ * @return string
+ */
+ protected function _getNotEmptyMessage($rule, $field)
+ {
+ $message = $this->_defaults[self::NOT_EMPTY_MESSAGE];
+
+ if (null !== ($translator = $this->getTranslator())) {
+ if ($translator->isTranslated(self::NOT_EMPTY_MESSAGE)) {
+ $message = $translator->translate(self::NOT_EMPTY_MESSAGE);
+ } else {
+ $message = $translator->translate($message);
+ }
+ }
+
+ $message = str_replace('%rule%', $rule, $message);
+ $message = str_replace('%field%', $field, $message);
+ return $message;
+ }
+
+ /**
+ * @return void
+ */
+ protected function _process()
+ {
+ if ($this->_processed === false) {
+ $this->_filter();
+ $this->_validate();
+ $this->_processed = true;
+ }
+ }
+
+ /**
+ * @return void
+ */
+ protected function _validate()
+ {
+ /**
+ * Special case: if there are no validators, treat all fields as valid.
+ */
+ if (!$this->_validatorRules) {
+ $this->_validFields = $this->_data;
+ $this->_data = array();
+ return;
+ }
+
+ // remember the default not empty message in case we want to temporarily change it
+ $preserveDefaultNotEmptyMessage = $this->_defaults[self::NOT_EMPTY_MESSAGE];
+
+ foreach ($this->_validatorRules as $ruleName => &$validatorRule) {
+ /**
+ * Make sure we have an array representing this validator chain.
+ * Don't typecast to (array) because it might be a Zend_Validate object
+ */
+ if (!is_array($validatorRule)) {
+ $validatorRule = array($validatorRule);
+ }
+
+ /**
+ * Validators are indexed by integer, metacommands are indexed by string.
+ * Pick out the validators.
+ */
+ $validatorList = array();
+ foreach ($validatorRule as $key => $value) {
+ if (is_int($key)) {
+ $validatorList[$key] = $value;
+ }
+ }
+
+ /**
+ * Use defaults for validation metacommands.
+ */
+ $validatorRule[self::RULE] = $ruleName;
+ if (!isset($validatorRule[self::FIELDS])) {
+ $validatorRule[self::FIELDS] = $ruleName;
+ }
+ if (!isset($validatorRule[self::BREAK_CHAIN])) {
+ $validatorRule[self::BREAK_CHAIN] = $this->_defaults[self::BREAK_CHAIN];
+ }
+ if (!isset($validatorRule[self::PRESENCE])) {
+ $validatorRule[self::PRESENCE] = $this->_defaults[self::PRESENCE];
+ }
+ if (!isset($validatorRule[self::ALLOW_EMPTY])) {
+ $foundNotEmptyValidator = false;
+
+ foreach ($validatorRule as $rule) {
+ if ($rule === 'NotEmpty') {
+ $foundNotEmptyValidator = true;
+ // field may not be empty, we are ready
+ break 1;
+ }
+
+ if (is_array($rule)) {
+ $keys = array_keys($rule);
+ $classKey = array_shift($keys);
+ if (isset($rule[$classKey])) {
+ $ruleClass = $rule[$classKey];
+ if ($ruleClass === 'NotEmpty') {
+ $foundNotEmptyValidator = true;
+ // field may not be empty, we are ready
+ break 1;
+ }
+ }
+ }
+
+ // we must check if it is an object before using instanceof
+ if (!is_object($rule)) {
+ // it cannot be a NotEmpty validator, skip this one
+ continue;
+ }
+
+ if($rule instanceof Zend_Validate_NotEmpty) {
+ $foundNotEmptyValidator = true;
+ // field may not be empty, we are ready
+ break 1;
+ }
+ }
+
+ if (!$foundNotEmptyValidator) {
+ $validatorRule[self::ALLOW_EMPTY] = $this->_defaults[self::ALLOW_EMPTY];
+ } else {
+ $validatorRule[self::ALLOW_EMPTY] = false;
+ }
+ }
+
+ if (!isset($validatorRule[self::MESSAGES])) {
+ $validatorRule[self::MESSAGES] = array();
+ } else if (!is_array($validatorRule[self::MESSAGES])) {
+ $validatorRule[self::MESSAGES] = array($validatorRule[self::MESSAGES]);
+ } else if (array_intersect_key($validatorList, $validatorRule[self::MESSAGES])) {
+ // this seems pointless... it just re-adds what it already has...
+ // I can disable all this and not a single unit test fails...
+ // There are now corresponding numeric keys in the validation rule messages array
+ // Treat it as a named messages list for all rule validators
+ $unifiedMessages = $validatorRule[self::MESSAGES];
+ $validatorRule[self::MESSAGES] = array();
+
+ foreach ($validatorList as $key => $validator) {
+ if (array_key_exists($key, $unifiedMessages)) {
+ $validatorRule[self::MESSAGES][$key] = $unifiedMessages[$key];
+ }
+ }
+ }
+
+ /**
+ * Load all the validator classes and add them to the chain.
+ */
+ if (!isset($validatorRule[self::VALIDATOR_CHAIN])) {
+ $validatorRule[self::VALIDATOR_CHAIN] = new Zend_Validate();
+
+ foreach ($validatorList as $key => $validator) {
+ if (is_string($validator) || is_array($validator)) {
+ $validator = $this->_getValidator($validator);
+ }
+
+ if (isset($validatorRule[self::MESSAGES][$key])) {
+ $value = $validatorRule[self::MESSAGES][$key];
+ if (is_array($value)) {
+ $validator->setMessages($value);
+ } else {
+ $validator->setMessage($value);
+ }
+
+ if ($validator instanceof Zend_Validate_NotEmpty) {
+ /** we are changing the defaults here, this is alright if all subsequent validators are also a not empty
+ * validator, but it goes wrong if one of them is not AND is required!!!
+ * that is why we restore the default value at the end of this loop
+ */
+ if (is_array($value)) {
+ $temp = $value; // keep the original value
+ $this->_defaults[self::NOT_EMPTY_MESSAGE] = array_pop($temp);
+ unset($temp);
+ } else {
+ $this->_defaults[self::NOT_EMPTY_MESSAGE] = $value;
+ }
+ }
+ }
+
+ $validatorRule[self::VALIDATOR_CHAIN]->addValidator($validator, $validatorRule[self::BREAK_CHAIN]);
+ }
+ $validatorRule[self::VALIDATOR_CHAIN_COUNT] = count($validatorList);
+ }
+
+ /**
+ * If the ruleName is the special wildcard rule,
+ * then apply the validator chain to all input data.
+ * Else just process the field named by the rule.
+ */
+ if ($ruleName == self::RULE_WILDCARD) {
+ foreach (array_keys($this->_data) as $field) {
+ $this->_validateRule(array_merge($validatorRule, array(self::FIELDS => $field)));
+ }
+ } else {
+ $this->_validateRule($validatorRule);
+ }
+
+ // reset the default not empty message
+ $this->_defaults[self::NOT_EMPTY_MESSAGE] = $preserveDefaultNotEmptyMessage;
+ }
+
+
+
+ /**
+ * Unset fields in $_data that have been added to other arrays.
+ * We have to wait until all rules have been processed because
+ * a given field may be referenced by multiple rules.
+ */
+ foreach (array_merge(array_keys($this->_missingFields), array_keys($this->_invalidMessages)) as $rule) {
+ foreach ((array) $this->_validatorRules[$rule][self::FIELDS] as $field) {
+ unset($this->_data[$field]);
+ }
+ }
+ foreach ($this->_validFields as $field => $value) {
+ unset($this->_data[$field]);
+ }
+
+ /**
+ * Anything left over in $_data is an unknown field.
+ */
+ $this->_unknownFields = $this->_data;
+ }
+
+ /**
+ * @param array $validatorRule
+ * @return void
+ */
+ protected function _validateRule(array $validatorRule)
+ {
+ /**
+ * Get one or more data values from input, and check for missing fields.
+ * Apply defaults if fields are missing.
+ */
+ $data = array();
+ foreach ((array) $validatorRule[self::FIELDS] as $key => $field) {
+ if (array_key_exists($field, $this->_data)) {
+ $data[$field] = $this->_data[$field];
+ } else if (isset($validatorRule[self::DEFAULT_VALUE])) {
+ /** @todo according to this code default value can't be an array. It has to be reviewed */
+ if (!is_array($validatorRule[self::DEFAULT_VALUE])) {
+ // Default value is a scalar
+ $data[$field] = $validatorRule[self::DEFAULT_VALUE];
+ } else {
+ // Default value is an array. Search for corresponding key
+ if (isset($validatorRule[self::DEFAULT_VALUE][$key])) {
+ $data[$field] = $validatorRule[self::DEFAULT_VALUE][$key];
+ } else if ($validatorRule[self::PRESENCE] == self::PRESENCE_REQUIRED) {
+ // Default value array is provided, but it doesn't have an entry for current field
+ // and presence is required
+ $this->_missingFields[$validatorRule[self::RULE]][] =
+ $this->_getMissingMessage($validatorRule[self::RULE], $field);
+ }
+ }
+ } else if ($validatorRule[self::PRESENCE] == self::PRESENCE_REQUIRED) {
+ $this->_missingFields[$validatorRule[self::RULE]][] =
+ $this->_getMissingMessage($validatorRule[self::RULE], $field);
+ }
+ }
+
+ /**
+ * If any required fields are missing, break the loop.
+ */
+ if (isset($this->_missingFields[$validatorRule[self::RULE]]) && count($this->_missingFields[$validatorRule[self::RULE]]) > 0) {
+ return;
+ }
+
+ /**
+ * Evaluate the inputs against the validator chain.
+ */
+ if (count((array) $validatorRule[self::FIELDS]) > 1) {
+ if (!$validatorRule[self::ALLOW_EMPTY]) {
+ $emptyFieldsFound = false;
+ $errorsList = array();
+ $messages = array();
+
+ foreach ($data as $fieldKey => $field) {
+ // if there is no Zend_Validate_NotEmpty instance in the rules, we will use the default
+ if (!($notEmptyValidator = $this->_getNotEmptyValidatorInstance($validatorRule))) {
+ $notEmptyValidator = $this->_getValidator('NotEmpty');
+ $notEmptyValidator->setMessage($this->_getNotEmptyMessage($validatorRule[self::RULE], $fieldKey));
+ }
+
+ if (!$notEmptyValidator->isValid($field)) {
+ foreach ($notEmptyValidator->getMessages() as $messageKey => $message) {
+ if (!isset($messages[$messageKey])) {
+ $messages[$messageKey] = $message;
+ } else {
+ $messages[] = $message;
+ }
+ }
+ $errorsList[] = $notEmptyValidator->getErrors();
+ $emptyFieldsFound = true;
+ }
+ }
+
+ if ($emptyFieldsFound) {
+ $this->_invalidMessages[$validatorRule[self::RULE]] = $messages;
+ $this->_invalidErrors[$validatorRule[self::RULE]] = array_unique(call_user_func_array('array_merge', $errorsList));
+ return;
+ }
+ }
+
+ if (!$validatorRule[self::VALIDATOR_CHAIN]->isValid($data)) {
+ $this->_invalidMessages[$validatorRule[self::RULE]] = $validatorRule[self::VALIDATOR_CHAIN]->getMessages();
+ $this->_invalidErrors[$validatorRule[self::RULE]] = $validatorRule[self::VALIDATOR_CHAIN]->getErrors();
+ return;
+ }
+ } else if (count($data) > 0) {
+ // $data is actually a one element array
+ $fieldNames = array_keys($data);
+ $fieldName = reset($fieldNames);
+ $field = reset($data);
+
+ $failed = false;
+ if (!is_array($field)) {
+ $field = array($field);
+ }
+
+ // if there is no Zend_Validate_NotEmpty instance in the rules, we will use the default
+ if (!($notEmptyValidator = $this->_getNotEmptyValidatorInstance($validatorRule))) {
+ $notEmptyValidator = $this->_getValidator('NotEmpty');
+ $notEmptyValidator->setMessage($this->_getNotEmptyMessage($validatorRule[self::RULE], $fieldName));
+ }
+
+ if ($validatorRule[self::ALLOW_EMPTY]) {
+ $validatorChain = $validatorRule[self::VALIDATOR_CHAIN];
+ } else {
+ $validatorChain = new Zend_Validate();
+ $validatorChain->addValidator($notEmptyValidator, true /* Always break on failure */);
+ $validatorChain->addValidator($validatorRule[self::VALIDATOR_CHAIN]);
+ }
+
+ foreach ($field as $key => $value) {
+ if ($validatorRule[self::ALLOW_EMPTY] && !$notEmptyValidator->isValid($value)) {
+ // Field is empty AND it's allowed. Do nothing.
+ continue;
+ }
+
+ if (!$validatorChain->isValid($value)) {
+ if (isset($this->_invalidMessages[$validatorRule[self::RULE]])) {
+ $collectedMessages = $this->_invalidMessages[$validatorRule[self::RULE]];
+ } else {
+ $collectedMessages = array();
+ }
+
+ foreach ($validatorChain->getMessages() as $messageKey => $message) {
+ if (!isset($collectedMessages[$messageKey])) {
+ $collectedMessages[$messageKey] = $message;
+ } else {
+ $collectedMessages[] = $message;
+ }
+ }
+
+ $this->_invalidMessages[$validatorRule[self::RULE]] = $collectedMessages;
+ if (isset($this->_invalidErrors[$validatorRule[self::RULE]])) {
+ $this->_invalidErrors[$validatorRule[self::RULE]] = array_merge($this->_invalidErrors[$validatorRule[self::RULE]],
+ $validatorChain->getErrors());
+ } else {
+ $this->_invalidErrors[$validatorRule[self::RULE]] = $validatorChain->getErrors();
+ }
+ unset($this->_validFields[$fieldName]);
+ $failed = true;
+ if ($validatorRule[self::BREAK_CHAIN]) {
+ return;
+ }
+ }
+ }
+ if ($failed) {
+ return;
+ }
+ }
+
+ /**
+ * If we got this far, the inputs for this rule pass validation.
+ */
+ foreach ((array) $validatorRule[self::FIELDS] as $field) {
+ if (array_key_exists($field, $data)) {
+ $this->_validFields[$field] = $data[$field];
+ }
+ }
+ }
+
+ /**
+ * Check a validatorRule for the presence of a NotEmpty validator instance.
+ * The purpose is to preserve things like a custom message, that may have been
+ * set on the validator outside Zend_Filter_Input.
+ * @param array $validatorRule
+ * @return mixed false if none is found, Zend_Validate_NotEmpty instance if found
+ */
+ protected function _getNotEmptyValidatorInstance($validatorRule) {
+ foreach ($validatorRule as $rule => $value) {
+ if (is_object($value) and $value instanceof Zend_Validate_NotEmpty) {
+ return $value;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * @param mixed $classBaseName
+ * @return Zend_Filter_Interface
+ */
+ protected function _getFilter($classBaseName)
+ {
+ return $this->_getFilterOrValidator(self::FILTER, $classBaseName);
+ }
+
+ /**
+ * @param mixed $classBaseName
+ * @return Zend_Validate_Interface
+ */
+ protected function _getValidator($classBaseName)
+ {
+ return $this->_getFilterOrValidator(self::VALIDATE, $classBaseName);
+ }
+
+ /**
+ * @param string $type
+ * @param mixed $classBaseName
+ * @return Zend_Filter_Interface|Zend_Validate_Interface
+ * @throws Zend_Filter_Exception
+ */
+ protected function _getFilterOrValidator($type, $classBaseName)
+ {
+ $args = array();
+
+ if (is_array($classBaseName)) {
+ $args = $classBaseName;
+ $classBaseName = array_shift($args);
+ }
+
+ $interfaceName = 'Zend_' . ucfirst($type) . '_Interface';
+ $className = $this->getPluginLoader($type)->load(ucfirst($classBaseName));
+
+ $class = new ReflectionClass($className);
+
+ if (!$class->implementsInterface($interfaceName)) {
+ throw new Zend_Filter_Exception("Class '$className' based on basename '$classBaseName' must implement the '$interfaceName' interface");
+ }
+
+ if ($class->hasMethod('__construct')) {
+ $object = $class->newInstanceArgs(array_values($args));
+ } else {
+ $object = $class->newInstance();
+ }
+
+ return $object;
+ }
+
+}
diff --git a/library/vendor/Zend/Filter/Int.php b/library/vendor/Zend/Filter/Int.php
new file mode 100644
index 0000000..ed7f9e8
--- /dev/null
+++ b/library/vendor/Zend/Filter/Int.php
@@ -0,0 +1,49 @@
+<?php
+
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Int implements Zend_Filter_Interface
+{
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Returns (int) $value
+ *
+ * @param string $value
+ * @return integer
+ */
+ public function filter($value)
+ {
+ return (int) ((string) $value);
+ }
+}
diff --git a/library/vendor/Zend/Filter/Interface.php b/library/vendor/Zend/Filter/Interface.php
new file mode 100644
index 0000000..3d9e65a
--- /dev/null
+++ b/library/vendor/Zend/Filter/Interface.php
@@ -0,0 +1,40 @@
+<?php
+
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Filter_Interface
+{
+ /**
+ * Returns the result of filtering $value
+ *
+ * @param mixed $value
+ * @throws Zend_Filter_Exception If filtering $value is impossible
+ * @return mixed
+ */
+ public function filter($value);
+}
diff --git a/library/vendor/Zend/Filter/LocalizedToNormalized.php b/library/vendor/Zend/Filter/LocalizedToNormalized.php
new file mode 100644
index 0000000..ca6b045
--- /dev/null
+++ b/library/vendor/Zend/Filter/LocalizedToNormalized.php
@@ -0,0 +1,110 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * @see Zend_Loader
+ */
+
+/**
+ * Normalizes given localized input
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_LocalizedToNormalized implements Zend_Filter_Interface
+{
+ /**
+ * Set options
+ * @var array
+ */
+ protected $_options = array(
+ 'locale' => null,
+ 'date_format' => null,
+ 'precision' => null
+ );
+
+ /**
+ * Class constructor
+ *
+ * @param string|Zend_Locale $locale (Optional) Locale to set
+ */
+ public function __construct($options = null)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ }
+
+ if (null !== $options) {
+ $this->setOptions($options);
+ }
+ }
+
+ /**
+ * Returns the set options
+ *
+ * @return array
+ */
+ public function getOptions()
+ {
+ return $this->_options;
+ }
+
+ /**
+ * Sets options to use
+ *
+ * @param array $options (Optional) Options to use
+ * @return Zend_Filter_LocalizedToNormalized
+ */
+ public function setOptions(array $options = null)
+ {
+ $this->_options = $options + $this->_options;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Normalizes the given input
+ *
+ * @param string $value Value to normalized
+ * @return string|array The normalized value
+ */
+ public function filter($value)
+ {
+ if (Zend_Locale_Format::isNumber($value, $this->_options)) {
+ return Zend_Locale_Format::getNumber($value, $this->_options);
+ } else if (($this->_options['date_format'] === null) && (strpos($value, ':') !== false)) {
+ // Special case, no date format specified, detect time input
+ return Zend_Locale_Format::getTime($value, $this->_options);
+ } else if (Zend_Locale_Format::checkDateFormat($value, $this->_options)) {
+ // Detect date or time input
+ return Zend_Locale_Format::getDate($value, $this->_options);
+ }
+
+ return $value;
+ }
+}
diff --git a/library/vendor/Zend/Filter/NormalizedToLocalized.php b/library/vendor/Zend/Filter/NormalizedToLocalized.php
new file mode 100644
index 0000000..54224ca
--- /dev/null
+++ b/library/vendor/Zend/Filter/NormalizedToLocalized.php
@@ -0,0 +1,108 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * @see Zend_Loader
+ */
+
+/**
+ * Localizes given normalized input
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_NormalizedToLocalized implements Zend_Filter_Interface
+{
+ /**
+ * Set options
+ */
+ protected $_options = array(
+ 'locale' => null,
+ 'date_format' => null,
+ 'precision' => null
+ );
+
+ /**
+ * Class constructor
+ *
+ * @param string|Zend_Locale $locale (Optional) Locale to set
+ */
+ public function __construct($options = null)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ }
+
+ if (null !== $options) {
+ $this->setOptions($options);
+ }
+ }
+
+ /**
+ * Returns the set options
+ *
+ * @return array
+ */
+ public function getOptions()
+ {
+ return $this->_options;
+ }
+
+ /**
+ * Sets options to use
+ *
+ * @param array $options (Optional) Options to use
+ * @return Zend_Filter_LocalizedToNormalized
+ */
+ public function setOptions(array $options = null)
+ {
+ $this->_options = $options + $this->_options;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Normalizes the given input
+ *
+ * @param string $value Value to normalized
+ * @return string|array The normalized value
+ */
+ public function filter($value)
+ {
+ if (is_array($value)) {
+ $date = new Zend_Date($value, $this->_options['locale']);
+ return $date->toString($this->_options['date_format']);
+ } else if ($this->_options['precision'] === 0) {
+ return Zend_Locale_Format::toInteger($value, $this->_options);
+ } else if ($this->_options['precision'] === null) {
+ return Zend_Locale_Format::toFloat($value, $this->_options);
+ }
+
+ return Zend_Locale_Format::toNumber($value, $this->_options);
+ }
+}
diff --git a/library/vendor/Zend/Filter/Null.php b/library/vendor/Zend/Filter/Null.php
new file mode 100644
index 0000000..14a79f2
--- /dev/null
+++ b/library/vendor/Zend/Filter/Null.php
@@ -0,0 +1,181 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Null implements Zend_Filter_Interface
+{
+ const BOOLEAN = 1;
+ const INTEGER = 2;
+ const EMPTY_ARRAY = 4;
+ const STRING = 8;
+ const ZERO = 16;
+ const ALL = 31;
+
+ protected $_constants = array(
+ self::BOOLEAN => 'boolean',
+ self::INTEGER => 'integer',
+ self::EMPTY_ARRAY => 'array',
+ self::STRING => 'string',
+ self::ZERO => 'zero',
+ self::ALL => 'all'
+ );
+
+ /**
+ * Internal type to detect
+ *
+ * @var integer
+ */
+ protected $_type = self::ALL;
+
+ /**
+ * Constructor
+ *
+ * @param string|array|Zend_Config $options OPTIONAL
+ */
+ public function __construct($options = null)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (!is_array($options)) {
+ $options = func_get_args();
+ $temp = array();
+ if (!empty($options)) {
+ $temp = array_shift($options);
+ }
+ $options = $temp;
+ } else if (is_array($options) && array_key_exists('type', $options)) {
+ $options = $options['type'];
+ }
+
+ if (!empty($options)) {
+ $this->setType($options);
+ }
+ }
+
+ /**
+ * Returns the set null types
+ *
+ * @return array
+ */
+ public function getType()
+ {
+ return $this->_type;
+ }
+
+ /**
+ * Set the null types
+ *
+ * @param integer|array $type
+ * @throws Zend_Filter_Exception
+ * @return Zend_Filter_Null
+ */
+ public function setType($type = null)
+ {
+ if (is_array($type)) {
+ $detected = 0;
+ foreach($type as $value) {
+ if (is_int($value)) {
+ $detected += $value;
+ } else if (in_array($value, $this->_constants)) {
+ $detected += array_search($value, $this->_constants);
+ }
+ }
+
+ $type = $detected;
+ } else if (is_string($type)) {
+ if (in_array($type, $this->_constants)) {
+ $type = array_search($type, $this->_constants);
+ }
+ }
+
+ if (!is_int($type) || ($type < 0) || ($type > self::ALL)) {
+ throw new Zend_Filter_Exception('Unknown type');
+ }
+
+ $this->_type = $type;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Returns null representation of $value, if value is empty and matches
+ * types that should be considered null.
+ *
+ * @param string $value
+ * @return string
+ */
+ public function filter($value)
+ {
+ $type = $this->getType();
+
+ // STRING ZERO ('0')
+ if ($type >= self::ZERO) {
+ $type -= self::ZERO;
+ if (is_string($value) && ($value == '0')) {
+ return null;
+ }
+ }
+
+ // STRING ('')
+ if ($type >= self::STRING) {
+ $type -= self::STRING;
+ if (is_string($value) && ($value == '')) {
+ return null;
+ }
+ }
+
+ // EMPTY_ARRAY (array())
+ if ($type >= self::EMPTY_ARRAY) {
+ $type -= self::EMPTY_ARRAY;
+ if (is_array($value) && ($value == array())) {
+ return null;
+ }
+ }
+
+ // INTEGER (0)
+ if ($type >= self::INTEGER) {
+ $type -= self::INTEGER;
+ if (is_int($value) && ($value == 0)) {
+ return null;
+ }
+ }
+
+ // BOOLEAN (false)
+ if ($type >= self::BOOLEAN) {
+ $type -= self::BOOLEAN;
+ if (is_bool($value) && ($value == false)) {
+ return null;
+ }
+ }
+
+ return $value;
+ }
+}
diff --git a/library/vendor/Zend/Filter/PregReplace.php b/library/vendor/Zend/Filter/PregReplace.php
new file mode 100644
index 0000000..a4714d6
--- /dev/null
+++ b/library/vendor/Zend/Filter/PregReplace.php
@@ -0,0 +1,172 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_PregReplace implements Zend_Filter_Interface
+{
+ /**
+ * Pattern to match
+ * @var mixed
+ */
+ protected $_matchPattern = null;
+
+ /**
+ * Replacement pattern
+ * @var mixed
+ */
+ protected $_replacement = '';
+
+ /**
+ * Is unicode enabled?
+ *
+ * @var bool
+ */
+ static protected $_unicodeSupportEnabled = null;
+
+ /**
+ * Is Unicode Support Enabled Utility function
+ *
+ * @return bool
+ */
+ static public function isUnicodeSupportEnabled()
+ {
+ if (self::$_unicodeSupportEnabled === null) {
+ self::_determineUnicodeSupport();
+ }
+
+ return self::$_unicodeSupportEnabled;
+ }
+
+ /**
+ * Method to cache the regex needed to determine if unicode support is available
+ *
+ * @return bool
+ */
+ static protected function _determineUnicodeSupport()
+ {
+ self::$_unicodeSupportEnabled = (@preg_match('/\pL/u', 'a')) ? true : false;
+ }
+
+ /**
+ * Constructor
+ * Supported options are
+ * 'match' => matching pattern
+ * 'replace' => replace with this
+ *
+ * @param string|array $options
+ * @return void
+ */
+ public function __construct($options = null)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (!is_array($options)) {
+ $options = func_get_args();
+ $temp = array();
+ if (!empty($options)) {
+ $temp['match'] = array_shift($options);
+ }
+
+ if (!empty($options)) {
+ $temp['replace'] = array_shift($options);
+ }
+
+ $options = $temp;
+ }
+
+ if (array_key_exists('match', $options)) {
+ $this->setMatchPattern($options['match']);
+ }
+
+ if (array_key_exists('replace', $options)) {
+ $this->setReplacement($options['replace']);
+ }
+ }
+
+ /**
+ * Set the match pattern for the regex being called within filter()
+ *
+ * @param mixed $match - same as the first argument of preg_replace
+ * @return Zend_Filter_PregReplace
+ */
+ public function setMatchPattern($match)
+ {
+ $this->_matchPattern = $match;
+ return $this;
+ }
+
+ /**
+ * Get currently set match pattern
+ *
+ * @return string
+ */
+ public function getMatchPattern()
+ {
+ return $this->_matchPattern;
+ }
+
+ /**
+ * Set the Replacement pattern/string for the preg_replace called in filter
+ *
+ * @param mixed $replacement - same as the second argument of preg_replace
+ * @return Zend_Filter_PregReplace
+ */
+ public function setReplacement($replacement)
+ {
+ $this->_replacement = $replacement;
+ return $this;
+ }
+
+ /**
+ * Get currently set replacement value
+ *
+ * @return string
+ */
+ public function getReplacement()
+ {
+ return $this->_replacement;
+ }
+
+ /**
+ * Perform regexp replacement as filter
+ *
+ * @param string $value
+ * @return string
+ */
+ public function filter($value)
+ {
+ if ($this->_matchPattern == null) {
+ throw new Zend_Filter_Exception(get_class($this) . ' does not have a valid MatchPattern set.');
+ }
+
+ return preg_replace($this->_matchPattern, $this->_replacement, $value);
+ }
+
+}
diff --git a/library/vendor/Zend/Filter/RealPath.php b/library/vendor/Zend/Filter/RealPath.php
new file mode 100644
index 0000000..3cc3c99
--- /dev/null
+++ b/library/vendor/Zend/Filter/RealPath.php
@@ -0,0 +1,133 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_RealPath implements Zend_Filter_Interface
+{
+ /**
+ * @var boolean $_pathExists
+ */
+ protected $_exists = true;
+
+ /**
+ * Class constructor
+ *
+ * @param boolean|Zend_Config $options Options to set
+ */
+ public function __construct($options = true)
+ {
+ $this->setExists($options);
+ }
+
+ /**
+ * Returns true if the filtered path must exist
+ *
+ * @return boolean
+ */
+ public function getExists()
+ {
+ return $this->_exists;
+ }
+
+ /**
+ * Sets if the path has to exist
+ * TRUE when the path must exist
+ * FALSE when not existing paths can be given
+ *
+ * @param boolean|Zend_Config $exists Path must exist
+ * @return Zend_Filter_RealPath
+ */
+ public function setExists($exists)
+ {
+ if ($exists instanceof Zend_Config) {
+ $exists = $exists->toArray();
+ }
+
+ if (is_array($exists)) {
+ if (isset($exists['exists'])) {
+ $exists = (boolean) $exists['exists'];
+ }
+ }
+
+ $this->_exists = (boolean) $exists;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Returns realpath($value)
+ *
+ * @param string $value
+ * @return string
+ */
+ public function filter($value)
+ {
+ $path = (string) $value;
+ if ($this->_exists) {
+ return realpath($path);
+ }
+
+ $realpath = @realpath($path);
+ if ($realpath) {
+ return $realpath;
+ }
+
+ $drive = '';
+ if (substr(PHP_OS, 0, 3) == 'WIN') {
+ $path = preg_replace('/[\\\\\/]/', DIRECTORY_SEPARATOR, $path);
+ if (preg_match('/([a-zA-Z]\:)(.*)/', $path, $matches)) {
+ list($fullMatch, $drive, $path) = $matches;
+ } else {
+ $cwd = getcwd();
+ $drive = substr($cwd, 0, 2);
+ if (substr($path, 0, 1) != DIRECTORY_SEPARATOR) {
+ $path = substr($cwd, 3) . DIRECTORY_SEPARATOR . $path;
+ }
+ }
+ } elseif (substr($path, 0, 1) != DIRECTORY_SEPARATOR) {
+ $path = getcwd() . DIRECTORY_SEPARATOR . $path;
+ }
+
+ $stack = array();
+ $parts = explode(DIRECTORY_SEPARATOR, $path);
+ foreach ($parts as $dir) {
+ if (strlen($dir) && $dir !== '.') {
+ if ($dir == '..') {
+ array_pop($stack);
+ } else {
+ array_push($stack, $dir);
+ }
+ }
+ }
+
+ return $drive . DIRECTORY_SEPARATOR . implode(DIRECTORY_SEPARATOR, $stack);
+ }
+}
diff --git a/library/vendor/Zend/Filter/StringToLower.php b/library/vendor/Zend/Filter/StringToLower.php
new file mode 100644
index 0000000..c91072b
--- /dev/null
+++ b/library/vendor/Zend/Filter/StringToLower.php
@@ -0,0 +1,118 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_StringToLower implements Zend_Filter_Interface
+{
+ /**
+ * Encoding for the input string
+ *
+ * @var string
+ */
+ protected $_encoding = null;
+
+ /**
+ * Constructor
+ *
+ * @param string|array|Zend_Config $options OPTIONAL
+ */
+ public function __construct($options = null)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (!is_array($options)) {
+ $options = func_get_args();
+ $temp = array();
+ if (!empty($options)) {
+ $temp['encoding'] = array_shift($options);
+ }
+ $options = $temp;
+ }
+
+ if (!array_key_exists('encoding', $options) && function_exists('mb_internal_encoding')) {
+ $options['encoding'] = mb_internal_encoding();
+ }
+
+ if (array_key_exists('encoding', $options)) {
+ $this->setEncoding($options['encoding']);
+ }
+ }
+
+ /**
+ * Returns the set encoding
+ *
+ * @return string
+ */
+ public function getEncoding()
+ {
+ return $this->_encoding;
+ }
+
+ /**
+ * Set the input encoding for the given string
+ *
+ * @param string $encoding
+ * @return Zend_Filter_StringToLower Provides a fluent interface
+ * @throws Zend_Filter_Exception
+ */
+ public function setEncoding($encoding = null)
+ {
+ if ($encoding !== null) {
+ if (!function_exists('mb_strtolower')) {
+ throw new Zend_Filter_Exception('mbstring is required for this feature');
+ }
+
+ $encoding = (string) $encoding;
+ if (!in_array(strtolower($encoding), array_map('strtolower', mb_list_encodings()))) {
+ throw new Zend_Filter_Exception("The given encoding '$encoding' is not supported by mbstring");
+ }
+ }
+
+ $this->_encoding = $encoding;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Returns the string $value, converting characters to lowercase as necessary
+ *
+ * @param string $value
+ * @return string
+ */
+ public function filter($value)
+ {
+ if ($this->_encoding !== null) {
+ return mb_strtolower((string) $value, $this->_encoding);
+ }
+
+ return strtolower((string) $value);
+ }
+}
diff --git a/library/vendor/Zend/Filter/StringToUpper.php b/library/vendor/Zend/Filter/StringToUpper.php
new file mode 100644
index 0000000..1276c8e
--- /dev/null
+++ b/library/vendor/Zend/Filter/StringToUpper.php
@@ -0,0 +1,118 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_StringToUpper implements Zend_Filter_Interface
+{
+ /**
+ * Encoding for the input string
+ *
+ * @var string
+ */
+ protected $_encoding = null;
+
+ /**
+ * Constructor
+ *
+ * @param string|array $options OPTIONAL
+ */
+ public function __construct($options = null)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (!is_array($options)) {
+ $options = func_get_args();
+ $temp = array();
+ if (!empty($options)) {
+ $temp['encoding'] = array_shift($options);
+ }
+ $options = $temp;
+ }
+
+ if (!array_key_exists('encoding', $options) && function_exists('mb_internal_encoding')) {
+ $options['encoding'] = mb_internal_encoding();
+ }
+
+ if (array_key_exists('encoding', $options)) {
+ $this->setEncoding($options['encoding']);
+ }
+ }
+
+ /**
+ * Returns the set encoding
+ *
+ * @return string
+ */
+ public function getEncoding()
+ {
+ return $this->_encoding;
+ }
+
+ /**
+ * Set the input encoding for the given string
+ *
+ * @param string $encoding
+ * @return Zend_Filter_StringToUpper Provides a fluent interface
+ * @throws Zend_Filter_Exception
+ */
+ public function setEncoding($encoding = null)
+ {
+ if ($encoding !== null) {
+ if (!function_exists('mb_strtoupper')) {
+ throw new Zend_Filter_Exception('mbstring is required for this feature');
+ }
+
+ $encoding = (string) $encoding;
+ if (!in_array(strtolower($encoding), array_map('strtolower', mb_list_encodings()))) {
+ throw new Zend_Filter_Exception("The given encoding '$encoding' is not supported by mbstring");
+ }
+ }
+
+ $this->_encoding = $encoding;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Returns the string $value, converting characters to uppercase as necessary
+ *
+ * @param string $value
+ * @return string
+ */
+ public function filter($value)
+ {
+ if ($this->_encoding) {
+ return mb_strtoupper((string) $value, $this->_encoding);
+ }
+
+ return strtoupper((string) $value);
+ }
+}
diff --git a/library/vendor/Zend/Filter/StringTrim.php b/library/vendor/Zend/Filter/StringTrim.php
new file mode 100644
index 0000000..8006ec9
--- /dev/null
+++ b/library/vendor/Zend/Filter/StringTrim.php
@@ -0,0 +1,123 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_StringTrim implements Zend_Filter_Interface
+{
+ /**
+ * List of characters provided to the trim() function
+ *
+ * If this is null, then trim() is called with no specific character list,
+ * and its default behavior will be invoked, trimming whitespace.
+ *
+ * @var string|null
+ */
+ protected $_charList;
+
+ /**
+ * Sets filter options
+ *
+ * @param string|array|Zend_Config $options
+ * @return void
+ */
+ public function __construct($options = null)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (!is_array($options)) {
+ $options = func_get_args();
+ $temp['charlist'] = array_shift($options);
+ $options = $temp;
+ }
+
+ if (array_key_exists('charlist', $options)) {
+ $this->setCharList($options['charlist']);
+ }
+ }
+
+ /**
+ * Returns the charList option
+ *
+ * @return string|null
+ */
+ public function getCharList()
+ {
+ return $this->_charList;
+ }
+
+ /**
+ * Sets the charList option
+ *
+ * @param string|null $charList
+ * @return Zend_Filter_StringTrim Provides a fluent interface
+ */
+ public function setCharList($charList)
+ {
+ $this->_charList = $charList;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Returns the string $value with characters stripped from the beginning and end
+ *
+ * @param string $value
+ * @return string
+ */
+ public function filter($value)
+ {
+ if (null === $this->_charList) {
+ return $this->_unicodeTrim((string) $value);
+ } else {
+ return $this->_unicodeTrim((string) $value, $this->_charList);
+ }
+ }
+
+ /**
+ * Unicode aware trim method
+ * Fixes a PHP problem
+ *
+ * @param string $value
+ * @param string $charlist
+ * @return string
+ */
+ protected function _unicodeTrim($value, $charlist = '\\\\s')
+ {
+ $chars = preg_replace(
+ array( '/[\^\-\]\\\]/S', '/\\\{4}/S', '/\//'),
+ array( '\\\\\\0', '\\', '\/' ),
+ $charlist
+ );
+
+ $pattern = '^[' . $chars . ']*|[' . $chars . ']*$';
+ return preg_replace("/$pattern/sSD", '', $value);
+ }
+}
diff --git a/library/vendor/Zend/Filter/StripNewlines.php b/library/vendor/Zend/Filter/StripNewlines.php
new file mode 100644
index 0000000..91f6342
--- /dev/null
+++ b/library/vendor/Zend/Filter/StripNewlines.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_StripNewlines implements Zend_Filter_Interface
+{
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Returns $value without newline control characters
+ *
+ * @param string $value
+ * @return string
+ */
+ public function filter ($value)
+ {
+ return str_replace(array("\n", "\r"), '', $value);
+ }
+}
diff --git a/library/vendor/Zend/Filter/StripTags.php b/library/vendor/Zend/Filter/StripTags.php
new file mode 100644
index 0000000..99d7a86
--- /dev/null
+++ b/library/vendor/Zend/Filter/StripTags.php
@@ -0,0 +1,351 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_StripTags implements Zend_Filter_Interface
+{
+ /**
+ * Unique ID prefix used for allowing comments
+ */
+ const UNIQUE_ID_PREFIX = '__Zend_Filter_StripTags__';
+
+ /**
+ * Whether comments are allowed
+ *
+ * If false (the default), then comments are removed from the input string.
+ *
+ * This setting is now deprecated, and ignored internally.
+ *
+ * @deprecated
+ * @var boolean
+ */
+ public $commentsAllowed = false;
+
+ /**
+ * Array of allowed tags and allowed attributes for each allowed tag
+ *
+ * Tags are stored in the array keys, and the array values are themselves
+ * arrays of the attributes allowed for the corresponding tag.
+ *
+ * @var array
+ */
+ protected $_tagsAllowed = array();
+
+ /**
+ * Array of allowed attributes for all allowed tags
+ *
+ * Attributes stored here are allowed for all of the allowed tags.
+ *
+ * @var array
+ */
+ protected $_attributesAllowed = array();
+
+ /**
+ * Sets the filter options
+ * Allowed options are
+ * 'allowTags' => Tags which are allowed
+ * 'allowAttribs' => Attributes which are allowed
+ * 'allowComments' => Are comments allowed ?
+ *
+ * @param string|array|Zend_Config $options
+ * @return void
+ */
+ public function __construct($options = null)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if ((!is_array($options)) || (is_array($options) && !array_key_exists('allowTags', $options) &&
+ !array_key_exists('allowAttribs', $options) && !array_key_exists('allowComments', $options))) {
+ $options = func_get_args();
+ $temp['allowTags'] = array_shift($options);
+ if (!empty($options)) {
+ $temp['allowAttribs'] = array_shift($options);
+ }
+
+ if (!empty($options)) {
+ $temp['allowComments'] = array_shift($options);
+ }
+
+ $options = $temp;
+ }
+
+ if (array_key_exists('allowTags', $options)) {
+ $this->setTagsAllowed($options['allowTags']);
+ }
+
+ if (array_key_exists('allowAttribs', $options)) {
+ $this->setAttributesAllowed($options['allowAttribs']);
+ }
+
+ if (array_key_exists('allowComments', $options)) {
+ $this->setCommentsAllowed($options['allowComments']);
+ }
+ }
+
+ /**
+ * Returns the commentsAllowed option
+ *
+ * This setting is now deprecated and ignored internally.
+ *
+ * @deprecated
+ * @return bool
+ */
+ public function getCommentsAllowed()
+ {
+ return $this->commentsAllowed;
+ }
+
+ /**
+ * Sets the commentsAllowed option
+ *
+ * This setting is now deprecated and ignored internally.
+ *
+ * @deprecated
+ * @param boolean $commentsAllowed
+ * @return Zend_Filter_StripTags Provides a fluent interface
+ */
+ public function setCommentsAllowed($commentsAllowed)
+ {
+ $this->commentsAllowed = (boolean) $commentsAllowed;
+ return $this;
+ }
+
+ /**
+ * Returns the tagsAllowed option
+ *
+ * @return array
+ */
+ public function getTagsAllowed()
+ {
+ return $this->_tagsAllowed;
+ }
+
+ /**
+ * Sets the tagsAllowed option
+ *
+ * @param array|string $tagsAllowed
+ * @return Zend_Filter_StripTags Provides a fluent interface
+ */
+ public function setTagsAllowed($tagsAllowed)
+ {
+ if (!is_array($tagsAllowed)) {
+ $tagsAllowed = array($tagsAllowed);
+ }
+
+ foreach ($tagsAllowed as $index => $element) {
+ // If the tag was provided without attributes
+ if (is_int($index) && is_string($element)) {
+ // Canonicalize the tag name
+ $tagName = strtolower($element);
+ // Store the tag as allowed with no attributes
+ $this->_tagsAllowed[$tagName] = array();
+ }
+ // Otherwise, if a tag was provided with attributes
+ else if (is_string($index) && (is_array($element) || is_string($element))) {
+ // Canonicalize the tag name
+ $tagName = strtolower($index);
+ // Canonicalize the attributes
+ if (is_string($element)) {
+ $element = array($element);
+ }
+ // Store the tag as allowed with the provided attributes
+ $this->_tagsAllowed[$tagName] = array();
+ foreach ($element as $attribute) {
+ if (is_string($attribute)) {
+ // Canonicalize the attribute name
+ $attributeName = strtolower($attribute);
+ $this->_tagsAllowed[$tagName][$attributeName] = null;
+ }
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns the attributesAllowed option
+ *
+ * @return array
+ */
+ public function getAttributesAllowed()
+ {
+ return $this->_attributesAllowed;
+ }
+
+ /**
+ * Sets the attributesAllowed option
+ *
+ * @param array|string $attributesAllowed
+ * @return Zend_Filter_StripTags Provides a fluent interface
+ */
+ public function setAttributesAllowed($attributesAllowed)
+ {
+ if (!is_array($attributesAllowed)) {
+ $attributesAllowed = array($attributesAllowed);
+ }
+
+ // Store each attribute as allowed
+ foreach ($attributesAllowed as $attribute) {
+ if (is_string($attribute)) {
+ // Canonicalize the attribute name
+ $attributeName = strtolower($attribute);
+ $this->_attributesAllowed[$attributeName] = null;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * @todo improve docblock descriptions
+ *
+ * @param string $value
+ * @return string
+ */
+ public function filter($value)
+ {
+ $value = (string) $value;
+
+ // Strip HTML comments first
+ while (strpos($value, '<!--') !== false) {
+ $pos = strrpos($value, '<!--');
+ $start = substr($value, 0, $pos);
+ $value = substr($value, $pos);
+
+ // If there is no comment closing tag, strip whole text
+ if (!preg_match('/--\s*>/s', $value)) {
+ $value = '';
+ } else {
+ $value = preg_replace('/<(?:!(?:--[\s\S]*?--\s*)?(>))/s', '', $value);
+ }
+
+ $value = $start . $value;
+ }
+
+ // Initialize accumulator for filtered data
+ $dataFiltered = '';
+ // Parse the input data iteratively as regular pre-tag text followed by a
+ // tag; either may be empty strings
+ preg_match_all('/([^<]*)(<?[^>]*>?)/', (string) $value, $matches);
+
+ // Iterate over each set of matches
+ foreach ($matches[1] as $index => $preTag) {
+ // If the pre-tag text is non-empty, strip any ">" characters from it
+ if (strlen($preTag)) {
+ $preTag = str_replace('>', '', $preTag);
+ }
+ // If a tag exists in this match, then filter the tag
+ $tag = $matches[2][$index];
+ if (strlen($tag)) {
+ $tagFiltered = $this->_filterTag($tag);
+ } else {
+ $tagFiltered = '';
+ }
+ // Add the filtered pre-tag text and filtered tag to the data buffer
+ $dataFiltered .= $preTag . $tagFiltered;
+ }
+
+ // Return the filtered data
+ return $dataFiltered;
+ }
+
+ /**
+ * Filters a single tag against the current option settings
+ *
+ * @param string $tag
+ * @return string
+ */
+ protected function _filterTag($tag)
+ {
+ // Parse the tag into:
+ // 1. a starting delimiter (mandatory)
+ // 2. a tag name (if available)
+ // 3. a string of attributes (if available)
+ // 4. an ending delimiter (if available)
+ $isMatch = preg_match('~(</?)(\w*)((/(?!>)|[^/>])*)(/?>)~', $tag, $matches);
+
+ // If the tag does not match, then strip the tag entirely
+ if (!$isMatch) {
+ return '';
+ }
+
+ // Save the matches to more meaningfully named variables
+ $tagStart = $matches[1];
+ $tagName = strtolower($matches[2]);
+ $tagAttributes = $matches[3];
+ $tagEnd = $matches[5];
+
+ // If the tag is not an allowed tag, then remove the tag entirely
+ if (!isset($this->_tagsAllowed[$tagName])) {
+ return '';
+ }
+
+ // Trim the attribute string of whitespace at the ends
+ $tagAttributes = trim($tagAttributes);
+
+ // If there are non-whitespace characters in the attribute string
+ if (strlen($tagAttributes)) {
+ // Parse iteratively for well-formed attributes
+ preg_match_all('/([\w-]+)\s*=\s*(?:(")(.*?)"|(\')(.*?)\')/s', $tagAttributes, $matches);
+
+ // Initialize valid attribute accumulator
+ $tagAttributes = '';
+
+ // Iterate over each matched attribute
+ foreach ($matches[1] as $index => $attributeName) {
+ $attributeName = strtolower($attributeName);
+ $attributeDelimiter = empty($matches[2][$index]) ? $matches[4][$index] : $matches[2][$index];
+ $attributeValue = empty($matches[3][$index]) ? $matches[5][$index] : $matches[3][$index];
+
+ // If the attribute is not allowed, then remove it entirely
+ if (!array_key_exists($attributeName, $this->_tagsAllowed[$tagName])
+ && !array_key_exists($attributeName, $this->_attributesAllowed)) {
+ continue;
+ }
+ // Add the attribute to the accumulator
+ $tagAttributes .= " $attributeName=" . $attributeDelimiter
+ . $attributeValue . $attributeDelimiter;
+ }
+ }
+
+ // Reconstruct tags ending with "/>" as backwards-compatible XHTML tag
+ if (strpos($tagEnd, '/') !== false) {
+ $tagEnd = " $tagEnd";
+ }
+
+ // Return the filtered tag
+ return $tagStart . $tagName . $tagAttributes . $tagEnd;
+ }
+}
diff --git a/library/vendor/Zend/Filter/Word/CamelCaseToDash.php b/library/vendor/Zend/Filter/Word/CamelCaseToDash.php
new file mode 100644
index 0000000..4698947
--- /dev/null
+++ b/library/vendor/Zend/Filter/Word/CamelCaseToDash.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Word_CamelCaseToDash extends Zend_Filter_Word_CamelCaseToSeparator
+{
+ /**
+ * Constructor
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ parent::__construct('-');
+ }
+}
diff --git a/library/vendor/Zend/Filter/Word/CamelCaseToSeparator.php b/library/vendor/Zend/Filter/Word/CamelCaseToSeparator.php
new file mode 100644
index 0000000..6592c45
--- /dev/null
+++ b/library/vendor/Zend/Filter/Word/CamelCaseToSeparator.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_PregReplace
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Word_CamelCaseToSeparator extends Zend_Filter_Word_Separator_Abstract
+{
+
+ public function filter($value)
+ {
+ if (self::isUnicodeSupportEnabled()) {
+ parent::setMatchPattern(array('#(?<=(?:\p{Lu}))(\p{Lu}\p{Ll})#','#(?<=(?:\p{Ll}|\p{Nd}))(\p{Lu})#'));
+ parent::setReplacement(array($this->_separator . '\1', $this->_separator . '\1'));
+ } else {
+ parent::setMatchPattern(array('#(?<=(?:[A-Z]))([A-Z]+)([A-Z][A-z])#', '#(?<=(?:[a-z0-9]))([A-Z])#'));
+ parent::setReplacement(array('\1' . $this->_separator . '\2', $this->_separator . '\1'));
+ }
+
+ return parent::filter($value);
+ }
+
+}
diff --git a/library/vendor/Zend/Filter/Word/CamelCaseToUnderscore.php b/library/vendor/Zend/Filter/Word/CamelCaseToUnderscore.php
new file mode 100644
index 0000000..fc2a5d7
--- /dev/null
+++ b/library/vendor/Zend/Filter/Word/CamelCaseToUnderscore.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_CamelCaseToSeparator
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Word_CamelCaseToUnderscore extends Zend_Filter_Word_CamelCaseToSeparator
+{
+ /**
+ * Constructor
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ parent::__construct('_');
+ }
+}
diff --git a/library/vendor/Zend/Filter/Word/DashToCamelCase.php b/library/vendor/Zend/Filter/Word/DashToCamelCase.php
new file mode 100644
index 0000000..c6ff5c1
--- /dev/null
+++ b/library/vendor/Zend/Filter/Word/DashToCamelCase.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Word_DashToCamelCase extends Zend_Filter_Word_SeparatorToCamelCase
+{
+ /**
+ * Constructor
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ parent::__construct('-');
+ }
+}
diff --git a/library/vendor/Zend/Filter/Word/DashToSeparator.php b/library/vendor/Zend/Filter/Word/DashToSeparator.php
new file mode 100644
index 0000000..fe86149
--- /dev/null
+++ b/library/vendor/Zend/Filter/Word/DashToSeparator.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_PregReplace
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Word_DashToSeparator extends Zend_Filter_Word_Separator_Abstract
+{
+
+ public function filter($value)
+ {
+ $this->setMatchPattern('#-#');
+ $this->setReplacement($this->_separator);
+ return parent::filter($value);
+ }
+}
diff --git a/library/vendor/Zend/Filter/Word/DashToUnderscore.php b/library/vendor/Zend/Filter/Word/DashToUnderscore.php
new file mode 100644
index 0000000..19527dd
--- /dev/null
+++ b/library/vendor/Zend/Filter/Word/DashToUnderscore.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_PregReplace
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Word_DashToUnderscore extends Zend_Filter_Word_SeparatorToSeparator
+{
+ /**
+ * Constructor
+ *
+ * @param string $separator Space by default
+ * @return void
+ */
+ public function __construct()
+ {
+ parent::__construct('-', '_');
+ }
+}
diff --git a/library/vendor/Zend/Filter/Word/Separator/Abstract.php b/library/vendor/Zend/Filter/Word/Separator/Abstract.php
new file mode 100644
index 0000000..7a95034
--- /dev/null
+++ b/library/vendor/Zend/Filter/Word/Separator/Abstract.php
@@ -0,0 +1,74 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_PregReplace
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @uses Zend_Filter_PregReplace
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Filter_Word_Separator_Abstract extends Zend_Filter_PregReplace
+{
+
+ protected $_separator = null;
+
+ /**
+ * Constructor
+ *
+ * @param string $separator Space by default
+ * @return void
+ */
+ public function __construct($separator = ' ')
+ {
+ $this->setSeparator($separator);
+ }
+
+ /**
+ * Sets a new seperator
+ *
+ * @param string $separator Seperator
+ * @return $this
+ */
+ public function setSeparator($separator)
+ {
+ if ($separator == null) {
+ throw new Zend_Filter_Exception('"' . $separator . '" is not a valid separator.');
+ }
+ $this->_separator = $separator;
+ return $this;
+ }
+
+ /**
+ * Returns the actual set seperator
+ *
+ * @return string
+ */
+ public function getSeparator()
+ {
+ return $this->_separator;
+ }
+
+}
diff --git a/library/vendor/Zend/Filter/Word/SeparatorToCamelCase.php b/library/vendor/Zend/Filter/Word/SeparatorToCamelCase.php
new file mode 100644
index 0000000..7f53eb7
--- /dev/null
+++ b/library/vendor/Zend/Filter/Word/SeparatorToCamelCase.php
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_PregReplace
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Word_SeparatorToCamelCase extends Zend_Filter_Word_Separator_Abstract
+{
+
+ public function filter($value)
+ {
+ // a unicode safe way of converting characters to \x00\x00 notation
+ $pregQuotedSeparator = preg_quote($this->_separator, '#');
+
+ if (self::isUnicodeSupportEnabled()) {
+ parent::setMatchPattern(array('#('.$pregQuotedSeparator.')(\p{L}{1})#','#(^\p{Ll}{1})#'));
+ parent::setReplacement(array('Zend_Filter_Word_SeparatorToCamelCase', '_strtoupperArray'));
+ } else {
+ parent::setMatchPattern(array('#('.$pregQuotedSeparator.')([A-Za-z]{1})#','#(^[A-Za-z]{1})#'));
+ parent::setReplacement(array('Zend_Filter_Word_SeparatorToCamelCase', '_strtoupperArray'));
+ }
+
+ return preg_replace_callback($this->_matchPattern, $this->_replacement, $value);
+ }
+
+ /**
+ * @param array $matches
+ * @return string
+ */
+ private static function _strtoupperArray(array $matches)
+ {
+ if (array_key_exists(2, $matches)) {
+ return strtoupper($matches[2]);
+ }
+ return strtoupper($matches[1]);
+ }
+
+}
diff --git a/library/vendor/Zend/Filter/Word/SeparatorToDash.php b/library/vendor/Zend/Filter/Word/SeparatorToDash.php
new file mode 100644
index 0000000..aeab938
--- /dev/null
+++ b/library/vendor/Zend/Filter/Word/SeparatorToDash.php
@@ -0,0 +1,45 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_SeperatorToSeparator
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Word_SeparatorToDash extends Zend_Filter_Word_SeparatorToSeparator
+{
+ /**
+ * Constructor
+ *
+ * @param string $searchSeparator Seperator to search for change
+ * @return void
+ */
+ public function __construct($searchSeparator = ' ')
+ {
+ parent::__construct($searchSeparator, '-');
+ }
+
+}
diff --git a/library/vendor/Zend/Filter/Word/SeparatorToSeparator.php b/library/vendor/Zend/Filter/Word/SeparatorToSeparator.php
new file mode 100644
index 0000000..d1ce7e9
--- /dev/null
+++ b/library/vendor/Zend/Filter/Word/SeparatorToSeparator.php
@@ -0,0 +1,127 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_PregReplace
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Word_SeparatorToSeparator extends Zend_Filter_PregReplace
+{
+
+ protected $_searchSeparator = null;
+ protected $_replacementSeparator = null;
+
+ /**
+ * Constructor
+ *
+ * @param string $searchSeparator Seperator to search for
+ * @param string $replacementSeperator Seperator to replace with
+ * @return void
+ */
+ public function __construct($searchSeparator = ' ', $replacementSeparator = '-')
+ {
+ $this->setSearchSeparator($searchSeparator);
+ $this->setReplacementSeparator($replacementSeparator);
+ }
+
+ /**
+ * Sets a new seperator to search for
+ *
+ * @param string $separator Seperator to search for
+ * @return $this
+ */
+ public function setSearchSeparator($separator)
+ {
+ $this->_searchSeparator = $separator;
+ return $this;
+ }
+
+ /**
+ * Returns the actual set seperator to search for
+ *
+ * @return string
+ */
+ public function getSearchSeparator()
+ {
+ return $this->_searchSeparator;
+ }
+
+ /**
+ * Sets a new seperator which replaces the searched one
+ *
+ * @param string $separator Seperator which replaces the searched one
+ * @return $this
+ */
+ public function setReplacementSeparator($separator)
+ {
+ $this->_replacementSeparator = $separator;
+ return $this;
+ }
+
+ /**
+ * Returns the actual set seperator which replaces the searched one
+ *
+ * @return string
+ */
+ public function getReplacementSeparator()
+ {
+ return $this->_replacementSeparator;
+ }
+
+ /**
+ * Defined by Zend_Filter_Interface
+ *
+ * Returns the string $value, replacing the searched seperators with the defined ones
+ *
+ * @param string $value
+ * @return string
+ */
+ public function filter($value)
+ {
+ return $this->_separatorToSeparatorFilter($value);
+ }
+
+ /**
+ * Do the real work, replaces the seperator to search for with the replacement seperator
+ *
+ * Returns the replaced string
+ *
+ * @param string $value
+ * @return string
+ */
+ protected function _separatorToSeparatorFilter($value)
+ {
+ if ($this->_searchSeparator == null) {
+ throw new Zend_Filter_Exception('You must provide a search separator for this filter to work.');
+ }
+
+ $this->setMatchPattern('#' . preg_quote($this->_searchSeparator, '#') . '#');
+ $this->setReplacement($this->_replacementSeparator);
+ return parent::filter($value);
+ }
+
+}
diff --git a/library/vendor/Zend/Filter/Word/UnderscoreToCamelCase.php b/library/vendor/Zend/Filter/Word/UnderscoreToCamelCase.php
new file mode 100644
index 0000000..0c44700
--- /dev/null
+++ b/library/vendor/Zend/Filter/Word/UnderscoreToCamelCase.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Word_UnderscoreToCamelCase extends Zend_Filter_Word_SeparatorToCamelCase
+{
+ /**
+ * Constructor
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ parent::__construct('_');
+ }
+}
diff --git a/library/vendor/Zend/Filter/Word/UnderscoreToDash.php b/library/vendor/Zend/Filter/Word/UnderscoreToDash.php
new file mode 100644
index 0000000..b63fd16
--- /dev/null
+++ b/library/vendor/Zend/Filter/Word/UnderscoreToDash.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_PregReplace
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Word_UnderscoreToDash extends Zend_Filter_Word_SeparatorToSeparator
+{
+ /**
+ * Constructor
+ *
+ * @param string $separator Space by default
+ * @return void
+ */
+ public function __construct()
+ {
+ parent::__construct('_', '-');
+ }
+}
diff --git a/library/vendor/Zend/Filter/Word/UnderscoreToSeparator.php b/library/vendor/Zend/Filter/Word/UnderscoreToSeparator.php
new file mode 100644
index 0000000..cfd7ed8
--- /dev/null
+++ b/library/vendor/Zend/Filter/Word/UnderscoreToSeparator.php
@@ -0,0 +1,44 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Filter_PregReplace
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Filter_Word_UnderscoreToSeparator extends Zend_Filter_Word_SeparatorToSeparator
+{
+ /**
+ * Constructor
+ *
+ * @param string $separator Space by default
+ * @return void
+ */
+ public function __construct($replacementSeparator = ' ')
+ {
+ parent::__construct('_', $replacementSeparator);
+ }
+}
diff --git a/library/vendor/Zend/Form.php b/library/vendor/Zend/Form.php
new file mode 100644
index 0000000..91987ac
--- /dev/null
+++ b/library/vendor/Zend/Form.php
@@ -0,0 +1,3472 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** @see Zend_Validate_Interface */
+
+/**
+ * Zend_Form
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form implements Iterator, Countable, Zend_Validate_Interface
+{
+ /**#@+
+ * Plugin loader type constants
+ */
+ const DECORATOR = 'DECORATOR';
+ const ELEMENT = 'ELEMENT';
+ /**#@-*/
+
+ /**#@+
+ * Method type constants
+ */
+ const METHOD_DELETE = 'delete';
+ const METHOD_GET = 'get';
+ const METHOD_POST = 'post';
+ const METHOD_PUT = 'put';
+ /**#@-*/
+
+ /**#@+
+ * Encoding type constants
+ */
+ const ENCTYPE_URLENCODED = 'application/x-www-form-urlencoded';
+ const ENCTYPE_MULTIPART = 'multipart/form-data';
+ /**#@-*/
+
+ /**
+ * Form metadata and attributes
+ * @var array
+ */
+ protected $_attribs = array();
+
+ /**
+ * Decorators for rendering
+ * @var array
+ */
+ protected $_decorators = array();
+
+ /**
+ * Default display group class
+ * @var string
+ */
+ protected $_defaultDisplayGroupClass = 'Zend_Form_DisplayGroup';
+
+ /**
+ * Form description
+ * @var string
+ */
+ protected $_description;
+
+ /**
+ * Should we disable loading the default decorators?
+ * @var bool
+ */
+ protected $_disableLoadDefaultDecorators = false;
+
+ /**
+ * Display group prefix paths
+ * @var array
+ */
+ protected $_displayGroupPrefixPaths = array();
+
+ /**
+ * Groups of elements grouped for display purposes
+ * @var array
+ */
+ protected $_displayGroups = array();
+
+ /**
+ * Global decorators to apply to all elements
+ * @var null|array
+ */
+ protected $_elementDecorators;
+
+ /**
+ * Prefix paths to use when creating elements
+ * @var array
+ */
+ protected $_elementPrefixPaths = array();
+
+ /**
+ * Form elements
+ * @var array
+ */
+ protected $_elements = array();
+
+ /**
+ * Array to which elements belong (if any)
+ * @var string
+ */
+ protected $_elementsBelongTo;
+
+ /**
+ * Custom form-level error messages
+ * @var array
+ */
+ protected $_errorMessages = array();
+
+ /**
+ * Are there errors in the form?
+ * @var bool
+ */
+ protected $_errorsExist = false;
+
+ /**
+ * Has the form been manually flagged as an error?
+ * @var bool
+ */
+ protected $_errorsForced = false;
+
+ /**
+ * Form order
+ * @var int|null
+ */
+ protected $_formOrder;
+
+ /**
+ * Whether or not form elements are members of an array
+ * @var bool
+ */
+ protected $_isArray = false;
+
+ /**
+ * Form legend
+ * @var string
+ */
+ protected $_legend;
+
+ /**
+ * Plugin loaders
+ * @var array
+ */
+ protected $_loaders = array();
+
+ /**
+ * Allowed form methods
+ * @var array
+ */
+ protected $_methods = array('delete', 'get', 'post', 'put');
+
+ /**
+ * Order in which to display and iterate elements
+ * @var array
+ */
+ protected $_order = array();
+
+ /**
+ * Whether internal order has been updated or not
+ * @var bool
+ */
+ protected $_orderUpdated = false;
+
+ /**
+ * Sub form prefix paths
+ * @var array
+ */
+ protected $_subFormPrefixPaths = array();
+
+ /**
+ * Sub forms
+ * @var array
+ */
+ protected $_subForms = array();
+
+ /**
+ * @var Zend_Translate
+ */
+ protected $_translator;
+
+ /**
+ * Global default translation adapter
+ * @var Zend_Translate
+ */
+ protected static $_translatorDefault;
+
+ /**
+ * is the translator disabled?
+ * @var bool
+ */
+ protected $_translatorDisabled = false;
+
+ /**
+ * @var Zend_View_Interface
+ */
+ protected $_view;
+
+ /**
+ * @var bool
+ */
+ protected $_isRendered = false;
+
+ /**
+ * Constructor
+ *
+ * Registers form view helper as decorator
+ *
+ * @param mixed $options
+ */
+ public function __construct($options = null)
+ {
+ if (is_array($options)) {
+ $this->setOptions($options);
+ } elseif ($options instanceof Zend_Config) {
+ $this->setConfig($options);
+ }
+
+ // Extensions...
+ $this->init();
+
+ $this->loadDefaultDecorators();
+ }
+
+ /**
+ * Clone form object and all children
+ *
+ * @return void
+ */
+ public function __clone()
+ {
+ $elements = array();
+ foreach ($this->getElements() as $name => $element) {
+ $elements[] = clone $element;
+ }
+ $this->setElements($elements);
+
+ $subForms = array();
+ foreach ($this->getSubForms() as $name => $subForm) {
+ $subForms[$name] = clone $subForm;
+ }
+ $this->setSubForms($subForms);
+
+ $displayGroups = array();
+ foreach ($this->_displayGroups as $group) {
+ /** @var Zend_Form_DisplayGroup $clone */
+ $clone = clone $group;
+ $elements = array();
+ foreach ($clone->getElements() as $name => $e) {
+ $elements[] = $this->getElement($name);
+ }
+ $clone->setElements($elements);
+ $displayGroups[] = $clone;
+ }
+ $this->setDisplayGroups($displayGroups);
+ }
+
+ /**
+ * Reset values of form
+ *
+ * @return Zend_Form
+ */
+ public function reset()
+ {
+ /** @var Zend_Form_Element $element */
+ foreach ($this->getElements() as $element) {
+ $element->setValue(null);
+ }
+ /** @var Zend_Form_SubForm $subForm */
+ foreach ($this->getSubForms() as $subForm) {
+ $subForm->reset();
+ }
+
+ return $this;
+ }
+
+ /**
+ * Initialize form (used by extending classes)
+ *
+ * @return void
+ */
+ public function init()
+ {
+ }
+
+ /**
+ * Set form state from options array
+ *
+ * @param array $options
+ * @return Zend_Form
+ */
+ public function setOptions(array $options)
+ {
+ if (isset($options['prefixPath'])) {
+ $this->addPrefixPaths($options['prefixPath']);
+ unset($options['prefixPath']);
+ }
+
+ if (isset($options['elementPrefixPath'])) {
+ $this->addElementPrefixPaths($options['elementPrefixPath']);
+ unset($options['elementPrefixPath']);
+ }
+
+ if (isset($options['displayGroupPrefixPath'])) {
+ $this->addDisplayGroupPrefixPaths($options['displayGroupPrefixPath']);
+ unset($options['displayGroupPrefixPath']);
+ }
+
+ if (isset($options['elementDecorators'])) {
+ $this->_elementDecorators = $options['elementDecorators'];
+ unset($options['elementDecorators']);
+ }
+
+ if (isset($options['elements'])) {
+ $this->setElements($options['elements']);
+ unset($options['elements']);
+ }
+
+ if (isset($options['defaultDisplayGroupClass'])) {
+ $this->setDefaultDisplayGroupClass($options['defaultDisplayGroupClass']);
+ unset($options['defaultDisplayGroupClass']);
+ }
+
+ if (isset($options['displayGroupDecorators'])) {
+ $displayGroupDecorators = $options['displayGroupDecorators'];
+ unset($options['displayGroupDecorators']);
+ }
+
+ if (isset($options['elementsBelongTo'])) {
+ $elementsBelongTo = $options['elementsBelongTo'];
+ unset($options['elementsBelongTo']);
+ }
+
+ if (isset($options['attribs'])) {
+ $this->addAttribs($options['attribs']);
+ unset($options['attribs']);
+ }
+
+ if (isset($options['subForms'])) {
+ $this->addSubForms($options['subForms']);
+ unset($options['subForms']);
+ }
+
+ $forbidden = array(
+ 'Options', 'Config', 'PluginLoader', 'SubForms', 'Translator',
+ 'Attrib', 'Default',
+ );
+
+ foreach ($options as $key => $value) {
+ $normalized = ucfirst($key);
+ if (in_array($normalized, $forbidden)) {
+ continue;
+ }
+
+ $method = 'set' . $normalized;
+ if (method_exists($this, $method)) {
+ if($normalized == 'View' && !($value instanceof Zend_View_Interface)) {
+ continue;
+ }
+ $this->$method($value);
+ } else {
+ $this->setAttrib($key, $value);
+ }
+ }
+
+ if (isset($displayGroupDecorators)) {
+ $this->setDisplayGroupDecorators($displayGroupDecorators);
+ }
+
+ if (isset($elementsBelongTo)) {
+ $this->setElementsBelongTo($elementsBelongTo);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set form state from config object
+ *
+ * @param Zend_Config $config
+ * @return Zend_Form
+ */
+ public function setConfig(Zend_Config $config)
+ {
+ return $this->setOptions($config->toArray());
+ }
+
+
+ // Loaders
+
+ /**
+ * Set plugin loaders for use with decorators and elements
+ *
+ * @param Zend_Loader_PluginLoader_Interface $loader
+ * @param string $type 'decorator' or 'element'
+ * @return Zend_Form
+ * @throws Zend_Form_Exception on invalid type
+ */
+ public function setPluginLoader(Zend_Loader_PluginLoader_Interface $loader, $type = null)
+ {
+ $type = strtoupper($type);
+ switch ($type) {
+ case self::DECORATOR:
+ case self::ELEMENT:
+ $this->_loaders[$type] = $loader;
+ return $this;
+ default:
+ throw new Zend_Form_Exception(sprintf('Invalid type "%s" provided to setPluginLoader()', $type));
+ }
+ }
+
+ /**
+ * Retrieve plugin loader for given type
+ *
+ * $type may be one of:
+ * - decorator
+ * - element
+ *
+ * If a plugin loader does not exist for the given type, defaults are
+ * created.
+ *
+ * @param string $type
+ * @return Zend_Loader_PluginLoader_Interface
+ * @throws Zend_Form_Exception
+ */
+ public function getPluginLoader($type = null)
+ {
+ $type = strtoupper($type);
+ if (!isset($this->_loaders[$type])) {
+ switch ($type) {
+ case self::DECORATOR:
+ $prefixSegment = 'Form_Decorator';
+ $pathSegment = 'Form/Decorator';
+ break;
+ case self::ELEMENT:
+ $prefixSegment = 'Form_Element';
+ $pathSegment = 'Form/Element';
+ break;
+ default:
+ throw new Zend_Form_Exception(sprintf('Invalid type "%s" provided to getPluginLoader()', $type));
+ }
+
+ $this->_loaders[$type] = new Zend_Loader_PluginLoader(
+ array('Zend_' . $prefixSegment . '_' => 'Zend/' . $pathSegment . '/')
+ );
+ }
+
+ return $this->_loaders[$type];
+ }
+
+ /**
+ * Add prefix path for plugin loader
+ *
+ * If no $type specified, assumes it is a base path for both filters and
+ * validators, and sets each according to the following rules:
+ * - decorators: $prefix = $prefix . '_Decorator'
+ * - elements: $prefix = $prefix . '_Element'
+ *
+ * Otherwise, the path prefix is set on the appropriate plugin loader.
+ *
+ * If $type is 'decorator', sets the path in the decorator plugin loader
+ * for all elements. Additionally, if no $type is provided,
+ * the prefix and path is added to both decorator and element
+ * plugin loader with following settings:
+ * $prefix . '_Decorator', $path . '/Decorator/'
+ * $prefix . '_Element', $path . '/Element/'
+ *
+ * @param string $prefix
+ * @param string $path
+ * @param string $type
+ * @return Zend_Form
+ * @throws Zend_Form_Exception for invalid type
+ */
+ public function addPrefixPath($prefix, $path, $type = null)
+ {
+ $type = strtoupper($type);
+ switch ($type) {
+ case self::DECORATOR:
+ case self::ELEMENT:
+ $loader = $this->getPluginLoader($type);
+ $loader->addPrefixPath($prefix, $path);
+ return $this;
+ case null:
+ $nsSeparator = (false !== strpos($prefix, '\\'))?'\\':'_';
+ $prefix = rtrim($prefix, $nsSeparator);
+ $path = rtrim($path, DIRECTORY_SEPARATOR);
+ foreach (array(self::DECORATOR, self::ELEMENT) as $type) {
+ $cType = ucfirst(strtolower($type));
+ $pluginPath = $path . DIRECTORY_SEPARATOR . $cType . DIRECTORY_SEPARATOR;
+ $pluginPrefix = $prefix . $nsSeparator . $cType;
+ $loader = $this->getPluginLoader($type);
+ $loader->addPrefixPath($pluginPrefix, $pluginPath);
+ }
+ return $this;
+ default:
+ throw new Zend_Form_Exception(sprintf('Invalid type "%s" provided to getPluginLoader()', $type));
+ }
+ }
+
+ /**
+ * Add many prefix paths at once
+ *
+ * @param array $spec
+ * @return Zend_Form
+ */
+ public function addPrefixPaths(array $spec)
+ {
+ if (isset($spec['prefix']) && isset($spec['path'])) {
+ return $this->addPrefixPath($spec['prefix'], $spec['path']);
+ }
+ foreach ($spec as $type => $paths) {
+ if (is_numeric($type) && is_array($paths)) {
+ $type = null;
+ if (isset($paths['prefix']) && isset($paths['path'])) {
+ if (isset($paths['type'])) {
+ $type = $paths['type'];
+ }
+ $this->addPrefixPath($paths['prefix'], $paths['path'], $type);
+ }
+ } elseif (!is_numeric($type)) {
+ if (!isset($paths['prefix']) || !isset($paths['path'])) {
+ continue;
+ }
+ $this->addPrefixPath($paths['prefix'], $paths['path'], $type);
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Add prefix path for all elements
+ *
+ * @param string $prefix
+ * @param string $path
+ * @param string $type
+ * @return Zend_Form
+ */
+ public function addElementPrefixPath($prefix, $path, $type = null)
+ {
+ $this->_elementPrefixPaths[] = array(
+ 'prefix' => $prefix,
+ 'path' => $path,
+ 'type' => $type,
+ );
+
+ /** @var Zend_Form_Element $element */
+ foreach ($this->getElements() as $element) {
+ $element->addPrefixPath($prefix, $path, $type);
+ }
+
+ /** @var Zend_Form_SubForm $subForm */
+ foreach ($this->getSubForms() as $subForm) {
+ $subForm->addElementPrefixPath($prefix, $path, $type);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Add prefix paths for all elements
+ *
+ * @param array $spec
+ * @return Zend_Form
+ */
+ public function addElementPrefixPaths(array $spec)
+ {
+ $this->_elementPrefixPaths = $this->_elementPrefixPaths + $spec;
+
+ /** @var Zend_Form_Element $element */
+ foreach ($this->getElements() as $element) {
+ $element->addPrefixPaths($spec);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Add prefix path for all display groups
+ *
+ * @param string $prefix
+ * @param string $path
+ * @return Zend_Form
+ */
+ public function addDisplayGroupPrefixPath($prefix, $path)
+ {
+ $this->_displayGroupPrefixPaths[] = array(
+ 'prefix' => $prefix,
+ 'path' => $path,
+ );
+
+ /** @var Zend_Form_DisplayGroup $group */
+ foreach ($this->getDisplayGroups() as $group) {
+ $group->addPrefixPath($prefix, $path);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Add multiple display group prefix paths at once
+ *
+ * @param array $spec
+ * @return Zend_Form
+ */
+ public function addDisplayGroupPrefixPaths(array $spec)
+ {
+ foreach ($spec as $key => $value) {
+ if (is_string($value) && !is_numeric($key)) {
+ $this->addDisplayGroupPrefixPath($key, $value);
+ continue;
+ }
+
+ if (is_string($value) && is_numeric($key)) {
+ continue;
+ }
+
+ if (is_array($value)) {
+ $count = count($value);
+ if (array_keys($value) === range(0, $count - 1)) {
+ if ($count < 2) {
+ continue;
+ }
+ $prefix = array_shift($value);
+ $path = array_shift($value);
+ $this->addDisplayGroupPrefixPath($prefix, $path);
+ continue;
+ }
+ if (array_key_exists('prefix', $value) && array_key_exists('path', $value)) {
+ $this->addDisplayGroupPrefixPath($value['prefix'], $value['path']);
+ }
+ }
+ }
+ return $this;
+ }
+
+ // Form metadata:
+
+ /**
+ * Set form attribute
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return Zend_Form
+ */
+ public function setAttrib($key, $value)
+ {
+ $key = (string) $key;
+ $this->_attribs[$key] = $value;
+ return $this;
+ }
+
+ /**
+ * Add multiple form attributes at once
+ *
+ * @param array $attribs
+ * @return Zend_Form
+ */
+ public function addAttribs(array $attribs)
+ {
+ foreach ($attribs as $key => $value) {
+ $this->setAttrib($key, $value);
+ }
+ return $this;
+ }
+
+ /**
+ * Set multiple form attributes at once
+ *
+ * Overwrites any previously set attributes.
+ *
+ * @param array $attribs
+ * @return Zend_Form
+ */
+ public function setAttribs(array $attribs)
+ {
+ $this->clearAttribs();
+ return $this->addAttribs($attribs);
+ }
+
+ /**
+ * Retrieve a single form attribute
+ *
+ * @param string $key
+ * @return mixed
+ */
+ public function getAttrib($key)
+ {
+ $key = (string) $key;
+ if (!isset($this->_attribs[$key])) {
+ return null;
+ }
+
+ return $this->_attribs[$key];
+ }
+
+ /**
+ * Retrieve all form attributes/metadata
+ *
+ * @return array
+ */
+ public function getAttribs()
+ {
+ return $this->_attribs;
+ }
+
+ /**
+ * Remove attribute
+ *
+ * @param string $key
+ * @return bool
+ */
+ public function removeAttrib($key)
+ {
+ if (isset($this->_attribs[$key])) {
+ unset($this->_attribs[$key]);
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Clear all form attributes
+ *
+ * @return Zend_Form
+ */
+ public function clearAttribs()
+ {
+ $this->_attribs = array();
+ return $this;
+ }
+
+ /**
+ * Set form action
+ *
+ * @param string $action
+ * @return Zend_Form
+ */
+ public function setAction($action)
+ {
+ return $this->setAttrib('action', (string) $action);
+ }
+
+ /**
+ * Get form action
+ *
+ * Sets default to '' if not set.
+ *
+ * @return string
+ */
+ public function getAction()
+ {
+ $action = $this->getAttrib('action');
+ if (null === $action) {
+ $action = '';
+ $this->setAction($action);
+ }
+ return $action;
+ }
+
+ /**
+ * Set form method
+ *
+ * Only values in {@link $_methods()} allowed
+ *
+ * @param string $method
+ * @return Zend_Form
+ * @throws Zend_Form_Exception
+ */
+ public function setMethod($method)
+ {
+ $method = strtolower($method);
+ if (!in_array($method, $this->_methods)) {
+ throw new Zend_Form_Exception(sprintf('"%s" is an invalid form method', $method));
+ }
+ $this->setAttrib('method', $method);
+ return $this;
+ }
+
+ /**
+ * Retrieve form method
+ *
+ * @return string
+ */
+ public function getMethod()
+ {
+ if (null === ($method = $this->getAttrib('method'))) {
+ $method = self::METHOD_POST;
+ $this->setAttrib('method', $method);
+ }
+ return strtolower($method);
+ }
+
+ /**
+ * Set encoding type
+ *
+ * @param string $value
+ * @return Zend_Form
+ */
+ public function setEnctype($value)
+ {
+ $this->setAttrib('enctype', $value);
+ return $this;
+ }
+
+ /**
+ * Get encoding type
+ *
+ * @return string
+ */
+ public function getEnctype()
+ {
+ if (null === ($enctype = $this->getAttrib('enctype'))) {
+ $enctype = self::ENCTYPE_URLENCODED;
+ $this->setAttrib('enctype', $enctype);
+ }
+ return $this->getAttrib('enctype');
+ }
+
+ /**
+ * Filter a name to only allow valid variable characters
+ *
+ * @param string $value
+ * @param bool $allowBrackets
+ * @return string
+ */
+ public function filterName($value, $allowBrackets = false)
+ {
+ $charset = '^a-zA-Z0-9_\x7f-\xff';
+ if ($allowBrackets) {
+ $charset .= '\[\]';
+ }
+ return preg_replace('/[' . $charset . ']/', '', (string) $value);
+ }
+
+ /**
+ * Set form name
+ *
+ * @param string $name
+ * @return Zend_Form
+ * @throws Zend_Form_Exception
+ */
+ public function setName($name)
+ {
+ $name = $this->filterName($name);
+ if ('' === (string)$name) {
+ throw new Zend_Form_Exception('Invalid name provided; must contain only valid variable characters and be non-empty');
+ }
+
+ return $this->setAttrib('name', $name);
+ }
+
+ /**
+ * Get name attribute
+ *
+ * @return null|string
+ */
+ public function getName()
+ {
+ return $this->getAttrib('name');
+ }
+
+ /**
+ * Get fully qualified name
+ *
+ * Places name as subitem of array and/or appends brackets.
+ *
+ * @return string
+ */
+ public function getFullyQualifiedName()
+ {
+ return $this->getName();
+ }
+
+ /**
+ * Get element id
+ *
+ * @return string
+ */
+ public function getId()
+ {
+ if (null !== ($id = $this->getAttrib('id'))) {
+ return $id;
+ }
+
+ $id = $this->getFullyQualifiedName();
+
+ // Bail early if no array notation detected
+ if (!strstr($id, '[')) {
+ return $id;
+ }
+
+ // Strip array notation
+ if ('[]' == substr($id, -2)) {
+ $id = substr($id, 0, strlen($id) - 2);
+ }
+ $id = str_replace('][', '-', $id);
+ $id = str_replace(array(']', '['), '-', $id);
+ $id = trim($id, '-');
+
+ return $id;
+ }
+
+ /**
+ * Set form legend
+ *
+ * @param string $value
+ * @return Zend_Form
+ */
+ public function setLegend($value)
+ {
+ $this->_legend = (string) $value;
+ return $this;
+ }
+
+ /**
+ * Get form legend
+ *
+ * @return string
+ */
+ public function getLegend()
+ {
+ return $this->_legend;
+ }
+
+ /**
+ * Set form description
+ *
+ * @param string $value
+ * @return Zend_Form
+ */
+ public function setDescription($value)
+ {
+ $this->_description = (string) $value;
+ return $this;
+ }
+
+ /**
+ * Retrieve form description
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->_description;
+ }
+
+ /**
+ * Set form order
+ *
+ * @param int $index
+ * @return Zend_Form
+ */
+ public function setOrder($index)
+ {
+ $this->_formOrder = (int) $index;
+ return $this;
+ }
+
+ /**
+ * Get form order
+ *
+ * @return int|null
+ */
+ public function getOrder()
+ {
+ return $this->_formOrder;
+ }
+
+ /**
+ * When calling renderFormElements or render this method
+ * is used to set $_isRendered member to prevent repeatedly
+ * merging belongsTo setting
+ */
+ protected function _setIsRendered()
+ {
+ $this->_isRendered = true;
+ return $this;
+ }
+
+ /**
+ * Get the value of $_isRendered member
+ */
+ protected function _getIsRendered()
+ {
+ return (bool)$this->_isRendered;
+ }
+
+ // Element interaction:
+
+ /**
+ * Add a new element
+ *
+ * $element may be either a string element type, or an object of type
+ * Zend_Form_Element. If a string element type is provided, $name must be
+ * provided, and $options may be optionally provided for configuring the
+ * element.
+ *
+ * If a Zend_Form_Element is provided, $name may be optionally provided,
+ * and any provided $options will be ignored.
+ *
+ * @param string|Zend_Form_Element $element
+ * @param string $name
+ * @param array|Zend_Config $options
+ * @throws Zend_Form_Exception on invalid element
+ * @return Zend_Form
+ */
+ public function addElement($element, $name = null, $options = null)
+ {
+ if (is_string($element)) {
+ if (null === $name) {
+ throw new Zend_Form_Exception(
+ 'Elements specified by string must have an accompanying name'
+ );
+ }
+
+ $this->_elements[$name] = $this->createElement($element, $name, $options);
+ } elseif ($element instanceof Zend_Form_Element) {
+ $prefixPaths = array();
+ $prefixPaths['decorator'] = $this->getPluginLoader('decorator')->getPaths();
+ if (!empty($this->_elementPrefixPaths)) {
+ $prefixPaths = array_merge($prefixPaths, $this->_elementPrefixPaths);
+ }
+
+ if (is_array($this->_elementDecorators)
+ && 0 == count($element->getDecorators())
+ ) {
+ $element->setDecorators($this->_elementDecorators);
+ }
+
+ if (null === $name) {
+ $name = $element->getName();
+ }
+
+ $this->_elements[$name] = $element;
+ $this->_elements[$name]->addPrefixPaths($prefixPaths);
+ } else {
+ throw new Zend_Form_Exception(
+ 'Element must be specified by string or Zend_Form_Element instance'
+ );
+ }
+
+ $this->_order[$name] = $this->_elements[$name]->getOrder();
+ $this->_orderUpdated = true;
+ $this->_setElementsBelongTo($name);
+
+ return $this;
+ }
+
+ /**
+ * Create an element
+ *
+ * Acts as a factory for creating elements. Elements created with this
+ * method will not be attached to the form, but will contain element
+ * settings as specified in the form object (including plugin loader
+ * prefix paths, default decorators, etc.).
+ *
+ * @param string $type
+ * @param string $name
+ * @param array|Zend_Config $options
+ * @throws Zend_Form_Exception
+ * @return Zend_Form_Element
+ */
+ public function createElement($type, $name, $options = null)
+ {
+ if (!is_string($type)) {
+ throw new Zend_Form_Exception('Element type must be a string indicating type');
+ }
+
+ if (!is_string($name)) {
+ throw new Zend_Form_Exception('Element name must be a string');
+ }
+
+ $prefixPaths = array();
+ $prefixPaths['decorator'] = $this->getPluginLoader('decorator')->getPaths();
+ if (!empty($this->_elementPrefixPaths)) {
+ $prefixPaths = array_merge($prefixPaths, $this->_elementPrefixPaths);
+ }
+
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ }
+
+ if ((null === $options) || !is_array($options)) {
+ $options = array('prefixPath' => $prefixPaths);
+
+ if (is_array($this->_elementDecorators)) {
+ $options['decorators'] = $this->_elementDecorators;
+ }
+ } elseif (is_array($options)) {
+ if (array_key_exists('prefixPath', $options)) {
+ $options['prefixPath'] = array_merge($prefixPaths, $options['prefixPath']);
+ } else {
+ $options['prefixPath'] = $prefixPaths;
+ }
+
+ if (is_array($this->_elementDecorators)
+ && !array_key_exists('decorators', $options)
+ ) {
+ $options['decorators'] = $this->_elementDecorators;
+ }
+ }
+
+ $class = $this->getPluginLoader(self::ELEMENT)->load($type);
+ $element = new $class($name, $options);
+
+ return $element;
+ }
+
+ /**
+ * Add multiple elements at once
+ *
+ * @param array $elements
+ * @return Zend_Form
+ */
+ public function addElements(array $elements)
+ {
+ foreach ($elements as $key => $spec) {
+ $name = null;
+ if (!is_numeric($key)) {
+ $name = $key;
+ }
+
+ if (is_string($spec) || ($spec instanceof Zend_Form_Element)) {
+ $this->addElement($spec, $name);
+ continue;
+ }
+
+ if (is_array($spec)) {
+ $argc = count($spec);
+ $options = array();
+ if (isset($spec['type'])) {
+ $type = $spec['type'];
+ if (isset($spec['name'])) {
+ $name = $spec['name'];
+ }
+ if (isset($spec['options'])) {
+ $options = $spec['options'];
+ }
+ $this->addElement($type, $name, $options);
+ } else {
+ switch ($argc) {
+ case 0:
+ continue 2;
+ case (1 <= $argc):
+ $type = array_shift($spec);
+ case (2 <= $argc):
+ if (null === $name) {
+ $name = array_shift($spec);
+ } else {
+ $options = array_shift($spec);
+ }
+ case (3 <= $argc):
+ if (empty($options)) {
+ $options = array_shift($spec);
+ }
+ default:
+ $this->addElement($type, $name, $options);
+ }
+ }
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Set form elements (overwrites existing elements)
+ *
+ * @param array $elements
+ * @return Zend_Form
+ */
+ public function setElements(array $elements)
+ {
+ $this->clearElements();
+ return $this->addElements($elements);
+ }
+
+ /**
+ * Retrieve a single element
+ *
+ * @param string $name
+ * @return Zend_Form_Element|null
+ */
+ public function getElement($name)
+ {
+ if (array_key_exists($name, $this->_elements)) {
+ return $this->_elements[$name];
+ }
+ return null;
+ }
+
+ /**
+ * Retrieve all elements
+ *
+ * @return array
+ */
+ public function getElements()
+ {
+ return $this->_elements;
+ }
+
+ /**
+ * Remove element
+ *
+ * @param string $name
+ * @return boolean
+ */
+ public function removeElement($name)
+ {
+ $name = (string) $name;
+ if (isset($this->_elements[$name])) {
+ unset($this->_elements[$name]);
+ if (array_key_exists($name, $this->_order)) {
+ unset($this->_order[$name]);
+ $this->_orderUpdated = true;
+ } else {
+ /** @var Zend_Form_DisplayGroup $group */
+ foreach ($this->_displayGroups as $group) {
+ if (null !== $group->getElement($name)) {
+ $group->removeElement($name);
+ }
+ }
+ }
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Remove all form elements
+ *
+ * @return Zend_Form
+ */
+ public function clearElements()
+ {
+ foreach (array_keys($this->_elements) as $key) {
+ if (array_key_exists($key, $this->_order)) {
+ unset($this->_order[$key]);
+ }
+ }
+ $this->_elements = array();
+ $this->_orderUpdated = true;
+ return $this;
+ }
+
+ /**
+ * Set default values for elements
+ *
+ * Sets values for all elements specified in the array of $defaults.
+ *
+ * @param array $defaults
+ * @return Zend_Form
+ */
+ public function setDefaults(array $defaults)
+ {
+ $eBelongTo = null;
+
+ if ($this->isArray()) {
+ $eBelongTo = $this->getElementsBelongTo();
+ $defaults = $this->_dissolveArrayValue($defaults, $eBelongTo);
+ }
+ /** @var Zend_Form_Element $element */
+ foreach ($this->getElements() as $name => $element) {
+ $check = $defaults;
+ if (($belongsTo = $element->getBelongsTo()) !== $eBelongTo) {
+ $check = $this->_dissolveArrayValue($defaults, $belongsTo);
+ }
+ if (array_key_exists($name, (array)$check)) {
+ $this->setDefault($name, $check[$name]);
+ $defaults = $this->_dissolveArrayUnsetKey($defaults, $belongsTo, $name);
+ }
+ }
+ /** @var Zend_Form_SubForm $form */
+ foreach ($this->getSubForms() as $name => $form) {
+ if (!$form->isArray() && array_key_exists($name, $defaults)) {
+ $form->setDefaults($defaults[$name]);
+ } else {
+ $form->setDefaults($defaults);
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Set default value for an element
+ *
+ * @param string $name
+ * @param mixed $value
+ * @return Zend_Form
+ */
+ public function setDefault($name, $value)
+ {
+ $name = (string) $name;
+ if ($element = $this->getElement($name)) {
+ $element->setValue($value);
+ } else {
+ if (is_scalar($value)) {
+ /** @var Zend_Form_SubForm $subForm */
+ foreach ($this->getSubForms() as $subForm) {
+ $subForm->setDefault($name, $value);
+ }
+ } elseif (is_array($value) && ($subForm = $this->getSubForm($name))) {
+ $subForm->setDefaults($value);
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Retrieve value for single element
+ *
+ * @param string $name
+ * @return mixed
+ */
+ public function getValue($name)
+ {
+ if ($element = $this->getElement($name)) {
+ return $element->getValue();
+ }
+
+ if ($subForm = $this->getSubForm($name)) {
+ return $subForm->getValues(true);
+ }
+
+ /** @var Zend_Form_SubForm $subForm */
+ foreach ($this->getSubForms() as $subForm) {
+ if ($name == $subForm->getElementsBelongTo()) {
+ return $subForm->getValues(true);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Retrieve all form element values
+ *
+ * @param bool $suppressArrayNotation
+ * @return array
+ */
+ public function getValues($suppressArrayNotation = false)
+ {
+ $values = array();
+ $eBelongTo = null;
+
+ if ($this->isArray()) {
+ $eBelongTo = $this->getElementsBelongTo();
+ }
+ /** @var Zend_Form_Element $element */
+ foreach ($this->getElements() as $key => $element) {
+ if (!$element->getIgnore()) {
+ $merge = array();
+ if (($belongsTo = $element->getBelongsTo()) !== $eBelongTo) {
+ if ('' !== (string)$belongsTo) {
+ $key = $belongsTo . '[' . $key . ']';
+ }
+ }
+ $merge = $this->_attachToArray($element->getValue(), $key);
+ $values = $this->_array_replace_recursive($values, $merge);
+ }
+ }
+ /** @var Zend_Form_SubForm $subForm */
+ foreach ($this->getSubForms() as $key => $subForm) {
+ $merge = array();
+ if (!$subForm->isArray()) {
+ $merge[$key] = $subForm->getValues();
+ } else {
+ $merge = $this->_attachToArray($subForm->getValues(true),
+ $subForm->getElementsBelongTo());
+ }
+ $values = $this->_array_replace_recursive($values, $merge);
+ }
+
+ if (!$suppressArrayNotation &&
+ $this->isArray() &&
+ !$this->_getIsRendered()) {
+ $values = $this->_attachToArray($values, $this->getElementsBelongTo());
+ }
+
+ return $values;
+ }
+
+ /**
+ * Returns only the valid values from the given form input.
+ *
+ * For models that can be saved in a partially valid state, for example when following the builder,
+ * prototype or state patterns it is particularly interessting to retrieve all the current valid
+ * values to persist them.
+ *
+ * @param array $data
+ * @param bool $suppressArrayNotation
+ * @return array
+ */
+ public function getValidValues($data, $suppressArrayNotation = false)
+ {
+ $values = array();
+ $eBelongTo = null;
+
+ if ($this->isArray()) {
+ $eBelongTo = $this->getElementsBelongTo();
+ $data = $this->_dissolveArrayValue($data, $eBelongTo);
+ }
+ $context = $data;
+ /** @var Zend_Form_Element $element */
+ foreach ($this->getElements() as $key => $element) {
+ if (!$element->getIgnore()) {
+ $check = $data;
+ if (($belongsTo = $element->getBelongsTo()) !== $eBelongTo) {
+ $check = $this->_dissolveArrayValue($data, $belongsTo);
+ }
+ if (isset($check[$key])) {
+ if($element->isValid($check[$key], $context)) {
+ $merge = array();
+ if ($belongsTo !== $eBelongTo && '' !== (string)$belongsTo) {
+ $key = $belongsTo . '[' . $key . ']';
+ }
+ $merge = $this->_attachToArray($element->getValue(), $key);
+ $values = $this->_array_replace_recursive($values, $merge);
+ }
+ $data = $this->_dissolveArrayUnsetKey($data, $belongsTo, $key);
+ }
+ }
+ }
+ /** @var Zend_Form_SubForm $form */
+ foreach ($this->getSubForms() as $key => $form) {
+ $merge = array();
+ if (isset($data[$key]) && !$form->isArray()) {
+ $tmp = $form->getValidValues($data[$key]);
+ if (!empty($tmp)) {
+ $merge[$key] = $tmp;
+ }
+ } else {
+ $tmp = $form->getValidValues($data, true);
+ if (!empty($tmp)) {
+ $merge = $this->_attachToArray($tmp, $form->getElementsBelongTo());
+ }
+ }
+ $values = $this->_array_replace_recursive($values, $merge);
+ }
+ if (!$suppressArrayNotation &&
+ $this->isArray() &&
+ !empty($values) &&
+ !$this->_getIsRendered()) {
+ $values = $this->_attachToArray($values, $this->getElementsBelongTo());
+ }
+
+ return $values;
+ }
+
+ /**
+ * Get unfiltered element value
+ *
+ * @param string $name
+ * @return mixed
+ */
+ public function getUnfilteredValue($name)
+ {
+ if ($element = $this->getElement($name)) {
+ return $element->getUnfilteredValue();
+ }
+ return null;
+ }
+
+ /**
+ * Retrieve all unfiltered element values
+ *
+ * @return array
+ */
+ public function getUnfilteredValues()
+ {
+ $values = array();
+ /** @var Zend_Form_Element $element */
+ foreach ($this->getElements() as $key => $element) {
+ $values[$key] = $element->getUnfilteredValue();
+ }
+
+ return $values;
+ }
+
+ /**
+ * Set all elements' filters
+ *
+ * @param array $filters
+ * @return Zend_Form
+ */
+ public function setElementFilters(array $filters)
+ {
+ /** @var Zend_Form_Element $element */
+ foreach ($this->getElements() as $element) {
+ $element->setFilters($filters);
+ }
+ return $this;
+ }
+
+ /**
+ * Set name of array elements belong to
+ *
+ * @param string $array
+ * @return Zend_Form
+ */
+ public function setElementsBelongTo($array)
+ {
+ $origName = $this->getElementsBelongTo();
+ $name = $this->filterName($array, true);
+ if ('' === $name) {
+ $name = null;
+ }
+ $this->_elementsBelongTo = $name;
+
+ if (null === $name) {
+ $this->setIsArray(false);
+ if (null !== $origName) {
+ $this->_setElementsBelongTo();
+ }
+ } else {
+ $this->setIsArray(true);
+ $this->_setElementsBelongTo();
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set array to which elements belong
+ *
+ * @param string $name Element name
+ * @return void
+ */
+ protected function _setElementsBelongTo($name = null)
+ {
+ $array = $this->getElementsBelongTo();
+
+ if (null === $array) {
+ return;
+ }
+
+ if (null === $name) {
+ /** @var Zend_Form_Element $element */
+ foreach ($this->getElements() as $element) {
+ $element->setBelongsTo($array);
+ }
+ } else {
+ if (null !== ($element = $this->getElement($name))) {
+ $element->setBelongsTo($array);
+ }
+ }
+ }
+
+ /**
+ * Get name of array elements belong to
+ *
+ * @return string|null
+ */
+ public function getElementsBelongTo()
+ {
+ if ((null === $this->_elementsBelongTo) && $this->isArray()) {
+ $name = $this->getName();
+ if ('' !== (string)$name) {
+ return $name;
+ }
+ }
+ return $this->_elementsBelongTo;
+ }
+
+ /**
+ * Set flag indicating elements belong to array
+ *
+ * @param bool $flag Value of flag
+ * @return Zend_Form
+ */
+ public function setIsArray($flag)
+ {
+ $this->_isArray = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Get flag indicating if elements belong to an array
+ *
+ * @return bool
+ */
+ public function isArray()
+ {
+ return $this->_isArray;
+ }
+
+ // Element groups:
+
+ /**
+ * Add a form group/subform
+ *
+ * @param Zend_Form $form
+ * @param string $name
+ * @param int $order
+ * @return Zend_Form
+ */
+ public function addSubForm(Zend_Form $form, $name, $order = null)
+ {
+ $name = (string) $name;
+ /** @var Zend_Loader_PluginLoader $loader */
+ foreach ($this->_loaders as $type => $loader) {
+ $loaderPaths = $loader->getPaths();
+ foreach ($loaderPaths as $prefix => $paths) {
+ foreach ($paths as $path) {
+ $form->addPrefixPath($prefix, $path, $type);
+ }
+ }
+ }
+
+ if (!empty($this->_elementPrefixPaths)) {
+ foreach ($this->_elementPrefixPaths as $spec) {
+ list($prefix, $path, $type) = array_values($spec);
+ $form->addElementPrefixPath($prefix, $path, $type);
+ }
+ }
+
+ if (!empty($this->_displayGroupPrefixPaths)) {
+ foreach ($this->_displayGroupPrefixPaths as $spec) {
+ list($prefix, $path) = array_values($spec);
+ $form->addDisplayGroupPrefixPath($prefix, $path);
+ }
+ }
+
+ if (null !== $order) {
+ $form->setOrder($order);
+ }
+
+ if (($oldName = $form->getName()) &&
+ $oldName !== $name &&
+ $oldName === $form->getElementsBelongTo()) {
+ $form->setElementsBelongTo($name);
+ }
+
+ $form->setName($name);
+ $this->_subForms[$name] = $form;
+ $this->_order[$name] = $order;
+ $this->_orderUpdated = true;
+ return $this;
+ }
+
+ /**
+ * Add multiple form subForms/subforms at once
+ *
+ * @param array $subForms
+ * @return Zend_Form
+ */
+ public function addSubForms(array $subForms)
+ {
+ foreach ($subForms as $key => $spec) {
+ $name = (string) $key;
+ if ($spec instanceof Zend_Form) {
+ $this->addSubForm($spec, $name);
+ continue;
+ }
+
+ if (is_array($spec)) {
+ $argc = count($spec);
+ $order = null;
+ switch ($argc) {
+ case 0:
+ continue 2;
+ case (1 <= $argc):
+ $subForm = array_shift($spec);
+
+ if (!$subForm instanceof Zend_Form) {
+ $subForm = new Zend_Form_SubForm($subForm);
+ }
+ case (2 <= $argc):
+ $name = array_shift($spec);
+ case (3 <= $argc):
+ $order = array_shift($spec);
+ default:
+ $this->addSubForm($subForm, $name, $order);
+ }
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Set multiple form subForms/subforms (overwrites)
+ *
+ * @param array $subForms
+ * @return Zend_Form
+ */
+ public function setSubForms(array $subForms)
+ {
+ $this->clearSubForms();
+ return $this->addSubForms($subForms);
+ }
+
+ /**
+ * Retrieve a form subForm/subform
+ *
+ * @param string $name
+ * @return Zend_Form|null
+ */
+ public function getSubForm($name)
+ {
+ $name = (string) $name;
+ if (isset($this->_subForms[$name])) {
+ return $this->_subForms[$name];
+ }
+ return null;
+ }
+
+ /**
+ * Retrieve all form subForms/subforms
+ *
+ * @return array
+ */
+ public function getSubForms()
+ {
+ return $this->_subForms;
+ }
+
+ /**
+ * Remove form subForm/subform
+ *
+ * @param string $name
+ * @return boolean
+ */
+ public function removeSubForm($name)
+ {
+ $name = (string) $name;
+ if (array_key_exists($name, $this->_subForms)) {
+ unset($this->_subForms[$name]);
+ if (array_key_exists($name, $this->_order)) {
+ unset($this->_order[$name]);
+ $this->_orderUpdated = true;
+ }
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Remove all form subForms/subforms
+ *
+ * @return Zend_Form
+ */
+ public function clearSubForms()
+ {
+ foreach (array_keys($this->_subForms) as $key) {
+ if (array_key_exists($key, $this->_order)) {
+ unset($this->_order[$key]);
+ }
+ }
+ $this->_subForms = array();
+ $this->_orderUpdated = true;
+ return $this;
+ }
+
+
+ // Display groups:
+
+ /**
+ * Set default display group class
+ *
+ * @param string $class
+ * @return Zend_Form
+ */
+ public function setDefaultDisplayGroupClass($class)
+ {
+ $this->_defaultDisplayGroupClass = (string) $class;
+ return $this;
+ }
+
+ /**
+ * Retrieve default display group class
+ *
+ * @return string
+ */
+ public function getDefaultDisplayGroupClass()
+ {
+ return $this->_defaultDisplayGroupClass;
+ }
+
+ /**
+ * Add a display group
+ *
+ * Groups named elements for display purposes.
+ *
+ * If a referenced element does not yet exist in the form, it is omitted.
+ *
+ * @param array $elements
+ * @param string $name
+ * @param array|Zend_Config $options
+ * @return Zend_Form
+ * @throws Zend_Form_Exception if no valid elements provided
+ */
+ public function addDisplayGroup(array $elements, $name, $options = null)
+ {
+ $group = array();
+ foreach ($elements as $element) {
+ if($element instanceof Zend_Form_Element) {
+ $elementName = $element->getName();
+ if (!isset($this->_elements[$elementName])) {
+ $this->addElement($element);
+ }
+ $element = $elementName;
+ }
+
+ if (isset($this->_elements[$element])) {
+ $add = $this->getElement($element);
+ if (null !== $add) {
+ $group[] = $add;
+ }
+ }
+ }
+ if (empty($group)) {
+ throw new Zend_Form_Exception('No valid elements specified for display group');
+ }
+
+ $name = (string) $name;
+
+ if (is_array($options)) {
+ $options['form'] = $this;
+ $options['elements'] = $group;
+ } elseif ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ $options['form'] = $this;
+ $options['elements'] = $group;
+ } else {
+ $options = array(
+ 'form' => $this,
+ 'elements' => $group,
+ );
+ }
+
+ if (isset($options['displayGroupClass'])) {
+ $class = $options['displayGroupClass'];
+ unset($options['displayGroupClass']);
+ } else {
+ $class = $this->getDefaultDisplayGroupClass();
+ }
+
+ if (!class_exists($class)) {
+ Zend_Loader::loadClass($class);
+ }
+ $this->_displayGroups[$name] = new $class(
+ $name,
+ $this->getPluginLoader(self::DECORATOR),
+ $options
+ );
+
+ if (!empty($this->_displayGroupPrefixPaths)) {
+ $this->_displayGroups[$name]->addPrefixPaths($this->_displayGroupPrefixPaths);
+ }
+
+ $this->_order[$name] = $this->_displayGroups[$name]->getOrder();
+ $this->_orderUpdated = true;
+ return $this;
+ }
+
+ /**
+ * Add a display group object (used with cloning)
+ *
+ * @param Zend_Form_DisplayGroup $group
+ * @param string|null $name
+ * @throws Zend_Form_Exception
+ * @return Zend_Form
+ */
+ protected function _addDisplayGroupObject(Zend_Form_DisplayGroup $group, $name = null)
+ {
+ if (null === $name) {
+ $name = $group->getName();
+ if ('' === (string)$name) {
+ throw new Zend_Form_Exception('Invalid display group added; requires name');
+ }
+ }
+
+ $this->_displayGroups[$name] = $group;
+ $group->setForm($this);
+
+ if (!empty($this->_displayGroupPrefixPaths)) {
+ $this->_displayGroups[$name]->addPrefixPaths($this->_displayGroupPrefixPaths);
+ }
+
+ $this->_order[$name] = $this->_displayGroups[$name]->getOrder();
+ $this->_orderUpdated = true;
+ return $this;
+ }
+
+ /**
+ * Add multiple display groups at once
+ *
+ * @param array $groups
+ * @return Zend_Form
+ */
+ public function addDisplayGroups(array $groups)
+ {
+ foreach ($groups as $key => $spec) {
+ $name = null;
+ if (!is_numeric($key)) {
+ $name = $key;
+ }
+
+ if ($spec instanceof Zend_Form_DisplayGroup) {
+ $this->_addDisplayGroupObject($spec);
+ }
+
+ if (!is_array($spec) || empty($spec)) {
+ continue;
+ }
+
+ $argc = count($spec);
+ $options = array();
+
+ if (isset($spec['elements'])) {
+ $elements = $spec['elements'];
+ if (isset($spec['name'])) {
+ $name = $spec['name'];
+ }
+ if (isset($spec['options'])) {
+ $options = $spec['options'];
+ }
+ $this->addDisplayGroup($elements, $name, $options);
+ } else {
+ switch ($argc) {
+ case (1 <= $argc):
+ $elements = array_shift($spec);
+ if (!is_array($elements) && (null !== $name)) {
+ $elements = array_merge((array) $elements, $spec);
+ $this->addDisplayGroup($elements, $name);
+ break;
+ }
+ case (2 <= $argc):
+ if (null !== $name) {
+ $options = array_shift($spec);
+ $this->addDisplayGroup($elements, $name, $options);
+ break;
+ }
+ $name = array_shift($spec);
+ case (3 <= $argc):
+ $options = array_shift($spec);
+ default:
+ $this->addDisplayGroup($elements, $name, $options);
+ }
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Add multiple display groups (overwrites)
+ *
+ * @param array $groups
+ * @return Zend_Form
+ */
+ public function setDisplayGroups(array $groups)
+ {
+ return $this->clearDisplayGroups()
+ ->addDisplayGroups($groups);
+ }
+
+ /**
+ * Return a display group
+ *
+ * @param string $name
+ * @return Zend_Form_DisplayGroup|null
+ */
+ public function getDisplayGroup($name)
+ {
+ $name = (string) $name;
+ if (isset($this->_displayGroups[$name])) {
+ return $this->_displayGroups[$name];
+ }
+
+ return null;
+ }
+
+ /**
+ * Return all display groups
+ *
+ * @return array
+ */
+ public function getDisplayGroups()
+ {
+ return $this->_displayGroups;
+ }
+
+ /**
+ * Remove a display group by name
+ *
+ * @param string $name
+ * @return boolean
+ */
+ public function removeDisplayGroup($name)
+ {
+ $name = (string) $name;
+ if (array_key_exists($name, $this->_displayGroups)) {
+ /** @var Zend_Form_Element $element */
+ foreach ($this->_displayGroups[$name] as $key => $element) {
+ if (array_key_exists($key, $this->_elements)) {
+ $this->_order[$key] = $element->getOrder();
+ $this->_orderUpdated = true;
+ }
+ }
+ unset($this->_displayGroups[$name]);
+
+ if (array_key_exists($name, $this->_order)) {
+ unset($this->_order[$name]);
+ $this->_orderUpdated = true;
+ }
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Remove all display groups
+ *
+ * @return Zend_Form
+ */
+ public function clearDisplayGroups()
+ {
+ foreach ($this->_displayGroups as $key => $group) {
+ if (array_key_exists($key, $this->_order)) {
+ unset($this->_order[$key]);
+ }
+ /** @var Zend_Form_Element $element */
+ foreach ($group as $name => $element) {
+ if (isset($this->_elements[$name])) {
+ $this->_order[$name] = $element->getOrder();
+ }
+ $this->_order[$name] = $element->getOrder();
+ }
+ }
+ $this->_displayGroups = array();
+ $this->_orderUpdated = true;
+ return $this;
+ }
+
+
+ // Processing
+
+ /**
+ * Populate form
+ *
+ * Proxies to {@link setDefaults()}
+ *
+ * @param array $values
+ * @return Zend_Form
+ */
+ public function populate(array $values)
+ {
+ return $this->setDefaults($values);
+ }
+
+ /**
+ * Determine array key name from given value
+ *
+ * Given a value such as foo[bar][baz], returns the last element (in this case, 'baz').
+ *
+ * @param string $value
+ * @return string
+ */
+ protected function _getArrayName($value)
+ {
+ if (!is_string($value) || '' === $value) {
+ return $value;
+ }
+
+ if (!strstr($value, '[')) {
+ return $value;
+ }
+
+ $endPos = strlen($value) - 1;
+ if (']' != $value[$endPos]) {
+ return $value;
+ }
+
+ $start = strrpos($value, '[') + 1;
+ $name = substr($value, $start, $endPos - $start);
+ return $name;
+ }
+
+ /**
+ * Extract the value by walking the array using given array path.
+ *
+ * Given an array path such as foo[bar][baz], returns the value of the last
+ * element (in this case, 'baz').
+ *
+ * @param array $value Array to walk
+ * @param string $arrayPath Array notation path of the part to extract
+ * @return string
+ */
+ protected function _dissolveArrayValue($value, $arrayPath)
+ {
+ // As long as we have more levels
+ while ($arrayPos = strpos($arrayPath ?? '', '[')) {
+ // Get the next key in the path
+ $arrayKey = trim(substr($arrayPath, 0, $arrayPos), ']');
+
+ // Set the potentially final value or the next search point in the array
+ if (isset($value[$arrayKey])) {
+ $value = $value[$arrayKey];
+ }
+
+ // Set the next search point in the path
+ $arrayPath = trim(substr($arrayPath, $arrayPos + 1), ']');
+ }
+
+ if (isset($value[$arrayPath])) {
+ $value = $value[$arrayPath];
+ }
+
+ return $value;
+ }
+
+ /**
+ * Given an array, an optional arrayPath and a key this method
+ * dissolves the arrayPath and unsets the key within the array
+ * if it exists.
+ *
+ * @param array $array
+ * @param string|null $arrayPath
+ * @param string $key
+ * @return array
+ */
+ protected function _dissolveArrayUnsetKey($array, $arrayPath, $key)
+ {
+ $unset =& $array;
+ $path = trim(strtr((string)$arrayPath, array('[' => '/', ']' => '')), '/');
+ $segs = ('' !== $path) ? explode('/', $path) : array();
+
+ foreach ($segs as $seg) {
+ if (!array_key_exists($seg, (array)$unset)) {
+ return $array;
+ }
+ $unset =& $unset[$seg];
+ }
+ if (array_key_exists($key, (array)$unset)) {
+ unset($unset[$key]);
+ }
+ return $array;
+ }
+
+ /**
+ * Converts given arrayPath to an array and attaches given value at the end of it.
+ *
+ * @param mixed $value The value to attach
+ * @param string $arrayPath Given array path to convert and attach to.
+ * @return array
+ */
+ protected function _attachToArray($value, $arrayPath)
+ {
+ // As long as we have more levels
+ while ($arrayPos = strrpos($arrayPath, '[')) {
+ // Get the next key in the path
+ $arrayKey = trim(substr($arrayPath, $arrayPos + 1), ']');
+
+ // Attach
+ $value = array($arrayKey => $value);
+
+ // Set the next search point in the path
+ $arrayPath = trim(substr($arrayPath, 0, $arrayPos), ']');
+ }
+
+ $value = array($arrayPath => $value);
+
+ return $value;
+ }
+
+ /**
+ * Returns a one dimensional numerical indexed array with the
+ * Elements, SubForms and Elements from DisplayGroups as Values.
+ *
+ * Subitems are inserted based on their order Setting if set,
+ * otherwise they are appended, the resulting numerical index
+ * may differ from the order value.
+ *
+ * @access protected
+ * @return array
+ */
+ public function getElementsAndSubFormsOrdered()
+ {
+ $ordered = array();
+ foreach ($this->_order as $name => $order) {
+ $order = isset($order) ? $order : count($ordered);
+ if ($this->$name instanceof Zend_Form_Element ||
+ $this->$name instanceof Zend_Form) {
+ array_splice($ordered, $order, 0, array($this->$name));
+ } else if ($this->$name instanceof Zend_Form_DisplayGroup) {
+ $subordered = array();
+ /** @var Zend_Form_Element $element */
+ foreach ($this->$name->getElements() as $element) {
+ $suborder = $element->getOrder();
+ $suborder = (null !== $suborder) ? $suborder : count($subordered);
+ array_splice($subordered, $suborder, 0, array($element));
+ }
+ if (!empty($subordered)) {
+ array_splice($ordered, $order, 0, $subordered);
+ }
+ }
+ }
+ return $ordered;
+ }
+
+ /**
+ * This is a helper function until php 5.3 is widespreaded
+ *
+ * @param array $into
+ * @return array
+ */
+ protected function _array_replace_recursive(array $into)
+ {
+ $fromArrays = array_slice(func_get_args(),1);
+
+ foreach ($fromArrays as $from) {
+ foreach ($from as $key => $value) {
+ if (is_array($value)) {
+ if (!isset($into[$key])) {
+ $into[$key] = array();
+ }
+ $into[$key] = $this->_array_replace_recursive($into[$key], $from[$key]);
+ } else {
+ $into[$key] = $value;
+ }
+ }
+ }
+ return $into;
+ }
+
+ /**
+ * Validate the form
+ *
+ * @param array $data
+ * @throws Zend_Form_Exception
+ * @return bool
+ */
+ public function isValid($data)
+ {
+ if (!is_array($data)) {
+ throw new Zend_Form_Exception(__METHOD__ . ' expects an array');
+ }
+ $translator = $this->getTranslator();
+ $valid = true;
+ $eBelongTo = null;
+
+ if ($this->isArray()) {
+ $eBelongTo = $this->getElementsBelongTo();
+ $data = $this->_dissolveArrayValue($data, $eBelongTo);
+ }
+ $context = $data;
+ /** @var Zend_Form_Element $element */
+ foreach ($this->getElements() as $key => $element) {
+ if (null !== $translator && $this->hasTranslator()
+ && !$element->hasTranslator()) {
+ $element->setTranslator($translator);
+ }
+ $check = $data;
+ if (($belongsTo = $element->getBelongsTo()) !== $eBelongTo) {
+ $check = $this->_dissolveArrayValue($data, $belongsTo);
+ }
+ if (!isset($check[$key])) {
+ $valid = $element->isValid(null, $context) && $valid;
+ } else {
+ $valid = $element->isValid($check[$key], $context) && $valid;
+ $data = $this->_dissolveArrayUnsetKey($data, $belongsTo, $key);
+ }
+ }
+ /** @var Zend_Form_SubForm $form */
+ foreach ($this->getSubForms() as $key => $form) {
+ if (null !== $translator && $this->hasTranslator()
+ && !$form->hasTranslator()) {
+ $form->setTranslator($translator);
+ }
+ if (isset($data[$key]) && !$form->isArray()) {
+ $valid = $form->isValid($data[$key]) && $valid;
+ } else {
+ $valid = $form->isValid($data) && $valid;
+ }
+ }
+
+ $this->_errorsExist = !$valid;
+
+ // If manually flagged as an error, return invalid status
+ if ($this->_errorsForced) {
+ return false;
+ }
+
+ return $valid;
+ }
+
+ /**
+ * Validate a partial form
+ *
+ * Does not check for required flags.
+ *
+ * @param array $data
+ * @return boolean
+ */
+ public function isValidPartial(array $data)
+ {
+ $eBelongTo = null;
+
+ if ($this->isArray()) {
+ $eBelongTo = $this->getElementsBelongTo();
+ $data = $this->_dissolveArrayValue($data, $eBelongTo);
+ }
+
+ $translator = $this->getTranslator();
+ $valid = true;
+ $context = $data;
+
+ /** @var Zend_Form_Element $element */
+ foreach ($this->getElements() as $key => $element) {
+ $check = $data;
+ if (($belongsTo = $element->getBelongsTo()) !== $eBelongTo) {
+ $check = $this->_dissolveArrayValue($data, $belongsTo);
+ }
+ if (isset($check[$key])) {
+ if (null !== $translator && !$element->hasTranslator()) {
+ $element->setTranslator($translator);
+ }
+ $valid = $element->isValid($check[$key], $context) && $valid;
+ $data = $this->_dissolveArrayUnsetKey($data, $belongsTo, $key);
+ }
+ }
+ /** @var Zend_Form_SubForm $form */
+ foreach ($this->getSubForms() as $key => $form) {
+ if (null !== $translator && !$form->hasTranslator()) {
+ $form->setTranslator($translator);
+ }
+ if (isset($data[$key]) && !$form->isArray()) {
+ $valid = $form->isValidPartial($data[$key]) && $valid;
+ } else {
+ $valid = $form->isValidPartial($data) && $valid;
+ }
+ }
+
+ $this->_errorsExist = !$valid;
+ return $valid;
+ }
+
+ /**
+ * Process submitted AJAX data
+ *
+ * Checks if provided $data is valid, via {@link isValidPartial()}. If so,
+ * it returns JSON-encoded boolean true. If not, it returns JSON-encoded
+ * error messages (as returned by {@link getMessages()}).
+ *
+ * @param array $data
+ * @return string JSON-encoded boolean true or error messages
+ */
+ public function processAjax(array $data)
+ {
+ if ($this->isValidPartial($data)) {
+ return Zend_Json::encode(true);
+ }
+ $messages = $this->getMessages();
+ return Zend_Json::encode($messages);
+ }
+
+ /**
+ * Add a custom error message to return in the event of failed validation
+ *
+ * @param string $message
+ * @return Zend_Form
+ */
+ public function addErrorMessage($message)
+ {
+ $this->_errorMessages[] = (string) $message;
+ return $this;
+ }
+
+ /**
+ * Add multiple custom error messages to return in the event of failed validation
+ *
+ * @param array $messages
+ * @return Zend_Form
+ */
+ public function addErrorMessages(array $messages)
+ {
+ foreach ($messages as $message) {
+ $this->addErrorMessage($message);
+ }
+ return $this;
+ }
+
+ /**
+ * Same as addErrorMessages(), but clears custom error message stack first
+ *
+ * @param array $messages
+ * @return Zend_Form
+ */
+ public function setErrorMessages(array $messages)
+ {
+ $this->clearErrorMessages();
+ return $this->addErrorMessages($messages);
+ }
+
+ /**
+ * Retrieve custom error messages
+ *
+ * @return array
+ */
+ public function getErrorMessages()
+ {
+ return $this->_errorMessages;
+ }
+
+ /**
+ * Clear custom error messages stack
+ *
+ * @return Zend_Form
+ */
+ public function clearErrorMessages()
+ {
+ $this->_errorMessages = array();
+ return $this;
+ }
+
+ /**
+ * Mark the element as being in a failed validation state
+ *
+ * @return Zend_Form
+ */
+ public function markAsError()
+ {
+ $this->_errorsExist = true;
+ $this->_errorsForced = true;
+ return $this;
+ }
+
+ /**
+ * Add an error message and mark element as failed validation
+ *
+ * @param string $message
+ * @return Zend_Form
+ */
+ public function addError($message)
+ {
+ $this->addErrorMessage($message);
+ $this->markAsError();
+ return $this;
+ }
+
+ /**
+ * Add multiple error messages and flag element as failed validation
+ *
+ * @param array $messages
+ * @return Zend_Form
+ */
+ public function addErrors(array $messages)
+ {
+ foreach ($messages as $message) {
+ $this->addError($message);
+ }
+ return $this;
+ }
+
+ /**
+ * Overwrite any previously set error messages and flag as failed validation
+ *
+ * @param array $messages
+ * @return Zend_Form
+ */
+ public function setErrors(array $messages)
+ {
+ $this->clearErrorMessages();
+ return $this->addErrors($messages);
+ }
+
+
+ public function persistData()
+ {
+ }
+
+ /**
+ * Are there errors in the form?
+ *
+ * @deprecated since 1.11.1 - use hasErrors() instead
+ * @return bool
+ */
+ public function isErrors()
+ {
+ return $this->hasErrors();
+ }
+
+ /**
+ * Are there errors in the form?
+ *
+ * @return bool
+ */
+ public function hasErrors()
+ {
+ $errors = $this->_errorsExist;
+
+ if (!$errors) {
+ /** @var Zend_Form_Element $element */
+ foreach ($this->getElements() as $element) {
+ if ($element->hasErrors()) {
+ $errors = true;
+ break;
+ }
+ }
+
+ /** @var Zend_Form_SubForm $subForm */
+ foreach ($this->getSubForms() as $subForm) {
+ if ($subForm->hasErrors()) {
+ $errors = true;
+ break;
+ }
+ }
+ }
+
+ return $errors;
+ }
+
+ /**
+ * Get error codes for all elements failing validation
+ *
+ * @param string $name
+ * @param bool $suppressArrayNotation
+ * @return array
+ */
+ public function getErrors($name = null, $suppressArrayNotation = false)
+ {
+ $errors = array();
+ if (null !== $name) {
+ if (isset($this->_elements[$name])) {
+ return $this->getElement($name)->getErrors();
+ } else if (isset($this->_subForms[$name])) {
+ return $this->getSubForm($name)->getErrors(null, true);
+ }
+ }
+
+ /** @var Zend_Form_Element $element */
+ foreach ($this->_elements as $key => $element) {
+ $errors[$key] = $element->getErrors();
+ }
+ /** @var Zend_Form_SubForm $subForm */
+ foreach ($this->getSubForms() as $key => $subForm) {
+ $merge = array();
+ if (!$subForm->isArray()) {
+ $merge[$key] = $subForm->getErrors();
+ } else {
+ $merge = $this->_attachToArray($subForm->getErrors(null, true),
+ $subForm->getElementsBelongTo());
+ }
+ $errors = $this->_array_replace_recursive($errors, $merge);
+ }
+
+ if (!$suppressArrayNotation &&
+ $this->isArray() &&
+ !$this->_getIsRendered()) {
+ $errors = $this->_attachToArray($errors, $this->getElementsBelongTo());
+ }
+
+ return $errors;
+ }
+
+ /**
+ * Retrieve error messages from elements failing validations
+ *
+ * @param string $name
+ * @param bool $suppressArrayNotation
+ * @return array
+ */
+ public function getMessages($name = null, $suppressArrayNotation = false)
+ {
+ if (null !== $name) {
+ if (isset($this->_elements[$name])) {
+ return $this->getElement($name)->getMessages();
+ } else if (isset($this->_subForms[$name])) {
+ return $this->getSubForm($name)->getMessages(null, true);
+ }
+ /** @var Zend_Form_SubForm $subForm */
+ foreach ($this->getSubForms() as $key => $subForm) {
+ if ($subForm->isArray()) {
+ $belongTo = $subForm->getElementsBelongTo();
+ if ($name == $this->_getArrayName($belongTo)) {
+ return $subForm->getMessages(null, true);
+ }
+ }
+ }
+ }
+
+ $customMessages = $this->_getErrorMessages();
+ if ($this->isErrors() && !empty($customMessages)) {
+ return $customMessages;
+ }
+
+ $messages = array();
+
+ /** @var Zend_Form_Element $element */
+ foreach ($this->getElements() as $name => $element) {
+ $eMessages = $element->getMessages();
+ if (!empty($eMessages)) {
+ $messages[$name] = $eMessages;
+ }
+ }
+
+ /** @var Zend_Form_SubForm $subForm */
+ foreach ($this->getSubForms() as $key => $subForm) {
+ $merge = $subForm->getMessages(null, true);
+ if (!empty($merge)) {
+ if (!$subForm->isArray()) {
+ $merge = array($key => $merge);
+ } else {
+ $merge = $this->_attachToArray($merge,
+ $subForm->getElementsBelongTo());
+ }
+ $messages = $this->_array_replace_recursive($messages, $merge);
+ }
+ }
+
+ if (!$suppressArrayNotation &&
+ $this->isArray() &&
+ !$this->_getIsRendered()) {
+ $messages = $this->_attachToArray($messages, $this->getElementsBelongTo());
+ }
+
+ return $messages;
+ }
+
+ /**
+ * Retrieve translated custom error messages
+ * Proxies to {@link _getErrorMessages()}.
+ *
+ * @return array
+ */
+ public function getCustomMessages()
+ {
+ return $this->_getErrorMessages();
+ }
+
+
+ // Rendering
+
+ /**
+ * Set view object
+ *
+ * @param Zend_View_Interface $view
+ * @return Zend_Form
+ */
+ public function setView(Zend_View_Interface $view = null)
+ {
+ $this->_view = $view;
+ return $this;
+ }
+
+ /**
+ * Retrieve view object
+ *
+ * If none registered, attempts to pull from ViewRenderer.
+ *
+ * @return Zend_View_Interface|null
+ */
+ public function getView()
+ {
+ if (null === $this->_view) {
+ $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
+ $this->setView($viewRenderer->view);
+ }
+
+ return $this->_view;
+ }
+
+ /**
+ * Instantiate a decorator based on class name or class name fragment
+ *
+ * @param string $name
+ * @param null|array $options
+ * @return Zend_Form_Decorator_Interface
+ */
+ protected function _getDecorator($name, $options)
+ {
+ $class = $this->getPluginLoader(self::DECORATOR)->load($name);
+ if (null === $options) {
+ $decorator = new $class;
+ } else {
+ $decorator = new $class($options);
+ }
+
+ return $decorator;
+ }
+
+ /**
+ * Add a decorator for rendering the element
+ *
+ * @param string|Zend_Form_Decorator_Interface $decorator
+ * @param array|Zend_Config $options Options with which to initialize decorator
+ * @throws Zend_Form_Exception
+ * @return Zend_Form
+ */
+ public function addDecorator($decorator, $options = null)
+ {
+ if ($decorator instanceof Zend_Form_Decorator_Interface) {
+ $name = get_class($decorator);
+ } elseif (is_string($decorator)) {
+ $name = $decorator;
+ $decorator = array(
+ 'decorator' => $name,
+ 'options' => $options,
+ );
+ } elseif (is_array($decorator)) {
+ foreach ($decorator as $name => $spec) {
+ break;
+ }
+ if (is_numeric($name)) {
+ throw new Zend_Form_Exception('Invalid alias provided to addDecorator; must be alphanumeric string');
+ }
+ if (is_string($spec)) {
+ $decorator = array(
+ 'decorator' => $spec,
+ 'options' => $options,
+ );
+ } elseif ($spec instanceof Zend_Form_Decorator_Interface) {
+ $decorator = $spec;
+ }
+ } else {
+ throw new Zend_Form_Exception('Invalid decorator provided to addDecorator; must be string or Zend_Form_Decorator_Interface');
+ }
+
+ $this->_decorators[$name] = $decorator;
+
+ return $this;
+ }
+
+ /**
+ * Add many decorators at once
+ *
+ * @param array $decorators
+ * @throws Zend_Form_Exception
+ * @return Zend_Form
+ */
+ public function addDecorators(array $decorators)
+ {
+ foreach ($decorators as $decoratorName => $decoratorInfo) {
+ if (is_string($decoratorInfo) ||
+ $decoratorInfo instanceof Zend_Form_Decorator_Interface) {
+ if (!is_numeric($decoratorName)) {
+ $this->addDecorator(array($decoratorName => $decoratorInfo));
+ } else {
+ $this->addDecorator($decoratorInfo);
+ }
+ } elseif (is_array($decoratorInfo)) {
+ $argc = count($decoratorInfo);
+ $options = array();
+ if (isset($decoratorInfo['decorator'])) {
+ $decorator = $decoratorInfo['decorator'];
+ if (isset($decoratorInfo['options'])) {
+ $options = $decoratorInfo['options'];
+ }
+ $this->addDecorator($decorator, $options);
+ } else {
+ switch (true) {
+ case (0 == $argc):
+ break;
+ case (1 <= $argc):
+ $decorator = array_shift($decoratorInfo);
+ case (2 <= $argc):
+ $options = array_shift($decoratorInfo);
+ default:
+ $this->addDecorator($decorator, $options);
+ break;
+ }
+ }
+ } else {
+ throw new Zend_Form_Exception('Invalid decorator passed to addDecorators()');
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Overwrite all decorators
+ *
+ * @param array $decorators
+ * @return Zend_Form
+ */
+ public function setDecorators(array $decorators)
+ {
+ $this->clearDecorators();
+ return $this->addDecorators($decorators);
+ }
+
+ /**
+ * Retrieve a registered decorator
+ *
+ * @param string $name
+ * @return false|Zend_Form_Decorator_Abstract
+ */
+ public function getDecorator($name)
+ {
+ if (!isset($this->_decorators[$name])) {
+ $len = strlen($name);
+ foreach ($this->_decorators as $localName => $decorator) {
+ if ($len > strlen($localName)) {
+ continue;
+ }
+
+ if (0 === substr_compare($localName, $name, -$len, $len, true)) {
+ if (is_array($decorator)) {
+ return $this->_loadDecorator($decorator, $localName);
+ }
+ return $decorator;
+ }
+ }
+ return false;
+ }
+
+ if (is_array($this->_decorators[$name])) {
+ return $this->_loadDecorator($this->_decorators[$name], $name);
+ }
+
+ return $this->_decorators[$name];
+ }
+
+ /**
+ * Retrieve all decorators
+ *
+ * @return array
+ */
+ public function getDecorators()
+ {
+ foreach ($this->_decorators as $key => $value) {
+ if (is_array($value)) {
+ $this->_loadDecorator($value, $key);
+ }
+ }
+ return $this->_decorators;
+ }
+
+ /**
+ * Remove a single decorator
+ *
+ * @param string $name
+ * @return bool
+ */
+ public function removeDecorator($name)
+ {
+ $decorator = $this->getDecorator($name);
+ if ($decorator) {
+ if (array_key_exists($name, $this->_decorators)) {
+ unset($this->_decorators[$name]);
+ } else {
+ $class = get_class($decorator);
+ if (!array_key_exists($class, $this->_decorators)) {
+ return false;
+ }
+ unset($this->_decorators[$class]);
+ }
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Clear all decorators
+ *
+ * @return Zend_Form
+ */
+ public function clearDecorators()
+ {
+ $this->_decorators = array();
+ return $this;
+ }
+
+ /**
+ * Set all element decorators as specified
+ *
+ * @param array $decorators
+ * @param array|null $elements Specific elements to decorate or exclude from decoration
+ * @param bool $include Whether $elements is an inclusion or exclusion list
+ * @return Zend_Form
+ */
+ public function setElementDecorators(array $decorators, array $elements = null, $include = true)
+ {
+ if (is_array($elements)) {
+ if ($include) {
+ $elementObjs = array();
+ foreach ($elements as $name) {
+ if (null !== ($element = $this->getElement($name))) {
+ $elementObjs[] = $element;
+ }
+ }
+ } else {
+ $elementObjs = $this->getElements();
+ foreach ($elements as $name) {
+ if (array_key_exists($name, $elementObjs)) {
+ unset($elementObjs[$name]);
+ }
+ }
+ }
+ } else {
+ $elementObjs = $this->getElements();
+ }
+
+ /** @var Zend_Form_Element $element */
+ foreach ($elementObjs as $element) {
+ $element->setDecorators($decorators);
+ }
+
+ $this->_elementDecorators = $decorators;
+
+ return $this;
+ }
+
+ /**
+ * Set all display group decorators as specified
+ *
+ * @param array $decorators
+ * @return Zend_Form
+ */
+ public function setDisplayGroupDecorators(array $decorators)
+ {
+ /** @var Zend_Form_DisplayGroup $group */
+ foreach ($this->getDisplayGroups() as $group) {
+ $group->setDecorators($decorators);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set all subform decorators as specified
+ *
+ * @param array $decorators
+ * @return Zend_Form
+ */
+ public function setSubFormDecorators(array $decorators)
+ {
+ /** @var Zend_Form_SubForm $form */
+ foreach ($this->getSubForms() as $form) {
+ $form->setDecorators($decorators);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Render form
+ *
+ * @param Zend_View_Interface $view
+ * @return string
+ */
+ public function render(Zend_View_Interface $view = null)
+ {
+ if (null !== $view) {
+ $this->setView($view);
+ }
+
+ $content = '';
+ /** @var Zend_Form_Decorator_Abstract $decorator */
+ foreach ($this->getDecorators() as $decorator) {
+ $decorator->setElement($this);
+ $content = $decorator->render($content);
+ }
+ $this->_setIsRendered();
+ return $content;
+ }
+
+ /**
+ * Serialize as string
+ *
+ * Proxies to {@link render()}.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ try {
+ $return = $this->render();
+ return $return;
+ } catch (Exception $e) {
+ $message = "Exception caught by form: " . $e->getMessage()
+ . "\nStack Trace:\n" . $e->getTraceAsString();
+ trigger_error($message, E_USER_WARNING);
+ return '';
+ }
+ }
+
+
+ // Localization:
+
+ /**
+ * Set translator object
+ *
+ * @param Zend_Translate|Zend_Translate_Adapter|null $translator
+ * @throws Zend_Form_Exception
+ * @return Zend_Form
+ */
+ public function setTranslator($translator = null)
+ {
+ if (null === $translator) {
+ $this->_translator = null;
+ } elseif ($translator instanceof Zend_Translate_Adapter) {
+ $this->_translator = $translator;
+ } elseif ($translator instanceof Zend_Translate) {
+ $this->_translator = $translator->getAdapter();
+ } else {
+ throw new Zend_Form_Exception('Invalid translator specified');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set global default translator object
+ *
+ * @param Zend_Translate|Zend_Translate_Adapter|null $translator
+ * @throws Zend_Form_Exception
+ * @return void
+ */
+ public static function setDefaultTranslator($translator = null)
+ {
+ if (null === $translator) {
+ self::$_translatorDefault = null;
+ } elseif ($translator instanceof Zend_Translate_Adapter) {
+ self::$_translatorDefault = $translator;
+ } elseif ($translator instanceof Zend_Translate) {
+ self::$_translatorDefault = $translator->getAdapter();
+ } else {
+ throw new Zend_Form_Exception('Invalid translator specified');
+ }
+ }
+
+ /**
+ * Retrieve translator object
+ *
+ * @return Zend_Translate|null
+ */
+ public function getTranslator()
+ {
+ if ($this->translatorIsDisabled()) {
+ return null;
+ }
+
+ if (null === $this->_translator) {
+ return self::getDefaultTranslator();
+ }
+
+ return $this->_translator;
+ }
+
+ /**
+ * Does this form have its own specific translator?
+ *
+ * @return bool
+ */
+ public function hasTranslator()
+ {
+ return (bool)$this->_translator;
+ }
+
+ /**
+ * Get global default translator object
+ *
+ * @return null|Zend_Translate
+ */
+ public static function getDefaultTranslator()
+ {
+ if (null === self::$_translatorDefault) {
+ if (Zend_Registry::isRegistered('Zend_Translate')) {
+ $translator = Zend_Registry::get('Zend_Translate');
+ if ($translator instanceof Zend_Translate_Adapter) {
+ return $translator;
+ } elseif ($translator instanceof Zend_Translate) {
+ return $translator->getAdapter();
+ }
+ }
+ }
+ return self::$_translatorDefault;
+ }
+
+ /**
+ * Is there a default translation object set?
+ *
+ * @return boolean
+ */
+ public static function hasDefaultTranslator()
+ {
+ return (bool)self::$_translatorDefault;
+ }
+
+ /**
+ * Indicate whether or not translation should be disabled
+ *
+ * @param bool $flag
+ * @return Zend_Form
+ */
+ public function setDisableTranslator($flag)
+ {
+ $this->_translatorDisabled = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Is translation disabled?
+ *
+ * @return bool
+ */
+ public function translatorIsDisabled()
+ {
+ return $this->_translatorDisabled;
+ }
+
+ /**
+ * Overloading: access to elements, form groups, and display groups
+ *
+ * @param string $name
+ * @return Zend_Form_Element|Zend_Form|null
+ */
+ public function __get($name)
+ {
+ if (isset($this->_elements[$name])) {
+ return $this->_elements[$name];
+ } elseif (isset($this->_subForms[$name])) {
+ return $this->_subForms[$name];
+ } elseif (isset($this->_displayGroups[$name])) {
+ return $this->_displayGroups[$name];
+ }
+
+ return null;
+ }
+
+ /**
+ * Overloading: access to elements, form groups, and display groups
+ *
+ * @param string $name
+ * @param Zend_Form_Element|Zend_Form $value
+ * @return void
+ * @throws Zend_Form_Exception for invalid $value
+ */
+ public function __set($name, $value)
+ {
+ if ($value instanceof Zend_Form_Element) {
+ $this->addElement($value, $name);
+ return;
+ } elseif ($value instanceof Zend_Form) {
+ $this->addSubForm($value, $name);
+ return;
+ } elseif (is_array($value)) {
+ $this->addDisplayGroup($value, $name);
+ return;
+ }
+
+ if (is_object($value)) {
+ $type = get_class($value);
+ } else {
+ $type = gettype($value);
+ }
+ throw new Zend_Form_Exception('Only form elements and groups may be overloaded; variable of type "' . $type . '" provided');
+ }
+
+ /**
+ * Overloading: access to elements, form groups, and display groups
+ *
+ * @param string $name
+ * @return boolean
+ */
+ public function __isset($name)
+ {
+ if (isset($this->_elements[$name])
+ || isset($this->_subForms[$name])
+ || isset($this->_displayGroups[$name]))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Overloading: access to elements, form groups, and display groups
+ *
+ * @param string $name
+ * @return void
+ */
+ public function __unset($name)
+ {
+ if (isset($this->_elements[$name])) {
+ unset($this->_elements[$name]);
+ } elseif (isset($this->_subForms[$name])) {
+ unset($this->_subForms[$name]);
+ } elseif (isset($this->_displayGroups[$name])) {
+ unset($this->_displayGroups[$name]);
+ }
+ }
+
+ /**
+ * Overloading: allow rendering specific decorators
+ *
+ * Call renderDecoratorName() to render a specific decorator.
+ *
+ * @param string $method
+ * @param array $args
+ * @return string
+ * @throws Zend_Form_Exception for invalid decorator or invalid method call
+ */
+ public function __call($method, $args)
+ {
+ if ('render' == substr($method, 0, 6)) {
+ $decoratorName = substr($method, 6);
+ if (false !== ($decorator = $this->getDecorator($decoratorName))) {
+ $decorator->setElement($this);
+ $seed = '';
+ if (0 < count($args)) {
+ $seed = array_shift($args);
+ }
+ if ($decoratorName === 'FormElements' ||
+ $decoratorName === 'PrepareElements') {
+ $this->_setIsRendered();
+ }
+ return $decorator->render($seed);
+ }
+
+ throw new Zend_Form_Exception(sprintf('Decorator by name %s does not exist', $decoratorName));
+ }
+
+ throw new Zend_Form_Exception(sprintf('Method %s does not exist', $method));
+ }
+
+ // Interfaces: Iterator, Countable
+
+ /**
+ * Current element/subform/display group
+ *
+ * @throws Zend_Form_Exception
+ * @return Zend_Form_Element|Zend_Form_DisplayGroup|Zend_Form
+ */
+ #[\ReturnTypeWillChange]
+ public function current()
+ {
+ $this->_sort();
+ current($this->_order);
+ $key = key($this->_order);
+
+ if (isset($this->_elements[$key])) {
+ return $this->getElement($key);
+ } elseif (isset($this->_subForms[$key])) {
+ return $this->getSubForm($key);
+ } elseif (isset($this->_displayGroups[$key])) {
+ return $this->getDisplayGroup($key);
+ } else {
+ throw new Zend_Form_Exception(sprintf('Corruption detected in form; invalid key ("%s") found in internal iterator', (string) $key));
+ }
+ }
+
+ /**
+ * Current element/subform/display group name
+ *
+ * @return string
+ */
+ public function key(): string
+ {
+ $this->_sort();
+ return key($this->_order);
+ }
+
+ /**
+ * Move pointer to next element/subform/display group
+ *
+ * @return void
+ */
+ public function next(): void
+ {
+ $this->_sort();
+ next($this->_order);
+ }
+
+ /**
+ * Move pointer to beginning of element/subform/display group loop
+ *
+ * @return void
+ */
+ public function rewind(): void
+ {
+ $this->_sort();
+ reset($this->_order);
+ }
+
+ /**
+ * Determine if current element/subform/display group is valid
+ *
+ * @return bool
+ */
+ public function valid(): bool
+ {
+ $this->_sort();
+ return (current($this->_order) !== false);
+ }
+
+ /**
+ * Count of elements/subforms that are iterable
+ *
+ * @return int
+ */
+ public function count(): int
+ {
+ return count($this->_order);
+ }
+
+ /**
+ * Set flag to disable loading default decorators
+ *
+ * @param bool $flag
+ * @return Zend_Form
+ */
+ public function setDisableLoadDefaultDecorators($flag)
+ {
+ $this->_disableLoadDefaultDecorators = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Should we load the default decorators?
+ *
+ * @return bool
+ */
+ public function loadDefaultDecoratorsIsDisabled()
+ {
+ return $this->_disableLoadDefaultDecorators;
+ }
+
+ /**
+ * Load the default decorators
+ *
+ * @return Zend_Form
+ */
+ public function loadDefaultDecorators()
+ {
+ if ($this->loadDefaultDecoratorsIsDisabled()) {
+ return $this;
+ }
+
+ $decorators = $this->getDecorators();
+ if (empty($decorators)) {
+ $this->addDecorator('FormElements')
+ ->addDecorator('HtmlTag', array('tag' => 'dl', 'class' => 'zend_form'))
+ ->addDecorator('Form');
+ }
+ return $this;
+ }
+
+ /**
+ * Remove an element from iteration
+ *
+ * @param string $name Element/group/form name
+ * @return void
+ */
+ public function removeFromIteration($name)
+ {
+ if (array_key_exists($name, $this->_order)) {
+ unset($this->_order[$name]);
+ $this->_orderUpdated = true;
+ }
+ }
+
+ /**
+ * Sort items according to their order
+ *
+ * @throws Zend_Form_Exception
+ * @return void
+ */
+ protected function _sort()
+ {
+ if ($this->_orderUpdated) {
+ $items = array();
+ $index = 0;
+ foreach ($this->_order as $key => $order) {
+ if (null === $order) {
+ if (null === ($order = $this->{$key}->getOrder())) {
+ while (array_search($index, $this->_order, true)) {
+ ++$index;
+ }
+ $items[$index] = $key;
+ ++$index;
+ } else {
+ $items[$order] = $key;
+ }
+ } elseif (isset($items[$order]) && $items[$order] !== $key) {
+ throw new Zend_Form_Exception('Form elements ' .
+ $items[$order] . ' and ' . $key .
+ ' have the same order (' .
+ $order . ') - ' .
+ 'this would result in only the last added element to be rendered'
+ );
+ } else {
+ $items[$order] = $key;
+ }
+ }
+
+ $items = array_flip($items);
+ asort($items);
+ $this->_order = $items;
+ $this->_orderUpdated = false;
+ }
+ }
+
+ /**
+ * Lazy-load a decorator
+ *
+ * @param array $decorator Decorator type and options
+ * @param mixed $name Decorator name or alias
+ * @return Zend_Form_Decorator_Interface
+ */
+ protected function _loadDecorator(array $decorator, $name)
+ {
+ $sameName = false;
+ if ($name == $decorator['decorator']) {
+ $sameName = true;
+ }
+
+ $instance = $this->_getDecorator($decorator['decorator'], $decorator['options']);
+ if ($sameName) {
+ $newName = get_class($instance);
+ $decoratorNames = array_keys($this->_decorators);
+ $order = array_flip($decoratorNames);
+ $order[$newName] = $order[$name];
+ $decoratorsExchange = array();
+ unset($order[$name]);
+ asort($order);
+ foreach ($order as $key => $index) {
+ if ($key == $newName) {
+ $decoratorsExchange[$key] = $instance;
+ continue;
+ }
+ $decoratorsExchange[$key] = $this->_decorators[$key];
+ }
+ $this->_decorators = $decoratorsExchange;
+ } else {
+ $this->_decorators[$name] = $instance;
+ }
+
+ return $instance;
+ }
+
+ /**
+ * Retrieve optionally translated custom error messages
+ *
+ * @return array
+ */
+ protected function _getErrorMessages()
+ {
+ $messages = $this->getErrorMessages();
+ $translator = $this->getTranslator();
+ if (null !== $translator) {
+ foreach ($messages as $key => $message) {
+ $messages[$key] = $translator->translate($message);
+ }
+ }
+ return $messages;
+ }
+}
diff --git a/library/vendor/Zend/Form/Decorator/Abstract.php b/library/vendor/Zend/Form/Decorator/Abstract.php
new file mode 100644
index 0000000..93c5a05
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/Abstract.php
@@ -0,0 +1,251 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Decorator_Interface */
+
+/**
+ * Zend_Form_Decorator_Abstract
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+abstract class Zend_Form_Decorator_Abstract implements Zend_Form_Decorator_Interface
+{
+ /**
+ * Placement constants
+ */
+ const APPEND = 'APPEND';
+ const PREPEND = 'PREPEND';
+
+ /**
+ * Default placement: append
+ * @var string
+ */
+ protected $_placement = 'APPEND';
+
+ /**
+ * @var Zend_Form_Element|Zend_Form
+ */
+ protected $_element;
+
+ /**
+ * Decorator options
+ * @var array
+ */
+ protected $_options = array();
+
+ /**
+ * Separator between new content and old
+ * @var string
+ */
+ protected $_separator = PHP_EOL;
+
+ /**
+ * Constructor
+ *
+ * @param array|Zend_Config $options
+ * @return void
+ */
+ public function __construct($options = null)
+ {
+ if (is_array($options)) {
+ $this->setOptions($options);
+ } elseif ($options instanceof Zend_Config) {
+ $this->setConfig($options);
+ }
+ }
+
+ /**
+ * Set options
+ *
+ * @param array $options
+ * @return Zend_Form_Decorator_Abstract
+ */
+ public function setOptions(array $options)
+ {
+ $this->_options = $options;
+ return $this;
+ }
+
+ /**
+ * Set options from config object
+ *
+ * @param Zend_Config $config
+ * @return Zend_Form_Decorator_Abstract
+ */
+ public function setConfig(Zend_Config $config)
+ {
+ return $this->setOptions($config->toArray());
+ }
+
+ /**
+ * Set option
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return Zend_Form_Decorator_Abstract
+ */
+ public function setOption($key, $value)
+ {
+ $this->_options[(string) $key] = $value;
+ return $this;
+ }
+
+ /**
+ * Get option
+ *
+ * @param string $key
+ * @return mixed
+ */
+ public function getOption($key)
+ {
+ $key = (string) $key;
+ if (isset($this->_options[$key])) {
+ return $this->_options[$key];
+ }
+
+ return null;
+ }
+
+ /**
+ * Retrieve options
+ *
+ * @return array
+ */
+ public function getOptions()
+ {
+ return $this->_options;
+ }
+
+ /**
+ * Remove single option
+ *
+ * @param mixed $key
+ * @return void
+ */
+ public function removeOption($key)
+ {
+ if (null !== $this->getOption($key)) {
+ unset($this->_options[$key]);
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Clear all options
+ *
+ * @return Zend_Form_Decorator_Abstract
+ */
+ public function clearOptions()
+ {
+ $this->_options = array();
+ return $this;
+ }
+
+ /**
+ * Set current form element
+ *
+ * @param Zend_Form_Element|Zend_Form $element
+ * @return Zend_Form_Decorator_Abstract
+ * @throws Zend_Form_Decorator_Exception on invalid element type
+ */
+ public function setElement($element)
+ {
+ if ((!$element instanceof Zend_Form_Element)
+ && (!$element instanceof Zend_Form)
+ && (!$element instanceof Zend_Form_DisplayGroup))
+ {
+ throw new Zend_Form_Decorator_Exception('Invalid element type passed to decorator');
+ }
+
+ $this->_element = $element;
+ return $this;
+ }
+
+ /**
+ * Retrieve current element
+ *
+ * @return Zend_Form_Element|Zend_Form
+ */
+ public function getElement()
+ {
+ return $this->_element;
+ }
+
+ /**
+ * Determine if decorator should append or prepend content
+ *
+ * @return string
+ */
+ public function getPlacement()
+ {
+ $placement = $this->_placement;
+ if (null !== ($placementOpt = $this->getOption('placement'))) {
+ $placementOpt = strtoupper($placementOpt);
+ switch ($placementOpt) {
+ case self::APPEND:
+ case self::PREPEND:
+ $placement = $this->_placement = $placementOpt;
+ break;
+ case false:
+ $placement = $this->_placement = null;
+ break;
+ default:
+ break;
+ }
+ $this->removeOption('placement');
+ }
+
+ return $placement;
+ }
+
+ /**
+ * Retrieve separator to use between old and new content
+ *
+ * @return string
+ */
+ public function getSeparator()
+ {
+ $separator = $this->_separator;
+ if (null !== ($separatorOpt = $this->getOption('separator'))) {
+ $separator = $this->_separator = (string) $separatorOpt;
+ $this->removeOption('separator');
+ }
+ return $separator;
+ }
+
+ /**
+ * Decorate content and/or element
+ *
+ * @param string $content
+ * @return string
+ * @throws Zend_Form_Decorator_Exception when unimplemented
+ */
+ public function render($content)
+ {
+ throw new Zend_Form_Decorator_Exception('render() not implemented');
+ }
+}
diff --git a/library/vendor/Zend/Form/Decorator/Callback.php b/library/vendor/Zend/Form/Decorator/Callback.php
new file mode 100644
index 0000000..fb759fd
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/Callback.php
@@ -0,0 +1,126 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Decorator_Abstract */
+
+/**
+ * Zend_Form_Decorator_Callback
+ *
+ * Execute an arbitrary callback to decorate an element. Callbacks should take
+ * three arguments, $content, $element, and $options:
+ *
+ * function mycallback($content, $element, array $options)
+ * {
+ * }
+ *
+ * and should return a string. ($options are whatever options were provided to
+ * the decorator.)
+ *
+ * To specify a callback, pass a valid callback as the 'callback' option.
+ *
+ * Callback results will be either appended, prepended, or replace the provided
+ * content. To replace the content, specify a placement of boolean false;
+ * defaults to append content.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Decorator_Callback extends Zend_Form_Decorator_Abstract
+{
+ /**
+ * Callback
+ * @var string|array
+ */
+ protected $_callback;
+
+ /**
+ * Set callback
+ *
+ * @param callback $callback
+ * @return Zend_Form_Decorator_Callback
+ * @throws Zend_Form_Exception
+ */
+ public function setCallback($callback)
+ {
+ if (!is_callable($callback)) {
+ throw new Zend_Form_Exception('Invalid callback provided to callback decorator');
+ }
+ $this->_callback = $callback;
+ return $this;
+ }
+
+ /**
+ * Get registered callback
+ *
+ * If not previously registered, checks to see if it exists in registered
+ * options.
+ *
+ * @return null|string|array
+ */
+ public function getCallback()
+ {
+ if (null === $this->_callback) {
+ if (null !== ($callback = $this->getOption('callback'))) {
+ $this->setCallback($callback);
+ $this->removeOption('callback');
+ }
+ }
+
+ return $this->_callback;
+ }
+
+ /**
+ * Render
+ *
+ * If no callback registered, returns callback. Otherwise, gets return
+ * value of callback and either appends, prepends, or replaces passed in
+ * content.
+ *
+ * @param string $content
+ * @return string
+ */
+ public function render($content)
+ {
+ $callback = $this->getCallback();
+ if (null === $callback) {
+ return $content;
+ }
+
+ $placement = $this->getPlacement();
+ $separator = $this->getSeparator();
+
+ $response = call_user_func($callback, $content, $this->getElement(), $this->getOptions());
+
+ switch ($placement) {
+ case self::APPEND:
+ return $content . $separator . $response;
+ case self::PREPEND:
+ return $response . $separator . $content;
+ default:
+ // replace content
+ return $response;
+ }
+ }
+}
diff --git a/library/vendor/Zend/Form/Decorator/Captcha.php b/library/vendor/Zend/Form/Decorator/Captcha.php
new file mode 100644
index 0000000..914189e
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/Captcha.php
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** @see Zend_Form_Decorator_Abstract */
+
+/**
+ * Captcha generic decorator
+ *
+ * Adds captcha adapter output
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Decorator_Captcha extends Zend_Form_Decorator_Abstract
+{
+ /**
+ * Render captcha
+ *
+ * @param string $content
+ * @return string
+ */
+ public function render($content)
+ {
+ $element = $this->getElement();
+ if (!method_exists($element, 'getCaptcha')) {
+ return $content;
+ }
+
+ $view = $element->getView();
+ if (null === $view) {
+ return $content;
+ }
+
+ $placement = $this->getPlacement();
+ $separator = $this->getSeparator();
+
+ $captcha = $element->getCaptcha();
+ $markup = $captcha->render($view, $element);
+ switch ($placement) {
+ case 'PREPEND':
+ $content = $markup . $separator . $content;
+ break;
+ case 'APPEND':
+ default:
+ $content = $content . $separator . $markup;
+ }
+ return $content;
+ }
+}
diff --git a/library/vendor/Zend/Form/Decorator/Description.php b/library/vendor/Zend/Form/Decorator/Description.php
new file mode 100644
index 0000000..63dfdbc
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/Description.php
@@ -0,0 +1,197 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Decorator_Abstract */
+
+/**
+ * Zend_Form_Decorator_Description
+ *
+ * Accepts the options:
+ * - separator: separator to use between label and content (defaults to PHP_EOL)
+ * - placement: whether to append or prepend label to content (defaults to prepend)
+ * - tag: if set, used to wrap the label in an additional HTML tag
+ * - class: if set, override default class used with HTML tag
+ * - escape: whether or not to escape description (true by default)
+ *
+ * Any other options passed will be used as HTML attributes of the HTML tag used.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Decorator_Description extends Zend_Form_Decorator_Abstract
+{
+ /**
+ * Whether or not to escape the description
+ * @var bool
+ */
+ protected $_escape;
+
+ /**
+ * Default placement: append
+ * @var string
+ */
+ protected $_placement = 'APPEND';
+
+ /**
+ * HTML tag with which to surround description
+ * @var string
+ */
+ protected $_tag;
+
+ /**
+ * Set HTML tag with which to surround description
+ *
+ * @param string $tag
+ * @return Zend_Form_Decorator_Description
+ */
+ public function setTag($tag)
+ {
+ $this->_tag = (string) $tag;
+ return $this;
+ }
+
+ /**
+ * Get HTML tag, if any, with which to surround description
+ *
+ * @return string
+ */
+ public function getTag()
+ {
+ if (null === $this->_tag) {
+ $tag = $this->getOption('tag');
+ if (null !== $tag) {
+ $this->removeOption('tag');
+ } else {
+ $tag = 'p';
+ }
+
+ $this->setTag($tag);
+ return $tag;
+ }
+
+ return $this->_tag;
+ }
+
+ /**
+ * Get class with which to define description
+ *
+ * Defaults to 'hint'
+ *
+ * @return string
+ */
+ public function getClass()
+ {
+ $class = $this->getOption('class');
+ if (null === $class) {
+ $class = 'hint';
+ $this->setOption('class', $class);
+ }
+
+ return $class;
+ }
+
+ /**
+ * Set whether or not to escape description
+ *
+ * @param bool $flag
+ * @return Zend_Form_Decorator_Description
+ */
+ public function setEscape($flag)
+ {
+ $this->_escape = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Get escape flag
+ *
+ * @return true
+ */
+ public function getEscape()
+ {
+ if (null === $this->_escape) {
+ if (null !== ($escape = $this->getOption('escape'))) {
+ $this->setEscape($escape);
+ $this->removeOption('escape');
+ } else {
+ $this->setEscape(true);
+ }
+ }
+
+ return $this->_escape;
+ }
+
+ /**
+ * Render a description
+ *
+ * @param string $content
+ * @return string
+ */
+ public function render($content)
+ {
+ $element = $this->getElement();
+ $view = $element->getView();
+ if (null === $view) {
+ return $content;
+ }
+
+ $description = $element->getDescription();
+ $description = trim($description ?? '');
+
+ if (!empty($description) && (null !== ($translator = $element->getTranslator()))) {
+ $description = $translator->translate($description);
+ }
+
+ if (empty($description)) {
+ return $content;
+ }
+
+ $separator = $this->getSeparator();
+ $placement = $this->getPlacement();
+ $tag = $this->getTag();
+ $class = $this->getClass();
+ $escape = $this->getEscape();
+
+ $options = $this->getOptions();
+
+ if ($escape) {
+ $description = $view->escape($description);
+ }
+
+ if (!empty($tag)) {
+ $options['tag'] = $tag;
+ $decorator = new Zend_Form_Decorator_HtmlTag($options);
+ $description = $decorator->render($description);
+ }
+
+ switch ($placement) {
+ case self::PREPEND:
+ return $description . $separator . $content;
+ case self::APPEND:
+ default:
+ return $content . $separator . $description;
+ }
+ }
+}
diff --git a/library/vendor/Zend/Form/Decorator/DtDdWrapper.php b/library/vendor/Zend/Form/Decorator/DtDdWrapper.php
new file mode 100644
index 0000000..b569fab
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/DtDdWrapper.php
@@ -0,0 +1,69 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Decorator_Abstract */
+
+/**
+ * Zend_Form_Decorator_DtDdWrapper
+ *
+ * Creates an empty <dt> item, and wraps the content in a <dd>. Used as a
+ * default decorator for subforms and display groups.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Decorator_DtDdWrapper extends Zend_Form_Decorator_Abstract
+{
+ /**
+ * Default placement: surround content
+ * @var string
+ */
+ protected $_placement = null;
+
+ /**
+ * Render
+ *
+ * Renders as the following:
+ * <dt>$dtLabel</dt>
+ * <dd>$content</dd>
+ *
+ * $dtLabel can be set via 'dtLabel' option, defaults to '\&#160;'
+ *
+ * @param string $content
+ * @return string
+ */
+ public function render($content)
+ {
+ $elementName = $this->getElement()->getName();
+
+ $dtLabel = $this->getOption('dtLabel');
+ if( null === $dtLabel ) {
+ $dtLabel = '&#160;';
+ }
+
+ return '<dt id="' . $elementName . '-label">' . $dtLabel . '</dt>' .
+ '<dd id="' . $elementName . '-element">' . $content . '</dd>';
+ }
+}
diff --git a/library/vendor/Zend/Form/Decorator/Errors.php b/library/vendor/Zend/Form/Decorator/Errors.php
new file mode 100644
index 0000000..24fc3d9
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/Errors.php
@@ -0,0 +1,76 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Decorator_Abstract */
+
+/**
+ * Zend_Form_Decorator_Errors
+ *
+ * Any options passed will be used as HTML attributes of the ul tag for the errors.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Decorator_Errors extends Zend_Form_Decorator_Abstract
+{
+ /**
+ * Render errors
+ *
+ * @param string $content
+ * @return string
+ */
+ public function render($content)
+ {
+ $element = $this->getElement();
+ $view = $element->getView();
+ if (null === $view) {
+ return $content;
+ }
+
+ // Get error messages
+ if ($element instanceof Zend_Form
+ && null !== $element->getElementsBelongTo()
+ ) {
+ $errors = $element->getMessages(null, true);
+ } else {
+ $errors = $element->getMessages();
+ }
+
+ if (empty($errors)) {
+ return $content;
+ }
+
+ $separator = $this->getSeparator();
+ $placement = $this->getPlacement();
+ $errors = $view->formErrors($errors, $this->getOptions());
+
+ switch ($placement) {
+ case self::APPEND:
+ return $content . $separator . $errors;
+ case self::PREPEND:
+ return $errors . $separator . $content;
+ }
+ }
+}
diff --git a/library/vendor/Zend/Form/Decorator/Exception.php b/library/vendor/Zend/Form/Decorator/Exception.php
new file mode 100644
index 0000000..6d86f32
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/Exception.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Exception */
+
+/**
+ * Exception for Zend_Form component.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Form_Decorator_Exception extends Zend_Form_Exception
+{
+}
diff --git a/library/vendor/Zend/Form/Decorator/Fieldset.php b/library/vendor/Zend/Form/Decorator/Fieldset.php
new file mode 100644
index 0000000..036df2c
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/Fieldset.php
@@ -0,0 +1,156 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Decorator_Abstract */
+
+/**
+ * Zend_Form_Decorator_Fieldset
+ *
+ * Any options passed will be used as HTML attributes of the fieldset tag.
+ *
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Decorator_Fieldset extends Zend_Form_Decorator_Abstract
+{
+ /**
+ * Attribs that should be removed prior to rendering
+ * @var array
+ */
+ public $stripAttribs = array(
+ 'action',
+ 'enctype',
+ 'helper',
+ 'method',
+ 'name',
+ 'accept-charset',
+ );
+
+ /**
+ * Fieldset legend
+ * @var string
+ */
+ protected $_legend;
+
+ /**
+ * Default placement: surround content
+ * @var string
+ */
+ protected $_placement = null;
+
+ /**
+ * Get options
+ *
+ * Merges in element attributes as well.
+ *
+ * @return array
+ */
+ public function getOptions()
+ {
+ $options = parent::getOptions();
+ if (null !== ($element = $this->getElement())) {
+ $attribs = $element->getAttribs();
+ $options = array_merge($attribs, $options);
+ $this->setOptions($options);
+ }
+ return $options;
+ }
+
+ /**
+ * Set legend
+ *
+ * @param string $value
+ * @return Zend_Form_Decorator_Fieldset
+ */
+ public function setLegend($value)
+ {
+ $this->_legend = (string) $value;
+ return $this;
+ }
+
+ /**
+ * Get legend
+ *
+ * @return string
+ */
+ public function getLegend()
+ {
+ $legend = $this->_legend;
+ if ((null === $legend) && (null !== ($element = $this->getElement()))) {
+ if (method_exists($element, 'getLegend')) {
+ $legend = $element->getLegend();
+ $this->setLegend($legend);
+ }
+ }
+ if ((null === $legend) && (null !== ($legend = $this->getOption('legend')))) {
+ $this->setLegend($legend);
+ $this->removeOption('legend');
+ }
+
+ return $legend;
+ }
+
+ /**
+ * Render a fieldset
+ *
+ * @param string $content
+ * @return string
+ */
+ public function render($content)
+ {
+ $element = $this->getElement();
+ $view = $element->getView();
+ if (null === $view) {
+ return $content;
+ }
+
+ $legend = $this->getLegend();
+ $attribs = $this->getOptions();
+ $name = $element->getFullyQualifiedName();
+ $id = (string)$element->getId();
+
+ if ((!array_key_exists('id', $attribs) || $attribs['id'] == $id) && '' !== $id) {
+ $attribs['id'] = 'fieldset-' . $id;
+ }
+
+ if (null !== $legend) {
+ if (null !== ($translator = $element->getTranslator())) {
+ $legend = $translator->translate($legend);
+ }
+
+ $attribs['legend'] = $legend;
+ }
+
+ foreach (array_keys($attribs) as $attrib) {
+ $testAttrib = strtolower($attrib);
+ if (in_array($testAttrib, $this->stripAttribs)) {
+ unset($attribs[$attrib]);
+ }
+ }
+
+ return $view->fieldset($name, $content, $attribs);
+ }
+}
diff --git a/library/vendor/Zend/Form/Decorator/File.php b/library/vendor/Zend/Form/Decorator/File.php
new file mode 100644
index 0000000..d7141de
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/File.php
@@ -0,0 +1,140 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Decorator_Abstract */
+
+/** Zend_Form_Decorator_Marker_File_Interface */
+
+/** Zend_File_Transfer_Adapter_Http */
+
+/**
+ * Zend_Form_Decorator_File
+ *
+ * Fixes the rendering for all subform and multi file elements
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Decorator_File
+ extends Zend_Form_Decorator_Abstract
+ implements Zend_Form_Decorator_Marker_File_Interface
+{
+ /**
+ * Attributes that should not be passed to helper
+ * @var array
+ */
+ protected $_attribBlacklist = array('helper', 'placement', 'separator', 'value');
+
+ /**
+ * Default placement: append
+ * @var string
+ */
+ protected $_placement = 'APPEND';
+
+ /**
+ * Get attributes to pass to file helper
+ *
+ * @return array
+ */
+ public function getAttribs()
+ {
+ $attribs = $this->getOptions();
+
+ if (null !== ($element = $this->getElement())) {
+ $attribs = array_merge($attribs, $element->getAttribs());
+ }
+
+ foreach ($this->_attribBlacklist as $key) {
+ if (array_key_exists($key, $attribs)) {
+ unset($attribs[$key]);
+ }
+ }
+
+ return $attribs;
+ }
+
+ /**
+ * Render a form file
+ *
+ * @param string $content
+ * @return string
+ */
+ public function render($content)
+ {
+ $element = $this->getElement();
+ if (!$element instanceof Zend_Form_Element) {
+ return $content;
+ }
+
+ $view = $element->getView();
+ if (!$view instanceof Zend_View_Interface) {
+ return $content;
+ }
+
+ $name = $element->getName();
+ $attribs = $this->getAttribs();
+ if (!array_key_exists('id', $attribs)) {
+ $attribs['id'] = $name;
+ }
+
+ $separator = $this->getSeparator();
+ $placement = $this->getPlacement();
+ $markup = array();
+ $size = $element->getMaxFileSize();
+ if ($size > 0) {
+ $element->setMaxFileSize(0);
+ $markup[] = $view->formHidden('MAX_FILE_SIZE', $size);
+ }
+
+ if (Zend_File_Transfer_Adapter_Http::isApcAvailable()) {
+ $markup[] = $view->formHidden(ini_get('apc.rfc1867_name'), uniqid(), array('id' => 'progress_key'));
+ } else if (Zend_File_Transfer_Adapter_Http::isUploadProgressAvailable()) {
+ $markup[] = $view->formHidden('UPLOAD_IDENTIFIER', uniqid(), array('id' => 'progress_key'));
+ }
+
+ $helper = $element->helper;
+ if ($element->isArray()) {
+ $name .= "[]";
+ $count = $element->getMultiFile();
+ for ($i = 0; $i < $count; ++$i) {
+ $htmlAttribs = $attribs;
+ $htmlAttribs['id'] .= '-' . $i;
+ $markup[] = $view->$helper($name, $htmlAttribs);
+ }
+ } else {
+ $markup[] = $view->$helper($name, $attribs);
+ }
+
+ $markup = implode($separator, $markup);
+
+ switch ($placement) {
+ case self::PREPEND:
+ return $markup . $separator . $content;
+ case self::APPEND:
+ default:
+ return $content . $separator . $markup;
+ }
+ }
+}
diff --git a/library/vendor/Zend/Form/Decorator/Form.php b/library/vendor/Zend/Form/Decorator/Form.php
new file mode 100644
index 0000000..c885731
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/Form.php
@@ -0,0 +1,133 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Decorator_Abstract */
+
+/**
+ * Zend_Form_Decorator_Form
+ *
+ * Render a Zend_Form object.
+ *
+ * Accepts following options:
+ * - separator: Separator to use between elements
+ * - helper: which view helper to use when rendering form. Should accept three
+ * arguments, string content, a name, and an array of attributes.
+ *
+ * Any other options passed will be used as HTML attributes of the form tag.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Decorator_Form extends Zend_Form_Decorator_Abstract
+{
+ /**
+ * Default view helper
+ * @var string
+ */
+ protected $_helper = 'form';
+
+ /**
+ * Set view helper for rendering form
+ *
+ * @param string $helper
+ * @return Zend_Form_Decorator_Form
+ */
+ public function setHelper($helper)
+ {
+ $this->_helper = (string) $helper;
+ return $this;
+ }
+
+ /**
+ * Get view helper for rendering form
+ *
+ * @return string
+ */
+ public function getHelper()
+ {
+ if (null !== ($helper = $this->getOption('helper'))) {
+ $this->setHelper($helper);
+ $this->removeOption('helper');
+ }
+ return $this->_helper;
+ }
+
+ /**
+ * Retrieve decorator options
+ *
+ * Assures that form action and method are set, and sets appropriate
+ * encoding type if current method is POST.
+ *
+ * @return array
+ */
+ public function getOptions()
+ {
+ if (null !== ($element = $this->getElement())) {
+ if ($element instanceof Zend_Form) {
+ $element->getAction();
+ $method = $element->getMethod();
+ if ($method == Zend_Form::METHOD_POST) {
+ $this->setOption('enctype', 'application/x-www-form-urlencoded');
+ }
+ foreach ($element->getAttribs() as $key => $value) {
+ $this->setOption($key, $value);
+ }
+ } elseif ($element instanceof Zend_Form_DisplayGroup) {
+ foreach ($element->getAttribs() as $key => $value) {
+ $this->setOption($key, $value);
+ }
+ }
+ }
+
+ if (isset($this->_options['method'])) {
+ $this->_options['method'] = strtolower($this->_options['method']);
+ }
+
+ return $this->_options;
+ }
+
+ /**
+ * Render a form
+ *
+ * Replaces $content entirely from currently set element.
+ *
+ * @param string $content
+ * @return string
+ */
+ public function render($content)
+ {
+ $form = $this->getElement();
+ $view = $form->getView();
+ if (null === $view) {
+ return $content;
+ }
+
+ $helper = $this->getHelper();
+ $attribs = $this->getOptions();
+ $name = $form->getFullyQualifiedName();
+ $attribs['id'] = $form->getId();
+ return $view->$helper($name, $attribs, $content);
+ }
+}
diff --git a/library/vendor/Zend/Form/Decorator/FormElements.php b/library/vendor/Zend/Form/Decorator/FormElements.php
new file mode 100644
index 0000000..c2fb136
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/FormElements.php
@@ -0,0 +1,140 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Decorator_Abstract */
+
+/**
+ * Zend_Form_Decorator_FormElements
+ *
+ * Render all form elements registered with current form
+ *
+ * Accepts following options:
+ * - separator: Separator to use between elements
+ *
+ * Any other options passed will be used as HTML attributes of the form tag.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Decorator_FormElements extends Zend_Form_Decorator_Abstract
+{
+ /**
+ * Merges given two belongsTo (array notation) strings
+ *
+ * @param string $baseBelongsTo
+ * @param string $belongsTo
+ * @return string
+ */
+ public function mergeBelongsTo($baseBelongsTo, $belongsTo)
+ {
+ $endOfArrayName = strpos($belongsTo, '[');
+
+ if ($endOfArrayName === false) {
+ return $baseBelongsTo . '[' . $belongsTo . ']';
+ }
+
+ $arrayName = substr($belongsTo, 0, $endOfArrayName);
+
+ return $baseBelongsTo . '[' . $arrayName . ']' . substr($belongsTo, $endOfArrayName);
+ }
+
+ /**
+ * Render form elements
+ *
+ * @param string $content
+ * @return string
+ */
+ public function render($content)
+ {
+ $form = $this->getElement();
+ if ((!$form instanceof Zend_Form) && (!$form instanceof Zend_Form_DisplayGroup)) {
+ return $content;
+ }
+
+ $belongsTo = ($form instanceof Zend_Form) ? $form->getElementsBelongTo() : null;
+ $elementContent = '';
+ $displayGroups = ($form instanceof Zend_Form) ? $form->getDisplayGroups() : array();
+ $separator = $this->getSeparator();
+ $translator = $form->getTranslator();
+ $items = array();
+ $view = $form->getView();
+ foreach ($form as $item) {
+ $item->setView($view);
+
+ // Set translator
+ if (!$item->hasTranslator()) {
+ $item->setTranslator($translator);
+ }
+
+ if ($item instanceof Zend_Form_Element) {
+ foreach ($displayGroups as $group) {
+ $elementName = $item->getName();
+ $element = $group->getElement($elementName);
+ if ($element) {
+ // Element belongs to display group; only render in that
+ // context.
+ continue 2;
+ }
+ }
+ $item->setBelongsTo($belongsTo);
+ } elseif (!empty($belongsTo) && ($item instanceof Zend_Form)) {
+ if ($item->isArray()) {
+ $name = $this->mergeBelongsTo($belongsTo, $item->getElementsBelongTo());
+ $item->setElementsBelongTo($name, true);
+ } else {
+ $item->setElementsBelongTo($belongsTo, true);
+ }
+ } elseif (!empty($belongsTo) && ($item instanceof Zend_Form_DisplayGroup)) {
+ foreach ($item as $element) {
+ $element->setBelongsTo($belongsTo);
+ }
+ }
+
+ $items[] = $item->render();
+
+ if (($item instanceof Zend_Form_Element_File)
+ || (($item instanceof Zend_Form)
+ && (Zend_Form::ENCTYPE_MULTIPART == $item->getEnctype()))
+ || (($item instanceof Zend_Form_DisplayGroup)
+ && (Zend_Form::ENCTYPE_MULTIPART == $item->getAttrib('enctype')))
+ ) {
+ if ($form instanceof Zend_Form) {
+ $form->setEnctype(Zend_Form::ENCTYPE_MULTIPART);
+ } elseif ($form instanceof Zend_Form_DisplayGroup) {
+ $form->setAttrib('enctype', Zend_Form::ENCTYPE_MULTIPART);
+ }
+ }
+ }
+ $elementContent = implode($separator, $items);
+
+ switch ($this->getPlacement()) {
+ case self::PREPEND:
+ return $elementContent . $separator . $content;
+ case self::APPEND:
+ default:
+ return $content . $separator . $elementContent;
+ }
+ }
+}
diff --git a/library/vendor/Zend/Form/Decorator/FormErrors.php b/library/vendor/Zend/Form/Decorator/FormErrors.php
new file mode 100644
index 0000000..70c9353
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/FormErrors.php
@@ -0,0 +1,514 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Decorator_Abstract */
+
+/**
+ * Zend_Form_Decorator_FormErrors
+ *
+ * Displays all form errors in one view.
+ *
+ * Any options passed will be used as HTML attributes of the ul tag for the errors.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Decorator_FormErrors extends Zend_Form_Decorator_Abstract
+{
+ /**
+ * Default values for markup options
+ * @var array
+ */
+ protected $_defaults = array(
+ 'ignoreSubForms' => false,
+ 'showCustomFormErrors' => true,
+ 'onlyCustomFormErrors' => false,
+ 'markupElementLabelEnd' => '</b>',
+ 'markupElementLabelStart' => '<b>',
+ 'markupListEnd' => '</ul>',
+ 'markupListItemEnd' => '</li>',
+ 'markupListItemStart' => '<li>',
+ 'markupListStart' => '<ul class="form-errors">',
+ );
+
+ /**#@+
+ * Markup options
+ * @var string
+ */
+ protected $_ignoreSubForms;
+ protected $_showCustomFormErrors;
+ protected $_onlyCustomFormErrors;
+ protected $_markupElementLabelEnd;
+ protected $_markupElementLabelStart;
+ protected $_markupListEnd;
+ protected $_markupListItemEnd;
+ protected $_markupListItemStart;
+ protected $_markupListStart;
+ /**#@-*/
+
+ /**
+ * Whether or not to escape error label and error message
+ * @var bool
+ */
+ protected $_escape;
+
+ /**
+ * Render errors
+ *
+ * @param string $content
+ * @return string
+ */
+ public function render($content)
+ {
+ $form = $this->getElement();
+ if (!$form instanceof Zend_Form) {
+ return $content;
+ }
+
+ $view = $form->getView();
+ if (null === $view) {
+ return $content;
+ }
+
+ $this->initOptions();
+ $markup = $this->_recurseForm($form, $view);
+
+ if (empty($markup)) {
+ return $content;
+ }
+
+ $markup = $this->getMarkupListStart()
+ . $markup
+ . $this->getMarkupListEnd();
+
+ switch ($this->getPlacement()) {
+ case self::APPEND:
+ return $content . $this->getSeparator() . $markup;
+ case self::PREPEND:
+ return $markup . $this->getSeparator() . $content;
+ }
+ }
+
+ /**
+ * Initialize options
+ *
+ * @return void
+ */
+ public function initOptions()
+ {
+ $this->getMarkupElementLabelEnd();
+ $this->getMarkupElementLabelStart();
+ $this->getMarkupListEnd();
+ $this->getMarkupListItemEnd();
+ $this->getMarkupListItemStart();
+ $this->getMarkupListStart();
+ $this->getPlacement();
+ $this->getSeparator();
+ $this->ignoreSubForms();
+ $this->getShowCustomFormErrors();
+ $this->getOnlyCustomFormErrors();
+ }
+
+ /**
+ * Retrieve markupElementLabelStart
+ *
+ * @return string
+ */
+ public function getMarkupElementLabelStart()
+ {
+ if (null === $this->_markupElementLabelStart) {
+ if (null === ($markupElementLabelStart = $this->getOption('markupElementLabelStart'))) {
+ $this->setMarkupElementLabelStart($this->_defaults['markupElementLabelStart']);
+ } else {
+ $this->setMarkupElementLabelStart($markupElementLabelStart);
+ $this->removeOption('markupElementLabelStart');
+ }
+ }
+
+ return $this->_markupElementLabelStart;
+ }
+
+ /**
+ * Set markupElementLabelStart
+ *
+ * @param string $markupElementLabelStart
+ * @return Zend_Form_Decorator_FormErrors
+ */
+ public function setMarkupElementLabelStart($markupElementLabelStart)
+ {
+ $this->_markupElementLabelStart = $markupElementLabelStart;
+ return $this;
+ }
+
+ /**
+ * Retrieve markupElementLabelEnd
+ *
+ * @return string
+ */
+ public function getMarkupElementLabelEnd()
+ {
+ if (null === $this->_markupElementLabelEnd) {
+ if (null === ($markupElementLabelEnd = $this->getOption('markupElementLabelEnd'))) {
+ $this->setMarkupElementLabelEnd($this->_defaults['markupElementLabelEnd']);
+ } else {
+ $this->setMarkupElementLabelEnd($markupElementLabelEnd);
+ $this->removeOption('markupElementLabelEnd');
+ }
+ }
+
+ return $this->_markupElementLabelEnd;
+ }
+
+ /**
+ * Set markupElementLabelEnd
+ *
+ * @param string $markupElementLabelEnd
+ * @return Zend_Form_Decorator_FormErrors
+ */
+ public function setMarkupElementLabelEnd($markupElementLabelEnd)
+ {
+ $this->_markupElementLabelEnd = $markupElementLabelEnd;
+ return $this;
+ }
+
+ /**
+ * Retrieve markupListStart
+ *
+ * @return string
+ */
+ public function getMarkupListStart()
+ {
+ if (null === $this->_markupListStart) {
+ if (null === ($markupListStart = $this->getOption('markupListStart'))) {
+ $this->setMarkupListStart($this->_defaults['markupListStart']);
+ } else {
+ $this->setMarkupListStart($markupListStart);
+ $this->removeOption('markupListStart');
+ }
+ }
+
+ return $this->_markupListStart;
+ }
+
+ /**
+ * Set markupListStart
+ *
+ * @param string $markupListStart
+ * @return Zend_Form_Decorator_FormErrors
+ */
+ public function setMarkupListStart($markupListStart)
+ {
+ $this->_markupListStart = $markupListStart;
+ return $this;
+ }
+
+ /**
+ * Retrieve markupListEnd
+ *
+ * @return string
+ */
+ public function getMarkupListEnd()
+ {
+ if (null === $this->_markupListEnd) {
+ if (null === ($markupListEnd = $this->getOption('markupListEnd'))) {
+ $this->setMarkupListEnd($this->_defaults['markupListEnd']);
+ } else {
+ $this->setMarkupListEnd($markupListEnd);
+ $this->removeOption('markupListEnd');
+ }
+ }
+
+ return $this->_markupListEnd;
+ }
+
+ /**
+ * Set markupListEnd
+ *
+ * @param string $markupListEnd
+ * @return Zend_Form_Decorator_FormErrors
+ */
+ public function setMarkupListEnd($markupListEnd)
+ {
+ $this->_markupListEnd = $markupListEnd;
+ return $this;
+ }
+
+ /**
+ * Retrieve markupListItemStart
+ *
+ * @return string
+ */
+ public function getMarkupListItemStart()
+ {
+ if (null === $this->_markupListItemStart) {
+ if (null === ($markupListItemStart = $this->getOption('markupListItemStart'))) {
+ $this->setMarkupListItemStart($this->_defaults['markupListItemStart']);
+ } else {
+ $this->setMarkupListItemStart($markupListItemStart);
+ $this->removeOption('markupListItemStart');
+ }
+ }
+
+ return $this->_markupListItemStart;
+ }
+
+ /**
+ * Set markupListItemStart
+ *
+ * @param string $markupListItemStart
+ * @return Zend_Form_Decorator_FormErrors
+ */
+ public function setMarkupListItemStart($markupListItemStart)
+ {
+ $this->_markupListItemStart = $markupListItemStart;
+ return $this;
+ }
+
+ /**
+ * Retrieve markupListItemEnd
+ *
+ * @return string
+ */
+ public function getMarkupListItemEnd()
+ {
+ if (null === $this->_markupListItemEnd) {
+ if (null === ($markupListItemEnd = $this->getOption('markupListItemEnd'))) {
+ $this->setMarkupListItemEnd($this->_defaults['markupListItemEnd']);
+ } else {
+ $this->setMarkupListItemEnd($markupListItemEnd);
+ $this->removeOption('markupListItemEnd');
+ }
+ }
+
+ return $this->_markupListItemEnd;
+ }
+
+ /**
+ * Set markupListItemEnd
+ *
+ * @param string $markupListItemEnd
+ * @return Zend_Form_Decorator_FormErrors
+ */
+ public function setMarkupListItemEnd($markupListItemEnd)
+ {
+ $this->_markupListItemEnd = $markupListItemEnd;
+ return $this;
+ }
+
+ /**
+ * Retrieve ignoreSubForms
+ *
+ * @return bool
+ */
+ public function ignoreSubForms()
+ {
+ if (null === $this->_ignoreSubForms) {
+ if (null === ($ignoreSubForms = $this->getOption('ignoreSubForms'))) {
+ $this->setIgnoreSubForms($this->_defaults['ignoreSubForms']);
+ } else {
+ $this->setIgnoreSubForms($ignoreSubForms);
+ $this->removeOption('ignoreSubForms');
+ }
+ }
+
+ return $this->_ignoreSubForms;
+ }
+
+ /**
+ * Set ignoreSubForms
+ *
+ * @param bool $ignoreSubForms
+ * @return Zend_Form_Decorator_FormErrors
+ */
+ public function setIgnoreSubForms($ignoreSubForms)
+ {
+ $this->_ignoreSubForms = (bool) $ignoreSubForms;
+ return $this;
+ }
+
+ /**
+ * Get showCustomFormErrors
+ *
+ * @return bool
+ */
+ public function getShowCustomFormErrors()
+ {
+ if (null === $this->_showCustomFormErrors) {
+ if (null === ($show = $this->getOption('showCustomFormErrors'))) {
+ $this->setShowCustomFormErrors($this->_defaults['showCustomFormErrors']);
+ } else {
+ $this->setShowCustomFormErrors($show);
+ $this->removeOption('showCustomFormErrors');
+ }
+ }
+ return $this->_showCustomFormErrors;
+ }
+
+ /**
+ * Set showCustomFormErrors
+ *
+ * @param bool $showCustomFormErrors
+ * @return Zend_Form_Decorator_FormErrors
+ */
+ public function setShowCustomFormErrors($showCustomFormErrors)
+ {
+ $this->_showCustomFormErrors = (bool)$showCustomFormErrors;
+ return $this;
+ }
+
+ /**
+ * Get onlyCustomFormErrors
+ *
+ * @return bool
+ */
+ public function getOnlyCustomFormErrors()
+ {
+ if (null === $this->_onlyCustomFormErrors) {
+ if (null === ($show = $this->getOption('onlyCustomFormErrors'))) {
+ $this->setOnlyCustomFormErrors($this->_defaults['onlyCustomFormErrors']);
+ } else {
+ $this->setOnlyCustomFormErrors($show);
+ $this->removeOption('onlyCustomFormErrors');
+ }
+ }
+ return $this->_onlyCustomFormErrors;
+ }
+
+ /**
+ * Set onlyCustomFormErrors, whether to display elements messages
+ * in addition to custom form messages.
+ *
+ * @param bool $onlyCustomFormErrors
+ * @return Zend_Form_Decorator_FormErrors
+ */
+ public function setOnlyCustomFormErrors($onlyCustomFormErrors)
+ {
+ $this->_onlyCustomFormErrors = (bool)$onlyCustomFormErrors;
+ return $this;
+ }
+
+ /**
+ * Set whether or not to escape error label and error message
+ *
+ * Sets also the 'escape' option for the view helper
+ *
+ * @param bool $flag
+ * @return Zend_Form_Decorator_FormErrors
+ */
+ public function setEscape($flag)
+ {
+ $this->_escape = (bool) $flag;
+
+ // Set also option for view helper
+ $this->setOption('escape', $this->_escape);
+ return $this;
+ }
+
+ /**
+ * Get escape flag
+ *
+ * @return bool
+ */
+ public function getEscape()
+ {
+ if (null === $this->_escape) {
+ if (null !== ($escape = $this->getOption('escape'))) {
+ $this->setEscape($escape);
+ } else {
+ $this->setEscape(true);
+ }
+ }
+
+ return $this->_escape;
+ }
+
+ /**
+ * Render element label
+ *
+ * @param Zend_Form_Element $element
+ * @param Zend_View_Interface $view
+ * @return string
+ */
+ public function renderLabel(Zend_Form_Element $element, Zend_View_Interface $view)
+ {
+ $label = $element->getLabel();
+ if (empty($label)) {
+ $label = $element->getName();
+
+ // Translate element name
+ if (null !== ($translator = $element->getTranslator())) {
+ $label = $translator->translate($label);
+ }
+ }
+
+ if ($this->getEscape()) {
+ $label = $view->escape($label);
+ }
+
+ return $this->getMarkupElementLabelStart()
+ . $label
+ . $this->getMarkupElementLabelEnd();
+ }
+
+ /**
+ * Recurse through a form object, rendering errors
+ *
+ * @param Zend_Form $form
+ * @param Zend_View_Interface $view
+ * @return string
+ */
+ protected function _recurseForm(Zend_Form $form, Zend_View_Interface $view)
+ {
+ $content = '';
+
+ $custom = $form->getCustomMessages();
+ if ($this->getShowCustomFormErrors() && count($custom)) {
+ $content .= $this->getMarkupListItemStart()
+ . $view->formErrors($custom, $this->getOptions())
+ . $this->getMarkupListItemEnd();
+ }
+ foreach ($form->getElementsAndSubFormsOrdered() as $subitem) {
+ if ($subitem instanceof Zend_Form_Element && !$this->getOnlyCustomFormErrors()) {
+ $messages = $subitem->getMessages();
+ if (count($messages)) {
+ $subitem->setView($view);
+ $content .= $this->getMarkupListItemStart()
+ . $this->renderLabel($subitem, $view)
+ . $view->formErrors($messages, $this->getOptions())
+ . $this->getMarkupListItemEnd();
+ }
+ } else if ($subitem instanceof Zend_Form && !$this->ignoreSubForms()) {
+ $markup = $this->_recurseForm($subitem, $view);
+
+ if (!empty($markup)) {
+ $content .= $this->getMarkupListStart()
+ . $markup
+ . $this->getMarkupListEnd();
+ }
+ }
+ }
+ return $content;
+ }
+}
diff --git a/library/vendor/Zend/Form/Decorator/HtmlTag.php b/library/vendor/Zend/Form/Decorator/HtmlTag.php
new file mode 100644
index 0000000..47b9e21
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/HtmlTag.php
@@ -0,0 +1,253 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * @see Zend_Form_Decorator_Abstract
+ */
+
+/**
+ * Zend_Form_Decorator_Element_HtmlTag
+ *
+ * Wraps content in an HTML block tag.
+ *
+ * Options accepted are:
+ * - tag: tag to use in decorator
+ * - noAttribs: do not render attributes in the opening tag
+ * - placement: 'append' or 'prepend'. If 'append', renders opening and
+ * closing tag after content; if prepend, renders opening and closing tag
+ * before content.
+ * - openOnly: render opening tag only
+ * - closeOnly: render closing tag only
+ *
+ * Any other options passed are processed as HTML attributes of the tag.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Decorator_HtmlTag extends Zend_Form_Decorator_Abstract
+{
+ /**
+ * Character encoding to use when escaping attributes
+ * @var string
+ */
+ protected $_encoding;
+
+ /**
+ * Placement; default to surround content
+ * @var string
+ */
+ protected $_placement = null;
+
+ /**
+ * HTML tag to use
+ * @var string
+ */
+ protected $_tag;
+
+ /**
+ * @var Zend_Filter
+ */
+ protected $_tagFilter;
+
+ /**
+ * Convert options to tag attributes
+ *
+ * @return string
+ */
+ protected function _htmlAttribs(array $attribs)
+ {
+ $xhtml = '';
+ $enc = $this->_getEncoding();
+ foreach ((array) $attribs as $key => $val) {
+ $key = htmlspecialchars($key, ENT_COMPAT, $enc);
+ if (is_array($val)) {
+ if (array_key_exists('callback', $val)
+ && is_callable($val['callback'])
+ ) {
+ $val = call_user_func($val['callback'], $this);
+ } else {
+ $val = implode(' ', $val);
+ }
+ }
+ $val = htmlspecialchars($val ?? '', ENT_COMPAT, $enc);
+ $xhtml .= " $key=\"$val\"";
+ }
+ return $xhtml;
+ }
+
+ /**
+ * Normalize tag
+ *
+ * Ensures tag is alphanumeric characters only, and all lowercase.
+ *
+ * @param string $tag
+ * @return string
+ */
+ public function normalizeTag($tag)
+ {
+ if (!isset($this->_tagFilter)) {
+ $this->_tagFilter = new Zend_Filter();
+ $this->_tagFilter->addFilter(new Zend_Filter_Alnum())
+ ->addFilter(new Zend_Filter_StringToLower());
+ }
+ return $this->_tagFilter->filter($tag);
+ }
+
+ /**
+ * Set tag to use
+ *
+ * @param string $tag
+ * @return Zend_Form_Decorator_HtmlTag
+ */
+ public function setTag($tag)
+ {
+ $this->_tag = $this->normalizeTag($tag);
+ return $this;
+ }
+
+ /**
+ * Get tag
+ *
+ * If no tag is registered, either via setTag() or as an option, uses 'div'.
+ *
+ * @return string
+ */
+ public function getTag()
+ {
+ if (null === $this->_tag) {
+ if (null === ($tag = $this->getOption('tag'))) {
+ $this->setTag('div');
+ } else {
+ $this->setTag($tag);
+ $this->removeOption('tag');
+ }
+ }
+
+ return $this->_tag;
+ }
+
+ /**
+ * Get the formatted open tag
+ *
+ * @param string $tag
+ * @param array $attribs
+ * @return string
+ */
+ protected function _getOpenTag($tag, array $attribs = null)
+ {
+ $html = '<' . $tag;
+ if (null !== $attribs) {
+ $html .= $this->_htmlAttribs($attribs);
+ }
+ $html .= '>';
+ return $html;
+ }
+
+ /**
+ * Get formatted closing tag
+ *
+ * @param string $tag
+ * @return string
+ */
+ protected function _getCloseTag($tag)
+ {
+ return '</' . $tag . '>';
+ }
+
+ /**
+ * Render content wrapped in an HTML tag
+ *
+ * @param string $content
+ * @return string
+ */
+ public function render($content)
+ {
+ $tag = $this->getTag();
+ $placement = $this->getPlacement();
+ $noAttribs = $this->getOption('noAttribs');
+ $openOnly = $this->getOption('openOnly');
+ $closeOnly = $this->getOption('closeOnly');
+ $this->removeOption('noAttribs');
+ $this->removeOption('openOnly');
+ $this->removeOption('closeOnly');
+
+ $attribs = null;
+ if (!$noAttribs) {
+ $attribs = $this->getOptions();
+ }
+
+ switch ($placement) {
+ case self::APPEND:
+ if ($closeOnly) {
+ return $content . $this->_getCloseTag($tag);
+ }
+ if ($openOnly) {
+ return $content . $this->_getOpenTag($tag, $attribs);
+ }
+ return $content
+ . $this->_getOpenTag($tag, $attribs)
+ . $this->_getCloseTag($tag);
+ case self::PREPEND:
+ if ($closeOnly) {
+ return $this->_getCloseTag($tag) . $content;
+ }
+ if ($openOnly) {
+ return $this->_getOpenTag($tag, $attribs) . $content;
+ }
+ return $this->_getOpenTag($tag, $attribs)
+ . $this->_getCloseTag($tag)
+ . $content;
+ default:
+ return (($openOnly || !$closeOnly) ? $this->_getOpenTag($tag, $attribs) : '')
+ . $content
+ . (($closeOnly || !$openOnly) ? $this->_getCloseTag($tag) : '');
+ }
+ }
+
+ /**
+ * Get encoding for use with htmlspecialchars()
+ *
+ * @return string
+ */
+ protected function _getEncoding()
+ {
+ if (null !== $this->_encoding) {
+ return $this->_encoding;
+ }
+
+ if (null === ($element = $this->getElement())) {
+ $this->_encoding = 'UTF-8';
+ } elseif (null === ($view = $element->getView())) {
+ $this->_encoding = 'UTF-8';
+ } elseif (!$view instanceof Zend_View_Abstract
+ && !method_exists($view, 'getEncoding')
+ ) {
+ $this->_encoding = 'UTF-8';
+ } else {
+ $this->_encoding = $view->getEncoding();
+ }
+ return $this->_encoding;
+ }
+}
diff --git a/library/vendor/Zend/Form/Decorator/Image.php b/library/vendor/Zend/Form/Decorator/Image.php
new file mode 100644
index 0000000..4ec01c1
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/Image.php
@@ -0,0 +1,152 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Decorator_Abstract */
+
+/**
+ * Zend_Form_Decorator_Image
+ *
+ * Accepts the options:
+ * - separator: separator to use between image and content (defaults to PHP_EOL)
+ * - placement: whether to append or prepend label to content (defaults to append)
+ * - tag: if set, used to wrap the label in an additional HTML tag
+ *
+ * Any other options passed will be used as HTML attributes of the image tag.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Decorator_Image extends Zend_Form_Decorator_Abstract
+{
+ /**
+ * Attributes that should not be passed to helper
+ * @var array
+ */
+ protected $_attribBlacklist = array('helper', 'placement', 'separator', 'tag');
+
+ /**
+ * Default placement: append
+ * @var string
+ */
+ protected $_placement = 'APPEND';
+
+ /**
+ * HTML tag with which to surround image
+ * @var string
+ */
+ protected $_tag;
+
+ /**
+ * Set HTML tag with which to surround label
+ *
+ * @param string $tag
+ * @return Zend_Form_Decorator_Image
+ */
+ public function setTag($tag)
+ {
+ $this->_tag = (string) $tag;
+ return $this;
+ }
+
+ /**
+ * Get HTML tag, if any, with which to surround label
+ *
+ * @return void
+ */
+ public function getTag()
+ {
+ if (null === $this->_tag) {
+ $tag = $this->getOption('tag');
+ if (null !== $tag) {
+ $this->removeOption('tag');
+ $this->setTag($tag);
+ }
+ return $tag;
+ }
+
+ return $this->_tag;
+ }
+
+ /**
+ * Get attributes to pass to image helper
+ *
+ * @return array
+ */
+ public function getAttribs()
+ {
+ $attribs = $this->getOptions();
+
+ if (null !== ($element = $this->getElement())) {
+ $attribs['alt'] = $element->getLabel();
+ $attribs = array_merge($attribs, $element->getAttribs());
+ }
+
+ foreach ($this->_attribBlacklist as $key) {
+ if (array_key_exists($key, $attribs)) {
+ unset($attribs[$key]);
+ }
+ }
+
+ return $attribs;
+ }
+
+ /**
+ * Render a form image
+ *
+ * @param string $content
+ * @return string
+ */
+ public function render($content)
+ {
+ $element = $this->getElement();
+ $view = $element->getView();
+ if (null === $view) {
+ return $content;
+ }
+
+ $tag = $this->getTag();
+ $placement = $this->getPlacement();
+ $separator = $this->getSeparator();
+ $name = $element->getFullyQualifiedName();
+ $attribs = $this->getAttribs();
+ $attribs['id'] = $element->getId();
+
+ $image = $view->formImage($name, $element->getImageValue(), $attribs);
+
+ if (null !== $tag) {
+ $decorator = new Zend_Form_Decorator_HtmlTag();
+ $decorator->setOptions(array('tag' => $tag));
+ $image = $decorator->render($image);
+ }
+
+ switch ($placement) {
+ case self::PREPEND:
+ return $image . $separator . $content;
+ case self::APPEND:
+ default:
+ return $content . $separator . $image;
+ }
+ }
+}
diff --git a/library/vendor/Zend/Form/Decorator/Interface.php b/library/vendor/Zend/Form/Decorator/Interface.php
new file mode 100644
index 0000000..5cc1171
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/Interface.php
@@ -0,0 +1,123 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * Zend_Form_Decorator_Interface
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+interface Zend_Form_Decorator_Interface
+{
+ /**
+ * Constructor
+ *
+ * Accept options during initialization.
+ *
+ * @param array|Zend_Config $options
+ * @return void
+ */
+ public function __construct($options = null);
+
+ /**
+ * Set an element to decorate
+ *
+ * While the name is "setElement", a form decorator could decorate either
+ * an element or a form object.
+ *
+ * @param mixed $element
+ * @return Zend_Form_Decorator_Interface
+ */
+ public function setElement($element);
+
+ /**
+ * Retrieve current element
+ *
+ * @return mixed
+ */
+ public function getElement();
+
+ /**
+ * Set decorator options from an array
+ *
+ * @param array $options
+ * @return Zend_Form_Decorator_Interface
+ */
+ public function setOptions(array $options);
+
+ /**
+ * Set decorator options from a config object
+ *
+ * @param Zend_Config $config
+ * @return Zend_Form_Decorator_Interface
+ */
+ public function setConfig(Zend_Config $config);
+
+ /**
+ * Set a single option
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return Zend_Form_Decorator_Interface
+ */
+ public function setOption($key, $value);
+
+ /**
+ * Retrieve a single option
+ *
+ * @param string $key
+ * @return mixed
+ */
+ public function getOption($key);
+
+ /**
+ * Retrieve decorator options
+ *
+ * @return array
+ */
+ public function getOptions();
+
+ /**
+ * Delete a single option
+ *
+ * @param string $key
+ * @return bool
+ */
+ public function removeOption($key);
+
+ /**
+ * Clear all options
+ *
+ * @return Zend_Form_Decorator_Interface
+ */
+ public function clearOptions();
+
+ /**
+ * Render the element
+ *
+ * @param string $content Content to decorate
+ * @return string
+ */
+ public function render($content);
+}
diff --git a/library/vendor/Zend/Form/Decorator/Label.php b/library/vendor/Zend/Form/Decorator/Label.php
new file mode 100644
index 0000000..c70c61e
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/Label.php
@@ -0,0 +1,461 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Decorator_Abstract */
+
+/**
+ * Zend_Form_Decorator_Label
+ *
+ * Accepts the options:
+ * - separator: separator to use between label and content (defaults to PHP_EOL)
+ * - placement: whether to append or prepend label to content (defaults to prepend)
+ * - tag: if set, used to wrap the label in an additional HTML tag
+ * - tagClass: if tag option is set, used to add a class to the label wrapper
+ * - opt(ional)Prefix: a prefix to the label to use when the element is optional
+ * - opt(ional)Suffix: a suffix to the label to use when the element is optional
+ * - req(uired)Prefix: a prefix to the label to use when the element is required
+ * - req(uired)Suffix: a suffix to the label to use when the element is required
+ *
+ * Any other options passed will be used as HTML attributes of the label tag.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Decorator_Label extends Zend_Form_Decorator_Abstract
+{
+ /**
+ * Placement constants
+ */
+ const IMPLICIT = 'IMPLICIT';
+ const IMPLICIT_PREPEND = 'IMPLICIT_PREPEND';
+ const IMPLICIT_APPEND = 'IMPLICIT_APPEND';
+
+ /**
+ * Default placement: prepend
+ * @var string
+ */
+ protected $_placement = 'PREPEND';
+
+ /**
+ * HTML tag with which to surround label
+ * @var string
+ */
+ protected $_tag;
+
+ /**
+ * Class for the HTML tag with which to surround label
+ * @var string
+ */
+ protected $_tagClass;
+
+ /**
+ * Set element ID
+ *
+ * @param string $id
+ * @return Zend_Form_Decorator_Label
+ */
+ public function setId($id)
+ {
+ $this->setOption('id', $id);
+ return $this;
+ }
+
+ /**
+ * Retrieve element ID (used in 'for' attribute)
+ *
+ * If none set in decorator, looks first for element 'id' attribute, and
+ * defaults to element name.
+ *
+ * @return string
+ */
+ public function getId()
+ {
+ $id = $this->getOption('id');
+ if (null === $id) {
+ if (null !== ($element = $this->getElement())) {
+ $id = $element->getId();
+ $this->setId($id);
+ }
+ }
+
+ return $id;
+ }
+
+ /**
+ * Set HTML tag with which to surround label
+ *
+ * @param string $tag
+ * @return Zend_Form_Decorator_Label
+ */
+ public function setTag($tag)
+ {
+ if (empty($tag)) {
+ $this->_tag = null;
+ } else {
+ $this->_tag = (string) $tag;
+ }
+
+ $this->removeOption('tag');
+
+ return $this;
+ }
+
+ /**
+ * Get HTML tag, if any, with which to surround label
+ *
+ * @return string
+ */
+ public function getTag()
+ {
+ if (null === $this->_tag) {
+ $tag = $this->getOption('tag');
+ if (null !== $tag) {
+ $this->removeOption('tag');
+ $this->setTag($tag);
+ }
+ return $tag;
+ }
+
+ return $this->_tag;
+ }
+
+ /**
+ * Set the class to apply to the HTML tag with which to surround label
+ *
+ * @param string $tagClass
+ * @return Zend_Form_Decorator_Label
+ */
+ public function setTagClass($tagClass)
+ {
+ if (empty($tagClass)) {
+ $this->_tagClass = null;
+ } else {
+ $this->_tagClass = (string) $tagClass;
+ }
+
+ $this->removeOption('tagClass');
+
+ return $this;
+ }
+
+ /**
+ * Get the class to apply to the HTML tag, if any, with which to surround label
+ *
+ * @return void
+ */
+ public function getTagClass()
+ {
+ if (null === $this->_tagClass) {
+ $tagClass = $this->getOption('tagClass');
+ if (null !== $tagClass) {
+ $this->removeOption('tagClass');
+ $this->setTagClass($tagClass);
+ }
+ }
+
+ return $this->_tagClass;
+ }
+
+ /**
+ * Get class with which to define label
+ *
+ * Appends either 'optional' or 'required' to class, depending on whether
+ * or not the element is required.
+ *
+ * @return string
+ */
+ public function getClass()
+ {
+ $class = '';
+ $element = $this->getElement();
+
+ $decoratorClass = $this->getOption('class');
+ if (!empty($decoratorClass)) {
+ $class .= ' ' . $decoratorClass;
+ }
+
+ $type = $element->isRequired() ? 'required' : 'optional';
+
+ if (!strstr($class, $type)) {
+ $class .= ' ' . $type;
+ $class = trim($class);
+ }
+
+ return $class;
+ }
+
+ /**
+ * Load an optional/required suffix/prefix key
+ *
+ * @param string $key
+ * @return void
+ */
+ protected function _loadOptReqKey($key)
+ {
+ if (!isset($this->$key)) {
+ $value = $this->getOption($key);
+ $this->$key = (string) $value;
+ if (null !== $value) {
+ $this->removeOption($key);
+ }
+ }
+ }
+
+ /**
+ * Overloading
+ *
+ * Currently overloads:
+ *
+ * - getOpt(ional)Prefix()
+ * - getOpt(ional)Suffix()
+ * - getReq(uired)Prefix()
+ * - getReq(uired)Suffix()
+ * - setOpt(ional)Prefix()
+ * - setOpt(ional)Suffix()
+ * - setReq(uired)Prefix()
+ * - setReq(uired)Suffix()
+ *
+ * @param string $method
+ * @param array $args
+ * @return mixed
+ * @throws Zend_Form_Exception for unsupported methods
+ */
+ public function __call($method, $args)
+ {
+ $tail = substr($method, -6);
+ $head = substr($method, 0, 3);
+ if (in_array($head, array('get', 'set'))
+ && (('Prefix' == $tail) || ('Suffix' == $tail))
+ ) {
+ $position = substr($method, -6);
+ $type = strtolower(substr($method, 3, 3));
+ switch ($type) {
+ case 'req':
+ $key = 'required' . $position;
+ break;
+ case 'opt':
+ $key = 'optional' . $position;
+ break;
+ default:
+ throw new Zend_Form_Exception(sprintf('Invalid method "%s" called in Label decorator, and detected as type %s', $method, $type));
+ }
+
+ switch ($head) {
+ case 'set':
+ if (0 === count($args)) {
+ throw new Zend_Form_Exception(sprintf('Method "%s" requires at least one argument; none provided', $method));
+ }
+ $value = array_shift($args);
+ $this->$key = $value;
+ return $this;
+ case 'get':
+ default:
+ if (null === ($element = $this->getElement())) {
+ $this->_loadOptReqKey($key);
+ } elseif (isset($element->$key)) {
+ $this->$key = (string) $element->$key;
+ } else {
+ $this->_loadOptReqKey($key);
+ }
+ return $this->$key;
+ }
+ }
+
+ throw new Zend_Form_Exception(sprintf('Invalid method "%s" called in Label decorator', $method));
+ }
+
+ /**
+ * Get label to render
+ *
+ * @return string
+ */
+ public function getLabel()
+ {
+ if (null === ($element = $this->getElement())) {
+ return '';
+ }
+
+ $label = $element->getLabel();
+ $label = trim($label ?? '');
+
+ if (empty($label)) {
+ return '';
+ }
+
+ $optPrefix = $this->getOptPrefix();
+ $optSuffix = $this->getOptSuffix();
+ $reqPrefix = $this->getReqPrefix();
+ $reqSuffix = $this->getReqSuffix();
+ $separator = $this->getSeparator();
+
+ if (!empty($label)) {
+ if ($element->isRequired()) {
+ $label = $reqPrefix . $label . $reqSuffix;
+ } else {
+ $label = $optPrefix . $label . $optSuffix;
+ }
+ }
+
+ return $label;
+ }
+
+ /**
+ * Determine if label should append, prepend or implicit content
+ *
+ * @return string
+ */
+ public function getPlacement()
+ {
+ $placement = $this->_placement;
+ if (null !== ($placementOpt = $this->getOption('placement'))) {
+ $placementOpt = strtoupper($placementOpt);
+ switch ($placementOpt) {
+ case self::APPEND:
+ case self::PREPEND:
+ case self::IMPLICIT:
+ case self::IMPLICIT_PREPEND:
+ case self::IMPLICIT_APPEND:
+ $placement = $this->_placement = $placementOpt;
+ break;
+ case false:
+ $placement = $this->_placement = null;
+ break;
+ default:
+ break;
+ }
+ $this->removeOption('placement');
+ }
+
+ return $placement;
+ }
+
+ /**
+ * Render a label
+ *
+ * @param string $content
+ * @return string
+ */
+ public function render($content)
+ {
+ $element = $this->getElement();
+ $view = $element->getView();
+ if (null === $view) {
+ return $content;
+ }
+
+ $label = $this->getLabel();
+ $separator = $this->getSeparator();
+ $placement = $this->getPlacement();
+ $tag = $this->getTag();
+ $tagClass = $this->getTagClass();
+ $id = $this->getId();
+ $class = $this->getClass();
+ $options = $this->getOptions();
+
+
+ if (empty($label) && empty($tag)) {
+ return $content;
+ }
+
+ if (!empty($label)) {
+ $options['class'] = $class;
+ $label = trim($label);
+
+ switch ($placement) {
+ case self::IMPLICIT:
+ // Break was intentionally omitted
+
+ case self::IMPLICIT_PREPEND:
+ $options['escape'] = false;
+ $options['disableFor'] = true;
+
+ $label = $view->formLabel(
+ $element->getFullyQualifiedName(),
+ $label . $separator . $content,
+ $options
+ );
+ break;
+
+ case self::IMPLICIT_APPEND:
+ $options['escape'] = false;
+ $options['disableFor'] = true;
+
+ $label = $view->formLabel(
+ $element->getFullyQualifiedName(),
+ $content . $separator . $label,
+ $options
+ );
+ break;
+
+ case self::APPEND:
+ // Break was intentionally omitted
+
+ case self::PREPEND:
+ // Break was intentionally omitted
+
+ default:
+ $label = $view->formLabel(
+ $element->getFullyQualifiedName(),
+ $label,
+ $options
+ );
+ break;
+ }
+ } else {
+ $label = '&#160;';
+ }
+
+ if (null !== $tag) {
+ $decorator = new Zend_Form_Decorator_HtmlTag();
+ if (null !== $this->_tagClass) {
+ $decorator->setOptions(array('tag' => $tag,
+ 'id' => $id . '-label',
+ 'class' => $tagClass));
+ } else {
+ $decorator->setOptions(array('tag' => $tag,
+ 'id' => $id . '-label'));
+ }
+
+ $label = $decorator->render($label);
+ }
+
+ switch ($placement) {
+ case self::APPEND:
+ return $content . $separator . $label;
+
+ case self::PREPEND:
+ return $label . $separator . $content;
+
+ case self::IMPLICIT:
+ // Break was intentionally omitted
+
+ case self::IMPLICIT_PREPEND:
+ // Break was intentionally omitted
+
+ case self::IMPLICIT_APPEND:
+ return $label;
+ }
+ }
+}
diff --git a/library/vendor/Zend/Form/Decorator/Marker/File/Interface.php b/library/vendor/Zend/Form/Decorator/Marker/File/Interface.php
new file mode 100644
index 0000000..40a4fe7
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/Marker/File/Interface.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * Zend_Form_Decorator_Marker_File_Interface
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+interface Zend_Form_Decorator_Marker_File_Interface
+{
+}
diff --git a/library/vendor/Zend/Form/Decorator/PrepareElements.php b/library/vendor/Zend/Form/Decorator/PrepareElements.php
new file mode 100644
index 0000000..52ed93c
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/PrepareElements.php
@@ -0,0 +1,89 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Decorator_FormElements */
+
+/**
+ * Zend_Form_Decorator_PrepareElements
+ *
+ * Render all form elements registered with current form
+ *
+ * Accepts following options:
+ * - separator: Separator to use between elements
+ *
+ * Any other options passed will be used as HTML attributes of the form tag.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Decorator_PrepareElements extends Zend_Form_Decorator_FormElements
+{
+ /**
+ * Render form elements
+ *
+ * @param string $content
+ * @return string
+ */
+ public function render($content)
+ {
+ $form = $this->getElement();
+ if ((!$form instanceof Zend_Form) && (!$form instanceof Zend_Form_DisplayGroup)) {
+ return $content;
+ }
+
+ $this->_recursivelyPrepareForm($form);
+
+ return $content;
+ }
+
+ protected function _recursivelyPrepareForm(Zend_Form $form)
+ {
+ $belongsTo = ($form instanceof Zend_Form) ? $form->getElementsBelongTo() : null;
+ $elementContent = '';
+ $separator = $this->getSeparator();
+ $translator = $form->getTranslator();
+ $view = $form->getView();
+
+ foreach ($form as $item) {
+ $item->setView($view)
+ ->setTranslator($translator);
+ if ($item instanceof Zend_Form_Element) {
+ $item->setBelongsTo($belongsTo);
+ } elseif (!empty($belongsTo) && ($item instanceof Zend_Form)) {
+ if ($item->isArray()) {
+ $name = $this->mergeBelongsTo($belongsTo, $item->getElementsBelongTo());
+ $item->setElementsBelongTo($name, true);
+ } else {
+ $item->setElementsBelongTo($belongsTo, true);
+ }
+ $this->_recursivelyPrepareForm($item);
+ } elseif (!empty($belongsTo) && ($item instanceof Zend_Form_DisplayGroup)) {
+ foreach ($item as $element) {
+ $element->setBelongsTo($belongsTo);
+ }
+ }
+ }
+ }
+}
diff --git a/library/vendor/Zend/Form/Decorator/Tooltip.php b/library/vendor/Zend/Form/Decorator/Tooltip.php
new file mode 100644
index 0000000..2448b61
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/Tooltip.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Decorator_Abstract */
+
+/**
+ * Zend_Form_Decorator_Tooltip
+ *
+ * Will translate the title attribute, if available
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id: Tooltip.php$
+ */
+class Zend_Form_Decorator_Tooltip extends Zend_Form_Decorator_Abstract
+{
+ /**
+ * Translates the title attribute if it is available, if the translator is available
+ * and if the translator is not disable on the element being rendered.
+ *
+ * @param string $content
+ * @return string
+ */
+ public function render($content)
+ {
+ if (null !== ($title = $this->getElement()->getAttrib('title'))) {
+ if (null !== ($translator = $this->getElement()->getTranslator())) {
+ $title = $translator->translate($title);
+ }
+ }
+
+ $this->getElement()->setAttrib('title', $title);
+ return $content;
+ }
+
+}
diff --git a/library/vendor/Zend/Form/Decorator/ViewHelper.php b/library/vendor/Zend/Form/Decorator/ViewHelper.php
new file mode 100644
index 0000000..a0f71af
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/ViewHelper.php
@@ -0,0 +1,266 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Decorator_Abstract */
+
+/**
+ * Zend_Form_Decorator_ViewHelper
+ *
+ * Decorate an element by using a view helper to render it.
+ *
+ * Accepts the following options:
+ * - separator: string with which to separate passed in content and generated content
+ * - placement: whether to append or prepend the generated content to the passed in content
+ * - helper: the name of the view helper to use
+ *
+ * Assumes the view helper accepts three parameters, the name, value, and
+ * optional attributes; these will be provided by the element.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Decorator_ViewHelper extends Zend_Form_Decorator_Abstract
+{
+ /**
+ * Element types that represent buttons
+ * @var array
+ */
+ protected $_buttonTypes = array(
+ 'Zend_Form_Element_Button',
+ 'Zend_Form_Element_Reset',
+ 'Zend_Form_Element_Submit',
+ );
+
+ /**
+ * View helper to use when rendering
+ * @var string
+ */
+ protected $_helper;
+
+ /**
+ * Set view helper to use when rendering
+ *
+ * @param string $helper
+ * @return Zend_Form_Decorator_Element_ViewHelper
+ */
+ public function setHelper($helper)
+ {
+ $this->_helper = (string) $helper;
+ return $this;
+ }
+
+ /**
+ * Retrieve view helper for rendering element
+ *
+ * @return string
+ */
+ public function getHelper()
+ {
+ if (null === $this->_helper) {
+ $options = $this->getOptions();
+ if (isset($options['helper'])) {
+ $this->setHelper($options['helper']);
+ $this->removeOption('helper');
+ } else {
+ $element = $this->getElement();
+ if (null !== $element) {
+ if (null !== ($helper = $element->getAttrib('helper'))) {
+ $this->setHelper($helper);
+ } else {
+ $type = $element->getType();
+ if ($pos = strrpos($type, '_')) {
+ $type = substr($type, $pos + 1);
+ }
+ $this->setHelper('form' . ucfirst($type));
+ }
+ }
+ }
+ }
+
+ return $this->_helper;
+ }
+
+ /**
+ * Get name
+ *
+ * If element is a Zend_Form_Element, will attempt to namespace it if the
+ * element belongs to an array.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ if (null === ($element = $this->getElement())) {
+ return '';
+ }
+
+ $name = $element->getName();
+
+ if (!$element instanceof Zend_Form_Element) {
+ return $name;
+ }
+
+ if (null !== ($belongsTo = $element->getBelongsTo())) {
+ $name = $belongsTo . '['
+ . $name
+ . ']';
+ }
+
+ if ($element->isArray()) {
+ $name .= '[]';
+ }
+
+ return $name;
+ }
+
+ /**
+ * Retrieve element attributes
+ *
+ * Set id to element name and/or array item.
+ *
+ * @return array
+ */
+ public function getElementAttribs()
+ {
+ if (null === ($element = $this->getElement())) {
+ return null;
+ }
+
+ $attribs = $element->getAttribs();
+ if (isset($attribs['helper'])) {
+ unset($attribs['helper']);
+ }
+
+ if (method_exists($element, 'getSeparator')) {
+ if (null !== ($listsep = $element->getSeparator())) {
+ $attribs['listsep'] = $listsep;
+ }
+ }
+
+ if (isset($attribs['id'])) {
+ return $attribs;
+ }
+
+ $id = $element->getName();
+
+ if ($element instanceof Zend_Form_Element) {
+ if (null !== ($belongsTo = $element->getBelongsTo())) {
+ $belongsTo = preg_replace('/\[([^\]]+)\]/', '-$1', $belongsTo);
+ $id = $belongsTo . '-' . $id;
+ }
+ }
+
+ $element->setAttrib('id', $id);
+ $attribs['id'] = $id;
+
+ return $attribs;
+ }
+
+ /**
+ * Get value
+ *
+ * If element type is one of the button types, returns the label.
+ *
+ * @param Zend_Form_Element $element
+ * @return string|null
+ */
+ public function getValue($element)
+ {
+ if (!$element instanceof Zend_Form_Element) {
+ return null;
+ }
+
+ foreach ($this->_buttonTypes as $type) {
+ if ($element instanceof $type) {
+ if (stristr($type, 'button')) {
+ $element->content = $element->getLabel();
+
+ return $element->getValue();
+ }
+ return $element->getLabel();
+ }
+ }
+
+ return $element->getValue();
+ }
+
+ /**
+ * Render an element using a view helper
+ *
+ * Determine view helper from 'viewHelper' option, or, if none set, from
+ * the element type. Then call as
+ * helper($element->getName(), $element->getValue(), $element->getAttribs())
+ *
+ * @param string $content
+ * @return string
+ * @throws Zend_Form_Decorator_Exception if element or view are not registered
+ */
+ public function render($content)
+ {
+ $element = $this->getElement();
+
+ $view = $element->getView();
+ if (null === $view) {
+ throw new Zend_Form_Decorator_Exception('ViewHelper decorator cannot render without a registered view object');
+ }
+
+ if (method_exists($element, 'getMultiOptions')) {
+ $element->getMultiOptions();
+ }
+
+ $helper = $this->getHelper();
+ $separator = $this->getSeparator();
+ $value = $this->getValue($element);
+ $attribs = $this->getElementAttribs();
+ $name = $element->getFullyQualifiedName();
+ $id = $element->getId();
+ $attribs['id'] = $id;
+
+ $helperObject = $view->getHelper($helper);
+ if (method_exists($helperObject, 'setTranslator')) {
+ $helperObject->setTranslator($element->getTranslator());
+ }
+
+ // Check list separator
+ if (isset($attribs['listsep'])
+ && in_array($helper, array('formMultiCheckbox', 'formRadio', 'formSelect'))
+ ) {
+ $listsep = $attribs['listsep'];
+ unset($attribs['listsep']);
+
+ $elementContent = $view->$helper($name, $value, $attribs, $element->options, $listsep);
+ } else {
+ $elementContent = $view->$helper($name, $value, $attribs, $element->options);
+ }
+
+ switch ($this->getPlacement()) {
+ case self::APPEND:
+ return $content . $separator . $elementContent;
+ case self::PREPEND:
+ return $elementContent . $separator . $content;
+ default:
+ return $elementContent;
+ }
+ }
+}
diff --git a/library/vendor/Zend/Form/Decorator/ViewScript.php b/library/vendor/Zend/Form/Decorator/ViewScript.php
new file mode 100644
index 0000000..0a1a5a1
--- /dev/null
+++ b/library/vendor/Zend/Form/Decorator/ViewScript.php
@@ -0,0 +1,190 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Decorator_Abstract */
+
+/**
+ * Zend_Form_Decorator_ViewScript
+ *
+ * Render a view script as a decorator
+ *
+ * Accepts the options:
+ * - separator: separator to use between view script content and provided content (defaults to PHP_EOL)
+ * - placement: whether to append or prepend view script content to provided content (defaults to prepend)
+ * - viewScript: view script to use
+ * - viewModule: module that view script is in (optional)
+ *
+ * The view script is rendered as a partial; the element being decorated is
+ * passed in as the 'element' variable:
+ * <code>
+ * // in view script:
+ * echo $this->element->getLabel();
+ * </code>
+ *
+ * Any options other than separator, placement, viewScript, and viewModule are passed to
+ * the partial as local variables.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Decorator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Decorator_ViewScript extends Zend_Form_Decorator_Abstract
+{
+ /**
+ * Default placement: append
+ * @var string
+ */
+ protected $_placement = 'APPEND';
+
+ /**
+ * View script to render
+ * @var string
+ */
+ protected $_viewScript;
+
+ /**
+ * View script module
+ * @var string
+ */
+ protected $_viewModule;
+
+ /**
+ * Set view script
+ *
+ * @param string $script
+ * @return Zend_Form_Decorator_ViewScript
+ */
+ public function setViewScript($script)
+ {
+ $this->_viewScript = (string) $script;
+ return $this;
+ }
+
+ /**
+ * Get view script
+ *
+ * @return string|null
+ */
+ public function getViewScript()
+ {
+ if (null === $this->_viewScript) {
+ if (null !== ($element = $this->getElement())) {
+ if (null !== ($viewScript = $element->getAttrib('viewScript'))) {
+ $this->setViewScript($viewScript);
+ return $viewScript;
+ }
+ }
+
+ if (null !== ($viewScript = $this->getOption('viewScript'))) {
+ $this->setViewScript($viewScript)
+ ->removeOption('viewScript');
+ }
+ }
+
+ return $this->_viewScript;
+ }
+
+ /**
+ * Set view script module
+ *
+ * @param string $module
+ * @return Zend_Form_Decorator_ViewScript
+ */
+ public function setViewModule($viewModule)
+ {
+ $this->_viewModule = (string) $viewModule;
+ return $this;
+ }
+
+ /**
+ * Get view script module
+ *
+ * @return string|null
+ */
+ public function getViewModule()
+ {
+ if (null === $this->_viewModule) {
+ if (null !== ($element = $this->getElement())) {
+ if (null !== ($viewModule = $element->getAttrib('viewModule'))) {
+ $this->setViewModule($viewModule);
+ return $viewModule;
+ }
+ }
+
+ if (null !== ($viewModule = $this->getOption('viewModule'))) {
+ $this->setViewModule($viewModule)
+ ->removeOption('viewModule');
+ }
+ }
+
+ return $this->_viewModule;
+ }
+
+ /**
+ * Render a view script
+ *
+ * @param string $content
+ * @return string
+ */
+ public function render($content)
+ {
+ $element = $this->getElement();
+ $view = $element->getView();
+ if (null === $view) {
+ return $content;
+ }
+
+ $viewScript = $this->getViewScript();
+ if (empty($viewScript)) {
+ throw new Zend_Form_Exception('No view script registered with ViewScript decorator');
+ }
+
+ $separator = $this->getSeparator();
+ $placement = $this->getPlacement();
+
+ $vars = $this->getOptions();
+ $vars['element'] = $element;
+ $vars['content'] = $content;
+ $vars['decorator'] = $this;
+
+ $viewModule = $this->getViewModule();
+ if (empty($viewModule)) {
+ $renderedContent = $view->partial($viewScript, $vars);
+ } else {
+ $renderedContent = $view->partial($viewScript, $viewModule, $vars);
+ }
+
+ // Get placement again to see if it has changed
+ $placement = $this->getPlacement();
+
+ switch ($placement) {
+ case self::PREPEND:
+ return $renderedContent . $separator . $content;
+ case self::APPEND:
+ return $content . $separator . $renderedContent;
+ default:
+ return $renderedContent;
+ }
+ }
+}
diff --git a/library/vendor/Zend/Form/DisplayGroup.php b/library/vendor/Zend/Form/DisplayGroup.php
new file mode 100644
index 0000000..73a4cde
--- /dev/null
+++ b/library/vendor/Zend/Form/DisplayGroup.php
@@ -0,0 +1,1172 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * Zend_Form_DisplayGroup
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_DisplayGroup implements Iterator,Countable
+{
+ /**
+ * Group attributes
+ * @var array
+ */
+ protected $_attribs = array();
+
+ /**
+ * Display group decorators
+ * @var array
+ */
+ protected $_decorators = array();
+
+ /**
+ * Description
+ * @var string
+ */
+ protected $_description;
+
+ /**
+ * Should we disable loading the default decorators?
+ * @var bool
+ */
+ protected $_disableLoadDefaultDecorators = false;
+
+ /**
+ * Element order
+ * @var array
+ */
+ protected $_elementOrder = array();
+
+ /**
+ * Elements
+ * @var array
+ */
+ protected $_elements = array();
+
+ /**
+ * Form object to which the display group is currently registered
+ *
+ * @var Zend_Form
+ */
+ protected $_form;
+
+ /**
+ * Whether or not a new element has been added to the group
+ * @var bool
+ */
+ protected $_groupUpdated = false;
+
+ /**
+ * Plugin loader for decorators
+ * @var Zend_Loader_PluginLoader
+ */
+ protected $_loader;
+
+ /**
+ * Group name
+ * @var string
+ */
+ protected $_name;
+
+ /**
+ * Group order
+ * @var int
+ */
+ protected $_order;
+
+ /**
+ * @var Zend_Translate
+ */
+ protected $_translator;
+
+ /**
+ * Is translation disabled?
+ * @var bool
+ */
+ protected $_translatorDisabled = false;
+
+ /**
+ * @var Zend_View_Interface
+ */
+ protected $_view;
+
+ /**
+ * Constructor
+ *
+ * @param string $name
+ * @param Zend_Loader_PluginLoader $loader
+ * @param array|Zend_Config $options
+ * @return void
+ */
+ public function __construct($name, Zend_Loader_PluginLoader $loader, $options = null)
+ {
+ $this->setName($name);
+
+ $this->setPluginLoader($loader);
+
+ if (is_array($options)) {
+ $this->setOptions($options);
+ } elseif ($options instanceof Zend_Config) {
+ $this->setConfig($options);
+ }
+
+ // Extensions...
+ $this->init();
+
+ $this->loadDefaultDecorators();
+ }
+
+ /**
+ * Initialize object; used by extending classes
+ *
+ * @return void
+ */
+ public function init()
+ {
+ }
+
+ /**
+ * Set options
+ *
+ * @param array $options
+ * @return Zend_Form_DisplayGroup
+ */
+ public function setOptions(array $options)
+ {
+ $forbidden = array(
+ 'Options', 'Config', 'PluginLoader', 'View',
+ 'Translator', 'Attrib'
+ );
+ foreach ($options as $key => $value) {
+ $normalized = ucfirst($key);
+
+ if (in_array($normalized, $forbidden)) {
+ continue;
+ }
+
+ $method = 'set' . $normalized;
+ if (method_exists($this, $method)) {
+ $this->$method($value);
+ } else {
+ $this->setAttrib($key, $value);
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Set options from config object
+ *
+ * @param Zend_Config $config
+ * @return Zend_Form_DisplayGroup
+ */
+ public function setConfig(Zend_Config $config)
+ {
+ return $this->setOptions($config->toArray());
+ }
+
+ /**
+ * Set group attribute
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return Zend_Form_DisplayGroup
+ */
+ public function setAttrib($key, $value)
+ {
+ $key = (string) $key;
+ $this->_attribs[$key] = $value;
+ return $this;
+ }
+
+ /**
+ * Add multiple form attributes at once
+ *
+ * @param array $attribs
+ * @return Zend_Form_DisplayGroup
+ */
+ public function addAttribs(array $attribs)
+ {
+ foreach ($attribs as $key => $value) {
+ $this->setAttrib($key, $value);
+ }
+ return $this;
+ }
+
+ /**
+ * Set multiple form attributes at once
+ *
+ * Overwrites any previously set attributes.
+ *
+ * @param array $attribs
+ * @return Zend_Form_DisplayGroup
+ */
+ public function setAttribs(array $attribs)
+ {
+ $this->clearAttribs();
+ return $this->addAttribs($attribs);
+ }
+
+ /**
+ * Retrieve a single form attribute
+ *
+ * @param string $key
+ * @return mixed
+ */
+ public function getAttrib($key)
+ {
+ $key = (string) $key;
+ if (!isset($this->_attribs[$key])) {
+ return null;
+ }
+
+ return $this->_attribs[$key];
+ }
+
+ /**
+ * Retrieve all form attributes/metadata
+ *
+ * @return array
+ */
+ public function getAttribs()
+ {
+ return $this->_attribs;
+ }
+
+ /**
+ * Remove attribute
+ *
+ * @param string $key
+ * @return bool
+ */
+ public function removeAttrib($key)
+ {
+ if (array_key_exists($key, $this->_attribs)) {
+ unset($this->_attribs[$key]);
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Clear all form attributes
+ *
+ * @return Zend_Form
+ */
+ public function clearAttribs()
+ {
+ $this->_attribs = array();
+ return $this;
+ }
+
+ /**
+ * Set form object to which the display group is attached
+ *
+ * @param Zend_Form $form
+ * @return Zend_Form_DisplayGroup
+ */
+ public function setForm(Zend_Form $form)
+ {
+ $this->_form = $form;
+
+ // Ensure any elements attached prior to setting the form are now
+ // removed from iteration by the form
+ foreach ($this->getElements() as $element) {
+ $form->removeFromIteration($element->getName());
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get form object to which the group is attached
+ *
+ * @return Zend_Form|null
+ */
+ public function getForm()
+ {
+ return $this->_form;
+ }
+
+ /**
+ * Filter a name to only allow valid variable characters
+ *
+ * @param string $value
+ * @return string
+ */
+ public function filterName($value)
+ {
+ return preg_replace('/[^a-zA-Z0-9_\x7f-\xff]/', '', (string) $value);
+ }
+
+ /**
+ * Set group name
+ *
+ * @param string $name
+ * @return Zend_Form_DisplayGroup
+ */
+ public function setName($name)
+ {
+ $name = $this->filtername($name);
+ if (('0' !== $name) && empty($name)) {
+ throw new Zend_Form_Exception('Invalid name provided; must contain only valid variable characters and be non-empty');
+ }
+
+ $this->_name = $name;
+ return $this;
+ }
+
+ /**
+ * Retrieve group name
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->_name;
+ }
+
+ /**
+ * Get fully qualified name
+ *
+ * Places name as subitem of array and/or appends brackets.
+ *
+ * @return string
+ */
+ public function getFullyQualifiedName()
+ {
+ return $this->getName();
+ }
+
+ /**
+ * Get element id
+ *
+ * @return string
+ */
+ public function getId()
+ {
+ if (isset($this->id)) {
+ return $this->id;
+ }
+
+ $id = $this->getFullyQualifiedName();
+
+ // Bail early if no array notation detected
+ if (!strstr($id, '[')) {
+ return $id;
+ }
+
+ // Strip array notation
+ if ('[]' == substr($id, -2)) {
+ $id = substr($id, 0, strlen($id) - 2);
+ }
+ $id = str_replace('][', '-', $id);
+ $id = str_replace(array(']', '['), '-', $id);
+ $id = trim($id, '-');
+
+ return $id;
+ }
+
+ /**
+ * Set group legend
+ *
+ * @param string $legend
+ * @return Zend_Form_DisplayGroup
+ */
+ public function setLegend($legend)
+ {
+ return $this->setAttrib('legend', (string) $legend);
+ }
+
+ /**
+ * Retrieve group legend
+ *
+ * @return string
+ */
+ public function getLegend()
+ {
+ return $this->getAttrib('legend');
+ }
+
+ /**
+ * Set description
+ *
+ * @param string $value
+ * @return Zend_Form_DisplayGroup
+ */
+ public function setDescription($value)
+ {
+ $this->_description = (string) $value;
+ return $this;
+ }
+
+ /**
+ * Get description
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->_description;
+ }
+
+ /**
+ * Set group order
+ *
+ * @param int $order
+ * @return Zend_Form_Element
+ */
+ public function setOrder($order)
+ {
+ $this->_order = (int) $order;
+ return $this;
+ }
+
+ /**
+ * Retrieve group order
+ *
+ * @return int
+ */
+ public function getOrder()
+ {
+ return $this->_order;
+ }
+
+ // Elements
+
+ /**
+ * Add element to stack
+ *
+ * @param Zend_Form_Element $element
+ * @return Zend_Form_DisplayGroup
+ */
+ public function addElement(Zend_Form_Element $element)
+ {
+ $this->_elements[$element->getName()] = $element;
+ $this->_groupUpdated = true;
+
+ // Display group will now handle display of element
+ if (null !== ($form = $this->getForm())) {
+ $form->removeFromIteration($element->getName());
+ }
+
+ return $this;
+ }
+
+ /**
+ * Add multiple elements at once
+ *
+ * @param array $elements
+ * @return Zend_Form_DisplayGroup
+ * @throws Zend_Form_Exception if any element is not a Zend_Form_Element
+ */
+ public function addElements(array $elements)
+ {
+ foreach ($elements as $element) {
+ if (!$element instanceof Zend_Form_Element) {
+ throw new Zend_Form_Exception('elements passed via array to addElements() must be Zend_Form_Elements only');
+ }
+ $this->addElement($element);
+ }
+ return $this;
+ }
+
+ /**
+ * Set multiple elements at once (overwrites)
+ *
+ * @param array $elements
+ * @return Zend_Form_DisplayGroup
+ */
+ public function setElements(array $elements)
+ {
+ $this->clearElements();
+ return $this->addElements($elements);
+ }
+
+ /**
+ * Retrieve element
+ *
+ * @param string $name
+ * @return Zend_Form_Element|null
+ */
+ public function getElement($name)
+ {
+ $name = (string) $name;
+ if (isset($this->_elements[$name])) {
+ return $this->_elements[$name];
+ }
+
+ return null;
+ }
+
+ /**
+ * Retrieve elements
+ * @return array
+ */
+ public function getElements()
+ {
+ return $this->_elements;
+ }
+
+ /**
+ * Remove a single element
+ *
+ * @param string $name
+ * @return boolean
+ */
+ public function removeElement($name)
+ {
+ $name = (string) $name;
+ if (array_key_exists($name, $this->_elements)) {
+ unset($this->_elements[$name]);
+ $this->_groupUpdated = true;
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Remove all elements
+ *
+ * @return Zend_Form_DisplayGroup
+ */
+ public function clearElements()
+ {
+ $this->_elements = array();
+ $this->_groupUpdated = true;
+ return $this;
+ }
+
+ // Plugin loader (for decorators)
+
+ /**
+ * Set plugin loader
+ *
+ * @param Zend_Loader_PluginLoader $loader
+ * @return Zend_Form_DisplayGroup
+ */
+ public function setPluginLoader(Zend_Loader_PluginLoader $loader)
+ {
+ $this->_loader = $loader;
+ return $this;
+ }
+
+ /**
+ * Retrieve plugin loader
+ *
+ * @return Zend_Loader_PluginLoader
+ */
+ public function getPluginLoader()
+ {
+ return $this->_loader;
+ }
+
+ /**
+ * Add a prefix path for the plugin loader
+ *
+ * @param string $prefix
+ * @param string $path
+ * @return Zend_Form_DisplayGroup
+ */
+ public function addPrefixPath($prefix, $path)
+ {
+ $this->getPluginLoader()->addPrefixPath($prefix, $path);
+ return $this;
+ }
+
+ /**
+ * Add several prefix paths at once
+ *
+ * @param array $spec
+ * @return Zend_Form_DisplayGroup
+ */
+ public function addPrefixPaths(array $spec)
+ {
+ if (isset($spec['prefix']) && isset($spec['path'])) {
+ return $this->addPrefixPath($spec['prefix'], $spec['path']);
+ }
+ foreach ($spec as $prefix => $paths) {
+ if (is_numeric($prefix) && is_array($paths)) {
+ $prefix = null;
+ if (isset($paths['prefix']) && isset($paths['path'])) {
+ $this->addPrefixPath($paths['prefix'], $paths['path']);
+ }
+ } elseif (!is_numeric($prefix)) {
+ if (is_string($paths)) {
+ $this->addPrefixPath($prefix, $paths);
+ } elseif (is_array($paths)) {
+ foreach ($paths as $path) {
+ $this->addPrefixPath($prefix, $path);
+ }
+ }
+ }
+ }
+ return $this;
+ }
+
+ // Decorators
+
+ /**
+ * Set flag to disable loading default decorators
+ *
+ * @param bool $flag
+ * @return Zend_Form_Element
+ */
+ public function setDisableLoadDefaultDecorators($flag)
+ {
+ $this->_disableLoadDefaultDecorators = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Should we load the default decorators?
+ *
+ * @return bool
+ */
+ public function loadDefaultDecoratorsIsDisabled()
+ {
+ return $this->_disableLoadDefaultDecorators;
+ }
+
+ /**
+ * Load default decorators
+ *
+ * @return Zend_Form_DisplayGroup
+ */
+ public function loadDefaultDecorators()
+ {
+ if ($this->loadDefaultDecoratorsIsDisabled()) {
+ return $this;
+ }
+
+ $decorators = $this->getDecorators();
+ if (empty($decorators)) {
+ $this->addDecorator('FormElements')
+ ->addDecorator('HtmlTag', array('tag' => 'dl'))
+ ->addDecorator('Fieldset')
+ ->addDecorator('DtDdWrapper');
+ }
+ return $this;
+ }
+
+ /**
+ * Instantiate a decorator based on class name or class name fragment
+ *
+ * @param string $name
+ * @param null|array $options
+ * @return Zend_Form_Decorator_Interface
+ */
+ protected function _getDecorator($name, $options = null)
+ {
+ $class = $this->getPluginLoader()->load($name);
+ if (null === $options) {
+ $decorator = new $class;
+ } else {
+ $decorator = new $class($options);
+ }
+
+ return $decorator;
+ }
+
+ /**
+ * Add a decorator for rendering the group
+ *
+ * @param string|Zend_Form_Decorator_Interface $decorator
+ * @param array|Zend_Config $options Options with which to initialize decorator
+ * @return Zend_Form_DisplayGroup
+ */
+ public function addDecorator($decorator, $options = null)
+ {
+ if ($decorator instanceof Zend_Form_Decorator_Interface) {
+ $name = get_class($decorator);
+ } elseif (is_string($decorator)) {
+ $name = $decorator;
+ $decorator = array(
+ 'decorator' => $name,
+ 'options' => $options,
+ );
+ } elseif (is_array($decorator)) {
+ foreach ($decorator as $name => $spec) {
+ break;
+ }
+ if (is_numeric($name)) {
+ throw new Zend_Form_Exception('Invalid alias provided to addDecorator; must be alphanumeric string');
+ }
+ if (is_string($spec)) {
+ $decorator = array(
+ 'decorator' => $spec,
+ 'options' => $options,
+ );
+ } elseif ($spec instanceof Zend_Form_Decorator_Interface) {
+ $decorator = $spec;
+ }
+ } else {
+ throw new Zend_Form_Exception('Invalid decorator provided to addDecorator; must be string or Zend_Form_Decorator_Interface');
+ }
+
+ $this->_decorators[$name] = $decorator;
+
+ return $this;
+ }
+
+ /**
+ * Add many decorators at once
+ *
+ * @param array $decorators
+ * @return Zend_Form_DisplayGroup
+ */
+ public function addDecorators(array $decorators)
+ {
+ foreach ($decorators as $decoratorName => $decoratorInfo) {
+ if (is_string($decoratorInfo) ||
+ $decoratorInfo instanceof Zend_Form_Decorator_Interface) {
+ if (!is_numeric($decoratorName)) {
+ $this->addDecorator(array($decoratorName => $decoratorInfo));
+ } else {
+ $this->addDecorator($decoratorInfo);
+ }
+ } elseif (is_array($decoratorInfo)) {
+ $argc = count($decoratorInfo);
+ $options = array();
+ if (isset($decoratorInfo['decorator'])) {
+ $decorator = $decoratorInfo['decorator'];
+ if (isset($decoratorInfo['options'])) {
+ $options = $decoratorInfo['options'];
+ }
+ $this->addDecorator($decorator, $options);
+ } else {
+ switch (true) {
+ case (0 == $argc):
+ break;
+ case (1 <= $argc):
+ $decorator = array_shift($decoratorInfo);
+ case (2 <= $argc):
+ $options = array_shift($decoratorInfo);
+ default:
+ $this->addDecorator($decorator, $options);
+ break;
+ }
+ }
+ } else {
+ throw new Zend_Form_Exception('Invalid decorator passed to addDecorators()');
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Overwrite all decorators
+ *
+ * @param array $decorators
+ * @return Zend_Form_DisplayGroup
+ */
+ public function setDecorators(array $decorators)
+ {
+ $this->clearDecorators();
+ return $this->addDecorators($decorators);
+ }
+
+ /**
+ * Retrieve a registered decorator
+ *
+ * @param string $name
+ * @return false|Zend_Form_Decorator_Abstract
+ */
+ public function getDecorator($name)
+ {
+ if (!isset($this->_decorators[$name])) {
+ $len = strlen($name);
+ foreach ($this->_decorators as $localName => $decorator) {
+ if ($len > strlen($localName)) {
+ continue;
+ }
+
+ if (0 === substr_compare($localName, $name, -$len, $len, true)) {
+ if (is_array($decorator)) {
+ return $this->_loadDecorator($decorator, $localName);
+ }
+ return $decorator;
+ }
+ }
+ return false;
+ }
+
+ if (is_array($this->_decorators[$name])) {
+ return $this->_loadDecorator($this->_decorators[$name], $name);
+ }
+
+ return $this->_decorators[$name];
+ }
+
+ /**
+ * Retrieve all decorators
+ *
+ * @return array
+ */
+ public function getDecorators()
+ {
+ foreach ($this->_decorators as $key => $value) {
+ if (is_array($value)) {
+ $this->_loadDecorator($value, $key);
+ }
+ }
+ return $this->_decorators;
+ }
+
+ /**
+ * Remove a single decorator
+ *
+ * @param string $name
+ * @return bool
+ */
+ public function removeDecorator($name)
+ {
+ $decorator = $this->getDecorator($name);
+ if ($decorator) {
+ if (array_key_exists($name, $this->_decorators)) {
+ unset($this->_decorators[$name]);
+ } else {
+ $class = get_class($decorator);
+ unset($this->_decorators[$class]);
+ }
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Clear all decorators
+ *
+ * @return Zend_Form_DisplayGroup
+ */
+ public function clearDecorators()
+ {
+ $this->_decorators = array();
+ return $this;
+ }
+
+ /**
+ * Set view
+ *
+ * @param Zend_View_Interface $view
+ * @return Zend_Form_DisplayGroup
+ */
+ public function setView(Zend_View_Interface $view = null)
+ {
+ $this->_view = $view;
+ return $this;
+ }
+
+ /**
+ * Retrieve view
+ *
+ * @return Zend_View_Interface
+ */
+ public function getView()
+ {
+ if (null === $this->_view) {
+ $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
+ $this->setView($viewRenderer->view);
+ }
+
+ return $this->_view;
+ }
+
+ /**
+ * Render display group
+ *
+ * @return string
+ */
+ public function render(Zend_View_Interface $view = null)
+ {
+ if (null !== $view) {
+ $this->setView($view);
+ }
+ $content = '';
+ foreach ($this->getDecorators() as $decorator) {
+ $decorator->setElement($this);
+ $content = $decorator->render($content);
+ }
+ return $content;
+ }
+
+ /**
+ * String representation of group
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ try {
+ $return = $this->render();
+ return $return;
+ } catch (Exception $e) {
+ trigger_error($e->getMessage(), E_USER_WARNING);
+ return '';
+ }
+ }
+
+ /**
+ * Set translator object
+ *
+ * @param Zend_Translate|Zend_Translate_Adapter|null $translator
+ * @return Zend_Form_DisplayGroup
+ */
+ public function setTranslator($translator = null)
+ {
+ if ((null === $translator) || ($translator instanceof Zend_Translate_Adapter)) {
+ $this->_translator = $translator;
+ } elseif ($translator instanceof Zend_Translate) {
+ $this->_translator = $translator->getAdapter();
+ } else {
+ throw new Zend_Form_Exception('Invalid translator specified');
+ }
+ return $this;
+ }
+
+ /**
+ * Retrieve translator object
+ *
+ * @return Zend_Translate_Adapter|null
+ */
+ public function getTranslator()
+ {
+ if ($this->translatorIsDisabled()) {
+ return null;
+ }
+
+ if (null === $this->_translator) {
+ return Zend_Form::getDefaultTranslator();
+ }
+
+ return $this->_translator;
+ }
+
+ /**
+ * Does this display group have its own specific translator?
+ *
+ * @return bool
+ */
+ public function hasTranslator()
+ {
+ return (bool) $this->getTranslator();
+ }
+
+ /**
+ * Indicate whether or not translation should be disabled
+ *
+ * @param bool $flag
+ * @return Zend_Form_DisplayGroup
+ */
+ public function setDisableTranslator($flag)
+ {
+ $this->_translatorDisabled = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Is translation disabled?
+ *
+ * @return bool
+ */
+ public function translatorIsDisabled()
+ {
+ return $this->_translatorDisabled;
+ }
+
+ /**
+ * Overloading: allow rendering specific decorators
+ *
+ * Call renderDecoratorName() to render a specific decorator.
+ *
+ * @param string $method
+ * @param array $args
+ * @return string
+ * @throws Zend_Form_Exception for invalid decorator or invalid method call
+ */
+ public function __call($method, $args)
+ {
+ if ('render' == substr($method, 0, 6)) {
+ $decoratorName = substr($method, 6);
+ if (false !== ($decorator = $this->getDecorator($decoratorName))) {
+ $decorator->setElement($this);
+ $seed = '';
+ if (0 < count($args)) {
+ $seed = array_shift($args);
+ }
+ return $decorator->render($seed);
+ }
+
+ throw new Zend_Form_Exception(sprintf('Decorator by name %s does not exist', $decoratorName));
+ }
+
+ throw new Zend_Form_Exception(sprintf('Method %s does not exist', $method));
+ }
+
+ // Interfaces: Iterator, Countable
+
+ /**
+ * Current element
+ *
+ * @return Zend_Form_Element
+ */
+ public function current(): Zend_Form_Element
+ {
+ $this->_sort();
+ current($this->_elementOrder);
+ $key = key($this->_elementOrder);
+ return $this->getElement($key);
+ }
+
+ /**
+ * Current element
+ *
+ * @return string
+ */
+ public function key(): string
+ {
+ $this->_sort();
+ return key($this->_elementOrder);
+ }
+
+ /**
+ * Move pointer to next element
+ *
+ * @return void
+ */
+ public function next(): void
+ {
+ $this->_sort();
+ next($this->_elementOrder);
+ }
+
+ /**
+ * Move pointer to beginning of element loop
+ *
+ * @return void
+ */
+ public function rewind(): void
+ {
+ $this->_sort();
+ reset($this->_elementOrder);
+ }
+
+ /**
+ * Determine if current element/subform/display group is valid
+ *
+ * @return bool
+ */
+ public function valid(): bool
+ {
+ $this->_sort();
+ return (current($this->_elementOrder) !== false);
+ }
+
+ /**
+ * Count of elements/subforms that are iterable
+ *
+ * @return int
+ */
+ public function count(): int
+ {
+ return count($this->_elements);
+ }
+
+ /**
+ * Sort items according to their order
+ *
+ * @return void
+ */
+ protected function _sort()
+ {
+ if ($this->_groupUpdated || !is_array($this->_elementOrder)) {
+ $elementOrder = array();
+ foreach ($this->getElements() as $key => $element) {
+ $elementOrder[$key] = $element->getOrder();
+ }
+
+ $items = array();
+ $index = 0;
+ foreach ($elementOrder as $key => $order) {
+ if (null === $order) {
+ while (array_search($index, $elementOrder, true)) {
+ ++$index;
+ }
+ $items[$index] = $key;
+ ++$index;
+ } else {
+ $items[$order] = $key;
+ }
+ }
+
+ $items = array_flip($items);
+ asort($items);
+ $this->_elementOrder = $items;
+ $this->_groupUpdated = false;
+ }
+ }
+
+ /**
+ * Lazy-load a decorator
+ *
+ * @param array $decorator Decorator type and options
+ * @param mixed $name Decorator name or alias
+ * @return Zend_Form_Decorator_Interface
+ */
+ protected function _loadDecorator(array $decorator, $name)
+ {
+ $sameName = false;
+ if ($name == $decorator['decorator']) {
+ $sameName = true;
+ }
+
+ $instance = $this->_getDecorator($decorator['decorator'], $decorator['options']);
+ if ($sameName) {
+ $newName = get_class($instance);
+ $decoratorNames = array_keys($this->_decorators);
+ $order = array_flip($decoratorNames);
+ $order[$newName] = $order[$name];
+ $decoratorsExchange = array();
+ unset($order[$name]);
+ asort($order);
+ foreach ($order as $key => $index) {
+ if ($key == $newName) {
+ $decoratorsExchange[$key] = $instance;
+ continue;
+ }
+ $decoratorsExchange[$key] = $this->_decorators[$key];
+ }
+ $this->_decorators = $decoratorsExchange;
+ } else {
+ $this->_decorators[$name] = $instance;
+ }
+
+ return $instance;
+ }
+}
diff --git a/library/vendor/Zend/Form/Element.php b/library/vendor/Zend/Form/Element.php
new file mode 100644
index 0000000..6e81ea6
--- /dev/null
+++ b/library/vendor/Zend/Form/Element.php
@@ -0,0 +1,2280 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** @see Zend_Filter */
+
+/** @see Zend_Form */
+
+/** @see Zend_Validate_Interface */
+
+/** @see Zend_Validate_Abstract */
+
+/**
+ * Zend_Form_Element
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Element implements Zend_Validate_Interface
+{
+ /**
+ * Element Constants
+ */
+ const DECORATOR = 'DECORATOR';
+ const FILTER = 'FILTER';
+ const VALIDATE = 'VALIDATE';
+
+ /**
+ * Default view helper to use
+ * @var string
+ */
+ public $helper = 'formText';
+
+ /**
+ * 'Allow empty' flag
+ * @var bool
+ */
+ protected $_allowEmpty = true;
+
+ /**
+ * Flag indicating whether or not to insert NotEmpty validator when element is required
+ * @var bool
+ */
+ protected $_autoInsertNotEmptyValidator = true;
+
+ /**
+ * Array to which element belongs
+ * @var string
+ */
+ protected $_belongsTo;
+
+ /**
+ * Element decorators
+ * @var array
+ */
+ protected $_decorators = array();
+
+ /**
+ * Element description
+ * @var string
+ */
+ protected $_description;
+
+ /**
+ * Should we disable loading the default decorators?
+ * @var bool
+ */
+ protected $_disableLoadDefaultDecorators = false;
+
+ /**
+ * Custom error messages
+ * @var array
+ */
+ protected $_errorMessages = array();
+
+ /**
+ * Validation errors
+ * @var array
+ */
+ protected $_errors = array();
+
+ /**
+ * Separator to use when concatenating aggregate error messages (for
+ * elements having array values)
+ * @var string
+ */
+ protected $_errorMessageSeparator = '; ';
+
+ /**
+ * Element filters
+ * @var array
+ */
+ protected $_filters = array();
+
+ /**
+ * Ignore flag (used when retrieving values at form level)
+ * @var bool
+ */
+ protected $_ignore = false;
+
+ /**
+ * Does the element represent an array?
+ * @var bool
+ */
+ protected $_isArray = false;
+
+ /**
+ * Is the error marked as in an invalid state?
+ * @var bool
+ */
+ protected $_isError = false;
+
+ /**
+ * Has the element been manually marked as invalid?
+ * @var bool
+ */
+ protected $_isErrorForced = false;
+
+ /**
+ * Element label
+ * @var string
+ */
+ protected $_label;
+
+ /**
+ * Plugin loaders for filter and validator chains
+ * @var array
+ */
+ protected $_loaders = array();
+
+ /**
+ * Formatted validation error messages
+ * @var array
+ */
+ protected $_messages = array();
+
+ /**
+ * Element name
+ * @var string
+ */
+ protected $_name;
+
+ /**
+ * Order of element
+ * @var int
+ */
+ protected $_order;
+
+ /**
+ * Required flag
+ * @var bool
+ */
+ protected $_required = false;
+
+ /**
+ * @var Zend_Translate
+ */
+ protected $_translator;
+
+ /**
+ * Is translation disabled?
+ * @var bool
+ */
+ protected $_translatorDisabled = false;
+
+ /**
+ * Element type
+ * @var string
+ */
+ protected $_type;
+
+ /**
+ * Array of initialized validators
+ * @var array Validators
+ */
+ protected $_validators = array();
+
+ /**
+ * Array of un-initialized validators
+ * @var array
+ */
+ protected $_validatorRules = array();
+
+ /**
+ * Element value
+ * @var mixed
+ */
+ protected $_value;
+
+ /**
+ * @var Zend_View_Interface
+ */
+ protected $_view;
+
+ /**
+ * Is a specific decorator being rendered via the magic renderDecorator()?
+ *
+ * This is to allow execution of logic inside the render() methods of child
+ * elements during the magic call while skipping the parent render() method.
+ *
+ * @var bool
+ */
+ protected $_isPartialRendering = false;
+
+ /**
+ * Use one error message for array elements with concatenated values
+ *
+ * @var bool
+ */
+ protected $_concatJustValuesInErrorMessage = false;
+
+ /**
+ * Constructor
+ *
+ * $spec may be:
+ * - string: name of element
+ * - array: options with which to configure element
+ * - Zend_Config: Zend_Config with options for configuring element
+ *
+ * @param string|array|Zend_Config $spec
+ * @param array|Zend_Config $options
+ * @return void
+ * @throws Zend_Form_Exception if no element name after initialization
+ */
+ public function __construct($spec, $options = null)
+ {
+ if (is_string($spec)) {
+ $this->setName($spec);
+ } elseif (is_array($spec)) {
+ $this->setOptions($spec);
+ } elseif ($spec instanceof Zend_Config) {
+ $this->setConfig($spec);
+ }
+
+ if (is_string($spec) && is_array($options)) {
+ $this->setOptions($options);
+ } elseif (is_string($spec) && ($options instanceof Zend_Config)) {
+ $this->setConfig($options);
+ }
+
+ if (null === $this->getName()) {
+ throw new Zend_Form_Exception('Zend_Form_Element requires each element to have a name');
+ }
+
+ /**
+ * Extensions
+ */
+ $this->init();
+
+ /**
+ * Register ViewHelper decorator by default
+ */
+ $this->loadDefaultDecorators();
+ }
+
+ /**
+ * Initialize object; used by extending classes
+ *
+ * @return void
+ */
+ public function init()
+ {
+ }
+
+ /**
+ * Set flag to disable loading default decorators
+ *
+ * @param bool $flag
+ * @return Zend_Form_Element
+ */
+ public function setDisableLoadDefaultDecorators($flag)
+ {
+ $this->_disableLoadDefaultDecorators = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Should we load the default decorators?
+ *
+ * @return bool
+ */
+ public function loadDefaultDecoratorsIsDisabled()
+ {
+ return $this->_disableLoadDefaultDecorators;
+ }
+
+ /**
+ * Load default decorators
+ *
+ * @return Zend_Form_Element
+ */
+ public function loadDefaultDecorators()
+ {
+ if ($this->loadDefaultDecoratorsIsDisabled()) {
+ return $this;
+ }
+
+ $decorators = $this->getDecorators();
+ if (empty($decorators)) {
+ $this->addDecorator('ViewHelper')
+ ->addDecorator('Errors')
+ ->addDecorator('Description', array('tag' => 'p', 'class' => 'description'))
+ ->addDecorator('HtmlTag', array(
+ 'tag' => 'dd',
+ 'id' => array('callback' => array(get_class($this), 'resolveElementId'))
+ ))
+ ->addDecorator('Label', array('tag' => 'dt'));
+ }
+ return $this;
+ }
+
+ /**
+ * Used to resolve and return an element ID
+ *
+ * Passed to the HtmlTag decorator as a callback in order to provide an ID.
+ *
+ * @param Zend_Form_Decorator_Interface $decorator
+ * @return string
+ */
+ public static function resolveElementId(Zend_Form_Decorator_Interface $decorator)
+ {
+ return $decorator->getElement()->getId() . '-element';
+ }
+
+ /**
+ * Set object state from options array
+ *
+ * @param array $options
+ * @return Zend_Form_Element
+ */
+ public function setOptions(array $options)
+ {
+ if (isset($options['prefixPath'])) {
+ $this->addPrefixPaths($options['prefixPath']);
+ unset($options['prefixPath']);
+ }
+
+ if (isset($options['disableTranslator'])) {
+ $this->setDisableTranslator($options['disableTranslator']);
+ unset($options['disableTranslator']);
+ }
+
+ unset($options['options']);
+ unset($options['config']);
+
+ foreach ($options as $key => $value) {
+ $method = 'set' . ucfirst($key);
+
+ if (in_array($method, array('setTranslator', 'setPluginLoader', 'setView'))) {
+ if (!is_object($value)) {
+ continue;
+ }
+ }
+
+ if (method_exists($this, $method)) {
+ // Setter exists; use it
+ $this->$method($value);
+ } else {
+ // Assume it's metadata
+ $this->setAttrib($key, $value);
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Set object state from Zend_Config object
+ *
+ * @param Zend_Config $config
+ * @return Zend_Form_Element
+ */
+ public function setConfig(Zend_Config $config)
+ {
+ return $this->setOptions($config->toArray());
+ }
+
+
+ // Localization:
+
+ /**
+ * Set translator object for localization
+ *
+ * @param Zend_Translate|null $translator
+ * @return Zend_Form_Element
+ */
+ public function setTranslator($translator = null)
+ {
+ if (null === $translator) {
+ $this->_translator = null;
+ } elseif ($translator instanceof Zend_Translate_Adapter) {
+ $this->_translator = $translator;
+ } elseif ($translator instanceof Zend_Translate) {
+ $this->_translator = $translator->getAdapter();
+ } else {
+ throw new Zend_Form_Exception('Invalid translator specified');
+ }
+ return $this;
+ }
+
+ /**
+ * Retrieve localization translator object
+ *
+ * @return Zend_Translate_Adapter|null
+ */
+ public function getTranslator()
+ {
+ if ($this->translatorIsDisabled()) {
+ return null;
+ }
+
+ if (null === $this->_translator) {
+ return Zend_Form::getDefaultTranslator();
+ }
+ return $this->_translator;
+ }
+
+ /**
+ * Does this element have its own specific translator?
+ *
+ * @return bool
+ */
+ public function hasTranslator()
+ {
+ return (bool)$this->_translator;
+ }
+
+ /**
+ * Indicate whether or not translation should be disabled
+ *
+ * @param bool $flag
+ * @return Zend_Form_Element
+ */
+ public function setDisableTranslator($flag)
+ {
+ $this->_translatorDisabled = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Is translation disabled?
+ *
+ * @return bool
+ */
+ public function translatorIsDisabled()
+ {
+ return $this->_translatorDisabled;
+ }
+
+ // Metadata
+
+ /**
+ * Filter a name to only allow valid variable characters
+ *
+ * @param string $value
+ * @param bool $allowBrackets
+ * @return string
+ */
+ public function filterName($value, $allowBrackets = false)
+ {
+ $charset = '^a-zA-Z0-9_\x7f-\xff';
+ if ($allowBrackets) {
+ $charset .= '\[\]';
+ }
+ return preg_replace('/[' . $charset . ']/', '', (string) $value);
+ }
+
+ /**
+ * Set element name
+ *
+ * @param string $name
+ * @return Zend_Form_Element
+ */
+ public function setName($name)
+ {
+ $name = $this->filterName($name);
+ if ('' === $name) {
+ throw new Zend_Form_Exception('Invalid name provided; must contain only valid variable characters and be non-empty');
+ }
+
+ $this->_name = $name;
+ return $this;
+ }
+
+ /**
+ * Return element name
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->_name;
+ }
+
+ /**
+ * Get fully qualified name
+ *
+ * Places name as subitem of array and/or appends brackets.
+ *
+ * @return string
+ */
+ public function getFullyQualifiedName()
+ {
+ $name = $this->getName();
+
+ if (null !== ($belongsTo = $this->getBelongsTo())) {
+ $name = $belongsTo . '[' . $name . ']';
+ }
+
+ if ($this->isArray()) {
+ $name .= '[]';
+ }
+
+ return $name;
+ }
+
+ /**
+ * Get element id
+ *
+ * @return string
+ */
+ public function getId()
+ {
+ if (isset($this->id)) {
+ return $this->id;
+ }
+
+ $id = $this->getFullyQualifiedName();
+
+ // Bail early if no array notation detected
+ if (!strstr($id, '[')) {
+ return $id;
+ }
+
+ // Strip array notation
+ if ('[]' == substr($id, -2)) {
+ $id = substr($id, 0, strlen($id) - 2);
+ }
+ $id = str_replace('][', '-', $id);
+ $id = str_replace(array(']', '['), '-', $id);
+ $id = trim($id, '-');
+
+ return $id;
+ }
+
+ /**
+ * Set element value
+ *
+ * @param mixed $value
+ * @return Zend_Form_Element
+ */
+ public function setValue($value)
+ {
+ $this->_value = $value;
+ return $this;
+ }
+
+ /**
+ * Filter a value
+ *
+ * @param string $value
+ * @param string $key
+ * @return void
+ */
+ protected function _filterValue(&$value, &$key)
+ {
+ foreach ($this->getFilters() as $filter) {
+ $value = $filter->filter($value);
+ }
+ }
+
+ /**
+ * Retrieve filtered element value
+ *
+ * @return mixed
+ */
+ public function getValue()
+ {
+ $valueFiltered = $this->_value;
+
+ if ($this->isArray() && is_array($valueFiltered)) {
+ array_walk_recursive($valueFiltered, function (&$val, $key) {
+ $this->_filterValue($val, $key);
+ });
+ } else {
+ $this->_filterValue($valueFiltered, $valueFiltered);
+ }
+
+ return $valueFiltered;
+ }
+
+ /**
+ * Retrieve unfiltered element value
+ *
+ * @return mixed
+ */
+ public function getUnfilteredValue()
+ {
+ return $this->_value;
+ }
+
+ /**
+ * Set element label
+ *
+ * @param string $label
+ * @return Zend_Form_Element
+ */
+ public function setLabel($label)
+ {
+ $this->_label = (string) $label;
+ return $this;
+ }
+
+ /**
+ * Retrieve element label
+ *
+ * @return string
+ */
+ public function getLabel()
+ {
+ $translator = $this->getTranslator();
+ if (null !== $translator) {
+ return $translator->translate($this->_label);
+ }
+
+ return $this->_label;
+ }
+
+ /**
+ * Set element order
+ *
+ * @param int $order
+ * @return Zend_Form_Element
+ */
+ public function setOrder($order)
+ {
+ $this->_order = (int) $order;
+ return $this;
+ }
+
+ /**
+ * Retrieve element order
+ *
+ * @return int
+ */
+ public function getOrder()
+ {
+ return $this->_order;
+ }
+
+ /**
+ * Set required flag
+ *
+ * @param bool $flag Default value is true
+ * @return Zend_Form_Element
+ */
+ public function setRequired($flag = true)
+ {
+ $this->_required = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Is the element required?
+ *
+ * @return bool
+ */
+ public function isRequired()
+ {
+ return $this->_required;
+ }
+
+ /**
+ * Set flag indicating whether a NotEmpty validator should be inserted when element is required
+ *
+ * @param bool $flag
+ * @return Zend_Form_Element
+ */
+ public function setAutoInsertNotEmptyValidator($flag)
+ {
+ $this->_autoInsertNotEmptyValidator = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Get flag indicating whether a NotEmpty validator should be inserted when element is required
+ *
+ * @return bool
+ */
+ public function autoInsertNotEmptyValidator()
+ {
+ return $this->_autoInsertNotEmptyValidator;
+ }
+
+ /**
+ * Set element description
+ *
+ * @param string $description
+ * @return Zend_Form_Element
+ */
+ public function setDescription($description)
+ {
+ $this->_description = (string) $description;
+ return $this;
+ }
+
+ /**
+ * Retrieve element description
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->_description;
+ }
+
+ /**
+ * Set 'allow empty' flag
+ *
+ * When the allow empty flag is enabled and the required flag is false, the
+ * element will validate with empty values.
+ *
+ * @param bool $flag
+ * @return Zend_Form_Element
+ */
+ public function setAllowEmpty($flag)
+ {
+ $this->_allowEmpty = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Get 'allow empty' flag
+ *
+ * @return bool
+ */
+ public function getAllowEmpty()
+ {
+ return $this->_allowEmpty;
+ }
+
+ /**
+ * Set ignore flag (used when retrieving values at form level)
+ *
+ * @param bool $flag
+ * @return Zend_Form_Element
+ */
+ public function setIgnore($flag)
+ {
+ $this->_ignore = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Get ignore flag (used when retrieving values at form level)
+ *
+ * @return bool
+ */
+ public function getIgnore()
+ {
+ return $this->_ignore;
+ }
+
+ /**
+ * Set flag indicating if element represents an array
+ *
+ * @param bool $flag
+ * @return Zend_Form_Element
+ */
+ public function setIsArray($flag)
+ {
+ $this->_isArray = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Is the element representing an array?
+ *
+ * @return bool
+ */
+ public function isArray()
+ {
+ return $this->_isArray;
+ }
+
+ /**
+ * Set array to which element belongs
+ *
+ * @param string $array
+ * @return Zend_Form_Element
+ */
+ public function setBelongsTo($array)
+ {
+ $array = $this->filterName($array, true);
+ if (!empty($array)) {
+ $this->_belongsTo = $array;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Return array name to which element belongs
+ *
+ * @return string
+ */
+ public function getBelongsTo()
+ {
+ return $this->_belongsTo;
+ }
+
+ /**
+ * Return element type
+ *
+ * @return string
+ */
+ public function getType()
+ {
+ if (null === $this->_type) {
+ $this->_type = get_class($this);
+ }
+
+ return $this->_type;
+ }
+
+ /**
+ * Set element attribute
+ *
+ * @param string $name
+ * @param mixed $value
+ * @return Zend_Form_Element
+ * @throws Zend_Form_Exception for invalid $name values
+ */
+ public function setAttrib($name, $value)
+ {
+ $name = (string) $name;
+ if ('_' == $name[0]) {
+ throw new Zend_Form_Exception(sprintf('Invalid attribute "%s"; must not contain a leading underscore', $name));
+ }
+
+ if (null === $value) {
+ unset($this->$name);
+ } else {
+ $this->$name = $value;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set multiple attributes at once
+ *
+ * @param array $attribs
+ * @return Zend_Form_Element
+ */
+ public function setAttribs(array $attribs)
+ {
+ foreach ($attribs as $key => $value) {
+ $this->setAttrib($key, $value);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Retrieve element attribute
+ *
+ * @param string $name
+ * @return string
+ */
+ public function getAttrib($name)
+ {
+ $name = (string) $name;
+ if (isset($this->$name)) {
+ return $this->$name;
+ }
+
+ return null;
+ }
+
+ /**
+ * Return all attributes
+ *
+ * @return array
+ */
+ public function getAttribs()
+ {
+ $attribs = get_object_vars($this);
+ unset($attribs['helper']);
+ foreach ($attribs as $key => $value) {
+ if ('_' == substr($key, 0, 1)) {
+ unset($attribs[$key]);
+ }
+ }
+
+ return $attribs;
+ }
+
+ /**
+ * Use one error message for array elements with concatenated values
+ *
+ * @param boolean $concatJustValuesInErrorMessage
+ * @return Zend_Form_Element
+ */
+ public function setConcatJustValuesInErrorMessage($concatJustValuesInErrorMessage)
+ {
+ $this->_concatJustValuesInErrorMessage = $concatJustValuesInErrorMessage;
+ return $this;
+ }
+
+ /**
+ * Use one error message for array elements with concatenated values
+ *
+ * @return boolean
+ */
+ public function getConcatJustValuesInErrorMessage()
+ {
+ return $this->_concatJustValuesInErrorMessage;
+ }
+
+ /**
+ * Overloading: retrieve object property
+ *
+ * Prevents access to properties beginning with '_'.
+ *
+ * @param string $key
+ * @return mixed
+ */
+ public function __get($key)
+ {
+ if ('_' == $key[0]) {
+ throw new Zend_Form_Exception(sprintf('Cannot retrieve value for protected/private property "%s"', $key));
+ }
+
+ if (!isset($this->$key)) {
+ return null;
+ }
+
+ return $this->$key;
+ }
+
+ /**
+ * Overloading: set object property
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return voide
+ */
+ public function __set($key, $value)
+ {
+ $this->setAttrib($key, $value);
+ }
+
+ /**
+ * Overloading: allow rendering specific decorators
+ *
+ * Call renderDecoratorName() to render a specific decorator.
+ *
+ * @param string $method
+ * @param array $args
+ * @return string
+ * @throws Zend_Form_Exception for invalid decorator or invalid method call
+ */
+ public function __call($method, $args)
+ {
+ if ('render' == substr($method, 0, 6)) {
+ $this->_isPartialRendering = true;
+ $this->render();
+ $this->_isPartialRendering = false;
+ $decoratorName = substr($method, 6);
+ if (false !== ($decorator = $this->getDecorator($decoratorName))) {
+ $decorator->setElement($this);
+ $seed = '';
+ if (0 < count($args)) {
+ $seed = array_shift($args);
+ }
+ return $decorator->render($seed);
+ }
+
+ throw new Zend_Form_Element_Exception(sprintf('Decorator by name %s does not exist', $decoratorName));
+ }
+
+ throw new Zend_Form_Element_Exception(sprintf('Method %s does not exist', $method));
+ }
+
+ // Loaders
+
+ /**
+ * Set plugin loader to use for validator or filter chain
+ *
+ * @param Zend_Loader_PluginLoader_Interface $loader
+ * @param string $type 'decorator', 'filter', or 'validate'
+ * @return Zend_Form_Element
+ * @throws Zend_Form_Exception on invalid type
+ */
+ public function setPluginLoader(Zend_Loader_PluginLoader_Interface $loader, $type)
+ {
+ $type = strtoupper($type);
+ switch ($type) {
+ case self::DECORATOR:
+ case self::FILTER:
+ case self::VALIDATE:
+ $this->_loaders[$type] = $loader;
+ return $this;
+ default:
+ throw new Zend_Form_Exception(sprintf('Invalid type "%s" provided to setPluginLoader()', $type));
+ }
+ }
+
+ /**
+ * Retrieve plugin loader for validator or filter chain
+ *
+ * Instantiates with default rules if none available for that type. Use
+ * 'decorator', 'filter', or 'validate' for $type.
+ *
+ * @param string $type
+ * @return Zend_Loader_PluginLoader
+ * @throws Zend_Loader_Exception on invalid type.
+ */
+ public function getPluginLoader($type)
+ {
+ $type = strtoupper($type);
+ switch ($type) {
+ case self::FILTER:
+ case self::VALIDATE:
+ $prefixSegment = ucfirst(strtolower($type));
+ $pathSegment = $prefixSegment;
+ case self::DECORATOR:
+ if (!isset($prefixSegment)) {
+ $prefixSegment = 'Form_Decorator';
+ $pathSegment = 'Form/Decorator';
+ }
+ if (!isset($this->_loaders[$type])) {
+ $this->_loaders[$type] = new Zend_Loader_PluginLoader(
+ array('Zend_' . $prefixSegment . '_' => 'Zend/' . $pathSegment . '/')
+ );
+ }
+ return $this->_loaders[$type];
+ default:
+ throw new Zend_Form_Exception(sprintf('Invalid type "%s" provided to getPluginLoader()', $type));
+ }
+ }
+
+ /**
+ * Add prefix path for plugin loader
+ *
+ * If no $type specified, assumes it is a base path for both filters and
+ * validators, and sets each according to the following rules:
+ * - decorators: $prefix = $prefix . '_Decorator'
+ * - filters: $prefix = $prefix . '_Filter'
+ * - validators: $prefix = $prefix . '_Validate'
+ *
+ * Otherwise, the path prefix is set on the appropriate plugin loader.
+ *
+ * @param string $prefix
+ * @param string $path
+ * @param string $type
+ * @return Zend_Form_Element
+ * @throws Zend_Form_Exception for invalid type
+ */
+ public function addPrefixPath($prefix, $path, $type = null)
+ {
+ $type = strtoupper($type);
+ switch ($type) {
+ case self::DECORATOR:
+ case self::FILTER:
+ case self::VALIDATE:
+ $loader = $this->getPluginLoader($type);
+ $loader->addPrefixPath($prefix, $path);
+ return $this;
+ case null:
+ $nsSeparator = (false !== strpos($prefix, '\\'))?'\\':'_';
+ $prefix = rtrim($prefix, $nsSeparator) . $nsSeparator;
+ $path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
+ foreach (array(self::DECORATOR, self::FILTER, self::VALIDATE) as $type) {
+ $cType = ucfirst(strtolower($type));
+ $loader = $this->getPluginLoader($type);
+ $loader->addPrefixPath($prefix . $cType, $path . $cType . DIRECTORY_SEPARATOR);
+ }
+ return $this;
+ default:
+ throw new Zend_Form_Exception(sprintf('Invalid type "%s" provided to getPluginLoader()', $type));
+ }
+ }
+
+ /**
+ * Add many prefix paths at once
+ *
+ * @param array $spec
+ * @return Zend_Form_Element
+ */
+ public function addPrefixPaths(array $spec)
+ {
+ if (isset($spec['prefix']) && isset($spec['path'])) {
+ return $this->addPrefixPath($spec['prefix'], $spec['path']);
+ }
+ foreach ($spec as $type => $paths) {
+ if (is_numeric($type) && is_array($paths)) {
+ $type = null;
+ if (isset($paths['prefix']) && isset($paths['path'])) {
+ if (isset($paths['type'])) {
+ $type = $paths['type'];
+ }
+ $this->addPrefixPath($paths['prefix'], $paths['path'], $type);
+ }
+ } elseif (!is_numeric($type)) {
+ if (!isset($paths['prefix']) || !isset($paths['path'])) {
+ foreach ($paths as $prefix => $spec) {
+ if (is_array($spec)) {
+ foreach ($spec as $path) {
+ if (!is_string($path)) {
+ continue;
+ }
+ $this->addPrefixPath($prefix, $path, $type);
+ }
+ } elseif (is_string($spec)) {
+ $this->addPrefixPath($prefix, $spec, $type);
+ }
+ }
+ } else {
+ $this->addPrefixPath($paths['prefix'], $paths['path'], $type);
+ }
+ }
+ }
+ return $this;
+ }
+
+ // Validation
+
+ /**
+ * Add validator to validation chain
+ *
+ * Note: will overwrite existing validators if they are of the same class.
+ *
+ * @param string|Zend_Validate_Interface $validator
+ * @param bool $breakChainOnFailure
+ * @param array $options
+ * @return Zend_Form_Element
+ * @throws Zend_Form_Exception if invalid validator type
+ */
+ public function addValidator($validator, $breakChainOnFailure = false, $options = array())
+ {
+ if ($validator instanceof Zend_Validate_Interface) {
+ $name = get_class($validator);
+
+ if (!isset($validator->zfBreakChainOnFailure)) {
+ $validator->zfBreakChainOnFailure = $breakChainOnFailure;
+ }
+ } elseif (is_string($validator)) {
+ $name = $validator;
+ $validator = array(
+ 'validator' => $validator,
+ 'breakChainOnFailure' => $breakChainOnFailure,
+ 'options' => $options,
+ );
+ } else {
+ throw new Zend_Form_Exception('Invalid validator provided to addValidator; must be string or Zend_Validate_Interface');
+ }
+
+
+ $this->_validators[$name] = $validator;
+
+ return $this;
+ }
+
+ /**
+ * Add multiple validators
+ *
+ * @param array $validators
+ * @return Zend_Form_Element
+ */
+ public function addValidators(array $validators)
+ {
+ foreach ($validators as $validatorInfo) {
+ if (is_string($validatorInfo)) {
+ $this->addValidator($validatorInfo);
+ } elseif ($validatorInfo instanceof Zend_Validate_Interface) {
+ $this->addValidator($validatorInfo);
+ } elseif (is_array($validatorInfo)) {
+ $argc = count($validatorInfo);
+ $breakChainOnFailure = false;
+ $options = array();
+ if (isset($validatorInfo['validator'])) {
+ $validator = $validatorInfo['validator'];
+ if (isset($validatorInfo['breakChainOnFailure'])) {
+ $breakChainOnFailure = $validatorInfo['breakChainOnFailure'];
+ }
+ if (isset($validatorInfo['options'])) {
+ $options = $validatorInfo['options'];
+ }
+ $this->addValidator($validator, $breakChainOnFailure, $options);
+ } else {
+ switch (true) {
+ case (0 == $argc):
+ break;
+ case (1 <= $argc):
+ $validator = array_shift($validatorInfo);
+ case (2 <= $argc):
+ $breakChainOnFailure = array_shift($validatorInfo);
+ case (3 <= $argc):
+ $options = array_shift($validatorInfo);
+ default:
+ $this->addValidator($validator, $breakChainOnFailure, $options);
+ break;
+ }
+ }
+ } else {
+ throw new Zend_Form_Exception('Invalid validator passed to addValidators()');
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set multiple validators, overwriting previous validators
+ *
+ * @param array $validators
+ * @return Zend_Form_Element
+ */
+ public function setValidators(array $validators)
+ {
+ $this->clearValidators();
+ return $this->addValidators($validators);
+ }
+
+ /**
+ * Retrieve a single validator by name
+ *
+ * @param string $name
+ * @return Zend_Validate_Interface|false False if not found, validator otherwise
+ */
+ public function getValidator($name)
+ {
+ if (!isset($this->_validators[$name])) {
+ $len = strlen($name);
+ foreach ($this->_validators as $localName => $validator) {
+ if ($len > strlen($localName)) {
+ continue;
+ }
+ if (0 === substr_compare($localName, $name, -$len, $len, true)) {
+ if (is_array($validator)) {
+ return $this->_loadValidator($validator);
+ }
+ return $validator;
+ }
+ }
+ return false;
+ }
+
+ if (is_array($this->_validators[$name])) {
+ return $this->_loadValidator($this->_validators[$name]);
+ }
+
+ return $this->_validators[$name];
+ }
+
+ /**
+ * Retrieve all validators
+ *
+ * @return array
+ */
+ public function getValidators()
+ {
+ $validators = array();
+ foreach ($this->_validators as $key => $value) {
+ if ($value instanceof Zend_Validate_Interface) {
+ $validators[$key] = $value;
+ continue;
+ }
+ $validator = $this->_loadValidator($value);
+ $validators[get_class($validator)] = $validator;
+ }
+ return $validators;
+ }
+
+ /**
+ * Remove a single validator by name
+ *
+ * @param string $name
+ * @return bool
+ */
+ public function removeValidator($name)
+ {
+ if (isset($this->_validators[$name])) {
+ unset($this->_validators[$name]);
+ } else {
+ $len = strlen($name);
+ foreach (array_keys($this->_validators) as $validator) {
+ if ($len > strlen($validator)) {
+ continue;
+ }
+ if (0 === substr_compare($validator, $name, -$len, $len, true)) {
+ unset($this->_validators[$validator]);
+ break;
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Clear all validators
+ *
+ * @return Zend_Form_Element
+ */
+ public function clearValidators()
+ {
+ $this->_validators = array();
+ return $this;
+ }
+
+ /**
+ * Validate element value
+ *
+ * If a translation adapter is registered, any error messages will be
+ * translated according to the current locale, using the given error code;
+ * if no matching translation is found, the original message will be
+ * utilized.
+ *
+ * Note: The *filtered* value is validated.
+ *
+ * @param mixed $value
+ * @param mixed $context
+ * @return boolean
+ */
+ public function isValid($value, $context = null)
+ {
+ $this->setValue($value);
+ $value = $this->getValue();
+
+ if ((('' === $value) || (null === $value))
+ && !$this->isRequired()
+ && $this->getAllowEmpty()
+ ) {
+ return true;
+ }
+
+ if ($this->isRequired()
+ && $this->autoInsertNotEmptyValidator()
+ && !$this->getValidator('NotEmpty'))
+ {
+ $validators = $this->getValidators();
+ $notEmpty = array('validator' => 'NotEmpty', 'breakChainOnFailure' => true);
+ array_unshift($validators, $notEmpty);
+ $this->setValidators($validators);
+ }
+
+ // Find the correct translator. Zend_Validate_Abstract::getDefaultTranslator()
+ // will get either the static translator attached to Zend_Validate_Abstract
+ // or the 'Zend_Translate' from Zend_Registry.
+ if (Zend_Validate_Abstract::hasDefaultTranslator() &&
+ !Zend_Form::hasDefaultTranslator())
+ {
+ $translator = Zend_Validate_Abstract::getDefaultTranslator();
+ if ($this->hasTranslator()) {
+ // only pick up this element's translator if it was attached directly.
+ $translator = $this->getTranslator();
+ }
+ } else {
+ $translator = $this->getTranslator();
+ }
+
+ $this->_messages = array();
+ $this->_errors = array();
+ $result = true;
+ $isArray = $this->isArray();
+ foreach ($this->getValidators() as $key => $validator) {
+ if (method_exists($validator, 'setTranslator')) {
+ if (method_exists($validator, 'hasTranslator')) {
+ if (!$validator->hasTranslator()) {
+ $validator->setTranslator($translator);
+ }
+ } else {
+ $validator->setTranslator($translator);
+ }
+ }
+
+ if (method_exists($validator, 'setDisableTranslator')) {
+ $validator->setDisableTranslator($this->translatorIsDisabled());
+ }
+
+ if ($isArray && is_array($value)) {
+ $messages = array();
+ $errors = array();
+ if (empty($value)) {
+ if ($this->isRequired()
+ || (!$this->isRequired() && !$this->getAllowEmpty())
+ ) {
+ $value = '';
+ }
+ }
+ foreach ((array)$value as $val) {
+ if (!$validator->isValid($val, $context)) {
+ $result = false;
+ if ($this->_hasErrorMessages()) {
+ $messages = $this->_getErrorMessages();
+ $errors = $messages;
+ } else {
+ $messages = array_merge($messages, $validator->getMessages());
+ $errors = array_merge($errors, $validator->getErrors());
+ }
+ }
+ }
+ if ($result) {
+ continue;
+ }
+ } elseif ($validator->isValid($value, $context)) {
+ continue;
+ } else {
+ $result = false;
+ if ($this->_hasErrorMessages()) {
+ $messages = $this->_getErrorMessages();
+ $errors = $messages;
+ } else {
+ $messages = $validator->getMessages();
+ $errors = array_keys($messages);
+ }
+ }
+
+ $result = false;
+ $this->_messages = array_merge($this->_messages, $messages);
+ $this->_errors = array_merge($this->_errors, $errors);
+
+ if ($validator->zfBreakChainOnFailure) {
+ break;
+ }
+ }
+
+ // If element manually flagged as invalid, return false
+ if ($this->_isErrorForced) {
+ return false;
+ }
+
+ return $result;
+ }
+
+ /**
+ * Add a custom error message to return in the event of failed validation
+ *
+ * @param string $message
+ * @return Zend_Form_Element
+ */
+ public function addErrorMessage($message)
+ {
+ $this->_errorMessages[] = (string) $message;
+ return $this;
+ }
+
+ /**
+ * Add multiple custom error messages to return in the event of failed validation
+ *
+ * @param array $messages
+ * @return Zend_Form_Element
+ */
+ public function addErrorMessages(array $messages)
+ {
+ foreach ($messages as $message) {
+ $this->addErrorMessage($message);
+ }
+ return $this;
+ }
+
+ /**
+ * Same as addErrorMessages(), but clears custom error message stack first
+ *
+ * @param array $messages
+ * @return Zend_Form_Element
+ */
+ public function setErrorMessages(array $messages)
+ {
+ $this->clearErrorMessages();
+ return $this->addErrorMessages($messages);
+ }
+
+ /**
+ * Retrieve custom error messages
+ *
+ * @return array
+ */
+ public function getErrorMessages()
+ {
+ return $this->_errorMessages;
+ }
+
+ /**
+ * Clear custom error messages stack
+ *
+ * @return Zend_Form_Element
+ */
+ public function clearErrorMessages()
+ {
+ $this->_errorMessages = array();
+ return $this;
+ }
+
+ /**
+ * Get errorMessageSeparator
+ *
+ * @return string
+ */
+ public function getErrorMessageSeparator()
+ {
+ return $this->_errorMessageSeparator;
+ }
+
+ /**
+ * Set errorMessageSeparator
+ *
+ * @param string $separator
+ * @return Zend_Form_Element
+ */
+ public function setErrorMessageSeparator($separator)
+ {
+ $this->_errorMessageSeparator = $separator;
+ return $this;
+ }
+
+ /**
+ * Mark the element as being in a failed validation state
+ *
+ * @return Zend_Form_Element
+ */
+ public function markAsError()
+ {
+ $messages = $this->getMessages();
+ $customMessages = $this->_getErrorMessages();
+ $messages = $messages + $customMessages;
+ if (empty($messages)) {
+ $this->_isError = true;
+ } else {
+ $this->_messages = $messages;
+ }
+ $this->_isErrorForced = true;
+ return $this;
+ }
+
+ /**
+ * Add an error message and mark element as failed validation
+ *
+ * @param string $message
+ * @return Zend_Form_Element
+ */
+ public function addError($message)
+ {
+ $this->addErrorMessage($message);
+ $this->markAsError();
+ return $this;
+ }
+
+ /**
+ * Add multiple error messages and flag element as failed validation
+ *
+ * @param array $messages
+ * @return Zend_Form_Element
+ */
+ public function addErrors(array $messages)
+ {
+ foreach ($messages as $message) {
+ $this->addError($message);
+ }
+ return $this;
+ }
+
+ /**
+ * Overwrite any previously set error messages and flag as failed validation
+ *
+ * @param array $messages
+ * @return Zend_Form_Element
+ */
+ public function setErrors(array $messages)
+ {
+ $this->clearErrorMessages();
+ return $this->addErrors($messages);
+ }
+
+ /**
+ * Are there errors registered?
+ *
+ * @return bool
+ */
+ public function hasErrors()
+ {
+ return (!empty($this->_messages) || $this->_isError);
+ }
+
+ /**
+ * Retrieve validator chain errors
+ *
+ * @return array
+ */
+ public function getErrors()
+ {
+ return $this->_errors;
+ }
+
+ /**
+ * Retrieve error messages
+ *
+ * @return array
+ */
+ public function getMessages()
+ {
+ return $this->_messages;
+ }
+
+
+ // Filtering
+
+ /**
+ * Add a filter to the element
+ *
+ * @param string|Zend_Filter_Interface $filter
+ * @return Zend_Form_Element
+ */
+ public function addFilter($filter, $options = array())
+ {
+ if ($filter instanceof Zend_Filter_Interface) {
+ $name = get_class($filter);
+ } elseif (is_string($filter)) {
+ $name = $filter;
+ $filter = array(
+ 'filter' => $filter,
+ 'options' => $options,
+ );
+ $this->_filters[$name] = $filter;
+ } else {
+ throw new Zend_Form_Exception('Invalid filter provided to addFilter; must be string or Zend_Filter_Interface');
+ }
+
+ $this->_filters[$name] = $filter;
+
+ return $this;
+ }
+
+ /**
+ * Add filters to element
+ *
+ * @param array $filters
+ * @return Zend_Form_Element
+ */
+ public function addFilters(array $filters)
+ {
+ foreach ($filters as $filterInfo) {
+ if (is_string($filterInfo)) {
+ $this->addFilter($filterInfo);
+ } elseif ($filterInfo instanceof Zend_Filter_Interface) {
+ $this->addFilter($filterInfo);
+ } elseif (is_array($filterInfo)) {
+ $argc = count($filterInfo);
+ $options = array();
+ if (isset($filterInfo['filter'])) {
+ $filter = $filterInfo['filter'];
+ if (isset($filterInfo['options'])) {
+ $options = $filterInfo['options'];
+ }
+ $this->addFilter($filter, $options);
+ } else {
+ switch (true) {
+ case (0 == $argc):
+ break;
+ case (1 <= $argc):
+ $filter = array_shift($filterInfo);
+ case (2 <= $argc):
+ $options = array_shift($filterInfo);
+ default:
+ $this->addFilter($filter, $options);
+ break;
+ }
+ }
+ } else {
+ throw new Zend_Form_Exception('Invalid filter passed to addFilters()');
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Add filters to element, overwriting any already existing
+ *
+ * @param array $filters
+ * @return Zend_Form_Element
+ */
+ public function setFilters(array $filters)
+ {
+ $this->clearFilters();
+ return $this->addFilters($filters);
+ }
+
+ /**
+ * Retrieve a single filter by name
+ *
+ * @param string $name
+ * @return Zend_Filter_Interface
+ */
+ public function getFilter($name)
+ {
+ if (!isset($this->_filters[$name])) {
+ $len = strlen($name);
+ foreach ($this->_filters as $localName => $filter) {
+ if ($len > strlen($localName)) {
+ continue;
+ }
+
+ if (0 === substr_compare($localName, $name, -$len, $len, true)) {
+ if (is_array($filter)) {
+ return $this->_loadFilter($filter);
+ }
+ return $filter;
+ }
+ }
+ return false;
+ }
+
+ if (is_array($this->_filters[$name])) {
+ return $this->_loadFilter($this->_filters[$name]);
+ }
+
+ return $this->_filters[$name];
+ }
+
+ /**
+ * Get all filters
+ *
+ * @return array
+ */
+ public function getFilters()
+ {
+ $filters = array();
+ foreach ($this->_filters as $key => $value) {
+ if ($value instanceof Zend_Filter_Interface) {
+ $filters[$key] = $value;
+ continue;
+ }
+ $filter = $this->_loadFilter($value);
+ $filters[get_class($filter)] = $filter;
+ }
+ return $filters;
+ }
+
+ /**
+ * Remove a filter by name
+ *
+ * @param string $name
+ * @return Zend_Form_Element
+ */
+ public function removeFilter($name)
+ {
+ if (isset($this->_filters[$name])) {
+ unset($this->_filters[$name]);
+ } else {
+ $len = strlen($name);
+ foreach (array_keys($this->_filters) as $filter) {
+ if ($len > strlen($filter)) {
+ continue;
+ }
+ if (0 === substr_compare($filter, $name, -$len, $len, true)) {
+ unset($this->_filters[$filter]);
+ break;
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Clear all filters
+ *
+ * @return Zend_Form_Element
+ */
+ public function clearFilters()
+ {
+ $this->_filters = array();
+ return $this;
+ }
+
+ // Rendering
+
+ /**
+ * Set view object
+ *
+ * @param Zend_View_Interface $view
+ * @return Zend_Form_Element
+ */
+ public function setView(Zend_View_Interface $view = null)
+ {
+ $this->_view = $view;
+ return $this;
+ }
+
+ /**
+ * Retrieve view object
+ *
+ * Retrieves from ViewRenderer if none previously set.
+ *
+ * @return null|Zend_View_Interface
+ */
+ public function getView()
+ {
+ if (null === $this->_view) {
+ $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
+ $this->setView($viewRenderer->view);
+ }
+ return $this->_view;
+ }
+
+ /**
+ * Instantiate a decorator based on class name or class name fragment
+ *
+ * @param string $name
+ * @param null|array $options
+ * @return Zend_Form_Decorator_Interface
+ */
+ protected function _getDecorator($name, $options)
+ {
+ $class = $this->getPluginLoader(self::DECORATOR)->load($name);
+ if (null === $options) {
+ $decorator = new $class;
+ } else {
+ $decorator = new $class($options);
+ }
+
+ return $decorator;
+ }
+
+ /**
+ * Add a decorator for rendering the element
+ *
+ * @param string|Zend_Form_Decorator_Interface $decorator
+ * @param array|Zend_Config $options Options with which to initialize decorator
+ * @return Zend_Form_Element
+ */
+ public function addDecorator($decorator, $options = null)
+ {
+ if ($decorator instanceof Zend_Form_Decorator_Interface) {
+ $name = get_class($decorator);
+ } elseif (is_string($decorator)) {
+ $name = $decorator;
+ $decorator = array(
+ 'decorator' => $name,
+ 'options' => $options,
+ );
+ } elseif (is_array($decorator)) {
+ foreach ($decorator as $name => $spec) {
+ break;
+ }
+ if (is_numeric($name)) {
+ throw new Zend_Form_Exception('Invalid alias provided to addDecorator; must be alphanumeric string');
+ }
+ if (is_string($spec)) {
+ $decorator = array(
+ 'decorator' => $spec,
+ 'options' => $options,
+ );
+ } elseif ($spec instanceof Zend_Form_Decorator_Interface) {
+ $decorator = $spec;
+ }
+ } else {
+ throw new Zend_Form_Exception('Invalid decorator provided to addDecorator; must be string or Zend_Form_Decorator_Interface');
+ }
+
+ $this->_decorators[$name] = $decorator;
+
+ return $this;
+ }
+
+ /**
+ * Add many decorators at once
+ *
+ * @param array $decorators
+ * @return Zend_Form_Element
+ */
+ public function addDecorators(array $decorators)
+ {
+ foreach ($decorators as $decoratorName => $decoratorInfo) {
+ if (is_string($decoratorInfo) ||
+ $decoratorInfo instanceof Zend_Form_Decorator_Interface) {
+ if (!is_numeric($decoratorName)) {
+ $this->addDecorator(array($decoratorName => $decoratorInfo));
+ } else {
+ $this->addDecorator($decoratorInfo);
+ }
+ } elseif (is_array($decoratorInfo)) {
+ $argc = count($decoratorInfo);
+ $options = array();
+ if (isset($decoratorInfo['decorator'])) {
+ $decorator = $decoratorInfo['decorator'];
+ if (isset($decoratorInfo['options'])) {
+ $options = $decoratorInfo['options'];
+ }
+ $this->addDecorator($decorator, $options);
+ } else {
+ switch (true) {
+ case (0 == $argc):
+ break;
+ case (1 <= $argc):
+ $decorator = array_shift($decoratorInfo);
+ case (2 <= $argc):
+ $options = array_shift($decoratorInfo);
+ default:
+ $this->addDecorator($decorator, $options);
+ break;
+ }
+ }
+ } else {
+ throw new Zend_Form_Exception('Invalid decorator passed to addDecorators()');
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Overwrite all decorators
+ *
+ * @param array $decorators
+ * @return Zend_Form_Element
+ */
+ public function setDecorators(array $decorators)
+ {
+ $this->clearDecorators();
+ return $this->addDecorators($decorators);
+ }
+
+ /**
+ * Retrieve a registered decorator
+ *
+ * @param string $name
+ * @return false|Zend_Form_Decorator_Abstract
+ */
+ public function getDecorator($name)
+ {
+ if (!isset($this->_decorators[$name])) {
+ $len = strlen($name);
+ foreach ($this->_decorators as $localName => $decorator) {
+ if ($len > strlen($localName)) {
+ continue;
+ }
+
+ if (0 === substr_compare($localName, $name, -$len, $len, true)) {
+ if (is_array($decorator)) {
+ return $this->_loadDecorator($decorator, $localName);
+ }
+ return $decorator;
+ }
+ }
+ return false;
+ }
+
+ if (is_array($this->_decorators[$name])) {
+ return $this->_loadDecorator($this->_decorators[$name], $name);
+ }
+
+ return $this->_decorators[$name];
+ }
+
+ /**
+ * Retrieve all decorators
+ *
+ * @return array
+ */
+ public function getDecorators()
+ {
+ foreach ($this->_decorators as $key => $value) {
+ if (is_array($value)) {
+ $this->_loadDecorator($value, $key);
+ }
+ }
+ return $this->_decorators;
+ }
+
+ /**
+ * Remove a single decorator
+ *
+ * @param string $name
+ * @return Zend_Form_Element
+ */
+ public function removeDecorator($name)
+ {
+ if (isset($this->_decorators[$name])) {
+ unset($this->_decorators[$name]);
+ } else {
+ $len = strlen($name);
+ foreach (array_keys($this->_decorators) as $decorator) {
+ if ($len > strlen($decorator)) {
+ continue;
+ }
+ if (0 === substr_compare($decorator, $name, -$len, $len, true)) {
+ unset($this->_decorators[$decorator]);
+ break;
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Clear all decorators
+ *
+ * @return Zend_Form_Element
+ */
+ public function clearDecorators()
+ {
+ $this->_decorators = array();
+ return $this;
+ }
+
+ /**
+ * Render form element
+ *
+ * @param Zend_View_Interface $view
+ * @return string
+ */
+ public function render(Zend_View_Interface $view = null)
+ {
+ if ($this->_isPartialRendering) {
+ return '';
+ }
+
+ if (null !== $view) {
+ $this->setView($view);
+ }
+
+ $content = '';
+ foreach ($this->getDecorators() as $decorator) {
+ $decorator->setElement($this);
+ $content = $decorator->render($content);
+ }
+ return $content;
+ }
+
+ /**
+ * String representation of form element
+ *
+ * Proxies to {@link render()}.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ try {
+ $return = $this->render();
+ return $return;
+ } catch (Exception $e) {
+ trigger_error($e->getMessage(), E_USER_WARNING);
+ return '';
+ }
+ }
+
+ /**
+ * Lazy-load a filter
+ *
+ * @param array $filter
+ * @return Zend_Filter_Interface
+ */
+ protected function _loadFilter(array $filter)
+ {
+ $origName = $filter['filter'];
+ $name = $this->getPluginLoader(self::FILTER)->load($filter['filter']);
+
+ if (array_key_exists($name, $this->_filters)) {
+ throw new Zend_Form_Exception(sprintf('Filter instance already exists for filter "%s"', $origName));
+ }
+
+ if (empty($filter['options'])) {
+ $instance = new $name;
+ } else {
+ $r = new ReflectionClass($name);
+ if ($r->hasMethod('__construct')) {
+ $instance = $r->newInstanceArgs(array_values((array) $filter['options']));
+ } else {
+ $instance = $r->newInstance();
+ }
+ }
+
+ if ($origName != $name) {
+ $filterNames = array_keys($this->_filters);
+ $order = array_flip($filterNames);
+ $order[$name] = $order[$origName];
+ $filtersExchange = array();
+ unset($order[$origName]);
+ asort($order);
+ foreach ($order as $key => $index) {
+ if ($key == $name) {
+ $filtersExchange[$key] = $instance;
+ continue;
+ }
+ $filtersExchange[$key] = $this->_filters[$key];
+ }
+ $this->_filters = $filtersExchange;
+ } else {
+ $this->_filters[$name] = $instance;
+ }
+
+ return $instance;
+ }
+
+ /**
+ * Lazy-load a validator
+ *
+ * @param array $validator Validator definition
+ * @return Zend_Validate_Interface
+ */
+ protected function _loadValidator(array $validator)
+ {
+ $origName = $validator['validator'];
+ $name = $this->getPluginLoader(self::VALIDATE)->load($validator['validator']);
+
+ if (array_key_exists($name, $this->_validators)) {
+ throw new Zend_Form_Exception(sprintf('Validator instance already exists for validator "%s"', $origName));
+ }
+
+ $messages = false;
+ if (isset($validator['options']) && array_key_exists('messages', (array)$validator['options'])) {
+ $messages = $validator['options']['messages'];
+ unset($validator['options']['messages']);
+ }
+
+ if (empty($validator['options'])) {
+ $instance = new $name;
+ } else {
+ $r = new ReflectionClass($name);
+ if ($r->hasMethod('__construct')) {
+ $numeric = false;
+ if (is_array($validator['options'])) {
+ $keys = array_keys($validator['options']);
+ foreach($keys as $key) {
+ if (is_numeric($key)) {
+ $numeric = true;
+ break;
+ }
+ }
+ }
+
+ if ($numeric) {
+ $instance = $r->newInstanceArgs(array_values((array) $validator['options']));
+ } else {
+ $instance = $r->newInstance($validator['options']);
+ }
+ } else {
+ $instance = $r->newInstance();
+ }
+ }
+
+ if ($messages) {
+ if (is_array($messages)) {
+ $instance->setMessages($messages);
+ } elseif (is_string($messages)) {
+ $instance->setMessage($messages);
+ }
+ }
+ $instance->zfBreakChainOnFailure = $validator['breakChainOnFailure'];
+
+ if ($origName != $name) {
+ $validatorNames = array_keys($this->_validators);
+ $order = array_flip($validatorNames);
+ $order[$name] = $order[$origName];
+ $validatorsExchange = array();
+ unset($order[$origName]);
+ asort($order);
+ foreach ($order as $key => $index) {
+ if ($key == $name) {
+ $validatorsExchange[$key] = $instance;
+ continue;
+ }
+ $validatorsExchange[$key] = $this->_validators[$key];
+ }
+ $this->_validators = $validatorsExchange;
+ } else {
+ $this->_validators[$name] = $instance;
+ }
+
+ return $instance;
+ }
+
+ /**
+ * Lazy-load a decorator
+ *
+ * @param array $decorator Decorator type and options
+ * @param mixed $name Decorator name or alias
+ * @return Zend_Form_Decorator_Interface
+ */
+ protected function _loadDecorator(array $decorator, $name)
+ {
+ $sameName = false;
+ if ($name == $decorator['decorator']) {
+ $sameName = true;
+ }
+
+ $instance = $this->_getDecorator($decorator['decorator'], $decorator['options']);
+ if ($sameName) {
+ $newName = get_class($instance);
+ $decoratorNames = array_keys($this->_decorators);
+ $order = array_flip($decoratorNames);
+ $order[$newName] = $order[$name];
+ $decoratorsExchange = array();
+ unset($order[$name]);
+ asort($order);
+ foreach ($order as $key => $index) {
+ if ($key == $newName) {
+ $decoratorsExchange[$key] = $instance;
+ continue;
+ }
+ $decoratorsExchange[$key] = $this->_decorators[$key];
+ }
+ $this->_decorators = $decoratorsExchange;
+ } else {
+ $this->_decorators[$name] = $instance;
+ }
+
+ return $instance;
+ }
+
+ /**
+ * Retrieve error messages and perform translation and value substitution
+ *
+ * @return array
+ */
+ protected function _getErrorMessages()
+ {
+ $translator = $this->getTranslator();
+ $messages = $this->getErrorMessages();
+ $value = $this->getValue();
+ foreach ($messages as $key => $message) {
+ if (null !== $translator) {
+ $message = $translator->translate($message);
+ }
+ if ($this->isArray() || is_array($value)) {
+ $aggregateMessages = array();
+ foreach ($value as $val) {
+ $aggregateMessages[] = str_replace('%value%', $val, $message);
+ }
+ if (count($aggregateMessages)) {
+ if ($this->_concatJustValuesInErrorMessage) {
+ $values = implode($this->getErrorMessageSeparator(), $value);
+ $messages[$key] = str_replace('%value%', $values, $message);
+ } else {
+ $messages[$key] = implode($this->getErrorMessageSeparator(), $aggregateMessages);
+ }
+ }
+ } else {
+ $messages[$key] = str_replace('%value%', $value, $message);
+ }
+ }
+ return $messages;
+ }
+
+ /**
+ * Are there custom error messages registered?
+ *
+ * @return bool
+ */
+ protected function _hasErrorMessages()
+ {
+ return !empty($this->_errorMessages);
+ }
+}
diff --git a/library/vendor/Zend/Form/Element/Button.php b/library/vendor/Zend/Form/Element/Button.php
new file mode 100644
index 0000000..89de056
--- /dev/null
+++ b/library/vendor/Zend/Form/Element/Button.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Element_Submit */
+
+/**
+ * Button form element
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Element_Button extends Zend_Form_Element_Submit
+{
+ /**
+ * Use formButton view helper by default
+ * @var string
+ */
+ public $helper = 'formButton';
+
+ /**
+ * Validate element value (pseudo)
+ *
+ * There is no need to reset the value
+ *
+ * @param mixed $value Is always ignored
+ * @param mixed $context Is always ignored
+ * @return boolean Returns always TRUE
+ */
+ public function isValid($value, $context = null)
+ {
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Form/Element/Checkbox.php b/library/vendor/Zend/Form/Element/Checkbox.php
new file mode 100644
index 0000000..65cdccc
--- /dev/null
+++ b/library/vendor/Zend/Form/Element/Checkbox.php
@@ -0,0 +1,202 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Element_Xhtml */
+
+/**
+ * Checkbox form element
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Element_Checkbox extends Zend_Form_Element_Xhtml
+{
+ /**
+ * Is the checkbox checked?
+ * @var bool
+ */
+ public $checked = false;
+
+ /**
+ * Use formCheckbox view helper by default
+ * @var string
+ */
+ public $helper = 'formCheckbox';
+
+ /**
+ * Options that will be passed to the view helper
+ * @var array
+ */
+ public $options = array(
+ 'checkedValue' => '1',
+ 'uncheckedValue' => '0',
+ );
+
+ /**
+ * Value when checked
+ * @var string
+ */
+ protected $_checkedValue = '1';
+
+ /**
+ * Value when not checked
+ * @var string
+ */
+ protected $_uncheckedValue = '0';
+
+ /**
+ * Current value
+ * @var string 0 or 1
+ */
+ protected $_value = '0';
+
+ /**
+ * Set options
+ *
+ * Intercept checked and unchecked values and set them early; test stored
+ * value against checked and unchecked values after configuration.
+ *
+ * @param array $options
+ * @return Zend_Form_Element_Checkbox
+ */
+ public function setOptions(array $options)
+ {
+ if (array_key_exists('checkedValue', $options)) {
+ $this->setCheckedValue($options['checkedValue']);
+ unset($options['checkedValue']);
+ }
+ if (array_key_exists('uncheckedValue', $options)) {
+ $this->setUncheckedValue($options['uncheckedValue']);
+ unset($options['uncheckedValue']);
+ }
+ parent::setOptions($options);
+
+ $curValue = $this->getValue();
+ $test = array($this->getCheckedValue(), $this->getUncheckedValue());
+ if (!in_array($curValue, $test)) {
+ $this->setValue($curValue);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set value
+ *
+ * If value matches checked value, sets to that value, and sets the checked
+ * flag to true.
+ *
+ * Any other value causes the unchecked value to be set as the current
+ * value, and the checked flag to be set as false.
+ *
+ *
+ * @param mixed $value
+ * @return Zend_Form_Element_Checkbox
+ */
+ public function setValue($value)
+ {
+ if ($value == $this->getCheckedValue()) {
+ parent::setValue($value);
+ $this->checked = true;
+ } else {
+ parent::setValue($this->getUncheckedValue());
+ $this->checked = false;
+ }
+ return $this;
+ }
+
+ /**
+ * Set checked value
+ *
+ * @param string $value
+ * @return Zend_Form_Element_Checkbox
+ */
+ public function setCheckedValue($value)
+ {
+ $this->_checkedValue = (string) $value;
+ $this->options['checkedValue'] = $value;
+ return $this;
+ }
+
+ /**
+ * Get value when checked
+ *
+ * @return string
+ */
+ public function getCheckedValue()
+ {
+ return $this->_checkedValue;
+ }
+
+ /**
+ * Set unchecked value
+ *
+ * @param string $value
+ * @return Zend_Form_Element_Checkbox
+ */
+ public function setUncheckedValue($value)
+ {
+ $this->_uncheckedValue = (string) $value;
+ $this->options['uncheckedValue'] = $value;
+ return $this;
+ }
+
+ /**
+ * Get value when not checked
+ *
+ * @return string
+ */
+ public function getUncheckedValue()
+ {
+ return $this->_uncheckedValue;
+ }
+
+ /**
+ * Set checked flag
+ *
+ * @param bool $flag
+ * @return Zend_Form_Element_Checkbox
+ */
+ public function setChecked($flag)
+ {
+ $this->checked = (bool) $flag;
+ if ($this->checked) {
+ $this->setValue($this->getCheckedValue());
+ } else {
+ $this->setValue($this->getUncheckedValue());
+ }
+ return $this;
+ }
+
+ /**
+ * Get checked flag
+ *
+ * @return bool
+ */
+ public function isChecked()
+ {
+ return $this->checked;
+ }
+}
diff --git a/library/vendor/Zend/Form/Element/Exception.php b/library/vendor/Zend/Form/Element/Exception.php
new file mode 100644
index 0000000..b39e053
--- /dev/null
+++ b/library/vendor/Zend/Form/Element/Exception.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Exception */
+
+/**
+ * Exception for Zend_Form component.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Form_Element_Exception extends Zend_Form_Exception
+{
+}
diff --git a/library/vendor/Zend/Form/Element/File.php b/library/vendor/Zend/Form/Element/File.php
new file mode 100644
index 0000000..1b336da
--- /dev/null
+++ b/library/vendor/Zend/Form/Element/File.php
@@ -0,0 +1,910 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Element_Xhtml */
+
+/**
+ * Zend_Form_Element
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Element_File extends Zend_Form_Element_Xhtml
+{
+ /**
+ * Plugin loader type
+ */
+ const TRANSFER_ADAPTER = 'TRANSFER_ADAPTER';
+
+ /**
+ * @var string Default view helper
+ */
+ public $helper = 'formFile';
+
+ /**
+ * @var Zend_File_Transfer_Adapter_Abstract
+ */
+ protected $_adapter;
+
+ /**
+ * @var boolean Already validated ?
+ */
+ protected $_validated = false;
+
+ /**
+ * @var boolean Disable value to be equal to file content
+ */
+ protected $_valueDisabled = false;
+
+ /**
+ * @var integer Internal multifile counter
+ */
+ protected $_counter = 1;
+
+ /**
+ * @var integer Maximum file size for MAX_FILE_SIZE attribut of form
+ */
+ protected static $_maxFileSize = -1;
+
+ /**
+ * Load default decorators
+ *
+ * @return Zend_Form_Element_File
+ */
+ public function loadDefaultDecorators()
+ {
+ if ($this->loadDefaultDecoratorsIsDisabled()) {
+ return $this;
+ }
+
+ parent::loadDefaultDecorators();
+
+ // This element needs the File decorator and not the ViewHelper decorator
+ if (false !== $this->getDecorator('ViewHelper')) {
+ $this->removeDecorator('ViewHelper');
+ }
+ if (false === $this->getDecorator('File')) {
+ // Add File decorator to the beginning
+ $decorators = $this->getDecorators();
+ array_unshift($decorators, 'File');
+ $this->setDecorators($decorators);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set plugin loader
+ *
+ * @param Zend_Loader_PluginLoader_Interface $loader
+ * @param string $type
+ * @return Zend_Form_Element_File
+ */
+ public function setPluginLoader(Zend_Loader_PluginLoader_Interface $loader, $type)
+ {
+ $type = strtoupper($type);
+
+ if ($type != self::TRANSFER_ADAPTER) {
+ return parent::setPluginLoader($loader, $type);
+ }
+
+ $this->_loaders[$type] = $loader;
+ return $this;
+ }
+
+ /**
+ * Get Plugin Loader
+ *
+ * @param string $type
+ * @return Zend_Loader_PluginLoader_Interface
+ */
+ public function getPluginLoader($type)
+ {
+ $type = strtoupper($type);
+
+ if ($type != self::TRANSFER_ADAPTER) {
+ return parent::getPluginLoader($type);
+ }
+
+ if (!array_key_exists($type, $this->_loaders)) {
+ $loader = new Zend_Loader_PluginLoader(array(
+ 'Zend_File_Transfer_Adapter' => 'Zend/File/Transfer/Adapter/',
+ ));
+ $this->setPluginLoader($loader, self::TRANSFER_ADAPTER);
+ }
+
+ return $this->_loaders[$type];
+ }
+
+ /**
+ * Add prefix path for plugin loader
+ *
+ * @param string $prefix
+ * @param string $path
+ * @param string $type
+ * @return Zend_Form_Element_File
+ */
+ public function addPrefixPath($prefix, $path, $type = null)
+ {
+ $type = strtoupper($type);
+ if (!empty($type) && ($type != self::TRANSFER_ADAPTER)) {
+ return parent::addPrefixPath($prefix, $path, $type);
+ }
+
+ if (empty($type)) {
+ $nsSeparator = (false !== strpos($prefix, '\\'))?'\\':'_';
+ $pluginPrefix = rtrim($prefix, $nsSeparator) . $nsSeparator . 'Transfer' . $nsSeparator . 'Adapter';
+ $pluginPath = rtrim($path, DIRECTORY_SEPARATOR) . '/Transfer/Adapter/';
+ $loader = $this->getPluginLoader(self::TRANSFER_ADAPTER);
+ $loader->addPrefixPath($pluginPrefix, $pluginPath);
+ return parent::addPrefixPath($prefix, $path, null);
+ }
+
+ $loader = $this->getPluginLoader($type);
+ $loader->addPrefixPath($prefix, $path);
+ return $this;
+ }
+
+ /**
+ * Set transfer adapter
+ *
+ * @param string|Zend_File_Transfer_Adapter_Abstract $adapter
+ * @return Zend_Form_Element_File
+ * @throws Zend_Form_Element_Exception
+ */
+ public function setTransferAdapter($adapter)
+ {
+ if ($adapter instanceof Zend_File_Transfer_Adapter_Abstract) {
+ $this->_adapter = $adapter;
+ } elseif (is_string($adapter)) {
+ $loader = $this->getPluginLoader(self::TRANSFER_ADAPTER);
+ $class = $loader->load($adapter);
+ $this->_adapter = new $class;
+ } else {
+ throw new Zend_Form_Element_Exception('Invalid adapter specified');
+ }
+
+ foreach (array('filter', 'validate') as $type) {
+ $loader = $this->getPluginLoader($type);
+ $this->_adapter->setPluginLoader($loader, $type);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get transfer adapter
+ *
+ * Lazy loads HTTP transfer adapter when no adapter registered.
+ *
+ * @return Zend_File_Transfer_Adapter_Abstract
+ */
+ public function getTransferAdapter()
+ {
+ if (null === $this->_adapter) {
+ $this->setTransferAdapter('Http');
+ }
+ return $this->_adapter;
+ }
+
+ /**
+ * Add Validator; proxy to adapter
+ *
+ * @param string|Zend_Validate_Interface $validator
+ * @param bool $breakChainOnFailure
+ * @param mixed $options
+ * @return Zend_Form_Element_File
+ */
+ public function addValidator($validator, $breakChainOnFailure = false, $options = array())
+ {
+ $adapter = $this->getTransferAdapter();
+ $adapter->addValidator($validator, $breakChainOnFailure, $options, $this->getName());
+ $this->_validated = false;
+
+ return $this;
+ }
+
+ /**
+ * Add multiple validators at once; proxy to adapter
+ *
+ * @param array $validators
+ * @return Zend_Form_Element_File
+ */
+ public function addValidators(array $validators)
+ {
+ $adapter = $this->getTransferAdapter();
+ $adapter->addValidators($validators, $this->getName());
+ $this->_validated = false;
+
+ return $this;
+ }
+
+ /**
+ * Add multiple validators at once, overwriting; proxy to adapter
+ *
+ * @param array $validators
+ * @return Zend_Form_Element_File
+ */
+ public function setValidators(array $validators)
+ {
+ $adapter = $this->getTransferAdapter();
+ $adapter->setValidators($validators, $this->getName());
+ $this->_validated = false;
+
+ return $this;
+ }
+
+ /**
+ * Retrieve validator by name; proxy to adapter
+ *
+ * @param string $name
+ * @return Zend_Validate_Interface|null
+ */
+ public function getValidator($name)
+ {
+ $adapter = $this->getTransferAdapter();
+ return $adapter->getValidator($name);
+ }
+
+ /**
+ * Retrieve all validators; proxy to adapter
+ *
+ * @return array
+ */
+ public function getValidators()
+ {
+ $adapter = $this->getTransferAdapter();
+ $validators = $adapter->getValidators($this->getName());
+ if ($validators === null) {
+ $validators = array();
+ }
+
+ return $validators;
+ }
+
+ /**
+ * Remove validator by name; proxy to adapter
+ *
+ * @param string $name
+ * @return Zend_Form_Element_File
+ */
+ public function removeValidator($name)
+ {
+ $adapter = $this->getTransferAdapter();
+ $adapter->removeValidator($name);
+ $this->_validated = false;
+
+ return $this;
+ }
+
+ /**
+ * Remove all validators; proxy to adapter
+ *
+ * @return Zend_Form_Element_File
+ */
+ public function clearValidators()
+ {
+ $adapter = $this->getTransferAdapter();
+ $adapter->clearValidators();
+ $this->_validated = false;
+
+ return $this;
+ }
+
+ /**
+ * Add Filter; proxy to adapter
+ *
+ * @param string|array $filter Type of filter to add
+ * @param string|array $options Options to set for the filter
+ * @return Zend_Form_Element_File
+ */
+ public function addFilter($filter, $options = null)
+ {
+ $adapter = $this->getTransferAdapter();
+ $adapter->addFilter($filter, $options, $this->getName());
+
+ return $this;
+ }
+
+ /**
+ * Add Multiple filters at once; proxy to adapter
+ *
+ * @param array $filters
+ * @return Zend_Form_Element_File
+ */
+ public function addFilters(array $filters)
+ {
+ $adapter = $this->getTransferAdapter();
+ $adapter->addFilters($filters, $this->getName());
+
+ return $this;
+ }
+
+ /**
+ * Sets a filter for the class, erasing all previous set; proxy to adapter
+ *
+ * @param array $filters Filters to set
+ * @return Zend_Form_Element_File
+ */
+ public function setFilters(array $filters)
+ {
+ $adapter = $this->getTransferAdapter();
+ $adapter->setFilters($filters, $this->getName());
+
+ return $this;
+ }
+
+ /**
+ * Retrieve individual filter; proxy to adapter
+ *
+ * @param string $name
+ * @return Zend_Filter_Interface|null
+ */
+ public function getFilter($name)
+ {
+ $adapter = $this->getTransferAdapter();
+ return $adapter->getFilter($name);
+ }
+
+ /**
+ * Returns all set filters; proxy to adapter
+ *
+ * @return array List of set filters
+ */
+ public function getFilters()
+ {
+ $adapter = $this->getTransferAdapter();
+ $filters = $adapter->getFilters($this->getName());
+
+ if ($filters === null) {
+ $filters = array();
+ }
+ return $filters;
+ }
+
+ /**
+ * Remove an individual filter; proxy to adapter
+ *
+ * @param string $name
+ * @return Zend_Form_Element_File
+ */
+ public function removeFilter($name)
+ {
+ $adapter = $this->getTransferAdapter();
+ $adapter->removeFilter($name);
+
+ return $this;
+ }
+
+ /**
+ * Remove all filters; proxy to adapter
+ *
+ * @return Zend_Form_Element_File
+ */
+ public function clearFilters()
+ {
+ $adapter = $this->getTransferAdapter();
+ $adapter->clearFilters();
+
+ return $this;
+ }
+
+ /**
+ * Validate upload
+ *
+ * @param string $value File, can be optional, give null to validate all files
+ * @param mixed $context
+ * @return bool
+ */
+ public function isValid($value, $context = null)
+ {
+ if ($this->_validated) {
+ return true;
+ }
+
+ $adapter = $this->getTransferAdapter();
+ $translator = $this->getTranslator();
+ if ($translator !== null) {
+ $adapter->setTranslator($translator);
+ }
+
+ if (!$this->isRequired()) {
+ $adapter->setOptions(array('ignoreNoFile' => true), $this->getName());
+ } else {
+ $adapter->setOptions(array('ignoreNoFile' => false), $this->getName());
+ if ($this->autoInsertNotEmptyValidator() && !$this->getValidator('NotEmpty')) {
+ $this->addValidator('NotEmpty', true);
+ }
+ }
+
+ if($adapter->isValid($this->getName())) {
+ $this->_validated = true;
+ return true;
+ }
+
+ $this->_validated = false;
+ return false;
+ }
+
+ /**
+ * Receive the uploaded file
+ *
+ * @return boolean
+ */
+ public function receive()
+ {
+ if (!$this->_validated) {
+ if (!$this->isValid($this->getName())) {
+ return false;
+ }
+ }
+
+ $adapter = $this->getTransferAdapter();
+ if ($adapter->receive($this->getName())) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Retrieve error codes; proxy to transfer adapter
+ *
+ * @return array
+ */
+ public function getErrors()
+ {
+ return parent::getErrors() + $this->getTransferAdapter()->getErrors();
+ }
+
+ /**
+ * Are there errors registered?
+ *
+ * @return bool
+ */
+ public function hasErrors()
+ {
+ return (parent::hasErrors() || $this->getTransferAdapter()->hasErrors());
+ }
+
+ /**
+ * Retrieve error messages; proxy to transfer adapter
+ *
+ * @return array
+ */
+ public function getMessages()
+ {
+ return parent::getMessages() + $this->getTransferAdapter()->getMessages();
+ }
+
+ /**
+ * Set the upload destination
+ *
+ * @param string $path
+ * @return Zend_Form_Element_File
+ */
+ public function setDestination($path)
+ {
+ $this->getTransferAdapter()->setDestination($path, $this->getName());
+ return $this;
+ }
+
+ /**
+ * Get the upload destination
+ *
+ * @return string
+ */
+ public function getDestination()
+ {
+ return $this->getTransferAdapter()->getDestination($this->getName());
+ }
+
+ /**
+ * Get the final filename
+ *
+ * @param string $value (Optional) Element or file to return
+ * @param boolean $path (Optional) Return also the path, defaults to true
+ * @return string
+ */
+ public function getFileName($value = null, $path = true)
+ {
+ if (empty($value)) {
+ $value = $this->getName();
+ }
+
+ return $this->getTransferAdapter()->getFileName($value, $path);
+ }
+
+ /**
+ * Get internal file informations
+ *
+ * @param string $value (Optional) Element or file to return
+ * @return array
+ */
+ public function getFileInfo($value = null)
+ {
+ if (empty($value)) {
+ $value = $this->getName();
+ }
+
+ return $this->getTransferAdapter()->getFileInfo($value);
+ }
+
+ /**
+ * Set a multifile element
+ *
+ * @param integer $count Number of file elements
+ * @return Zend_Form_Element_File Provides fluent interface
+ */
+ public function setMultiFile($count)
+ {
+ if ((integer) $count < 2) {
+ $this->setIsArray(false);
+ $this->_counter = 1;
+ } else {
+ $this->setIsArray(true);
+ $this->_counter = (integer) $count;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns the multifile element number
+ *
+ * @return integer
+ */
+ public function getMultiFile()
+ {
+ return $this->_counter;
+ }
+
+ /**
+ * Sets the maximum file size of the form
+ *
+ * @return integer
+ */
+ public function getMaxFileSize()
+ {
+ if (self::$_maxFileSize < 0) {
+ $ini = $this->_convertIniToInteger(trim(ini_get('post_max_size')));
+ $max = $this->_convertIniToInteger(trim(ini_get('upload_max_filesize')));
+ $min = max($ini, $max);
+ if ($ini > 0) {
+ $min = min($min, $ini);
+ }
+
+ if ($max > 0) {
+ $min = min($min, $max);
+ }
+
+ self::$_maxFileSize = $min;
+ }
+
+ return self::$_maxFileSize;
+ }
+
+ /**
+ * Sets the maximum file size of the form
+ *
+ * @param integer $size
+ * @return integer
+ */
+ public function setMaxFileSize($size)
+ {
+ $ini = $this->_convertIniToInteger(trim(ini_get('post_max_size')));
+ $max = $this->_convertIniToInteger(trim(ini_get('upload_max_filesize')));
+
+ if (($max > -1) && ($size > $max)) {
+ trigger_error("Your 'upload_max_filesize' config setting limits the maximum filesize to '$max'. You tried to set '$size'.", E_USER_NOTICE);
+ $size = $max;
+ }
+
+ if (($ini > -1) && ($size > $ini)) {
+ trigger_error("Your 'post_max_size' config setting limits the maximum filesize to '$ini'. You tried to set '$size'.", E_USER_NOTICE);
+ $size = $ini;
+ }
+
+ self::$_maxFileSize = $size;
+ return $this;
+ }
+
+ /**
+ * Converts a ini setting to a integer value
+ *
+ * @param string $setting
+ * @return integer
+ */
+ private function _convertIniToInteger($setting)
+ {
+ if (!is_numeric($setting)) {
+ $type = strtoupper(substr($setting, -1));
+ $setting = (integer) substr($setting, 0, -1);
+
+ switch ($type) {
+ case 'K' :
+ $setting *= 1024;
+ break;
+
+ case 'M' :
+ $setting *= 1024 * 1024;
+ break;
+
+ case 'G' :
+ $setting *= 1024 * 1024 * 1024;
+ break;
+
+ default :
+ break;
+ }
+ }
+
+ return (integer) $setting;
+ }
+
+ /**
+ * Set if the file will be uploaded when getting the value
+ * This defaults to false which will force receive() when calling getValues()
+ *
+ * @param boolean $flag Sets if the file is handled as the elements value
+ * @return Zend_Form_Element_File
+ */
+ public function setValueDisabled($flag)
+ {
+ $this->_valueDisabled = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Returns if the file will be uploaded when calling getValues()
+ *
+ * @return boolean Receive the file on calling getValues()?
+ */
+ public function isValueDisabled()
+ {
+ return $this->_valueDisabled;
+ }
+
+ /**
+ * Processes the file, returns null or the filename only
+ * For the complete path, use getFileName
+ *
+ * @return null|string
+ */
+ public function getValue()
+ {
+ if ($this->_value !== null) {
+ return $this->_value;
+ }
+
+ $content = $this->getTransferAdapter()->getFileName($this->getName());
+ if (empty($content)) {
+ return null;
+ }
+
+ if (!$this->isValid(null)) {
+ return null;
+ }
+
+ if (!$this->_valueDisabled && !$this->receive()) {
+ return null;
+ }
+
+ return $this->getFileName(null, false);
+ }
+
+ /**
+ * Disallow setting the value
+ *
+ * @param mixed $value
+ * @return Zend_Form_Element_File
+ */
+ public function setValue($value)
+ {
+ return $this;
+ }
+
+ /**
+ * Set translator object for localization
+ *
+ * @param Zend_Translate|null $translator
+ * @return Zend_Form_Element_File
+ */
+ public function setTranslator($translator = null)
+ {
+ $adapter = $this->getTransferAdapter();
+ $adapter->setTranslator($translator);
+ parent::setTranslator($translator);
+
+ return $this;
+ }
+
+ /**
+ * Retrieve localization translator object
+ *
+ * @return Zend_Translate_Adapter|null
+ */
+ public function getTranslator()
+ {
+ if ($this->translatorIsDisabled()) {
+ return null;
+ }
+
+ $translator = $this->getTransferAdapter()->getTranslator();
+ if (null === $translator) {
+ return Zend_Form::getDefaultTranslator();
+ }
+
+ return $translator;
+ }
+
+ /**
+ * Indicate whether or not translation should be disabled
+ *
+ * @param bool $flag
+ * @return Zend_Form_Element_File
+ */
+ public function setDisableTranslator($flag)
+ {
+ $adapter = $this->getTransferAdapter();
+ $adapter->setDisableTranslator($flag);
+ $this->_translatorDisabled = (bool) $flag;
+
+ return $this;
+ }
+
+ /**
+ * Is translation disabled?
+ *
+ * @return bool
+ */
+ public function translatorIsDisabled()
+ {
+ $adapter = $this->getTransferAdapter();
+ return $adapter->translatorIsDisabled();
+ }
+
+ /**
+ * Was the file received?
+ *
+ * @return bool
+ */
+ public function isReceived()
+ {
+ $adapter = $this->getTransferAdapter();
+ return $adapter->isReceived($this->getName());
+ }
+
+ /**
+ * Was the file uploaded?
+ *
+ * @return bool
+ */
+ public function isUploaded()
+ {
+ $adapter = $this->getTransferAdapter();
+ return $adapter->isUploaded($this->getName());
+ }
+
+ /**
+ * Has the file been filtered?
+ *
+ * @return bool
+ */
+ public function isFiltered()
+ {
+ $adapter = $this->getTransferAdapter();
+ return $adapter->isFiltered($this->getName());
+ }
+
+ /**
+ * Returns the hash for this file element
+ *
+ * @param string $hash (Optional) Hash algorithm to use
+ * @return string|array Hashstring
+ */
+ public function getHash($hash = 'crc32')
+ {
+ $adapter = $this->getTransferAdapter();
+ return $adapter->getHash($hash, $this->getName());
+ }
+
+ /**
+ * Returns the filesize for this file element
+ *
+ * @return string|array Filesize
+ */
+ public function getFileSize()
+ {
+ $adapter = $this->getTransferAdapter();
+ return $adapter->getFileSize($this->getName());
+ }
+
+ /**
+ * Returns the mimetype for this file element
+ *
+ * @return string|array Mimetype
+ */
+ public function getMimeType()
+ {
+ $adapter = $this->getTransferAdapter();
+ return $adapter->getMimeType($this->getName());
+ }
+
+ /**
+ * Render form element
+ * Checks for decorator interface to prevent errors
+ *
+ * @param Zend_View_Interface $view
+ * @return string
+ * @throws Zend_Form_Element_Exception
+ */
+ public function render(Zend_View_Interface $view = null)
+ {
+ $marker = false;
+ foreach ($this->getDecorators() as $decorator) {
+ if ($decorator instanceof Zend_Form_Decorator_Marker_File_Interface) {
+ $marker = true;
+ }
+ }
+
+ if (!$marker) {
+ throw new Zend_Form_Element_Exception('No file decorator found... unable to render file element');
+ }
+
+ return parent::render($view);
+ }
+
+ /**
+ * Retrieve error messages and perform translation and value substitution
+ *
+ * @return array
+ */
+ protected function _getErrorMessages()
+ {
+ $translator = $this->getTranslator();
+ $messages = $this->getErrorMessages();
+ $value = $this->getFileName();
+ foreach ($messages as $key => $message) {
+ if (null !== $translator) {
+ $message = $translator->translate($message);
+ }
+
+ if ($this->isArray() || is_array($value)) {
+ $aggregateMessages = array();
+ foreach ($value as $val) {
+ $aggregateMessages[] = str_replace('%value%', $val, $message);
+ }
+
+ if (!empty($aggregateMessages)) {
+ $messages[$key] = $aggregateMessages;
+ }
+ } else {
+ $messages[$key] = str_replace('%value%', $value, $message);
+ }
+ }
+
+ return $messages;
+ }
+}
diff --git a/library/vendor/Zend/Form/Element/Hidden.php b/library/vendor/Zend/Form/Element/Hidden.php
new file mode 100644
index 0000000..c512684
--- /dev/null
+++ b/library/vendor/Zend/Form/Element/Hidden.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Element_Xhtml */
+
+/**
+ * Hidden form element
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Element_Hidden extends Zend_Form_Element_Xhtml
+{
+ /**
+ * Use formHidden view helper by default
+ * @var string
+ */
+ public $helper = 'formHidden';
+}
diff --git a/library/vendor/Zend/Form/Element/Image.php b/library/vendor/Zend/Form/Element/Image.php
new file mode 100644
index 0000000..46c914a
--- /dev/null
+++ b/library/vendor/Zend/Form/Element/Image.php
@@ -0,0 +1,131 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Element_Xhtml */
+
+/**
+ * Image form element
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Element_Image extends Zend_Form_Element_Xhtml
+{
+ /**
+ * What view helper to use when using view helper decorator
+ * @var string
+ */
+ public $helper = 'formImage';
+
+ /**
+ * Image source
+ * @var string
+ */
+ public $src;
+
+ /**
+ * Image value
+ * @var mixed
+ */
+ protected $_imageValue;
+
+ /**
+ * Load default decorators
+ *
+ * @return Zend_Form_Element_Image
+ */
+ public function loadDefaultDecorators()
+ {
+ if ($this->loadDefaultDecoratorsIsDisabled()) {
+ return $this;
+ }
+
+ $decorators = $this->getDecorators();
+ if (empty($decorators)) {
+ $this->addDecorator('Tooltip')
+ ->addDecorator('Image')
+ ->addDecorator('Errors')
+ ->addDecorator('HtmlTag', array('tag' => 'dd'))
+ ->addDecorator('Label', array('tag' => 'dt'));
+ }
+ return $this;
+ }
+
+ /**
+ * Set image path
+ *
+ * @param string $path
+ * @return Zend_Form_Element_Image
+ */
+ public function setImage($path)
+ {
+ $this->src = (string) $path;
+ return $this;
+ }
+
+ /**
+ * Get image path
+ *
+ * @return string
+ */
+ public function getImage()
+ {
+ return $this->src;
+ }
+
+ /**
+ * Set image value to use when submitted
+ *
+ * @param mixed $value
+ * @return Zend_Form_Element_Image
+ */
+ public function setImageValue($value)
+ {
+ $this->_imageValue = $value;
+ return $this;
+ }
+
+ /**
+ * Get image value to use when submitted
+ *
+ * @return mixed
+ */
+ public function getImageValue()
+ {
+ return $this->_imageValue;
+ }
+
+ /**
+ * Was this element used to submit the form?
+ *
+ * @return bool
+ */
+ public function isChecked()
+ {
+ $imageValue = $this->getImageValue();
+ return ((null !== $imageValue) && ($this->getValue() == $imageValue));
+ }
+
+}
diff --git a/library/vendor/Zend/Form/Element/Multi.php b/library/vendor/Zend/Form/Element/Multi.php
new file mode 100644
index 0000000..3de2033
--- /dev/null
+++ b/library/vendor/Zend/Form/Element/Multi.php
@@ -0,0 +1,316 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Element_Xhtml */
+
+/**
+ * Base class for multi-option form elements
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+abstract class Zend_Form_Element_Multi extends Zend_Form_Element_Xhtml
+{
+ /**
+ * Array of options for multi-item
+ * @var array
+ */
+ public $options = array();
+
+ /**
+ * Flag: autoregister inArray validator?
+ * @var bool
+ */
+ protected $_registerInArrayValidator = true;
+
+ /**
+ * Separator to use between options; defaults to '<br />'.
+ * @var string
+ */
+ protected $_separator = '<br />';
+
+ /**
+ * Which values are translated already?
+ * @var array
+ */
+ protected $_translated = array();
+
+ /**
+ * Retrieve separator
+ *
+ * @return mixed
+ */
+ public function getSeparator()
+ {
+ return $this->_separator;
+ }
+
+ /**
+ * Set separator
+ *
+ * @param mixed $separator
+ * @return self
+ */
+ public function setSeparator($separator)
+ {
+ $this->_separator = $separator;
+ return $this;
+ }
+
+ /**
+ * Retrieve options array
+ *
+ * @return array
+ */
+ protected function _getMultiOptions()
+ {
+ if (null === $this->options || !is_array($this->options)) {
+ $this->options = array();
+ }
+
+ return $this->options;
+ }
+
+ /**
+ * Add an option
+ *
+ * @param string $option
+ * @param string $value
+ * @return Zend_Form_Element_Multi
+ */
+ public function addMultiOption($option, $value = '')
+ {
+ $option = (string) $option;
+ $this->_getMultiOptions();
+ if (!$this->_translateOption($option, $value)) {
+ $this->options[$option] = $value;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Add many options at once
+ *
+ * @param array $options
+ * @return Zend_Form_Element_Multi
+ */
+ public function addMultiOptions(array $options)
+ {
+ foreach ($options as $option => $value) {
+ if (is_array($value)
+ && array_key_exists('key', $value)
+ && array_key_exists('value', $value)
+ ) {
+ $this->addMultiOption($value['key'], $value['value']);
+ } else {
+ $this->addMultiOption($option, $value);
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Set all options at once (overwrites)
+ *
+ * @param array $options
+ * @return Zend_Form_Element_Multi
+ */
+ public function setMultiOptions(array $options)
+ {
+ $this->clearMultiOptions();
+ return $this->addMultiOptions($options);
+ }
+
+ /**
+ * Retrieve single multi option
+ *
+ * @param string $option
+ * @return mixed
+ */
+ public function getMultiOption($option)
+ {
+ $option = (string) $option;
+ $this->_getMultiOptions();
+ if (isset($this->options[$option])) {
+ $this->_translateOption($option, $this->options[$option]);
+ return $this->options[$option];
+ }
+
+ return null;
+ }
+
+ /**
+ * Retrieve options
+ *
+ * @return array
+ */
+ public function getMultiOptions()
+ {
+ $this->_getMultiOptions();
+ foreach ($this->options as $option => $value) {
+ $this->_translateOption($option, $value);
+ }
+ return $this->options;
+ }
+
+ /**
+ * Remove a single multi option
+ *
+ * @param string $option
+ * @return bool
+ */
+ public function removeMultiOption($option)
+ {
+ $option = (string) $option;
+ $this->_getMultiOptions();
+ if (isset($this->options[$option])) {
+ unset($this->options[$option]);
+ if (isset($this->_translated[$option])) {
+ unset($this->_translated[$option]);
+ }
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Clear all options
+ *
+ * @return Zend_Form_Element_Multi
+ */
+ public function clearMultiOptions()
+ {
+ $this->options = array();
+ $this->_translated = array();
+ return $this;
+ }
+
+ /**
+ * Set flag indicating whether or not to auto-register inArray validator
+ *
+ * @param bool $flag
+ * @return Zend_Form_Element_Multi
+ */
+ public function setRegisterInArrayValidator($flag)
+ {
+ $this->_registerInArrayValidator = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Get status of auto-register inArray validator flag
+ *
+ * @return bool
+ */
+ public function registerInArrayValidator()
+ {
+ return $this->_registerInArrayValidator;
+ }
+
+ /**
+ * Is the value provided valid?
+ *
+ * Autoregisters InArray validator if necessary.
+ *
+ * @param string $value
+ * @param mixed $context
+ * @return bool
+ */
+ public function isValid($value, $context = null)
+ {
+ if ($this->registerInArrayValidator()) {
+ if (!$this->getValidator('InArray')) {
+ $multiOptions = $this->getMultiOptions();
+ $options = array();
+
+ foreach ($multiOptions as $opt_value => $opt_label) {
+ // optgroup instead of option label
+ if (is_array($opt_label)) {
+ $options = array_merge($options, array_keys($opt_label));
+ }
+ else {
+ $options[] = $opt_value;
+ }
+ }
+
+ $this->addValidator(
+ 'InArray',
+ true,
+ array($options)
+ );
+ }
+ }
+ return parent::isValid($value, $context);
+ }
+
+ /**
+ * Translate an option
+ *
+ * @param string $option
+ * @param string $value
+ * @return bool
+ */
+ protected function _translateOption($option, $value)
+ {
+ if ($this->translatorIsDisabled()) {
+ return false;
+ }
+
+ if (!isset($this->_translated[$option]) && !empty($value)) {
+ $this->options[$option] = $this->_translateValue($value);
+ if ($this->options[$option] === $value) {
+ return false;
+ }
+ $this->_translated[$option] = true;
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Translate a multi option value
+ *
+ * @param string $value
+ * @return string
+ */
+ protected function _translateValue($value)
+ {
+ if (is_array($value)) {
+ foreach ($value as $key => $val) {
+ $value[$key] = $this->_translateValue($val);
+ }
+ return $value;
+ } else {
+ if (null !== ($translator = $this->getTranslator())) {
+ return $translator->translate($value);
+ }
+
+ return $value;
+ }
+ }
+}
diff --git a/library/vendor/Zend/Form/Element/MultiCheckbox.php b/library/vendor/Zend/Form/Element/MultiCheckbox.php
new file mode 100644
index 0000000..24fe938
--- /dev/null
+++ b/library/vendor/Zend/Form/Element/MultiCheckbox.php
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Element_Multi */
+
+/**
+ * MultiCheckbox form element
+ *
+ * Allows specifyinc a (multi-)dimensional associative array of values to use
+ * as labelled checkboxes; these will return an array of values for those
+ * checkboxes selected.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Element_MultiCheckbox extends Zend_Form_Element_Multi
+{
+ /**
+ * Use formMultiCheckbox view helper by default
+ * @var string
+ */
+ public $helper = 'formMultiCheckbox';
+
+ /**
+ * MultiCheckbox is an array of values by default
+ * @var bool
+ */
+ protected $_isArray = true;
+
+ /**
+ * Load default decorators
+ *
+ * @return Zend_Form_Element_MultiCheckbox
+ */
+ public function loadDefaultDecorators()
+ {
+ if ($this->loadDefaultDecoratorsIsDisabled()) {
+ return $this;
+ }
+
+ parent::loadDefaultDecorators();
+
+ // Disable 'for' attribute
+ if (false !== $decorator = $this->getDecorator('label')) {
+ $decorator->setOption('disableFor', true);
+ }
+
+ return $this;
+ }
+}
diff --git a/library/vendor/Zend/Form/Element/Multiselect.php b/library/vendor/Zend/Form/Element/Multiselect.php
new file mode 100644
index 0000000..5e94d56
--- /dev/null
+++ b/library/vendor/Zend/Form/Element/Multiselect.php
@@ -0,0 +1,53 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Element_Select */
+
+/**
+ * Multiselect form element
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Element_Multiselect extends Zend_Form_Element_Select
+{
+ /**
+ * 'multiple' attribute
+ * @var string
+ */
+ public $multiple = 'multiple';
+
+ /**
+ * Use formSelect view helper by default
+ * @var string
+ */
+ public $helper = 'formSelect';
+
+ /**
+ * Multiselect is an array of values by default
+ * @var bool
+ */
+ protected $_isArray = true;
+}
diff --git a/library/vendor/Zend/Form/Element/Note.php b/library/vendor/Zend/Form/Element/Note.php
new file mode 100644
index 0000000..77dee53
--- /dev/null
+++ b/library/vendor/Zend/Form/Element/Note.php
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Element_Xhtml */
+
+/**
+ * Element to show an HTML note
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Element_Note extends Zend_Form_Element_Xhtml
+{
+ /**
+ * Default form view helper to use for rendering
+ *
+ * @var string
+ */
+ public $helper = 'formNote';
+
+ /**
+ * Ignore flag (used when retrieving values at form level)
+ *
+ * @var bool
+ */
+ protected $_ignore = true;
+
+ /**
+ * Validate element value (pseudo)
+ *
+ * There is no need to reset the value
+ *
+ * @param mixed $value Is always ignored
+ * @param mixed $context Is always ignored
+ * @return boolean Returns always TRUE
+ */
+ public function isValid($value, $context = null)
+ {
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Form/Element/Password.php b/library/vendor/Zend/Form/Element/Password.php
new file mode 100644
index 0000000..8d84c72
--- /dev/null
+++ b/library/vendor/Zend/Form/Element/Password.php
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Element_Xhtml */
+
+/**
+ * Password form element
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Element_Password extends Zend_Form_Element_Xhtml
+{
+ /**
+ * Use formPassword view helper by default
+ * @var string
+ */
+ public $helper = 'formPassword';
+
+ /**
+ * Whether or not to render the password
+ * @var bool
+ */
+ public $renderPassword = false;
+
+ /**
+ * Set flag indicating whether or not to render the password
+ * @param bool $flag
+ * @return Zend_Form_Element_Password
+ */
+ public function setRenderPassword($flag)
+ {
+ $this->renderPassword = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Get value of renderPassword flag
+ *
+ * @return bool
+ */
+ public function renderPassword()
+ {
+ return $this->renderPassword;
+ }
+
+ /**
+ * Override isValid()
+ *
+ * Ensure that validation error messages mask password value.
+ *
+ * @param string $value
+ * @param mixed $context
+ * @return bool
+ */
+ public function isValid($value, $context = null)
+ {
+ foreach ($this->getValidators() as $validator) {
+ if ($validator instanceof Zend_Validate_Abstract) {
+ $validator->setObscureValue(true);
+ }
+ }
+ return parent::isValid($value, $context);
+ }
+}
diff --git a/library/vendor/Zend/Form/Element/Radio.php b/library/vendor/Zend/Form/Element/Radio.php
new file mode 100644
index 0000000..883a00d
--- /dev/null
+++ b/library/vendor/Zend/Form/Element/Radio.php
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Element_Multi */
+
+/**
+ * Radio form element
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Element_Radio extends Zend_Form_Element_Multi
+{
+ /**
+ * Use formRadio view helper by default
+ * @var string
+ */
+ public $helper = 'formRadio';
+
+ /**
+ * Load default decorators
+ *
+ * Disables "for" attribute of label if label decorator enabled.
+ *
+ * @return Zend_Form_Element_Radio
+ */
+ public function loadDefaultDecorators()
+ {
+ if ($this->loadDefaultDecoratorsIsDisabled()) {
+ return $this;
+ }
+ parent::loadDefaultDecorators();
+
+ // Disable 'for' attribute
+ if (isset($this->_decorators['Label'])
+ && !isset($this->_decorators['Label']['options']['disableFor']))
+ {
+ $this->_decorators['Label']['options']['disableFor'] = true;
+ }
+
+ return $this;
+ }
+}
diff --git a/library/vendor/Zend/Form/Element/Reset.php b/library/vendor/Zend/Form/Element/Reset.php
new file mode 100644
index 0000000..8a27805
--- /dev/null
+++ b/library/vendor/Zend/Form/Element/Reset.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Element_Submit */
+
+/**
+ * Reset form element
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Element_Reset extends Zend_Form_Element_Submit
+{
+ /**
+ * Use formReset view helper by default
+ * @var string
+ */
+ public $helper = 'formReset';
+}
diff --git a/library/vendor/Zend/Form/Element/Select.php b/library/vendor/Zend/Form/Element/Select.php
new file mode 100644
index 0000000..acf009a
--- /dev/null
+++ b/library/vendor/Zend/Form/Element/Select.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Element_Multi */
+
+/**
+ * Select.php form element
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Element_Select extends Zend_Form_Element_Multi
+{
+ /**
+ * 'multiple' attribute
+ * @var string
+ */
+ public $multiple = false;
+
+ /**
+ * Use formSelect view helper by default
+ * @var string
+ */
+ public $helper = 'formSelect';
+}
diff --git a/library/vendor/Zend/Form/Element/Submit.php b/library/vendor/Zend/Form/Element/Submit.php
new file mode 100644
index 0000000..ad564e0
--- /dev/null
+++ b/library/vendor/Zend/Form/Element/Submit.php
@@ -0,0 +1,126 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Element_Xhtml */
+
+/**
+ * Submit form element
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Element_Submit extends Zend_Form_Element_Xhtml
+{
+ /**
+ * Default view helper to use
+ * @var string
+ */
+ public $helper = 'formSubmit';
+
+ /**
+ * Constructor
+ *
+ * @param string|array|Zend_Config $spec Element name or configuration
+ * @param string|array|Zend_Config $options Element value or configuration
+ * @return void
+ */
+ public function __construct($spec, $options = null)
+ {
+ if (is_string($spec) && ((null !== $options) && is_string($options))) {
+ $options = array('label' => $options);
+ }
+
+ if (!isset($options['ignore'])) {
+ $options['ignore'] = true;
+ }
+
+ parent::__construct($spec, $options);
+ }
+
+ /**
+ * Return label
+ *
+ * If no label is present, returns the currently set name.
+ *
+ * If a translator is present, returns the translated label.
+ *
+ * @return string
+ */
+ public function getLabel()
+ {
+ $value = parent::getLabel();
+
+ if (null === $value) {
+ $value = $this->getName();
+
+ if (null !== ($translator = $this->getTranslator())) {
+ return $translator->translate($value);
+ }
+ }
+
+ return $value;
+ }
+
+ /**
+ * Has this submit button been selected?
+ *
+ * @return bool
+ */
+ public function isChecked()
+ {
+ $value = $this->getValue();
+
+ if (empty($value)) {
+ return false;
+ }
+ if ($value != $this->getLabel()) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Default decorators
+ *
+ * Uses only 'Submit' and 'DtDdWrapper' decorators by default.
+ *
+ * @return Zend_Form_Element_Submit
+ */
+ public function loadDefaultDecorators()
+ {
+ if ($this->loadDefaultDecoratorsIsDisabled()) {
+ return $this;
+ }
+
+ $decorators = $this->getDecorators();
+ if (empty($decorators)) {
+ $this->addDecorator('Tooltip')
+ ->addDecorator('ViewHelper')
+ ->addDecorator('DtDdWrapper');
+ }
+ return $this;
+ }
+}
diff --git a/library/vendor/Zend/Form/Element/Text.php b/library/vendor/Zend/Form/Element/Text.php
new file mode 100644
index 0000000..1a99b8e
--- /dev/null
+++ b/library/vendor/Zend/Form/Element/Text.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Element_Xhtml */
+
+/**
+ * Text form element
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Element_Text extends Zend_Form_Element_Xhtml
+{
+ /**
+ * Default form view helper to use for rendering
+ * @var string
+ */
+ public $helper = 'formText';
+}
diff --git a/library/vendor/Zend/Form/Element/Textarea.php b/library/vendor/Zend/Form/Element/Textarea.php
new file mode 100644
index 0000000..ff4ddd5
--- /dev/null
+++ b/library/vendor/Zend/Form/Element/Textarea.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Element_Xhtml */
+
+/**
+ * Textarea form element
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_Element_Textarea extends Zend_Form_Element_Xhtml
+{
+ /**
+ * Use formTextarea view helper by default
+ * @var string
+ */
+ public $helper = 'formTextarea';
+}
diff --git a/library/vendor/Zend/Form/Element/Xhtml.php b/library/vendor/Zend/Form/Element/Xhtml.php
new file mode 100644
index 0000000..6ef15e9
--- /dev/null
+++ b/library/vendor/Zend/Form/Element/Xhtml.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form_Element */
+
+/**
+ * Base element for XHTML elements
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @subpackage Element
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+abstract class Zend_Form_Element_Xhtml extends Zend_Form_Element
+{
+}
diff --git a/library/vendor/Zend/Form/Exception.php b/library/vendor/Zend/Form/Exception.php
new file mode 100644
index 0000000..61a1bd5
--- /dev/null
+++ b/library/vendor/Zend/Form/Exception.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Exception */
+
+/**
+ * Exception for Zend_Form component.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Form_Exception extends Zend_Exception
+{
+}
diff --git a/library/vendor/Zend/Form/SubForm.php b/library/vendor/Zend/Form/SubForm.php
new file mode 100644
index 0000000..36d961e
--- /dev/null
+++ b/library/vendor/Zend/Form/SubForm.php
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Form */
+
+/**
+ * Zend_Form_SubForm
+ *
+ * @category Zend
+ * @package Zend_Form
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Form_SubForm extends Zend_Form
+{
+ /**
+ * Whether or not form elements are members of an array
+ * @var bool
+ */
+ protected $_isArray = true;
+
+ /**
+ * Load the default decorators
+ *
+ * @return Zend_Form_SubForm
+ */
+ public function loadDefaultDecorators()
+ {
+ if ($this->loadDefaultDecoratorsIsDisabled()) {
+ return $this;
+ }
+
+ $decorators = $this->getDecorators();
+ if (empty($decorators)) {
+ $this->addDecorator('FormElements')
+ ->addDecorator('HtmlTag', array('tag' => 'dl'))
+ ->addDecorator('Fieldset')
+ ->addDecorator('DtDdWrapper');
+ }
+ return $this;
+ }
+}
diff --git a/library/vendor/Zend/Json.php b/library/vendor/Zend/Json.php
new file mode 100644
index 0000000..b7b97f2
--- /dev/null
+++ b/library/vendor/Zend/Json.php
@@ -0,0 +1,433 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Json
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Json_Expr.
+ *
+ * @see Zend_Json_Expr
+ */
+
+/** @see Zend_Xml_Security */
+
+/**
+ * Class for encoding to and decoding from JSON.
+ *
+ * @category Zend
+ * @package Zend_Json
+ * @uses Zend_Json_Expr
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Json
+{
+ /**
+ * How objects should be encoded -- arrays or as StdClass. TYPE_ARRAY is 1
+ * so that it is a boolean true value, allowing it to be used with
+ * ext/json's functions.
+ */
+ const TYPE_ARRAY = 1;
+ const TYPE_OBJECT = 0;
+
+ /**
+ * To check the allowed nesting depth of the XML tree during xml2json conversion.
+ *
+ * @var int
+ */
+ public static $maxRecursionDepthAllowed=25;
+
+ /**
+ * @var bool
+ */
+ public static $useBuiltinEncoderDecoder = false;
+
+ /**
+ * Decodes the given $encodedValue string which is
+ * encoded in the JSON format
+ *
+ * Uses ext/json's json_decode if available.
+ *
+ * @param string $encodedValue Encoded in JSON format
+ * @param int $objectDecodeType Optional; flag indicating how to decode
+ * objects. See {@link Zend_Json_Decoder::decode()} for details.
+ * @return mixed
+ */
+ public static function decode($encodedValue, $objectDecodeType = Zend_Json::TYPE_ARRAY)
+ {
+ $encodedValue = (string) $encodedValue;
+ if (function_exists('json_decode') && self::$useBuiltinEncoderDecoder !== true) {
+ $decode = json_decode($encodedValue, $objectDecodeType);
+
+ // php < 5.3
+ if (!function_exists('json_last_error')) {
+ if (strtolower($encodedValue) === 'null') {
+ return null;
+ } elseif ($decode === null) {
+ throw new Zend_Json_Exception('Decoding failed');
+ }
+ // php >= 5.3
+ } elseif (($jsonLastErr = json_last_error()) != JSON_ERROR_NONE) {
+ switch ($jsonLastErr) {
+ case JSON_ERROR_DEPTH:
+ throw new Zend_Json_Exception('Decoding failed: Maximum stack depth exceeded');
+ case JSON_ERROR_CTRL_CHAR:
+ throw new Zend_Json_Exception('Decoding failed: Unexpected control character found');
+ case JSON_ERROR_SYNTAX:
+ throw new Zend_Json_Exception('Decoding failed: Syntax error');
+ default:
+ throw new Zend_Json_Exception('Decoding failed');
+ }
+ }
+
+ return $decode;
+ }
+
+ return Zend_Json_Decoder::decode($encodedValue, $objectDecodeType);
+ }
+
+ /**
+ * Encode the mixed $valueToEncode into the JSON format
+ *
+ * Encodes using ext/json's json_encode() if available.
+ *
+ * NOTE: Object should not contain cycles; the JSON format
+ * does not allow object reference.
+ *
+ * NOTE: Only public variables will be encoded
+ *
+ * NOTE: Encoding native javascript expressions are possible using Zend_Json_Expr.
+ * You can enable this by setting $options['enableJsonExprFinder'] = true
+ *
+ * @see Zend_Json_Expr
+ *
+ * @param mixed $valueToEncode
+ * @param boolean $cycleCheck Optional; whether or not to check for object recursion; off by default
+ * @param array $options Additional options used during encoding
+ * @return string JSON encoded object
+ */
+ public static function encode($valueToEncode, $cycleCheck = false, $options = array())
+ {
+ if (is_object($valueToEncode)) {
+ if (method_exists($valueToEncode, 'toJson')) {
+ return $valueToEncode->toJson();
+ } elseif (method_exists($valueToEncode, 'toArray')) {
+ return self::encode($valueToEncode->toArray(), $cycleCheck, $options);
+ }
+ }
+
+ // Pre-encoding look for Zend_Json_Expr objects and replacing by tmp ids
+ $javascriptExpressions = array();
+ if(isset($options['enableJsonExprFinder'])
+ && ($options['enableJsonExprFinder'] == true)
+ ) {
+ /**
+ * @see Zend_Json_Encoder
+ */
+ $valueToEncode = self::_recursiveJsonExprFinder($valueToEncode, $javascriptExpressions);
+ }
+
+ // Encoding
+ if (function_exists('json_encode') && self::$useBuiltinEncoderDecoder !== true) {
+ $encodedResult = json_encode($valueToEncode);
+ } else {
+ $encodedResult = Zend_Json_Encoder::encode($valueToEncode, $cycleCheck, $options);
+ }
+
+ //only do post-proccessing to revert back the Zend_Json_Expr if any.
+ if (count($javascriptExpressions) > 0) {
+ $count = count($javascriptExpressions);
+ for($i = 0; $i < $count; $i++) {
+ $magicKey = $javascriptExpressions[$i]['magicKey'];
+ $value = $javascriptExpressions[$i]['value'];
+
+ $encodedResult = str_replace(
+ //instead of replacing "key:magicKey", we replace directly magicKey by value because "key" never changes.
+ '"' . $magicKey . '"',
+ $value,
+ $encodedResult
+ );
+ }
+ }
+
+ return $encodedResult;
+ }
+
+ /**
+ * Check & Replace Zend_Json_Expr for tmp ids in the valueToEncode
+ *
+ * Check if the value is a Zend_Json_Expr, and if replace its value
+ * with a magic key and save the javascript expression in an array.
+ *
+ * NOTE this method is recursive.
+ *
+ * NOTE: This method is used internally by the encode method.
+ *
+ * @see encode
+ * @param array|object|Zend_Json_Expr $value a string - object property to be encoded
+ * @param array $javascriptExpressions
+ * @param null $currentKey
+ *
+ * @internal param mixed $valueToCheck
+ * @return void
+ */
+ protected static function _recursiveJsonExprFinder(&$value, array &$javascriptExpressions, $currentKey = null)
+ {
+ if ($value instanceof Zend_Json_Expr) {
+ // TODO: Optimize with ascii keys, if performance is bad
+ $magicKey = "____" . $currentKey . "_" . (count($javascriptExpressions));
+ $javascriptExpressions[] = array(
+
+ //if currentKey is integer, encodeUnicodeString call is not required.
+ "magicKey" => (is_int($currentKey)) ? $magicKey : Zend_Json_Encoder::encodeUnicodeString($magicKey),
+ "value" => $value->__toString(),
+ );
+ $value = $magicKey;
+ } elseif (is_array($value)) {
+ foreach ($value as $k => $v) {
+ $value[$k] = self::_recursiveJsonExprFinder($value[$k], $javascriptExpressions, $k);
+ }
+ } elseif (is_object($value)) {
+ foreach ($value as $k => $v) {
+ $value->$k = self::_recursiveJsonExprFinder($value->$k, $javascriptExpressions, $k);
+ }
+ }
+ return $value;
+ }
+
+ /**
+ * Return the value of an XML attribute text or the text between
+ * the XML tags
+ *
+ * In order to allow Zend_Json_Expr from xml, we check if the node
+ * matchs the pattern that try to detect if it is a new Zend_Json_Expr
+ * if it matches, we return a new Zend_Json_Expr instead of a text node
+ *
+ * @param SimpleXMLElement $simpleXmlElementObject
+ * @return Zend_Json_Expr|string
+ */
+ protected static function _getXmlValue($simpleXmlElementObject) {
+ $pattern = '/^[\s]*new Zend_Json_Expr[\s]*\([\s]*[\"\']{1}(.*)[\"\']{1}[\s]*\)[\s]*$/';
+ $matchings = array();
+ $match = preg_match ($pattern, $simpleXmlElementObject, $matchings);
+ if ($match) {
+ return new Zend_Json_Expr($matchings[1]);
+ } else {
+ return (trim(strval($simpleXmlElementObject)));
+ }
+ }
+ /**
+ * _processXml - Contains the logic for xml2json
+ *
+ * The logic in this function is a recursive one.
+ *
+ * The main caller of this function (i.e. fromXml) needs to provide
+ * only the first two parameters i.e. the SimpleXMLElement object and
+ * the flag for ignoring or not ignoring XML attributes. The third parameter
+ * will be used internally within this function during the recursive calls.
+ *
+ * This function converts the SimpleXMLElement object into a PHP array by
+ * calling a recursive (protected static) function in this class. Once all
+ * the XML elements are stored in the PHP array, it is returned to the caller.
+ *
+ * Throws a Zend_Json_Exception if the XML tree is deeper than the allowed limit.
+ *
+ * @param SimpleXMLElement $simpleXmlElementObject
+ * @param boolean $ignoreXmlAttributes
+ * @param integer $recursionDepth
+ * @return array
+ */
+ protected static function _processXml($simpleXmlElementObject, $ignoreXmlAttributes, $recursionDepth=0)
+ {
+ // Keep an eye on how deeply we are involved in recursion.
+ if ($recursionDepth > self::$maxRecursionDepthAllowed) {
+ // XML tree is too deep. Exit now by throwing an exception.
+ throw new Zend_Json_Exception(
+ "Function _processXml exceeded the allowed recursion depth of " .
+ self::$maxRecursionDepthAllowed);
+ } // End of if ($recursionDepth > self::$maxRecursionDepthAllowed)
+
+ $children = $simpleXmlElementObject->children();
+ $name = $simpleXmlElementObject->getName();
+ $value = self::_getXmlValue($simpleXmlElementObject);
+ $attributes = (array) $simpleXmlElementObject->attributes();
+
+ if (count($children) == 0) {
+ if (!empty($attributes) && !$ignoreXmlAttributes) {
+ foreach ($attributes['@attributes'] as $k => $v) {
+ $attributes['@attributes'][$k]= self::_getXmlValue($v);
+ }
+ if (!empty($value)) {
+ $attributes['@text'] = $value;
+ }
+ return array($name => $attributes);
+ } else {
+ return array($name => $value);
+ }
+ } else {
+ $childArray= array();
+ foreach ($children as $child) {
+ $childname = $child->getName();
+ $element = self::_processXml($child,$ignoreXmlAttributes,$recursionDepth+1);
+ if (array_key_exists($childname, $childArray)) {
+ if (empty($subChild[$childname])) {
+ $childArray[$childname] = array($childArray[$childname]);
+ $subChild[$childname] = true;
+ }
+ $childArray[$childname][] = $element[$childname];
+ } else {
+ $childArray[$childname] = $element[$childname];
+ }
+ }
+ if (!empty($attributes) && !$ignoreXmlAttributes) {
+ foreach ($attributes['@attributes'] as $k => $v) {
+ $attributes['@attributes'][$k] = self::_getXmlValue($v);
+ }
+ $childArray['@attributes'] = $attributes['@attributes'];
+ }
+ if (!empty($value)) {
+ $childArray['@text'] = $value;
+ }
+ return array($name => $childArray);
+ }
+ }
+
+ /**
+ * fromXml - Converts XML to JSON
+ *
+ * Converts a XML formatted string into a JSON formatted string.
+ * The value returned will be a string in JSON format.
+ *
+ * The caller of this function needs to provide only the first parameter,
+ * which is an XML formatted String. The second parameter is optional, which
+ * lets the user to select if the XML attributes in the input XML string
+ * should be included or ignored in xml2json conversion.
+ *
+ * This function converts the XML formatted string into a PHP array by
+ * calling a recursive (protected static) function in this class. Then, it
+ * converts that PHP array into JSON by calling the "encode" static funcion.
+ *
+ * Throws a Zend_Json_Exception if the input not a XML formatted string.
+ * NOTE: Encoding native javascript expressions via Zend_Json_Expr is not possible.
+ *
+ * @static
+ * @access public
+ * @param string $xmlStringContents XML String to be converted
+ * @param boolean $ignoreXmlAttributes Include or exclude XML attributes in
+ * the xml2json conversion process.
+ * @return mixed - JSON formatted string on success
+ * @throws Zend_Json_Exception
+ */
+ public static function fromXml($xmlStringContents, $ignoreXmlAttributes=true)
+ {
+ // Load the XML formatted string into a Simple XML Element object.
+ $simpleXmlElementObject = Zend_Xml_Security::scan($xmlStringContents);
+
+ // If it is not a valid XML content, throw an exception.
+ if ($simpleXmlElementObject == null) {
+ throw new Zend_Json_Exception('Function fromXml was called with an invalid XML formatted string.');
+ } // End of if ($simpleXmlElementObject == null)
+
+ $resultArray = null;
+
+ // Call the recursive function to convert the XML into a PHP array.
+ $resultArray = self::_processXml($simpleXmlElementObject, $ignoreXmlAttributes);
+
+ // Convert the PHP array to JSON using Zend_Json encode method.
+ // It is just that simple.
+ $jsonStringOutput = self::encode($resultArray);
+ return($jsonStringOutput);
+ }
+
+
+
+ /**
+ * Pretty-print JSON string
+ *
+ * Use 'format' option to select output format - currently html and txt supported, txt is default
+ * Use 'indent' option to override the indentation string set in the format - by default for the 'txt' format it's a tab
+ *
+ * @param string $json Original JSON string
+ * @param array $options Encoding options
+ * @return string
+ */
+ public static function prettyPrint($json, $options = array())
+ {
+ $tokens = preg_split('|([\{\}\]\[,])|', $json, -1, PREG_SPLIT_DELIM_CAPTURE);
+ $result = '';
+ $indent = 0;
+
+ $format= 'txt';
+
+ $ind = "\t";
+
+ if (isset($options['format'])) {
+ $format = $options['format'];
+ }
+
+ switch ($format) {
+ case 'html':
+ $lineBreak = '<br />';
+ $ind = '&nbsp;&nbsp;&nbsp;&nbsp;';
+ break;
+ default:
+ case 'txt':
+ $lineBreak = "\n";
+ $ind = "\t";
+ break;
+ }
+
+ // override the defined indent setting with the supplied option
+ if (isset($options['indent'])) {
+ $ind = $options['indent'];
+ }
+
+ $inLiteral = false;
+ foreach($tokens as $token) {
+ if($token == '') {
+ continue;
+ }
+
+ $prefix = str_repeat($ind, $indent);
+ if (!$inLiteral && ($token == '{' || $token == '[')) {
+ $indent++;
+ if (($result != '') && ($result[(strlen($result)-1)] == $lineBreak)) {
+ $result .= $prefix;
+ }
+ $result .= $token . $lineBreak;
+ } elseif (!$inLiteral && ($token == '}' || $token == ']')) {
+ $indent--;
+ $prefix = str_repeat($ind, $indent);
+ $result .= $lineBreak . $prefix . $token;
+ } elseif (!$inLiteral && $token == ',') {
+ $result .= $token . $lineBreak;
+ } else {
+ $result .= ( $inLiteral ? '' : $prefix ) . $token;
+
+ // Count # of unescaped double-quotes in token, subtract # of
+ // escaped double-quotes and if the result is odd then we are
+ // inside a string literal
+ if ((substr_count($token, "\"")-substr_count($token, "\\\"")) % 2 != 0) {
+ $inLiteral = !$inLiteral;
+ }
+ }
+ }
+ return $result;
+ }
+}
diff --git a/library/vendor/Zend/Json/Decoder.php b/library/vendor/Zend/Json/Decoder.php
new file mode 100644
index 0000000..0a06016
--- /dev/null
+++ b/library/vendor/Zend/Json/Decoder.php
@@ -0,0 +1,570 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Json
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Json
+ */
+
+/**
+ * Decode JSON encoded string to PHP variable constructs
+ *
+ * @category Zend
+ * @package Zend_Json
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Json_Decoder
+{
+ /**
+ * Parse tokens used to decode the JSON object. These are not
+ * for public consumption, they are just used internally to the
+ * class.
+ */
+ const EOF = 0;
+ const DATUM = 1;
+ const LBRACE = 2;
+ const LBRACKET = 3;
+ const RBRACE = 4;
+ const RBRACKET = 5;
+ const COMMA = 6;
+ const COLON = 7;
+
+ /**
+ * Use to maintain a "pointer" to the source being decoded
+ *
+ * @var string
+ */
+ protected $_source;
+
+ /**
+ * Caches the source length
+ *
+ * @var int
+ */
+ protected $_sourceLength;
+
+ /**
+ * The offset within the souce being decoded
+ *
+ * @var int
+ *
+ */
+ protected $_offset;
+
+ /**
+ * The current token being considered in the parser cycle
+ *
+ * @var int
+ */
+ protected $_token;
+
+ /**
+ * Flag indicating how objects should be decoded
+ *
+ * @var int
+ * @access protected
+ */
+ protected $_decodeType;
+
+ /**
+ * Constructor
+ *
+ * @param string $source String source to decode
+ * @param int $decodeType How objects should be decoded -- see
+ * {@link Zend_Json::TYPE_ARRAY} and {@link Zend_Json::TYPE_OBJECT} for
+ * valid values
+ * @return void
+ */
+ protected function __construct($source, $decodeType)
+ {
+ // Set defaults
+ $this->_source = self::decodeUnicodeString($source);
+ $this->_sourceLength = strlen($this->_source);
+ $this->_token = self::EOF;
+ $this->_offset = 0;
+
+ // Normalize and set $decodeType
+ if (!in_array($decodeType, array(Zend_Json::TYPE_ARRAY, Zend_Json::TYPE_OBJECT)))
+ {
+ $decodeType = Zend_Json::TYPE_ARRAY;
+ }
+ $this->_decodeType = $decodeType;
+
+ // Set pointer at first token
+ $this->_getNextToken();
+ }
+
+ /**
+ * Decode a JSON source string
+ *
+ * Decodes a JSON encoded string. The value returned will be one of the
+ * following:
+ * - integer
+ * - float
+ * - boolean
+ * - null
+ * - StdClass
+ * - array
+ * - array of one or more of the above types
+ *
+ * By default, decoded objects will be returned as associative arrays; to
+ * return a StdClass object instead, pass {@link Zend_Json::TYPE_OBJECT} to
+ * the $objectDecodeType parameter.
+ *
+ * Throws a Zend_Json_Exception if the source string is null.
+ *
+ * @static
+ * @access public
+ * @param string $source String to be decoded
+ * @param int $objectDecodeType How objects should be decoded; should be
+ * either or {@link Zend_Json::TYPE_ARRAY} or
+ * {@link Zend_Json::TYPE_OBJECT}; defaults to TYPE_ARRAY
+ * @return mixed
+ * @throws Zend_Json_Exception
+ */
+ public static function decode($source = null, $objectDecodeType = Zend_Json::TYPE_ARRAY)
+ {
+ if (null === $source) {
+ throw new Zend_Json_Exception('Must specify JSON encoded source for decoding');
+ } elseif (!is_string($source)) {
+ throw new Zend_Json_Exception('Can only decode JSON encoded strings');
+ }
+
+ $decoder = new self($source, $objectDecodeType);
+
+ return $decoder->_decodeValue();
+ }
+
+
+ /**
+ * Recursive driving rountine for supported toplevel tops
+ *
+ * @return mixed
+ */
+ protected function _decodeValue()
+ {
+ switch ($this->_token) {
+ case self::DATUM:
+ $result = $this->_tokenValue;
+ $this->_getNextToken();
+ return($result);
+ break;
+ case self::LBRACE:
+ return($this->_decodeObject());
+ break;
+ case self::LBRACKET:
+ return($this->_decodeArray());
+ break;
+ default:
+ return null;
+ break;
+ }
+ }
+
+ /**
+ * Decodes an object of the form:
+ * { "attribute: value, "attribute2" : value,...}
+ *
+ * If Zend_Json_Encoder was used to encode the original object then
+ * a special attribute called __className which specifies a class
+ * name that should wrap the data contained within the encoded source.
+ *
+ * Decodes to either an array or StdClass object, based on the value of
+ * {@link $_decodeType}. If invalid $_decodeType present, returns as an
+ * array.
+ *
+ * @return array|StdClass
+ */
+ protected function _decodeObject()
+ {
+ $members = array();
+ $tok = $this->_getNextToken();
+
+ while ($tok && $tok != self::RBRACE) {
+ if ($tok != self::DATUM || ! is_string($this->_tokenValue)) {
+ throw new Zend_Json_Exception('Missing key in object encoding: ' . $this->_source);
+ }
+
+ $key = $this->_tokenValue;
+ $tok = $this->_getNextToken();
+
+ if ($tok != self::COLON) {
+ throw new Zend_Json_Exception('Missing ":" in object encoding: ' . $this->_source);
+ }
+
+ $tok = $this->_getNextToken();
+ $members[$key] = $this->_decodeValue();
+ $tok = $this->_token;
+
+ if ($tok == self::RBRACE) {
+ break;
+ }
+
+ if ($tok != self::COMMA) {
+ throw new Zend_Json_Exception('Missing "," in object encoding: ' . $this->_source);
+ }
+
+ $tok = $this->_getNextToken();
+ }
+
+ switch ($this->_decodeType) {
+ case Zend_Json::TYPE_OBJECT:
+ // Create new StdClass and populate with $members
+ $result = new StdClass();
+ foreach ($members as $key => $value) {
+ if ($key === '') {
+ $key = '_empty_';
+ }
+ $result->$key = $value;
+ }
+ break;
+ case Zend_Json::TYPE_ARRAY:
+ default:
+ $result = $members;
+ break;
+ }
+
+ $this->_getNextToken();
+ return $result;
+ }
+
+ /**
+ * Decodes a JSON array format:
+ * [element, element2,...,elementN]
+ *
+ * @return array
+ */
+ protected function _decodeArray()
+ {
+ $result = array();
+ $starttok = $tok = $this->_getNextToken(); // Move past the '['
+ $index = 0;
+
+ while ($tok && $tok != self::RBRACKET) {
+ $result[$index++] = $this->_decodeValue();
+
+ $tok = $this->_token;
+
+ if ($tok == self::RBRACKET || !$tok) {
+ break;
+ }
+
+ if ($tok != self::COMMA) {
+ throw new Zend_Json_Exception('Missing "," in array encoding: ' . $this->_source);
+ }
+
+ $tok = $this->_getNextToken();
+ }
+
+ $this->_getNextToken();
+ return($result);
+ }
+
+
+ /**
+ * Removes whitepsace characters from the source input
+ */
+ protected function _eatWhitespace()
+ {
+ if (preg_match(
+ '/([\t\b\f\n\r ])*/s',
+ $this->_source,
+ $matches,
+ PREG_OFFSET_CAPTURE,
+ $this->_offset)
+ && $matches[0][1] == $this->_offset)
+ {
+ $this->_offset += strlen($matches[0][0]);
+ }
+ }
+
+
+ /**
+ * Retrieves the next token from the source stream
+ *
+ * @return int Token constant value specified in class definition
+ */
+ protected function _getNextToken()
+ {
+ $this->_token = self::EOF;
+ $this->_tokenValue = null;
+ $this->_eatWhitespace();
+
+ if ($this->_offset >= $this->_sourceLength) {
+ return(self::EOF);
+ }
+
+ $str = $this->_source;
+ $str_length = $this->_sourceLength;
+ $i = $this->_offset;
+ $start = $i;
+
+ switch ($str[$i]) {
+ case '{':
+ $this->_token = self::LBRACE;
+ break;
+ case '}':
+ $this->_token = self::RBRACE;
+ break;
+ case '[':
+ $this->_token = self::LBRACKET;
+ break;
+ case ']':
+ $this->_token = self::RBRACKET;
+ break;
+ case ',':
+ $this->_token = self::COMMA;
+ break;
+ case ':':
+ $this->_token = self::COLON;
+ break;
+ case '"':
+ $result = '';
+ do {
+ $i++;
+ if ($i >= $str_length) {
+ break;
+ }
+
+ $chr = $str[$i];
+
+ if ($chr == '\\') {
+ $i++;
+ if ($i >= $str_length) {
+ break;
+ }
+ $chr = $str[$i];
+ switch ($chr) {
+ case '"' :
+ $result .= '"';
+ break;
+ case '\\':
+ $result .= '\\';
+ break;
+ case '/' :
+ $result .= '/';
+ break;
+ case 'b' :
+ $result .= "\x08";
+ break;
+ case 'f' :
+ $result .= "\x0c";
+ break;
+ case 'n' :
+ $result .= "\x0a";
+ break;
+ case 'r' :
+ $result .= "\x0d";
+ break;
+ case 't' :
+ $result .= "\x09";
+ break;
+ case '\'' :
+ $result .= '\'';
+ break;
+ default:
+ throw new Zend_Json_Exception("Illegal escape "
+ . "sequence '" . $chr . "'");
+ }
+ } elseif($chr == '"') {
+ break;
+ } else {
+ $result .= $chr;
+ }
+ } while ($i < $str_length);
+
+ $this->_token = self::DATUM;
+ //$this->_tokenValue = substr($str, $start + 1, $i - $start - 1);
+ $this->_tokenValue = $result;
+ break;
+ case 't':
+ if (($i+ 3) < $str_length && substr($str, $start, 4) == "true") {
+ $this->_token = self::DATUM;
+ }
+ $this->_tokenValue = true;
+ $i += 3;
+ break;
+ case 'f':
+ if (($i+ 4) < $str_length && substr($str, $start, 5) == "false") {
+ $this->_token = self::DATUM;
+ }
+ $this->_tokenValue = false;
+ $i += 4;
+ break;
+ case 'n':
+ if (($i+ 3) < $str_length && substr($str, $start, 4) == "null") {
+ $this->_token = self::DATUM;
+ }
+ $this->_tokenValue = NULL;
+ $i += 3;
+ break;
+ }
+
+ if ($this->_token != self::EOF) {
+ $this->_offset = $i + 1; // Consume the last token character
+ return($this->_token);
+ }
+
+ $chr = $str[$i];
+ if ($chr == '-' || $chr == '.' || ($chr >= '0' && $chr <= '9')) {
+ if (preg_match('/-?([0-9])*(\.[0-9]*)?((e|E)((-|\+)?)[0-9]+)?/s',
+ $str, $matches, PREG_OFFSET_CAPTURE, $start) && $matches[0][1] == $start) {
+
+ $datum = $matches[0][0];
+
+ if (is_numeric($datum)) {
+ if (preg_match('/^0\d+$/', $datum)) {
+ throw new Zend_Json_Exception("Octal notation not supported by JSON (value: $datum)");
+ } else {
+ $val = intval($datum);
+ $fVal = floatval($datum);
+ $this->_tokenValue = ($val == $fVal ? $val : $fVal);
+ }
+ } else {
+ throw new Zend_Json_Exception("Illegal number format: $datum");
+ }
+
+ $this->_token = self::DATUM;
+ $this->_offset = $start + strlen($datum);
+ }
+ } else {
+ throw new Zend_Json_Exception('Illegal Token');
+ }
+
+ return($this->_token);
+ }
+
+ /**
+ * Decode Unicode Characters from \u0000 ASCII syntax.
+ *
+ * This algorithm was originally developed for the
+ * Solar Framework by Paul M. Jones
+ *
+ * @link http://solarphp.com/
+ * @link http://svn.solarphp.com/core/trunk/Solar/Json.php
+ * @param string $value
+ * @return string
+ */
+ public static function decodeUnicodeString($chrs)
+ {
+ $delim = substr($chrs, 0, 1);
+ $utf8 = '';
+ $strlen_chrs = strlen($chrs);
+
+ for($i = 0; $i < $strlen_chrs; $i++) {
+
+ $substr_chrs_c_2 = substr($chrs, $i, 2);
+ $ord_chrs_c = ord($chrs[$i]);
+
+ switch (true) {
+ case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $i, 6)):
+ // single, escaped unicode character
+ $utf16 = chr(hexdec(substr($chrs, ($i + 2), 2)))
+ . chr(hexdec(substr($chrs, ($i + 4), 2)));
+ $utf8 .= self::_utf162utf8($utf16);
+ $i += 5;
+ break;
+ case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):
+ $utf8 .= $chrs[$i];
+ break;
+ case ($ord_chrs_c & 0xE0) == 0xC0:
+ // characters U-00000080 - U-000007FF, mask 110XXXXX
+ //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $utf8 .= substr($chrs, $i, 2);
+ ++$i;
+ break;
+ case ($ord_chrs_c & 0xF0) == 0xE0:
+ // characters U-00000800 - U-0000FFFF, mask 1110XXXX
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $utf8 .= substr($chrs, $i, 3);
+ $i += 2;
+ break;
+ case ($ord_chrs_c & 0xF8) == 0xF0:
+ // characters U-00010000 - U-001FFFFF, mask 11110XXX
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $utf8 .= substr($chrs, $i, 4);
+ $i += 3;
+ break;
+ case ($ord_chrs_c & 0xFC) == 0xF8:
+ // characters U-00200000 - U-03FFFFFF, mask 111110XX
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $utf8 .= substr($chrs, $i, 5);
+ $i += 4;
+ break;
+ case ($ord_chrs_c & 0xFE) == 0xFC:
+ // characters U-04000000 - U-7FFFFFFF, mask 1111110X
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $utf8 .= substr($chrs, $i, 6);
+ $i += 5;
+ break;
+ }
+ }
+
+ return $utf8;
+ }
+
+ /**
+ * Convert a string from one UTF-16 char to one UTF-8 char.
+ *
+ * Normally should be handled by mb_convert_encoding, but
+ * provides a slower PHP-only method for installations
+ * that lack the multibye string extension.
+ *
+ * This method is from the Solar Framework by Paul M. Jones
+ *
+ * @link http://solarphp.com
+ * @param string $utf16 UTF-16 character
+ * @return string UTF-8 character
+ */
+ protected static function _utf162utf8($utf16)
+ {
+ // Check for mb extension otherwise do by hand.
+ if( function_exists('mb_convert_encoding') ) {
+ return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
+ }
+
+ $bytes = (ord($utf16[0]) << 8) | ord($utf16[1]);
+
+ switch (true) {
+ case ((0x7F & $bytes) == $bytes):
+ // this case should never be reached, because we are in ASCII range
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ return chr(0x7F & $bytes);
+
+ case (0x07FF & $bytes) == $bytes:
+ // return a 2-byte UTF-8 character
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ return chr(0xC0 | (($bytes >> 6) & 0x1F))
+ . chr(0x80 | ($bytes & 0x3F));
+
+ case (0xFFFF & $bytes) == $bytes:
+ // return a 3-byte UTF-8 character
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ return chr(0xE0 | (($bytes >> 12) & 0x0F))
+ . chr(0x80 | (($bytes >> 6) & 0x3F))
+ . chr(0x80 | ($bytes & 0x3F));
+ }
+
+ // ignoring UTF-32 for now, sorry
+ return '';
+ }
+}
+
diff --git a/library/vendor/Zend/Json/Encoder.php b/library/vendor/Zend/Json/Encoder.php
new file mode 100644
index 0000000..57acb35
--- /dev/null
+++ b/library/vendor/Zend/Json/Encoder.php
@@ -0,0 +1,576 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Json
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Encode PHP constructs to JSON
+ *
+ * @category Zend
+ * @package Zend_Json
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Json_Encoder
+{
+ /**
+ * Whether or not to check for possible cycling
+ *
+ * @var boolean
+ */
+ protected $_cycleCheck;
+
+ /**
+ * Additional options used during encoding
+ *
+ * @var array
+ */
+ protected $_options = array();
+
+ /**
+ * Array of visited objects; used to prevent cycling.
+ *
+ * @var array
+ */
+ protected $_visited = array();
+
+ /**
+ * Constructor
+ *
+ * @param boolean $cycleCheck Whether or not to check for recursion when encoding
+ * @param array $options Additional options used during encoding
+ * @return void
+ */
+ protected function __construct($cycleCheck = false, $options = array())
+ {
+ $this->_cycleCheck = $cycleCheck;
+ $this->_options = $options;
+ }
+
+ /**
+ * Use the JSON encoding scheme for the value specified
+ *
+ * @param mixed $value The value to be encoded
+ * @param boolean $cycleCheck Whether or not to check for possible object recursion when encoding
+ * @param array $options Additional options used during encoding
+ * @return string The encoded value
+ */
+ public static function encode($value, $cycleCheck = false, $options = array())
+ {
+ $encoder = new self(($cycleCheck) ? true : false, $options);
+ return $encoder->_encodeValue($value);
+ }
+
+ /**
+ * Recursive driver which determines the type of value to be encoded
+ * and then dispatches to the appropriate method. $values are either
+ * - objects (returns from {@link _encodeObject()})
+ * - arrays (returns from {@link _encodeArray()})
+ * - basic datums (e.g. numbers or strings) (returns from {@link _encodeDatum()})
+ *
+ * @param mixed $value The value to be encoded
+ * @return string Encoded value
+ */
+ protected function _encodeValue(&$value)
+ {
+ if (is_object($value)) {
+ return $this->_encodeObject($value);
+ } else if (is_array($value)) {
+ return $this->_encodeArray($value);
+ }
+
+ return $this->_encodeDatum($value);
+ }
+
+
+
+ /**
+ * Encode an object to JSON by encoding each of the public properties
+ *
+ * A special property is added to the JSON object called '__className'
+ * that contains the name of the class of $value. This is used to decode
+ * the object on the client into a specific class.
+ *
+ * @param object $value
+ * @return string
+ * @throws Zend_Json_Exception If recursive checks are enabled and the object has been serialized previously
+ */
+ protected function _encodeObject(&$value)
+ {
+ if ($this->_cycleCheck) {
+ if ($this->_wasVisited($value)) {
+
+ if (isset($this->_options['silenceCyclicalExceptions'])
+ && $this->_options['silenceCyclicalExceptions']===true) {
+
+ return '"* RECURSION (' . get_class($value) . ') *"';
+
+ } else {
+ throw new Zend_Json_Exception(
+ 'Cycles not supported in JSON encoding, cycle introduced by '
+ . 'class "' . get_class($value) . '"'
+ );
+ }
+ }
+
+ $this->_visited[] = $value;
+ }
+
+ $props = '';
+ if (method_exists($value, 'toJson')) {
+ $props =',' . preg_replace("/^\{(.*)\}$/","\\1",$value->toJson());
+ } else {
+ if ($value instanceof IteratorAggregate) {
+ $propCollection = $value->getIterator();
+ } elseif ($value instanceof Iterator) {
+ $propCollection = $value;
+ } else {
+ $propCollection = get_object_vars($value);
+ }
+
+ foreach ($propCollection as $name => $propValue) {
+ if (isset($propValue)) {
+ $props .= ','
+ . $this->_encodeString($name)
+ . ':'
+ . $this->_encodeValue($propValue);
+ }
+ }
+ }
+ $className = get_class($value);
+ return '{"__className":' . $this->_encodeString($className)
+ . $props . '}';
+ }
+
+
+ /**
+ * Determine if an object has been serialized already
+ *
+ * @param mixed $value
+ * @return boolean
+ */
+ protected function _wasVisited(&$value)
+ {
+ if (in_array($value, $this->_visited, true)) {
+ return true;
+ }
+
+ return false;
+ }
+
+
+ /**
+ * JSON encode an array value
+ *
+ * Recursively encodes each value of an array and returns a JSON encoded
+ * array string.
+ *
+ * Arrays are defined as integer-indexed arrays starting at index 0, where
+ * the last index is (count($array) -1); any deviation from that is
+ * considered an associative array, and will be encoded as such.
+ *
+ * @param array& $array
+ * @return string
+ */
+ protected function _encodeArray(&$array)
+ {
+ $tmpArray = array();
+
+ // Check for associative array
+ if (!empty($array) && (array_keys($array) !== range(0, count($array) - 1))) {
+ // Associative array
+ $result = '{';
+ foreach ($array as $key => $value) {
+ $key = (string) $key;
+ $tmpArray[] = $this->_encodeString($key)
+ . ':'
+ . $this->_encodeValue($value);
+ }
+ $result .= implode(',', $tmpArray);
+ $result .= '}';
+ } else {
+ // Indexed array
+ $result = '[';
+ $length = count($array);
+ for ($i = 0; $i < $length; $i++) {
+ $tmpArray[] = $this->_encodeValue($array[$i]);
+ }
+ $result .= implode(',', $tmpArray);
+ $result .= ']';
+ }
+
+ return $result;
+ }
+
+
+ /**
+ * JSON encode a basic data type (string, number, boolean, null)
+ *
+ * If value type is not a string, number, boolean, or null, the string
+ * 'null' is returned.
+ *
+ * @param mixed& $value
+ * @return string
+ */
+ protected function _encodeDatum(&$value)
+ {
+ $result = 'null';
+
+ if (is_int($value) || is_float($value)) {
+ $result = (string) $value;
+ $result = str_replace(",", ".", $result);
+ } elseif (is_string($value)) {
+ $result = $this->_encodeString($value);
+ } elseif (is_bool($value)) {
+ $result = $value ? 'true' : 'false';
+ }
+
+ return $result;
+ }
+
+
+ /**
+ * JSON encode a string value by escaping characters as necessary
+ *
+ * @param string& $value
+ * @return string
+ */
+ protected function _encodeString(&$string)
+ {
+ // Escape these characters with a backslash:
+ // " \ / \n \r \t \b \f
+ $search = array('\\', "\n", "\t", "\r", "\b", "\f", '"', '/');
+ $replace = array('\\\\', '\\n', '\\t', '\\r', '\\b', '\\f', '\"', '\\/');
+ $string = str_replace($search, $replace, $string);
+
+ // Escape certain ASCII characters:
+ // 0x08 => \b
+ // 0x0c => \f
+ $string = str_replace(array(chr(0x08), chr(0x0C)), array('\b', '\f'), $string);
+ $string = self::encodeUnicodeString($string);
+
+ return '"' . $string . '"';
+ }
+
+
+ /**
+ * Encode the constants associated with the ReflectionClass
+ * parameter. The encoding format is based on the class2 format
+ *
+ * @param ReflectionClass $cls
+ * @return string Encoded constant block in class2 format
+ */
+ private static function _encodeConstants(ReflectionClass $cls)
+ {
+ $result = "constants : {";
+ $constants = $cls->getConstants();
+
+ $tmpArray = array();
+ if (!empty($constants)) {
+ foreach ($constants as $key => $value) {
+ $tmpArray[] = "$key: " . self::encode($value);
+ }
+
+ $result .= implode(', ', $tmpArray);
+ }
+
+ return $result . "}";
+ }
+
+
+ /**
+ * Encode the public methods of the ReflectionClass in the
+ * class2 format
+ *
+ * @param ReflectionClass $cls
+ * @return string Encoded method fragment
+ *
+ */
+ private static function _encodeMethods(ReflectionClass $cls)
+ {
+ $methods = $cls->getMethods();
+ $result = 'methods:{';
+
+ $started = false;
+ foreach ($methods as $method) {
+ if (! $method->isPublic() || !$method->isUserDefined()) {
+ continue;
+ }
+
+ if ($started) {
+ $result .= ',';
+ }
+ $started = true;
+
+ $result .= '' . $method->getName(). ':function(';
+
+ if ('__construct' != $method->getName()) {
+ $parameters = $method->getParameters();
+ $paramCount = count($parameters);
+ $argsStarted = false;
+
+ $argNames = "var argNames=[";
+ foreach ($parameters as $param) {
+ if ($argsStarted) {
+ $result .= ',';
+ }
+
+ $result .= $param->getName();
+
+ if ($argsStarted) {
+ $argNames .= ',';
+ }
+
+ $argNames .= '"' . $param->getName() . '"';
+
+ $argsStarted = true;
+ }
+ $argNames .= "];";
+
+ $result .= "){"
+ . $argNames
+ . 'var result = ZAjaxEngine.invokeRemoteMethod('
+ . "this, '" . $method->getName()
+ . "',argNames,arguments);"
+ . 'return(result);}';
+ } else {
+ $result .= "){}";
+ }
+ }
+
+ return $result . "}";
+ }
+
+
+ /**
+ * Encode the public properties of the ReflectionClass in the class2
+ * format.
+ *
+ * @param ReflectionClass $cls
+ * @return string Encode properties list
+ *
+ */
+ private static function _encodeVariables(ReflectionClass $cls)
+ {
+ $properties = $cls->getProperties();
+ $propValues = get_class_vars($cls->getName());
+ $result = "variables:{";
+ $cnt = 0;
+
+ $tmpArray = array();
+ foreach ($properties as $prop) {
+ if (! $prop->isPublic()) {
+ continue;
+ }
+
+ $tmpArray[] = $prop->getName()
+ . ':'
+ . self::encode($propValues[$prop->getName()]);
+ }
+ $result .= implode(',', $tmpArray);
+
+ return $result . "}";
+ }
+
+ /**
+ * Encodes the given $className into the class2 model of encoding PHP
+ * classes into JavaScript class2 classes.
+ * NOTE: Currently only public methods and variables are proxied onto
+ * the client machine
+ *
+ * @param string $className The name of the class, the class must be
+ * instantiable using a null constructor
+ * @param string $package Optional package name appended to JavaScript
+ * proxy class name
+ * @return string The class2 (JavaScript) encoding of the class
+ * @throws Zend_Json_Exception
+ */
+ public static function encodeClass($className, $package = '')
+ {
+ $cls = new ReflectionClass($className);
+ if (! $cls->isInstantiable()) {
+ throw new Zend_Json_Exception("$className must be instantiable");
+ }
+
+ return "Class.create('$package$className',{"
+ . self::_encodeConstants($cls) .","
+ . self::_encodeMethods($cls) .","
+ . self::_encodeVariables($cls) .'});';
+ }
+
+
+ /**
+ * Encode several classes at once
+ *
+ * Returns JSON encoded classes, using {@link encodeClass()}.
+ *
+ * @param array $classNames
+ * @param string $package
+ * @return string
+ */
+ public static function encodeClasses(array $classNames, $package = '')
+ {
+ $result = '';
+ foreach ($classNames as $className) {
+ $result .= self::encodeClass($className, $package);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Encode Unicode Characters to \u0000 ASCII syntax.
+ *
+ * This algorithm was originally developed for the
+ * Solar Framework by Paul M. Jones
+ *
+ * @link http://solarphp.com/
+ * @link http://svn.solarphp.com/core/trunk/Solar/Json.php
+ * @param string $value
+ * @return string
+ */
+ public static function encodeUnicodeString($value)
+ {
+ $strlen_var = strlen($value);
+ $ascii = "";
+
+ /**
+ * Iterate over every character in the string,
+ * escaping with a slash or encoding to UTF-8 where necessary
+ */
+ for($i = 0; $i < $strlen_var; $i++) {
+ $ord_var_c = ord($value[$i]);
+
+ switch (true) {
+ case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)):
+ // characters U-00000000 - U-0000007F (same as ASCII)
+ $ascii .= $value[$i];
+ break;
+
+ case (($ord_var_c & 0xE0) == 0xC0):
+ // characters U-00000080 - U-000007FF, mask 110XXXXX
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $char = pack('C*', $ord_var_c, ord($value[$i + 1]));
+ $i += 1;
+ $utf16 = self::_utf82utf16($char);
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
+ break;
+
+ case (($ord_var_c & 0xF0) == 0xE0):
+ // characters U-00000800 - U-0000FFFF, mask 1110XXXX
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $char = pack('C*', $ord_var_c,
+ ord($value[$i + 1]),
+ ord($value[$i + 2]));
+ $i += 2;
+ $utf16 = self::_utf82utf16($char);
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
+ break;
+
+ case (($ord_var_c & 0xF8) == 0xF0):
+ // characters U-00010000 - U-001FFFFF, mask 11110XXX
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $char = pack('C*', $ord_var_c,
+ ord($value[$i + 1]),
+ ord($value[$i + 2]),
+ ord($value[$i + 3]));
+ $i += 3;
+ $utf16 = self::_utf82utf16($char);
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
+ break;
+
+ case (($ord_var_c & 0xFC) == 0xF8):
+ // characters U-00200000 - U-03FFFFFF, mask 111110XX
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $char = pack('C*', $ord_var_c,
+ ord($value[$i + 1]),
+ ord($value[$i + 2]),
+ ord($value[$i + 3]),
+ ord($value[$i + 4]));
+ $i += 4;
+ $utf16 = self::_utf82utf16($char);
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
+ break;
+
+ case (($ord_var_c & 0xFE) == 0xFC):
+ // characters U-04000000 - U-7FFFFFFF, mask 1111110X
+ // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ $char = pack('C*', $ord_var_c,
+ ord($value[$i + 1]),
+ ord($value[$i + 2]),
+ ord($value[$i + 3]),
+ ord($value[$i + 4]),
+ ord($value[$i + 5]));
+ $i += 5;
+ $utf16 = self::_utf82utf16($char);
+ $ascii .= sprintf('\u%04s', bin2hex($utf16));
+ break;
+ }
+ }
+
+ return $ascii;
+ }
+
+ /**
+ * Convert a string from one UTF-8 char to one UTF-16 char.
+ *
+ * Normally should be handled by mb_convert_encoding, but
+ * provides a slower PHP-only method for installations
+ * that lack the multibye string extension.
+ *
+ * This method is from the Solar Framework by Paul M. Jones
+ *
+ * @link http://solarphp.com
+ * @param string $utf8 UTF-8 character
+ * @return string UTF-16 character
+ */
+ protected static function _utf82utf16($utf8)
+ {
+ // Check for mb extension otherwise do by hand.
+ if( function_exists('mb_convert_encoding') ) {
+ return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');
+ }
+
+ switch (strlen($utf8)) {
+ case 1:
+ // this case should never be reached, because we are in ASCII range
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ return $utf8;
+
+ case 2:
+ // return a UTF-16 character from a 2-byte UTF-8 char
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ return chr(0x07 & (ord($utf8[0]) >> 2))
+ . chr((0xC0 & (ord($utf8[0]) << 6))
+ | (0x3F & ord($utf8[1])));
+
+ case 3:
+ // return a UTF-16 character from a 3-byte UTF-8 char
+ // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
+ return chr((0xF0 & (ord($utf8[0]) << 4))
+ | (0x0F & (ord($utf8[1]) >> 2)))
+ . chr((0xC0 & (ord($utf8[1]) << 6))
+ | (0x7F & ord($utf8[2])));
+ }
+
+ // ignoring UTF-32 for now, sorry
+ return '';
+ }
+}
+
diff --git a/library/vendor/Zend/Json/Exception.php b/library/vendor/Zend/Json/Exception.php
new file mode 100644
index 0000000..5b4a0db
--- /dev/null
+++ b/library/vendor/Zend/Json/Exception.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Json
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Zend_Exception
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Json
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Json_Exception extends Zend_Exception
+{}
+
diff --git a/library/vendor/Zend/Json/Expr.php b/library/vendor/Zend/Json/Expr.php
new file mode 100644
index 0000000..1fd5f23
--- /dev/null
+++ b/library/vendor/Zend/Json/Expr.php
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Json
+ * @subpackage Expr
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Class for Zend_Json encode method.
+ *
+ * This class simply holds a string with a native Javascript Expression,
+ * so objects | arrays to be encoded with Zend_Json can contain native
+ * Javascript Expressions.
+ *
+ * Example:
+ * <code>
+ * $foo = array(
+ * 'integer' =>9,
+ * 'string' =>'test string',
+ * 'function' => Zend_Json_Expr(
+ * 'function(){ window.alert("javascript function encoded by Zend_Json") }'
+ * ),
+ * );
+ *
+ * Zend_Json::encode($foo, false, array('enableJsonExprFinder' => true));
+ * // it will returns json encoded string:
+ * // {"integer":9,"string":"test string","function":function(){window.alert("javascript function encoded by Zend_Json")}}
+ * </code>
+ *
+ * @category Zend
+ * @package Zend_Json
+ * @subpackage Expr
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Json_Expr
+{
+ /**
+ * Storage for javascript expression.
+ *
+ * @var string
+ */
+ protected $_expression;
+
+ /**
+ * Constructor
+ *
+ * @param string $expression the expression to hold.
+ * @return void
+ */
+ public function __construct($expression)
+ {
+ $this->_expression = (string) $expression;
+ }
+
+ /**
+ * Cast to string
+ *
+ * @return string holded javascript expression.
+ */
+ public function __toString()
+ {
+ return $this->_expression;
+ }
+}
diff --git a/library/vendor/Zend/LICENSE.txt b/library/vendor/Zend/LICENSE.txt
new file mode 100644
index 0000000..6eab5aa
--- /dev/null
+++ b/library/vendor/Zend/LICENSE.txt
@@ -0,0 +1,27 @@
+Copyright (c) 2005-2015, Zend Technologies USA, Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+ * Neither the name of Zend Technologies USA, Inc. nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/library/vendor/Zend/Layout.php b/library/vendor/Zend/Layout.php
new file mode 100644
index 0000000..a123e44
--- /dev/null
+++ b/library/vendor/Zend/Layout.php
@@ -0,0 +1,788 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Layout
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Provide Layout support for MVC applications
+ *
+ * @category Zend
+ * @package Zend_Layout
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Layout
+{
+ /**
+ * Placeholder container for layout variables
+ * @var Zend_View_Helper_Placeholder_Container
+ */
+ protected $_container;
+
+ /**
+ * Key used to store content from 'default' named response segment
+ * @var string
+ */
+ protected $_contentKey = 'content';
+
+ /**
+ * Are layouts enabled?
+ * @var bool
+ */
+ protected $_enabled = true;
+
+ /**
+ * Helper class
+ * @var string
+ */
+ protected $_helperClass = 'Zend_Layout_Controller_Action_Helper_Layout';
+
+ /**
+ * Inflector used to resolve layout script
+ * @var Zend_Filter_Inflector
+ */
+ protected $_inflector;
+
+ /**
+ * Flag: is inflector enabled?
+ * @var bool
+ */
+ protected $_inflectorEnabled = true;
+
+ /**
+ * Inflector target
+ * @var string
+ */
+ protected $_inflectorTarget = ':script.:suffix';
+
+ /**
+ * Layout view
+ * @var string
+ */
+ protected $_layout = 'layout';
+
+ /**
+ * Layout view script path
+ * @var string
+ */
+ protected $_viewScriptPath = null;
+
+ protected $_viewBasePath = null;
+ protected $_viewBasePrefix = 'Layout_View';
+
+ /**
+ * Flag: is MVC integration enabled?
+ * @var bool
+ */
+ protected $_mvcEnabled = true;
+
+ /**
+ * Instance registered with MVC, if any
+ * @var Zend_Layout
+ */
+ protected static $_mvcInstance;
+
+ /**
+ * Flag: is MVC successful action only flag set?
+ * @var bool
+ */
+ protected $_mvcSuccessfulActionOnly = true;
+
+ /**
+ * Plugin class
+ * @var string
+ */
+ protected $_pluginClass = 'Zend_Layout_Controller_Plugin_Layout';
+
+ /**
+ * @var Zend_View_Interface
+ */
+ protected $_view;
+
+ /**
+ * View script suffix for layout script
+ * @var string
+ */
+ protected $_viewSuffix = 'phtml';
+
+ /**
+ * Constructor
+ *
+ * Accepts either:
+ * - A string path to layouts
+ * - An array of options
+ * - A Zend_Config object with options
+ *
+ * Layout script path, either as argument or as key in options, is
+ * required.
+ *
+ * If mvcEnabled flag is false from options, simply sets layout script path.
+ * Otherwise, also instantiates and registers action helper and controller
+ * plugin.
+ *
+ * @param string|array|Zend_Config $options
+ * @return void
+ */
+ public function __construct($options = null, $initMvc = false)
+ {
+ if (null !== $options) {
+ if (is_string($options)) {
+ $this->setLayoutPath($options);
+ } elseif (is_array($options)) {
+ $this->setOptions($options);
+ } elseif ($options instanceof Zend_Config) {
+ $this->setConfig($options);
+ } else {
+ throw new Zend_Layout_Exception('Invalid option provided to constructor');
+ }
+ }
+
+ $this->_initVarContainer();
+
+ if ($initMvc) {
+ $this->_setMvcEnabled(true);
+ $this->_initMvc();
+ } else {
+ $this->_setMvcEnabled(false);
+ }
+ }
+
+ /**
+ * Static method for initialization with MVC support
+ *
+ * @param string|array|Zend_Config $options
+ * @return Zend_Layout
+ */
+ public static function startMvc($options = null)
+ {
+ if (null === self::$_mvcInstance) {
+ self::$_mvcInstance = new self($options, true);
+ } else {
+ if (is_string($options)) {
+ self::$_mvcInstance->setLayoutPath($options);
+ } elseif (is_array($options) || $options instanceof Zend_Config) {
+ self::$_mvcInstance->setOptions($options);
+ }
+ }
+
+ return self::$_mvcInstance;
+ }
+
+ /**
+ * Retrieve MVC instance of Zend_Layout object
+ *
+ * @return Zend_Layout|null
+ */
+ public static function getMvcInstance()
+ {
+ return self::$_mvcInstance;
+ }
+
+ /**
+ * Reset MVC instance
+ *
+ * Unregisters plugins and helpers, and destroys MVC layout instance.
+ *
+ * @return void
+ */
+ public static function resetMvcInstance()
+ {
+ if (null !== self::$_mvcInstance) {
+ $layout = self::$_mvcInstance;
+ $pluginClass = $layout->getPluginClass();
+ $front = Zend_Controller_Front::getInstance();
+ if ($front->hasPlugin($pluginClass)) {
+ $front->unregisterPlugin($pluginClass);
+ }
+
+ if (Zend_Controller_Action_HelperBroker::hasHelper('layout')) {
+ Zend_Controller_Action_HelperBroker::removeHelper('layout');
+ }
+
+ unset($layout);
+ self::$_mvcInstance = null;
+ }
+ }
+
+ /**
+ * Set options en masse
+ *
+ * @param array|Zend_Config $options
+ * @return void
+ */
+ public function setOptions($options)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } elseif (!is_array($options)) {
+ throw new Zend_Layout_Exception('setOptions() expects either an array or a Zend_Config object');
+ }
+
+ foreach ($options as $key => $value) {
+ $method = 'set' . ucfirst($key);
+ if (method_exists($this, $method)) {
+ $this->$method($value);
+ }
+ }
+ }
+
+ /**
+ * Initialize MVC integration
+ *
+ * @return void
+ */
+ protected function _initMvc()
+ {
+ $this->_initPlugin();
+ $this->_initHelper();
+ }
+
+ /**
+ * Initialize front controller plugin
+ *
+ * @return void
+ */
+ protected function _initPlugin()
+ {
+ $pluginClass = $this->getPluginClass();
+ $front = Zend_Controller_Front::getInstance();
+ if (!$front->hasPlugin($pluginClass)) {
+ if (!class_exists($pluginClass)) {
+ Zend_Loader::loadClass($pluginClass);
+ }
+ $front->registerPlugin(
+ // register to run last | BUT before the ErrorHandler (if its available)
+ new $pluginClass($this),
+ 99
+ );
+ }
+ }
+
+ /**
+ * Initialize action helper
+ *
+ * @return void
+ */
+ protected function _initHelper()
+ {
+ $helperClass = $this->getHelperClass();
+ if (!Zend_Controller_Action_HelperBroker::hasHelper('layout')) {
+ if (!class_exists($helperClass)) {
+ Zend_Loader::loadClass($helperClass);
+ }
+ Zend_Controller_Action_HelperBroker::getStack()->offsetSet(-90, new $helperClass($this));
+ }
+ }
+
+ /**
+ * Set options from a config object
+ *
+ * @param Zend_Config $config
+ * @return Zend_Layout
+ */
+ public function setConfig(Zend_Config $config)
+ {
+ $this->setOptions($config->toArray());
+ return $this;
+ }
+
+ /**
+ * Initialize placeholder container for layout vars
+ *
+ * @return Zend_View_Helper_Placeholder_Container
+ */
+ protected function _initVarContainer()
+ {
+ if (null === $this->_container) {
+ $this->_container = Zend_View_Helper_Placeholder_Registry::getRegistry()->getContainer(__CLASS__);
+ }
+
+ return $this->_container;
+ }
+
+ /**
+ * Set layout script to use
+ *
+ * Note: enables layout by default, can be disabled
+ *
+ * @param string $name
+ * @param boolean $enabled
+ * @return Zend_Layout
+ */
+ public function setLayout($name, $enabled = true)
+ {
+ $this->_layout = (string) $name;
+ if ($enabled) {
+ $this->enableLayout();
+ }
+ return $this;
+ }
+
+ /**
+ * Get current layout script
+ *
+ * @return string
+ */
+ public function getLayout()
+ {
+ return $this->_layout;
+ }
+
+ /**
+ * Disable layout
+ *
+ * @return Zend_Layout
+ */
+ public function disableLayout()
+ {
+ $this->_enabled = false;
+ return $this;
+ }
+
+ /**
+ * Enable layout
+ *
+ * @return Zend_Layout
+ */
+ public function enableLayout()
+ {
+ $this->_enabled = true;
+ return $this;
+ }
+
+ /**
+ * Is layout enabled?
+ *
+ * @return bool
+ */
+ public function isEnabled()
+ {
+ return $this->_enabled;
+ }
+
+
+ public function setViewBasePath($path, $prefix = 'Layout_View')
+ {
+ $this->_viewBasePath = $path;
+ $this->_viewBasePrefix = $prefix;
+ return $this;
+ }
+
+ public function getViewBasePath()
+ {
+ return $this->_viewBasePath;
+ }
+
+ public function setViewScriptPath($path)
+ {
+ $this->_viewScriptPath = $path;
+ return $this;
+ }
+
+ public function getViewScriptPath()
+ {
+ return $this->_viewScriptPath;
+ }
+
+ /**
+ * Set layout script path
+ *
+ * @param string $path
+ * @return Zend_Layout
+ */
+ public function setLayoutPath($path)
+ {
+ return $this->setViewScriptPath($path);
+ }
+
+ /**
+ * Get current layout script path
+ *
+ * @return string
+ */
+ public function getLayoutPath()
+ {
+ return $this->getViewScriptPath();
+ }
+
+ /**
+ * Set content key
+ *
+ * Key in namespace container denoting default content
+ *
+ * @param string $contentKey
+ * @return Zend_Layout
+ */
+ public function setContentKey($contentKey)
+ {
+ $this->_contentKey = (string) $contentKey;
+ return $this;
+ }
+
+ /**
+ * Retrieve content key
+ *
+ * @return string
+ */
+ public function getContentKey()
+ {
+ return $this->_contentKey;
+ }
+
+ /**
+ * Set MVC enabled flag
+ *
+ * @param bool $mvcEnabled
+ * @return Zend_Layout
+ */
+ protected function _setMvcEnabled($mvcEnabled)
+ {
+ $this->_mvcEnabled = ($mvcEnabled) ? true : false;
+ return $this;
+ }
+
+ /**
+ * Retrieve MVC enabled flag
+ *
+ * @return bool
+ */
+ public function getMvcEnabled()
+ {
+ return $this->_mvcEnabled;
+ }
+
+ /**
+ * Set MVC Successful Action Only flag
+ *
+ * @param bool $successfulActionOnly
+ * @return Zend_Layout
+ */
+ public function setMvcSuccessfulActionOnly($successfulActionOnly)
+ {
+ $this->_mvcSuccessfulActionOnly = ($successfulActionOnly) ? true : false;
+ return $this;
+ }
+
+ /**
+ * Get MVC Successful Action Only Flag
+ *
+ * @return bool
+ */
+ public function getMvcSuccessfulActionOnly()
+ {
+ return $this->_mvcSuccessfulActionOnly;
+ }
+
+ /**
+ * Set view object
+ *
+ * @param Zend_View_Interface $view
+ * @return Zend_Layout
+ */
+ public function setView(Zend_View_Interface $view)
+ {
+ $this->_view = $view;
+ return $this;
+ }
+
+ /**
+ * Retrieve helper class
+ *
+ * @return string
+ */
+ public function getHelperClass()
+ {
+ return $this->_helperClass;
+ }
+
+ /**
+ * Set helper class
+ *
+ * @param string $helperClass
+ * @return Zend_Layout
+ */
+ public function setHelperClass($helperClass)
+ {
+ $this->_helperClass = (string) $helperClass;
+ return $this;
+ }
+
+ /**
+ * Retrieve plugin class
+ *
+ * @return string
+ */
+ public function getPluginClass()
+ {
+ return $this->_pluginClass;
+ }
+
+ /**
+ * Set plugin class
+ *
+ * @param string $pluginClass
+ * @return Zend_Layout
+ */
+ public function setPluginClass($pluginClass)
+ {
+ $this->_pluginClass = (string) $pluginClass;
+ return $this;
+ }
+
+ /**
+ * Get current view object
+ *
+ * If no view object currently set, retrieves it from the ViewRenderer.
+ *
+ * @todo Set inflector from view renderer at same time
+ * @return Zend_View_Interface
+ */
+ public function getView()
+ {
+ if (null === $this->_view) {
+ $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
+ if (null === $viewRenderer->view) {
+ $viewRenderer->initView();
+ }
+ $this->setView($viewRenderer->view);
+ }
+ return $this->_view;
+ }
+
+ /**
+ * Set layout view script suffix
+ *
+ * @param string $viewSuffix
+ * @return Zend_Layout
+ */
+ public function setViewSuffix($viewSuffix)
+ {
+ $this->_viewSuffix = (string) $viewSuffix;
+ return $this;
+ }
+
+ /**
+ * Retrieve layout view script suffix
+ *
+ * @return string
+ */
+ public function getViewSuffix()
+ {
+ return $this->_viewSuffix;
+ }
+
+ /**
+ * Retrieve inflector target
+ *
+ * @return string
+ */
+ public function getInflectorTarget()
+ {
+ return $this->_inflectorTarget;
+ }
+
+ /**
+ * Set inflector target
+ *
+ * @param string $inflectorTarget
+ * @return Zend_Layout
+ */
+ public function setInflectorTarget($inflectorTarget)
+ {
+ $this->_inflectorTarget = (string) $inflectorTarget;
+ return $this;
+ }
+
+ /**
+ * Set inflector to use when resolving layout names
+ *
+ * @param Zend_Filter_Inflector $inflector
+ * @return Zend_Layout
+ */
+ public function setInflector(Zend_Filter_Inflector $inflector)
+ {
+ $this->_inflector = $inflector;
+ return $this;
+ }
+
+ /**
+ * Retrieve inflector
+ *
+ * @return Zend_Filter_Inflector
+ */
+ public function getInflector()
+ {
+ if (null === $this->_inflector) {
+ $inflector = new Zend_Filter_Inflector();
+ $inflector->setTargetReference($this->_inflectorTarget)
+ ->addRules(array(':script' => array('Word_CamelCaseToDash', 'StringToLower')))
+ ->setStaticRuleReference('suffix', $this->_viewSuffix);
+ $this->setInflector($inflector);
+ }
+
+ return $this->_inflector;
+ }
+
+ /**
+ * Enable inflector
+ *
+ * @return Zend_Layout
+ */
+ public function enableInflector()
+ {
+ $this->_inflectorEnabled = true;
+ return $this;
+ }
+
+ /**
+ * Disable inflector
+ *
+ * @return Zend_Layout
+ */
+ public function disableInflector()
+ {
+ $this->_inflectorEnabled = false;
+ return $this;
+ }
+
+ /**
+ * Return status of inflector enabled flag
+ *
+ * @return bool
+ */
+ public function inflectorEnabled()
+ {
+ return $this->_inflectorEnabled;
+ }
+
+ /**
+ * Set layout variable
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return void
+ */
+ public function __set($key, $value)
+ {
+ $this->_container[$key] = $value;
+ }
+
+ /**
+ * Get layout variable
+ *
+ * @param string $key
+ * @return mixed
+ */
+ public function __get($key)
+ {
+ if (isset($this->_container[$key])) {
+ return $this->_container[$key];
+ }
+
+ return null;
+ }
+
+ /**
+ * Is a layout variable set?
+ *
+ * @param string $key
+ * @return bool
+ */
+ public function __isset($key)
+ {
+ return (isset($this->_container[$key]));
+ }
+
+ /**
+ * Unset a layout variable?
+ *
+ * @param string $key
+ * @return void
+ */
+ public function __unset($key)
+ {
+ if (isset($this->_container[$key])) {
+ unset($this->_container[$key]);
+ }
+ }
+
+ /**
+ * Assign one or more layout variables
+ *
+ * @param mixed $spec Assoc array or string key; if assoc array, sets each
+ * key as a layout variable
+ * @param mixed $value Value if $spec is a key
+ * @return Zend_Layout
+ * @throws Zend_Layout_Exception if non-array/string value passed to $spec
+ */
+ public function assign($spec, $value = null)
+ {
+ if (is_array($spec)) {
+ $orig = $this->_container->getArrayCopy();
+ $merged = array_merge($orig, $spec);
+ $this->_container->exchangeArray($merged);
+ return $this;
+ }
+
+ if (is_string($spec)) {
+ $this->_container[$spec] = $value;
+ return $this;
+ }
+
+ throw new Zend_Layout_Exception('Invalid values passed to assign()');
+ }
+
+ /**
+ * Render layout
+ *
+ * Sets internal script path as last path on script path stack, assigns
+ * layout variables to view, determines layout name using inflector, and
+ * renders layout view script.
+ *
+ * $name will be passed to the inflector as the key 'script'.
+ *
+ * @param mixed $name
+ * @return mixed
+ */
+ public function render($name = null)
+ {
+ if (null === $name) {
+ $name = $this->getLayout();
+ }
+
+ if ($this->inflectorEnabled() && (null !== ($inflector = $this->getInflector())))
+ {
+ $name = $this->_inflector->filter(array('script' => $name));
+ }
+
+ $view = $this->getView();
+
+ if (null !== ($path = $this->getViewScriptPath())) {
+ if (method_exists($view, 'addScriptPath')) {
+ $view->addScriptPath($path);
+ } else {
+ $view->setScriptPath($path);
+ }
+ } elseif (null !== ($path = $this->getViewBasePath())) {
+ $view->addBasePath($path, $this->_viewBasePrefix);
+ }
+
+ return $view->render($name);
+ }
+}
diff --git a/library/vendor/Zend/Layout/Controller/Action/Helper/Layout.php b/library/vendor/Zend/Layout/Controller/Action/Helper/Layout.php
new file mode 100644
index 0000000..cd3f48c
--- /dev/null
+++ b/library/vendor/Zend/Layout/Controller/Action/Helper/Layout.php
@@ -0,0 +1,181 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Controller_Action_Helper_Abstract */
+
+/**
+ * Helper for interacting with Zend_Layout objects
+ *
+ * @uses Zend_Controller_Action_Helper_Abstract
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Zend_Controller_Action
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Layout_Controller_Action_Helper_Layout extends Zend_Controller_Action_Helper_Abstract
+{
+ /**
+ * @var Zend_Controller_Front
+ */
+ protected $_frontController;
+
+ /**
+ * @var Zend_Layout
+ */
+ protected $_layout;
+
+ /**
+ * @var bool
+ */
+ protected $_isActionControllerSuccessful = false;
+
+ /**
+ * Constructor
+ *
+ * @param Zend_Layout $layout
+ * @return void
+ */
+ public function __construct(Zend_Layout $layout = null)
+ {
+ if (null !== $layout) {
+ $this->setLayoutInstance($layout);
+ } else {
+ /**
+ * @see Zend_Layout
+ */
+ $layout = Zend_Layout::getMvcInstance();
+ }
+
+ if (null !== $layout) {
+ $pluginClass = $layout->getPluginClass();
+ $front = $this->getFrontController();
+ if ($front->hasPlugin($pluginClass)) {
+ $plugin = $front->getPlugin($pluginClass);
+ $plugin->setLayoutActionHelper($this);
+ }
+ }
+ }
+
+ public function init()
+ {
+ $this->_isActionControllerSuccessful = false;
+ }
+
+ /**
+ * Get front controller instance
+ *
+ * @return Zend_Controller_Front
+ */
+ public function getFrontController()
+ {
+ if (null === $this->_frontController) {
+ /**
+ * @see Zend_Controller_Front
+ */
+ $this->_frontController = Zend_Controller_Front::getInstance();
+ }
+
+ return $this->_frontController;
+ }
+
+ /**
+ * Get layout object
+ *
+ * @return Zend_Layout
+ */
+ public function getLayoutInstance()
+ {
+ if (null === $this->_layout) {
+ /**
+ * @see Zend_Layout
+ */
+ if (null === ($this->_layout = Zend_Layout::getMvcInstance())) {
+ $this->_layout = new Zend_Layout();
+ }
+ }
+
+ return $this->_layout;
+ }
+
+ /**
+ * Set layout object
+ *
+ * @param Zend_Layout $layout
+ * @return Zend_Layout_Controller_Action_Helper_Layout
+ */
+ public function setLayoutInstance(Zend_Layout $layout)
+ {
+ $this->_layout = $layout;
+ return $this;
+ }
+
+ /**
+ * Mark Action Controller (according to this plugin) as Running successfully
+ *
+ * @return Zend_Layout_Controller_Action_Helper_Layout
+ */
+ public function postDispatch()
+ {
+ $this->_isActionControllerSuccessful = true;
+ return $this;
+ }
+
+ /**
+ * Did the previous action successfully complete?
+ *
+ * @return bool
+ */
+ public function isActionControllerSuccessful()
+ {
+ return $this->_isActionControllerSuccessful;
+ }
+
+ /**
+ * Strategy pattern; call object as method
+ *
+ * Returns layout object
+ *
+ * @return Zend_Layout
+ */
+ public function direct()
+ {
+ return $this->getLayoutInstance();
+ }
+
+ /**
+ * Proxy method calls to layout object
+ *
+ * @param string $method
+ * @param array $args
+ * @return mixed
+ */
+ public function __call($method, $args)
+ {
+ $layout = $this->getLayoutInstance();
+ if (method_exists($layout, $method)) {
+ return call_user_func_array(array($layout, $method), $args);
+ }
+
+ throw new Zend_Layout_Exception(sprintf("Invalid method '%s' called on layout action helper", $method));
+ }
+}
diff --git a/library/vendor/Zend/Layout/Controller/Plugin/Layout.php b/library/vendor/Zend/Layout/Controller/Plugin/Layout.php
new file mode 100644
index 0000000..d4855e7
--- /dev/null
+++ b/library/vendor/Zend/Layout/Controller/Plugin/Layout.php
@@ -0,0 +1,155 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Plugins
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Controller_Plugin_Abstract */
+
+/**
+ * Render layouts
+ *
+ * @uses Zend_Controller_Plugin_Abstract
+ * @category Zend
+ * @package Zend_Controller
+ * @subpackage Plugins
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Layout_Controller_Plugin_Layout extends Zend_Controller_Plugin_Abstract
+{
+ protected $_layoutActionHelper = null;
+
+ /**
+ * @var Zend_Layout
+ */
+ protected $_layout;
+
+ /**
+ * Constructor
+ *
+ * @param Zend_Layout $layout
+ * @return void
+ */
+ public function __construct(Zend_Layout $layout = null)
+ {
+ if (null !== $layout) {
+ $this->setLayout($layout);
+ }
+ }
+
+ /**
+ * Retrieve layout object
+ *
+ * @return Zend_Layout
+ */
+ public function getLayout()
+ {
+ return $this->_layout;
+ }
+
+ /**
+ * Set layout object
+ *
+ * @param Zend_Layout $layout
+ * @return Zend_Layout_Controller_Plugin_Layout
+ */
+ public function setLayout(Zend_Layout $layout)
+ {
+ $this->_layout = $layout;
+ return $this;
+ }
+
+ /**
+ * Set layout action helper
+ *
+ * @param Zend_Layout_Controller_Action_Helper_Layout $layoutActionHelper
+ * @return Zend_Layout_Controller_Plugin_Layout
+ */
+ public function setLayoutActionHelper(Zend_Layout_Controller_Action_Helper_Layout $layoutActionHelper)
+ {
+ $this->_layoutActionHelper = $layoutActionHelper;
+ return $this;
+ }
+
+ /**
+ * Retrieve layout action helper
+ *
+ * @return Zend_Layout_Controller_Action_Helper_Layout
+ */
+ public function getLayoutActionHelper()
+ {
+ return $this->_layoutActionHelper;
+ }
+
+ /**
+ * postDispatch() plugin hook -- render layout
+ *
+ * @param Zend_Controller_Request_Abstract $request
+ * @return void
+ */
+ public function postDispatch(Zend_Controller_Request_Abstract $request)
+ {
+ $layout = $this->getLayout();
+ $helper = $this->getLayoutActionHelper();
+
+ // Return early if forward detected
+ if (!$request->isDispatched()
+ || $this->getResponse()->isRedirect()
+ || ($layout->getMvcSuccessfulActionOnly()
+ && (!empty($helper) && !$helper->isActionControllerSuccessful())))
+ {
+ return;
+ }
+
+ // Return early if layout has been disabled
+ if (!$layout->isEnabled()) {
+ return;
+ }
+
+ $response = $this->getResponse();
+ $content = $response->getBody(true);
+ $contentKey = $layout->getContentKey();
+
+ if (isset($content['default'])) {
+ $content[$contentKey] = $content['default'];
+ }
+ if ('default' != $contentKey) {
+ unset($content['default']);
+ }
+
+ $layout->assign($content);
+
+ $fullContent = null;
+ $obStartLevel = ob_get_level();
+ try {
+ $fullContent = $layout->render();
+ $response->setBody($fullContent);
+ } catch (Exception $e) {
+ while (ob_get_level() > $obStartLevel) {
+ $fullContent .= ob_get_clean();
+ }
+ $request->setParam('layoutFullContent', $fullContent);
+ $request->setParam('layoutContent', $layout->content);
+ $response->setBody(null);
+ throw $e;
+ }
+
+ }
+}
diff --git a/library/vendor/Zend/Layout/Exception.php b/library/vendor/Zend/Layout/Exception.php
new file mode 100644
index 0000000..c589e1a
--- /dev/null
+++ b/library/vendor/Zend/Layout/Exception.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Layout
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/** Zend_Exception */
+
+
+/**
+ * @category Zend
+ * @package Zend_Layout
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Layout_Exception extends Zend_Exception
+{}
+
diff --git a/library/vendor/Zend/Loader.php b/library/vendor/Zend/Loader.php
new file mode 100644
index 0000000..2952e81
--- /dev/null
+++ b/library/vendor/Zend/Loader.php
@@ -0,0 +1,338 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Loader
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Static methods for loading classes and files.
+ *
+ * @category Zend
+ * @package Zend_Loader
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Loader
+{
+ /**
+ * Loads a class from a PHP file. The filename must be formatted
+ * as "$class.php".
+ *
+ * If $dirs is a string or an array, it will search the directories
+ * in the order supplied, and attempt to load the first matching file.
+ *
+ * If $dirs is null, it will split the class name at underscores to
+ * generate a path hierarchy (e.g., "Zend_Example_Class" will map
+ * to "Zend/Example/Class.php").
+ *
+ * If the file was not found in the $dirs, or if no $dirs were specified,
+ * it will attempt to load it from PHP's include_path.
+ *
+ * @param string $class - The full class name of a Zend component.
+ * @param string|array $dirs - OPTIONAL Either a path or an array of paths
+ * to search.
+ * @return void
+ * @throws Zend_Exception
+ */
+ public static function loadClass($class, $dirs = null)
+ {
+ if (class_exists($class, false) || interface_exists($class, false)) {
+ return;
+ }
+
+ if ((null !== $dirs) && !is_string($dirs) && !is_array($dirs)) {
+ throw new Zend_Exception('Directory argument must be a string or an array');
+ }
+
+ $file = self::standardiseFile($class);
+
+ if (!empty($dirs)) {
+ // use the autodiscovered path
+ $dirPath = dirname($file);
+ if (is_string($dirs)) {
+ $dirs = explode(PATH_SEPARATOR, $dirs);
+ }
+ foreach ($dirs as $key => $dir) {
+ if ($dir == '.') {
+ $dirs[$key] = $dirPath;
+ } else {
+ $dir = rtrim($dir, '\\/');
+ $dirs[$key] = $dir . DIRECTORY_SEPARATOR . $dirPath;
+ }
+ }
+ $file = basename($file);
+ self::loadFile($file, $dirs, true);
+ } else {
+ self::loadFile($file, null, true);
+ }
+
+ if (!class_exists($class, false) && !interface_exists($class, false)) {
+ throw new Zend_Exception("File \"$file\" does not exist or class \"$class\" was not found in the file");
+ }
+ }
+
+ /**
+ * Loads a PHP file. This is a wrapper for PHP's include() function.
+ *
+ * $filename must be the complete filename, including any
+ * extension such as ".php". Note that a security check is performed that
+ * does not permit extended characters in the filename. This method is
+ * intended for loading Zend Framework files.
+ *
+ * If $dirs is a string or an array, it will search the directories
+ * in the order supplied, and attempt to load the first matching file.
+ *
+ * If the file was not found in the $dirs, or if no $dirs were specified,
+ * it will attempt to load it from PHP's include_path.
+ *
+ * If $once is TRUE, it will use include_once() instead of include().
+ *
+ * @param string $filename
+ * @param string|array $dirs - OPTIONAL either a path or array of paths
+ * to search.
+ * @param boolean $once
+ * @return boolean
+ * @throws Zend_Exception
+ */
+ public static function loadFile($filename, $dirs = null, $once = false)
+ {
+ self::_securityCheck($filename);
+
+ /**
+ * Search in provided directories, as well as include_path
+ */
+ $incPath = false;
+ if (!empty($dirs) && (is_array($dirs) || is_string($dirs))) {
+ if (is_array($dirs)) {
+ $dirs = implode(PATH_SEPARATOR, $dirs);
+ }
+ $incPath = get_include_path();
+ set_include_path($dirs . PATH_SEPARATOR . $incPath);
+ }
+
+ /**
+ * Try finding for the plain filename in the include_path.
+ */
+ if ($once) {
+ include_once $filename;
+ } else {
+ include $filename;
+ }
+
+ /**
+ * If searching in directories, reset include_path
+ */
+ if ($incPath) {
+ set_include_path($incPath);
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns TRUE if the $filename is readable, or FALSE otherwise.
+ * This function uses the PHP include_path, where PHP's is_readable()
+ * does not.
+ *
+ * Note from ZF-2900:
+ * If you use custom error handler, please check whether return value
+ * from error_reporting() is zero or not.
+ * At mark of fopen() can not suppress warning if the handler is used.
+ *
+ * @param string $filename
+ * @return boolean
+ */
+ public static function isReadable($filename)
+ {
+ if (is_readable($filename)) {
+ // Return early if the filename is readable without needing the
+ // include_path
+ return true;
+ }
+
+ if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN'
+ && preg_match('/^[a-z]:/i', $filename)
+ ) {
+ // If on windows, and path provided is clearly an absolute path,
+ // return false immediately
+ return false;
+ }
+
+ foreach (self::explodeIncludePath() as $path) {
+ if ($path == '.') {
+ if (is_readable($filename)) {
+ return true;
+ }
+ continue;
+ }
+ $file = $path . '/' . $filename;
+ if (is_readable($file)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Explode an include path into an array
+ *
+ * If no path provided, uses current include_path. Works around issues that
+ * occur when the path includes stream schemas.
+ *
+ * @param string|null $path
+ * @return array
+ */
+ public static function explodeIncludePath($path = null)
+ {
+ if (null === $path) {
+ $path = get_include_path();
+ }
+
+ if (PATH_SEPARATOR == ':') {
+ // On *nix systems, include_paths which include paths with a stream
+ // schema cannot be safely explode'd, so we have to be a bit more
+ // intelligent in the approach.
+ $paths = preg_split('#:(?!//)#', $path);
+ } else {
+ $paths = explode(PATH_SEPARATOR, $path);
+ }
+ return $paths;
+ }
+
+ /**
+ * spl_autoload() suitable implementation for supporting class autoloading.
+ *
+ * Attach to spl_autoload() using the following:
+ * <code>
+ * spl_autoload_register(array('Zend_Loader', 'autoload'));
+ * </code>
+ *
+ * @deprecated Since 1.8.0
+ * @param string $class
+ * @return string|false Class name on success; false on failure
+ */
+ public static function autoload($class)
+ {
+ trigger_error(__CLASS__ . '::' . __METHOD__ . ' is deprecated as of 1.8.0 and will be removed with 2.0.0; use Zend_Loader_Autoloader instead', E_USER_NOTICE);
+ try {
+ @self::loadClass($class);
+ return $class;
+ } catch (Exception $e) {
+ return false;
+ }
+ }
+
+ /**
+ * Register {@link autoload()} with spl_autoload()
+ *
+ * @deprecated Since 1.8.0
+ * @param string $class (optional)
+ * @param boolean $enabled (optional)
+ * @return void
+ * @throws Zend_Exception if spl_autoload() is not found
+ * or if the specified class does not have an autoload() method.
+ */
+ public static function registerAutoload($class = 'Zend_Loader', $enabled = true)
+ {
+ trigger_error(__CLASS__ . '::' . __METHOD__ . ' is deprecated as of 1.8.0 and will be removed with 2.0.0; use Zend_Loader_Autoloader instead', E_USER_NOTICE);
+ $autoloader = Zend_Loader_Autoloader::getInstance();
+ $autoloader->setFallbackAutoloader(true);
+
+ if ('Zend_Loader' != $class) {
+ self::loadClass($class);
+ $methods = get_class_methods($class);
+ if (!in_array('autoload', (array) $methods)) {
+ throw new Zend_Exception("The class \"$class\" does not have an autoload() method");
+ }
+
+ $callback = array($class, 'autoload');
+
+ if ($enabled) {
+ $autoloader->pushAutoloader($callback);
+ } else {
+ $autoloader->removeAutoloader($callback);
+ }
+ }
+ }
+
+ /**
+ * Ensure that filename does not contain exploits
+ *
+ * @param string $filename
+ * @return void
+ * @throws Zend_Exception
+ */
+ protected static function _securityCheck($filename)
+ {
+ /**
+ * Security check
+ */
+ if (preg_match('/[^a-z0-9\\/\\\\_.:-]/i', $filename)) {
+ throw new Zend_Exception('Security check: Illegal character in filename');
+ }
+ }
+
+ /**
+ * Attempt to include() the file.
+ *
+ * include() is not prefixed with the @ operator because if
+ * the file is loaded and contains a parse error, execution
+ * will halt silently and this is difficult to debug.
+ *
+ * Always set display_errors = Off on production servers!
+ *
+ * @param string $filespec
+ * @param boolean $once
+ * @return boolean
+ * @deprecated Since 1.5.0; use loadFile() instead
+ */
+ protected static function _includeFile($filespec, $once = false)
+ {
+ if ($once) {
+ return include_once $filespec;
+ } else {
+ return include $filespec ;
+ }
+ }
+
+ /**
+ * Standardise the filename.
+ *
+ * Convert the supplied filename into the namespace-aware standard,
+ * based on the Framework Interop Group reference implementation:
+ * http://groups.google.com/group/php-standards/web/psr-0-final-proposal
+ *
+ * The filename must be formatted as "$file.php".
+ *
+ * @param string $file - The file name to be loaded.
+ * @return string
+ */
+ public static function standardiseFile($file)
+ {
+ $fileName = ltrim($file, '\\');
+ $file = '';
+ $namespace = '';
+ if ($lastNsPos = strripos($fileName, '\\')) {
+ $namespace = substr($fileName, 0, $lastNsPos);
+ $fileName = substr($fileName, $lastNsPos + 1);
+ $file = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
+ }
+ $file .= str_replace('_', DIRECTORY_SEPARATOR, $fileName) . '.php';
+ return $file;
+ }
+}
diff --git a/library/vendor/Zend/Loader/Autoloader.php b/library/vendor/Zend/Loader/Autoloader.php
new file mode 100644
index 0000000..06e7023
--- /dev/null
+++ b/library/vendor/Zend/Loader/Autoloader.php
@@ -0,0 +1,589 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Loader
+ * @subpackage Autoloader
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Loader */
+require_once 'Zend/Loader.php';
+
+/**
+ * Autoloader stack and namespace autoloader
+ *
+ * @uses Zend_Loader_Autoloader
+ * @package Zend_Loader
+ * @subpackage Autoloader
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Loader_Autoloader
+{
+ /**
+ * @var Zend_Loader_Autoloader Singleton instance
+ */
+ protected static $_instance;
+
+ /**
+ * @var array Concrete autoloader callback implementations
+ */
+ protected $_autoloaders = array();
+
+ /**
+ * @var array Default autoloader callback
+ */
+ protected $_defaultAutoloader = array('Zend_Loader', 'loadClass');
+
+ /**
+ * @var bool Whether or not to act as a fallback autoloader
+ */
+ protected $_fallbackAutoloader = false;
+
+ /**
+ * @var array Callback for internal autoloader implementation
+ */
+ protected $_internalAutoloader;
+
+ /**
+ * @var array Supported namespaces 'Zend' and 'ZendX' by default.
+ */
+ protected $_namespaces = array(
+ 'Zend_' => true,
+ 'ZendX_' => true,
+ );
+
+ /**
+ * @var array Namespace-specific autoloaders
+ */
+ protected $_namespaceAutoloaders = array();
+
+ /**
+ * @var bool Whether or not to suppress file not found warnings
+ */
+ protected $_suppressNotFoundWarnings = false;
+
+ /**
+ * @var null|string
+ */
+ protected $_zfPath;
+
+ /**
+ * Retrieve singleton instance
+ *
+ * @return Zend_Loader_Autoloader
+ */
+ public static function getInstance()
+ {
+ if (null === self::$_instance) {
+ self::$_instance = new self();
+ }
+ return self::$_instance;
+ }
+
+ /**
+ * Reset the singleton instance
+ *
+ * @return void
+ */
+ public static function resetInstance()
+ {
+ self::$_instance = null;
+ }
+
+ /**
+ * Autoload a class
+ *
+ * @param string $class
+ * @return bool
+ */
+ public static function autoload($class)
+ {
+ $self = self::getInstance();
+
+ foreach ($self->getClassAutoloaders($class) as $autoloader) {
+ if ($autoloader instanceof Zend_Loader_Autoloader_Interface) {
+ if ($autoloader->autoload($class)) {
+ return true;
+ }
+ } elseif (is_array($autoloader)) {
+ if (call_user_func($autoloader, $class)) {
+ return true;
+ }
+ } elseif (is_string($autoloader) || is_callable($autoloader)) {
+ if ($autoloader($class)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Set the default autoloader implementation
+ *
+ * @param string|array $callback PHP callback
+ * @return void
+ */
+ public function setDefaultAutoloader($callback)
+ {
+ if (!is_callable($callback)) {
+ throw new Zend_Loader_Exception('Invalid callback specified for default autoloader');
+ }
+
+ $this->_defaultAutoloader = $callback;
+ return $this;
+ }
+
+ /**
+ * Retrieve the default autoloader callback
+ *
+ * @return string|array PHP Callback
+ */
+ public function getDefaultAutoloader()
+ {
+ return $this->_defaultAutoloader;
+ }
+
+ /**
+ * Set several autoloader callbacks at once
+ *
+ * @param array $autoloaders Array of PHP callbacks (or Zend_Loader_Autoloader_Interface implementations) to act as autoloaders
+ * @return Zend_Loader_Autoloader
+ */
+ public function setAutoloaders(array $autoloaders)
+ {
+ $this->_autoloaders = $autoloaders;
+ return $this;
+ }
+
+ /**
+ * Get attached autoloader implementations
+ *
+ * @return array
+ */
+ public function getAutoloaders()
+ {
+ return $this->_autoloaders;
+ }
+
+ /**
+ * Return all autoloaders for a given namespace
+ *
+ * @param string $namespace
+ * @return array
+ */
+ public function getNamespaceAutoloaders($namespace)
+ {
+ $namespace = (string) $namespace;
+ if (!array_key_exists($namespace, $this->_namespaceAutoloaders)) {
+ return array();
+ }
+ return $this->_namespaceAutoloaders[$namespace];
+ }
+
+ /**
+ * Register a namespace to autoload
+ *
+ * @param string|array $namespace
+ * @return Zend_Loader_Autoloader
+ */
+ public function registerNamespace($namespace)
+ {
+ if (is_string($namespace)) {
+ $namespace = (array) $namespace;
+ } elseif (!is_array($namespace)) {
+ throw new Zend_Loader_Exception('Invalid namespace provided');
+ }
+
+ foreach ($namespace as $ns) {
+ if (!isset($this->_namespaces[$ns])) {
+ $this->_namespaces[$ns] = true;
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Unload a registered autoload namespace
+ *
+ * @param string|array $namespace
+ * @return Zend_Loader_Autoloader
+ */
+ public function unregisterNamespace($namespace)
+ {
+ if (is_string($namespace)) {
+ $namespace = (array) $namespace;
+ } elseif (!is_array($namespace)) {
+ throw new Zend_Loader_Exception('Invalid namespace provided');
+ }
+
+ foreach ($namespace as $ns) {
+ if (isset($this->_namespaces[$ns])) {
+ unset($this->_namespaces[$ns]);
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Get a list of registered autoload namespaces
+ *
+ * @return array
+ */
+ public function getRegisteredNamespaces()
+ {
+ return array_keys($this->_namespaces);
+ }
+
+ public function setZfPath($spec, $version = 'latest')
+ {
+ $path = $spec;
+ if (is_array($spec)) {
+ if (!isset($spec['path'])) {
+ throw new Zend_Loader_Exception('No path specified for ZF');
+ }
+ $path = $spec['path'];
+ if (isset($spec['version'])) {
+ $version = $spec['version'];
+ }
+ }
+
+ $this->_zfPath = $this->_getVersionPath($path, $version);
+ set_include_path(implode(PATH_SEPARATOR, array(
+ $this->_zfPath,
+ get_include_path(),
+ )));
+ return $this;
+ }
+
+ public function getZfPath()
+ {
+ return $this->_zfPath;
+ }
+
+ /**
+ * Get or set the value of the "suppress not found warnings" flag
+ *
+ * @param null|bool $flag
+ * @return bool|Zend_Loader_Autoloader Returns boolean if no argument is passed, object instance otherwise
+ */
+ public function suppressNotFoundWarnings($flag = null)
+ {
+ if (null === $flag) {
+ return $this->_suppressNotFoundWarnings;
+ }
+ $this->_suppressNotFoundWarnings = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Indicate whether or not this autoloader should be a fallback autoloader
+ *
+ * @param bool $flag
+ * @return Zend_Loader_Autoloader
+ */
+ public function setFallbackAutoloader($flag)
+ {
+ $this->_fallbackAutoloader = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Is this instance acting as a fallback autoloader?
+ *
+ * @return bool
+ */
+ public function isFallbackAutoloader()
+ {
+ return $this->_fallbackAutoloader;
+ }
+
+ /**
+ * Get autoloaders to use when matching class
+ *
+ * Determines if the class matches a registered namespace, and, if so,
+ * returns only the autoloaders for that namespace. Otherwise, it returns
+ * all non-namespaced autoloaders.
+ *
+ * @param string $class
+ * @return array Array of autoloaders to use
+ */
+ public function getClassAutoloaders($class)
+ {
+ $namespace = false;
+ $autoloaders = array();
+
+ // Add concrete namespaced autoloaders
+ foreach (array_keys($this->_namespaceAutoloaders) as $ns) {
+ if ('' == $ns) {
+ continue;
+ }
+ if (0 === strpos($class, $ns)) {
+ if ((false === $namespace) || (strlen($ns) > strlen($namespace))) {
+ $namespace = $ns;
+ $autoloaders = $this->getNamespaceAutoloaders($ns);
+ }
+ }
+ }
+
+ // Add internal namespaced autoloader
+ foreach ($this->getRegisteredNamespaces() as $ns) {
+ if (0 === strpos($class, $ns)) {
+ $namespace = $ns;
+ $autoloaders[] = $this->_internalAutoloader;
+ break;
+ }
+ }
+
+ // Add non-namespaced autoloaders
+ $autoloadersNonNamespace = $this->getNamespaceAutoloaders('');
+ if (count($autoloadersNonNamespace)) {
+ foreach ($autoloadersNonNamespace as $ns) {
+ $autoloaders[] = $ns;
+ }
+ unset($autoloadersNonNamespace);
+ }
+
+ // Add fallback autoloader
+ if (!$namespace && $this->isFallbackAutoloader()) {
+ $autoloaders[] = $this->_internalAutoloader;
+ }
+
+ return $autoloaders;
+ }
+
+ /**
+ * Add an autoloader to the beginning of the stack
+ *
+ * @param object|array|string $callback PHP callback or Zend_Loader_Autoloader_Interface implementation
+ * @param string|array $namespace Specific namespace(s) under which to register callback
+ * @return Zend_Loader_Autoloader
+ */
+ public function unshiftAutoloader($callback, $namespace = '')
+ {
+ $autoloaders = $this->getAutoloaders();
+ array_unshift($autoloaders, $callback);
+ $this->setAutoloaders($autoloaders);
+
+ $namespace = (array) $namespace;
+ foreach ($namespace as $ns) {
+ $autoloaders = $this->getNamespaceAutoloaders($ns);
+ array_unshift($autoloaders, $callback);
+ $this->_setNamespaceAutoloaders($autoloaders, $ns);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Append an autoloader to the autoloader stack
+ *
+ * @param object|array|string $callback PHP callback or Zend_Loader_Autoloader_Interface implementation
+ * @param string|array $namespace Specific namespace(s) under which to register callback
+ * @return Zend_Loader_Autoloader
+ */
+ public function pushAutoloader($callback, $namespace = '')
+ {
+ $autoloaders = $this->getAutoloaders();
+ array_push($autoloaders, $callback);
+ $this->setAutoloaders($autoloaders);
+
+ $namespace = (array) $namespace;
+ foreach ($namespace as $ns) {
+ $autoloaders = $this->getNamespaceAutoloaders($ns);
+ array_push($autoloaders, $callback);
+ $this->_setNamespaceAutoloaders($autoloaders, $ns);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Remove an autoloader from the autoloader stack
+ *
+ * @param object|array|string $callback PHP callback or Zend_Loader_Autoloader_Interface implementation
+ * @param null|string|array $namespace Specific namespace(s) from which to remove autoloader
+ * @return Zend_Loader_Autoloader
+ */
+ public function removeAutoloader($callback, $namespace = null)
+ {
+ if (null === $namespace) {
+ $autoloaders = $this->getAutoloaders();
+ if (false !== ($index = array_search($callback, $autoloaders, true))) {
+ unset($autoloaders[$index]);
+ $this->setAutoloaders($autoloaders);
+ }
+
+ foreach ($this->_namespaceAutoloaders as $ns => $autoloaders) {
+ if (false !== ($index = array_search($callback, $autoloaders, true))) {
+ unset($autoloaders[$index]);
+ $this->_setNamespaceAutoloaders($autoloaders, $ns);
+ }
+ }
+ } else {
+ $namespace = (array) $namespace;
+ foreach ($namespace as $ns) {
+ $autoloaders = $this->getNamespaceAutoloaders($ns);
+ if (false !== ($index = array_search($callback, $autoloaders, true))) {
+ unset($autoloaders[$index]);
+ $this->_setNamespaceAutoloaders($autoloaders, $ns);
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Constructor
+ *
+ * Registers instance with spl_autoload stack
+ *
+ * @return void
+ */
+ protected function __construct()
+ {
+ spl_autoload_register(array(__CLASS__, 'autoload'));
+ $this->_internalAutoloader = array($this, '_autoload');
+ }
+
+ /**
+ * Internal autoloader implementation
+ *
+ * @param string $class
+ * @return bool
+ */
+ protected function _autoload($class)
+ {
+ $callback = $this->getDefaultAutoloader();
+ try {
+ if ($this->suppressNotFoundWarnings()) {
+ @call_user_func($callback, $class);
+ } else {
+ call_user_func($callback, $class);
+ }
+ return $class;
+ } catch (Zend_Exception $e) {
+ return false;
+ }
+ }
+
+ /**
+ * Set autoloaders for a specific namespace
+ *
+ * @param array $autoloaders
+ * @param string $namespace
+ * @return Zend_Loader_Autoloader
+ */
+ protected function _setNamespaceAutoloaders(array $autoloaders, $namespace = '')
+ {
+ $namespace = (string) $namespace;
+ $this->_namespaceAutoloaders[$namespace] = $autoloaders;
+ return $this;
+ }
+
+ /**
+ * Retrieve the filesystem path for the requested ZF version
+ *
+ * @param string $path
+ * @param string $version
+ * @return void
+ */
+ protected function _getVersionPath($path, $version)
+ {
+ $type = $this->_getVersionType($version);
+
+ if ($type == 'latest') {
+ $version = 'latest';
+ }
+
+ $availableVersions = $this->_getAvailableVersions($path, $version);
+ if (empty($availableVersions)) {
+ throw new Zend_Loader_Exception('No valid ZF installations discovered');
+ }
+
+ $matchedVersion = array_pop($availableVersions);
+ return $matchedVersion;
+ }
+
+ /**
+ * Retrieve the ZF version type
+ *
+ * @param string $version
+ * @return string "latest", "major", "minor", or "specific"
+ * @throws Zend_Loader_Exception if version string contains too many dots
+ */
+ protected function _getVersionType($version)
+ {
+ if (strtolower($version) == 'latest') {
+ return 'latest';
+ }
+
+ $parts = explode('.', $version);
+ $count = count($parts);
+ if (1 == $count) {
+ return 'major';
+ }
+ if (2 == $count) {
+ return 'minor';
+ }
+ if (3 < $count) {
+ throw new Zend_Loader_Exception('Invalid version string provided');
+ }
+ return 'specific';
+ }
+
+ /**
+ * Get available versions for the version type requested
+ *
+ * @param string $path
+ * @param string $version
+ * @return array
+ */
+ protected function _getAvailableVersions($path, $version)
+ {
+ if (!is_dir($path)) {
+ throw new Zend_Loader_Exception('Invalid ZF path provided');
+ }
+
+ $path = rtrim($path, '/');
+ $path = rtrim($path, '\\');
+ $versionLen = strlen($version);
+ $versions = array();
+ $dirs = glob("$path/*", GLOB_ONLYDIR);
+ foreach ((array) $dirs as $dir) {
+ $dirName = substr($dir, strlen($path) + 1);
+ if (!preg_match('/^(?:ZendFramework-)?(\d+\.\d+\.\d+((a|b|pl|pr|p|rc)\d+)?)(?:-minimal)?$/i', $dirName, $matches)) {
+ continue;
+ }
+
+ $matchedVersion = $matches[1];
+
+ if (('latest' == $version)
+ || ((strlen($matchedVersion) >= $versionLen)
+ && (0 === strpos($matchedVersion, $version)))
+ ) {
+ $versions[$matchedVersion] = $dir . '/library';
+ }
+ }
+
+ uksort($versions, 'version_compare');
+ return $versions;
+ }
+}
diff --git a/library/vendor/Zend/Loader/Autoloader/Interface.php b/library/vendor/Zend/Loader/Autoloader/Interface.php
new file mode 100644
index 0000000..64985e2
--- /dev/null
+++ b/library/vendor/Zend/Loader/Autoloader/Interface.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Loader
+ * @subpackage Autoloader
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * Autoloader interface
+ *
+ * @package Zend_Loader
+ * @subpackage Autoloader
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Loader_Autoloader_Interface
+{
+ /**
+ * Autoload a class
+ *
+ * @abstract
+ * @param string $class
+ * @return mixed
+ * False [if unable to load $class]
+ * get_class($class) [if $class is successfully loaded]
+ */
+ public function autoload($class);
+}
diff --git a/library/vendor/Zend/Loader/Exception.php b/library/vendor/Zend/Loader/Exception.php
new file mode 100644
index 0000000..c170e21
--- /dev/null
+++ b/library/vendor/Zend/Loader/Exception.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Loader
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Exception
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Loader
+ * @uses Zend_Exception
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Loader_Exception extends Zend_Exception
+{}
diff --git a/library/vendor/Zend/Loader/Exception/InvalidArgumentException.php b/library/vendor/Zend/Loader/Exception/InvalidArgumentException.php
new file mode 100644
index 0000000..0c9e09b
--- /dev/null
+++ b/library/vendor/Zend/Loader/Exception/InvalidArgumentException.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Loader
+ * @subpackage Exception
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Loader
+ * @subpackage Exception
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Loader_Exception_InvalidArgumentException
+ extends Zend_Loader_Exception
+{
+}
diff --git a/library/vendor/Zend/Loader/PluginLoader.php b/library/vendor/Zend/Loader/PluginLoader.php
new file mode 100644
index 0000000..5e985b0
--- /dev/null
+++ b/library/vendor/Zend/Loader/PluginLoader.php
@@ -0,0 +1,497 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Loader
+ * @subpackage PluginLoader
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Loader_PluginLoader_Interface */
+
+/** Zend_Loader */
+
+/**
+ * Generic plugin class loader
+ *
+ * @category Zend
+ * @package Zend_Loader
+ * @subpackage PluginLoader
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Loader_PluginLoader implements Zend_Loader_PluginLoader_Interface
+{
+ /**
+ * Class map cache file
+ * @var string
+ */
+ protected static $_includeFileCache;
+
+ /**
+ * Class map cache file handler
+ * @var resource
+ */
+ protected static $_includeFileCacheHandler;
+
+ /**
+ * Instance loaded plugin paths
+ *
+ * @var array
+ */
+ protected $_loadedPluginPaths = array();
+
+ /**
+ * Instance loaded plugins
+ *
+ * @var array
+ */
+ protected $_loadedPlugins = array();
+
+ /**
+ * Instance registry property
+ *
+ * @var array
+ */
+ protected $_prefixToPaths = array();
+
+ /**
+ * Statically loaded plugin path mappings
+ *
+ * @var array
+ */
+ protected static $_staticLoadedPluginPaths = array();
+
+ /**
+ * Statically loaded plugins
+ *
+ * @var array
+ */
+ protected static $_staticLoadedPlugins = array();
+
+ /**
+ * Static registry property
+ *
+ * @var array
+ */
+ protected static $_staticPrefixToPaths = array();
+
+ /**
+ * Whether to use a statically named registry for loading plugins
+ *
+ * @var string|null
+ */
+ protected $_useStaticRegistry = null;
+
+ /**
+ * Constructor
+ *
+ * @param array $prefixToPaths
+ * @param string $staticRegistryName OPTIONAL
+ */
+ public function __construct(Array $prefixToPaths = array(), $staticRegistryName = null)
+ {
+ if (is_string($staticRegistryName) && !empty($staticRegistryName)) {
+ $this->_useStaticRegistry = $staticRegistryName;
+ if(!isset(self::$_staticPrefixToPaths[$staticRegistryName])) {
+ self::$_staticPrefixToPaths[$staticRegistryName] = array();
+ }
+ if(!isset(self::$_staticLoadedPlugins[$staticRegistryName])) {
+ self::$_staticLoadedPlugins[$staticRegistryName] = array();
+ }
+ }
+
+ foreach ($prefixToPaths as $prefix => $path) {
+ $this->addPrefixPath($prefix, $path);
+ }
+ }
+
+ /**
+ * Format prefix for internal use
+ *
+ * @param string $prefix
+ * @return string
+ */
+ protected function _formatPrefix($prefix)
+ {
+ if($prefix == "") {
+ return $prefix;
+ }
+
+ $nsSeparator = (false !== strpos($prefix, '\\'))?'\\':'_';
+ $prefix = rtrim($prefix, $nsSeparator) . $nsSeparator;
+ //if $nsSeprator == "\" and the prefix ends in "_\" remove trailing \
+ //https://github.com/zendframework/zf1/issues/152
+ if(($nsSeparator == "\\") && (substr($prefix,-2) == "_\\")) {
+ $prefix = substr($prefix, 0, -1);
+ }
+ return $prefix;
+ }
+
+ /**
+ * Add prefixed paths to the registry of paths
+ *
+ * @param string $prefix
+ * @param string $path
+ * @return Zend_Loader_PluginLoader
+ */
+ public function addPrefixPath($prefix, $path)
+ {
+ if (!is_string($prefix) || !is_string($path)) {
+ throw new Zend_Loader_PluginLoader_Exception('Zend_Loader_PluginLoader::addPrefixPath() method only takes strings for prefix and path.');
+ }
+
+ $prefix = $this->_formatPrefix($prefix);
+ $path = rtrim($path, '/\\') . '/';
+
+ if ($this->_useStaticRegistry) {
+ self::$_staticPrefixToPaths[$this->_useStaticRegistry][$prefix][] = $path;
+ } else {
+ if (!isset($this->_prefixToPaths[$prefix])) {
+ $this->_prefixToPaths[$prefix] = array();
+ }
+ if (!in_array($path, $this->_prefixToPaths[$prefix])) {
+ $this->_prefixToPaths[$prefix][] = $path;
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Get path stack
+ *
+ * @param string $prefix
+ * @return false|array False if prefix does not exist, array otherwise
+ */
+ public function getPaths($prefix = null)
+ {
+ if ((null !== $prefix) && is_string($prefix)) {
+ $prefix = $this->_formatPrefix($prefix);
+ if ($this->_useStaticRegistry) {
+ if (isset(self::$_staticPrefixToPaths[$this->_useStaticRegistry][$prefix])) {
+ return self::$_staticPrefixToPaths[$this->_useStaticRegistry][$prefix];
+ }
+
+ return false;
+ }
+
+ if (isset($this->_prefixToPaths[$prefix])) {
+ return $this->_prefixToPaths[$prefix];
+ }
+
+ return false;
+ }
+
+ if ($this->_useStaticRegistry) {
+ return self::$_staticPrefixToPaths[$this->_useStaticRegistry];
+ }
+
+ return $this->_prefixToPaths;
+ }
+
+ /**
+ * Clear path stack
+ *
+ * @param string $prefix
+ * @return bool False only if $prefix does not exist
+ */
+ public function clearPaths($prefix = null)
+ {
+ if ((null !== $prefix) && is_string($prefix)) {
+ $prefix = $this->_formatPrefix($prefix);
+ if ($this->_useStaticRegistry) {
+ if (isset(self::$_staticPrefixToPaths[$this->_useStaticRegistry][$prefix])) {
+ unset(self::$_staticPrefixToPaths[$this->_useStaticRegistry][$prefix]);
+ return true;
+ }
+
+ return false;
+ }
+
+ if (isset($this->_prefixToPaths[$prefix])) {
+ unset($this->_prefixToPaths[$prefix]);
+ return true;
+ }
+
+ return false;
+ }
+
+ if ($this->_useStaticRegistry) {
+ self::$_staticPrefixToPaths[$this->_useStaticRegistry] = array();
+ } else {
+ $this->_prefixToPaths = array();
+ }
+
+ return true;
+ }
+
+ /**
+ * Remove a prefix (or prefixed-path) from the registry
+ *
+ * @param string $prefix
+ * @param string $path OPTIONAL
+ * @return Zend_Loader_PluginLoader
+ */
+ public function removePrefixPath($prefix, $path = null)
+ {
+ $prefix = $this->_formatPrefix($prefix);
+ if ($this->_useStaticRegistry) {
+ $registry =& self::$_staticPrefixToPaths[$this->_useStaticRegistry];
+ } else {
+ $registry =& $this->_prefixToPaths;
+ }
+
+ if (!isset($registry[$prefix])) {
+ throw new Zend_Loader_PluginLoader_Exception('Prefix ' . $prefix . ' was not found in the PluginLoader.');
+ }
+
+ if ($path != null) {
+ $pos = array_search($path, $registry[$prefix]);
+ if (false === $pos) {
+ throw new Zend_Loader_PluginLoader_Exception('Prefix ' . $prefix . ' / Path ' . $path . ' was not found in the PluginLoader.');
+ }
+ unset($registry[$prefix][$pos]);
+ } else {
+ unset($registry[$prefix]);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Normalize plugin name
+ *
+ * @param string $name
+ * @return string
+ */
+ protected function _formatName($name)
+ {
+ return ucfirst((string) $name);
+ }
+
+ /**
+ * Whether or not a Plugin by a specific name is loaded
+ *
+ * @param string $name
+ * @return Zend_Loader_PluginLoader
+ */
+ public function isLoaded($name)
+ {
+ $name = $this->_formatName($name);
+ if ($this->_useStaticRegistry) {
+ return isset(self::$_staticLoadedPlugins[$this->_useStaticRegistry][$name]);
+ }
+
+ return isset($this->_loadedPlugins[$name]);
+ }
+
+ /**
+ * Return full class name for a named plugin
+ *
+ * @param string $name
+ * @return string|false False if class not found, class name otherwise
+ */
+ public function getClassName($name)
+ {
+ $name = $this->_formatName($name);
+ if ($this->_useStaticRegistry
+ && isset(self::$_staticLoadedPlugins[$this->_useStaticRegistry][$name])
+ ) {
+ return self::$_staticLoadedPlugins[$this->_useStaticRegistry][$name];
+ } elseif (isset($this->_loadedPlugins[$name])) {
+ return $this->_loadedPlugins[$name];
+ }
+
+ return false;
+ }
+
+ /**
+ * Get path to plugin class
+ *
+ * @param mixed $name
+ * @return string|false False if not found
+ */
+ public function getClassPath($name)
+ {
+ $name = $this->_formatName($name);
+ if ($this->_useStaticRegistry
+ && !empty(self::$_staticLoadedPluginPaths[$this->_useStaticRegistry][$name])
+ ) {
+ return self::$_staticLoadedPluginPaths[$this->_useStaticRegistry][$name];
+ } elseif (!empty($this->_loadedPluginPaths[$name])) {
+ return $this->_loadedPluginPaths[$name];
+ }
+
+ if ($this->isLoaded($name)) {
+ $class = $this->getClassName($name);
+ $r = new ReflectionClass($class);
+ $path = $r->getFileName();
+ if ($this->_useStaticRegistry) {
+ self::$_staticLoadedPluginPaths[$this->_useStaticRegistry][$name] = $path;
+ } else {
+ $this->_loadedPluginPaths[$name] = $path;
+ }
+ return $path;
+ }
+
+ return false;
+ }
+
+ /**
+ * Load a plugin via the name provided
+ *
+ * @param string $name
+ * @param bool $throwExceptions Whether or not to throw exceptions if the
+ * class is not resolved
+ * @return string|false Class name of loaded class; false if $throwExceptions
+ * if false and no class found
+ * @throws Zend_Loader_Exception if class not found
+ */
+ public function load($name, $throwExceptions = true)
+ {
+ $name = $this->_formatName($name);
+ if ($this->isLoaded($name)) {
+ return $this->getClassName($name);
+ }
+
+ if ($this->_useStaticRegistry) {
+ $registry = self::$_staticPrefixToPaths[$this->_useStaticRegistry];
+ } else {
+ $registry = $this->_prefixToPaths;
+ }
+
+ $registry = array_reverse($registry, true);
+ $found = false;
+ if (false !== strpos($name, '\\')) {
+ $classFile = str_replace('\\', DIRECTORY_SEPARATOR, $name) . '.php';
+ } else {
+ $classFile = str_replace('_', DIRECTORY_SEPARATOR, $name) . '.php';
+ }
+ $incFile = self::getIncludeFileCache();
+ foreach ($registry as $prefix => $paths) {
+ $className = $prefix . $name;
+
+ if (class_exists($className, false)) {
+ $found = true;
+ break;
+ }
+
+ $paths = array_reverse($paths, true);
+
+ foreach ($paths as $path) {
+ $loadFile = $path . $classFile;
+ if (Zend_Loader::isReadable($loadFile)) {
+ include_once $loadFile;
+ if (class_exists($className, false)) {
+ if (null !== $incFile) {
+ self::_appendIncFile($loadFile);
+ }
+ $found = true;
+ break 2;
+ }
+ }
+ }
+ }
+
+ if (!$found) {
+ if (!$throwExceptions) {
+ return false;
+ }
+
+ $message = "Plugin by name '$name' was not found in the registry; used paths:";
+ foreach ($registry as $prefix => $paths) {
+ $message .= "\n$prefix: " . implode(PATH_SEPARATOR, $paths);
+ }
+ throw new Zend_Loader_PluginLoader_Exception($message);
+ }
+
+ if ($this->_useStaticRegistry) {
+ self::$_staticLoadedPlugins[$this->_useStaticRegistry][$name] = $className;
+ } else {
+ $this->_loadedPlugins[$name] = $className;
+ }
+ return $className;
+ }
+
+ /**
+ * Set path to class file cache
+ *
+ * Specify a path to a file that will add include_once statements for each
+ * plugin class loaded. This is an opt-in feature for performance purposes.
+ *
+ * @param string $file
+ * @return void
+ * @throws Zend_Loader_PluginLoader_Exception if file is not writeable or path does not exist
+ */
+ public static function setIncludeFileCache($file)
+ {
+ if (!empty(self::$_includeFileCacheHandler)) {
+ flock(self::$_includeFileCacheHandler, LOCK_UN);
+ fclose(self::$_includeFileCacheHandler);
+ }
+
+ self::$_includeFileCacheHandler = null;
+
+ if (null === $file) {
+ self::$_includeFileCache = null;
+ return;
+ }
+
+ if (!file_exists($file) && !file_exists(dirname($file))) {
+ throw new Zend_Loader_PluginLoader_Exception('Specified file does not exist and/or directory does not exist (' . $file . ')');
+ }
+ if (file_exists($file) && !is_writable($file)) {
+ throw new Zend_Loader_PluginLoader_Exception('Specified file is not writeable (' . $file . ')');
+ }
+ if (!file_exists($file) && file_exists(dirname($file)) && !is_writable(dirname($file))) {
+ throw new Zend_Loader_PluginLoader_Exception('Specified file is not writeable (' . $file . ')');
+ }
+
+ self::$_includeFileCache = $file;
+ }
+
+ /**
+ * Retrieve class file cache path
+ *
+ * @return string|null
+ */
+ public static function getIncludeFileCache()
+ {
+ return self::$_includeFileCache;
+ }
+
+ /**
+ * Append an include_once statement to the class file cache
+ *
+ * @param string $incFile
+ * @return void
+ */
+ protected static function _appendIncFile($incFile)
+ {
+ if (!isset(self::$_includeFileCacheHandler)) {
+ self::$_includeFileCacheHandler = fopen(self::$_includeFileCache, 'ab');
+
+ if (!flock(self::$_includeFileCacheHandler, LOCK_EX | LOCK_NB, $wouldBlock) || $wouldBlock) {
+ self::$_includeFileCacheHandler = false;
+ }
+ }
+
+ if (false !== self::$_includeFileCacheHandler) {
+ $line = "<?php include_once '$incFile'?>\n";
+ fwrite(self::$_includeFileCacheHandler, $line, strlen($line));
+ }
+ }
+}
diff --git a/library/vendor/Zend/Loader/PluginLoader/Exception.php b/library/vendor/Zend/Loader/PluginLoader/Exception.php
new file mode 100644
index 0000000..3138391
--- /dev/null
+++ b/library/vendor/Zend/Loader/PluginLoader/Exception.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Loader
+ * @subpackage PluginLoader
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Loader_Exception
+ */
+
+/**
+ * Plugin class loader exceptions
+ *
+ * @category Zend
+ * @package Zend_Loader
+ * @subpackage PluginLoader
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Loader_PluginLoader_Exception extends Zend_Loader_Exception
+{
+}
diff --git a/library/vendor/Zend/Loader/PluginLoader/Interface.php b/library/vendor/Zend/Loader/PluginLoader/Interface.php
new file mode 100644
index 0000000..2733191
--- /dev/null
+++ b/library/vendor/Zend/Loader/PluginLoader/Interface.php
@@ -0,0 +1,75 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Loader
+ * @subpackage PluginLoader
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Plugin class loader interface
+ *
+ * @category Zend
+ * @package Zend_Loader
+ * @subpackage PluginLoader
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Loader_PluginLoader_Interface
+{
+ /**
+ * Add prefixed paths to the registry of paths
+ *
+ * @param string $prefix
+ * @param string $path
+ * @return Zend_Loader_PluginLoader
+ */
+ public function addPrefixPath($prefix, $path);
+
+ /**
+ * Remove a prefix (or prefixed-path) from the registry
+ *
+ * @param string $prefix
+ * @param string $path OPTIONAL
+ * @return Zend_Loader_PluginLoader
+ */
+ public function removePrefixPath($prefix, $path = null);
+
+ /**
+ * Whether or not a Helper by a specific name
+ *
+ * @param string $name
+ * @return Zend_Loader_PluginLoader
+ */
+ public function isLoaded($name);
+
+ /**
+ * Return full class name for a named helper
+ *
+ * @param string $name
+ * @return string
+ */
+ public function getClassName($name);
+
+ /**
+ * Load a helper via the name provided
+ *
+ * @param string $name
+ * @return string
+ */
+ public function load($name);
+}
diff --git a/library/vendor/Zend/Locale.php b/library/vendor/Zend/Locale.php
new file mode 100644
index 0000000..94a77b3
--- /dev/null
+++ b/library/vendor/Zend/Locale.php
@@ -0,0 +1,1996 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Locale
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Base class for localization
+ *
+ * @category Zend
+ * @package Zend_Locale
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Locale
+{
+ /**
+ * List of locales that are no longer part of CLDR along with a
+ * mapping to an appropriate alternative.
+ *
+ * @var array
+ */
+ private static $_localeAliases = array(
+ 'az_AZ' => 'az_Latn_AZ',
+ 'bs_BA' => 'bs_Latn_BA',
+ 'ha_GH' => 'ha_Latn_GH',
+ 'ha_NE' => 'ha_Latn_NE',
+ 'ha_NG' => 'ha_Latn_NG',
+ 'kk_KZ' => 'kk_Cyrl_KZ',
+ 'ks_IN' => 'ks_Arab_IN',
+ 'mn_MN' => 'mn_Cyrl_MN',
+ 'ms_BN' => 'ms_Latn_BN',
+ 'ms_MY' => 'ms_Latn_MY',
+ 'ms_SG' => 'ms_Latn_SG',
+ 'pa_IN' => 'pa_Guru_IN',
+ 'pa_PK' => 'pa_Arab_PK',
+ 'shi_MA' => 'shi_Latn_MA',
+ 'sr_BA' => 'sr_Latn_BA',
+ 'sr_ME' => 'sr_Latn_ME',
+ 'sr_RS' => 'sr_Latn_RS',
+ 'sr_XK' => 'sr_Latn_XK',
+ 'tg_TJ' => 'tg_Cyrl_TJ',
+ 'tzm_MA' => 'tzm_Latn_MA',
+ 'uz_AF' => 'uz_Arab_AF',
+ 'uz_UZ' => 'uz_Latn_UZ',
+ 'vai_LR' => 'vai_Latn_LR',
+ 'zh_CN' => 'zh_Hans_CN',
+ 'zh_HK' => 'zh_Hant_HK',
+ 'zh_MO' => 'zh_Hans_MO',
+ 'zh_SG' => 'zh_Hans_SG',
+ 'zh_TW' => 'zh_Hant_TW',
+ );
+
+ /**
+ * Class wide Locale Constants
+ *
+ * @var array $_localeData
+ */
+ private static $_localeData = array(
+ 'root' => true,
+ 'aa' => true,
+ 'aa_DJ' => true,
+ 'aa_ER' => true,
+ 'aa_ET' => true,
+ 'af' => true,
+ 'af_NA' => true,
+ 'af_ZA' => true,
+ 'agq' => true,
+ 'agq_CM' => true,
+ 'ak' => true,
+ 'ak_GH' => true,
+ 'am' => true,
+ 'am_ET' => true,
+ 'ar' => true,
+ 'ar_001' => true,
+ 'ar_AE' => true,
+ 'ar_BH' => true,
+ 'ar_DJ' => true,
+ 'ar_DZ' => true,
+ 'ar_EG' => true,
+ 'ar_EH' => true,
+ 'ar_ER' => true,
+ 'ar_IL' => true,
+ 'ar_IQ' => true,
+ 'ar_JO' => true,
+ 'ar_KM' => true,
+ 'ar_KW' => true,
+ 'ar_LB' => true,
+ 'ar_LY' => true,
+ 'ar_MA' => true,
+ 'ar_MR' => true,
+ 'ar_OM' => true,
+ 'ar_PS' => true,
+ 'ar_QA' => true,
+ 'ar_SA' => true,
+ 'ar_SD' => true,
+ 'ar_SO' => true,
+ 'ar_SS' => true,
+ 'ar_SY' => true,
+ 'ar_TD' => true,
+ 'ar_TN' => true,
+ 'ar_YE' => true,
+ 'as' => true,
+ 'as_IN' => true,
+ 'asa' => true,
+ 'asa_TZ' => true,
+ 'ast' => true,
+ 'ast_ES' => true,
+ 'az' => true,
+ 'az_Cyrl' => true,
+ 'az_Cyrl_AZ' => true,
+ 'az_Latn' => true,
+ 'az_Latn_AZ' => true,
+ 'bas' => true,
+ 'bas_CM' => true,
+ 'be' => true,
+ 'be_BY' => true,
+ 'bem' => true,
+ 'bem_ZM' => true,
+ 'bez' => true,
+ 'bez_TZ' => true,
+ 'bg' => true,
+ 'bg_BG' => true,
+ 'bm' => true,
+ 'bm_ML' => true,
+ 'bn' => true,
+ 'bn_BD' => true,
+ 'bn_IN' => true,
+ 'bo' => true,
+ 'bo_CN' => true,
+ 'bo_IN' => true,
+ 'br' => true,
+ 'br_FR' => true,
+ 'brx' => true,
+ 'brx_IN' => true,
+ 'bs' => true,
+ 'bs_Cyrl' => true,
+ 'bs_Cyrl_BA' => true,
+ 'bs_Latn' => true,
+ 'bs_Latn_BA' => true,
+ 'byn' => true,
+ 'byn_ER' => true,
+ 'ca' => true,
+ 'ca_AD' => true,
+ 'ca_ES' => true,
+ 'ca_ES_VALENCIA' => true,
+ 'ca_FR' => true,
+ 'ca_IT' => true,
+ 'cgg' => true,
+ 'cgg_UG' => true,
+ 'chr' => true,
+ 'chr_US' => true,
+ 'cs' => true,
+ 'cs_CZ' => true,
+ 'cy' => true,
+ 'cy_GB' => true,
+ 'da' => true,
+ 'da_DK' => true,
+ 'da_GL' => true,
+ 'dav' => true,
+ 'dav_KE' => true,
+ 'de' => true,
+ 'de_AT' => true,
+ 'de_BE' => true,
+ 'de_CH' => true,
+ 'de_DE' => true,
+ 'de_LI' => true,
+ 'de_LU' => true,
+ 'dje' => true,
+ 'dje_NE' => true,
+ 'dua' => true,
+ 'dua_CM' => true,
+ 'dyo' => true,
+ 'dyo_SN' => true,
+ 'dz' => true,
+ 'dz_BT' => true,
+ 'ebu' => true,
+ 'ebu_KE' => true,
+ 'ee' => true,
+ 'ee_GH' => true,
+ 'ee_TG' => true,
+ 'el' => true,
+ 'el_CY' => true,
+ 'el_GR' => true,
+ 'en' => true,
+ 'en_001' => true,
+ 'en_150' => true,
+ 'en_AG' => true,
+ 'en_AI' => true,
+ 'en_AS' => true,
+ 'en_AU' => true,
+ 'en_BB' => true,
+ 'en_BE' => true,
+ 'en_BM' => true,
+ 'en_BS' => true,
+ 'en_BW' => true,
+ 'en_BZ' => true,
+ 'en_CA' => true,
+ 'en_CC' => true,
+ 'en_CK' => true,
+ 'en_CM' => true,
+ 'en_CX' => true,
+ 'en_DG' => true,
+ 'en_DM' => true,
+ 'en_Dsrt' => true,
+ 'en_Dsrt_US' => true,
+ 'en_ER' => true,
+ 'en_FJ' => true,
+ 'en_FK' => true,
+ 'en_FM' => true,
+ 'en_GB' => true,
+ 'en_GD' => true,
+ 'en_GG' => true,
+ 'en_GH' => true,
+ 'en_GI' => true,
+ 'en_GM' => true,
+ 'en_GU' => true,
+ 'en_GY' => true,
+ 'en_HK' => true,
+ 'en_IE' => true,
+ 'en_IM' => true,
+ 'en_IN' => true,
+ 'en_IO' => true,
+ 'en_JE' => true,
+ 'en_JM' => true,
+ 'en_KE' => true,
+ 'en_KI' => true,
+ 'en_KN' => true,
+ 'en_KY' => true,
+ 'en_LC' => true,
+ 'en_LR' => true,
+ 'en_LS' => true,
+ 'en_MG' => true,
+ 'en_MH' => true,
+ 'en_MO' => true,
+ 'en_MP' => true,
+ 'en_MS' => true,
+ 'en_MT' => true,
+ 'en_MU' => true,
+ 'en_MW' => true,
+ 'en_NA' => true,
+ 'en_NF' => true,
+ 'en_NG' => true,
+ 'en_NR' => true,
+ 'en_NU' => true,
+ 'en_NZ' => true,
+ 'en_PG' => true,
+ 'en_PH' => true,
+ 'en_PK' => true,
+ 'en_PN' => true,
+ 'en_PR' => true,
+ 'en_PW' => true,
+ 'en_RW' => true,
+ 'en_SB' => true,
+ 'en_SC' => true,
+ 'en_SD' => true,
+ 'en_SG' => true,
+ 'en_SH' => true,
+ 'en_SL' => true,
+ 'en_SS' => true,
+ 'en_SX' => true,
+ 'en_SZ' => true,
+ 'en_TC' => true,
+ 'en_TK' => true,
+ 'en_TO' => true,
+ 'en_TT' => true,
+ 'en_TV' => true,
+ 'en_TZ' => true,
+ 'en_UG' => true,
+ 'en_UM' => true,
+ 'en_US' => true,
+ 'en_US_POSIX' => true,
+ 'en_VC' => true,
+ 'en_VG' => true,
+ 'en_VI' => true,
+ 'en_VU' => true,
+ 'en_WS' => true,
+ 'en_ZA' => true,
+ 'en_ZM' => true,
+ 'en_ZW' => true,
+ 'eo' => true,
+ 'eo_001' => true,
+ 'es' => true,
+ 'es_419' => true,
+ 'es_AR' => true,
+ 'es_BO' => true,
+ 'es_CL' => true,
+ 'es_CO' => true,
+ 'es_CR' => true,
+ 'es_CU' => true,
+ 'es_DO' => true,
+ 'es_EA' => true,
+ 'es_EC' => true,
+ 'es_ES' => true,
+ 'es_GQ' => true,
+ 'es_GT' => true,
+ 'es_HN' => true,
+ 'es_IC' => true,
+ 'es_MX' => true,
+ 'es_NI' => true,
+ 'es_PA' => true,
+ 'es_PE' => true,
+ 'es_PH' => true,
+ 'es_PR' => true,
+ 'es_PY' => true,
+ 'es_SV' => true,
+ 'es_US' => true,
+ 'es_UY' => true,
+ 'es_VE' => true,
+ 'et' => true,
+ 'et_EE' => true,
+ 'eu' => true,
+ 'eu_ES' => true,
+ 'ewo' => true,
+ 'ewo_CM' => true,
+ 'fa' => true,
+ 'fa_AF' => true,
+ 'fa_IR' => true,
+ 'ff' => true,
+ 'ff_CM' => true,
+ 'ff_GN' => true,
+ 'ff_MR' => true,
+ 'fr_PM' => true,
+ 'ff_SN' => true,
+ 'fr_WF' => true,
+ 'fi' => true,
+ 'fi_FI' => true,
+ 'fil' => true,
+ 'fil_PH' => true,
+ 'fo' => true,
+ 'fo_FO' => true,
+ 'fr' => true,
+ 'fr_BE' => true,
+ 'fr_BF' => true,
+ 'fr_BI' => true,
+ 'fr_BJ' => true,
+ 'fr_BL' => true,
+ 'fr_CA' => true,
+ 'fr_CD' => true,
+ 'fr_CF' => true,
+ 'fr_CG' => true,
+ 'fr_CH' => true,
+ 'fr_CI' => true,
+ 'fr_CM' => true,
+ 'fr_DJ' => true,
+ 'fr_DZ' => true,
+ 'fr_FR' => true,
+ 'fr_GA' => true,
+ 'fr_GF' => true,
+ 'fr_GN' => true,
+ 'fr_GP' => true,
+ 'fr_GQ' => true,
+ 'fr_HT' => true,
+ 'fr_KM' => true,
+ 'fr_LU' => true,
+ 'fr_MA' => true,
+ 'fr_MC' => true,
+ 'fr_MF' => true,
+ 'fr_MG' => true,
+ 'fr_ML' => true,
+ 'fr_MQ' => true,
+ 'fr_MR' => true,
+ 'fr_MU' => true,
+ 'fr_NC' => true,
+ 'fr_NE' => true,
+ 'fr_PF' => true,
+ 'fr_RE' => true,
+ 'fr_RW' => true,
+ 'fr_SC' => true,
+ 'fr_SN' => true,
+ 'fr_SY' => true,
+ 'fr_TD' => true,
+ 'fr_TG' => true,
+ 'fr_TN' => true,
+ 'fr_VU' => true,
+ 'fr_YT' => true,
+ 'fur' => true,
+ 'fur_IT' => true,
+ 'fy' => true,
+ 'fy_NL' => true,
+ 'ga' => true,
+ 'ga_IE' => true,
+ 'gd' => true,
+ 'gd_GB' => true,
+ 'gl' => true,
+ 'gl_ES' => true,
+ 'gsw' => true,
+ 'gsw_CH' => true,
+ 'gsw_LI' => true,
+ 'gu' => true,
+ 'gu_IN' => true,
+ 'guz' => true,
+ 'guz_KE' => true,
+ 'gv' => true,
+ 'gv_IM' => true,
+ 'ha' => true,
+ 'ha_Latn' => true,
+ 'ha_Latn_GH' => true,
+ 'ha_Latn_NE' => true,
+ 'ha_Latn_NG' => true,
+ 'haw' => true,
+ 'haw_US' => true,
+ 'he' => true,
+ 'he_IL' => true,
+ 'hi' => true,
+ 'hi_IN' => true,
+ 'hr' => true,
+ 'hr_BA' => true,
+ 'hr_HR' => true,
+ 'hu' => true,
+ 'hu_HU' => true,
+ 'hy' => true,
+ 'hy_AM' => true,
+ 'ia' => true,
+ 'ia_FR' => true,
+ 'id' => true,
+ 'id_ID' => true,
+ 'ig' => true,
+ 'ig_NG' => true,
+ 'ii' => true,
+ 'ii_CN' => true,
+ 'is' => true,
+ 'is_IS' => true,
+ 'it' => true,
+ 'it_CH' => true,
+ 'it_IT' => true,
+ 'it_SM' => true,
+ 'ja' => true,
+ 'ja_JP' => true,
+ 'jgo' => true,
+ 'jgo_CM' => true,
+ 'jmc' => true,
+ 'jmc_TZ' => true,
+ 'ka' => true,
+ 'ka_GE' => true,
+ 'kab' => true,
+ 'kab_DZ' => true,
+ 'kam' => true,
+ 'kam_KE' => true,
+ 'kde' => true,
+ 'kde_TZ' => true,
+ 'kea' => true,
+ 'kea_CV' => true,
+ 'khq' => true,
+ 'khq_ML' => true,
+ 'ki' => true,
+ 'ki_KE' => true,
+ 'kk' => true,
+ 'kk_Cyrl' => true,
+ 'kk_Cyrl_KZ' => true,
+ 'kkj' => true,
+ 'kkj_CM' => true,
+ 'kl' => true,
+ 'kl_GL' => true,
+ 'kln' => true,
+ 'kln_KE' => true,
+ 'km' => true,
+ 'km_KH' => true,
+ 'kn' => true,
+ 'kn_IN' => true,
+ 'ko' => true,
+ 'ko_KP' => true,
+ 'ko_KR' => true,
+ 'kok' => true,
+ 'kok_IN' => true,
+ 'ks' => true,
+ 'ks_Arab' => true,
+ 'ks_Arab_IN' => true,
+ 'ksb' => true,
+ 'ksb_TZ' => true,
+ 'ksf' => true,
+ 'ksf_CM' => true,
+ 'ksh' => true,
+ 'ksh_DE' => true,
+ 'kw' => true,
+ 'kw_GB' => true,
+ 'ky' => true,
+ 'ky_Cyrl' => true,
+ 'ky_Cyrl_KG' => true,
+ 'lag' => true,
+ 'lag_TZ' => true,
+ 'lg' => true,
+ 'lg_UG' => true,
+ 'lkt' => true,
+ 'lkt_US' => true,
+ 'ln' => true,
+ 'ln_AO' => true,
+ 'ln_CD' => true,
+ 'ln_CF' => true,
+ 'ln_CG' => true,
+ 'lo' => true,
+ 'lo_LA' => true,
+ 'lt' => true,
+ 'lt_LT' => true,
+ 'lu' => true,
+ 'lu_CD' => true,
+ 'luo' => true,
+ 'luo_KE' => true,
+ 'luy' => true,
+ 'luy_KE' => true,
+ 'lv' => true,
+ 'lv_LV' => true,
+ 'mas' => true,
+ 'mas_KE' => true,
+ 'mas_TZ' => true,
+ 'mer' => true,
+ 'mer_KE' => true,
+ 'mfe' => true,
+ 'mfe_MU' => true,
+ 'mg' => true,
+ 'mg_MG' => true,
+ 'mgh' => true,
+ 'mgh_MZ' => true,
+ 'mgo' => true,
+ 'mgo_CM' => true,
+ 'mk' => true,
+ 'mk_MK' => true,
+ 'ml' => true,
+ 'ml_IN' => true,
+ 'mn' => true,
+ 'mn_Cyrl' => true,
+ 'mn_Cyrl_MN' => true,
+ 'mr' => true,
+ 'mr_IN' => true,
+ 'ms' => true,
+ 'ms_Latn' => true,
+ 'ms_Latn_BN' => true,
+ 'ms_Latn_MY' => true,
+ 'ms_Latn_SG' => true,
+ 'mt' => true,
+ 'mt_MT' => true,
+ 'mua' => true,
+ 'mua_CM' => true,
+ 'my' => true,
+ 'my_MM' => true,
+ 'naq' => true,
+ 'naq_NA' => true,
+ 'nb' => true,
+ 'nb_NO' => true,
+ 'nb_SJ' => true,
+ 'nd' => true,
+ 'nd_ZW' => true,
+ 'ne' => true,
+ 'ne_IN' => true,
+ 'ne_NP' => true,
+ 'nl' => true,
+ 'nl_AW' => true,
+ 'nl_BE' => true,
+ 'nl_BQ' => true,
+ 'nl_CW' => true,
+ 'nl_NL' => true,
+ 'nl_SR' => true,
+ 'nl_SX' => true,
+ 'nmg' => true,
+ 'nmg_CM' => true,
+ 'nn' => true,
+ 'nn_NO' => true,
+ 'nnh' => true,
+ 'nnh_CM' => true,
+ 'nr' => true,
+ 'nr_ZA' => true,
+ 'nso' => true,
+ 'nso_ZA' => true,
+ 'nus' => true,
+ 'nus_SD' => true,
+ 'nyn' => true,
+ 'nyn_UG' => true,
+ 'om' => true,
+ 'om_ET' => true,
+ 'om_KE' => true,
+ 'or' => true,
+ 'or_IN' => true,
+ 'ordinals' => true,
+ 'os' => true,
+ 'os_GE' => true,
+ 'os_RU' => true,
+ 'pa' => true,
+ 'pa_Arab' => true,
+ 'pa_Arab_PK' => true,
+ 'pa_Guru' => true,
+ 'pa_Guru_IN' => true,
+ 'pl' => true,
+ 'pl_PL' => true,
+ 'plurals' => true,
+ 'ps' => true,
+ 'ps_AF' => true,
+ 'pt' => true,
+ 'pt_AO' => true,
+ 'pt_BR' => true,
+ 'pt_CV' => true,
+ 'pt_GW' => true,
+ 'pt_MO' => true,
+ 'pt_MZ' => true,
+ 'pt_PT' => true,
+ 'pt_ST' => true,
+ 'pt_TL' => true,
+ 'rm' => true,
+ 'rm_CH' => true,
+ 'rn' => true,
+ 'rn_BI' => true,
+ 'ro' => true,
+ 'ro_MD' => true,
+ 'ro_RO' => true,
+ 'rof' => true,
+ 'rof_TZ' => true,
+ 'ru' => true,
+ 'ru_BY' => true,
+ 'ru_KG' => true,
+ 'ru_KZ' => true,
+ 'ru_MD' => true,
+ 'ru_RU' => true,
+ 'ru_UA' => true,
+ 'rw' => true,
+ 'rw_RW' => true,
+ 'rwk' => true,
+ 'rwk_TZ' => true,
+ 'sah' => true,
+ 'sah_RU' => true,
+ 'saq' => true,
+ 'saq_KE' => true,
+ 'sbp' => true,
+ 'sbp_TZ' => true,
+ 'se' => true,
+ 'se_FI' => true,
+ 'se_NO' => true,
+ 'seh' => true,
+ 'seh_MZ' => true,
+ 'ses' => true,
+ 'ses_ML' => true,
+ 'sg' => true,
+ 'sg_CF' => true,
+ 'shi' => true,
+ 'shi_Latn' => true,
+ 'shi_Latn_MA' => true,
+ 'shi_Tfng' => true,
+ 'shi_Tfng_MA' => true,
+ 'si' => true,
+ 'si_LK' => true,
+ 'sk' => true,
+ 'sk_SK' => true,
+ 'sl' => true,
+ 'sl_SI' => true,
+ 'sn' => true,
+ 'sn_ZW' => true,
+ 'so' => true,
+ 'so_DJ' => true,
+ 'so_ET' => true,
+ 'so_KE' => true,
+ 'so_SO' => true,
+ 'sq' => true,
+ 'sq_AL' => true,
+ 'sq_MK' => true,
+ 'sq_XK' => true,
+ 'sr' => true,
+ 'sr_Cyrl' => true,
+ 'sr_Cyrl_BA' => true,
+ 'sr_Cyrl_ME' => true,
+ 'sr_Cyrl_RS' => true,
+ 'sr_Cyrl_XK' => true,
+ 'sr_Latn' => true,
+ 'sr_Latn_BA' => true,
+ 'sr_Latn_ME' => true,
+ 'sr_Latn_RS' => true,
+ 'sr_Latn_XK' => true,
+ 'ss' => true,
+ 'ss_SZ' => true,
+ 'ss_ZA' => true,
+ 'ssy' => true,
+ 'ssy_ER' => true,
+ 'st' => true,
+ 'st_LS' => true,
+ 'st_ZA' => true,
+ 'sv' => true,
+ 'sv_AX' => true,
+ 'sv_FI' => true,
+ 'sv_SE' => true,
+ 'sw' => true,
+ 'sw_KE' => true,
+ 'sw_TZ' => true,
+ 'sw_UG' => true,
+ 'swc' => true,
+ 'swc_CD' => true,
+ 'ta' => true,
+ 'ta_IN' => true,
+ 'ta_LK' => true,
+ 'ta_MY' => true,
+ 'ta_SG' => true,
+ 'te' => true,
+ 'te_IN' => true,
+ 'teo' => true,
+ 'teo_KE' => true,
+ 'teo_UG' => true,
+ 'tg' => true,
+ 'tg_Cyrl' => true,
+ 'tg_Cyrl_TJ' => true,
+ 'th' => true,
+ 'th_TH' => true,
+ 'ti' => true,
+ 'ti_ER' => true,
+ 'ti_ET' => true,
+ 'tig' => true,
+ 'tig_ER' => true,
+ 'tn' => true,
+ 'tn_BW' => true,
+ 'tn_ZA' => true,
+ 'to' => true,
+ 'to_TO' => true,
+ 'tr' => true,
+ 'tr_CY' => true,
+ 'tr_TR' => true,
+ 'ts' => true,
+ 'ts_ZA' => true,
+ 'twq' => true,
+ 'twq_NE' => true,
+ 'tzm' => true,
+ 'tzm_Latn' => true,
+ 'tzm_Latn_MA' => true,
+ 'ug' => true,
+ 'ug_Arab' => true,
+ 'ug_Arab_CN' => true,
+ 'uk' => true,
+ 'uk_UA' => true,
+ 'ur' => true,
+ 'ur_IN' => true,
+ 'ur_PK' => true,
+ 'uz' => true,
+ 'uz_Arab' => true,
+ 'uz_Arab_AF' => true,
+ 'uz_Cyrl' => true,
+ 'uz_Cyrl_UZ' => true,
+ 'uz_Latn' => true,
+ 'uz_Latn_UZ' => true,
+ 'vai' => true,
+ 'vai_Latn' => true,
+ 'vai_Latn_LR' => true,
+ 'vai_Vaii' => true,
+ 'vai_Vaii_LR' => true,
+ 've' => true,
+ 've_ZA' => true,
+ 'vi' => true,
+ 'vi_VN' => true,
+ 'vo' => true,
+ 'vo_001' => true,
+ 'vun' => true,
+ 'vun_TZ' => true,
+ 'wae' => true,
+ 'wae_CH' => true,
+ 'wal' => true,
+ 'wal_ET' => true,
+ 'xh' => true,
+ 'xh_ZA' => true,
+ 'xog' => true,
+ 'xog_UG' => true,
+ 'yav' => true,
+ 'yav_CM' => true,
+ 'yo' => true,
+ 'yo_BJ' => true,
+ 'yo_NG' => true,
+ 'zgh' => true,
+ 'zgh_MA' => true,
+ 'zh' => true,
+ 'zh_Hans' => true,
+ 'zh_Hans_CN' => true,
+ 'zh_Hans_HK' => true,
+ 'zh_Hans_MO' => true,
+ 'zh_Hans_SG' => true,
+ 'zh_Hant' => true,
+ 'zh_Hant_HK' => true,
+ 'zh_Hant_MO' => true,
+ 'zh_Hant_TW' => true,
+ 'zu' => true,
+ 'zu_ZA' => true,
+ );
+
+ /**
+ * Class wide Locale Constants
+ *
+ * @var array $_territoryData
+ */
+ private static $_territoryData = array(
+ 'AD' => 'ca_AD',
+ 'AE' => 'ar_AE',
+ 'AF' => 'fa_AF',
+ 'AG' => 'en_AG',
+ 'AI' => 'en_AI',
+ 'AL' => 'sq_AL',
+ 'AM' => 'hy_AM',
+ 'AN' => 'pap_AN',
+ 'AO' => 'pt_AO',
+ 'AQ' => 'und_AQ',
+ 'AR' => 'es_AR',
+ 'AS' => 'sm_AS',
+ 'AT' => 'de_AT',
+ 'AU' => 'en_AU',
+ 'AW' => 'nl_AW',
+ 'AX' => 'sv_AX',
+ 'AZ' => 'az_Latn_AZ',
+ 'BA' => 'bs_BA',
+ 'BB' => 'en_BB',
+ 'BD' => 'bn_BD',
+ 'BE' => 'nl_BE',
+ 'BF' => 'mos_BF',
+ 'BG' => 'bg_BG',
+ 'BH' => 'ar_BH',
+ 'BI' => 'rn_BI',
+ 'BJ' => 'fr_BJ',
+ 'BL' => 'fr_BL',
+ 'BM' => 'en_BM',
+ 'BN' => 'ms_BN',
+ 'BO' => 'es_BO',
+ 'BR' => 'pt_BR',
+ 'BS' => 'en_BS',
+ 'BT' => 'dz_BT',
+ 'BV' => 'und_BV',
+ 'BW' => 'en_BW',
+ 'BY' => 'be_BY',
+ 'BZ' => 'en_BZ',
+ 'CA' => 'en_CA',
+ 'CC' => 'ms_CC',
+ 'CD' => 'sw_CD',
+ 'CF' => 'fr_CF',
+ 'CG' => 'fr_CG',
+ 'CH' => 'de_CH',
+ 'CI' => 'fr_CI',
+ 'CK' => 'en_CK',
+ 'CL' => 'es_CL',
+ 'CM' => 'fr_CM',
+ 'CN' => 'zh_Hans_CN',
+ 'CO' => 'es_CO',
+ 'CR' => 'es_CR',
+ 'CU' => 'es_CU',
+ 'CV' => 'kea_CV',
+ 'CX' => 'en_CX',
+ 'CY' => 'el_CY',
+ 'CZ' => 'cs_CZ',
+ 'DE' => 'de_DE',
+ 'DJ' => 'aa_DJ',
+ 'DK' => 'da_DK',
+ 'DM' => 'en_DM',
+ 'DO' => 'es_DO',
+ 'DZ' => 'ar_DZ',
+ 'EC' => 'es_EC',
+ 'EE' => 'et_EE',
+ 'EG' => 'ar_EG',
+ 'EH' => 'ar_EH',
+ 'ER' => 'ti_ER',
+ 'ES' => 'es_ES',
+ 'ET' => 'en_ET',
+ 'FI' => 'fi_FI',
+ 'FJ' => 'hi_FJ',
+ 'FK' => 'en_FK',
+ 'FM' => 'chk_FM',
+ 'FO' => 'fo_FO',
+ 'FR' => 'fr_FR',
+ 'GA' => 'fr_GA',
+ 'GB' => 'en_GB',
+ 'GD' => 'en_GD',
+ 'GE' => 'ka_GE',
+ 'GF' => 'fr_GF',
+ 'GG' => 'en_GG',
+ 'GH' => 'ak_GH',
+ 'GI' => 'en_GI',
+ 'GL' => 'iu_GL',
+ 'GM' => 'en_GM',
+ 'GN' => 'fr_GN',
+ 'GP' => 'fr_GP',
+ 'GQ' => 'fan_GQ',
+ 'GR' => 'el_GR',
+ 'GS' => 'und_GS',
+ 'GT' => 'es_GT',
+ 'GU' => 'en_GU',
+ 'GW' => 'pt_GW',
+ 'GY' => 'en_GY',
+ 'HK' => 'zh_Hant_HK',
+ 'HM' => 'und_HM',
+ 'HN' => 'es_HN',
+ 'HR' => 'hr_HR',
+ 'HT' => 'ht_HT',
+ 'HU' => 'hu_HU',
+ 'ID' => 'id_ID',
+ 'IE' => 'en_IE',
+ 'IL' => 'he_IL',
+ 'IM' => 'en_IM',
+ 'IN' => 'hi_IN',
+ 'IO' => 'und_IO',
+ 'IQ' => 'ar_IQ',
+ 'IR' => 'fa_IR',
+ 'IS' => 'is_IS',
+ 'IT' => 'it_IT',
+ 'JE' => 'en_JE',
+ 'JM' => 'en_JM',
+ 'JO' => 'ar_JO',
+ 'JP' => 'ja_JP',
+ 'KE' => 'en_KE',
+ 'KG' => 'ky_Cyrl_KG',
+ 'KH' => 'km_KH',
+ 'KI' => 'en_KI',
+ 'KM' => 'ar_KM',
+ 'KN' => 'en_KN',
+ 'KP' => 'ko_KP',
+ 'KR' => 'ko_KR',
+ 'KW' => 'ar_KW',
+ 'KY' => 'en_KY',
+ 'KZ' => 'ru_KZ',
+ 'LA' => 'lo_LA',
+ 'LB' => 'ar_LB',
+ 'LC' => 'en_LC',
+ 'LI' => 'de_LI',
+ 'LK' => 'si_LK',
+ 'LR' => 'en_LR',
+ 'LS' => 'st_LS',
+ 'LT' => 'lt_LT',
+ 'LU' => 'fr_LU',
+ 'LV' => 'lv_LV',
+ 'LY' => 'ar_LY',
+ 'MA' => 'ar_MA',
+ 'MC' => 'fr_MC',
+ 'MD' => 'ro_MD',
+ 'ME' => 'sr_Latn_ME',
+ 'MF' => 'fr_MF',
+ 'MG' => 'mg_MG',
+ 'MH' => 'mh_MH',
+ 'MK' => 'mk_MK',
+ 'ML' => 'bm_ML',
+ 'MM' => 'my_MM',
+ 'MN' => 'mn_Cyrl_MN',
+ 'MO' => 'zh_Hant_MO',
+ 'MP' => 'en_MP',
+ 'MQ' => 'fr_MQ',
+ 'MR' => 'ar_MR',
+ 'MS' => 'en_MS',
+ 'MT' => 'mt_MT',
+ 'MU' => 'mfe_MU',
+ 'MV' => 'dv_MV',
+ 'MW' => 'ny_MW',
+ 'MX' => 'es_MX',
+ 'MY' => 'ms_MY',
+ 'MZ' => 'pt_MZ',
+ 'NA' => 'kj_NA',
+ 'NC' => 'fr_NC',
+ 'NE' => 'ha_Latn_NE',
+ 'NF' => 'en_NF',
+ 'NG' => 'en_NG',
+ 'NI' => 'es_NI',
+ 'NL' => 'nl_NL',
+ 'NO' => 'nb_NO',
+ 'NP' => 'ne_NP',
+ 'NR' => 'en_NR',
+ 'NU' => 'niu_NU',
+ 'NZ' => 'en_NZ',
+ 'OM' => 'ar_OM',
+ 'PA' => 'es_PA',
+ 'PE' => 'es_PE',
+ 'PF' => 'fr_PF',
+ 'PG' => 'tpi_PG',
+ 'PH' => 'fil_PH',
+ 'PK' => 'ur_PK',
+ 'PL' => 'pl_PL',
+ 'PM' => 'fr_PM',
+ 'PN' => 'en_PN',
+ 'PR' => 'es_PR',
+ 'PS' => 'ar_PS',
+ 'PT' => 'pt_PT',
+ 'PW' => 'pau_PW',
+ 'PY' => 'gn_PY',
+ 'QA' => 'ar_QA',
+ 'RE' => 'fr_RE',
+ 'RO' => 'ro_RO',
+ 'RS' => 'sr_Cyrl_RS',
+ 'RU' => 'ru_RU',
+ 'RW' => 'rw_RW',
+ 'SA' => 'ar_SA',
+ 'SB' => 'en_SB',
+ 'SC' => 'crs_SC',
+ 'SD' => 'ar_SD',
+ 'SE' => 'sv_SE',
+ 'SG' => 'en_SG',
+ 'SH' => 'en_SH',
+ 'SI' => 'sl_SI',
+ 'SJ' => 'nb_SJ',
+ 'SK' => 'sk_SK',
+ 'SL' => 'kri_SL',
+ 'SM' => 'it_SM',
+ 'SN' => 'fr_SN',
+ 'SO' => 'sw_SO',
+ 'SR' => 'srn_SR',
+ 'ST' => 'pt_ST',
+ 'SV' => 'es_SV',
+ 'SY' => 'ar_SY',
+ 'SZ' => 'en_SZ',
+ 'TC' => 'en_TC',
+ 'TD' => 'fr_TD',
+ 'TF' => 'und_TF',
+ 'TG' => 'fr_TG',
+ 'TH' => 'th_TH',
+ 'TJ' => 'tg_Cyrl_TJ',
+ 'TK' => 'tkl_TK',
+ 'TL' => 'pt_TL',
+ 'TM' => 'tk_TM',
+ 'TN' => 'ar_TN',
+ 'TO' => 'to_TO',
+ 'TR' => 'tr_TR',
+ 'TT' => 'en_TT',
+ 'TV' => 'tvl_TV',
+ 'TW' => 'zh_Hant_TW',
+ 'TZ' => 'sw_TZ',
+ 'UA' => 'uk_UA',
+ 'UG' => 'sw_UG',
+ 'UM' => 'en_UM',
+ 'US' => 'en_US',
+ 'UY' => 'es_UY',
+ 'UZ' => 'uz_Cyrl_UZ',
+ 'VA' => 'it_VA',
+ 'VC' => 'en_VC',
+ 'VE' => 'es_VE',
+ 'VG' => 'en_VG',
+ 'VI' => 'en_VI',
+ 'VN' => 'vi_VN',
+ 'VU' => 'bi_VU',
+ 'WF' => 'wls_WF',
+ 'WS' => 'sm_WS',
+ 'YE' => 'ar_YE',
+ 'YT' => 'swb_YT',
+ 'ZA' => 'en_ZA',
+ 'ZM' => 'en_ZM',
+ 'ZW' => 'sn_ZW'
+ );
+
+ /**
+ * Autosearch constants
+ */
+ const BROWSER = 'browser';
+ const ENVIRONMENT = 'environment';
+ const ZFDEFAULT = 'default';
+
+ /**
+ * Defines if old behaviour should be supported
+ * Old behaviour throws notices and will be deleted in future releases
+ *
+ * @var boolean
+ */
+ public static $compatibilityMode = false;
+
+ /**
+ * Internal variable
+ *
+ * @var boolean
+ */
+ private static $_breakChain = false;
+
+ /**
+ * Actual set locale
+ *
+ * @var string Locale
+ */
+ protected $_locale;
+
+ /**
+ * Automatic detected locale
+ *
+ * @var string Locales
+ */
+ protected static $_auto;
+
+ /**
+ * Browser detected locale
+ *
+ * @var string Locales
+ */
+ protected static $_browser;
+
+ /**
+ * Environment detected locale
+ *
+ * @var string Locales
+ */
+ protected static $_environment;
+
+ /**
+ * Default locale
+ *
+ * @var string Locales
+ */
+ protected static $_default = array('en' => true);
+
+ /**
+ * Generates a locale object
+ * If no locale is given a automatic search is done
+ * Then the most probable locale will be automatically set
+ * Search order is
+ * 1. Given Locale
+ * 2. HTTP Client
+ * 3. Server Environment
+ * 4. Framework Standard
+ *
+ * @param string|Zend_Locale $locale (Optional) Locale for parsing input
+ * @throws Zend_Locale_Exception When autodetection has been failed
+ */
+ public function __construct($locale = null)
+ {
+ $this->setLocale($locale);
+ }
+
+ /**
+ * Serialization Interface
+ *
+ * @return string
+ */
+ public function serialize()
+ {
+ return serialize($this);
+ }
+
+ /**
+ * Returns a string representation of the object
+ *
+ * @return string
+ */
+ public function toString()
+ {
+ return (string) $this->_locale;
+ }
+
+ /**
+ * Returns a string representation of the object
+ * Alias for toString
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->toString();
+ }
+
+ /**
+ * Return the default locale
+ *
+ * @return array Returns an array of all locale string
+ */
+ public static function getDefault()
+ {
+ if ((self::$compatibilityMode === true) or (func_num_args() > 0)) {
+ if (!self::$_breakChain) {
+ self::$_breakChain = true;
+ trigger_error('You are running Zend_Locale in compatibility mode... please migrate your scripts', E_USER_NOTICE);
+ $params = func_get_args();
+ $param = null;
+ if (isset($params[0])) {
+ $param = $params[0];
+ }
+ return self::getOrder($param);
+ }
+
+ self::$_breakChain = false;
+ }
+
+ return self::$_default;
+ }
+
+ /**
+ * Sets a new default locale which will be used when no locale can be detected
+ * If provided you can set a quality between 0 and 1 (or 2 and 100)
+ * which represents the percent of quality the browser
+ * requested within HTTP
+ *
+ * @param string|Zend_Locale $locale Locale to set
+ * @param float $quality The quality to set from 0 to 1
+ * @throws Zend_Locale_Exception When a autolocale was given
+ * @throws Zend_Locale_Exception When a unknown locale was given
+ * @return void
+ */
+ public static function setDefault($locale, $quality = 1)
+ {
+ if (($locale === 'auto') or ($locale === 'root') or ($locale === 'default') or
+ ($locale === 'environment') or ($locale === 'browser')) {
+ throw new Zend_Locale_Exception('Only full qualified locales can be used as default!');
+ }
+
+ if (($quality < 0.1) or ($quality > 100)) {
+ throw new Zend_Locale_Exception("Quality must be between 0.1 and 100");
+ }
+
+ if ($quality > 1) {
+ $quality /= 100;
+ }
+
+ $locale = self::_prepareLocale($locale);
+ if (isset(self::$_localeData[(string) $locale]) === true) {
+ self::$_default = array((string) $locale => $quality);
+ } else {
+ $elocale = explode('_', (string) $locale);
+ if (isset(self::$_localeData[$elocale[0]]) === true) {
+ self::$_default = array($elocale[0] => $quality);
+ } else {
+ throw new Zend_Locale_Exception("Unknown locale '" . (string) $locale . "' can not be set as default!");
+ }
+ }
+
+ self::$_auto = self::getBrowser() + self::getEnvironment() + self::getDefault();
+ }
+
+ /**
+ * Expects the Systems standard locale
+ *
+ * For Windows:
+ * f.e.: LC_COLLATE=C;LC_CTYPE=German_Austria.1252;LC_MONETARY=C
+ * would be recognised as de_AT
+ *
+ * @return array
+ */
+ public static function getEnvironment()
+ {
+ if (self::$_environment !== null) {
+ return self::$_environment;
+ }
+
+
+ $language = setlocale(LC_ALL, 0);
+ $languages = explode(';', $language);
+ $languagearray = array();
+
+ foreach ($languages as $locale) {
+ if (strpos($locale, '=') !== false) {
+ $language = substr($locale, strpos($locale, '='));
+ $language = substr($language, 1);
+ }
+
+ if ($language !== 'C') {
+ if (strpos($language, '.') !== false) {
+ $language = substr($language, 0, strpos($language, '.'));
+ } else if (strpos($language, '@') !== false) {
+ $language = substr($language, 0, strpos($language, '@'));
+ }
+
+ $language = str_ireplace(
+ array_keys(Zend_Locale_Data_Translation::$languageTranslation),
+ array_values(Zend_Locale_Data_Translation::$languageTranslation),
+ (string) $language
+ );
+
+ $language = str_ireplace(
+ array_keys(Zend_Locale_Data_Translation::$regionTranslation),
+ array_values(Zend_Locale_Data_Translation::$regionTranslation),
+ $language
+ );
+
+ if (isset(self::$_localeData[$language]) === true) {
+ $languagearray[$language] = 1;
+ if (strpos($language, '_') !== false) {
+ $languagearray[substr($language, 0, strpos($language, '_'))] = 1;
+ }
+ }
+ }
+ }
+
+ self::$_environment = $languagearray;
+ return $languagearray;
+ }
+
+ /**
+ * Return an array of all accepted languages of the client
+ * Expects RFC compilant Header !!
+ *
+ * The notation can be :
+ * de,en-UK-US;q=0.5,fr-FR;q=0.2
+ *
+ * @return array - list of accepted languages including quality
+ */
+ public static function getBrowser()
+ {
+ if (self::$_browser !== null) {
+ return self::$_browser;
+ }
+
+ $httplanguages = getenv('HTTP_ACCEPT_LANGUAGE');
+ if (empty($httplanguages) && array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER)) {
+ $httplanguages = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
+ }
+
+ $languages = array();
+ if (empty($httplanguages)) {
+ return $languages;
+ }
+
+ $accepted = preg_split('/,\s*/', $httplanguages);
+
+ foreach ($accepted as $accept) {
+ $match = null;
+ $result = preg_match('/^([a-z]{1,8}(?:[-_][a-z]{1,8})*)(?:;\s*q=(0(?:\.[0-9]{1,3})?|1(?:\.0{1,3})?))?$/i',
+ $accept, $match);
+
+ if ($result < 1) {
+ continue;
+ }
+
+ if (isset($match[2]) === true) {
+ $quality = (float) $match[2];
+ } else {
+ $quality = 1.0;
+ }
+
+ $countrys = explode('-', $match[1]);
+ $region = array_shift($countrys);
+
+ $country2 = explode('_', $region);
+ $region = array_shift($country2);
+
+ foreach ($countrys as $country) {
+ $languages[$region . '_' . strtoupper($country)] = $quality;
+ }
+
+ foreach ($country2 as $country) {
+ $languages[$region . '_' . strtoupper($country)] = $quality;
+ }
+
+ if ((isset($languages[$region]) === false) || ($languages[$region] < $quality)) {
+ $languages[$region] = $quality;
+ }
+ }
+
+ self::$_browser = $languages;
+ return $languages;
+ }
+
+ /**
+ * Sets a new locale
+ *
+ * @param string|Zend_Locale $locale (Optional) New locale to set
+ * @return void
+ */
+ public function setLocale($locale = null)
+ {
+ $locale = self::_prepareLocale($locale);
+
+ if (isset(self::$_localeData[(string) $locale]) === false) {
+ // Is it an alias? If so, we can use this locale
+ if (isset(self::$_localeAliases[$locale]) === true) {
+ $this->_locale = $locale;
+ return;
+ }
+
+ $region = substr((string) $locale, 0, 3);
+ if (isset($region[2]) === true) {
+ if (($region[2] === '_') or ($region[2] === '-')) {
+ $region = substr($region, 0, 2);
+ }
+ }
+
+ if (isset(self::$_localeData[(string) $region]) === true) {
+ $this->_locale = $region;
+ } else {
+ $this->_locale = 'root';
+ }
+ } else {
+ $this->_locale = $locale;
+ }
+ }
+
+ /**
+ * Returns the language part of the locale
+ *
+ * @return string
+ */
+ public function getLanguage()
+ {
+ $locale = explode('_', $this->_locale);
+ return $locale[0];
+ }
+
+ /**
+ * Returns the region part of the locale if available
+ *
+ * @return string|false - Regionstring
+ */
+ public function getRegion()
+ {
+ $locale = explode('_', $this->_locale);
+ if (isset($locale[1]) === true) {
+ return $locale[1];
+ }
+
+ return false;
+ }
+
+ /**
+ * Return the accepted charset of the client
+ *
+ * @return string
+ */
+ public static function getHttpCharset()
+ {
+ $httpcharsets = getenv('HTTP_ACCEPT_CHARSET');
+
+ $charsets = array();
+ if ($httpcharsets === false) {
+ return $charsets;
+ }
+
+ $accepted = preg_split('/,\s*/', $httpcharsets);
+ foreach ($accepted as $accept) {
+ if (empty($accept) === true) {
+ continue;
+ }
+
+ if (strpos($accept, ';') !== false) {
+ $quality = (float) substr($accept, (strpos($accept, '=') + 1));
+ $pos = substr($accept, 0, strpos($accept, ';'));
+ $charsets[$pos] = $quality;
+ } else {
+ $quality = 1.0;
+ $charsets[$accept] = $quality;
+ }
+ }
+
+ return $charsets;
+ }
+
+ /**
+ * Returns true if both locales are equal
+ *
+ * @param Zend_Locale $object Locale to check for equality
+ * @return boolean
+ */
+ public function equals(Zend_Locale $object)
+ {
+ if ($object->toString() === $this->toString()) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns localized informations as array, supported are several
+ * types of informations.
+ * For detailed information about the types look into the documentation
+ *
+ * @param string $path (Optional) Type of information to return
+ * @param string|Zend_Locale $locale (Optional) Locale|Language for which this informations should be returned
+ * @param string $value (Optional) Value for detail list
+ * @return array Array with the wished information in the given language
+ */
+ public static function getTranslationList($path = null, $locale = null, $value = null)
+ {
+ $locale = self::findLocale($locale);
+ $result = Zend_Locale_Data::getList($locale, $path, $value);
+ if (empty($result) === true) {
+ return false;
+ }
+
+ return $result;
+ }
+
+ /**
+ * Returns an array with the name of all languages translated to the given language
+ *
+ * @param string|Zend_Locale $locale (Optional) Locale for language translation
+ * @return array
+ * @deprecated
+ */
+ public static function getLanguageTranslationList($locale = null)
+ {
+ trigger_error("The method getLanguageTranslationList is deprecated. Use getTranslationList('language', $locale) instead", E_USER_NOTICE);
+ return self::getTranslationList('language', $locale);
+ }
+
+ /**
+ * Returns an array with the name of all scripts translated to the given language
+ *
+ * @param string|Zend_Locale $locale (Optional) Locale for script translation
+ * @return array
+ * @deprecated
+ */
+ public static function getScriptTranslationList($locale = null)
+ {
+ trigger_error("The method getScriptTranslationList is deprecated. Use getTranslationList('script', $locale) instead", E_USER_NOTICE);
+ return self::getTranslationList('script', $locale);
+ }
+
+ /**
+ * Returns an array with the name of all countries translated to the given language
+ *
+ * @param string|Zend_Locale $locale (Optional) Locale for country translation
+ * @return array
+ * @deprecated
+ */
+ public static function getCountryTranslationList($locale = null)
+ {
+ trigger_error("The method getCountryTranslationList is deprecated. Use getTranslationList('territory', $locale, 2) instead", E_USER_NOTICE);
+ return self::getTranslationList('territory', $locale, 2);
+ }
+
+ /**
+ * Returns an array with the name of all territories translated to the given language
+ * All territories contains other countries.
+ *
+ * @param string|Zend_Locale $locale (Optional) Locale for territory translation
+ * @return array
+ * @deprecated
+ */
+ public static function getTerritoryTranslationList($locale = null)
+ {
+ trigger_error("The method getTerritoryTranslationList is deprecated. Use getTranslationList('territory', $locale, 1) instead", E_USER_NOTICE);
+ return self::getTranslationList('territory', $locale, 1);
+ }
+
+ /**
+ * Returns a localized information string, supported are several types of informations.
+ * For detailed information about the types look into the documentation
+ *
+ * @param string $value Name to get detailed information about
+ * @param string $path (Optional) Type of information to return
+ * @param string|Zend_Locale $locale (Optional) Locale|Language for which this informations should be returned
+ * @return string|false The wished information in the given language
+ */
+ public static function getTranslation($value = null, $path = null, $locale = null)
+ {
+ $locale = self::findLocale($locale);
+ $result = Zend_Locale_Data::getContent($locale, $path, $value);
+ if (empty($result) === true && '0' !== $result) {
+ return false;
+ }
+
+ return $result;
+ }
+
+ /**
+ * Returns the localized language name
+ *
+ * @param string $value Name to get detailed information about
+ * @param string $locale (Optional) Locale for language translation
+ * @return array
+ * @deprecated
+ */
+ public static function getLanguageTranslation($value, $locale = null)
+ {
+ trigger_error("The method getLanguageTranslation is deprecated. Use getTranslation($value, 'language', $locale) instead", E_USER_NOTICE);
+ return self::getTranslation($value, 'language', $locale);
+ }
+
+ /**
+ * Returns the localized script name
+ *
+ * @param string $value Name to get detailed information about
+ * @param string $locale (Optional) locale for script translation
+ * @return array
+ * @deprecated
+ */
+ public static function getScriptTranslation($value, $locale = null)
+ {
+ trigger_error("The method getScriptTranslation is deprecated. Use getTranslation($value, 'script', $locale) instead", E_USER_NOTICE);
+ return self::getTranslation($value, 'script', $locale);
+ }
+
+ /**
+ * Returns the localized country name
+ *
+ * @param string $value Name to get detailed information about
+ * @param string|Zend_Locale $locale (Optional) Locale for country translation
+ * @return array
+ * @deprecated
+ */
+ public static function getCountryTranslation($value, $locale = null)
+ {
+ trigger_error("The method getCountryTranslation is deprecated. Use getTranslation($value, 'country', $locale) instead", E_USER_NOTICE);
+ return self::getTranslation($value, 'country', $locale);
+ }
+
+ /**
+ * Returns the localized territory name
+ * All territories contains other countries.
+ *
+ * @param string $value Name to get detailed information about
+ * @param string|Zend_Locale $locale (Optional) Locale for territory translation
+ * @return array
+ * @deprecated
+ */
+ public static function getTerritoryTranslation($value, $locale = null)
+ {
+ trigger_error("The method getTerritoryTranslation is deprecated. Use getTranslation($value, 'territory', $locale) instead", E_USER_NOTICE);
+ return self::getTranslation($value, 'territory', $locale);
+ }
+
+ /**
+ * Returns an array with translated yes strings
+ *
+ * @param string|Zend_Locale $locale (Optional) Locale for language translation (defaults to $this locale)
+ * @return array
+ */
+ public static function getQuestion($locale = null)
+ {
+ $locale = self::findLocale($locale);
+ $quest = Zend_Locale_Data::getList($locale, 'question');
+ $yes = explode(':', $quest['yes']);
+ $no = explode(':', $quest['no']);
+ $quest['yes'] = $yes[0];
+ $quest['yesarray'] = $yes;
+ $quest['no'] = $no[0];
+ $quest['noarray'] = $no;
+ $quest['yesexpr'] = self::_prepareQuestionString($yes);
+ $quest['noexpr'] = self::_prepareQuestionString($no);
+
+ return $quest;
+ }
+
+ /**
+ * Internal function for preparing the returned question regex string
+ *
+ * @param string $input Regex to parse
+ * @return string
+ */
+ private static function _prepareQuestionString($input)
+ {
+ $regex = '';
+ if (is_array($input) === true) {
+ $regex = '^';
+ $start = true;
+ foreach ($input as $row) {
+ if ($start === false) {
+ $regex .= '|';
+ }
+
+ $start = false;
+ $regex .= '(';
+ $one = null;
+ if (strlen($row) > 2) {
+ $one = true;
+ }
+
+ foreach (str_split($row, 1) as $char) {
+ $regex .= '[' . $char;
+ $regex .= strtoupper($char) . ']';
+ if ($one === true) {
+ $one = false;
+ $regex .= '(';
+ }
+ }
+
+ if ($one === false) {
+ $regex .= ')';
+ }
+
+ $regex .= '?)';
+ }
+ }
+
+ return $regex;
+ }
+
+ /**
+ * Checks if a locale identifier is a real locale or not
+ * Examples:
+ * "en_XX" refers to "en", which returns true
+ * "XX_yy" refers to "root", which returns false
+ *
+ * @param string|Zend_Locale $locale Locale to check for
+ * @param boolean $strict (Optional) If true, no rerouting will be done when checking
+ * @param boolean $compatible (DEPRECATED) Only for internal usage, brakes compatibility mode
+ * @return boolean If the locale is known dependend on the settings
+ */
+ public static function isLocale($locale, $strict = false, $compatible = true)
+ {
+ if (($locale instanceof Zend_Locale)
+ || (is_string($locale) && array_key_exists($locale, self::$_localeData))
+ ) {
+ return true;
+ }
+
+ // Is it an alias?
+ if (is_string($locale) && array_key_exists($locale, self::$_localeAliases)) {
+ return true;
+ }
+
+ if (($locale === null) || (!is_string($locale) and !is_array($locale))) {
+ return false;
+ }
+
+ try {
+ $locale = self::_prepareLocale($locale, $strict);
+ } catch (Zend_Locale_Exception $e) {
+ return false;
+ }
+
+ if (($compatible === true) and (self::$compatibilityMode === true)) {
+ trigger_error('You are running Zend_Locale in compatibility mode... please migrate your scripts', E_USER_NOTICE);
+ if (isset(self::$_localeData[$locale]) === true) {
+ return $locale;
+ } else if (!$strict) {
+ $locale = explode('_', $locale);
+ if (isset(self::$_localeData[$locale[0]]) === true) {
+ return $locale[0];
+ }
+ }
+ } else {
+ if (isset(self::$_localeData[$locale]) === true) {
+ return true;
+ } else if (!$strict) {
+ $locale = explode('_', $locale);
+ if (isset(self::$_localeData[$locale[0]]) === true) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Finds the proper locale based on the input
+ * Checks if it exists, degrades it when necessary
+ * Detects registry locale and when all fails tries to detect a automatic locale
+ * Returns the found locale as string
+ *
+ * @param string $locale
+ * @throws Zend_Locale_Exception When the given locale is no locale or the autodetection fails
+ * @return string
+ */
+ public static function findLocale($locale = null)
+ {
+ if ($locale === null) {
+ if (Zend_Registry::isRegistered('Zend_Locale')) {
+ $locale = Zend_Registry::get('Zend_Locale');
+ }
+ }
+
+ if ($locale === null) {
+ $locale = new Zend_Locale();
+ }
+
+ if (!Zend_Locale::isLocale($locale, true, false)) {
+ if (!Zend_Locale::isLocale($locale, false, false)) {
+ $locale = Zend_Locale::getLocaleToTerritory($locale);
+
+ if (empty($locale)) {
+ throw new Zend_Locale_Exception("The locale '$locale' is no known locale");
+ }
+ } else {
+ $locale = new Zend_Locale($locale);
+ }
+ }
+
+ $locale = self::_prepareLocale($locale);
+ return $locale;
+ }
+
+ /**
+ * Returns the expected locale for a given territory
+ *
+ * @param string $territory Territory for which the locale is being searched
+ * @return string|null Locale string or null when no locale has been found
+ */
+ public static function getLocaleToTerritory($territory)
+ {
+ $territory = strtoupper($territory);
+ if (array_key_exists($territory, self::$_territoryData)) {
+ return self::$_territoryData[$territory];
+ }
+
+ return null;
+ }
+
+ /**
+ * Returns a list of all known locales where the locale is the key
+ * Only real locales are returned, the internal locales 'root', 'auto', 'browser'
+ * and 'environment' are suppressed
+ *
+ * @return array List of all Locales
+ */
+ public static function getLocaleList()
+ {
+ $list = self::$_localeData;
+ unset($list['root']);
+ unset($list['auto']);
+ unset($list['browser']);
+ unset($list['environment']);
+ return $list;
+ }
+
+ /**
+ * Returns the set cache
+ *
+ * @return Zend_Cache_Core The set cache
+ */
+ public static function getCache()
+ {
+ return Zend_Locale_Data::getCache();
+ }
+
+ /**
+ * Sets a cache
+ *
+ * @param Zend_Cache_Core $cache Cache to set
+ * @return void
+ */
+ public static function setCache(Zend_Cache_Core $cache)
+ {
+ Zend_Locale_Data::setCache($cache);
+ }
+
+ /**
+ * Returns true when a cache is set
+ *
+ * @return boolean
+ */
+ public static function hasCache()
+ {
+ return Zend_Locale_Data::hasCache();
+ }
+
+ /**
+ * Removes any set cache
+ *
+ * @return void
+ */
+ public static function removeCache()
+ {
+ Zend_Locale_Data::removeCache();
+ }
+
+ /**
+ * Clears all set cache data
+ *
+ * @param string $tag Tag to clear when the default tag name is not used
+ * @return void
+ */
+ public static function clearCache($tag = null)
+ {
+ Zend_Locale_Data::clearCache($tag);
+ }
+
+ /**
+ * Disables the set cache
+ *
+ * @param boolean $flag True disables any set cache, default is false
+ * @return void
+ */
+ public static function disableCache($flag)
+ {
+ Zend_Locale_Data::disableCache($flag);
+ }
+
+ /**
+ * Internal function, returns a single locale on detection
+ *
+ * @param string|Zend_Locale $locale (Optional) Locale to work on
+ * @param boolean $strict (Optional) Strict preparation
+ * @throws Zend_Locale_Exception When no locale is set which is only possible when the class was wrong extended
+ * @return string
+ */
+ private static function _prepareLocale($locale, $strict = false)
+ {
+ if ($locale instanceof Zend_Locale) {
+ $locale = $locale->toString();
+ }
+
+ if (is_array($locale)) {
+ return '';
+ }
+
+ if (empty(self::$_auto) === true) {
+ self::$_browser = self::getBrowser();
+ self::$_environment = self::getEnvironment();
+ self::$_breakChain = true;
+ self::$_auto = self::getBrowser() + self::getEnvironment() + self::getDefault();
+ }
+
+ if (!$strict) {
+ if ($locale === 'browser') {
+ $locale = self::$_browser;
+ }
+
+ if ($locale === 'environment') {
+ $locale = self::$_environment;
+ }
+
+ if ($locale === 'default') {
+ $locale = self::$_default;
+ }
+
+ if (($locale === 'auto') or ($locale === null)) {
+ $locale = self::$_auto;
+ }
+
+ if (is_array($locale) === true) {
+ $locale = key($locale);
+ }
+ }
+
+ // This can only happen when someone extends Zend_Locale and erases the default
+ if ($locale === null) {
+ throw new Zend_Locale_Exception('Autodetection of Locale has been failed!');
+ }
+
+ if (strpos($locale, '-') !== false) {
+ $locale = strtr($locale, '-', '_');
+ }
+
+ $parts = explode('_', $locale);
+ if (!isset(self::$_localeData[$parts[0]])) {
+ if ((count($parts) == 1) && array_key_exists($parts[0], self::$_territoryData)) {
+ return self::$_territoryData[$parts[0]];
+ }
+
+ return '';
+ }
+
+ foreach($parts as $key => $value) {
+ if ((strlen($value) < 2) || (strlen($value) > 3)) {
+ unset($parts[$key]);
+ }
+ }
+
+ $locale = implode('_', $parts);
+ return (string) $locale;
+ }
+
+ /**
+ * Search the locale automatically and return all used locales
+ * ordered by quality
+ *
+ * Standard Searchorder is Browser, Environment, Default
+ *
+ * @param string $searchorder (Optional) Searchorder
+ * @return array Returns an array of all detected locales
+ */
+ public static function getOrder($order = null)
+ {
+ switch ($order) {
+ case self::ENVIRONMENT:
+ self::$_breakChain = true;
+ $languages = self::getEnvironment() + self::getBrowser() + self::getDefault();
+ break;
+
+ case self::ZFDEFAULT:
+ self::$_breakChain = true;
+ $languages = self::getDefault() + self::getEnvironment() + self::getBrowser();
+ break;
+
+ default:
+ self::$_breakChain = true;
+ $languages = self::getBrowser() + self::getEnvironment() + self::getDefault();
+ break;
+ }
+
+ return $languages;
+ }
+
+ /**
+ * Is the given locale in the list of aliases?
+ *
+ * @param string|Zend_Locale $locale Locale to work on
+ * @return boolean
+ */
+ public static function isAlias($locale)
+ {
+ if ($locale instanceof Zend_Locale) {
+ $locale = $locale->toString();
+ }
+
+ return isset(self::$_localeAliases[$locale]);
+ }
+
+ /**
+ * Return an alias' actual locale.
+ *
+ * @param string|Zend_Locale $locale Locale to work on
+ * @return string
+ */
+ public static function getAlias($locale)
+ {
+ if ($locale instanceof Zend_Locale) {
+ $locale = $locale->toString();
+ }
+
+ if (isset(self::$_localeAliases[$locale]) === true) {
+ return self::$_localeAliases[$locale];
+ }
+
+ return (string) $locale;
+ }
+}
diff --git a/library/vendor/Zend/Locale/Data.php b/library/vendor/Zend/Locale/Data.php
new file mode 100644
index 0000000..a6a435a
--- /dev/null
+++ b/library/vendor/Zend/Locale/Data.php
@@ -0,0 +1,1609 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Locale
+ * @subpackage Data
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * include needed classes
+ */
+
+/** @see Zend_Xml_Security */
+
+/**
+ * Locale data reader, handles the CLDR
+ *
+ * @category Zend
+ * @package Zend_Locale
+ * @subpackage Data
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Locale_Data
+{
+ /**
+ * Locale files
+ *
+ * @var array
+ */
+ private static $_ldml = array();
+
+ /**
+ * List of values which are collected
+ *
+ * @var array
+ */
+ private static $_list = array();
+
+ /**
+ * Internal cache for ldml values
+ *
+ * @var Zend_Cache_Core
+ */
+ private static $_cache = null;
+
+ /**
+ * Internal value to remember if cache supports tags
+ *
+ * @var boolean
+ */
+ private static $_cacheTags = false;
+
+ /**
+ * Internal option, cache disabled
+ *
+ * @var boolean
+ */
+ private static $_cacheDisabled = false;
+
+ /**
+ * Read the content from locale
+ *
+ * Can be called like:
+ * <ldml>
+ * <delimiter>test</delimiter>
+ * <second type='myone'>content</second>
+ * <second type='mysecond'>content2</second>
+ * <third type='mythird' />
+ * </ldml>
+ *
+ * Case 1: _readFile('ar','/ldml/delimiter') -> returns [] = test
+ * Case 1: _readFile('ar','/ldml/second[@type=myone]') -> returns [] = content
+ * Case 2: _readFile('ar','/ldml/second','type') -> returns [myone] = content; [mysecond] = content2
+ * Case 3: _readFile('ar','/ldml/delimiter',,'right') -> returns [right] = test
+ * Case 4: _readFile('ar','/ldml/third','type','myone') -> returns [myone] = mythird
+ *
+ * @param string $locale
+ * @param string $path
+ * @param string $attribute
+ * @param string $value
+ * @access private
+ * @return array
+ */
+ private static function _readFile($locale, $path, $attribute, $value, $temp)
+ {
+ // without attribute - read all values
+ // with attribute - read only this value
+ if (!empty(self::$_ldml[(string) $locale])) {
+
+ $result = self::$_ldml[(string) $locale]->xpath($path);
+ if (!empty($result)) {
+ foreach ($result as &$found) {
+
+ if (empty($value)) {
+
+ if (empty($attribute)) {
+ // Case 1
+ $temp[] = (string) $found;
+ } else if (empty($temp[(string) $found[$attribute]])){
+ // Case 2
+ $temp[(string) $found[$attribute]] = (string) $found;
+ }
+
+ } else if (empty ($temp[$value])) {
+
+ if (empty($attribute)) {
+ // Case 3
+ $temp[$value] = (string) $found;
+ } else {
+ // Case 4
+ $temp[$value] = (string) $found[$attribute];
+ }
+
+ }
+ }
+ }
+ }
+ return $temp;
+ }
+
+ /**
+ * Find possible routing to other path or locale
+ *
+ * @param string $locale
+ * @param string $path
+ * @param string $attribute
+ * @param string $value
+ * @param array $temp
+ * @return bool
+ * @throws Zend_Locale_Exception
+ */
+ private static function _findRoute($locale, $path, $attribute, $value, &$temp)
+ {
+ // load locale file if not already in cache
+ // needed for alias tag when referring to other locale
+ if (empty(self::$_ldml[(string) $locale])) {
+ $filename = dirname(__FILE__) . '/Data/' . $locale . '.xml';
+ if (!file_exists($filename)) {
+ throw new Zend_Locale_Exception("Missing locale file '$filename' for '$locale' locale.");
+ }
+
+ self::$_ldml[(string) $locale] = Zend_Xml_Security::scanFile($filename);
+ }
+
+ // search for 'alias' tag in the search path for redirection
+ $search = '';
+ $tok = strtok($path, '/');
+
+ // parse the complete path
+ if (!empty(self::$_ldml[(string) $locale])) {
+ while ($tok !== false) {
+ $search .= '/' . $tok;
+ if (strpos($search, '[@') !== false) {
+ while (strrpos($search, '[@') > strrpos($search, ']')) {
+ $tok = strtok('/');
+ if (empty($tok)) {
+ $search .= '/';
+ }
+ $search = $search . '/' . $tok;
+ }
+ }
+ $result = self::$_ldml[(string) $locale]->xpath($search . '/alias');
+
+ // alias found
+ if (!empty($result)) {
+
+ $source = $result[0]['source'];
+ $newpath = $result[0]['path'];
+
+ // new path - path //ldml is to ignore
+ if ($newpath != '//ldml') {
+ // other path - parse to make real path
+
+ while (substr($newpath,0,3) == '../') {
+ $newpath = substr($newpath, 3);
+ $search = substr($search, 0, strrpos($search, '/'));
+ }
+
+ // truncate ../ to realpath otherwise problems with alias
+ $path = $search . '/' . $newpath;
+ while (($tok = strtok('/'))!== false) {
+ $path = $path . '/' . $tok;
+ }
+ }
+
+ // reroute to other locale
+ if ($source != 'locale') {
+ $locale = $source;
+ }
+
+ $temp = self::_getFile($locale, $path, $attribute, $value, $temp);
+ return false;
+ }
+
+ $tok = strtok('/');
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Read the right LDML file
+ *
+ * @param string $locale
+ * @param string $path
+ * @param string|bool $attribute
+ * @param string|bool $value
+ * @param array $temp
+ * @return array
+ * @throws Zend_Locale_Exception
+ */
+ private static function _getFile($locale, $path, $attribute = false, $value = false, $temp = array())
+ {
+ $result = self::_findRoute($locale, $path, $attribute, $value, $temp);
+ if ($result) {
+ $temp = self::_readFile($locale, $path, $attribute, $value, $temp);
+ }
+
+ // parse required locales reversive
+ // example: when given zh_Hans_CN
+ // 1. -> zh_Hans_CN
+ // 2. -> zh_Hans
+ // 3. -> zh
+ // 4. -> root
+ if (($locale != 'root') && ($result)) {
+ // Search for parent locale
+ if (false !== strpos($locale, '_')) {
+ $parentLocale = self::getContent($locale, 'parentlocale');
+ if ($parentLocale) {
+ $temp = self::_getFile($parentLocale, $path, $attribute, $value, $temp);
+ }
+ }
+
+ $locale = substr($locale, 0, -strlen(strrchr($locale, '_')));
+ if (!empty($locale)) {
+ $temp = self::_getFile($locale, $path, $attribute, $value, $temp);
+ } else {
+ $temp = self::_getFile('root', $path, $attribute, $value, $temp);
+ }
+ }
+ return $temp;
+ }
+
+ /**
+ * Find the details for supplemental calendar datas
+ *
+ * @param string $locale Locale for Detaildata
+ * @param array $list List to search
+ * @return string Key for Detaildata
+ */
+ private static function _calendarDetail($locale, $list)
+ {
+ $ret = "001";
+ foreach ($list as $key => $value) {
+ if (strpos($locale, '_') !== false) {
+ $locale = substr($locale, strpos($locale, '_') + 1);
+ }
+ if (strpos($key, $locale) !== false) {
+ $ret = $key;
+ break;
+ }
+ }
+ return $ret;
+ }
+
+ /**
+ * Internal function for checking the locale
+ *
+ * @param string|Zend_Locale $locale Locale to check
+ * @return string
+ * @throws Zend_Locale_Exception
+ */
+ private static function _checkLocale($locale)
+ {
+ if (empty($locale)) {
+ $locale = new Zend_Locale();
+ }
+
+ if (!(Zend_Locale::isLocale((string) $locale, null, false))) {
+ throw new Zend_Locale_Exception("Locale (" . (string) $locale . ") is a unknown locale");
+ }
+
+ if (Zend_Locale::isAlias($locale)) {
+ // Return a valid CLDR locale so that the XML file can be loaded.
+ return Zend_Locale::getAlias($locale);
+ }
+ return (string) $locale;
+ }
+
+ /**
+ * Read the LDML file, get a array of multipath defined value
+ *
+ * @param string $locale
+ * @param string $path
+ * @param bool|string $value
+ * @return array
+ * @throws Zend_Locale_Exception
+ */
+ public static function getList($locale, $path, $value = false)
+ {
+ $locale = self::_checkLocale($locale);
+
+ if (!isset(self::$_cache) && !self::$_cacheDisabled) {
+ self::$_cache = Zend_Cache::factory(
+ 'Core',
+ 'File',
+ array('automatic_serialization' => true),
+ array());
+ }
+
+ $val = $value;
+ if (is_array($value)) {
+ $val = implode('_' , $value);
+ }
+
+ $val = urlencode($val);
+ $id = self::_filterCacheId('Zend_LocaleL_' . $locale . '_' . $path . '_' . $val);
+ if (!self::$_cacheDisabled && ($result = self::$_cache->load($id))) {
+ return unserialize($result);
+ }
+
+ $temp = array();
+ switch(strtolower($path)) {
+ case 'language':
+ $temp = self::_getFile($locale, '/ldml/localeDisplayNames/languages/language', 'type');
+ break;
+
+ case 'script':
+ $temp = self::_getFile($locale, '/ldml/localeDisplayNames/scripts/script', 'type');
+ break;
+
+ case 'territory':
+ $temp = self::_getFile($locale, '/ldml/localeDisplayNames/territories/territory', 'type');
+ if ($value === 1) {
+ foreach($temp as $key => $value) {
+ if ((is_numeric($key) === false) and ($key != 'QO') and ($key != 'EU')) {
+ unset($temp[$key]);
+ }
+ }
+ } else if ($value === 2) {
+ foreach($temp as $key => $value) {
+ if (is_numeric($key) or ($key == 'QO') or ($key == 'EU')) {
+ unset($temp[$key]);
+ }
+ }
+ }
+ break;
+
+ case 'variant':
+ $temp = self::_getFile($locale, '/ldml/localeDisplayNames/variants/variant', 'type');
+ break;
+
+ case 'key':
+ $temp = self::_getFile($locale, '/ldml/localeDisplayNames/keys/key', 'type');
+ break;
+
+ case 'type':
+ if (empty($value)) {
+ $temp = self::_getFile($locale, '/ldml/localeDisplayNames/types/type', 'type');
+ } else {
+ if (($value == 'calendar') or
+ ($value == 'collation') or
+ ($value == 'currency')) {
+ $temp = self::_getFile($locale, '/ldml/localeDisplayNames/types/type[@key=\'' . $value . '\']', 'type');
+ } else {
+ $temp = self::_getFile($locale, '/ldml/localeDisplayNames/types/type[@type=\'' . $value . '\']', 'type');
+ }
+ }
+ break;
+
+ case 'layout':
+ $temp = self::_getFile($locale, '/ldml/layout/orientation/characterOrder', '', 'characterOrder');
+ $temp += self::_getFile($locale, '/ldml/layout/orientation/lineOrder', '', 'lineOrder');
+ break;
+
+ case 'contexttransform':
+ if (empty($value)) {
+ $value = 'uiListOrMenu';
+ }
+ $temp = self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'languages\']/contextTransform[@type=\''.$value.'\']', '', 'languages');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'day-format-except-narrow\']/contextTransform[@type=\''.$value.'\']', '', 'day-format-except-narrow');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'day-standalone-except-narrow\']/contextTransform[@type=\''.$value.'\']', '', 'day-standalone-except-narrow');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'day-narrow\']/contextTransform[@type=\''.$value.'\']', '', 'day-narrow');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'month-format-except-narrow\']/contextTransform[@type=\''.$value.'\']', '', 'month-format-except-narrow');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'month-standalone-except-narrow\']/contextTransform[@type=\''.$value.'\']', '', 'month-standalone-except-narrow');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'month-narrow\']/contextTransform[@type=\''.$value.'\']', '', 'month-narrow');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'script\']/contextTransform[@type=\''.$value.'\']', '', 'script');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'territory\']/contextTransform[@type=\''.$value.'\']', '', 'territory');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'variant\']/contextTransform[@type=\''.$value.'\']', '', 'variant');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'key\']/contextTransform[@type=\''.$value.'\']', '', 'key');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'type\']/contextTransform[@type=\''.$value.'\']', '', 'type');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'era-name\']/contextTransform[@type=\''.$value.'\']', '', 'era-name');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'era-abbr\']/contextTransform[@type=\''.$value.'\']', '', 'era-abbr');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'era-narrow\']/contextTransform[@type=\''.$value.'\']', '', 'era-narrow');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'quater-format-wide\']/contextTransform[@type=\''.$value.'\']', '', 'quater-format-wide');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'quater-standalone-wide\']/contextTransform[@type=\''.$value.'\']', '', 'quater-standalone-wide');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'quater-abbreviated\']/contextTransform[@type=\''.$value.'\']', '', 'quater-abbreviated');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'quater-narrow\']/contextTransform[@type=\''.$value.'\']', '', 'quater-narrow');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'calendar-field\']/contextTransform[@type=\''.$value.'\']', '', 'calendar-field');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'symbol\']/contextTransform[@type=\''.$value.'\']', '', 'symbol');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'tense\']/contextTransform[@type=\''.$value.'\']', '', 'tense');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'zone-exemplarCity\']/contextTransform[@type=\''.$value.'\']', '', 'zone-exemplarCity');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'zone-long\']/contextTransform[@type=\''.$value.'\']', '', 'zone-long');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'zone-short\']/contextTransform[@type=\''.$value.'\']', '', 'zone-short');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'metazone-long\']/contextTransform[@type=\''.$value.'\']', '', 'metazone-long');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'metazone-short\']/contextTransform[@type=\''.$value.'\']', '', 'metazone-short');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'displayName-count\']/contextTransform[@type=\''.$value.'\']', '', 'displayName-count');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'displayName\']/contextTransform[@type=\''.$value.'\']', '', 'displayName');
+ $temp += self::_getFile($locale, '/ldml/contextTransforms/contextTransformUsage[@type=\'unit-pattern\']/contextTransform[@type=\''.$value.'\']', '', 'unit-pattern');
+ break;
+
+ case 'characters':
+ $temp = self::_getFile($locale, '/ldml/characters/exemplarCharacters', '', 'characters');
+ $temp += self::_getFile($locale, '/ldml/characters/exemplarCharacters[@type=\'auxiliary\']', '', 'auxiliary');
+ // $temp += self::_getFile($locale, '/ldml/characters/exemplarCharacters[@type=\'currencySymbol\']', '', 'currencySymbol');
+ break;
+
+ case 'delimiters':
+ $temp = self::_getFile($locale, '/ldml/delimiters/quotationStart', '', 'quoteStart');
+ $temp += self::_getFile($locale, '/ldml/delimiters/quotationEnd', '', 'quoteEnd');
+ $temp += self::_getFile($locale, '/ldml/delimiters/alternateQuotationStart', '', 'quoteStartAlt');
+ $temp += self::_getFile($locale, '/ldml/delimiters/alternateQuotationEnd', '', 'quoteEndAlt');
+ break;
+
+ case 'measurement':
+ $temp = self::_getFile('supplementalData', '/supplementalData/measurementData/measurementSystem[@type=\'metric\']', 'territories', 'metric');
+ $temp += self::_getFile('supplementalData', '/supplementalData/measurementData/measurementSystem[@type=\'US\']', 'territories', 'US');
+ $temp += self::_getFile('supplementalData', '/supplementalData/measurementData/paperSize[@type=\'A4\']', 'territories', 'A4');
+ $temp += self::_getFile('supplementalData', '/supplementalData/measurementData/paperSize[@type=\'US-Letter\']', 'territories', 'US-Letter');
+ break;
+
+ case 'months':
+ if (empty($value)) {
+ $value = "gregorian";
+ }
+ $temp['context'] = "format";
+ $temp['default'] = "wide";
+ $temp['format']['abbreviated'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/monthContext[@type=\'format\']/monthWidth[@type=\'abbreviated\']/month', 'type');
+ $temp['format']['narrow'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/monthContext[@type=\'format\']/monthWidth[@type=\'narrow\']/month', 'type');
+ $temp['format']['wide'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/monthContext[@type=\'format\']/monthWidth[@type=\'wide\']/month', 'type');
+ $temp['stand-alone']['abbreviated'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/monthContext[@type=\'stand-alone\']/monthWidth[@type=\'abbreviated\']/month', 'type');
+ $temp['stand-alone']['narrow'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/monthContext[@type=\'stand-alone\']/monthWidth[@type=\'narrow\']/month', 'type');
+ $temp['stand-alone']['wide'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/monthContext[@type=\'stand-alone\']/monthWidth[@type=\'wide\']/month', 'type');
+ break;
+
+ case 'month':
+ if (empty($value)) {
+ $value = array("gregorian", "format", "wide");
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/months/monthContext[@type=\'' . $value[1] . '\']/monthWidth[@type=\'' . $value[2] . '\']/month', 'type');
+ break;
+
+ case 'days':
+ if (empty($value)) {
+ $value = "gregorian";
+ }
+ $temp['context'] = "format";
+ $temp['default'] = "wide";
+ $temp['format']['abbreviated'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/dayContext[@type=\'format\']/dayWidth[@type=\'abbreviated\']/day', 'type');
+ $temp['format']['narrow'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/dayContext[@type=\'format\']/dayWidth[@type=\'narrow\']/day', 'type');
+ $temp['format']['wide'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/dayContext[@type=\'format\']/dayWidth[@type=\'wide\']/day', 'type');
+ $temp['stand-alone']['abbreviated'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/dayContext[@type=\'stand-alone\']/dayWidth[@type=\'abbreviated\']/day', 'type');
+ $temp['stand-alone']['narrow'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/dayContext[@type=\'stand-alone\']/dayWidth[@type=\'narrow\']/day', 'type');
+ $temp['stand-alone']['wide'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/dayContext[@type=\'stand-alone\']/dayWidth[@type=\'wide\']/day', 'type');
+ break;
+
+ case 'day':
+ if (empty($value)) {
+ $value = array("gregorian", "format", "wide");
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/days/dayContext[@type=\'' . $value[1] . '\']/dayWidth[@type=\'' . $value[2] . '\']/day', 'type');
+ break;
+
+ case 'week':
+ $minDays = self::_calendarDetail($locale, self::_getFile('supplementalData', '/supplementalData/weekData/minDays', 'territories'));
+ $firstDay = self::_calendarDetail($locale, self::_getFile('supplementalData', '/supplementalData/weekData/firstDay', 'territories'));
+ $weekStart = self::_calendarDetail($locale, self::_getFile('supplementalData', '/supplementalData/weekData/weekendStart', 'territories'));
+ $weekEnd = self::_calendarDetail($locale, self::_getFile('supplementalData', '/supplementalData/weekData/weekendEnd', 'territories'));
+
+ $temp = self::_getFile('supplementalData', "/supplementalData/weekData/minDays[@territories='" . $minDays . "']", 'count', 'minDays');
+ $temp += self::_getFile('supplementalData', "/supplementalData/weekData/firstDay[@territories='" . $firstDay . "']", 'day', 'firstDay');
+ $temp += self::_getFile('supplementalData', "/supplementalData/weekData/weekendStart[@territories='" . $weekStart . "']", 'day', 'weekendStart');
+ $temp += self::_getFile('supplementalData', "/supplementalData/weekData/weekendEnd[@territories='" . $weekEnd . "']", 'day', 'weekendEnd');
+ break;
+
+ case 'quarters':
+ if (empty($value)) {
+ $value = "gregorian";
+ }
+ $temp['format']['abbreviated'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/quarters/quarterContext[@type=\'format\']/quarterWidth[@type=\'abbreviated\']/quarter', 'type');
+ $temp['format']['narrow'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/quarters/quarterContext[@type=\'format\']/quarterWidth[@type=\'narrow\']/quarter', 'type');
+ $temp['format']['wide'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/quarters/quarterContext[@type=\'format\']/quarterWidth[@type=\'wide\']/quarter', 'type');
+ $temp['stand-alone']['abbreviated'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/quarters/quarterContext[@type=\'stand-alone\']/quarterWidth[@type=\'abbreviated\']/quarter', 'type');
+ $temp['stand-alone']['narrow'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/quarters/quarterContext[@type=\'stand-alone\']/quarterWidth[@type=\'narrow\']/quarter', 'type');
+ $temp['stand-alone']['wide'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/quarters/quarterContext[@type=\'stand-alone\']/quarterWidth[@type=\'wide\']/quarter', 'type');
+ break;
+
+ case 'quarter':
+ if (empty($value)) {
+ $value = array("gregorian", "format", "wide");
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/quarters/quarterContext[@type=\'' . $value[1] . '\']/quarterWidth[@type=\'' . $value[2] . '\']/quarter', 'type');
+ break;
+
+ case 'eras':
+ if (empty($value)) {
+ $value = "gregorian";
+ }
+ $temp['names'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/eras/eraNames/era', 'type');
+ $temp['abbreviated'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/eras/eraAbbr/era', 'type');
+ $temp['narrow'] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/eras/eraNarrow/era', 'type');
+ break;
+
+ case 'era':
+ if (empty($value)) {
+ $value = array("gregorian", "Abbr");
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/eras/era' . $value[1] . '/era', 'type');
+ break;
+
+ case 'date':
+ if (empty($value)) {
+ $value = "gregorian";
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateFormats/dateFormatLength[@type=\'full\']/dateFormat/pattern', '', 'full');
+ $temp += self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateFormats/dateFormatLength[@type=\'long\']/dateFormat/pattern', '', 'long');
+ $temp += self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateFormats/dateFormatLength[@type=\'medium\']/dateFormat/pattern', '', 'medium');
+ $temp += self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateFormats/dateFormatLength[@type=\'short\']/dateFormat/pattern', '', 'short');
+ break;
+
+ case 'time':
+ if (empty($value)) {
+ $value = "gregorian";
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/timeFormats/timeFormatLength[@type=\'full\']/timeFormat/pattern', '', 'full');
+ $temp += self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/timeFormats/timeFormatLength[@type=\'long\']/timeFormat/pattern', '', 'long');
+ $temp += self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/timeFormats/timeFormatLength[@type=\'medium\']/timeFormat/pattern', '', 'medium');
+ $temp += self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/timeFormats/timeFormatLength[@type=\'short\']/timeFormat/pattern', '', 'short');
+ break;
+
+ case 'datetime':
+ if (empty($value)) {
+ $value = "gregorian";
+ }
+
+ $timefull = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/timeFormats/timeFormatLength[@type=\'full\']/timeFormat/pattern', '', 'full');
+ $timelong = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/timeFormats/timeFormatLength[@type=\'long\']/timeFormat/pattern', '', 'long');
+ $timemedi = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/timeFormats/timeFormatLength[@type=\'medium\']/timeFormat/pattern', '', 'medi');
+ $timeshor = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/timeFormats/timeFormatLength[@type=\'short\']/timeFormat/pattern', '', 'shor');
+
+ $datefull = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateFormats/dateFormatLength[@type=\'full\']/dateFormat/pattern', '', 'full');
+ $datelong = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateFormats/dateFormatLength[@type=\'long\']/dateFormat/pattern', '', 'long');
+ $datemedi = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateFormats/dateFormatLength[@type=\'medium\']/dateFormat/pattern', '', 'medi');
+ $dateshor = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateFormats/dateFormatLength[@type=\'short\']/dateFormat/pattern', '', 'shor');
+
+ $full = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateTimeFormats/dateTimeFormatLength[@type=\'full\']/dateTimeFormat/pattern', '', 'full');
+ $long = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateTimeFormats/dateTimeFormatLength[@type=\'long\']/dateTimeFormat/pattern', '', 'long');
+ $medi = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateTimeFormats/dateTimeFormatLength[@type=\'medium\']/dateTimeFormat/pattern', '', 'medi');
+ $shor = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateTimeFormats/dateTimeFormatLength[@type=\'short\']/dateTimeFormat/pattern', '', 'shor');
+
+ $temp['full'] = str_replace(array('{0}', '{1}'), array($timefull['full'], $datefull['full']), $full['full']);
+ $temp['long'] = str_replace(array('{0}', '{1}'), array($timelong['long'], $datelong['long']), $long['long']);
+ $temp['medium'] = str_replace(array('{0}', '{1}'), array($timemedi['medi'], $datemedi['medi']), $medi['medi']);
+ $temp['short'] = str_replace(array('{0}', '{1}'), array($timeshor['shor'], $dateshor['shor']), $shor['shor']);
+ break;
+
+ case 'dateitem':
+ if (empty($value)) {
+ $value = "gregorian";
+ }
+ $_temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateTimeFormats/availableFormats/dateFormatItem', 'id');
+ foreach($_temp as $key => $found) {
+ $temp += self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateTimeFormats/availableFormats/dateFormatItem[@id=\'' . $key . '\']', '', $key);
+ }
+ break;
+
+ case 'dateinterval':
+ if (empty($value)) {
+ $value = "gregorian";
+ }
+ $_temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateTimeFormats/intervalFormats/intervalFormatItem', 'id');
+ foreach($_temp as $key => $found) {
+ $temp[$key] = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateTimeFormats/intervalFormats/intervalFormatItem[@id=\'' . $key . '\']/greatestDifference', 'id');
+ }
+ break;
+
+ case 'field':
+ if (empty($value)) {
+ $value = "gregorian";
+ }
+ $temp2 = self::_getFile($locale, '/ldml/dates/fields/field', 'type');
+ // $temp2 = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/fields/field', 'type');
+ foreach ($temp2 as $key => $keyvalue) {
+ $temp += self::_getFile($locale, '/ldml/dates/fields/field[@type=\'' . $key . '\']/displayName', '', $key);
+ // $temp += self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/fields/field[@type=\'' . $key . '\']/displayName', '', $key);
+ }
+ break;
+
+ case 'relative':
+ if (empty($value)) {
+ $value = "day";
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/fields/field[@type=\'' . $value . '\']/relative', 'type');
+ break;
+
+ case 'symbols':
+ $temp = self::_getFile($locale, '/ldml/numbers/symbols/decimal', '', 'decimal');
+ $temp += self::_getFile($locale, '/ldml/numbers/symbols/group', '', 'group');
+ $temp += self::_getFile($locale, '/ldml/numbers/symbols/list', '', 'list');
+ $temp += self::_getFile($locale, '/ldml/numbers/symbols/percentSign', '', 'percent');
+ $temp += self::_getFile($locale, '/ldml/numbers/symbols/nativeZeroDigit', '', 'zero');
+ $temp += self::_getFile($locale, '/ldml/numbers/symbols/patternDigit', '', 'pattern');
+ $temp += self::_getFile($locale, '/ldml/numbers/symbols/plusSign', '', 'plus');
+ $temp += self::_getFile($locale, '/ldml/numbers/symbols/minusSign', '', 'minus');
+ $temp += self::_getFile($locale, '/ldml/numbers/symbols/exponential', '', 'exponent');
+ $temp += self::_getFile($locale, '/ldml/numbers/symbols/perMille', '', 'mille');
+ $temp += self::_getFile($locale, '/ldml/numbers/symbols/infinity', '', 'infinity');
+ $temp += self::_getFile($locale, '/ldml/numbers/symbols/nan', '', 'nan');
+ break;
+
+ case 'nametocurrency':
+ $_temp = self::_getFile($locale, '/ldml/numbers/currencies/currency', 'type');
+ foreach ($_temp as $key => $found) {
+ $temp += self::_getFile($locale, '/ldml/numbers/currencies/currency[@type=\'' . $key . '\']/displayName', '', $key);
+ }
+ break;
+
+ case 'currencytoname':
+ $_temp = self::_getFile($locale, '/ldml/numbers/currencies/currency', 'type');
+ foreach ($_temp as $key => $keyvalue) {
+ $val = self::_getFile($locale, '/ldml/numbers/currencies/currency[@type=\'' . $key . '\']/displayName', '', $key);
+ if (!isset($val[$key])) {
+ continue;
+ }
+ if (!isset($temp[$val[$key]])) {
+ $temp[$val[$key]] = $key;
+ } else {
+ $temp[$val[$key]] .= " " . $key;
+ }
+ }
+ break;
+
+ case 'currencysymbol':
+ $_temp = self::_getFile($locale, '/ldml/numbers/currencies/currency', 'type');
+ foreach ($_temp as $key => $found) {
+ $temp += self::_getFile($locale, '/ldml/numbers/currencies/currency[@type=\'' . $key . '\']/symbol', '', $key);
+ }
+ break;
+
+ case 'question':
+ $temp = self::_getFile($locale, '/ldml/posix/messages/yesstr', '', 'yes');
+ $temp += self::_getFile($locale, '/ldml/posix/messages/nostr', '', 'no');
+ break;
+
+ case 'currencyfraction':
+ $_temp = self::_getFile('supplementalData', '/supplementalData/currencyData/fractions/info', 'iso4217');
+ foreach ($_temp as $key => $found) {
+ $temp += self::_getFile('supplementalData', '/supplementalData/currencyData/fractions/info[@iso4217=\'' . $key . '\']', 'digits', $key);
+ }
+ break;
+
+ case 'currencyrounding':
+ $_temp = self::_getFile('supplementalData', '/supplementalData/currencyData/fractions/info', 'iso4217');
+ foreach ($_temp as $key => $found) {
+ $temp += self::_getFile('supplementalData', '/supplementalData/currencyData/fractions/info[@iso4217=\'' . $key . '\']', 'rounding', $key);
+ }
+ break;
+
+ case 'currencytoregion':
+ $_temp = self::_getFile('supplementalData', '/supplementalData/currencyData/region', 'iso3166');
+ foreach ($_temp as $key => $keyvalue) {
+ $temp += self::_getFile('supplementalData', '/supplementalData/currencyData/region[@iso3166=\'' . $key . '\']/currency', 'iso4217', $key);
+ }
+ break;
+
+ case 'regiontocurrency':
+ $_temp = self::_getFile('supplementalData', '/supplementalData/currencyData/region', 'iso3166');
+ foreach ($_temp as $key => $keyvalue) {
+ $val = self::_getFile('supplementalData', '/supplementalData/currencyData/region[@iso3166=\'' . $key . '\']/currency', 'iso4217', $key);
+ if (!isset($val[$key])) {
+ continue;
+ }
+ if (!isset($temp[$val[$key]])) {
+ $temp[$val[$key]] = $key;
+ } else {
+ $temp[$val[$key]] .= " " . $key;
+ }
+ }
+ break;
+
+ case 'regiontoterritory':
+ $_temp = self::_getFile('supplementalData', '/supplementalData/territoryContainment/group', 'type');
+ foreach ($_temp as $key => $found) {
+ $temp += self::_getFile('supplementalData', '/supplementalData/territoryContainment/group[@type=\'' . $key . '\']', 'contains', $key);
+ }
+ break;
+
+ case 'territorytoregion':
+ $_temp2 = self::_getFile('supplementalData', '/supplementalData/territoryContainment/group', 'type');
+ $_temp = array();
+ foreach ($_temp2 as $key => $found) {
+ $_temp += self::_getFile('supplementalData', '/supplementalData/territoryContainment/group[@type=\'' . $key . '\']', 'contains', $key);
+ }
+ foreach($_temp as $key => $found) {
+ $_temp3 = explode(" ", $found);
+ foreach($_temp3 as $found3) {
+ if (!isset($temp[$found3])) {
+ $temp[$found3] = (string) $key;
+ } else {
+ $temp[$found3] .= " " . $key;
+ }
+ }
+ }
+ break;
+
+ case 'scripttolanguage':
+ $_temp = self::_getFile('supplementalData', '/supplementalData/languageData/language', 'type');
+ foreach ($_temp as $key => $found) {
+ $temp += self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $key . '\']', 'scripts', $key);
+ if (empty($temp[$key])) {
+ unset($temp[$key]);
+ }
+ }
+ break;
+
+ case 'languagetoscript':
+ $_temp2 = self::_getFile('supplementalData', '/supplementalData/languageData/language', 'type');
+ $_temp = array();
+ foreach ($_temp2 as $key => $found) {
+ $_temp += self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $key . '\']', 'scripts', $key);
+ }
+ foreach($_temp as $key => $found) {
+ $_temp3 = explode(" ", $found);
+ foreach($_temp3 as $found3) {
+ if (empty($found3)) {
+ continue;
+ }
+ if (!isset($temp[$found3])) {
+ $temp[$found3] = (string) $key;
+ } else {
+ $temp[$found3] .= " " . $key;
+ }
+ }
+ }
+ break;
+
+ case 'territorytolanguage':
+ $_temp = self::_getFile('supplementalData', '/supplementalData/languageData/language', 'type');
+ foreach ($_temp as $key => $found) {
+ $temp += self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $key . '\']', 'territories', $key);
+ if (empty($temp[$key])) {
+ unset($temp[$key]);
+ }
+ }
+ break;
+
+ case 'languagetoterritory':
+ $_temp2 = self::_getFile('supplementalData', '/supplementalData/languageData/language', 'type');
+ $_temp = array();
+ foreach ($_temp2 as $key => $found) {
+ $_temp += self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $key . '\']', 'territories', $key);
+ }
+ foreach($_temp as $key => $found) {
+ $_temp3 = explode(" ", $found);
+ foreach($_temp3 as $found3) {
+ if (empty($found3)) {
+ continue;
+ }
+ if (!isset($temp[$found3])) {
+ $temp[$found3] = (string) $key;
+ } else {
+ $temp[$found3] .= " " . $key;
+ }
+ }
+ }
+ break;
+
+ case 'timezonetowindows':
+ $_temp = self::_getFile('windowsZones', '/supplementalData/windowsZones/mapTimezones/mapZone', 'other');
+ foreach ($_temp as $key => $found) {
+ $temp += self::_getFile('windowsZones', '/supplementalData/windowsZones/mapTimezones/mapZone[@other=\'' . $key . '\']', 'type', $key);
+ }
+ break;
+
+ case 'windowstotimezone':
+ $_temp = self::_getFile('windowsZones', '/supplementalData/windowsZones/mapTimezones/mapZone', 'type');
+ foreach ($_temp as $key => $found) {
+ $temp += self::_getFile('windowsZones', '/supplementalData/windowsZones/mapTimezones/mapZone[@type=\'' .$key . '\']', 'other', $key);
+ }
+ break;
+
+ case 'territorytotimezone':
+ $_temp = self::_getFile('metaZones', '/supplementalData/metaZones/mapTimezones/mapZone', 'type');
+ foreach ($_temp as $key => $found) {
+ $temp += self::_getFile('metaZones', '/supplementalData/metaZones/mapTimezones/mapZone[@type=\'' . $key . '\']', 'territory', $key);
+ }
+ break;
+
+ case 'timezonetoterritory':
+ $_temp = self::_getFile('metaZones', '/supplementalData/metaZones/mapTimezones/mapZone', 'territory');
+ foreach ($_temp as $key => $found) {
+ $temp += self::_getFile('metaZones', '/supplementalData/metaZones/mapTimezones/mapZone[@territory=\'' . $key . '\']', 'type', $key);
+ }
+ break;
+
+ case 'citytotimezone':
+ $_temp = self::_getFile($locale, '/ldml/dates/timeZoneNames/zone', 'type');
+ foreach($_temp as $key => $found) {
+ $temp += self::_getFile($locale, '/ldml/dates/timeZoneNames/zone[@type=\'' . $key . '\']/exemplarCity', '', $key);
+ }
+ break;
+
+ case 'timezonetocity':
+ $_temp = self::_getFile($locale, '/ldml/dates/timeZoneNames/zone', 'type');
+ $temp = array();
+ foreach($_temp as $key => $found) {
+ $temp += self::_getFile($locale, '/ldml/dates/timeZoneNames/zone[@type=\'' . $key . '\']/exemplarCity', '', $key);
+ if (!empty($temp[$key])) {
+ $temp[$temp[$key]] = $key;
+ }
+ unset($temp[$key]);
+ }
+ break;
+
+ case 'phonetoterritory':
+ $_temp = self::_getFile('telephoneCodeData', '/supplementalData/telephoneCodeData/codesByTerritory', 'territory');
+ foreach ($_temp as $key => $keyvalue) {
+ $temp += self::_getFile('telephoneCodeData', '/supplementalData/telephoneCodeData/codesByTerritory[@territory=\'' . $key . '\']/telephoneCountryCode', 'code', $key);
+ }
+ break;
+
+ case 'territorytophone':
+ $_temp = self::_getFile('telephoneCodeData', '/supplementalData/telephoneCodeData/codesByTerritory', 'territory');
+ foreach ($_temp as $key => $keyvalue) {
+ $val = self::_getFile('telephoneCodeData', '/supplementalData/telephoneCodeData/codesByTerritory[@territory=\'' . $key . '\']/telephoneCountryCode', 'code', $key);
+ if (!isset($val[$key])) {
+ continue;
+ }
+ if (!isset($temp[$val[$key]])) {
+ $temp[$val[$key]] = $key;
+ } else {
+ $temp[$val[$key]] .= " " . $key;
+ }
+ }
+ break;
+
+ case 'numerictoterritory':
+ $_temp = self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes', 'type');
+ foreach ($_temp as $key => $keyvalue) {
+ $temp += self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes[@type=\'' . $key . '\']', 'numeric', $key);
+ }
+ break;
+
+ case 'territorytonumeric':
+ $_temp = self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes', 'numeric');
+ foreach ($_temp as $key => $keyvalue) {
+ $temp += self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes[@numeric=\'' . $key . '\']', 'type', $key);
+ }
+ break;
+
+ case 'alpha3toterritory':
+ $_temp = self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes', 'type');
+ foreach ($_temp as $key => $keyvalue) {
+ $temp += self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes[@type=\'' . $key . '\']', 'alpha3', $key);
+ }
+ break;
+
+ case 'territorytoalpha3':
+ $_temp = self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes', 'alpha3');
+ foreach ($_temp as $key => $keyvalue) {
+ $temp += self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes[@alpha3=\'' . $key . '\']', 'type', $key);
+ }
+ break;
+
+ case 'postaltoterritory':
+ $_temp = self::_getFile('postalCodeData', '/supplementalData/postalCodeData/postCodeRegex', 'territoryId');
+ foreach ($_temp as $key => $keyvalue) {
+ $temp += self::_getFile('postalCodeData', '/supplementalData/postalCodeData/postCodeRegex[@territoryId=\'' . $key . '\']', 'territoryId');
+ }
+ break;
+
+ case 'numberingsystem':
+ $_temp = self::_getFile('numberingSystems', '/supplementalData/numberingSystems/numberingSystem', 'id');
+ foreach ($_temp as $key => $keyvalue) {
+ $temp += self::_getFile('numberingSystems', '/supplementalData/numberingSystems/numberingSystem[@id=\'' . $key . '\']', 'digits', $key);
+ if (empty($temp[$key])) {
+ unset($temp[$key]);
+ }
+ }
+ break;
+
+ case 'chartofallback':
+ $_temp = self::_getFile('characters', '/supplementalData/characters/character-fallback/character', 'value');
+ foreach ($_temp as $key => $keyvalue) {
+ $temp2 = self::_getFile('characters', '/supplementalData/characters/character-fallback/character[@value=\'' . $key . '\']/substitute', '', $key);
+ $temp[current($temp2)] = $key;
+ }
+ break;
+
+ case 'fallbacktochar':
+ $_temp = self::_getFile('characters', '/supplementalData/characters/character-fallback/character', 'value');
+ foreach ($_temp as $key => $keyvalue) {
+ $temp += self::_getFile('characters', '/supplementalData/characters/character-fallback/character[@value=\'' . $key . '\']/substitute', '', $key);
+ }
+ break;
+
+ case 'localeupgrade':
+ $_temp = self::_getFile('likelySubtags', '/supplementalData/likelySubtags/likelySubtag', 'from');
+ foreach ($_temp as $key => $keyvalue) {
+ $temp += self::_getFile('likelySubtags', '/supplementalData/likelySubtags/likelySubtag[@from=\'' . $key . '\']', 'to', $key);
+ }
+ break;
+
+ case 'unit':
+ $_temp = self::_getFile($locale, '/ldml/units/unitLength/unit', 'type');
+ foreach($_temp as $key => $keyvalue) {
+ $_temp2 = self::_getFile($locale, '/ldml/units/unitLength/unit[@type=\'' . $key . '\']/unitPattern', 'count');
+ $temp[$key] = $_temp2;
+ }
+ break;
+
+ default :
+ throw new Zend_Locale_Exception("Unknown list ($path) for parsing locale data.");
+ break;
+ }
+
+ if (isset(self::$_cache)) {
+ if (self::$_cacheTags) {
+ self::$_cache->save( serialize($temp), $id, array('Zend_Locale'));
+ } else {
+ self::$_cache->save( serialize($temp), $id);
+ }
+ }
+
+ return $temp;
+ }
+
+ /**
+ * Read the LDML file, get a single path defined value
+ *
+ * @param string $locale
+ * @param string $path
+ * @param bool|string $value
+ * @return string
+ * @throws Zend_Locale_Exception
+ */
+ public static function getContent($locale, $path, $value = false)
+ {
+ $locale = self::_checkLocale($locale);
+
+ if (!isset(self::$_cache) && !self::$_cacheDisabled) {
+ self::$_cache = Zend_Cache::factory(
+ 'Core',
+ 'File',
+ array('automatic_serialization' => true),
+ array());
+ }
+
+ $val = $value;
+ if (is_array($value)) {
+ $val = implode('_' , $value);
+ }
+ $val = urlencode($val);
+ $id = self::_filterCacheId('Zend_LocaleC_' . $locale . '_' . $path . '_' . $val);
+ if (!self::$_cacheDisabled && ($result = self::$_cache->load($id))) {
+ return unserialize($result);
+ }
+
+ switch(strtolower($path)) {
+ case 'language':
+ $temp = self::_getFile($locale, '/ldml/localeDisplayNames/languages/language[@type=\'' . $value . '\']', 'type');
+ break;
+
+ case 'script':
+ $temp = self::_getFile($locale, '/ldml/localeDisplayNames/scripts/script[@type=\'' . $value . '\']', 'type');
+ break;
+
+ case 'country':
+ case 'territory':
+ $temp = self::_getFile($locale, '/ldml/localeDisplayNames/territories/territory[@type=\'' . $value . '\']', 'type');
+ break;
+
+ case 'variant':
+ $temp = self::_getFile($locale, '/ldml/localeDisplayNames/variants/variant[@type=\'' . $value . '\']', 'type');
+ break;
+
+ case 'key':
+ $temp = self::_getFile($locale, '/ldml/localeDisplayNames/keys/key[@type=\'' . $value . '\']', 'type');
+ break;
+
+ case 'defaultcalendar':
+ $givenLocale = new Zend_Locale($locale);
+ $territory = $givenLocale->getRegion();
+ unset($givenLocale);
+ $temp = self::_getFile('supplementalData', '/supplementalData/calendarPreferenceData/calendarPreference[contains(@territories,\'' . $territory . '\')]', 'ordering', 'ordering');
+ if (isset($temp['ordering'])) {
+ list($temp) = explode(' ', $temp['ordering']);
+ } else {
+ $temp = 'gregorian';
+ }
+ break;
+
+ case 'monthcontext':
+ /* default context is always 'format'
+ if (empty ($value)) {
+ $value = "gregorian";
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/default', 'choice', 'context');
+ */
+ $temp = 'format';
+ break;
+
+ case 'defaultmonth':
+ /* default width is always 'wide'
+ if (empty ($value)) {
+ $value = "gregorian";
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/months/monthContext[@type=\'format\']/default', 'choice', 'default');
+ */
+ $temp = 'wide';
+ break;
+
+ case 'month':
+ if (!is_array($value)) {
+ $temp = $value;
+ $value = array("gregorian", "format", "wide", $temp);
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/months/monthContext[@type=\'' . $value[1] . '\']/monthWidth[@type=\'' . $value[2] . '\']/month[@type=\'' . $value[3] . '\']', 'type');
+ break;
+
+ case 'daycontext':
+ /* default context is always 'format'
+ if (empty($value)) {
+ $value = "gregorian";
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/default', 'choice', 'context');
+ */
+ $temp = 'format';
+ break;
+
+ case 'defaultday':
+ /* default width is always 'wide'
+ if (empty($value)) {
+ $value = "gregorian";
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/days/dayContext[@type=\'format\']/default', 'choice', 'default');
+ */
+ $temp = 'wide';
+ break;
+
+ case 'day':
+ if (!is_array($value)) {
+ $temp = $value;
+ $value = array("gregorian", "format", "wide", $temp);
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/days/dayContext[@type=\'' . $value[1] . '\']/dayWidth[@type=\'' . $value[2] . '\']/day[@type=\'' . $value[3] . '\']', 'type');
+ break;
+
+ case 'quarter':
+ if (!is_array($value)) {
+ $temp = $value;
+ $value = array("gregorian", "format", "wide", $temp);
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/quarters/quarterContext[@type=\'' . $value[1] . '\']/quarterWidth[@type=\'' . $value[2] . '\']/quarter[@type=\'' . $value[3] . '\']', 'type');
+ break;
+
+ case 'am':
+ if (empty($value)) {
+ $value = array("gregorian", "format", "wide");
+ }
+ if (!is_array($value)) {
+ $temp = $value;
+ $value = array($temp, "format", "wide");
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/dayPeriods/dayPeriodContext[@type=\'' . $value[1] . '\']/dayPeriodWidth[@type=\'' . $value[2] . '\']/dayPeriod[@type=\'am\']', '', 'dayPeriod');
+ break;
+
+ case 'pm':
+ if (empty($value)) {
+ $value = array("gregorian", "format", "wide");
+ }
+ if (!is_array($value)) {
+ $temp = $value;
+ $value = array($temp, "format", "wide");
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/dayPeriods/dayPeriodContext[@type=\'' . $value[1] . '\']/dayPeriodWidth[@type=\'' . $value[2] . '\']/dayPeriod[@type=\'pm\']', '', 'dayPeriod');
+ break;
+
+ case 'era':
+ if (!is_array($value)) {
+ $temp = $value;
+ $value = array("gregorian", "Abbr", $temp);
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/eras/era' . $value[1] . '/era[@type=\'' . $value[2] . '\']', 'type');
+ break;
+
+ case 'defaultdate':
+ /* default choice is deprecated in CDLR - should be always medium here
+ if (empty($value)) {
+ $value = "gregorian";
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/dateFormats/default', 'choice', 'default');
+ */
+ $temp = 'medium';
+ break;
+
+ case 'date':
+ if (empty($value)) {
+ $value = array("gregorian", "medium");
+ }
+ if (!is_array($value)) {
+ $temp = $value;
+ $value = array("gregorian", $temp);
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/dateFormats/dateFormatLength[@type=\'' . $value[1] . '\']/dateFormat/pattern', '', 'pattern');
+ break;
+
+ case 'defaulttime':
+ /* default choice is deprecated in CDLR - should be always medium here
+ if (empty($value)) {
+ $value = "gregorian";
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value . '\']/timeFormats/default', 'choice', 'default');
+ */
+ $temp = 'medium';
+ break;
+
+ case 'time':
+ if (empty($value)) {
+ $value = array("gregorian", "medium");
+ }
+ if (!is_array($value)) {
+ $temp = $value;
+ $value = array("gregorian", $temp);
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/timeFormats/timeFormatLength[@type=\'' . $value[1] . '\']/timeFormat/pattern', '', 'pattern');
+ break;
+
+ case 'datetime':
+ if (empty($value)) {
+ $value = array("gregorian", "medium");
+ }
+ if (!is_array($value)) {
+ $temp = $value;
+ $value = array("gregorian", $temp);
+ }
+
+ $date = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/dateFormats/dateFormatLength[@type=\'' . $value[1] . '\']/dateFormat/pattern', '', 'pattern');
+ $time = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/timeFormats/timeFormatLength[@type=\'' . $value[1] . '\']/timeFormat/pattern', '', 'pattern');
+ $datetime = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/dateTimeFormats/dateTimeFormatLength[@type=\'' . $value[1] . '\']/dateTimeFormat/pattern', '', 'pattern');
+ $temp = str_replace(array('{0}', '{1}'), array(current($time), current($date)), current($datetime));
+ break;
+
+ case 'dateitem':
+ if (empty($value)) {
+ $value = array("gregorian", "yyMMdd");
+ }
+ if (!is_array($value)) {
+ $temp = $value;
+ $value = array("gregorian", $temp);
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/dateTimeFormats/availableFormats/dateFormatItem[@id=\'' . $value[1] . '\']', '');
+ break;
+
+ case 'dateinterval':
+ if (empty($value)) {
+ $value = array("gregorian", "yMd", "y");
+ }
+ if (!is_array($value)) {
+ $temp = $value;
+ $value = array("gregorian", $temp, $temp[0]);
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/dateTimeFormats/intervalFormats/intervalFormatItem[@id=\'' . $value[1] . '\']/greatestDifference[@id=\'' . $value[2] . '\']', '');
+ break;
+
+ case 'field':
+ if (!is_array($value)) {
+ $temp = $value;
+ $value = array("gregorian", $temp);
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/fields/field[@type=\'' . $value[1] . '\']/displayName', '', $value[1]);
+ break;
+
+ case 'relative':
+ if (!is_array($value)) {
+ $temp = $value;
+ $value = array("gregorian", $temp);
+ }
+ $temp = self::_getFile($locale, '/ldml/dates/fields/field[@type=\'day\']/relative[@type=\'' . $value[1] . '\']', '', $value[1]);
+ // $temp = self::_getFile($locale, '/ldml/dates/calendars/calendar[@type=\'' . $value[0] . '\']/fields/field/relative[@type=\'' . $value[1] . '\']', '', $value[1]);
+ break;
+
+ case 'defaultnumberingsystem':
+ $temp = self::_getFile($locale, '/ldml/numbers/defaultNumberingSystem', '', 'default');
+ break;
+
+ case 'decimalnumber':
+ $temp = self::_getFile($locale, '/ldml/numbers/decimalFormats/decimalFormatLength/decimalFormat/pattern', '', 'default');
+ break;
+
+ case 'scientificnumber':
+ $temp = self::_getFile($locale, '/ldml/numbers/scientificFormats/scientificFormatLength/scientificFormat/pattern', '', 'default');
+ break;
+
+ case 'percentnumber':
+ $temp = self::_getFile($locale, '/ldml/numbers/percentFormats/percentFormatLength/percentFormat/pattern', '', 'default');
+ break;
+
+ case 'currencynumber':
+ $temp = self::_getFile($locale, '/ldml/numbers/currencyFormats/currencyFormatLength/currencyFormat/pattern', '', 'default');
+ break;
+
+ case 'nametocurrency':
+ $temp = self::_getFile($locale, '/ldml/numbers/currencies/currency[@type=\'' . $value . '\']/displayName', '', $value);
+ break;
+
+ case 'currencytoname':
+ $temp = self::_getFile($locale, '/ldml/numbers/currencies/currency[@type=\'' . $value . '\']/displayName', '', $value);
+ $_temp = self::_getFile($locale, '/ldml/numbers/currencies/currency', 'type');
+ $temp = array();
+ foreach ($_temp as $key => $keyvalue) {
+ $val = self::_getFile($locale, '/ldml/numbers/currencies/currency[@type=\'' . $key . '\']/displayName', '', $key);
+ if (!isset($val[$key]) or ($val[$key] != $value)) {
+ continue;
+ }
+ if (!isset($temp[$val[$key]])) {
+ $temp[$val[$key]] = $key;
+ } else {
+ $temp[$val[$key]] .= " " . $key;
+ }
+ }
+ break;
+
+ case 'currencysymbol':
+ $temp = self::_getFile($locale, '/ldml/numbers/currencies/currency[@type=\'' . $value . '\']/symbol', '', $value);
+ break;
+
+ case 'question':
+ $temp = self::_getFile($locale, '/ldml/posix/messages/' . $value . 'str', '', $value);
+ break;
+
+ case 'currencyfraction':
+ if (empty($value)) {
+ $value = "DEFAULT";
+ }
+ $temp = self::_getFile('supplementalData', '/supplementalData/currencyData/fractions/info[@iso4217=\'' . $value . '\']', 'digits', 'digits');
+ break;
+
+ case 'currencyrounding':
+ if (empty($value)) {
+ $value = "DEFAULT";
+ }
+ $temp = self::_getFile('supplementalData', '/supplementalData/currencyData/fractions/info[@iso4217=\'' . $value . '\']', 'rounding', 'rounding');
+ break;
+
+ case 'currencytoregion':
+ $temp = self::_getFile('supplementalData', '/supplementalData/currencyData/region[@iso3166=\'' . $value . '\']/currency', 'iso4217', $value);
+ break;
+
+ case 'regiontocurrency':
+ $_temp = self::_getFile('supplementalData', '/supplementalData/currencyData/region', 'iso3166');
+ $temp = array();
+ foreach ($_temp as $key => $keyvalue) {
+ $val = self::_getFile('supplementalData', '/supplementalData/currencyData/region[@iso3166=\'' . $key . '\']/currency', 'iso4217', $key);
+ if (!isset($val[$key]) or ($val[$key] != $value)) {
+ continue;
+ }
+ if (!isset($temp[$val[$key]])) {
+ $temp[$val[$key]] = $key;
+ } else {
+ $temp[$val[$key]] .= " " . $key;
+ }
+ }
+ break;
+
+ case 'regiontoterritory':
+ $temp = self::_getFile('supplementalData', '/supplementalData/territoryContainment/group[@type=\'' . $value . '\']', 'contains', $value);
+ break;
+
+ case 'territorytoregion':
+ $_temp2 = self::_getFile('supplementalData', '/supplementalData/territoryContainment/group', 'type');
+ $_temp = array();
+ foreach ($_temp2 as $key => $found) {
+ $_temp += self::_getFile('supplementalData', '/supplementalData/territoryContainment/group[@type=\'' . $key . '\']', 'contains', $key);
+ }
+ $temp = array();
+ foreach($_temp as $key => $found) {
+ $_temp3 = explode(" ", $found);
+ foreach($_temp3 as $found3) {
+ if ($found3 !== $value) {
+ continue;
+ }
+ if (!isset($temp[$found3])) {
+ $temp[$found3] = (string) $key;
+ } else {
+ $temp[$found3] .= " " . $key;
+ }
+ }
+ }
+ break;
+
+ case 'scripttolanguage':
+ $temp = self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $value . '\']', 'scripts', $value);
+ break;
+
+ case 'languagetoscript':
+ $_temp2 = self::_getFile('supplementalData', '/supplementalData/languageData/language', 'type');
+ $_temp = array();
+ foreach ($_temp2 as $key => $found) {
+ $_temp += self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $key . '\']', 'scripts', $key);
+ }
+ $temp = array();
+ foreach($_temp as $key => $found) {
+ $_temp3 = explode(" ", $found);
+ foreach($_temp3 as $found3) {
+ if ($found3 !== $value) {
+ continue;
+ }
+ if (!isset($temp[$found3])) {
+ $temp[$found3] = (string) $key;
+ } else {
+ $temp[$found3] .= " " . $key;
+ }
+ }
+ }
+ break;
+
+ case 'territorytolanguage':
+ $temp = self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $value . '\']', 'territories', $value);
+ break;
+
+ case 'languagetoterritory':
+ $_temp2 = self::_getFile('supplementalData', '/supplementalData/languageData/language', 'type');
+ $_temp = array();
+ foreach ($_temp2 as $key => $found) {
+ $_temp += self::_getFile('supplementalData', '/supplementalData/languageData/language[@type=\'' . $key . '\']', 'territories', $key);
+ }
+ $temp = array();
+ foreach($_temp as $key => $found) {
+ $_temp3 = explode(" ", $found);
+ foreach($_temp3 as $found3) {
+ if ($found3 !== $value) {
+ continue;
+ }
+ if (!isset($temp[$found3])) {
+ $temp[$found3] = (string) $key;
+ } else {
+ $temp[$found3] .= " " . $key;
+ }
+ }
+ }
+ break;
+
+ case 'timezonetowindows':
+ $temp = self::_getFile('windowsZones', '/supplementalData/windowsZones/mapTimezones/mapZone[@other=\''.$value.'\']', 'type', $value);
+ break;
+
+ case 'windowstotimezone':
+ $temp = self::_getFile('windowsZones', '/supplementalData/windowsZones/mapTimezones/mapZone[@type=\''.$value.'\']', 'other', $value);
+ break;
+
+ case 'territorytotimezone':
+ $temp = self::_getFile('metaZones', '/supplementalData/metaZones/mapTimezones/mapZone[@type=\'' . $value . '\']', 'territory', $value);
+ break;
+
+ case 'timezonetoterritory':
+ $temp = self::_getFile('metaZones', '/supplementalData/metaZones/mapTimezones/mapZone[@territory=\'' . $value . '\']', 'type', $value);
+ break;
+
+ case 'citytotimezone':
+ $temp = self::_getFile($locale, '/ldml/dates/timeZoneNames/zone[@type=\'' . $value . '\']/exemplarCity', '', $value);
+ break;
+
+ case 'timezonetocity':
+ $_temp = self::_getFile($locale, '/ldml/dates/timeZoneNames/zone', 'type');
+ $temp = array();
+ foreach($_temp as $key => $found) {
+ $temp += self::_getFile($locale, '/ldml/dates/timeZoneNames/zone[@type=\'' . $key . '\']/exemplarCity', '', $key);
+ if (!empty($temp[$key])) {
+ if ($temp[$key] == $value) {
+ $temp[$temp[$key]] = $key;
+ }
+ }
+ unset($temp[$key]);
+ }
+ break;
+
+ case 'phonetoterritory':
+ $temp = self::_getFile('telephoneCodeData', '/supplementalData/telephoneCodeData/codesByTerritory[@territory=\'' . $value . '\']/telephoneCountryCode', 'code', $value);
+ break;
+
+ case 'territorytophone':
+ $_temp2 = self::_getFile('telephoneCodeData', '/supplementalData/telephoneCodeData/codesByTerritory', 'territory');
+ $_temp = array();
+ foreach ($_temp2 as $key => $found) {
+ $_temp += self::_getFile('telephoneCodeData', '/supplementalData/telephoneCodeData/codesByTerritory[@territory=\'' . $key . '\']/telephoneCountryCode', 'code', $key);
+ }
+ $temp = array();
+ foreach($_temp as $key => $found) {
+ $_temp3 = explode(" ", $found);
+ foreach($_temp3 as $found3) {
+ if ($found3 !== $value) {
+ continue;
+ }
+ if (!isset($temp[$found3])) {
+ $temp[$found3] = (string) $key;
+ } else {
+ $temp[$found3] .= " " . $key;
+ }
+ }
+ }
+ break;
+
+ case 'numerictoterritory':
+ $temp = self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes[@type=\''.$value.'\']', 'numeric', $value);
+ break;
+
+ case 'territorytonumeric':
+ $temp = self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes[@numeric=\''.$value.'\']', 'type', $value);
+ break;
+
+ case 'alpha3toterritory':
+ $temp = self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes[@type=\''.$value.'\']', 'alpha3', $value);
+ break;
+
+ case 'territorytoalpha3':
+ $temp = self::_getFile('supplementalData', '/supplementalData/codeMappings/territoryCodes[@alpha3=\''.$value.'\']', 'type', $value);
+ break;
+
+ case 'postaltoterritory':
+ $temp = self::_getFile('postalCodeData', '/supplementalData/postalCodeData/postCodeRegex[@territoryId=\'' . $value . '\']', 'territoryId');
+ break;
+
+ case 'numberingsystem':
+ $temp = self::_getFile('numberingSystems', '/supplementalData/numberingSystems/numberingSystem[@id=\'' . strtolower($value) . '\']', 'digits', $value);
+ break;
+
+ case 'chartofallback':
+ $_temp = self::_getFile('characters', '/supplementalData/characters/character-fallback/character', 'value');
+ foreach ($_temp as $key => $keyvalue) {
+ $temp2 = self::_getFile('characters', '/supplementalData/characters/character-fallback/character[@value=\'' . $key . '\']/substitute', '', $key);
+ if (current($temp2) == $value) {
+ $temp = $key;
+ }
+ }
+ break;
+
+ $temp = self::_getFile('characters', '/supplementalData/characters/character-fallback/character[@value=\'' . $value . '\']/substitute', '', $value);
+ break;
+
+ case 'fallbacktochar':
+ $temp = self::_getFile('characters', '/supplementalData/characters/character-fallback/character[@value=\'' . $value . '\']/substitute', '');
+ break;
+
+ case 'localeupgrade':
+ $temp = self::_getFile('likelySubtags', '/supplementalData/likelySubtags/likelySubtag[@from=\'' . $value . '\']', 'to', $value);
+ break;
+
+ case 'unit':
+ $temp = self::_getFile($locale, '/ldml/units/unitLength/unit[@type=\'' . $value[0] . '\']/unitPattern[@count=\'' . $value[1] . '\']', '');
+ break;
+
+ case 'parentlocale':
+ if (false === $value) {
+ $value = $locale;
+ }
+ $temp = self::_getFile('supplementalData', "/supplementalData/parentLocales/parentLocale[contains(@locales, '" . $value . "')]", 'parent', 'parent');
+ break;
+
+ default :
+ throw new Zend_Locale_Exception("Unknown detail ($path) for parsing locale data.");
+ break;
+ }
+
+ if (is_array($temp)) {
+ $temp = current($temp);
+ }
+ if (isset(self::$_cache)) {
+ if (self::$_cacheTags) {
+ self::$_cache->save( serialize($temp), $id, array('Zend_Locale'));
+ } else {
+ self::$_cache->save( serialize($temp), $id);
+ }
+ }
+
+ return $temp;
+ }
+
+ /**
+ * Returns the set cache
+ *
+ * @return Zend_Cache_Core The set cache
+ */
+ public static function getCache()
+ {
+ return self::$_cache;
+ }
+
+ /**
+ * Set a cache for Zend_Locale_Data
+ *
+ * @param Zend_Cache_Core $cache A cache frontend
+ */
+ public static function setCache(Zend_Cache_Core $cache)
+ {
+ self::$_cache = $cache;
+ self::_getTagSupportForCache();
+ }
+
+ /**
+ * Returns true when a cache is set
+ *
+ * @return boolean
+ */
+ public static function hasCache()
+ {
+ if (self::$_cache !== null) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Removes any set cache
+ *
+ * @return void
+ */
+ public static function removeCache()
+ {
+ self::$_cache = null;
+ }
+
+ /**
+ * Clears all set cache data
+ *
+ * @return void
+ */
+ public static function clearCache()
+ {
+ if (self::$_cacheTags) {
+ self::$_cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array('Zend_Locale'));
+ } else {
+ self::$_cache->clean(Zend_Cache::CLEANING_MODE_ALL);
+ }
+ }
+
+ /**
+ * Disables the cache
+ *
+ * @param bool $flag
+ */
+ public static function disableCache($flag)
+ {
+ self::$_cacheDisabled = (boolean) $flag;
+ }
+
+ /**
+ * Internal method to check if the given cache supports tags
+ *
+ * @return bool
+ */
+ private static function _getTagSupportForCache()
+ {
+ $backend = self::$_cache->getBackend();
+ if ($backend instanceof Zend_Cache_Backend_ExtendedInterface) {
+ $cacheOptions = $backend->getCapabilities();
+ self::$_cacheTags = $cacheOptions['tags'];
+ } else {
+ self::$_cacheTags = false;
+ }
+
+ return self::$_cacheTags;
+ }
+
+ /**
+ * Filter an ID to only allow valid variable characters
+ *
+ * @param string $value
+ * @return string
+ */
+ protected static function _filterCacheId($value)
+ {
+ return strtr(
+ $value,
+ array(
+ '-' => '_',
+ '%' => '_',
+ '+' => '_',
+ '.' => '_',
+ )
+ );
+ }
+}
diff --git a/library/vendor/Zend/Locale/Data/Translation.php b/library/vendor/Zend/Locale/Data/Translation.php
new file mode 100644
index 0000000..ceb16a9
--- /dev/null
+++ b/library/vendor/Zend/Locale/Data/Translation.php
@@ -0,0 +1,285 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Locale
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Definition class for all Windows locales
+ *
+ * Based on this two lists:
+ * @link http://msdn.microsoft.com/en-us/library/39cwe7zf.aspx
+ * @link http://msdn.microsoft.com/en-us/library/cdax410z.aspx
+ * @link http://msdn.microsoft.com/en-us/goglobal/bb964664.aspx
+ * @link http://msdn.microsoft.com/en-us/goglobal/bb895996.aspx
+ *
+ * @category Zend
+ * @package Zend_Locale
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Locale_Data_Translation
+{
+ /**
+ * Locale Translation for Full Named Locales
+ *
+ * @var array $localeTranslation
+ */
+ public static $languageTranslation = array(
+ 'Afrikaans' => 'af',
+ 'Albanian' => 'sq',
+ 'Amharic' => 'am',
+ 'Arabic' => 'ar',
+ 'Armenian' => 'hy',
+ 'Assamese' => 'as',
+ 'Azeri' => 'az',
+ 'Azeri Latin' => 'az_Latn',
+ 'Azeri Cyrillic' => 'az_Cyrl',
+ 'Basque' => 'eu',
+ 'Belarusian' => 'be',
+ 'Bengali' => 'bn',
+ 'Bengali Latin' => 'bn_Latn',
+ 'Bosnian' => 'bs',
+ 'Bulgarian' => 'bg',
+ 'Burmese' => 'my',
+ 'Catalan' => 'ca',
+ 'Cherokee' => 'chr',
+ 'Chinese' => 'zh',
+ 'Croatian' => 'hr',
+ 'Czech' => 'cs',
+ 'Danish' => 'da',
+ 'Divehi' => 'dv',
+ 'Dutch' => 'nl',
+ 'English' => 'en',
+ 'Estonian' => 'et',
+ 'Faroese' => 'fo',
+ 'Faeroese' => 'fo',
+ 'Farsi' => 'fa',
+ 'Filipino' => 'fil',
+ 'Finnish' => 'fi',
+ 'French' => 'fr',
+ 'Frisian' => 'fy',
+ 'Gaelic' => 'gd',
+ 'Galician' => 'gl',
+ 'Georgian' => 'ka',
+ 'German' => 'de',
+ 'Greek' => 'el',
+ 'Guarani' => 'gn',
+ 'Gujarati' => 'gu',
+ 'Hausa' => 'ha',
+ 'Hawaiian' => 'haw',
+ 'Hebrew' => 'he',
+ 'Hindi' => 'hi',
+ 'Hungarian' => 'hu',
+ 'Icelandic' => 'is',
+ 'Igbo' => 'ig',
+ 'Indonesian' => 'id',
+ 'Inuktitut' => 'iu',
+ 'Italian' => 'it',
+ 'Japanese' => 'ja',
+ 'Kannada' => 'kn',
+ 'Kanuri' => 'kr',
+ 'Kashmiri' => 'ks',
+ 'Kazakh' => 'kk',
+ 'Khmer' => 'km',
+ 'Konkani' => 'kok',
+ 'Korean' => 'ko',
+ 'Kyrgyz' => 'ky',
+ 'Lao' => 'lo',
+ 'Latin' => 'la',
+ 'Latvian' => 'lv',
+ 'Lithuanian' => 'lt',
+ 'Macedonian' => 'mk',
+ 'Malay' => 'ms',
+ 'Malayalam' => 'ml',
+ 'Maltese' => 'mt',
+ 'Manipuri' => 'mni',
+ 'Maori' => 'mi',
+ 'Marathi' => 'mr',
+ 'Mongolian' => 'mn',
+ 'Nepali' => 'ne',
+ 'Norwegian' => 'no',
+ 'Norwegian Bokmal' => 'nb',
+ 'Norwegian Nynorsk' => 'nn',
+ 'Oriya' => 'or',
+ 'Oromo' => 'om',
+ 'Papiamentu' => 'pap',
+ 'Pashto' => 'ps',
+ 'Polish' => 'pl',
+ 'Portuguese' => 'pt',
+ 'Punjabi' => 'pa',
+ 'Quecha' => 'qu',
+ 'Quechua' => 'qu',
+ 'Rhaeto-Romanic' => 'rm',
+ 'Romanian' => 'ro',
+ 'Russian' => 'ru',
+ 'Sami' => 'smi',
+ 'Sami Inari' => 'smn',
+ 'Sami Lule' => 'smj',
+ 'Sami Northern' => 'se',
+ 'Sami Skolt' => 'sms',
+ 'Sami Southern' => 'sma',
+ 'Sanskrit' => 'sa',
+ 'Serbian' => 'sr',
+ 'Serbian Latin' => 'sr_Latn',
+ 'Serbian Cyrillic' => 'sr_Cyrl',
+ 'Sindhi' => 'sd',
+ 'Sinhalese' => 'si',
+ 'Slovak' => 'sk',
+ 'Slovenian' => 'sl',
+ 'Somali' => 'so',
+ 'Sorbian' => 'wen',
+ 'Spanish' => 'es',
+ 'Swahili' => 'sw',
+ 'Swedish' => 'sv',
+ 'Syriac' => 'syr',
+ 'Tajik' => 'tg',
+ 'Tamazight' => 'tmh',
+ 'Tamil' => 'ta',
+ 'Tatar' => 'tt',
+ 'Telugu' => 'te',
+ 'Thai' => 'th',
+ 'Tibetan' => 'bo',
+ 'Tigrigna' => 'ti',
+ 'Tsonga' => 'ts',
+ 'Tswana' => 'tn',
+ 'Turkish' => 'tr',
+ 'Turkmen' => 'tk',
+ 'Uighur' => 'ug',
+ 'Ukrainian' => 'uk',
+ 'Urdu' => 'ur',
+ 'Uzbek' => 'uz',
+ 'Uzbek Latin' => 'uz_Latn',
+ 'Uzbek Cyrillic' => 'uz_Cyrl',
+ 'Venda' => 've',
+ 'Vietnamese' => 'vi',
+ 'Welsh' => 'cy',
+ 'Xhosa' => 'xh',
+ 'Yiddish' => 'yi',
+ 'Yoruba' => 'yo',
+ 'Zulu' => 'zu',
+ );
+
+ public static $regionTranslation = array(
+ 'Albania' => 'AL',
+ 'Algeria' => 'DZ',
+ 'Argentina' => 'AR',
+ 'Armenia' => 'AM',
+ 'Australia' => 'AU',
+ 'Austria' => 'AT',
+ 'Bahrain' => 'BH',
+ 'Bangladesh' => 'BD',
+ 'Belgium' => 'BE',
+ 'Belize' => 'BZ',
+ 'Bhutan' => 'BT',
+ 'Bolivia' => 'BO',
+ 'Bosnia Herzegovina' => 'BA',
+ 'Brazil' => 'BR',
+ 'Brazilian' => 'BR',
+ 'Brunei Darussalam' => 'BN',
+ 'Cameroon' => 'CM',
+ 'Canada' => 'CA',
+ 'Chile' => 'CL',
+ 'China' => 'CN',
+ 'Colombia' => 'CO',
+ 'Costa Rica' => 'CR',
+ "Cote d'Ivoire" => 'CI',
+ 'Czech Republic' => 'CZ',
+ 'Dominican Republic' => 'DO',
+ 'Denmark' => 'DK',
+ 'Ecuador' => 'EC',
+ 'Egypt' => 'EG',
+ 'El Salvador' => 'SV',
+ 'Eritrea' => 'ER',
+ 'Ethiopia' => 'ET',
+ 'Finland' => 'FI',
+ 'France' => 'FR',
+ 'Germany' => 'DE',
+ 'Greece' => 'GR',
+ 'Guatemala' => 'GT',
+ 'Haiti' => 'HT',
+ 'Honduras' => 'HN',
+ 'Hong Kong' => 'HK',
+ 'Hong Kong SAR' => 'HK',
+ 'Hungary' => 'HU',
+ 'Iceland' => 'IS',
+ 'India' => 'IN',
+ 'Indonesia' => 'ID',
+ 'Iran' => 'IR',
+ 'Iraq' => 'IQ',
+ 'Ireland' => 'IE',
+ 'Italy' => 'IT',
+ 'Jamaica' => 'JM',
+ 'Japan' => 'JP',
+ 'Jordan' => 'JO',
+ 'Korea' => 'KR',
+ 'Kuwait' => 'KW',
+ 'Lebanon' => 'LB',
+ 'Libya' => 'LY',
+ 'Liechtenstein' => 'LI',
+ 'Luxembourg' => 'LU',
+ 'Macau' => 'MO',
+ 'Macao SAR' => 'MO',
+ 'Malaysia' => 'MY',
+ 'Mali' => 'ML',
+ 'Mexico' => 'MX',
+ 'Moldava' => 'MD',
+ 'Monaco' => 'MC',
+ 'Morocco' => 'MA',
+ 'Netherlands' => 'NL',
+ 'New Zealand' => 'NZ',
+ 'Nicaragua' => 'NI',
+ 'Nigeria' => 'NG',
+ 'Norway' => 'NO',
+ 'Oman' => 'OM',
+ 'Pakistan' => 'PK',
+ 'Panama' => 'PA',
+ 'Paraguay' => 'PY',
+ "People's Republic of China" => 'CN',
+ 'Peru' => 'PE',
+ 'Philippines' => 'PH',
+ 'Poland' => 'PL',
+ 'Portugal' => 'PT',
+ 'PRC' => 'CN',
+ 'Puerto Rico' => 'PR',
+ 'Qatar' => 'QA',
+ 'Reunion' => 'RE',
+ 'Russia' => 'RU',
+ 'Saudi Arabia' => 'SA',
+ 'Senegal' => 'SN',
+ 'Singapore' => 'SG',
+ 'Slovakia' => 'SK',
+ 'South Africa' => 'ZA',
+ 'Spain' => 'ES',
+ 'Sri Lanka' => 'LK',
+ 'Sweden' => 'SE',
+ 'Switzerland' => 'CH',
+ 'Syria' => 'SY',
+ 'Taiwan' => 'TW',
+ 'The Netherlands' => 'NL',
+ 'Trinidad' => 'TT',
+ 'Tunisia' => 'TN',
+ 'UAE' => 'AE',
+ 'United Kingdom' => 'GB',
+ 'United States' => 'US',
+ 'Uruguay' => 'UY',
+ 'Venezuela' => 'VE',
+ 'Yemen' => 'YE',
+ 'Zimbabwe' => 'ZW',
+ );
+}
diff --git a/library/vendor/Zend/Locale/Exception.php b/library/vendor/Zend/Locale/Exception.php
new file mode 100644
index 0000000..05c543f
--- /dev/null
+++ b/library/vendor/Zend/Locale/Exception.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Locale
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+
+/**
+ * Zend_Exception
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Locale
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Locale_Exception extends Zend_Exception
+{
+}
diff --git a/library/vendor/Zend/Locale/Format.php b/library/vendor/Zend/Locale/Format.php
new file mode 100644
index 0000000..a1baf6e
--- /dev/null
+++ b/library/vendor/Zend/Locale/Format.php
@@ -0,0 +1,1321 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Locale
+ * @subpackage Format
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * include needed classes
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Locale
+ * @subpackage Format
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Locale_Format
+{
+ const STANDARD = 'auto';
+
+ private static $_options = array('date_format' => null,
+ 'number_format' => null,
+ 'format_type' => 'iso',
+ 'fix_date' => false,
+ 'locale' => null,
+ 'cache' => null,
+ 'disableCache' => null,
+ 'precision' => null);
+
+ /**
+ * Sets class wide options, if no option was given, the actual set options will be returned
+ * The 'precision' option of a value is used to truncate or stretch extra digits. -1 means not to touch the extra digits.
+ * The 'locale' option helps when parsing numbers and dates using separators and month names.
+ * The date format 'format_type' option selects between CLDR/ISO date format specifier tokens and PHP's date() tokens.
+ * The 'fix_date' option enables or disables heuristics that attempt to correct invalid dates.
+ * The 'number_format' option can be used to specify a default number format string
+ * The 'date_format' option can be used to specify a default date format string, but beware of using getDate(),
+ * checkDateFormat() and getTime() after using setOptions() with a 'format'. To use these four methods
+ * with the default date format for a locale, use array('date_format' => null, 'locale' => $locale) for their options.
+ *
+ * @param array $options Array of options, keyed by option name: format_type = 'iso' | 'php', fix_date = true | false,
+ * locale = Zend_Locale | locale string, precision = whole number between -1 and 30
+ * @throws Zend_Locale_Exception
+ * @return array if no option was given
+ */
+ public static function setOptions(array $options = array())
+ {
+ self::$_options = self::_checkOptions($options) + self::$_options;
+ return self::$_options;
+ }
+
+ /**
+ * Internal function for checking the options array of proper input values
+ * See {@link setOptions()} for details.
+ *
+ * @param array $options Array of options, keyed by option name: format_type = 'iso' | 'php', fix_date = true | false,
+ * locale = Zend_Locale | locale string, precision = whole number between -1 and 30
+ * @throws Zend_Locale_Exception
+ * @return array if no option was given
+ */
+ private static function _checkOptions(array $options = array())
+ {
+ if (count($options) == 0) {
+ return self::$_options;
+ }
+ foreach ($options as $name => $value) {
+ $name = strtolower($name);
+ if ($name !== 'locale') {
+ if (gettype($value) === 'string') {
+ $value = strtolower($value);
+ }
+ }
+
+ switch($name) {
+ case 'number_format' :
+ if ($value == Zend_Locale_Format::STANDARD) {
+ $locale = self::$_options['locale'];
+ if (isset($options['locale'])) {
+ $locale = $options['locale'];
+ }
+ $options['number_format'] = Zend_Locale_Data::getContent($locale, 'decimalnumber');
+ } else if ((gettype($value) !== 'string') and ($value !== NULL)) {
+ $stringValue = (string)(is_array($value) ? implode(' ', $value) : $value);
+ throw new Zend_Locale_Exception("Unknown number format type '" . gettype($value) . "'. "
+ . "Format '$stringValue' must be a valid number format string.");
+ }
+ break;
+
+ case 'date_format' :
+ if ($value == Zend_Locale_Format::STANDARD) {
+ $locale = self::$_options['locale'];
+ if (isset($options['locale'])) {
+ $locale = $options['locale'];
+ }
+ $options['date_format'] = Zend_Locale_Format::getDateFormat($locale);
+ } else if ((gettype($value) !== 'string') and ($value !== NULL)) {
+ $stringValue = (string)(is_array($value) ? implode(' ', $value) : $value);
+ throw new Zend_Locale_Exception("Unknown dateformat type '" . gettype($value) . "'. "
+ . "Format '$stringValue' must be a valid ISO or PHP date format string.");
+ } else {
+ if (((isset($options['format_type']) === true) and ($options['format_type'] == 'php')) or
+ ((isset($options['format_type']) === false) and (self::$_options['format_type'] == 'php'))) {
+ $options['date_format'] = Zend_Locale_Format::convertPhpToIsoFormat($value);
+ }
+ }
+ break;
+
+ case 'format_type' :
+ if (($value != 'php') && ($value != 'iso')) {
+ throw new Zend_Locale_Exception("Unknown date format type '$value'. Only 'iso' and 'php'"
+ . " are supported.");
+ }
+ break;
+
+ case 'fix_date' :
+ if (($value !== true) && ($value !== false)) {
+ throw new Zend_Locale_Exception("Enabling correction of dates must be either true or false"
+ . "(fix_date='$value').");
+ }
+ break;
+
+ case 'locale' :
+ $options['locale'] = Zend_Locale::findLocale($value);
+ break;
+
+ case 'cache' :
+ if ($value instanceof Zend_Cache_Core) {
+ Zend_Locale_Data::setCache($value);
+ }
+ break;
+
+ case 'disablecache' :
+ if (null !== $value) {
+ Zend_Locale_Data::disableCache($value);
+ }
+ break;
+
+ case 'precision' :
+ if ($value === NULL) {
+ $value = -1;
+ }
+
+ if (($value < -1) || ($value > 30)) {
+ throw new Zend_Locale_Exception("'$value' precision is not a whole number less than 30.");
+ }
+ break;
+
+ default:
+ throw new Zend_Locale_Exception("Unknown option: '$name' = '$value'");
+ break;
+
+ }
+ }
+
+ return $options;
+ }
+
+ /**
+ * Changes the numbers/digits within a given string from one script to another
+ * 'Decimal' representated the stardard numbers 0-9, if a script does not exist
+ * an exception will be thrown.
+ *
+ * Examples for conversion from Arabic to Latin numerals:
+ * convertNumerals('١١٠ Tests', 'Arab'); -> returns '100 Tests'
+ * Example for conversion from Latin to Arabic numerals:
+ * convertNumerals('100 Tests', 'Latn', 'Arab'); -> returns '١١٠ Tests'
+ *
+ * @param string $input String to convert
+ * @param string $from Script to parse, see {@link Zend_Locale::getScriptList()} for details.
+ * @param string $to OPTIONAL Script to convert to
+ * @return string Returns the converted input
+ * @throws Zend_Locale_Exception
+ */
+ public static function convertNumerals($input, $from, $to = null)
+ {
+ if (!self::_getUniCodeSupport()) {
+ trigger_error("Sorry, your PCRE extension does not support UTF8 which is needed for the I18N core", E_USER_NOTICE);
+ }
+
+ $from = strtolower($from);
+ $source = Zend_Locale_Data::getContent('en', 'numberingsystem', $from);
+ if (empty($source)) {
+ throw new Zend_Locale_Exception("Unknown script '$from'. Use 'Latn' for digits 0,1,2,3,4,5,6,7,8,9.");
+ }
+
+ if ($to !== null) {
+ $to = strtolower($to);
+ $target = Zend_Locale_Data::getContent('en', 'numberingsystem', $to);
+ if (empty($target)) {
+ throw new Zend_Locale_Exception("Unknown script '$to'. Use 'Latn' for digits 0,1,2,3,4,5,6,7,8,9.");
+ }
+ } else {
+ $target = '0123456789';
+ }
+
+ for ($x = 0; $x < 10; ++$x) {
+ $asource[$x] = "/" . iconv_substr($source, $x, 1, 'UTF-8') . "/u";
+ $atarget[$x] = iconv_substr($target, $x, 1, 'UTF-8');
+ }
+
+ return preg_replace($asource, $atarget, $input);
+ }
+
+ /**
+ * Returns the normalized number from a localized one
+ * Parsing depends on given locale (grouping and decimal)
+ *
+ * Examples for input:
+ * '2345.4356,1234' = 23455456.1234
+ * '+23,3452.123' = 233452.123
+ * '12343 ' = 12343
+ * '-9456' = -9456
+ * '0' = 0
+ *
+ * @param string $input Input string to parse for numbers
+ * @param array $options Options: locale, precision. See {@link setOptions()} for details.
+ * @return string Returns the extracted number
+ * @throws Zend_Locale_Exception
+ */
+ public static function getNumber($input, array $options = array())
+ {
+ $options = self::_checkOptions($options) + self::$_options;
+ if (!is_string($input)) {
+ return $input;
+ }
+
+ if (!self::isNumber($input, $options)) {
+ throw new Zend_Locale_Exception('No localized value in ' . $input . ' found, or the given number does not match the localized format');
+ }
+
+ // Get correct signs for this locale
+ $symbols = Zend_Locale_Data::getList($options['locale'],'symbols');
+ // Change locale input to be default number
+ if (($input[0] == $symbols['minus']) && ('-' != $input[0])) {
+ $input = '-' . substr($input, 1);
+ }
+
+ $input = str_replace($symbols['group'],'', $input);
+ if (strpos($input, $symbols['decimal']) !== false) {
+ if ($symbols['decimal'] != '.') {
+ $input = str_replace($symbols['decimal'], ".", $input);
+ }
+
+ $pre = substr($input, strpos($input, '.') + 1);
+ if ($options['precision'] === null) {
+ $options['precision'] = strlen($pre);
+ }
+
+ if (strlen($pre) >= $options['precision']) {
+ $input = substr($input, 0, strlen($input) - strlen($pre) + $options['precision']);
+ }
+
+ if (($options['precision'] == 0) && ($input[strlen($input) - 1] == '.')) {
+ $input = substr($input, 0, -1);
+ }
+ }
+
+ return $input;
+ }
+
+ /**
+ * Returns a locale formatted number depending on the given options.
+ * The seperation and fraction sign is used from the set locale.
+ * ##0.# -> 12345.12345 -> 12345.12345
+ * ##0.00 -> 12345.12345 -> 12345.12
+ * ##,##0.00 -> 12345.12345 -> 12,345.12
+ *
+ * @param string $value Localized number string
+ * @param array $options Options: number_format, locale, precision. See {@link setOptions()} for details.
+ * @return string locale formatted number
+ * @throws Zend_Locale_Exception
+ */
+ public static function toNumber($value, array $options = array())
+ {
+ // load class within method for speed
+
+ $value = Zend_Locale_Math::floatalize($value);
+ $value = Zend_Locale_Math::normalize($value);
+ $options = self::_checkOptions($options) + self::$_options;
+ $options['locale'] = (string) $options['locale'];
+
+ // Get correct signs for this locale
+ $symbols = Zend_Locale_Data::getList($options['locale'], 'symbols');
+ $oenc = self::_getEncoding();
+ self::_setEncoding('UTF-8');
+
+ // Get format
+ $format = $options['number_format'];
+ if ($format === null) {
+ $format = Zend_Locale_Data::getContent($options['locale'], 'decimalnumber');
+ $format = self::_seperateFormat($format, $value, $options['precision']);
+
+ if ($options['precision'] !== null) {
+ $value = Zend_Locale_Math::normalize(Zend_Locale_Math::round($value, $options['precision']));
+ }
+ } else {
+ // seperate negative format pattern when available
+ $format = self::_seperateFormat($format, $value, $options['precision']);
+ if (strpos($format, '.')) {
+ if (is_numeric($options['precision'])) {
+ $value = Zend_Locale_Math::round($value, $options['precision']);
+ } else {
+ if (substr($format, iconv_strpos($format, '.') + 1, 3) == '###') {
+ $options['precision'] = null;
+ } else {
+ $options['precision'] = iconv_strlen(iconv_substr($format, iconv_strpos($format, '.') + 1,
+ iconv_strrpos($format, '0') - iconv_strpos($format, '.')));
+ $format = iconv_substr($format, 0, iconv_strpos($format, '.') + 1) . '###'
+ . iconv_substr($format, iconv_strrpos($format, '0') + 1);
+ }
+ }
+ } else {
+ $value = Zend_Locale_Math::round($value, 0);
+ $options['precision'] = 0;
+ }
+ $value = Zend_Locale_Math::normalize($value);
+ }
+
+ if (iconv_strpos($format, '0') === false) {
+ self::_setEncoding($oenc);
+ throw new Zend_Locale_Exception('Wrong format... missing 0');
+ }
+
+ // get number parts
+ $pos = iconv_strpos($value, '.');
+ if ($pos !== false) {
+ if ($options['precision'] === null) {
+ $precstr = iconv_substr($value, $pos + 1);
+ } else {
+ $precstr = iconv_substr($value, $pos + 1, $options['precision']);
+ if (iconv_strlen($precstr) < $options['precision']) {
+ $precstr = $precstr . str_pad("0", ($options['precision'] - iconv_strlen($precstr)), "0");
+ }
+ }
+ } else {
+ if ($options['precision'] > 0) {
+ $precstr = str_pad("0", ($options['precision']), "0");
+ }
+ }
+
+ if ($options['precision'] === null) {
+ if (isset($precstr)) {
+ $options['precision'] = iconv_strlen($precstr);
+ } else {
+ $options['precision'] = 0;
+ }
+ }
+
+ // get fraction and format lengths
+ if (strpos($value, '.') !== false) {
+ $number = substr((string) $value, 0, strpos($value, '.'));
+ } else {
+ $number = $value;
+ }
+
+ $prec = call_user_func(Zend_Locale_Math::$sub, $value, $number, $options['precision']);
+ $prec = Zend_Locale_Math::floatalize($prec);
+ $prec = Zend_Locale_Math::normalize($prec);
+ if (iconv_strpos($prec, '-') !== false) {
+ $prec = iconv_substr($prec, 1);
+ }
+
+ if (($prec == 0) and ($options['precision'] > 0)) {
+ $prec = "0.0";
+ }
+
+ if (($options['precision'] + 2) > iconv_strlen($prec)) {
+ $prec = str_pad((string) $prec, $options['precision'] + 2, "0", STR_PAD_RIGHT);
+ }
+
+ if (iconv_strpos($number, '-') !== false) {
+ $number = iconv_substr($number, 1);
+ }
+ $group = iconv_strrpos($format, ',');
+ $group2 = iconv_strpos ($format, ',');
+ $point = iconv_strpos ($format, '0');
+ // Add fraction
+ $rest = "";
+ if (iconv_strpos($format, '.')) {
+ $rest = iconv_substr($format, iconv_strpos($format, '.') + 1);
+ $length = iconv_strlen($rest);
+ for($x = 0; $x < $length; ++$x) {
+ if (($rest[0] == '0') || ($rest[0] == '#')) {
+ $rest = iconv_substr($rest, 1);
+ }
+ }
+ $format = iconv_substr($format, 0, iconv_strlen($format) - iconv_strlen($rest));
+ }
+
+ if ($options['precision'] == '0') {
+ if (iconv_strrpos($format, '-') != 0) {
+ $format = iconv_substr($format, 0, $point)
+ . iconv_substr($format, iconv_strrpos($format, '#') + 2);
+ } else {
+ $format = iconv_substr($format, 0, $point);
+ }
+ } else {
+ $format = iconv_substr($format, 0, $point) . $symbols['decimal']
+ . iconv_substr($prec, 2);
+ }
+
+ $format .= $rest;
+ // Add seperation
+ if ($group == 0) {
+ // no seperation
+ $format = $number . iconv_substr($format, $point);
+ } else if ($group == $group2) {
+ // only 1 seperation
+ $seperation = ($point - $group);
+ for ($x = iconv_strlen($number); $x > $seperation; $x -= $seperation) {
+ if (iconv_substr($number, 0, $x - $seperation) !== "") {
+ $number = iconv_substr($number, 0, $x - $seperation) . $symbols['group']
+ . iconv_substr($number, $x - $seperation);
+ }
+ }
+ $format = iconv_substr($format, 0, iconv_strpos($format, '#')) . $number . iconv_substr($format, $point);
+ } else {
+
+ // 2 seperations
+ if (iconv_strlen($number) > ($point - $group)) {
+ $seperation = ($point - $group);
+ $number = iconv_substr($number, 0, iconv_strlen($number) - $seperation) . $symbols['group']
+ . iconv_substr($number, iconv_strlen($number) - $seperation);
+
+ if ((iconv_strlen($number) - 1) > ($point - $group + 1)) {
+ $seperation2 = ($group - $group2 - 1);
+ for ($x = iconv_strlen($number) - $seperation2 - 2; $x > $seperation2; $x -= $seperation2) {
+ $number = iconv_substr($number, 0, $x - $seperation2) . $symbols['group']
+ . iconv_substr($number, $x - $seperation2);
+ }
+ }
+
+ }
+ $format = iconv_substr($format, 0, iconv_strpos($format, '#')) . $number . iconv_substr($format, $point);
+ }
+ // set negative sign
+ if (call_user_func(Zend_Locale_Math::$comp, $value, 0, $options['precision']) < 0) {
+ if (iconv_strpos($format, '-') === false) {
+ $format = $symbols['minus'] . $format;
+ } else {
+ $format = str_replace('-', $symbols['minus'], $format);
+ }
+ }
+
+ self::_setEncoding($oenc);
+ return (string) $format;
+ }
+
+ /**
+ * @param string $format
+ * @param string $value
+ * @param int $precision
+ * @return string
+ */
+ private static function _seperateFormat($format, $value, $precision)
+ {
+ if (iconv_strpos($format, ';') !== false) {
+ if (call_user_func(Zend_Locale_Math::$comp, $value, 0, $precision) < 0) {
+ $tmpformat = iconv_substr($format, iconv_strpos($format, ';') + 1);
+ if ($tmpformat[0] == '(') {
+ $format = iconv_substr($format, 0, iconv_strpos($format, ';'));
+ } else {
+ $format = $tmpformat;
+ }
+ } else {
+ $format = iconv_substr($format, 0, iconv_strpos($format, ';'));
+ }
+ }
+
+ return $format;
+ }
+
+
+ /**
+ * Checks if the input contains a normalized or localized number
+ *
+ * @param string $input Localized number string
+ * @param array $options Options: locale. See {@link setOptions()} for details.
+ * @return boolean Returns true if a number was found
+ */
+ public static function isNumber($input, array $options = array())
+ {
+ if (!self::_getUniCodeSupport()) {
+ trigger_error("Sorry, your PCRE extension does not support UTF8 which is needed for the I18N core", E_USER_NOTICE);
+ }
+
+ $options = self::_checkOptions($options) + self::$_options;
+
+ // Get correct signs for this locale
+ $symbols = Zend_Locale_Data::getList($options['locale'],'symbols');
+
+ $regexs = Zend_Locale_Format::_getRegexForType('decimalnumber', $options);
+ $regexs = array_merge($regexs, Zend_Locale_Format::_getRegexForType('scientificnumber', $options));
+ if (!empty($input) && ($input[0] == $symbols['decimal'])) {
+ $input = 0 . $input;
+ }
+ foreach ($regexs as $regex) {
+ preg_match($regex, $input, $found);
+ if (isset($found[0])) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Internal method to convert cldr number syntax into regex
+ *
+ * @param string $type
+ * @param array $options Options: locale. See {@link setOptions()} for details.
+ * @return string
+ * @throws Zend_Locale_Exception
+ */
+ private static function _getRegexForType($type, $options)
+ {
+ $decimal = Zend_Locale_Data::getContent($options['locale'], $type);
+ $decimal = preg_replace('/[^#0,;\.\-Ee]/u', '',$decimal);
+ $patterns = explode(';', $decimal);
+
+ if (count($patterns) == 1) {
+ $patterns[1] = '-' . $patterns[0];
+ }
+
+ $symbols = Zend_Locale_Data::getList($options['locale'],'symbols');
+
+ foreach($patterns as $pkey => $pattern) {
+ $regex[$pkey] = '/^';
+ $rest = 0;
+ $end = null;
+ if (strpos($pattern, '.') !== false) {
+ $end = substr($pattern, strpos($pattern, '.') + 1);
+ $pattern = substr($pattern, 0, -strlen($end) - 1);
+ }
+
+ if (strpos($pattern, ',') !== false) {
+ $parts = explode(',', $pattern);
+ $count = count($parts);
+ foreach($parts as $key => $part) {
+ switch ($part) {
+ case '#':
+ case '-#':
+ if ($part[0] == '-') {
+ $regex[$pkey] .= '[' . $symbols['minus'] . '-]{0,1}';
+ } else {
+ $regex[$pkey] .= '[' . $symbols['plus'] . '+]{0,1}';
+ }
+
+ if (($parts[$key + 1]) == '##0') {
+ $regex[$pkey] .= '[0-9]{1,3}';
+ } else if (($parts[$key + 1]) == '##') {
+ $regex[$pkey] .= '[0-9]{1,2}';
+ } else {
+ throw new Zend_Locale_Exception('Unsupported token for numberformat (Pos 1):"' . $pattern . '"');
+ }
+ break;
+ case '##':
+ if ($parts[$key + 1] == '##0') {
+ $regex[$pkey] .= '(\\' . $symbols['group'] . '{0,1}[0-9]{2})*';
+ } else {
+ throw new Zend_Locale_Exception('Unsupported token for numberformat (Pos 2):"' . $pattern . '"');
+ }
+ break;
+ case '##0':
+ if ($parts[$key - 1] == '##') {
+ $regex[$pkey] .= '[0-9]';
+ } else if (($parts[$key - 1] == '#') || ($parts[$key - 1] == '-#')) {
+ $regex[$pkey] .= '(\\' . $symbols['group'] . '{0,1}[0-9]{3})*';
+ } else {
+ throw new Zend_Locale_Exception('Unsupported token for numberformat (Pos 3):"' . $pattern . '"');
+ }
+ break;
+ case '#0':
+ if ($key == 0) {
+ $regex[$pkey] .= '[0-9]*';
+ } else {
+ throw new Zend_Locale_Exception('Unsupported token for numberformat (Pos 4):"' . $pattern . '"');
+ }
+ break;
+ }
+ }
+ }
+
+ if (strpos($pattern, 'E') !== false) {
+ if (($pattern == '#E0') || ($pattern == '#E00')) {
+ $regex[$pkey] .= '[' . $symbols['plus']. '+]{0,1}[0-9]{1,}(\\' . $symbols['decimal'] . '[0-9]{1,})*[eE][' . $symbols['plus']. '+]{0,1}[0-9]{1,}';
+ } else if (($pattern == '-#E0') || ($pattern == '-#E00')) {
+ $regex[$pkey] .= '[' . $symbols['minus']. '-]{0,1}[0-9]{1,}(\\' . $symbols['decimal'] . '[0-9]{1,})*[eE][' . $symbols['minus']. '-]{0,1}[0-9]{1,}';
+ } else {
+ throw new Zend_Locale_Exception('Unsupported token for numberformat (Pos 5):"' . $pattern . '"');
+ }
+ }
+
+ if (!empty($end)) {
+ if ($end == '###') {
+ $regex[$pkey] .= '(\\' . $symbols['decimal'] . '{1}[0-9]{1,}){0,1}';
+ } else if ($end == '###-') {
+ $regex[$pkey] .= '(\\' . $symbols['decimal'] . '{1}[0-9]{1,}){0,1}[' . $symbols['minus']. '-]';
+ } else {
+ throw new Zend_Locale_Exception('Unsupported token for numberformat (Pos 6):"' . $pattern . '"');
+ }
+ }
+
+ $regex[$pkey] .= '$/u';
+ }
+
+ return $regex;
+ }
+
+ /**
+ * Alias for getNumber
+ *
+ * @param string $input Number to localize
+ * @param array $options Options: locale, precision. See {@link setOptions()} for details.
+ * @return float
+ */
+ public static function getFloat($input, array $options = array())
+ {
+ return floatval(self::getNumber($input, $options));
+ }
+
+ /**
+ * Returns a locale formatted integer number
+ * Alias for toNumber()
+ *
+ * @param string $value Number to normalize
+ * @param array $options Options: locale, precision. See {@link setOptions()} for details.
+ * @return string Locale formatted number
+ */
+ public static function toFloat($value, array $options = array())
+ {
+ $options['number_format'] = Zend_Locale_Format::STANDARD;
+ return self::toNumber($value, $options);
+ }
+
+ /**
+ * Returns if a float was found
+ * Alias for isNumber()
+ *
+ * @param string $value Localized number string
+ * @param array $options Options: locale. See {@link setOptions()} for details.
+ * @return boolean Returns true if a number was found
+ */
+ public static function isFloat($value, array $options = array())
+ {
+ return self::isNumber($value, $options);
+ }
+
+ /**
+ * Returns the first found integer from an string
+ * Parsing depends on given locale (grouping and decimal)
+ *
+ * Examples for input:
+ * ' 2345.4356,1234' = 23455456
+ * '+23,3452.123' = 233452
+ * ' 12343 ' = 12343
+ * '-9456km' = -9456
+ * '0' = 0
+ * '(-){0,1}(\d+(\.){0,1})*(\,){0,1})\d+'
+ *
+ * @param string $input Input string to parse for numbers
+ * @param array $options Options: locale. See {@link setOptions()} for details.
+ * @return integer Returns the extracted number
+ */
+ public static function getInteger($input, array $options = array())
+ {
+ $options['precision'] = 0;
+ return intval(self::getFloat($input, $options));
+ }
+
+ /**
+ * Returns a localized number
+ *
+ * @param string $value Number to normalize
+ * @param array $options Options: locale. See {@link setOptions()} for details.
+ * @return string Locale formatted number
+ */
+ public static function toInteger($value, array $options = array())
+ {
+ $options['precision'] = 0;
+ $options['number_format'] = Zend_Locale_Format::STANDARD;
+ return self::toNumber($value, $options);
+ }
+
+ /**
+ * Returns if a integer was found
+ *
+ * @param string $value Localized number string
+ * @param array $options Options: locale. See {@link setOptions()} for details.
+ * @return boolean Returns true if a integer was found
+ */
+ public static function isInteger($value, array $options = array())
+ {
+ if (!self::isNumber($value, $options)) {
+ return false;
+ }
+
+ if (self::getInteger($value, $options) == self::getFloat($value, $options)) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Converts a format string from PHP's date format to ISO format
+ * Remember that Zend Date always returns localized string, so a month name which returns the english
+ * month in php's date() will return the translated month name with this function... use 'en' as locale
+ * if you are in need of the original english names
+ *
+ * The conversion has the following restrictions:
+ * 'a', 'A' - Meridiem is not explicit upper/lowercase, you have to upper/lowercase the translated value yourself
+ *
+ * @param string $format Format string in PHP's date format
+ * @return string Format string in ISO format
+ */
+ public static function convertPhpToIsoFormat($format)
+ {
+ if ($format === null) {
+ return null;
+ }
+
+ $convert = array(
+ 'd' => 'dd' , 'D' => 'EE' , 'j' => 'd' , 'l' => 'EEEE',
+ 'N' => 'eee' , 'S' => 'SS' , 'w' => 'e' , 'z' => 'D' ,
+ 'W' => 'ww' , 'F' => 'MMMM', 'm' => 'MM' , 'M' => 'MMM' ,
+ 'n' => 'M' , 't' => 'ddd' , 'L' => 'l' , 'o' => 'YYYY',
+ 'Y' => 'yyyy', 'y' => 'yy' , 'a' => 'a' , 'A' => 'a' ,
+ 'B' => 'B' , 'g' => 'h' , 'G' => 'H' , 'h' => 'hh' ,
+ 'H' => 'HH' , 'i' => 'mm' , 's' => 'ss' , 'e' => 'zzzz',
+ 'I' => 'I' , 'O' => 'Z' , 'P' => 'ZZZZ', 'T' => 'z' ,
+ 'Z' => 'X' , 'c' => 'yyyy-MM-ddTHH:mm:ssZZZZ', 'r' => 'r',
+ 'U' => 'U',
+ );
+ $escaped = false;
+ $inEscapedString = false;
+ $converted = array();
+ foreach (str_split($format) as $char) {
+ if (!$escaped && $char == '\\') {
+ // Next char will be escaped: let's remember it
+ $escaped = true;
+ } elseif ($escaped) {
+ if (!$inEscapedString) {
+ // First escaped string: start the quoted chunk
+ $converted[] = "'";
+ $inEscapedString = true;
+ }
+ // Since the previous char was a \ and we are in the quoted
+ // chunk, let's simply add $char as it is
+ $converted[] = $char;
+ $escaped = false;
+ } elseif ($char == "'") {
+ // Single quotes need to be escaped like this
+ $converted[] = "''";
+ } else {
+ if ($inEscapedString) {
+ // Close the single-quoted chunk
+ $converted[] = "'";
+ $inEscapedString = false;
+ }
+ // Convert the unescaped char if needed
+ if (isset($convert[$char])) {
+ $converted[] = $convert[$char];
+ } else {
+ $converted[] = $char;
+ }
+ }
+ }
+
+ return implode($converted);
+ }
+
+ /**
+ * Parse date and split in named array fields
+ *
+ * @param string $date Date string to parse
+ * @param array $options Options: format_type, fix_date, locale, date_format. See {@link setOptions()} for details.
+ * @return array Possible array members: day, month, year, hour, minute, second, fixed, format
+ * @throws Zend_Locale_Exception
+ */
+ private static function _parseDate($date, $options)
+ {
+ if (!self::_getUniCodeSupport()) {
+ trigger_error("Sorry, your PCRE extension does not support UTF8 which is needed for the I18N core", E_USER_NOTICE);
+ }
+
+ $options = self::_checkOptions($options) + self::$_options;
+ $test = array('h', 'H', 'm', 's', 'y', 'Y', 'M', 'd', 'D', 'E', 'S', 'l', 'B', 'I',
+ 'X', 'r', 'U', 'G', 'w', 'e', 'a', 'A', 'Z', 'z', 'v');
+
+ $format = $options['date_format'];
+ $number = $date; // working copy
+ $result['date_format'] = $format; // save the format used to normalize $number (convenience)
+ $result['locale'] = $options['locale']; // save the locale used to normalize $number (convenience)
+
+ $oenc = self::_getEncoding();
+ self::_setEncoding('UTF-8');
+ $day = iconv_strpos($format, 'd');
+ $month = iconv_strpos($format, 'M');
+ $year = iconv_strpos($format, 'y');
+ $hour = iconv_strpos($format, 'H');
+ $min = iconv_strpos($format, 'm');
+ $sec = iconv_strpos($format, 's');
+ $am = null;
+ if ($hour === false) {
+ $hour = iconv_strpos($format, 'h');
+ }
+ if ($year === false) {
+ $year = iconv_strpos($format, 'Y');
+ }
+ if ($day === false) {
+ $day = iconv_strpos($format, 'E');
+ if ($day === false) {
+ $day = iconv_strpos($format, 'D');
+ }
+ }
+
+ if ($day !== false) {
+ $parse[$day] = 'd';
+ if (!empty($options['locale']) && ($options['locale'] !== 'root') &&
+ (!is_object($options['locale']) || ((string) $options['locale'] !== 'root'))) {
+ // erase day string
+ $daylist = Zend_Locale_Data::getList($options['locale'], 'day');
+ foreach($daylist as $key => $name) {
+ if (iconv_strpos($number, $name) !== false) {
+ $number = str_replace($name, "EEEE", $number);
+ break;
+ }
+ }
+ }
+ }
+ $position = false;
+
+ if ($month !== false) {
+ $parse[$month] = 'M';
+ if (!empty($options['locale']) && ($options['locale'] !== 'root') &&
+ (!is_object($options['locale']) || ((string) $options['locale'] !== 'root'))) {
+ // prepare to convert month name to their numeric equivalents, if requested,
+ // and we have a $options['locale']
+ $position = self::_replaceMonth($number, Zend_Locale_Data::getList($options['locale'],
+ 'month'));
+ if ($position === false) {
+ $position = self::_replaceMonth($number, Zend_Locale_Data::getList($options['locale'],
+ 'month', array('gregorian', 'format', 'abbreviated')));
+ }
+ }
+ }
+ if ($year !== false) {
+ $parse[$year] = 'y';
+ }
+ if ($hour !== false) {
+ $parse[$hour] = 'H';
+ }
+ if ($min !== false) {
+ $parse[$min] = 'm';
+ }
+ if ($sec !== false) {
+ $parse[$sec] = 's';
+ }
+
+ if (empty($parse)) {
+ self::_setEncoding($oenc);
+ throw new Zend_Locale_Exception("Unknown date format, neither date nor time in '" . $format . "' found");
+ }
+ ksort($parse);
+
+ // get daytime
+ if (iconv_strpos($format, 'a') !== false) {
+ if (iconv_strpos(strtoupper($number), strtoupper(Zend_Locale_Data::getContent($options['locale'], 'am'))) !== false) {
+ $am = true;
+ } else if (iconv_strpos(strtoupper($number), strtoupper(Zend_Locale_Data::getContent($options['locale'], 'pm'))) !== false) {
+ $am = false;
+ }
+ }
+
+ // split number parts
+ $split = false;
+ preg_match_all('/\d+/u', $number, $splitted);
+
+ if (count($splitted[0]) == 0) {
+ self::_setEncoding($oenc);
+ throw new Zend_Locale_Exception("No date part in '$date' found.");
+ }
+ if (count($splitted[0]) == 1) {
+ $split = 0;
+ }
+ $cnt = 0;
+ foreach($parse as $key => $value) {
+
+ switch($value) {
+ case 'd':
+ if ($split === false) {
+ if (count($splitted[0]) > $cnt) {
+ $result['day'] = $splitted[0][$cnt];
+ }
+ } else {
+ $result['day'] = iconv_substr($splitted[0][0], $split, 2);
+ $split += 2;
+ }
+ ++$cnt;
+ break;
+ case 'M':
+ if ($split === false) {
+ if (count($splitted[0]) > $cnt) {
+ $result['month'] = $splitted[0][$cnt];
+ }
+ } else {
+ $result['month'] = iconv_substr($splitted[0][0], $split, 2);
+ $split += 2;
+ }
+ ++$cnt;
+ break;
+ case 'y':
+ $length = 2;
+ if ((iconv_substr($format, $year, 4) == 'yyyy')
+ || (iconv_substr($format, $year, 4) == 'YYYY')) {
+ $length = 4;
+ }
+
+ if ($split === false) {
+ if (count($splitted[0]) > $cnt) {
+ $result['year'] = $splitted[0][$cnt];
+ }
+ } else {
+ $result['year'] = iconv_substr($splitted[0][0], $split, $length);
+ $split += $length;
+ }
+
+ ++$cnt;
+ break;
+ case 'H':
+ if ($split === false) {
+ if (count($splitted[0]) > $cnt) {
+ $result['hour'] = $splitted[0][$cnt];
+ }
+ } else {
+ $result['hour'] = iconv_substr($splitted[0][0], $split, 2);
+ $split += 2;
+ }
+ ++$cnt;
+ break;
+ case 'm':
+ if ($split === false) {
+ if (count($splitted[0]) > $cnt) {
+ $result['minute'] = $splitted[0][$cnt];
+ }
+ } else {
+ $result['minute'] = iconv_substr($splitted[0][0], $split, 2);
+ $split += 2;
+ }
+ ++$cnt;
+ break;
+ case 's':
+ if ($split === false) {
+ if (count($splitted[0]) > $cnt) {
+ $result['second'] = $splitted[0][$cnt];
+ }
+ } else {
+ $result['second'] = iconv_substr($splitted[0][0], $split, 2);
+ $split += 2;
+ }
+ ++$cnt;
+ break;
+ }
+ }
+
+ // AM/PM correction
+ if ($hour !== false) {
+ if (($am === true) and ($result['hour'] == 12)){
+ $result['hour'] = 0;
+ } else if (($am === false) and ($result['hour'] != 12)) {
+ $result['hour'] += 12;
+ }
+ }
+
+ if ($options['fix_date'] === true) {
+ $result['fixed'] = 0; // nothing has been "fixed" by swapping date parts around (yet)
+ }
+
+ if ($day !== false) {
+ // fix false month
+ if (isset($result['day']) and isset($result['month'])) {
+ if (($position !== false) and ((iconv_strpos($date, $result['day']) === false) or
+ (isset($result['year']) and (iconv_strpos($date, $result['year']) === false)))) {
+ if ($options['fix_date'] !== true) {
+ self::_setEncoding($oenc);
+ throw new Zend_Locale_Exception("Unable to parse date '$date' using '" . $format
+ . "' (false month, $position, $month)");
+ }
+ $temp = $result['day'];
+ $result['day'] = $result['month'];
+ $result['month'] = $temp;
+ $result['fixed'] = 1;
+ }
+ }
+
+ // fix switched values d <> y
+ if (isset($result['day']) and isset($result['year'])) {
+ if ($result['day'] > 31) {
+ if ($options['fix_date'] !== true) {
+ self::_setEncoding($oenc);
+ throw new Zend_Locale_Exception("Unable to parse date '$date' using '"
+ . $format . "' (d <> y)");
+ }
+ $temp = $result['year'];
+ $result['year'] = $result['day'];
+ $result['day'] = $temp;
+ $result['fixed'] = 2;
+ }
+ }
+
+ // fix switched values M <> y
+ if (isset($result['month']) and isset($result['year'])) {
+ if ($result['month'] > 31) {
+ if ($options['fix_date'] !== true) {
+ self::_setEncoding($oenc);
+ throw new Zend_Locale_Exception("Unable to parse date '$date' using '"
+ . $format . "' (M <> y)");
+ }
+ $temp = $result['year'];
+ $result['year'] = $result['month'];
+ $result['month'] = $temp;
+ $result['fixed'] = 3;
+ }
+ }
+
+ // fix switched values M <> d
+ if (isset($result['month']) and isset($result['day'])) {
+ if ($result['month'] > 12) {
+ if ($options['fix_date'] !== true || $result['month'] > 31) {
+ self::_setEncoding($oenc);
+ throw new Zend_Locale_Exception("Unable to parse date '$date' using '"
+ . $format . "' (M <> d)");
+ }
+ $temp = $result['day'];
+ $result['day'] = $result['month'];
+ $result['month'] = $temp;
+ $result['fixed'] = 4;
+ }
+ }
+ }
+
+ if (isset($result['year'])) {
+ if (((iconv_strlen($result['year']) == 2) && ($result['year'] < 10)) ||
+ (((iconv_strpos($format, 'yy') !== false) && (iconv_strpos($format, 'yyyy') === false)) ||
+ ((iconv_strpos($format, 'YY') !== false) && (iconv_strpos($format, 'YYYY') === false)))) {
+ if (($result['year'] >= 0) && ($result['year'] < 100)) {
+ if ($result['year'] < 70) {
+ $result['year'] = (int) $result['year'] + 100;
+ }
+
+ $result['year'] = (int) $result['year'] + 1900;
+ }
+ }
+ }
+
+ self::_setEncoding($oenc);
+ return $result;
+ }
+
+ /**
+ * Search $number for a month name found in $monthlist, and replace if found.
+ *
+ * @param string $number Date string (modified)
+ * @param array $monthlist List of month names
+ *
+ * @return int|false Position of replaced string (false if nothing replaced)
+ */
+ protected static function _replaceMonth(&$number, $monthlist)
+ {
+ // If $locale was invalid, $monthlist will default to a "root" identity
+ // mapping for each month number from 1 to 12.
+ // If no $locale was given, or $locale was invalid, do not use this identity mapping to normalize.
+ // Otherwise, translate locale aware month names in $number to their numeric equivalents.
+ $position = false;
+ if ($monthlist && $monthlist[1] != 1) {
+ foreach($monthlist as $key => $name) {
+ if (($position = iconv_strpos($number, $name, 0, 'UTF-8')) !== false) {
+ $number = str_ireplace($name, $key, $number);
+ return $position;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns the default date format for $locale.
+ *
+ * @param string|Zend_Locale $locale OPTIONAL Locale of $number, possibly in string form (e.g. 'de_AT')
+ * @return string format
+ * @throws Zend_Locale_Exception throws an exception when locale data is broken
+ */
+ public static function getDateFormat($locale = null)
+ {
+ $format = Zend_Locale_Data::getContent($locale, 'date');
+ if (empty($format)) {
+ throw new Zend_Locale_Exception("failed to receive data from locale $locale");
+ }
+
+ return $format;
+ }
+
+ /**
+ * Returns an array with the normalized date from an locale date
+ * a input of 10.01.2006 without a $locale would return:
+ * array ('day' => 10, 'month' => 1, 'year' => 2006)
+ * The 'locale' option is only used to convert human readable day
+ * and month names to their numeric equivalents.
+ * The 'format' option allows specification of self-defined date formats,
+ * when not using the default format for the 'locale'.
+ *
+ * @param string $date Date string
+ * @param array $options Options: format_type, fix_date, locale, date_format. See {@link setOptions()} for details.
+ * @return array Possible array members: day, month, year, hour, minute, second, fixed, format
+ */
+ public static function getDate($date, array $options = array())
+ {
+ $options = self::_checkOptions($options) + self::$_options;
+ if (empty($options['date_format'])) {
+ $options['format_type'] = 'iso';
+ $options['date_format'] = self::getDateFormat($options['locale']);
+ }
+
+ return self::_parseDate($date, $options);
+ }
+
+ /**
+ * Returns if the given datestring contains all date parts from the given format.
+ * If no format is given, the default date format from the locale is used
+ * If you want to check if the date is a proper date you should use Zend_Date::isDate()
+ *
+ * @param string $date Date string
+ * @param array $options Options: format_type, fix_date, locale, date_format. See {@link setOptions()} for details.
+ * @return boolean
+ */
+ public static function checkDateFormat($date, array $options = array())
+ {
+ try {
+ $date = self::getDate($date, $options);
+ } catch (Exception $e) {
+ return false;
+ }
+
+ if (empty($options['date_format'])) {
+ $options['format_type'] = 'iso';
+ $options['date_format'] = self::getDateFormat(isset($options['locale']) ? $options['locale'] : null);
+ }
+ $options = self::_checkOptions($options) + self::$_options;
+
+ // day expected but not parsed
+ if ((iconv_strpos($options['date_format'], 'd', 0, 'UTF-8') !== false) and (!isset($date['day']) or ($date['day'] === ""))) {
+ return false;
+ }
+
+ // month expected but not parsed
+ if ((iconv_strpos($options['date_format'], 'M', 0, 'UTF-8') !== false) and (!isset($date['month']) or ($date['month'] === ""))) {
+ return false;
+ }
+
+ // year expected but not parsed
+ if (((iconv_strpos($options['date_format'], 'Y', 0, 'UTF-8') !== false) or
+ (iconv_strpos($options['date_format'], 'y', 0, 'UTF-8') !== false)) and (!isset($date['year']) or ($date['year'] === ""))) {
+ return false;
+ }
+
+ // second expected but not parsed
+ if ((iconv_strpos($options['date_format'], 's', 0, 'UTF-8') !== false) and (!isset($date['second']) or ($date['second'] === ""))) {
+ return false;
+ }
+
+ // minute expected but not parsed
+ if ((iconv_strpos($options['date_format'], 'm', 0, 'UTF-8') !== false) and (!isset($date['minute']) or ($date['minute'] === ""))) {
+ return false;
+ }
+
+ // hour expected but not parsed
+ if (((iconv_strpos($options['date_format'], 'H', 0, 'UTF-8') !== false) or
+ (iconv_strpos($options['date_format'], 'h', 0, 'UTF-8') !== false)) and (!isset($date['hour']) or ($date['hour'] === ""))) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns the default time format for $locale.
+ *
+ * @param string|Zend_Locale $locale OPTIONAL Locale of $number, possibly in string form (e.g. 'de_AT')
+ * @return string format
+ * @throws Zend_Locale_Exception
+ */
+ public static function getTimeFormat($locale = null)
+ {
+ $format = Zend_Locale_Data::getContent($locale, 'time');
+ if (empty($format)) {
+ throw new Zend_Locale_Exception("failed to receive data from locale $locale");
+ }
+ return $format;
+ }
+
+ /**
+ * Returns an array with 'hour', 'minute', and 'second' elements extracted from $time
+ * according to the order described in $format. For a format of 'H:i:s', and
+ * an input of 11:20:55, getTime() would return:
+ * array ('hour' => 11, 'minute' => 20, 'second' => 55)
+ * The optional $locale parameter may be used to help extract times from strings
+ * containing both a time and a day or month name.
+ *
+ * @param string $time Time string
+ * @param array $options Options: format_type, fix_date, locale, date_format. See {@link setOptions()} for details.
+ * @return array Possible array members: day, month, year, hour, minute, second, fixed, format
+ */
+ public static function getTime($time, array $options = array())
+ {
+ $options = self::_checkOptions($options) + self::$_options;
+ if (empty($options['date_format'])) {
+ $options['format_type'] = 'iso';
+ $options['date_format'] = self::getTimeFormat($options['locale']);
+ }
+ return self::_parseDate($time, $options);
+ }
+
+ /**
+ * Returns the default datetime format for $locale.
+ *
+ * @param string|Zend_Locale $locale OPTIONAL Locale of $number, possibly in string form (e.g. 'de_AT')
+ * @return string format
+ * @throws Zend_Locale_Exception
+ */
+ public static function getDateTimeFormat($locale = null)
+ {
+ $format = Zend_Locale_Data::getContent($locale, 'datetime');
+ if (empty($format)) {
+ throw new Zend_Locale_Exception("failed to receive data from locale $locale");
+ }
+ return $format;
+ }
+
+ /**
+ * Returns an array with 'year', 'month', 'day', 'hour', 'minute', and 'second' elements
+ * extracted from $datetime according to the order described in $format. For a format of 'd.M.y H:i:s',
+ * and an input of 10.05.1985 11:20:55, getDateTime() would return:
+ * array ('year' => 1985, 'month' => 5, 'day' => 10, 'hour' => 11, 'minute' => 20, 'second' => 55)
+ * The optional $locale parameter may be used to help extract times from strings
+ * containing both a time and a day or month name.
+ *
+ * @param string $datetime DateTime string
+ * @param array $options Options: format_type, fix_date, locale, date_format. See {@link setOptions()} for details.
+ * @return array Possible array members: day, month, year, hour, minute, second, fixed, format
+ */
+ public static function getDateTime($datetime, array $options = array())
+ {
+ $options = self::_checkOptions($options) + self::$_options;
+ if (empty($options['date_format'])) {
+ $options['format_type'] = 'iso';
+ $options['date_format'] = self::getDateTimeFormat($options['locale']);
+ }
+ return self::_parseDate($datetime, $options);
+ }
+
+ /**
+ * Internal method to detect of Unicode supports UTF8
+ * which should be enabled within vanilla php installations
+ *
+ * @return boolean
+ */
+ protected static function _getUniCodeSupport()
+ {
+ return (@preg_match('/\pL/u', 'a')) ? true : false;
+ }
+
+ /**
+ * Internal method to retrieve the current encoding via the ini setting
+ * default_charset for PHP >= 5.6 or iconv_get_encoding otherwise.
+ *
+ * @return string
+ */
+ protected static function _getEncoding()
+ {
+ $oenc = PHP_VERSION_ID < 50600
+ ? iconv_get_encoding('internal_encoding')
+ : ini_get('default_charset');
+
+ return $oenc;
+ }
+
+ /**
+ * Internal method to set the encoding via the ini setting
+ * default_charset for PHP >= 5.6 or iconv_set_encoding otherwise.
+ *
+ * @param string $encoding
+ * @return void
+ */
+ protected static function _setEncoding($encoding)
+ {
+ if (PHP_VERSION_ID < 50600) {
+ iconv_set_encoding('internal_encoding', $encoding);
+ } else {
+ ini_set('default_charset', $encoding);
+ }
+ }
+}
diff --git a/library/vendor/Zend/Locale/Math.php b/library/vendor/Zend/Locale/Math.php
new file mode 100644
index 0000000..1b61b07
--- /dev/null
+++ b/library/vendor/Zend/Locale/Math.php
@@ -0,0 +1,354 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Locale
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Utility class for proxying math function to bcmath functions, if present,
+ * otherwise to PHP builtin math operators, with limited detection of overflow conditions.
+ * Sampling of PHP environments and platforms suggests that at least 80% to 90% support bcmath.
+ * Thus, this file should be as light as possible.
+ *
+ * @category Zend
+ * @package Zend_Locale
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+class Zend_Locale_Math
+{
+ // support unit testing without using bcmath functions
+ public static $_bcmathDisabled = false;
+
+ public static $add = array('Zend_Locale_Math', 'Add');
+ public static $sub = array('Zend_Locale_Math', 'Sub');
+ public static $pow = array('Zend_Locale_Math', 'Pow');
+ public static $mul = array('Zend_Locale_Math', 'Mul');
+ public static $div = array('Zend_Locale_Math', 'Div');
+ public static $comp = array('Zend_Locale_Math', 'Comp');
+ public static $sqrt = array('Zend_Locale_Math', 'Sqrt');
+ public static $mod = array('Zend_Locale_Math', 'Mod');
+ public static $scale = 'bcscale';
+
+ public static function isBcmathDisabled()
+ {
+ return self::$_bcmathDisabled;
+ }
+
+ /**
+ * Surprisingly, the results of this implementation of round()
+ * prove better than the native PHP round(). For example, try:
+ * round(639.795, 2);
+ * round(267.835, 2);
+ * round(0.302515, 5);
+ * round(0.36665, 4);
+ * then try:
+ * Zend_Locale_Math::round('639.795', 2);
+ */
+ public static function round($op1, $precision = 0)
+ {
+ if (self::$_bcmathDisabled) {
+ $op1 = round($op1, $precision);
+ if (strpos((string) $op1, 'E') === false) {
+ return self::normalize(round($op1, $precision));
+ }
+ }
+
+ if (strpos($op1, 'E') !== false) {
+ $op1 = self::floatalize($op1);
+ }
+
+ $op1 = trim(self::normalize($op1));
+ $length = strlen($op1);
+ if (($decPos = strpos($op1, '.')) === false) {
+ $op1 .= '.0';
+ $decPos = $length;
+ $length += 2;
+ }
+ if ($precision < 0 && abs($precision) > $decPos) {
+ return '0';
+ }
+
+ $digitsBeforeDot = $length - ($decPos + 1);
+ if ($precision >= ($length - ($decPos + 1))) {
+ return $op1;
+ }
+
+ if ($precision === 0) {
+ $triggerPos = 1;
+ $roundPos = -1;
+ } elseif ($precision > 0) {
+ $triggerPos = $precision + 1;
+ $roundPos = $precision;
+ } else {
+ $triggerPos = $precision;
+ $roundPos = $precision -1;
+ }
+
+ $triggerDigit = $op1[$triggerPos + $decPos];
+ if ($precision < 0) {
+ // zero fill digits to the left of the decimal place
+ $op1 = substr($op1, 0, $decPos + $precision) . str_pad('', abs($precision), '0');
+ }
+
+ if ($triggerDigit >= '5') {
+ if ($roundPos + $decPos == -1) {
+ return str_pad('1', $decPos + 1, '0');
+ }
+
+ $roundUp = str_pad('', $length, '0');
+ $roundUp[$decPos] = '.';
+ $roundUp[$roundPos + $decPos] = '1';
+
+ if ($op1 > 0) {
+ if (self::$_bcmathDisabled) {
+ return Zend_Locale_Math_PhpMath::Add($op1, $roundUp, $precision);
+ }
+ return self::Add($op1, $roundUp, $precision);
+ } else {
+ if (self::$_bcmathDisabled) {
+ return Zend_Locale_Math_PhpMath::Sub($op1, $roundUp, $precision);
+ }
+ return self::Sub($op1, $roundUp, $precision);
+ }
+ } elseif ($precision >= 0) {
+ return substr($op1, 0, $decPos + ($precision ? $precision + 1: 0));
+ }
+
+ return (string) $op1;
+ }
+
+ /**
+ * Convert a scientific notation to float
+ * Additionally fixed a problem with PHP <= 5.2.x with big integers
+ *
+ * @param string $value
+ */
+ public static function floatalize($value)
+ {
+ $value = strtoupper($value);
+ if (strpos($value, 'E') === false) {
+ return $value;
+ }
+
+ $number = substr($value, 0, strpos($value, 'E'));
+ if (strpos($number, '.') !== false) {
+ $post = strlen(substr($number, strpos($number, '.') + 1));
+ $mantis = substr($value, strpos($value, 'E') + 1);
+ if ($mantis < 0) {
+ $post += abs((int) $mantis);
+ }
+
+ $value = number_format($value, $post, '.', '');
+ } else {
+ $value = number_format($value, 0, '.', '');
+ }
+
+ return $value;
+ }
+
+ /**
+ * Normalizes an input to standard english notation
+ * Fixes a problem of BCMath with setLocale which is PHP related
+ *
+ * @param integer $value Value to normalize
+ * @return string Normalized string without BCMath problems
+ */
+ public static function normalize($value)
+ {
+ $convert = localeconv();
+ $value = str_replace($convert['thousands_sep'], "",(string) $value);
+ $value = str_replace($convert['positive_sign'], "", $value);
+ $value = str_replace($convert['decimal_point'], ".",$value);
+ if (!empty($convert['negative_sign']) and (strpos($value, $convert['negative_sign']))) {
+ $value = str_replace($convert['negative_sign'], "", $value);
+ $value = "-" . $value;
+ }
+
+ return $value;
+ }
+
+ /**
+ * Localizes an input from standard english notation
+ * Fixes a problem of BCMath with setLocale which is PHP related
+ *
+ * @param integer $value Value to normalize
+ * @return string Normalized string without BCMath problems
+ */
+ public static function localize($value)
+ {
+ $convert = localeconv();
+ $value = str_replace(".", $convert['decimal_point'], (string) $value);
+ if (!empty($convert['negative_sign']) and (strpos($value, "-"))) {
+ $value = str_replace("-", $convert['negative_sign'], $value);
+ }
+ return $value;
+ }
+
+ /**
+ * Changes exponential numbers to plain string numbers
+ * Fixes a problem of BCMath with numbers containing exponents
+ *
+ * @param integer $value Value to erase the exponent
+ * @param integer $scale (Optional) Scale to use
+ * @return string
+ */
+ public static function exponent($value, $scale = null)
+ {
+ if (!extension_loaded('bcmath')) {
+ return $value;
+ }
+
+ $split = explode('e', $value);
+ if (count($split) == 1) {
+ $split = explode('E', $value);
+ }
+
+ if (count($split) > 1) {
+ $value = bcmul($split[0], bcpow(10, $split[1], $scale), $scale);
+ }
+
+ return $value;
+ }
+
+ /**
+ * BCAdd - fixes a problem of BCMath and exponential numbers
+ *
+ * @param string $op1
+ * @param string $op2
+ * @param integer $scale
+ * @return string
+ */
+ public static function Add($op1, $op2, $scale = null)
+ {
+ $op1 = self::exponent($op1, $scale);
+ $op2 = self::exponent($op2, $scale);
+
+ return bcadd($op1, $op2, $scale);
+ }
+
+ /**
+ * BCSub - fixes a problem of BCMath and exponential numbers
+ *
+ * @param string $op1
+ * @param string $op2
+ * @param integer $scale
+ * @return string
+ */
+ public static function Sub($op1, $op2, $scale = null)
+ {
+ $op1 = self::exponent($op1, $scale);
+ $op2 = self::exponent($op2, $scale);
+ return bcsub($op1, $op2, $scale);
+ }
+
+ /**
+ * BCPow - fixes a problem of BCMath and exponential numbers
+ *
+ * @param string $op1
+ * @param string $op2
+ * @param integer $scale
+ * @return string
+ */
+ public static function Pow($op1, $op2, $scale = null)
+ {
+ $op1 = self::exponent($op1, $scale);
+ $op2 = self::exponent($op2, $scale);
+ return bcpow($op1, $op2, $scale);
+ }
+
+ /**
+ * BCMul - fixes a problem of BCMath and exponential numbers
+ *
+ * @param string $op1
+ * @param string $op2
+ * @param integer $scale
+ * @return string
+ */
+ public static function Mul($op1, $op2, $scale = null)
+ {
+ $op1 = self::exponent($op1, $scale);
+ $op2 = self::exponent($op2, $scale);
+ return bcmul($op1, $op2, $scale);
+ }
+
+ /**
+ * BCDiv - fixes a problem of BCMath and exponential numbers
+ *
+ * @param string $op1
+ * @param string $op2
+ * @param integer $scale
+ * @return string
+ */
+ public static function Div($op1, $op2, $scale = null)
+ {
+ $op1 = self::exponent($op1, $scale);
+ $op2 = self::exponent($op2, $scale);
+ return bcdiv($op1, $op2, $scale);
+ }
+
+ /**
+ * BCSqrt - fixes a problem of BCMath and exponential numbers
+ *
+ * @param string $op1
+ * @param integer $scale
+ * @return string
+ */
+ public static function Sqrt($op1, $scale = null)
+ {
+ $op1 = self::exponent($op1, $scale);
+ return bcsqrt($op1, $scale);
+ }
+
+ /**
+ * BCMod - fixes a problem of BCMath and exponential numbers
+ *
+ * @param string $op1
+ * @param string $op2
+ * @return string
+ */
+ public static function Mod($op1, $op2)
+ {
+ $op1 = self::exponent($op1);
+ $op2 = self::exponent($op2);
+ return bcmod($op1, $op2);
+ }
+
+ /**
+ * BCComp - fixes a problem of BCMath and exponential numbers
+ *
+ * @param string $op1
+ * @param string $op2
+ * @param integer $scale
+ * @return string
+ */
+ public static function Comp($op1, $op2, $scale = null)
+ {
+ $op1 = self::exponent($op1, $scale);
+ $op2 = self::exponent($op2, $scale);
+ return bccomp($op1, $op2, $scale);
+ }
+}
+
+if (!extension_loaded('bcmath')
+ || (defined('TESTS_ZEND_LOCALE_BCMATH_ENABLED') && !TESTS_ZEND_LOCALE_BCMATH_ENABLED)
+) {
+ Zend_Locale_Math_PhpMath::disable();
+}
diff --git a/library/vendor/Zend/Locale/Math/Exception.php b/library/vendor/Zend/Locale/Math/Exception.php
new file mode 100644
index 0000000..fbf6c55
--- /dev/null
+++ b/library/vendor/Zend/Locale/Math/Exception.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Locale
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+
+/**
+ * Zend_Exception
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Locale
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Locale_Math_Exception extends Zend_Locale_Exception
+{
+ protected $op1 = null;
+ protected $op2 = null;
+ protected $result = null;
+
+ public function __construct($message, $op1 = null, $op2 = null, $result = null)
+ {
+ $this->op1 = $op1;
+ $this->op2 = $op2;
+ $this->result = $result;
+ parent::__construct($message);
+ }
+
+ public function getResults()
+ {
+ return array($this->op1, $this->op2, $this->result);
+ }
+}
diff --git a/library/vendor/Zend/Locale/Math/PhpMath.php b/library/vendor/Zend/Locale/Math/PhpMath.php
new file mode 100644
index 0000000..6d774c2
--- /dev/null
+++ b/library/vendor/Zend/Locale/Math/PhpMath.php
@@ -0,0 +1,239 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Locale
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Utility class for proxying math function to bcmath functions, if present,
+ * otherwise to PHP builtin math operators, with limited detection of overflow conditions.
+ * Sampling of PHP environments and platforms suggests that at least 80% to 90% support bcmath.
+ * This file should only be loaded for the 10% to 20% lacking access to the bcmath extension.
+ *
+ * @category Zend
+ * @package Zend_Locale
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Locale_Math_PhpMath extends Zend_Locale_Math
+{
+ public static function disable()
+ {
+ self::$_bcmathDisabled = true;
+ self::$add = array('Zend_Locale_Math_PhpMath', 'Add');
+ self::$sub = array('Zend_Locale_Math_PhpMath', 'Sub');
+ self::$pow = array('Zend_Locale_Math_PhpMath', 'Pow');
+ self::$mul = array('Zend_Locale_Math_PhpMath', 'Mul');
+ self::$div = array('Zend_Locale_Math_PhpMath', 'Div');
+ self::$comp = array('Zend_Locale_Math_PhpMath', 'Comp');
+ self::$sqrt = array('Zend_Locale_Math_PhpMath', 'Sqrt');
+ self::$mod = array('Zend_Locale_Math_PhpMath', 'Mod');
+ self::$scale = array('Zend_Locale_Math_PhpMath', 'Scale');
+
+ self::$defaultScale = 0;
+ self::$defaultPrecision = 1;
+ }
+
+ public static $defaultScale;
+ public static $defaultPrecision;
+
+
+ public static function Add($op1, $op2, $scale = null)
+ {
+ if ($scale === null) {
+ $scale = Zend_Locale_Math_PhpMath::$defaultScale;
+ $precision = Zend_Locale_Math_PhpMath::$defaultPrecision;
+ } else {
+ $precision = pow(10, -$scale);
+ }
+
+ if (empty($op1)) {
+ $op1 = 0;
+ }
+ $op1 = self::normalize($op1);
+ $op2 = self::normalize($op2);
+ $result = $op1 + $op2;
+ if (is_infinite($result) or (abs($result - $op2 - $op1) > $precision)) {
+ throw new Zend_Locale_Math_Exception("addition overflow: $op1 + $op2 != $result", $op1, $op2, $result);
+ }
+
+ return self::round(self::normalize($result), $scale);
+ }
+
+ public static function Sub($op1, $op2, $scale = null)
+ {
+ if ($scale === null) {
+ $scale = Zend_Locale_Math_PhpMath::$defaultScale;
+ $precision = Zend_Locale_Math_PhpMath::$defaultPrecision;
+ } else {
+ $precision = pow(10, -$scale);
+ }
+
+ if (empty($op1)) {
+ $op1 = 0;
+ }
+ $op1 = self::normalize($op1);
+ $op2 = self::normalize($op2);
+ $result = $op1 - $op2;
+ if (is_infinite($result) or (abs($result + $op2 - $op1) > $precision)) {
+ throw new Zend_Locale_Math_Exception("subtraction overflow: $op1 - $op2 != $result", $op1, $op2, $result);
+ }
+
+ return self::round(self::normalize($result), $scale);
+ }
+
+ public static function Pow($op1, $op2, $scale = null)
+ {
+ if ($scale === null) {
+ $scale = Zend_Locale_Math_PhpMath::$defaultScale;
+ }
+
+ $op1 = self::normalize($op1);
+ $op2 = self::normalize($op2);
+
+ // BCMath extension doesn't use decimal part of the power
+ // Provide the same behavior
+ $op2 = ($op2 > 0) ? floor($op2) : ceil($op2);
+
+ $result = pow($op1, $op2);
+ if (is_infinite($result) or is_nan($result)) {
+ throw new Zend_Locale_Math_Exception("power overflow: $op1 ^ $op2", $op1, $op2, $result);
+ }
+
+ return self::round(self::normalize($result), $scale);
+ }
+
+ public static function Mul($op1, $op2, $scale = null)
+ {
+ if ($scale === null) {
+ $scale = Zend_Locale_Math_PhpMath::$defaultScale;
+ }
+
+ if (empty($op1)) {
+ $op1 = 0;
+ }
+ $op1 = self::normalize($op1);
+ $op2 = self::normalize($op2);
+ $result = $op1 * $op2;
+ if (is_infinite($result) or is_nan($result)) {
+ throw new Zend_Locale_Math_Exception("multiplication overflow: $op1 * $op2 != $result", $op1, $op2, $result);
+ }
+
+ return self::round(self::normalize($result), $scale);
+ }
+
+ public static function Div($op1, $op2, $scale = null)
+ {
+ if ($scale === null) {
+ $scale = Zend_Locale_Math_PhpMath::$defaultScale;
+ }
+
+ if (empty($op2)) {
+ throw new Zend_Locale_Math_Exception("can not divide by zero", $op1, $op2, null);
+ }
+ if (empty($op1)) {
+ $op1 = 0;
+ }
+ $op1 = self::normalize($op1);
+ $op2 = self::normalize($op2);
+ $result = $op1 / $op2;
+ if (is_infinite($result) or is_nan($result)) {
+ throw new Zend_Locale_Math_Exception("division overflow: $op1 / $op2 != $result", $op1, $op2, $result);
+ }
+
+ return self::round(self::normalize($result), $scale);
+ }
+
+ public static function Sqrt($op1, $scale = null)
+ {
+ if ($scale === null) {
+ $scale = Zend_Locale_Math_PhpMath::$defaultScale;
+ }
+
+ if (empty($op1)) {
+ $op1 = 0;
+ }
+ $op1 = self::normalize($op1);
+ $result = sqrt($op1);
+ if (is_nan($result)) {
+ return NULL;
+ }
+
+ return self::round(self::normalize($result), $scale);
+ }
+
+ public static function Mod($op1, $op2)
+ {
+ if (empty($op1)) {
+ $op1 = 0;
+ }
+ if (empty($op2)) {
+ return NULL;
+ }
+ $op1 = self::normalize($op1);
+ $op2 = self::normalize($op2);
+ if ((int)$op2 == 0) {
+ return NULL;
+ }
+ $result = $op1 % $op2;
+ if (is_nan($result) or (($op1 - $result) % $op2 != 0)) {
+ throw new Zend_Locale_Math_Exception("modulus calculation error: $op1 % $op2 != $result", $op1, $op2, $result);
+ }
+
+ return self::normalize($result);
+ }
+
+ public static function Comp($op1, $op2, $scale = null)
+ {
+ if ($scale === null) {
+ $scale = Zend_Locale_Math_PhpMath::$defaultScale;
+ }
+
+ if (empty($op1)) {
+ $op1 = 0;
+ }
+ $op1 = self::normalize($op1);
+ $op2 = self::normalize($op2);
+ if ($scale <> 0) {
+ $op1 = self::round($op1, $scale);
+ $op2 = self::round($op2, $scale);
+ } else {
+ $op1 = ($op1 > 0) ? floor($op1) : ceil($op1);
+ $op2 = ($op2 > 0) ? floor($op2) : ceil($op2);
+ }
+ if ($op1 > $op2) {
+ return 1;
+ } else if ($op1 < $op2) {
+ return -1;
+ }
+ return 0;
+ }
+
+ public static function Scale($scale)
+ {
+ if ($scale > 9) {
+ throw new Zend_Locale_Math_Exception("can not scale to precision $scale", $scale, null, null);
+ }
+ self::$defaultScale = $scale;
+ self::$defaultPrecision = pow(10, -$scale);
+ return true;
+ }
+}
+
+Zend_Locale_Math_PhpMath::disable(); // disable use of bcmath functions
diff --git a/library/vendor/Zend/Log.php b/library/vendor/Zend/Log.php
new file mode 100644
index 0000000..e9d14a9
--- /dev/null
+++ b/library/vendor/Zend/Log.php
@@ -0,0 +1,645 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Log
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ *
+ * Convenience methods for log [@see Zend_Log::__call()]:
+ *
+ * @method emerg(string $message, $extras = null)
+ * @method alert(string $message, $extras = null)
+ * @method crit(string $message, $extras = null)
+ * @method err(string $message, $extras = null)
+ * @method warn(string $message, $extras = null)
+ * @method notice(string $message, $extras = null)
+ * @method info(string $message, $extras = null)
+ * @method debug(string $message, $extras = null)
+ */
+class Zend_Log
+{
+ const EMERG = 0; // Emergency: system is unusable
+ const ALERT = 1; // Alert: action must be taken immediately
+ const CRIT = 2; // Critical: critical conditions
+ const ERR = 3; // Error: error conditions
+ const WARN = 4; // Warning: warning conditions
+ const NOTICE = 5; // Notice: normal but significant condition
+ const INFO = 6; // Informational: informational messages
+ const DEBUG = 7; // Debug: debug messages
+
+ /**
+ * @var array of priorities where the keys are the
+ * priority numbers and the values are the priority names
+ */
+ protected $_priorities = array();
+
+ /**
+ * @var array of Zend_Log_Writer_Abstract
+ */
+ protected $_writers = array();
+
+ /**
+ * @var array of Zend_Log_Filter_Interface
+ */
+ protected $_filters = array();
+
+ /**
+ * @var array of extra log event
+ */
+ protected $_extras = array();
+
+ /**
+ *
+ * @var string
+ */
+ protected $_defaultWriterNamespace = 'Zend_Log_Writer';
+
+ /**
+ *
+ * @var string
+ */
+ protected $_defaultFilterNamespace = 'Zend_Log_Filter';
+
+ /**
+ *
+ * @var string
+ */
+ protected $_defaultFormatterNamespace = 'Zend_Log_Formatter';
+
+ /**
+ *
+ * @var callback
+ */
+ protected $_origErrorHandler = null;
+
+ /**
+ *
+ * @var boolean
+ */
+ protected $_registeredErrorHandler = false;
+
+ /**
+ *
+ * @var array|boolean
+ */
+ protected $_errorHandlerMap = false;
+
+ /**
+ *
+ * @var string
+ */
+ protected $_timestampFormat = 'c';
+
+ /**
+ * Class constructor. Create a new logger
+ *
+ * @param Zend_Log_Writer_Abstract|null $writer default writer
+ */
+ public function __construct(Zend_Log_Writer_Abstract $writer = null)
+ {
+ $r = new ReflectionClass($this);
+ $this->_priorities = array_flip($r->getConstants());
+
+ if ($writer !== null) {
+ $this->addWriter($writer);
+ }
+ }
+
+ /**
+ * Factory to construct the logger and one or more writers
+ * based on the configuration array
+ *
+ * @param array|Zend_Config Array or instance of Zend_Config
+ * @return Zend_Log
+ * @throws Zend_Log_Exception
+ */
+ static public function factory($config = array())
+ {
+ if ($config instanceof Zend_Config) {
+ $config = $config->toArray();
+ }
+
+ if (!is_array($config) || empty($config)) {
+ /** @see Zend_Log_Exception */
+ throw new Zend_Log_Exception('Configuration must be an array or instance of Zend_Config');
+ }
+
+ if (array_key_exists('className', $config)) {
+ $class = $config['className'];
+ unset($config['className']);
+ } else {
+ $class = __CLASS__;
+ }
+
+ $log = new $class;
+
+ if (!$log instanceof Zend_Log) {
+ /** @see Zend_Log_Exception */
+ throw new Zend_Log_Exception('Passed className does not belong to a descendant of Zend_Log');
+ }
+
+ if (array_key_exists('timestampFormat', $config)) {
+ if (null != $config['timestampFormat'] && '' != $config['timestampFormat']) {
+ $log->setTimestampFormat($config['timestampFormat']);
+ }
+ unset($config['timestampFormat']);
+ }
+
+ if (!is_array(current($config))) {
+ $log->addWriter(current($config));
+ } else {
+ foreach($config as $writer) {
+ $log->addWriter($writer);
+ }
+ }
+
+ return $log;
+ }
+
+
+ /**
+ * Construct a writer object based on a configuration array
+ *
+ * @param array $config config array with writer spec
+ * @return Zend_Log_Writer_Abstract
+ * @throws Zend_Log_Exception
+ */
+ protected function _constructWriterFromConfig($config)
+ {
+ $writer = $this->_constructFromConfig('writer', $config, $this->_defaultWriterNamespace);
+
+ if (!$writer instanceof Zend_Log_Writer_Abstract) {
+ $writerName = is_object($writer)
+ ? get_class($writer)
+ : 'The specified writer';
+ /** @see Zend_Log_Exception */
+ throw new Zend_Log_Exception("{$writerName} does not extend Zend_Log_Writer_Abstract!");
+ }
+
+ if (isset($config['filterName'])) {
+ $filter = $this->_constructFilterFromConfig($config);
+ $writer->addFilter($filter);
+ }
+
+ if (isset($config['formatterName'])) {
+ $formatter = $this->_constructFormatterFromConfig($config);
+ $writer->setFormatter($formatter);
+ }
+
+ return $writer;
+ }
+
+ /**
+ * Construct filter object from configuration array or Zend_Config object
+ *
+ * @param array|Zend_Config $config Zend_Config or Array
+ * @return Zend_Log_Filter_Interface
+ * @throws Zend_Log_Exception
+ */
+ protected function _constructFilterFromConfig($config)
+ {
+ $filter = $this->_constructFromConfig('filter', $config, $this->_defaultFilterNamespace);
+
+ if (!$filter instanceof Zend_Log_Filter_Interface) {
+ $filterName = is_object($filter)
+ ? get_class($filter)
+ : 'The specified filter';
+ /** @see Zend_Log_Exception */
+ throw new Zend_Log_Exception("{$filterName} does not implement Zend_Log_Filter_Interface");
+ }
+
+ return $filter;
+ }
+
+ /**
+ * Construct formatter object from configuration array or Zend_Config object
+ *
+ * @param array|Zend_Config $config Zend_Config or Array
+ * @return Zend_Log_Formatter_Interface
+ * @throws Zend_Log_Exception
+ */
+ protected function _constructFormatterFromConfig($config)
+ {
+ $formatter = $this->_constructFromConfig('formatter', $config, $this->_defaultFormatterNamespace);
+
+ if (!$formatter instanceof Zend_Log_Formatter_Interface) {
+ $formatterName = is_object($formatter)
+ ? get_class($formatter)
+ : 'The specified formatter';
+ /** @see Zend_Log_Exception */
+ throw new Zend_Log_Exception($formatterName . ' does not implement Zend_Log_Formatter_Interface');
+ }
+
+ return $formatter;
+ }
+
+ /**
+ * Construct a filter or writer from config
+ *
+ * @param string $type 'writer' of 'filter'
+ * @param mixed $config Zend_Config or Array
+ * @param string $namespace
+ * @return object
+ * @throws Zend_Log_Exception
+ */
+ protected function _constructFromConfig($type, $config, $namespace)
+ {
+ if ($config instanceof Zend_Config) {
+ $config = $config->toArray();
+ }
+
+ if (!is_array($config) || empty($config)) {
+ throw new Zend_Log_Exception(
+ 'Configuration must be an array or instance of Zend_Config'
+ );
+ }
+
+ $params = isset($config[ $type .'Params' ]) ? $config[ $type .'Params' ] : array();
+ $className = $this->getClassName($config, $type, $namespace);
+ if (!class_exists($className)) {
+ Zend_Loader::loadClass($className);
+ }
+
+ $reflection = new ReflectionClass($className);
+ if (!$reflection->implementsInterface('Zend_Log_FactoryInterface')) {
+ throw new Zend_Log_Exception(
+ $className . ' does not implement Zend_Log_FactoryInterface and can not be constructed from config.'
+ );
+ }
+
+ return call_user_func(array($className, 'factory'), $params);
+ }
+
+ /**
+ * Get the writer or filter full classname
+ *
+ * @param array $config
+ * @param string $type filter|writer
+ * @param string $defaultNamespace
+ * @return string full classname
+ * @throws Zend_Log_Exception
+ */
+ protected function getClassName($config, $type, $defaultNamespace)
+ {
+ if (!isset($config[$type . 'Name'])) {
+ throw new Zend_Log_Exception("Specify {$type}Name in the configuration array");
+ }
+
+ $className = $config[$type . 'Name'];
+ $namespace = $defaultNamespace;
+
+ if (isset($config[$type . 'Namespace'])) {
+ $namespace = $config[$type . 'Namespace'];
+ }
+
+ // PHP >= 5.3.0 namespace given?
+ if (substr($namespace, -1) == '\\') {
+ return $namespace . $className;
+ }
+
+ // empty namespace given?
+ if (strlen($namespace) === 0) {
+ return $className;
+ }
+
+ return $namespace . '_' . $className;
+ }
+
+ /**
+ * Packs message and priority into Event array
+ *
+ * @param string $message Message to log
+ * @param integer $priority Priority of message
+ * @return array Event array
+ */
+ protected function _packEvent($message, $priority)
+ {
+ return array_merge(array(
+ 'timestamp' => date($this->_timestampFormat),
+ 'message' => $message,
+ 'priority' => $priority,
+ 'priorityName' => $this->_priorities[$priority]
+ ),
+ $this->_extras
+ );
+ }
+
+ /**
+ * Class destructor. Shutdown log writers
+ *
+ * @return void
+ */
+ public function __destruct()
+ {
+ /** @var Zend_Log_Writer_Abstract $writer */
+ foreach($this->_writers as $writer) {
+ $writer->shutdown();
+ }
+ }
+
+ /**
+ * Undefined method handler allows a shortcut:
+ * $log->priorityName('message')
+ * instead of
+ * $log->log('message', Zend_Log::PRIORITY_NAME)
+ *
+ * @param string $method priority name
+ * @param string $params message to log
+ * @return void
+ * @throws Zend_Log_Exception
+ */
+ public function __call($method, $params)
+ {
+ $priority = strtoupper($method);
+ if (($priority = array_search($priority, $this->_priorities)) !== false) {
+ switch (count($params)) {
+ case 0:
+ /** @see Zend_Log_Exception */
+ throw new Zend_Log_Exception('Missing log message');
+ case 1:
+ $message = array_shift($params);
+ $extras = null;
+ break;
+ default:
+ $message = array_shift($params);
+ $extras = array_shift($params);
+ break;
+ }
+ $this->log($message, $priority, $extras);
+ } else {
+ /** @see Zend_Log_Exception */
+ throw new Zend_Log_Exception('Bad log priority');
+ }
+ }
+
+ /**
+ * Log a message at a priority
+ *
+ * @param string $message Message to log
+ * @param integer $priority Priority of message
+ * @param mixed $extras Extra information to log in event
+ * @return void
+ * @throws Zend_Log_Exception
+ */
+ public function log($message, $priority, $extras = null)
+ {
+ // sanity checks
+ if (empty($this->_writers)) {
+ /** @see Zend_Log_Exception */
+ throw new Zend_Log_Exception('No writers were added');
+ }
+
+ if (! isset($this->_priorities[$priority])) {
+ /** @see Zend_Log_Exception */
+ throw new Zend_Log_Exception('Bad log priority');
+ }
+
+ // pack into event required by filters and writers
+ $event = $this->_packEvent($message, $priority);
+
+ // Check to see if any extra information was passed
+ if (!empty($extras)) {
+ $info = array();
+ if (is_array($extras)) {
+ foreach ($extras as $key => $value) {
+ if (is_string($key)) {
+ $event[$key] = $value;
+ } else {
+ $info[] = $value;
+ }
+ }
+ } else {
+ $info = $extras;
+ }
+ if (!empty($info)) {
+ $event['info'] = $info;
+ }
+ }
+
+ // abort if rejected by the global filters
+ /** @var Zend_Log_Filter_Interface $filter */
+ foreach ($this->_filters as $filter) {
+ if (! $filter->accept($event)) {
+ return;
+ }
+ }
+
+ // send to each writer
+ /** @var Zend_Log_Writer_Abstract $writer */
+ foreach ($this->_writers as $writer) {
+ $writer->write($event);
+ }
+ }
+
+ /**
+ * Add a custom priority
+ *
+ * @param string $name Name of priority
+ * @param integer $priority Numeric priority
+ * @return $this
+ * @throws Zend_Log_Exception
+ */
+ public function addPriority($name, $priority)
+ {
+ // Priority names must be uppercase for predictability.
+ $name = strtoupper($name);
+
+ if (isset($this->_priorities[$priority])
+ || false !== array_search($name, $this->_priorities)) {
+ /** @see Zend_Log_Exception */
+ throw new Zend_Log_Exception('Existing priorities cannot be overwritten');
+ }
+
+ $this->_priorities[$priority] = $name;
+ return $this;
+ }
+
+ /**
+ * Add a filter that will be applied before all log writers.
+ * Before a message will be received by any of the writers, it
+ * must be accepted by all filters added with this method.
+ *
+ * @param int|Zend_Config|array|Zend_Log_Filter_Interface $filter
+ * @return $this
+ * @throws Zend_Log_Exception
+ */
+ public function addFilter($filter)
+ {
+ if (is_int($filter)) {
+ /** @see Zend_Log_Filter_Priority */
+ $filter = new Zend_Log_Filter_Priority($filter);
+
+ } elseif ($filter instanceof Zend_Config || is_array($filter)) {
+ $filter = $this->_constructFilterFromConfig($filter);
+
+ } elseif(! $filter instanceof Zend_Log_Filter_Interface) {
+ /** @see Zend_Log_Exception */
+ throw new Zend_Log_Exception('Invalid filter provided');
+ }
+
+ $this->_filters[] = $filter;
+ return $this;
+ }
+
+ /**
+ * Add a writer. A writer is responsible for taking a log
+ * message and writing it out to storage.
+ *
+ * @param mixed $writer Zend_Log_Writer_Abstract or Config array
+ * @return Zend_Log
+ * @throws Zend_Log_Exception
+ */
+ public function addWriter($writer)
+ {
+ if (is_array($writer) || $writer instanceof Zend_Config) {
+ $writer = $this->_constructWriterFromConfig($writer);
+ }
+
+ if (!$writer instanceof Zend_Log_Writer_Abstract) {
+ /** @see Zend_Log_Exception */
+ throw new Zend_Log_Exception(
+ 'Writer must be an instance of Zend_Log_Writer_Abstract'
+ . ' or you should pass a configuration array'
+ );
+ }
+
+ $this->_writers[] = $writer;
+ return $this;
+ }
+
+ /**
+ * Set an extra item to pass to the log writers.
+ *
+ * @param string $name Name of the field
+ * @param string $value Value of the field
+ * @return Zend_Log
+ */
+ public function setEventItem($name, $value)
+ {
+ $this->_extras = array_merge($this->_extras, array($name => $value));
+ return $this;
+ }
+
+ /**
+ * Register Logging system as an error handler to log php errors
+ * Note: it still calls the original error handler if set_error_handler is able to return it.
+ *
+ * Errors will be mapped as:
+ * E_NOTICE, E_USER_NOTICE => NOTICE
+ * E_WARNING, E_CORE_WARNING, E_USER_WARNING => WARN
+ * E_ERROR, E_USER_ERROR, E_CORE_ERROR, E_RECOVERABLE_ERROR => ERR
+ * E_DEPRECATED, E_STRICT, E_USER_DEPRECATED => DEBUG
+ * (unknown/other) => INFO
+ *
+ * @link http://www.php.net/manual/en/function.set-error-handler.php Custom error handler
+ *
+ * @return Zend_Log
+ */
+ public function registerErrorHandler()
+ {
+ // Only register once. Avoids loop issues if it gets registered twice.
+ if ($this->_registeredErrorHandler) {
+ return $this;
+ }
+
+ $this->_origErrorHandler = set_error_handler(array($this, 'errorHandler'));
+
+ // Contruct a default map of phpErrors to Zend_Log priorities.
+ // Some of the errors are uncatchable, but are included for completeness
+ $this->_errorHandlerMap = array(
+ E_NOTICE => Zend_Log::NOTICE,
+ E_USER_NOTICE => Zend_Log::NOTICE,
+ E_WARNING => Zend_Log::WARN,
+ E_CORE_WARNING => Zend_Log::WARN,
+ E_USER_WARNING => Zend_Log::WARN,
+ E_ERROR => Zend_Log::ERR,
+ E_USER_ERROR => Zend_Log::ERR,
+ E_CORE_ERROR => Zend_Log::ERR,
+ E_RECOVERABLE_ERROR => Zend_Log::ERR,
+ E_STRICT => Zend_Log::DEBUG,
+ );
+ // PHP 5.3.0+
+ if (defined('E_DEPRECATED')) {
+ $this->_errorHandlerMap['E_DEPRECATED'] = Zend_Log::DEBUG;
+ }
+ if (defined('E_USER_DEPRECATED')) {
+ $this->_errorHandlerMap['E_USER_DEPRECATED'] = Zend_Log::DEBUG;
+ }
+
+ $this->_registeredErrorHandler = true;
+ return $this;
+ }
+
+ /**
+ * Error Handler will convert error into log message, and then call the original error handler
+ *
+ * @link http://www.php.net/manual/en/function.set-error-handler.php Custom error handler
+ * @param int $errno
+ * @param string $errstr
+ * @param string $errfile
+ * @param int $errline
+ * @param array $errcontext
+ * @return boolean
+ */
+ public function errorHandler($errno, $errstr, $errfile, $errline, $errcontext)
+ {
+ $errorLevel = error_reporting();
+
+ if ($errorLevel & $errno) {
+ if (isset($this->_errorHandlerMap[$errno])) {
+ $priority = $this->_errorHandlerMap[$errno];
+ } else {
+ $priority = Zend_Log::INFO;
+ }
+ $this->log($errstr, $priority, array('errno'=>$errno, 'file'=>$errfile, 'line'=>$errline, 'context'=>$errcontext));
+ }
+
+ if ($this->_origErrorHandler !== null) {
+ return call_user_func($this->_origErrorHandler, $errno, $errstr, $errfile, $errline, $errcontext);
+ }
+ return false;
+ }
+
+ /**
+ * Set timestamp format for log entries.
+ *
+ * @param string $format
+ * @return Zend_Log
+ */
+ public function setTimestampFormat($format)
+ {
+ $this->_timestampFormat = $format;
+ return $this;
+ }
+
+ /**
+ * Get timestamp format used for log entries.
+ *
+ * @return string
+ */
+ public function getTimestampFormat()
+ {
+ return $this->_timestampFormat;
+ }
+}
diff --git a/library/vendor/Zend/Log/Exception.php b/library/vendor/Zend/Log/Exception.php
new file mode 100644
index 0000000..84c7633
--- /dev/null
+++ b/library/vendor/Zend/Log/Exception.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Exception */
+
+/**
+ * @category Zend
+ * @package Zend_Log
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Log_Exception extends Zend_Exception
+{}
diff --git a/library/vendor/Zend/Log/FactoryInterface.php b/library/vendor/Zend/Log/FactoryInterface.php
new file mode 100644
index 0000000..eb67e2c
--- /dev/null
+++ b/library/vendor/Zend/Log/FactoryInterface.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Log
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+interface Zend_Log_FactoryInterface
+{
+ /**
+ * Construct a Zend_Log driver
+ *
+ * @param array|Zend_Config $config
+ * @return Zend_Log_FactoryInterface
+ */
+ static public function factory($config);
+}
diff --git a/library/vendor/Zend/Log/Filter/Abstract.php b/library/vendor/Zend/Log/Filter/Abstract.php
new file mode 100644
index 0000000..53cd40c
--- /dev/null
+++ b/library/vendor/Zend/Log/Filter/Abstract.php
@@ -0,0 +1,57 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Writer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** @see Zend_Log_Filter_Interface */
+
+/** @see Zend_Log_FactoryInterface */
+
+/**
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+abstract class Zend_Log_Filter_Abstract
+ implements Zend_Log_Filter_Interface, Zend_Log_FactoryInterface
+{
+ /**
+ * Validate and optionally convert the config to array
+ *
+ * @param array|Zend_Config $config Zend_Config or Array
+ * @return array
+ * @throws Zend_Log_Exception
+ */
+ static protected function _parseConfig($config)
+ {
+ if ($config instanceof Zend_Config) {
+ $config = $config->toArray();
+ }
+
+ if (!is_array($config)) {
+ throw new Zend_Log_Exception('Configuration must be an array or instance of Zend_Config');
+ }
+
+ return $config;
+ }
+}
diff --git a/library/vendor/Zend/Log/Filter/Interface.php b/library/vendor/Zend/Log/Filter/Interface.php
new file mode 100644
index 0000000..dc0cbad
--- /dev/null
+++ b/library/vendor/Zend/Log/Filter/Interface.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+interface Zend_Log_Filter_Interface
+{
+ /**
+ * Returns TRUE to accept the message, FALSE to block it.
+ *
+ * @param array $event event data
+ * @return boolean accepted?
+ */
+ public function accept($event);
+}
diff --git a/library/vendor/Zend/Log/Filter/Message.php b/library/vendor/Zend/Log/Filter/Message.php
new file mode 100644
index 0000000..3b98f92
--- /dev/null
+++ b/library/vendor/Zend/Log/Filter/Message.php
@@ -0,0 +1,83 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Log_Filter_Abstract */
+
+/**
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Log_Filter_Message extends Zend_Log_Filter_Abstract
+{
+ /**
+ * @var string
+ */
+ protected $_regexp;
+
+ /**
+ * Filter out any log messages not matching $regexp.
+ *
+ * @param string $regexp Regular expression to test the log message
+ * @return void
+ * @throws Zend_Log_Exception
+ */
+ public function __construct($regexp)
+ {
+ if (@preg_match($regexp, '') === false) {
+ throw new Zend_Log_Exception("Invalid regular expression '$regexp'");
+ }
+ $this->_regexp = $regexp;
+ }
+
+ /**
+ * Create a new instance of Zend_Log_Filter_Message
+ *
+ * @param array|Zend_Config $config
+ * @return Zend_Log_Filter_Message
+ */
+ static public function factory($config)
+ {
+ $config = self::_parseConfig($config);
+ $config = array_merge(array(
+ 'regexp' => null
+ ), $config);
+
+ return new self(
+ $config['regexp']
+ );
+ }
+
+ /**
+ * Returns TRUE to accept the message, FALSE to block it.
+ *
+ * @param array $event event data
+ * @return boolean accepted?
+ */
+ public function accept($event)
+ {
+ return preg_match($this->_regexp, $event['message']) > 0;
+ }
+}
diff --git a/library/vendor/Zend/Log/Filter/Priority.php b/library/vendor/Zend/Log/Filter/Priority.php
new file mode 100644
index 0000000..f1dbd93
--- /dev/null
+++ b/library/vendor/Zend/Log/Filter/Priority.php
@@ -0,0 +1,99 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Log_Filter_Abstract */
+
+/**
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Log_Filter_Priority extends Zend_Log_Filter_Abstract
+{
+ /**
+ * @var integer
+ */
+ protected $_priority;
+
+ /**
+ * @var string
+ */
+ protected $_operator;
+
+ /**
+ * Filter logging by $priority. By default, it will accept any log
+ * event whose priority value is less than or equal to $priority.
+ *
+ * @param integer $priority Priority
+ * @param string $operator Comparison operator
+ * @return void
+ * @throws Zend_Log_Exception
+ */
+ public function __construct($priority, $operator = null)
+ {
+ if (! is_int($priority)) {
+ throw new Zend_Log_Exception('Priority must be an integer');
+ }
+
+ $this->_priority = $priority;
+ $this->_operator = $operator === null ? '<=' : $operator;
+ }
+
+ /**
+ * Create a new instance of Zend_Log_Filter_Priority
+ *
+ * @param array|Zend_Config $config
+ * @return Zend_Log_Filter_Priority
+ */
+ static public function factory($config)
+ {
+ $config = self::_parseConfig($config);
+ $config = array_merge(array(
+ 'priority' => null,
+ 'operator' => null,
+ ), $config);
+
+ // Add support for constants
+ if (!is_numeric($config['priority']) && isset($config['priority']) && defined($config['priority'])) {
+ $config['priority'] = constant($config['priority']);
+ }
+
+ return new self(
+ (int) $config['priority'],
+ $config['operator']
+ );
+ }
+
+ /**
+ * Returns TRUE to accept the message, FALSE to block it.
+ *
+ * @param array $event event data
+ * @return boolean accepted?
+ */
+ public function accept($event)
+ {
+ return version_compare($event['priority'], $this->_priority, $this->_operator);
+ }
+}
diff --git a/library/vendor/Zend/Log/Filter/Suppress.php b/library/vendor/Zend/Log/Filter/Suppress.php
new file mode 100644
index 0000000..3766077
--- /dev/null
+++ b/library/vendor/Zend/Log/Filter/Suppress.php
@@ -0,0 +1,76 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Log_Filter_Interface */
+
+/**
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Filter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Log_Filter_Suppress extends Zend_Log_Filter_Abstract
+{
+ /**
+ * @var boolean
+ */
+ protected $_accept = true;
+
+ /**
+ * This is a simple boolean filter.
+ *
+ * Call suppress(true) to suppress all log events.
+ * Call suppress(false) to accept all log events.
+ *
+ * @param boolean $suppress Should all log events be suppressed?
+ * @return void
+ */
+ public function suppress($suppress)
+ {
+ $this->_accept = (! $suppress);
+ }
+
+ /**
+ * Returns TRUE to accept the message, FALSE to block it.
+ *
+ * @param array $event event data
+ * @return boolean accepted?
+ */
+ public function accept($event)
+ {
+ return $this->_accept;
+ }
+
+ /**
+ * Create a new instance of Zend_Log_Filter_Suppress
+ *
+ * @param array|Zend_Config $config
+ * @return Zend_Log_Filter_Suppress
+ * @throws Zend_Log_Exception
+ */
+ static public function factory($config)
+ {
+ return new self();
+ }
+}
diff --git a/library/vendor/Zend/Log/Formatter/Abstract.php b/library/vendor/Zend/Log/Formatter/Abstract.php
new file mode 100644
index 0000000..6fa402a
--- /dev/null
+++ b/library/vendor/Zend/Log/Formatter/Abstract.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Formatter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** @see Zend_Log_Formatter_Interface */
+
+/** @see Zend_Log_FactoryInterface */
+
+/**
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Formatter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+abstract class Zend_Log_Formatter_Abstract
+ implements Zend_Log_Formatter_Interface, Zend_Log_FactoryInterface
+{
+}
diff --git a/library/vendor/Zend/Log/Formatter/Interface.php b/library/vendor/Zend/Log/Formatter/Interface.php
new file mode 100644
index 0000000..9b21fa7
--- /dev/null
+++ b/library/vendor/Zend/Log/Formatter/Interface.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Formatter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Formatter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+interface Zend_Log_Formatter_Interface
+{
+ /**
+ * Formats data into a single line to be written by the writer.
+ *
+ * @param array $event event data
+ * @return string formatted line to write to the log
+ */
+ public function format($event);
+
+}
diff --git a/library/vendor/Zend/Log/Formatter/Simple.php b/library/vendor/Zend/Log/Formatter/Simple.php
new file mode 100644
index 0000000..b2c2376
--- /dev/null
+++ b/library/vendor/Zend/Log/Formatter/Simple.php
@@ -0,0 +1,106 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Formatter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Log_Formatter_Abstract */
+
+/**
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Formatter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Log_Formatter_Simple extends Zend_Log_Formatter_Abstract
+{
+ /**
+ * @var string
+ */
+ protected $_format;
+
+ const DEFAULT_FORMAT = '%timestamp% %priorityName% (%priority%): %message%';
+
+ /**
+ * Class constructor
+ *
+ * @param null|string $format Format specifier for log messages
+ * @return void
+ * @throws Zend_Log_Exception
+ */
+ public function __construct($format = null)
+ {
+ if ($format === null) {
+ $format = self::DEFAULT_FORMAT . PHP_EOL;
+ }
+
+ if (!is_string($format)) {
+ throw new Zend_Log_Exception('Format must be a string');
+ }
+
+ $this->_format = $format;
+ }
+
+ /**
+ * Factory for Zend_Log_Formatter_Simple classe
+ *
+ * @param array|Zend_Config $options
+ * @return Zend_Log_Formatter_Simple
+ */
+ public static function factory($options)
+ {
+ $format = null;
+ if (null !== $options) {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ }
+
+ if (array_key_exists('format', $options)) {
+ $format = $options['format'];
+ }
+ }
+
+ return new self($format);
+ }
+
+ /**
+ * Formats data into a single line to be written by the writer.
+ *
+ * @param array $event event data
+ * @return string formatted line to write to the log
+ */
+ public function format($event)
+ {
+ $output = $this->_format;
+
+ foreach ($event as $name => $value) {
+ if ((is_object($value) && !method_exists($value,'__toString'))
+ || is_array($value)
+ ) {
+ $value = gettype($value);
+ }
+
+ $output = str_replace("%$name%", $value, $output);
+ }
+
+ return $output;
+ }
+}
diff --git a/library/vendor/Zend/Log/Formatter/Xml.php b/library/vendor/Zend/Log/Formatter/Xml.php
new file mode 100644
index 0000000..21fddb6
--- /dev/null
+++ b/library/vendor/Zend/Log/Formatter/Xml.php
@@ -0,0 +1,164 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Formatter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Log_Formatter_Abstract */
+
+/**
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Formatter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Log_Formatter_Xml extends Zend_Log_Formatter_Abstract
+{
+ /**
+ * @var string Name of root element
+ */
+ protected $_rootElement;
+
+ /**
+ * @var array Relates XML elements to log data field keys.
+ */
+ protected $_elementMap;
+
+ /**
+ * @var string Encoding to use in XML
+ */
+ protected $_encoding;
+
+ /**
+ * Class constructor
+ * (the default encoding is UTF-8)
+ *
+ * @param array|Zend_Config $options
+ * @return void
+ */
+ public function __construct($options = array())
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } elseif (!is_array($options)) {
+ $args = func_get_args();
+
+ $options = array(
+ 'rootElement' => array_shift($args)
+ );
+
+ if (count($args)) {
+ $options['elementMap'] = array_shift($args);
+ }
+
+ if (count($args)) {
+ $options['encoding'] = array_shift($args);
+ }
+ }
+
+ if (!array_key_exists('rootElement', $options)) {
+ $options['rootElement'] = 'logEntry';
+ }
+
+ if (!array_key_exists('encoding', $options)) {
+ $options['encoding'] = 'UTF-8';
+ }
+
+ $this->_rootElement = $options['rootElement'];
+ $this->setEncoding($options['encoding']);
+
+ if (array_key_exists('elementMap', $options)) {
+ $this->_elementMap = $options['elementMap'];
+ }
+ }
+
+ /**
+ * Factory for Zend_Log_Formatter_Xml classe
+ *
+ * @param array|Zend_Config $options
+ * @return Zend_Log_Formatter_Xml
+ */
+ public static function factory($options)
+ {
+ return new self($options);
+ }
+
+ /**
+ * Get encoding
+ *
+ * @return string
+ */
+ public function getEncoding()
+ {
+ return $this->_encoding;
+ }
+
+ /**
+ * Set encoding
+ *
+ * @param string $value
+ * @return Zend_Log_Formatter_Xml
+ */
+ public function setEncoding($value)
+ {
+ $this->_encoding = (string) $value;
+ return $this;
+ }
+
+ /**
+ * Formats data into a single line to be written by the writer.
+ *
+ * @param array $event event data
+ * @return string formatted line to write to the log
+ */
+ public function format($event)
+ {
+ if ($this->_elementMap === null) {
+ $dataToInsert = $event;
+ } else {
+ $dataToInsert = array();
+ foreach ($this->_elementMap as $elementName => $fieldKey) {
+ $dataToInsert[$elementName] = $event[$fieldKey];
+ }
+ }
+
+ $enc = $this->getEncoding();
+ $dom = new DOMDocument('1.0', $enc);
+ $elt = $dom->appendChild(new DOMElement($this->_rootElement));
+
+ foreach ($dataToInsert as $key => $value) {
+ if (empty($value)
+ || is_scalar($value)
+ || (is_object($value) && method_exists($value,'__toString'))
+ ) {
+ if($key == "message") {
+ $value = htmlspecialchars($value, ENT_COMPAT, $enc);
+ }
+ $elt->appendChild(new DOMElement($key, (string)$value));
+ }
+ }
+
+ $xml = $dom->saveXML();
+ $xml = preg_replace('/<\?xml version="1.0"( encoding="[^\"]*")?\?>\n/u', '', $xml);
+
+ return $xml . PHP_EOL;
+ }
+}
diff --git a/library/vendor/Zend/Log/Writer/Abstract.php b/library/vendor/Zend/Log/Writer/Abstract.php
new file mode 100644
index 0000000..c39be13
--- /dev/null
+++ b/library/vendor/Zend/Log/Writer/Abstract.php
@@ -0,0 +1,138 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Writer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Log_Filter_Priority */
+
+/**
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Writer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+abstract class Zend_Log_Writer_Abstract implements Zend_Log_FactoryInterface
+{
+ /**
+ * @var array of Zend_Log_Filter_Interface
+ */
+ protected $_filters = array();
+
+ /**
+ * Formats the log message before writing.
+ *
+ * @var Zend_Log_Formatter_Interface
+ */
+ protected $_formatter;
+
+ /**
+ * Add a filter specific to this writer.
+ *
+ * @param Zend_Log_Filter_Interface|int $filter Filter class or filter
+ * priority
+ * @return Zend_Log_Writer_Abstract
+ * @throws Zend_Log_Exception
+ */
+ public function addFilter($filter)
+ {
+ if (is_int($filter)) {
+ $filter = new Zend_Log_Filter_Priority($filter);
+ }
+
+ if (!$filter instanceof Zend_Log_Filter_Interface) {
+ /** @see Zend_Log_Exception */
+ throw new Zend_Log_Exception('Invalid filter provided');
+ }
+
+ $this->_filters[] = $filter;
+ return $this;
+ }
+
+ /**
+ * Log a message to this writer.
+ *
+ * @param array $event log data event
+ * @return void
+ */
+ public function write($event)
+ {
+ /** @var Zend_Log_Filter_Interface $filter */
+ foreach ($this->_filters as $filter) {
+ if (!$filter->accept($event)) {
+ return;
+ }
+ }
+
+ // exception occurs on error
+ $this->_write($event);
+ }
+
+ /**
+ * Set a new formatter for this writer
+ *
+ * @param Zend_Log_Formatter_Interface $formatter
+ * @return Zend_Log_Writer_Abstract
+ */
+ public function setFormatter(Zend_Log_Formatter_Interface $formatter)
+ {
+ $this->_formatter = $formatter;
+ return $this;
+ }
+
+ /**
+ * Perform shutdown activites such as closing open resources
+ *
+ * @return void
+ */
+ public function shutdown()
+ {}
+
+ /**
+ * Write a message to the log.
+ *
+ * @param array $event log data event
+ * @return void
+ */
+ abstract protected function _write($event);
+
+ /**
+ * Validate and optionally convert the config to array
+ *
+ * @param array|Zend_Config $config Zend_Config or Array
+ * @return array
+ * @throws Zend_Log_Exception
+ */
+ static protected function _parseConfig($config)
+ {
+ if ($config instanceof Zend_Config) {
+ $config = $config->toArray();
+ }
+
+ if (!is_array($config)) {
+ throw new Zend_Log_Exception(
+ 'Configuration must be an array or instance of Zend_Config'
+ );
+ }
+
+ return $config;
+ }
+}
diff --git a/library/vendor/Zend/Log/Writer/Db.php b/library/vendor/Zend/Log/Writer/Db.php
new file mode 100644
index 0000000..1c61c12
--- /dev/null
+++ b/library/vendor/Zend/Log/Writer/Db.php
@@ -0,0 +1,144 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Writer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Log_Writer_Abstract */
+
+/**
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Writer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Log_Writer_Db extends Zend_Log_Writer_Abstract
+{
+ /**
+ * Database adapter instance
+ *
+ * @var Zend_Db_Adapter
+ */
+ protected $_db;
+
+ /**
+ * Name of the log table in the database
+ *
+ * @var string
+ */
+ protected $_table;
+
+ /**
+ * Relates database columns names to log data field keys.
+ *
+ * @var null|array
+ */
+ protected $_columnMap;
+
+ /**
+ * Class constructor
+ *
+ * @param Zend_Db_Adapter $db Database adapter instance
+ * @param string $table Log table in database
+ * @param array $columnMap
+ * @return void
+ */
+ public function __construct($db, $table, $columnMap = null)
+ {
+ $this->_db = $db;
+ $this->_table = $table;
+ $this->_columnMap = $columnMap;
+ }
+
+ /**
+ * Create a new instance of Zend_Log_Writer_Db
+ *
+ * @param array|Zend_Config $config
+ * @return Zend_Log_Writer_Db
+ */
+ static public function factory($config)
+ {
+ $config = self::_parseConfig($config);
+ $config = array_merge(array(
+ 'db' => null,
+ 'table' => null,
+ 'columnMap' => null,
+ ), $config);
+
+ if (isset($config['columnmap'])) {
+ $config['columnMap'] = $config['columnmap'];
+ }
+
+ return new self(
+ $config['db'],
+ $config['table'],
+ $config['columnMap']
+ );
+ }
+
+ /**
+ * Formatting is not possible on this writer
+ *
+ * @return void
+ * @throws Zend_Log_Exception
+ */
+ public function setFormatter(Zend_Log_Formatter_Interface $formatter)
+ {
+ throw new Zend_Log_Exception(get_class($this) . ' does not support formatting');
+ }
+
+ /**
+ * Remove reference to database adapter
+ *
+ * @return void
+ */
+ public function shutdown()
+ {
+ $this->_db = null;
+ }
+
+ /**
+ * Write a message to the log.
+ *
+ * @param array $event event data
+ * @return void
+ * @throws Zend_Log_Exception
+ */
+ protected function _write($event)
+ {
+ if ($this->_db === null) {
+ throw new Zend_Log_Exception('Database adapter is null');
+ }
+
+ if ($this->_columnMap === null) {
+ $dataToInsert = $event;
+ } else {
+ $dataToInsert = array();
+ foreach ($this->_columnMap as $columnName => $fieldKey) {
+ if (isset($event[$fieldKey])) {
+ $dataToInsert[$columnName] = $event[$fieldKey];
+ }
+ }
+ }
+
+ $this->_db->insert($this->_table, $dataToInsert);
+ }
+}
diff --git a/library/vendor/Zend/Log/Writer/Mail.php b/library/vendor/Zend/Log/Writer/Mail.php
new file mode 100644
index 0000000..571d893
--- /dev/null
+++ b/library/vendor/Zend/Log/Writer/Mail.php
@@ -0,0 +1,426 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Writer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Log_Writer_Abstract */
+
+/** Zend_Log_Exception */
+
+/** Zend_Log_Formatter_Simple*/
+
+/**
+ * Class used for writing log messages to email via Zend_Mail.
+ *
+ * Allows for emailing log messages at and above a certain level via a
+ * Zend_Mail object. Note that this class only sends the email upon
+ * completion, so any log entries accumulated are sent in a single email.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Writer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Log_Writer_Mail extends Zend_Log_Writer_Abstract
+{
+ /**
+ * Array of formatted events to include in message body.
+ *
+ * @var array
+ */
+ protected $_eventsToMail = array();
+
+ /**
+ * Array of formatted lines for use in an HTML email body; these events
+ * are formatted with an optional formatter if the caller is using
+ * Zend_Layout.
+ *
+ * @var array
+ */
+ protected $_layoutEventsToMail = array();
+
+ /**
+ * Zend_Mail instance to use
+ *
+ * @var Zend_Mail
+ */
+ protected $_mail;
+
+ /**
+ * Zend_Layout instance to use; optional.
+ *
+ * @var Zend_Layout
+ */
+ protected $_layout;
+
+ /**
+ * Optional formatter for use when rendering with Zend_Layout.
+ *
+ * @var Zend_Log_Formatter_Interface
+ */
+ protected $_layoutFormatter;
+
+ /**
+ * Array keeping track of the number of entries per priority level.
+ *
+ * @var array
+ */
+ protected $_numEntriesPerPriority = array();
+
+ /**
+ * Subject prepend text.
+ *
+ * Can only be used of the Zend_Mail object has not already had its
+ * subject line set. Using this will cause the subject to have the entry
+ * counts per-priority level appended to it.
+ *
+ * @var string|null
+ */
+ protected $_subjectPrependText;
+
+ /**
+ * MethodMap for Zend_Mail's headers
+ *
+ * @var array
+ */
+ protected static $_methodMapHeaders = array(
+ 'from' => 'setFrom',
+ 'to' => 'addTo',
+ 'cc' => 'addCc',
+ 'bcc' => 'addBcc',
+ );
+
+ /**
+ * Class constructor.
+ *
+ * Constructs the mail writer; requires a Zend_Mail instance, and takes an
+ * optional Zend_Layout instance. If Zend_Layout is being used,
+ * $this->_layout->events will be set for use in the layout template.
+ *
+ * @param Zend_Mail $mail Mail instance
+ * @param Zend_Layout $layout Layout instance; optional
+ * @return void
+ */
+ public function __construct(Zend_Mail $mail, Zend_Layout $layout = null)
+ {
+ $this->_mail = $mail;
+ if (null !== $layout) {
+ $this->setLayout($layout);
+ }
+ $this->_formatter = new Zend_Log_Formatter_Simple();
+ }
+
+ /**
+ * Create a new instance of Zend_Log_Writer_Mail
+ *
+ * @param array|Zend_Config $config
+ * @return Zend_Log_Writer_Mail
+ */
+ static public function factory($config)
+ {
+ $config = self::_parseConfig($config);
+ $mail = self::_constructMailFromConfig($config);
+ $writer = new self($mail);
+
+ if (isset($config['layout']) || isset($config['layoutOptions'])) {
+ $writer->setLayout($config);
+ }
+ if (isset($config['layoutFormatter'])) {
+ $layoutFormatter = new $config['layoutFormatter'];
+ $writer->setLayoutFormatter($layoutFormatter);
+ }
+ if (isset($config['subjectPrependText'])) {
+ $writer->setSubjectPrependText($config['subjectPrependText']);
+ }
+
+ return $writer;
+ }
+
+ /**
+ * Set the layout
+ *
+ * @param Zend_Layout|array $layout
+ * @return Zend_Log_Writer_Mail
+ * @throws Zend_Log_Exception
+ */
+ public function setLayout($layout)
+ {
+ if (is_array($layout)) {
+ $layout = $this->_constructLayoutFromConfig($layout);
+ }
+
+ if (!$layout instanceof Zend_Layout) {
+ throw new Zend_Log_Exception('Mail must be an instance of Zend_Layout or an array');
+ }
+ $this->_layout = $layout;
+
+ return $this;
+ }
+
+ /**
+ * Construct a Zend_Mail instance based on a configuration array
+ *
+ * @param array $config
+ * @return Zend_Mail
+ * @throws Zend_Log_Exception
+ */
+ protected static function _constructMailFromConfig(array $config)
+ {
+ $mailClass = 'Zend_Mail';
+ if (isset($config['mail'])) {
+ $mailClass = $config['mail'];
+ }
+
+ if (!array_key_exists('charset', $config)) {
+ $config['charset'] = null;
+ }
+ $mail = new $mailClass($config['charset']);
+ if (!$mail instanceof Zend_Mail) {
+ throw new Zend_Log_Exception($mail . 'must extend Zend_Mail');
+ }
+
+ if (isset($config['subject'])) {
+ $mail->setSubject($config['subject']);
+ }
+
+ $headerAddresses = array_intersect_key($config, self::$_methodMapHeaders);
+ if (count($headerAddresses)) {
+ foreach ($headerAddresses as $header => $address) {
+ $method = self::$_methodMapHeaders[$header];
+ if (is_array($address) && isset($address['name'])
+ && !is_numeric($address['name'])
+ ) {
+ $params = array(
+ $address['email'],
+ $address['name']
+ );
+ } else if (is_array($address) && isset($address['email'])) {
+ $params = array($address['email']);
+ } else {
+ $params = array($address);
+ }
+ call_user_func_array(array($mail, $method), $params);
+ }
+ }
+
+ return $mail;
+ }
+
+ /**
+ * Construct a Zend_Layout instance based on a configuration array
+ *
+ * @param array $config
+ * @return Zend_Layout
+ * @throws Zend_Log_Exception
+ */
+ protected function _constructLayoutFromConfig(array $config)
+ {
+ $config = array_merge(array(
+ 'layout' => 'Zend_Layout',
+ 'layoutOptions' => null
+ ), $config);
+
+ $layoutClass = $config['layout'];
+ $layout = new $layoutClass($config['layoutOptions']);
+ if (!$layout instanceof Zend_Layout) {
+ throw new Zend_Log_Exception($layout . 'must extend Zend_Layout');
+ }
+
+ return $layout;
+ }
+
+ /**
+ * Places event line into array of lines to be used as message body.
+ *
+ * Handles the formatting of both plaintext entries, as well as those
+ * rendered with Zend_Layout.
+ *
+ * @param array $event Event data
+ * @return void
+ */
+ protected function _write($event)
+ {
+ // Track the number of entries per priority level.
+ if (!isset($this->_numEntriesPerPriority[$event['priorityName']])) {
+ $this->_numEntriesPerPriority[$event['priorityName']] = 1;
+ } else {
+ $this->_numEntriesPerPriority[$event['priorityName']]++;
+ }
+
+ $formattedEvent = $this->_formatter->format($event);
+
+ // All plaintext events are to use the standard formatter.
+ $this->_eventsToMail[] = $formattedEvent;
+
+ // If we have a Zend_Layout instance, use a specific formatter for the
+ // layout if one exists. Otherwise, just use the event with its
+ // default format.
+ if ($this->_layout) {
+ if ($this->_layoutFormatter) {
+ $this->_layoutEventsToMail[] =
+ $this->_layoutFormatter->format($event);
+ } else {
+ $this->_layoutEventsToMail[] = $formattedEvent;
+ }
+ }
+ }
+
+ /**
+ * Gets instance of Zend_Log_Formatter_Instance used for formatting a
+ * message using Zend_Layout, if applicable.
+ *
+ * @return Zend_Log_Formatter_Interface|null The formatter, or null.
+ */
+ public function getLayoutFormatter()
+ {
+ return $this->_layoutFormatter;
+ }
+
+ /**
+ * Sets a specific formatter for use with Zend_Layout events.
+ *
+ * Allows use of a second formatter on lines that will be rendered with
+ * Zend_Layout. In the event that Zend_Layout is not being used, this
+ * formatter cannot be set, so an exception will be thrown.
+ *
+ * @param Zend_Log_Formatter_Interface $formatter
+ * @return Zend_Log_Writer_Mail
+ * @throws Zend_Log_Exception
+ */
+ public function setLayoutFormatter(Zend_Log_Formatter_Interface $formatter)
+ {
+ if (!$this->_layout) {
+ throw new Zend_Log_Exception(
+ 'cannot set formatter for layout; ' .
+ 'a Zend_Layout instance is not in use');
+ }
+
+ $this->_layoutFormatter = $formatter;
+ return $this;
+ }
+
+ /**
+ * Allows caller to have the mail subject dynamically set to contain the
+ * entry counts per-priority level.
+ *
+ * Sets the text for use in the subject, with entry counts per-priority
+ * level appended to the end. Since a Zend_Mail subject can only be set
+ * once, this method cannot be used if the Zend_Mail object already has a
+ * subject set.
+ *
+ * @param string $subject Subject prepend text.
+ * @return Zend_Log_Writer_Mail
+ * @throws Zend_Log_Exception
+ */
+ public function setSubjectPrependText($subject)
+ {
+ if ($this->_mail->getSubject()) {
+ throw new Zend_Log_Exception(
+ 'subject already set on mail; ' .
+ 'cannot set subject prepend text');
+ }
+
+ $this->_subjectPrependText = (string) $subject;
+ return $this;
+ }
+
+ /**
+ * Sends mail to recipient(s) if log entries are present. Note that both
+ * plaintext and HTML portions of email are handled here.
+ *
+ * @return void
+ */
+ public function shutdown()
+ {
+ // If there are events to mail, use them as message body. Otherwise,
+ // there is no mail to be sent.
+ if (empty($this->_eventsToMail)) {
+ return;
+ }
+
+ if ($this->_subjectPrependText !== null) {
+ // Tack on the summary of entries per-priority to the subject
+ // line and set it on the Zend_Mail object.
+ $numEntries = $this->_getFormattedNumEntriesPerPriority();
+ $this->_mail->setSubject(
+ "{$this->_subjectPrependText} ({$numEntries})");
+ }
+
+
+ // Always provide events to mail as plaintext.
+ $this->_mail->setBodyText(implode('', $this->_eventsToMail));
+
+ // If a Zend_Layout instance is being used, set its "events"
+ // value to the lines formatted for use with the layout.
+ if ($this->_layout) {
+ // Set the required "messages" value for the layout. Here we
+ // are assuming that the layout is for use with HTML.
+ $this->_layout->events =
+ implode('', $this->_layoutEventsToMail);
+
+ // If an exception occurs during rendering, convert it to a notice
+ // so we can avoid an exception thrown without a stack frame.
+ try {
+ $this->_mail->setBodyHtml($this->_layout->render());
+ } catch (Exception $e) {
+ trigger_error(
+ "exception occurred when rendering layout; " .
+ "unable to set html body for message; " .
+ "message = {$e->getMessage()}; " .
+ "code = {$e->getCode()}; " .
+ "exception class = " . get_class($e),
+ E_USER_NOTICE);
+ }
+ }
+
+ // Finally, send the mail. If an exception occurs, convert it into a
+ // warning-level message so we can avoid an exception thrown without a
+ // stack frame.
+ try {
+ $this->_mail->send();
+ } catch (Exception $e) {
+ trigger_error(
+ "unable to send log entries via email; " .
+ "message = {$e->getMessage()}; " .
+ "code = {$e->getCode()}; " .
+ "exception class = " . get_class($e),
+ E_USER_WARNING);
+ }
+ }
+
+ /**
+ * Gets a string of number of entries per-priority level that occurred, or
+ * an emptry string if none occurred.
+ *
+ * @return string
+ */
+ protected function _getFormattedNumEntriesPerPriority()
+ {
+ $strings = array();
+
+ foreach ($this->_numEntriesPerPriority as $priority => $numEntries) {
+ $strings[] = "{$priority}={$numEntries}";
+ }
+
+ return implode(', ', $strings);
+ }
+}
diff --git a/library/vendor/Zend/Log/Writer/Mock.php b/library/vendor/Zend/Log/Writer/Mock.php
new file mode 100644
index 0000000..8551123
--- /dev/null
+++ b/library/vendor/Zend/Log/Writer/Mock.php
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Writer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Log_Writer_Abstract */
+
+/**
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Writer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Log_Writer_Mock extends Zend_Log_Writer_Abstract
+{
+ /**
+ * array of log events
+ *
+ * @var array
+ */
+ public $events = array();
+
+ /**
+ * shutdown called?
+ *
+ * @var boolean
+ */
+ public $shutdown = false;
+
+ /**
+ * Write a message to the log.
+ *
+ * @param array $event event data
+ * @return void
+ */
+ public function _write($event)
+ {
+ $this->events[] = $event;
+ }
+
+ /**
+ * Record shutdown
+ *
+ * @return void
+ */
+ public function shutdown()
+ {
+ $this->shutdown = true;
+ }
+
+ /**
+ * Create a new instance of Zend_Log_Writer_Mock
+ *
+ * @param array|Zend_Config $config
+ * @return Zend_Log_Writer_Mock
+ */
+ static public function factory($config)
+ {
+ return new self();
+ }
+}
diff --git a/library/vendor/Zend/Log/Writer/Null.php b/library/vendor/Zend/Log/Writer/Null.php
new file mode 100644
index 0000000..2dc3103
--- /dev/null
+++ b/library/vendor/Zend/Log/Writer/Null.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Writer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Log_Writer_Abstract */
+
+/**
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Writer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Log_Writer_Null extends Zend_Log_Writer_Abstract
+{
+ /**
+ * Write a message to the log.
+ *
+ * @param array $event event data
+ * @return void
+ */
+ protected function _write($event)
+ {
+ }
+
+ /**
+ * Create a new instance of Zend_Log_Writer_Null
+ *
+ * @param array|Zend_Config $config
+ * @return Zend_Log_Writer_Null
+ */
+ static public function factory($config)
+ {
+ return new self();
+ }
+}
diff --git a/library/vendor/Zend/Log/Writer/Stream.php b/library/vendor/Zend/Log/Writer/Stream.php
new file mode 100644
index 0000000..95771e8
--- /dev/null
+++ b/library/vendor/Zend/Log/Writer/Stream.php
@@ -0,0 +1,132 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Writer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Log_Writer_Abstract */
+
+/** Zend_Log_Formatter_Simple */
+
+/**
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Writer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Log_Writer_Stream extends Zend_Log_Writer_Abstract
+{
+ /**
+ * Holds the PHP stream to log to.
+ *
+ * @var null|stream
+ */
+ protected $_stream = null;
+
+ /**
+ * Class Constructor
+ *
+ * @param array|string|resource $streamOrUrl Stream or URL to open as a stream
+ * @param string|null $mode Mode, only applicable if a URL is given
+ * @return void
+ * @throws Zend_Log_Exception
+ */
+ public function __construct($streamOrUrl, $mode = null)
+ {
+ // Setting the default
+ if (null === $mode) {
+ $mode = 'a';
+ }
+
+ if (is_resource($streamOrUrl)) {
+ if (get_resource_type($streamOrUrl) != 'stream') {
+ throw new Zend_Log_Exception('Resource is not a stream');
+ }
+
+ if ($mode != 'a') {
+ throw new Zend_Log_Exception('Mode cannot be changed on existing streams');
+ }
+
+ $this->_stream = $streamOrUrl;
+ } else {
+ if (is_array($streamOrUrl) && isset($streamOrUrl['stream'])) {
+ $streamOrUrl = $streamOrUrl['stream'];
+ }
+
+ if (! $this->_stream = @fopen($streamOrUrl, $mode, false)) {
+ $msg = "\"$streamOrUrl\" cannot be opened with mode \"$mode\"";
+ throw new Zend_Log_Exception($msg);
+ }
+ }
+
+ $this->_formatter = new Zend_Log_Formatter_Simple();
+ }
+
+ /**
+ * Create a new instance of Zend_Log_Writer_Stream
+ *
+ * @param array|Zend_Config $config
+ * @return Zend_Log_Writer_Stream
+ */
+ static public function factory($config)
+ {
+ $config = self::_parseConfig($config);
+ $config = array_merge(array(
+ 'stream' => null,
+ 'mode' => null,
+ ), $config);
+
+ $streamOrUrl = isset($config['url']) ? $config['url'] : $config['stream'];
+
+ return new self(
+ $streamOrUrl,
+ $config['mode']
+ );
+ }
+
+ /**
+ * Close the stream resource.
+ *
+ * @return void
+ */
+ public function shutdown()
+ {
+ if (is_resource($this->_stream)) {
+ fclose($this->_stream);
+ }
+ }
+
+ /**
+ * Write a message to the log.
+ *
+ * @param array $event event data
+ * @return void
+ * @throws Zend_Log_Exception
+ */
+ protected function _write($event)
+ {
+ $line = $this->_formatter->format($event);
+
+ if (false === @fwrite($this->_stream, $line)) {
+ throw new Zend_Log_Exception("Unable to write to stream");
+ }
+ }
+}
diff --git a/library/vendor/Zend/Log/Writer/Syslog.php b/library/vendor/Zend/Log/Writer/Syslog.php
new file mode 100644
index 0000000..7a569d7
--- /dev/null
+++ b/library/vendor/Zend/Log/Writer/Syslog.php
@@ -0,0 +1,263 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Writer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Log */
+
+/** Zend_Log_Writer_Abstract */
+
+/**
+ * Writes log messages to syslog
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Writer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Log_Writer_Syslog extends Zend_Log_Writer_Abstract
+{
+ /**
+ * Maps Zend_Log priorities to PHP's syslog priorities
+ *
+ * @var array
+ */
+ protected $_priorities = array(
+ Zend_Log::EMERG => LOG_EMERG,
+ Zend_Log::ALERT => LOG_ALERT,
+ Zend_Log::CRIT => LOG_CRIT,
+ Zend_Log::ERR => LOG_ERR,
+ Zend_Log::WARN => LOG_WARNING,
+ Zend_Log::NOTICE => LOG_NOTICE,
+ Zend_Log::INFO => LOG_INFO,
+ Zend_Log::DEBUG => LOG_DEBUG,
+ );
+
+ /**
+ * The default log priority - for unmapped custom priorities
+ *
+ * @var string
+ */
+ protected $_defaultPriority = LOG_NOTICE;
+
+ /**
+ * Last application name set by a syslog-writer instance
+ *
+ * @var string
+ */
+ protected static $_lastApplication;
+
+ /**
+ * Last facility name set by a syslog-writer instance
+ *
+ * @var string
+ */
+ protected static $_lastFacility;
+
+ /**
+ * Application name used by this syslog-writer instance
+ *
+ * @var string
+ */
+ protected $_application = 'Zend_Log';
+
+ /**
+ * Facility used by this syslog-writer instance
+ *
+ * @var int
+ */
+ protected $_facility = LOG_USER;
+
+ /**
+ * Types of program available to logging of message
+ *
+ * @var array
+ */
+ protected $_validFacilities = array();
+
+ /**
+ * Class constructor
+ *
+ * @param array $params Array of options; may include "application" and "facility" keys
+ * @return void
+ */
+ public function __construct(array $params = array())
+ {
+ if (isset($params['application'])) {
+ $this->_application = $params['application'];
+ }
+
+ $runInitializeSyslog = true;
+ if (isset($params['facility'])) {
+ $this->setFacility($params['facility']);
+ $runInitializeSyslog = false;
+ }
+
+ if ($runInitializeSyslog) {
+ $this->_initializeSyslog();
+ }
+ }
+
+ /**
+ * Create a new instance of Zend_Log_Writer_Syslog
+ *
+ * @param array|Zend_Config $config
+ * @return Zend_Log_Writer_Syslog
+ */
+ static public function factory($config)
+ {
+ return new self(self::_parseConfig($config));
+ }
+
+ /**
+ * Initialize values facilities
+ *
+ * @return void
+ */
+ protected function _initializeValidFacilities()
+ {
+ $constants = array(
+ 'LOG_AUTH',
+ 'LOG_AUTHPRIV',
+ 'LOG_CRON',
+ 'LOG_DAEMON',
+ 'LOG_KERN',
+ 'LOG_LOCAL0',
+ 'LOG_LOCAL1',
+ 'LOG_LOCAL2',
+ 'LOG_LOCAL3',
+ 'LOG_LOCAL4',
+ 'LOG_LOCAL5',
+ 'LOG_LOCAL6',
+ 'LOG_LOCAL7',
+ 'LOG_LPR',
+ 'LOG_MAIL',
+ 'LOG_NEWS',
+ 'LOG_SYSLOG',
+ 'LOG_USER',
+ 'LOG_UUCP'
+ );
+
+ foreach ($constants as $constant) {
+ if (defined($constant)) {
+ $this->_validFacilities[] = constant($constant);
+ }
+ }
+ }
+
+ /**
+ * Initialize syslog / set application name and facility
+ *
+ * @return void
+ */
+ protected function _initializeSyslog()
+ {
+ self::$_lastApplication = $this->_application;
+ self::$_lastFacility = $this->_facility;
+ openlog($this->_application, LOG_PID, $this->_facility);
+ }
+
+ /**
+ * Set syslog facility
+ *
+ * @param int $facility Syslog facility
+ * @return Zend_Log_Writer_Syslog
+ * @throws Zend_Log_Exception for invalid log facility
+ */
+ public function setFacility($facility)
+ {
+ if ($this->_facility === $facility) {
+ return $this;
+ }
+
+ if (!count($this->_validFacilities)) {
+ $this->_initializeValidFacilities();
+ }
+
+ if (!in_array($facility, $this->_validFacilities)) {
+ throw new Zend_Log_Exception('Invalid log facility provided; please see http://php.net/openlog for a list of valid facility values');
+ }
+
+ if ('WIN' == strtoupper(substr(PHP_OS, 0, 3))
+ && ($facility !== LOG_USER)
+ ) {
+ throw new Zend_Log_Exception('Only LOG_USER is a valid log facility on Windows');
+ }
+
+ $this->_facility = $facility;
+ $this->_initializeSyslog();
+ return $this;
+ }
+
+ /**
+ * Set application name
+ *
+ * @param string $application Application name
+ * @return Zend_Log_Writer_Syslog
+ */
+ public function setApplicationName($application)
+ {
+ if ($this->_application === $application) {
+ return $this;
+ }
+ $this->_application = $application;
+ $this->_initializeSyslog();
+ return $this;
+ }
+
+ /**
+ * Close syslog.
+ *
+ * @return void
+ */
+ public function shutdown()
+ {
+ closelog();
+ }
+
+ /**
+ * Write a message to syslog.
+ *
+ * @param array $event event data
+ * @return void
+ */
+ protected function _write($event)
+ {
+ if (array_key_exists($event['priority'], $this->_priorities)) {
+ $priority = $this->_priorities[$event['priority']];
+ } else {
+ $priority = $this->_defaultPriority;
+ }
+
+ if ($this->_application !== self::$_lastApplication
+ || $this->_facility !== self::$_lastFacility)
+ {
+ $this->_initializeSyslog();
+ }
+
+ $message = $event['message'];
+ if ($this->_formatter instanceof Zend_Log_Formatter_Interface) {
+ $message = $this->_formatter->format($event);
+ }
+
+ syslog($priority, $message);
+ }
+}
diff --git a/library/vendor/Zend/Log/Writer/ZendMonitor.php b/library/vendor/Zend/Log/Writer/ZendMonitor.php
new file mode 100644
index 0000000..b59db93
--- /dev/null
+++ b/library/vendor/Zend/Log/Writer/ZendMonitor.php
@@ -0,0 +1,130 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Writer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Log_Writer_Abstract */
+
+/**
+ * @category Zend
+ * @package Zend_Log
+ * @subpackage Writer
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Log_Writer_ZendMonitor extends Zend_Log_Writer_Abstract
+{
+ /**
+ * Is Zend Monitor enabled?
+ *
+ * @var boolean
+ */
+ protected $_isEnabled = true;
+
+ /**
+ * Is this for a Zend Server intance?
+ *
+ * @var boolean
+ */
+ protected $_isZendServer = false;
+
+ /**
+ * @return void
+ */
+ public function __construct()
+ {
+ if (!function_exists('monitor_custom_event')) {
+ $this->_isEnabled = false;
+ }
+ if (function_exists('zend_monitor_custom_event')) {
+ $this->_isZendServer = true;
+ }
+ }
+
+ /**
+ * Create a new instance of Zend_Log_Writer_ZendMonitor
+ *
+ * @param array|Zend_Config $config
+ * @return Zend_Log_Writer_ZendMonitor
+ */
+ static public function factory($config)
+ {
+ return new self();
+ }
+
+ /**
+ * Is logging to this writer enabled?
+ *
+ * If the Zend Monitor extension is not enabled, this log writer will
+ * fail silently. You can query this method to determine if the log
+ * writer is enabled.
+ *
+ * @return boolean
+ */
+ public function isEnabled()
+ {
+ return $this->_isEnabled;
+ }
+
+ /**
+ * Log a message to this writer.
+ *
+ * @param array $event log data event
+ * @return void
+ */
+ public function write($event)
+ {
+ if (!$this->isEnabled()) {
+ return;
+ }
+
+ parent::write($event);
+ }
+
+ /**
+ * Write a message to the log.
+ *
+ * @param array $event log data event
+ * @return void
+ */
+ protected function _write($event)
+ {
+ $priority = $event['priority'];
+ $message = $event['message'];
+ unset($event['priority'], $event['message']);
+
+ if (!empty($event)) {
+ if ($this->_isZendServer) {
+ // On Zend Server; third argument should be the event
+ zend_monitor_custom_event($priority, $message, $event);
+ } else {
+ // On Zend Platform; third argument is severity -- either
+ // 0 or 1 -- and fourth is optional (event)
+ // Severity is either 0 (normal) or 1 (severe); classifying
+ // notice, info, and debug as "normal", and all others as
+ // "severe"
+ monitor_custom_event($priority, $message, ($priority > 4) ? 0 : 1, $event);
+ }
+ } else {
+ monitor_custom_event($priority, $message);
+ }
+ }
+}
diff --git a/library/vendor/Zend/Mail.php b/library/vendor/Zend/Mail.php
new file mode 100644
index 0000000..8a1173c
--- /dev/null
+++ b/library/vendor/Zend/Mail.php
@@ -0,0 +1,1265 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Mail_Transport_Abstract
+ */
+
+/**
+ * @see Zend_Mime
+ */
+
+/**
+ * @see Zend_Mime_Message
+ */
+
+/**
+ * @see Zend_Mime_Part
+ */
+
+
+/**
+ * Class for sending an email.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail extends Zend_Mime_Message
+{
+ /**#@+
+ * @access protected
+ */
+
+ /**
+ * @var Zend_Mail_Transport_Abstract
+ * @static
+ */
+ protected static $_defaultTransport = null;
+
+ /**
+ * @var array
+ * @static
+ */
+ protected static $_defaultFrom;
+
+ /**
+ * @var array
+ * @static
+ */
+ protected static $_defaultReplyTo;
+
+ /**
+ * Mail character set
+ * @var string
+ */
+ protected $_charset = 'iso-8859-1';
+
+ /**
+ * Mail headers
+ * @var array
+ */
+ protected $_headers = array();
+
+ /**
+ * Encoding of Mail headers
+ * @var string
+ */
+ protected $_headerEncoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE;
+
+ /**
+ * From: address
+ * @var string
+ */
+ protected $_from = null;
+
+ /**
+ * To: addresses
+ * @var array
+ */
+ protected $_to = array();
+
+ /**
+ * Array of all recipients
+ * @var array
+ */
+ protected $_recipients = array();
+
+ /**
+ * Reply-To header
+ * @var string
+ */
+ protected $_replyTo = null;
+
+ /**
+ * Return-Path header
+ * @var string
+ */
+ protected $_returnPath = null;
+
+ /**
+ * Subject: header
+ * @var string
+ */
+ protected $_subject = null;
+
+ /**
+ * Date: header
+ * @var string
+ */
+ protected $_date = null;
+
+ /**
+ * Message-ID: header
+ * @var string
+ */
+ protected $_messageId = null;
+
+ /**
+ * text/plain MIME part
+ * @var false|Zend_Mime_Part
+ */
+ protected $_bodyText = false;
+
+ /**
+ * text/html MIME part
+ * @var false|Zend_Mime_Part
+ */
+ protected $_bodyHtml = false;
+
+ /**
+ * MIME boundary string
+ * @var string
+ */
+ protected $_mimeBoundary = null;
+
+ /**
+ * Content type of the message
+ * @var string
+ */
+ protected $_type = null;
+
+ /**#@-*/
+
+ /**
+ * Flag: whether or not email has attachments
+ * @var boolean
+ */
+ public $hasAttachments = false;
+
+
+ /**
+ * Sets the default mail transport for all following uses of
+ * Zend_Mail::send();
+ *
+ * @todo Allow passing a string to indicate the transport to load
+ * @todo Allow passing in optional options for the transport to load
+ * @param Zend_Mail_Transport_Abstract $transport
+ */
+ public static function setDefaultTransport(Zend_Mail_Transport_Abstract $transport)
+ {
+ self::$_defaultTransport = $transport;
+ }
+
+ /**
+ * Gets the default mail transport for all following uses of
+ * unittests
+ *
+ * @todo Allow passing a string to indicate the transport to load
+ * @todo Allow passing in optional options for the transport to load
+ */
+ public static function getDefaultTransport()
+ {
+ return self::$_defaultTransport;
+ }
+
+ /**
+ * Clear the default transport property
+ */
+ public static function clearDefaultTransport()
+ {
+ self::$_defaultTransport = null;
+ }
+
+ /**
+ * Public constructor
+ *
+ * @param string $charset
+ */
+ public function __construct($charset = null)
+ {
+ if ($charset != null) {
+ $this->_charset = $charset;
+ }
+ }
+
+ /**
+ * Return charset string
+ *
+ * @return string
+ */
+ public function getCharset()
+ {
+ return $this->_charset;
+ }
+
+ /**
+ * Set content type
+ *
+ * Should only be used for manually setting multipart content types.
+ *
+ * @param string $type Content type
+ * @return Zend_Mail Implements fluent interface
+ * @throws Zend_Mail_Exception for types not supported by Zend_Mime
+ */
+ public function setType($type)
+ {
+ $allowed = array(
+ Zend_Mime::MULTIPART_ALTERNATIVE,
+ Zend_Mime::MULTIPART_MIXED,
+ Zend_Mime::MULTIPART_RELATED,
+ );
+ if (!in_array($type, $allowed)) {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('Invalid content type "' . $type . '"');
+ }
+
+ $this->_type = $type;
+ return $this;
+ }
+
+ /**
+ * Get content type of the message
+ *
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->_type;
+ }
+
+ /**
+ * Set an arbitrary mime boundary for the message
+ *
+ * If not set, Zend_Mime will generate one.
+ *
+ * @param string $boundary
+ * @return Zend_Mail Provides fluent interface
+ */
+ public function setMimeBoundary($boundary)
+ {
+ $this->_mimeBoundary = $boundary;
+
+ return $this;
+ }
+
+ /**
+ * Return the boundary string used for the message
+ *
+ * @return string
+ */
+ public function getMimeBoundary()
+ {
+ return $this->_mimeBoundary;
+ }
+
+ /**
+ * Return encoding of mail headers
+ *
+ * @deprecated use {@link getHeaderEncoding()} instead
+ * @return string
+ */
+ public function getEncodingOfHeaders()
+ {
+ return $this->getHeaderEncoding();
+ }
+
+ /**
+ * Return the encoding of mail headers
+ *
+ * Either Zend_Mime::ENCODING_QUOTEDPRINTABLE or Zend_Mime::ENCODING_BASE64
+ *
+ * @return string
+ */
+ public function getHeaderEncoding()
+ {
+ return $this->_headerEncoding;
+ }
+
+ /**
+ * Set the encoding of mail headers
+ *
+ * @deprecated Use {@link setHeaderEncoding()} instead.
+ * @param string $encoding
+ * @return Zend_Mail
+ */
+ public function setEncodingOfHeaders($encoding)
+ {
+ return $this->setHeaderEncoding($encoding);
+ }
+
+ /**
+ * Set the encoding of mail headers
+ *
+ * @param string $encoding Zend_Mime::ENCODING_QUOTEDPRINTABLE or
+ * Zend_Mime::ENCODING_BASE64
+ * @return Zend_Mail Provides fluent interface
+ * @throws Zend_Mail_Exception
+ */
+ public function setHeaderEncoding($encoding)
+ {
+ $allowed = array(
+ Zend_Mime::ENCODING_BASE64,
+ Zend_Mime::ENCODING_QUOTEDPRINTABLE
+ );
+ if (!in_array($encoding, $allowed)) {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('Invalid encoding "' . $encoding . '"');
+ }
+ $this->_headerEncoding = $encoding;
+
+ return $this;
+ }
+
+ /**
+ * Sets the text body for the message.
+ *
+ * @param string $txt
+ * @param string $charset
+ * @param string $encoding
+ * @return Zend_Mail Provides fluent interface
+ */
+ public function setBodyText($txt, $charset = null, $encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE)
+ {
+ if ($charset === null) {
+ $charset = $this->_charset;
+ }
+
+ $mp = new Zend_Mime_Part($txt);
+ $mp->encoding = $encoding;
+ $mp->type = Zend_Mime::TYPE_TEXT;
+ $mp->disposition = Zend_Mime::DISPOSITION_INLINE;
+ $mp->charset = $charset;
+
+ $this->_bodyText = $mp;
+
+ return $this;
+ }
+
+ /**
+ * Return text body Zend_Mime_Part or string
+ *
+ * @param bool $textOnly Whether to return just the body text content or
+ * the MIME part; defaults to false, the MIME part
+ * @return false|Zend_Mime_Part|string
+ */
+ public function getBodyText($textOnly = false)
+ {
+ if ($textOnly && $this->_bodyText) {
+ $body = $this->_bodyText;
+ return $body->getContent();
+ }
+
+ return $this->_bodyText;
+ }
+
+ /**
+ * Sets the HTML body for the message
+ *
+ * @param string $html
+ * @param string $charset
+ * @param string $encoding
+ * @return Zend_Mail Provides fluent interface
+ */
+ public function setBodyHtml($html, $charset = null, $encoding = Zend_Mime::ENCODING_QUOTEDPRINTABLE)
+ {
+ if ($charset === null) {
+ $charset = $this->_charset;
+ }
+
+ $mp = new Zend_Mime_Part($html);
+ $mp->encoding = $encoding;
+ $mp->type = Zend_Mime::TYPE_HTML;
+ $mp->disposition = Zend_Mime::DISPOSITION_INLINE;
+ $mp->charset = $charset;
+
+ $this->_bodyHtml = $mp;
+
+ return $this;
+ }
+
+ /**
+ * Return Zend_Mime_Part representing body HTML
+ *
+ * @param bool $htmlOnly Whether to return the body HTML only, or the MIME part; defaults to false, the MIME part
+ * @return false|Zend_Mime_Part|string
+ */
+ public function getBodyHtml($htmlOnly = false)
+ {
+ if ($htmlOnly && $this->_bodyHtml) {
+ $body = $this->_bodyHtml;
+ return $body->getContent();
+ }
+
+ return $this->_bodyHtml;
+ }
+
+ /**
+ * Adds an existing attachment to the mail message
+ *
+ * @param Zend_Mime_Part $attachment
+ * @return Zend_Mail Provides fluent interface
+ */
+ public function addAttachment(Zend_Mime_Part $attachment)
+ {
+ $this->addPart($attachment);
+ $this->hasAttachments = true;
+
+ return $this;
+ }
+
+ /**
+ * Creates a Zend_Mime_Part attachment
+ *
+ * Attachment is automatically added to the mail object after creation. The
+ * attachment object is returned to allow for further manipulation.
+ *
+ * @param string $body
+ * @param string $mimeType
+ * @param string $disposition
+ * @param string $encoding
+ * @param string $filename OPTIONAL A filename for the attachment
+ * @return Zend_Mime_Part Newly created Zend_Mime_Part object (to allow
+ * advanced settings)
+ */
+ public function createAttachment($body,
+ $mimeType = Zend_Mime::TYPE_OCTETSTREAM,
+ $disposition = Zend_Mime::DISPOSITION_ATTACHMENT,
+ $encoding = Zend_Mime::ENCODING_BASE64,
+ $filename = null)
+ {
+
+ $mp = new Zend_Mime_Part($body);
+ $mp->encoding = $encoding;
+ $mp->type = $mimeType;
+ $mp->disposition = $disposition;
+ $mp->filename = $filename;
+
+ $this->addAttachment($mp);
+
+ return $mp;
+ }
+
+ /**
+ * Return a count of message parts
+ *
+ * @return integer
+ */
+ public function getPartCount()
+ {
+ return count($this->_parts);
+ }
+
+ /**
+ * Encode header fields
+ *
+ * Encodes header content according to RFC1522 if it contains non-printable
+ * characters.
+ *
+ * @param string $value
+ * @return string
+ */
+ protected function _encodeHeader($value)
+ {
+ if (Zend_Mime::isPrintable($value) === false) {
+ if ($this->getHeaderEncoding() === Zend_Mime::ENCODING_QUOTEDPRINTABLE) {
+ $value = Zend_Mime::encodeQuotedPrintableHeader($value, $this->getCharset(), Zend_Mime::LINELENGTH, Zend_Mime::LINEEND);
+ } else {
+ $value = Zend_Mime::encodeBase64Header($value, $this->getCharset(), Zend_Mime::LINELENGTH, Zend_Mime::LINEEND);
+ }
+ }
+
+ return $value;
+ }
+
+ /**
+ * Add a header to the message
+ *
+ * Adds a header to this message. If append is true and the header already
+ * exists, raises a flag indicating that the header should be appended.
+ *
+ * @param string $headerName
+ * @param string $value
+ * @param bool $append
+ */
+ protected function _storeHeader($headerName, $value, $append = false)
+ {
+ if (isset($this->_headers[$headerName])) {
+ $this->_headers[$headerName][] = $value;
+ } else {
+ $this->_headers[$headerName] = array($value);
+ }
+
+ if ($append) {
+ $this->_headers[$headerName]['append'] = true;
+ }
+
+ }
+
+ /**
+ * Clear header from the message
+ *
+ * @param string $headerName
+ * @deprecated use public method directly
+ */
+ protected function _clearHeader($headerName)
+ {
+ $this->clearHeader($headerName);
+ }
+
+ /**
+ * Helper function for adding a recipient and the corresponding header
+ *
+ * @param string $headerName
+ * @param string $email
+ * @param string $name
+ */
+ protected function _addRecipientAndHeader($headerName, $email, $name)
+ {
+ $email = $this->_filterEmail($email);
+ $name = $this->_filterName($name);
+ // prevent duplicates
+ $this->_recipients[$email] = 1;
+ $this->_storeHeader($headerName, $this->_formatAddress($email, $name), true);
+ }
+
+ /**
+ * Adds To-header and recipient, $email can be an array, or a single string
+ * address
+ *
+ * @param string|array $email
+ * @param string $name
+ * @return Zend_Mail Provides fluent interface
+ */
+ public function addTo($email, $name='')
+ {
+ if (!is_array($email)) {
+ $email = array($name => $email);
+ }
+
+ foreach ($email as $n => $recipient) {
+ $this->_addRecipientAndHeader('To', $recipient, is_int($n) ? '' : $n);
+ $this->_to[] = $recipient;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Adds Cc-header and recipient, $email can be an array, or a single string
+ * address
+ *
+ * @param string|array $email
+ * @param string $name
+ * @return Zend_Mail Provides fluent interface
+ */
+ public function addCc($email, $name='')
+ {
+ if (!is_array($email)) {
+ $email = array($name => $email);
+ }
+
+ foreach ($email as $n => $recipient) {
+ $this->_addRecipientAndHeader('Cc', $recipient, is_int($n) ? '' : $n);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Adds Bcc recipient, $email can be an array, or a single string address
+ *
+ * @param string|array $email
+ * @return Zend_Mail Provides fluent interface
+ */
+ public function addBcc($email)
+ {
+ if (!is_array($email)) {
+ $email = array($email);
+ }
+
+ foreach ($email as $recipient) {
+ $this->_addRecipientAndHeader('Bcc', $recipient, '');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Return list of recipient email addresses
+ *
+ * @return array (of strings)
+ */
+ public function getRecipients()
+ {
+ return array_keys($this->_recipients);
+ }
+
+ /**
+ * Clear header from the message
+ *
+ * @param string $headerName
+ * @return Zend_Mail Provides fluent inter
+ */
+ public function clearHeader($headerName)
+ {
+ if (isset($this->_headers[$headerName])){
+ unset($this->_headers[$headerName]);
+ }
+ return $this;
+ }
+
+ /**
+ * Clears list of recipient email addresses
+ *
+ * @return Zend_Mail Provides fluent interface
+ */
+ public function clearRecipients()
+ {
+ $this->_recipients = array();
+ $this->_to = array();
+
+ $this->clearHeader('To');
+ $this->clearHeader('Cc');
+ $this->clearHeader('Bcc');
+
+ return $this;
+ }
+
+ /**
+ * Sets From-header and sender of the message
+ *
+ * @param string $email
+ * @param string $name
+ * @return Zend_Mail Provides fluent interface
+ * @throws Zend_Mail_Exception if called subsequent times
+ */
+ public function setFrom($email, $name = null)
+ {
+ if (null !== $this->_from) {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('From Header set twice');
+ }
+
+ $email = $this->_filterEmail($email);
+ $name = $this->_filterName($name);
+ $this->_from = $email;
+ $this->_storeHeader('From', $this->_formatAddress($email, $name), true);
+
+ return $this;
+ }
+
+ /**
+ * Set Reply-To Header
+ *
+ * @param string $email
+ * @param string $name
+ * @return Zend_Mail
+ * @throws Zend_Mail_Exception if called more than one time
+ */
+ public function setReplyTo($email, $name = null)
+ {
+ if (null !== $this->_replyTo) {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('Reply-To Header set twice');
+ }
+
+ $email = $this->_filterEmail($email);
+ $name = $this->_filterName($name);
+ $this->_replyTo = $email;
+ $this->_storeHeader('Reply-To', $this->_formatAddress($email, $name), true);
+
+ return $this;
+ }
+
+ /**
+ * Returns the sender of the mail
+ *
+ * @return string
+ */
+ public function getFrom()
+ {
+ return $this->_from;
+ }
+
+ /**
+ * Returns the current Reply-To address of the message
+ *
+ * @return string|null Reply-To address, null when not set
+ */
+ public function getReplyTo()
+ {
+ return $this->_replyTo;
+ }
+
+ /**
+ * Clears the sender from the mail
+ *
+ * @return Zend_Mail Provides fluent interface
+ */
+ public function clearFrom()
+ {
+ $this->_from = null;
+ $this->clearHeader('From');
+
+ return $this;
+ }
+
+ /**
+ * Clears the current Reply-To address from the message
+ *
+ * @return Zend_Mail Provides fluent interface
+ */
+ public function clearReplyTo()
+ {
+ $this->_replyTo = null;
+ $this->clearHeader('Reply-To');
+
+ return $this;
+ }
+
+ /**
+ * Sets Default From-email and name of the message
+ *
+ * @param string $email
+ * @param string $name optional
+ * @return void
+ */
+ public static function setDefaultFrom($email, $name = null)
+ {
+ self::$_defaultFrom = array('email' => $email, 'name' => $name);
+ }
+
+ /**
+ * Returns the default sender of the mail
+ *
+ * @return null|array Null if none was set.
+ */
+ public static function getDefaultFrom()
+ {
+ return self::$_defaultFrom;
+ }
+
+ /**
+ * Clears the default sender from the mail
+ *
+ * @return void
+ */
+ public static function clearDefaultFrom()
+ {
+ self::$_defaultFrom = null;
+ }
+
+ /**
+ * Sets From-name and -email based on the defaults
+ *
+ * @return Zend_Mail Provides fluent interface
+ * @throws Zend_Mail_Exception
+ */
+ public function setFromToDefaultFrom() {
+ $from = self::getDefaultFrom();
+ if($from === null) {
+ throw new Zend_Mail_Exception(
+ 'No default From Address set to use');
+ }
+
+ $this->setFrom($from['email'], $from['name']);
+
+ return $this;
+ }
+
+ /**
+ * Sets Default ReplyTo-address and -name of the message
+ *
+ * @param string $email
+ * @param string $name optional
+ * @return void
+ */
+ public static function setDefaultReplyTo($email, $name = null)
+ {
+ self::$_defaultReplyTo = array('email' => $email, 'name' => $name);
+ }
+
+ /**
+ * Returns the default Reply-To Address and Name of the mail
+ *
+ * @return null|array Null if none was set.
+ */
+ public static function getDefaultReplyTo()
+ {
+ return self::$_defaultReplyTo;
+ }
+
+ /**
+ * Clears the default ReplyTo-address and -name from the mail
+ *
+ * @return void
+ */
+ public static function clearDefaultReplyTo()
+ {
+ self::$_defaultReplyTo = null;
+ }
+
+ /**
+ * Sets ReplyTo-name and -email based on the defaults
+ *
+ * @return Zend_Mail Provides fluent interface
+ * @throws Zend_Mail_Exception
+ */
+ public function setReplyToFromDefault() {
+ $replyTo = self::getDefaultReplyTo();
+ if($replyTo === null) {
+ throw new Zend_Mail_Exception(
+ 'No default Reply-To Address set to use');
+ }
+
+ $this->setReplyTo($replyTo['email'], $replyTo['name']);
+
+ return $this;
+ }
+
+ /**
+ * Sets the Return-Path header of the message
+ *
+ * @param string $email
+ * @return Zend_Mail Provides fluent interface
+ * @throws Zend_Mail_Exception if set multiple times
+ */
+ public function setReturnPath($email)
+ {
+ if ($this->_returnPath === null) {
+ $email = $this->_filterEmail($email);
+ $this->_returnPath = $email;
+ $this->_storeHeader('Return-Path', $email, false);
+ } else {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('Return-Path Header set twice');
+ }
+ return $this;
+ }
+
+ /**
+ * Returns the current Return-Path address of the message
+ *
+ * If no Return-Path header is set, returns the value of {@link $_from}.
+ *
+ * @return string
+ */
+ public function getReturnPath()
+ {
+ if (null !== $this->_returnPath) {
+ return $this->_returnPath;
+ }
+
+ return $this->_from;
+ }
+
+ /**
+ * Clears the current Return-Path address from the message
+ *
+ * @return Zend_Mail Provides fluent interface
+ */
+ public function clearReturnPath()
+ {
+ $this->_returnPath = null;
+ $this->clearHeader('Return-Path');
+
+ return $this;
+ }
+
+ /**
+ * Sets the subject of the message
+ *
+ * @param string $subject
+ * @return Zend_Mail Provides fluent interface
+ * @throws Zend_Mail_Exception
+ */
+ public function setSubject($subject)
+ {
+ if ($this->_subject === null) {
+ $subject = $this->_filterOther($subject);
+ $this->_subject = $this->_encodeHeader($subject);
+ $this->_storeHeader('Subject', $this->_subject);
+ } else {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('Subject set twice');
+ }
+ return $this;
+ }
+
+ /**
+ * Returns the encoded subject of the message
+ *
+ * @return string
+ */
+ public function getSubject()
+ {
+ return $this->_subject;
+ }
+
+ /**
+ * Clears the encoded subject from the message
+ *
+ * @return Zend_Mail Provides fluent interface
+ */
+ public function clearSubject()
+ {
+ $this->_subject = null;
+ $this->clearHeader('Subject');
+
+ return $this;
+ }
+
+ /**
+ * Sets Date-header
+ *
+ * @param int|string|Zend_Date $date
+ * @return Zend_Mail Provides fluent interface
+ * @throws Zend_Mail_Exception if called subsequent times or wrong date
+ * format.
+ */
+ public function setDate($date = null)
+ {
+ if ($this->_date === null) {
+ if ($date === null) {
+ $date = date('r');
+ } else if (is_int($date)) {
+ $date = date('r', $date);
+ } else if (is_string($date)) {
+ $date = strtotime($date);
+ if ($date === false || $date < 0) {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('String representations of Date Header must be ' .
+ 'strtotime()-compatible');
+ }
+ $date = date('r', $date);
+ } else if ($date instanceof Zend_Date) {
+ $date = $date->get(Zend_Date::RFC_2822);
+ } else {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception(__METHOD__ . ' only accepts UNIX timestamps, Zend_Date objects, ' .
+ ' and strtotime()-compatible strings');
+ }
+ $this->_date = $date;
+ $this->_storeHeader('Date', $date);
+ } else {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('Date Header set twice');
+ }
+ return $this;
+ }
+
+ /**
+ * Returns the formatted date of the message
+ *
+ * @return string
+ */
+ public function getDate()
+ {
+ return $this->_date;
+ }
+
+ /**
+ * Clears the formatted date from the message
+ *
+ * @return Zend_Mail Provides fluent interface
+ */
+ public function clearDate()
+ {
+ $this->_date = null;
+ $this->clearHeader('Date');
+
+ return $this;
+ }
+
+ /**
+ * Sets the Message-ID of the message
+ *
+ * @param boolean|string $id
+ * true :Auto
+ * false :No set
+ * null :No set
+ * string:Sets given string (Angle brackets is not necessary)
+ * @return Zend_Mail Provides fluent interface
+ * @throws Zend_Mail_Exception
+ */
+ public function setMessageId($id = true)
+ {
+ if ($id === null || $id === false) {
+ return $this;
+ } elseif ($id === true) {
+ $id = $this->createMessageId();
+ }
+
+ if ($this->_messageId === null) {
+ $id = $this->_filterOther($id);
+ $this->_messageId = $id;
+ $this->_storeHeader('Message-Id', '<' . $this->_messageId . '>');
+ } else {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('Message-ID set twice');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns the Message-ID of the message
+ *
+ * @return string
+ */
+ public function getMessageId()
+ {
+ return $this->_messageId;
+ }
+
+
+ /**
+ * Clears the Message-ID from the message
+ *
+ * @return Zend_Mail Provides fluent interface
+ */
+ public function clearMessageId()
+ {
+ $this->_messageId = null;
+ $this->clearHeader('Message-Id');
+
+ return $this;
+ }
+
+ /**
+ * Creates the Message-ID
+ *
+ * @return string
+ */
+ public function createMessageId() {
+
+ $time = time();
+
+ if ($this->_from !== null) {
+ $user = $this->_from;
+ } elseif (isset($_SERVER['REMOTE_ADDR'])) {
+ $user = $_SERVER['REMOTE_ADDR'];
+ } else {
+ $user = getmypid();
+ }
+
+ $rand = mt_rand();
+
+ if ($this->_recipients !== array()) {
+ $recipient = array_rand($this->_recipients);
+ } else {
+ $recipient = 'unknown';
+ }
+
+ if (isset($_SERVER["SERVER_NAME"])) {
+ $hostName = $_SERVER["SERVER_NAME"];
+ } else {
+ $hostName = php_uname('n');
+ }
+
+ return sha1($time . $user . $rand . $recipient) . '@' . $hostName;
+ }
+
+ /**
+ * Add a custom header to the message
+ *
+ * @param string $name
+ * @param string $value
+ * @param boolean $append
+ * @return Zend_Mail Provides fluent interface
+ * @throws Zend_Mail_Exception on attempts to create standard headers
+ */
+ public function addHeader($name, $value, $append = false)
+ {
+ $prohibit = array('to', 'cc', 'bcc', 'from', 'subject',
+ 'reply-to', 'return-path',
+ 'date', 'message-id',
+ );
+ if (in_array(strtolower($name), $prohibit)) {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('Cannot set standard header from addHeader()');
+ }
+
+ $value = $this->_filterOther($value);
+ $value = $this->_encodeHeader($value);
+ $this->_storeHeader($name, $value, $append);
+
+ return $this;
+ }
+
+ /**
+ * Return mail headers
+ *
+ * @return array
+ */
+ public function getHeaders()
+ {
+ return $this->_headers;
+ }
+
+ /**
+ * Sends this email using the given transport or a previously
+ * set DefaultTransport or the internal mail function if no
+ * default transport had been set.
+ *
+ * @param Zend_Mail_Transport_Abstract $transport
+ * @return Zend_Mail Provides fluent interface
+ */
+ public function send($transport = null)
+ {
+ if ($transport === null) {
+ if (! self::$_defaultTransport instanceof Zend_Mail_Transport_Abstract) {
+ $transport = new Zend_Mail_Transport_Sendmail();
+ } else {
+ $transport = self::$_defaultTransport;
+ }
+ }
+
+ if ($this->_date === null) {
+ $this->setDate();
+ }
+
+ if(null === $this->_from && null !== self::getDefaultFrom()) {
+ $this->setFromToDefaultFrom();
+ }
+
+ if(null === $this->_replyTo && null !== self::getDefaultReplyTo()) {
+ $this->setReplyToFromDefault();
+ }
+
+ $transport->send($this);
+
+ return $this;
+ }
+
+ /**
+ * Filter of email data
+ *
+ * @param string $email
+ * @return string
+ */
+ protected function _filterEmail($email)
+ {
+ $rule = array("\r" => '',
+ "\n" => '',
+ "\t" => '',
+ '"' => '',
+ ',' => '',
+ '<' => '',
+ '>' => '',
+ );
+
+ return strtr($email, $rule);
+ }
+
+ /**
+ * Filter of name data
+ *
+ * @param string $name
+ * @return string
+ */
+ protected function _filterName($name)
+ {
+ $rule = array("\r" => '',
+ "\n" => '',
+ "\t" => '',
+ '"' => "'",
+ '<' => '[',
+ '>' => ']',
+ );
+
+ return trim(strtr($name, $rule));
+ }
+
+ /**
+ * Filter of other data
+ *
+ * @param string $data
+ * @return string
+ */
+ protected function _filterOther($data)
+ {
+ $rule = array("\r" => '',
+ "\n" => '',
+ "\t" => '',
+ );
+
+ return strtr($data, $rule);
+ }
+
+ /**
+ * Formats e-mail address
+ *
+ * @param string $email
+ * @param string $name
+ * @return string
+ */
+ protected function _formatAddress($email, $name)
+ {
+ if ($name === '' || $name === null || $name === $email) {
+ return $email;
+ } else {
+ $encodedName = $this->_encodeHeader($name);
+ if ($encodedName === $name && strcspn($name, '()<>[]:;@\\,.') != strlen($name)) {
+ $format = '"%s" <%s>';
+ } else {
+ $format = '%s <%s>';
+ }
+ return sprintf($format, $encodedName, $email);
+ }
+ }
+
+}
diff --git a/library/vendor/Zend/Mail/Exception.php b/library/vendor/Zend/Mail/Exception.php
new file mode 100644
index 0000000..eeae2ab
--- /dev/null
+++ b/library/vendor/Zend/Mail/Exception.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Exception
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Exception extends Zend_Exception
+{}
+
diff --git a/library/vendor/Zend/Mail/Header/HeaderName.php b/library/vendor/Zend/Mail/Header/HeaderName.php
new file mode 100644
index 0000000..1284c3c
--- /dev/null
+++ b/library/vendor/Zend/Mail/Header/HeaderName.php
@@ -0,0 +1,91 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+final class Zend_Mail_Header_HeaderName
+{
+ /**
+ * No public constructor.
+ */
+ private function __construct()
+ {
+ }
+
+ /**
+ * Filter the header name according to RFC 2822
+ *
+ * @see http://www.rfc-base.org/txt/rfc-2822.txt (section 2.2)
+ * @param string $name
+ * @return string
+ */
+ public static function filter($name)
+ {
+ $result = '';
+ $tot = strlen($name);
+ for ($i = 0; $i < $tot; $i += 1) {
+ $ord = ord($name[$i]);
+ if ($ord > 32 && $ord < 127 && $ord !== 58) {
+ $result .= $name[$i];
+ }
+ }
+ return $result;
+ }
+
+ /**
+ * Determine if the header name contains any invalid characters.
+ *
+ * @param string $name
+ * @return bool
+ */
+ public static function isValid($name)
+ {
+ $tot = strlen($name);
+ for ($i = 0; $i < $tot; $i += 1) {
+ $ord = ord($name[$i]);
+ if ($ord < 33 || $ord > 126 || $ord === 58) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Assert that the header name is valid.
+ *
+ * Raises an exception if invalid.
+ *
+ * @param string $name
+ * @throws Exception\RuntimeException
+ * @return void
+ */
+ public static function assertValid($name)
+ {
+ if (! self::isValid($name)) {
+ throw new Zend_Mail_Exception('Invalid header name detected');
+ }
+ }
+}
diff --git a/library/vendor/Zend/Mail/Header/HeaderValue.php b/library/vendor/Zend/Mail/Header/HeaderValue.php
new file mode 100644
index 0000000..7828e8b
--- /dev/null
+++ b/library/vendor/Zend/Mail/Header/HeaderValue.php
@@ -0,0 +1,135 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+final class Zend_Mail_Header_HeaderValue
+{
+ /**
+ * No public constructor.
+ */
+ private function __construct()
+ {
+ }
+
+ /**
+ * Filter the header value according to RFC 2822
+ *
+ * @see http://www.rfc-base.org/txt/rfc-2822.txt (section 2.2)
+ * @param string $value
+ * @return string
+ */
+ public static function filter($value)
+ {
+ $result = '';
+ $tot = strlen($value);
+
+ // Filter for CR and LF characters, leaving CRLF + WSP sequences for
+ // Long Header Fields (section 2.2.3 of RFC 2822)
+ for ($i = 0; $i < $tot; $i += 1) {
+ $ord = ord($value[$i]);
+ if (($ord < 32 || $ord > 126)
+ && $ord !== 13
+ ) {
+ continue;
+ }
+
+ if ($ord === 13) {
+ if ($i + 2 >= $tot) {
+ continue;
+ }
+
+ $lf = ord($value[$i + 1]);
+ $sp = ord($value[$i + 2]);
+
+ if ($lf !== 10 || $sp !== 32) {
+ continue;
+ }
+
+ $result .= "\r\n ";
+ $i += 2;
+ continue;
+ }
+
+ $result .= $value[$i];
+ }
+
+ return $result;
+ }
+
+ /**
+ * Determine if the header value contains any invalid characters.
+ *
+ * @see http://www.rfc-base.org/txt/rfc-2822.txt (section 2.2)
+ * @param string $value
+ * @return bool
+ */
+ public static function isValid($value)
+ {
+ $tot = strlen($value);
+ for ($i = 0; $i < $tot; $i += 1) {
+ $ord = ord($value[$i]);
+ if (($ord < 32 || $ord > 126)
+ && $ord !== 13
+ ) {
+ return false;
+ }
+
+ if ($ord === 13) {
+ if ($i + 2 >= $tot) {
+ return false;
+ }
+
+ $lf = ord($value[$i + 1]);
+ $sp = ord($value[$i + 2]);
+
+ if ($lf !== 10 || $sp !== 32) {
+ return false;
+ }
+
+ $i += 2;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Assert that the header value is valid.
+ *
+ * Raises an exception if invalid.
+ *
+ * @param string $value
+ * @throws Exception\RuntimeException
+ * @return void
+ */
+ public static function assertValid($value)
+ {
+ if (! self::isValid($value)) {
+ throw new Zend_Mail_Exception('Invalid header value detected');
+ }
+ }
+}
diff --git a/library/vendor/Zend/Mail/Message.php b/library/vendor/Zend/Mail/Message.php
new file mode 100644
index 0000000..b9ac013
--- /dev/null
+++ b/library/vendor/Zend/Mail/Message.php
@@ -0,0 +1,110 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Zend_Mail_Part
+ */
+
+/**
+ * Zend_Mail_Message_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Message extends Zend_Mail_Part implements Zend_Mail_Message_Interface
+{
+ /**
+ * flags for this message
+ * @var array
+ */
+ protected $_flags = array();
+
+ /**
+ * Public constructor
+ *
+ * In addition to the parameters of Zend_Mail_Part::__construct() this constructor supports:
+ * - file filename or file handle of a file with raw message content
+ * - flags array with flags for message, keys are ignored, use constants defined in Zend_Mail_Storage
+ *
+ * @param string $rawMessage full message with or without headers
+ * @throws Zend_Mail_Exception
+ */
+ public function __construct(array $params)
+ {
+ if (isset($params['file'])) {
+ if (!is_resource($params['file'])) {
+ $params['raw'] = @file_get_contents($params['file']);
+ if ($params['raw'] === false) {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('could not open file');
+ }
+ } else {
+ $params['raw'] = stream_get_contents($params['file']);
+ }
+ $params['raw'] = preg_replace("/(?<!\r)\n/", "\r\n", $params['raw']);
+ }
+
+ if (!empty($params['flags'])) {
+ // set key and value to the same value for easy lookup
+ $this->_flags = array_merge($this->_flags, array_combine($params['flags'],$params['flags']));
+ }
+
+ parent::__construct($params);
+ }
+
+ /**
+ * return toplines as found after headers
+ *
+ * @return string toplines
+ */
+ public function getTopLines()
+ {
+ return $this->_topLines;
+ }
+
+ /**
+ * check if flag is set
+ *
+ * @param mixed $flag a flag name, use constants defined in Zend_Mail_Storage
+ * @return bool true if set, otherwise false
+ */
+ public function hasFlag($flag)
+ {
+ return isset($this->_flags[$flag]);
+ }
+
+ /**
+ * get all set flags
+ *
+ * @return array array with flags, key and value are the same for easy lookup
+ */
+ public function getFlags()
+ {
+ return $this->_flags;
+ }
+}
diff --git a/library/vendor/Zend/Mail/Message/File.php b/library/vendor/Zend/Mail/Message/File.php
new file mode 100644
index 0000000..f123092
--- /dev/null
+++ b/library/vendor/Zend/Mail/Message/File.php
@@ -0,0 +1,94 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Zend_Mail_Part
+ */
+
+/**
+ * Zend_Mail_Message_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Message_File extends Zend_Mail_Part_File implements Zend_Mail_Message_Interface
+{
+ /**
+ * flags for this message
+ * @var array
+ */
+ protected $_flags = array();
+
+ /**
+ * Public constructor
+ *
+ * In addition to the parameters of Zend_Mail_Part::__construct() this constructor supports:
+ * - flags array with flags for message, keys are ignored, use constants defined in Zend_Mail_Storage
+ *
+ * @param string $rawMessage full message with or without headers
+ * @throws Zend_Mail_Exception
+ */
+ public function __construct(array $params)
+ {
+ if (!empty($params['flags'])) {
+ // set key and value to the same value for easy lookup
+ $this->_flags = array_combine($params['flags'], $params['flags']);
+ }
+
+ parent::__construct($params);
+ }
+
+ /**
+ * return toplines as found after headers
+ *
+ * @return string toplines
+ */
+ public function getTopLines()
+ {
+ return $this->_topLines;
+ }
+
+ /**
+ * check if flag is set
+ *
+ * @param mixed $flag a flag name, use constants defined in Zend_Mail_Storage
+ * @return bool true if set, otherwise false
+ */
+ public function hasFlag($flag)
+ {
+ return isset($this->_flags[$flag]);
+ }
+
+ /**
+ * get all set flags
+ *
+ * @return array array with flags, key and value are the same for easy lookup
+ */
+ public function getFlags()
+ {
+ return $this->_flags;
+ }
+}
diff --git a/library/vendor/Zend/Mail/Message/Interface.php b/library/vendor/Zend/Mail/Message/Interface.php
new file mode 100644
index 0000000..dad7964
--- /dev/null
+++ b/library/vendor/Zend/Mail/Message/Interface.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+interface Zend_Mail_Message_Interface
+{
+ /**
+ * return toplines as found after headers
+ *
+ * @return string toplines
+ */
+ public function getTopLines();
+
+ /**
+ * check if flag is set
+ *
+ * @param mixed $flag a flag name, use constants defined in Zend_Mail_Storage
+ * @return bool true if set, otherwise false
+ */
+ public function hasFlag($flag);
+
+ /**
+ * get all set flags
+ *
+ * @return array array with flags, key and value are the same for easy lookup
+ */
+ public function getFlags();
+}
diff --git a/library/vendor/Zend/Mail/Part.php b/library/vendor/Zend/Mail/Part.php
new file mode 100644
index 0000000..060689b
--- /dev/null
+++ b/library/vendor/Zend/Mail/Part.php
@@ -0,0 +1,590 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Mime_Decode
+ */
+
+/**
+ * @see Zend_Mail_Header_HeaderName
+ */
+
+/**
+ * @see Zend_Mail_Header_HeaderValue
+ */
+
+/**
+ * @see Zend_Mail_Part_Interface
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Part implements RecursiveIterator, Zend_Mail_Part_Interface
+{
+ /**
+ * headers of part as array
+ * @var null|array
+ */
+ protected $_headers;
+
+ /**
+ * raw part body
+ * @var null|string
+ */
+ protected $_content;
+
+ /**
+ * toplines as fetched with headers
+ * @var string
+ */
+ protected $_topLines = '';
+
+ /**
+ * parts of multipart message
+ * @var array
+ */
+ protected $_parts = array();
+
+ /**
+ * count of parts of a multipart message
+ * @var null|int
+ */
+ protected $_countParts;
+
+ /**
+ * current position of iterator
+ * @var int
+ */
+ protected $_iterationPos = 1;
+
+ /**
+ * mail handler, if late fetch is active
+ * @var null|Zend_Mail_Storage_Abstract
+ */
+ protected $_mail;
+
+ /**
+ * message number for mail handler
+ * @var int
+ */
+ protected $_messageNum = 0;
+
+ /**
+ * Class to use when creating message parts
+ * @var string
+ */
+ protected $_partClass;
+
+ /**
+ * Public constructor
+ *
+ * Zend_Mail_Part supports different sources for content. The possible params are:
+ * - handler a instance of Zend_Mail_Storage_Abstract for late fetch
+ * - id number of message for handler
+ * - raw raw content with header and body as string
+ * - headers headers as array (name => value) or string, if a content part is found it's used as toplines
+ * - noToplines ignore content found after headers in param 'headers'
+ * - content content as string
+ *
+ * @param array $params full message with or without headers
+ * @throws Zend_Mail_Exception
+ */
+ public function __construct(array $params)
+ {
+ if (isset($params['handler'])) {
+ if (!$params['handler'] instanceof Zend_Mail_Storage_Abstract) {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('handler is not a valid mail handler');
+ }
+ if (!isset($params['id'])) {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('need a message id with a handler');
+ }
+
+ $this->_mail = $params['handler'];
+ $this->_messageNum = $params['id'];
+ }
+
+ if (isset($params['partclass'])) {
+ $this->setPartClass($params['partclass']);
+ }
+
+ if (isset($params['raw'])) {
+ Zend_Mime_Decode::splitMessage($params['raw'], $this->_headers, $this->_content, "\r\n");
+ } else if (isset($params['headers'])) {
+ if (is_array($params['headers'])) {
+ $this->_headers = $params['headers'];
+ $this->_validateHeaders($this->_headers);
+ } else {
+ if (!empty($params['noToplines'])) {
+ Zend_Mime_Decode::splitMessage($params['headers'], $this->_headers, $null, "\r\n");
+ } else {
+ Zend_Mime_Decode::splitMessage($params['headers'], $this->_headers, $this->_topLines, "\r\n");
+ }
+ }
+
+ if (isset($params['content'])) {
+ $this->_content = $params['content'];
+ }
+ }
+ }
+
+ /**
+ * Set name pf class used to encapsulate message parts
+ * @param string $class
+ * @return Zend_Mail_Part
+ */
+ public function setPartClass($class)
+ {
+ if ( !class_exists($class) ) {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception("Class '{$class}' does not exist");
+ }
+ if ( !is_subclass_of($class, 'Zend_Mail_Part_Interface') ) {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception("Class '{$class}' must implement Zend_Mail_Part_Interface");
+ }
+
+ $this->_partClass = $class;
+ return $this;
+ }
+
+ /**
+ * Retrieve the class name used to encapsulate message parts
+ * @return string
+ */
+ public function getPartClass()
+ {
+ if ( !$this->_partClass ) {
+ $this->_partClass = __CLASS__;
+ }
+ return $this->_partClass;
+ }
+
+ /**
+ * Check if part is a multipart message
+ *
+ * @return bool if part is multipart
+ */
+ public function isMultipart()
+ {
+ try {
+ return stripos($this->contentType, 'multipart/') === 0;
+ } catch(Zend_Mail_Exception $e) {
+ return false;
+ }
+ }
+
+
+ /**
+ * Body of part
+ *
+ * If part is multipart the raw content of this part with all sub parts is returned
+ *
+ * @return string body
+ * @throws Zend_Mail_Exception
+ */
+ public function getContent()
+ {
+ if ($this->_content !== null) {
+ return $this->_content;
+ }
+
+ if ($this->_mail) {
+ return $this->_mail->getRawContent($this->_messageNum);
+ } else {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('no content');
+ }
+ }
+
+ /**
+ * Return size of part
+ *
+ * Quite simple implemented currently (not decoding). Handle with care.
+ *
+ * @return int size
+ */
+ public function getSize() {
+ return strlen($this->getContent());
+ }
+
+
+ /**
+ * Cache content and split in parts if multipart
+ *
+ * @return null
+ * @throws Zend_Mail_Exception
+ */
+ protected function _cacheContent()
+ {
+ // caching content if we can't fetch parts
+ if ($this->_content === null && $this->_mail) {
+ $this->_content = $this->_mail->getRawContent($this->_messageNum);
+ }
+
+ if (!$this->isMultipart()) {
+ return;
+ }
+
+ // split content in parts
+ $boundary = $this->getHeaderField('content-type', 'boundary');
+ if (!$boundary) {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('no boundary found in content type to split message');
+ }
+ $parts = Zend_Mime_Decode::splitMessageStruct($this->_content, $boundary);
+ if ($parts === null) {
+ return;
+ }
+ $partClass = $this->getPartClass();
+ $counter = 1;
+ foreach ($parts as $part) {
+ $this->_parts[$counter++] = new $partClass(array('headers' => $part['header'], 'content' => $part['body']));
+ }
+ }
+
+ /**
+ * Get part of multipart message
+ *
+ * @param int $num number of part starting with 1 for first part
+ * @return Zend_Mail_Part wanted part
+ * @throws Zend_Mail_Exception
+ */
+ public function getPart($num)
+ {
+ if (isset($this->_parts[$num])) {
+ return $this->_parts[$num];
+ }
+
+ if (!$this->_mail && $this->_content === null) {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('part not found');
+ }
+
+ if ($this->_mail && $this->_mail->hasFetchPart) {
+ // TODO: fetch part
+ // return
+ }
+
+ $this->_cacheContent();
+
+ if (!isset($this->_parts[$num])) {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('part not found');
+ }
+
+ return $this->_parts[$num];
+ }
+
+ /**
+ * Count parts of a multipart part
+ *
+ * @return int number of sub-parts
+ */
+ public function countParts()
+ {
+ if ($this->_countParts) {
+ return $this->_countParts;
+ }
+
+ $this->_countParts = count($this->_parts);
+ if ($this->_countParts) {
+ return $this->_countParts;
+ }
+
+ if ($this->_mail && $this->_mail->hasFetchPart) {
+ // TODO: fetch part
+ // return
+ }
+
+ $this->_cacheContent();
+
+ $this->_countParts = count($this->_parts);
+ return $this->_countParts;
+ }
+
+
+ /**
+ * Get all headers
+ *
+ * The returned headers are as saved internally. All names are lowercased. The value is a string or an array
+ * if a header with the same name occurs more than once.
+ *
+ * @return array headers as array(name => value)
+ */
+ public function getHeaders()
+ {
+ if ($this->_headers === null) {
+ if (!$this->_mail) {
+ $this->_headers = array();
+ } else {
+ $part = $this->_mail->getRawHeader($this->_messageNum);
+ Zend_Mime_Decode::splitMessage($part, $this->_headers, $null);
+ }
+ }
+
+ return $this->_headers;
+ }
+
+ /**
+ * Get a header in specificed format
+ *
+ * Internally headers that occur more than once are saved as array, all other as string. If $format
+ * is set to string implode is used to concat the values (with Zend_Mime::LINEEND as delim).
+ *
+ * @param string $name name of header, matches case-insensitive, but camel-case is replaced with dashes
+ * @param string $format change type of return value to 'string' or 'array'
+ * @return string|array value of header in wanted or internal format
+ * @throws Zend_Mail_Exception
+ */
+ public function getHeader($name, $format = null)
+ {
+ if ($this->_headers === null) {
+ $this->getHeaders();
+ }
+
+ $lowerName = strtolower($name);
+
+ if ($this->headerExists($name) == false) {
+ $lowerName = strtolower(preg_replace('%([a-z])([A-Z])%', '\1-\2', $name));
+ if($this->headerExists($lowerName) == false) {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception("no Header with Name $name or $lowerName found");
+ }
+ }
+ $name = $lowerName;
+
+ $header = $this->_headers[$name];
+
+ switch ($format) {
+ case 'string':
+ if (is_array($header)) {
+ $header = implode(Zend_Mime::LINEEND, $header);
+ }
+ break;
+ case 'array':
+ $header = (array)$header;
+ default:
+ // do nothing
+ }
+
+ return $header;
+ }
+
+ /**
+ * Check wheater the Mail part has a specific header.
+ *
+ * @param string $name
+ * @return boolean
+ */
+ public function headerExists($name)
+ {
+ $name = strtolower($name);
+ if(isset($this->_headers[$name])) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Get a specific field from a header like content type or all fields as array
+ *
+ * If the header occurs more than once, only the value from the first header
+ * is returned.
+ *
+ * Throws a Zend_Mail_Exception if the requested header does not exist. If
+ * the specific header field does not exist, returns null.
+ *
+ * @param string $name name of header, like in getHeader()
+ * @param string $wantedPart the wanted part, default is first, if null an array with all parts is returned
+ * @param string $firstName key name for the first part
+ * @return string|array wanted part or all parts as array($firstName => firstPart, partname => value)
+ * @throws Zend_Exception, Zend_Mail_Exception
+ */
+ public function getHeaderField($name, $wantedPart = 0, $firstName = 0) {
+ return Zend_Mime_Decode::splitHeaderField(current($this->getHeader($name, 'array')), $wantedPart, $firstName);
+ }
+
+
+ /**
+ * Getter for mail headers - name is matched in lowercase
+ *
+ * This getter is short for Zend_Mail_Part::getHeader($name, 'string')
+ *
+ * @see Zend_Mail_Part::getHeader()
+ *
+ * @param string $name header name
+ * @return string value of header
+ * @throws Zend_Mail_Exception
+ */
+ public function __get($name)
+ {
+ return $this->getHeader($name, 'string');
+ }
+
+ /**
+ * Isset magic method proxy to hasHeader
+ *
+ * This method is short syntax for Zend_Mail_Part::hasHeader($name);
+ *
+ * @see Zend_Mail_Part::hasHeader
+ *
+ * @param string
+ * @return boolean
+ */
+ public function __isset($name)
+ {
+ return $this->headerExists($name);
+ }
+
+ /**
+ * magic method to get content of part
+ *
+ * @return string content
+ */
+ public function __toString()
+ {
+ return $this->getContent();
+ }
+
+ /**
+ * implements RecursiveIterator::hasChildren()
+ *
+ * @return bool current element has children/is multipart
+ */
+ public function hasChildren()
+ {
+ $current = $this->current();
+ return $current && $current instanceof Zend_Mail_Part && $current->isMultipart();
+ }
+
+ /**
+ * implements RecursiveIterator::getChildren()
+ *
+ * @return Zend_Mail_Part same as self::current()
+ */
+ public function getChildren()
+ {
+ return $this->current();
+ }
+
+ /**
+ * implements Iterator::valid()
+ *
+ * @return bool check if there's a current element
+ */
+ public function valid()
+ {
+ if ($this->_countParts === null) {
+ $this->countParts();
+ }
+ return $this->_iterationPos && $this->_iterationPos <= $this->_countParts;
+ }
+
+ /**
+ * implements Iterator::next()
+ *
+ * @return null
+ */
+ public function next()
+ {
+ ++$this->_iterationPos;
+ }
+
+ /**
+ * implements Iterator::key()
+ *
+ * @return string key/number of current part
+ */
+ public function key()
+ {
+ return $this->_iterationPos;
+ }
+
+ /**
+ * implements Iterator::current()
+ *
+ * @return Zend_Mail_Part current part
+ */
+ public function current()
+ {
+ return $this->getPart($this->_iterationPos);
+ }
+
+ /**
+ * implements Iterator::rewind()
+ *
+ * @return null
+ */
+ public function rewind()
+ {
+ $this->countParts();
+ $this->_iterationPos = 1;
+ }
+
+ /**
+ * Ensure headers do not contain invalid characters
+ *
+ * @param array $headers
+ * @param bool $assertNames
+ */
+ protected function _validateHeaders(array $headers, $assertNames = true)
+ {
+ foreach ($headers as $name => $value) {
+ if ($assertNames) {
+ Zend_Mail_Header_HeaderName::assertValid($name);
+ }
+
+ if (is_array($value)) {
+ $this->_validateHeaders($value, false);
+ continue;
+ }
+
+ Zend_Mail_Header_HeaderValue::assertValid($value);
+ }
+ }
+}
diff --git a/library/vendor/Zend/Mail/Part/File.php b/library/vendor/Zend/Mail/Part/File.php
new file mode 100644
index 0000000..da81b7d
--- /dev/null
+++ b/library/vendor/Zend/Mail/Part/File.php
@@ -0,0 +1,191 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Mime_Decode
+ */
+
+/**
+ * @see Zend_Mail_Part
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Part_File extends Zend_Mail_Part
+{
+ protected $_contentPos = array();
+ protected $_partPos = array();
+ protected $_fh;
+
+ /**
+ * Public constructor
+ *
+ * This handler supports the following params:
+ * - file filename or open file handler with message content (required)
+ * - startPos start position of message or part in file (default: current position)
+ * - endPos end position of message or part in file (default: end of file)
+ *
+ * @param array $params full message with or without headers
+ * @throws Zend_Mail_Exception
+ */
+ public function __construct(array $params)
+ {
+ if (empty($params['file'])) {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('no file given in params');
+ }
+
+ if (!is_resource($params['file'])) {
+ $this->_fh = fopen($params['file'], 'r');
+ } else {
+ $this->_fh = $params['file'];
+ }
+ if (!$this->_fh) {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('could not open file');
+ }
+ if (isset($params['startPos'])) {
+ fseek($this->_fh, $params['startPos']);
+ }
+ $header = '';
+ $endPos = isset($params['endPos']) ? $params['endPos'] : null;
+ while (($endPos === null || ftell($this->_fh) < $endPos) && trim($line = fgets($this->_fh))) {
+ $header .= $line;
+ }
+
+ Zend_Mime_Decode::splitMessage($header, $this->_headers, $null);
+
+ $this->_contentPos[0] = ftell($this->_fh);
+ if ($endPos !== null) {
+ $this->_contentPos[1] = $endPos;
+ } else {
+ fseek($this->_fh, 0, SEEK_END);
+ $this->_contentPos[1] = ftell($this->_fh);
+ }
+ if (!$this->isMultipart()) {
+ return;
+ }
+
+ $boundary = $this->getHeaderField('content-type', 'boundary');
+ if (!$boundary) {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('no boundary found in content type to split message');
+ }
+
+ $part = array();
+ $pos = $this->_contentPos[0];
+ fseek($this->_fh, $pos);
+ while (!feof($this->_fh) && ($endPos === null || $pos < $endPos)) {
+ $line = fgets($this->_fh);
+ if ($line === false) {
+ if (feof($this->_fh)) {
+ break;
+ }
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('error reading file');
+ }
+
+ $lastPos = $pos;
+ $pos = ftell($this->_fh);
+ $line = trim($line);
+
+ if ($line == '--' . $boundary) {
+ if ($part) {
+ // not first part
+ $part[1] = $lastPos;
+ $this->_partPos[] = $part;
+ }
+ $part = array($pos);
+ } else if ($line == '--' . $boundary . '--') {
+ $part[1] = $lastPos;
+ $this->_partPos[] = $part;
+ break;
+ }
+ }
+ $this->_countParts = count($this->_partPos);
+
+ }
+
+
+ /**
+ * Body of part
+ *
+ * If part is multipart the raw content of this part with all sub parts is returned
+ *
+ * @return string body
+ * @throws Zend_Mail_Exception
+ */
+ public function getContent($stream = null)
+ {
+ fseek($this->_fh, $this->_contentPos[0]);
+ if ($stream !== null) {
+ return stream_copy_to_stream($this->_fh, $stream, $this->_contentPos[1] - $this->_contentPos[0]);
+ }
+ $length = $this->_contentPos[1] - $this->_contentPos[0];
+ return $length < 1 ? '' : fread($this->_fh, $length);
+ }
+
+ /**
+ * Return size of part
+ *
+ * Quite simple implemented currently (not decoding). Handle with care.
+ *
+ * @return int size
+ */
+ public function getSize() {
+ return $this->_contentPos[1] - $this->_contentPos[0];
+ }
+
+ /**
+ * Get part of multipart message
+ *
+ * @param int $num number of part starting with 1 for first part
+ * @return Zend_Mail_Part wanted part
+ * @throws Zend_Mail_Exception
+ */
+ public function getPart($num)
+ {
+ --$num;
+ if (!isset($this->_partPos[$num])) {
+ /**
+ * @see Zend_Mail_Exception
+ */
+ throw new Zend_Mail_Exception('part not found');
+ }
+
+ return new self(array('file' => $this->_fh, 'startPos' => $this->_partPos[$num][0],
+ 'endPos' => $this->_partPos[$num][1]));
+ }
+}
diff --git a/library/vendor/Zend/Mail/Part/Interface.php b/library/vendor/Zend/Mail/Part/Interface.php
new file mode 100644
index 0000000..0d9275d
--- /dev/null
+++ b/library/vendor/Zend/Mail/Part/Interface.php
@@ -0,0 +1,136 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+interface Zend_Mail_Part_Interface extends RecursiveIterator
+{
+ /**
+ * Check if part is a multipart message
+ *
+ * @return bool if part is multipart
+ */
+ public function isMultipart();
+
+
+ /**
+ * Body of part
+ *
+ * If part is multipart the raw content of this part with all sub parts is returned
+ *
+ * @return string body
+ * @throws Zend_Mail_Exception
+ */
+ public function getContent();
+
+ /**
+ * Return size of part
+ *
+ * @return int size
+ */
+ public function getSize();
+
+ /**
+ * Get part of multipart message
+ *
+ * @param int $num number of part starting with 1 for first part
+ * @return Zend_Mail_Part wanted part
+ * @throws Zend_Mail_Exception
+ */
+ public function getPart($num);
+
+ /**
+ * Count parts of a multipart part
+ *
+ * @return int number of sub-parts
+ */
+ public function countParts();
+
+
+ /**
+ * Get all headers
+ *
+ * The returned headers are as saved internally. All names are lowercased. The value is a string or an array
+ * if a header with the same name occurs more than once.
+ *
+ * @return array headers as array(name => value)
+ */
+ public function getHeaders();
+
+ /**
+ * Get a header in specificed format
+ *
+ * Internally headers that occur more than once are saved as array, all other as string. If $format
+ * is set to string implode is used to concat the values (with Zend_Mime::LINEEND as delim).
+ *
+ * @param string $name name of header, matches case-insensitive, but camel-case is replaced with dashes
+ * @param string $format change type of return value to 'string' or 'array'
+ * @return string|array value of header in wanted or internal format
+ * @throws Zend_Mail_Exception
+ */
+ public function getHeader($name, $format = null);
+
+ /**
+ * Get a specific field from a header like content type or all fields as array
+ *
+ * If the header occurs more than once, only the value from the first header
+ * is returned.
+ *
+ * Throws a Zend_Mail_Exception if the requested header does not exist. If
+ * the specific header field does not exist, returns null.
+ *
+ * @param string $name name of header, like in getHeader()
+ * @param string $wantedPart the wanted part, default is first, if null an array with all parts is returned
+ * @param string $firstName key name for the first part
+ * @return string|array wanted part or all parts as array($firstName => firstPart, partname => value)
+ * @throws Zend_Exception, Zend_Mail_Exception
+ */
+ public function getHeaderField($name, $wantedPart = 0, $firstName = 0);
+
+
+ /**
+ * Getter for mail headers - name is matched in lowercase
+ *
+ * This getter is short for Zend_Mail_Part::getHeader($name, 'string')
+ *
+ * @see Zend_Mail_Part::getHeader()
+ *
+ * @param string $name header name
+ * @return string value of header
+ * @throws Zend_Mail_Exception
+ */
+ public function __get($name);
+
+ /**
+ * magic method to get content of part
+ *
+ * @return string content
+ */
+ public function __toString();
+}
diff --git a/library/vendor/Zend/Mail/Protocol/Abstract.php b/library/vendor/Zend/Mail/Protocol/Abstract.php
new file mode 100644
index 0000000..57c5999
--- /dev/null
+++ b/library/vendor/Zend/Mail/Protocol/Abstract.php
@@ -0,0 +1,436 @@
+<?php
+
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Protocol
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Validate
+ */
+
+
+/**
+ * @see Zend_Validate_Hostname
+ */
+
+
+/**
+ * Zend_Mail_Protocol_Abstract
+ *
+ * Provides low-level methods for concrete adapters to communicate with a remote mail server and track requests and responses.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Protocol
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ * @todo Implement proxy settings
+ */
+abstract class Zend_Mail_Protocol_Abstract
+{
+ /**
+ * Mail default EOL string
+ */
+ const EOL = "\r\n";
+
+
+ /**
+ * Default timeout in seconds for initiating session
+ */
+ const TIMEOUT_CONNECTION = 30;
+
+ /**
+ * Maximum of the transaction log
+ * @var integer
+ */
+ protected $_maximumLog = 64;
+
+
+ /**
+ * Hostname or IP address of remote server
+ * @var string
+ */
+ protected $_host;
+
+
+ /**
+ * Port number of connection
+ * @var integer
+ */
+ protected $_port;
+
+
+ /**
+ * Instance of Zend_Validate to check hostnames
+ * @var Zend_Validate
+ */
+ protected $_validHost;
+
+
+ /**
+ * Socket connection resource
+ * @var resource
+ */
+ protected $_socket;
+
+
+ /**
+ * Last request sent to server
+ * @var string
+ */
+ protected $_request;
+
+
+ /**
+ * Array of server responses to last request
+ * @var array
+ */
+ protected $_response;
+
+
+ /**
+ * String template for parsing server responses using sscanf (default: 3 digit code and response string)
+ * @var resource
+ * @deprecated Since 1.10.3
+ */
+ protected $_template = '%d%s';
+
+
+ /**
+ * Log of mail requests and server responses for a session
+ * @var array
+ */
+ private $_log = array();
+
+
+ /**
+ * Constructor.
+ *
+ * @param string $host OPTIONAL Hostname of remote connection (default: 127.0.0.1)
+ * @param integer $port OPTIONAL Port number (default: null)
+ * @throws Zend_Mail_Protocol_Exception
+ * @return void
+ */
+ public function __construct($host = '127.0.0.1', $port = null)
+ {
+ $this->_validHost = new Zend_Validate();
+ $this->_validHost->addValidator(new Zend_Validate_Hostname(Zend_Validate_Hostname::ALLOW_ALL));
+
+ if (!$this->_validHost->isValid($host)) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception(join(', ', $this->_validHost->getMessages()));
+ }
+
+ $this->_host = $host;
+ $this->_port = $port;
+ }
+
+
+ /**
+ * Class destructor to cleanup open resources
+ *
+ * @return void
+ */
+ public function __destruct()
+ {
+ $this->_disconnect();
+ }
+
+ /**
+ * Set the maximum log size
+ *
+ * @param integer $maximumLog Maximum log size
+ * @return void
+ */
+ public function setMaximumLog($maximumLog)
+ {
+ $this->_maximumLog = (int) $maximumLog;
+ }
+
+
+ /**
+ * Get the maximum log size
+ *
+ * @return int the maximum log size
+ */
+ public function getMaximumLog()
+ {
+ return $this->_maximumLog;
+ }
+
+
+ /**
+ * Create a connection to the remote host
+ *
+ * Concrete adapters for this class will implement their own unique connect scripts, using the _connect() method to create the socket resource.
+ */
+ abstract public function connect();
+
+
+ /**
+ * Retrieve the last client request
+ *
+ * @return string
+ */
+ public function getRequest()
+ {
+ return $this->_request;
+ }
+
+
+ /**
+ * Retrieve the last server response
+ *
+ * @return array
+ */
+ public function getResponse()
+ {
+ return $this->_response;
+ }
+
+
+ /**
+ * Retrieve the transaction log
+ *
+ * @return string
+ */
+ public function getLog()
+ {
+ return implode('', $this->_log);
+ }
+
+
+ /**
+ * Reset the transaction log
+ *
+ * @return void
+ */
+ public function resetLog()
+ {
+ $this->_log = array();
+ }
+
+ /**
+ * Add the transaction log
+ *
+ * @param string new transaction
+ * @return void
+ */
+ protected function _addLog($value)
+ {
+ if ($this->_maximumLog >= 0 && count($this->_log) >= $this->_maximumLog) {
+ array_shift($this->_log);
+ }
+
+ $this->_log[] = $value;
+ }
+
+ /**
+ * Connect to the server using the supplied transport and target
+ *
+ * An example $remote string may be 'tcp://mail.example.com:25' or 'ssh://hostname.com:2222'
+ *
+ * @param string $remote Remote
+ * @throws Zend_Mail_Protocol_Exception
+ * @return boolean
+ */
+ protected function _connect($remote)
+ {
+ $errorNum = 0;
+ $errorStr = '';
+
+ // open connection
+ $this->_socket = @stream_socket_client($remote, $errorNum, $errorStr, self::TIMEOUT_CONNECTION);
+
+ if ($this->_socket === false) {
+ if ($errorNum == 0) {
+ $errorStr = 'Could not open socket';
+ }
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception($errorStr);
+ }
+
+ if (($result = $this->_setStreamTimeout(self::TIMEOUT_CONNECTION)) === false) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('Could not set stream timeout');
+ }
+
+ return $result;
+ }
+
+
+ /**
+ * Disconnect from remote host and free resource
+ *
+ * @return void
+ */
+ protected function _disconnect()
+ {
+ if (is_resource($this->_socket)) {
+ fclose($this->_socket);
+ }
+ }
+
+
+ /**
+ * Send the given request followed by a LINEEND to the server.
+ *
+ * @param string $request
+ * @throws Zend_Mail_Protocol_Exception
+ * @return integer|boolean Number of bytes written to remote host
+ */
+ protected function _send($request)
+ {
+ if (!is_resource($this->_socket)) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('No connection has been established to ' . $this->_host);
+ }
+
+ $this->_request = $request;
+
+ $result = fwrite($this->_socket, $request . self::EOL);
+
+ // Save request to internal log
+ $this->_addLog($request . self::EOL);
+
+ if ($result === false) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('Could not send request to ' . $this->_host);
+ }
+
+ return $result;
+ }
+
+
+ /**
+ * Get a line from the stream.
+ *
+ * @var integer $timeout Per-request timeout value if applicable
+ * @throws Zend_Mail_Protocol_Exception
+ * @return string
+ */
+ protected function _receive($timeout = null)
+ {
+ if (!is_resource($this->_socket)) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('No connection has been established to ' . $this->_host);
+ }
+
+ // Adapters may wish to supply per-commend timeouts according to appropriate RFC
+ if ($timeout !== null) {
+ $this->_setStreamTimeout($timeout);
+ }
+
+ // Retrieve response
+ $reponse = fgets($this->_socket, 1024);
+
+ // Save request to internal log
+ $this->_addLog($reponse);
+
+ // Check meta data to ensure connection is still valid
+ $info = stream_get_meta_data($this->_socket);
+
+ if (!empty($info['timed_out'])) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception($this->_host . ' has timed out');
+ }
+
+ if ($reponse === false) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('Could not read from ' . $this->_host);
+ }
+
+ return $reponse;
+ }
+
+
+ /**
+ * Parse server response for successful codes
+ *
+ * Read the response from the stream and check for expected return code.
+ * Throws a Zend_Mail_Protocol_Exception if an unexpected code is returned.
+ *
+ * @param string|array $code One or more codes that indicate a successful response
+ * @throws Zend_Mail_Protocol_Exception
+ * @return string Last line of response string
+ */
+ protected function _expect($code, $timeout = null)
+ {
+ $this->_response = array();
+ $cmd = '';
+ $more = '';
+ $msg = '';
+ $errMsg = '';
+
+ if (!is_array($code)) {
+ $code = array($code);
+ }
+
+ do {
+ $this->_response[] = $result = $this->_receive($timeout);
+ list($cmd, $more, $msg) = preg_split('/([\s-]+)/', $result, 2, PREG_SPLIT_DELIM_CAPTURE);
+
+ if ($errMsg !== '') {
+ $errMsg .= ' ' . $msg;
+ } elseif ($cmd === null || !in_array($cmd, $code)) {
+ $errMsg = $msg;
+ }
+
+ } while (strpos($more, '-') === 0); // The '-' message prefix indicates an information string instead of a response string.
+
+ if ($errMsg !== '') {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception($errMsg, $cmd);
+ }
+
+ return $msg;
+ }
+
+ /**
+ * Set stream timeout
+ *
+ * @param integer $timeout
+ * @return boolean
+ */
+ protected function _setStreamTimeout($timeout)
+ {
+ return stream_set_timeout($this->_socket, $timeout);
+ }
+}
diff --git a/library/vendor/Zend/Mail/Protocol/Exception.php b/library/vendor/Zend/Mail/Protocol/Exception.php
new file mode 100644
index 0000000..c7f565d
--- /dev/null
+++ b/library/vendor/Zend/Mail/Protocol/Exception.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Protocol
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Exception
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Protocol
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Protocol_Exception extends Zend_Mail_Exception
+{}
+
diff --git a/library/vendor/Zend/Mail/Protocol/Imap.php b/library/vendor/Zend/Mail/Protocol/Imap.php
new file mode 100644
index 0000000..067e04f
--- /dev/null
+++ b/library/vendor/Zend/Mail/Protocol/Imap.php
@@ -0,0 +1,830 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Protocol
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Protocol
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Protocol_Imap
+{
+ /**
+ * Default timeout in seconds for initiating session
+ */
+ const TIMEOUT_CONNECTION = 30;
+
+ /**
+ * socket to imap server
+ * @var resource|null
+ */
+ protected $_socket;
+
+ /**
+ * counter for request tag
+ * @var int
+ */
+ protected $_tagCount = 0;
+
+ /**
+ * Public constructor
+ *
+ * @param string $host hostname or IP address of IMAP server, if given connect() is called
+ * @param int|null $port port of IMAP server, null for default (143 or 993 for ssl)
+ * @param bool $ssl use ssl? 'SSL', 'TLS' or false
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ function __construct($host = '', $port = null, $ssl = false)
+ {
+ if ($host) {
+ $this->connect($host, $port, $ssl);
+ }
+ }
+
+ /**
+ * Public destructor
+ */
+ public function __destruct()
+ {
+ $this->logout();
+ }
+
+ /**
+ * Open connection to IMAP server
+ *
+ * @param string $host hostname or IP address of IMAP server
+ * @param int|null $port of IMAP server, default is 143 (993 for ssl)
+ * @param string|bool $ssl use 'SSL', 'TLS' or false
+ * @return string welcome message
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function connect($host, $port = null, $ssl = false)
+ {
+ if ($ssl == 'SSL') {
+ $host = 'ssl://' . $host;
+ }
+
+ if ($port === null) {
+ $port = $ssl === 'SSL' ? 993 : 143;
+ }
+
+ $errno = 0;
+ $errstr = '';
+ $this->_socket = @fsockopen($host, $port, $errno, $errstr, self::TIMEOUT_CONNECTION);
+ if (!$this->_socket) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('cannot connect to host; error = ' . $errstr .
+ ' (errno = ' . $errno . ' )');
+ }
+
+ if (!$this->_assumedNextLine('* OK')) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('host doesn\'t allow connection');
+ }
+
+ if ($ssl === 'TLS') {
+ $result = $this->requestAndResponse('STARTTLS');
+ $result = $result && stream_socket_enable_crypto($this->_socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
+ if (!$result) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('cannot enable TLS');
+ }
+ }
+ }
+
+ /**
+ * get the next line from socket with error checking, but nothing else
+ *
+ * @return string next line
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ protected function _nextLine()
+ {
+ $line = @fgets($this->_socket);
+ if ($line === false) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('cannot read - connection closed?');
+ }
+
+ return $line;
+ }
+
+ /**
+ * get next line and assume it starts with $start. some requests give a simple
+ * feedback so we can quickly check if we can go on.
+ *
+ * @param string $start the first bytes we assume to be in the next line
+ * @return bool line starts with $start
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ protected function _assumedNextLine($start)
+ {
+ $line = $this->_nextLine();
+ return strpos($line, $start) === 0;
+ }
+
+ /**
+ * get next line and split the tag. that's the normal case for a response line
+ *
+ * @param string $tag tag of line is returned by reference
+ * @return string next line
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ protected function _nextTaggedLine(&$tag)
+ {
+ $line = $this->_nextLine();
+
+ // seperate tag from line
+ list($tag, $line) = explode(' ', $line, 2);
+
+ return $line;
+ }
+
+ /**
+ * split a given line in tokens. a token is literal of any form or a list
+ *
+ * @param string $line line to decode
+ * @return array tokens, literals are returned as string, lists as array
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ protected function _decodeLine($line)
+ {
+ $tokens = array();
+ $stack = array();
+
+ /*
+ We start to decode the response here. The unterstood tokens are:
+ literal
+ "literal" or also "lit\\er\"al"
+ {bytes}<NL>literal
+ (literals*)
+ All tokens are returned in an array. Literals in braces (the last unterstood
+ token in the list) are returned as an array of tokens. I.e. the following response:
+ "foo" baz {3}<NL>bar ("f\\\"oo" bar)
+ would be returned as:
+ array('foo', 'baz', 'bar', array('f\\\"oo', 'bar'));
+
+ // TODO: add handling of '[' and ']' to parser for easier handling of response text
+ */
+ // replace any trailling <NL> including spaces with a single space
+ $line = rtrim($line) . ' ';
+ while (($pos = strpos($line, ' ')) !== false) {
+ $token = substr($line, 0, $pos);
+ while ($token[0] == '(') {
+ array_push($stack, $tokens);
+ $tokens = array();
+ $token = substr($token, 1);
+ }
+ if ($token[0] == '"') {
+ if (preg_match('%^\(*"((.|\\\\|\\")*?)" *%', $line, $matches)) {
+ $tokens[] = $matches[1];
+ $line = substr($line, strlen($matches[0]));
+ continue;
+ }
+ }
+ if ($token[0] == '{') {
+ $endPos = strpos($token, '}');
+ $chars = substr($token, 1, $endPos - 1);
+ if (is_numeric($chars)) {
+ $token = '';
+ while (strlen($token) < $chars) {
+ $token .= $this->_nextLine();
+ }
+ $line = '';
+ if (strlen($token) > $chars) {
+ $line = substr($token, $chars);
+ $token = substr($token, 0, $chars);
+ } else {
+ $line .= $this->_nextLine();
+ }
+ $tokens[] = $token;
+ $line = trim($line) . ' ';
+ continue;
+ }
+ }
+ if ($stack && $token[strlen($token) - 1] == ')') {
+ // closing braces are not seperated by spaces, so we need to count them
+ $braces = strlen($token);
+ $token = rtrim($token, ')');
+ // only count braces if more than one
+ $braces -= strlen($token) + 1;
+ // only add if token had more than just closing braces
+ if (rtrim($token) != '') {
+ $tokens[] = rtrim($token);
+ }
+ $token = $tokens;
+ $tokens = array_pop($stack);
+ // special handline if more than one closing brace
+ while ($braces-- > 0) {
+ $tokens[] = $token;
+ $token = $tokens;
+ $tokens = array_pop($stack);
+ }
+ }
+ $tokens[] = $token;
+ $line = substr($line, $pos + 1);
+ }
+
+ // maybe the server forgot to send some closing braces
+ while ($stack) {
+ $child = $tokens;
+ $tokens = array_pop($stack);
+ $tokens[] = $child;
+ }
+
+ return $tokens;
+ }
+
+ /**
+ * read a response "line" (could also be more than one real line if response has {..}<NL>)
+ * and do a simple decode
+ *
+ * @param array|string $tokens decoded tokens are returned by reference, if $dontParse
+ * is true the unparsed line is returned here
+ * @param string $wantedTag check for this tag for response code. Default '*' is
+ * continuation tag.
+ * @param bool $dontParse if true only the unparsed line is returned $tokens
+ * @return bool if returned tag matches wanted tag
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function readLine(&$tokens = array(), $wantedTag = '*', $dontParse = false)
+ {
+ $line = $this->_nextTaggedLine($tag);
+ if (!$dontParse) {
+ $tokens = $this->_decodeLine($line);
+ } else {
+ $tokens = $line;
+ }
+
+ // if tag is wanted tag we might be at the end of a multiline response
+ return $tag == $wantedTag;
+ }
+
+ /**
+ * read all lines of response until given tag is found (last line of response)
+ *
+ * @param string $tag the tag of your request
+ * @param string|array $filter you can filter the response so you get only the
+ * given response lines
+ * @param bool $dontParse if true every line is returned unparsed instead of
+ * the decoded tokens
+ * @return null|bool|array tokens if success, false if error, null if bad request
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function readResponse($tag, $dontParse = false)
+ {
+ $lines = array();
+ while (!$this->readLine($tokens, $tag, $dontParse)) {
+ $lines[] = $tokens;
+ }
+
+ if ($dontParse) {
+ // last to chars are still needed for response code
+ $tokens = array(substr($tokens, 0, 2));
+ }
+ // last line has response code
+ if ($tokens[0] == 'OK') {
+ return $lines ? $lines : true;
+ } else if ($tokens[0] == 'NO'){
+ return false;
+ }
+ return null;
+ }
+
+ /**
+ * send a request
+ *
+ * @param string $command your request command
+ * @param array $tokens additional parameters to command, use escapeString() to prepare
+ * @param string $tag provide a tag otherwise an autogenerated is returned
+ * @return null
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function sendRequest($command, $tokens = array(), &$tag = null)
+ {
+ if (!$tag) {
+ ++$this->_tagCount;
+ $tag = 'TAG' . $this->_tagCount;
+ }
+
+ $line = $tag . ' ' . $command;
+
+ foreach ($tokens as $token) {
+ if (is_array($token)) {
+ if (@fputs($this->_socket, $line . ' ' . $token[0] . "\r\n") === false) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('cannot write - connection closed?');
+ }
+ if (!$this->_assumedNextLine('+ ')) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('cannot send literal string');
+ }
+ $line = $token[1];
+ } else {
+ $line .= ' ' . $token;
+ }
+ }
+
+ if (@fputs($this->_socket, $line . "\r\n") === false) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('cannot write - connection closed?');
+ }
+ }
+
+ /**
+ * send a request and get response at once
+ *
+ * @param string $command command as in sendRequest()
+ * @param array $tokens parameters as in sendRequest()
+ * @param bool $dontParse if true unparsed lines are returned instead of tokens
+ * @return mixed response as in readResponse()
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function requestAndResponse($command, $tokens = array(), $dontParse = false)
+ {
+ $this->sendRequest($command, $tokens, $tag);
+ $response = $this->readResponse($tag, $dontParse);
+
+ return $response;
+ }
+
+ /**
+ * escape one or more literals i.e. for sendRequest
+ *
+ * @param string|array $string the literal/-s
+ * @return string|array escape literals, literals with newline ar returned
+ * as array('{size}', 'string');
+ */
+ public function escapeString($string)
+ {
+ if (func_num_args() < 2) {
+ if (strpos($string, "\n") !== false) {
+ return array('{' . strlen($string) . '}', $string);
+ } else {
+ return '"' . str_replace(array('\\', '"'), array('\\\\', '\\"'), $string) . '"';
+ }
+ }
+ $result = array();
+ foreach (func_get_args() as $string) {
+ $result[] = $this->escapeString($string);
+ }
+ return $result;
+ }
+
+ /**
+ * escape a list with literals or lists
+ *
+ * @param array $list list with literals or lists as PHP array
+ * @return string escaped list for imap
+ */
+ public function escapeList($list)
+ {
+ $result = array();
+ foreach ($list as $k => $v) {
+ if (!is_array($v)) {
+// $result[] = $this->escapeString($v);
+ $result[] = $v;
+ continue;
+ }
+ $result[] = $this->escapeList($v);
+ }
+ return '(' . implode(' ', $result) . ')';
+ }
+
+ /**
+ * Login to IMAP server.
+ *
+ * @param string $user username
+ * @param string $password password
+ * @return bool success
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function login($user, $password)
+ {
+ return $this->requestAndResponse('LOGIN', $this->escapeString($user, $password), true);
+ }
+
+ /**
+ * logout of imap server
+ *
+ * @return bool success
+ */
+ public function logout()
+ {
+ $result = false;
+ if ($this->_socket) {
+ try {
+ $result = $this->requestAndResponse('LOGOUT', array(), true);
+ } catch (Zend_Mail_Protocol_Exception $e) {
+ // ignoring exception
+ }
+ fclose($this->_socket);
+ $this->_socket = null;
+ }
+ return $result;
+ }
+
+
+ /**
+ * Get capabilities from IMAP server
+ *
+ * @return array list of capabilities
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function capability()
+ {
+ $response = $this->requestAndResponse('CAPABILITY');
+
+ if (!$response) {
+ return $response;
+ }
+
+ $capabilities = array();
+ foreach ($response as $line) {
+ $capabilities = array_merge($capabilities, $line);
+ }
+ return $capabilities;
+ }
+
+ /**
+ * Examine and select have the same response. The common code for both
+ * is in this method
+ *
+ * @param string $command can be 'EXAMINE' or 'SELECT' and this is used as command
+ * @param string $box which folder to change to or examine
+ * @return bool|array false if error, array with returned information
+ * otherwise (flags, exists, recent, uidvalidity)
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function examineOrSelect($command = 'EXAMINE', $box = 'INBOX')
+ {
+ $this->sendRequest($command, array($this->escapeString($box)), $tag);
+
+ $result = array();
+ while (!$this->readLine($tokens, $tag)) {
+ if ($tokens[0] == 'FLAGS') {
+ array_shift($tokens);
+ $result['flags'] = $tokens;
+ continue;
+ }
+ switch ($tokens[1]) {
+ case 'EXISTS':
+ case 'RECENT':
+ $result[strtolower($tokens[1])] = $tokens[0];
+ break;
+ case '[UIDVALIDITY':
+ $result['uidvalidity'] = (int)$tokens[2];
+ break;
+ default:
+ // ignore
+ }
+ }
+
+ if ($tokens[0] != 'OK') {
+ return false;
+ }
+ return $result;
+ }
+
+ /**
+ * change folder
+ *
+ * @param string $box change to this folder
+ * @return bool|array see examineOrselect()
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function select($box = 'INBOX')
+ {
+ return $this->examineOrSelect('SELECT', $box);
+ }
+
+ /**
+ * examine folder
+ *
+ * @param string $box examine this folder
+ * @return bool|array see examineOrselect()
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function examine($box = 'INBOX')
+ {
+ return $this->examineOrSelect('EXAMINE', $box);
+ }
+
+ /**
+ * fetch one or more items of one or more messages
+ *
+ * @param string|array $items items to fetch from message(s) as string (if only one item)
+ * or array of strings
+ * @param int $from message for items or start message if $to !== null
+ * @param int|null $to if null only one message ($from) is fetched, else it's the
+ * last message, INF means last message avaible
+ * @return string|array if only one item of one message is fetched it's returned as string
+ * if items of one message are fetched it's returned as (name => value)
+ * if one items of messages are fetched it's returned as (msgno => value)
+ * if items of messages are fetchted it's returned as (msgno => (name => value))
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function fetch($items, $from, $to = null)
+ {
+ if (is_array($from)) {
+ $set = implode(',', $from);
+ } else if ($to === null) {
+ $set = (int)$from;
+ } else if ($to === INF) {
+ $set = (int)$from . ':*';
+ } else {
+ $set = (int)$from . ':' . (int)$to;
+ }
+
+ $items = (array)$items;
+ $itemList = $this->escapeList($items);
+
+ $this->sendRequest('FETCH', array($set, $itemList), $tag);
+
+ $result = array();
+ while (!$this->readLine($tokens, $tag)) {
+ // ignore other responses
+ if ($tokens[1] != 'FETCH') {
+ continue;
+ }
+ // ignore other messages
+ if ($to === null && !is_array($from) && $tokens[0] != $from) {
+ continue;
+ }
+ // if we only want one item we return that one directly
+ if (count($items) == 1) {
+ if ($tokens[2][0] == $items[0]) {
+ $data = $tokens[2][1];
+ } else {
+ // maybe the server send an other field we didn't wanted
+ $count = count($tokens[2]);
+ // we start with 2, because 0 was already checked
+ for ($i = 2; $i < $count; $i += 2) {
+ if ($tokens[2][$i] != $items[0]) {
+ continue;
+ }
+ $data = $tokens[2][$i + 1];
+ break;
+ }
+ }
+ } else {
+ $data = array();
+ while (key($tokens[2]) !== null) {
+ $data[current($tokens[2])] = next($tokens[2]);
+ next($tokens[2]);
+ }
+ }
+ // if we want only one message we can ignore everything else and just return
+ if ($to === null && !is_array($from) && $tokens[0] == $from) {
+ // we still need to read all lines
+ while (!$this->readLine($tokens, $tag));
+ return $data;
+ }
+ $result[$tokens[0]] = $data;
+ }
+
+ if ($to === null && !is_array($from)) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('the single id was not found in response');
+ }
+
+ return $result;
+ }
+
+ /**
+ * get mailbox list
+ *
+ * this method can't be named after the IMAP command 'LIST', as list is a reserved keyword
+ *
+ * @param string $reference mailbox reference for list
+ * @param string $mailbox mailbox name match with wildcards
+ * @return array mailboxes that matched $mailbox as array(globalName => array('delim' => .., 'flags' => ..))
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function listMailbox($reference = '', $mailbox = '*')
+ {
+ $result = array();
+ $list = $this->requestAndResponse('LIST', $this->escapeString($reference, $mailbox));
+ if (!$list || $list === true) {
+ return $result;
+ }
+
+ foreach ($list as $item) {
+ if (count($item) != 4 || $item[0] != 'LIST') {
+ continue;
+ }
+ $result[$item[3]] = array('delim' => $item[2], 'flags' => $item[1]);
+ }
+
+ return $result;
+ }
+
+ /**
+ * set flags
+ *
+ * @param array $flags flags to set, add or remove - see $mode
+ * @param int $from message for items or start message if $to !== null
+ * @param int|null $to if null only one message ($from) is fetched, else it's the
+ * last message, INF means last message avaible
+ * @param string|null $mode '+' to add flags, '-' to remove flags, everything else sets the flags as given
+ * @param bool $silent if false the return values are the new flags for the wanted messages
+ * @return bool|array new flags if $silent is false, else true or false depending on success
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function store(array $flags, $from, $to = null, $mode = null, $silent = true)
+ {
+ $item = 'FLAGS';
+ if ($mode == '+' || $mode == '-') {
+ $item = $mode . $item;
+ }
+ if ($silent) {
+ $item .= '.SILENT';
+ }
+
+ $flags = $this->escapeList($flags);
+ $set = (int)$from;
+ if ($to != null) {
+ $set .= ':' . ($to == INF ? '*' : (int)$to);
+ }
+
+ $result = $this->requestAndResponse('STORE', array($set, $item, $flags), $silent);
+
+ if ($silent) {
+ return $result ? true : false;
+ }
+
+ $tokens = $result;
+ $result = array();
+ foreach ($tokens as $token) {
+ if ($token[1] != 'FETCH' || $token[2][0] != 'FLAGS') {
+ continue;
+ }
+ $result[$token[0]] = $token[2][1];
+ }
+
+ return $result;
+ }
+
+ /**
+ * append a new message to given folder
+ *
+ * @param string $folder name of target folder
+ * @param string $message full message content
+ * @param array $flags flags for new message
+ * @param string $date date for new message
+ * @return bool success
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function append($folder, $message, $flags = null, $date = null)
+ {
+ $tokens = array();
+ $tokens[] = $this->escapeString($folder);
+ if ($flags !== null) {
+ $tokens[] = $this->escapeList($flags);
+ }
+ if ($date !== null) {
+ $tokens[] = $this->escapeString($date);
+ }
+ $tokens[] = $this->escapeString($message);
+
+ return $this->requestAndResponse('APPEND', $tokens, true);
+ }
+
+ /**
+ * copy message set from current folder to other folder
+ *
+ * @param string $folder destination folder
+ * @param int|null $to if null only one message ($from) is fetched, else it's the
+ * last message, INF means last message avaible
+ * @return bool success
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function copy($folder, $from, $to = null)
+ {
+ $set = (int)$from;
+ if ($to != null) {
+ $set .= ':' . ($to == INF ? '*' : (int)$to);
+ }
+
+ return $this->requestAndResponse('COPY', array($set, $this->escapeString($folder)), true);
+ }
+
+ /**
+ * create a new folder (and parent folders if needed)
+ *
+ * @param string $folder folder name
+ * @return bool success
+ */
+ public function create($folder)
+ {
+ return $this->requestAndResponse('CREATE', array($this->escapeString($folder)), true);
+ }
+
+ /**
+ * rename an existing folder
+ *
+ * @param string $old old name
+ * @param string $new new name
+ * @return bool success
+ */
+ public function rename($old, $new)
+ {
+ return $this->requestAndResponse('RENAME', $this->escapeString($old, $new), true);
+ }
+
+ /**
+ * remove a folder
+ *
+ * @param string $folder folder name
+ * @return bool success
+ */
+ public function delete($folder)
+ {
+ return $this->requestAndResponse('DELETE', array($this->escapeString($folder)), true);
+ }
+
+ /**
+ * permanently remove messages
+ *
+ * @return bool success
+ */
+ public function expunge()
+ {
+ // TODO: parse response?
+ return $this->requestAndResponse('EXPUNGE');
+ }
+
+ /**
+ * send noop
+ *
+ * @return bool success
+ */
+ public function noop()
+ {
+ // TODO: parse response
+ return $this->requestAndResponse('NOOP');
+ }
+
+ /**
+ * do a search request
+ *
+ * This method is currently marked as internal as the API might change and is not
+ * safe if you don't take precautions.
+ *
+ * @internal
+ * @return array message ids
+ */
+ public function search(array $params)
+ {
+ $response = $this->requestAndResponse('SEARCH', $params);
+ if (!$response) {
+ return $response;
+ }
+
+ foreach ($response as $ids) {
+ if ($ids[0] == 'SEARCH') {
+ array_shift($ids);
+ return $ids;
+ }
+ }
+ return array();
+ }
+
+}
diff --git a/library/vendor/Zend/Mail/Protocol/Pop3.php b/library/vendor/Zend/Mail/Protocol/Pop3.php
new file mode 100644
index 0000000..d6c6e26
--- /dev/null
+++ b/library/vendor/Zend/Mail/Protocol/Pop3.php
@@ -0,0 +1,466 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Protocol
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Protocol
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Protocol_Pop3
+{
+ /**
+ * Default timeout in seconds for initiating session
+ */
+ const TIMEOUT_CONNECTION = 30;
+
+ /**
+ * saves if server supports top
+ * @var null|bool
+ */
+ public $hasTop = null;
+
+ /**
+ * socket to pop3
+ * @var null|resource
+ */
+ protected $_socket;
+
+ /**
+ * greeting timestamp for apop
+ * @var null|string
+ */
+ protected $_timestamp;
+
+
+ /**
+ * Public constructor
+ *
+ * @param string $host hostname or IP address of POP3 server, if given connect() is called
+ * @param int|null $port port of POP3 server, null for default (110 or 995 for ssl)
+ * @param bool|string $ssl use ssl? 'SSL', 'TLS' or false
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function __construct($host = '', $port = null, $ssl = false)
+ {
+ if ($host) {
+ $this->connect($host, $port, $ssl);
+ }
+ }
+
+
+ /**
+ * Public destructor
+ */
+ public function __destruct()
+ {
+ $this->logout();
+ }
+
+
+ /**
+ * Open connection to POP3 server
+ *
+ * @param string $host hostname or IP address of POP3 server
+ * @param int|null $port of POP3 server, default is 110 (995 for ssl)
+ * @param string|bool $ssl use 'SSL', 'TLS' or false
+ * @return string welcome message
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function connect($host, $port = null, $ssl = false)
+ {
+ if ($ssl == 'SSL') {
+ $host = 'ssl://' . $host;
+ }
+
+ if ($port === null) {
+ $port = $ssl == 'SSL' ? 995 : 110;
+ }
+
+ $errno = 0;
+ $errstr = '';
+ $this->_socket = @fsockopen($host, $port, $errno, $errstr, self::TIMEOUT_CONNECTION);
+ if (!$this->_socket) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('cannot connect to host; error = ' . $errstr .
+ ' (errno = ' . $errno . ' )');
+ }
+
+ $welcome = $this->readResponse();
+
+ strtok($welcome, '<');
+ $this->_timestamp = strtok('>');
+ if (!strpos($this->_timestamp, '@')) {
+ $this->_timestamp = null;
+ } else {
+ $this->_timestamp = '<' . $this->_timestamp . '>';
+ }
+
+ if ($ssl === 'TLS') {
+ $this->request('STLS');
+ $result = stream_socket_enable_crypto($this->_socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT);
+ if (!$result) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('cannot enable TLS');
+ }
+ }
+
+ return $welcome;
+ }
+
+
+ /**
+ * Send a request
+ *
+ * @param string $request your request without newline
+ * @return null
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function sendRequest($request)
+ {
+ $result = @fputs($this->_socket, $request . "\r\n");
+ if (!$result) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('send failed - connection closed?');
+ }
+ }
+
+
+ /**
+ * read a response
+ *
+ * @param boolean $multiline response has multiple lines and should be read until "<nl>.<nl>"
+ * @return string response
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function readResponse($multiline = false)
+ {
+ $result = @fgets($this->_socket);
+ if (!is_string($result)) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('read failed - connection closed?');
+ }
+
+ $result = trim($result);
+ if (strpos($result, ' ')) {
+ list($status, $message) = explode(' ', $result, 2);
+ } else {
+ $status = $result;
+ $message = '';
+ }
+
+ if ($status != '+OK') {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('last request failed');
+ }
+
+ if ($multiline) {
+ $message = '';
+ $line = fgets($this->_socket);
+ while ($line && rtrim($line, "\r\n") != '.') {
+ if ($line[0] == '.') {
+ $line = substr($line, 1);
+ }
+ $message .= $line;
+ $line = fgets($this->_socket);
+ };
+ }
+
+ return $message;
+ }
+
+
+ /**
+ * Send request and get resposne
+ *
+ * @see sendRequest(), readResponse()
+ *
+ * @param string $request request
+ * @param bool $multiline multiline response?
+ * @return string result from readResponse()
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function request($request, $multiline = false)
+ {
+ $this->sendRequest($request);
+ return $this->readResponse($multiline);
+ }
+
+
+ /**
+ * End communication with POP3 server (also closes socket)
+ *
+ * @return null
+ */
+ public function logout()
+ {
+ if (!$this->_socket) {
+ return;
+ }
+
+ try {
+ $this->request('QUIT');
+ } catch (Zend_Mail_Protocol_Exception $e) {
+ // ignore error - we're closing the socket anyway
+ }
+
+ fclose($this->_socket);
+ $this->_socket = null;
+ }
+
+
+ /**
+ * Get capabilities from POP3 server
+ *
+ * @return array list of capabilities
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function capa()
+ {
+ $result = $this->request('CAPA', true);
+ return explode("\n", $result);
+ }
+
+
+ /**
+ * Login to POP3 server. Can use APOP
+ *
+ * @param string $user username
+ * @param string $password password
+ * @param bool $try_apop should APOP be tried?
+ * @return void
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function login($user, $password, $tryApop = true)
+ {
+ if ($tryApop && $this->_timestamp) {
+ try {
+ $this->request("APOP $user " . md5($this->_timestamp . $password));
+ return;
+ } catch (Zend_Mail_Protocol_Exception $e) {
+ // ignore
+ }
+ }
+
+ $result = $this->request("USER $user");
+ $result = $this->request("PASS $password");
+ }
+
+
+ /**
+ * Make STAT call for message count and size sum
+ *
+ * @param int $messages out parameter with count of messages
+ * @param int $octets out parameter with size in octects of messages
+ * @return void
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function status(&$messages, &$octets)
+ {
+ $messages = 0;
+ $octets = 0;
+ $result = $this->request('STAT');
+
+ list($messages, $octets) = explode(' ', $result);
+ }
+
+
+ /**
+ * Make LIST call for size of message(s)
+ *
+ * @param int|null $msgno number of message, null for all
+ * @return int|array size of given message or list with array(num => size)
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function getList($msgno = null)
+ {
+ if ($msgno !== null) {
+ $result = $this->request("LIST $msgno");
+
+ list(, $result) = explode(' ', $result);
+ return (int)$result;
+ }
+
+ $result = $this->request('LIST', true);
+ $messages = array();
+ $line = strtok($result, "\n");
+ while ($line) {
+ list($no, $size) = explode(' ', trim($line));
+ $messages[(int)$no] = (int)$size;
+ $line = strtok("\n");
+ }
+
+ return $messages;
+ }
+
+
+ /**
+ * Make UIDL call for getting a uniqueid
+ *
+ * @param int|null $msgno number of message, null for all
+ * @return string|array uniqueid of message or list with array(num => uniqueid)
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function uniqueid($msgno = null)
+ {
+ if ($msgno !== null) {
+ $result = $this->request("UIDL $msgno");
+
+ list(, $result) = explode(' ', $result);
+ return $result;
+ }
+
+ $result = $this->request('UIDL', true);
+
+ $result = explode("\n", $result);
+ $messages = array();
+ foreach ($result as $line) {
+ if (!$line) {
+ continue;
+ }
+ list($no, $id) = explode(' ', trim($line), 2);
+ $messages[(int)$no] = $id;
+ }
+
+ return $messages;
+
+ }
+
+
+ /**
+ * Make TOP call for getting headers and maybe some body lines
+ * This method also sets hasTop - before it it's not known if top is supported
+ *
+ * The fallback makes normale RETR call, which retrieves the whole message. Additional
+ * lines are not removed.
+ *
+ * @param int $msgno number of message
+ * @param int $lines number of wanted body lines (empty line is inserted after header lines)
+ * @param bool $fallback fallback with full retrieve if top is not supported
+ * @return string message headers with wanted body lines
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function top($msgno, $lines = 0, $fallback = false)
+ {
+ if ($this->hasTop === false) {
+ if ($fallback) {
+ return $this->retrieve($msgno);
+ } else {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('top not supported and no fallback wanted');
+ }
+ }
+ $this->hasTop = true;
+
+ $lines = (!$lines || $lines < 1) ? 0 : (int)$lines;
+
+ try {
+ $result = $this->request("TOP $msgno $lines", true);
+ } catch (Zend_Mail_Protocol_Exception $e) {
+ $this->hasTop = false;
+ if ($fallback) {
+ $result = $this->retrieve($msgno);
+ } else {
+ throw $e;
+ }
+ }
+
+ return $result;
+ }
+
+
+ /**
+ * Make a RETR call for retrieving a full message with headers and body
+ *
+ * @deprecated since 1.1.0; this method has a typo - please use retrieve()
+ * @param int $msgno message number
+ * @return string message
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function retrive($msgno)
+ {
+ return $this->retrieve($msgno);
+ }
+
+
+ /**
+ * Make a RETR call for retrieving a full message with headers and body
+ *
+ * @param int $msgno message number
+ * @return string message
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function retrieve($msgno)
+ {
+ $result = $this->request("RETR $msgno", true);
+ return $result;
+ }
+
+ /**
+ * Make a NOOP call, maybe needed for keeping the server happy
+ *
+ * @return null
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function noop()
+ {
+ $this->request('NOOP');
+ }
+
+
+ /**
+ * Make a DELE count to remove a message
+ *
+ * @return null
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function delete($msgno)
+ {
+ $this->request("DELE $msgno");
+ }
+
+
+ /**
+ * Make RSET call, which rollbacks delete requests
+ *
+ * @return null
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function undelete()
+ {
+ $this->request('RSET');
+ }
+}
diff --git a/library/vendor/Zend/Mail/Protocol/Smtp.php b/library/vendor/Zend/Mail/Protocol/Smtp.php
new file mode 100644
index 0000000..403ae82
--- /dev/null
+++ b/library/vendor/Zend/Mail/Protocol/Smtp.php
@@ -0,0 +1,433 @@
+<?php
+
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Protocol
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Mime
+ */
+
+
+/**
+ * @see Zend_Mail_Protocol_Abstract
+ */
+
+
+/**
+ * Smtp implementation of Zend_Mail_Protocol_Abstract
+ *
+ * Minimum implementation according to RFC2821: EHLO, MAIL FROM, RCPT TO, DATA, RSET, NOOP, QUIT
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Protocol
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Protocol_Smtp extends Zend_Mail_Protocol_Abstract
+{
+ /**
+ * The transport method for the socket
+ *
+ * @var string
+ */
+ protected $_transport = 'tcp';
+
+
+ /**
+ * Indicates that a session is requested to be secure
+ *
+ * @var string
+ */
+ protected $_secure;
+
+
+ /**
+ * Indicates an smtp session has been started by the HELO command
+ *
+ * @var boolean
+ */
+ protected $_sess = false;
+
+
+ /**
+ * Indicates the HELO command has been issues
+ *
+ * @var unknown_type
+ */
+ protected $_helo = false;
+
+
+ /**
+ * Indicates an smtp AUTH has been issued and authenticated
+ *
+ * @var unknown_type
+ */
+ protected $_auth = false;
+
+
+ /**
+ * Indicates a MAIL command has been issued
+ *
+ * @var unknown_type
+ */
+ protected $_mail = false;
+
+
+ /**
+ * Indicates one or more RCTP commands have been issued
+ *
+ * @var unknown_type
+ */
+ protected $_rcpt = false;
+
+
+ /**
+ * Indicates that DATA has been issued and sent
+ *
+ * @var unknown_type
+ */
+ protected $_data = null;
+
+
+ /**
+ * Constructor.
+ *
+ * @param string $host
+ * @param integer $port
+ * @param array $config
+ * @return void
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function __construct($host = '127.0.0.1', $port = null, array $config = array())
+ {
+ if (isset($config['ssl'])) {
+ switch (strtolower($config['ssl'])) {
+ case 'tls':
+ $this->_secure = 'tls';
+ break;
+
+ case 'ssl':
+ $this->_transport = 'ssl';
+ $this->_secure = 'ssl';
+ if ($port == null) {
+ $port = 465;
+ }
+ break;
+
+ default:
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception($config['ssl'] . ' is unsupported SSL type');
+ break;
+ }
+ }
+
+ // If no port has been specified then check the master PHP ini file. Defaults to 25 if the ini setting is null.
+ if ($port == null) {
+ if (($port = ini_get('smtp_port')) == '') {
+ $port = 25;
+ }
+ }
+
+ parent::__construct($host, $port);
+ }
+
+
+ /**
+ * Connect to the server with the parameters given in the constructor.
+ *
+ * @return boolean
+ */
+ public function connect()
+ {
+ return $this->_connect($this->_transport . '://' . $this->_host . ':'. $this->_port);
+ }
+
+
+ /**
+ * Initiate HELO/EHLO sequence and set flag to indicate valid smtp session
+ *
+ * @param string $host The client hostname or IP address (default: 127.0.0.1)
+ * @throws Zend_Mail_Protocol_Exception
+ * @return void
+ */
+ public function helo($host = '127.0.0.1')
+ {
+ // Respect RFC 2821 and disallow HELO attempts if session is already initiated.
+ if ($this->_sess === true) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('Cannot issue HELO to existing session');
+ }
+
+ // Validate client hostname
+ if (!$this->_validHost->isValid($host)) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception(join(', ', $this->_validHost->getMessages()));
+ }
+
+ // Initiate helo sequence
+ $this->_expect(220, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2
+ $this->_ehlo($host);
+
+ // If a TLS session is required, commence negotiation
+ if ($this->_secure == 'tls') {
+ $this->_send('STARTTLS');
+ $this->_expect(220, 180);
+ if (!stream_socket_enable_crypto($this->_socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('Unable to connect via TLS');
+ }
+ $this->_ehlo($host);
+ }
+
+ $this->_startSession();
+ $this->auth();
+ }
+
+
+ /**
+ * Send EHLO or HELO depending on capabilities of smtp host
+ *
+ * @param string $host The client hostname or IP address (default: 127.0.0.1)
+ * @throws Zend_Mail_Protocol_Exception
+ * @return void
+ */
+ protected function _ehlo($host)
+ {
+ // Support for older, less-compliant remote servers. Tries multiple attempts of EHLO or HELO.
+ try {
+ $this->_send('EHLO ' . $host);
+ $this->_expect(250, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2
+ } catch (Zend_Mail_Protocol_Exception $e) {
+ $this->_send('HELO ' . $host);
+ $this->_expect(250, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2
+ } catch (Zend_Mail_Protocol_Exception $e) {
+ throw $e;
+ }
+ }
+
+
+ /**
+ * Issues MAIL command
+ *
+ * @param string $from Sender mailbox
+ * @throws Zend_Mail_Protocol_Exception
+ * @return void
+ */
+ public function mail($from)
+ {
+ if ($this->_sess !== true) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('A valid session has not been started');
+ }
+
+ $this->_send('MAIL FROM:<' . $from . '>');
+ $this->_expect(250, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2
+
+ // Set mail to true, clear recipients and any existing data flags as per 4.1.1.2 of RFC 2821
+ $this->_mail = true;
+ $this->_rcpt = false;
+ $this->_data = false;
+ }
+
+
+ /**
+ * Issues RCPT command
+ *
+ * @param string $to Receiver(s) mailbox
+ * @throws Zend_Mail_Protocol_Exception
+ * @return void
+ */
+ public function rcpt($to)
+ {
+ if ($this->_mail !== true) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('No sender reverse path has been supplied');
+ }
+
+ // Set rcpt to true, as per 4.1.1.3 of RFC 2821
+ $this->_send('RCPT TO:<' . $to . '>');
+ $this->_expect(array(250, 251), 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2
+ $this->_rcpt = true;
+ }
+
+
+ /**
+ * Issues DATA command
+ *
+ * @param string $data
+ * @throws Zend_Mail_Protocol_Exception
+ * @return void
+ */
+ public function data($data)
+ {
+ // Ensure recipients have been set
+ if ($this->_rcpt !== true) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('No recipient forward path has been supplied');
+ }
+
+ $this->_send('DATA');
+ $this->_expect(354, 120); // Timeout set for 2 minutes as per RFC 2821 4.5.3.2
+
+ foreach (explode(Zend_Mime::LINEEND, $data) as $line) {
+ if (strpos($line, '.') === 0) {
+ // Escape lines prefixed with a '.'
+ $line = '.' . $line;
+ }
+ $this->_send($line);
+ }
+
+ $this->_send('.');
+ $this->_expect(250, 600); // Timeout set for 10 minutes as per RFC 2821 4.5.3.2
+ $this->_data = true;
+ }
+
+
+ /**
+ * Issues the RSET command and validates answer
+ *
+ * Can be used to restore a clean smtp communication state when a transaction has been cancelled or commencing a new transaction.
+ *
+ * @return void
+ */
+ public function rset()
+ {
+ $this->_send('RSET');
+ // MS ESMTP doesn't follow RFC, see [ZF-1377]
+ $this->_expect(array(250, 220));
+
+ $this->_mail = false;
+ $this->_rcpt = false;
+ $this->_data = false;
+ }
+
+
+ /**
+ * Issues the NOOP command and validates answer
+ *
+ * Not used by Zend_Mail, could be used to keep a connection alive or check if it is still open.
+ *
+ * @return void
+ */
+ public function noop()
+ {
+ $this->_send('NOOP');
+ $this->_expect(250, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2
+ }
+
+
+ /**
+ * Issues the VRFY command and validates answer
+ *
+ * Not used by Zend_Mail.
+ *
+ * @param string $user User Name or eMail to verify
+ * @return void
+ */
+ public function vrfy($user)
+ {
+ $this->_send('VRFY ' . $user);
+ $this->_expect(array(250, 251, 252), 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2
+ }
+
+
+ /**
+ * Issues the QUIT command and clears the current session
+ *
+ * @return void
+ */
+ public function quit()
+ {
+ if ($this->_sess) {
+ $this->_send('QUIT');
+ $this->_expect(221, 300); // Timeout set for 5 minutes as per RFC 2821 4.5.3.2
+ $this->_stopSession();
+ }
+ }
+
+
+ /**
+ * Default authentication method
+ *
+ * This default method is implemented by AUTH adapters to properly authenticate to a remote host.
+ *
+ * @throws Zend_Mail_Protocol_Exception
+ * @return void
+ */
+ public function auth()
+ {
+ if ($this->_auth === true) {
+ /**
+ * @see Zend_Mail_Protocol_Exception
+ */
+ throw new Zend_Mail_Protocol_Exception('Already authenticated for this session');
+ }
+ }
+
+
+ /**
+ * Closes connection
+ *
+ * @return void
+ */
+ public function disconnect()
+ {
+ $this->_disconnect();
+ }
+
+
+ /**
+ * Start mail session
+ *
+ * @return void
+ */
+ protected function _startSession()
+ {
+ $this->_sess = true;
+ }
+
+
+ /**
+ * Stop mail session
+ *
+ * @return void
+ */
+ protected function _stopSession()
+ {
+ $this->_sess = false;
+ }
+}
diff --git a/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php b/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php
new file mode 100644
index 0000000..2a5ca3d
--- /dev/null
+++ b/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Crammd5.php
@@ -0,0 +1,107 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Protocol
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Mail_Protocol_Smtp
+ */
+
+
+/**
+ * Performs CRAM-MD5 authentication
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Protocol
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Protocol_Smtp_Auth_Crammd5 extends Zend_Mail_Protocol_Smtp
+{
+ /**
+ * Constructor.
+ *
+ * @param string $host (Default: 127.0.0.1)
+ * @param int $port (Default: null)
+ * @param array $config Auth-specific parameters
+ * @return void
+ */
+ public function __construct($host = '127.0.0.1', $port = null, $config = null)
+ {
+ if (is_array($config)) {
+ if (isset($config['username'])) {
+ $this->_username = $config['username'];
+ }
+ if (isset($config['password'])) {
+ $this->_password = $config['password'];
+ }
+ }
+
+ parent::__construct($host, $port, $config);
+ }
+
+
+ /**
+ * @todo Perform CRAM-MD5 authentication with supplied credentials
+ *
+ * @return void
+ */
+ public function auth()
+ {
+ // Ensure AUTH has not already been initiated.
+ parent::auth();
+
+ $this->_send('AUTH CRAM-MD5');
+ $challenge = $this->_expect(334);
+ $challenge = base64_decode($challenge);
+ $digest = $this->_hmacMd5($this->_password, $challenge);
+ $this->_send(base64_encode($this->_username . ' ' . $digest));
+ $this->_expect(235);
+ $this->_auth = true;
+ }
+
+
+ /**
+ * Prepare CRAM-MD5 response to server's ticket
+ *
+ * @param string $key Challenge key (usually password)
+ * @param string $data Challenge data
+ * @param string $block Length of blocks
+ * @return string
+ */
+ protected function _hmacMd5($key, $data, $block = 64)
+ {
+ if (strlen($key) > 64) {
+ $key = pack('H32', md5($key));
+ } elseif (strlen($key) < 64) {
+ $key = str_pad($key, $block, "\0");
+ }
+
+ $k_ipad = substr($key, 0, 64) ^ str_repeat(chr(0x36), 64);
+ $k_opad = substr($key, 0, 64) ^ str_repeat(chr(0x5C), 64);
+
+ $inner = pack('H32', md5($k_ipad . $data));
+ $digest = md5($k_opad . $inner);
+
+ return $digest;
+ }
+}
diff --git a/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Login.php b/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Login.php
new file mode 100644
index 0000000..5295b65
--- /dev/null
+++ b/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Login.php
@@ -0,0 +1,97 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Protocol
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Mail_Protocol_Smtp
+ */
+
+
+/**
+ * Performs LOGIN authentication
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Protocol
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Protocol_Smtp_Auth_Login extends Zend_Mail_Protocol_Smtp
+{
+ /**
+ * LOGIN username
+ *
+ * @var string
+ */
+ protected $_username;
+
+
+ /**
+ * LOGIN password
+ *
+ * @var string
+ */
+ protected $_password;
+
+
+ /**
+ * Constructor.
+ *
+ * @param string $host (Default: 127.0.0.1)
+ * @param int $port (Default: null)
+ * @param array $config Auth-specific parameters
+ * @return void
+ */
+ public function __construct($host = '127.0.0.1', $port = null, $config = null)
+ {
+ if (is_array($config)) {
+ if (isset($config['username'])) {
+ $this->_username = $config['username'];
+ }
+ if (isset($config['password'])) {
+ $this->_password = $config['password'];
+ }
+ }
+
+ parent::__construct($host, $port, $config);
+ }
+
+
+ /**
+ * Perform LOGIN authentication with supplied credentials
+ *
+ * @return void
+ */
+ public function auth()
+ {
+ // Ensure AUTH has not already been initiated.
+ parent::auth();
+
+ $this->_send('AUTH LOGIN');
+ $this->_expect(334);
+ $this->_send(base64_encode($this->_username));
+ $this->_expect(334);
+ $this->_send(base64_encode($this->_password));
+ $this->_expect(235);
+ $this->_auth = true;
+ }
+}
diff --git a/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Plain.php b/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Plain.php
new file mode 100644
index 0000000..abd788e
--- /dev/null
+++ b/library/vendor/Zend/Mail/Protocol/Smtp/Auth/Plain.php
@@ -0,0 +1,95 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Protocol
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Mail_Protocol_Smtp
+ */
+
+
+/**
+ * Performs PLAIN authentication
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Protocol
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Protocol_Smtp_Auth_Plain extends Zend_Mail_Protocol_Smtp
+{
+ /**
+ * PLAIN username
+ *
+ * @var string
+ */
+ protected $_username;
+
+
+ /**
+ * PLAIN password
+ *
+ * @var string
+ */
+ protected $_password;
+
+
+ /**
+ * Constructor.
+ *
+ * @param string $host (Default: 127.0.0.1)
+ * @param int $port (Default: null)
+ * @param array $config Auth-specific parameters
+ * @return void
+ */
+ public function __construct($host = '127.0.0.1', $port = null, $config = null)
+ {
+ if (is_array($config)) {
+ if (isset($config['username'])) {
+ $this->_username = $config['username'];
+ }
+ if (isset($config['password'])) {
+ $this->_password = $config['password'];
+ }
+ }
+
+ parent::__construct($host, $port, $config);
+ }
+
+
+ /**
+ * Perform PLAIN authentication with supplied credentials
+ *
+ * @return void
+ */
+ public function auth()
+ {
+ // Ensure AUTH has not already been initiated.
+ parent::auth();
+
+ $this->_send('AUTH PLAIN');
+ $this->_expect(334);
+ $this->_send(base64_encode("\0" . $this->_username . "\0" . $this->_password));
+ $this->_expect(235);
+ $this->_auth = true;
+ }
+}
diff --git a/library/vendor/Zend/Mail/Storage.php b/library/vendor/Zend/Mail/Storage.php
new file mode 100644
index 0000000..b0eed12
--- /dev/null
+++ b/library/vendor/Zend/Mail/Storage.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Storage
+{
+ // maildir and IMAP flags, using IMAP names, where possible to be able to distinguish between IMAP
+ // system flags and other flags
+ const FLAG_PASSED = 'Passed';
+ const FLAG_SEEN = '\Seen';
+ const FLAG_UNSEEN = '\Unseen';
+ const FLAG_ANSWERED = '\Answered';
+ const FLAG_FLAGGED = '\Flagged';
+ const FLAG_DELETED = '\Deleted';
+ const FLAG_DRAFT = '\Draft';
+ const FLAG_RECENT = '\Recent';
+}
diff --git a/library/vendor/Zend/Mail/Storage/Abstract.php b/library/vendor/Zend/Mail/Storage/Abstract.php
new file mode 100644
index 0000000..d522789
--- /dev/null
+++ b/library/vendor/Zend/Mail/Storage/Abstract.php
@@ -0,0 +1,364 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Mail_Storage_Abstract implements Countable, ArrayAccess, SeekableIterator
+{
+ /**
+ * class capabilities with default values
+ * @var array
+ */
+ protected $_has = array('uniqueid' => true,
+ 'delete' => false,
+ 'create' => false,
+ 'top' => false,
+ 'fetchPart' => true,
+ 'flags' => false);
+
+ /**
+ * current iteration position
+ * @var int
+ */
+ protected $_iterationPos = 0;
+
+ /**
+ * maximum iteration position (= message count)
+ * @var null|int
+ */
+ protected $_iterationMax = null;
+
+ /**
+ * used message class, change it in an extened class to extend the returned message class
+ * @var string
+ */
+ protected $_messageClass = 'Zend_Mail_Message';
+
+ /**
+ * Getter for has-properties. The standard has properties
+ * are: hasFolder, hasUniqueid, hasDelete, hasCreate, hasTop
+ *
+ * The valid values for the has-properties are:
+ * - true if a feature is supported
+ * - false if a feature is not supported
+ * - null is it's not yet known or it can't be know if a feature is supported
+ *
+ * @param string $var property name
+ * @return bool supported or not
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function __get($var)
+ {
+ if (strpos($var, 'has') === 0) {
+ $var = strtolower(substr($var, 3));
+ return isset($this->_has[$var]) ? $this->_has[$var] : null;
+ }
+
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception($var . ' not found');
+ }
+
+
+ /**
+ * Get a full list of features supported by the specific mail lib and the server
+ *
+ * @return array list of features as array(featurename => true|false[|null])
+ */
+ public function getCapabilities()
+ {
+ return $this->_has;
+ }
+
+
+ /**
+ * Count messages messages in current box/folder
+ *
+ * @return int number of messages
+ * @throws Zend_Mail_Storage_Exception
+ */
+ abstract public function countMessages();
+
+
+ /**
+ * Get a list of messages with number and size
+ *
+ * @param int $id number of message
+ * @return int|array size of given message of list with all messages as array(num => size)
+ */
+ abstract public function getSize($id = 0);
+
+
+ /**
+ * Get a message with headers and body
+ *
+ * @param int $id number of message
+ * @return Zend_Mail_Message
+ */
+ abstract public function getMessage($id);
+
+
+ /**
+ * Get raw header of message or part
+ *
+ * @param int $id number of message
+ * @param null|array|string $part path to part or null for messsage header
+ * @param int $topLines include this many lines with header (after an empty line)
+ * @return string raw header
+ */
+ abstract public function getRawHeader($id, $part = null, $topLines = 0);
+
+ /**
+ * Get raw content of message or part
+ *
+ * @param int $id number of message
+ * @param null|array|string $part path to part or null for messsage content
+ * @return string raw content
+ */
+ abstract public function getRawContent($id, $part = null);
+
+ /**
+ * Create instance with parameters
+ *
+ * @param array $params mail reader specific parameters
+ * @throws Zend_Mail_Storage_Exception
+ */
+ abstract public function __construct($params);
+
+
+ /**
+ * Destructor calls close() and therefore closes the resource.
+ */
+ public function __destruct()
+ {
+ $this->close();
+ }
+
+
+ /**
+ * Close resource for mail lib. If you need to control, when the resource
+ * is closed. Otherwise the destructor would call this.
+ *
+ * @return null
+ */
+ abstract public function close();
+
+
+ /**
+ * Keep the resource alive.
+ *
+ * @return null
+ */
+ abstract public function noop();
+
+ /**
+ * delete a message from current box/folder
+ *
+ * @return null
+ */
+ abstract public function removeMessage($id);
+
+ /**
+ * get unique id for one or all messages
+ *
+ * if storage does not support unique ids it's the same as the message number
+ *
+ * @param int|null $id message number
+ * @return array|string message number for given message or all messages as array
+ * @throws Zend_Mail_Storage_Exception
+ */
+ abstract public function getUniqueId($id = null);
+
+ /**
+ * get a message number from a unique id
+ *
+ * I.e. if you have a webmailer that supports deleting messages you should use unique ids
+ * as parameter and use this method to translate it to message number right before calling removeMessage()
+ *
+ * @param string $id unique id
+ * @return int message number
+ * @throws Zend_Mail_Storage_Exception
+ */
+ abstract public function getNumberByUniqueId($id);
+
+ // interface implementations follows
+
+ /**
+ * Countable::count()
+ *
+ * @return int
+ */
+ public function count()
+ {
+ return $this->countMessages();
+ }
+
+
+ /**
+ * ArrayAccess::offsetExists()
+ *
+ * @param int $id
+ * @return boolean
+ */
+ public function offsetExists($id)
+ {
+ try {
+ if ($this->getMessage($id)) {
+ return true;
+ }
+ } catch(Zend_Mail_Storage_Exception $e) {}
+
+ return false;
+ }
+
+
+ /**
+ * ArrayAccess::offsetGet()
+ *
+ * @param int $id
+ * @return Zend_Mail_Message message object
+ */
+ public function offsetGet($id)
+ {
+ return $this->getMessage($id);
+ }
+
+
+ /**
+ * ArrayAccess::offsetSet()
+ *
+ * @param id $id
+ * @param mixed $value
+ * @throws Zend_Mail_Storage_Exception
+ * @return void
+ */
+ public function offsetSet($id, $value)
+ {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('cannot write mail messages via array access');
+ }
+
+
+ /**
+ * ArrayAccess::offsetUnset()
+ *
+ * @param int $id
+ * @return boolean success
+ */
+ public function offsetUnset($id)
+ {
+ return $this->removeMessage($id);
+ }
+
+
+ /**
+ * Iterator::rewind()
+ *
+ * Rewind always gets the new count from the storage. Thus if you use
+ * the interfaces and your scripts take long you should use reset()
+ * from time to time.
+ *
+ * @return void
+ */
+ public function rewind()
+ {
+ $this->_iterationMax = $this->countMessages();
+ $this->_iterationPos = 1;
+ }
+
+
+ /**
+ * Iterator::current()
+ *
+ * @return Zend_Mail_Message current message
+ */
+ public function current()
+ {
+ return $this->getMessage($this->_iterationPos);
+ }
+
+
+ /**
+ * Iterator::key()
+ *
+ * @return int id of current position
+ */
+ public function key()
+ {
+ return $this->_iterationPos;
+ }
+
+
+ /**
+ * Iterator::next()
+ *
+ * @return void
+ */
+ public function next()
+ {
+ ++$this->_iterationPos;
+ }
+
+
+ /**
+ * Iterator::valid()
+ *
+ * @return boolean
+ */
+ public function valid()
+ {
+ if ($this->_iterationMax === null) {
+ $this->_iterationMax = $this->countMessages();
+ }
+ return $this->_iterationPos && $this->_iterationPos <= $this->_iterationMax;
+ }
+
+
+ /**
+ * SeekableIterator::seek()
+ *
+ * @param int $pos
+ * @return void
+ * @throws OutOfBoundsException
+ */
+ public function seek($pos)
+ {
+ if ($this->_iterationMax === null) {
+ $this->_iterationMax = $this->countMessages();
+ }
+
+ if ($pos > $this->_iterationMax) {
+ throw new OutOfBoundsException('this position does not exist');
+ }
+ $this->_iterationPos = $pos;
+ }
+
+}
diff --git a/library/vendor/Zend/Mail/Storage/Exception.php b/library/vendor/Zend/Mail/Storage/Exception.php
new file mode 100644
index 0000000..a9c9021
--- /dev/null
+++ b/library/vendor/Zend/Mail/Storage/Exception.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Mail_Exception
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Storage_Exception extends Zend_Mail_Exception
+{}
+
diff --git a/library/vendor/Zend/Mail/Storage/Folder.php b/library/vendor/Zend/Mail/Storage/Folder.php
new file mode 100644
index 0000000..19d0269
--- /dev/null
+++ b/library/vendor/Zend/Mail/Storage/Folder.php
@@ -0,0 +1,235 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Storage_Folder implements RecursiveIterator
+{
+ /**
+ * subfolders of folder array(localName => Zend_Mail_Storage_Folder folder)
+ * @var array
+ */
+ protected $_folders;
+
+ /**
+ * local name (name of folder in parent folder)
+ * @var string
+ */
+ protected $_localName;
+
+ /**
+ * global name (absolute name of folder)
+ * @var string
+ */
+ protected $_globalName;
+
+ /**
+ * folder is selectable if folder is able to hold messages, else it's just a parent folder
+ * @var bool
+ */
+ protected $_selectable = true;
+
+ /**
+ * create a new mail folder instance
+ *
+ * @param string $localName name of folder in current subdirectory
+ * @param string $globalName absolute name of folder
+ * @param bool $selectable if true folder holds messages, if false it's just a parent for subfolders
+ * @param array $folders init with given instances of Zend_Mail_Storage_Folder as subfolders
+ */
+ public function __construct($localName, $globalName = '', $selectable = true, array $folders = array())
+ {
+ $this->_localName = $localName;
+ $this->_globalName = $globalName ? $globalName : $localName;
+ $this->_selectable = $selectable;
+ $this->_folders = $folders;
+ }
+
+ /**
+ * implements RecursiveIterator::hasChildren()
+ *
+ * @return bool current element has children
+ */
+ public function hasChildren()
+ {
+ $current = $this->current();
+ return $current && $current instanceof Zend_Mail_Storage_Folder && !$current->isLeaf();
+ }
+
+ /**
+ * implements RecursiveIterator::getChildren()
+ *
+ * @return Zend_Mail_Storage_Folder same as self::current()
+ */
+ public function getChildren()
+ {
+ return $this->current();
+ }
+
+ /**
+ * implements Iterator::valid()
+ *
+ * @return bool check if there's a current element
+ */
+ public function valid()
+ {
+ return key($this->_folders) !== null;
+ }
+
+ /**
+ * implements Iterator::next()
+ *
+ * @return null
+ */
+ public function next()
+ {
+ next($this->_folders);
+ }
+
+ /**
+ * implements Iterator::key()
+ *
+ * @return string key/local name of current element
+ */
+ public function key()
+ {
+ return key($this->_folders);
+ }
+
+ /**
+ * implements Iterator::current()
+ *
+ * @return Zend_Mail_Storage_Folder current folder
+ */
+ public function current()
+ {
+ return current($this->_folders);
+ }
+
+ /**
+ * implements Iterator::rewind()
+ *
+ * @return null
+ */
+ public function rewind()
+ {
+ reset($this->_folders);
+ }
+
+ /**
+ * get subfolder named $name
+ *
+ * @param string $name wanted subfolder
+ * @return Zend_Mail_Storage_Folder folder named $folder
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function __get($name)
+ {
+ if (!isset($this->_folders[$name])) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception("no subfolder named $name");
+ }
+
+ return $this->_folders[$name];
+ }
+
+ /**
+ * add or replace subfolder named $name
+ *
+ * @param string $name local name of subfolder
+ * @param Zend_Mail_Storage_Folder $folder instance for new subfolder
+ * @return null
+ */
+ public function __set($name, Zend_Mail_Storage_Folder $folder)
+ {
+ $this->_folders[$name] = $folder;
+ }
+
+ /**
+ * remove subfolder named $name
+ *
+ * @param string $name local name of subfolder
+ * @return null
+ */
+ public function __unset($name)
+ {
+ unset($this->_folders[$name]);
+ }
+
+ /**
+ * magic method for easy output of global name
+ *
+ * @return string global name of folder
+ */
+ public function __toString()
+ {
+ return (string)$this->getGlobalName();
+ }
+
+ /**
+ * get local name
+ *
+ * @return string local name
+ */
+ public function getLocalName()
+ {
+ return $this->_localName;
+ }
+
+ /**
+ * get global name
+ *
+ * @return string global name
+ */
+ public function getGlobalName()
+ {
+ return $this->_globalName;
+ }
+
+ /**
+ * is this folder selectable?
+ *
+ * @return bool selectable
+ */
+ public function isSelectable()
+ {
+ return $this->_selectable;
+ }
+
+ /**
+ * check if folder has no subfolder
+ *
+ * @return bool true if no subfolders
+ */
+ public function isLeaf()
+ {
+ return empty($this->_folders);
+ }
+}
diff --git a/library/vendor/Zend/Mail/Storage/Folder/Interface.php b/library/vendor/Zend/Mail/Storage/Folder/Interface.php
new file mode 100644
index 0000000..dc09205
--- /dev/null
+++ b/library/vendor/Zend/Mail/Storage/Folder/Interface.php
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Mail_Storage_Folder_Interface
+{
+ /**
+ * get root folder or given folder
+ *
+ * @param string $rootFolder get folder structure for given folder, else root
+ * @return Zend_Mail_Storage_Folder root or wanted folder
+ */
+ public function getFolders($rootFolder = null);
+
+ /**
+ * select given folder
+ *
+ * folder must be selectable!
+ *
+ * @param Zend_Mail_Storage_Folder|string $globalName global name of folder or instance for subfolder
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function selectFolder($globalName);
+
+
+ /**
+ * get Zend_Mail_Storage_Folder instance for current folder
+ *
+ * @return Zend_Mail_Storage_Folder instance of current folder
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getCurrentFolder();
+}
diff --git a/library/vendor/Zend/Mail/Storage/Folder/Maildir.php b/library/vendor/Zend/Mail/Storage/Folder/Maildir.php
new file mode 100644
index 0000000..9c9838e
--- /dev/null
+++ b/library/vendor/Zend/Mail/Storage/Folder/Maildir.php
@@ -0,0 +1,255 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Mail_Storage_Folder
+ */
+
+/**
+ * @see Zend_Mail_Storage_Folder_Interface
+ */
+
+/**
+ * @see Zend_Mail_Storage_Maildir
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Storage_Folder_Maildir extends Zend_Mail_Storage_Maildir implements Zend_Mail_Storage_Folder_Interface
+{
+ /**
+ * Zend_Mail_Storage_Folder root folder for folder structure
+ * @var Zend_Mail_Storage_Folder
+ */
+ protected $_rootFolder;
+
+ /**
+ * rootdir of folder structure
+ * @var string
+ */
+ protected $_rootdir;
+
+ /**
+ * name of current folder
+ * @var string
+ */
+ protected $_currentFolder;
+
+ /**
+ * delim char for subfolders
+ * @var string
+ */
+ protected $_delim;
+
+ /**
+ * Create instance with parameters
+ * Supported parameters are:
+ * - dirname rootdir of maildir structure
+ * - delim delim char for folder structur, default is '.'
+ * - folder intial selected folder, default is 'INBOX'
+ *
+ * @param array $params mail reader specific parameters
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function __construct($params)
+ {
+ if (is_array($params)) {
+ $params = (object)$params;
+ }
+
+ if (!isset($params->dirname) || !is_dir($params->dirname)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('no valid dirname given in params');
+ }
+
+ $this->_rootdir = rtrim($params->dirname, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
+
+ $this->_delim = isset($params->delim) ? $params->delim : '.';
+
+ $this->_buildFolderTree();
+ $this->selectFolder(!empty($params->folder) ? $params->folder : 'INBOX');
+ $this->_has['top'] = true;
+ $this->_has['flags'] = true;
+ }
+
+ /**
+ * find all subfolders and mbox files for folder structure
+ *
+ * Result is save in Zend_Mail_Storage_Folder instances with the root in $this->_rootFolder.
+ * $parentFolder and $parentGlobalName are only used internally for recursion.
+ *
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ protected function _buildFolderTree()
+ {
+ $this->_rootFolder = new Zend_Mail_Storage_Folder('/', '/', false);
+ $this->_rootFolder->INBOX = new Zend_Mail_Storage_Folder('INBOX', 'INBOX', true);
+
+ $dh = @opendir($this->_rootdir);
+ if (!$dh) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception("can't read folders in maildir");
+ }
+ $dirs = array();
+ while (($entry = readdir($dh)) !== false) {
+ // maildir++ defines folders must start with .
+ if ($entry[0] != '.' || $entry == '.' || $entry == '..') {
+ continue;
+ }
+ if ($this->_isMaildir($this->_rootdir . $entry)) {
+ $dirs[] = $entry;
+ }
+ }
+ closedir($dh);
+
+ sort($dirs);
+ $stack = array(null);
+ $folderStack = array(null);
+ $parentFolder = $this->_rootFolder;
+ $parent = '.';
+
+ foreach ($dirs as $dir) {
+ do {
+ if (strpos($dir, $parent) === 0) {
+ $local = substr($dir, strlen($parent));
+ if (strpos($local, $this->_delim) !== false) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('error while reading maildir');
+ }
+ array_push($stack, $parent);
+ $parent = $dir . $this->_delim;
+ $folder = new Zend_Mail_Storage_Folder($local, substr($dir, 1), true);
+ $parentFolder->$local = $folder;
+ array_push($folderStack, $parentFolder);
+ $parentFolder = $folder;
+ break;
+ } else if ($stack) {
+ $parent = array_pop($stack);
+ $parentFolder = array_pop($folderStack);
+ }
+ } while ($stack);
+ if (!$stack) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('error while reading maildir');
+ }
+ }
+ }
+
+ /**
+ * get root folder or given folder
+ *
+ * @param string $rootFolder get folder structure for given folder, else root
+ * @return Zend_Mail_Storage_Folder root or wanted folder
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getFolders($rootFolder = null)
+ {
+ if (!$rootFolder || $rootFolder == 'INBOX') {
+ return $this->_rootFolder;
+ }
+
+ // rootdir is same as INBOX in maildir
+ if (strpos($rootFolder, 'INBOX' . $this->_delim) === 0) {
+ $rootFolder = substr($rootFolder, 6);
+ }
+ $currentFolder = $this->_rootFolder;
+ $subname = trim($rootFolder, $this->_delim);
+ while ($currentFolder) {
+ @list($entry, $subname) = @explode($this->_delim, $subname, 2);
+ $currentFolder = $currentFolder->$entry;
+ if (!$subname) {
+ break;
+ }
+ }
+
+ if ($currentFolder->getGlobalName() != rtrim($rootFolder, $this->_delim)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception("folder $rootFolder not found");
+ }
+ return $currentFolder;
+ }
+
+ /**
+ * select given folder
+ *
+ * folder must be selectable!
+ *
+ * @param Zend_Mail_Storage_Folder|string $globalName global name of folder or instance for subfolder
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function selectFolder($globalName)
+ {
+ $this->_currentFolder = (string)$globalName;
+
+ // getting folder from folder tree for validation
+ $folder = $this->getFolders($this->_currentFolder);
+
+ try {
+ $this->_openMaildir($this->_rootdir . '.' . $folder->getGlobalName());
+ } catch(Zend_Mail_Storage_Exception $e) {
+ // check what went wrong
+ if (!$folder->isSelectable()) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception("{$this->_currentFolder} is not selectable", 0, $e);
+ }
+ // seems like file has vanished; rebuilding folder tree - but it's still an exception
+ $this->_buildFolderTree($this->_rootdir);
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('seems like the maildir has vanished, I\'ve rebuild the ' .
+ 'folder tree, search for an other folder and try again', 0, $e);
+ }
+ }
+
+ /**
+ * get Zend_Mail_Storage_Folder instance for current folder
+ *
+ * @return Zend_Mail_Storage_Folder instance of current folder
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getCurrentFolder()
+ {
+ return $this->_currentFolder;
+ }
+}
diff --git a/library/vendor/Zend/Mail/Storage/Folder/Mbox.php b/library/vendor/Zend/Mail/Storage/Folder/Mbox.php
new file mode 100644
index 0000000..670a6ff
--- /dev/null
+++ b/library/vendor/Zend/Mail/Storage/Folder/Mbox.php
@@ -0,0 +1,255 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Mail_Storage_Folder
+ */
+
+/**
+ * @see Zend_Mail_Storage_Folder_Interface
+ */
+
+/**
+ * @see Zend_Mail_Storage_Mbox
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Storage_Folder_Mbox extends Zend_Mail_Storage_Mbox implements Zend_Mail_Storage_Folder_Interface
+{
+ /**
+ * Zend_Mail_Storage_Folder root folder for folder structure
+ * @var Zend_Mail_Storage_Folder
+ */
+ protected $_rootFolder;
+
+ /**
+ * rootdir of folder structure
+ * @var string
+ */
+ protected $_rootdir;
+
+ /**
+ * name of current folder
+ * @var string
+ */
+ protected $_currentFolder;
+
+ /**
+ * Create instance with parameters
+ *
+ * Disallowed parameters are:
+ * - filename use Zend_Mail_Storage_Mbox for a single file
+ * Supported parameters are:
+ * - dirname rootdir of mbox structure
+ * - folder intial selected folder, default is 'INBOX'
+ *
+ * @param array $params mail reader specific parameters
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function __construct($params)
+ {
+ if (is_array($params)) {
+ $params = (object)$params;
+ }
+
+ if (isset($params->filename)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('use Zend_Mail_Storage_Mbox for a single file');
+ }
+
+ if (!isset($params->dirname) || !is_dir($params->dirname)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('no valid dirname given in params');
+ }
+
+ $this->_rootdir = rtrim($params->dirname, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
+
+ $this->_buildFolderTree($this->_rootdir);
+ $this->selectFolder(!empty($params->folder) ? $params->folder : 'INBOX');
+ $this->_has['top'] = true;
+ $this->_has['uniqueid'] = false;
+ }
+
+ /**
+ * find all subfolders and mbox files for folder structure
+ *
+ * Result is save in Zend_Mail_Storage_Folder instances with the root in $this->_rootFolder.
+ * $parentFolder and $parentGlobalName are only used internally for recursion.
+ *
+ * @param string $currentDir call with root dir, also used for recursion.
+ * @param Zend_Mail_Storage_Folder|null $parentFolder used for recursion
+ * @param string $parentGlobalName used for rescursion
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ protected function _buildFolderTree($currentDir, $parentFolder = null, $parentGlobalName = '')
+ {
+ if (!$parentFolder) {
+ $this->_rootFolder = new Zend_Mail_Storage_Folder('/', '/', false);
+ $parentFolder = $this->_rootFolder;
+ }
+
+ $dh = @opendir($currentDir);
+ if (!$dh) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception("can't read dir $currentDir");
+ }
+ while (($entry = readdir($dh)) !== false) {
+ // ignore hidden files for mbox
+ if ($entry[0] == '.') {
+ continue;
+ }
+ $absoluteEntry = $currentDir . $entry;
+ $globalName = $parentGlobalName . DIRECTORY_SEPARATOR . $entry;
+ if (is_file($absoluteEntry) && $this->_isMboxFile($absoluteEntry)) {
+ $parentFolder->$entry = new Zend_Mail_Storage_Folder($entry, $globalName);
+ continue;
+ }
+ if (!is_dir($absoluteEntry) /* || $entry == '.' || $entry == '..' */) {
+ continue;
+ }
+ $folder = new Zend_Mail_Storage_Folder($entry, $globalName, false);
+ $parentFolder->$entry = $folder;
+ $this->_buildFolderTree($absoluteEntry . DIRECTORY_SEPARATOR, $folder, $globalName);
+ }
+
+ closedir($dh);
+ }
+
+ /**
+ * get root folder or given folder
+ *
+ * @param string $rootFolder get folder structure for given folder, else root
+ * @return Zend_Mail_Storage_Folder root or wanted folder
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getFolders($rootFolder = null)
+ {
+ if (!$rootFolder) {
+ return $this->_rootFolder;
+ }
+
+ $currentFolder = $this->_rootFolder;
+ $subname = trim($rootFolder, DIRECTORY_SEPARATOR);
+ while ($currentFolder) {
+ @list($entry, $subname) = @explode(DIRECTORY_SEPARATOR, $subname, 2);
+ $currentFolder = $currentFolder->$entry;
+ if (!$subname) {
+ break;
+ }
+ }
+
+ if ($currentFolder->getGlobalName() != DIRECTORY_SEPARATOR . trim($rootFolder, DIRECTORY_SEPARATOR)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception("folder $rootFolder not found");
+ }
+ return $currentFolder;
+ }
+
+ /**
+ * select given folder
+ *
+ * folder must be selectable!
+ *
+ * @param Zend_Mail_Storage_Folder|string $globalName global name of folder or instance for subfolder
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function selectFolder($globalName)
+ {
+ $this->_currentFolder = (string)$globalName;
+
+ // getting folder from folder tree for validation
+ $folder = $this->getFolders($this->_currentFolder);
+
+ try {
+ $this->_openMboxFile($this->_rootdir . $folder->getGlobalName());
+ } catch(Zend_Mail_Storage_Exception $e) {
+ // check what went wrong
+ if (!$folder->isSelectable()) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception("{$this->_currentFolder} is not selectable", 0, $e);
+ }
+ // seems like file has vanished; rebuilding folder tree - but it's still an exception
+ $this->_buildFolderTree($this->_rootdir);
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('seems like the mbox file has vanished, I\'ve rebuild the ' .
+ 'folder tree, search for an other folder and try again', 0, $e);
+ }
+ }
+
+ /**
+ * get Zend_Mail_Storage_Folder instance for current folder
+ *
+ * @return Zend_Mail_Storage_Folder instance of current folder
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getCurrentFolder()
+ {
+ return $this->_currentFolder;
+ }
+
+ /**
+ * magic method for serialize()
+ *
+ * with this method you can cache the mbox class
+ *
+ * @return array name of variables
+ */
+ public function __sleep()
+ {
+ return array_merge(parent::__sleep(), array('_currentFolder', '_rootFolder', '_rootdir'));
+ }
+
+ /**
+ * magic method for unserialize()
+ *
+ * with this method you can cache the mbox class
+ *
+ * @return null
+ */
+ public function __wakeup()
+ {
+ // if cache is stall selectFolder() rebuilds the tree on error
+ parent::__wakeup();
+ }
+}
diff --git a/library/vendor/Zend/Mail/Storage/Imap.php b/library/vendor/Zend/Mail/Storage/Imap.php
new file mode 100644
index 0000000..2678025
--- /dev/null
+++ b/library/vendor/Zend/Mail/Storage/Imap.php
@@ -0,0 +1,620 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Mail_Storage_Abstract
+ */
+
+/**
+ * @see Zend_Mail_Protocol_Imap
+ */
+
+/**
+ * @see Zend_Mail_Storage_Writable_Interface
+ */
+
+/**
+ * @see Zend_Mail_Storage_Folder_Interface
+ */
+
+/**
+ * @see Zend_Mail_Storage_Folder
+ */
+
+/**
+ * @see Zend_Mail_Message
+ */
+
+/**
+ * @see Zend_Mail_Storage
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Storage_Imap extends Zend_Mail_Storage_Abstract
+ implements Zend_Mail_Storage_Folder_Interface, Zend_Mail_Storage_Writable_Interface
+{
+ // TODO: with an internal cache we could optimize this class, or create an extra class with
+ // such optimizations. Especially the various fetch calls could be combined to one cache call
+
+ /**
+ * protocol handler
+ * @var null|Zend_Mail_Protocol_Imap
+ */
+ protected $_protocol;
+
+ /**
+ * name of current folder
+ * @var string
+ */
+ protected $_currentFolder = '';
+
+ /**
+ * imap flags to constants translation
+ * @var array
+ */
+ protected static $_knownFlags = array('\Passed' => Zend_Mail_Storage::FLAG_PASSED,
+ '\Answered' => Zend_Mail_Storage::FLAG_ANSWERED,
+ '\Seen' => Zend_Mail_Storage::FLAG_SEEN,
+ '\Unseen' => Zend_Mail_Storage::FLAG_UNSEEN,
+ '\Deleted' => Zend_Mail_Storage::FLAG_DELETED,
+ '\Draft' => Zend_Mail_Storage::FLAG_DRAFT,
+ '\Flagged' => Zend_Mail_Storage::FLAG_FLAGGED);
+
+ /**
+ * map flags to search criterias
+ * @var array
+ */
+ protected static $_searchFlags = array('\Recent' => 'RECENT',
+ '\Answered' => 'ANSWERED',
+ '\Seen' => 'SEEN',
+ '\Unseen' => 'UNSEEN',
+ '\Deleted' => 'DELETED',
+ '\Draft' => 'DRAFT',
+ '\Flagged' => 'FLAGGED');
+
+ /**
+ * Count messages all messages in current box
+ *
+ * @return int number of messages
+ * @throws Zend_Mail_Storage_Exception
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function countMessages($flags = null)
+ {
+ if (!$this->_currentFolder) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('No selected folder to count');
+ }
+
+ if ($flags === null) {
+ return count($this->_protocol->search(array('ALL')));
+ }
+
+ $params = array();
+ foreach ((array)$flags as $flag) {
+ if (isset(self::$_searchFlags[$flag])) {
+ $params[] = self::$_searchFlags[$flag];
+ } else {
+ $params[] = 'KEYWORD';
+ $params[] = $this->_protocol->escapeString($flag);
+ }
+ }
+ return count($this->_protocol->search($params));
+ }
+
+ /**
+ * get a list of messages with number and size
+ *
+ * @param int $id number of message
+ * @return int|array size of given message of list with all messages as array(num => size)
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function getSize($id = 0)
+ {
+ if ($id) {
+ return $this->_protocol->fetch('RFC822.SIZE', $id);
+ }
+ return $this->_protocol->fetch('RFC822.SIZE', 1, INF);
+ }
+
+ /**
+ * Fetch a message
+ *
+ * @param int $id number of message
+ * @return Zend_Mail_Message
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function getMessage($id)
+ {
+ $data = $this->_protocol->fetch(array('FLAGS', 'RFC822.HEADER'), $id);
+ $header = $data['RFC822.HEADER'];
+
+ $flags = array();
+ foreach ($data['FLAGS'] as $flag) {
+ $flags[] = isset(self::$_knownFlags[$flag]) ? self::$_knownFlags[$flag] : $flag;
+ }
+
+ return new $this->_messageClass(array('handler' => $this, 'id' => $id, 'headers' => $header, 'flags' => $flags));
+ }
+
+ /*
+ * Get raw header of message or part
+ *
+ * @param int $id number of message
+ * @param null|array|string $part path to part or null for messsage header
+ * @param int $topLines include this many lines with header (after an empty line)
+ * @param int $topLines include this many lines with header (after an empty line)
+ * @return string raw header
+ * @throws Zend_Mail_Protocol_Exception
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getRawHeader($id, $part = null, $topLines = 0)
+ {
+ if ($part !== null) {
+ // TODO: implement
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('not implemented');
+ }
+
+ // TODO: toplines
+ return $this->_protocol->fetch('RFC822.HEADER', $id);
+ }
+
+ /*
+ * Get raw content of message or part
+ *
+ * @param int $id number of message
+ * @param null|array|string $part path to part or null for messsage content
+ * @return string raw content
+ * @throws Zend_Mail_Protocol_Exception
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getRawContent($id, $part = null)
+ {
+ if ($part !== null) {
+ // TODO: implement
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('not implemented');
+ }
+
+ return $this->_protocol->fetch('RFC822.TEXT', $id);
+ }
+
+ /**
+ * create instance with parameters
+ * Supported paramters are
+ * - user username
+ * - host hostname or ip address of IMAP server [optional, default = 'localhost']
+ * - password password for user 'username' [optional, default = '']
+ * - port port for IMAP server [optional, default = 110]
+ * - ssl 'SSL' or 'TLS' for secure sockets
+ * - folder select this folder [optional, default = 'INBOX']
+ *
+ * @param array $params mail reader specific parameters
+ * @throws Zend_Mail_Storage_Exception
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function __construct($params)
+ {
+ if (is_array($params)) {
+ $params = (object)$params;
+ }
+
+ $this->_has['flags'] = true;
+
+ if ($params instanceof Zend_Mail_Protocol_Imap) {
+ $this->_protocol = $params;
+ try {
+ $this->selectFolder('INBOX');
+ } catch(Zend_Mail_Storage_Exception $e) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('cannot select INBOX, is this a valid transport?', 0, $e);
+ }
+ return;
+ }
+
+ if (!isset($params->user)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('need at least user in params');
+ }
+
+ $host = isset($params->host) ? $params->host : 'localhost';
+ $password = isset($params->password) ? $params->password : '';
+ $port = isset($params->port) ? $params->port : null;
+ $ssl = isset($params->ssl) ? $params->ssl : false;
+
+ $this->_protocol = new Zend_Mail_Protocol_Imap();
+ $this->_protocol->connect($host, $port, $ssl);
+ if (!$this->_protocol->login($params->user, $password)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('cannot login, user or password wrong');
+ }
+ $this->selectFolder(isset($params->folder) ? $params->folder : 'INBOX');
+ }
+
+ /**
+ * Close resource for mail lib. If you need to control, when the resource
+ * is closed. Otherwise the destructor would call this.
+ *
+ * @return null
+ */
+ public function close()
+ {
+ $this->_currentFolder = '';
+ $this->_protocol->logout();
+ }
+
+ /**
+ * Keep the server busy.
+ *
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function noop()
+ {
+ if (!$this->_protocol->noop()) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('could not do nothing');
+ }
+ }
+
+ /**
+ * Remove a message from server. If you're doing that from a web enviroment
+ * you should be careful and use a uniqueid as parameter if possible to
+ * identify the message.
+ *
+ * @param int $id number of message
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function removeMessage($id)
+ {
+ if (!$this->_protocol->store(array(Zend_Mail_Storage::FLAG_DELETED), $id, null, '+')) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('cannot set deleted flag');
+ }
+ // TODO: expunge here or at close? we can handle an error here better and are more fail safe
+ if (!$this->_protocol->expunge()) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('message marked as deleted, but could not expunge');
+ }
+ }
+
+ /**
+ * get unique id for one or all messages
+ *
+ * if storage does not support unique ids it's the same as the message number
+ *
+ * @param int|null $id message number
+ * @return array|string message number for given message or all messages as array
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getUniqueId($id = null)
+ {
+ if ($id) {
+ return $this->_protocol->fetch('UID', $id);
+ }
+
+ return $this->_protocol->fetch('UID', 1, INF);
+ }
+
+ /**
+ * get a message number from a unique id
+ *
+ * I.e. if you have a webmailer that supports deleting messages you should use unique ids
+ * as parameter and use this method to translate it to message number right before calling removeMessage()
+ *
+ * @param string $id unique id
+ * @return int message number
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getNumberByUniqueId($id)
+ {
+ // TODO: use search to find number directly
+ $ids = $this->getUniqueId();
+ foreach ($ids as $k => $v) {
+ if ($v == $id) {
+ return $k;
+ }
+ }
+
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('unique id not found');
+ }
+
+
+ /**
+ * get root folder or given folder
+ *
+ * @param string $rootFolder get folder structure for given folder, else root
+ * @return Zend_Mail_Storage_Folder root or wanted folder
+ * @throws Zend_Mail_Storage_Exception
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function getFolders($rootFolder = null)
+ {
+ $folders = $this->_protocol->listMailbox((string)$rootFolder);
+ if (!$folders) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('folder not found');
+ }
+
+ ksort($folders, SORT_STRING);
+ $root = new Zend_Mail_Storage_Folder('/', '/', false);
+ $stack = array(null);
+ $folderStack = array(null);
+ $parentFolder = $root;
+ $parent = '';
+
+ foreach ($folders as $globalName => $data) {
+ do {
+ if (!$parent || strpos($globalName, $parent) === 0) {
+ $pos = strrpos($globalName, $data['delim']);
+ if ($pos === false) {
+ $localName = $globalName;
+ } else {
+ $localName = substr($globalName, $pos + 1);
+ }
+ $selectable = !$data['flags'] || !in_array('\\Noselect', $data['flags']);
+
+ array_push($stack, $parent);
+ $parent = $globalName . $data['delim'];
+ $folder = new Zend_Mail_Storage_Folder($localName, $globalName, $selectable);
+ $parentFolder->$localName = $folder;
+ array_push($folderStack, $parentFolder);
+ $parentFolder = $folder;
+ break;
+ } else if ($stack) {
+ $parent = array_pop($stack);
+ $parentFolder = array_pop($folderStack);
+ }
+ } while ($stack);
+ if (!$stack) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('error while constructing folder tree');
+ }
+ }
+
+ return $root;
+ }
+
+ /**
+ * select given folder
+ *
+ * folder must be selectable!
+ *
+ * @param Zend_Mail_Storage_Folder|string $globalName global name of folder or instance for subfolder
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function selectFolder($globalName)
+ {
+ $this->_currentFolder = $globalName;
+ if (!$this->_protocol->select($this->_currentFolder)) {
+ $this->_currentFolder = '';
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('cannot change folder, maybe it does not exist');
+ }
+ }
+
+
+ /**
+ * get Zend_Mail_Storage_Folder instance for current folder
+ *
+ * @return Zend_Mail_Storage_Folder instance of current folder
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getCurrentFolder()
+ {
+ return $this->_currentFolder;
+ }
+
+ /**
+ * create a new folder
+ *
+ * This method also creates parent folders if necessary. Some mail storages may restrict, which folder
+ * may be used as parent or which chars may be used in the folder name
+ *
+ * @param string $name global name of folder, local name if $parentFolder is set
+ * @param string|Zend_Mail_Storage_Folder $parentFolder parent folder for new folder, else root folder is parent
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function createFolder($name, $parentFolder = null)
+ {
+ // TODO: we assume / as the hierarchy delim - need to get that from the folder class!
+ if ($parentFolder instanceof Zend_Mail_Storage_Folder) {
+ $folder = $parentFolder->getGlobalName() . '/' . $name;
+ } else if ($parentFolder != null) {
+ $folder = $parentFolder . '/' . $name;
+ } else {
+ $folder = $name;
+ }
+
+ if (!$this->_protocol->create($folder)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('cannot create folder');
+ }
+ }
+
+ /**
+ * remove a folder
+ *
+ * @param string|Zend_Mail_Storage_Folder $name name or instance of folder
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function removeFolder($name)
+ {
+ if ($name instanceof Zend_Mail_Storage_Folder) {
+ $name = $name->getGlobalName();
+ }
+
+ if (!$this->_protocol->delete($name)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('cannot delete folder');
+ }
+ }
+
+ /**
+ * rename and/or move folder
+ *
+ * The new name has the same restrictions as in createFolder()
+ *
+ * @param string|Zend_Mail_Storage_Folder $oldName name or instance of folder
+ * @param string $newName new global name of folder
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function renameFolder($oldName, $newName)
+ {
+ if ($oldName instanceof Zend_Mail_Storage_Folder) {
+ $oldName = $oldName->getGlobalName();
+ }
+
+ if (!$this->_protocol->rename($oldName, $newName)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('cannot rename folder');
+ }
+ }
+
+ /**
+ * append a new message to mail storage
+ *
+ * @param string $message message as string or instance of message class
+ * @param null|string|Zend_Mail_Storage_Folder $folder folder for new message, else current folder is taken
+ * @param null|array $flags set flags for new message, else a default set is used
+ * @throws Zend_Mail_Storage_Exception
+ */
+ // not yet * @param string|Zend_Mail_Message|Zend_Mime_Message $message message as string or instance of message class
+ public function appendMessage($message, $folder = null, $flags = null)
+ {
+ if ($folder === null) {
+ $folder = $this->_currentFolder;
+ }
+
+ if ($flags === null) {
+ $flags = array(Zend_Mail_Storage::FLAG_SEEN);
+ }
+
+ // TODO: handle class instances for $message
+ if (!$this->_protocol->append($folder, $message, $flags)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('cannot create message, please check if the folder exists and your flags');
+ }
+ }
+
+ /**
+ * copy an existing message
+ *
+ * @param int $id number of message
+ * @param string|Zend_Mail_Storage_Folder $folder name or instance of targer folder
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function copyMessage($id, $folder)
+ {
+ if (!$this->_protocol->copy($folder, $id)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('cannot copy message, does the folder exist?');
+ }
+ }
+
+ /**
+ * move an existing message
+ *
+ * NOTE: imap has no native move command, thus it's emulated with copy and delete
+ *
+ * @param int $id number of message
+ * @param string|Zend_Mail_Storage_Folder $folder name or instance of targer folder
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function moveMessage($id, $folder) {
+ $this->copyMessage($id, $folder);
+ $this->removeMessage($id);
+ }
+
+ /**
+ * set flags for message
+ *
+ * NOTE: this method can't set the recent flag.
+ *
+ * @param int $id number of message
+ * @param array $flags new flags for message
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function setFlags($id, $flags)
+ {
+ if (!$this->_protocol->store($flags, $id)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('cannot set flags, have you tried to set the recent flag or special chars?');
+ }
+ }
+}
+
diff --git a/library/vendor/Zend/Mail/Storage/Maildir.php b/library/vendor/Zend/Mail/Storage/Maildir.php
new file mode 100644
index 0000000..78c983b
--- /dev/null
+++ b/library/vendor/Zend/Mail/Storage/Maildir.php
@@ -0,0 +1,462 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Mail_Storage_Abstract
+ */
+
+/**
+ * @see Zend_Mail_Message_File
+ */
+
+/**
+ * @see Zend_Mail_Storage
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Storage_Maildir extends Zend_Mail_Storage_Abstract
+{
+ /**
+ * used message class, change it in an extened class to extend the returned message class
+ * @var string
+ */
+ protected $_messageClass = 'Zend_Mail_Message_File';
+
+ /**
+ * data of found message files in maildir dir
+ * @var array
+ */
+ protected $_files = array();
+
+ /**
+ * known flag chars in filenames
+ *
+ * This list has to be in alphabetical order for setFlags()
+ *
+ * @var array
+ */
+ protected static $_knownFlags = array('D' => Zend_Mail_Storage::FLAG_DRAFT,
+ 'F' => Zend_Mail_Storage::FLAG_FLAGGED,
+ 'P' => Zend_Mail_Storage::FLAG_PASSED,
+ 'R' => Zend_Mail_Storage::FLAG_ANSWERED,
+ 'S' => Zend_Mail_Storage::FLAG_SEEN,
+ 'T' => Zend_Mail_Storage::FLAG_DELETED);
+
+ // TODO: getFlags($id) for fast access if headers are not needed (i.e. just setting flags)?
+
+ /**
+ * Count messages all messages in current box
+ *
+ * @return int number of messages
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function countMessages($flags = null)
+ {
+ if ($flags === null) {
+ return count($this->_files);
+ }
+
+ $count = 0;
+ if (!is_array($flags)) {
+ foreach ($this->_files as $file) {
+ if (isset($file['flaglookup'][$flags])) {
+ ++$count;
+ }
+ }
+ return $count;
+ }
+
+ $flags = array_flip($flags);
+ foreach ($this->_files as $file) {
+ foreach ($flags as $flag => $v) {
+ if (!isset($file['flaglookup'][$flag])) {
+ continue 2;
+ }
+ }
+ ++$count;
+ }
+ return $count;
+ }
+
+ /**
+ * Get one or all fields from file structure. Also checks if message is valid
+ *
+ * @param int $id message number
+ * @param string|null $field wanted field
+ * @return string|array wanted field or all fields as array
+ * @throws Zend_Mail_Storage_Exception
+ */
+ protected function _getFileData($id, $field = null)
+ {
+ if (!isset($this->_files[$id - 1])) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('id does not exist');
+ }
+
+ if (!$field) {
+ return $this->_files[$id - 1];
+ }
+
+ if (!isset($this->_files[$id - 1][$field])) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('field does not exist');
+ }
+
+ return $this->_files[$id - 1][$field];
+ }
+
+ /**
+ * Get a list of messages with number and size
+ *
+ * @param int|null $id number of message or null for all messages
+ * @return int|array size of given message of list with all messages as array(num => size)
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getSize($id = null)
+ {
+ if ($id !== null) {
+ $filedata = $this->_getFileData($id);
+ return isset($filedata['size']) ? $filedata['size'] : filesize($filedata['filename']);
+ }
+
+ $result = array();
+ foreach ($this->_files as $num => $data) {
+ $result[$num + 1] = isset($data['size']) ? $data['size'] : filesize($data['filename']);
+ }
+
+ return $result;
+ }
+
+
+
+ /**
+ * Fetch a message
+ *
+ * @param int $id number of message
+ * @return Zend_Mail_Message_File
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getMessage($id)
+ {
+ // TODO that's ugly, would be better to let the message class decide
+ if (strtolower($this->_messageClass) == 'zend_mail_message_file' || is_subclass_of($this->_messageClass, 'zend_mail_message_file')) {
+ return new $this->_messageClass(array('file' => $this->_getFileData($id, 'filename'),
+ 'flags' => $this->_getFileData($id, 'flags')));
+ }
+
+ return new $this->_messageClass(array('handler' => $this, 'id' => $id, 'headers' => $this->getRawHeader($id),
+ 'flags' => $this->_getFileData($id, 'flags')));
+ }
+
+ /*
+ * Get raw header of message or part
+ *
+ * @param int $id number of message
+ * @param null|array|string $part path to part or null for messsage header
+ * @param int $topLines include this many lines with header (after an empty line)
+ * @return string raw header
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getRawHeader($id, $part = null, $topLines = 0)
+ {
+ if ($part !== null) {
+ // TODO: implement
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('not implemented');
+ }
+
+ $fh = fopen($this->_getFileData($id, 'filename'), 'r');
+
+ $content = '';
+ while (!feof($fh)) {
+ $line = fgets($fh);
+ if (!trim($line)) {
+ break;
+ }
+ $content .= $line;
+ }
+
+ fclose($fh);
+ return $content;
+ }
+
+ /*
+ * Get raw content of message or part
+ *
+ * @param int $id number of message
+ * @param null|array|string $part path to part or null for messsage content
+ * @return string raw content
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getRawContent($id, $part = null)
+ {
+ if ($part !== null) {
+ // TODO: implement
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('not implemented');
+ }
+
+ $fh = fopen($this->_getFileData($id, 'filename'), 'r');
+
+ while (!feof($fh)) {
+ $line = fgets($fh);
+ if (!trim($line)) {
+ break;
+ }
+ }
+
+ $content = stream_get_contents($fh);
+ fclose($fh);
+ return $content;
+ }
+
+ /**
+ * Create instance with parameters
+ * Supported parameters are:
+ * - dirname dirname of mbox file
+ *
+ * @param array $params mail reader specific parameters
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function __construct($params)
+ {
+ if (is_array($params)) {
+ $params = (object)$params;
+ }
+
+ if (!isset($params->dirname) || !is_dir($params->dirname)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('no valid dirname given in params');
+ }
+
+ if (!$this->_isMaildir($params->dirname)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('invalid maildir given');
+ }
+
+ $this->_has['top'] = true;
+ $this->_has['flags'] = true;
+ $this->_openMaildir($params->dirname);
+ }
+
+ /**
+ * check if a given dir is a valid maildir
+ *
+ * @param string $dirname name of dir
+ * @return bool dir is valid maildir
+ */
+ protected function _isMaildir($dirname)
+ {
+ if (file_exists($dirname . '/new') && !is_dir($dirname . '/new')) {
+ return false;
+ }
+ if (file_exists($dirname . '/tmp') && !is_dir($dirname . '/tmp')) {
+ return false;
+ }
+ return is_dir($dirname . '/cur');
+ }
+
+ /**
+ * open given dir as current maildir
+ *
+ * @param string $dirname name of maildir
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ protected function _openMaildir($dirname)
+ {
+ if ($this->_files) {
+ $this->close();
+ }
+
+ $dh = @opendir($dirname . '/cur/');
+ if (!$dh) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('cannot open maildir');
+ }
+ $this->_getMaildirFiles($dh, $dirname . '/cur/');
+ closedir($dh);
+
+ $dh = @opendir($dirname . '/new/');
+ if ($dh) {
+ $this->_getMaildirFiles($dh, $dirname . '/new/', array(Zend_Mail_Storage::FLAG_RECENT));
+ closedir($dh);
+ } else if (file_exists($dirname . '/new/')) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('cannot read recent mails in maildir');
+ }
+ }
+
+ /**
+ * find all files in opened dir handle and add to maildir files
+ *
+ * @param resource $dh dir handle used for search
+ * @param string $dirname dirname of dir in $dh
+ * @param array $default_flags default flags for given dir
+ * @return null
+ */
+ protected function _getMaildirFiles($dh, $dirname, $default_flags = array())
+ {
+ while (($entry = readdir($dh)) !== false) {
+ if ($entry[0] == '.' || !is_file($dirname . $entry)) {
+ continue;
+ }
+
+ @list($uniq, $info) = explode(':', $entry, 2);
+ @list(,$size) = explode(',', $uniq, 2);
+ if ($size && $size[0] == 'S' && $size[1] == '=') {
+ $size = substr($size, 2);
+ }
+ if (!ctype_digit($size)) {
+ $size = null;
+ }
+ @list($version, $flags) = explode(',', $info, 2);
+ if ($version != 2) {
+ $flags = '';
+ }
+
+ $named_flags = $default_flags;
+ $length = strlen($flags);
+ for ($i = 0; $i < $length; ++$i) {
+ $flag = $flags[$i];
+ $named_flags[$flag] = isset(self::$_knownFlags[$flag]) ? self::$_knownFlags[$flag] : $flag;
+ }
+
+ $data = array('uniq' => $uniq,
+ 'flags' => $named_flags,
+ 'flaglookup' => array_flip($named_flags),
+ 'filename' => $dirname . $entry);
+ if ($size !== null) {
+ $data['size'] = (int)$size;
+ }
+ $this->_files[] = $data;
+ }
+ }
+
+
+ /**
+ * Close resource for mail lib. If you need to control, when the resource
+ * is closed. Otherwise the destructor would call this.
+ *
+ * @return void
+ */
+ public function close()
+ {
+ $this->_files = array();
+ }
+
+
+ /**
+ * Waste some CPU cycles doing nothing.
+ *
+ * @return void
+ */
+ public function noop()
+ {
+ return true;
+ }
+
+
+ /**
+ * stub for not supported message deletion
+ *
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function removeMessage($id)
+ {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('maildir is (currently) read-only');
+ }
+
+ /**
+ * get unique id for one or all messages
+ *
+ * if storage does not support unique ids it's the same as the message number
+ *
+ * @param int|null $id message number
+ * @return array|string message number for given message or all messages as array
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getUniqueId($id = null)
+ {
+ if ($id) {
+ return $this->_getFileData($id, 'uniq');
+ }
+
+ $ids = array();
+ foreach ($this->_files as $num => $file) {
+ $ids[$num + 1] = $file['uniq'];
+ }
+ return $ids;
+ }
+
+ /**
+ * get a message number from a unique id
+ *
+ * I.e. if you have a webmailer that supports deleting messages you should use unique ids
+ * as parameter and use this method to translate it to message number right before calling removeMessage()
+ *
+ * @param string $id unique id
+ * @return int message number
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getNumberByUniqueId($id)
+ {
+ foreach ($this->_files as $num => $file) {
+ if ($file['uniq'] == $id) {
+ return $num + 1;
+ }
+ }
+
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('unique id not found');
+ }
+}
diff --git a/library/vendor/Zend/Mail/Storage/Mbox.php b/library/vendor/Zend/Mail/Storage/Mbox.php
new file mode 100644
index 0000000..5f5bffb
--- /dev/null
+++ b/library/vendor/Zend/Mail/Storage/Mbox.php
@@ -0,0 +1,437 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Loader
+ * May be used in constructor, but commented out for now
+ */
+// require_once 'Zend/Loader.php';
+
+/**
+ * @see Zend_Mail_Storage_Abstract
+ */
+
+/**
+ * @see Zend_Mail_Message_File
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Storage_Mbox extends Zend_Mail_Storage_Abstract
+{
+ /**
+ * file handle to mbox file
+ * @var null|resource
+ */
+ protected $_fh;
+
+ /**
+ * filename of mbox file for __wakeup
+ * @var string
+ */
+ protected $_filename;
+
+ /**
+ * modification date of mbox file for __wakeup
+ * @var int
+ */
+ protected $_filemtime;
+
+ /**
+ * start and end position of messages as array('start' => start, 'seperator' => headersep, 'end' => end)
+ * @var array
+ */
+ protected $_positions;
+
+ /**
+ * used message class, change it in an extened class to extend the returned message class
+ * @var string
+ */
+ protected $_messageClass = 'Zend_Mail_Message_File';
+
+ /**
+ * Count messages all messages in current box
+ *
+ * @return int number of messages
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function countMessages()
+ {
+ return count($this->_positions);
+ }
+
+
+ /**
+ * Get a list of messages with number and size
+ *
+ * @param int|null $id number of message or null for all messages
+ * @return int|array size of given message of list with all messages as array(num => size)
+ */
+ public function getSize($id = 0)
+ {
+ if ($id) {
+ $pos = $this->_positions[$id - 1];
+ return $pos['end'] - $pos['start'];
+ }
+
+ $result = array();
+ foreach ($this->_positions as $num => $pos) {
+ $result[$num + 1] = $pos['end'] - $pos['start'];
+ }
+
+ return $result;
+ }
+
+
+ /**
+ * Get positions for mail message or throw exeption if id is invalid
+ *
+ * @param int $id number of message
+ * @return array positions as in _positions
+ * @throws Zend_Mail_Storage_Exception
+ */
+ protected function _getPos($id)
+ {
+ if (!isset($this->_positions[$id - 1])) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('id does not exist');
+ }
+
+ return $this->_positions[$id - 1];
+ }
+
+
+ /**
+ * Fetch a message
+ *
+ * @param int $id number of message
+ * @return Zend_Mail_Message_File
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getMessage($id)
+ {
+ // TODO that's ugly, would be better to let the message class decide
+ if (strtolower($this->_messageClass) == 'zend_mail_message_file' || is_subclass_of($this->_messageClass, 'zend_mail_message_file')) {
+ // TODO top/body lines
+ $messagePos = $this->_getPos($id);
+ return new $this->_messageClass(array('file' => $this->_fh, 'startPos' => $messagePos['start'],
+ 'endPos' => $messagePos['end']));
+ }
+
+ $bodyLines = 0; // TODO: need a way to change that
+
+ $message = $this->getRawHeader($id);
+ // file pointer is after headers now
+ if ($bodyLines) {
+ $message .= "\n";
+ while ($bodyLines-- && ftell($this->_fh) < $this->_positions[$id - 1]['end']) {
+ $message .= fgets($this->_fh);
+ }
+ }
+
+ return new $this->_messageClass(array('handler' => $this, 'id' => $id, 'headers' => $message));
+ }
+
+ /*
+ * Get raw header of message or part
+ *
+ * @param int $id number of message
+ * @param null|array|string $part path to part or null for messsage header
+ * @param int $topLines include this many lines with header (after an empty line)
+ * @return string raw header
+ * @throws Zend_Mail_Protocol_Exception
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getRawHeader($id, $part = null, $topLines = 0)
+ {
+ if ($part !== null) {
+ // TODO: implement
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('not implemented');
+ }
+ $messagePos = $this->_getPos($id);
+ // TODO: toplines
+ return stream_get_contents($this->_fh, $messagePos['separator'] - $messagePos['start'], $messagePos['start']);
+ }
+
+ /*
+ * Get raw content of message or part
+ *
+ * @param int $id number of message
+ * @param null|array|string $part path to part or null for messsage content
+ * @return string raw content
+ * @throws Zend_Mail_Protocol_Exception
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getRawContent($id, $part = null)
+ {
+ if ($part !== null) {
+ // TODO: implement
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('not implemented');
+ }
+ $messagePos = $this->_getPos($id);
+ return stream_get_contents($this->_fh, $messagePos['end'] - $messagePos['separator'], $messagePos['separator']);
+ }
+
+ /**
+ * Create instance with parameters
+ * Supported parameters are:
+ * - filename filename of mbox file
+ *
+ * @param array $params mail reader specific parameters
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function __construct($params)
+ {
+ if (is_array($params)) {
+ $params = (object)$params;
+ }
+
+ if (!isset($params->filename) /* || Zend_Loader::isReadable($params['filename']) */) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('no valid filename given in params');
+ }
+
+ $this->_openMboxFile($params->filename);
+ $this->_has['top'] = true;
+ $this->_has['uniqueid'] = false;
+ }
+
+ /**
+ * check if given file is a mbox file
+ *
+ * if $file is a resource its file pointer is moved after the first line
+ *
+ * @param resource|string $file stream resource of name of file
+ * @param bool $fileIsString file is string or resource
+ * @return bool file is mbox file
+ */
+ protected function _isMboxFile($file, $fileIsString = true)
+ {
+ if ($fileIsString) {
+ $file = @fopen($file, 'r');
+ if (!$file) {
+ return false;
+ }
+ } else {
+ fseek($file, 0);
+ }
+
+ $result = false;
+
+ $line = fgets($file);
+ if (strpos($line, 'From ') === 0) {
+ $result = true;
+ }
+
+ if ($fileIsString) {
+ @fclose($file);
+ }
+
+ return $result;
+ }
+
+ /**
+ * open given file as current mbox file
+ *
+ * @param string $filename filename of mbox file
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ protected function _openMboxFile($filename)
+ {
+ if ($this->_fh) {
+ $this->close();
+ }
+
+ $this->_fh = @fopen($filename, 'r');
+ if (!$this->_fh) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('cannot open mbox file');
+ }
+ $this->_filename = $filename;
+ $this->_filemtime = filemtime($this->_filename);
+
+ if (!$this->_isMboxFile($this->_fh, false)) {
+ @fclose($this->_fh);
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('file is not a valid mbox format');
+ }
+
+ $messagePos = array('start' => ftell($this->_fh), 'separator' => 0, 'end' => 0);
+ while (($line = fgets($this->_fh)) !== false) {
+ if (strpos($line, 'From ') === 0) {
+ $messagePos['end'] = ftell($this->_fh) - strlen($line) - 2; // + newline
+ if (!$messagePos['separator']) {
+ $messagePos['separator'] = $messagePos['end'];
+ }
+ $this->_positions[] = $messagePos;
+ $messagePos = array('start' => ftell($this->_fh), 'separator' => 0, 'end' => 0);
+ }
+ if (!$messagePos['separator'] && !trim($line)) {
+ $messagePos['separator'] = ftell($this->_fh);
+ }
+ }
+
+ $messagePos['end'] = ftell($this->_fh);
+ if (!$messagePos['separator']) {
+ $messagePos['separator'] = $messagePos['end'];
+ }
+ $this->_positions[] = $messagePos;
+ }
+
+ /**
+ * Close resource for mail lib. If you need to control, when the resource
+ * is closed. Otherwise the destructor would call this.
+ *
+ * @return void
+ */
+ public function close()
+ {
+ @fclose($this->_fh);
+ $this->_positions = array();
+ }
+
+
+ /**
+ * Waste some CPU cycles doing nothing.
+ *
+ * @return void
+ */
+ public function noop()
+ {
+ return true;
+ }
+
+
+ /**
+ * stub for not supported message deletion
+ *
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function removeMessage($id)
+ {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('mbox is read-only');
+ }
+
+ /**
+ * get unique id for one or all messages
+ *
+ * Mbox does not support unique ids (yet) - it's always the same as the message number.
+ * That shouldn't be a problem, because we can't change mbox files. Therefor the message
+ * number is save enough.
+ *
+ * @param int|null $id message number
+ * @return array|string message number for given message or all messages as array
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getUniqueId($id = null)
+ {
+ if ($id) {
+ // check if id exists
+ $this->_getPos($id);
+ return $id;
+ }
+
+ $range = range(1, $this->countMessages());
+ return array_combine($range, $range);
+ }
+
+ /**
+ * get a message number from a unique id
+ *
+ * I.e. if you have a webmailer that supports deleting messages you should use unique ids
+ * as parameter and use this method to translate it to message number right before calling removeMessage()
+ *
+ * @param string $id unique id
+ * @return int message number
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getNumberByUniqueId($id)
+ {
+ // check if id exists
+ $this->_getPos($id);
+ return $id;
+ }
+
+ /**
+ * magic method for serialize()
+ *
+ * with this method you can cache the mbox class
+ *
+ * @return array name of variables
+ */
+ public function __sleep()
+ {
+ return array('_filename', '_positions', '_filemtime');
+ }
+
+ /**
+ * magic method for unserialize()
+ *
+ * with this method you can cache the mbox class
+ * for cache validation the mtime of the mbox file is used
+ *
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function __wakeup()
+ {
+ if ($this->_filemtime != @filemtime($this->_filename)) {
+ $this->close();
+ $this->_openMboxFile($this->_filename);
+ } else {
+ $this->_fh = @fopen($this->_filename, 'r');
+ if (!$this->_fh) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('cannot open mbox file');
+ }
+ }
+ }
+
+}
diff --git a/library/vendor/Zend/Mail/Storage/Pop3.php b/library/vendor/Zend/Mail/Storage/Pop3.php
new file mode 100644
index 0000000..5da6974
--- /dev/null
+++ b/library/vendor/Zend/Mail/Storage/Pop3.php
@@ -0,0 +1,321 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Mail_Storage_Abstract
+ */
+
+/**
+ * @see Zend_Mail_Protocol_Pop3
+ */
+
+/**
+ * @see Zend_Mail_Message
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Storage_Pop3 extends Zend_Mail_Storage_Abstract
+{
+ /**
+ * protocol handler
+ * @var null|Zend_Mail_Protocol_Pop3
+ */
+ protected $_protocol;
+
+
+ /**
+ * Count messages all messages in current box
+ *
+ * @return int number of messages
+ * @throws Zend_Mail_Storage_Exception
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function countMessages()
+ {
+ $this->_protocol->status($count, $null);
+ return (int)$count;
+ }
+
+ /**
+ * get a list of messages with number and size
+ *
+ * @param int $id number of message
+ * @return int|array size of given message of list with all messages as array(num => size)
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function getSize($id = 0)
+ {
+ $id = $id ? $id : null;
+ return $this->_protocol->getList($id);
+ }
+
+ /**
+ * Fetch a message
+ *
+ * @param int $id number of message
+ * @return Zend_Mail_Message
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function getMessage($id)
+ {
+ $bodyLines = 0;
+ $message = $this->_protocol->top($id, $bodyLines, true);
+
+ return new $this->_messageClass(array('handler' => $this, 'id' => $id, 'headers' => $message,
+ 'noToplines' => $bodyLines < 1));
+ }
+
+ /*
+ * Get raw header of message or part
+ *
+ * @param int $id number of message
+ * @param null|array|string $part path to part or null for messsage header
+ * @param int $topLines include this many lines with header (after an empty line)
+ * @return string raw header
+ * @throws Zend_Mail_Protocol_Exception
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getRawHeader($id, $part = null, $topLines = 0)
+ {
+ if ($part !== null) {
+ // TODO: implement
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('not implemented');
+ }
+
+ return $this->_protocol->top($id, 0, true);
+ }
+
+ /*
+ * Get raw content of message or part
+ *
+ * @param int $id number of message
+ * @param null|array|string $part path to part or null for messsage content
+ * @return string raw content
+ * @throws Zend_Mail_Protocol_Exception
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getRawContent($id, $part = null)
+ {
+ if ($part !== null) {
+ // TODO: implement
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('not implemented');
+ }
+
+ $content = $this->_protocol->retrieve($id);
+ // TODO: find a way to avoid decoding the headers
+ Zend_Mime_Decode::splitMessage($content, $null, $body);
+ return $body;
+ }
+
+ /**
+ * create instance with parameters
+ * Supported paramters are
+ * - host hostname or ip address of POP3 server
+ * - user username
+ * - password password for user 'username' [optional, default = '']
+ * - port port for POP3 server [optional, default = 110]
+ * - ssl 'SSL' or 'TLS' for secure sockets
+ *
+ * @param array $params mail reader specific parameters
+ * @throws Zend_Mail_Storage_Exception
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function __construct($params)
+ {
+ if (is_array($params)) {
+ $params = (object)$params;
+ }
+
+ $this->_has['fetchPart'] = false;
+ $this->_has['top'] = null;
+ $this->_has['uniqueid'] = null;
+
+ if ($params instanceof Zend_Mail_Protocol_Pop3) {
+ $this->_protocol = $params;
+ return;
+ }
+
+ if (!isset($params->user)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('need at least user in params');
+ }
+
+ $host = isset($params->host) ? $params->host : 'localhost';
+ $password = isset($params->password) ? $params->password : '';
+ $port = isset($params->port) ? $params->port : null;
+ $ssl = isset($params->ssl) ? $params->ssl : false;
+
+ $this->_protocol = new Zend_Mail_Protocol_Pop3();
+ $this->_protocol->connect($host, $port, $ssl);
+ $this->_protocol->login($params->user, $password);
+ }
+
+ /**
+ * Close resource for mail lib. If you need to control, when the resource
+ * is closed. Otherwise the destructor would call this.
+ *
+ * @return null
+ */
+ public function close()
+ {
+ $this->_protocol->logout();
+ }
+
+ /**
+ * Keep the server busy.
+ *
+ * @return null
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function noop()
+ {
+ return $this->_protocol->noop();
+ }
+
+ /**
+ * Remove a message from server. If you're doing that from a web enviroment
+ * you should be careful and use a uniqueid as parameter if possible to
+ * identify the message.
+ *
+ * @param int $id number of message
+ * @return null
+ * @throws Zend_Mail_Protocol_Exception
+ */
+ public function removeMessage($id)
+ {
+ $this->_protocol->delete($id);
+ }
+
+ /**
+ * get unique id for one or all messages
+ *
+ * if storage does not support unique ids it's the same as the message number
+ *
+ * @param int|null $id message number
+ * @return array|string message number for given message or all messages as array
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getUniqueId($id = null)
+ {
+ if (!$this->hasUniqueid) {
+ if ($id) {
+ return $id;
+ }
+ $count = $this->countMessages();
+ if ($count < 1) {
+ return array();
+ }
+ $range = range(1, $count);
+ return array_combine($range, $range);
+ }
+
+ return $this->_protocol->uniqueid($id);
+ }
+
+ /**
+ * get a message number from a unique id
+ *
+ * I.e. if you have a webmailer that supports deleting messages you should use unique ids
+ * as parameter and use this method to translate it to message number right before calling removeMessage()
+ *
+ * @param string $id unique id
+ * @return int message number
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function getNumberByUniqueId($id)
+ {
+ if (!$this->hasUniqueid) {
+ return $id;
+ }
+
+ $ids = $this->getUniqueId();
+ foreach ($ids as $k => $v) {
+ if ($v == $id) {
+ return $k;
+ }
+ }
+
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('unique id not found');
+ }
+
+ /**
+ * Special handling for hasTop and hasUniqueid. The headers of the first message is
+ * retrieved if Top wasn't needed/tried yet.
+ *
+ * @see Zend_Mail_Storage_Abstract:__get()
+ * @param string $var
+ * @return string
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function __get($var)
+ {
+ $result = parent::__get($var);
+ if ($result !== null) {
+ return $result;
+ }
+
+ if (strtolower($var) == 'hastop') {
+ if ($this->_protocol->hasTop === null) {
+ // need to make a real call, because not all server are honest in their capas
+ try {
+ $this->_protocol->top(1, 0, false);
+ } catch(Zend_Mail_Exception $e) {
+ // ignoring error
+ }
+ }
+ $this->_has['top'] = $this->_protocol->hasTop;
+ return $this->_protocol->hasTop;
+ }
+
+ if (strtolower($var) == 'hasuniqueid') {
+ $id = null;
+ try {
+ $id = $this->_protocol->uniqueid(1);
+ } catch(Zend_Mail_Exception $e) {
+ // ignoring error
+ }
+ $this->_has['uniqueid'] = $id ? true : false;
+ return $this->_has['uniqueid'];
+ }
+
+ return $result;
+ }
+}
diff --git a/library/vendor/Zend/Mail/Storage/Writable/Interface.php b/library/vendor/Zend/Mail/Storage/Writable/Interface.php
new file mode 100644
index 0000000..aad8e5e
--- /dev/null
+++ b/library/vendor/Zend/Mail/Storage/Writable/Interface.php
@@ -0,0 +1,108 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+interface Zend_Mail_Storage_Writable_Interface
+{
+ /**
+ * create a new folder
+ *
+ * This method also creates parent folders if necessary. Some mail storages may restrict, which folder
+ * may be used as parent or which chars may be used in the folder name
+ *
+ * @param string $name global name of folder, local name if $parentFolder is set
+ * @param string|Zend_Mail_Storage_Folder $parentFolder parent folder for new folder, else root folder is parent
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function createFolder($name, $parentFolder = null);
+
+ /**
+ * remove a folder
+ *
+ * @param string|Zend_Mail_Storage_Folder $name name or instance of folder
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function removeFolder($name);
+
+ /**
+ * rename and/or move folder
+ *
+ * The new name has the same restrictions as in createFolder()
+ *
+ * @param string|Zend_Mail_Storage_Folder $oldName name or instance of folder
+ * @param string $newName new global name of folder
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function renameFolder($oldName, $newName);
+
+ /**
+ * append a new message to mail storage
+ *
+ * @param string|Zend_Mail_Message|Zend_Mime_Message $message message as string or instance of message class
+ * @param null|string|Zend_Mail_Storage_Folder $folder folder for new message, else current folder is taken
+ * @param null|array $flags set flags for new message, else a default set is used
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function appendMessage($message, $folder = null, $flags = null);
+
+ /**
+ * copy an existing message
+ *
+ * @param int $id number of message
+ * @param string|Zend_Mail_Storage_Folder $folder name or instance of targer folder
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function copyMessage($id, $folder);
+
+ /**
+ * move an existing message
+ *
+ * @param int $id number of message
+ * @param string|Zend_Mail_Storage_Folder $folder name or instance of targer folder
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function moveMessage($id, $folder);
+
+ /**
+ * set flags for message
+ *
+ * NOTE: this method can't set the recent flag.
+ *
+ * @param int $id number of message
+ * @param array $flags new flags for message
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function setFlags($id, $flags);
+}
diff --git a/library/vendor/Zend/Mail/Storage/Writable/Maildir.php b/library/vendor/Zend/Mail/Storage/Writable/Maildir.php
new file mode 100644
index 0000000..e4f468e
--- /dev/null
+++ b/library/vendor/Zend/Mail/Storage/Writable/Maildir.php
@@ -0,0 +1,1014 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Mail_Storage_Folder_Maildir
+ */
+
+/**
+ * @see Zend_Mail_Storage_Writable_Interface
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Storage
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Storage_Writable_Maildir extends Zend_Mail_Storage_Folder_Maildir
+ implements Zend_Mail_Storage_Writable_Interface
+{
+ // TODO: init maildir (+ constructor option create if not found)
+
+ /**
+ * use quota and size of quota if given
+ * @var bool|int
+ */
+ protected $_quota;
+
+ /**
+ * create a new maildir
+ *
+ * If the given dir is already a valid maildir this will not fail.
+ *
+ * @param string $dir directory for the new maildir (may already exist)
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public static function initMaildir($dir)
+ {
+ if (file_exists($dir)) {
+ if (!is_dir($dir)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('maildir must be a directory if already exists');
+ }
+ } else {
+ if (!mkdir($dir)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ $dir = dirname($dir);
+ if (!file_exists($dir)) {
+ throw new Zend_Mail_Storage_Exception("parent $dir not found");
+ } else if (!is_dir($dir)) {
+ throw new Zend_Mail_Storage_Exception("parent $dir not a directory");
+ } else {
+ throw new Zend_Mail_Storage_Exception('cannot create maildir');
+ }
+ }
+ }
+
+ foreach (array('cur', 'tmp', 'new') as $subdir) {
+ if (!@mkdir($dir . DIRECTORY_SEPARATOR . $subdir)) {
+ // ignore if dir exists (i.e. was already valid maildir or two processes try to create one)
+ if (!file_exists($dir . DIRECTORY_SEPARATOR . $subdir)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('could not create subdir ' . $subdir);
+ }
+ }
+ }
+ }
+
+ /**
+ * Create instance with parameters
+ * Additional parameters are (see parent for more):
+ * - create if true a new maildir is create if none exists
+ *
+ * @param array $params mail reader specific parameters
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function __construct($params) {
+ if (is_array($params)) {
+ $params = (object)$params;
+ }
+
+ if (!empty($params->create) && isset($params->dirname) && !file_exists($params->dirname . DIRECTORY_SEPARATOR . 'cur')) {
+ self::initMaildir($params->dirname);
+ }
+
+ parent::__construct($params);
+ }
+
+ /**
+ * create a new folder
+ *
+ * This method also creates parent folders if necessary. Some mail storages may restrict, which folder
+ * may be used as parent or which chars may be used in the folder name
+ *
+ * @param string $name global name of folder, local name if $parentFolder is set
+ * @param string|Zend_Mail_Storage_Folder $parentFolder parent folder for new folder, else root folder is parent
+ * @return string only used internally (new created maildir)
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function createFolder($name, $parentFolder = null)
+ {
+ if ($parentFolder instanceof Zend_Mail_Storage_Folder) {
+ $folder = $parentFolder->getGlobalName() . $this->_delim . $name;
+ } else if ($parentFolder != null) {
+ $folder = rtrim($parentFolder, $this->_delim) . $this->_delim . $name;
+ } else {
+ $folder = $name;
+ }
+
+ $folder = trim($folder, $this->_delim);
+
+ // first we check if we try to create a folder that does exist
+ $exists = null;
+ try {
+ $exists = $this->getFolders($folder);
+ } catch (Zend_Mail_Exception $e) {
+ // ok
+ }
+ if ($exists) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('folder already exists');
+ }
+
+ if (strpos($folder, $this->_delim . $this->_delim) !== false) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('invalid name - folder parts may not be empty');
+ }
+
+ if (strpos($folder, 'INBOX' . $this->_delim) === 0) {
+ $folder = substr($folder, 6);
+ }
+
+ $fulldir = $this->_rootdir . '.' . $folder;
+
+ // check if we got tricked and would create a dir outside of the rootdir or not as direct child
+ if (strpos($folder, DIRECTORY_SEPARATOR) !== false || strpos($folder, '/') !== false
+ || dirname($fulldir) . DIRECTORY_SEPARATOR != $this->_rootdir) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('invalid name - no directory seprator allowed in folder name');
+ }
+
+ // has a parent folder?
+ $parent = null;
+ if (strpos($folder, $this->_delim)) {
+ // let's see if the parent folder exists
+ $parent = substr($folder, 0, strrpos($folder, $this->_delim));
+ try {
+ $this->getFolders($parent);
+ } catch (Zend_Mail_Exception $e) {
+ // does not - create parent folder
+ $this->createFolder($parent);
+ }
+ }
+
+ if (!@mkdir($fulldir) || !@mkdir($fulldir . DIRECTORY_SEPARATOR . 'cur')) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('error while creating new folder, may be created incompletly');
+ }
+
+ mkdir($fulldir . DIRECTORY_SEPARATOR . 'new');
+ mkdir($fulldir . DIRECTORY_SEPARATOR . 'tmp');
+
+ $localName = $parent ? substr($folder, strlen($parent) + 1) : $folder;
+ $this->getFolders($parent)->$localName = new Zend_Mail_Storage_Folder($localName, $folder, true);
+
+ return $fulldir;
+ }
+
+ /**
+ * remove a folder
+ *
+ * @param string|Zend_Mail_Storage_Folder $name name or instance of folder
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function removeFolder($name)
+ {
+ // TODO: This could fail in the middle of the task, which is not optimal.
+ // But there is no defined standard way to mark a folder as removed and there is no atomar fs-op
+ // to remove a directory. Also moving the folder to a/the trash folder is not possible, as
+ // all parent folders must be created. What we could do is add a dash to the front of the
+ // directory name and it should be ignored as long as other processes obey the standard.
+
+ if ($name instanceof Zend_Mail_Storage_Folder) {
+ $name = $name->getGlobalName();
+ }
+
+ $name = trim($name, $this->_delim);
+ if (strpos($name, 'INBOX' . $this->_delim) === 0) {
+ $name = substr($name, 6);
+ }
+
+ // check if folder exists and has no children
+ if (!$this->getFolders($name)->isLeaf()) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('delete children first');
+ }
+
+ if ($name == 'INBOX' || $name == DIRECTORY_SEPARATOR || $name == '/') {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('wont delete INBOX');
+ }
+
+ if ($name == $this->getCurrentFolder()) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('wont delete selected folder');
+ }
+
+ foreach (array('tmp', 'new', 'cur', '.') as $subdir) {
+ $dir = $this->_rootdir . '.' . $name . DIRECTORY_SEPARATOR . $subdir;
+ if (!file_exists($dir)) {
+ continue;
+ }
+ $dh = opendir($dir);
+ if (!$dh) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception("error opening $subdir");
+ }
+ while (($entry = readdir($dh)) !== false) {
+ if ($entry == '.' || $entry == '..') {
+ continue;
+ }
+ if (!unlink($dir . DIRECTORY_SEPARATOR . $entry)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception("error cleaning $subdir");
+ }
+ }
+ closedir($dh);
+ if ($subdir !== '.') {
+ if (!rmdir($dir)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception("error removing $subdir");
+ }
+ }
+ }
+
+ if (!rmdir($this->_rootdir . '.' . $name)) {
+ // at least we should try to make it a valid maildir again
+ mkdir($this->_rootdir . '.' . $name . DIRECTORY_SEPARATOR . 'cur');
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception("error removing maindir");
+ }
+
+ $parent = strpos($name, $this->_delim) ? substr($name, 0, strrpos($name, $this->_delim)) : null;
+ $localName = $parent ? substr($name, strlen($parent) + 1) : $name;
+ unset($this->getFolders($parent)->$localName);
+ }
+
+ /**
+ * rename and/or move folder
+ *
+ * The new name has the same restrictions as in createFolder()
+ *
+ * @param string|Zend_Mail_Storage_Folder $oldName name or instance of folder
+ * @param string $newName new global name of folder
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function renameFolder($oldName, $newName)
+ {
+ // TODO: This is also not atomar and has similar problems as removeFolder()
+
+ if ($oldName instanceof Zend_Mail_Storage_Folder) {
+ $oldName = $oldName->getGlobalName();
+ }
+
+ $oldName = trim($oldName, $this->_delim);
+ if (strpos($oldName, 'INBOX' . $this->_delim) === 0) {
+ $oldName = substr($oldName, 6);
+ }
+
+ $newName = trim($newName, $this->_delim);
+ if (strpos($newName, 'INBOX' . $this->_delim) === 0) {
+ $newName = substr($newName, 6);
+ }
+
+ if (strpos($newName, $oldName . $this->_delim) === 0) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('new folder cannot be a child of old folder');
+ }
+
+ // check if folder exists and has no children
+ $folder = $this->getFolders($oldName);
+
+ if ($oldName == 'INBOX' || $oldName == DIRECTORY_SEPARATOR || $oldName == '/') {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('wont rename INBOX');
+ }
+
+ if ($oldName == $this->getCurrentFolder()) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('wont rename selected folder');
+ }
+
+ $newdir = $this->createFolder($newName);
+
+ if (!$folder->isLeaf()) {
+ foreach ($folder as $k => $v) {
+ $this->renameFolder($v->getGlobalName(), $newName . $this->_delim . $k);
+ }
+ }
+
+ $olddir = $this->_rootdir . '.' . $folder;
+ foreach (array('tmp', 'new', 'cur') as $subdir) {
+ $subdir = DIRECTORY_SEPARATOR . $subdir;
+ if (!file_exists($olddir . $subdir)) {
+ continue;
+ }
+ // using copy or moving files would be even better - but also much slower
+ if (!rename($olddir . $subdir, $newdir . $subdir)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('error while moving ' . $subdir);
+ }
+ }
+ // create a dummy if removing fails - otherwise we can't read it next time
+ mkdir($olddir . DIRECTORY_SEPARATOR . 'cur');
+ $this->removeFolder($oldName);
+ }
+
+ /**
+ * create a uniqueid for maildir filename
+ *
+ * This is nearly the format defined in the maildir standard. The microtime() call should already
+ * create a uniqueid, the pid is for multicore/-cpu machine that manage to call this function at the
+ * exact same time, and uname() gives us the hostname for multiple machines accessing the same storage.
+ *
+ * If someone disables posix we create a random number of the same size, so this method should also
+ * work on Windows - if you manage to get maildir working on Windows.
+ * Microtime could also be disabled, altough I've never seen it.
+ *
+ * @return string new uniqueid
+ */
+ protected function _createUniqueId()
+ {
+ $id = '';
+ $id .= function_exists('microtime') ? microtime(true) : (time() . ' ' . rand(0, 100000));
+ $id .= '.' . (function_exists('posix_getpid') ? posix_getpid() : rand(50, 65535));
+ $id .= '.' . php_uname('n');
+
+ return $id;
+ }
+
+ /**
+ * open a temporary maildir file
+ *
+ * makes sure tmp/ exists and create a file with a unique name
+ * you should close the returned filehandle!
+ *
+ * @param string $folder name of current folder without leading .
+ * @return array array('dirname' => dir of maildir folder, 'uniq' => unique id, 'filename' => name of create file
+ * 'handle' => file opened for writing)
+ * @throws Zend_Mail_Storage_Exception
+ */
+ protected function _createTmpFile($folder = 'INBOX')
+ {
+ if ($folder == 'INBOX') {
+ $tmpdir = $this->_rootdir . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR;
+ } else {
+ $tmpdir = $this->_rootdir . '.' . $folder . DIRECTORY_SEPARATOR . 'tmp' . DIRECTORY_SEPARATOR;
+ }
+ if (!file_exists($tmpdir)) {
+ if (!mkdir($tmpdir)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('problems creating tmp dir');
+ }
+ }
+
+ // we should retry to create a unique id if a file with the same name exists
+ // to avoid a script timeout we only wait 1 second (instead of 2) and stop
+ // after a defined retry count
+ // if you change this variable take into account that it can take up to $max_tries seconds
+ // normally we should have a valid unique name after the first try, we're just following the "standard" here
+ $max_tries = 5;
+ for ($i = 0; $i < $max_tries; ++$i) {
+ $uniq = $this->_createUniqueId();
+ if (!file_exists($tmpdir . $uniq)) {
+ // here is the race condition! - as defined in the standard
+ // to avoid having a long time between stat()ing the file and creating it we're opening it here
+ // to mark the filename as taken
+ $fh = fopen($tmpdir . $uniq, 'w');
+ if (!$fh) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('could not open temp file');
+ }
+ break;
+ }
+ sleep(1);
+ }
+
+ if (!$fh) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception("tried $max_tries unique ids for a temp file, but all were taken"
+ . ' - giving up');
+ }
+
+ return array('dirname' => $this->_rootdir . '.' . $folder, 'uniq' => $uniq, 'filename' => $tmpdir . $uniq,
+ 'handle' => $fh);
+ }
+
+ /**
+ * create an info string for filenames with given flags
+ *
+ * @param array $flags wanted flags, with the reference you'll get the set flags with correct key (= char for flag)
+ * @return string info string for version 2 filenames including the leading colon
+ * @throws Zend_Mail_Storage_Exception
+ */
+ protected function _getInfoString(&$flags)
+ {
+ // accessing keys is easier, faster and it removes duplicated flags
+ $wanted_flags = array_flip($flags);
+ if (isset($wanted_flags[Zend_Mail_Storage::FLAG_RECENT])) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('recent flag may not be set');
+ }
+
+ $info = ':2,';
+ $flags = array();
+ foreach (Zend_Mail_Storage_Maildir::$_knownFlags as $char => $flag) {
+ if (!isset($wanted_flags[$flag])) {
+ continue;
+ }
+ $info .= $char;
+ $flags[$char] = $flag;
+ unset($wanted_flags[$flag]);
+ }
+
+ if (!empty($wanted_flags)) {
+ $wanted_flags = implode(', ', array_keys($wanted_flags));
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('unknown flag(s): ' . $wanted_flags);
+ }
+
+ return $info;
+ }
+
+ /**
+ * append a new message to mail storage
+ *
+ * @param string|stream $message message as string or stream resource
+ * @param null|string|Zend_Mail_Storage_Folder $folder folder for new message, else current folder is taken
+ * @param null|array $flags set flags for new message, else a default set is used
+ * @param bool $recent handle this mail as if recent flag has been set,
+ * should only be used in delivery
+ * @throws Zend_Mail_Storage_Exception
+ */
+ // not yet * @param string|Zend_Mail_Message|Zend_Mime_Message $message message as string or instance of message class
+
+ public function appendMessage($message, $folder = null, $flags = null, $recent = false)
+ {
+ if ($this->_quota && $this->checkQuota()) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('storage is over quota!');
+ }
+
+ if ($folder === null) {
+ $folder = $this->_currentFolder;
+ }
+
+ if (!($folder instanceof Zend_Mail_Storage_Folder)) {
+ $folder = $this->getFolders($folder);
+ }
+
+ if ($flags === null) {
+ $flags = array(Zend_Mail_Storage::FLAG_SEEN);
+ }
+ $info = $this->_getInfoString($flags);
+ $temp_file = $this->_createTmpFile($folder->getGlobalName());
+
+ // TODO: handle class instances for $message
+ if (is_resource($message) && get_resource_type($message) == 'stream') {
+ stream_copy_to_stream($message, $temp_file['handle']);
+ } else {
+ fputs($temp_file['handle'], $message);
+ }
+ fclose($temp_file['handle']);
+
+ // we're adding the size to the filename for maildir++
+ $size = filesize($temp_file['filename']);
+ if ($size !== false) {
+ $info = ',S=' . $size . $info;
+ }
+ $new_filename = $temp_file['dirname'] . DIRECTORY_SEPARATOR;
+ $new_filename .= $recent ? 'new' : 'cur';
+ $new_filename .= DIRECTORY_SEPARATOR . $temp_file['uniq'] . $info;
+
+ // we're throwing any exception after removing our temp file and saving it to this variable instead
+ $exception = null;
+
+ if (!link($temp_file['filename'], $new_filename)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ $exception = new Zend_Mail_Storage_Exception('cannot link message file to final dir');
+ }
+ @unlink($temp_file['filename']);
+
+ if ($exception) {
+ throw $exception;
+ }
+
+ $this->_files[] = array('uniq' => $temp_file['uniq'],
+ 'flags' => $flags,
+ 'filename' => $new_filename);
+ if ($this->_quota) {
+ $this->_addQuotaEntry((int)$size, 1);
+ }
+ }
+
+ /**
+ * copy an existing message
+ *
+ * @param int $id number of message
+ * @param string|Zend_Mail_Storage_Folder $folder name or instance of targer folder
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function copyMessage($id, $folder)
+ {
+ if ($this->_quota && $this->checkQuota()) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('storage is over quota!');
+ }
+
+ if (!($folder instanceof Zend_Mail_Storage_Folder)) {
+ $folder = $this->getFolders($folder);
+ }
+
+ $filedata = $this->_getFileData($id);
+ $old_file = $filedata['filename'];
+ $flags = $filedata['flags'];
+
+ // copied message can't be recent
+ while (($key = array_search(Zend_Mail_Storage::FLAG_RECENT, $flags)) !== false) {
+ unset($flags[$key]);
+ }
+ $info = $this->_getInfoString($flags);
+
+ // we're creating the copy as temp file before moving to cur/
+ $temp_file = $this->_createTmpFile($folder->getGlobalName());
+ // we don't write directly to the file
+ fclose($temp_file['handle']);
+
+ // we're adding the size to the filename for maildir++
+ $size = filesize($old_file);
+ if ($size !== false) {
+ $info = ',S=' . $size . $info;
+ }
+
+ $new_file = $temp_file['dirname'] . DIRECTORY_SEPARATOR . 'cur' . DIRECTORY_SEPARATOR . $temp_file['uniq'] . $info;
+
+ // we're throwing any exception after removing our temp file and saving it to this variable instead
+ $exception = null;
+
+ if (!copy($old_file, $temp_file['filename'])) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ $exception = new Zend_Mail_Storage_Exception('cannot copy message file');
+ } else if (!link($temp_file['filename'], $new_file)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ $exception = new Zend_Mail_Storage_Exception('cannot link message file to final dir');
+ }
+ @unlink($temp_file['filename']);
+
+ if ($exception) {
+ throw $exception;
+ }
+
+ if ($folder->getGlobalName() == $this->_currentFolder
+ || ($this->_currentFolder == 'INBOX' && $folder->getGlobalName() == '/')) {
+ $this->_files[] = array('uniq' => $temp_file['uniq'],
+ 'flags' => $flags,
+ 'filename' => $new_file);
+ }
+
+ if ($this->_quota) {
+ $this->_addQuotaEntry((int)$size, 1);
+ }
+ }
+
+ /**
+ * move an existing message
+ *
+ * @param int $id number of message
+ * @param string|Zend_Mail_Storage_Folder $folder name or instance of targer folder
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function moveMessage($id, $folder) {
+ if (!($folder instanceof Zend_Mail_Storage_Folder)) {
+ $folder = $this->getFolders($folder);
+ }
+
+ if ($folder->getGlobalName() == $this->_currentFolder
+ || ($this->_currentFolder == 'INBOX' && $folder->getGlobalName() == '/')) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('target is current folder');
+ }
+
+ $filedata = $this->_getFileData($id);
+ $old_file = $filedata['filename'];
+ $flags = $filedata['flags'];
+
+ // moved message can't be recent
+ while (($key = array_search(Zend_Mail_Storage::FLAG_RECENT, $flags)) !== false) {
+ unset($flags[$key]);
+ }
+ $info = $this->_getInfoString($flags);
+
+ // reserving a new name
+ $temp_file = $this->_createTmpFile($folder->getGlobalName());
+ fclose($temp_file['handle']);
+
+ // we're adding the size to the filename for maildir++
+ $size = filesize($old_file);
+ if ($size !== false) {
+ $info = ',S=' . $size . $info;
+ }
+
+ $new_file = $temp_file['dirname'] . DIRECTORY_SEPARATOR . 'cur' . DIRECTORY_SEPARATOR . $temp_file['uniq'] . $info;
+
+ // we're throwing any exception after removing our temp file and saving it to this variable instead
+ $exception = null;
+
+ if (!rename($old_file, $new_file)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ $exception = new Zend_Mail_Storage_Exception('cannot move message file');
+ }
+ @unlink($temp_file['filename']);
+
+ if ($exception) {
+ throw $exception;
+ }
+
+ unset($this->_files[$id - 1]);
+ // remove the gap
+ $this->_files = array_values($this->_files);
+ }
+
+
+ /**
+ * set flags for message
+ *
+ * NOTE: this method can't set the recent flag.
+ *
+ * @param int $id number of message
+ * @param array $flags new flags for message
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function setFlags($id, $flags)
+ {
+ $info = $this->_getInfoString($flags);
+ $filedata = $this->_getFileData($id);
+
+ // NOTE: double dirname to make sure we always move to cur. if recent flag has been set (message is in new) it will be moved to cur.
+ $new_filename = dirname(dirname($filedata['filename'])) . DIRECTORY_SEPARATOR . 'cur' . DIRECTORY_SEPARATOR . "$filedata[uniq]$info";
+
+ if (!@rename($filedata['filename'], $new_filename)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('cannot rename file');
+ }
+
+ $filedata['flags'] = $flags;
+ $filedata['filename'] = $new_filename;
+
+ $this->_files[$id - 1] = $filedata;
+ }
+
+
+ /**
+ * stub for not supported message deletion
+ *
+ * @return null
+ * @throws Zend_Mail_Storage_Exception
+ */
+ public function removeMessage($id)
+ {
+ $filename = $this->_getFileData($id, 'filename');
+
+ if ($this->_quota) {
+ $size = filesize($filename);
+ }
+
+ if (!@unlink($filename)) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('cannot remove message');
+ }
+ unset($this->_files[$id - 1]);
+ // remove the gap
+ $this->_files = array_values($this->_files);
+ if ($this->_quota) {
+ $this->_addQuotaEntry(0 - (int)$size, -1);
+ }
+ }
+
+ /**
+ * enable/disable quota and set a quota value if wanted or needed
+ *
+ * You can enable/disable quota with true/false. If you don't have
+ * a MDA or want to enforce a quota value you can also set this value
+ * here. Use array('size' => SIZE_QUOTA, 'count' => MAX_MESSAGE) do
+ * define your quota. Order of these fields does matter!
+ *
+ * @param bool|array $value new quota value
+ * @return null
+ */
+ public function setQuota($value) {
+ $this->_quota = $value;
+ }
+
+ /**
+ * get currently set quota
+ *
+ * @see Zend_Mail_Storage_Writable_Maildir::setQuota()
+ *
+ * @return bool|array
+ */
+ public function getQuota($fromStorage = false) {
+ if ($fromStorage) {
+ $fh = @fopen($this->_rootdir . 'maildirsize', 'r');
+ if (!$fh) {
+ /**
+ * @see Zend_Mail_Storage_Exception
+ */
+ throw new Zend_Mail_Storage_Exception('cannot open maildirsize');
+ }
+ $definition = fgets($fh);
+ fclose($fh);
+ $definition = explode(',', trim($definition));
+ $quota = array();
+ foreach ($definition as $member) {
+ $key = $member[strlen($member) - 1];
+ if ($key == 'S' || $key == 'C') {
+ $key = $key == 'C' ? 'count' : 'size';
+ }
+ $quota[$key] = substr($member, 0, -1);
+ }
+ return $quota;
+ }
+
+ return $this->_quota;
+ }
+
+ /**
+ * @see http://www.inter7.com/courierimap/README.maildirquota.html "Calculating maildirsize"
+ */
+ protected function _calculateMaildirsize() {
+ $timestamps = array();
+ $messages = 0;
+ $total_size = 0;
+
+ if (is_array($this->_quota)) {
+ $quota = $this->_quota;
+ } else {
+ try {
+ $quota = $this->getQuota(true);
+ } catch (Zend_Mail_Storage_Exception $e) {
+ throw new Zend_Mail_Storage_Exception('no quota definition found', 0, $e);
+ }
+ }
+
+ $folders = new RecursiveIteratorIterator($this->getFolders(), RecursiveIteratorIterator::SELF_FIRST);
+ foreach ($folders as $folder) {
+ $subdir = $folder->getGlobalName();
+ if ($subdir == 'INBOX') {
+ $subdir = '';
+ } else {
+ $subdir = '.' . $subdir;
+ }
+ if ($subdir == 'Trash') {
+ continue;
+ }
+
+ foreach (array('cur', 'new') as $subsubdir) {
+ $dirname = $this->_rootdir . $subdir . DIRECTORY_SEPARATOR . $subsubdir . DIRECTORY_SEPARATOR;
+ if (!file_exists($dirname)) {
+ continue;
+ }
+ // NOTE: we are using mtime instead of "the latest timestamp". The latest would be atime
+ // and as we are accessing the directory it would make the whole calculation useless.
+ $timestamps[$dirname] = filemtime($dirname);
+
+ $dh = opendir($dirname);
+ // NOTE: Should have been checked in constructor. Not throwing an exception here, quotas will
+ // therefore not be fully enforeced, but next request will fail anyway, if problem persists.
+ if (!$dh) {
+ continue;
+ }
+
+
+ while (($entry = readdir()) !== false) {
+ if ($entry[0] == '.' || !is_file($dirname . $entry)) {
+ continue;
+ }
+
+ if (strpos($entry, ',S=')) {
+ strtok($entry, '=');
+ $filesize = strtok(':');
+ if (is_numeric($filesize)) {
+ $total_size += $filesize;
+ ++$messages;
+ continue;
+ }
+ }
+ $size = filesize($dirname . $entry);
+ if ($size === false) {
+ // ignore, as we assume file got removed
+ continue;
+ }
+ $total_size += $size;
+ ++$messages;
+ }
+ }
+ }
+
+ $tmp = $this->_createTmpFile();
+ $fh = $tmp['handle'];
+ $definition = array();
+ foreach ($quota as $type => $value) {
+ if ($type == 'size' || $type == 'count') {
+ $type = $type == 'count' ? 'C' : 'S';
+ }
+ $definition[] = $value . $type;
+ }
+ $definition = implode(',', $definition);
+ fputs($fh, "$definition\n");
+ fputs($fh, "$total_size $messages\n");
+ fclose($fh);
+ rename($tmp['filename'], $this->_rootdir . 'maildirsize');
+ foreach ($timestamps as $dir => $timestamp) {
+ if ($timestamp < filemtime($dir)) {
+ unlink($this->_rootdir . 'maildirsize');
+ break;
+ }
+ }
+
+ return array('size' => $total_size, 'count' => $messages, 'quota' => $quota);
+ }
+
+ /**
+ * @see http://www.inter7.com/courierimap/README.maildirquota.html "Calculating the quota for a Maildir++"
+ */
+ protected function _calculateQuota($forceRecalc = false) {
+ $fh = null;
+ $total_size = 0;
+ $messages = 0;
+ $maildirsize = '';
+ if (!$forceRecalc && file_exists($this->_rootdir . 'maildirsize') && filesize($this->_rootdir . 'maildirsize') < 5120) {
+ $fh = fopen($this->_rootdir . 'maildirsize', 'r');
+ }
+ if ($fh) {
+ $maildirsize = fread($fh, 5120);
+ if (strlen($maildirsize) >= 5120) {
+ fclose($fh);
+ $fh = null;
+ $maildirsize = '';
+ }
+ }
+ if (!$fh) {
+ $result = $this->_calculateMaildirsize();
+ $total_size = $result['size'];
+ $messages = $result['count'];
+ $quota = $result['quota'];
+ } else {
+ $maildirsize = explode("\n", $maildirsize);
+ if (is_array($this->_quota)) {
+ $quota = $this->_quota;
+ } else {
+ $definition = explode(',', $maildirsize[0]);
+ $quota = array();
+ foreach ($definition as $member) {
+ $key = $member[strlen($member) - 1];
+ if ($key == 'S' || $key == 'C') {
+ $key = $key == 'C' ? 'count' : 'size';
+ }
+ $quota[$key] = substr($member, 0, -1);
+ }
+ }
+ unset($maildirsize[0]);
+ foreach ($maildirsize as $line) {
+ list($size, $count) = explode(' ', trim($line));
+ $total_size += $size;
+ $messages += $count;
+ }
+ }
+
+ $over_quota = false;
+ $over_quota = $over_quota || (isset($quota['size']) && $total_size > $quota['size']);
+ $over_quota = $over_quota || (isset($quota['count']) && $messages > $quota['count']);
+ // NOTE: $maildirsize equals false if it wasn't set (AKA we recalculated) or it's only
+ // one line, because $maildirsize[0] gets unsetted.
+ // Also we're using local time to calculate the 15 minute offset. Touching a file just for known the
+ // local time of the file storage isn't worth the hassle.
+ if ($over_quota && ($maildirsize || filemtime($this->_rootdir . 'maildirsize') > time() - 900)) {
+ $result = $this->_calculateMaildirsize();
+ $total_size = $result['size'];
+ $messages = $result['count'];
+ $quota = $result['quota'];
+ $over_quota = false;
+ $over_quota = $over_quota || (isset($quota['size']) && $total_size > $quota['size']);
+ $over_quota = $over_quota || (isset($quota['count']) && $messages > $quota['count']);
+ }
+
+ if ($fh) {
+ // TODO is there a safe way to keep the handle open for writing?
+ fclose($fh);
+ }
+
+ return array('size' => $total_size, 'count' => $messages, 'quota' => $quota, 'over_quota' => $over_quota);
+ }
+
+ protected function _addQuotaEntry($size, $count = 1) {
+ if (!file_exists($this->_rootdir . 'maildirsize')) {
+ // TODO: should get file handler from _calculateQuota
+ }
+ $size = (int)$size;
+ $count = (int)$count;
+ file_put_contents($this->_rootdir . 'maildirsize', "$size $count\n", FILE_APPEND);
+ }
+
+ /**
+ * check if storage is currently over quota
+ *
+ * @param bool $detailedResponse return known data of quota and current size and message count @see _calculateQuota()
+ * @return bool|array over quota state or detailed response
+ */
+ public function checkQuota($detailedResponse = false, $forceRecalc = false) {
+ $result = $this->_calculateQuota($forceRecalc);
+ return $detailedResponse ? $result : $result['over_quota'];
+ }
+}
diff --git a/library/vendor/Zend/Mail/Transport/Abstract.php b/library/vendor/Zend/Mail/Transport/Abstract.php
new file mode 100644
index 0000000..3656060
--- /dev/null
+++ b/library/vendor/Zend/Mail/Transport/Abstract.php
@@ -0,0 +1,345 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Transport
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Mime
+ */
+
+
+/**
+ * Abstract for sending eMails through different
+ * ways of transport
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Transport
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Mail_Transport_Abstract
+{
+ /**
+ * Mail body
+ * @var string
+ * @access public
+ */
+ public $body = '';
+
+ /**
+ * MIME boundary
+ * @var string
+ * @access public
+ */
+ public $boundary = '';
+
+ /**
+ * Mail header string
+ * @var string
+ * @access public
+ */
+ public $header = '';
+
+ /**
+ * Array of message headers
+ * @var array
+ * @access protected
+ */
+ protected $_headers = array();
+
+ /**
+ * Message is a multipart message
+ * @var boolean
+ * @access protected
+ */
+ protected $_isMultipart = false;
+
+ /**
+ * Zend_Mail object
+ * @var false|Zend_Mail
+ * @access protected
+ */
+ protected $_mail = false;
+
+ /**
+ * Array of message parts
+ * @var array
+ * @access protected
+ */
+ protected $_parts = array();
+
+ /**
+ * Recipients string
+ * @var string
+ * @access public
+ */
+ public $recipients = '';
+
+ /**
+ * EOL character string used by transport
+ * @var string
+ * @access public
+ */
+ public $EOL = "\r\n";
+
+ /**
+ * Send an email independent from the used transport
+ *
+ * The requisite information for the email will be found in the following
+ * properties:
+ *
+ * - {@link $recipients} - list of recipients (string)
+ * - {@link $header} - message header
+ * - {@link $body} - message body
+ */
+ abstract protected function _sendMail();
+
+ /**
+ * Return all mail headers as an array
+ *
+ * If a boundary is given, a multipart header is generated with a
+ * Content-Type of either multipart/alternative or multipart/mixed depending
+ * on the mail parts present in the {@link $_mail Zend_Mail object} present.
+ *
+ * @param string $boundary
+ * @return array
+ */
+ protected function _getHeaders($boundary)
+ {
+ if (null !== $boundary) {
+ // Build multipart mail
+ $type = $this->_mail->getType();
+ if (!$type) {
+ if ($this->_mail->hasAttachments) {
+ $type = Zend_Mime::MULTIPART_MIXED;
+ } elseif ($this->_mail->getBodyText() && $this->_mail->getBodyHtml()) {
+ $type = Zend_Mime::MULTIPART_ALTERNATIVE;
+ } else {
+ $type = Zend_Mime::MULTIPART_MIXED;
+ }
+ }
+
+ $this->_headers['Content-Type'] = array(
+ $type . ';'
+ . $this->EOL
+ . " " . 'boundary="' . $boundary . '"'
+ );
+ $this->boundary = $boundary;
+ }
+
+ $this->_headers['MIME-Version'] = array('1.0');
+
+ return $this->_headers;
+ }
+
+ /**
+ * Prepend header name to header value
+ *
+ * @param string $item
+ * @param string $key
+ * @param string $prefix
+ * @static
+ * @access protected
+ * @return void
+ */
+ protected static function _formatHeader(&$item, $key, $prefix)
+ {
+ $item = $prefix . ': ' . $item;
+ }
+
+ /**
+ * Prepare header string for use in transport
+ *
+ * Prepares and generates {@link $header} based on the headers provided.
+ *
+ * @param mixed $headers
+ * @access protected
+ * @return void
+ * @throws Zend_Mail_Transport_Exception if any header lines exceed 998
+ * characters
+ */
+ protected function _prepareHeaders($headers)
+ {
+ if (!$this->_mail) {
+ /**
+ * @see Zend_Mail_Transport_Exception
+ */
+ throw new Zend_Mail_Transport_Exception('Missing Zend_Mail object in _mail property');
+ }
+
+ $this->header = '';
+
+ foreach ($headers as $header => $content) {
+ if (isset($content['append'])) {
+ unset($content['append']);
+ $value = implode(',' . $this->EOL . ' ', $content);
+ $this->header .= $header . ': ' . $value . $this->EOL;
+ } else {
+ array_walk($content, array(get_class($this), '_formatHeader'), $header);
+ $this->header .= implode($this->EOL, $content) . $this->EOL;
+ }
+ }
+
+ // Sanity check on headers -- should not be > 998 characters
+ $sane = true;
+ foreach (explode($this->EOL, $this->header) as $line) {
+ if (strlen(trim($line)) > 998) {
+ $sane = false;
+ break;
+ }
+ }
+ if (!$sane) {
+ /**
+ * @see Zend_Mail_Transport_Exception
+ */
+ throw new Zend_Mail_Exception('At least one mail header line is too long');
+ }
+ }
+
+ /**
+ * Generate MIME compliant message from the current configuration
+ *
+ * If both a text and HTML body are present, generates a
+ * multipart/alternative Zend_Mime_Part containing the headers and contents
+ * of each. Otherwise, uses whichever of the text or HTML parts present.
+ *
+ * The content part is then prepended to the list of Zend_Mime_Parts for
+ * this message.
+ *
+ * @return void
+ */
+ protected function _buildBody()
+ {
+ if (($text = $this->_mail->getBodyText())
+ && ($html = $this->_mail->getBodyHtml()))
+ {
+ // Generate unique boundary for multipart/alternative
+ $mime = new Zend_Mime(null);
+ $boundaryLine = $mime->boundaryLine($this->EOL);
+ $boundaryEnd = $mime->mimeEnd($this->EOL);
+
+ $text->disposition = false;
+ $html->disposition = false;
+
+ $body = $boundaryLine
+ . $text->getHeaders($this->EOL)
+ . $this->EOL
+ . $text->getContent($this->EOL)
+ . $this->EOL
+ . $boundaryLine
+ . $html->getHeaders($this->EOL)
+ . $this->EOL
+ . $html->getContent($this->EOL)
+ . $this->EOL
+ . $boundaryEnd;
+
+ $mp = new Zend_Mime_Part($body);
+ $mp->type = Zend_Mime::MULTIPART_ALTERNATIVE;
+ $mp->boundary = $mime->boundary();
+
+ $this->_isMultipart = true;
+
+ // Ensure first part contains text alternatives
+ array_unshift($this->_parts, $mp);
+
+ // Get headers
+ $this->_headers = $this->_mail->getHeaders();
+ return;
+ }
+
+ // If not multipart, then get the body
+ if (false !== ($body = $this->_mail->getBodyHtml())) {
+ array_unshift($this->_parts, $body);
+ } elseif (false !== ($body = $this->_mail->getBodyText())) {
+ array_unshift($this->_parts, $body);
+ }
+
+ if (!$body) {
+ /**
+ * @see Zend_Mail_Transport_Exception
+ */
+ throw new Zend_Mail_Transport_Exception('No body specified');
+ }
+
+ // Get headers
+ $this->_headers = $this->_mail->getHeaders();
+ $headers = $body->getHeadersArray($this->EOL);
+ foreach ($headers as $header) {
+ // Headers in Zend_Mime_Part are kept as arrays with two elements, a
+ // key and a value
+ $this->_headers[$header[0]] = array($header[1]);
+ }
+ }
+
+ /**
+ * Send a mail using this transport
+ *
+ * @param Zend_Mail $mail
+ * @access public
+ * @return void
+ * @throws Zend_Mail_Transport_Exception if mail is empty
+ */
+ public function send(Zend_Mail $mail)
+ {
+ $this->_isMultipart = false;
+ $this->_mail = $mail;
+ $this->_parts = $mail->getParts();
+ $mime = $mail->getMime();
+
+ // Build body content
+ $this->_buildBody();
+
+ // Determine number of parts and boundary
+ $count = count($this->_parts);
+ $boundary = null;
+ if ($count < 1) {
+ /**
+ * @see Zend_Mail_Transport_Exception
+ */
+ throw new Zend_Mail_Transport_Exception('Empty mail cannot be sent');
+ }
+
+ if ($count > 1) {
+ // Multipart message; create new MIME object and boundary
+ $mime = new Zend_Mime($this->_mail->getMimeBoundary());
+ $boundary = $mime->boundary();
+ } elseif ($this->_isMultipart) {
+ // multipart/alternative -- grab boundary
+ $boundary = $this->_parts[0]->boundary;
+ }
+
+ // Determine recipients, and prepare headers
+ $this->recipients = implode(',', $mail->getRecipients());
+ $this->_prepareHeaders($this->_getHeaders($boundary));
+
+ // Create message body
+ // This is done so that the same Zend_Mail object can be used in
+ // multiple transports
+ $message = new Zend_Mime_Message();
+ $message->setParts($this->_parts);
+ $message->setMime($mime);
+ $this->body = $message->generateMessage($this->EOL);
+
+ // Send to transport!
+ $this->_sendMail();
+ }
+}
diff --git a/library/vendor/Zend/Mail/Transport/Exception.php b/library/vendor/Zend/Mail/Transport/Exception.php
new file mode 100644
index 0000000..655a07e
--- /dev/null
+++ b/library/vendor/Zend/Mail/Transport/Exception.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Transport
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Mail_Exception
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Transport
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Transport_Exception extends Zend_Mail_Exception
+{}
+
diff --git a/library/vendor/Zend/Mail/Transport/File.php b/library/vendor/Zend/Mail/Transport/File.php
new file mode 100644
index 0000000..3584a89
--- /dev/null
+++ b/library/vendor/Zend/Mail/Transport/File.php
@@ -0,0 +1,131 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Transport
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Mail_Transport_Abstract
+ */
+
+
+/**
+ * File transport
+ *
+ * Class for saving outgoing emails in filesystem
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Transport
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Transport_File extends Zend_Mail_Transport_Abstract
+{
+ /**
+ * Target directory for saving sent email messages
+ *
+ * @var string
+ */
+ protected $_path;
+
+ /**
+ * Callback function generating a file name
+ *
+ * @var string|array
+ */
+ protected $_callback;
+
+ /**
+ * Constructor
+ *
+ * @param array|Zend_Config $options OPTIONAL (Default: null)
+ * @return void
+ */
+ public function __construct($options = null)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } elseif (!is_array($options)) {
+ $options = array();
+ }
+
+ // Making sure we have some defaults to work with
+ if (!isset($options['path'])) {
+ $options['path'] = sys_get_temp_dir();
+ }
+ if (!isset($options['callback'])) {
+ $options['callback'] = array($this, 'defaultCallback');
+ }
+
+ $this->setOptions($options);
+ }
+
+ /**
+ * Sets options
+ *
+ * @param array $options
+ * @return void
+ */
+ public function setOptions(array $options)
+ {
+ if (isset($options['path']) && is_dir($options['path'])) {
+ $this->_path = $options['path'];
+ }
+ if (isset($options['callback']) && is_callable($options['callback'])) {
+ $this->_callback = $options['callback'];
+ }
+ }
+
+ /**
+ * Saves e-mail message to a file
+ *
+ * @return void
+ * @throws Zend_Mail_Transport_Exception on not writable target directory
+ * @throws Zend_Mail_Transport_Exception on file_put_contents() failure
+ */
+ protected function _sendMail()
+ {
+ $file = $this->_path . DIRECTORY_SEPARATOR . call_user_func($this->_callback, $this);
+
+ if (!is_writable(dirname($file))) {
+ throw new Zend_Mail_Transport_Exception(sprintf(
+ 'Target directory "%s" does not exist or is not writable',
+ dirname($file)
+ ));
+ }
+
+ $email = $this->header . $this->EOL . $this->body;
+
+ if (!file_put_contents($file, $email)) {
+ throw new Zend_Mail_Transport_Exception('Unable to send mail');
+ }
+ }
+
+ /**
+ * Default callback for generating filenames
+ *
+ * @param Zend_Mail_Transport_File File transport instance
+ * @return string
+ */
+ public function defaultCallback($transport)
+ {
+ return 'ZendMail_' . $_SERVER['REQUEST_TIME'] . '_' . mt_rand() . '.tmp';
+ }
+}
diff --git a/library/vendor/Zend/Mail/Transport/Sendmail.php b/library/vendor/Zend/Mail/Transport/Sendmail.php
new file mode 100644
index 0000000..30d6011
--- /dev/null
+++ b/library/vendor/Zend/Mail/Transport/Sendmail.php
@@ -0,0 +1,214 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Transport
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Mail_Transport_Abstract
+ */
+
+
+/**
+ * Class for sending eMails via the PHP internal mail() function
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Transport
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Transport_Sendmail extends Zend_Mail_Transport_Abstract
+{
+ /**
+ * Subject
+ * @var string
+ * @access public
+ */
+ public $subject = null;
+
+
+ /**
+ * Config options for sendmail parameters
+ *
+ * @var string
+ */
+ public $parameters;
+
+ /**
+ * EOL character string
+ * @var string
+ * @access public
+ */
+ public $EOL = PHP_EOL;
+
+ /**
+ * error information
+ * @var string
+ */
+ protected $_errstr;
+
+ /**
+ * Constructor.
+ *
+ * @param string|array|Zend_Config $parameters OPTIONAL (Default: null)
+ * @return void
+ */
+ public function __construct($parameters = null)
+ {
+ if ($parameters instanceof Zend_Config) {
+ $parameters = $parameters->toArray();
+ }
+
+ if (is_array($parameters)) {
+ $parameters = implode(' ', $parameters);
+ }
+
+ $this->parameters = $parameters;
+ }
+
+
+ /**
+ * Send mail using PHP native mail()
+ *
+ * @access public
+ * @return void
+ * @throws Zend_Mail_Transport_Exception if parameters is set
+ * but not a string
+ * @throws Zend_Mail_Transport_Exception on mail() failure
+ */
+ public function _sendMail()
+ {
+ if ($this->parameters === null) {
+ set_error_handler(array($this, '_handleMailErrors'));
+ $result = mail(
+ $this->recipients,
+ $this->_mail->getSubject(),
+ $this->body,
+ $this->header);
+ restore_error_handler();
+ } else {
+ if(!is_string($this->parameters)) {
+ /**
+ * @see Zend_Mail_Transport_Exception
+ *
+ * Exception is thrown here because
+ * $parameters is a public property
+ */
+ throw new Zend_Mail_Transport_Exception(
+ 'Parameters were set but are not a string'
+ );
+ }
+
+ set_error_handler(array($this, '_handleMailErrors'));
+ $result = mail(
+ $this->recipients,
+ $this->_mail->getSubject(),
+ $this->body,
+ $this->header,
+ $this->parameters);
+ restore_error_handler();
+ }
+
+ if ($this->_errstr !== null || !$result) {
+ /**
+ * @see Zend_Mail_Transport_Exception
+ */
+ throw new Zend_Mail_Transport_Exception('Unable to send mail. ' . $this->_errstr);
+ }
+ }
+
+
+ /**
+ * Format and fix headers
+ *
+ * mail() uses its $to and $subject arguments to set the To: and Subject:
+ * headers, respectively. This method strips those out as a sanity check to
+ * prevent duplicate header entries.
+ *
+ * @access protected
+ * @param array $headers
+ * @return void
+ * @throws Zend_Mail_Transport_Exception
+ */
+ protected function _prepareHeaders($headers)
+ {
+ if (!$this->_mail) {
+ /**
+ * @see Zend_Mail_Transport_Exception
+ */
+ throw new Zend_Mail_Transport_Exception('_prepareHeaders requires a registered Zend_Mail object');
+ }
+
+ // mail() uses its $to parameter to set the To: header, and the $subject
+ // parameter to set the Subject: header. We need to strip them out.
+ if (0 === strpos(PHP_OS, 'WIN')) {
+ // If the current recipients list is empty, throw an error
+ if (empty($this->recipients)) {
+ /**
+ * @see Zend_Mail_Transport_Exception
+ */
+ throw new Zend_Mail_Transport_Exception('Missing To addresses');
+ }
+ } else {
+ // All others, simply grab the recipients and unset the To: header
+ if (!isset($headers['To'])) {
+ /**
+ * @see Zend_Mail_Transport_Exception
+ */
+ throw new Zend_Mail_Transport_Exception('Missing To header');
+ }
+
+ unset($headers['To']['append']);
+ $this->recipients = implode(',', $headers['To']);
+ }
+
+ // Remove recipient header
+ unset($headers['To']);
+
+ // Remove subject header, if present
+ if (isset($headers['Subject'])) {
+ unset($headers['Subject']);
+ }
+
+ // Prepare headers
+ parent::_prepareHeaders($headers);
+
+ // Fix issue with empty blank line ontop when using Sendmail Trnasport
+ $this->header = rtrim($this->header);
+ }
+
+ /**
+ * Temporary error handler for PHP native mail().
+ *
+ * @param int $errno
+ * @param string $errstr
+ * @param string $errfile
+ * @param string $errline
+ * @param array $errcontext
+ * @return true
+ */
+ public function _handleMailErrors($errno, $errstr, $errfile = null, $errline = null, array $errcontext = null)
+ {
+ $this->_errstr = $errstr;
+ return true;
+ }
+
+}
diff --git a/library/vendor/Zend/Mail/Transport/Smtp.php b/library/vendor/Zend/Mail/Transport/Smtp.php
new file mode 100644
index 0000000..b9c0ac9
--- /dev/null
+++ b/library/vendor/Zend/Mail/Transport/Smtp.php
@@ -0,0 +1,238 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Transport
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Mime
+ */
+
+/**
+ * @see Zend_Mail_Protocol_Smtp
+ */
+
+/**
+ * @see Zend_Mail_Transport_Abstract
+ */
+
+
+/**
+ * SMTP connection object
+ *
+ * Loads an instance of Zend_Mail_Protocol_Smtp and forwards smtp transactions
+ *
+ * @category Zend
+ * @package Zend_Mail
+ * @subpackage Transport
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mail_Transport_Smtp extends Zend_Mail_Transport_Abstract
+{
+ /**
+ * EOL character string used by transport
+ * @var string
+ * @access public
+ */
+ public $EOL = "\n";
+
+ /**
+ * Remote smtp hostname or i.p.
+ *
+ * @var string
+ */
+ protected $_host;
+
+
+ /**
+ * Port number
+ *
+ * @var integer|null
+ */
+ protected $_port;
+
+
+ /**
+ * Local client hostname or i.p.
+ *
+ * @var string
+ */
+ protected $_name = 'localhost';
+
+
+ /**
+ * Authentication type OPTIONAL
+ *
+ * @var string
+ */
+ protected $_auth;
+
+
+ /**
+ * Config options for authentication
+ *
+ * @var array
+ */
+ protected $_config;
+
+
+ /**
+ * Instance of Zend_Mail_Protocol_Smtp
+ *
+ * @var Zend_Mail_Protocol_Smtp
+ */
+ protected $_connection;
+
+
+ /**
+ * Constructor.
+ *
+ * @param string $host OPTIONAL (Default: 127.0.0.1)
+ * @param array|null $config OPTIONAL (Default: null)
+ * @return void
+ *
+ * @todo Someone please make this compatible
+ * with the SendMail transport class.
+ */
+ public function __construct($host = '127.0.0.1', Array $config = array())
+ {
+ if (isset($config['name'])) {
+ $this->_name = $config['name'];
+ }
+ if (isset($config['port'])) {
+ $this->_port = $config['port'];
+ }
+ if (isset($config['auth'])) {
+ $this->_auth = $config['auth'];
+ }
+
+ $this->_host = $host;
+ $this->_config = $config;
+ }
+
+
+ /**
+ * Class destructor to ensure all open connections are closed
+ *
+ * @return void
+ */
+ public function __destruct()
+ {
+ if ($this->_connection instanceof Zend_Mail_Protocol_Smtp) {
+ try {
+ $this->_connection->quit();
+ } catch (Zend_Mail_Protocol_Exception $e) {
+ // ignore
+ }
+ $this->_connection->disconnect();
+ }
+ }
+
+
+ /**
+ * Sets the connection protocol instance
+ *
+ * @param Zend_Mail_Protocol_Abstract $client
+ *
+ * @return void
+ */
+ public function setConnection(Zend_Mail_Protocol_Abstract $connection)
+ {
+ $this->_connection = $connection;
+ }
+
+
+ /**
+ * Gets the connection protocol instance
+ *
+ * @return Zend_Mail_Protocol|null
+ */
+ public function getConnection()
+ {
+ return $this->_connection;
+ }
+
+ /**
+ * Send an email via the SMTP connection protocol
+ *
+ * The connection via the protocol adapter is made just-in-time to allow a
+ * developer to add a custom adapter if required before mail is sent.
+ *
+ * @return void
+ * @todo Rename this to sendMail, it's a public method...
+ */
+ public function _sendMail()
+ {
+ // If sending multiple messages per session use existing adapter
+ if (!($this->_connection instanceof Zend_Mail_Protocol_Smtp)) {
+ // Check if authentication is required and determine required class
+ $connectionClass = 'Zend_Mail_Protocol_Smtp';
+ if ($this->_auth) {
+ $connectionClass .= '_Auth_' . ucwords($this->_auth);
+ }
+ if (!class_exists($connectionClass)) {
+ Zend_Loader::loadClass($connectionClass);
+ }
+ $this->setConnection(new $connectionClass($this->_host, $this->_port, $this->_config));
+ $this->_connection->connect();
+ $this->_connection->helo($this->_name);
+ } else {
+ // Reset connection to ensure reliable transaction
+ $this->_connection->rset();
+ }
+
+ // Set sender email address
+ $this->_connection->mail($this->_mail->getReturnPath());
+
+ // Set recipient forward paths
+ foreach ($this->_mail->getRecipients() as $recipient) {
+ $this->_connection->rcpt($recipient);
+ }
+
+ // Issue DATA command to client
+ $this->_connection->data($this->header . Zend_Mime::LINEEND . $this->body);
+ }
+
+ /**
+ * Format and fix headers
+ *
+ * Some SMTP servers do not strip BCC headers. Most clients do it themselves as do we.
+ *
+ * @access protected
+ * @param array $headers
+ * @return void
+ * @throws Zend_Transport_Exception
+ */
+ protected function _prepareHeaders($headers)
+ {
+ if (!$this->_mail) {
+ /**
+ * @see Zend_Mail_Transport_Exception
+ */
+ throw new Zend_Mail_Transport_Exception('_prepareHeaders requires a registered Zend_Mail object');
+ }
+
+ unset($headers['Bcc']);
+
+ // Prepare headers
+ parent::_prepareHeaders($headers);
+ }
+}
diff --git a/library/vendor/Zend/Mime.php b/library/vendor/Zend/Mime.php
new file mode 100644
index 0000000..5530b6c
--- /dev/null
+++ b/library/vendor/Zend/Mime.php
@@ -0,0 +1,670 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mime
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Support class for MultiPart Mime Messages
+ *
+ * @category Zend
+ * @package Zend_Mime
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mime
+{
+ const TYPE_OCTETSTREAM = 'application/octet-stream';
+ const TYPE_TEXT = 'text/plain';
+ const TYPE_HTML = 'text/html';
+ const ENCODING_7BIT = '7bit';
+ const ENCODING_8BIT = '8bit';
+ const ENCODING_QUOTEDPRINTABLE = 'quoted-printable';
+ const ENCODING_BASE64 = 'base64';
+ const DISPOSITION_ATTACHMENT = 'attachment';
+ const DISPOSITION_INLINE = 'inline';
+ const LINELENGTH = 72;
+ const LINEEND = "\n";
+ const MULTIPART_ALTERNATIVE = 'multipart/alternative';
+ const MULTIPART_MIXED = 'multipart/mixed';
+ const MULTIPART_RELATED = 'multipart/related';
+
+ /**
+ * Boundary
+ *
+ * @var null|string
+ */
+ protected $_boundary;
+
+ /**
+ * @var int
+ */
+ protected static $makeUnique = 0;
+
+ /**
+ * Lookup-Tables for QuotedPrintable
+ *
+ * @var array
+ */
+ public static $qpKeys = array(
+ "\x00",
+ "\x01",
+ "\x02",
+ "\x03",
+ "\x04",
+ "\x05",
+ "\x06",
+ "\x07",
+ "\x08",
+ "\x09",
+ "\x0A",
+ "\x0B",
+ "\x0C",
+ "\x0D",
+ "\x0E",
+ "\x0F",
+ "\x10",
+ "\x11",
+ "\x12",
+ "\x13",
+ "\x14",
+ "\x15",
+ "\x16",
+ "\x17",
+ "\x18",
+ "\x19",
+ "\x1A",
+ "\x1B",
+ "\x1C",
+ "\x1D",
+ "\x1E",
+ "\x1F",
+ "\x7F",
+ "\x80",
+ "\x81",
+ "\x82",
+ "\x83",
+ "\x84",
+ "\x85",
+ "\x86",
+ "\x87",
+ "\x88",
+ "\x89",
+ "\x8A",
+ "\x8B",
+ "\x8C",
+ "\x8D",
+ "\x8E",
+ "\x8F",
+ "\x90",
+ "\x91",
+ "\x92",
+ "\x93",
+ "\x94",
+ "\x95",
+ "\x96",
+ "\x97",
+ "\x98",
+ "\x99",
+ "\x9A",
+ "\x9B",
+ "\x9C",
+ "\x9D",
+ "\x9E",
+ "\x9F",
+ "\xA0",
+ "\xA1",
+ "\xA2",
+ "\xA3",
+ "\xA4",
+ "\xA5",
+ "\xA6",
+ "\xA7",
+ "\xA8",
+ "\xA9",
+ "\xAA",
+ "\xAB",
+ "\xAC",
+ "\xAD",
+ "\xAE",
+ "\xAF",
+ "\xB0",
+ "\xB1",
+ "\xB2",
+ "\xB3",
+ "\xB4",
+ "\xB5",
+ "\xB6",
+ "\xB7",
+ "\xB8",
+ "\xB9",
+ "\xBA",
+ "\xBB",
+ "\xBC",
+ "\xBD",
+ "\xBE",
+ "\xBF",
+ "\xC0",
+ "\xC1",
+ "\xC2",
+ "\xC3",
+ "\xC4",
+ "\xC5",
+ "\xC6",
+ "\xC7",
+ "\xC8",
+ "\xC9",
+ "\xCA",
+ "\xCB",
+ "\xCC",
+ "\xCD",
+ "\xCE",
+ "\xCF",
+ "\xD0",
+ "\xD1",
+ "\xD2",
+ "\xD3",
+ "\xD4",
+ "\xD5",
+ "\xD6",
+ "\xD7",
+ "\xD8",
+ "\xD9",
+ "\xDA",
+ "\xDB",
+ "\xDC",
+ "\xDD",
+ "\xDE",
+ "\xDF",
+ "\xE0",
+ "\xE1",
+ "\xE2",
+ "\xE3",
+ "\xE4",
+ "\xE5",
+ "\xE6",
+ "\xE7",
+ "\xE8",
+ "\xE9",
+ "\xEA",
+ "\xEB",
+ "\xEC",
+ "\xED",
+ "\xEE",
+ "\xEF",
+ "\xF0",
+ "\xF1",
+ "\xF2",
+ "\xF3",
+ "\xF4",
+ "\xF5",
+ "\xF6",
+ "\xF7",
+ "\xF8",
+ "\xF9",
+ "\xFA",
+ "\xFB",
+ "\xFC",
+ "\xFD",
+ "\xFE",
+ "\xFF"
+ );
+
+ /**
+ * @var array
+ */
+ public static $qpReplaceValues = array(
+ "=00",
+ "=01",
+ "=02",
+ "=03",
+ "=04",
+ "=05",
+ "=06",
+ "=07",
+ "=08",
+ "=09",
+ "=0A",
+ "=0B",
+ "=0C",
+ "=0D",
+ "=0E",
+ "=0F",
+ "=10",
+ "=11",
+ "=12",
+ "=13",
+ "=14",
+ "=15",
+ "=16",
+ "=17",
+ "=18",
+ "=19",
+ "=1A",
+ "=1B",
+ "=1C",
+ "=1D",
+ "=1E",
+ "=1F",
+ "=7F",
+ "=80",
+ "=81",
+ "=82",
+ "=83",
+ "=84",
+ "=85",
+ "=86",
+ "=87",
+ "=88",
+ "=89",
+ "=8A",
+ "=8B",
+ "=8C",
+ "=8D",
+ "=8E",
+ "=8F",
+ "=90",
+ "=91",
+ "=92",
+ "=93",
+ "=94",
+ "=95",
+ "=96",
+ "=97",
+ "=98",
+ "=99",
+ "=9A",
+ "=9B",
+ "=9C",
+ "=9D",
+ "=9E",
+ "=9F",
+ "=A0",
+ "=A1",
+ "=A2",
+ "=A3",
+ "=A4",
+ "=A5",
+ "=A6",
+ "=A7",
+ "=A8",
+ "=A9",
+ "=AA",
+ "=AB",
+ "=AC",
+ "=AD",
+ "=AE",
+ "=AF",
+ "=B0",
+ "=B1",
+ "=B2",
+ "=B3",
+ "=B4",
+ "=B5",
+ "=B6",
+ "=B7",
+ "=B8",
+ "=B9",
+ "=BA",
+ "=BB",
+ "=BC",
+ "=BD",
+ "=BE",
+ "=BF",
+ "=C0",
+ "=C1",
+ "=C2",
+ "=C3",
+ "=C4",
+ "=C5",
+ "=C6",
+ "=C7",
+ "=C8",
+ "=C9",
+ "=CA",
+ "=CB",
+ "=CC",
+ "=CD",
+ "=CE",
+ "=CF",
+ "=D0",
+ "=D1",
+ "=D2",
+ "=D3",
+ "=D4",
+ "=D5",
+ "=D6",
+ "=D7",
+ "=D8",
+ "=D9",
+ "=DA",
+ "=DB",
+ "=DC",
+ "=DD",
+ "=DE",
+ "=DF",
+ "=E0",
+ "=E1",
+ "=E2",
+ "=E3",
+ "=E4",
+ "=E5",
+ "=E6",
+ "=E7",
+ "=E8",
+ "=E9",
+ "=EA",
+ "=EB",
+ "=EC",
+ "=ED",
+ "=EE",
+ "=EF",
+ "=F0",
+ "=F1",
+ "=F2",
+ "=F3",
+ "=F4",
+ "=F5",
+ "=F6",
+ "=F7",
+ "=F8",
+ "=F9",
+ "=FA",
+ "=FB",
+ "=FC",
+ "=FD",
+ "=FE",
+ "=FF"
+ );
+
+ /**
+ * @var string
+ */
+ public static $qpKeysString =
+ "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF";
+
+ /**
+ * Check if the given string is "printable"
+ *
+ * Checks that a string contains no unprintable characters. If this returns
+ * false, encode the string for secure delivery.
+ *
+ * @param string $str
+ * @return boolean
+ */
+ public static function isPrintable($str)
+ {
+ return (strcspn($str, self::$qpKeysString) == strlen($str));
+ }
+
+ /**
+ * Encode a given string with the QUOTED_PRINTABLE mechanism and wrap the lines.
+ *
+ * @param string $str
+ * @param int $lineLength Line length; defaults to {@link LINELENGTH}
+ * @param string $lineEnd Line end; defaults to {@link LINEEND}
+ * @return string
+ */
+ public static function encodeQuotedPrintable(
+ $str,
+ $lineLength = self::LINELENGTH,
+ $lineEnd = self::LINEEND
+ )
+ {
+ $out = '';
+ $str = self::_encodeQuotedPrintable($str);
+
+ // Split encoded text into separate lines
+ while (strlen($str) > 0) {
+ $ptr = strlen($str);
+ if ($ptr > $lineLength) {
+ $ptr = $lineLength;
+ }
+
+ // Ensure we are not splitting across an encoded character
+ $pos = strrpos(substr($str, 0, $ptr), '=');
+ if ($pos !== false && $pos >= $ptr - 2) {
+ $ptr = $pos;
+ }
+
+ // Check if there is a space at the end of the line and rewind
+ if ($ptr > 0 && $str[$ptr - 1] == ' ') {
+ --$ptr;
+ }
+
+ // Add string and continue
+ $out .= substr($str, 0, $ptr) . '=' . $lineEnd;
+ $str = substr($str, $ptr);
+ }
+
+ $out = rtrim($out, $lineEnd);
+ $out = rtrim($out, '=');
+
+ return $out;
+ }
+
+ /**
+ * Converts a string into quoted printable format.
+ *
+ * @param string $str
+ * @return string
+ */
+ private static function _encodeQuotedPrintable($str)
+ {
+ $str = str_replace('=', '=3D', $str);
+ $str = str_replace(self::$qpKeys, self::$qpReplaceValues, $str);
+ $str = rtrim($str);
+
+ return $str;
+ }
+
+ /**
+ * Encode a given string with the QUOTED_PRINTABLE mechanism for Mail Headers.
+ *
+ * Mail headers depend on an extended quoted printable algorithm otherwise
+ * a range of bugs can occur.
+ *
+ * @param string $str
+ * @param string $charset
+ * @param int $lineLength Line length; defaults to {@link LINELENGTH}
+ * @param string $lineEnd Line end; defaults to {@link LINEEND}
+ * @return string
+ */
+ public static function encodeQuotedPrintableHeader(
+ $str, $charset, $lineLength = self::LINELENGTH, $lineEnd = self::LINEEND
+ )
+ {
+ // Reduce line-length by the length of the required delimiter, charsets and encoding
+ $prefix = sprintf('=?%s?Q?', $charset);
+ $lineLength = $lineLength - strlen($prefix) - 3;
+
+ $str = self::_encodeQuotedPrintable($str);
+
+ // Mail-Header required chars have to be encoded also:
+ $str = str_replace(
+ array('?', ' ', '_', ','), array('=3F', '=20', '=5F', '=2C'), $str
+ );
+
+ // initialize first line, we need it anyways
+ $lines = array(0 => "");
+
+ // Split encoded text into separate lines
+ $tmp = "";
+ while (strlen($str) > 0) {
+ $currentLine = max(count($lines) - 1, 0);
+ $token = self::getNextQuotedPrintableToken($str);
+ $str = substr($str, strlen($token));
+
+ $tmp .= $token;
+ if ($token == '=20') {
+ // only if we have a single char token or space, we can append the
+ // tempstring it to the current line or start a new line if necessary.
+ if (strlen($lines[$currentLine] . $tmp) > $lineLength) {
+ $lines[$currentLine + 1] = $tmp;
+ } else {
+ $lines[$currentLine] .= $tmp;
+ }
+ $tmp = "";
+ }
+ // don't forget to append the rest to the last line
+ if (strlen($str) == 0) {
+ $lines[$currentLine] .= $tmp;
+ }
+ }
+
+ // assemble the lines together by pre- and appending delimiters, charset, encoding.
+ for ($i = 0; $i < count($lines); $i++) {
+ $lines[$i] = " " . $prefix . $lines[$i] . "?=";
+ }
+ $str = trim(implode($lineEnd, $lines));
+
+ return $str;
+ }
+
+ /**
+ * Retrieves the first token from a quoted printable string.
+ *
+ * @param string $str
+ * @return string
+ */
+ private static function getNextQuotedPrintableToken($str)
+ {
+ if (substr($str, 0, 1) == "=") {
+ $token = substr($str, 0, 3);
+ } else {
+ $token = substr($str, 0, 1);
+ }
+
+ return $token;
+ }
+
+ /**
+ * Encode a given string in mail header compatible base64 encoding.
+ *
+ * @param string $str
+ * @param string $charset
+ * @param int $lineLength Line length; defaults to {@link LINELENGTH}
+ * @param string $lineEnd Line end; defaults to {@link LINEEND}
+ * @return string
+ */
+ public static function encodeBase64Header(
+ $str, $charset, $lineLength = self::LINELENGTH, $lineEnd = self::LINEEND
+ )
+ {
+ $prefix = '=?' . $charset . '?B?';
+ $suffix = '?=';
+ $remainingLength = $lineLength - strlen($prefix) - strlen($suffix);
+
+ $encodedValue = self::encodeBase64($str, $remainingLength, $lineEnd);
+ $encodedValue = str_replace(
+ $lineEnd, $suffix . $lineEnd . ' ' . $prefix, $encodedValue
+ );
+ $encodedValue = $prefix . $encodedValue . $suffix;
+
+ return $encodedValue;
+ }
+
+ /**
+ * Encode a given string in base64 encoding and break lines
+ * according to the maximum linelength.
+ *
+ * @param string $str
+ * @param int $lineLength Line length; defaults to {@link LINELENGTH}
+ * @param string $lineEnd Line end; defaults to {@link LINEEND}
+ * @return string
+ */
+ public static function encodeBase64(
+ $str, $lineLength = self::LINELENGTH, $lineEnd = self::LINEEND
+ )
+ {
+ return rtrim(chunk_split(base64_encode($str), $lineLength, $lineEnd));
+ }
+
+ /**
+ * Constructor
+ *
+ * @param null|string $boundary
+ */
+ public function __construct($boundary = null)
+ {
+ // This string needs to be somewhat unique
+ if ($boundary === null) {
+ $this->_boundary = '=_' . md5(microtime(1) . self::$makeUnique++);
+ } else {
+ $this->_boundary = $boundary;
+ }
+ }
+
+ /**
+ * Encode the given string with the given encoding.
+ *
+ * @param string $str
+ * @param string $encoding
+ * @param string $EOL Line end; defaults to {@link Zend_Mime::LINEEND}
+ * @return string
+ */
+ public static function encode($str, $encoding, $EOL = self::LINEEND)
+ {
+ switch ($encoding) {
+ case self::ENCODING_BASE64:
+ return self::encodeBase64($str, self::LINELENGTH, $EOL);
+
+ case self::ENCODING_QUOTEDPRINTABLE:
+ return self::encodeQuotedPrintable($str, self::LINELENGTH, $EOL);
+
+ default:
+ /**
+ * @todo 7Bit and 8Bit is currently handled the same way.
+ */
+ return $str;
+ }
+ }
+
+ /**
+ * Return a MIME boundary
+ *
+ * @access public
+ * @return string
+ */
+ public function boundary()
+ {
+ return $this->_boundary;
+ }
+
+ /**
+ * Return a MIME boundary line
+ *
+ * @param string $EOL Line end; defaults to {@link LINEEND}
+ * @return string
+ */
+ public function boundaryLine($EOL = self::LINEEND)
+ {
+ return $EOL . '--' . $this->_boundary . $EOL;
+ }
+
+ /**
+ * Return MIME ending
+ *
+ * @param string $EOL Line end; defaults to {@link LINEEND}
+ * @return string
+ */
+ public function mimeEnd($EOL = self::LINEEND)
+ {
+ return $EOL . '--' . $this->_boundary . '--' . $EOL;
+ }
+}
diff --git a/library/vendor/Zend/Mime/Decode.php b/library/vendor/Zend/Mime/Decode.php
new file mode 100644
index 0000000..a63f861
--- /dev/null
+++ b/library/vendor/Zend/Mime/Decode.php
@@ -0,0 +1,275 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mime
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Mime
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Mime
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mime_Decode
+{
+ /**
+ * Explode MIME multipart string into seperate parts
+ *
+ * Parts consist of the header and the body of each MIME part.
+ *
+ * @param string $body raw body of message
+ * @param string $boundary boundary as found in content-type
+ * @return array parts with content of each part, empty if no parts found
+ * @throws Zend_Exception
+ */
+ public static function splitMime($body, $boundary)
+ {
+ // TODO: we're ignoring \r for now - is this function fast enough and is it safe to asume noone needs \r?
+ $body = str_replace("\r", '', $body);
+
+ $start = 0;
+ $res = array();
+ // find every mime part limiter and cut out the
+ // string before it.
+ // the part before the first boundary string is discarded:
+ $p = strpos($body, '--' . $boundary . "\n", $start);
+ if ($p === false) {
+ // no parts found!
+ return array();
+ }
+
+ // position after first boundary line
+ $start = $p + 3 + strlen($boundary);
+
+ while (($p = strpos($body, '--' . $boundary . "\n", $start)) !== false) {
+ $res[] = substr($body, $start, $p-$start);
+ $start = $p + 3 + strlen($boundary);
+ }
+
+ // no more parts, find end boundary
+ $p = strpos($body, '--' . $boundary . '--', $start);
+ if ($p === false) {
+ throw new Zend_Exception('Not a valid Mime Message: End Missing');
+ }
+
+ // the remaining part also needs to be parsed:
+ $res[] = substr($body, $start, $p - $start);
+
+ return $res;
+ }
+
+ /**
+ * decodes a mime encoded String and returns a
+ * struct of parts with header and body
+ *
+ * @param string $message raw message content
+ * @param string $boundary boundary as found in content-type
+ * @param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND}
+ * @return array|null parts as array('header' => array(name => value), 'body' => content), null if no parts found
+ * @throws Zend_Exception
+ */
+ public static function splitMessageStruct(
+ $message, $boundary, $EOL = Zend_Mime::LINEEND
+ )
+ {
+ $parts = self::splitMime($message, $boundary);
+ if (count($parts) <= 0) {
+ return null;
+ }
+ $result = array();
+ foreach ($parts as $part) {
+ self::splitMessage($part, $headers, $body, $EOL);
+ $result[] = array(
+ 'header' => $headers,
+ 'body' => $body
+ );
+ }
+
+ return $result;
+ }
+
+ /**
+ * split a message in header and body part, if no header or an
+ * invalid header is found $headers is empty
+ *
+ * The charset of the returned headers depend on your iconv settings.
+ *
+ * @param string $message raw message with header and optional content
+ * @param array $headers output param, array with headers as array(name => value)
+ * @param string $body output param, content of message
+ * @param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND}
+ * @return null
+ */
+ public static function splitMessage(
+ $message, &$headers, &$body, $EOL = Zend_Mime::LINEEND
+ )
+ {
+ // check for valid header at first line
+ $firstline = strtok($message, "\n");
+ if (!preg_match('%^[^\s]+[^:]*:%', $firstline)) {
+ $headers = array();
+ // TODO: we're ignoring \r for now - is this function fast enough and is it safe to asume noone needs \r?
+ $body = str_replace(
+ array(
+ "\r",
+ "\n"
+ ), array(
+ '',
+ $EOL
+ ), $message
+ );
+
+ return;
+ }
+
+ // find an empty line between headers and body
+ // default is set new line
+ if (strpos($message, $EOL . $EOL)) {
+ list($headers, $body) = explode($EOL . $EOL, $message, 2);
+ // next is the standard new line
+ } else {
+ if ($EOL != "\r\n" && strpos($message, "\r\n\r\n")) {
+ list($headers, $body) = explode("\r\n\r\n", $message, 2);
+ // next is the other "standard" new line
+ } else {
+ if ($EOL != "\n" && strpos($message, "\n\n")) {
+ list($headers, $body) = explode("\n\n", $message, 2);
+ // at last resort find anything that looks like a new line
+ } else {
+ @list($headers, $body) =
+ @preg_split("%([\r\n]+)\\1%U", $message, 2);
+ }
+ }
+ }
+
+ $headers = iconv_mime_decode_headers(
+ $headers, ICONV_MIME_DECODE_CONTINUE_ON_ERROR
+ );
+
+ if ($headers === false) {
+ // an error occurs during the decoding
+ return;
+ }
+
+ // normalize header names
+ foreach ($headers as $name => $header) {
+ $lower = strtolower($name);
+ if ($lower == $name) {
+ continue;
+ }
+ unset($headers[$name]);
+ if (!isset($headers[$lower])) {
+ $headers[$lower] = $header;
+ continue;
+ }
+ if (is_array($headers[$lower])) {
+ $headers[$lower][] = $header;
+ continue;
+ }
+ $headers[$lower] = array(
+ $headers[$lower],
+ $header
+ );
+ }
+ }
+
+ /**
+ * split a content type in its different parts
+ *
+ * @param string $type content-type
+ * @param string $wantedPart the wanted part, else an array with all parts is returned
+ * @return string|array wanted part or all parts as array('type' => content-type, partname => value)
+ */
+ public static function splitContentType($type, $wantedPart = null)
+ {
+ return self::splitHeaderField($type, $wantedPart, 'type');
+ }
+
+ /**
+ * split a header field like content type in its different parts
+ *
+ * @param string $field
+ * @param string $wantedPart the wanted part, else an array with all parts is returned
+ * @param int|string $firstName key name for the first part
+ * @throws Zend_Exception
+ * @return string|array wanted part or all parts as array($firstName => firstPart, partname => value)
+ */
+ public static function splitHeaderField(
+ $field, $wantedPart = null, $firstName = 0
+ )
+ {
+ $wantedPart = strtolower($wantedPart);
+ $firstName = strtolower($firstName);
+
+ // special case - a bit optimized
+ if ($firstName === $wantedPart) {
+ $field = strtok($field, ';');
+
+ return $field[0] == '"' ? substr($field, 1, -1) : $field;
+ }
+
+ $field = $firstName . '=' . $field;
+ if (!preg_match_all('%([^=\s]+)\s*=\s*("[^"]+"|[^;]+)(;\s*|$)%', $field, $matches)) {
+ throw new Zend_Exception('not a valid header field');
+ }
+
+ if ($wantedPart) {
+ foreach ($matches[1] as $key => $name) {
+ if (strcasecmp($name, $wantedPart)) {
+ continue;
+ }
+ if ($matches[2][$key][0] != '"') {
+ return $matches[2][$key];
+ }
+
+ return substr($matches[2][$key], 1, -1);
+ }
+
+ return null;
+ }
+
+ $split = array();
+ foreach ($matches[1] as $key => $name) {
+ $name = strtolower($name);
+ if ($matches[2][$key][0] == '"') {
+ $split[$name] = substr($matches[2][$key], 1, -1);
+ } else {
+ $split[$name] = $matches[2][$key];
+ }
+ }
+
+ return $split;
+ }
+
+ /**
+ * decode a quoted printable encoded string
+ *
+ * The charset of the returned string depends on your iconv settings.
+ *
+ * @param string $string Encoded string
+ * @return string Decoded string
+ */
+ public static function decodeQuotedPrintable($string)
+ {
+ return quoted_printable_decode($string);
+ }
+}
diff --git a/library/vendor/Zend/Mime/Exception.php b/library/vendor/Zend/Mime/Exception.php
new file mode 100644
index 0000000..a803058
--- /dev/null
+++ b/library/vendor/Zend/Mime/Exception.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mime
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Exception
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Mime
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mime_Exception extends Zend_Exception
+{
+}
+
diff --git a/library/vendor/Zend/Mime/Message.php b/library/vendor/Zend/Mime/Message.php
new file mode 100644
index 0000000..6082890
--- /dev/null
+++ b/library/vendor/Zend/Mime/Message.php
@@ -0,0 +1,302 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mime
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Mime
+ */
+
+/**
+ * Zend_Mime_Part
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Mime
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mime_Message
+{
+ /**
+ * The Zend_Mime_Parts of the message
+ *
+ * @var array
+ */
+ protected $_parts = array();
+
+ /**
+ * The Zend_Mime object for the message
+ *
+ * @var Zend_Mime|null
+ */
+ protected $_mime = null;
+
+ /**
+ * Returns the list of all Zend_Mime_Parts in the message
+ *
+ * @return array of Zend_Mime_Part
+ */
+ public function getParts()
+ {
+ return $this->_parts;
+ }
+
+ /**
+ * Sets the given array of Zend_Mime_Parts as the array for the message
+ *
+ * @param array $parts
+ */
+ public function setParts($parts)
+ {
+ $this->_parts = $parts;
+ }
+
+ /**
+ * Append a new Zend_Mime_Part to the current message
+ *
+ * @param Zend_Mime_Part $part
+ */
+ public function addPart(Zend_Mime_Part $part)
+ {
+ /**
+ * @todo check for duplicate object handle
+ */
+ $this->_parts[] = $part;
+ }
+
+ /**
+ * Check if message needs to be sent as multipart
+ * MIME message or if it has only one part.
+ *
+ * @return boolean
+ */
+ public function isMultiPart()
+ {
+ return (count($this->_parts) > 1);
+ }
+
+ /**
+ * Set Zend_Mime object for the message
+ *
+ * This can be used to set the boundary specifically or to use a subclass of
+ * Zend_Mime for generating the boundary.
+ *
+ * @param Zend_Mime $mime
+ */
+ public function setMime(Zend_Mime $mime)
+ {
+ $this->_mime = $mime;
+ }
+
+ /**
+ * Returns the Zend_Mime object in use by the message
+ *
+ * If the object was not present, it is created and returned. Can be used to
+ * determine the boundary used in this message.
+ *
+ * @return Zend_Mime
+ */
+ public function getMime()
+ {
+ if ($this->_mime === null) {
+ $this->_mime = new Zend_Mime();
+ }
+
+ return $this->_mime;
+ }
+
+ /**
+ * Generate MIME-compliant message from the current configuration
+ *
+ * This can be a multipart message if more than one MIME part was added. If
+ * only one part is present, the content of this part is returned. If no
+ * part had been added, an empty string is returned.
+ *
+ * Parts are seperated by the mime boundary as defined in Zend_Mime. If
+ * {@link setMime()} has been called before this method, the Zend_Mime
+ * object set by this call will be used. Otherwise, a new Zend_Mime object
+ * is generated and used.
+ *
+ * @param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND}
+ * @return string
+ */
+ public function generateMessage($EOL = Zend_Mime::LINEEND)
+ {
+ if (!$this->isMultiPart()) {
+ $body = array_shift($this->_parts);
+ $body = $body->getContent($EOL);
+ } else {
+ $mime = $this->getMime();
+
+ $boundaryLine = $mime->boundaryLine($EOL);
+ $body = 'This is a message in Mime Format. If you see this, '
+ . "your mail reader does not support this format." . $EOL;
+
+ foreach (array_keys($this->_parts) as $p) {
+ $body .= $boundaryLine
+ . $this->getPartHeaders($p, $EOL)
+ . $EOL
+ . $this->getPartContent($p, $EOL);
+ }
+
+ $body .= $mime->mimeEnd($EOL);
+ }
+
+ return trim($body);
+ }
+
+ /**
+ * Get the headers of a given part as an array
+ *
+ * @param int $partnum
+ * @return array
+ */
+ public function getPartHeadersArray($partnum)
+ {
+ return $this->_parts[$partnum]->getHeadersArray();
+ }
+
+ /**
+ * Get the headers of a given part as a string
+ *
+ * @param int $partnum
+ * @param string $EOL
+ * @return string
+ */
+ public function getPartHeaders($partnum, $EOL = Zend_Mime::LINEEND)
+ {
+ return $this->_parts[$partnum]->getHeaders($EOL);
+ }
+
+ /**
+ * Get the (encoded) content of a given part as a string
+ *
+ * @param int $partnum
+ * @param string $EOL
+ * @return string
+ */
+ public function getPartContent($partnum, $EOL = Zend_Mime::LINEEND)
+ {
+ return $this->_parts[$partnum]->getContent($EOL);
+ }
+
+ /**
+ * Explode MIME multipart string into seperate parts
+ *
+ * Parts consist of the header and the body of each MIME part.
+ *
+ * @param string $body
+ * @param string $boundary
+ * @throws Zend_Exception
+ * @return array
+ */
+ protected static function _disassembleMime($body, $boundary)
+ {
+ $start = 0;
+ $res = array();
+ // find every mime part limiter and cut out the
+ // string before it.
+ // the part before the first boundary string is discarded:
+ $p = strpos($body, '--' . $boundary . "\n", $start);
+ if ($p === false) {
+ // no parts found!
+ return array();
+ }
+
+ // position after first boundary line
+ $start = $p + 3 + strlen($boundary);
+
+ while (($p = strpos($body, '--' . $boundary . "\n", $start))
+ !== false) {
+ $res[] = substr($body, $start, $p - $start);
+ $start = $p + 3 + strlen($boundary);
+ }
+
+ // no more parts, find end boundary
+ $p = strpos($body, '--' . $boundary . '--', $start);
+ if ($p === false) {
+ throw new Zend_Exception('Not a valid Mime Message: End Missing');
+ }
+
+ // the remaining part also needs to be parsed:
+ $res[] = substr($body, $start, $p - $start);
+
+ return $res;
+ }
+
+ /**
+ * Decodes a MIME encoded string and returns a Zend_Mime_Message object with
+ * all the MIME parts set according to the given string
+ *
+ * @param string $message
+ * @param string $boundary
+ * @param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND}
+ * @throws Zend_Exception
+ * @return Zend_Mime_Message
+ */
+ public static function createFromMessage(
+ $message, $boundary, $EOL = Zend_Mime::LINEEND
+ )
+ {
+ $parts = Zend_Mime_Decode::splitMessageStruct($message, $boundary, $EOL);
+
+ $res = new self();
+ foreach ($parts as $part) {
+ // now we build a new MimePart for the current Message Part:
+ $newPart = new Zend_Mime_Part($part['body']);
+ foreach ($part['header'] as $key => $value) {
+ /**
+ * @todo check for characterset and filename
+ */
+ switch (strtolower($key)) {
+ case 'content-type':
+ $newPart->type = $value;
+ break;
+ case 'content-transfer-encoding':
+ $newPart->encoding = $value;
+ break;
+ case 'content-id':
+ $newPart->id = trim($value, '<>');
+ break;
+ case 'content-disposition':
+ $newPart->disposition = $value;
+ break;
+ case 'content-description':
+ $newPart->description = $value;
+ break;
+ case 'content-location':
+ $newPart->location = $value;
+ break;
+ case 'content-language':
+ $newPart->language = $value;
+ break;
+ default:
+ throw new Zend_Exception(
+ 'Unknown header ignored for MimePart:' . $key
+ );
+ }
+ }
+ $res->addPart($newPart);
+ }
+
+ return $res;
+ }
+}
diff --git a/library/vendor/Zend/Mime/Part.php b/library/vendor/Zend/Mime/Part.php
new file mode 100644
index 0000000..852fb56
--- /dev/null
+++ b/library/vendor/Zend/Mime/Part.php
@@ -0,0 +1,329 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Mime
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Mime
+ */
+
+/**
+ * Class representing a MIME part.
+ *
+ * @category Zend
+ * @package Zend_Mime
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Mime_Part
+{
+
+ /**
+ * Type
+ *
+ * @var string
+ */
+ public $type = Zend_Mime::TYPE_OCTETSTREAM;
+
+ /**
+ * Encoding
+ *
+ * @var string
+ */
+ public $encoding = Zend_Mime::ENCODING_8BIT;
+
+ /**
+ * ID
+ *
+ * @var string
+ */
+ public $id;
+
+ /**
+ * Disposition
+ *
+ * @var string
+ */
+ public $disposition;
+
+ /**
+ * Filename
+ *
+ * @var string
+ */
+ public $filename;
+
+ /**
+ * Description
+ *
+ * @var string
+ */
+ public $description;
+
+ /**
+ * Character set
+ *
+ * @var string
+ */
+ public $charset;
+
+ /**
+ * Boundary
+ *
+ * @var string
+ */
+ public $boundary;
+
+ /**
+ * Location
+ *
+ * @var string
+ */
+ public $location;
+
+ /**
+ * Language
+ *
+ * @var string
+ */
+ public $language;
+
+ /**
+ * Content
+ *
+ * @var mixed
+ */
+ protected $_content;
+
+ /**
+ * @var bool
+ */
+ protected $_isStream = false;
+
+ /**
+ * create a new Mime Part.
+ * The (unencoded) content of the Part as passed
+ * as a string or stream
+ *
+ * @param mixed $content String or Stream containing the content
+ */
+ public function __construct($content)
+ {
+ $this->_content = $content;
+ if (is_resource($content)) {
+ $this->_isStream = true;
+ }
+ }
+
+ /**
+ * @todo setters/getters
+ * @todo error checking for setting $type
+ * @todo error checking for setting $encoding
+ */
+
+ /**
+ * check if this part can be read as a stream.
+ * if true, getEncodedStream can be called, otherwise
+ * only getContent can be used to fetch the encoded
+ * content of the part
+ *
+ * @return bool
+ */
+ public function isStream()
+ {
+ return $this->_isStream;
+ }
+
+ /**
+ * if this was created with a stream, return a filtered stream for
+ * reading the content. very useful for large file attachments.
+ *
+ * @return mixed Stream
+ * @throws Zend_Mime_Exception if not a stream or unable to append filter
+ */
+ public function getEncodedStream()
+ {
+ if (!$this->_isStream) {
+ throw new Zend_Mime_Exception(
+ 'Attempt to get a stream from a string part'
+ );
+ }
+
+ //stream_filter_remove(); // ??? is that right?
+ switch ($this->encoding) {
+ case Zend_Mime::ENCODING_QUOTEDPRINTABLE:
+ $filter = stream_filter_append(
+ $this->_content,
+ 'convert.quoted-printable-encode',
+ STREAM_FILTER_READ,
+ array(
+ 'line-length' => 76,
+ 'line-break-chars' => Zend_Mime::LINEEND
+ )
+ );
+ if (!is_resource($filter)) {
+ throw new Zend_Mime_Exception(
+ 'Failed to append quoted-printable filter'
+ );
+ }
+ break;
+
+ case Zend_Mime::ENCODING_BASE64:
+ $filter = stream_filter_append(
+ $this->_content,
+ 'convert.base64-encode',
+ STREAM_FILTER_READ,
+ array(
+ 'line-length' => 76,
+ 'line-break-chars' => Zend_Mime::LINEEND
+ )
+ );
+ if (!is_resource($filter)) {
+ throw new Zend_Mime_Exception(
+ 'Failed to append base64 filter'
+ );
+ }
+ break;
+
+ default:
+ }
+
+ return $this->_content;
+ }
+
+ /**
+ * Get the Content of the current Mime Part in the given encoding.
+ *
+ * @param string $EOL Line end; defaults to {@link Zend_Mime::LINEEND}
+ * @throws Zend_Mime_Exception
+ * @return string
+ */
+ public function getContent($EOL = Zend_Mime::LINEEND)
+ {
+ if ($this->_isStream) {
+ return stream_get_contents($this->getEncodedStream());
+ } else {
+ return Zend_Mime::encode($this->_content, $this->encoding, $EOL);
+ }
+ }
+
+ /**
+ * Get the RAW unencoded content from this part
+ *
+ * @return string
+ */
+ public function getRawContent()
+ {
+ if ($this->_isStream) {
+ return stream_get_contents($this->_content);
+ } else {
+ return $this->_content;
+ }
+ }
+
+ /**
+ * Create and return the array of headers for this MIME part
+ *
+ * @param string $EOL Line end; defaults to {@link Zend_Mime::LINEEND}
+ * @return array
+ */
+ public function getHeadersArray($EOL = Zend_Mime::LINEEND)
+ {
+ $headers = array();
+
+ $contentType = $this->type;
+ if ($this->charset) {
+ $contentType .= '; charset=' . $this->charset;
+ }
+
+ if ($this->boundary) {
+ $contentType .= ';' . $EOL
+ . " boundary=\"" . $this->boundary . '"';
+ }
+
+ $headers[] = array(
+ 'Content-Type',
+ $contentType
+ );
+
+ if ($this->encoding) {
+ $headers[] = array(
+ 'Content-Transfer-Encoding',
+ $this->encoding
+ );
+ }
+
+ if ($this->id) {
+ $headers[] = array(
+ 'Content-ID',
+ '<' . $this->id . '>'
+ );
+ }
+
+ if ($this->disposition) {
+ $disposition = $this->disposition;
+ if ($this->filename) {
+ $disposition .= '; filename="' . $this->filename . '"';
+ }
+ $headers[] = array(
+ 'Content-Disposition',
+ $disposition
+ );
+ }
+
+ if ($this->description) {
+ $headers[] = array(
+ 'Content-Description',
+ $this->description
+ );
+ }
+
+ if ($this->location) {
+ $headers[] = array(
+ 'Content-Location',
+ $this->location
+ );
+ }
+
+ if ($this->language) {
+ $headers[] = array(
+ 'Content-Language',
+ $this->language
+ );
+ }
+
+ return $headers;
+ }
+
+ /**
+ * Return the headers for this part as a string
+ *
+ * @param string $EOL Line end; defaults to {@link Zend_Mime::LINEEND}
+ * @return string
+ */
+ public function getHeaders($EOL = Zend_Mime::LINEEND)
+ {
+ $res = '';
+ foreach ($this->getHeadersArray($EOL) as $header) {
+ $res .= $header[0] . ': ' . $header[1] . $EOL;
+ }
+
+ return $res;
+ }
+}
diff --git a/library/vendor/Zend/Paginator.php b/library/vendor/Zend/Paginator.php
new file mode 100644
index 0000000..e96f882
--- /dev/null
+++ b/library/vendor/Zend/Paginator.php
@@ -0,0 +1,1164 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Loader_PluginLoader
+ */
+
+/**
+ * @see Zend_Json
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Paginator implements Countable, IteratorAggregate
+{
+ /**
+ * Specifies that the factory should try to detect the proper adapter type first
+ *
+ * @var string
+ */
+ const INTERNAL_ADAPTER = 'Zend_Paginator_Adapter_Internal';
+
+ /**
+ * The cache tag prefix used to namespace Paginator results in the cache
+ *
+ */
+ const CACHE_TAG_PREFIX = 'Zend_Paginator_';
+
+ /**
+ * Adapter plugin loader
+ *
+ * @var Zend_Loader_PluginLoader
+ */
+ protected static $_adapterLoader = null;
+
+ /**
+ * Configuration file
+ *
+ * @var Zend_Config
+ */
+ protected static $_config = null;
+
+ /**
+ * Default scrolling style
+ *
+ * @var string
+ */
+ protected static $_defaultScrollingStyle = 'Sliding';
+
+ /**
+ * Default item count per page
+ *
+ * @var int
+ */
+ protected static $_defaultItemCountPerPage = 10;
+
+ /**
+ * Default number of local pages (i.e., the number of discretes
+ * page numbers that will be displayed, including the current
+ * page number)
+ *
+ * @var int
+ */
+ protected static $_defaultPageRange = 10;
+
+ /**
+ * Scrolling style plugin loader
+ *
+ * @var Zend_Loader_PluginLoader
+ */
+ protected static $_scrollingStyleLoader = null;
+
+ /**
+ * Cache object
+ *
+ * @var Zend_Cache_Core
+ */
+ protected static $_cache;
+
+ /**
+ * Enable or disable the cache by Zend_Paginator instance
+ *
+ * @var bool
+ */
+ protected $_cacheEnabled = true;
+
+ /**
+ * Adapter
+ *
+ * @var Zend_Paginator_Adapter_Interface
+ */
+ protected $_adapter = null;
+
+ /**
+ * Number of items in the current page
+ *
+ * @var integer
+ */
+ protected $_currentItemCount = null;
+
+ /**
+ * Current page items
+ *
+ * @var Traversable
+ */
+ protected $_currentItems = null;
+
+ /**
+ * Current page number (starting from 1)
+ *
+ * @var integer
+ */
+ protected $_currentPageNumber = 1;
+
+ /**
+ * Result filter
+ *
+ * @var Zend_Filter_Interface
+ */
+ protected $_filter = null;
+
+ /**
+ * Number of items per page
+ *
+ * @var integer
+ */
+ protected $_itemCountPerPage = null;
+
+ /**
+ * Number of pages
+ *
+ * @var integer
+ */
+ protected $_pageCount = null;
+
+ /**
+ * Number of local pages (i.e., the number of discrete page numbers
+ * that will be displayed, including the current page number)
+ *
+ * @var integer
+ */
+ protected $_pageRange = null;
+
+ /**
+ * Pages
+ *
+ * @var array
+ */
+ protected $_pages = null;
+
+ /**
+ * View instance used for self rendering
+ *
+ * @var Zend_View_Interface
+ */
+ protected $_view = null;
+
+ /**
+ * Adds an adapter prefix path to the plugin loader.
+ *
+ * @param string $prefix
+ * @param string $path
+ */
+ public static function addAdapterPrefixPath($prefix, $path)
+ {
+ self::getAdapterLoader()->addPrefixPath($prefix, $path);
+ }
+
+ /**
+ * Adds an array of adapter prefix paths to the plugin
+ * loader.
+ *
+ * <code>
+ * $prefixPaths = array(
+ * 'My_Paginator_Adapter' => 'My/Paginator/Adapter/',
+ * 'Your_Paginator_Adapter' => 'Your/Paginator/Adapter/'
+ * );
+ * </code>
+ *
+ * @param array $prefixPaths
+ */
+ public static function addAdapterPrefixPaths(array $prefixPaths)
+ {
+ if (isset($prefixPaths['prefix']) && isset($prefixPaths['path'])) {
+ self::addAdapterPrefixPath($prefixPaths['prefix'], $prefixPaths['path']);
+ } else {
+ foreach ($prefixPaths as $prefix => $path) {
+ if (is_array($path) && isset($path['prefix']) && isset($path['path'])) {
+ $prefix = $path['prefix'];
+ $path = $path['path'];
+ }
+
+ self::addAdapterPrefixPath($prefix, $path);
+ }
+ }
+ }
+
+ /**
+ * Adds a scrolling style prefix path to the plugin loader.
+ *
+ * @param string $prefix
+ * @param string $path
+ */
+ public static function addScrollingStylePrefixPath($prefix, $path)
+ {
+ self::getScrollingStyleLoader()->addPrefixPath($prefix, $path);
+ }
+
+ /**
+ * Adds an array of scrolling style prefix paths to the plugin
+ * loader.
+ *
+ * <code>
+ * $prefixPaths = array(
+ * 'My_Paginator_ScrollingStyle' => 'My/Paginator/ScrollingStyle/',
+ * 'Your_Paginator_ScrollingStyle' => 'Your/Paginator/ScrollingStyle/'
+ * );
+ * </code>
+ *
+ * @param array $prefixPaths
+ */
+ public static function addScrollingStylePrefixPaths(array $prefixPaths)
+ {
+ if (isset($prefixPaths['prefix']) && isset($prefixPaths['path'])) {
+ self::addScrollingStylePrefixPath($prefixPaths['prefix'], $prefixPaths['path']);
+ } else {
+ foreach ($prefixPaths as $prefix => $path) {
+ if (is_array($path) && isset($path['prefix']) && isset($path['path'])) {
+ $prefix = $path['prefix'];
+ $path = $path['path'];
+ }
+
+ self::addScrollingStylePrefixPath($prefix, $path);
+ }
+ }
+ }
+
+ /**
+ * Factory.
+ *
+ * @param mixed $data
+ * @param string $adapter
+ * @param array $prefixPaths
+ * @return Zend_Paginator
+ */
+ public static function factory($data, $adapter = self::INTERNAL_ADAPTER,
+ array $prefixPaths = null)
+ {
+ if ($data instanceof Zend_Paginator_AdapterAggregate) {
+ return new self($data->getPaginatorAdapter());
+ } else {
+ if ($adapter == self::INTERNAL_ADAPTER) {
+ if (is_array($data)) {
+ $adapter = 'Array';
+ } else if ($data instanceof Zend_Db_Table_Select) {
+ $adapter = 'DbTableSelect';
+ } else if ($data instanceof Zend_Db_Select) {
+ $adapter = 'DbSelect';
+ } else if ($data instanceof Iterator) {
+ $adapter = 'Iterator';
+ } else if (is_integer($data)) {
+ $adapter = 'Null';
+ } else {
+ $type = (is_object($data)) ? get_class($data) : gettype($data);
+
+ /**
+ * @see Zend_Paginator_Exception
+ */
+
+ throw new Zend_Paginator_Exception('No adapter for type ' . $type);
+ }
+ }
+
+ $pluginLoader = self::getAdapterLoader();
+
+ if (null !== $prefixPaths) {
+ foreach ($prefixPaths as $prefix => $path) {
+ $pluginLoader->addPrefixPath($prefix, $path);
+ }
+ }
+
+ $adapterClassName = $pluginLoader->load($adapter);
+
+ return new self(new $adapterClassName($data));
+ }
+ }
+
+ /**
+ * Returns the adapter loader. If it doesn't exist it's created.
+ *
+ * @return Zend_Loader_PluginLoader
+ */
+ public static function getAdapterLoader()
+ {
+ if (self::$_adapterLoader === null) {
+ self::$_adapterLoader = new Zend_Loader_PluginLoader(
+ array('Zend_Paginator_Adapter' => 'Zend/Paginator/Adapter')
+ );
+ }
+
+ return self::$_adapterLoader;
+ }
+
+ /**
+ * Set a global config
+ *
+ * @param Zend_Config $config
+ */
+ public static function setConfig(Zend_Config $config)
+ {
+ self::$_config = $config;
+
+ $adapterPaths = $config->get('adapterpaths');
+
+ if ($adapterPaths != null) {
+ self::addAdapterPrefixPaths($adapterPaths->adapterpath->toArray());
+ }
+
+ $prefixPaths = $config->get('prefixpaths');
+
+ if ($prefixPaths != null) {
+ self::addScrollingStylePrefixPaths($prefixPaths->prefixpath->toArray());
+ }
+
+ $scrollingStyle = $config->get('scrollingstyle');
+
+ if ($scrollingStyle != null) {
+ self::setDefaultScrollingStyle($scrollingStyle);
+ }
+ }
+
+ /**
+ * Returns the default scrolling style.
+ *
+ * @return string
+ */
+ public static function getDefaultScrollingStyle()
+ {
+ return self::$_defaultScrollingStyle;
+ }
+
+ /**
+ * Get the default item count per page
+ *
+ * @return int
+ */
+ public static function getDefaultItemCountPerPage()
+ {
+ return self::$_defaultItemCountPerPage;
+ }
+
+ /**
+ * Set the default item count per page
+ *
+ * @param int $count
+ */
+ public static function setDefaultItemCountPerPage($count)
+ {
+ self::$_defaultItemCountPerPage = (int) $count;
+ }
+
+ /**
+ * Get the default page range
+ *
+ * @return int
+ */
+ public static function getDefaultPageRange()
+ {
+ return self::$_defaultPageRange;
+ }
+
+ /**
+ * Set the default page range
+ *
+ * @param int $count
+ */
+ public static function setDefaultPageRange($count)
+ {
+ self::$_defaultPageRange = (int) $count;
+ }
+
+ /**
+ * Sets a cache object
+ *
+ * @param Zend_Cache_Core $cache
+ */
+ public static function setCache(Zend_Cache_Core $cache)
+ {
+ self::$_cache = $cache;
+ }
+
+ /**
+ * Sets the default scrolling style.
+ *
+ * @param string $scrollingStyle
+ */
+ public static function setDefaultScrollingStyle($scrollingStyle = 'Sliding')
+ {
+ self::$_defaultScrollingStyle = $scrollingStyle;
+ }
+
+ /**
+ * Returns the scrolling style loader. If it doesn't exist it's
+ * created.
+ *
+ * @return Zend_Loader_PluginLoader
+ */
+ public static function getScrollingStyleLoader()
+ {
+ if (self::$_scrollingStyleLoader === null) {
+ self::$_scrollingStyleLoader = new Zend_Loader_PluginLoader(
+ array('Zend_Paginator_ScrollingStyle' => 'Zend/Paginator/ScrollingStyle')
+ );
+ }
+
+ return self::$_scrollingStyleLoader;
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param Zend_Paginator_Adapter_Interface|Zend_Paginator_AdapterAggregate $adapter
+ */
+ public function __construct($adapter)
+ {
+ if ($adapter instanceof Zend_Paginator_Adapter_Interface) {
+ $this->_adapter = $adapter;
+ } else if ($adapter instanceof Zend_Paginator_AdapterAggregate) {
+ $this->_adapter = $adapter->getPaginatorAdapter();
+ } else {
+ /**
+ * @see Zend_Paginator_Exception
+ */
+
+ throw new Zend_Paginator_Exception(
+ 'Zend_Paginator only accepts instances of the type ' .
+ 'Zend_Paginator_Adapter_Interface or Zend_Paginator_AdapterAggregate.'
+ );
+ }
+
+ $config = self::$_config;
+
+ if ($config != null) {
+ $setupMethods = array('ItemCountPerPage', 'PageRange');
+
+ foreach ($setupMethods as $setupMethod) {
+ $value = $config->get(strtolower($setupMethod));
+
+ if ($value != null) {
+ $setupMethod = 'set' . $setupMethod;
+ $this->$setupMethod($value);
+ }
+ }
+ }
+ }
+
+ /**
+ * Serializes the object as a string. Proxies to {@link render()}.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ try {
+ $return = $this->render();
+ return $return;
+ } catch (Exception $e) {
+ trigger_error($e->getMessage(), E_USER_WARNING);
+ }
+
+ return '';
+ }
+
+ /**
+ * Enables/Disables the cache for this instance
+ *
+ * @param bool $enable
+ * @return Zend_Paginator
+ */
+ public function setCacheEnabled($enable)
+ {
+ $this->_cacheEnabled = (bool)$enable;
+ return $this;
+ }
+
+ /**
+ * Returns the number of pages.
+ *
+ * @return integer
+ */
+ public function count(): int
+ {
+ if (!$this->_pageCount) {
+ $this->_pageCount = $this->_calculatePageCount();
+ }
+
+ return $this->_pageCount;
+ }
+
+ /**
+ * Returns the total number of items available. Uses cache if caching is enabled.
+ *
+ * @return integer
+ */
+ public function getTotalItemCount()
+ {
+ if (!$this->_cacheEnabled()) {
+ return count($this->getAdapter());
+ } else {
+ $cacheId = md5($this->_getCacheInternalId(). '_itemCount');
+ $itemCount = self::$_cache->load($cacheId);
+
+ if ($itemCount === false) {
+ $itemCount = count($this->getAdapter());
+
+ self::$_cache->save($itemCount, $cacheId, array($this->_getCacheInternalId()));
+ }
+
+ return $itemCount;
+ }
+ }
+
+ /**
+ * Clear the page item cache.
+ *
+ * @param int $pageNumber
+ * @return Zend_Paginator
+ */
+ public function clearPageItemCache($pageNumber = null)
+ {
+ if (!$this->_cacheEnabled()) {
+ return $this;
+ }
+
+ if (null === $pageNumber) {
+ foreach (self::$_cache->getIdsMatchingTags(array($this->_getCacheInternalId())) as $id) {
+ if (preg_match('|'.self::CACHE_TAG_PREFIX."(\d+)_.*|", $id, $page)) {
+ self::$_cache->remove($this->_getCacheId($page[1]));
+ }
+ }
+ } else {
+ $cleanId = $this->_getCacheId($pageNumber);
+ self::$_cache->remove($cleanId);
+ }
+ return $this;
+ }
+
+ /**
+ * Returns the absolute item number for the specified item.
+ *
+ * @param integer $relativeItemNumber Relative item number
+ * @param integer $pageNumber Page number
+ * @return integer
+ */
+ public function getAbsoluteItemNumber($relativeItemNumber, $pageNumber = null)
+ {
+ $relativeItemNumber = $this->normalizeItemNumber($relativeItemNumber);
+
+ if ($pageNumber == null) {
+ $pageNumber = $this->getCurrentPageNumber();
+ }
+
+ $pageNumber = $this->normalizePageNumber($pageNumber);
+
+ return (($pageNumber - 1) * $this->getItemCountPerPage()) + $relativeItemNumber;
+ }
+
+ /**
+ * Returns the adapter.
+ *
+ * @return Zend_Paginator_Adapter_Interface
+ */
+ public function getAdapter()
+ {
+ return $this->_adapter;
+ }
+
+ /**
+ * Returns the number of items for the current page.
+ *
+ * @return integer
+ */
+ public function getCurrentItemCount()
+ {
+ if ($this->_currentItemCount === null) {
+ $this->_currentItemCount = $this->getItemCount($this->getCurrentItems());
+ }
+
+ return $this->_currentItemCount;
+ }
+
+ /**
+ * Returns the items for the current page.
+ *
+ * @return Traversable
+ */
+ public function getCurrentItems()
+ {
+ if ($this->_currentItems === null) {
+ $this->_currentItems = $this->getItemsByPage($this->getCurrentPageNumber());
+ }
+
+ return $this->_currentItems;
+ }
+
+ /**
+ * Returns the current page number.
+ *
+ * @return integer
+ */
+ public function getCurrentPageNumber()
+ {
+ return $this->normalizePageNumber($this->_currentPageNumber);
+ }
+
+ /**
+ * Sets the current page number.
+ *
+ * @param integer $pageNumber Page number
+ * @return Zend_Paginator $this
+ */
+ public function setCurrentPageNumber($pageNumber)
+ {
+ $this->_currentPageNumber = (integer) $pageNumber;
+ $this->_currentItems = null;
+ $this->_currentItemCount = null;
+
+ return $this;
+ }
+
+ /**
+ * Get the filter
+ *
+ * @return Zend_Filter_Interface
+ */
+ public function getFilter()
+ {
+ return $this->_filter;
+ }
+
+ /**
+ * Set a filter chain
+ *
+ * @param Zend_Filter_Interface $filter
+ * @return Zend_Paginator
+ */
+ public function setFilter(Zend_Filter_Interface $filter)
+ {
+ $this->_filter = $filter;
+
+ return $this;
+ }
+
+ /**
+ * Returns an item from a page. The current page is used if there's no
+ * page sepcified.
+ *
+ * @param integer $itemNumber Item number (1 to itemCountPerPage)
+ * @param integer $pageNumber
+ * @return mixed
+ */
+ public function getItem($itemNumber, $pageNumber = null)
+ {
+ if ($pageNumber == null) {
+ $pageNumber = $this->getCurrentPageNumber();
+ } else if ($pageNumber < 0) {
+ $pageNumber = ($this->count() + 1) + $pageNumber;
+ }
+
+ $page = $this->getItemsByPage($pageNumber);
+ $itemCount = $this->getItemCount($page);
+
+ if ($itemCount == 0) {
+ /**
+ * @see Zend_Paginator_Exception
+ */
+
+ throw new Zend_Paginator_Exception('Page ' . $pageNumber . ' does not exist');
+ }
+
+ if ($itemNumber < 0) {
+ $itemNumber = ($itemCount + 1) + $itemNumber;
+ }
+
+ $itemNumber = $this->normalizeItemNumber($itemNumber);
+
+ if ($itemNumber > $itemCount) {
+ /**
+ * @see Zend_Paginator_Exception
+ */
+
+ throw new Zend_Paginator_Exception('Page ' . $pageNumber . ' does not'
+ . ' contain item number ' . $itemNumber);
+ }
+
+ return $page[$itemNumber - 1];
+ }
+
+ /**
+ * Returns the number of items per page.
+ *
+ * @return integer
+ */
+ public function getItemCountPerPage()
+ {
+ if (empty($this->_itemCountPerPage)) {
+ $this->_itemCountPerPage = self::getDefaultItemCountPerPage();
+ }
+
+ return $this->_itemCountPerPage;
+ }
+
+ /**
+ * Sets the number of items per page.
+ *
+ * @param integer $itemCountPerPage
+ * @return Zend_Paginator $this
+ */
+ public function setItemCountPerPage($itemCountPerPage = -1)
+ {
+ $this->_itemCountPerPage = (integer) $itemCountPerPage;
+ if ($this->_itemCountPerPage < 1) {
+ $this->_itemCountPerPage = $this->getTotalItemCount();
+ }
+ $this->_pageCount = $this->_calculatePageCount();
+ $this->_currentItems = null;
+ $this->_currentItemCount = null;
+
+ return $this;
+ }
+
+ /**
+ * Returns the number of items in a collection.
+ *
+ * @param mixed $items Items
+ * @return integer
+ */
+ public function getItemCount($items)
+ {
+ $itemCount = 0;
+
+ if (is_array($items) || $items instanceof Countable) {
+ $itemCount = count($items);
+ } else { // $items is something like LimitIterator
+ $itemCount = iterator_count($items);
+ }
+
+ return $itemCount;
+ }
+
+ /**
+ * Returns the items for a given page.
+ *
+ * @return Traversable
+ */
+ public function getItemsByPage($pageNumber)
+ {
+ $pageNumber = $this->normalizePageNumber($pageNumber);
+
+ if ($this->_cacheEnabled()) {
+ $data = self::$_cache->load($this->_getCacheId($pageNumber));
+ if ($data !== false) {
+ return $data;
+ }
+ }
+
+ $offset = ($pageNumber - 1) * $this->getItemCountPerPage();
+
+ $items = $this->_adapter->getItems($offset, $this->getItemCountPerPage());
+
+ $filter = $this->getFilter();
+
+ if ($filter !== null) {
+ $items = $filter->filter($items);
+ }
+
+ if (!$items instanceof Traversable) {
+ $items = new ArrayIterator($items);
+ }
+
+ if ($this->_cacheEnabled()) {
+ self::$_cache->save($items, $this->_getCacheId($pageNumber), array($this->_getCacheInternalId()));
+ }
+
+ return $items;
+ }
+
+ /**
+ * Returns a foreach-compatible iterator.
+ *
+ * @return Traversable
+ */
+ public function getIterator(): Traversable
+ {
+ return $this->getCurrentItems();
+ }
+
+ /**
+ * Returns the page range (see property declaration above).
+ *
+ * @return integer
+ */
+ public function getPageRange()
+ {
+ if (null === $this->_pageRange) {
+ $this->_pageRange = self::getDefaultPageRange();
+ }
+
+ return $this->_pageRange;
+ }
+
+ /**
+ * Sets the page range (see property declaration above).
+ *
+ * @param integer $pageRange
+ * @return Zend_Paginator $this
+ */
+ public function setPageRange($pageRange)
+ {
+ $this->_pageRange = (integer) $pageRange;
+
+ return $this;
+ }
+
+ /**
+ * Returns the page collection.
+ *
+ * @param string $scrollingStyle Scrolling style
+ * @return array
+ */
+ public function getPages($scrollingStyle = null)
+ {
+ if ($this->_pages === null) {
+ $this->_pages = $this->_createPages($scrollingStyle);
+ }
+
+ return $this->_pages;
+ }
+
+ /**
+ * Returns a subset of pages within a given range.
+ *
+ * @param integer $lowerBound Lower bound of the range
+ * @param integer $upperBound Upper bound of the range
+ * @return array
+ */
+ public function getPagesInRange($lowerBound, $upperBound)
+ {
+ $lowerBound = $this->normalizePageNumber($lowerBound);
+ $upperBound = $this->normalizePageNumber($upperBound);
+
+ $pages = array();
+
+ for ($pageNumber = $lowerBound; $pageNumber <= $upperBound; $pageNumber++) {
+ $pages[$pageNumber] = $pageNumber;
+ }
+
+ return $pages;
+ }
+
+ /**
+ * Returns the page item cache.
+ *
+ * @return array
+ */
+ public function getPageItemCache()
+ {
+ $data = array();
+ if ($this->_cacheEnabled()) {
+ foreach (self::$_cache->getIdsMatchingTags(array($this->_getCacheInternalId())) as $id) {
+ if (preg_match('|'.self::CACHE_TAG_PREFIX."(\d+)_.*|", $id, $page)) {
+ $data[$page[1]] = self::$_cache->load($this->_getCacheId($page[1]));
+ }
+ }
+ }
+ return $data;
+ }
+
+ /**
+ * Retrieves the view instance. If none registered, attempts to pull f
+ * rom ViewRenderer.
+ *
+ * @return Zend_View_Interface|null
+ */
+ public function getView()
+ {
+ if ($this->_view === null) {
+ /**
+ * @see Zend_Controller_Action_HelperBroker
+ */
+
+ $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
+ if ($viewRenderer->view === null) {
+ $viewRenderer->initView();
+ }
+ $this->_view = $viewRenderer->view;
+ }
+
+ return $this->_view;
+ }
+
+ /**
+ * Sets the view object.
+ *
+ * @param Zend_View_Interface $view
+ * @return Zend_Paginator
+ */
+ public function setView(Zend_View_Interface $view = null)
+ {
+ $this->_view = $view;
+
+ return $this;
+ }
+
+ /**
+ * Brings the item number in range of the page.
+ *
+ * @param integer $itemNumber
+ * @return integer
+ */
+ public function normalizeItemNumber($itemNumber)
+ {
+ $itemNumber = (integer) $itemNumber;
+
+ if ($itemNumber < 1) {
+ $itemNumber = 1;
+ }
+
+ if ($itemNumber > $this->getItemCountPerPage()) {
+ $itemNumber = $this->getItemCountPerPage();
+ }
+
+ return $itemNumber;
+ }
+
+ /**
+ * Brings the page number in range of the paginator.
+ *
+ * @param integer $pageNumber
+ * @return integer
+ */
+ public function normalizePageNumber($pageNumber)
+ {
+ $pageNumber = (integer) $pageNumber;
+
+ if ($pageNumber < 1) {
+ $pageNumber = 1;
+ }
+
+ $pageCount = $this->count();
+
+ if ($pageCount > 0 && $pageNumber > $pageCount) {
+ $pageNumber = $pageCount;
+ }
+
+ return $pageNumber;
+ }
+
+ /**
+ * Renders the paginator.
+ *
+ * @param Zend_View_Interface $view
+ * @return string
+ */
+ public function render(Zend_View_Interface $view = null)
+ {
+ if (null !== $view) {
+ $this->setView($view);
+ }
+
+ $view = $this->getView();
+
+ return $view->paginationControl($this);
+ }
+
+ /**
+ * Returns the items of the current page as JSON.
+ *
+ * @return string
+ */
+ public function toJson()
+ {
+ $currentItems = $this->getCurrentItems();
+
+ if ($currentItems instanceof Zend_Db_Table_Rowset_Abstract) {
+ return Zend_Json::encode($currentItems->toArray());
+ } else {
+ return Zend_Json::encode($currentItems);
+ }
+ }
+
+ /**
+ * Tells if there is an active cache object
+ * and if the cache has not been desabled
+ *
+ * @return bool
+ */
+ protected function _cacheEnabled()
+ {
+ return ((self::$_cache !== null) && $this->_cacheEnabled);
+ }
+
+ /**
+ * Makes an Id for the cache
+ * Depends on the adapter object and the page number
+ *
+ * Used to store item in cache from that Paginator instance
+ * and that current page
+ *
+ * @param int $page
+ * @return string
+ */
+ protected function _getCacheId($page = null)
+ {
+ if ($page === null) {
+ $page = $this->getCurrentPageNumber();
+ }
+ return self::CACHE_TAG_PREFIX . $page . '_' . $this->_getCacheInternalId();
+ }
+
+ /**
+ * Get the internal cache id
+ * Depends on the adapter and the item count per page
+ *
+ * Used to tag that unique Paginator instance in cache
+ *
+ * @return string
+ */
+ protected function _getCacheInternalId()
+ {
+ $adapter = $this->getAdapter();
+
+ if (method_exists($adapter, 'getCacheIdentifier')) {
+ return md5(serialize(array(
+ $adapter->getCacheIdentifier(), $this->getItemCountPerPage()
+ )));
+ } else {
+ return md5(serialize(array(
+ $adapter,
+ $this->getItemCountPerPage()
+ )));
+ }
+ }
+
+ /**
+ * Calculates the page count.
+ *
+ * @return integer
+ */
+ protected function _calculatePageCount()
+ {
+ return (integer) ceil($this->getTotalItemCount() / $this->getItemCountPerPage());
+ }
+
+ /**
+ * Creates the page collection.
+ *
+ * @param string $scrollingStyle Scrolling style
+ * @return stdClass
+ */
+ protected function _createPages($scrollingStyle = null)
+ {
+ $pageCount = $this->count();
+ $currentPageNumber = $this->getCurrentPageNumber();
+
+ $pages = new stdClass();
+ $pages->pageCount = $pageCount;
+ $pages->itemCountPerPage = $this->getItemCountPerPage();
+ $pages->first = 1;
+ $pages->current = $currentPageNumber;
+ $pages->last = $pageCount;
+
+ // Previous and next
+ if ($currentPageNumber - 1 > 0) {
+ $pages->previous = $currentPageNumber - 1;
+ }
+
+ if ($currentPageNumber + 1 <= $pageCount) {
+ $pages->next = $currentPageNumber + 1;
+ }
+
+ // Pages in range
+ $scrollingStyle = $this->_loadScrollingStyle($scrollingStyle);
+ $pages->pagesInRange = $scrollingStyle->getPages($this);
+ $pages->firstPageInRange = min($pages->pagesInRange);
+ $pages->lastPageInRange = max($pages->pagesInRange);
+
+ // Item numbers
+ if ($this->getCurrentItems() !== null) {
+ $pages->currentItemCount = $this->getCurrentItemCount();
+ $pages->itemCountPerPage = $this->getItemCountPerPage();
+ $pages->totalItemCount = $this->getTotalItemCount();
+ $pages->firstItemNumber = (($currentPageNumber - 1) * $this->getItemCountPerPage()) + 1;
+ $pages->lastItemNumber = $pages->firstItemNumber + $pages->currentItemCount - 1;
+ }
+
+ return $pages;
+ }
+
+ /**
+ * Loads a scrolling style.
+ *
+ * @param string $scrollingStyle
+ * @return Zend_Paginator_ScrollingStyle_Interface
+ */
+ protected function _loadScrollingStyle($scrollingStyle = null)
+ {
+ if ($scrollingStyle === null) {
+ $scrollingStyle = self::$_defaultScrollingStyle;
+ }
+
+ switch (strtolower(gettype($scrollingStyle))) {
+ case 'object':
+ if (!$scrollingStyle instanceof Zend_Paginator_ScrollingStyle_Interface) {
+ /**
+ * @see Zend_View_Exception
+ */
+
+ throw new Zend_View_Exception('Scrolling style must implement ' .
+ 'Zend_Paginator_ScrollingStyle_Interface');
+ }
+
+ return $scrollingStyle;
+
+ case 'string':
+ $className = self::getScrollingStyleLoader()->load($scrollingStyle);
+
+ return new $className();
+
+ case 'null':
+ // Fall through to default case
+
+ default:
+ /**
+ * @see Zend_View_Exception
+ */
+
+ throw new Zend_View_Exception('Scrolling style must be a class ' .
+ 'name or object implementing Zend_Paginator_ScrollingStyle_Interface');
+ }
+ }
+}
diff --git a/library/vendor/Zend/Paginator/Adapter/Array.php b/library/vendor/Zend/Paginator/Adapter/Array.php
new file mode 100644
index 0000000..b4d0c09
--- /dev/null
+++ b/library/vendor/Zend/Paginator/Adapter/Array.php
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Paginator_Adapter_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Paginator_Adapter_Array implements Zend_Paginator_Adapter_Interface
+{
+ /**
+ * Array
+ *
+ * @var array
+ */
+ protected $_array = null;
+
+ /**
+ * Item count
+ *
+ * @var integer
+ */
+ protected $_count = null;
+
+ /**
+ * Constructor.
+ *
+ * @param array $array Array to paginate
+ */
+ public function __construct(array $array)
+ {
+ $this->_array = $array;
+ $this->_count = count($array);
+ }
+
+ /**
+ * Returns an array of items for a page.
+ *
+ * @param integer $offset Page offset
+ * @param integer $itemCountPerPage Number of items per page
+ * @return array
+ */
+ public function getItems($offset, $itemCountPerPage)
+ {
+ return array_slice($this->_array, $offset, $itemCountPerPage);
+ }
+
+ /**
+ * Returns the total number of rows in the array.
+ *
+ * @return integer
+ */
+ public function count()
+ {
+ return $this->_count;
+ }
+}
diff --git a/library/vendor/Zend/Paginator/Adapter/DbSelect.php b/library/vendor/Zend/Paginator/Adapter/DbSelect.php
new file mode 100644
index 0000000..ebd7142
--- /dev/null
+++ b/library/vendor/Zend/Paginator/Adapter/DbSelect.php
@@ -0,0 +1,285 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Paginator_Adapter_Interface
+ */
+
+/**
+ * @see Zend_Db
+ */
+
+/**
+ * @see Zend_Db_Select
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Paginator_Adapter_DbSelect implements Zend_Paginator_Adapter_Interface
+{
+ /**
+ * Name of the row count column
+ *
+ * @var string
+ */
+ const ROW_COUNT_COLUMN = 'zend_paginator_row_count';
+
+ /**
+ * The COUNT query
+ *
+ * @var Zend_Db_Select
+ */
+ protected $_countSelect = null;
+
+ /**
+ * Database query
+ *
+ * @var Zend_Db_Select
+ */
+ protected $_select = null;
+
+ /**
+ * Total item count
+ *
+ * @var integer
+ */
+ protected $_rowCount = null;
+
+ /**
+ * Identifies this adapter for caching purposes. This value will remain constant for
+ * the entire life of this adapter regardless of how many different pages are queried.
+ *
+ * @var string
+ */
+ protected $_cacheIdentifier = null;
+
+ /**
+ * Constructor.
+ *
+ * @param Zend_Db_Select $select The select query
+ */
+ public function __construct(Zend_Db_Select $select)
+ {
+ $this->_select = $select;
+ $this->_cacheIdentifier = md5($select->assemble());
+ }
+
+ /**
+ * Returns the cache identifier.
+ *
+ * @return string
+ */
+ public function getCacheIdentifier()
+ {
+ return $this->_cacheIdentifier;
+ }
+
+ /**
+ * Sets the total row count, either directly or through a supplied
+ * query. Without setting this, {@link getPages()} selects the count
+ * as a subquery (SELECT COUNT ... FROM (SELECT ...)). While this
+ * yields an accurate count even with queries containing clauses like
+ * LIMIT, it can be slow in some circumstances. For example, in MySQL,
+ * subqueries are generally slow when using the InnoDB storage engine.
+ * Users are therefore encouraged to profile their queries to find
+ * the solution that best meets their needs.
+ *
+ * @param Zend_Db_Select|integer $totalRowCount Total row count integer
+ * or query
+ * @return Zend_Paginator_Adapter_DbSelect $this
+ * @throws Zend_Paginator_Exception
+ */
+ public function setRowCount($rowCount)
+ {
+ if ($rowCount instanceof Zend_Db_Select) {
+ $columns = $rowCount->getPart(Zend_Db_Select::COLUMNS);
+
+ $countColumnPart = empty($columns[0][2])
+ ? $columns[0][1]
+ : $columns[0][2];
+
+ if ($countColumnPart instanceof Zend_Db_Expr) {
+ $countColumnPart = $countColumnPart->__toString();
+ }
+
+ $rowCountColumn = $this->_select->getAdapter()->foldCase(self::ROW_COUNT_COLUMN);
+
+ // The select query can contain only one column, which should be the row count column
+ if (false === strpos($countColumnPart, $rowCountColumn)) {
+ /**
+ * @see Zend_Paginator_Exception
+ */
+
+ throw new Zend_Paginator_Exception('Row count column not found');
+ }
+
+ $result = $rowCount->query(Zend_Db::FETCH_ASSOC)->fetch();
+
+ $this->_rowCount = count($result) > 0 ? $result[$rowCountColumn] : 0;
+ } else if (is_integer($rowCount)) {
+ $this->_rowCount = $rowCount;
+ } else {
+ /**
+ * @see Zend_Paginator_Exception
+ */
+
+ throw new Zend_Paginator_Exception('Invalid row count');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns an array of items for a page.
+ *
+ * @param integer $offset Page offset
+ * @param integer $itemCountPerPage Number of items per page
+ * @return array
+ */
+ public function getItems($offset, $itemCountPerPage)
+ {
+ $this->_select->limit($itemCountPerPage, $offset);
+
+ return $this->_select->query()->fetchAll();
+ }
+
+ /**
+ * Returns the total number of rows in the result set.
+ *
+ * @return integer
+ */
+ public function count()
+ {
+ if ($this->_rowCount === null) {
+ $this->setRowCount(
+ $this->getCountSelect()
+ );
+ }
+
+ return $this->_rowCount;
+ }
+
+ /**
+ * Get the COUNT select object for the provided query
+ *
+ * TODO: Have a look at queries that have both GROUP BY and DISTINCT specified.
+ * In that use-case I'm expecting problems when either GROUP BY or DISTINCT
+ * has one column.
+ *
+ * @return Zend_Db_Select
+ */
+ public function getCountSelect()
+ {
+ /**
+ * We only need to generate a COUNT query once. It will not change for
+ * this instance.
+ */
+ if ($this->_countSelect !== null) {
+ return $this->_countSelect;
+ }
+
+ $rowCount = clone $this->_select;
+ $rowCount->__toString(); // Workaround for ZF-3719 and related
+
+ $db = $rowCount->getAdapter();
+
+ $countColumn = $db->quoteIdentifier($db->foldCase(self::ROW_COUNT_COLUMN));
+ $countPart = 'COUNT(1) AS ';
+ $groupPart = null;
+ $unionParts = $rowCount->getPart(Zend_Db_Select::UNION);
+
+ /**
+ * If we're dealing with a UNION query, execute the UNION as a subquery
+ * to the COUNT query.
+ */
+ if (!empty($unionParts)) {
+ $expression = new Zend_Db_Expr($countPart . $countColumn);
+
+ $rowCount = $db
+ ->select()
+ ->bind($rowCount->getBind())
+ ->from($rowCount, $expression);
+ } else {
+ $columnParts = $rowCount->getPart(Zend_Db_Select::COLUMNS);
+ $groupParts = $rowCount->getPart(Zend_Db_Select::GROUP);
+ $havingParts = $rowCount->getPart(Zend_Db_Select::HAVING);
+ $isDistinct = $rowCount->getPart(Zend_Db_Select::DISTINCT);
+
+ /**
+ * If there is more than one column AND it's a DISTINCT query, more
+ * than one group, or if the query has a HAVING clause, then take
+ * the original query and use it as a subquery os the COUNT query.
+ */
+ if (($isDistinct && ((count($columnParts) == 1 && $columnParts[0][1] == Zend_Db_Select::SQL_WILDCARD)
+ || count($columnParts) > 1)) || count($groupParts) > 1 || !empty($havingParts)) {
+ $rowCount->reset(Zend_Db_Select::ORDER);
+ $rowCount = $db
+ ->select()
+ ->bind($rowCount->getBind())
+ ->from($rowCount);
+ } else if ($isDistinct) {
+ $part = $columnParts[0];
+
+ if ($part[1] !== Zend_Db_Select::SQL_WILDCARD && !($part[1] instanceof Zend_Db_Expr)) {
+ $column = $db->quoteIdentifier($part[1], true);
+
+ if (!empty($part[0])) {
+ $column = $db->quoteIdentifier($part[0], true) . '.' . $column;
+ }
+
+ $groupPart = $column;
+ }
+ } else if (!empty($groupParts)) {
+ $groupPart = $db->quoteIdentifier($groupParts[0], true);
+ }
+
+ /**
+ * If the original query had a GROUP BY or a DISTINCT part and only
+ * one column was specified, create a COUNT(DISTINCT ) query instead
+ * of a regular COUNT query.
+ */
+ if (!empty($groupPart)) {
+ $countPart = 'COUNT(DISTINCT ' . $groupPart . ') AS ';
+ }
+
+ /**
+ * Create the COUNT part of the query
+ */
+ $expression = new Zend_Db_Expr($countPart . $countColumn);
+
+ $rowCount->reset(Zend_Db_Select::COLUMNS)
+ ->reset(Zend_Db_Select::ORDER)
+ ->reset(Zend_Db_Select::LIMIT_OFFSET)
+ ->reset(Zend_Db_Select::GROUP)
+ ->reset(Zend_Db_Select::DISTINCT)
+ ->reset(Zend_Db_Select::HAVING)
+ ->columns($expression);
+ }
+
+ $this->_countSelect = $rowCount;
+
+ return $rowCount;
+ }
+}
diff --git a/library/vendor/Zend/Paginator/Adapter/DbTableSelect.php b/library/vendor/Zend/Paginator/Adapter/DbTableSelect.php
new file mode 100644
index 0000000..dac467f
--- /dev/null
+++ b/library/vendor/Zend/Paginator/Adapter/DbTableSelect.php
@@ -0,0 +1,47 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Paginator_Adapter_DbSelect
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Paginator_Adapter_DbTableSelect extends Zend_Paginator_Adapter_DbSelect
+{
+ /**
+ * Returns a Zend_Db_Table_Rowset_Abstract of items for a page.
+ *
+ * @param integer $offset Page offset
+ * @param integer $itemCountPerPage Number of items per page
+ * @return Zend_Db_Table_Rowset_Abstract
+ */
+ public function getItems($offset, $itemCountPerPage)
+ {
+ $this->_select->limit($itemCountPerPage, $offset);
+
+ return $this->_select->getTable()->fetchAll($this->_select);
+ }
+}
diff --git a/library/vendor/Zend/Paginator/Adapter/Interface.php b/library/vendor/Zend/Paginator/Adapter/Interface.php
new file mode 100644
index 0000000..7ec1ee2
--- /dev/null
+++ b/library/vendor/Zend/Paginator/Adapter/Interface.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Interface for pagination adapters.
+ *
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Paginator_Adapter_Interface extends Countable
+{
+ /**
+ * Returns an collection of items for a page.
+ *
+ * @param integer $offset Page offset
+ * @param integer $itemCountPerPage Number of items per page
+ * @return array
+ */
+ public function getItems($offset, $itemCountPerPage);
+}
diff --git a/library/vendor/Zend/Paginator/Adapter/Iterator.php b/library/vendor/Zend/Paginator/Adapter/Iterator.php
new file mode 100644
index 0000000..ad10da9
--- /dev/null
+++ b/library/vendor/Zend/Paginator/Adapter/Iterator.php
@@ -0,0 +1,99 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Paginator_Adapter_Interface
+ */
+
+/**
+ * @see Zend_Paginator_SerializableLimitIterator
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Paginator_Adapter_Iterator implements Zend_Paginator_Adapter_Interface
+{
+ /**
+ * Iterator which implements Countable
+ *
+ * @var Iterator
+ */
+ protected $_iterator = null;
+
+ /**
+ * Item count
+ *
+ * @var integer
+ */
+ protected $_count = null;
+
+ /**
+ * Constructor.
+ *
+ * @param Iterator $iterator Iterator to paginate
+ * @throws Zend_Paginator_Exception
+ */
+ public function __construct(Iterator $iterator)
+ {
+ if (!$iterator instanceof Countable) {
+ /**
+ * @see Zend_Paginator_Exception
+ */
+
+ throw new Zend_Paginator_Exception('Iterator must implement Countable');
+ }
+
+ $this->_iterator = $iterator;
+ $this->_count = count($iterator);
+ }
+
+ /**
+ * Returns an iterator of items for a page, or an empty array.
+ *
+ * @param integer $offset Page offset
+ * @param integer $itemCountPerPage Number of items per page
+ * @return LimitIterator|array
+ */
+ public function getItems($offset, $itemCountPerPage)
+ {
+ if ($this->_count == 0) {
+ return array();
+ }
+
+ // @link http://bugs.php.net/bug.php?id=49906 | ZF-8084
+ // return new LimitIterator($this->_iterator, $offset, $itemCountPerPage);
+ return new Zend_Paginator_SerializableLimitIterator($this->_iterator, $offset, $itemCountPerPage);
+ }
+
+ /**
+ * Returns the total number of rows in the collection.
+ *
+ * @return integer
+ */
+ public function count()
+ {
+ return $this->_count;
+ }
+}
diff --git a/library/vendor/Zend/Paginator/Adapter/Null.php b/library/vendor/Zend/Paginator/Adapter/Null.php
new file mode 100644
index 0000000..da91d4d
--- /dev/null
+++ b/library/vendor/Zend/Paginator/Adapter/Null.php
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Paginator_Adapter_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Paginator_Adapter_Null implements Zend_Paginator_Adapter_Interface
+{
+ /**
+ * Item count
+ *
+ * @var integer
+ */
+ protected $_count = null;
+
+ /**
+ * Constructor.
+ *
+ * @param array $count Total item count
+ */
+ public function __construct($count = 0)
+ {
+ $this->_count = $count;
+ }
+
+ /**
+ * Returns an array of items for a page.
+ *
+ * @param integer $offset Page offset
+ * @param integer $itemCountPerPage Number of items per page
+ * @return array
+ */
+ public function getItems($offset, $itemCountPerPage)
+ {
+ if ($offset >= $this->count()) {
+ return array();
+ }
+
+ $remainItemCount = $this->count() - $offset;
+ $currentItemCount = $remainItemCount > $itemCountPerPage ? $itemCountPerPage : $remainItemCount;
+
+ return array_fill(0, $currentItemCount, null);
+ }
+
+ /**
+ * Returns the total number of rows in the array.
+ *
+ * @return integer
+ */
+ public function count()
+ {
+ return $this->_count;
+ }
+}
diff --git a/library/vendor/Zend/Paginator/AdapterAggregate.php b/library/vendor/Zend/Paginator/AdapterAggregate.php
new file mode 100644
index 0000000..fe209d4
--- /dev/null
+++ b/library/vendor/Zend/Paginator/AdapterAggregate.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Paginator
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Interface that aggregates a Zend_Paginator_Adapter_Abstract just like IteratorAggregate does for Iterators.
+ *
+ * @category Zend
+ * @package Zend_Paginator
+ * @subpackage Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Paginator_AdapterAggregate
+{
+ /**
+ * Return a fully configured Paginator Adapter from this method.
+ *
+ * @return Zend_Paginator_Adapter_Interface
+ */
+ public function getPaginatorAdapter();
+}
diff --git a/library/vendor/Zend/Paginator/Exception.php b/library/vendor/Zend/Paginator/Exception.php
new file mode 100644
index 0000000..85513fa
--- /dev/null
+++ b/library/vendor/Zend/Paginator/Exception.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Exception
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Paginator_Exception extends Zend_Exception
+{
+}
diff --git a/library/vendor/Zend/Paginator/ScrollingStyle/All.php b/library/vendor/Zend/Paginator/ScrollingStyle/All.php
new file mode 100644
index 0000000..6ef5427
--- /dev/null
+++ b/library/vendor/Zend/Paginator/ScrollingStyle/All.php
@@ -0,0 +1,49 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Paginator_ScrollingStyle_Interface
+ */
+
+/**
+ * A scrolling style that returns every page in the collection.
+ * Useful when it is necessary to make every page available at
+ * once--for example, when using a dropdown menu pagination control.
+ *
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Paginator_ScrollingStyle_All implements Zend_Paginator_ScrollingStyle_Interface
+{
+ /**
+ * Returns an array of all pages given a page number and range.
+ *
+ * @param Zend_Paginator $paginator
+ * @param integer $pageRange Unused
+ * @return array
+ */
+ public function getPages(Zend_Paginator $paginator, $pageRange = null)
+ {
+ return $paginator->getPagesInRange(1, $paginator->count());
+ }
+}
diff --git a/library/vendor/Zend/Paginator/ScrollingStyle/Elastic.php b/library/vendor/Zend/Paginator/ScrollingStyle/Elastic.php
new file mode 100644
index 0000000..6e103f6
--- /dev/null
+++ b/library/vendor/Zend/Paginator/ScrollingStyle/Elastic.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Paginator_ScrollingStyle_Sliding
+ */
+
+/**
+ * A Google-like scrolling style. Incrementally expands the range to about
+ * twice the given page range, then behaves like a slider. See the example
+ * link.
+ *
+ * @link http://www.google.com/search?q=Zend+Framework
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Paginator_ScrollingStyle_Elastic extends Zend_Paginator_ScrollingStyle_Sliding
+{
+ /**
+ * Returns an array of "local" pages given a page number and range.
+ *
+ * @param Zend_Paginator $paginator
+ * @param integer $pageRange Unused
+ * @return array
+ */
+ public function getPages(Zend_Paginator $paginator, $pageRange = null)
+ {
+ $pageRange = $paginator->getPageRange();
+ $pageNumber = $paginator->getCurrentPageNumber();
+
+ $originalPageRange = $pageRange;
+ $pageRange = $pageRange * 2 - 1;
+
+ if ($originalPageRange + $pageNumber - 1 < $pageRange) {
+ $pageRange = $originalPageRange + $pageNumber - 1;
+ } else if ($originalPageRange + $pageNumber - 1 > count($paginator)) {
+ $pageRange = $originalPageRange + count($paginator) - $pageNumber;
+ }
+
+ return parent::getPages($paginator, $pageRange);
+ }
+}
diff --git a/library/vendor/Zend/Paginator/ScrollingStyle/Interface.php b/library/vendor/Zend/Paginator/ScrollingStyle/Interface.php
new file mode 100644
index 0000000..7871d89
--- /dev/null
+++ b/library/vendor/Zend/Paginator/ScrollingStyle/Interface.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Paginator_ScrollingStyle_Interface
+{
+ /**
+ * Returns an array of "local" pages given a page number and range.
+ *
+ * @param Zend_Paginator $paginator
+ * @param integer $pageRange (Optional) Page range
+ * @return array
+ */
+ public function getPages(Zend_Paginator $paginator, $pageRange = null);
+}
diff --git a/library/vendor/Zend/Paginator/ScrollingStyle/Jumping.php b/library/vendor/Zend/Paginator/ScrollingStyle/Jumping.php
new file mode 100644
index 0000000..93c1b79
--- /dev/null
+++ b/library/vendor/Zend/Paginator/ScrollingStyle/Jumping.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Paginator_ScrollingStyle_Interface
+ */
+
+/**
+ * A scrolling style in which the cursor advances to the upper bound
+ * of the page range, the page range "jumps" to the next section, and
+ * the cursor moves back to the beginning of the range.
+ *
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Paginator_ScrollingStyle_Jumping implements Zend_Paginator_ScrollingStyle_Interface
+{
+ /**
+ * Returns an array of "local" pages given a page number and range.
+ *
+ * @param Zend_Paginator $paginator
+ * @param integer $pageRange Unused
+ * @return array
+ */
+ public function getPages(Zend_Paginator $paginator, $pageRange = null)
+ {
+ $pageRange = $paginator->getPageRange();
+ $pageNumber = $paginator->getCurrentPageNumber();
+
+ $delta = $pageNumber % $pageRange;
+
+ if ($delta == 0) {
+ $delta = $pageRange;
+ }
+
+ $offset = $pageNumber - $delta;
+ $lowerBound = $offset + 1;
+ $upperBound = $offset + $pageRange;
+
+ return $paginator->getPagesInRange($lowerBound, $upperBound);
+ }
+}
diff --git a/library/vendor/Zend/Paginator/ScrollingStyle/Sliding.php b/library/vendor/Zend/Paginator/ScrollingStyle/Sliding.php
new file mode 100644
index 0000000..8bc6962
--- /dev/null
+++ b/library/vendor/Zend/Paginator/ScrollingStyle/Sliding.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Paginator_ScrollingStyle_Interface
+ */
+
+/**
+ * A Yahoo! Search-like scrolling style. The cursor will advance to
+ * the middle of the range, then remain there until the user reaches
+ * the end of the page set, at which point it will continue on to
+ * the end of the range and the last page in the set.
+ *
+ * @link http://search.yahoo.com/search?p=Zend+Framework
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Paginator_ScrollingStyle_Sliding implements Zend_Paginator_ScrollingStyle_Interface
+{
+ /**
+ * Returns an array of "local" pages given a page number and range.
+ *
+ * @param Zend_Paginator $paginator
+ * @param integer $pageRange (Optional) Page range
+ * @return array
+ */
+ public function getPages(Zend_Paginator $paginator, $pageRange = null)
+ {
+ if ($pageRange === null) {
+ $pageRange = $paginator->getPageRange();
+ }
+
+ $pageNumber = $paginator->getCurrentPageNumber();
+ $pageCount = count($paginator);
+
+ if ($pageRange > $pageCount) {
+ $pageRange = $pageCount;
+ }
+
+ $delta = ceil($pageRange / 2);
+
+ if ($pageNumber - $delta > $pageCount - $pageRange) {
+ $lowerBound = $pageCount - $pageRange + 1;
+ $upperBound = $pageCount;
+ } else {
+ if ($pageNumber - $delta < 0) {
+ $delta = $pageNumber;
+ }
+
+ $offset = $pageNumber - $delta;
+ $lowerBound = $offset + 1;
+ $upperBound = $offset + $pageRange;
+ }
+
+ return $paginator->getPagesInRange($lowerBound, $upperBound);
+ }
+}
diff --git a/library/vendor/Zend/Paginator/SerializableLimitIterator.php b/library/vendor/Zend/Paginator/SerializableLimitIterator.php
new file mode 100644
index 0000000..0e2e3d0
--- /dev/null
+++ b/library/vendor/Zend/Paginator/SerializableLimitIterator.php
@@ -0,0 +1,159 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Paginator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Paginator_SerializableLimitIterator extends LimitIterator implements Serializable, ArrayAccess
+{
+
+ /**
+ * Offset to first element
+ *
+ * @var int
+ */
+ private $_offset;
+
+ /**
+ * Maximum number of elements to show or -1 for all
+ *
+ * @var int
+ */
+ private $_count;
+
+ /**
+ * Construct a Zend_Paginator_SerializableLimitIterator
+ *
+ * @param Iterator $it Iterator to limit (must be serializable by un-/serialize)
+ * @param int $offset Offset to first element
+ * @param int $count Maximum number of elements to show or -1 for all
+ * @see LimitIterator::__construct
+ */
+ public function __construct (Iterator $it, $offset=0, $count=-1)
+ {
+ parent::__construct($it, $offset, $count);
+ $this->_offset = $offset;
+ $this->_count = $count;
+ }
+
+ /**
+ * @return string representation of the instance
+ */
+ public function serialize()
+ {
+ return serialize(array(
+ 'it' => $this->getInnerIterator(),
+ 'offset' => $this->_offset,
+ 'count' => $this->_count,
+ 'pos' => $this->getPosition(),
+ ));
+ }
+
+ public function __serialize(): array
+ {
+ return array(
+ 'it' => $this->getInnerIterator(),
+ 'offset' => $this->_offset,
+ 'count' => $this->_count,
+ 'pos' => $this->getPosition(),
+ );
+ }
+
+ /**
+ * @param string $data representation of the instance
+ */
+ public function unserialize($data)
+ {
+ $dataArr = unserialize($data);
+ $this->__construct($dataArr['it'], $dataArr['offset'], $dataArr['count']);
+ $this->seek($dataArr['pos']+$dataArr['offset']);
+ }
+
+ public function __unserialize(array $data): void
+ {
+ $this->__construct($data['it'], $data['offset'], $data['count']);
+ $this->seek($data['pos']+$data['offset']);
+ }
+
+ /**
+ * Returns value of the Iterator
+ *
+ * @param int $offset
+ * @return mixed
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ $currentOffset = $this->key();
+ $this->seek($offset);
+ $current = $this->current();
+ $this->seek($currentOffset);
+ return $current;
+ }
+
+ /**
+ * Does nothing
+ * Required by the ArrayAccess implementation
+ *
+ * @param int $offset
+ * @param mixed $value
+ */
+ public function offsetSet($offset, $value): void
+ {
+ }
+
+ /**
+ * Determine if a value of Iterator is set and is not NULL
+ *
+ * @param int $offset
+ */
+ public function offsetExists($offset): bool
+ {
+ if ($offset > 0 && $offset < $this->_count) {
+ try {
+ $currentOffset = $this->key();
+ $this->seek($offset);
+ $current = $this->current();
+ $this->seek($currentOffset);
+ return null !== $current;
+ } catch (OutOfBoundsException $e) {
+ // reset position in case of exception is assigned null
+ $this->rewind();
+ $this->seek($currentOffset);
+ return false;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Does nothing
+ * Required by the ArrayAccess implementation
+ *
+ * @param int $offset
+ */
+ public function offsetUnset($offset): void
+ {
+ }
+}
diff --git a/library/vendor/Zend/ProgressBar.php b/library/vendor/Zend/ProgressBar.php
new file mode 100644
index 0000000..60804ee
--- /dev/null
+++ b/library/vendor/Zend/ProgressBar.php
@@ -0,0 +1,207 @@
+<?php
+/**
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_ProgressBar
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_ProgressBar offers an interface for multiple enviroments.
+ *
+ * @category Zend
+ * @package Zend_ProgressBar
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_ProgressBar
+{
+ /**
+ * Min value
+ *
+ * @var float
+ */
+ protected $_min;
+
+ /**
+ * Max value
+ *
+ * @var float
+ */
+ protected $_max;
+
+ /**
+ * Current value
+ *
+ * @var float
+ */
+ protected $_current;
+
+ /**
+ * Start time of the progressbar, required for ETA
+ *
+ * @var integer
+ */
+ protected $_startTime;
+
+ /**
+ * Current status text
+ *
+ * @var string
+ */
+ protected $_statusText = null;
+
+ /**
+ * Adapter for the output
+ *
+ * @var Zend_ProgressBar_Adapter
+ */
+ protected $_adapter;
+
+ /**
+ * Namespace for keeping the progressbar persistent
+ *
+ * @var string
+ */
+ protected $_persistenceNamespace = null;
+
+ /**
+ * Create a new progressbar backend.
+ *
+ * @param Zend_ProgressBar_Adapter $adapter
+ * @param float $min
+ * @param float $max
+ * @param string $persistenceNamespace
+ * @throws Zend_ProgressBar_Exception When $min is greater than $max
+ */
+ public function __construct(Zend_ProgressBar_Adapter $adapter, $min = 0, $max = 100, $persistenceNamespace = null)
+ {
+ // Check min/max values and set them
+ if ($min > $max) {
+ throw new Zend_ProgressBar_Exception('$max must be greater than $min');
+ }
+
+ $this->_min = (float) $min;
+ $this->_max = (float) $max;
+ $this->_current = (float) $min;
+
+ // See if we have to open a session namespace
+ if ($persistenceNamespace !== null) {
+
+ $this->_persistenceNamespace = new Zend_Session_Namespace($persistenceNamespace);
+ }
+
+ // Set adapter
+ $this->_adapter = $adapter;
+
+ // Track the start time
+ $this->_startTime = time();
+
+ // See If a persistenceNamespace exists and handle accordingly
+ if ($this->_persistenceNamespace !== null) {
+ if (isset($this->_persistenceNamespace->isSet)) {
+ $this->_startTime = $this->_persistenceNamespace->startTime;
+ $this->_current = $this->_persistenceNamespace->current;
+ $this->_statusText = $this->_persistenceNamespace->statusText;
+ } else {
+ $this->_persistenceNamespace->isSet = true;
+ $this->_persistenceNamespace->startTime = $this->_startTime;
+ $this->_persistenceNamespace->current = $this->_current;
+ $this->_persistenceNamespace->statusText = $this->_statusText;
+ }
+ } else {
+ $this->update();
+ }
+ }
+
+ /**
+ * Get the current adapter
+ *
+ * @return Zend_ProgressBar_Adapter
+ */
+ public function getAdapter()
+ {
+ return $this->_adapter;
+ }
+
+ /**
+ * Update the progressbar
+ *
+ * @param float $value
+ * @param string $text
+ * @return void
+ */
+ public function update($value = null, $text = null)
+ {
+ // Update value if given
+ if ($value !== null) {
+ $this->_current = min($this->_max, max($this->_min, $value));
+ }
+
+ // Update text if given
+ if ($text !== null) {
+ $this->_statusText = $text;
+ }
+
+ // See if we have to update a namespace
+ if ($this->_persistenceNamespace !== null) {
+ $this->_persistenceNamespace->current = $this->_current;
+ $this->_persistenceNamespace->statusText = $this->_statusText;
+ }
+
+ // Calculate percent
+ if ($this->_min === $this->_max) {
+ $percent = false;
+ } else {
+ $percent = (float) ($this->_current - $this->_min) / ($this->_max - $this->_min);
+ }
+
+ // Calculate ETA
+ $timeTaken = time() - $this->_startTime;
+
+ if ($percent === .0 || $percent === false) {
+ $timeRemaining = null;
+ } else {
+ $timeRemaining = round(((1 / $percent) * $timeTaken) - $timeTaken);
+ }
+
+ // Poll the adapter
+ $this->_adapter->notify($this->_current, $this->_max, $percent, $timeTaken, $timeRemaining, $this->_statusText);
+ }
+
+ /**
+ * Update the progressbar to the next value
+ *
+ * @param string $text
+ * @return void
+ */
+ public function next($diff = 1, $text = null)
+ {
+ $this->update(max($this->_min, min($this->_max, $this->_current + $diff)), $text);
+ }
+
+ /**
+ * Call the adapters finish() behaviour
+ *
+ * @return void
+ */
+ public function finish()
+ {
+ if ($this->_persistenceNamespace !== null) {
+ unset($this->_persistenceNamespace->isSet);
+ }
+
+ $this->_adapter->finish();
+ }
+}
diff --git a/library/vendor/Zend/ProgressBar/Adapter.php b/library/vendor/Zend/ProgressBar/Adapter.php
new file mode 100644
index 0000000..89e5918
--- /dev/null
+++ b/library/vendor/Zend/ProgressBar/Adapter.php
@@ -0,0 +1,113 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_ProgressBar
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Abstract class for Zend_ProgressBar_Adapters
+ *
+ * @category Zend
+ * @package Zend_ProgressBar
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_ProgressBar_Adapter
+{
+ /**
+ * Option keys to skip when calling setOptions()
+ *
+ * @var array
+ */
+ protected $_skipOptions = array(
+ 'options',
+ 'config',
+ );
+
+ /**
+ * Create a new adapter
+ *
+ * $options may be either be an array or a Zend_Config object which
+ * specifies adapter related options.
+ *
+ * @param null|array|Zend_Config $options
+ */
+ public function __construct($options = null)
+ {
+ if (is_array($options)) {
+ $this->setOptions($options);
+ } elseif ($options instanceof Zend_Config) {
+ $this->setConfig($options);
+ }
+ }
+
+ /**
+ * Set options via a Zend_Config instance
+ *
+ * @param Zend_Config $config
+ * @return Zend_ProgressBar_Adapter
+ */
+ public function setConfig(Zend_Config $config)
+ {
+ $this->setOptions($config->toArray());
+
+ return $this;
+ }
+
+ /**
+ * Set options via an array
+ *
+ * @param array $options
+ * @return Zend_ProgressBar_Adapter
+ */
+ public function setOptions(array $options)
+ {
+ foreach ($options as $key => $value) {
+ if (in_array(strtolower($key), $this->_skipOptions)) {
+ continue;
+ }
+
+ $method = 'set' . ucfirst($key);
+ if (method_exists($this, $method)) {
+ $this->$method($value);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Notify the adapter about an update
+ *
+ * @param float $current Current progress value
+ * @param float $max Max progress value
+ * @param float $percent Current percent value
+ * @param integer $timeTaken Taken time in seconds
+ * @param integer $timeRemaining Remaining time in seconds
+ * @param string $text Status text
+ * @return void
+ */
+ abstract public function notify($current, $max, $percent, $timeTaken, $timeRemaining, $text);
+
+ /**
+ * Called when the progress is explicitly finished
+ *
+ * @return void
+ */
+ abstract public function finish();
+}
diff --git a/library/vendor/Zend/ProgressBar/Adapter/Exception.php b/library/vendor/Zend/ProgressBar/Adapter/Exception.php
new file mode 100644
index 0000000..110fced
--- /dev/null
+++ b/library/vendor/Zend/ProgressBar/Adapter/Exception.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_ProgressBar
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_ProgressBar_Exception
+ */
+
+/**
+ * Exception class for Zend_ProgressBar_Adapter
+ *
+ * @category Zend
+ * @package Zend_ProgressBar
+ * @uses Zend_ProgressBar_Exception
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_ProgressBar_Adapter_Exception extends Zend_ProgressBar_Exception
+{
+}
diff --git a/library/vendor/Zend/ProgressBar/Adapter/JsPull.php b/library/vendor/Zend/ProgressBar/Adapter/JsPull.php
new file mode 100644
index 0000000..cb9b5bd
--- /dev/null
+++ b/library/vendor/Zend/ProgressBar/Adapter/JsPull.php
@@ -0,0 +1,115 @@
+<?php
+/**
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_ProgressBar
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Json
+ */
+
+/**
+ * @see Zend_ProgressBar_Adapter
+ */
+
+/**
+ * Zend_ProgressBar_Adapter_JsPull offers a simple method for updating a
+ * progressbar in a browser.
+ *
+ * @category Zend
+ * @package Zend_ProgressBar
+ * @uses Zend_ProgressBar_Adapter_Interface
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_ProgressBar_Adapter_JsPull extends Zend_ProgressBar_Adapter
+{
+ /**
+ * Wether to exit after json data send or not
+ *
+ * @var boolean
+ */
+ protected $_exitAfterSend = true;
+
+ /**
+ * Set wether to exit after json data send or not
+ *
+ * @param boolean $exitAfterSend
+ * @return Zend_ProgressBar_Adapter_JsPull
+ */
+ public function setExitAfterSend($exitAfterSend)
+ {
+ $this->_exitAfterSend = $exitAfterSend;
+ }
+
+ /**
+ * Defined by Zend_ProgressBar_Adapter_Interface
+ *
+ * @param float $current Current progress value
+ * @param float $max Max progress value
+ * @param float $percent Current percent value
+ * @param integer $timeTaken Taken time in seconds
+ * @param integer $timeRemaining Remaining time in seconds
+ * @param string $text Status text
+ * @return void
+ */
+ public function notify($current, $max, $percent, $timeTaken, $timeRemaining, $text)
+ {
+ $arguments = array(
+ 'current' => $current,
+ 'max' => $max,
+ 'percent' => ($percent * 100),
+ 'timeTaken' => $timeTaken,
+ 'timeRemaining' => $timeRemaining,
+ 'text' => $text,
+ 'finished' => false
+ );
+
+ $data = Zend_Json::encode($arguments);
+
+ // Output the data
+ $this->_outputData($data);
+ }
+
+ /**
+ * Defined by Zend_ProgressBar_Adapter_Interface
+ *
+ * @return void
+ */
+ public function finish()
+ {
+ $data = Zend_Json::encode(array('finished' => true));
+
+ $this->_outputData($data);
+ }
+
+ /**
+ * Outputs given data the user agent.
+ *
+ * This split-off is required for unit-testing.
+ *
+ * @param string $data
+ * @return void
+ */
+ protected function _outputData($data)
+ {
+ echo $data;
+
+ if ($this->_exitAfterSend) {
+ exit;
+ }
+ }
+}
diff --git a/library/vendor/Zend/ProgressBar/Adapter/JsPush.php b/library/vendor/Zend/ProgressBar/Adapter/JsPush.php
new file mode 100644
index 0000000..f43d85e
--- /dev/null
+++ b/library/vendor/Zend/ProgressBar/Adapter/JsPush.php
@@ -0,0 +1,146 @@
+<?php
+/**
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_ProgressBar
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Json
+ */
+
+/**
+ * @see Zend_ProgressBar_Adapter
+ */
+
+/**
+ * Zend_ProgressBar_Adapter_JsPush offers a simple method for updating a
+ * progressbar in a browser.
+ *
+ * @category Zend
+ * @package Zend_ProgressBar
+ * @uses Zend_ProgressBar_Adapter_Interface
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_ProgressBar_Adapter_JsPush extends Zend_ProgressBar_Adapter
+{
+ /**
+ * Name of the JavaScript method to call on update
+ *
+ * @var string
+ */
+ protected $_updateMethodName = 'Zend_ProgressBar_Update';
+
+ /**
+ * Name of the JavaScript method to call on finish
+ *
+ * @var string
+ */
+ protected $_finishMethodName;
+
+ /**
+ * Set the update method name
+ *
+ * @param string $methodName
+ * @return Zend_ProgressBar_Adapter_JsPush
+ */
+ public function setUpdateMethodName($methodName)
+ {
+ $this->_updateMethodName = $methodName;
+
+ return $this;
+ }
+
+ /**
+ * Set the finish method name
+ *
+ * @param string $methodName
+ * @return Zend_ProgressBar_Adapter_JsPush
+ */
+ public function setFinishMethodName($methodName)
+ {
+ $this->_finishMethodName = $methodName;
+
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_ProgressBar_Adapter_Interface
+ *
+ * @param float $current Current progress value
+ * @param float $max Max progress value
+ * @param float $percent Current percent value
+ * @param integer $timeTaken Taken time in seconds
+ * @param integer $timeRemaining Remaining time in seconds
+ * @param string $text Status text
+ * @return void
+ */
+ public function notify($current, $max, $percent, $timeTaken, $timeRemaining, $text)
+ {
+ $arguments = array(
+ 'current' => $current,
+ 'max' => $max,
+ 'percent' => ($percent * 100),
+ 'timeTaken' => $timeTaken,
+ 'timeRemaining' => $timeRemaining,
+ 'text' => $text
+ );
+
+ $data = '<script type="text/javascript">'
+ . 'parent.' . $this->_updateMethodName . '(' . Zend_Json::encode($arguments) . ');'
+ . '</script>';
+
+ // Output the data
+ $this->_outputData($data);
+ }
+
+ /**
+ * Defined by Zend_ProgressBar_Adapter_Interface
+ *
+ * @return void
+ */
+ public function finish()
+ {
+ if ($this->_finishMethodName === null) {
+ return;
+ }
+
+ $data = '<script type="text/javascript">'
+ . 'parent.' . $this->_finishMethodName . '();'
+ . '</script>';
+
+ $this->_outputData($data);
+ }
+
+ /**
+ * Outputs given data the user agent.
+ *
+ * This split-off is required for unit-testing.
+ *
+ * @param string $data
+ * @return void
+ */
+ protected function _outputData($data)
+ {
+ // 1024 padding is required for Safari, while 256 padding is required
+ // for Internet Explorer. The <br /> is required so Safari actually
+ // executes the <script />
+ echo str_pad($data . '<br />', 1024, ' ', STR_PAD_RIGHT) . "\n";
+
+ flush();
+ ob_flush();
+ }
+}
diff --git a/library/vendor/Zend/ProgressBar/Exception.php b/library/vendor/Zend/ProgressBar/Exception.php
new file mode 100644
index 0000000..b002520
--- /dev/null
+++ b/library/vendor/Zend/ProgressBar/Exception.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_ProgressBar
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Exception
+ */
+
+/**
+ * Exception class for Zend_ProgressBar
+ *
+ * @category Zend
+ * @package Zend_ProgressBar
+ * @uses Zend_Exception
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_ProgressBar_Exception extends Zend_Exception
+{
+}
diff --git a/library/vendor/Zend/README.md b/library/vendor/Zend/README.md
new file mode 100644
index 0000000..6c5445b
--- /dev/null
+++ b/library/vendor/Zend/README.md
@@ -0,0 +1,8 @@
+# icingaweb2-vendor-zf1
+
+icingaweb2-vendor-zf1 is [Icinga Web 2](https://www.icinga.org/products/icinga-web-2/)'s fork of
+[Zend Framework](https://framework.zend.com/) 1 which is
+[end-of-life](https://framework.zend.com/blog/2016-06-28-zf1-eol.html) since Sep 28, 2016.
+We've reduced the library to the minimum required by Icinga Web 2 and its modules.
+The Icinga Project will provide security and bug fixes.
+icingaweb2-vendor-zf1 is based on Zend Framework 1 version 1.12.20.
diff --git a/library/vendor/Zend/Registry.php b/library/vendor/Zend/Registry.php
new file mode 100644
index 0000000..59b971e
--- /dev/null
+++ b/library/vendor/Zend/Registry.php
@@ -0,0 +1,192 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Registry
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Generic storage class helps to manage global data.
+ *
+ * @category Zend
+ * @package Zend_Registry
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Registry extends ArrayObject
+{
+ /**
+ * Class name of the singleton registry object.
+ * @var string
+ */
+ private static $_registryClassName = 'Zend_Registry';
+
+ /**
+ * Registry object provides storage for shared objects.
+ * @var Zend_Registry
+ */
+ private static $_registry = null;
+
+ /**
+ * Retrieves the default registry instance.
+ *
+ * @return Zend_Registry
+ */
+ public static function getInstance()
+ {
+ if (self::$_registry === null) {
+ self::init();
+ }
+
+ return self::$_registry;
+ }
+
+ /**
+ * Set the default registry instance to a specified instance.
+ *
+ * @param Zend_Registry $registry An object instance of type Zend_Registry,
+ * or a subclass.
+ * @return void
+ * @throws Zend_Exception if registry is already initialized.
+ */
+ public static function setInstance(Zend_Registry $registry)
+ {
+ if (self::$_registry !== null) {
+ throw new Zend_Exception('Registry is already initialized');
+ }
+
+ self::setClassName(get_class($registry));
+ self::$_registry = $registry;
+ }
+
+ /**
+ * Initialize the default registry instance.
+ *
+ * @return void
+ */
+ protected static function init()
+ {
+ self::setInstance(new self::$_registryClassName());
+ }
+
+ /**
+ * Set the class name to use for the default registry instance.
+ * Does not affect the currently initialized instance, it only applies
+ * for the next time you instantiate.
+ *
+ * @param string $registryClassName
+ * @return void
+ * @throws Zend_Exception if the registry is initialized or if the
+ * class name is not valid.
+ */
+ public static function setClassName($registryClassName = 'Zend_Registry')
+ {
+ if (self::$_registry !== null) {
+ throw new Zend_Exception('Registry is already initialized');
+ }
+
+ if (!is_string($registryClassName)) {
+ throw new Zend_Exception("Argument is not a class name");
+ }
+
+ /**
+ * @see Zend_Loader
+ */
+ if (!class_exists($registryClassName)) {
+ Zend_Loader::loadClass($registryClassName);
+ }
+
+ self::$_registryClassName = $registryClassName;
+ }
+
+ /**
+ * Unset the default registry instance.
+ * Primarily used in tearDown() in unit tests.
+ * @returns void
+ */
+ public static function _unsetInstance()
+ {
+ self::$_registry = null;
+ }
+
+ /**
+ * getter method, basically same as offsetGet().
+ *
+ * This method can be called from an object of type Zend_Registry, or it
+ * can be called statically. In the latter case, it uses the default
+ * static instance stored in the class.
+ *
+ * @param string $index - get the value associated with $index
+ * @return mixed
+ * @throws Zend_Exception if no entry is registered for $index.
+ */
+ public static function get($index)
+ {
+ $instance = self::getInstance();
+
+ if (!$instance->offsetExists($index)) {
+ throw new Zend_Exception("No entry is registered for key '$index'");
+ }
+
+ return $instance->offsetGet($index);
+ }
+
+ /**
+ * setter method, basically same as offsetSet().
+ *
+ * This method can be called from an object of type Zend_Registry, or it
+ * can be called statically. In the latter case, it uses the default
+ * static instance stored in the class.
+ *
+ * @param string $index The location in the ArrayObject in which to store
+ * the value.
+ * @param mixed $value The object to store in the ArrayObject.
+ * @return void
+ */
+ public static function set($index, $value)
+ {
+ $instance = self::getInstance();
+ $instance->offsetSet($index, $value);
+ }
+
+ /**
+ * Returns TRUE if the $index is a named value in the registry,
+ * or FALSE if $index was not found in the registry.
+ *
+ * @param string $index
+ * @return boolean
+ */
+ public static function isRegistered($index)
+ {
+ if (self::$_registry === null) {
+ return false;
+ }
+ return self::$_registry->offsetExists($index);
+ }
+
+ /**
+ * Constructs a parent ArrayObject with default
+ * ARRAY_AS_PROPS to allow acces as an object
+ *
+ * @param array $array data array
+ * @param integer $flags ArrayObject flags
+ */
+ public function __construct($array = array(), $flags = parent::ARRAY_AS_PROPS)
+ {
+ parent::__construct($array, $flags);
+ }
+}
diff --git a/library/vendor/Zend/Server/Abstract.php b/library/vendor/Zend/Server/Abstract.php
new file mode 100644
index 0000000..7f3d1eb
--- /dev/null
+++ b/library/vendor/Zend/Server/Abstract.php
@@ -0,0 +1,235 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Server_Interface */
+
+/**
+ * Zend_Server_Definition
+ */
+
+/**
+ * Zend_Server_Method_Definition
+ */
+
+/**
+ * Zend_Server_Method_Callback
+ */
+
+/**
+ * Zend_Server_Method_Prototype
+ */
+
+/**
+ * Zend_Server_Method_Parameter
+ */
+
+/**
+ * Zend_Server_Abstract
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+abstract class Zend_Server_Abstract implements Zend_Server_Interface
+{
+ /**
+ * @deprecated
+ * @var array List of PHP magic methods (lowercased)
+ */
+ protected static $magic_methods = array(
+ '__call',
+ '__clone',
+ '__construct',
+ '__destruct',
+ '__get',
+ '__isset',
+ '__set',
+ '__set_state',
+ '__sleep',
+ '__tostring',
+ '__unset',
+ '__wakeup',
+ );
+
+ /**
+ * @var bool Flag; whether or not overwriting existing methods is allowed
+ */
+ protected $_overwriteExistingMethods = false;
+
+ /**
+ * @var Zend_Server_Definition
+ */
+ protected $_table;
+
+ /**
+ * Constructor
+ *
+ * Setup server description
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ $this->_table = new Zend_Server_Definition();
+ $this->_table->setOverwriteExistingMethods($this->_overwriteExistingMethods);
+ }
+
+ /**
+ * Returns a list of registered methods
+ *
+ * Returns an array of method definitions.
+ *
+ * @return Zend_Server_Definition
+ */
+ public function getFunctions()
+ {
+ return $this->_table;
+ }
+
+ /**
+ * Lowercase a string
+ *
+ * Lowercase's a string by reference
+ *
+ * @deprecated
+ * @param string $string value
+ * @param string $key
+ * @return string Lower cased string
+ */
+ public static function lowerCase(&$value, &$key)
+ {
+ trigger_error(__CLASS__ . '::' . __METHOD__ . '() is deprecated and will be removed in a future version', E_USER_NOTICE);
+ return $value = strtolower($value);
+ }
+
+ /**
+ * Build callback for method signature
+ *
+ * @param Zend_Server_Reflection_Function_Abstract $reflection
+ * @return Zend_Server_Method_Callback
+ */
+ protected function _buildCallback(Zend_Server_Reflection_Function_Abstract $reflection)
+ {
+ $callback = new Zend_Server_Method_Callback();
+ if ($reflection instanceof Zend_Server_Reflection_Method) {
+ $callback->setType($reflection->isStatic() ? 'static' : 'instance')
+ ->setClass($reflection->getDeclaringClass()->getName())
+ ->setMethod($reflection->getName());
+ } elseif ($reflection instanceof Zend_Server_Reflection_Function) {
+ $callback->setType('function')
+ ->setFunction($reflection->getName());
+ }
+ return $callback;
+ }
+
+ /**
+ * Build a method signature
+ *
+ * @param Zend_Server_Reflection_Function_Abstract $reflection
+ * @param null|string|object $class
+ * @return Zend_Server_Method_Definition
+ * @throws Zend_Server_Exception on duplicate entry
+ */
+ protected function _buildSignature(Zend_Server_Reflection_Function_Abstract $reflection, $class = null)
+ {
+ $ns = $reflection->getNamespace();
+ $name = $reflection->getName();
+ $method = empty($ns) ? $name : $ns . '.' . $name;
+
+ if (!$this->_overwriteExistingMethods && $this->_table->hasMethod($method)) {
+ throw new Zend_Server_Exception('Duplicate method registered: ' . $method);
+ }
+
+ $definition = new Zend_Server_Method_Definition();
+ $definition->setName($method)
+ ->setCallback($this->_buildCallback($reflection))
+ ->setMethodHelp($reflection->getDescription())
+ ->setInvokeArguments($reflection->getInvokeArguments());
+
+ foreach ($reflection->getPrototypes() as $proto) {
+ $prototype = new Zend_Server_Method_Prototype();
+ $prototype->setReturnType($this->_fixType($proto->getReturnType()));
+ foreach ($proto->getParameters() as $parameter) {
+ $param = new Zend_Server_Method_Parameter(array(
+ 'type' => $this->_fixType($parameter->getType()),
+ 'name' => $parameter->getName(),
+ 'optional' => $parameter->isOptional(),
+ ));
+ if ($parameter->isDefaultValueAvailable()) {
+ $param->setDefaultValue($parameter->getDefaultValue());
+ }
+ $prototype->addParameter($param);
+ }
+ $definition->addPrototype($prototype);
+ }
+ if (is_object($class)) {
+ $definition->setObject($class);
+ }
+ $this->_table->addMethod($definition);
+ return $definition;
+ }
+
+ /**
+ * Dispatch method
+ *
+ * @param Zend_Server_Method_Definition $invocable
+ * @param array $params
+ * @return mixed
+ */
+ protected function _dispatch(Zend_Server_Method_Definition $invocable, array $params)
+ {
+ $callback = $invocable->getCallback();
+ $type = $callback->getType();
+
+ if ('function' == $type) {
+ $function = $callback->getFunction();
+ return call_user_func_array($function, $params);
+ }
+
+ $class = $callback->getClass();
+ $method = $callback->getMethod();
+
+ if ('static' == $type) {
+ return call_user_func_array(array($class, $method), $params);
+ }
+
+ $object = $invocable->getObject();
+ if (!is_object($object)) {
+ $invokeArgs = $invocable->getInvokeArguments();
+ if (!empty($invokeArgs)) {
+ $reflection = new ReflectionClass($class);
+ $object = $reflection->newInstanceArgs(array_values($invokeArgs));
+ } else {
+ $object = new $class;
+ }
+ }
+ return call_user_func_array(array($object, $method), $params);
+ }
+
+ /**
+ * Map PHP type to protocol type
+ *
+ * @param string $type
+ * @return string
+ */
+ abstract protected function _fixType($type);
+}
diff --git a/library/vendor/Zend/Server/Cache.php b/library/vendor/Zend/Server/Cache.php
new file mode 100644
index 0000000..97264df
--- /dev/null
+++ b/library/vendor/Zend/Server/Cache.php
@@ -0,0 +1,147 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Server_Cache: cache server definitions
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Server_Cache
+{
+ /**
+ * @var array Methods to skip when caching server
+ */
+ protected static $_skipMethods = array();
+
+ /**
+ * Cache a file containing the dispatch list.
+ *
+ * Serializes the server definition stores the information
+ * in $filename.
+ *
+ * Returns false on any error (typically, inability to write to file), true
+ * on success.
+ *
+ * @param string $filename
+ * @param Zend_Server_Interface $server
+ * @return bool
+ */
+ public static function save($filename, Zend_Server_Interface $server)
+ {
+ if (!is_string($filename)
+ || (!file_exists($filename) && !is_writable(dirname($filename))))
+ {
+ return false;
+ }
+
+ $methods = $server->getFunctions();
+
+ if ($methods instanceof Zend_Server_Definition) {
+ $definition = new Zend_Server_Definition();
+ foreach ($methods as $method) {
+ if (in_array($method->getName(), self::$_skipMethods)) {
+ continue;
+ }
+ $definition->addMethod($method);
+ }
+ $methods = $definition;
+ }
+
+ if (0 === @file_put_contents($filename, serialize($methods))) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Load server definition from a file
+ *
+ * Unserializes a stored server definition from $filename. Returns false if
+ * it fails in any way, true on success.
+ *
+ * Useful to prevent needing to build the server definition on each
+ * request. Sample usage:
+ *
+ * <code>
+ * if (!Zend_Server_Cache::get($filename, $server)) {
+ * require_once 'Some/Service/Class.php';
+ * require_once 'Another/Service/Class.php';
+ *
+ * // Attach Some_Service_Class with namespace 'some'
+ * $server->attach('Some_Service_Class', 'some');
+ *
+ * // Attach Another_Service_Class with namespace 'another'
+ * $server->attach('Another_Service_Class', 'another');
+ *
+ * Zend_Server_Cache::save($filename, $server);
+ * }
+ *
+ * $response = $server->handle();
+ * echo $response;
+ * </code>
+ *
+ * @param string $filename
+ * @param Zend_Server_Interface $server
+ * @return bool
+ */
+ public static function get($filename, Zend_Server_Interface $server)
+ {
+ if (!is_string($filename)
+ || !file_exists($filename)
+ || !is_readable($filename))
+ {
+ return false;
+ }
+
+
+ if (false === ($dispatch = @file_get_contents($filename))) {
+ return false;
+ }
+
+ if (false === ($dispatchArray = @unserialize($dispatch))) {
+ return false;
+ }
+
+ $server->loadFunctions($dispatchArray);
+
+ return true;
+ }
+
+ /**
+ * Remove a cache file
+ *
+ * @param string $filename
+ * @return boolean
+ */
+ public static function delete($filename)
+ {
+ if (is_string($filename) && file_exists($filename)) {
+ unlink($filename);
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/Server/Definition.php b/library/vendor/Zend/Server/Definition.php
new file mode 100644
index 0000000..fb8d24a
--- /dev/null
+++ b/library/vendor/Zend/Server/Definition.php
@@ -0,0 +1,263 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Server methods metadata
+ *
+ * @todo Implement iterator
+ * @category Zend
+ * @package Zend_Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Server_Definition implements Countable, Iterator
+{
+ /**
+ * @var array Array of Zend_Server_Method_Definition objects
+ */
+ protected $_methods = array();
+
+ /**
+ * @var bool Whether or not overwriting existing methods is allowed
+ */
+ protected $_overwriteExistingMethods = false;
+
+ /**
+ * Constructor
+ *
+ * @param null|array $methods
+ * @return void
+ */
+ public function __construct($methods = null)
+ {
+ if (is_array($methods)) {
+ $this->setMethods($methods);
+ }
+ }
+
+ /**
+ * Set flag indicating whether or not overwriting existing methods is allowed
+ *
+ * @param mixed $flag
+ * @return void
+ */
+ public function setOverwriteExistingMethods($flag)
+ {
+ $this->_overwriteExistingMethods = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Add method to definition
+ *
+ * @param array|Zend_Server_Method_Definition $method
+ * @param null|string $name
+ * @return Zend_Server_Definition
+ * @throws Zend_Server_Exception if duplicate or invalid method provided
+ */
+ public function addMethod($method, $name = null)
+ {
+ if (is_array($method)) {
+ $method = new Zend_Server_Method_Definition($method);
+ } elseif (!$method instanceof Zend_Server_Method_Definition) {
+ throw new Zend_Server_Exception('Invalid method provided');
+ }
+
+ if (is_numeric($name)) {
+ $name = null;
+ }
+ if (null !== $name) {
+ $method->setName($name);
+ } else {
+ $name = $method->getName();
+ }
+ if (null === $name) {
+ throw new Zend_Server_Exception('No method name provided');
+ }
+
+ if (!$this->_overwriteExistingMethods && array_key_exists($name, $this->_methods)) {
+ throw new Zend_Server_Exception(sprintf('Method by name of "%s" already exists', $name));
+ }
+ $this->_methods[$name] = $method;
+ return $this;
+ }
+
+ /**
+ * Add multiple methods
+ *
+ * @param array $methods Array of Zend_Server_Method_Definition objects or arrays
+ * @return Zend_Server_Definition
+ */
+ public function addMethods(array $methods)
+ {
+ foreach ($methods as $key => $method) {
+ $this->addMethod($method, $key);
+ }
+ return $this;
+ }
+
+ /**
+ * Set all methods at once (overwrite)
+ *
+ * @param array $methods Array of Zend_Server_Method_Definition objects or arrays
+ * @return Zend_Server_Definition
+ */
+ public function setMethods(array $methods)
+ {
+ $this->clearMethods();
+ $this->addMethods($methods);
+ return $this;
+ }
+
+ /**
+ * Does the definition have the given method?
+ *
+ * @param string $method
+ * @return bool
+ */
+ public function hasMethod($method)
+ {
+ return array_key_exists($method, $this->_methods);
+ }
+
+ /**
+ * Get a given method definition
+ *
+ * @param string $method
+ * @return null|Zend_Server_Method_Definition
+ */
+ public function getMethod($method)
+ {
+ if ($this->hasMethod($method)) {
+ return $this->_methods[$method];
+ }
+ return false;
+ }
+
+ /**
+ * Get all method definitions
+ *
+ * @return array Array of Zend_Server_Method_Definition objects
+ */
+ public function getMethods()
+ {
+ return $this->_methods;
+ }
+
+ /**
+ * Remove a method definition
+ *
+ * @param string $method
+ * @return Zend_Server_Definition
+ */
+ public function removeMethod($method)
+ {
+ if ($this->hasMethod($method)) {
+ unset($this->_methods[$method]);
+ }
+ return $this;
+ }
+
+ /**
+ * Clear all method definitions
+ *
+ * @return Zend_Server_Definition
+ */
+ public function clearMethods()
+ {
+ $this->_methods = array();
+ return $this;
+ }
+
+ /**
+ * Cast definition to an array
+ *
+ * @return array
+ */
+ public function toArray()
+ {
+ $methods = array();
+ foreach ($this->getMethods() as $key => $method) {
+ $methods[$key] = $method->toArray();
+ }
+ return $methods;
+ }
+
+ /**
+ * Countable: count of methods
+ *
+ * @return int
+ */
+ public function count()
+ {
+ return count($this->_methods);
+ }
+
+ /**
+ * Iterator: current item
+ *
+ * @return mixed
+ */
+ public function current()
+ {
+ return current($this->_methods);
+ }
+
+ /**
+ * Iterator: current item key
+ *
+ * @return int|string
+ */
+ public function key()
+ {
+ return key($this->_methods);
+ }
+
+ /**
+ * Iterator: advance to next method
+ *
+ * @return void
+ */
+ public function next()
+ {
+ return next($this->_methods);
+ }
+
+ /**
+ * Iterator: return to first method
+ *
+ * @return void
+ */
+ public function rewind()
+ {
+ return reset($this->_methods);
+ }
+
+ /**
+ * Iterator: is the current index valid?
+ *
+ * @return bool
+ */
+ public function valid()
+ {
+ return (bool) $this->current();
+ }
+}
diff --git a/library/vendor/Zend/Server/Exception.php b/library/vendor/Zend/Server/Exception.php
new file mode 100644
index 0000000..c3b9c9f
--- /dev/null
+++ b/library/vendor/Zend/Server/Exception.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * Zend_Exception
+ */
+
+/**
+ * Zend_Server_Reflection exceptions
+ *
+ * @package Zend_Server
+ * @subpackage Reflection
+ * @version $Id$
+ */
+class Zend_Server_Exception extends Zend_Exception
+{
+}
diff --git a/library/vendor/Zend/Server/Interface.php b/library/vendor/Zend/Server/Interface.php
new file mode 100644
index 0000000..cc60bc5
--- /dev/null
+++ b/library/vendor/Zend/Server/Interface.php
@@ -0,0 +1,118 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * Zend_Server_Interface
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+interface Zend_Server_Interface
+{
+ /**
+ * Attach a function as a server method
+ *
+ * Namespacing is primarily for xmlrpc, but may be used with other
+ * implementations to prevent naming collisions.
+ *
+ * @param string $function
+ * @param string $namespace
+ * @param null|array Optional array of arguments to pass to callbacks at
+ * dispatch.
+ * @return void
+ */
+ public function addFunction($function, $namespace = '');
+
+ /**
+ * Attach a class to a server
+ *
+ * The individual implementations should probably allow passing a variable
+ * number of arguments in, so that developers may define custom runtime
+ * arguments to pass to server methods.
+ *
+ * Namespacing is primarily for xmlrpc, but could be used for other
+ * implementations as well.
+ *
+ * @param mixed $class Class name or object instance to examine and attach
+ * to the server.
+ * @param string $namespace Optional namespace with which to prepend method
+ * names in the dispatch table.
+ * methods in the class will be valid callbacks.
+ * @param null|array Optional array of arguments to pass to callbacks at
+ * dispatch.
+ * @return void
+ */
+ public function setClass($class, $namespace = '', $argv = null);
+
+ /**
+ * Generate a server fault
+ *
+ * @param mixed $fault
+ * @param int $code
+ * @return mixed
+ */
+ public function fault($fault = null, $code = 404);
+
+ /**
+ * Handle a request
+ *
+ * Requests may be passed in, or the server may automagically determine the
+ * request based on defaults. Dispatches server request to appropriate
+ * method and returns a response
+ *
+ * @param mixed $request
+ * @return mixed
+ */
+ public function handle($request = false);
+
+ /**
+ * Return a server definition array
+ *
+ * Returns a server definition array as created using
+ * {@link * Zend_Server_Reflection}. Can be used for server introspection,
+ * documentation, or persistence.
+ *
+ * @access public
+ * @return array
+ */
+ public function getFunctions();
+
+ /**
+ * Load server definition
+ *
+ * Used for persistence; loads a construct as returned by {@link getFunctions()}.
+ *
+ * @param array $array
+ * @return void
+ */
+ public function loadFunctions($definition);
+
+ /**
+ * Set server persistence
+ *
+ * @todo Determine how to implement this
+ * @param int $mode
+ * @return void
+ */
+ public function setPersistence($mode);
+}
diff --git a/library/vendor/Zend/Server/Method/Callback.php b/library/vendor/Zend/Server/Method/Callback.php
new file mode 100644
index 0000000..3f81197
--- /dev/null
+++ b/library/vendor/Zend/Server/Method/Callback.php
@@ -0,0 +1,204 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @subpackage Method
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Method callback metadata
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @subpackage Method
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Server_Method_Callback
+{
+ /**
+ * @var string Class name for class method callback
+ */
+ protected $_class;
+
+ /**
+ * @var string Function name for function callback
+ */
+ protected $_function;
+
+ /**
+ * @var string Method name for class method callback
+ */
+ protected $_method;
+
+ /**
+ * @var string Callback type
+ */
+ protected $_type;
+
+ /**
+ * @var array Valid callback types
+ */
+ protected $_types = array('function', 'static', 'instance');
+
+ /**
+ * Constructor
+ *
+ * @param null|array $options
+ * @return void
+ */
+ public function __construct($options = null)
+ {
+ if ((null !== $options) && is_array($options)) {
+ $this->setOptions($options);
+ }
+ }
+
+ /**
+ * Set object state from array of options
+ *
+ * @param array $options
+ * @return Zend_Server_Method_Callback
+ */
+ public function setOptions(array $options)
+ {
+ foreach ($options as $key => $value) {
+ $method = 'set' . ucfirst($key);
+ if (method_exists($this, $method)) {
+ $this->$method($value);
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Set callback class
+ *
+ * @param string $class
+ * @return Zend_Server_Method_Callback
+ */
+ public function setClass($class)
+ {
+ if (is_object($class)) {
+ $class = get_class($class);
+ }
+ $this->_class = $class;
+ return $this;
+ }
+
+ /**
+ * Get callback class
+ *
+ * @return string|null
+ */
+ public function getClass()
+ {
+ return $this->_class;
+ }
+
+ /**
+ * Set callback function
+ *
+ * @param string $function
+ * @return Zend_Server_Method_Callback
+ */
+ public function setFunction($function)
+ {
+ $this->_function = (string) $function;
+ $this->setType('function');
+ return $this;
+ }
+
+ /**
+ * Get callback function
+ *
+ * @return null|string
+ */
+ public function getFunction()
+ {
+ return $this->_function;
+ }
+
+ /**
+ * Set callback class method
+ *
+ * @param string $method
+ * @return Zend_Server_Method_Callback
+ */
+ public function setMethod($method)
+ {
+ $this->_method = $method;
+ return $this;
+ }
+
+ /**
+ * Get callback class method
+ *
+ * @return null|string
+ */
+ public function getMethod()
+ {
+ return $this->_method;
+ }
+
+ /**
+ * Set callback type
+ *
+ * @param string $type
+ * @return Zend_Server_Method_Callback
+ * @throws Zend_Server_Exception
+ */
+ public function setType($type)
+ {
+ if (!in_array($type, $this->_types)) {
+ throw new Zend_Server_Exception('Invalid method callback type passed to ' . __CLASS__ . '::' . __METHOD__);
+ }
+ $this->_type = $type;
+ return $this;
+ }
+
+ /**
+ * Get callback type
+ *
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->_type;
+ }
+
+ /**
+ * Cast callback to array
+ *
+ * @return array
+ */
+ public function toArray()
+ {
+ $type = $this->getType();
+ $array = array(
+ 'type' => $type,
+ );
+ if ('function' == $type) {
+ $array['function'] = $this->getFunction();
+ } else {
+ $array['class'] = $this->getClass();
+ $array['method'] = $this->getMethod();
+ }
+ return $array;
+ }
+}
diff --git a/library/vendor/Zend/Server/Method/Definition.php b/library/vendor/Zend/Server/Method/Definition.php
new file mode 100644
index 0000000..5635ae6
--- /dev/null
+++ b/library/vendor/Zend/Server/Method/Definition.php
@@ -0,0 +1,288 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @subpackage Method
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Method definition metadata
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @subpackage Method
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Server_Method_Definition
+{
+ /**
+ * @var Zend_Server_Method_Callback
+ */
+ protected $_callback;
+
+ /**
+ * @var array
+ */
+ protected $_invokeArguments = array();
+
+ /**
+ * @var string
+ */
+ protected $_methodHelp = '';
+
+ /**
+ * @var string
+ */
+ protected $_name;
+
+ /**
+ * @var null|object
+ */
+ protected $_object;
+
+ /**
+ * @var array Array of Zend_Server_Method_Prototype objects
+ */
+ protected $_prototypes = array();
+
+ /**
+ * Constructor
+ *
+ * @param null|array $options
+ * @return void
+ */
+ public function __construct($options = null)
+ {
+ if ((null !== $options) && is_array($options)) {
+ $this->setOptions($options);
+ }
+ }
+
+ /**
+ * Set object state from options
+ *
+ * @param array $options
+ * @return Zend_Server_Method_Definition
+ */
+ public function setOptions(array $options)
+ {
+ foreach ($options as $key => $value) {
+ $method = 'set' . ucfirst($key);
+ if (method_exists($this, $method)) {
+ $this->$method($value);
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Set method name
+ *
+ * @param string $name
+ * @return Zend_Server_Method_Definition
+ */
+ public function setName($name)
+ {
+ $this->_name = (string) $name;
+ return $this;
+ }
+
+ /**
+ * Get method name
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->_name;
+ }
+
+ /**
+ * Set method callback
+ *
+ * @param array|Zend_Server_Method_Callback $callback
+ * @return Zend_Server_Method_Definition
+ */
+ public function setCallback($callback)
+ {
+ if (is_array($callback)) {
+ $callback = new Zend_Server_Method_Callback($callback);
+ } elseif (!$callback instanceof Zend_Server_Method_Callback) {
+ throw new Zend_Server_Exception('Invalid method callback provided');
+ }
+ $this->_callback = $callback;
+ return $this;
+ }
+
+ /**
+ * Get method callback
+ *
+ * @return Zend_Server_Method_Callback
+ */
+ public function getCallback()
+ {
+ return $this->_callback;
+ }
+
+ /**
+ * Add prototype to method definition
+ *
+ * @param array|Zend_Server_Method_Prototype $prototype
+ * @return Zend_Server_Method_Definition
+ */
+ public function addPrototype($prototype)
+ {
+ if (is_array($prototype)) {
+ $prototype = new Zend_Server_Method_Prototype($prototype);
+ } elseif (!$prototype instanceof Zend_Server_Method_Prototype) {
+ throw new Zend_Server_Exception('Invalid method prototype provided');
+ }
+ $this->_prototypes[] = $prototype;
+ return $this;
+ }
+
+ /**
+ * Add multiple prototypes at once
+ *
+ * @param array $prototypes Array of Zend_Server_Method_Prototype objects or arrays
+ * @return Zend_Server_Method_Definition
+ */
+ public function addPrototypes(array $prototypes)
+ {
+ foreach ($prototypes as $prototype) {
+ $this->addPrototype($prototype);
+ }
+ return $this;
+ }
+
+ /**
+ * Set all prototypes at once (overwrites)
+ *
+ * @param array $prototypes Array of Zend_Server_Method_Prototype objects or arrays
+ * @return Zend_Server_Method_Definition
+ */
+ public function setPrototypes(array $prototypes)
+ {
+ $this->_prototypes = array();
+ $this->addPrototypes($prototypes);
+ return $this;
+ }
+
+ /**
+ * Get all prototypes
+ *
+ * @return array $prototypes Array of Zend_Server_Method_Prototype objects or arrays
+ */
+ public function getPrototypes()
+ {
+ return $this->_prototypes;
+ }
+
+ /**
+ * Set method help
+ *
+ * @param string $methodHelp
+ * @return Zend_Server_Method_Definition
+ */
+ public function setMethodHelp($methodHelp)
+ {
+ $this->_methodHelp = (string) $methodHelp;
+ return $this;
+ }
+
+ /**
+ * Get method help
+ *
+ * @return string
+ */
+ public function getMethodHelp()
+ {
+ return $this->_methodHelp;
+ }
+
+ /**
+ * Set object to use with method calls
+ *
+ * @param object $object
+ * @return Zend_Server_Method_Definition
+ */
+ public function setObject($object)
+ {
+ if (!is_object($object) && (null !== $object)) {
+ throw new Zend_Server_Exception('Invalid object passed to ' . __CLASS__ . '::' . __METHOD__);
+ }
+ $this->_object = $object;
+ return $this;
+ }
+
+ /**
+ * Get object to use with method calls
+ *
+ * @return null|object
+ */
+ public function getObject()
+ {
+ return $this->_object;
+ }
+
+ /**
+ * Set invoke arguments
+ *
+ * @param array $invokeArguments
+ * @return Zend_Server_Method_Definition
+ */
+ public function setInvokeArguments(array $invokeArguments)
+ {
+ $this->_invokeArguments = $invokeArguments;
+ return $this;
+ }
+
+ /**
+ * Retrieve invoke arguments
+ *
+ * @return array
+ */
+ public function getInvokeArguments()
+ {
+ return $this->_invokeArguments;
+ }
+
+ /**
+ * Serialize to array
+ *
+ * @return array
+ */
+ public function toArray()
+ {
+ $prototypes = $this->getPrototypes();
+ $signatures = array();
+ foreach ($prototypes as $prototype) {
+ $signatures[] = $prototype->toArray();
+ }
+
+ return array(
+ 'name' => $this->getName(),
+ 'callback' => $this->getCallback()->toArray(),
+ 'prototypes' => $signatures,
+ 'methodHelp' => $this->getMethodHelp(),
+ 'invokeArguments' => $this->getInvokeArguments(),
+ 'object' => $this->getObject(),
+ );
+ }
+}
diff --git a/library/vendor/Zend/Server/Method/Parameter.php b/library/vendor/Zend/Server/Method/Parameter.php
new file mode 100644
index 0000000..63e14a4
--- /dev/null
+++ b/library/vendor/Zend/Server/Method/Parameter.php
@@ -0,0 +1,214 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @subpackage Method
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Method parameter metadata
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @subpackage Method
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Server_Method_Parameter
+{
+ /**
+ * @var mixed Default parameter value
+ */
+ protected $_defaultValue;
+
+ /**
+ * @var string Parameter description
+ */
+ protected $_description = '';
+
+ /**
+ * @var string Parameter variable name
+ */
+ protected $_name;
+
+ /**
+ * @var bool Is parameter optional?
+ */
+ protected $_optional = false;
+
+ /**
+ * @var string Parameter type
+ */
+ protected $_type = 'mixed';
+
+ /**
+ * Constructor
+ *
+ * @param null|array $options
+ * @return void
+ */
+ public function __construct($options = null)
+ {
+ if (is_array($options)) {
+ $this->setOptions($options);
+ }
+ }
+
+ /**
+ * Set object state from array of options
+ *
+ * @param array $options
+ * @return Zend_Server_Method_Parameter
+ */
+ public function setOptions(array $options)
+ {
+ foreach ($options as $key => $value) {
+ $method = 'set' . ucfirst($key);
+ if (method_exists($this, $method)) {
+ $this->$method($value);
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Set default value
+ *
+ * @param mixed $defaultValue
+ * @return Zend_Server_Method_Parameter
+ */
+ public function setDefaultValue($defaultValue)
+ {
+ $this->_defaultValue = $defaultValue;
+ return $this;
+ }
+
+ /**
+ * Retrieve default value
+ *
+ * @return mixed
+ */
+ public function getDefaultValue()
+ {
+ return $this->_defaultValue;
+ }
+
+ /**
+ * Set description
+ *
+ * @param string $description
+ * @return Zend_Server_Method_Parameter
+ */
+ public function setDescription($description)
+ {
+ $this->_description = (string) $description;
+ return $this;
+ }
+
+ /**
+ * Retrieve description
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->_description;
+ }
+
+ /**
+ * Set name
+ *
+ * @param string $name
+ * @return Zend_Server_Method_Parameter
+ */
+ public function setName($name)
+ {
+ $this->_name = (string) $name;
+ return $this;
+ }
+
+ /**
+ * Retrieve name
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->_name;
+ }
+
+ /**
+ * Set optional flag
+ *
+ * @param bool $flag
+ * @return Zend_Server_Method_Parameter
+ */
+ public function setOptional($flag)
+ {
+ $this->_optional = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Is the parameter optional?
+ *
+ * @return bool
+ */
+ public function isOptional()
+ {
+ return $this->_optional;
+ }
+
+ /**
+ * Set parameter type
+ *
+ * @param string $type
+ * @return Zend_Server_Method_Parameter
+ */
+ public function setType($type)
+ {
+ $this->_type = (string) $type;
+ return $this;
+ }
+
+ /**
+ * Retrieve parameter type
+ *
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->_type;
+ }
+
+ /**
+ * Cast to array
+ *
+ * @return array
+ */
+ public function toArray()
+ {
+ return array(
+ 'type' => $this->getType(),
+ 'name' => $this->getName(),
+ 'optional' => $this->isOptional(),
+ 'defaultValue' => $this->getDefaultValue(),
+ 'description' => $this->getDescription(),
+ );
+ }
+}
diff --git a/library/vendor/Zend/Server/Method/Prototype.php b/library/vendor/Zend/Server/Method/Prototype.php
new file mode 100644
index 0000000..33c5a14
--- /dev/null
+++ b/library/vendor/Zend/Server/Method/Prototype.php
@@ -0,0 +1,207 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @subpackage Method
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Method prototype metadata
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @subpackage Method
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Server_Method_Prototype
+{
+ /**
+ * @var string Return type
+ */
+ protected $_returnType = 'void';
+
+ /**
+ * @var array Map parameter names to parameter index
+ */
+ protected $_parameterNameMap = array();
+
+ /**
+ * @var array Method parameters
+ */
+ protected $_parameters = array();
+
+ /**
+ * Constructor
+ *
+ * @param null|array $options
+ * @return void
+ */
+ public function __construct($options = null)
+ {
+ if ((null !== $options) && is_array($options)) {
+ $this->setOptions($options);
+ }
+ }
+
+ /**
+ * Set return value
+ *
+ * @param string $returnType
+ * @return Zend_Server_Method_Prototype
+ */
+ public function setReturnType($returnType)
+ {
+ $this->_returnType = $returnType;
+ return $this;
+ }
+
+ /**
+ * Retrieve return type
+ *
+ * @return string
+ */
+ public function getReturnType()
+ {
+ return $this->_returnType;
+ }
+
+ /**
+ * Add a parameter
+ *
+ * @param string $parameter
+ * @return Zend_Server_Method_Prototype
+ */
+ public function addParameter($parameter)
+ {
+ if ($parameter instanceof Zend_Server_Method_Parameter) {
+ $this->_parameters[] = $parameter;
+ if (null !== ($name = $parameter->getName())) {
+ $this->_parameterNameMap[$name] = count($this->_parameters) - 1;
+ }
+ } else {
+ $parameter = new Zend_Server_Method_Parameter(array(
+ 'type' => (string) $parameter,
+ ));
+ $this->_parameters[] = $parameter;
+ }
+ return $this;
+ }
+
+ /**
+ * Add parameters
+ *
+ * @param array $parameter
+ * @return Zend_Server_Method_Prototype
+ */
+ public function addParameters(array $parameters)
+ {
+ foreach ($parameters as $parameter) {
+ $this->addParameter($parameter);
+ }
+ return $this;
+ }
+
+ /**
+ * Set parameters
+ *
+ * @param array $parameters
+ * @return Zend_Server_Method_Prototype
+ */
+ public function setParameters(array $parameters)
+ {
+ $this->_parameters = array();
+ $this->_parameterNameMap = array();
+ $this->addParameters($parameters);
+ return $this;
+ }
+
+ /**
+ * Retrieve parameters as list of types
+ *
+ * @return array
+ */
+ public function getParameters()
+ {
+ $types = array();
+ foreach ($this->_parameters as $parameter) {
+ $types[] = $parameter->getType();
+ }
+ return $types;
+ }
+
+ /**
+ * Get parameter objects
+ *
+ * @return array
+ */
+ public function getParameterObjects()
+ {
+ return $this->_parameters;
+ }
+
+ /**
+ * Retrieve a single parameter by name or index
+ *
+ * @param string|int $index
+ * @return null|Zend_Server_Method_Parameter
+ */
+ public function getParameter($index)
+ {
+ if (!is_string($index) && !is_numeric($index)) {
+ return null;
+ }
+ if (array_key_exists($index, $this->_parameterNameMap)) {
+ $index = $this->_parameterNameMap[$index];
+ }
+ if (array_key_exists($index, $this->_parameters)) {
+ return $this->_parameters[$index];
+ }
+ return null;
+ }
+
+ /**
+ * Set object state from array
+ *
+ * @param array $options
+ * @return Zend_Server_Method_Prototype
+ */
+ public function setOptions(array $options)
+ {
+ foreach ($options as $key => $value) {
+ $method = 'set' . ucfirst($key);
+ if (method_exists($this, $method)) {
+ $this->$method($value);
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Serialize to array
+ *
+ * @return array
+ */
+ public function toArray()
+ {
+ return array(
+ 'returnType' => $this->getReturnType(),
+ 'parameters' => $this->getParameters(),
+ );
+ }
+}
diff --git a/library/vendor/Zend/Server/Reflection.php b/library/vendor/Zend/Server/Reflection.php
new file mode 100644
index 0000000..5d95c64
--- /dev/null
+++ b/library/vendor/Zend/Server/Reflection.php
@@ -0,0 +1,105 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * Zend_Server_Reflection_Function
+ */
+
+/**
+ * Zend_Server_Reflection_Class
+ */
+
+/**
+ * Reflection for determining method signatures to use with server classes
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @subpackage Reflection
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Server_Reflection
+{
+ /**
+ * Perform class reflection to create dispatch signatures
+ *
+ * Creates a {@link Zend_Server_Reflection_Class} object for the class or
+ * object provided.
+ *
+ * If extra arguments should be passed to dispatchable methods, these may
+ * be provided as an array to $argv.
+ *
+ * @param string|object $class Class name or object
+ * @param null|array $argv Optional arguments to be used during the method call
+ * @param string $namespace Optional namespace with which to prefix the
+ * method name (used for the signature key). Primarily to avoid collisions,
+ * also for XmlRpc namespacing
+ * @return Zend_Server_Reflection_Class
+ * @throws Zend_Server_Reflection_Exception
+ */
+ public static function reflectClass($class, $argv = false, $namespace = '')
+ {
+ if (is_object($class)) {
+ $reflection = new ReflectionObject($class);
+ } elseif (class_exists($class)) {
+ $reflection = new ReflectionClass($class);
+ } else {
+ throw new Zend_Server_Reflection_Exception('Invalid class or object passed to attachClass()');
+ }
+
+ if ($argv && !is_array($argv)) {
+ throw new Zend_Server_Reflection_Exception('Invalid argv argument passed to reflectClass');
+ }
+
+ return new Zend_Server_Reflection_Class($reflection, $namespace, $argv);
+ }
+
+ /**
+ * Perform function reflection to create dispatch signatures
+ *
+ * Creates dispatch prototypes for a function. It returns a
+ * {@link Zend_Server_Reflection_Function} object.
+ *
+ * If extra arguments should be passed to the dispatchable function, these
+ * may be provided as an array to $argv.
+ *
+ * @param string $function Function name
+ * @param null|array $argv Optional arguments to be used during the method call
+ * @param string $namespace Optional namespace with which to prefix the
+ * function name (used for the signature key). Primarily to avoid
+ * collisions, also for XmlRpc namespacing
+ * @return Zend_Server_Reflection_Function
+ * @throws Zend_Server_Reflection_Exception
+ */
+ public static function reflectFunction($function, $argv = false, $namespace = '')
+ {
+ if (!is_string($function) || !function_exists($function)) {
+ throw new Zend_Server_Reflection_Exception('Invalid function "' . $function . '" passed to reflectFunction');
+ }
+
+
+ if ($argv && !is_array($argv)) {
+ throw new Zend_Server_Reflection_Exception('Invalid argv argument passed to reflectClass');
+ }
+
+ return new Zend_Server_Reflection_Function(new ReflectionFunction($function), $namespace, $argv);
+ }
+}
diff --git a/library/vendor/Zend/Server/Reflection/Class.php b/library/vendor/Zend/Server/Reflection/Class.php
new file mode 100644
index 0000000..9456f0a
--- /dev/null
+++ b/library/vendor/Zend/Server/Reflection/Class.php
@@ -0,0 +1,195 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * Zend_Server_Reflection_Method
+ */
+
+/**
+ * Class/Object reflection
+ *
+ * Proxies calls to a ReflectionClass object, and decorates getMethods() by
+ * creating its own list of {@link Zend_Server_Reflection_Method}s.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @subpackage Reflection
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Server_Reflection_Class
+{
+ /**
+ * Optional configuration parameters; accessible via {@link __get} and
+ * {@link __set()}
+ * @var array
+ */
+ protected $_config = array();
+
+ /**
+ * Array of {@link Zend_Server_Reflection_Method}s
+ * @var array
+ */
+ protected $_methods = array();
+
+ /**
+ * Namespace
+ * @var string
+ */
+ protected $_namespace = null;
+
+ /**
+ * ReflectionClass object
+ * @var ReflectionClass
+ */
+ protected $_reflection;
+
+ /**
+ * Constructor
+ *
+ * Create array of dispatchable methods, each a
+ * {@link Zend_Server_Reflection_Method}. Sets reflection object property.
+ *
+ * @param ReflectionClass $reflection
+ * @param string $namespace
+ * @param mixed $argv
+ * @return void
+ */
+ public function __construct(ReflectionClass $reflection, $namespace = null, $argv = false)
+ {
+ $this->_reflection = $reflection;
+ $this->setNamespace($namespace);
+
+ foreach ($reflection->getMethods() as $method) {
+ // Don't aggregate magic methods
+ if ('__' == substr($method->getName(), 0, 2)) {
+ continue;
+ }
+
+ if ($method->isPublic()) {
+ // Get signatures and description
+ $this->_methods[] = new Zend_Server_Reflection_Method($this, $method, $this->getNamespace(), $argv);
+ }
+ }
+ }
+
+ /**
+ * Proxy reflection calls
+ *
+ * @param string $method
+ * @param array $args
+ * @return mixed
+ */
+ public function __call($method, $args)
+ {
+ if (method_exists($this->_reflection, $method)) {
+ return call_user_func_array(array($this->_reflection, $method), $args);
+ }
+
+ throw new Zend_Server_Reflection_Exception('Invalid reflection method');
+ }
+
+ /**
+ * Retrieve configuration parameters
+ *
+ * Values are retrieved by key from {@link $_config}. Returns null if no
+ * value found.
+ *
+ * @param string $key
+ * @return mixed
+ */
+ public function __get($key)
+ {
+ if (isset($this->_config[$key])) {
+ return $this->_config[$key];
+ }
+
+ return null;
+ }
+
+ /**
+ * Set configuration parameters
+ *
+ * Values are stored by $key in {@link $_config}.
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return void
+ */
+ public function __set($key, $value)
+ {
+ $this->_config[$key] = $value;
+ }
+
+ /**
+ * Return array of dispatchable {@link Zend_Server_Reflection_Method}s.
+ *
+ * @access public
+ * @return array
+ */
+ public function getMethods()
+ {
+ return $this->_methods;
+ }
+
+ /**
+ * Get namespace for this class
+ *
+ * @return string
+ */
+ public function getNamespace()
+ {
+ return $this->_namespace;
+ }
+
+ /**
+ * Set namespace for this class
+ *
+ * @param string $namespace
+ * @return void
+ */
+ public function setNamespace($namespace)
+ {
+ if (empty($namespace)) {
+ $this->_namespace = '';
+ return;
+ }
+
+ if (!is_string($namespace) || !preg_match('/[a-z0-9_\.]+/i', $namespace)) {
+ throw new Zend_Server_Reflection_Exception('Invalid namespace');
+ }
+
+ $this->_namespace = $namespace;
+ }
+
+ /**
+ * Wakeup from serialization
+ *
+ * Reflection needs explicit instantiation to work correctly. Re-instantiate
+ * reflection object on wakeup.
+ *
+ * @return void
+ */
+ public function __wakeup()
+ {
+ $this->_reflection = new ReflectionClass($this->getName());
+ }
+}
diff --git a/library/vendor/Zend/Server/Reflection/Exception.php b/library/vendor/Zend/Server/Reflection/Exception.php
new file mode 100644
index 0000000..e264768
--- /dev/null
+++ b/library/vendor/Zend/Server/Reflection/Exception.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * @see Zend_Server_Exception
+ */
+
+/**
+ * Zend_Server_Reflection exceptions
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @subpackage Reflection
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Server_Reflection_Exception extends Zend_Server_Exception
+{
+}
diff --git a/library/vendor/Zend/Server/Reflection/Function.php b/library/vendor/Zend/Server/Reflection/Function.php
new file mode 100644
index 0000000..cd76afa
--- /dev/null
+++ b/library/vendor/Zend/Server/Reflection/Function.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * Zend_Server_Reflection_Function_Abstract
+ */
+
+/**
+ * Function Reflection
+ *
+ * @uses Zend_Server_Reflection_Function_Abstract
+ * @category Zend
+ * @package Zend_Server
+ * @subpackage Reflection
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Server_Reflection_Function extends Zend_Server_Reflection_Function_Abstract
+{
+}
diff --git a/library/vendor/Zend/Server/Reflection/Function/Abstract.php b/library/vendor/Zend/Server/Reflection/Function/Abstract.php
new file mode 100644
index 0000000..f0557f8
--- /dev/null
+++ b/library/vendor/Zend/Server/Reflection/Function/Abstract.php
@@ -0,0 +1,506 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * Zend_Server_Reflection_Node
+ */
+
+/**
+ * Zend_Server_Reflection_Parameter
+ */
+
+/**
+ * Zend_Server_Reflection_Prototype
+ */
+
+/**
+ * Function/Method Reflection
+ *
+ * Decorates a ReflectionFunction. Allows setting and retrieving an alternate
+ * 'service' name (i.e., the name to be used when calling via a service),
+ * setting and retrieving the description (originally set using the docblock
+ * contents), retrieving the callback and callback type, retrieving additional
+ * method invocation arguments, and retrieving the
+ * method {@link Zend_Server_Reflection_Prototype prototypes}.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @subpackage Reflection
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+abstract class Zend_Server_Reflection_Function_Abstract
+{
+ /**
+ * @var ReflectionFunction
+ */
+ protected $_reflection;
+
+ /**
+ * Additional arguments to pass to method on invocation
+ * @var array
+ */
+ protected $_argv = array();
+
+ /**
+ * Used to store extra configuration for the method (typically done by the
+ * server class, e.g., to indicate whether or not to instantiate a class).
+ * Associative array; access is as properties via {@link __get()} and
+ * {@link __set()}
+ * @var array
+ */
+ protected $_config = array();
+
+ /**
+ * Declaring class (needed for when serialization occurs)
+ * @var string
+ */
+ protected $_class;
+
+ /**
+ * Function/method description
+ * @var string
+ */
+ protected $_description = '';
+
+ /**
+ * Namespace with which to prefix function/method name
+ * @var string
+ */
+ protected $_namespace;
+
+ /**
+ * Prototypes
+ * @var array
+ */
+ protected $_prototypes = array();
+
+ private $_return;
+ private $_returnDesc;
+ private $_paramDesc;
+ private $_sigParams;
+ private $_sigParamsDepth;
+
+ /**
+ * Constructor
+ *
+ * @param ReflectionFunction $r
+ */
+ public function __construct(Reflector $r, $namespace = null, $argv = array())
+ {
+ // In PHP 5.1.x, ReflectionMethod extends ReflectionFunction. In 5.2.x,
+ // both extend ReflectionFunctionAbstract. So, we can't do normal type
+ // hinting in the prototype, but instead need to do some explicit
+ // testing here.
+ if ((!$r instanceof ReflectionFunction)
+ && (!$r instanceof ReflectionMethod)) {
+ throw new Zend_Server_Reflection_Exception('Invalid reflection class');
+ }
+ $this->_reflection = $r;
+
+ // Determine namespace
+ if (null !== $namespace){
+ $this->setNamespace($namespace);
+ }
+
+ // Determine arguments
+ if (is_array($argv)) {
+ $this->_argv = $argv;
+ }
+
+ // If method call, need to store some info on the class
+ if ($r instanceof ReflectionMethod) {
+ $this->_class = $r->getDeclaringClass()->getName();
+ }
+
+ // Perform some introspection
+ $this->_reflect();
+ }
+
+ /**
+ * Create signature node tree
+ *
+ * Recursive method to build the signature node tree. Increments through
+ * each array in {@link $_sigParams}, adding every value of the next level
+ * to the current value (unless the current value is null).
+ *
+ * @param Zend_Server_Reflection_Node $parent
+ * @param int $level
+ * @return void
+ */
+ protected function _addTree(Zend_Server_Reflection_Node $parent, $level = 0)
+ {
+ if ($level >= $this->_sigParamsDepth) {
+ return;
+ }
+
+ foreach ($this->_sigParams[$level] as $value) {
+ $node = new Zend_Server_Reflection_Node($value, $parent);
+ if ((null !== $value) && ($this->_sigParamsDepth > $level + 1)) {
+ $this->_addTree($node, $level + 1);
+ }
+ }
+ }
+
+ /**
+ * Build the signature tree
+ *
+ * Builds a signature tree starting at the return values and descending
+ * through each method argument. Returns an array of
+ * {@link Zend_Server_Reflection_Node}s.
+ *
+ * @return array
+ */
+ protected function _buildTree()
+ {
+ $returnTree = array();
+ foreach ((array) $this->_return as $value) {
+ $node = new Zend_Server_Reflection_Node($value);
+ $this->_addTree($node);
+ $returnTree[] = $node;
+ }
+
+ return $returnTree;
+ }
+
+ /**
+ * Build method signatures
+ *
+ * Builds method signatures using the array of return types and the array of
+ * parameters types
+ *
+ * @param array $return Array of return types
+ * @param string $returnDesc Return value description
+ * @param array $params Array of arguments (each an array of types)
+ * @param array $paramDesc Array of parameter descriptions
+ * @return array
+ */
+ protected function _buildSignatures($return, $returnDesc, $paramTypes, $paramDesc)
+ {
+ $this->_return = $return;
+ $this->_returnDesc = $returnDesc;
+ $this->_paramDesc = $paramDesc;
+ $this->_sigParams = $paramTypes;
+ $this->_sigParamsDepth = count($paramTypes);
+ $signatureTrees = $this->_buildTree();
+ $signatures = array();
+
+ $endPoints = array();
+ foreach ($signatureTrees as $root) {
+ $tmp = $root->getEndPoints();
+ if (empty($tmp)) {
+ $endPoints = array_merge($endPoints, array($root));
+ } else {
+ $endPoints = array_merge($endPoints, $tmp);
+ }
+ }
+
+ foreach ($endPoints as $node) {
+ if (!$node instanceof Zend_Server_Reflection_Node) {
+ continue;
+ }
+
+ $signature = array();
+ do {
+ array_unshift($signature, $node->getValue());
+ $node = $node->getParent();
+ } while ($node instanceof Zend_Server_Reflection_Node);
+
+ $signatures[] = $signature;
+ }
+
+ // Build prototypes
+ $params = $this->_reflection->getParameters();
+ foreach ($signatures as $signature) {
+ $return = new Zend_Server_Reflection_ReturnValue(array_shift($signature), $this->_returnDesc);
+ $tmp = array();
+ foreach ($signature as $key => $type) {
+ $param = new Zend_Server_Reflection_Parameter($params[$key], $type, (isset($this->_paramDesc[$key]) ? $this->_paramDesc[$key] : null));
+ $param->setPosition($key);
+ $tmp[] = $param;
+ }
+
+ $this->_prototypes[] = new Zend_Server_Reflection_Prototype($return, $tmp);
+ }
+ }
+
+ /**
+ * Use code reflection to create method signatures
+ *
+ * Determines the method help/description text from the function DocBlock
+ * comment. Determines method signatures using a combination of
+ * ReflectionFunction and parsing of DocBlock @param and @return values.
+ *
+ * @param ReflectionFunction $function
+ * @return array
+ */
+ protected function _reflect()
+ {
+ $function = $this->_reflection;
+ $helpText = '';
+ $signatures = array();
+ $returnDesc = '';
+ $paramCount = $function->getNumberOfParameters();
+ $paramCountRequired = $function->getNumberOfRequiredParameters();
+ $parameters = $function->getParameters();
+ $docBlock = $function->getDocComment();
+
+ if (!empty($docBlock)) {
+ // Get help text
+ if (preg_match(':/\*\*\s*\r?\n\s*\*\s(.*?)\r?\n\s*\*(\s@|/):s', $docBlock, $matches))
+ {
+ $helpText = $matches[1];
+ $helpText = preg_replace('/(^\s*\*\s)/m', '', $helpText);
+ $helpText = preg_replace('/\r?\n\s*\*\s*(\r?\n)*/s', "\n", $helpText);
+ $helpText = trim($helpText);
+ }
+
+ // Get return type(s) and description
+ $return = 'void';
+ if (preg_match('/@return\s+(\S+)/', $docBlock, $matches)) {
+ $return = explode('|', $matches[1]);
+ if (preg_match('/@return\s+\S+\s+(.*?)(@|\*\/)/s', $docBlock, $matches))
+ {
+ $value = $matches[1];
+ $value = preg_replace('/\s?\*\s/m', '', $value);
+ $value = preg_replace('/\s{2,}/', ' ', $value);
+ $returnDesc = trim($value);
+ }
+ }
+
+ // Get param types and description
+ if (preg_match_all('/@param\s+([^\s]+)/m', $docBlock, $matches)) {
+ $paramTypesTmp = $matches[1];
+ if (preg_match_all('/@param\s+\S+\s+(\$\S+)\s+(.*?)(?=@|\*\/)/s', $docBlock, $matches))
+ {
+ $paramDesc = $matches[2];
+ foreach ($paramDesc as $key => $value) {
+ $value = preg_replace('/\s?\*\s/m', '', $value);
+ $value = preg_replace('/\s{2,}/', ' ', $value);
+ $paramDesc[$key] = trim($value);
+ }
+ }
+ }
+ } else {
+ $helpText = $function->getName();
+ $return = 'void';
+
+ // Try and auto-determine type, based on reflection
+ $paramTypesTmp = array();
+ foreach ($parameters as $i => $param) {
+ $paramType = 'mixed';
+ if ($param->isArray()) {
+ $paramType = 'array';
+ }
+ $paramTypesTmp[$i] = $paramType;
+ }
+ }
+
+ // Set method description
+ $this->setDescription($helpText);
+
+ // Get all param types as arrays
+ if (!isset($paramTypesTmp) && (0 < $paramCount)) {
+ $paramTypesTmp = array_fill(0, $paramCount, 'mixed');
+ } elseif (!isset($paramTypesTmp)) {
+ $paramTypesTmp = array();
+ } elseif (count($paramTypesTmp) < $paramCount) {
+ $start = $paramCount - count($paramTypesTmp);
+ for ($i = $start; $i < $paramCount; ++$i) {
+ $paramTypesTmp[$i] = 'mixed';
+ }
+ }
+
+ // Get all param descriptions as arrays
+ if (!isset($paramDesc) && (0 < $paramCount)) {
+ $paramDesc = array_fill(0, $paramCount, '');
+ } elseif (!isset($paramDesc)) {
+ $paramDesc = array();
+ } elseif (count($paramDesc) < $paramCount) {
+ $start = $paramCount - count($paramDesc);
+ for ($i = $start; $i < $paramCount; ++$i) {
+ $paramDesc[$i] = '';
+ }
+ }
+
+ if (count($paramTypesTmp) != $paramCount) {
+ throw new Zend_Server_Reflection_Exception(
+ 'Variable number of arguments is not supported for services (except optional parameters). '
+ . 'Number of function arguments in ' . $function->getDeclaringClass()->getName() . '::'
+ . $function->getName() . '() must correspond to actual number of arguments described in the '
+ . 'docblock.');
+ }
+
+ $paramTypes = array();
+ foreach ($paramTypesTmp as $i => $param) {
+ $tmp = explode('|', $param);
+ if ($parameters[$i]->isOptional()) {
+ array_unshift($tmp, null);
+ }
+ $paramTypes[] = $tmp;
+ }
+
+ $this->_buildSignatures($return, $returnDesc, $paramTypes, $paramDesc);
+ }
+
+
+ /**
+ * Proxy reflection calls
+ *
+ * @param string $method
+ * @param array $args
+ * @return mixed
+ */
+ public function __call($method, $args)
+ {
+ if (method_exists($this->_reflection, $method)) {
+ return call_user_func_array(array($this->_reflection, $method), $args);
+ }
+
+ throw new Zend_Server_Reflection_Exception('Invalid reflection method ("' .$method. '")');
+ }
+
+ /**
+ * Retrieve configuration parameters
+ *
+ * Values are retrieved by key from {@link $_config}. Returns null if no
+ * value found.
+ *
+ * @param string $key
+ * @return mixed
+ */
+ public function __get($key)
+ {
+ if (isset($this->_config[$key])) {
+ return $this->_config[$key];
+ }
+
+ return null;
+ }
+
+ /**
+ * Set configuration parameters
+ *
+ * Values are stored by $key in {@link $_config}.
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return void
+ */
+ public function __set($key, $value)
+ {
+ $this->_config[$key] = $value;
+ }
+
+ /**
+ * Set method's namespace
+ *
+ * @param string $namespace
+ * @return void
+ */
+ public function setNamespace($namespace)
+ {
+ if (empty($namespace)) {
+ $this->_namespace = '';
+ return;
+ }
+
+ if (!is_string($namespace) || !preg_match('/[a-z0-9_\.]+/i', $namespace)) {
+ throw new Zend_Server_Reflection_Exception('Invalid namespace');
+ }
+
+ $this->_namespace = $namespace;
+ }
+
+ /**
+ * Return method's namespace
+ *
+ * @return string
+ */
+ public function getNamespace()
+ {
+ return $this->_namespace;
+ }
+
+ /**
+ * Set the description
+ *
+ * @param string $string
+ * @return void
+ */
+ public function setDescription($string)
+ {
+ if (!is_string($string)) {
+ throw new Zend_Server_Reflection_Exception('Invalid description');
+ }
+
+ $this->_description = $string;
+ }
+
+ /**
+ * Retrieve the description
+ *
+ * @return void
+ */
+ public function getDescription()
+ {
+ return $this->_description;
+ }
+
+ /**
+ * Retrieve all prototypes as array of
+ * {@link Zend_Server_Reflection_Prototype Zend_Server_Reflection_Prototypes}
+ *
+ * @return array
+ */
+ public function getPrototypes()
+ {
+ return $this->_prototypes;
+ }
+
+ /**
+ * Retrieve additional invocation arguments
+ *
+ * @return array
+ */
+ public function getInvokeArguments()
+ {
+ return $this->_argv;
+ }
+
+ /**
+ * Wakeup from serialization
+ *
+ * Reflection needs explicit instantiation to work correctly. Re-instantiate
+ * reflection object on wakeup.
+ *
+ * @return void
+ */
+ public function __wakeup()
+ {
+ if ($this->_reflection instanceof ReflectionMethod) {
+ $class = new ReflectionClass($this->_class);
+ $this->_reflection = new ReflectionMethod($class->newInstance(), $this->getName());
+ } else {
+ $this->_reflection = new ReflectionFunction($this->getName());
+ }
+ }
+}
diff --git a/library/vendor/Zend/Server/Reflection/Method.php b/library/vendor/Zend/Server/Reflection/Method.php
new file mode 100644
index 0000000..305b783
--- /dev/null
+++ b/library/vendor/Zend/Server/Reflection/Method.php
@@ -0,0 +1,109 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * Zend_Server_Reflection_Function_Abstract
+ */
+
+/**
+ * Method Reflection
+ *
+ * @uses Zend_Server_Reflection_Function_Abstract
+ * @category Zend
+ * @package Zend_Server
+ * @subpackage Reflection
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Server_Reflection_Method extends Zend_Server_Reflection_Function_Abstract
+{
+ /**
+ * Parent class name
+ * @var string
+ */
+ protected $_class;
+
+ /**
+ * Parent class reflection
+ * @var Zend_Server_Reflection_Class
+ */
+ protected $_classReflection;
+
+ /**
+ * Constructor
+ *
+ * @param Zend_Server_Reflection_Class $class
+ * @param ReflectionMethod $r
+ * @param string $namespace
+ * @param array $argv
+ * @return void
+ */
+ public function __construct(Zend_Server_Reflection_Class $class, ReflectionMethod $r, $namespace = null, $argv = array())
+ {
+ $this->_classReflection = $class;
+ $this->_reflection = $r;
+
+ $classNamespace = $class->getNamespace();
+
+ // Determine namespace
+ if (!empty($namespace)) {
+ $this->setNamespace($namespace);
+ } elseif (!empty($classNamespace)) {
+ $this->setNamespace($classNamespace);
+ }
+
+ // Determine arguments
+ if (is_array($argv)) {
+ $this->_argv = $argv;
+ }
+
+ // If method call, need to store some info on the class
+ $this->_class = $class->getName();
+
+ // Perform some introspection
+ $this->_reflect();
+ }
+
+ /**
+ * Return the reflection for the class that defines this method
+ *
+ * @return Zend_Server_Reflection_Class
+ */
+ public function getDeclaringClass()
+ {
+ return $this->_classReflection;
+ }
+
+ /**
+ * Wakeup from serialization
+ *
+ * Reflection needs explicit instantiation to work correctly. Re-instantiate
+ * reflection object on wakeup.
+ *
+ * @return void
+ */
+ public function __wakeup()
+ {
+ $this->_classReflection = new Zend_Server_Reflection_Class(new ReflectionClass($this->_class), $this->getNamespace(), $this->getInvokeArguments());
+ $this->_reflection = new ReflectionMethod($this->_classReflection->getName(), $this->getName());
+ }
+
+}
diff --git a/library/vendor/Zend/Server/Reflection/Node.php b/library/vendor/Zend/Server/Reflection/Node.php
new file mode 100644
index 0000000..d80abf3
--- /dev/null
+++ b/library/vendor/Zend/Server/Reflection/Node.php
@@ -0,0 +1,201 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * Node Tree class for Zend_Server reflection operations
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @subpackage Reflection
+ * @version $Id$
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Server_Reflection_Node
+{
+ /**
+ * Node value
+ * @var mixed
+ */
+ protected $_value = null;
+
+ /**
+ * Array of child nodes (if any)
+ * @var array
+ */
+ protected $_children = array();
+
+ /**
+ * Parent node (if any)
+ * @var Zend_Server_Reflection_Node
+ */
+ protected $_parent = null;
+
+ /**
+ * Constructor
+ *
+ * @param mixed $value
+ * @param Zend_Server_Reflection_Node $parent Optional
+ * @return Zend_Server_Reflection_Node
+ */
+ public function __construct($value, Zend_Server_Reflection_Node $parent = null)
+ {
+ $this->_value = $value;
+ if (null !== $parent) {
+ $this->setParent($parent, true);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set parent node
+ *
+ * @param Zend_Server_Reflection_Node $node
+ * @param boolean $new Whether or not the child node is newly created
+ * and should always be attached
+ * @return void
+ */
+ public function setParent(Zend_Server_Reflection_Node $node, $new = false)
+ {
+ $this->_parent = $node;
+
+ if ($new) {
+ $node->attachChild($this);
+ return;
+ }
+ }
+
+ /**
+ * Create and attach a new child node
+ *
+ * @param mixed $value
+ * @access public
+ * @return Zend_Server_Reflection_Node New child node
+ */
+ public function createChild($value)
+ {
+ $child = new self($value, $this);
+
+ return $child;
+ }
+
+ /**
+ * Attach a child node
+ *
+ * @param Zend_Server_Reflection_Node $node
+ * @return void
+ */
+ public function attachChild(Zend_Server_Reflection_Node $node)
+ {
+ $this->_children[] = $node;
+
+ if ($node->getParent() !== $this) {
+ $node->setParent($this);
+ }
+ }
+
+ /**
+ * Return an array of all child nodes
+ *
+ * @return array
+ */
+ public function getChildren()
+ {
+ return $this->_children;
+ }
+
+ /**
+ * Does this node have children?
+ *
+ * @return boolean
+ */
+ public function hasChildren()
+ {
+ return count($this->_children) > 0;
+ }
+
+ /**
+ * Return the parent node
+ *
+ * @return null|Zend_Server_Reflection_Node
+ */
+ public function getParent()
+ {
+ return $this->_parent;
+ }
+
+ /**
+ * Return the node's current value
+ *
+ * @return mixed
+ */
+ public function getValue()
+ {
+ return $this->_value;
+ }
+
+ /**
+ * Set the node value
+ *
+ * @param mixed $value
+ * @return void
+ */
+ public function setValue($value)
+ {
+ $this->_value = $value;
+ }
+
+ /**
+ * Retrieve the bottommost nodes of this node's tree
+ *
+ * Retrieves the bottommost nodes of the tree by recursively calling
+ * getEndPoints() on all children. If a child is null, it returns the parent
+ * as an end point.
+ *
+ * @return array
+ */
+ public function getEndPoints()
+ {
+ $endPoints = array();
+ if (!$this->hasChildren()) {
+ return $endPoints;
+ }
+
+ foreach ($this->_children as $child) {
+ $value = $child->getValue();
+
+ if (null === $value) {
+ $endPoints[] = $this;
+ } elseif ((null !== $value)
+ && $child->hasChildren())
+ {
+ $childEndPoints = $child->getEndPoints();
+ if (!empty($childEndPoints)) {
+ $endPoints = array_merge($endPoints, $childEndPoints);
+ }
+ } elseif ((null !== $value) && !$child->hasChildren()) {
+ $endPoints[] = $child;
+ }
+ }
+
+ return $endPoints;
+ }
+}
diff --git a/library/vendor/Zend/Server/Reflection/Parameter.php b/library/vendor/Zend/Server/Reflection/Parameter.php
new file mode 100644
index 0000000..681824a
--- /dev/null
+++ b/library/vendor/Zend/Server/Reflection/Parameter.php
@@ -0,0 +1,158 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * Parameter Reflection
+ *
+ * Decorates a ReflectionParameter to allow setting the parameter type
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @subpackage Reflection
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Server_Reflection_Parameter
+{
+ /**
+ * @var ReflectionParameter
+ */
+ protected $_reflection;
+
+ /**
+ * Parameter position
+ * @var int
+ */
+ protected $_position;
+
+ /**
+ * Parameter type
+ * @var string
+ */
+ protected $_type;
+
+ /**
+ * Parameter description
+ * @var string
+ */
+ protected $_description;
+
+ /**
+ * Constructor
+ *
+ * @param ReflectionParameter $r
+ * @param string $type Parameter type
+ * @param string $description Parameter description
+ */
+ public function __construct(ReflectionParameter $r, $type = 'mixed', $description = '')
+ {
+ $this->_reflection = $r;
+ $this->setType($type);
+ $this->setDescription($description);
+ }
+
+ /**
+ * Proxy reflection calls
+ *
+ * @param string $method
+ * @param array $args
+ * @return mixed
+ */
+ public function __call($method, $args)
+ {
+ if (method_exists($this->_reflection, $method)) {
+ return call_user_func_array(array($this->_reflection, $method), $args);
+ }
+
+ throw new Zend_Server_Reflection_Exception('Invalid reflection method');
+ }
+
+ /**
+ * Retrieve parameter type
+ *
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->_type;
+ }
+
+ /**
+ * Set parameter type
+ *
+ * @param string|null $type
+ * @return void
+ */
+ public function setType($type)
+ {
+ if (!is_string($type) && (null !== $type)) {
+ throw new Zend_Server_Reflection_Exception('Invalid parameter type');
+ }
+
+ $this->_type = $type;
+ }
+
+ /**
+ * Retrieve parameter description
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->_description;
+ }
+
+ /**
+ * Set parameter description
+ *
+ * @param string|null $description
+ * @return void
+ */
+ public function setDescription($description)
+ {
+ if (!is_string($description) && (null !== $description)) {
+ throw new Zend_Server_Reflection_Exception('Invalid parameter description');
+ }
+
+ $this->_description = $description;
+ }
+
+ /**
+ * Set parameter position
+ *
+ * @param int $index
+ * @return void
+ */
+ public function setPosition($index)
+ {
+ $this->_position = (int) $index;
+ }
+
+ /**
+ * Return parameter position
+ *
+ * @return int
+ */
+ public function getPosition()
+ {
+ return $this->_position;
+ }
+}
diff --git a/library/vendor/Zend/Server/Reflection/Prototype.php b/library/vendor/Zend/Server/Reflection/Prototype.php
new file mode 100644
index 0000000..e780623
--- /dev/null
+++ b/library/vendor/Zend/Server/Reflection/Prototype.php
@@ -0,0 +1,99 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * Zend_Server_Reflection_ReturnValue
+ */
+
+/**
+ * Zend_Server_Reflection_Parameter
+ */
+
+/**
+ * Method/Function prototypes
+ *
+ * Contains accessors for the return value and all method arguments.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @subpackage Reflection
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Server_Reflection_Prototype
+{
+ /**
+ * Constructor
+ *
+ * @param Zend_Server_Reflection_ReturnValue $return
+ * @param array $params
+ * @return void
+ */
+ public function __construct(Zend_Server_Reflection_ReturnValue $return, $params = null)
+ {
+ $this->_return = $return;
+
+ if (!is_array($params) && (null !== $params)) {
+ throw new Zend_Server_Reflection_Exception('Invalid parameters');
+ }
+
+ if (is_array($params)) {
+ foreach ($params as $param) {
+ if (!$param instanceof Zend_Server_Reflection_Parameter) {
+ throw new Zend_Server_Reflection_Exception('One or more params are invalid');
+ }
+ }
+ }
+
+ $this->_params = $params;
+ }
+
+ /**
+ * Retrieve return type
+ *
+ * @return string
+ */
+ public function getReturnType()
+ {
+ return $this->_return->getType();
+ }
+
+ /**
+ * Retrieve the return value object
+ *
+ * @access public
+ * @return Zend_Server_Reflection_ReturnValue
+ */
+ public function getReturnValue()
+ {
+ return $this->_return;
+ }
+
+ /**
+ * Retrieve method parameters
+ *
+ * @return array Array of {@link Zend_Server_Reflection_Parameter}s
+ */
+ public function getParameters()
+ {
+ return $this->_params;
+ }
+}
diff --git a/library/vendor/Zend/Server/Reflection/ReturnValue.php b/library/vendor/Zend/Server/Reflection/ReturnValue.php
new file mode 100644
index 0000000..dcc5132
--- /dev/null
+++ b/library/vendor/Zend/Server/Reflection/ReturnValue.php
@@ -0,0 +1,108 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * Return value reflection
+ *
+ * Stores the return value type and description
+ *
+ * @category Zend
+ * @package Zend_Server
+ * @subpackage Reflection
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Server_Reflection_ReturnValue
+{
+ /**
+ * Return value type
+ * @var string
+ */
+ protected $_type;
+
+ /**
+ * Return value description
+ * @var string
+ */
+ protected $_description;
+
+ /**
+ * Constructor
+ *
+ * @param string $type Return value type
+ * @param string $description Return value type
+ */
+ public function __construct($type = 'mixed', $description = '')
+ {
+ $this->setType($type);
+ $this->setDescription($description);
+ }
+
+ /**
+ * Retrieve parameter type
+ *
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->_type;
+ }
+
+ /**
+ * Set parameter type
+ *
+ * @param string|null $type
+ * @return void
+ */
+ public function setType($type)
+ {
+ if (!is_string($type) && (null !== $type)) {
+ throw new Zend_Server_Reflection_Exception('Invalid parameter type');
+ }
+
+ $this->_type = $type;
+ }
+
+ /**
+ * Retrieve parameter description
+ *
+ * @return string
+ */
+ public function getDescription()
+ {
+ return $this->_description;
+ }
+
+ /**
+ * Set parameter description
+ *
+ * @param string|null $description
+ * @return void
+ */
+ public function setDescription($description)
+ {
+ if (!is_string($description) && (null !== $description)) {
+ throw new Zend_Server_Reflection_Exception('Invalid parameter description');
+ }
+
+ $this->_description = $description;
+ }
+}
diff --git a/library/vendor/Zend/Session.php b/library/vendor/Zend/Session.php
new file mode 100644
index 0000000..a1ed797
--- /dev/null
+++ b/library/vendor/Zend/Session.php
@@ -0,0 +1,895 @@
+<?php
+
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ * @since Preview Release 0.2
+ */
+
+
+/**
+ * @see Zend_Session_Abstract
+ */
+
+/**
+ * @see Zend_Session_Namespace
+ */
+
+/**
+ * @see Zend_Session_SaveHandler_Interface
+ */
+
+
+/**
+ * Zend_Session
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Session extends Zend_Session_Abstract
+{
+ /**
+ * Whether or not Zend_Session is being used with unit tests
+ *
+ * @internal
+ * @var bool
+ */
+ public static $_unitTestEnabled = false;
+
+ /**
+ * $_throwStartupException
+ *
+ * @var bool|bitset This could also be a combiniation of error codes to catch
+ */
+ protected static $_throwStartupExceptions = true;
+
+ /**
+ * Check whether or not the session was started
+ *
+ * @var bool
+ */
+ private static $_sessionStarted = false;
+
+ /**
+ * Whether or not the session id has been regenerated this request.
+ *
+ * Id regeneration state
+ * <0 - regenerate requested when session is started
+ * 0 - do nothing
+ * >0 - already called session_regenerate_id()
+ *
+ * @var int
+ */
+ private static $_regenerateIdState = 0;
+
+ /**
+ * Private list of php's ini values for ext/session
+ * null values will default to the php.ini value, otherwise
+ * the value below will overwrite the default ini value, unless
+ * the user has set an option explicity with setOptions()
+ *
+ * @var array
+ */
+ private static $_defaultOptions = array(
+ 'save_path' => null,
+ 'name' => null, /* this should be set to a unique value for each application */
+ 'save_handler' => null,
+ //'auto_start' => null, /* intentionally excluded (see manual) */
+ 'gc_probability' => null,
+ 'gc_divisor' => null,
+ 'gc_maxlifetime' => null,
+ 'serialize_handler' => null,
+ 'cookie_lifetime' => null,
+ 'cookie_path' => null,
+ 'cookie_domain' => null,
+ 'cookie_secure' => null,
+ 'cookie_httponly' => null,
+ 'use_cookies' => null,
+ 'use_only_cookies' => 'on',
+ 'referer_check' => null,
+ 'entropy_file' => null,
+ 'entropy_length' => null,
+ 'cache_limiter' => null,
+ 'cache_expire' => null,
+ 'use_trans_sid' => null,
+ 'bug_compat_42' => null,
+ 'bug_compat_warn' => null,
+ 'hash_function' => null,
+ 'hash_bits_per_character' => null
+ );
+
+ /**
+ * List of options pertaining to Zend_Session that can be set by developers
+ * using Zend_Session::setOptions(). This list intentionally duplicates
+ * the individual declaration of static "class" variables by the same names.
+ *
+ * @var array
+ */
+ private static $_localOptions = array(
+ 'strict' => '_strict',
+ 'remember_me_seconds' => '_rememberMeSeconds',
+ 'throw_startup_exceptions' => '_throwStartupExceptions'
+ );
+
+ /**
+ * Whether or not write close has been performed.
+ *
+ * @var bool
+ */
+ private static $_writeClosed = false;
+
+ /**
+ * Whether or not session id cookie has been deleted
+ *
+ * @var bool
+ */
+ private static $_sessionCookieDeleted = false;
+
+ /**
+ * Whether or not session has been destroyed via session_destroy()
+ *
+ * @var bool
+ */
+ private static $_destroyed = false;
+
+ /**
+ * Whether or not session must be initiated before usage
+ *
+ * @var bool
+ */
+ private static $_strict = false;
+
+ /**
+ * Default number of seconds the session will be remembered for when asked to be remembered
+ *
+ * @var int
+ */
+ private static $_rememberMeSeconds = 1209600; // 2 weeks
+
+ /**
+ * Whether the default options listed in Zend_Session::$_localOptions have been set
+ *
+ * @var bool
+ */
+ private static $_defaultOptionsSet = false;
+
+ /**
+ * A reference to the set session save handler
+ *
+ * @var Zend_Session_SaveHandler_Interface
+ */
+ private static $_saveHandler = null;
+
+
+ /**
+ * Constructor overriding - make sure that a developer cannot instantiate
+ */
+ protected function __construct()
+ {
+ }
+
+
+ /**
+ * setOptions - set both the class specified
+ *
+ * @param array $userOptions - pass-by-keyword style array of <option name, option value> pairs
+ * @throws Zend_Session_Exception
+ * @return void
+ */
+ public static function setOptions(array $userOptions = array())
+ {
+ // set default options on first run only (before applying user settings)
+ if (!self::$_defaultOptionsSet) {
+ foreach (self::$_defaultOptions as $defaultOptionName => $defaultOptionValue) {
+ if (isset(self::$_defaultOptions[$defaultOptionName])) {
+ ini_set("session.$defaultOptionName", $defaultOptionValue);
+ }
+ }
+
+ self::$_defaultOptionsSet = true;
+ }
+
+ // set the options the user has requested to set
+ foreach ($userOptions as $userOptionName => $userOptionValue) {
+
+ $userOptionName = strtolower($userOptionName);
+
+ // set the ini based values
+ if (array_key_exists($userOptionName, self::$_defaultOptions)) {
+ ini_set("session.$userOptionName", $userOptionValue);
+ }
+ elseif (isset(self::$_localOptions[$userOptionName])) {
+ self::${self::$_localOptions[$userOptionName]} = $userOptionValue;
+ }
+ else {
+ /** @see Zend_Session_Exception */
+ throw new Zend_Session_Exception("Unknown option: $userOptionName = $userOptionValue");
+ }
+ }
+ }
+
+ /**
+ * getOptions()
+ *
+ * @param string $optionName OPTIONAL
+ * @return array|string
+ */
+ public static function getOptions($optionName = null)
+ {
+ $options = array();
+ foreach (ini_get_all('session') as $sysOptionName => $sysOptionValues) {
+ $options[substr($sysOptionName, 8)] = $sysOptionValues['local_value'];
+ }
+ foreach (self::$_localOptions as $localOptionName => $localOptionMemberName) {
+ $options[$localOptionName] = self::${$localOptionMemberName};
+ }
+
+ if ($optionName) {
+ if (array_key_exists($optionName, $options)) {
+ return $options[$optionName];
+ }
+ return null;
+ }
+
+ return $options;
+ }
+
+ /**
+ * setSaveHandler() - Session Save Handler assignment
+ *
+ * @param Zend_Session_SaveHandler_Interface $interface
+ * @throws Zend_Session_Exception When the session_set_save_handler call fails
+ * @return void
+ */
+ public static function setSaveHandler(Zend_Session_SaveHandler_Interface $saveHandler)
+ {
+ self::$_saveHandler = $saveHandler;
+
+ if (self::$_unitTestEnabled) {
+ return;
+ }
+
+ $result = session_set_save_handler(
+ array(&$saveHandler, 'open'),
+ array(&$saveHandler, 'close'),
+ array(&$saveHandler, 'read'),
+ array(&$saveHandler, 'write'),
+ array(&$saveHandler, 'destroy'),
+ array(&$saveHandler, 'gc')
+ );
+
+ if (!$result) {
+ throw new Zend_Session_Exception('Unable to set session handler');
+ }
+ }
+
+
+ /**
+ * getSaveHandler() - Get the session Save Handler
+ *
+ * @return Zend_Session_SaveHandler_Interface
+ */
+ public static function getSaveHandler()
+ {
+ return self::$_saveHandler;
+ }
+
+
+ /**
+ * regenerateId() - Regenerate the session id. Best practice is to call this after
+ * session is started. If called prior to session starting, session id will be regenerated
+ * at start time.
+ *
+ * @throws Zend_Session_Exception
+ * @return void
+ */
+ public static function regenerateId()
+ {
+ if (!self::$_unitTestEnabled && headers_sent($filename, $linenum)) {
+ /** @see Zend_Session_Exception */
+ throw new Zend_Session_Exception("You must call " . __CLASS__ . '::' . __FUNCTION__ .
+ "() before any output has been sent to the browser; output started in {$filename}/{$linenum}");
+ }
+
+ if ( !self::$_sessionStarted ) {
+ self::$_regenerateIdState = -1;
+ } else {
+ if (!self::$_unitTestEnabled) {
+ session_regenerate_id(true);
+ }
+ self::$_regenerateIdState = 1;
+ }
+ }
+
+
+ /**
+ * rememberMe() - Write a persistent cookie that expires after a number of seconds in the future. If no number of
+ * seconds is specified, then this defaults to self::$_rememberMeSeconds. Due to clock errors on end users' systems,
+ * large values are recommended to avoid undesirable expiration of session cookies.
+ *
+ * @param int $seconds OPTIONAL specifies TTL for cookie in seconds from present time
+ * @return void
+ */
+ public static function rememberMe($seconds = null)
+ {
+ $seconds = (int) $seconds;
+ $seconds = ($seconds > 0) ? $seconds : self::$_rememberMeSeconds;
+
+ self::rememberUntil($seconds);
+ }
+
+
+ /**
+ * forgetMe() - Write a volatile session cookie, removing any persistent cookie that may have existed. The session
+ * would end upon, for example, termination of a web browser program.
+ *
+ * @return void
+ */
+ public static function forgetMe()
+ {
+ self::rememberUntil(0);
+ }
+
+
+ /**
+ * rememberUntil() - This method does the work of changing the state of the session cookie and making
+ * sure that it gets resent to the browser via regenerateId()
+ *
+ * @param int $seconds
+ * @return void
+ */
+ public static function rememberUntil($seconds = 0)
+ {
+ if (self::$_unitTestEnabled) {
+ self::regenerateId();
+ return;
+ }
+
+ $cookieParams = session_get_cookie_params();
+
+ session_set_cookie_params(
+ $seconds,
+ $cookieParams['path'],
+ $cookieParams['domain'],
+ $cookieParams['secure']
+ );
+
+ // normally "rememberMe()" represents a security context change, so should use new session id
+ self::regenerateId();
+ }
+
+
+ /**
+ * sessionExists() - whether or not a session exists for the current request
+ *
+ * @return bool
+ */
+ public static function sessionExists()
+ {
+ if ((bool)ini_get('session.use_cookies') == true && isset($_COOKIE[session_name()])) {
+ return true;
+ } elseif ((bool)ini_get('session.use_only_cookies') == false && isset($_REQUEST[session_name()])) {
+ return true;
+ } elseif (self::$_unitTestEnabled) {
+ return true;
+ }
+
+ return false;
+ }
+
+
+ /**
+ * Whether or not session has been destroyed via session_destroy()
+ *
+ * @return bool
+ */
+ public static function isDestroyed()
+ {
+ return self::$_destroyed;
+ }
+
+
+ /**
+ * start() - Start the session.
+ *
+ * @param bool|array $options OPTIONAL Either user supplied options, or flag indicating if start initiated automatically
+ * @throws Zend_Session_Exception
+ * @return void
+ */
+ public static function start($options = false)
+ {
+ // Check to see if we've been passed an invalid session ID
+ if ( self::getId() && !self::_checkId(self::getId()) ) {
+ // Generate a valid, temporary replacement
+ self::setId(md5(self::getId()));
+ // Force a regenerate after session is started
+ self::$_regenerateIdState = -1;
+ }
+
+ if (self::$_sessionStarted && self::$_destroyed) {
+ throw new Zend_Session_Exception('The session was explicitly destroyed during this request, attempting to re-start is not allowed.');
+ }
+
+ if (self::$_sessionStarted) {
+ return; // already started
+ }
+
+ // make sure our default options (at the least) have been set
+ if (!self::$_defaultOptionsSet) {
+ self::setOptions(is_array($options) ? $options : array());
+ }
+
+ // In strict mode, do not allow auto-starting Zend_Session, such as via "new Zend_Session_Namespace()"
+ if (self::$_strict && $options === true) {
+ /** @see Zend_Session_Exception */
+ throw new Zend_Session_Exception('You must explicitly start the session with Zend_Session::start() when session options are set to strict.');
+ }
+
+ $filename = $linenum = null;
+ if (!self::$_unitTestEnabled && headers_sent($filename, $linenum)) {
+ /** @see Zend_Session_Exception */
+ throw new Zend_Session_Exception("Session must be started before any output has been sent to the browser;"
+ . " output started in {$filename}/{$linenum}");
+ }
+
+ // See http://www.php.net/manual/en/ref.session.php for explanation
+ if (!self::$_unitTestEnabled && defined('SID')) {
+ /** @see Zend_Session_Exception */
+ throw new Zend_Session_Exception('session has already been started by session.auto-start or session_start()');
+ }
+
+ /**
+ * Hack to throw exceptions on start instead of php errors
+ * @see http://framework.zend.com/issues/browse/ZF-1325
+ */
+
+ $errorLevel = (is_int(self::$_throwStartupExceptions)) ? self::$_throwStartupExceptions : E_ALL;
+
+ /** @see Zend_Session_Exception */
+ if (!self::$_unitTestEnabled) {
+
+ if (self::$_throwStartupExceptions) {
+ set_error_handler(array('Zend_Session_Exception', 'handleSessionStartError'), $errorLevel);
+ }
+
+ $startedCleanly = session_start();
+
+ if (self::$_throwStartupExceptions) {
+ restore_error_handler();
+ }
+
+ if (!$startedCleanly || Zend_Session_Exception::$sessionStartError != null) {
+ if (self::$_throwStartupExceptions) {
+ set_error_handler(array('Zend_Session_Exception', 'handleSilentWriteClose'), $errorLevel);
+ }
+ session_write_close();
+ if (self::$_throwStartupExceptions) {
+ restore_error_handler();
+ throw new Zend_Session_Exception(__CLASS__ . '::' . __FUNCTION__ . '() - ' . Zend_Session_Exception::$sessionStartError);
+ }
+ }
+ }
+
+ parent::$_readable = true;
+ parent::$_writable = true;
+ self::$_sessionStarted = true;
+ if (self::$_regenerateIdState === -1) {
+ self::regenerateId();
+ }
+
+ // run validators if they exist
+ if (isset($_SESSION['__ZF']['VALID'])) {
+ self::_processValidators();
+ }
+
+ self::_processStartupMetadataGlobal();
+ }
+
+ /**
+ * Perform a hash-bits check on the session ID
+ *
+ * @param string $id Session ID
+ * @return bool
+ */
+ protected static function _checkId($id)
+ {
+ $saveHandler = ini_get('session.save_handler');
+ if ($saveHandler == 'cluster') { // Zend Server SC, validate only after last dash
+ $dashPos = strrpos($id, '-');
+ if ($dashPos) {
+ $id = substr($id, $dashPos + 1);
+ }
+ }
+
+ $hashBitsPerChar = ini_get('session.hash_bits_per_character');
+ if (!$hashBitsPerChar) {
+ $hashBitsPerChar = 5; // the default value
+ }
+ switch($hashBitsPerChar) {
+ case 4: $pattern = '^[0-9a-f]*$'; break;
+ case 5: $pattern = '^[0-9a-v]*$'; break;
+ case 6: $pattern = '^[0-9a-zA-Z-,]*$'; break;
+ }
+ return preg_match('#'.$pattern.'#', $id);
+ }
+
+
+ /**
+ * _processGlobalMetadata() - this method initizes the sessions GLOBAL
+ * metadata, mostly global data expiration calculations.
+ *
+ * @return void
+ */
+ private static function _processStartupMetadataGlobal()
+ {
+ // process global metadata
+ if (isset($_SESSION['__ZF'])) {
+
+ // expire globally expired values
+ foreach ($_SESSION['__ZF'] as $namespace => $namespace_metadata) {
+
+ // Expire Namespace by Time (ENT)
+ if (isset($namespace_metadata['ENT']) && ($namespace_metadata['ENT'] > 0) && (time() > $namespace_metadata['ENT']) ) {
+ unset($_SESSION[$namespace]);
+ unset($_SESSION['__ZF'][$namespace]);
+ }
+
+ // Expire Namespace by Global Hop (ENGH) if it wasnt expired above
+ if (isset($_SESSION['__ZF'][$namespace]) && isset($namespace_metadata['ENGH']) && $namespace_metadata['ENGH'] >= 1) {
+
+ $_SESSION['__ZF'][$namespace]['ENGH']--;
+
+ if ($_SESSION['__ZF'][$namespace]['ENGH'] === 0) {
+ if (isset($_SESSION[$namespace])) {
+ parent::$_expiringData[$namespace] = $_SESSION[$namespace];
+ unset($_SESSION[$namespace]);
+ }
+ unset($_SESSION['__ZF'][$namespace]);
+ }
+ }
+
+ // Expire Namespace Variables by Time (ENVT)
+ if (isset($namespace_metadata['ENVT'])) {
+ foreach ($namespace_metadata['ENVT'] as $variable => $time) {
+ if (time() > $time) {
+ unset($_SESSION[$namespace][$variable]);
+ unset($_SESSION['__ZF'][$namespace]['ENVT'][$variable]);
+ }
+ }
+ if (empty($_SESSION['__ZF'][$namespace]['ENVT'])) {
+ unset($_SESSION['__ZF'][$namespace]['ENVT']);
+ }
+ }
+
+ // Expire Namespace Variables by Global Hop (ENVGH)
+ if (isset($namespace_metadata['ENVGH'])) {
+ foreach ($namespace_metadata['ENVGH'] as $variable => $hops) {
+ $_SESSION['__ZF'][$namespace]['ENVGH'][$variable]--;
+
+ if ($_SESSION['__ZF'][$namespace]['ENVGH'][$variable] === 0) {
+ if (isset($_SESSION[$namespace][$variable])) {
+ parent::$_expiringData[$namespace][$variable] = $_SESSION[$namespace][$variable];
+ unset($_SESSION[$namespace][$variable]);
+ }
+ unset($_SESSION['__ZF'][$namespace]['ENVGH'][$variable]);
+ }
+ }
+ if (empty($_SESSION['__ZF'][$namespace]['ENVGH'])) {
+ unset($_SESSION['__ZF'][$namespace]['ENVGH']);
+ }
+ }
+
+ if (isset($namespace) && empty($_SESSION['__ZF'][$namespace])) {
+ unset($_SESSION['__ZF'][$namespace]);
+ }
+ }
+ }
+
+ if (isset($_SESSION['__ZF']) && empty($_SESSION['__ZF'])) {
+ unset($_SESSION['__ZF']);
+ }
+ }
+
+
+ /**
+ * isStarted() - convenience method to determine if the session is already started.
+ *
+ * @return bool
+ */
+ public static function isStarted()
+ {
+ return self::$_sessionStarted;
+ }
+
+
+ /**
+ * isRegenerated() - convenience method to determine if session_regenerate_id()
+ * has been called during this request by Zend_Session.
+ *
+ * @return bool
+ */
+ public static function isRegenerated()
+ {
+ return ( (self::$_regenerateIdState > 0) ? true : false );
+ }
+
+
+ /**
+ * getId() - get the current session id
+ *
+ * @return string
+ */
+ public static function getId()
+ {
+ return session_id();
+ }
+
+
+ /**
+ * setId() - set an id to a user specified id
+ *
+ * @throws Zend_Session_Exception
+ * @param string $id
+ * @return void
+ */
+ public static function setId($id)
+ {
+ if (!self::$_unitTestEnabled && defined('SID')) {
+ /** @see Zend_Session_Exception */
+ throw new Zend_Session_Exception('The session has already been started. The session id must be set first.');
+ }
+
+ if (!self::$_unitTestEnabled && headers_sent($filename, $linenum)) {
+ /** @see Zend_Session_Exception */
+ throw new Zend_Session_Exception("You must call ".__CLASS__.'::'.__FUNCTION__.
+ "() before any output has been sent to the browser; output started in {$filename}/{$linenum}");
+ }
+
+ if (!is_string($id) || $id === '') {
+ /** @see Zend_Session_Exception */
+ throw new Zend_Session_Exception('You must provide a non-empty string as a session identifier.');
+ }
+
+ session_id($id);
+ }
+
+
+ /**
+ * registerValidator() - register a validator that will attempt to validate this session for
+ * every future request
+ *
+ * @param Zend_Session_Validator_Interface $validator
+ * @return void
+ */
+ public static function registerValidator(Zend_Session_Validator_Interface $validator)
+ {
+ $validator->setup();
+ }
+
+
+ /**
+ * stop() - Disable write access. Optionally disable read (not implemented).
+ *
+ * @return void
+ */
+ public static function stop()
+ {
+ parent::$_writable = false;
+ }
+
+
+ /**
+ * writeClose() - Shutdown the sesssion, close writing and detach $_SESSION from the back-end storage mechanism.
+ * This will complete the internal data transformation on this request.
+ *
+ * @param bool $readonly - OPTIONAL remove write access (i.e. throw error if Zend_Session's attempt writes)
+ * @return void
+ */
+ public static function writeClose($readonly = true)
+ {
+ if (self::$_unitTestEnabled) {
+ return;
+ }
+
+ if (self::$_writeClosed) {
+ return;
+ }
+
+ if ($readonly) {
+ parent::$_writable = false;
+ }
+
+ session_write_close();
+ self::$_writeClosed = true;
+ }
+
+
+ /**
+ * destroy() - This is used to destroy session data, and optionally, the session cookie itself
+ *
+ * @param bool $remove_cookie - OPTIONAL remove session id cookie, defaults to true (remove cookie)
+ * @param bool $readonly - OPTIONAL remove write access (i.e. throw error if Zend_Session's attempt writes)
+ * @return void
+ */
+ public static function destroy($remove_cookie = true, $readonly = true)
+ {
+ if (self::$_unitTestEnabled) {
+ return;
+ }
+
+ if (self::$_destroyed) {
+ return;
+ }
+
+ if ($readonly) {
+ parent::$_writable = false;
+ }
+
+ session_destroy();
+ self::$_destroyed = true;
+
+ if ($remove_cookie) {
+ self::expireSessionCookie();
+ }
+ }
+
+
+ /**
+ * expireSessionCookie() - Sends an expired session id cookie, causing the client to delete the session cookie
+ *
+ * @return void
+ */
+ public static function expireSessionCookie()
+ {
+ if (self::$_unitTestEnabled) {
+ return;
+ }
+
+ if (self::$_sessionCookieDeleted) {
+ return;
+ }
+
+ self::$_sessionCookieDeleted = true;
+
+ if (isset($_COOKIE[session_name()])) {
+ $cookie_params = session_get_cookie_params();
+
+ setcookie(
+ session_name(),
+ false,
+ 315554400, // strtotime('1980-01-01'),
+ $cookie_params['path'],
+ $cookie_params['domain'],
+ $cookie_params['secure']
+ );
+ }
+ }
+
+
+ /**
+ * _processValidator() - internal function that is called in the existence of VALID metadata
+ *
+ * @throws Zend_Session_Exception
+ * @return void
+ */
+ private static function _processValidators()
+ {
+ foreach ($_SESSION['__ZF']['VALID'] as $validator_name => $valid_data) {
+ if (!class_exists($validator_name)) {
+ Zend_Loader::loadClass($validator_name);
+ }
+ $validator = new $validator_name;
+ if ($validator->validate() === false) {
+ /** @see Zend_Session_Validator_Exception */
+ throw new Zend_Session_Validator_Exception("This session is not valid according to {$validator_name}.");
+ }
+ }
+ }
+
+
+ /**
+ * namespaceIsset() - check to see if a namespace is set
+ *
+ * @param string $namespace
+ * @return bool
+ */
+ public static function namespaceIsset($namespace)
+ {
+ return parent::_namespaceIsset($namespace);
+ }
+
+
+ /**
+ * namespaceUnset() - unset a namespace or a variable within a namespace
+ *
+ * @param string $namespace
+ * @throws Zend_Session_Exception
+ * @return void
+ */
+ public static function namespaceUnset($namespace)
+ {
+ parent::_namespaceUnset($namespace);
+ Zend_Session_Namespace::resetSingleInstance($namespace);
+ }
+
+
+ /**
+ * namespaceGet() - get all variables in a namespace
+ * Deprecated: Use getIterator() in Zend_Session_Namespace.
+ *
+ * @param string $namespace
+ * @return array
+ */
+ public static function namespaceGet($namespace)
+ {
+ return parent::_namespaceGetAll($namespace);
+ }
+
+
+ /**
+ * getIterator() - return an iteratable object for use in foreach and the like,
+ * this completes the IteratorAggregate interface
+ *
+ * @throws Zend_Session_Exception
+ * @return ArrayObject
+ */
+ public static function getIterator()
+ {
+ if (parent::$_readable === false) {
+ /** @see Zend_Session_Exception */
+ throw new Zend_Session_Exception(parent::_THROW_NOT_READABLE_MSG);
+ }
+
+ $spaces = array();
+ if (isset($_SESSION)) {
+ $spaces = array_keys($_SESSION);
+ foreach($spaces as $key => $space) {
+ if (!strncmp($space, '__', 2) || !is_array($_SESSION[$space])) {
+ unset($spaces[$key]);
+ }
+ }
+ }
+
+ return new ArrayObject(array_merge($spaces, array_keys(parent::$_expiringData)));
+ }
+
+
+ /**
+ * isWritable() - returns a boolean indicating if namespaces can write (use setters)
+ *
+ * @return bool
+ */
+ public static function isWritable()
+ {
+ return parent::$_writable;
+ }
+
+
+ /**
+ * isReadable() - returns a boolean indicating if namespaces can write (use setters)
+ *
+ * @return bool
+ */
+ public static function isReadable()
+ {
+ return parent::$_readable;
+ }
+
+}
diff --git a/library/vendor/Zend/Session/Abstract.php b/library/vendor/Zend/Session/Abstract.php
new file mode 100644
index 0000000..15ffde0
--- /dev/null
+++ b/library/vendor/Zend/Session/Abstract.php
@@ -0,0 +1,182 @@
+<?php
+
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ * @since Preview Release 0.2
+ */
+
+
+/**
+ * Zend_Session_Abstract
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Session_Abstract
+{
+ /**
+ * Whether or not session permits writing (modification of $_SESSION[])
+ *
+ * @var bool
+ */
+ protected static $_writable = false;
+
+ /**
+ * Whether or not session permits reading (reading data in $_SESSION[])
+ *
+ * @var bool
+ */
+ protected static $_readable = false;
+
+ /**
+ * Since expiring data is handled at startup to avoid __destruct difficulties,
+ * the data that will be expiring at end of this request is held here
+ *
+ * @var array
+ */
+ protected static $_expiringData = array();
+
+
+ /**
+ * Error message thrown when an action requires modification,
+ * but current Zend_Session has been marked as read-only.
+ */
+ const _THROW_NOT_WRITABLE_MSG = 'Zend_Session is currently marked as read-only.';
+
+
+ /**
+ * Error message thrown when an action requires reading session data,
+ * but current Zend_Session is not marked as readable.
+ */
+ const _THROW_NOT_READABLE_MSG = 'Zend_Session is not marked as readable.';
+
+
+ /**
+ * namespaceIsset() - check to see if a namespace or a variable within a namespace is set
+ *
+ * @param string $namespace
+ * @param string $name
+ * @return bool
+ */
+ protected static function _namespaceIsset($namespace, $name = null)
+ {
+ if (self::$_readable === false) {
+ /**
+ * @see Zend_Session_Exception
+ */
+ throw new Zend_Session_Exception(self::_THROW_NOT_READABLE_MSG);
+ }
+
+ if ($name === null) {
+ return ( isset($_SESSION[$namespace]) || isset(self::$_expiringData[$namespace]) );
+ } else {
+ return ( isset($_SESSION[$namespace][$name]) || isset(self::$_expiringData[$namespace][$name]) );
+ }
+ }
+
+
+ /**
+ * namespaceUnset() - unset a namespace or a variable within a namespace
+ *
+ * @param string $namespace
+ * @param string $name
+ * @throws Zend_Session_Exception
+ * @return void
+ */
+ protected static function _namespaceUnset($namespace, $name = null)
+ {
+ if (self::$_writable === false) {
+ /**
+ * @see Zend_Session_Exception
+ */
+ throw new Zend_Session_Exception(self::_THROW_NOT_WRITABLE_MSG);
+ }
+
+ $name = (string) $name;
+
+ // check to see if the api wanted to remove a var from a namespace or a namespace
+ if ($name === '') {
+ unset($_SESSION[$namespace]);
+ unset(self::$_expiringData[$namespace]);
+ } else {
+ unset($_SESSION[$namespace][$name]);
+ unset(self::$_expiringData[$namespace][$name]);
+ }
+
+ // if we remove the last value, remove namespace.
+ if (empty($_SESSION[$namespace])) {
+ unset($_SESSION[$namespace]);
+ }
+ }
+
+
+ /**
+ * namespaceGet() - Get $name variable from $namespace, returning by reference.
+ *
+ * @param string $namespace
+ * @param string $name
+ * @return mixed
+ */
+ protected static function & _namespaceGet($namespace, $name = null)
+ {
+ if (self::$_readable === false) {
+ /**
+ * @see Zend_Session_Exception
+ */
+ throw new Zend_Session_Exception(self::_THROW_NOT_READABLE_MSG);
+ }
+
+ if ($name === null) {
+ if (isset($_SESSION[$namespace])) { // check session first for data requested
+ return $_SESSION[$namespace];
+ } elseif (isset(self::$_expiringData[$namespace])) { // check expiring data for data reqeusted
+ return self::$_expiringData[$namespace];
+ } else {
+ return $_SESSION[$namespace]; // satisfy return by reference
+ }
+ } else {
+ if (isset($_SESSION[$namespace][$name])) { // check session first
+ return $_SESSION[$namespace][$name];
+ } elseif (isset(self::$_expiringData[$namespace][$name])) { // check expiring data
+ return self::$_expiringData[$namespace][$name];
+ } else {
+ return $_SESSION[$namespace][$name]; // satisfy return by reference
+ }
+ }
+ }
+
+
+ /**
+ * namespaceGetAll() - Get an array containing $namespace, including expiring data.
+ *
+ * @param string $namespace
+ * @param string $name
+ * @return mixed
+ */
+ protected static function _namespaceGetAll($namespace)
+ {
+ $currentData = (isset($_SESSION[$namespace]) && is_array($_SESSION[$namespace])) ?
+ $_SESSION[$namespace] : array();
+ $expiringData = (isset(self::$_expiringData[$namespace]) && is_array(self::$_expiringData[$namespace])) ?
+ self::$_expiringData[$namespace] : array();
+ return array_merge($currentData, $expiringData);
+ }
+}
diff --git a/library/vendor/Zend/Session/Exception.php b/library/vendor/Zend/Session/Exception.php
new file mode 100644
index 0000000..52672ec
--- /dev/null
+++ b/library/vendor/Zend/Session/Exception.php
@@ -0,0 +1,73 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ * @since Preview Release 0.2
+ */
+
+
+/**
+ * @see Zend_Exception
+ */
+
+
+/**
+ * Zend_Session_Exception
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Session_Exception extends Zend_Exception
+{
+ /**
+ * sessionStartError
+ *
+ * @see http://framework.zend.com/issues/browse/ZF-1325
+ * @var string PHP Error Message
+ */
+ static public $sessionStartError = null;
+
+ /**
+ * handleSessionStartError() - interface for set_error_handler()
+ *
+ * @see http://framework.zend.com/issues/browse/ZF-1325
+ * @param int $errno
+ * @param string $errstr
+ * @return void
+ */
+ static public function handleSessionStartError($errno, $errstr, $errfile, $errline, $errcontext)
+ {
+ self::$sessionStartError = $errfile . '(Line:' . $errline . '): Error #' . $errno . ' ' . $errstr;
+ }
+
+ /**
+ * handleSilentWriteClose() - interface for set_error_handler()
+ *
+ * @see http://framework.zend.com/issues/browse/ZF-1325
+ * @param int $errno
+ * @param string $errstr
+ * @return void
+ */
+ static public function handleSilentWriteClose($errno, $errstr, $errfile, $errline, $errcontext)
+ {
+ self::$sessionStartError .= PHP_EOL . $errfile . '(Line:' . $errline . '): Error #' . $errno . ' ' . $errstr;
+ }
+}
+
diff --git a/library/vendor/Zend/Session/Namespace.php b/library/vendor/Zend/Session/Namespace.php
new file mode 100644
index 0000000..52d7945
--- /dev/null
+++ b/library/vendor/Zend/Session/Namespace.php
@@ -0,0 +1,511 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ * @since Preview Release 0.2
+ */
+
+
+/**
+ * @see Zend_Session
+ */
+
+
+/**
+ * @see Zend_Session_Abstract
+ */
+
+
+/**
+ * Zend_Session_Namespace
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Session_Namespace extends Zend_Session_Abstract implements IteratorAggregate
+{
+
+ /**
+ * used as option to constructor to prevent additional instances to the same namespace
+ */
+ const SINGLE_INSTANCE = true;
+
+ /**
+ * Namespace - which namespace this instance of zend-session is saving-to/getting-from
+ *
+ * @var string
+ */
+ protected $_namespace = "Default";
+
+ /**
+ * Namespace locking mechanism
+ *
+ * @var array
+ */
+ protected static $_namespaceLocks = array();
+
+ /**
+ * Single instance namespace array to ensure data security.
+ *
+ * @var array
+ */
+ protected static $_singleInstances = array();
+
+ /**
+ * resetSingleInstance()
+ *
+ * @param string $namespaceName
+ * @return null
+ */
+ public static function resetSingleInstance($namespaceName = null)
+ {
+ if ($namespaceName != null) {
+ if (array_key_exists($namespaceName, self::$_singleInstances)) {
+ unset(self::$_singleInstances[$namespaceName]);
+ }
+ return;
+ }
+
+ self::$_singleInstances = array();
+ return;
+ }
+
+ /**
+ * __construct() - Returns an instance object bound to a particular, isolated section
+ * of the session, identified by $namespace name (defaulting to 'Default').
+ * The optional argument $singleInstance will prevent construction of additional
+ * instance objects acting as accessors to this $namespace.
+ *
+ * @param string $namespace - programmatic name of the requested namespace
+ * @param bool $singleInstance - prevent creation of additional accessor instance objects for this namespace
+ * @return void
+ */
+ public function __construct($namespace = 'Default', $singleInstance = false)
+ {
+ if ($namespace === '') {
+ /**
+ * @see Zend_Session_Exception
+ */
+ throw new Zend_Session_Exception('Session namespace must be a non-empty string.');
+ }
+
+ if ($namespace[0] == "_") {
+ /**
+ * @see Zend_Session_Exception
+ */
+ throw new Zend_Session_Exception('Session namespace must not start with an underscore.');
+ }
+
+ if (preg_match('#(^[0-9])#i', $namespace[0])) {
+ /**
+ * @see Zend_Session_Exception
+ */
+ throw new Zend_Session_Exception('Session namespace must not start with a number.');
+ }
+
+ if (isset(self::$_singleInstances[$namespace])) {
+ /**
+ * @see Zend_Session_Exception
+ */
+ throw new Zend_Session_Exception("A session namespace object already exists for this namespace ('$namespace'), and no additional accessors (session namespace objects) for this namespace are permitted.");
+ }
+
+ if ($singleInstance === true) {
+ self::$_singleInstances[$namespace] = true;
+ }
+
+ $this->_namespace = $namespace;
+
+ // Process metadata specific only to this namespace.
+ Zend_Session::start(true); // attempt auto-start (throws exception if strict option set)
+
+ if (self::$_readable === false) {
+ /**
+ * @see Zend_Session_Exception
+ */
+ throw new Zend_Session_Exception(self::_THROW_NOT_READABLE_MSG);
+ }
+
+ if (!isset($_SESSION['__ZF'])) {
+ return; // no further processing needed
+ }
+
+ // do not allow write access to namespaces, after stop() or writeClose()
+ if (parent::$_writable === true) {
+ if (isset($_SESSION['__ZF'][$namespace])) {
+
+ // Expire Namespace by Namespace Hop (ENNH)
+ if (isset($_SESSION['__ZF'][$namespace]['ENNH'])) {
+ $_SESSION['__ZF'][$namespace]['ENNH']--;
+
+ if ($_SESSION['__ZF'][$namespace]['ENNH'] === 0) {
+ if (isset($_SESSION[$namespace])) {
+ self::$_expiringData[$namespace] = $_SESSION[$namespace];
+ unset($_SESSION[$namespace]);
+ }
+ unset($_SESSION['__ZF'][$namespace]);
+ }
+ }
+
+ // Expire Namespace Variables by Namespace Hop (ENVNH)
+ if (isset($_SESSION['__ZF'][$namespace]['ENVNH'])) {
+ foreach ($_SESSION['__ZF'][$namespace]['ENVNH'] as $variable => $hops) {
+ $_SESSION['__ZF'][$namespace]['ENVNH'][$variable]--;
+
+ if ($_SESSION['__ZF'][$namespace]['ENVNH'][$variable] === 0) {
+ if (isset($_SESSION[$namespace][$variable])) {
+ self::$_expiringData[$namespace][$variable] = $_SESSION[$namespace][$variable];
+ unset($_SESSION[$namespace][$variable]);
+ }
+ unset($_SESSION['__ZF'][$namespace]['ENVNH'][$variable]);
+ }
+ }
+ if(empty($_SESSION['__ZF'][$namespace]['ENVNH'])) {
+ unset($_SESSION['__ZF'][$namespace]['ENVNH']);
+ }
+ }
+ }
+
+ if (empty($_SESSION['__ZF'][$namespace])) {
+ unset($_SESSION['__ZF'][$namespace]);
+ }
+
+ if (empty($_SESSION['__ZF'])) {
+ unset($_SESSION['__ZF']);
+ }
+ }
+ }
+
+
+ /**
+ * getIterator() - return an iteratable object for use in foreach and the like,
+ * this completes the IteratorAggregate interface
+ *
+ * @return ArrayObject - iteratable container of the namespace contents
+ */
+ public function getIterator()
+ {
+ return new ArrayObject(parent::_namespaceGetAll($this->_namespace));
+ }
+
+
+ /**
+ * lock() - mark a session/namespace as readonly
+ *
+ * @return void
+ */
+ public function lock()
+ {
+ self::$_namespaceLocks[$this->_namespace] = true;
+ }
+
+
+ /**
+ * unlock() - unmark a session/namespace to enable read & write
+ *
+ * @return void
+ */
+ public function unlock()
+ {
+ unset(self::$_namespaceLocks[$this->_namespace]);
+ }
+
+
+ /**
+ * unlockAll() - unmark all session/namespaces to enable read & write
+ *
+ * @return void
+ */
+ public static function unlockAll()
+ {
+ self::$_namespaceLocks = array();
+ }
+
+
+ /**
+ * isLocked() - return lock status, true if, and only if, read-only
+ *
+ * @return bool
+ */
+ public function isLocked()
+ {
+ return isset(self::$_namespaceLocks[$this->_namespace]);
+ }
+
+
+ /**
+ * unsetAll() - unset all variables in this namespace
+ *
+ * @return true
+ */
+ public function unsetAll()
+ {
+ return parent::_namespaceUnset($this->_namespace);
+ }
+
+
+ /**
+ * __get() - method to get a variable in this object's current namespace
+ *
+ * @param string $name - programmatic name of a key, in a <key,value> pair in the current namespace
+ * @return mixed
+ */
+ public function & __get($name)
+ {
+ if ($name === '') {
+ /**
+ * @see Zend_Session_Exception
+ */
+ throw new Zend_Session_Exception("The '$name' key must be a non-empty string");
+ }
+
+ return parent::_namespaceGet($this->_namespace, $name);
+ }
+
+
+ /**
+ * __set() - method to set a variable/value in this object's namespace
+ *
+ * @param string $name - programmatic name of a key, in a <key,value> pair in the current namespace
+ * @param mixed $value - value in the <key,value> pair to assign to the $name key
+ * @throws Zend_Session_Exception
+ * @return true
+ */
+ public function __set($name, $value)
+ {
+ if (isset(self::$_namespaceLocks[$this->_namespace])) {
+ /**
+ * @see Zend_Session_Exception
+ */
+ throw new Zend_Session_Exception('This session/namespace has been marked as read-only.');
+ }
+
+ if ($name === '') {
+ /**
+ * @see Zend_Session_Exception
+ */
+ throw new Zend_Session_Exception("The '$name' key must be a non-empty string");
+ }
+
+ if (parent::$_writable === false) {
+ /**
+ * @see Zend_Session_Exception
+ */
+ throw new Zend_Session_Exception(parent::_THROW_NOT_WRITABLE_MSG);
+ }
+
+ $name = (string) $name;
+
+ $_SESSION[$this->_namespace][$name] = $value;
+ }
+
+
+ /**
+ * apply() - enables applying user-selected function, such as array_merge() to the namespace
+ * Parameters following the $callback argument are passed to the callback function.
+ * Caveat: ignores members expiring now.
+ *
+ * Example:
+ * $namespace->apply('array_merge', array('tree' => 'apple', 'fruit' => 'peach'), array('flower' => 'rose'));
+ * $namespace->apply('count');
+ *
+ * @param string|array $callback - callback function
+ */
+ public function apply($callback)
+ {
+ $arg_list = func_get_args();
+ $arg_list[0] = $_SESSION[$this->_namespace];
+ return call_user_func_array($callback, $arg_list);
+ }
+
+
+ /**
+ * applySet() - enables applying user-selected function, and sets entire namespace to the result
+ * Result of $callback must be an array.
+ * Parameters following the $callback argument are passed to the callback function.
+ * Caveat: ignores members expiring now.
+ *
+ * Example:
+ * $namespace->applySet('array_merge', array('tree' => 'apple', 'fruit' => 'peach'), array('flower' => 'rose'));
+ *
+ * @param string|array $callback - callback function
+ */
+ public function applySet($callback)
+ {
+ $arg_list = func_get_args();
+ $arg_list[0] = $_SESSION[$this->_namespace];
+ $result = call_user_func_array($callback, $arg_list);
+ if (!is_array($result)) {
+ /**
+ * @see Zend_Session_Exception
+ */
+ throw new Zend_Session_Exception('Result must be an array. Got: ' . gettype($result));
+ }
+ $_SESSION[$this->_namespace] = $result;
+ return $result;
+ }
+
+
+ /**
+ * __isset() - determine if a variable in this object's namespace is set
+ *
+ * @param string $name - programmatic name of a key, in a <key,value> pair in the current namespace
+ * @return bool
+ */
+ public function __isset($name)
+ {
+ if ($name === '') {
+ /**
+ * @see Zend_Session_Exception
+ */
+ throw new Zend_Session_Exception("The '$name' key must be a non-empty string");
+ }
+
+ return parent::_namespaceIsset($this->_namespace, $name);
+ }
+
+
+ /**
+ * __unset() - unset a variable in this object's namespace.
+ *
+ * @param string $name - programmatic name of a key, in a <key,value> pair in the current namespace
+ * @return true
+ */
+ public function __unset($name)
+ {
+ if ($name === '') {
+ /**
+ * @see Zend_Session_Exception
+ */
+ throw new Zend_Session_Exception("The '$name' key must be a non-empty string");
+ }
+
+ return parent::_namespaceUnset($this->_namespace, $name);
+ }
+
+
+ /**
+ * setExpirationSeconds() - expire the namespace, or specific variables after a specified
+ * number of seconds
+ *
+ * @param int $seconds - expires in this many seconds
+ * @param mixed $variables - OPTIONAL list of variables to expire (defaults to all)
+ * @throws Zend_Session_Exception
+ * @return void
+ */
+ public function setExpirationSeconds($seconds, $variables = null)
+ {
+ if (parent::$_writable === false) {
+ /**
+ * @see Zend_Session_Exception
+ */
+ throw new Zend_Session_Exception(parent::_THROW_NOT_WRITABLE_MSG);
+ }
+
+ if ($seconds <= 0) {
+ /**
+ * @see Zend_Session_Exception
+ */
+ throw new Zend_Session_Exception('Seconds must be positive.');
+ }
+
+ if ($variables === null) {
+
+ // apply expiration to entire namespace
+ $_SESSION['__ZF'][$this->_namespace]['ENT'] = time() + $seconds;
+
+ } else {
+
+ if (is_string($variables)) {
+ $variables = array($variables);
+ }
+
+ foreach ($variables as $variable) {
+ if (!empty($variable)) {
+ $_SESSION['__ZF'][$this->_namespace]['ENVT'][$variable] = time() + $seconds;
+ }
+ }
+ }
+ }
+
+
+ /**
+ * setExpirationHops() - expire the namespace, or specific variables after a specified
+ * number of page hops
+ *
+ * @param int $hops - how many "hops" (number of subsequent requests) before expiring
+ * @param mixed $variables - OPTIONAL list of variables to expire (defaults to all)
+ * @param boolean $hopCountOnUsageOnly - OPTIONAL if set, only count a hop/request if this namespace is used
+ * @throws Zend_Session_Exception
+ * @return void
+ */
+ public function setExpirationHops($hops, $variables = null, $hopCountOnUsageOnly = false)
+ {
+ if (parent::$_writable === false) {
+ /**
+ * @see Zend_Session_Exception
+ */
+ throw new Zend_Session_Exception(parent::_THROW_NOT_WRITABLE_MSG);
+ }
+
+ if ($hops <= 0) {
+ /**
+ * @see Zend_Session_Exception
+ */
+ throw new Zend_Session_Exception('Hops must be positive number.');
+ }
+
+ if ($variables === null) {
+
+ // apply expiration to entire namespace
+ if ($hopCountOnUsageOnly === false) {
+ $_SESSION['__ZF'][$this->_namespace]['ENGH'] = $hops;
+ } else {
+ $_SESSION['__ZF'][$this->_namespace]['ENNH'] = $hops;
+ }
+
+ } else {
+
+ if (is_string($variables)) {
+ $variables = array($variables);
+ }
+
+ foreach ($variables as $variable) {
+ if (!empty($variable)) {
+ if ($hopCountOnUsageOnly === false) {
+ $_SESSION['__ZF'][$this->_namespace]['ENVGH'][$variable] = $hops;
+ } else {
+ $_SESSION['__ZF'][$this->_namespace]['ENVNH'][$variable] = $hops;
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Returns the namespace name
+ *
+ * @return string
+ */
+ public function getNamespace()
+ {
+ return $this->_namespace;
+ }
+}
diff --git a/library/vendor/Zend/Session/SaveHandler/DbTable.php b/library/vendor/Zend/Session/SaveHandler/DbTable.php
new file mode 100644
index 0000000..a4b1bf7
--- /dev/null
+++ b/library/vendor/Zend/Session/SaveHandler/DbTable.php
@@ -0,0 +1,579 @@
+<?php
+
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-webat this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Session
+ */
+
+/**
+ * @see Zend_Db_Table_Abstract
+ */
+
+/**
+ * @see Zend_Db_Table_Row_Abstract
+ */
+
+/**
+ * @see Zend_Config
+ */
+
+/**
+ * Zend_Session_SaveHandler_DbTable
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @subpackage SaveHandler
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Session_SaveHandler_DbTable
+ extends Zend_Db_Table_Abstract
+ implements Zend_Session_SaveHandler_Interface
+{
+ const PRIMARY_ASSIGNMENT = 'primaryAssignment';
+ const PRIMARY_ASSIGNMENT_SESSION_SAVE_PATH = 'sessionSavePath';
+ const PRIMARY_ASSIGNMENT_SESSION_NAME = 'sessionName';
+ const PRIMARY_ASSIGNMENT_SESSION_ID = 'sessionId';
+
+ const MODIFIED_COLUMN = 'modifiedColumn';
+ const LIFETIME_COLUMN = 'lifetimeColumn';
+ const DATA_COLUMN = 'dataColumn';
+
+ const LIFETIME = 'lifetime';
+ const OVERRIDE_LIFETIME = 'overrideLifetime';
+
+ const PRIMARY_TYPE_NUM = 'PRIMARY_TYPE_NUM';
+ const PRIMARY_TYPE_PRIMARYNUM = 'PRIMARY_TYPE_PRIMARYNUM';
+ const PRIMARY_TYPE_ASSOC = 'PRIMARY_TYPE_ASSOC';
+ const PRIMARY_TYPE_WHERECLAUSE = 'PRIMARY_TYPE_WHERECLAUSE';
+
+ /**
+ * Session table primary key value assignment
+ *
+ * @var array
+ */
+ protected $_primaryAssignment = null;
+
+ /**
+ * Session table last modification time column
+ *
+ * @var string
+ */
+ protected $_modifiedColumn = null;
+
+ /**
+ * Session table lifetime column
+ *
+ * @var string
+ */
+ protected $_lifetimeColumn = null;
+
+ /**
+ * Session table data column
+ *
+ * @var string
+ */
+ protected $_dataColumn = null;
+
+ /**
+ * Session lifetime
+ *
+ * @var int
+ */
+ protected $_lifetime = false;
+
+ /**
+ * Whether or not the lifetime of an existing session should be overridden
+ *
+ * @var boolean
+ */
+ protected $_overrideLifetime = false;
+
+ /**
+ * Session save path
+ *
+ * @var string
+ */
+ protected $_sessionSavePath;
+
+ /**
+ * Session name
+ *
+ * @var string
+ */
+ protected $_sessionName;
+
+ /**
+ * Constructor
+ *
+ * $config is an instance of Zend_Config or an array of key/value pairs containing configuration options for
+ * Zend_Session_SaveHandler_DbTable and Zend_Db_Table_Abstract. These are the configuration options for
+ * Zend_Session_SaveHandler_DbTable:
+ *
+ * primaryAssignment => (string|array) Session table primary key value assignment
+ * (optional; default: 1 => sessionId) You have to assign a value to each primary key of your session table.
+ * The value of this configuration option is either a string if you have only one primary key or an array if
+ * you have multiple primary keys. The array consists of numeric keys starting at 1 and string values. There
+ * are some values which will be replaced by session information:
+ *
+ * sessionId => The id of the current session
+ * sessionName => The name of the current session
+ * sessionSavePath => The save path of the current session
+ *
+ * NOTE: One of your assignments MUST contain 'sessionId' as value!
+ *
+ * modifiedColumn => (string) Session table last modification time column
+ *
+ * lifetimeColumn => (string) Session table lifetime column
+ *
+ * dataColumn => (string) Session table data column
+ *
+ * lifetime => (integer) Session lifetime (optional; default: ini_get('session.gc_maxlifetime'))
+ *
+ * overrideLifetime => (boolean) Whether or not the lifetime of an existing session should be overridden
+ * (optional; default: false)
+ *
+ * @param Zend_Config|array $config User-provided configuration
+ * @return void
+ * @throws Zend_Session_SaveHandler_Exception
+ */
+ public function __construct($config)
+ {
+ if ($config instanceof Zend_Config) {
+ $config = $config->toArray();
+ } else if (!is_array($config)) {
+ /**
+ * @see Zend_Session_SaveHandler_Exception
+ */
+
+ throw new Zend_Session_SaveHandler_Exception(
+ '$config must be an instance of Zend_Config or array of key/value pairs containing '
+ . 'configuration options for Zend_Session_SaveHandler_DbTable and Zend_Db_Table_Abstract.');
+ }
+
+ foreach ($config as $key => $value) {
+ do {
+ switch ($key) {
+ case self::PRIMARY_ASSIGNMENT:
+ $this->_primaryAssignment = $value;
+ break;
+ case self::MODIFIED_COLUMN:
+ $this->_modifiedColumn = (string) $value;
+ break;
+ case self::LIFETIME_COLUMN:
+ $this->_lifetimeColumn = (string) $value;
+ break;
+ case self::DATA_COLUMN:
+ $this->_dataColumn = (string) $value;
+ break;
+ case self::LIFETIME:
+ $this->setLifetime($value);
+ break;
+ case self::OVERRIDE_LIFETIME:
+ $this->setOverrideLifetime($value);
+ break;
+ default:
+ // unrecognized options passed to parent::__construct()
+ break 2;
+ }
+ unset($config[$key]);
+ } while (false);
+ }
+
+ parent::__construct($config);
+ }
+
+ /**
+ * Destructor
+ *
+ * @return void
+ */
+ public function __destruct()
+ {
+ Zend_Session::writeClose();
+ }
+
+ /**
+ * Set session lifetime and optional whether or not the lifetime of an existing session should be overridden
+ *
+ * $lifetime === false resets lifetime to session.gc_maxlifetime
+ *
+ * @param int $lifetime
+ * @param boolean $overrideLifetime (optional)
+ * @return Zend_Session_SaveHandler_DbTable
+ */
+ public function setLifetime($lifetime, $overrideLifetime = null)
+ {
+ if ($lifetime < 0) {
+ /**
+ * @see Zend_Session_SaveHandler_Exception
+ */
+ throw new Zend_Session_SaveHandler_Exception();
+ } else if (empty($lifetime)) {
+ $this->_lifetime = (int) ini_get('session.gc_maxlifetime');
+ } else {
+ $this->_lifetime = (int) $lifetime;
+ }
+
+ if ($overrideLifetime != null) {
+ $this->setOverrideLifetime($overrideLifetime);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Retrieve session lifetime
+ *
+ * @return int
+ */
+ public function getLifetime()
+ {
+ return $this->_lifetime;
+ }
+
+ /**
+ * Set whether or not the lifetime of an existing session should be overridden
+ *
+ * @param boolean $overrideLifetime
+ * @return Zend_Session_SaveHandler_DbTable
+ */
+ public function setOverrideLifetime($overrideLifetime)
+ {
+ $this->_overrideLifetime = (boolean) $overrideLifetime;
+
+ return $this;
+ }
+
+ /**
+ * Retrieve whether or not the lifetime of an existing session should be overridden
+ *
+ * @return boolean
+ */
+ public function getOverrideLifetime()
+ {
+ return $this->_overrideLifetime;
+ }
+
+ /**
+ * Open Session
+ *
+ * @param string $save_path
+ * @param string $name
+ * @return boolean
+ */
+ public function open($save_path, $name)
+ {
+ $this->_sessionSavePath = $save_path;
+ $this->_sessionName = $name;
+
+ return true;
+ }
+
+ /**
+ * Close session
+ *
+ * @return boolean
+ */
+ public function close()
+ {
+ return true;
+ }
+
+ /**
+ * Read session data
+ *
+ * @param string $id
+ * @return string
+ */
+ public function read($id)
+ {
+ $return = '';
+
+ $rows = call_user_func_array(array(&$this, 'find'), $this->_getPrimary($id));
+
+ if (count($rows)) {
+ if ($this->_getExpirationTime($row = $rows->current()) > time()) {
+ $return = $row->{$this->_dataColumn};
+ } else {
+ $this->destroy($id);
+ }
+ }
+
+ return $return;
+ }
+
+ /**
+ * Write session data
+ *
+ * @param string $id
+ * @param string $data
+ * @return boolean
+ */
+ public function write($id, $data)
+ {
+ $return = false;
+
+ $data = array($this->_modifiedColumn => time(),
+ $this->_dataColumn => (string) $data);
+
+ $rows = call_user_func_array(array(&$this, 'find'), $this->_getPrimary($id));
+
+ if (count($rows)) {
+ $data[$this->_lifetimeColumn] = $this->_getLifetime($rows->current());
+
+ if ($this->update($data, $this->_getPrimary($id, self::PRIMARY_TYPE_WHERECLAUSE))) {
+ $return = true;
+ }
+ } else {
+ $data[$this->_lifetimeColumn] = $this->_lifetime;
+
+ if ($this->insert(array_merge($this->_getPrimary($id, self::PRIMARY_TYPE_ASSOC), $data))) {
+ $return = true;
+ }
+ }
+
+ return $return;
+ }
+
+ /**
+ * Destroy session
+ *
+ * @param string $id
+ * @return boolean
+ */
+ public function destroy($id)
+ {
+ $return = false;
+
+ if ($this->delete($this->_getPrimary($id, self::PRIMARY_TYPE_WHERECLAUSE))) {
+ $return = true;
+ }
+
+ return $return;
+ }
+
+ /**
+ * Garbage Collection
+ *
+ * @param int $maxlifetime
+ * @return true
+ */
+ public function gc($maxlifetime)
+ {
+ $this->delete($this->getAdapter()->quoteIdentifier($this->_modifiedColumn, true) . ' + '
+ . $this->getAdapter()->quoteIdentifier($this->_lifetimeColumn, true) . ' < '
+ . $this->getAdapter()->quote(time()));
+
+ return true;
+ }
+
+ /**
+ * Calls other protected methods for individual setup tasks and requirement checks
+ *
+ * @return void
+ */
+ protected function _setup()
+ {
+ parent::_setup();
+
+ $this->_setupPrimaryAssignment();
+ $this->setLifetime($this->_lifetime);
+
+ $this->_checkRequiredColumns();
+ }
+
+ /**
+ * Initialize table and schema names
+ *
+ * @return void
+ * @throws Zend_Session_SaveHandler_Exception
+ */
+ protected function _setupTableName()
+ {
+ if (empty($this->_name) && basename(($this->_name = session_save_path())) != $this->_name) {
+ /**
+ * @see Zend_Session_SaveHandler_Exception
+ */
+
+ throw new Zend_Session_SaveHandler_Exception('session.save_path is a path and not a table name.');
+ }
+
+ if (strpos($this->_name, '.')) {
+ list($this->_schema, $this->_name) = explode('.', $this->_name);
+ }
+ }
+
+ /**
+ * Initialize session table primary key value assignment
+ *
+ * @return void
+ * @throws Zend_Session_SaveHandler_Exception
+ */
+ protected function _setupPrimaryAssignment()
+ {
+ if ($this->_primaryAssignment === null) {
+ $this->_primaryAssignment = array(1 => self::PRIMARY_ASSIGNMENT_SESSION_ID);
+ } else if (!is_array($this->_primaryAssignment)) {
+ $this->_primaryAssignment = array(1 => (string) $this->_primaryAssignment);
+ } else if (isset($this->_primaryAssignment[0])) {
+ array_unshift($this->_primaryAssignment, null);
+
+ unset($this->_primaryAssignment[0]);
+ }
+
+ if (count($this->_primaryAssignment) !== count($this->_primary)) {
+ /**
+ * @see Zend_Session_SaveHandler_Exception
+ */
+
+ throw new Zend_Session_SaveHandler_Exception(
+ "Value for configuration option '" . self::PRIMARY_ASSIGNMENT . "' must have an assignment "
+ . "for each session table primary key.");
+ } else if (!in_array(self::PRIMARY_ASSIGNMENT_SESSION_ID, $this->_primaryAssignment)) {
+ /**
+ * @see Zend_Session_SaveHandler_Exception
+ */
+
+ throw new Zend_Session_SaveHandler_Exception(
+ "Value for configuration option '" . self::PRIMARY_ASSIGNMENT . "' must have an assignment "
+ . "for the session id ('" . self::PRIMARY_ASSIGNMENT_SESSION_ID . "').");
+ }
+ }
+
+ /**
+ * Check for required session table columns
+ *
+ * @return void
+ * @throws Zend_Session_SaveHandler_Exception
+ */
+ protected function _checkRequiredColumns()
+ {
+ if ($this->_modifiedColumn === null) {
+ /**
+ * @see Zend_Session_SaveHandler_Exception
+ */
+
+ throw new Zend_Session_SaveHandler_Exception(
+ "Configuration must define '" . self::MODIFIED_COLUMN . "' which names the "
+ . "session table last modification time column.");
+ } else if ($this->_lifetimeColumn === null) {
+ /**
+ * @see Zend_Session_SaveHandler_Exception
+ */
+
+ throw new Zend_Session_SaveHandler_Exception(
+ "Configuration must define '" . self::LIFETIME_COLUMN . "' which names the "
+ . "session table lifetime column.");
+ } else if ($this->_dataColumn === null) {
+ /**
+ * @see Zend_Session_SaveHandler_Exception
+ */
+
+ throw new Zend_Session_SaveHandler_Exception(
+ "Configuration must define '" . self::DATA_COLUMN . "' which names the "
+ . "session table data column.");
+ }
+ }
+
+ /**
+ * Retrieve session table primary key values
+ *
+ * @param string $id
+ * @param string $type (optional; default: self::PRIMARY_TYPE_NUM)
+ * @return array
+ */
+ protected function _getPrimary($id, $type = null)
+ {
+ $this->_setupPrimaryKey();
+
+ if ($type === null) {
+ $type = self::PRIMARY_TYPE_NUM;
+ }
+
+ $primaryArray = array();
+
+ foreach ($this->_primary as $index => $primary) {
+ switch ($this->_primaryAssignment[$index]) {
+ case self::PRIMARY_ASSIGNMENT_SESSION_SAVE_PATH:
+ $value = $this->_sessionSavePath;
+ break;
+ case self::PRIMARY_ASSIGNMENT_SESSION_NAME:
+ $value = $this->_sessionName;
+ break;
+ case self::PRIMARY_ASSIGNMENT_SESSION_ID:
+ $value = (string) $id;
+ break;
+ default:
+ $value = (string) $this->_primaryAssignment[$index];
+ break;
+ }
+
+ switch ((string) $type) {
+ case self::PRIMARY_TYPE_PRIMARYNUM:
+ $primaryArray[$index] = $value;
+ break;
+ case self::PRIMARY_TYPE_ASSOC:
+ $primaryArray[$primary] = $value;
+ break;
+ case self::PRIMARY_TYPE_WHERECLAUSE:
+ $primaryArray[] = $this->getAdapter()->quoteIdentifier($primary, true) . ' = '
+ . $this->getAdapter()->quote($value);
+ break;
+ case self::PRIMARY_TYPE_NUM:
+ default:
+ $primaryArray[] = $value;
+ break;
+ }
+ }
+
+ return $primaryArray;
+ }
+
+ /**
+ * Retrieve session lifetime considering Zend_Session_SaveHandler_DbTable::OVERRIDE_LIFETIME
+ *
+ * @param Zend_Db_Table_Row_Abstract $row
+ * @return int
+ */
+ protected function _getLifetime(Zend_Db_Table_Row_Abstract $row)
+ {
+ $return = $this->_lifetime;
+
+ if (!$this->_overrideLifetime) {
+ $return = (int) $row->{$this->_lifetimeColumn};
+ }
+
+ return $return;
+ }
+
+ /**
+ * Retrieve session expiration time
+ *
+ * @param Zend_Db_Table_Row_Abstract $row
+ * @return int
+ */
+ protected function _getExpirationTime(Zend_Db_Table_Row_Abstract $row)
+ {
+ return (int) $row->{$this->_modifiedColumn} + $this->_getLifetime($row);
+ }
+}
diff --git a/library/vendor/Zend/Session/SaveHandler/Exception.php b/library/vendor/Zend/Session/SaveHandler/Exception.php
new file mode 100644
index 0000000..2b1876f
--- /dev/null
+++ b/library/vendor/Zend/Session/SaveHandler/Exception.php
@@ -0,0 +1,36 @@
+<?php
+
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Session_Exception
+ */
+
+/**
+ * Zend_Session_SaveHandler_Exception
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Session_SaveHandler_Exception extends Zend_Session_Exception
+{}
diff --git a/library/vendor/Zend/Session/SaveHandler/Interface.php b/library/vendor/Zend/Session/SaveHandler/Interface.php
new file mode 100644
index 0000000..18ed5fe
--- /dev/null
+++ b/library/vendor/Zend/Session/SaveHandler/Interface.php
@@ -0,0 +1,81 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ * @since Preview Release 0.2
+ */
+
+/**
+ * Zend_Session_SaveHandler_Interface
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @subpackage SaveHandler
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @see http://php.net/session_set_save_handler
+ */
+interface Zend_Session_SaveHandler_Interface
+{
+
+ /**
+ * Open Session - retrieve resources
+ *
+ * @param string $save_path
+ * @param string $name
+ */
+ public function open($save_path, $name);
+
+ /**
+ * Close Session - free resources
+ *
+ */
+ public function close();
+
+ /**
+ * Read session data
+ *
+ * @param string $id
+ */
+ public function read($id);
+
+ /**
+ * Write Session - commit data to resource
+ *
+ * @param string $id
+ * @param mixed $data
+ */
+ public function write($id, $data);
+
+ /**
+ * Destroy Session - remove data from resource for
+ * given session id
+ *
+ * @param string $id
+ */
+ public function destroy($id);
+
+ /**
+ * Garbage Collection - remove old session data older
+ * than $maxlifetime (in seconds)
+ *
+ * @param int $maxlifetime
+ */
+ public function gc($maxlifetime);
+
+}
diff --git a/library/vendor/Zend/Session/Validator/Abstract.php b/library/vendor/Zend/Session/Validator/Abstract.php
new file mode 100644
index 0000000..f39d20e
--- /dev/null
+++ b/library/vendor/Zend/Session/Validator/Abstract.php
@@ -0,0 +1,70 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ * @since Preview Release 0.2
+ */
+
+/**
+ * @see Zend_Session_Validator_Interface
+ */
+
+/**
+ * Zend_Session_Validator_Abstract
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @subpackage Validator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Session_Validator_Abstract implements Zend_Session_Validator_Interface
+{
+
+ /**
+ * SetValidData() - This method should be used to store the environment variables that
+ * will be needed in order to validate the session later in the validate() method.
+ * These values are stored in the session in the __ZF namespace, in an array named VALID
+ *
+ * @param mixed $data
+ * @return void
+ */
+ protected function setValidData($data)
+ {
+ $validatorName = get_class($this);
+
+ $_SESSION['__ZF']['VALID'][$validatorName] = $data;
+ }
+
+
+ /**
+ * GetValidData() - This method should be used to retrieve the environment variables that
+ * will be needed to 'validate' a session.
+ *
+ * @return mixed
+ */
+ protected function getValidData()
+ {
+ $validatorName = get_class($this);
+ if (isset($_SESSION['__ZF']['VALID'][$validatorName])) {
+ return $_SESSION['__ZF']['VALID'][$validatorName];
+ }
+ return null;
+ }
+
+}
diff --git a/library/vendor/Zend/Session/Validator/Exception.php b/library/vendor/Zend/Session/Validator/Exception.php
new file mode 100644
index 0000000..03c2a03
--- /dev/null
+++ b/library/vendor/Zend/Session/Validator/Exception.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ * @since Preview Release 0.2
+ */
+
+
+/**
+ * @see Zend_Session_Exception
+ */
+
+
+/**
+ * Zend_Session_Validator_Exception
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @subpackage Validator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Session_Validator_Exception extends Zend_Session_Exception
+{
+
+}
+
diff --git a/library/vendor/Zend/Session/Validator/HttpUserAgent.php b/library/vendor/Zend/Session/Validator/HttpUserAgent.php
new file mode 100644
index 0000000..8431aa2
--- /dev/null
+++ b/library/vendor/Zend/Session/Validator/HttpUserAgent.php
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ * @since Preview Release 0.2
+ */
+
+/**
+ * @see Zend_Session_Validator_Abstract
+ */
+
+/**
+ * Zend_Session_Validator_HttpUserAgent
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @subpackage Validator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Session_Validator_HttpUserAgent extends Zend_Session_Validator_Abstract
+{
+
+ /**
+ * Setup() - this method will get the current user agent and store it in the session
+ * as 'valid data'
+ *
+ * @return void
+ */
+ public function setup()
+ {
+ $this->setValidData( (isset($_SERVER['HTTP_USER_AGENT'])
+ ? $_SERVER['HTTP_USER_AGENT'] : null) );
+ }
+
+ /**
+ * Validate() - this method will determine if the current user agent matches the
+ * user agent we stored when we initialized this variable.
+ *
+ * @return bool
+ */
+ public function validate()
+ {
+ $currentBrowser = (isset($_SERVER['HTTP_USER_AGENT'])
+ ? $_SERVER['HTTP_USER_AGENT'] : null);
+
+ return $currentBrowser === $this->getValidData();
+ }
+
+}
diff --git a/library/vendor/Zend/Session/Validator/Interface.php b/library/vendor/Zend/Session/Validator/Interface.php
new file mode 100644
index 0000000..ab4eb3e
--- /dev/null
+++ b/library/vendor/Zend/Session/Validator/Interface.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ * @since Preview Release 0.2
+ */
+
+/**
+ * Zend_Session_Validator_Interface
+ *
+ * @category Zend
+ * @package Zend_Session
+ * @subpackage Validator
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Session_Validator_Interface
+{
+
+ /**
+ * Setup() - this method will store the environment variables
+ * necessary to be able to validate against in future requests.
+ *
+ * @return void
+ */
+ public function setup();
+
+ /**
+ * Validate() - this method will be called at the beginning of
+ * every session to determine if the current environment matches
+ * that which was store in the setup() procedure.
+ *
+ * @return boolean
+ */
+ public function validate();
+
+}
diff --git a/library/vendor/Zend/Soap/AutoDiscover.php b/library/vendor/Zend/Soap/AutoDiscover.php
new file mode 100644
index 0000000..794d2a1
--- /dev/null
+++ b/library/vendor/Zend/Soap/AutoDiscover.php
@@ -0,0 +1,597 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage AutoDiscover
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Server_Interface
+ */
+/**
+ * @see Zend_Soap_Wsdl
+ */
+/**
+ * @see Zend_Server_Reflection
+ */
+/**
+ * @see Zend_Server_Abstract
+ */
+/**
+ * @see Zend_Uri
+ */
+
+/**
+ * Zend_Soap_AutoDiscover
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage AutoDiscover
+ */
+class Zend_Soap_AutoDiscover implements Zend_Server_Interface
+{
+ /**
+ * @var Zend_Soap_Wsdl
+ */
+ protected $_wsdl = null;
+
+ /**
+ * @var Zend_Server_Reflection
+ */
+ protected $_reflection = null;
+
+ /**
+ * @var array
+ */
+ protected $_functions = array();
+
+ /**
+ * @var boolean
+ */
+ protected $_strategy;
+
+ /**
+ * Url where the WSDL file will be available at.
+ *
+ * @var WSDL Uri
+ */
+ protected $_uri;
+
+ /**
+ * soap:body operation style options
+ *
+ * @var array
+ */
+ protected $_operationBodyStyle = array('use' => 'encoded', 'encodingStyle' => "http://schemas.xmlsoap.org/soap/encoding/");
+
+ /**
+ * soap:operation style
+ *
+ * @var array
+ */
+ protected $_bindingStyle = array('style' => 'rpc', 'transport' => 'http://schemas.xmlsoap.org/soap/http');
+
+ /**
+ * Name of the class to handle the WSDL creation.
+ *
+ * @var string
+ */
+ protected $_wsdlClass = 'Zend_Soap_Wsdl';
+
+ /**
+ * Constructor
+ *
+ * @param boolean|string|Zend_Soap_Wsdl_Strategy_Interface $strategy
+ * @param string|Zend_Uri $uri
+ * @param string $wsdlClass
+ */
+ public function __construct($strategy = true, $uri=null, $wsdlClass=null)
+ {
+ $this->_reflection = new Zend_Server_Reflection();
+ $this->setComplexTypeStrategy($strategy);
+
+ if($uri !== null) {
+ $this->setUri($uri);
+ }
+
+ if($wsdlClass !== null) {
+ $this->setWsdlClass($wsdlClass);
+ }
+ }
+
+ /**
+ * Set the location at which the WSDL file will be availabe.
+ *
+ * @see Zend_Soap_Exception
+ * @param Zend_Uri|string $uri
+ * @return Zend_Soap_AutoDiscover
+ * @throws Zend_Soap_AutoDiscover_Exception
+ */
+ public function setUri($uri)
+ {
+ if (!is_string($uri) && !($uri instanceof Zend_Uri)) {
+ throw new Zend_Soap_AutoDiscover_Exception("No uri given to Zend_Soap_AutoDiscover::setUri as string or Zend_Uri instance.");
+ }
+ $this->_uri = $uri;
+
+ // change uri in WSDL file also if existant
+ if ($this->_wsdl instanceof Zend_Soap_Wsdl) {
+ $this->_wsdl->setUri($uri);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Return the current Uri that the SOAP WSDL Service will be located at.
+ *
+ * @return Zend_Uri
+ */
+ public function getUri()
+ {
+ if($this->_uri !== null) {
+ $uri = $this->_uri;
+ } else {
+ $schema = $this->getSchema();
+ $host = $this->getHostName();
+ $scriptName = $this->getRequestUriWithoutParameters();
+ $uri = Zend_Uri::factory($schema . '://' . $host . $scriptName);
+ $this->setUri($uri);
+ }
+ return $uri;
+ }
+
+ /**
+ * Set the name of the WSDL handling class.
+ *
+ * @see Zend_Soap_Exception
+ * @see Zend_Soap_Exception
+ * @param string $wsdlClass
+ * @return Zend_Soap_AutoDiscover
+ * @throws Zend_Soap_AutoDiscover_Exception
+ */
+ public function setWsdlClass($wsdlClass)
+ {
+ if (!is_string($wsdlClass) && !is_subclass_of($wsdlClass, 'Zend_Soap_Wsdl')) {
+ throw new Zend_Soap_AutoDiscover_Exception("No Zend_Soap_Wsdl subclass given to Zend_Soap_AutoDiscover::setWsdlClass as string.");
+ }
+ $this->_wsdlClass = $wsdlClass;
+
+ return $this;
+ }
+
+ /**
+ * Return the name of the WSDL handling class.
+ *
+ * @return string
+ */
+ public function getWsdlClass()
+ {
+ return $this->_wsdlClass;
+ }
+
+ /**
+ * Set options for all the binding operations soap:body elements.
+ *
+ * By default the options are set to 'use' => 'encoded' and
+ * 'encodingStyle' => "http://schemas.xmlsoap.org/soap/encoding/".
+ *
+ * @see Zend_Soap_AutoDiscover_Exception
+ * @param array $operationStyle
+ * @return Zend_Soap_AutoDiscover
+ * @throws Zend_Soap_AutoDiscover_Exception
+ */
+ public function setOperationBodyStyle(array $operationStyle=array())
+ {
+ if(!isset($operationStyle['use'])) {
+ throw new Zend_Soap_AutoDiscover_Exception("Key 'use' is required in Operation soap:body style.");
+ }
+ $this->_operationBodyStyle = $operationStyle;
+ return $this;
+ }
+
+ /**
+ * Set Binding soap:binding style.
+ *
+ * By default 'style' is 'rpc' and 'transport' is 'http://schemas.xmlsoap.org/soap/http'.
+ *
+ * @param array $bindingStyle
+ * @return Zend_Soap_AutoDiscover
+ */
+ public function setBindingStyle(array $bindingStyle=array())
+ {
+ if(isset($bindingStyle['style'])) {
+ $this->_bindingStyle['style'] = $bindingStyle['style'];
+ }
+ if(isset($bindingStyle['transport'])) {
+ $this->_bindingStyle['transport'] = $bindingStyle['transport'];
+ }
+ return $this;
+ }
+
+ /**
+ * Detect and returns the current HTTP/HTTPS Schema
+ *
+ * @return string
+ */
+ protected function getSchema()
+ {
+ $schema = "http";
+ if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
+ $schema = 'https';
+ }
+ return $schema;
+ }
+
+ /**
+ * Detect and return the current hostname
+ *
+ * @return string
+ */
+ protected function getHostName()
+ {
+ if(isset($_SERVER['HTTP_HOST'])) {
+ $host = $_SERVER['HTTP_HOST'];
+ } else {
+ $host = $_SERVER['SERVER_NAME'];
+ }
+ return $host;
+ }
+
+ /**
+ * Detect and return the current script name without parameters
+ *
+ * @return string
+ */
+ protected function getRequestUriWithoutParameters()
+ {
+ if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) { // IIS with Microsoft Rewrite Module
+ $requestUri = $_SERVER['HTTP_X_ORIGINAL_URL'];
+ } elseif (isset($_SERVER['HTTP_X_REWRITE_URL'])) { // check this first so IIS will catch
+ $requestUri = $_SERVER['HTTP_X_REWRITE_URL'];
+ } elseif (isset($_SERVER['REQUEST_URI'])) {
+ $requestUri = $_SERVER['REQUEST_URI'];
+ } elseif (isset($_SERVER['ORIG_PATH_INFO'])) { // IIS 5.0, PHP as CGI
+ $requestUri = $_SERVER['ORIG_PATH_INFO'];
+ } else {
+ $requestUri = $_SERVER['SCRIPT_NAME'];
+ }
+ if( ($pos = strpos($requestUri, "?")) !== false) {
+ $requestUri = substr($requestUri, 0, $pos);
+ }
+
+ return $requestUri;
+ }
+
+ /**
+ * Set the strategy that handles functions and classes that are added AFTER this call.
+ *
+ * @param boolean|string|Zend_Soap_Wsdl_Strategy_Interface $strategy
+ * @return Zend_Soap_AutoDiscover
+ */
+ public function setComplexTypeStrategy($strategy)
+ {
+ $this->_strategy = $strategy;
+ if($this->_wsdl instanceof Zend_Soap_Wsdl) {
+ $this->_wsdl->setComplexTypeStrategy($strategy);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set the Class the SOAP server will use
+ *
+ * @param string $class Class Name
+ * @param string $namespace Class Namspace - Not Used
+ * @param array $argv Arguments to instantiate the class - Not Used
+ * @return Zend_Soap_AutoDiscover
+ */
+ public function setClass($class, $namespace = '', $argv = null)
+ {
+ $uri = $this->getUri();
+
+ $wsdl = new $this->_wsdlClass($class, $uri, $this->_strategy);
+
+ // The wsdl:types element must precede all other elements (WS-I Basic Profile 1.1 R2023)
+ $wsdl->addSchemaTypeSection();
+
+ $port = $wsdl->addPortType($class . 'Port');
+ $binding = $wsdl->addBinding($class . 'Binding', 'tns:' .$class. 'Port');
+
+ $wsdl->addSoapBinding($binding, $this->_bindingStyle['style'], $this->_bindingStyle['transport']);
+ $wsdl->addService($class . 'Service', $class . 'Port', 'tns:' . $class . 'Binding', $uri);
+ foreach ($this->_reflection->reflectClass($class)->getMethods() as $method) {
+ $this->_addFunctionToWsdl($method, $wsdl, $port, $binding);
+ }
+ $this->_wsdl = $wsdl;
+
+ return $this;
+ }
+
+ /**
+ * Add a Single or Multiple Functions to the WSDL
+ *
+ * @param string $function Function Name
+ * @param string $namespace Function namespace - Not Used
+ * @return Zend_Soap_AutoDiscover
+ */
+ public function addFunction($function, $namespace = '')
+ {
+ static $port;
+ static $operation;
+ static $binding;
+
+ if (!is_array($function)) {
+ $function = (array) $function;
+ }
+
+ $uri = $this->getUri();
+
+ if (!($this->_wsdl instanceof Zend_Soap_Wsdl)) {
+ $parts = explode('.', basename($_SERVER['SCRIPT_NAME']));
+ $name = $parts[0];
+ $wsdl = new Zend_Soap_Wsdl($name, $uri, $this->_strategy);
+
+ // The wsdl:types element must precede all other elements (WS-I Basic Profile 1.1 R2023)
+ $wsdl->addSchemaTypeSection();
+
+ $port = $wsdl->addPortType($name . 'Port');
+ $binding = $wsdl->addBinding($name . 'Binding', 'tns:' .$name. 'Port');
+
+ $wsdl->addSoapBinding($binding, $this->_bindingStyle['style'], $this->_bindingStyle['transport']);
+ $wsdl->addService($name . 'Service', $name . 'Port', 'tns:' . $name . 'Binding', $uri);
+ } else {
+ $wsdl = $this->_wsdl;
+ }
+
+ foreach ($function as $func) {
+ $method = $this->_reflection->reflectFunction($func);
+ $this->_addFunctionToWsdl($method, $wsdl, $port, $binding);
+ }
+ $this->_wsdl = $wsdl;
+
+ return $this;
+ }
+
+ /**
+ * Add a function to the WSDL document.
+ *
+ * @param Zend_Server_Reflection_Function_Abstract $function function to add
+ * @param Zend_Soap_Wsdl $wsdl WSDL document
+ * @param object $port wsdl:portType
+ * @param object $binding wsdl:binding
+ * @return void
+ */
+ protected function _addFunctionToWsdl($function, $wsdl, $port, $binding)
+ {
+ $uri = $this->getUri();
+
+ // We only support one prototype: the one with the maximum number of arguments
+ $prototype = null;
+ $maxNumArgumentsOfPrototype = -1;
+ foreach ($function->getPrototypes() as $tmpPrototype) {
+ $numParams = count($tmpPrototype->getParameters());
+ if ($numParams > $maxNumArgumentsOfPrototype) {
+ $maxNumArgumentsOfPrototype = $numParams;
+ $prototype = $tmpPrototype;
+ }
+ }
+ if ($prototype === null) {
+ throw new Zend_Soap_AutoDiscover_Exception("No prototypes could be found for the '" . $function->getName() . "' function");
+ }
+
+ // Add the input message (parameters)
+ $args = array();
+ if ($this->_bindingStyle['style'] == 'document') {
+ // Document style: wrap all parameters in a sequence element
+ $sequence = array();
+ foreach ($prototype->getParameters() as $param) {
+ $sequenceElement = array(
+ 'name' => $param->getName(),
+ 'type' => $wsdl->getType($param->getType())
+ );
+ if ($param->isOptional()) {
+ $sequenceElement['nillable'] = 'true';
+ }
+ $sequence[] = $sequenceElement;
+ }
+ $element = array(
+ 'name' => $function->getName(),
+ 'sequence' => $sequence
+ );
+ // Add the wrapper element part, which must be named 'parameters'
+ $args['parameters'] = array('element' => $wsdl->addElement($element));
+ } else {
+ // RPC style: add each parameter as a typed part
+ foreach ($prototype->getParameters() as $param) {
+ $args[$param->getName()] = array('type' => $wsdl->getType($param->getType()));
+ }
+ }
+ $wsdl->addMessage($function->getName() . 'In', $args);
+
+ $isOneWayMessage = false;
+ if($prototype->getReturnType() == "void") {
+ $isOneWayMessage = true;
+ }
+
+ if($isOneWayMessage == false) {
+ // Add the output message (return value)
+ $args = array();
+ if ($this->_bindingStyle['style'] == 'document') {
+ // Document style: wrap the return value in a sequence element
+ $sequence = array();
+ if ($prototype->getReturnType() != "void") {
+ $sequence[] = array(
+ 'name' => $function->getName() . 'Result',
+ 'type' => $wsdl->getType($prototype->getReturnType())
+ );
+ }
+ $element = array(
+ 'name' => $function->getName() . 'Response',
+ 'sequence' => $sequence
+ );
+ // Add the wrapper element part, which must be named 'parameters'
+ $args['parameters'] = array('element' => $wsdl->addElement($element));
+ } else if ($prototype->getReturnType() != "void") {
+ // RPC style: add the return value as a typed part
+ $args['return'] = array('type' => $wsdl->getType($prototype->getReturnType()));
+ }
+ $wsdl->addMessage($function->getName() . 'Out', $args);
+ }
+
+ // Add the portType operation
+ if($isOneWayMessage == false) {
+ $portOperation = $wsdl->addPortOperation($port, $function->getName(), 'tns:' . $function->getName() . 'In', 'tns:' . $function->getName() . 'Out');
+ } else {
+ $portOperation = $wsdl->addPortOperation($port, $function->getName(), 'tns:' . $function->getName() . 'In', false);
+ }
+ $desc = $function->getDescription();
+ if (strlen($desc) > 0) {
+ $wsdl->addDocumentation($portOperation, $desc);
+ }
+
+ // When using the RPC style, make sure the operation style includes a 'namespace' attribute (WS-I Basic Profile 1.1 R2717)
+ if ($this->_bindingStyle['style'] == 'rpc' && !isset($this->_operationBodyStyle['namespace'])) {
+ $this->_operationBodyStyle['namespace'] = ''.$uri;
+ }
+
+ // Add the binding operation
+ if($isOneWayMessage == false) {
+ $operation = $wsdl->addBindingOperation($binding, $function->getName(), $this->_operationBodyStyle, $this->_operationBodyStyle);
+ } else {
+ $operation = $wsdl->addBindingOperation($binding, $function->getName(), $this->_operationBodyStyle);
+ }
+ $wsdl->addSoapOperation($operation, $uri . '#' .$function->getName());
+
+ // Add the function name to the list
+ $this->_functions[] = $function->getName();
+ }
+
+ /**
+ * Action to take when an error occurs
+ *
+ * @param string $fault
+ * @param string|int $code
+ * @throws Zend_Soap_AutoDiscover_Exception
+ */
+ public function fault($fault = null, $code = null)
+ {
+ throw new Zend_Soap_AutoDiscover_Exception("Function has no use in AutoDiscover.");
+ }
+
+ /**
+ * Handle the Request
+ *
+ * @param string $request A non-standard request - Not Used
+ */
+ public function handle($request = false)
+ {
+ if (!headers_sent()) {
+ header('Content-Type: text/xml');
+ }
+ $this->_wsdl->dump();
+ }
+
+ /**
+ * Proxy to WSDL dump function
+ *
+ * @param string $filename
+ * @return boolean
+ * @throws Zend_Soap_AutoDiscover_Exception
+ */
+ public function dump($filename)
+ {
+ if($this->_wsdl !== null) {
+ return $this->_wsdl->dump($filename);
+ } else {
+ /**
+ * @see Zend_Soap_AutoDiscover_Exception
+ */
+ throw new Zend_Soap_AutoDiscover_Exception("Cannot dump autodiscovered contents, WSDL file has not been generated yet.");
+ }
+ }
+
+ /**
+ * Proxy to WSDL toXml() function
+ *
+ * @return string
+ * @throws Zend_Soap_AutoDiscover_Exception
+ */
+ public function toXml()
+ {
+ if($this->_wsdl !== null) {
+ return $this->_wsdl->toXml();
+ } else {
+ /**
+ * @see Zend_Soap_AutoDiscover_Exception
+ */
+ throw new Zend_Soap_AutoDiscover_Exception("Cannot return autodiscovered contents, WSDL file has not been generated yet.");
+ }
+ }
+
+ /**
+ * Return an array of functions in the WSDL
+ *
+ * @return array
+ */
+ public function getFunctions()
+ {
+ return $this->_functions;
+ }
+
+ /**
+ * Load Functions
+ *
+ * @param unknown_type $definition
+ * @throws Zend_Soap_AutoDiscover_Exception
+ */
+ public function loadFunctions($definition)
+ {
+ throw new Zend_Soap_AutoDiscover_Exception("Function has no use in AutoDiscover.");
+ }
+
+ /**
+ * Set Persistance
+ *
+ * @param int $mode
+ * @throws Zend_Soap_AutoDiscover_Exception
+ */
+ public function setPersistence($mode)
+ {
+ throw new Zend_Soap_AutoDiscover_Exception("Function has no use in AutoDiscover.");
+ }
+
+ /**
+ * Returns an XSD Type for the given PHP type
+ *
+ * @param string $type PHP Type to get the XSD type for
+ * @return string
+ */
+ public function getType($type)
+ {
+ if (!($this->_wsdl instanceof Zend_Soap_Wsdl)) {
+ /** @todo Exception throwing may be more correct */
+
+ // WSDL is not defined yet, so we can't recognize type in context of current service
+ return '';
+ } else {
+ return $this->_wsdl->getType($type);
+ }
+ }
+}
diff --git a/library/vendor/Zend/Soap/AutoDiscover/Exception.php b/library/vendor/Zend/Soap/AutoDiscover/Exception.php
new file mode 100644
index 0000000..6b6491e
--- /dev/null
+++ b/library/vendor/Zend/Soap/AutoDiscover/Exception.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage AutoDiscover
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Exception
+ */
+
+/**
+ * @package Zend_Soap
+ * @subpackage AutoDiscover
+ */
+class Zend_Soap_AutoDiscover_Exception extends Zend_Exception
+{
+}
diff --git a/library/vendor/Zend/Soap/Client.php b/library/vendor/Zend/Soap/Client.php
new file mode 100644
index 0000000..e58223f
--- /dev/null
+++ b/library/vendor/Zend/Soap/Client.php
@@ -0,0 +1,1223 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Client
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Soap_Server
+ */
+
+/**
+ * @see Zend_Soap_Client_Local
+ */
+
+/**
+ * @see Zend_Soap_Client_Common
+ */
+
+/**
+ * Zend_Soap_Client
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Client
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Soap_Client
+{
+ /**
+ * Encoding
+ * @var string
+ */
+ protected $_encoding = 'UTF-8';
+
+ /**
+ * Array of SOAP type => PHP class pairings for handling return/incoming values
+ * @var array
+ */
+ protected $_classmap = null;
+
+ /**
+ * Registered fault exceptions
+ * @var array
+ */
+ protected $_faultExceptions = array();
+
+ /**
+ * SOAP version to use; SOAP_1_2 by default, to allow processing of headers
+ * @var int
+ */
+ protected $_soapVersion = SOAP_1_2;
+
+ /** Set of other SoapClient options */
+ protected $_uri = null;
+ protected $_location = null;
+ protected $_style = null;
+ protected $_use = null;
+ protected $_login = null;
+ protected $_password = null;
+ protected $_proxy_host = null;
+ protected $_proxy_port = null;
+ protected $_proxy_login = null;
+ protected $_proxy_password = null;
+ protected $_local_cert = null;
+ protected $_passphrase = null;
+ protected $_compression = null;
+ protected $_connection_timeout = null;
+ protected $_stream_context = null;
+ protected $_features = null;
+ protected $_cache_wsdl = null;
+ protected $_user_agent = null;
+ protected $_exceptions = null;
+
+ /**
+ * WSDL used to access server
+ * It also defines Zend_Soap_Client working mode (WSDL vs non-WSDL)
+ *
+ * @var string
+ */
+ protected $_wsdl = null;
+
+ /**
+ * SoapClient object
+ *
+ * @var SoapClient
+ */
+ protected $_soapClient;
+
+ /**
+ * Last invoked method
+ *
+ * @var string
+ */
+ protected $_lastMethod = '';
+
+ /**
+ * SOAP request headers.
+ *
+ * Array of SoapHeader objects
+ *
+ * @var array
+ */
+ protected $_soapInputHeaders = array();
+
+ /**
+ * Permanent SOAP request headers (shared between requests).
+ *
+ * Array of SoapHeader objects
+ *
+ * @var array
+ */
+ protected $_permanentSoapInputHeaders = array();
+
+ /**
+ * Output SOAP headers.
+ *
+ * Array of SoapHeader objects
+ *
+ * @var array
+ */
+ protected $_soapOutputHeaders = array();
+
+ /**
+ * Constructor
+ *
+ * @param string $wsdl
+ * @param array $options
+ */
+ public function __construct($wsdl = null, $options = null)
+ {
+ if (!extension_loaded('soap')) {
+ throw new Zend_Soap_Client_Exception('SOAP extension is not loaded.');
+ }
+
+ if ($wsdl !== null) {
+ $this->setWsdl($wsdl);
+ }
+ if ($options !== null) {
+ $this->setOptions($options);
+ }
+ }
+
+ /**
+ * Set wsdl
+ *
+ * @param string $wsdl
+ * @return Zend_Soap_Client
+ */
+ public function setWsdl($wsdl)
+ {
+ $this->_wsdl = $wsdl;
+ $this->_soapClient = null;
+
+ return $this;
+ }
+
+ /**
+ * Get wsdl
+ *
+ * @return string
+ */
+ public function getWsdl()
+ {
+ return $this->_wsdl;
+ }
+
+ /**
+ * Set Options
+ *
+ * Allows setting options as an associative array of option => value pairs.
+ *
+ * @param array|Zend_Config $options
+ * @return Zend_Soap_Client
+ * @throws Zend_SoapClient_Exception
+ */
+ public function setOptions($options)
+ {
+ if($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ }
+
+ foreach ($options as $key => $value) {
+ switch ($key) {
+ case 'classmap':
+ case 'classMap':
+ $this->setClassmap($value);
+ break;
+ case 'encoding':
+ $this->setEncoding($value);
+ break;
+ case 'soapVersion':
+ case 'soap_version':
+ $this->setSoapVersion($value);
+ break;
+ case 'wsdl':
+ $this->setWsdl($value);
+ break;
+ case 'uri':
+ $this->setUri($value);
+ break;
+ case 'location':
+ $this->setLocation($value);
+ break;
+ case 'style':
+ $this->setStyle($value);
+ break;
+ case 'use':
+ $this->setEncodingMethod($value);
+ break;
+ case 'login':
+ $this->setHttpLogin($value);
+ break;
+ case 'password':
+ $this->setHttpPassword($value);
+ break;
+ case 'proxy_host':
+ $this->setProxyHost($value);
+ break;
+ case 'proxy_port':
+ $this->setProxyPort($value);
+ break;
+ case 'proxy_login':
+ $this->setProxyLogin($value);
+ break;
+ case 'proxy_password':
+ $this->setProxyPassword($value);
+ break;
+ case 'local_cert':
+ $this->setHttpsCertificate($value);
+ break;
+ case 'passphrase':
+ $this->setHttpsCertPassphrase($value);
+ break;
+ case 'compression':
+ $this->setCompressionOptions($value);
+ break;
+ case 'stream_context':
+ $this->setStreamContext($value);
+ break;
+ case 'features':
+ $this->setSoapFeatures($value);
+ break;
+ case 'cache_wsdl':
+ $this->setWsdlCache($value);
+ break;
+ case 'useragent':
+ case 'userAgent':
+ case 'user_agent':
+ $this->setUserAgent($value);
+ break;
+ case 'exceptions':
+ $this->setExceptions($value);
+ break;
+
+ // Not used now
+ // case 'connection_timeout':
+ // $this->_connection_timeout = $value;
+ // break;
+
+ default:
+ throw new Zend_Soap_Client_Exception('Unknown SOAP client option');
+ break;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Return array of options suitable for using with SoapClient constructor
+ *
+ * @return array
+ */
+ public function getOptions()
+ {
+ $options = array();
+
+ $options['classmap'] = $this->getClassmap();
+ $options['encoding'] = $this->getEncoding();
+ $options['soap_version'] = $this->getSoapVersion();
+ $options['wsdl'] = $this->getWsdl();
+ $options['uri'] = $this->getUri();
+ $options['location'] = $this->getLocation();
+ $options['style'] = $this->getStyle();
+ $options['use'] = $this->getEncodingMethod();
+ $options['login'] = $this->getHttpLogin();
+ $options['password'] = $this->getHttpPassword();
+ $options['proxy_host'] = $this->getProxyHost();
+ $options['proxy_port'] = $this->getProxyPort();
+ $options['proxy_login'] = $this->getProxyLogin();
+ $options['proxy_password'] = $this->getProxyPassword();
+ $options['local_cert'] = $this->getHttpsCertificate();
+ $options['passphrase'] = $this->getHttpsCertPassphrase();
+ $options['compression'] = $this->getCompressionOptions();
+ //$options['connection_timeout'] = $this->_connection_timeout;
+ $options['stream_context'] = $this->getStreamContext();
+ $options['cache_wsdl'] = $this->getWsdlCache();
+ $options['features'] = $this->getSoapFeatures();
+ $options['user_agent'] = $this->getUserAgent();
+ $options['exceptions'] = $this->getExceptions();
+
+ foreach ($options as $key => $value) {
+ /*
+ * ugly hack as I don't know if checking for '=== null'
+ * breaks some other option
+ */
+ if (in_array($key, array('user_agent', 'cache_wsdl', 'compression', 'exceptions'))) {
+ if ($value === null) {
+ unset($options[$key]);
+ }
+ } else {
+ if ($value == null) {
+ unset($options[$key]);
+ }
+ }
+ }
+
+ return $options;
+ }
+
+ /**
+ * Set SOAP version
+ *
+ * @param int $version One of the SOAP_1_1 or SOAP_1_2 constants
+ * @return Zend_Soap_Client
+ * @throws Zend_Soap_Client_Exception with invalid soap version argument
+ */
+ public function setSoapVersion($version)
+ {
+ if (!in_array($version, array(SOAP_1_1, SOAP_1_2))) {
+ throw new Zend_Soap_Client_Exception('Invalid soap version specified. Use SOAP_1_1 or SOAP_1_2 constants.');
+ }
+ $this->_soapVersion = $version;
+
+ $this->_soapClient = null;
+
+ return $this;
+ }
+
+ /**
+ * Get SOAP version
+ *
+ * @return int
+ */
+ public function getSoapVersion()
+ {
+ return $this->_soapVersion;
+ }
+
+ /**
+ * Set classmap
+ *
+ * @param array $classmap
+ * @return Zend_Soap_Client
+ * @throws Zend_Soap_Client_Exception for any invalid class in the class map
+ */
+ public function setClassmap(array $classmap)
+ {
+ foreach ($classmap as $type => $class) {
+ if (!class_exists($class)) {
+ throw new Zend_Soap_Client_Exception('Invalid class in class map');
+ }
+ }
+
+ $this->_classmap = $classmap;
+
+ $this->_soapClient = null;
+
+ return $this;
+ }
+
+ /**
+ * Retrieve classmap
+ *
+ * @return mixed
+ */
+ public function getClassmap()
+ {
+ return $this->_classmap;
+ }
+
+ /**
+ * Set encoding
+ *
+ * @param string $encoding
+ * @return Zend_Soap_Client
+ * @throws Zend_Soap_Client_Exception with invalid encoding argument
+ */
+ public function setEncoding($encoding)
+ {
+ if (!is_string($encoding)) {
+ throw new Zend_Soap_Client_Exception('Invalid encoding specified');
+ }
+
+ $this->_encoding = $encoding;
+
+ $this->_soapClient = null;
+
+ return $this;
+ }
+
+ /**
+ * Get encoding
+ *
+ * @return string
+ */
+ public function getEncoding()
+ {
+ return $this->_encoding;
+ }
+
+ /**
+ * Check for valid URN
+ *
+ * @param string $urn
+ * @return true
+ * @throws Zend_Soap_Client_Exception on invalid URN
+ */
+ public function validateUrn($urn)
+ {
+ $scheme = parse_url($urn, PHP_URL_SCHEME);
+ if ($scheme === false || $scheme === null) {
+ throw new Zend_Soap_Client_Exception('Invalid URN');
+ }
+
+ return true;
+
+ }
+
+ /**
+ * Set URI
+ *
+ * URI in Web Service the target namespace
+ *
+ * @param string $uri
+ * @return Zend_Soap_Client
+ * @throws Zend_Soap_Client_Exception with invalid uri argument
+ */
+ public function setUri($uri)
+ {
+ $this->validateUrn($uri);
+ $this->_uri = $uri;
+
+ $this->_soapClient = null;
+
+ return $this;
+ }
+
+ /**
+ * Retrieve URI
+ *
+ * @return string
+ */
+ public function getUri()
+ {
+ return $this->_uri;
+ }
+
+ /**
+ * Set Location
+ *
+ * URI in Web Service the target namespace
+ *
+ * @param string $location
+ * @return Zend_Soap_Client
+ * @throws Zend_Soap_Client_Exception with invalid uri argument
+ */
+ public function setLocation($location)
+ {
+ $this->validateUrn($location);
+ $this->_location = $location;
+
+ $this->_soapClient = null;
+
+ return $this;
+ }
+
+ /**
+ * Retrieve URI
+ *
+ * @return string
+ */
+ public function getLocation()
+ {
+ return $this->_location;
+ }
+
+ /**
+ * Set request style
+ *
+ * @param int $style One of the SOAP_RPC or SOAP_DOCUMENT constants
+ * @return Zend_Soap_Client
+ * @throws Zend_Soap_Client_Exception with invalid style argument
+ */
+ public function setStyle($style)
+ {
+ if (!in_array($style, array(SOAP_RPC, SOAP_DOCUMENT))) {
+ throw new Zend_Soap_Client_Exception('Invalid request style specified. Use SOAP_RPC or SOAP_DOCUMENT constants.');
+ }
+
+ $this->_style = $style;
+
+ $this->_soapClient = null;
+
+ return $this;
+ }
+
+ /**
+ * Get request style
+ *
+ * @return int
+ */
+ public function getStyle()
+ {
+ return $this->_style;
+ }
+
+ /**
+ * Set message encoding method
+ *
+ * @param int $use One of the SOAP_ENCODED or SOAP_LITERAL constants
+ * @return Zend_Soap_Client
+ * @throws Zend_Soap_Client_Exception with invalid message encoding method argument
+ */
+ public function setEncodingMethod($use)
+ {
+ if (!in_array($use, array(SOAP_ENCODED, SOAP_LITERAL))) {
+ throw new Zend_Soap_Client_Exception('Invalid message encoding method. Use SOAP_ENCODED or SOAP_LITERAL constants.');
+ }
+
+ $this->_use = $use;
+
+ $this->_soapClient = null;
+
+ return $this;
+ }
+
+ /**
+ * Get message encoding method
+ *
+ * @return int
+ */
+ public function getEncodingMethod()
+ {
+ return $this->_use;
+ }
+
+ /**
+ * Set HTTP login
+ *
+ * @param string $login
+ * @return Zend_Soap_Client
+ */
+ public function setHttpLogin($login)
+ {
+ $this->_login = $login;
+
+ $this->_soapClient = null;
+
+ return $this;
+ }
+
+ /**
+ * Retrieve HTTP Login
+ *
+ * @return string
+ */
+ public function getHttpLogin()
+ {
+ return $this->_login;
+ }
+
+ /**
+ * Set HTTP password
+ *
+ * @param string $password
+ * @return Zend_Soap_Client
+ */
+ public function setHttpPassword($password)
+ {
+ $this->_password = $password;
+
+ $this->_soapClient = null;
+
+ return $this;
+ }
+
+ /**
+ * Retrieve HTTP Password
+ *
+ * @return string
+ */
+ public function getHttpPassword()
+ {
+ return $this->_password;
+ }
+
+ /**
+ * Set proxy host
+ *
+ * @param string $proxyHost
+ * @return Zend_Soap_Client
+ */
+ public function setProxyHost($proxyHost)
+ {
+ $this->_proxy_host = $proxyHost;
+
+ $this->_soapClient = null;
+
+ return $this;
+ }
+
+ /**
+ * Retrieve proxy host
+ *
+ * @return string
+ */
+ public function getProxyHost()
+ {
+ return $this->_proxy_host;
+ }
+
+ /**
+ * Set proxy port
+ *
+ * @param int $proxyPort
+ * @return Zend_Soap_Client
+ */
+ public function setProxyPort($proxyPort)
+ {
+ $this->_proxy_port = (int)$proxyPort;
+
+ $this->_soapClient = null;
+
+ return $this;
+ }
+
+ /**
+ * Retrieve proxy port
+ *
+ * @return int
+ */
+ public function getProxyPort()
+ {
+ return $this->_proxy_port;
+ }
+
+ /**
+ * Set proxy login
+ *
+ * @param string $proxyLogin
+ * @return Zend_Soap_Client
+ */
+ public function setProxyLogin($proxyLogin)
+ {
+ $this->_proxy_login = $proxyLogin;
+
+ $this->_soapClient = null;
+
+ return $this;
+ }
+
+ /**
+ * Retrieve proxy login
+ *
+ * @return string
+ */
+ public function getProxyLogin()
+ {
+ return $this->_proxy_login;
+ }
+
+ /**
+ * Set proxy password
+ *
+ * @param string $proxyLogin
+ * @return Zend_Soap_Client
+ */
+ public function setProxyPassword($proxyPassword)
+ {
+ $this->_proxy_password = $proxyPassword;
+
+ $this->_soapClient = null;
+
+ return $this;
+ }
+
+ /**
+ * Set HTTPS client certificate path
+ *
+ * @param string $localCert local certificate path
+ * @return Zend_Soap_Client
+ * @throws Zend_Soap_Client_Exception with invalid local certificate path argument
+ */
+ public function setHttpsCertificate($localCert)
+ {
+ if (!is_readable($localCert)) {
+ throw new Zend_Soap_Client_Exception('Invalid HTTPS client certificate path.');
+ }
+
+ $this->_local_cert = $localCert;
+
+ $this->_soapClient = null;
+
+ return $this;
+ }
+
+ /**
+ * Get HTTPS client certificate path
+ *
+ * @return string
+ */
+ public function getHttpsCertificate()
+ {
+ return $this->_local_cert;
+ }
+
+ /**
+ * Set HTTPS client certificate passphrase
+ *
+ * @param string $passphrase
+ * @return Zend_Soap_Client
+ */
+ public function setHttpsCertPassphrase($passphrase)
+ {
+ $this->_passphrase = $passphrase;
+
+ $this->_soapClient = null;
+
+ return $this;
+ }
+
+ /**
+ * Get HTTPS client certificate passphrase
+ *
+ * @return string
+ */
+ public function getHttpsCertPassphrase()
+ {
+ return $this->_passphrase;
+ }
+
+ /**
+ * Set compression options
+ *
+ * @param int|null $compressionOptions
+ * @return Zend_Soap_Client
+ */
+ public function setCompressionOptions($compressionOptions)
+ {
+ if ($compressionOptions === null) {
+ $this->_compression = null;
+ } else {
+ $this->_compression = (int)$compressionOptions;
+ }
+ $this->_soapClient = null;
+ return $this;
+ }
+
+ /**
+ * Get Compression options
+ *
+ * @return int
+ */
+ public function getCompressionOptions()
+ {
+ return $this->_compression;
+ }
+
+ /**
+ * Retrieve proxy password
+ *
+ * @return string
+ */
+ public function getProxyPassword()
+ {
+ return $this->_proxy_password;
+ }
+
+ /**
+ * Set Stream Context
+ *
+ * @return Zend_Soap_Client
+ */
+ public function setStreamContext($context)
+ {
+ if(!is_resource($context) || get_resource_type($context) !== "stream-context") {
+ /**
+ * @see Zend_Soap_Client_Exception
+ */
+ throw new Zend_Soap_Client_Exception(
+ "Invalid stream context resource given."
+ );
+ }
+
+ $this->_stream_context = $context;
+ return $this;
+ }
+
+ /**
+ * Get Stream Context
+ *
+ * @return resource
+ */
+ public function getStreamContext()
+ {
+ return $this->_stream_context;
+ }
+
+ /**
+ * Set the SOAP Feature options.
+ *
+ * @param string|int $feature
+ * @return Zend_Soap_Client
+ */
+ public function setSoapFeatures($feature)
+ {
+ $this->_features = $feature;
+
+ $this->_soapClient = null;
+ return $this;
+ }
+
+ /**
+ * Return current SOAP Features options
+ *
+ * @return int
+ */
+ public function getSoapFeatures()
+ {
+ return $this->_features;
+ }
+
+ /**
+ * Set the SOAP Wsdl Caching Options
+ *
+ * @param string|int|boolean|null $caching
+ * @return Zend_Soap_Client
+ */
+ public function setWsdlCache($caching)
+ {
+ if ($caching === null) {
+ $this->_cache_wsdl = null;
+ } else {
+ $this->_cache_wsdl = (int)$caching;
+ }
+ return $this;
+ }
+
+ /**
+ * Get current SOAP Wsdl Caching option
+ *
+ * @return int
+ */
+ public function getWsdlCache()
+ {
+ return $this->_cache_wsdl;
+ }
+
+ /**
+ * Set the string to use in User-Agent header
+ *
+ * @param string|null $userAgent
+ * @return Zend_Soap_Client
+ */
+ public function setUserAgent($userAgent)
+ {
+ if ($userAgent === null) {
+ $this->_user_agent = null;
+ } else {
+ $this->_user_agent = (string)$userAgent;
+ }
+ return $this;
+ }
+
+ /**
+ * Get current string to use in User-Agent header
+ *
+ * @return string|null
+ */
+ public function getUserAgent()
+ {
+ return $this->_user_agent;
+ }
+
+ /**
+ * Set the exceptions option
+ *
+ * The exceptions option is a boolean value defining whether soap errors
+ * throw exceptions.
+ *
+ * @see http://php.net/manual/soapclient.soapclient.php#refsect1-soapclient.soapclient-parameters
+ *
+ * @param bool $exceptions
+ * @return $this
+ */
+ public function setExceptions($exceptions)
+ {
+ $this->_exceptions = (bool) $exceptions;
+
+ return $this;
+ }
+
+ /**
+ * Get the exceptions option
+ *
+ * The exceptions option is a boolean value defining whether soap errors
+ * throw exceptions.
+ *
+ * @see http://php.net/manual/soapclient.soapclient.php#refsect1-soapclient.soapclient-parameters
+ *
+ * @return bool|null
+ */
+ public function getExceptions()
+ {
+ return $this->_exceptions;
+ }
+
+ /**
+ * Retrieve request XML
+ *
+ * @return string
+ */
+ public function getLastRequest()
+ {
+ if ($this->_soapClient !== null) {
+ return $this->_soapClient->__getLastRequest();
+ }
+
+ return '';
+ }
+
+ /**
+ * Get response XML
+ *
+ * @return string
+ */
+ public function getLastResponse()
+ {
+ if ($this->_soapClient !== null) {
+ return $this->_soapClient->__getLastResponse();
+ }
+
+ return '';
+ }
+
+ /**
+ * Retrieve request headers
+ *
+ * @return string
+ */
+ public function getLastRequestHeaders()
+ {
+ if ($this->_soapClient !== null) {
+ return $this->_soapClient->__getLastRequestHeaders();
+ }
+
+ return '';
+ }
+
+ /**
+ * Retrieve response headers (as string)
+ *
+ * @return string
+ */
+ public function getLastResponseHeaders()
+ {
+ if ($this->_soapClient !== null) {
+ return $this->_soapClient->__getLastResponseHeaders();
+ }
+
+ return '';
+ }
+
+ /**
+ * Retrieve last invoked method
+ *
+ * @return string
+ */
+ public function getLastMethod()
+ {
+ return $this->_lastMethod;
+ }
+
+ /**
+ * Do request proxy method.
+ *
+ * May be overridden in subclasses
+ *
+ * @internal
+ * @param Zend_Soap_Client_Common $client
+ * @param string $request
+ * @param string $location
+ * @param string $action
+ * @param int $version
+ * @param int $one_way
+ * @return mixed
+ */
+ public function _doRequest(Zend_Soap_Client_Common $client, $request, $location, $action, $version, $one_way = null)
+ {
+ // Perform request as is
+ if ($one_way == null) {
+ return call_user_func(array($client,'SoapClient::__doRequest'), $request, $location, $action, $version);
+ } else {
+ return call_user_func(array($client,'SoapClient::__doRequest'), $request, $location, $action, $version, $one_way);
+ }
+ }
+
+ /**
+ * Initialize SOAP Client object
+ *
+ * @throws Zend_Soap_Client_Exception
+ */
+ protected function _initSoapClientObject()
+ {
+ $wsdl = $this->getWsdl();
+ $options = array_merge($this->getOptions(), array('trace' => true));
+
+ if ($wsdl == null) {
+ if (!isset($options['location'])) {
+ throw new Zend_Soap_Client_Exception('\'location\' parameter is required in non-WSDL mode.');
+ }
+ if (!isset($options['uri'])) {
+ throw new Zend_Soap_Client_Exception('\'uri\' parameter is required in non-WSDL mode.');
+ }
+ } else {
+ if (isset($options['use'])) {
+ throw new Zend_Soap_Client_Exception('\'use\' parameter only works in non-WSDL mode.');
+ }
+ if (isset($options['style'])) {
+ throw new Zend_Soap_Client_Exception('\'style\' parameter only works in non-WSDL mode.');
+ }
+ }
+ unset($options['wsdl']);
+
+ $this->_soapClient = new Zend_Soap_Client_Common(array($this, '_doRequest'), $wsdl, $options);
+ }
+
+
+ /**
+ * Perform arguments pre-processing
+ *
+ * My be overridden in descendant classes
+ *
+ * @param array $arguments
+ */
+ protected function _preProcessArguments($arguments)
+ {
+ // Do nothing
+ return $arguments;
+ }
+
+ /**
+ * Perform result pre-processing
+ *
+ * My be overridden in descendant classes
+ *
+ * @param array $arguments
+ */
+ protected function _preProcessResult($result)
+ {
+ // Do nothing
+ return $result;
+ }
+
+ /**
+ * Add SOAP input header
+ *
+ * @param SoapHeader $header
+ * @param boolean $permanent
+ * @return Zend_Soap_Client
+ */
+ public function addSoapInputHeader(SoapHeader $header, $permanent = false)
+ {
+ if ($permanent) {
+ $this->_permanentSoapInputHeaders[] = $header;
+ } else {
+ $this->_soapInputHeaders[] = $header;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Reset SOAP input headers
+ *
+ * @return Zend_Soap_Client
+ */
+ public function resetSoapInputHeaders()
+ {
+ $this->_permanentSoapInputHeaders = array();
+ $this->_soapInputHeaders = array();
+
+ return $this;
+ }
+
+ /**
+ * Get last SOAP output headers
+ *
+ * @return array
+ */
+ public function getLastSoapOutputHeaderObjects()
+ {
+ return $this->_soapOutputHeaders;
+ }
+
+ /**
+ * Perform a SOAP call
+ *
+ * @param string $name
+ * @param array $arguments
+ * @return mixed
+ */
+ public function __call($name, $arguments)
+ {
+ $soapClient = $this->getSoapClient();
+
+ $this->_lastMethod = $name;
+
+ $soapHeaders = array_merge($this->_permanentSoapInputHeaders, $this->_soapInputHeaders);
+ $result = $soapClient->__soapCall($name,
+ $this->_preProcessArguments($arguments),
+ null, /* Options are already set to the SOAP client object */
+ (count($soapHeaders) > 0)? $soapHeaders : null,
+ $this->_soapOutputHeaders);
+
+ // Reset non-permanent input headers
+ $this->_soapInputHeaders = array();
+
+ return $this->_preProcessResult($result);
+ }
+
+
+ /**
+ * Return a list of available functions
+ *
+ * @return array
+ * @throws Zend_Soap_Client_Exception
+ */
+ public function getFunctions()
+ {
+ if ($this->getWsdl() == null) {
+ throw new Zend_Soap_Client_Exception('\'getFunctions\' method is available only in WSDL mode.');
+ }
+
+ $soapClient = $this->getSoapClient();
+ return $soapClient->__getFunctions();
+ }
+
+
+ /**
+ * Get used types.
+ *
+ * @return array
+ */
+
+ /**
+ * Return a list of SOAP types
+ *
+ * @return array
+ * @throws Zend_Soap_Client_Exception
+ */
+ public function getTypes()
+ {
+ if ($this->getWsdl() == null) {
+ throw new Zend_Soap_Client_Exception('\'getTypes\' method is available only in WSDL mode.');
+ }
+
+ $soapClient = $this->getSoapClient();
+
+ return $soapClient->__getTypes();
+ }
+
+ /**
+ * @param SoapClient $soapClient
+ * @return Zend_Soap_Client
+ */
+ public function setSoapClient(SoapClient $soapClient)
+ {
+ $this->_soapClient = $soapClient;
+ return $this;
+ }
+
+ /**
+ * @return SoapClient
+ */
+ public function getSoapClient()
+ {
+ if ($this->_soapClient == null) {
+ $this->_initSoapClientObject();
+ }
+ return $this->_soapClient;
+ }
+
+ /**
+ * @param string $name
+ * @param string $value
+ * @return Zend_Soap_Client
+ */
+ public function setCookie($cookieName, $cookieValue=null)
+ {
+ $soapClient = $this->getSoapClient();
+ $soapClient->__setCookie($cookieName, $cookieValue);
+ return $this;
+ }
+}
diff --git a/library/vendor/Zend/Soap/Client/Common.php b/library/vendor/Zend/Soap/Client/Common.php
new file mode 100644
index 0000000..7880115
--- /dev/null
+++ b/library/vendor/Zend/Soap/Client/Common.php
@@ -0,0 +1,76 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Client
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+if (extension_loaded('soap')) {
+
+/**
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Client
+ */
+class Zend_Soap_Client_Common extends SoapClient
+{
+ /**
+ * doRequest() pre-processing method
+ *
+ * @var callback
+ */
+ protected $_doRequestCallback;
+
+ /**
+ * Common Soap Client constructor
+ *
+ * @param callback $doRequestMethod
+ * @param string $wsdl
+ * @param array $options
+ */
+ function __construct($doRequestCallback, $wsdl, $options)
+ {
+ $this->_doRequestCallback = $doRequestCallback;
+
+ parent::__construct($wsdl, $options);
+ }
+
+ /**
+ * Performs SOAP request over HTTP.
+ * Overridden to implement different transport layers, perform additional XML processing or other purpose.
+ *
+ * @param string $request
+ * @param string $location
+ * @param string $action
+ * @param int $version
+ * @param int $one_way
+ * @return mixed
+ */
+ function __doRequest($request, $location, $action, $version, $one_way = null)
+ {
+ if ($one_way === null) {
+ return call_user_func($this->_doRequestCallback, $this, $request, $location, $action, $version);
+ } else {
+ return call_user_func($this->_doRequestCallback, $this, $request, $location, $action, $version, $one_way);
+ }
+ }
+
+}
+
+} // end if (extension_loaded('soap')
diff --git a/library/vendor/Zend/Soap/Client/DotNet.php b/library/vendor/Zend/Soap/Client/DotNet.php
new file mode 100644
index 0000000..0e6d121
--- /dev/null
+++ b/library/vendor/Zend/Soap/Client/DotNet.php
@@ -0,0 +1,93 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Client
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Soap_Client */
+
+if (extension_loaded('soap')) {
+
+/**
+ * Zend_Soap_Client_Local
+ *
+ * Class is intended to be used with .Net Web Services.
+ *
+ * Important! Class is at experimental stage now.
+ * Please leave your notes, compatiblity issues reports or
+ * suggestions in fw-webservices@lists.zend.com or fw-general@lists.com
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Client
+ */
+class Zend_Soap_Client_DotNet extends Zend_Soap_Client
+{
+ /**
+ * Constructor
+ *
+ * @param string $wsdl
+ * @param array $options
+ */
+ public function __construct($wsdl = null, $options = null)
+ {
+ // Use SOAP 1.1 as default
+ $this->setSoapVersion(SOAP_1_1);
+
+ parent::__construct($wsdl, $options);
+ }
+
+
+ /**
+ * Perform arguments pre-processing
+ *
+ * My be overridden in descendant classes
+ *
+ * @param array $arguments
+ * @throws Zend_Soap_Client_Exception
+ */
+ protected function _preProcessArguments($arguments)
+ {
+ if (count($arguments) > 1 ||
+ (count($arguments) == 1 && !is_array(reset($arguments)))
+ ) {
+ throw new Zend_Soap_Client_Exception('.Net webservice arguments have to be grouped into array: array(\'a\' => $a, \'b\' => $b, ...).');
+ }
+
+ // Do nothing
+ return $arguments;
+ }
+
+ /**
+ * Perform result pre-processing
+ *
+ * My be overridden in descendant classes
+ *
+ * @param array $arguments
+ */
+ protected function _preProcessResult($result)
+ {
+ $resultProperty = $this->getLastMethod() . 'Result';
+
+ return $result->$resultProperty;
+ }
+
+}
+
+} // end if (extension_loaded('soap')
diff --git a/library/vendor/Zend/Soap/Client/Exception.php b/library/vendor/Zend/Soap/Client/Exception.php
new file mode 100644
index 0000000..2c210ed
--- /dev/null
+++ b/library/vendor/Zend/Soap/Client/Exception.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Client
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Exception */
+
+/**
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Client
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Soap_Client_Exception extends Zend_Exception
+{}
+
diff --git a/library/vendor/Zend/Soap/Client/Local.php b/library/vendor/Zend/Soap/Client/Local.php
new file mode 100644
index 0000000..c060700
--- /dev/null
+++ b/library/vendor/Zend/Soap/Client/Local.php
@@ -0,0 +1,97 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Client
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Soap_Server */
+
+/** Zend_Soap_Client */
+
+if (extension_loaded('soap')) {
+
+/**
+ * Zend_Soap_Client_Local
+ *
+ * Class is intended to be used as local SOAP client which works
+ * with a provided Server object.
+ *
+ * Could be used for development or testing purposes.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Client
+ */
+class Zend_Soap_Client_Local extends Zend_Soap_Client
+{
+ /**
+ * Server object
+ *
+ * @var Zend_Soap_Server
+ */
+ protected $_server;
+
+ /**
+ * Local client constructor
+ *
+ * @param Zend_Soap_Server $server
+ * @param string $wsdl
+ * @param array $options
+ */
+ function __construct(Zend_Soap_Server $server, $wsdl, $options = null)
+ {
+ $this->_server = $server;
+
+ // Use Server specified SOAP version as default
+ $this->setSoapVersion($server->getSoapVersion());
+
+ parent::__construct($wsdl, $options);
+ }
+
+ /**
+ * Actual "do request" method.
+ *
+ * @internal
+ * @param Zend_Soap_Client_Common $client
+ * @param string $request
+ * @param string $location
+ * @param string $action
+ * @param int $version
+ * @param int $one_way
+ * @return mixed
+ */
+ public function _doRequest(Zend_Soap_Client_Common $client, $request, $location, $action, $version, $one_way = null)
+ {
+ // Perform request as is
+ ob_start();
+ $this->_server->handle($request);
+ $response = ob_get_clean();
+
+ if ($response === null || $response === '') {
+ $serverResponse = $this->server->getResponse();
+ if ($serverResponse !== null) {
+ $response = $serverResponse;
+ }
+ }
+
+ return $response;
+ }
+}
+
+} // end if (extension_loaded('soap')
diff --git a/library/vendor/Zend/Soap/Server.php b/library/vendor/Zend/Soap/Server.php
new file mode 100644
index 0000000..9b36815
--- /dev/null
+++ b/library/vendor/Zend/Soap/Server.php
@@ -0,0 +1,999 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * @see Zend_Server_Interface
+ */
+
+/** @see Zend_Xml_Security */
+
+/** @see Zend_Xml_Exception */
+
+/**
+ * Zend_Soap_Server
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Server
+ * @uses Zend_Server_Interface
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Soap_Server implements Zend_Server_Interface
+{
+ /**
+ * Actor URI
+ * @var string URI
+ */
+ protected $_actor;
+
+ /**
+ * Class registered with this server
+ * @var string
+ */
+ protected $_class;
+
+ /**
+ * Arguments to pass to {@link $_class} constructor
+ * @var array
+ */
+ protected $_classArgs = array();
+
+ /**
+ * Object registered with this server
+ */
+ protected $_object;
+
+ /**
+ * Array of SOAP type => PHP class pairings for handling return/incoming values
+ * @var array
+ */
+ protected $_classmap;
+
+ /**
+ * Encoding
+ * @var string
+ */
+ protected $_encoding;
+
+ /**
+ * SOAP Server Features
+ *
+ * @var int
+ */
+ protected $_features;
+
+ /**
+ * WSDL Caching Options of SOAP Server
+ *
+ * @var mixed
+ */
+ protected $_wsdlCache;
+
+ /**
+ * WS-I compliant
+ *
+ * @var boolean
+ */
+ protected $_wsiCompliant;
+
+ /**
+ * Registered fault exceptions
+ * @var array
+ */
+ protected $_faultExceptions = array();
+
+ /**
+ * Functions registered with this server; may be either an array or the SOAP_FUNCTIONS_ALL
+ * constant
+ * @var array|int
+ */
+ protected $_functions = array();
+
+ /**
+ * Persistence mode; should be one of the SOAP persistence constants
+ * @var int
+ */
+ protected $_persistence;
+
+ /**
+ * Request XML
+ * @var string
+ */
+ protected $_request;
+
+ /**
+ * Response XML
+ * @var string
+ */
+ protected $_response;
+
+ /**
+ * Flag: whether or not {@link handle()} should return a response instead
+ * of automatically emitting it.
+ * @var boolean
+ */
+ protected $_returnResponse = false;
+
+ /**
+ * SOAP version to use; SOAP_1_2 by default, to allow processing of headers
+ * @var int
+ */
+ protected $_soapVersion = SOAP_1_2;
+
+ /**
+ * URI or path to WSDL
+ * @var string
+ */
+ protected $_wsdl;
+
+ /**
+ * URI namespace for SOAP server
+ * @var string URI
+ */
+ protected $_uri;
+
+ /**
+ * Constructor
+ *
+ * Sets display_errors INI setting to off (prevent client errors due to bad
+ * XML in response). Registers {@link handlePhpErrors()} as error handler
+ * for E_USER_ERROR.
+ *
+ * If $wsdl is provided, it is passed on to {@link setWsdl()}; if any
+ * options are specified, they are passed on to {@link setOptions()}.
+ *
+ * @param string $wsdl
+ * @param array $options
+ * @return void
+ */
+ public function __construct($wsdl = null, array $options = null)
+ {
+ if (!extension_loaded('soap')) {
+ throw new Zend_Soap_Server_Exception('SOAP extension is not loaded.');
+ }
+
+ if (null !== $wsdl) {
+ $this->setWsdl($wsdl);
+ }
+
+ if (null !== $options) {
+ $this->setOptions($options);
+ }
+ }
+
+ /**
+ * Set Options
+ *
+ * Allows setting options as an associative array of option => value pairs.
+ *
+ * @param array|Zend_Config $options
+ * @return Zend_Soap_Server
+ */
+ public function setOptions($options)
+ {
+ if($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ }
+
+ foreach ($options as $key => $value) {
+ switch ($key) {
+ case 'actor':
+ $this->setActor($value);
+ break;
+ case 'classmap':
+ case 'classMap':
+ $this->setClassmap($value);
+ break;
+ case 'encoding':
+ $this->setEncoding($value);
+ break;
+ case 'soapVersion':
+ case 'soap_version':
+ $this->setSoapVersion($value);
+ break;
+ case 'uri':
+ $this->setUri($value);
+ break;
+ case 'wsdl':
+ $this->setWsdl($value);
+ break;
+ case 'featues':
+ trigger_error(__METHOD__ . ': the option "featues" is deprecated as of 1.10.x and will be removed with 2.0.0; use "features" instead', E_USER_NOTICE);
+ case 'features':
+ $this->setSoapFeatures($value);
+ break;
+ case 'cache_wsdl':
+ $this->setWsdlCache($value);
+ break;
+ case 'wsi_compliant':
+ $this->setWsiCompliant($value);
+ break;
+ default:
+ break;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Return array of options suitable for using with SoapServer constructor
+ *
+ * @return array
+ */
+ public function getOptions()
+ {
+ $options = array();
+ if (null !== $this->_actor) {
+ $options['actor'] = $this->_actor;
+ }
+
+ if (null !== $this->_classmap) {
+ $options['classmap'] = $this->_classmap;
+ }
+
+ if (null !== $this->_encoding) {
+ $options['encoding'] = $this->_encoding;
+ }
+
+ if (null !== $this->_soapVersion) {
+ $options['soap_version'] = $this->_soapVersion;
+ }
+
+ if (null !== $this->_uri) {
+ $options['uri'] = $this->_uri;
+ }
+
+ if (null !== $this->_features) {
+ $options['features'] = $this->_features;
+ }
+
+ if (null !== $this->_wsdlCache) {
+ $options['cache_wsdl'] = $this->_wsdlCache;
+ }
+
+ if (null !== $this->_wsiCompliant) {
+ $options['wsi_compliant'] = $this->_wsiCompliant;
+ }
+
+ return $options;
+ }
+ /**
+ * Set WS-I compliant
+ *
+ * @param boolean $value
+ * @return Zend_Soap_Server
+ */
+ public function setWsiCompliant($value)
+ {
+ if (is_bool($value)) {
+ $this->_wsiCompliant = $value;
+ }
+ return $this;
+ }
+ /**
+ * Gt WS-I compliant
+ *
+ * @return boolean
+ */
+ public function getWsiCompliant()
+ {
+ return $this->_wsiCompliant;
+ }
+ /**
+ * Set encoding
+ *
+ * @param string $encoding
+ * @return Zend_Soap_Server
+ * @throws Zend_Soap_Server_Exception with invalid encoding argument
+ */
+ public function setEncoding($encoding)
+ {
+ if (!is_string($encoding)) {
+ throw new Zend_Soap_Server_Exception('Invalid encoding specified');
+ }
+
+ $this->_encoding = $encoding;
+ return $this;
+ }
+
+ /**
+ * Get encoding
+ *
+ * @return string
+ */
+ public function getEncoding()
+ {
+ return $this->_encoding;
+ }
+
+ /**
+ * Set SOAP version
+ *
+ * @param int $version One of the SOAP_1_1 or SOAP_1_2 constants
+ * @return Zend_Soap_Server
+ * @throws Zend_Soap_Server_Exception with invalid soap version argument
+ */
+ public function setSoapVersion($version)
+ {
+ if (!in_array($version, array(SOAP_1_1, SOAP_1_2))) {
+ throw new Zend_Soap_Server_Exception('Invalid soap version specified');
+ }
+
+ $this->_soapVersion = $version;
+ return $this;
+ }
+
+ /**
+ * Get SOAP version
+ *
+ * @return int
+ */
+ public function getSoapVersion()
+ {
+ return $this->_soapVersion;
+ }
+
+ /**
+ * Check for valid URN
+ *
+ * @param string $urn
+ * @return true
+ * @throws Zend_Soap_Server_Exception on invalid URN
+ */
+ public function validateUrn($urn)
+ {
+ $scheme = parse_url($urn, PHP_URL_SCHEME);
+ if ($scheme === false || $scheme === null) {
+ throw new Zend_Soap_Server_Exception('Invalid URN');
+ }
+
+ return true;
+ }
+
+ /**
+ * Set actor
+ *
+ * Actor is the actor URI for the server.
+ *
+ * @param string $actor
+ * @return Zend_Soap_Server
+ */
+ public function setActor($actor)
+ {
+ $this->validateUrn($actor);
+ $this->_actor = $actor;
+ return $this;
+ }
+
+ /**
+ * Retrieve actor
+ *
+ * @return string
+ */
+ public function getActor()
+ {
+ return $this->_actor;
+ }
+
+ /**
+ * Set URI
+ *
+ * URI in SoapServer is actually the target namespace, not a URI; $uri must begin with 'urn:'.
+ *
+ * @param string $uri
+ * @return Zend_Soap_Server
+ * @throws Zend_Soap_Server_Exception with invalid uri argument
+ */
+ public function setUri($uri)
+ {
+ $this->validateUrn($uri);
+ $this->_uri = $uri;
+ return $this;
+ }
+
+ /**
+ * Retrieve URI
+ *
+ * @return string
+ */
+ public function getUri()
+ {
+ return $this->_uri;
+ }
+
+ /**
+ * Set classmap
+ *
+ * @param array $classmap
+ * @return Zend_Soap_Server
+ * @throws Zend_Soap_Server_Exception for any invalid class in the class map
+ */
+ public function setClassmap($classmap)
+ {
+ if (!is_array($classmap)) {
+ /**
+ * @see Zend_Soap_Server_Exception
+ */
+ throw new Zend_Soap_Server_Exception('Classmap must be an array');
+ }
+ foreach ($classmap as $type => $class) {
+ if (!class_exists($class)) {
+ /**
+ * @see Zend_Soap_Server_Exception
+ */
+ throw new Zend_Soap_Server_Exception('Invalid class in class map');
+ }
+ }
+
+ $this->_classmap = $classmap;
+ return $this;
+ }
+
+ /**
+ * Retrieve classmap
+ *
+ * @return mixed
+ */
+ public function getClassmap()
+ {
+ return $this->_classmap;
+ }
+
+ /**
+ * Set wsdl
+ *
+ * @param string $wsdl URI or path to a WSDL
+ * @return Zend_Soap_Server
+ */
+ public function setWsdl($wsdl)
+ {
+ $this->_wsdl = $wsdl;
+ return $this;
+ }
+
+ /**
+ * Retrieve wsdl
+ *
+ * @return string
+ */
+ public function getWsdl()
+ {
+ return $this->_wsdl;
+ }
+
+ /**
+ * Set the SOAP Feature options.
+ *
+ * @param string|int $feature
+ * @return Zend_Soap_Server
+ */
+ public function setSoapFeatures($feature)
+ {
+ $this->_features = $feature;
+ return $this;
+ }
+
+ /**
+ * Return current SOAP Features options
+ *
+ * @return int
+ */
+ public function getSoapFeatures()
+ {
+ return $this->_features;
+ }
+
+ /**
+ * Set the SOAP Wsdl Caching Options
+ *
+ * @param string|int|boolean $caching
+ * @return Zend_Soap_Server
+ */
+ public function setWsdlCache($options)
+ {
+ $this->_wsdlCache = $options;
+ return $this;
+ }
+
+ /**
+ * Get current SOAP Wsdl Caching option
+ */
+ public function getWsdlCache()
+ {
+ return $this->_wsdlCache;
+ }
+
+ /**
+ * Attach a function as a server method
+ *
+ * @param array|string $function Function name, array of function names to attach,
+ * or SOAP_FUNCTIONS_ALL to attach all functions
+ * @param string $namespace Ignored
+ * @return Zend_Soap_Server
+ * @throws Zend_Soap_Server_Exception on invalid functions
+ */
+ public function addFunction($function, $namespace = '')
+ {
+ // Bail early if set to SOAP_FUNCTIONS_ALL
+ if ($this->_functions == SOAP_FUNCTIONS_ALL) {
+ return $this;
+ }
+
+ if (is_array($function)) {
+ foreach ($function as $func) {
+ if (is_string($func) && function_exists($func)) {
+ $this->_functions[] = $func;
+ } else {
+ throw new Zend_Soap_Server_Exception('One or more invalid functions specified in array');
+ }
+ }
+ $this->_functions = array_merge($this->_functions, $function);
+ } elseif (is_string($function) && function_exists($function)) {
+ $this->_functions[] = $function;
+ } elseif ($function == SOAP_FUNCTIONS_ALL) {
+ $this->_functions = SOAP_FUNCTIONS_ALL;
+ } else {
+ throw new Zend_Soap_Server_Exception('Invalid function specified');
+ }
+
+ if (is_array($this->_functions)) {
+ $this->_functions = array_unique($this->_functions);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Attach a class to a server
+ *
+ * Accepts a class name to use when handling requests. Any additional
+ * arguments will be passed to that class' constructor when instantiated.
+ *
+ * See {@link setObject()} to set preconfigured object instances as request handlers.
+ *
+ * @param string $class Class Name which executes SOAP Requests at endpoint.
+ * @return Zend_Soap_Server
+ * @throws Zend_Soap_Server_Exception if called more than once, or if class
+ * does not exist
+ */
+ public function setClass($class, $namespace = '', $argv = null)
+ {
+ if (isset($this->_class)) {
+ throw new Zend_Soap_Server_Exception('A class has already been registered with this soap server instance');
+ }
+
+ if (!is_string($class)) {
+ throw new Zend_Soap_Server_Exception('Invalid class argument (' . gettype($class) . ')');
+ }
+
+ if (!class_exists($class)) {
+ throw new Zend_Soap_Server_Exception('Class "' . $class . '" does not exist');
+ }
+
+ $this->_class = $class;
+ if (1 < func_num_args()) {
+ $argv = func_get_args();
+ array_shift($argv);
+ $this->_classArgs = $argv;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Attach an object to a server
+ *
+ * Accepts an instanciated object to use when handling requests.
+ *
+ * @param object $object
+ * @return Zend_Soap_Server
+ */
+ public function setObject($object)
+ {
+ if(!is_object($object)) {
+ throw new Zend_Soap_Server_Exception('Invalid object argument ('.gettype($object).')');
+ }
+
+ if(isset($this->_object)) {
+ throw new Zend_Soap_Server_Exception('An object has already been registered with this soap server instance');
+ }
+
+ if ($this->_wsiCompliant) {
+ $this->_object = new Zend_Soap_Server_Proxy($object);
+ } else {
+ $this->_object = $object;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Return a server definition array
+ *
+ * Returns a list of all functions registered with {@link addFunction()},
+ * merged with all public methods of the class set with {@link setClass()}
+ * (if any).
+ *
+ * @access public
+ * @return array
+ */
+ public function getFunctions()
+ {
+ $functions = array();
+ if (null !== $this->_class) {
+ $functions = get_class_methods($this->_class);
+ } elseif (null !== $this->_object) {
+ $functions = get_class_methods($this->_object);
+ }
+
+ return array_merge((array) $this->_functions, $functions);
+ }
+
+ /**
+ * Unimplemented: Load server definition
+ *
+ * @param array $array
+ * @return void
+ * @throws Zend_Soap_Server_Exception Unimplemented
+ */
+ public function loadFunctions($definition)
+ {
+ throw new Zend_Soap_Server_Exception('Unimplemented');
+ }
+
+ /**
+ * Set server persistence
+ *
+ * @param int $mode
+ * @return Zend_Soap_Server
+ */
+ public function setPersistence($mode)
+ {
+ if (!in_array($mode, array(SOAP_PERSISTENCE_SESSION, SOAP_PERSISTENCE_REQUEST))) {
+ throw new Zend_Soap_Server_Exception('Invalid persistence mode specified');
+ }
+
+ $this->_persistence = $mode;
+ return $this;
+ }
+
+ /**
+ * Get server persistence
+ *
+ * @return Zend_Soap_Server
+ */
+ public function getPersistence()
+ {
+ return $this->_persistence;
+ }
+
+ /**
+ * Set request
+ *
+ * $request may be any of:
+ * - DOMDocument; if so, then cast to XML
+ * - DOMNode; if so, then grab owner document and cast to XML
+ * - SimpleXMLElement; if so, then cast to XML
+ * - stdClass; if so, calls __toString() and verifies XML
+ * - string; if so, verifies XML
+ *
+ * @param DOMDocument|DOMNode|SimpleXMLElement|stdClass|string $request
+ * @return Zend_Soap_Server
+ */
+ protected function _setRequest($request)
+ {
+ if ($request instanceof DOMDocument) {
+ $xml = $request->saveXML();
+ } elseif ($request instanceof DOMNode) {
+ $xml = $request->ownerDocument->saveXML();
+ } elseif ($request instanceof SimpleXMLElement) {
+ $xml = $request->asXML();
+ } elseif (is_object($request) || is_string($request)) {
+ if (is_object($request)) {
+ $xml = $request->__toString();
+ } else {
+ $xml = $request;
+ }
+
+ $dom = new DOMDocument();
+ try {
+ if(strlen($xml) == 0 || (!$dom = Zend_Xml_Security::scan($xml, $dom))) {
+ throw new Zend_Soap_Server_Exception('Invalid XML');
+ }
+ } catch (Zend_Xml_Exception $e) {
+ throw new Zend_Soap_Server_Exception(
+ $e->getMessage()
+ );
+ }
+ }
+ $this->_request = $xml;
+ return $this;
+ }
+
+ /**
+ * Retrieve request XML
+ *
+ * @return string
+ */
+ public function getLastRequest()
+ {
+ return $this->_request;
+ }
+
+ /**
+ * Set return response flag
+ *
+ * If true, {@link handle()} will return the response instead of
+ * automatically sending it back to the requesting client.
+ *
+ * The response is always available via {@link getResponse()}.
+ *
+ * @param boolean $flag
+ * @return Zend_Soap_Server
+ */
+ public function setReturnResponse($flag)
+ {
+ $this->_returnResponse = ($flag) ? true : false;
+ return $this;
+ }
+
+ /**
+ * Retrieve return response flag
+ *
+ * @return boolean
+ */
+ public function getReturnResponse()
+ {
+ return $this->_returnResponse;
+ }
+
+ /**
+ * Get response XML
+ *
+ * @return string
+ */
+ public function getLastResponse()
+ {
+ return $this->_response;
+ }
+
+ /**
+ * Get SoapServer object
+ *
+ * Uses {@link $_wsdl} and return value of {@link getOptions()} to instantiate
+ * SoapServer object, and then registers any functions or class with it, as
+ * well as peristence.
+ *
+ * @return SoapServer
+ */
+ protected function _getSoap()
+ {
+ $options = $this->getOptions();
+ $server = new SoapServer($this->_wsdl, $options);
+
+ if (!empty($this->_functions)) {
+ $server->addFunction($this->_functions);
+ }
+
+ if (!empty($this->_class)) {
+ $args = $this->_classArgs;
+ array_unshift($args, $this->_class);
+ if ($this->_wsiCompliant) {
+ array_unshift($args, 'Zend_Soap_Server_Proxy');
+ }
+ call_user_func_array(array($server, 'setClass'), $args);
+ }
+
+ if (!empty($this->_object)) {
+ $server->setObject($this->_object);
+ }
+
+ if (null !== $this->_persistence) {
+ $server->setPersistence($this->_persistence);
+ }
+
+ return $server;
+ }
+
+ /**
+ * Handle a request
+ *
+ * Instantiates SoapServer object with options set in object, and
+ * dispatches its handle() method.
+ *
+ * $request may be any of:
+ * - DOMDocument; if so, then cast to XML
+ * - DOMNode; if so, then grab owner document and cast to XML
+ * - SimpleXMLElement; if so, then cast to XML
+ * - stdClass; if so, calls __toString() and verifies XML
+ * - string; if so, verifies XML
+ *
+ * If no request is passed, pulls request using php:://input (for
+ * cross-platform compatability purposes).
+ *
+ * @param DOMDocument|DOMNode|SimpleXMLElement|stdClass|string $request Optional request
+ * @return void|string
+ */
+ public function handle($request = null)
+ {
+ if (null === $request) {
+ $request = file_get_contents('php://input');
+ }
+
+ // Set Zend_Soap_Server error handler
+ $displayErrorsOriginalState = $this->_initializeSoapErrorContext();
+
+ $setRequestException = null;
+ /**
+ * @see Zend_Soap_Server_Exception
+ */
+ try {
+ $this->_setRequest($request);
+ } catch (Zend_Soap_Server_Exception $e) {
+ $setRequestException = $e;
+ }
+
+ $soap = $this->_getSoap();
+
+ $fault = false;
+ ob_start();
+ if ($setRequestException instanceof Exception) {
+ // Create SOAP fault message if we've caught a request exception
+ $fault = $this->fault($setRequestException->getMessage(), 'Sender');
+ } else {
+ try {
+ $soap->handle($this->_request);
+ } catch (Exception $e) {
+ $fault = $this->fault($e);
+ }
+ }
+ $this->_response = ob_get_clean();
+
+ // Restore original error handler
+ restore_error_handler();
+ ini_set('display_errors', $displayErrorsOriginalState);
+
+ // Send a fault, if we have one
+ if ($fault) {
+ $soap->fault($fault->faultcode, $fault->faultstring);
+ }
+
+ if (!$this->_returnResponse) {
+ echo $this->_response;
+ return;
+ }
+
+ return $this->_response;
+ }
+
+ /**
+ * Method initalizes the error context that the SOAPServer enviroment will run in.
+ *
+ * @return boolean display_errors original value
+ */
+ protected function _initializeSoapErrorContext()
+ {
+ $displayErrorsOriginalState = ini_get('display_errors');
+ ini_set('display_errors', false);
+ set_error_handler(array($this, 'handlePhpErrors'), E_USER_ERROR);
+ return $displayErrorsOriginalState;
+ }
+
+ /**
+ * Register a valid fault exception
+ *
+ * @param string|array $class Exception class or array of exception classes
+ * @return Zend_Soap_Server
+ */
+ public function registerFaultException($class)
+ {
+ $this->_faultExceptions = array_merge($this->_faultExceptions, (array) $class);
+ return $this;
+ }
+
+ /**
+ * Deregister a fault exception from the fault exception stack
+ *
+ * @param string $class
+ * @return boolean
+ */
+ public function deregisterFaultException($class)
+ {
+ if (in_array($class, $this->_faultExceptions, true)) {
+ $index = array_search($class, $this->_faultExceptions);
+ unset($this->_faultExceptions[$index]);
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Return fault exceptions list
+ *
+ * @return array
+ */
+ public function getFaultExceptions()
+ {
+ return $this->_faultExceptions;
+ }
+
+ /**
+ * Generate a server fault
+ *
+ * Note that the arguments are reverse to those of SoapFault.
+ *
+ * If an exception is passed as the first argument, its message and code
+ * will be used to create the fault object if it has been registered via
+ * {@Link registerFaultException()}.
+ *
+ * @link http://www.w3.org/TR/soap12-part1/#faultcodes
+ * @param string|Exception $fault
+ * @param string $code SOAP Fault Codes
+ * @return SoapFault
+ */
+ public function fault($fault = null, $code = "Receiver")
+ {
+ if ($fault instanceof Exception) {
+ $class = get_class($fault);
+ if (in_array($class, $this->_faultExceptions)) {
+ $message = $fault->getMessage();
+ $eCode = $fault->getCode();
+ $code = empty($eCode) ? $code : $eCode;
+ } else {
+ $message = 'Unknown error';
+ }
+ } elseif(is_string($fault)) {
+ $message = $fault;
+ } else {
+ $message = 'Unknown error';
+ }
+
+ $allowedFaultModes = array(
+ 'VersionMismatch', 'MustUnderstand', 'DataEncodingUnknown',
+ 'Sender', 'Receiver', 'Server'
+ );
+ if(!in_array($code, $allowedFaultModes)) {
+ $code = "Receiver";
+ }
+
+ return new SoapFault($code, $message);
+ }
+
+ /**
+ * Throw PHP errors as SoapFaults
+ *
+ * @param int $errno
+ * @param string $errstr
+ * @param string $errfile
+ * @param int $errline
+ * @param array $errcontext
+ * @return void
+ * @throws SoapFault
+ */
+ public function handlePhpErrors($errno, $errstr, $errfile = null, $errline = null, array $errcontext = null)
+ {
+ throw $this->fault($errstr, "Receiver");
+ }
+}
diff --git a/library/vendor/Zend/Soap/Server/Exception.php b/library/vendor/Zend/Soap/Server/Exception.php
new file mode 100644
index 0000000..29e4554
--- /dev/null
+++ b/library/vendor/Zend/Soap/Server/Exception.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+
+/** Zend_Exception */
+
+
+/**
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Server
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+class Zend_Soap_Server_Exception extends Zend_Exception
+{}
+
diff --git a/library/vendor/Zend/Soap/Server/Proxy.php b/library/vendor/Zend/Soap/Server/Proxy.php
new file mode 100644
index 0000000..addecd1
--- /dev/null
+++ b/library/vendor/Zend/Soap/Server/Proxy.php
@@ -0,0 +1,75 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage AutoDiscover
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id:$
+ */
+
+class Zend_Soap_Server_Proxy
+{
+ /**
+ * @var object
+ */
+ protected $_classInstance;
+ /**
+ * @var string
+ */
+ protected $_className;
+ /**
+ * Constructor
+ *
+ * @param object $service
+ */
+ public function __construct($className, $classArgs = array())
+ {
+ $class = new ReflectionClass($className);
+ $constructor = $class->getConstructor();
+ if ($constructor === null) {
+ $this->_classInstance = $class->newInstance();
+ } else {
+ $this->_classInstance = $class->newInstanceArgs(array_values($classArgs));
+ }
+ $this->_className = $className;
+ }
+ /**
+ * Proxy for the WS-I compliant call
+ *
+ * @param string $name
+ * @param string $arguments
+ * @return array
+ */
+ public function __call($name, $arguments)
+ {
+ $result = call_user_func_array(array($this->_classInstance, $name), $this->_preProcessArguments($arguments));
+ return array("{$name}Result"=>$result);
+ }
+ /**
+ * Pre process arguments
+ *
+ * @param mixed $arguments
+ * @return array
+ */
+ protected function _preProcessArguments($arguments)
+ {
+ if (count($arguments) == 1 && is_object($arguments[0])) {
+ return get_object_vars($arguments[0]);
+ } else {
+ return $arguments;
+ }
+ }
+}
diff --git a/library/vendor/Zend/Soap/Wsdl.php b/library/vendor/Zend/Soap/Wsdl.php
new file mode 100644
index 0000000..95f2c20
--- /dev/null
+++ b/library/vendor/Zend/Soap/Wsdl.php
@@ -0,0 +1,661 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Soap_Wsdl_Strategy_Interface
+ */
+
+/**
+ * @see Zend_Soap_Wsdl_Strategy_Abstract
+ */
+
+/** @see Zend_Xml_Security */
+
+/**
+ * Zend_Soap_Wsdl
+ *
+ * @category Zend
+ * @package Zend_Soap
+ */
+class Zend_Soap_Wsdl
+{
+ /**
+ * @var object DomDocument Instance
+ */
+ private $_dom;
+
+ /**
+ * @var object WSDL Root XML_Tree_Node
+ */
+ private $_wsdl;
+
+ /**
+ * @var string URI where the WSDL will be available
+ */
+ private $_uri;
+
+ /**
+ * @var DOMElement
+ */
+ private $_schema = null;
+
+ /**
+ * Types defined on schema
+ *
+ * @var array
+ */
+ private $_includedTypes = array();
+
+ /**
+ * Strategy for detection of complex types
+ */
+ protected $_strategy = null;
+
+
+ /**
+ * Constructor
+ *
+ * @param string $name Name of the Web Service being Described
+ * @param string $uri URI where the WSDL will be available
+ * @param boolean|string|Zend_Soap_Wsdl_Strategy_Interface $strategy
+ */
+ public function __construct($name, $uri, $strategy = true)
+ {
+ if ($uri instanceof Zend_Uri_Http) {
+ $uri = $uri->getUri();
+ }
+ $this->_uri = $uri;
+
+ /**
+ * @todo change DomDocument object creation from cparsing to construxting using API
+ * It also should authomatically escape $name and $uri values if necessary
+ */
+ $wsdl = "<?xml version='1.0' ?>
+ <definitions name='$name' targetNamespace='$uri'
+ xmlns='http://schemas.xmlsoap.org/wsdl/'
+ xmlns:tns='$uri'
+ xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
+ xmlns:xsd='http://www.w3.org/2001/XMLSchema'
+ xmlns:soap-enc='http://schemas.xmlsoap.org/soap/encoding/'
+ xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'></definitions>";
+ $this->_dom = new DOMDocument();
+ if (!$this->_dom = Zend_Xml_Security::scan($wsdl, $this->_dom)) {
+ throw new Zend_Server_Exception('Unable to create DomDocument');
+ }
+ $this->_wsdl = $this->_dom->documentElement;
+
+ $this->setComplexTypeStrategy($strategy);
+ }
+
+ /**
+ * Set a new uri for this WSDL
+ *
+ * @param string|Zend_Uri_Http $uri
+ * @return Zend_Server_Wsdl
+ */
+ public function setUri($uri)
+ {
+ if ($uri instanceof Zend_Uri_Http) {
+ $uri = $uri->getUri();
+ }
+ $oldUri = $this->_uri;
+ $this->_uri = $uri;
+
+ if($this->_dom !== null) {
+ // @todo: This is the worst hack ever, but its needed due to design and non BC issues of WSDL generation
+ $xml = $this->_dom->saveXML();
+ $xml = str_replace($oldUri, $uri, $xml);
+ $this->_dom = new DOMDocument();
+ $this->_dom = Zend_Xml_Security::scan($xml, $this->_dom);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set a strategy for complex type detection and handling
+ *
+ * @todo Boolean is for backwards compability with extractComplexType object var. Remove it in later versions.
+ * @param boolean|string|Zend_Soap_Wsdl_Strategy_Interface $strategy
+ * @return Zend_Soap_Wsdl
+ */
+ public function setComplexTypeStrategy($strategy)
+ {
+ if($strategy === true) {
+ $strategy = new Zend_Soap_Wsdl_Strategy_DefaultComplexType();
+ } else if($strategy === false) {
+ $strategy = new Zend_Soap_Wsdl_Strategy_AnyType();
+ } else if(is_string($strategy)) {
+ if(class_exists($strategy)) {
+ $strategy = new $strategy();
+ } else {
+ throw new Zend_Soap_Wsdl_Exception(
+ sprintf("Strategy with name '%s does not exist.", $strategy
+ ));
+ }
+ }
+
+ if(!($strategy instanceof Zend_Soap_Wsdl_Strategy_Interface)) {
+ throw new Zend_Soap_Wsdl_Exception("Set a strategy that is not of type 'Zend_Soap_Wsdl_Strategy_Interface'");
+ }
+ $this->_strategy = $strategy;
+ return $this;
+ }
+
+ /**
+ * Get the current complex type strategy
+ *
+ * @return Zend_Soap_Wsdl_Strategy_Interface
+ */
+ public function getComplexTypeStrategy()
+ {
+ return $this->_strategy;
+ }
+
+ /**
+ * Add a {@link http://www.w3.org/TR/wsdl#_messages message} element to the WSDL
+ *
+ * @param string $name Name for the {@link http://www.w3.org/TR/wsdl#_messages message}
+ * @param array $parts An array of {@link http://www.w3.org/TR/wsdl#_message parts}
+ * The array is constructed like: 'name of part' => 'part xml schema data type'
+ * or 'name of part' => array('type' => 'part xml schema type')
+ * or 'name of part' => array('element' => 'part xml element name')
+ * @return object The new message's XML_Tree_Node for use in {@link function addDocumentation}
+ */
+ public function addMessage($name, $parts)
+ {
+ $message = $this->_dom->createElement('message');
+
+ $message->setAttribute('name', $name);
+
+ if (sizeof($parts) > 0) {
+ foreach ($parts as $name => $type) {
+ $part = $this->_dom->createElement('part');
+ $part->setAttribute('name', $name);
+ if (is_array($type)) {
+ foreach ($type as $key => $value) {
+ $part->setAttribute($key, $value);
+ }
+ } else {
+ $part->setAttribute('type', $type);
+ }
+ $message->appendChild($part);
+ }
+ }
+
+ $this->_wsdl->appendChild($message);
+
+ return $message;
+ }
+
+ /**
+ * Add a {@link http://www.w3.org/TR/wsdl#_porttypes portType} element to the WSDL
+ *
+ * @param string $name portType element's name
+ * @return object The new portType's XML_Tree_Node for use in {@link function addPortOperation} and {@link function addDocumentation}
+ */
+ public function addPortType($name)
+ {
+ $portType = $this->_dom->createElement('portType');
+ $portType->setAttribute('name', $name);
+ $this->_wsdl->appendChild($portType);
+
+ return $portType;
+ }
+
+ /**
+ * Add an {@link http://www.w3.org/TR/wsdl#_request-response operation} element to a portType element
+ *
+ * @param object $portType a portType XML_Tree_Node, from {@link function addPortType}
+ * @param string $name Operation name
+ * @param string $input Input Message
+ * @param string $output Output Message
+ * @param string $fault Fault Message
+ * @return object The new operation's XML_Tree_Node for use in {@link function addDocumentation}
+ */
+ public function addPortOperation($portType, $name, $input = false, $output = false, $fault = false)
+ {
+ $operation = $this->_dom->createElement('operation');
+ $operation->setAttribute('name', $name);
+
+ if (is_string($input) && (strlen(trim($input)) >= 1)) {
+ $node = $this->_dom->createElement('input');
+ $node->setAttribute('message', $input);
+ $operation->appendChild($node);
+ }
+ if (is_string($output) && (strlen(trim($output)) >= 1)) {
+ $node= $this->_dom->createElement('output');
+ $node->setAttribute('message', $output);
+ $operation->appendChild($node);
+ }
+ if (is_string($fault) && (strlen(trim($fault)) >= 1)) {
+ $node = $this->_dom->createElement('fault');
+ $node->setAttribute('message', $fault);
+ $operation->appendChild($node);
+ }
+
+ $portType->appendChild($operation);
+
+ return $operation;
+ }
+
+ /**
+ * Add a {@link http://www.w3.org/TR/wsdl#_bindings binding} element to WSDL
+ *
+ * @param string $name Name of the Binding
+ * @param string $type name of the portType to bind
+ * @return object The new binding's XML_Tree_Node for use with {@link function addBindingOperation} and {@link function addDocumentation}
+ */
+ public function addBinding($name, $portType)
+ {
+ $binding = $this->_dom->createElement('binding');
+ $binding->setAttribute('name', $name);
+ $binding->setAttribute('type', $portType);
+
+ $this->_wsdl->appendChild($binding);
+
+ return $binding;
+ }
+
+ /**
+ * Add an operation to a binding element
+ *
+ * @param object $binding A binding XML_Tree_Node returned by {@link function addBinding}
+ * @param array $input An array of attributes for the input element, allowed keys are: 'use', 'namespace', 'encodingStyle'. {@link http://www.w3.org/TR/wsdl#_soap:body More Information}
+ * @param array $output An array of attributes for the output element, allowed keys are: 'use', 'namespace', 'encodingStyle'. {@link http://www.w3.org/TR/wsdl#_soap:body More Information}
+ * @param array $fault An array of attributes for the fault element, allowed keys are: 'name', 'use', 'namespace', 'encodingStyle'. {@link http://www.w3.org/TR/wsdl#_soap:body More Information}
+ * @return object The new Operation's XML_Tree_Node for use with {@link function addSoapOperation} and {@link function addDocumentation}
+ */
+ public function addBindingOperation($binding, $name, $input = false, $output = false, $fault = false)
+ {
+ $operation = $this->_dom->createElement('operation');
+ $operation->setAttribute('name', $name);
+
+ if (is_array($input)) {
+ $node = $this->_dom->createElement('input');
+ $soap_node = $this->_dom->createElement('soap:body');
+ foreach ($input as $name => $value) {
+ $soap_node->setAttribute($name, $value);
+ }
+ $node->appendChild($soap_node);
+ $operation->appendChild($node);
+ }
+
+ if (is_array($output)) {
+ $node = $this->_dom->createElement('output');
+ $soap_node = $this->_dom->createElement('soap:body');
+ foreach ($output as $name => $value) {
+ $soap_node->setAttribute($name, $value);
+ }
+ $node->appendChild($soap_node);
+ $operation->appendChild($node);
+ }
+
+ if (is_array($fault)) {
+ $node = $this->_dom->createElement('fault');
+ /**
+ * Note. Do we really need name attribute to be also set at wsdl:fault node???
+ * W3C standard doesn't mention it (http://www.w3.org/TR/wsdl#_soap:fault)
+ * But some real world WSDLs use it, so it may be required for compatibility reasons.
+ */
+ if (isset($fault['name'])) {
+ $node->setAttribute('name', $fault['name']);
+ }
+
+ $soap_node = $this->_dom->createElement('soap:fault');
+ foreach ($fault as $name => $value) {
+ $soap_node->setAttribute($name, $value);
+ }
+ $node->appendChild($soap_node);
+ $operation->appendChild($node);
+ }
+
+ $binding->appendChild($operation);
+
+ return $operation;
+ }
+
+ /**
+ * Add a {@link http://www.w3.org/TR/wsdl#_soap:binding SOAP binding} element to a Binding element
+ *
+ * @param object $binding A binding XML_Tree_Node returned by {@link function addBinding}
+ * @param string $style binding style, possible values are "rpc" (the default) and "document"
+ * @param string $transport Transport method (defaults to HTTP)
+ * @return boolean
+ */
+ public function addSoapBinding($binding, $style = 'document', $transport = 'http://schemas.xmlsoap.org/soap/http')
+ {
+ $soap_binding = $this->_dom->createElement('soap:binding');
+ $soap_binding->setAttribute('style', $style);
+ $soap_binding->setAttribute('transport', $transport);
+
+ $binding->appendChild($soap_binding);
+
+ return $soap_binding;
+ }
+
+ /**
+ * Add a {@link http://www.w3.org/TR/wsdl#_soap:operation SOAP operation} to an operation element
+ *
+ * @param object $operation An operation XML_Tree_Node returned by {@link function addBindingOperation}
+ * @param string $soap_action SOAP Action
+ * @return boolean
+ */
+ public function addSoapOperation($binding, $soap_action)
+ {
+ if ($soap_action instanceof Zend_Uri_Http) {
+ $soap_action = $soap_action->getUri();
+ }
+ $soap_operation = $this->_dom->createElement('soap:operation');
+ $soap_operation->setAttribute('soapAction', $soap_action);
+
+ $binding->insertBefore($soap_operation, $binding->firstChild);
+
+ return $soap_operation;
+ }
+
+ /**
+ * Add a {@link http://www.w3.org/TR/wsdl#_services service} element to the WSDL
+ *
+ * @param string $name Service Name
+ * @param string $port_name Name of the port for the service
+ * @param string $binding Binding for the port
+ * @param string $location SOAP Address for the service
+ * @return object The new service's XML_Tree_Node for use with {@link function addDocumentation}
+ */
+ public function addService($name, $port_name, $binding, $location)
+ {
+ if ($location instanceof Zend_Uri_Http) {
+ $location = $location->getUri();
+ }
+ $service = $this->_dom->createElement('service');
+ $service->setAttribute('name', $name);
+
+ $port = $this->_dom->createElement('port');
+ $port->setAttribute('name', $port_name);
+ $port->setAttribute('binding', $binding);
+
+ $soap_address = $this->_dom->createElement('soap:address');
+ $soap_address->setAttribute('location', $location);
+
+ $port->appendChild($soap_address);
+ $service->appendChild($port);
+
+ $this->_wsdl->appendChild($service);
+
+ return $service;
+ }
+
+ /**
+ * Add a documentation element to any element in the WSDL.
+ *
+ * Note that the WSDL {@link http://www.w3.org/TR/wsdl#_documentation specification} uses 'document',
+ * but the WSDL {@link http://schemas.xmlsoap.org/wsdl/ schema} uses 'documentation' instead.
+ * The {@link http://www.ws-i.org/Profiles/BasicProfile-1.1-2004-08-24.html#WSDL_documentation_Element WS-I Basic Profile 1.1} recommends using 'documentation'.
+ *
+ * @param object $input_node An XML_Tree_Node returned by another method to add the documentation to
+ * @param string $documentation Human readable documentation for the node
+ * @return DOMElement The documentation element
+ */
+ public function addDocumentation($input_node, $documentation)
+ {
+ if ($input_node === $this) {
+ $node = $this->_dom->documentElement;
+ } else {
+ $node = $input_node;
+ }
+
+ $doc = $this->_dom->createElement('documentation');
+ $doc_cdata = $this->_dom->createTextNode(str_replace(array("\r\n", "\r"), "\n", $documentation));
+ $doc->appendChild($doc_cdata);
+
+ if($node->hasChildNodes()) {
+ $node->insertBefore($doc, $node->firstChild);
+ } else {
+ $node->appendChild($doc);
+ }
+
+ return $doc;
+ }
+
+ /**
+ * Add WSDL Types element
+ *
+ * @param object $types A DomDocument|DomNode|DomElement|DomDocumentFragment with all the XML Schema types defined in it
+ */
+ public function addTypes($types)
+ {
+ if ($types instanceof DomDocument) {
+ $dom = $this->_dom->importNode($types->documentElement);
+ $this->_wsdl->appendChild($types->documentElement);
+ } elseif ($types instanceof DomNode || $types instanceof DomElement || $types instanceof DomDocumentFragment ) {
+ $dom = $this->_dom->importNode($types);
+ $this->_wsdl->appendChild($dom);
+ }
+ }
+
+ /**
+ * Add a complex type name that is part of this WSDL and can be used in signatures.
+ *
+ * @param string $type
+ * @return Zend_Soap_Wsdl
+ */
+ public function addType($type)
+ {
+ if(!in_array($type, $this->_includedTypes)) {
+ $this->_includedTypes[] = $type;
+ }
+ return $this;
+ }
+
+ /**
+ * Return an array of all currently included complex types
+ *
+ * @return array
+ */
+ public function getTypes()
+ {
+ return $this->_includedTypes;
+ }
+
+ /**
+ * Return the Schema node of the WSDL
+ *
+ * @return DOMElement
+ */
+ public function getSchema()
+ {
+ if($this->_schema == null) {
+ $this->addSchemaTypeSection();
+ }
+
+ return $this->_schema;
+ }
+
+ /**
+ * Return the WSDL as XML
+ *
+ * @return string WSDL as XML
+ */
+ public function toXML()
+ {
+ return $this->_dom->saveXML();
+ }
+
+ /**
+ * Return DOM Document
+ *
+ * @return object DomDocum ent
+ */
+ public function toDomDocument()
+ {
+ return $this->_dom;
+ }
+
+ /**
+ * Echo the WSDL as XML
+ *
+ * @return boolean
+ */
+ public function dump($filename = false)
+ {
+ if (!$filename) {
+ echo $this->toXML();
+ return true;
+ } else {
+ return file_put_contents($filename, $this->toXML());
+ }
+ }
+
+ /**
+ * Returns an XSD Type for the given PHP type
+ *
+ * @param string $type PHP Type to get the XSD type for
+ * @return string
+ */
+ public function getType($type)
+ {
+ switch (strtolower($type)) {
+ case 'string':
+ case 'str':
+ return 'xsd:string';
+ case 'long':
+ return 'xsd:long';
+ case 'int':
+ case 'integer':
+ return 'xsd:int';
+ case 'float':
+ return 'xsd:float';
+ case 'double':
+ return 'xsd:double';
+ case 'boolean':
+ case 'bool':
+ return 'xsd:boolean';
+ case 'array':
+ return 'soap-enc:Array';
+ case 'object':
+ return 'xsd:struct';
+ case 'mixed':
+ return 'xsd:anyType';
+ case 'void':
+ return '';
+ default:
+ // delegate retrieval of complex type to current strategy
+ return $this->addComplexType($type);
+ }
+ }
+
+ /**
+ * This function makes sure a complex types section and schema additions are set.
+ *
+ * @return Zend_Soap_Wsdl
+ */
+ public function addSchemaTypeSection()
+ {
+ if ($this->_schema === null) {
+ $this->_schema = $this->_dom->createElement('xsd:schema');
+ $this->_schema->setAttribute('targetNamespace', $this->_uri);
+ $types = $this->_dom->createElement('types');
+ $types->appendChild($this->_schema);
+ $this->_wsdl->appendChild($types);
+ }
+ return $this;
+ }
+
+ /**
+ * Add a {@link http://www.w3.org/TR/wsdl#_types types} data type definition
+ *
+ * @param string $type Name of the class to be specified
+ * @return string XSD Type for the given PHP type
+ */
+ public function addComplexType($type)
+ {
+ if (in_array($type, $this->getTypes())) {
+ return "tns:$type";
+ }
+ $this->addSchemaTypeSection();
+
+ $strategy = $this->getComplexTypeStrategy();
+ $strategy->setContext($this);
+ // delegates the detection of a complex type to the current strategy
+ return $strategy->addComplexType($type);
+ }
+
+ /**
+ * Parse an xsd:element represented as an array into a DOMElement.
+ *
+ * @param array $element an xsd:element represented as an array
+ * @return DOMElement parsed element
+ */
+ private function _parseElement($element)
+ {
+ if (!is_array($element)) {
+ throw new Zend_Soap_Wsdl_Exception("The 'element' parameter needs to be an associative array.");
+ }
+
+ $elementXml = $this->_dom->createElement('xsd:element');
+ foreach ($element as $key => $value) {
+ if (in_array($key, array('sequence', 'all', 'choice'))) {
+ if (is_array($value)) {
+ $complexType = $this->_dom->createElement('xsd:complexType');
+ if (count($value) > 0) {
+ $container = $this->_dom->createElement('xsd:' . $key);
+ foreach ($value as $subelement) {
+ $subelementXml = $this->_parseElement($subelement);
+ $container->appendChild($subelementXml);
+ }
+ $complexType->appendChild($container);
+ }
+ $elementXml->appendChild($complexType);
+ }
+ } else {
+ $elementXml->setAttribute($key, $value);
+ }
+ }
+ return $elementXml;
+ }
+
+ /**
+ * Add an xsd:element represented as an array to the schema.
+ *
+ * Array keys represent attribute names and values their respective value.
+ * The 'sequence', 'all' and 'choice' keys must have an array of elements as their value,
+ * to add them to a nested complexType.
+ *
+ * Example: array( 'name' => 'MyElement',
+ * 'sequence' => array( array('name' => 'myString', 'type' => 'string'),
+ * array('name' => 'myInteger', 'type' => 'int') ) );
+ * Resulting XML: <xsd:element name="MyElement"><xsd:complexType><xsd:sequence>
+ * <xsd:element name="myString" type="string"/>
+ * <xsd:element name="myInteger" type="int"/>
+ * </xsd:sequence></xsd:complexType></xsd:element>
+ *
+ * @param array $element an xsd:element represented as an array
+ * @return string xsd:element for the given element array
+ */
+ public function addElement($element)
+ {
+ $schema = $this->getSchema();
+ $elementXml = $this->_parseElement($element);
+ $schema->appendChild($elementXml);
+ return 'tns:' . $element['name'];
+ }
+}
diff --git a/library/vendor/Zend/Soap/Wsdl/Exception.php b/library/vendor/Zend/Soap/Wsdl/Exception.php
new file mode 100644
index 0000000..11397f0
--- /dev/null
+++ b/library/vendor/Zend/Soap/Wsdl/Exception.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Wsdl
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Exception
+ */
+
+/**
+ * Zend_Soap_Wsdl_Exception
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Wsdl
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Soap_Wsdl_Exception extends Zend_Exception { }
diff --git a/library/vendor/Zend/Soap/Wsdl/Strategy/Abstract.php b/library/vendor/Zend/Soap/Wsdl/Strategy/Abstract.php
new file mode 100644
index 0000000..35f198f
--- /dev/null
+++ b/library/vendor/Zend/Soap/Wsdl/Strategy/Abstract.php
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Wsdl
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Soap_Wsdl_Strategy_Interface
+ */
+
+/**
+ * Abstract class for Zend_Soap_Wsdl_Strategy.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Wsdl
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Soap_Wsdl_Strategy_Abstract implements Zend_Soap_Wsdl_Strategy_Interface
+{
+ /**
+ * Context object
+ *
+ * @var Zend_Soap_Wsdl
+ */
+ protected $_context;
+
+ /**
+ * Set the Zend_Soap_Wsdl Context object this strategy resides in.
+ *
+ * @param Zend_Soap_Wsdl $context
+ * @return void
+ */
+ public function setContext(Zend_Soap_Wsdl $context)
+ {
+ $this->_context = $context;
+ }
+
+ /**
+ * Return the current Zend_Soap_Wsdl context object
+ *
+ * @return Zend_Soap_Wsdl
+ */
+ public function getContext()
+ {
+ return $this->_context;
+ }
+}
diff --git a/library/vendor/Zend/Soap/Wsdl/Strategy/AnyType.php b/library/vendor/Zend/Soap/Wsdl/Strategy/AnyType.php
new file mode 100644
index 0000000..13f352e
--- /dev/null
+++ b/library/vendor/Zend/Soap/Wsdl/Strategy/AnyType.php
@@ -0,0 +1,58 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Wsdl
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Soap_Wsdl_Strategy_Interface
+ */
+
+/**
+ * Zend_Soap_Wsdl_Strategy_AnyType
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Wsdl
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Soap_Wsdl_Strategy_AnyType implements Zend_Soap_Wsdl_Strategy_Interface
+{
+ /**
+ * Not needed in this strategy.
+ *
+ * @param Zend_Soap_Wsdl $context
+ */
+ public function setContext(Zend_Soap_Wsdl $context)
+ {
+
+ }
+
+ /**
+ * Returns xsd:anyType regardless of the input.
+ *
+ * @param string $type
+ * @return string
+ */
+ public function addComplexType($type)
+ {
+ return 'xsd:anyType';
+ }
+}
diff --git a/library/vendor/Zend/Soap/Wsdl/Strategy/ArrayOfTypeComplex.php b/library/vendor/Zend/Soap/Wsdl/Strategy/ArrayOfTypeComplex.php
new file mode 100644
index 0000000..a830840
--- /dev/null
+++ b/library/vendor/Zend/Soap/Wsdl/Strategy/ArrayOfTypeComplex.php
@@ -0,0 +1,142 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Wsdl
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Soap_Wsdl_Strategy_DefaultComplexType
+ */
+
+/**
+ * Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Wsdl
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex extends Zend_Soap_Wsdl_Strategy_DefaultComplexType
+{
+ protected $_inProcess = array();
+
+ /**
+ * Add an ArrayOfType based on the xsd:complexType syntax if type[] is detected in return value doc comment.
+ *
+ * @param string $type
+ * @return string tns:xsd-type
+ */
+ public function addComplexType($type)
+ {
+ if (in_array($type, $this->_inProcess)) {
+ return "tns:" . $type;
+ }
+ $this->_inProcess[$type] = $type;
+
+ $nestingLevel = $this->_getNestedCount($type);
+
+ if($nestingLevel > 1) {
+ throw new Zend_Soap_Wsdl_Exception(
+ "ArrayOfTypeComplex cannot return nested ArrayOfObject deeper than ".
+ "one level. Use array object properties to return deep nested data.
+ ");
+ }
+
+ $singularType = $this->_getSingularPhpType($type);
+
+ if(!class_exists($singularType)) {
+ throw new Zend_Soap_Wsdl_Exception(sprintf(
+ "Cannot add a complex type %s that is not an object or where ".
+ "class could not be found in 'DefaultComplexType' strategy.", $type
+ ));
+ }
+
+ if($nestingLevel == 1) {
+ // The following blocks define the Array of Object structure
+ $xsdComplexTypeName = $this->_addArrayOfComplexType($singularType, $type);
+ } else {
+ $xsdComplexTypeName = $singularType;
+ }
+
+ // The array for the objects has been created, now build the object definition:
+ if(!in_array($singularType, $this->getContext()->getTypes())) {
+ parent::addComplexType($singularType);
+ }
+
+ unset($this->_inProcess[$type]);
+ return "tns:".$xsdComplexTypeName;
+ }
+
+ protected function _addArrayOfComplexType($singularType, $type)
+ {
+ $dom = $this->getContext()->toDomDocument();
+
+ $xsdComplexTypeName = $this->_getXsdComplexTypeName($singularType);
+
+ if(!in_array($xsdComplexTypeName, $this->getContext()->getTypes())) {
+ $complexType = $dom->createElement('xsd:complexType');
+ $complexType->setAttribute('name', $xsdComplexTypeName);
+
+ $complexContent = $dom->createElement("xsd:complexContent");
+ $complexType->appendChild($complexContent);
+
+ $xsdRestriction = $dom->createElement("xsd:restriction");
+ $xsdRestriction->setAttribute('base', 'soap-enc:Array');
+ $complexContent->appendChild($xsdRestriction);
+
+ $xsdAttribute = $dom->createElement("xsd:attribute");
+ $xsdAttribute->setAttribute("ref", "soap-enc:arrayType");
+ $xsdAttribute->setAttribute("wsdl:arrayType", sprintf("tns:%s[]", $singularType));
+ $xsdRestriction->appendChild($xsdAttribute);
+
+ $this->getContext()->getSchema()->appendChild($complexType);
+ $this->getContext()->addType($xsdComplexTypeName);
+ }
+
+ return $xsdComplexTypeName;
+ }
+
+ protected function _getXsdComplexTypeName($type)
+ {
+ return sprintf('ArrayOf%s', $type);
+ }
+
+ /**
+ * From a nested definition with type[], get the singular PHP Type
+ *
+ * @param string $type
+ * @return string
+ */
+ protected function _getSingularPhpType($type)
+ {
+ return str_replace("[]", "", $type);
+ }
+
+ /**
+ * Return the array nesting level based on the type name
+ *
+ * @param string $type
+ * @return integer
+ */
+ protected function _getNestedCount($type)
+ {
+ return substr_count($type, "[]");
+ }
+}
diff --git a/library/vendor/Zend/Soap/Wsdl/Strategy/ArrayOfTypeSequence.php b/library/vendor/Zend/Soap/Wsdl/Strategy/ArrayOfTypeSequence.php
new file mode 100644
index 0000000..e82ea50
--- /dev/null
+++ b/library/vendor/Zend/Soap/Wsdl/Strategy/ArrayOfTypeSequence.php
@@ -0,0 +1,154 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Soap_Wsdl_Strategy_DefaultComplexType
+ */
+
+/**
+ * Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Wsdl
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence extends Zend_Soap_Wsdl_Strategy_DefaultComplexType
+{
+ /**
+ * Add an unbounded ArrayOfType based on the xsd:sequence syntax if type[] is detected in return value doc comment.
+ *
+ * @param string $type
+ * @return string tns:xsd-type
+ */
+ public function addComplexType($type)
+ {
+ $nestedCounter = $this->_getNestedCount($type);
+
+ if($nestedCounter > 0) {
+ $singularType = $this->_getSingularType($type);
+
+ for($i = 1; $i <= $nestedCounter; $i++) {
+ $complexTypeName = substr($this->_getTypeNameBasedOnNestingLevel($singularType, $i), 4);
+ $childTypeName = $this->_getTypeNameBasedOnNestingLevel($singularType, $i-1);
+
+ $this->_addElementFromWsdlAndChildTypes($complexTypeName, $childTypeName);
+ }
+ // adding the PHP type which is resolved to a nested XSD type. therefore add only once.
+ $this->getContext()->addType($complexTypeName);
+
+ return "tns:$complexTypeName";
+ } else if (!in_array($type, $this->getContext()->getTypes())) {
+ // New singular complex type
+ return parent::addComplexType($type);
+ } else {
+ // Existing complex type
+ return $this->getContext()->getType($type);
+ }
+ }
+
+ /**
+ * Return the ArrayOf or simple type name based on the singular xsdtype and the nesting level
+ *
+ * @param string $singularType
+ * @param int $level
+ * @return string
+ */
+ protected function _getTypeNameBasedOnNestingLevel($singularType, $level)
+ {
+ if($level == 0) {
+ // This is not an Array anymore, return the xsd simple type
+ return $singularType;
+ } else {
+ $prefix = str_repeat("ArrayOf", $level);
+ $xsdType = $this->_getStrippedXsdType($singularType);
+ $arrayType = $prefix.$xsdType;
+ return "tns:$arrayType";
+ }
+ }
+
+ /**
+ * Strip the xsd: from a singularType and Format it nice for ArrayOf<Type> naming
+ *
+ * @param string $singularType
+ * @return string
+ */
+ protected function _getStrippedXsdType($singularType)
+ {
+ return ucfirst(substr(strtolower($singularType), 4));
+ }
+
+ /**
+ * From a nested defintion with type[], get the singular xsd:type
+ *
+ * @throws Zend_Soap_Wsdl_Exception When no xsd:simpletype can be detected.
+ * @param string $type
+ * @return string
+ */
+ protected function _getSingularType($type)
+ {
+ $singulartype = $this->getContext()->getType(str_replace("[]", "", $type));
+ return $singulartype;
+ }
+
+ /**
+ * Return the array nesting level based on the type name
+ *
+ * @param string $type
+ * @return integer
+ */
+ protected function _getNestedCount($type)
+ {
+ return substr_count($type, "[]");
+ }
+
+ /**
+ * Append the complex type definition to the WSDL via the context access
+ *
+ * @param string $arrayType
+ * @param string $childTypeName
+ * @return void
+ */
+ protected function _addElementFromWsdlAndChildTypes($arrayType, $childTypeName)
+ {
+ if (!in_array($arrayType, $this->getContext()->getTypes())) {
+ $dom = $this->getContext()->toDomDocument();
+
+ $complexType = $dom->createElement('xsd:complexType');
+ $complexType->setAttribute('name', $arrayType);
+
+ $sequence = $dom->createElement('xsd:sequence');
+
+ $element = $dom->createElement('xsd:element');
+ $element->setAttribute('name', 'item');
+ $element->setAttribute('type', $childTypeName);
+ $element->setAttribute('minOccurs', 0);
+ $element->setAttribute('maxOccurs', 'unbounded');
+ $sequence->appendChild($element);
+
+ $complexType->appendChild($sequence);
+
+ $this->getContext()->getSchema()->appendChild($complexType);
+ $this->getContext()->addType($arrayType);
+ }
+ }
+}
diff --git a/library/vendor/Zend/Soap/Wsdl/Strategy/Composite.php b/library/vendor/Zend/Soap/Wsdl/Strategy/Composite.php
new file mode 100644
index 0000000..a80120e
--- /dev/null
+++ b/library/vendor/Zend/Soap/Wsdl/Strategy/Composite.php
@@ -0,0 +1,183 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Wsdl
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Soap_Wsdl_Strategy_Interface
+ */
+
+/**
+ * Zend_Soap_Wsdl_Strategy_Composite
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Wsdl
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Soap_Wsdl_Strategy_Composite implements Zend_Soap_Wsdl_Strategy_Interface
+{
+ /**
+ * Typemap of Complex Type => Strategy pairs.
+ *
+ * @var array
+ */
+ protected $_typeMap = array();
+
+ /**
+ * Default Strategy of this composite
+ *
+ * @var string|Zend_Soap_Wsdl_Strategy_Interface
+ */
+ protected $_defaultStrategy;
+
+ /**
+ * Context WSDL file that this composite serves
+ *
+ * @var Zend_Soap_Wsdl|null
+ */
+ protected $_context;
+
+ /**
+ * Construct Composite WSDL Strategy.
+ *
+ * @throws Zend_Soap_Wsdl_Exception
+ * @param array $typeMap
+ * @param string|Zend_Soap_Wsdl_Strategy_Interface $defaultStrategy
+ */
+ public function __construct(array $typeMap=array(), $defaultStrategy="Zend_Soap_Wsdl_Strategy_DefaultComplexType")
+ {
+ foreach($typeMap AS $type => $strategy) {
+ $this->connectTypeToStrategy($type, $strategy);
+ }
+ $this->_defaultStrategy = $defaultStrategy;
+ }
+
+ /**
+ * Connect a complex type to a given strategy.
+ *
+ * @throws Zend_Soap_Wsdl_Exception
+ * @param string $type
+ * @param string|Zend_Soap_Wsdl_Strategy_Interface $strategy
+ * @return Zend_Soap_Wsdl_Strategy_Composite
+ */
+ public function connectTypeToStrategy($type, $strategy)
+ {
+ if(!is_string($type)) {
+ /**
+ * @see Zend_Soap_Wsdl_Exception
+ */
+ throw new Zend_Soap_Wsdl_Exception("Invalid type given to Composite Type Map.");
+ }
+ $this->_typeMap[$type] = $strategy;
+ return $this;
+ }
+
+ /**
+ * Return default strategy of this composite
+ *
+ * @throws Zend_Soap_Wsdl_Exception
+ * @param string $type
+ * @return Zend_Soap_Wsdl_Strategy_Interface
+ */
+ public function getDefaultStrategy()
+ {
+ $strategy = $this->_defaultStrategy;
+ if(is_string($strategy) && class_exists($strategy)) {
+ $strategy = new $strategy;
+ }
+ if( !($strategy instanceof Zend_Soap_Wsdl_Strategy_Interface) ) {
+ /**
+ * @see Zend_Soap_Wsdl_Exception
+ */
+ throw new Zend_Soap_Wsdl_Exception(
+ "Default Strategy for Complex Types is not a valid strategy object."
+ );
+ }
+ $this->_defaultStrategy = $strategy;
+ return $strategy;
+ }
+
+ /**
+ * Return specific strategy or the default strategy of this type.
+ *
+ * @throws Zend_Soap_Wsdl_Exception
+ * @param string $type
+ * @return Zend_Soap_Wsdl_Strategy_Interface
+ */
+ public function getStrategyOfType($type)
+ {
+ if(isset($this->_typeMap[$type])) {
+ $strategy = $this->_typeMap[$type];
+
+ if(is_string($strategy) && class_exists($strategy)) {
+ $strategy = new $strategy();
+ }
+
+ if( !($strategy instanceof Zend_Soap_Wsdl_Strategy_Interface) ) {
+ /**
+ * @see Zend_Soap_Wsdl_Exception
+ */
+ throw new Zend_Soap_Wsdl_Exception(
+ "Strategy for Complex Type '".$type."' is not a valid strategy object."
+ );
+ }
+ $this->_typeMap[$type] = $strategy;
+ } else {
+ $strategy = $this->getDefaultStrategy();
+ }
+ return $strategy;
+ }
+
+ /**
+ * Method accepts the current WSDL context file.
+ *
+ * @param Zend_Soap_Wsdl $context
+ */
+ public function setContext(Zend_Soap_Wsdl $context)
+ {
+ $this->_context = $context;
+ return $this;
+ }
+
+ /**
+ * Create a complex type based on a strategy
+ *
+ * @throws Zend_Soap_Wsdl_Exception
+ * @param string $type
+ * @return string XSD type
+ */
+ public function addComplexType($type)
+ {
+ if(!($this->_context instanceof Zend_Soap_Wsdl) ) {
+ /**
+ * @see Zend_Soap_Wsdl_Exception
+ */
+ throw new Zend_Soap_Wsdl_Exception(
+ "Cannot add complex type '".$type."', no context is set for this composite strategy."
+ );
+ }
+
+ $strategy = $this->getStrategyOfType($type);
+ $strategy->setContext($this->_context);
+ return $strategy->addComplexType($type);
+ }
+}
diff --git a/library/vendor/Zend/Soap/Wsdl/Strategy/DefaultComplexType.php b/library/vendor/Zend/Soap/Wsdl/Strategy/DefaultComplexType.php
new file mode 100644
index 0000000..3baf804
--- /dev/null
+++ b/library/vendor/Zend/Soap/Wsdl/Strategy/DefaultComplexType.php
@@ -0,0 +1,89 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Wsdl
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Soap_Wsdl_Strategy_Abstract
+ */
+
+/**
+ * Zend_Soap_Wsdl_Strategy_DefaultComplexType
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Wsdl
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Soap_Wsdl_Strategy_DefaultComplexType extends Zend_Soap_Wsdl_Strategy_Abstract
+{
+ /**
+ * Add a complex type by recursivly using all the class properties fetched via Reflection.
+ *
+ * @param string $type Name of the class to be specified
+ * @return string XSD Type for the given PHP type
+ */
+ public function addComplexType($type)
+ {
+ if(!class_exists($type)) {
+ throw new Zend_Soap_Wsdl_Exception(sprintf(
+ "Cannot add a complex type %s that is not an object or where ".
+ "class could not be found in 'DefaultComplexType' strategy.", $type
+ ));
+ }
+
+ $dom = $this->getContext()->toDomDocument();
+ $class = new ReflectionClass($type);
+
+ $defaultProperties = $class->getDefaultProperties();
+
+ $complexType = $dom->createElement('xsd:complexType');
+ $complexType->setAttribute('name', $type);
+
+ $all = $dom->createElement('xsd:all');
+
+ foreach ($class->getProperties() as $property) {
+ if ($property->isPublic() && preg_match_all('/@var\s+([^\s]+)/m', $property->getDocComment(), $matches)) {
+
+ /**
+ * @todo check if 'xsd:element' must be used here (it may not be compatible with using 'complexType'
+ * node for describing other classes used as attribute types for current class
+ */
+ $element = $dom->createElement('xsd:element');
+ $element->setAttribute('name', $propertyName = $property->getName());
+ $element->setAttribute('type', $this->getContext()->getType(trim($matches[1][0])));
+
+ // If the default value is null, then this property is nillable.
+ if ($defaultProperties[$propertyName] === null) {
+ $element->setAttribute('nillable', 'true');
+ }
+
+ $all->appendChild($element);
+ }
+ }
+
+ $complexType->appendChild($all);
+ $this->getContext()->getSchema()->appendChild($complexType);
+ $this->getContext()->addType($type);
+
+ return "tns:$type";
+ }
+}
diff --git a/library/vendor/Zend/Soap/Wsdl/Strategy/Interface.php b/library/vendor/Zend/Soap/Wsdl/Strategy/Interface.php
new file mode 100644
index 0000000..9a57605
--- /dev/null
+++ b/library/vendor/Zend/Soap/Wsdl/Strategy/Interface.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Wsdl
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Interface for Zend_Soap_Wsdl_Strategy.
+ *
+ * @category Zend
+ * @package Zend_Soap
+ * @subpackage Wsdl
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Soap_Wsdl_Strategy_Interface
+{
+ /**
+ * Method accepts the current WSDL context file.
+ *
+ * @param <type> $context
+ */
+ public function setContext(Zend_Soap_Wsdl $context);
+
+ /**
+ * Create a complex type based on a strategy
+ *
+ * @param string $type
+ * @return string XSD type
+ */
+ public function addComplexType($type);
+}
diff --git a/library/vendor/Zend/TimeSync.php b/library/vendor/Zend/TimeSync.php
new file mode 100644
index 0000000..5b05c4b
--- /dev/null
+++ b/library/vendor/Zend/TimeSync.php
@@ -0,0 +1,296 @@
+<?php
+
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_TimeSync
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * Zend_Date
+ */
+
+/**
+ * @category Zend
+ * @package Zend_TimeSync
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_TimeSync implements IteratorAggregate
+{
+ /**
+ * Set the default timeserver protocol to "Ntp". This will be called
+ * when no protocol is specified
+ */
+ const DEFAULT_PROTOCOL = 'Ntp';
+
+ /**
+ * Contains array of timeserver objects
+ *
+ * @var array
+ */
+ protected $_timeservers = array();
+
+ /**
+ * Holds a reference to the timeserver that is currently being used
+ *
+ * @var object
+ */
+ protected $_current;
+
+ /**
+ * Allowed timeserver schemes
+ *
+ * @var array
+ */
+ protected $_allowedSchemes = array(
+ 'Ntp',
+ 'Sntp'
+ );
+
+ /**
+ * Configuration array, set using the constructor or using
+ * ::setOptions() or ::setOption()
+ *
+ * @var array
+ */
+ public static $options = array(
+ 'timeout' => 1
+ );
+
+ /**
+ * Zend_TimeSync constructor
+ *
+ * @param string|array $target - OPTIONAL single timeserver, or an array of timeservers.
+ * @param string $alias - OPTIONAL an alias for this timeserver
+ * @return object
+ */
+ public function __construct($target = null, $alias = null)
+ {
+ if ($target !== null) {
+ $this->addServer($target, $alias);
+ }
+ }
+
+ /**
+ * getIterator() - return an iteratable object for use in foreach and the like,
+ * this completes the IteratorAggregate interface
+ *
+ * @return ArrayObject
+ */
+ public function getIterator()
+ {
+ return new ArrayObject($this->_timeservers);
+ }
+
+ /**
+ * Add a timeserver or multiple timeservers
+ *
+ * Server should be a single string representation of a timeserver,
+ * or a structured array listing multiple timeservers.
+ *
+ * If you provide an array of timeservers in the $target variable,
+ * $alias will be ignored. you can enter these as the array key
+ * in the provided array, which should be structured as follows:
+ *
+ * <code>
+ * $example = array(
+ * 'server_a' => 'ntp://127.0.0.1',
+ * 'server_b' => 'ntp://127.0.0.1:123',
+ * 'server_c' => 'ntp://[2000:364:234::2.5]',
+ * 'server_d' => 'ntp://[2000:364:234::2.5]:123'
+ * );
+ * </code>
+ *
+ * If no port number has been suplied, the default matching port
+ * number will be used.
+ *
+ * Supported protocols are:
+ * - ntp
+ * - sntp
+ *
+ * @param string|array $target - Single timeserver, or an array of timeservers.
+ * @param string $alias - OPTIONAL an alias for this timeserver
+ * @throws Zend_TimeSync_Exception
+ */
+ public function addServer($target, $alias = null)
+ {
+ if (is_array($target)) {
+ foreach ($target as $key => $server) {
+ $this->_addServer($server, $key);
+ }
+ } else {
+ $this->_addServer($target, $alias);
+ }
+ }
+
+ /**
+ * Sets the value for the given options
+ *
+ * This will replace any currently defined options.
+ *
+ * @param array $options - An array of options to be set
+ */
+ public static function setOptions(array $options)
+ {
+ foreach ($options as $key => $value) {
+ Zend_TimeSync::$options[$key] = $value;
+ }
+ }
+
+ /**
+ * Marks a nameserver as current
+ *
+ * @param string|integer $alias - The alias from the timeserver to set as current
+ * @throws Zend_TimeSync_Exception
+ */
+ public function setServer($alias)
+ {
+ if (isset($this->_timeservers[$alias]) === true) {
+ $this->_current = $this->_timeservers[$alias];
+ } else {
+ throw new Zend_TimeSync_Exception("'$alias' does not point to valid timeserver");
+ }
+ }
+
+ /**
+ * Returns the value to the option
+ *
+ * @param string $key - The option's identifier
+ * @return mixed
+ * @throws Zend_TimeSync_Exception
+ */
+ public static function getOptions($key = null)
+ {
+ if ($key == null) {
+ return Zend_TimeSync::$options;
+ }
+
+ if (isset(Zend_TimeSync::$options[$key]) === true) {
+ return Zend_TimeSync::$options[$key];
+ } else {
+ throw new Zend_TimeSync_Exception("'$key' does not point to valid option");
+ }
+ }
+
+ /**
+ * Return a specified timeserver by alias
+ * If no alias is given it will return the current timeserver
+ *
+ * @param string|integer $alias - The alias from the timeserver to return
+ * @return object
+ * @throws Zend_TimeSync_Exception
+ */
+ public function getServer($alias = null)
+ {
+ if ($alias === null) {
+ if (isset($this->_current) && $this->_current !== false) {
+ return $this->_current;
+ } else {
+ throw new Zend_TimeSync_Exception('there is no timeserver set');
+ }
+ }
+ if (isset($this->_timeservers[$alias]) === true) {
+ return $this->_timeservers[$alias];
+ } else {
+ throw new Zend_TimeSync_Exception("'$alias' does not point to valid timeserver");
+ }
+ }
+
+ /**
+ * Returns information sent/returned from the current timeserver
+ *
+ * @return array
+ */
+ public function getInfo()
+ {
+ return $this->getServer()->getInfo();
+ }
+
+ /**
+ * Query the timeserver list using the fallback mechanism
+ *
+ * If there are multiple servers listed, this method will act as a
+ * facade and will try to return the date from the first server that
+ * returns a valid result.
+ *
+ * @param Zend_Locale $locale - OPTIONAL locale
+ * @return object
+ * @throws Zend_TimeSync_Exception
+ */
+ public function getDate($locale = null)
+ {
+ foreach ($this->_timeservers as $alias => $server) {
+ $this->_current = $server;
+ try {
+ return $server->getDate($locale);
+ } catch (Zend_TimeSync_Exception $e) {
+ if (!isset($masterException)) {
+ $masterException = new Zend_TimeSync_Exception('all timeservers are bogus');
+ }
+ $masterException->addException($e);
+ }
+ }
+
+ throw $masterException;
+ }
+
+ /**
+ * Adds a timeserver object to the timeserver list
+ *
+ * @param string|array $target - Single timeserver, or an array of timeservers.
+ * @param string $alias - An alias for this timeserver
+ */
+ protected function _addServer($target, $alias)
+ {
+ if ($pos = strpos($target, '://')) {
+ $protocol = substr($target, 0, $pos);
+ $adress = substr($target, $pos + 3);
+ } else {
+ $adress = $target;
+ $protocol = self::DEFAULT_PROTOCOL;
+ }
+
+ if ($pos = strrpos($adress, ':')) {
+ $posbr = strpos($adress, ']');
+ if ($posbr and ($pos > $posbr)) {
+ $port = substr($adress, $pos + 1);
+ $adress = substr($adress, 0, $pos);
+ } else if (!$posbr and $pos) {
+ $port = substr($adress, $pos + 1);
+ $adress = substr($adress, 0, $pos);
+ } else {
+ $port = null;
+ }
+ } else {
+ $port = null;
+ }
+
+ $protocol = ucfirst(strtolower($protocol));
+ if (!in_array($protocol, $this->_allowedSchemes)) {
+ throw new Zend_TimeSync_Exception("'$protocol' is not a supported protocol");
+ }
+
+ $className = 'Zend_TimeSync_' . $protocol;
+ if (!class_exists($className)) {
+ Zend_Loader::loadClass($className);
+ }
+ $timeServerObj = new $className($adress, $port);
+
+ $this->_timeservers[$alias] = $timeServerObj;
+ }
+}
diff --git a/library/vendor/Zend/TimeSync/Exception.php b/library/vendor/Zend/TimeSync/Exception.php
new file mode 100644
index 0000000..c1a33e4
--- /dev/null
+++ b/library/vendor/Zend/TimeSync/Exception.php
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_TimeSync
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_Exception
+ */
+
+/**
+ * Exception class for Zend_TimeSync
+ *
+ * @category Zend
+ * @package Zend_TimeSync
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_TimeSync_Exception extends Zend_Exception
+{
+ /**
+ * Contains array of exceptions thrown in queried server
+ *
+ * @var array
+ */
+ protected $_exceptions;
+
+ /**
+ * Adds an exception to the exception list
+ *
+ * @param Zend_TimeSync_Exception $exception New exteption to throw
+ * @return void
+ */
+ public function addException(Zend_TimeSync_Exception $exception)
+ {
+ $this->_exceptions[] = $exception;
+ }
+
+ /**
+ * Returns an array of exceptions that were thrown
+ *
+ * @return array
+ */
+ public function get()
+ {
+ return $this->_exceptions;
+ }
+}
diff --git a/library/vendor/Zend/TimeSync/Ntp.php b/library/vendor/Zend/TimeSync/Ntp.php
new file mode 100644
index 0000000..0c52530
--- /dev/null
+++ b/library/vendor/Zend/TimeSync/Ntp.php
@@ -0,0 +1,430 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_TimeSync
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_TimeSync_Protocol
+ */
+
+/**
+ * NTP Protocol handling class
+ *
+ * @category Zend
+ * @package Zend_TimeSync
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_TimeSync_Ntp extends Zend_TimeSync_Protocol
+{
+ /**
+ * NTP port number (123) assigned by the Internet Assigned Numbers Authority
+ *
+ * @var integer
+ */
+ protected $_port = 123;
+
+ /**
+ * NTP class constructor, sets the timeserver and port number
+ *
+ * @param string $timeserver Adress of the timeserver to connect to
+ * @param integer $port (Optional) Port for this timeserver
+ */
+ public function __construct($timeserver, $port = 123)
+ {
+ $this->_timeserver = 'udp://' . $timeserver;
+ if ($port !== null) {
+ $this->_port = $port;
+ }
+ }
+
+ /**
+ * Prepare local timestamp for transmission in our request packet
+ *
+ * NTP timestamps are represented as a 64-bit fixed-point number, in
+ * seconds relative to 0000 UT on 1 January 1900. The integer part is
+ * in the first 32 bits and the fraction part in the last 32 bits
+ *
+ * @return string
+ */
+ protected function _prepare()
+ {
+ $frac = microtime();
+ $fracba = ($frac & 0xff000000) >> 24;
+ $fracbb = ($frac & 0x00ff0000) >> 16;
+ $fracbc = ($frac & 0x0000ff00) >> 8;
+ $fracbd = ($frac & 0x000000ff);
+
+ $sec = (time() + 2208988800);
+ $secba = ($sec & 0xff000000) >> 24;
+ $secbb = ($sec & 0x00ff0000) >> 16;
+ $secbc = ($sec & 0x0000ff00) >> 8;
+ $secbd = ($sec & 0x000000ff);
+
+ // Flags
+ $nul = chr(0x00);
+ $nulbyte = $nul . $nul . $nul . $nul;
+ $ntppacket = chr(0xd9) . $nul . chr(0x0a) . chr(0xfa);
+
+ /*
+ * Root delay
+ *
+ * Indicates the total roundtrip delay to the primary reference
+ * source at the root of the synchronization subnet, in seconds
+ */
+ $ntppacket .= $nul . $nul . chr(0x1c) . chr(0x9b);
+
+ /*
+ * Clock Dispersion
+ *
+ * Indicates the maximum error relative to the primary reference source at the
+ * root of the synchronization subnet, in seconds
+ */
+ $ntppacket .= $nul . chr(0x08) . chr(0xd7) . chr(0xff);
+
+ /*
+ * ReferenceClockID
+ *
+ * Identifying the particular reference clock
+ */
+ $ntppacket .= $nulbyte;
+
+ /*
+ * The local time, in timestamp format, at the peer when its latest NTP message
+ * was sent. Contanis an integer and a fractional part
+ */
+ $ntppacket .= chr($secba) . chr($secbb) . chr($secbc) . chr($secbd);
+ $ntppacket .= chr($fracba) . chr($fracbb) . chr($fracbc) . chr($fracbd);
+
+ /*
+ * The local time, in timestamp format, at the peer. Contains an integer
+ * and a fractional part.
+ */
+ $ntppacket .= $nulbyte;
+ $ntppacket .= $nulbyte;
+
+ /*
+ * This is the local time, in timestamp format, when the latest NTP message from
+ * the peer arrived. Contanis an integer and a fractional part.
+ */
+ $ntppacket .= $nulbyte;
+ $ntppacket .= $nulbyte;
+
+ /*
+ * The local time, in timestamp format, at which the
+ * NTP message departed the sender. Contanis an integer
+ * and a fractional part.
+ */
+ $ntppacket .= chr($secba) . chr($secbb) . chr($secbc) . chr($secbd);
+ $ntppacket .= chr($fracba) . chr($fracbb) . chr($fracbc) . chr($fracbd);
+
+ return $ntppacket;
+ }
+
+ /**
+ * Calculates a 32bit integer
+ *
+ * @param string $input
+ * @return integer
+ */
+ protected function _getInteger($input)
+ {
+ $f1 = str_pad(ord($input[0]), 2, '0', STR_PAD_LEFT);
+ $f1 .= str_pad(ord($input[1]), 2, '0', STR_PAD_LEFT);
+ $f1 .= str_pad(ord($input[2]), 2, '0', STR_PAD_LEFT);
+ $f1 .= str_pad(ord($input[3]), 2, '0', STR_PAD_LEFT);
+ return (int) $f1;
+ }
+
+ /**
+ * Calculates a 32bit signed fixed point number
+ *
+ * @param string $input
+ * @return float
+ */
+ protected function _getFloat($input)
+ {
+ $f1 = str_pad(ord($input[0]), 2, '0', STR_PAD_LEFT);
+ $f1 .= str_pad(ord($input[1]), 2, '0', STR_PAD_LEFT);
+ $f1 .= str_pad(ord($input[2]), 2, '0', STR_PAD_LEFT);
+ $f1 .= str_pad(ord($input[3]), 2, '0', STR_PAD_LEFT);
+ $f2 = $f1 >> 17;
+ $f3 = ($f1 & 0x0001FFFF);
+ $f1 = $f2 . '.' . $f3;
+ return (float) $f1;
+ }
+
+ /**
+ * Calculates a 64bit timestamp
+ *
+ * @param string $input
+ * @return float
+ */
+ protected function _getTimestamp($input)
+ {
+ $f1 = (ord($input[0]) * pow(256, 3));
+ $f1 += (ord($input[1]) * pow(256, 2));
+ $f1 += (ord($input[2]) * pow(256, 1));
+ $f1 += (ord($input[3]));
+ $f1 -= 2208988800;
+
+ $f2 = (ord($input[4]) * pow(256, 3));
+ $f2 += (ord($input[5]) * pow(256, 2));
+ $f2 += (ord($input[6]) * pow(256, 1));
+ $f2 += (ord($input[7]));
+
+ return (float) ($f1 . "." . $f2);
+ }
+
+ /**
+ * Reads the data returned from the timeserver
+ *
+ * This will return an array with binary data listing:
+ *
+ * @return array
+ * @throws Zend_TimeSync_Exception When timeserver can not be connected
+ */
+ protected function _read()
+ {
+ $flags = ord(fread($this->_socket, 1));
+ $info = stream_get_meta_data($this->_socket);
+
+ if ($info['timed_out'] === true) {
+ fclose($this->_socket);
+ throw new Zend_TimeSync_Exception('could not connect to ' .
+ "'$this->_timeserver' on port '$this->_port', reason: 'server timed out'");
+ }
+
+ $result = array(
+ 'flags' => $flags,
+ 'stratum' => ord(fread($this->_socket, 1)),
+ 'poll' => ord(fread($this->_socket, 1)),
+ 'precision' => ord(fread($this->_socket, 1)),
+ 'rootdelay' => $this->_getFloat(fread($this->_socket, 4)),
+ 'rootdispersion' => $this->_getFloat(fread($this->_socket, 4)),
+ 'referenceid' => fread($this->_socket, 4),
+ 'referencestamp' => $this->_getTimestamp(fread($this->_socket, 8)),
+ 'originatestamp' => $this->_getTimestamp(fread($this->_socket, 8)),
+ 'receivestamp' => $this->_getTimestamp(fread($this->_socket, 8)),
+ 'transmitstamp' => $this->_getTimestamp(fread($this->_socket, 8)),
+ 'clientreceived' => microtime(true)
+ );
+
+ $this->_disconnect();
+ return $result;
+ }
+
+ /**
+ * Sends the NTP packet to the server
+ *
+ * @param string $data Data to send to the timeserver
+ * @return void
+ */
+ protected function _write($data)
+ {
+ $this->_connect();
+
+ fwrite($this->_socket, $data);
+ stream_set_timeout($this->_socket, Zend_TimeSync::$options['timeout']);
+ }
+
+ /**
+ * Extracts the binary data returned from the timeserver
+ *
+ * @param string|array $binary Data returned from the timeserver
+ * @return integer Difference in seconds
+ */
+ protected function _extract($binary)
+ {
+ /*
+ * Leap Indicator bit 1100 0000
+ *
+ * Code warning of impending leap-second to be inserted at the end of
+ * the last day of the current month.
+ */
+ $leap = ($binary['flags'] & 0xc0) >> 6;
+ switch($leap) {
+ case 0:
+ $this->_info['leap'] = '0 - no warning';
+ break;
+
+ case 1:
+ $this->_info['leap'] = '1 - last minute has 61 seconds';
+ break;
+
+ case 2:
+ $this->_info['leap'] = '2 - last minute has 59 seconds';
+ break;
+
+ default:
+ $this->_info['leap'] = '3 - not syncronised';
+ break;
+ }
+
+ /*
+ * Version Number bit 0011 1000
+ *
+ * This should be 3 (RFC 1305)
+ */
+ $this->_info['version'] = ($binary['flags'] & 0x38) >> 3;
+
+ /*
+ * Mode bit 0000 0111
+ *
+ * Except in broadcast mode, an NTP association is formed when two peers
+ * exchange messages and one or both of them create and maintain an
+ * instantiation of the protocol machine, called an association.
+ */
+ $mode = ($binary['flags'] & 0x07);
+ switch($mode) {
+ case 1:
+ $this->_info['mode'] = 'symetric active';
+ break;
+
+ case 2:
+ $this->_info['mode'] = 'symetric passive';
+ break;
+
+ case 3:
+ $this->_info['mode'] = 'client';
+ break;
+
+ case 4:
+ $this->_info['mode'] = 'server';
+ break;
+
+ case 5:
+ $this->_info['mode'] = 'broadcast';
+ break;
+
+ default:
+ $this->_info['mode'] = 'reserved';
+ break;
+ }
+
+ $ntpserviceid = 'Unknown Stratum ' . $binary['stratum'] . ' Service';
+
+ /*
+ * Reference Clock Identifier
+ *
+ * Identifies the particular reference clock.
+ */
+ $refid = strtoupper($binary['referenceid']);
+ switch($binary['stratum']) {
+ case 0:
+ if (substr($refid, 0, 3) === 'DCN') {
+ $ntpserviceid = 'DCN routing protocol';
+ } else if (substr($refid, 0, 4) === 'NIST') {
+ $ntpserviceid = 'NIST public modem';
+ } else if (substr($refid, 0, 3) === 'TSP') {
+ $ntpserviceid = 'TSP time protocol';
+ } else if (substr($refid, 0, 3) === 'DTS') {
+ $ntpserviceid = 'Digital Time Service';
+ }
+ break;
+
+ case 1:
+ if (substr($refid, 0, 4) === 'ATOM') {
+ $ntpserviceid = 'Atomic Clock (calibrated)';
+ } else if (substr($refid, 0, 3) === 'VLF') {
+ $ntpserviceid = 'VLF radio';
+ } else if ($refid === 'CALLSIGN') {
+ $ntpserviceid = 'Generic radio';
+ } else if (substr($refid, 0, 4) === 'LORC') {
+ $ntpserviceid = 'LORAN-C radionavigation';
+ } else if (substr($refid, 0, 4) === 'GOES') {
+ $ntpserviceid = 'GOES UHF environment satellite';
+ } else if (substr($refid, 0, 3) === 'GPS') {
+ $ntpserviceid = 'GPS UHF satellite positioning';
+ }
+ break;
+
+ default:
+ $ntpserviceid = ord(substr($binary['referenceid'], 0, 1));
+ $ntpserviceid .= '.';
+ $ntpserviceid .= ord(substr($binary['referenceid'], 1, 1));
+ $ntpserviceid .= '.';
+ $ntpserviceid .= ord(substr($binary['referenceid'], 2, 1));
+ $ntpserviceid .= '.';
+ $ntpserviceid .= ord(substr($binary['referenceid'], 3, 1));
+ break;
+ }
+
+ $this->_info['ntpid'] = $ntpserviceid;
+
+ /*
+ * Stratum
+ *
+ * Indicates the stratum level of the local clock
+ */
+ switch($binary['stratum']) {
+ case 0:
+ $this->_info['stratum'] = 'undefined';
+ break;
+
+ case 1:
+ $this->_info['stratum'] = 'primary reference';
+ break;
+
+ default:
+ $this->_info['stratum'] = 'secondary reference';
+ break;
+ }
+
+ /*
+ * Indicates the total roundtrip delay to the primary reference source at the
+ * root of the synchronization subnet, in seconds.
+ *
+ * Both positive and negative values, depending on clock precision and skew, are
+ * possible.
+ */
+ $this->_info['rootdelay'] = $binary['rootdelay'];
+
+ /*
+ * Indicates the maximum error relative to the primary reference source at the
+ * root of the synchronization subnet, in seconds.
+ *
+ * Only positive values greater than zero are possible.
+ */
+ $this->_info['rootdispersion'] = $binary['rootdispersion'];
+
+ /*
+ * The roundtrip delay of the peer clock relative to the local clock
+ * over the network path between them, in seconds.
+ *
+ * Note that this variable can take on both positive and negative values,
+ * depending on clock precision and skew-error accumulation.
+ */
+ $this->_info['roundtrip'] = $binary['receivestamp'];
+ $this->_info['roundtrip'] -= $binary['originatestamp'];
+ $this->_info['roundtrip'] -= $binary['transmitstamp'];
+ $this->_info['roundtrip'] += $binary['clientreceived'];
+ $this->_info['roundtrip'] /= 2;
+
+ // The offset of the peer clock relative to the local clock, in seconds.
+ $this->_info['offset'] = $binary['receivestamp'];
+ $this->_info['offset'] -= $binary['originatestamp'];
+ $this->_info['offset'] += $binary['transmitstamp'];
+ $this->_info['offset'] -= $binary['clientreceived'];
+ $this->_info['offset'] /= 2;
+ $time = (time() - $this->_info['offset']);
+
+ return $time;
+ }
+}
diff --git a/library/vendor/Zend/TimeSync/Protocol.php b/library/vendor/Zend/TimeSync/Protocol.php
new file mode 100644
index 0000000..12dc6d9
--- /dev/null
+++ b/library/vendor/Zend/TimeSync/Protocol.php
@@ -0,0 +1,148 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_TimeSync
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Abstract class definition for all timeserver protocols
+ *
+ * @category Zend
+ * @package Zend_TimeSync
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_TimeSync_Protocol
+{
+ /**
+ * Holds the current socket connection
+ *
+ * @var array
+ */
+ protected $_socket;
+
+ /**
+ * Exceptions that might have occured
+ *
+ * @var array
+ */
+ protected $_exceptions;
+
+ /**
+ * Hostname for timeserver
+ *
+ * @var string
+ */
+ protected $_timeserver;
+
+ /**
+ * Holds information passed/returned from timeserver
+ *
+ * @var array
+ */
+ protected $_info = array();
+
+ /**
+ * Abstract method that prepares the data to send to the timeserver
+ *
+ * @return mixed
+ */
+ abstract protected function _prepare();
+
+ /**
+ * Abstract method that reads the data returned from the timeserver
+ *
+ * @return mixed
+ */
+ abstract protected function _read();
+
+ /**
+ * Abstract method that writes data to to the timeserver
+ *
+ * @param string $data Data to write
+ * @return void
+ */
+ abstract protected function _write($data);
+
+ /**
+ * Abstract method that extracts the binary data returned from the timeserver
+ *
+ * @param string|array $data Data returned from the timeserver
+ * @return integer
+ */
+ abstract protected function _extract($data);
+
+ /**
+ * Connect to the specified timeserver.
+ *
+ * @return void
+ * @throws Zend_TimeSync_Exception When the connection failed
+ */
+ protected function _connect()
+ {
+ $socket = @fsockopen($this->_timeserver, $this->_port, $errno, $errstr,
+ Zend_TimeSync::$options['timeout']);
+ if ($socket === false) {
+ throw new Zend_TimeSync_Exception('could not connect to ' .
+ "'$this->_timeserver' on port '$this->_port', reason: '$errstr'");
+ }
+
+ $this->_socket = $socket;
+ }
+
+ /**
+ * Disconnects from the peer, closes the socket.
+ *
+ * @return void
+ */
+ protected function _disconnect()
+ {
+ @fclose($this->_socket);
+ $this->_socket = null;
+ }
+
+ /**
+ * Return information sent/returned from the timeserver
+ *
+ * @return array
+ */
+ public function getInfo()
+ {
+ if (empty($this->_info) === true) {
+ $this->_write($this->_prepare());
+ $timestamp = $this->_extract($this->_read());
+ }
+
+ return $this->_info;
+ }
+
+ /**
+ * Query this timeserver without using the fallback mechanism
+ *
+ * @param string|Zend_Locale $locale (Optional) Locale
+ * @return Zend_Date
+ */
+ public function getDate($locale = null)
+ {
+ $this->_write($this->_prepare());
+ $timestamp = $this->_extract($this->_read());
+
+ $date = new Zend_Date($this, null, $locale);
+ return $date;
+ }
+}
diff --git a/library/vendor/Zend/TimeSync/Sntp.php b/library/vendor/Zend/TimeSync/Sntp.php
new file mode 100644
index 0000000..6ad0a5e
--- /dev/null
+++ b/library/vendor/Zend/TimeSync/Sntp.php
@@ -0,0 +1,118 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_TimeSync
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Zend_TimeSync_Protocol
+ */
+
+/**
+ * SNTP Protocol handling class
+ *
+ * @category Zend
+ * @package Zend_TimeSync
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_TimeSync_Sntp extends Zend_TimeSync_Protocol
+{
+ /**
+ * Port number for this timeserver
+ *
+ * @var integer
+ */
+ protected $_port = 37;
+
+ /**
+ * Socket delay
+ *
+ * @var integer
+ */
+ private $_delay;
+
+ /**
+ * Class constructor, sets the timeserver and port number
+ *
+ * @param string $timeserver Timeserver to connect to
+ * @param integer $port Port of the timeserver when it differs from the default port
+ */
+ public function __construct($timeserver, $port)
+ {
+ $this->_timeserver = 'udp://' . $timeserver;
+ if ($port !== null) {
+ $this->_port = $port;
+ }
+ }
+
+ /**
+ * Prepares the data that will be send to the timeserver
+ *
+ * @return array
+ */
+ protected function _prepare()
+ {
+ return "\n";
+ }
+
+ /**
+ * Reads the data returned from the timeserver
+ *
+ * @return string
+ */
+ protected function _read()
+ {
+ $result = fread($this->_socket, 49);
+ $this->_delay = (($this->_delay - time()) / 2);
+
+ return $result;
+ }
+
+ /**
+ * Writes data to to the timeserver
+ *
+ * @param string $data Data to write to the timeserver
+ * @return void
+ */
+ protected function _write($data)
+ {
+ $this->_connect();
+ $this->_delay = time();
+ fputs($this->_socket, $data);
+ }
+
+ /**
+ * Extracts the data returned from the timeserver
+ *
+ * @param string $result Data to extract
+ * @return integer
+ */
+ protected function _extract($result)
+ {
+ $dec = hexdec('7fffffff');
+ $time = abs(($dec - hexdec(bin2hex($result))) - $dec);
+ $time -= 2208988800;
+ // Socket delay
+ $time -= $this->_delay;
+
+ $this->_info['offset'] = $this->_delay;
+
+ return $time;
+ }
+}
diff --git a/library/vendor/Zend/Translate.php b/library/vendor/Zend/Translate.php
new file mode 100644
index 0000000..de9f530
--- /dev/null
+++ b/library/vendor/Zend/Translate.php
@@ -0,0 +1,220 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Translate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Loader
+ */
+
+/**
+ * @see Zend_Translate_Adapter
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Translate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Translate {
+ /**
+ * Adapter names constants
+ */
+ const AN_ARRAY = 'Array';
+ const AN_CSV = 'Csv';
+ const AN_GETTEXT = 'Gettext';
+ const AN_INI = 'Ini';
+ const AN_QT = 'Qt';
+ const AN_TBX = 'Tbx';
+ const AN_TMX = 'Tmx';
+ const AN_XLIFF = 'Xliff';
+ const AN_XMLTM = 'XmlTm';
+
+ const LOCALE_DIRECTORY = 'directory';
+ const LOCALE_FILENAME = 'filename';
+
+ /**
+ * Adapter
+ *
+ * @var Zend_Translate_Adapter
+ */
+ private $_adapter;
+
+ /**
+ * Generates the standard translation object
+ *
+ * @param array|Zend_Config|Zend_Translate_Adapter $options Options to use
+ * @param string|array [$content] Path to content, or content itself
+ * @param string|Zend_Locale [$locale]
+ * @throws Zend_Translate_Exception
+ */
+ public function __construct($options = array())
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (func_num_args() > 1) {
+ $args = func_get_args();
+ $options = array();
+ $options['adapter'] = array_shift($args);
+ if (!empty($args)) {
+ $options['content'] = array_shift($args);
+ }
+
+ if (!empty($args)) {
+ $options['locale'] = array_shift($args);
+ }
+
+ if (!empty($args)) {
+ $opt = array_shift($args);
+ $options = array_merge($opt, $options);
+ }
+ } else if (!is_array($options)) {
+ $options = array('adapter' => $options);
+ }
+
+ $this->setAdapter($options);
+ }
+
+ /**
+ * Sets a new adapter
+ *
+ * @param array|Zend_Config|Zend_Translate_Adapter $options Options to use
+ * @param string|array [$content] Path to content, or content itself
+ * @param string|Zend_Locale [$locale]
+ * @throws Zend_Translate_Exception
+ */
+ public function setAdapter($options = array())
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (func_num_args() > 1) {
+ $args = func_get_args();
+ $options = array();
+ $options['adapter'] = array_shift($args);
+ if (!empty($args)) {
+ $options['content'] = array_shift($args);
+ }
+
+ if (!empty($args)) {
+ $options['locale'] = array_shift($args);
+ }
+
+ if (!empty($args)) {
+ $opt = array_shift($args);
+ $options = array_merge($opt, $options);
+ }
+ } else if (!is_array($options)) {
+ $options = array('adapter' => $options);
+ }
+
+ if (Zend_Loader::isReadable('Zend/Translate/Adapter/' . ucfirst($options['adapter']). '.php')) {
+ $options['adapter'] = 'Zend_Translate_Adapter_' . ucfirst($options['adapter']);
+ }
+
+ if (!class_exists($options['adapter'])) {
+ Zend_Loader::loadClass($options['adapter']);
+ }
+
+ if (array_key_exists('cache', $options)) {
+ Zend_Translate_Adapter::setCache($options['cache']);
+ }
+
+ $adapter = $options['adapter'];
+ unset($options['adapter']);
+ $this->_adapter = new $adapter($options);
+ if (!$this->_adapter instanceof Zend_Translate_Adapter) {
+ throw new Zend_Translate_Exception("Adapter " . $adapter . " does not extend Zend_Translate_Adapter");
+ }
+ }
+
+ /**
+ * Returns the adapters name and it's options
+ *
+ * @return Zend_Translate_Adapter
+ */
+ public function getAdapter()
+ {
+ return $this->_adapter;
+ }
+
+ /**
+ * Returns the set cache
+ *
+ * @return Zend_Cache_Core The set cache
+ */
+ public static function getCache()
+ {
+ return Zend_Translate_Adapter::getCache();
+ }
+
+ /**
+ * Sets a cache for all instances of Zend_Translate
+ *
+ * @param Zend_Cache_Core $cache Cache to store to
+ * @return void
+ */
+ public static function setCache(Zend_Cache_Core $cache)
+ {
+ Zend_Translate_Adapter::setCache($cache);
+ }
+
+ /**
+ * Returns true when a cache is set
+ *
+ * @return boolean
+ */
+ public static function hasCache()
+ {
+ return Zend_Translate_Adapter::hasCache();
+ }
+
+ /**
+ * Removes any set cache
+ *
+ * @return void
+ */
+ public static function removeCache()
+ {
+ Zend_Translate_Adapter::removeCache();
+ }
+
+ /**
+ * Clears all set cache data
+ *
+ * @param string $tag Tag to clear when the default tag name is not used
+ * @return void
+ */
+ public static function clearCache($tag = null)
+ {
+ Zend_Translate_Adapter::clearCache($tag);
+ }
+
+ /**
+ * Calls all methods from the adapter
+ */
+ public function __call($method, array $options)
+ {
+ if (method_exists($this->_adapter, $method)) {
+ return call_user_func_array(array($this->_adapter, $method), $options);
+ }
+ throw new Zend_Translate_Exception("Unknown method '" . $method . "' called!");
+ }
+}
diff --git a/library/vendor/Zend/Translate/Adapter.php b/library/vendor/Zend/Translate/Adapter.php
new file mode 100644
index 0000000..f21ef3c
--- /dev/null
+++ b/library/vendor/Zend/Translate/Adapter.php
@@ -0,0 +1,988 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Translate
+ * @subpackage Zend_Translate_Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Locale
+ */
+
+/**
+ * @see Zend_Translate_Plural
+ */
+
+/**
+ * Basic adapter class for each translation source adapter
+ *
+ * @category Zend
+ * @package Zend_Translate
+ * @subpackage Zend_Translate_Adapter
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Translate_Adapter {
+ /**
+ * Shows if locale detection is in automatic level
+ * @var boolean
+ */
+ private $_automatic = true;
+
+ /**
+ * Internal value to see already routed languages
+ * @var array()
+ */
+ private $_routed = array();
+
+ /**
+ * Internal cache for all adapters
+ * @var Zend_Cache_Core
+ */
+ protected static $_cache = null;
+
+ /**
+ * Internal value to remember if cache supports tags
+ *
+ * @var boolean
+ */
+ private static $_cacheTags = false;
+
+ /**
+ * Scans for the locale within the name of the directory
+ * @constant integer
+ */
+ const LOCALE_DIRECTORY = 'directory';
+
+ /**
+ * Scans for the locale within the name of the file
+ * @constant integer
+ */
+ const LOCALE_FILENAME = 'filename';
+
+ /**
+ * Array with all options, each adapter can have own additional options
+ * 'clear' => when true, clears already loaded translations when adding new files
+ * 'content' => content to translate or file or directory with content
+ * 'disableNotices' => when true, omits notices from being displayed
+ * 'ignore' => a prefix for files and directories which are not being added
+ * 'locale' => the actual set locale to use
+ * 'log' => a instance of Zend_Log where logs are written to
+ * 'logMessage' => message to be logged
+ * 'logPriority' => priority which is used to write the log message
+ * 'logUntranslated' => when true, untranslated messages are not logged
+ * 'reload' => reloads the cache by reading the content again
+ * 'scan' => searches for translation files using the LOCALE constants
+ * 'tag' => tag to use for the cache
+ *
+ * @var array
+ */
+ protected $_options = array(
+ 'clear' => false,
+ 'content' => null,
+ 'disableNotices' => false,
+ 'ignore' => '.',
+ 'locale' => 'auto',
+ 'log' => null,
+ 'logMessage' => "Untranslated message within '%locale%': %message%",
+ 'logPriority' => 5,
+ 'logUntranslated' => false,
+ 'reload' => false,
+ 'route' => null,
+ 'scan' => null,
+ 'tag' => 'Zend_Translate'
+ );
+
+ /**
+ * Translation table
+ * @var array
+ */
+ protected $_translate = array();
+
+ /**
+ * Generates the adapter
+ *
+ * @param string|array|Zend_Config $options Translation options for this adapter
+ * @param string|array [$content]
+ * @param string|Zend_Locale [$locale]
+ * @throws Zend_Translate_Exception
+ * @return void
+ */
+ public function __construct($options = array())
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (func_num_args() > 1) {
+ $args = func_get_args();
+ $options = array();
+ $options['content'] = array_shift($args);
+
+ if (!empty($args)) {
+ $options['locale'] = array_shift($args);
+ }
+
+ if (!empty($args)) {
+ $opt = array_shift($args);
+ $options = array_merge($opt, $options);
+ }
+ } else if (!is_array($options)) {
+ $options = array('content' => $options);
+ }
+
+ if (array_key_exists('cache', $options)) {
+ self::setCache($options['cache']);
+ unset($options['cache']);
+ }
+
+ if (isset(self::$_cache)) {
+ $id = 'Zend_Translate_' . $this->toString() . '_Options';
+ $result = self::$_cache->load($id);
+ if ($result) {
+ $this->_options = $result;
+ }
+ }
+
+ if (empty($options['locale']) || ($options['locale'] === "auto")) {
+ $this->_automatic = true;
+ } else {
+ $this->_automatic = false;
+ }
+
+ $locale = null;
+ if (!empty($options['locale'])) {
+ $locale = $options['locale'];
+ unset($options['locale']);
+ }
+
+ $this->setOptions($options);
+ $options['locale'] = $locale;
+
+ if (!empty($options['content'])) {
+ $this->addTranslation($options);
+ }
+
+ if ($this->getLocale() !== (string) $options['locale']) {
+ $this->setLocale($options['locale']);
+ }
+ }
+
+ /**
+ * Add translations
+ *
+ * This may be a new language or additional content for an existing language
+ * If the key 'clear' is true, then translations for the specified
+ * language will be replaced and added otherwise
+ *
+ * @param array|Zend_Config $options Options and translations to be added
+ * @throws Zend_Translate_Exception
+ * @return Zend_Translate_Adapter Provides fluent interface
+ */
+ public function addTranslation($options = array())
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (func_num_args() > 1) {
+ $args = func_get_args();
+ $options = array();
+ $options['content'] = array_shift($args);
+
+ if (!empty($args)) {
+ $options['locale'] = array_shift($args);
+ }
+
+ if (!empty($args)) {
+ $opt = array_shift($args);
+ $options = array_merge($opt, $options);
+ }
+ } else if (!is_array($options)) {
+ $options = array('content' => $options);
+ }
+
+ if (!isset($options['content']) || empty($options['content'])) {
+ throw new Zend_Translate_Exception("Required option 'content' is missing");
+ }
+
+ $originate = null;
+ if (!empty($options['locale'])) {
+ $originate = (string) $options['locale'];
+ }
+
+ if ((array_key_exists('log', $options)) && !($options['log'] instanceof Zend_Log)) {
+ throw new Zend_Translate_Exception('Instance of Zend_Log expected for option log');
+ }
+
+ try {
+ if (!($options['content'] instanceof Zend_Translate) && !($options['content'] instanceof Zend_Translate_Adapter)) {
+ if (empty($options['locale'])) {
+ $options['locale'] = null;
+ }
+
+ $options['locale'] = Zend_Locale::findLocale($options['locale']);
+ }
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Translate_Exception("The given Language '{$options['locale']}' does not exist", 0, $e);
+ }
+
+ $options = $options + $this->_options;
+ if (is_string($options['content']) and is_dir($options['content'])) {
+ $options['content'] = realpath($options['content']);
+ $prev = '';
+ $iterator = new RecursiveIteratorIterator(
+ new RecursiveRegexIterator(
+ new RecursiveDirectoryIterator($options['content'], RecursiveDirectoryIterator::KEY_AS_PATHNAME),
+ '/^(?!.*(\.svn|\.cvs)).*$/', RecursiveRegexIterator::MATCH
+ ),
+ RecursiveIteratorIterator::SELF_FIRST
+ );
+
+ foreach ($iterator as $directory => $info) {
+ $file = $info->getFilename();
+ if (is_array($options['ignore'])) {
+ foreach ($options['ignore'] as $key => $ignore) {
+ if (strpos($key, 'regex') !== false) {
+ if (preg_match($ignore, $directory)) {
+ // ignore files matching the given regex from option 'ignore' and all files below
+ continue 2;
+ }
+ } else if (strpos($directory, DIRECTORY_SEPARATOR . $ignore) !== false) {
+ // ignore files matching first characters from option 'ignore' and all files below
+ continue 2;
+ }
+ }
+ } else {
+ if (strpos($directory, DIRECTORY_SEPARATOR . $options['ignore']) !== false) {
+ // ignore files matching first characters from option 'ignore' and all files below
+ continue;
+ }
+ }
+
+ if ($info->isDir()) {
+ // pathname as locale
+ if (($options['scan'] === self::LOCALE_DIRECTORY) and (Zend_Locale::isLocale($file, true, false))) {
+ $options['locale'] = $file;
+ $prev = (string) $options['locale'];
+ }
+ } else if ($info->isFile()) {
+ // filename as locale
+ if ($options['scan'] === self::LOCALE_FILENAME) {
+ $filename = explode('.', $file);
+ array_pop($filename);
+ $filename = implode('.', $filename);
+ if (Zend_Locale::isLocale((string) $filename, true, false)) {
+ $options['locale'] = (string) $filename;
+ } else {
+ $parts = explode('.', $file);
+ $parts2 = array();
+ foreach($parts as $token) {
+ $parts2 += explode('_', $token);
+ }
+ $parts = array_merge($parts, $parts2);
+ $parts2 = array();
+ foreach($parts as $token) {
+ $parts2 += explode('-', $token);
+ }
+ $parts = array_merge($parts, $parts2);
+ $parts = array_unique($parts);
+ $prev = '';
+ foreach($parts as $token) {
+ if (Zend_Locale::isLocale($token, true, false)) {
+ if (strlen($prev) <= strlen($token)) {
+ $options['locale'] = $token;
+ $prev = $token;
+ }
+ }
+ }
+ }
+ }
+
+ try {
+ $options['content'] = $info->getPathname();
+ $this->_addTranslationData($options);
+ } catch (Zend_Translate_Exception $e) {
+ // ignore failed sources while scanning
+ }
+ }
+ }
+
+ unset($iterator);
+ } else {
+ $this->_addTranslationData($options);
+ }
+
+ if ((isset($this->_translate[$originate]) === true) and (count($this->_translate[$originate]) > 0)) {
+ $this->setLocale($originate);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Sets new adapter options
+ *
+ * @param array $options Adapter options
+ * @throws Zend_Translate_Exception
+ * @return Zend_Translate_Adapter Provides fluent interface
+ */
+ public function setOptions(array $options = array())
+ {
+ $change = false;
+ $locale = null;
+ foreach ($options as $key => $option) {
+ if ($key == 'locale') {
+ $locale = $option;
+ } else if ((isset($this->_options[$key]) and ($this->_options[$key] != $option)) or
+ !isset($this->_options[$key])) {
+ if (($key == 'log') && !($option instanceof Zend_Log)) {
+ throw new Zend_Translate_Exception('Instance of Zend_Log expected for option log');
+ }
+
+ if ($key == 'cache') {
+ self::setCache($option);
+ continue;
+ }
+
+ $this->_options[$key] = $option;
+ $change = true;
+ }
+ }
+
+ if ($locale !== null) {
+ $this->setLocale($locale);
+ }
+
+ if (isset(self::$_cache) and ($change == true)) {
+ $id = 'Zend_Translate_' . $this->toString() . '_Options';
+ if (self::$_cacheTags) {
+ self::$_cache->save($this->_options, $id, array($this->_options['tag']));
+ } else {
+ self::$_cache->save($this->_options, $id);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns the adapters name and it's options
+ *
+ * @param string|null $optionKey String returns this option
+ * null returns all options
+ * @return integer|string|array|null
+ */
+ public function getOptions($optionKey = null)
+ {
+ if ($optionKey === null) {
+ return $this->_options;
+ }
+
+ if (isset($this->_options[$optionKey]) === true) {
+ return $this->_options[$optionKey];
+ }
+
+ return null;
+ }
+
+ /**
+ * Gets locale
+ *
+ * @return Zend_Locale|string|null
+ */
+ public function getLocale()
+ {
+ return $this->_options['locale'];
+ }
+
+ /**
+ * Sets locale
+ *
+ * @param string|Zend_Locale $locale Locale to set
+ * @throws Zend_Translate_Exception
+ * @return Zend_Translate_Adapter Provides fluent interface
+ */
+ public function setLocale($locale)
+ {
+ if (($locale === "auto") or ($locale === null)) {
+ $this->_automatic = true;
+ } else {
+ $this->_automatic = false;
+ }
+
+ try {
+ $locale = Zend_Locale::findLocale($locale);
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Translate_Exception("The given Language ({$locale}) does not exist", 0, $e);
+ }
+
+ if (!isset($this->_translate[$locale])) {
+ $temp = explode('_', $locale);
+ if (!isset($this->_translate[$temp[0]]) and !isset($this->_translate[$locale])) {
+ if (!$this->_options['disableNotices']) {
+ if ($this->_options['log']) {
+ $this->_options['log']->log("The language '{$locale}' has to be added before it can be used.", $this->_options['logPriority']);
+ } else {
+ trigger_error("The language '{$locale}' has to be added before it can be used.", E_USER_NOTICE);
+ }
+ }
+ }
+
+ $locale = $temp[0];
+ }
+
+ if (empty($this->_translate[$locale])) {
+ if (!$this->_options['disableNotices']) {
+ if ($this->_options['log']) {
+ $this->_options['log']->log("No translation for the language '{$locale}' available.", $this->_options['logPriority']);
+ } else {
+ trigger_error("No translation for the language '{$locale}' available.", E_USER_NOTICE);
+ }
+ }
+ }
+
+ if ($this->_options['locale'] != $locale) {
+ $this->_options['locale'] = $locale;
+
+ if (isset(self::$_cache)) {
+ $id = 'Zend_Translate_' . $this->toString() . '_Options';
+ if (self::$_cacheTags) {
+ self::$_cache->save($this->_options, $id, array($this->_options['tag']));
+ } else {
+ self::$_cache->save($this->_options, $id);
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns the available languages from this adapter
+ *
+ * @return array|null
+ */
+ public function getList()
+ {
+ $list = array_keys($this->_translate);
+ $result = null;
+ foreach($list as $value) {
+ if (!empty($this->_translate[$value])) {
+ $result[$value] = $value;
+ }
+ }
+ return $result;
+ }
+
+ /**
+ * Returns the message id for a given translation
+ * If no locale is given, the actual language will be used
+ *
+ * @param string $message Message to get the key for
+ * @param string|Zend_Locale $locale (optional) Language to return the message ids from
+ * @return string|array|false
+ */
+ public function getMessageId($message, $locale = null)
+ {
+ if (empty($locale) or !$this->isAvailable($locale)) {
+ $locale = $this->_options['locale'];
+ }
+
+ return array_search($message, $this->_translate[(string) $locale]);
+ }
+
+ /**
+ * Returns all available message ids from this adapter
+ * If no locale is given, the actual language will be used
+ *
+ * @param string|Zend_Locale $locale (optional) Language to return the message ids from
+ * @return array
+ */
+ public function getMessageIds($locale = null)
+ {
+ if (empty($locale) or !$this->isAvailable($locale)) {
+ $locale = $this->_options['locale'];
+ }
+
+ return array_keys($this->_translate[(string) $locale]);
+ }
+
+ /**
+ * Returns all available translations from this adapter
+ * If no locale is given, the actual language will be used
+ * If 'all' is given the complete translation dictionary will be returned
+ *
+ * @param string|Zend_Locale $locale (optional) Language to return the messages from
+ * @return array
+ */
+ public function getMessages($locale = null)
+ {
+ if ($locale === 'all') {
+ return $this->_translate;
+ }
+
+ if ((empty($locale) === true) or ($this->isAvailable($locale) === false)) {
+ $locale = $this->_options['locale'];
+ }
+
+ return $this->_translate[(string) $locale];
+ }
+
+ /**
+ * Is the wished language available ?
+ *
+ * @see Zend_Locale
+ * @param string|Zend_Locale $locale Language to search for, identical with locale identifier,
+ * @see Zend_Locale for more information
+ * @return boolean
+ */
+ public function isAvailable($locale)
+ {
+ $return = isset($this->_translate[(string) $locale]);
+ return $return;
+ }
+
+ /**
+ * Load translation data
+ *
+ * @param mixed $data
+ * @param string|Zend_Locale $locale
+ * @param array $options (optional)
+ * @return array
+ */
+ abstract protected function _loadTranslationData($data, $locale, array $options = array());
+
+ /**
+ * Internal function for adding translation data
+ *
+ * This may be a new language or additional data for an existing language
+ * If the options 'clear' is true, then the translation data for the specified
+ * language is replaced and added otherwise
+ *
+ * @see Zend_Locale
+ * @param array|Zend_Config $content Translation data to add
+ * @throws Zend_Translate_Exception
+ * @return Zend_Translate_Adapter Provides fluent interface
+ */
+ private function _addTranslationData($options = array())
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (func_num_args() > 1) {
+ $args = func_get_args();
+ $options['content'] = array_shift($args);
+
+ if (!empty($args)) {
+ $options['locale'] = array_shift($args);
+ }
+
+ if (!empty($args)) {
+ $options += array_shift($args);
+ }
+ }
+
+ if (($options['content'] instanceof Zend_Translate) || ($options['content'] instanceof Zend_Translate_Adapter)) {
+ $options['usetranslateadapter'] = true;
+ if (!empty($options['locale']) && ($options['locale'] !== 'auto')) {
+ $options['content'] = $options['content']->getMessages($options['locale']);
+ } else {
+ $content = $options['content'];
+ $locales = $content->getList();
+ foreach ($locales as $locale) {
+ $options['locale'] = $locale;
+ $options['content'] = $content->getMessages($locale);
+ $this->_addTranslationData($options);
+ }
+
+ return $this;
+ }
+ }
+
+ try {
+ $options['locale'] = Zend_Locale::findLocale($options['locale']);
+ } catch (Zend_Locale_Exception $e) {
+ throw new Zend_Translate_Exception("The given Language '{$options['locale']}' does not exist", 0, $e);
+ }
+
+ if ($options['clear'] || !isset($this->_translate[$options['locale']])) {
+ $this->_translate[$options['locale']] = array();
+ }
+
+ $read = true;
+ if (isset(self::$_cache)) {
+ $id = 'Zend_Translate_' . md5(serialize($options['content'])) . '_' . $this->toString();
+ $temp = self::$_cache->load($id);
+ if ($temp) {
+ $read = false;
+ }
+ }
+
+ if ($options['reload']) {
+ $read = true;
+ }
+
+ if ($read) {
+ if (!empty($options['usetranslateadapter'])) {
+ $temp = array($options['locale'] => $options['content']);
+ } else {
+ $temp = $this->_loadTranslationData($options['content'], $options['locale'], $options);
+ }
+ }
+
+ if (empty($temp)) {
+ $temp = array();
+ }
+
+ $keys = array_keys($temp);
+ foreach($keys as $key) {
+ if (!isset($this->_translate[$key])) {
+ $this->_translate[$key] = array();
+ }
+
+ if (array_key_exists($key, $temp) && is_array($temp[$key])) {
+ $this->_translate[$key] = $temp[$key] + $this->_translate[$key];
+ }
+ }
+
+ if ($this->_automatic === true) {
+ $find = new Zend_Locale($options['locale']);
+ $browser = $find->getEnvironment() + $find->getBrowser();
+ arsort($browser);
+ foreach($browser as $language => $quality) {
+ if (isset($this->_translate[$language])) {
+ $this->_options['locale'] = $language;
+ break;
+ }
+ }
+ }
+
+ if (($read) and (isset(self::$_cache))) {
+ $id = 'Zend_Translate_' . md5(serialize($options['content'])) . '_' . $this->toString();
+ if (self::$_cacheTags) {
+ self::$_cache->save($temp, $id, array($this->_options['tag']));
+ } else {
+ self::$_cache->save($temp, $id);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Translates the given string
+ * returns the translation
+ *
+ * @see Zend_Locale
+ * @param string|array $messageId Translation string, or Array for plural translations
+ * @param string|Zend_Locale $locale (optional) Locale/Language to use, identical with
+ * locale identifier, @see Zend_Locale for more information
+ * @return string
+ */
+ public function translate($messageId, $locale = null)
+ {
+ if ($locale === null) {
+ $locale = $this->_options['locale'];
+ }
+
+ $plural = null;
+ if (is_array($messageId)) {
+ if (count($messageId) > 2) {
+ $number = array_pop($messageId);
+ if (!is_numeric($number)) {
+ $plocale = $number;
+ $number = array_pop($messageId);
+ } else {
+ $plocale = 'en';
+ }
+
+ $plural = $messageId;
+ $messageId = $messageId[0];
+ } else {
+ $messageId = $messageId[0];
+ }
+ }
+
+ if (!Zend_Locale::isLocale($locale, true, false)) {
+ if (!Zend_Locale::isLocale($locale, false, false)) {
+ // language does not exist, return original string
+ $this->_log($messageId, $locale);
+ // use rerouting when enabled
+ if (!empty($this->_options['route'])) {
+ if (array_key_exists($locale, $this->_options['route']) &&
+ !array_key_exists($locale, $this->_routed)) {
+ $this->_routed[$locale] = true;
+ return $this->translate($messageId, $this->_options['route'][$locale]);
+ }
+ }
+
+ $this->_routed = array();
+ if ($plural === null) {
+ return $messageId;
+ }
+
+ $rule = Zend_Translate_Plural::getPlural($number, $plocale);
+ if (!isset($plural[$rule])) {
+ $rule = 0;
+ }
+
+ return $plural[$rule];
+ }
+
+ $locale = new Zend_Locale($locale);
+ }
+
+ $locale = (string) $locale;
+ if ((is_string($messageId) || is_int($messageId)) && isset($this->_translate[$locale][$messageId])) {
+ // return original translation
+ if ($plural === null) {
+ $this->_routed = array();
+ return $this->_translate[$locale][$messageId];
+ }
+
+ $rule = Zend_Translate_Plural::getPlural($number, $locale);
+ if (isset($this->_translate[$locale][$plural[0]][$rule])) {
+ $this->_routed = array();
+ return $this->_translate[$locale][$plural[0]][$rule];
+ }
+ } else if (strlen($locale) != 2) {
+ // faster than creating a new locale and separate the leading part
+ $locale = substr($locale, 0, -strlen(strrchr($locale, '_')));
+
+ if ((is_string($messageId) || is_int($messageId)) && isset($this->_translate[$locale][$messageId])) {
+ // return regionless translation (en_US -> en)
+ if ($plural === null) {
+ $this->_routed = array();
+ return $this->_translate[$locale][$messageId];
+ }
+
+ $rule = Zend_Translate_Plural::getPlural($number, $locale);
+ if (isset($this->_translate[$locale][$plural[0]][$rule])) {
+ $this->_routed = array();
+ return $this->_translate[$locale][$plural[0]][$rule];
+ }
+ }
+ }
+
+ $this->_log($messageId, $locale);
+ // use rerouting when enabled
+ if (!empty($this->_options['route'])) {
+ if (array_key_exists($locale, $this->_options['route']) &&
+ !array_key_exists($locale, $this->_routed)) {
+ $this->_routed[$locale] = true;
+ return $this->translate($messageId, $this->_options['route'][$locale]);
+ }
+ }
+
+ $this->_routed = array();
+ if ($plural === null) {
+ return $messageId;
+ }
+
+ $rule = Zend_Translate_Plural::getPlural($number, $plocale);
+ if (!isset($plural[$rule])) {
+ $rule = 0;
+ }
+
+ return $plural[$rule];
+ }
+
+ /**
+ * Translates the given string using plural notations
+ * Returns the translated string
+ *
+ * @see Zend_Locale
+ * @param string $singular Singular translation string
+ * @param string $plural Plural translation string
+ * @param integer $number Number for detecting the correct plural
+ * @param string|Zend_Locale $locale (Optional) Locale/Language to use, identical with
+ * locale identifier, @see Zend_Locale for more information
+ * @return string
+ */
+ public function plural($singular, $plural, $number, $locale = null)
+ {
+ return $this->translate(array($singular, $plural, $number), $locale);
+ }
+
+ /**
+ * Logs a message when the log option is set
+ *
+ * @param string $message Message to log
+ * @param String $locale Locale to log
+ */
+ protected function _log($message, $locale) {
+ if ($this->_options['logUntranslated']) {
+ $message = str_replace('%message%', $message, $this->_options['logMessage']);
+ $message = str_replace('%locale%', $locale, $message);
+ if ($this->_options['log']) {
+ $this->_options['log']->log($message, $this->_options['logPriority']);
+ } else {
+ trigger_error($message, E_USER_NOTICE);
+ }
+ }
+ }
+
+ /**
+ * Translates the given string
+ * returns the translation
+ *
+ * @param string $messageId Translation string
+ * @param string|Zend_Locale $locale (optional) Locale/Language to use, identical with locale
+ * identifier, @see Zend_Locale for more information
+ * @return string
+ */
+ public function _($messageId, $locale = null)
+ {
+ return $this->translate($messageId, $locale);
+ }
+
+ /**
+ * Checks if a string is translated within the source or not
+ * returns boolean
+ *
+ * @param string $messageId Translation string
+ * @param boolean $original (optional) Allow translation only for original language
+ * when true, a translation for 'en_US' would give false when it can
+ * be translated with 'en' only
+ * @param string|Zend_Locale $locale (optional) Locale/Language to use, identical with locale identifier,
+ * see Zend_Locale for more information
+ * @return boolean
+ */
+ public function isTranslated($messageId, $original = false, $locale = null)
+ {
+ if (($original !== false) and ($original !== true)) {
+ $locale = $original;
+ $original = false;
+ }
+
+ if ($locale === null) {
+ $locale = $this->_options['locale'];
+ }
+
+ if (!Zend_Locale::isLocale($locale, true, false)) {
+ if (!Zend_Locale::isLocale($locale, false, false)) {
+ // language does not exist, return original string
+ return false;
+ }
+
+ $locale = new Zend_Locale($locale);
+ }
+
+ $locale = (string) $locale;
+ if ((is_string($messageId) || is_int($messageId)) && isset($this->_translate[$locale][$messageId])) {
+ // return original translation
+ return true;
+ } else if ((strlen($locale) != 2) and ($original === false)) {
+ // faster than creating a new locale and separate the leading part
+ $locale = substr($locale, 0, -strlen(strrchr($locale, '_')));
+
+ if ((is_string($messageId) || is_int($messageId)) && isset($this->_translate[$locale][$messageId])) {
+ // return regionless translation (en_US -> en)
+ return true;
+ }
+ }
+
+ // No translation found, return original
+ return false;
+ }
+
+ /**
+ * Returns the set cache
+ *
+ * @return Zend_Cache_Core The set cache
+ */
+ public static function getCache()
+ {
+ return self::$_cache;
+ }
+
+ /**
+ * Sets a cache for all Zend_Translate_Adapters
+ *
+ * @param Zend_Cache_Core $cache Cache to store to
+ */
+ public static function setCache(Zend_Cache_Core $cache)
+ {
+ self::$_cache = $cache;
+ self::_getTagSupportForCache();
+ }
+
+ /**
+ * Returns true when a cache is set
+ *
+ * @return boolean
+ */
+ public static function hasCache()
+ {
+ if (self::$_cache !== null) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Removes any set cache
+ *
+ * @return void
+ */
+ public static function removeCache()
+ {
+ self::$_cache = null;
+ }
+
+ /**
+ * Clears all set cache data
+ *
+ * @param string $tag Tag to clear when the default tag name is not used
+ * @return void
+ */
+ public static function clearCache($tag = null)
+ {
+ if (self::$_cacheTags) {
+ if ($tag == null) {
+ $tag = 'Zend_Translate';
+ }
+
+ self::$_cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array($tag));
+ } else {
+ self::$_cache->clean(Zend_Cache::CLEANING_MODE_ALL);
+ }
+ }
+
+ /**
+ * Returns the adapter name
+ *
+ * @return string
+ */
+ abstract public function toString();
+
+ /**
+ * Internal method to check if the given cache supports tags
+ *
+ * @param Zend_Cache $cache
+ */
+ private static function _getTagSupportForCache()
+ {
+ $backend = self::$_cache->getBackend();
+ if ($backend instanceof Zend_Cache_Backend_ExtendedInterface) {
+ $cacheOptions = $backend->getCapabilities();
+ self::$_cacheTags = $cacheOptions['tags'];
+ } else {
+ self::$_cacheTags = false;
+ }
+
+ return self::$_cacheTags;
+ }
+}
diff --git a/library/vendor/Zend/Translate/Exception.php b/library/vendor/Zend/Translate/Exception.php
new file mode 100644
index 0000000..8502ec1
--- /dev/null
+++ b/library/vendor/Zend/Translate/Exception.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Translate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+
+/**
+ * Zend_Exception
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Translate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Translate_Exception extends Zend_Exception
+{
+}
diff --git a/library/vendor/Zend/Translate/Plural.php b/library/vendor/Zend/Translate/Plural.php
new file mode 100644
index 0000000..9920828
--- /dev/null
+++ b/library/vendor/Zend/Translate/Plural.php
@@ -0,0 +1,223 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Locale
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Utility class for returning the plural rules according to the given locale
+ *
+ * @category Zend
+ * @package Zend_Locale
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Translate_Plural
+{
+ /**
+ * Manual rule to use
+ *
+ * @var string
+ */
+ protected static $_plural = array();
+
+ /**
+ * Returns the plural definition to use
+ *
+ * @param integer $number Number for plural selection
+ * @param string $locale Locale to use
+ * @return integer Plural number to use
+ */
+ public static function getPlural($number, $locale)
+ {
+ if ($locale == "pt_BR") {
+ // temporary set a locale for brasilian
+ $locale = "xbr";
+ }
+
+ if (strlen($locale) > 3) {
+ $locale = substr($locale, 0, -strlen(strrchr($locale, '_')));
+ }
+
+ if (isset(self::$_plural[$locale])) {
+ $return = call_user_func(self::$_plural[$locale], $number);
+
+ if (!is_int($return) || ($return < 0)) {
+ $return = 0;
+ }
+
+ return $return;
+ }
+
+ switch($locale) {
+ case 'az':
+ case 'bo':
+ case 'dz':
+ case 'id':
+ case 'ja':
+ case 'jv':
+ case 'ka':
+ case 'km':
+ case 'kn':
+ case 'ko':
+ case 'ms':
+ case 'th':
+ case 'tr':
+ case 'vi':
+ case 'zh':
+ return 0;
+ break;
+
+ case 'af':
+ case 'bn':
+ case 'bg':
+ case 'ca':
+ case 'da':
+ case 'de':
+ case 'el':
+ case 'en':
+ case 'eo':
+ case 'es':
+ case 'et':
+ case 'eu':
+ case 'fa':
+ case 'fi':
+ case 'fo':
+ case 'fur':
+ case 'fy':
+ case 'gl':
+ case 'gu':
+ case 'ha':
+ case 'he':
+ case 'hu':
+ case 'is':
+ case 'it':
+ case 'ku':
+ case 'lb':
+ case 'ml':
+ case 'mn':
+ case 'mr':
+ case 'nah':
+ case 'nb':
+ case 'ne':
+ case 'nl':
+ case 'nn':
+ case 'no':
+ case 'om':
+ case 'or':
+ case 'pa':
+ case 'pap':
+ case 'ps':
+ case 'pt':
+ case 'so':
+ case 'sq':
+ case 'sv':
+ case 'sw':
+ case 'ta':
+ case 'te':
+ case 'tk':
+ case 'ur':
+ case 'zu':
+ return ($number == 1) ? 0 : 1;
+
+ case 'am':
+ case 'bh':
+ case 'fil':
+ case 'fr':
+ case 'gun':
+ case 'hi':
+ case 'ln':
+ case 'mg':
+ case 'nso':
+ case 'xbr':
+ case 'ti':
+ case 'wa':
+ return (($number == 0) || ($number == 1)) ? 0 : 1;
+
+ case 'be':
+ case 'bs':
+ case 'hr':
+ case 'ru':
+ case 'sr':
+ case 'uk':
+ return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2);
+
+ case 'cs':
+ case 'sk':
+ return ($number == 1) ? 0 : ((($number >= 2) && ($number <= 4)) ? 1 : 2);
+
+ case 'ga':
+ return ($number == 1) ? 0 : (($number == 2) ? 1 : 2);
+
+ case 'lt':
+ return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2);
+
+ case 'sl':
+ return ($number % 100 == 1) ? 0 : (($number % 100 == 2) ? 1 : ((($number % 100 == 3) || ($number % 100 == 4)) ? 2 : 3));
+
+ case 'mk':
+ return ($number % 10 == 1) ? 0 : 1;
+
+ case 'mt':
+ return ($number == 1) ? 0 : ((($number == 0) || (($number % 100 > 1) && ($number % 100 < 11))) ? 1 : ((($number % 100 > 10) && ($number % 100 < 20)) ? 2 : 3));
+
+ case 'lv':
+ return ($number == 0) ? 0 : ((($number % 10 == 1) && ($number % 100 != 11)) ? 1 : 2);
+
+ case 'pl':
+ return ($number == 1) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 12) || ($number % 100 > 14))) ? 1 : 2);
+
+ case 'cy':
+ return ($number == 1) ? 0 : (($number == 2) ? 1 : ((($number == 8) || ($number == 11)) ? 2 : 3));
+
+ case 'ro':
+ return ($number == 1) ? 0 : ((($number == 0) || (($number % 100 > 0) && ($number % 100 < 20))) ? 1 : 2);
+
+ case 'ar':
+ return ($number == 0) ? 0 : (($number == 1) ? 1 : (($number == 2) ? 2 : ((($number >= 3) && ($number <= 10)) ? 3 : ((($number >= 11) && ($number <= 99)) ? 4 : 5))));
+
+ default:
+ return 0;
+ }
+ }
+
+ /**
+ * Set's a new plural rule
+ *
+ * @param string $rule Callback which acts as rule
+ * @param string $locale Locale which is used for this callback
+ * @return null
+ */
+ public static function setPlural($rule, $locale)
+ {
+ if ($locale == "pt_BR") {
+ // temporary set a locale for brasilian
+ $locale = "xbr";
+ }
+
+ if (strlen($locale) > 3) {
+ $locale = substr($locale, 0, -strlen(strrchr($locale, '_')));
+ }
+
+ if (!is_callable($rule)) {
+ throw new Zend_Translate_Exception('The given rule can not be called');
+ }
+
+ self::$_plural[$locale] = $rule;
+ }
+}
diff --git a/library/vendor/Zend/Uri.php b/library/vendor/Zend/Uri.php
new file mode 100644
index 0000000..ca152b5
--- /dev/null
+++ b/library/vendor/Zend/Uri.php
@@ -0,0 +1,201 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Uri
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Abstract class for all Zend_Uri handlers
+ *
+ * @category Zend
+ * @package Zend_Uri
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Uri
+{
+ /**
+ * Scheme of this URI (http, ftp, etc.)
+ *
+ * @var string
+ */
+ protected $_scheme = '';
+
+ /**
+ * Global configuration array
+ *
+ * @var array
+ */
+ static protected $_config = array(
+ 'allow_unwise' => false
+ );
+
+ /**
+ * Return a string representation of this URI.
+ *
+ * @see getUri()
+ * @return string
+ */
+ public function __toString()
+ {
+ try {
+ return $this->getUri();
+ } catch (Exception $e) {
+ trigger_error($e->getMessage(), E_USER_WARNING);
+ return '';
+ }
+ }
+
+ /**
+ * Convenience function, checks that a $uri string is well-formed
+ * by validating it but not returning an object. Returns TRUE if
+ * $uri is a well-formed URI, or FALSE otherwise.
+ *
+ * @param string $uri The URI to check
+ * @return boolean
+ */
+ public static function check($uri)
+ {
+ try {
+ $uri = self::factory($uri);
+ } catch (Exception $e) {
+ return false;
+ }
+
+ return $uri->valid();
+ }
+
+ /**
+ * Create a new Zend_Uri object for a URI. If building a new URI, then $uri should contain
+ * only the scheme (http, ftp, etc). Otherwise, supply $uri with the complete URI.
+ *
+ * @param string $uri The URI form which a Zend_Uri instance is created
+ * @param string $className The name of the class to use in order to manipulate URI
+ * @throws Zend_Uri_Exception When an empty string was supplied for the scheme
+ * @throws Zend_Uri_Exception When an illegal scheme is supplied
+ * @throws Zend_Uri_Exception When the scheme is not supported
+ * @throws Zend_Uri_Exception When $className doesn't exist or doesn't implements Zend_Uri
+ * @return Zend_Uri
+ * @link http://www.faqs.org/rfcs/rfc2396.html
+ */
+ public static function factory($uri = 'http', $className = null)
+ {
+ // Separate the scheme from the scheme-specific parts
+ $uri = explode(':', $uri, 2);
+ $scheme = strtolower($uri[0]);
+ $schemeSpecific = isset($uri[1]) === true ? $uri[1] : '';
+
+ if (strlen($scheme) === 0) {
+ throw new Zend_Uri_Exception('An empty string was supplied for the scheme');
+ }
+
+ // Security check: $scheme is used to load a class file, so only alphanumerics are allowed.
+ if (ctype_alnum($scheme) === false) {
+ throw new Zend_Uri_Exception('Illegal scheme supplied, only alphanumeric characters are permitted');
+ }
+
+ if ($className === null) {
+ /**
+ * Create a new Zend_Uri object for the $uri. If a subclass of Zend_Uri exists for the
+ * scheme, return an instance of that class. Otherwise, a Zend_Uri_Exception is thrown.
+ */
+ switch ($scheme) {
+ case 'http':
+ // Break intentionally omitted
+ case 'https':
+ $className = 'Zend_Uri_Http';
+ break;
+
+ case 'mailto':
+ // TODO
+ default:
+ throw new Zend_Uri_Exception("Scheme \"$scheme\" is not supported");
+ break;
+ }
+ }
+
+ try {
+ Zend_Loader::loadClass($className);
+ } catch (Exception $e) {
+ throw new Zend_Uri_Exception("\"$className\" not found");
+ }
+
+ $schemeHandler = new $className($scheme, $schemeSpecific);
+
+ if (! $schemeHandler instanceof Zend_Uri) {
+ throw new Zend_Uri_Exception("\"$className\" is not an instance of Zend_Uri");
+ }
+
+ return $schemeHandler;
+ }
+
+ /**
+ * Get the URI's scheme
+ *
+ * @return string|false Scheme or false if no scheme is set.
+ */
+ public function getScheme()
+ {
+ if (empty($this->_scheme) === false) {
+ return $this->_scheme;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Set global configuration options
+ *
+ * @param Zend_Config|array $config
+ */
+ static public function setConfig($config)
+ {
+ if ($config instanceof Zend_Config) {
+ $config = $config->toArray();
+ } elseif (!is_array($config)) {
+ throw new Zend_Uri_Exception("Config must be an array or an instance of Zend_Config.");
+ }
+
+ foreach ($config as $k => $v) {
+ self::$_config[$k] = $v;
+ }
+ }
+
+ /**
+ * Zend_Uri and its subclasses cannot be instantiated directly.
+ * Use Zend_Uri::factory() to return a new Zend_Uri object.
+ *
+ * @param string $scheme The scheme of the URI
+ * @param string $schemeSpecific The scheme-specific part of the URI
+ */
+ abstract protected function __construct($scheme, $schemeSpecific = '');
+
+ /**
+ * Return a string representation of this URI.
+ *
+ * @return string
+ */
+ abstract public function getUri();
+
+ /**
+ * Returns TRUE if this URI is valid, or FALSE otherwise.
+ *
+ * @return boolean
+ */
+ abstract public function valid();
+}
diff --git a/library/vendor/Zend/Uri/Exception.php b/library/vendor/Zend/Uri/Exception.php
new file mode 100644
index 0000000..780ffbc
--- /dev/null
+++ b/library/vendor/Zend/Uri/Exception.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Uri
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Exception
+ */
+
+/**
+ * Exceptions for Zend_Uri
+ *
+ * @category Zend
+ * @package Zend_Uri
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Uri_Exception extends Zend_Exception
+{
+}
diff --git a/library/vendor/Zend/Uri/Http.php b/library/vendor/Zend/Uri/Http.php
new file mode 100644
index 0000000..a964a25
--- /dev/null
+++ b/library/vendor/Zend/Uri/Http.php
@@ -0,0 +1,745 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Uri
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Uri
+ */
+
+/**
+ * @see Zend_Validate_Hostname
+ */
+
+/**
+ * HTTP(S) URI handler
+ *
+ * @category Zend
+ * @package Zend_Uri
+ * @uses Zend_Uri
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Uri_Http extends Zend_Uri
+{
+ /**
+ * Character classes for validation regular expressions
+ */
+ const CHAR_ALNUM = 'A-Za-z0-9';
+ const CHAR_MARK = '-_.!~*\'()\[\]';
+ const CHAR_RESERVED = ';\/?:@&=+$,';
+ const CHAR_SEGMENT = ':@&=+$,;';
+ const CHAR_UNWISE = '{}|\\\\^`';
+
+ /**
+ * HTTP username
+ *
+ * @var string
+ */
+ protected $_username = '';
+
+ /**
+ * HTTP password
+ *
+ * @var string
+ */
+ protected $_password = '';
+
+ /**
+ * HTTP host
+ *
+ * @var string
+ */
+ protected $_host = '';
+
+ /**
+ * HTTP post
+ *
+ * @var string
+ */
+ protected $_port = '';
+
+ /**
+ * HTTP part
+ *
+ * @var string
+ */
+ protected $_path = '';
+
+ /**
+ * HTTP query
+ *
+ * @var string
+ */
+ protected $_query = '';
+
+ /**
+ * HTTP fragment
+ *
+ * @var string
+ */
+ protected $_fragment = '';
+
+ /**
+ * Regular expression grammar rules for validation; values added by constructor
+ *
+ * @var array
+ */
+ protected $_regex = array();
+
+ /**
+ * Constructor accepts a string $scheme (e.g., http, https) and a scheme-specific part of the URI
+ * (e.g., example.com/path/to/resource?query=param#fragment)
+ *
+ * @param string $scheme The scheme of the URI
+ * @param string $schemeSpecific The scheme-specific part of the URI
+ * @throws Zend_Uri_Exception When the URI is not valid
+ */
+ protected function __construct($scheme, $schemeSpecific = '')
+ {
+ // Set the scheme
+ $this->_scheme = $scheme;
+
+ // Set up grammar rules for validation via regular expressions. These
+ // are to be used with slash-delimited regular expression strings.
+
+ // Escaped special characters (eg. '%25' for '%')
+ $this->_regex['escaped'] = '%[[:xdigit:]]{2}';
+
+ // Unreserved characters
+ $this->_regex['unreserved'] = '[' . self::CHAR_ALNUM . self::CHAR_MARK . ']';
+
+ // Segment can use escaped, unreserved or a set of additional chars
+ $this->_regex['segment'] = '(?:' . $this->_regex['escaped'] . '|[' .
+ self::CHAR_ALNUM . self::CHAR_MARK . self::CHAR_SEGMENT . '])*';
+
+ // Path can be a series of segmets char strings seperated by '/'
+ $this->_regex['path'] = '(?:\/(?:' . $this->_regex['segment'] . ')?)+';
+
+ // URI characters can be escaped, alphanumeric, mark or reserved chars
+ $this->_regex['uric'] = '(?:' . $this->_regex['escaped'] . '|[' .
+ self::CHAR_ALNUM . self::CHAR_MARK . self::CHAR_RESERVED .
+
+ // If unwise chars are allowed, add them to the URI chars class
+ (self::$_config['allow_unwise'] ? self::CHAR_UNWISE : '') . '])';
+
+ // If no scheme-specific part was supplied, the user intends to create
+ // a new URI with this object. No further parsing is required.
+ if (strlen($schemeSpecific) === 0) {
+ return;
+ }
+
+ // Parse the scheme-specific URI parts into the instance variables.
+ $this->_parseUri($schemeSpecific);
+
+ // Validate the URI
+ if ($this->valid() === false) {
+ throw new Zend_Uri_Exception('Invalid URI supplied');
+ }
+ }
+
+ /**
+ * Creates a Zend_Uri_Http from the given string
+ *
+ * @param string $uri String to create URI from, must start with
+ * 'http://' or 'https://'
+ * @throws InvalidArgumentException When the given $uri is not a string or
+ * does not start with http:// or https://
+ * @throws Zend_Uri_Exception When the given $uri is invalid
+ * @return Zend_Uri_Http
+ */
+ public static function fromString($uri)
+ {
+ if (is_string($uri) === false) {
+ throw new Zend_Uri_Exception('$uri is not a string');
+ }
+
+ $uri = explode(':', $uri, 2);
+ $scheme = strtolower($uri[0]);
+ $schemeSpecific = isset($uri[1]) === true ? $uri[1] : '';
+
+ if (in_array($scheme, array('http', 'https')) === false) {
+ throw new Zend_Uri_Exception("Invalid scheme: '$scheme'");
+ }
+
+ $schemeHandler = new Zend_Uri_Http($scheme, $schemeSpecific);
+ return $schemeHandler;
+ }
+
+ /**
+ * Parse the scheme-specific portion of the URI and place its parts into instance variables.
+ *
+ * @param string $schemeSpecific The scheme-specific portion to parse
+ * @throws Zend_Uri_Exception When scheme-specific decoposition fails
+ * @throws Zend_Uri_Exception When authority decomposition fails
+ * @return void
+ */
+ protected function _parseUri($schemeSpecific)
+ {
+ // High-level decomposition parser
+ $pattern = '~^((//)([^/?#]*))([^?#]*)(\?([^#]*))?(#(.*))?$~';
+ $status = @preg_match($pattern, $schemeSpecific, $matches);
+ if ($status === false) {
+ throw new Zend_Uri_Exception('Internal error: scheme-specific decomposition failed');
+ }
+
+ // Failed decomposition; no further processing needed
+ if ($status === false) {
+ return;
+ }
+
+ // Save URI components that need no further decomposition
+ $this->_path = isset($matches[4]) === true ? $matches[4] : '';
+ $this->_query = isset($matches[6]) === true ? $matches[6] : '';
+ $this->_fragment = isset($matches[8]) === true ? $matches[8] : '';
+
+ // Additional decomposition to get username, password, host, and port
+ $combo = isset($matches[3]) === true ? $matches[3] : '';
+ $pattern = '~^(([^:@]*)(:([^@]*))?@)?((?(?=[[])[[][^]]+[]]|[^:]+))(:(.*))?$~';
+ $status = @preg_match($pattern, $combo, $matches);
+ if ($status === false) {
+ throw new Zend_Uri_Exception('Internal error: authority decomposition failed');
+ }
+
+ // Save remaining URI components
+ $this->_username = isset($matches[2]) === true ? $matches[2] : '';
+ $this->_password = isset($matches[4]) === true ? $matches[4] : '';
+ $this->_host = isset($matches[5]) === true
+ ? preg_replace('~^\[([^]]+)\]$~', '\1', $matches[5]) // Strip wrapper [] from IPv6 literal
+ : '';
+ $this->_port = isset($matches[7]) === true ? $matches[7] : '';
+ }
+
+ /**
+ * Returns a URI based on current values of the instance variables. If any
+ * part of the URI does not pass validation, then an exception is thrown.
+ *
+ * @throws Zend_Uri_Exception When one or more parts of the URI are invalid
+ * @return string
+ */
+ public function getUri()
+ {
+ if ($this->valid() === false) {
+ throw new Zend_Uri_Exception('One or more parts of the URI are invalid');
+ }
+
+ $password = strlen($this->_password) > 0 ? ":$this->_password" : '';
+ $auth = strlen($this->_username) > 0 ? "$this->_username$password@" : '';
+ $port = strlen($this->_port) > 0 ? ":$this->_port" : '';
+ $query = strlen($this->_query) > 0 ? "?$this->_query" : '';
+ $fragment = strlen($this->_fragment) > 0 ? "#$this->_fragment" : '';
+
+ return $this->_scheme
+ . '://'
+ . $auth
+ . $this->_host
+ . $port
+ . $this->_path
+ . $query
+ . $fragment;
+ }
+
+ /**
+ * Validate the current URI from the instance variables. Returns true if and only if all
+ * parts pass validation.
+ *
+ * @return boolean
+ */
+ public function valid()
+ {
+ // Return true if and only if all parts of the URI have passed validation
+ return $this->validateUsername()
+ and $this->validatePassword()
+ and $this->validateHost()
+ and $this->validatePort()
+ and $this->validatePath()
+ and $this->validateQuery()
+ and $this->validateFragment();
+ }
+
+ /**
+ * Returns the username portion of the URL, or FALSE if none.
+ *
+ * @return string
+ */
+ public function getUsername()
+ {
+ return strlen($this->_username) > 0 ? $this->_username : false;
+ }
+
+ /**
+ * Returns true if and only if the username passes validation. If no username is passed,
+ * then the username contained in the instance variable is used.
+ *
+ * @param string $username The HTTP username
+ * @throws Zend_Uri_Exception When username validation fails
+ * @return boolean
+ * @link http://www.faqs.org/rfcs/rfc2396.html
+ */
+ public function validateUsername($username = null)
+ {
+ if ($username === null) {
+ $username = $this->_username;
+ }
+
+ // If the username is empty, then it is considered valid
+ if (strlen($username) === 0) {
+ return true;
+ }
+
+ // Check the username against the allowed values
+ $status = @preg_match('/^(?:' . $this->_regex['escaped'] . '|[' .
+ self::CHAR_ALNUM . self::CHAR_MARK . ';:&=+$,' . '])+$/', $username);
+
+ if ($status === false) {
+ throw new Zend_Uri_Exception('Internal error: username validation failed');
+ }
+
+ return $status === 1;
+ }
+
+ /**
+ * Sets the username for the current URI, and returns the old username
+ *
+ * @param string $username The HTTP username
+ * @throws Zend_Uri_Exception When $username is not a valid HTTP username
+ * @return string
+ */
+ public function setUsername($username)
+ {
+ if ($this->validateUsername($username) === false) {
+ throw new Zend_Uri_Exception("Username \"$username\" is not a valid HTTP username");
+ }
+
+ $oldUsername = $this->_username;
+ $this->_username = $username;
+
+ return $oldUsername;
+ }
+
+ /**
+ * Returns the password portion of the URL, or FALSE if none.
+ *
+ * @return string
+ */
+ public function getPassword()
+ {
+ return strlen($this->_password) > 0 ? $this->_password : false;
+ }
+
+ /**
+ * Returns true if and only if the password passes validation. If no password is passed,
+ * then the password contained in the instance variable is used.
+ *
+ * @param string $password The HTTP password
+ * @throws Zend_Uri_Exception When password validation fails
+ * @return boolean
+ * @link http://www.faqs.org/rfcs/rfc2396.html
+ */
+ public function validatePassword($password = null)
+ {
+ if ($password === null) {
+ $password = $this->_password;
+ }
+
+ // If the password is empty, then it is considered valid
+ if (strlen($password) === 0) {
+ return true;
+ }
+
+ // If the password is nonempty, but there is no username, then it is considered invalid
+ if (strlen($password) > 0 and strlen($this->_username) === 0) {
+ return false;
+ }
+
+ // Check the password against the allowed values
+ $status = @preg_match('/^(?:' . $this->_regex['escaped'] . '|[' .
+ self::CHAR_ALNUM . self::CHAR_MARK . ';:&=+$,' . '])+$/', $password);
+
+ if ($status === false) {
+ throw new Zend_Uri_Exception('Internal error: password validation failed.');
+ }
+
+ return $status == 1;
+ }
+
+ /**
+ * Sets the password for the current URI, and returns the old password
+ *
+ * @param string $password The HTTP password
+ * @throws Zend_Uri_Exception When $password is not a valid HTTP password
+ * @return string
+ */
+ public function setPassword($password)
+ {
+ if ($this->validatePassword($password) === false) {
+ throw new Zend_Uri_Exception("Password \"$password\" is not a valid HTTP password.");
+ }
+
+ $oldPassword = $this->_password;
+ $this->_password = $password;
+
+ return $oldPassword;
+ }
+
+ /**
+ * Returns the domain or host IP portion of the URL, or FALSE if none.
+ *
+ * @return string
+ */
+ public function getHost()
+ {
+ return strlen($this->_host) > 0 ? $this->_host : false;
+ }
+
+ /**
+ * Returns true if and only if the host string passes validation. If no host is passed,
+ * then the host contained in the instance variable is used.
+ *
+ * @param string $host The HTTP host
+ * @return boolean
+ * @uses Zend_Filter
+ */
+ public function validateHost($host = null)
+ {
+ if ($host === null) {
+ $host = $this->_host;
+ }
+
+ // If the host is empty, then it is considered invalid
+ if (strlen($host) === 0) {
+ return false;
+ }
+
+ // Check the host against the allowed values; delegated to Zend_Filter.
+ $validate = new Zend_Validate_Hostname(Zend_Validate_Hostname::ALLOW_ALL);
+
+ return $validate->isValid($host);
+ }
+
+ /**
+ * Sets the host for the current URI, and returns the old host
+ *
+ * @param string $host The HTTP host
+ * @throws Zend_Uri_Exception When $host is nota valid HTTP host
+ * @return string
+ */
+ public function setHost($host)
+ {
+ if ($this->validateHost($host) === false) {
+ throw new Zend_Uri_Exception("Host \"$host\" is not a valid HTTP host");
+ }
+
+ $oldHost = $this->_host;
+ $this->_host = $host;
+
+ return $oldHost;
+ }
+
+ /**
+ * Returns the TCP port, or FALSE if none.
+ *
+ * @return string
+ */
+ public function getPort()
+ {
+ return strlen($this->_port) > 0 ? $this->_port : false;
+ }
+
+ /**
+ * Returns true if and only if the TCP port string passes validation. If no port is passed,
+ * then the port contained in the instance variable is used.
+ *
+ * @param string $port The HTTP port
+ * @return boolean
+ */
+ public function validatePort($port = null)
+ {
+ if ($port === null) {
+ $port = $this->_port;
+ }
+
+ // If the port is empty, then it is considered valid
+ if (strlen($port) === 0) {
+ return true;
+ }
+
+ // Check the port against the allowed values
+ return ctype_digit((string) $port) and 1 <= $port and $port <= 65535;
+ }
+
+ /**
+ * Sets the port for the current URI, and returns the old port
+ *
+ * @param string $port The HTTP port
+ * @throws Zend_Uri_Exception When $port is not a valid HTTP port
+ * @return string
+ */
+ public function setPort($port)
+ {
+ if ($this->validatePort($port) === false) {
+ throw new Zend_Uri_Exception("Port \"$port\" is not a valid HTTP port.");
+ }
+
+ $oldPort = $this->_port;
+ $this->_port = $port;
+
+ return $oldPort;
+ }
+
+ /**
+ * Returns the path and filename portion of the URL.
+ *
+ * @return string
+ */
+ public function getPath()
+ {
+ return strlen($this->_path) > 0 ? $this->_path : '/';
+ }
+
+ /**
+ * Returns true if and only if the path string passes validation. If no path is passed,
+ * then the path contained in the instance variable is used.
+ *
+ * @param string $path The HTTP path
+ * @throws Zend_Uri_Exception When path validation fails
+ * @return boolean
+ */
+ public function validatePath($path = null)
+ {
+ if ($path === null) {
+ $path = $this->_path;
+ }
+
+ // If the path is empty, then it is considered valid
+ if (strlen($path) === 0) {
+ return true;
+ }
+
+ // Determine whether the path is well-formed
+ $pattern = '/^' . $this->_regex['path'] . '$/';
+ $status = @preg_match($pattern, $path);
+ if ($status === false) {
+ throw new Zend_Uri_Exception('Internal error: path validation failed');
+ }
+
+ return (boolean) $status;
+ }
+
+ /**
+ * Sets the path for the current URI, and returns the old path
+ *
+ * @param string $path The HTTP path
+ * @throws Zend_Uri_Exception When $path is not a valid HTTP path
+ * @return string
+ */
+ public function setPath($path)
+ {
+ if ($this->validatePath($path) === false) {
+ throw new Zend_Uri_Exception("Path \"$path\" is not a valid HTTP path");
+ }
+
+ $oldPath = $this->_path;
+ $this->_path = $path;
+
+ return $oldPath;
+ }
+
+ /**
+ * Returns the query portion of the URL (after ?), or FALSE if none.
+ *
+ * @return string
+ */
+ public function getQuery()
+ {
+ return strlen($this->_query) > 0 ? $this->_query : false;
+ }
+
+ /**
+ * Returns the query portion of the URL (after ?) as a
+ * key-value-array. If the query is empty an empty array
+ * is returned
+ *
+ * @return array
+ */
+ public function getQueryAsArray()
+ {
+ $query = $this->getQuery();
+ $querryArray = array();
+ if ($query !== false) {
+ parse_str($query, $querryArray);
+ }
+ return $querryArray;
+ }
+
+ /**
+ * Returns true if and only if the query string passes validation. If no query is passed,
+ * then the query string contained in the instance variable is used.
+ *
+ * @param string $query The query to validate
+ * @throws Zend_Uri_Exception When query validation fails
+ * @return boolean
+ * @link http://www.faqs.org/rfcs/rfc2396.html
+ */
+ public function validateQuery($query = null)
+ {
+ if ($query === null) {
+ $query = $this->_query;
+ }
+
+ // If query is empty, it is considered to be valid
+ if (strlen($query) === 0) {
+ return true;
+ }
+
+ // Determine whether the query is well-formed
+ $pattern = '/^' . $this->_regex['uric'] . '*$/';
+ $status = @preg_match($pattern, $query);
+ if ($status === false) {
+ throw new Zend_Uri_Exception('Internal error: query validation failed');
+ }
+
+ return $status == 1;
+ }
+
+ /**
+ * Add or replace params in the query string for the current URI, and
+ * return the old query.
+ *
+ * @param array $queryParams
+ * @return string Old query string
+ */
+ public function addReplaceQueryParameters(array $queryParams)
+ {
+ $queryParams = array_merge($this->getQueryAsArray(), $queryParams);
+ return $this->setQuery($queryParams);
+ }
+
+ /**
+ * Remove params in the query string for the current URI, and
+ * return the old query.
+ *
+ * @param array $queryParamKeys
+ * @return string Old query string
+ */
+ public function removeQueryParameters(array $queryParamKeys)
+ {
+ $queryParams = array_diff_key($this->getQueryAsArray(), array_fill_keys($queryParamKeys, 0));
+ return $this->setQuery($queryParams);
+ }
+
+ /**
+ * Set the query string for the current URI, and return the old query
+ * string This method accepts both strings and arrays.
+ *
+ * @param string|array $query The query string or array
+ * @throws Zend_Uri_Exception When $query is not a valid query string
+ * @return string Old query string
+ */
+ public function setQuery($query)
+ {
+ $oldQuery = $this->_query;
+
+ // If query is empty, set an empty string
+ if (empty($query) === true) {
+ $this->_query = '';
+ return $oldQuery;
+ }
+
+ // If query is an array, make a string out of it
+ if (is_array($query) === true) {
+ $query = http_build_query($query, '', '&');
+ } else {
+ // If it is a string, make sure it is valid. If not parse and encode it
+ $query = (string) $query;
+ if ($this->validateQuery($query) === false) {
+ parse_str($query, $queryArray);
+ $query = http_build_query($queryArray, '', '&');
+ }
+ }
+
+ // Make sure the query is valid, and set it
+ if ($this->validateQuery($query) === false) {
+ throw new Zend_Uri_Exception("'$query' is not a valid query string");
+ }
+
+ $this->_query = $query;
+
+ return $oldQuery;
+ }
+
+ /**
+ * Returns the fragment portion of the URL (after #), or FALSE if none.
+ *
+ * @return string|false
+ */
+ public function getFragment()
+ {
+ return strlen($this->_fragment) > 0 ? $this->_fragment : false;
+ }
+
+ /**
+ * Returns true if and only if the fragment passes validation. If no fragment is passed,
+ * then the fragment contained in the instance variable is used.
+ *
+ * @param string $fragment Fragment of an URI
+ * @throws Zend_Uri_Exception When fragment validation fails
+ * @return boolean
+ * @link http://www.faqs.org/rfcs/rfc2396.html
+ */
+ public function validateFragment($fragment = null)
+ {
+ if ($fragment === null) {
+ $fragment = $this->_fragment;
+ }
+
+ // If fragment is empty, it is considered to be valid
+ if (strlen($fragment) === 0) {
+ return true;
+ }
+
+ // Determine whether the fragment is well-formed
+ $pattern = '/^' . $this->_regex['uric'] . '*$/';
+ $status = @preg_match($pattern, $fragment);
+ if ($status === false) {
+ throw new Zend_Uri_Exception('Internal error: fragment validation failed');
+ }
+
+ return (boolean) $status;
+ }
+
+ /**
+ * Sets the fragment for the current URI, and returns the old fragment
+ *
+ * @param string $fragment Fragment of the current URI
+ * @throws Zend_Uri_Exception When $fragment is not a valid HTTP fragment
+ * @return string
+ */
+ public function setFragment($fragment)
+ {
+ if ($this->validateFragment($fragment) === false) {
+ throw new Zend_Uri_Exception("Fragment \"$fragment\" is not a valid HTTP fragment");
+ }
+
+ $oldFragment = $this->_fragment;
+ $this->_fragment = $fragment;
+
+ return $oldFragment;
+ }
+}
diff --git a/library/vendor/Zend/VERSION b/library/vendor/Zend/VERSION
new file mode 100644
index 0000000..2e06b1a
--- /dev/null
+++ b/library/vendor/Zend/VERSION
@@ -0,0 +1 @@
+v1.12.20-23-gc1f645550
diff --git a/library/vendor/Zend/Validate.php b/library/vendor/Zend/Validate.php
new file mode 100644
index 0000000..34f72be
--- /dev/null
+++ b/library/vendor/Zend/Validate.php
@@ -0,0 +1,283 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate implements Zend_Validate_Interface
+{
+ /**
+ * Validator chain
+ *
+ * @var array
+ */
+ protected $_validators = array();
+
+ /**
+ * Array of validation failure messages
+ *
+ * @var array
+ */
+ protected $_messages = array();
+
+ /**
+ * Default Namespaces
+ *
+ * @var array
+ */
+ protected static $_defaultNamespaces = array();
+
+ /**
+ * Array of validation failure message codes
+ *
+ * @var array
+ * @deprecated Since 1.5.0
+ */
+ protected $_errors = array();
+
+ /**
+ * Adds a validator to the end of the chain
+ *
+ * If $breakChainOnFailure is true, then if the validator fails, the next validator in the chain,
+ * if one exists, will not be executed.
+ *
+ * @param Zend_Validate_Interface $validator
+ * @param boolean $breakChainOnFailure
+ * @return Zend_Validate Provides a fluent interface
+ */
+ public function addValidator(Zend_Validate_Interface $validator, $breakChainOnFailure = false)
+ {
+ $this->_validators[] = array(
+ 'instance' => $validator,
+ 'breakChainOnFailure' => (boolean) $breakChainOnFailure
+ );
+ return $this;
+ }
+
+ /**
+ * Returns true if and only if $value passes all validations in the chain
+ *
+ * Validators are run in the order in which they were added to the chain (FIFO).
+ *
+ * @param mixed $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ $this->_messages = array();
+ $this->_errors = array();
+ $result = true;
+ foreach ($this->_validators as $element) {
+ $validator = $element['instance'];
+ if ($validator->isValid($value)) {
+ continue;
+ }
+ $result = false;
+ $messages = $validator->getMessages();
+ $this->_messages = array_merge($this->_messages, $messages);
+ $this->_errors = array_merge($this->_errors, array_keys($messages));
+ if ($element['breakChainOnFailure']) {
+ break;
+ }
+ }
+ return $result;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns array of validation failure messages
+ *
+ * @return array
+ */
+ public function getMessages()
+ {
+ return $this->_messages;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns array of validation failure message codes
+ *
+ * @return array
+ * @deprecated Since 1.5.0
+ */
+ public function getErrors()
+ {
+ return $this->_errors;
+ }
+
+ /**
+ * Returns the set default namespaces
+ *
+ * @return array
+ */
+ public static function getDefaultNamespaces()
+ {
+ return self::$_defaultNamespaces;
+ }
+
+ /**
+ * Sets new default namespaces
+ *
+ * @param array|string $namespace
+ * @return null
+ */
+ public static function setDefaultNamespaces($namespace)
+ {
+ if (!is_array($namespace)) {
+ $namespace = array((string) $namespace);
+ }
+
+ self::$_defaultNamespaces = $namespace;
+ }
+
+ /**
+ * Adds a new default namespace
+ *
+ * @param array|string $namespace
+ * @return null
+ */
+ public static function addDefaultNamespaces($namespace)
+ {
+ if (!is_array($namespace)) {
+ $namespace = array((string) $namespace);
+ }
+
+ self::$_defaultNamespaces = array_unique(array_merge(self::$_defaultNamespaces, $namespace));
+ }
+
+ /**
+ * Returns true when defaultNamespaces are set
+ *
+ * @return boolean
+ */
+ public static function hasDefaultNamespaces()
+ {
+ return (!empty(self::$_defaultNamespaces));
+ }
+
+ /**
+ * @param mixed $value
+ * @param string $classBaseName
+ * @param array $args OPTIONAL
+ * @param mixed $namespaces OPTIONAL
+ * @return boolean
+ * @throws Zend_Validate_Exception
+ */
+ public static function is($value, $classBaseName, array $args = array(), $namespaces = array())
+ {
+ $namespaces = array_merge((array) $namespaces, self::$_defaultNamespaces, array('Zend_Validate'));
+ $className = ucfirst($classBaseName);
+ try {
+ if (!class_exists($className, false)) {
+ foreach($namespaces as $namespace) {
+ $class = $namespace . '_' . $className;
+ $file = str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php';
+ if (Zend_Loader::isReadable($file)) {
+ Zend_Loader::loadClass($class);
+ $className = $class;
+ break;
+ }
+ }
+ }
+
+ $class = new ReflectionClass($className);
+ if ($class->implementsInterface('Zend_Validate_Interface')) {
+ if ($class->hasMethod('__construct')) {
+ $keys = array_keys($args);
+ $numeric = false;
+ foreach($keys as $key) {
+ if (is_numeric($key)) {
+ $numeric = true;
+ break;
+ }
+ }
+
+ if ($numeric) {
+ $object = $class->newInstanceArgs(array_values($args));
+ } else {
+ $object = $class->newInstance($args);
+ }
+ } else {
+ $object = $class->newInstance();
+ }
+
+ return $object->isValid($value);
+ }
+ } catch (Zend_Validate_Exception $ze) {
+ // if there is an exception while validating throw it
+ throw $ze;
+ } catch (Exception $e) {
+ // fallthrough and continue for missing validation classes
+ }
+
+ throw new Zend_Validate_Exception("Validate class not found from basename '$classBaseName'");
+ }
+
+ /**
+ * Returns the maximum allowed message length
+ *
+ * @return integer
+ */
+ public static function getMessageLength()
+ {
+ return Zend_Validate_Abstract::getMessageLength();
+ }
+
+ /**
+ * Sets the maximum allowed message length
+ *
+ * @param integer $length
+ */
+ public static function setMessageLength($length = -1)
+ {
+ Zend_Validate_Abstract::setMessageLength($length);
+ }
+
+ /**
+ * Returns the default translation object
+ *
+ * @return Zend_Translate_Adapter|null
+ */
+ public static function getDefaultTranslator($translator = null)
+ {
+ return Zend_Validate_Abstract::getDefaultTranslator();
+ }
+
+ /**
+ * Sets a default translation object for all validation objects
+ *
+ * @param Zend_Translate|Zend_Translate_Adapter|null $translator
+ */
+ public static function setDefaultTranslator($translator = null)
+ {
+ Zend_Validate_Abstract::setDefaultTranslator($translator);
+ }
+}
diff --git a/library/vendor/Zend/Validate/Abstract.php b/library/vendor/Zend/Validate/Abstract.php
new file mode 100644
index 0000000..f3ba551
--- /dev/null
+++ b/library/vendor/Zend/Validate/Abstract.php
@@ -0,0 +1,477 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Validate_Abstract implements Zend_Validate_Interface
+{
+ /**
+ * The value to be validated
+ *
+ * @var mixed
+ */
+ protected $_value;
+
+ /**
+ * Additional variables available for validation failure messages
+ *
+ * @var array
+ */
+ protected $_messageVariables = array();
+
+ /**
+ * Validation failure message template definitions
+ *
+ * @var array
+ */
+ protected $_messageTemplates = array();
+
+ /**
+ * Array of validation failure messages
+ *
+ * @var array
+ */
+ protected $_messages = array();
+
+ /**
+ * Flag indidcating whether or not value should be obfuscated in error
+ * messages
+ * @var bool
+ */
+ protected $_obscureValue = false;
+
+ /**
+ * Array of validation failure message codes
+ *
+ * @var array
+ * @deprecated Since 1.5.0
+ */
+ protected $_errors = array();
+
+ /**
+ * Translation object
+ * @var Zend_Translate
+ */
+ protected $_translator;
+
+ /**
+ * Default translation object for all validate objects
+ * @var Zend_Translate
+ */
+ protected static $_defaultTranslator;
+
+ /**
+ * Is translation disabled?
+ * @var Boolean
+ */
+ protected $_translatorDisabled = false;
+
+ /**
+ * Limits the maximum returned length of a error message
+ *
+ * @var Integer
+ */
+ protected static $_messageLength = -1;
+
+ /**
+ * Returns array of validation failure messages
+ *
+ * @return array
+ */
+ public function getMessages()
+ {
+ return $this->_messages;
+ }
+
+ /**
+ * Returns an array of the names of variables that are used in constructing validation failure messages
+ *
+ * @return array
+ */
+ public function getMessageVariables()
+ {
+ return array_keys($this->_messageVariables);
+ }
+
+ /**
+ * Returns the message templates from the validator
+ *
+ * @return array
+ */
+ public function getMessageTemplates()
+ {
+ return $this->_messageTemplates;
+ }
+
+ /**
+ * Sets the validation failure message template for a particular key
+ *
+ * @param string $messageString
+ * @param string $messageKey OPTIONAL
+ * @return Zend_Validate_Abstract Provides a fluent interface
+ * @throws Zend_Validate_Exception
+ */
+ public function setMessage($messageString, $messageKey = null)
+ {
+ if ($messageKey === null) {
+ $keys = array_keys($this->_messageTemplates);
+ foreach($keys as $key) {
+ $this->setMessage($messageString, $key);
+ }
+ return $this;
+ }
+
+ if (!isset($this->_messageTemplates[$messageKey])) {
+ throw new Zend_Validate_Exception("No message template exists for key '$messageKey'");
+ }
+
+ $this->_messageTemplates[$messageKey] = $messageString;
+ return $this;
+ }
+
+ /**
+ * Sets validation failure message templates given as an array, where the array keys are the message keys,
+ * and the array values are the message template strings.
+ *
+ * @param array $messages
+ * @return Zend_Validate_Abstract
+ */
+ public function setMessages(array $messages)
+ {
+ foreach ($messages as $key => $message) {
+ $this->setMessage($message, $key);
+ }
+ return $this;
+ }
+
+ /**
+ * Magic function returns the value of the requested property, if and only if it is the value or a
+ * message variable.
+ *
+ * @param string $property
+ * @return mixed
+ * @throws Zend_Validate_Exception
+ */
+ public function __get($property)
+ {
+ if ($property == 'value') {
+ return $this->_value;
+ }
+ if (array_key_exists($property, $this->_messageVariables)) {
+ return $this->{$this->_messageVariables[$property]};
+ }
+ /**
+ * @see Zend_Validate_Exception
+ */
+ throw new Zend_Validate_Exception("No property exists by the name '$property'");
+ }
+
+ /**
+ * Constructs and returns a validation failure message with the given message key and value.
+ *
+ * Returns null if and only if $messageKey does not correspond to an existing template.
+ *
+ * If a translator is available and a translation exists for $messageKey,
+ * the translation will be used.
+ *
+ * @param string $messageKey
+ * @param string $value
+ * @return string
+ */
+ protected function _createMessage($messageKey, $value)
+ {
+ if (!isset($this->_messageTemplates[$messageKey])) {
+ return null;
+ }
+
+ $message = $this->_messageTemplates[$messageKey];
+
+ if (null !== ($translator = $this->getTranslator())) {
+ if ($translator->isTranslated($messageKey)) {
+ $message = $translator->translate($messageKey);
+ } else {
+ $message = $translator->translate($message);
+ }
+ }
+
+ if (is_object($value)) {
+ if (!in_array('__toString', get_class_methods($value))) {
+ $value = get_class($value) . ' object';
+ } else {
+ $value = $value->__toString();
+ }
+ } elseif (is_array($value)) {
+ $value = $this->_implodeRecursive($value);
+ } else {
+ $value = implode((array) $value);
+ }
+
+ if ($this->getObscureValue()) {
+ $value = str_repeat('*', strlen($value));
+ }
+
+ $message = str_replace('%value%', $value, $message);
+ foreach ($this->_messageVariables as $ident => $property) {
+ $message = str_replace(
+ "%$ident%",
+ implode(' ', (array) $this->$property),
+ $message
+ );
+ }
+
+ $length = self::getMessageLength();
+ if (($length > -1) && (strlen($message) > $length)) {
+ $message = substr($message, 0, (self::getMessageLength() - 3)) . '...';
+ }
+
+ return $message;
+ }
+
+ /**
+ * Joins elements of a multidimensional array
+ *
+ * @param array $pieces
+ * @return string
+ */
+ protected function _implodeRecursive(array $pieces)
+ {
+ $values = array();
+ foreach ($pieces as $item) {
+ if (is_array($item)) {
+ $values[] = $this->_implodeRecursive($item);
+ } else {
+ $values[] = $item;
+ }
+ }
+
+ return implode(', ', $values);
+ }
+
+ /**
+ * @param string $messageKey
+ * @param string $value OPTIONAL
+ * @return void
+ */
+ protected function _error($messageKey, $value = null)
+ {
+ if ($messageKey === null) {
+ $keys = array_keys($this->_messageTemplates);
+ $messageKey = current($keys);
+ }
+ if ($value === null) {
+ $value = $this->_value;
+ }
+ $this->_errors[] = $messageKey;
+ $this->_messages[$messageKey] = $this->_createMessage($messageKey, $value);
+ }
+
+ /**
+ * Sets the value to be validated and clears the messages and errors arrays
+ *
+ * @param mixed $value
+ * @return void
+ */
+ protected function _setValue($value)
+ {
+ $this->_value = $value;
+ $this->_messages = array();
+ $this->_errors = array();
+ }
+
+ /**
+ * Returns array of validation failure message codes
+ *
+ * @return array
+ * @deprecated Since 1.5.0
+ */
+ public function getErrors()
+ {
+ return $this->_errors;
+ }
+
+ /**
+ * Set flag indicating whether or not value should be obfuscated in messages
+ *
+ * @param bool $flag
+ * @return Zend_Validate_Abstract
+ */
+ public function setObscureValue($flag)
+ {
+ $this->_obscureValue = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Retrieve flag indicating whether or not value should be obfuscated in
+ * messages
+ *
+ * @return bool
+ */
+ public function getObscureValue()
+ {
+ return $this->_obscureValue;
+ }
+
+ /**
+ * Set translation object
+ *
+ * @param Zend_Translate|Zend_Translate_Adapter|null $translator
+ * @throws Zend_Validate_Exception
+ * @return Zend_Validate_Abstract
+ */
+ public function setTranslator($translator = null)
+ {
+ if ((null === $translator) || ($translator instanceof Zend_Translate_Adapter)) {
+ $this->_translator = $translator;
+ } elseif ($translator instanceof Zend_Translate) {
+ $this->_translator = $translator->getAdapter();
+ } else {
+ throw new Zend_Validate_Exception('Invalid translator specified');
+ }
+ return $this;
+ }
+
+ /**
+ * Return translation object
+ *
+ * @return Zend_Translate_Adapter|null
+ */
+ public function getTranslator()
+ {
+ if ($this->translatorIsDisabled()) {
+ return null;
+ }
+
+ if (null === $this->_translator) {
+ return self::getDefaultTranslator();
+ }
+
+ return $this->_translator;
+ }
+
+ /**
+ * Does this validator have its own specific translator?
+ *
+ * @return bool
+ */
+ public function hasTranslator()
+ {
+ return (bool)$this->_translator;
+ }
+
+ /**
+ * Set default translation object for all validate objects
+ *
+ * @param Zend_Translate|Zend_Translate_Adapter|null $translator
+ * @throws Zend_Validate_Exception
+ */
+ public static function setDefaultTranslator($translator = null)
+ {
+ if ((null === $translator) || ($translator instanceof Zend_Translate_Adapter)) {
+ self::$_defaultTranslator = $translator;
+ } elseif ($translator instanceof Zend_Translate) {
+ self::$_defaultTranslator = $translator->getAdapter();
+ } else {
+ throw new Zend_Validate_Exception('Invalid translator specified');
+ }
+ }
+
+ /**
+ * Get default translation object for all validate objects
+ *
+ * @return Zend_Translate_Adapter|null
+ */
+ public static function getDefaultTranslator()
+ {
+ if (null === self::$_defaultTranslator) {
+ if (Zend_Registry::isRegistered('Zend_Translate')) {
+ $translator = Zend_Registry::get('Zend_Translate');
+ if ($translator instanceof Zend_Translate_Adapter) {
+ return $translator;
+ } elseif ($translator instanceof Zend_Translate) {
+ return $translator->getAdapter();
+ }
+ }
+ }
+
+ return self::$_defaultTranslator;
+ }
+
+ /**
+ * Is there a default translation object set?
+ *
+ * @return boolean
+ */
+ public static function hasDefaultTranslator()
+ {
+ return (bool)self::$_defaultTranslator;
+ }
+
+ /**
+ * Indicate whether or not translation should be disabled
+ *
+ * @param bool $flag
+ * @return Zend_Validate_Abstract
+ */
+ public function setDisableTranslator($flag)
+ {
+ $this->_translatorDisabled = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Is translation disabled?
+ *
+ * @return bool
+ */
+ public function translatorIsDisabled()
+ {
+ return $this->_translatorDisabled;
+ }
+
+ /**
+ * Returns the maximum allowed message length
+ *
+ * @return integer
+ */
+ public static function getMessageLength()
+ {
+ return self::$_messageLength;
+ }
+
+ /**
+ * Sets the maximum allowed message length
+ *
+ * @param integer $length
+ */
+ public static function setMessageLength($length = -1)
+ {
+ self::$_messageLength = $length;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Alnum.php b/library/vendor/Zend/Validate/Alnum.php
new file mode 100644
index 0000000..190ac44
--- /dev/null
+++ b/library/vendor/Zend/Validate/Alnum.php
@@ -0,0 +1,147 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Alnum extends Zend_Validate_Abstract
+{
+ const INVALID = 'alnumInvalid';
+ const NOT_ALNUM = 'notAlnum';
+ const STRING_EMPTY = 'alnumStringEmpty';
+
+ /**
+ * Whether to allow white space characters; off by default
+ *
+ * @var boolean
+ * @deprecated
+ */
+ public $allowWhiteSpace;
+
+ /**
+ * Alphanumeric filter used for validation
+ *
+ * @var Zend_Filter_Alnum
+ */
+ protected static $_filter = null;
+
+ /**
+ * Validation failure message template definitions
+ *
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::INVALID => "Invalid type given. String, integer or float expected",
+ self::NOT_ALNUM => "'%value%' contains characters which are non alphabetic and no digits",
+ self::STRING_EMPTY => "'%value%' is an empty string",
+ );
+
+ /**
+ * Sets default option values for this instance
+ *
+ * @param boolean|Zend_Config $allowWhiteSpace
+ */
+ public function __construct($allowWhiteSpace = false)
+ {
+ if ($allowWhiteSpace instanceof Zend_Config) {
+ $allowWhiteSpace = $allowWhiteSpace->toArray();
+ }
+
+ if (is_array($allowWhiteSpace)) {
+ if (array_key_exists('allowWhiteSpace', $allowWhiteSpace)) {
+ $allowWhiteSpace = $allowWhiteSpace['allowWhiteSpace'];
+ } else {
+ $allowWhiteSpace = false;
+ }
+ }
+
+ $this->allowWhiteSpace = (boolean) $allowWhiteSpace;
+ }
+
+ /**
+ * Returns the allowWhiteSpace option
+ *
+ * @return boolean
+ */
+ public function getAllowWhiteSpace()
+ {
+ return $this->allowWhiteSpace;
+ }
+
+ /**
+ * Sets the allowWhiteSpace option
+ *
+ * @param boolean $allowWhiteSpace
+ * @return Zend_Filter_Alnum Provides a fluent interface
+ */
+ public function setAllowWhiteSpace($allowWhiteSpace)
+ {
+ $this->allowWhiteSpace = (boolean) $allowWhiteSpace;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if $value contains only alphabetic and digit characters
+ *
+ * @param string $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ if (!is_string($value) && !is_int($value) && !is_float($value)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ $this->_setValue($value);
+
+ if ('' === $value) {
+ $this->_error(self::STRING_EMPTY);
+ return false;
+ }
+
+ if (null === self::$_filter) {
+ /**
+ * @see Zend_Filter_Alnum
+ */
+ self::$_filter = new Zend_Filter_Alnum();
+ }
+
+ self::$_filter->allowWhiteSpace = $this->allowWhiteSpace;
+
+ if ($value != self::$_filter->filter($value)) {
+ $this->_error(self::NOT_ALNUM);
+ return false;
+ }
+
+ return true;
+ }
+
+}
diff --git a/library/vendor/Zend/Validate/Alpha.php b/library/vendor/Zend/Validate/Alpha.php
new file mode 100644
index 0000000..a5dbe40
--- /dev/null
+++ b/library/vendor/Zend/Validate/Alpha.php
@@ -0,0 +1,147 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Alpha extends Zend_Validate_Abstract
+{
+ const INVALID = 'alphaInvalid';
+ const NOT_ALPHA = 'notAlpha';
+ const STRING_EMPTY = 'alphaStringEmpty';
+
+ /**
+ * Whether to allow white space characters; off by default
+ *
+ * @var boolean
+ * @deprecated
+ */
+ public $allowWhiteSpace;
+
+ /**
+ * Alphabetic filter used for validation
+ *
+ * @var Zend_Filter_Alpha
+ */
+ protected static $_filter = null;
+
+ /**
+ * Validation failure message template definitions
+ *
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::INVALID => "Invalid type given. String expected",
+ self::NOT_ALPHA => "'%value%' contains non alphabetic characters",
+ self::STRING_EMPTY => "'%value%' is an empty string"
+ );
+
+ /**
+ * Sets default option values for this instance
+ *
+ * @param boolean|Zend_Config $allowWhiteSpace
+ */
+ public function __construct($allowWhiteSpace = false)
+ {
+ if ($allowWhiteSpace instanceof Zend_Config) {
+ $allowWhiteSpace = $allowWhiteSpace->toArray();
+ }
+
+ if (is_array($allowWhiteSpace)) {
+ if (array_key_exists('allowWhiteSpace', $allowWhiteSpace)) {
+ $allowWhiteSpace = $allowWhiteSpace['allowWhiteSpace'];
+ } else {
+ $allowWhiteSpace = false;
+ }
+ }
+
+ $this->allowWhiteSpace = (boolean) $allowWhiteSpace;
+ }
+
+ /**
+ * Returns the allowWhiteSpace option
+ *
+ * @return boolean
+ */
+ public function getAllowWhiteSpace()
+ {
+ return $this->allowWhiteSpace;
+ }
+
+ /**
+ * Sets the allowWhiteSpace option
+ *
+ * @param boolean $allowWhiteSpace
+ * @return Zend_Filter_Alpha Provides a fluent interface
+ */
+ public function setAllowWhiteSpace($allowWhiteSpace)
+ {
+ $this->allowWhiteSpace = (boolean) $allowWhiteSpace;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if $value contains only alphabetic characters
+ *
+ * @param string $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ if (!is_string($value)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ $this->_setValue($value);
+
+ if ('' === $value) {
+ $this->_error(self::STRING_EMPTY);
+ return false;
+ }
+
+ if (null === self::$_filter) {
+ /**
+ * @see Zend_Filter_Alpha
+ */
+ self::$_filter = new Zend_Filter_Alpha();
+ }
+
+ self::$_filter->allowWhiteSpace = $this->allowWhiteSpace;
+
+ if ($value !== self::$_filter->filter($value)) {
+ $this->_error(self::NOT_ALPHA);
+ return false;
+ }
+
+ return true;
+ }
+
+}
diff --git a/library/vendor/Zend/Validate/Barcode.php b/library/vendor/Zend/Validate/Barcode.php
new file mode 100644
index 0000000..2cc6f11
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode.php
@@ -0,0 +1,222 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @see Zend_Loader
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode extends Zend_Validate_Abstract
+{
+ const INVALID = 'barcodeInvalid';
+ const FAILED = 'barcodeFailed';
+ const INVALID_CHARS = 'barcodeInvalidChars';
+ const INVALID_LENGTH = 'barcodeInvalidLength';
+
+ protected $_messageTemplates = array(
+ self::FAILED => "'%value%' failed checksum validation",
+ self::INVALID_CHARS => "'%value%' contains invalid characters",
+ self::INVALID_LENGTH => "'%value%' should have a length of %length% characters",
+ self::INVALID => "Invalid type given. String expected",
+ );
+
+ /**
+ * Additional variables available for validation failure messages
+ *
+ * @var array
+ */
+ protected $_messageVariables = array(
+ 'length' => '_length'
+ );
+
+ /**
+ * Length for the set subtype
+ *
+ * @var integer
+ */
+ protected $_length;
+
+ /**
+ * Barcode adapter
+ *
+ * @var Zend_Validate_Barcode_BarcodeAdapter
+ */
+ protected $_adapter;
+
+ /**
+ * Generates the standard validator object
+ *
+ * @param string|Zend_Config|
+ * Zend_Validate_Barcode_BarcodeAdapter $adapter Barcode adapter to use
+ * @throws Zend_Validate_Exception
+ */
+ public function __construct($adapter)
+ {
+ if ($adapter instanceof Zend_Config) {
+ $adapter = $adapter->toArray();
+ }
+
+ $options = null;
+ $checksum = null;
+ if (is_array($adapter)) {
+ if (array_key_exists('options', $adapter)) {
+ $options = $adapter['options'];
+ }
+
+ if (array_key_exists('checksum', $adapter)) {
+ $checksum = $adapter['checksum'];
+ }
+
+ if (array_key_exists('adapter', $adapter)) {
+ $adapter = $adapter['adapter'];
+ } else {
+ throw new Zend_Validate_Exception("Missing option 'adapter'");
+ }
+ }
+
+ $this->setAdapter($adapter, $options);
+ if ($checksum !== null) {
+ $this->setChecksum($checksum);
+ }
+ }
+
+ /**
+ * Returns the set adapter
+ *
+ * @return Zend_Validate_Barcode_BarcodeAdapter
+ */
+ public function getAdapter()
+ {
+ return $this->_adapter;
+ }
+
+ /**
+ * Sets a new barcode adapter
+ *
+ * @param string|Zend_Validate_Barcode $adapter Barcode adapter to use
+ * @param array $options Options for this adapter
+ * @return $this
+ * @throws Zend_Validate_Exception
+ */
+ public function setAdapter($adapter, $options = null)
+ {
+ $adapter = ucfirst(strtolower($adapter));
+ if (Zend_Loader::isReadable('Zend/Validate/Barcode/' . $adapter. '.php')) {
+ $adapter = 'Zend_Validate_Barcode_' . $adapter;
+ }
+
+ if (!class_exists($adapter)) {
+ Zend_Loader::loadClass($adapter);
+ }
+
+ $this->_adapter = new $adapter($options);
+ if (!$this->_adapter instanceof Zend_Validate_Barcode_AdapterInterface) {
+ throw new Zend_Validate_Exception(
+ "Adapter " . $adapter . " does not implement Zend_Validate_Barcode_AdapterInterface"
+ );
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns the checksum option
+ *
+ * @return boolean
+ */
+ public function getChecksum()
+ {
+ return $this->getAdapter()->getCheck();
+ }
+
+ /**
+ * Sets the checksum option
+ *
+ * @param boolean $checksum
+ * @return Zend_Validate_Barcode
+ */
+ public function setChecksum($checksum)
+ {
+ $this->getAdapter()->setCheck($checksum);
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if $value contains a valid barcode
+ *
+ * @param string $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ if (!is_string($value)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ $this->_setValue($value);
+ $adapter = $this->getAdapter();
+ $this->_length = $adapter->getLength();
+ $result = $adapter->checkLength($value);
+ if (!$result) {
+ if (is_array($this->_length)) {
+ $temp = $this->_length;
+ $this->_length = "";
+ foreach($temp as $length) {
+ $this->_length .= "/";
+ $this->_length .= $length;
+ }
+
+ $this->_length = substr($this->_length, 1);
+ }
+
+ $this->_error(self::INVALID_LENGTH);
+ return false;
+ }
+
+ $result = $adapter->checkChars($value);
+ if (!$result) {
+ $this->_error(self::INVALID_CHARS);
+ return false;
+ }
+
+ if ($this->getChecksum()) {
+ $result = $adapter->checksum($value);
+ if (!$result) {
+ $this->_error(self::FAILED);
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Barcode/AdapterAbstract.php b/library/vendor/Zend/Validate/Barcode/AdapterAbstract.php
new file mode 100644
index 0000000..01e2409
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/AdapterAbstract.php
@@ -0,0 +1,314 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterInterface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Validate_Barcode_AdapterAbstract
+ implements Zend_Validate_Barcode_AdapterInterface
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer|array|string
+ */
+ protected $_length;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters;
+
+ /**
+ * Callback to checksum function
+ * @var string|array
+ */
+ protected $_checksum;
+
+ /**
+ * Is a checksum value included?
+ * @var boolean
+ */
+ protected $_hasChecksum = true;
+
+ /**
+ * Checks the length of a barcode
+ *
+ * @param string $value The barcode to check for proper length
+ * @return boolean
+ */
+ public function checkLength($value)
+ {
+ if (!is_string($value)) {
+ return false;
+ }
+
+ $fixum = strlen($value);
+ $found = false;
+ $length = $this->getLength();
+ if (is_array($length)) {
+ foreach ($length as $value) {
+ if ($fixum == $value) {
+ $found = true;
+ }
+
+ if ($value == -1) {
+ $found = true;
+ }
+ }
+ } elseif ($fixum == $length) {
+ $found = true;
+ } elseif ($length == -1) {
+ $found = true;
+ } elseif ($length == 'even') {
+ $count = $fixum % 2;
+ $found = ($count == 0) ? true : false;
+ } elseif ($length == 'odd') {
+ $count = $fixum % 2;
+ $found = ($count == 1) ? true : false;
+ }
+
+ return $found;
+ }
+
+ /**
+ * Checks for allowed characters within the barcode
+ *
+ * @param string $value The barcode to check for allowed characters
+ * @return boolean
+ */
+ public function checkChars($value)
+ {
+ if (!is_string($value)) {
+ return false;
+ }
+
+ $characters = $this->getCharacters();
+ if ($characters == 128) {
+ for ($x = 0; $x < 128; ++$x) {
+ $value = str_replace(chr($x), '', $value);
+ }
+ } else {
+ $chars = str_split($characters);
+ foreach ($chars as $char) {
+ $value = str_replace($char, '', $value);
+ }
+ }
+
+ if (strlen($value) > 0) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Validates the checksum
+ *
+ * @param string $value The barcode to check the checksum for
+ * @return boolean
+ */
+ public function checksum($value)
+ {
+ $checksum = $this->getChecksum();
+ if (!empty($checksum)) {
+ if (method_exists($this, $checksum)) {
+ return call_user_func(array($this, $checksum), $value);
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Returns the allowed barcode length
+ *
+ * @return string
+ */
+ public function getLength()
+ {
+ return $this->_length;
+ }
+
+ /**
+ * Returns the allowed characters
+ *
+ * @return integer|string
+ */
+ public function getCharacters()
+ {
+ return $this->_characters;
+ }
+
+ /**
+ * Returns the checksum function name
+ *
+ */
+ public function getChecksum()
+ {
+ return $this->_checksum;
+ }
+
+ /**
+ * Returns if barcode uses checksum
+ *
+ * @return boolean
+ */
+ public function getCheck()
+ {
+ return $this->_hasChecksum;
+ }
+
+ /**
+ * Sets the checksum validation
+ *
+ * @param boolean $check
+ * @return Zend_Validate_Barcode_AdapterAbstract
+ */
+ public function setCheck($check)
+ {
+ $this->_hasChecksum = (boolean) $check;
+ return $this;
+ }
+
+ /**
+ * Validates the checksum (Modulo 10)
+ * GTIN implementation factor 3
+ *
+ * @param string $value The barcode to validate
+ * @return boolean
+ */
+ protected function _gtin($value)
+ {
+ $barcode = substr($value, 0, -1);
+ $sum = 0;
+ $length = strlen($barcode) - 1;
+
+ for ($i = 0; $i <= $length; $i++) {
+ if (($i % 2) === 0) {
+ $sum += $barcode[$length - $i] * 3;
+ } else {
+ $sum += $barcode[$length - $i];
+ }
+ }
+
+ $calc = $sum % 10;
+ $checksum = ($calc === 0) ? 0 : (10 - $calc);
+ if ($value[$length + 1] != $checksum) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Validates the checksum (Modulo 10)
+ * IDENTCODE implementation factors 9 and 4
+ *
+ * @param string $value The barcode to validate
+ * @return boolean
+ */
+ protected function _identcode($value)
+ {
+ $barcode = substr($value, 0, -1);
+ $sum = 0;
+ $length = strlen($value) - 2;
+
+ for ($i = 0; $i <= $length; $i++) {
+ if (($i % 2) === 0) {
+ $sum += $barcode[$length - $i] * 4;
+ } else {
+ $sum += $barcode[$length - $i] * 9;
+ }
+ }
+
+ $calc = $sum % 10;
+ $checksum = ($calc === 0) ? 0 : (10 - $calc);
+ if ($value[$length + 1] != $checksum) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Validates the checksum (Modulo 10)
+ * CODE25 implementation factor 3
+ *
+ * @param string $value The barcode to validate
+ * @return boolean
+ */
+ protected function _code25($value)
+ {
+ $barcode = substr($value, 0, -1);
+ $sum = 0;
+ $length = strlen($barcode) - 1;
+
+ for ($i = 0; $i <= $length; $i++) {
+ if (($i % 2) === 0) {
+ $sum += $barcode[$i] * 3;
+ } else {
+ $sum += $barcode[$i];
+ }
+ }
+
+ $calc = $sum % 10;
+ $checksum = ($calc === 0) ? 0 : (10 - $calc);
+ if ($value[$length + 1] != $checksum) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Validates the checksum ()
+ * POSTNET implementation
+ *
+ * @param string $value The barcode to validate
+ * @return boolean
+ */
+ protected function _postnet($value)
+ {
+ $checksum = substr($value, -1, 1);
+ $values = str_split(substr($value, 0, -1));
+
+ $check = 0;
+ foreach($values as $row) {
+ $check += $row;
+ }
+
+ $check %= 10;
+ $check = 10 - $check;
+ if ($check == $checksum) {
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Barcode/AdapterInterface.php b/library/vendor/Zend/Validate/Barcode/AdapterInterface.php
new file mode 100644
index 0000000..8e96eff
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/AdapterInterface.php
@@ -0,0 +1,68 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Validate_Barcode_AdapterInterface
+{
+ /**
+ * Checks the length of a barcode
+ *
+ * @param string $value The barcode to check for proper length
+ * @return boolean
+ */
+ public function checkLength($value);
+
+ /**
+ * Checks for allowed characters within the barcode
+ *
+ * @param string $value The barcode to check for allowed characters
+ * @return boolean
+ */
+ public function checkChars($value);
+
+ /**
+ * Validates the checksum
+ *
+ * @param string $value The barcode to check the checksum for
+ * @return boolean
+ */
+ public function checksum($value);
+
+ /**
+ * Returns if barcode uses a checksum
+ *
+ * @return boolean
+ */
+ public function getCheck();
+
+ /**
+ * Sets the checksum validation
+ *
+ * @param boolean $check
+ * @return Zend_Validate_Barcode_Adapter Provides a fluent interface
+ */
+ public function setCheck($check);
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Code25.php b/library/vendor/Zend/Validate/Barcode/Code25.php
new file mode 100644
index 0000000..e0e540a
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Code25.php
@@ -0,0 +1,61 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Code25 extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = -1;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_code25';
+
+ /**
+ * Constructor
+ *
+ * Sets check flag to false.
+ */
+ public function __construct()
+ {
+ $this->setCheck(false);
+ }
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Code25interleaved.php b/library/vendor/Zend/Validate/Barcode/Code25interleaved.php
new file mode 100644
index 0000000..c952781
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Code25interleaved.php
@@ -0,0 +1,61 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Code25interleaved extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = 'even';
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_code25';
+
+ /**
+ * Constructor
+ *
+ * Sets check flag to false.
+ */
+ public function __construct()
+ {
+ $this->setCheck(false);
+ }
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Code39.php b/library/vendor/Zend/Validate/Barcode/Code39.php
new file mode 100644
index 0000000..e1554a1
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Code39.php
@@ -0,0 +1,97 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Code39 extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = -1;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ -.$/+%';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_code39';
+
+ /**
+ * @var array
+ */
+ protected $_check = array(
+ '0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6,
+ '7' => 7, '8' => 8, '9' => 9, 'A' => 10, 'B' => 11, 'C' => 12, 'D' => 13,
+ 'E' => 14, 'F' => 15, 'G' => 16, 'H' => 17, 'I' => 18, 'J' => 19, 'K' => 20,
+ 'L' => 21, 'M' => 22, 'N' => 23, 'O' => 24, 'P' => 25, 'Q' => 26, 'R' => 27,
+ 'S' => 28, 'T' => 29, 'U' => 30, 'V' => 31, 'W' => 32, 'X' => 33, 'Y' => 34,
+ 'Z' => 35, '-' => 36, '.' => 37, ' ' => 38, '$' => 39, '/' => 40, '+' => 41,
+ '%' => 42,
+ );
+
+ /**
+ * Constructor
+ *
+ * Sets check flag to false.
+ */
+ public function __construct()
+ {
+ $this->setCheck(false);
+ }
+
+ /**
+ * Validates the checksum (Modulo 43)
+ *
+ * @param string $value The barcode to validate
+ * @return boolean
+ */
+ protected function _code39($value)
+ {
+ $checksum = substr($value, -1, 1);
+ $value = str_split(substr($value, 0, -1));
+ $count = 0;
+ foreach($value as $char) {
+ $count += $this->_check[$char];
+ }
+
+ $mod = $count % 43;
+ if ($mod == $this->_check[$checksum]) {
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Code39ext.php b/library/vendor/Zend/Validate/Barcode/Code39ext.php
new file mode 100644
index 0000000..a295694
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Code39ext.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Code39ext extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = -1;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = 128;
+
+ /**
+ * Constructor
+ *
+ * Sets check flag to false.
+ */
+ public function __construct()
+ {
+ $this->setCheck(false);
+ }
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Code93.php b/library/vendor/Zend/Validate/Barcode/Code93.php
new file mode 100644
index 0000000..2f83ee8
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Code93.php
@@ -0,0 +1,117 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Code93 extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = -1;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ -.$/+%';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_code93';
+
+ /**
+ * Note that the characters !"§& are only synonyms
+ * @var array
+ */
+ protected $_check = array(
+ '0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6,
+ '7' => 7, '8' => 8, '9' => 9, 'A' => 10, 'B' => 11, 'C' => 12, 'D' => 13,
+ 'E' => 14, 'F' => 15, 'G' => 16, 'H' => 17, 'I' => 18, 'J' => 19, 'K' => 20,
+ 'L' => 21, 'M' => 22, 'N' => 23, 'O' => 24, 'P' => 25, 'Q' => 26, 'R' => 27,
+ 'S' => 28, 'T' => 29, 'U' => 30, 'V' => 31, 'W' => 32, 'X' => 33, 'Y' => 34,
+ 'Z' => 35, '-' => 36, '.' => 37, ' ' => 38, '$' => 39, '/' => 40, '+' => 41,
+ '%' => 42, '!' => 43, '"' => 44, '§' => 45, '&' => 46,
+ );
+
+ /**
+ * Constructor
+ *
+ * Sets check flag to false.
+ */
+ public function __construct()
+ {
+ $this->setCheck(false);
+ }
+
+ /**
+ * Validates the checksum (Modulo CK)
+ *
+ * @param string $value The barcode to validate
+ * @return boolean
+ */
+ protected function _code93($value)
+ {
+ $checksum = substr($value, -2, 2);
+ $value = str_split(substr($value, 0, -2));
+ $count = 0;
+ $length = count($value) % 20;
+ foreach($value as $char) {
+ if ($length == 0) {
+ $length = 20;
+ }
+
+ $count += $this->_check[$char] * $length;
+ --$length;
+ }
+
+ $check = array_search(($count % 47), $this->_check);
+ $value[] = $check;
+ $count = 0;
+ $length = count($value) % 15;
+ foreach($value as $char) {
+ if ($length == 0) {
+ $length = 15;
+ }
+
+ $count += $this->_check[$char] * $length;
+ --$length;
+ }
+ $check .= array_search(($count % 47), $this->_check);
+
+ if ($check == $checksum) {
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Code93ext.php b/library/vendor/Zend/Validate/Barcode/Code93ext.php
new file mode 100644
index 0000000..8795f00
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Code93ext.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Code93ext extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = -1;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = 128;
+
+ /**
+ * Constructor
+ *
+ * Sets check flag to false.
+ */
+ public function __construct()
+ {
+ $this->setCheck(false);
+ }
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Ean12.php b/library/vendor/Zend/Validate/Barcode/Ean12.php
new file mode 100644
index 0000000..67bb14c
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Ean12.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Ean12 extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = 12;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_gtin';
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Ean13.php b/library/vendor/Zend/Validate/Barcode/Ean13.php
new file mode 100644
index 0000000..7554885
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Ean13.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Ean13 extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = 13;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_gtin';
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Ean14.php b/library/vendor/Zend/Validate/Barcode/Ean14.php
new file mode 100644
index 0000000..af62b0e
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Ean14.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Ean14 extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = 14;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_gtin';
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Ean18.php b/library/vendor/Zend/Validate/Barcode/Ean18.php
new file mode 100644
index 0000000..d2fe756
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Ean18.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Ean18 extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = 18;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_gtin';
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Ean2.php b/library/vendor/Zend/Validate/Barcode/Ean2.php
new file mode 100644
index 0000000..7124fd0
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Ean2.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Ean2 extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = 2;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Constructor
+ *
+ * Sets check flag to false.
+ */
+ public function __construct()
+ {
+ $this->setCheck(false);
+ }
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Ean5.php b/library/vendor/Zend/Validate/Barcode/Ean5.php
new file mode 100644
index 0000000..74654a7
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Ean5.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Ean5 extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = 5;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Constructor
+ *
+ * Sets check flag to false.
+ */
+ public function __construct()
+ {
+ $this->setCheck(false);
+ }
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Ean8.php b/library/vendor/Zend/Validate/Barcode/Ean8.php
new file mode 100644
index 0000000..7f61dfb
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Ean8.php
@@ -0,0 +1,68 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Ean8 extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = array(7, 8);
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_gtin';
+
+ /**
+ * Overrides parent checkLength
+ *
+ * @param string $value Value
+ * @return boolean
+ */
+ public function checkLength($value)
+ {
+ if (strlen($value) == 7) {
+ $this->setCheck(false);
+ } else {
+ $this->setCheck(true);
+ }
+
+ return parent::checkLength($value);
+ }
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Gtin12.php b/library/vendor/Zend/Validate/Barcode/Gtin12.php
new file mode 100644
index 0000000..d94a1b5
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Gtin12.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Gtin12 extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = 12;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_gtin';
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Gtin13.php b/library/vendor/Zend/Validate/Barcode/Gtin13.php
new file mode 100644
index 0000000..ea66ce1
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Gtin13.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Gtin13 extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = 13;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_gtin';
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Gtin14.php b/library/vendor/Zend/Validate/Barcode/Gtin14.php
new file mode 100644
index 0000000..a2354cb
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Gtin14.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Gtin14 extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = 14;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_gtin';
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Identcode.php b/library/vendor/Zend/Validate/Barcode/Identcode.php
new file mode 100644
index 0000000..f02cab7
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Identcode.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Identcode extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = 12;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_identcode';
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Intelligentmail.php b/library/vendor/Zend/Validate/Barcode/Intelligentmail.php
new file mode 100644
index 0000000..d14ac37
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Intelligentmail.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_IntelligentMail extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = array(20, 25, 29, 31);
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Constructor
+ *
+ * Sets check flag to false.
+ */
+ public function __construct()
+ {
+ $this->setCheck(false);
+ }
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Issn.php b/library/vendor/Zend/Validate/Barcode/Issn.php
new file mode 100644
index 0000000..49c705d
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Issn.php
@@ -0,0 +1,118 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Issn extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = array(8, 13);
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789X';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_gtin';
+
+ /**
+ * Allows X on length of 8 chars
+ *
+ * @param string $value The barcode to check for allowed characters
+ * @return boolean
+ */
+ public function checkChars($value)
+ {
+ if (strlen($value) != 8) {
+ if (strpos($value, 'X') !== false) {
+ return false;
+ }
+ }
+
+ return parent::checkChars($value);
+ }
+
+ /**
+ * Validates the checksum
+ *
+ * @param string $value The barcode to check the checksum for
+ * @return boolean
+ */
+ public function checksum($value)
+ {
+ if (strlen($value) == 8) {
+ $this->_checksum = '_issn';
+ } else {
+ $this->_checksum = '_gtin';
+ }
+
+ return parent::checksum($value);
+ }
+
+ /**
+ * Validates the checksum ()
+ * ISSN implementation (reversed mod11)
+ *
+ * @param string $value The barcode to validate
+ * @return boolean
+ */
+ protected function _issn($value)
+ {
+ $checksum = substr($value, -1, 1);
+ $values = str_split(substr($value, 0, -1));
+ $check = 0;
+ $multi = 8;
+ foreach($values as $token) {
+ if ($token == 'X') {
+ $token = 10;
+ }
+
+ $check += ($token * $multi);
+ --$multi;
+ }
+
+ $check %= 11;
+ $check = 11 - $check;
+ if ($check == $checksum) {
+ return true;
+ } else if (($check == 10) && ($checksum == 'X')) {
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Itf14.php b/library/vendor/Zend/Validate/Barcode/Itf14.php
new file mode 100644
index 0000000..0ed97d1
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Itf14.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Itf14 extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = 14;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_gtin';
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Leitcode.php b/library/vendor/Zend/Validate/Barcode/Leitcode.php
new file mode 100644
index 0000000..a79acac
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Leitcode.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Leitcode extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = 14;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_identcode';
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Planet.php b/library/vendor/Zend/Validate/Barcode/Planet.php
new file mode 100644
index 0000000..96ed881
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Planet.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Planet extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = array(12, 14);
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_postnet';
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Postnet.php b/library/vendor/Zend/Validate/Barcode/Postnet.php
new file mode 100644
index 0000000..a0b0ca3
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Postnet.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Postnet extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = array(6, 7, 10, 12);
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_postnet';
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Royalmail.php b/library/vendor/Zend/Validate/Barcode/Royalmail.php
new file mode 100644
index 0000000..c4c2685
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Royalmail.php
@@ -0,0 +1,120 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Royalmail extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = -1;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
+
+ protected $_rows = array(
+ '0' => 1, '1' => 1, '2' => 1, '3' => 1, '4' => 1, '5' => 1,
+ '6' => 2, '7' => 2, '8' => 2, '9' => 2, 'A' => 2, 'B' => 2,
+ 'C' => 3, 'D' => 3, 'E' => 3, 'F' => 3, 'G' => 3, 'H' => 3,
+ 'I' => 4, 'J' => 4, 'K' => 4, 'L' => 4, 'M' => 4, 'N' => 4,
+ 'O' => 5, 'P' => 5, 'Q' => 5, 'R' => 5, 'S' => 5, 'T' => 5,
+ 'U' => 0, 'V' => 0, 'W' => 0, 'X' => 0, 'Y' => 0, 'Z' => 0,
+ );
+
+ protected $_columns = array(
+ '0' => 1, '1' => 2, '2' => 3, '3' => 4, '4' => 5, '5' => 0,
+ '6' => 1, '7' => 2, '8' => 3, '9' => 4, 'A' => 5, 'B' => 0,
+ 'C' => 1, 'D' => 2, 'E' => 3, 'F' => 4, 'G' => 5, 'H' => 0,
+ 'I' => 1, 'J' => 2, 'K' => 3, 'L' => 4, 'M' => 5, 'N' => 0,
+ 'O' => 1, 'P' => 2, 'Q' => 3, 'R' => 4, 'S' => 5, 'T' => 0,
+ 'U' => 1, 'V' => 2, 'W' => 3, 'X' => 4, 'Y' => 5, 'Z' => 0,
+ );
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_royalmail';
+
+ /**
+ * Validates the checksum ()
+ *
+ * @param string $value The barcode to validate
+ * @return boolean
+ */
+ protected function _royalmail($value)
+ {
+ $checksum = substr($value, -1, 1);
+ $values = str_split(substr($value, 0, -1));
+ $rowvalue = 0;
+ $colvalue = 0;
+ foreach($values as $row) {
+ $rowvalue += $this->_rows[$row];
+ $colvalue += $this->_columns[$row];
+ }
+
+ $rowvalue %= 6;
+ $colvalue %= 6;
+
+ $rowchkvalue = array_keys($this->_rows, $rowvalue);
+ $colchkvalue = array_keys($this->_columns, $colvalue);
+ $chkvalue = current(array_intersect($rowchkvalue, $colchkvalue));
+ if ($chkvalue == $checksum) {
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Allows start and stop tag within checked chars
+ *
+ * @param string $value The barcode to check for allowed characters
+ * @return boolean
+ */
+ public function checkChars($value)
+ {
+ if ($value[0] == '(') {
+ $value = substr($value, 1);
+
+ if ($value[strlen($value) - 1] == ')') {
+ $value = substr($value, 0, -1);
+ } else {
+ return false;
+ }
+ }
+
+ return parent::checkChars($value);
+ }
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Sscc.php b/library/vendor/Zend/Validate/Barcode/Sscc.php
new file mode 100644
index 0000000..e234bf1
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Sscc.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Sscc extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = 18;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_gtin';
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Upca.php b/library/vendor/Zend/Validate/Barcode/Upca.php
new file mode 100644
index 0000000..4b92bd6
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Upca.php
@@ -0,0 +1,51 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Upca extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = 12;
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_gtin';
+}
diff --git a/library/vendor/Zend/Validate/Barcode/Upce.php b/library/vendor/Zend/Validate/Barcode/Upce.php
new file mode 100644
index 0000000..8d8dd2a
--- /dev/null
+++ b/library/vendor/Zend/Validate/Barcode/Upce.php
@@ -0,0 +1,68 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Barcode_AdapterAbstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Barcode_Upce extends Zend_Validate_Barcode_AdapterAbstract
+{
+ /**
+ * Allowed barcode lengths
+ * @var integer
+ */
+ protected $_length = array(6, 7, 8);
+
+ /**
+ * Allowed barcode characters
+ * @var string
+ */
+ protected $_characters = '0123456789';
+
+ /**
+ * Checksum function
+ * @var string
+ */
+ protected $_checksum = '_gtin';
+
+ /**
+ * Overrides parent checkLength
+ *
+ * @param string $value Value
+ * @return boolean
+ */
+ public function checkLength($value)
+ {
+ if (strlen($value) != 8) {
+ $this->setCheck(false);
+ } else {
+ $this->setCheck(true);
+ }
+
+ return parent::checkLength($value);
+ }
+}
diff --git a/library/vendor/Zend/Validate/Between.php b/library/vendor/Zend/Validate/Between.php
new file mode 100644
index 0000000..09ba84d
--- /dev/null
+++ b/library/vendor/Zend/Validate/Between.php
@@ -0,0 +1,222 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Between extends Zend_Validate_Abstract
+{
+ /**
+ * Validation failure message key for when the value is not between the min and max, inclusively
+ */
+ const NOT_BETWEEN = 'notBetween';
+
+ /**
+ * Validation failure message key for when the value is not strictly between the min and max
+ */
+ const NOT_BETWEEN_STRICT = 'notBetweenStrict';
+
+ /**
+ * Validation failure message template definitions
+ *
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::NOT_BETWEEN => "'%value%' is not between '%min%' and '%max%', inclusively",
+ self::NOT_BETWEEN_STRICT => "'%value%' is not strictly between '%min%' and '%max%'"
+ );
+
+ /**
+ * Additional variables available for validation failure messages
+ *
+ * @var array
+ */
+ protected $_messageVariables = array(
+ 'min' => '_min',
+ 'max' => '_max'
+ );
+
+ /**
+ * Minimum value
+ *
+ * @var mixed
+ */
+ protected $_min;
+
+ /**
+ * Maximum value
+ *
+ * @var mixed
+ */
+ protected $_max;
+
+ /**
+ * Whether to do inclusive comparisons, allowing equivalence to min and/or max
+ *
+ * If false, then strict comparisons are done, and the value may equal neither
+ * the min nor max options
+ *
+ * @var boolean
+ */
+ protected $_inclusive;
+
+ /**
+ * Sets validator options
+ * Accepts the following option keys:
+ * 'min' => scalar, minimum border
+ * 'max' => scalar, maximum border
+ * 'inclusive' => boolean, inclusive border values
+ *
+ * @param array|Zend_Config $options
+ * @throws Zend_Validate_Exception
+ */
+ public function __construct($options)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (!is_array($options)) {
+ $options = func_get_args();
+ $temp['min'] = array_shift($options);
+ if (!empty($options)) {
+ $temp['max'] = array_shift($options);
+ }
+
+ if (!empty($options)) {
+ $temp['inclusive'] = array_shift($options);
+ }
+
+ $options = $temp;
+ }
+
+ if (!array_key_exists('min', $options) || !array_key_exists('max', $options)) {
+ throw new Zend_Validate_Exception("Missing option. 'min' and 'max' has to be given");
+ }
+
+ if (!array_key_exists('inclusive', $options)) {
+ $options['inclusive'] = true;
+ }
+
+ $this->setMin($options['min'])
+ ->setMax($options['max'])
+ ->setInclusive($options['inclusive']);
+ }
+
+ /**
+ * Returns the min option
+ *
+ * @return mixed
+ */
+ public function getMin()
+ {
+ return $this->_min;
+ }
+
+ /**
+ * Sets the min option
+ *
+ * @param mixed $min
+ * @return Zend_Validate_Between Provides a fluent interface
+ */
+ public function setMin($min)
+ {
+ $this->_min = $min;
+ return $this;
+ }
+
+ /**
+ * Returns the max option
+ *
+ * @return mixed
+ */
+ public function getMax()
+ {
+ return $this->_max;
+ }
+
+ /**
+ * Sets the max option
+ *
+ * @param mixed $max
+ * @return Zend_Validate_Between Provides a fluent interface
+ */
+ public function setMax($max)
+ {
+ $this->_max = $max;
+ return $this;
+ }
+
+ /**
+ * Returns the inclusive option
+ *
+ * @return boolean
+ */
+ public function getInclusive()
+ {
+ return $this->_inclusive;
+ }
+
+ /**
+ * Sets the inclusive option
+ *
+ * @param boolean $inclusive
+ * @return Zend_Validate_Between Provides a fluent interface
+ */
+ public function setInclusive($inclusive)
+ {
+ $this->_inclusive = $inclusive;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if $value is between min and max options, inclusively
+ * if inclusive option is true.
+ *
+ * @param mixed $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ $this->_setValue($value);
+
+ if ($this->_inclusive) {
+ if ($this->_min > $value || $value > $this->_max) {
+ $this->_error(self::NOT_BETWEEN);
+ return false;
+ }
+ } else {
+ if ($this->_min >= $value || $value >= $this->_max) {
+ $this->_error(self::NOT_BETWEEN_STRICT);
+ return false;
+ }
+ }
+ return true;
+ }
+
+}
diff --git a/library/vendor/Zend/Validate/Callback.php b/library/vendor/Zend/Validate/Callback.php
new file mode 100644
index 0000000..e333cad
--- /dev/null
+++ b/library/vendor/Zend/Validate/Callback.php
@@ -0,0 +1,170 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Callback extends Zend_Validate_Abstract
+{
+ /**
+ * Invalid callback
+ */
+ const INVALID_CALLBACK = 'callbackInvalid';
+
+ /**
+ * Invalid value
+ */
+ const INVALID_VALUE = 'callbackValue';
+
+ /**
+ * Validation failure message template definitions
+ *
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::INVALID_VALUE => "'%value%' is not valid",
+ self::INVALID_CALLBACK => "An exception has been raised within the callback",
+ );
+
+ /**
+ * Callback in a call_user_func format
+ *
+ * @var string|array
+ */
+ protected $_callback = null;
+
+ /**
+ * Default options to set for the filter
+ *
+ * @var mixed
+ */
+ protected $_options = array();
+
+ /**
+ * Sets validator options
+ *
+ * @param mixed $callback
+ * @throws Zend_Validate_Exception
+ */
+ public function __construct($callback = null)
+ {
+ if (is_callable($callback)) {
+ $this->setCallback($callback);
+ } elseif (is_array($callback)) {
+ if (isset($callback['callback'])) {
+ $this->setCallback($callback['callback']);
+ }
+ if (isset($callback['options'])) {
+ $this->setOptions($callback['options']);
+ }
+ }
+
+ if (null === ($initializedCallack = $this->getCallback())) {
+ throw new Zend_Validate_Exception('No callback registered');
+ }
+ }
+
+ /**
+ * Returns the set callback
+ *
+ * @return mixed
+ */
+ public function getCallback()
+ {
+ return $this->_callback;
+ }
+
+ /**
+ * Sets the callback
+ *
+ * @param string|array $callback
+ * @throws Zend_Validate_Exception
+ * @return Zend_Validate_Callback Provides a fluent interface
+ */
+ public function setCallback($callback)
+ {
+ if (!is_callable($callback)) {
+ throw new Zend_Validate_Exception('Invalid callback given');
+ }
+ $this->_callback = $callback;
+ return $this;
+ }
+
+ /**
+ * Returns the set options for the callback
+ *
+ * @return mixed
+ */
+ public function getOptions()
+ {
+ return $this->_options;
+ }
+
+ /**
+ * Sets options for the callback
+ *
+ * @param mixed $options
+ * @return Zend_Validate_Callback Provides a fluent interface
+ */
+ public function setOptions($options)
+ {
+ $this->_options = (array) $options;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if the set callback returns
+ * for the provided $value
+ *
+ * @param mixed $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ $this->_setValue($value);
+
+ $options = $this->getOptions();
+ $callback = $this->getCallback();
+ $args = func_get_args();
+ $options = array_merge($args, $options);
+
+ try {
+ if (!call_user_func_array($callback, $options)) {
+ $this->_error(self::INVALID_VALUE);
+ return false;
+ }
+ } catch (Exception $e) {
+ $this->_error(self::INVALID_CALLBACK);
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Ccnum.php b/library/vendor/Zend/Validate/Ccnum.php
new file mode 100644
index 0000000..150f64c
--- /dev/null
+++ b/library/vendor/Zend/Validate/Ccnum.php
@@ -0,0 +1,110 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Ccnum extends Zend_Validate_Abstract
+{
+ /**
+ * Validation failure message key for when the value is not of valid length
+ */
+ const LENGTH = 'ccnumLength';
+
+ /**
+ * Validation failure message key for when the value fails the mod-10 checksum
+ */
+ const CHECKSUM = 'ccnumChecksum';
+
+ /**
+ * Digits filter for input
+ *
+ * @var Zend_Filter_Digits
+ */
+ protected static $_filter = null;
+
+ /**
+ * Validation failure message template definitions
+ *
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::LENGTH => "'%value%' must contain between 13 and 19 digits",
+ self::CHECKSUM => "Luhn algorithm (mod-10 checksum) failed on '%value%'"
+ );
+
+ public function __construct()
+ {
+ trigger_error('Using the Ccnum validator is deprecated in favor of the CreditCard validator');
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if $value follows the Luhn algorithm (mod-10 checksum)
+ *
+ * @param string $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ $this->_setValue($value);
+
+ if (null === self::$_filter) {
+ /**
+ * @see Zend_Filter_Digits
+ */
+ self::$_filter = new Zend_Filter_Digits();
+ }
+
+ $valueFiltered = self::$_filter->filter($value);
+
+ $length = strlen($valueFiltered);
+
+ if ($length < 13 || $length > 19) {
+ $this->_error(self::LENGTH);
+ return false;
+ }
+
+ $sum = 0;
+ $weight = 2;
+
+ for ($i = $length - 2; $i >= 0; $i--) {
+ $digit = $weight * $valueFiltered[$i];
+ $sum += floor($digit / 10) + $digit % 10;
+ $weight = $weight % 2 + 1;
+ }
+
+ if ((10 - $sum % 10) % 10 != $valueFiltered[$length - 1]) {
+ $this->_error(self::CHECKSUM, $valueFiltered);
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/CreditCard.php b/library/vendor/Zend/Validate/CreditCard.php
new file mode 100644
index 0000000..1302626
--- /dev/null
+++ b/library/vendor/Zend/Validate/CreditCard.php
@@ -0,0 +1,316 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_CreditCard extends Zend_Validate_Abstract
+{
+ /**
+ * Detected CCI list
+ *
+ * @var string
+ */
+ const ALL = 'All';
+ const AMERICAN_EXPRESS = 'American_Express';
+ const UNIONPAY = 'Unionpay';
+ const DINERS_CLUB = 'Diners_Club';
+ const DINERS_CLUB_US = 'Diners_Club_US';
+ const DISCOVER = 'Discover';
+ const JCB = 'JCB';
+ const LASER = 'Laser';
+ const MAESTRO = 'Maestro';
+ const MASTERCARD = 'Mastercard';
+ const SOLO = 'Solo';
+ const VISA = 'Visa';
+
+ const CHECKSUM = 'creditcardChecksum';
+ const CONTENT = 'creditcardContent';
+ const INVALID = 'creditcardInvalid';
+ const LENGTH = 'creditcardLength';
+ const PREFIX = 'creditcardPrefix';
+ const SERVICE = 'creditcardService';
+ const SERVICEFAILURE = 'creditcardServiceFailure';
+
+ /**
+ * Validation failure message template definitions
+ *
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::CHECKSUM => "'%value%' seems to contain an invalid checksum",
+ self::CONTENT => "'%value%' must contain only digits",
+ self::INVALID => "Invalid type given. String expected",
+ self::LENGTH => "'%value%' contains an invalid amount of digits",
+ self::PREFIX => "'%value%' is not from an allowed institute",
+ self::SERVICE => "'%value%' seems to be an invalid creditcard number",
+ self::SERVICEFAILURE => "An exception has been raised while validating '%value%'",
+ );
+
+ /**
+ * List of allowed CCV lengths
+ *
+ * @var array
+ */
+ protected $_cardLength = array(
+ self::AMERICAN_EXPRESS => array(15),
+ self::DINERS_CLUB => array(14),
+ self::DINERS_CLUB_US => array(16),
+ self::DISCOVER => array(16),
+ self::JCB => array(16),
+ self::LASER => array(16, 17, 18, 19),
+ self::MAESTRO => array(12, 13, 14, 15, 16, 17, 18, 19),
+ self::MASTERCARD => array(16),
+ self::SOLO => array(16, 18, 19),
+ self::UNIONPAY => array(16, 17, 18, 19),
+ self::VISA => array(16),
+ );
+
+ /**
+ * List of accepted CCV provider tags
+ *
+ * @var array
+ */
+ protected $_cardType = array(
+ self::AMERICAN_EXPRESS => array('34', '37'),
+ self::DINERS_CLUB => array('300', '301', '302', '303', '304', '305', '36'),
+ self::DINERS_CLUB_US => array('54', '55'),
+ self::DISCOVER => array('6011', '622126', '622127', '622128', '622129', '62213',
+ '62214', '62215', '62216', '62217', '62218', '62219',
+ '6222', '6223', '6224', '6225', '6226', '6227', '6228',
+ '62290', '62291', '622920', '622921', '622922', '622923',
+ '622924', '622925', '644', '645', '646', '647', '648',
+ '649', '65'),
+ self::JCB => array('3528', '3529', '353', '354', '355', '356', '357', '358'),
+ self::LASER => array('6304', '6706', '6771', '6709'),
+ self::MAESTRO => array('5018', '5020', '5038', '6304', '6759', '6761', '6763'),
+ self::MASTERCARD => array('51', '52', '53', '54', '55'),
+ self::SOLO => array('6334', '6767'),
+ self::UNIONPAY => array('622126', '622127', '622128', '622129', '62213', '62214',
+ '62215', '62216', '62217', '62218', '62219', '6222', '6223',
+ '6224', '6225', '6226', '6227', '6228', '62290', '62291',
+ '622920', '622921', '622922', '622923', '622924', '622925'),
+ self::VISA => array('4'),
+ );
+
+ /**
+ * CCIs which are accepted by validation
+ *
+ * @var array
+ */
+ protected $_type = array();
+
+ /**
+ * Service callback for additional validation
+ *
+ * @var callback
+ */
+ protected $_service;
+
+ /**
+ * Constructor
+ *
+ * @param string|array|Zend_Config $options OPTIONAL Type of CCI to allow
+ */
+ public function __construct($options = array())
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (!is_array($options)) {
+ $options = func_get_args();
+ $temp['type'] = array_shift($options);
+ if (!empty($options)) {
+ $temp['service'] = array_shift($options);
+ }
+
+ $options = $temp;
+ }
+
+ if (!array_key_exists('type', $options)) {
+ $options['type'] = self::ALL;
+ }
+
+ $this->setType($options['type']);
+ if (array_key_exists('service', $options)) {
+ $this->setService($options['service']);
+ }
+ }
+
+ /**
+ * Returns a list of accepted CCIs
+ *
+ * @return array
+ */
+ public function getType()
+ {
+ return $this->_type;
+ }
+
+ /**
+ * Sets CCIs which are accepted by validation
+ *
+ * @param string|array $type Type to allow for validation
+ * @return Zend_Validate_CreditCard Provides a fluent interface
+ */
+ public function setType($type)
+ {
+ $this->_type = array();
+ return $this->addType($type);
+ }
+
+ /**
+ * Adds a CCI to be accepted by validation
+ *
+ * @param string|array $type Type to allow for validation
+ * @return Zend_Validate_CreditCard Provides a fluent interface
+ */
+ public function addType($type)
+ {
+ if (is_string($type)) {
+ $type = array($type);
+ }
+
+ foreach($type as $typ) {
+ if (defined('self::' . strtoupper($typ)) && !in_array($typ, $this->_type)) {
+ $this->_type[] = $typ;
+ }
+
+ if (($typ == self::ALL)) {
+ $this->_type = array_keys($this->_cardLength);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns the actual set service
+ *
+ * @return callback
+ */
+ public function getService()
+ {
+ return $this->_service;
+ }
+
+ /**
+ * Sets a new callback for service validation
+ *
+ * @param mixed $service
+ * @throws Zend_Validate_Exception
+ * @return $this
+ */
+ public function setService($service)
+ {
+ if (!is_callable($service)) {
+ throw new Zend_Validate_Exception('Invalid callback given');
+ }
+
+ $this->_service = $service;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if $value follows the Luhn algorithm (mod-10 checksum)
+ *
+ * @param string $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ $this->_setValue($value);
+
+ if (!is_string($value)) {
+ $this->_error(self::INVALID, $value);
+ return false;
+ }
+
+ if (!ctype_digit($value)) {
+ $this->_error(self::CONTENT, $value);
+ return false;
+ }
+
+ $length = strlen($value);
+ $types = $this->getType();
+ $foundp = false;
+ $foundl = false;
+ foreach ($types as $type) {
+ foreach ($this->_cardType[$type] as $prefix) {
+ if (substr($value, 0, strlen($prefix)) == $prefix) {
+ $foundp = true;
+ if (in_array($length, $this->_cardLength[$type])) {
+ $foundl = true;
+ break 2;
+ }
+ }
+ }
+ }
+
+ if ($foundp == false){
+ $this->_error(self::PREFIX, $value);
+ return false;
+ }
+
+ if ($foundl == false) {
+ $this->_error(self::LENGTH, $value);
+ return false;
+ }
+
+ $sum = 0;
+ $weight = 2;
+
+ for ($i = $length - 2; $i >= 0; $i--) {
+ $digit = $weight * $value[$i];
+ $sum += floor($digit / 10) + $digit % 10;
+ $weight = $weight % 2 + 1;
+ }
+
+ if ((10 - $sum % 10) % 10 != $value[$length - 1]) {
+ $this->_error(self::CHECKSUM, $value);
+ return false;
+ }
+
+ if (!empty($this->_service)) {
+ try {
+ $callback = new Zend_Validate_Callback($this->_service);
+ $callback->setOptions($this->_type);
+ if (!$callback->isValid($value)) {
+ $this->_error(self::SERVICE, $value);
+ return false;
+ }
+ } catch (Zend_Exception $e) {
+ $this->_error(self::SERVICEFAILURE, $value);
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Date.php b/library/vendor/Zend/Validate/Date.php
new file mode 100644
index 0000000..3851a8e
--- /dev/null
+++ b/library/vendor/Zend/Validate/Date.php
@@ -0,0 +1,253 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Date extends Zend_Validate_Abstract
+{
+ const INVALID = 'dateInvalid';
+ const INVALID_DATE = 'dateInvalidDate';
+ const FALSEFORMAT = 'dateFalseFormat';
+
+ /**
+ * Validation failure message template definitions
+ *
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::INVALID => "Invalid type given. String, integer, array or Zend_Date expected",
+ self::INVALID_DATE => "'%value%' does not appear to be a valid date",
+ self::FALSEFORMAT => "'%value%' does not fit the date format '%format%'",
+ );
+
+ /**
+ * @var array
+ */
+ protected $_messageVariables = array(
+ 'format' => '_format'
+ );
+
+ /**
+ * Optional format
+ *
+ * @var string|null
+ */
+ protected $_format;
+
+ /**
+ * Optional locale
+ *
+ * @var string|Zend_Locale|null
+ */
+ protected $_locale;
+
+ /**
+ * Sets validator options
+ *
+ * @param string|array|Zend_Config $options OPTIONAL
+ */
+ public function __construct($options = array())
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (!is_array($options)) {
+ $options = func_get_args();
+ $temp['format'] = array_shift($options);
+ if (!empty($options)) {
+ $temp['locale'] = array_shift($options);
+ }
+
+ $options = $temp;
+ }
+
+ if (array_key_exists('format', $options)) {
+ $this->setFormat($options['format']);
+ }
+
+ if (!array_key_exists('locale', $options)) {
+ if (Zend_Registry::isRegistered('Zend_Locale')) {
+ $options['locale'] = Zend_Registry::get('Zend_Locale');
+ }
+ }
+
+ if (array_key_exists('locale', $options)) {
+ $this->setLocale($options['locale']);
+ }
+ }
+
+ /**
+ * Returns the locale option
+ *
+ * @return string|Zend_Locale|null
+ */
+ public function getLocale()
+ {
+ return $this->_locale;
+ }
+
+ /**
+ * Sets the locale option
+ *
+ * @param string|Zend_Locale $locale
+ * @return Zend_Validate_Date provides a fluent interface
+ */
+ public function setLocale($locale = null)
+ {
+ $this->_locale = Zend_Locale::findLocale($locale);
+ return $this;
+ }
+
+ /**
+ * Returns the locale option
+ *
+ * @return string|null
+ */
+ public function getFormat()
+ {
+ return $this->_format;
+ }
+
+ /**
+ * Sets the format option
+ *
+ * @param string $format
+ * @return Zend_Validate_Date provides a fluent interface
+ */
+ public function setFormat($format = null)
+ {
+ $this->_format = $format;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if $value is a valid date of the format YYYY-MM-DD
+ * If optional $format or $locale is set the date format is checked
+ * according to Zend_Date, see Zend_Date::isDate()
+ *
+ * @param string|array|Zend_Date $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ if (!is_string($value) && !is_int($value) && !is_float($value) &&
+ !is_array($value) && !($value instanceof Zend_Date)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ $this->_setValue($value);
+
+ if (($this->_format !== null) || ($this->_locale !== null) || is_array($value) ||
+ $value instanceof Zend_Date) {
+ if (!Zend_Date::isDate($value, $this->_format, $this->_locale)) {
+ if ($this->_checkFormat($value) === false) {
+ $this->_error(self::FALSEFORMAT);
+ } else {
+ $this->_error(self::INVALID_DATE);
+ }
+ return false;
+ }
+ } else {
+ if (!preg_match('/^\d{4}-\d{2}-\d{2}$/', $value)) {
+ $this->_format = 'yyyy-MM-dd';
+ $this->_error(self::FALSEFORMAT);
+ $this->_format = null;
+ return false;
+ }
+
+ list($year, $month, $day) = sscanf($value, '%d-%d-%d');
+
+ if (!checkdate($month, $day, $year)) {
+ $this->_error(self::INVALID_DATE);
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Check if the given date fits the given format
+ *
+ * @param string $value Date to check
+ * @return boolean False when date does not fit the format
+ */
+ private function _checkFormat($value)
+ {
+ try {
+ $parsed = Zend_Locale_Format::getDate($value, array(
+ 'date_format' => $this->_format, 'format_type' => 'iso',
+ 'fix_date' => false));
+ if (isset($parsed['year']) and ((strpos(strtoupper($this->_format), 'YY') !== false) and
+ (strpos(strtoupper($this->_format), 'YYYY') === false))) {
+ $parsed['year'] = Zend_Date::getFullYear($parsed['year']);
+ }
+ } catch (Exception $e) {
+ // Date can not be parsed
+ return false;
+ }
+
+ if (((strpos($this->_format, 'Y') !== false) or (strpos($this->_format, 'y') !== false)) and
+ (!isset($parsed['year']))) {
+ // Year expected but not found
+ return false;
+ }
+
+ if ((strpos($this->_format, 'M') !== false) and (!isset($parsed['month']))) {
+ // Month expected but not found
+ return false;
+ }
+
+ if ((strpos($this->_format, 'd') !== false) and (!isset($parsed['day']))) {
+ // Day expected but not found
+ return false;
+ }
+
+ if (((strpos($this->_format, 'H') !== false) or (strpos($this->_format, 'h') !== false)) and
+ (!isset($parsed['hour']))) {
+ // Hour expected but not found
+ return false;
+ }
+
+ if ((strpos($this->_format, 'm') !== false) and (!isset($parsed['minute']))) {
+ // Minute expected but not found
+ return false;
+ }
+
+ if ((strpos($this->_format, 's') !== false) and (!isset($parsed['second']))) {
+ // Second expected but not found
+ return false;
+ }
+
+ // Date fits the format
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Db/Abstract.php b/library/vendor/Zend/Validate/Db/Abstract.php
new file mode 100644
index 0000000..b08b1ca
--- /dev/null
+++ b/library/vendor/Zend/Validate/Db/Abstract.php
@@ -0,0 +1,350 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * Class for Database record validation
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @uses Zend_Validate_Abstract
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_Validate_Db_Abstract extends Zend_Validate_Abstract
+{
+ /**
+ * Error constants
+ */
+ const ERROR_NO_RECORD_FOUND = 'noRecordFound';
+ const ERROR_RECORD_FOUND = 'recordFound';
+
+ /**
+ * @var array Message templates
+ */
+ protected $_messageTemplates = array(
+ self::ERROR_NO_RECORD_FOUND => "No record matching '%value%' was found",
+ self::ERROR_RECORD_FOUND => "A record matching '%value%' was found",
+ );
+
+ /**
+ * @var string
+ */
+ protected $_schema = null;
+
+ /**
+ * @var string
+ */
+ protected $_table = '';
+
+ /**
+ * @var string
+ */
+ protected $_field = '';
+
+ /**
+ * @var mixed
+ */
+ protected $_exclude = null;
+
+ /**
+ * Database adapter to use. If null isValid() will use Zend_Db::getInstance instead
+ *
+ * @var unknown_type
+ */
+ protected $_adapter = null;
+
+ /**
+ * Select object to use. can be set, or will be auto-generated
+ * @var Zend_Db_Select
+ */
+ protected $_select;
+
+ /**
+ * Provides basic configuration for use with Zend_Validate_Db Validators
+ * Setting $exclude allows a single record to be excluded from matching.
+ * Exclude can either be a String containing a where clause, or an array with `field` and `value` keys
+ * to define the where clause added to the sql.
+ * A database adapter may optionally be supplied to avoid using the registered default adapter.
+ *
+ * The following option keys are supported:
+ * 'table' => The database table to validate against
+ * 'schema' => The schema keys
+ * 'field' => The field to check for a match
+ * 'exclude' => An optional where clause or field/value pair to exclude from the query
+ * 'adapter' => An optional database adapter to use
+ *
+ * @param array|Zend_Config $options Options to use for this validator
+ * @throws Zend_Validate_Exception
+ */
+ public function __construct($options)
+ {
+ if ($options instanceof Zend_Db_Select) {
+ $this->setSelect($options);
+ return;
+ }
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (func_num_args() > 1) {
+ $options = func_get_args();
+ $temp['table'] = array_shift($options);
+ $temp['field'] = array_shift($options);
+ if (!empty($options)) {
+ $temp['exclude'] = array_shift($options);
+ }
+
+ if (!empty($options)) {
+ $temp['adapter'] = array_shift($options);
+ }
+
+ $options = $temp;
+ }
+
+ if (!array_key_exists('table', $options) && !array_key_exists('schema', $options)) {
+ throw new Zend_Validate_Exception('Table or Schema option missing!');
+ }
+
+ if (!array_key_exists('field', $options)) {
+ throw new Zend_Validate_Exception('Field option missing!');
+ }
+
+ if (array_key_exists('adapter', $options)) {
+ $this->setAdapter($options['adapter']);
+ }
+
+ if (array_key_exists('exclude', $options)) {
+ $this->setExclude($options['exclude']);
+ }
+
+ $this->setField($options['field']);
+ if (array_key_exists('table', $options)) {
+ $this->setTable($options['table']);
+ }
+
+ if (array_key_exists('schema', $options)) {
+ $this->setSchema($options['schema']);
+ }
+ }
+
+ /**
+ * Returns the set adapter
+ *
+ * @throws Zend_Validate_Exception
+ * @return Zend_Db_Adapter
+ */
+ public function getAdapter()
+ {
+ /**
+ * Check for an adapter being defined. if not, fetch the default adapter.
+ */
+ if ($this->_adapter === null) {
+ $this->_adapter = Zend_Db_Table_Abstract::getDefaultAdapter();
+ if (null === $this->_adapter) {
+ throw new Zend_Validate_Exception('No database adapter present');
+ }
+ }
+ return $this->_adapter;
+ }
+
+ /**
+ * Sets a new database adapter
+ *
+ * @param Zend_Db_Adapter_Abstract $adapter
+ * @throws Zend_Validate_Exception
+ * @return Zend_Validate_Db_Abstract
+ */
+ public function setAdapter($adapter)
+ {
+ if (!($adapter instanceof Zend_Db_Adapter_Abstract)) {
+ throw new Zend_Validate_Exception('Adapter option must be a database adapter!');
+ }
+
+ $this->_adapter = $adapter;
+ return $this;
+ }
+
+ /**
+ * Returns the set exclude clause
+ *
+ * @return string|array
+ */
+ public function getExclude()
+ {
+ return $this->_exclude;
+ }
+
+ /**
+ * Sets a new exclude clause
+ *
+ * @param string|array $exclude
+ * @return Zend_Validate_Db_Abstract
+ */
+ public function setExclude($exclude)
+ {
+ $this->_exclude = $exclude;
+ return $this;
+ }
+
+ /**
+ * Returns the set field
+ *
+ * @return string|array
+ */
+ public function getField()
+ {
+ return $this->_field;
+ }
+
+ /**
+ * Sets a new field
+ *
+ * @param string $field
+ * @return Zend_Validate_Db_Abstract
+ */
+ public function setField($field)
+ {
+ $this->_field = (string) $field;
+ return $this;
+ }
+
+ /**
+ * Returns the set table
+ *
+ * @return string
+ */
+ public function getTable()
+ {
+ return $this->_table;
+ }
+
+ /**
+ * Sets a new table
+ *
+ * @param string $table
+ * @return Zend_Validate_Db_Abstract
+ */
+ public function setTable($table)
+ {
+ $this->_table = (string) $table;
+ return $this;
+ }
+
+ /**
+ * Returns the set schema
+ *
+ * @return string
+ */
+ public function getSchema()
+ {
+ return $this->_schema;
+ }
+
+ /**
+ * Sets a new schema
+ *
+ * @param string $schema
+ * @return Zend_Validate_Db_Abstract
+ */
+ public function setSchema($schema)
+ {
+ $this->_schema = $schema;
+ return $this;
+ }
+
+ /**
+ * Sets the select object to be used by the validator
+ *
+ * @param Zend_Db_Select $select
+ * @throws Zend_Validate_Exception
+ * @return Zend_Validate_Db_Abstract
+ */
+ public function setSelect($select)
+ {
+ if (!$select instanceof Zend_Db_Select) {
+ throw new Zend_Validate_Exception('Select option must be a valid ' .
+ 'Zend_Db_Select object');
+ }
+ $this->_select = $select;
+ return $this;
+ }
+
+ /**
+ * Gets the select object to be used by the validator.
+ * If no select object was supplied to the constructor,
+ * then it will auto-generate one from the given table,
+ * schema, field, and adapter options.
+ *
+ * @return Zend_Db_Select The Select object which will be used
+ */
+ public function getSelect()
+ {
+ if (null === $this->_select) {
+ $db = $this->getAdapter();
+ /**
+ * Build select object
+ */
+ $select = new Zend_Db_Select($db);
+ $select->from($this->_table, array($this->_field), $this->_schema);
+ if ($db->supportsParameters('named')) {
+ $select->where($db->quoteIdentifier($this->_field, true).' = :value'); // named
+ } else {
+ $select->where($db->quoteIdentifier($this->_field, true).' = ?'); // positional
+ }
+ if ($this->_exclude !== null) {
+ if (is_array($this->_exclude)) {
+ $select->where(
+ $db->quoteIdentifier($this->_exclude['field'], true) .
+ ' != ?', $this->_exclude['value']
+ );
+ } else {
+ $select->where($this->_exclude);
+ }
+ }
+ $select->limit(1);
+ $this->_select = $select;
+ }
+ return $this->_select;
+ }
+
+ /**
+ * Run query and returns matches, or null if no matches are found.
+ *
+ * @param String $value
+ * @return Array when matches are found.
+ */
+ protected function _query($value)
+ {
+ $select = $this->getSelect();
+ /**
+ * Run query
+ */
+ $result = $select->getAdapter()->fetchRow(
+ $select,
+ array('value' => $value), // this should work whether db supports positional or named params
+ Zend_Db::FETCH_ASSOC
+ );
+
+ return $result;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Db/NoRecordExists.php b/library/vendor/Zend/Validate/Db/NoRecordExists.php
new file mode 100644
index 0000000..3d1628a
--- /dev/null
+++ b/library/vendor/Zend/Validate/Db/NoRecordExists.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Db_Abstract
+ */
+
+/**
+ * Confirms a record does not exist in a table.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @uses Zend_Validate_Db_Abstract
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Db_NoRecordExists extends Zend_Validate_Db_Abstract
+{
+ public function isValid($value)
+ {
+ $valid = true;
+ $this->_setValue($value);
+
+ $result = $this->_query($value);
+ if ($result) {
+ $valid = false;
+ $this->_error(self::ERROR_RECORD_FOUND);
+ }
+
+ return $valid;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Db/RecordExists.php b/library/vendor/Zend/Validate/Db/RecordExists.php
new file mode 100644
index 0000000..fb65f70
--- /dev/null
+++ b/library/vendor/Zend/Validate/Db/RecordExists.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Db_Abstract
+ */
+
+/**
+ * Confirms a record exists in a table.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @uses Zend_Validate_Db_Abstract
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Db_RecordExists extends Zend_Validate_Db_Abstract
+{
+ public function isValid($value)
+ {
+ $valid = true;
+ $this->_setValue($value);
+
+ $result = $this->_query($value);
+ if (!$result) {
+ $valid = false;
+ $this->_error(self::ERROR_NO_RECORD_FOUND);
+ }
+
+ return $valid;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Digits.php b/library/vendor/Zend/Validate/Digits.php
new file mode 100644
index 0000000..b18b590
--- /dev/null
+++ b/library/vendor/Zend/Validate/Digits.php
@@ -0,0 +1,89 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Digits extends Zend_Validate_Abstract
+{
+ const NOT_DIGITS = 'notDigits';
+ const STRING_EMPTY = 'digitsStringEmpty';
+ const INVALID = 'digitsInvalid';
+
+ /**
+ * Digits filter used for validation
+ *
+ * @var Zend_Filter_Digits
+ */
+ protected static $_filter = null;
+
+ /**
+ * Validation failure message template definitions
+ *
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::NOT_DIGITS => "'%value%' must contain only digits",
+ self::STRING_EMPTY => "'%value%' is an empty string",
+ self::INVALID => "Invalid type given. String, integer or float expected",
+ );
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if $value only contains digit characters
+ *
+ * @param string $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ if (!is_string($value) && !is_int($value) && !is_float($value)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ $this->_setValue((string) $value);
+
+ if ('' === $this->_value) {
+ $this->_error(self::STRING_EMPTY);
+ return false;
+ }
+
+ if (null === self::$_filter) {
+ self::$_filter = new Zend_Filter_Digits();
+ }
+
+ if ($this->_value !== self::$_filter->filter($this->_value)) {
+ $this->_error(self::NOT_DIGITS);
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/EmailAddress.php b/library/vendor/Zend/Validate/EmailAddress.php
new file mode 100644
index 0000000..de7726a
--- /dev/null
+++ b/library/vendor/Zend/Validate/EmailAddress.php
@@ -0,0 +1,571 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @see Zend_Validate_Hostname
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_EmailAddress extends Zend_Validate_Abstract
+{
+ const INVALID = 'emailAddressInvalid';
+ const INVALID_FORMAT = 'emailAddressInvalidFormat';
+ const INVALID_HOSTNAME = 'emailAddressInvalidHostname';
+ const INVALID_MX_RECORD = 'emailAddressInvalidMxRecord';
+ const INVALID_SEGMENT = 'emailAddressInvalidSegment';
+ const DOT_ATOM = 'emailAddressDotAtom';
+ const QUOTED_STRING = 'emailAddressQuotedString';
+ const INVALID_LOCAL_PART = 'emailAddressInvalidLocalPart';
+ const LENGTH_EXCEEDED = 'emailAddressLengthExceeded';
+
+ /**
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::INVALID => "Invalid type given. String expected",
+ self::INVALID_FORMAT => "'%value%' is not a valid email address in the basic format local-part@hostname",
+ self::INVALID_HOSTNAME => "'%hostname%' is not a valid hostname for email address '%value%'",
+ self::INVALID_MX_RECORD => "'%hostname%' does not appear to have a valid MX record for the email address '%value%'",
+ self::INVALID_SEGMENT => "'%hostname%' is not in a routable network segment. The email address '%value%' should not be resolved from public network",
+ self::DOT_ATOM => "'%localPart%' can not be matched against dot-atom format",
+ self::QUOTED_STRING => "'%localPart%' can not be matched against quoted-string format",
+ self::INVALID_LOCAL_PART => "'%localPart%' is not a valid local part for email address '%value%'",
+ self::LENGTH_EXCEEDED => "'%value%' exceeds the allowed length",
+ );
+
+ /**
+ * As of RFC5753 (JAN 2010), the following blocks are no longer reserved:
+ * - 128.0.0.0/16
+ * - 191.255.0.0/16
+ * - 223.255.255.0/24
+ * @see http://tools.ietf.org/html/rfc5735#page-6
+ *
+ * As of RFC6598 (APR 2012), the following blocks are now reserved:
+ * - 100.64.0.0/10
+ * @see http://tools.ietf.org/html/rfc6598#section-7
+ *
+ * @see http://en.wikipedia.org/wiki/IPv4
+ * @var array
+ */
+ protected $_invalidIp = array(
+ '0' => '0.0.0.0/8',
+ '10' => '10.0.0.0/8',
+ '100' => '100.64.0.0/10',
+ '127' => '127.0.0.0/8',
+ '169' => '169.254.0.0/16',
+ '172' => '172.16.0.0/12',
+ '192' => array(
+ '192.0.0.0/24',
+ '192.0.2.0/24',
+ '192.88.99.0/24',
+ '192.168.0.0/16'
+ ),
+ '198' => '198.18.0.0/15',
+ '224' => '224.0.0.0/4',
+ '240' => '240.0.0.0/4'
+ );
+
+ /**
+ * @var array
+ */
+ protected $_messageVariables = array(
+ 'hostname' => '_hostname',
+ 'localPart' => '_localPart'
+ );
+
+ /**
+ * @var string
+ */
+ protected $_hostname;
+
+ /**
+ * @var string
+ */
+ protected $_localPart;
+
+ /**
+ * Internal options array
+ */
+ protected $_options = array(
+ 'mx' => false,
+ 'deep' => false,
+ 'domain' => true,
+ 'allow' => Zend_Validate_Hostname::ALLOW_DNS,
+ 'hostname' => null
+ );
+
+ /**
+ * Instantiates hostname validator for local use
+ *
+ * The following option keys are supported:
+ * 'hostname' => A hostname validator, see Zend_Validate_Hostname
+ * 'allow' => Options for the hostname validator, see Zend_Validate_Hostname::ALLOW_*
+ * 'mx' => If MX check should be enabled, boolean
+ * 'deep' => If a deep MX check should be done, boolean
+ *
+ * @param array|string|Zend_Config $options OPTIONAL
+ */
+ public function __construct($options = array())
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (!is_array($options)) {
+ $options = func_get_args();
+ $temp['allow'] = array_shift($options);
+ if (!empty($options)) {
+ $temp['mx'] = array_shift($options);
+ }
+
+ if (!empty($options)) {
+ $temp['hostname'] = array_shift($options);
+ }
+
+ $options = $temp;
+ }
+
+ $options += $this->_options;
+ $this->setOptions($options);
+ }
+
+ /**
+ * Returns all set Options
+ *
+ * @return array
+ */
+ public function getOptions()
+ {
+ return $this->_options;
+ }
+
+ /**
+ * Set options for the email validator
+ *
+ * @param array $options
+ * @return Zend_Validate_EmailAddress Provides a fluent inteface
+ */
+ public function setOptions(array $options = array())
+ {
+ if (array_key_exists('messages', $options)) {
+ $this->setMessages($options['messages']);
+ }
+
+ if (array_key_exists('hostname', $options)) {
+ if (array_key_exists('allow', $options)) {
+ $this->setHostnameValidator($options['hostname'], $options['allow']);
+ } else {
+ $this->setHostnameValidator($options['hostname']);
+ }
+ } elseif ($this->_options['hostname'] == null) {
+ $this->setHostnameValidator();
+ }
+
+ if (array_key_exists('mx', $options)) {
+ $this->setValidateMx($options['mx']);
+ }
+
+ if (array_key_exists('deep', $options)) {
+ $this->setDeepMxCheck($options['deep']);
+ }
+
+ if (array_key_exists('domain', $options)) {
+ $this->setDomainCheck($options['domain']);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Sets the validation failure message template for a particular key
+ * Adds the ability to set messages to the attached hostname validator
+ *
+ * @param string $messageString
+ * @param string $messageKey OPTIONAL
+ * @return Zend_Validate_Abstract Provides a fluent interface
+ * @throws Zend_Validate_Exception
+ */
+ public function setMessage($messageString, $messageKey = null)
+ {
+ if ($messageKey === null) {
+ $this->_options['hostname']->setMessage($messageString);
+ parent::setMessage($messageString);
+ return $this;
+ }
+
+ if (!isset($this->_messageTemplates[$messageKey])) {
+ $this->_options['hostname']->setMessage($messageString, $messageKey);
+ }
+
+ $this->_messageTemplates[$messageKey] = $messageString;
+ return $this;
+ }
+
+ /**
+ * Returns the set hostname validator
+ *
+ * @return Zend_Validate_Hostname
+ */
+ public function getHostnameValidator()
+ {
+ return $this->_options['hostname'];
+ }
+
+ /**
+ * @param Zend_Validate_Hostname $hostnameValidator OPTIONAL
+ * @param int $allow OPTIONAL
+ * @return $this
+ */
+ public function setHostnameValidator(Zend_Validate_Hostname $hostnameValidator = null, $allow = Zend_Validate_Hostname::ALLOW_DNS)
+ {
+ if (!$hostnameValidator) {
+ $hostnameValidator = new Zend_Validate_Hostname($allow);
+ }
+
+ $this->_options['hostname'] = $hostnameValidator;
+ $this->_options['allow'] = $allow;
+ return $this;
+ }
+
+ /**
+ * Whether MX checking via getmxrr is supported or not
+ *
+ * This currently only works on UNIX systems
+ *
+ * @return boolean
+ */
+ public function validateMxSupported()
+ {
+ return function_exists('getmxrr');
+ }
+
+ /**
+ * Returns the set validateMx option
+ *
+ * @return boolean
+ */
+ public function getValidateMx()
+ {
+ return $this->_options['mx'];
+ }
+
+ /**
+ * Set whether we check for a valid MX record via DNS
+ *
+ * This only applies when DNS hostnames are validated
+ *
+ * @param boolean $mx Set allowed to true to validate for MX records, and false to not validate them
+ * @throws Zend_Validate_Exception
+ * @return Zend_Validate_EmailAddress Provides a fluent inteface
+ */
+ public function setValidateMx($mx)
+ {
+ if ((bool) $mx && !$this->validateMxSupported()) {
+ throw new Zend_Validate_Exception('MX checking not available on this system');
+ }
+
+ $this->_options['mx'] = (bool) $mx;
+ return $this;
+ }
+
+ /**
+ * Returns the set deepMxCheck option
+ *
+ * @return boolean
+ */
+ public function getDeepMxCheck()
+ {
+ return $this->_options['deep'];
+ }
+
+ /**
+ * Set whether we check MX record should be a deep validation
+ *
+ * @param boolean $deep Set deep to true to perform a deep validation process for MX records
+ * @return Zend_Validate_EmailAddress Provides a fluent inteface
+ */
+ public function setDeepMxCheck($deep)
+ {
+ $this->_options['deep'] = (bool) $deep;
+ return $this;
+ }
+
+ /**
+ * Returns the set domainCheck option
+ *
+ * @return unknown
+ */
+ public function getDomainCheck()
+ {
+ return $this->_options['domain'];
+ }
+
+ /**
+ * Sets if the domain should also be checked
+ * or only the local part of the email address
+ *
+ * @param boolean $domain
+ * @return Zend_Validate_EmailAddress Provides a fluent inteface
+ */
+ public function setDomainCheck($domain = true)
+ {
+ $this->_options['domain'] = (boolean) $domain;
+ return $this;
+ }
+
+ /**
+ * Returns if the given host is reserved
+ *
+ * @param string $host
+ * @return boolean
+ */
+ private function _isReserved($host){
+ if (!preg_match('/^([0-9]{1,3}\.){3}[0-9]{1,3}$/', $host)) {
+ $host = gethostbyname($host);
+ }
+
+ $octet = explode('.',$host);
+ if ((int)$octet[0] >= 224) {
+ return true;
+ } else if (array_key_exists($octet[0], $this->_invalidIp)) {
+ foreach ((array)$this->_invalidIp[$octet[0]] as $subnetData) {
+ // we skip the first loop as we already know that octet matches
+ for ($i = 1; $i < 4; $i++) {
+ if (strpos($subnetData, $octet[$i]) !== $i * 4) {
+ break;
+ }
+ }
+
+ $host = explode("/", $subnetData);
+ $binaryHost = "";
+ $tmp = explode(".", $host[0]);
+ for ($i = 0; $i < 4 ; $i++) {
+ $binaryHost .= str_pad(decbin($tmp[$i]), 8, "0", STR_PAD_LEFT);
+ }
+
+ $segmentData = array(
+ 'network' => (int)$this->_toIp(str_pad(substr($binaryHost, 0, $host[1]), 32, 0)),
+ 'broadcast' => (int)$this->_toIp(str_pad(substr($binaryHost, 0, $host[1]), 32, 1))
+ );
+
+ for ($j = $i; $j < 4; $j++) {
+ if ((int)$octet[$j] < $segmentData['network'][$j] ||
+ (int)$octet[$j] > $segmentData['broadcast'][$j]) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Converts a binary string to an IP address
+ *
+ * @param string $binary
+ * @return mixed
+ */
+ private function _toIp($binary)
+ {
+ $ip = array();
+ $tmp = explode(".", chunk_split($binary, 8, "."));
+ for ($i = 0; $i < 4 ; $i++) {
+ $ip[$i] = bindec($tmp[$i]);
+ }
+
+ return $ip;
+ }
+
+ /**
+ * Internal method to validate the local part of the email address
+ *
+ * @return boolean
+ */
+ private function _validateLocalPart()
+ {
+ // First try to match the local part on the common dot-atom format
+ $result = false;
+
+ // Dot-atom characters are: 1*atext *("." 1*atext)
+ // atext: ALPHA / DIGIT / and "!", "#", "$", "%", "&", "'", "*",
+ // "+", "-", "/", "=", "?", "^", "_", "`", "{", "|", "}", "~"
+ $atext = 'a-zA-Z0-9\x21\x23\x24\x25\x26\x27\x2a\x2b\x2d\x2f\x3d\x3f\x5e\x5f\x60\x7b\x7c\x7d\x7e';
+ if (preg_match('/^[' . $atext . ']+(\x2e+[' . $atext . ']+)*$/', $this->_localPart)) {
+ $result = true;
+ } else {
+ // Try quoted string format (RFC 5321 Chapter 4.1.2)
+
+ // Quoted-string characters are: DQUOTE *(qtext/quoted-pair) DQUOTE
+ $qtext = '\x20-\x21\x23-\x5b\x5d-\x7e'; // %d32-33 / %d35-91 / %d93-126
+ $quotedPair = '\x20-\x7e'; // %d92 %d32-126
+ if (preg_match('/^"(['. $qtext .']|\x5c[' . $quotedPair . '])*"$/', $this->localPart)) {
+ $result = true;
+ } else {
+ $this->_error(self::DOT_ATOM);
+ $this->_error(self::QUOTED_STRING);
+ $this->_error(self::INVALID_LOCAL_PART);
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Internal method to validate the servers MX records
+ *
+ * @return boolean
+ */
+ private function _validateMXRecords()
+ {
+ $mxHosts = array();
+ $hostname = $this->_hostname;
+
+ //decode IDN domain name if possible
+ if (function_exists('idn_to_ascii')) {
+ $hostname = idn_to_ascii($this->_hostname);
+ }
+
+ $result = getmxrr($hostname, $mxHosts);
+ if (!$result) {
+ $this->_error(self::INVALID_MX_RECORD);
+ } else if ($this->_options['deep'] && function_exists('checkdnsrr')) {
+ $validAddress = false;
+ $reserved = true;
+ foreach ($mxHosts as $hostname) {
+ $res = $this->_isReserved($hostname);
+ if (!$res) {
+ $reserved = false;
+ }
+
+ if (!$res
+ && (checkdnsrr($hostname, "A")
+ || checkdnsrr($hostname, "AAAA")
+ || checkdnsrr($hostname, "A6"))) {
+ $validAddress = true;
+ break;
+ }
+ }
+
+ if (!$validAddress) {
+ $result = false;
+ if ($reserved) {
+ $this->_error(self::INVALID_SEGMENT);
+ } else {
+ $this->_error(self::INVALID_MX_RECORD);
+ }
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * Internal method to validate the hostname part of the email address
+ *
+ * @return boolean
+ */
+ private function _validateHostnamePart()
+ {
+ $hostname = $this->_options['hostname']->setTranslator($this->getTranslator())
+ ->isValid($this->_hostname);
+ if (!$hostname) {
+ $this->_error(self::INVALID_HOSTNAME);
+
+ // Get messages and errors from hostnameValidator
+ foreach ($this->_options['hostname']->getMessages() as $code => $message) {
+ $this->_messages[$code] = $message;
+ }
+
+ foreach ($this->_options['hostname']->getErrors() as $error) {
+ $this->_errors[] = $error;
+ }
+ } else if ($this->_options['mx']) {
+ // MX check on hostname
+ $hostname = $this->_validateMXRecords();
+ }
+
+ return $hostname;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if $value is a valid email address
+ * according to RFC2822
+ *
+ * @link http://www.ietf.org/rfc/rfc2822.txt RFC2822
+ * @link http://www.columbia.edu/kermit/ascii.html US-ASCII characters
+ * @param string $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ if (!is_string($value)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ $matches = array();
+ $length = true;
+ $this->_setValue($value);
+
+ // Split email address up and disallow '..'
+ if ((strpos($value, '..') !== false) or
+ (!preg_match('/^(.+)@([^@]+)$/', $value, $matches))) {
+ $this->_error(self::INVALID_FORMAT);
+ return false;
+ }
+
+ $this->_localPart = $matches[1];
+ $this->_hostname = $matches[2];
+
+ if ((strlen($this->_localPart) > 64) || (strlen($this->_hostname) > 255)) {
+ $length = false;
+ $this->_error(self::LENGTH_EXCEEDED);
+ }
+
+ // Match hostname part
+ if ($this->_options['domain']) {
+ $hostname = $this->_validateHostnamePart();
+ }
+
+ $local = $this->_validateLocalPart();
+
+ // If both parts valid, return true
+ if ($local && $length) {
+ if (($this->_options['domain'] && $hostname) || !$this->_options['domain']) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Exception.php b/library/vendor/Zend/Validate/Exception.php
new file mode 100644
index 0000000..ca88a8b
--- /dev/null
+++ b/library/vendor/Zend/Validate/Exception.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Exception
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Exception extends Zend_Exception
+{}
diff --git a/library/vendor/Zend/Validate/File/Count.php b/library/vendor/Zend/Validate/File/Count.php
new file mode 100644
index 0000000..eaa7480
--- /dev/null
+++ b/library/vendor/Zend/Validate/File/Count.php
@@ -0,0 +1,279 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * Validator for counting all given files
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_File_Count extends Zend_Validate_Abstract
+{
+ /**#@+
+ * @const string Error constants
+ */
+ const TOO_MANY = 'fileCountTooMany';
+ const TOO_FEW = 'fileCountTooFew';
+ /**#@-*/
+
+ /**
+ * @var array Error message templates
+ */
+ protected $_messageTemplates = array(
+ self::TOO_MANY => "Too many files, maximum '%max%' are allowed but '%count%' are given",
+ self::TOO_FEW => "Too few files, minimum '%min%' are expected but '%count%' are given",
+ );
+
+ /**
+ * @var array Error message template variables
+ */
+ protected $_messageVariables = array(
+ 'min' => '_min',
+ 'max' => '_max',
+ 'count' => '_count'
+ );
+
+ /**
+ * Minimum file count
+ *
+ * If null, there is no minimum file count
+ *
+ * @var integer
+ */
+ protected $_min;
+
+ /**
+ * Maximum file count
+ *
+ * If null, there is no maximum file count
+ *
+ * @var integer|null
+ */
+ protected $_max;
+
+ /**
+ * Actual filecount
+ *
+ * @var integer
+ */
+ protected $_count;
+
+ /**
+ * Internal file array
+ * @var array
+ */
+ protected $_files;
+
+ /**
+ * Sets validator options
+ *
+ * Min limits the file count, when used with max=null it is the maximum file count
+ * It also accepts an array with the keys 'min' and 'max'
+ *
+ * If $options is a integer, it will be used as maximum file count
+ * As Array is accepts the following keys:
+ * 'min': Minimum filecount
+ * 'max': Maximum filecount
+ *
+ * @param integer|array|Zend_Config $options Options for the adapter
+ * @throws Zend_Validate_Exception
+ */
+ public function __construct($options)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } elseif (is_string($options) || is_numeric($options)) {
+ $options = array('max' => $options);
+ } elseif (!is_array($options)) {
+ throw new Zend_Validate_Exception ('Invalid options to validator provided');
+ }
+
+ if (1 < func_num_args()) {
+ $options['min'] = func_get_arg(0);
+ $options['max'] = func_get_arg(1);
+ }
+
+ if (isset($options['min'])) {
+ $this->setMin($options);
+ }
+
+ if (isset($options['max'])) {
+ $this->setMax($options);
+ }
+ }
+
+ /**
+ * Returns the minimum file count
+ *
+ * @return integer
+ */
+ public function getMin()
+ {
+ return $this->_min;
+ }
+
+ /**
+ * Sets the minimum file count
+ *
+ * @param integer|array $min The minimum file count
+ * @return Zend_Validate_File_Count Provides a fluent interface
+ * @throws Zend_Validate_Exception When min is greater than max
+ */
+ public function setMin($min)
+ {
+ if (is_array($min) and isset($min['min'])) {
+ $min = $min['min'];
+ }
+
+ if (!is_string($min) and !is_numeric($min)) {
+ throw new Zend_Validate_Exception ('Invalid options to validator provided');
+ }
+
+ $min = (integer) $min;
+ if (($this->_max !== null) && ($min > $this->_max)) {
+ throw new Zend_Validate_Exception("The minimum must be less than or equal to the maximum file count, but $min >"
+ . " {$this->_max}");
+ }
+
+ $this->_min = $min;
+ return $this;
+ }
+
+ /**
+ * Returns the maximum file count
+ *
+ * @return integer
+ */
+ public function getMax()
+ {
+ return $this->_max;
+ }
+
+ /**
+ * Sets the maximum file count
+ *
+ * @param integer|array $max The maximum file count
+ * @return Zend_Validate_StringLength Provides a fluent interface
+ * @throws Zend_Validate_Exception When max is smaller than min
+ */
+ public function setMax($max)
+ {
+ if (is_array($max) and isset($max['max'])) {
+ $max = $max['max'];
+ }
+
+ if (!is_string($max) and !is_numeric($max)) {
+ throw new Zend_Validate_Exception ('Invalid options to validator provided');
+ }
+
+ $max = (integer) $max;
+ if (($this->_min !== null) && ($max < $this->_min)) {
+ throw new Zend_Validate_Exception("The maximum must be greater than or equal to the minimum file count, but "
+ . "$max < {$this->_min}");
+ }
+
+ $this->_max = $max;
+ return $this;
+ }
+
+ /**
+ * Adds a file for validation
+ *
+ * @param string|array $file
+ * @return $this
+ */
+ public function addFile($file)
+ {
+ if (is_string($file)) {
+ $file = array($file);
+ }
+
+ if (is_array($file)) {
+ foreach ($file as $name) {
+ if (!isset($this->_files[$name]) && !empty($name)) {
+ $this->_files[$name] = $name;
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if the file count of all checked files is at least min and
+ * not bigger than max (when max is not null). Attention: When checking with set min you
+ * must give all files with the first call, otherwise you will get an false.
+ *
+ * @param string|array $value Filenames to check for count
+ * @param array $file File data from Zend_File_Transfer
+ * @return boolean
+ */
+ public function isValid($value, $file = null)
+ {
+ if (($file !== null) && !array_key_exists('destination', $file)) {
+ $file['destination'] = dirname($value);
+ }
+
+ if (($file !== null) && array_key_exists('tmp_name', $file)) {
+ $value = $file['destination'] . DIRECTORY_SEPARATOR . $file['name'];
+ }
+
+ if (($file === null) || !empty($file['tmp_name'])) {
+ $this->addFile($value);
+ }
+
+ $this->_count = count($this->_files);
+ if (($this->_max !== null) && ($this->_count > $this->_max)) {
+ return $this->_throw($file, self::TOO_MANY);
+ }
+
+ if (($this->_min !== null) && ($this->_count < $this->_min)) {
+ return $this->_throw($file, self::TOO_FEW);
+ }
+
+ return true;
+ }
+
+ /**
+ * Throws an error of the given type
+ *
+ * @param string $file
+ * @param string $errorType
+ * @return false
+ */
+ protected function _throw($file, $errorType)
+ {
+ if ($file !== null) {
+ $this->_value = $file['name'];
+ }
+
+ $this->_error($errorType);
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/Validate/File/Crc32.php b/library/vendor/Zend/Validate/File/Crc32.php
new file mode 100644
index 0000000..b577c84
--- /dev/null
+++ b/library/vendor/Zend/Validate/File/Crc32.php
@@ -0,0 +1,177 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_File_Hash
+ */
+
+/**
+ * Validator for the crc32 hash of given files
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_File_Crc32 extends Zend_Validate_File_Hash
+{
+ /**
+ * @const string Error constants
+ */
+ const DOES_NOT_MATCH = 'fileCrc32DoesNotMatch';
+ const NOT_DETECTED = 'fileCrc32NotDetected';
+ const NOT_FOUND = 'fileCrc32NotFound';
+
+ /**
+ * @var array Error message templates
+ */
+ protected $_messageTemplates = array(
+ self::DOES_NOT_MATCH => "File '%value%' does not match the given crc32 hashes",
+ self::NOT_DETECTED => "A crc32 hash could not be evaluated for the given file",
+ self::NOT_FOUND => "File '%value%' is not readable or does not exist",
+ );
+
+ /**
+ * Hash of the file
+ *
+ * @var string
+ */
+ protected $_hash;
+
+ /**
+ * Sets validator options
+ *
+ * @param string|array|Zend_Config $options
+ * @throws Zend_Validate_Exception
+ * @return Zend_Validate_File_Crc32
+ */
+ public function __construct($options)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } elseif (is_scalar($options)) {
+ $options = array('hash1' => $options);
+ } elseif (!is_array($options)) {
+ throw new Zend_Validate_Exception('Invalid options to validator provided');
+ }
+
+ $this->setCrc32($options);
+ }
+
+ /**
+ * Returns all set crc32 hashes
+ *
+ * @return array
+ */
+ public function getCrc32()
+ {
+ return $this->getHash();
+ }
+
+ /**
+ * Sets the crc32 hash for one or multiple files
+ *
+ * @param string|array $options
+ * @return Zend_Validate_File_Hash Provides a fluent interface
+ */
+ public function setHash($options)
+ {
+ if (!is_array($options)) {
+ $options = array($options);
+ }
+
+ $options['algorithm'] = 'crc32';
+ parent::setHash($options);
+ return $this;
+ }
+
+ /**
+ * Sets the crc32 hash for one or multiple files
+ *
+ * @param string|array $options
+ * @return Zend_Validate_File_Hash Provides a fluent interface
+ */
+ public function setCrc32($options)
+ {
+ $this->setHash($options);
+ return $this;
+ }
+
+ /**
+ * Adds the crc32 hash for one or multiple files
+ *
+ * @param string|array $options
+ * @return Zend_Validate_File_Hash Provides a fluent interface
+ */
+ public function addHash($options)
+ {
+ if (!is_array($options)) {
+ $options = array($options);
+ }
+
+ $options['algorithm'] = 'crc32';
+ parent::addHash($options);
+ return $this;
+ }
+
+ /**
+ * Adds the crc32 hash for one or multiple files
+ *
+ * @param string|array $options
+ * @return Zend_Validate_File_Hash Provides a fluent interface
+ */
+ public function addCrc32($options)
+ {
+ $this->addHash($options);
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if the given file confirms the set hash
+ *
+ * @param string $value Filename to check for hash
+ * @param array $file File data from Zend_File_Transfer
+ * @return boolean
+ */
+ public function isValid($value, $file = null)
+ {
+ // Is file readable ?
+ if (!Zend_Loader::isReadable($value)) {
+ return $this->_throw($file, self::NOT_FOUND);
+ }
+
+ $hashes = array_unique(array_keys($this->_hash));
+ $filehash = hash_file('crc32', $value);
+ if ($filehash === false) {
+ return $this->_throw($file, self::NOT_DETECTED);
+ }
+
+ foreach($hashes as $hash) {
+ if ($filehash === $hash) {
+ return true;
+ }
+ }
+
+ return $this->_throw($file, self::DOES_NOT_MATCH);
+ }
+}
diff --git a/library/vendor/Zend/Validate/File/ExcludeExtension.php b/library/vendor/Zend/Validate/File/ExcludeExtension.php
new file mode 100644
index 0000000..605b71e
--- /dev/null
+++ b/library/vendor/Zend/Validate/File/ExcludeExtension.php
@@ -0,0 +1,92 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * Validator for the excluding file extensions
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_File_ExcludeExtension extends Zend_Validate_File_Extension
+{
+ /**
+ * @const string Error constants
+ */
+ const FALSE_EXTENSION = 'fileExcludeExtensionFalse';
+ const NOT_FOUND = 'fileExcludeExtensionNotFound';
+
+ /**
+ * @var array Error message templates
+ */
+ protected $_messageTemplates = array(
+ self::FALSE_EXTENSION => "File '%value%' has a false extension",
+ self::NOT_FOUND => "File '%value%' is not readable or does not exist",
+ );
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if the fileextension of $value is not included in the
+ * set extension list
+ *
+ * @param string $value Real file to check for extension
+ * @param array $file File data from Zend_File_Transfer
+ * @return boolean
+ */
+ public function isValid($value, $file = null)
+ {
+ // Is file readable ?
+ if (!Zend_Loader::isReadable($value)) {
+ return $this->_throw($file, self::NOT_FOUND);
+ }
+
+ if ($file !== null) {
+ $info['extension'] = substr($file['name'], strrpos($file['name'], '.') + 1);
+ } else {
+ $info = pathinfo($value);
+ }
+
+ $extensions = $this->getExtension();
+
+ if ($this->_case and (!in_array($info['extension'], $extensions))) {
+ return true;
+ } else if (!$this->_case) {
+ $found = false;
+ foreach ($extensions as $extension) {
+ if (strtolower($extension) == strtolower($info['extension'])) {
+ $found = true;
+ }
+ }
+
+ if (!$found) {
+ return true;
+ }
+ }
+
+ return $this->_throw($file, self::FALSE_EXTENSION);
+ }
+}
diff --git a/library/vendor/Zend/Validate/File/ExcludeMimeType.php b/library/vendor/Zend/Validate/File/ExcludeMimeType.php
new file mode 100644
index 0000000..5b031ce
--- /dev/null
+++ b/library/vendor/Zend/Validate/File/ExcludeMimeType.php
@@ -0,0 +1,99 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_File_MimeType
+ */
+
+/**
+ * Validator for the mime type of a file
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_File_ExcludeMimeType extends Zend_Validate_File_MimeType
+{
+ const FALSE_TYPE = 'fileExcludeMimeTypeFalse';
+ const NOT_DETECTED = 'fileExcludeMimeTypeNotDetected';
+ const NOT_READABLE = 'fileExcludeMimeTypeNotReadable';
+
+ /**
+ * @var array Error message templates
+ */
+ protected $_messageTemplates = array(
+ self::FALSE_TYPE => "File '%value%' has a false mimetype of '%type%'",
+ self::NOT_DETECTED => "The mimetype of file '%value%' could not be detected",
+ self::NOT_READABLE => "File '%value%' is not readable or does not exist",
+ );
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if the mimetype of the file does not matche the given ones. Also parts
+ * of mimetypes can be checked. If you give for example "image" all image
+ * mime types will not be accepted like "image/gif", "image/jpeg" and so on.
+ *
+ * @param string $value Real file to check for mimetype
+ * @param array $file File data from Zend_File_Transfer
+ * @return boolean
+ */
+ public function isValid($value, $file = null)
+ {
+ if ($file === null) {
+ $file = array(
+ 'type' => null,
+ 'name' => $value
+ );
+ }
+
+ // Is file readable ?
+ if (!Zend_Loader::isReadable($value)) {
+ return $this->_throw($file, self::NOT_READABLE);
+ }
+
+ $this->_type = $this->_detectMimeType($value);
+
+ if (empty($this->_type) && $this->_headerCheck) {
+ $this->_type = $file['type'];
+ }
+
+ if (empty($this->_type)) {
+ return $this->_throw($file, self::NOT_DETECTED);
+ }
+
+ $mimetype = $this->getMimeType(true);
+ if (in_array($this->_type, $mimetype)) {
+ return $this->_throw($file, self::FALSE_TYPE);
+ }
+
+ $types = explode('/', $this->_type);
+ $types = array_merge($types, explode('-', $this->_type));
+ foreach($mimetype as $mime) {
+ if (in_array($mime, $types)) {
+ return $this->_throw($file, self::FALSE_TYPE);
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/File/Exists.php b/library/vendor/Zend/Validate/File/Exists.php
new file mode 100644
index 0000000..d22cfcf
--- /dev/null
+++ b/library/vendor/Zend/Validate/File/Exists.php
@@ -0,0 +1,201 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * Validator which checks if the file already exists in the directory
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_File_Exists extends Zend_Validate_Abstract
+{
+ /**
+ * @const string Error constants
+ */
+ const DOES_NOT_EXIST = 'fileExistsDoesNotExist';
+
+ /**
+ * @var array Error message templates
+ */
+ protected $_messageTemplates = array(
+ self::DOES_NOT_EXIST => "File '%value%' does not exist",
+ );
+
+ /**
+ * Internal list of directories
+ * @var string
+ */
+ protected $_directory = '';
+
+ /**
+ * @var array Error message template variables
+ */
+ protected $_messageVariables = array(
+ 'directory' => '_directory'
+ );
+
+ /**
+ * Sets validator options
+ *
+ * @param string|array|Zend_Config $directory
+ * @throws Zend_Validate_Exception
+ */
+ public function __construct($directory = array())
+ {
+ if ($directory instanceof Zend_Config) {
+ $directory = $directory->toArray();
+ } else if (is_string($directory)) {
+ $directory = explode(',', $directory);
+ } else if (!is_array($directory)) {
+ throw new Zend_Validate_Exception ('Invalid options to validator provided');
+ }
+
+ $this->setDirectory($directory);
+ }
+
+ /**
+ * Returns the set file directories which are checked
+ *
+ * @param boolean $asArray Returns the values as array, when false an concated string is returned
+ * @return string
+ */
+ public function getDirectory($asArray = false)
+ {
+ $asArray = (bool) $asArray;
+ $directory = (string) $this->_directory;
+ if ($asArray) {
+ $directory = explode(',', $directory);
+ }
+
+ return $directory;
+ }
+
+ /**
+ * Sets the file directory which will be checked
+ *
+ * @param string|array $directory The directories to validate
+ * @return Zend_Validate_File_Extension Provides a fluent interface
+ */
+ public function setDirectory($directory)
+ {
+ $this->_directory = null;
+ $this->addDirectory($directory);
+ return $this;
+ }
+
+ /**
+ * Adds the file directory which will be checked
+ *
+ * @param string|array $directory The directory to add for validation
+ * @throws Zend_Validate_Exception
+ * @return Zend_Validate_File_Extension Provides a fluent interface
+ */
+ public function addDirectory($directory)
+ {
+ $directories = $this->getDirectory(true);
+
+ if (is_string($directory)) {
+ $directory = explode(',', $directory);
+ } else if (!is_array($directory)) {
+ throw new Zend_Validate_Exception ('Invalid options to validator provided');
+ }
+
+ foreach ($directory as $content) {
+ if (empty($content) || !is_string($content)) {
+ continue;
+ }
+
+ $directories[] = trim($content);
+ }
+ $directories = array_unique($directories);
+
+ // Sanity check to ensure no empty values
+ foreach ($directories as $key => $dir) {
+ if (empty($dir)) {
+ unset($directories[$key]);
+ }
+ }
+
+ $this->_directory = implode(',', $directories);
+
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if the file already exists in the set directories
+ *
+ * @param string $value Real file to check for existance
+ * @param array $file File data from Zend_File_Transfer
+ * @return boolean
+ */
+ public function isValid($value, $file = null)
+ {
+ $directories = $this->getDirectory(true);
+ if (($file !== null) and (!empty($file['destination']))) {
+ $directories[] = $file['destination'];
+ } else if (!isset($file['name'])) {
+ $file['name'] = $value;
+ }
+
+ $check = false;
+ foreach ($directories as $directory) {
+ if (empty($directory)) {
+ continue;
+ }
+
+ $check = true;
+ if (!file_exists($directory . DIRECTORY_SEPARATOR . $file['name'])) {
+ return $this->_throw($file, self::DOES_NOT_EXIST);
+ }
+ }
+
+ if (!$check) {
+ return $this->_throw($file, self::DOES_NOT_EXIST);
+ }
+
+ return true;
+ }
+
+ /**
+ * Throws an error of the given type
+ *
+ * @param string $file
+ * @param string $errorType
+ * @return false
+ */
+ protected function _throw($file, $errorType)
+ {
+ if ($file !== null) {
+ $this->_value = $file['name'];
+ }
+
+ $this->_error($errorType);
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/Validate/File/Extension.php b/library/vendor/Zend/Validate/File/Extension.php
new file mode 100644
index 0000000..e2d057a
--- /dev/null
+++ b/library/vendor/Zend/Validate/File/Extension.php
@@ -0,0 +1,235 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * Validator for the file extension of a file
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_File_Extension extends Zend_Validate_Abstract
+{
+ /**
+ * @const string Error constants
+ */
+ const FALSE_EXTENSION = 'fileExtensionFalse';
+ const NOT_FOUND = 'fileExtensionNotFound';
+
+ /**
+ * @var array Error message templates
+ */
+ protected $_messageTemplates = array(
+ self::FALSE_EXTENSION => "File '%value%' has a false extension",
+ self::NOT_FOUND => "File '%value%' is not readable or does not exist",
+ );
+
+ /**
+ * Internal list of extensions
+ * @var string
+ */
+ protected $_extension = '';
+
+ /**
+ * Validate case sensitive
+ *
+ * @var boolean
+ */
+ protected $_case = false;
+
+ /**
+ * @var array Error message template variables
+ */
+ protected $_messageVariables = array(
+ 'extension' => '_extension'
+ );
+
+ /**
+ * Sets validator options
+ *
+ * @param string|array|Zend_Config $options
+ */
+ public function __construct($options)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ }
+
+ if (1 < func_num_args()) {
+ $case = func_get_arg(1);
+ $this->setCase($case);
+ }
+
+ if (is_array($options) and isset($options['case'])) {
+ $this->setCase($options['case']);
+ unset($options['case']);
+ }
+
+ $this->setExtension($options);
+ }
+
+ /**
+ * Returns the case option
+ *
+ * @return boolean
+ */
+ public function getCase()
+ {
+ return $this->_case;
+ }
+
+ /**
+ * Sets the case to use
+ *
+ * @param boolean $case
+ * @return Zend_Validate_File_Extension Provides a fluent interface
+ */
+ public function setCase($case)
+ {
+ $this->_case = (boolean) $case;
+ return $this;
+ }
+
+ /**
+ * Returns the set file extension
+ *
+ * @return array
+ */
+ public function getExtension()
+ {
+ $extension = explode(',', $this->_extension);
+
+ return $extension;
+ }
+
+ /**
+ * Sets the file extensions
+ *
+ * @param string|array $extension The extensions to validate
+ * @return Zend_Validate_File_Extension Provides a fluent interface
+ */
+ public function setExtension($extension)
+ {
+ $this->_extension = null;
+ $this->addExtension($extension);
+ return $this;
+ }
+
+ /**
+ * Adds the file extensions
+ *
+ * @param string|array $extension The extensions to add for validation
+ * @return Zend_Validate_File_Extension Provides a fluent interface
+ */
+ public function addExtension($extension)
+ {
+ $extensions = $this->getExtension();
+ if (is_string($extension)) {
+ $extension = explode(',', $extension);
+ }
+
+ foreach ($extension as $content) {
+ if (empty($content) || !is_string($content)) {
+ continue;
+ }
+
+ $extensions[] = trim($content);
+ }
+ $extensions = array_unique($extensions);
+
+ // Sanity check to ensure no empty values
+ foreach ($extensions as $key => $ext) {
+ if (empty($ext)) {
+ unset($extensions[$key]);
+ }
+ }
+
+ $this->_extension = implode(',', $extensions);
+
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if the fileextension of $value is included in the
+ * set extension list
+ *
+ * @param string $value Real file to check for extension
+ * @param array $file File data from Zend_File_Transfer
+ * @return boolean
+ */
+ public function isValid($value, $file = null)
+ {
+ // Is file readable ?
+ if (!Zend_Loader::isReadable($value)) {
+ return $this->_throw($file, self::NOT_FOUND);
+ }
+
+ if ($file !== null) {
+ $info['extension'] = substr($file['name'], strrpos($file['name'], '.') + 1);
+ } else {
+ $info = pathinfo($value);
+ if (!array_key_exists('extension', $info)) {
+ // From the manual at http://php.net/pathinfo:
+ // "If the path does not have an extension, no extension element
+ // will be returned (see second example below)."
+ return false;
+ }
+ }
+
+ $extensions = $this->getExtension();
+
+ if ($this->_case && (in_array($info['extension'], $extensions))) {
+ return true;
+ } else if (!$this->getCase()) {
+ foreach ($extensions as $extension) {
+ if (strtolower($extension) == strtolower($info['extension'])) {
+ return true;
+ }
+ }
+ }
+
+ return $this->_throw($file, self::FALSE_EXTENSION);
+ }
+
+ /**
+ * Throws an error of the given type
+ *
+ * @param string $file
+ * @param string $errorType
+ * @return false
+ */
+ protected function _throw($file, $errorType)
+ {
+ if (null !== $file) {
+ $this->_value = $file['name'];
+ }
+
+ $this->_error($errorType);
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/Validate/File/FilesSize.php b/library/vendor/Zend/Validate/File/FilesSize.php
new file mode 100644
index 0000000..e7b4930
--- /dev/null
+++ b/library/vendor/Zend/Validate/File/FilesSize.php
@@ -0,0 +1,161 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_File_Size
+ */
+
+/**
+ * Validator for the size of all files which will be validated in sum
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_File_FilesSize extends Zend_Validate_File_Size
+{
+ /**
+ * @const string Error constants
+ */
+ const TOO_BIG = 'fileFilesSizeTooBig';
+ const TOO_SMALL = 'fileFilesSizeTooSmall';
+ const NOT_READABLE = 'fileFilesSizeNotReadable';
+
+ /**
+ * @var array Error message templates
+ */
+ protected $_messageTemplates = array(
+ self::TOO_BIG => "All files in sum should have a maximum size of '%max%' but '%size%' were detected",
+ self::TOO_SMALL => "All files in sum should have a minimum size of '%min%' but '%size%' were detected",
+ self::NOT_READABLE => "One or more files can not be read",
+ );
+
+ /**
+ * Internal file array
+ *
+ * @var array
+ */
+ protected $_files;
+
+ /**
+ * Sets validator options
+ *
+ * Min limits the used diskspace for all files, when used with max=null it is the maximum filesize
+ * It also accepts an array with the keys 'min' and 'max'
+ *
+ * @param integer|array|Zend_Config $options Options for this validator
+ * @throws Zend_Validate_Exception
+ */
+ public function __construct($options)
+ {
+ $this->_files = array();
+ $this->_setSize(0);
+
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } elseif (is_scalar($options)) {
+ $options = array('max' => $options);
+ } elseif (!is_array($options)) {
+ throw new Zend_Validate_Exception('Invalid options to validator provided');
+ }
+
+ if (1 < func_num_args()) {
+ $argv = func_get_args();
+ array_shift($argv);
+ $options['max'] = array_shift($argv);
+ if (!empty($argv)) {
+ $options['bytestring'] = array_shift($argv);
+ }
+ }
+
+ parent::__construct($options);
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if the disk usage of all files is at least min and
+ * not bigger than max (when max is not null).
+ *
+ * @param string|array $value Real file to check for size
+ * @param array $file File data from Zend_File_Transfer
+ * @return boolean
+ */
+ public function isValid($value, $file = null)
+ {
+ if (is_string($value)) {
+ $value = array($value);
+ }
+
+ $min = $this->getMin(true);
+ $max = $this->getMax(true);
+ $size = $this->_getSize();
+ foreach ($value as $files) {
+ // Is file readable ?
+ if (!Zend_Loader::isReadable($files)) {
+ $this->_throw($file, self::NOT_READABLE);
+ continue;
+ }
+
+ if (!isset($this->_files[$files])) {
+ $this->_files[$files] = $files;
+ } else {
+ // file already counted... do not count twice
+ continue;
+ }
+
+ // limited to 2GB files
+ $size += @filesize($files);
+ $this->_size = $size;
+ if (($max !== null) && ($max < $size)) {
+ if ($this->useByteString()) {
+ $this->_max = $this->_toByteString($max);
+ $this->_size = $this->_toByteString($size);
+ $this->_throw($file, self::TOO_BIG);
+ $this->_max = $max;
+ $this->_size = $size;
+ } else {
+ $this->_throw($file, self::TOO_BIG);
+ }
+ }
+ }
+
+ // Check that aggregate files are >= minimum size
+ if (($min !== null) && ($size < $min)) {
+ if ($this->useByteString()) {
+ $this->_min = $this->_toByteString($min);
+ $this->_size = $this->_toByteString($size);
+ $this->_throw($file, self::TOO_SMALL);
+ $this->_min = $min;
+ $this->_size = $size;
+ } else {
+ $this->_throw($file, self::TOO_SMALL);
+ }
+ }
+
+ if (count($this->_messages) > 0) {
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/File/Hash.php b/library/vendor/Zend/Validate/File/Hash.php
new file mode 100644
index 0000000..55a0347
--- /dev/null
+++ b/library/vendor/Zend/Validate/File/Hash.php
@@ -0,0 +1,190 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * Validator for the hash of given files
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_File_Hash extends Zend_Validate_Abstract
+{
+ /**
+ * @const string Error constants
+ */
+ const DOES_NOT_MATCH = 'fileHashDoesNotMatch';
+ const NOT_DETECTED = 'fileHashHashNotDetected';
+ const NOT_FOUND = 'fileHashNotFound';
+
+ /**
+ * @var array Error message templates
+ */
+ protected $_messageTemplates = array(
+ self::DOES_NOT_MATCH => "File '%value%' does not match the given hashes",
+ self::NOT_DETECTED => "A hash could not be evaluated for the given file",
+ self::NOT_FOUND => "File '%value%' is not readable or does not exist"
+ );
+
+ /**
+ * Hash of the file
+ *
+ * @var string
+ */
+ protected $_hash;
+
+ /**
+ * Sets validator options
+ *
+ * @param string|array $options
+ * @throws Zend_Validate_Exception
+ */
+ public function __construct($options)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } elseif (is_scalar($options)) {
+ $options = array('hash1' => $options);
+ } elseif (!is_array($options)) {
+ throw new Zend_Validate_Exception('Invalid options to validator provided');
+ }
+
+ if (1 < func_num_args()) {
+ $options['algorithm'] = func_get_arg(1);
+ }
+
+ $this->setHash($options);
+ }
+
+ /**
+ * Returns the set hash values as array, the hash as key and the algorithm the value
+ *
+ * @return array
+ */
+ public function getHash()
+ {
+ return $this->_hash;
+ }
+
+ /**
+ * Sets the hash for one or multiple files
+ *
+ * @param string|array $options
+ * @return Zend_Validate_File_Hash Provides a fluent interface
+ */
+ public function setHash($options)
+ {
+ $this->_hash = null;
+ $this->addHash($options);
+
+ return $this;
+ }
+
+ /**
+ * Adds the hash for one or multiple files
+ *
+ * @param string|array $options
+ * @throws Zend_Validate_Exception
+ * @return Zend_Validate_File_Hash Provides a fluent interface
+ */
+ public function addHash($options)
+ {
+ if (is_string($options)) {
+ $options = array($options);
+ } else if (!is_array($options)) {
+ throw new Zend_Validate_Exception("False parameter given");
+ }
+
+ $known = hash_algos();
+ if (!isset($options['algorithm'])) {
+ $algorithm = 'crc32';
+ } else {
+ $algorithm = $options['algorithm'];
+ unset($options['algorithm']);
+ }
+
+ if (!in_array($algorithm, $known)) {
+ throw new Zend_Validate_Exception("Unknown algorithm '{$algorithm}'");
+ }
+
+ foreach ($options as $value) {
+ $this->_hash[$value] = $algorithm;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if the given file confirms the set hash
+ *
+ * @param string $value Filename to check for hash
+ * @param array $file File data from Zend_File_Transfer
+ * @return boolean
+ */
+ public function isValid($value, $file = null)
+ {
+ // Is file readable ?
+ if (!Zend_Loader::isReadable($value)) {
+ return $this->_throw($file, self::NOT_FOUND);
+ }
+
+ $algos = array_unique(array_values($this->_hash));
+ $hashes = array_unique(array_keys($this->_hash));
+ foreach ($algos as $algorithm) {
+ $filehash = hash_file($algorithm, $value);
+ if ($filehash === false) {
+ return $this->_throw($file, self::NOT_DETECTED);
+ }
+
+ foreach($hashes as $hash) {
+ if ($filehash === $hash) {
+ return true;
+ }
+ }
+ }
+
+ return $this->_throw($file, self::DOES_NOT_MATCH);
+ }
+
+ /**
+ * Throws an error of the given type
+ *
+ * @param string $file
+ * @param string $errorType
+ * @return false
+ */
+ protected function _throw($file, $errorType)
+ {
+ if ($file !== null) {
+ $this->_value = $file['name'];
+ }
+
+ $this->_error($errorType);
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/Validate/File/ImageSize.php b/library/vendor/Zend/Validate/File/ImageSize.php
new file mode 100644
index 0000000..686a9cb
--- /dev/null
+++ b/library/vendor/Zend/Validate/File/ImageSize.php
@@ -0,0 +1,357 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * Validator for the image size of a image file
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_File_ImageSize extends Zend_Validate_Abstract
+{
+ /**
+ * @const string Error constants
+ */
+ const WIDTH_TOO_BIG = 'fileImageSizeWidthTooBig';
+ const WIDTH_TOO_SMALL = 'fileImageSizeWidthTooSmall';
+ const HEIGHT_TOO_BIG = 'fileImageSizeHeightTooBig';
+ const HEIGHT_TOO_SMALL = 'fileImageSizeHeightTooSmall';
+ const NOT_DETECTED = 'fileImageSizeNotDetected';
+ const NOT_READABLE = 'fileImageSizeNotReadable';
+
+ /**
+ * @var array Error message template
+ */
+ protected $_messageTemplates = array(
+ self::WIDTH_TOO_BIG => "Maximum allowed width for image '%value%' should be '%maxwidth%' but '%width%' detected",
+ self::WIDTH_TOO_SMALL => "Minimum expected width for image '%value%' should be '%minwidth%' but '%width%' detected",
+ self::HEIGHT_TOO_BIG => "Maximum allowed height for image '%value%' should be '%maxheight%' but '%height%' detected",
+ self::HEIGHT_TOO_SMALL => "Minimum expected height for image '%value%' should be '%minheight%' but '%height%' detected",
+ self::NOT_DETECTED => "The size of image '%value%' could not be detected",
+ self::NOT_READABLE => "File '%value%' is not readable or does not exist",
+ );
+
+ /**
+ * @var array Error message template variables
+ */
+ protected $_messageVariables = array(
+ 'minwidth' => '_minwidth',
+ 'maxwidth' => '_maxwidth',
+ 'minheight' => '_minheight',
+ 'maxheight' => '_maxheight',
+ 'width' => '_width',
+ 'height' => '_height'
+ );
+
+ /**
+ * Minimum image width
+ *
+ * @var integer
+ */
+ protected $_minwidth;
+
+ /**
+ * Maximum image width
+ *
+ * @var integer
+ */
+ protected $_maxwidth;
+
+ /**
+ * Minimum image height
+ *
+ * @var integer
+ */
+ protected $_minheight;
+
+ /**
+ * Maximum image height
+ *
+ * @var integer
+ */
+ protected $_maxheight;
+
+ /**
+ * Detected width
+ *
+ * @var integer
+ */
+ protected $_width;
+
+ /**
+ * Detected height
+ *
+ * @var integer
+ */
+ protected $_height;
+
+ /**
+ * Sets validator options
+ *
+ * Accepts the following option keys:
+ * - minheight
+ * - minwidth
+ * - maxheight
+ * - maxwidth
+ *
+ * @param Zend_Config|array $options
+ * @throws Zend_Validate_Exception
+ */
+ public function __construct($options)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } elseif (1 < func_num_args()) {
+ if (!is_array($options)) {
+ $options = array('minwidth' => $options);
+ }
+ $argv = func_get_args();
+ array_shift($argv);
+ $options['minheight'] = array_shift($argv);
+ if (!empty($argv)) {
+ $options['maxwidth'] = array_shift($argv);
+ if (!empty($argv)) {
+ $options['maxheight'] = array_shift($argv);
+ }
+ }
+ } else if (!is_array($options)) {
+ throw new Zend_Validate_Exception ('Invalid options to validator provided');
+ }
+
+ if (isset($options['minheight']) || isset($options['minwidth'])) {
+ $this->setImageMin($options);
+ }
+
+ if (isset($options['maxheight']) || isset($options['maxwidth'])) {
+ $this->setImageMax($options);
+ }
+ }
+
+ /**
+ * Returns the set minimum image sizes
+ *
+ * @return array
+ */
+ public function getImageMin()
+ {
+ return array('minwidth' => $this->_minwidth, 'minheight' => $this->_minheight);
+ }
+
+ /**
+ * Returns the set maximum image sizes
+ *
+ * @return array
+ */
+ public function getImageMax()
+ {
+ return array('maxwidth' => $this->_maxwidth, 'maxheight' => $this->_maxheight);
+ }
+
+ /**
+ * Returns the set image width sizes
+ *
+ * @return array
+ */
+ public function getImageWidth()
+ {
+ return array('minwidth' => $this->_minwidth, 'maxwidth' => $this->_maxwidth);
+ }
+
+ /**
+ * Returns the set image height sizes
+ *
+ * @return array
+ */
+ public function getImageHeight()
+ {
+ return array('minheight' => $this->_minheight, 'maxheight' => $this->_maxheight);
+ }
+
+ /**
+ * Sets the minimum image size
+ *
+ * @param array $options The minimum image dimensions
+ * @throws Zend_Validate_Exception When minwidth is greater than maxwidth
+ * @throws Zend_Validate_Exception When minheight is greater than maxheight
+ * @return Zend_Validate_File_ImageSize Provides a fluent interface
+ */
+ public function setImageMin($options)
+ {
+ if (isset($options['minwidth'])) {
+ if (($this->_maxwidth !== null) and ($options['minwidth'] > $this->_maxwidth)) {
+ throw new Zend_Validate_Exception("The minimum image width must be less than or equal to the "
+ . " maximum image width, but {$options['minwidth']} > {$this->_maxwidth}");
+ }
+ }
+
+ if (isset($options['maxheight'])) {
+ if (($this->_maxheight !== null) and ($options['minheight'] > $this->_maxheight)) {
+ throw new Zend_Validate_Exception("The minimum image height must be less than or equal to the "
+ . " maximum image height, but {$options['minheight']} > {$this->_maxheight}");
+ }
+ }
+
+ if (isset($options['minwidth'])) {
+ $this->_minwidth = (int) $options['minwidth'];
+ }
+
+ if (isset($options['minheight'])) {
+ $this->_minheight = (int) $options['minheight'];
+ }
+
+ return $this;
+ }
+
+ /**
+ * Sets the maximum image size
+ *
+ * @param array $options The maximum image dimensions
+ * @throws Zend_Validate_Exception When maxwidth is smaller than minwidth
+ * @throws Zend_Validate_Exception When maxheight is smaller than minheight
+ * @return Zend_Validate_StringLength Provides a fluent interface
+ */
+ public function setImageMax($options)
+ {
+ if (isset($options['maxwidth'])) {
+ if (($this->_minwidth !== null) and ($options['maxwidth'] < $this->_minwidth)) {
+ throw new Zend_Validate_Exception("The maximum image width must be greater than or equal to the "
+ . "minimum image width, but {$options['maxwidth']} < {$this->_minwidth}");
+ }
+ }
+
+ if (isset($options['maxheight'])) {
+ if (($this->_minheight !== null) and ($options['maxheight'] < $this->_minheight)) {
+ throw new Zend_Validate_Exception("The maximum image height must be greater than or equal to the "
+ . "minimum image height, but {$options['maxheight']} < {$this->_minwidth}");
+ }
+ }
+
+ if (isset($options['maxwidth'])) {
+ $this->_maxwidth = (int) $options['maxwidth'];
+ }
+
+ if (isset($options['maxheight'])) {
+ $this->_maxheight = (int) $options['maxheight'];
+ }
+
+ return $this;
+ }
+
+ /**
+ * Sets the mimimum and maximum image width
+ *
+ * @param array $options The image width dimensions
+ * @return Zend_Validate_File_ImageSize Provides a fluent interface
+ */
+ public function setImageWidth($options)
+ {
+ $this->setImageMin($options);
+ $this->setImageMax($options);
+
+ return $this;
+ }
+
+ /**
+ * Sets the mimimum and maximum image height
+ *
+ * @param array $options The image height dimensions
+ * @return Zend_Validate_File_ImageSize Provides a fluent interface
+ */
+ public function setImageHeight($options)
+ {
+ $this->setImageMin($options);
+ $this->setImageMax($options);
+
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if the imagesize of $value is at least min and
+ * not bigger than max
+ *
+ * @param string $value Real file to check for image size
+ * @param array $file File data from Zend_File_Transfer
+ * @return boolean
+ */
+ public function isValid($value, $file = null)
+ {
+ // Is file readable ?
+ if (!Zend_Loader::isReadable($value)) {
+ return $this->_throw($file, self::NOT_READABLE);
+ }
+
+ $size = @getimagesize($value);
+ $this->_setValue($file);
+
+ if (empty($size) or ($size[0] === 0) or ($size[1] === 0)) {
+ return $this->_throw($file, self::NOT_DETECTED);
+ }
+
+ $this->_width = $size[0];
+ $this->_height = $size[1];
+ if ($this->_width < $this->_minwidth) {
+ $this->_throw($file, self::WIDTH_TOO_SMALL);
+ }
+
+ if (($this->_maxwidth !== null) and ($this->_maxwidth < $this->_width)) {
+ $this->_throw($file, self::WIDTH_TOO_BIG);
+ }
+
+ if ($this->_height < $this->_minheight) {
+ $this->_throw($file, self::HEIGHT_TOO_SMALL);
+ }
+
+ if (($this->_maxheight !== null) and ($this->_maxheight < $this->_height)) {
+ $this->_throw($file, self::HEIGHT_TOO_BIG);
+ }
+
+ if (count($this->_messages) > 0) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Throws an error of the given type
+ *
+ * @param string $file
+ * @param string $errorType
+ * @return false
+ */
+ protected function _throw($file, $errorType)
+ {
+ if ($file !== null) {
+ $this->_value = $file['name'];
+ }
+
+ $this->_error($errorType);
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/Validate/File/IsCompressed.php b/library/vendor/Zend/Validate/File/IsCompressed.php
new file mode 100644
index 0000000..9902353
--- /dev/null
+++ b/library/vendor/Zend/Validate/File/IsCompressed.php
@@ -0,0 +1,148 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_File_MimeType
+ */
+
+/**
+ * Validator which checks if the file already exists in the directory
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_File_IsCompressed extends Zend_Validate_File_MimeType
+{
+ /**
+ * @const string Error constants
+ */
+ const FALSE_TYPE = 'fileIsCompressedFalseType';
+ const NOT_DETECTED = 'fileIsCompressedNotDetected';
+ const NOT_READABLE = 'fileIsCompressedNotReadable';
+
+ /**
+ * @var array Error message templates
+ */
+ protected $_messageTemplates = array(
+ self::FALSE_TYPE => "File '%value%' is not compressed, '%type%' detected",
+ self::NOT_DETECTED => "The mimetype of file '%value%' could not be detected",
+ self::NOT_READABLE => "File '%value%' is not readable or does not exist",
+ );
+
+ /**
+ * Sets validator options
+ *
+ * @param string|array|Zend_Config $mimetype
+ */
+ public function __construct($mimetype = array())
+ {
+ if ($mimetype instanceof Zend_Config) {
+ $mimetype = $mimetype->toArray();
+ }
+
+ $temp = array();
+ // http://de.wikipedia.org/wiki/Liste_von_Dateiendungen
+ $default = array(
+ 'application/arj',
+ 'application/gnutar',
+ 'application/lha',
+ 'application/lzx',
+ 'application/vnd.ms-cab-compressed',
+ 'application/x-ace-compressed',
+ 'application/x-arc',
+ 'application/x-archive',
+ 'application/x-arj',
+ 'application/x-bzip',
+ 'application/x-bzip2',
+ 'application/x-cab-compressed',
+ 'application/x-compress',
+ 'application/x-compressed',
+ 'application/x-cpio',
+ 'application/x-debian-package',
+ 'application/x-eet',
+ 'application/x-gzip',
+ 'application/x-java-pack200',
+ 'application/x-lha',
+ 'application/x-lharc',
+ 'application/x-lzh',
+ 'application/x-lzma',
+ 'application/x-lzx',
+ 'application/x-rar',
+ 'application/x-sit',
+ 'application/x-stuffit',
+ 'application/x-tar',
+ 'application/zip',
+ 'application/x-zip',
+ 'application/zoo',
+ 'multipart/x-gzip',
+ );
+
+ if (is_array($mimetype)) {
+ $temp = $mimetype;
+ if (array_key_exists('magicfile', $temp)) {
+ unset($temp['magicfile']);
+ }
+
+ if (array_key_exists('headerCheck', $temp)) {
+ unset($temp['headerCheck']);
+ }
+
+ if (empty($temp)) {
+ $mimetype += $default;
+ }
+ }
+
+ if (empty($mimetype)) {
+ $mimetype = $default;
+ }
+
+ parent::__construct($mimetype);
+ }
+
+ /**
+ * Throws an error of the given type
+ * Duplicates parent method due to OOP Problem with late static binding in PHP 5.2
+ *
+ * @param string $file
+ * @param string $errorType
+ * @return false
+ */
+ protected function _throw($file, $errorType)
+ {
+ $this->_value = $file['name'];
+ switch($errorType) {
+ case Zend_Validate_File_MimeType::FALSE_TYPE :
+ $errorType = self::FALSE_TYPE;
+ break;
+ case Zend_Validate_File_MimeType::NOT_DETECTED :
+ $errorType = self::NOT_DETECTED;
+ break;
+ case Zend_Validate_File_MimeType::NOT_READABLE :
+ $errorType = self::NOT_READABLE;
+ break;
+ }
+
+ $this->_error($errorType);
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/Validate/File/IsImage.php b/library/vendor/Zend/Validate/File/IsImage.php
new file mode 100644
index 0000000..a87f1a6
--- /dev/null
+++ b/library/vendor/Zend/Validate/File/IsImage.php
@@ -0,0 +1,171 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_File_MimeType
+ */
+
+/**
+ * Validator which checks if the file already exists in the directory
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_File_IsImage extends Zend_Validate_File_MimeType
+{
+ /**
+ * @const string Error constants
+ */
+ const FALSE_TYPE = 'fileIsImageFalseType';
+ const NOT_DETECTED = 'fileIsImageNotDetected';
+ const NOT_READABLE = 'fileIsImageNotReadable';
+
+ /**
+ * @var array Error message templates
+ */
+ protected $_messageTemplates = array(
+ self::FALSE_TYPE => "File '%value%' is no image, '%type%' detected",
+ self::NOT_DETECTED => "The mimetype of file '%value%' could not be detected",
+ self::NOT_READABLE => "File '%value%' is not readable or does not exist",
+ );
+
+ /**
+ * Sets validator options
+ *
+ * @param string|array|Zend_Config $mimetype
+ */
+ public function __construct($mimetype = array())
+ {
+ if ($mimetype instanceof Zend_Config) {
+ $mimetype = $mimetype->toArray();
+ }
+
+ $temp = array();
+ // http://de.wikipedia.org/wiki/Liste_von_Dateiendungen
+ // http://www.iana.org/assignments/media-types/image/
+ $default = array(
+ 'application/cdf',
+ 'application/dicom',
+ 'application/fractals',
+ 'application/postscript',
+ 'application/vnd.hp-hpgl',
+ 'application/vnd.oasis.opendocument.graphics',
+ 'application/x-cdf',
+ 'application/x-cmu-raster',
+ 'application/x-ima',
+ 'application/x-inventor',
+ 'application/x-koan',
+ 'application/x-portable-anymap',
+ 'application/x-world-x-3dmf',
+ 'image/bmp',
+ 'image/c',
+ 'image/cgm',
+ 'image/fif',
+ 'image/gif',
+ 'image/jpeg',
+ 'image/jpm',
+ 'image/jpx',
+ 'image/jp2',
+ 'image/naplps',
+ 'image/pjpeg',
+ 'image/png',
+ 'image/svg',
+ 'image/svg+xml',
+ 'image/tiff',
+ 'image/vnd.adobe.photoshop',
+ 'image/vnd.djvu',
+ 'image/vnd.fpx',
+ 'image/vnd.net-fpx',
+ 'image/x-cmu-raster',
+ 'image/x-cmx',
+ 'image/x-coreldraw',
+ 'image/x-cpi',
+ 'image/x-emf',
+ 'image/x-ico',
+ 'image/x-icon',
+ 'image/x-jg',
+ 'image/x-ms-bmp',
+ 'image/x-niff',
+ 'image/x-pict',
+ 'image/x-pcx',
+ 'image/x-portable-anymap',
+ 'image/x-portable-bitmap',
+ 'image/x-portable-greymap',
+ 'image/x-portable-pixmap',
+ 'image/x-quicktime',
+ 'image/x-rgb',
+ 'image/x-tiff',
+ 'image/x-unknown',
+ 'image/x-windows-bmp',
+ 'image/x-xpmi',
+ );
+
+ if (is_array($mimetype)) {
+ $temp = $mimetype;
+ if (array_key_exists('magicfile', $temp)) {
+ unset($temp['magicfile']);
+ }
+
+ if (array_key_exists('headerCheck', $temp)) {
+ unset($temp['headerCheck']);
+ }
+
+ if (empty($temp)) {
+ $mimetype += $default;
+ }
+ }
+
+ if (empty($mimetype)) {
+ $mimetype = $default;
+ }
+
+ parent::__construct($mimetype);
+ }
+
+ /**
+ * Throws an error of the given type
+ * Duplicates parent method due to OOP Problem with late static binding in PHP 5.2
+ *
+ * @param string $file
+ * @param string $errorType
+ * @return false
+ */
+ protected function _throw($file, $errorType)
+ {
+ $this->_value = $file['name'];
+ switch($errorType) {
+ case Zend_Validate_File_MimeType::FALSE_TYPE :
+ $errorType = self::FALSE_TYPE;
+ break;
+ case Zend_Validate_File_MimeType::NOT_DETECTED :
+ $errorType = self::NOT_DETECTED;
+ break;
+ case Zend_Validate_File_MimeType::NOT_READABLE :
+ $errorType = self::NOT_READABLE;
+ break;
+ }
+
+ $this->_error($errorType);
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/Validate/File/Md5.php b/library/vendor/Zend/Validate/File/Md5.php
new file mode 100644
index 0000000..1205a26
--- /dev/null
+++ b/library/vendor/Zend/Validate/File/Md5.php
@@ -0,0 +1,179 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_File_Hash
+ */
+
+/**
+ * Validator for the md5 hash of given files
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_File_Md5 extends Zend_Validate_File_Hash
+{
+ /**
+ * @const string Error constants
+ */
+ const DOES_NOT_MATCH = 'fileMd5DoesNotMatch';
+ const NOT_DETECTED = 'fileMd5NotDetected';
+ const NOT_FOUND = 'fileMd5NotFound';
+
+ /**
+ * @var array Error message templates
+ */
+ protected $_messageTemplates = array(
+ self::DOES_NOT_MATCH => "File '%value%' does not match the given md5 hashes",
+ self::NOT_DETECTED => "A md5 hash could not be evaluated for the given file",
+ self::NOT_FOUND => "File '%value%' is not readable or does not exist",
+ );
+
+ /**
+ * Hash of the file
+ *
+ * @var string
+ */
+ protected $_hash;
+
+ /**
+ * Sets validator options
+ *
+ * $hash is the hash we accept for the file $file
+ *
+ * @param string|array $options
+ * @throws Zend_Validate_Exception
+ * @return Zend_Validate_File_Md5
+ */
+ public function __construct($options)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } elseif (is_scalar($options)) {
+ $options = array('hash1' => $options);
+ } elseif (!is_array($options)) {
+ throw new Zend_Validate_Exception('Invalid options to validator provided');
+ }
+
+ $this->setMd5($options);
+ }
+
+ /**
+ * Returns all set md5 hashes
+ *
+ * @return array
+ */
+ public function getMd5()
+ {
+ return $this->getHash();
+ }
+
+ /**
+ * Sets the md5 hash for one or multiple files
+ *
+ * @param string|array $options
+ * @return Zend_Validate_File_Hash Provides a fluent interface
+ */
+ public function setHash($options)
+ {
+ if (!is_array($options)) {
+ $options = (array) $options;
+ }
+
+ $options['algorithm'] = 'md5';
+ parent::setHash($options);
+ return $this;
+ }
+
+ /**
+ * Sets the md5 hash for one or multiple files
+ *
+ * @param string|array $options
+ * @return Zend_Validate_File_Hash Provides a fluent interface
+ */
+ public function setMd5($options)
+ {
+ $this->setHash($options);
+ return $this;
+ }
+
+ /**
+ * Adds the md5 hash for one or multiple files
+ *
+ * @param string|array $options
+ * @return Zend_Validate_File_Hash Provides a fluent interface
+ */
+ public function addHash($options)
+ {
+ if (!is_array($options)) {
+ $options = (array) $options;
+ }
+
+ $options['algorithm'] = 'md5';
+ parent::addHash($options);
+ return $this;
+ }
+
+ /**
+ * Adds the md5 hash for one or multiple files
+ *
+ * @param string|array $options
+ * @return Zend_Validate_File_Hash Provides a fluent interface
+ */
+ public function addMd5($options)
+ {
+ $this->addHash($options);
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if the given file confirms the set hash
+ *
+ * @param string $value Filename to check for hash
+ * @param array $file File data from Zend_File_Transfer
+ * @return boolean
+ */
+ public function isValid($value, $file = null)
+ {
+ // Is file readable ?
+ if (!Zend_Loader::isReadable($value)) {
+ return $this->_throw($file, self::NOT_FOUND);
+ }
+
+ $hashes = array_unique(array_keys($this->_hash));
+ $filehash = hash_file('md5', $value);
+ if ($filehash === false) {
+ return $this->_throw($file, self::NOT_DETECTED);
+ }
+
+ foreach($hashes as $hash) {
+ if ($filehash === $hash) {
+ return true;
+ }
+ }
+
+ return $this->_throw($file, self::DOES_NOT_MATCH);
+ }
+}
diff --git a/library/vendor/Zend/Validate/File/MimeType.php b/library/vendor/Zend/Validate/File/MimeType.php
new file mode 100644
index 0000000..407ec72
--- /dev/null
+++ b/library/vendor/Zend/Validate/File/MimeType.php
@@ -0,0 +1,468 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * Validator for the mime type of a file
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_File_MimeType extends Zend_Validate_Abstract
+{
+ /**
+ * @const Error type constants
+ */
+ const FALSE_TYPE = 'fileMimeTypeFalse';
+ const NOT_DETECTED = 'fileMimeTypeNotDetected';
+ const NOT_READABLE = 'fileMimeTypeNotReadable';
+
+ /**
+ * @var array Error message templates
+ */
+ protected $_messageTemplates = array(
+ self::FALSE_TYPE => "File '%value%' has a false mimetype of '%type%'",
+ self::NOT_DETECTED => "The mimetype of file '%value%' could not be detected",
+ self::NOT_READABLE => "File '%value%' is not readable or does not exist",
+ );
+
+ /**
+ * @var array
+ */
+ protected $_messageVariables = array(
+ 'type' => '_type'
+ );
+
+ /**
+ * @var string
+ */
+ protected $_type;
+
+ /**
+ * Mimetypes
+ *
+ * If null, there is no mimetype
+ *
+ * @var string|null
+ */
+ protected $_mimetype;
+
+ /**
+ * Magicfile to use
+ *
+ * @var string|null
+ */
+ protected $_magicfile;
+
+ /**
+ * Finfo object to use
+ *
+ * @var resource
+ */
+ protected $_finfo;
+
+ /**
+ * If no $_ENV['MAGIC'] is set, try and autodiscover it based on common locations
+ * @var array
+ */
+ protected $_magicFiles = array(
+ '/usr/share/misc/magic',
+ '/usr/share/misc/magic.mime',
+ '/usr/share/misc/magic.mgc',
+ '/usr/share/mime/magic',
+ '/usr/share/mime/magic.mime',
+ '/usr/share/mime/magic.mgc',
+ '/usr/share/file/magic',
+ '/usr/share/file/magic.mime',
+ '/usr/share/file/magic.mgc',
+ );
+
+ /**
+ * Indicates whether use of $_magicFiles should be attempted.
+ * @var boolean
+ */
+ protected $_tryCommonMagicFiles = true;
+
+ /**
+ * Option to allow header check
+ *
+ * @var boolean
+ */
+ protected $_headerCheck = false;
+
+ /**
+ * Holds error information returned by finfo_open
+ *
+ * @var array
+ */
+ protected $_finfoError;
+
+ /**
+ * Sets validator options
+ *
+ * Mimetype to accept
+ *
+ * @param string|array $mimetype MimeType
+ * @throws Zend_Validate_Exception
+ */
+ public function __construct($mimetype)
+ {
+ if ($mimetype instanceof Zend_Config) {
+ $mimetype = $mimetype->toArray();
+ } elseif (is_string($mimetype)) {
+ $mimetype = explode(',', $mimetype);
+ } elseif (!is_array($mimetype)) {
+ throw new Zend_Validate_Exception("Invalid options to validator provided");
+ }
+
+ if (isset($mimetype['magicfile'])) {
+ $this->setMagicFile($mimetype['magicfile']);
+ unset($mimetype['magicfile']);
+ }
+
+ if (isset($mimetype['headerCheck'])) {
+ $this->enableHeaderCheck($mimetype['headerCheck']);
+ unset($mimetype['headerCheck']);
+ }
+
+ $this->setMimeType($mimetype);
+ }
+
+ /**
+ * Returns the actual set magicfile
+ *
+ * Note that for PHP 5.3.0 or higher, we don't use $_ENV['MAGIC'] or try to
+ * find a magic file in a common location as PHP now has a built-in internal
+ * magic file.
+ *
+ * @return string
+ */
+ public function getMagicFile()
+ {
+ if (version_compare(PHP_VERSION, '5.3.0', '<')
+ && null === $this->_magicfile) {
+ if (!empty($_ENV['MAGIC'])) {
+ $this->setMagicFile($_ENV['MAGIC']);
+ } elseif (
+ !(@ini_get("safe_mode") == 'On' || @ini_get("safe_mode") === 1)
+ && $this->shouldTryCommonMagicFiles() // @see ZF-11784
+ ) {
+ foreach ($this->_magicFiles as $file) {
+ // supressing errors which are thrown due to openbase_dir restrictions
+ try {
+ $this->setMagicFile($file);
+ if ($this->_magicfile !== null) {
+ break;
+ }
+ } catch (Zend_Validate_Exception $e) {
+ // Intentionally, catch and fall through
+ }
+ }
+ }
+
+ if ($this->_magicfile === null) {
+ $this->_magicfile = false;
+ }
+ }
+
+ return $this->_magicfile;
+ }
+
+ /**
+ * Sets the magicfile to use
+ * if null, the MAGIC constant from php is used
+ * if the MAGIC file is errorous, no file will be set
+ *
+ * @param string $file
+ * @throws Zend_Validate_Exception When finfo can not read the magicfile
+ * @return Zend_Validate_File_MimeType Provides a fluent interface
+ */
+ public function setMagicFile($file)
+ {
+ if (empty($file)) {
+ $this->_magicfile = null;
+ } else if (!(class_exists('finfo', false))) {
+ $this->_magicfile = null;
+ throw new Zend_Validate_Exception('Magicfile can not be set. There is no finfo extension installed');
+ } else if (!is_file($file) || !is_readable($file)) {
+ throw new Zend_Validate_Exception('The given magicfile can not be read');
+ } else {
+ $const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME;
+ set_error_handler(array($this, '_errorHandler'), E_NOTICE | E_WARNING);
+ $this->_finfo = finfo_open($const, $file);
+ restore_error_handler();
+ if (empty($this->_finfo)) {
+ $this->_finfo = null;
+ throw new Zend_Validate_Exception(
+ sprintf('The given magicfile ("%s") is not accepted by finfo', $file),
+ null,
+ $this->_finfoError
+ );
+ } else {
+ $this->_magicfile = $file;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Enables or disables attempts to try the common magic file locations
+ * specified by Zend_Validate_File_MimeType::_magicFiles
+ *
+ * @param boolean $flag
+ * @return Zend_Validate_File_MimeType Provides fluent interface
+ * @see http://framework.zend.com/issues/browse/ZF-11784
+ */
+ public function setTryCommonMagicFilesFlag($flag = true)
+ {
+ $this->_tryCommonMagicFiles = (boolean) $flag;
+
+ return $this;
+ }
+
+ /**
+ * Accessor for Zend_Validate_File_MimeType::_magicFiles
+ *
+ * @return boolean
+ * @see http://framework.zend.com/issues/browse/ZF-11784
+ */
+ public function shouldTryCommonMagicFiles()
+ {
+ return $this->_tryCommonMagicFiles;
+ }
+
+ /**
+ * Returns the Header Check option
+ *
+ * @return boolean
+ */
+ public function getHeaderCheck()
+ {
+ return $this->_headerCheck;
+ }
+
+ /**
+ * Defines if the http header should be used
+ * Note that this is unsave and therefor the default value is false
+ *
+ * @param boolean $headerCheck
+ * @return Zend_Validate_File_MimeType Provides a fluent interface
+ */
+ public function enableHeaderCheck($headerCheck = true)
+ {
+ $this->_headerCheck = (boolean) $headerCheck;
+ return $this;
+ }
+
+ /**
+ * Returns the set mimetypes
+ *
+ * @param boolean $asArray Returns the values as array, when false an concated string is returned
+ * @return string|array
+ */
+ public function getMimeType($asArray = false)
+ {
+ $asArray = (bool) $asArray;
+ $mimetype = (string) $this->_mimetype;
+ if ($asArray) {
+ $mimetype = explode(',', $mimetype);
+ }
+
+ return $mimetype;
+ }
+
+ /**
+ * Sets the mimetypes
+ *
+ * @param string|array $mimetype The mimetypes to validate
+ * @return Zend_Validate_File_Extension Provides a fluent interface
+ */
+ public function setMimeType($mimetype)
+ {
+ $this->_mimetype = null;
+ $this->addMimeType($mimetype);
+ return $this;
+ }
+
+ /**
+ * Adds the mimetypes
+ *
+ * @param string|array $mimetype The mimetypes to add for validation
+ * @throws Zend_Validate_Exception
+ * @return Zend_Validate_File_Extension Provides a fluent interface
+ */
+ public function addMimeType($mimetype)
+ {
+ $mimetypes = $this->getMimeType(true);
+
+ if (is_string($mimetype)) {
+ $mimetype = explode(',', $mimetype);
+ } elseif (!is_array($mimetype)) {
+ throw new Zend_Validate_Exception("Invalid options to validator provided");
+ }
+
+ if (isset($mimetype['magicfile'])) {
+ unset($mimetype['magicfile']);
+ }
+
+ foreach ($mimetype as $content) {
+ if (empty($content) || !is_string($content)) {
+ continue;
+ }
+ $mimetypes[] = trim($content);
+ }
+ $mimetypes = array_unique($mimetypes);
+
+ // Sanity check to ensure no empty values
+ foreach ($mimetypes as $key => $mt) {
+ if (empty($mt)) {
+ unset($mimetypes[$key]);
+ }
+ }
+
+ $this->_mimetype = implode(',', $mimetypes);
+
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if the mimetype of the file matches the given ones. Also parts
+ * of mimetypes can be checked. If you give for example "image" all image
+ * mime types will be accepted like "image/gif", "image/jpeg" and so on.
+ *
+ * @param string $value Real file to check for mimetype
+ * @param array $file File data from Zend_File_Transfer
+ * @return boolean
+ */
+ public function isValid($value, $file = null)
+ {
+ if ($file === null) {
+ $file = array(
+ 'type' => null,
+ 'name' => $value
+ );
+ }
+
+ // Is file readable ?
+ if (!Zend_Loader::isReadable($value)) {
+ return $this->_throw($file, self::NOT_READABLE);
+ }
+
+ $this->_type = $this->_detectMimeType($value);
+
+ if (empty($this->_type) && $this->_headerCheck) {
+ $this->_type = $file['type'];
+ }
+
+ if (empty($this->_type)) {
+ return $this->_throw($file, self::NOT_DETECTED);
+ }
+
+ $mimetype = $this->getMimeType(true);
+ if (in_array($this->_type, $mimetype)) {
+ return true;
+ }
+
+ $types = explode('/', $this->_type);
+ $types = array_merge($types, explode('-', $this->_type));
+ $types = array_merge($types, explode(';', $this->_type));
+ foreach($mimetype as $mime) {
+ if (in_array($mime, $types)) {
+ return true;
+ }
+ }
+
+ return $this->_throw($file, self::FALSE_TYPE);
+ }
+
+ /**
+ * Throws an error of the given type
+ *
+ * @param string $file
+ * @param string $errorType
+ * @return false
+ */
+ protected function _throw($file, $errorType)
+ {
+ $this->_value = $file['name'];
+ $this->_error($errorType);
+ return false;
+ }
+
+ /**
+ * Try to detect mime type of given file.
+ * @param string $file File which mime type should be detected
+ * @return string File mime type or null if not detected
+ */
+ protected function _detectMimeType($file)
+ {
+ $mimefile = $this->getMagicFile();
+ $type = null;
+
+ if (class_exists('finfo', false)) {
+ $const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME;
+
+ if (!empty($mimefile) && empty($this->_finfo)) {
+ set_error_handler(array($this, '_errorHandler'), E_NOTICE | E_WARNING);
+ $this->_finfo = finfo_open($const, $mimefile);
+ restore_error_handler();
+ }
+
+ if (empty($this->_finfo)) {
+ set_error_handler(array($this, '_errorHandler'), E_NOTICE | E_WARNING);
+ $this->_finfo = finfo_open($const);
+ restore_error_handler();
+ }
+
+ if (!empty($this->_finfo)) {
+ $type = finfo_file($this->_finfo, $file);
+ }
+ }
+
+ if (empty($type) &&
+ (function_exists('mime_content_type') && ini_get('mime_magic.magicfile'))) {
+ $type = mime_content_type($file);
+ }
+
+ return $type;
+ }
+
+ /**
+ * Saves the provided error information by finfo_open to this instance
+ *
+ * @param integer $errno
+ * @param string $errstr
+ * @param string $errfile
+ * @param integer $errline
+ */
+ protected function _errorHandler($errno, $errstr, $errfile, $errline)
+ {
+ $this->_finfoError = new ErrorException($errstr, $errno, 0, $errfile, $errline);
+ }
+}
diff --git a/library/vendor/Zend/Validate/File/NotExists.php b/library/vendor/Zend/Validate/File/NotExists.php
new file mode 100644
index 0000000..0599aa8
--- /dev/null
+++ b/library/vendor/Zend/Validate/File/NotExists.php
@@ -0,0 +1,83 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_File_Exists
+ */
+
+/**
+ * Validator which checks if the destination file does not exist
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_File_NotExists extends Zend_Validate_File_Exists
+{
+ /**
+ * @const string Error constants
+ */
+ const DOES_EXIST = 'fileNotExistsDoesExist';
+
+ /**
+ * @var array Error message templates
+ */
+ protected $_messageTemplates = array(
+ self::DOES_EXIST => "File '%value%' exists",
+ );
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if the file does not exist in the set destinations
+ *
+ * @param string $value Real file to check for
+ * @param array $file File data from Zend_File_Transfer
+ * @return boolean
+ */
+ public function isValid($value, $file = null)
+ {
+ $directories = $this->getDirectory(true);
+ if (($file !== null) and (!empty($file['destination']))) {
+ $directories[] = $file['destination'];
+ } else if (!isset($file['name'])) {
+ $file['name'] = $value;
+ }
+
+ foreach ($directories as $directory) {
+ if (empty($directory)) {
+ continue;
+ }
+
+ $check = true;
+ if (file_exists($directory . DIRECTORY_SEPARATOR . $file['name'])) {
+ return $this->_throw($file, self::DOES_EXIST);
+ }
+ }
+
+ if (!isset($check)) {
+ return $this->_throw($file, self::DOES_EXIST);
+ }
+
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/File/Sha1.php b/library/vendor/Zend/Validate/File/Sha1.php
new file mode 100644
index 0000000..0451807
--- /dev/null
+++ b/library/vendor/Zend/Validate/File/Sha1.php
@@ -0,0 +1,179 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_File_Hash
+ */
+
+/**
+ * Validator for the sha1 hash of given files
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_File_Sha1 extends Zend_Validate_File_Hash
+{
+ /**
+ * @const string Error constants
+ */
+ const DOES_NOT_MATCH = 'fileSha1DoesNotMatch';
+ const NOT_DETECTED = 'fileSha1NotDetected';
+ const NOT_FOUND = 'fileSha1NotFound';
+
+ /**
+ * @var array Error message templates
+ */
+ protected $_messageTemplates = array(
+ self::DOES_NOT_MATCH => "File '%value%' does not match the given sha1 hashes",
+ self::NOT_DETECTED => "A sha1 hash could not be evaluated for the given file",
+ self::NOT_FOUND => "File '%value%' is not readable or does not exist",
+ );
+
+ /**
+ * Hash of the file
+ *
+ * @var string
+ */
+ protected $_hash;
+
+ /**
+ * Sets validator options
+ *
+ * $hash is the hash we accept for the file $file
+ *
+ * @param string|array $options
+ * @throws Zend_Validate_Exception
+ * @return Zend_Validate_File_Sha1
+ */
+ public function __construct($options)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } elseif (is_scalar($options)) {
+ $options = array('hash1' => $options);
+ } elseif (!is_array($options)) {
+ throw new Zend_Validate_Exception('Invalid options to validator provided');
+ }
+
+ $this->setHash($options);
+ }
+
+ /**
+ * Returns all set sha1 hashes
+ *
+ * @return array
+ */
+ public function getSha1()
+ {
+ return $this->getHash();
+ }
+
+ /**
+ * Sets the sha1 hash for one or multiple files
+ *
+ * @param string|array $options
+ * @return Zend_Validate_File_Hash Provides a fluent interface
+ */
+ public function setHash($options)
+ {
+ if (!is_array($options)) {
+ $options = (array) $options;
+ }
+
+ $options['algorithm'] = 'sha1';
+ parent::setHash($options);
+ return $this;
+ }
+
+ /**
+ * Sets the sha1 hash for one or multiple files
+ *
+ * @param string|array $options
+ * @return Zend_Validate_File_Hash Provides a fluent interface
+ */
+ public function setSha1($options)
+ {
+ $this->setHash($options);
+ return $this;
+ }
+
+ /**
+ * Adds the sha1 hash for one or multiple files
+ *
+ * @param string|array $options
+ * @return Zend_Validate_File_Hash Provides a fluent interface
+ */
+ public function addHash($options)
+ {
+ if (!is_array($options)) {
+ $options = (array) $options;
+ }
+
+ $options['algorithm'] = 'sha1';
+ parent::addHash($options);
+ return $this;
+ }
+
+ /**
+ * Adds the sha1 hash for one or multiple files
+ *
+ * @param string|array $options
+ * @return Zend_Validate_File_Hash Provides a fluent interface
+ */
+ public function addSha1($options)
+ {
+ $this->addHash($options);
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if the given file confirms the set hash
+ *
+ * @param string $value Filename to check for hash
+ * @param array $file File data from Zend_File_Transfer
+ * @return boolean
+ */
+ public function isValid($value, $file = null)
+ {
+ // Is file readable ?
+ if (!Zend_Loader::isReadable($value)) {
+ return $this->_throw($file, self::NOT_FOUND);
+ }
+
+ $hashes = array_unique(array_keys($this->_hash));
+ $filehash = hash_file('sha1', $value);
+ if ($filehash === false) {
+ return $this->_throw($file, self::NOT_DETECTED);
+ }
+
+ foreach ($hashes as $hash) {
+ if ($filehash === $hash) {
+ return true;
+ }
+ }
+
+ return $this->_throw($file, self::DOES_NOT_MATCH);
+ }
+}
diff --git a/library/vendor/Zend/Validate/File/Size.php b/library/vendor/Zend/Validate/File/Size.php
new file mode 100644
index 0000000..69034a9
--- /dev/null
+++ b/library/vendor/Zend/Validate/File/Size.php
@@ -0,0 +1,398 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * Validator for the maximum size of a file up to a max of 2GB
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_File_Size extends Zend_Validate_Abstract
+{
+ /**#@+
+ * @const string Error constants
+ */
+ const TOO_BIG = 'fileSizeTooBig';
+ const TOO_SMALL = 'fileSizeTooSmall';
+ const NOT_FOUND = 'fileSizeNotFound';
+ /**#@-*/
+
+ /**
+ * @var array Error message templates
+ */
+ protected $_messageTemplates = array(
+ self::TOO_BIG => "Maximum allowed size for file '%value%' is '%max%' but '%size%' detected",
+ self::TOO_SMALL => "Minimum expected size for file '%value%' is '%min%' but '%size%' detected",
+ self::NOT_FOUND => "File '%value%' is not readable or does not exist",
+ );
+
+ /**
+ * @var array Error message template variables
+ */
+ protected $_messageVariables = array(
+ 'min' => '_min',
+ 'max' => '_max',
+ 'size' => '_size',
+ );
+
+ /**
+ * Minimum filesize
+ * @var integer
+ */
+ protected $_min;
+
+ /**
+ * Maximum filesize
+ *
+ * If null, there is no maximum filesize
+ *
+ * @var integer|null
+ */
+ protected $_max;
+
+ /**
+ * Detected size
+ *
+ * @var integer
+ */
+ protected $_size;
+
+ /**
+ * Use bytestring ?
+ *
+ * @var boolean
+ */
+ protected $_useByteString = true;
+
+ /**
+ * Sets validator options
+ *
+ * If $options is a integer, it will be used as maximum filesize
+ * As Array is accepts the following keys:
+ * 'min': Minimum filesize
+ * 'max': Maximum filesize
+ * 'bytestring': Use bytestring or real size for messages
+ *
+ * @param integer|array $options Options for the adapter
+ * @throws Zend_Validate_Exception
+ */
+ public function __construct($options)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } elseif (is_string($options) || is_numeric($options)) {
+ $options = array('max' => $options);
+ } elseif (!is_array($options)) {
+ throw new Zend_Validate_Exception ('Invalid options to validator provided');
+ }
+
+ if (1 < func_num_args()) {
+ $argv = func_get_args();
+ array_shift($argv);
+ $options['max'] = array_shift($argv);
+ if (!empty($argv)) {
+ $options['bytestring'] = array_shift($argv);
+ }
+ }
+
+ if (isset($options['bytestring'])) {
+ $this->setUseByteString($options['bytestring']);
+ }
+
+ if (isset($options['min'])) {
+ $this->setMin($options['min']);
+ }
+
+ if (isset($options['max'])) {
+ $this->setMax($options['max']);
+ }
+ }
+
+ /**
+ * Returns the minimum filesize
+ *
+ * @param boolean $byteString Use bytestring ?
+ * @return integer
+ */
+ public function setUseByteString($byteString = true)
+ {
+ $this->_useByteString = (bool) $byteString;
+ return $this;
+ }
+
+ /**
+ * Will bytestring be used?
+ *
+ * @return boolean
+ */
+ public function useByteString()
+ {
+ return $this->_useByteString;
+ }
+
+ /**
+ * Returns the minimum filesize
+ *
+ * @param bool $raw Whether or not to force return of the raw value (defaults off)
+ * @return integer|string
+ */
+ public function getMin($raw = false)
+ {
+ $min = $this->_min;
+ if (!$raw && $this->useByteString()) {
+ $min = $this->_toByteString($min);
+ }
+
+ return $min;
+ }
+
+ /**
+ * Sets the minimum filesize
+ *
+ * @param integer $min The minimum filesize
+ * @throws Zend_Validate_Exception When min is greater than max
+ * @return Zend_Validate_File_Size Provides a fluent interface
+ */
+ public function setMin($min)
+ {
+ if (!is_string($min) and !is_numeric($min)) {
+ throw new Zend_Validate_Exception ('Invalid options to validator provided');
+ }
+
+ $min = (integer) $this->_fromByteString($min);
+ $max = $this->getMax(true);
+ if (($max !== null) && ($min > $max)) {
+ throw new Zend_Validate_Exception("The minimum must be less than or equal to the maximum filesize, but $min >"
+ . " $max");
+ }
+
+ $this->_min = $min;
+ return $this;
+ }
+
+ /**
+ * Returns the maximum filesize
+ *
+ * @param bool $raw Whether or not to force return of the raw value (defaults off)
+ * @return integer|string
+ */
+ public function getMax($raw = false)
+ {
+ $max = $this->_max;
+ if (!$raw && $this->useByteString()) {
+ $max = $this->_toByteString($max);
+ }
+
+ return $max;
+ }
+
+ /**
+ * Sets the maximum filesize
+ *
+ * @param integer $max The maximum filesize
+ * @throws Zend_Validate_Exception When max is smaller than min
+ * @return Zend_Validate_StringLength Provides a fluent interface
+ */
+ public function setMax($max)
+ {
+ if (!is_string($max) && !is_numeric($max)) {
+ throw new Zend_Validate_Exception ('Invalid options to validator provided');
+ }
+
+ $max = (integer) $this->_fromByteString($max);
+ $min = $this->getMin(true);
+ if (($min !== null) && ($max < $min)) {
+ throw new Zend_Validate_Exception("The maximum must be greater than or equal to the minimum filesize, but "
+ . "$max < $min");
+ }
+
+ $this->_max = $max;
+ return $this;
+ }
+
+ /**
+ * Retrieve current detected file size
+ *
+ * @return int
+ */
+ protected function _getSize()
+ {
+ return $this->_size;
+ }
+
+ /**
+ * Set current size
+ *
+ * @param int $size
+ * @return Zend_Validate_File_Size
+ */
+ protected function _setSize($size)
+ {
+ $this->_size = $size;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if the filesize of $value is at least min and
+ * not bigger than max (when max is not null).
+ *
+ * @param string $value Real file to check for size
+ * @param array $file File data from Zend_File_Transfer
+ * @return boolean
+ */
+ public function isValid($value, $file = null)
+ {
+ // Is file readable ?
+ if (!Zend_Loader::isReadable($value)) {
+ return $this->_throw($file, self::NOT_FOUND);
+ }
+
+ // limited to 4GB files
+ $size = sprintf("%u", @filesize($value));
+ $this->_size = $size;
+
+ // Check to see if it's smaller than min size
+ $min = $this->getMin(true);
+ $max = $this->getMax(true);
+ if (($min !== null) && ($size < $min)) {
+ if ($this->useByteString()) {
+ $this->_min = $this->_toByteString($min);
+ $this->_size = $this->_toByteString($size);
+ $this->_throw($file, self::TOO_SMALL);
+ $this->_min = $min;
+ $this->_size = $size;
+ } else {
+ $this->_throw($file, self::TOO_SMALL);
+ }
+ }
+
+ // Check to see if it's larger than max size
+ if (($max !== null) && ($max < $size)) {
+ if ($this->useByteString()) {
+ $this->_max = $this->_toByteString($max);
+ $this->_size = $this->_toByteString($size);
+ $this->_throw($file, self::TOO_BIG);
+ $this->_max = $max;
+ $this->_size = $size;
+ } else {
+ $this->_throw($file, self::TOO_BIG);
+ }
+ }
+
+ if (count($this->_messages) > 0) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns the formatted size
+ *
+ * @param integer $size
+ * @return string
+ */
+ protected function _toByteString($size)
+ {
+ $sizes = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
+ for ($i=0; $size >= 1024 && $i < 9; $i++) {
+ $size /= 1024;
+ }
+
+ return round($size, 2) . $sizes[$i];
+ }
+
+ /**
+ * Returns the unformatted size
+ *
+ * @param string $size
+ * @return integer
+ */
+ protected function _fromByteString($size)
+ {
+ if (is_numeric($size)) {
+ return (integer) $size;
+ }
+
+ $type = trim(substr($size, -2, 1));
+
+ $value = substr($size, 0, -1);
+ if (!is_numeric($value)) {
+ $value = substr($value, 0, -1);
+ }
+
+ switch (strtoupper($type)) {
+ case 'Y':
+ $value *= (1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024);
+ break;
+ case 'Z':
+ $value *= (1024 * 1024 * 1024 * 1024 * 1024 * 1024 * 1024);
+ break;
+ case 'E':
+ $value *= (1024 * 1024 * 1024 * 1024 * 1024 * 1024);
+ break;
+ case 'P':
+ $value *= (1024 * 1024 * 1024 * 1024 * 1024);
+ break;
+ case 'T':
+ $value *= (1024 * 1024 * 1024 * 1024);
+ break;
+ case 'G':
+ $value *= (1024 * 1024 * 1024);
+ break;
+ case 'M':
+ $value *= (1024 * 1024);
+ break;
+ case 'K':
+ $value *= 1024;
+ break;
+ default:
+ break;
+ }
+
+ return $value;
+ }
+
+ /**
+ * Throws an error of the given type
+ *
+ * @param string $file
+ * @param string $errorType
+ * @return false
+ */
+ protected function _throw($file, $errorType)
+ {
+ if ($file !== null) {
+ $this->_value = $file['name'];
+ }
+
+ $this->_error($errorType);
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/Validate/File/Upload.php b/library/vendor/Zend/Validate/File/Upload.php
new file mode 100644
index 0000000..b86c1c7
--- /dev/null
+++ b/library/vendor/Zend/Validate/File/Upload.php
@@ -0,0 +1,249 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * Validator for the maximum size of a file up to a max of 2GB
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_File_Upload extends Zend_Validate_Abstract
+{
+ /**@#+
+ * @const string Error constants
+ */
+ const INI_SIZE = 'fileUploadErrorIniSize';
+ const FORM_SIZE = 'fileUploadErrorFormSize';
+ const PARTIAL = 'fileUploadErrorPartial';
+ const NO_FILE = 'fileUploadErrorNoFile';
+ const NO_TMP_DIR = 'fileUploadErrorNoTmpDir';
+ const CANT_WRITE = 'fileUploadErrorCantWrite';
+ const EXTENSION = 'fileUploadErrorExtension';
+ const ATTACK = 'fileUploadErrorAttack';
+ const FILE_NOT_FOUND = 'fileUploadErrorFileNotFound';
+ const UNKNOWN = 'fileUploadErrorUnknown';
+ /**@#-*/
+
+ /**
+ * @var array Error message templates
+ */
+ protected $_messageTemplates = array(
+ self::INI_SIZE => "File '%value%' exceeds the defined ini size",
+ self::FORM_SIZE => "File '%value%' exceeds the defined form size",
+ self::PARTIAL => "File '%value%' was only partially uploaded",
+ self::NO_FILE => "File '%value%' was not uploaded",
+ self::NO_TMP_DIR => "No temporary directory was found for file '%value%'",
+ self::CANT_WRITE => "File '%value%' can't be written",
+ self::EXTENSION => "A PHP extension returned an error while uploading the file '%value%'",
+ self::ATTACK => "File '%value%' was illegally uploaded. This could be a possible attack",
+ self::FILE_NOT_FOUND => "File '%value%' was not found",
+ self::UNKNOWN => "Unknown error while uploading file '%value%'"
+ );
+
+ /**
+ * Internal array of files
+ * @var array
+ */
+ protected $_files = array();
+
+ /**
+ * Sets validator options
+ *
+ * The array $files must be given in syntax of Zend_File_Transfer to be checked
+ * If no files are given the $_FILES array will be used automatically.
+ * NOTE: This validator will only work with HTTP POST uploads!
+ *
+ * @param array|Zend_Config $files Array of files in syntax of Zend_File_Transfer
+ */
+ public function __construct($files = array())
+ {
+ if ($files instanceof Zend_Config) {
+ $files = $files->toArray();
+ }
+
+ $this->setFiles($files);
+ }
+
+ /**
+ * Returns the array of set files
+ *
+ * @param string $file (Optional) The file to return in detail
+ * @return array
+ * @throws Zend_Validate_Exception If file is not found
+ */
+ public function getFiles($file = null)
+ {
+ if ($file !== null) {
+ $return = array();
+ foreach ($this->_files as $name => $content) {
+ if ($name === $file) {
+ $return[$file] = $this->_files[$name];
+ }
+
+ if ($content['name'] === $file) {
+ $return[$name] = $this->_files[$name];
+ }
+ }
+
+ if (count($return) === 0) {
+ throw new Zend_Validate_Exception("The file '$file' was not found");
+ }
+
+ return $return;
+ }
+
+ return $this->_files;
+ }
+
+ /**
+ * Sets the files to be checked
+ *
+ * @param array $files The files to check in syntax of Zend_File_Transfer
+ * @return Zend_Validate_File_Upload Provides a fluent interface
+ */
+ public function setFiles($files = array())
+ {
+ if (count($files) === 0) {
+ $this->_files = $_FILES;
+ } else {
+ $this->_files = $files;
+ }
+
+ // see ZF-10738
+ if (is_null($this->_files)) {
+ $this->_files = array();
+ }
+
+ foreach($this->_files as $file => $content) {
+ if (!isset($content['error'])) {
+ unset($this->_files[$file]);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if the file was uploaded without errors
+ *
+ * @param string $value Single file to check for upload errors, when giving null the $_FILES array
+ * from initialization will be used
+ * @param string|null $file
+ * @return boolean
+ */
+ public function isValid($value, $file = null)
+ {
+ $this->_messages = [];
+ if (array_key_exists($value, $this->_files)) {
+ $files[$value] = $this->_files[$value];
+ } else {
+ foreach ($this->_files as $file => $content) {
+ if (isset($content['name']) && ($content['name'] === $value)) {
+ $files[$file] = $this->_files[$file];
+ }
+
+ if (isset($content['tmp_name']) && ($content['tmp_name'] === $value)) {
+ $files[$file] = $this->_files[$file];
+ }
+ }
+ }
+
+ if (empty($files)) {
+ return $this->_throw($file, self::FILE_NOT_FOUND);
+ }
+
+ foreach ($files as $file => $content) {
+ $this->_value = $file;
+ switch($content['error']) {
+ case 0:
+ if (!is_uploaded_file($content['tmp_name'])) {
+ $this->_throw($content, self::ATTACK);
+ }
+ break;
+
+ case 1:
+ $this->_throw($content, self::INI_SIZE);
+ break;
+
+ case 2:
+ $this->_throw($content, self::FORM_SIZE);
+ break;
+
+ case 3:
+ $this->_throw($content, self::PARTIAL);
+ break;
+
+ case 4:
+ $this->_throw($content, self::NO_FILE);
+ break;
+
+ case 6:
+ $this->_throw($content, self::NO_TMP_DIR);
+ break;
+
+ case 7:
+ $this->_throw($content, self::CANT_WRITE);
+ break;
+
+ case 8:
+ $this->_throw($content, self::EXTENSION);
+ break;
+
+ default:
+ $this->_throw($content, self::UNKNOWN);
+ break;
+ }
+ }
+
+ if (count($this->_messages) > 0) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ /**
+ * Throws an error of the given type
+ *
+ * @param string $file
+ * @param string $errorType
+ * @return false
+ */
+ protected function _throw($file, $errorType)
+ {
+ if ($file !== null) {
+ if (is_array($file) and !empty($file['name'])) {
+ $this->_value = $file['name'];
+ }
+ }
+
+ $this->_error($errorType);
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/Validate/File/WordCount.php b/library/vendor/Zend/Validate/File/WordCount.php
new file mode 100644
index 0000000..09b3fd1
--- /dev/null
+++ b/library/vendor/Zend/Validate/File/WordCount.php
@@ -0,0 +1,99 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_File_Count
+ */
+
+/**
+ * Validator for counting all words in a file
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_File_WordCount extends Zend_Validate_File_Count
+{
+ /**#@+
+ * @const string Error constants
+ */
+ const TOO_MUCH = 'fileWordCountTooMuch';
+ const TOO_LESS = 'fileWordCountTooLess';
+ const NOT_FOUND = 'fileWordCountNotFound';
+ /**#@-*/
+
+ /**
+ * @var array Error message templates
+ */
+ protected $_messageTemplates = array(
+ self::TOO_MUCH => "Too much words, maximum '%max%' are allowed but '%count%' were counted",
+ self::TOO_LESS => "Too less words, minimum '%min%' are expected but '%count%' were counted",
+ self::NOT_FOUND => "File '%value%' is not readable or does not exist",
+ );
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if the counted words are at least min and
+ * not bigger than max (when max is not null).
+ *
+ * @param string $value Filename to check for word count
+ * @param array $file File data from Zend_File_Transfer
+ * @return boolean
+ */
+ public function isValid($value, $file = null)
+ {
+ // Is file readable ?
+ if (!Zend_Loader::isReadable($value)) {
+ return $this->_throw($file, self::NOT_FOUND);
+ }
+
+ $content = file_get_contents($value);
+ $this->_count = str_word_count($content);
+ if (($this->_max !== null) && ($this->_count > $this->_max)) {
+ return $this->_throw($file, self::TOO_MUCH);
+ }
+
+ if (($this->_min !== null) && ($this->_count < $this->_min)) {
+ return $this->_throw($file, self::TOO_LESS);
+ }
+
+ return true;
+ }
+
+ /**
+ * Throws an error of the given type
+ *
+ * @param string $file
+ * @param string $errorType
+ * @return false
+ */
+ protected function _throw($file, $errorType)
+ {
+ if ($file !== null) {
+ $this->_value = $file['name'];
+ }
+
+ $this->_error($errorType);
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Float.php b/library/vendor/Zend/Validate/Float.php
new file mode 100644
index 0000000..95b0097
--- /dev/null
+++ b/library/vendor/Zend/Validate/Float.php
@@ -0,0 +1,131 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @see Zend_Locale_Format
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Float extends Zend_Validate_Abstract
+{
+ const INVALID = 'floatInvalid';
+ const NOT_FLOAT = 'notFloat';
+
+ /**
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::INVALID => "Invalid type given. String, integer or float expected",
+ self::NOT_FLOAT => "'%value%' does not appear to be a float",
+ );
+
+ protected $_locale;
+
+ /**
+ * Constructor for the float validator
+ *
+ * @param string|Zend_Config|Zend_Locale $locale
+ */
+ public function __construct($locale = null)
+ {
+ if ($locale instanceof Zend_Config) {
+ $locale = $locale->toArray();
+ }
+
+ if (is_array($locale)) {
+ if (array_key_exists('locale', $locale)) {
+ $locale = $locale['locale'];
+ } else {
+ $locale = null;
+ }
+ }
+
+ if (empty($locale)) {
+ if (Zend_Registry::isRegistered('Zend_Locale')) {
+ $locale = Zend_Registry::get('Zend_Locale');
+ }
+ }
+
+ $this->setLocale($locale);
+ }
+
+ /**
+ * Returns the set locale
+ */
+ public function getLocale()
+ {
+ return $this->_locale;
+ }
+
+ /**
+ * Sets the locale to use
+ *
+ * @param string|Zend_Locale $locale
+ * @return $this
+ */
+ public function setLocale($locale = null)
+ {
+ $this->_locale = Zend_Locale::findLocale($locale);
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if $value is a floating-point value
+ *
+ * @param string $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ if (!is_string($value) && !is_int($value) && !is_float($value)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ if (is_float($value)) {
+ return true;
+ }
+
+ $this->_setValue($value);
+ try {
+ if (!Zend_Locale_Format::isFloat($value, array('locale' => $this->_locale))) {
+ $this->_error(self::NOT_FLOAT);
+ return false;
+ }
+ } catch (Zend_Locale_Exception $e) {
+ $this->_error(self::NOT_FLOAT);
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/GreaterThan.php b/library/vendor/Zend/Validate/GreaterThan.php
new file mode 100644
index 0000000..ae71917
--- /dev/null
+++ b/library/vendor/Zend/Validate/GreaterThan.php
@@ -0,0 +1,122 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_GreaterThan extends Zend_Validate_Abstract
+{
+
+ const NOT_GREATER = 'notGreaterThan';
+
+ /**
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::NOT_GREATER => "'%value%' is not greater than '%min%'",
+ );
+
+ /**
+ * @var array
+ */
+ protected $_messageVariables = array(
+ 'min' => '_min'
+ );
+
+ /**
+ * Minimum value
+ *
+ * @var mixed
+ */
+ protected $_min;
+
+ /**
+ * Sets validator options
+ *
+ * @param mixed|Zend_Config $min
+ * @throws Zend_Validate_Exception
+ */
+ public function __construct($min)
+ {
+ if ($min instanceof Zend_Config) {
+ $min = $min->toArray();
+ }
+
+ if (is_array($min)) {
+ if (array_key_exists('min', $min)) {
+ $min = $min['min'];
+ } else {
+ throw new Zend_Validate_Exception("Missing option 'min'");
+ }
+ }
+
+ $this->setMin($min);
+ }
+
+ /**
+ * Returns the min option
+ *
+ * @return mixed
+ */
+ public function getMin()
+ {
+ return $this->_min;
+ }
+
+ /**
+ * Sets the min option
+ *
+ * @param mixed $min
+ * @return Zend_Validate_GreaterThan Provides a fluent interface
+ */
+ public function setMin($min)
+ {
+ $this->_min = $min;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if $value is greater than min option
+ *
+ * @param mixed $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ $this->_setValue($value);
+
+ if ($this->_min >= $value) {
+ $this->_error(self::NOT_GREATER);
+ return false;
+ }
+ return true;
+ }
+
+}
diff --git a/library/vendor/Zend/Validate/Hex.php b/library/vendor/Zend/Validate/Hex.php
new file mode 100644
index 0000000..d8fcab2
--- /dev/null
+++ b/library/vendor/Zend/Validate/Hex.php
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Hex extends Zend_Validate_Abstract
+{
+ const INVALID = 'hexInvalid';
+ const NOT_HEX = 'notHex';
+
+ /**
+ * Validation failure message template definitions
+ *
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::INVALID => "Invalid type given. String expected",
+ self::NOT_HEX => "'%value%' has not only hexadecimal digit characters",
+ );
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if $value contains only hexadecimal digit characters
+ *
+ * @param string $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ if (!is_string($value) && !is_int($value)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ $this->_setValue($value);
+ if (!ctype_xdigit((string) $value)) {
+ $this->_error(self::NOT_HEX);
+ return false;
+ }
+
+ return true;
+ }
+
+}
diff --git a/library/vendor/Zend/Validate/Hostname.php b/library/vendor/Zend/Validate/Hostname.php
new file mode 100644
index 0000000..afddd76
--- /dev/null
+++ b/library/vendor/Zend/Validate/Hostname.php
@@ -0,0 +1,1987 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @see Zend_Validate_Ip
+ */
+
+/**
+ * Please note there are two standalone test scripts for testing IDN characters due to problems
+ * with file encoding.
+ *
+ * The first is tests/Zend/Validate/HostnameTestStandalone.php which is designed to be run on
+ * the command line.
+ *
+ * The second is tests/Zend/Validate/HostnameTestForm.php which is designed to be run via HTML
+ * to allow users to test entering UTF-8 characters in a form.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Hostname extends Zend_Validate_Abstract
+{
+ const CANNOT_DECODE_PUNYCODE = 'hostnameCannotDecodePunycode';
+ const INVALID = 'hostnameInvalid';
+ const INVALID_DASH = 'hostnameDashCharacter';
+ const INVALID_HOSTNAME = 'hostnameInvalidHostname';
+ const INVALID_HOSTNAME_SCHEMA = 'hostnameInvalidHostnameSchema';
+ const INVALID_LOCAL_NAME = 'hostnameInvalidLocalName';
+ const INVALID_URI = 'hostnameInvalidUri';
+ const IP_ADDRESS_NOT_ALLOWED = 'hostnameIpAddressNotAllowed';
+ const LOCAL_NAME_NOT_ALLOWED = 'hostnameLocalNameNotAllowed';
+ const UNDECIPHERABLE_TLD = 'hostnameUndecipherableTld';
+ const UNKNOWN_TLD = 'hostnameUnknownTld';
+
+ /**
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::CANNOT_DECODE_PUNYCODE => "'%value%' appears to be a DNS hostname but the given punycode notation cannot be decoded",
+ self::INVALID => "Invalid type given. String expected",
+ self::INVALID_DASH => "'%value%' appears to be a DNS hostname but contains a dash in an invalid position",
+ self::INVALID_HOSTNAME => "'%value%' does not match the expected structure for a DNS hostname",
+ self::INVALID_HOSTNAME_SCHEMA => "'%value%' appears to be a DNS hostname but cannot match against hostname schema for TLD '%tld%'",
+ self::INVALID_LOCAL_NAME => "'%value%' does not appear to be a valid local network name",
+ self::INVALID_URI => "'%value%' does not appear to be a valid URI hostname",
+ self::IP_ADDRESS_NOT_ALLOWED => "'%value%' appears to be an IP address, but IP addresses are not allowed",
+ self::LOCAL_NAME_NOT_ALLOWED => "'%value%' appears to be a local network name but local network names are not allowed",
+ self::UNDECIPHERABLE_TLD => "'%value%' appears to be a DNS hostname but cannot extract TLD part",
+ self::UNKNOWN_TLD => "'%value%' appears to be a DNS hostname but cannot match TLD against known list",
+ );
+
+ /**
+ * @var array
+ */
+ protected $_messageVariables = array(
+ 'tld' => '_tld'
+ );
+
+ /**
+ * Allows Internet domain names (e.g., example.com)
+ */
+ const ALLOW_DNS = 1;
+
+ /**
+ * Allows IP addresses
+ */
+ const ALLOW_IP = 2;
+
+ /**
+ * Allows local network names (e.g., localhost, www.localdomain)
+ */
+ const ALLOW_LOCAL = 4;
+
+ /**
+ * Allows all types of hostnames
+ */
+ const ALLOW_URI = 8;
+
+ /**
+ * Allows all types of hostnames
+ */
+ const ALLOW_ALL = 15;
+
+ /**
+ * Array of valid top-level-domains
+ *
+ * Version 2015091800, Last Updated Fri Sep 18 07:07:01 2015 UTC
+ *
+ * @see http://data.iana.org/TLD/tlds-alpha-by-domain.txt List of all TLDs by domain
+ * @see http://www.iana.org/domains/root/db/ Official list of supported TLDs
+ * @var array
+ */
+ protected $_validTlds = array(
+ 'aaa',
+ 'abb',
+ 'abbott',
+ 'abogado',
+ 'ac',
+ 'academy',
+ 'accenture',
+ 'accountant',
+ 'accountants',
+ 'aco',
+ 'active',
+ 'actor',
+ 'ad',
+ 'ads',
+ 'adult',
+ 'ae',
+ 'aeg',
+ 'aero',
+ 'af',
+ 'afl',
+ 'ag',
+ 'agency',
+ 'ai',
+ 'aig',
+ 'airforce',
+ 'airtel',
+ 'al',
+ 'allfinanz',
+ 'alsace',
+ 'am',
+ 'amica',
+ 'amsterdam',
+ 'android',
+ 'ao',
+ 'apartments',
+ 'app',
+ 'aq',
+ 'aquarelle',
+ 'ar',
+ 'aramco',
+ 'archi',
+ 'army',
+ 'arpa',
+ 'arte',
+ 'as',
+ 'asia',
+ 'associates',
+ 'at',
+ 'attorney',
+ 'au',
+ 'auction',
+ 'audio',
+ 'auto',
+ 'autos',
+ 'aw',
+ 'ax',
+ 'axa',
+ 'az',
+ 'azure',
+ 'ba',
+ 'band',
+ 'bank',
+ 'bar',
+ 'barcelona',
+ 'barclaycard',
+ 'barclays',
+ 'bargains',
+ 'bauhaus',
+ 'bayern',
+ 'bb',
+ 'bbc',
+ 'bbva',
+ 'bcn',
+ 'bd',
+ 'be',
+ 'beer',
+ 'bentley',
+ 'berlin',
+ 'best',
+ 'bet',
+ 'bf',
+ 'bg',
+ 'bh',
+ 'bharti',
+ 'bi',
+ 'bible',
+ 'bid',
+ 'bike',
+ 'bing',
+ 'bingo',
+ 'bio',
+ 'biz',
+ 'bj',
+ 'black',
+ 'blackfriday',
+ 'bloomberg',
+ 'blue',
+ 'bm',
+ 'bms',
+ 'bmw',
+ 'bn',
+ 'bnl',
+ 'bnpparibas',
+ 'bo',
+ 'boats',
+ 'bom',
+ 'bond',
+ 'boo',
+ 'boots',
+ 'boutique',
+ 'br',
+ 'bradesco',
+ 'bridgestone',
+ 'broker',
+ 'brother',
+ 'brussels',
+ 'bs',
+ 'bt',
+ 'budapest',
+ 'build',
+ 'builders',
+ 'business',
+ 'buzz',
+ 'bv',
+ 'bw',
+ 'by',
+ 'bz',
+ 'bzh',
+ 'ca',
+ 'cab',
+ 'cafe',
+ 'cal',
+ 'camera',
+ 'camp',
+ 'cancerresearch',
+ 'canon',
+ 'capetown',
+ 'capital',
+ 'car',
+ 'caravan',
+ 'cards',
+ 'care',
+ 'career',
+ 'careers',
+ 'cars',
+ 'cartier',
+ 'casa',
+ 'cash',
+ 'casino',
+ 'cat',
+ 'catering',
+ 'cba',
+ 'cbn',
+ 'cc',
+ 'cd',
+ 'ceb',
+ 'center',
+ 'ceo',
+ 'cern',
+ 'cf',
+ 'cfa',
+ 'cfd',
+ 'cg',
+ 'ch',
+ 'chanel',
+ 'channel',
+ 'chat',
+ 'cheap',
+ 'chloe',
+ 'christmas',
+ 'chrome',
+ 'church',
+ 'ci',
+ 'cipriani',
+ 'cisco',
+ 'citic',
+ 'city',
+ 'ck',
+ 'cl',
+ 'claims',
+ 'cleaning',
+ 'click',
+ 'clinic',
+ 'clothing',
+ 'cloud',
+ 'club',
+ 'clubmed',
+ 'cm',
+ 'cn',
+ 'co',
+ 'coach',
+ 'codes',
+ 'coffee',
+ 'college',
+ 'cologne',
+ 'com',
+ 'commbank',
+ 'community',
+ 'company',
+ 'computer',
+ 'condos',
+ 'construction',
+ 'consulting',
+ 'contractors',
+ 'cooking',
+ 'cool',
+ 'coop',
+ 'corsica',
+ 'country',
+ 'coupons',
+ 'courses',
+ 'cr',
+ 'credit',
+ 'creditcard',
+ 'cricket',
+ 'crown',
+ 'crs',
+ 'cruises',
+ 'csc',
+ 'cu',
+ 'cuisinella',
+ 'cv',
+ 'cw',
+ 'cx',
+ 'cy',
+ 'cymru',
+ 'cyou',
+ 'cz',
+ 'dabur',
+ 'dad',
+ 'dance',
+ 'date',
+ 'dating',
+ 'datsun',
+ 'day',
+ 'dclk',
+ 'de',
+ 'deals',
+ 'degree',
+ 'delivery',
+ 'dell',
+ 'delta',
+ 'democrat',
+ 'dental',
+ 'dentist',
+ 'desi',
+ 'design',
+ 'dev',
+ 'diamonds',
+ 'diet',
+ 'digital',
+ 'direct',
+ 'directory',
+ 'discount',
+ 'dj',
+ 'dk',
+ 'dm',
+ 'dnp',
+ 'do',
+ 'docs',
+ 'dog',
+ 'doha',
+ 'domains',
+ 'doosan',
+ 'download',
+ 'drive',
+ 'durban',
+ 'dvag',
+ 'dz',
+ 'earth',
+ 'eat',
+ 'ec',
+ 'edu',
+ 'education',
+ 'ee',
+ 'eg',
+ 'email',
+ 'emerck',
+ 'energy',
+ 'engineer',
+ 'engineering',
+ 'enterprises',
+ 'epson',
+ 'equipment',
+ 'er',
+ 'erni',
+ 'es',
+ 'esq',
+ 'estate',
+ 'et',
+ 'eu',
+ 'eurovision',
+ 'eus',
+ 'events',
+ 'everbank',
+ 'exchange',
+ 'expert',
+ 'exposed',
+ 'express',
+ 'fage',
+ 'fail',
+ 'faith',
+ 'family',
+ 'fan',
+ 'fans',
+ 'farm',
+ 'fashion',
+ 'feedback',
+ 'fi',
+ 'film',
+ 'final',
+ 'finance',
+ 'financial',
+ 'firmdale',
+ 'fish',
+ 'fishing',
+ 'fit',
+ 'fitness',
+ 'fj',
+ 'fk',
+ 'flights',
+ 'florist',
+ 'flowers',
+ 'flsmidth',
+ 'fly',
+ 'fm',
+ 'fo',
+ 'foo',
+ 'football',
+ 'forex',
+ 'forsale',
+ 'forum',
+ 'foundation',
+ 'fr',
+ 'frl',
+ 'frogans',
+ 'fund',
+ 'furniture',
+ 'futbol',
+ 'fyi',
+ 'ga',
+ 'gal',
+ 'gallery',
+ 'game',
+ 'garden',
+ 'gb',
+ 'gbiz',
+ 'gd',
+ 'gdn',
+ 'ge',
+ 'gea',
+ 'gent',
+ 'genting',
+ 'gf',
+ 'gg',
+ 'ggee',
+ 'gh',
+ 'gi',
+ 'gift',
+ 'gifts',
+ 'gives',
+ 'giving',
+ 'gl',
+ 'glass',
+ 'gle',
+ 'global',
+ 'globo',
+ 'gm',
+ 'gmail',
+ 'gmo',
+ 'gmx',
+ 'gn',
+ 'gold',
+ 'goldpoint',
+ 'golf',
+ 'goo',
+ 'goog',
+ 'google',
+ 'gop',
+ 'gov',
+ 'gp',
+ 'gq',
+ 'gr',
+ 'graphics',
+ 'gratis',
+ 'green',
+ 'gripe',
+ 'group',
+ 'gs',
+ 'gt',
+ 'gu',
+ 'gucci',
+ 'guge',
+ 'guide',
+ 'guitars',
+ 'guru',
+ 'gw',
+ 'gy',
+ 'hamburg',
+ 'hangout',
+ 'haus',
+ 'healthcare',
+ 'help',
+ 'here',
+ 'hermes',
+ 'hiphop',
+ 'hitachi',
+ 'hiv',
+ 'hk',
+ 'hm',
+ 'hn',
+ 'hockey',
+ 'holdings',
+ 'holiday',
+ 'homedepot',
+ 'homes',
+ 'honda',
+ 'horse',
+ 'host',
+ 'hosting',
+ 'hoteles',
+ 'hotmail',
+ 'house',
+ 'how',
+ 'hr',
+ 'hsbc',
+ 'ht',
+ 'hu',
+ 'hyundai',
+ 'ibm',
+ 'icbc',
+ 'ice',
+ 'icu',
+ 'id',
+ 'ie',
+ 'ifm',
+ 'iinet',
+ 'il',
+ 'im',
+ 'immo',
+ 'immobilien',
+ 'in',
+ 'industries',
+ 'infiniti',
+ 'info',
+ 'ing',
+ 'ink',
+ 'institute',
+ 'insure',
+ 'int',
+ 'international',
+ 'investments',
+ 'io',
+ 'ipiranga',
+ 'iq',
+ 'ir',
+ 'irish',
+ 'is',
+ 'ist',
+ 'istanbul',
+ 'it',
+ 'itau',
+ 'iwc',
+ 'jaguar',
+ 'java',
+ 'jcb',
+ 'je',
+ 'jetzt',
+ 'jewelry',
+ 'jlc',
+ 'jll',
+ 'jm',
+ 'jo',
+ 'jobs',
+ 'joburg',
+ 'jp',
+ 'jprs',
+ 'juegos',
+ 'kaufen',
+ 'kddi',
+ 'ke',
+ 'kg',
+ 'kh',
+ 'ki',
+ 'kia',
+ 'kim',
+ 'kinder',
+ 'kitchen',
+ 'kiwi',
+ 'km',
+ 'kn',
+ 'koeln',
+ 'komatsu',
+ 'kp',
+ 'kr',
+ 'krd',
+ 'kred',
+ 'kw',
+ 'ky',
+ 'kyoto',
+ 'kz',
+ 'la',
+ 'lacaixa',
+ 'lancaster',
+ 'land',
+ 'landrover',
+ 'lasalle',
+ 'lat',
+ 'latrobe',
+ 'law',
+ 'lawyer',
+ 'lb',
+ 'lc',
+ 'lds',
+ 'lease',
+ 'leclerc',
+ 'legal',
+ 'lexus',
+ 'lgbt',
+ 'li',
+ 'liaison',
+ 'lidl',
+ 'life',
+ 'lighting',
+ 'limited',
+ 'limo',
+ 'linde',
+ 'link',
+ 'live',
+ 'lixil',
+ 'lk',
+ 'loan',
+ 'loans',
+ 'lol',
+ 'london',
+ 'lotte',
+ 'lotto',
+ 'love',
+ 'lr',
+ 'ls',
+ 'lt',
+ 'ltd',
+ 'ltda',
+ 'lu',
+ 'lupin',
+ 'luxe',
+ 'luxury',
+ 'lv',
+ 'ly',
+ 'ma',
+ 'madrid',
+ 'maif',
+ 'maison',
+ 'man',
+ 'management',
+ 'mango',
+ 'market',
+ 'marketing',
+ 'markets',
+ 'marriott',
+ 'mba',
+ 'mc',
+ 'md',
+ 'me',
+ 'media',
+ 'meet',
+ 'melbourne',
+ 'meme',
+ 'memorial',
+ 'men',
+ 'menu',
+ 'mg',
+ 'mh',
+ 'miami',
+ 'microsoft',
+ 'mil',
+ 'mini',
+ 'mk',
+ 'ml',
+ 'mm',
+ 'mma',
+ 'mn',
+ 'mo',
+ 'mobi',
+ 'moda',
+ 'moe',
+ 'moi',
+ 'mom',
+ 'monash',
+ 'money',
+ 'montblanc',
+ 'mormon',
+ 'mortgage',
+ 'moscow',
+ 'motorcycles',
+ 'mov',
+ 'movie',
+ 'movistar',
+ 'mp',
+ 'mq',
+ 'mr',
+ 'ms',
+ 'mt',
+ 'mtn',
+ 'mtpc',
+ 'mtr',
+ 'mu',
+ 'museum',
+ 'mutuelle',
+ 'mv',
+ 'mw',
+ 'mx',
+ 'my',
+ 'mz',
+ 'na',
+ 'nadex',
+ 'nagoya',
+ 'name',
+ 'navy',
+ 'nc',
+ 'ne',
+ 'nec',
+ 'net',
+ 'netbank',
+ 'network',
+ 'neustar',
+ 'new',
+ 'news',
+ 'nexus',
+ 'nf',
+ 'ng',
+ 'ngo',
+ 'nhk',
+ 'ni',
+ 'nico',
+ 'ninja',
+ 'nissan',
+ 'nl',
+ 'no',
+ 'nokia',
+ 'np',
+ 'nr',
+ 'nra',
+ 'nrw',
+ 'ntt',
+ 'nu',
+ 'nyc',
+ 'nz',
+ 'obi',
+ 'office',
+ 'okinawa',
+ 'om',
+ 'omega',
+ 'one',
+ 'ong',
+ 'onl',
+ 'online',
+ 'ooo',
+ 'oracle',
+ 'orange',
+ 'org',
+ 'organic',
+ 'osaka',
+ 'otsuka',
+ 'ovh',
+ 'pa',
+ 'page',
+ 'panerai',
+ 'paris',
+ 'partners',
+ 'parts',
+ 'party',
+ 'pe',
+ 'pet',
+ 'pf',
+ 'pg',
+ 'ph',
+ 'pharmacy',
+ 'philips',
+ 'photo',
+ 'photography',
+ 'photos',
+ 'physio',
+ 'piaget',
+ 'pics',
+ 'pictet',
+ 'pictures',
+ 'pink',
+ 'pizza',
+ 'pk',
+ 'pl',
+ 'place',
+ 'play',
+ 'plumbing',
+ 'plus',
+ 'pm',
+ 'pn',
+ 'pohl',
+ 'poker',
+ 'porn',
+ 'post',
+ 'pr',
+ 'praxi',
+ 'press',
+ 'pro',
+ 'prod',
+ 'productions',
+ 'prof',
+ 'properties',
+ 'property',
+ 'protection',
+ 'ps',
+ 'pt',
+ 'pub',
+ 'pw',
+ 'py',
+ 'qa',
+ 'qpon',
+ 'quebec',
+ 'racing',
+ 're',
+ 'realtor',
+ 'realty',
+ 'recipes',
+ 'red',
+ 'redstone',
+ 'rehab',
+ 'reise',
+ 'reisen',
+ 'reit',
+ 'ren',
+ 'rent',
+ 'rentals',
+ 'repair',
+ 'report',
+ 'republican',
+ 'rest',
+ 'restaurant',
+ 'review',
+ 'reviews',
+ 'rich',
+ 'ricoh',
+ 'rio',
+ 'rip',
+ 'ro',
+ 'rocks',
+ 'rodeo',
+ 'rs',
+ 'rsvp',
+ 'ru',
+ 'ruhr',
+ 'run',
+ 'rw',
+ 'rwe',
+ 'ryukyu',
+ 'sa',
+ 'saarland',
+ 'sakura',
+ 'sale',
+ 'samsung',
+ 'sandvik',
+ 'sandvikcoromant',
+ 'sanofi',
+ 'sap',
+ 'sarl',
+ 'saxo',
+ 'sb',
+ 'sc',
+ 'sca',
+ 'scb',
+ 'schmidt',
+ 'scholarships',
+ 'school',
+ 'schule',
+ 'schwarz',
+ 'science',
+ 'scor',
+ 'scot',
+ 'sd',
+ 'se',
+ 'seat',
+ 'security',
+ 'seek',
+ 'sener',
+ 'services',
+ 'seven',
+ 'sew',
+ 'sex',
+ 'sexy',
+ 'sg',
+ 'sh',
+ 'shiksha',
+ 'shoes',
+ 'show',
+ 'shriram',
+ 'si',
+ 'singles',
+ 'site',
+ 'sj',
+ 'sk',
+ 'ski',
+ 'sky',
+ 'skype',
+ 'sl',
+ 'sm',
+ 'sn',
+ 'sncf',
+ 'so',
+ 'soccer',
+ 'social',
+ 'software',
+ 'sohu',
+ 'solar',
+ 'solutions',
+ 'sony',
+ 'soy',
+ 'space',
+ 'spiegel',
+ 'spreadbetting',
+ 'sr',
+ 'srl',
+ 'st',
+ 'stada',
+ 'starhub',
+ 'statoil',
+ 'stc',
+ 'stcgroup',
+ 'stockholm',
+ 'studio',
+ 'study',
+ 'style',
+ 'su',
+ 'sucks',
+ 'supplies',
+ 'supply',
+ 'support',
+ 'surf',
+ 'surgery',
+ 'suzuki',
+ 'sv',
+ 'swatch',
+ 'swiss',
+ 'sx',
+ 'sy',
+ 'sydney',
+ 'systems',
+ 'sz',
+ 'taipei',
+ 'tatamotors',
+ 'tatar',
+ 'tattoo',
+ 'tax',
+ 'taxi',
+ 'tc',
+ 'td',
+ 'team',
+ 'tech',
+ 'technology',
+ 'tel',
+ 'telefonica',
+ 'temasek',
+ 'tennis',
+ 'tf',
+ 'tg',
+ 'th',
+ 'thd',
+ 'theater',
+ 'theatre',
+ 'tickets',
+ 'tienda',
+ 'tips',
+ 'tires',
+ 'tirol',
+ 'tj',
+ 'tk',
+ 'tl',
+ 'tm',
+ 'tn',
+ 'to',
+ 'today',
+ 'tokyo',
+ 'tools',
+ 'top',
+ 'toray',
+ 'toshiba',
+ 'tours',
+ 'town',
+ 'toyota',
+ 'toys',
+ 'tr',
+ 'trade',
+ 'trading',
+ 'training',
+ 'travel',
+ 'trust',
+ 'tt',
+ 'tui',
+ 'tv',
+ 'tw',
+ 'tz',
+ 'ua',
+ 'ubs',
+ 'ug',
+ 'uk',
+ 'university',
+ 'uno',
+ 'uol',
+ 'us',
+ 'uy',
+ 'uz',
+ 'va',
+ 'vacations',
+ 'vc',
+ 've',
+ 'vegas',
+ 'ventures',
+ 'versicherung',
+ 'vet',
+ 'vg',
+ 'vi',
+ 'viajes',
+ 'video',
+ 'villas',
+ 'vin',
+ 'virgin',
+ 'vision',
+ 'vista',
+ 'vistaprint',
+ 'viva',
+ 'vlaanderen',
+ 'vn',
+ 'vodka',
+ 'vote',
+ 'voting',
+ 'voto',
+ 'voyage',
+ 'vu',
+ 'wales',
+ 'walter',
+ 'wang',
+ 'watch',
+ 'webcam',
+ 'website',
+ 'wed',
+ 'wedding',
+ 'weir',
+ 'wf',
+ 'whoswho',
+ 'wien',
+ 'wiki',
+ 'williamhill',
+ 'win',
+ 'windows',
+ 'wine',
+ 'wme',
+ 'work',
+ 'works',
+ 'world',
+ 'ws',
+ 'wtc',
+ 'wtf',
+ 'xbox',
+ 'xerox',
+ 'xin',
+ 'xn--11b4c3d',
+ 'xn--1qqw23a',
+ 'xn--30rr7y',
+ 'xn--3bst00m',
+ 'xn--3ds443g',
+ 'xn--3e0b707e',
+ 'xn--3pxu8k',
+ 'xn--42c2d9a',
+ 'xn--45brj9c',
+ 'xn--45q11c',
+ 'xn--4gbrim',
+ 'xn--55qw42g',
+ 'xn--55qx5d',
+ 'xn--6frz82g',
+ 'xn--6qq986b3xl',
+ 'xn--80adxhks',
+ 'xn--80ao21a',
+ 'xn--80asehdb',
+ 'xn--80aswg',
+ 'xn--90a3ac',
+ 'xn--90ais',
+ 'xn--9dbq2a',
+ 'xn--9et52u',
+ 'xn--b4w605ferd',
+ 'xn--c1avg',
+ 'xn--c2br7g',
+ 'xn--cg4bki',
+ 'xn--clchc0ea0b2g2a9gcd',
+ 'xn--czr694b',
+ 'xn--czrs0t',
+ 'xn--czru2d',
+ 'xn--d1acj3b',
+ 'xn--d1alf',
+ 'xn--efvy88h',
+ 'xn--estv75g',
+ 'xn--fhbei',
+ 'xn--fiq228c5hs',
+ 'xn--fiq64b',
+ 'xn--fiqs8s',
+ 'xn--fiqz9s',
+ 'xn--fjq720a',
+ 'xn--flw351e',
+ 'xn--fpcrj9c3d',
+ 'xn--fzc2c9e2c',
+ 'xn--gecrj9c',
+ 'xn--h2brj9c',
+ 'xn--hxt814e',
+ 'xn--i1b6b1a6a2e',
+ 'xn--imr513n',
+ 'xn--io0a7i',
+ 'xn--j1aef',
+ 'xn--j1amh',
+ 'xn--j6w193g',
+ 'xn--kcrx77d1x4a',
+ 'xn--kprw13d',
+ 'xn--kpry57d',
+ 'xn--kput3i',
+ 'xn--l1acc',
+ 'xn--lgbbat1ad8j',
+ 'xn--mgb9awbf',
+ 'xn--mgba3a3ejt',
+ 'xn--mgba3a4f16a',
+ 'xn--mgbaam7a8h',
+ 'xn--mgbab2bd',
+ 'xn--mgbayh7gpa',
+ 'xn--mgbbh1a71e',
+ 'xn--mgbc0a9azcg',
+ 'xn--mgberp4a5d4ar',
+ 'xn--mgbpl2fh',
+ 'xn--mgbx4cd0ab',
+ 'xn--mk1bu44c',
+ 'xn--mxtq1m',
+ 'xn--ngbc5azd',
+ 'xn--node',
+ 'xn--nqv7f',
+ 'xn--nqv7fs00ema',
+ 'xn--nyqy26a',
+ 'xn--o3cw4h',
+ 'xn--ogbpf8fl',
+ 'xn--p1acf',
+ 'xn--p1ai',
+ 'xn--pgbs0dh',
+ 'xn--pssy2u',
+ 'xn--q9jyb4c',
+ 'xn--qcka1pmc',
+ 'xn--rhqv96g',
+ 'xn--s9brj9c',
+ 'xn--ses554g',
+ 'xn--t60b56a',
+ 'xn--tckwe',
+ 'xn--unup4y',
+ 'xn--vermgensberater-ctb',
+ 'xn--vermgensberatung-pwb',
+ 'xn--vhquv',
+ 'xn--vuq861b',
+ 'xn--wgbh1c',
+ 'xn--wgbl6a',
+ 'xn--xhq521b',
+ 'xn--xkc2al3hye2a',
+ 'xn--xkc2dl3a5ee0h',
+ 'xn--y9a3aq',
+ 'xn--yfro4i67o',
+ 'xn--ygbi2ammx',
+ 'xn--zfr164b',
+ 'xperia',
+ 'xxx',
+ 'xyz',
+ 'yachts',
+ 'yamaxun',
+ 'yandex',
+ 'ye',
+ 'yodobashi',
+ 'yoga',
+ 'yokohama',
+ 'youtube',
+ 'yt',
+ 'za',
+ 'zara',
+ 'zip',
+ 'zm',
+ 'zone',
+ 'zuerich',
+ 'zw',
+ '测试',
+ 'परीक्षा',
+ '佛山',
+ '集团',
+ '在线',
+ '한국',
+ 'ভারত',
+ '八卦',
+ 'موقع',
+ 'বাংলা',
+ '公益',
+ '公司',
+ '移动',
+ '我爱你',
+ 'москва',
+ 'испытание',
+ 'қаз',
+ 'онлайн',
+ 'сайт',
+ 'срб',
+ 'бел',
+ '테스트',
+ 'орг',
+ '삼성',
+ 'சிங்கப்பூர்',
+ '商标',
+ '商城',
+ 'дети',
+ 'мкд',
+ 'טעסט',
+ '中文网',
+ '中信',
+ '中国',
+ '中國',
+ '谷歌',
+ 'భారత్',
+ 'ලංකා',
+ '測試',
+ 'ભારત',
+ 'भारत',
+ 'آزمایشی',
+ 'பரிட்சை',
+ 'संगठन',
+ '网络',
+ 'укр',
+ '香港',
+ 'δοκιμή',
+ 'إختبار',
+ '台湾',
+ '台灣',
+ '手机',
+ 'мон',
+ 'الجزائر',
+ 'عمان',
+ 'ایران',
+ 'امارات',
+ 'بازار',
+ 'پاکستان',
+ 'الاردن',
+ 'بھارت',
+ 'المغرب',
+ 'السعودية',
+ 'سودان',
+ 'عراق',
+ 'مليسيا',
+ 'شبكة',
+ 'გე',
+ '机构',
+ '组织机构',
+ 'ไทย',
+ 'سورية',
+ 'рус',
+ 'рф',
+ 'تونس',
+ 'みんな',
+ 'グーグル',
+ '世界',
+ 'ਭਾਰਤ',
+ '网址',
+ '游戏',
+ 'vermögensberater',
+ 'vermögensberatung',
+ '企业',
+ 'مصر',
+ 'قطر',
+ '广东',
+ 'இலங்கை',
+ 'இந்தியா',
+ 'հայ',
+ '新加坡',
+ 'فلسطين',
+ 'テスト',
+ '政务',
+ );
+
+ /**
+ * @var string
+ */
+ protected $_tld;
+
+ /**
+ * Array for valid Idns
+ * @see http://www.iana.org/domains/idn-tables/ Official list of supported IDN Chars
+ * (.AC) Ascension Island http://www.nic.ac/pdf/AC-IDN-Policy.pdf
+ * (.AR) Argentinia http://www.nic.ar/faqidn.html
+ * (.AS) American Samoa http://www.nic.as/idn/chars.cfm
+ * (.AT) Austria http://www.nic.at/en/service/technical_information/idn/charset_converter/
+ * (.BIZ) International http://www.iana.org/domains/idn-tables/
+ * (.BR) Brazil http://registro.br/faq/faq6.html
+ * (.BV) Bouvett Island http://www.norid.no/domeneregistrering/idn/idn_nyetegn.en.html
+ * (.CA) Canada http://www.iana.org/domains/idn-tables/tables/ca_fr_1.0.html
+ * (.CAT) Catalan http://www.iana.org/domains/idn-tables/tables/cat_ca_1.0.html
+ * (.CH) Switzerland https://nic.switch.ch/reg/ocView.action?res=EF6GW2JBPVTG67DLNIQXU234MN6SC33JNQQGI7L6#anhang1
+ * (.CL) Chile http://www.iana.org/domains/idn-tables/tables/cl_latn_1.0.html
+ * (.COM) International http://www.verisign.com/information-services/naming-services/internationalized-domain-names/index.html
+ * (.DE) Germany http://www.denic.de/en/domains/idns/liste.html
+ * (.DK) Danmark http://www.dk-hostmaster.dk/index.php?id=151
+ * (.ES) Spain https://www.nic.es/media/2008-05/1210147705287.pdf
+ * (.FI) Finland http://www.ficora.fi/en/index/palvelut/fiverkkotunnukset/aakkostenkaytto.html
+ * (.GR) Greece https://grweb.ics.forth.gr/CharacterTable1_en.jsp
+ * (.HU) Hungary http://www.domain.hu/domain/English/szabalyzat/szabalyzat.html
+ * (.INFO) International http://www.nic.info/info/idn
+ * (.IO) British Indian Ocean Territory http://www.nic.io/IO-IDN-Policy.pdf
+ * (.IR) Iran http://www.nic.ir/Allowable_Characters_dot-iran
+ * (.IS) Iceland http://www.isnic.is/domain/rules.php
+ * (.KR) Korea http://www.iana.org/domains/idn-tables/tables/kr_ko-kr_1.0.html
+ * (.LI) Liechtenstein https://nic.switch.ch/reg/ocView.action?res=EF6GW2JBPVTG67DLNIQXU234MN6SC33JNQQGI7L6#anhang1
+ * (.LT) Lithuania http://www.domreg.lt/static/doc/public/idn_symbols-en.pdf
+ * (.MD) Moldova http://www.register.md/
+ * (.MUSEUM) International http://www.iana.org/domains/idn-tables/tables/museum_latn_1.0.html
+ * (.NET) International http://www.verisign.com/information-services/naming-services/internationalized-domain-names/index.html
+ * (.NO) Norway http://www.norid.no/domeneregistrering/idn/idn_nyetegn.en.html
+ * (.NU) Niue http://www.worldnames.net/
+ * (.ORG) International http://www.pir.org/index.php?db=content/FAQs&tbl=FAQs_Registrant&id=2
+ * (.PE) Peru https://www.nic.pe/nuevas_politicas_faq_2.php
+ * (.PL) Poland http://www.dns.pl/IDN/allowed_character_sets.pdf
+ * (.PR) Puerto Rico http://www.nic.pr/idn_rules.asp
+ * (.PT) Portugal https://online.dns.pt/dns_2008/do?com=DS;8216320233;111;+PAGE(4000058)+K-CAT-CODIGO(C.125)+RCNT(100);
+ * (.RU) Russia http://www.iana.org/domains/idn-tables/tables/ru_ru-ru_1.0.html
+ * (.RS) Serbia http://www.iana.org/domains/idn-tables/tables/rs_sr-rs_1.0.pdf
+ * (.SA) Saudi Arabia http://www.iana.org/domains/idn-tables/tables/sa_ar_1.0.html
+ * (.SE) Sweden http://www.iis.se/english/IDN_campaignsite.shtml?lang=en
+ * (.SH) Saint Helena http://www.nic.sh/SH-IDN-Policy.pdf
+ * (.SJ) Svalbard and Jan Mayen http://www.norid.no/domeneregistrering/idn/idn_nyetegn.en.html
+ * (.TH) Thailand http://www.iana.org/domains/idn-tables/tables/th_th-th_1.0.html
+ * (.TM) Turkmenistan http://www.nic.tm/TM-IDN-Policy.pdf
+ * (.TR) Turkey https://www.nic.tr/index.php
+ * (.UA) Ukraine http://www.iana.org/domains/idn-tables/tables/ua_cyrl_1.2.html
+ * (.VE) Venice http://www.iana.org/domains/idn-tables/tables/ve_es_1.0.html
+ * (.VN) Vietnam http://www.vnnic.vn/english/5-6-300-2-2-04-20071115.htm#1.%20Introduction
+ *
+ * @var array
+ */
+ protected $_validIdns = array(
+ 'AC' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēėęěĝġģĥħīįĵķĺļľŀłńņňŋőœŕŗřśŝşšţťŧūŭůűųŵŷźżž]{1,63}$/iu'),
+ 'AR' => array(1 => '/^[\x{002d}0-9a-zà-ãç-êìíñ-õü]{1,63}$/iu'),
+ 'AS' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĸĺļľłńņňŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźż]{1,63}$/iu'),
+ 'AT' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿœšž]{1,63}$/iu'),
+ 'BIZ' => 'Hostname/Biz.php',
+ 'BR' => array(1 => '/^[\x{002d}0-9a-zà-ãçéíó-õúü]{1,63}$/iu'),
+ 'BV' => array(1 => '/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'),
+ 'CA' => array(1 => '/^[\x{002d}0-9a-zàâæçéèêëîïôœùûüÿ\x{00E0}\x{00E2}\x{00E7}\x{00E8}\x{00E9}\x{00EA}\x{00EB}\x{00EE}\x{00EF}\x{00F4}\x{00F9}\x{00FB}\x{00FC}\x{00E6}\x{0153}\x{00FF}]{1,63}$/iu'),
+ 'CAT' => array(1 => '/^[\x{002d}0-9a-z·àç-éíïòóúü]{1,63}$/iu'),
+ 'CH' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿœ]{1,63}$/iu'),
+ 'CL' => array(1 => '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu'),
+ 'CN' => 'Hostname/Cn.php',
+ 'COM' => 'Hostname/Com.php',
+ 'DE' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťßţŧŭůűũųūŵŷźžż]{1,63}$/iu'),
+ 'DK' => array(1 => '/^[\x{002d}0-9a-zäéöüæøå]{1,63}$/iu'),
+ 'ES' => array(1 => '/^[\x{002d}0-9a-zàáçèéíïñòóúü·]{1,63}$/iu'),
+ 'EU' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿ]{1,63}$/iu',
+ 2 => '/^[\x{002d}0-9a-zāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĺļľŀłńņňʼnŋōŏőœŕŗřśŝšťŧũūŭůűųŵŷźżž]{1,63}$/iu',
+ 3 => '/^[\x{002d}0-9a-zșț]{1,63}$/iu',
+ 4 => '/^[\x{002d}0-9a-zΐάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ]{1,63}$/iu',
+ 5 => '/^[\x{002d}0-9a-zабвгдежзийклмнопрстуфхцчшщъыьэюя]{1,63}$/iu',
+ 6 => '/^[\x{002d}0-9a-zἀ-ἇἐ-ἕἠ-ἧἰ-ἷὀ-ὅὐ-ὗὠ-ὧὰ-ὼώᾀ-ᾇᾐ-ᾗᾠ-ᾧᾰ-ᾴᾶᾷῂῃῄῆῇῐ-ῒΐῖῗῠ-ῧῲῳῴῶῷ]{1,63}$/iu'),
+ 'FI' => array(1 => '/^[\x{002d}0-9a-zäåö]{1,63}$/iu'),
+ 'GR' => array(1 => '/^[\x{002d}0-9a-zΆΈΉΊΌΎ-ΡΣ-ώἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼῂῃῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲῳῴῶ-ῼ]{1,63}$/iu'),
+ 'HK' => 'Hostname/Cn.php',
+ 'HU' => array(1 => '/^[\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu'),
+ 'IL' => array(1 => '/^[\x{002d}0-9\x{05D0}-\x{05EA}]{1,63}$/iu',
+ 2 => '/^[\x{002d}0-9a-z]{1,63}$/i'),
+ 'INFO'=> array(1 => '/^[\x{002d}0-9a-zäåæéöøü]{1,63}$/iu',
+ 2 => '/^[\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu',
+ 3 => '/^[\x{002d}0-9a-záæéíðóöúýþ]{1,63}$/iu',
+ 4 => '/^[\x{AC00}-\x{D7A3}]{1,17}$/iu',
+ 5 => '/^[\x{002d}0-9a-zāčēģīķļņōŗšūž]{1,63}$/iu',
+ 6 => '/^[\x{002d}0-9a-ząčėęįšūųž]{1,63}$/iu',
+ 7 => '/^[\x{002d}0-9a-zóąćęłńśźż]{1,63}$/iu',
+ 8 => '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu'),
+ 'IO' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'),
+ 'IS' => array(1 => '/^[\x{002d}0-9a-záéýúíóþæöð]{1,63}$/iu'),
+ 'IT' => array(1 => '/^[\x{002d}0-9a-zàâäèéêëìîïòôöùûüæœçÿß-]{1,63}$/iu'),
+ 'JP' => 'Hostname/Jp.php',
+ 'KR' => array(1 => '/^[\x{AC00}-\x{D7A3}]{1,17}$/iu'),
+ 'LI' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿœ]{1,63}$/iu'),
+ 'LT' => array(1 => '/^[\x{002d}0-9ąčęėįšųūž]{1,63}$/iu'),
+ 'MD' => array(1 => '/^[\x{002d}0-9ăâîşţ]{1,63}$/iu'),
+ 'MUSEUM' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćċčďđēėęěğġģħīįıķĺļľłńņňŋōőœŕŗřśşšţťŧūůűųŵŷźżžǎǐǒǔ\x{01E5}\x{01E7}\x{01E9}\x{01EF}ə\x{0292}ẁẃẅỳ]{1,63}$/iu'),
+ 'NET' => 'Hostname/Com.php',
+ 'NO' => array(1 => '/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'),
+ 'NU' => 'Hostname/Com.php',
+ 'ORG' => array(1 => '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu',
+ 2 => '/^[\x{002d}0-9a-zóąćęłńśźż]{1,63}$/iu',
+ 3 => '/^[\x{002d}0-9a-záäåæéëíðóöøúüýþ]{1,63}$/iu',
+ 4 => '/^[\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu',
+ 5 => '/^[\x{002d}0-9a-ząčėęįšūųž]{1,63}$/iu',
+ 6 => '/^[\x{AC00}-\x{D7A3}]{1,17}$/iu',
+ 7 => '/^[\x{002d}0-9a-zāčēģīķļņōŗšūž]{1,63}$/iu'),
+ 'PE' => array(1 => '/^[\x{002d}0-9a-zñáéíóúü]{1,63}$/iu'),
+ 'PL' => array(1 => '/^[\x{002d}0-9a-zāčēģīķļņōŗšūž]{1,63}$/iu',
+ 2 => '/^[\x{002d}а-ик-ш\x{0450}ѓѕјљњќџ]{1,63}$/iu',
+ 3 => '/^[\x{002d}0-9a-zâîăşţ]{1,63}$/iu',
+ 4 => '/^[\x{002d}0-9а-яё\x{04C2}]{1,63}$/iu',
+ 5 => '/^[\x{002d}0-9a-zàáâèéêìíîòóôùúûċġħż]{1,63}$/iu',
+ 6 => '/^[\x{002d}0-9a-zàäåæéêòóôöøü]{1,63}$/iu',
+ 7 => '/^[\x{002d}0-9a-zóąćęłńśźż]{1,63}$/iu',
+ 8 => '/^[\x{002d}0-9a-zàáâãçéêíòóôõúü]{1,63}$/iu',
+ 9 => '/^[\x{002d}0-9a-zâîăşţ]{1,63}$/iu',
+ 10=> '/^[\x{002d}0-9a-záäéíóôúýčďĺľňŕšťž]{1,63}$/iu',
+ 11=> '/^[\x{002d}0-9a-zçë]{1,63}$/iu',
+ 12=> '/^[\x{002d}0-9а-ик-шђјљњћџ]{1,63}$/iu',
+ 13=> '/^[\x{002d}0-9a-zćčđšž]{1,63}$/iu',
+ 14=> '/^[\x{002d}0-9a-zâçöûüğış]{1,63}$/iu',
+ 15=> '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu',
+ 16=> '/^[\x{002d}0-9a-zäõöüšž]{1,63}$/iu',
+ 17=> '/^[\x{002d}0-9a-zĉĝĥĵŝŭ]{1,63}$/iu',
+ 18=> '/^[\x{002d}0-9a-zâäéëîô]{1,63}$/iu',
+ 19=> '/^[\x{002d}0-9a-zàáâäåæçèéêëìíîïðñòôöøùúûüýćčłńřśš]{1,63}$/iu',
+ 20=> '/^[\x{002d}0-9a-zäåæõöøüšž]{1,63}$/iu',
+ 21=> '/^[\x{002d}0-9a-zàáçèéìíòóùú]{1,63}$/iu',
+ 22=> '/^[\x{002d}0-9a-zàáéíóöúüőű]{1,63}$/iu',
+ 23=> '/^[\x{002d}0-9ΐά-ώ]{1,63}$/iu',
+ 24=> '/^[\x{002d}0-9a-zàáâåæçèéêëðóôöøüþœ]{1,63}$/iu',
+ 25=> '/^[\x{002d}0-9a-záäéíóöúüýčďěňřšťůž]{1,63}$/iu',
+ 26=> '/^[\x{002d}0-9a-z·àçèéíïòóúü]{1,63}$/iu',
+ 27=> '/^[\x{002d}0-9а-ъьюя\x{0450}\x{045D}]{1,63}$/iu',
+ 28=> '/^[\x{002d}0-9а-яёіў]{1,63}$/iu',
+ 29=> '/^[\x{002d}0-9a-ząčėęįšūųž]{1,63}$/iu',
+ 30=> '/^[\x{002d}0-9a-záäåæéëíðóöøúüýþ]{1,63}$/iu',
+ 31=> '/^[\x{002d}0-9a-zàâæçèéêëîïñôùûüÿœ]{1,63}$/iu',
+ 32=> '/^[\x{002d}0-9а-щъыьэюяёєіїґ]{1,63}$/iu',
+ 33=> '/^[\x{002d}0-9א-ת]{1,63}$/iu'),
+ 'PR' => array(1 => '/^[\x{002d}0-9a-záéíóúñäëïüöâêîôûàèùæçœãõ]{1,63}$/iu'),
+ 'PT' => array(1 => '/^[\x{002d}0-9a-záàâãçéêíóôõú]{1,63}$/iu'),
+ 'RS' => array(1 => '/^[\x{002D}\x{0030}-\x{0039}\x{0061}-\x{007A}\x{0107}\x{010D}\x{0111}\x{0161}\x{017E}]{1,63}$/iu)'),
+ 'RU' => array(1 => '/^[\x{002d}0-9а-яё]{1,63}$/iu'),
+ 'SA' => array(1 => '/^[\x{002d}.0-9\x{0621}-\x{063A}\x{0641}-\x{064A}\x{0660}-\x{0669}]{1,63}$/iu'),
+ 'SE' => array(1 => '/^[\x{002d}0-9a-zäåéöü]{1,63}$/iu'),
+ 'SH' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿăąāćĉčċďđĕěėęēğĝġģĥħĭĩįīıĵķĺľļłńňņŋŏőōœĸŕřŗśŝšşťţŧŭůűũųūŵŷźžż]{1,63}$/iu'),
+ 'SI' => array(
+ 1 => '/^[\x{002d}0-9a-zà-öø-ÿ]{1,63}$/iu',
+ 2 => '/^[\x{002d}0-9a-zāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĺļľŀłńņňʼnŋōŏőœŕŗřśŝšťŧũūŭůűųŵŷźżž]{1,63}$/iu',
+ 3 => '/^[\x{002d}0-9a-zșț]{1,63}$/iu'),
+ 'SJ' => array(1 => '/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu'),
+ 'TH' => array(1 => '/^[\x{002d}0-9a-z\x{0E01}-\x{0E3A}\x{0E40}-\x{0E4D}\x{0E50}-\x{0E59}]{1,63}$/iu'),
+ 'TM' => array(1 => '/^[\x{002d}0-9a-zà-öø-ÿāăąćĉċčďđēėęěĝġģĥħīįĵķĺļľŀłńņňŋőœŕŗřśŝşšţťŧūŭůűųŵŷźżž]{1,63}$/iu'),
+ 'TW' => 'Hostname/Cn.php',
+ 'TR' => array(1 => '/^[\x{002d}0-9a-zğıüşöç]{1,63}$/iu'),
+ 'UA' => array(1 => '/^[\x{002d}0-9a-zабвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљњћќѝўџґӂʼ]{1,63}$/iu'),
+ 'VE' => array(1 => '/^[\x{002d}0-9a-záéíóúüñ]{1,63}$/iu'),
+ 'VN' => array(1 => '/^[ÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚÝàáâãèéêìíòóôõùúýĂăĐđĨĩŨũƠơƯư\x{1EA0}-\x{1EF9}]{1,63}$/iu'),
+ 'мон' => array(1 => '/^[\x{002d}0-9\x{0430}-\x{044F}]{1,63}$/iu'),
+ 'срб' => array(1 => '/^[\x{002d}0-9а-ик-шђјљњћџ]{1,63}$/iu'),
+ 'сайт' => array(1 => '/^[\x{002d}0-9а-яёіїѝйўґг]{1,63}$/iu'),
+ 'онлайн' => array(1 => '/^[\x{002d}0-9а-яёіїѝйўґг]{1,63}$/iu'),
+ '中国' => 'Hostname/Cn.php',
+ '中國' => 'Hostname/Cn.php',
+ 'ලංකා' => array(1 => '/^[\x{0d80}-\x{0dff}]{1,63}$/iu'),
+ '香港' => 'Hostname/Cn.php',
+ '台湾' => 'Hostname/Cn.php',
+ '台灣' => 'Hostname/Cn.php',
+ 'امارات' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'),
+ 'الاردن' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'),
+ 'السعودية' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'),
+ 'ไทย' => array(1 => '/^[\x{002d}0-9a-z\x{0E01}-\x{0E3A}\x{0E40}-\x{0E4D}\x{0E50}-\x{0E59}]{1,63}$/iu'),
+ 'рф' => array(1 => '/^[\x{002d}0-9а-яё]{1,63}$/iu'),
+ 'تونس' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'),
+ 'مصر' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'),
+ 'இலங்கை' => array(1 => '/^[\x{0b80}-\x{0bff}]{1,63}$/iu'),
+ 'فلسطين' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'),
+ 'شبكة' => array(1 => '/^[\x{0621}-\x{0624}\x{0626}-\x{063A}\x{0641}\x{0642}\x{0644}-\x{0648}\x{067E}\x{0686}\x{0698}\x{06A9}\x{06AF}\x{06CC}\x{06F0}-\x{06F9}]{1,30}$/iu'),
+ );
+
+ protected $_idnLength = array(
+ 'BIZ' => array(5 => 17, 11 => 15, 12 => 20),
+ 'CN' => array(1 => 20),
+ 'COM' => array(3 => 17, 5 => 20),
+ 'HK' => array(1 => 15),
+ 'INFO'=> array(4 => 17),
+ 'KR' => array(1 => 17),
+ 'NET' => array(3 => 17, 5 => 20),
+ 'ORG' => array(6 => 17),
+ 'TW' => array(1 => 20),
+ 'ایران' => array(1 => 30),
+ '中国' => array(1 => 20),
+ '公司' => array(1 => 20),
+ '网络' => array(1 => 20),
+ );
+
+ protected $_options = array(
+ 'allow' => self::ALLOW_DNS,
+ 'idn' => true,
+ 'tld' => true,
+ 'ip' => null
+ );
+
+ /**
+ * Sets validator options
+ *
+ * @see http://www.iana.org/cctld/specifications-policies-cctlds-01apr02.htm Technical Specifications for ccTLDs
+ * @param array $options Validator options
+ */
+ public function __construct($options = array())
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (!is_array($options)) {
+ $options = func_get_args();
+ $temp['allow'] = array_shift($options);
+ if (!empty($options)) {
+ $temp['idn'] = array_shift($options);
+ }
+
+ if (!empty($options)) {
+ $temp['tld'] = array_shift($options);
+ }
+
+ if (!empty($options)) {
+ $temp['ip'] = array_shift($options);
+ }
+
+ $options = $temp;
+ }
+
+ $options += $this->_options;
+ $this->setOptions($options);
+ }
+
+ /**
+ * Returns all set options
+ *
+ * @return array
+ */
+ public function getOptions()
+ {
+ return $this->_options;
+ }
+
+ /**
+ * Sets the options for this validator
+ *
+ * @param array $options
+ * @return Zend_Validate_Hostname
+ */
+ public function setOptions($options)
+ {
+ if (array_key_exists('allow', $options)) {
+ $this->setAllow($options['allow']);
+ }
+
+ if (array_key_exists('idn', $options)) {
+ $this->setValidateIdn($options['idn']);
+ }
+
+ if (array_key_exists('tld', $options)) {
+ $this->setValidateTld($options['tld']);
+ }
+
+ if (array_key_exists('ip', $options)) {
+ $this->setIpValidator($options['ip']);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns the set ip validator
+ *
+ * @return Zend_Validate_Ip
+ */
+ public function getIpValidator()
+ {
+ return $this->_options['ip'];
+ }
+
+ /**
+ * @param Zend_Validate_Ip $ipValidator OPTIONAL
+ * @return Zend_Validate_Hostname
+ */
+ public function setIpValidator(Zend_Validate_Ip $ipValidator = null)
+ {
+ if ($ipValidator === null) {
+ $ipValidator = new Zend_Validate_Ip();
+ }
+
+ $this->_options['ip'] = $ipValidator;
+ return $this;
+ }
+
+ /**
+ * Returns the allow option
+ *
+ * @return integer
+ */
+ public function getAllow()
+ {
+ return $this->_options['allow'];
+ }
+
+ /**
+ * Sets the allow option
+ *
+ * @param integer $allow
+ * @return Zend_Validate_Hostname Provides a fluent interface
+ */
+ public function setAllow($allow)
+ {
+ $this->_options['allow'] = $allow;
+ return $this;
+ }
+
+ /**
+ * Returns the set idn option
+ *
+ * @return boolean
+ */
+ public function getValidateIdn()
+ {
+ return $this->_options['idn'];
+ }
+
+ /**
+ * Set whether IDN domains are validated
+ *
+ * This only applies when DNS hostnames are validated
+ *
+ * @param boolean $allowed Set allowed to true to validate IDNs, and false to not validate them
+ * @return $this
+ */
+ public function setValidateIdn ($allowed)
+ {
+ $this->_options['idn'] = (bool) $allowed;
+ return $this;
+ }
+
+ /**
+ * Returns the set tld option
+ *
+ * @return boolean
+ */
+ public function getValidateTld()
+ {
+ return $this->_options['tld'];
+ }
+
+ /**
+ * Set whether the TLD element of a hostname is validated
+ *
+ * This only applies when DNS hostnames are validated
+ *
+ * @param boolean $allowed Set allowed to true to validate TLDs, and false to not validate them
+ * @return $this
+ */
+ public function setValidateTld ($allowed)
+ {
+ $this->_options['tld'] = (bool) $allowed;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if the $value is a valid hostname with respect to the current allow option
+ *
+ * @param string $value
+ * @throws Zend_Validate_Exception if a fatal error occurs for validation process
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ if (!is_string($value)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ $this->_setValue($value);
+ // Check input against IP address schema
+ if (preg_match('/^[0-9a-f:.]*$/i', $value) &&
+ $this->_options['ip']->setTranslator($this->getTranslator())->isValid($value)) {
+ if (!($this->_options['allow'] & self::ALLOW_IP)) {
+ $this->_error(self::IP_ADDRESS_NOT_ALLOWED);
+ return false;
+ } else {
+ return true;
+ }
+ }
+
+ // RFC3986 3.2.2 states:
+ //
+ // The rightmost domain label of a fully qualified domain name
+ // in DNS may be followed by a single "." and should be if it is
+ // necessary to distinguish between the complete domain name and
+ // some local domain.
+ //
+ // (see ZF-6363)
+
+ // Local hostnames are allowed to be partitial (ending '.')
+ if ($this->_options['allow'] & self::ALLOW_LOCAL) {
+ if (substr($value, -1) === '.') {
+ $value = substr($value, 0, -1);
+ if (substr($value, -1) === '.') {
+ // Empty hostnames (ending '..') are not allowed
+ $this->_error(self::INVALID_LOCAL_NAME);
+ return false;
+ }
+ }
+ }
+
+ $domainParts = explode('.', $value);
+
+ // Prevent partitial IP V4 adresses (ending '.')
+ if ((count($domainParts) == 4) && preg_match('/^[0-9.a-e:.]*$/i', $value) &&
+ $this->_options['ip']->setTranslator($this->getTranslator())->isValid($value)) {
+ $this->_error(self::INVALID_LOCAL_NAME);
+ }
+
+ // Check input against DNS hostname schema
+ if ((count($domainParts) > 1) && (strlen($value) >= 4) && (strlen($value) <= 254)) {
+ $status = false;
+
+ $origenc = PHP_VERSION_ID < 50600
+ ? iconv_get_encoding('internal_encoding')
+ : ini_get('default_charset');
+ if (PHP_VERSION_ID < 50600) {
+ iconv_set_encoding('internal_encoding', 'UTF-8');
+ } else {
+ ini_set('default_charset', 'UTF-8');
+ }
+ do {
+ // First check TLD
+ $matches = array();
+ if (preg_match('/([^.]{2,63})$/iu', end($domainParts), $matches)
+ || (array_key_exists(end($domainParts), $this->_validIdns))) {
+ reset($domainParts);
+
+ // Hostname characters are: *(label dot)(label dot label); max 254 chars
+ // label: id-prefix [*ldh{61} id-prefix]; max 63 chars
+ // id-prefix: alpha / digit
+ // ldh: alpha / digit / dash
+
+ // Match TLD against known list
+ $this->_tld = $matches[1];
+ if ($this->_options['tld']) {
+ if (!in_array(strtolower($this->_tld), $this->_validTlds)
+ && !in_array($this->_tld, $this->_validTlds)) {
+ $this->_error(self::UNKNOWN_TLD);
+ $status = false;
+ break;
+ }
+ // We have already validated that the TLD is fine. We don't want it to go through the below
+ // checks as new UTF-8 TLDs will incorrectly fail if there is no IDN regex for it.
+ array_pop($domainParts);
+ }
+
+ /**
+ * Match against IDN hostnames
+ * Note: Keep label regex short to avoid issues with long patterns when matching IDN hostnames
+ * @see Zend_Validate_Hostname_Interface
+ */
+ $regexChars = array(0 => '/^[a-z0-9\x2d]{1,63}$/i');
+ if ($this->_options['idn'] && isset($this->_validIdns[strtoupper($this->_tld)])) {
+ if (is_string($this->_validIdns[strtoupper($this->_tld)])) {
+ $regexChars += include($this->_validIdns[strtoupper($this->_tld)]);
+ } else {
+ $regexChars += $this->_validIdns[strtoupper($this->_tld)];
+ }
+ }
+
+ // Check each hostname part
+ $check = 0;
+ foreach ($domainParts as $domainPart) {
+ // If some domain part is empty (i.e. zend..com), it's invalid
+ if (empty($domainPart) && $domainPart !== '0') {
+ $this->_error(self::INVALID_HOSTNAME);
+ return false;
+ }
+
+ // Decode Punycode domainnames to IDN
+ if (strpos($domainPart, 'xn--') === 0) {
+ $domainPart = $this->decodePunycode(substr($domainPart, 4));
+ if ($domainPart === false) {
+ return false;
+ }
+ }
+
+ // Check dash (-) does not start, end or appear in 3rd and 4th positions
+ if ((strpos($domainPart, '-') === 0)
+ || ((strlen($domainPart) > 2) && (strpos($domainPart, '-', 2) == 2) && (strpos($domainPart, '-', 3) == 3))
+ || (strpos($domainPart, '-') === (strlen($domainPart) - 1))) {
+ $this->_error(self::INVALID_DASH);
+ $status = false;
+ break 2;
+ }
+
+ // Check each domain part
+ $checked = false;
+ foreach($regexChars as $regexKey => $regexChar) {
+ $status = preg_match($regexChar, $domainPart);
+ if ($status > 0) {
+ $length = 63;
+ if (array_key_exists(strtoupper($this->_tld), $this->_idnLength)
+ && (array_key_exists($regexKey, $this->_idnLength[strtoupper($this->_tld)]))) {
+ $length = $this->_idnLength[strtoupper($this->_tld)];
+ }
+
+ if (iconv_strlen($domainPart, 'UTF-8') > $length) {
+ $this->_error(self::INVALID_HOSTNAME);
+ } else {
+ $checked = true;
+ break;
+ }
+ }
+ }
+
+ if ($checked) {
+ ++$check;
+ }
+ }
+
+ // If one of the labels doesn't match, the hostname is invalid
+ if ($check !== count($domainParts)) {
+ $this->_error(self::INVALID_HOSTNAME_SCHEMA);
+ $status = false;
+ }
+ } else {
+ // Hostname not long enough
+ $this->_error(self::UNDECIPHERABLE_TLD);
+ $status = false;
+ }
+ } while (false);
+
+ if (PHP_VERSION_ID < 50600) {
+ iconv_set_encoding('internal_encoding', $origenc);
+ } else {
+ ini_set('default_charset', $origenc);
+ }
+ // If the input passes as an Internet domain name, and domain names are allowed, then the hostname
+ // passes validation
+ if ($status && ($this->_options['allow'] & self::ALLOW_DNS)) {
+ return true;
+ }
+ } else if ($this->_options['allow'] & self::ALLOW_DNS) {
+ $this->_error(self::INVALID_HOSTNAME);
+ }
+
+ // Check for URI Syntax (RFC3986)
+ if ($this->_options['allow'] & self::ALLOW_URI) {
+ if (preg_match("/^([a-zA-Z0-9-._~!$&\'()*+,;=]|%[[:xdigit:]]{2}){1,254}$/i", $value)) {
+ return true;
+ } else {
+ $this->_error(self::INVALID_URI);
+ }
+ }
+
+ // Check input against local network name schema; last chance to pass validation
+ $regexLocal = '/^(([a-zA-Z0-9\x2d]{1,63}\x2e)*[a-zA-Z0-9\x2d]{1,63}[\x2e]{0,1}){1,254}$/';
+ $status = @preg_match($regexLocal, $value);
+
+ // If the input passes as a local network name, and local network names are allowed, then the
+ // hostname passes validation
+ $allowLocal = $this->_options['allow'] & self::ALLOW_LOCAL;
+ if ($status && $allowLocal) {
+ return true;
+ }
+
+ // If the input does not pass as a local network name, add a message
+ if (!$status) {
+ $this->_error(self::INVALID_LOCAL_NAME);
+ }
+
+ // If local network names are not allowed, add a message
+ if ($status && !$allowLocal) {
+ $this->_error(self::LOCAL_NAME_NOT_ALLOWED);
+ }
+
+ return false;
+ }
+
+ /**
+ * Decodes a punycode encoded string to it's original utf8 string
+ * In case of a decoding failure the original string is returned
+ *
+ * @param string $encoded Punycode encoded string to decode
+ * @return string
+ */
+ protected function decodePunycode($encoded)
+ {
+ if (!preg_match('/^[a-z0-9-]+$/i', $encoded)) {
+ // no punycode encoded string
+ $this->_error(self::CANNOT_DECODE_PUNYCODE);
+ return false;
+ }
+
+ $decoded = array();
+ $separator = strrpos($encoded, '-');
+ if ($separator > 0) {
+ for ($x = 0; $x < $separator; ++$x) {
+ // prepare decoding matrix
+ $decoded[] = ord($encoded[$x]);
+ }
+ }
+
+ $lengthd = count($decoded);
+ $lengthe = strlen($encoded);
+
+ // decoding
+ $init = true;
+ $base = 72;
+ $index = 0;
+ $char = 0x80;
+
+ for ($indexe = ($separator) ? ($separator + 1) : 0; $indexe < $lengthe; ++$lengthd) {
+ for ($old_index = $index, $pos = 1, $key = 36; 1 ; $key += 36) {
+ $hex = ord($encoded[$indexe++]);
+ $digit = ($hex - 48 < 10) ? $hex - 22
+ : (($hex - 65 < 26) ? $hex - 65
+ : (($hex - 97 < 26) ? $hex - 97
+ : 36));
+
+ $index += $digit * $pos;
+ $tag = ($key <= $base) ? 1 : (($key >= $base + 26) ? 26 : ($key - $base));
+ if ($digit < $tag) {
+ break;
+ }
+
+ $pos = (int) ($pos * (36 - $tag));
+ }
+
+ $delta = intval($init ? (($index - $old_index) / 700) : (($index - $old_index) / 2));
+ $delta += intval($delta / ($lengthd + 1));
+ for ($key = 0; $delta > 910 / 2; $key += 36) {
+ $delta = intval($delta / 35);
+ }
+
+ $base = intval($key + 36 * $delta / ($delta + 38));
+ $init = false;
+ $char += (int) ($index / ($lengthd + 1));
+ $index %= ($lengthd + 1);
+ if ($lengthd > 0) {
+ for ($i = $lengthd; $i > $index; $i--) {
+ $decoded[$i] = $decoded[($i - 1)];
+ }
+ }
+
+ $decoded[$index++] = $char;
+ }
+
+ // convert decoded ucs4 to utf8 string
+ foreach ($decoded as $key => $value) {
+ if ($value < 128) {
+ $decoded[$key] = chr($value);
+ } elseif ($value < (1 << 11)) {
+ $decoded[$key] = chr(192 + ($value >> 6));
+ $decoded[$key] .= chr(128 + ($value & 63));
+ } elseif ($value < (1 << 16)) {
+ $decoded[$key] = chr(224 + ($value >> 12));
+ $decoded[$key] .= chr(128 + (($value >> 6) & 63));
+ $decoded[$key] .= chr(128 + ($value & 63));
+ } elseif ($value < (1 << 21)) {
+ $decoded[$key] = chr(240 + ($value >> 18));
+ $decoded[$key] .= chr(128 + (($value >> 12) & 63));
+ $decoded[$key] .= chr(128 + (($value >> 6) & 63));
+ $decoded[$key] .= chr(128 + ($value & 63));
+ } else {
+ $this->_error(self::CANNOT_DECODE_PUNYCODE);
+ return false;
+ }
+ }
+
+ return implode($decoded);
+ }
+}
diff --git a/library/vendor/Zend/Validate/Hostname/Biz.php b/library/vendor/Zend/Validate/Hostname/Biz.php
new file mode 100644
index 0000000..eb1bea2
--- /dev/null
+++ b/library/vendor/Zend/Validate/Hostname/Biz.php
@@ -0,0 +1,2917 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Ressource file for biz idn validation
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+return array(
+ 1 => '/^[\x{002d}0-9a-zäåæéöøü]{1,63}$/iu',
+ 2 => '/^[\x{002d}0-9a-záéíñóúü]{1,63}$/iu',
+ 3 => '/^[\x{002d}0-9a-záéíóöúüőű]{1,63}$/iu',
+ 4 => '/^[\x{002d}0-9a-záæéíðóöúýþ]{1,63}$/iu',
+ 5 => '/^[\x{AC00}-\x{D7A3}]{1,17}$/iu',
+ 6 => '/^[\x{002d}0-9a-ząčėęįšūųž]{1,63}$/iu',
+ 7 => '/^[\x{002d}0-9a-zāčēģīķļņōŗšūž]{1,63}$/iu',
+ 8 => '/^[\x{002d}0-9a-zàáä-éêñ-ôöøüčđńŋšŧž]{1,63}$/iu',
+ 9 => '/^[\x{002d}0-9a-zóąćęłńśźż]{1,63}$/iu',
+ 10 => '/^[\x{002d}0-9a-záàâãçéêíóôõú]{1,63}$/iu',
+ 11 => '/^[\x{002d}0-9a-z\x{3005}-\x{3007}\x{3041}-\x{3093}\x{309D}\x{309E}\x{30A1}-\x{30F6}\x{30FC}' .
+'\x{30FD}\x{30FE}\x{4E00}\x{4E01}\x{4E03}\x{4E07}\x{4E08}\x{4E09}\x{4E0A}' .
+'\x{4E0B}\x{4E0D}\x{4E0E}\x{4E10}\x{4E11}\x{4E14}\x{4E15}\x{4E16}\x{4E17}' .
+'\x{4E18}\x{4E19}\x{4E1E}\x{4E21}\x{4E26}\x{4E2A}\x{4E2D}\x{4E31}\x{4E32}' .
+'\x{4E36}\x{4E38}\x{4E39}\x{4E3B}\x{4E3C}\x{4E3F}\x{4E42}\x{4E43}\x{4E45}' .
+'\x{4E4B}\x{4E4D}\x{4E4E}\x{4E4F}\x{4E55}\x{4E56}\x{4E57}\x{4E58}\x{4E59}' .
+'\x{4E5D}\x{4E5E}\x{4E5F}\x{4E62}\x{4E71}\x{4E73}\x{4E7E}\x{4E80}\x{4E82}' .
+'\x{4E85}\x{4E86}\x{4E88}\x{4E89}\x{4E8A}\x{4E8B}\x{4E8C}\x{4E8E}\x{4E91}' .
+'\x{4E92}\x{4E94}\x{4E95}\x{4E98}\x{4E99}\x{4E9B}\x{4E9C}\x{4E9E}\x{4E9F}' .
+'\x{4EA0}\x{4EA1}\x{4EA2}\x{4EA4}\x{4EA5}\x{4EA6}\x{4EA8}\x{4EAB}\x{4EAC}' .
+'\x{4EAD}\x{4EAE}\x{4EB0}\x{4EB3}\x{4EB6}\x{4EBA}\x{4EC0}\x{4EC1}\x{4EC2}' .
+'\x{4EC4}\x{4EC6}\x{4EC7}\x{4ECA}\x{4ECB}\x{4ECD}\x{4ECE}\x{4ECF}\x{4ED4}' .
+'\x{4ED5}\x{4ED6}\x{4ED7}\x{4ED8}\x{4ED9}\x{4EDD}\x{4EDE}\x{4EDF}\x{4EE3}' .
+'\x{4EE4}\x{4EE5}\x{4EED}\x{4EEE}\x{4EF0}\x{4EF2}\x{4EF6}\x{4EF7}\x{4EFB}' .
+'\x{4F01}\x{4F09}\x{4F0A}\x{4F0D}\x{4F0E}\x{4F0F}\x{4F10}\x{4F11}\x{4F1A}' .
+'\x{4F1C}\x{4F1D}\x{4F2F}\x{4F30}\x{4F34}\x{4F36}\x{4F38}\x{4F3A}\x{4F3C}' .
+'\x{4F3D}\x{4F43}\x{4F46}\x{4F47}\x{4F4D}\x{4F4E}\x{4F4F}\x{4F50}\x{4F51}' .
+'\x{4F53}\x{4F55}\x{4F57}\x{4F59}\x{4F5A}\x{4F5B}\x{4F5C}\x{4F5D}\x{4F5E}' .
+'\x{4F69}\x{4F6F}\x{4F70}\x{4F73}\x{4F75}\x{4F76}\x{4F7B}\x{4F7C}\x{4F7F}' .
+'\x{4F83}\x{4F86}\x{4F88}\x{4F8B}\x{4F8D}\x{4F8F}\x{4F91}\x{4F96}\x{4F98}' .
+'\x{4F9B}\x{4F9D}\x{4FA0}\x{4FA1}\x{4FAB}\x{4FAD}\x{4FAE}\x{4FAF}\x{4FB5}' .
+'\x{4FB6}\x{4FBF}\x{4FC2}\x{4FC3}\x{4FC4}\x{4FCA}\x{4FCE}\x{4FD0}\x{4FD1}' .
+'\x{4FD4}\x{4FD7}\x{4FD8}\x{4FDA}\x{4FDB}\x{4FDD}\x{4FDF}\x{4FE1}\x{4FE3}' .
+'\x{4FE4}\x{4FE5}\x{4FEE}\x{4FEF}\x{4FF3}\x{4FF5}\x{4FF6}\x{4FF8}\x{4FFA}' .
+'\x{4FFE}\x{5005}\x{5006}\x{5009}\x{500B}\x{500D}\x{500F}\x{5011}\x{5012}' .
+'\x{5014}\x{5016}\x{5019}\x{501A}\x{501F}\x{5021}\x{5023}\x{5024}\x{5025}' .
+'\x{5026}\x{5028}\x{5029}\x{502A}\x{502B}\x{502C}\x{502D}\x{5036}\x{5039}' .
+'\x{5043}\x{5047}\x{5048}\x{5049}\x{504F}\x{5050}\x{5055}\x{5056}\x{505A}' .
+'\x{505C}\x{5065}\x{506C}\x{5072}\x{5074}\x{5075}\x{5076}\x{5078}\x{507D}' .
+'\x{5080}\x{5085}\x{508D}\x{5091}\x{5098}\x{5099}\x{509A}\x{50AC}\x{50AD}' .
+'\x{50B2}\x{50B3}\x{50B4}\x{50B5}\x{50B7}\x{50BE}\x{50C2}\x{50C5}\x{50C9}' .
+'\x{50CA}\x{50CD}\x{50CF}\x{50D1}\x{50D5}\x{50D6}\x{50DA}\x{50DE}\x{50E3}' .
+'\x{50E5}\x{50E7}\x{50ED}\x{50EE}\x{50F5}\x{50F9}\x{50FB}\x{5100}\x{5101}' .
+'\x{5102}\x{5104}\x{5109}\x{5112}\x{5114}\x{5115}\x{5116}\x{5118}\x{511A}' .
+'\x{511F}\x{5121}\x{512A}\x{5132}\x{5137}\x{513A}\x{513B}\x{513C}\x{513F}' .
+'\x{5140}\x{5141}\x{5143}\x{5144}\x{5145}\x{5146}\x{5147}\x{5148}\x{5149}' .
+'\x{514B}\x{514C}\x{514D}\x{514E}\x{5150}\x{5152}\x{5154}\x{515A}\x{515C}' .
+'\x{5162}\x{5165}\x{5168}\x{5169}\x{516A}\x{516B}\x{516C}\x{516D}\x{516E}' .
+'\x{5171}\x{5175}\x{5176}\x{5177}\x{5178}\x{517C}\x{5180}\x{5182}\x{5185}' .
+'\x{5186}\x{5189}\x{518A}\x{518C}\x{518D}\x{518F}\x{5190}\x{5191}\x{5192}' .
+'\x{5193}\x{5195}\x{5196}\x{5197}\x{5199}\x{51A0}\x{51A2}\x{51A4}\x{51A5}' .
+'\x{51A6}\x{51A8}\x{51A9}\x{51AA}\x{51AB}\x{51AC}\x{51B0}\x{51B1}\x{51B2}' .
+'\x{51B3}\x{51B4}\x{51B5}\x{51B6}\x{51B7}\x{51BD}\x{51C4}\x{51C5}\x{51C6}' .
+'\x{51C9}\x{51CB}\x{51CC}\x{51CD}\x{51D6}\x{51DB}\x{51DC}\x{51DD}\x{51E0}' .
+'\x{51E1}\x{51E6}\x{51E7}\x{51E9}\x{51EA}\x{51ED}\x{51F0}\x{51F1}\x{51F5}' .
+'\x{51F6}\x{51F8}\x{51F9}\x{51FA}\x{51FD}\x{51FE}\x{5200}\x{5203}\x{5204}' .
+'\x{5206}\x{5207}\x{5208}\x{520A}\x{520B}\x{520E}\x{5211}\x{5214}\x{5217}' .
+'\x{521D}\x{5224}\x{5225}\x{5227}\x{5229}\x{522A}\x{522E}\x{5230}\x{5233}' .
+'\x{5236}\x{5237}\x{5238}\x{5239}\x{523A}\x{523B}\x{5243}\x{5244}\x{5247}' .
+'\x{524A}\x{524B}\x{524C}\x{524D}\x{524F}\x{5254}\x{5256}\x{525B}\x{525E}' .
+'\x{5263}\x{5264}\x{5265}\x{5269}\x{526A}\x{526F}\x{5270}\x{5271}\x{5272}' .
+'\x{5273}\x{5274}\x{5275}\x{527D}\x{527F}\x{5283}\x{5287}\x{5288}\x{5289}' .
+'\x{528D}\x{5291}\x{5292}\x{5294}\x{529B}\x{529F}\x{52A0}\x{52A3}\x{52A9}' .
+'\x{52AA}\x{52AB}\x{52AC}\x{52AD}\x{52B1}\x{52B4}\x{52B5}\x{52B9}\x{52BC}' .
+'\x{52BE}\x{52C1}\x{52C3}\x{52C5}\x{52C7}\x{52C9}\x{52CD}\x{52D2}\x{52D5}' .
+'\x{52D7}\x{52D8}\x{52D9}\x{52DD}\x{52DE}\x{52DF}\x{52E0}\x{52E2}\x{52E3}' .
+'\x{52E4}\x{52E6}\x{52E7}\x{52F2}\x{52F3}\x{52F5}\x{52F8}\x{52F9}\x{52FA}' .
+'\x{52FE}\x{52FF}\x{5301}\x{5302}\x{5305}\x{5306}\x{5308}\x{530D}\x{530F}' .
+'\x{5310}\x{5315}\x{5316}\x{5317}\x{5319}\x{531A}\x{531D}\x{5320}\x{5321}' .
+'\x{5323}\x{532A}\x{532F}\x{5331}\x{5333}\x{5338}\x{5339}\x{533A}\x{533B}' .
+'\x{533F}\x{5340}\x{5341}\x{5343}\x{5345}\x{5346}\x{5347}\x{5348}\x{5349}' .
+'\x{534A}\x{534D}\x{5351}\x{5352}\x{5353}\x{5354}\x{5357}\x{5358}\x{535A}' .
+'\x{535C}\x{535E}\x{5360}\x{5366}\x{5369}\x{536E}\x{536F}\x{5370}\x{5371}' .
+'\x{5373}\x{5374}\x{5375}\x{5377}\x{5378}\x{537B}\x{537F}\x{5382}\x{5384}' .
+'\x{5396}\x{5398}\x{539A}\x{539F}\x{53A0}\x{53A5}\x{53A6}\x{53A8}\x{53A9}' .
+'\x{53AD}\x{53AE}\x{53B0}\x{53B3}\x{53B6}\x{53BB}\x{53C2}\x{53C3}\x{53C8}' .
+'\x{53C9}\x{53CA}\x{53CB}\x{53CC}\x{53CD}\x{53CE}\x{53D4}\x{53D6}\x{53D7}' .
+'\x{53D9}\x{53DB}\x{53DF}\x{53E1}\x{53E2}\x{53E3}\x{53E4}\x{53E5}\x{53E8}' .
+'\x{53E9}\x{53EA}\x{53EB}\x{53EC}\x{53ED}\x{53EE}\x{53EF}\x{53F0}\x{53F1}' .
+'\x{53F2}\x{53F3}\x{53F6}\x{53F7}\x{53F8}\x{53FA}\x{5401}\x{5403}\x{5404}' .
+'\x{5408}\x{5409}\x{540A}\x{540B}\x{540C}\x{540D}\x{540E}\x{540F}\x{5410}' .
+'\x{5411}\x{541B}\x{541D}\x{541F}\x{5420}\x{5426}\x{5429}\x{542B}\x{542C}' .
+'\x{542D}\x{542E}\x{5436}\x{5438}\x{5439}\x{543B}\x{543C}\x{543D}\x{543E}' .
+'\x{5440}\x{5442}\x{5446}\x{5448}\x{5449}\x{544A}\x{544E}\x{5451}\x{545F}' .
+'\x{5468}\x{546A}\x{5470}\x{5471}\x{5473}\x{5475}\x{5476}\x{5477}\x{547B}' .
+'\x{547C}\x{547D}\x{5480}\x{5484}\x{5486}\x{548B}\x{548C}\x{548E}\x{548F}' .
+'\x{5490}\x{5492}\x{54A2}\x{54A4}\x{54A5}\x{54A8}\x{54AB}\x{54AC}\x{54AF}' .
+'\x{54B2}\x{54B3}\x{54B8}\x{54BC}\x{54BD}\x{54BE}\x{54C0}\x{54C1}\x{54C2}' .
+'\x{54C4}\x{54C7}\x{54C8}\x{54C9}\x{54D8}\x{54E1}\x{54E2}\x{54E5}\x{54E6}' .
+'\x{54E8}\x{54E9}\x{54ED}\x{54EE}\x{54F2}\x{54FA}\x{54FD}\x{5504}\x{5506}' .
+'\x{5507}\x{550F}\x{5510}\x{5514}\x{5516}\x{552E}\x{552F}\x{5531}\x{5533}' .
+'\x{5538}\x{5539}\x{553E}\x{5540}\x{5544}\x{5545}\x{5546}\x{554C}\x{554F}' .
+'\x{5553}\x{5556}\x{5557}\x{555C}\x{555D}\x{5563}\x{557B}\x{557C}\x{557E}' .
+'\x{5580}\x{5583}\x{5584}\x{5587}\x{5589}\x{558A}\x{558B}\x{5598}\x{5599}' .
+'\x{559A}\x{559C}\x{559D}\x{559E}\x{559F}\x{55A7}\x{55A8}\x{55A9}\x{55AA}' .
+'\x{55AB}\x{55AC}\x{55AE}\x{55B0}\x{55B6}\x{55C4}\x{55C5}\x{55C7}\x{55D4}' .
+'\x{55DA}\x{55DC}\x{55DF}\x{55E3}\x{55E4}\x{55F7}\x{55F9}\x{55FD}\x{55FE}' .
+'\x{5606}\x{5609}\x{5614}\x{5616}\x{5617}\x{5618}\x{561B}\x{5629}\x{562F}' .
+'\x{5631}\x{5632}\x{5634}\x{5636}\x{5638}\x{5642}\x{564C}\x{564E}\x{5650}' .
+'\x{565B}\x{5664}\x{5668}\x{566A}\x{566B}\x{566C}\x{5674}\x{5678}\x{567A}' .
+'\x{5680}\x{5686}\x{5687}\x{568A}\x{568F}\x{5694}\x{56A0}\x{56A2}\x{56A5}' .
+'\x{56AE}\x{56B4}\x{56B6}\x{56BC}\x{56C0}\x{56C1}\x{56C2}\x{56C3}\x{56C8}' .
+'\x{56CE}\x{56D1}\x{56D3}\x{56D7}\x{56D8}\x{56DA}\x{56DB}\x{56DE}\x{56E0}' .
+'\x{56E3}\x{56EE}\x{56F0}\x{56F2}\x{56F3}\x{56F9}\x{56FA}\x{56FD}\x{56FF}' .
+'\x{5700}\x{5703}\x{5704}\x{5708}\x{5709}\x{570B}\x{570D}\x{570F}\x{5712}' .
+'\x{5713}\x{5716}\x{5718}\x{571C}\x{571F}\x{5726}\x{5727}\x{5728}\x{572D}' .
+'\x{5730}\x{5737}\x{5738}\x{573B}\x{5740}\x{5742}\x{5747}\x{574A}\x{574E}' .
+'\x{574F}\x{5750}\x{5751}\x{5761}\x{5764}\x{5766}\x{5769}\x{576A}\x{577F}' .
+'\x{5782}\x{5788}\x{5789}\x{578B}\x{5793}\x{57A0}\x{57A2}\x{57A3}\x{57A4}' .
+'\x{57AA}\x{57B0}\x{57B3}\x{57C0}\x{57C3}\x{57C6}\x{57CB}\x{57CE}\x{57D2}' .
+'\x{57D3}\x{57D4}\x{57D6}\x{57DC}\x{57DF}\x{57E0}\x{57E3}\x{57F4}\x{57F7}' .
+'\x{57F9}\x{57FA}\x{57FC}\x{5800}\x{5802}\x{5805}\x{5806}\x{580A}\x{580B}' .
+'\x{5815}\x{5819}\x{581D}\x{5821}\x{5824}\x{582A}\x{582F}\x{5830}\x{5831}' .
+'\x{5834}\x{5835}\x{583A}\x{583D}\x{5840}\x{5841}\x{584A}\x{584B}\x{5851}' .
+'\x{5852}\x{5854}\x{5857}\x{5858}\x{5859}\x{585A}\x{585E}\x{5862}\x{5869}' .
+'\x{586B}\x{5870}\x{5872}\x{5875}\x{5879}\x{587E}\x{5883}\x{5885}\x{5893}' .
+'\x{5897}\x{589C}\x{589F}\x{58A8}\x{58AB}\x{58AE}\x{58B3}\x{58B8}\x{58B9}' .
+'\x{58BA}\x{58BB}\x{58BE}\x{58C1}\x{58C5}\x{58C7}\x{58CA}\x{58CC}\x{58D1}' .
+'\x{58D3}\x{58D5}\x{58D7}\x{58D8}\x{58D9}\x{58DC}\x{58DE}\x{58DF}\x{58E4}' .
+'\x{58E5}\x{58EB}\x{58EC}\x{58EE}\x{58EF}\x{58F0}\x{58F1}\x{58F2}\x{58F7}' .
+'\x{58F9}\x{58FA}\x{58FB}\x{58FC}\x{58FD}\x{5902}\x{5909}\x{590A}\x{590F}' .
+'\x{5910}\x{5915}\x{5916}\x{5918}\x{5919}\x{591A}\x{591B}\x{591C}\x{5922}' .
+'\x{5925}\x{5927}\x{5929}\x{592A}\x{592B}\x{592C}\x{592D}\x{592E}\x{5931}' .
+'\x{5932}\x{5937}\x{5938}\x{593E}\x{5944}\x{5947}\x{5948}\x{5949}\x{594E}' .
+'\x{594F}\x{5950}\x{5951}\x{5954}\x{5955}\x{5957}\x{5958}\x{595A}\x{5960}' .
+'\x{5962}\x{5965}\x{5967}\x{5968}\x{5969}\x{596A}\x{596C}\x{596E}\x{5973}' .
+'\x{5974}\x{5978}\x{597D}\x{5981}\x{5982}\x{5983}\x{5984}\x{598A}\x{598D}' .
+'\x{5993}\x{5996}\x{5999}\x{599B}\x{599D}\x{59A3}\x{59A5}\x{59A8}\x{59AC}' .
+'\x{59B2}\x{59B9}\x{59BB}\x{59BE}\x{59C6}\x{59C9}\x{59CB}\x{59D0}\x{59D1}' .
+'\x{59D3}\x{59D4}\x{59D9}\x{59DA}\x{59DC}\x{59E5}\x{59E6}\x{59E8}\x{59EA}' .
+'\x{59EB}\x{59F6}\x{59FB}\x{59FF}\x{5A01}\x{5A03}\x{5A09}\x{5A11}\x{5A18}' .
+'\x{5A1A}\x{5A1C}\x{5A1F}\x{5A20}\x{5A25}\x{5A29}\x{5A2F}\x{5A35}\x{5A36}' .
+'\x{5A3C}\x{5A40}\x{5A41}\x{5A46}\x{5A49}\x{5A5A}\x{5A62}\x{5A66}\x{5A6A}' .
+'\x{5A6C}\x{5A7F}\x{5A92}\x{5A9A}\x{5A9B}\x{5ABC}\x{5ABD}\x{5ABE}\x{5AC1}' .
+'\x{5AC2}\x{5AC9}\x{5ACB}\x{5ACC}\x{5AD0}\x{5AD6}\x{5AD7}\x{5AE1}\x{5AE3}' .
+'\x{5AE6}\x{5AE9}\x{5AFA}\x{5AFB}\x{5B09}\x{5B0B}\x{5B0C}\x{5B16}\x{5B22}' .
+'\x{5B2A}\x{5B2C}\x{5B30}\x{5B32}\x{5B36}\x{5B3E}\x{5B40}\x{5B43}\x{5B45}' .
+'\x{5B50}\x{5B51}\x{5B54}\x{5B55}\x{5B57}\x{5B58}\x{5B5A}\x{5B5B}\x{5B5C}' .
+'\x{5B5D}\x{5B5F}\x{5B63}\x{5B64}\x{5B65}\x{5B66}\x{5B69}\x{5B6B}\x{5B70}' .
+'\x{5B71}\x{5B73}\x{5B75}\x{5B78}\x{5B7A}\x{5B80}\x{5B83}\x{5B85}\x{5B87}' .
+'\x{5B88}\x{5B89}\x{5B8B}\x{5B8C}\x{5B8D}\x{5B8F}\x{5B95}\x{5B97}\x{5B98}' .
+'\x{5B99}\x{5B9A}\x{5B9B}\x{5B9C}\x{5B9D}\x{5B9F}\x{5BA2}\x{5BA3}\x{5BA4}' .
+'\x{5BA5}\x{5BA6}\x{5BAE}\x{5BB0}\x{5BB3}\x{5BB4}\x{5BB5}\x{5BB6}\x{5BB8}' .
+'\x{5BB9}\x{5BBF}\x{5BC2}\x{5BC3}\x{5BC4}\x{5BC5}\x{5BC6}\x{5BC7}\x{5BC9}' .
+'\x{5BCC}\x{5BD0}\x{5BD2}\x{5BD3}\x{5BD4}\x{5BDB}\x{5BDD}\x{5BDE}\x{5BDF}' .
+'\x{5BE1}\x{5BE2}\x{5BE4}\x{5BE5}\x{5BE6}\x{5BE7}\x{5BE8}\x{5BE9}\x{5BEB}' .
+'\x{5BEE}\x{5BF0}\x{5BF3}\x{5BF5}\x{5BF6}\x{5BF8}\x{5BFA}\x{5BFE}\x{5BFF}' .
+'\x{5C01}\x{5C02}\x{5C04}\x{5C05}\x{5C06}\x{5C07}\x{5C08}\x{5C09}\x{5C0A}' .
+'\x{5C0B}\x{5C0D}\x{5C0E}\x{5C0F}\x{5C11}\x{5C13}\x{5C16}\x{5C1A}\x{5C20}' .
+'\x{5C22}\x{5C24}\x{5C28}\x{5C2D}\x{5C31}\x{5C38}\x{5C39}\x{5C3A}\x{5C3B}' .
+'\x{5C3C}\x{5C3D}\x{5C3E}\x{5C3F}\x{5C40}\x{5C41}\x{5C45}\x{5C46}\x{5C48}' .
+'\x{5C4A}\x{5C4B}\x{5C4D}\x{5C4E}\x{5C4F}\x{5C50}\x{5C51}\x{5C53}\x{5C55}' .
+'\x{5C5E}\x{5C60}\x{5C61}\x{5C64}\x{5C65}\x{5C6C}\x{5C6E}\x{5C6F}\x{5C71}' .
+'\x{5C76}\x{5C79}\x{5C8C}\x{5C90}\x{5C91}\x{5C94}\x{5CA1}\x{5CA8}\x{5CA9}' .
+'\x{5CAB}\x{5CAC}\x{5CB1}\x{5CB3}\x{5CB6}\x{5CB7}\x{5CB8}\x{5CBB}\x{5CBC}' .
+'\x{5CBE}\x{5CC5}\x{5CC7}\x{5CD9}\x{5CE0}\x{5CE1}\x{5CE8}\x{5CE9}\x{5CEA}' .
+'\x{5CED}\x{5CEF}\x{5CF0}\x{5CF6}\x{5CFA}\x{5CFB}\x{5CFD}\x{5D07}\x{5D0B}' .
+'\x{5D0E}\x{5D11}\x{5D14}\x{5D15}\x{5D16}\x{5D17}\x{5D18}\x{5D19}\x{5D1A}' .
+'\x{5D1B}\x{5D1F}\x{5D22}\x{5D29}\x{5D4B}\x{5D4C}\x{5D4E}\x{5D50}\x{5D52}' .
+'\x{5D5C}\x{5D69}\x{5D6C}\x{5D6F}\x{5D73}\x{5D76}\x{5D82}\x{5D84}\x{5D87}' .
+'\x{5D8B}\x{5D8C}\x{5D90}\x{5D9D}\x{5DA2}\x{5DAC}\x{5DAE}\x{5DB7}\x{5DBA}' .
+'\x{5DBC}\x{5DBD}\x{5DC9}\x{5DCC}\x{5DCD}\x{5DD2}\x{5DD3}\x{5DD6}\x{5DDB}' .
+'\x{5DDD}\x{5DDE}\x{5DE1}\x{5DE3}\x{5DE5}\x{5DE6}\x{5DE7}\x{5DE8}\x{5DEB}' .
+'\x{5DEE}\x{5DF1}\x{5DF2}\x{5DF3}\x{5DF4}\x{5DF5}\x{5DF7}\x{5DFB}\x{5DFD}' .
+'\x{5DFE}\x{5E02}\x{5E03}\x{5E06}\x{5E0B}\x{5E0C}\x{5E11}\x{5E16}\x{5E19}' .
+'\x{5E1A}\x{5E1B}\x{5E1D}\x{5E25}\x{5E2B}\x{5E2D}\x{5E2F}\x{5E30}\x{5E33}' .
+'\x{5E36}\x{5E37}\x{5E38}\x{5E3D}\x{5E40}\x{5E43}\x{5E44}\x{5E45}\x{5E47}' .
+'\x{5E4C}\x{5E4E}\x{5E54}\x{5E55}\x{5E57}\x{5E5F}\x{5E61}\x{5E62}\x{5E63}' .
+'\x{5E64}\x{5E72}\x{5E73}\x{5E74}\x{5E75}\x{5E76}\x{5E78}\x{5E79}\x{5E7A}' .
+'\x{5E7B}\x{5E7C}\x{5E7D}\x{5E7E}\x{5E7F}\x{5E81}\x{5E83}\x{5E84}\x{5E87}' .
+'\x{5E8A}\x{5E8F}\x{5E95}\x{5E96}\x{5E97}\x{5E9A}\x{5E9C}\x{5EA0}\x{5EA6}' .
+'\x{5EA7}\x{5EAB}\x{5EAD}\x{5EB5}\x{5EB6}\x{5EB7}\x{5EB8}\x{5EC1}\x{5EC2}' .
+'\x{5EC3}\x{5EC8}\x{5EC9}\x{5ECA}\x{5ECF}\x{5ED0}\x{5ED3}\x{5ED6}\x{5EDA}' .
+'\x{5EDB}\x{5EDD}\x{5EDF}\x{5EE0}\x{5EE1}\x{5EE2}\x{5EE3}\x{5EE8}\x{5EE9}' .
+'\x{5EEC}\x{5EF0}\x{5EF1}\x{5EF3}\x{5EF4}\x{5EF6}\x{5EF7}\x{5EF8}\x{5EFA}' .
+'\x{5EFB}\x{5EFC}\x{5EFE}\x{5EFF}\x{5F01}\x{5F03}\x{5F04}\x{5F09}\x{5F0A}' .
+'\x{5F0B}\x{5F0C}\x{5F0D}\x{5F0F}\x{5F10}\x{5F11}\x{5F13}\x{5F14}\x{5F15}' .
+'\x{5F16}\x{5F17}\x{5F18}\x{5F1B}\x{5F1F}\x{5F25}\x{5F26}\x{5F27}\x{5F29}' .
+'\x{5F2D}\x{5F2F}\x{5F31}\x{5F35}\x{5F37}\x{5F38}\x{5F3C}\x{5F3E}\x{5F41}' .
+'\x{5F48}\x{5F4A}\x{5F4C}\x{5F4E}\x{5F51}\x{5F53}\x{5F56}\x{5F57}\x{5F59}' .
+'\x{5F5C}\x{5F5D}\x{5F61}\x{5F62}\x{5F66}\x{5F69}\x{5F6A}\x{5F6B}\x{5F6C}' .
+'\x{5F6D}\x{5F70}\x{5F71}\x{5F73}\x{5F77}\x{5F79}\x{5F7C}\x{5F7F}\x{5F80}' .
+'\x{5F81}\x{5F82}\x{5F83}\x{5F84}\x{5F85}\x{5F87}\x{5F88}\x{5F8A}\x{5F8B}' .
+'\x{5F8C}\x{5F90}\x{5F91}\x{5F92}\x{5F93}\x{5F97}\x{5F98}\x{5F99}\x{5F9E}' .
+'\x{5FA0}\x{5FA1}\x{5FA8}\x{5FA9}\x{5FAA}\x{5FAD}\x{5FAE}\x{5FB3}\x{5FB4}' .
+'\x{5FB9}\x{5FBC}\x{5FBD}\x{5FC3}\x{5FC5}\x{5FCC}\x{5FCD}\x{5FD6}\x{5FD7}' .
+'\x{5FD8}\x{5FD9}\x{5FDC}\x{5FDD}\x{5FE0}\x{5FE4}\x{5FEB}\x{5FF0}\x{5FF1}' .
+'\x{5FF5}\x{5FF8}\x{5FFB}\x{5FFD}\x{5FFF}\x{600E}\x{600F}\x{6010}\x{6012}' .
+'\x{6015}\x{6016}\x{6019}\x{601B}\x{601C}\x{601D}\x{6020}\x{6021}\x{6025}' .
+'\x{6026}\x{6027}\x{6028}\x{6029}\x{602A}\x{602B}\x{602F}\x{6031}\x{603A}' .
+'\x{6041}\x{6042}\x{6043}\x{6046}\x{604A}\x{604B}\x{604D}\x{6050}\x{6052}' .
+'\x{6055}\x{6059}\x{605A}\x{605F}\x{6060}\x{6062}\x{6063}\x{6064}\x{6065}' .
+'\x{6068}\x{6069}\x{606A}\x{606B}\x{606C}\x{606D}\x{606F}\x{6070}\x{6075}' .
+'\x{6077}\x{6081}\x{6083}\x{6084}\x{6089}\x{608B}\x{608C}\x{608D}\x{6092}' .
+'\x{6094}\x{6096}\x{6097}\x{609A}\x{609B}\x{609F}\x{60A0}\x{60A3}\x{60A6}' .
+'\x{60A7}\x{60A9}\x{60AA}\x{60B2}\x{60B3}\x{60B4}\x{60B5}\x{60B6}\x{60B8}' .
+'\x{60BC}\x{60BD}\x{60C5}\x{60C6}\x{60C7}\x{60D1}\x{60D3}\x{60D8}\x{60DA}' .
+'\x{60DC}\x{60DF}\x{60E0}\x{60E1}\x{60E3}\x{60E7}\x{60E8}\x{60F0}\x{60F1}' .
+'\x{60F3}\x{60F4}\x{60F6}\x{60F7}\x{60F9}\x{60FA}\x{60FB}\x{6100}\x{6101}' .
+'\x{6103}\x{6106}\x{6108}\x{6109}\x{610D}\x{610E}\x{610F}\x{6115}\x{611A}' .
+'\x{611B}\x{611F}\x{6121}\x{6127}\x{6128}\x{612C}\x{6134}\x{613C}\x{613D}' .
+'\x{613E}\x{613F}\x{6142}\x{6144}\x{6147}\x{6148}\x{614A}\x{614B}\x{614C}' .
+'\x{614D}\x{614E}\x{6153}\x{6155}\x{6158}\x{6159}\x{615A}\x{615D}\x{615F}' .
+'\x{6162}\x{6163}\x{6165}\x{6167}\x{6168}\x{616B}\x{616E}\x{616F}\x{6170}' .
+'\x{6171}\x{6173}\x{6174}\x{6175}\x{6176}\x{6177}\x{617E}\x{6182}\x{6187}' .
+'\x{618A}\x{618E}\x{6190}\x{6191}\x{6194}\x{6196}\x{6199}\x{619A}\x{61A4}' .
+'\x{61A7}\x{61A9}\x{61AB}\x{61AC}\x{61AE}\x{61B2}\x{61B6}\x{61BA}\x{61BE}' .
+'\x{61C3}\x{61C6}\x{61C7}\x{61C8}\x{61C9}\x{61CA}\x{61CB}\x{61CC}\x{61CD}' .
+'\x{61D0}\x{61E3}\x{61E6}\x{61F2}\x{61F4}\x{61F6}\x{61F7}\x{61F8}\x{61FA}' .
+'\x{61FC}\x{61FD}\x{61FE}\x{61FF}\x{6200}\x{6208}\x{6209}\x{620A}\x{620C}' .
+'\x{620D}\x{620E}\x{6210}\x{6211}\x{6212}\x{6214}\x{6216}\x{621A}\x{621B}' .
+'\x{621D}\x{621E}\x{621F}\x{6221}\x{6226}\x{622A}\x{622E}\x{622F}\x{6230}' .
+'\x{6232}\x{6233}\x{6234}\x{6238}\x{623B}\x{623F}\x{6240}\x{6241}\x{6247}' .
+'\x{6248}\x{6249}\x{624B}\x{624D}\x{624E}\x{6253}\x{6255}\x{6258}\x{625B}' .
+'\x{625E}\x{6260}\x{6263}\x{6268}\x{626E}\x{6271}\x{6276}\x{6279}\x{627C}' .
+'\x{627E}\x{627F}\x{6280}\x{6282}\x{6283}\x{6284}\x{6289}\x{628A}\x{6291}' .
+'\x{6292}\x{6293}\x{6294}\x{6295}\x{6296}\x{6297}\x{6298}\x{629B}\x{629C}' .
+'\x{629E}\x{62AB}\x{62AC}\x{62B1}\x{62B5}\x{62B9}\x{62BB}\x{62BC}\x{62BD}' .
+'\x{62C2}\x{62C5}\x{62C6}\x{62C7}\x{62C8}\x{62C9}\x{62CA}\x{62CC}\x{62CD}' .
+'\x{62CF}\x{62D0}\x{62D1}\x{62D2}\x{62D3}\x{62D4}\x{62D7}\x{62D8}\x{62D9}' .
+'\x{62DB}\x{62DC}\x{62DD}\x{62E0}\x{62E1}\x{62EC}\x{62ED}\x{62EE}\x{62EF}' .
+'\x{62F1}\x{62F3}\x{62F5}\x{62F6}\x{62F7}\x{62FE}\x{62FF}\x{6301}\x{6302}' .
+'\x{6307}\x{6308}\x{6309}\x{630C}\x{6311}\x{6319}\x{631F}\x{6327}\x{6328}' .
+'\x{632B}\x{632F}\x{633A}\x{633D}\x{633E}\x{633F}\x{6349}\x{634C}\x{634D}' .
+'\x{634F}\x{6350}\x{6355}\x{6357}\x{635C}\x{6367}\x{6368}\x{6369}\x{636B}' .
+'\x{636E}\x{6372}\x{6376}\x{6377}\x{637A}\x{637B}\x{6380}\x{6383}\x{6388}' .
+'\x{6389}\x{638C}\x{638E}\x{638F}\x{6392}\x{6396}\x{6398}\x{639B}\x{639F}' .
+'\x{63A0}\x{63A1}\x{63A2}\x{63A3}\x{63A5}\x{63A7}\x{63A8}\x{63A9}\x{63AA}' .
+'\x{63AB}\x{63AC}\x{63B2}\x{63B4}\x{63B5}\x{63BB}\x{63BE}\x{63C0}\x{63C3}' .
+'\x{63C4}\x{63C6}\x{63C9}\x{63CF}\x{63D0}\x{63D2}\x{63D6}\x{63DA}\x{63DB}' .
+'\x{63E1}\x{63E3}\x{63E9}\x{63EE}\x{63F4}\x{63F6}\x{63FA}\x{6406}\x{640D}' .
+'\x{640F}\x{6413}\x{6416}\x{6417}\x{641C}\x{6426}\x{6428}\x{642C}\x{642D}' .
+'\x{6434}\x{6436}\x{643A}\x{643E}\x{6442}\x{644E}\x{6458}\x{6467}\x{6469}' .
+'\x{646F}\x{6476}\x{6478}\x{647A}\x{6483}\x{6488}\x{6492}\x{6493}\x{6495}' .
+'\x{649A}\x{649E}\x{64A4}\x{64A5}\x{64A9}\x{64AB}\x{64AD}\x{64AE}\x{64B0}' .
+'\x{64B2}\x{64B9}\x{64BB}\x{64BC}\x{64C1}\x{64C2}\x{64C5}\x{64C7}\x{64CD}' .
+'\x{64D2}\x{64D4}\x{64D8}\x{64DA}\x{64E0}\x{64E1}\x{64E2}\x{64E3}\x{64E6}' .
+'\x{64E7}\x{64EC}\x{64EF}\x{64F1}\x{64F2}\x{64F4}\x{64F6}\x{64FA}\x{64FD}' .
+'\x{64FE}\x{6500}\x{6505}\x{6518}\x{651C}\x{651D}\x{6523}\x{6524}\x{652A}' .
+'\x{652B}\x{652C}\x{652F}\x{6534}\x{6535}\x{6536}\x{6537}\x{6538}\x{6539}' .
+'\x{653B}\x{653E}\x{653F}\x{6545}\x{6548}\x{654D}\x{654F}\x{6551}\x{6555}' .
+'\x{6556}\x{6557}\x{6558}\x{6559}\x{655D}\x{655E}\x{6562}\x{6563}\x{6566}' .
+'\x{656C}\x{6570}\x{6572}\x{6574}\x{6575}\x{6577}\x{6578}\x{6582}\x{6583}' .
+'\x{6587}\x{6588}\x{6589}\x{658C}\x{658E}\x{6590}\x{6591}\x{6597}\x{6599}' .
+'\x{659B}\x{659C}\x{659F}\x{65A1}\x{65A4}\x{65A5}\x{65A7}\x{65AB}\x{65AC}' .
+'\x{65AD}\x{65AF}\x{65B0}\x{65B7}\x{65B9}\x{65BC}\x{65BD}\x{65C1}\x{65C3}' .
+'\x{65C4}\x{65C5}\x{65C6}\x{65CB}\x{65CC}\x{65CF}\x{65D2}\x{65D7}\x{65D9}' .
+'\x{65DB}\x{65E0}\x{65E1}\x{65E2}\x{65E5}\x{65E6}\x{65E7}\x{65E8}\x{65E9}' .
+'\x{65EC}\x{65ED}\x{65F1}\x{65FA}\x{65FB}\x{6602}\x{6603}\x{6606}\x{6607}' .
+'\x{660A}\x{660C}\x{660E}\x{660F}\x{6613}\x{6614}\x{661C}\x{661F}\x{6620}' .
+'\x{6625}\x{6627}\x{6628}\x{662D}\x{662F}\x{6634}\x{6635}\x{6636}\x{663C}' .
+'\x{663F}\x{6641}\x{6642}\x{6643}\x{6644}\x{6649}\x{664B}\x{664F}\x{6652}' .
+'\x{665D}\x{665E}\x{665F}\x{6662}\x{6664}\x{6666}\x{6667}\x{6668}\x{6669}' .
+'\x{666E}\x{666F}\x{6670}\x{6674}\x{6676}\x{667A}\x{6681}\x{6683}\x{6684}' .
+'\x{6687}\x{6688}\x{6689}\x{668E}\x{6691}\x{6696}\x{6697}\x{6698}\x{669D}' .
+'\x{66A2}\x{66A6}\x{66AB}\x{66AE}\x{66B4}\x{66B8}\x{66B9}\x{66BC}\x{66BE}' .
+'\x{66C1}\x{66C4}\x{66C7}\x{66C9}\x{66D6}\x{66D9}\x{66DA}\x{66DC}\x{66DD}' .
+'\x{66E0}\x{66E6}\x{66E9}\x{66F0}\x{66F2}\x{66F3}\x{66F4}\x{66F5}\x{66F7}' .
+'\x{66F8}\x{66F9}\x{66FC}\x{66FD}\x{66FE}\x{66FF}\x{6700}\x{6703}\x{6708}' .
+'\x{6709}\x{670B}\x{670D}\x{670F}\x{6714}\x{6715}\x{6716}\x{6717}\x{671B}' .
+'\x{671D}\x{671E}\x{671F}\x{6726}\x{6727}\x{6728}\x{672A}\x{672B}\x{672C}' .
+'\x{672D}\x{672E}\x{6731}\x{6734}\x{6736}\x{6737}\x{6738}\x{673A}\x{673D}' .
+'\x{673F}\x{6741}\x{6746}\x{6749}\x{674E}\x{674F}\x{6750}\x{6751}\x{6753}' .
+'\x{6756}\x{6759}\x{675C}\x{675E}\x{675F}\x{6760}\x{6761}\x{6762}\x{6763}' .
+'\x{6764}\x{6765}\x{676A}\x{676D}\x{676F}\x{6770}\x{6771}\x{6772}\x{6773}' .
+'\x{6775}\x{6777}\x{677C}\x{677E}\x{677F}\x{6785}\x{6787}\x{6789}\x{678B}' .
+'\x{678C}\x{6790}\x{6795}\x{6797}\x{679A}\x{679C}\x{679D}\x{67A0}\x{67A1}' .
+'\x{67A2}\x{67A6}\x{67A9}\x{67AF}\x{67B3}\x{67B4}\x{67B6}\x{67B7}\x{67B8}' .
+'\x{67B9}\x{67C1}\x{67C4}\x{67C6}\x{67CA}\x{67CE}\x{67CF}\x{67D0}\x{67D1}' .
+'\x{67D3}\x{67D4}\x{67D8}\x{67DA}\x{67DD}\x{67DE}\x{67E2}\x{67E4}\x{67E7}' .
+'\x{67E9}\x{67EC}\x{67EE}\x{67EF}\x{67F1}\x{67F3}\x{67F4}\x{67F5}\x{67FB}' .
+'\x{67FE}\x{67FF}\x{6802}\x{6803}\x{6804}\x{6813}\x{6816}\x{6817}\x{681E}' .
+'\x{6821}\x{6822}\x{6829}\x{682A}\x{682B}\x{6832}\x{6834}\x{6838}\x{6839}' .
+'\x{683C}\x{683D}\x{6840}\x{6841}\x{6842}\x{6843}\x{6846}\x{6848}\x{684D}' .
+'\x{684E}\x{6850}\x{6851}\x{6853}\x{6854}\x{6859}\x{685C}\x{685D}\x{685F}' .
+'\x{6863}\x{6867}\x{6874}\x{6876}\x{6877}\x{687E}\x{687F}\x{6881}\x{6883}' .
+'\x{6885}\x{688D}\x{688F}\x{6893}\x{6894}\x{6897}\x{689B}\x{689D}\x{689F}' .
+'\x{68A0}\x{68A2}\x{68A6}\x{68A7}\x{68A8}\x{68AD}\x{68AF}\x{68B0}\x{68B1}' .
+'\x{68B3}\x{68B5}\x{68B6}\x{68B9}\x{68BA}\x{68BC}\x{68C4}\x{68C6}\x{68C9}' .
+'\x{68CA}\x{68CB}\x{68CD}\x{68D2}\x{68D4}\x{68D5}\x{68D7}\x{68D8}\x{68DA}' .
+'\x{68DF}\x{68E0}\x{68E1}\x{68E3}\x{68E7}\x{68EE}\x{68EF}\x{68F2}\x{68F9}' .
+'\x{68FA}\x{6900}\x{6901}\x{6904}\x{6905}\x{6908}\x{690B}\x{690C}\x{690D}' .
+'\x{690E}\x{690F}\x{6912}\x{6919}\x{691A}\x{691B}\x{691C}\x{6921}\x{6922}' .
+'\x{6923}\x{6925}\x{6926}\x{6928}\x{692A}\x{6930}\x{6934}\x{6936}\x{6939}' .
+'\x{693D}\x{693F}\x{694A}\x{6953}\x{6954}\x{6955}\x{6959}\x{695A}\x{695C}' .
+'\x{695D}\x{695E}\x{6960}\x{6961}\x{6962}\x{696A}\x{696B}\x{696D}\x{696E}' .
+'\x{696F}\x{6973}\x{6974}\x{6975}\x{6977}\x{6978}\x{6979}\x{697C}\x{697D}' .
+'\x{697E}\x{6981}\x{6982}\x{698A}\x{698E}\x{6991}\x{6994}\x{6995}\x{699B}' .
+'\x{699C}\x{69A0}\x{69A7}\x{69AE}\x{69B1}\x{69B2}\x{69B4}\x{69BB}\x{69BE}' .
+'\x{69BF}\x{69C1}\x{69C3}\x{69C7}\x{69CA}\x{69CB}\x{69CC}\x{69CD}\x{69CE}' .
+'\x{69D0}\x{69D3}\x{69D8}\x{69D9}\x{69DD}\x{69DE}\x{69E7}\x{69E8}\x{69EB}' .
+'\x{69ED}\x{69F2}\x{69F9}\x{69FB}\x{69FD}\x{69FF}\x{6A02}\x{6A05}\x{6A0A}' .
+'\x{6A0B}\x{6A0C}\x{6A12}\x{6A13}\x{6A14}\x{6A17}\x{6A19}\x{6A1B}\x{6A1E}' .
+'\x{6A1F}\x{6A21}\x{6A22}\x{6A23}\x{6A29}\x{6A2A}\x{6A2B}\x{6A2E}\x{6A35}' .
+'\x{6A36}\x{6A38}\x{6A39}\x{6A3A}\x{6A3D}\x{6A44}\x{6A47}\x{6A48}\x{6A4B}' .
+'\x{6A58}\x{6A59}\x{6A5F}\x{6A61}\x{6A62}\x{6A66}\x{6A72}\x{6A78}\x{6A7F}' .
+'\x{6A80}\x{6A84}\x{6A8D}\x{6A8E}\x{6A90}\x{6A97}\x{6A9C}\x{6AA0}\x{6AA2}' .
+'\x{6AA3}\x{6AAA}\x{6AAC}\x{6AAE}\x{6AB3}\x{6AB8}\x{6ABB}\x{6AC1}\x{6AC2}' .
+'\x{6AC3}\x{6AD1}\x{6AD3}\x{6ADA}\x{6ADB}\x{6ADE}\x{6ADF}\x{6AE8}\x{6AEA}' .
+'\x{6AFA}\x{6AFB}\x{6B04}\x{6B05}\x{6B0A}\x{6B12}\x{6B16}\x{6B1D}\x{6B1F}' .
+'\x{6B20}\x{6B21}\x{6B23}\x{6B27}\x{6B32}\x{6B37}\x{6B38}\x{6B39}\x{6B3A}' .
+'\x{6B3D}\x{6B3E}\x{6B43}\x{6B47}\x{6B49}\x{6B4C}\x{6B4E}\x{6B50}\x{6B53}' .
+'\x{6B54}\x{6B59}\x{6B5B}\x{6B5F}\x{6B61}\x{6B62}\x{6B63}\x{6B64}\x{6B66}' .
+'\x{6B69}\x{6B6A}\x{6B6F}\x{6B73}\x{6B74}\x{6B78}\x{6B79}\x{6B7B}\x{6B7F}' .
+'\x{6B80}\x{6B83}\x{6B84}\x{6B86}\x{6B89}\x{6B8A}\x{6B8B}\x{6B8D}\x{6B95}' .
+'\x{6B96}\x{6B98}\x{6B9E}\x{6BA4}\x{6BAA}\x{6BAB}\x{6BAF}\x{6BB1}\x{6BB2}' .
+'\x{6BB3}\x{6BB4}\x{6BB5}\x{6BB7}\x{6BBA}\x{6BBB}\x{6BBC}\x{6BBF}\x{6BC0}' .
+'\x{6BC5}\x{6BC6}\x{6BCB}\x{6BCD}\x{6BCE}\x{6BD2}\x{6BD3}\x{6BD4}\x{6BD8}' .
+'\x{6BDB}\x{6BDF}\x{6BEB}\x{6BEC}\x{6BEF}\x{6BF3}\x{6C08}\x{6C0F}\x{6C11}' .
+'\x{6C13}\x{6C14}\x{6C17}\x{6C1B}\x{6C23}\x{6C24}\x{6C34}\x{6C37}\x{6C38}' .
+'\x{6C3E}\x{6C40}\x{6C41}\x{6C42}\x{6C4E}\x{6C50}\x{6C55}\x{6C57}\x{6C5A}' .
+'\x{6C5D}\x{6C5E}\x{6C5F}\x{6C60}\x{6C62}\x{6C68}\x{6C6A}\x{6C70}\x{6C72}' .
+'\x{6C73}\x{6C7A}\x{6C7D}\x{6C7E}\x{6C81}\x{6C82}\x{6C83}\x{6C88}\x{6C8C}' .
+'\x{6C8D}\x{6C90}\x{6C92}\x{6C93}\x{6C96}\x{6C99}\x{6C9A}\x{6C9B}\x{6CA1}' .
+'\x{6CA2}\x{6CAB}\x{6CAE}\x{6CB1}\x{6CB3}\x{6CB8}\x{6CB9}\x{6CBA}\x{6CBB}' .
+'\x{6CBC}\x{6CBD}\x{6CBE}\x{6CBF}\x{6CC1}\x{6CC4}\x{6CC5}\x{6CC9}\x{6CCA}' .
+'\x{6CCC}\x{6CD3}\x{6CD5}\x{6CD7}\x{6CD9}\x{6CDB}\x{6CDD}\x{6CE1}\x{6CE2}' .
+'\x{6CE3}\x{6CE5}\x{6CE8}\x{6CEA}\x{6CEF}\x{6CF0}\x{6CF1}\x{6CF3}\x{6D0B}' .
+'\x{6D0C}\x{6D12}\x{6D17}\x{6D19}\x{6D1B}\x{6D1E}\x{6D1F}\x{6D25}\x{6D29}' .
+'\x{6D2A}\x{6D2B}\x{6D32}\x{6D33}\x{6D35}\x{6D36}\x{6D38}\x{6D3B}\x{6D3D}' .
+'\x{6D3E}\x{6D41}\x{6D44}\x{6D45}\x{6D59}\x{6D5A}\x{6D5C}\x{6D63}\x{6D64}' .
+'\x{6D66}\x{6D69}\x{6D6A}\x{6D6C}\x{6D6E}\x{6D74}\x{6D77}\x{6D78}\x{6D79}' .
+'\x{6D85}\x{6D88}\x{6D8C}\x{6D8E}\x{6D93}\x{6D95}\x{6D99}\x{6D9B}\x{6D9C}' .
+'\x{6DAF}\x{6DB2}\x{6DB5}\x{6DB8}\x{6DBC}\x{6DC0}\x{6DC5}\x{6DC6}\x{6DC7}' .
+'\x{6DCB}\x{6DCC}\x{6DD1}\x{6DD2}\x{6DD5}\x{6DD8}\x{6DD9}\x{6DDE}\x{6DE1}' .
+'\x{6DE4}\x{6DE6}\x{6DE8}\x{6DEA}\x{6DEB}\x{6DEC}\x{6DEE}\x{6DF1}\x{6DF3}' .
+'\x{6DF5}\x{6DF7}\x{6DF9}\x{6DFA}\x{6DFB}\x{6E05}\x{6E07}\x{6E08}\x{6E09}' .
+'\x{6E0A}\x{6E0B}\x{6E13}\x{6E15}\x{6E19}\x{6E1A}\x{6E1B}\x{6E1D}\x{6E1F}' .
+'\x{6E20}\x{6E21}\x{6E23}\x{6E24}\x{6E25}\x{6E26}\x{6E29}\x{6E2B}\x{6E2C}' .
+'\x{6E2D}\x{6E2E}\x{6E2F}\x{6E38}\x{6E3A}\x{6E3E}\x{6E43}\x{6E4A}\x{6E4D}' .
+'\x{6E4E}\x{6E56}\x{6E58}\x{6E5B}\x{6E5F}\x{6E67}\x{6E6B}\x{6E6E}\x{6E6F}' .
+'\x{6E72}\x{6E76}\x{6E7E}\x{6E7F}\x{6E80}\x{6E82}\x{6E8C}\x{6E8F}\x{6E90}' .
+'\x{6E96}\x{6E98}\x{6E9C}\x{6E9D}\x{6E9F}\x{6EA2}\x{6EA5}\x{6EAA}\x{6EAF}' .
+'\x{6EB2}\x{6EB6}\x{6EB7}\x{6EBA}\x{6EBD}\x{6EC2}\x{6EC4}\x{6EC5}\x{6EC9}' .
+'\x{6ECB}\x{6ECC}\x{6ED1}\x{6ED3}\x{6ED4}\x{6ED5}\x{6EDD}\x{6EDE}\x{6EEC}' .
+'\x{6EEF}\x{6EF2}\x{6EF4}\x{6EF7}\x{6EF8}\x{6EFE}\x{6EFF}\x{6F01}\x{6F02}' .
+'\x{6F06}\x{6F09}\x{6F0F}\x{6F11}\x{6F13}\x{6F14}\x{6F15}\x{6F20}\x{6F22}' .
+'\x{6F23}\x{6F2B}\x{6F2C}\x{6F31}\x{6F32}\x{6F38}\x{6F3E}\x{6F3F}\x{6F41}' .
+'\x{6F45}\x{6F54}\x{6F58}\x{6F5B}\x{6F5C}\x{6F5F}\x{6F64}\x{6F66}\x{6F6D}' .
+'\x{6F6E}\x{6F6F}\x{6F70}\x{6F74}\x{6F78}\x{6F7A}\x{6F7C}\x{6F80}\x{6F81}' .
+'\x{6F82}\x{6F84}\x{6F86}\x{6F8E}\x{6F91}\x{6F97}\x{6FA1}\x{6FA3}\x{6FA4}' .
+'\x{6FAA}\x{6FB1}\x{6FB3}\x{6FB9}\x{6FC0}\x{6FC1}\x{6FC2}\x{6FC3}\x{6FC6}' .
+'\x{6FD4}\x{6FD5}\x{6FD8}\x{6FDB}\x{6FDF}\x{6FE0}\x{6FE1}\x{6FE4}\x{6FEB}' .
+'\x{6FEC}\x{6FEE}\x{6FEF}\x{6FF1}\x{6FF3}\x{6FF6}\x{6FFA}\x{6FFE}\x{7001}' .
+'\x{7009}\x{700B}\x{700F}\x{7011}\x{7015}\x{7018}\x{701A}\x{701B}\x{701D}' .
+'\x{701E}\x{701F}\x{7026}\x{7027}\x{702C}\x{7030}\x{7032}\x{703E}\x{704C}' .
+'\x{7051}\x{7058}\x{7063}\x{706B}\x{706F}\x{7070}\x{7078}\x{707C}\x{707D}' .
+'\x{7089}\x{708A}\x{708E}\x{7092}\x{7099}\x{70AC}\x{70AD}\x{70AE}\x{70AF}' .
+'\x{70B3}\x{70B8}\x{70B9}\x{70BA}\x{70C8}\x{70CB}\x{70CF}\x{70D9}\x{70DD}' .
+'\x{70DF}\x{70F1}\x{70F9}\x{70FD}\x{7109}\x{7114}\x{7119}\x{711A}\x{711C}' .
+'\x{7121}\x{7126}\x{7136}\x{713C}\x{7149}\x{714C}\x{714E}\x{7155}\x{7156}' .
+'\x{7159}\x{7162}\x{7164}\x{7165}\x{7166}\x{7167}\x{7169}\x{716C}\x{716E}' .
+'\x{717D}\x{7184}\x{7188}\x{718A}\x{718F}\x{7194}\x{7195}\x{7199}\x{719F}' .
+'\x{71A8}\x{71AC}\x{71B1}\x{71B9}\x{71BE}\x{71C3}\x{71C8}\x{71C9}\x{71CE}' .
+'\x{71D0}\x{71D2}\x{71D4}\x{71D5}\x{71D7}\x{71DF}\x{71E0}\x{71E5}\x{71E6}' .
+'\x{71E7}\x{71EC}\x{71ED}\x{71EE}\x{71F5}\x{71F9}\x{71FB}\x{71FC}\x{71FF}' .
+'\x{7206}\x{720D}\x{7210}\x{721B}\x{7228}\x{722A}\x{722C}\x{722D}\x{7230}' .
+'\x{7232}\x{7235}\x{7236}\x{723A}\x{723B}\x{723C}\x{723D}\x{723E}\x{723F}' .
+'\x{7240}\x{7246}\x{7247}\x{7248}\x{724B}\x{724C}\x{7252}\x{7258}\x{7259}' .
+'\x{725B}\x{725D}\x{725F}\x{7261}\x{7262}\x{7267}\x{7269}\x{7272}\x{7274}' .
+'\x{7279}\x{727D}\x{727E}\x{7280}\x{7281}\x{7282}\x{7287}\x{7292}\x{7296}' .
+'\x{72A0}\x{72A2}\x{72A7}\x{72AC}\x{72AF}\x{72B2}\x{72B6}\x{72B9}\x{72C2}' .
+'\x{72C3}\x{72C4}\x{72C6}\x{72CE}\x{72D0}\x{72D2}\x{72D7}\x{72D9}\x{72DB}' .
+'\x{72E0}\x{72E1}\x{72E2}\x{72E9}\x{72EC}\x{72ED}\x{72F7}\x{72F8}\x{72F9}' .
+'\x{72FC}\x{72FD}\x{730A}\x{7316}\x{7317}\x{731B}\x{731C}\x{731D}\x{731F}' .
+'\x{7325}\x{7329}\x{732A}\x{732B}\x{732E}\x{732F}\x{7334}\x{7336}\x{7337}' .
+'\x{733E}\x{733F}\x{7344}\x{7345}\x{734E}\x{734F}\x{7357}\x{7363}\x{7368}' .
+'\x{736A}\x{7370}\x{7372}\x{7375}\x{7378}\x{737A}\x{737B}\x{7384}\x{7387}' .
+'\x{7389}\x{738B}\x{7396}\x{73A9}\x{73B2}\x{73B3}\x{73BB}\x{73C0}\x{73C2}' .
+'\x{73C8}\x{73CA}\x{73CD}\x{73CE}\x{73DE}\x{73E0}\x{73E5}\x{73EA}\x{73ED}' .
+'\x{73EE}\x{73F1}\x{73F8}\x{73FE}\x{7403}\x{7405}\x{7406}\x{7409}\x{7422}' .
+'\x{7425}\x{7432}\x{7433}\x{7434}\x{7435}\x{7436}\x{743A}\x{743F}\x{7441}' .
+'\x{7455}\x{7459}\x{745A}\x{745B}\x{745C}\x{745E}\x{745F}\x{7460}\x{7463}' .
+'\x{7464}\x{7469}\x{746A}\x{746F}\x{7470}\x{7473}\x{7476}\x{747E}\x{7483}' .
+'\x{748B}\x{749E}\x{74A2}\x{74A7}\x{74B0}\x{74BD}\x{74CA}\x{74CF}\x{74D4}' .
+'\x{74DC}\x{74E0}\x{74E2}\x{74E3}\x{74E6}\x{74E7}\x{74E9}\x{74EE}\x{74F0}' .
+'\x{74F1}\x{74F2}\x{74F6}\x{74F7}\x{74F8}\x{7503}\x{7504}\x{7505}\x{750C}' .
+'\x{750D}\x{750E}\x{7511}\x{7513}\x{7515}\x{7518}\x{751A}\x{751C}\x{751E}' .
+'\x{751F}\x{7523}\x{7525}\x{7526}\x{7528}\x{752B}\x{752C}\x{7530}\x{7531}' .
+'\x{7532}\x{7533}\x{7537}\x{7538}\x{753A}\x{753B}\x{753C}\x{7544}\x{7546}' .
+'\x{7549}\x{754A}\x{754B}\x{754C}\x{754D}\x{754F}\x{7551}\x{7554}\x{7559}' .
+'\x{755A}\x{755B}\x{755C}\x{755D}\x{7560}\x{7562}\x{7564}\x{7565}\x{7566}' .
+'\x{7567}\x{7569}\x{756A}\x{756B}\x{756D}\x{7570}\x{7573}\x{7574}\x{7576}' .
+'\x{7577}\x{7578}\x{757F}\x{7582}\x{7586}\x{7587}\x{7589}\x{758A}\x{758B}' .
+'\x{758E}\x{758F}\x{7591}\x{7594}\x{759A}\x{759D}\x{75A3}\x{75A5}\x{75AB}' .
+'\x{75B1}\x{75B2}\x{75B3}\x{75B5}\x{75B8}\x{75B9}\x{75BC}\x{75BD}\x{75BE}' .
+'\x{75C2}\x{75C3}\x{75C5}\x{75C7}\x{75CA}\x{75CD}\x{75D2}\x{75D4}\x{75D5}' .
+'\x{75D8}\x{75D9}\x{75DB}\x{75DE}\x{75E2}\x{75E3}\x{75E9}\x{75F0}\x{75F2}' .
+'\x{75F3}\x{75F4}\x{75FA}\x{75FC}\x{75FE}\x{75FF}\x{7601}\x{7609}\x{760B}' .
+'\x{760D}\x{761F}\x{7620}\x{7621}\x{7622}\x{7624}\x{7627}\x{7630}\x{7634}' .
+'\x{763B}\x{7642}\x{7646}\x{7647}\x{7648}\x{764C}\x{7652}\x{7656}\x{7658}' .
+'\x{765C}\x{7661}\x{7662}\x{7667}\x{7668}\x{7669}\x{766A}\x{766C}\x{7670}' .
+'\x{7672}\x{7676}\x{7678}\x{767A}\x{767B}\x{767C}\x{767D}\x{767E}\x{7680}' .
+'\x{7683}\x{7684}\x{7686}\x{7687}\x{7688}\x{768B}\x{768E}\x{7690}\x{7693}' .
+'\x{7696}\x{7699}\x{769A}\x{76AE}\x{76B0}\x{76B4}\x{76B7}\x{76B8}\x{76B9}' .
+'\x{76BA}\x{76BF}\x{76C2}\x{76C3}\x{76C6}\x{76C8}\x{76CA}\x{76CD}\x{76D2}' .
+'\x{76D6}\x{76D7}\x{76DB}\x{76DC}\x{76DE}\x{76DF}\x{76E1}\x{76E3}\x{76E4}' .
+'\x{76E5}\x{76E7}\x{76EA}\x{76EE}\x{76F2}\x{76F4}\x{76F8}\x{76FB}\x{76FE}' .
+'\x{7701}\x{7704}\x{7707}\x{7708}\x{7709}\x{770B}\x{770C}\x{771B}\x{771E}' .
+'\x{771F}\x{7720}\x{7724}\x{7725}\x{7726}\x{7729}\x{7737}\x{7738}\x{773A}' .
+'\x{773C}\x{7740}\x{7747}\x{775A}\x{775B}\x{7761}\x{7763}\x{7765}\x{7766}' .
+'\x{7768}\x{776B}\x{7779}\x{777E}\x{777F}\x{778B}\x{778E}\x{7791}\x{779E}' .
+'\x{77A0}\x{77A5}\x{77AC}\x{77AD}\x{77B0}\x{77B3}\x{77B6}\x{77B9}\x{77BB}' .
+'\x{77BC}\x{77BD}\x{77BF}\x{77C7}\x{77CD}\x{77D7}\x{77DA}\x{77DB}\x{77DC}' .
+'\x{77E2}\x{77E3}\x{77E5}\x{77E7}\x{77E9}\x{77ED}\x{77EE}\x{77EF}\x{77F3}' .
+'\x{77FC}\x{7802}\x{780C}\x{7812}\x{7814}\x{7815}\x{7820}\x{7825}\x{7826}' .
+'\x{7827}\x{7832}\x{7834}\x{783A}\x{783F}\x{7845}\x{785D}\x{786B}\x{786C}' .
+'\x{786F}\x{7872}\x{7874}\x{787C}\x{7881}\x{7886}\x{7887}\x{788C}\x{788D}' .
+'\x{788E}\x{7891}\x{7893}\x{7895}\x{7897}\x{789A}\x{78A3}\x{78A7}\x{78A9}' .
+'\x{78AA}\x{78AF}\x{78B5}\x{78BA}\x{78BC}\x{78BE}\x{78C1}\x{78C5}\x{78C6}' .
+'\x{78CA}\x{78CB}\x{78D0}\x{78D1}\x{78D4}\x{78DA}\x{78E7}\x{78E8}\x{78EC}' .
+'\x{78EF}\x{78F4}\x{78FD}\x{7901}\x{7907}\x{790E}\x{7911}\x{7912}\x{7919}' .
+'\x{7926}\x{792A}\x{792B}\x{792C}\x{793A}\x{793C}\x{793E}\x{7940}\x{7941}' .
+'\x{7947}\x{7948}\x{7949}\x{7950}\x{7953}\x{7955}\x{7956}\x{7957}\x{795A}' .
+'\x{795D}\x{795E}\x{795F}\x{7960}\x{7962}\x{7965}\x{7968}\x{796D}\x{7977}' .
+'\x{797A}\x{797F}\x{7980}\x{7981}\x{7984}\x{7985}\x{798A}\x{798D}\x{798E}' .
+'\x{798F}\x{799D}\x{79A6}\x{79A7}\x{79AA}\x{79AE}\x{79B0}\x{79B3}\x{79B9}' .
+'\x{79BA}\x{79BD}\x{79BE}\x{79BF}\x{79C0}\x{79C1}\x{79C9}\x{79CB}\x{79D1}' .
+'\x{79D2}\x{79D5}\x{79D8}\x{79DF}\x{79E1}\x{79E3}\x{79E4}\x{79E6}\x{79E7}' .
+'\x{79E9}\x{79EC}\x{79F0}\x{79FB}\x{7A00}\x{7A08}\x{7A0B}\x{7A0D}\x{7A0E}' .
+'\x{7A14}\x{7A17}\x{7A18}\x{7A19}\x{7A1A}\x{7A1C}\x{7A1F}\x{7A20}\x{7A2E}' .
+'\x{7A31}\x{7A32}\x{7A37}\x{7A3B}\x{7A3C}\x{7A3D}\x{7A3E}\x{7A3F}\x{7A40}' .
+'\x{7A42}\x{7A43}\x{7A46}\x{7A49}\x{7A4D}\x{7A4E}\x{7A4F}\x{7A50}\x{7A57}' .
+'\x{7A61}\x{7A62}\x{7A63}\x{7A69}\x{7A6B}\x{7A70}\x{7A74}\x{7A76}\x{7A79}' .
+'\x{7A7A}\x{7A7D}\x{7A7F}\x{7A81}\x{7A83}\x{7A84}\x{7A88}\x{7A92}\x{7A93}' .
+'\x{7A95}\x{7A96}\x{7A97}\x{7A98}\x{7A9F}\x{7AA9}\x{7AAA}\x{7AAE}\x{7AAF}' .
+'\x{7AB0}\x{7AB6}\x{7ABA}\x{7ABF}\x{7AC3}\x{7AC4}\x{7AC5}\x{7AC7}\x{7AC8}' .
+'\x{7ACA}\x{7ACB}\x{7ACD}\x{7ACF}\x{7AD2}\x{7AD3}\x{7AD5}\x{7AD9}\x{7ADA}' .
+'\x{7ADC}\x{7ADD}\x{7ADF}\x{7AE0}\x{7AE1}\x{7AE2}\x{7AE3}\x{7AE5}\x{7AE6}' .
+'\x{7AEA}\x{7AED}\x{7AEF}\x{7AF0}\x{7AF6}\x{7AF8}\x{7AF9}\x{7AFA}\x{7AFF}' .
+'\x{7B02}\x{7B04}\x{7B06}\x{7B08}\x{7B0A}\x{7B0B}\x{7B0F}\x{7B11}\x{7B18}' .
+'\x{7B19}\x{7B1B}\x{7B1E}\x{7B20}\x{7B25}\x{7B26}\x{7B28}\x{7B2C}\x{7B33}' .
+'\x{7B35}\x{7B36}\x{7B39}\x{7B45}\x{7B46}\x{7B48}\x{7B49}\x{7B4B}\x{7B4C}' .
+'\x{7B4D}\x{7B4F}\x{7B50}\x{7B51}\x{7B52}\x{7B54}\x{7B56}\x{7B5D}\x{7B65}' .
+'\x{7B67}\x{7B6C}\x{7B6E}\x{7B70}\x{7B71}\x{7B74}\x{7B75}\x{7B7A}\x{7B86}' .
+'\x{7B87}\x{7B8B}\x{7B8D}\x{7B8F}\x{7B92}\x{7B94}\x{7B95}\x{7B97}\x{7B98}' .
+'\x{7B99}\x{7B9A}\x{7B9C}\x{7B9D}\x{7B9F}\x{7BA1}\x{7BAA}\x{7BAD}\x{7BB1}' .
+'\x{7BB4}\x{7BB8}\x{7BC0}\x{7BC1}\x{7BC4}\x{7BC6}\x{7BC7}\x{7BC9}\x{7BCB}' .
+'\x{7BCC}\x{7BCF}\x{7BDD}\x{7BE0}\x{7BE4}\x{7BE5}\x{7BE6}\x{7BE9}\x{7BED}' .
+'\x{7BF3}\x{7BF6}\x{7BF7}\x{7C00}\x{7C07}\x{7C0D}\x{7C11}\x{7C12}\x{7C13}' .
+'\x{7C14}\x{7C17}\x{7C1F}\x{7C21}\x{7C23}\x{7C27}\x{7C2A}\x{7C2B}\x{7C37}' .
+'\x{7C38}\x{7C3D}\x{7C3E}\x{7C3F}\x{7C40}\x{7C43}\x{7C4C}\x{7C4D}\x{7C4F}' .
+'\x{7C50}\x{7C54}\x{7C56}\x{7C58}\x{7C5F}\x{7C60}\x{7C64}\x{7C65}\x{7C6C}' .
+'\x{7C73}\x{7C75}\x{7C7E}\x{7C81}\x{7C82}\x{7C83}\x{7C89}\x{7C8B}\x{7C8D}' .
+'\x{7C90}\x{7C92}\x{7C95}\x{7C97}\x{7C98}\x{7C9B}\x{7C9F}\x{7CA1}\x{7CA2}' .
+'\x{7CA4}\x{7CA5}\x{7CA7}\x{7CA8}\x{7CAB}\x{7CAD}\x{7CAE}\x{7CB1}\x{7CB2}' .
+'\x{7CB3}\x{7CB9}\x{7CBD}\x{7CBE}\x{7CC0}\x{7CC2}\x{7CC5}\x{7CCA}\x{7CCE}' .
+'\x{7CD2}\x{7CD6}\x{7CD8}\x{7CDC}\x{7CDE}\x{7CDF}\x{7CE0}\x{7CE2}\x{7CE7}' .
+'\x{7CEF}\x{7CF2}\x{7CF4}\x{7CF6}\x{7CF8}\x{7CFA}\x{7CFB}\x{7CFE}\x{7D00}' .
+'\x{7D02}\x{7D04}\x{7D05}\x{7D06}\x{7D0A}\x{7D0B}\x{7D0D}\x{7D10}\x{7D14}' .
+'\x{7D15}\x{7D17}\x{7D18}\x{7D19}\x{7D1A}\x{7D1B}\x{7D1C}\x{7D20}\x{7D21}' .
+'\x{7D22}\x{7D2B}\x{7D2C}\x{7D2E}\x{7D2F}\x{7D30}\x{7D32}\x{7D33}\x{7D35}' .
+'\x{7D39}\x{7D3A}\x{7D3F}\x{7D42}\x{7D43}\x{7D44}\x{7D45}\x{7D46}\x{7D4B}' .
+'\x{7D4C}\x{7D4E}\x{7D4F}\x{7D50}\x{7D56}\x{7D5B}\x{7D5E}\x{7D61}\x{7D62}' .
+'\x{7D63}\x{7D66}\x{7D68}\x{7D6E}\x{7D71}\x{7D72}\x{7D73}\x{7D75}\x{7D76}' .
+'\x{7D79}\x{7D7D}\x{7D89}\x{7D8F}\x{7D93}\x{7D99}\x{7D9A}\x{7D9B}\x{7D9C}' .
+'\x{7D9F}\x{7DA2}\x{7DA3}\x{7DAB}\x{7DAC}\x{7DAD}\x{7DAE}\x{7DAF}\x{7DB0}' .
+'\x{7DB1}\x{7DB2}\x{7DB4}\x{7DB5}\x{7DB8}\x{7DBA}\x{7DBB}\x{7DBD}\x{7DBE}' .
+'\x{7DBF}\x{7DC7}\x{7DCA}\x{7DCB}\x{7DCF}\x{7DD1}\x{7DD2}\x{7DD5}\x{7DD8}' .
+'\x{7DDA}\x{7DDC}\x{7DDD}\x{7DDE}\x{7DE0}\x{7DE1}\x{7DE4}\x{7DE8}\x{7DE9}' .
+'\x{7DEC}\x{7DEF}\x{7DF2}\x{7DF4}\x{7DFB}\x{7E01}\x{7E04}\x{7E05}\x{7E09}' .
+'\x{7E0A}\x{7E0B}\x{7E12}\x{7E1B}\x{7E1E}\x{7E1F}\x{7E21}\x{7E22}\x{7E23}' .
+'\x{7E26}\x{7E2B}\x{7E2E}\x{7E31}\x{7E32}\x{7E35}\x{7E37}\x{7E39}\x{7E3A}' .
+'\x{7E3B}\x{7E3D}\x{7E3E}\x{7E41}\x{7E43}\x{7E46}\x{7E4A}\x{7E4B}\x{7E4D}' .
+'\x{7E54}\x{7E55}\x{7E56}\x{7E59}\x{7E5A}\x{7E5D}\x{7E5E}\x{7E66}\x{7E67}' .
+'\x{7E69}\x{7E6A}\x{7E6D}\x{7E70}\x{7E79}\x{7E7B}\x{7E7C}\x{7E7D}\x{7E7F}' .
+'\x{7E82}\x{7E83}\x{7E88}\x{7E89}\x{7E8C}\x{7E8E}\x{7E8F}\x{7E90}\x{7E92}' .
+'\x{7E93}\x{7E94}\x{7E96}\x{7E9B}\x{7E9C}\x{7F36}\x{7F38}\x{7F3A}\x{7F45}' .
+'\x{7F4C}\x{7F4D}\x{7F4E}\x{7F50}\x{7F51}\x{7F54}\x{7F55}\x{7F58}\x{7F5F}' .
+'\x{7F60}\x{7F67}\x{7F68}\x{7F69}\x{7F6A}\x{7F6B}\x{7F6E}\x{7F70}\x{7F72}' .
+'\x{7F75}\x{7F77}\x{7F78}\x{7F79}\x{7F82}\x{7F83}\x{7F85}\x{7F86}\x{7F87}' .
+'\x{7F88}\x{7F8A}\x{7F8C}\x{7F8E}\x{7F94}\x{7F9A}\x{7F9D}\x{7F9E}\x{7FA3}' .
+'\x{7FA4}\x{7FA8}\x{7FA9}\x{7FAE}\x{7FAF}\x{7FB2}\x{7FB6}\x{7FB8}\x{7FB9}' .
+'\x{7FBD}\x{7FC1}\x{7FC5}\x{7FC6}\x{7FCA}\x{7FCC}\x{7FD2}\x{7FD4}\x{7FD5}' .
+'\x{7FE0}\x{7FE1}\x{7FE6}\x{7FE9}\x{7FEB}\x{7FF0}\x{7FF3}\x{7FF9}\x{7FFB}' .
+'\x{7FFC}\x{8000}\x{8001}\x{8003}\x{8004}\x{8005}\x{8006}\x{800B}\x{800C}' .
+'\x{8010}\x{8012}\x{8015}\x{8017}\x{8018}\x{8019}\x{801C}\x{8021}\x{8028}' .
+'\x{8033}\x{8036}\x{803B}\x{803D}\x{803F}\x{8046}\x{804A}\x{8052}\x{8056}' .
+'\x{8058}\x{805A}\x{805E}\x{805F}\x{8061}\x{8062}\x{8068}\x{806F}\x{8070}' .
+'\x{8072}\x{8073}\x{8074}\x{8076}\x{8077}\x{8079}\x{807D}\x{807E}\x{807F}' .
+'\x{8084}\x{8085}\x{8086}\x{8087}\x{8089}\x{808B}\x{808C}\x{8093}\x{8096}' .
+'\x{8098}\x{809A}\x{809B}\x{809D}\x{80A1}\x{80A2}\x{80A5}\x{80A9}\x{80AA}' .
+'\x{80AC}\x{80AD}\x{80AF}\x{80B1}\x{80B2}\x{80B4}\x{80BA}\x{80C3}\x{80C4}' .
+'\x{80C6}\x{80CC}\x{80CE}\x{80D6}\x{80D9}\x{80DA}\x{80DB}\x{80DD}\x{80DE}' .
+'\x{80E1}\x{80E4}\x{80E5}\x{80EF}\x{80F1}\x{80F4}\x{80F8}\x{80FC}\x{80FD}' .
+'\x{8102}\x{8105}\x{8106}\x{8107}\x{8108}\x{8109}\x{810A}\x{811A}\x{811B}' .
+'\x{8123}\x{8129}\x{812F}\x{8131}\x{8133}\x{8139}\x{813E}\x{8146}\x{814B}' .
+'\x{814E}\x{8150}\x{8151}\x{8153}\x{8154}\x{8155}\x{815F}\x{8165}\x{8166}' .
+'\x{816B}\x{816E}\x{8170}\x{8171}\x{8174}\x{8178}\x{8179}\x{817A}\x{817F}' .
+'\x{8180}\x{8182}\x{8183}\x{8188}\x{818A}\x{818F}\x{8193}\x{8195}\x{819A}' .
+'\x{819C}\x{819D}\x{81A0}\x{81A3}\x{81A4}\x{81A8}\x{81A9}\x{81B0}\x{81B3}' .
+'\x{81B5}\x{81B8}\x{81BA}\x{81BD}\x{81BE}\x{81BF}\x{81C0}\x{81C2}\x{81C6}' .
+'\x{81C8}\x{81C9}\x{81CD}\x{81D1}\x{81D3}\x{81D8}\x{81D9}\x{81DA}\x{81DF}' .
+'\x{81E0}\x{81E3}\x{81E5}\x{81E7}\x{81E8}\x{81EA}\x{81ED}\x{81F3}\x{81F4}' .
+'\x{81FA}\x{81FB}\x{81FC}\x{81FE}\x{8201}\x{8202}\x{8205}\x{8207}\x{8208}' .
+'\x{8209}\x{820A}\x{820C}\x{820D}\x{820E}\x{8210}\x{8212}\x{8216}\x{8217}' .
+'\x{8218}\x{821B}\x{821C}\x{821E}\x{821F}\x{8229}\x{822A}\x{822B}\x{822C}' .
+'\x{822E}\x{8233}\x{8235}\x{8236}\x{8237}\x{8238}\x{8239}\x{8240}\x{8247}' .
+'\x{8258}\x{8259}\x{825A}\x{825D}\x{825F}\x{8262}\x{8264}\x{8266}\x{8268}' .
+'\x{826A}\x{826B}\x{826E}\x{826F}\x{8271}\x{8272}\x{8276}\x{8277}\x{8278}' .
+'\x{827E}\x{828B}\x{828D}\x{8292}\x{8299}\x{829D}\x{829F}\x{82A5}\x{82A6}' .
+'\x{82AB}\x{82AC}\x{82AD}\x{82AF}\x{82B1}\x{82B3}\x{82B8}\x{82B9}\x{82BB}' .
+'\x{82BD}\x{82C5}\x{82D1}\x{82D2}\x{82D3}\x{82D4}\x{82D7}\x{82D9}\x{82DB}' .
+'\x{82DC}\x{82DE}\x{82DF}\x{82E1}\x{82E3}\x{82E5}\x{82E6}\x{82E7}\x{82EB}' .
+'\x{82F1}\x{82F3}\x{82F4}\x{82F9}\x{82FA}\x{82FB}\x{8302}\x{8303}\x{8304}' .
+'\x{8305}\x{8306}\x{8309}\x{830E}\x{8316}\x{8317}\x{8318}\x{831C}\x{8323}' .
+'\x{8328}\x{832B}\x{832F}\x{8331}\x{8332}\x{8334}\x{8335}\x{8336}\x{8338}' .
+'\x{8339}\x{8340}\x{8345}\x{8349}\x{834A}\x{834F}\x{8350}\x{8352}\x{8358}' .
+'\x{8373}\x{8375}\x{8377}\x{837B}\x{837C}\x{8385}\x{8387}\x{8389}\x{838A}' .
+'\x{838E}\x{8393}\x{8396}\x{839A}\x{839E}\x{839F}\x{83A0}\x{83A2}\x{83A8}' .
+'\x{83AA}\x{83AB}\x{83B1}\x{83B5}\x{83BD}\x{83C1}\x{83C5}\x{83CA}\x{83CC}' .
+'\x{83CE}\x{83D3}\x{83D6}\x{83D8}\x{83DC}\x{83DF}\x{83E0}\x{83E9}\x{83EB}' .
+'\x{83EF}\x{83F0}\x{83F1}\x{83F2}\x{83F4}\x{83F7}\x{83FB}\x{83FD}\x{8403}' .
+'\x{8404}\x{8407}\x{840B}\x{840C}\x{840D}\x{840E}\x{8413}\x{8420}\x{8422}' .
+'\x{8429}\x{842A}\x{842C}\x{8431}\x{8435}\x{8438}\x{843C}\x{843D}\x{8446}' .
+'\x{8449}\x{844E}\x{8457}\x{845B}\x{8461}\x{8462}\x{8463}\x{8466}\x{8469}' .
+'\x{846B}\x{846C}\x{846D}\x{846E}\x{846F}\x{8471}\x{8475}\x{8477}\x{8479}' .
+'\x{847A}\x{8482}\x{8484}\x{848B}\x{8490}\x{8494}\x{8499}\x{849C}\x{849F}' .
+'\x{84A1}\x{84AD}\x{84B2}\x{84B8}\x{84B9}\x{84BB}\x{84BC}\x{84BF}\x{84C1}' .
+'\x{84C4}\x{84C6}\x{84C9}\x{84CA}\x{84CB}\x{84CD}\x{84D0}\x{84D1}\x{84D6}' .
+'\x{84D9}\x{84DA}\x{84EC}\x{84EE}\x{84F4}\x{84FC}\x{84FF}\x{8500}\x{8506}' .
+'\x{8511}\x{8513}\x{8514}\x{8515}\x{8517}\x{8518}\x{851A}\x{851F}\x{8521}' .
+'\x{8526}\x{852C}\x{852D}\x{8535}\x{853D}\x{8540}\x{8541}\x{8543}\x{8548}' .
+'\x{8549}\x{854A}\x{854B}\x{854E}\x{8555}\x{8557}\x{8558}\x{855A}\x{8563}' .
+'\x{8568}\x{8569}\x{856A}\x{856D}\x{8577}\x{857E}\x{8580}\x{8584}\x{8587}' .
+'\x{8588}\x{858A}\x{8590}\x{8591}\x{8594}\x{8597}\x{8599}\x{859B}\x{859C}' .
+'\x{85A4}\x{85A6}\x{85A8}\x{85A9}\x{85AA}\x{85AB}\x{85AC}\x{85AE}\x{85AF}' .
+'\x{85B9}\x{85BA}\x{85C1}\x{85C9}\x{85CD}\x{85CF}\x{85D0}\x{85D5}\x{85DC}' .
+'\x{85DD}\x{85E4}\x{85E5}\x{85E9}\x{85EA}\x{85F7}\x{85F9}\x{85FA}\x{85FB}' .
+'\x{85FE}\x{8602}\x{8606}\x{8607}\x{860A}\x{860B}\x{8613}\x{8616}\x{8617}' .
+'\x{861A}\x{8622}\x{862D}\x{862F}\x{8630}\x{863F}\x{864D}\x{864E}\x{8650}' .
+'\x{8654}\x{8655}\x{865A}\x{865C}\x{865E}\x{865F}\x{8667}\x{866B}\x{8671}' .
+'\x{8679}\x{867B}\x{868A}\x{868B}\x{868C}\x{8693}\x{8695}\x{86A3}\x{86A4}' .
+'\x{86A9}\x{86AA}\x{86AB}\x{86AF}\x{86B0}\x{86B6}\x{86C4}\x{86C6}\x{86C7}' .
+'\x{86C9}\x{86CB}\x{86CD}\x{86CE}\x{86D4}\x{86D9}\x{86DB}\x{86DE}\x{86DF}' .
+'\x{86E4}\x{86E9}\x{86EC}\x{86ED}\x{86EE}\x{86EF}\x{86F8}\x{86F9}\x{86FB}' .
+'\x{86FE}\x{8700}\x{8702}\x{8703}\x{8706}\x{8708}\x{8709}\x{870A}\x{870D}' .
+'\x{8711}\x{8712}\x{8718}\x{871A}\x{871C}\x{8725}\x{8729}\x{8734}\x{8737}' .
+'\x{873B}\x{873F}\x{8749}\x{874B}\x{874C}\x{874E}\x{8753}\x{8755}\x{8757}' .
+'\x{8759}\x{875F}\x{8760}\x{8763}\x{8766}\x{8768}\x{876A}\x{876E}\x{8774}' .
+'\x{8776}\x{8778}\x{877F}\x{8782}\x{878D}\x{879F}\x{87A2}\x{87AB}\x{87AF}' .
+'\x{87B3}\x{87BA}\x{87BB}\x{87BD}\x{87C0}\x{87C4}\x{87C6}\x{87C7}\x{87CB}' .
+'\x{87D0}\x{87D2}\x{87E0}\x{87EF}\x{87F2}\x{87F6}\x{87F7}\x{87F9}\x{87FB}' .
+'\x{87FE}\x{8805}\x{880D}\x{880E}\x{880F}\x{8811}\x{8815}\x{8816}\x{8821}' .
+'\x{8822}\x{8823}\x{8827}\x{8831}\x{8836}\x{8839}\x{883B}\x{8840}\x{8842}' .
+'\x{8844}\x{8846}\x{884C}\x{884D}\x{8852}\x{8853}\x{8857}\x{8859}\x{885B}' .
+'\x{885D}\x{885E}\x{8861}\x{8862}\x{8863}\x{8868}\x{886B}\x{8870}\x{8872}' .
+'\x{8875}\x{8877}\x{887D}\x{887E}\x{887F}\x{8881}\x{8882}\x{8888}\x{888B}' .
+'\x{888D}\x{8892}\x{8896}\x{8897}\x{8899}\x{889E}\x{88A2}\x{88A4}\x{88AB}' .
+'\x{88AE}\x{88B0}\x{88B1}\x{88B4}\x{88B5}\x{88B7}\x{88BF}\x{88C1}\x{88C2}' .
+'\x{88C3}\x{88C4}\x{88C5}\x{88CF}\x{88D4}\x{88D5}\x{88D8}\x{88D9}\x{88DC}' .
+'\x{88DD}\x{88DF}\x{88E1}\x{88E8}\x{88F2}\x{88F3}\x{88F4}\x{88F8}\x{88F9}' .
+'\x{88FC}\x{88FD}\x{88FE}\x{8902}\x{8904}\x{8907}\x{890A}\x{890C}\x{8910}' .
+'\x{8912}\x{8913}\x{891D}\x{891E}\x{8925}\x{892A}\x{892B}\x{8936}\x{8938}' .
+'\x{893B}\x{8941}\x{8943}\x{8944}\x{894C}\x{894D}\x{8956}\x{895E}\x{895F}' .
+'\x{8960}\x{8964}\x{8966}\x{896A}\x{896D}\x{896F}\x{8972}\x{8974}\x{8977}' .
+'\x{897E}\x{897F}\x{8981}\x{8983}\x{8986}\x{8987}\x{8988}\x{898A}\x{898B}' .
+'\x{898F}\x{8993}\x{8996}\x{8997}\x{8998}\x{899A}\x{89A1}\x{89A6}\x{89A7}' .
+'\x{89A9}\x{89AA}\x{89AC}\x{89AF}\x{89B2}\x{89B3}\x{89BA}\x{89BD}\x{89BF}' .
+'\x{89C0}\x{89D2}\x{89DA}\x{89DC}\x{89DD}\x{89E3}\x{89E6}\x{89E7}\x{89F4}' .
+'\x{89F8}\x{8A00}\x{8A02}\x{8A03}\x{8A08}\x{8A0A}\x{8A0C}\x{8A0E}\x{8A10}' .
+'\x{8A13}\x{8A16}\x{8A17}\x{8A18}\x{8A1B}\x{8A1D}\x{8A1F}\x{8A23}\x{8A25}' .
+'\x{8A2A}\x{8A2D}\x{8A31}\x{8A33}\x{8A34}\x{8A36}\x{8A3A}\x{8A3B}\x{8A3C}' .
+'\x{8A41}\x{8A46}\x{8A48}\x{8A50}\x{8A51}\x{8A52}\x{8A54}\x{8A55}\x{8A5B}' .
+'\x{8A5E}\x{8A60}\x{8A62}\x{8A63}\x{8A66}\x{8A69}\x{8A6B}\x{8A6C}\x{8A6D}' .
+'\x{8A6E}\x{8A70}\x{8A71}\x{8A72}\x{8A73}\x{8A7C}\x{8A82}\x{8A84}\x{8A85}' .
+'\x{8A87}\x{8A89}\x{8A8C}\x{8A8D}\x{8A91}\x{8A93}\x{8A95}\x{8A98}\x{8A9A}' .
+'\x{8A9E}\x{8AA0}\x{8AA1}\x{8AA3}\x{8AA4}\x{8AA5}\x{8AA6}\x{8AA8}\x{8AAC}' .
+'\x{8AAD}\x{8AB0}\x{8AB2}\x{8AB9}\x{8ABC}\x{8ABF}\x{8AC2}\x{8AC4}\x{8AC7}' .
+'\x{8ACB}\x{8ACC}\x{8ACD}\x{8ACF}\x{8AD2}\x{8AD6}\x{8ADA}\x{8ADB}\x{8ADC}' .
+'\x{8ADE}\x{8AE0}\x{8AE1}\x{8AE2}\x{8AE4}\x{8AE6}\x{8AE7}\x{8AEB}\x{8AED}' .
+'\x{8AEE}\x{8AF1}\x{8AF3}\x{8AF7}\x{8AF8}\x{8AFA}\x{8AFE}\x{8B00}\x{8B01}' .
+'\x{8B02}\x{8B04}\x{8B07}\x{8B0C}\x{8B0E}\x{8B10}\x{8B14}\x{8B16}\x{8B17}' .
+'\x{8B19}\x{8B1A}\x{8B1B}\x{8B1D}\x{8B20}\x{8B21}\x{8B26}\x{8B28}\x{8B2B}' .
+'\x{8B2C}\x{8B33}\x{8B39}\x{8B3E}\x{8B41}\x{8B49}\x{8B4C}\x{8B4E}\x{8B4F}' .
+'\x{8B56}\x{8B58}\x{8B5A}\x{8B5B}\x{8B5C}\x{8B5F}\x{8B66}\x{8B6B}\x{8B6C}' .
+'\x{8B6F}\x{8B70}\x{8B71}\x{8B72}\x{8B74}\x{8B77}\x{8B7D}\x{8B80}\x{8B83}' .
+'\x{8B8A}\x{8B8C}\x{8B8E}\x{8B90}\x{8B92}\x{8B93}\x{8B96}\x{8B99}\x{8B9A}' .
+'\x{8C37}\x{8C3A}\x{8C3F}\x{8C41}\x{8C46}\x{8C48}\x{8C4A}\x{8C4C}\x{8C4E}' .
+'\x{8C50}\x{8C55}\x{8C5A}\x{8C61}\x{8C62}\x{8C6A}\x{8C6B}\x{8C6C}\x{8C78}' .
+'\x{8C79}\x{8C7A}\x{8C7C}\x{8C82}\x{8C85}\x{8C89}\x{8C8A}\x{8C8C}\x{8C8D}' .
+'\x{8C8E}\x{8C94}\x{8C98}\x{8C9D}\x{8C9E}\x{8CA0}\x{8CA1}\x{8CA2}\x{8CA7}' .
+'\x{8CA8}\x{8CA9}\x{8CAA}\x{8CAB}\x{8CAC}\x{8CAD}\x{8CAE}\x{8CAF}\x{8CB0}' .
+'\x{8CB2}\x{8CB3}\x{8CB4}\x{8CB6}\x{8CB7}\x{8CB8}\x{8CBB}\x{8CBC}\x{8CBD}' .
+'\x{8CBF}\x{8CC0}\x{8CC1}\x{8CC2}\x{8CC3}\x{8CC4}\x{8CC7}\x{8CC8}\x{8CCA}' .
+'\x{8CCD}\x{8CCE}\x{8CD1}\x{8CD3}\x{8CDA}\x{8CDB}\x{8CDC}\x{8CDE}\x{8CE0}' .
+'\x{8CE2}\x{8CE3}\x{8CE4}\x{8CE6}\x{8CEA}\x{8CED}\x{8CFA}\x{8CFB}\x{8CFC}' .
+'\x{8CFD}\x{8D04}\x{8D05}\x{8D07}\x{8D08}\x{8D0A}\x{8D0B}\x{8D0D}\x{8D0F}' .
+'\x{8D10}\x{8D13}\x{8D14}\x{8D16}\x{8D64}\x{8D66}\x{8D67}\x{8D6B}\x{8D6D}' .
+'\x{8D70}\x{8D71}\x{8D73}\x{8D74}\x{8D77}\x{8D81}\x{8D85}\x{8D8A}\x{8D99}' .
+'\x{8DA3}\x{8DA8}\x{8DB3}\x{8DBA}\x{8DBE}\x{8DC2}\x{8DCB}\x{8DCC}\x{8DCF}' .
+'\x{8DD6}\x{8DDA}\x{8DDB}\x{8DDD}\x{8DDF}\x{8DE1}\x{8DE3}\x{8DE8}\x{8DEA}' .
+'\x{8DEB}\x{8DEF}\x{8DF3}\x{8DF5}\x{8DFC}\x{8DFF}\x{8E08}\x{8E09}\x{8E0A}' .
+'\x{8E0F}\x{8E10}\x{8E1D}\x{8E1E}\x{8E1F}\x{8E2A}\x{8E30}\x{8E34}\x{8E35}' .
+'\x{8E42}\x{8E44}\x{8E47}\x{8E48}\x{8E49}\x{8E4A}\x{8E4C}\x{8E50}\x{8E55}' .
+'\x{8E59}\x{8E5F}\x{8E60}\x{8E63}\x{8E64}\x{8E72}\x{8E74}\x{8E76}\x{8E7C}' .
+'\x{8E81}\x{8E84}\x{8E85}\x{8E87}\x{8E8A}\x{8E8B}\x{8E8D}\x{8E91}\x{8E93}' .
+'\x{8E94}\x{8E99}\x{8EA1}\x{8EAA}\x{8EAB}\x{8EAC}\x{8EAF}\x{8EB0}\x{8EB1}' .
+'\x{8EBE}\x{8EC5}\x{8EC6}\x{8EC8}\x{8ECA}\x{8ECB}\x{8ECC}\x{8ECD}\x{8ED2}' .
+'\x{8EDB}\x{8EDF}\x{8EE2}\x{8EE3}\x{8EEB}\x{8EF8}\x{8EFB}\x{8EFC}\x{8EFD}' .
+'\x{8EFE}\x{8F03}\x{8F05}\x{8F09}\x{8F0A}\x{8F0C}\x{8F12}\x{8F13}\x{8F14}' .
+'\x{8F15}\x{8F19}\x{8F1B}\x{8F1C}\x{8F1D}\x{8F1F}\x{8F26}\x{8F29}\x{8F2A}' .
+'\x{8F2F}\x{8F33}\x{8F38}\x{8F39}\x{8F3B}\x{8F3E}\x{8F3F}\x{8F42}\x{8F44}' .
+'\x{8F45}\x{8F46}\x{8F49}\x{8F4C}\x{8F4D}\x{8F4E}\x{8F57}\x{8F5C}\x{8F5F}' .
+'\x{8F61}\x{8F62}\x{8F63}\x{8F64}\x{8F9B}\x{8F9C}\x{8F9E}\x{8F9F}\x{8FA3}' .
+'\x{8FA7}\x{8FA8}\x{8FAD}\x{8FAE}\x{8FAF}\x{8FB0}\x{8FB1}\x{8FB2}\x{8FB7}' .
+'\x{8FBA}\x{8FBB}\x{8FBC}\x{8FBF}\x{8FC2}\x{8FC4}\x{8FC5}\x{8FCE}\x{8FD1}' .
+'\x{8FD4}\x{8FDA}\x{8FE2}\x{8FE5}\x{8FE6}\x{8FE9}\x{8FEA}\x{8FEB}\x{8FED}' .
+'\x{8FEF}\x{8FF0}\x{8FF4}\x{8FF7}\x{8FF8}\x{8FF9}\x{8FFA}\x{8FFD}\x{9000}' .
+'\x{9001}\x{9003}\x{9005}\x{9006}\x{900B}\x{900D}\x{900E}\x{900F}\x{9010}' .
+'\x{9011}\x{9013}\x{9014}\x{9015}\x{9016}\x{9017}\x{9019}\x{901A}\x{901D}' .
+'\x{901E}\x{901F}\x{9020}\x{9021}\x{9022}\x{9023}\x{9027}\x{902E}\x{9031}' .
+'\x{9032}\x{9035}\x{9036}\x{9038}\x{9039}\x{903C}\x{903E}\x{9041}\x{9042}' .
+'\x{9045}\x{9047}\x{9049}\x{904A}\x{904B}\x{904D}\x{904E}\x{904F}\x{9050}' .
+'\x{9051}\x{9052}\x{9053}\x{9054}\x{9055}\x{9056}\x{9058}\x{9059}\x{905C}' .
+'\x{905E}\x{9060}\x{9061}\x{9063}\x{9065}\x{9068}\x{9069}\x{906D}\x{906E}' .
+'\x{906F}\x{9072}\x{9075}\x{9076}\x{9077}\x{9078}\x{907A}\x{907C}\x{907D}' .
+'\x{907F}\x{9080}\x{9081}\x{9082}\x{9083}\x{9084}\x{9087}\x{9089}\x{908A}' .
+'\x{908F}\x{9091}\x{90A3}\x{90A6}\x{90A8}\x{90AA}\x{90AF}\x{90B1}\x{90B5}' .
+'\x{90B8}\x{90C1}\x{90CA}\x{90CE}\x{90DB}\x{90E1}\x{90E2}\x{90E4}\x{90E8}' .
+'\x{90ED}\x{90F5}\x{90F7}\x{90FD}\x{9102}\x{9112}\x{9119}\x{912D}\x{9130}' .
+'\x{9132}\x{9149}\x{914A}\x{914B}\x{914C}\x{914D}\x{914E}\x{9152}\x{9154}' .
+'\x{9156}\x{9158}\x{9162}\x{9163}\x{9165}\x{9169}\x{916A}\x{916C}\x{9172}' .
+'\x{9173}\x{9175}\x{9177}\x{9178}\x{9182}\x{9187}\x{9189}\x{918B}\x{918D}' .
+'\x{9190}\x{9192}\x{9197}\x{919C}\x{91A2}\x{91A4}\x{91AA}\x{91AB}\x{91AF}' .
+'\x{91B4}\x{91B5}\x{91B8}\x{91BA}\x{91C0}\x{91C1}\x{91C6}\x{91C7}\x{91C8}' .
+'\x{91C9}\x{91CB}\x{91CC}\x{91CD}\x{91CE}\x{91CF}\x{91D0}\x{91D1}\x{91D6}' .
+'\x{91D8}\x{91DB}\x{91DC}\x{91DD}\x{91DF}\x{91E1}\x{91E3}\x{91E6}\x{91E7}' .
+'\x{91F5}\x{91F6}\x{91FC}\x{91FF}\x{920D}\x{920E}\x{9211}\x{9214}\x{9215}' .
+'\x{921E}\x{9229}\x{922C}\x{9234}\x{9237}\x{923F}\x{9244}\x{9245}\x{9248}' .
+'\x{9249}\x{924B}\x{9250}\x{9257}\x{925A}\x{925B}\x{925E}\x{9262}\x{9264}' .
+'\x{9266}\x{9271}\x{927E}\x{9280}\x{9283}\x{9285}\x{9291}\x{9293}\x{9295}' .
+'\x{9296}\x{9298}\x{929A}\x{929B}\x{929C}\x{92AD}\x{92B7}\x{92B9}\x{92CF}' .
+'\x{92D2}\x{92E4}\x{92E9}\x{92EA}\x{92ED}\x{92F2}\x{92F3}\x{92F8}\x{92FA}' .
+'\x{92FC}\x{9306}\x{930F}\x{9310}\x{9318}\x{9319}\x{931A}\x{9320}\x{9322}' .
+'\x{9323}\x{9326}\x{9328}\x{932B}\x{932C}\x{932E}\x{932F}\x{9332}\x{9335}' .
+'\x{933A}\x{933B}\x{9344}\x{934B}\x{934D}\x{9354}\x{9356}\x{935B}\x{935C}' .
+'\x{9360}\x{936C}\x{936E}\x{9375}\x{937C}\x{937E}\x{938C}\x{9394}\x{9396}' .
+'\x{9397}\x{939A}\x{93A7}\x{93AC}\x{93AD}\x{93AE}\x{93B0}\x{93B9}\x{93C3}' .
+'\x{93C8}\x{93D0}\x{93D1}\x{93D6}\x{93D7}\x{93D8}\x{93DD}\x{93E1}\x{93E4}' .
+'\x{93E5}\x{93E8}\x{9403}\x{9407}\x{9410}\x{9413}\x{9414}\x{9418}\x{9419}' .
+'\x{941A}\x{9421}\x{942B}\x{9435}\x{9436}\x{9438}\x{943A}\x{9441}\x{9444}' .
+'\x{9451}\x{9452}\x{9453}\x{945A}\x{945B}\x{945E}\x{9460}\x{9462}\x{946A}' .
+'\x{9470}\x{9475}\x{9477}\x{947C}\x{947D}\x{947E}\x{947F}\x{9481}\x{9577}' .
+'\x{9580}\x{9582}\x{9583}\x{9587}\x{9589}\x{958A}\x{958B}\x{958F}\x{9591}' .
+'\x{9593}\x{9594}\x{9596}\x{9598}\x{9599}\x{95A0}\x{95A2}\x{95A3}\x{95A4}' .
+'\x{95A5}\x{95A7}\x{95A8}\x{95AD}\x{95B2}\x{95B9}\x{95BB}\x{95BC}\x{95BE}' .
+'\x{95C3}\x{95C7}\x{95CA}\x{95CC}\x{95CD}\x{95D4}\x{95D5}\x{95D6}\x{95D8}' .
+'\x{95DC}\x{95E1}\x{95E2}\x{95E5}\x{961C}\x{9621}\x{9628}\x{962A}\x{962E}' .
+'\x{962F}\x{9632}\x{963B}\x{963F}\x{9640}\x{9642}\x{9644}\x{964B}\x{964C}' .
+'\x{964D}\x{964F}\x{9650}\x{965B}\x{965C}\x{965D}\x{965E}\x{965F}\x{9662}' .
+'\x{9663}\x{9664}\x{9665}\x{9666}\x{966A}\x{966C}\x{9670}\x{9672}\x{9673}' .
+'\x{9675}\x{9676}\x{9677}\x{9678}\x{967A}\x{967D}\x{9685}\x{9686}\x{9688}' .
+'\x{968A}\x{968B}\x{968D}\x{968E}\x{968F}\x{9694}\x{9695}\x{9697}\x{9698}' .
+'\x{9699}\x{969B}\x{969C}\x{96A0}\x{96A3}\x{96A7}\x{96A8}\x{96AA}\x{96B0}' .
+'\x{96B1}\x{96B2}\x{96B4}\x{96B6}\x{96B7}\x{96B8}\x{96B9}\x{96BB}\x{96BC}' .
+'\x{96C0}\x{96C1}\x{96C4}\x{96C5}\x{96C6}\x{96C7}\x{96C9}\x{96CB}\x{96CC}' .
+'\x{96CD}\x{96CE}\x{96D1}\x{96D5}\x{96D6}\x{96D9}\x{96DB}\x{96DC}\x{96E2}' .
+'\x{96E3}\x{96E8}\x{96EA}\x{96EB}\x{96F0}\x{96F2}\x{96F6}\x{96F7}\x{96F9}' .
+'\x{96FB}\x{9700}\x{9704}\x{9706}\x{9707}\x{9708}\x{970A}\x{970D}\x{970E}' .
+'\x{970F}\x{9711}\x{9713}\x{9716}\x{9719}\x{971C}\x{971E}\x{9724}\x{9727}' .
+'\x{972A}\x{9730}\x{9732}\x{9738}\x{9739}\x{973D}\x{973E}\x{9742}\x{9744}' .
+'\x{9746}\x{9748}\x{9749}\x{9752}\x{9756}\x{9759}\x{975C}\x{975E}\x{9760}' .
+'\x{9761}\x{9762}\x{9764}\x{9766}\x{9768}\x{9769}\x{976B}\x{976D}\x{9771}' .
+'\x{9774}\x{9779}\x{977A}\x{977C}\x{9781}\x{9784}\x{9785}\x{9786}\x{978B}' .
+'\x{978D}\x{978F}\x{9790}\x{9798}\x{979C}\x{97A0}\x{97A3}\x{97A6}\x{97A8}' .
+'\x{97AB}\x{97AD}\x{97B3}\x{97B4}\x{97C3}\x{97C6}\x{97C8}\x{97CB}\x{97D3}' .
+'\x{97DC}\x{97ED}\x{97EE}\x{97F2}\x{97F3}\x{97F5}\x{97F6}\x{97FB}\x{97FF}' .
+'\x{9801}\x{9802}\x{9803}\x{9805}\x{9806}\x{9808}\x{980C}\x{980F}\x{9810}' .
+'\x{9811}\x{9812}\x{9813}\x{9817}\x{9818}\x{981A}\x{9821}\x{9824}\x{982C}' .
+'\x{982D}\x{9834}\x{9837}\x{9838}\x{983B}\x{983C}\x{983D}\x{9846}\x{984B}' .
+'\x{984C}\x{984D}\x{984E}\x{984F}\x{9854}\x{9855}\x{9858}\x{985B}\x{985E}' .
+'\x{9867}\x{986B}\x{986F}\x{9870}\x{9871}\x{9873}\x{9874}\x{98A8}\x{98AA}' .
+'\x{98AF}\x{98B1}\x{98B6}\x{98C3}\x{98C4}\x{98C6}\x{98DB}\x{98DC}\x{98DF}' .
+'\x{98E2}\x{98E9}\x{98EB}\x{98ED}\x{98EE}\x{98EF}\x{98F2}\x{98F4}\x{98FC}' .
+'\x{98FD}\x{98FE}\x{9903}\x{9905}\x{9909}\x{990A}\x{990C}\x{9910}\x{9912}' .
+'\x{9913}\x{9914}\x{9918}\x{991D}\x{991E}\x{9920}\x{9921}\x{9924}\x{9928}' .
+'\x{992C}\x{992E}\x{993D}\x{993E}\x{9942}\x{9945}\x{9949}\x{994B}\x{994C}' .
+'\x{9950}\x{9951}\x{9952}\x{9955}\x{9957}\x{9996}\x{9997}\x{9998}\x{9999}' .
+'\x{99A5}\x{99A8}\x{99AC}\x{99AD}\x{99AE}\x{99B3}\x{99B4}\x{99BC}\x{99C1}' .
+'\x{99C4}\x{99C5}\x{99C6}\x{99C8}\x{99D0}\x{99D1}\x{99D2}\x{99D5}\x{99D8}' .
+'\x{99DB}\x{99DD}\x{99DF}\x{99E2}\x{99ED}\x{99EE}\x{99F1}\x{99F2}\x{99F8}' .
+'\x{99FB}\x{99FF}\x{9A01}\x{9A05}\x{9A0E}\x{9A0F}\x{9A12}\x{9A13}\x{9A19}' .
+'\x{9A28}\x{9A2B}\x{9A30}\x{9A37}\x{9A3E}\x{9A40}\x{9A42}\x{9A43}\x{9A45}' .
+'\x{9A4D}\x{9A55}\x{9A57}\x{9A5A}\x{9A5B}\x{9A5F}\x{9A62}\x{9A64}\x{9A65}' .
+'\x{9A69}\x{9A6A}\x{9A6B}\x{9AA8}\x{9AAD}\x{9AB0}\x{9AB8}\x{9ABC}\x{9AC0}' .
+'\x{9AC4}\x{9ACF}\x{9AD1}\x{9AD3}\x{9AD4}\x{9AD8}\x{9ADE}\x{9ADF}\x{9AE2}' .
+'\x{9AE3}\x{9AE6}\x{9AEA}\x{9AEB}\x{9AED}\x{9AEE}\x{9AEF}\x{9AF1}\x{9AF4}' .
+'\x{9AF7}\x{9AFB}\x{9B06}\x{9B18}\x{9B1A}\x{9B1F}\x{9B22}\x{9B23}\x{9B25}' .
+'\x{9B27}\x{9B28}\x{9B29}\x{9B2A}\x{9B2E}\x{9B2F}\x{9B31}\x{9B32}\x{9B3B}' .
+'\x{9B3C}\x{9B41}\x{9B42}\x{9B43}\x{9B44}\x{9B45}\x{9B4D}\x{9B4E}\x{9B4F}' .
+'\x{9B51}\x{9B54}\x{9B58}\x{9B5A}\x{9B6F}\x{9B74}\x{9B83}\x{9B8E}\x{9B91}' .
+'\x{9B92}\x{9B93}\x{9B96}\x{9B97}\x{9B9F}\x{9BA0}\x{9BA8}\x{9BAA}\x{9BAB}' .
+'\x{9BAD}\x{9BAE}\x{9BB4}\x{9BB9}\x{9BC0}\x{9BC6}\x{9BC9}\x{9BCA}\x{9BCF}' .
+'\x{9BD1}\x{9BD2}\x{9BD4}\x{9BD6}\x{9BDB}\x{9BE1}\x{9BE2}\x{9BE3}\x{9BE4}' .
+'\x{9BE8}\x{9BF0}\x{9BF1}\x{9BF2}\x{9BF5}\x{9C04}\x{9C06}\x{9C08}\x{9C09}' .
+'\x{9C0A}\x{9C0C}\x{9C0D}\x{9C10}\x{9C12}\x{9C13}\x{9C14}\x{9C15}\x{9C1B}' .
+'\x{9C21}\x{9C24}\x{9C25}\x{9C2D}\x{9C2E}\x{9C2F}\x{9C30}\x{9C32}\x{9C39}' .
+'\x{9C3A}\x{9C3B}\x{9C3E}\x{9C46}\x{9C47}\x{9C48}\x{9C52}\x{9C57}\x{9C5A}' .
+'\x{9C60}\x{9C67}\x{9C76}\x{9C78}\x{9CE5}\x{9CE7}\x{9CE9}\x{9CEB}\x{9CEC}' .
+'\x{9CF0}\x{9CF3}\x{9CF4}\x{9CF6}\x{9D03}\x{9D06}\x{9D07}\x{9D08}\x{9D09}' .
+'\x{9D0E}\x{9D12}\x{9D15}\x{9D1B}\x{9D1F}\x{9D23}\x{9D26}\x{9D28}\x{9D2A}' .
+'\x{9D2B}\x{9D2C}\x{9D3B}\x{9D3E}\x{9D3F}\x{9D41}\x{9D44}\x{9D46}\x{9D48}' .
+'\x{9D50}\x{9D51}\x{9D59}\x{9D5C}\x{9D5D}\x{9D5E}\x{9D60}\x{9D61}\x{9D64}' .
+'\x{9D6C}\x{9D6F}\x{9D72}\x{9D7A}\x{9D87}\x{9D89}\x{9D8F}\x{9D9A}\x{9DA4}' .
+'\x{9DA9}\x{9DAB}\x{9DAF}\x{9DB2}\x{9DB4}\x{9DB8}\x{9DBA}\x{9DBB}\x{9DC1}' .
+'\x{9DC2}\x{9DC4}\x{9DC6}\x{9DCF}\x{9DD3}\x{9DD9}\x{9DE6}\x{9DED}\x{9DEF}' .
+'\x{9DF2}\x{9DF8}\x{9DF9}\x{9DFA}\x{9DFD}\x{9E1A}\x{9E1B}\x{9E1E}\x{9E75}' .
+'\x{9E78}\x{9E79}\x{9E7D}\x{9E7F}\x{9E81}\x{9E88}\x{9E8B}\x{9E8C}\x{9E91}' .
+'\x{9E92}\x{9E93}\x{9E95}\x{9E97}\x{9E9D}\x{9E9F}\x{9EA5}\x{9EA6}\x{9EA9}' .
+'\x{9EAA}\x{9EAD}\x{9EB8}\x{9EB9}\x{9EBA}\x{9EBB}\x{9EBC}\x{9EBE}\x{9EBF}' .
+'\x{9EC4}\x{9ECC}\x{9ECD}\x{9ECE}\x{9ECF}\x{9ED0}\x{9ED2}\x{9ED4}\x{9ED8}' .
+'\x{9ED9}\x{9EDB}\x{9EDC}\x{9EDD}\x{9EDE}\x{9EE0}\x{9EE5}\x{9EE8}\x{9EEF}' .
+'\x{9EF4}\x{9EF6}\x{9EF7}\x{9EF9}\x{9EFB}\x{9EFC}\x{9EFD}\x{9F07}\x{9F08}' .
+'\x{9F0E}\x{9F13}\x{9F15}\x{9F20}\x{9F21}\x{9F2C}\x{9F3B}\x{9F3E}\x{9F4A}' .
+'\x{9F4B}\x{9F4E}\x{9F4F}\x{9F52}\x{9F54}\x{9F5F}\x{9F60}\x{9F61}\x{9F62}' .
+'\x{9F63}\x{9F66}\x{9F67}\x{9F6A}\x{9F6C}\x{9F72}\x{9F76}\x{9F77}\x{9F8D}' .
+'\x{9F95}\x{9F9C}\x{9F9D}\x{9FA0}]{1,15}$/iu',
+ 12 => '/^[\x{002d}0-9a-z\x{3447}\x{3473}\x{359E}\x{360E}\x{361A}\x{3918}\x{396E}\x{39CF}\x{39D0}' .
+'\x{39DF}\x{3A73}\x{3B4E}\x{3C6E}\x{3CE0}\x{4056}\x{415F}\x{4337}\x{43AC}' .
+'\x{43B1}\x{43DD}\x{44D6}\x{464C}\x{4661}\x{4723}\x{4729}\x{477C}\x{478D}' .
+'\x{4947}\x{497A}\x{497D}\x{4982}\x{4983}\x{4985}\x{4986}\x{499B}\x{499F}' .
+'\x{49B6}\x{49B7}\x{4C77}\x{4C9F}\x{4CA0}\x{4CA1}\x{4CA2}\x{4CA3}\x{4D13}' .
+'\x{4D14}\x{4D15}\x{4D16}\x{4D17}\x{4D18}\x{4D19}\x{4DAE}\x{4E00}\x{4E01}' .
+'\x{4E02}\x{4E03}\x{4E04}\x{4E05}\x{4E06}\x{4E07}\x{4E08}\x{4E09}\x{4E0A}' .
+'\x{4E0B}\x{4E0C}\x{4E0D}\x{4E0E}\x{4E0F}\x{4E10}\x{4E11}\x{4E13}\x{4E14}' .
+'\x{4E15}\x{4E16}\x{4E17}\x{4E18}\x{4E19}\x{4E1A}\x{4E1B}\x{4E1C}\x{4E1D}' .
+'\x{4E1E}\x{4E1F}\x{4E20}\x{4E21}\x{4E22}\x{4E23}\x{4E24}\x{4E25}\x{4E26}' .
+'\x{4E27}\x{4E28}\x{4E2A}\x{4E2B}\x{4E2C}\x{4E2D}\x{4E2E}\x{4E2F}\x{4E30}' .
+'\x{4E31}\x{4E32}\x{4E33}\x{4E34}\x{4E35}\x{4E36}\x{4E37}\x{4E38}\x{4E39}' .
+'\x{4E3A}\x{4E3B}\x{4E3C}\x{4E3D}\x{4E3E}\x{4E3F}\x{4E40}\x{4E41}\x{4E42}' .
+'\x{4E43}\x{4E44}\x{4E45}\x{4E46}\x{4E47}\x{4E48}\x{4E49}\x{4E4A}\x{4E4B}' .
+'\x{4E4C}\x{4E4D}\x{4E4E}\x{4E4F}\x{4E50}\x{4E51}\x{4E52}\x{4E53}\x{4E54}' .
+'\x{4E56}\x{4E57}\x{4E58}\x{4E59}\x{4E5A}\x{4E5B}\x{4E5C}\x{4E5D}\x{4E5E}' .
+'\x{4E5F}\x{4E60}\x{4E61}\x{4E62}\x{4E63}\x{4E64}\x{4E65}\x{4E66}\x{4E67}' .
+'\x{4E69}\x{4E6A}\x{4E6B}\x{4E6C}\x{4E6D}\x{4E6E}\x{4E6F}\x{4E70}\x{4E71}' .
+'\x{4E72}\x{4E73}\x{4E74}\x{4E75}\x{4E76}\x{4E77}\x{4E78}\x{4E7A}\x{4E7B}' .
+'\x{4E7C}\x{4E7D}\x{4E7E}\x{4E7F}\x{4E80}\x{4E81}\x{4E82}\x{4E83}\x{4E84}' .
+'\x{4E85}\x{4E86}\x{4E87}\x{4E88}\x{4E89}\x{4E8B}\x{4E8C}\x{4E8D}\x{4E8E}' .
+'\x{4E8F}\x{4E90}\x{4E91}\x{4E92}\x{4E93}\x{4E94}\x{4E95}\x{4E97}\x{4E98}' .
+'\x{4E99}\x{4E9A}\x{4E9B}\x{4E9C}\x{4E9D}\x{4E9E}\x{4E9F}\x{4EA0}\x{4EA1}' .
+'\x{4EA2}\x{4EA4}\x{4EA5}\x{4EA6}\x{4EA7}\x{4EA8}\x{4EA9}\x{4EAA}\x{4EAB}' .
+'\x{4EAC}\x{4EAD}\x{4EAE}\x{4EAF}\x{4EB0}\x{4EB1}\x{4EB2}\x{4EB3}\x{4EB4}' .
+'\x{4EB5}\x{4EB6}\x{4EB7}\x{4EB8}\x{4EB9}\x{4EBA}\x{4EBB}\x{4EBD}\x{4EBE}' .
+'\x{4EBF}\x{4EC0}\x{4EC1}\x{4EC2}\x{4EC3}\x{4EC4}\x{4EC5}\x{4EC6}\x{4EC7}' .
+'\x{4EC8}\x{4EC9}\x{4ECA}\x{4ECB}\x{4ECD}\x{4ECE}\x{4ECF}\x{4ED0}\x{4ED1}' .
+'\x{4ED2}\x{4ED3}\x{4ED4}\x{4ED5}\x{4ED6}\x{4ED7}\x{4ED8}\x{4ED9}\x{4EDA}' .
+'\x{4EDB}\x{4EDC}\x{4EDD}\x{4EDE}\x{4EDF}\x{4EE0}\x{4EE1}\x{4EE2}\x{4EE3}' .
+'\x{4EE4}\x{4EE5}\x{4EE6}\x{4EE8}\x{4EE9}\x{4EEA}\x{4EEB}\x{4EEC}\x{4EEF}' .
+'\x{4EF0}\x{4EF1}\x{4EF2}\x{4EF3}\x{4EF4}\x{4EF5}\x{4EF6}\x{4EF7}\x{4EFB}' .
+'\x{4EFD}\x{4EFF}\x{4F00}\x{4F01}\x{4F02}\x{4F03}\x{4F04}\x{4F05}\x{4F06}' .
+'\x{4F08}\x{4F09}\x{4F0A}\x{4F0B}\x{4F0C}\x{4F0D}\x{4F0E}\x{4F0F}\x{4F10}' .
+'\x{4F11}\x{4F12}\x{4F13}\x{4F14}\x{4F15}\x{4F17}\x{4F18}\x{4F19}\x{4F1A}' .
+'\x{4F1B}\x{4F1C}\x{4F1D}\x{4F1E}\x{4F1F}\x{4F20}\x{4F21}\x{4F22}\x{4F23}' .
+'\x{4F24}\x{4F25}\x{4F26}\x{4F27}\x{4F29}\x{4F2A}\x{4F2B}\x{4F2C}\x{4F2D}' .
+'\x{4F2E}\x{4F2F}\x{4F30}\x{4F32}\x{4F33}\x{4F34}\x{4F36}\x{4F38}\x{4F39}' .
+'\x{4F3A}\x{4F3B}\x{4F3C}\x{4F3D}\x{4F3E}\x{4F3F}\x{4F41}\x{4F42}\x{4F43}' .
+'\x{4F45}\x{4F46}\x{4F47}\x{4F48}\x{4F49}\x{4F4A}\x{4F4B}\x{4F4C}\x{4F4D}' .
+'\x{4F4E}\x{4F4F}\x{4F50}\x{4F51}\x{4F52}\x{4F53}\x{4F54}\x{4F55}\x{4F56}' .
+'\x{4F57}\x{4F58}\x{4F59}\x{4F5A}\x{4F5B}\x{4F5C}\x{4F5D}\x{4F5E}\x{4F5F}' .
+'\x{4F60}\x{4F61}\x{4F62}\x{4F63}\x{4F64}\x{4F65}\x{4F66}\x{4F67}\x{4F68}' .
+'\x{4F69}\x{4F6A}\x{4F6B}\x{4F6C}\x{4F6D}\x{4F6E}\x{4F6F}\x{4F70}\x{4F72}' .
+'\x{4F73}\x{4F74}\x{4F75}\x{4F76}\x{4F77}\x{4F78}\x{4F79}\x{4F7A}\x{4F7B}' .
+'\x{4F7C}\x{4F7D}\x{4F7E}\x{4F7F}\x{4F80}\x{4F81}\x{4F82}\x{4F83}\x{4F84}' .
+'\x{4F85}\x{4F86}\x{4F87}\x{4F88}\x{4F89}\x{4F8A}\x{4F8B}\x{4F8D}\x{4F8F}' .
+'\x{4F90}\x{4F91}\x{4F92}\x{4F93}\x{4F94}\x{4F95}\x{4F96}\x{4F97}\x{4F98}' .
+'\x{4F99}\x{4F9A}\x{4F9B}\x{4F9C}\x{4F9D}\x{4F9E}\x{4F9F}\x{4FA0}\x{4FA1}' .
+'\x{4FA3}\x{4FA4}\x{4FA5}\x{4FA6}\x{4FA7}\x{4FA8}\x{4FA9}\x{4FAA}\x{4FAB}' .
+'\x{4FAC}\x{4FAE}\x{4FAF}\x{4FB0}\x{4FB1}\x{4FB2}\x{4FB3}\x{4FB4}\x{4FB5}' .
+'\x{4FB6}\x{4FB7}\x{4FB8}\x{4FB9}\x{4FBA}\x{4FBB}\x{4FBC}\x{4FBE}\x{4FBF}' .
+'\x{4FC0}\x{4FC1}\x{4FC2}\x{4FC3}\x{4FC4}\x{4FC5}\x{4FC7}\x{4FC9}\x{4FCA}' .
+'\x{4FCB}\x{4FCD}\x{4FCE}\x{4FCF}\x{4FD0}\x{4FD1}\x{4FD2}\x{4FD3}\x{4FD4}' .
+'\x{4FD5}\x{4FD6}\x{4FD7}\x{4FD8}\x{4FD9}\x{4FDA}\x{4FDB}\x{4FDC}\x{4FDD}' .
+'\x{4FDE}\x{4FDF}\x{4FE0}\x{4FE1}\x{4FE3}\x{4FE4}\x{4FE5}\x{4FE6}\x{4FE7}' .
+'\x{4FE8}\x{4FE9}\x{4FEA}\x{4FEB}\x{4FEC}\x{4FED}\x{4FEE}\x{4FEF}\x{4FF0}' .
+'\x{4FF1}\x{4FF2}\x{4FF3}\x{4FF4}\x{4FF5}\x{4FF6}\x{4FF7}\x{4FF8}\x{4FF9}' .
+'\x{4FFA}\x{4FFB}\x{4FFE}\x{4FFF}\x{5000}\x{5001}\x{5002}\x{5003}\x{5004}' .
+'\x{5005}\x{5006}\x{5007}\x{5008}\x{5009}\x{500A}\x{500B}\x{500C}\x{500D}' .
+'\x{500E}\x{500F}\x{5011}\x{5012}\x{5013}\x{5014}\x{5015}\x{5016}\x{5017}' .
+'\x{5018}\x{5019}\x{501A}\x{501B}\x{501C}\x{501D}\x{501E}\x{501F}\x{5020}' .
+'\x{5021}\x{5022}\x{5023}\x{5024}\x{5025}\x{5026}\x{5027}\x{5028}\x{5029}' .
+'\x{502A}\x{502B}\x{502C}\x{502D}\x{502E}\x{502F}\x{5030}\x{5031}\x{5032}' .
+'\x{5033}\x{5035}\x{5036}\x{5037}\x{5039}\x{503A}\x{503B}\x{503C}\x{503E}' .
+'\x{503F}\x{5040}\x{5041}\x{5043}\x{5044}\x{5045}\x{5046}\x{5047}\x{5048}' .
+'\x{5049}\x{504A}\x{504B}\x{504C}\x{504D}\x{504E}\x{504F}\x{5051}\x{5053}' .
+'\x{5054}\x{5055}\x{5056}\x{5057}\x{5059}\x{505A}\x{505B}\x{505C}\x{505D}' .
+'\x{505E}\x{505F}\x{5060}\x{5061}\x{5062}\x{5063}\x{5064}\x{5065}\x{5066}' .
+'\x{5067}\x{5068}\x{5069}\x{506A}\x{506B}\x{506C}\x{506D}\x{506E}\x{506F}' .
+'\x{5070}\x{5071}\x{5072}\x{5073}\x{5074}\x{5075}\x{5076}\x{5077}\x{5078}' .
+'\x{5079}\x{507A}\x{507B}\x{507D}\x{507E}\x{507F}\x{5080}\x{5082}\x{5083}' .
+'\x{5084}\x{5085}\x{5086}\x{5087}\x{5088}\x{5089}\x{508A}\x{508B}\x{508C}' .
+'\x{508D}\x{508E}\x{508F}\x{5090}\x{5091}\x{5092}\x{5094}\x{5095}\x{5096}' .
+'\x{5098}\x{5099}\x{509A}\x{509B}\x{509C}\x{509D}\x{509E}\x{50A2}\x{50A3}' .
+'\x{50A4}\x{50A5}\x{50A6}\x{50A7}\x{50A8}\x{50A9}\x{50AA}\x{50AB}\x{50AC}' .
+'\x{50AD}\x{50AE}\x{50AF}\x{50B0}\x{50B1}\x{50B2}\x{50B3}\x{50B4}\x{50B5}' .
+'\x{50B6}\x{50B7}\x{50B8}\x{50BA}\x{50BB}\x{50BC}\x{50BD}\x{50BE}\x{50BF}' .
+'\x{50C0}\x{50C1}\x{50C2}\x{50C4}\x{50C5}\x{50C6}\x{50C7}\x{50C8}\x{50C9}' .
+'\x{50CA}\x{50CB}\x{50CC}\x{50CD}\x{50CE}\x{50CF}\x{50D0}\x{50D1}\x{50D2}' .
+'\x{50D3}\x{50D4}\x{50D5}\x{50D6}\x{50D7}\x{50D9}\x{50DA}\x{50DB}\x{50DC}' .
+'\x{50DD}\x{50DE}\x{50E0}\x{50E3}\x{50E4}\x{50E5}\x{50E6}\x{50E7}\x{50E8}' .
+'\x{50E9}\x{50EA}\x{50EC}\x{50ED}\x{50EE}\x{50EF}\x{50F0}\x{50F1}\x{50F2}' .
+'\x{50F3}\x{50F5}\x{50F6}\x{50F8}\x{50F9}\x{50FA}\x{50FB}\x{50FC}\x{50FD}' .
+'\x{50FE}\x{50FF}\x{5100}\x{5101}\x{5102}\x{5103}\x{5104}\x{5105}\x{5106}' .
+'\x{5107}\x{5108}\x{5109}\x{510A}\x{510B}\x{510C}\x{510D}\x{510E}\x{510F}' .
+'\x{5110}\x{5111}\x{5112}\x{5113}\x{5114}\x{5115}\x{5116}\x{5117}\x{5118}' .
+'\x{5119}\x{511A}\x{511C}\x{511D}\x{511E}\x{511F}\x{5120}\x{5121}\x{5122}' .
+'\x{5123}\x{5124}\x{5125}\x{5126}\x{5127}\x{5129}\x{512A}\x{512C}\x{512D}' .
+'\x{512E}\x{512F}\x{5130}\x{5131}\x{5132}\x{5133}\x{5134}\x{5135}\x{5136}' .
+'\x{5137}\x{5138}\x{5139}\x{513A}\x{513B}\x{513C}\x{513D}\x{513E}\x{513F}' .
+'\x{5140}\x{5141}\x{5143}\x{5144}\x{5145}\x{5146}\x{5147}\x{5148}\x{5149}' .
+'\x{514B}\x{514C}\x{514D}\x{514E}\x{5150}\x{5151}\x{5152}\x{5154}\x{5155}' .
+'\x{5156}\x{5157}\x{5159}\x{515A}\x{515B}\x{515C}\x{515D}\x{515E}\x{515F}' .
+'\x{5161}\x{5162}\x{5163}\x{5165}\x{5166}\x{5167}\x{5168}\x{5169}\x{516A}' .
+'\x{516B}\x{516C}\x{516D}\x{516E}\x{516F}\x{5170}\x{5171}\x{5173}\x{5174}' .
+'\x{5175}\x{5176}\x{5177}\x{5178}\x{5179}\x{517A}\x{517B}\x{517C}\x{517D}' .
+'\x{517F}\x{5180}\x{5181}\x{5182}\x{5185}\x{5186}\x{5187}\x{5188}\x{5189}' .
+'\x{518A}\x{518B}\x{518C}\x{518D}\x{518F}\x{5190}\x{5191}\x{5192}\x{5193}' .
+'\x{5194}\x{5195}\x{5196}\x{5197}\x{5198}\x{5199}\x{519A}\x{519B}\x{519C}' .
+'\x{519D}\x{519E}\x{519F}\x{51A0}\x{51A2}\x{51A4}\x{51A5}\x{51A6}\x{51A7}' .
+'\x{51A8}\x{51AA}\x{51AB}\x{51AC}\x{51AE}\x{51AF}\x{51B0}\x{51B1}\x{51B2}' .
+'\x{51B3}\x{51B5}\x{51B6}\x{51B7}\x{51B9}\x{51BB}\x{51BC}\x{51BD}\x{51BE}' .
+'\x{51BF}\x{51C0}\x{51C1}\x{51C3}\x{51C4}\x{51C5}\x{51C6}\x{51C7}\x{51C8}' .
+'\x{51C9}\x{51CA}\x{51CB}\x{51CC}\x{51CD}\x{51CE}\x{51CF}\x{51D0}\x{51D1}' .
+'\x{51D4}\x{51D5}\x{51D6}\x{51D7}\x{51D8}\x{51D9}\x{51DA}\x{51DB}\x{51DC}' .
+'\x{51DD}\x{51DE}\x{51E0}\x{51E1}\x{51E2}\x{51E3}\x{51E4}\x{51E5}\x{51E7}' .
+'\x{51E8}\x{51E9}\x{51EA}\x{51EB}\x{51ED}\x{51EF}\x{51F0}\x{51F1}\x{51F3}' .
+'\x{51F4}\x{51F5}\x{51F6}\x{51F7}\x{51F8}\x{51F9}\x{51FA}\x{51FB}\x{51FC}' .
+'\x{51FD}\x{51FE}\x{51FF}\x{5200}\x{5201}\x{5202}\x{5203}\x{5204}\x{5205}' .
+'\x{5206}\x{5207}\x{5208}\x{5209}\x{520A}\x{520B}\x{520C}\x{520D}\x{520E}' .
+'\x{520F}\x{5210}\x{5211}\x{5212}\x{5213}\x{5214}\x{5215}\x{5216}\x{5217}' .
+'\x{5218}\x{5219}\x{521A}\x{521B}\x{521C}\x{521D}\x{521E}\x{521F}\x{5220}' .
+'\x{5221}\x{5222}\x{5223}\x{5224}\x{5225}\x{5226}\x{5228}\x{5229}\x{522A}' .
+'\x{522B}\x{522C}\x{522D}\x{522E}\x{522F}\x{5230}\x{5231}\x{5232}\x{5233}' .
+'\x{5234}\x{5235}\x{5236}\x{5237}\x{5238}\x{5239}\x{523A}\x{523B}\x{523C}' .
+'\x{523D}\x{523E}\x{523F}\x{5240}\x{5241}\x{5242}\x{5243}\x{5244}\x{5245}' .
+'\x{5246}\x{5247}\x{5248}\x{5249}\x{524A}\x{524B}\x{524C}\x{524D}\x{524E}' .
+'\x{5250}\x{5251}\x{5252}\x{5254}\x{5255}\x{5256}\x{5257}\x{5258}\x{5259}' .
+'\x{525A}\x{525B}\x{525C}\x{525D}\x{525E}\x{525F}\x{5260}\x{5261}\x{5262}' .
+'\x{5263}\x{5264}\x{5265}\x{5267}\x{5268}\x{5269}\x{526A}\x{526B}\x{526C}' .
+'\x{526D}\x{526E}\x{526F}\x{5270}\x{5272}\x{5273}\x{5274}\x{5275}\x{5276}' .
+'\x{5277}\x{5278}\x{527A}\x{527B}\x{527C}\x{527D}\x{527E}\x{527F}\x{5280}' .
+'\x{5281}\x{5282}\x{5283}\x{5284}\x{5286}\x{5287}\x{5288}\x{5289}\x{528A}' .
+'\x{528B}\x{528C}\x{528D}\x{528F}\x{5290}\x{5291}\x{5292}\x{5293}\x{5294}' .
+'\x{5295}\x{5296}\x{5297}\x{5298}\x{5299}\x{529A}\x{529B}\x{529C}\x{529D}' .
+'\x{529E}\x{529F}\x{52A0}\x{52A1}\x{52A2}\x{52A3}\x{52A5}\x{52A6}\x{52A7}' .
+'\x{52A8}\x{52A9}\x{52AA}\x{52AB}\x{52AC}\x{52AD}\x{52AE}\x{52AF}\x{52B0}' .
+'\x{52B1}\x{52B2}\x{52B3}\x{52B4}\x{52B5}\x{52B6}\x{52B7}\x{52B8}\x{52B9}' .
+'\x{52BA}\x{52BB}\x{52BC}\x{52BD}\x{52BE}\x{52BF}\x{52C0}\x{52C1}\x{52C2}' .
+'\x{52C3}\x{52C6}\x{52C7}\x{52C9}\x{52CA}\x{52CB}\x{52CD}\x{52CF}\x{52D0}' .
+'\x{52D2}\x{52D3}\x{52D5}\x{52D6}\x{52D7}\x{52D8}\x{52D9}\x{52DA}\x{52DB}' .
+'\x{52DC}\x{52DD}\x{52DE}\x{52DF}\x{52E0}\x{52E2}\x{52E3}\x{52E4}\x{52E6}' .
+'\x{52E7}\x{52E8}\x{52E9}\x{52EA}\x{52EB}\x{52EC}\x{52ED}\x{52EF}\x{52F0}' .
+'\x{52F1}\x{52F2}\x{52F3}\x{52F4}\x{52F5}\x{52F6}\x{52F7}\x{52F8}\x{52F9}' .
+'\x{52FA}\x{52FB}\x{52FC}\x{52FD}\x{52FE}\x{52FF}\x{5300}\x{5301}\x{5302}' .
+'\x{5305}\x{5306}\x{5307}\x{5308}\x{5309}\x{530A}\x{530B}\x{530C}\x{530D}' .
+'\x{530E}\x{530F}\x{5310}\x{5311}\x{5312}\x{5313}\x{5314}\x{5315}\x{5316}' .
+'\x{5317}\x{5319}\x{531A}\x{531C}\x{531D}\x{531F}\x{5320}\x{5321}\x{5322}' .
+'\x{5323}\x{5324}\x{5325}\x{5326}\x{5328}\x{532A}\x{532B}\x{532C}\x{532D}' .
+'\x{532E}\x{532F}\x{5330}\x{5331}\x{5333}\x{5334}\x{5337}\x{5339}\x{533A}' .
+'\x{533B}\x{533C}\x{533D}\x{533E}\x{533F}\x{5340}\x{5341}\x{5343}\x{5344}' .
+'\x{5345}\x{5346}\x{5347}\x{5348}\x{5349}\x{534A}\x{534B}\x{534C}\x{534D}' .
+'\x{534E}\x{534F}\x{5350}\x{5351}\x{5352}\x{5353}\x{5354}\x{5355}\x{5356}' .
+'\x{5357}\x{5358}\x{5359}\x{535A}\x{535C}\x{535E}\x{535F}\x{5360}\x{5361}' .
+'\x{5362}\x{5363}\x{5364}\x{5365}\x{5366}\x{5367}\x{5369}\x{536B}\x{536C}' .
+'\x{536E}\x{536F}\x{5370}\x{5371}\x{5372}\x{5373}\x{5374}\x{5375}\x{5376}' .
+'\x{5377}\x{5378}\x{5379}\x{537A}\x{537B}\x{537C}\x{537D}\x{537E}\x{537F}' .
+'\x{5381}\x{5382}\x{5383}\x{5384}\x{5385}\x{5386}\x{5387}\x{5388}\x{5389}' .
+'\x{538A}\x{538B}\x{538C}\x{538D}\x{538E}\x{538F}\x{5390}\x{5391}\x{5392}' .
+'\x{5393}\x{5394}\x{5395}\x{5396}\x{5397}\x{5398}\x{5399}\x{539A}\x{539B}' .
+'\x{539C}\x{539D}\x{539E}\x{539F}\x{53A0}\x{53A2}\x{53A3}\x{53A4}\x{53A5}' .
+'\x{53A6}\x{53A7}\x{53A8}\x{53A9}\x{53AC}\x{53AD}\x{53AE}\x{53B0}\x{53B1}' .
+'\x{53B2}\x{53B3}\x{53B4}\x{53B5}\x{53B6}\x{53B7}\x{53B8}\x{53B9}\x{53BB}' .
+'\x{53BC}\x{53BD}\x{53BE}\x{53BF}\x{53C0}\x{53C1}\x{53C2}\x{53C3}\x{53C4}' .
+'\x{53C6}\x{53C7}\x{53C8}\x{53C9}\x{53CA}\x{53CB}\x{53CC}\x{53CD}\x{53CE}' .
+'\x{53D0}\x{53D1}\x{53D2}\x{53D3}\x{53D4}\x{53D5}\x{53D6}\x{53D7}\x{53D8}' .
+'\x{53D9}\x{53DB}\x{53DC}\x{53DF}\x{53E0}\x{53E1}\x{53E2}\x{53E3}\x{53E4}' .
+'\x{53E5}\x{53E6}\x{53E8}\x{53E9}\x{53EA}\x{53EB}\x{53EC}\x{53ED}\x{53EE}' .
+'\x{53EF}\x{53F0}\x{53F1}\x{53F2}\x{53F3}\x{53F4}\x{53F5}\x{53F6}\x{53F7}' .
+'\x{53F8}\x{53F9}\x{53FA}\x{53FB}\x{53FC}\x{53FD}\x{53FE}\x{5401}\x{5402}' .
+'\x{5403}\x{5404}\x{5405}\x{5406}\x{5407}\x{5408}\x{5409}\x{540A}\x{540B}' .
+'\x{540C}\x{540D}\x{540E}\x{540F}\x{5410}\x{5411}\x{5412}\x{5413}\x{5414}' .
+'\x{5415}\x{5416}\x{5417}\x{5418}\x{5419}\x{541B}\x{541C}\x{541D}\x{541E}' .
+'\x{541F}\x{5420}\x{5421}\x{5423}\x{5424}\x{5425}\x{5426}\x{5427}\x{5428}' .
+'\x{5429}\x{542A}\x{542B}\x{542C}\x{542D}\x{542E}\x{542F}\x{5430}\x{5431}' .
+'\x{5432}\x{5433}\x{5434}\x{5435}\x{5436}\x{5437}\x{5438}\x{5439}\x{543A}' .
+'\x{543B}\x{543C}\x{543D}\x{543E}\x{543F}\x{5440}\x{5441}\x{5442}\x{5443}' .
+'\x{5444}\x{5445}\x{5446}\x{5447}\x{5448}\x{5449}\x{544A}\x{544B}\x{544D}' .
+'\x{544E}\x{544F}\x{5450}\x{5451}\x{5452}\x{5453}\x{5454}\x{5455}\x{5456}' .
+'\x{5457}\x{5458}\x{5459}\x{545A}\x{545B}\x{545C}\x{545E}\x{545F}\x{5460}' .
+'\x{5461}\x{5462}\x{5463}\x{5464}\x{5465}\x{5466}\x{5467}\x{5468}\x{546A}' .
+'\x{546B}\x{546C}\x{546D}\x{546E}\x{546F}\x{5470}\x{5471}\x{5472}\x{5473}' .
+'\x{5474}\x{5475}\x{5476}\x{5477}\x{5478}\x{5479}\x{547A}\x{547B}\x{547C}' .
+'\x{547D}\x{547E}\x{547F}\x{5480}\x{5481}\x{5482}\x{5483}\x{5484}\x{5485}' .
+'\x{5486}\x{5487}\x{5488}\x{5489}\x{548B}\x{548C}\x{548D}\x{548E}\x{548F}' .
+'\x{5490}\x{5491}\x{5492}\x{5493}\x{5494}\x{5495}\x{5496}\x{5497}\x{5498}' .
+'\x{5499}\x{549A}\x{549B}\x{549C}\x{549D}\x{549E}\x{549F}\x{54A0}\x{54A1}' .
+'\x{54A2}\x{54A3}\x{54A4}\x{54A5}\x{54A6}\x{54A7}\x{54A8}\x{54A9}\x{54AA}' .
+'\x{54AB}\x{54AC}\x{54AD}\x{54AE}\x{54AF}\x{54B0}\x{54B1}\x{54B2}\x{54B3}' .
+'\x{54B4}\x{54B6}\x{54B7}\x{54B8}\x{54B9}\x{54BA}\x{54BB}\x{54BC}\x{54BD}' .
+'\x{54BE}\x{54BF}\x{54C0}\x{54C1}\x{54C2}\x{54C3}\x{54C4}\x{54C5}\x{54C6}' .
+'\x{54C7}\x{54C8}\x{54C9}\x{54CA}\x{54CB}\x{54CC}\x{54CD}\x{54CE}\x{54CF}' .
+'\x{54D0}\x{54D1}\x{54D2}\x{54D3}\x{54D4}\x{54D5}\x{54D6}\x{54D7}\x{54D8}' .
+'\x{54D9}\x{54DA}\x{54DB}\x{54DC}\x{54DD}\x{54DE}\x{54DF}\x{54E0}\x{54E1}' .
+'\x{54E2}\x{54E3}\x{54E4}\x{54E5}\x{54E6}\x{54E7}\x{54E8}\x{54E9}\x{54EA}' .
+'\x{54EB}\x{54EC}\x{54ED}\x{54EE}\x{54EF}\x{54F0}\x{54F1}\x{54F2}\x{54F3}' .
+'\x{54F4}\x{54F5}\x{54F7}\x{54F8}\x{54F9}\x{54FA}\x{54FB}\x{54FC}\x{54FD}' .
+'\x{54FE}\x{54FF}\x{5500}\x{5501}\x{5502}\x{5503}\x{5504}\x{5505}\x{5506}' .
+'\x{5507}\x{5508}\x{5509}\x{550A}\x{550B}\x{550C}\x{550D}\x{550E}\x{550F}' .
+'\x{5510}\x{5511}\x{5512}\x{5513}\x{5514}\x{5516}\x{5517}\x{551A}\x{551B}' .
+'\x{551C}\x{551D}\x{551E}\x{551F}\x{5520}\x{5521}\x{5522}\x{5523}\x{5524}' .
+'\x{5525}\x{5526}\x{5527}\x{5528}\x{5529}\x{552A}\x{552B}\x{552C}\x{552D}' .
+'\x{552E}\x{552F}\x{5530}\x{5531}\x{5532}\x{5533}\x{5534}\x{5535}\x{5536}' .
+'\x{5537}\x{5538}\x{5539}\x{553A}\x{553B}\x{553C}\x{553D}\x{553E}\x{553F}' .
+'\x{5540}\x{5541}\x{5542}\x{5543}\x{5544}\x{5545}\x{5546}\x{5548}\x{5549}' .
+'\x{554A}\x{554B}\x{554C}\x{554D}\x{554E}\x{554F}\x{5550}\x{5551}\x{5552}' .
+'\x{5553}\x{5554}\x{5555}\x{5556}\x{5557}\x{5558}\x{5559}\x{555A}\x{555B}' .
+'\x{555C}\x{555D}\x{555E}\x{555F}\x{5561}\x{5562}\x{5563}\x{5564}\x{5565}' .
+'\x{5566}\x{5567}\x{5568}\x{5569}\x{556A}\x{556B}\x{556C}\x{556D}\x{556E}' .
+'\x{556F}\x{5570}\x{5571}\x{5572}\x{5573}\x{5574}\x{5575}\x{5576}\x{5577}' .
+'\x{5578}\x{5579}\x{557B}\x{557C}\x{557D}\x{557E}\x{557F}\x{5580}\x{5581}' .
+'\x{5582}\x{5583}\x{5584}\x{5585}\x{5586}\x{5587}\x{5588}\x{5589}\x{558A}' .
+'\x{558B}\x{558C}\x{558D}\x{558E}\x{558F}\x{5590}\x{5591}\x{5592}\x{5593}' .
+'\x{5594}\x{5595}\x{5596}\x{5597}\x{5598}\x{5599}\x{559A}\x{559B}\x{559C}' .
+'\x{559D}\x{559E}\x{559F}\x{55A0}\x{55A1}\x{55A2}\x{55A3}\x{55A4}\x{55A5}' .
+'\x{55A6}\x{55A7}\x{55A8}\x{55A9}\x{55AA}\x{55AB}\x{55AC}\x{55AD}\x{55AE}' .
+'\x{55AF}\x{55B0}\x{55B1}\x{55B2}\x{55B3}\x{55B4}\x{55B5}\x{55B6}\x{55B7}' .
+'\x{55B8}\x{55B9}\x{55BA}\x{55BB}\x{55BC}\x{55BD}\x{55BE}\x{55BF}\x{55C0}' .
+'\x{55C1}\x{55C2}\x{55C3}\x{55C4}\x{55C5}\x{55C6}\x{55C7}\x{55C8}\x{55C9}' .
+'\x{55CA}\x{55CB}\x{55CC}\x{55CD}\x{55CE}\x{55CF}\x{55D0}\x{55D1}\x{55D2}' .
+'\x{55D3}\x{55D4}\x{55D5}\x{55D6}\x{55D7}\x{55D8}\x{55D9}\x{55DA}\x{55DB}' .
+'\x{55DC}\x{55DD}\x{55DE}\x{55DF}\x{55E1}\x{55E2}\x{55E3}\x{55E4}\x{55E5}' .
+'\x{55E6}\x{55E7}\x{55E8}\x{55E9}\x{55EA}\x{55EB}\x{55EC}\x{55ED}\x{55EE}' .
+'\x{55EF}\x{55F0}\x{55F1}\x{55F2}\x{55F3}\x{55F4}\x{55F5}\x{55F6}\x{55F7}' .
+'\x{55F9}\x{55FA}\x{55FB}\x{55FC}\x{55FD}\x{55FE}\x{55FF}\x{5600}\x{5601}' .
+'\x{5602}\x{5603}\x{5604}\x{5606}\x{5607}\x{5608}\x{5609}\x{560C}\x{560D}' .
+'\x{560E}\x{560F}\x{5610}\x{5611}\x{5612}\x{5613}\x{5614}\x{5615}\x{5616}' .
+'\x{5617}\x{5618}\x{5619}\x{561A}\x{561B}\x{561C}\x{561D}\x{561E}\x{561F}' .
+'\x{5621}\x{5622}\x{5623}\x{5624}\x{5625}\x{5626}\x{5627}\x{5628}\x{5629}' .
+'\x{562A}\x{562C}\x{562D}\x{562E}\x{562F}\x{5630}\x{5631}\x{5632}\x{5633}' .
+'\x{5634}\x{5635}\x{5636}\x{5638}\x{5639}\x{563A}\x{563B}\x{563D}\x{563E}' .
+'\x{563F}\x{5640}\x{5641}\x{5642}\x{5643}\x{5645}\x{5646}\x{5647}\x{5648}' .
+'\x{5649}\x{564A}\x{564C}\x{564D}\x{564E}\x{564F}\x{5650}\x{5652}\x{5653}' .
+'\x{5654}\x{5655}\x{5657}\x{5658}\x{5659}\x{565A}\x{565B}\x{565C}\x{565D}' .
+'\x{565E}\x{5660}\x{5662}\x{5663}\x{5664}\x{5665}\x{5666}\x{5667}\x{5668}' .
+'\x{5669}\x{566A}\x{566B}\x{566C}\x{566D}\x{566E}\x{566F}\x{5670}\x{5671}' .
+'\x{5672}\x{5673}\x{5674}\x{5676}\x{5677}\x{5678}\x{5679}\x{567A}\x{567B}' .
+'\x{567C}\x{567E}\x{567F}\x{5680}\x{5681}\x{5682}\x{5683}\x{5684}\x{5685}' .
+'\x{5686}\x{5687}\x{568A}\x{568C}\x{568D}\x{568E}\x{568F}\x{5690}\x{5691}' .
+'\x{5692}\x{5693}\x{5694}\x{5695}\x{5697}\x{5698}\x{5699}\x{569A}\x{569B}' .
+'\x{569C}\x{569D}\x{569F}\x{56A0}\x{56A1}\x{56A3}\x{56A4}\x{56A5}\x{56A6}' .
+'\x{56A7}\x{56A8}\x{56A9}\x{56AA}\x{56AB}\x{56AC}\x{56AD}\x{56AE}\x{56AF}' .
+'\x{56B0}\x{56B1}\x{56B2}\x{56B3}\x{56B4}\x{56B5}\x{56B6}\x{56B7}\x{56B8}' .
+'\x{56B9}\x{56BB}\x{56BC}\x{56BD}\x{56BE}\x{56BF}\x{56C0}\x{56C1}\x{56C2}' .
+'\x{56C3}\x{56C4}\x{56C5}\x{56C6}\x{56C7}\x{56C8}\x{56C9}\x{56CA}\x{56CB}' .
+'\x{56CC}\x{56CD}\x{56CE}\x{56D0}\x{56D1}\x{56D2}\x{56D3}\x{56D4}\x{56D5}' .
+'\x{56D6}\x{56D7}\x{56D8}\x{56DA}\x{56DB}\x{56DC}\x{56DD}\x{56DE}\x{56DF}' .
+'\x{56E0}\x{56E1}\x{56E2}\x{56E3}\x{56E4}\x{56E5}\x{56E7}\x{56E8}\x{56E9}' .
+'\x{56EA}\x{56EB}\x{56EC}\x{56ED}\x{56EE}\x{56EF}\x{56F0}\x{56F1}\x{56F2}' .
+'\x{56F3}\x{56F4}\x{56F5}\x{56F7}\x{56F9}\x{56FA}\x{56FD}\x{56FE}\x{56FF}' .
+'\x{5700}\x{5701}\x{5702}\x{5703}\x{5704}\x{5706}\x{5707}\x{5708}\x{5709}' .
+'\x{570A}\x{570B}\x{570C}\x{570D}\x{570E}\x{570F}\x{5710}\x{5712}\x{5713}' .
+'\x{5714}\x{5715}\x{5716}\x{5718}\x{5719}\x{571A}\x{571B}\x{571C}\x{571D}' .
+'\x{571E}\x{571F}\x{5720}\x{5722}\x{5723}\x{5725}\x{5726}\x{5727}\x{5728}' .
+'\x{5729}\x{572A}\x{572B}\x{572C}\x{572D}\x{572E}\x{572F}\x{5730}\x{5731}' .
+'\x{5732}\x{5733}\x{5734}\x{5735}\x{5736}\x{5737}\x{5738}\x{5739}\x{573A}' .
+'\x{573B}\x{573C}\x{573E}\x{573F}\x{5740}\x{5741}\x{5742}\x{5744}\x{5745}' .
+'\x{5746}\x{5747}\x{5749}\x{574A}\x{574B}\x{574C}\x{574D}\x{574E}\x{574F}' .
+'\x{5750}\x{5751}\x{5752}\x{5753}\x{5754}\x{5757}\x{5759}\x{575A}\x{575B}' .
+'\x{575C}\x{575D}\x{575E}\x{575F}\x{5760}\x{5761}\x{5762}\x{5764}\x{5765}' .
+'\x{5766}\x{5767}\x{5768}\x{5769}\x{576A}\x{576B}\x{576C}\x{576D}\x{576F}' .
+'\x{5770}\x{5771}\x{5772}\x{5773}\x{5774}\x{5775}\x{5776}\x{5777}\x{5779}' .
+'\x{577A}\x{577B}\x{577C}\x{577D}\x{577E}\x{577F}\x{5780}\x{5782}\x{5783}' .
+'\x{5784}\x{5785}\x{5786}\x{5788}\x{5789}\x{578A}\x{578B}\x{578C}\x{578D}' .
+'\x{578E}\x{578F}\x{5790}\x{5791}\x{5792}\x{5793}\x{5794}\x{5795}\x{5797}' .
+'\x{5798}\x{5799}\x{579A}\x{579B}\x{579C}\x{579D}\x{579E}\x{579F}\x{57A0}' .
+'\x{57A1}\x{57A2}\x{57A3}\x{57A4}\x{57A5}\x{57A6}\x{57A7}\x{57A9}\x{57AA}' .
+'\x{57AB}\x{57AC}\x{57AD}\x{57AE}\x{57AF}\x{57B0}\x{57B1}\x{57B2}\x{57B3}' .
+'\x{57B4}\x{57B5}\x{57B6}\x{57B7}\x{57B8}\x{57B9}\x{57BA}\x{57BB}\x{57BC}' .
+'\x{57BD}\x{57BE}\x{57BF}\x{57C0}\x{57C1}\x{57C2}\x{57C3}\x{57C4}\x{57C5}' .
+'\x{57C6}\x{57C7}\x{57C8}\x{57C9}\x{57CB}\x{57CC}\x{57CD}\x{57CE}\x{57CF}' .
+'\x{57D0}\x{57D2}\x{57D3}\x{57D4}\x{57D5}\x{57D6}\x{57D8}\x{57D9}\x{57DA}' .
+'\x{57DC}\x{57DD}\x{57DF}\x{57E0}\x{57E1}\x{57E2}\x{57E3}\x{57E4}\x{57E5}' .
+'\x{57E6}\x{57E7}\x{57E8}\x{57E9}\x{57EA}\x{57EB}\x{57EC}\x{57ED}\x{57EE}' .
+'\x{57EF}\x{57F0}\x{57F1}\x{57F2}\x{57F3}\x{57F4}\x{57F5}\x{57F6}\x{57F7}' .
+'\x{57F8}\x{57F9}\x{57FA}\x{57FB}\x{57FC}\x{57FD}\x{57FE}\x{57FF}\x{5800}' .
+'\x{5801}\x{5802}\x{5803}\x{5804}\x{5805}\x{5806}\x{5807}\x{5808}\x{5809}' .
+'\x{580A}\x{580B}\x{580C}\x{580D}\x{580E}\x{580F}\x{5810}\x{5811}\x{5812}' .
+'\x{5813}\x{5814}\x{5815}\x{5816}\x{5819}\x{581A}\x{581B}\x{581C}\x{581D}' .
+'\x{581E}\x{581F}\x{5820}\x{5821}\x{5822}\x{5823}\x{5824}\x{5825}\x{5826}' .
+'\x{5827}\x{5828}\x{5829}\x{582A}\x{582B}\x{582C}\x{582D}\x{582E}\x{582F}' .
+'\x{5830}\x{5831}\x{5832}\x{5833}\x{5834}\x{5835}\x{5836}\x{5837}\x{5838}' .
+'\x{5839}\x{583A}\x{583B}\x{583C}\x{583D}\x{583E}\x{583F}\x{5840}\x{5842}' .
+'\x{5843}\x{5844}\x{5845}\x{5846}\x{5847}\x{5848}\x{5849}\x{584A}\x{584B}' .
+'\x{584C}\x{584D}\x{584E}\x{584F}\x{5851}\x{5852}\x{5853}\x{5854}\x{5855}' .
+'\x{5857}\x{5858}\x{5859}\x{585A}\x{585B}\x{585C}\x{585D}\x{585E}\x{585F}' .
+'\x{5861}\x{5862}\x{5863}\x{5864}\x{5865}\x{5868}\x{5869}\x{586A}\x{586B}' .
+'\x{586C}\x{586D}\x{586E}\x{586F}\x{5870}\x{5871}\x{5872}\x{5873}\x{5874}' .
+'\x{5875}\x{5876}\x{5878}\x{5879}\x{587A}\x{587B}\x{587C}\x{587D}\x{587E}' .
+'\x{587F}\x{5880}\x{5881}\x{5882}\x{5883}\x{5884}\x{5885}\x{5886}\x{5887}' .
+'\x{5888}\x{5889}\x{588A}\x{588B}\x{588C}\x{588D}\x{588E}\x{588F}\x{5890}' .
+'\x{5891}\x{5892}\x{5893}\x{5894}\x{5896}\x{5897}\x{5898}\x{5899}\x{589A}' .
+'\x{589B}\x{589C}\x{589D}\x{589E}\x{589F}\x{58A0}\x{58A1}\x{58A2}\x{58A3}' .
+'\x{58A4}\x{58A5}\x{58A6}\x{58A7}\x{58A8}\x{58A9}\x{58AB}\x{58AC}\x{58AD}' .
+'\x{58AE}\x{58AF}\x{58B0}\x{58B1}\x{58B2}\x{58B3}\x{58B4}\x{58B7}\x{58B8}' .
+'\x{58B9}\x{58BA}\x{58BB}\x{58BC}\x{58BD}\x{58BE}\x{58BF}\x{58C1}\x{58C2}' .
+'\x{58C5}\x{58C6}\x{58C7}\x{58C8}\x{58C9}\x{58CA}\x{58CB}\x{58CE}\x{58CF}' .
+'\x{58D1}\x{58D2}\x{58D3}\x{58D4}\x{58D5}\x{58D6}\x{58D7}\x{58D8}\x{58D9}' .
+'\x{58DA}\x{58DB}\x{58DD}\x{58DE}\x{58DF}\x{58E0}\x{58E2}\x{58E3}\x{58E4}' .
+'\x{58E5}\x{58E7}\x{58E8}\x{58E9}\x{58EA}\x{58EB}\x{58EC}\x{58ED}\x{58EE}' .
+'\x{58EF}\x{58F0}\x{58F1}\x{58F2}\x{58F3}\x{58F4}\x{58F6}\x{58F7}\x{58F8}' .
+'\x{58F9}\x{58FA}\x{58FB}\x{58FC}\x{58FD}\x{58FE}\x{58FF}\x{5900}\x{5902}' .
+'\x{5903}\x{5904}\x{5906}\x{5907}\x{5909}\x{590A}\x{590B}\x{590C}\x{590D}' .
+'\x{590E}\x{590F}\x{5910}\x{5912}\x{5914}\x{5915}\x{5916}\x{5917}\x{5918}' .
+'\x{5919}\x{591A}\x{591B}\x{591C}\x{591D}\x{591E}\x{591F}\x{5920}\x{5921}' .
+'\x{5922}\x{5924}\x{5925}\x{5926}\x{5927}\x{5928}\x{5929}\x{592A}\x{592B}' .
+'\x{592C}\x{592D}\x{592E}\x{592F}\x{5930}\x{5931}\x{5932}\x{5934}\x{5935}' .
+'\x{5937}\x{5938}\x{5939}\x{593A}\x{593B}\x{593C}\x{593D}\x{593E}\x{593F}' .
+'\x{5940}\x{5941}\x{5942}\x{5943}\x{5944}\x{5945}\x{5946}\x{5947}\x{5948}' .
+'\x{5949}\x{594A}\x{594B}\x{594C}\x{594D}\x{594E}\x{594F}\x{5950}\x{5951}' .
+'\x{5952}\x{5953}\x{5954}\x{5955}\x{5956}\x{5957}\x{5958}\x{595A}\x{595C}' .
+'\x{595D}\x{595E}\x{595F}\x{5960}\x{5961}\x{5962}\x{5963}\x{5964}\x{5965}' .
+'\x{5966}\x{5967}\x{5968}\x{5969}\x{596A}\x{596B}\x{596C}\x{596D}\x{596E}' .
+'\x{596F}\x{5970}\x{5971}\x{5972}\x{5973}\x{5974}\x{5975}\x{5976}\x{5977}' .
+'\x{5978}\x{5979}\x{597A}\x{597B}\x{597C}\x{597D}\x{597E}\x{597F}\x{5980}' .
+'\x{5981}\x{5982}\x{5983}\x{5984}\x{5985}\x{5986}\x{5987}\x{5988}\x{5989}' .
+'\x{598A}\x{598B}\x{598C}\x{598D}\x{598E}\x{598F}\x{5990}\x{5991}\x{5992}' .
+'\x{5993}\x{5994}\x{5995}\x{5996}\x{5997}\x{5998}\x{5999}\x{599A}\x{599C}' .
+'\x{599D}\x{599E}\x{599F}\x{59A0}\x{59A1}\x{59A2}\x{59A3}\x{59A4}\x{59A5}' .
+'\x{59A6}\x{59A7}\x{59A8}\x{59A9}\x{59AA}\x{59AB}\x{59AC}\x{59AD}\x{59AE}' .
+'\x{59AF}\x{59B0}\x{59B1}\x{59B2}\x{59B3}\x{59B4}\x{59B5}\x{59B6}\x{59B8}' .
+'\x{59B9}\x{59BA}\x{59BB}\x{59BC}\x{59BD}\x{59BE}\x{59BF}\x{59C0}\x{59C1}' .
+'\x{59C2}\x{59C3}\x{59C4}\x{59C5}\x{59C6}\x{59C7}\x{59C8}\x{59C9}\x{59CA}' .
+'\x{59CB}\x{59CC}\x{59CD}\x{59CE}\x{59CF}\x{59D0}\x{59D1}\x{59D2}\x{59D3}' .
+'\x{59D4}\x{59D5}\x{59D6}\x{59D7}\x{59D8}\x{59D9}\x{59DA}\x{59DB}\x{59DC}' .
+'\x{59DD}\x{59DE}\x{59DF}\x{59E0}\x{59E1}\x{59E2}\x{59E3}\x{59E4}\x{59E5}' .
+'\x{59E6}\x{59E8}\x{59E9}\x{59EA}\x{59EB}\x{59EC}\x{59ED}\x{59EE}\x{59EF}' .
+'\x{59F0}\x{59F1}\x{59F2}\x{59F3}\x{59F4}\x{59F5}\x{59F6}\x{59F7}\x{59F8}' .
+'\x{59F9}\x{59FA}\x{59FB}\x{59FC}\x{59FD}\x{59FE}\x{59FF}\x{5A00}\x{5A01}' .
+'\x{5A02}\x{5A03}\x{5A04}\x{5A05}\x{5A06}\x{5A07}\x{5A08}\x{5A09}\x{5A0A}' .
+'\x{5A0B}\x{5A0C}\x{5A0D}\x{5A0E}\x{5A0F}\x{5A10}\x{5A11}\x{5A12}\x{5A13}' .
+'\x{5A14}\x{5A15}\x{5A16}\x{5A17}\x{5A18}\x{5A19}\x{5A1A}\x{5A1B}\x{5A1C}' .
+'\x{5A1D}\x{5A1E}\x{5A1F}\x{5A20}\x{5A21}\x{5A22}\x{5A23}\x{5A25}\x{5A27}' .
+'\x{5A28}\x{5A29}\x{5A2A}\x{5A2B}\x{5A2D}\x{5A2E}\x{5A2F}\x{5A31}\x{5A32}' .
+'\x{5A33}\x{5A34}\x{5A35}\x{5A36}\x{5A37}\x{5A38}\x{5A39}\x{5A3A}\x{5A3B}' .
+'\x{5A3C}\x{5A3D}\x{5A3E}\x{5A3F}\x{5A40}\x{5A41}\x{5A42}\x{5A43}\x{5A44}' .
+'\x{5A45}\x{5A46}\x{5A47}\x{5A48}\x{5A49}\x{5A4A}\x{5A4B}\x{5A4C}\x{5A4D}' .
+'\x{5A4E}\x{5A4F}\x{5A50}\x{5A51}\x{5A52}\x{5A53}\x{5A55}\x{5A56}\x{5A57}' .
+'\x{5A58}\x{5A5A}\x{5A5B}\x{5A5C}\x{5A5D}\x{5A5E}\x{5A5F}\x{5A60}\x{5A61}' .
+'\x{5A62}\x{5A63}\x{5A64}\x{5A65}\x{5A66}\x{5A67}\x{5A68}\x{5A69}\x{5A6A}' .
+'\x{5A6B}\x{5A6C}\x{5A6D}\x{5A6E}\x{5A70}\x{5A72}\x{5A73}\x{5A74}\x{5A75}' .
+'\x{5A76}\x{5A77}\x{5A78}\x{5A79}\x{5A7A}\x{5A7B}\x{5A7C}\x{5A7D}\x{5A7E}' .
+'\x{5A7F}\x{5A80}\x{5A81}\x{5A82}\x{5A83}\x{5A84}\x{5A85}\x{5A86}\x{5A88}' .
+'\x{5A89}\x{5A8A}\x{5A8B}\x{5A8C}\x{5A8E}\x{5A8F}\x{5A90}\x{5A91}\x{5A92}' .
+'\x{5A93}\x{5A94}\x{5A95}\x{5A96}\x{5A97}\x{5A98}\x{5A99}\x{5A9A}\x{5A9B}' .
+'\x{5A9C}\x{5A9D}\x{5A9E}\x{5A9F}\x{5AA0}\x{5AA1}\x{5AA2}\x{5AA3}\x{5AA4}' .
+'\x{5AA5}\x{5AA6}\x{5AA7}\x{5AA8}\x{5AA9}\x{5AAA}\x{5AAC}\x{5AAD}\x{5AAE}' .
+'\x{5AAF}\x{5AB0}\x{5AB1}\x{5AB2}\x{5AB3}\x{5AB4}\x{5AB5}\x{5AB6}\x{5AB7}' .
+'\x{5AB8}\x{5AB9}\x{5ABA}\x{5ABB}\x{5ABC}\x{5ABD}\x{5ABE}\x{5ABF}\x{5AC0}' .
+'\x{5AC1}\x{5AC2}\x{5AC3}\x{5AC4}\x{5AC5}\x{5AC6}\x{5AC7}\x{5AC8}\x{5AC9}' .
+'\x{5ACA}\x{5ACB}\x{5ACC}\x{5ACD}\x{5ACE}\x{5ACF}\x{5AD1}\x{5AD2}\x{5AD4}' .
+'\x{5AD5}\x{5AD6}\x{5AD7}\x{5AD8}\x{5AD9}\x{5ADA}\x{5ADB}\x{5ADC}\x{5ADD}' .
+'\x{5ADE}\x{5ADF}\x{5AE0}\x{5AE1}\x{5AE2}\x{5AE3}\x{5AE4}\x{5AE5}\x{5AE6}' .
+'\x{5AE7}\x{5AE8}\x{5AE9}\x{5AEA}\x{5AEB}\x{5AEC}\x{5AED}\x{5AEE}\x{5AF1}' .
+'\x{5AF2}\x{5AF3}\x{5AF4}\x{5AF5}\x{5AF6}\x{5AF7}\x{5AF8}\x{5AF9}\x{5AFA}' .
+'\x{5AFB}\x{5AFC}\x{5AFD}\x{5AFE}\x{5AFF}\x{5B00}\x{5B01}\x{5B02}\x{5B03}' .
+'\x{5B04}\x{5B05}\x{5B06}\x{5B07}\x{5B08}\x{5B09}\x{5B0B}\x{5B0C}\x{5B0E}' .
+'\x{5B0F}\x{5B10}\x{5B11}\x{5B12}\x{5B13}\x{5B14}\x{5B15}\x{5B16}\x{5B17}' .
+'\x{5B18}\x{5B19}\x{5B1A}\x{5B1B}\x{5B1C}\x{5B1D}\x{5B1E}\x{5B1F}\x{5B20}' .
+'\x{5B21}\x{5B22}\x{5B23}\x{5B24}\x{5B25}\x{5B26}\x{5B27}\x{5B28}\x{5B29}' .
+'\x{5B2A}\x{5B2B}\x{5B2C}\x{5B2D}\x{5B2E}\x{5B2F}\x{5B30}\x{5B31}\x{5B32}' .
+'\x{5B33}\x{5B34}\x{5B35}\x{5B36}\x{5B37}\x{5B38}\x{5B3A}\x{5B3B}\x{5B3C}' .
+'\x{5B3D}\x{5B3E}\x{5B3F}\x{5B40}\x{5B41}\x{5B42}\x{5B43}\x{5B44}\x{5B45}' .
+'\x{5B47}\x{5B48}\x{5B49}\x{5B4A}\x{5B4B}\x{5B4C}\x{5B4D}\x{5B4E}\x{5B50}' .
+'\x{5B51}\x{5B53}\x{5B54}\x{5B55}\x{5B56}\x{5B57}\x{5B58}\x{5B59}\x{5B5A}' .
+'\x{5B5B}\x{5B5C}\x{5B5D}\x{5B5E}\x{5B5F}\x{5B62}\x{5B63}\x{5B64}\x{5B65}' .
+'\x{5B66}\x{5B67}\x{5B68}\x{5B69}\x{5B6A}\x{5B6B}\x{5B6C}\x{5B6D}\x{5B6E}' .
+'\x{5B70}\x{5B71}\x{5B72}\x{5B73}\x{5B74}\x{5B75}\x{5B76}\x{5B77}\x{5B78}' .
+'\x{5B7A}\x{5B7B}\x{5B7C}\x{5B7D}\x{5B7F}\x{5B80}\x{5B81}\x{5B82}\x{5B83}' .
+'\x{5B84}\x{5B85}\x{5B87}\x{5B88}\x{5B89}\x{5B8A}\x{5B8B}\x{5B8C}\x{5B8D}' .
+'\x{5B8E}\x{5B8F}\x{5B91}\x{5B92}\x{5B93}\x{5B94}\x{5B95}\x{5B96}\x{5B97}' .
+'\x{5B98}\x{5B99}\x{5B9A}\x{5B9B}\x{5B9C}\x{5B9D}\x{5B9E}\x{5B9F}\x{5BA0}' .
+'\x{5BA1}\x{5BA2}\x{5BA3}\x{5BA4}\x{5BA5}\x{5BA6}\x{5BA7}\x{5BA8}\x{5BAA}' .
+'\x{5BAB}\x{5BAC}\x{5BAD}\x{5BAE}\x{5BAF}\x{5BB0}\x{5BB1}\x{5BB3}\x{5BB4}' .
+'\x{5BB5}\x{5BB6}\x{5BB8}\x{5BB9}\x{5BBA}\x{5BBB}\x{5BBD}\x{5BBE}\x{5BBF}' .
+'\x{5BC0}\x{5BC1}\x{5BC2}\x{5BC3}\x{5BC4}\x{5BC5}\x{5BC6}\x{5BC7}\x{5BCA}' .
+'\x{5BCB}\x{5BCC}\x{5BCD}\x{5BCE}\x{5BCF}\x{5BD0}\x{5BD1}\x{5BD2}\x{5BD3}' .
+'\x{5BD4}\x{5BD5}\x{5BD6}\x{5BD8}\x{5BD9}\x{5BDB}\x{5BDC}\x{5BDD}\x{5BDE}' .
+'\x{5BDF}\x{5BE0}\x{5BE1}\x{5BE2}\x{5BE3}\x{5BE4}\x{5BE5}\x{5BE6}\x{5BE7}' .
+'\x{5BE8}\x{5BE9}\x{5BEA}\x{5BEB}\x{5BEC}\x{5BED}\x{5BEE}\x{5BEF}\x{5BF0}' .
+'\x{5BF1}\x{5BF2}\x{5BF3}\x{5BF4}\x{5BF5}\x{5BF6}\x{5BF7}\x{5BF8}\x{5BF9}' .
+'\x{5BFA}\x{5BFB}\x{5BFC}\x{5BFD}\x{5BFF}\x{5C01}\x{5C03}\x{5C04}\x{5C05}' .
+'\x{5C06}\x{5C07}\x{5C08}\x{5C09}\x{5C0A}\x{5C0B}\x{5C0C}\x{5C0D}\x{5C0E}' .
+'\x{5C0F}\x{5C10}\x{5C11}\x{5C12}\x{5C13}\x{5C14}\x{5C15}\x{5C16}\x{5C17}' .
+'\x{5C18}\x{5C19}\x{5C1A}\x{5C1C}\x{5C1D}\x{5C1E}\x{5C1F}\x{5C20}\x{5C21}' .
+'\x{5C22}\x{5C24}\x{5C25}\x{5C27}\x{5C28}\x{5C2A}\x{5C2B}\x{5C2C}\x{5C2D}' .
+'\x{5C2E}\x{5C2F}\x{5C30}\x{5C31}\x{5C32}\x{5C33}\x{5C34}\x{5C35}\x{5C37}' .
+'\x{5C38}\x{5C39}\x{5C3A}\x{5C3B}\x{5C3C}\x{5C3D}\x{5C3E}\x{5C3F}\x{5C40}' .
+'\x{5C41}\x{5C42}\x{5C43}\x{5C44}\x{5C45}\x{5C46}\x{5C47}\x{5C48}\x{5C49}' .
+'\x{5C4A}\x{5C4B}\x{5C4C}\x{5C4D}\x{5C4E}\x{5C4F}\x{5C50}\x{5C51}\x{5C52}' .
+'\x{5C53}\x{5C54}\x{5C55}\x{5C56}\x{5C57}\x{5C58}\x{5C59}\x{5C5B}\x{5C5C}' .
+'\x{5C5D}\x{5C5E}\x{5C5F}\x{5C60}\x{5C61}\x{5C62}\x{5C63}\x{5C64}\x{5C65}' .
+'\x{5C66}\x{5C67}\x{5C68}\x{5C69}\x{5C6A}\x{5C6B}\x{5C6C}\x{5C6D}\x{5C6E}' .
+'\x{5C6F}\x{5C70}\x{5C71}\x{5C72}\x{5C73}\x{5C74}\x{5C75}\x{5C76}\x{5C77}' .
+'\x{5C78}\x{5C79}\x{5C7A}\x{5C7B}\x{5C7C}\x{5C7D}\x{5C7E}\x{5C7F}\x{5C80}' .
+'\x{5C81}\x{5C82}\x{5C83}\x{5C84}\x{5C86}\x{5C87}\x{5C88}\x{5C89}\x{5C8A}' .
+'\x{5C8B}\x{5C8C}\x{5C8D}\x{5C8E}\x{5C8F}\x{5C90}\x{5C91}\x{5C92}\x{5C93}' .
+'\x{5C94}\x{5C95}\x{5C96}\x{5C97}\x{5C98}\x{5C99}\x{5C9A}\x{5C9B}\x{5C9C}' .
+'\x{5C9D}\x{5C9E}\x{5C9F}\x{5CA0}\x{5CA1}\x{5CA2}\x{5CA3}\x{5CA4}\x{5CA5}' .
+'\x{5CA6}\x{5CA7}\x{5CA8}\x{5CA9}\x{5CAA}\x{5CAB}\x{5CAC}\x{5CAD}\x{5CAE}' .
+'\x{5CAF}\x{5CB0}\x{5CB1}\x{5CB2}\x{5CB3}\x{5CB5}\x{5CB6}\x{5CB7}\x{5CB8}' .
+'\x{5CBA}\x{5CBB}\x{5CBC}\x{5CBD}\x{5CBE}\x{5CBF}\x{5CC1}\x{5CC2}\x{5CC3}' .
+'\x{5CC4}\x{5CC5}\x{5CC6}\x{5CC7}\x{5CC8}\x{5CC9}\x{5CCA}\x{5CCB}\x{5CCC}' .
+'\x{5CCD}\x{5CCE}\x{5CCF}\x{5CD0}\x{5CD1}\x{5CD2}\x{5CD3}\x{5CD4}\x{5CD6}' .
+'\x{5CD7}\x{5CD8}\x{5CD9}\x{5CDA}\x{5CDB}\x{5CDC}\x{5CDE}\x{5CDF}\x{5CE0}' .
+'\x{5CE1}\x{5CE2}\x{5CE3}\x{5CE4}\x{5CE5}\x{5CE6}\x{5CE7}\x{5CE8}\x{5CE9}' .
+'\x{5CEA}\x{5CEB}\x{5CEC}\x{5CED}\x{5CEE}\x{5CEF}\x{5CF0}\x{5CF1}\x{5CF2}' .
+'\x{5CF3}\x{5CF4}\x{5CF6}\x{5CF7}\x{5CF8}\x{5CF9}\x{5CFA}\x{5CFB}\x{5CFC}' .
+'\x{5CFD}\x{5CFE}\x{5CFF}\x{5D00}\x{5D01}\x{5D02}\x{5D03}\x{5D04}\x{5D05}' .
+'\x{5D06}\x{5D07}\x{5D08}\x{5D09}\x{5D0A}\x{5D0B}\x{5D0C}\x{5D0D}\x{5D0E}' .
+'\x{5D0F}\x{5D10}\x{5D11}\x{5D12}\x{5D13}\x{5D14}\x{5D15}\x{5D16}\x{5D17}' .
+'\x{5D18}\x{5D19}\x{5D1A}\x{5D1B}\x{5D1C}\x{5D1D}\x{5D1E}\x{5D1F}\x{5D20}' .
+'\x{5D21}\x{5D22}\x{5D23}\x{5D24}\x{5D25}\x{5D26}\x{5D27}\x{5D28}\x{5D29}' .
+'\x{5D2A}\x{5D2C}\x{5D2D}\x{5D2E}\x{5D30}\x{5D31}\x{5D32}\x{5D33}\x{5D34}' .
+'\x{5D35}\x{5D36}\x{5D37}\x{5D38}\x{5D39}\x{5D3A}\x{5D3C}\x{5D3D}\x{5D3E}' .
+'\x{5D3F}\x{5D40}\x{5D41}\x{5D42}\x{5D43}\x{5D44}\x{5D45}\x{5D46}\x{5D47}' .
+'\x{5D48}\x{5D49}\x{5D4A}\x{5D4B}\x{5D4C}\x{5D4D}\x{5D4E}\x{5D4F}\x{5D50}' .
+'\x{5D51}\x{5D52}\x{5D54}\x{5D55}\x{5D56}\x{5D58}\x{5D59}\x{5D5A}\x{5D5B}' .
+'\x{5D5D}\x{5D5E}\x{5D5F}\x{5D61}\x{5D62}\x{5D63}\x{5D64}\x{5D65}\x{5D66}' .
+'\x{5D67}\x{5D68}\x{5D69}\x{5D6A}\x{5D6B}\x{5D6C}\x{5D6D}\x{5D6E}\x{5D6F}' .
+'\x{5D70}\x{5D71}\x{5D72}\x{5D73}\x{5D74}\x{5D75}\x{5D76}\x{5D77}\x{5D78}' .
+'\x{5D79}\x{5D7A}\x{5D7B}\x{5D7C}\x{5D7D}\x{5D7E}\x{5D7F}\x{5D80}\x{5D81}' .
+'\x{5D82}\x{5D84}\x{5D85}\x{5D86}\x{5D87}\x{5D88}\x{5D89}\x{5D8A}\x{5D8B}' .
+'\x{5D8C}\x{5D8D}\x{5D8E}\x{5D8F}\x{5D90}\x{5D91}\x{5D92}\x{5D93}\x{5D94}' .
+'\x{5D95}\x{5D97}\x{5D98}\x{5D99}\x{5D9A}\x{5D9B}\x{5D9C}\x{5D9D}\x{5D9E}' .
+'\x{5D9F}\x{5DA0}\x{5DA1}\x{5DA2}\x{5DA5}\x{5DA6}\x{5DA7}\x{5DA8}\x{5DA9}' .
+'\x{5DAA}\x{5DAC}\x{5DAD}\x{5DAE}\x{5DAF}\x{5DB0}\x{5DB1}\x{5DB2}\x{5DB4}' .
+'\x{5DB5}\x{5DB6}\x{5DB7}\x{5DB8}\x{5DBA}\x{5DBB}\x{5DBC}\x{5DBD}\x{5DBE}' .
+'\x{5DBF}\x{5DC0}\x{5DC1}\x{5DC2}\x{5DC3}\x{5DC5}\x{5DC6}\x{5DC7}\x{5DC8}' .
+'\x{5DC9}\x{5DCA}\x{5DCB}\x{5DCC}\x{5DCD}\x{5DCE}\x{5DCF}\x{5DD0}\x{5DD1}' .
+'\x{5DD2}\x{5DD3}\x{5DD4}\x{5DD5}\x{5DD6}\x{5DD8}\x{5DD9}\x{5DDB}\x{5DDD}' .
+'\x{5DDE}\x{5DDF}\x{5DE0}\x{5DE1}\x{5DE2}\x{5DE3}\x{5DE4}\x{5DE5}\x{5DE6}' .
+'\x{5DE7}\x{5DE8}\x{5DE9}\x{5DEA}\x{5DEB}\x{5DEC}\x{5DED}\x{5DEE}\x{5DEF}' .
+'\x{5DF0}\x{5DF1}\x{5DF2}\x{5DF3}\x{5DF4}\x{5DF5}\x{5DF7}\x{5DF8}\x{5DF9}' .
+'\x{5DFA}\x{5DFB}\x{5DFC}\x{5DFD}\x{5DFE}\x{5DFF}\x{5E00}\x{5E01}\x{5E02}' .
+'\x{5E03}\x{5E04}\x{5E05}\x{5E06}\x{5E07}\x{5E08}\x{5E09}\x{5E0A}\x{5E0B}' .
+'\x{5E0C}\x{5E0D}\x{5E0E}\x{5E0F}\x{5E10}\x{5E11}\x{5E13}\x{5E14}\x{5E15}' .
+'\x{5E16}\x{5E17}\x{5E18}\x{5E19}\x{5E1A}\x{5E1B}\x{5E1C}\x{5E1D}\x{5E1E}' .
+'\x{5E1F}\x{5E20}\x{5E21}\x{5E22}\x{5E23}\x{5E24}\x{5E25}\x{5E26}\x{5E27}' .
+'\x{5E28}\x{5E29}\x{5E2A}\x{5E2B}\x{5E2C}\x{5E2D}\x{5E2E}\x{5E2F}\x{5E30}' .
+'\x{5E31}\x{5E32}\x{5E33}\x{5E34}\x{5E35}\x{5E36}\x{5E37}\x{5E38}\x{5E39}' .
+'\x{5E3A}\x{5E3B}\x{5E3C}\x{5E3D}\x{5E3E}\x{5E40}\x{5E41}\x{5E42}\x{5E43}' .
+'\x{5E44}\x{5E45}\x{5E46}\x{5E47}\x{5E49}\x{5E4A}\x{5E4B}\x{5E4C}\x{5E4D}' .
+'\x{5E4E}\x{5E4F}\x{5E50}\x{5E52}\x{5E53}\x{5E54}\x{5E55}\x{5E56}\x{5E57}' .
+'\x{5E58}\x{5E59}\x{5E5A}\x{5E5B}\x{5E5C}\x{5E5D}\x{5E5E}\x{5E5F}\x{5E60}' .
+'\x{5E61}\x{5E62}\x{5E63}\x{5E64}\x{5E65}\x{5E66}\x{5E67}\x{5E68}\x{5E69}' .
+'\x{5E6A}\x{5E6B}\x{5E6C}\x{5E6D}\x{5E6E}\x{5E6F}\x{5E70}\x{5E71}\x{5E72}' .
+'\x{5E73}\x{5E74}\x{5E75}\x{5E76}\x{5E77}\x{5E78}\x{5E79}\x{5E7A}\x{5E7B}' .
+'\x{5E7C}\x{5E7D}\x{5E7E}\x{5E7F}\x{5E80}\x{5E81}\x{5E82}\x{5E83}\x{5E84}' .
+'\x{5E85}\x{5E86}\x{5E87}\x{5E88}\x{5E89}\x{5E8A}\x{5E8B}\x{5E8C}\x{5E8D}' .
+'\x{5E8E}\x{5E8F}\x{5E90}\x{5E91}\x{5E93}\x{5E94}\x{5E95}\x{5E96}\x{5E97}' .
+'\x{5E98}\x{5E99}\x{5E9A}\x{5E9B}\x{5E9C}\x{5E9D}\x{5E9E}\x{5E9F}\x{5EA0}' .
+'\x{5EA1}\x{5EA2}\x{5EA3}\x{5EA4}\x{5EA5}\x{5EA6}\x{5EA7}\x{5EA8}\x{5EA9}' .
+'\x{5EAA}\x{5EAB}\x{5EAC}\x{5EAD}\x{5EAE}\x{5EAF}\x{5EB0}\x{5EB1}\x{5EB2}' .
+'\x{5EB3}\x{5EB4}\x{5EB5}\x{5EB6}\x{5EB7}\x{5EB8}\x{5EB9}\x{5EBB}\x{5EBC}' .
+'\x{5EBD}\x{5EBE}\x{5EBF}\x{5EC1}\x{5EC2}\x{5EC3}\x{5EC4}\x{5EC5}\x{5EC6}' .
+'\x{5EC7}\x{5EC8}\x{5EC9}\x{5ECA}\x{5ECB}\x{5ECC}\x{5ECD}\x{5ECE}\x{5ECF}' .
+'\x{5ED0}\x{5ED1}\x{5ED2}\x{5ED3}\x{5ED4}\x{5ED5}\x{5ED6}\x{5ED7}\x{5ED8}' .
+'\x{5ED9}\x{5EDA}\x{5EDB}\x{5EDC}\x{5EDD}\x{5EDE}\x{5EDF}\x{5EE0}\x{5EE1}' .
+'\x{5EE2}\x{5EE3}\x{5EE4}\x{5EE5}\x{5EE6}\x{5EE7}\x{5EE8}\x{5EE9}\x{5EEA}' .
+'\x{5EEC}\x{5EED}\x{5EEE}\x{5EEF}\x{5EF0}\x{5EF1}\x{5EF2}\x{5EF3}\x{5EF4}' .
+'\x{5EF5}\x{5EF6}\x{5EF7}\x{5EF8}\x{5EFA}\x{5EFB}\x{5EFC}\x{5EFD}\x{5EFE}' .
+'\x{5EFF}\x{5F00}\x{5F01}\x{5F02}\x{5F03}\x{5F04}\x{5F05}\x{5F06}\x{5F07}' .
+'\x{5F08}\x{5F0A}\x{5F0B}\x{5F0C}\x{5F0D}\x{5F0F}\x{5F11}\x{5F12}\x{5F13}' .
+'\x{5F14}\x{5F15}\x{5F16}\x{5F17}\x{5F18}\x{5F19}\x{5F1A}\x{5F1B}\x{5F1C}' .
+'\x{5F1D}\x{5F1E}\x{5F1F}\x{5F20}\x{5F21}\x{5F22}\x{5F23}\x{5F24}\x{5F25}' .
+'\x{5F26}\x{5F27}\x{5F28}\x{5F29}\x{5F2A}\x{5F2B}\x{5F2C}\x{5F2D}\x{5F2E}' .
+'\x{5F2F}\x{5F30}\x{5F31}\x{5F32}\x{5F33}\x{5F34}\x{5F35}\x{5F36}\x{5F37}' .
+'\x{5F38}\x{5F39}\x{5F3A}\x{5F3C}\x{5F3E}\x{5F3F}\x{5F40}\x{5F41}\x{5F42}' .
+'\x{5F43}\x{5F44}\x{5F45}\x{5F46}\x{5F47}\x{5F48}\x{5F49}\x{5F4A}\x{5F4B}' .
+'\x{5F4C}\x{5F4D}\x{5F4E}\x{5F4F}\x{5F50}\x{5F51}\x{5F52}\x{5F53}\x{5F54}' .
+'\x{5F55}\x{5F56}\x{5F57}\x{5F58}\x{5F59}\x{5F5A}\x{5F5B}\x{5F5C}\x{5F5D}' .
+'\x{5F5E}\x{5F5F}\x{5F60}\x{5F61}\x{5F62}\x{5F63}\x{5F64}\x{5F65}\x{5F66}' .
+'\x{5F67}\x{5F68}\x{5F69}\x{5F6A}\x{5F6B}\x{5F6C}\x{5F6D}\x{5F6E}\x{5F6F}' .
+'\x{5F70}\x{5F71}\x{5F72}\x{5F73}\x{5F74}\x{5F75}\x{5F76}\x{5F77}\x{5F78}' .
+'\x{5F79}\x{5F7A}\x{5F7B}\x{5F7C}\x{5F7D}\x{5F7E}\x{5F7F}\x{5F80}\x{5F81}' .
+'\x{5F82}\x{5F83}\x{5F84}\x{5F85}\x{5F86}\x{5F87}\x{5F88}\x{5F89}\x{5F8A}' .
+'\x{5F8B}\x{5F8C}\x{5F8D}\x{5F8E}\x{5F90}\x{5F91}\x{5F92}\x{5F93}\x{5F94}' .
+'\x{5F95}\x{5F96}\x{5F97}\x{5F98}\x{5F99}\x{5F9B}\x{5F9C}\x{5F9D}\x{5F9E}' .
+'\x{5F9F}\x{5FA0}\x{5FA1}\x{5FA2}\x{5FA5}\x{5FA6}\x{5FA7}\x{5FA8}\x{5FA9}' .
+'\x{5FAA}\x{5FAB}\x{5FAC}\x{5FAD}\x{5FAE}\x{5FAF}\x{5FB1}\x{5FB2}\x{5FB3}' .
+'\x{5FB4}\x{5FB5}\x{5FB6}\x{5FB7}\x{5FB8}\x{5FB9}\x{5FBA}\x{5FBB}\x{5FBC}' .
+'\x{5FBD}\x{5FBE}\x{5FBF}\x{5FC0}\x{5FC1}\x{5FC3}\x{5FC4}\x{5FC5}\x{5FC6}' .
+'\x{5FC7}\x{5FC8}\x{5FC9}\x{5FCA}\x{5FCB}\x{5FCC}\x{5FCD}\x{5FCF}\x{5FD0}' .
+'\x{5FD1}\x{5FD2}\x{5FD3}\x{5FD4}\x{5FD5}\x{5FD6}\x{5FD7}\x{5FD8}\x{5FD9}' .
+'\x{5FDA}\x{5FDC}\x{5FDD}\x{5FDE}\x{5FE0}\x{5FE1}\x{5FE3}\x{5FE4}\x{5FE5}' .
+'\x{5FE6}\x{5FE7}\x{5FE8}\x{5FE9}\x{5FEA}\x{5FEB}\x{5FED}\x{5FEE}\x{5FEF}' .
+'\x{5FF0}\x{5FF1}\x{5FF2}\x{5FF3}\x{5FF4}\x{5FF5}\x{5FF6}\x{5FF7}\x{5FF8}' .
+'\x{5FF9}\x{5FFA}\x{5FFB}\x{5FFD}\x{5FFE}\x{5FFF}\x{6000}\x{6001}\x{6002}' .
+'\x{6003}\x{6004}\x{6005}\x{6006}\x{6007}\x{6008}\x{6009}\x{600A}\x{600B}' .
+'\x{600C}\x{600D}\x{600E}\x{600F}\x{6010}\x{6011}\x{6012}\x{6013}\x{6014}' .
+'\x{6015}\x{6016}\x{6017}\x{6018}\x{6019}\x{601A}\x{601B}\x{601C}\x{601D}' .
+'\x{601E}\x{601F}\x{6020}\x{6021}\x{6022}\x{6024}\x{6025}\x{6026}\x{6027}' .
+'\x{6028}\x{6029}\x{602A}\x{602B}\x{602C}\x{602D}\x{602E}\x{602F}\x{6030}' .
+'\x{6031}\x{6032}\x{6033}\x{6034}\x{6035}\x{6036}\x{6037}\x{6038}\x{6039}' .
+'\x{603A}\x{603B}\x{603C}\x{603D}\x{603E}\x{603F}\x{6040}\x{6041}\x{6042}' .
+'\x{6043}\x{6044}\x{6045}\x{6046}\x{6047}\x{6048}\x{6049}\x{604A}\x{604B}' .
+'\x{604C}\x{604D}\x{604E}\x{604F}\x{6050}\x{6051}\x{6052}\x{6053}\x{6054}' .
+'\x{6055}\x{6057}\x{6058}\x{6059}\x{605A}\x{605B}\x{605C}\x{605D}\x{605E}' .
+'\x{605F}\x{6062}\x{6063}\x{6064}\x{6065}\x{6066}\x{6067}\x{6068}\x{6069}' .
+'\x{606A}\x{606B}\x{606C}\x{606D}\x{606E}\x{606F}\x{6070}\x{6072}\x{6073}' .
+'\x{6075}\x{6076}\x{6077}\x{6078}\x{6079}\x{607A}\x{607B}\x{607C}\x{607D}' .
+'\x{607E}\x{607F}\x{6080}\x{6081}\x{6082}\x{6083}\x{6084}\x{6085}\x{6086}' .
+'\x{6087}\x{6088}\x{6089}\x{608A}\x{608B}\x{608C}\x{608D}\x{608E}\x{608F}' .
+'\x{6090}\x{6092}\x{6094}\x{6095}\x{6096}\x{6097}\x{6098}\x{6099}\x{609A}' .
+'\x{609B}\x{609C}\x{609D}\x{609E}\x{609F}\x{60A0}\x{60A1}\x{60A2}\x{60A3}' .
+'\x{60A4}\x{60A6}\x{60A7}\x{60A8}\x{60AA}\x{60AB}\x{60AC}\x{60AD}\x{60AE}' .
+'\x{60AF}\x{60B0}\x{60B1}\x{60B2}\x{60B3}\x{60B4}\x{60B5}\x{60B6}\x{60B7}' .
+'\x{60B8}\x{60B9}\x{60BA}\x{60BB}\x{60BC}\x{60BD}\x{60BE}\x{60BF}\x{60C0}' .
+'\x{60C1}\x{60C2}\x{60C3}\x{60C4}\x{60C5}\x{60C6}\x{60C7}\x{60C8}\x{60C9}' .
+'\x{60CA}\x{60CB}\x{60CC}\x{60CD}\x{60CE}\x{60CF}\x{60D0}\x{60D1}\x{60D3}' .
+'\x{60D4}\x{60D5}\x{60D7}\x{60D8}\x{60D9}\x{60DA}\x{60DB}\x{60DC}\x{60DD}' .
+'\x{60DF}\x{60E0}\x{60E1}\x{60E2}\x{60E4}\x{60E6}\x{60E7}\x{60E8}\x{60E9}' .
+'\x{60EA}\x{60EB}\x{60EC}\x{60ED}\x{60EE}\x{60EF}\x{60F0}\x{60F1}\x{60F2}' .
+'\x{60F3}\x{60F4}\x{60F5}\x{60F6}\x{60F7}\x{60F8}\x{60F9}\x{60FA}\x{60FB}' .
+'\x{60FC}\x{60FE}\x{60FF}\x{6100}\x{6101}\x{6103}\x{6104}\x{6105}\x{6106}' .
+'\x{6108}\x{6109}\x{610A}\x{610B}\x{610C}\x{610D}\x{610E}\x{610F}\x{6110}' .
+'\x{6112}\x{6113}\x{6114}\x{6115}\x{6116}\x{6117}\x{6118}\x{6119}\x{611A}' .
+'\x{611B}\x{611C}\x{611D}\x{611F}\x{6120}\x{6122}\x{6123}\x{6124}\x{6125}' .
+'\x{6126}\x{6127}\x{6128}\x{6129}\x{612A}\x{612B}\x{612C}\x{612D}\x{612E}' .
+'\x{612F}\x{6130}\x{6132}\x{6134}\x{6136}\x{6137}\x{613A}\x{613B}\x{613C}' .
+'\x{613D}\x{613E}\x{613F}\x{6140}\x{6141}\x{6142}\x{6143}\x{6144}\x{6145}' .
+'\x{6146}\x{6147}\x{6148}\x{6149}\x{614A}\x{614B}\x{614C}\x{614D}\x{614E}' .
+'\x{614F}\x{6150}\x{6151}\x{6152}\x{6153}\x{6154}\x{6155}\x{6156}\x{6157}' .
+'\x{6158}\x{6159}\x{615A}\x{615B}\x{615C}\x{615D}\x{615E}\x{615F}\x{6161}' .
+'\x{6162}\x{6163}\x{6164}\x{6165}\x{6166}\x{6167}\x{6168}\x{6169}\x{616A}' .
+'\x{616B}\x{616C}\x{616D}\x{616E}\x{6170}\x{6171}\x{6172}\x{6173}\x{6174}' .
+'\x{6175}\x{6176}\x{6177}\x{6178}\x{6179}\x{617A}\x{617C}\x{617E}\x{6180}' .
+'\x{6181}\x{6182}\x{6183}\x{6184}\x{6185}\x{6187}\x{6188}\x{6189}\x{618A}' .
+'\x{618B}\x{618C}\x{618D}\x{618E}\x{618F}\x{6190}\x{6191}\x{6192}\x{6193}' .
+'\x{6194}\x{6195}\x{6196}\x{6198}\x{6199}\x{619A}\x{619B}\x{619D}\x{619E}' .
+'\x{619F}\x{61A0}\x{61A1}\x{61A2}\x{61A3}\x{61A4}\x{61A5}\x{61A6}\x{61A7}' .
+'\x{61A8}\x{61A9}\x{61AA}\x{61AB}\x{61AC}\x{61AD}\x{61AE}\x{61AF}\x{61B0}' .
+'\x{61B1}\x{61B2}\x{61B3}\x{61B4}\x{61B5}\x{61B6}\x{61B7}\x{61B8}\x{61BA}' .
+'\x{61BC}\x{61BD}\x{61BE}\x{61BF}\x{61C0}\x{61C1}\x{61C2}\x{61C3}\x{61C4}' .
+'\x{61C5}\x{61C6}\x{61C7}\x{61C8}\x{61C9}\x{61CA}\x{61CB}\x{61CC}\x{61CD}' .
+'\x{61CE}\x{61CF}\x{61D0}\x{61D1}\x{61D2}\x{61D4}\x{61D6}\x{61D7}\x{61D8}' .
+'\x{61D9}\x{61DA}\x{61DB}\x{61DC}\x{61DD}\x{61DE}\x{61DF}\x{61E0}\x{61E1}' .
+'\x{61E2}\x{61E3}\x{61E4}\x{61E5}\x{61E6}\x{61E7}\x{61E8}\x{61E9}\x{61EA}' .
+'\x{61EB}\x{61ED}\x{61EE}\x{61F0}\x{61F1}\x{61F2}\x{61F3}\x{61F5}\x{61F6}' .
+'\x{61F7}\x{61F8}\x{61F9}\x{61FA}\x{61FB}\x{61FC}\x{61FD}\x{61FE}\x{61FF}' .
+'\x{6200}\x{6201}\x{6202}\x{6203}\x{6204}\x{6206}\x{6207}\x{6208}\x{6209}' .
+'\x{620A}\x{620B}\x{620C}\x{620D}\x{620E}\x{620F}\x{6210}\x{6211}\x{6212}' .
+'\x{6213}\x{6214}\x{6215}\x{6216}\x{6217}\x{6218}\x{6219}\x{621A}\x{621B}' .
+'\x{621C}\x{621D}\x{621E}\x{621F}\x{6220}\x{6221}\x{6222}\x{6223}\x{6224}' .
+'\x{6225}\x{6226}\x{6227}\x{6228}\x{6229}\x{622A}\x{622B}\x{622C}\x{622D}' .
+'\x{622E}\x{622F}\x{6230}\x{6231}\x{6232}\x{6233}\x{6234}\x{6236}\x{6237}' .
+'\x{6238}\x{623A}\x{623B}\x{623C}\x{623D}\x{623E}\x{623F}\x{6240}\x{6241}' .
+'\x{6242}\x{6243}\x{6244}\x{6245}\x{6246}\x{6247}\x{6248}\x{6249}\x{624A}' .
+'\x{624B}\x{624C}\x{624D}\x{624E}\x{624F}\x{6250}\x{6251}\x{6252}\x{6253}' .
+'\x{6254}\x{6255}\x{6256}\x{6258}\x{6259}\x{625A}\x{625B}\x{625C}\x{625D}' .
+'\x{625E}\x{625F}\x{6260}\x{6261}\x{6262}\x{6263}\x{6264}\x{6265}\x{6266}' .
+'\x{6267}\x{6268}\x{6269}\x{626A}\x{626B}\x{626C}\x{626D}\x{626E}\x{626F}' .
+'\x{6270}\x{6271}\x{6272}\x{6273}\x{6274}\x{6275}\x{6276}\x{6277}\x{6278}' .
+'\x{6279}\x{627A}\x{627B}\x{627C}\x{627D}\x{627E}\x{627F}\x{6280}\x{6281}' .
+'\x{6283}\x{6284}\x{6285}\x{6286}\x{6287}\x{6288}\x{6289}\x{628A}\x{628B}' .
+'\x{628C}\x{628E}\x{628F}\x{6290}\x{6291}\x{6292}\x{6293}\x{6294}\x{6295}' .
+'\x{6296}\x{6297}\x{6298}\x{6299}\x{629A}\x{629B}\x{629C}\x{629E}\x{629F}' .
+'\x{62A0}\x{62A1}\x{62A2}\x{62A3}\x{62A4}\x{62A5}\x{62A7}\x{62A8}\x{62A9}' .
+'\x{62AA}\x{62AB}\x{62AC}\x{62AD}\x{62AE}\x{62AF}\x{62B0}\x{62B1}\x{62B2}' .
+'\x{62B3}\x{62B4}\x{62B5}\x{62B6}\x{62B7}\x{62B8}\x{62B9}\x{62BA}\x{62BB}' .
+'\x{62BC}\x{62BD}\x{62BE}\x{62BF}\x{62C0}\x{62C1}\x{62C2}\x{62C3}\x{62C4}' .
+'\x{62C5}\x{62C6}\x{62C7}\x{62C8}\x{62C9}\x{62CA}\x{62CB}\x{62CC}\x{62CD}' .
+'\x{62CE}\x{62CF}\x{62D0}\x{62D1}\x{62D2}\x{62D3}\x{62D4}\x{62D5}\x{62D6}' .
+'\x{62D7}\x{62D8}\x{62D9}\x{62DA}\x{62DB}\x{62DC}\x{62DD}\x{62DF}\x{62E0}' .
+'\x{62E1}\x{62E2}\x{62E3}\x{62E4}\x{62E5}\x{62E6}\x{62E7}\x{62E8}\x{62E9}' .
+'\x{62EB}\x{62EC}\x{62ED}\x{62EE}\x{62EF}\x{62F0}\x{62F1}\x{62F2}\x{62F3}' .
+'\x{62F4}\x{62F5}\x{62F6}\x{62F7}\x{62F8}\x{62F9}\x{62FA}\x{62FB}\x{62FC}' .
+'\x{62FD}\x{62FE}\x{62FF}\x{6300}\x{6301}\x{6302}\x{6303}\x{6304}\x{6305}' .
+'\x{6306}\x{6307}\x{6308}\x{6309}\x{630B}\x{630C}\x{630D}\x{630E}\x{630F}' .
+'\x{6310}\x{6311}\x{6312}\x{6313}\x{6314}\x{6315}\x{6316}\x{6318}\x{6319}' .
+'\x{631A}\x{631B}\x{631C}\x{631D}\x{631E}\x{631F}\x{6320}\x{6321}\x{6322}' .
+'\x{6323}\x{6324}\x{6325}\x{6326}\x{6327}\x{6328}\x{6329}\x{632A}\x{632B}' .
+'\x{632C}\x{632D}\x{632E}\x{632F}\x{6330}\x{6332}\x{6333}\x{6334}\x{6336}' .
+'\x{6338}\x{6339}\x{633A}\x{633B}\x{633C}\x{633D}\x{633E}\x{6340}\x{6341}' .
+'\x{6342}\x{6343}\x{6344}\x{6345}\x{6346}\x{6347}\x{6348}\x{6349}\x{634A}' .
+'\x{634B}\x{634C}\x{634D}\x{634E}\x{634F}\x{6350}\x{6351}\x{6352}\x{6353}' .
+'\x{6354}\x{6355}\x{6356}\x{6357}\x{6358}\x{6359}\x{635A}\x{635C}\x{635D}' .
+'\x{635E}\x{635F}\x{6360}\x{6361}\x{6362}\x{6363}\x{6364}\x{6365}\x{6366}' .
+'\x{6367}\x{6368}\x{6369}\x{636A}\x{636B}\x{636C}\x{636D}\x{636E}\x{636F}' .
+'\x{6370}\x{6371}\x{6372}\x{6373}\x{6374}\x{6375}\x{6376}\x{6377}\x{6378}' .
+'\x{6379}\x{637A}\x{637B}\x{637C}\x{637D}\x{637E}\x{6380}\x{6381}\x{6382}' .
+'\x{6383}\x{6384}\x{6385}\x{6386}\x{6387}\x{6388}\x{6389}\x{638A}\x{638C}' .
+'\x{638D}\x{638E}\x{638F}\x{6390}\x{6391}\x{6392}\x{6394}\x{6395}\x{6396}' .
+'\x{6397}\x{6398}\x{6399}\x{639A}\x{639B}\x{639C}\x{639D}\x{639E}\x{639F}' .
+'\x{63A0}\x{63A1}\x{63A2}\x{63A3}\x{63A4}\x{63A5}\x{63A6}\x{63A7}\x{63A8}' .
+'\x{63A9}\x{63AA}\x{63AB}\x{63AC}\x{63AD}\x{63AE}\x{63AF}\x{63B0}\x{63B1}' .
+'\x{63B2}\x{63B3}\x{63B4}\x{63B5}\x{63B6}\x{63B7}\x{63B8}\x{63B9}\x{63BA}' .
+'\x{63BC}\x{63BD}\x{63BE}\x{63BF}\x{63C0}\x{63C1}\x{63C2}\x{63C3}\x{63C4}' .
+'\x{63C5}\x{63C6}\x{63C7}\x{63C8}\x{63C9}\x{63CA}\x{63CB}\x{63CC}\x{63CD}' .
+'\x{63CE}\x{63CF}\x{63D0}\x{63D2}\x{63D3}\x{63D4}\x{63D5}\x{63D6}\x{63D7}' .
+'\x{63D8}\x{63D9}\x{63DA}\x{63DB}\x{63DC}\x{63DD}\x{63DE}\x{63DF}\x{63E0}' .
+'\x{63E1}\x{63E2}\x{63E3}\x{63E4}\x{63E5}\x{63E6}\x{63E7}\x{63E8}\x{63E9}' .
+'\x{63EA}\x{63EB}\x{63EC}\x{63ED}\x{63EE}\x{63EF}\x{63F0}\x{63F1}\x{63F2}' .
+'\x{63F3}\x{63F4}\x{63F5}\x{63F6}\x{63F7}\x{63F8}\x{63F9}\x{63FA}\x{63FB}' .
+'\x{63FC}\x{63FD}\x{63FE}\x{63FF}\x{6400}\x{6401}\x{6402}\x{6403}\x{6404}' .
+'\x{6405}\x{6406}\x{6408}\x{6409}\x{640A}\x{640B}\x{640C}\x{640D}\x{640E}' .
+'\x{640F}\x{6410}\x{6411}\x{6412}\x{6413}\x{6414}\x{6415}\x{6416}\x{6417}' .
+'\x{6418}\x{6419}\x{641A}\x{641B}\x{641C}\x{641D}\x{641E}\x{641F}\x{6420}' .
+'\x{6421}\x{6422}\x{6423}\x{6424}\x{6425}\x{6426}\x{6427}\x{6428}\x{6429}' .
+'\x{642A}\x{642B}\x{642C}\x{642D}\x{642E}\x{642F}\x{6430}\x{6431}\x{6432}' .
+'\x{6433}\x{6434}\x{6435}\x{6436}\x{6437}\x{6438}\x{6439}\x{643A}\x{643D}' .
+'\x{643E}\x{643F}\x{6440}\x{6441}\x{6443}\x{6444}\x{6445}\x{6446}\x{6447}' .
+'\x{6448}\x{644A}\x{644B}\x{644C}\x{644D}\x{644E}\x{644F}\x{6450}\x{6451}' .
+'\x{6452}\x{6453}\x{6454}\x{6455}\x{6456}\x{6457}\x{6458}\x{6459}\x{645B}' .
+'\x{645C}\x{645D}\x{645E}\x{645F}\x{6460}\x{6461}\x{6462}\x{6463}\x{6464}' .
+'\x{6465}\x{6466}\x{6467}\x{6468}\x{6469}\x{646A}\x{646B}\x{646C}\x{646D}' .
+'\x{646E}\x{646F}\x{6470}\x{6471}\x{6472}\x{6473}\x{6474}\x{6475}\x{6476}' .
+'\x{6477}\x{6478}\x{6479}\x{647A}\x{647B}\x{647C}\x{647D}\x{647F}\x{6480}' .
+'\x{6481}\x{6482}\x{6483}\x{6484}\x{6485}\x{6487}\x{6488}\x{6489}\x{648A}' .
+'\x{648B}\x{648C}\x{648D}\x{648E}\x{648F}\x{6490}\x{6491}\x{6492}\x{6493}' .
+'\x{6494}\x{6495}\x{6496}\x{6497}\x{6498}\x{6499}\x{649A}\x{649B}\x{649C}' .
+'\x{649D}\x{649E}\x{649F}\x{64A0}\x{64A2}\x{64A3}\x{64A4}\x{64A5}\x{64A6}' .
+'\x{64A7}\x{64A8}\x{64A9}\x{64AA}\x{64AB}\x{64AC}\x{64AD}\x{64AE}\x{64B0}' .
+'\x{64B1}\x{64B2}\x{64B3}\x{64B4}\x{64B5}\x{64B7}\x{64B8}\x{64B9}\x{64BA}' .
+'\x{64BB}\x{64BC}\x{64BD}\x{64BE}\x{64BF}\x{64C0}\x{64C1}\x{64C2}\x{64C3}' .
+'\x{64C4}\x{64C5}\x{64C6}\x{64C7}\x{64C9}\x{64CA}\x{64CB}\x{64CC}\x{64CD}' .
+'\x{64CE}\x{64CF}\x{64D0}\x{64D1}\x{64D2}\x{64D3}\x{64D4}\x{64D6}\x{64D7}' .
+'\x{64D8}\x{64D9}\x{64DA}\x{64DB}\x{64DC}\x{64DD}\x{64DE}\x{64DF}\x{64E0}' .
+'\x{64E2}\x{64E3}\x{64E4}\x{64E6}\x{64E7}\x{64E8}\x{64E9}\x{64EA}\x{64EB}' .
+'\x{64EC}\x{64ED}\x{64EF}\x{64F0}\x{64F1}\x{64F2}\x{64F3}\x{64F4}\x{64F6}' .
+'\x{64F7}\x{64F8}\x{64FA}\x{64FB}\x{64FC}\x{64FD}\x{64FE}\x{64FF}\x{6500}' .
+'\x{6501}\x{6503}\x{6504}\x{6505}\x{6506}\x{6507}\x{6508}\x{6509}\x{650B}' .
+'\x{650C}\x{650D}\x{650E}\x{650F}\x{6510}\x{6511}\x{6512}\x{6513}\x{6514}' .
+'\x{6515}\x{6516}\x{6517}\x{6518}\x{6519}\x{651A}\x{651B}\x{651C}\x{651D}' .
+'\x{651E}\x{6520}\x{6521}\x{6522}\x{6523}\x{6524}\x{6525}\x{6526}\x{6527}' .
+'\x{6529}\x{652A}\x{652B}\x{652C}\x{652D}\x{652E}\x{652F}\x{6530}\x{6531}' .
+'\x{6532}\x{6533}\x{6534}\x{6535}\x{6536}\x{6537}\x{6538}\x{6539}\x{653A}' .
+'\x{653B}\x{653C}\x{653D}\x{653E}\x{653F}\x{6541}\x{6543}\x{6544}\x{6545}' .
+'\x{6546}\x{6547}\x{6548}\x{6549}\x{654A}\x{654B}\x{654C}\x{654D}\x{654E}' .
+'\x{654F}\x{6550}\x{6551}\x{6552}\x{6553}\x{6554}\x{6555}\x{6556}\x{6557}' .
+'\x{6558}\x{6559}\x{655B}\x{655C}\x{655D}\x{655E}\x{6560}\x{6561}\x{6562}' .
+'\x{6563}\x{6564}\x{6565}\x{6566}\x{6567}\x{6568}\x{6569}\x{656A}\x{656B}' .
+'\x{656C}\x{656E}\x{656F}\x{6570}\x{6571}\x{6572}\x{6573}\x{6574}\x{6575}' .
+'\x{6576}\x{6577}\x{6578}\x{6579}\x{657A}\x{657B}\x{657C}\x{657E}\x{657F}' .
+'\x{6580}\x{6581}\x{6582}\x{6583}\x{6584}\x{6585}\x{6586}\x{6587}\x{6588}' .
+'\x{6589}\x{658B}\x{658C}\x{658D}\x{658E}\x{658F}\x{6590}\x{6591}\x{6592}' .
+'\x{6593}\x{6594}\x{6595}\x{6596}\x{6597}\x{6598}\x{6599}\x{659B}\x{659C}' .
+'\x{659D}\x{659E}\x{659F}\x{65A0}\x{65A1}\x{65A2}\x{65A3}\x{65A4}\x{65A5}' .
+'\x{65A6}\x{65A7}\x{65A8}\x{65A9}\x{65AA}\x{65AB}\x{65AC}\x{65AD}\x{65AE}' .
+'\x{65AF}\x{65B0}\x{65B1}\x{65B2}\x{65B3}\x{65B4}\x{65B6}\x{65B7}\x{65B8}' .
+'\x{65B9}\x{65BA}\x{65BB}\x{65BC}\x{65BD}\x{65BF}\x{65C0}\x{65C1}\x{65C2}' .
+'\x{65C3}\x{65C4}\x{65C5}\x{65C6}\x{65C7}\x{65CA}\x{65CB}\x{65CC}\x{65CD}' .
+'\x{65CE}\x{65CF}\x{65D0}\x{65D2}\x{65D3}\x{65D4}\x{65D5}\x{65D6}\x{65D7}' .
+'\x{65DA}\x{65DB}\x{65DD}\x{65DE}\x{65DF}\x{65E0}\x{65E1}\x{65E2}\x{65E3}' .
+'\x{65E5}\x{65E6}\x{65E7}\x{65E8}\x{65E9}\x{65EB}\x{65EC}\x{65ED}\x{65EE}' .
+'\x{65EF}\x{65F0}\x{65F1}\x{65F2}\x{65F3}\x{65F4}\x{65F5}\x{65F6}\x{65F7}' .
+'\x{65F8}\x{65FA}\x{65FB}\x{65FC}\x{65FD}\x{6600}\x{6601}\x{6602}\x{6603}' .
+'\x{6604}\x{6605}\x{6606}\x{6607}\x{6608}\x{6609}\x{660A}\x{660B}\x{660C}' .
+'\x{660D}\x{660E}\x{660F}\x{6610}\x{6611}\x{6612}\x{6613}\x{6614}\x{6615}' .
+'\x{6616}\x{6618}\x{6619}\x{661A}\x{661B}\x{661C}\x{661D}\x{661F}\x{6620}' .
+'\x{6621}\x{6622}\x{6623}\x{6624}\x{6625}\x{6626}\x{6627}\x{6628}\x{6629}' .
+'\x{662A}\x{662B}\x{662D}\x{662E}\x{662F}\x{6630}\x{6631}\x{6632}\x{6633}' .
+'\x{6634}\x{6635}\x{6636}\x{6639}\x{663A}\x{663C}\x{663D}\x{663E}\x{6640}' .
+'\x{6641}\x{6642}\x{6643}\x{6644}\x{6645}\x{6646}\x{6647}\x{6649}\x{664A}' .
+'\x{664B}\x{664C}\x{664E}\x{664F}\x{6650}\x{6651}\x{6652}\x{6653}\x{6654}' .
+'\x{6655}\x{6656}\x{6657}\x{6658}\x{6659}\x{665A}\x{665B}\x{665C}\x{665D}' .
+'\x{665E}\x{665F}\x{6661}\x{6662}\x{6664}\x{6665}\x{6666}\x{6668}\x{6669}' .
+'\x{666A}\x{666B}\x{666C}\x{666D}\x{666E}\x{666F}\x{6670}\x{6671}\x{6672}' .
+'\x{6673}\x{6674}\x{6675}\x{6676}\x{6677}\x{6678}\x{6679}\x{667A}\x{667B}' .
+'\x{667C}\x{667D}\x{667E}\x{667F}\x{6680}\x{6681}\x{6682}\x{6683}\x{6684}' .
+'\x{6685}\x{6686}\x{6687}\x{6688}\x{6689}\x{668A}\x{668B}\x{668C}\x{668D}' .
+'\x{668E}\x{668F}\x{6690}\x{6691}\x{6693}\x{6694}\x{6695}\x{6696}\x{6697}' .
+'\x{6698}\x{6699}\x{669A}\x{669B}\x{669D}\x{669F}\x{66A0}\x{66A1}\x{66A2}' .
+'\x{66A3}\x{66A4}\x{66A5}\x{66A6}\x{66A7}\x{66A8}\x{66A9}\x{66AA}\x{66AB}' .
+'\x{66AE}\x{66AF}\x{66B0}\x{66B1}\x{66B2}\x{66B3}\x{66B4}\x{66B5}\x{66B6}' .
+'\x{66B7}\x{66B8}\x{66B9}\x{66BA}\x{66BB}\x{66BC}\x{66BD}\x{66BE}\x{66BF}' .
+'\x{66C0}\x{66C1}\x{66C2}\x{66C3}\x{66C4}\x{66C5}\x{66C6}\x{66C7}\x{66C8}' .
+'\x{66C9}\x{66CA}\x{66CB}\x{66CC}\x{66CD}\x{66CE}\x{66CF}\x{66D1}\x{66D2}' .
+'\x{66D4}\x{66D5}\x{66D6}\x{66D8}\x{66D9}\x{66DA}\x{66DB}\x{66DC}\x{66DD}' .
+'\x{66DE}\x{66E0}\x{66E1}\x{66E2}\x{66E3}\x{66E4}\x{66E5}\x{66E6}\x{66E7}' .
+'\x{66E8}\x{66E9}\x{66EA}\x{66EB}\x{66EC}\x{66ED}\x{66EE}\x{66F0}\x{66F1}' .
+'\x{66F2}\x{66F3}\x{66F4}\x{66F5}\x{66F6}\x{66F7}\x{66F8}\x{66F9}\x{66FA}' .
+'\x{66FB}\x{66FC}\x{66FE}\x{66FF}\x{6700}\x{6701}\x{6703}\x{6704}\x{6705}' .
+'\x{6706}\x{6708}\x{6709}\x{670A}\x{670B}\x{670C}\x{670D}\x{670E}\x{670F}' .
+'\x{6710}\x{6711}\x{6712}\x{6713}\x{6714}\x{6715}\x{6716}\x{6717}\x{6718}' .
+'\x{671A}\x{671B}\x{671C}\x{671D}\x{671E}\x{671F}\x{6720}\x{6721}\x{6722}' .
+'\x{6723}\x{6725}\x{6726}\x{6727}\x{6728}\x{672A}\x{672B}\x{672C}\x{672D}' .
+'\x{672E}\x{672F}\x{6730}\x{6731}\x{6732}\x{6733}\x{6734}\x{6735}\x{6736}' .
+'\x{6737}\x{6738}\x{6739}\x{673A}\x{673B}\x{673C}\x{673D}\x{673E}\x{673F}' .
+'\x{6740}\x{6741}\x{6742}\x{6743}\x{6744}\x{6745}\x{6746}\x{6747}\x{6748}' .
+'\x{6749}\x{674A}\x{674B}\x{674C}\x{674D}\x{674E}\x{674F}\x{6750}\x{6751}' .
+'\x{6752}\x{6753}\x{6754}\x{6755}\x{6756}\x{6757}\x{6758}\x{6759}\x{675A}' .
+'\x{675B}\x{675C}\x{675D}\x{675E}\x{675F}\x{6760}\x{6761}\x{6762}\x{6763}' .
+'\x{6764}\x{6765}\x{6766}\x{6768}\x{6769}\x{676A}\x{676B}\x{676C}\x{676D}' .
+'\x{676E}\x{676F}\x{6770}\x{6771}\x{6772}\x{6773}\x{6774}\x{6775}\x{6776}' .
+'\x{6777}\x{6778}\x{6779}\x{677A}\x{677B}\x{677C}\x{677D}\x{677E}\x{677F}' .
+'\x{6780}\x{6781}\x{6782}\x{6783}\x{6784}\x{6785}\x{6786}\x{6787}\x{6789}' .
+'\x{678A}\x{678B}\x{678C}\x{678D}\x{678E}\x{678F}\x{6790}\x{6791}\x{6792}' .
+'\x{6793}\x{6794}\x{6795}\x{6797}\x{6798}\x{6799}\x{679A}\x{679B}\x{679C}' .
+'\x{679D}\x{679E}\x{679F}\x{67A0}\x{67A1}\x{67A2}\x{67A3}\x{67A4}\x{67A5}' .
+'\x{67A6}\x{67A7}\x{67A8}\x{67AA}\x{67AB}\x{67AC}\x{67AD}\x{67AE}\x{67AF}' .
+'\x{67B0}\x{67B1}\x{67B2}\x{67B3}\x{67B4}\x{67B5}\x{67B6}\x{67B7}\x{67B8}' .
+'\x{67B9}\x{67BA}\x{67BB}\x{67BC}\x{67BE}\x{67C0}\x{67C1}\x{67C2}\x{67C3}' .
+'\x{67C4}\x{67C5}\x{67C6}\x{67C7}\x{67C8}\x{67C9}\x{67CA}\x{67CB}\x{67CC}' .
+'\x{67CD}\x{67CE}\x{67CF}\x{67D0}\x{67D1}\x{67D2}\x{67D3}\x{67D4}\x{67D6}' .
+'\x{67D8}\x{67D9}\x{67DA}\x{67DB}\x{67DC}\x{67DD}\x{67DE}\x{67DF}\x{67E0}' .
+'\x{67E1}\x{67E2}\x{67E3}\x{67E4}\x{67E5}\x{67E6}\x{67E7}\x{67E8}\x{67E9}' .
+'\x{67EA}\x{67EB}\x{67EC}\x{67ED}\x{67EE}\x{67EF}\x{67F0}\x{67F1}\x{67F2}' .
+'\x{67F3}\x{67F4}\x{67F5}\x{67F6}\x{67F7}\x{67F8}\x{67FA}\x{67FB}\x{67FC}' .
+'\x{67FD}\x{67FE}\x{67FF}\x{6800}\x{6802}\x{6803}\x{6804}\x{6805}\x{6806}' .
+'\x{6807}\x{6808}\x{6809}\x{680A}\x{680B}\x{680C}\x{680D}\x{680E}\x{680F}' .
+'\x{6810}\x{6811}\x{6812}\x{6813}\x{6814}\x{6816}\x{6817}\x{6818}\x{6819}' .
+'\x{681A}\x{681B}\x{681C}\x{681D}\x{681F}\x{6820}\x{6821}\x{6822}\x{6823}' .
+'\x{6824}\x{6825}\x{6826}\x{6828}\x{6829}\x{682A}\x{682B}\x{682C}\x{682D}' .
+'\x{682E}\x{682F}\x{6831}\x{6832}\x{6833}\x{6834}\x{6835}\x{6836}\x{6837}' .
+'\x{6838}\x{6839}\x{683A}\x{683B}\x{683C}\x{683D}\x{683E}\x{683F}\x{6840}' .
+'\x{6841}\x{6842}\x{6843}\x{6844}\x{6845}\x{6846}\x{6847}\x{6848}\x{6849}' .
+'\x{684A}\x{684B}\x{684C}\x{684D}\x{684E}\x{684F}\x{6850}\x{6851}\x{6852}' .
+'\x{6853}\x{6854}\x{6855}\x{6856}\x{6857}\x{685B}\x{685D}\x{6860}\x{6861}' .
+'\x{6862}\x{6863}\x{6864}\x{6865}\x{6866}\x{6867}\x{6868}\x{6869}\x{686A}' .
+'\x{686B}\x{686C}\x{686D}\x{686E}\x{686F}\x{6870}\x{6871}\x{6872}\x{6873}' .
+'\x{6874}\x{6875}\x{6876}\x{6877}\x{6878}\x{6879}\x{687B}\x{687C}\x{687D}' .
+'\x{687E}\x{687F}\x{6880}\x{6881}\x{6882}\x{6883}\x{6884}\x{6885}\x{6886}' .
+'\x{6887}\x{6888}\x{6889}\x{688A}\x{688B}\x{688C}\x{688D}\x{688E}\x{688F}' .
+'\x{6890}\x{6891}\x{6892}\x{6893}\x{6894}\x{6896}\x{6897}\x{6898}\x{689A}' .
+'\x{689B}\x{689C}\x{689D}\x{689E}\x{689F}\x{68A0}\x{68A1}\x{68A2}\x{68A3}' .
+'\x{68A4}\x{68A6}\x{68A7}\x{68A8}\x{68A9}\x{68AA}\x{68AB}\x{68AC}\x{68AD}' .
+'\x{68AE}\x{68AF}\x{68B0}\x{68B1}\x{68B2}\x{68B3}\x{68B4}\x{68B5}\x{68B6}' .
+'\x{68B7}\x{68B9}\x{68BB}\x{68BC}\x{68BD}\x{68BE}\x{68BF}\x{68C0}\x{68C1}' .
+'\x{68C2}\x{68C4}\x{68C6}\x{68C7}\x{68C8}\x{68C9}\x{68CA}\x{68CB}\x{68CC}' .
+'\x{68CD}\x{68CE}\x{68CF}\x{68D0}\x{68D1}\x{68D2}\x{68D3}\x{68D4}\x{68D5}' .
+'\x{68D6}\x{68D7}\x{68D8}\x{68DA}\x{68DB}\x{68DC}\x{68DD}\x{68DE}\x{68DF}' .
+'\x{68E0}\x{68E1}\x{68E3}\x{68E4}\x{68E6}\x{68E7}\x{68E8}\x{68E9}\x{68EA}' .
+'\x{68EB}\x{68EC}\x{68ED}\x{68EE}\x{68EF}\x{68F0}\x{68F1}\x{68F2}\x{68F3}' .
+'\x{68F4}\x{68F5}\x{68F6}\x{68F7}\x{68F8}\x{68F9}\x{68FA}\x{68FB}\x{68FC}' .
+'\x{68FD}\x{68FE}\x{68FF}\x{6901}\x{6902}\x{6903}\x{6904}\x{6905}\x{6906}' .
+'\x{6907}\x{6908}\x{690A}\x{690B}\x{690C}\x{690D}\x{690E}\x{690F}\x{6910}' .
+'\x{6911}\x{6912}\x{6913}\x{6914}\x{6915}\x{6916}\x{6917}\x{6918}\x{6919}' .
+'\x{691A}\x{691B}\x{691C}\x{691D}\x{691E}\x{691F}\x{6920}\x{6921}\x{6922}' .
+'\x{6923}\x{6924}\x{6925}\x{6926}\x{6927}\x{6928}\x{6929}\x{692A}\x{692B}' .
+'\x{692C}\x{692D}\x{692E}\x{692F}\x{6930}\x{6931}\x{6932}\x{6933}\x{6934}' .
+'\x{6935}\x{6936}\x{6937}\x{6938}\x{6939}\x{693A}\x{693B}\x{693C}\x{693D}' .
+'\x{693F}\x{6940}\x{6941}\x{6942}\x{6943}\x{6944}\x{6945}\x{6946}\x{6947}' .
+'\x{6948}\x{6949}\x{694A}\x{694B}\x{694C}\x{694E}\x{694F}\x{6950}\x{6951}' .
+'\x{6952}\x{6953}\x{6954}\x{6955}\x{6956}\x{6957}\x{6958}\x{6959}\x{695A}' .
+'\x{695B}\x{695C}\x{695D}\x{695E}\x{695F}\x{6960}\x{6961}\x{6962}\x{6963}' .
+'\x{6964}\x{6965}\x{6966}\x{6967}\x{6968}\x{6969}\x{696A}\x{696B}\x{696C}' .
+'\x{696D}\x{696E}\x{696F}\x{6970}\x{6971}\x{6972}\x{6973}\x{6974}\x{6975}' .
+'\x{6976}\x{6977}\x{6978}\x{6979}\x{697A}\x{697B}\x{697C}\x{697D}\x{697E}' .
+'\x{697F}\x{6980}\x{6981}\x{6982}\x{6983}\x{6984}\x{6985}\x{6986}\x{6987}' .
+'\x{6988}\x{6989}\x{698A}\x{698B}\x{698C}\x{698D}\x{698E}\x{698F}\x{6990}' .
+'\x{6991}\x{6992}\x{6993}\x{6994}\x{6995}\x{6996}\x{6997}\x{6998}\x{6999}' .
+'\x{699A}\x{699B}\x{699C}\x{699D}\x{699E}\x{69A0}\x{69A1}\x{69A3}\x{69A4}' .
+'\x{69A5}\x{69A6}\x{69A7}\x{69A8}\x{69A9}\x{69AA}\x{69AB}\x{69AC}\x{69AD}' .
+'\x{69AE}\x{69AF}\x{69B0}\x{69B1}\x{69B2}\x{69B3}\x{69B4}\x{69B5}\x{69B6}' .
+'\x{69B7}\x{69B8}\x{69B9}\x{69BA}\x{69BB}\x{69BC}\x{69BD}\x{69BE}\x{69BF}' .
+'\x{69C1}\x{69C2}\x{69C3}\x{69C4}\x{69C5}\x{69C6}\x{69C7}\x{69C8}\x{69C9}' .
+'\x{69CA}\x{69CB}\x{69CC}\x{69CD}\x{69CE}\x{69CF}\x{69D0}\x{69D3}\x{69D4}' .
+'\x{69D8}\x{69D9}\x{69DA}\x{69DB}\x{69DC}\x{69DD}\x{69DE}\x{69DF}\x{69E0}' .
+'\x{69E1}\x{69E2}\x{69E3}\x{69E4}\x{69E5}\x{69E6}\x{69E7}\x{69E8}\x{69E9}' .
+'\x{69EA}\x{69EB}\x{69EC}\x{69ED}\x{69EE}\x{69EF}\x{69F0}\x{69F1}\x{69F2}' .
+'\x{69F3}\x{69F4}\x{69F5}\x{69F6}\x{69F7}\x{69F8}\x{69FA}\x{69FB}\x{69FC}' .
+'\x{69FD}\x{69FE}\x{69FF}\x{6A00}\x{6A01}\x{6A02}\x{6A04}\x{6A05}\x{6A06}' .
+'\x{6A07}\x{6A08}\x{6A09}\x{6A0A}\x{6A0B}\x{6A0D}\x{6A0E}\x{6A0F}\x{6A10}' .
+'\x{6A11}\x{6A12}\x{6A13}\x{6A14}\x{6A15}\x{6A16}\x{6A17}\x{6A18}\x{6A19}' .
+'\x{6A1A}\x{6A1B}\x{6A1D}\x{6A1E}\x{6A1F}\x{6A20}\x{6A21}\x{6A22}\x{6A23}' .
+'\x{6A25}\x{6A26}\x{6A27}\x{6A28}\x{6A29}\x{6A2A}\x{6A2B}\x{6A2C}\x{6A2D}' .
+'\x{6A2E}\x{6A2F}\x{6A30}\x{6A31}\x{6A32}\x{6A33}\x{6A34}\x{6A35}\x{6A36}' .
+'\x{6A38}\x{6A39}\x{6A3A}\x{6A3B}\x{6A3C}\x{6A3D}\x{6A3E}\x{6A3F}\x{6A40}' .
+'\x{6A41}\x{6A42}\x{6A43}\x{6A44}\x{6A45}\x{6A46}\x{6A47}\x{6A48}\x{6A49}' .
+'\x{6A4B}\x{6A4C}\x{6A4D}\x{6A4E}\x{6A4F}\x{6A50}\x{6A51}\x{6A52}\x{6A54}' .
+'\x{6A55}\x{6A56}\x{6A57}\x{6A58}\x{6A59}\x{6A5A}\x{6A5B}\x{6A5D}\x{6A5E}' .
+'\x{6A5F}\x{6A60}\x{6A61}\x{6A62}\x{6A63}\x{6A64}\x{6A65}\x{6A66}\x{6A67}' .
+'\x{6A68}\x{6A69}\x{6A6A}\x{6A6B}\x{6A6C}\x{6A6D}\x{6A6F}\x{6A71}\x{6A72}' .
+'\x{6A73}\x{6A74}\x{6A75}\x{6A76}\x{6A77}\x{6A78}\x{6A79}\x{6A7A}\x{6A7B}' .
+'\x{6A7C}\x{6A7D}\x{6A7E}\x{6A7F}\x{6A80}\x{6A81}\x{6A82}\x{6A83}\x{6A84}' .
+'\x{6A85}\x{6A87}\x{6A88}\x{6A89}\x{6A8B}\x{6A8C}\x{6A8D}\x{6A8E}\x{6A90}' .
+'\x{6A91}\x{6A92}\x{6A93}\x{6A94}\x{6A95}\x{6A96}\x{6A97}\x{6A98}\x{6A9A}' .
+'\x{6A9B}\x{6A9C}\x{6A9E}\x{6A9F}\x{6AA0}\x{6AA1}\x{6AA2}\x{6AA3}\x{6AA4}' .
+'\x{6AA5}\x{6AA6}\x{6AA7}\x{6AA8}\x{6AA9}\x{6AAB}\x{6AAC}\x{6AAD}\x{6AAE}' .
+'\x{6AAF}\x{6AB0}\x{6AB2}\x{6AB3}\x{6AB4}\x{6AB5}\x{6AB6}\x{6AB7}\x{6AB8}' .
+'\x{6AB9}\x{6ABA}\x{6ABB}\x{6ABC}\x{6ABD}\x{6ABF}\x{6AC1}\x{6AC2}\x{6AC3}' .
+'\x{6AC5}\x{6AC6}\x{6AC7}\x{6ACA}\x{6ACB}\x{6ACC}\x{6ACD}\x{6ACE}\x{6ACF}' .
+'\x{6AD0}\x{6AD1}\x{6AD2}\x{6AD3}\x{6AD4}\x{6AD5}\x{6AD6}\x{6AD7}\x{6AD9}' .
+'\x{6ADA}\x{6ADB}\x{6ADC}\x{6ADD}\x{6ADE}\x{6ADF}\x{6AE0}\x{6AE1}\x{6AE2}' .
+'\x{6AE3}\x{6AE4}\x{6AE5}\x{6AE6}\x{6AE7}\x{6AE8}\x{6AEA}\x{6AEB}\x{6AEC}' .
+'\x{6AED}\x{6AEE}\x{6AEF}\x{6AF0}\x{6AF1}\x{6AF2}\x{6AF3}\x{6AF4}\x{6AF5}' .
+'\x{6AF6}\x{6AF7}\x{6AF8}\x{6AF9}\x{6AFA}\x{6AFB}\x{6AFC}\x{6AFD}\x{6AFE}' .
+'\x{6AFF}\x{6B00}\x{6B01}\x{6B02}\x{6B03}\x{6B04}\x{6B05}\x{6B06}\x{6B07}' .
+'\x{6B08}\x{6B09}\x{6B0A}\x{6B0B}\x{6B0C}\x{6B0D}\x{6B0F}\x{6B10}\x{6B11}' .
+'\x{6B12}\x{6B13}\x{6B14}\x{6B15}\x{6B16}\x{6B17}\x{6B18}\x{6B19}\x{6B1A}' .
+'\x{6B1C}\x{6B1D}\x{6B1E}\x{6B1F}\x{6B20}\x{6B21}\x{6B22}\x{6B23}\x{6B24}' .
+'\x{6B25}\x{6B26}\x{6B27}\x{6B28}\x{6B29}\x{6B2A}\x{6B2B}\x{6B2C}\x{6B2D}' .
+'\x{6B2F}\x{6B30}\x{6B31}\x{6B32}\x{6B33}\x{6B34}\x{6B36}\x{6B37}\x{6B38}' .
+'\x{6B39}\x{6B3A}\x{6B3B}\x{6B3C}\x{6B3D}\x{6B3E}\x{6B3F}\x{6B41}\x{6B42}' .
+'\x{6B43}\x{6B44}\x{6B45}\x{6B46}\x{6B47}\x{6B48}\x{6B49}\x{6B4A}\x{6B4B}' .
+'\x{6B4C}\x{6B4D}\x{6B4E}\x{6B4F}\x{6B50}\x{6B51}\x{6B52}\x{6B53}\x{6B54}' .
+'\x{6B55}\x{6B56}\x{6B59}\x{6B5A}\x{6B5B}\x{6B5C}\x{6B5E}\x{6B5F}\x{6B60}' .
+'\x{6B61}\x{6B62}\x{6B63}\x{6B64}\x{6B65}\x{6B66}\x{6B67}\x{6B69}\x{6B6A}' .
+'\x{6B6B}\x{6B6D}\x{6B6F}\x{6B70}\x{6B72}\x{6B73}\x{6B74}\x{6B76}\x{6B77}' .
+'\x{6B78}\x{6B79}\x{6B7A}\x{6B7B}\x{6B7C}\x{6B7E}\x{6B7F}\x{6B80}\x{6B81}' .
+'\x{6B82}\x{6B83}\x{6B84}\x{6B85}\x{6B86}\x{6B87}\x{6B88}\x{6B89}\x{6B8A}' .
+'\x{6B8B}\x{6B8C}\x{6B8D}\x{6B8E}\x{6B8F}\x{6B90}\x{6B91}\x{6B92}\x{6B93}' .
+'\x{6B94}\x{6B95}\x{6B96}\x{6B97}\x{6B98}\x{6B99}\x{6B9A}\x{6B9B}\x{6B9C}' .
+'\x{6B9D}\x{6B9E}\x{6B9F}\x{6BA0}\x{6BA1}\x{6BA2}\x{6BA3}\x{6BA4}\x{6BA5}' .
+'\x{6BA6}\x{6BA7}\x{6BA8}\x{6BA9}\x{6BAA}\x{6BAB}\x{6BAC}\x{6BAD}\x{6BAE}' .
+'\x{6BAF}\x{6BB0}\x{6BB2}\x{6BB3}\x{6BB4}\x{6BB5}\x{6BB6}\x{6BB7}\x{6BB9}' .
+'\x{6BBA}\x{6BBB}\x{6BBC}\x{6BBD}\x{6BBE}\x{6BBF}\x{6BC0}\x{6BC1}\x{6BC2}' .
+'\x{6BC3}\x{6BC4}\x{6BC5}\x{6BC6}\x{6BC7}\x{6BC8}\x{6BC9}\x{6BCA}\x{6BCB}' .
+'\x{6BCC}\x{6BCD}\x{6BCE}\x{6BCF}\x{6BD0}\x{6BD1}\x{6BD2}\x{6BD3}\x{6BD4}' .
+'\x{6BD5}\x{6BD6}\x{6BD7}\x{6BD8}\x{6BD9}\x{6BDA}\x{6BDB}\x{6BDC}\x{6BDD}' .
+'\x{6BDE}\x{6BDF}\x{6BE0}\x{6BE1}\x{6BE2}\x{6BE3}\x{6BE4}\x{6BE5}\x{6BE6}' .
+'\x{6BE7}\x{6BE8}\x{6BEA}\x{6BEB}\x{6BEC}\x{6BED}\x{6BEE}\x{6BEF}\x{6BF0}' .
+'\x{6BF2}\x{6BF3}\x{6BF5}\x{6BF6}\x{6BF7}\x{6BF8}\x{6BF9}\x{6BFB}\x{6BFC}' .
+'\x{6BFD}\x{6BFE}\x{6BFF}\x{6C00}\x{6C01}\x{6C02}\x{6C03}\x{6C04}\x{6C05}' .
+'\x{6C06}\x{6C07}\x{6C08}\x{6C09}\x{6C0B}\x{6C0C}\x{6C0D}\x{6C0E}\x{6C0F}' .
+'\x{6C10}\x{6C11}\x{6C12}\x{6C13}\x{6C14}\x{6C15}\x{6C16}\x{6C18}\x{6C19}' .
+'\x{6C1A}\x{6C1B}\x{6C1D}\x{6C1E}\x{6C1F}\x{6C20}\x{6C21}\x{6C22}\x{6C23}' .
+'\x{6C24}\x{6C25}\x{6C26}\x{6C27}\x{6C28}\x{6C29}\x{6C2A}\x{6C2B}\x{6C2C}' .
+'\x{6C2E}\x{6C2F}\x{6C30}\x{6C31}\x{6C32}\x{6C33}\x{6C34}\x{6C35}\x{6C36}' .
+'\x{6C37}\x{6C38}\x{6C3A}\x{6C3B}\x{6C3D}\x{6C3E}\x{6C3F}\x{6C40}\x{6C41}' .
+'\x{6C42}\x{6C43}\x{6C44}\x{6C46}\x{6C47}\x{6C48}\x{6C49}\x{6C4A}\x{6C4B}' .
+'\x{6C4C}\x{6C4D}\x{6C4E}\x{6C4F}\x{6C50}\x{6C51}\x{6C52}\x{6C53}\x{6C54}' .
+'\x{6C55}\x{6C56}\x{6C57}\x{6C58}\x{6C59}\x{6C5A}\x{6C5B}\x{6C5C}\x{6C5D}' .
+'\x{6C5E}\x{6C5F}\x{6C60}\x{6C61}\x{6C62}\x{6C63}\x{6C64}\x{6C65}\x{6C66}' .
+'\x{6C67}\x{6C68}\x{6C69}\x{6C6A}\x{6C6B}\x{6C6D}\x{6C6F}\x{6C70}\x{6C71}' .
+'\x{6C72}\x{6C73}\x{6C74}\x{6C75}\x{6C76}\x{6C77}\x{6C78}\x{6C79}\x{6C7A}' .
+'\x{6C7B}\x{6C7C}\x{6C7D}\x{6C7E}\x{6C7F}\x{6C80}\x{6C81}\x{6C82}\x{6C83}' .
+'\x{6C84}\x{6C85}\x{6C86}\x{6C87}\x{6C88}\x{6C89}\x{6C8A}\x{6C8B}\x{6C8C}' .
+'\x{6C8D}\x{6C8E}\x{6C8F}\x{6C90}\x{6C91}\x{6C92}\x{6C93}\x{6C94}\x{6C95}' .
+'\x{6C96}\x{6C97}\x{6C98}\x{6C99}\x{6C9A}\x{6C9B}\x{6C9C}\x{6C9D}\x{6C9E}' .
+'\x{6C9F}\x{6CA1}\x{6CA2}\x{6CA3}\x{6CA4}\x{6CA5}\x{6CA6}\x{6CA7}\x{6CA8}' .
+'\x{6CA9}\x{6CAA}\x{6CAB}\x{6CAC}\x{6CAD}\x{6CAE}\x{6CAF}\x{6CB0}\x{6CB1}' .
+'\x{6CB2}\x{6CB3}\x{6CB4}\x{6CB5}\x{6CB6}\x{6CB7}\x{6CB8}\x{6CB9}\x{6CBA}' .
+'\x{6CBB}\x{6CBC}\x{6CBD}\x{6CBE}\x{6CBF}\x{6CC0}\x{6CC1}\x{6CC2}\x{6CC3}' .
+'\x{6CC4}\x{6CC5}\x{6CC6}\x{6CC7}\x{6CC8}\x{6CC9}\x{6CCA}\x{6CCB}\x{6CCC}' .
+'\x{6CCD}\x{6CCE}\x{6CCF}\x{6CD0}\x{6CD1}\x{6CD2}\x{6CD3}\x{6CD4}\x{6CD5}' .
+'\x{6CD6}\x{6CD7}\x{6CD9}\x{6CDA}\x{6CDB}\x{6CDC}\x{6CDD}\x{6CDE}\x{6CDF}' .
+'\x{6CE0}\x{6CE1}\x{6CE2}\x{6CE3}\x{6CE4}\x{6CE5}\x{6CE6}\x{6CE7}\x{6CE8}' .
+'\x{6CE9}\x{6CEA}\x{6CEB}\x{6CEC}\x{6CED}\x{6CEE}\x{6CEF}\x{6CF0}\x{6CF1}' .
+'\x{6CF2}\x{6CF3}\x{6CF5}\x{6CF6}\x{6CF7}\x{6CF8}\x{6CF9}\x{6CFA}\x{6CFB}' .
+'\x{6CFC}\x{6CFD}\x{6CFE}\x{6CFF}\x{6D00}\x{6D01}\x{6D03}\x{6D04}\x{6D05}' .
+'\x{6D06}\x{6D07}\x{6D08}\x{6D09}\x{6D0A}\x{6D0B}\x{6D0C}\x{6D0D}\x{6D0E}' .
+'\x{6D0F}\x{6D10}\x{6D11}\x{6D12}\x{6D13}\x{6D14}\x{6D15}\x{6D16}\x{6D17}' .
+'\x{6D18}\x{6D19}\x{6D1A}\x{6D1B}\x{6D1D}\x{6D1E}\x{6D1F}\x{6D20}\x{6D21}' .
+'\x{6D22}\x{6D23}\x{6D25}\x{6D26}\x{6D27}\x{6D28}\x{6D29}\x{6D2A}\x{6D2B}' .
+'\x{6D2C}\x{6D2D}\x{6D2E}\x{6D2F}\x{6D30}\x{6D31}\x{6D32}\x{6D33}\x{6D34}' .
+'\x{6D35}\x{6D36}\x{6D37}\x{6D38}\x{6D39}\x{6D3A}\x{6D3B}\x{6D3C}\x{6D3D}' .
+'\x{6D3E}\x{6D3F}\x{6D40}\x{6D41}\x{6D42}\x{6D43}\x{6D44}\x{6D45}\x{6D46}' .
+'\x{6D47}\x{6D48}\x{6D49}\x{6D4A}\x{6D4B}\x{6D4C}\x{6D4D}\x{6D4E}\x{6D4F}' .
+'\x{6D50}\x{6D51}\x{6D52}\x{6D53}\x{6D54}\x{6D55}\x{6D56}\x{6D57}\x{6D58}' .
+'\x{6D59}\x{6D5A}\x{6D5B}\x{6D5C}\x{6D5D}\x{6D5E}\x{6D5F}\x{6D60}\x{6D61}' .
+'\x{6D62}\x{6D63}\x{6D64}\x{6D65}\x{6D66}\x{6D67}\x{6D68}\x{6D69}\x{6D6A}' .
+'\x{6D6B}\x{6D6C}\x{6D6D}\x{6D6E}\x{6D6F}\x{6D70}\x{6D72}\x{6D73}\x{6D74}' .
+'\x{6D75}\x{6D76}\x{6D77}\x{6D78}\x{6D79}\x{6D7A}\x{6D7B}\x{6D7C}\x{6D7D}' .
+'\x{6D7E}\x{6D7F}\x{6D80}\x{6D82}\x{6D83}\x{6D84}\x{6D85}\x{6D86}\x{6D87}' .
+'\x{6D88}\x{6D89}\x{6D8A}\x{6D8B}\x{6D8C}\x{6D8D}\x{6D8E}\x{6D8F}\x{6D90}' .
+'\x{6D91}\x{6D92}\x{6D93}\x{6D94}\x{6D95}\x{6D97}\x{6D98}\x{6D99}\x{6D9A}' .
+'\x{6D9B}\x{6D9D}\x{6D9E}\x{6D9F}\x{6DA0}\x{6DA1}\x{6DA2}\x{6DA3}\x{6DA4}' .
+'\x{6DA5}\x{6DA6}\x{6DA7}\x{6DA8}\x{6DA9}\x{6DAA}\x{6DAB}\x{6DAC}\x{6DAD}' .
+'\x{6DAE}\x{6DAF}\x{6DB2}\x{6DB3}\x{6DB4}\x{6DB5}\x{6DB7}\x{6DB8}\x{6DB9}' .
+'\x{6DBA}\x{6DBB}\x{6DBC}\x{6DBD}\x{6DBE}\x{6DBF}\x{6DC0}\x{6DC1}\x{6DC2}' .
+'\x{6DC3}\x{6DC4}\x{6DC5}\x{6DC6}\x{6DC7}\x{6DC8}\x{6DC9}\x{6DCA}\x{6DCB}' .
+'\x{6DCC}\x{6DCD}\x{6DCE}\x{6DCF}\x{6DD0}\x{6DD1}\x{6DD2}\x{6DD3}\x{6DD4}' .
+'\x{6DD5}\x{6DD6}\x{6DD7}\x{6DD8}\x{6DD9}\x{6DDA}\x{6DDB}\x{6DDC}\x{6DDD}' .
+'\x{6DDE}\x{6DDF}\x{6DE0}\x{6DE1}\x{6DE2}\x{6DE3}\x{6DE4}\x{6DE5}\x{6DE6}' .
+'\x{6DE7}\x{6DE8}\x{6DE9}\x{6DEA}\x{6DEB}\x{6DEC}\x{6DED}\x{6DEE}\x{6DEF}' .
+'\x{6DF0}\x{6DF1}\x{6DF2}\x{6DF3}\x{6DF4}\x{6DF5}\x{6DF6}\x{6DF7}\x{6DF8}' .
+'\x{6DF9}\x{6DFA}\x{6DFB}\x{6DFC}\x{6DFD}\x{6E00}\x{6E03}\x{6E04}\x{6E05}' .
+'\x{6E07}\x{6E08}\x{6E09}\x{6E0A}\x{6E0B}\x{6E0C}\x{6E0D}\x{6E0E}\x{6E0F}' .
+'\x{6E10}\x{6E11}\x{6E14}\x{6E15}\x{6E16}\x{6E17}\x{6E19}\x{6E1A}\x{6E1B}' .
+'\x{6E1C}\x{6E1D}\x{6E1E}\x{6E1F}\x{6E20}\x{6E21}\x{6E22}\x{6E23}\x{6E24}' .
+'\x{6E25}\x{6E26}\x{6E27}\x{6E28}\x{6E29}\x{6E2B}\x{6E2C}\x{6E2D}\x{6E2E}' .
+'\x{6E2F}\x{6E30}\x{6E31}\x{6E32}\x{6E33}\x{6E34}\x{6E35}\x{6E36}\x{6E37}' .
+'\x{6E38}\x{6E39}\x{6E3A}\x{6E3B}\x{6E3C}\x{6E3D}\x{6E3E}\x{6E3F}\x{6E40}' .
+'\x{6E41}\x{6E42}\x{6E43}\x{6E44}\x{6E45}\x{6E46}\x{6E47}\x{6E48}\x{6E49}' .
+'\x{6E4A}\x{6E4B}\x{6E4D}\x{6E4E}\x{6E4F}\x{6E50}\x{6E51}\x{6E52}\x{6E53}' .
+'\x{6E54}\x{6E55}\x{6E56}\x{6E57}\x{6E58}\x{6E59}\x{6E5A}\x{6E5B}\x{6E5C}' .
+'\x{6E5D}\x{6E5E}\x{6E5F}\x{6E60}\x{6E61}\x{6E62}\x{6E63}\x{6E64}\x{6E65}' .
+'\x{6E66}\x{6E67}\x{6E68}\x{6E69}\x{6E6A}\x{6E6B}\x{6E6D}\x{6E6E}\x{6E6F}' .
+'\x{6E70}\x{6E71}\x{6E72}\x{6E73}\x{6E74}\x{6E75}\x{6E77}\x{6E78}\x{6E79}' .
+'\x{6E7E}\x{6E7F}\x{6E80}\x{6E81}\x{6E82}\x{6E83}\x{6E84}\x{6E85}\x{6E86}' .
+'\x{6E87}\x{6E88}\x{6E89}\x{6E8A}\x{6E8D}\x{6E8E}\x{6E8F}\x{6E90}\x{6E91}' .
+'\x{6E92}\x{6E93}\x{6E94}\x{6E96}\x{6E97}\x{6E98}\x{6E99}\x{6E9A}\x{6E9B}' .
+'\x{6E9C}\x{6E9D}\x{6E9E}\x{6E9F}\x{6EA0}\x{6EA1}\x{6EA2}\x{6EA3}\x{6EA4}' .
+'\x{6EA5}\x{6EA6}\x{6EA7}\x{6EA8}\x{6EA9}\x{6EAA}\x{6EAB}\x{6EAC}\x{6EAD}' .
+'\x{6EAE}\x{6EAF}\x{6EB0}\x{6EB1}\x{6EB2}\x{6EB3}\x{6EB4}\x{6EB5}\x{6EB6}' .
+'\x{6EB7}\x{6EB8}\x{6EB9}\x{6EBA}\x{6EBB}\x{6EBC}\x{6EBD}\x{6EBE}\x{6EBF}' .
+'\x{6EC0}\x{6EC1}\x{6EC2}\x{6EC3}\x{6EC4}\x{6EC5}\x{6EC6}\x{6EC7}\x{6EC8}' .
+'\x{6EC9}\x{6ECA}\x{6ECB}\x{6ECC}\x{6ECD}\x{6ECE}\x{6ECF}\x{6ED0}\x{6ED1}' .
+'\x{6ED2}\x{6ED3}\x{6ED4}\x{6ED5}\x{6ED6}\x{6ED7}\x{6ED8}\x{6ED9}\x{6EDA}' .
+'\x{6EDC}\x{6EDE}\x{6EDF}\x{6EE0}\x{6EE1}\x{6EE2}\x{6EE4}\x{6EE5}\x{6EE6}' .
+'\x{6EE7}\x{6EE8}\x{6EE9}\x{6EEA}\x{6EEB}\x{6EEC}\x{6EED}\x{6EEE}\x{6EEF}' .
+'\x{6EF0}\x{6EF1}\x{6EF2}\x{6EF3}\x{6EF4}\x{6EF5}\x{6EF6}\x{6EF7}\x{6EF8}' .
+'\x{6EF9}\x{6EFA}\x{6EFB}\x{6EFC}\x{6EFD}\x{6EFE}\x{6EFF}\x{6F00}\x{6F01}' .
+'\x{6F02}\x{6F03}\x{6F05}\x{6F06}\x{6F07}\x{6F08}\x{6F09}\x{6F0A}\x{6F0C}' .
+'\x{6F0D}\x{6F0E}\x{6F0F}\x{6F10}\x{6F11}\x{6F12}\x{6F13}\x{6F14}\x{6F15}' .
+'\x{6F16}\x{6F17}\x{6F18}\x{6F19}\x{6F1A}\x{6F1B}\x{6F1C}\x{6F1D}\x{6F1E}' .
+'\x{6F1F}\x{6F20}\x{6F21}\x{6F22}\x{6F23}\x{6F24}\x{6F25}\x{6F26}\x{6F27}' .
+'\x{6F28}\x{6F29}\x{6F2A}\x{6F2B}\x{6F2C}\x{6F2D}\x{6F2E}\x{6F2F}\x{6F30}' .
+'\x{6F31}\x{6F32}\x{6F33}\x{6F34}\x{6F35}\x{6F36}\x{6F37}\x{6F38}\x{6F39}' .
+'\x{6F3A}\x{6F3B}\x{6F3C}\x{6F3D}\x{6F3E}\x{6F3F}\x{6F40}\x{6F41}\x{6F43}' .
+'\x{6F44}\x{6F45}\x{6F46}\x{6F47}\x{6F49}\x{6F4B}\x{6F4C}\x{6F4D}\x{6F4E}' .
+'\x{6F4F}\x{6F50}\x{6F51}\x{6F52}\x{6F53}\x{6F54}\x{6F55}\x{6F56}\x{6F57}' .
+'\x{6F58}\x{6F59}\x{6F5A}\x{6F5B}\x{6F5C}\x{6F5D}\x{6F5E}\x{6F5F}\x{6F60}' .
+'\x{6F61}\x{6F62}\x{6F63}\x{6F64}\x{6F65}\x{6F66}\x{6F67}\x{6F68}\x{6F69}' .
+'\x{6F6A}\x{6F6B}\x{6F6C}\x{6F6D}\x{6F6E}\x{6F6F}\x{6F70}\x{6F71}\x{6F72}' .
+'\x{6F73}\x{6F74}\x{6F75}\x{6F76}\x{6F77}\x{6F78}\x{6F7A}\x{6F7B}\x{6F7C}' .
+'\x{6F7D}\x{6F7E}\x{6F7F}\x{6F80}\x{6F81}\x{6F82}\x{6F83}\x{6F84}\x{6F85}' .
+'\x{6F86}\x{6F87}\x{6F88}\x{6F89}\x{6F8A}\x{6F8B}\x{6F8C}\x{6F8D}\x{6F8E}' .
+'\x{6F8F}\x{6F90}\x{6F91}\x{6F92}\x{6F93}\x{6F94}\x{6F95}\x{6F96}\x{6F97}' .
+'\x{6F99}\x{6F9B}\x{6F9C}\x{6F9D}\x{6F9E}\x{6FA0}\x{6FA1}\x{6FA2}\x{6FA3}' .
+'\x{6FA4}\x{6FA5}\x{6FA6}\x{6FA7}\x{6FA8}\x{6FA9}\x{6FAA}\x{6FAB}\x{6FAC}' .
+'\x{6FAD}\x{6FAE}\x{6FAF}\x{6FB0}\x{6FB1}\x{6FB2}\x{6FB3}\x{6FB4}\x{6FB5}' .
+'\x{6FB6}\x{6FB8}\x{6FB9}\x{6FBA}\x{6FBB}\x{6FBC}\x{6FBD}\x{6FBE}\x{6FBF}' .
+'\x{6FC0}\x{6FC1}\x{6FC2}\x{6FC3}\x{6FC4}\x{6FC6}\x{6FC7}\x{6FC8}\x{6FC9}' .
+'\x{6FCA}\x{6FCB}\x{6FCC}\x{6FCD}\x{6FCE}\x{6FCF}\x{6FD1}\x{6FD2}\x{6FD4}' .
+'\x{6FD5}\x{6FD6}\x{6FD7}\x{6FD8}\x{6FD9}\x{6FDA}\x{6FDB}\x{6FDC}\x{6FDD}' .
+'\x{6FDE}\x{6FDF}\x{6FE0}\x{6FE1}\x{6FE2}\x{6FE3}\x{6FE4}\x{6FE5}\x{6FE6}' .
+'\x{6FE7}\x{6FE8}\x{6FE9}\x{6FEA}\x{6FEB}\x{6FEC}\x{6FED}\x{6FEE}\x{6FEF}' .
+'\x{6FF0}\x{6FF1}\x{6FF2}\x{6FF3}\x{6FF4}\x{6FF6}\x{6FF7}\x{6FF8}\x{6FF9}' .
+'\x{6FFA}\x{6FFB}\x{6FFC}\x{6FFE}\x{6FFF}\x{7000}\x{7001}\x{7002}\x{7003}' .
+'\x{7004}\x{7005}\x{7006}\x{7007}\x{7008}\x{7009}\x{700A}\x{700B}\x{700C}' .
+'\x{700D}\x{700E}\x{700F}\x{7011}\x{7012}\x{7014}\x{7015}\x{7016}\x{7017}' .
+'\x{7018}\x{7019}\x{701A}\x{701B}\x{701C}\x{701D}\x{701F}\x{7020}\x{7021}' .
+'\x{7022}\x{7023}\x{7024}\x{7025}\x{7026}\x{7027}\x{7028}\x{7029}\x{702A}' .
+'\x{702B}\x{702C}\x{702D}\x{702E}\x{702F}\x{7030}\x{7031}\x{7032}\x{7033}' .
+'\x{7034}\x{7035}\x{7036}\x{7037}\x{7038}\x{7039}\x{703A}\x{703B}\x{703C}' .
+'\x{703D}\x{703E}\x{703F}\x{7040}\x{7041}\x{7042}\x{7043}\x{7044}\x{7045}' .
+'\x{7046}\x{7048}\x{7049}\x{704A}\x{704C}\x{704D}\x{704F}\x{7050}\x{7051}' .
+'\x{7052}\x{7053}\x{7054}\x{7055}\x{7056}\x{7057}\x{7058}\x{7059}\x{705A}' .
+'\x{705B}\x{705C}\x{705D}\x{705E}\x{705F}\x{7060}\x{7061}\x{7062}\x{7063}' .
+'\x{7064}\x{7065}\x{7066}\x{7067}\x{7068}\x{7069}\x{706A}\x{706B}\x{706C}' .
+'\x{706D}\x{706E}\x{706F}\x{7070}\x{7071}\x{7074}\x{7075}\x{7076}\x{7077}' .
+'\x{7078}\x{7079}\x{707A}\x{707C}\x{707D}\x{707E}\x{707F}\x{7080}\x{7082}' .
+'\x{7083}\x{7084}\x{7085}\x{7086}\x{7087}\x{7088}\x{7089}\x{708A}\x{708B}' .
+'\x{708C}\x{708E}\x{708F}\x{7090}\x{7091}\x{7092}\x{7093}\x{7094}\x{7095}' .
+'\x{7096}\x{7098}\x{7099}\x{709A}\x{709C}\x{709D}\x{709E}\x{709F}\x{70A0}' .
+'\x{70A1}\x{70A2}\x{70A3}\x{70A4}\x{70A5}\x{70A6}\x{70A7}\x{70A8}\x{70A9}' .
+'\x{70AB}\x{70AC}\x{70AD}\x{70AE}\x{70AF}\x{70B0}\x{70B1}\x{70B3}\x{70B4}' .
+'\x{70B5}\x{70B7}\x{70B8}\x{70B9}\x{70BA}\x{70BB}\x{70BC}\x{70BD}\x{70BE}' .
+'\x{70BF}\x{70C0}\x{70C1}\x{70C2}\x{70C3}\x{70C4}\x{70C5}\x{70C6}\x{70C7}' .
+'\x{70C8}\x{70C9}\x{70CA}\x{70CB}\x{70CC}\x{70CD}\x{70CE}\x{70CF}\x{70D0}' .
+'\x{70D1}\x{70D2}\x{70D3}\x{70D4}\x{70D6}\x{70D7}\x{70D8}\x{70D9}\x{70DA}' .
+'\x{70DB}\x{70DC}\x{70DD}\x{70DE}\x{70DF}\x{70E0}\x{70E1}\x{70E2}\x{70E3}' .
+'\x{70E4}\x{70E5}\x{70E6}\x{70E7}\x{70E8}\x{70E9}\x{70EA}\x{70EB}\x{70EC}' .
+'\x{70ED}\x{70EE}\x{70EF}\x{70F0}\x{70F1}\x{70F2}\x{70F3}\x{70F4}\x{70F5}' .
+'\x{70F6}\x{70F7}\x{70F8}\x{70F9}\x{70FA}\x{70FB}\x{70FC}\x{70FD}\x{70FF}' .
+'\x{7100}\x{7101}\x{7102}\x{7103}\x{7104}\x{7105}\x{7106}\x{7107}\x{7109}' .
+'\x{710A}\x{710B}\x{710C}\x{710D}\x{710E}\x{710F}\x{7110}\x{7111}\x{7112}' .
+'\x{7113}\x{7115}\x{7116}\x{7117}\x{7118}\x{7119}\x{711A}\x{711B}\x{711C}' .
+'\x{711D}\x{711E}\x{711F}\x{7120}\x{7121}\x{7122}\x{7123}\x{7125}\x{7126}' .
+'\x{7127}\x{7128}\x{7129}\x{712A}\x{712B}\x{712C}\x{712D}\x{712E}\x{712F}' .
+'\x{7130}\x{7131}\x{7132}\x{7135}\x{7136}\x{7137}\x{7138}\x{7139}\x{713A}' .
+'\x{713B}\x{713D}\x{713E}\x{713F}\x{7140}\x{7141}\x{7142}\x{7143}\x{7144}' .
+'\x{7145}\x{7146}\x{7147}\x{7148}\x{7149}\x{714A}\x{714B}\x{714C}\x{714D}' .
+'\x{714E}\x{714F}\x{7150}\x{7151}\x{7152}\x{7153}\x{7154}\x{7156}\x{7158}' .
+'\x{7159}\x{715A}\x{715B}\x{715C}\x{715D}\x{715E}\x{715F}\x{7160}\x{7161}' .
+'\x{7162}\x{7163}\x{7164}\x{7165}\x{7166}\x{7167}\x{7168}\x{7169}\x{716A}' .
+'\x{716C}\x{716E}\x{716F}\x{7170}\x{7171}\x{7172}\x{7173}\x{7174}\x{7175}' .
+'\x{7176}\x{7177}\x{7178}\x{7179}\x{717A}\x{717B}\x{717C}\x{717D}\x{717E}' .
+'\x{717F}\x{7180}\x{7181}\x{7182}\x{7183}\x{7184}\x{7185}\x{7186}\x{7187}' .
+'\x{7188}\x{7189}\x{718A}\x{718B}\x{718C}\x{718E}\x{718F}\x{7190}\x{7191}' .
+'\x{7192}\x{7193}\x{7194}\x{7195}\x{7197}\x{7198}\x{7199}\x{719A}\x{719B}' .
+'\x{719C}\x{719D}\x{719E}\x{719F}\x{71A0}\x{71A1}\x{71A2}\x{71A3}\x{71A4}' .
+'\x{71A5}\x{71A7}\x{71A8}\x{71A9}\x{71AA}\x{71AC}\x{71AD}\x{71AE}\x{71AF}' .
+'\x{71B0}\x{71B1}\x{71B2}\x{71B3}\x{71B4}\x{71B5}\x{71B7}\x{71B8}\x{71B9}' .
+'\x{71BA}\x{71BB}\x{71BC}\x{71BD}\x{71BE}\x{71BF}\x{71C0}\x{71C1}\x{71C2}' .
+'\x{71C3}\x{71C4}\x{71C5}\x{71C6}\x{71C7}\x{71C8}\x{71C9}\x{71CA}\x{71CB}' .
+'\x{71CD}\x{71CE}\x{71CF}\x{71D0}\x{71D1}\x{71D2}\x{71D4}\x{71D5}\x{71D6}' .
+'\x{71D7}\x{71D8}\x{71D9}\x{71DA}\x{71DB}\x{71DC}\x{71DD}\x{71DE}\x{71DF}' .
+'\x{71E0}\x{71E1}\x{71E2}\x{71E3}\x{71E4}\x{71E5}\x{71E6}\x{71E7}\x{71E8}' .
+'\x{71E9}\x{71EA}\x{71EB}\x{71EC}\x{71ED}\x{71EE}\x{71EF}\x{71F0}\x{71F1}' .
+'\x{71F2}\x{71F4}\x{71F5}\x{71F6}\x{71F7}\x{71F8}\x{71F9}\x{71FB}\x{71FC}' .
+'\x{71FD}\x{71FE}\x{71FF}\x{7201}\x{7202}\x{7203}\x{7204}\x{7205}\x{7206}' .
+'\x{7207}\x{7208}\x{7209}\x{720A}\x{720C}\x{720D}\x{720E}\x{720F}\x{7210}' .
+'\x{7212}\x{7213}\x{7214}\x{7216}\x{7218}\x{7219}\x{721A}\x{721B}\x{721C}' .
+'\x{721D}\x{721E}\x{721F}\x{7221}\x{7222}\x{7223}\x{7226}\x{7227}\x{7228}' .
+'\x{7229}\x{722A}\x{722B}\x{722C}\x{722D}\x{722E}\x{7230}\x{7231}\x{7232}' .
+'\x{7233}\x{7235}\x{7236}\x{7237}\x{7238}\x{7239}\x{723A}\x{723B}\x{723C}' .
+'\x{723D}\x{723E}\x{723F}\x{7240}\x{7241}\x{7242}\x{7243}\x{7244}\x{7246}' .
+'\x{7247}\x{7248}\x{7249}\x{724A}\x{724B}\x{724C}\x{724D}\x{724F}\x{7251}' .
+'\x{7252}\x{7253}\x{7254}\x{7256}\x{7257}\x{7258}\x{7259}\x{725A}\x{725B}' .
+'\x{725C}\x{725D}\x{725E}\x{725F}\x{7260}\x{7261}\x{7262}\x{7263}\x{7264}' .
+'\x{7265}\x{7266}\x{7267}\x{7268}\x{7269}\x{726A}\x{726B}\x{726C}\x{726D}' .
+'\x{726E}\x{726F}\x{7270}\x{7271}\x{7272}\x{7273}\x{7274}\x{7275}\x{7276}' .
+'\x{7277}\x{7278}\x{7279}\x{727A}\x{727B}\x{727C}\x{727D}\x{727E}\x{727F}' .
+'\x{7280}\x{7281}\x{7282}\x{7283}\x{7284}\x{7285}\x{7286}\x{7287}\x{7288}' .
+'\x{7289}\x{728A}\x{728B}\x{728C}\x{728D}\x{728E}\x{728F}\x{7290}\x{7291}' .
+'\x{7292}\x{7293}\x{7294}\x{7295}\x{7296}\x{7297}\x{7298}\x{7299}\x{729A}' .
+'\x{729B}\x{729C}\x{729D}\x{729E}\x{729F}\x{72A1}\x{72A2}\x{72A3}\x{72A4}' .
+'\x{72A5}\x{72A6}\x{72A7}\x{72A8}\x{72A9}\x{72AA}\x{72AC}\x{72AD}\x{72AE}' .
+'\x{72AF}\x{72B0}\x{72B1}\x{72B2}\x{72B3}\x{72B4}\x{72B5}\x{72B6}\x{72B7}' .
+'\x{72B8}\x{72B9}\x{72BA}\x{72BB}\x{72BC}\x{72BD}\x{72BF}\x{72C0}\x{72C1}' .
+'\x{72C2}\x{72C3}\x{72C4}\x{72C5}\x{72C6}\x{72C7}\x{72C8}\x{72C9}\x{72CA}' .
+'\x{72CB}\x{72CC}\x{72CD}\x{72CE}\x{72CF}\x{72D0}\x{72D1}\x{72D2}\x{72D3}' .
+'\x{72D4}\x{72D5}\x{72D6}\x{72D7}\x{72D8}\x{72D9}\x{72DA}\x{72DB}\x{72DC}' .
+'\x{72DD}\x{72DE}\x{72DF}\x{72E0}\x{72E1}\x{72E2}\x{72E3}\x{72E4}\x{72E5}' .
+'\x{72E6}\x{72E7}\x{72E8}\x{72E9}\x{72EA}\x{72EB}\x{72EC}\x{72ED}\x{72EE}' .
+'\x{72EF}\x{72F0}\x{72F1}\x{72F2}\x{72F3}\x{72F4}\x{72F5}\x{72F6}\x{72F7}' .
+'\x{72F8}\x{72F9}\x{72FA}\x{72FB}\x{72FC}\x{72FD}\x{72FE}\x{72FF}\x{7300}' .
+'\x{7301}\x{7303}\x{7304}\x{7305}\x{7306}\x{7307}\x{7308}\x{7309}\x{730A}' .
+'\x{730B}\x{730C}\x{730D}\x{730E}\x{730F}\x{7311}\x{7312}\x{7313}\x{7314}' .
+'\x{7315}\x{7316}\x{7317}\x{7318}\x{7319}\x{731A}\x{731B}\x{731C}\x{731D}' .
+'\x{731E}\x{7320}\x{7321}\x{7322}\x{7323}\x{7324}\x{7325}\x{7326}\x{7327}' .
+'\x{7329}\x{732A}\x{732B}\x{732C}\x{732D}\x{732E}\x{7330}\x{7331}\x{7332}' .
+'\x{7333}\x{7334}\x{7335}\x{7336}\x{7337}\x{7338}\x{7339}\x{733A}\x{733B}' .
+'\x{733C}\x{733D}\x{733E}\x{733F}\x{7340}\x{7341}\x{7342}\x{7343}\x{7344}' .
+'\x{7345}\x{7346}\x{7347}\x{7348}\x{7349}\x{734A}\x{734B}\x{734C}\x{734D}' .
+'\x{734E}\x{7350}\x{7351}\x{7352}\x{7354}\x{7355}\x{7356}\x{7357}\x{7358}' .
+'\x{7359}\x{735A}\x{735B}\x{735C}\x{735D}\x{735E}\x{735F}\x{7360}\x{7361}' .
+'\x{7362}\x{7364}\x{7365}\x{7366}\x{7367}\x{7368}\x{7369}\x{736A}\x{736B}' .
+'\x{736C}\x{736D}\x{736E}\x{736F}\x{7370}\x{7371}\x{7372}\x{7373}\x{7374}' .
+'\x{7375}\x{7376}\x{7377}\x{7378}\x{7379}\x{737A}\x{737B}\x{737C}\x{737D}' .
+'\x{737E}\x{737F}\x{7380}\x{7381}\x{7382}\x{7383}\x{7384}\x{7385}\x{7386}' .
+'\x{7387}\x{7388}\x{7389}\x{738A}\x{738B}\x{738C}\x{738D}\x{738E}\x{738F}' .
+'\x{7390}\x{7391}\x{7392}\x{7393}\x{7394}\x{7395}\x{7396}\x{7397}\x{7398}' .
+'\x{7399}\x{739A}\x{739B}\x{739D}\x{739E}\x{739F}\x{73A0}\x{73A1}\x{73A2}' .
+'\x{73A3}\x{73A4}\x{73A5}\x{73A6}\x{73A7}\x{73A8}\x{73A9}\x{73AA}\x{73AB}' .
+'\x{73AC}\x{73AD}\x{73AE}\x{73AF}\x{73B0}\x{73B1}\x{73B2}\x{73B3}\x{73B4}' .
+'\x{73B5}\x{73B6}\x{73B7}\x{73B8}\x{73B9}\x{73BA}\x{73BB}\x{73BC}\x{73BD}' .
+'\x{73BE}\x{73BF}\x{73C0}\x{73C2}\x{73C3}\x{73C4}\x{73C5}\x{73C6}\x{73C7}' .
+'\x{73C8}\x{73C9}\x{73CA}\x{73CB}\x{73CC}\x{73CD}\x{73CE}\x{73CF}\x{73D0}' .
+'\x{73D1}\x{73D2}\x{73D3}\x{73D4}\x{73D5}\x{73D6}\x{73D7}\x{73D8}\x{73D9}' .
+'\x{73DA}\x{73DB}\x{73DC}\x{73DD}\x{73DE}\x{73DF}\x{73E0}\x{73E2}\x{73E3}' .
+'\x{73E5}\x{73E6}\x{73E7}\x{73E8}\x{73E9}\x{73EA}\x{73EB}\x{73EC}\x{73ED}' .
+'\x{73EE}\x{73EF}\x{73F0}\x{73F1}\x{73F2}\x{73F4}\x{73F5}\x{73F6}\x{73F7}' .
+'\x{73F8}\x{73F9}\x{73FA}\x{73FC}\x{73FD}\x{73FE}\x{73FF}\x{7400}\x{7401}' .
+'\x{7402}\x{7403}\x{7404}\x{7405}\x{7406}\x{7407}\x{7408}\x{7409}\x{740A}' .
+'\x{740B}\x{740C}\x{740D}\x{740E}\x{740F}\x{7410}\x{7411}\x{7412}\x{7413}' .
+'\x{7414}\x{7415}\x{7416}\x{7417}\x{7419}\x{741A}\x{741B}\x{741C}\x{741D}' .
+'\x{741E}\x{741F}\x{7420}\x{7421}\x{7422}\x{7423}\x{7424}\x{7425}\x{7426}' .
+'\x{7427}\x{7428}\x{7429}\x{742A}\x{742B}\x{742C}\x{742D}\x{742E}\x{742F}' .
+'\x{7430}\x{7431}\x{7432}\x{7433}\x{7434}\x{7435}\x{7436}\x{7437}\x{7438}' .
+'\x{743A}\x{743B}\x{743C}\x{743D}\x{743F}\x{7440}\x{7441}\x{7442}\x{7443}' .
+'\x{7444}\x{7445}\x{7446}\x{7448}\x{744A}\x{744B}\x{744C}\x{744D}\x{744E}' .
+'\x{744F}\x{7450}\x{7451}\x{7452}\x{7453}\x{7454}\x{7455}\x{7456}\x{7457}' .
+'\x{7459}\x{745A}\x{745B}\x{745C}\x{745D}\x{745E}\x{745F}\x{7461}\x{7462}' .
+'\x{7463}\x{7464}\x{7465}\x{7466}\x{7467}\x{7468}\x{7469}\x{746A}\x{746B}' .
+'\x{746C}\x{746D}\x{746E}\x{746F}\x{7470}\x{7471}\x{7472}\x{7473}\x{7474}' .
+'\x{7475}\x{7476}\x{7477}\x{7478}\x{7479}\x{747A}\x{747C}\x{747D}\x{747E}' .
+'\x{747F}\x{7480}\x{7481}\x{7482}\x{7483}\x{7485}\x{7486}\x{7487}\x{7488}' .
+'\x{7489}\x{748A}\x{748B}\x{748C}\x{748D}\x{748E}\x{748F}\x{7490}\x{7491}' .
+'\x{7492}\x{7493}\x{7494}\x{7495}\x{7497}\x{7498}\x{7499}\x{749A}\x{749B}' .
+'\x{749C}\x{749E}\x{749F}\x{74A0}\x{74A1}\x{74A3}\x{74A4}\x{74A5}\x{74A6}' .
+'\x{74A7}\x{74A8}\x{74A9}\x{74AA}\x{74AB}\x{74AC}\x{74AD}\x{74AE}\x{74AF}' .
+'\x{74B0}\x{74B1}\x{74B2}\x{74B3}\x{74B4}\x{74B5}\x{74B6}\x{74B7}\x{74B8}' .
+'\x{74B9}\x{74BA}\x{74BB}\x{74BC}\x{74BD}\x{74BE}\x{74BF}\x{74C0}\x{74C1}' .
+'\x{74C2}\x{74C3}\x{74C4}\x{74C5}\x{74C6}\x{74CA}\x{74CB}\x{74CD}\x{74CE}' .
+'\x{74CF}\x{74D0}\x{74D1}\x{74D2}\x{74D3}\x{74D4}\x{74D5}\x{74D6}\x{74D7}' .
+'\x{74D8}\x{74D9}\x{74DA}\x{74DB}\x{74DC}\x{74DD}\x{74DE}\x{74DF}\x{74E0}' .
+'\x{74E1}\x{74E2}\x{74E3}\x{74E4}\x{74E5}\x{74E6}\x{74E7}\x{74E8}\x{74E9}' .
+'\x{74EA}\x{74EC}\x{74ED}\x{74EE}\x{74EF}\x{74F0}\x{74F1}\x{74F2}\x{74F3}' .
+'\x{74F4}\x{74F5}\x{74F6}\x{74F7}\x{74F8}\x{74F9}\x{74FA}\x{74FB}\x{74FC}' .
+'\x{74FD}\x{74FE}\x{74FF}\x{7500}\x{7501}\x{7502}\x{7503}\x{7504}\x{7505}' .
+'\x{7506}\x{7507}\x{7508}\x{7509}\x{750A}\x{750B}\x{750C}\x{750D}\x{750F}' .
+'\x{7510}\x{7511}\x{7512}\x{7513}\x{7514}\x{7515}\x{7516}\x{7517}\x{7518}' .
+'\x{7519}\x{751A}\x{751B}\x{751C}\x{751D}\x{751E}\x{751F}\x{7521}\x{7522}' .
+'\x{7523}\x{7524}\x{7525}\x{7526}\x{7527}\x{7528}\x{7529}\x{752A}\x{752B}' .
+'\x{752C}\x{752D}\x{752E}\x{752F}\x{7530}\x{7531}\x{7532}\x{7533}\x{7535}' .
+'\x{7536}\x{7537}\x{7538}\x{7539}\x{753A}\x{753B}\x{753C}\x{753D}\x{753E}' .
+'\x{753F}\x{7540}\x{7542}\x{7543}\x{7544}\x{7545}\x{7546}\x{7547}\x{7548}' .
+'\x{7549}\x{754B}\x{754C}\x{754D}\x{754E}\x{754F}\x{7550}\x{7551}\x{7553}' .
+'\x{7554}\x{7556}\x{7557}\x{7558}\x{7559}\x{755A}\x{755B}\x{755C}\x{755D}' .
+'\x{755F}\x{7560}\x{7562}\x{7563}\x{7564}\x{7565}\x{7566}\x{7567}\x{7568}' .
+'\x{7569}\x{756A}\x{756B}\x{756C}\x{756D}\x{756E}\x{756F}\x{7570}\x{7572}' .
+'\x{7574}\x{7575}\x{7576}\x{7577}\x{7578}\x{7579}\x{757C}\x{757D}\x{757E}' .
+'\x{757F}\x{7580}\x{7581}\x{7582}\x{7583}\x{7584}\x{7586}\x{7587}\x{7588}' .
+'\x{7589}\x{758A}\x{758B}\x{758C}\x{758D}\x{758F}\x{7590}\x{7591}\x{7592}' .
+'\x{7593}\x{7594}\x{7595}\x{7596}\x{7597}\x{7598}\x{7599}\x{759A}\x{759B}' .
+'\x{759C}\x{759D}\x{759E}\x{759F}\x{75A0}\x{75A1}\x{75A2}\x{75A3}\x{75A4}' .
+'\x{75A5}\x{75A6}\x{75A7}\x{75A8}\x{75AA}\x{75AB}\x{75AC}\x{75AD}\x{75AE}' .
+'\x{75AF}\x{75B0}\x{75B1}\x{75B2}\x{75B3}\x{75B4}\x{75B5}\x{75B6}\x{75B8}' .
+'\x{75B9}\x{75BA}\x{75BB}\x{75BC}\x{75BD}\x{75BE}\x{75BF}\x{75C0}\x{75C1}' .
+'\x{75C2}\x{75C3}\x{75C4}\x{75C5}\x{75C6}\x{75C7}\x{75C8}\x{75C9}\x{75CA}' .
+'\x{75CB}\x{75CC}\x{75CD}\x{75CE}\x{75CF}\x{75D0}\x{75D1}\x{75D2}\x{75D3}' .
+'\x{75D4}\x{75D5}\x{75D6}\x{75D7}\x{75D8}\x{75D9}\x{75DA}\x{75DB}\x{75DD}' .
+'\x{75DE}\x{75DF}\x{75E0}\x{75E1}\x{75E2}\x{75E3}\x{75E4}\x{75E5}\x{75E6}' .
+'\x{75E7}\x{75E8}\x{75EA}\x{75EB}\x{75EC}\x{75ED}\x{75EF}\x{75F0}\x{75F1}' .
+'\x{75F2}\x{75F3}\x{75F4}\x{75F5}\x{75F6}\x{75F7}\x{75F8}\x{75F9}\x{75FA}' .
+'\x{75FB}\x{75FC}\x{75FD}\x{75FE}\x{75FF}\x{7600}\x{7601}\x{7602}\x{7603}' .
+'\x{7604}\x{7605}\x{7606}\x{7607}\x{7608}\x{7609}\x{760A}\x{760B}\x{760C}' .
+'\x{760D}\x{760E}\x{760F}\x{7610}\x{7611}\x{7612}\x{7613}\x{7614}\x{7615}' .
+'\x{7616}\x{7617}\x{7618}\x{7619}\x{761A}\x{761B}\x{761C}\x{761D}\x{761E}' .
+'\x{761F}\x{7620}\x{7621}\x{7622}\x{7623}\x{7624}\x{7625}\x{7626}\x{7627}' .
+'\x{7628}\x{7629}\x{762A}\x{762B}\x{762D}\x{762E}\x{762F}\x{7630}\x{7631}' .
+'\x{7632}\x{7633}\x{7634}\x{7635}\x{7636}\x{7637}\x{7638}\x{7639}\x{763A}' .
+'\x{763B}\x{763C}\x{763D}\x{763E}\x{763F}\x{7640}\x{7641}\x{7642}\x{7643}' .
+'\x{7646}\x{7647}\x{7648}\x{7649}\x{764A}\x{764B}\x{764C}\x{764D}\x{764F}' .
+'\x{7650}\x{7652}\x{7653}\x{7654}\x{7656}\x{7657}\x{7658}\x{7659}\x{765A}' .
+'\x{765B}\x{765C}\x{765D}\x{765E}\x{765F}\x{7660}\x{7661}\x{7662}\x{7663}' .
+'\x{7664}\x{7665}\x{7666}\x{7667}\x{7668}\x{7669}\x{766A}\x{766B}\x{766C}' .
+'\x{766D}\x{766E}\x{766F}\x{7670}\x{7671}\x{7672}\x{7674}\x{7675}\x{7676}' .
+'\x{7677}\x{7678}\x{7679}\x{767B}\x{767C}\x{767D}\x{767E}\x{767F}\x{7680}' .
+'\x{7681}\x{7682}\x{7683}\x{7684}\x{7685}\x{7686}\x{7687}\x{7688}\x{7689}' .
+'\x{768A}\x{768B}\x{768C}\x{768E}\x{768F}\x{7690}\x{7691}\x{7692}\x{7693}' .
+'\x{7694}\x{7695}\x{7696}\x{7697}\x{7698}\x{7699}\x{769A}\x{769B}\x{769C}' .
+'\x{769D}\x{769E}\x{769F}\x{76A0}\x{76A3}\x{76A4}\x{76A6}\x{76A7}\x{76A9}' .
+'\x{76AA}\x{76AB}\x{76AC}\x{76AD}\x{76AE}\x{76AF}\x{76B0}\x{76B1}\x{76B2}' .
+'\x{76B4}\x{76B5}\x{76B7}\x{76B8}\x{76BA}\x{76BB}\x{76BC}\x{76BD}\x{76BE}' .
+'\x{76BF}\x{76C0}\x{76C2}\x{76C3}\x{76C4}\x{76C5}\x{76C6}\x{76C7}\x{76C8}' .
+'\x{76C9}\x{76CA}\x{76CD}\x{76CE}\x{76CF}\x{76D0}\x{76D1}\x{76D2}\x{76D3}' .
+'\x{76D4}\x{76D5}\x{76D6}\x{76D7}\x{76D8}\x{76DA}\x{76DB}\x{76DC}\x{76DD}' .
+'\x{76DE}\x{76DF}\x{76E0}\x{76E1}\x{76E2}\x{76E3}\x{76E4}\x{76E5}\x{76E6}' .
+'\x{76E7}\x{76E8}\x{76E9}\x{76EA}\x{76EC}\x{76ED}\x{76EE}\x{76EF}\x{76F0}' .
+'\x{76F1}\x{76F2}\x{76F3}\x{76F4}\x{76F5}\x{76F6}\x{76F7}\x{76F8}\x{76F9}' .
+'\x{76FA}\x{76FB}\x{76FC}\x{76FD}\x{76FE}\x{76FF}\x{7701}\x{7703}\x{7704}' .
+'\x{7705}\x{7706}\x{7707}\x{7708}\x{7709}\x{770A}\x{770B}\x{770C}\x{770D}' .
+'\x{770F}\x{7710}\x{7711}\x{7712}\x{7713}\x{7714}\x{7715}\x{7716}\x{7717}' .
+'\x{7718}\x{7719}\x{771A}\x{771B}\x{771C}\x{771D}\x{771E}\x{771F}\x{7720}' .
+'\x{7722}\x{7723}\x{7725}\x{7726}\x{7727}\x{7728}\x{7729}\x{772A}\x{772C}' .
+'\x{772D}\x{772E}\x{772F}\x{7730}\x{7731}\x{7732}\x{7733}\x{7734}\x{7735}' .
+'\x{7736}\x{7737}\x{7738}\x{7739}\x{773A}\x{773B}\x{773C}\x{773D}\x{773E}' .
+'\x{7740}\x{7741}\x{7743}\x{7744}\x{7745}\x{7746}\x{7747}\x{7748}\x{7749}' .
+'\x{774A}\x{774B}\x{774C}\x{774D}\x{774E}\x{774F}\x{7750}\x{7751}\x{7752}' .
+'\x{7753}\x{7754}\x{7755}\x{7756}\x{7757}\x{7758}\x{7759}\x{775A}\x{775B}' .
+'\x{775C}\x{775D}\x{775E}\x{775F}\x{7760}\x{7761}\x{7762}\x{7763}\x{7765}' .
+'\x{7766}\x{7767}\x{7768}\x{7769}\x{776A}\x{776B}\x{776C}\x{776D}\x{776E}' .
+'\x{776F}\x{7770}\x{7771}\x{7772}\x{7773}\x{7774}\x{7775}\x{7776}\x{7777}' .
+'\x{7778}\x{7779}\x{777A}\x{777B}\x{777C}\x{777D}\x{777E}\x{777F}\x{7780}' .
+'\x{7781}\x{7782}\x{7783}\x{7784}\x{7785}\x{7786}\x{7787}\x{7788}\x{7789}' .
+'\x{778A}\x{778B}\x{778C}\x{778D}\x{778E}\x{778F}\x{7790}\x{7791}\x{7792}' .
+'\x{7793}\x{7794}\x{7795}\x{7797}\x{7798}\x{7799}\x{779A}\x{779B}\x{779C}' .
+'\x{779D}\x{779E}\x{779F}\x{77A0}\x{77A1}\x{77A2}\x{77A3}\x{77A5}\x{77A6}' .
+'\x{77A7}\x{77A8}\x{77A9}\x{77AA}\x{77AB}\x{77AC}\x{77AD}\x{77AE}\x{77AF}' .
+'\x{77B0}\x{77B1}\x{77B2}\x{77B3}\x{77B4}\x{77B5}\x{77B6}\x{77B7}\x{77B8}' .
+'\x{77B9}\x{77BA}\x{77BB}\x{77BC}\x{77BD}\x{77BF}\x{77C0}\x{77C2}\x{77C3}' .
+'\x{77C4}\x{77C5}\x{77C6}\x{77C7}\x{77C8}\x{77C9}\x{77CA}\x{77CB}\x{77CC}' .
+'\x{77CD}\x{77CE}\x{77CF}\x{77D0}\x{77D1}\x{77D3}\x{77D4}\x{77D5}\x{77D6}' .
+'\x{77D7}\x{77D8}\x{77D9}\x{77DA}\x{77DB}\x{77DC}\x{77DE}\x{77DF}\x{77E0}' .
+'\x{77E1}\x{77E2}\x{77E3}\x{77E5}\x{77E7}\x{77E8}\x{77E9}\x{77EA}\x{77EB}' .
+'\x{77EC}\x{77ED}\x{77EE}\x{77EF}\x{77F0}\x{77F1}\x{77F2}\x{77F3}\x{77F6}' .
+'\x{77F7}\x{77F8}\x{77F9}\x{77FA}\x{77FB}\x{77FC}\x{77FD}\x{77FE}\x{77FF}' .
+'\x{7800}\x{7801}\x{7802}\x{7803}\x{7804}\x{7805}\x{7806}\x{7808}\x{7809}' .
+'\x{780A}\x{780B}\x{780C}\x{780D}\x{780E}\x{780F}\x{7810}\x{7811}\x{7812}' .
+'\x{7813}\x{7814}\x{7815}\x{7816}\x{7817}\x{7818}\x{7819}\x{781A}\x{781B}' .
+'\x{781C}\x{781D}\x{781E}\x{781F}\x{7820}\x{7821}\x{7822}\x{7823}\x{7825}' .
+'\x{7826}\x{7827}\x{7828}\x{7829}\x{782A}\x{782B}\x{782C}\x{782D}\x{782E}' .
+'\x{782F}\x{7830}\x{7831}\x{7832}\x{7833}\x{7834}\x{7835}\x{7837}\x{7838}' .
+'\x{7839}\x{783A}\x{783B}\x{783C}\x{783D}\x{783E}\x{7840}\x{7841}\x{7843}' .
+'\x{7844}\x{7845}\x{7847}\x{7848}\x{7849}\x{784A}\x{784C}\x{784D}\x{784E}' .
+'\x{7850}\x{7851}\x{7852}\x{7853}\x{7854}\x{7855}\x{7856}\x{7857}\x{7858}' .
+'\x{7859}\x{785A}\x{785B}\x{785C}\x{785D}\x{785E}\x{785F}\x{7860}\x{7861}' .
+'\x{7862}\x{7863}\x{7864}\x{7865}\x{7866}\x{7867}\x{7868}\x{7869}\x{786A}' .
+'\x{786B}\x{786C}\x{786D}\x{786E}\x{786F}\x{7870}\x{7871}\x{7872}\x{7873}' .
+'\x{7874}\x{7875}\x{7877}\x{7878}\x{7879}\x{787A}\x{787B}\x{787C}\x{787D}' .
+'\x{787E}\x{787F}\x{7880}\x{7881}\x{7882}\x{7883}\x{7884}\x{7885}\x{7886}' .
+'\x{7887}\x{7889}\x{788A}\x{788B}\x{788C}\x{788D}\x{788E}\x{788F}\x{7890}' .
+'\x{7891}\x{7892}\x{7893}\x{7894}\x{7895}\x{7896}\x{7897}\x{7898}\x{7899}' .
+'\x{789A}\x{789B}\x{789C}\x{789D}\x{789E}\x{789F}\x{78A0}\x{78A1}\x{78A2}' .
+'\x{78A3}\x{78A4}\x{78A5}\x{78A6}\x{78A7}\x{78A8}\x{78A9}\x{78AA}\x{78AB}' .
+'\x{78AC}\x{78AD}\x{78AE}\x{78AF}\x{78B0}\x{78B1}\x{78B2}\x{78B3}\x{78B4}' .
+'\x{78B5}\x{78B6}\x{78B7}\x{78B8}\x{78B9}\x{78BA}\x{78BB}\x{78BC}\x{78BD}' .
+'\x{78BE}\x{78BF}\x{78C0}\x{78C1}\x{78C3}\x{78C4}\x{78C5}\x{78C6}\x{78C8}' .
+'\x{78C9}\x{78CA}\x{78CB}\x{78CC}\x{78CD}\x{78CE}\x{78CF}\x{78D0}\x{78D1}' .
+'\x{78D3}\x{78D4}\x{78D5}\x{78D6}\x{78D7}\x{78D8}\x{78D9}\x{78DA}\x{78DB}' .
+'\x{78DC}\x{78DD}\x{78DE}\x{78DF}\x{78E0}\x{78E1}\x{78E2}\x{78E3}\x{78E4}' .
+'\x{78E5}\x{78E6}\x{78E7}\x{78E8}\x{78E9}\x{78EA}\x{78EB}\x{78EC}\x{78ED}' .
+'\x{78EE}\x{78EF}\x{78F1}\x{78F2}\x{78F3}\x{78F4}\x{78F5}\x{78F6}\x{78F7}' .
+'\x{78F9}\x{78FA}\x{78FB}\x{78FC}\x{78FD}\x{78FE}\x{78FF}\x{7901}\x{7902}' .
+'\x{7903}\x{7904}\x{7905}\x{7906}\x{7907}\x{7909}\x{790A}\x{790B}\x{790C}' .
+'\x{790E}\x{790F}\x{7910}\x{7911}\x{7912}\x{7913}\x{7914}\x{7916}\x{7917}' .
+'\x{7918}\x{7919}\x{791A}\x{791B}\x{791C}\x{791D}\x{791E}\x{7921}\x{7922}' .
+'\x{7923}\x{7924}\x{7925}\x{7926}\x{7927}\x{7928}\x{7929}\x{792A}\x{792B}' .
+'\x{792C}\x{792D}\x{792E}\x{792F}\x{7930}\x{7931}\x{7933}\x{7934}\x{7935}' .
+'\x{7937}\x{7938}\x{7939}\x{793A}\x{793B}\x{793C}\x{793D}\x{793E}\x{793F}' .
+'\x{7940}\x{7941}\x{7942}\x{7943}\x{7944}\x{7945}\x{7946}\x{7947}\x{7948}' .
+'\x{7949}\x{794A}\x{794B}\x{794C}\x{794D}\x{794E}\x{794F}\x{7950}\x{7951}' .
+'\x{7952}\x{7953}\x{7954}\x{7955}\x{7956}\x{7957}\x{7958}\x{795A}\x{795B}' .
+'\x{795C}\x{795D}\x{795E}\x{795F}\x{7960}\x{7961}\x{7962}\x{7963}\x{7964}' .
+'\x{7965}\x{7966}\x{7967}\x{7968}\x{7969}\x{796A}\x{796B}\x{796D}\x{796F}' .
+'\x{7970}\x{7971}\x{7972}\x{7973}\x{7974}\x{7977}\x{7978}\x{7979}\x{797A}' .
+'\x{797B}\x{797C}\x{797D}\x{797E}\x{797F}\x{7980}\x{7981}\x{7982}\x{7983}' .
+'\x{7984}\x{7985}\x{7988}\x{7989}\x{798A}\x{798B}\x{798C}\x{798D}\x{798E}' .
+'\x{798F}\x{7990}\x{7991}\x{7992}\x{7993}\x{7994}\x{7995}\x{7996}\x{7997}' .
+'\x{7998}\x{7999}\x{799A}\x{799B}\x{799C}\x{799F}\x{79A0}\x{79A1}\x{79A2}' .
+'\x{79A3}\x{79A4}\x{79A5}\x{79A6}\x{79A7}\x{79A8}\x{79AA}\x{79AB}\x{79AC}' .
+'\x{79AD}\x{79AE}\x{79AF}\x{79B0}\x{79B1}\x{79B2}\x{79B3}\x{79B4}\x{79B5}' .
+'\x{79B6}\x{79B7}\x{79B8}\x{79B9}\x{79BA}\x{79BB}\x{79BD}\x{79BE}\x{79BF}' .
+'\x{79C0}\x{79C1}\x{79C2}\x{79C3}\x{79C5}\x{79C6}\x{79C8}\x{79C9}\x{79CA}' .
+'\x{79CB}\x{79CD}\x{79CE}\x{79CF}\x{79D0}\x{79D1}\x{79D2}\x{79D3}\x{79D5}' .
+'\x{79D6}\x{79D8}\x{79D9}\x{79DA}\x{79DB}\x{79DC}\x{79DD}\x{79DE}\x{79DF}' .
+'\x{79E0}\x{79E1}\x{79E2}\x{79E3}\x{79E4}\x{79E5}\x{79E6}\x{79E7}\x{79E8}' .
+'\x{79E9}\x{79EA}\x{79EB}\x{79EC}\x{79ED}\x{79EE}\x{79EF}\x{79F0}\x{79F1}' .
+'\x{79F2}\x{79F3}\x{79F4}\x{79F5}\x{79F6}\x{79F7}\x{79F8}\x{79F9}\x{79FA}' .
+'\x{79FB}\x{79FC}\x{79FD}\x{79FE}\x{79FF}\x{7A00}\x{7A02}\x{7A03}\x{7A04}' .
+'\x{7A05}\x{7A06}\x{7A08}\x{7A0A}\x{7A0B}\x{7A0C}\x{7A0D}\x{7A0E}\x{7A0F}' .
+'\x{7A10}\x{7A11}\x{7A12}\x{7A13}\x{7A14}\x{7A15}\x{7A16}\x{7A17}\x{7A18}' .
+'\x{7A19}\x{7A1A}\x{7A1B}\x{7A1C}\x{7A1D}\x{7A1E}\x{7A1F}\x{7A20}\x{7A21}' .
+'\x{7A22}\x{7A23}\x{7A24}\x{7A25}\x{7A26}\x{7A27}\x{7A28}\x{7A29}\x{7A2A}' .
+'\x{7A2B}\x{7A2D}\x{7A2E}\x{7A2F}\x{7A30}\x{7A31}\x{7A32}\x{7A33}\x{7A34}' .
+'\x{7A35}\x{7A37}\x{7A39}\x{7A3B}\x{7A3C}\x{7A3D}\x{7A3E}\x{7A3F}\x{7A40}' .
+'\x{7A41}\x{7A42}\x{7A43}\x{7A44}\x{7A45}\x{7A46}\x{7A47}\x{7A48}\x{7A49}' .
+'\x{7A4A}\x{7A4B}\x{7A4C}\x{7A4D}\x{7A4E}\x{7A50}\x{7A51}\x{7A52}\x{7A53}' .
+'\x{7A54}\x{7A55}\x{7A56}\x{7A57}\x{7A58}\x{7A59}\x{7A5A}\x{7A5B}\x{7A5C}' .
+'\x{7A5D}\x{7A5E}\x{7A5F}\x{7A60}\x{7A61}\x{7A62}\x{7A65}\x{7A66}\x{7A67}' .
+'\x{7A68}\x{7A69}\x{7A6B}\x{7A6C}\x{7A6D}\x{7A6E}\x{7A70}\x{7A71}\x{7A72}' .
+'\x{7A73}\x{7A74}\x{7A75}\x{7A76}\x{7A77}\x{7A78}\x{7A79}\x{7A7A}\x{7A7B}' .
+'\x{7A7C}\x{7A7D}\x{7A7E}\x{7A7F}\x{7A80}\x{7A81}\x{7A83}\x{7A84}\x{7A85}' .
+'\x{7A86}\x{7A87}\x{7A88}\x{7A89}\x{7A8A}\x{7A8B}\x{7A8C}\x{7A8D}\x{7A8E}' .
+'\x{7A8F}\x{7A90}\x{7A91}\x{7A92}\x{7A93}\x{7A94}\x{7A95}\x{7A96}\x{7A97}' .
+'\x{7A98}\x{7A99}\x{7A9C}\x{7A9D}\x{7A9E}\x{7A9F}\x{7AA0}\x{7AA1}\x{7AA2}' .
+'\x{7AA3}\x{7AA4}\x{7AA5}\x{7AA6}\x{7AA7}\x{7AA8}\x{7AA9}\x{7AAA}\x{7AAB}' .
+'\x{7AAC}\x{7AAD}\x{7AAE}\x{7AAF}\x{7AB0}\x{7AB1}\x{7AB2}\x{7AB3}\x{7AB4}' .
+'\x{7AB5}\x{7AB6}\x{7AB7}\x{7AB8}\x{7ABA}\x{7ABE}\x{7ABF}\x{7AC0}\x{7AC1}' .
+'\x{7AC4}\x{7AC5}\x{7AC7}\x{7AC8}\x{7AC9}\x{7ACA}\x{7ACB}\x{7ACC}\x{7ACD}' .
+'\x{7ACE}\x{7ACF}\x{7AD0}\x{7AD1}\x{7AD2}\x{7AD3}\x{7AD4}\x{7AD5}\x{7AD6}' .
+'\x{7AD8}\x{7AD9}\x{7ADB}\x{7ADC}\x{7ADD}\x{7ADE}\x{7ADF}\x{7AE0}\x{7AE1}' .
+'\x{7AE2}\x{7AE3}\x{7AE4}\x{7AE5}\x{7AE6}\x{7AE7}\x{7AE8}\x{7AEA}\x{7AEB}' .
+'\x{7AEC}\x{7AED}\x{7AEE}\x{7AEF}\x{7AF0}\x{7AF1}\x{7AF2}\x{7AF3}\x{7AF4}' .
+'\x{7AF6}\x{7AF7}\x{7AF8}\x{7AF9}\x{7AFA}\x{7AFB}\x{7AFD}\x{7AFE}\x{7AFF}' .
+'\x{7B00}\x{7B01}\x{7B02}\x{7B03}\x{7B04}\x{7B05}\x{7B06}\x{7B08}\x{7B09}' .
+'\x{7B0A}\x{7B0B}\x{7B0C}\x{7B0D}\x{7B0E}\x{7B0F}\x{7B10}\x{7B11}\x{7B12}' .
+'\x{7B13}\x{7B14}\x{7B15}\x{7B16}\x{7B17}\x{7B18}\x{7B19}\x{7B1A}\x{7B1B}' .
+'\x{7B1C}\x{7B1D}\x{7B1E}\x{7B20}\x{7B21}\x{7B22}\x{7B23}\x{7B24}\x{7B25}' .
+'\x{7B26}\x{7B28}\x{7B2A}\x{7B2B}\x{7B2C}\x{7B2D}\x{7B2E}\x{7B2F}\x{7B30}' .
+'\x{7B31}\x{7B32}\x{7B33}\x{7B34}\x{7B35}\x{7B36}\x{7B37}\x{7B38}\x{7B39}' .
+'\x{7B3A}\x{7B3B}\x{7B3C}\x{7B3D}\x{7B3E}\x{7B3F}\x{7B40}\x{7B41}\x{7B43}' .
+'\x{7B44}\x{7B45}\x{7B46}\x{7B47}\x{7B48}\x{7B49}\x{7B4A}\x{7B4B}\x{7B4C}' .
+'\x{7B4D}\x{7B4E}\x{7B4F}\x{7B50}\x{7B51}\x{7B52}\x{7B54}\x{7B55}\x{7B56}' .
+'\x{7B57}\x{7B58}\x{7B59}\x{7B5A}\x{7B5B}\x{7B5C}\x{7B5D}\x{7B5E}\x{7B5F}' .
+'\x{7B60}\x{7B61}\x{7B62}\x{7B63}\x{7B64}\x{7B65}\x{7B66}\x{7B67}\x{7B68}' .
+'\x{7B69}\x{7B6A}\x{7B6B}\x{7B6C}\x{7B6D}\x{7B6E}\x{7B70}\x{7B71}\x{7B72}' .
+'\x{7B73}\x{7B74}\x{7B75}\x{7B76}\x{7B77}\x{7B78}\x{7B79}\x{7B7B}\x{7B7C}' .
+'\x{7B7D}\x{7B7E}\x{7B7F}\x{7B80}\x{7B81}\x{7B82}\x{7B83}\x{7B84}\x{7B85}' .
+'\x{7B87}\x{7B88}\x{7B89}\x{7B8A}\x{7B8B}\x{7B8C}\x{7B8D}\x{7B8E}\x{7B8F}' .
+'\x{7B90}\x{7B91}\x{7B93}\x{7B94}\x{7B95}\x{7B96}\x{7B97}\x{7B98}\x{7B99}' .
+'\x{7B9A}\x{7B9B}\x{7B9C}\x{7B9D}\x{7B9E}\x{7B9F}\x{7BA0}\x{7BA1}\x{7BA2}' .
+'\x{7BA4}\x{7BA6}\x{7BA7}\x{7BA8}\x{7BA9}\x{7BAA}\x{7BAB}\x{7BAC}\x{7BAD}' .
+'\x{7BAE}\x{7BAF}\x{7BB1}\x{7BB3}\x{7BB4}\x{7BB5}\x{7BB6}\x{7BB7}\x{7BB8}' .
+'\x{7BB9}\x{7BBA}\x{7BBB}\x{7BBC}\x{7BBD}\x{7BBE}\x{7BBF}\x{7BC0}\x{7BC1}' .
+'\x{7BC2}\x{7BC3}\x{7BC4}\x{7BC5}\x{7BC6}\x{7BC7}\x{7BC8}\x{7BC9}\x{7BCA}' .
+'\x{7BCB}\x{7BCC}\x{7BCD}\x{7BCE}\x{7BD0}\x{7BD1}\x{7BD2}\x{7BD3}\x{7BD4}' .
+'\x{7BD5}\x{7BD6}\x{7BD7}\x{7BD8}\x{7BD9}\x{7BDA}\x{7BDB}\x{7BDC}\x{7BDD}' .
+'\x{7BDE}\x{7BDF}\x{7BE0}\x{7BE1}\x{7BE2}\x{7BE3}\x{7BE4}\x{7BE5}\x{7BE6}' .
+'\x{7BE7}\x{7BE8}\x{7BE9}\x{7BEA}\x{7BEB}\x{7BEC}\x{7BED}\x{7BEE}\x{7BEF}' .
+'\x{7BF0}\x{7BF1}\x{7BF2}\x{7BF3}\x{7BF4}\x{7BF5}\x{7BF6}\x{7BF7}\x{7BF8}' .
+'\x{7BF9}\x{7BFB}\x{7BFC}\x{7BFD}\x{7BFE}\x{7BFF}\x{7C00}\x{7C01}\x{7C02}' .
+'\x{7C03}\x{7C04}\x{7C05}\x{7C06}\x{7C07}\x{7C08}\x{7C09}\x{7C0A}\x{7C0B}' .
+'\x{7C0C}\x{7C0D}\x{7C0E}\x{7C0F}\x{7C10}\x{7C11}\x{7C12}\x{7C13}\x{7C15}' .
+'\x{7C16}\x{7C17}\x{7C18}\x{7C19}\x{7C1A}\x{7C1C}\x{7C1D}\x{7C1E}\x{7C1F}' .
+'\x{7C20}\x{7C21}\x{7C22}\x{7C23}\x{7C24}\x{7C25}\x{7C26}\x{7C27}\x{7C28}' .
+'\x{7C29}\x{7C2A}\x{7C2B}\x{7C2C}\x{7C2D}\x{7C30}\x{7C31}\x{7C32}\x{7C33}' .
+'\x{7C34}\x{7C35}\x{7C36}\x{7C37}\x{7C38}\x{7C39}\x{7C3A}\x{7C3B}\x{7C3C}' .
+'\x{7C3D}\x{7C3E}\x{7C3F}\x{7C40}\x{7C41}\x{7C42}\x{7C43}\x{7C44}\x{7C45}' .
+'\x{7C46}\x{7C47}\x{7C48}\x{7C49}\x{7C4A}\x{7C4B}\x{7C4C}\x{7C4D}\x{7C4E}' .
+'\x{7C50}\x{7C51}\x{7C53}\x{7C54}\x{7C56}\x{7C57}\x{7C58}\x{7C59}\x{7C5A}' .
+'\x{7C5B}\x{7C5C}\x{7C5E}\x{7C5F}\x{7C60}\x{7C61}\x{7C62}\x{7C63}\x{7C64}' .
+'\x{7C65}\x{7C66}\x{7C67}\x{7C68}\x{7C69}\x{7C6A}\x{7C6B}\x{7C6C}\x{7C6D}' .
+'\x{7C6E}\x{7C6F}\x{7C70}\x{7C71}\x{7C72}\x{7C73}\x{7C74}\x{7C75}\x{7C77}' .
+'\x{7C78}\x{7C79}\x{7C7A}\x{7C7B}\x{7C7C}\x{7C7D}\x{7C7E}\x{7C7F}\x{7C80}' .
+'\x{7C81}\x{7C82}\x{7C84}\x{7C85}\x{7C86}\x{7C88}\x{7C89}\x{7C8A}\x{7C8B}' .
+'\x{7C8C}\x{7C8D}\x{7C8E}\x{7C8F}\x{7C90}\x{7C91}\x{7C92}\x{7C94}\x{7C95}' .
+'\x{7C96}\x{7C97}\x{7C98}\x{7C99}\x{7C9B}\x{7C9C}\x{7C9D}\x{7C9E}\x{7C9F}' .
+'\x{7CA0}\x{7CA1}\x{7CA2}\x{7CA3}\x{7CA4}\x{7CA5}\x{7CA6}\x{7CA7}\x{7CA8}' .
+'\x{7CA9}\x{7CAA}\x{7CAD}\x{7CAE}\x{7CAF}\x{7CB0}\x{7CB1}\x{7CB2}\x{7CB3}' .
+'\x{7CB4}\x{7CB5}\x{7CB6}\x{7CB7}\x{7CB8}\x{7CB9}\x{7CBA}\x{7CBB}\x{7CBC}' .
+'\x{7CBD}\x{7CBE}\x{7CBF}\x{7CC0}\x{7CC1}\x{7CC2}\x{7CC3}\x{7CC4}\x{7CC5}' .
+'\x{7CC6}\x{7CC7}\x{7CC8}\x{7CC9}\x{7CCA}\x{7CCB}\x{7CCC}\x{7CCD}\x{7CCE}' .
+'\x{7CCF}\x{7CD0}\x{7CD1}\x{7CD2}\x{7CD4}\x{7CD5}\x{7CD6}\x{7CD7}\x{7CD8}' .
+'\x{7CD9}\x{7CDC}\x{7CDD}\x{7CDE}\x{7CDF}\x{7CE0}\x{7CE2}\x{7CE4}\x{7CE7}' .
+'\x{7CE8}\x{7CE9}\x{7CEA}\x{7CEB}\x{7CEC}\x{7CED}\x{7CEE}\x{7CEF}\x{7CF0}' .
+'\x{7CF1}\x{7CF2}\x{7CF3}\x{7CF4}\x{7CF5}\x{7CF6}\x{7CF7}\x{7CF8}\x{7CF9}' .
+'\x{7CFA}\x{7CFB}\x{7CFD}\x{7CFE}\x{7D00}\x{7D01}\x{7D02}\x{7D03}\x{7D04}' .
+'\x{7D05}\x{7D06}\x{7D07}\x{7D08}\x{7D09}\x{7D0A}\x{7D0B}\x{7D0C}\x{7D0D}' .
+'\x{7D0E}\x{7D0F}\x{7D10}\x{7D11}\x{7D12}\x{7D13}\x{7D14}\x{7D15}\x{7D16}' .
+'\x{7D17}\x{7D18}\x{7D19}\x{7D1A}\x{7D1B}\x{7D1C}\x{7D1D}\x{7D1E}\x{7D1F}' .
+'\x{7D20}\x{7D21}\x{7D22}\x{7D24}\x{7D25}\x{7D26}\x{7D27}\x{7D28}\x{7D29}' .
+'\x{7D2B}\x{7D2C}\x{7D2E}\x{7D2F}\x{7D30}\x{7D31}\x{7D32}\x{7D33}\x{7D34}' .
+'\x{7D35}\x{7D36}\x{7D37}\x{7D38}\x{7D39}\x{7D3A}\x{7D3B}\x{7D3C}\x{7D3D}' .
+'\x{7D3E}\x{7D3F}\x{7D40}\x{7D41}\x{7D42}\x{7D43}\x{7D44}\x{7D45}\x{7D46}' .
+'\x{7D47}\x{7D49}\x{7D4A}\x{7D4B}\x{7D4C}\x{7D4E}\x{7D4F}\x{7D50}\x{7D51}' .
+'\x{7D52}\x{7D53}\x{7D54}\x{7D55}\x{7D56}\x{7D57}\x{7D58}\x{7D59}\x{7D5B}' .
+'\x{7D5C}\x{7D5D}\x{7D5E}\x{7D5F}\x{7D60}\x{7D61}\x{7D62}\x{7D63}\x{7D65}' .
+'\x{7D66}\x{7D67}\x{7D68}\x{7D69}\x{7D6A}\x{7D6B}\x{7D6C}\x{7D6D}\x{7D6E}' .
+'\x{7D6F}\x{7D70}\x{7D71}\x{7D72}\x{7D73}\x{7D74}\x{7D75}\x{7D76}\x{7D77}' .
+'\x{7D79}\x{7D7A}\x{7D7B}\x{7D7C}\x{7D7D}\x{7D7E}\x{7D7F}\x{7D80}\x{7D81}' .
+'\x{7D83}\x{7D84}\x{7D85}\x{7D86}\x{7D87}\x{7D88}\x{7D89}\x{7D8A}\x{7D8B}' .
+'\x{7D8C}\x{7D8D}\x{7D8E}\x{7D8F}\x{7D90}\x{7D91}\x{7D92}\x{7D93}\x{7D94}' .
+'\x{7D96}\x{7D97}\x{7D99}\x{7D9B}\x{7D9C}\x{7D9D}\x{7D9E}\x{7D9F}\x{7DA0}' .
+'\x{7DA1}\x{7DA2}\x{7DA3}\x{7DA5}\x{7DA6}\x{7DA7}\x{7DA9}\x{7DAA}\x{7DAB}' .
+'\x{7DAC}\x{7DAD}\x{7DAE}\x{7DAF}\x{7DB0}\x{7DB1}\x{7DB2}\x{7DB3}\x{7DB4}' .
+'\x{7DB5}\x{7DB6}\x{7DB7}\x{7DB8}\x{7DB9}\x{7DBA}\x{7DBB}\x{7DBC}\x{7DBD}' .
+'\x{7DBE}\x{7DBF}\x{7DC0}\x{7DC1}\x{7DC2}\x{7DC3}\x{7DC4}\x{7DC5}\x{7DC6}' .
+'\x{7DC7}\x{7DC8}\x{7DC9}\x{7DCA}\x{7DCB}\x{7DCC}\x{7DCE}\x{7DCF}\x{7DD0}' .
+'\x{7DD1}\x{7DD2}\x{7DD4}\x{7DD5}\x{7DD6}\x{7DD7}\x{7DD8}\x{7DD9}\x{7DDA}' .
+'\x{7DDB}\x{7DDD}\x{7DDE}\x{7DDF}\x{7DE0}\x{7DE1}\x{7DE2}\x{7DE3}\x{7DE6}' .
+'\x{7DE7}\x{7DE8}\x{7DE9}\x{7DEA}\x{7DEC}\x{7DED}\x{7DEE}\x{7DEF}\x{7DF0}' .
+'\x{7DF1}\x{7DF2}\x{7DF3}\x{7DF4}\x{7DF5}\x{7DF6}\x{7DF7}\x{7DF8}\x{7DF9}' .
+'\x{7DFA}\x{7DFB}\x{7DFC}\x{7E00}\x{7E01}\x{7E02}\x{7E03}\x{7E04}\x{7E05}' .
+'\x{7E06}\x{7E07}\x{7E08}\x{7E09}\x{7E0A}\x{7E0B}\x{7E0C}\x{7E0D}\x{7E0E}' .
+'\x{7E0F}\x{7E10}\x{7E11}\x{7E12}\x{7E13}\x{7E14}\x{7E15}\x{7E16}\x{7E17}' .
+'\x{7E19}\x{7E1A}\x{7E1B}\x{7E1C}\x{7E1D}\x{7E1E}\x{7E1F}\x{7E20}\x{7E21}' .
+'\x{7E22}\x{7E23}\x{7E24}\x{7E25}\x{7E26}\x{7E27}\x{7E28}\x{7E29}\x{7E2A}' .
+'\x{7E2B}\x{7E2C}\x{7E2D}\x{7E2E}\x{7E2F}\x{7E30}\x{7E31}\x{7E32}\x{7E33}' .
+'\x{7E34}\x{7E35}\x{7E36}\x{7E37}\x{7E38}\x{7E39}\x{7E3A}\x{7E3B}\x{7E3C}' .
+'\x{7E3D}\x{7E3E}\x{7E3F}\x{7E40}\x{7E41}\x{7E42}\x{7E43}\x{7E44}\x{7E45}' .
+'\x{7E46}\x{7E47}\x{7E48}\x{7E49}\x{7E4C}\x{7E4D}\x{7E4E}\x{7E4F}\x{7E50}' .
+'\x{7E51}\x{7E52}\x{7E53}\x{7E54}\x{7E55}\x{7E56}\x{7E57}\x{7E58}\x{7E59}' .
+'\x{7E5A}\x{7E5C}\x{7E5D}\x{7E5E}\x{7E5F}\x{7E60}\x{7E61}\x{7E62}\x{7E63}' .
+'\x{7E65}\x{7E66}\x{7E67}\x{7E68}\x{7E69}\x{7E6A}\x{7E6B}\x{7E6C}\x{7E6D}' .
+'\x{7E6E}\x{7E6F}\x{7E70}\x{7E71}\x{7E72}\x{7E73}\x{7E74}\x{7E75}\x{7E76}' .
+'\x{7E77}\x{7E78}\x{7E79}\x{7E7A}\x{7E7B}\x{7E7C}\x{7E7D}\x{7E7E}\x{7E7F}' .
+'\x{7E80}\x{7E81}\x{7E82}\x{7E83}\x{7E84}\x{7E85}\x{7E86}\x{7E87}\x{7E88}' .
+'\x{7E89}\x{7E8A}\x{7E8B}\x{7E8C}\x{7E8D}\x{7E8E}\x{7E8F}\x{7E90}\x{7E91}' .
+'\x{7E92}\x{7E93}\x{7E94}\x{7E95}\x{7E96}\x{7E97}\x{7E98}\x{7E99}\x{7E9A}' .
+'\x{7E9B}\x{7E9C}\x{7E9E}\x{7E9F}\x{7EA0}\x{7EA1}\x{7EA2}\x{7EA3}\x{7EA4}' .
+'\x{7EA5}\x{7EA6}\x{7EA7}\x{7EA8}\x{7EA9}\x{7EAA}\x{7EAB}\x{7EAC}\x{7EAD}' .
+'\x{7EAE}\x{7EAF}\x{7EB0}\x{7EB1}\x{7EB2}\x{7EB3}\x{7EB4}\x{7EB5}\x{7EB6}' .
+'\x{7EB7}\x{7EB8}\x{7EB9}\x{7EBA}\x{7EBB}\x{7EBC}\x{7EBD}\x{7EBE}\x{7EBF}' .
+'\x{7EC0}\x{7EC1}\x{7EC2}\x{7EC3}\x{7EC4}\x{7EC5}\x{7EC6}\x{7EC7}\x{7EC8}' .
+'\x{7EC9}\x{7ECA}\x{7ECB}\x{7ECC}\x{7ECD}\x{7ECE}\x{7ECF}\x{7ED0}\x{7ED1}' .
+'\x{7ED2}\x{7ED3}\x{7ED4}\x{7ED5}\x{7ED6}\x{7ED7}\x{7ED8}\x{7ED9}\x{7EDA}' .
+'\x{7EDB}\x{7EDC}\x{7EDD}\x{7EDE}\x{7EDF}\x{7EE0}\x{7EE1}\x{7EE2}\x{7EE3}' .
+'\x{7EE4}\x{7EE5}\x{7EE6}\x{7EE7}\x{7EE8}\x{7EE9}\x{7EEA}\x{7EEB}\x{7EEC}' .
+'\x{7EED}\x{7EEE}\x{7EEF}\x{7EF0}\x{7EF1}\x{7EF2}\x{7EF3}\x{7EF4}\x{7EF5}' .
+'\x{7EF6}\x{7EF7}\x{7EF8}\x{7EF9}\x{7EFA}\x{7EFB}\x{7EFC}\x{7EFD}\x{7EFE}' .
+'\x{7EFF}\x{7F00}\x{7F01}\x{7F02}\x{7F03}\x{7F04}\x{7F05}\x{7F06}\x{7F07}' .
+'\x{7F08}\x{7F09}\x{7F0A}\x{7F0B}\x{7F0C}\x{7F0D}\x{7F0E}\x{7F0F}\x{7F10}' .
+'\x{7F11}\x{7F12}\x{7F13}\x{7F14}\x{7F15}\x{7F16}\x{7F17}\x{7F18}\x{7F19}' .
+'\x{7F1A}\x{7F1B}\x{7F1C}\x{7F1D}\x{7F1E}\x{7F1F}\x{7F20}\x{7F21}\x{7F22}' .
+'\x{7F23}\x{7F24}\x{7F25}\x{7F26}\x{7F27}\x{7F28}\x{7F29}\x{7F2A}\x{7F2B}' .
+'\x{7F2C}\x{7F2D}\x{7F2E}\x{7F2F}\x{7F30}\x{7F31}\x{7F32}\x{7F33}\x{7F34}' .
+'\x{7F35}\x{7F36}\x{7F37}\x{7F38}\x{7F39}\x{7F3A}\x{7F3D}\x{7F3E}\x{7F3F}' .
+'\x{7F40}\x{7F42}\x{7F43}\x{7F44}\x{7F45}\x{7F47}\x{7F48}\x{7F49}\x{7F4A}' .
+'\x{7F4B}\x{7F4C}\x{7F4D}\x{7F4E}\x{7F4F}\x{7F50}\x{7F51}\x{7F52}\x{7F53}' .
+'\x{7F54}\x{7F55}\x{7F56}\x{7F57}\x{7F58}\x{7F5A}\x{7F5B}\x{7F5C}\x{7F5D}' .
+'\x{7F5E}\x{7F5F}\x{7F60}\x{7F61}\x{7F62}\x{7F63}\x{7F64}\x{7F65}\x{7F66}' .
+'\x{7F67}\x{7F68}\x{7F69}\x{7F6A}\x{7F6B}\x{7F6C}\x{7F6D}\x{7F6E}\x{7F6F}' .
+'\x{7F70}\x{7F71}\x{7F72}\x{7F73}\x{7F74}\x{7F75}\x{7F76}\x{7F77}\x{7F78}' .
+'\x{7F79}\x{7F7A}\x{7F7B}\x{7F7C}\x{7F7D}\x{7F7E}\x{7F7F}\x{7F80}\x{7F81}' .
+'\x{7F82}\x{7F83}\x{7F85}\x{7F86}\x{7F87}\x{7F88}\x{7F89}\x{7F8A}\x{7F8B}' .
+'\x{7F8C}\x{7F8D}\x{7F8E}\x{7F8F}\x{7F91}\x{7F92}\x{7F93}\x{7F94}\x{7F95}' .
+'\x{7F96}\x{7F98}\x{7F9A}\x{7F9B}\x{7F9C}\x{7F9D}\x{7F9E}\x{7F9F}\x{7FA0}' .
+'\x{7FA1}\x{7FA2}\x{7FA3}\x{7FA4}\x{7FA5}\x{7FA6}\x{7FA7}\x{7FA8}\x{7FA9}' .
+'\x{7FAA}\x{7FAB}\x{7FAC}\x{7FAD}\x{7FAE}\x{7FAF}\x{7FB0}\x{7FB1}\x{7FB2}' .
+'\x{7FB3}\x{7FB5}\x{7FB6}\x{7FB7}\x{7FB8}\x{7FB9}\x{7FBA}\x{7FBB}\x{7FBC}' .
+'\x{7FBD}\x{7FBE}\x{7FBF}\x{7FC0}\x{7FC1}\x{7FC2}\x{7FC3}\x{7FC4}\x{7FC5}' .
+'\x{7FC6}\x{7FC7}\x{7FC8}\x{7FC9}\x{7FCA}\x{7FCB}\x{7FCC}\x{7FCD}\x{7FCE}' .
+'\x{7FCF}\x{7FD0}\x{7FD1}\x{7FD2}\x{7FD3}\x{7FD4}\x{7FD5}\x{7FD7}\x{7FD8}' .
+'\x{7FD9}\x{7FDA}\x{7FDB}\x{7FDC}\x{7FDE}\x{7FDF}\x{7FE0}\x{7FE1}\x{7FE2}' .
+'\x{7FE3}\x{7FE5}\x{7FE6}\x{7FE7}\x{7FE8}\x{7FE9}\x{7FEA}\x{7FEB}\x{7FEC}' .
+'\x{7FED}\x{7FEE}\x{7FEF}\x{7FF0}\x{7FF1}\x{7FF2}\x{7FF3}\x{7FF4}\x{7FF5}' .
+'\x{7FF6}\x{7FF7}\x{7FF8}\x{7FF9}\x{7FFA}\x{7FFB}\x{7FFC}\x{7FFD}\x{7FFE}' .
+'\x{7FFF}\x{8000}\x{8001}\x{8002}\x{8003}\x{8004}\x{8005}\x{8006}\x{8007}' .
+'\x{8008}\x{8009}\x{800B}\x{800C}\x{800D}\x{800E}\x{800F}\x{8010}\x{8011}' .
+'\x{8012}\x{8013}\x{8014}\x{8015}\x{8016}\x{8017}\x{8018}\x{8019}\x{801A}' .
+'\x{801B}\x{801C}\x{801D}\x{801E}\x{801F}\x{8020}\x{8021}\x{8022}\x{8023}' .
+'\x{8024}\x{8025}\x{8026}\x{8027}\x{8028}\x{8029}\x{802A}\x{802B}\x{802C}' .
+'\x{802D}\x{802E}\x{8030}\x{8031}\x{8032}\x{8033}\x{8034}\x{8035}\x{8036}' .
+'\x{8037}\x{8038}\x{8039}\x{803A}\x{803B}\x{803D}\x{803E}\x{803F}\x{8041}' .
+'\x{8042}\x{8043}\x{8044}\x{8045}\x{8046}\x{8047}\x{8048}\x{8049}\x{804A}' .
+'\x{804B}\x{804C}\x{804D}\x{804E}\x{804F}\x{8050}\x{8051}\x{8052}\x{8053}' .
+'\x{8054}\x{8055}\x{8056}\x{8057}\x{8058}\x{8059}\x{805A}\x{805B}\x{805C}' .
+'\x{805D}\x{805E}\x{805F}\x{8060}\x{8061}\x{8062}\x{8063}\x{8064}\x{8065}' .
+'\x{8067}\x{8068}\x{8069}\x{806A}\x{806B}\x{806C}\x{806D}\x{806E}\x{806F}' .
+'\x{8070}\x{8071}\x{8072}\x{8073}\x{8074}\x{8075}\x{8076}\x{8077}\x{8078}' .
+'\x{8079}\x{807A}\x{807B}\x{807C}\x{807D}\x{807E}\x{807F}\x{8080}\x{8081}' .
+'\x{8082}\x{8083}\x{8084}\x{8085}\x{8086}\x{8087}\x{8089}\x{808A}\x{808B}' .
+'\x{808C}\x{808D}\x{808F}\x{8090}\x{8091}\x{8092}\x{8093}\x{8095}\x{8096}' .
+'\x{8097}\x{8098}\x{8099}\x{809A}\x{809B}\x{809C}\x{809D}\x{809E}\x{809F}' .
+'\x{80A0}\x{80A1}\x{80A2}\x{80A3}\x{80A4}\x{80A5}\x{80A9}\x{80AA}\x{80AB}' .
+'\x{80AD}\x{80AE}\x{80AF}\x{80B0}\x{80B1}\x{80B2}\x{80B4}\x{80B5}\x{80B6}' .
+'\x{80B7}\x{80B8}\x{80BA}\x{80BB}\x{80BC}\x{80BD}\x{80BE}\x{80BF}\x{80C0}' .
+'\x{80C1}\x{80C2}\x{80C3}\x{80C4}\x{80C5}\x{80C6}\x{80C7}\x{80C8}\x{80C9}' .
+'\x{80CA}\x{80CB}\x{80CC}\x{80CD}\x{80CE}\x{80CF}\x{80D0}\x{80D1}\x{80D2}' .
+'\x{80D3}\x{80D4}\x{80D5}\x{80D6}\x{80D7}\x{80D8}\x{80D9}\x{80DA}\x{80DB}' .
+'\x{80DC}\x{80DD}\x{80DE}\x{80E0}\x{80E1}\x{80E2}\x{80E3}\x{80E4}\x{80E5}' .
+'\x{80E6}\x{80E7}\x{80E8}\x{80E9}\x{80EA}\x{80EB}\x{80EC}\x{80ED}\x{80EE}' .
+'\x{80EF}\x{80F0}\x{80F1}\x{80F2}\x{80F3}\x{80F4}\x{80F5}\x{80F6}\x{80F7}' .
+'\x{80F8}\x{80F9}\x{80FA}\x{80FB}\x{80FC}\x{80FD}\x{80FE}\x{80FF}\x{8100}' .
+'\x{8101}\x{8102}\x{8105}\x{8106}\x{8107}\x{8108}\x{8109}\x{810A}\x{810B}' .
+'\x{810C}\x{810D}\x{810E}\x{810F}\x{8110}\x{8111}\x{8112}\x{8113}\x{8114}' .
+'\x{8115}\x{8116}\x{8118}\x{8119}\x{811A}\x{811B}\x{811C}\x{811D}\x{811E}' .
+'\x{811F}\x{8120}\x{8121}\x{8122}\x{8123}\x{8124}\x{8125}\x{8126}\x{8127}' .
+'\x{8128}\x{8129}\x{812A}\x{812B}\x{812C}\x{812D}\x{812E}\x{812F}\x{8130}' .
+'\x{8131}\x{8132}\x{8136}\x{8137}\x{8138}\x{8139}\x{813A}\x{813B}\x{813C}' .
+'\x{813D}\x{813E}\x{813F}\x{8140}\x{8141}\x{8142}\x{8143}\x{8144}\x{8145}' .
+'\x{8146}\x{8147}\x{8148}\x{8149}\x{814A}\x{814B}\x{814C}\x{814D}\x{814E}' .
+'\x{814F}\x{8150}\x{8151}\x{8152}\x{8153}\x{8154}\x{8155}\x{8156}\x{8157}' .
+'\x{8158}\x{8159}\x{815A}\x{815B}\x{815C}\x{815D}\x{815E}\x{8160}\x{8161}' .
+'\x{8162}\x{8163}\x{8164}\x{8165}\x{8166}\x{8167}\x{8168}\x{8169}\x{816A}' .
+'\x{816B}\x{816C}\x{816D}\x{816E}\x{816F}\x{8170}\x{8171}\x{8172}\x{8173}' .
+'\x{8174}\x{8175}\x{8176}\x{8177}\x{8178}\x{8179}\x{817A}\x{817B}\x{817C}' .
+'\x{817D}\x{817E}\x{817F}\x{8180}\x{8181}\x{8182}\x{8183}\x{8185}\x{8186}' .
+'\x{8187}\x{8188}\x{8189}\x{818A}\x{818B}\x{818C}\x{818D}\x{818E}\x{818F}' .
+'\x{8191}\x{8192}\x{8193}\x{8194}\x{8195}\x{8197}\x{8198}\x{8199}\x{819A}' .
+'\x{819B}\x{819C}\x{819D}\x{819E}\x{819F}\x{81A0}\x{81A1}\x{81A2}\x{81A3}' .
+'\x{81A4}\x{81A5}\x{81A6}\x{81A7}\x{81A8}\x{81A9}\x{81AA}\x{81AB}\x{81AC}' .
+'\x{81AD}\x{81AE}\x{81AF}\x{81B0}\x{81B1}\x{81B2}\x{81B3}\x{81B4}\x{81B5}' .
+'\x{81B6}\x{81B7}\x{81B8}\x{81B9}\x{81BA}\x{81BB}\x{81BC}\x{81BD}\x{81BE}' .
+'\x{81BF}\x{81C0}\x{81C1}\x{81C2}\x{81C3}\x{81C4}\x{81C5}\x{81C6}\x{81C7}' .
+'\x{81C8}\x{81C9}\x{81CA}\x{81CC}\x{81CD}\x{81CE}\x{81CF}\x{81D0}\x{81D1}' .
+'\x{81D2}\x{81D4}\x{81D5}\x{81D6}\x{81D7}\x{81D8}\x{81D9}\x{81DA}\x{81DB}' .
+'\x{81DC}\x{81DD}\x{81DE}\x{81DF}\x{81E0}\x{81E1}\x{81E2}\x{81E3}\x{81E5}' .
+'\x{81E6}\x{81E7}\x{81E8}\x{81E9}\x{81EA}\x{81EB}\x{81EC}\x{81ED}\x{81EE}' .
+'\x{81F1}\x{81F2}\x{81F3}\x{81F4}\x{81F5}\x{81F6}\x{81F7}\x{81F8}\x{81F9}' .
+'\x{81FA}\x{81FB}\x{81FC}\x{81FD}\x{81FE}\x{81FF}\x{8200}\x{8201}\x{8202}' .
+'\x{8203}\x{8204}\x{8205}\x{8206}\x{8207}\x{8208}\x{8209}\x{820A}\x{820B}' .
+'\x{820C}\x{820D}\x{820E}\x{820F}\x{8210}\x{8211}\x{8212}\x{8214}\x{8215}' .
+'\x{8216}\x{8218}\x{8219}\x{821A}\x{821B}\x{821C}\x{821D}\x{821E}\x{821F}' .
+'\x{8220}\x{8221}\x{8222}\x{8223}\x{8225}\x{8226}\x{8227}\x{8228}\x{8229}' .
+'\x{822A}\x{822B}\x{822C}\x{822D}\x{822F}\x{8230}\x{8231}\x{8232}\x{8233}' .
+'\x{8234}\x{8235}\x{8236}\x{8237}\x{8238}\x{8239}\x{823A}\x{823B}\x{823C}' .
+'\x{823D}\x{823E}\x{823F}\x{8240}\x{8242}\x{8243}\x{8244}\x{8245}\x{8246}' .
+'\x{8247}\x{8248}\x{8249}\x{824A}\x{824B}\x{824C}\x{824D}\x{824E}\x{824F}' .
+'\x{8250}\x{8251}\x{8252}\x{8253}\x{8254}\x{8255}\x{8256}\x{8257}\x{8258}' .
+'\x{8259}\x{825A}\x{825B}\x{825C}\x{825D}\x{825E}\x{825F}\x{8260}\x{8261}' .
+'\x{8263}\x{8264}\x{8266}\x{8267}\x{8268}\x{8269}\x{826A}\x{826B}\x{826C}' .
+'\x{826D}\x{826E}\x{826F}\x{8270}\x{8271}\x{8272}\x{8273}\x{8274}\x{8275}' .
+'\x{8276}\x{8277}\x{8278}\x{8279}\x{827A}\x{827B}\x{827C}\x{827D}\x{827E}' .
+'\x{827F}\x{8280}\x{8281}\x{8282}\x{8283}\x{8284}\x{8285}\x{8286}\x{8287}' .
+'\x{8288}\x{8289}\x{828A}\x{828B}\x{828D}\x{828E}\x{828F}\x{8290}\x{8291}' .
+'\x{8292}\x{8293}\x{8294}\x{8295}\x{8296}\x{8297}\x{8298}\x{8299}\x{829A}' .
+'\x{829B}\x{829C}\x{829D}\x{829E}\x{829F}\x{82A0}\x{82A1}\x{82A2}\x{82A3}' .
+'\x{82A4}\x{82A5}\x{82A6}\x{82A7}\x{82A8}\x{82A9}\x{82AA}\x{82AB}\x{82AC}' .
+'\x{82AD}\x{82AE}\x{82AF}\x{82B0}\x{82B1}\x{82B3}\x{82B4}\x{82B5}\x{82B6}' .
+'\x{82B7}\x{82B8}\x{82B9}\x{82BA}\x{82BB}\x{82BC}\x{82BD}\x{82BE}\x{82BF}' .
+'\x{82C0}\x{82C1}\x{82C2}\x{82C3}\x{82C4}\x{82C5}\x{82C6}\x{82C7}\x{82C8}' .
+'\x{82C9}\x{82CA}\x{82CB}\x{82CC}\x{82CD}\x{82CE}\x{82CF}\x{82D0}\x{82D1}' .
+'\x{82D2}\x{82D3}\x{82D4}\x{82D5}\x{82D6}\x{82D7}\x{82D8}\x{82D9}\x{82DA}' .
+'\x{82DB}\x{82DC}\x{82DD}\x{82DE}\x{82DF}\x{82E0}\x{82E1}\x{82E3}\x{82E4}' .
+'\x{82E5}\x{82E6}\x{82E7}\x{82E8}\x{82E9}\x{82EA}\x{82EB}\x{82EC}\x{82ED}' .
+'\x{82EE}\x{82EF}\x{82F0}\x{82F1}\x{82F2}\x{82F3}\x{82F4}\x{82F5}\x{82F6}' .
+'\x{82F7}\x{82F8}\x{82F9}\x{82FA}\x{82FB}\x{82FD}\x{82FE}\x{82FF}\x{8300}' .
+'\x{8301}\x{8302}\x{8303}\x{8304}\x{8305}\x{8306}\x{8307}\x{8308}\x{8309}' .
+'\x{830B}\x{830C}\x{830D}\x{830E}\x{830F}\x{8311}\x{8312}\x{8313}\x{8314}' .
+'\x{8315}\x{8316}\x{8317}\x{8318}\x{8319}\x{831A}\x{831B}\x{831C}\x{831D}' .
+'\x{831E}\x{831F}\x{8320}\x{8321}\x{8322}\x{8323}\x{8324}\x{8325}\x{8326}' .
+'\x{8327}\x{8328}\x{8329}\x{832A}\x{832B}\x{832C}\x{832D}\x{832E}\x{832F}' .
+'\x{8331}\x{8332}\x{8333}\x{8334}\x{8335}\x{8336}\x{8337}\x{8338}\x{8339}' .
+'\x{833A}\x{833B}\x{833C}\x{833D}\x{833E}\x{833F}\x{8340}\x{8341}\x{8342}' .
+'\x{8343}\x{8344}\x{8345}\x{8346}\x{8347}\x{8348}\x{8349}\x{834A}\x{834B}' .
+'\x{834C}\x{834D}\x{834E}\x{834F}\x{8350}\x{8351}\x{8352}\x{8353}\x{8354}' .
+'\x{8356}\x{8357}\x{8358}\x{8359}\x{835A}\x{835B}\x{835C}\x{835D}\x{835E}' .
+'\x{835F}\x{8360}\x{8361}\x{8362}\x{8363}\x{8364}\x{8365}\x{8366}\x{8367}' .
+'\x{8368}\x{8369}\x{836A}\x{836B}\x{836C}\x{836D}\x{836E}\x{836F}\x{8370}' .
+'\x{8371}\x{8372}\x{8373}\x{8374}\x{8375}\x{8376}\x{8377}\x{8378}\x{8379}' .
+'\x{837A}\x{837B}\x{837C}\x{837D}\x{837E}\x{837F}\x{8380}\x{8381}\x{8382}' .
+'\x{8383}\x{8384}\x{8385}\x{8386}\x{8387}\x{8388}\x{8389}\x{838A}\x{838B}' .
+'\x{838C}\x{838D}\x{838E}\x{838F}\x{8390}\x{8391}\x{8392}\x{8393}\x{8394}' .
+'\x{8395}\x{8396}\x{8397}\x{8398}\x{8399}\x{839A}\x{839B}\x{839C}\x{839D}' .
+'\x{839E}\x{83A0}\x{83A1}\x{83A2}\x{83A3}\x{83A4}\x{83A5}\x{83A6}\x{83A7}' .
+'\x{83A8}\x{83A9}\x{83AA}\x{83AB}\x{83AC}\x{83AD}\x{83AE}\x{83AF}\x{83B0}' .
+'\x{83B1}\x{83B2}\x{83B3}\x{83B4}\x{83B6}\x{83B7}\x{83B8}\x{83B9}\x{83BA}' .
+'\x{83BB}\x{83BC}\x{83BD}\x{83BF}\x{83C0}\x{83C1}\x{83C2}\x{83C3}\x{83C4}' .
+'\x{83C5}\x{83C6}\x{83C7}\x{83C8}\x{83C9}\x{83CA}\x{83CB}\x{83CC}\x{83CD}' .
+'\x{83CE}\x{83CF}\x{83D0}\x{83D1}\x{83D2}\x{83D3}\x{83D4}\x{83D5}\x{83D6}' .
+'\x{83D7}\x{83D8}\x{83D9}\x{83DA}\x{83DB}\x{83DC}\x{83DD}\x{83DE}\x{83DF}' .
+'\x{83E0}\x{83E1}\x{83E2}\x{83E3}\x{83E4}\x{83E5}\x{83E7}\x{83E8}\x{83E9}' .
+'\x{83EA}\x{83EB}\x{83EC}\x{83EE}\x{83EF}\x{83F0}\x{83F1}\x{83F2}\x{83F3}' .
+'\x{83F4}\x{83F5}\x{83F6}\x{83F7}\x{83F8}\x{83F9}\x{83FA}\x{83FB}\x{83FC}' .
+'\x{83FD}\x{83FE}\x{83FF}\x{8400}\x{8401}\x{8402}\x{8403}\x{8404}\x{8405}' .
+'\x{8406}\x{8407}\x{8408}\x{8409}\x{840A}\x{840B}\x{840C}\x{840D}\x{840E}' .
+'\x{840F}\x{8410}\x{8411}\x{8412}\x{8413}\x{8415}\x{8418}\x{8419}\x{841A}' .
+'\x{841B}\x{841C}\x{841D}\x{841E}\x{8421}\x{8422}\x{8423}\x{8424}\x{8425}' .
+'\x{8426}\x{8427}\x{8428}\x{8429}\x{842A}\x{842B}\x{842C}\x{842D}\x{842E}' .
+'\x{842F}\x{8430}\x{8431}\x{8432}\x{8433}\x{8434}\x{8435}\x{8436}\x{8437}' .
+'\x{8438}\x{8439}\x{843A}\x{843B}\x{843C}\x{843D}\x{843E}\x{843F}\x{8440}' .
+'\x{8441}\x{8442}\x{8443}\x{8444}\x{8445}\x{8446}\x{8447}\x{8448}\x{8449}' .
+'\x{844A}\x{844B}\x{844C}\x{844D}\x{844E}\x{844F}\x{8450}\x{8451}\x{8452}' .
+'\x{8453}\x{8454}\x{8455}\x{8456}\x{8457}\x{8459}\x{845A}\x{845B}\x{845C}' .
+'\x{845D}\x{845E}\x{845F}\x{8460}\x{8461}\x{8462}\x{8463}\x{8464}\x{8465}' .
+'\x{8466}\x{8467}\x{8468}\x{8469}\x{846A}\x{846B}\x{846C}\x{846D}\x{846E}' .
+'\x{846F}\x{8470}\x{8471}\x{8472}\x{8473}\x{8474}\x{8475}\x{8476}\x{8477}' .
+'\x{8478}\x{8479}\x{847A}\x{847B}\x{847C}\x{847D}\x{847E}\x{847F}\x{8480}' .
+'\x{8481}\x{8482}\x{8484}\x{8485}\x{8486}\x{8487}\x{8488}\x{8489}\x{848A}' .
+'\x{848B}\x{848C}\x{848D}\x{848E}\x{848F}\x{8490}\x{8491}\x{8492}\x{8493}' .
+'\x{8494}\x{8496}\x{8497}\x{8498}\x{8499}\x{849A}\x{849B}\x{849C}\x{849D}' .
+'\x{849E}\x{849F}\x{84A0}\x{84A1}\x{84A2}\x{84A3}\x{84A4}\x{84A5}\x{84A6}' .
+'\x{84A7}\x{84A8}\x{84A9}\x{84AA}\x{84AB}\x{84AC}\x{84AE}\x{84AF}\x{84B0}' .
+'\x{84B1}\x{84B2}\x{84B3}\x{84B4}\x{84B5}\x{84B6}\x{84B8}\x{84B9}\x{84BA}' .
+'\x{84BB}\x{84BC}\x{84BD}\x{84BE}\x{84BF}\x{84C0}\x{84C1}\x{84C2}\x{84C4}' .
+'\x{84C5}\x{84C6}\x{84C7}\x{84C8}\x{84C9}\x{84CA}\x{84CB}\x{84CC}\x{84CD}' .
+'\x{84CE}\x{84CF}\x{84D0}\x{84D1}\x{84D2}\x{84D3}\x{84D4}\x{84D5}\x{84D6}' .
+'\x{84D7}\x{84D8}\x{84D9}\x{84DB}\x{84DC}\x{84DD}\x{84DE}\x{84DF}\x{84E0}' .
+'\x{84E1}\x{84E2}\x{84E3}\x{84E4}\x{84E5}\x{84E6}\x{84E7}\x{84E8}\x{84E9}' .
+'\x{84EA}\x{84EB}\x{84EC}\x{84EE}\x{84EF}\x{84F0}\x{84F1}\x{84F2}\x{84F3}' .
+'\x{84F4}\x{84F5}\x{84F6}\x{84F7}\x{84F8}\x{84F9}\x{84FA}\x{84FB}\x{84FC}' .
+'\x{84FD}\x{84FE}\x{84FF}\x{8500}\x{8501}\x{8502}\x{8503}\x{8504}\x{8506}' .
+'\x{8507}\x{8508}\x{8509}\x{850A}\x{850B}\x{850C}\x{850D}\x{850E}\x{850F}' .
+'\x{8511}\x{8512}\x{8513}\x{8514}\x{8515}\x{8516}\x{8517}\x{8518}\x{8519}' .
+'\x{851A}\x{851B}\x{851C}\x{851D}\x{851E}\x{851F}\x{8520}\x{8521}\x{8522}' .
+'\x{8523}\x{8524}\x{8525}\x{8526}\x{8527}\x{8528}\x{8529}\x{852A}\x{852B}' .
+'\x{852C}\x{852D}\x{852E}\x{852F}\x{8530}\x{8531}\x{8534}\x{8535}\x{8536}' .
+'\x{8537}\x{8538}\x{8539}\x{853A}\x{853B}\x{853C}\x{853D}\x{853E}\x{853F}' .
+'\x{8540}\x{8541}\x{8542}\x{8543}\x{8544}\x{8545}\x{8546}\x{8547}\x{8548}' .
+'\x{8549}\x{854A}\x{854B}\x{854D}\x{854E}\x{854F}\x{8551}\x{8552}\x{8553}' .
+'\x{8554}\x{8555}\x{8556}\x{8557}\x{8558}\x{8559}\x{855A}\x{855B}\x{855C}' .
+'\x{855D}\x{855E}\x{855F}\x{8560}\x{8561}\x{8562}\x{8563}\x{8564}\x{8565}' .
+'\x{8566}\x{8567}\x{8568}\x{8569}\x{856A}\x{856B}\x{856C}\x{856D}\x{856E}' .
+'\x{856F}\x{8570}\x{8571}\x{8572}\x{8573}\x{8574}\x{8575}\x{8576}\x{8577}' .
+'\x{8578}\x{8579}\x{857A}\x{857B}\x{857C}\x{857D}\x{857E}\x{8580}\x{8581}' .
+'\x{8582}\x{8583}\x{8584}\x{8585}\x{8586}\x{8587}\x{8588}\x{8589}\x{858A}' .
+'\x{858B}\x{858C}\x{858D}\x{858E}\x{858F}\x{8590}\x{8591}\x{8592}\x{8594}' .
+'\x{8595}\x{8596}\x{8598}\x{8599}\x{859A}\x{859B}\x{859C}\x{859D}\x{859E}' .
+'\x{859F}\x{85A0}\x{85A1}\x{85A2}\x{85A3}\x{85A4}\x{85A5}\x{85A6}\x{85A7}' .
+'\x{85A8}\x{85A9}\x{85AA}\x{85AB}\x{85AC}\x{85AD}\x{85AE}\x{85AF}\x{85B0}' .
+'\x{85B1}\x{85B3}\x{85B4}\x{85B5}\x{85B6}\x{85B7}\x{85B8}\x{85B9}\x{85BA}' .
+'\x{85BC}\x{85BD}\x{85BE}\x{85BF}\x{85C0}\x{85C1}\x{85C2}\x{85C3}\x{85C4}' .
+'\x{85C5}\x{85C6}\x{85C7}\x{85C8}\x{85C9}\x{85CA}\x{85CB}\x{85CD}\x{85CE}' .
+'\x{85CF}\x{85D0}\x{85D1}\x{85D2}\x{85D3}\x{85D4}\x{85D5}\x{85D6}\x{85D7}' .
+'\x{85D8}\x{85D9}\x{85DA}\x{85DB}\x{85DC}\x{85DD}\x{85DE}\x{85DF}\x{85E0}' .
+'\x{85E1}\x{85E2}\x{85E3}\x{85E4}\x{85E5}\x{85E6}\x{85E7}\x{85E8}\x{85E9}' .
+'\x{85EA}\x{85EB}\x{85EC}\x{85ED}\x{85EF}\x{85F0}\x{85F1}\x{85F2}\x{85F4}' .
+'\x{85F5}\x{85F6}\x{85F7}\x{85F8}\x{85F9}\x{85FA}\x{85FB}\x{85FD}\x{85FE}' .
+'\x{85FF}\x{8600}\x{8601}\x{8602}\x{8604}\x{8605}\x{8606}\x{8607}\x{8608}' .
+'\x{8609}\x{860A}\x{860B}\x{860C}\x{860F}\x{8611}\x{8612}\x{8613}\x{8614}' .
+'\x{8616}\x{8617}\x{8618}\x{8619}\x{861A}\x{861B}\x{861C}\x{861E}\x{861F}' .
+'\x{8620}\x{8621}\x{8622}\x{8623}\x{8624}\x{8625}\x{8626}\x{8627}\x{8628}' .
+'\x{8629}\x{862A}\x{862B}\x{862C}\x{862D}\x{862E}\x{862F}\x{8630}\x{8631}' .
+'\x{8632}\x{8633}\x{8634}\x{8635}\x{8636}\x{8638}\x{8639}\x{863A}\x{863B}' .
+'\x{863C}\x{863D}\x{863E}\x{863F}\x{8640}\x{8641}\x{8642}\x{8643}\x{8644}' .
+'\x{8645}\x{8646}\x{8647}\x{8648}\x{8649}\x{864A}\x{864B}\x{864C}\x{864D}' .
+'\x{864E}\x{864F}\x{8650}\x{8651}\x{8652}\x{8653}\x{8654}\x{8655}\x{8656}' .
+'\x{8658}\x{8659}\x{865A}\x{865B}\x{865C}\x{865D}\x{865E}\x{865F}\x{8660}' .
+'\x{8661}\x{8662}\x{8663}\x{8664}\x{8665}\x{8666}\x{8667}\x{8668}\x{8669}' .
+'\x{866A}\x{866B}\x{866C}\x{866D}\x{866E}\x{866F}\x{8670}\x{8671}\x{8672}' .
+'\x{8673}\x{8674}\x{8676}\x{8677}\x{8678}\x{8679}\x{867A}\x{867B}\x{867C}' .
+'\x{867D}\x{867E}\x{867F}\x{8680}\x{8681}\x{8682}\x{8683}\x{8684}\x{8685}' .
+'\x{8686}\x{8687}\x{8688}\x{868A}\x{868B}\x{868C}\x{868D}\x{868E}\x{868F}' .
+'\x{8690}\x{8691}\x{8693}\x{8694}\x{8695}\x{8696}\x{8697}\x{8698}\x{8699}' .
+'\x{869A}\x{869B}\x{869C}\x{869D}\x{869E}\x{869F}\x{86A1}\x{86A2}\x{86A3}' .
+'\x{86A4}\x{86A5}\x{86A7}\x{86A8}\x{86A9}\x{86AA}\x{86AB}\x{86AC}\x{86AD}' .
+'\x{86AE}\x{86AF}\x{86B0}\x{86B1}\x{86B2}\x{86B3}\x{86B4}\x{86B5}\x{86B6}' .
+'\x{86B7}\x{86B8}\x{86B9}\x{86BA}\x{86BB}\x{86BC}\x{86BD}\x{86BE}\x{86BF}' .
+'\x{86C0}\x{86C1}\x{86C2}\x{86C3}\x{86C4}\x{86C5}\x{86C6}\x{86C7}\x{86C8}' .
+'\x{86C9}\x{86CA}\x{86CB}\x{86CC}\x{86CE}\x{86CF}\x{86D0}\x{86D1}\x{86D2}' .
+'\x{86D3}\x{86D4}\x{86D6}\x{86D7}\x{86D8}\x{86D9}\x{86DA}\x{86DB}\x{86DC}' .
+'\x{86DD}\x{86DE}\x{86DF}\x{86E1}\x{86E2}\x{86E3}\x{86E4}\x{86E5}\x{86E6}' .
+'\x{86E8}\x{86E9}\x{86EA}\x{86EB}\x{86EC}\x{86ED}\x{86EE}\x{86EF}\x{86F0}' .
+'\x{86F1}\x{86F2}\x{86F3}\x{86F4}\x{86F5}\x{86F6}\x{86F7}\x{86F8}\x{86F9}' .
+'\x{86FA}\x{86FB}\x{86FC}\x{86FE}\x{86FF}\x{8700}\x{8701}\x{8702}\x{8703}' .
+'\x{8704}\x{8705}\x{8706}\x{8707}\x{8708}\x{8709}\x{870A}\x{870B}\x{870C}' .
+'\x{870D}\x{870E}\x{870F}\x{8710}\x{8711}\x{8712}\x{8713}\x{8714}\x{8715}' .
+'\x{8716}\x{8717}\x{8718}\x{8719}\x{871A}\x{871B}\x{871C}\x{871E}\x{871F}' .
+'\x{8720}\x{8721}\x{8722}\x{8723}\x{8724}\x{8725}\x{8726}\x{8727}\x{8728}' .
+'\x{8729}\x{872A}\x{872B}\x{872C}\x{872D}\x{872E}\x{8730}\x{8731}\x{8732}' .
+'\x{8733}\x{8734}\x{8735}\x{8736}\x{8737}\x{8738}\x{8739}\x{873A}\x{873B}' .
+'\x{873C}\x{873E}\x{873F}\x{8740}\x{8741}\x{8742}\x{8743}\x{8744}\x{8746}' .
+'\x{8747}\x{8748}\x{8749}\x{874A}\x{874C}\x{874D}\x{874E}\x{874F}\x{8750}' .
+'\x{8751}\x{8752}\x{8753}\x{8754}\x{8755}\x{8756}\x{8757}\x{8758}\x{8759}' .
+'\x{875A}\x{875B}\x{875C}\x{875D}\x{875E}\x{875F}\x{8760}\x{8761}\x{8762}' .
+'\x{8763}\x{8764}\x{8765}\x{8766}\x{8767}\x{8768}\x{8769}\x{876A}\x{876B}' .
+'\x{876C}\x{876D}\x{876E}\x{876F}\x{8770}\x{8772}\x{8773}\x{8774}\x{8775}' .
+'\x{8776}\x{8777}\x{8778}\x{8779}\x{877A}\x{877B}\x{877C}\x{877D}\x{877E}' .
+'\x{8780}\x{8781}\x{8782}\x{8783}\x{8784}\x{8785}\x{8786}\x{8787}\x{8788}' .
+'\x{8789}\x{878A}\x{878B}\x{878C}\x{878D}\x{878F}\x{8790}\x{8791}\x{8792}' .
+'\x{8793}\x{8794}\x{8795}\x{8796}\x{8797}\x{8798}\x{879A}\x{879B}\x{879C}' .
+'\x{879D}\x{879E}\x{879F}\x{87A0}\x{87A1}\x{87A2}\x{87A3}\x{87A4}\x{87A5}' .
+'\x{87A6}\x{87A7}\x{87A8}\x{87A9}\x{87AA}\x{87AB}\x{87AC}\x{87AD}\x{87AE}' .
+'\x{87AF}\x{87B0}\x{87B1}\x{87B2}\x{87B3}\x{87B4}\x{87B5}\x{87B6}\x{87B7}' .
+'\x{87B8}\x{87B9}\x{87BA}\x{87BB}\x{87BC}\x{87BD}\x{87BE}\x{87BF}\x{87C0}' .
+'\x{87C1}\x{87C2}\x{87C3}\x{87C4}\x{87C5}\x{87C6}\x{87C7}\x{87C8}\x{87C9}' .
+'\x{87CA}\x{87CB}\x{87CC}\x{87CD}\x{87CE}\x{87CF}\x{87D0}\x{87D1}\x{87D2}' .
+'\x{87D3}\x{87D4}\x{87D5}\x{87D6}\x{87D7}\x{87D8}\x{87D9}\x{87DB}\x{87DC}' .
+'\x{87DD}\x{87DE}\x{87DF}\x{87E0}\x{87E1}\x{87E2}\x{87E3}\x{87E4}\x{87E5}' .
+'\x{87E6}\x{87E7}\x{87E8}\x{87E9}\x{87EA}\x{87EB}\x{87EC}\x{87ED}\x{87EE}' .
+'\x{87EF}\x{87F1}\x{87F2}\x{87F3}\x{87F4}\x{87F5}\x{87F6}\x{87F7}\x{87F8}' .
+'\x{87F9}\x{87FA}\x{87FB}\x{87FC}\x{87FD}\x{87FE}\x{87FF}\x{8800}\x{8801}' .
+'\x{8802}\x{8803}\x{8804}\x{8805}\x{8806}\x{8808}\x{8809}\x{880A}\x{880B}' .
+'\x{880C}\x{880D}\x{880E}\x{880F}\x{8810}\x{8811}\x{8813}\x{8814}\x{8815}' .
+'\x{8816}\x{8817}\x{8818}\x{8819}\x{881A}\x{881B}\x{881C}\x{881D}\x{881E}' .
+'\x{881F}\x{8820}\x{8821}\x{8822}\x{8823}\x{8824}\x{8825}\x{8826}\x{8827}' .
+'\x{8828}\x{8829}\x{882A}\x{882B}\x{882C}\x{882E}\x{882F}\x{8830}\x{8831}' .
+'\x{8832}\x{8833}\x{8834}\x{8835}\x{8836}\x{8837}\x{8838}\x{8839}\x{883B}' .
+'\x{883C}\x{883D}\x{883E}\x{883F}\x{8840}\x{8841}\x{8842}\x{8843}\x{8844}' .
+'\x{8845}\x{8846}\x{8848}\x{8849}\x{884A}\x{884B}\x{884C}\x{884D}\x{884E}' .
+'\x{884F}\x{8850}\x{8851}\x{8852}\x{8853}\x{8854}\x{8855}\x{8856}\x{8857}' .
+'\x{8859}\x{885A}\x{885B}\x{885D}\x{885E}\x{8860}\x{8861}\x{8862}\x{8863}' .
+'\x{8864}\x{8865}\x{8866}\x{8867}\x{8868}\x{8869}\x{886A}\x{886B}\x{886C}' .
+'\x{886D}\x{886E}\x{886F}\x{8870}\x{8871}\x{8872}\x{8873}\x{8874}\x{8875}' .
+'\x{8876}\x{8877}\x{8878}\x{8879}\x{887B}\x{887C}\x{887D}\x{887E}\x{887F}' .
+'\x{8880}\x{8881}\x{8882}\x{8883}\x{8884}\x{8885}\x{8886}\x{8887}\x{8888}' .
+'\x{8889}\x{888A}\x{888B}\x{888C}\x{888D}\x{888E}\x{888F}\x{8890}\x{8891}' .
+'\x{8892}\x{8893}\x{8894}\x{8895}\x{8896}\x{8897}\x{8898}\x{8899}\x{889A}' .
+'\x{889B}\x{889C}\x{889D}\x{889E}\x{889F}\x{88A0}\x{88A1}\x{88A2}\x{88A3}' .
+'\x{88A4}\x{88A5}\x{88A6}\x{88A7}\x{88A8}\x{88A9}\x{88AA}\x{88AB}\x{88AC}' .
+'\x{88AD}\x{88AE}\x{88AF}\x{88B0}\x{88B1}\x{88B2}\x{88B3}\x{88B4}\x{88B6}' .
+'\x{88B7}\x{88B8}\x{88B9}\x{88BA}\x{88BB}\x{88BC}\x{88BD}\x{88BE}\x{88BF}' .
+'\x{88C0}\x{88C1}\x{88C2}\x{88C3}\x{88C4}\x{88C5}\x{88C6}\x{88C7}\x{88C8}' .
+'\x{88C9}\x{88CA}\x{88CB}\x{88CC}\x{88CD}\x{88CE}\x{88CF}\x{88D0}\x{88D1}' .
+'\x{88D2}\x{88D3}\x{88D4}\x{88D5}\x{88D6}\x{88D7}\x{88D8}\x{88D9}\x{88DA}' .
+'\x{88DB}\x{88DC}\x{88DD}\x{88DE}\x{88DF}\x{88E0}\x{88E1}\x{88E2}\x{88E3}' .
+'\x{88E4}\x{88E5}\x{88E7}\x{88E8}\x{88EA}\x{88EB}\x{88EC}\x{88EE}\x{88EF}' .
+'\x{88F0}\x{88F1}\x{88F2}\x{88F3}\x{88F4}\x{88F5}\x{88F6}\x{88F7}\x{88F8}' .
+'\x{88F9}\x{88FA}\x{88FB}\x{88FC}\x{88FD}\x{88FE}\x{88FF}\x{8900}\x{8901}' .
+'\x{8902}\x{8904}\x{8905}\x{8906}\x{8907}\x{8908}\x{8909}\x{890A}\x{890B}' .
+'\x{890C}\x{890D}\x{890E}\x{8910}\x{8911}\x{8912}\x{8913}\x{8914}\x{8915}' .
+'\x{8916}\x{8917}\x{8918}\x{8919}\x{891A}\x{891B}\x{891C}\x{891D}\x{891E}' .
+'\x{891F}\x{8920}\x{8921}\x{8922}\x{8923}\x{8925}\x{8926}\x{8927}\x{8928}' .
+'\x{8929}\x{892A}\x{892B}\x{892C}\x{892D}\x{892E}\x{892F}\x{8930}\x{8931}' .
+'\x{8932}\x{8933}\x{8934}\x{8935}\x{8936}\x{8937}\x{8938}\x{8939}\x{893A}' .
+'\x{893B}\x{893C}\x{893D}\x{893E}\x{893F}\x{8940}\x{8941}\x{8942}\x{8943}' .
+'\x{8944}\x{8945}\x{8946}\x{8947}\x{8948}\x{8949}\x{894A}\x{894B}\x{894C}' .
+'\x{894E}\x{894F}\x{8950}\x{8951}\x{8952}\x{8953}\x{8954}\x{8955}\x{8956}' .
+'\x{8957}\x{8958}\x{8959}\x{895A}\x{895B}\x{895C}\x{895D}\x{895E}\x{895F}' .
+'\x{8960}\x{8961}\x{8962}\x{8963}\x{8964}\x{8966}\x{8967}\x{8968}\x{8969}' .
+'\x{896A}\x{896B}\x{896C}\x{896D}\x{896E}\x{896F}\x{8970}\x{8971}\x{8972}' .
+'\x{8973}\x{8974}\x{8976}\x{8977}\x{8978}\x{8979}\x{897A}\x{897B}\x{897C}' .
+'\x{897E}\x{897F}\x{8980}\x{8981}\x{8982}\x{8983}\x{8984}\x{8985}\x{8986}' .
+'\x{8987}\x{8988}\x{8989}\x{898A}\x{898B}\x{898C}\x{898E}\x{898F}\x{8991}' .
+'\x{8992}\x{8993}\x{8995}\x{8996}\x{8997}\x{8998}\x{899A}\x{899B}\x{899C}' .
+'\x{899D}\x{899E}\x{899F}\x{89A0}\x{89A1}\x{89A2}\x{89A3}\x{89A4}\x{89A5}' .
+'\x{89A6}\x{89A7}\x{89A8}\x{89AA}\x{89AB}\x{89AC}\x{89AD}\x{89AE}\x{89AF}' .
+'\x{89B1}\x{89B2}\x{89B3}\x{89B5}\x{89B6}\x{89B7}\x{89B8}\x{89B9}\x{89BA}' .
+'\x{89BD}\x{89BE}\x{89BF}\x{89C0}\x{89C1}\x{89C2}\x{89C3}\x{89C4}\x{89C5}' .
+'\x{89C6}\x{89C7}\x{89C8}\x{89C9}\x{89CA}\x{89CB}\x{89CC}\x{89CD}\x{89CE}' .
+'\x{89CF}\x{89D0}\x{89D1}\x{89D2}\x{89D3}\x{89D4}\x{89D5}\x{89D6}\x{89D7}' .
+'\x{89D8}\x{89D9}\x{89DA}\x{89DB}\x{89DC}\x{89DD}\x{89DE}\x{89DF}\x{89E0}' .
+'\x{89E1}\x{89E2}\x{89E3}\x{89E4}\x{89E5}\x{89E6}\x{89E7}\x{89E8}\x{89E9}' .
+'\x{89EA}\x{89EB}\x{89EC}\x{89ED}\x{89EF}\x{89F0}\x{89F1}\x{89F2}\x{89F3}' .
+'\x{89F4}\x{89F6}\x{89F7}\x{89F8}\x{89FA}\x{89FB}\x{89FC}\x{89FE}\x{89FF}' .
+'\x{8A00}\x{8A01}\x{8A02}\x{8A03}\x{8A04}\x{8A07}\x{8A08}\x{8A09}\x{8A0A}' .
+'\x{8A0B}\x{8A0C}\x{8A0D}\x{8A0E}\x{8A0F}\x{8A10}\x{8A11}\x{8A12}\x{8A13}' .
+'\x{8A15}\x{8A16}\x{8A17}\x{8A18}\x{8A1A}\x{8A1B}\x{8A1C}\x{8A1D}\x{8A1E}' .
+'\x{8A1F}\x{8A22}\x{8A23}\x{8A24}\x{8A25}\x{8A26}\x{8A27}\x{8A28}\x{8A29}' .
+'\x{8A2A}\x{8A2C}\x{8A2D}\x{8A2E}\x{8A2F}\x{8A30}\x{8A31}\x{8A32}\x{8A34}' .
+'\x{8A35}\x{8A36}\x{8A37}\x{8A38}\x{8A39}\x{8A3A}\x{8A3B}\x{8A3C}\x{8A3E}' .
+'\x{8A3F}\x{8A40}\x{8A41}\x{8A42}\x{8A43}\x{8A44}\x{8A45}\x{8A46}\x{8A47}' .
+'\x{8A48}\x{8A49}\x{8A4A}\x{8A4C}\x{8A4D}\x{8A4E}\x{8A4F}\x{8A50}\x{8A51}' .
+'\x{8A52}\x{8A53}\x{8A54}\x{8A55}\x{8A56}\x{8A57}\x{8A58}\x{8A59}\x{8A5A}' .
+'\x{8A5B}\x{8A5C}\x{8A5D}\x{8A5E}\x{8A5F}\x{8A60}\x{8A61}\x{8A62}\x{8A63}' .
+'\x{8A65}\x{8A66}\x{8A67}\x{8A68}\x{8A69}\x{8A6A}\x{8A6B}\x{8A6C}\x{8A6D}' .
+'\x{8A6E}\x{8A6F}\x{8A70}\x{8A71}\x{8A72}\x{8A73}\x{8A74}\x{8A75}\x{8A76}' .
+'\x{8A77}\x{8A79}\x{8A7A}\x{8A7B}\x{8A7C}\x{8A7E}\x{8A7F}\x{8A80}\x{8A81}' .
+'\x{8A82}\x{8A83}\x{8A84}\x{8A85}\x{8A86}\x{8A87}\x{8A89}\x{8A8A}\x{8A8B}' .
+'\x{8A8C}\x{8A8D}\x{8A8E}\x{8A8F}\x{8A90}\x{8A91}\x{8A92}\x{8A93}\x{8A94}' .
+'\x{8A95}\x{8A96}\x{8A97}\x{8A98}\x{8A99}\x{8A9A}\x{8A9B}\x{8A9C}\x{8A9D}' .
+'\x{8A9E}\x{8AA0}\x{8AA1}\x{8AA2}\x{8AA3}\x{8AA4}\x{8AA5}\x{8AA6}\x{8AA7}' .
+'\x{8AA8}\x{8AA9}\x{8AAA}\x{8AAB}\x{8AAC}\x{8AAE}\x{8AB0}\x{8AB1}\x{8AB2}' .
+'\x{8AB3}\x{8AB4}\x{8AB5}\x{8AB6}\x{8AB8}\x{8AB9}\x{8ABA}\x{8ABB}\x{8ABC}' .
+'\x{8ABD}\x{8ABE}\x{8ABF}\x{8AC0}\x{8AC1}\x{8AC2}\x{8AC3}\x{8AC4}\x{8AC5}' .
+'\x{8AC6}\x{8AC7}\x{8AC8}\x{8AC9}\x{8ACA}\x{8ACB}\x{8ACC}\x{8ACD}\x{8ACE}' .
+'\x{8ACF}\x{8AD1}\x{8AD2}\x{8AD3}\x{8AD4}\x{8AD5}\x{8AD6}\x{8AD7}\x{8AD8}' .
+'\x{8AD9}\x{8ADA}\x{8ADB}\x{8ADC}\x{8ADD}\x{8ADE}\x{8ADF}\x{8AE0}\x{8AE1}' .
+'\x{8AE2}\x{8AE3}\x{8AE4}\x{8AE5}\x{8AE6}\x{8AE7}\x{8AE8}\x{8AE9}\x{8AEA}' .
+'\x{8AEB}\x{8AED}\x{8AEE}\x{8AEF}\x{8AF0}\x{8AF1}\x{8AF2}\x{8AF3}\x{8AF4}' .
+'\x{8AF5}\x{8AF6}\x{8AF7}\x{8AF8}\x{8AF9}\x{8AFA}\x{8AFB}\x{8AFC}\x{8AFD}' .
+'\x{8AFE}\x{8AFF}\x{8B00}\x{8B01}\x{8B02}\x{8B03}\x{8B04}\x{8B05}\x{8B06}' .
+'\x{8B07}\x{8B08}\x{8B09}\x{8B0A}\x{8B0B}\x{8B0D}\x{8B0E}\x{8B0F}\x{8B10}' .
+'\x{8B11}\x{8B12}\x{8B13}\x{8B14}\x{8B15}\x{8B16}\x{8B17}\x{8B18}\x{8B19}' .
+'\x{8B1A}\x{8B1B}\x{8B1C}\x{8B1D}\x{8B1E}\x{8B1F}\x{8B20}\x{8B21}\x{8B22}' .
+'\x{8B23}\x{8B24}\x{8B25}\x{8B26}\x{8B27}\x{8B28}\x{8B2A}\x{8B2B}\x{8B2C}' .
+'\x{8B2D}\x{8B2E}\x{8B2F}\x{8B30}\x{8B31}\x{8B33}\x{8B34}\x{8B35}\x{8B36}' .
+'\x{8B37}\x{8B39}\x{8B3A}\x{8B3B}\x{8B3C}\x{8B3D}\x{8B3E}\x{8B40}\x{8B41}' .
+'\x{8B42}\x{8B43}\x{8B44}\x{8B45}\x{8B46}\x{8B47}\x{8B48}\x{8B49}\x{8B4A}' .
+'\x{8B4B}\x{8B4C}\x{8B4D}\x{8B4E}\x{8B4F}\x{8B50}\x{8B51}\x{8B52}\x{8B53}' .
+'\x{8B54}\x{8B55}\x{8B56}\x{8B57}\x{8B58}\x{8B59}\x{8B5A}\x{8B5B}\x{8B5C}' .
+'\x{8B5D}\x{8B5E}\x{8B5F}\x{8B60}\x{8B63}\x{8B64}\x{8B65}\x{8B66}\x{8B67}' .
+'\x{8B68}\x{8B6A}\x{8B6B}\x{8B6C}\x{8B6D}\x{8B6E}\x{8B6F}\x{8B70}\x{8B71}' .
+'\x{8B73}\x{8B74}\x{8B76}\x{8B77}\x{8B78}\x{8B79}\x{8B7A}\x{8B7B}\x{8B7D}' .
+'\x{8B7E}\x{8B7F}\x{8B80}\x{8B82}\x{8B83}\x{8B84}\x{8B85}\x{8B86}\x{8B88}' .
+'\x{8B89}\x{8B8A}\x{8B8B}\x{8B8C}\x{8B8E}\x{8B90}\x{8B91}\x{8B92}\x{8B93}' .
+'\x{8B94}\x{8B95}\x{8B96}\x{8B97}\x{8B98}\x{8B99}\x{8B9A}\x{8B9C}\x{8B9D}' .
+'\x{8B9E}\x{8B9F}\x{8BA0}\x{8BA1}\x{8BA2}\x{8BA3}\x{8BA4}\x{8BA5}\x{8BA6}' .
+'\x{8BA7}\x{8BA8}\x{8BA9}\x{8BAA}\x{8BAB}\x{8BAC}\x{8BAD}\x{8BAE}\x{8BAF}' .
+'\x{8BB0}\x{8BB1}\x{8BB2}\x{8BB3}\x{8BB4}\x{8BB5}\x{8BB6}\x{8BB7}\x{8BB8}' .
+'\x{8BB9}\x{8BBA}\x{8BBB}\x{8BBC}\x{8BBD}\x{8BBE}\x{8BBF}\x{8BC0}\x{8BC1}' .
+'\x{8BC2}\x{8BC3}\x{8BC4}\x{8BC5}\x{8BC6}\x{8BC7}\x{8BC8}\x{8BC9}\x{8BCA}' .
+'\x{8BCB}\x{8BCC}\x{8BCD}\x{8BCE}\x{8BCF}\x{8BD0}\x{8BD1}\x{8BD2}\x{8BD3}' .
+'\x{8BD4}\x{8BD5}\x{8BD6}\x{8BD7}\x{8BD8}\x{8BD9}\x{8BDA}\x{8BDB}\x{8BDC}' .
+'\x{8BDD}\x{8BDE}\x{8BDF}\x{8BE0}\x{8BE1}\x{8BE2}\x{8BE3}\x{8BE4}\x{8BE5}' .
+'\x{8BE6}\x{8BE7}\x{8BE8}\x{8BE9}\x{8BEA}\x{8BEB}\x{8BEC}\x{8BED}\x{8BEE}' .
+'\x{8BEF}\x{8BF0}\x{8BF1}\x{8BF2}\x{8BF3}\x{8BF4}\x{8BF5}\x{8BF6}\x{8BF7}' .
+'\x{8BF8}\x{8BF9}\x{8BFA}\x{8BFB}\x{8BFC}\x{8BFD}\x{8BFE}\x{8BFF}\x{8C00}' .
+'\x{8C01}\x{8C02}\x{8C03}\x{8C04}\x{8C05}\x{8C06}\x{8C07}\x{8C08}\x{8C09}' .
+'\x{8C0A}\x{8C0B}\x{8C0C}\x{8C0D}\x{8C0E}\x{8C0F}\x{8C10}\x{8C11}\x{8C12}' .
+'\x{8C13}\x{8C14}\x{8C15}\x{8C16}\x{8C17}\x{8C18}\x{8C19}\x{8C1A}\x{8C1B}' .
+'\x{8C1C}\x{8C1D}\x{8C1E}\x{8C1F}\x{8C20}\x{8C21}\x{8C22}\x{8C23}\x{8C24}' .
+'\x{8C25}\x{8C26}\x{8C27}\x{8C28}\x{8C29}\x{8C2A}\x{8C2B}\x{8C2C}\x{8C2D}' .
+'\x{8C2E}\x{8C2F}\x{8C30}\x{8C31}\x{8C32}\x{8C33}\x{8C34}\x{8C35}\x{8C36}' .
+'\x{8C37}\x{8C39}\x{8C3A}\x{8C3B}\x{8C3C}\x{8C3D}\x{8C3E}\x{8C3F}\x{8C41}' .
+'\x{8C42}\x{8C43}\x{8C45}\x{8C46}\x{8C47}\x{8C48}\x{8C49}\x{8C4A}\x{8C4B}' .
+'\x{8C4C}\x{8C4D}\x{8C4E}\x{8C4F}\x{8C50}\x{8C54}\x{8C55}\x{8C56}\x{8C57}' .
+'\x{8C59}\x{8C5A}\x{8C5B}\x{8C5C}\x{8C5D}\x{8C5E}\x{8C5F}\x{8C60}\x{8C61}' .
+'\x{8C62}\x{8C63}\x{8C64}\x{8C65}\x{8C66}\x{8C67}\x{8C68}\x{8C69}\x{8C6A}' .
+'\x{8C6B}\x{8C6C}\x{8C6D}\x{8C6E}\x{8C6F}\x{8C70}\x{8C71}\x{8C72}\x{8C73}' .
+'\x{8C75}\x{8C76}\x{8C77}\x{8C78}\x{8C79}\x{8C7A}\x{8C7B}\x{8C7D}\x{8C7E}' .
+'\x{8C80}\x{8C81}\x{8C82}\x{8C84}\x{8C85}\x{8C86}\x{8C88}\x{8C89}\x{8C8A}' .
+'\x{8C8C}\x{8C8D}\x{8C8F}\x{8C90}\x{8C91}\x{8C92}\x{8C93}\x{8C94}\x{8C95}' .
+'\x{8C96}\x{8C97}\x{8C98}\x{8C99}\x{8C9A}\x{8C9C}\x{8C9D}\x{8C9E}\x{8C9F}' .
+'\x{8CA0}\x{8CA1}\x{8CA2}\x{8CA3}\x{8CA4}\x{8CA5}\x{8CA7}\x{8CA8}\x{8CA9}' .
+'\x{8CAA}\x{8CAB}\x{8CAC}\x{8CAD}\x{8CAE}\x{8CAF}\x{8CB0}\x{8CB1}\x{8CB2}' .
+'\x{8CB3}\x{8CB4}\x{8CB5}\x{8CB6}\x{8CB7}\x{8CB8}\x{8CB9}\x{8CBA}\x{8CBB}' .
+'\x{8CBC}\x{8CBD}\x{8CBE}\x{8CBF}\x{8CC0}\x{8CC1}\x{8CC2}\x{8CC3}\x{8CC4}' .
+'\x{8CC5}\x{8CC6}\x{8CC7}\x{8CC8}\x{8CC9}\x{8CCA}\x{8CCC}\x{8CCE}\x{8CCF}' .
+'\x{8CD0}\x{8CD1}\x{8CD2}\x{8CD3}\x{8CD4}\x{8CD5}\x{8CD7}\x{8CD9}\x{8CDA}' .
+'\x{8CDB}\x{8CDC}\x{8CDD}\x{8CDE}\x{8CDF}\x{8CE0}\x{8CE1}\x{8CE2}\x{8CE3}' .
+'\x{8CE4}\x{8CE5}\x{8CE6}\x{8CE7}\x{8CE8}\x{8CEA}\x{8CEB}\x{8CEC}\x{8CED}' .
+'\x{8CEE}\x{8CEF}\x{8CF0}\x{8CF1}\x{8CF2}\x{8CF3}\x{8CF4}\x{8CF5}\x{8CF6}' .
+'\x{8CF8}\x{8CF9}\x{8CFA}\x{8CFB}\x{8CFC}\x{8CFD}\x{8CFE}\x{8CFF}\x{8D00}' .
+'\x{8D02}\x{8D03}\x{8D04}\x{8D05}\x{8D06}\x{8D07}\x{8D08}\x{8D09}\x{8D0A}' .
+'\x{8D0B}\x{8D0C}\x{8D0D}\x{8D0E}\x{8D0F}\x{8D10}\x{8D13}\x{8D14}\x{8D15}' .
+'\x{8D16}\x{8D17}\x{8D18}\x{8D19}\x{8D1A}\x{8D1B}\x{8D1C}\x{8D1D}\x{8D1E}' .
+'\x{8D1F}\x{8D20}\x{8D21}\x{8D22}\x{8D23}\x{8D24}\x{8D25}\x{8D26}\x{8D27}' .
+'\x{8D28}\x{8D29}\x{8D2A}\x{8D2B}\x{8D2C}\x{8D2D}\x{8D2E}\x{8D2F}\x{8D30}' .
+'\x{8D31}\x{8D32}\x{8D33}\x{8D34}\x{8D35}\x{8D36}\x{8D37}\x{8D38}\x{8D39}' .
+'\x{8D3A}\x{8D3B}\x{8D3C}\x{8D3D}\x{8D3E}\x{8D3F}\x{8D40}\x{8D41}\x{8D42}' .
+'\x{8D43}\x{8D44}\x{8D45}\x{8D46}\x{8D47}\x{8D48}\x{8D49}\x{8D4A}\x{8D4B}' .
+'\x{8D4C}\x{8D4D}\x{8D4E}\x{8D4F}\x{8D50}\x{8D51}\x{8D52}\x{8D53}\x{8D54}' .
+'\x{8D55}\x{8D56}\x{8D57}\x{8D58}\x{8D59}\x{8D5A}\x{8D5B}\x{8D5C}\x{8D5D}' .
+'\x{8D5E}\x{8D5F}\x{8D60}\x{8D61}\x{8D62}\x{8D63}\x{8D64}\x{8D65}\x{8D66}' .
+'\x{8D67}\x{8D68}\x{8D69}\x{8D6A}\x{8D6B}\x{8D6C}\x{8D6D}\x{8D6E}\x{8D6F}' .
+'\x{8D70}\x{8D71}\x{8D72}\x{8D73}\x{8D74}\x{8D75}\x{8D76}\x{8D77}\x{8D78}' .
+'\x{8D79}\x{8D7A}\x{8D7B}\x{8D7D}\x{8D7E}\x{8D7F}\x{8D80}\x{8D81}\x{8D82}' .
+'\x{8D83}\x{8D84}\x{8D85}\x{8D86}\x{8D87}\x{8D88}\x{8D89}\x{8D8A}\x{8D8B}' .
+'\x{8D8C}\x{8D8D}\x{8D8E}\x{8D8F}\x{8D90}\x{8D91}\x{8D92}\x{8D93}\x{8D94}' .
+'\x{8D95}\x{8D96}\x{8D97}\x{8D98}\x{8D99}\x{8D9A}\x{8D9B}\x{8D9C}\x{8D9D}' .
+'\x{8D9E}\x{8D9F}\x{8DA0}\x{8DA1}\x{8DA2}\x{8DA3}\x{8DA4}\x{8DA5}\x{8DA7}' .
+'\x{8DA8}\x{8DA9}\x{8DAA}\x{8DAB}\x{8DAC}\x{8DAD}\x{8DAE}\x{8DAF}\x{8DB0}' .
+'\x{8DB1}\x{8DB2}\x{8DB3}\x{8DB4}\x{8DB5}\x{8DB6}\x{8DB7}\x{8DB8}\x{8DB9}' .
+'\x{8DBA}\x{8DBB}\x{8DBC}\x{8DBD}\x{8DBE}\x{8DBF}\x{8DC1}\x{8DC2}\x{8DC3}' .
+'\x{8DC4}\x{8DC5}\x{8DC6}\x{8DC7}\x{8DC8}\x{8DC9}\x{8DCA}\x{8DCB}\x{8DCC}' .
+'\x{8DCD}\x{8DCE}\x{8DCF}\x{8DD0}\x{8DD1}\x{8DD2}\x{8DD3}\x{8DD4}\x{8DD5}' .
+'\x{8DD6}\x{8DD7}\x{8DD8}\x{8DD9}\x{8DDA}\x{8DDB}\x{8DDC}\x{8DDD}\x{8DDE}' .
+'\x{8DDF}\x{8DE0}\x{8DE1}\x{8DE2}\x{8DE3}\x{8DE4}\x{8DE6}\x{8DE7}\x{8DE8}' .
+'\x{8DE9}\x{8DEA}\x{8DEB}\x{8DEC}\x{8DED}\x{8DEE}\x{8DEF}\x{8DF0}\x{8DF1}' .
+'\x{8DF2}\x{8DF3}\x{8DF4}\x{8DF5}\x{8DF6}\x{8DF7}\x{8DF8}\x{8DF9}\x{8DFA}' .
+'\x{8DFB}\x{8DFC}\x{8DFD}\x{8DFE}\x{8DFF}\x{8E00}\x{8E02}\x{8E03}\x{8E04}' .
+'\x{8E05}\x{8E06}\x{8E07}\x{8E08}\x{8E09}\x{8E0A}\x{8E0C}\x{8E0D}\x{8E0E}' .
+'\x{8E0F}\x{8E10}\x{8E11}\x{8E12}\x{8E13}\x{8E14}\x{8E15}\x{8E16}\x{8E17}' .
+'\x{8E18}\x{8E19}\x{8E1A}\x{8E1B}\x{8E1C}\x{8E1D}\x{8E1E}\x{8E1F}\x{8E20}' .
+'\x{8E21}\x{8E22}\x{8E23}\x{8E24}\x{8E25}\x{8E26}\x{8E27}\x{8E28}\x{8E29}' .
+'\x{8E2A}\x{8E2B}\x{8E2C}\x{8E2D}\x{8E2E}\x{8E2F}\x{8E30}\x{8E31}\x{8E33}' .
+'\x{8E34}\x{8E35}\x{8E36}\x{8E37}\x{8E38}\x{8E39}\x{8E3A}\x{8E3B}\x{8E3C}' .
+'\x{8E3D}\x{8E3E}\x{8E3F}\x{8E40}\x{8E41}\x{8E42}\x{8E43}\x{8E44}\x{8E45}' .
+'\x{8E47}\x{8E48}\x{8E49}\x{8E4A}\x{8E4B}\x{8E4C}\x{8E4D}\x{8E4E}\x{8E50}' .
+'\x{8E51}\x{8E52}\x{8E53}\x{8E54}\x{8E55}\x{8E56}\x{8E57}\x{8E58}\x{8E59}' .
+'\x{8E5A}\x{8E5B}\x{8E5C}\x{8E5D}\x{8E5E}\x{8E5F}\x{8E60}\x{8E61}\x{8E62}' .
+'\x{8E63}\x{8E64}\x{8E65}\x{8E66}\x{8E67}\x{8E68}\x{8E69}\x{8E6A}\x{8E6B}' .
+'\x{8E6C}\x{8E6D}\x{8E6F}\x{8E70}\x{8E71}\x{8E72}\x{8E73}\x{8E74}\x{8E76}' .
+'\x{8E78}\x{8E7A}\x{8E7B}\x{8E7C}\x{8E7D}\x{8E7E}\x{8E7F}\x{8E80}\x{8E81}' .
+'\x{8E82}\x{8E83}\x{8E84}\x{8E85}\x{8E86}\x{8E87}\x{8E88}\x{8E89}\x{8E8A}' .
+'\x{8E8B}\x{8E8C}\x{8E8D}\x{8E8E}\x{8E8F}\x{8E90}\x{8E91}\x{8E92}\x{8E93}' .
+'\x{8E94}\x{8E95}\x{8E96}\x{8E97}\x{8E98}\x{8E9A}\x{8E9C}\x{8E9D}\x{8E9E}' .
+'\x{8E9F}\x{8EA0}\x{8EA1}\x{8EA3}\x{8EA4}\x{8EA5}\x{8EA6}\x{8EA7}\x{8EA8}' .
+'\x{8EA9}\x{8EAA}\x{8EAB}\x{8EAC}\x{8EAD}\x{8EAE}\x{8EAF}\x{8EB0}\x{8EB1}' .
+'\x{8EB2}\x{8EB4}\x{8EB5}\x{8EB8}\x{8EB9}\x{8EBA}\x{8EBB}\x{8EBC}\x{8EBD}' .
+'\x{8EBE}\x{8EBF}\x{8EC0}\x{8EC2}\x{8EC3}\x{8EC5}\x{8EC6}\x{8EC7}\x{8EC8}' .
+'\x{8EC9}\x{8ECA}\x{8ECB}\x{8ECC}\x{8ECD}\x{8ECE}\x{8ECF}\x{8ED0}\x{8ED1}' .
+'\x{8ED2}\x{8ED3}\x{8ED4}\x{8ED5}\x{8ED6}\x{8ED7}\x{8ED8}\x{8EDA}\x{8EDB}' .
+'\x{8EDC}\x{8EDD}\x{8EDE}\x{8EDF}\x{8EE0}\x{8EE1}\x{8EE4}\x{8EE5}\x{8EE6}' .
+'\x{8EE7}\x{8EE8}\x{8EE9}\x{8EEA}\x{8EEB}\x{8EEC}\x{8EED}\x{8EEE}\x{8EEF}' .
+'\x{8EF1}\x{8EF2}\x{8EF3}\x{8EF4}\x{8EF5}\x{8EF6}\x{8EF7}\x{8EF8}\x{8EF9}' .
+'\x{8EFA}\x{8EFB}\x{8EFC}\x{8EFD}\x{8EFE}\x{8EFF}\x{8F00}\x{8F01}\x{8F02}' .
+'\x{8F03}\x{8F04}\x{8F05}\x{8F06}\x{8F07}\x{8F08}\x{8F09}\x{8F0A}\x{8F0B}' .
+'\x{8F0D}\x{8F0E}\x{8F10}\x{8F11}\x{8F12}\x{8F13}\x{8F14}\x{8F15}\x{8F16}' .
+'\x{8F17}\x{8F18}\x{8F1A}\x{8F1B}\x{8F1C}\x{8F1D}\x{8F1E}\x{8F1F}\x{8F20}' .
+'\x{8F21}\x{8F22}\x{8F23}\x{8F24}\x{8F25}\x{8F26}\x{8F27}\x{8F28}\x{8F29}' .
+'\x{8F2A}\x{8F2B}\x{8F2C}\x{8F2E}\x{8F2F}\x{8F30}\x{8F31}\x{8F32}\x{8F33}' .
+'\x{8F34}\x{8F35}\x{8F36}\x{8F37}\x{8F38}\x{8F39}\x{8F3B}\x{8F3C}\x{8F3D}' .
+'\x{8F3E}\x{8F3F}\x{8F40}\x{8F42}\x{8F43}\x{8F44}\x{8F45}\x{8F46}\x{8F47}' .
+'\x{8F48}\x{8F49}\x{8F4A}\x{8F4B}\x{8F4C}\x{8F4D}\x{8F4E}\x{8F4F}\x{8F50}' .
+'\x{8F51}\x{8F52}\x{8F53}\x{8F54}\x{8F55}\x{8F56}\x{8F57}\x{8F58}\x{8F59}' .
+'\x{8F5A}\x{8F5B}\x{8F5D}\x{8F5E}\x{8F5F}\x{8F60}\x{8F61}\x{8F62}\x{8F63}' .
+'\x{8F64}\x{8F65}\x{8F66}\x{8F67}\x{8F68}\x{8F69}\x{8F6A}\x{8F6B}\x{8F6C}' .
+'\x{8F6D}\x{8F6E}\x{8F6F}\x{8F70}\x{8F71}\x{8F72}\x{8F73}\x{8F74}\x{8F75}' .
+'\x{8F76}\x{8F77}\x{8F78}\x{8F79}\x{8F7A}\x{8F7B}\x{8F7C}\x{8F7D}\x{8F7E}' .
+'\x{8F7F}\x{8F80}\x{8F81}\x{8F82}\x{8F83}\x{8F84}\x{8F85}\x{8F86}\x{8F87}' .
+'\x{8F88}\x{8F89}\x{8F8A}\x{8F8B}\x{8F8C}\x{8F8D}\x{8F8E}\x{8F8F}\x{8F90}' .
+'\x{8F91}\x{8F92}\x{8F93}\x{8F94}\x{8F95}\x{8F96}\x{8F97}\x{8F98}\x{8F99}' .
+'\x{8F9A}\x{8F9B}\x{8F9C}\x{8F9E}\x{8F9F}\x{8FA0}\x{8FA1}\x{8FA2}\x{8FA3}' .
+'\x{8FA5}\x{8FA6}\x{8FA7}\x{8FA8}\x{8FA9}\x{8FAA}\x{8FAB}\x{8FAC}\x{8FAD}' .
+'\x{8FAE}\x{8FAF}\x{8FB0}\x{8FB1}\x{8FB2}\x{8FB4}\x{8FB5}\x{8FB6}\x{8FB7}' .
+'\x{8FB8}\x{8FB9}\x{8FBB}\x{8FBC}\x{8FBD}\x{8FBE}\x{8FBF}\x{8FC0}\x{8FC1}' .
+'\x{8FC2}\x{8FC4}\x{8FC5}\x{8FC6}\x{8FC7}\x{8FC8}\x{8FC9}\x{8FCB}\x{8FCC}' .
+'\x{8FCD}\x{8FCE}\x{8FCF}\x{8FD0}\x{8FD1}\x{8FD2}\x{8FD3}\x{8FD4}\x{8FD5}' .
+'\x{8FD6}\x{8FD7}\x{8FD8}\x{8FD9}\x{8FDA}\x{8FDB}\x{8FDC}\x{8FDD}\x{8FDE}' .
+'\x{8FDF}\x{8FE0}\x{8FE1}\x{8FE2}\x{8FE3}\x{8FE4}\x{8FE5}\x{8FE6}\x{8FE8}' .
+'\x{8FE9}\x{8FEA}\x{8FEB}\x{8FEC}\x{8FED}\x{8FEE}\x{8FEF}\x{8FF0}\x{8FF1}' .
+'\x{8FF2}\x{8FF3}\x{8FF4}\x{8FF5}\x{8FF6}\x{8FF7}\x{8FF8}\x{8FF9}\x{8FFA}' .
+'\x{8FFB}\x{8FFC}\x{8FFD}\x{8FFE}\x{8FFF}\x{9000}\x{9001}\x{9002}\x{9003}' .
+'\x{9004}\x{9005}\x{9006}\x{9007}\x{9008}\x{9009}\x{900A}\x{900B}\x{900C}' .
+'\x{900D}\x{900F}\x{9010}\x{9011}\x{9012}\x{9013}\x{9014}\x{9015}\x{9016}' .
+'\x{9017}\x{9018}\x{9019}\x{901A}\x{901B}\x{901C}\x{901D}\x{901E}\x{901F}' .
+'\x{9020}\x{9021}\x{9022}\x{9023}\x{9024}\x{9025}\x{9026}\x{9027}\x{9028}' .
+'\x{9029}\x{902B}\x{902D}\x{902E}\x{902F}\x{9030}\x{9031}\x{9032}\x{9033}' .
+'\x{9034}\x{9035}\x{9036}\x{9038}\x{903A}\x{903B}\x{903C}\x{903D}\x{903E}' .
+'\x{903F}\x{9041}\x{9042}\x{9043}\x{9044}\x{9045}\x{9047}\x{9048}\x{9049}' .
+'\x{904A}\x{904B}\x{904C}\x{904D}\x{904E}\x{904F}\x{9050}\x{9051}\x{9052}' .
+'\x{9053}\x{9054}\x{9055}\x{9056}\x{9057}\x{9058}\x{9059}\x{905A}\x{905B}' .
+'\x{905C}\x{905D}\x{905E}\x{905F}\x{9060}\x{9061}\x{9062}\x{9063}\x{9064}' .
+'\x{9065}\x{9066}\x{9067}\x{9068}\x{9069}\x{906A}\x{906B}\x{906C}\x{906D}' .
+'\x{906E}\x{906F}\x{9070}\x{9071}\x{9072}\x{9073}\x{9074}\x{9075}\x{9076}' .
+'\x{9077}\x{9078}\x{9079}\x{907A}\x{907B}\x{907C}\x{907D}\x{907E}\x{907F}' .
+'\x{9080}\x{9081}\x{9082}\x{9083}\x{9084}\x{9085}\x{9086}\x{9087}\x{9088}' .
+'\x{9089}\x{908A}\x{908B}\x{908C}\x{908D}\x{908E}\x{908F}\x{9090}\x{9091}' .
+'\x{9092}\x{9093}\x{9094}\x{9095}\x{9096}\x{9097}\x{9098}\x{9099}\x{909A}' .
+'\x{909B}\x{909C}\x{909D}\x{909E}\x{909F}\x{90A0}\x{90A1}\x{90A2}\x{90A3}' .
+'\x{90A4}\x{90A5}\x{90A6}\x{90A7}\x{90A8}\x{90A9}\x{90AA}\x{90AC}\x{90AD}' .
+'\x{90AE}\x{90AF}\x{90B0}\x{90B1}\x{90B2}\x{90B3}\x{90B4}\x{90B5}\x{90B6}' .
+'\x{90B7}\x{90B8}\x{90B9}\x{90BA}\x{90BB}\x{90BC}\x{90BD}\x{90BE}\x{90BF}' .
+'\x{90C0}\x{90C1}\x{90C2}\x{90C3}\x{90C4}\x{90C5}\x{90C6}\x{90C7}\x{90C8}' .
+'\x{90C9}\x{90CA}\x{90CB}\x{90CE}\x{90CF}\x{90D0}\x{90D1}\x{90D3}\x{90D4}' .
+'\x{90D5}\x{90D6}\x{90D7}\x{90D8}\x{90D9}\x{90DA}\x{90DB}\x{90DC}\x{90DD}' .
+'\x{90DE}\x{90DF}\x{90E0}\x{90E1}\x{90E2}\x{90E3}\x{90E4}\x{90E5}\x{90E6}' .
+'\x{90E7}\x{90E8}\x{90E9}\x{90EA}\x{90EB}\x{90EC}\x{90ED}\x{90EE}\x{90EF}' .
+'\x{90F0}\x{90F1}\x{90F2}\x{90F3}\x{90F4}\x{90F5}\x{90F7}\x{90F8}\x{90F9}' .
+'\x{90FA}\x{90FB}\x{90FC}\x{90FD}\x{90FE}\x{90FF}\x{9100}\x{9101}\x{9102}' .
+'\x{9103}\x{9104}\x{9105}\x{9106}\x{9107}\x{9108}\x{9109}\x{910B}\x{910C}' .
+'\x{910D}\x{910E}\x{910F}\x{9110}\x{9111}\x{9112}\x{9113}\x{9114}\x{9115}' .
+'\x{9116}\x{9117}\x{9118}\x{9119}\x{911A}\x{911B}\x{911C}\x{911D}\x{911E}' .
+'\x{911F}\x{9120}\x{9121}\x{9122}\x{9123}\x{9124}\x{9125}\x{9126}\x{9127}' .
+'\x{9128}\x{9129}\x{912A}\x{912B}\x{912C}\x{912D}\x{912E}\x{912F}\x{9130}' .
+'\x{9131}\x{9132}\x{9133}\x{9134}\x{9135}\x{9136}\x{9137}\x{9138}\x{9139}' .
+'\x{913A}\x{913B}\x{913E}\x{913F}\x{9140}\x{9141}\x{9142}\x{9143}\x{9144}' .
+'\x{9145}\x{9146}\x{9147}\x{9148}\x{9149}\x{914A}\x{914B}\x{914C}\x{914D}' .
+'\x{914E}\x{914F}\x{9150}\x{9151}\x{9152}\x{9153}\x{9154}\x{9155}\x{9156}' .
+'\x{9157}\x{9158}\x{915A}\x{915B}\x{915C}\x{915D}\x{915E}\x{915F}\x{9160}' .
+'\x{9161}\x{9162}\x{9163}\x{9164}\x{9165}\x{9166}\x{9167}\x{9168}\x{9169}' .
+'\x{916A}\x{916B}\x{916C}\x{916D}\x{916E}\x{916F}\x{9170}\x{9171}\x{9172}' .
+'\x{9173}\x{9174}\x{9175}\x{9176}\x{9177}\x{9178}\x{9179}\x{917A}\x{917C}' .
+'\x{917D}\x{917E}\x{917F}\x{9180}\x{9181}\x{9182}\x{9183}\x{9184}\x{9185}' .
+'\x{9186}\x{9187}\x{9188}\x{9189}\x{918A}\x{918B}\x{918C}\x{918D}\x{918E}' .
+'\x{918F}\x{9190}\x{9191}\x{9192}\x{9193}\x{9194}\x{9196}\x{9199}\x{919A}' .
+'\x{919B}\x{919C}\x{919D}\x{919E}\x{919F}\x{91A0}\x{91A1}\x{91A2}\x{91A3}' .
+'\x{91A5}\x{91A6}\x{91A7}\x{91A8}\x{91AA}\x{91AB}\x{91AC}\x{91AD}\x{91AE}' .
+'\x{91AF}\x{91B0}\x{91B1}\x{91B2}\x{91B3}\x{91B4}\x{91B5}\x{91B6}\x{91B7}' .
+'\x{91B9}\x{91BA}\x{91BB}\x{91BC}\x{91BD}\x{91BE}\x{91C0}\x{91C1}\x{91C2}' .
+'\x{91C3}\x{91C5}\x{91C6}\x{91C7}\x{91C9}\x{91CA}\x{91CB}\x{91CC}\x{91CD}' .
+'\x{91CE}\x{91CF}\x{91D0}\x{91D1}\x{91D2}\x{91D3}\x{91D4}\x{91D5}\x{91D7}' .
+'\x{91D8}\x{91D9}\x{91DA}\x{91DB}\x{91DC}\x{91DD}\x{91DE}\x{91DF}\x{91E2}' .
+'\x{91E3}\x{91E4}\x{91E5}\x{91E6}\x{91E7}\x{91E8}\x{91E9}\x{91EA}\x{91EB}' .
+'\x{91EC}\x{91ED}\x{91EE}\x{91F0}\x{91F1}\x{91F2}\x{91F3}\x{91F4}\x{91F5}' .
+'\x{91F7}\x{91F8}\x{91F9}\x{91FA}\x{91FB}\x{91FD}\x{91FE}\x{91FF}\x{9200}' .
+'\x{9201}\x{9202}\x{9203}\x{9204}\x{9205}\x{9206}\x{9207}\x{9208}\x{9209}' .
+'\x{920A}\x{920B}\x{920C}\x{920D}\x{920E}\x{920F}\x{9210}\x{9211}\x{9212}' .
+'\x{9214}\x{9215}\x{9216}\x{9217}\x{9218}\x{9219}\x{921A}\x{921B}\x{921C}' .
+'\x{921D}\x{921E}\x{9220}\x{9221}\x{9223}\x{9224}\x{9225}\x{9226}\x{9227}' .
+'\x{9228}\x{9229}\x{922A}\x{922B}\x{922D}\x{922E}\x{922F}\x{9230}\x{9231}' .
+'\x{9232}\x{9233}\x{9234}\x{9235}\x{9236}\x{9237}\x{9238}\x{9239}\x{923A}' .
+'\x{923B}\x{923C}\x{923D}\x{923E}\x{923F}\x{9240}\x{9241}\x{9242}\x{9245}' .
+'\x{9246}\x{9247}\x{9248}\x{9249}\x{924A}\x{924B}\x{924C}\x{924D}\x{924E}' .
+'\x{924F}\x{9250}\x{9251}\x{9252}\x{9253}\x{9254}\x{9255}\x{9256}\x{9257}' .
+'\x{9258}\x{9259}\x{925A}\x{925B}\x{925C}\x{925D}\x{925E}\x{925F}\x{9260}' .
+'\x{9261}\x{9262}\x{9263}\x{9264}\x{9265}\x{9266}\x{9267}\x{9268}\x{926B}' .
+'\x{926C}\x{926D}\x{926E}\x{926F}\x{9270}\x{9272}\x{9273}\x{9274}\x{9275}' .
+'\x{9276}\x{9277}\x{9278}\x{9279}\x{927A}\x{927B}\x{927C}\x{927D}\x{927E}' .
+'\x{927F}\x{9280}\x{9282}\x{9283}\x{9285}\x{9286}\x{9287}\x{9288}\x{9289}' .
+'\x{928A}\x{928B}\x{928C}\x{928D}\x{928E}\x{928F}\x{9290}\x{9291}\x{9292}' .
+'\x{9293}\x{9294}\x{9295}\x{9296}\x{9297}\x{9298}\x{9299}\x{929A}\x{929B}' .
+'\x{929C}\x{929D}\x{929F}\x{92A0}\x{92A1}\x{92A2}\x{92A3}\x{92A4}\x{92A5}' .
+'\x{92A6}\x{92A7}\x{92A8}\x{92A9}\x{92AA}\x{92AB}\x{92AC}\x{92AD}\x{92AE}' .
+'\x{92AF}\x{92B0}\x{92B1}\x{92B2}\x{92B3}\x{92B4}\x{92B5}\x{92B6}\x{92B7}' .
+'\x{92B8}\x{92B9}\x{92BA}\x{92BB}\x{92BC}\x{92BE}\x{92BF}\x{92C0}\x{92C1}' .
+'\x{92C2}\x{92C3}\x{92C4}\x{92C5}\x{92C6}\x{92C7}\x{92C8}\x{92C9}\x{92CA}' .
+'\x{92CB}\x{92CC}\x{92CD}\x{92CE}\x{92CF}\x{92D0}\x{92D1}\x{92D2}\x{92D3}' .
+'\x{92D5}\x{92D6}\x{92D7}\x{92D8}\x{92D9}\x{92DA}\x{92DC}\x{92DD}\x{92DE}' .
+'\x{92DF}\x{92E0}\x{92E1}\x{92E3}\x{92E4}\x{92E5}\x{92E6}\x{92E7}\x{92E8}' .
+'\x{92E9}\x{92EA}\x{92EB}\x{92EC}\x{92ED}\x{92EE}\x{92EF}\x{92F0}\x{92F1}' .
+'\x{92F2}\x{92F3}\x{92F4}\x{92F5}\x{92F6}\x{92F7}\x{92F8}\x{92F9}\x{92FA}' .
+'\x{92FB}\x{92FC}\x{92FD}\x{92FE}\x{92FF}\x{9300}\x{9301}\x{9302}\x{9303}' .
+'\x{9304}\x{9305}\x{9306}\x{9307}\x{9308}\x{9309}\x{930A}\x{930B}\x{930C}' .
+'\x{930D}\x{930E}\x{930F}\x{9310}\x{9311}\x{9312}\x{9313}\x{9314}\x{9315}' .
+'\x{9316}\x{9317}\x{9318}\x{9319}\x{931A}\x{931B}\x{931D}\x{931E}\x{931F}' .
+'\x{9320}\x{9321}\x{9322}\x{9323}\x{9324}\x{9325}\x{9326}\x{9327}\x{9328}' .
+'\x{9329}\x{932A}\x{932B}\x{932D}\x{932E}\x{932F}\x{9332}\x{9333}\x{9334}' .
+'\x{9335}\x{9336}\x{9337}\x{9338}\x{9339}\x{933A}\x{933B}\x{933C}\x{933D}' .
+'\x{933E}\x{933F}\x{9340}\x{9341}\x{9342}\x{9343}\x{9344}\x{9345}\x{9346}' .
+'\x{9347}\x{9348}\x{9349}\x{934A}\x{934B}\x{934C}\x{934D}\x{934E}\x{934F}' .
+'\x{9350}\x{9351}\x{9352}\x{9353}\x{9354}\x{9355}\x{9356}\x{9357}\x{9358}' .
+'\x{9359}\x{935A}\x{935B}\x{935C}\x{935D}\x{935E}\x{935F}\x{9360}\x{9361}' .
+'\x{9363}\x{9364}\x{9365}\x{9366}\x{9367}\x{9369}\x{936A}\x{936C}\x{936D}' .
+'\x{936E}\x{9370}\x{9371}\x{9372}\x{9374}\x{9375}\x{9376}\x{9377}\x{9379}' .
+'\x{937A}\x{937B}\x{937C}\x{937D}\x{937E}\x{9380}\x{9382}\x{9383}\x{9384}' .
+'\x{9385}\x{9386}\x{9387}\x{9388}\x{9389}\x{938A}\x{938C}\x{938D}\x{938E}' .
+'\x{938F}\x{9390}\x{9391}\x{9392}\x{9393}\x{9394}\x{9395}\x{9396}\x{9397}' .
+'\x{9398}\x{9399}\x{939A}\x{939B}\x{939D}\x{939E}\x{939F}\x{93A1}\x{93A2}' .
+'\x{93A3}\x{93A4}\x{93A5}\x{93A6}\x{93A7}\x{93A8}\x{93A9}\x{93AA}\x{93AC}' .
+'\x{93AD}\x{93AE}\x{93AF}\x{93B0}\x{93B1}\x{93B2}\x{93B3}\x{93B4}\x{93B5}' .
+'\x{93B6}\x{93B7}\x{93B8}\x{93B9}\x{93BA}\x{93BC}\x{93BD}\x{93BE}\x{93BF}' .
+'\x{93C0}\x{93C1}\x{93C2}\x{93C3}\x{93C4}\x{93C5}\x{93C6}\x{93C7}\x{93C8}' .
+'\x{93C9}\x{93CA}\x{93CB}\x{93CC}\x{93CD}\x{93CE}\x{93CF}\x{93D0}\x{93D1}' .
+'\x{93D2}\x{93D3}\x{93D4}\x{93D5}\x{93D6}\x{93D7}\x{93D8}\x{93D9}\x{93DA}' .
+'\x{93DB}\x{93DC}\x{93DD}\x{93DE}\x{93DF}\x{93E1}\x{93E2}\x{93E3}\x{93E4}' .
+'\x{93E6}\x{93E7}\x{93E8}\x{93E9}\x{93EA}\x{93EB}\x{93EC}\x{93ED}\x{93EE}' .
+'\x{93EF}\x{93F0}\x{93F1}\x{93F2}\x{93F4}\x{93F5}\x{93F6}\x{93F7}\x{93F8}' .
+'\x{93F9}\x{93FA}\x{93FB}\x{93FC}\x{93FD}\x{93FE}\x{93FF}\x{9400}\x{9401}' .
+'\x{9403}\x{9404}\x{9405}\x{9406}\x{9407}\x{9408}\x{9409}\x{940A}\x{940B}' .
+'\x{940C}\x{940D}\x{940E}\x{940F}\x{9410}\x{9411}\x{9412}\x{9413}\x{9414}' .
+'\x{9415}\x{9416}\x{9418}\x{9419}\x{941B}\x{941D}\x{9420}\x{9422}\x{9423}' .
+'\x{9425}\x{9426}\x{9427}\x{9428}\x{9429}\x{942A}\x{942B}\x{942C}\x{942D}' .
+'\x{942E}\x{942F}\x{9430}\x{9431}\x{9432}\x{9433}\x{9434}\x{9435}\x{9436}' .
+'\x{9437}\x{9438}\x{9439}\x{943A}\x{943B}\x{943C}\x{943D}\x{943E}\x{943F}' .
+'\x{9440}\x{9441}\x{9442}\x{9444}\x{9445}\x{9446}\x{9447}\x{9448}\x{9449}' .
+'\x{944A}\x{944B}\x{944C}\x{944D}\x{944F}\x{9450}\x{9451}\x{9452}\x{9453}' .
+'\x{9454}\x{9455}\x{9456}\x{9457}\x{9458}\x{9459}\x{945B}\x{945C}\x{945D}' .
+'\x{945E}\x{945F}\x{9460}\x{9461}\x{9462}\x{9463}\x{9464}\x{9465}\x{9466}' .
+'\x{9467}\x{9468}\x{9469}\x{946A}\x{946B}\x{946D}\x{946E}\x{946F}\x{9470}' .
+'\x{9471}\x{9472}\x{9473}\x{9474}\x{9475}\x{9476}\x{9477}\x{9478}\x{9479}' .
+'\x{947A}\x{947C}\x{947D}\x{947E}\x{947F}\x{9480}\x{9481}\x{9482}\x{9483}' .
+'\x{9484}\x{9485}\x{9486}\x{9487}\x{9488}\x{9489}\x{948A}\x{948B}\x{948C}' .
+'\x{948D}\x{948E}\x{948F}\x{9490}\x{9491}\x{9492}\x{9493}\x{9494}\x{9495}' .
+'\x{9496}\x{9497}\x{9498}\x{9499}\x{949A}\x{949B}\x{949C}\x{949D}\x{949E}' .
+'\x{949F}\x{94A0}\x{94A1}\x{94A2}\x{94A3}\x{94A4}\x{94A5}\x{94A6}\x{94A7}' .
+'\x{94A8}\x{94A9}\x{94AA}\x{94AB}\x{94AC}\x{94AD}\x{94AE}\x{94AF}\x{94B0}' .
+'\x{94B1}\x{94B2}\x{94B3}\x{94B4}\x{94B5}\x{94B6}\x{94B7}\x{94B8}\x{94B9}' .
+'\x{94BA}\x{94BB}\x{94BC}\x{94BD}\x{94BE}\x{94BF}\x{94C0}\x{94C1}\x{94C2}' .
+'\x{94C3}\x{94C4}\x{94C5}\x{94C6}\x{94C7}\x{94C8}\x{94C9}\x{94CA}\x{94CB}' .
+'\x{94CC}\x{94CD}\x{94CE}\x{94CF}\x{94D0}\x{94D1}\x{94D2}\x{94D3}\x{94D4}' .
+'\x{94D5}\x{94D6}\x{94D7}\x{94D8}\x{94D9}\x{94DA}\x{94DB}\x{94DC}\x{94DD}' .
+'\x{94DE}\x{94DF}\x{94E0}\x{94E1}\x{94E2}\x{94E3}\x{94E4}\x{94E5}\x{94E6}' .
+'\x{94E7}\x{94E8}\x{94E9}\x{94EA}\x{94EB}\x{94EC}\x{94ED}\x{94EE}\x{94EF}' .
+'\x{94F0}\x{94F1}\x{94F2}\x{94F3}\x{94F4}\x{94F5}\x{94F6}\x{94F7}\x{94F8}' .
+'\x{94F9}\x{94FA}\x{94FB}\x{94FC}\x{94FD}\x{94FE}\x{94FF}\x{9500}\x{9501}' .
+'\x{9502}\x{9503}\x{9504}\x{9505}\x{9506}\x{9507}\x{9508}\x{9509}\x{950A}' .
+'\x{950B}\x{950C}\x{950D}\x{950E}\x{950F}\x{9510}\x{9511}\x{9512}\x{9513}' .
+'\x{9514}\x{9515}\x{9516}\x{9517}\x{9518}\x{9519}\x{951A}\x{951B}\x{951C}' .
+'\x{951D}\x{951E}\x{951F}\x{9520}\x{9521}\x{9522}\x{9523}\x{9524}\x{9525}' .
+'\x{9526}\x{9527}\x{9528}\x{9529}\x{952A}\x{952B}\x{952C}\x{952D}\x{952E}' .
+'\x{952F}\x{9530}\x{9531}\x{9532}\x{9533}\x{9534}\x{9535}\x{9536}\x{9537}' .
+'\x{9538}\x{9539}\x{953A}\x{953B}\x{953C}\x{953D}\x{953E}\x{953F}\x{9540}' .
+'\x{9541}\x{9542}\x{9543}\x{9544}\x{9545}\x{9546}\x{9547}\x{9548}\x{9549}' .
+'\x{954A}\x{954B}\x{954C}\x{954D}\x{954E}\x{954F}\x{9550}\x{9551}\x{9552}' .
+'\x{9553}\x{9554}\x{9555}\x{9556}\x{9557}\x{9558}\x{9559}\x{955A}\x{955B}' .
+'\x{955C}\x{955D}\x{955E}\x{955F}\x{9560}\x{9561}\x{9562}\x{9563}\x{9564}' .
+'\x{9565}\x{9566}\x{9567}\x{9568}\x{9569}\x{956A}\x{956B}\x{956C}\x{956D}' .
+'\x{956E}\x{956F}\x{9570}\x{9571}\x{9572}\x{9573}\x{9574}\x{9575}\x{9576}' .
+'\x{9577}\x{957A}\x{957B}\x{957C}\x{957D}\x{957F}\x{9580}\x{9581}\x{9582}' .
+'\x{9583}\x{9584}\x{9586}\x{9587}\x{9588}\x{9589}\x{958A}\x{958B}\x{958C}' .
+'\x{958D}\x{958E}\x{958F}\x{9590}\x{9591}\x{9592}\x{9593}\x{9594}\x{9595}' .
+'\x{9596}\x{9598}\x{9599}\x{959A}\x{959B}\x{959C}\x{959D}\x{959E}\x{959F}' .
+'\x{95A1}\x{95A2}\x{95A3}\x{95A4}\x{95A5}\x{95A6}\x{95A7}\x{95A8}\x{95A9}' .
+'\x{95AA}\x{95AB}\x{95AC}\x{95AD}\x{95AE}\x{95AF}\x{95B0}\x{95B1}\x{95B2}' .
+'\x{95B5}\x{95B6}\x{95B7}\x{95B9}\x{95BA}\x{95BB}\x{95BC}\x{95BD}\x{95BE}' .
+'\x{95BF}\x{95C0}\x{95C2}\x{95C3}\x{95C4}\x{95C5}\x{95C6}\x{95C7}\x{95C8}' .
+'\x{95C9}\x{95CA}\x{95CB}\x{95CC}\x{95CD}\x{95CE}\x{95CF}\x{95D0}\x{95D1}' .
+'\x{95D2}\x{95D3}\x{95D4}\x{95D5}\x{95D6}\x{95D7}\x{95D8}\x{95DA}\x{95DB}' .
+'\x{95DC}\x{95DE}\x{95DF}\x{95E0}\x{95E1}\x{95E2}\x{95E3}\x{95E4}\x{95E5}' .
+'\x{95E6}\x{95E7}\x{95E8}\x{95E9}\x{95EA}\x{95EB}\x{95EC}\x{95ED}\x{95EE}' .
+'\x{95EF}\x{95F0}\x{95F1}\x{95F2}\x{95F3}\x{95F4}\x{95F5}\x{95F6}\x{95F7}' .
+'\x{95F8}\x{95F9}\x{95FA}\x{95FB}\x{95FC}\x{95FD}\x{95FE}\x{95FF}\x{9600}' .
+'\x{9601}\x{9602}\x{9603}\x{9604}\x{9605}\x{9606}\x{9607}\x{9608}\x{9609}' .
+'\x{960A}\x{960B}\x{960C}\x{960D}\x{960E}\x{960F}\x{9610}\x{9611}\x{9612}' .
+'\x{9613}\x{9614}\x{9615}\x{9616}\x{9617}\x{9618}\x{9619}\x{961A}\x{961B}' .
+'\x{961C}\x{961D}\x{961E}\x{961F}\x{9620}\x{9621}\x{9622}\x{9623}\x{9624}' .
+'\x{9627}\x{9628}\x{962A}\x{962B}\x{962C}\x{962D}\x{962E}\x{962F}\x{9630}' .
+'\x{9631}\x{9632}\x{9633}\x{9634}\x{9635}\x{9636}\x{9637}\x{9638}\x{9639}' .
+'\x{963A}\x{963B}\x{963C}\x{963D}\x{963F}\x{9640}\x{9641}\x{9642}\x{9643}' .
+'\x{9644}\x{9645}\x{9646}\x{9647}\x{9648}\x{9649}\x{964A}\x{964B}\x{964C}' .
+'\x{964D}\x{964E}\x{964F}\x{9650}\x{9651}\x{9652}\x{9653}\x{9654}\x{9655}' .
+'\x{9658}\x{9659}\x{965A}\x{965B}\x{965C}\x{965D}\x{965E}\x{965F}\x{9660}' .
+'\x{9661}\x{9662}\x{9663}\x{9664}\x{9666}\x{9667}\x{9668}\x{9669}\x{966A}' .
+'\x{966B}\x{966C}\x{966D}\x{966E}\x{966F}\x{9670}\x{9671}\x{9672}\x{9673}' .
+'\x{9674}\x{9675}\x{9676}\x{9677}\x{9678}\x{967C}\x{967D}\x{967E}\x{9680}' .
+'\x{9683}\x{9684}\x{9685}\x{9686}\x{9687}\x{9688}\x{9689}\x{968A}\x{968B}' .
+'\x{968D}\x{968E}\x{968F}\x{9690}\x{9691}\x{9692}\x{9693}\x{9694}\x{9695}' .
+'\x{9697}\x{9698}\x{9699}\x{969B}\x{969C}\x{969E}\x{96A0}\x{96A1}\x{96A2}' .
+'\x{96A3}\x{96A4}\x{96A5}\x{96A6}\x{96A7}\x{96A8}\x{96A9}\x{96AA}\x{96AC}' .
+'\x{96AD}\x{96AE}\x{96B0}\x{96B1}\x{96B3}\x{96B4}\x{96B6}\x{96B7}\x{96B8}' .
+'\x{96B9}\x{96BA}\x{96BB}\x{96BC}\x{96BD}\x{96BE}\x{96BF}\x{96C0}\x{96C1}' .
+'\x{96C2}\x{96C3}\x{96C4}\x{96C5}\x{96C6}\x{96C7}\x{96C8}\x{96C9}\x{96CA}' .
+'\x{96CB}\x{96CC}\x{96CD}\x{96CE}\x{96CF}\x{96D0}\x{96D1}\x{96D2}\x{96D3}' .
+'\x{96D4}\x{96D5}\x{96D6}\x{96D7}\x{96D8}\x{96D9}\x{96DA}\x{96DB}\x{96DC}' .
+'\x{96DD}\x{96DE}\x{96DF}\x{96E0}\x{96E1}\x{96E2}\x{96E3}\x{96E5}\x{96E8}' .
+'\x{96E9}\x{96EA}\x{96EB}\x{96EC}\x{96ED}\x{96EE}\x{96EF}\x{96F0}\x{96F1}' .
+'\x{96F2}\x{96F3}\x{96F4}\x{96F5}\x{96F6}\x{96F7}\x{96F8}\x{96F9}\x{96FA}' .
+'\x{96FB}\x{96FD}\x{96FE}\x{96FF}\x{9700}\x{9701}\x{9702}\x{9703}\x{9704}' .
+'\x{9705}\x{9706}\x{9707}\x{9708}\x{9709}\x{970A}\x{970B}\x{970C}\x{970D}' .
+'\x{970E}\x{970F}\x{9710}\x{9711}\x{9712}\x{9713}\x{9715}\x{9716}\x{9718}' .
+'\x{9719}\x{971C}\x{971D}\x{971E}\x{971F}\x{9720}\x{9721}\x{9722}\x{9723}' .
+'\x{9724}\x{9725}\x{9726}\x{9727}\x{9728}\x{9729}\x{972A}\x{972B}\x{972C}' .
+'\x{972D}\x{972E}\x{972F}\x{9730}\x{9731}\x{9732}\x{9735}\x{9736}\x{9738}' .
+'\x{9739}\x{973A}\x{973B}\x{973C}\x{973D}\x{973E}\x{973F}\x{9742}\x{9743}' .
+'\x{9744}\x{9745}\x{9746}\x{9747}\x{9748}\x{9749}\x{974A}\x{974B}\x{974C}' .
+'\x{974E}\x{974F}\x{9750}\x{9751}\x{9752}\x{9753}\x{9754}\x{9755}\x{9756}' .
+'\x{9758}\x{9759}\x{975A}\x{975B}\x{975C}\x{975D}\x{975E}\x{975F}\x{9760}' .
+'\x{9761}\x{9762}\x{9765}\x{9766}\x{9767}\x{9768}\x{9769}\x{976A}\x{976B}' .
+'\x{976C}\x{976D}\x{976E}\x{976F}\x{9770}\x{9772}\x{9773}\x{9774}\x{9776}' .
+'\x{9777}\x{9778}\x{9779}\x{977A}\x{977B}\x{977C}\x{977D}\x{977E}\x{977F}' .
+'\x{9780}\x{9781}\x{9782}\x{9783}\x{9784}\x{9785}\x{9786}\x{9788}\x{978A}' .
+'\x{978B}\x{978C}\x{978D}\x{978E}\x{978F}\x{9790}\x{9791}\x{9792}\x{9793}' .
+'\x{9794}\x{9795}\x{9796}\x{9797}\x{9798}\x{9799}\x{979A}\x{979C}\x{979D}' .
+'\x{979E}\x{979F}\x{97A0}\x{97A1}\x{97A2}\x{97A3}\x{97A4}\x{97A5}\x{97A6}' .
+'\x{97A7}\x{97A8}\x{97AA}\x{97AB}\x{97AC}\x{97AD}\x{97AE}\x{97AF}\x{97B2}' .
+'\x{97B3}\x{97B4}\x{97B6}\x{97B7}\x{97B8}\x{97B9}\x{97BA}\x{97BB}\x{97BC}' .
+'\x{97BD}\x{97BF}\x{97C1}\x{97C2}\x{97C3}\x{97C4}\x{97C5}\x{97C6}\x{97C7}' .
+'\x{97C8}\x{97C9}\x{97CA}\x{97CB}\x{97CC}\x{97CD}\x{97CE}\x{97CF}\x{97D0}' .
+'\x{97D1}\x{97D3}\x{97D4}\x{97D5}\x{97D6}\x{97D7}\x{97D8}\x{97D9}\x{97DA}' .
+'\x{97DB}\x{97DC}\x{97DD}\x{97DE}\x{97DF}\x{97E0}\x{97E1}\x{97E2}\x{97E3}' .
+'\x{97E4}\x{97E5}\x{97E6}\x{97E7}\x{97E8}\x{97E9}\x{97EA}\x{97EB}\x{97EC}' .
+'\x{97ED}\x{97EE}\x{97EF}\x{97F0}\x{97F1}\x{97F2}\x{97F3}\x{97F4}\x{97F5}' .
+'\x{97F6}\x{97F7}\x{97F8}\x{97F9}\x{97FA}\x{97FB}\x{97FD}\x{97FE}\x{97FF}' .
+'\x{9800}\x{9801}\x{9802}\x{9803}\x{9804}\x{9805}\x{9806}\x{9807}\x{9808}' .
+'\x{9809}\x{980A}\x{980B}\x{980C}\x{980D}\x{980E}\x{980F}\x{9810}\x{9811}' .
+'\x{9812}\x{9813}\x{9814}\x{9815}\x{9816}\x{9817}\x{9818}\x{9819}\x{981A}' .
+'\x{981B}\x{981C}\x{981D}\x{981E}\x{9820}\x{9821}\x{9822}\x{9823}\x{9824}' .
+'\x{9826}\x{9827}\x{9828}\x{9829}\x{982B}\x{982D}\x{982E}\x{982F}\x{9830}' .
+'\x{9831}\x{9832}\x{9834}\x{9835}\x{9836}\x{9837}\x{9838}\x{9839}\x{983B}' .
+'\x{983C}\x{983D}\x{983F}\x{9840}\x{9841}\x{9843}\x{9844}\x{9845}\x{9846}' .
+'\x{9848}\x{9849}\x{984A}\x{984C}\x{984D}\x{984E}\x{984F}\x{9850}\x{9851}' .
+'\x{9852}\x{9853}\x{9854}\x{9855}\x{9857}\x{9858}\x{9859}\x{985A}\x{985B}' .
+'\x{985C}\x{985D}\x{985E}\x{985F}\x{9860}\x{9861}\x{9862}\x{9863}\x{9864}' .
+'\x{9865}\x{9867}\x{9869}\x{986A}\x{986B}\x{986C}\x{986D}\x{986E}\x{986F}' .
+'\x{9870}\x{9871}\x{9872}\x{9873}\x{9874}\x{9875}\x{9876}\x{9877}\x{9878}' .
+'\x{9879}\x{987A}\x{987B}\x{987C}\x{987D}\x{987E}\x{987F}\x{9880}\x{9881}' .
+'\x{9882}\x{9883}\x{9884}\x{9885}\x{9886}\x{9887}\x{9888}\x{9889}\x{988A}' .
+'\x{988B}\x{988C}\x{988D}\x{988E}\x{988F}\x{9890}\x{9891}\x{9892}\x{9893}' .
+'\x{9894}\x{9895}\x{9896}\x{9897}\x{9898}\x{9899}\x{989A}\x{989B}\x{989C}' .
+'\x{989D}\x{989E}\x{989F}\x{98A0}\x{98A1}\x{98A2}\x{98A3}\x{98A4}\x{98A5}' .
+'\x{98A6}\x{98A7}\x{98A8}\x{98A9}\x{98AA}\x{98AB}\x{98AC}\x{98AD}\x{98AE}' .
+'\x{98AF}\x{98B0}\x{98B1}\x{98B2}\x{98B3}\x{98B4}\x{98B5}\x{98B6}\x{98B8}' .
+'\x{98B9}\x{98BA}\x{98BB}\x{98BC}\x{98BD}\x{98BE}\x{98BF}\x{98C0}\x{98C1}' .
+'\x{98C2}\x{98C3}\x{98C4}\x{98C5}\x{98C6}\x{98C8}\x{98C9}\x{98CB}\x{98CC}' .
+'\x{98CD}\x{98CE}\x{98CF}\x{98D0}\x{98D1}\x{98D2}\x{98D3}\x{98D4}\x{98D5}' .
+'\x{98D6}\x{98D7}\x{98D8}\x{98D9}\x{98DA}\x{98DB}\x{98DC}\x{98DD}\x{98DE}' .
+'\x{98DF}\x{98E0}\x{98E2}\x{98E3}\x{98E5}\x{98E6}\x{98E7}\x{98E8}\x{98E9}' .
+'\x{98EA}\x{98EB}\x{98ED}\x{98EF}\x{98F0}\x{98F2}\x{98F3}\x{98F4}\x{98F5}' .
+'\x{98F6}\x{98F7}\x{98F9}\x{98FA}\x{98FC}\x{98FD}\x{98FE}\x{98FF}\x{9900}' .
+'\x{9901}\x{9902}\x{9903}\x{9904}\x{9905}\x{9906}\x{9907}\x{9908}\x{9909}' .
+'\x{990A}\x{990B}\x{990C}\x{990D}\x{990E}\x{990F}\x{9910}\x{9911}\x{9912}' .
+'\x{9913}\x{9914}\x{9915}\x{9916}\x{9917}\x{9918}\x{991A}\x{991B}\x{991C}' .
+'\x{991D}\x{991E}\x{991F}\x{9920}\x{9921}\x{9922}\x{9923}\x{9924}\x{9925}' .
+'\x{9926}\x{9927}\x{9928}\x{9929}\x{992A}\x{992B}\x{992C}\x{992D}\x{992E}' .
+'\x{992F}\x{9930}\x{9931}\x{9932}\x{9933}\x{9934}\x{9935}\x{9936}\x{9937}' .
+'\x{9938}\x{9939}\x{993A}\x{993C}\x{993D}\x{993E}\x{993F}\x{9940}\x{9941}' .
+'\x{9942}\x{9943}\x{9945}\x{9946}\x{9947}\x{9948}\x{9949}\x{994A}\x{994B}' .
+'\x{994C}\x{994E}\x{994F}\x{9950}\x{9951}\x{9952}\x{9953}\x{9954}\x{9955}' .
+'\x{9956}\x{9957}\x{9958}\x{9959}\x{995B}\x{995C}\x{995E}\x{995F}\x{9960}' .
+'\x{9961}\x{9962}\x{9963}\x{9964}\x{9965}\x{9966}\x{9967}\x{9968}\x{9969}' .
+'\x{996A}\x{996B}\x{996C}\x{996D}\x{996E}\x{996F}\x{9970}\x{9971}\x{9972}' .
+'\x{9973}\x{9974}\x{9975}\x{9976}\x{9977}\x{9978}\x{9979}\x{997A}\x{997B}' .
+'\x{997C}\x{997D}\x{997E}\x{997F}\x{9980}\x{9981}\x{9982}\x{9983}\x{9984}' .
+'\x{9985}\x{9986}\x{9987}\x{9988}\x{9989}\x{998A}\x{998B}\x{998C}\x{998D}' .
+'\x{998E}\x{998F}\x{9990}\x{9991}\x{9992}\x{9993}\x{9994}\x{9995}\x{9996}' .
+'\x{9997}\x{9998}\x{9999}\x{999A}\x{999B}\x{999C}\x{999D}\x{999E}\x{999F}' .
+'\x{99A0}\x{99A1}\x{99A2}\x{99A3}\x{99A4}\x{99A5}\x{99A6}\x{99A7}\x{99A8}' .
+'\x{99A9}\x{99AA}\x{99AB}\x{99AC}\x{99AD}\x{99AE}\x{99AF}\x{99B0}\x{99B1}' .
+'\x{99B2}\x{99B3}\x{99B4}\x{99B5}\x{99B6}\x{99B7}\x{99B8}\x{99B9}\x{99BA}' .
+'\x{99BB}\x{99BC}\x{99BD}\x{99BE}\x{99C0}\x{99C1}\x{99C2}\x{99C3}\x{99C4}' .
+'\x{99C6}\x{99C7}\x{99C8}\x{99C9}\x{99CA}\x{99CB}\x{99CC}\x{99CD}\x{99CE}' .
+'\x{99CF}\x{99D0}\x{99D1}\x{99D2}\x{99D3}\x{99D4}\x{99D5}\x{99D6}\x{99D7}' .
+'\x{99D8}\x{99D9}\x{99DA}\x{99DB}\x{99DC}\x{99DD}\x{99DE}\x{99DF}\x{99E1}' .
+'\x{99E2}\x{99E3}\x{99E4}\x{99E5}\x{99E7}\x{99E8}\x{99E9}\x{99EA}\x{99EC}' .
+'\x{99ED}\x{99EE}\x{99EF}\x{99F0}\x{99F1}\x{99F2}\x{99F3}\x{99F4}\x{99F6}' .
+'\x{99F7}\x{99F8}\x{99F9}\x{99FA}\x{99FB}\x{99FC}\x{99FD}\x{99FE}\x{99FF}' .
+'\x{9A00}\x{9A01}\x{9A02}\x{9A03}\x{9A04}\x{9A05}\x{9A06}\x{9A07}\x{9A08}' .
+'\x{9A09}\x{9A0A}\x{9A0B}\x{9A0C}\x{9A0D}\x{9A0E}\x{9A0F}\x{9A11}\x{9A14}' .
+'\x{9A15}\x{9A16}\x{9A19}\x{9A1A}\x{9A1B}\x{9A1C}\x{9A1D}\x{9A1E}\x{9A1F}' .
+'\x{9A20}\x{9A21}\x{9A22}\x{9A23}\x{9A24}\x{9A25}\x{9A26}\x{9A27}\x{9A29}' .
+'\x{9A2A}\x{9A2B}\x{9A2C}\x{9A2D}\x{9A2E}\x{9A2F}\x{9A30}\x{9A31}\x{9A32}' .
+'\x{9A33}\x{9A34}\x{9A35}\x{9A36}\x{9A37}\x{9A38}\x{9A39}\x{9A3A}\x{9A3C}' .
+'\x{9A3D}\x{9A3E}\x{9A3F}\x{9A40}\x{9A41}\x{9A42}\x{9A43}\x{9A44}\x{9A45}' .
+'\x{9A46}\x{9A47}\x{9A48}\x{9A49}\x{9A4A}\x{9A4B}\x{9A4C}\x{9A4D}\x{9A4E}' .
+'\x{9A4F}\x{9A50}\x{9A52}\x{9A53}\x{9A54}\x{9A55}\x{9A56}\x{9A57}\x{9A59}' .
+'\x{9A5A}\x{9A5B}\x{9A5C}\x{9A5E}\x{9A5F}\x{9A60}\x{9A61}\x{9A62}\x{9A64}' .
+'\x{9A65}\x{9A66}\x{9A67}\x{9A68}\x{9A69}\x{9A6A}\x{9A6B}\x{9A6C}\x{9A6D}' .
+'\x{9A6E}\x{9A6F}\x{9A70}\x{9A71}\x{9A72}\x{9A73}\x{9A74}\x{9A75}\x{9A76}' .
+'\x{9A77}\x{9A78}\x{9A79}\x{9A7A}\x{9A7B}\x{9A7C}\x{9A7D}\x{9A7E}\x{9A7F}' .
+'\x{9A80}\x{9A81}\x{9A82}\x{9A83}\x{9A84}\x{9A85}\x{9A86}\x{9A87}\x{9A88}' .
+'\x{9A89}\x{9A8A}\x{9A8B}\x{9A8C}\x{9A8D}\x{9A8E}\x{9A8F}\x{9A90}\x{9A91}' .
+'\x{9A92}\x{9A93}\x{9A94}\x{9A95}\x{9A96}\x{9A97}\x{9A98}\x{9A99}\x{9A9A}' .
+'\x{9A9B}\x{9A9C}\x{9A9D}\x{9A9E}\x{9A9F}\x{9AA0}\x{9AA1}\x{9AA2}\x{9AA3}' .
+'\x{9AA4}\x{9AA5}\x{9AA6}\x{9AA7}\x{9AA8}\x{9AAA}\x{9AAB}\x{9AAC}\x{9AAD}' .
+'\x{9AAE}\x{9AAF}\x{9AB0}\x{9AB1}\x{9AB2}\x{9AB3}\x{9AB4}\x{9AB5}\x{9AB6}' .
+'\x{9AB7}\x{9AB8}\x{9AB9}\x{9ABA}\x{9ABB}\x{9ABC}\x{9ABE}\x{9ABF}\x{9AC0}' .
+'\x{9AC1}\x{9AC2}\x{9AC3}\x{9AC4}\x{9AC5}\x{9AC6}\x{9AC7}\x{9AC9}\x{9ACA}' .
+'\x{9ACB}\x{9ACC}\x{9ACD}\x{9ACE}\x{9ACF}\x{9AD0}\x{9AD1}\x{9AD2}\x{9AD3}' .
+'\x{9AD4}\x{9AD5}\x{9AD6}\x{9AD8}\x{9AD9}\x{9ADA}\x{9ADB}\x{9ADC}\x{9ADD}' .
+'\x{9ADE}\x{9ADF}\x{9AE1}\x{9AE2}\x{9AE3}\x{9AE5}\x{9AE6}\x{9AE7}\x{9AEA}' .
+'\x{9AEB}\x{9AEC}\x{9AED}\x{9AEE}\x{9AEF}\x{9AF1}\x{9AF2}\x{9AF3}\x{9AF4}' .
+'\x{9AF5}\x{9AF6}\x{9AF7}\x{9AF8}\x{9AF9}\x{9AFA}\x{9AFB}\x{9AFC}\x{9AFD}' .
+'\x{9AFE}\x{9AFF}\x{9B01}\x{9B03}\x{9B04}\x{9B05}\x{9B06}\x{9B07}\x{9B08}' .
+'\x{9B0A}\x{9B0B}\x{9B0C}\x{9B0D}\x{9B0E}\x{9B0F}\x{9B10}\x{9B11}\x{9B12}' .
+'\x{9B13}\x{9B15}\x{9B16}\x{9B17}\x{9B18}\x{9B19}\x{9B1A}\x{9B1C}\x{9B1D}' .
+'\x{9B1E}\x{9B1F}\x{9B20}\x{9B21}\x{9B22}\x{9B23}\x{9B24}\x{9B25}\x{9B26}' .
+'\x{9B27}\x{9B28}\x{9B29}\x{9B2A}\x{9B2B}\x{9B2C}\x{9B2D}\x{9B2E}\x{9B2F}' .
+'\x{9B30}\x{9B31}\x{9B32}\x{9B33}\x{9B35}\x{9B36}\x{9B37}\x{9B38}\x{9B39}' .
+'\x{9B3A}\x{9B3B}\x{9B3C}\x{9B3E}\x{9B3F}\x{9B41}\x{9B42}\x{9B43}\x{9B44}' .
+'\x{9B45}\x{9B46}\x{9B47}\x{9B48}\x{9B49}\x{9B4A}\x{9B4B}\x{9B4C}\x{9B4D}' .
+'\x{9B4E}\x{9B4F}\x{9B51}\x{9B52}\x{9B53}\x{9B54}\x{9B55}\x{9B56}\x{9B58}' .
+'\x{9B59}\x{9B5A}\x{9B5B}\x{9B5C}\x{9B5D}\x{9B5E}\x{9B5F}\x{9B60}\x{9B61}' .
+'\x{9B63}\x{9B64}\x{9B65}\x{9B66}\x{9B67}\x{9B68}\x{9B69}\x{9B6A}\x{9B6B}' .
+'\x{9B6C}\x{9B6D}\x{9B6E}\x{9B6F}\x{9B70}\x{9B71}\x{9B73}\x{9B74}\x{9B75}' .
+'\x{9B76}\x{9B77}\x{9B78}\x{9B79}\x{9B7A}\x{9B7B}\x{9B7C}\x{9B7D}\x{9B7E}' .
+'\x{9B7F}\x{9B80}\x{9B81}\x{9B82}\x{9B83}\x{9B84}\x{9B85}\x{9B86}\x{9B87}' .
+'\x{9B88}\x{9B8A}\x{9B8B}\x{9B8D}\x{9B8E}\x{9B8F}\x{9B90}\x{9B91}\x{9B92}' .
+'\x{9B93}\x{9B94}\x{9B95}\x{9B96}\x{9B97}\x{9B98}\x{9B9A}\x{9B9B}\x{9B9C}' .
+'\x{9B9D}\x{9B9E}\x{9B9F}\x{9BA0}\x{9BA1}\x{9BA2}\x{9BA3}\x{9BA4}\x{9BA5}' .
+'\x{9BA6}\x{9BA7}\x{9BA8}\x{9BA9}\x{9BAA}\x{9BAB}\x{9BAC}\x{9BAD}\x{9BAE}' .
+'\x{9BAF}\x{9BB0}\x{9BB1}\x{9BB2}\x{9BB3}\x{9BB4}\x{9BB5}\x{9BB6}\x{9BB7}' .
+'\x{9BB8}\x{9BB9}\x{9BBA}\x{9BBB}\x{9BBC}\x{9BBD}\x{9BBE}\x{9BBF}\x{9BC0}' .
+'\x{9BC1}\x{9BC3}\x{9BC4}\x{9BC5}\x{9BC6}\x{9BC7}\x{9BC8}\x{9BC9}\x{9BCA}' .
+'\x{9BCB}\x{9BCC}\x{9BCD}\x{9BCE}\x{9BCF}\x{9BD0}\x{9BD1}\x{9BD2}\x{9BD3}' .
+'\x{9BD4}\x{9BD5}\x{9BD6}\x{9BD7}\x{9BD8}\x{9BD9}\x{9BDA}\x{9BDB}\x{9BDC}' .
+'\x{9BDD}\x{9BDE}\x{9BDF}\x{9BE0}\x{9BE1}\x{9BE2}\x{9BE3}\x{9BE4}\x{9BE5}' .
+'\x{9BE6}\x{9BE7}\x{9BE8}\x{9BE9}\x{9BEA}\x{9BEB}\x{9BEC}\x{9BED}\x{9BEE}' .
+'\x{9BEF}\x{9BF0}\x{9BF1}\x{9BF2}\x{9BF3}\x{9BF4}\x{9BF5}\x{9BF7}\x{9BF8}' .
+'\x{9BF9}\x{9BFA}\x{9BFB}\x{9BFC}\x{9BFD}\x{9BFE}\x{9BFF}\x{9C02}\x{9C05}' .
+'\x{9C06}\x{9C07}\x{9C08}\x{9C09}\x{9C0A}\x{9C0B}\x{9C0C}\x{9C0D}\x{9C0E}' .
+'\x{9C0F}\x{9C10}\x{9C11}\x{9C12}\x{9C13}\x{9C14}\x{9C15}\x{9C16}\x{9C17}' .
+'\x{9C18}\x{9C19}\x{9C1A}\x{9C1B}\x{9C1C}\x{9C1D}\x{9C1E}\x{9C1F}\x{9C20}' .
+'\x{9C21}\x{9C22}\x{9C23}\x{9C24}\x{9C25}\x{9C26}\x{9C27}\x{9C28}\x{9C29}' .
+'\x{9C2A}\x{9C2B}\x{9C2C}\x{9C2D}\x{9C2F}\x{9C30}\x{9C31}\x{9C32}\x{9C33}' .
+'\x{9C34}\x{9C35}\x{9C36}\x{9C37}\x{9C38}\x{9C39}\x{9C3A}\x{9C3B}\x{9C3C}' .
+'\x{9C3D}\x{9C3E}\x{9C3F}\x{9C40}\x{9C41}\x{9C43}\x{9C44}\x{9C45}\x{9C46}' .
+'\x{9C47}\x{9C48}\x{9C49}\x{9C4A}\x{9C4B}\x{9C4C}\x{9C4D}\x{9C4E}\x{9C50}' .
+'\x{9C52}\x{9C53}\x{9C54}\x{9C55}\x{9C56}\x{9C57}\x{9C58}\x{9C59}\x{9C5A}' .
+'\x{9C5B}\x{9C5C}\x{9C5D}\x{9C5E}\x{9C5F}\x{9C60}\x{9C62}\x{9C63}\x{9C65}' .
+'\x{9C66}\x{9C67}\x{9C68}\x{9C69}\x{9C6A}\x{9C6B}\x{9C6C}\x{9C6D}\x{9C6E}' .
+'\x{9C6F}\x{9C70}\x{9C71}\x{9C72}\x{9C73}\x{9C74}\x{9C75}\x{9C77}\x{9C78}' .
+'\x{9C79}\x{9C7A}\x{9C7C}\x{9C7D}\x{9C7E}\x{9C7F}\x{9C80}\x{9C81}\x{9C82}' .
+'\x{9C83}\x{9C84}\x{9C85}\x{9C86}\x{9C87}\x{9C88}\x{9C89}\x{9C8A}\x{9C8B}' .
+'\x{9C8C}\x{9C8D}\x{9C8E}\x{9C8F}\x{9C90}\x{9C91}\x{9C92}\x{9C93}\x{9C94}' .
+'\x{9C95}\x{9C96}\x{9C97}\x{9C98}\x{9C99}\x{9C9A}\x{9C9B}\x{9C9C}\x{9C9D}' .
+'\x{9C9E}\x{9C9F}\x{9CA0}\x{9CA1}\x{9CA2}\x{9CA3}\x{9CA4}\x{9CA5}\x{9CA6}' .
+'\x{9CA7}\x{9CA8}\x{9CA9}\x{9CAA}\x{9CAB}\x{9CAC}\x{9CAD}\x{9CAE}\x{9CAF}' .
+'\x{9CB0}\x{9CB1}\x{9CB2}\x{9CB3}\x{9CB4}\x{9CB5}\x{9CB6}\x{9CB7}\x{9CB8}' .
+'\x{9CB9}\x{9CBA}\x{9CBB}\x{9CBC}\x{9CBD}\x{9CBE}\x{9CBF}\x{9CC0}\x{9CC1}' .
+'\x{9CC2}\x{9CC3}\x{9CC4}\x{9CC5}\x{9CC6}\x{9CC7}\x{9CC8}\x{9CC9}\x{9CCA}' .
+'\x{9CCB}\x{9CCC}\x{9CCD}\x{9CCE}\x{9CCF}\x{9CD0}\x{9CD1}\x{9CD2}\x{9CD3}' .
+'\x{9CD4}\x{9CD5}\x{9CD6}\x{9CD7}\x{9CD8}\x{9CD9}\x{9CDA}\x{9CDB}\x{9CDC}' .
+'\x{9CDD}\x{9CDE}\x{9CDF}\x{9CE0}\x{9CE1}\x{9CE2}\x{9CE3}\x{9CE4}\x{9CE5}' .
+'\x{9CE6}\x{9CE7}\x{9CE8}\x{9CE9}\x{9CEA}\x{9CEB}\x{9CEC}\x{9CED}\x{9CEE}' .
+'\x{9CEF}\x{9CF0}\x{9CF1}\x{9CF2}\x{9CF3}\x{9CF4}\x{9CF5}\x{9CF6}\x{9CF7}' .
+'\x{9CF8}\x{9CF9}\x{9CFA}\x{9CFB}\x{9CFC}\x{9CFD}\x{9CFE}\x{9CFF}\x{9D00}' .
+'\x{9D01}\x{9D02}\x{9D03}\x{9D04}\x{9D05}\x{9D06}\x{9D07}\x{9D08}\x{9D09}' .
+'\x{9D0A}\x{9D0B}\x{9D0F}\x{9D10}\x{9D12}\x{9D13}\x{9D14}\x{9D15}\x{9D16}' .
+'\x{9D17}\x{9D18}\x{9D19}\x{9D1A}\x{9D1B}\x{9D1C}\x{9D1D}\x{9D1E}\x{9D1F}' .
+'\x{9D20}\x{9D21}\x{9D22}\x{9D23}\x{9D24}\x{9D25}\x{9D26}\x{9D28}\x{9D29}' .
+'\x{9D2B}\x{9D2D}\x{9D2E}\x{9D2F}\x{9D30}\x{9D31}\x{9D32}\x{9D33}\x{9D34}' .
+'\x{9D36}\x{9D37}\x{9D38}\x{9D39}\x{9D3A}\x{9D3B}\x{9D3D}\x{9D3E}\x{9D3F}' .
+'\x{9D40}\x{9D41}\x{9D42}\x{9D43}\x{9D45}\x{9D46}\x{9D47}\x{9D48}\x{9D49}' .
+'\x{9D4A}\x{9D4B}\x{9D4C}\x{9D4D}\x{9D4E}\x{9D4F}\x{9D50}\x{9D51}\x{9D52}' .
+'\x{9D53}\x{9D54}\x{9D55}\x{9D56}\x{9D57}\x{9D58}\x{9D59}\x{9D5A}\x{9D5B}' .
+'\x{9D5C}\x{9D5D}\x{9D5E}\x{9D5F}\x{9D60}\x{9D61}\x{9D62}\x{9D63}\x{9D64}' .
+'\x{9D65}\x{9D66}\x{9D67}\x{9D68}\x{9D69}\x{9D6A}\x{9D6B}\x{9D6C}\x{9D6E}' .
+'\x{9D6F}\x{9D70}\x{9D71}\x{9D72}\x{9D73}\x{9D74}\x{9D75}\x{9D76}\x{9D77}' .
+'\x{9D78}\x{9D79}\x{9D7A}\x{9D7B}\x{9D7C}\x{9D7D}\x{9D7E}\x{9D7F}\x{9D80}' .
+'\x{9D81}\x{9D82}\x{9D83}\x{9D84}\x{9D85}\x{9D86}\x{9D87}\x{9D88}\x{9D89}' .
+'\x{9D8A}\x{9D8B}\x{9D8C}\x{9D8D}\x{9D8E}\x{9D90}\x{9D91}\x{9D92}\x{9D93}' .
+'\x{9D94}\x{9D96}\x{9D97}\x{9D98}\x{9D99}\x{9D9A}\x{9D9B}\x{9D9C}\x{9D9D}' .
+'\x{9D9E}\x{9D9F}\x{9DA0}\x{9DA1}\x{9DA2}\x{9DA3}\x{9DA4}\x{9DA5}\x{9DA6}' .
+'\x{9DA7}\x{9DA8}\x{9DA9}\x{9DAA}\x{9DAB}\x{9DAC}\x{9DAD}\x{9DAF}\x{9DB0}' .
+'\x{9DB1}\x{9DB2}\x{9DB3}\x{9DB4}\x{9DB5}\x{9DB6}\x{9DB7}\x{9DB8}\x{9DB9}' .
+'\x{9DBA}\x{9DBB}\x{9DBC}\x{9DBE}\x{9DBF}\x{9DC1}\x{9DC2}\x{9DC3}\x{9DC4}' .
+'\x{9DC5}\x{9DC7}\x{9DC8}\x{9DC9}\x{9DCA}\x{9DCB}\x{9DCC}\x{9DCD}\x{9DCE}' .
+'\x{9DCF}\x{9DD0}\x{9DD1}\x{9DD2}\x{9DD3}\x{9DD4}\x{9DD5}\x{9DD6}\x{9DD7}' .
+'\x{9DD8}\x{9DD9}\x{9DDA}\x{9DDB}\x{9DDC}\x{9DDD}\x{9DDE}\x{9DDF}\x{9DE0}' .
+'\x{9DE1}\x{9DE2}\x{9DE3}\x{9DE4}\x{9DE5}\x{9DE6}\x{9DE7}\x{9DE8}\x{9DE9}' .
+'\x{9DEB}\x{9DEC}\x{9DED}\x{9DEE}\x{9DEF}\x{9DF0}\x{9DF1}\x{9DF2}\x{9DF3}' .
+'\x{9DF4}\x{9DF5}\x{9DF6}\x{9DF7}\x{9DF8}\x{9DF9}\x{9DFA}\x{9DFB}\x{9DFD}' .
+'\x{9DFE}\x{9DFF}\x{9E00}\x{9E01}\x{9E02}\x{9E03}\x{9E04}\x{9E05}\x{9E06}' .
+'\x{9E07}\x{9E08}\x{9E09}\x{9E0A}\x{9E0B}\x{9E0C}\x{9E0D}\x{9E0F}\x{9E10}' .
+'\x{9E11}\x{9E12}\x{9E13}\x{9E14}\x{9E15}\x{9E17}\x{9E18}\x{9E19}\x{9E1A}' .
+'\x{9E1B}\x{9E1D}\x{9E1E}\x{9E1F}\x{9E20}\x{9E21}\x{9E22}\x{9E23}\x{9E24}' .
+'\x{9E25}\x{9E26}\x{9E27}\x{9E28}\x{9E29}\x{9E2A}\x{9E2B}\x{9E2C}\x{9E2D}' .
+'\x{9E2E}\x{9E2F}\x{9E30}\x{9E31}\x{9E32}\x{9E33}\x{9E34}\x{9E35}\x{9E36}' .
+'\x{9E37}\x{9E38}\x{9E39}\x{9E3A}\x{9E3B}\x{9E3C}\x{9E3D}\x{9E3E}\x{9E3F}' .
+'\x{9E40}\x{9E41}\x{9E42}\x{9E43}\x{9E44}\x{9E45}\x{9E46}\x{9E47}\x{9E48}' .
+'\x{9E49}\x{9E4A}\x{9E4B}\x{9E4C}\x{9E4D}\x{9E4E}\x{9E4F}\x{9E50}\x{9E51}' .
+'\x{9E52}\x{9E53}\x{9E54}\x{9E55}\x{9E56}\x{9E57}\x{9E58}\x{9E59}\x{9E5A}' .
+'\x{9E5B}\x{9E5C}\x{9E5D}\x{9E5E}\x{9E5F}\x{9E60}\x{9E61}\x{9E62}\x{9E63}' .
+'\x{9E64}\x{9E65}\x{9E66}\x{9E67}\x{9E68}\x{9E69}\x{9E6A}\x{9E6B}\x{9E6C}' .
+'\x{9E6D}\x{9E6E}\x{9E6F}\x{9E70}\x{9E71}\x{9E72}\x{9E73}\x{9E74}\x{9E75}' .
+'\x{9E76}\x{9E77}\x{9E79}\x{9E7A}\x{9E7C}\x{9E7D}\x{9E7E}\x{9E7F}\x{9E80}' .
+'\x{9E81}\x{9E82}\x{9E83}\x{9E84}\x{9E85}\x{9E86}\x{9E87}\x{9E88}\x{9E89}' .
+'\x{9E8A}\x{9E8B}\x{9E8C}\x{9E8D}\x{9E8E}\x{9E91}\x{9E92}\x{9E93}\x{9E94}' .
+'\x{9E96}\x{9E97}\x{9E99}\x{9E9A}\x{9E9B}\x{9E9C}\x{9E9D}\x{9E9F}\x{9EA0}' .
+'\x{9EA1}\x{9EA3}\x{9EA4}\x{9EA5}\x{9EA6}\x{9EA7}\x{9EA8}\x{9EA9}\x{9EAA}' .
+'\x{9EAD}\x{9EAE}\x{9EAF}\x{9EB0}\x{9EB2}\x{9EB3}\x{9EB4}\x{9EB5}\x{9EB6}' .
+'\x{9EB7}\x{9EB8}\x{9EBB}\x{9EBC}\x{9EBD}\x{9EBE}\x{9EBF}\x{9EC0}\x{9EC1}' .
+'\x{9EC2}\x{9EC3}\x{9EC4}\x{9EC5}\x{9EC6}\x{9EC7}\x{9EC8}\x{9EC9}\x{9ECA}' .
+'\x{9ECB}\x{9ECC}\x{9ECD}\x{9ECE}\x{9ECF}\x{9ED0}\x{9ED1}\x{9ED2}\x{9ED3}' .
+'\x{9ED4}\x{9ED5}\x{9ED6}\x{9ED7}\x{9ED8}\x{9ED9}\x{9EDA}\x{9EDB}\x{9EDC}' .
+'\x{9EDD}\x{9EDE}\x{9EDF}\x{9EE0}\x{9EE1}\x{9EE2}\x{9EE3}\x{9EE4}\x{9EE5}' .
+'\x{9EE6}\x{9EE7}\x{9EE8}\x{9EE9}\x{9EEA}\x{9EEB}\x{9EED}\x{9EEE}\x{9EEF}' .
+'\x{9EF0}\x{9EF2}\x{9EF3}\x{9EF4}\x{9EF5}\x{9EF6}\x{9EF7}\x{9EF8}\x{9EF9}' .
+'\x{9EFA}\x{9EFB}\x{9EFC}\x{9EFD}\x{9EFE}\x{9EFF}\x{9F00}\x{9F01}\x{9F02}' .
+'\x{9F04}\x{9F05}\x{9F06}\x{9F07}\x{9F08}\x{9F09}\x{9F0A}\x{9F0B}\x{9F0C}' .
+'\x{9F0D}\x{9F0E}\x{9F0F}\x{9F10}\x{9F12}\x{9F13}\x{9F15}\x{9F16}\x{9F17}' .
+'\x{9F18}\x{9F19}\x{9F1A}\x{9F1B}\x{9F1C}\x{9F1D}\x{9F1E}\x{9F1F}\x{9F20}' .
+'\x{9F22}\x{9F23}\x{9F24}\x{9F25}\x{9F27}\x{9F28}\x{9F29}\x{9F2A}\x{9F2B}' .
+'\x{9F2C}\x{9F2D}\x{9F2E}\x{9F2F}\x{9F30}\x{9F31}\x{9F32}\x{9F33}\x{9F34}' .
+'\x{9F35}\x{9F36}\x{9F37}\x{9F38}\x{9F39}\x{9F3A}\x{9F3B}\x{9F3C}\x{9F3D}' .
+'\x{9F3E}\x{9F3F}\x{9F40}\x{9F41}\x{9F42}\x{9F43}\x{9F44}\x{9F46}\x{9F47}' .
+'\x{9F48}\x{9F49}\x{9F4A}\x{9F4B}\x{9F4C}\x{9F4D}\x{9F4E}\x{9F4F}\x{9F50}' .
+'\x{9F51}\x{9F52}\x{9F54}\x{9F55}\x{9F56}\x{9F57}\x{9F58}\x{9F59}\x{9F5A}' .
+'\x{9F5B}\x{9F5C}\x{9F5D}\x{9F5E}\x{9F5F}\x{9F60}\x{9F61}\x{9F63}\x{9F64}' .
+'\x{9F65}\x{9F66}\x{9F67}\x{9F68}\x{9F69}\x{9F6A}\x{9F6B}\x{9F6C}\x{9F6E}' .
+'\x{9F6F}\x{9F70}\x{9F71}\x{9F72}\x{9F73}\x{9F74}\x{9F75}\x{9F76}\x{9F77}' .
+'\x{9F78}\x{9F79}\x{9F7A}\x{9F7B}\x{9F7C}\x{9F7D}\x{9F7E}\x{9F7F}\x{9F80}' .
+'\x{9F81}\x{9F82}\x{9F83}\x{9F84}\x{9F85}\x{9F86}\x{9F87}\x{9F88}\x{9F89}' .
+'\x{9F8A}\x{9F8B}\x{9F8C}\x{9F8D}\x{9F8E}\x{9F8F}\x{9F90}\x{9F91}\x{9F92}' .
+'\x{9F93}\x{9F94}\x{9F95}\x{9F96}\x{9F97}\x{9F98}\x{9F99}\x{9F9A}\x{9F9B}' .
+'\x{9F9C}\x{9F9D}\x{9F9E}\x{9F9F}\x{9FA0}\x{9FA2}\x{9FA4}\x{9FA5}]{1,20}$/iu');
diff --git a/library/vendor/Zend/Validate/Hostname/Cn.php b/library/vendor/Zend/Validate/Hostname/Cn.php
new file mode 100644
index 0000000..816e499
--- /dev/null
+++ b/library/vendor/Zend/Validate/Hostname/Cn.php
@@ -0,0 +1,2199 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Ressource file for chinese idn validation
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+return array(
+ 1 => '/^[\x{002d}0-9a-z\x{3447}\x{3473}\x{359E}\x{360E}\x{361A}\x{3918}\x{396E}\x{39CF}\x{39D0}' .
+'\x{39DF}\x{3A73}\x{3B4E}\x{3C6E}\x{3CE0}\x{4056}\x{415F}\x{4337}\x{43AC}' .
+'\x{43B1}\x{43DD}\x{44D6}\x{464C}\x{4661}\x{4723}\x{4729}\x{477C}\x{478D}' .
+'\x{4947}\x{497A}\x{497D}\x{4982}\x{4983}\x{4985}\x{4986}\x{499B}\x{499F}' .
+'\x{49B6}\x{49B7}\x{4C77}\x{4C9F}\x{4CA0}\x{4CA1}\x{4CA2}\x{4CA3}\x{4D13}' .
+'\x{4D14}\x{4D15}\x{4D16}\x{4D17}\x{4D18}\x{4D19}\x{4DAE}\x{4E00}\x{4E01}' .
+'\x{4E02}\x{4E03}\x{4E04}\x{4E05}\x{4E06}\x{4E07}\x{4E08}\x{4E09}\x{4E0A}' .
+'\x{4E0B}\x{4E0C}\x{4E0D}\x{4E0E}\x{4E0F}\x{4E10}\x{4E11}\x{4E13}\x{4E14}' .
+'\x{4E15}\x{4E16}\x{4E17}\x{4E18}\x{4E19}\x{4E1A}\x{4E1B}\x{4E1C}\x{4E1D}' .
+'\x{4E1E}\x{4E1F}\x{4E20}\x{4E21}\x{4E22}\x{4E23}\x{4E24}\x{4E25}\x{4E26}' .
+'\x{4E27}\x{4E28}\x{4E2A}\x{4E2B}\x{4E2C}\x{4E2D}\x{4E2E}\x{4E2F}\x{4E30}' .
+'\x{4E31}\x{4E32}\x{4E33}\x{4E34}\x{4E35}\x{4E36}\x{4E37}\x{4E38}\x{4E39}' .
+'\x{4E3A}\x{4E3B}\x{4E3C}\x{4E3D}\x{4E3E}\x{4E3F}\x{4E40}\x{4E41}\x{4E42}' .
+'\x{4E43}\x{4E44}\x{4E45}\x{4E46}\x{4E47}\x{4E48}\x{4E49}\x{4E4A}\x{4E4B}' .
+'\x{4E4C}\x{4E4D}\x{4E4E}\x{4E4F}\x{4E50}\x{4E51}\x{4E52}\x{4E53}\x{4E54}' .
+'\x{4E56}\x{4E57}\x{4E58}\x{4E59}\x{4E5A}\x{4E5B}\x{4E5C}\x{4E5D}\x{4E5E}' .
+'\x{4E5F}\x{4E60}\x{4E61}\x{4E62}\x{4E63}\x{4E64}\x{4E65}\x{4E66}\x{4E67}' .
+'\x{4E69}\x{4E6A}\x{4E6B}\x{4E6C}\x{4E6D}\x{4E6E}\x{4E6F}\x{4E70}\x{4E71}' .
+'\x{4E72}\x{4E73}\x{4E74}\x{4E75}\x{4E76}\x{4E77}\x{4E78}\x{4E7A}\x{4E7B}' .
+'\x{4E7C}\x{4E7D}\x{4E7E}\x{4E7F}\x{4E80}\x{4E81}\x{4E82}\x{4E83}\x{4E84}' .
+'\x{4E85}\x{4E86}\x{4E87}\x{4E88}\x{4E89}\x{4E8B}\x{4E8C}\x{4E8D}\x{4E8E}' .
+'\x{4E8F}\x{4E90}\x{4E91}\x{4E92}\x{4E93}\x{4E94}\x{4E95}\x{4E97}\x{4E98}' .
+'\x{4E99}\x{4E9A}\x{4E9B}\x{4E9C}\x{4E9D}\x{4E9E}\x{4E9F}\x{4EA0}\x{4EA1}' .
+'\x{4EA2}\x{4EA4}\x{4EA5}\x{4EA6}\x{4EA7}\x{4EA8}\x{4EA9}\x{4EAA}\x{4EAB}' .
+'\x{4EAC}\x{4EAD}\x{4EAE}\x{4EAF}\x{4EB0}\x{4EB1}\x{4EB2}\x{4EB3}\x{4EB4}' .
+'\x{4EB5}\x{4EB6}\x{4EB7}\x{4EB8}\x{4EB9}\x{4EBA}\x{4EBB}\x{4EBD}\x{4EBE}' .
+'\x{4EBF}\x{4EC0}\x{4EC1}\x{4EC2}\x{4EC3}\x{4EC4}\x{4EC5}\x{4EC6}\x{4EC7}' .
+'\x{4EC8}\x{4EC9}\x{4ECA}\x{4ECB}\x{4ECD}\x{4ECE}\x{4ECF}\x{4ED0}\x{4ED1}' .
+'\x{4ED2}\x{4ED3}\x{4ED4}\x{4ED5}\x{4ED6}\x{4ED7}\x{4ED8}\x{4ED9}\x{4EDA}' .
+'\x{4EDB}\x{4EDC}\x{4EDD}\x{4EDE}\x{4EDF}\x{4EE0}\x{4EE1}\x{4EE2}\x{4EE3}' .
+'\x{4EE4}\x{4EE5}\x{4EE6}\x{4EE8}\x{4EE9}\x{4EEA}\x{4EEB}\x{4EEC}\x{4EEF}' .
+'\x{4EF0}\x{4EF1}\x{4EF2}\x{4EF3}\x{4EF4}\x{4EF5}\x{4EF6}\x{4EF7}\x{4EFB}' .
+'\x{4EFD}\x{4EFF}\x{4F00}\x{4F01}\x{4F02}\x{4F03}\x{4F04}\x{4F05}\x{4F06}' .
+'\x{4F08}\x{4F09}\x{4F0A}\x{4F0B}\x{4F0C}\x{4F0D}\x{4F0E}\x{4F0F}\x{4F10}' .
+'\x{4F11}\x{4F12}\x{4F13}\x{4F14}\x{4F15}\x{4F17}\x{4F18}\x{4F19}\x{4F1A}' .
+'\x{4F1B}\x{4F1C}\x{4F1D}\x{4F1E}\x{4F1F}\x{4F20}\x{4F21}\x{4F22}\x{4F23}' .
+'\x{4F24}\x{4F25}\x{4F26}\x{4F27}\x{4F29}\x{4F2A}\x{4F2B}\x{4F2C}\x{4F2D}' .
+'\x{4F2E}\x{4F2F}\x{4F30}\x{4F32}\x{4F33}\x{4F34}\x{4F36}\x{4F38}\x{4F39}' .
+'\x{4F3A}\x{4F3B}\x{4F3C}\x{4F3D}\x{4F3E}\x{4F3F}\x{4F41}\x{4F42}\x{4F43}' .
+'\x{4F45}\x{4F46}\x{4F47}\x{4F48}\x{4F49}\x{4F4A}\x{4F4B}\x{4F4C}\x{4F4D}' .
+'\x{4F4E}\x{4F4F}\x{4F50}\x{4F51}\x{4F52}\x{4F53}\x{4F54}\x{4F55}\x{4F56}' .
+'\x{4F57}\x{4F58}\x{4F59}\x{4F5A}\x{4F5B}\x{4F5C}\x{4F5D}\x{4F5E}\x{4F5F}' .
+'\x{4F60}\x{4F61}\x{4F62}\x{4F63}\x{4F64}\x{4F65}\x{4F66}\x{4F67}\x{4F68}' .
+'\x{4F69}\x{4F6A}\x{4F6B}\x{4F6C}\x{4F6D}\x{4F6E}\x{4F6F}\x{4F70}\x{4F72}' .
+'\x{4F73}\x{4F74}\x{4F75}\x{4F76}\x{4F77}\x{4F78}\x{4F79}\x{4F7A}\x{4F7B}' .
+'\x{4F7C}\x{4F7D}\x{4F7E}\x{4F7F}\x{4F80}\x{4F81}\x{4F82}\x{4F83}\x{4F84}' .
+'\x{4F85}\x{4F86}\x{4F87}\x{4F88}\x{4F89}\x{4F8A}\x{4F8B}\x{4F8D}\x{4F8F}' .
+'\x{4F90}\x{4F91}\x{4F92}\x{4F93}\x{4F94}\x{4F95}\x{4F96}\x{4F97}\x{4F98}' .
+'\x{4F99}\x{4F9A}\x{4F9B}\x{4F9C}\x{4F9D}\x{4F9E}\x{4F9F}\x{4FA0}\x{4FA1}' .
+'\x{4FA3}\x{4FA4}\x{4FA5}\x{4FA6}\x{4FA7}\x{4FA8}\x{4FA9}\x{4FAA}\x{4FAB}' .
+'\x{4FAC}\x{4FAE}\x{4FAF}\x{4FB0}\x{4FB1}\x{4FB2}\x{4FB3}\x{4FB4}\x{4FB5}' .
+'\x{4FB6}\x{4FB7}\x{4FB8}\x{4FB9}\x{4FBA}\x{4FBB}\x{4FBC}\x{4FBE}\x{4FBF}' .
+'\x{4FC0}\x{4FC1}\x{4FC2}\x{4FC3}\x{4FC4}\x{4FC5}\x{4FC7}\x{4FC9}\x{4FCA}' .
+'\x{4FCB}\x{4FCD}\x{4FCE}\x{4FCF}\x{4FD0}\x{4FD1}\x{4FD2}\x{4FD3}\x{4FD4}' .
+'\x{4FD5}\x{4FD6}\x{4FD7}\x{4FD8}\x{4FD9}\x{4FDA}\x{4FDB}\x{4FDC}\x{4FDD}' .
+'\x{4FDE}\x{4FDF}\x{4FE0}\x{4FE1}\x{4FE3}\x{4FE4}\x{4FE5}\x{4FE6}\x{4FE7}' .
+'\x{4FE8}\x{4FE9}\x{4FEA}\x{4FEB}\x{4FEC}\x{4FED}\x{4FEE}\x{4FEF}\x{4FF0}' .
+'\x{4FF1}\x{4FF2}\x{4FF3}\x{4FF4}\x{4FF5}\x{4FF6}\x{4FF7}\x{4FF8}\x{4FF9}' .
+'\x{4FFA}\x{4FFB}\x{4FFE}\x{4FFF}\x{5000}\x{5001}\x{5002}\x{5003}\x{5004}' .
+'\x{5005}\x{5006}\x{5007}\x{5008}\x{5009}\x{500A}\x{500B}\x{500C}\x{500D}' .
+'\x{500E}\x{500F}\x{5011}\x{5012}\x{5013}\x{5014}\x{5015}\x{5016}\x{5017}' .
+'\x{5018}\x{5019}\x{501A}\x{501B}\x{501C}\x{501D}\x{501E}\x{501F}\x{5020}' .
+'\x{5021}\x{5022}\x{5023}\x{5024}\x{5025}\x{5026}\x{5027}\x{5028}\x{5029}' .
+'\x{502A}\x{502B}\x{502C}\x{502D}\x{502E}\x{502F}\x{5030}\x{5031}\x{5032}' .
+'\x{5033}\x{5035}\x{5036}\x{5037}\x{5039}\x{503A}\x{503B}\x{503C}\x{503E}' .
+'\x{503F}\x{5040}\x{5041}\x{5043}\x{5044}\x{5045}\x{5046}\x{5047}\x{5048}' .
+'\x{5049}\x{504A}\x{504B}\x{504C}\x{504D}\x{504E}\x{504F}\x{5051}\x{5053}' .
+'\x{5054}\x{5055}\x{5056}\x{5057}\x{5059}\x{505A}\x{505B}\x{505C}\x{505D}' .
+'\x{505E}\x{505F}\x{5060}\x{5061}\x{5062}\x{5063}\x{5064}\x{5065}\x{5066}' .
+'\x{5067}\x{5068}\x{5069}\x{506A}\x{506B}\x{506C}\x{506D}\x{506E}\x{506F}' .
+'\x{5070}\x{5071}\x{5072}\x{5073}\x{5074}\x{5075}\x{5076}\x{5077}\x{5078}' .
+'\x{5079}\x{507A}\x{507B}\x{507D}\x{507E}\x{507F}\x{5080}\x{5082}\x{5083}' .
+'\x{5084}\x{5085}\x{5086}\x{5087}\x{5088}\x{5089}\x{508A}\x{508B}\x{508C}' .
+'\x{508D}\x{508E}\x{508F}\x{5090}\x{5091}\x{5092}\x{5094}\x{5095}\x{5096}' .
+'\x{5098}\x{5099}\x{509A}\x{509B}\x{509C}\x{509D}\x{509E}\x{50A2}\x{50A3}' .
+'\x{50A4}\x{50A5}\x{50A6}\x{50A7}\x{50A8}\x{50A9}\x{50AA}\x{50AB}\x{50AC}' .
+'\x{50AD}\x{50AE}\x{50AF}\x{50B0}\x{50B1}\x{50B2}\x{50B3}\x{50B4}\x{50B5}' .
+'\x{50B6}\x{50B7}\x{50B8}\x{50BA}\x{50BB}\x{50BC}\x{50BD}\x{50BE}\x{50BF}' .
+'\x{50C0}\x{50C1}\x{50C2}\x{50C4}\x{50C5}\x{50C6}\x{50C7}\x{50C8}\x{50C9}' .
+'\x{50CA}\x{50CB}\x{50CC}\x{50CD}\x{50CE}\x{50CF}\x{50D0}\x{50D1}\x{50D2}' .
+'\x{50D3}\x{50D4}\x{50D5}\x{50D6}\x{50D7}\x{50D9}\x{50DA}\x{50DB}\x{50DC}' .
+'\x{50DD}\x{50DE}\x{50E0}\x{50E3}\x{50E4}\x{50E5}\x{50E6}\x{50E7}\x{50E8}' .
+'\x{50E9}\x{50EA}\x{50EC}\x{50ED}\x{50EE}\x{50EF}\x{50F0}\x{50F1}\x{50F2}' .
+'\x{50F3}\x{50F5}\x{50F6}\x{50F8}\x{50F9}\x{50FA}\x{50FB}\x{50FC}\x{50FD}' .
+'\x{50FE}\x{50FF}\x{5100}\x{5101}\x{5102}\x{5103}\x{5104}\x{5105}\x{5106}' .
+'\x{5107}\x{5108}\x{5109}\x{510A}\x{510B}\x{510C}\x{510D}\x{510E}\x{510F}' .
+'\x{5110}\x{5111}\x{5112}\x{5113}\x{5114}\x{5115}\x{5116}\x{5117}\x{5118}' .
+'\x{5119}\x{511A}\x{511C}\x{511D}\x{511E}\x{511F}\x{5120}\x{5121}\x{5122}' .
+'\x{5123}\x{5124}\x{5125}\x{5126}\x{5127}\x{5129}\x{512A}\x{512C}\x{512D}' .
+'\x{512E}\x{512F}\x{5130}\x{5131}\x{5132}\x{5133}\x{5134}\x{5135}\x{5136}' .
+'\x{5137}\x{5138}\x{5139}\x{513A}\x{513B}\x{513C}\x{513D}\x{513E}\x{513F}' .
+'\x{5140}\x{5141}\x{5143}\x{5144}\x{5145}\x{5146}\x{5147}\x{5148}\x{5149}' .
+'\x{514B}\x{514C}\x{514D}\x{514E}\x{5150}\x{5151}\x{5152}\x{5154}\x{5155}' .
+'\x{5156}\x{5157}\x{5159}\x{515A}\x{515B}\x{515C}\x{515D}\x{515E}\x{515F}' .
+'\x{5161}\x{5162}\x{5163}\x{5165}\x{5166}\x{5167}\x{5168}\x{5169}\x{516A}' .
+'\x{516B}\x{516C}\x{516D}\x{516E}\x{516F}\x{5170}\x{5171}\x{5173}\x{5174}' .
+'\x{5175}\x{5176}\x{5177}\x{5178}\x{5179}\x{517A}\x{517B}\x{517C}\x{517D}' .
+'\x{517F}\x{5180}\x{5181}\x{5182}\x{5185}\x{5186}\x{5187}\x{5188}\x{5189}' .
+'\x{518A}\x{518B}\x{518C}\x{518D}\x{518F}\x{5190}\x{5191}\x{5192}\x{5193}' .
+'\x{5194}\x{5195}\x{5196}\x{5197}\x{5198}\x{5199}\x{519A}\x{519B}\x{519C}' .
+'\x{519D}\x{519E}\x{519F}\x{51A0}\x{51A2}\x{51A4}\x{51A5}\x{51A6}\x{51A7}' .
+'\x{51A8}\x{51AA}\x{51AB}\x{51AC}\x{51AE}\x{51AF}\x{51B0}\x{51B1}\x{51B2}' .
+'\x{51B3}\x{51B5}\x{51B6}\x{51B7}\x{51B9}\x{51BB}\x{51BC}\x{51BD}\x{51BE}' .
+'\x{51BF}\x{51C0}\x{51C1}\x{51C3}\x{51C4}\x{51C5}\x{51C6}\x{51C7}\x{51C8}' .
+'\x{51C9}\x{51CA}\x{51CB}\x{51CC}\x{51CD}\x{51CE}\x{51CF}\x{51D0}\x{51D1}' .
+'\x{51D4}\x{51D5}\x{51D6}\x{51D7}\x{51D8}\x{51D9}\x{51DA}\x{51DB}\x{51DC}' .
+'\x{51DD}\x{51DE}\x{51E0}\x{51E1}\x{51E2}\x{51E3}\x{51E4}\x{51E5}\x{51E7}' .
+'\x{51E8}\x{51E9}\x{51EA}\x{51EB}\x{51ED}\x{51EF}\x{51F0}\x{51F1}\x{51F3}' .
+'\x{51F4}\x{51F5}\x{51F6}\x{51F7}\x{51F8}\x{51F9}\x{51FA}\x{51FB}\x{51FC}' .
+'\x{51FD}\x{51FE}\x{51FF}\x{5200}\x{5201}\x{5202}\x{5203}\x{5204}\x{5205}' .
+'\x{5206}\x{5207}\x{5208}\x{5209}\x{520A}\x{520B}\x{520C}\x{520D}\x{520E}' .
+'\x{520F}\x{5210}\x{5211}\x{5212}\x{5213}\x{5214}\x{5215}\x{5216}\x{5217}' .
+'\x{5218}\x{5219}\x{521A}\x{521B}\x{521C}\x{521D}\x{521E}\x{521F}\x{5220}' .
+'\x{5221}\x{5222}\x{5223}\x{5224}\x{5225}\x{5226}\x{5228}\x{5229}\x{522A}' .
+'\x{522B}\x{522C}\x{522D}\x{522E}\x{522F}\x{5230}\x{5231}\x{5232}\x{5233}' .
+'\x{5234}\x{5235}\x{5236}\x{5237}\x{5238}\x{5239}\x{523A}\x{523B}\x{523C}' .
+'\x{523D}\x{523E}\x{523F}\x{5240}\x{5241}\x{5242}\x{5243}\x{5244}\x{5245}' .
+'\x{5246}\x{5247}\x{5248}\x{5249}\x{524A}\x{524B}\x{524C}\x{524D}\x{524E}' .
+'\x{5250}\x{5251}\x{5252}\x{5254}\x{5255}\x{5256}\x{5257}\x{5258}\x{5259}' .
+'\x{525A}\x{525B}\x{525C}\x{525D}\x{525E}\x{525F}\x{5260}\x{5261}\x{5262}' .
+'\x{5263}\x{5264}\x{5265}\x{5267}\x{5268}\x{5269}\x{526A}\x{526B}\x{526C}' .
+'\x{526D}\x{526E}\x{526F}\x{5270}\x{5272}\x{5273}\x{5274}\x{5275}\x{5276}' .
+'\x{5277}\x{5278}\x{527A}\x{527B}\x{527C}\x{527D}\x{527E}\x{527F}\x{5280}' .
+'\x{5281}\x{5282}\x{5283}\x{5284}\x{5286}\x{5287}\x{5288}\x{5289}\x{528A}' .
+'\x{528B}\x{528C}\x{528D}\x{528F}\x{5290}\x{5291}\x{5292}\x{5293}\x{5294}' .
+'\x{5295}\x{5296}\x{5297}\x{5298}\x{5299}\x{529A}\x{529B}\x{529C}\x{529D}' .
+'\x{529E}\x{529F}\x{52A0}\x{52A1}\x{52A2}\x{52A3}\x{52A5}\x{52A6}\x{52A7}' .
+'\x{52A8}\x{52A9}\x{52AA}\x{52AB}\x{52AC}\x{52AD}\x{52AE}\x{52AF}\x{52B0}' .
+'\x{52B1}\x{52B2}\x{52B3}\x{52B4}\x{52B5}\x{52B6}\x{52B7}\x{52B8}\x{52B9}' .
+'\x{52BA}\x{52BB}\x{52BC}\x{52BD}\x{52BE}\x{52BF}\x{52C0}\x{52C1}\x{52C2}' .
+'\x{52C3}\x{52C6}\x{52C7}\x{52C9}\x{52CA}\x{52CB}\x{52CD}\x{52CF}\x{52D0}' .
+'\x{52D2}\x{52D3}\x{52D5}\x{52D6}\x{52D7}\x{52D8}\x{52D9}\x{52DA}\x{52DB}' .
+'\x{52DC}\x{52DD}\x{52DE}\x{52DF}\x{52E0}\x{52E2}\x{52E3}\x{52E4}\x{52E6}' .
+'\x{52E7}\x{52E8}\x{52E9}\x{52EA}\x{52EB}\x{52EC}\x{52ED}\x{52EF}\x{52F0}' .
+'\x{52F1}\x{52F2}\x{52F3}\x{52F4}\x{52F5}\x{52F6}\x{52F7}\x{52F8}\x{52F9}' .
+'\x{52FA}\x{52FB}\x{52FC}\x{52FD}\x{52FE}\x{52FF}\x{5300}\x{5301}\x{5302}' .
+'\x{5305}\x{5306}\x{5307}\x{5308}\x{5309}\x{530A}\x{530B}\x{530C}\x{530D}' .
+'\x{530E}\x{530F}\x{5310}\x{5311}\x{5312}\x{5313}\x{5314}\x{5315}\x{5316}' .
+'\x{5317}\x{5319}\x{531A}\x{531C}\x{531D}\x{531F}\x{5320}\x{5321}\x{5322}' .
+'\x{5323}\x{5324}\x{5325}\x{5326}\x{5328}\x{532A}\x{532B}\x{532C}\x{532D}' .
+'\x{532E}\x{532F}\x{5330}\x{5331}\x{5333}\x{5334}\x{5337}\x{5339}\x{533A}' .
+'\x{533B}\x{533C}\x{533D}\x{533E}\x{533F}\x{5340}\x{5341}\x{5343}\x{5344}' .
+'\x{5345}\x{5346}\x{5347}\x{5348}\x{5349}\x{534A}\x{534B}\x{534C}\x{534D}' .
+'\x{534E}\x{534F}\x{5350}\x{5351}\x{5352}\x{5353}\x{5354}\x{5355}\x{5356}' .
+'\x{5357}\x{5358}\x{5359}\x{535A}\x{535C}\x{535E}\x{535F}\x{5360}\x{5361}' .
+'\x{5362}\x{5363}\x{5364}\x{5365}\x{5366}\x{5367}\x{5369}\x{536B}\x{536C}' .
+'\x{536E}\x{536F}\x{5370}\x{5371}\x{5372}\x{5373}\x{5374}\x{5375}\x{5376}' .
+'\x{5377}\x{5378}\x{5379}\x{537A}\x{537B}\x{537C}\x{537D}\x{537E}\x{537F}' .
+'\x{5381}\x{5382}\x{5383}\x{5384}\x{5385}\x{5386}\x{5387}\x{5388}\x{5389}' .
+'\x{538A}\x{538B}\x{538C}\x{538D}\x{538E}\x{538F}\x{5390}\x{5391}\x{5392}' .
+'\x{5393}\x{5394}\x{5395}\x{5396}\x{5397}\x{5398}\x{5399}\x{539A}\x{539B}' .
+'\x{539C}\x{539D}\x{539E}\x{539F}\x{53A0}\x{53A2}\x{53A3}\x{53A4}\x{53A5}' .
+'\x{53A6}\x{53A7}\x{53A8}\x{53A9}\x{53AC}\x{53AD}\x{53AE}\x{53B0}\x{53B1}' .
+'\x{53B2}\x{53B3}\x{53B4}\x{53B5}\x{53B6}\x{53B7}\x{53B8}\x{53B9}\x{53BB}' .
+'\x{53BC}\x{53BD}\x{53BE}\x{53BF}\x{53C0}\x{53C1}\x{53C2}\x{53C3}\x{53C4}' .
+'\x{53C6}\x{53C7}\x{53C8}\x{53C9}\x{53CA}\x{53CB}\x{53CC}\x{53CD}\x{53CE}' .
+'\x{53D0}\x{53D1}\x{53D2}\x{53D3}\x{53D4}\x{53D5}\x{53D6}\x{53D7}\x{53D8}' .
+'\x{53D9}\x{53DB}\x{53DC}\x{53DF}\x{53E0}\x{53E1}\x{53E2}\x{53E3}\x{53E4}' .
+'\x{53E5}\x{53E6}\x{53E8}\x{53E9}\x{53EA}\x{53EB}\x{53EC}\x{53ED}\x{53EE}' .
+'\x{53EF}\x{53F0}\x{53F1}\x{53F2}\x{53F3}\x{53F4}\x{53F5}\x{53F6}\x{53F7}' .
+'\x{53F8}\x{53F9}\x{53FA}\x{53FB}\x{53FC}\x{53FD}\x{53FE}\x{5401}\x{5402}' .
+'\x{5403}\x{5404}\x{5405}\x{5406}\x{5407}\x{5408}\x{5409}\x{540A}\x{540B}' .
+'\x{540C}\x{540D}\x{540E}\x{540F}\x{5410}\x{5411}\x{5412}\x{5413}\x{5414}' .
+'\x{5415}\x{5416}\x{5417}\x{5418}\x{5419}\x{541B}\x{541C}\x{541D}\x{541E}' .
+'\x{541F}\x{5420}\x{5421}\x{5423}\x{5424}\x{5425}\x{5426}\x{5427}\x{5428}' .
+'\x{5429}\x{542A}\x{542B}\x{542C}\x{542D}\x{542E}\x{542F}\x{5430}\x{5431}' .
+'\x{5432}\x{5433}\x{5434}\x{5435}\x{5436}\x{5437}\x{5438}\x{5439}\x{543A}' .
+'\x{543B}\x{543C}\x{543D}\x{543E}\x{543F}\x{5440}\x{5441}\x{5442}\x{5443}' .
+'\x{5444}\x{5445}\x{5446}\x{5447}\x{5448}\x{5449}\x{544A}\x{544B}\x{544D}' .
+'\x{544E}\x{544F}\x{5450}\x{5451}\x{5452}\x{5453}\x{5454}\x{5455}\x{5456}' .
+'\x{5457}\x{5458}\x{5459}\x{545A}\x{545B}\x{545C}\x{545E}\x{545F}\x{5460}' .
+'\x{5461}\x{5462}\x{5463}\x{5464}\x{5465}\x{5466}\x{5467}\x{5468}\x{546A}' .
+'\x{546B}\x{546C}\x{546D}\x{546E}\x{546F}\x{5470}\x{5471}\x{5472}\x{5473}' .
+'\x{5474}\x{5475}\x{5476}\x{5477}\x{5478}\x{5479}\x{547A}\x{547B}\x{547C}' .
+'\x{547D}\x{547E}\x{547F}\x{5480}\x{5481}\x{5482}\x{5483}\x{5484}\x{5485}' .
+'\x{5486}\x{5487}\x{5488}\x{5489}\x{548B}\x{548C}\x{548D}\x{548E}\x{548F}' .
+'\x{5490}\x{5491}\x{5492}\x{5493}\x{5494}\x{5495}\x{5496}\x{5497}\x{5498}' .
+'\x{5499}\x{549A}\x{549B}\x{549C}\x{549D}\x{549E}\x{549F}\x{54A0}\x{54A1}' .
+'\x{54A2}\x{54A3}\x{54A4}\x{54A5}\x{54A6}\x{54A7}\x{54A8}\x{54A9}\x{54AA}' .
+'\x{54AB}\x{54AC}\x{54AD}\x{54AE}\x{54AF}\x{54B0}\x{54B1}\x{54B2}\x{54B3}' .
+'\x{54B4}\x{54B6}\x{54B7}\x{54B8}\x{54B9}\x{54BA}\x{54BB}\x{54BC}\x{54BD}' .
+'\x{54BE}\x{54BF}\x{54C0}\x{54C1}\x{54C2}\x{54C3}\x{54C4}\x{54C5}\x{54C6}' .
+'\x{54C7}\x{54C8}\x{54C9}\x{54CA}\x{54CB}\x{54CC}\x{54CD}\x{54CE}\x{54CF}' .
+'\x{54D0}\x{54D1}\x{54D2}\x{54D3}\x{54D4}\x{54D5}\x{54D6}\x{54D7}\x{54D8}' .
+'\x{54D9}\x{54DA}\x{54DB}\x{54DC}\x{54DD}\x{54DE}\x{54DF}\x{54E0}\x{54E1}' .
+'\x{54E2}\x{54E3}\x{54E4}\x{54E5}\x{54E6}\x{54E7}\x{54E8}\x{54E9}\x{54EA}' .
+'\x{54EB}\x{54EC}\x{54ED}\x{54EE}\x{54EF}\x{54F0}\x{54F1}\x{54F2}\x{54F3}' .
+'\x{54F4}\x{54F5}\x{54F7}\x{54F8}\x{54F9}\x{54FA}\x{54FB}\x{54FC}\x{54FD}' .
+'\x{54FE}\x{54FF}\x{5500}\x{5501}\x{5502}\x{5503}\x{5504}\x{5505}\x{5506}' .
+'\x{5507}\x{5508}\x{5509}\x{550A}\x{550B}\x{550C}\x{550D}\x{550E}\x{550F}' .
+'\x{5510}\x{5511}\x{5512}\x{5513}\x{5514}\x{5516}\x{5517}\x{551A}\x{551B}' .
+'\x{551C}\x{551D}\x{551E}\x{551F}\x{5520}\x{5521}\x{5522}\x{5523}\x{5524}' .
+'\x{5525}\x{5526}\x{5527}\x{5528}\x{5529}\x{552A}\x{552B}\x{552C}\x{552D}' .
+'\x{552E}\x{552F}\x{5530}\x{5531}\x{5532}\x{5533}\x{5534}\x{5535}\x{5536}' .
+'\x{5537}\x{5538}\x{5539}\x{553A}\x{553B}\x{553C}\x{553D}\x{553E}\x{553F}' .
+'\x{5540}\x{5541}\x{5542}\x{5543}\x{5544}\x{5545}\x{5546}\x{5548}\x{5549}' .
+'\x{554A}\x{554B}\x{554C}\x{554D}\x{554E}\x{554F}\x{5550}\x{5551}\x{5552}' .
+'\x{5553}\x{5554}\x{5555}\x{5556}\x{5557}\x{5558}\x{5559}\x{555A}\x{555B}' .
+'\x{555C}\x{555D}\x{555E}\x{555F}\x{5561}\x{5562}\x{5563}\x{5564}\x{5565}' .
+'\x{5566}\x{5567}\x{5568}\x{5569}\x{556A}\x{556B}\x{556C}\x{556D}\x{556E}' .
+'\x{556F}\x{5570}\x{5571}\x{5572}\x{5573}\x{5574}\x{5575}\x{5576}\x{5577}' .
+'\x{5578}\x{5579}\x{557B}\x{557C}\x{557D}\x{557E}\x{557F}\x{5580}\x{5581}' .
+'\x{5582}\x{5583}\x{5584}\x{5585}\x{5586}\x{5587}\x{5588}\x{5589}\x{558A}' .
+'\x{558B}\x{558C}\x{558D}\x{558E}\x{558F}\x{5590}\x{5591}\x{5592}\x{5593}' .
+'\x{5594}\x{5595}\x{5596}\x{5597}\x{5598}\x{5599}\x{559A}\x{559B}\x{559C}' .
+'\x{559D}\x{559E}\x{559F}\x{55A0}\x{55A1}\x{55A2}\x{55A3}\x{55A4}\x{55A5}' .
+'\x{55A6}\x{55A7}\x{55A8}\x{55A9}\x{55AA}\x{55AB}\x{55AC}\x{55AD}\x{55AE}' .
+'\x{55AF}\x{55B0}\x{55B1}\x{55B2}\x{55B3}\x{55B4}\x{55B5}\x{55B6}\x{55B7}' .
+'\x{55B8}\x{55B9}\x{55BA}\x{55BB}\x{55BC}\x{55BD}\x{55BE}\x{55BF}\x{55C0}' .
+'\x{55C1}\x{55C2}\x{55C3}\x{55C4}\x{55C5}\x{55C6}\x{55C7}\x{55C8}\x{55C9}' .
+'\x{55CA}\x{55CB}\x{55CC}\x{55CD}\x{55CE}\x{55CF}\x{55D0}\x{55D1}\x{55D2}' .
+'\x{55D3}\x{55D4}\x{55D5}\x{55D6}\x{55D7}\x{55D8}\x{55D9}\x{55DA}\x{55DB}' .
+'\x{55DC}\x{55DD}\x{55DE}\x{55DF}\x{55E1}\x{55E2}\x{55E3}\x{55E4}\x{55E5}' .
+'\x{55E6}\x{55E7}\x{55E8}\x{55E9}\x{55EA}\x{55EB}\x{55EC}\x{55ED}\x{55EE}' .
+'\x{55EF}\x{55F0}\x{55F1}\x{55F2}\x{55F3}\x{55F4}\x{55F5}\x{55F6}\x{55F7}' .
+'\x{55F9}\x{55FA}\x{55FB}\x{55FC}\x{55FD}\x{55FE}\x{55FF}\x{5600}\x{5601}' .
+'\x{5602}\x{5603}\x{5604}\x{5606}\x{5607}\x{5608}\x{5609}\x{560C}\x{560D}' .
+'\x{560E}\x{560F}\x{5610}\x{5611}\x{5612}\x{5613}\x{5614}\x{5615}\x{5616}' .
+'\x{5617}\x{5618}\x{5619}\x{561A}\x{561B}\x{561C}\x{561D}\x{561E}\x{561F}' .
+'\x{5621}\x{5622}\x{5623}\x{5624}\x{5625}\x{5626}\x{5627}\x{5628}\x{5629}' .
+'\x{562A}\x{562C}\x{562D}\x{562E}\x{562F}\x{5630}\x{5631}\x{5632}\x{5633}' .
+'\x{5634}\x{5635}\x{5636}\x{5638}\x{5639}\x{563A}\x{563B}\x{563D}\x{563E}' .
+'\x{563F}\x{5640}\x{5641}\x{5642}\x{5643}\x{5645}\x{5646}\x{5647}\x{5648}' .
+'\x{5649}\x{564A}\x{564C}\x{564D}\x{564E}\x{564F}\x{5650}\x{5652}\x{5653}' .
+'\x{5654}\x{5655}\x{5657}\x{5658}\x{5659}\x{565A}\x{565B}\x{565C}\x{565D}' .
+'\x{565E}\x{5660}\x{5662}\x{5663}\x{5664}\x{5665}\x{5666}\x{5667}\x{5668}' .
+'\x{5669}\x{566A}\x{566B}\x{566C}\x{566D}\x{566E}\x{566F}\x{5670}\x{5671}' .
+'\x{5672}\x{5673}\x{5674}\x{5676}\x{5677}\x{5678}\x{5679}\x{567A}\x{567B}' .
+'\x{567C}\x{567E}\x{567F}\x{5680}\x{5681}\x{5682}\x{5683}\x{5684}\x{5685}' .
+'\x{5686}\x{5687}\x{568A}\x{568C}\x{568D}\x{568E}\x{568F}\x{5690}\x{5691}' .
+'\x{5692}\x{5693}\x{5694}\x{5695}\x{5697}\x{5698}\x{5699}\x{569A}\x{569B}' .
+'\x{569C}\x{569D}\x{569F}\x{56A0}\x{56A1}\x{56A3}\x{56A4}\x{56A5}\x{56A6}' .
+'\x{56A7}\x{56A8}\x{56A9}\x{56AA}\x{56AB}\x{56AC}\x{56AD}\x{56AE}\x{56AF}' .
+'\x{56B0}\x{56B1}\x{56B2}\x{56B3}\x{56B4}\x{56B5}\x{56B6}\x{56B7}\x{56B8}' .
+'\x{56B9}\x{56BB}\x{56BC}\x{56BD}\x{56BE}\x{56BF}\x{56C0}\x{56C1}\x{56C2}' .
+'\x{56C3}\x{56C4}\x{56C5}\x{56C6}\x{56C7}\x{56C8}\x{56C9}\x{56CA}\x{56CB}' .
+'\x{56CC}\x{56CD}\x{56CE}\x{56D0}\x{56D1}\x{56D2}\x{56D3}\x{56D4}\x{56D5}' .
+'\x{56D6}\x{56D7}\x{56D8}\x{56DA}\x{56DB}\x{56DC}\x{56DD}\x{56DE}\x{56DF}' .
+'\x{56E0}\x{56E1}\x{56E2}\x{56E3}\x{56E4}\x{56E5}\x{56E7}\x{56E8}\x{56E9}' .
+'\x{56EA}\x{56EB}\x{56EC}\x{56ED}\x{56EE}\x{56EF}\x{56F0}\x{56F1}\x{56F2}' .
+'\x{56F3}\x{56F4}\x{56F5}\x{56F7}\x{56F9}\x{56FA}\x{56FD}\x{56FE}\x{56FF}' .
+'\x{5700}\x{5701}\x{5702}\x{5703}\x{5704}\x{5706}\x{5707}\x{5708}\x{5709}' .
+'\x{570A}\x{570B}\x{570C}\x{570D}\x{570E}\x{570F}\x{5710}\x{5712}\x{5713}' .
+'\x{5714}\x{5715}\x{5716}\x{5718}\x{5719}\x{571A}\x{571B}\x{571C}\x{571D}' .
+'\x{571E}\x{571F}\x{5720}\x{5722}\x{5723}\x{5725}\x{5726}\x{5727}\x{5728}' .
+'\x{5729}\x{572A}\x{572B}\x{572C}\x{572D}\x{572E}\x{572F}\x{5730}\x{5731}' .
+'\x{5732}\x{5733}\x{5734}\x{5735}\x{5736}\x{5737}\x{5738}\x{5739}\x{573A}' .
+'\x{573B}\x{573C}\x{573E}\x{573F}\x{5740}\x{5741}\x{5742}\x{5744}\x{5745}' .
+'\x{5746}\x{5747}\x{5749}\x{574A}\x{574B}\x{574C}\x{574D}\x{574E}\x{574F}' .
+'\x{5750}\x{5751}\x{5752}\x{5753}\x{5754}\x{5757}\x{5759}\x{575A}\x{575B}' .
+'\x{575C}\x{575D}\x{575E}\x{575F}\x{5760}\x{5761}\x{5762}\x{5764}\x{5765}' .
+'\x{5766}\x{5767}\x{5768}\x{5769}\x{576A}\x{576B}\x{576C}\x{576D}\x{576F}' .
+'\x{5770}\x{5771}\x{5772}\x{5773}\x{5774}\x{5775}\x{5776}\x{5777}\x{5779}' .
+'\x{577A}\x{577B}\x{577C}\x{577D}\x{577E}\x{577F}\x{5780}\x{5782}\x{5783}' .
+'\x{5784}\x{5785}\x{5786}\x{5788}\x{5789}\x{578A}\x{578B}\x{578C}\x{578D}' .
+'\x{578E}\x{578F}\x{5790}\x{5791}\x{5792}\x{5793}\x{5794}\x{5795}\x{5797}' .
+'\x{5798}\x{5799}\x{579A}\x{579B}\x{579C}\x{579D}\x{579E}\x{579F}\x{57A0}' .
+'\x{57A1}\x{57A2}\x{57A3}\x{57A4}\x{57A5}\x{57A6}\x{57A7}\x{57A9}\x{57AA}' .
+'\x{57AB}\x{57AC}\x{57AD}\x{57AE}\x{57AF}\x{57B0}\x{57B1}\x{57B2}\x{57B3}' .
+'\x{57B4}\x{57B5}\x{57B6}\x{57B7}\x{57B8}\x{57B9}\x{57BA}\x{57BB}\x{57BC}' .
+'\x{57BD}\x{57BE}\x{57BF}\x{57C0}\x{57C1}\x{57C2}\x{57C3}\x{57C4}\x{57C5}' .
+'\x{57C6}\x{57C7}\x{57C8}\x{57C9}\x{57CB}\x{57CC}\x{57CD}\x{57CE}\x{57CF}' .
+'\x{57D0}\x{57D2}\x{57D3}\x{57D4}\x{57D5}\x{57D6}\x{57D8}\x{57D9}\x{57DA}' .
+'\x{57DC}\x{57DD}\x{57DF}\x{57E0}\x{57E1}\x{57E2}\x{57E3}\x{57E4}\x{57E5}' .
+'\x{57E6}\x{57E7}\x{57E8}\x{57E9}\x{57EA}\x{57EB}\x{57EC}\x{57ED}\x{57EE}' .
+'\x{57EF}\x{57F0}\x{57F1}\x{57F2}\x{57F3}\x{57F4}\x{57F5}\x{57F6}\x{57F7}' .
+'\x{57F8}\x{57F9}\x{57FA}\x{57FB}\x{57FC}\x{57FD}\x{57FE}\x{57FF}\x{5800}' .
+'\x{5801}\x{5802}\x{5803}\x{5804}\x{5805}\x{5806}\x{5807}\x{5808}\x{5809}' .
+'\x{580A}\x{580B}\x{580C}\x{580D}\x{580E}\x{580F}\x{5810}\x{5811}\x{5812}' .
+'\x{5813}\x{5814}\x{5815}\x{5816}\x{5819}\x{581A}\x{581B}\x{581C}\x{581D}' .
+'\x{581E}\x{581F}\x{5820}\x{5821}\x{5822}\x{5823}\x{5824}\x{5825}\x{5826}' .
+'\x{5827}\x{5828}\x{5829}\x{582A}\x{582B}\x{582C}\x{582D}\x{582E}\x{582F}' .
+'\x{5830}\x{5831}\x{5832}\x{5833}\x{5834}\x{5835}\x{5836}\x{5837}\x{5838}' .
+'\x{5839}\x{583A}\x{583B}\x{583C}\x{583D}\x{583E}\x{583F}\x{5840}\x{5842}' .
+'\x{5843}\x{5844}\x{5845}\x{5846}\x{5847}\x{5848}\x{5849}\x{584A}\x{584B}' .
+'\x{584C}\x{584D}\x{584E}\x{584F}\x{5851}\x{5852}\x{5853}\x{5854}\x{5855}' .
+'\x{5857}\x{5858}\x{5859}\x{585A}\x{585B}\x{585C}\x{585D}\x{585E}\x{585F}' .
+'\x{5861}\x{5862}\x{5863}\x{5864}\x{5865}\x{5868}\x{5869}\x{586A}\x{586B}' .
+'\x{586C}\x{586D}\x{586E}\x{586F}\x{5870}\x{5871}\x{5872}\x{5873}\x{5874}' .
+'\x{5875}\x{5876}\x{5878}\x{5879}\x{587A}\x{587B}\x{587C}\x{587D}\x{587E}' .
+'\x{587F}\x{5880}\x{5881}\x{5882}\x{5883}\x{5884}\x{5885}\x{5886}\x{5887}' .
+'\x{5888}\x{5889}\x{588A}\x{588B}\x{588C}\x{588D}\x{588E}\x{588F}\x{5890}' .
+'\x{5891}\x{5892}\x{5893}\x{5894}\x{5896}\x{5897}\x{5898}\x{5899}\x{589A}' .
+'\x{589B}\x{589C}\x{589D}\x{589E}\x{589F}\x{58A0}\x{58A1}\x{58A2}\x{58A3}' .
+'\x{58A4}\x{58A5}\x{58A6}\x{58A7}\x{58A8}\x{58A9}\x{58AB}\x{58AC}\x{58AD}' .
+'\x{58AE}\x{58AF}\x{58B0}\x{58B1}\x{58B2}\x{58B3}\x{58B4}\x{58B7}\x{58B8}' .
+'\x{58B9}\x{58BA}\x{58BB}\x{58BC}\x{58BD}\x{58BE}\x{58BF}\x{58C1}\x{58C2}' .
+'\x{58C5}\x{58C6}\x{58C7}\x{58C8}\x{58C9}\x{58CA}\x{58CB}\x{58CE}\x{58CF}' .
+'\x{58D1}\x{58D2}\x{58D3}\x{58D4}\x{58D5}\x{58D6}\x{58D7}\x{58D8}\x{58D9}' .
+'\x{58DA}\x{58DB}\x{58DD}\x{58DE}\x{58DF}\x{58E0}\x{58E2}\x{58E3}\x{58E4}' .
+'\x{58E5}\x{58E7}\x{58E8}\x{58E9}\x{58EA}\x{58EB}\x{58EC}\x{58ED}\x{58EE}' .
+'\x{58EF}\x{58F0}\x{58F1}\x{58F2}\x{58F3}\x{58F4}\x{58F6}\x{58F7}\x{58F8}' .
+'\x{58F9}\x{58FA}\x{58FB}\x{58FC}\x{58FD}\x{58FE}\x{58FF}\x{5900}\x{5902}' .
+'\x{5903}\x{5904}\x{5906}\x{5907}\x{5909}\x{590A}\x{590B}\x{590C}\x{590D}' .
+'\x{590E}\x{590F}\x{5910}\x{5912}\x{5914}\x{5915}\x{5916}\x{5917}\x{5918}' .
+'\x{5919}\x{591A}\x{591B}\x{591C}\x{591D}\x{591E}\x{591F}\x{5920}\x{5921}' .
+'\x{5922}\x{5924}\x{5925}\x{5926}\x{5927}\x{5928}\x{5929}\x{592A}\x{592B}' .
+'\x{592C}\x{592D}\x{592E}\x{592F}\x{5930}\x{5931}\x{5932}\x{5934}\x{5935}' .
+'\x{5937}\x{5938}\x{5939}\x{593A}\x{593B}\x{593C}\x{593D}\x{593E}\x{593F}' .
+'\x{5940}\x{5941}\x{5942}\x{5943}\x{5944}\x{5945}\x{5946}\x{5947}\x{5948}' .
+'\x{5949}\x{594A}\x{594B}\x{594C}\x{594D}\x{594E}\x{594F}\x{5950}\x{5951}' .
+'\x{5952}\x{5953}\x{5954}\x{5955}\x{5956}\x{5957}\x{5958}\x{595A}\x{595C}' .
+'\x{595D}\x{595E}\x{595F}\x{5960}\x{5961}\x{5962}\x{5963}\x{5964}\x{5965}' .
+'\x{5966}\x{5967}\x{5968}\x{5969}\x{596A}\x{596B}\x{596C}\x{596D}\x{596E}' .
+'\x{596F}\x{5970}\x{5971}\x{5972}\x{5973}\x{5974}\x{5975}\x{5976}\x{5977}' .
+'\x{5978}\x{5979}\x{597A}\x{597B}\x{597C}\x{597D}\x{597E}\x{597F}\x{5980}' .
+'\x{5981}\x{5982}\x{5983}\x{5984}\x{5985}\x{5986}\x{5987}\x{5988}\x{5989}' .
+'\x{598A}\x{598B}\x{598C}\x{598D}\x{598E}\x{598F}\x{5990}\x{5991}\x{5992}' .
+'\x{5993}\x{5994}\x{5995}\x{5996}\x{5997}\x{5998}\x{5999}\x{599A}\x{599C}' .
+'\x{599D}\x{599E}\x{599F}\x{59A0}\x{59A1}\x{59A2}\x{59A3}\x{59A4}\x{59A5}' .
+'\x{59A6}\x{59A7}\x{59A8}\x{59A9}\x{59AA}\x{59AB}\x{59AC}\x{59AD}\x{59AE}' .
+'\x{59AF}\x{59B0}\x{59B1}\x{59B2}\x{59B3}\x{59B4}\x{59B5}\x{59B6}\x{59B8}' .
+'\x{59B9}\x{59BA}\x{59BB}\x{59BC}\x{59BD}\x{59BE}\x{59BF}\x{59C0}\x{59C1}' .
+'\x{59C2}\x{59C3}\x{59C4}\x{59C5}\x{59C6}\x{59C7}\x{59C8}\x{59C9}\x{59CA}' .
+'\x{59CB}\x{59CC}\x{59CD}\x{59CE}\x{59CF}\x{59D0}\x{59D1}\x{59D2}\x{59D3}' .
+'\x{59D4}\x{59D5}\x{59D6}\x{59D7}\x{59D8}\x{59D9}\x{59DA}\x{59DB}\x{59DC}' .
+'\x{59DD}\x{59DE}\x{59DF}\x{59E0}\x{59E1}\x{59E2}\x{59E3}\x{59E4}\x{59E5}' .
+'\x{59E6}\x{59E8}\x{59E9}\x{59EA}\x{59EB}\x{59EC}\x{59ED}\x{59EE}\x{59EF}' .
+'\x{59F0}\x{59F1}\x{59F2}\x{59F3}\x{59F4}\x{59F5}\x{59F6}\x{59F7}\x{59F8}' .
+'\x{59F9}\x{59FA}\x{59FB}\x{59FC}\x{59FD}\x{59FE}\x{59FF}\x{5A00}\x{5A01}' .
+'\x{5A02}\x{5A03}\x{5A04}\x{5A05}\x{5A06}\x{5A07}\x{5A08}\x{5A09}\x{5A0A}' .
+'\x{5A0B}\x{5A0C}\x{5A0D}\x{5A0E}\x{5A0F}\x{5A10}\x{5A11}\x{5A12}\x{5A13}' .
+'\x{5A14}\x{5A15}\x{5A16}\x{5A17}\x{5A18}\x{5A19}\x{5A1A}\x{5A1B}\x{5A1C}' .
+'\x{5A1D}\x{5A1E}\x{5A1F}\x{5A20}\x{5A21}\x{5A22}\x{5A23}\x{5A25}\x{5A27}' .
+'\x{5A28}\x{5A29}\x{5A2A}\x{5A2B}\x{5A2D}\x{5A2E}\x{5A2F}\x{5A31}\x{5A32}' .
+'\x{5A33}\x{5A34}\x{5A35}\x{5A36}\x{5A37}\x{5A38}\x{5A39}\x{5A3A}\x{5A3B}' .
+'\x{5A3C}\x{5A3D}\x{5A3E}\x{5A3F}\x{5A40}\x{5A41}\x{5A42}\x{5A43}\x{5A44}' .
+'\x{5A45}\x{5A46}\x{5A47}\x{5A48}\x{5A49}\x{5A4A}\x{5A4B}\x{5A4C}\x{5A4D}' .
+'\x{5A4E}\x{5A4F}\x{5A50}\x{5A51}\x{5A52}\x{5A53}\x{5A55}\x{5A56}\x{5A57}' .
+'\x{5A58}\x{5A5A}\x{5A5B}\x{5A5C}\x{5A5D}\x{5A5E}\x{5A5F}\x{5A60}\x{5A61}' .
+'\x{5A62}\x{5A63}\x{5A64}\x{5A65}\x{5A66}\x{5A67}\x{5A68}\x{5A69}\x{5A6A}' .
+'\x{5A6B}\x{5A6C}\x{5A6D}\x{5A6E}\x{5A70}\x{5A72}\x{5A73}\x{5A74}\x{5A75}' .
+'\x{5A76}\x{5A77}\x{5A78}\x{5A79}\x{5A7A}\x{5A7B}\x{5A7C}\x{5A7D}\x{5A7E}' .
+'\x{5A7F}\x{5A80}\x{5A81}\x{5A82}\x{5A83}\x{5A84}\x{5A85}\x{5A86}\x{5A88}' .
+'\x{5A89}\x{5A8A}\x{5A8B}\x{5A8C}\x{5A8E}\x{5A8F}\x{5A90}\x{5A91}\x{5A92}' .
+'\x{5A93}\x{5A94}\x{5A95}\x{5A96}\x{5A97}\x{5A98}\x{5A99}\x{5A9A}\x{5A9B}' .
+'\x{5A9C}\x{5A9D}\x{5A9E}\x{5A9F}\x{5AA0}\x{5AA1}\x{5AA2}\x{5AA3}\x{5AA4}' .
+'\x{5AA5}\x{5AA6}\x{5AA7}\x{5AA8}\x{5AA9}\x{5AAA}\x{5AAC}\x{5AAD}\x{5AAE}' .
+'\x{5AAF}\x{5AB0}\x{5AB1}\x{5AB2}\x{5AB3}\x{5AB4}\x{5AB5}\x{5AB6}\x{5AB7}' .
+'\x{5AB8}\x{5AB9}\x{5ABA}\x{5ABB}\x{5ABC}\x{5ABD}\x{5ABE}\x{5ABF}\x{5AC0}' .
+'\x{5AC1}\x{5AC2}\x{5AC3}\x{5AC4}\x{5AC5}\x{5AC6}\x{5AC7}\x{5AC8}\x{5AC9}' .
+'\x{5ACA}\x{5ACB}\x{5ACC}\x{5ACD}\x{5ACE}\x{5ACF}\x{5AD1}\x{5AD2}\x{5AD4}' .
+'\x{5AD5}\x{5AD6}\x{5AD7}\x{5AD8}\x{5AD9}\x{5ADA}\x{5ADB}\x{5ADC}\x{5ADD}' .
+'\x{5ADE}\x{5ADF}\x{5AE0}\x{5AE1}\x{5AE2}\x{5AE3}\x{5AE4}\x{5AE5}\x{5AE6}' .
+'\x{5AE7}\x{5AE8}\x{5AE9}\x{5AEA}\x{5AEB}\x{5AEC}\x{5AED}\x{5AEE}\x{5AF1}' .
+'\x{5AF2}\x{5AF3}\x{5AF4}\x{5AF5}\x{5AF6}\x{5AF7}\x{5AF8}\x{5AF9}\x{5AFA}' .
+'\x{5AFB}\x{5AFC}\x{5AFD}\x{5AFE}\x{5AFF}\x{5B00}\x{5B01}\x{5B02}\x{5B03}' .
+'\x{5B04}\x{5B05}\x{5B06}\x{5B07}\x{5B08}\x{5B09}\x{5B0B}\x{5B0C}\x{5B0E}' .
+'\x{5B0F}\x{5B10}\x{5B11}\x{5B12}\x{5B13}\x{5B14}\x{5B15}\x{5B16}\x{5B17}' .
+'\x{5B18}\x{5B19}\x{5B1A}\x{5B1B}\x{5B1C}\x{5B1D}\x{5B1E}\x{5B1F}\x{5B20}' .
+'\x{5B21}\x{5B22}\x{5B23}\x{5B24}\x{5B25}\x{5B26}\x{5B27}\x{5B28}\x{5B29}' .
+'\x{5B2A}\x{5B2B}\x{5B2C}\x{5B2D}\x{5B2E}\x{5B2F}\x{5B30}\x{5B31}\x{5B32}' .
+'\x{5B33}\x{5B34}\x{5B35}\x{5B36}\x{5B37}\x{5B38}\x{5B3A}\x{5B3B}\x{5B3C}' .
+'\x{5B3D}\x{5B3E}\x{5B3F}\x{5B40}\x{5B41}\x{5B42}\x{5B43}\x{5B44}\x{5B45}' .
+'\x{5B47}\x{5B48}\x{5B49}\x{5B4A}\x{5B4B}\x{5B4C}\x{5B4D}\x{5B4E}\x{5B50}' .
+'\x{5B51}\x{5B53}\x{5B54}\x{5B55}\x{5B56}\x{5B57}\x{5B58}\x{5B59}\x{5B5A}' .
+'\x{5B5B}\x{5B5C}\x{5B5D}\x{5B5E}\x{5B5F}\x{5B62}\x{5B63}\x{5B64}\x{5B65}' .
+'\x{5B66}\x{5B67}\x{5B68}\x{5B69}\x{5B6A}\x{5B6B}\x{5B6C}\x{5B6D}\x{5B6E}' .
+'\x{5B70}\x{5B71}\x{5B72}\x{5B73}\x{5B74}\x{5B75}\x{5B76}\x{5B77}\x{5B78}' .
+'\x{5B7A}\x{5B7B}\x{5B7C}\x{5B7D}\x{5B7F}\x{5B80}\x{5B81}\x{5B82}\x{5B83}' .
+'\x{5B84}\x{5B85}\x{5B87}\x{5B88}\x{5B89}\x{5B8A}\x{5B8B}\x{5B8C}\x{5B8D}' .
+'\x{5B8E}\x{5B8F}\x{5B91}\x{5B92}\x{5B93}\x{5B94}\x{5B95}\x{5B96}\x{5B97}' .
+'\x{5B98}\x{5B99}\x{5B9A}\x{5B9B}\x{5B9C}\x{5B9D}\x{5B9E}\x{5B9F}\x{5BA0}' .
+'\x{5BA1}\x{5BA2}\x{5BA3}\x{5BA4}\x{5BA5}\x{5BA6}\x{5BA7}\x{5BA8}\x{5BAA}' .
+'\x{5BAB}\x{5BAC}\x{5BAD}\x{5BAE}\x{5BAF}\x{5BB0}\x{5BB1}\x{5BB3}\x{5BB4}' .
+'\x{5BB5}\x{5BB6}\x{5BB8}\x{5BB9}\x{5BBA}\x{5BBB}\x{5BBD}\x{5BBE}\x{5BBF}' .
+'\x{5BC0}\x{5BC1}\x{5BC2}\x{5BC3}\x{5BC4}\x{5BC5}\x{5BC6}\x{5BC7}\x{5BCA}' .
+'\x{5BCB}\x{5BCC}\x{5BCD}\x{5BCE}\x{5BCF}\x{5BD0}\x{5BD1}\x{5BD2}\x{5BD3}' .
+'\x{5BD4}\x{5BD5}\x{5BD6}\x{5BD8}\x{5BD9}\x{5BDB}\x{5BDC}\x{5BDD}\x{5BDE}' .
+'\x{5BDF}\x{5BE0}\x{5BE1}\x{5BE2}\x{5BE3}\x{5BE4}\x{5BE5}\x{5BE6}\x{5BE7}' .
+'\x{5BE8}\x{5BE9}\x{5BEA}\x{5BEB}\x{5BEC}\x{5BED}\x{5BEE}\x{5BEF}\x{5BF0}' .
+'\x{5BF1}\x{5BF2}\x{5BF3}\x{5BF4}\x{5BF5}\x{5BF6}\x{5BF7}\x{5BF8}\x{5BF9}' .
+'\x{5BFA}\x{5BFB}\x{5BFC}\x{5BFD}\x{5BFF}\x{5C01}\x{5C03}\x{5C04}\x{5C05}' .
+'\x{5C06}\x{5C07}\x{5C08}\x{5C09}\x{5C0A}\x{5C0B}\x{5C0C}\x{5C0D}\x{5C0E}' .
+'\x{5C0F}\x{5C10}\x{5C11}\x{5C12}\x{5C13}\x{5C14}\x{5C15}\x{5C16}\x{5C17}' .
+'\x{5C18}\x{5C19}\x{5C1A}\x{5C1C}\x{5C1D}\x{5C1E}\x{5C1F}\x{5C20}\x{5C21}' .
+'\x{5C22}\x{5C24}\x{5C25}\x{5C27}\x{5C28}\x{5C2A}\x{5C2B}\x{5C2C}\x{5C2D}' .
+'\x{5C2E}\x{5C2F}\x{5C30}\x{5C31}\x{5C32}\x{5C33}\x{5C34}\x{5C35}\x{5C37}' .
+'\x{5C38}\x{5C39}\x{5C3A}\x{5C3B}\x{5C3C}\x{5C3D}\x{5C3E}\x{5C3F}\x{5C40}' .
+'\x{5C41}\x{5C42}\x{5C43}\x{5C44}\x{5C45}\x{5C46}\x{5C47}\x{5C48}\x{5C49}' .
+'\x{5C4A}\x{5C4B}\x{5C4C}\x{5C4D}\x{5C4E}\x{5C4F}\x{5C50}\x{5C51}\x{5C52}' .
+'\x{5C53}\x{5C54}\x{5C55}\x{5C56}\x{5C57}\x{5C58}\x{5C59}\x{5C5B}\x{5C5C}' .
+'\x{5C5D}\x{5C5E}\x{5C5F}\x{5C60}\x{5C61}\x{5C62}\x{5C63}\x{5C64}\x{5C65}' .
+'\x{5C66}\x{5C67}\x{5C68}\x{5C69}\x{5C6A}\x{5C6B}\x{5C6C}\x{5C6D}\x{5C6E}' .
+'\x{5C6F}\x{5C70}\x{5C71}\x{5C72}\x{5C73}\x{5C74}\x{5C75}\x{5C76}\x{5C77}' .
+'\x{5C78}\x{5C79}\x{5C7A}\x{5C7B}\x{5C7C}\x{5C7D}\x{5C7E}\x{5C7F}\x{5C80}' .
+'\x{5C81}\x{5C82}\x{5C83}\x{5C84}\x{5C86}\x{5C87}\x{5C88}\x{5C89}\x{5C8A}' .
+'\x{5C8B}\x{5C8C}\x{5C8D}\x{5C8E}\x{5C8F}\x{5C90}\x{5C91}\x{5C92}\x{5C93}' .
+'\x{5C94}\x{5C95}\x{5C96}\x{5C97}\x{5C98}\x{5C99}\x{5C9A}\x{5C9B}\x{5C9C}' .
+'\x{5C9D}\x{5C9E}\x{5C9F}\x{5CA0}\x{5CA1}\x{5CA2}\x{5CA3}\x{5CA4}\x{5CA5}' .
+'\x{5CA6}\x{5CA7}\x{5CA8}\x{5CA9}\x{5CAA}\x{5CAB}\x{5CAC}\x{5CAD}\x{5CAE}' .
+'\x{5CAF}\x{5CB0}\x{5CB1}\x{5CB2}\x{5CB3}\x{5CB5}\x{5CB6}\x{5CB7}\x{5CB8}' .
+'\x{5CBA}\x{5CBB}\x{5CBC}\x{5CBD}\x{5CBE}\x{5CBF}\x{5CC1}\x{5CC2}\x{5CC3}' .
+'\x{5CC4}\x{5CC5}\x{5CC6}\x{5CC7}\x{5CC8}\x{5CC9}\x{5CCA}\x{5CCB}\x{5CCC}' .
+'\x{5CCD}\x{5CCE}\x{5CCF}\x{5CD0}\x{5CD1}\x{5CD2}\x{5CD3}\x{5CD4}\x{5CD6}' .
+'\x{5CD7}\x{5CD8}\x{5CD9}\x{5CDA}\x{5CDB}\x{5CDC}\x{5CDE}\x{5CDF}\x{5CE0}' .
+'\x{5CE1}\x{5CE2}\x{5CE3}\x{5CE4}\x{5CE5}\x{5CE6}\x{5CE7}\x{5CE8}\x{5CE9}' .
+'\x{5CEA}\x{5CEB}\x{5CEC}\x{5CED}\x{5CEE}\x{5CEF}\x{5CF0}\x{5CF1}\x{5CF2}' .
+'\x{5CF3}\x{5CF4}\x{5CF6}\x{5CF7}\x{5CF8}\x{5CF9}\x{5CFA}\x{5CFB}\x{5CFC}' .
+'\x{5CFD}\x{5CFE}\x{5CFF}\x{5D00}\x{5D01}\x{5D02}\x{5D03}\x{5D04}\x{5D05}' .
+'\x{5D06}\x{5D07}\x{5D08}\x{5D09}\x{5D0A}\x{5D0B}\x{5D0C}\x{5D0D}\x{5D0E}' .
+'\x{5D0F}\x{5D10}\x{5D11}\x{5D12}\x{5D13}\x{5D14}\x{5D15}\x{5D16}\x{5D17}' .
+'\x{5D18}\x{5D19}\x{5D1A}\x{5D1B}\x{5D1C}\x{5D1D}\x{5D1E}\x{5D1F}\x{5D20}' .
+'\x{5D21}\x{5D22}\x{5D23}\x{5D24}\x{5D25}\x{5D26}\x{5D27}\x{5D28}\x{5D29}' .
+'\x{5D2A}\x{5D2C}\x{5D2D}\x{5D2E}\x{5D30}\x{5D31}\x{5D32}\x{5D33}\x{5D34}' .
+'\x{5D35}\x{5D36}\x{5D37}\x{5D38}\x{5D39}\x{5D3A}\x{5D3C}\x{5D3D}\x{5D3E}' .
+'\x{5D3F}\x{5D40}\x{5D41}\x{5D42}\x{5D43}\x{5D44}\x{5D45}\x{5D46}\x{5D47}' .
+'\x{5D48}\x{5D49}\x{5D4A}\x{5D4B}\x{5D4C}\x{5D4D}\x{5D4E}\x{5D4F}\x{5D50}' .
+'\x{5D51}\x{5D52}\x{5D54}\x{5D55}\x{5D56}\x{5D58}\x{5D59}\x{5D5A}\x{5D5B}' .
+'\x{5D5D}\x{5D5E}\x{5D5F}\x{5D61}\x{5D62}\x{5D63}\x{5D64}\x{5D65}\x{5D66}' .
+'\x{5D67}\x{5D68}\x{5D69}\x{5D6A}\x{5D6B}\x{5D6C}\x{5D6D}\x{5D6E}\x{5D6F}' .
+'\x{5D70}\x{5D71}\x{5D72}\x{5D73}\x{5D74}\x{5D75}\x{5D76}\x{5D77}\x{5D78}' .
+'\x{5D79}\x{5D7A}\x{5D7B}\x{5D7C}\x{5D7D}\x{5D7E}\x{5D7F}\x{5D80}\x{5D81}' .
+'\x{5D82}\x{5D84}\x{5D85}\x{5D86}\x{5D87}\x{5D88}\x{5D89}\x{5D8A}\x{5D8B}' .
+'\x{5D8C}\x{5D8D}\x{5D8E}\x{5D8F}\x{5D90}\x{5D91}\x{5D92}\x{5D93}\x{5D94}' .
+'\x{5D95}\x{5D97}\x{5D98}\x{5D99}\x{5D9A}\x{5D9B}\x{5D9C}\x{5D9D}\x{5D9E}' .
+'\x{5D9F}\x{5DA0}\x{5DA1}\x{5DA2}\x{5DA5}\x{5DA6}\x{5DA7}\x{5DA8}\x{5DA9}' .
+'\x{5DAA}\x{5DAC}\x{5DAD}\x{5DAE}\x{5DAF}\x{5DB0}\x{5DB1}\x{5DB2}\x{5DB4}' .
+'\x{5DB5}\x{5DB6}\x{5DB7}\x{5DB8}\x{5DBA}\x{5DBB}\x{5DBC}\x{5DBD}\x{5DBE}' .
+'\x{5DBF}\x{5DC0}\x{5DC1}\x{5DC2}\x{5DC3}\x{5DC5}\x{5DC6}\x{5DC7}\x{5DC8}' .
+'\x{5DC9}\x{5DCA}\x{5DCB}\x{5DCC}\x{5DCD}\x{5DCE}\x{5DCF}\x{5DD0}\x{5DD1}' .
+'\x{5DD2}\x{5DD3}\x{5DD4}\x{5DD5}\x{5DD6}\x{5DD8}\x{5DD9}\x{5DDB}\x{5DDD}' .
+'\x{5DDE}\x{5DDF}\x{5DE0}\x{5DE1}\x{5DE2}\x{5DE3}\x{5DE4}\x{5DE5}\x{5DE6}' .
+'\x{5DE7}\x{5DE8}\x{5DE9}\x{5DEA}\x{5DEB}\x{5DEC}\x{5DED}\x{5DEE}\x{5DEF}' .
+'\x{5DF0}\x{5DF1}\x{5DF2}\x{5DF3}\x{5DF4}\x{5DF5}\x{5DF7}\x{5DF8}\x{5DF9}' .
+'\x{5DFA}\x{5DFB}\x{5DFC}\x{5DFD}\x{5DFE}\x{5DFF}\x{5E00}\x{5E01}\x{5E02}' .
+'\x{5E03}\x{5E04}\x{5E05}\x{5E06}\x{5E07}\x{5E08}\x{5E09}\x{5E0A}\x{5E0B}' .
+'\x{5E0C}\x{5E0D}\x{5E0E}\x{5E0F}\x{5E10}\x{5E11}\x{5E13}\x{5E14}\x{5E15}' .
+'\x{5E16}\x{5E17}\x{5E18}\x{5E19}\x{5E1A}\x{5E1B}\x{5E1C}\x{5E1D}\x{5E1E}' .
+'\x{5E1F}\x{5E20}\x{5E21}\x{5E22}\x{5E23}\x{5E24}\x{5E25}\x{5E26}\x{5E27}' .
+'\x{5E28}\x{5E29}\x{5E2A}\x{5E2B}\x{5E2C}\x{5E2D}\x{5E2E}\x{5E2F}\x{5E30}' .
+'\x{5E31}\x{5E32}\x{5E33}\x{5E34}\x{5E35}\x{5E36}\x{5E37}\x{5E38}\x{5E39}' .
+'\x{5E3A}\x{5E3B}\x{5E3C}\x{5E3D}\x{5E3E}\x{5E40}\x{5E41}\x{5E42}\x{5E43}' .
+'\x{5E44}\x{5E45}\x{5E46}\x{5E47}\x{5E49}\x{5E4A}\x{5E4B}\x{5E4C}\x{5E4D}' .
+'\x{5E4E}\x{5E4F}\x{5E50}\x{5E52}\x{5E53}\x{5E54}\x{5E55}\x{5E56}\x{5E57}' .
+'\x{5E58}\x{5E59}\x{5E5A}\x{5E5B}\x{5E5C}\x{5E5D}\x{5E5E}\x{5E5F}\x{5E60}' .
+'\x{5E61}\x{5E62}\x{5E63}\x{5E64}\x{5E65}\x{5E66}\x{5E67}\x{5E68}\x{5E69}' .
+'\x{5E6A}\x{5E6B}\x{5E6C}\x{5E6D}\x{5E6E}\x{5E6F}\x{5E70}\x{5E71}\x{5E72}' .
+'\x{5E73}\x{5E74}\x{5E75}\x{5E76}\x{5E77}\x{5E78}\x{5E79}\x{5E7A}\x{5E7B}' .
+'\x{5E7C}\x{5E7D}\x{5E7E}\x{5E7F}\x{5E80}\x{5E81}\x{5E82}\x{5E83}\x{5E84}' .
+'\x{5E85}\x{5E86}\x{5E87}\x{5E88}\x{5E89}\x{5E8A}\x{5E8B}\x{5E8C}\x{5E8D}' .
+'\x{5E8E}\x{5E8F}\x{5E90}\x{5E91}\x{5E93}\x{5E94}\x{5E95}\x{5E96}\x{5E97}' .
+'\x{5E98}\x{5E99}\x{5E9A}\x{5E9B}\x{5E9C}\x{5E9D}\x{5E9E}\x{5E9F}\x{5EA0}' .
+'\x{5EA1}\x{5EA2}\x{5EA3}\x{5EA4}\x{5EA5}\x{5EA6}\x{5EA7}\x{5EA8}\x{5EA9}' .
+'\x{5EAA}\x{5EAB}\x{5EAC}\x{5EAD}\x{5EAE}\x{5EAF}\x{5EB0}\x{5EB1}\x{5EB2}' .
+'\x{5EB3}\x{5EB4}\x{5EB5}\x{5EB6}\x{5EB7}\x{5EB8}\x{5EB9}\x{5EBB}\x{5EBC}' .
+'\x{5EBD}\x{5EBE}\x{5EBF}\x{5EC1}\x{5EC2}\x{5EC3}\x{5EC4}\x{5EC5}\x{5EC6}' .
+'\x{5EC7}\x{5EC8}\x{5EC9}\x{5ECA}\x{5ECB}\x{5ECC}\x{5ECD}\x{5ECE}\x{5ECF}' .
+'\x{5ED0}\x{5ED1}\x{5ED2}\x{5ED3}\x{5ED4}\x{5ED5}\x{5ED6}\x{5ED7}\x{5ED8}' .
+'\x{5ED9}\x{5EDA}\x{5EDB}\x{5EDC}\x{5EDD}\x{5EDE}\x{5EDF}\x{5EE0}\x{5EE1}' .
+'\x{5EE2}\x{5EE3}\x{5EE4}\x{5EE5}\x{5EE6}\x{5EE7}\x{5EE8}\x{5EE9}\x{5EEA}' .
+'\x{5EEC}\x{5EED}\x{5EEE}\x{5EEF}\x{5EF0}\x{5EF1}\x{5EF2}\x{5EF3}\x{5EF4}' .
+'\x{5EF5}\x{5EF6}\x{5EF7}\x{5EF8}\x{5EFA}\x{5EFB}\x{5EFC}\x{5EFD}\x{5EFE}' .
+'\x{5EFF}\x{5F00}\x{5F01}\x{5F02}\x{5F03}\x{5F04}\x{5F05}\x{5F06}\x{5F07}' .
+'\x{5F08}\x{5F0A}\x{5F0B}\x{5F0C}\x{5F0D}\x{5F0F}\x{5F11}\x{5F12}\x{5F13}' .
+'\x{5F14}\x{5F15}\x{5F16}\x{5F17}\x{5F18}\x{5F19}\x{5F1A}\x{5F1B}\x{5F1C}' .
+'\x{5F1D}\x{5F1E}\x{5F1F}\x{5F20}\x{5F21}\x{5F22}\x{5F23}\x{5F24}\x{5F25}' .
+'\x{5F26}\x{5F27}\x{5F28}\x{5F29}\x{5F2A}\x{5F2B}\x{5F2C}\x{5F2D}\x{5F2E}' .
+'\x{5F2F}\x{5F30}\x{5F31}\x{5F32}\x{5F33}\x{5F34}\x{5F35}\x{5F36}\x{5F37}' .
+'\x{5F38}\x{5F39}\x{5F3A}\x{5F3C}\x{5F3E}\x{5F3F}\x{5F40}\x{5F41}\x{5F42}' .
+'\x{5F43}\x{5F44}\x{5F45}\x{5F46}\x{5F47}\x{5F48}\x{5F49}\x{5F4A}\x{5F4B}' .
+'\x{5F4C}\x{5F4D}\x{5F4E}\x{5F4F}\x{5F50}\x{5F51}\x{5F52}\x{5F53}\x{5F54}' .
+'\x{5F55}\x{5F56}\x{5F57}\x{5F58}\x{5F59}\x{5F5A}\x{5F5B}\x{5F5C}\x{5F5D}' .
+'\x{5F5E}\x{5F5F}\x{5F60}\x{5F61}\x{5F62}\x{5F63}\x{5F64}\x{5F65}\x{5F66}' .
+'\x{5F67}\x{5F68}\x{5F69}\x{5F6A}\x{5F6B}\x{5F6C}\x{5F6D}\x{5F6E}\x{5F6F}' .
+'\x{5F70}\x{5F71}\x{5F72}\x{5F73}\x{5F74}\x{5F75}\x{5F76}\x{5F77}\x{5F78}' .
+'\x{5F79}\x{5F7A}\x{5F7B}\x{5F7C}\x{5F7D}\x{5F7E}\x{5F7F}\x{5F80}\x{5F81}' .
+'\x{5F82}\x{5F83}\x{5F84}\x{5F85}\x{5F86}\x{5F87}\x{5F88}\x{5F89}\x{5F8A}' .
+'\x{5F8B}\x{5F8C}\x{5F8D}\x{5F8E}\x{5F90}\x{5F91}\x{5F92}\x{5F93}\x{5F94}' .
+'\x{5F95}\x{5F96}\x{5F97}\x{5F98}\x{5F99}\x{5F9B}\x{5F9C}\x{5F9D}\x{5F9E}' .
+'\x{5F9F}\x{5FA0}\x{5FA1}\x{5FA2}\x{5FA5}\x{5FA6}\x{5FA7}\x{5FA8}\x{5FA9}' .
+'\x{5FAA}\x{5FAB}\x{5FAC}\x{5FAD}\x{5FAE}\x{5FAF}\x{5FB1}\x{5FB2}\x{5FB3}' .
+'\x{5FB4}\x{5FB5}\x{5FB6}\x{5FB7}\x{5FB8}\x{5FB9}\x{5FBA}\x{5FBB}\x{5FBC}' .
+'\x{5FBD}\x{5FBE}\x{5FBF}\x{5FC0}\x{5FC1}\x{5FC3}\x{5FC4}\x{5FC5}\x{5FC6}' .
+'\x{5FC7}\x{5FC8}\x{5FC9}\x{5FCA}\x{5FCB}\x{5FCC}\x{5FCD}\x{5FCF}\x{5FD0}' .
+'\x{5FD1}\x{5FD2}\x{5FD3}\x{5FD4}\x{5FD5}\x{5FD6}\x{5FD7}\x{5FD8}\x{5FD9}' .
+'\x{5FDA}\x{5FDC}\x{5FDD}\x{5FDE}\x{5FE0}\x{5FE1}\x{5FE3}\x{5FE4}\x{5FE5}' .
+'\x{5FE6}\x{5FE7}\x{5FE8}\x{5FE9}\x{5FEA}\x{5FEB}\x{5FED}\x{5FEE}\x{5FEF}' .
+'\x{5FF0}\x{5FF1}\x{5FF2}\x{5FF3}\x{5FF4}\x{5FF5}\x{5FF6}\x{5FF7}\x{5FF8}' .
+'\x{5FF9}\x{5FFA}\x{5FFB}\x{5FFD}\x{5FFE}\x{5FFF}\x{6000}\x{6001}\x{6002}' .
+'\x{6003}\x{6004}\x{6005}\x{6006}\x{6007}\x{6008}\x{6009}\x{600A}\x{600B}' .
+'\x{600C}\x{600D}\x{600E}\x{600F}\x{6010}\x{6011}\x{6012}\x{6013}\x{6014}' .
+'\x{6015}\x{6016}\x{6017}\x{6018}\x{6019}\x{601A}\x{601B}\x{601C}\x{601D}' .
+'\x{601E}\x{601F}\x{6020}\x{6021}\x{6022}\x{6024}\x{6025}\x{6026}\x{6027}' .
+'\x{6028}\x{6029}\x{602A}\x{602B}\x{602C}\x{602D}\x{602E}\x{602F}\x{6030}' .
+'\x{6031}\x{6032}\x{6033}\x{6034}\x{6035}\x{6036}\x{6037}\x{6038}\x{6039}' .
+'\x{603A}\x{603B}\x{603C}\x{603D}\x{603E}\x{603F}\x{6040}\x{6041}\x{6042}' .
+'\x{6043}\x{6044}\x{6045}\x{6046}\x{6047}\x{6048}\x{6049}\x{604A}\x{604B}' .
+'\x{604C}\x{604D}\x{604E}\x{604F}\x{6050}\x{6051}\x{6052}\x{6053}\x{6054}' .
+'\x{6055}\x{6057}\x{6058}\x{6059}\x{605A}\x{605B}\x{605C}\x{605D}\x{605E}' .
+'\x{605F}\x{6062}\x{6063}\x{6064}\x{6065}\x{6066}\x{6067}\x{6068}\x{6069}' .
+'\x{606A}\x{606B}\x{606C}\x{606D}\x{606E}\x{606F}\x{6070}\x{6072}\x{6073}' .
+'\x{6075}\x{6076}\x{6077}\x{6078}\x{6079}\x{607A}\x{607B}\x{607C}\x{607D}' .
+'\x{607E}\x{607F}\x{6080}\x{6081}\x{6082}\x{6083}\x{6084}\x{6085}\x{6086}' .
+'\x{6087}\x{6088}\x{6089}\x{608A}\x{608B}\x{608C}\x{608D}\x{608E}\x{608F}' .
+'\x{6090}\x{6092}\x{6094}\x{6095}\x{6096}\x{6097}\x{6098}\x{6099}\x{609A}' .
+'\x{609B}\x{609C}\x{609D}\x{609E}\x{609F}\x{60A0}\x{60A1}\x{60A2}\x{60A3}' .
+'\x{60A4}\x{60A6}\x{60A7}\x{60A8}\x{60AA}\x{60AB}\x{60AC}\x{60AD}\x{60AE}' .
+'\x{60AF}\x{60B0}\x{60B1}\x{60B2}\x{60B3}\x{60B4}\x{60B5}\x{60B6}\x{60B7}' .
+'\x{60B8}\x{60B9}\x{60BA}\x{60BB}\x{60BC}\x{60BD}\x{60BE}\x{60BF}\x{60C0}' .
+'\x{60C1}\x{60C2}\x{60C3}\x{60C4}\x{60C5}\x{60C6}\x{60C7}\x{60C8}\x{60C9}' .
+'\x{60CA}\x{60CB}\x{60CC}\x{60CD}\x{60CE}\x{60CF}\x{60D0}\x{60D1}\x{60D3}' .
+'\x{60D4}\x{60D5}\x{60D7}\x{60D8}\x{60D9}\x{60DA}\x{60DB}\x{60DC}\x{60DD}' .
+'\x{60DF}\x{60E0}\x{60E1}\x{60E2}\x{60E4}\x{60E6}\x{60E7}\x{60E8}\x{60E9}' .
+'\x{60EA}\x{60EB}\x{60EC}\x{60ED}\x{60EE}\x{60EF}\x{60F0}\x{60F1}\x{60F2}' .
+'\x{60F3}\x{60F4}\x{60F5}\x{60F6}\x{60F7}\x{60F8}\x{60F9}\x{60FA}\x{60FB}' .
+'\x{60FC}\x{60FE}\x{60FF}\x{6100}\x{6101}\x{6103}\x{6104}\x{6105}\x{6106}' .
+'\x{6108}\x{6109}\x{610A}\x{610B}\x{610C}\x{610D}\x{610E}\x{610F}\x{6110}' .
+'\x{6112}\x{6113}\x{6114}\x{6115}\x{6116}\x{6117}\x{6118}\x{6119}\x{611A}' .
+'\x{611B}\x{611C}\x{611D}\x{611F}\x{6120}\x{6122}\x{6123}\x{6124}\x{6125}' .
+'\x{6126}\x{6127}\x{6128}\x{6129}\x{612A}\x{612B}\x{612C}\x{612D}\x{612E}' .
+'\x{612F}\x{6130}\x{6132}\x{6134}\x{6136}\x{6137}\x{613A}\x{613B}\x{613C}' .
+'\x{613D}\x{613E}\x{613F}\x{6140}\x{6141}\x{6142}\x{6143}\x{6144}\x{6145}' .
+'\x{6146}\x{6147}\x{6148}\x{6149}\x{614A}\x{614B}\x{614C}\x{614D}\x{614E}' .
+'\x{614F}\x{6150}\x{6151}\x{6152}\x{6153}\x{6154}\x{6155}\x{6156}\x{6157}' .
+'\x{6158}\x{6159}\x{615A}\x{615B}\x{615C}\x{615D}\x{615E}\x{615F}\x{6161}' .
+'\x{6162}\x{6163}\x{6164}\x{6165}\x{6166}\x{6167}\x{6168}\x{6169}\x{616A}' .
+'\x{616B}\x{616C}\x{616D}\x{616E}\x{6170}\x{6171}\x{6172}\x{6173}\x{6174}' .
+'\x{6175}\x{6176}\x{6177}\x{6178}\x{6179}\x{617A}\x{617C}\x{617E}\x{6180}' .
+'\x{6181}\x{6182}\x{6183}\x{6184}\x{6185}\x{6187}\x{6188}\x{6189}\x{618A}' .
+'\x{618B}\x{618C}\x{618D}\x{618E}\x{618F}\x{6190}\x{6191}\x{6192}\x{6193}' .
+'\x{6194}\x{6195}\x{6196}\x{6198}\x{6199}\x{619A}\x{619B}\x{619D}\x{619E}' .
+'\x{619F}\x{61A0}\x{61A1}\x{61A2}\x{61A3}\x{61A4}\x{61A5}\x{61A6}\x{61A7}' .
+'\x{61A8}\x{61A9}\x{61AA}\x{61AB}\x{61AC}\x{61AD}\x{61AE}\x{61AF}\x{61B0}' .
+'\x{61B1}\x{61B2}\x{61B3}\x{61B4}\x{61B5}\x{61B6}\x{61B7}\x{61B8}\x{61BA}' .
+'\x{61BC}\x{61BD}\x{61BE}\x{61BF}\x{61C0}\x{61C1}\x{61C2}\x{61C3}\x{61C4}' .
+'\x{61C5}\x{61C6}\x{61C7}\x{61C8}\x{61C9}\x{61CA}\x{61CB}\x{61CC}\x{61CD}' .
+'\x{61CE}\x{61CF}\x{61D0}\x{61D1}\x{61D2}\x{61D4}\x{61D6}\x{61D7}\x{61D8}' .
+'\x{61D9}\x{61DA}\x{61DB}\x{61DC}\x{61DD}\x{61DE}\x{61DF}\x{61E0}\x{61E1}' .
+'\x{61E2}\x{61E3}\x{61E4}\x{61E5}\x{61E6}\x{61E7}\x{61E8}\x{61E9}\x{61EA}' .
+'\x{61EB}\x{61ED}\x{61EE}\x{61F0}\x{61F1}\x{61F2}\x{61F3}\x{61F5}\x{61F6}' .
+'\x{61F7}\x{61F8}\x{61F9}\x{61FA}\x{61FB}\x{61FC}\x{61FD}\x{61FE}\x{61FF}' .
+'\x{6200}\x{6201}\x{6202}\x{6203}\x{6204}\x{6206}\x{6207}\x{6208}\x{6209}' .
+'\x{620A}\x{620B}\x{620C}\x{620D}\x{620E}\x{620F}\x{6210}\x{6211}\x{6212}' .
+'\x{6213}\x{6214}\x{6215}\x{6216}\x{6217}\x{6218}\x{6219}\x{621A}\x{621B}' .
+'\x{621C}\x{621D}\x{621E}\x{621F}\x{6220}\x{6221}\x{6222}\x{6223}\x{6224}' .
+'\x{6225}\x{6226}\x{6227}\x{6228}\x{6229}\x{622A}\x{622B}\x{622C}\x{622D}' .
+'\x{622E}\x{622F}\x{6230}\x{6231}\x{6232}\x{6233}\x{6234}\x{6236}\x{6237}' .
+'\x{6238}\x{623A}\x{623B}\x{623C}\x{623D}\x{623E}\x{623F}\x{6240}\x{6241}' .
+'\x{6242}\x{6243}\x{6244}\x{6245}\x{6246}\x{6247}\x{6248}\x{6249}\x{624A}' .
+'\x{624B}\x{624C}\x{624D}\x{624E}\x{624F}\x{6250}\x{6251}\x{6252}\x{6253}' .
+'\x{6254}\x{6255}\x{6256}\x{6258}\x{6259}\x{625A}\x{625B}\x{625C}\x{625D}' .
+'\x{625E}\x{625F}\x{6260}\x{6261}\x{6262}\x{6263}\x{6264}\x{6265}\x{6266}' .
+'\x{6267}\x{6268}\x{6269}\x{626A}\x{626B}\x{626C}\x{626D}\x{626E}\x{626F}' .
+'\x{6270}\x{6271}\x{6272}\x{6273}\x{6274}\x{6275}\x{6276}\x{6277}\x{6278}' .
+'\x{6279}\x{627A}\x{627B}\x{627C}\x{627D}\x{627E}\x{627F}\x{6280}\x{6281}' .
+'\x{6283}\x{6284}\x{6285}\x{6286}\x{6287}\x{6288}\x{6289}\x{628A}\x{628B}' .
+'\x{628C}\x{628E}\x{628F}\x{6290}\x{6291}\x{6292}\x{6293}\x{6294}\x{6295}' .
+'\x{6296}\x{6297}\x{6298}\x{6299}\x{629A}\x{629B}\x{629C}\x{629E}\x{629F}' .
+'\x{62A0}\x{62A1}\x{62A2}\x{62A3}\x{62A4}\x{62A5}\x{62A7}\x{62A8}\x{62A9}' .
+'\x{62AA}\x{62AB}\x{62AC}\x{62AD}\x{62AE}\x{62AF}\x{62B0}\x{62B1}\x{62B2}' .
+'\x{62B3}\x{62B4}\x{62B5}\x{62B6}\x{62B7}\x{62B8}\x{62B9}\x{62BA}\x{62BB}' .
+'\x{62BC}\x{62BD}\x{62BE}\x{62BF}\x{62C0}\x{62C1}\x{62C2}\x{62C3}\x{62C4}' .
+'\x{62C5}\x{62C6}\x{62C7}\x{62C8}\x{62C9}\x{62CA}\x{62CB}\x{62CC}\x{62CD}' .
+'\x{62CE}\x{62CF}\x{62D0}\x{62D1}\x{62D2}\x{62D3}\x{62D4}\x{62D5}\x{62D6}' .
+'\x{62D7}\x{62D8}\x{62D9}\x{62DA}\x{62DB}\x{62DC}\x{62DD}\x{62DF}\x{62E0}' .
+'\x{62E1}\x{62E2}\x{62E3}\x{62E4}\x{62E5}\x{62E6}\x{62E7}\x{62E8}\x{62E9}' .
+'\x{62EB}\x{62EC}\x{62ED}\x{62EE}\x{62EF}\x{62F0}\x{62F1}\x{62F2}\x{62F3}' .
+'\x{62F4}\x{62F5}\x{62F6}\x{62F7}\x{62F8}\x{62F9}\x{62FA}\x{62FB}\x{62FC}' .
+'\x{62FD}\x{62FE}\x{62FF}\x{6300}\x{6301}\x{6302}\x{6303}\x{6304}\x{6305}' .
+'\x{6306}\x{6307}\x{6308}\x{6309}\x{630B}\x{630C}\x{630D}\x{630E}\x{630F}' .
+'\x{6310}\x{6311}\x{6312}\x{6313}\x{6314}\x{6315}\x{6316}\x{6318}\x{6319}' .
+'\x{631A}\x{631B}\x{631C}\x{631D}\x{631E}\x{631F}\x{6320}\x{6321}\x{6322}' .
+'\x{6323}\x{6324}\x{6325}\x{6326}\x{6327}\x{6328}\x{6329}\x{632A}\x{632B}' .
+'\x{632C}\x{632D}\x{632E}\x{632F}\x{6330}\x{6332}\x{6333}\x{6334}\x{6336}' .
+'\x{6338}\x{6339}\x{633A}\x{633B}\x{633C}\x{633D}\x{633E}\x{6340}\x{6341}' .
+'\x{6342}\x{6343}\x{6344}\x{6345}\x{6346}\x{6347}\x{6348}\x{6349}\x{634A}' .
+'\x{634B}\x{634C}\x{634D}\x{634E}\x{634F}\x{6350}\x{6351}\x{6352}\x{6353}' .
+'\x{6354}\x{6355}\x{6356}\x{6357}\x{6358}\x{6359}\x{635A}\x{635C}\x{635D}' .
+'\x{635E}\x{635F}\x{6360}\x{6361}\x{6362}\x{6363}\x{6364}\x{6365}\x{6366}' .
+'\x{6367}\x{6368}\x{6369}\x{636A}\x{636B}\x{636C}\x{636D}\x{636E}\x{636F}' .
+'\x{6370}\x{6371}\x{6372}\x{6373}\x{6374}\x{6375}\x{6376}\x{6377}\x{6378}' .
+'\x{6379}\x{637A}\x{637B}\x{637C}\x{637D}\x{637E}\x{6380}\x{6381}\x{6382}' .
+'\x{6383}\x{6384}\x{6385}\x{6386}\x{6387}\x{6388}\x{6389}\x{638A}\x{638C}' .
+'\x{638D}\x{638E}\x{638F}\x{6390}\x{6391}\x{6392}\x{6394}\x{6395}\x{6396}' .
+'\x{6397}\x{6398}\x{6399}\x{639A}\x{639B}\x{639C}\x{639D}\x{639E}\x{639F}' .
+'\x{63A0}\x{63A1}\x{63A2}\x{63A3}\x{63A4}\x{63A5}\x{63A6}\x{63A7}\x{63A8}' .
+'\x{63A9}\x{63AA}\x{63AB}\x{63AC}\x{63AD}\x{63AE}\x{63AF}\x{63B0}\x{63B1}' .
+'\x{63B2}\x{63B3}\x{63B4}\x{63B5}\x{63B6}\x{63B7}\x{63B8}\x{63B9}\x{63BA}' .
+'\x{63BC}\x{63BD}\x{63BE}\x{63BF}\x{63C0}\x{63C1}\x{63C2}\x{63C3}\x{63C4}' .
+'\x{63C5}\x{63C6}\x{63C7}\x{63C8}\x{63C9}\x{63CA}\x{63CB}\x{63CC}\x{63CD}' .
+'\x{63CE}\x{63CF}\x{63D0}\x{63D2}\x{63D3}\x{63D4}\x{63D5}\x{63D6}\x{63D7}' .
+'\x{63D8}\x{63D9}\x{63DA}\x{63DB}\x{63DC}\x{63DD}\x{63DE}\x{63DF}\x{63E0}' .
+'\x{63E1}\x{63E2}\x{63E3}\x{63E4}\x{63E5}\x{63E6}\x{63E7}\x{63E8}\x{63E9}' .
+'\x{63EA}\x{63EB}\x{63EC}\x{63ED}\x{63EE}\x{63EF}\x{63F0}\x{63F1}\x{63F2}' .
+'\x{63F3}\x{63F4}\x{63F5}\x{63F6}\x{63F7}\x{63F8}\x{63F9}\x{63FA}\x{63FB}' .
+'\x{63FC}\x{63FD}\x{63FE}\x{63FF}\x{6400}\x{6401}\x{6402}\x{6403}\x{6404}' .
+'\x{6405}\x{6406}\x{6408}\x{6409}\x{640A}\x{640B}\x{640C}\x{640D}\x{640E}' .
+'\x{640F}\x{6410}\x{6411}\x{6412}\x{6413}\x{6414}\x{6415}\x{6416}\x{6417}' .
+'\x{6418}\x{6419}\x{641A}\x{641B}\x{641C}\x{641D}\x{641E}\x{641F}\x{6420}' .
+'\x{6421}\x{6422}\x{6423}\x{6424}\x{6425}\x{6426}\x{6427}\x{6428}\x{6429}' .
+'\x{642A}\x{642B}\x{642C}\x{642D}\x{642E}\x{642F}\x{6430}\x{6431}\x{6432}' .
+'\x{6433}\x{6434}\x{6435}\x{6436}\x{6437}\x{6438}\x{6439}\x{643A}\x{643D}' .
+'\x{643E}\x{643F}\x{6440}\x{6441}\x{6443}\x{6444}\x{6445}\x{6446}\x{6447}' .
+'\x{6448}\x{644A}\x{644B}\x{644C}\x{644D}\x{644E}\x{644F}\x{6450}\x{6451}' .
+'\x{6452}\x{6453}\x{6454}\x{6455}\x{6456}\x{6457}\x{6458}\x{6459}\x{645B}' .
+'\x{645C}\x{645D}\x{645E}\x{645F}\x{6460}\x{6461}\x{6462}\x{6463}\x{6464}' .
+'\x{6465}\x{6466}\x{6467}\x{6468}\x{6469}\x{646A}\x{646B}\x{646C}\x{646D}' .
+'\x{646E}\x{646F}\x{6470}\x{6471}\x{6472}\x{6473}\x{6474}\x{6475}\x{6476}' .
+'\x{6477}\x{6478}\x{6479}\x{647A}\x{647B}\x{647C}\x{647D}\x{647F}\x{6480}' .
+'\x{6481}\x{6482}\x{6483}\x{6484}\x{6485}\x{6487}\x{6488}\x{6489}\x{648A}' .
+'\x{648B}\x{648C}\x{648D}\x{648E}\x{648F}\x{6490}\x{6491}\x{6492}\x{6493}' .
+'\x{6494}\x{6495}\x{6496}\x{6497}\x{6498}\x{6499}\x{649A}\x{649B}\x{649C}' .
+'\x{649D}\x{649E}\x{649F}\x{64A0}\x{64A2}\x{64A3}\x{64A4}\x{64A5}\x{64A6}' .
+'\x{64A7}\x{64A8}\x{64A9}\x{64AA}\x{64AB}\x{64AC}\x{64AD}\x{64AE}\x{64B0}' .
+'\x{64B1}\x{64B2}\x{64B3}\x{64B4}\x{64B5}\x{64B7}\x{64B8}\x{64B9}\x{64BA}' .
+'\x{64BB}\x{64BC}\x{64BD}\x{64BE}\x{64BF}\x{64C0}\x{64C1}\x{64C2}\x{64C3}' .
+'\x{64C4}\x{64C5}\x{64C6}\x{64C7}\x{64C9}\x{64CA}\x{64CB}\x{64CC}\x{64CD}' .
+'\x{64CE}\x{64CF}\x{64D0}\x{64D1}\x{64D2}\x{64D3}\x{64D4}\x{64D6}\x{64D7}' .
+'\x{64D8}\x{64D9}\x{64DA}\x{64DB}\x{64DC}\x{64DD}\x{64DE}\x{64DF}\x{64E0}' .
+'\x{64E2}\x{64E3}\x{64E4}\x{64E6}\x{64E7}\x{64E8}\x{64E9}\x{64EA}\x{64EB}' .
+'\x{64EC}\x{64ED}\x{64EF}\x{64F0}\x{64F1}\x{64F2}\x{64F3}\x{64F4}\x{64F6}' .
+'\x{64F7}\x{64F8}\x{64FA}\x{64FB}\x{64FC}\x{64FD}\x{64FE}\x{64FF}\x{6500}' .
+'\x{6501}\x{6503}\x{6504}\x{6505}\x{6506}\x{6507}\x{6508}\x{6509}\x{650B}' .
+'\x{650C}\x{650D}\x{650E}\x{650F}\x{6510}\x{6511}\x{6512}\x{6513}\x{6514}' .
+'\x{6515}\x{6516}\x{6517}\x{6518}\x{6519}\x{651A}\x{651B}\x{651C}\x{651D}' .
+'\x{651E}\x{6520}\x{6521}\x{6522}\x{6523}\x{6524}\x{6525}\x{6526}\x{6527}' .
+'\x{6529}\x{652A}\x{652B}\x{652C}\x{652D}\x{652E}\x{652F}\x{6530}\x{6531}' .
+'\x{6532}\x{6533}\x{6534}\x{6535}\x{6536}\x{6537}\x{6538}\x{6539}\x{653A}' .
+'\x{653B}\x{653C}\x{653D}\x{653E}\x{653F}\x{6541}\x{6543}\x{6544}\x{6545}' .
+'\x{6546}\x{6547}\x{6548}\x{6549}\x{654A}\x{654B}\x{654C}\x{654D}\x{654E}' .
+'\x{654F}\x{6550}\x{6551}\x{6552}\x{6553}\x{6554}\x{6555}\x{6556}\x{6557}' .
+'\x{6558}\x{6559}\x{655B}\x{655C}\x{655D}\x{655E}\x{6560}\x{6561}\x{6562}' .
+'\x{6563}\x{6564}\x{6565}\x{6566}\x{6567}\x{6568}\x{6569}\x{656A}\x{656B}' .
+'\x{656C}\x{656E}\x{656F}\x{6570}\x{6571}\x{6572}\x{6573}\x{6574}\x{6575}' .
+'\x{6576}\x{6577}\x{6578}\x{6579}\x{657A}\x{657B}\x{657C}\x{657E}\x{657F}' .
+'\x{6580}\x{6581}\x{6582}\x{6583}\x{6584}\x{6585}\x{6586}\x{6587}\x{6588}' .
+'\x{6589}\x{658B}\x{658C}\x{658D}\x{658E}\x{658F}\x{6590}\x{6591}\x{6592}' .
+'\x{6593}\x{6594}\x{6595}\x{6596}\x{6597}\x{6598}\x{6599}\x{659B}\x{659C}' .
+'\x{659D}\x{659E}\x{659F}\x{65A0}\x{65A1}\x{65A2}\x{65A3}\x{65A4}\x{65A5}' .
+'\x{65A6}\x{65A7}\x{65A8}\x{65A9}\x{65AA}\x{65AB}\x{65AC}\x{65AD}\x{65AE}' .
+'\x{65AF}\x{65B0}\x{65B1}\x{65B2}\x{65B3}\x{65B4}\x{65B6}\x{65B7}\x{65B8}' .
+'\x{65B9}\x{65BA}\x{65BB}\x{65BC}\x{65BD}\x{65BF}\x{65C0}\x{65C1}\x{65C2}' .
+'\x{65C3}\x{65C4}\x{65C5}\x{65C6}\x{65C7}\x{65CA}\x{65CB}\x{65CC}\x{65CD}' .
+'\x{65CE}\x{65CF}\x{65D0}\x{65D2}\x{65D3}\x{65D4}\x{65D5}\x{65D6}\x{65D7}' .
+'\x{65DA}\x{65DB}\x{65DD}\x{65DE}\x{65DF}\x{65E0}\x{65E1}\x{65E2}\x{65E3}' .
+'\x{65E5}\x{65E6}\x{65E7}\x{65E8}\x{65E9}\x{65EB}\x{65EC}\x{65ED}\x{65EE}' .
+'\x{65EF}\x{65F0}\x{65F1}\x{65F2}\x{65F3}\x{65F4}\x{65F5}\x{65F6}\x{65F7}' .
+'\x{65F8}\x{65FA}\x{65FB}\x{65FC}\x{65FD}\x{6600}\x{6601}\x{6602}\x{6603}' .
+'\x{6604}\x{6605}\x{6606}\x{6607}\x{6608}\x{6609}\x{660A}\x{660B}\x{660C}' .
+'\x{660D}\x{660E}\x{660F}\x{6610}\x{6611}\x{6612}\x{6613}\x{6614}\x{6615}' .
+'\x{6616}\x{6618}\x{6619}\x{661A}\x{661B}\x{661C}\x{661D}\x{661F}\x{6620}' .
+'\x{6621}\x{6622}\x{6623}\x{6624}\x{6625}\x{6626}\x{6627}\x{6628}\x{6629}' .
+'\x{662A}\x{662B}\x{662D}\x{662E}\x{662F}\x{6630}\x{6631}\x{6632}\x{6633}' .
+'\x{6634}\x{6635}\x{6636}\x{6639}\x{663A}\x{663C}\x{663D}\x{663E}\x{6640}' .
+'\x{6641}\x{6642}\x{6643}\x{6644}\x{6645}\x{6646}\x{6647}\x{6649}\x{664A}' .
+'\x{664B}\x{664C}\x{664E}\x{664F}\x{6650}\x{6651}\x{6652}\x{6653}\x{6654}' .
+'\x{6655}\x{6656}\x{6657}\x{6658}\x{6659}\x{665A}\x{665B}\x{665C}\x{665D}' .
+'\x{665E}\x{665F}\x{6661}\x{6662}\x{6664}\x{6665}\x{6666}\x{6668}\x{6669}' .
+'\x{666A}\x{666B}\x{666C}\x{666D}\x{666E}\x{666F}\x{6670}\x{6671}\x{6672}' .
+'\x{6673}\x{6674}\x{6675}\x{6676}\x{6677}\x{6678}\x{6679}\x{667A}\x{667B}' .
+'\x{667C}\x{667D}\x{667E}\x{667F}\x{6680}\x{6681}\x{6682}\x{6683}\x{6684}' .
+'\x{6685}\x{6686}\x{6687}\x{6688}\x{6689}\x{668A}\x{668B}\x{668C}\x{668D}' .
+'\x{668E}\x{668F}\x{6690}\x{6691}\x{6693}\x{6694}\x{6695}\x{6696}\x{6697}' .
+'\x{6698}\x{6699}\x{669A}\x{669B}\x{669D}\x{669F}\x{66A0}\x{66A1}\x{66A2}' .
+'\x{66A3}\x{66A4}\x{66A5}\x{66A6}\x{66A7}\x{66A8}\x{66A9}\x{66AA}\x{66AB}' .
+'\x{66AE}\x{66AF}\x{66B0}\x{66B1}\x{66B2}\x{66B3}\x{66B4}\x{66B5}\x{66B6}' .
+'\x{66B7}\x{66B8}\x{66B9}\x{66BA}\x{66BB}\x{66BC}\x{66BD}\x{66BE}\x{66BF}' .
+'\x{66C0}\x{66C1}\x{66C2}\x{66C3}\x{66C4}\x{66C5}\x{66C6}\x{66C7}\x{66C8}' .
+'\x{66C9}\x{66CA}\x{66CB}\x{66CC}\x{66CD}\x{66CE}\x{66CF}\x{66D1}\x{66D2}' .
+'\x{66D4}\x{66D5}\x{66D6}\x{66D8}\x{66D9}\x{66DA}\x{66DB}\x{66DC}\x{66DD}' .
+'\x{66DE}\x{66E0}\x{66E1}\x{66E2}\x{66E3}\x{66E4}\x{66E5}\x{66E6}\x{66E7}' .
+'\x{66E8}\x{66E9}\x{66EA}\x{66EB}\x{66EC}\x{66ED}\x{66EE}\x{66F0}\x{66F1}' .
+'\x{66F2}\x{66F3}\x{66F4}\x{66F5}\x{66F6}\x{66F7}\x{66F8}\x{66F9}\x{66FA}' .
+'\x{66FB}\x{66FC}\x{66FE}\x{66FF}\x{6700}\x{6701}\x{6703}\x{6704}\x{6705}' .
+'\x{6706}\x{6708}\x{6709}\x{670A}\x{670B}\x{670C}\x{670D}\x{670E}\x{670F}' .
+'\x{6710}\x{6711}\x{6712}\x{6713}\x{6714}\x{6715}\x{6716}\x{6717}\x{6718}' .
+'\x{671A}\x{671B}\x{671C}\x{671D}\x{671E}\x{671F}\x{6720}\x{6721}\x{6722}' .
+'\x{6723}\x{6725}\x{6726}\x{6727}\x{6728}\x{672A}\x{672B}\x{672C}\x{672D}' .
+'\x{672E}\x{672F}\x{6730}\x{6731}\x{6732}\x{6733}\x{6734}\x{6735}\x{6736}' .
+'\x{6737}\x{6738}\x{6739}\x{673A}\x{673B}\x{673C}\x{673D}\x{673E}\x{673F}' .
+'\x{6740}\x{6741}\x{6742}\x{6743}\x{6744}\x{6745}\x{6746}\x{6747}\x{6748}' .
+'\x{6749}\x{674A}\x{674B}\x{674C}\x{674D}\x{674E}\x{674F}\x{6750}\x{6751}' .
+'\x{6752}\x{6753}\x{6754}\x{6755}\x{6756}\x{6757}\x{6758}\x{6759}\x{675A}' .
+'\x{675B}\x{675C}\x{675D}\x{675E}\x{675F}\x{6760}\x{6761}\x{6762}\x{6763}' .
+'\x{6764}\x{6765}\x{6766}\x{6768}\x{6769}\x{676A}\x{676B}\x{676C}\x{676D}' .
+'\x{676E}\x{676F}\x{6770}\x{6771}\x{6772}\x{6773}\x{6774}\x{6775}\x{6776}' .
+'\x{6777}\x{6778}\x{6779}\x{677A}\x{677B}\x{677C}\x{677D}\x{677E}\x{677F}' .
+'\x{6780}\x{6781}\x{6782}\x{6783}\x{6784}\x{6785}\x{6786}\x{6787}\x{6789}' .
+'\x{678A}\x{678B}\x{678C}\x{678D}\x{678E}\x{678F}\x{6790}\x{6791}\x{6792}' .
+'\x{6793}\x{6794}\x{6795}\x{6797}\x{6798}\x{6799}\x{679A}\x{679B}\x{679C}' .
+'\x{679D}\x{679E}\x{679F}\x{67A0}\x{67A1}\x{67A2}\x{67A3}\x{67A4}\x{67A5}' .
+'\x{67A6}\x{67A7}\x{67A8}\x{67AA}\x{67AB}\x{67AC}\x{67AD}\x{67AE}\x{67AF}' .
+'\x{67B0}\x{67B1}\x{67B2}\x{67B3}\x{67B4}\x{67B5}\x{67B6}\x{67B7}\x{67B8}' .
+'\x{67B9}\x{67BA}\x{67BB}\x{67BC}\x{67BE}\x{67C0}\x{67C1}\x{67C2}\x{67C3}' .
+'\x{67C4}\x{67C5}\x{67C6}\x{67C7}\x{67C8}\x{67C9}\x{67CA}\x{67CB}\x{67CC}' .
+'\x{67CD}\x{67CE}\x{67CF}\x{67D0}\x{67D1}\x{67D2}\x{67D3}\x{67D4}\x{67D6}' .
+'\x{67D8}\x{67D9}\x{67DA}\x{67DB}\x{67DC}\x{67DD}\x{67DE}\x{67DF}\x{67E0}' .
+'\x{67E1}\x{67E2}\x{67E3}\x{67E4}\x{67E5}\x{67E6}\x{67E7}\x{67E8}\x{67E9}' .
+'\x{67EA}\x{67EB}\x{67EC}\x{67ED}\x{67EE}\x{67EF}\x{67F0}\x{67F1}\x{67F2}' .
+'\x{67F3}\x{67F4}\x{67F5}\x{67F6}\x{67F7}\x{67F8}\x{67FA}\x{67FB}\x{67FC}' .
+'\x{67FD}\x{67FE}\x{67FF}\x{6800}\x{6802}\x{6803}\x{6804}\x{6805}\x{6806}' .
+'\x{6807}\x{6808}\x{6809}\x{680A}\x{680B}\x{680C}\x{680D}\x{680E}\x{680F}' .
+'\x{6810}\x{6811}\x{6812}\x{6813}\x{6814}\x{6816}\x{6817}\x{6818}\x{6819}' .
+'\x{681A}\x{681B}\x{681C}\x{681D}\x{681F}\x{6820}\x{6821}\x{6822}\x{6823}' .
+'\x{6824}\x{6825}\x{6826}\x{6828}\x{6829}\x{682A}\x{682B}\x{682C}\x{682D}' .
+'\x{682E}\x{682F}\x{6831}\x{6832}\x{6833}\x{6834}\x{6835}\x{6836}\x{6837}' .
+'\x{6838}\x{6839}\x{683A}\x{683B}\x{683C}\x{683D}\x{683E}\x{683F}\x{6840}' .
+'\x{6841}\x{6842}\x{6843}\x{6844}\x{6845}\x{6846}\x{6847}\x{6848}\x{6849}' .
+'\x{684A}\x{684B}\x{684C}\x{684D}\x{684E}\x{684F}\x{6850}\x{6851}\x{6852}' .
+'\x{6853}\x{6854}\x{6855}\x{6856}\x{6857}\x{685B}\x{685D}\x{6860}\x{6861}' .
+'\x{6862}\x{6863}\x{6864}\x{6865}\x{6866}\x{6867}\x{6868}\x{6869}\x{686A}' .
+'\x{686B}\x{686C}\x{686D}\x{686E}\x{686F}\x{6870}\x{6871}\x{6872}\x{6873}' .
+'\x{6874}\x{6875}\x{6876}\x{6877}\x{6878}\x{6879}\x{687B}\x{687C}\x{687D}' .
+'\x{687E}\x{687F}\x{6880}\x{6881}\x{6882}\x{6883}\x{6884}\x{6885}\x{6886}' .
+'\x{6887}\x{6888}\x{6889}\x{688A}\x{688B}\x{688C}\x{688D}\x{688E}\x{688F}' .
+'\x{6890}\x{6891}\x{6892}\x{6893}\x{6894}\x{6896}\x{6897}\x{6898}\x{689A}' .
+'\x{689B}\x{689C}\x{689D}\x{689E}\x{689F}\x{68A0}\x{68A1}\x{68A2}\x{68A3}' .
+'\x{68A4}\x{68A6}\x{68A7}\x{68A8}\x{68A9}\x{68AA}\x{68AB}\x{68AC}\x{68AD}' .
+'\x{68AE}\x{68AF}\x{68B0}\x{68B1}\x{68B2}\x{68B3}\x{68B4}\x{68B5}\x{68B6}' .
+'\x{68B7}\x{68B9}\x{68BB}\x{68BC}\x{68BD}\x{68BE}\x{68BF}\x{68C0}\x{68C1}' .
+'\x{68C2}\x{68C4}\x{68C6}\x{68C7}\x{68C8}\x{68C9}\x{68CA}\x{68CB}\x{68CC}' .
+'\x{68CD}\x{68CE}\x{68CF}\x{68D0}\x{68D1}\x{68D2}\x{68D3}\x{68D4}\x{68D5}' .
+'\x{68D6}\x{68D7}\x{68D8}\x{68DA}\x{68DB}\x{68DC}\x{68DD}\x{68DE}\x{68DF}' .
+'\x{68E0}\x{68E1}\x{68E3}\x{68E4}\x{68E6}\x{68E7}\x{68E8}\x{68E9}\x{68EA}' .
+'\x{68EB}\x{68EC}\x{68ED}\x{68EE}\x{68EF}\x{68F0}\x{68F1}\x{68F2}\x{68F3}' .
+'\x{68F4}\x{68F5}\x{68F6}\x{68F7}\x{68F8}\x{68F9}\x{68FA}\x{68FB}\x{68FC}' .
+'\x{68FD}\x{68FE}\x{68FF}\x{6901}\x{6902}\x{6903}\x{6904}\x{6905}\x{6906}' .
+'\x{6907}\x{6908}\x{690A}\x{690B}\x{690C}\x{690D}\x{690E}\x{690F}\x{6910}' .
+'\x{6911}\x{6912}\x{6913}\x{6914}\x{6915}\x{6916}\x{6917}\x{6918}\x{6919}' .
+'\x{691A}\x{691B}\x{691C}\x{691D}\x{691E}\x{691F}\x{6920}\x{6921}\x{6922}' .
+'\x{6923}\x{6924}\x{6925}\x{6926}\x{6927}\x{6928}\x{6929}\x{692A}\x{692B}' .
+'\x{692C}\x{692D}\x{692E}\x{692F}\x{6930}\x{6931}\x{6932}\x{6933}\x{6934}' .
+'\x{6935}\x{6936}\x{6937}\x{6938}\x{6939}\x{693A}\x{693B}\x{693C}\x{693D}' .
+'\x{693F}\x{6940}\x{6941}\x{6942}\x{6943}\x{6944}\x{6945}\x{6946}\x{6947}' .
+'\x{6948}\x{6949}\x{694A}\x{694B}\x{694C}\x{694E}\x{694F}\x{6950}\x{6951}' .
+'\x{6952}\x{6953}\x{6954}\x{6955}\x{6956}\x{6957}\x{6958}\x{6959}\x{695A}' .
+'\x{695B}\x{695C}\x{695D}\x{695E}\x{695F}\x{6960}\x{6961}\x{6962}\x{6963}' .
+'\x{6964}\x{6965}\x{6966}\x{6967}\x{6968}\x{6969}\x{696A}\x{696B}\x{696C}' .
+'\x{696D}\x{696E}\x{696F}\x{6970}\x{6971}\x{6972}\x{6973}\x{6974}\x{6975}' .
+'\x{6976}\x{6977}\x{6978}\x{6979}\x{697A}\x{697B}\x{697C}\x{697D}\x{697E}' .
+'\x{697F}\x{6980}\x{6981}\x{6982}\x{6983}\x{6984}\x{6985}\x{6986}\x{6987}' .
+'\x{6988}\x{6989}\x{698A}\x{698B}\x{698C}\x{698D}\x{698E}\x{698F}\x{6990}' .
+'\x{6991}\x{6992}\x{6993}\x{6994}\x{6995}\x{6996}\x{6997}\x{6998}\x{6999}' .
+'\x{699A}\x{699B}\x{699C}\x{699D}\x{699E}\x{69A0}\x{69A1}\x{69A3}\x{69A4}' .
+'\x{69A5}\x{69A6}\x{69A7}\x{69A8}\x{69A9}\x{69AA}\x{69AB}\x{69AC}\x{69AD}' .
+'\x{69AE}\x{69AF}\x{69B0}\x{69B1}\x{69B2}\x{69B3}\x{69B4}\x{69B5}\x{69B6}' .
+'\x{69B7}\x{69B8}\x{69B9}\x{69BA}\x{69BB}\x{69BC}\x{69BD}\x{69BE}\x{69BF}' .
+'\x{69C1}\x{69C2}\x{69C3}\x{69C4}\x{69C5}\x{69C6}\x{69C7}\x{69C8}\x{69C9}' .
+'\x{69CA}\x{69CB}\x{69CC}\x{69CD}\x{69CE}\x{69CF}\x{69D0}\x{69D3}\x{69D4}' .
+'\x{69D8}\x{69D9}\x{69DA}\x{69DB}\x{69DC}\x{69DD}\x{69DE}\x{69DF}\x{69E0}' .
+'\x{69E1}\x{69E2}\x{69E3}\x{69E4}\x{69E5}\x{69E6}\x{69E7}\x{69E8}\x{69E9}' .
+'\x{69EA}\x{69EB}\x{69EC}\x{69ED}\x{69EE}\x{69EF}\x{69F0}\x{69F1}\x{69F2}' .
+'\x{69F3}\x{69F4}\x{69F5}\x{69F6}\x{69F7}\x{69F8}\x{69FA}\x{69FB}\x{69FC}' .
+'\x{69FD}\x{69FE}\x{69FF}\x{6A00}\x{6A01}\x{6A02}\x{6A04}\x{6A05}\x{6A06}' .
+'\x{6A07}\x{6A08}\x{6A09}\x{6A0A}\x{6A0B}\x{6A0D}\x{6A0E}\x{6A0F}\x{6A10}' .
+'\x{6A11}\x{6A12}\x{6A13}\x{6A14}\x{6A15}\x{6A16}\x{6A17}\x{6A18}\x{6A19}' .
+'\x{6A1A}\x{6A1B}\x{6A1D}\x{6A1E}\x{6A1F}\x{6A20}\x{6A21}\x{6A22}\x{6A23}' .
+'\x{6A25}\x{6A26}\x{6A27}\x{6A28}\x{6A29}\x{6A2A}\x{6A2B}\x{6A2C}\x{6A2D}' .
+'\x{6A2E}\x{6A2F}\x{6A30}\x{6A31}\x{6A32}\x{6A33}\x{6A34}\x{6A35}\x{6A36}' .
+'\x{6A38}\x{6A39}\x{6A3A}\x{6A3B}\x{6A3C}\x{6A3D}\x{6A3E}\x{6A3F}\x{6A40}' .
+'\x{6A41}\x{6A42}\x{6A43}\x{6A44}\x{6A45}\x{6A46}\x{6A47}\x{6A48}\x{6A49}' .
+'\x{6A4B}\x{6A4C}\x{6A4D}\x{6A4E}\x{6A4F}\x{6A50}\x{6A51}\x{6A52}\x{6A54}' .
+'\x{6A55}\x{6A56}\x{6A57}\x{6A58}\x{6A59}\x{6A5A}\x{6A5B}\x{6A5D}\x{6A5E}' .
+'\x{6A5F}\x{6A60}\x{6A61}\x{6A62}\x{6A63}\x{6A64}\x{6A65}\x{6A66}\x{6A67}' .
+'\x{6A68}\x{6A69}\x{6A6A}\x{6A6B}\x{6A6C}\x{6A6D}\x{6A6F}\x{6A71}\x{6A72}' .
+'\x{6A73}\x{6A74}\x{6A75}\x{6A76}\x{6A77}\x{6A78}\x{6A79}\x{6A7A}\x{6A7B}' .
+'\x{6A7C}\x{6A7D}\x{6A7E}\x{6A7F}\x{6A80}\x{6A81}\x{6A82}\x{6A83}\x{6A84}' .
+'\x{6A85}\x{6A87}\x{6A88}\x{6A89}\x{6A8B}\x{6A8C}\x{6A8D}\x{6A8E}\x{6A90}' .
+'\x{6A91}\x{6A92}\x{6A93}\x{6A94}\x{6A95}\x{6A96}\x{6A97}\x{6A98}\x{6A9A}' .
+'\x{6A9B}\x{6A9C}\x{6A9E}\x{6A9F}\x{6AA0}\x{6AA1}\x{6AA2}\x{6AA3}\x{6AA4}' .
+'\x{6AA5}\x{6AA6}\x{6AA7}\x{6AA8}\x{6AA9}\x{6AAB}\x{6AAC}\x{6AAD}\x{6AAE}' .
+'\x{6AAF}\x{6AB0}\x{6AB2}\x{6AB3}\x{6AB4}\x{6AB5}\x{6AB6}\x{6AB7}\x{6AB8}' .
+'\x{6AB9}\x{6ABA}\x{6ABB}\x{6ABC}\x{6ABD}\x{6ABF}\x{6AC1}\x{6AC2}\x{6AC3}' .
+'\x{6AC5}\x{6AC6}\x{6AC7}\x{6ACA}\x{6ACB}\x{6ACC}\x{6ACD}\x{6ACE}\x{6ACF}' .
+'\x{6AD0}\x{6AD1}\x{6AD2}\x{6AD3}\x{6AD4}\x{6AD5}\x{6AD6}\x{6AD7}\x{6AD9}' .
+'\x{6ADA}\x{6ADB}\x{6ADC}\x{6ADD}\x{6ADE}\x{6ADF}\x{6AE0}\x{6AE1}\x{6AE2}' .
+'\x{6AE3}\x{6AE4}\x{6AE5}\x{6AE6}\x{6AE7}\x{6AE8}\x{6AEA}\x{6AEB}\x{6AEC}' .
+'\x{6AED}\x{6AEE}\x{6AEF}\x{6AF0}\x{6AF1}\x{6AF2}\x{6AF3}\x{6AF4}\x{6AF5}' .
+'\x{6AF6}\x{6AF7}\x{6AF8}\x{6AF9}\x{6AFA}\x{6AFB}\x{6AFC}\x{6AFD}\x{6AFE}' .
+'\x{6AFF}\x{6B00}\x{6B01}\x{6B02}\x{6B03}\x{6B04}\x{6B05}\x{6B06}\x{6B07}' .
+'\x{6B08}\x{6B09}\x{6B0A}\x{6B0B}\x{6B0C}\x{6B0D}\x{6B0F}\x{6B10}\x{6B11}' .
+'\x{6B12}\x{6B13}\x{6B14}\x{6B15}\x{6B16}\x{6B17}\x{6B18}\x{6B19}\x{6B1A}' .
+'\x{6B1C}\x{6B1D}\x{6B1E}\x{6B1F}\x{6B20}\x{6B21}\x{6B22}\x{6B23}\x{6B24}' .
+'\x{6B25}\x{6B26}\x{6B27}\x{6B28}\x{6B29}\x{6B2A}\x{6B2B}\x{6B2C}\x{6B2D}' .
+'\x{6B2F}\x{6B30}\x{6B31}\x{6B32}\x{6B33}\x{6B34}\x{6B36}\x{6B37}\x{6B38}' .
+'\x{6B39}\x{6B3A}\x{6B3B}\x{6B3C}\x{6B3D}\x{6B3E}\x{6B3F}\x{6B41}\x{6B42}' .
+'\x{6B43}\x{6B44}\x{6B45}\x{6B46}\x{6B47}\x{6B48}\x{6B49}\x{6B4A}\x{6B4B}' .
+'\x{6B4C}\x{6B4D}\x{6B4E}\x{6B4F}\x{6B50}\x{6B51}\x{6B52}\x{6B53}\x{6B54}' .
+'\x{6B55}\x{6B56}\x{6B59}\x{6B5A}\x{6B5B}\x{6B5C}\x{6B5E}\x{6B5F}\x{6B60}' .
+'\x{6B61}\x{6B62}\x{6B63}\x{6B64}\x{6B65}\x{6B66}\x{6B67}\x{6B69}\x{6B6A}' .
+'\x{6B6B}\x{6B6D}\x{6B6F}\x{6B70}\x{6B72}\x{6B73}\x{6B74}\x{6B76}\x{6B77}' .
+'\x{6B78}\x{6B79}\x{6B7A}\x{6B7B}\x{6B7C}\x{6B7E}\x{6B7F}\x{6B80}\x{6B81}' .
+'\x{6B82}\x{6B83}\x{6B84}\x{6B85}\x{6B86}\x{6B87}\x{6B88}\x{6B89}\x{6B8A}' .
+'\x{6B8B}\x{6B8C}\x{6B8D}\x{6B8E}\x{6B8F}\x{6B90}\x{6B91}\x{6B92}\x{6B93}' .
+'\x{6B94}\x{6B95}\x{6B96}\x{6B97}\x{6B98}\x{6B99}\x{6B9A}\x{6B9B}\x{6B9C}' .
+'\x{6B9D}\x{6B9E}\x{6B9F}\x{6BA0}\x{6BA1}\x{6BA2}\x{6BA3}\x{6BA4}\x{6BA5}' .
+'\x{6BA6}\x{6BA7}\x{6BA8}\x{6BA9}\x{6BAA}\x{6BAB}\x{6BAC}\x{6BAD}\x{6BAE}' .
+'\x{6BAF}\x{6BB0}\x{6BB2}\x{6BB3}\x{6BB4}\x{6BB5}\x{6BB6}\x{6BB7}\x{6BB9}' .
+'\x{6BBA}\x{6BBB}\x{6BBC}\x{6BBD}\x{6BBE}\x{6BBF}\x{6BC0}\x{6BC1}\x{6BC2}' .
+'\x{6BC3}\x{6BC4}\x{6BC5}\x{6BC6}\x{6BC7}\x{6BC8}\x{6BC9}\x{6BCA}\x{6BCB}' .
+'\x{6BCC}\x{6BCD}\x{6BCE}\x{6BCF}\x{6BD0}\x{6BD1}\x{6BD2}\x{6BD3}\x{6BD4}' .
+'\x{6BD5}\x{6BD6}\x{6BD7}\x{6BD8}\x{6BD9}\x{6BDA}\x{6BDB}\x{6BDC}\x{6BDD}' .
+'\x{6BDE}\x{6BDF}\x{6BE0}\x{6BE1}\x{6BE2}\x{6BE3}\x{6BE4}\x{6BE5}\x{6BE6}' .
+'\x{6BE7}\x{6BE8}\x{6BEA}\x{6BEB}\x{6BEC}\x{6BED}\x{6BEE}\x{6BEF}\x{6BF0}' .
+'\x{6BF2}\x{6BF3}\x{6BF5}\x{6BF6}\x{6BF7}\x{6BF8}\x{6BF9}\x{6BFB}\x{6BFC}' .
+'\x{6BFD}\x{6BFE}\x{6BFF}\x{6C00}\x{6C01}\x{6C02}\x{6C03}\x{6C04}\x{6C05}' .
+'\x{6C06}\x{6C07}\x{6C08}\x{6C09}\x{6C0B}\x{6C0C}\x{6C0D}\x{6C0E}\x{6C0F}' .
+'\x{6C10}\x{6C11}\x{6C12}\x{6C13}\x{6C14}\x{6C15}\x{6C16}\x{6C18}\x{6C19}' .
+'\x{6C1A}\x{6C1B}\x{6C1D}\x{6C1E}\x{6C1F}\x{6C20}\x{6C21}\x{6C22}\x{6C23}' .
+'\x{6C24}\x{6C25}\x{6C26}\x{6C27}\x{6C28}\x{6C29}\x{6C2A}\x{6C2B}\x{6C2C}' .
+'\x{6C2E}\x{6C2F}\x{6C30}\x{6C31}\x{6C32}\x{6C33}\x{6C34}\x{6C35}\x{6C36}' .
+'\x{6C37}\x{6C38}\x{6C3A}\x{6C3B}\x{6C3D}\x{6C3E}\x{6C3F}\x{6C40}\x{6C41}' .
+'\x{6C42}\x{6C43}\x{6C44}\x{6C46}\x{6C47}\x{6C48}\x{6C49}\x{6C4A}\x{6C4B}' .
+'\x{6C4C}\x{6C4D}\x{6C4E}\x{6C4F}\x{6C50}\x{6C51}\x{6C52}\x{6C53}\x{6C54}' .
+'\x{6C55}\x{6C56}\x{6C57}\x{6C58}\x{6C59}\x{6C5A}\x{6C5B}\x{6C5C}\x{6C5D}' .
+'\x{6C5E}\x{6C5F}\x{6C60}\x{6C61}\x{6C62}\x{6C63}\x{6C64}\x{6C65}\x{6C66}' .
+'\x{6C67}\x{6C68}\x{6C69}\x{6C6A}\x{6C6B}\x{6C6D}\x{6C6F}\x{6C70}\x{6C71}' .
+'\x{6C72}\x{6C73}\x{6C74}\x{6C75}\x{6C76}\x{6C77}\x{6C78}\x{6C79}\x{6C7A}' .
+'\x{6C7B}\x{6C7C}\x{6C7D}\x{6C7E}\x{6C7F}\x{6C80}\x{6C81}\x{6C82}\x{6C83}' .
+'\x{6C84}\x{6C85}\x{6C86}\x{6C87}\x{6C88}\x{6C89}\x{6C8A}\x{6C8B}\x{6C8C}' .
+'\x{6C8D}\x{6C8E}\x{6C8F}\x{6C90}\x{6C91}\x{6C92}\x{6C93}\x{6C94}\x{6C95}' .
+'\x{6C96}\x{6C97}\x{6C98}\x{6C99}\x{6C9A}\x{6C9B}\x{6C9C}\x{6C9D}\x{6C9E}' .
+'\x{6C9F}\x{6CA1}\x{6CA2}\x{6CA3}\x{6CA4}\x{6CA5}\x{6CA6}\x{6CA7}\x{6CA8}' .
+'\x{6CA9}\x{6CAA}\x{6CAB}\x{6CAC}\x{6CAD}\x{6CAE}\x{6CAF}\x{6CB0}\x{6CB1}' .
+'\x{6CB2}\x{6CB3}\x{6CB4}\x{6CB5}\x{6CB6}\x{6CB7}\x{6CB8}\x{6CB9}\x{6CBA}' .
+'\x{6CBB}\x{6CBC}\x{6CBD}\x{6CBE}\x{6CBF}\x{6CC0}\x{6CC1}\x{6CC2}\x{6CC3}' .
+'\x{6CC4}\x{6CC5}\x{6CC6}\x{6CC7}\x{6CC8}\x{6CC9}\x{6CCA}\x{6CCB}\x{6CCC}' .
+'\x{6CCD}\x{6CCE}\x{6CCF}\x{6CD0}\x{6CD1}\x{6CD2}\x{6CD3}\x{6CD4}\x{6CD5}' .
+'\x{6CD6}\x{6CD7}\x{6CD9}\x{6CDA}\x{6CDB}\x{6CDC}\x{6CDD}\x{6CDE}\x{6CDF}' .
+'\x{6CE0}\x{6CE1}\x{6CE2}\x{6CE3}\x{6CE4}\x{6CE5}\x{6CE6}\x{6CE7}\x{6CE8}' .
+'\x{6CE9}\x{6CEA}\x{6CEB}\x{6CEC}\x{6CED}\x{6CEE}\x{6CEF}\x{6CF0}\x{6CF1}' .
+'\x{6CF2}\x{6CF3}\x{6CF5}\x{6CF6}\x{6CF7}\x{6CF8}\x{6CF9}\x{6CFA}\x{6CFB}' .
+'\x{6CFC}\x{6CFD}\x{6CFE}\x{6CFF}\x{6D00}\x{6D01}\x{6D03}\x{6D04}\x{6D05}' .
+'\x{6D06}\x{6D07}\x{6D08}\x{6D09}\x{6D0A}\x{6D0B}\x{6D0C}\x{6D0D}\x{6D0E}' .
+'\x{6D0F}\x{6D10}\x{6D11}\x{6D12}\x{6D13}\x{6D14}\x{6D15}\x{6D16}\x{6D17}' .
+'\x{6D18}\x{6D19}\x{6D1A}\x{6D1B}\x{6D1D}\x{6D1E}\x{6D1F}\x{6D20}\x{6D21}' .
+'\x{6D22}\x{6D23}\x{6D25}\x{6D26}\x{6D27}\x{6D28}\x{6D29}\x{6D2A}\x{6D2B}' .
+'\x{6D2C}\x{6D2D}\x{6D2E}\x{6D2F}\x{6D30}\x{6D31}\x{6D32}\x{6D33}\x{6D34}' .
+'\x{6D35}\x{6D36}\x{6D37}\x{6D38}\x{6D39}\x{6D3A}\x{6D3B}\x{6D3C}\x{6D3D}' .
+'\x{6D3E}\x{6D3F}\x{6D40}\x{6D41}\x{6D42}\x{6D43}\x{6D44}\x{6D45}\x{6D46}' .
+'\x{6D47}\x{6D48}\x{6D49}\x{6D4A}\x{6D4B}\x{6D4C}\x{6D4D}\x{6D4E}\x{6D4F}' .
+'\x{6D50}\x{6D51}\x{6D52}\x{6D53}\x{6D54}\x{6D55}\x{6D56}\x{6D57}\x{6D58}' .
+'\x{6D59}\x{6D5A}\x{6D5B}\x{6D5C}\x{6D5D}\x{6D5E}\x{6D5F}\x{6D60}\x{6D61}' .
+'\x{6D62}\x{6D63}\x{6D64}\x{6D65}\x{6D66}\x{6D67}\x{6D68}\x{6D69}\x{6D6A}' .
+'\x{6D6B}\x{6D6C}\x{6D6D}\x{6D6E}\x{6D6F}\x{6D70}\x{6D72}\x{6D73}\x{6D74}' .
+'\x{6D75}\x{6D76}\x{6D77}\x{6D78}\x{6D79}\x{6D7A}\x{6D7B}\x{6D7C}\x{6D7D}' .
+'\x{6D7E}\x{6D7F}\x{6D80}\x{6D82}\x{6D83}\x{6D84}\x{6D85}\x{6D86}\x{6D87}' .
+'\x{6D88}\x{6D89}\x{6D8A}\x{6D8B}\x{6D8C}\x{6D8D}\x{6D8E}\x{6D8F}\x{6D90}' .
+'\x{6D91}\x{6D92}\x{6D93}\x{6D94}\x{6D95}\x{6D97}\x{6D98}\x{6D99}\x{6D9A}' .
+'\x{6D9B}\x{6D9D}\x{6D9E}\x{6D9F}\x{6DA0}\x{6DA1}\x{6DA2}\x{6DA3}\x{6DA4}' .
+'\x{6DA5}\x{6DA6}\x{6DA7}\x{6DA8}\x{6DA9}\x{6DAA}\x{6DAB}\x{6DAC}\x{6DAD}' .
+'\x{6DAE}\x{6DAF}\x{6DB2}\x{6DB3}\x{6DB4}\x{6DB5}\x{6DB7}\x{6DB8}\x{6DB9}' .
+'\x{6DBA}\x{6DBB}\x{6DBC}\x{6DBD}\x{6DBE}\x{6DBF}\x{6DC0}\x{6DC1}\x{6DC2}' .
+'\x{6DC3}\x{6DC4}\x{6DC5}\x{6DC6}\x{6DC7}\x{6DC8}\x{6DC9}\x{6DCA}\x{6DCB}' .
+'\x{6DCC}\x{6DCD}\x{6DCE}\x{6DCF}\x{6DD0}\x{6DD1}\x{6DD2}\x{6DD3}\x{6DD4}' .
+'\x{6DD5}\x{6DD6}\x{6DD7}\x{6DD8}\x{6DD9}\x{6DDA}\x{6DDB}\x{6DDC}\x{6DDD}' .
+'\x{6DDE}\x{6DDF}\x{6DE0}\x{6DE1}\x{6DE2}\x{6DE3}\x{6DE4}\x{6DE5}\x{6DE6}' .
+'\x{6DE7}\x{6DE8}\x{6DE9}\x{6DEA}\x{6DEB}\x{6DEC}\x{6DED}\x{6DEE}\x{6DEF}' .
+'\x{6DF0}\x{6DF1}\x{6DF2}\x{6DF3}\x{6DF4}\x{6DF5}\x{6DF6}\x{6DF7}\x{6DF8}' .
+'\x{6DF9}\x{6DFA}\x{6DFB}\x{6DFC}\x{6DFD}\x{6E00}\x{6E03}\x{6E04}\x{6E05}' .
+'\x{6E07}\x{6E08}\x{6E09}\x{6E0A}\x{6E0B}\x{6E0C}\x{6E0D}\x{6E0E}\x{6E0F}' .
+'\x{6E10}\x{6E11}\x{6E14}\x{6E15}\x{6E16}\x{6E17}\x{6E19}\x{6E1A}\x{6E1B}' .
+'\x{6E1C}\x{6E1D}\x{6E1E}\x{6E1F}\x{6E20}\x{6E21}\x{6E22}\x{6E23}\x{6E24}' .
+'\x{6E25}\x{6E26}\x{6E27}\x{6E28}\x{6E29}\x{6E2B}\x{6E2C}\x{6E2D}\x{6E2E}' .
+'\x{6E2F}\x{6E30}\x{6E31}\x{6E32}\x{6E33}\x{6E34}\x{6E35}\x{6E36}\x{6E37}' .
+'\x{6E38}\x{6E39}\x{6E3A}\x{6E3B}\x{6E3C}\x{6E3D}\x{6E3E}\x{6E3F}\x{6E40}' .
+'\x{6E41}\x{6E42}\x{6E43}\x{6E44}\x{6E45}\x{6E46}\x{6E47}\x{6E48}\x{6E49}' .
+'\x{6E4A}\x{6E4B}\x{6E4D}\x{6E4E}\x{6E4F}\x{6E50}\x{6E51}\x{6E52}\x{6E53}' .
+'\x{6E54}\x{6E55}\x{6E56}\x{6E57}\x{6E58}\x{6E59}\x{6E5A}\x{6E5B}\x{6E5C}' .
+'\x{6E5D}\x{6E5E}\x{6E5F}\x{6E60}\x{6E61}\x{6E62}\x{6E63}\x{6E64}\x{6E65}' .
+'\x{6E66}\x{6E67}\x{6E68}\x{6E69}\x{6E6A}\x{6E6B}\x{6E6D}\x{6E6E}\x{6E6F}' .
+'\x{6E70}\x{6E71}\x{6E72}\x{6E73}\x{6E74}\x{6E75}\x{6E77}\x{6E78}\x{6E79}' .
+'\x{6E7E}\x{6E7F}\x{6E80}\x{6E81}\x{6E82}\x{6E83}\x{6E84}\x{6E85}\x{6E86}' .
+'\x{6E87}\x{6E88}\x{6E89}\x{6E8A}\x{6E8D}\x{6E8E}\x{6E8F}\x{6E90}\x{6E91}' .
+'\x{6E92}\x{6E93}\x{6E94}\x{6E96}\x{6E97}\x{6E98}\x{6E99}\x{6E9A}\x{6E9B}' .
+'\x{6E9C}\x{6E9D}\x{6E9E}\x{6E9F}\x{6EA0}\x{6EA1}\x{6EA2}\x{6EA3}\x{6EA4}' .
+'\x{6EA5}\x{6EA6}\x{6EA7}\x{6EA8}\x{6EA9}\x{6EAA}\x{6EAB}\x{6EAC}\x{6EAD}' .
+'\x{6EAE}\x{6EAF}\x{6EB0}\x{6EB1}\x{6EB2}\x{6EB3}\x{6EB4}\x{6EB5}\x{6EB6}' .
+'\x{6EB7}\x{6EB8}\x{6EB9}\x{6EBA}\x{6EBB}\x{6EBC}\x{6EBD}\x{6EBE}\x{6EBF}' .
+'\x{6EC0}\x{6EC1}\x{6EC2}\x{6EC3}\x{6EC4}\x{6EC5}\x{6EC6}\x{6EC7}\x{6EC8}' .
+'\x{6EC9}\x{6ECA}\x{6ECB}\x{6ECC}\x{6ECD}\x{6ECE}\x{6ECF}\x{6ED0}\x{6ED1}' .
+'\x{6ED2}\x{6ED3}\x{6ED4}\x{6ED5}\x{6ED6}\x{6ED7}\x{6ED8}\x{6ED9}\x{6EDA}' .
+'\x{6EDC}\x{6EDE}\x{6EDF}\x{6EE0}\x{6EE1}\x{6EE2}\x{6EE4}\x{6EE5}\x{6EE6}' .
+'\x{6EE7}\x{6EE8}\x{6EE9}\x{6EEA}\x{6EEB}\x{6EEC}\x{6EED}\x{6EEE}\x{6EEF}' .
+'\x{6EF0}\x{6EF1}\x{6EF2}\x{6EF3}\x{6EF4}\x{6EF5}\x{6EF6}\x{6EF7}\x{6EF8}' .
+'\x{6EF9}\x{6EFA}\x{6EFB}\x{6EFC}\x{6EFD}\x{6EFE}\x{6EFF}\x{6F00}\x{6F01}' .
+'\x{6F02}\x{6F03}\x{6F05}\x{6F06}\x{6F07}\x{6F08}\x{6F09}\x{6F0A}\x{6F0C}' .
+'\x{6F0D}\x{6F0E}\x{6F0F}\x{6F10}\x{6F11}\x{6F12}\x{6F13}\x{6F14}\x{6F15}' .
+'\x{6F16}\x{6F17}\x{6F18}\x{6F19}\x{6F1A}\x{6F1B}\x{6F1C}\x{6F1D}\x{6F1E}' .
+'\x{6F1F}\x{6F20}\x{6F21}\x{6F22}\x{6F23}\x{6F24}\x{6F25}\x{6F26}\x{6F27}' .
+'\x{6F28}\x{6F29}\x{6F2A}\x{6F2B}\x{6F2C}\x{6F2D}\x{6F2E}\x{6F2F}\x{6F30}' .
+'\x{6F31}\x{6F32}\x{6F33}\x{6F34}\x{6F35}\x{6F36}\x{6F37}\x{6F38}\x{6F39}' .
+'\x{6F3A}\x{6F3B}\x{6F3C}\x{6F3D}\x{6F3E}\x{6F3F}\x{6F40}\x{6F41}\x{6F43}' .
+'\x{6F44}\x{6F45}\x{6F46}\x{6F47}\x{6F49}\x{6F4B}\x{6F4C}\x{6F4D}\x{6F4E}' .
+'\x{6F4F}\x{6F50}\x{6F51}\x{6F52}\x{6F53}\x{6F54}\x{6F55}\x{6F56}\x{6F57}' .
+'\x{6F58}\x{6F59}\x{6F5A}\x{6F5B}\x{6F5C}\x{6F5D}\x{6F5E}\x{6F5F}\x{6F60}' .
+'\x{6F61}\x{6F62}\x{6F63}\x{6F64}\x{6F65}\x{6F66}\x{6F67}\x{6F68}\x{6F69}' .
+'\x{6F6A}\x{6F6B}\x{6F6C}\x{6F6D}\x{6F6E}\x{6F6F}\x{6F70}\x{6F71}\x{6F72}' .
+'\x{6F73}\x{6F74}\x{6F75}\x{6F76}\x{6F77}\x{6F78}\x{6F7A}\x{6F7B}\x{6F7C}' .
+'\x{6F7D}\x{6F7E}\x{6F7F}\x{6F80}\x{6F81}\x{6F82}\x{6F83}\x{6F84}\x{6F85}' .
+'\x{6F86}\x{6F87}\x{6F88}\x{6F89}\x{6F8A}\x{6F8B}\x{6F8C}\x{6F8D}\x{6F8E}' .
+'\x{6F8F}\x{6F90}\x{6F91}\x{6F92}\x{6F93}\x{6F94}\x{6F95}\x{6F96}\x{6F97}' .
+'\x{6F99}\x{6F9B}\x{6F9C}\x{6F9D}\x{6F9E}\x{6FA0}\x{6FA1}\x{6FA2}\x{6FA3}' .
+'\x{6FA4}\x{6FA5}\x{6FA6}\x{6FA7}\x{6FA8}\x{6FA9}\x{6FAA}\x{6FAB}\x{6FAC}' .
+'\x{6FAD}\x{6FAE}\x{6FAF}\x{6FB0}\x{6FB1}\x{6FB2}\x{6FB3}\x{6FB4}\x{6FB5}' .
+'\x{6FB6}\x{6FB8}\x{6FB9}\x{6FBA}\x{6FBB}\x{6FBC}\x{6FBD}\x{6FBE}\x{6FBF}' .
+'\x{6FC0}\x{6FC1}\x{6FC2}\x{6FC3}\x{6FC4}\x{6FC6}\x{6FC7}\x{6FC8}\x{6FC9}' .
+'\x{6FCA}\x{6FCB}\x{6FCC}\x{6FCD}\x{6FCE}\x{6FCF}\x{6FD1}\x{6FD2}\x{6FD4}' .
+'\x{6FD5}\x{6FD6}\x{6FD7}\x{6FD8}\x{6FD9}\x{6FDA}\x{6FDB}\x{6FDC}\x{6FDD}' .
+'\x{6FDE}\x{6FDF}\x{6FE0}\x{6FE1}\x{6FE2}\x{6FE3}\x{6FE4}\x{6FE5}\x{6FE6}' .
+'\x{6FE7}\x{6FE8}\x{6FE9}\x{6FEA}\x{6FEB}\x{6FEC}\x{6FED}\x{6FEE}\x{6FEF}' .
+'\x{6FF0}\x{6FF1}\x{6FF2}\x{6FF3}\x{6FF4}\x{6FF6}\x{6FF7}\x{6FF8}\x{6FF9}' .
+'\x{6FFA}\x{6FFB}\x{6FFC}\x{6FFE}\x{6FFF}\x{7000}\x{7001}\x{7002}\x{7003}' .
+'\x{7004}\x{7005}\x{7006}\x{7007}\x{7008}\x{7009}\x{700A}\x{700B}\x{700C}' .
+'\x{700D}\x{700E}\x{700F}\x{7011}\x{7012}\x{7014}\x{7015}\x{7016}\x{7017}' .
+'\x{7018}\x{7019}\x{701A}\x{701B}\x{701C}\x{701D}\x{701F}\x{7020}\x{7021}' .
+'\x{7022}\x{7023}\x{7024}\x{7025}\x{7026}\x{7027}\x{7028}\x{7029}\x{702A}' .
+'\x{702B}\x{702C}\x{702D}\x{702E}\x{702F}\x{7030}\x{7031}\x{7032}\x{7033}' .
+'\x{7034}\x{7035}\x{7036}\x{7037}\x{7038}\x{7039}\x{703A}\x{703B}\x{703C}' .
+'\x{703D}\x{703E}\x{703F}\x{7040}\x{7041}\x{7042}\x{7043}\x{7044}\x{7045}' .
+'\x{7046}\x{7048}\x{7049}\x{704A}\x{704C}\x{704D}\x{704F}\x{7050}\x{7051}' .
+'\x{7052}\x{7053}\x{7054}\x{7055}\x{7056}\x{7057}\x{7058}\x{7059}\x{705A}' .
+'\x{705B}\x{705C}\x{705D}\x{705E}\x{705F}\x{7060}\x{7061}\x{7062}\x{7063}' .
+'\x{7064}\x{7065}\x{7066}\x{7067}\x{7068}\x{7069}\x{706A}\x{706B}\x{706C}' .
+'\x{706D}\x{706E}\x{706F}\x{7070}\x{7071}\x{7074}\x{7075}\x{7076}\x{7077}' .
+'\x{7078}\x{7079}\x{707A}\x{707C}\x{707D}\x{707E}\x{707F}\x{7080}\x{7082}' .
+'\x{7083}\x{7084}\x{7085}\x{7086}\x{7087}\x{7088}\x{7089}\x{708A}\x{708B}' .
+'\x{708C}\x{708E}\x{708F}\x{7090}\x{7091}\x{7092}\x{7093}\x{7094}\x{7095}' .
+'\x{7096}\x{7098}\x{7099}\x{709A}\x{709C}\x{709D}\x{709E}\x{709F}\x{70A0}' .
+'\x{70A1}\x{70A2}\x{70A3}\x{70A4}\x{70A5}\x{70A6}\x{70A7}\x{70A8}\x{70A9}' .
+'\x{70AB}\x{70AC}\x{70AD}\x{70AE}\x{70AF}\x{70B0}\x{70B1}\x{70B3}\x{70B4}' .
+'\x{70B5}\x{70B7}\x{70B8}\x{70B9}\x{70BA}\x{70BB}\x{70BC}\x{70BD}\x{70BE}' .
+'\x{70BF}\x{70C0}\x{70C1}\x{70C2}\x{70C3}\x{70C4}\x{70C5}\x{70C6}\x{70C7}' .
+'\x{70C8}\x{70C9}\x{70CA}\x{70CB}\x{70CC}\x{70CD}\x{70CE}\x{70CF}\x{70D0}' .
+'\x{70D1}\x{70D2}\x{70D3}\x{70D4}\x{70D6}\x{70D7}\x{70D8}\x{70D9}\x{70DA}' .
+'\x{70DB}\x{70DC}\x{70DD}\x{70DE}\x{70DF}\x{70E0}\x{70E1}\x{70E2}\x{70E3}' .
+'\x{70E4}\x{70E5}\x{70E6}\x{70E7}\x{70E8}\x{70E9}\x{70EA}\x{70EB}\x{70EC}' .
+'\x{70ED}\x{70EE}\x{70EF}\x{70F0}\x{70F1}\x{70F2}\x{70F3}\x{70F4}\x{70F5}' .
+'\x{70F6}\x{70F7}\x{70F8}\x{70F9}\x{70FA}\x{70FB}\x{70FC}\x{70FD}\x{70FF}' .
+'\x{7100}\x{7101}\x{7102}\x{7103}\x{7104}\x{7105}\x{7106}\x{7107}\x{7109}' .
+'\x{710A}\x{710B}\x{710C}\x{710D}\x{710E}\x{710F}\x{7110}\x{7111}\x{7112}' .
+'\x{7113}\x{7115}\x{7116}\x{7117}\x{7118}\x{7119}\x{711A}\x{711B}\x{711C}' .
+'\x{711D}\x{711E}\x{711F}\x{7120}\x{7121}\x{7122}\x{7123}\x{7125}\x{7126}' .
+'\x{7127}\x{7128}\x{7129}\x{712A}\x{712B}\x{712C}\x{712D}\x{712E}\x{712F}' .
+'\x{7130}\x{7131}\x{7132}\x{7135}\x{7136}\x{7137}\x{7138}\x{7139}\x{713A}' .
+'\x{713B}\x{713D}\x{713E}\x{713F}\x{7140}\x{7141}\x{7142}\x{7143}\x{7144}' .
+'\x{7145}\x{7146}\x{7147}\x{7148}\x{7149}\x{714A}\x{714B}\x{714C}\x{714D}' .
+'\x{714E}\x{714F}\x{7150}\x{7151}\x{7152}\x{7153}\x{7154}\x{7156}\x{7158}' .
+'\x{7159}\x{715A}\x{715B}\x{715C}\x{715D}\x{715E}\x{715F}\x{7160}\x{7161}' .
+'\x{7162}\x{7163}\x{7164}\x{7165}\x{7166}\x{7167}\x{7168}\x{7169}\x{716A}' .
+'\x{716C}\x{716E}\x{716F}\x{7170}\x{7171}\x{7172}\x{7173}\x{7174}\x{7175}' .
+'\x{7176}\x{7177}\x{7178}\x{7179}\x{717A}\x{717B}\x{717C}\x{717D}\x{717E}' .
+'\x{717F}\x{7180}\x{7181}\x{7182}\x{7183}\x{7184}\x{7185}\x{7186}\x{7187}' .
+'\x{7188}\x{7189}\x{718A}\x{718B}\x{718C}\x{718E}\x{718F}\x{7190}\x{7191}' .
+'\x{7192}\x{7193}\x{7194}\x{7195}\x{7197}\x{7198}\x{7199}\x{719A}\x{719B}' .
+'\x{719C}\x{719D}\x{719E}\x{719F}\x{71A0}\x{71A1}\x{71A2}\x{71A3}\x{71A4}' .
+'\x{71A5}\x{71A7}\x{71A8}\x{71A9}\x{71AA}\x{71AC}\x{71AD}\x{71AE}\x{71AF}' .
+'\x{71B0}\x{71B1}\x{71B2}\x{71B3}\x{71B4}\x{71B5}\x{71B7}\x{71B8}\x{71B9}' .
+'\x{71BA}\x{71BB}\x{71BC}\x{71BD}\x{71BE}\x{71BF}\x{71C0}\x{71C1}\x{71C2}' .
+'\x{71C3}\x{71C4}\x{71C5}\x{71C6}\x{71C7}\x{71C8}\x{71C9}\x{71CA}\x{71CB}' .
+'\x{71CD}\x{71CE}\x{71CF}\x{71D0}\x{71D1}\x{71D2}\x{71D4}\x{71D5}\x{71D6}' .
+'\x{71D7}\x{71D8}\x{71D9}\x{71DA}\x{71DB}\x{71DC}\x{71DD}\x{71DE}\x{71DF}' .
+'\x{71E0}\x{71E1}\x{71E2}\x{71E3}\x{71E4}\x{71E5}\x{71E6}\x{71E7}\x{71E8}' .
+'\x{71E9}\x{71EA}\x{71EB}\x{71EC}\x{71ED}\x{71EE}\x{71EF}\x{71F0}\x{71F1}' .
+'\x{71F2}\x{71F4}\x{71F5}\x{71F6}\x{71F7}\x{71F8}\x{71F9}\x{71FB}\x{71FC}' .
+'\x{71FD}\x{71FE}\x{71FF}\x{7201}\x{7202}\x{7203}\x{7204}\x{7205}\x{7206}' .
+'\x{7207}\x{7208}\x{7209}\x{720A}\x{720C}\x{720D}\x{720E}\x{720F}\x{7210}' .
+'\x{7212}\x{7213}\x{7214}\x{7216}\x{7218}\x{7219}\x{721A}\x{721B}\x{721C}' .
+'\x{721D}\x{721E}\x{721F}\x{7221}\x{7222}\x{7223}\x{7226}\x{7227}\x{7228}' .
+'\x{7229}\x{722A}\x{722B}\x{722C}\x{722D}\x{722E}\x{7230}\x{7231}\x{7232}' .
+'\x{7233}\x{7235}\x{7236}\x{7237}\x{7238}\x{7239}\x{723A}\x{723B}\x{723C}' .
+'\x{723D}\x{723E}\x{723F}\x{7240}\x{7241}\x{7242}\x{7243}\x{7244}\x{7246}' .
+'\x{7247}\x{7248}\x{7249}\x{724A}\x{724B}\x{724C}\x{724D}\x{724F}\x{7251}' .
+'\x{7252}\x{7253}\x{7254}\x{7256}\x{7257}\x{7258}\x{7259}\x{725A}\x{725B}' .
+'\x{725C}\x{725D}\x{725E}\x{725F}\x{7260}\x{7261}\x{7262}\x{7263}\x{7264}' .
+'\x{7265}\x{7266}\x{7267}\x{7268}\x{7269}\x{726A}\x{726B}\x{726C}\x{726D}' .
+'\x{726E}\x{726F}\x{7270}\x{7271}\x{7272}\x{7273}\x{7274}\x{7275}\x{7276}' .
+'\x{7277}\x{7278}\x{7279}\x{727A}\x{727B}\x{727C}\x{727D}\x{727E}\x{727F}' .
+'\x{7280}\x{7281}\x{7282}\x{7283}\x{7284}\x{7285}\x{7286}\x{7287}\x{7288}' .
+'\x{7289}\x{728A}\x{728B}\x{728C}\x{728D}\x{728E}\x{728F}\x{7290}\x{7291}' .
+'\x{7292}\x{7293}\x{7294}\x{7295}\x{7296}\x{7297}\x{7298}\x{7299}\x{729A}' .
+'\x{729B}\x{729C}\x{729D}\x{729E}\x{729F}\x{72A1}\x{72A2}\x{72A3}\x{72A4}' .
+'\x{72A5}\x{72A6}\x{72A7}\x{72A8}\x{72A9}\x{72AA}\x{72AC}\x{72AD}\x{72AE}' .
+'\x{72AF}\x{72B0}\x{72B1}\x{72B2}\x{72B3}\x{72B4}\x{72B5}\x{72B6}\x{72B7}' .
+'\x{72B8}\x{72B9}\x{72BA}\x{72BB}\x{72BC}\x{72BD}\x{72BF}\x{72C0}\x{72C1}' .
+'\x{72C2}\x{72C3}\x{72C4}\x{72C5}\x{72C6}\x{72C7}\x{72C8}\x{72C9}\x{72CA}' .
+'\x{72CB}\x{72CC}\x{72CD}\x{72CE}\x{72CF}\x{72D0}\x{72D1}\x{72D2}\x{72D3}' .
+'\x{72D4}\x{72D5}\x{72D6}\x{72D7}\x{72D8}\x{72D9}\x{72DA}\x{72DB}\x{72DC}' .
+'\x{72DD}\x{72DE}\x{72DF}\x{72E0}\x{72E1}\x{72E2}\x{72E3}\x{72E4}\x{72E5}' .
+'\x{72E6}\x{72E7}\x{72E8}\x{72E9}\x{72EA}\x{72EB}\x{72EC}\x{72ED}\x{72EE}' .
+'\x{72EF}\x{72F0}\x{72F1}\x{72F2}\x{72F3}\x{72F4}\x{72F5}\x{72F6}\x{72F7}' .
+'\x{72F8}\x{72F9}\x{72FA}\x{72FB}\x{72FC}\x{72FD}\x{72FE}\x{72FF}\x{7300}' .
+'\x{7301}\x{7303}\x{7304}\x{7305}\x{7306}\x{7307}\x{7308}\x{7309}\x{730A}' .
+'\x{730B}\x{730C}\x{730D}\x{730E}\x{730F}\x{7311}\x{7312}\x{7313}\x{7314}' .
+'\x{7315}\x{7316}\x{7317}\x{7318}\x{7319}\x{731A}\x{731B}\x{731C}\x{731D}' .
+'\x{731E}\x{7320}\x{7321}\x{7322}\x{7323}\x{7324}\x{7325}\x{7326}\x{7327}' .
+'\x{7329}\x{732A}\x{732B}\x{732C}\x{732D}\x{732E}\x{7330}\x{7331}\x{7332}' .
+'\x{7333}\x{7334}\x{7335}\x{7336}\x{7337}\x{7338}\x{7339}\x{733A}\x{733B}' .
+'\x{733C}\x{733D}\x{733E}\x{733F}\x{7340}\x{7341}\x{7342}\x{7343}\x{7344}' .
+'\x{7345}\x{7346}\x{7347}\x{7348}\x{7349}\x{734A}\x{734B}\x{734C}\x{734D}' .
+'\x{734E}\x{7350}\x{7351}\x{7352}\x{7354}\x{7355}\x{7356}\x{7357}\x{7358}' .
+'\x{7359}\x{735A}\x{735B}\x{735C}\x{735D}\x{735E}\x{735F}\x{7360}\x{7361}' .
+'\x{7362}\x{7364}\x{7365}\x{7366}\x{7367}\x{7368}\x{7369}\x{736A}\x{736B}' .
+'\x{736C}\x{736D}\x{736E}\x{736F}\x{7370}\x{7371}\x{7372}\x{7373}\x{7374}' .
+'\x{7375}\x{7376}\x{7377}\x{7378}\x{7379}\x{737A}\x{737B}\x{737C}\x{737D}' .
+'\x{737E}\x{737F}\x{7380}\x{7381}\x{7382}\x{7383}\x{7384}\x{7385}\x{7386}' .
+'\x{7387}\x{7388}\x{7389}\x{738A}\x{738B}\x{738C}\x{738D}\x{738E}\x{738F}' .
+'\x{7390}\x{7391}\x{7392}\x{7393}\x{7394}\x{7395}\x{7396}\x{7397}\x{7398}' .
+'\x{7399}\x{739A}\x{739B}\x{739D}\x{739E}\x{739F}\x{73A0}\x{73A1}\x{73A2}' .
+'\x{73A3}\x{73A4}\x{73A5}\x{73A6}\x{73A7}\x{73A8}\x{73A9}\x{73AA}\x{73AB}' .
+'\x{73AC}\x{73AD}\x{73AE}\x{73AF}\x{73B0}\x{73B1}\x{73B2}\x{73B3}\x{73B4}' .
+'\x{73B5}\x{73B6}\x{73B7}\x{73B8}\x{73B9}\x{73BA}\x{73BB}\x{73BC}\x{73BD}' .
+'\x{73BE}\x{73BF}\x{73C0}\x{73C2}\x{73C3}\x{73C4}\x{73C5}\x{73C6}\x{73C7}' .
+'\x{73C8}\x{73C9}\x{73CA}\x{73CB}\x{73CC}\x{73CD}\x{73CE}\x{73CF}\x{73D0}' .
+'\x{73D1}\x{73D2}\x{73D3}\x{73D4}\x{73D5}\x{73D6}\x{73D7}\x{73D8}\x{73D9}' .
+'\x{73DA}\x{73DB}\x{73DC}\x{73DD}\x{73DE}\x{73DF}\x{73E0}\x{73E2}\x{73E3}' .
+'\x{73E5}\x{73E6}\x{73E7}\x{73E8}\x{73E9}\x{73EA}\x{73EB}\x{73EC}\x{73ED}' .
+'\x{73EE}\x{73EF}\x{73F0}\x{73F1}\x{73F2}\x{73F4}\x{73F5}\x{73F6}\x{73F7}' .
+'\x{73F8}\x{73F9}\x{73FA}\x{73FC}\x{73FD}\x{73FE}\x{73FF}\x{7400}\x{7401}' .
+'\x{7402}\x{7403}\x{7404}\x{7405}\x{7406}\x{7407}\x{7408}\x{7409}\x{740A}' .
+'\x{740B}\x{740C}\x{740D}\x{740E}\x{740F}\x{7410}\x{7411}\x{7412}\x{7413}' .
+'\x{7414}\x{7415}\x{7416}\x{7417}\x{7419}\x{741A}\x{741B}\x{741C}\x{741D}' .
+'\x{741E}\x{741F}\x{7420}\x{7421}\x{7422}\x{7423}\x{7424}\x{7425}\x{7426}' .
+'\x{7427}\x{7428}\x{7429}\x{742A}\x{742B}\x{742C}\x{742D}\x{742E}\x{742F}' .
+'\x{7430}\x{7431}\x{7432}\x{7433}\x{7434}\x{7435}\x{7436}\x{7437}\x{7438}' .
+'\x{743A}\x{743B}\x{743C}\x{743D}\x{743F}\x{7440}\x{7441}\x{7442}\x{7443}' .
+'\x{7444}\x{7445}\x{7446}\x{7448}\x{744A}\x{744B}\x{744C}\x{744D}\x{744E}' .
+'\x{744F}\x{7450}\x{7451}\x{7452}\x{7453}\x{7454}\x{7455}\x{7456}\x{7457}' .
+'\x{7459}\x{745A}\x{745B}\x{745C}\x{745D}\x{745E}\x{745F}\x{7461}\x{7462}' .
+'\x{7463}\x{7464}\x{7465}\x{7466}\x{7467}\x{7468}\x{7469}\x{746A}\x{746B}' .
+'\x{746C}\x{746D}\x{746E}\x{746F}\x{7470}\x{7471}\x{7472}\x{7473}\x{7474}' .
+'\x{7475}\x{7476}\x{7477}\x{7478}\x{7479}\x{747A}\x{747C}\x{747D}\x{747E}' .
+'\x{747F}\x{7480}\x{7481}\x{7482}\x{7483}\x{7485}\x{7486}\x{7487}\x{7488}' .
+'\x{7489}\x{748A}\x{748B}\x{748C}\x{748D}\x{748E}\x{748F}\x{7490}\x{7491}' .
+'\x{7492}\x{7493}\x{7494}\x{7495}\x{7497}\x{7498}\x{7499}\x{749A}\x{749B}' .
+'\x{749C}\x{749E}\x{749F}\x{74A0}\x{74A1}\x{74A3}\x{74A4}\x{74A5}\x{74A6}' .
+'\x{74A7}\x{74A8}\x{74A9}\x{74AA}\x{74AB}\x{74AC}\x{74AD}\x{74AE}\x{74AF}' .
+'\x{74B0}\x{74B1}\x{74B2}\x{74B3}\x{74B4}\x{74B5}\x{74B6}\x{74B7}\x{74B8}' .
+'\x{74B9}\x{74BA}\x{74BB}\x{74BC}\x{74BD}\x{74BE}\x{74BF}\x{74C0}\x{74C1}' .
+'\x{74C2}\x{74C3}\x{74C4}\x{74C5}\x{74C6}\x{74CA}\x{74CB}\x{74CD}\x{74CE}' .
+'\x{74CF}\x{74D0}\x{74D1}\x{74D2}\x{74D3}\x{74D4}\x{74D5}\x{74D6}\x{74D7}' .
+'\x{74D8}\x{74D9}\x{74DA}\x{74DB}\x{74DC}\x{74DD}\x{74DE}\x{74DF}\x{74E0}' .
+'\x{74E1}\x{74E2}\x{74E3}\x{74E4}\x{74E5}\x{74E6}\x{74E7}\x{74E8}\x{74E9}' .
+'\x{74EA}\x{74EC}\x{74ED}\x{74EE}\x{74EF}\x{74F0}\x{74F1}\x{74F2}\x{74F3}' .
+'\x{74F4}\x{74F5}\x{74F6}\x{74F7}\x{74F8}\x{74F9}\x{74FA}\x{74FB}\x{74FC}' .
+'\x{74FD}\x{74FE}\x{74FF}\x{7500}\x{7501}\x{7502}\x{7503}\x{7504}\x{7505}' .
+'\x{7506}\x{7507}\x{7508}\x{7509}\x{750A}\x{750B}\x{750C}\x{750D}\x{750F}' .
+'\x{7510}\x{7511}\x{7512}\x{7513}\x{7514}\x{7515}\x{7516}\x{7517}\x{7518}' .
+'\x{7519}\x{751A}\x{751B}\x{751C}\x{751D}\x{751E}\x{751F}\x{7521}\x{7522}' .
+'\x{7523}\x{7524}\x{7525}\x{7526}\x{7527}\x{7528}\x{7529}\x{752A}\x{752B}' .
+'\x{752C}\x{752D}\x{752E}\x{752F}\x{7530}\x{7531}\x{7532}\x{7533}\x{7535}' .
+'\x{7536}\x{7537}\x{7538}\x{7539}\x{753A}\x{753B}\x{753C}\x{753D}\x{753E}' .
+'\x{753F}\x{7540}\x{7542}\x{7543}\x{7544}\x{7545}\x{7546}\x{7547}\x{7548}' .
+'\x{7549}\x{754B}\x{754C}\x{754D}\x{754E}\x{754F}\x{7550}\x{7551}\x{7553}' .
+'\x{7554}\x{7556}\x{7557}\x{7558}\x{7559}\x{755A}\x{755B}\x{755C}\x{755D}' .
+'\x{755F}\x{7560}\x{7562}\x{7563}\x{7564}\x{7565}\x{7566}\x{7567}\x{7568}' .
+'\x{7569}\x{756A}\x{756B}\x{756C}\x{756D}\x{756E}\x{756F}\x{7570}\x{7572}' .
+'\x{7574}\x{7575}\x{7576}\x{7577}\x{7578}\x{7579}\x{757C}\x{757D}\x{757E}' .
+'\x{757F}\x{7580}\x{7581}\x{7582}\x{7583}\x{7584}\x{7586}\x{7587}\x{7588}' .
+'\x{7589}\x{758A}\x{758B}\x{758C}\x{758D}\x{758F}\x{7590}\x{7591}\x{7592}' .
+'\x{7593}\x{7594}\x{7595}\x{7596}\x{7597}\x{7598}\x{7599}\x{759A}\x{759B}' .
+'\x{759C}\x{759D}\x{759E}\x{759F}\x{75A0}\x{75A1}\x{75A2}\x{75A3}\x{75A4}' .
+'\x{75A5}\x{75A6}\x{75A7}\x{75A8}\x{75AA}\x{75AB}\x{75AC}\x{75AD}\x{75AE}' .
+'\x{75AF}\x{75B0}\x{75B1}\x{75B2}\x{75B3}\x{75B4}\x{75B5}\x{75B6}\x{75B8}' .
+'\x{75B9}\x{75BA}\x{75BB}\x{75BC}\x{75BD}\x{75BE}\x{75BF}\x{75C0}\x{75C1}' .
+'\x{75C2}\x{75C3}\x{75C4}\x{75C5}\x{75C6}\x{75C7}\x{75C8}\x{75C9}\x{75CA}' .
+'\x{75CB}\x{75CC}\x{75CD}\x{75CE}\x{75CF}\x{75D0}\x{75D1}\x{75D2}\x{75D3}' .
+'\x{75D4}\x{75D5}\x{75D6}\x{75D7}\x{75D8}\x{75D9}\x{75DA}\x{75DB}\x{75DD}' .
+'\x{75DE}\x{75DF}\x{75E0}\x{75E1}\x{75E2}\x{75E3}\x{75E4}\x{75E5}\x{75E6}' .
+'\x{75E7}\x{75E8}\x{75EA}\x{75EB}\x{75EC}\x{75ED}\x{75EF}\x{75F0}\x{75F1}' .
+'\x{75F2}\x{75F3}\x{75F4}\x{75F5}\x{75F6}\x{75F7}\x{75F8}\x{75F9}\x{75FA}' .
+'\x{75FB}\x{75FC}\x{75FD}\x{75FE}\x{75FF}\x{7600}\x{7601}\x{7602}\x{7603}' .
+'\x{7604}\x{7605}\x{7606}\x{7607}\x{7608}\x{7609}\x{760A}\x{760B}\x{760C}' .
+'\x{760D}\x{760E}\x{760F}\x{7610}\x{7611}\x{7612}\x{7613}\x{7614}\x{7615}' .
+'\x{7616}\x{7617}\x{7618}\x{7619}\x{761A}\x{761B}\x{761C}\x{761D}\x{761E}' .
+'\x{761F}\x{7620}\x{7621}\x{7622}\x{7623}\x{7624}\x{7625}\x{7626}\x{7627}' .
+'\x{7628}\x{7629}\x{762A}\x{762B}\x{762D}\x{762E}\x{762F}\x{7630}\x{7631}' .
+'\x{7632}\x{7633}\x{7634}\x{7635}\x{7636}\x{7637}\x{7638}\x{7639}\x{763A}' .
+'\x{763B}\x{763C}\x{763D}\x{763E}\x{763F}\x{7640}\x{7641}\x{7642}\x{7643}' .
+'\x{7646}\x{7647}\x{7648}\x{7649}\x{764A}\x{764B}\x{764C}\x{764D}\x{764F}' .
+'\x{7650}\x{7652}\x{7653}\x{7654}\x{7656}\x{7657}\x{7658}\x{7659}\x{765A}' .
+'\x{765B}\x{765C}\x{765D}\x{765E}\x{765F}\x{7660}\x{7661}\x{7662}\x{7663}' .
+'\x{7664}\x{7665}\x{7666}\x{7667}\x{7668}\x{7669}\x{766A}\x{766B}\x{766C}' .
+'\x{766D}\x{766E}\x{766F}\x{7670}\x{7671}\x{7672}\x{7674}\x{7675}\x{7676}' .
+'\x{7677}\x{7678}\x{7679}\x{767B}\x{767C}\x{767D}\x{767E}\x{767F}\x{7680}' .
+'\x{7681}\x{7682}\x{7683}\x{7684}\x{7685}\x{7686}\x{7687}\x{7688}\x{7689}' .
+'\x{768A}\x{768B}\x{768C}\x{768E}\x{768F}\x{7690}\x{7691}\x{7692}\x{7693}' .
+'\x{7694}\x{7695}\x{7696}\x{7697}\x{7698}\x{7699}\x{769A}\x{769B}\x{769C}' .
+'\x{769D}\x{769E}\x{769F}\x{76A0}\x{76A3}\x{76A4}\x{76A6}\x{76A7}\x{76A9}' .
+'\x{76AA}\x{76AB}\x{76AC}\x{76AD}\x{76AE}\x{76AF}\x{76B0}\x{76B1}\x{76B2}' .
+'\x{76B4}\x{76B5}\x{76B7}\x{76B8}\x{76BA}\x{76BB}\x{76BC}\x{76BD}\x{76BE}' .
+'\x{76BF}\x{76C0}\x{76C2}\x{76C3}\x{76C4}\x{76C5}\x{76C6}\x{76C7}\x{76C8}' .
+'\x{76C9}\x{76CA}\x{76CD}\x{76CE}\x{76CF}\x{76D0}\x{76D1}\x{76D2}\x{76D3}' .
+'\x{76D4}\x{76D5}\x{76D6}\x{76D7}\x{76D8}\x{76DA}\x{76DB}\x{76DC}\x{76DD}' .
+'\x{76DE}\x{76DF}\x{76E0}\x{76E1}\x{76E2}\x{76E3}\x{76E4}\x{76E5}\x{76E6}' .
+'\x{76E7}\x{76E8}\x{76E9}\x{76EA}\x{76EC}\x{76ED}\x{76EE}\x{76EF}\x{76F0}' .
+'\x{76F1}\x{76F2}\x{76F3}\x{76F4}\x{76F5}\x{76F6}\x{76F7}\x{76F8}\x{76F9}' .
+'\x{76FA}\x{76FB}\x{76FC}\x{76FD}\x{76FE}\x{76FF}\x{7701}\x{7703}\x{7704}' .
+'\x{7705}\x{7706}\x{7707}\x{7708}\x{7709}\x{770A}\x{770B}\x{770C}\x{770D}' .
+'\x{770F}\x{7710}\x{7711}\x{7712}\x{7713}\x{7714}\x{7715}\x{7716}\x{7717}' .
+'\x{7718}\x{7719}\x{771A}\x{771B}\x{771C}\x{771D}\x{771E}\x{771F}\x{7720}' .
+'\x{7722}\x{7723}\x{7725}\x{7726}\x{7727}\x{7728}\x{7729}\x{772A}\x{772C}' .
+'\x{772D}\x{772E}\x{772F}\x{7730}\x{7731}\x{7732}\x{7733}\x{7734}\x{7735}' .
+'\x{7736}\x{7737}\x{7738}\x{7739}\x{773A}\x{773B}\x{773C}\x{773D}\x{773E}' .
+'\x{7740}\x{7741}\x{7743}\x{7744}\x{7745}\x{7746}\x{7747}\x{7748}\x{7749}' .
+'\x{774A}\x{774B}\x{774C}\x{774D}\x{774E}\x{774F}\x{7750}\x{7751}\x{7752}' .
+'\x{7753}\x{7754}\x{7755}\x{7756}\x{7757}\x{7758}\x{7759}\x{775A}\x{775B}' .
+'\x{775C}\x{775D}\x{775E}\x{775F}\x{7760}\x{7761}\x{7762}\x{7763}\x{7765}' .
+'\x{7766}\x{7767}\x{7768}\x{7769}\x{776A}\x{776B}\x{776C}\x{776D}\x{776E}' .
+'\x{776F}\x{7770}\x{7771}\x{7772}\x{7773}\x{7774}\x{7775}\x{7776}\x{7777}' .
+'\x{7778}\x{7779}\x{777A}\x{777B}\x{777C}\x{777D}\x{777E}\x{777F}\x{7780}' .
+'\x{7781}\x{7782}\x{7783}\x{7784}\x{7785}\x{7786}\x{7787}\x{7788}\x{7789}' .
+'\x{778A}\x{778B}\x{778C}\x{778D}\x{778E}\x{778F}\x{7790}\x{7791}\x{7792}' .
+'\x{7793}\x{7794}\x{7795}\x{7797}\x{7798}\x{7799}\x{779A}\x{779B}\x{779C}' .
+'\x{779D}\x{779E}\x{779F}\x{77A0}\x{77A1}\x{77A2}\x{77A3}\x{77A5}\x{77A6}' .
+'\x{77A7}\x{77A8}\x{77A9}\x{77AA}\x{77AB}\x{77AC}\x{77AD}\x{77AE}\x{77AF}' .
+'\x{77B0}\x{77B1}\x{77B2}\x{77B3}\x{77B4}\x{77B5}\x{77B6}\x{77B7}\x{77B8}' .
+'\x{77B9}\x{77BA}\x{77BB}\x{77BC}\x{77BD}\x{77BF}\x{77C0}\x{77C2}\x{77C3}' .
+'\x{77C4}\x{77C5}\x{77C6}\x{77C7}\x{77C8}\x{77C9}\x{77CA}\x{77CB}\x{77CC}' .
+'\x{77CD}\x{77CE}\x{77CF}\x{77D0}\x{77D1}\x{77D3}\x{77D4}\x{77D5}\x{77D6}' .
+'\x{77D7}\x{77D8}\x{77D9}\x{77DA}\x{77DB}\x{77DC}\x{77DE}\x{77DF}\x{77E0}' .
+'\x{77E1}\x{77E2}\x{77E3}\x{77E5}\x{77E7}\x{77E8}\x{77E9}\x{77EA}\x{77EB}' .
+'\x{77EC}\x{77ED}\x{77EE}\x{77EF}\x{77F0}\x{77F1}\x{77F2}\x{77F3}\x{77F6}' .
+'\x{77F7}\x{77F8}\x{77F9}\x{77FA}\x{77FB}\x{77FC}\x{77FD}\x{77FE}\x{77FF}' .
+'\x{7800}\x{7801}\x{7802}\x{7803}\x{7804}\x{7805}\x{7806}\x{7808}\x{7809}' .
+'\x{780A}\x{780B}\x{780C}\x{780D}\x{780E}\x{780F}\x{7810}\x{7811}\x{7812}' .
+'\x{7813}\x{7814}\x{7815}\x{7816}\x{7817}\x{7818}\x{7819}\x{781A}\x{781B}' .
+'\x{781C}\x{781D}\x{781E}\x{781F}\x{7820}\x{7821}\x{7822}\x{7823}\x{7825}' .
+'\x{7826}\x{7827}\x{7828}\x{7829}\x{782A}\x{782B}\x{782C}\x{782D}\x{782E}' .
+'\x{782F}\x{7830}\x{7831}\x{7832}\x{7833}\x{7834}\x{7835}\x{7837}\x{7838}' .
+'\x{7839}\x{783A}\x{783B}\x{783C}\x{783D}\x{783E}\x{7840}\x{7841}\x{7843}' .
+'\x{7844}\x{7845}\x{7847}\x{7848}\x{7849}\x{784A}\x{784C}\x{784D}\x{784E}' .
+'\x{7850}\x{7851}\x{7852}\x{7853}\x{7854}\x{7855}\x{7856}\x{7857}\x{7858}' .
+'\x{7859}\x{785A}\x{785B}\x{785C}\x{785D}\x{785E}\x{785F}\x{7860}\x{7861}' .
+'\x{7862}\x{7863}\x{7864}\x{7865}\x{7866}\x{7867}\x{7868}\x{7869}\x{786A}' .
+'\x{786B}\x{786C}\x{786D}\x{786E}\x{786F}\x{7870}\x{7871}\x{7872}\x{7873}' .
+'\x{7874}\x{7875}\x{7877}\x{7878}\x{7879}\x{787A}\x{787B}\x{787C}\x{787D}' .
+'\x{787E}\x{787F}\x{7880}\x{7881}\x{7882}\x{7883}\x{7884}\x{7885}\x{7886}' .
+'\x{7887}\x{7889}\x{788A}\x{788B}\x{788C}\x{788D}\x{788E}\x{788F}\x{7890}' .
+'\x{7891}\x{7892}\x{7893}\x{7894}\x{7895}\x{7896}\x{7897}\x{7898}\x{7899}' .
+'\x{789A}\x{789B}\x{789C}\x{789D}\x{789E}\x{789F}\x{78A0}\x{78A1}\x{78A2}' .
+'\x{78A3}\x{78A4}\x{78A5}\x{78A6}\x{78A7}\x{78A8}\x{78A9}\x{78AA}\x{78AB}' .
+'\x{78AC}\x{78AD}\x{78AE}\x{78AF}\x{78B0}\x{78B1}\x{78B2}\x{78B3}\x{78B4}' .
+'\x{78B5}\x{78B6}\x{78B7}\x{78B8}\x{78B9}\x{78BA}\x{78BB}\x{78BC}\x{78BD}' .
+'\x{78BE}\x{78BF}\x{78C0}\x{78C1}\x{78C3}\x{78C4}\x{78C5}\x{78C6}\x{78C8}' .
+'\x{78C9}\x{78CA}\x{78CB}\x{78CC}\x{78CD}\x{78CE}\x{78CF}\x{78D0}\x{78D1}' .
+'\x{78D3}\x{78D4}\x{78D5}\x{78D6}\x{78D7}\x{78D8}\x{78D9}\x{78DA}\x{78DB}' .
+'\x{78DC}\x{78DD}\x{78DE}\x{78DF}\x{78E0}\x{78E1}\x{78E2}\x{78E3}\x{78E4}' .
+'\x{78E5}\x{78E6}\x{78E7}\x{78E8}\x{78E9}\x{78EA}\x{78EB}\x{78EC}\x{78ED}' .
+'\x{78EE}\x{78EF}\x{78F1}\x{78F2}\x{78F3}\x{78F4}\x{78F5}\x{78F6}\x{78F7}' .
+'\x{78F9}\x{78FA}\x{78FB}\x{78FC}\x{78FD}\x{78FE}\x{78FF}\x{7901}\x{7902}' .
+'\x{7903}\x{7904}\x{7905}\x{7906}\x{7907}\x{7909}\x{790A}\x{790B}\x{790C}' .
+'\x{790E}\x{790F}\x{7910}\x{7911}\x{7912}\x{7913}\x{7914}\x{7916}\x{7917}' .
+'\x{7918}\x{7919}\x{791A}\x{791B}\x{791C}\x{791D}\x{791E}\x{7921}\x{7922}' .
+'\x{7923}\x{7924}\x{7925}\x{7926}\x{7927}\x{7928}\x{7929}\x{792A}\x{792B}' .
+'\x{792C}\x{792D}\x{792E}\x{792F}\x{7930}\x{7931}\x{7933}\x{7934}\x{7935}' .
+'\x{7937}\x{7938}\x{7939}\x{793A}\x{793B}\x{793C}\x{793D}\x{793E}\x{793F}' .
+'\x{7940}\x{7941}\x{7942}\x{7943}\x{7944}\x{7945}\x{7946}\x{7947}\x{7948}' .
+'\x{7949}\x{794A}\x{794B}\x{794C}\x{794D}\x{794E}\x{794F}\x{7950}\x{7951}' .
+'\x{7952}\x{7953}\x{7954}\x{7955}\x{7956}\x{7957}\x{7958}\x{795A}\x{795B}' .
+'\x{795C}\x{795D}\x{795E}\x{795F}\x{7960}\x{7961}\x{7962}\x{7963}\x{7964}' .
+'\x{7965}\x{7966}\x{7967}\x{7968}\x{7969}\x{796A}\x{796B}\x{796D}\x{796F}' .
+'\x{7970}\x{7971}\x{7972}\x{7973}\x{7974}\x{7977}\x{7978}\x{7979}\x{797A}' .
+'\x{797B}\x{797C}\x{797D}\x{797E}\x{797F}\x{7980}\x{7981}\x{7982}\x{7983}' .
+'\x{7984}\x{7985}\x{7988}\x{7989}\x{798A}\x{798B}\x{798C}\x{798D}\x{798E}' .
+'\x{798F}\x{7990}\x{7991}\x{7992}\x{7993}\x{7994}\x{7995}\x{7996}\x{7997}' .
+'\x{7998}\x{7999}\x{799A}\x{799B}\x{799C}\x{799F}\x{79A0}\x{79A1}\x{79A2}' .
+'\x{79A3}\x{79A4}\x{79A5}\x{79A6}\x{79A7}\x{79A8}\x{79AA}\x{79AB}\x{79AC}' .
+'\x{79AD}\x{79AE}\x{79AF}\x{79B0}\x{79B1}\x{79B2}\x{79B3}\x{79B4}\x{79B5}' .
+'\x{79B6}\x{79B7}\x{79B8}\x{79B9}\x{79BA}\x{79BB}\x{79BD}\x{79BE}\x{79BF}' .
+'\x{79C0}\x{79C1}\x{79C2}\x{79C3}\x{79C5}\x{79C6}\x{79C8}\x{79C9}\x{79CA}' .
+'\x{79CB}\x{79CD}\x{79CE}\x{79CF}\x{79D0}\x{79D1}\x{79D2}\x{79D3}\x{79D5}' .
+'\x{79D6}\x{79D8}\x{79D9}\x{79DA}\x{79DB}\x{79DC}\x{79DD}\x{79DE}\x{79DF}' .
+'\x{79E0}\x{79E1}\x{79E2}\x{79E3}\x{79E4}\x{79E5}\x{79E6}\x{79E7}\x{79E8}' .
+'\x{79E9}\x{79EA}\x{79EB}\x{79EC}\x{79ED}\x{79EE}\x{79EF}\x{79F0}\x{79F1}' .
+'\x{79F2}\x{79F3}\x{79F4}\x{79F5}\x{79F6}\x{79F7}\x{79F8}\x{79F9}\x{79FA}' .
+'\x{79FB}\x{79FC}\x{79FD}\x{79FE}\x{79FF}\x{7A00}\x{7A02}\x{7A03}\x{7A04}' .
+'\x{7A05}\x{7A06}\x{7A08}\x{7A0A}\x{7A0B}\x{7A0C}\x{7A0D}\x{7A0E}\x{7A0F}' .
+'\x{7A10}\x{7A11}\x{7A12}\x{7A13}\x{7A14}\x{7A15}\x{7A16}\x{7A17}\x{7A18}' .
+'\x{7A19}\x{7A1A}\x{7A1B}\x{7A1C}\x{7A1D}\x{7A1E}\x{7A1F}\x{7A20}\x{7A21}' .
+'\x{7A22}\x{7A23}\x{7A24}\x{7A25}\x{7A26}\x{7A27}\x{7A28}\x{7A29}\x{7A2A}' .
+'\x{7A2B}\x{7A2D}\x{7A2E}\x{7A2F}\x{7A30}\x{7A31}\x{7A32}\x{7A33}\x{7A34}' .
+'\x{7A35}\x{7A37}\x{7A39}\x{7A3B}\x{7A3C}\x{7A3D}\x{7A3E}\x{7A3F}\x{7A40}' .
+'\x{7A41}\x{7A42}\x{7A43}\x{7A44}\x{7A45}\x{7A46}\x{7A47}\x{7A48}\x{7A49}' .
+'\x{7A4A}\x{7A4B}\x{7A4C}\x{7A4D}\x{7A4E}\x{7A50}\x{7A51}\x{7A52}\x{7A53}' .
+'\x{7A54}\x{7A55}\x{7A56}\x{7A57}\x{7A58}\x{7A59}\x{7A5A}\x{7A5B}\x{7A5C}' .
+'\x{7A5D}\x{7A5E}\x{7A5F}\x{7A60}\x{7A61}\x{7A62}\x{7A65}\x{7A66}\x{7A67}' .
+'\x{7A68}\x{7A69}\x{7A6B}\x{7A6C}\x{7A6D}\x{7A6E}\x{7A70}\x{7A71}\x{7A72}' .
+'\x{7A73}\x{7A74}\x{7A75}\x{7A76}\x{7A77}\x{7A78}\x{7A79}\x{7A7A}\x{7A7B}' .
+'\x{7A7C}\x{7A7D}\x{7A7E}\x{7A7F}\x{7A80}\x{7A81}\x{7A83}\x{7A84}\x{7A85}' .
+'\x{7A86}\x{7A87}\x{7A88}\x{7A89}\x{7A8A}\x{7A8B}\x{7A8C}\x{7A8D}\x{7A8E}' .
+'\x{7A8F}\x{7A90}\x{7A91}\x{7A92}\x{7A93}\x{7A94}\x{7A95}\x{7A96}\x{7A97}' .
+'\x{7A98}\x{7A99}\x{7A9C}\x{7A9D}\x{7A9E}\x{7A9F}\x{7AA0}\x{7AA1}\x{7AA2}' .
+'\x{7AA3}\x{7AA4}\x{7AA5}\x{7AA6}\x{7AA7}\x{7AA8}\x{7AA9}\x{7AAA}\x{7AAB}' .
+'\x{7AAC}\x{7AAD}\x{7AAE}\x{7AAF}\x{7AB0}\x{7AB1}\x{7AB2}\x{7AB3}\x{7AB4}' .
+'\x{7AB5}\x{7AB6}\x{7AB7}\x{7AB8}\x{7ABA}\x{7ABE}\x{7ABF}\x{7AC0}\x{7AC1}' .
+'\x{7AC4}\x{7AC5}\x{7AC7}\x{7AC8}\x{7AC9}\x{7ACA}\x{7ACB}\x{7ACC}\x{7ACD}' .
+'\x{7ACE}\x{7ACF}\x{7AD0}\x{7AD1}\x{7AD2}\x{7AD3}\x{7AD4}\x{7AD5}\x{7AD6}' .
+'\x{7AD8}\x{7AD9}\x{7ADB}\x{7ADC}\x{7ADD}\x{7ADE}\x{7ADF}\x{7AE0}\x{7AE1}' .
+'\x{7AE2}\x{7AE3}\x{7AE4}\x{7AE5}\x{7AE6}\x{7AE7}\x{7AE8}\x{7AEA}\x{7AEB}' .
+'\x{7AEC}\x{7AED}\x{7AEE}\x{7AEF}\x{7AF0}\x{7AF1}\x{7AF2}\x{7AF3}\x{7AF4}' .
+'\x{7AF6}\x{7AF7}\x{7AF8}\x{7AF9}\x{7AFA}\x{7AFB}\x{7AFD}\x{7AFE}\x{7AFF}' .
+'\x{7B00}\x{7B01}\x{7B02}\x{7B03}\x{7B04}\x{7B05}\x{7B06}\x{7B08}\x{7B09}' .
+'\x{7B0A}\x{7B0B}\x{7B0C}\x{7B0D}\x{7B0E}\x{7B0F}\x{7B10}\x{7B11}\x{7B12}' .
+'\x{7B13}\x{7B14}\x{7B15}\x{7B16}\x{7B17}\x{7B18}\x{7B19}\x{7B1A}\x{7B1B}' .
+'\x{7B1C}\x{7B1D}\x{7B1E}\x{7B20}\x{7B21}\x{7B22}\x{7B23}\x{7B24}\x{7B25}' .
+'\x{7B26}\x{7B28}\x{7B2A}\x{7B2B}\x{7B2C}\x{7B2D}\x{7B2E}\x{7B2F}\x{7B30}' .
+'\x{7B31}\x{7B32}\x{7B33}\x{7B34}\x{7B35}\x{7B36}\x{7B37}\x{7B38}\x{7B39}' .
+'\x{7B3A}\x{7B3B}\x{7B3C}\x{7B3D}\x{7B3E}\x{7B3F}\x{7B40}\x{7B41}\x{7B43}' .
+'\x{7B44}\x{7B45}\x{7B46}\x{7B47}\x{7B48}\x{7B49}\x{7B4A}\x{7B4B}\x{7B4C}' .
+'\x{7B4D}\x{7B4E}\x{7B4F}\x{7B50}\x{7B51}\x{7B52}\x{7B54}\x{7B55}\x{7B56}' .
+'\x{7B57}\x{7B58}\x{7B59}\x{7B5A}\x{7B5B}\x{7B5C}\x{7B5D}\x{7B5E}\x{7B5F}' .
+'\x{7B60}\x{7B61}\x{7B62}\x{7B63}\x{7B64}\x{7B65}\x{7B66}\x{7B67}\x{7B68}' .
+'\x{7B69}\x{7B6A}\x{7B6B}\x{7B6C}\x{7B6D}\x{7B6E}\x{7B70}\x{7B71}\x{7B72}' .
+'\x{7B73}\x{7B74}\x{7B75}\x{7B76}\x{7B77}\x{7B78}\x{7B79}\x{7B7B}\x{7B7C}' .
+'\x{7B7D}\x{7B7E}\x{7B7F}\x{7B80}\x{7B81}\x{7B82}\x{7B83}\x{7B84}\x{7B85}' .
+'\x{7B87}\x{7B88}\x{7B89}\x{7B8A}\x{7B8B}\x{7B8C}\x{7B8D}\x{7B8E}\x{7B8F}' .
+'\x{7B90}\x{7B91}\x{7B93}\x{7B94}\x{7B95}\x{7B96}\x{7B97}\x{7B98}\x{7B99}' .
+'\x{7B9A}\x{7B9B}\x{7B9C}\x{7B9D}\x{7B9E}\x{7B9F}\x{7BA0}\x{7BA1}\x{7BA2}' .
+'\x{7BA4}\x{7BA6}\x{7BA7}\x{7BA8}\x{7BA9}\x{7BAA}\x{7BAB}\x{7BAC}\x{7BAD}' .
+'\x{7BAE}\x{7BAF}\x{7BB1}\x{7BB3}\x{7BB4}\x{7BB5}\x{7BB6}\x{7BB7}\x{7BB8}' .
+'\x{7BB9}\x{7BBA}\x{7BBB}\x{7BBC}\x{7BBD}\x{7BBE}\x{7BBF}\x{7BC0}\x{7BC1}' .
+'\x{7BC2}\x{7BC3}\x{7BC4}\x{7BC5}\x{7BC6}\x{7BC7}\x{7BC8}\x{7BC9}\x{7BCA}' .
+'\x{7BCB}\x{7BCC}\x{7BCD}\x{7BCE}\x{7BD0}\x{7BD1}\x{7BD2}\x{7BD3}\x{7BD4}' .
+'\x{7BD5}\x{7BD6}\x{7BD7}\x{7BD8}\x{7BD9}\x{7BDA}\x{7BDB}\x{7BDC}\x{7BDD}' .
+'\x{7BDE}\x{7BDF}\x{7BE0}\x{7BE1}\x{7BE2}\x{7BE3}\x{7BE4}\x{7BE5}\x{7BE6}' .
+'\x{7BE7}\x{7BE8}\x{7BE9}\x{7BEA}\x{7BEB}\x{7BEC}\x{7BED}\x{7BEE}\x{7BEF}' .
+'\x{7BF0}\x{7BF1}\x{7BF2}\x{7BF3}\x{7BF4}\x{7BF5}\x{7BF6}\x{7BF7}\x{7BF8}' .
+'\x{7BF9}\x{7BFB}\x{7BFC}\x{7BFD}\x{7BFE}\x{7BFF}\x{7C00}\x{7C01}\x{7C02}' .
+'\x{7C03}\x{7C04}\x{7C05}\x{7C06}\x{7C07}\x{7C08}\x{7C09}\x{7C0A}\x{7C0B}' .
+'\x{7C0C}\x{7C0D}\x{7C0E}\x{7C0F}\x{7C10}\x{7C11}\x{7C12}\x{7C13}\x{7C15}' .
+'\x{7C16}\x{7C17}\x{7C18}\x{7C19}\x{7C1A}\x{7C1C}\x{7C1D}\x{7C1E}\x{7C1F}' .
+'\x{7C20}\x{7C21}\x{7C22}\x{7C23}\x{7C24}\x{7C25}\x{7C26}\x{7C27}\x{7C28}' .
+'\x{7C29}\x{7C2A}\x{7C2B}\x{7C2C}\x{7C2D}\x{7C30}\x{7C31}\x{7C32}\x{7C33}' .
+'\x{7C34}\x{7C35}\x{7C36}\x{7C37}\x{7C38}\x{7C39}\x{7C3A}\x{7C3B}\x{7C3C}' .
+'\x{7C3D}\x{7C3E}\x{7C3F}\x{7C40}\x{7C41}\x{7C42}\x{7C43}\x{7C44}\x{7C45}' .
+'\x{7C46}\x{7C47}\x{7C48}\x{7C49}\x{7C4A}\x{7C4B}\x{7C4C}\x{7C4D}\x{7C4E}' .
+'\x{7C50}\x{7C51}\x{7C53}\x{7C54}\x{7C56}\x{7C57}\x{7C58}\x{7C59}\x{7C5A}' .
+'\x{7C5B}\x{7C5C}\x{7C5E}\x{7C5F}\x{7C60}\x{7C61}\x{7C62}\x{7C63}\x{7C64}' .
+'\x{7C65}\x{7C66}\x{7C67}\x{7C68}\x{7C69}\x{7C6A}\x{7C6B}\x{7C6C}\x{7C6D}' .
+'\x{7C6E}\x{7C6F}\x{7C70}\x{7C71}\x{7C72}\x{7C73}\x{7C74}\x{7C75}\x{7C77}' .
+'\x{7C78}\x{7C79}\x{7C7A}\x{7C7B}\x{7C7C}\x{7C7D}\x{7C7E}\x{7C7F}\x{7C80}' .
+'\x{7C81}\x{7C82}\x{7C84}\x{7C85}\x{7C86}\x{7C88}\x{7C89}\x{7C8A}\x{7C8B}' .
+'\x{7C8C}\x{7C8D}\x{7C8E}\x{7C8F}\x{7C90}\x{7C91}\x{7C92}\x{7C94}\x{7C95}' .
+'\x{7C96}\x{7C97}\x{7C98}\x{7C99}\x{7C9B}\x{7C9C}\x{7C9D}\x{7C9E}\x{7C9F}' .
+'\x{7CA0}\x{7CA1}\x{7CA2}\x{7CA3}\x{7CA4}\x{7CA5}\x{7CA6}\x{7CA7}\x{7CA8}' .
+'\x{7CA9}\x{7CAA}\x{7CAD}\x{7CAE}\x{7CAF}\x{7CB0}\x{7CB1}\x{7CB2}\x{7CB3}' .
+'\x{7CB4}\x{7CB5}\x{7CB6}\x{7CB7}\x{7CB8}\x{7CB9}\x{7CBA}\x{7CBB}\x{7CBC}' .
+'\x{7CBD}\x{7CBE}\x{7CBF}\x{7CC0}\x{7CC1}\x{7CC2}\x{7CC3}\x{7CC4}\x{7CC5}' .
+'\x{7CC6}\x{7CC7}\x{7CC8}\x{7CC9}\x{7CCA}\x{7CCB}\x{7CCC}\x{7CCD}\x{7CCE}' .
+'\x{7CCF}\x{7CD0}\x{7CD1}\x{7CD2}\x{7CD4}\x{7CD5}\x{7CD6}\x{7CD7}\x{7CD8}' .
+'\x{7CD9}\x{7CDC}\x{7CDD}\x{7CDE}\x{7CDF}\x{7CE0}\x{7CE2}\x{7CE4}\x{7CE7}' .
+'\x{7CE8}\x{7CE9}\x{7CEA}\x{7CEB}\x{7CEC}\x{7CED}\x{7CEE}\x{7CEF}\x{7CF0}' .
+'\x{7CF1}\x{7CF2}\x{7CF3}\x{7CF4}\x{7CF5}\x{7CF6}\x{7CF7}\x{7CF8}\x{7CF9}' .
+'\x{7CFA}\x{7CFB}\x{7CFD}\x{7CFE}\x{7D00}\x{7D01}\x{7D02}\x{7D03}\x{7D04}' .
+'\x{7D05}\x{7D06}\x{7D07}\x{7D08}\x{7D09}\x{7D0A}\x{7D0B}\x{7D0C}\x{7D0D}' .
+'\x{7D0E}\x{7D0F}\x{7D10}\x{7D11}\x{7D12}\x{7D13}\x{7D14}\x{7D15}\x{7D16}' .
+'\x{7D17}\x{7D18}\x{7D19}\x{7D1A}\x{7D1B}\x{7D1C}\x{7D1D}\x{7D1E}\x{7D1F}' .
+'\x{7D20}\x{7D21}\x{7D22}\x{7D24}\x{7D25}\x{7D26}\x{7D27}\x{7D28}\x{7D29}' .
+'\x{7D2B}\x{7D2C}\x{7D2E}\x{7D2F}\x{7D30}\x{7D31}\x{7D32}\x{7D33}\x{7D34}' .
+'\x{7D35}\x{7D36}\x{7D37}\x{7D38}\x{7D39}\x{7D3A}\x{7D3B}\x{7D3C}\x{7D3D}' .
+'\x{7D3E}\x{7D3F}\x{7D40}\x{7D41}\x{7D42}\x{7D43}\x{7D44}\x{7D45}\x{7D46}' .
+'\x{7D47}\x{7D49}\x{7D4A}\x{7D4B}\x{7D4C}\x{7D4E}\x{7D4F}\x{7D50}\x{7D51}' .
+'\x{7D52}\x{7D53}\x{7D54}\x{7D55}\x{7D56}\x{7D57}\x{7D58}\x{7D59}\x{7D5B}' .
+'\x{7D5C}\x{7D5D}\x{7D5E}\x{7D5F}\x{7D60}\x{7D61}\x{7D62}\x{7D63}\x{7D65}' .
+'\x{7D66}\x{7D67}\x{7D68}\x{7D69}\x{7D6A}\x{7D6B}\x{7D6C}\x{7D6D}\x{7D6E}' .
+'\x{7D6F}\x{7D70}\x{7D71}\x{7D72}\x{7D73}\x{7D74}\x{7D75}\x{7D76}\x{7D77}' .
+'\x{7D79}\x{7D7A}\x{7D7B}\x{7D7C}\x{7D7D}\x{7D7E}\x{7D7F}\x{7D80}\x{7D81}' .
+'\x{7D83}\x{7D84}\x{7D85}\x{7D86}\x{7D87}\x{7D88}\x{7D89}\x{7D8A}\x{7D8B}' .
+'\x{7D8C}\x{7D8D}\x{7D8E}\x{7D8F}\x{7D90}\x{7D91}\x{7D92}\x{7D93}\x{7D94}' .
+'\x{7D96}\x{7D97}\x{7D99}\x{7D9B}\x{7D9C}\x{7D9D}\x{7D9E}\x{7D9F}\x{7DA0}' .
+'\x{7DA1}\x{7DA2}\x{7DA3}\x{7DA5}\x{7DA6}\x{7DA7}\x{7DA9}\x{7DAA}\x{7DAB}' .
+'\x{7DAC}\x{7DAD}\x{7DAE}\x{7DAF}\x{7DB0}\x{7DB1}\x{7DB2}\x{7DB3}\x{7DB4}' .
+'\x{7DB5}\x{7DB6}\x{7DB7}\x{7DB8}\x{7DB9}\x{7DBA}\x{7DBB}\x{7DBC}\x{7DBD}' .
+'\x{7DBE}\x{7DBF}\x{7DC0}\x{7DC1}\x{7DC2}\x{7DC3}\x{7DC4}\x{7DC5}\x{7DC6}' .
+'\x{7DC7}\x{7DC8}\x{7DC9}\x{7DCA}\x{7DCB}\x{7DCC}\x{7DCE}\x{7DCF}\x{7DD0}' .
+'\x{7DD1}\x{7DD2}\x{7DD4}\x{7DD5}\x{7DD6}\x{7DD7}\x{7DD8}\x{7DD9}\x{7DDA}' .
+'\x{7DDB}\x{7DDD}\x{7DDE}\x{7DDF}\x{7DE0}\x{7DE1}\x{7DE2}\x{7DE3}\x{7DE6}' .
+'\x{7DE7}\x{7DE8}\x{7DE9}\x{7DEA}\x{7DEC}\x{7DED}\x{7DEE}\x{7DEF}\x{7DF0}' .
+'\x{7DF1}\x{7DF2}\x{7DF3}\x{7DF4}\x{7DF5}\x{7DF6}\x{7DF7}\x{7DF8}\x{7DF9}' .
+'\x{7DFA}\x{7DFB}\x{7DFC}\x{7E00}\x{7E01}\x{7E02}\x{7E03}\x{7E04}\x{7E05}' .
+'\x{7E06}\x{7E07}\x{7E08}\x{7E09}\x{7E0A}\x{7E0B}\x{7E0C}\x{7E0D}\x{7E0E}' .
+'\x{7E0F}\x{7E10}\x{7E11}\x{7E12}\x{7E13}\x{7E14}\x{7E15}\x{7E16}\x{7E17}' .
+'\x{7E19}\x{7E1A}\x{7E1B}\x{7E1C}\x{7E1D}\x{7E1E}\x{7E1F}\x{7E20}\x{7E21}' .
+'\x{7E22}\x{7E23}\x{7E24}\x{7E25}\x{7E26}\x{7E27}\x{7E28}\x{7E29}\x{7E2A}' .
+'\x{7E2B}\x{7E2C}\x{7E2D}\x{7E2E}\x{7E2F}\x{7E30}\x{7E31}\x{7E32}\x{7E33}' .
+'\x{7E34}\x{7E35}\x{7E36}\x{7E37}\x{7E38}\x{7E39}\x{7E3A}\x{7E3B}\x{7E3C}' .
+'\x{7E3D}\x{7E3E}\x{7E3F}\x{7E40}\x{7E41}\x{7E42}\x{7E43}\x{7E44}\x{7E45}' .
+'\x{7E46}\x{7E47}\x{7E48}\x{7E49}\x{7E4C}\x{7E4D}\x{7E4E}\x{7E4F}\x{7E50}' .
+'\x{7E51}\x{7E52}\x{7E53}\x{7E54}\x{7E55}\x{7E56}\x{7E57}\x{7E58}\x{7E59}' .
+'\x{7E5A}\x{7E5C}\x{7E5D}\x{7E5E}\x{7E5F}\x{7E60}\x{7E61}\x{7E62}\x{7E63}' .
+'\x{7E65}\x{7E66}\x{7E67}\x{7E68}\x{7E69}\x{7E6A}\x{7E6B}\x{7E6C}\x{7E6D}' .
+'\x{7E6E}\x{7E6F}\x{7E70}\x{7E71}\x{7E72}\x{7E73}\x{7E74}\x{7E75}\x{7E76}' .
+'\x{7E77}\x{7E78}\x{7E79}\x{7E7A}\x{7E7B}\x{7E7C}\x{7E7D}\x{7E7E}\x{7E7F}' .
+'\x{7E80}\x{7E81}\x{7E82}\x{7E83}\x{7E84}\x{7E85}\x{7E86}\x{7E87}\x{7E88}' .
+'\x{7E89}\x{7E8A}\x{7E8B}\x{7E8C}\x{7E8D}\x{7E8E}\x{7E8F}\x{7E90}\x{7E91}' .
+'\x{7E92}\x{7E93}\x{7E94}\x{7E95}\x{7E96}\x{7E97}\x{7E98}\x{7E99}\x{7E9A}' .
+'\x{7E9B}\x{7E9C}\x{7E9E}\x{7E9F}\x{7EA0}\x{7EA1}\x{7EA2}\x{7EA3}\x{7EA4}' .
+'\x{7EA5}\x{7EA6}\x{7EA7}\x{7EA8}\x{7EA9}\x{7EAA}\x{7EAB}\x{7EAC}\x{7EAD}' .
+'\x{7EAE}\x{7EAF}\x{7EB0}\x{7EB1}\x{7EB2}\x{7EB3}\x{7EB4}\x{7EB5}\x{7EB6}' .
+'\x{7EB7}\x{7EB8}\x{7EB9}\x{7EBA}\x{7EBB}\x{7EBC}\x{7EBD}\x{7EBE}\x{7EBF}' .
+'\x{7EC0}\x{7EC1}\x{7EC2}\x{7EC3}\x{7EC4}\x{7EC5}\x{7EC6}\x{7EC7}\x{7EC8}' .
+'\x{7EC9}\x{7ECA}\x{7ECB}\x{7ECC}\x{7ECD}\x{7ECE}\x{7ECF}\x{7ED0}\x{7ED1}' .
+'\x{7ED2}\x{7ED3}\x{7ED4}\x{7ED5}\x{7ED6}\x{7ED7}\x{7ED8}\x{7ED9}\x{7EDA}' .
+'\x{7EDB}\x{7EDC}\x{7EDD}\x{7EDE}\x{7EDF}\x{7EE0}\x{7EE1}\x{7EE2}\x{7EE3}' .
+'\x{7EE4}\x{7EE5}\x{7EE6}\x{7EE7}\x{7EE8}\x{7EE9}\x{7EEA}\x{7EEB}\x{7EEC}' .
+'\x{7EED}\x{7EEE}\x{7EEF}\x{7EF0}\x{7EF1}\x{7EF2}\x{7EF3}\x{7EF4}\x{7EF5}' .
+'\x{7EF6}\x{7EF7}\x{7EF8}\x{7EF9}\x{7EFA}\x{7EFB}\x{7EFC}\x{7EFD}\x{7EFE}' .
+'\x{7EFF}\x{7F00}\x{7F01}\x{7F02}\x{7F03}\x{7F04}\x{7F05}\x{7F06}\x{7F07}' .
+'\x{7F08}\x{7F09}\x{7F0A}\x{7F0B}\x{7F0C}\x{7F0D}\x{7F0E}\x{7F0F}\x{7F10}' .
+'\x{7F11}\x{7F12}\x{7F13}\x{7F14}\x{7F15}\x{7F16}\x{7F17}\x{7F18}\x{7F19}' .
+'\x{7F1A}\x{7F1B}\x{7F1C}\x{7F1D}\x{7F1E}\x{7F1F}\x{7F20}\x{7F21}\x{7F22}' .
+'\x{7F23}\x{7F24}\x{7F25}\x{7F26}\x{7F27}\x{7F28}\x{7F29}\x{7F2A}\x{7F2B}' .
+'\x{7F2C}\x{7F2D}\x{7F2E}\x{7F2F}\x{7F30}\x{7F31}\x{7F32}\x{7F33}\x{7F34}' .
+'\x{7F35}\x{7F36}\x{7F37}\x{7F38}\x{7F39}\x{7F3A}\x{7F3D}\x{7F3E}\x{7F3F}' .
+'\x{7F40}\x{7F42}\x{7F43}\x{7F44}\x{7F45}\x{7F47}\x{7F48}\x{7F49}\x{7F4A}' .
+'\x{7F4B}\x{7F4C}\x{7F4D}\x{7F4E}\x{7F4F}\x{7F50}\x{7F51}\x{7F52}\x{7F53}' .
+'\x{7F54}\x{7F55}\x{7F56}\x{7F57}\x{7F58}\x{7F5A}\x{7F5B}\x{7F5C}\x{7F5D}' .
+'\x{7F5E}\x{7F5F}\x{7F60}\x{7F61}\x{7F62}\x{7F63}\x{7F64}\x{7F65}\x{7F66}' .
+'\x{7F67}\x{7F68}\x{7F69}\x{7F6A}\x{7F6B}\x{7F6C}\x{7F6D}\x{7F6E}\x{7F6F}' .
+'\x{7F70}\x{7F71}\x{7F72}\x{7F73}\x{7F74}\x{7F75}\x{7F76}\x{7F77}\x{7F78}' .
+'\x{7F79}\x{7F7A}\x{7F7B}\x{7F7C}\x{7F7D}\x{7F7E}\x{7F7F}\x{7F80}\x{7F81}' .
+'\x{7F82}\x{7F83}\x{7F85}\x{7F86}\x{7F87}\x{7F88}\x{7F89}\x{7F8A}\x{7F8B}' .
+'\x{7F8C}\x{7F8D}\x{7F8E}\x{7F8F}\x{7F91}\x{7F92}\x{7F93}\x{7F94}\x{7F95}' .
+'\x{7F96}\x{7F98}\x{7F9A}\x{7F9B}\x{7F9C}\x{7F9D}\x{7F9E}\x{7F9F}\x{7FA0}' .
+'\x{7FA1}\x{7FA2}\x{7FA3}\x{7FA4}\x{7FA5}\x{7FA6}\x{7FA7}\x{7FA8}\x{7FA9}' .
+'\x{7FAA}\x{7FAB}\x{7FAC}\x{7FAD}\x{7FAE}\x{7FAF}\x{7FB0}\x{7FB1}\x{7FB2}' .
+'\x{7FB3}\x{7FB5}\x{7FB6}\x{7FB7}\x{7FB8}\x{7FB9}\x{7FBA}\x{7FBB}\x{7FBC}' .
+'\x{7FBD}\x{7FBE}\x{7FBF}\x{7FC0}\x{7FC1}\x{7FC2}\x{7FC3}\x{7FC4}\x{7FC5}' .
+'\x{7FC6}\x{7FC7}\x{7FC8}\x{7FC9}\x{7FCA}\x{7FCB}\x{7FCC}\x{7FCD}\x{7FCE}' .
+'\x{7FCF}\x{7FD0}\x{7FD1}\x{7FD2}\x{7FD3}\x{7FD4}\x{7FD5}\x{7FD7}\x{7FD8}' .
+'\x{7FD9}\x{7FDA}\x{7FDB}\x{7FDC}\x{7FDE}\x{7FDF}\x{7FE0}\x{7FE1}\x{7FE2}' .
+'\x{7FE3}\x{7FE5}\x{7FE6}\x{7FE7}\x{7FE8}\x{7FE9}\x{7FEA}\x{7FEB}\x{7FEC}' .
+'\x{7FED}\x{7FEE}\x{7FEF}\x{7FF0}\x{7FF1}\x{7FF2}\x{7FF3}\x{7FF4}\x{7FF5}' .
+'\x{7FF6}\x{7FF7}\x{7FF8}\x{7FF9}\x{7FFA}\x{7FFB}\x{7FFC}\x{7FFD}\x{7FFE}' .
+'\x{7FFF}\x{8000}\x{8001}\x{8002}\x{8003}\x{8004}\x{8005}\x{8006}\x{8007}' .
+'\x{8008}\x{8009}\x{800B}\x{800C}\x{800D}\x{800E}\x{800F}\x{8010}\x{8011}' .
+'\x{8012}\x{8013}\x{8014}\x{8015}\x{8016}\x{8017}\x{8018}\x{8019}\x{801A}' .
+'\x{801B}\x{801C}\x{801D}\x{801E}\x{801F}\x{8020}\x{8021}\x{8022}\x{8023}' .
+'\x{8024}\x{8025}\x{8026}\x{8027}\x{8028}\x{8029}\x{802A}\x{802B}\x{802C}' .
+'\x{802D}\x{802E}\x{8030}\x{8031}\x{8032}\x{8033}\x{8034}\x{8035}\x{8036}' .
+'\x{8037}\x{8038}\x{8039}\x{803A}\x{803B}\x{803D}\x{803E}\x{803F}\x{8041}' .
+'\x{8042}\x{8043}\x{8044}\x{8045}\x{8046}\x{8047}\x{8048}\x{8049}\x{804A}' .
+'\x{804B}\x{804C}\x{804D}\x{804E}\x{804F}\x{8050}\x{8051}\x{8052}\x{8053}' .
+'\x{8054}\x{8055}\x{8056}\x{8057}\x{8058}\x{8059}\x{805A}\x{805B}\x{805C}' .
+'\x{805D}\x{805E}\x{805F}\x{8060}\x{8061}\x{8062}\x{8063}\x{8064}\x{8065}' .
+'\x{8067}\x{8068}\x{8069}\x{806A}\x{806B}\x{806C}\x{806D}\x{806E}\x{806F}' .
+'\x{8070}\x{8071}\x{8072}\x{8073}\x{8074}\x{8075}\x{8076}\x{8077}\x{8078}' .
+'\x{8079}\x{807A}\x{807B}\x{807C}\x{807D}\x{807E}\x{807F}\x{8080}\x{8081}' .
+'\x{8082}\x{8083}\x{8084}\x{8085}\x{8086}\x{8087}\x{8089}\x{808A}\x{808B}' .
+'\x{808C}\x{808D}\x{808F}\x{8090}\x{8091}\x{8092}\x{8093}\x{8095}\x{8096}' .
+'\x{8097}\x{8098}\x{8099}\x{809A}\x{809B}\x{809C}\x{809D}\x{809E}\x{809F}' .
+'\x{80A0}\x{80A1}\x{80A2}\x{80A3}\x{80A4}\x{80A5}\x{80A9}\x{80AA}\x{80AB}' .
+'\x{80AD}\x{80AE}\x{80AF}\x{80B0}\x{80B1}\x{80B2}\x{80B4}\x{80B5}\x{80B6}' .
+'\x{80B7}\x{80B8}\x{80BA}\x{80BB}\x{80BC}\x{80BD}\x{80BE}\x{80BF}\x{80C0}' .
+'\x{80C1}\x{80C2}\x{80C3}\x{80C4}\x{80C5}\x{80C6}\x{80C7}\x{80C8}\x{80C9}' .
+'\x{80CA}\x{80CB}\x{80CC}\x{80CD}\x{80CE}\x{80CF}\x{80D0}\x{80D1}\x{80D2}' .
+'\x{80D3}\x{80D4}\x{80D5}\x{80D6}\x{80D7}\x{80D8}\x{80D9}\x{80DA}\x{80DB}' .
+'\x{80DC}\x{80DD}\x{80DE}\x{80E0}\x{80E1}\x{80E2}\x{80E3}\x{80E4}\x{80E5}' .
+'\x{80E6}\x{80E7}\x{80E8}\x{80E9}\x{80EA}\x{80EB}\x{80EC}\x{80ED}\x{80EE}' .
+'\x{80EF}\x{80F0}\x{80F1}\x{80F2}\x{80F3}\x{80F4}\x{80F5}\x{80F6}\x{80F7}' .
+'\x{80F8}\x{80F9}\x{80FA}\x{80FB}\x{80FC}\x{80FD}\x{80FE}\x{80FF}\x{8100}' .
+'\x{8101}\x{8102}\x{8105}\x{8106}\x{8107}\x{8108}\x{8109}\x{810A}\x{810B}' .
+'\x{810C}\x{810D}\x{810E}\x{810F}\x{8110}\x{8111}\x{8112}\x{8113}\x{8114}' .
+'\x{8115}\x{8116}\x{8118}\x{8119}\x{811A}\x{811B}\x{811C}\x{811D}\x{811E}' .
+'\x{811F}\x{8120}\x{8121}\x{8122}\x{8123}\x{8124}\x{8125}\x{8126}\x{8127}' .
+'\x{8128}\x{8129}\x{812A}\x{812B}\x{812C}\x{812D}\x{812E}\x{812F}\x{8130}' .
+'\x{8131}\x{8132}\x{8136}\x{8137}\x{8138}\x{8139}\x{813A}\x{813B}\x{813C}' .
+'\x{813D}\x{813E}\x{813F}\x{8140}\x{8141}\x{8142}\x{8143}\x{8144}\x{8145}' .
+'\x{8146}\x{8147}\x{8148}\x{8149}\x{814A}\x{814B}\x{814C}\x{814D}\x{814E}' .
+'\x{814F}\x{8150}\x{8151}\x{8152}\x{8153}\x{8154}\x{8155}\x{8156}\x{8157}' .
+'\x{8158}\x{8159}\x{815A}\x{815B}\x{815C}\x{815D}\x{815E}\x{8160}\x{8161}' .
+'\x{8162}\x{8163}\x{8164}\x{8165}\x{8166}\x{8167}\x{8168}\x{8169}\x{816A}' .
+'\x{816B}\x{816C}\x{816D}\x{816E}\x{816F}\x{8170}\x{8171}\x{8172}\x{8173}' .
+'\x{8174}\x{8175}\x{8176}\x{8177}\x{8178}\x{8179}\x{817A}\x{817B}\x{817C}' .
+'\x{817D}\x{817E}\x{817F}\x{8180}\x{8181}\x{8182}\x{8183}\x{8185}\x{8186}' .
+'\x{8187}\x{8188}\x{8189}\x{818A}\x{818B}\x{818C}\x{818D}\x{818E}\x{818F}' .
+'\x{8191}\x{8192}\x{8193}\x{8194}\x{8195}\x{8197}\x{8198}\x{8199}\x{819A}' .
+'\x{819B}\x{819C}\x{819D}\x{819E}\x{819F}\x{81A0}\x{81A1}\x{81A2}\x{81A3}' .
+'\x{81A4}\x{81A5}\x{81A6}\x{81A7}\x{81A8}\x{81A9}\x{81AA}\x{81AB}\x{81AC}' .
+'\x{81AD}\x{81AE}\x{81AF}\x{81B0}\x{81B1}\x{81B2}\x{81B3}\x{81B4}\x{81B5}' .
+'\x{81B6}\x{81B7}\x{81B8}\x{81B9}\x{81BA}\x{81BB}\x{81BC}\x{81BD}\x{81BE}' .
+'\x{81BF}\x{81C0}\x{81C1}\x{81C2}\x{81C3}\x{81C4}\x{81C5}\x{81C6}\x{81C7}' .
+'\x{81C8}\x{81C9}\x{81CA}\x{81CC}\x{81CD}\x{81CE}\x{81CF}\x{81D0}\x{81D1}' .
+'\x{81D2}\x{81D4}\x{81D5}\x{81D6}\x{81D7}\x{81D8}\x{81D9}\x{81DA}\x{81DB}' .
+'\x{81DC}\x{81DD}\x{81DE}\x{81DF}\x{81E0}\x{81E1}\x{81E2}\x{81E3}\x{81E5}' .
+'\x{81E6}\x{81E7}\x{81E8}\x{81E9}\x{81EA}\x{81EB}\x{81EC}\x{81ED}\x{81EE}' .
+'\x{81F1}\x{81F2}\x{81F3}\x{81F4}\x{81F5}\x{81F6}\x{81F7}\x{81F8}\x{81F9}' .
+'\x{81FA}\x{81FB}\x{81FC}\x{81FD}\x{81FE}\x{81FF}\x{8200}\x{8201}\x{8202}' .
+'\x{8203}\x{8204}\x{8205}\x{8206}\x{8207}\x{8208}\x{8209}\x{820A}\x{820B}' .
+'\x{820C}\x{820D}\x{820E}\x{820F}\x{8210}\x{8211}\x{8212}\x{8214}\x{8215}' .
+'\x{8216}\x{8218}\x{8219}\x{821A}\x{821B}\x{821C}\x{821D}\x{821E}\x{821F}' .
+'\x{8220}\x{8221}\x{8222}\x{8223}\x{8225}\x{8226}\x{8227}\x{8228}\x{8229}' .
+'\x{822A}\x{822B}\x{822C}\x{822D}\x{822F}\x{8230}\x{8231}\x{8232}\x{8233}' .
+'\x{8234}\x{8235}\x{8236}\x{8237}\x{8238}\x{8239}\x{823A}\x{823B}\x{823C}' .
+'\x{823D}\x{823E}\x{823F}\x{8240}\x{8242}\x{8243}\x{8244}\x{8245}\x{8246}' .
+'\x{8247}\x{8248}\x{8249}\x{824A}\x{824B}\x{824C}\x{824D}\x{824E}\x{824F}' .
+'\x{8250}\x{8251}\x{8252}\x{8253}\x{8254}\x{8255}\x{8256}\x{8257}\x{8258}' .
+'\x{8259}\x{825A}\x{825B}\x{825C}\x{825D}\x{825E}\x{825F}\x{8260}\x{8261}' .
+'\x{8263}\x{8264}\x{8266}\x{8267}\x{8268}\x{8269}\x{826A}\x{826B}\x{826C}' .
+'\x{826D}\x{826E}\x{826F}\x{8270}\x{8271}\x{8272}\x{8273}\x{8274}\x{8275}' .
+'\x{8276}\x{8277}\x{8278}\x{8279}\x{827A}\x{827B}\x{827C}\x{827D}\x{827E}' .
+'\x{827F}\x{8280}\x{8281}\x{8282}\x{8283}\x{8284}\x{8285}\x{8286}\x{8287}' .
+'\x{8288}\x{8289}\x{828A}\x{828B}\x{828D}\x{828E}\x{828F}\x{8290}\x{8291}' .
+'\x{8292}\x{8293}\x{8294}\x{8295}\x{8296}\x{8297}\x{8298}\x{8299}\x{829A}' .
+'\x{829B}\x{829C}\x{829D}\x{829E}\x{829F}\x{82A0}\x{82A1}\x{82A2}\x{82A3}' .
+'\x{82A4}\x{82A5}\x{82A6}\x{82A7}\x{82A8}\x{82A9}\x{82AA}\x{82AB}\x{82AC}' .
+'\x{82AD}\x{82AE}\x{82AF}\x{82B0}\x{82B1}\x{82B3}\x{82B4}\x{82B5}\x{82B6}' .
+'\x{82B7}\x{82B8}\x{82B9}\x{82BA}\x{82BB}\x{82BC}\x{82BD}\x{82BE}\x{82BF}' .
+'\x{82C0}\x{82C1}\x{82C2}\x{82C3}\x{82C4}\x{82C5}\x{82C6}\x{82C7}\x{82C8}' .
+'\x{82C9}\x{82CA}\x{82CB}\x{82CC}\x{82CD}\x{82CE}\x{82CF}\x{82D0}\x{82D1}' .
+'\x{82D2}\x{82D3}\x{82D4}\x{82D5}\x{82D6}\x{82D7}\x{82D8}\x{82D9}\x{82DA}' .
+'\x{82DB}\x{82DC}\x{82DD}\x{82DE}\x{82DF}\x{82E0}\x{82E1}\x{82E3}\x{82E4}' .
+'\x{82E5}\x{82E6}\x{82E7}\x{82E8}\x{82E9}\x{82EA}\x{82EB}\x{82EC}\x{82ED}' .
+'\x{82EE}\x{82EF}\x{82F0}\x{82F1}\x{82F2}\x{82F3}\x{82F4}\x{82F5}\x{82F6}' .
+'\x{82F7}\x{82F8}\x{82F9}\x{82FA}\x{82FB}\x{82FD}\x{82FE}\x{82FF}\x{8300}' .
+'\x{8301}\x{8302}\x{8303}\x{8304}\x{8305}\x{8306}\x{8307}\x{8308}\x{8309}' .
+'\x{830B}\x{830C}\x{830D}\x{830E}\x{830F}\x{8311}\x{8312}\x{8313}\x{8314}' .
+'\x{8315}\x{8316}\x{8317}\x{8318}\x{8319}\x{831A}\x{831B}\x{831C}\x{831D}' .
+'\x{831E}\x{831F}\x{8320}\x{8321}\x{8322}\x{8323}\x{8324}\x{8325}\x{8326}' .
+'\x{8327}\x{8328}\x{8329}\x{832A}\x{832B}\x{832C}\x{832D}\x{832E}\x{832F}' .
+'\x{8331}\x{8332}\x{8333}\x{8334}\x{8335}\x{8336}\x{8337}\x{8338}\x{8339}' .
+'\x{833A}\x{833B}\x{833C}\x{833D}\x{833E}\x{833F}\x{8340}\x{8341}\x{8342}' .
+'\x{8343}\x{8344}\x{8345}\x{8346}\x{8347}\x{8348}\x{8349}\x{834A}\x{834B}' .
+'\x{834C}\x{834D}\x{834E}\x{834F}\x{8350}\x{8351}\x{8352}\x{8353}\x{8354}' .
+'\x{8356}\x{8357}\x{8358}\x{8359}\x{835A}\x{835B}\x{835C}\x{835D}\x{835E}' .
+'\x{835F}\x{8360}\x{8361}\x{8362}\x{8363}\x{8364}\x{8365}\x{8366}\x{8367}' .
+'\x{8368}\x{8369}\x{836A}\x{836B}\x{836C}\x{836D}\x{836E}\x{836F}\x{8370}' .
+'\x{8371}\x{8372}\x{8373}\x{8374}\x{8375}\x{8376}\x{8377}\x{8378}\x{8379}' .
+'\x{837A}\x{837B}\x{837C}\x{837D}\x{837E}\x{837F}\x{8380}\x{8381}\x{8382}' .
+'\x{8383}\x{8384}\x{8385}\x{8386}\x{8387}\x{8388}\x{8389}\x{838A}\x{838B}' .
+'\x{838C}\x{838D}\x{838E}\x{838F}\x{8390}\x{8391}\x{8392}\x{8393}\x{8394}' .
+'\x{8395}\x{8396}\x{8397}\x{8398}\x{8399}\x{839A}\x{839B}\x{839C}\x{839D}' .
+'\x{839E}\x{83A0}\x{83A1}\x{83A2}\x{83A3}\x{83A4}\x{83A5}\x{83A6}\x{83A7}' .
+'\x{83A8}\x{83A9}\x{83AA}\x{83AB}\x{83AC}\x{83AD}\x{83AE}\x{83AF}\x{83B0}' .
+'\x{83B1}\x{83B2}\x{83B3}\x{83B4}\x{83B6}\x{83B7}\x{83B8}\x{83B9}\x{83BA}' .
+'\x{83BB}\x{83BC}\x{83BD}\x{83BF}\x{83C0}\x{83C1}\x{83C2}\x{83C3}\x{83C4}' .
+'\x{83C5}\x{83C6}\x{83C7}\x{83C8}\x{83C9}\x{83CA}\x{83CB}\x{83CC}\x{83CD}' .
+'\x{83CE}\x{83CF}\x{83D0}\x{83D1}\x{83D2}\x{83D3}\x{83D4}\x{83D5}\x{83D6}' .
+'\x{83D7}\x{83D8}\x{83D9}\x{83DA}\x{83DB}\x{83DC}\x{83DD}\x{83DE}\x{83DF}' .
+'\x{83E0}\x{83E1}\x{83E2}\x{83E3}\x{83E4}\x{83E5}\x{83E7}\x{83E8}\x{83E9}' .
+'\x{83EA}\x{83EB}\x{83EC}\x{83EE}\x{83EF}\x{83F0}\x{83F1}\x{83F2}\x{83F3}' .
+'\x{83F4}\x{83F5}\x{83F6}\x{83F7}\x{83F8}\x{83F9}\x{83FA}\x{83FB}\x{83FC}' .
+'\x{83FD}\x{83FE}\x{83FF}\x{8400}\x{8401}\x{8402}\x{8403}\x{8404}\x{8405}' .
+'\x{8406}\x{8407}\x{8408}\x{8409}\x{840A}\x{840B}\x{840C}\x{840D}\x{840E}' .
+'\x{840F}\x{8410}\x{8411}\x{8412}\x{8413}\x{8415}\x{8418}\x{8419}\x{841A}' .
+'\x{841B}\x{841C}\x{841D}\x{841E}\x{8421}\x{8422}\x{8423}\x{8424}\x{8425}' .
+'\x{8426}\x{8427}\x{8428}\x{8429}\x{842A}\x{842B}\x{842C}\x{842D}\x{842E}' .
+'\x{842F}\x{8430}\x{8431}\x{8432}\x{8433}\x{8434}\x{8435}\x{8436}\x{8437}' .
+'\x{8438}\x{8439}\x{843A}\x{843B}\x{843C}\x{843D}\x{843E}\x{843F}\x{8440}' .
+'\x{8441}\x{8442}\x{8443}\x{8444}\x{8445}\x{8446}\x{8447}\x{8448}\x{8449}' .
+'\x{844A}\x{844B}\x{844C}\x{844D}\x{844E}\x{844F}\x{8450}\x{8451}\x{8452}' .
+'\x{8453}\x{8454}\x{8455}\x{8456}\x{8457}\x{8459}\x{845A}\x{845B}\x{845C}' .
+'\x{845D}\x{845E}\x{845F}\x{8460}\x{8461}\x{8462}\x{8463}\x{8464}\x{8465}' .
+'\x{8466}\x{8467}\x{8468}\x{8469}\x{846A}\x{846B}\x{846C}\x{846D}\x{846E}' .
+'\x{846F}\x{8470}\x{8471}\x{8472}\x{8473}\x{8474}\x{8475}\x{8476}\x{8477}' .
+'\x{8478}\x{8479}\x{847A}\x{847B}\x{847C}\x{847D}\x{847E}\x{847F}\x{8480}' .
+'\x{8481}\x{8482}\x{8484}\x{8485}\x{8486}\x{8487}\x{8488}\x{8489}\x{848A}' .
+'\x{848B}\x{848C}\x{848D}\x{848E}\x{848F}\x{8490}\x{8491}\x{8492}\x{8493}' .
+'\x{8494}\x{8496}\x{8497}\x{8498}\x{8499}\x{849A}\x{849B}\x{849C}\x{849D}' .
+'\x{849E}\x{849F}\x{84A0}\x{84A1}\x{84A2}\x{84A3}\x{84A4}\x{84A5}\x{84A6}' .
+'\x{84A7}\x{84A8}\x{84A9}\x{84AA}\x{84AB}\x{84AC}\x{84AE}\x{84AF}\x{84B0}' .
+'\x{84B1}\x{84B2}\x{84B3}\x{84B4}\x{84B5}\x{84B6}\x{84B8}\x{84B9}\x{84BA}' .
+'\x{84BB}\x{84BC}\x{84BD}\x{84BE}\x{84BF}\x{84C0}\x{84C1}\x{84C2}\x{84C4}' .
+'\x{84C5}\x{84C6}\x{84C7}\x{84C8}\x{84C9}\x{84CA}\x{84CB}\x{84CC}\x{84CD}' .
+'\x{84CE}\x{84CF}\x{84D0}\x{84D1}\x{84D2}\x{84D3}\x{84D4}\x{84D5}\x{84D6}' .
+'\x{84D7}\x{84D8}\x{84D9}\x{84DB}\x{84DC}\x{84DD}\x{84DE}\x{84DF}\x{84E0}' .
+'\x{84E1}\x{84E2}\x{84E3}\x{84E4}\x{84E5}\x{84E6}\x{84E7}\x{84E8}\x{84E9}' .
+'\x{84EA}\x{84EB}\x{84EC}\x{84EE}\x{84EF}\x{84F0}\x{84F1}\x{84F2}\x{84F3}' .
+'\x{84F4}\x{84F5}\x{84F6}\x{84F7}\x{84F8}\x{84F9}\x{84FA}\x{84FB}\x{84FC}' .
+'\x{84FD}\x{84FE}\x{84FF}\x{8500}\x{8501}\x{8502}\x{8503}\x{8504}\x{8506}' .
+'\x{8507}\x{8508}\x{8509}\x{850A}\x{850B}\x{850C}\x{850D}\x{850E}\x{850F}' .
+'\x{8511}\x{8512}\x{8513}\x{8514}\x{8515}\x{8516}\x{8517}\x{8518}\x{8519}' .
+'\x{851A}\x{851B}\x{851C}\x{851D}\x{851E}\x{851F}\x{8520}\x{8521}\x{8522}' .
+'\x{8523}\x{8524}\x{8525}\x{8526}\x{8527}\x{8528}\x{8529}\x{852A}\x{852B}' .
+'\x{852C}\x{852D}\x{852E}\x{852F}\x{8530}\x{8531}\x{8534}\x{8535}\x{8536}' .
+'\x{8537}\x{8538}\x{8539}\x{853A}\x{853B}\x{853C}\x{853D}\x{853E}\x{853F}' .
+'\x{8540}\x{8541}\x{8542}\x{8543}\x{8544}\x{8545}\x{8546}\x{8547}\x{8548}' .
+'\x{8549}\x{854A}\x{854B}\x{854D}\x{854E}\x{854F}\x{8551}\x{8552}\x{8553}' .
+'\x{8554}\x{8555}\x{8556}\x{8557}\x{8558}\x{8559}\x{855A}\x{855B}\x{855C}' .
+'\x{855D}\x{855E}\x{855F}\x{8560}\x{8561}\x{8562}\x{8563}\x{8564}\x{8565}' .
+'\x{8566}\x{8567}\x{8568}\x{8569}\x{856A}\x{856B}\x{856C}\x{856D}\x{856E}' .
+'\x{856F}\x{8570}\x{8571}\x{8572}\x{8573}\x{8574}\x{8575}\x{8576}\x{8577}' .
+'\x{8578}\x{8579}\x{857A}\x{857B}\x{857C}\x{857D}\x{857E}\x{8580}\x{8581}' .
+'\x{8582}\x{8583}\x{8584}\x{8585}\x{8586}\x{8587}\x{8588}\x{8589}\x{858A}' .
+'\x{858B}\x{858C}\x{858D}\x{858E}\x{858F}\x{8590}\x{8591}\x{8592}\x{8594}' .
+'\x{8595}\x{8596}\x{8598}\x{8599}\x{859A}\x{859B}\x{859C}\x{859D}\x{859E}' .
+'\x{859F}\x{85A0}\x{85A1}\x{85A2}\x{85A3}\x{85A4}\x{85A5}\x{85A6}\x{85A7}' .
+'\x{85A8}\x{85A9}\x{85AA}\x{85AB}\x{85AC}\x{85AD}\x{85AE}\x{85AF}\x{85B0}' .
+'\x{85B1}\x{85B3}\x{85B4}\x{85B5}\x{85B6}\x{85B7}\x{85B8}\x{85B9}\x{85BA}' .
+'\x{85BC}\x{85BD}\x{85BE}\x{85BF}\x{85C0}\x{85C1}\x{85C2}\x{85C3}\x{85C4}' .
+'\x{85C5}\x{85C6}\x{85C7}\x{85C8}\x{85C9}\x{85CA}\x{85CB}\x{85CD}\x{85CE}' .
+'\x{85CF}\x{85D0}\x{85D1}\x{85D2}\x{85D3}\x{85D4}\x{85D5}\x{85D6}\x{85D7}' .
+'\x{85D8}\x{85D9}\x{85DA}\x{85DB}\x{85DC}\x{85DD}\x{85DE}\x{85DF}\x{85E0}' .
+'\x{85E1}\x{85E2}\x{85E3}\x{85E4}\x{85E5}\x{85E6}\x{85E7}\x{85E8}\x{85E9}' .
+'\x{85EA}\x{85EB}\x{85EC}\x{85ED}\x{85EF}\x{85F0}\x{85F1}\x{85F2}\x{85F4}' .
+'\x{85F5}\x{85F6}\x{85F7}\x{85F8}\x{85F9}\x{85FA}\x{85FB}\x{85FD}\x{85FE}' .
+'\x{85FF}\x{8600}\x{8601}\x{8602}\x{8604}\x{8605}\x{8606}\x{8607}\x{8608}' .
+'\x{8609}\x{860A}\x{860B}\x{860C}\x{860F}\x{8611}\x{8612}\x{8613}\x{8614}' .
+'\x{8616}\x{8617}\x{8618}\x{8619}\x{861A}\x{861B}\x{861C}\x{861E}\x{861F}' .
+'\x{8620}\x{8621}\x{8622}\x{8623}\x{8624}\x{8625}\x{8626}\x{8627}\x{8628}' .
+'\x{8629}\x{862A}\x{862B}\x{862C}\x{862D}\x{862E}\x{862F}\x{8630}\x{8631}' .
+'\x{8632}\x{8633}\x{8634}\x{8635}\x{8636}\x{8638}\x{8639}\x{863A}\x{863B}' .
+'\x{863C}\x{863D}\x{863E}\x{863F}\x{8640}\x{8641}\x{8642}\x{8643}\x{8644}' .
+'\x{8645}\x{8646}\x{8647}\x{8648}\x{8649}\x{864A}\x{864B}\x{864C}\x{864D}' .
+'\x{864E}\x{864F}\x{8650}\x{8651}\x{8652}\x{8653}\x{8654}\x{8655}\x{8656}' .
+'\x{8658}\x{8659}\x{865A}\x{865B}\x{865C}\x{865D}\x{865E}\x{865F}\x{8660}' .
+'\x{8661}\x{8662}\x{8663}\x{8664}\x{8665}\x{8666}\x{8667}\x{8668}\x{8669}' .
+'\x{866A}\x{866B}\x{866C}\x{866D}\x{866E}\x{866F}\x{8670}\x{8671}\x{8672}' .
+'\x{8673}\x{8674}\x{8676}\x{8677}\x{8678}\x{8679}\x{867A}\x{867B}\x{867C}' .
+'\x{867D}\x{867E}\x{867F}\x{8680}\x{8681}\x{8682}\x{8683}\x{8684}\x{8685}' .
+'\x{8686}\x{8687}\x{8688}\x{868A}\x{868B}\x{868C}\x{868D}\x{868E}\x{868F}' .
+'\x{8690}\x{8691}\x{8693}\x{8694}\x{8695}\x{8696}\x{8697}\x{8698}\x{8699}' .
+'\x{869A}\x{869B}\x{869C}\x{869D}\x{869E}\x{869F}\x{86A1}\x{86A2}\x{86A3}' .
+'\x{86A4}\x{86A5}\x{86A7}\x{86A8}\x{86A9}\x{86AA}\x{86AB}\x{86AC}\x{86AD}' .
+'\x{86AE}\x{86AF}\x{86B0}\x{86B1}\x{86B2}\x{86B3}\x{86B4}\x{86B5}\x{86B6}' .
+'\x{86B7}\x{86B8}\x{86B9}\x{86BA}\x{86BB}\x{86BC}\x{86BD}\x{86BE}\x{86BF}' .
+'\x{86C0}\x{86C1}\x{86C2}\x{86C3}\x{86C4}\x{86C5}\x{86C6}\x{86C7}\x{86C8}' .
+'\x{86C9}\x{86CA}\x{86CB}\x{86CC}\x{86CE}\x{86CF}\x{86D0}\x{86D1}\x{86D2}' .
+'\x{86D3}\x{86D4}\x{86D6}\x{86D7}\x{86D8}\x{86D9}\x{86DA}\x{86DB}\x{86DC}' .
+'\x{86DD}\x{86DE}\x{86DF}\x{86E1}\x{86E2}\x{86E3}\x{86E4}\x{86E5}\x{86E6}' .
+'\x{86E8}\x{86E9}\x{86EA}\x{86EB}\x{86EC}\x{86ED}\x{86EE}\x{86EF}\x{86F0}' .
+'\x{86F1}\x{86F2}\x{86F3}\x{86F4}\x{86F5}\x{86F6}\x{86F7}\x{86F8}\x{86F9}' .
+'\x{86FA}\x{86FB}\x{86FC}\x{86FE}\x{86FF}\x{8700}\x{8701}\x{8702}\x{8703}' .
+'\x{8704}\x{8705}\x{8706}\x{8707}\x{8708}\x{8709}\x{870A}\x{870B}\x{870C}' .
+'\x{870D}\x{870E}\x{870F}\x{8710}\x{8711}\x{8712}\x{8713}\x{8714}\x{8715}' .
+'\x{8716}\x{8717}\x{8718}\x{8719}\x{871A}\x{871B}\x{871C}\x{871E}\x{871F}' .
+'\x{8720}\x{8721}\x{8722}\x{8723}\x{8724}\x{8725}\x{8726}\x{8727}\x{8728}' .
+'\x{8729}\x{872A}\x{872B}\x{872C}\x{872D}\x{872E}\x{8730}\x{8731}\x{8732}' .
+'\x{8733}\x{8734}\x{8735}\x{8736}\x{8737}\x{8738}\x{8739}\x{873A}\x{873B}' .
+'\x{873C}\x{873E}\x{873F}\x{8740}\x{8741}\x{8742}\x{8743}\x{8744}\x{8746}' .
+'\x{8747}\x{8748}\x{8749}\x{874A}\x{874C}\x{874D}\x{874E}\x{874F}\x{8750}' .
+'\x{8751}\x{8752}\x{8753}\x{8754}\x{8755}\x{8756}\x{8757}\x{8758}\x{8759}' .
+'\x{875A}\x{875B}\x{875C}\x{875D}\x{875E}\x{875F}\x{8760}\x{8761}\x{8762}' .
+'\x{8763}\x{8764}\x{8765}\x{8766}\x{8767}\x{8768}\x{8769}\x{876A}\x{876B}' .
+'\x{876C}\x{876D}\x{876E}\x{876F}\x{8770}\x{8772}\x{8773}\x{8774}\x{8775}' .
+'\x{8776}\x{8777}\x{8778}\x{8779}\x{877A}\x{877B}\x{877C}\x{877D}\x{877E}' .
+'\x{8780}\x{8781}\x{8782}\x{8783}\x{8784}\x{8785}\x{8786}\x{8787}\x{8788}' .
+'\x{8789}\x{878A}\x{878B}\x{878C}\x{878D}\x{878F}\x{8790}\x{8791}\x{8792}' .
+'\x{8793}\x{8794}\x{8795}\x{8796}\x{8797}\x{8798}\x{879A}\x{879B}\x{879C}' .
+'\x{879D}\x{879E}\x{879F}\x{87A0}\x{87A1}\x{87A2}\x{87A3}\x{87A4}\x{87A5}' .
+'\x{87A6}\x{87A7}\x{87A8}\x{87A9}\x{87AA}\x{87AB}\x{87AC}\x{87AD}\x{87AE}' .
+'\x{87AF}\x{87B0}\x{87B1}\x{87B2}\x{87B3}\x{87B4}\x{87B5}\x{87B6}\x{87B7}' .
+'\x{87B8}\x{87B9}\x{87BA}\x{87BB}\x{87BC}\x{87BD}\x{87BE}\x{87BF}\x{87C0}' .
+'\x{87C1}\x{87C2}\x{87C3}\x{87C4}\x{87C5}\x{87C6}\x{87C7}\x{87C8}\x{87C9}' .
+'\x{87CA}\x{87CB}\x{87CC}\x{87CD}\x{87CE}\x{87CF}\x{87D0}\x{87D1}\x{87D2}' .
+'\x{87D3}\x{87D4}\x{87D5}\x{87D6}\x{87D7}\x{87D8}\x{87D9}\x{87DB}\x{87DC}' .
+'\x{87DD}\x{87DE}\x{87DF}\x{87E0}\x{87E1}\x{87E2}\x{87E3}\x{87E4}\x{87E5}' .
+'\x{87E6}\x{87E7}\x{87E8}\x{87E9}\x{87EA}\x{87EB}\x{87EC}\x{87ED}\x{87EE}' .
+'\x{87EF}\x{87F1}\x{87F2}\x{87F3}\x{87F4}\x{87F5}\x{87F6}\x{87F7}\x{87F8}' .
+'\x{87F9}\x{87FA}\x{87FB}\x{87FC}\x{87FD}\x{87FE}\x{87FF}\x{8800}\x{8801}' .
+'\x{8802}\x{8803}\x{8804}\x{8805}\x{8806}\x{8808}\x{8809}\x{880A}\x{880B}' .
+'\x{880C}\x{880D}\x{880E}\x{880F}\x{8810}\x{8811}\x{8813}\x{8814}\x{8815}' .
+'\x{8816}\x{8817}\x{8818}\x{8819}\x{881A}\x{881B}\x{881C}\x{881D}\x{881E}' .
+'\x{881F}\x{8820}\x{8821}\x{8822}\x{8823}\x{8824}\x{8825}\x{8826}\x{8827}' .
+'\x{8828}\x{8829}\x{882A}\x{882B}\x{882C}\x{882E}\x{882F}\x{8830}\x{8831}' .
+'\x{8832}\x{8833}\x{8834}\x{8835}\x{8836}\x{8837}\x{8838}\x{8839}\x{883B}' .
+'\x{883C}\x{883D}\x{883E}\x{883F}\x{8840}\x{8841}\x{8842}\x{8843}\x{8844}' .
+'\x{8845}\x{8846}\x{8848}\x{8849}\x{884A}\x{884B}\x{884C}\x{884D}\x{884E}' .
+'\x{884F}\x{8850}\x{8851}\x{8852}\x{8853}\x{8854}\x{8855}\x{8856}\x{8857}' .
+'\x{8859}\x{885A}\x{885B}\x{885D}\x{885E}\x{8860}\x{8861}\x{8862}\x{8863}' .
+'\x{8864}\x{8865}\x{8866}\x{8867}\x{8868}\x{8869}\x{886A}\x{886B}\x{886C}' .
+'\x{886D}\x{886E}\x{886F}\x{8870}\x{8871}\x{8872}\x{8873}\x{8874}\x{8875}' .
+'\x{8876}\x{8877}\x{8878}\x{8879}\x{887B}\x{887C}\x{887D}\x{887E}\x{887F}' .
+'\x{8880}\x{8881}\x{8882}\x{8883}\x{8884}\x{8885}\x{8886}\x{8887}\x{8888}' .
+'\x{8889}\x{888A}\x{888B}\x{888C}\x{888D}\x{888E}\x{888F}\x{8890}\x{8891}' .
+'\x{8892}\x{8893}\x{8894}\x{8895}\x{8896}\x{8897}\x{8898}\x{8899}\x{889A}' .
+'\x{889B}\x{889C}\x{889D}\x{889E}\x{889F}\x{88A0}\x{88A1}\x{88A2}\x{88A3}' .
+'\x{88A4}\x{88A5}\x{88A6}\x{88A7}\x{88A8}\x{88A9}\x{88AA}\x{88AB}\x{88AC}' .
+'\x{88AD}\x{88AE}\x{88AF}\x{88B0}\x{88B1}\x{88B2}\x{88B3}\x{88B4}\x{88B6}' .
+'\x{88B7}\x{88B8}\x{88B9}\x{88BA}\x{88BB}\x{88BC}\x{88BD}\x{88BE}\x{88BF}' .
+'\x{88C0}\x{88C1}\x{88C2}\x{88C3}\x{88C4}\x{88C5}\x{88C6}\x{88C7}\x{88C8}' .
+'\x{88C9}\x{88CA}\x{88CB}\x{88CC}\x{88CD}\x{88CE}\x{88CF}\x{88D0}\x{88D1}' .
+'\x{88D2}\x{88D3}\x{88D4}\x{88D5}\x{88D6}\x{88D7}\x{88D8}\x{88D9}\x{88DA}' .
+'\x{88DB}\x{88DC}\x{88DD}\x{88DE}\x{88DF}\x{88E0}\x{88E1}\x{88E2}\x{88E3}' .
+'\x{88E4}\x{88E5}\x{88E7}\x{88E8}\x{88EA}\x{88EB}\x{88EC}\x{88EE}\x{88EF}' .
+'\x{88F0}\x{88F1}\x{88F2}\x{88F3}\x{88F4}\x{88F5}\x{88F6}\x{88F7}\x{88F8}' .
+'\x{88F9}\x{88FA}\x{88FB}\x{88FC}\x{88FD}\x{88FE}\x{88FF}\x{8900}\x{8901}' .
+'\x{8902}\x{8904}\x{8905}\x{8906}\x{8907}\x{8908}\x{8909}\x{890A}\x{890B}' .
+'\x{890C}\x{890D}\x{890E}\x{8910}\x{8911}\x{8912}\x{8913}\x{8914}\x{8915}' .
+'\x{8916}\x{8917}\x{8918}\x{8919}\x{891A}\x{891B}\x{891C}\x{891D}\x{891E}' .
+'\x{891F}\x{8920}\x{8921}\x{8922}\x{8923}\x{8925}\x{8926}\x{8927}\x{8928}' .
+'\x{8929}\x{892A}\x{892B}\x{892C}\x{892D}\x{892E}\x{892F}\x{8930}\x{8931}' .
+'\x{8932}\x{8933}\x{8934}\x{8935}\x{8936}\x{8937}\x{8938}\x{8939}\x{893A}' .
+'\x{893B}\x{893C}\x{893D}\x{893E}\x{893F}\x{8940}\x{8941}\x{8942}\x{8943}' .
+'\x{8944}\x{8945}\x{8946}\x{8947}\x{8948}\x{8949}\x{894A}\x{894B}\x{894C}' .
+'\x{894E}\x{894F}\x{8950}\x{8951}\x{8952}\x{8953}\x{8954}\x{8955}\x{8956}' .
+'\x{8957}\x{8958}\x{8959}\x{895A}\x{895B}\x{895C}\x{895D}\x{895E}\x{895F}' .
+'\x{8960}\x{8961}\x{8962}\x{8963}\x{8964}\x{8966}\x{8967}\x{8968}\x{8969}' .
+'\x{896A}\x{896B}\x{896C}\x{896D}\x{896E}\x{896F}\x{8970}\x{8971}\x{8972}' .
+'\x{8973}\x{8974}\x{8976}\x{8977}\x{8978}\x{8979}\x{897A}\x{897B}\x{897C}' .
+'\x{897E}\x{897F}\x{8980}\x{8981}\x{8982}\x{8983}\x{8984}\x{8985}\x{8986}' .
+'\x{8987}\x{8988}\x{8989}\x{898A}\x{898B}\x{898C}\x{898E}\x{898F}\x{8991}' .
+'\x{8992}\x{8993}\x{8995}\x{8996}\x{8997}\x{8998}\x{899A}\x{899B}\x{899C}' .
+'\x{899D}\x{899E}\x{899F}\x{89A0}\x{89A1}\x{89A2}\x{89A3}\x{89A4}\x{89A5}' .
+'\x{89A6}\x{89A7}\x{89A8}\x{89AA}\x{89AB}\x{89AC}\x{89AD}\x{89AE}\x{89AF}' .
+'\x{89B1}\x{89B2}\x{89B3}\x{89B5}\x{89B6}\x{89B7}\x{89B8}\x{89B9}\x{89BA}' .
+'\x{89BD}\x{89BE}\x{89BF}\x{89C0}\x{89C1}\x{89C2}\x{89C3}\x{89C4}\x{89C5}' .
+'\x{89C6}\x{89C7}\x{89C8}\x{89C9}\x{89CA}\x{89CB}\x{89CC}\x{89CD}\x{89CE}' .
+'\x{89CF}\x{89D0}\x{89D1}\x{89D2}\x{89D3}\x{89D4}\x{89D5}\x{89D6}\x{89D7}' .
+'\x{89D8}\x{89D9}\x{89DA}\x{89DB}\x{89DC}\x{89DD}\x{89DE}\x{89DF}\x{89E0}' .
+'\x{89E1}\x{89E2}\x{89E3}\x{89E4}\x{89E5}\x{89E6}\x{89E7}\x{89E8}\x{89E9}' .
+'\x{89EA}\x{89EB}\x{89EC}\x{89ED}\x{89EF}\x{89F0}\x{89F1}\x{89F2}\x{89F3}' .
+'\x{89F4}\x{89F6}\x{89F7}\x{89F8}\x{89FA}\x{89FB}\x{89FC}\x{89FE}\x{89FF}' .
+'\x{8A00}\x{8A01}\x{8A02}\x{8A03}\x{8A04}\x{8A07}\x{8A08}\x{8A09}\x{8A0A}' .
+'\x{8A0B}\x{8A0C}\x{8A0D}\x{8A0E}\x{8A0F}\x{8A10}\x{8A11}\x{8A12}\x{8A13}' .
+'\x{8A15}\x{8A16}\x{8A17}\x{8A18}\x{8A1A}\x{8A1B}\x{8A1C}\x{8A1D}\x{8A1E}' .
+'\x{8A1F}\x{8A22}\x{8A23}\x{8A24}\x{8A25}\x{8A26}\x{8A27}\x{8A28}\x{8A29}' .
+'\x{8A2A}\x{8A2C}\x{8A2D}\x{8A2E}\x{8A2F}\x{8A30}\x{8A31}\x{8A32}\x{8A34}' .
+'\x{8A35}\x{8A36}\x{8A37}\x{8A38}\x{8A39}\x{8A3A}\x{8A3B}\x{8A3C}\x{8A3E}' .
+'\x{8A3F}\x{8A40}\x{8A41}\x{8A42}\x{8A43}\x{8A44}\x{8A45}\x{8A46}\x{8A47}' .
+'\x{8A48}\x{8A49}\x{8A4A}\x{8A4C}\x{8A4D}\x{8A4E}\x{8A4F}\x{8A50}\x{8A51}' .
+'\x{8A52}\x{8A53}\x{8A54}\x{8A55}\x{8A56}\x{8A57}\x{8A58}\x{8A59}\x{8A5A}' .
+'\x{8A5B}\x{8A5C}\x{8A5D}\x{8A5E}\x{8A5F}\x{8A60}\x{8A61}\x{8A62}\x{8A63}' .
+'\x{8A65}\x{8A66}\x{8A67}\x{8A68}\x{8A69}\x{8A6A}\x{8A6B}\x{8A6C}\x{8A6D}' .
+'\x{8A6E}\x{8A6F}\x{8A70}\x{8A71}\x{8A72}\x{8A73}\x{8A74}\x{8A75}\x{8A76}' .
+'\x{8A77}\x{8A79}\x{8A7A}\x{8A7B}\x{8A7C}\x{8A7E}\x{8A7F}\x{8A80}\x{8A81}' .
+'\x{8A82}\x{8A83}\x{8A84}\x{8A85}\x{8A86}\x{8A87}\x{8A89}\x{8A8A}\x{8A8B}' .
+'\x{8A8C}\x{8A8D}\x{8A8E}\x{8A8F}\x{8A90}\x{8A91}\x{8A92}\x{8A93}\x{8A94}' .
+'\x{8A95}\x{8A96}\x{8A97}\x{8A98}\x{8A99}\x{8A9A}\x{8A9B}\x{8A9C}\x{8A9D}' .
+'\x{8A9E}\x{8AA0}\x{8AA1}\x{8AA2}\x{8AA3}\x{8AA4}\x{8AA5}\x{8AA6}\x{8AA7}' .
+'\x{8AA8}\x{8AA9}\x{8AAA}\x{8AAB}\x{8AAC}\x{8AAE}\x{8AB0}\x{8AB1}\x{8AB2}' .
+'\x{8AB3}\x{8AB4}\x{8AB5}\x{8AB6}\x{8AB8}\x{8AB9}\x{8ABA}\x{8ABB}\x{8ABC}' .
+'\x{8ABD}\x{8ABE}\x{8ABF}\x{8AC0}\x{8AC1}\x{8AC2}\x{8AC3}\x{8AC4}\x{8AC5}' .
+'\x{8AC6}\x{8AC7}\x{8AC8}\x{8AC9}\x{8ACA}\x{8ACB}\x{8ACC}\x{8ACD}\x{8ACE}' .
+'\x{8ACF}\x{8AD1}\x{8AD2}\x{8AD3}\x{8AD4}\x{8AD5}\x{8AD6}\x{8AD7}\x{8AD8}' .
+'\x{8AD9}\x{8ADA}\x{8ADB}\x{8ADC}\x{8ADD}\x{8ADE}\x{8ADF}\x{8AE0}\x{8AE1}' .
+'\x{8AE2}\x{8AE3}\x{8AE4}\x{8AE5}\x{8AE6}\x{8AE7}\x{8AE8}\x{8AE9}\x{8AEA}' .
+'\x{8AEB}\x{8AED}\x{8AEE}\x{8AEF}\x{8AF0}\x{8AF1}\x{8AF2}\x{8AF3}\x{8AF4}' .
+'\x{8AF5}\x{8AF6}\x{8AF7}\x{8AF8}\x{8AF9}\x{8AFA}\x{8AFB}\x{8AFC}\x{8AFD}' .
+'\x{8AFE}\x{8AFF}\x{8B00}\x{8B01}\x{8B02}\x{8B03}\x{8B04}\x{8B05}\x{8B06}' .
+'\x{8B07}\x{8B08}\x{8B09}\x{8B0A}\x{8B0B}\x{8B0D}\x{8B0E}\x{8B0F}\x{8B10}' .
+'\x{8B11}\x{8B12}\x{8B13}\x{8B14}\x{8B15}\x{8B16}\x{8B17}\x{8B18}\x{8B19}' .
+'\x{8B1A}\x{8B1B}\x{8B1C}\x{8B1D}\x{8B1E}\x{8B1F}\x{8B20}\x{8B21}\x{8B22}' .
+'\x{8B23}\x{8B24}\x{8B25}\x{8B26}\x{8B27}\x{8B28}\x{8B2A}\x{8B2B}\x{8B2C}' .
+'\x{8B2D}\x{8B2E}\x{8B2F}\x{8B30}\x{8B31}\x{8B33}\x{8B34}\x{8B35}\x{8B36}' .
+'\x{8B37}\x{8B39}\x{8B3A}\x{8B3B}\x{8B3C}\x{8B3D}\x{8B3E}\x{8B40}\x{8B41}' .
+'\x{8B42}\x{8B43}\x{8B44}\x{8B45}\x{8B46}\x{8B47}\x{8B48}\x{8B49}\x{8B4A}' .
+'\x{8B4B}\x{8B4C}\x{8B4D}\x{8B4E}\x{8B4F}\x{8B50}\x{8B51}\x{8B52}\x{8B53}' .
+'\x{8B54}\x{8B55}\x{8B56}\x{8B57}\x{8B58}\x{8B59}\x{8B5A}\x{8B5B}\x{8B5C}' .
+'\x{8B5D}\x{8B5E}\x{8B5F}\x{8B60}\x{8B63}\x{8B64}\x{8B65}\x{8B66}\x{8B67}' .
+'\x{8B68}\x{8B6A}\x{8B6B}\x{8B6C}\x{8B6D}\x{8B6E}\x{8B6F}\x{8B70}\x{8B71}' .
+'\x{8B73}\x{8B74}\x{8B76}\x{8B77}\x{8B78}\x{8B79}\x{8B7A}\x{8B7B}\x{8B7D}' .
+'\x{8B7E}\x{8B7F}\x{8B80}\x{8B82}\x{8B83}\x{8B84}\x{8B85}\x{8B86}\x{8B88}' .
+'\x{8B89}\x{8B8A}\x{8B8B}\x{8B8C}\x{8B8E}\x{8B90}\x{8B91}\x{8B92}\x{8B93}' .
+'\x{8B94}\x{8B95}\x{8B96}\x{8B97}\x{8B98}\x{8B99}\x{8B9A}\x{8B9C}\x{8B9D}' .
+'\x{8B9E}\x{8B9F}\x{8BA0}\x{8BA1}\x{8BA2}\x{8BA3}\x{8BA4}\x{8BA5}\x{8BA6}' .
+'\x{8BA7}\x{8BA8}\x{8BA9}\x{8BAA}\x{8BAB}\x{8BAC}\x{8BAD}\x{8BAE}\x{8BAF}' .
+'\x{8BB0}\x{8BB1}\x{8BB2}\x{8BB3}\x{8BB4}\x{8BB5}\x{8BB6}\x{8BB7}\x{8BB8}' .
+'\x{8BB9}\x{8BBA}\x{8BBB}\x{8BBC}\x{8BBD}\x{8BBE}\x{8BBF}\x{8BC0}\x{8BC1}' .
+'\x{8BC2}\x{8BC3}\x{8BC4}\x{8BC5}\x{8BC6}\x{8BC7}\x{8BC8}\x{8BC9}\x{8BCA}' .
+'\x{8BCB}\x{8BCC}\x{8BCD}\x{8BCE}\x{8BCF}\x{8BD0}\x{8BD1}\x{8BD2}\x{8BD3}' .
+'\x{8BD4}\x{8BD5}\x{8BD6}\x{8BD7}\x{8BD8}\x{8BD9}\x{8BDA}\x{8BDB}\x{8BDC}' .
+'\x{8BDD}\x{8BDE}\x{8BDF}\x{8BE0}\x{8BE1}\x{8BE2}\x{8BE3}\x{8BE4}\x{8BE5}' .
+'\x{8BE6}\x{8BE7}\x{8BE8}\x{8BE9}\x{8BEA}\x{8BEB}\x{8BEC}\x{8BED}\x{8BEE}' .
+'\x{8BEF}\x{8BF0}\x{8BF1}\x{8BF2}\x{8BF3}\x{8BF4}\x{8BF5}\x{8BF6}\x{8BF7}' .
+'\x{8BF8}\x{8BF9}\x{8BFA}\x{8BFB}\x{8BFC}\x{8BFD}\x{8BFE}\x{8BFF}\x{8C00}' .
+'\x{8C01}\x{8C02}\x{8C03}\x{8C04}\x{8C05}\x{8C06}\x{8C07}\x{8C08}\x{8C09}' .
+'\x{8C0A}\x{8C0B}\x{8C0C}\x{8C0D}\x{8C0E}\x{8C0F}\x{8C10}\x{8C11}\x{8C12}' .
+'\x{8C13}\x{8C14}\x{8C15}\x{8C16}\x{8C17}\x{8C18}\x{8C19}\x{8C1A}\x{8C1B}' .
+'\x{8C1C}\x{8C1D}\x{8C1E}\x{8C1F}\x{8C20}\x{8C21}\x{8C22}\x{8C23}\x{8C24}' .
+'\x{8C25}\x{8C26}\x{8C27}\x{8C28}\x{8C29}\x{8C2A}\x{8C2B}\x{8C2C}\x{8C2D}' .
+'\x{8C2E}\x{8C2F}\x{8C30}\x{8C31}\x{8C32}\x{8C33}\x{8C34}\x{8C35}\x{8C36}' .
+'\x{8C37}\x{8C39}\x{8C3A}\x{8C3B}\x{8C3C}\x{8C3D}\x{8C3E}\x{8C3F}\x{8C41}' .
+'\x{8C42}\x{8C43}\x{8C45}\x{8C46}\x{8C47}\x{8C48}\x{8C49}\x{8C4A}\x{8C4B}' .
+'\x{8C4C}\x{8C4D}\x{8C4E}\x{8C4F}\x{8C50}\x{8C54}\x{8C55}\x{8C56}\x{8C57}' .
+'\x{8C59}\x{8C5A}\x{8C5B}\x{8C5C}\x{8C5D}\x{8C5E}\x{8C5F}\x{8C60}\x{8C61}' .
+'\x{8C62}\x{8C63}\x{8C64}\x{8C65}\x{8C66}\x{8C67}\x{8C68}\x{8C69}\x{8C6A}' .
+'\x{8C6B}\x{8C6C}\x{8C6D}\x{8C6E}\x{8C6F}\x{8C70}\x{8C71}\x{8C72}\x{8C73}' .
+'\x{8C75}\x{8C76}\x{8C77}\x{8C78}\x{8C79}\x{8C7A}\x{8C7B}\x{8C7D}\x{8C7E}' .
+'\x{8C80}\x{8C81}\x{8C82}\x{8C84}\x{8C85}\x{8C86}\x{8C88}\x{8C89}\x{8C8A}' .
+'\x{8C8C}\x{8C8D}\x{8C8F}\x{8C90}\x{8C91}\x{8C92}\x{8C93}\x{8C94}\x{8C95}' .
+'\x{8C96}\x{8C97}\x{8C98}\x{8C99}\x{8C9A}\x{8C9C}\x{8C9D}\x{8C9E}\x{8C9F}' .
+'\x{8CA0}\x{8CA1}\x{8CA2}\x{8CA3}\x{8CA4}\x{8CA5}\x{8CA7}\x{8CA8}\x{8CA9}' .
+'\x{8CAA}\x{8CAB}\x{8CAC}\x{8CAD}\x{8CAE}\x{8CAF}\x{8CB0}\x{8CB1}\x{8CB2}' .
+'\x{8CB3}\x{8CB4}\x{8CB5}\x{8CB6}\x{8CB7}\x{8CB8}\x{8CB9}\x{8CBA}\x{8CBB}' .
+'\x{8CBC}\x{8CBD}\x{8CBE}\x{8CBF}\x{8CC0}\x{8CC1}\x{8CC2}\x{8CC3}\x{8CC4}' .
+'\x{8CC5}\x{8CC6}\x{8CC7}\x{8CC8}\x{8CC9}\x{8CCA}\x{8CCC}\x{8CCE}\x{8CCF}' .
+'\x{8CD0}\x{8CD1}\x{8CD2}\x{8CD3}\x{8CD4}\x{8CD5}\x{8CD7}\x{8CD9}\x{8CDA}' .
+'\x{8CDB}\x{8CDC}\x{8CDD}\x{8CDE}\x{8CDF}\x{8CE0}\x{8CE1}\x{8CE2}\x{8CE3}' .
+'\x{8CE4}\x{8CE5}\x{8CE6}\x{8CE7}\x{8CE8}\x{8CEA}\x{8CEB}\x{8CEC}\x{8CED}' .
+'\x{8CEE}\x{8CEF}\x{8CF0}\x{8CF1}\x{8CF2}\x{8CF3}\x{8CF4}\x{8CF5}\x{8CF6}' .
+'\x{8CF8}\x{8CF9}\x{8CFA}\x{8CFB}\x{8CFC}\x{8CFD}\x{8CFE}\x{8CFF}\x{8D00}' .
+'\x{8D02}\x{8D03}\x{8D04}\x{8D05}\x{8D06}\x{8D07}\x{8D08}\x{8D09}\x{8D0A}' .
+'\x{8D0B}\x{8D0C}\x{8D0D}\x{8D0E}\x{8D0F}\x{8D10}\x{8D13}\x{8D14}\x{8D15}' .
+'\x{8D16}\x{8D17}\x{8D18}\x{8D19}\x{8D1A}\x{8D1B}\x{8D1C}\x{8D1D}\x{8D1E}' .
+'\x{8D1F}\x{8D20}\x{8D21}\x{8D22}\x{8D23}\x{8D24}\x{8D25}\x{8D26}\x{8D27}' .
+'\x{8D28}\x{8D29}\x{8D2A}\x{8D2B}\x{8D2C}\x{8D2D}\x{8D2E}\x{8D2F}\x{8D30}' .
+'\x{8D31}\x{8D32}\x{8D33}\x{8D34}\x{8D35}\x{8D36}\x{8D37}\x{8D38}\x{8D39}' .
+'\x{8D3A}\x{8D3B}\x{8D3C}\x{8D3D}\x{8D3E}\x{8D3F}\x{8D40}\x{8D41}\x{8D42}' .
+'\x{8D43}\x{8D44}\x{8D45}\x{8D46}\x{8D47}\x{8D48}\x{8D49}\x{8D4A}\x{8D4B}' .
+'\x{8D4C}\x{8D4D}\x{8D4E}\x{8D4F}\x{8D50}\x{8D51}\x{8D52}\x{8D53}\x{8D54}' .
+'\x{8D55}\x{8D56}\x{8D57}\x{8D58}\x{8D59}\x{8D5A}\x{8D5B}\x{8D5C}\x{8D5D}' .
+'\x{8D5E}\x{8D5F}\x{8D60}\x{8D61}\x{8D62}\x{8D63}\x{8D64}\x{8D65}\x{8D66}' .
+'\x{8D67}\x{8D68}\x{8D69}\x{8D6A}\x{8D6B}\x{8D6C}\x{8D6D}\x{8D6E}\x{8D6F}' .
+'\x{8D70}\x{8D71}\x{8D72}\x{8D73}\x{8D74}\x{8D75}\x{8D76}\x{8D77}\x{8D78}' .
+'\x{8D79}\x{8D7A}\x{8D7B}\x{8D7D}\x{8D7E}\x{8D7F}\x{8D80}\x{8D81}\x{8D82}' .
+'\x{8D83}\x{8D84}\x{8D85}\x{8D86}\x{8D87}\x{8D88}\x{8D89}\x{8D8A}\x{8D8B}' .
+'\x{8D8C}\x{8D8D}\x{8D8E}\x{8D8F}\x{8D90}\x{8D91}\x{8D92}\x{8D93}\x{8D94}' .
+'\x{8D95}\x{8D96}\x{8D97}\x{8D98}\x{8D99}\x{8D9A}\x{8D9B}\x{8D9C}\x{8D9D}' .
+'\x{8D9E}\x{8D9F}\x{8DA0}\x{8DA1}\x{8DA2}\x{8DA3}\x{8DA4}\x{8DA5}\x{8DA7}' .
+'\x{8DA8}\x{8DA9}\x{8DAA}\x{8DAB}\x{8DAC}\x{8DAD}\x{8DAE}\x{8DAF}\x{8DB0}' .
+'\x{8DB1}\x{8DB2}\x{8DB3}\x{8DB4}\x{8DB5}\x{8DB6}\x{8DB7}\x{8DB8}\x{8DB9}' .
+'\x{8DBA}\x{8DBB}\x{8DBC}\x{8DBD}\x{8DBE}\x{8DBF}\x{8DC1}\x{8DC2}\x{8DC3}' .
+'\x{8DC4}\x{8DC5}\x{8DC6}\x{8DC7}\x{8DC8}\x{8DC9}\x{8DCA}\x{8DCB}\x{8DCC}' .
+'\x{8DCD}\x{8DCE}\x{8DCF}\x{8DD0}\x{8DD1}\x{8DD2}\x{8DD3}\x{8DD4}\x{8DD5}' .
+'\x{8DD6}\x{8DD7}\x{8DD8}\x{8DD9}\x{8DDA}\x{8DDB}\x{8DDC}\x{8DDD}\x{8DDE}' .
+'\x{8DDF}\x{8DE0}\x{8DE1}\x{8DE2}\x{8DE3}\x{8DE4}\x{8DE6}\x{8DE7}\x{8DE8}' .
+'\x{8DE9}\x{8DEA}\x{8DEB}\x{8DEC}\x{8DED}\x{8DEE}\x{8DEF}\x{8DF0}\x{8DF1}' .
+'\x{8DF2}\x{8DF3}\x{8DF4}\x{8DF5}\x{8DF6}\x{8DF7}\x{8DF8}\x{8DF9}\x{8DFA}' .
+'\x{8DFB}\x{8DFC}\x{8DFD}\x{8DFE}\x{8DFF}\x{8E00}\x{8E02}\x{8E03}\x{8E04}' .
+'\x{8E05}\x{8E06}\x{8E07}\x{8E08}\x{8E09}\x{8E0A}\x{8E0C}\x{8E0D}\x{8E0E}' .
+'\x{8E0F}\x{8E10}\x{8E11}\x{8E12}\x{8E13}\x{8E14}\x{8E15}\x{8E16}\x{8E17}' .
+'\x{8E18}\x{8E19}\x{8E1A}\x{8E1B}\x{8E1C}\x{8E1D}\x{8E1E}\x{8E1F}\x{8E20}' .
+'\x{8E21}\x{8E22}\x{8E23}\x{8E24}\x{8E25}\x{8E26}\x{8E27}\x{8E28}\x{8E29}' .
+'\x{8E2A}\x{8E2B}\x{8E2C}\x{8E2D}\x{8E2E}\x{8E2F}\x{8E30}\x{8E31}\x{8E33}' .
+'\x{8E34}\x{8E35}\x{8E36}\x{8E37}\x{8E38}\x{8E39}\x{8E3A}\x{8E3B}\x{8E3C}' .
+'\x{8E3D}\x{8E3E}\x{8E3F}\x{8E40}\x{8E41}\x{8E42}\x{8E43}\x{8E44}\x{8E45}' .
+'\x{8E47}\x{8E48}\x{8E49}\x{8E4A}\x{8E4B}\x{8E4C}\x{8E4D}\x{8E4E}\x{8E50}' .
+'\x{8E51}\x{8E52}\x{8E53}\x{8E54}\x{8E55}\x{8E56}\x{8E57}\x{8E58}\x{8E59}' .
+'\x{8E5A}\x{8E5B}\x{8E5C}\x{8E5D}\x{8E5E}\x{8E5F}\x{8E60}\x{8E61}\x{8E62}' .
+'\x{8E63}\x{8E64}\x{8E65}\x{8E66}\x{8E67}\x{8E68}\x{8E69}\x{8E6A}\x{8E6B}' .
+'\x{8E6C}\x{8E6D}\x{8E6F}\x{8E70}\x{8E71}\x{8E72}\x{8E73}\x{8E74}\x{8E76}' .
+'\x{8E78}\x{8E7A}\x{8E7B}\x{8E7C}\x{8E7D}\x{8E7E}\x{8E7F}\x{8E80}\x{8E81}' .
+'\x{8E82}\x{8E83}\x{8E84}\x{8E85}\x{8E86}\x{8E87}\x{8E88}\x{8E89}\x{8E8A}' .
+'\x{8E8B}\x{8E8C}\x{8E8D}\x{8E8E}\x{8E8F}\x{8E90}\x{8E91}\x{8E92}\x{8E93}' .
+'\x{8E94}\x{8E95}\x{8E96}\x{8E97}\x{8E98}\x{8E9A}\x{8E9C}\x{8E9D}\x{8E9E}' .
+'\x{8E9F}\x{8EA0}\x{8EA1}\x{8EA3}\x{8EA4}\x{8EA5}\x{8EA6}\x{8EA7}\x{8EA8}' .
+'\x{8EA9}\x{8EAA}\x{8EAB}\x{8EAC}\x{8EAD}\x{8EAE}\x{8EAF}\x{8EB0}\x{8EB1}' .
+'\x{8EB2}\x{8EB4}\x{8EB5}\x{8EB8}\x{8EB9}\x{8EBA}\x{8EBB}\x{8EBC}\x{8EBD}' .
+'\x{8EBE}\x{8EBF}\x{8EC0}\x{8EC2}\x{8EC3}\x{8EC5}\x{8EC6}\x{8EC7}\x{8EC8}' .
+'\x{8EC9}\x{8ECA}\x{8ECB}\x{8ECC}\x{8ECD}\x{8ECE}\x{8ECF}\x{8ED0}\x{8ED1}' .
+'\x{8ED2}\x{8ED3}\x{8ED4}\x{8ED5}\x{8ED6}\x{8ED7}\x{8ED8}\x{8EDA}\x{8EDB}' .
+'\x{8EDC}\x{8EDD}\x{8EDE}\x{8EDF}\x{8EE0}\x{8EE1}\x{8EE4}\x{8EE5}\x{8EE6}' .
+'\x{8EE7}\x{8EE8}\x{8EE9}\x{8EEA}\x{8EEB}\x{8EEC}\x{8EED}\x{8EEE}\x{8EEF}' .
+'\x{8EF1}\x{8EF2}\x{8EF3}\x{8EF4}\x{8EF5}\x{8EF6}\x{8EF7}\x{8EF8}\x{8EF9}' .
+'\x{8EFA}\x{8EFB}\x{8EFC}\x{8EFD}\x{8EFE}\x{8EFF}\x{8F00}\x{8F01}\x{8F02}' .
+'\x{8F03}\x{8F04}\x{8F05}\x{8F06}\x{8F07}\x{8F08}\x{8F09}\x{8F0A}\x{8F0B}' .
+'\x{8F0D}\x{8F0E}\x{8F10}\x{8F11}\x{8F12}\x{8F13}\x{8F14}\x{8F15}\x{8F16}' .
+'\x{8F17}\x{8F18}\x{8F1A}\x{8F1B}\x{8F1C}\x{8F1D}\x{8F1E}\x{8F1F}\x{8F20}' .
+'\x{8F21}\x{8F22}\x{8F23}\x{8F24}\x{8F25}\x{8F26}\x{8F27}\x{8F28}\x{8F29}' .
+'\x{8F2A}\x{8F2B}\x{8F2C}\x{8F2E}\x{8F2F}\x{8F30}\x{8F31}\x{8F32}\x{8F33}' .
+'\x{8F34}\x{8F35}\x{8F36}\x{8F37}\x{8F38}\x{8F39}\x{8F3B}\x{8F3C}\x{8F3D}' .
+'\x{8F3E}\x{8F3F}\x{8F40}\x{8F42}\x{8F43}\x{8F44}\x{8F45}\x{8F46}\x{8F47}' .
+'\x{8F48}\x{8F49}\x{8F4A}\x{8F4B}\x{8F4C}\x{8F4D}\x{8F4E}\x{8F4F}\x{8F50}' .
+'\x{8F51}\x{8F52}\x{8F53}\x{8F54}\x{8F55}\x{8F56}\x{8F57}\x{8F58}\x{8F59}' .
+'\x{8F5A}\x{8F5B}\x{8F5D}\x{8F5E}\x{8F5F}\x{8F60}\x{8F61}\x{8F62}\x{8F63}' .
+'\x{8F64}\x{8F65}\x{8F66}\x{8F67}\x{8F68}\x{8F69}\x{8F6A}\x{8F6B}\x{8F6C}' .
+'\x{8F6D}\x{8F6E}\x{8F6F}\x{8F70}\x{8F71}\x{8F72}\x{8F73}\x{8F74}\x{8F75}' .
+'\x{8F76}\x{8F77}\x{8F78}\x{8F79}\x{8F7A}\x{8F7B}\x{8F7C}\x{8F7D}\x{8F7E}' .
+'\x{8F7F}\x{8F80}\x{8F81}\x{8F82}\x{8F83}\x{8F84}\x{8F85}\x{8F86}\x{8F87}' .
+'\x{8F88}\x{8F89}\x{8F8A}\x{8F8B}\x{8F8C}\x{8F8D}\x{8F8E}\x{8F8F}\x{8F90}' .
+'\x{8F91}\x{8F92}\x{8F93}\x{8F94}\x{8F95}\x{8F96}\x{8F97}\x{8F98}\x{8F99}' .
+'\x{8F9A}\x{8F9B}\x{8F9C}\x{8F9E}\x{8F9F}\x{8FA0}\x{8FA1}\x{8FA2}\x{8FA3}' .
+'\x{8FA5}\x{8FA6}\x{8FA7}\x{8FA8}\x{8FA9}\x{8FAA}\x{8FAB}\x{8FAC}\x{8FAD}' .
+'\x{8FAE}\x{8FAF}\x{8FB0}\x{8FB1}\x{8FB2}\x{8FB4}\x{8FB5}\x{8FB6}\x{8FB7}' .
+'\x{8FB8}\x{8FB9}\x{8FBB}\x{8FBC}\x{8FBD}\x{8FBE}\x{8FBF}\x{8FC0}\x{8FC1}' .
+'\x{8FC2}\x{8FC4}\x{8FC5}\x{8FC6}\x{8FC7}\x{8FC8}\x{8FC9}\x{8FCB}\x{8FCC}' .
+'\x{8FCD}\x{8FCE}\x{8FCF}\x{8FD0}\x{8FD1}\x{8FD2}\x{8FD3}\x{8FD4}\x{8FD5}' .
+'\x{8FD6}\x{8FD7}\x{8FD8}\x{8FD9}\x{8FDA}\x{8FDB}\x{8FDC}\x{8FDD}\x{8FDE}' .
+'\x{8FDF}\x{8FE0}\x{8FE1}\x{8FE2}\x{8FE3}\x{8FE4}\x{8FE5}\x{8FE6}\x{8FE8}' .
+'\x{8FE9}\x{8FEA}\x{8FEB}\x{8FEC}\x{8FED}\x{8FEE}\x{8FEF}\x{8FF0}\x{8FF1}' .
+'\x{8FF2}\x{8FF3}\x{8FF4}\x{8FF5}\x{8FF6}\x{8FF7}\x{8FF8}\x{8FF9}\x{8FFA}' .
+'\x{8FFB}\x{8FFC}\x{8FFD}\x{8FFE}\x{8FFF}\x{9000}\x{9001}\x{9002}\x{9003}' .
+'\x{9004}\x{9005}\x{9006}\x{9007}\x{9008}\x{9009}\x{900A}\x{900B}\x{900C}' .
+'\x{900D}\x{900F}\x{9010}\x{9011}\x{9012}\x{9013}\x{9014}\x{9015}\x{9016}' .
+'\x{9017}\x{9018}\x{9019}\x{901A}\x{901B}\x{901C}\x{901D}\x{901E}\x{901F}' .
+'\x{9020}\x{9021}\x{9022}\x{9023}\x{9024}\x{9025}\x{9026}\x{9027}\x{9028}' .
+'\x{9029}\x{902B}\x{902D}\x{902E}\x{902F}\x{9030}\x{9031}\x{9032}\x{9033}' .
+'\x{9034}\x{9035}\x{9036}\x{9038}\x{903A}\x{903B}\x{903C}\x{903D}\x{903E}' .
+'\x{903F}\x{9041}\x{9042}\x{9043}\x{9044}\x{9045}\x{9047}\x{9048}\x{9049}' .
+'\x{904A}\x{904B}\x{904C}\x{904D}\x{904E}\x{904F}\x{9050}\x{9051}\x{9052}' .
+'\x{9053}\x{9054}\x{9055}\x{9056}\x{9057}\x{9058}\x{9059}\x{905A}\x{905B}' .
+'\x{905C}\x{905D}\x{905E}\x{905F}\x{9060}\x{9061}\x{9062}\x{9063}\x{9064}' .
+'\x{9065}\x{9066}\x{9067}\x{9068}\x{9069}\x{906A}\x{906B}\x{906C}\x{906D}' .
+'\x{906E}\x{906F}\x{9070}\x{9071}\x{9072}\x{9073}\x{9074}\x{9075}\x{9076}' .
+'\x{9077}\x{9078}\x{9079}\x{907A}\x{907B}\x{907C}\x{907D}\x{907E}\x{907F}' .
+'\x{9080}\x{9081}\x{9082}\x{9083}\x{9084}\x{9085}\x{9086}\x{9087}\x{9088}' .
+'\x{9089}\x{908A}\x{908B}\x{908C}\x{908D}\x{908E}\x{908F}\x{9090}\x{9091}' .
+'\x{9092}\x{9093}\x{9094}\x{9095}\x{9096}\x{9097}\x{9098}\x{9099}\x{909A}' .
+'\x{909B}\x{909C}\x{909D}\x{909E}\x{909F}\x{90A0}\x{90A1}\x{90A2}\x{90A3}' .
+'\x{90A4}\x{90A5}\x{90A6}\x{90A7}\x{90A8}\x{90A9}\x{90AA}\x{90AC}\x{90AD}' .
+'\x{90AE}\x{90AF}\x{90B0}\x{90B1}\x{90B2}\x{90B3}\x{90B4}\x{90B5}\x{90B6}' .
+'\x{90B7}\x{90B8}\x{90B9}\x{90BA}\x{90BB}\x{90BC}\x{90BD}\x{90BE}\x{90BF}' .
+'\x{90C0}\x{90C1}\x{90C2}\x{90C3}\x{90C4}\x{90C5}\x{90C6}\x{90C7}\x{90C8}' .
+'\x{90C9}\x{90CA}\x{90CB}\x{90CE}\x{90CF}\x{90D0}\x{90D1}\x{90D3}\x{90D4}' .
+'\x{90D5}\x{90D6}\x{90D7}\x{90D8}\x{90D9}\x{90DA}\x{90DB}\x{90DC}\x{90DD}' .
+'\x{90DE}\x{90DF}\x{90E0}\x{90E1}\x{90E2}\x{90E3}\x{90E4}\x{90E5}\x{90E6}' .
+'\x{90E7}\x{90E8}\x{90E9}\x{90EA}\x{90EB}\x{90EC}\x{90ED}\x{90EE}\x{90EF}' .
+'\x{90F0}\x{90F1}\x{90F2}\x{90F3}\x{90F4}\x{90F5}\x{90F7}\x{90F8}\x{90F9}' .
+'\x{90FA}\x{90FB}\x{90FC}\x{90FD}\x{90FE}\x{90FF}\x{9100}\x{9101}\x{9102}' .
+'\x{9103}\x{9104}\x{9105}\x{9106}\x{9107}\x{9108}\x{9109}\x{910B}\x{910C}' .
+'\x{910D}\x{910E}\x{910F}\x{9110}\x{9111}\x{9112}\x{9113}\x{9114}\x{9115}' .
+'\x{9116}\x{9117}\x{9118}\x{9119}\x{911A}\x{911B}\x{911C}\x{911D}\x{911E}' .
+'\x{911F}\x{9120}\x{9121}\x{9122}\x{9123}\x{9124}\x{9125}\x{9126}\x{9127}' .
+'\x{9128}\x{9129}\x{912A}\x{912B}\x{912C}\x{912D}\x{912E}\x{912F}\x{9130}' .
+'\x{9131}\x{9132}\x{9133}\x{9134}\x{9135}\x{9136}\x{9137}\x{9138}\x{9139}' .
+'\x{913A}\x{913B}\x{913E}\x{913F}\x{9140}\x{9141}\x{9142}\x{9143}\x{9144}' .
+'\x{9145}\x{9146}\x{9147}\x{9148}\x{9149}\x{914A}\x{914B}\x{914C}\x{914D}' .
+'\x{914E}\x{914F}\x{9150}\x{9151}\x{9152}\x{9153}\x{9154}\x{9155}\x{9156}' .
+'\x{9157}\x{9158}\x{915A}\x{915B}\x{915C}\x{915D}\x{915E}\x{915F}\x{9160}' .
+'\x{9161}\x{9162}\x{9163}\x{9164}\x{9165}\x{9166}\x{9167}\x{9168}\x{9169}' .
+'\x{916A}\x{916B}\x{916C}\x{916D}\x{916E}\x{916F}\x{9170}\x{9171}\x{9172}' .
+'\x{9173}\x{9174}\x{9175}\x{9176}\x{9177}\x{9178}\x{9179}\x{917A}\x{917C}' .
+'\x{917D}\x{917E}\x{917F}\x{9180}\x{9181}\x{9182}\x{9183}\x{9184}\x{9185}' .
+'\x{9186}\x{9187}\x{9188}\x{9189}\x{918A}\x{918B}\x{918C}\x{918D}\x{918E}' .
+'\x{918F}\x{9190}\x{9191}\x{9192}\x{9193}\x{9194}\x{9196}\x{9199}\x{919A}' .
+'\x{919B}\x{919C}\x{919D}\x{919E}\x{919F}\x{91A0}\x{91A1}\x{91A2}\x{91A3}' .
+'\x{91A5}\x{91A6}\x{91A7}\x{91A8}\x{91AA}\x{91AB}\x{91AC}\x{91AD}\x{91AE}' .
+'\x{91AF}\x{91B0}\x{91B1}\x{91B2}\x{91B3}\x{91B4}\x{91B5}\x{91B6}\x{91B7}' .
+'\x{91B9}\x{91BA}\x{91BB}\x{91BC}\x{91BD}\x{91BE}\x{91C0}\x{91C1}\x{91C2}' .
+'\x{91C3}\x{91C5}\x{91C6}\x{91C7}\x{91C9}\x{91CA}\x{91CB}\x{91CC}\x{91CD}' .
+'\x{91CE}\x{91CF}\x{91D0}\x{91D1}\x{91D2}\x{91D3}\x{91D4}\x{91D5}\x{91D7}' .
+'\x{91D8}\x{91D9}\x{91DA}\x{91DB}\x{91DC}\x{91DD}\x{91DE}\x{91DF}\x{91E2}' .
+'\x{91E3}\x{91E4}\x{91E5}\x{91E6}\x{91E7}\x{91E8}\x{91E9}\x{91EA}\x{91EB}' .
+'\x{91EC}\x{91ED}\x{91EE}\x{91F0}\x{91F1}\x{91F2}\x{91F3}\x{91F4}\x{91F5}' .
+'\x{91F7}\x{91F8}\x{91F9}\x{91FA}\x{91FB}\x{91FD}\x{91FE}\x{91FF}\x{9200}' .
+'\x{9201}\x{9202}\x{9203}\x{9204}\x{9205}\x{9206}\x{9207}\x{9208}\x{9209}' .
+'\x{920A}\x{920B}\x{920C}\x{920D}\x{920E}\x{920F}\x{9210}\x{9211}\x{9212}' .
+'\x{9214}\x{9215}\x{9216}\x{9217}\x{9218}\x{9219}\x{921A}\x{921B}\x{921C}' .
+'\x{921D}\x{921E}\x{9220}\x{9221}\x{9223}\x{9224}\x{9225}\x{9226}\x{9227}' .
+'\x{9228}\x{9229}\x{922A}\x{922B}\x{922D}\x{922E}\x{922F}\x{9230}\x{9231}' .
+'\x{9232}\x{9233}\x{9234}\x{9235}\x{9236}\x{9237}\x{9238}\x{9239}\x{923A}' .
+'\x{923B}\x{923C}\x{923D}\x{923E}\x{923F}\x{9240}\x{9241}\x{9242}\x{9245}' .
+'\x{9246}\x{9247}\x{9248}\x{9249}\x{924A}\x{924B}\x{924C}\x{924D}\x{924E}' .
+'\x{924F}\x{9250}\x{9251}\x{9252}\x{9253}\x{9254}\x{9255}\x{9256}\x{9257}' .
+'\x{9258}\x{9259}\x{925A}\x{925B}\x{925C}\x{925D}\x{925E}\x{925F}\x{9260}' .
+'\x{9261}\x{9262}\x{9263}\x{9264}\x{9265}\x{9266}\x{9267}\x{9268}\x{926B}' .
+'\x{926C}\x{926D}\x{926E}\x{926F}\x{9270}\x{9272}\x{9273}\x{9274}\x{9275}' .
+'\x{9276}\x{9277}\x{9278}\x{9279}\x{927A}\x{927B}\x{927C}\x{927D}\x{927E}' .
+'\x{927F}\x{9280}\x{9282}\x{9283}\x{9285}\x{9286}\x{9287}\x{9288}\x{9289}' .
+'\x{928A}\x{928B}\x{928C}\x{928D}\x{928E}\x{928F}\x{9290}\x{9291}\x{9292}' .
+'\x{9293}\x{9294}\x{9295}\x{9296}\x{9297}\x{9298}\x{9299}\x{929A}\x{929B}' .
+'\x{929C}\x{929D}\x{929F}\x{92A0}\x{92A1}\x{92A2}\x{92A3}\x{92A4}\x{92A5}' .
+'\x{92A6}\x{92A7}\x{92A8}\x{92A9}\x{92AA}\x{92AB}\x{92AC}\x{92AD}\x{92AE}' .
+'\x{92AF}\x{92B0}\x{92B1}\x{92B2}\x{92B3}\x{92B4}\x{92B5}\x{92B6}\x{92B7}' .
+'\x{92B8}\x{92B9}\x{92BA}\x{92BB}\x{92BC}\x{92BE}\x{92BF}\x{92C0}\x{92C1}' .
+'\x{92C2}\x{92C3}\x{92C4}\x{92C5}\x{92C6}\x{92C7}\x{92C8}\x{92C9}\x{92CA}' .
+'\x{92CB}\x{92CC}\x{92CD}\x{92CE}\x{92CF}\x{92D0}\x{92D1}\x{92D2}\x{92D3}' .
+'\x{92D5}\x{92D6}\x{92D7}\x{92D8}\x{92D9}\x{92DA}\x{92DC}\x{92DD}\x{92DE}' .
+'\x{92DF}\x{92E0}\x{92E1}\x{92E3}\x{92E4}\x{92E5}\x{92E6}\x{92E7}\x{92E8}' .
+'\x{92E9}\x{92EA}\x{92EB}\x{92EC}\x{92ED}\x{92EE}\x{92EF}\x{92F0}\x{92F1}' .
+'\x{92F2}\x{92F3}\x{92F4}\x{92F5}\x{92F6}\x{92F7}\x{92F8}\x{92F9}\x{92FA}' .
+'\x{92FB}\x{92FC}\x{92FD}\x{92FE}\x{92FF}\x{9300}\x{9301}\x{9302}\x{9303}' .
+'\x{9304}\x{9305}\x{9306}\x{9307}\x{9308}\x{9309}\x{930A}\x{930B}\x{930C}' .
+'\x{930D}\x{930E}\x{930F}\x{9310}\x{9311}\x{9312}\x{9313}\x{9314}\x{9315}' .
+'\x{9316}\x{9317}\x{9318}\x{9319}\x{931A}\x{931B}\x{931D}\x{931E}\x{931F}' .
+'\x{9320}\x{9321}\x{9322}\x{9323}\x{9324}\x{9325}\x{9326}\x{9327}\x{9328}' .
+'\x{9329}\x{932A}\x{932B}\x{932D}\x{932E}\x{932F}\x{9332}\x{9333}\x{9334}' .
+'\x{9335}\x{9336}\x{9337}\x{9338}\x{9339}\x{933A}\x{933B}\x{933C}\x{933D}' .
+'\x{933E}\x{933F}\x{9340}\x{9341}\x{9342}\x{9343}\x{9344}\x{9345}\x{9346}' .
+'\x{9347}\x{9348}\x{9349}\x{934A}\x{934B}\x{934C}\x{934D}\x{934E}\x{934F}' .
+'\x{9350}\x{9351}\x{9352}\x{9353}\x{9354}\x{9355}\x{9356}\x{9357}\x{9358}' .
+'\x{9359}\x{935A}\x{935B}\x{935C}\x{935D}\x{935E}\x{935F}\x{9360}\x{9361}' .
+'\x{9363}\x{9364}\x{9365}\x{9366}\x{9367}\x{9369}\x{936A}\x{936C}\x{936D}' .
+'\x{936E}\x{9370}\x{9371}\x{9372}\x{9374}\x{9375}\x{9376}\x{9377}\x{9379}' .
+'\x{937A}\x{937B}\x{937C}\x{937D}\x{937E}\x{9380}\x{9382}\x{9383}\x{9384}' .
+'\x{9385}\x{9386}\x{9387}\x{9388}\x{9389}\x{938A}\x{938C}\x{938D}\x{938E}' .
+'\x{938F}\x{9390}\x{9391}\x{9392}\x{9393}\x{9394}\x{9395}\x{9396}\x{9397}' .
+'\x{9398}\x{9399}\x{939A}\x{939B}\x{939D}\x{939E}\x{939F}\x{93A1}\x{93A2}' .
+'\x{93A3}\x{93A4}\x{93A5}\x{93A6}\x{93A7}\x{93A8}\x{93A9}\x{93AA}\x{93AC}' .
+'\x{93AD}\x{93AE}\x{93AF}\x{93B0}\x{93B1}\x{93B2}\x{93B3}\x{93B4}\x{93B5}' .
+'\x{93B6}\x{93B7}\x{93B8}\x{93B9}\x{93BA}\x{93BC}\x{93BD}\x{93BE}\x{93BF}' .
+'\x{93C0}\x{93C1}\x{93C2}\x{93C3}\x{93C4}\x{93C5}\x{93C6}\x{93C7}\x{93C8}' .
+'\x{93C9}\x{93CA}\x{93CB}\x{93CC}\x{93CD}\x{93CE}\x{93CF}\x{93D0}\x{93D1}' .
+'\x{93D2}\x{93D3}\x{93D4}\x{93D5}\x{93D6}\x{93D7}\x{93D8}\x{93D9}\x{93DA}' .
+'\x{93DB}\x{93DC}\x{93DD}\x{93DE}\x{93DF}\x{93E1}\x{93E2}\x{93E3}\x{93E4}' .
+'\x{93E6}\x{93E7}\x{93E8}\x{93E9}\x{93EA}\x{93EB}\x{93EC}\x{93ED}\x{93EE}' .
+'\x{93EF}\x{93F0}\x{93F1}\x{93F2}\x{93F4}\x{93F5}\x{93F6}\x{93F7}\x{93F8}' .
+'\x{93F9}\x{93FA}\x{93FB}\x{93FC}\x{93FD}\x{93FE}\x{93FF}\x{9400}\x{9401}' .
+'\x{9403}\x{9404}\x{9405}\x{9406}\x{9407}\x{9408}\x{9409}\x{940A}\x{940B}' .
+'\x{940C}\x{940D}\x{940E}\x{940F}\x{9410}\x{9411}\x{9412}\x{9413}\x{9414}' .
+'\x{9415}\x{9416}\x{9418}\x{9419}\x{941B}\x{941D}\x{9420}\x{9422}\x{9423}' .
+'\x{9425}\x{9426}\x{9427}\x{9428}\x{9429}\x{942A}\x{942B}\x{942C}\x{942D}' .
+'\x{942E}\x{942F}\x{9430}\x{9431}\x{9432}\x{9433}\x{9434}\x{9435}\x{9436}' .
+'\x{9437}\x{9438}\x{9439}\x{943A}\x{943B}\x{943C}\x{943D}\x{943E}\x{943F}' .
+'\x{9440}\x{9441}\x{9442}\x{9444}\x{9445}\x{9446}\x{9447}\x{9448}\x{9449}' .
+'\x{944A}\x{944B}\x{944C}\x{944D}\x{944F}\x{9450}\x{9451}\x{9452}\x{9453}' .
+'\x{9454}\x{9455}\x{9456}\x{9457}\x{9458}\x{9459}\x{945B}\x{945C}\x{945D}' .
+'\x{945E}\x{945F}\x{9460}\x{9461}\x{9462}\x{9463}\x{9464}\x{9465}\x{9466}' .
+'\x{9467}\x{9468}\x{9469}\x{946A}\x{946B}\x{946D}\x{946E}\x{946F}\x{9470}' .
+'\x{9471}\x{9472}\x{9473}\x{9474}\x{9475}\x{9476}\x{9477}\x{9478}\x{9479}' .
+'\x{947A}\x{947C}\x{947D}\x{947E}\x{947F}\x{9480}\x{9481}\x{9482}\x{9483}' .
+'\x{9484}\x{9485}\x{9486}\x{9487}\x{9488}\x{9489}\x{948A}\x{948B}\x{948C}' .
+'\x{948D}\x{948E}\x{948F}\x{9490}\x{9491}\x{9492}\x{9493}\x{9494}\x{9495}' .
+'\x{9496}\x{9497}\x{9498}\x{9499}\x{949A}\x{949B}\x{949C}\x{949D}\x{949E}' .
+'\x{949F}\x{94A0}\x{94A1}\x{94A2}\x{94A3}\x{94A4}\x{94A5}\x{94A6}\x{94A7}' .
+'\x{94A8}\x{94A9}\x{94AA}\x{94AB}\x{94AC}\x{94AD}\x{94AE}\x{94AF}\x{94B0}' .
+'\x{94B1}\x{94B2}\x{94B3}\x{94B4}\x{94B5}\x{94B6}\x{94B7}\x{94B8}\x{94B9}' .
+'\x{94BA}\x{94BB}\x{94BC}\x{94BD}\x{94BE}\x{94BF}\x{94C0}\x{94C1}\x{94C2}' .
+'\x{94C3}\x{94C4}\x{94C5}\x{94C6}\x{94C7}\x{94C8}\x{94C9}\x{94CA}\x{94CB}' .
+'\x{94CC}\x{94CD}\x{94CE}\x{94CF}\x{94D0}\x{94D1}\x{94D2}\x{94D3}\x{94D4}' .
+'\x{94D5}\x{94D6}\x{94D7}\x{94D8}\x{94D9}\x{94DA}\x{94DB}\x{94DC}\x{94DD}' .
+'\x{94DE}\x{94DF}\x{94E0}\x{94E1}\x{94E2}\x{94E3}\x{94E4}\x{94E5}\x{94E6}' .
+'\x{94E7}\x{94E8}\x{94E9}\x{94EA}\x{94EB}\x{94EC}\x{94ED}\x{94EE}\x{94EF}' .
+'\x{94F0}\x{94F1}\x{94F2}\x{94F3}\x{94F4}\x{94F5}\x{94F6}\x{94F7}\x{94F8}' .
+'\x{94F9}\x{94FA}\x{94FB}\x{94FC}\x{94FD}\x{94FE}\x{94FF}\x{9500}\x{9501}' .
+'\x{9502}\x{9503}\x{9504}\x{9505}\x{9506}\x{9507}\x{9508}\x{9509}\x{950A}' .
+'\x{950B}\x{950C}\x{950D}\x{950E}\x{950F}\x{9510}\x{9511}\x{9512}\x{9513}' .
+'\x{9514}\x{9515}\x{9516}\x{9517}\x{9518}\x{9519}\x{951A}\x{951B}\x{951C}' .
+'\x{951D}\x{951E}\x{951F}\x{9520}\x{9521}\x{9522}\x{9523}\x{9524}\x{9525}' .
+'\x{9526}\x{9527}\x{9528}\x{9529}\x{952A}\x{952B}\x{952C}\x{952D}\x{952E}' .
+'\x{952F}\x{9530}\x{9531}\x{9532}\x{9533}\x{9534}\x{9535}\x{9536}\x{9537}' .
+'\x{9538}\x{9539}\x{953A}\x{953B}\x{953C}\x{953D}\x{953E}\x{953F}\x{9540}' .
+'\x{9541}\x{9542}\x{9543}\x{9544}\x{9545}\x{9546}\x{9547}\x{9548}\x{9549}' .
+'\x{954A}\x{954B}\x{954C}\x{954D}\x{954E}\x{954F}\x{9550}\x{9551}\x{9552}' .
+'\x{9553}\x{9554}\x{9555}\x{9556}\x{9557}\x{9558}\x{9559}\x{955A}\x{955B}' .
+'\x{955C}\x{955D}\x{955E}\x{955F}\x{9560}\x{9561}\x{9562}\x{9563}\x{9564}' .
+'\x{9565}\x{9566}\x{9567}\x{9568}\x{9569}\x{956A}\x{956B}\x{956C}\x{956D}' .
+'\x{956E}\x{956F}\x{9570}\x{9571}\x{9572}\x{9573}\x{9574}\x{9575}\x{9576}' .
+'\x{9577}\x{957A}\x{957B}\x{957C}\x{957D}\x{957F}\x{9580}\x{9581}\x{9582}' .
+'\x{9583}\x{9584}\x{9586}\x{9587}\x{9588}\x{9589}\x{958A}\x{958B}\x{958C}' .
+'\x{958D}\x{958E}\x{958F}\x{9590}\x{9591}\x{9592}\x{9593}\x{9594}\x{9595}' .
+'\x{9596}\x{9598}\x{9599}\x{959A}\x{959B}\x{959C}\x{959D}\x{959E}\x{959F}' .
+'\x{95A1}\x{95A2}\x{95A3}\x{95A4}\x{95A5}\x{95A6}\x{95A7}\x{95A8}\x{95A9}' .
+'\x{95AA}\x{95AB}\x{95AC}\x{95AD}\x{95AE}\x{95AF}\x{95B0}\x{95B1}\x{95B2}' .
+'\x{95B5}\x{95B6}\x{95B7}\x{95B9}\x{95BA}\x{95BB}\x{95BC}\x{95BD}\x{95BE}' .
+'\x{95BF}\x{95C0}\x{95C2}\x{95C3}\x{95C4}\x{95C5}\x{95C6}\x{95C7}\x{95C8}' .
+'\x{95C9}\x{95CA}\x{95CB}\x{95CC}\x{95CD}\x{95CE}\x{95CF}\x{95D0}\x{95D1}' .
+'\x{95D2}\x{95D3}\x{95D4}\x{95D5}\x{95D6}\x{95D7}\x{95D8}\x{95DA}\x{95DB}' .
+'\x{95DC}\x{95DE}\x{95DF}\x{95E0}\x{95E1}\x{95E2}\x{95E3}\x{95E4}\x{95E5}' .
+'\x{95E6}\x{95E7}\x{95E8}\x{95E9}\x{95EA}\x{95EB}\x{95EC}\x{95ED}\x{95EE}' .
+'\x{95EF}\x{95F0}\x{95F1}\x{95F2}\x{95F3}\x{95F4}\x{95F5}\x{95F6}\x{95F7}' .
+'\x{95F8}\x{95F9}\x{95FA}\x{95FB}\x{95FC}\x{95FD}\x{95FE}\x{95FF}\x{9600}' .
+'\x{9601}\x{9602}\x{9603}\x{9604}\x{9605}\x{9606}\x{9607}\x{9608}\x{9609}' .
+'\x{960A}\x{960B}\x{960C}\x{960D}\x{960E}\x{960F}\x{9610}\x{9611}\x{9612}' .
+'\x{9613}\x{9614}\x{9615}\x{9616}\x{9617}\x{9618}\x{9619}\x{961A}\x{961B}' .
+'\x{961C}\x{961D}\x{961E}\x{961F}\x{9620}\x{9621}\x{9622}\x{9623}\x{9624}' .
+'\x{9627}\x{9628}\x{962A}\x{962B}\x{962C}\x{962D}\x{962E}\x{962F}\x{9630}' .
+'\x{9631}\x{9632}\x{9633}\x{9634}\x{9635}\x{9636}\x{9637}\x{9638}\x{9639}' .
+'\x{963A}\x{963B}\x{963C}\x{963D}\x{963F}\x{9640}\x{9641}\x{9642}\x{9643}' .
+'\x{9644}\x{9645}\x{9646}\x{9647}\x{9648}\x{9649}\x{964A}\x{964B}\x{964C}' .
+'\x{964D}\x{964E}\x{964F}\x{9650}\x{9651}\x{9652}\x{9653}\x{9654}\x{9655}' .
+'\x{9658}\x{9659}\x{965A}\x{965B}\x{965C}\x{965D}\x{965E}\x{965F}\x{9660}' .
+'\x{9661}\x{9662}\x{9663}\x{9664}\x{9666}\x{9667}\x{9668}\x{9669}\x{966A}' .
+'\x{966B}\x{966C}\x{966D}\x{966E}\x{966F}\x{9670}\x{9671}\x{9672}\x{9673}' .
+'\x{9674}\x{9675}\x{9676}\x{9677}\x{9678}\x{967C}\x{967D}\x{967E}\x{9680}' .
+'\x{9683}\x{9684}\x{9685}\x{9686}\x{9687}\x{9688}\x{9689}\x{968A}\x{968B}' .
+'\x{968D}\x{968E}\x{968F}\x{9690}\x{9691}\x{9692}\x{9693}\x{9694}\x{9695}' .
+'\x{9697}\x{9698}\x{9699}\x{969B}\x{969C}\x{969E}\x{96A0}\x{96A1}\x{96A2}' .
+'\x{96A3}\x{96A4}\x{96A5}\x{96A6}\x{96A7}\x{96A8}\x{96A9}\x{96AA}\x{96AC}' .
+'\x{96AD}\x{96AE}\x{96B0}\x{96B1}\x{96B3}\x{96B4}\x{96B6}\x{96B7}\x{96B8}' .
+'\x{96B9}\x{96BA}\x{96BB}\x{96BC}\x{96BD}\x{96BE}\x{96BF}\x{96C0}\x{96C1}' .
+'\x{96C2}\x{96C3}\x{96C4}\x{96C5}\x{96C6}\x{96C7}\x{96C8}\x{96C9}\x{96CA}' .
+'\x{96CB}\x{96CC}\x{96CD}\x{96CE}\x{96CF}\x{96D0}\x{96D1}\x{96D2}\x{96D3}' .
+'\x{96D4}\x{96D5}\x{96D6}\x{96D7}\x{96D8}\x{96D9}\x{96DA}\x{96DB}\x{96DC}' .
+'\x{96DD}\x{96DE}\x{96DF}\x{96E0}\x{96E1}\x{96E2}\x{96E3}\x{96E5}\x{96E8}' .
+'\x{96E9}\x{96EA}\x{96EB}\x{96EC}\x{96ED}\x{96EE}\x{96EF}\x{96F0}\x{96F1}' .
+'\x{96F2}\x{96F3}\x{96F4}\x{96F5}\x{96F6}\x{96F7}\x{96F8}\x{96F9}\x{96FA}' .
+'\x{96FB}\x{96FD}\x{96FE}\x{96FF}\x{9700}\x{9701}\x{9702}\x{9703}\x{9704}' .
+'\x{9705}\x{9706}\x{9707}\x{9708}\x{9709}\x{970A}\x{970B}\x{970C}\x{970D}' .
+'\x{970E}\x{970F}\x{9710}\x{9711}\x{9712}\x{9713}\x{9715}\x{9716}\x{9718}' .
+'\x{9719}\x{971C}\x{971D}\x{971E}\x{971F}\x{9720}\x{9721}\x{9722}\x{9723}' .
+'\x{9724}\x{9725}\x{9726}\x{9727}\x{9728}\x{9729}\x{972A}\x{972B}\x{972C}' .
+'\x{972D}\x{972E}\x{972F}\x{9730}\x{9731}\x{9732}\x{9735}\x{9736}\x{9738}' .
+'\x{9739}\x{973A}\x{973B}\x{973C}\x{973D}\x{973E}\x{973F}\x{9742}\x{9743}' .
+'\x{9744}\x{9745}\x{9746}\x{9747}\x{9748}\x{9749}\x{974A}\x{974B}\x{974C}' .
+'\x{974E}\x{974F}\x{9750}\x{9751}\x{9752}\x{9753}\x{9754}\x{9755}\x{9756}' .
+'\x{9758}\x{9759}\x{975A}\x{975B}\x{975C}\x{975D}\x{975E}\x{975F}\x{9760}' .
+'\x{9761}\x{9762}\x{9765}\x{9766}\x{9767}\x{9768}\x{9769}\x{976A}\x{976B}' .
+'\x{976C}\x{976D}\x{976E}\x{976F}\x{9770}\x{9772}\x{9773}\x{9774}\x{9776}' .
+'\x{9777}\x{9778}\x{9779}\x{977A}\x{977B}\x{977C}\x{977D}\x{977E}\x{977F}' .
+'\x{9780}\x{9781}\x{9782}\x{9783}\x{9784}\x{9785}\x{9786}\x{9788}\x{978A}' .
+'\x{978B}\x{978C}\x{978D}\x{978E}\x{978F}\x{9790}\x{9791}\x{9792}\x{9793}' .
+'\x{9794}\x{9795}\x{9796}\x{9797}\x{9798}\x{9799}\x{979A}\x{979C}\x{979D}' .
+'\x{979E}\x{979F}\x{97A0}\x{97A1}\x{97A2}\x{97A3}\x{97A4}\x{97A5}\x{97A6}' .
+'\x{97A7}\x{97A8}\x{97AA}\x{97AB}\x{97AC}\x{97AD}\x{97AE}\x{97AF}\x{97B2}' .
+'\x{97B3}\x{97B4}\x{97B6}\x{97B7}\x{97B8}\x{97B9}\x{97BA}\x{97BB}\x{97BC}' .
+'\x{97BD}\x{97BF}\x{97C1}\x{97C2}\x{97C3}\x{97C4}\x{97C5}\x{97C6}\x{97C7}' .
+'\x{97C8}\x{97C9}\x{97CA}\x{97CB}\x{97CC}\x{97CD}\x{97CE}\x{97CF}\x{97D0}' .
+'\x{97D1}\x{97D3}\x{97D4}\x{97D5}\x{97D6}\x{97D7}\x{97D8}\x{97D9}\x{97DA}' .
+'\x{97DB}\x{97DC}\x{97DD}\x{97DE}\x{97DF}\x{97E0}\x{97E1}\x{97E2}\x{97E3}' .
+'\x{97E4}\x{97E5}\x{97E6}\x{97E7}\x{97E8}\x{97E9}\x{97EA}\x{97EB}\x{97EC}' .
+'\x{97ED}\x{97EE}\x{97EF}\x{97F0}\x{97F1}\x{97F2}\x{97F3}\x{97F4}\x{97F5}' .
+'\x{97F6}\x{97F7}\x{97F8}\x{97F9}\x{97FA}\x{97FB}\x{97FD}\x{97FE}\x{97FF}' .
+'\x{9800}\x{9801}\x{9802}\x{9803}\x{9804}\x{9805}\x{9806}\x{9807}\x{9808}' .
+'\x{9809}\x{980A}\x{980B}\x{980C}\x{980D}\x{980E}\x{980F}\x{9810}\x{9811}' .
+'\x{9812}\x{9813}\x{9814}\x{9815}\x{9816}\x{9817}\x{9818}\x{9819}\x{981A}' .
+'\x{981B}\x{981C}\x{981D}\x{981E}\x{9820}\x{9821}\x{9822}\x{9823}\x{9824}' .
+'\x{9826}\x{9827}\x{9828}\x{9829}\x{982B}\x{982D}\x{982E}\x{982F}\x{9830}' .
+'\x{9831}\x{9832}\x{9834}\x{9835}\x{9836}\x{9837}\x{9838}\x{9839}\x{983B}' .
+'\x{983C}\x{983D}\x{983F}\x{9840}\x{9841}\x{9843}\x{9844}\x{9845}\x{9846}' .
+'\x{9848}\x{9849}\x{984A}\x{984C}\x{984D}\x{984E}\x{984F}\x{9850}\x{9851}' .
+'\x{9852}\x{9853}\x{9854}\x{9855}\x{9857}\x{9858}\x{9859}\x{985A}\x{985B}' .
+'\x{985C}\x{985D}\x{985E}\x{985F}\x{9860}\x{9861}\x{9862}\x{9863}\x{9864}' .
+'\x{9865}\x{9867}\x{9869}\x{986A}\x{986B}\x{986C}\x{986D}\x{986E}\x{986F}' .
+'\x{9870}\x{9871}\x{9872}\x{9873}\x{9874}\x{9875}\x{9876}\x{9877}\x{9878}' .
+'\x{9879}\x{987A}\x{987B}\x{987C}\x{987D}\x{987E}\x{987F}\x{9880}\x{9881}' .
+'\x{9882}\x{9883}\x{9884}\x{9885}\x{9886}\x{9887}\x{9888}\x{9889}\x{988A}' .
+'\x{988B}\x{988C}\x{988D}\x{988E}\x{988F}\x{9890}\x{9891}\x{9892}\x{9893}' .
+'\x{9894}\x{9895}\x{9896}\x{9897}\x{9898}\x{9899}\x{989A}\x{989B}\x{989C}' .
+'\x{989D}\x{989E}\x{989F}\x{98A0}\x{98A1}\x{98A2}\x{98A3}\x{98A4}\x{98A5}' .
+'\x{98A6}\x{98A7}\x{98A8}\x{98A9}\x{98AA}\x{98AB}\x{98AC}\x{98AD}\x{98AE}' .
+'\x{98AF}\x{98B0}\x{98B1}\x{98B2}\x{98B3}\x{98B4}\x{98B5}\x{98B6}\x{98B8}' .
+'\x{98B9}\x{98BA}\x{98BB}\x{98BC}\x{98BD}\x{98BE}\x{98BF}\x{98C0}\x{98C1}' .
+'\x{98C2}\x{98C3}\x{98C4}\x{98C5}\x{98C6}\x{98C8}\x{98C9}\x{98CB}\x{98CC}' .
+'\x{98CD}\x{98CE}\x{98CF}\x{98D0}\x{98D1}\x{98D2}\x{98D3}\x{98D4}\x{98D5}' .
+'\x{98D6}\x{98D7}\x{98D8}\x{98D9}\x{98DA}\x{98DB}\x{98DC}\x{98DD}\x{98DE}' .
+'\x{98DF}\x{98E0}\x{98E2}\x{98E3}\x{98E5}\x{98E6}\x{98E7}\x{98E8}\x{98E9}' .
+'\x{98EA}\x{98EB}\x{98ED}\x{98EF}\x{98F0}\x{98F2}\x{98F3}\x{98F4}\x{98F5}' .
+'\x{98F6}\x{98F7}\x{98F9}\x{98FA}\x{98FC}\x{98FD}\x{98FE}\x{98FF}\x{9900}' .
+'\x{9901}\x{9902}\x{9903}\x{9904}\x{9905}\x{9906}\x{9907}\x{9908}\x{9909}' .
+'\x{990A}\x{990B}\x{990C}\x{990D}\x{990E}\x{990F}\x{9910}\x{9911}\x{9912}' .
+'\x{9913}\x{9914}\x{9915}\x{9916}\x{9917}\x{9918}\x{991A}\x{991B}\x{991C}' .
+'\x{991D}\x{991E}\x{991F}\x{9920}\x{9921}\x{9922}\x{9923}\x{9924}\x{9925}' .
+'\x{9926}\x{9927}\x{9928}\x{9929}\x{992A}\x{992B}\x{992C}\x{992D}\x{992E}' .
+'\x{992F}\x{9930}\x{9931}\x{9932}\x{9933}\x{9934}\x{9935}\x{9936}\x{9937}' .
+'\x{9938}\x{9939}\x{993A}\x{993C}\x{993D}\x{993E}\x{993F}\x{9940}\x{9941}' .
+'\x{9942}\x{9943}\x{9945}\x{9946}\x{9947}\x{9948}\x{9949}\x{994A}\x{994B}' .
+'\x{994C}\x{994E}\x{994F}\x{9950}\x{9951}\x{9952}\x{9953}\x{9954}\x{9955}' .
+'\x{9956}\x{9957}\x{9958}\x{9959}\x{995B}\x{995C}\x{995E}\x{995F}\x{9960}' .
+'\x{9961}\x{9962}\x{9963}\x{9964}\x{9965}\x{9966}\x{9967}\x{9968}\x{9969}' .
+'\x{996A}\x{996B}\x{996C}\x{996D}\x{996E}\x{996F}\x{9970}\x{9971}\x{9972}' .
+'\x{9973}\x{9974}\x{9975}\x{9976}\x{9977}\x{9978}\x{9979}\x{997A}\x{997B}' .
+'\x{997C}\x{997D}\x{997E}\x{997F}\x{9980}\x{9981}\x{9982}\x{9983}\x{9984}' .
+'\x{9985}\x{9986}\x{9987}\x{9988}\x{9989}\x{998A}\x{998B}\x{998C}\x{998D}' .
+'\x{998E}\x{998F}\x{9990}\x{9991}\x{9992}\x{9993}\x{9994}\x{9995}\x{9996}' .
+'\x{9997}\x{9998}\x{9999}\x{999A}\x{999B}\x{999C}\x{999D}\x{999E}\x{999F}' .
+'\x{99A0}\x{99A1}\x{99A2}\x{99A3}\x{99A4}\x{99A5}\x{99A6}\x{99A7}\x{99A8}' .
+'\x{99A9}\x{99AA}\x{99AB}\x{99AC}\x{99AD}\x{99AE}\x{99AF}\x{99B0}\x{99B1}' .
+'\x{99B2}\x{99B3}\x{99B4}\x{99B5}\x{99B6}\x{99B7}\x{99B8}\x{99B9}\x{99BA}' .
+'\x{99BB}\x{99BC}\x{99BD}\x{99BE}\x{99C0}\x{99C1}\x{99C2}\x{99C3}\x{99C4}' .
+'\x{99C6}\x{99C7}\x{99C8}\x{99C9}\x{99CA}\x{99CB}\x{99CC}\x{99CD}\x{99CE}' .
+'\x{99CF}\x{99D0}\x{99D1}\x{99D2}\x{99D3}\x{99D4}\x{99D5}\x{99D6}\x{99D7}' .
+'\x{99D8}\x{99D9}\x{99DA}\x{99DB}\x{99DC}\x{99DD}\x{99DE}\x{99DF}\x{99E1}' .
+'\x{99E2}\x{99E3}\x{99E4}\x{99E5}\x{99E7}\x{99E8}\x{99E9}\x{99EA}\x{99EC}' .
+'\x{99ED}\x{99EE}\x{99EF}\x{99F0}\x{99F1}\x{99F2}\x{99F3}\x{99F4}\x{99F6}' .
+'\x{99F7}\x{99F8}\x{99F9}\x{99FA}\x{99FB}\x{99FC}\x{99FD}\x{99FE}\x{99FF}' .
+'\x{9A00}\x{9A01}\x{9A02}\x{9A03}\x{9A04}\x{9A05}\x{9A06}\x{9A07}\x{9A08}' .
+'\x{9A09}\x{9A0A}\x{9A0B}\x{9A0C}\x{9A0D}\x{9A0E}\x{9A0F}\x{9A11}\x{9A14}' .
+'\x{9A15}\x{9A16}\x{9A19}\x{9A1A}\x{9A1B}\x{9A1C}\x{9A1D}\x{9A1E}\x{9A1F}' .
+'\x{9A20}\x{9A21}\x{9A22}\x{9A23}\x{9A24}\x{9A25}\x{9A26}\x{9A27}\x{9A29}' .
+'\x{9A2A}\x{9A2B}\x{9A2C}\x{9A2D}\x{9A2E}\x{9A2F}\x{9A30}\x{9A31}\x{9A32}' .
+'\x{9A33}\x{9A34}\x{9A35}\x{9A36}\x{9A37}\x{9A38}\x{9A39}\x{9A3A}\x{9A3C}' .
+'\x{9A3D}\x{9A3E}\x{9A3F}\x{9A40}\x{9A41}\x{9A42}\x{9A43}\x{9A44}\x{9A45}' .
+'\x{9A46}\x{9A47}\x{9A48}\x{9A49}\x{9A4A}\x{9A4B}\x{9A4C}\x{9A4D}\x{9A4E}' .
+'\x{9A4F}\x{9A50}\x{9A52}\x{9A53}\x{9A54}\x{9A55}\x{9A56}\x{9A57}\x{9A59}' .
+'\x{9A5A}\x{9A5B}\x{9A5C}\x{9A5E}\x{9A5F}\x{9A60}\x{9A61}\x{9A62}\x{9A64}' .
+'\x{9A65}\x{9A66}\x{9A67}\x{9A68}\x{9A69}\x{9A6A}\x{9A6B}\x{9A6C}\x{9A6D}' .
+'\x{9A6E}\x{9A6F}\x{9A70}\x{9A71}\x{9A72}\x{9A73}\x{9A74}\x{9A75}\x{9A76}' .
+'\x{9A77}\x{9A78}\x{9A79}\x{9A7A}\x{9A7B}\x{9A7C}\x{9A7D}\x{9A7E}\x{9A7F}' .
+'\x{9A80}\x{9A81}\x{9A82}\x{9A83}\x{9A84}\x{9A85}\x{9A86}\x{9A87}\x{9A88}' .
+'\x{9A89}\x{9A8A}\x{9A8B}\x{9A8C}\x{9A8D}\x{9A8E}\x{9A8F}\x{9A90}\x{9A91}' .
+'\x{9A92}\x{9A93}\x{9A94}\x{9A95}\x{9A96}\x{9A97}\x{9A98}\x{9A99}\x{9A9A}' .
+'\x{9A9B}\x{9A9C}\x{9A9D}\x{9A9E}\x{9A9F}\x{9AA0}\x{9AA1}\x{9AA2}\x{9AA3}' .
+'\x{9AA4}\x{9AA5}\x{9AA6}\x{9AA7}\x{9AA8}\x{9AAA}\x{9AAB}\x{9AAC}\x{9AAD}' .
+'\x{9AAE}\x{9AAF}\x{9AB0}\x{9AB1}\x{9AB2}\x{9AB3}\x{9AB4}\x{9AB5}\x{9AB6}' .
+'\x{9AB7}\x{9AB8}\x{9AB9}\x{9ABA}\x{9ABB}\x{9ABC}\x{9ABE}\x{9ABF}\x{9AC0}' .
+'\x{9AC1}\x{9AC2}\x{9AC3}\x{9AC4}\x{9AC5}\x{9AC6}\x{9AC7}\x{9AC9}\x{9ACA}' .
+'\x{9ACB}\x{9ACC}\x{9ACD}\x{9ACE}\x{9ACF}\x{9AD0}\x{9AD1}\x{9AD2}\x{9AD3}' .
+'\x{9AD4}\x{9AD5}\x{9AD6}\x{9AD8}\x{9AD9}\x{9ADA}\x{9ADB}\x{9ADC}\x{9ADD}' .
+'\x{9ADE}\x{9ADF}\x{9AE1}\x{9AE2}\x{9AE3}\x{9AE5}\x{9AE6}\x{9AE7}\x{9AEA}' .
+'\x{9AEB}\x{9AEC}\x{9AED}\x{9AEE}\x{9AEF}\x{9AF1}\x{9AF2}\x{9AF3}\x{9AF4}' .
+'\x{9AF5}\x{9AF6}\x{9AF7}\x{9AF8}\x{9AF9}\x{9AFA}\x{9AFB}\x{9AFC}\x{9AFD}' .
+'\x{9AFE}\x{9AFF}\x{9B01}\x{9B03}\x{9B04}\x{9B05}\x{9B06}\x{9B07}\x{9B08}' .
+'\x{9B0A}\x{9B0B}\x{9B0C}\x{9B0D}\x{9B0E}\x{9B0F}\x{9B10}\x{9B11}\x{9B12}' .
+'\x{9B13}\x{9B15}\x{9B16}\x{9B17}\x{9B18}\x{9B19}\x{9B1A}\x{9B1C}\x{9B1D}' .
+'\x{9B1E}\x{9B1F}\x{9B20}\x{9B21}\x{9B22}\x{9B23}\x{9B24}\x{9B25}\x{9B26}' .
+'\x{9B27}\x{9B28}\x{9B29}\x{9B2A}\x{9B2B}\x{9B2C}\x{9B2D}\x{9B2E}\x{9B2F}' .
+'\x{9B30}\x{9B31}\x{9B32}\x{9B33}\x{9B35}\x{9B36}\x{9B37}\x{9B38}\x{9B39}' .
+'\x{9B3A}\x{9B3B}\x{9B3C}\x{9B3E}\x{9B3F}\x{9B41}\x{9B42}\x{9B43}\x{9B44}' .
+'\x{9B45}\x{9B46}\x{9B47}\x{9B48}\x{9B49}\x{9B4A}\x{9B4B}\x{9B4C}\x{9B4D}' .
+'\x{9B4E}\x{9B4F}\x{9B51}\x{9B52}\x{9B53}\x{9B54}\x{9B55}\x{9B56}\x{9B58}' .
+'\x{9B59}\x{9B5A}\x{9B5B}\x{9B5C}\x{9B5D}\x{9B5E}\x{9B5F}\x{9B60}\x{9B61}' .
+'\x{9B63}\x{9B64}\x{9B65}\x{9B66}\x{9B67}\x{9B68}\x{9B69}\x{9B6A}\x{9B6B}' .
+'\x{9B6C}\x{9B6D}\x{9B6E}\x{9B6F}\x{9B70}\x{9B71}\x{9B73}\x{9B74}\x{9B75}' .
+'\x{9B76}\x{9B77}\x{9B78}\x{9B79}\x{9B7A}\x{9B7B}\x{9B7C}\x{9B7D}\x{9B7E}' .
+'\x{9B7F}\x{9B80}\x{9B81}\x{9B82}\x{9B83}\x{9B84}\x{9B85}\x{9B86}\x{9B87}' .
+'\x{9B88}\x{9B8A}\x{9B8B}\x{9B8D}\x{9B8E}\x{9B8F}\x{9B90}\x{9B91}\x{9B92}' .
+'\x{9B93}\x{9B94}\x{9B95}\x{9B96}\x{9B97}\x{9B98}\x{9B9A}\x{9B9B}\x{9B9C}' .
+'\x{9B9D}\x{9B9E}\x{9B9F}\x{9BA0}\x{9BA1}\x{9BA2}\x{9BA3}\x{9BA4}\x{9BA5}' .
+'\x{9BA6}\x{9BA7}\x{9BA8}\x{9BA9}\x{9BAA}\x{9BAB}\x{9BAC}\x{9BAD}\x{9BAE}' .
+'\x{9BAF}\x{9BB0}\x{9BB1}\x{9BB2}\x{9BB3}\x{9BB4}\x{9BB5}\x{9BB6}\x{9BB7}' .
+'\x{9BB8}\x{9BB9}\x{9BBA}\x{9BBB}\x{9BBC}\x{9BBD}\x{9BBE}\x{9BBF}\x{9BC0}' .
+'\x{9BC1}\x{9BC3}\x{9BC4}\x{9BC5}\x{9BC6}\x{9BC7}\x{9BC8}\x{9BC9}\x{9BCA}' .
+'\x{9BCB}\x{9BCC}\x{9BCD}\x{9BCE}\x{9BCF}\x{9BD0}\x{9BD1}\x{9BD2}\x{9BD3}' .
+'\x{9BD4}\x{9BD5}\x{9BD6}\x{9BD7}\x{9BD8}\x{9BD9}\x{9BDA}\x{9BDB}\x{9BDC}' .
+'\x{9BDD}\x{9BDE}\x{9BDF}\x{9BE0}\x{9BE1}\x{9BE2}\x{9BE3}\x{9BE4}\x{9BE5}' .
+'\x{9BE6}\x{9BE7}\x{9BE8}\x{9BE9}\x{9BEA}\x{9BEB}\x{9BEC}\x{9BED}\x{9BEE}' .
+'\x{9BEF}\x{9BF0}\x{9BF1}\x{9BF2}\x{9BF3}\x{9BF4}\x{9BF5}\x{9BF7}\x{9BF8}' .
+'\x{9BF9}\x{9BFA}\x{9BFB}\x{9BFC}\x{9BFD}\x{9BFE}\x{9BFF}\x{9C02}\x{9C05}' .
+'\x{9C06}\x{9C07}\x{9C08}\x{9C09}\x{9C0A}\x{9C0B}\x{9C0C}\x{9C0D}\x{9C0E}' .
+'\x{9C0F}\x{9C10}\x{9C11}\x{9C12}\x{9C13}\x{9C14}\x{9C15}\x{9C16}\x{9C17}' .
+'\x{9C18}\x{9C19}\x{9C1A}\x{9C1B}\x{9C1C}\x{9C1D}\x{9C1E}\x{9C1F}\x{9C20}' .
+'\x{9C21}\x{9C22}\x{9C23}\x{9C24}\x{9C25}\x{9C26}\x{9C27}\x{9C28}\x{9C29}' .
+'\x{9C2A}\x{9C2B}\x{9C2C}\x{9C2D}\x{9C2F}\x{9C30}\x{9C31}\x{9C32}\x{9C33}' .
+'\x{9C34}\x{9C35}\x{9C36}\x{9C37}\x{9C38}\x{9C39}\x{9C3A}\x{9C3B}\x{9C3C}' .
+'\x{9C3D}\x{9C3E}\x{9C3F}\x{9C40}\x{9C41}\x{9C43}\x{9C44}\x{9C45}\x{9C46}' .
+'\x{9C47}\x{9C48}\x{9C49}\x{9C4A}\x{9C4B}\x{9C4C}\x{9C4D}\x{9C4E}\x{9C50}' .
+'\x{9C52}\x{9C53}\x{9C54}\x{9C55}\x{9C56}\x{9C57}\x{9C58}\x{9C59}\x{9C5A}' .
+'\x{9C5B}\x{9C5C}\x{9C5D}\x{9C5E}\x{9C5F}\x{9C60}\x{9C62}\x{9C63}\x{9C65}' .
+'\x{9C66}\x{9C67}\x{9C68}\x{9C69}\x{9C6A}\x{9C6B}\x{9C6C}\x{9C6D}\x{9C6E}' .
+'\x{9C6F}\x{9C70}\x{9C71}\x{9C72}\x{9C73}\x{9C74}\x{9C75}\x{9C77}\x{9C78}' .
+'\x{9C79}\x{9C7A}\x{9C7C}\x{9C7D}\x{9C7E}\x{9C7F}\x{9C80}\x{9C81}\x{9C82}' .
+'\x{9C83}\x{9C84}\x{9C85}\x{9C86}\x{9C87}\x{9C88}\x{9C89}\x{9C8A}\x{9C8B}' .
+'\x{9C8C}\x{9C8D}\x{9C8E}\x{9C8F}\x{9C90}\x{9C91}\x{9C92}\x{9C93}\x{9C94}' .
+'\x{9C95}\x{9C96}\x{9C97}\x{9C98}\x{9C99}\x{9C9A}\x{9C9B}\x{9C9C}\x{9C9D}' .
+'\x{9C9E}\x{9C9F}\x{9CA0}\x{9CA1}\x{9CA2}\x{9CA3}\x{9CA4}\x{9CA5}\x{9CA6}' .
+'\x{9CA7}\x{9CA8}\x{9CA9}\x{9CAA}\x{9CAB}\x{9CAC}\x{9CAD}\x{9CAE}\x{9CAF}' .
+'\x{9CB0}\x{9CB1}\x{9CB2}\x{9CB3}\x{9CB4}\x{9CB5}\x{9CB6}\x{9CB7}\x{9CB8}' .
+'\x{9CB9}\x{9CBA}\x{9CBB}\x{9CBC}\x{9CBD}\x{9CBE}\x{9CBF}\x{9CC0}\x{9CC1}' .
+'\x{9CC2}\x{9CC3}\x{9CC4}\x{9CC5}\x{9CC6}\x{9CC7}\x{9CC8}\x{9CC9}\x{9CCA}' .
+'\x{9CCB}\x{9CCC}\x{9CCD}\x{9CCE}\x{9CCF}\x{9CD0}\x{9CD1}\x{9CD2}\x{9CD3}' .
+'\x{9CD4}\x{9CD5}\x{9CD6}\x{9CD7}\x{9CD8}\x{9CD9}\x{9CDA}\x{9CDB}\x{9CDC}' .
+'\x{9CDD}\x{9CDE}\x{9CDF}\x{9CE0}\x{9CE1}\x{9CE2}\x{9CE3}\x{9CE4}\x{9CE5}' .
+'\x{9CE6}\x{9CE7}\x{9CE8}\x{9CE9}\x{9CEA}\x{9CEB}\x{9CEC}\x{9CED}\x{9CEE}' .
+'\x{9CEF}\x{9CF0}\x{9CF1}\x{9CF2}\x{9CF3}\x{9CF4}\x{9CF5}\x{9CF6}\x{9CF7}' .
+'\x{9CF8}\x{9CF9}\x{9CFA}\x{9CFB}\x{9CFC}\x{9CFD}\x{9CFE}\x{9CFF}\x{9D00}' .
+'\x{9D01}\x{9D02}\x{9D03}\x{9D04}\x{9D05}\x{9D06}\x{9D07}\x{9D08}\x{9D09}' .
+'\x{9D0A}\x{9D0B}\x{9D0F}\x{9D10}\x{9D12}\x{9D13}\x{9D14}\x{9D15}\x{9D16}' .
+'\x{9D17}\x{9D18}\x{9D19}\x{9D1A}\x{9D1B}\x{9D1C}\x{9D1D}\x{9D1E}\x{9D1F}' .
+'\x{9D20}\x{9D21}\x{9D22}\x{9D23}\x{9D24}\x{9D25}\x{9D26}\x{9D28}\x{9D29}' .
+'\x{9D2B}\x{9D2D}\x{9D2E}\x{9D2F}\x{9D30}\x{9D31}\x{9D32}\x{9D33}\x{9D34}' .
+'\x{9D36}\x{9D37}\x{9D38}\x{9D39}\x{9D3A}\x{9D3B}\x{9D3D}\x{9D3E}\x{9D3F}' .
+'\x{9D40}\x{9D41}\x{9D42}\x{9D43}\x{9D45}\x{9D46}\x{9D47}\x{9D48}\x{9D49}' .
+'\x{9D4A}\x{9D4B}\x{9D4C}\x{9D4D}\x{9D4E}\x{9D4F}\x{9D50}\x{9D51}\x{9D52}' .
+'\x{9D53}\x{9D54}\x{9D55}\x{9D56}\x{9D57}\x{9D58}\x{9D59}\x{9D5A}\x{9D5B}' .
+'\x{9D5C}\x{9D5D}\x{9D5E}\x{9D5F}\x{9D60}\x{9D61}\x{9D62}\x{9D63}\x{9D64}' .
+'\x{9D65}\x{9D66}\x{9D67}\x{9D68}\x{9D69}\x{9D6A}\x{9D6B}\x{9D6C}\x{9D6E}' .
+'\x{9D6F}\x{9D70}\x{9D71}\x{9D72}\x{9D73}\x{9D74}\x{9D75}\x{9D76}\x{9D77}' .
+'\x{9D78}\x{9D79}\x{9D7A}\x{9D7B}\x{9D7C}\x{9D7D}\x{9D7E}\x{9D7F}\x{9D80}' .
+'\x{9D81}\x{9D82}\x{9D83}\x{9D84}\x{9D85}\x{9D86}\x{9D87}\x{9D88}\x{9D89}' .
+'\x{9D8A}\x{9D8B}\x{9D8C}\x{9D8D}\x{9D8E}\x{9D90}\x{9D91}\x{9D92}\x{9D93}' .
+'\x{9D94}\x{9D96}\x{9D97}\x{9D98}\x{9D99}\x{9D9A}\x{9D9B}\x{9D9C}\x{9D9D}' .
+'\x{9D9E}\x{9D9F}\x{9DA0}\x{9DA1}\x{9DA2}\x{9DA3}\x{9DA4}\x{9DA5}\x{9DA6}' .
+'\x{9DA7}\x{9DA8}\x{9DA9}\x{9DAA}\x{9DAB}\x{9DAC}\x{9DAD}\x{9DAF}\x{9DB0}' .
+'\x{9DB1}\x{9DB2}\x{9DB3}\x{9DB4}\x{9DB5}\x{9DB6}\x{9DB7}\x{9DB8}\x{9DB9}' .
+'\x{9DBA}\x{9DBB}\x{9DBC}\x{9DBE}\x{9DBF}\x{9DC1}\x{9DC2}\x{9DC3}\x{9DC4}' .
+'\x{9DC5}\x{9DC7}\x{9DC8}\x{9DC9}\x{9DCA}\x{9DCB}\x{9DCC}\x{9DCD}\x{9DCE}' .
+'\x{9DCF}\x{9DD0}\x{9DD1}\x{9DD2}\x{9DD3}\x{9DD4}\x{9DD5}\x{9DD6}\x{9DD7}' .
+'\x{9DD8}\x{9DD9}\x{9DDA}\x{9DDB}\x{9DDC}\x{9DDD}\x{9DDE}\x{9DDF}\x{9DE0}' .
+'\x{9DE1}\x{9DE2}\x{9DE3}\x{9DE4}\x{9DE5}\x{9DE6}\x{9DE7}\x{9DE8}\x{9DE9}' .
+'\x{9DEB}\x{9DEC}\x{9DED}\x{9DEE}\x{9DEF}\x{9DF0}\x{9DF1}\x{9DF2}\x{9DF3}' .
+'\x{9DF4}\x{9DF5}\x{9DF6}\x{9DF7}\x{9DF8}\x{9DF9}\x{9DFA}\x{9DFB}\x{9DFD}' .
+'\x{9DFE}\x{9DFF}\x{9E00}\x{9E01}\x{9E02}\x{9E03}\x{9E04}\x{9E05}\x{9E06}' .
+'\x{9E07}\x{9E08}\x{9E09}\x{9E0A}\x{9E0B}\x{9E0C}\x{9E0D}\x{9E0F}\x{9E10}' .
+'\x{9E11}\x{9E12}\x{9E13}\x{9E14}\x{9E15}\x{9E17}\x{9E18}\x{9E19}\x{9E1A}' .
+'\x{9E1B}\x{9E1D}\x{9E1E}\x{9E1F}\x{9E20}\x{9E21}\x{9E22}\x{9E23}\x{9E24}' .
+'\x{9E25}\x{9E26}\x{9E27}\x{9E28}\x{9E29}\x{9E2A}\x{9E2B}\x{9E2C}\x{9E2D}' .
+'\x{9E2E}\x{9E2F}\x{9E30}\x{9E31}\x{9E32}\x{9E33}\x{9E34}\x{9E35}\x{9E36}' .
+'\x{9E37}\x{9E38}\x{9E39}\x{9E3A}\x{9E3B}\x{9E3C}\x{9E3D}\x{9E3E}\x{9E3F}' .
+'\x{9E40}\x{9E41}\x{9E42}\x{9E43}\x{9E44}\x{9E45}\x{9E46}\x{9E47}\x{9E48}' .
+'\x{9E49}\x{9E4A}\x{9E4B}\x{9E4C}\x{9E4D}\x{9E4E}\x{9E4F}\x{9E50}\x{9E51}' .
+'\x{9E52}\x{9E53}\x{9E54}\x{9E55}\x{9E56}\x{9E57}\x{9E58}\x{9E59}\x{9E5A}' .
+'\x{9E5B}\x{9E5C}\x{9E5D}\x{9E5E}\x{9E5F}\x{9E60}\x{9E61}\x{9E62}\x{9E63}' .
+'\x{9E64}\x{9E65}\x{9E66}\x{9E67}\x{9E68}\x{9E69}\x{9E6A}\x{9E6B}\x{9E6C}' .
+'\x{9E6D}\x{9E6E}\x{9E6F}\x{9E70}\x{9E71}\x{9E72}\x{9E73}\x{9E74}\x{9E75}' .
+'\x{9E76}\x{9E77}\x{9E79}\x{9E7A}\x{9E7C}\x{9E7D}\x{9E7E}\x{9E7F}\x{9E80}' .
+'\x{9E81}\x{9E82}\x{9E83}\x{9E84}\x{9E85}\x{9E86}\x{9E87}\x{9E88}\x{9E89}' .
+'\x{9E8A}\x{9E8B}\x{9E8C}\x{9E8D}\x{9E8E}\x{9E91}\x{9E92}\x{9E93}\x{9E94}' .
+'\x{9E96}\x{9E97}\x{9E99}\x{9E9A}\x{9E9B}\x{9E9C}\x{9E9D}\x{9E9F}\x{9EA0}' .
+'\x{9EA1}\x{9EA3}\x{9EA4}\x{9EA5}\x{9EA6}\x{9EA7}\x{9EA8}\x{9EA9}\x{9EAA}' .
+'\x{9EAD}\x{9EAE}\x{9EAF}\x{9EB0}\x{9EB2}\x{9EB3}\x{9EB4}\x{9EB5}\x{9EB6}' .
+'\x{9EB7}\x{9EB8}\x{9EBB}\x{9EBC}\x{9EBD}\x{9EBE}\x{9EBF}\x{9EC0}\x{9EC1}' .
+'\x{9EC2}\x{9EC3}\x{9EC4}\x{9EC5}\x{9EC6}\x{9EC7}\x{9EC8}\x{9EC9}\x{9ECA}' .
+'\x{9ECB}\x{9ECC}\x{9ECD}\x{9ECE}\x{9ECF}\x{9ED0}\x{9ED1}\x{9ED2}\x{9ED3}' .
+'\x{9ED4}\x{9ED5}\x{9ED6}\x{9ED7}\x{9ED8}\x{9ED9}\x{9EDA}\x{9EDB}\x{9EDC}' .
+'\x{9EDD}\x{9EDE}\x{9EDF}\x{9EE0}\x{9EE1}\x{9EE2}\x{9EE3}\x{9EE4}\x{9EE5}' .
+'\x{9EE6}\x{9EE7}\x{9EE8}\x{9EE9}\x{9EEA}\x{9EEB}\x{9EED}\x{9EEE}\x{9EEF}' .
+'\x{9EF0}\x{9EF2}\x{9EF3}\x{9EF4}\x{9EF5}\x{9EF6}\x{9EF7}\x{9EF8}\x{9EF9}' .
+'\x{9EFA}\x{9EFB}\x{9EFC}\x{9EFD}\x{9EFE}\x{9EFF}\x{9F00}\x{9F01}\x{9F02}' .
+'\x{9F04}\x{9F05}\x{9F06}\x{9F07}\x{9F08}\x{9F09}\x{9F0A}\x{9F0B}\x{9F0C}' .
+'\x{9F0D}\x{9F0E}\x{9F0F}\x{9F10}\x{9F12}\x{9F13}\x{9F15}\x{9F16}\x{9F17}' .
+'\x{9F18}\x{9F19}\x{9F1A}\x{9F1B}\x{9F1C}\x{9F1D}\x{9F1E}\x{9F1F}\x{9F20}' .
+'\x{9F22}\x{9F23}\x{9F24}\x{9F25}\x{9F27}\x{9F28}\x{9F29}\x{9F2A}\x{9F2B}' .
+'\x{9F2C}\x{9F2D}\x{9F2E}\x{9F2F}\x{9F30}\x{9F31}\x{9F32}\x{9F33}\x{9F34}' .
+'\x{9F35}\x{9F36}\x{9F37}\x{9F38}\x{9F39}\x{9F3A}\x{9F3B}\x{9F3C}\x{9F3D}' .
+'\x{9F3E}\x{9F3F}\x{9F40}\x{9F41}\x{9F42}\x{9F43}\x{9F44}\x{9F46}\x{9F47}' .
+'\x{9F48}\x{9F49}\x{9F4A}\x{9F4B}\x{9F4C}\x{9F4D}\x{9F4E}\x{9F4F}\x{9F50}' .
+'\x{9F51}\x{9F52}\x{9F54}\x{9F55}\x{9F56}\x{9F57}\x{9F58}\x{9F59}\x{9F5A}' .
+'\x{9F5B}\x{9F5C}\x{9F5D}\x{9F5E}\x{9F5F}\x{9F60}\x{9F61}\x{9F63}\x{9F64}' .
+'\x{9F65}\x{9F66}\x{9F67}\x{9F68}\x{9F69}\x{9F6A}\x{9F6B}\x{9F6C}\x{9F6E}' .
+'\x{9F6F}\x{9F70}\x{9F71}\x{9F72}\x{9F73}\x{9F74}\x{9F75}\x{9F76}\x{9F77}' .
+'\x{9F78}\x{9F79}\x{9F7A}\x{9F7B}\x{9F7C}\x{9F7D}\x{9F7E}\x{9F7F}\x{9F80}' .
+'\x{9F81}\x{9F82}\x{9F83}\x{9F84}\x{9F85}\x{9F86}\x{9F87}\x{9F88}\x{9F89}' .
+'\x{9F8A}\x{9F8B}\x{9F8C}\x{9F8D}\x{9F8E}\x{9F8F}\x{9F90}\x{9F91}\x{9F92}' .
+'\x{9F93}\x{9F94}\x{9F95}\x{9F96}\x{9F97}\x{9F98}\x{9F99}\x{9F9A}\x{9F9B}' .
+'\x{9F9C}\x{9F9D}\x{9F9E}\x{9F9F}\x{9FA0}\x{9FA2}\x{9FA4}\x{9FA5}]{1,20}$/iu');
diff --git a/library/vendor/Zend/Validate/Hostname/Com.php b/library/vendor/Zend/Validate/Hostname/Com.php
new file mode 100644
index 0000000..873dd52
--- /dev/null
+++ b/library/vendor/Zend/Validate/Hostname/Com.php
@@ -0,0 +1,196 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Ressource file for com and net idn validation
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+return array(
+ 1 => '/^[\x{002d}0-9\x{0400}-\x{052f}]{1,63}$/iu',
+ 2 => '/^[\x{002d}0-9\x{0370}-\x{03ff}]{1,63}$/iu',
+ 3 => '/^[\x{002d}0-9a-z\x{ac00}-\x{d7a3}]{1,17}$/iu',
+ 4 => '/^[\x{002d}0-9a-z·à-öø-ÿāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįıĵķĸĺļľłńņňŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷźżž]{1,63}$/iu',
+ 5 => '/^[\x{002d}0-9A-Za-z\x{3400}-\x{3401}\x{3404}-\x{3406}\x{340C}\x{3416}\x{341C}' .
+'\x{3421}\x{3424}\x{3428}-\x{3429}\x{342B}-\x{342E}\x{3430}-\x{3434}\x{3436}' .
+'\x{3438}-\x{343C}\x{343E}\x{3441}-\x{3445}\x{3447}\x{3449}-\x{3451}\x{3453}' .
+'\x{3457}-\x{345F}\x{3463}-\x{3467}\x{346E}-\x{3471}\x{3473}-\x{3477}\x{3479}-\x{348E}\x{3491}-\x{3497}' .
+'\x{3499}-\x{34A1}\x{34A4}-\x{34AD}\x{34AF}-\x{34B0}\x{34B2}-\x{34BF}\x{34C2}-\x{34C5}\x{34C7}-\x{34CC}' .
+'\x{34CE}-\x{34D1}\x{34D3}-\x{34D8}\x{34DA}-\x{34E4}\x{34E7}-\x{34E9}\x{34EC}-\x{34EF}\x{34F1}-\x{34FE}' .
+'\x{3500}-\x{3507}\x{350A}-\x{3513}\x{3515}\x{3517}-\x{351A}\x{351C}-\x{351E}\x{3520}-\x{352A}' .
+'\x{352C}-\x{3552}\x{3554}-\x{355C}\x{355E}-\x{3567}\x{3569}-\x{3573}\x{3575}-\x{357C}\x{3580}-\x{3588}' .
+'\x{358F}-\x{3598}\x{359E}-\x{35AB}\x{35B4}-\x{35CD}\x{35D0}\x{35D3}-\x{35DC}\x{35E2}-\x{35ED}' .
+'\x{35F0}-\x{35F6}\x{35FB}-\x{3602}\x{3605}-\x{360E}\x{3610}-\x{3611}\x{3613}-\x{3616}\x{3619}-\x{362D}' .
+'\x{362F}-\x{3634}\x{3636}-\x{363B}\x{363F}-\x{3645}\x{3647}-\x{364B}\x{364D}-\x{3653}\x{3655}' .
+'\x{3659}-\x{365E}\x{3660}-\x{3665}\x{3667}-\x{367C}\x{367E}\x{3680}-\x{3685}\x{3687}' .
+'\x{3689}-\x{3690}\x{3692}-\x{3698}\x{369A}\x{369C}-\x{36AE}\x{36B0}-\x{36BF}\x{36C1}-\x{36C5}' .
+'\x{36C9}-\x{36CA}\x{36CD}-\x{36DE}\x{36E1}-\x{36E2}\x{36E5}-\x{36FE}\x{3701}-\x{3713}\x{3715}-\x{371E}' .
+'\x{3720}-\x{372C}\x{372E}-\x{3745}\x{3747}-\x{3748}\x{374A}\x{374C}-\x{3759}\x{375B}-\x{3760}' .
+'\x{3762}-\x{3767}\x{3769}-\x{3772}\x{3774}-\x{378C}\x{378F}-\x{379C}\x{379F}\x{37A1}-\x{37AD}' .
+'\x{37AF}-\x{37B7}\x{37B9}-\x{37C1}\x{37C3}-\x{37C5}\x{37C7}-\x{37D4}\x{37D6}-\x{37E0}\x{37E2}' .
+'\x{37E5}-\x{37ED}\x{37EF}-\x{37F6}\x{37F8}-\x{3802}\x{3804}-\x{381D}\x{3820}-\x{3822}\x{3825}-\x{382A}' .
+'\x{382D}-\x{382F}\x{3831}-\x{3832}\x{3834}-\x{384C}\x{384E}-\x{3860}\x{3862}-\x{3863}\x{3865}-\x{386B}' .
+'\x{386D}-\x{3886}\x{3888}-\x{38A1}\x{38A3}\x{38A5}-\x{38AA}\x{38AC}\x{38AE}-\x{38B0}' .
+'\x{38B2}-\x{38B6}\x{38B8}\x{38BA}-\x{38BE}\x{38C0}-\x{38C9}\x{38CB}-\x{38D4}\x{38D8}-\x{38E0}' .
+'\x{38E2}-\x{38E6}\x{38EB}-\x{38ED}\x{38EF}-\x{38F2}\x{38F5}-\x{38F7}\x{38FA}-\x{38FF}\x{3901}-\x{392A}' .
+'\x{392C}\x{392E}-\x{393B}\x{393E}-\x{3956}\x{395A}-\x{3969}\x{396B}-\x{397A}\x{397C}-\x{3987}' .
+'\x{3989}-\x{3998}\x{399A}-\x{39B0}\x{39B2}\x{39B4}-\x{39D0}\x{39D2}-\x{39DA}\x{39DE}-\x{39DF}' .
+'\x{39E1}-\x{39EF}\x{39F1}-\x{3A17}\x{3A19}-\x{3A2A}\x{3A2D}-\x{3A40}\x{3A43}-\x{3A4E}\x{3A50}' .
+'\x{3A52}-\x{3A5E}\x{3A60}-\x{3A6D}\x{3A6F}-\x{3A77}\x{3A79}-\x{3A82}\x{3A84}-\x{3A85}\x{3A87}-\x{3A89}' .
+'\x{3A8B}-\x{3A8F}\x{3A91}-\x{3A93}\x{3A95}-\x{3A96}\x{3A9A}\x{3A9C}-\x{3AA6}\x{3AA8}-\x{3AA9}' .
+'\x{3AAB}-\x{3AB1}\x{3AB4}-\x{3ABC}\x{3ABE}-\x{3AC5}\x{3ACA}-\x{3ACB}\x{3ACD}-\x{3AD5}\x{3AD7}-\x{3AE1}' .
+'\x{3AE4}-\x{3AE7}\x{3AE9}-\x{3AEC}\x{3AEE}-\x{3AFD}\x{3B01}-\x{3B10}\x{3B12}-\x{3B15}\x{3B17}-\x{3B1E}' .
+'\x{3B20}-\x{3B23}\x{3B25}-\x{3B27}\x{3B29}-\x{3B36}\x{3B38}-\x{3B39}\x{3B3B}-\x{3B3C}\x{3B3F}' .
+'\x{3B41}-\x{3B44}\x{3B47}-\x{3B4C}\x{3B4E}\x{3B51}-\x{3B55}\x{3B58}-\x{3B62}\x{3B68}-\x{3B72}' .
+'\x{3B78}-\x{3B88}\x{3B8B}-\x{3B9F}\x{3BA1}\x{3BA3}-\x{3BBA}\x{3BBC}\x{3BBF}-\x{3BD0}' .
+'\x{3BD3}-\x{3BE6}\x{3BEA}-\x{3BFB}\x{3BFE}-\x{3C12}\x{3C14}-\x{3C1B}\x{3C1D}-\x{3C37}\x{3C39}-\x{3C4F}' .
+'\x{3C52}\x{3C54}-\x{3C5C}\x{3C5E}-\x{3C68}\x{3C6A}-\x{3C76}\x{3C78}-\x{3C8F}\x{3C91}-\x{3CA8}' .
+'\x{3CAA}-\x{3CAD}\x{3CAF}-\x{3CBE}\x{3CC0}-\x{3CC8}\x{3CCA}-\x{3CD3}\x{3CD6}-\x{3CE0}\x{3CE4}-\x{3CEE}' .
+'\x{3CF3}-\x{3D0A}\x{3D0E}-\x{3D1E}\x{3D20}-\x{3D21}\x{3D25}-\x{3D38}\x{3D3B}-\x{3D46}\x{3D4A}-\x{3D59}' .
+'\x{3D5D}-\x{3D7B}\x{3D7D}-\x{3D81}\x{3D84}-\x{3D88}\x{3D8C}-\x{3D8F}\x{3D91}-\x{3D98}\x{3D9A}-\x{3D9C}' .
+'\x{3D9E}-\x{3DA1}\x{3DA3}-\x{3DB0}\x{3DB2}-\x{3DB5}\x{3DB9}-\x{3DBC}\x{3DBE}-\x{3DCB}\x{3DCD}-\x{3DDB}' .
+'\x{3DDF}-\x{3DE8}\x{3DEB}-\x{3DF0}\x{3DF3}-\x{3DF9}\x{3DFB}-\x{3DFC}\x{3DFE}-\x{3E05}\x{3E08}-\x{3E33}' .
+'\x{3E35}-\x{3E3E}\x{3E40}-\x{3E47}\x{3E49}-\x{3E67}\x{3E6B}-\x{3E6F}\x{3E71}-\x{3E85}\x{3E87}-\x{3E8C}' .
+'\x{3E8E}-\x{3E98}\x{3E9A}-\x{3EA1}\x{3EA3}-\x{3EAE}\x{3EB0}-\x{3EB5}\x{3EB7}-\x{3EBA}\x{3EBD}' .
+'\x{3EBF}-\x{3EC4}\x{3EC7}-\x{3ECE}\x{3ED1}-\x{3ED7}\x{3ED9}-\x{3EDA}\x{3EDD}-\x{3EE3}\x{3EE7}-\x{3EE8}' .
+'\x{3EEB}-\x{3EF2}\x{3EF5}-\x{3EFF}\x{3F01}-\x{3F02}\x{3F04}-\x{3F07}\x{3F09}-\x{3F44}\x{3F46}-\x{3F4E}' .
+'\x{3F50}-\x{3F53}\x{3F55}-\x{3F72}\x{3F74}-\x{3F75}\x{3F77}-\x{3F7B}\x{3F7D}-\x{3FB0}\x{3FB6}-\x{3FBF}' .
+'\x{3FC1}-\x{3FCF}\x{3FD1}-\x{3FD3}\x{3FD5}-\x{3FDF}\x{3FE1}-\x{400B}\x{400D}-\x{401C}\x{401E}-\x{4024}' .
+'\x{4027}-\x{403F}\x{4041}-\x{4060}\x{4062}-\x{4069}\x{406B}-\x{408A}\x{408C}-\x{40A7}\x{40A9}-\x{40B4}' .
+'\x{40B6}-\x{40C2}\x{40C7}-\x{40CF}\x{40D1}-\x{40DE}\x{40E0}-\x{40E7}\x{40E9}-\x{40EE}\x{40F0}-\x{40FB}' .
+'\x{40FD}-\x{4109}\x{410B}-\x{4115}\x{4118}-\x{411D}\x{411F}-\x{4122}\x{4124}-\x{4133}\x{4136}-\x{4138}' .
+'\x{413A}-\x{4148}\x{414A}-\x{4169}\x{416C}-\x{4185}\x{4188}-\x{418B}\x{418D}-\x{41AD}\x{41AF}-\x{41B3}' .
+'\x{41B5}-\x{41C3}\x{41C5}-\x{41C9}\x{41CB}-\x{41F2}\x{41F5}-\x{41FE}\x{4200}-\x{4227}\x{422A}-\x{4246}' .
+'\x{4248}-\x{4263}\x{4265}-\x{428B}\x{428D}-\x{42A1}\x{42A3}-\x{42C4}\x{42C8}-\x{42DC}\x{42DE}-\x{430A}' .
+'\x{430C}-\x{4335}\x{4337}\x{4342}-\x{435F}\x{4361}-\x{439A}\x{439C}-\x{439D}\x{439F}-\x{43A4}' .
+'\x{43A6}-\x{43EC}\x{43EF}-\x{4405}\x{4407}-\x{4429}\x{442B}-\x{4455}\x{4457}-\x{4468}\x{446A}-\x{446D}' .
+'\x{446F}-\x{4476}\x{4479}-\x{447D}\x{447F}-\x{4486}\x{4488}-\x{4490}\x{4492}-\x{4498}\x{449A}-\x{44AD}' .
+'\x{44B0}-\x{44BD}\x{44C1}-\x{44D3}\x{44D6}-\x{44E7}\x{44EA}\x{44EC}-\x{44FA}\x{44FC}-\x{4541}' .
+'\x{4543}-\x{454F}\x{4551}-\x{4562}\x{4564}-\x{4575}\x{4577}-\x{45AB}\x{45AD}-\x{45BD}\x{45BF}-\x{45D5}' .
+'\x{45D7}-\x{45EC}\x{45EE}-\x{45F2}\x{45F4}-\x{45FA}\x{45FC}-\x{461A}\x{461C}-\x{461D}\x{461F}-\x{4631}' .
+'\x{4633}-\x{4649}\x{464C}\x{464E}-\x{4652}\x{4654}-\x{466A}\x{466C}-\x{4675}\x{4677}-\x{467A}' .
+'\x{467C}-\x{4694}\x{4696}-\x{46A3}\x{46A5}-\x{46AB}\x{46AD}-\x{46D2}\x{46D4}-\x{4723}\x{4729}-\x{4732}' .
+'\x{4734}-\x{4758}\x{475A}\x{475C}-\x{478B}\x{478D}\x{4791}-\x{47B1}\x{47B3}-\x{47F1}' .
+'\x{47F3}-\x{480B}\x{480D}-\x{4815}\x{4817}-\x{4839}\x{483B}-\x{4870}\x{4872}-\x{487A}\x{487C}-\x{487F}' .
+'\x{4883}-\x{488E}\x{4890}-\x{4896}\x{4899}-\x{48A2}\x{48A4}-\x{48B9}\x{48BB}-\x{48C8}\x{48CA}-\x{48D1}' .
+'\x{48D3}-\x{48E5}\x{48E7}-\x{48F2}\x{48F4}-\x{48FF}\x{4901}-\x{4922}\x{4924}-\x{4928}\x{492A}-\x{4931}' .
+'\x{4933}-\x{495B}\x{495D}-\x{4978}\x{497A}\x{497D}\x{4982}-\x{4983}\x{4985}-\x{49A8}' .
+'\x{49AA}-\x{49AF}\x{49B1}-\x{49B7}\x{49B9}-\x{49BD}\x{49C1}-\x{49C7}\x{49C9}-\x{49CE}\x{49D0}-\x{49E8}' .
+'\x{49EA}\x{49EC}\x{49EE}-\x{4A19}\x{4A1B}-\x{4A43}\x{4A45}-\x{4A4D}\x{4A4F}-\x{4A9E}' .
+'\x{4AA0}-\x{4AA9}\x{4AAB}-\x{4B4E}\x{4B50}-\x{4B5B}\x{4B5D}-\x{4B69}\x{4B6B}-\x{4BC2}\x{4BC6}-\x{4BE8}' .
+'\x{4BEA}-\x{4BFA}\x{4BFC}-\x{4C06}\x{4C08}-\x{4C2D}\x{4C2F}-\x{4C32}\x{4C34}-\x{4C35}\x{4C37}-\x{4C69}' .
+'\x{4C6B}-\x{4C73}\x{4C75}-\x{4C86}\x{4C88}-\x{4C97}\x{4C99}-\x{4C9C}\x{4C9F}-\x{4CA3}\x{4CA5}-\x{4CB5}' .
+'\x{4CB7}-\x{4CF8}\x{4CFA}-\x{4D27}\x{4D29}-\x{4DAC}\x{4DAE}-\x{4DB1}\x{4DB3}-\x{4DB5}\x{4E00}-\x{4E54}' .
+'\x{4E56}-\x{4E89}\x{4E8B}-\x{4EEC}\x{4EEE}-\x{4FAC}\x{4FAE}-\x{503C}\x{503E}-\x{51E5}\x{51E7}-\x{5270}' .
+'\x{5272}-\x{56A1}\x{56A3}-\x{5840}\x{5842}-\x{58B5}\x{58B7}-\x{58CB}\x{58CD}-\x{5BC8}\x{5BCA}-\x{5C01}' .
+'\x{5C03}-\x{5C25}\x{5C27}-\x{5D5B}\x{5D5D}-\x{5F08}\x{5F0A}-\x{61F3}\x{61F5}-\x{63BA}\x{63BC}-\x{6441}' .
+'\x{6443}-\x{657C}\x{657E}-\x{663E}\x{6640}-\x{66FC}\x{66FE}-\x{6728}\x{672A}-\x{6766}\x{6768}-\x{67A8}' .
+'\x{67AA}-\x{685B}\x{685D}-\x{685E}\x{6860}-\x{68B9}\x{68BB}-\x{6AC8}\x{6ACA}-\x{6BB0}\x{6BB2}-\x{6C16}' .
+'\x{6C18}-\x{6D9B}\x{6D9D}-\x{6E12}\x{6E14}-\x{6E8B}\x{6E8D}-\x{704D}\x{704F}-\x{7113}\x{7115}-\x{713B}' .
+'\x{713D}-\x{7154}\x{7156}-\x{729F}\x{72A1}-\x{731E}\x{7320}-\x{7362}\x{7364}-\x{7533}\x{7535}-\x{7551}' .
+'\x{7553}-\x{7572}\x{7574}-\x{75E8}\x{75EA}-\x{7679}\x{767B}-\x{783E}\x{7840}-\x{7A62}\x{7A64}-\x{7AC2}' .
+'\x{7AC4}-\x{7B06}\x{7B08}-\x{7B79}\x{7B7B}-\x{7BCE}\x{7BD0}-\x{7D99}\x{7D9B}-\x{7E49}\x{7E4C}-\x{8132}' .
+'\x{8134}\x{8136}-\x{81D2}\x{81D4}-\x{8216}\x{8218}-\x{822D}\x{822F}-\x{83B4}\x{83B6}-\x{841F}' .
+'\x{8421}-\x{86CC}\x{86CE}-\x{874A}\x{874C}-\x{877E}\x{8780}-\x{8A32}\x{8A34}-\x{8B71}\x{8B73}-\x{8B8E}' .
+'\x{8B90}-\x{8DE4}\x{8DE6}-\x{8E9A}\x{8E9C}-\x{8EE1}\x{8EE4}-\x{8F0B}\x{8F0D}-\x{8FB9}\x{8FBB}-\x{9038}' .
+'\x{903A}-\x{9196}\x{9198}-\x{91A3}\x{91A5}-\x{91B7}\x{91B9}-\x{91C7}\x{91C9}-\x{91E0}\x{91E2}-\x{91FB}' .
+'\x{91FD}-\x{922B}\x{922D}-\x{9270}\x{9272}-\x{9420}\x{9422}-\x{9664}\x{9666}-\x{9679}\x{967B}-\x{9770}' .
+'\x{9772}-\x{982B}\x{982D}-\x{98ED}\x{98EF}-\x{99C4}\x{99C6}-\x{9A11}\x{9A14}-\x{9A27}\x{9A29}-\x{9D0D}' .
+'\x{9D0F}-\x{9D2B}\x{9D2D}-\x{9D8E}\x{9D90}-\x{9DC5}\x{9DC7}-\x{9E77}\x{9E79}-\x{9EB8}\x{9EBB}-\x{9F20}' .
+'\x{9F22}-\x{9F61}\x{9F63}-\x{9FA5}\x{FA28}]{1,20}$/iu',
+ 6 => '/^[\x{002d}0-9A-Za-z]{1,63}$/iu',
+ 7 => '/^[\x{00A1}-\x{00FF}]{1,63}$/iu',
+ 8 => '/^[\x{0100}-\x{017f}]{1,63}$/iu',
+ 9 => '/^[\x{0180}-\x{024f}]{1,63}$/iu',
+ 10 => '/^[\x{0250}-\x{02af}]{1,63}$/iu',
+ 11 => '/^[\x{02b0}-\x{02ff}]{1,63}$/iu',
+ 12 => '/^[\x{0300}-\x{036f}]{1,63}$/iu',
+ 13 => '/^[\x{0370}-\x{03ff}]{1,63}$/iu',
+ 14 => '/^[\x{0400}-\x{04ff}]{1,63}$/iu',
+ 15 => '/^[\x{0500}-\x{052f}]{1,63}$/iu',
+ 16 => '/^[\x{0530}-\x{058F}]{1,63}$/iu',
+ 17 => '/^[\x{0590}-\x{05FF}]{1,63}$/iu',
+ 18 => '/^[\x{0600}-\x{06FF}]{1,63}$/iu',
+ 19 => '/^[\x{0700}-\x{074F}]{1,63}$/iu',
+ 20 => '/^[\x{0780}-\x{07BF}]{1,63}$/iu',
+ 21 => '/^[\x{0900}-\x{097F}]{1,63}$/iu',
+ 22 => '/^[\x{0980}-\x{09FF}]{1,63}$/iu',
+ 23 => '/^[\x{0A00}-\x{0A7F}]{1,63}$/iu',
+ 24 => '/^[\x{0A80}-\x{0AFF}]{1,63}$/iu',
+ 25 => '/^[\x{0B00}-\x{0B7F}]{1,63}$/iu',
+ 26 => '/^[\x{0B80}-\x{0BFF}]{1,63}$/iu',
+ 27 => '/^[\x{0C00}-\x{0C7F}]{1,63}$/iu',
+ 28 => '/^[\x{0C80}-\x{0CFF}]{1,63}$/iu',
+ 29 => '/^[\x{0D00}-\x{0D7F}]{1,63}$/iu',
+ 30 => '/^[\x{0D80}-\x{0DFF}]{1,63}$/iu',
+ 31 => '/^[\x{0E00}-\x{0E7F}]{1,63}$/iu',
+ 32 => '/^[\x{0E80}-\x{0EFF}]{1,63}$/iu',
+ 33 => '/^[\x{0F00}-\x{0FFF}]{1,63}$/iu',
+ 34 => '/^[\x{1000}-\x{109F}]{1,63}$/iu',
+ 35 => '/^[\x{10A0}-\x{10FF}]{1,63}$/iu',
+ 36 => '/^[\x{1100}-\x{11FF}]{1,63}$/iu',
+ 37 => '/^[\x{1200}-\x{137F}]{1,63}$/iu',
+ 38 => '/^[\x{13A0}-\x{13FF}]{1,63}$/iu',
+ 39 => '/^[\x{1400}-\x{167F}]{1,63}$/iu',
+ 40 => '/^[\x{1680}-\x{169F}]{1,63}$/iu',
+ 41 => '/^[\x{16A0}-\x{16FF}]{1,63}$/iu',
+ 42 => '/^[\x{1700}-\x{171F}]{1,63}$/iu',
+ 43 => '/^[\x{1720}-\x{173F}]{1,63}$/iu',
+ 44 => '/^[\x{1740}-\x{175F}]{1,63}$/iu',
+ 45 => '/^[\x{1760}-\x{177F}]{1,63}$/iu',
+ 46 => '/^[\x{1780}-\x{17FF}]{1,63}$/iu',
+ 47 => '/^[\x{1800}-\x{18AF}]{1,63}$/iu',
+ 48 => '/^[\x{1E00}-\x{1EFF}]{1,63}$/iu',
+ 49 => '/^[\x{1F00}-\x{1FFF}]{1,63}$/iu',
+ 50 => '/^[\x{2070}-\x{209F}]{1,63}$/iu',
+ 51 => '/^[\x{2100}-\x{214F}]{1,63}$/iu',
+ 52 => '/^[\x{2150}-\x{218F}]{1,63}$/iu',
+ 53 => '/^[\x{2460}-\x{24FF}]{1,63}$/iu',
+ 54 => '/^[\x{2E80}-\x{2EFF}]{1,63}$/iu',
+ 55 => '/^[\x{2F00}-\x{2FDF}]{1,63}$/iu',
+ 56 => '/^[\x{2FF0}-\x{2FFF}]{1,63}$/iu',
+ 57 => '/^[\x{3040}-\x{309F}]{1,63}$/iu',
+ 58 => '/^[\x{30A0}-\x{30FF}]{1,63}$/iu',
+ 59 => '/^[\x{3100}-\x{312F}]{1,63}$/iu',
+ 60 => '/^[\x{3130}-\x{318F}]{1,63}$/iu',
+ 61 => '/^[\x{3190}-\x{319F}]{1,63}$/iu',
+ 62 => '/^[\x{31A0}-\x{31BF}]{1,63}$/iu',
+ 63 => '/^[\x{31F0}-\x{31FF}]{1,63}$/iu',
+ 64 => '/^[\x{3200}-\x{32FF}]{1,63}$/iu',
+ 65 => '/^[\x{3300}-\x{33FF}]{1,63}$/iu',
+ 66 => '/^[\x{3400}-\x{4DBF}]{1,63}$/iu',
+ 67 => '/^[\x{4E00}-\x{9FFF}]{1,63}$/iu',
+ 68 => '/^[\x{A000}-\x{A48F}]{1,63}$/iu',
+ 69 => '/^[\x{A490}-\x{A4CF}]{1,63}$/iu',
+ 70 => '/^[\x{AC00}-\x{D7AF}]{1,63}$/iu',
+ 73 => '/^[\x{F900}-\x{FAFF}]{1,63}$/iu',
+ 74 => '/^[\x{FB00}-\x{FB4F}]{1,63}$/iu',
+ 75 => '/^[\x{FB50}-\x{FDFF}]{1,63}$/iu',
+ 76 => '/^[\x{FE20}-\x{FE2F}]{1,63}$/iu',
+ 77 => '/^[\x{FE70}-\x{FEFF}]{1,63}$/iu',
+ 78 => '/^[\x{FF00}-\x{FFEF}]{1,63}$/iu',
+ 79 => '/^[\x{20000}-\x{2A6DF}]{1,63}$/iu',
+ 80 => '/^[\x{2F800}-\x{2FA1F}]{1,63}$/iu'
+
+);
diff --git a/library/vendor/Zend/Validate/Hostname/Jp.php b/library/vendor/Zend/Validate/Hostname/Jp.php
new file mode 100644
index 0000000..caca994
--- /dev/null
+++ b/library/vendor/Zend/Validate/Hostname/Jp.php
@@ -0,0 +1,739 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Ressource file for japanese idn validation
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+return array(
+ 1 => '/^[\x{002d}0-9a-z\x{3005}-\x{3007}\x{3041}-\x{3093}\x{309D}\x{309E}' .
+'\x{30A1}-\x{30F6}\x{30FC}' .
+'\x{30FD}\x{30FE}\x{4E00}\x{4E01}\x{4E03}\x{4E07}\x{4E08}\x{4E09}\x{4E0A}' .
+'\x{4E0B}\x{4E0D}\x{4E0E}\x{4E10}\x{4E11}\x{4E14}\x{4E15}\x{4E16}\x{4E17}' .
+'\x{4E18}\x{4E19}\x{4E1E}\x{4E21}\x{4E26}\x{4E2A}\x{4E2D}\x{4E31}\x{4E32}' .
+'\x{4E36}\x{4E38}\x{4E39}\x{4E3B}\x{4E3C}\x{4E3F}\x{4E42}\x{4E43}\x{4E45}' .
+'\x{4E4B}\x{4E4D}\x{4E4E}\x{4E4F}\x{4E55}\x{4E56}\x{4E57}\x{4E58}\x{4E59}' .
+'\x{4E5D}\x{4E5E}\x{4E5F}\x{4E62}\x{4E71}\x{4E73}\x{4E7E}\x{4E80}\x{4E82}' .
+'\x{4E85}\x{4E86}\x{4E88}\x{4E89}\x{4E8A}\x{4E8B}\x{4E8C}\x{4E8E}\x{4E91}' .
+'\x{4E92}\x{4E94}\x{4E95}\x{4E98}\x{4E99}\x{4E9B}\x{4E9C}\x{4E9E}\x{4E9F}' .
+'\x{4EA0}\x{4EA1}\x{4EA2}\x{4EA4}\x{4EA5}\x{4EA6}\x{4EA8}\x{4EAB}\x{4EAC}' .
+'\x{4EAD}\x{4EAE}\x{4EB0}\x{4EB3}\x{4EB6}\x{4EBA}\x{4EC0}\x{4EC1}\x{4EC2}' .
+'\x{4EC4}\x{4EC6}\x{4EC7}\x{4ECA}\x{4ECB}\x{4ECD}\x{4ECE}\x{4ECF}\x{4ED4}' .
+'\x{4ED5}\x{4ED6}\x{4ED7}\x{4ED8}\x{4ED9}\x{4EDD}\x{4EDE}\x{4EDF}\x{4EE3}' .
+'\x{4EE4}\x{4EE5}\x{4EED}\x{4EEE}\x{4EF0}\x{4EF2}\x{4EF6}\x{4EF7}\x{4EFB}' .
+'\x{4F01}\x{4F09}\x{4F0A}\x{4F0D}\x{4F0E}\x{4F0F}\x{4F10}\x{4F11}\x{4F1A}' .
+'\x{4F1C}\x{4F1D}\x{4F2F}\x{4F30}\x{4F34}\x{4F36}\x{4F38}\x{4F3A}\x{4F3C}' .
+'\x{4F3D}\x{4F43}\x{4F46}\x{4F47}\x{4F4D}\x{4F4E}\x{4F4F}\x{4F50}\x{4F51}' .
+'\x{4F53}\x{4F55}\x{4F57}\x{4F59}\x{4F5A}\x{4F5B}\x{4F5C}\x{4F5D}\x{4F5E}' .
+'\x{4F69}\x{4F6F}\x{4F70}\x{4F73}\x{4F75}\x{4F76}\x{4F7B}\x{4F7C}\x{4F7F}' .
+'\x{4F83}\x{4F86}\x{4F88}\x{4F8B}\x{4F8D}\x{4F8F}\x{4F91}\x{4F96}\x{4F98}' .
+'\x{4F9B}\x{4F9D}\x{4FA0}\x{4FA1}\x{4FAB}\x{4FAD}\x{4FAE}\x{4FAF}\x{4FB5}' .
+'\x{4FB6}\x{4FBF}\x{4FC2}\x{4FC3}\x{4FC4}\x{4FCA}\x{4FCE}\x{4FD0}\x{4FD1}' .
+'\x{4FD4}\x{4FD7}\x{4FD8}\x{4FDA}\x{4FDB}\x{4FDD}\x{4FDF}\x{4FE1}\x{4FE3}' .
+'\x{4FE4}\x{4FE5}\x{4FEE}\x{4FEF}\x{4FF3}\x{4FF5}\x{4FF6}\x{4FF8}\x{4FFA}' .
+'\x{4FFE}\x{5005}\x{5006}\x{5009}\x{500B}\x{500D}\x{500F}\x{5011}\x{5012}' .
+'\x{5014}\x{5016}\x{5019}\x{501A}\x{501F}\x{5021}\x{5023}\x{5024}\x{5025}' .
+'\x{5026}\x{5028}\x{5029}\x{502A}\x{502B}\x{502C}\x{502D}\x{5036}\x{5039}' .
+'\x{5043}\x{5047}\x{5048}\x{5049}\x{504F}\x{5050}\x{5055}\x{5056}\x{505A}' .
+'\x{505C}\x{5065}\x{506C}\x{5072}\x{5074}\x{5075}\x{5076}\x{5078}\x{507D}' .
+'\x{5080}\x{5085}\x{508D}\x{5091}\x{5098}\x{5099}\x{509A}\x{50AC}\x{50AD}' .
+'\x{50B2}\x{50B3}\x{50B4}\x{50B5}\x{50B7}\x{50BE}\x{50C2}\x{50C5}\x{50C9}' .
+'\x{50CA}\x{50CD}\x{50CF}\x{50D1}\x{50D5}\x{50D6}\x{50DA}\x{50DE}\x{50E3}' .
+'\x{50E5}\x{50E7}\x{50ED}\x{50EE}\x{50F5}\x{50F9}\x{50FB}\x{5100}\x{5101}' .
+'\x{5102}\x{5104}\x{5109}\x{5112}\x{5114}\x{5115}\x{5116}\x{5118}\x{511A}' .
+'\x{511F}\x{5121}\x{512A}\x{5132}\x{5137}\x{513A}\x{513B}\x{513C}\x{513F}' .
+'\x{5140}\x{5141}\x{5143}\x{5144}\x{5145}\x{5146}\x{5147}\x{5148}\x{5149}' .
+'\x{514B}\x{514C}\x{514D}\x{514E}\x{5150}\x{5152}\x{5154}\x{515A}\x{515C}' .
+'\x{5162}\x{5165}\x{5168}\x{5169}\x{516A}\x{516B}\x{516C}\x{516D}\x{516E}' .
+'\x{5171}\x{5175}\x{5176}\x{5177}\x{5178}\x{517C}\x{5180}\x{5182}\x{5185}' .
+'\x{5186}\x{5189}\x{518A}\x{518C}\x{518D}\x{518F}\x{5190}\x{5191}\x{5192}' .
+'\x{5193}\x{5195}\x{5196}\x{5197}\x{5199}\x{51A0}\x{51A2}\x{51A4}\x{51A5}' .
+'\x{51A6}\x{51A8}\x{51A9}\x{51AA}\x{51AB}\x{51AC}\x{51B0}\x{51B1}\x{51B2}' .
+'\x{51B3}\x{51B4}\x{51B5}\x{51B6}\x{51B7}\x{51BD}\x{51C4}\x{51C5}\x{51C6}' .
+'\x{51C9}\x{51CB}\x{51CC}\x{51CD}\x{51D6}\x{51DB}\x{51DC}\x{51DD}\x{51E0}' .
+'\x{51E1}\x{51E6}\x{51E7}\x{51E9}\x{51EA}\x{51ED}\x{51F0}\x{51F1}\x{51F5}' .
+'\x{51F6}\x{51F8}\x{51F9}\x{51FA}\x{51FD}\x{51FE}\x{5200}\x{5203}\x{5204}' .
+'\x{5206}\x{5207}\x{5208}\x{520A}\x{520B}\x{520E}\x{5211}\x{5214}\x{5217}' .
+'\x{521D}\x{5224}\x{5225}\x{5227}\x{5229}\x{522A}\x{522E}\x{5230}\x{5233}' .
+'\x{5236}\x{5237}\x{5238}\x{5239}\x{523A}\x{523B}\x{5243}\x{5244}\x{5247}' .
+'\x{524A}\x{524B}\x{524C}\x{524D}\x{524F}\x{5254}\x{5256}\x{525B}\x{525E}' .
+'\x{5263}\x{5264}\x{5265}\x{5269}\x{526A}\x{526F}\x{5270}\x{5271}\x{5272}' .
+'\x{5273}\x{5274}\x{5275}\x{527D}\x{527F}\x{5283}\x{5287}\x{5288}\x{5289}' .
+'\x{528D}\x{5291}\x{5292}\x{5294}\x{529B}\x{529F}\x{52A0}\x{52A3}\x{52A9}' .
+'\x{52AA}\x{52AB}\x{52AC}\x{52AD}\x{52B1}\x{52B4}\x{52B5}\x{52B9}\x{52BC}' .
+'\x{52BE}\x{52C1}\x{52C3}\x{52C5}\x{52C7}\x{52C9}\x{52CD}\x{52D2}\x{52D5}' .
+'\x{52D7}\x{52D8}\x{52D9}\x{52DD}\x{52DE}\x{52DF}\x{52E0}\x{52E2}\x{52E3}' .
+'\x{52E4}\x{52E6}\x{52E7}\x{52F2}\x{52F3}\x{52F5}\x{52F8}\x{52F9}\x{52FA}' .
+'\x{52FE}\x{52FF}\x{5301}\x{5302}\x{5305}\x{5306}\x{5308}\x{530D}\x{530F}' .
+'\x{5310}\x{5315}\x{5316}\x{5317}\x{5319}\x{531A}\x{531D}\x{5320}\x{5321}' .
+'\x{5323}\x{532A}\x{532F}\x{5331}\x{5333}\x{5338}\x{5339}\x{533A}\x{533B}' .
+'\x{533F}\x{5340}\x{5341}\x{5343}\x{5345}\x{5346}\x{5347}\x{5348}\x{5349}' .
+'\x{534A}\x{534D}\x{5351}\x{5352}\x{5353}\x{5354}\x{5357}\x{5358}\x{535A}' .
+'\x{535C}\x{535E}\x{5360}\x{5366}\x{5369}\x{536E}\x{536F}\x{5370}\x{5371}' .
+'\x{5373}\x{5374}\x{5375}\x{5377}\x{5378}\x{537B}\x{537F}\x{5382}\x{5384}' .
+'\x{5396}\x{5398}\x{539A}\x{539F}\x{53A0}\x{53A5}\x{53A6}\x{53A8}\x{53A9}' .
+'\x{53AD}\x{53AE}\x{53B0}\x{53B3}\x{53B6}\x{53BB}\x{53C2}\x{53C3}\x{53C8}' .
+'\x{53C9}\x{53CA}\x{53CB}\x{53CC}\x{53CD}\x{53CE}\x{53D4}\x{53D6}\x{53D7}' .
+'\x{53D9}\x{53DB}\x{53DF}\x{53E1}\x{53E2}\x{53E3}\x{53E4}\x{53E5}\x{53E8}' .
+'\x{53E9}\x{53EA}\x{53EB}\x{53EC}\x{53ED}\x{53EE}\x{53EF}\x{53F0}\x{53F1}' .
+'\x{53F2}\x{53F3}\x{53F6}\x{53F7}\x{53F8}\x{53FA}\x{5401}\x{5403}\x{5404}' .
+'\x{5408}\x{5409}\x{540A}\x{540B}\x{540C}\x{540D}\x{540E}\x{540F}\x{5410}' .
+'\x{5411}\x{541B}\x{541D}\x{541F}\x{5420}\x{5426}\x{5429}\x{542B}\x{542C}' .
+'\x{542D}\x{542E}\x{5436}\x{5438}\x{5439}\x{543B}\x{543C}\x{543D}\x{543E}' .
+'\x{5440}\x{5442}\x{5446}\x{5448}\x{5449}\x{544A}\x{544E}\x{5451}\x{545F}' .
+'\x{5468}\x{546A}\x{5470}\x{5471}\x{5473}\x{5475}\x{5476}\x{5477}\x{547B}' .
+'\x{547C}\x{547D}\x{5480}\x{5484}\x{5486}\x{548B}\x{548C}\x{548E}\x{548F}' .
+'\x{5490}\x{5492}\x{54A2}\x{54A4}\x{54A5}\x{54A8}\x{54AB}\x{54AC}\x{54AF}' .
+'\x{54B2}\x{54B3}\x{54B8}\x{54BC}\x{54BD}\x{54BE}\x{54C0}\x{54C1}\x{54C2}' .
+'\x{54C4}\x{54C7}\x{54C8}\x{54C9}\x{54D8}\x{54E1}\x{54E2}\x{54E5}\x{54E6}' .
+'\x{54E8}\x{54E9}\x{54ED}\x{54EE}\x{54F2}\x{54FA}\x{54FD}\x{5504}\x{5506}' .
+'\x{5507}\x{550F}\x{5510}\x{5514}\x{5516}\x{552E}\x{552F}\x{5531}\x{5533}' .
+'\x{5538}\x{5539}\x{553E}\x{5540}\x{5544}\x{5545}\x{5546}\x{554C}\x{554F}' .
+'\x{5553}\x{5556}\x{5557}\x{555C}\x{555D}\x{5563}\x{557B}\x{557C}\x{557E}' .
+'\x{5580}\x{5583}\x{5584}\x{5587}\x{5589}\x{558A}\x{558B}\x{5598}\x{5599}' .
+'\x{559A}\x{559C}\x{559D}\x{559E}\x{559F}\x{55A7}\x{55A8}\x{55A9}\x{55AA}' .
+'\x{55AB}\x{55AC}\x{55AE}\x{55B0}\x{55B6}\x{55C4}\x{55C5}\x{55C7}\x{55D4}' .
+'\x{55DA}\x{55DC}\x{55DF}\x{55E3}\x{55E4}\x{55F7}\x{55F9}\x{55FD}\x{55FE}' .
+'\x{5606}\x{5609}\x{5614}\x{5616}\x{5617}\x{5618}\x{561B}\x{5629}\x{562F}' .
+'\x{5631}\x{5632}\x{5634}\x{5636}\x{5638}\x{5642}\x{564C}\x{564E}\x{5650}' .
+'\x{565B}\x{5664}\x{5668}\x{566A}\x{566B}\x{566C}\x{5674}\x{5678}\x{567A}' .
+'\x{5680}\x{5686}\x{5687}\x{568A}\x{568F}\x{5694}\x{56A0}\x{56A2}\x{56A5}' .
+'\x{56AE}\x{56B4}\x{56B6}\x{56BC}\x{56C0}\x{56C1}\x{56C2}\x{56C3}\x{56C8}' .
+'\x{56CE}\x{56D1}\x{56D3}\x{56D7}\x{56D8}\x{56DA}\x{56DB}\x{56DE}\x{56E0}' .
+'\x{56E3}\x{56EE}\x{56F0}\x{56F2}\x{56F3}\x{56F9}\x{56FA}\x{56FD}\x{56FF}' .
+'\x{5700}\x{5703}\x{5704}\x{5708}\x{5709}\x{570B}\x{570D}\x{570F}\x{5712}' .
+'\x{5713}\x{5716}\x{5718}\x{571C}\x{571F}\x{5726}\x{5727}\x{5728}\x{572D}' .
+'\x{5730}\x{5737}\x{5738}\x{573B}\x{5740}\x{5742}\x{5747}\x{574A}\x{574E}' .
+'\x{574F}\x{5750}\x{5751}\x{5761}\x{5764}\x{5766}\x{5769}\x{576A}\x{577F}' .
+'\x{5782}\x{5788}\x{5789}\x{578B}\x{5793}\x{57A0}\x{57A2}\x{57A3}\x{57A4}' .
+'\x{57AA}\x{57B0}\x{57B3}\x{57C0}\x{57C3}\x{57C6}\x{57CB}\x{57CE}\x{57D2}' .
+'\x{57D3}\x{57D4}\x{57D6}\x{57DC}\x{57DF}\x{57E0}\x{57E3}\x{57F4}\x{57F7}' .
+'\x{57F9}\x{57FA}\x{57FC}\x{5800}\x{5802}\x{5805}\x{5806}\x{580A}\x{580B}' .
+'\x{5815}\x{5819}\x{581D}\x{5821}\x{5824}\x{582A}\x{582F}\x{5830}\x{5831}' .
+'\x{5834}\x{5835}\x{583A}\x{583D}\x{5840}\x{5841}\x{584A}\x{584B}\x{5851}' .
+'\x{5852}\x{5854}\x{5857}\x{5858}\x{5859}\x{585A}\x{585E}\x{5862}\x{5869}' .
+'\x{586B}\x{5870}\x{5872}\x{5875}\x{5879}\x{587E}\x{5883}\x{5885}\x{5893}' .
+'\x{5897}\x{589C}\x{589F}\x{58A8}\x{58AB}\x{58AE}\x{58B3}\x{58B8}\x{58B9}' .
+'\x{58BA}\x{58BB}\x{58BE}\x{58C1}\x{58C5}\x{58C7}\x{58CA}\x{58CC}\x{58D1}' .
+'\x{58D3}\x{58D5}\x{58D7}\x{58D8}\x{58D9}\x{58DC}\x{58DE}\x{58DF}\x{58E4}' .
+'\x{58E5}\x{58EB}\x{58EC}\x{58EE}\x{58EF}\x{58F0}\x{58F1}\x{58F2}\x{58F7}' .
+'\x{58F9}\x{58FA}\x{58FB}\x{58FC}\x{58FD}\x{5902}\x{5909}\x{590A}\x{590F}' .
+'\x{5910}\x{5915}\x{5916}\x{5918}\x{5919}\x{591A}\x{591B}\x{591C}\x{5922}' .
+'\x{5925}\x{5927}\x{5929}\x{592A}\x{592B}\x{592C}\x{592D}\x{592E}\x{5931}' .
+'\x{5932}\x{5937}\x{5938}\x{593E}\x{5944}\x{5947}\x{5948}\x{5949}\x{594E}' .
+'\x{594F}\x{5950}\x{5951}\x{5954}\x{5955}\x{5957}\x{5958}\x{595A}\x{5960}' .
+'\x{5962}\x{5965}\x{5967}\x{5968}\x{5969}\x{596A}\x{596C}\x{596E}\x{5973}' .
+'\x{5974}\x{5978}\x{597D}\x{5981}\x{5982}\x{5983}\x{5984}\x{598A}\x{598D}' .
+'\x{5993}\x{5996}\x{5999}\x{599B}\x{599D}\x{59A3}\x{59A5}\x{59A8}\x{59AC}' .
+'\x{59B2}\x{59B9}\x{59BB}\x{59BE}\x{59C6}\x{59C9}\x{59CB}\x{59D0}\x{59D1}' .
+'\x{59D3}\x{59D4}\x{59D9}\x{59DA}\x{59DC}\x{59E5}\x{59E6}\x{59E8}\x{59EA}' .
+'\x{59EB}\x{59F6}\x{59FB}\x{59FF}\x{5A01}\x{5A03}\x{5A09}\x{5A11}\x{5A18}' .
+'\x{5A1A}\x{5A1C}\x{5A1F}\x{5A20}\x{5A25}\x{5A29}\x{5A2F}\x{5A35}\x{5A36}' .
+'\x{5A3C}\x{5A40}\x{5A41}\x{5A46}\x{5A49}\x{5A5A}\x{5A62}\x{5A66}\x{5A6A}' .
+'\x{5A6C}\x{5A7F}\x{5A92}\x{5A9A}\x{5A9B}\x{5ABC}\x{5ABD}\x{5ABE}\x{5AC1}' .
+'\x{5AC2}\x{5AC9}\x{5ACB}\x{5ACC}\x{5AD0}\x{5AD6}\x{5AD7}\x{5AE1}\x{5AE3}' .
+'\x{5AE6}\x{5AE9}\x{5AFA}\x{5AFB}\x{5B09}\x{5B0B}\x{5B0C}\x{5B16}\x{5B22}' .
+'\x{5B2A}\x{5B2C}\x{5B30}\x{5B32}\x{5B36}\x{5B3E}\x{5B40}\x{5B43}\x{5B45}' .
+'\x{5B50}\x{5B51}\x{5B54}\x{5B55}\x{5B57}\x{5B58}\x{5B5A}\x{5B5B}\x{5B5C}' .
+'\x{5B5D}\x{5B5F}\x{5B63}\x{5B64}\x{5B65}\x{5B66}\x{5B69}\x{5B6B}\x{5B70}' .
+'\x{5B71}\x{5B73}\x{5B75}\x{5B78}\x{5B7A}\x{5B80}\x{5B83}\x{5B85}\x{5B87}' .
+'\x{5B88}\x{5B89}\x{5B8B}\x{5B8C}\x{5B8D}\x{5B8F}\x{5B95}\x{5B97}\x{5B98}' .
+'\x{5B99}\x{5B9A}\x{5B9B}\x{5B9C}\x{5B9D}\x{5B9F}\x{5BA2}\x{5BA3}\x{5BA4}' .
+'\x{5BA5}\x{5BA6}\x{5BAE}\x{5BB0}\x{5BB3}\x{5BB4}\x{5BB5}\x{5BB6}\x{5BB8}' .
+'\x{5BB9}\x{5BBF}\x{5BC2}\x{5BC3}\x{5BC4}\x{5BC5}\x{5BC6}\x{5BC7}\x{5BC9}' .
+'\x{5BCC}\x{5BD0}\x{5BD2}\x{5BD3}\x{5BD4}\x{5BDB}\x{5BDD}\x{5BDE}\x{5BDF}' .
+'\x{5BE1}\x{5BE2}\x{5BE4}\x{5BE5}\x{5BE6}\x{5BE7}\x{5BE8}\x{5BE9}\x{5BEB}' .
+'\x{5BEE}\x{5BF0}\x{5BF3}\x{5BF5}\x{5BF6}\x{5BF8}\x{5BFA}\x{5BFE}\x{5BFF}' .
+'\x{5C01}\x{5C02}\x{5C04}\x{5C05}\x{5C06}\x{5C07}\x{5C08}\x{5C09}\x{5C0A}' .
+'\x{5C0B}\x{5C0D}\x{5C0E}\x{5C0F}\x{5C11}\x{5C13}\x{5C16}\x{5C1A}\x{5C20}' .
+'\x{5C22}\x{5C24}\x{5C28}\x{5C2D}\x{5C31}\x{5C38}\x{5C39}\x{5C3A}\x{5C3B}' .
+'\x{5C3C}\x{5C3D}\x{5C3E}\x{5C3F}\x{5C40}\x{5C41}\x{5C45}\x{5C46}\x{5C48}' .
+'\x{5C4A}\x{5C4B}\x{5C4D}\x{5C4E}\x{5C4F}\x{5C50}\x{5C51}\x{5C53}\x{5C55}' .
+'\x{5C5E}\x{5C60}\x{5C61}\x{5C64}\x{5C65}\x{5C6C}\x{5C6E}\x{5C6F}\x{5C71}' .
+'\x{5C76}\x{5C79}\x{5C8C}\x{5C90}\x{5C91}\x{5C94}\x{5CA1}\x{5CA8}\x{5CA9}' .
+'\x{5CAB}\x{5CAC}\x{5CB1}\x{5CB3}\x{5CB6}\x{5CB7}\x{5CB8}\x{5CBB}\x{5CBC}' .
+'\x{5CBE}\x{5CC5}\x{5CC7}\x{5CD9}\x{5CE0}\x{5CE1}\x{5CE8}\x{5CE9}\x{5CEA}' .
+'\x{5CED}\x{5CEF}\x{5CF0}\x{5CF6}\x{5CFA}\x{5CFB}\x{5CFD}\x{5D07}\x{5D0B}' .
+'\x{5D0E}\x{5D11}\x{5D14}\x{5D15}\x{5D16}\x{5D17}\x{5D18}\x{5D19}\x{5D1A}' .
+'\x{5D1B}\x{5D1F}\x{5D22}\x{5D29}\x{5D4B}\x{5D4C}\x{5D4E}\x{5D50}\x{5D52}' .
+'\x{5D5C}\x{5D69}\x{5D6C}\x{5D6F}\x{5D73}\x{5D76}\x{5D82}\x{5D84}\x{5D87}' .
+'\x{5D8B}\x{5D8C}\x{5D90}\x{5D9D}\x{5DA2}\x{5DAC}\x{5DAE}\x{5DB7}\x{5DBA}' .
+'\x{5DBC}\x{5DBD}\x{5DC9}\x{5DCC}\x{5DCD}\x{5DD2}\x{5DD3}\x{5DD6}\x{5DDB}' .
+'\x{5DDD}\x{5DDE}\x{5DE1}\x{5DE3}\x{5DE5}\x{5DE6}\x{5DE7}\x{5DE8}\x{5DEB}' .
+'\x{5DEE}\x{5DF1}\x{5DF2}\x{5DF3}\x{5DF4}\x{5DF5}\x{5DF7}\x{5DFB}\x{5DFD}' .
+'\x{5DFE}\x{5E02}\x{5E03}\x{5E06}\x{5E0B}\x{5E0C}\x{5E11}\x{5E16}\x{5E19}' .
+'\x{5E1A}\x{5E1B}\x{5E1D}\x{5E25}\x{5E2B}\x{5E2D}\x{5E2F}\x{5E30}\x{5E33}' .
+'\x{5E36}\x{5E37}\x{5E38}\x{5E3D}\x{5E40}\x{5E43}\x{5E44}\x{5E45}\x{5E47}' .
+'\x{5E4C}\x{5E4E}\x{5E54}\x{5E55}\x{5E57}\x{5E5F}\x{5E61}\x{5E62}\x{5E63}' .
+'\x{5E64}\x{5E72}\x{5E73}\x{5E74}\x{5E75}\x{5E76}\x{5E78}\x{5E79}\x{5E7A}' .
+'\x{5E7B}\x{5E7C}\x{5E7D}\x{5E7E}\x{5E7F}\x{5E81}\x{5E83}\x{5E84}\x{5E87}' .
+'\x{5E8A}\x{5E8F}\x{5E95}\x{5E96}\x{5E97}\x{5E9A}\x{5E9C}\x{5EA0}\x{5EA6}' .
+'\x{5EA7}\x{5EAB}\x{5EAD}\x{5EB5}\x{5EB6}\x{5EB7}\x{5EB8}\x{5EC1}\x{5EC2}' .
+'\x{5EC3}\x{5EC8}\x{5EC9}\x{5ECA}\x{5ECF}\x{5ED0}\x{5ED3}\x{5ED6}\x{5EDA}' .
+'\x{5EDB}\x{5EDD}\x{5EDF}\x{5EE0}\x{5EE1}\x{5EE2}\x{5EE3}\x{5EE8}\x{5EE9}' .
+'\x{5EEC}\x{5EF0}\x{5EF1}\x{5EF3}\x{5EF4}\x{5EF6}\x{5EF7}\x{5EF8}\x{5EFA}' .
+'\x{5EFB}\x{5EFC}\x{5EFE}\x{5EFF}\x{5F01}\x{5F03}\x{5F04}\x{5F09}\x{5F0A}' .
+'\x{5F0B}\x{5F0C}\x{5F0D}\x{5F0F}\x{5F10}\x{5F11}\x{5F13}\x{5F14}\x{5F15}' .
+'\x{5F16}\x{5F17}\x{5F18}\x{5F1B}\x{5F1F}\x{5F25}\x{5F26}\x{5F27}\x{5F29}' .
+'\x{5F2D}\x{5F2F}\x{5F31}\x{5F35}\x{5F37}\x{5F38}\x{5F3C}\x{5F3E}\x{5F41}' .
+'\x{5F48}\x{5F4A}\x{5F4C}\x{5F4E}\x{5F51}\x{5F53}\x{5F56}\x{5F57}\x{5F59}' .
+'\x{5F5C}\x{5F5D}\x{5F61}\x{5F62}\x{5F66}\x{5F69}\x{5F6A}\x{5F6B}\x{5F6C}' .
+'\x{5F6D}\x{5F70}\x{5F71}\x{5F73}\x{5F77}\x{5F79}\x{5F7C}\x{5F7F}\x{5F80}' .
+'\x{5F81}\x{5F82}\x{5F83}\x{5F84}\x{5F85}\x{5F87}\x{5F88}\x{5F8A}\x{5F8B}' .
+'\x{5F8C}\x{5F90}\x{5F91}\x{5F92}\x{5F93}\x{5F97}\x{5F98}\x{5F99}\x{5F9E}' .
+'\x{5FA0}\x{5FA1}\x{5FA8}\x{5FA9}\x{5FAA}\x{5FAD}\x{5FAE}\x{5FB3}\x{5FB4}' .
+'\x{5FB9}\x{5FBC}\x{5FBD}\x{5FC3}\x{5FC5}\x{5FCC}\x{5FCD}\x{5FD6}\x{5FD7}' .
+'\x{5FD8}\x{5FD9}\x{5FDC}\x{5FDD}\x{5FE0}\x{5FE4}\x{5FEB}\x{5FF0}\x{5FF1}' .
+'\x{5FF5}\x{5FF8}\x{5FFB}\x{5FFD}\x{5FFF}\x{600E}\x{600F}\x{6010}\x{6012}' .
+'\x{6015}\x{6016}\x{6019}\x{601B}\x{601C}\x{601D}\x{6020}\x{6021}\x{6025}' .
+'\x{6026}\x{6027}\x{6028}\x{6029}\x{602A}\x{602B}\x{602F}\x{6031}\x{603A}' .
+'\x{6041}\x{6042}\x{6043}\x{6046}\x{604A}\x{604B}\x{604D}\x{6050}\x{6052}' .
+'\x{6055}\x{6059}\x{605A}\x{605F}\x{6060}\x{6062}\x{6063}\x{6064}\x{6065}' .
+'\x{6068}\x{6069}\x{606A}\x{606B}\x{606C}\x{606D}\x{606F}\x{6070}\x{6075}' .
+'\x{6077}\x{6081}\x{6083}\x{6084}\x{6089}\x{608B}\x{608C}\x{608D}\x{6092}' .
+'\x{6094}\x{6096}\x{6097}\x{609A}\x{609B}\x{609F}\x{60A0}\x{60A3}\x{60A6}' .
+'\x{60A7}\x{60A9}\x{60AA}\x{60B2}\x{60B3}\x{60B4}\x{60B5}\x{60B6}\x{60B8}' .
+'\x{60BC}\x{60BD}\x{60C5}\x{60C6}\x{60C7}\x{60D1}\x{60D3}\x{60D8}\x{60DA}' .
+'\x{60DC}\x{60DF}\x{60E0}\x{60E1}\x{60E3}\x{60E7}\x{60E8}\x{60F0}\x{60F1}' .
+'\x{60F3}\x{60F4}\x{60F6}\x{60F7}\x{60F9}\x{60FA}\x{60FB}\x{6100}\x{6101}' .
+'\x{6103}\x{6106}\x{6108}\x{6109}\x{610D}\x{610E}\x{610F}\x{6115}\x{611A}' .
+'\x{611B}\x{611F}\x{6121}\x{6127}\x{6128}\x{612C}\x{6134}\x{613C}\x{613D}' .
+'\x{613E}\x{613F}\x{6142}\x{6144}\x{6147}\x{6148}\x{614A}\x{614B}\x{614C}' .
+'\x{614D}\x{614E}\x{6153}\x{6155}\x{6158}\x{6159}\x{615A}\x{615D}\x{615F}' .
+'\x{6162}\x{6163}\x{6165}\x{6167}\x{6168}\x{616B}\x{616E}\x{616F}\x{6170}' .
+'\x{6171}\x{6173}\x{6174}\x{6175}\x{6176}\x{6177}\x{617E}\x{6182}\x{6187}' .
+'\x{618A}\x{618E}\x{6190}\x{6191}\x{6194}\x{6196}\x{6199}\x{619A}\x{61A4}' .
+'\x{61A7}\x{61A9}\x{61AB}\x{61AC}\x{61AE}\x{61B2}\x{61B6}\x{61BA}\x{61BE}' .
+'\x{61C3}\x{61C6}\x{61C7}\x{61C8}\x{61C9}\x{61CA}\x{61CB}\x{61CC}\x{61CD}' .
+'\x{61D0}\x{61E3}\x{61E6}\x{61F2}\x{61F4}\x{61F6}\x{61F7}\x{61F8}\x{61FA}' .
+'\x{61FC}\x{61FD}\x{61FE}\x{61FF}\x{6200}\x{6208}\x{6209}\x{620A}\x{620C}' .
+'\x{620D}\x{620E}\x{6210}\x{6211}\x{6212}\x{6214}\x{6216}\x{621A}\x{621B}' .
+'\x{621D}\x{621E}\x{621F}\x{6221}\x{6226}\x{622A}\x{622E}\x{622F}\x{6230}' .
+'\x{6232}\x{6233}\x{6234}\x{6238}\x{623B}\x{623F}\x{6240}\x{6241}\x{6247}' .
+'\x{6248}\x{6249}\x{624B}\x{624D}\x{624E}\x{6253}\x{6255}\x{6258}\x{625B}' .
+'\x{625E}\x{6260}\x{6263}\x{6268}\x{626E}\x{6271}\x{6276}\x{6279}\x{627C}' .
+'\x{627E}\x{627F}\x{6280}\x{6282}\x{6283}\x{6284}\x{6289}\x{628A}\x{6291}' .
+'\x{6292}\x{6293}\x{6294}\x{6295}\x{6296}\x{6297}\x{6298}\x{629B}\x{629C}' .
+'\x{629E}\x{62AB}\x{62AC}\x{62B1}\x{62B5}\x{62B9}\x{62BB}\x{62BC}\x{62BD}' .
+'\x{62C2}\x{62C5}\x{62C6}\x{62C7}\x{62C8}\x{62C9}\x{62CA}\x{62CC}\x{62CD}' .
+'\x{62CF}\x{62D0}\x{62D1}\x{62D2}\x{62D3}\x{62D4}\x{62D7}\x{62D8}\x{62D9}' .
+'\x{62DB}\x{62DC}\x{62DD}\x{62E0}\x{62E1}\x{62EC}\x{62ED}\x{62EE}\x{62EF}' .
+'\x{62F1}\x{62F3}\x{62F5}\x{62F6}\x{62F7}\x{62FE}\x{62FF}\x{6301}\x{6302}' .
+'\x{6307}\x{6308}\x{6309}\x{630C}\x{6311}\x{6319}\x{631F}\x{6327}\x{6328}' .
+'\x{632B}\x{632F}\x{633A}\x{633D}\x{633E}\x{633F}\x{6349}\x{634C}\x{634D}' .
+'\x{634F}\x{6350}\x{6355}\x{6357}\x{635C}\x{6367}\x{6368}\x{6369}\x{636B}' .
+'\x{636E}\x{6372}\x{6376}\x{6377}\x{637A}\x{637B}\x{6380}\x{6383}\x{6388}' .
+'\x{6389}\x{638C}\x{638E}\x{638F}\x{6392}\x{6396}\x{6398}\x{639B}\x{639F}' .
+'\x{63A0}\x{63A1}\x{63A2}\x{63A3}\x{63A5}\x{63A7}\x{63A8}\x{63A9}\x{63AA}' .
+'\x{63AB}\x{63AC}\x{63B2}\x{63B4}\x{63B5}\x{63BB}\x{63BE}\x{63C0}\x{63C3}' .
+'\x{63C4}\x{63C6}\x{63C9}\x{63CF}\x{63D0}\x{63D2}\x{63D6}\x{63DA}\x{63DB}' .
+'\x{63E1}\x{63E3}\x{63E9}\x{63EE}\x{63F4}\x{63F6}\x{63FA}\x{6406}\x{640D}' .
+'\x{640F}\x{6413}\x{6416}\x{6417}\x{641C}\x{6426}\x{6428}\x{642C}\x{642D}' .
+'\x{6434}\x{6436}\x{643A}\x{643E}\x{6442}\x{644E}\x{6458}\x{6467}\x{6469}' .
+'\x{646F}\x{6476}\x{6478}\x{647A}\x{6483}\x{6488}\x{6492}\x{6493}\x{6495}' .
+'\x{649A}\x{649E}\x{64A4}\x{64A5}\x{64A9}\x{64AB}\x{64AD}\x{64AE}\x{64B0}' .
+'\x{64B2}\x{64B9}\x{64BB}\x{64BC}\x{64C1}\x{64C2}\x{64C5}\x{64C7}\x{64CD}' .
+'\x{64D2}\x{64D4}\x{64D8}\x{64DA}\x{64E0}\x{64E1}\x{64E2}\x{64E3}\x{64E6}' .
+'\x{64E7}\x{64EC}\x{64EF}\x{64F1}\x{64F2}\x{64F4}\x{64F6}\x{64FA}\x{64FD}' .
+'\x{64FE}\x{6500}\x{6505}\x{6518}\x{651C}\x{651D}\x{6523}\x{6524}\x{652A}' .
+'\x{652B}\x{652C}\x{652F}\x{6534}\x{6535}\x{6536}\x{6537}\x{6538}\x{6539}' .
+'\x{653B}\x{653E}\x{653F}\x{6545}\x{6548}\x{654D}\x{654F}\x{6551}\x{6555}' .
+'\x{6556}\x{6557}\x{6558}\x{6559}\x{655D}\x{655E}\x{6562}\x{6563}\x{6566}' .
+'\x{656C}\x{6570}\x{6572}\x{6574}\x{6575}\x{6577}\x{6578}\x{6582}\x{6583}' .
+'\x{6587}\x{6588}\x{6589}\x{658C}\x{658E}\x{6590}\x{6591}\x{6597}\x{6599}' .
+'\x{659B}\x{659C}\x{659F}\x{65A1}\x{65A4}\x{65A5}\x{65A7}\x{65AB}\x{65AC}' .
+'\x{65AD}\x{65AF}\x{65B0}\x{65B7}\x{65B9}\x{65BC}\x{65BD}\x{65C1}\x{65C3}' .
+'\x{65C4}\x{65C5}\x{65C6}\x{65CB}\x{65CC}\x{65CF}\x{65D2}\x{65D7}\x{65D9}' .
+'\x{65DB}\x{65E0}\x{65E1}\x{65E2}\x{65E5}\x{65E6}\x{65E7}\x{65E8}\x{65E9}' .
+'\x{65EC}\x{65ED}\x{65F1}\x{65FA}\x{65FB}\x{6602}\x{6603}\x{6606}\x{6607}' .
+'\x{660A}\x{660C}\x{660E}\x{660F}\x{6613}\x{6614}\x{661C}\x{661F}\x{6620}' .
+'\x{6625}\x{6627}\x{6628}\x{662D}\x{662F}\x{6634}\x{6635}\x{6636}\x{663C}' .
+'\x{663F}\x{6641}\x{6642}\x{6643}\x{6644}\x{6649}\x{664B}\x{664F}\x{6652}' .
+'\x{665D}\x{665E}\x{665F}\x{6662}\x{6664}\x{6666}\x{6667}\x{6668}\x{6669}' .
+'\x{666E}\x{666F}\x{6670}\x{6674}\x{6676}\x{667A}\x{6681}\x{6683}\x{6684}' .
+'\x{6687}\x{6688}\x{6689}\x{668E}\x{6691}\x{6696}\x{6697}\x{6698}\x{669D}' .
+'\x{66A2}\x{66A6}\x{66AB}\x{66AE}\x{66B4}\x{66B8}\x{66B9}\x{66BC}\x{66BE}' .
+'\x{66C1}\x{66C4}\x{66C7}\x{66C9}\x{66D6}\x{66D9}\x{66DA}\x{66DC}\x{66DD}' .
+'\x{66E0}\x{66E6}\x{66E9}\x{66F0}\x{66F2}\x{66F3}\x{66F4}\x{66F5}\x{66F7}' .
+'\x{66F8}\x{66F9}\x{66FC}\x{66FD}\x{66FE}\x{66FF}\x{6700}\x{6703}\x{6708}' .
+'\x{6709}\x{670B}\x{670D}\x{670F}\x{6714}\x{6715}\x{6716}\x{6717}\x{671B}' .
+'\x{671D}\x{671E}\x{671F}\x{6726}\x{6727}\x{6728}\x{672A}\x{672B}\x{672C}' .
+'\x{672D}\x{672E}\x{6731}\x{6734}\x{6736}\x{6737}\x{6738}\x{673A}\x{673D}' .
+'\x{673F}\x{6741}\x{6746}\x{6749}\x{674E}\x{674F}\x{6750}\x{6751}\x{6753}' .
+'\x{6756}\x{6759}\x{675C}\x{675E}\x{675F}\x{6760}\x{6761}\x{6762}\x{6763}' .
+'\x{6764}\x{6765}\x{676A}\x{676D}\x{676F}\x{6770}\x{6771}\x{6772}\x{6773}' .
+'\x{6775}\x{6777}\x{677C}\x{677E}\x{677F}\x{6785}\x{6787}\x{6789}\x{678B}' .
+'\x{678C}\x{6790}\x{6795}\x{6797}\x{679A}\x{679C}\x{679D}\x{67A0}\x{67A1}' .
+'\x{67A2}\x{67A6}\x{67A9}\x{67AF}\x{67B3}\x{67B4}\x{67B6}\x{67B7}\x{67B8}' .
+'\x{67B9}\x{67C1}\x{67C4}\x{67C6}\x{67CA}\x{67CE}\x{67CF}\x{67D0}\x{67D1}' .
+'\x{67D3}\x{67D4}\x{67D8}\x{67DA}\x{67DD}\x{67DE}\x{67E2}\x{67E4}\x{67E7}' .
+'\x{67E9}\x{67EC}\x{67EE}\x{67EF}\x{67F1}\x{67F3}\x{67F4}\x{67F5}\x{67FB}' .
+'\x{67FE}\x{67FF}\x{6802}\x{6803}\x{6804}\x{6813}\x{6816}\x{6817}\x{681E}' .
+'\x{6821}\x{6822}\x{6829}\x{682A}\x{682B}\x{6832}\x{6834}\x{6838}\x{6839}' .
+'\x{683C}\x{683D}\x{6840}\x{6841}\x{6842}\x{6843}\x{6846}\x{6848}\x{684D}' .
+'\x{684E}\x{6850}\x{6851}\x{6853}\x{6854}\x{6859}\x{685C}\x{685D}\x{685F}' .
+'\x{6863}\x{6867}\x{6874}\x{6876}\x{6877}\x{687E}\x{687F}\x{6881}\x{6883}' .
+'\x{6885}\x{688D}\x{688F}\x{6893}\x{6894}\x{6897}\x{689B}\x{689D}\x{689F}' .
+'\x{68A0}\x{68A2}\x{68A6}\x{68A7}\x{68A8}\x{68AD}\x{68AF}\x{68B0}\x{68B1}' .
+'\x{68B3}\x{68B5}\x{68B6}\x{68B9}\x{68BA}\x{68BC}\x{68C4}\x{68C6}\x{68C9}' .
+'\x{68CA}\x{68CB}\x{68CD}\x{68D2}\x{68D4}\x{68D5}\x{68D7}\x{68D8}\x{68DA}' .
+'\x{68DF}\x{68E0}\x{68E1}\x{68E3}\x{68E7}\x{68EE}\x{68EF}\x{68F2}\x{68F9}' .
+'\x{68FA}\x{6900}\x{6901}\x{6904}\x{6905}\x{6908}\x{690B}\x{690C}\x{690D}' .
+'\x{690E}\x{690F}\x{6912}\x{6919}\x{691A}\x{691B}\x{691C}\x{6921}\x{6922}' .
+'\x{6923}\x{6925}\x{6926}\x{6928}\x{692A}\x{6930}\x{6934}\x{6936}\x{6939}' .
+'\x{693D}\x{693F}\x{694A}\x{6953}\x{6954}\x{6955}\x{6959}\x{695A}\x{695C}' .
+'\x{695D}\x{695E}\x{6960}\x{6961}\x{6962}\x{696A}\x{696B}\x{696D}\x{696E}' .
+'\x{696F}\x{6973}\x{6974}\x{6975}\x{6977}\x{6978}\x{6979}\x{697C}\x{697D}' .
+'\x{697E}\x{6981}\x{6982}\x{698A}\x{698E}\x{6991}\x{6994}\x{6995}\x{699B}' .
+'\x{699C}\x{69A0}\x{69A7}\x{69AE}\x{69B1}\x{69B2}\x{69B4}\x{69BB}\x{69BE}' .
+'\x{69BF}\x{69C1}\x{69C3}\x{69C7}\x{69CA}\x{69CB}\x{69CC}\x{69CD}\x{69CE}' .
+'\x{69D0}\x{69D3}\x{69D8}\x{69D9}\x{69DD}\x{69DE}\x{69E7}\x{69E8}\x{69EB}' .
+'\x{69ED}\x{69F2}\x{69F9}\x{69FB}\x{69FD}\x{69FF}\x{6A02}\x{6A05}\x{6A0A}' .
+'\x{6A0B}\x{6A0C}\x{6A12}\x{6A13}\x{6A14}\x{6A17}\x{6A19}\x{6A1B}\x{6A1E}' .
+'\x{6A1F}\x{6A21}\x{6A22}\x{6A23}\x{6A29}\x{6A2A}\x{6A2B}\x{6A2E}\x{6A35}' .
+'\x{6A36}\x{6A38}\x{6A39}\x{6A3A}\x{6A3D}\x{6A44}\x{6A47}\x{6A48}\x{6A4B}' .
+'\x{6A58}\x{6A59}\x{6A5F}\x{6A61}\x{6A62}\x{6A66}\x{6A72}\x{6A78}\x{6A7F}' .
+'\x{6A80}\x{6A84}\x{6A8D}\x{6A8E}\x{6A90}\x{6A97}\x{6A9C}\x{6AA0}\x{6AA2}' .
+'\x{6AA3}\x{6AAA}\x{6AAC}\x{6AAE}\x{6AB3}\x{6AB8}\x{6ABB}\x{6AC1}\x{6AC2}' .
+'\x{6AC3}\x{6AD1}\x{6AD3}\x{6ADA}\x{6ADB}\x{6ADE}\x{6ADF}\x{6AE8}\x{6AEA}' .
+'\x{6AFA}\x{6AFB}\x{6B04}\x{6B05}\x{6B0A}\x{6B12}\x{6B16}\x{6B1D}\x{6B1F}' .
+'\x{6B20}\x{6B21}\x{6B23}\x{6B27}\x{6B32}\x{6B37}\x{6B38}\x{6B39}\x{6B3A}' .
+'\x{6B3D}\x{6B3E}\x{6B43}\x{6B47}\x{6B49}\x{6B4C}\x{6B4E}\x{6B50}\x{6B53}' .
+'\x{6B54}\x{6B59}\x{6B5B}\x{6B5F}\x{6B61}\x{6B62}\x{6B63}\x{6B64}\x{6B66}' .
+'\x{6B69}\x{6B6A}\x{6B6F}\x{6B73}\x{6B74}\x{6B78}\x{6B79}\x{6B7B}\x{6B7F}' .
+'\x{6B80}\x{6B83}\x{6B84}\x{6B86}\x{6B89}\x{6B8A}\x{6B8B}\x{6B8D}\x{6B95}' .
+'\x{6B96}\x{6B98}\x{6B9E}\x{6BA4}\x{6BAA}\x{6BAB}\x{6BAF}\x{6BB1}\x{6BB2}' .
+'\x{6BB3}\x{6BB4}\x{6BB5}\x{6BB7}\x{6BBA}\x{6BBB}\x{6BBC}\x{6BBF}\x{6BC0}' .
+'\x{6BC5}\x{6BC6}\x{6BCB}\x{6BCD}\x{6BCE}\x{6BD2}\x{6BD3}\x{6BD4}\x{6BD8}' .
+'\x{6BDB}\x{6BDF}\x{6BEB}\x{6BEC}\x{6BEF}\x{6BF3}\x{6C08}\x{6C0F}\x{6C11}' .
+'\x{6C13}\x{6C14}\x{6C17}\x{6C1B}\x{6C23}\x{6C24}\x{6C34}\x{6C37}\x{6C38}' .
+'\x{6C3E}\x{6C40}\x{6C41}\x{6C42}\x{6C4E}\x{6C50}\x{6C55}\x{6C57}\x{6C5A}' .
+'\x{6C5D}\x{6C5E}\x{6C5F}\x{6C60}\x{6C62}\x{6C68}\x{6C6A}\x{6C70}\x{6C72}' .
+'\x{6C73}\x{6C7A}\x{6C7D}\x{6C7E}\x{6C81}\x{6C82}\x{6C83}\x{6C88}\x{6C8C}' .
+'\x{6C8D}\x{6C90}\x{6C92}\x{6C93}\x{6C96}\x{6C99}\x{6C9A}\x{6C9B}\x{6CA1}' .
+'\x{6CA2}\x{6CAB}\x{6CAE}\x{6CB1}\x{6CB3}\x{6CB8}\x{6CB9}\x{6CBA}\x{6CBB}' .
+'\x{6CBC}\x{6CBD}\x{6CBE}\x{6CBF}\x{6CC1}\x{6CC4}\x{6CC5}\x{6CC9}\x{6CCA}' .
+'\x{6CCC}\x{6CD3}\x{6CD5}\x{6CD7}\x{6CD9}\x{6CDB}\x{6CDD}\x{6CE1}\x{6CE2}' .
+'\x{6CE3}\x{6CE5}\x{6CE8}\x{6CEA}\x{6CEF}\x{6CF0}\x{6CF1}\x{6CF3}\x{6D0B}' .
+'\x{6D0C}\x{6D12}\x{6D17}\x{6D19}\x{6D1B}\x{6D1E}\x{6D1F}\x{6D25}\x{6D29}' .
+'\x{6D2A}\x{6D2B}\x{6D32}\x{6D33}\x{6D35}\x{6D36}\x{6D38}\x{6D3B}\x{6D3D}' .
+'\x{6D3E}\x{6D41}\x{6D44}\x{6D45}\x{6D59}\x{6D5A}\x{6D5C}\x{6D63}\x{6D64}' .
+'\x{6D66}\x{6D69}\x{6D6A}\x{6D6C}\x{6D6E}\x{6D74}\x{6D77}\x{6D78}\x{6D79}' .
+'\x{6D85}\x{6D88}\x{6D8C}\x{6D8E}\x{6D93}\x{6D95}\x{6D99}\x{6D9B}\x{6D9C}' .
+'\x{6DAF}\x{6DB2}\x{6DB5}\x{6DB8}\x{6DBC}\x{6DC0}\x{6DC5}\x{6DC6}\x{6DC7}' .
+'\x{6DCB}\x{6DCC}\x{6DD1}\x{6DD2}\x{6DD5}\x{6DD8}\x{6DD9}\x{6DDE}\x{6DE1}' .
+'\x{6DE4}\x{6DE6}\x{6DE8}\x{6DEA}\x{6DEB}\x{6DEC}\x{6DEE}\x{6DF1}\x{6DF3}' .
+'\x{6DF5}\x{6DF7}\x{6DF9}\x{6DFA}\x{6DFB}\x{6E05}\x{6E07}\x{6E08}\x{6E09}' .
+'\x{6E0A}\x{6E0B}\x{6E13}\x{6E15}\x{6E19}\x{6E1A}\x{6E1B}\x{6E1D}\x{6E1F}' .
+'\x{6E20}\x{6E21}\x{6E23}\x{6E24}\x{6E25}\x{6E26}\x{6E29}\x{6E2B}\x{6E2C}' .
+'\x{6E2D}\x{6E2E}\x{6E2F}\x{6E38}\x{6E3A}\x{6E3E}\x{6E43}\x{6E4A}\x{6E4D}' .
+'\x{6E4E}\x{6E56}\x{6E58}\x{6E5B}\x{6E5F}\x{6E67}\x{6E6B}\x{6E6E}\x{6E6F}' .
+'\x{6E72}\x{6E76}\x{6E7E}\x{6E7F}\x{6E80}\x{6E82}\x{6E8C}\x{6E8F}\x{6E90}' .
+'\x{6E96}\x{6E98}\x{6E9C}\x{6E9D}\x{6E9F}\x{6EA2}\x{6EA5}\x{6EAA}\x{6EAF}' .
+'\x{6EB2}\x{6EB6}\x{6EB7}\x{6EBA}\x{6EBD}\x{6EC2}\x{6EC4}\x{6EC5}\x{6EC9}' .
+'\x{6ECB}\x{6ECC}\x{6ED1}\x{6ED3}\x{6ED4}\x{6ED5}\x{6EDD}\x{6EDE}\x{6EEC}' .
+'\x{6EEF}\x{6EF2}\x{6EF4}\x{6EF7}\x{6EF8}\x{6EFE}\x{6EFF}\x{6F01}\x{6F02}' .
+'\x{6F06}\x{6F09}\x{6F0F}\x{6F11}\x{6F13}\x{6F14}\x{6F15}\x{6F20}\x{6F22}' .
+'\x{6F23}\x{6F2B}\x{6F2C}\x{6F31}\x{6F32}\x{6F38}\x{6F3E}\x{6F3F}\x{6F41}' .
+'\x{6F45}\x{6F54}\x{6F58}\x{6F5B}\x{6F5C}\x{6F5F}\x{6F64}\x{6F66}\x{6F6D}' .
+'\x{6F6E}\x{6F6F}\x{6F70}\x{6F74}\x{6F78}\x{6F7A}\x{6F7C}\x{6F80}\x{6F81}' .
+'\x{6F82}\x{6F84}\x{6F86}\x{6F8E}\x{6F91}\x{6F97}\x{6FA1}\x{6FA3}\x{6FA4}' .
+'\x{6FAA}\x{6FB1}\x{6FB3}\x{6FB9}\x{6FC0}\x{6FC1}\x{6FC2}\x{6FC3}\x{6FC6}' .
+'\x{6FD4}\x{6FD5}\x{6FD8}\x{6FDB}\x{6FDF}\x{6FE0}\x{6FE1}\x{6FE4}\x{6FEB}' .
+'\x{6FEC}\x{6FEE}\x{6FEF}\x{6FF1}\x{6FF3}\x{6FF6}\x{6FFA}\x{6FFE}\x{7001}' .
+'\x{7009}\x{700B}\x{700F}\x{7011}\x{7015}\x{7018}\x{701A}\x{701B}\x{701D}' .
+'\x{701E}\x{701F}\x{7026}\x{7027}\x{702C}\x{7030}\x{7032}\x{703E}\x{704C}' .
+'\x{7051}\x{7058}\x{7063}\x{706B}\x{706F}\x{7070}\x{7078}\x{707C}\x{707D}' .
+'\x{7089}\x{708A}\x{708E}\x{7092}\x{7099}\x{70AC}\x{70AD}\x{70AE}\x{70AF}' .
+'\x{70B3}\x{70B8}\x{70B9}\x{70BA}\x{70C8}\x{70CB}\x{70CF}\x{70D9}\x{70DD}' .
+'\x{70DF}\x{70F1}\x{70F9}\x{70FD}\x{7109}\x{7114}\x{7119}\x{711A}\x{711C}' .
+'\x{7121}\x{7126}\x{7136}\x{713C}\x{7149}\x{714C}\x{714E}\x{7155}\x{7156}' .
+'\x{7159}\x{7162}\x{7164}\x{7165}\x{7166}\x{7167}\x{7169}\x{716C}\x{716E}' .
+'\x{717D}\x{7184}\x{7188}\x{718A}\x{718F}\x{7194}\x{7195}\x{7199}\x{719F}' .
+'\x{71A8}\x{71AC}\x{71B1}\x{71B9}\x{71BE}\x{71C3}\x{71C8}\x{71C9}\x{71CE}' .
+'\x{71D0}\x{71D2}\x{71D4}\x{71D5}\x{71D7}\x{71DF}\x{71E0}\x{71E5}\x{71E6}' .
+'\x{71E7}\x{71EC}\x{71ED}\x{71EE}\x{71F5}\x{71F9}\x{71FB}\x{71FC}\x{71FF}' .
+'\x{7206}\x{720D}\x{7210}\x{721B}\x{7228}\x{722A}\x{722C}\x{722D}\x{7230}' .
+'\x{7232}\x{7235}\x{7236}\x{723A}\x{723B}\x{723C}\x{723D}\x{723E}\x{723F}' .
+'\x{7240}\x{7246}\x{7247}\x{7248}\x{724B}\x{724C}\x{7252}\x{7258}\x{7259}' .
+'\x{725B}\x{725D}\x{725F}\x{7261}\x{7262}\x{7267}\x{7269}\x{7272}\x{7274}' .
+'\x{7279}\x{727D}\x{727E}\x{7280}\x{7281}\x{7282}\x{7287}\x{7292}\x{7296}' .
+'\x{72A0}\x{72A2}\x{72A7}\x{72AC}\x{72AF}\x{72B2}\x{72B6}\x{72B9}\x{72C2}' .
+'\x{72C3}\x{72C4}\x{72C6}\x{72CE}\x{72D0}\x{72D2}\x{72D7}\x{72D9}\x{72DB}' .
+'\x{72E0}\x{72E1}\x{72E2}\x{72E9}\x{72EC}\x{72ED}\x{72F7}\x{72F8}\x{72F9}' .
+'\x{72FC}\x{72FD}\x{730A}\x{7316}\x{7317}\x{731B}\x{731C}\x{731D}\x{731F}' .
+'\x{7325}\x{7329}\x{732A}\x{732B}\x{732E}\x{732F}\x{7334}\x{7336}\x{7337}' .
+'\x{733E}\x{733F}\x{7344}\x{7345}\x{734E}\x{734F}\x{7357}\x{7363}\x{7368}' .
+'\x{736A}\x{7370}\x{7372}\x{7375}\x{7378}\x{737A}\x{737B}\x{7384}\x{7387}' .
+'\x{7389}\x{738B}\x{7396}\x{73A9}\x{73B2}\x{73B3}\x{73BB}\x{73C0}\x{73C2}' .
+'\x{73C8}\x{73CA}\x{73CD}\x{73CE}\x{73DE}\x{73E0}\x{73E5}\x{73EA}\x{73ED}' .
+'\x{73EE}\x{73F1}\x{73F8}\x{73FE}\x{7403}\x{7405}\x{7406}\x{7409}\x{7422}' .
+'\x{7425}\x{7432}\x{7433}\x{7434}\x{7435}\x{7436}\x{743A}\x{743F}\x{7441}' .
+'\x{7455}\x{7459}\x{745A}\x{745B}\x{745C}\x{745E}\x{745F}\x{7460}\x{7463}' .
+'\x{7464}\x{7469}\x{746A}\x{746F}\x{7470}\x{7473}\x{7476}\x{747E}\x{7483}' .
+'\x{748B}\x{749E}\x{74A2}\x{74A7}\x{74B0}\x{74BD}\x{74CA}\x{74CF}\x{74D4}' .
+'\x{74DC}\x{74E0}\x{74E2}\x{74E3}\x{74E6}\x{74E7}\x{74E9}\x{74EE}\x{74F0}' .
+'\x{74F1}\x{74F2}\x{74F6}\x{74F7}\x{74F8}\x{7503}\x{7504}\x{7505}\x{750C}' .
+'\x{750D}\x{750E}\x{7511}\x{7513}\x{7515}\x{7518}\x{751A}\x{751C}\x{751E}' .
+'\x{751F}\x{7523}\x{7525}\x{7526}\x{7528}\x{752B}\x{752C}\x{7530}\x{7531}' .
+'\x{7532}\x{7533}\x{7537}\x{7538}\x{753A}\x{753B}\x{753C}\x{7544}\x{7546}' .
+'\x{7549}\x{754A}\x{754B}\x{754C}\x{754D}\x{754F}\x{7551}\x{7554}\x{7559}' .
+'\x{755A}\x{755B}\x{755C}\x{755D}\x{7560}\x{7562}\x{7564}\x{7565}\x{7566}' .
+'\x{7567}\x{7569}\x{756A}\x{756B}\x{756D}\x{7570}\x{7573}\x{7574}\x{7576}' .
+'\x{7577}\x{7578}\x{757F}\x{7582}\x{7586}\x{7587}\x{7589}\x{758A}\x{758B}' .
+'\x{758E}\x{758F}\x{7591}\x{7594}\x{759A}\x{759D}\x{75A3}\x{75A5}\x{75AB}' .
+'\x{75B1}\x{75B2}\x{75B3}\x{75B5}\x{75B8}\x{75B9}\x{75BC}\x{75BD}\x{75BE}' .
+'\x{75C2}\x{75C3}\x{75C5}\x{75C7}\x{75CA}\x{75CD}\x{75D2}\x{75D4}\x{75D5}' .
+'\x{75D8}\x{75D9}\x{75DB}\x{75DE}\x{75E2}\x{75E3}\x{75E9}\x{75F0}\x{75F2}' .
+'\x{75F3}\x{75F4}\x{75FA}\x{75FC}\x{75FE}\x{75FF}\x{7601}\x{7609}\x{760B}' .
+'\x{760D}\x{761F}\x{7620}\x{7621}\x{7622}\x{7624}\x{7627}\x{7630}\x{7634}' .
+'\x{763B}\x{7642}\x{7646}\x{7647}\x{7648}\x{764C}\x{7652}\x{7656}\x{7658}' .
+'\x{765C}\x{7661}\x{7662}\x{7667}\x{7668}\x{7669}\x{766A}\x{766C}\x{7670}' .
+'\x{7672}\x{7676}\x{7678}\x{767A}\x{767B}\x{767C}\x{767D}\x{767E}\x{7680}' .
+'\x{7683}\x{7684}\x{7686}\x{7687}\x{7688}\x{768B}\x{768E}\x{7690}\x{7693}' .
+'\x{7696}\x{7699}\x{769A}\x{76AE}\x{76B0}\x{76B4}\x{76B7}\x{76B8}\x{76B9}' .
+'\x{76BA}\x{76BF}\x{76C2}\x{76C3}\x{76C6}\x{76C8}\x{76CA}\x{76CD}\x{76D2}' .
+'\x{76D6}\x{76D7}\x{76DB}\x{76DC}\x{76DE}\x{76DF}\x{76E1}\x{76E3}\x{76E4}' .
+'\x{76E5}\x{76E7}\x{76EA}\x{76EE}\x{76F2}\x{76F4}\x{76F8}\x{76FB}\x{76FE}' .
+'\x{7701}\x{7704}\x{7707}\x{7708}\x{7709}\x{770B}\x{770C}\x{771B}\x{771E}' .
+'\x{771F}\x{7720}\x{7724}\x{7725}\x{7726}\x{7729}\x{7737}\x{7738}\x{773A}' .
+'\x{773C}\x{7740}\x{7747}\x{775A}\x{775B}\x{7761}\x{7763}\x{7765}\x{7766}' .
+'\x{7768}\x{776B}\x{7779}\x{777E}\x{777F}\x{778B}\x{778E}\x{7791}\x{779E}' .
+'\x{77A0}\x{77A5}\x{77AC}\x{77AD}\x{77B0}\x{77B3}\x{77B6}\x{77B9}\x{77BB}' .
+'\x{77BC}\x{77BD}\x{77BF}\x{77C7}\x{77CD}\x{77D7}\x{77DA}\x{77DB}\x{77DC}' .
+'\x{77E2}\x{77E3}\x{77E5}\x{77E7}\x{77E9}\x{77ED}\x{77EE}\x{77EF}\x{77F3}' .
+'\x{77FC}\x{7802}\x{780C}\x{7812}\x{7814}\x{7815}\x{7820}\x{7825}\x{7826}' .
+'\x{7827}\x{7832}\x{7834}\x{783A}\x{783F}\x{7845}\x{785D}\x{786B}\x{786C}' .
+'\x{786F}\x{7872}\x{7874}\x{787C}\x{7881}\x{7886}\x{7887}\x{788C}\x{788D}' .
+'\x{788E}\x{7891}\x{7893}\x{7895}\x{7897}\x{789A}\x{78A3}\x{78A7}\x{78A9}' .
+'\x{78AA}\x{78AF}\x{78B5}\x{78BA}\x{78BC}\x{78BE}\x{78C1}\x{78C5}\x{78C6}' .
+'\x{78CA}\x{78CB}\x{78D0}\x{78D1}\x{78D4}\x{78DA}\x{78E7}\x{78E8}\x{78EC}' .
+'\x{78EF}\x{78F4}\x{78FD}\x{7901}\x{7907}\x{790E}\x{7911}\x{7912}\x{7919}' .
+'\x{7926}\x{792A}\x{792B}\x{792C}\x{793A}\x{793C}\x{793E}\x{7940}\x{7941}' .
+'\x{7947}\x{7948}\x{7949}\x{7950}\x{7953}\x{7955}\x{7956}\x{7957}\x{795A}' .
+'\x{795D}\x{795E}\x{795F}\x{7960}\x{7962}\x{7965}\x{7968}\x{796D}\x{7977}' .
+'\x{797A}\x{797F}\x{7980}\x{7981}\x{7984}\x{7985}\x{798A}\x{798D}\x{798E}' .
+'\x{798F}\x{799D}\x{79A6}\x{79A7}\x{79AA}\x{79AE}\x{79B0}\x{79B3}\x{79B9}' .
+'\x{79BA}\x{79BD}\x{79BE}\x{79BF}\x{79C0}\x{79C1}\x{79C9}\x{79CB}\x{79D1}' .
+'\x{79D2}\x{79D5}\x{79D8}\x{79DF}\x{79E1}\x{79E3}\x{79E4}\x{79E6}\x{79E7}' .
+'\x{79E9}\x{79EC}\x{79F0}\x{79FB}\x{7A00}\x{7A08}\x{7A0B}\x{7A0D}\x{7A0E}' .
+'\x{7A14}\x{7A17}\x{7A18}\x{7A19}\x{7A1A}\x{7A1C}\x{7A1F}\x{7A20}\x{7A2E}' .
+'\x{7A31}\x{7A32}\x{7A37}\x{7A3B}\x{7A3C}\x{7A3D}\x{7A3E}\x{7A3F}\x{7A40}' .
+'\x{7A42}\x{7A43}\x{7A46}\x{7A49}\x{7A4D}\x{7A4E}\x{7A4F}\x{7A50}\x{7A57}' .
+'\x{7A61}\x{7A62}\x{7A63}\x{7A69}\x{7A6B}\x{7A70}\x{7A74}\x{7A76}\x{7A79}' .
+'\x{7A7A}\x{7A7D}\x{7A7F}\x{7A81}\x{7A83}\x{7A84}\x{7A88}\x{7A92}\x{7A93}' .
+'\x{7A95}\x{7A96}\x{7A97}\x{7A98}\x{7A9F}\x{7AA9}\x{7AAA}\x{7AAE}\x{7AAF}' .
+'\x{7AB0}\x{7AB6}\x{7ABA}\x{7ABF}\x{7AC3}\x{7AC4}\x{7AC5}\x{7AC7}\x{7AC8}' .
+'\x{7ACA}\x{7ACB}\x{7ACD}\x{7ACF}\x{7AD2}\x{7AD3}\x{7AD5}\x{7AD9}\x{7ADA}' .
+'\x{7ADC}\x{7ADD}\x{7ADF}\x{7AE0}\x{7AE1}\x{7AE2}\x{7AE3}\x{7AE5}\x{7AE6}' .
+'\x{7AEA}\x{7AED}\x{7AEF}\x{7AF0}\x{7AF6}\x{7AF8}\x{7AF9}\x{7AFA}\x{7AFF}' .
+'\x{7B02}\x{7B04}\x{7B06}\x{7B08}\x{7B0A}\x{7B0B}\x{7B0F}\x{7B11}\x{7B18}' .
+'\x{7B19}\x{7B1B}\x{7B1E}\x{7B20}\x{7B25}\x{7B26}\x{7B28}\x{7B2C}\x{7B33}' .
+'\x{7B35}\x{7B36}\x{7B39}\x{7B45}\x{7B46}\x{7B48}\x{7B49}\x{7B4B}\x{7B4C}' .
+'\x{7B4D}\x{7B4F}\x{7B50}\x{7B51}\x{7B52}\x{7B54}\x{7B56}\x{7B5D}\x{7B65}' .
+'\x{7B67}\x{7B6C}\x{7B6E}\x{7B70}\x{7B71}\x{7B74}\x{7B75}\x{7B7A}\x{7B86}' .
+'\x{7B87}\x{7B8B}\x{7B8D}\x{7B8F}\x{7B92}\x{7B94}\x{7B95}\x{7B97}\x{7B98}' .
+'\x{7B99}\x{7B9A}\x{7B9C}\x{7B9D}\x{7B9F}\x{7BA1}\x{7BAA}\x{7BAD}\x{7BB1}' .
+'\x{7BB4}\x{7BB8}\x{7BC0}\x{7BC1}\x{7BC4}\x{7BC6}\x{7BC7}\x{7BC9}\x{7BCB}' .
+'\x{7BCC}\x{7BCF}\x{7BDD}\x{7BE0}\x{7BE4}\x{7BE5}\x{7BE6}\x{7BE9}\x{7BED}' .
+'\x{7BF3}\x{7BF6}\x{7BF7}\x{7C00}\x{7C07}\x{7C0D}\x{7C11}\x{7C12}\x{7C13}' .
+'\x{7C14}\x{7C17}\x{7C1F}\x{7C21}\x{7C23}\x{7C27}\x{7C2A}\x{7C2B}\x{7C37}' .
+'\x{7C38}\x{7C3D}\x{7C3E}\x{7C3F}\x{7C40}\x{7C43}\x{7C4C}\x{7C4D}\x{7C4F}' .
+'\x{7C50}\x{7C54}\x{7C56}\x{7C58}\x{7C5F}\x{7C60}\x{7C64}\x{7C65}\x{7C6C}' .
+'\x{7C73}\x{7C75}\x{7C7E}\x{7C81}\x{7C82}\x{7C83}\x{7C89}\x{7C8B}\x{7C8D}' .
+'\x{7C90}\x{7C92}\x{7C95}\x{7C97}\x{7C98}\x{7C9B}\x{7C9F}\x{7CA1}\x{7CA2}' .
+'\x{7CA4}\x{7CA5}\x{7CA7}\x{7CA8}\x{7CAB}\x{7CAD}\x{7CAE}\x{7CB1}\x{7CB2}' .
+'\x{7CB3}\x{7CB9}\x{7CBD}\x{7CBE}\x{7CC0}\x{7CC2}\x{7CC5}\x{7CCA}\x{7CCE}' .
+'\x{7CD2}\x{7CD6}\x{7CD8}\x{7CDC}\x{7CDE}\x{7CDF}\x{7CE0}\x{7CE2}\x{7CE7}' .
+'\x{7CEF}\x{7CF2}\x{7CF4}\x{7CF6}\x{7CF8}\x{7CFA}\x{7CFB}\x{7CFE}\x{7D00}' .
+'\x{7D02}\x{7D04}\x{7D05}\x{7D06}\x{7D0A}\x{7D0B}\x{7D0D}\x{7D10}\x{7D14}' .
+'\x{7D15}\x{7D17}\x{7D18}\x{7D19}\x{7D1A}\x{7D1B}\x{7D1C}\x{7D20}\x{7D21}' .
+'\x{7D22}\x{7D2B}\x{7D2C}\x{7D2E}\x{7D2F}\x{7D30}\x{7D32}\x{7D33}\x{7D35}' .
+'\x{7D39}\x{7D3A}\x{7D3F}\x{7D42}\x{7D43}\x{7D44}\x{7D45}\x{7D46}\x{7D4B}' .
+'\x{7D4C}\x{7D4E}\x{7D4F}\x{7D50}\x{7D56}\x{7D5B}\x{7D5E}\x{7D61}\x{7D62}' .
+'\x{7D63}\x{7D66}\x{7D68}\x{7D6E}\x{7D71}\x{7D72}\x{7D73}\x{7D75}\x{7D76}' .
+'\x{7D79}\x{7D7D}\x{7D89}\x{7D8F}\x{7D93}\x{7D99}\x{7D9A}\x{7D9B}\x{7D9C}' .
+'\x{7D9F}\x{7DA2}\x{7DA3}\x{7DAB}\x{7DAC}\x{7DAD}\x{7DAE}\x{7DAF}\x{7DB0}' .
+'\x{7DB1}\x{7DB2}\x{7DB4}\x{7DB5}\x{7DB8}\x{7DBA}\x{7DBB}\x{7DBD}\x{7DBE}' .
+'\x{7DBF}\x{7DC7}\x{7DCA}\x{7DCB}\x{7DCF}\x{7DD1}\x{7DD2}\x{7DD5}\x{7DD8}' .
+'\x{7DDA}\x{7DDC}\x{7DDD}\x{7DDE}\x{7DE0}\x{7DE1}\x{7DE4}\x{7DE8}\x{7DE9}' .
+'\x{7DEC}\x{7DEF}\x{7DF2}\x{7DF4}\x{7DFB}\x{7E01}\x{7E04}\x{7E05}\x{7E09}' .
+'\x{7E0A}\x{7E0B}\x{7E12}\x{7E1B}\x{7E1E}\x{7E1F}\x{7E21}\x{7E22}\x{7E23}' .
+'\x{7E26}\x{7E2B}\x{7E2E}\x{7E31}\x{7E32}\x{7E35}\x{7E37}\x{7E39}\x{7E3A}' .
+'\x{7E3B}\x{7E3D}\x{7E3E}\x{7E41}\x{7E43}\x{7E46}\x{7E4A}\x{7E4B}\x{7E4D}' .
+'\x{7E54}\x{7E55}\x{7E56}\x{7E59}\x{7E5A}\x{7E5D}\x{7E5E}\x{7E66}\x{7E67}' .
+'\x{7E69}\x{7E6A}\x{7E6D}\x{7E70}\x{7E79}\x{7E7B}\x{7E7C}\x{7E7D}\x{7E7F}' .
+'\x{7E82}\x{7E83}\x{7E88}\x{7E89}\x{7E8C}\x{7E8E}\x{7E8F}\x{7E90}\x{7E92}' .
+'\x{7E93}\x{7E94}\x{7E96}\x{7E9B}\x{7E9C}\x{7F36}\x{7F38}\x{7F3A}\x{7F45}' .
+'\x{7F4C}\x{7F4D}\x{7F4E}\x{7F50}\x{7F51}\x{7F54}\x{7F55}\x{7F58}\x{7F5F}' .
+'\x{7F60}\x{7F67}\x{7F68}\x{7F69}\x{7F6A}\x{7F6B}\x{7F6E}\x{7F70}\x{7F72}' .
+'\x{7F75}\x{7F77}\x{7F78}\x{7F79}\x{7F82}\x{7F83}\x{7F85}\x{7F86}\x{7F87}' .
+'\x{7F88}\x{7F8A}\x{7F8C}\x{7F8E}\x{7F94}\x{7F9A}\x{7F9D}\x{7F9E}\x{7FA3}' .
+'\x{7FA4}\x{7FA8}\x{7FA9}\x{7FAE}\x{7FAF}\x{7FB2}\x{7FB6}\x{7FB8}\x{7FB9}' .
+'\x{7FBD}\x{7FC1}\x{7FC5}\x{7FC6}\x{7FCA}\x{7FCC}\x{7FD2}\x{7FD4}\x{7FD5}' .
+'\x{7FE0}\x{7FE1}\x{7FE6}\x{7FE9}\x{7FEB}\x{7FF0}\x{7FF3}\x{7FF9}\x{7FFB}' .
+'\x{7FFC}\x{8000}\x{8001}\x{8003}\x{8004}\x{8005}\x{8006}\x{800B}\x{800C}' .
+'\x{8010}\x{8012}\x{8015}\x{8017}\x{8018}\x{8019}\x{801C}\x{8021}\x{8028}' .
+'\x{8033}\x{8036}\x{803B}\x{803D}\x{803F}\x{8046}\x{804A}\x{8052}\x{8056}' .
+'\x{8058}\x{805A}\x{805E}\x{805F}\x{8061}\x{8062}\x{8068}\x{806F}\x{8070}' .
+'\x{8072}\x{8073}\x{8074}\x{8076}\x{8077}\x{8079}\x{807D}\x{807E}\x{807F}' .
+'\x{8084}\x{8085}\x{8086}\x{8087}\x{8089}\x{808B}\x{808C}\x{8093}\x{8096}' .
+'\x{8098}\x{809A}\x{809B}\x{809D}\x{80A1}\x{80A2}\x{80A5}\x{80A9}\x{80AA}' .
+'\x{80AC}\x{80AD}\x{80AF}\x{80B1}\x{80B2}\x{80B4}\x{80BA}\x{80C3}\x{80C4}' .
+'\x{80C6}\x{80CC}\x{80CE}\x{80D6}\x{80D9}\x{80DA}\x{80DB}\x{80DD}\x{80DE}' .
+'\x{80E1}\x{80E4}\x{80E5}\x{80EF}\x{80F1}\x{80F4}\x{80F8}\x{80FC}\x{80FD}' .
+'\x{8102}\x{8105}\x{8106}\x{8107}\x{8108}\x{8109}\x{810A}\x{811A}\x{811B}' .
+'\x{8123}\x{8129}\x{812F}\x{8131}\x{8133}\x{8139}\x{813E}\x{8146}\x{814B}' .
+'\x{814E}\x{8150}\x{8151}\x{8153}\x{8154}\x{8155}\x{815F}\x{8165}\x{8166}' .
+'\x{816B}\x{816E}\x{8170}\x{8171}\x{8174}\x{8178}\x{8179}\x{817A}\x{817F}' .
+'\x{8180}\x{8182}\x{8183}\x{8188}\x{818A}\x{818F}\x{8193}\x{8195}\x{819A}' .
+'\x{819C}\x{819D}\x{81A0}\x{81A3}\x{81A4}\x{81A8}\x{81A9}\x{81B0}\x{81B3}' .
+'\x{81B5}\x{81B8}\x{81BA}\x{81BD}\x{81BE}\x{81BF}\x{81C0}\x{81C2}\x{81C6}' .
+'\x{81C8}\x{81C9}\x{81CD}\x{81D1}\x{81D3}\x{81D8}\x{81D9}\x{81DA}\x{81DF}' .
+'\x{81E0}\x{81E3}\x{81E5}\x{81E7}\x{81E8}\x{81EA}\x{81ED}\x{81F3}\x{81F4}' .
+'\x{81FA}\x{81FB}\x{81FC}\x{81FE}\x{8201}\x{8202}\x{8205}\x{8207}\x{8208}' .
+'\x{8209}\x{820A}\x{820C}\x{820D}\x{820E}\x{8210}\x{8212}\x{8216}\x{8217}' .
+'\x{8218}\x{821B}\x{821C}\x{821E}\x{821F}\x{8229}\x{822A}\x{822B}\x{822C}' .
+'\x{822E}\x{8233}\x{8235}\x{8236}\x{8237}\x{8238}\x{8239}\x{8240}\x{8247}' .
+'\x{8258}\x{8259}\x{825A}\x{825D}\x{825F}\x{8262}\x{8264}\x{8266}\x{8268}' .
+'\x{826A}\x{826B}\x{826E}\x{826F}\x{8271}\x{8272}\x{8276}\x{8277}\x{8278}' .
+'\x{827E}\x{828B}\x{828D}\x{8292}\x{8299}\x{829D}\x{829F}\x{82A5}\x{82A6}' .
+'\x{82AB}\x{82AC}\x{82AD}\x{82AF}\x{82B1}\x{82B3}\x{82B8}\x{82B9}\x{82BB}' .
+'\x{82BD}\x{82C5}\x{82D1}\x{82D2}\x{82D3}\x{82D4}\x{82D7}\x{82D9}\x{82DB}' .
+'\x{82DC}\x{82DE}\x{82DF}\x{82E1}\x{82E3}\x{82E5}\x{82E6}\x{82E7}\x{82EB}' .
+'\x{82F1}\x{82F3}\x{82F4}\x{82F9}\x{82FA}\x{82FB}\x{8302}\x{8303}\x{8304}' .
+'\x{8305}\x{8306}\x{8309}\x{830E}\x{8316}\x{8317}\x{8318}\x{831C}\x{8323}' .
+'\x{8328}\x{832B}\x{832F}\x{8331}\x{8332}\x{8334}\x{8335}\x{8336}\x{8338}' .
+'\x{8339}\x{8340}\x{8345}\x{8349}\x{834A}\x{834F}\x{8350}\x{8352}\x{8358}' .
+'\x{8373}\x{8375}\x{8377}\x{837B}\x{837C}\x{8385}\x{8387}\x{8389}\x{838A}' .
+'\x{838E}\x{8393}\x{8396}\x{839A}\x{839E}\x{839F}\x{83A0}\x{83A2}\x{83A8}' .
+'\x{83AA}\x{83AB}\x{83B1}\x{83B5}\x{83BD}\x{83C1}\x{83C5}\x{83CA}\x{83CC}' .
+'\x{83CE}\x{83D3}\x{83D6}\x{83D8}\x{83DC}\x{83DF}\x{83E0}\x{83E9}\x{83EB}' .
+'\x{83EF}\x{83F0}\x{83F1}\x{83F2}\x{83F4}\x{83F7}\x{83FB}\x{83FD}\x{8403}' .
+'\x{8404}\x{8407}\x{840B}\x{840C}\x{840D}\x{840E}\x{8413}\x{8420}\x{8422}' .
+'\x{8429}\x{842A}\x{842C}\x{8431}\x{8435}\x{8438}\x{843C}\x{843D}\x{8446}' .
+'\x{8449}\x{844E}\x{8457}\x{845B}\x{8461}\x{8462}\x{8463}\x{8466}\x{8469}' .
+'\x{846B}\x{846C}\x{846D}\x{846E}\x{846F}\x{8471}\x{8475}\x{8477}\x{8479}' .
+'\x{847A}\x{8482}\x{8484}\x{848B}\x{8490}\x{8494}\x{8499}\x{849C}\x{849F}' .
+'\x{84A1}\x{84AD}\x{84B2}\x{84B8}\x{84B9}\x{84BB}\x{84BC}\x{84BF}\x{84C1}' .
+'\x{84C4}\x{84C6}\x{84C9}\x{84CA}\x{84CB}\x{84CD}\x{84D0}\x{84D1}\x{84D6}' .
+'\x{84D9}\x{84DA}\x{84EC}\x{84EE}\x{84F4}\x{84FC}\x{84FF}\x{8500}\x{8506}' .
+'\x{8511}\x{8513}\x{8514}\x{8515}\x{8517}\x{8518}\x{851A}\x{851F}\x{8521}' .
+'\x{8526}\x{852C}\x{852D}\x{8535}\x{853D}\x{8540}\x{8541}\x{8543}\x{8548}' .
+'\x{8549}\x{854A}\x{854B}\x{854E}\x{8555}\x{8557}\x{8558}\x{855A}\x{8563}' .
+'\x{8568}\x{8569}\x{856A}\x{856D}\x{8577}\x{857E}\x{8580}\x{8584}\x{8587}' .
+'\x{8588}\x{858A}\x{8590}\x{8591}\x{8594}\x{8597}\x{8599}\x{859B}\x{859C}' .
+'\x{85A4}\x{85A6}\x{85A8}\x{85A9}\x{85AA}\x{85AB}\x{85AC}\x{85AE}\x{85AF}' .
+'\x{85B9}\x{85BA}\x{85C1}\x{85C9}\x{85CD}\x{85CF}\x{85D0}\x{85D5}\x{85DC}' .
+'\x{85DD}\x{85E4}\x{85E5}\x{85E9}\x{85EA}\x{85F7}\x{85F9}\x{85FA}\x{85FB}' .
+'\x{85FE}\x{8602}\x{8606}\x{8607}\x{860A}\x{860B}\x{8613}\x{8616}\x{8617}' .
+'\x{861A}\x{8622}\x{862D}\x{862F}\x{8630}\x{863F}\x{864D}\x{864E}\x{8650}' .
+'\x{8654}\x{8655}\x{865A}\x{865C}\x{865E}\x{865F}\x{8667}\x{866B}\x{8671}' .
+'\x{8679}\x{867B}\x{868A}\x{868B}\x{868C}\x{8693}\x{8695}\x{86A3}\x{86A4}' .
+'\x{86A9}\x{86AA}\x{86AB}\x{86AF}\x{86B0}\x{86B6}\x{86C4}\x{86C6}\x{86C7}' .
+'\x{86C9}\x{86CB}\x{86CD}\x{86CE}\x{86D4}\x{86D9}\x{86DB}\x{86DE}\x{86DF}' .
+'\x{86E4}\x{86E9}\x{86EC}\x{86ED}\x{86EE}\x{86EF}\x{86F8}\x{86F9}\x{86FB}' .
+'\x{86FE}\x{8700}\x{8702}\x{8703}\x{8706}\x{8708}\x{8709}\x{870A}\x{870D}' .
+'\x{8711}\x{8712}\x{8718}\x{871A}\x{871C}\x{8725}\x{8729}\x{8734}\x{8737}' .
+'\x{873B}\x{873F}\x{8749}\x{874B}\x{874C}\x{874E}\x{8753}\x{8755}\x{8757}' .
+'\x{8759}\x{875F}\x{8760}\x{8763}\x{8766}\x{8768}\x{876A}\x{876E}\x{8774}' .
+'\x{8776}\x{8778}\x{877F}\x{8782}\x{878D}\x{879F}\x{87A2}\x{87AB}\x{87AF}' .
+'\x{87B3}\x{87BA}\x{87BB}\x{87BD}\x{87C0}\x{87C4}\x{87C6}\x{87C7}\x{87CB}' .
+'\x{87D0}\x{87D2}\x{87E0}\x{87EF}\x{87F2}\x{87F6}\x{87F7}\x{87F9}\x{87FB}' .
+'\x{87FE}\x{8805}\x{880D}\x{880E}\x{880F}\x{8811}\x{8815}\x{8816}\x{8821}' .
+'\x{8822}\x{8823}\x{8827}\x{8831}\x{8836}\x{8839}\x{883B}\x{8840}\x{8842}' .
+'\x{8844}\x{8846}\x{884C}\x{884D}\x{8852}\x{8853}\x{8857}\x{8859}\x{885B}' .
+'\x{885D}\x{885E}\x{8861}\x{8862}\x{8863}\x{8868}\x{886B}\x{8870}\x{8872}' .
+'\x{8875}\x{8877}\x{887D}\x{887E}\x{887F}\x{8881}\x{8882}\x{8888}\x{888B}' .
+'\x{888D}\x{8892}\x{8896}\x{8897}\x{8899}\x{889E}\x{88A2}\x{88A4}\x{88AB}' .
+'\x{88AE}\x{88B0}\x{88B1}\x{88B4}\x{88B5}\x{88B7}\x{88BF}\x{88C1}\x{88C2}' .
+'\x{88C3}\x{88C4}\x{88C5}\x{88CF}\x{88D4}\x{88D5}\x{88D8}\x{88D9}\x{88DC}' .
+'\x{88DD}\x{88DF}\x{88E1}\x{88E8}\x{88F2}\x{88F3}\x{88F4}\x{88F8}\x{88F9}' .
+'\x{88FC}\x{88FD}\x{88FE}\x{8902}\x{8904}\x{8907}\x{890A}\x{890C}\x{8910}' .
+'\x{8912}\x{8913}\x{891D}\x{891E}\x{8925}\x{892A}\x{892B}\x{8936}\x{8938}' .
+'\x{893B}\x{8941}\x{8943}\x{8944}\x{894C}\x{894D}\x{8956}\x{895E}\x{895F}' .
+'\x{8960}\x{8964}\x{8966}\x{896A}\x{896D}\x{896F}\x{8972}\x{8974}\x{8977}' .
+'\x{897E}\x{897F}\x{8981}\x{8983}\x{8986}\x{8987}\x{8988}\x{898A}\x{898B}' .
+'\x{898F}\x{8993}\x{8996}\x{8997}\x{8998}\x{899A}\x{89A1}\x{89A6}\x{89A7}' .
+'\x{89A9}\x{89AA}\x{89AC}\x{89AF}\x{89B2}\x{89B3}\x{89BA}\x{89BD}\x{89BF}' .
+'\x{89C0}\x{89D2}\x{89DA}\x{89DC}\x{89DD}\x{89E3}\x{89E6}\x{89E7}\x{89F4}' .
+'\x{89F8}\x{8A00}\x{8A02}\x{8A03}\x{8A08}\x{8A0A}\x{8A0C}\x{8A0E}\x{8A10}' .
+'\x{8A13}\x{8A16}\x{8A17}\x{8A18}\x{8A1B}\x{8A1D}\x{8A1F}\x{8A23}\x{8A25}' .
+'\x{8A2A}\x{8A2D}\x{8A31}\x{8A33}\x{8A34}\x{8A36}\x{8A3A}\x{8A3B}\x{8A3C}' .
+'\x{8A41}\x{8A46}\x{8A48}\x{8A50}\x{8A51}\x{8A52}\x{8A54}\x{8A55}\x{8A5B}' .
+'\x{8A5E}\x{8A60}\x{8A62}\x{8A63}\x{8A66}\x{8A69}\x{8A6B}\x{8A6C}\x{8A6D}' .
+'\x{8A6E}\x{8A70}\x{8A71}\x{8A72}\x{8A73}\x{8A7C}\x{8A82}\x{8A84}\x{8A85}' .
+'\x{8A87}\x{8A89}\x{8A8C}\x{8A8D}\x{8A91}\x{8A93}\x{8A95}\x{8A98}\x{8A9A}' .
+'\x{8A9E}\x{8AA0}\x{8AA1}\x{8AA3}\x{8AA4}\x{8AA5}\x{8AA6}\x{8AA8}\x{8AAC}' .
+'\x{8AAD}\x{8AB0}\x{8AB2}\x{8AB9}\x{8ABC}\x{8ABF}\x{8AC2}\x{8AC4}\x{8AC7}' .
+'\x{8ACB}\x{8ACC}\x{8ACD}\x{8ACF}\x{8AD2}\x{8AD6}\x{8ADA}\x{8ADB}\x{8ADC}' .
+'\x{8ADE}\x{8AE0}\x{8AE1}\x{8AE2}\x{8AE4}\x{8AE6}\x{8AE7}\x{8AEB}\x{8AED}' .
+'\x{8AEE}\x{8AF1}\x{8AF3}\x{8AF7}\x{8AF8}\x{8AFA}\x{8AFE}\x{8B00}\x{8B01}' .
+'\x{8B02}\x{8B04}\x{8B07}\x{8B0C}\x{8B0E}\x{8B10}\x{8B14}\x{8B16}\x{8B17}' .
+'\x{8B19}\x{8B1A}\x{8B1B}\x{8B1D}\x{8B20}\x{8B21}\x{8B26}\x{8B28}\x{8B2B}' .
+'\x{8B2C}\x{8B33}\x{8B39}\x{8B3E}\x{8B41}\x{8B49}\x{8B4C}\x{8B4E}\x{8B4F}' .
+'\x{8B56}\x{8B58}\x{8B5A}\x{8B5B}\x{8B5C}\x{8B5F}\x{8B66}\x{8B6B}\x{8B6C}' .
+'\x{8B6F}\x{8B70}\x{8B71}\x{8B72}\x{8B74}\x{8B77}\x{8B7D}\x{8B80}\x{8B83}' .
+'\x{8B8A}\x{8B8C}\x{8B8E}\x{8B90}\x{8B92}\x{8B93}\x{8B96}\x{8B99}\x{8B9A}' .
+'\x{8C37}\x{8C3A}\x{8C3F}\x{8C41}\x{8C46}\x{8C48}\x{8C4A}\x{8C4C}\x{8C4E}' .
+'\x{8C50}\x{8C55}\x{8C5A}\x{8C61}\x{8C62}\x{8C6A}\x{8C6B}\x{8C6C}\x{8C78}' .
+'\x{8C79}\x{8C7A}\x{8C7C}\x{8C82}\x{8C85}\x{8C89}\x{8C8A}\x{8C8C}\x{8C8D}' .
+'\x{8C8E}\x{8C94}\x{8C98}\x{8C9D}\x{8C9E}\x{8CA0}\x{8CA1}\x{8CA2}\x{8CA7}' .
+'\x{8CA8}\x{8CA9}\x{8CAA}\x{8CAB}\x{8CAC}\x{8CAD}\x{8CAE}\x{8CAF}\x{8CB0}' .
+'\x{8CB2}\x{8CB3}\x{8CB4}\x{8CB6}\x{8CB7}\x{8CB8}\x{8CBB}\x{8CBC}\x{8CBD}' .
+'\x{8CBF}\x{8CC0}\x{8CC1}\x{8CC2}\x{8CC3}\x{8CC4}\x{8CC7}\x{8CC8}\x{8CCA}' .
+'\x{8CCD}\x{8CCE}\x{8CD1}\x{8CD3}\x{8CDA}\x{8CDB}\x{8CDC}\x{8CDE}\x{8CE0}' .
+'\x{8CE2}\x{8CE3}\x{8CE4}\x{8CE6}\x{8CEA}\x{8CED}\x{8CFA}\x{8CFB}\x{8CFC}' .
+'\x{8CFD}\x{8D04}\x{8D05}\x{8D07}\x{8D08}\x{8D0A}\x{8D0B}\x{8D0D}\x{8D0F}' .
+'\x{8D10}\x{8D13}\x{8D14}\x{8D16}\x{8D64}\x{8D66}\x{8D67}\x{8D6B}\x{8D6D}' .
+'\x{8D70}\x{8D71}\x{8D73}\x{8D74}\x{8D77}\x{8D81}\x{8D85}\x{8D8A}\x{8D99}' .
+'\x{8DA3}\x{8DA8}\x{8DB3}\x{8DBA}\x{8DBE}\x{8DC2}\x{8DCB}\x{8DCC}\x{8DCF}' .
+'\x{8DD6}\x{8DDA}\x{8DDB}\x{8DDD}\x{8DDF}\x{8DE1}\x{8DE3}\x{8DE8}\x{8DEA}' .
+'\x{8DEB}\x{8DEF}\x{8DF3}\x{8DF5}\x{8DFC}\x{8DFF}\x{8E08}\x{8E09}\x{8E0A}' .
+'\x{8E0F}\x{8E10}\x{8E1D}\x{8E1E}\x{8E1F}\x{8E2A}\x{8E30}\x{8E34}\x{8E35}' .
+'\x{8E42}\x{8E44}\x{8E47}\x{8E48}\x{8E49}\x{8E4A}\x{8E4C}\x{8E50}\x{8E55}' .
+'\x{8E59}\x{8E5F}\x{8E60}\x{8E63}\x{8E64}\x{8E72}\x{8E74}\x{8E76}\x{8E7C}' .
+'\x{8E81}\x{8E84}\x{8E85}\x{8E87}\x{8E8A}\x{8E8B}\x{8E8D}\x{8E91}\x{8E93}' .
+'\x{8E94}\x{8E99}\x{8EA1}\x{8EAA}\x{8EAB}\x{8EAC}\x{8EAF}\x{8EB0}\x{8EB1}' .
+'\x{8EBE}\x{8EC5}\x{8EC6}\x{8EC8}\x{8ECA}\x{8ECB}\x{8ECC}\x{8ECD}\x{8ED2}' .
+'\x{8EDB}\x{8EDF}\x{8EE2}\x{8EE3}\x{8EEB}\x{8EF8}\x{8EFB}\x{8EFC}\x{8EFD}' .
+'\x{8EFE}\x{8F03}\x{8F05}\x{8F09}\x{8F0A}\x{8F0C}\x{8F12}\x{8F13}\x{8F14}' .
+'\x{8F15}\x{8F19}\x{8F1B}\x{8F1C}\x{8F1D}\x{8F1F}\x{8F26}\x{8F29}\x{8F2A}' .
+'\x{8F2F}\x{8F33}\x{8F38}\x{8F39}\x{8F3B}\x{8F3E}\x{8F3F}\x{8F42}\x{8F44}' .
+'\x{8F45}\x{8F46}\x{8F49}\x{8F4C}\x{8F4D}\x{8F4E}\x{8F57}\x{8F5C}\x{8F5F}' .
+'\x{8F61}\x{8F62}\x{8F63}\x{8F64}\x{8F9B}\x{8F9C}\x{8F9E}\x{8F9F}\x{8FA3}' .
+'\x{8FA7}\x{8FA8}\x{8FAD}\x{8FAE}\x{8FAF}\x{8FB0}\x{8FB1}\x{8FB2}\x{8FB7}' .
+'\x{8FBA}\x{8FBB}\x{8FBC}\x{8FBF}\x{8FC2}\x{8FC4}\x{8FC5}\x{8FCE}\x{8FD1}' .
+'\x{8FD4}\x{8FDA}\x{8FE2}\x{8FE5}\x{8FE6}\x{8FE9}\x{8FEA}\x{8FEB}\x{8FED}' .
+'\x{8FEF}\x{8FF0}\x{8FF4}\x{8FF7}\x{8FF8}\x{8FF9}\x{8FFA}\x{8FFD}\x{9000}' .
+'\x{9001}\x{9003}\x{9005}\x{9006}\x{900B}\x{900D}\x{900E}\x{900F}\x{9010}' .
+'\x{9011}\x{9013}\x{9014}\x{9015}\x{9016}\x{9017}\x{9019}\x{901A}\x{901D}' .
+'\x{901E}\x{901F}\x{9020}\x{9021}\x{9022}\x{9023}\x{9027}\x{902E}\x{9031}' .
+'\x{9032}\x{9035}\x{9036}\x{9038}\x{9039}\x{903C}\x{903E}\x{9041}\x{9042}' .
+'\x{9045}\x{9047}\x{9049}\x{904A}\x{904B}\x{904D}\x{904E}\x{904F}\x{9050}' .
+'\x{9051}\x{9052}\x{9053}\x{9054}\x{9055}\x{9056}\x{9058}\x{9059}\x{905C}' .
+'\x{905E}\x{9060}\x{9061}\x{9063}\x{9065}\x{9068}\x{9069}\x{906D}\x{906E}' .
+'\x{906F}\x{9072}\x{9075}\x{9076}\x{9077}\x{9078}\x{907A}\x{907C}\x{907D}' .
+'\x{907F}\x{9080}\x{9081}\x{9082}\x{9083}\x{9084}\x{9087}\x{9089}\x{908A}' .
+'\x{908F}\x{9091}\x{90A3}\x{90A6}\x{90A8}\x{90AA}\x{90AF}\x{90B1}\x{90B5}' .
+'\x{90B8}\x{90C1}\x{90CA}\x{90CE}\x{90DB}\x{90E1}\x{90E2}\x{90E4}\x{90E8}' .
+'\x{90ED}\x{90F5}\x{90F7}\x{90FD}\x{9102}\x{9112}\x{9119}\x{912D}\x{9130}' .
+'\x{9132}\x{9149}\x{914A}\x{914B}\x{914C}\x{914D}\x{914E}\x{9152}\x{9154}' .
+'\x{9156}\x{9158}\x{9162}\x{9163}\x{9165}\x{9169}\x{916A}\x{916C}\x{9172}' .
+'\x{9173}\x{9175}\x{9177}\x{9178}\x{9182}\x{9187}\x{9189}\x{918B}\x{918D}' .
+'\x{9190}\x{9192}\x{9197}\x{919C}\x{91A2}\x{91A4}\x{91AA}\x{91AB}\x{91AF}' .
+'\x{91B4}\x{91B5}\x{91B8}\x{91BA}\x{91C0}\x{91C1}\x{91C6}\x{91C7}\x{91C8}' .
+'\x{91C9}\x{91CB}\x{91CC}\x{91CD}\x{91CE}\x{91CF}\x{91D0}\x{91D1}\x{91D6}' .
+'\x{91D8}\x{91DB}\x{91DC}\x{91DD}\x{91DF}\x{91E1}\x{91E3}\x{91E6}\x{91E7}' .
+'\x{91F5}\x{91F6}\x{91FC}\x{91FF}\x{920D}\x{920E}\x{9211}\x{9214}\x{9215}' .
+'\x{921E}\x{9229}\x{922C}\x{9234}\x{9237}\x{923F}\x{9244}\x{9245}\x{9248}' .
+'\x{9249}\x{924B}\x{9250}\x{9257}\x{925A}\x{925B}\x{925E}\x{9262}\x{9264}' .
+'\x{9266}\x{9271}\x{927E}\x{9280}\x{9283}\x{9285}\x{9291}\x{9293}\x{9295}' .
+'\x{9296}\x{9298}\x{929A}\x{929B}\x{929C}\x{92AD}\x{92B7}\x{92B9}\x{92CF}' .
+'\x{92D2}\x{92E4}\x{92E9}\x{92EA}\x{92ED}\x{92F2}\x{92F3}\x{92F8}\x{92FA}' .
+'\x{92FC}\x{9306}\x{930F}\x{9310}\x{9318}\x{9319}\x{931A}\x{9320}\x{9322}' .
+'\x{9323}\x{9326}\x{9328}\x{932B}\x{932C}\x{932E}\x{932F}\x{9332}\x{9335}' .
+'\x{933A}\x{933B}\x{9344}\x{934B}\x{934D}\x{9354}\x{9356}\x{935B}\x{935C}' .
+'\x{9360}\x{936C}\x{936E}\x{9375}\x{937C}\x{937E}\x{938C}\x{9394}\x{9396}' .
+'\x{9397}\x{939A}\x{93A7}\x{93AC}\x{93AD}\x{93AE}\x{93B0}\x{93B9}\x{93C3}' .
+'\x{93C8}\x{93D0}\x{93D1}\x{93D6}\x{93D7}\x{93D8}\x{93DD}\x{93E1}\x{93E4}' .
+'\x{93E5}\x{93E8}\x{9403}\x{9407}\x{9410}\x{9413}\x{9414}\x{9418}\x{9419}' .
+'\x{941A}\x{9421}\x{942B}\x{9435}\x{9436}\x{9438}\x{943A}\x{9441}\x{9444}' .
+'\x{9451}\x{9452}\x{9453}\x{945A}\x{945B}\x{945E}\x{9460}\x{9462}\x{946A}' .
+'\x{9470}\x{9475}\x{9477}\x{947C}\x{947D}\x{947E}\x{947F}\x{9481}\x{9577}' .
+'\x{9580}\x{9582}\x{9583}\x{9587}\x{9589}\x{958A}\x{958B}\x{958F}\x{9591}' .
+'\x{9593}\x{9594}\x{9596}\x{9598}\x{9599}\x{95A0}\x{95A2}\x{95A3}\x{95A4}' .
+'\x{95A5}\x{95A7}\x{95A8}\x{95AD}\x{95B2}\x{95B9}\x{95BB}\x{95BC}\x{95BE}' .
+'\x{95C3}\x{95C7}\x{95CA}\x{95CC}\x{95CD}\x{95D4}\x{95D5}\x{95D6}\x{95D8}' .
+'\x{95DC}\x{95E1}\x{95E2}\x{95E5}\x{961C}\x{9621}\x{9628}\x{962A}\x{962E}' .
+'\x{962F}\x{9632}\x{963B}\x{963F}\x{9640}\x{9642}\x{9644}\x{964B}\x{964C}' .
+'\x{964D}\x{964F}\x{9650}\x{965B}\x{965C}\x{965D}\x{965E}\x{965F}\x{9662}' .
+'\x{9663}\x{9664}\x{9665}\x{9666}\x{966A}\x{966C}\x{9670}\x{9672}\x{9673}' .
+'\x{9675}\x{9676}\x{9677}\x{9678}\x{967A}\x{967D}\x{9685}\x{9686}\x{9688}' .
+'\x{968A}\x{968B}\x{968D}\x{968E}\x{968F}\x{9694}\x{9695}\x{9697}\x{9698}' .
+'\x{9699}\x{969B}\x{969C}\x{96A0}\x{96A3}\x{96A7}\x{96A8}\x{96AA}\x{96B0}' .
+'\x{96B1}\x{96B2}\x{96B4}\x{96B6}\x{96B7}\x{96B8}\x{96B9}\x{96BB}\x{96BC}' .
+'\x{96C0}\x{96C1}\x{96C4}\x{96C5}\x{96C6}\x{96C7}\x{96C9}\x{96CB}\x{96CC}' .
+'\x{96CD}\x{96CE}\x{96D1}\x{96D5}\x{96D6}\x{96D9}\x{96DB}\x{96DC}\x{96E2}' .
+'\x{96E3}\x{96E8}\x{96EA}\x{96EB}\x{96F0}\x{96F2}\x{96F6}\x{96F7}\x{96F9}' .
+'\x{96FB}\x{9700}\x{9704}\x{9706}\x{9707}\x{9708}\x{970A}\x{970D}\x{970E}' .
+'\x{970F}\x{9711}\x{9713}\x{9716}\x{9719}\x{971C}\x{971E}\x{9724}\x{9727}' .
+'\x{972A}\x{9730}\x{9732}\x{9738}\x{9739}\x{973D}\x{973E}\x{9742}\x{9744}' .
+'\x{9746}\x{9748}\x{9749}\x{9752}\x{9756}\x{9759}\x{975C}\x{975E}\x{9760}' .
+'\x{9761}\x{9762}\x{9764}\x{9766}\x{9768}\x{9769}\x{976B}\x{976D}\x{9771}' .
+'\x{9774}\x{9779}\x{977A}\x{977C}\x{9781}\x{9784}\x{9785}\x{9786}\x{978B}' .
+'\x{978D}\x{978F}\x{9790}\x{9798}\x{979C}\x{97A0}\x{97A3}\x{97A6}\x{97A8}' .
+'\x{97AB}\x{97AD}\x{97B3}\x{97B4}\x{97C3}\x{97C6}\x{97C8}\x{97CB}\x{97D3}' .
+'\x{97DC}\x{97ED}\x{97EE}\x{97F2}\x{97F3}\x{97F5}\x{97F6}\x{97FB}\x{97FF}' .
+'\x{9801}\x{9802}\x{9803}\x{9805}\x{9806}\x{9808}\x{980C}\x{980F}\x{9810}' .
+'\x{9811}\x{9812}\x{9813}\x{9817}\x{9818}\x{981A}\x{9821}\x{9824}\x{982C}' .
+'\x{982D}\x{9834}\x{9837}\x{9838}\x{983B}\x{983C}\x{983D}\x{9846}\x{984B}' .
+'\x{984C}\x{984D}\x{984E}\x{984F}\x{9854}\x{9855}\x{9858}\x{985B}\x{985E}' .
+'\x{9867}\x{986B}\x{986F}\x{9870}\x{9871}\x{9873}\x{9874}\x{98A8}\x{98AA}' .
+'\x{98AF}\x{98B1}\x{98B6}\x{98C3}\x{98C4}\x{98C6}\x{98DB}\x{98DC}\x{98DF}' .
+'\x{98E2}\x{98E9}\x{98EB}\x{98ED}\x{98EE}\x{98EF}\x{98F2}\x{98F4}\x{98FC}' .
+'\x{98FD}\x{98FE}\x{9903}\x{9905}\x{9909}\x{990A}\x{990C}\x{9910}\x{9912}' .
+'\x{9913}\x{9914}\x{9918}\x{991D}\x{991E}\x{9920}\x{9921}\x{9924}\x{9928}' .
+'\x{992C}\x{992E}\x{993D}\x{993E}\x{9942}\x{9945}\x{9949}\x{994B}\x{994C}' .
+'\x{9950}\x{9951}\x{9952}\x{9955}\x{9957}\x{9996}\x{9997}\x{9998}\x{9999}' .
+'\x{99A5}\x{99A8}\x{99AC}\x{99AD}\x{99AE}\x{99B3}\x{99B4}\x{99BC}\x{99C1}' .
+'\x{99C4}\x{99C5}\x{99C6}\x{99C8}\x{99D0}\x{99D1}\x{99D2}\x{99D5}\x{99D8}' .
+'\x{99DB}\x{99DD}\x{99DF}\x{99E2}\x{99ED}\x{99EE}\x{99F1}\x{99F2}\x{99F8}' .
+'\x{99FB}\x{99FF}\x{9A01}\x{9A05}\x{9A0E}\x{9A0F}\x{9A12}\x{9A13}\x{9A19}' .
+'\x{9A28}\x{9A2B}\x{9A30}\x{9A37}\x{9A3E}\x{9A40}\x{9A42}\x{9A43}\x{9A45}' .
+'\x{9A4D}\x{9A55}\x{9A57}\x{9A5A}\x{9A5B}\x{9A5F}\x{9A62}\x{9A64}\x{9A65}' .
+'\x{9A69}\x{9A6A}\x{9A6B}\x{9AA8}\x{9AAD}\x{9AB0}\x{9AB8}\x{9ABC}\x{9AC0}' .
+'\x{9AC4}\x{9ACF}\x{9AD1}\x{9AD3}\x{9AD4}\x{9AD8}\x{9ADE}\x{9ADF}\x{9AE2}' .
+'\x{9AE3}\x{9AE6}\x{9AEA}\x{9AEB}\x{9AED}\x{9AEE}\x{9AEF}\x{9AF1}\x{9AF4}' .
+'\x{9AF7}\x{9AFB}\x{9B06}\x{9B18}\x{9B1A}\x{9B1F}\x{9B22}\x{9B23}\x{9B25}' .
+'\x{9B27}\x{9B28}\x{9B29}\x{9B2A}\x{9B2E}\x{9B2F}\x{9B31}\x{9B32}\x{9B3B}' .
+'\x{9B3C}\x{9B41}\x{9B42}\x{9B43}\x{9B44}\x{9B45}\x{9B4D}\x{9B4E}\x{9B4F}' .
+'\x{9B51}\x{9B54}\x{9B58}\x{9B5A}\x{9B6F}\x{9B74}\x{9B83}\x{9B8E}\x{9B91}' .
+'\x{9B92}\x{9B93}\x{9B96}\x{9B97}\x{9B9F}\x{9BA0}\x{9BA8}\x{9BAA}\x{9BAB}' .
+'\x{9BAD}\x{9BAE}\x{9BB4}\x{9BB9}\x{9BC0}\x{9BC6}\x{9BC9}\x{9BCA}\x{9BCF}' .
+'\x{9BD1}\x{9BD2}\x{9BD4}\x{9BD6}\x{9BDB}\x{9BE1}\x{9BE2}\x{9BE3}\x{9BE4}' .
+'\x{9BE8}\x{9BF0}\x{9BF1}\x{9BF2}\x{9BF5}\x{9C04}\x{9C06}\x{9C08}\x{9C09}' .
+'\x{9C0A}\x{9C0C}\x{9C0D}\x{9C10}\x{9C12}\x{9C13}\x{9C14}\x{9C15}\x{9C1B}' .
+'\x{9C21}\x{9C24}\x{9C25}\x{9C2D}\x{9C2E}\x{9C2F}\x{9C30}\x{9C32}\x{9C39}' .
+'\x{9C3A}\x{9C3B}\x{9C3E}\x{9C46}\x{9C47}\x{9C48}\x{9C52}\x{9C57}\x{9C5A}' .
+'\x{9C60}\x{9C67}\x{9C76}\x{9C78}\x{9CE5}\x{9CE7}\x{9CE9}\x{9CEB}\x{9CEC}' .
+'\x{9CF0}\x{9CF3}\x{9CF4}\x{9CF6}\x{9D03}\x{9D06}\x{9D07}\x{9D08}\x{9D09}' .
+'\x{9D0E}\x{9D12}\x{9D15}\x{9D1B}\x{9D1F}\x{9D23}\x{9D26}\x{9D28}\x{9D2A}' .
+'\x{9D2B}\x{9D2C}\x{9D3B}\x{9D3E}\x{9D3F}\x{9D41}\x{9D44}\x{9D46}\x{9D48}' .
+'\x{9D50}\x{9D51}\x{9D59}\x{9D5C}\x{9D5D}\x{9D5E}\x{9D60}\x{9D61}\x{9D64}' .
+'\x{9D6C}\x{9D6F}\x{9D72}\x{9D7A}\x{9D87}\x{9D89}\x{9D8F}\x{9D9A}\x{9DA4}' .
+'\x{9DA9}\x{9DAB}\x{9DAF}\x{9DB2}\x{9DB4}\x{9DB8}\x{9DBA}\x{9DBB}\x{9DC1}' .
+'\x{9DC2}\x{9DC4}\x{9DC6}\x{9DCF}\x{9DD3}\x{9DD9}\x{9DE6}\x{9DED}\x{9DEF}' .
+'\x{9DF2}\x{9DF8}\x{9DF9}\x{9DFA}\x{9DFD}\x{9E1A}\x{9E1B}\x{9E1E}\x{9E75}' .
+'\x{9E78}\x{9E79}\x{9E7D}\x{9E7F}\x{9E81}\x{9E88}\x{9E8B}\x{9E8C}\x{9E91}' .
+'\x{9E92}\x{9E93}\x{9E95}\x{9E97}\x{9E9D}\x{9E9F}\x{9EA5}\x{9EA6}\x{9EA9}' .
+'\x{9EAA}\x{9EAD}\x{9EB8}\x{9EB9}\x{9EBA}\x{9EBB}\x{9EBC}\x{9EBE}\x{9EBF}' .
+'\x{9EC4}\x{9ECC}\x{9ECD}\x{9ECE}\x{9ECF}\x{9ED0}\x{9ED2}\x{9ED4}\x{9ED8}' .
+'\x{9ED9}\x{9EDB}\x{9EDC}\x{9EDD}\x{9EDE}\x{9EE0}\x{9EE5}\x{9EE8}\x{9EEF}' .
+'\x{9EF4}\x{9EF6}\x{9EF7}\x{9EF9}\x{9EFB}\x{9EFC}\x{9EFD}\x{9F07}\x{9F08}' .
+'\x{9F0E}\x{9F13}\x{9F15}\x{9F20}\x{9F21}\x{9F2C}\x{9F3B}\x{9F3E}\x{9F4A}' .
+'\x{9F4B}\x{9F4E}\x{9F4F}\x{9F52}\x{9F54}\x{9F5F}\x{9F60}\x{9F61}\x{9F62}' .
+'\x{9F63}\x{9F66}\x{9F67}\x{9F6A}\x{9F6C}\x{9F72}\x{9F76}\x{9F77}\x{9F8D}' .
+'\x{9F95}\x{9F9C}\x{9F9D}\x{9FA0}]{1,15}$/iu');
diff --git a/library/vendor/Zend/Validate/Iban.php b/library/vendor/Zend/Validate/Iban.php
new file mode 100644
index 0000000..f01005b
--- /dev/null
+++ b/library/vendor/Zend/Validate/Iban.php
@@ -0,0 +1,246 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * Validates IBAN Numbers (International Bank Account Numbers)
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Iban extends Zend_Validate_Abstract
+{
+ const NOTSUPPORTED = 'ibanNotSupported';
+ const FALSEFORMAT = 'ibanFalseFormat';
+ const CHECKFAILED = 'ibanCheckFailed';
+
+ /**
+ * Validation failure message template definitions
+ *
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::NOTSUPPORTED => "Unknown country within the IBAN '%value%'",
+ self::FALSEFORMAT => "'%value%' has a false IBAN format",
+ self::CHECKFAILED => "'%value%' has failed the IBAN check",
+ );
+
+ /**
+ * Optional locale
+ *
+ * @var string|Zend_Locale|null
+ */
+ protected $_locale;
+
+ /**
+ * IBAN regexes by region
+ *
+ * @var array
+ */
+ protected $_ibanregex = array(
+ 'AD' => '/^AD[0-9]{2}[0-9]{8}[A-Z0-9]{12}$/',
+ 'AE' => '/^AE[0-9]{2}[0-9]{3}[0-9]{16}$/',
+ 'AL' => '/^AL[0-9]{2}[0-9]{8}[A-Z0-9]{16}$/',
+ 'AT' => '/^AT[0-9]{2}[0-9]{5}[0-9]{11}$/',
+ 'AZ' => '/^AZ[0-9]{2}[0-9]{4}[A-Z0-9]{20}$/',
+ 'BA' => '/^BA[0-9]{2}[0-9]{6}[0-9]{10}$/',
+ 'BE' => '/^BE[0-9]{2}[0-9]{3}[0-9]{9}$/',
+ 'BG' => '/^BG[0-9]{2}[A-Z]{4}[0-9]{4}[0-9]{2}[A-Z0-9]{8}$/',
+ 'BH' => '/^BH[0-9]{2}[A-Z]{4}[A-Z0-9]{14}$/',
+ 'BR' => '/^BR[0-9]{2}[0-9]{8}[0-9]{5}[0-9]{10}[A-Z]{1}[A-Z0-9]{1}$/',
+ 'CH' => '/^CH[0-9]{2}[0-9]{5}[A-Z0-9]{12}$/',
+ 'CR' => '/^CR[0-9]{2}[0-9]{3}[0-9]{14}$/',
+ 'CS' => '/^CS[0-9]{2}[0-9]{3}[0-9]{15}$/',
+ 'CY' => '/^CY[0-9]{2}[0-9]{8}[A-Z0-9]{16}$/',
+ 'CZ' => '/^CZ[0-9]{2}[0-9]{4}[0-9]{16}$/',
+ 'DE' => '/^DE[0-9]{2}[0-9]{8}[0-9]{10}$/',
+ 'DK' => '/^DK[0-9]{2}[0-9]{4}[0-9]{10}$/',
+ 'DO' => '/^DO[0-9]{2}[A-Z0-9]{4}[0-9]{20}$/',
+ 'EE' => '/^EE[0-9]{2}[0-9]{4}[0-9]{12}$/',
+ 'ES' => '/^ES[0-9]{2}[0-9]{8}[0-9]{12}$/',
+ 'FR' => '/^FR[0-9]{2}[0-9]{10}[A-Z0-9]{11}[0-9]{2}$/',
+ 'FI' => '/^FI[0-9]{2}[0-9]{6}[0-9]{8}$/',
+ 'FO' => '/^FO[0-9]{2}[0-9]{4}[0-9]{9}[0-9]{1}$/',
+ 'GB' => '/^GB[0-9]{2}[A-Z]{4}[0-9]{14}$/',
+ 'GE' => '/^GE[0-9]{2}[A-Z]{2}[0-9]{16}$/',
+ 'GI' => '/^GI[0-9]{2}[A-Z]{4}[A-Z0-9]{15}$/',
+ 'GL' => '/^GL[0-9]{2}[0-9]{4}[0-9]{9}[0-9]{1}$/',
+ 'GR' => '/^GR[0-9]{2}[0-9]{7}[A-Z0-9]{16}$/',
+ 'GT' => '/^GT[0-9]{2}[A-Z0-9]{4}[A-Z0-9]{20}$/',
+ 'HR' => '/^HR[0-9]{2}[0-9]{7}[0-9]{10}$/',
+ 'HU' => '/^HU[0-9]{2}[0-9]{7}[0-9]{1}[0-9]{15}[0-9]{1}$/',
+ 'IE' => '/^IE[0-9]{2}[A-Z0-9]{4}[0-9]{6}[0-9]{8}$/',
+ 'IL' => '/^IL[0-9]{2}[0-9]{3}[0-9]{3}[0-9]{13}$/',
+ 'IS' => '/^IS[0-9]{2}[0-9]{4}[0-9]{18}$/',
+ 'IT' => '/^IT[0-9]{2}[A-Z]{1}[0-9]{10}[A-Z0-9]{12}$/',
+ 'KW' => '/^KW[0-9]{2}[A-Z]{4}[0-9]{3}[0-9]{22}$/',
+ 'KZ' => '/^KZ[A-Z]{2}[0-9]{2}[0-9]{3}[A-Z0-9]{13}$/',
+ 'LB' => '/^LB[0-9]{2}[0-9]{4}[A-Z0-9]{20}$/',
+ 'LI' => '/^LI[0-9]{2}[0-9]{5}[A-Z0-9]{12}$/',
+ 'LU' => '/^LU[0-9]{2}[0-9]{3}[A-Z0-9]{13}$/',
+ 'LT' => '/^LT[0-9]{2}[0-9]{5}[0-9]{11}$/',
+ 'LV' => '/^LV[0-9]{2}[A-Z]{4}[A-Z0-9]{13}$/',
+ 'MC' => '/^MC[0-9]{2}[0-9]{5}[0-9]{5}[A-Z0-9]{11}[0-9]{2}$/',
+ 'MD' => '/^MD[0-9]{2}[A-Z0-9]{20}$/',
+ 'ME' => '/^ME[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}$/',
+ 'MK' => '/^MK[0-9]{2}[0-9]{3}[A-Z0-9]{10}[0-9]{2}$/',
+ 'MR' => '/^MR13[0-9]{5}[0-9]{5}[0-9]{11}[0-9]{2}$/',
+ 'MU' => '/^MU[0-9]{2}[A-Z]{4}[0-9]{2}[0-9]{2}[0-9]{12}[0-9]{3}[A-Z]{2}$/',
+ 'MT' => '/^MT[0-9]{2}[A-Z]{4}[0-9]{5}[A-Z0-9]{18}$/',
+ 'NL' => '/^NL[0-9]{2}[A-Z]{4}[0-9]{10}$/',
+ 'NO' => '/^NO[0-9]{2}[0-9]{4}[0-9]{7}$/',
+ 'PK' => '/^PK[0-9]{2}[A-Z]{4}[0-9]{16}$/',
+ 'PL' => '/^PL[0-9]{2}[0-9]{8}[0-9]{16}$/',
+ 'PS' => '/^PS[0-9]{2}[A-Z]{4}[0-9]{21}$/',
+ 'PT' => '/^PT[0-9]{2}[0-9]{8}[0-9]{13}$/',
+ 'RO' => '/^RO[0-9]{2}[A-Z]{4}[A-Z0-9]{16}$/',
+ 'RS' => '/^RS[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}$/',
+ 'SA' => '/^SA[0-9]{2}[0-9]{2}[A-Z0-9]{18}$/',
+ 'SE' => '/^SE[0-9]{2}[0-9]{3}[0-9]{17}$/',
+ 'SI' => '/^SI[0-9]{2}[0-9]{5}[0-9]{8}[0-9]{2}$/',
+ 'SK' => '/^SK[0-9]{2}[0-9]{4}[0-9]{16}$/',
+ 'SM' => '/^SM[0-9]{2}[A-Z]{1}[0-9]{5}[0-9]{5}[A-Z0-9]{12}$/',
+ 'TN' => '/^TN[0-9]{2}[0-9]{5}[0-9]{15}$/',
+ 'TR' => '/^TR[0-9]{2}[0-9]{5}[A-Z0-9]{17}$/',
+ 'VG' => '/^VG[0-9]{2}[A-Z]{4}[0-9]{16}$/'
+ );
+
+ /**
+ * Sets validator options
+ *
+ * @param string|Zend_Config|Zend_Locale $locale OPTIONAL
+ */
+ public function __construct($locale = null)
+ {
+ if ($locale instanceof Zend_Config) {
+ $locale = $locale->toArray();
+ }
+
+ if (is_array($locale)) {
+ if (array_key_exists('locale', $locale)) {
+ $locale = $locale['locale'];
+ } else {
+ $locale = null;
+ }
+ }
+
+ if (empty($locale)) {
+ if (Zend_Registry::isRegistered('Zend_Locale')) {
+ $locale = Zend_Registry::get('Zend_Locale');
+ }
+ }
+
+ if ($locale !== null) {
+ $this->setLocale($locale);
+ }
+ }
+
+ /**
+ * Returns the locale option
+ *
+ * @return string|Zend_Locale|null
+ */
+ public function getLocale()
+ {
+ return $this->_locale;
+ }
+
+ /**
+ * Sets the locale option
+ *
+ * @param string|Zend_Locale $locale
+ * @throws Zend_Locale_Exception
+ * @throws Zend_Validate_Exception
+ * @return Zend_Validate_Date provides a fluent interface
+ */
+ public function setLocale($locale = null)
+ {
+ if ($locale !== false) {
+ $locale = Zend_Locale::findLocale($locale);
+ if (strlen($locale) < 4) {
+ throw new Zend_Validate_Exception('Region must be given for IBAN validation');
+ }
+ }
+
+ $this->_locale = $locale;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if $value is a valid IBAN
+ *
+ * @param string $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ $value = strtoupper($value);
+ $this->_setValue($value);
+
+ if (empty($this->_locale)) {
+ $region = substr($value, 0, 2);
+ } else {
+ $region = new Zend_Locale($this->_locale);
+ $region = $region->getRegion();
+ }
+
+ if (!array_key_exists($region, $this->_ibanregex)) {
+ $this->_setValue($region);
+ $this->_error(self::NOTSUPPORTED);
+ return false;
+ }
+
+ if (!preg_match($this->_ibanregex[$region], $value)) {
+ $this->_error(self::FALSEFORMAT);
+ return false;
+ }
+
+ $format = substr($value, 4) . substr($value, 0, 4);
+ $format = str_replace(
+ array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
+ 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'),
+ array('10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22',
+ '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35'),
+ $format);
+
+ $temp = intval(substr($format, 0, 1));
+ $len = strlen($format);
+ for ($x = 1; $x < $len; ++$x) {
+ $temp *= 10;
+ $temp += intval(substr($format, $x, 1));
+ $temp %= 97;
+ }
+
+ if ($temp != 1) {
+ $this->_error(self::CHECKFAILED);
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Identical.php b/library/vendor/Zend/Validate/Identical.php
new file mode 100644
index 0000000..6afa0eb
--- /dev/null
+++ b/library/vendor/Zend/Validate/Identical.php
@@ -0,0 +1,163 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** @see Zend_Validate_Abstract */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Identical extends Zend_Validate_Abstract
+{
+ /**
+ * Error codes
+ * @const string
+ */
+ const NOT_SAME = 'notSame';
+ const MISSING_TOKEN = 'missingToken';
+
+ /**
+ * Error messages
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::NOT_SAME => "The two given tokens do not match",
+ self::MISSING_TOKEN => 'No token was provided to match against',
+ );
+
+ /**
+ * @var array
+ */
+ protected $_messageVariables = array(
+ 'token' => '_tokenString'
+ );
+
+ /**
+ * Original token against which to validate
+ * @var string
+ */
+ protected $_tokenString;
+ protected $_token;
+ protected $_strict = true;
+
+ /**
+ * Sets validator options
+ *
+ * @param mixed $token
+ */
+ public function __construct($token = null)
+ {
+ if ($token instanceof Zend_Config) {
+ $token = $token->toArray();
+ }
+
+ if (is_array($token) && array_key_exists('token', $token)) {
+ if (array_key_exists('strict', $token)) {
+ $this->setStrict($token['strict']);
+ }
+
+ $this->setToken($token['token']);
+ } else if (null !== $token) {
+ $this->setToken($token);
+ }
+ }
+
+ /**
+ * Retrieve token
+ *
+ * @return string
+ */
+ public function getToken()
+ {
+ return $this->_token;
+ }
+
+ /**
+ * Set token against which to compare
+ *
+ * @param mixed $token
+ * @return Zend_Validate_Identical
+ */
+ public function setToken($token)
+ {
+ $this->_tokenString = $token;
+ $this->_token = $token;
+ return $this;
+ }
+
+ /**
+ * Returns the strict parameter
+ *
+ * @return boolean
+ */
+ public function getStrict()
+ {
+ return $this->_strict;
+ }
+
+ /**
+ * Sets the strict parameter
+ *
+ * @param Zend_Validate_Identical
+ * @return $this
+ */
+ public function setStrict($strict)
+ {
+ $this->_strict = (boolean) $strict;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if a token has been set and the provided value
+ * matches that token.
+ *
+ * @param mixed $value
+ * @param array $context
+ * @return boolean
+ */
+ public function isValid($value, $context = null)
+ {
+ $this->_setValue($value);
+
+ if (($context !== null) && isset($context) && array_key_exists($this->getToken(), $context)) {
+ $token = $context[$this->getToken()];
+ } else {
+ $token = $this->getToken();
+ }
+
+ if ($token === null) {
+ $this->_error(self::MISSING_TOKEN);
+ return false;
+ }
+
+ $strict = $this->getStrict();
+ if (($strict && ($value !== $token)) || (!$strict && ($value != $token))) {
+ $this->_error(self::NOT_SAME);
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/InArray.php b/library/vendor/Zend/Validate/InArray.php
new file mode 100644
index 0000000..9a9a353
--- /dev/null
+++ b/library/vendor/Zend/Validate/InArray.php
@@ -0,0 +1,202 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_InArray extends Zend_Validate_Abstract
+{
+ const NOT_IN_ARRAY = 'notInArray';
+
+ /**
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::NOT_IN_ARRAY => "'%value%' was not found in the haystack",
+ );
+
+ /**
+ * Haystack of possible values
+ *
+ * @var array
+ */
+ protected $_haystack;
+
+ /**
+ * Whether a strict in_array() invocation is used
+ *
+ * @var boolean
+ */
+ protected $_strict = false;
+
+ /**
+ * Whether a recursive search should be done
+ *
+ * @var boolean
+ */
+ protected $_recursive = false;
+
+ /**
+ * Sets validator options
+ *
+ * @param array|Zend_Config $options Validator options
+ * @throws Zend_Validate_Exception
+ */
+ public function __construct($options)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (!is_array($options)) {
+ throw new Zend_Validate_Exception('Array expected as parameter');
+ } else {
+ $count = func_num_args();
+ $temp = array();
+ if ($count > 1) {
+ $temp['haystack'] = func_get_arg(0);
+ $temp['strict'] = func_get_arg(1);
+ $options = $temp;
+ } else {
+ $temp = func_get_arg(0);
+ if (!array_key_exists('haystack', $options)) {
+ $options = array();
+ $options['haystack'] = $temp;
+ } else {
+ $options = $temp;
+ }
+ }
+ }
+
+ $this->setHaystack($options['haystack']);
+ if (array_key_exists('strict', $options)) {
+ $this->setStrict($options['strict']);
+ }
+
+ if (array_key_exists('recursive', $options)) {
+ $this->setRecursive($options['recursive']);
+ }
+ }
+
+ /**
+ * Returns the haystack option
+ *
+ * @return mixed
+ */
+ public function getHaystack()
+ {
+ return $this->_haystack;
+ }
+
+ /**
+ * Sets the haystack option
+ *
+ * @param mixed $haystack
+ * @return Zend_Validate_InArray Provides a fluent interface
+ */
+ public function setHaystack(array $haystack)
+ {
+ $this->_haystack = $haystack;
+ return $this;
+ }
+
+ /**
+ * Returns the strict option
+ *
+ * @return boolean
+ */
+ public function getStrict()
+ {
+ return $this->_strict;
+ }
+
+ /**
+ * Sets the strict option
+ *
+ * @param boolean $strict
+ * @return Zend_Validate_InArray Provides a fluent interface
+ */
+ public function setStrict($strict)
+ {
+ $this->_strict = (boolean) $strict;
+ return $this;
+ }
+
+ /**
+ * Returns the recursive option
+ *
+ * @return boolean
+ */
+ public function getRecursive()
+ {
+ return $this->_recursive;
+ }
+
+ /**
+ * Sets the recursive option
+ *
+ * @param boolean $recursive
+ * @return Zend_Validate_InArray Provides a fluent interface
+ */
+ public function setRecursive($recursive)
+ {
+ $this->_recursive = (boolean) $recursive;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if $value is contained in the haystack option. If the strict
+ * option is true, then the type of $value is also checked.
+ *
+ * @param mixed $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ $this->_setValue($value);
+ if ($this->getRecursive()) {
+ $iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($this->_haystack));
+ foreach($iterator as $element) {
+ if ($this->_strict) {
+ if ($element === $value) {
+ return true;
+ }
+ } else if ($element == $value) {
+ return true;
+ }
+ }
+ } else {
+ if (in_array($value, $this->_haystack, $this->_strict)) {
+ return true;
+ }
+ }
+
+ $this->_error(self::NOT_IN_ARRAY);
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Int.php b/library/vendor/Zend/Validate/Int.php
new file mode 100644
index 0000000..75ec6cd
--- /dev/null
+++ b/library/vendor/Zend/Validate/Int.php
@@ -0,0 +1,145 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @see Zend_Locale_Format
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Int extends Zend_Validate_Abstract
+{
+ const INVALID = 'intInvalid';
+ const NOT_INT = 'notInt';
+
+ /**
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::INVALID => "Invalid type given. String or integer expected",
+ self::NOT_INT => "'%value%' does not appear to be an integer",
+ );
+
+ protected $_locale;
+
+ /**
+ * Constructor for the integer validator
+ *
+ * @param string|Zend_Config|Zend_Locale $locale
+ */
+ public function __construct($locale = null)
+ {
+ if ($locale instanceof Zend_Config) {
+ $locale = $locale->toArray();
+ }
+
+ if (is_array($locale)) {
+ if (array_key_exists('locale', $locale)) {
+ $locale = $locale['locale'];
+ } else {
+ $locale = null;
+ }
+ }
+
+ if (empty($locale)) {
+ if (Zend_Registry::isRegistered('Zend_Locale')) {
+ $locale = Zend_Registry::get('Zend_Locale');
+ }
+ }
+
+ if ($locale !== null) {
+ $this->setLocale($locale);
+ }
+ }
+
+ /**
+ * Returns the set locale
+ */
+ public function getLocale()
+ {
+ return $this->_locale;
+ }
+
+ /**
+ * Sets the locale to use
+ *
+ * @param string|Zend_Locale $locale
+ * @return $this
+ */
+ public function setLocale($locale = null)
+ {
+ $this->_locale = Zend_Locale::findLocale($locale);
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if $value is a valid integer
+ *
+ * @param string|integer $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ if (!is_string($value) && !is_int($value) && !is_float($value)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ if (is_int($value)) {
+ return true;
+ }
+
+ $this->_setValue($value);
+ if ($this->_locale === null) {
+ $locale = localeconv();
+ $valueFiltered = str_replace($locale['decimal_point'], '.', $value);
+ $valueFiltered = str_replace($locale['thousands_sep'], '', $valueFiltered);
+
+ if (strval(intval($valueFiltered)) != $valueFiltered) {
+ $this->_error(self::NOT_INT);
+ return false;
+ }
+
+ } else {
+ try {
+ if (!Zend_Locale_Format::isInteger($value, array('locale' => $this->_locale))) {
+ $this->_error(self::NOT_INT);
+ return false;
+ }
+ } catch (Zend_Locale_Exception $e) {
+ $this->_error(self::NOT_INT);
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Interface.php b/library/vendor/Zend/Validate/Interface.php
new file mode 100644
index 0000000..f1d0883
--- /dev/null
+++ b/library/vendor/Zend/Validate/Interface.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_Validate_Interface
+{
+ /**
+ * Returns true if and only if $value meets the validation requirements
+ *
+ * If $value fails validation, then this method returns false, and
+ * getMessages() will return an array of messages that explain why the
+ * validation failed.
+ *
+ * @param mixed $value
+ * @return boolean
+ * @throws Zend_Validate_Exception If validation of $value is impossible
+ */
+ public function isValid($value);
+
+ /**
+ * Returns an array of messages that explain why the most recent isValid()
+ * call returned false. The array keys are validation failure message identifiers,
+ * and the array values are the corresponding human-readable message strings.
+ *
+ * If isValid() was never called or if the most recent isValid() call
+ * returned true, then this method returns an empty array.
+ *
+ * @return array
+ */
+ public function getMessages();
+}
diff --git a/library/vendor/Zend/Validate/Ip.php b/library/vendor/Zend/Validate/Ip.php
new file mode 100644
index 0000000..1195ec7
--- /dev/null
+++ b/library/vendor/Zend/Validate/Ip.php
@@ -0,0 +1,190 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Ip extends Zend_Validate_Abstract
+{
+ const INVALID = 'ipInvalid';
+ const NOT_IP_ADDRESS = 'notIpAddress';
+
+ /**
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::INVALID => "Invalid type given. String expected",
+ self::NOT_IP_ADDRESS => "'%value%' does not appear to be a valid IP address",
+ );
+
+ /**
+ * internal options
+ *
+ * @var array
+ */
+ protected $_options = array(
+ 'allowipv6' => true,
+ 'allowipv4' => true
+ );
+
+ /**
+ * Sets validator options
+ *
+ * @param array $options OPTIONAL Options to set, see the manual for all available options
+ */
+ public function __construct($options = array())
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (!is_array($options)) {
+ $options = func_get_args();
+ $temp['allowipv6'] = array_shift($options);
+ if (!empty($options)) {
+ $temp['allowipv4'] = array_shift($options);
+ }
+
+ $options = $temp;
+ }
+
+ $options += $this->_options;
+ $this->setOptions($options);
+ }
+
+ /**
+ * Returns all set options
+ *
+ * @return array
+ */
+ public function getOptions()
+ {
+ return $this->_options;
+ }
+
+ /**
+ * Sets the options for this validator
+ *
+ * @param array $options
+ * @throws Zend_Validate_Exception
+ * @return Zend_Validate_Ip
+ */
+ public function setOptions($options)
+ {
+ if (array_key_exists('allowipv6', $options)) {
+ $this->_options['allowipv6'] = (boolean) $options['allowipv6'];
+ }
+
+ if (array_key_exists('allowipv4', $options)) {
+ $this->_options['allowipv4'] = (boolean) $options['allowipv4'];
+ }
+
+ if (!$this->_options['allowipv4'] && !$this->_options['allowipv6']) {
+ throw new Zend_Validate_Exception('Nothing to validate. Check your options');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if $value is a valid IP address
+ *
+ * @param mixed $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ if (!is_string($value)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ $this->_setValue($value);
+ if (($this->_options['allowipv4'] && !$this->_options['allowipv6'] && !$this->_validateIPv4($value)) ||
+ (!$this->_options['allowipv4'] && $this->_options['allowipv6'] && !$this->_validateIPv6($value)) ||
+ ($this->_options['allowipv4'] && $this->_options['allowipv6'] && !$this->_validateIPv4($value) && !$this->_validateIPv6($value))) {
+ $this->_error(self::NOT_IP_ADDRESS);
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Validates an IPv4 address
+ *
+ * @param string $value
+ * @return bool
+ */
+ protected function _validateIPv4($value) {
+ $ip2long = ip2long($value);
+ if($ip2long === false) {
+ return false;
+ }
+
+ return $value == long2ip($ip2long);
+ }
+
+ /**
+ * Validates an IPv6 address
+ *
+ * @param string $value Value to check against
+ * @return boolean True when $value is a valid ipv6 address
+ * False otherwise
+ */
+ protected function _validateIPv6($value) {
+ if (strlen($value) < 3) {
+ return $value == '::';
+ }
+
+ if (strpos($value, '.')) {
+ $lastcolon = strrpos($value, ':');
+ if (!($lastcolon && $this->_validateIPv4(substr($value, $lastcolon + 1)))) {
+ return false;
+ }
+
+ $value = substr($value, 0, $lastcolon) . ':0:0';
+ }
+
+ if (strpos($value, '::') === false) {
+ return preg_match('/\A(?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4}\z/i', $value);
+ }
+
+ $colonCount = substr_count($value, ':');
+ if ($colonCount < 8) {
+ return preg_match('/\A(?::|(?:[a-f0-9]{1,4}:)+):(?:(?:[a-f0-9]{1,4}:)*[a-f0-9]{1,4})?\z/i', $value);
+ }
+
+ // special case with ending or starting double colon
+ if ($colonCount == 8) {
+ return preg_match('/\A(?:::)?(?:[a-f0-9]{1,4}:){6}[a-f0-9]{1,4}(?:::)?\z/i', $value);
+ }
+
+ return false;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Isbn.php b/library/vendor/Zend/Validate/Isbn.php
new file mode 100644
index 0000000..e917afc
--- /dev/null
+++ b/library/vendor/Zend/Validate/Isbn.php
@@ -0,0 +1,274 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Isbn extends Zend_Validate_Abstract
+{
+ const AUTO = 'auto';
+ const ISBN10 = '10';
+ const ISBN13 = '13';
+ const INVALID = 'isbnInvalid';
+ const NO_ISBN = 'isbnNoIsbn';
+
+ /**
+ * Validation failure message template definitions.
+ *
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::INVALID => "Invalid type given. String or integer expected",
+ self::NO_ISBN => "'%value%' is not a valid ISBN number",
+ );
+
+ /**
+ * Allowed type.
+ *
+ * @var string
+ */
+ protected $_type = self::AUTO;
+
+ /**
+ * Separator character.
+ *
+ * @var string
+ */
+ protected $_separator = '';
+
+ /**
+ * Set up options.
+ *
+ * @param Zend_Config|array $options
+ * @throws Zend_Validate_Exception When $options is not valid
+ */
+ public function __construct($options = array())
+ {
+ // prepare options
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ }
+ if (!is_array($options)) {
+ /**
+ * @see Zend_Validate_Exception
+ */
+ throw new Zend_Validate_Exception('Invalid options provided.');
+ }
+
+ // set type
+ if (array_key_exists('type', $options)) {
+ $this->setType($options['type']);
+ }
+
+ // set separator
+ if (array_key_exists('separator', $options)) {
+ $this->setSeparator($options['separator']);
+ }
+ }
+
+ /**
+ * Detect input format.
+ *
+ * @return string
+ */
+ protected function _detectFormat()
+ {
+ // prepare separator and pattern list
+ $sep = quotemeta($this->_separator);
+ $patterns = array();
+ $lengths = array();
+
+ // check for ISBN-10
+ if ($this->_type == self::ISBN10 || $this->_type == self::AUTO) {
+ if (empty($sep)) {
+ $pattern = '/^[0-9]{9}[0-9X]{1}$/';
+ $length = 10;
+ } else {
+ $pattern = "/^[0-9]{1,7}[{$sep}]{1}[0-9]{1,7}[{$sep}]{1}[0-9]{1,7}[{$sep}]{1}[0-9X]{1}$/";
+ $length = 13;
+ }
+
+ $patterns[$pattern] = self::ISBN10;
+ $lengths[$pattern] = $length;
+ }
+
+ // check for ISBN-13
+ if ($this->_type == self::ISBN13 || $this->_type == self::AUTO) {
+ if (empty($sep)) {
+ $pattern = '/^[0-9]{13}$/';
+ $length = 13;
+ } else {
+ $pattern = "/^[0-9]{1,9}[{$sep}]{1}[0-9]{1,5}[{$sep}]{1}[0-9]{1,9}[{$sep}]{1}[0-9]{1,9}[{$sep}]{1}[0-9]{1}$/";
+ $length = 17;
+ }
+
+ $patterns[$pattern] = self::ISBN13;
+ $lengths[$pattern] = $length;
+ }
+
+ // check pattern list
+ foreach ($patterns as $pattern => $type) {
+ if ((strlen($this->_value) == $lengths[$pattern]) && preg_match($pattern, $this->_value)) {
+ return $type;
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface.
+ *
+ * Returns true if and only if $value is a valid ISBN.
+ *
+ * @param string $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ if (!is_string($value) && !is_int($value)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ $value = (string) $value;
+ $this->_setValue($value);
+
+ switch ($this->_detectFormat()) {
+ case self::ISBN10:
+ // sum
+ $isbn10 = str_replace($this->_separator, '', $value);
+ $sum = 0;
+ for ($i = 0; $i < 9; $i++) {
+ $sum += (10 - $i) * $isbn10[$i];
+ }
+
+ // checksum
+ $checksum = 11 - ($sum % 11);
+ if ($checksum == 11) {
+ $checksum = '0';
+ } elseif ($checksum == 10) {
+ $checksum = 'X';
+ }
+ break;
+
+ case self::ISBN13:
+ // sum
+ $isbn13 = str_replace($this->_separator, '', $value);
+ $sum = 0;
+ for ($i = 0; $i < 12; $i++) {
+ if ($i % 2 == 0) {
+ $sum += $isbn13[$i];
+ } else {
+ $sum += 3 * $isbn13[$i];
+ }
+ }
+ // checksum
+ $checksum = 10 - ($sum % 10);
+ if ($checksum == 10) {
+ $checksum = '0';
+ }
+ break;
+
+ default:
+ $this->_error(self::NO_ISBN);
+ return false;
+ }
+
+ // validate
+ if (substr($this->_value, -1) != $checksum) {
+ $this->_error(self::NO_ISBN);
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * Set separator characters.
+ *
+ * It is allowed only empty string, hyphen and space.
+ *
+ * @param string $separator
+ * @throws Zend_Validate_Exception When $separator is not valid
+ * @return Zend_Validate_Isbn Provides a fluent interface
+ */
+ public function setSeparator($separator)
+ {
+ // check separator
+ if (!in_array($separator, array('-', ' ', ''))) {
+ /**
+ * @see Zend_Validate_Exception
+ */
+ throw new Zend_Validate_Exception('Invalid ISBN separator.');
+ }
+
+ $this->_separator = $separator;
+ return $this;
+ }
+
+ /**
+ * Get separator characters.
+ *
+ * @return string
+ */
+ public function getSeparator()
+ {
+ return $this->_separator;
+ }
+
+ /**
+ * Set allowed ISBN type.
+ *
+ * @param string $type
+ * @throws Zend_Validate_Exception When $type is not valid
+ * @return Zend_Validate_Isbn Provides a fluent interface
+ */
+ public function setType($type)
+ {
+ // check type
+ if (!in_array($type, array(self::AUTO, self::ISBN10, self::ISBN13))) {
+ /**
+ * @see Zend_Validate_Exception
+ */
+ throw new Zend_Validate_Exception('Invalid ISBN type');
+ }
+
+ $this->_type = $type;
+ return $this;
+ }
+
+ /**
+ * Get allowed ISBN type.
+ *
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->_type;
+ }
+}
diff --git a/library/vendor/Zend/Validate/LessThan.php b/library/vendor/Zend/Validate/LessThan.php
new file mode 100644
index 0000000..6c1244b
--- /dev/null
+++ b/library/vendor/Zend/Validate/LessThan.php
@@ -0,0 +1,120 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_LessThan extends Zend_Validate_Abstract
+{
+ const NOT_LESS = 'notLessThan';
+
+ /**
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::NOT_LESS => "'%value%' is not less than '%max%'"
+ );
+
+ /**
+ * @var array
+ */
+ protected $_messageVariables = array(
+ 'max' => '_max'
+ );
+
+ /**
+ * Maximum value
+ *
+ * @var mixed
+ */
+ protected $_max;
+
+ /**
+ * Sets validator options
+ *
+ * @param mixed|Zend_Config $max
+ * @throws Zend_Validate_Exception
+ */
+ public function __construct($max)
+ {
+ if ($max instanceof Zend_Config) {
+ $max = $max->toArray();
+ }
+
+ if (is_array($max)) {
+ if (array_key_exists('max', $max)) {
+ $max = $max['max'];
+ } else {
+ throw new Zend_Validate_Exception("Missing option 'max'");
+ }
+ }
+
+ $this->setMax($max);
+ }
+
+ /**
+ * Returns the max option
+ *
+ * @return mixed
+ */
+ public function getMax()
+ {
+ return $this->_max;
+ }
+
+ /**
+ * Sets the max option
+ *
+ * @param mixed $max
+ * @return Zend_Validate_LessThan Provides a fluent interface
+ */
+ public function setMax($max)
+ {
+ $this->_max = $max;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if $value is less than max option
+ *
+ * @param mixed $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ $this->_setValue($value);
+ if ($this->_max <= $value) {
+ $this->_error(self::NOT_LESS);
+ return false;
+ }
+ return true;
+ }
+
+}
diff --git a/library/vendor/Zend/Validate/NotEmpty.php b/library/vendor/Zend/Validate/NotEmpty.php
new file mode 100644
index 0000000..7b70e68
--- /dev/null
+++ b/library/vendor/Zend/Validate/NotEmpty.php
@@ -0,0 +1,277 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_NotEmpty extends Zend_Validate_Abstract
+{
+ const BOOLEAN = 1;
+ const INTEGER = 2;
+ const FLOAT = 4;
+ const STRING = 8;
+ const ZERO = 16;
+ const EMPTY_ARRAY = 32;
+ const NULL = 64;
+ const PHP = 127;
+ const SPACE = 128;
+ const OBJECT = 256;
+ const OBJECT_STRING = 512;
+ const OBJECT_COUNT = 1024;
+ const ALL = 2047;
+
+ const INVALID = 'notEmptyInvalid';
+ const IS_EMPTY = 'isEmpty';
+
+ protected $_constants = array(
+ self::BOOLEAN => 'boolean',
+ self::INTEGER => 'integer',
+ self::FLOAT => 'float',
+ self::STRING => 'string',
+ self::ZERO => 'zero',
+ self::EMPTY_ARRAY => 'array',
+ self::NULL => 'null',
+ self::PHP => 'php',
+ self::SPACE => 'space',
+ self::OBJECT => 'object',
+ self::OBJECT_STRING => 'objectstring',
+ self::OBJECT_COUNT => 'objectcount',
+ self::ALL => 'all',
+ );
+
+ /**
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::IS_EMPTY => "Value is required and can't be empty",
+ self::INVALID => "Invalid type given. String, integer, float, boolean or array expected",
+ );
+
+ /**
+ * Internal type to detect
+ *
+ * @var integer
+ */
+ protected $_type = 493;
+
+ /**
+ * Constructor
+ *
+ * @param string|array|Zend_Config $options OPTIONAL
+ */
+ public function __construct($options = null)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (!is_array($options)) {
+ $options = func_get_args();
+ $temp = array();
+ if (!empty($options)) {
+ $temp['type'] = array_shift($options);
+ }
+
+ $options = $temp;
+ }
+
+ if (is_array($options) && array_key_exists('type', $options)) {
+ $this->setType($options['type']);
+ }
+ }
+
+ /**
+ * Returns the set types
+ *
+ * @return array
+ */
+ public function getType()
+ {
+ return $this->_type;
+ }
+
+ /**
+ * Set the types
+ *
+ * @param integer|array $type
+ * @throws Zend_Validate_Exception
+ * @return Zend_Validate_NotEmpty
+ */
+ public function setType($type = null)
+ {
+ if (is_array($type)) {
+ $detected = 0;
+ foreach($type as $value) {
+ if (is_int($value)) {
+ $detected += $value;
+ } else if (in_array($value, $this->_constants)) {
+ $detected += array_search($value, $this->_constants);
+ }
+ }
+
+ $type = $detected;
+ } else if (is_string($type) && in_array($type, $this->_constants)) {
+ $type = array_search($type, $this->_constants);
+ }
+
+ if (!is_int($type) || ($type < 0) || ($type > self::ALL)) {
+ throw new Zend_Validate_Exception('Unknown type');
+ }
+
+ $this->_type = $type;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if $value is not an empty value.
+ *
+ * @param string $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ if ($value !== null && !is_string($value) && !is_int($value) && !is_float($value) &&
+ !is_bool($value) && !is_array($value) && !is_object($value)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ $type = $this->getType();
+ $this->_setValue($value);
+ $object = false;
+
+ // OBJECT_COUNT (countable object)
+ if ($type >= self::OBJECT_COUNT) {
+ $type -= self::OBJECT_COUNT;
+ $object = true;
+
+ if (is_object($value) && ($value instanceof Countable) && (count($value) == 0)) {
+ $this->_error(self::IS_EMPTY);
+ return false;
+ }
+ }
+
+ // OBJECT_STRING (object's toString)
+ if ($type >= self::OBJECT_STRING) {
+ $type -= self::OBJECT_STRING;
+ $object = true;
+
+ if ((is_object($value) && (!method_exists($value, '__toString'))) ||
+ (is_object($value) && (method_exists($value, '__toString')) && (((string) $value) == ""))) {
+ $this->_error(self::IS_EMPTY);
+ return false;
+ }
+ }
+
+ // OBJECT (object)
+ if ($type >= self::OBJECT) {
+ $type -= self::OBJECT;
+ // fall trough, objects are always not empty
+ } else if ($object === false) {
+ // object not allowed but object given -> return false
+ if (is_object($value)) {
+ $this->_error(self::IS_EMPTY);
+ return false;
+ }
+ }
+
+ // SPACE (' ')
+ if ($type >= self::SPACE) {
+ $type -= self::SPACE;
+ if (is_string($value) && (preg_match('/^\s+$/s', $value))) {
+ $this->_error(self::IS_EMPTY);
+ return false;
+ }
+ }
+
+ // NULL (null)
+ if ($type >= self::NULL) {
+ $type -= self::NULL;
+ if ($value === null) {
+ $this->_error(self::IS_EMPTY);
+ return false;
+ }
+ }
+
+ // EMPTY_ARRAY (array())
+ if ($type >= self::EMPTY_ARRAY) {
+ $type -= self::EMPTY_ARRAY;
+ if (is_array($value) && ($value == array())) {
+ $this->_error(self::IS_EMPTY);
+ return false;
+ }
+ }
+
+ // ZERO ('0')
+ if ($type >= self::ZERO) {
+ $type -= self::ZERO;
+ if (is_string($value) && ($value == '0')) {
+ $this->_error(self::IS_EMPTY);
+ return false;
+ }
+ }
+
+ // STRING ('')
+ if ($type >= self::STRING) {
+ $type -= self::STRING;
+ if (is_string($value) && ($value == '')) {
+ $this->_error(self::IS_EMPTY);
+ return false;
+ }
+ }
+
+ // FLOAT (0.0)
+ if ($type >= self::FLOAT) {
+ $type -= self::FLOAT;
+ if (is_float($value) && ($value == 0.0)) {
+ $this->_error(self::IS_EMPTY);
+ return false;
+ }
+ }
+
+ // INTEGER (0)
+ if ($type >= self::INTEGER) {
+ $type -= self::INTEGER;
+ if (is_int($value) && ($value == 0)) {
+ $this->_error(self::IS_EMPTY);
+ return false;
+ }
+ }
+
+ // BOOLEAN (false)
+ if ($type >= self::BOOLEAN) {
+ $type -= self::BOOLEAN;
+ if (is_bool($value) && ($value == false)) {
+ $this->_error(self::IS_EMPTY);
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/PostCode.php b/library/vendor/Zend/Validate/PostCode.php
new file mode 100644
index 0000000..0ae7b03
--- /dev/null
+++ b/library/vendor/Zend/Validate/PostCode.php
@@ -0,0 +1,202 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @see Zend_Locale_Format
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_PostCode extends Zend_Validate_Abstract
+{
+ const INVALID = 'postcodeInvalid';
+ const NO_MATCH = 'postcodeNoMatch';
+
+ /**
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::INVALID => "Invalid type given. String or integer expected",
+ self::NO_MATCH => "'%value%' does not appear to be a postal code",
+ );
+
+ /**
+ * Locale to use
+ *
+ * @var string
+ */
+ protected $_locale;
+
+ /**
+ * Manual postal code format
+ *
+ * @var unknown_type
+ */
+ protected $_format;
+
+ /**
+ * Constructor for the integer validator
+ *
+ * Accepts either a string locale, a Zend_Locale object, or an array or
+ * Zend_Config object containing the keys "locale" and/or "format".
+ *
+ * @param string|Zend_Locale|array|Zend_Config $options
+ * @throws Zend_Validate_Exception On empty format
+ */
+ public function __construct($options = null)
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ }
+
+ if (empty($options)) {
+ if (Zend_Registry::isRegistered('Zend_Locale')) {
+ $this->setLocale(Zend_Registry::get('Zend_Locale'));
+ }
+ } elseif (is_array($options)) {
+ // Received
+ if (array_key_exists('locale', $options)) {
+ $this->setLocale($options['locale']);
+ }
+
+ if (array_key_exists('format', $options)) {
+ $this->setFormat($options['format']);
+ }
+ } elseif ($options instanceof Zend_Locale || is_string($options)) {
+ // Received Locale object or string locale
+ $this->setLocale($options);
+ }
+
+ $format = $this->getFormat();
+ if (empty($format)) {
+ throw new Zend_Validate_Exception("A postcode-format string has to be given for validation");
+ }
+ }
+
+ /**
+ * Returns the set locale
+ *
+ * @return string|Zend_Locale The set locale
+ */
+ public function getLocale()
+ {
+ return $this->_locale;
+ }
+
+ /**
+ * Sets the locale to use
+ *
+ * @param string|Zend_Locale $locale
+ * @throws Zend_Validate_Exception On unrecognised region
+ * @throws Zend_Validate_Exception On not detected format
+ * @return Zend_Validate_PostCode Provides a fluent interface
+ */
+ public function setLocale($locale = null)
+ {
+ $this->_locale = Zend_Locale::findLocale($locale);
+ $locale = new Zend_Locale($this->_locale);
+ $region = $locale->getRegion();
+ if (empty($region)) {
+ throw new Zend_Validate_Exception("Unable to detect a region for the locale '$locale'");
+ }
+
+ $format = Zend_Locale::getTranslation(
+ $locale->getRegion(),
+ 'postaltoterritory',
+ $this->_locale
+ );
+
+ if (empty($format)) {
+ throw new Zend_Validate_Exception("Unable to detect a postcode format for the region '{$locale->getRegion()}'");
+ }
+
+ $this->setFormat($format);
+ return $this;
+ }
+
+ /**
+ * Returns the set postal code format
+ *
+ * @return string
+ */
+ public function getFormat()
+ {
+ return $this->_format;
+ }
+
+ /**
+ * Sets a self defined postal format as regex
+ *
+ * @param string $format
+ * @throws Zend_Validate_Exception On empty format
+ * @return Zend_Validate_PostCode Provides a fluent interface
+ */
+ public function setFormat($format)
+ {
+ if (empty($format) || !is_string($format)) {
+ throw new Zend_Validate_Exception("A postcode-format string has to be given for validation");
+ }
+
+ if ($format[0] !== '/') {
+ $format = '/^' . $format;
+ }
+
+ if ($format[strlen($format) - 1] !== '/') {
+ $format .= '$/';
+ }
+
+ $this->_format = $format;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if $value is a valid postalcode
+ *
+ * @param string $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ $this->_setValue($value);
+ if (!is_string($value) && !is_int($value)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ $format = $this->getFormat();
+ if (!preg_match($format, $value)) {
+ $this->_error(self::NO_MATCH);
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Regex.php b/library/vendor/Zend/Validate/Regex.php
new file mode 100644
index 0000000..533efc0
--- /dev/null
+++ b/library/vendor/Zend/Validate/Regex.php
@@ -0,0 +1,143 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Regex extends Zend_Validate_Abstract
+{
+ const INVALID = 'regexInvalid';
+ const NOT_MATCH = 'regexNotMatch';
+ const ERROROUS = 'regexErrorous';
+
+ /**
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::INVALID => "Invalid type given. String, integer or float expected",
+ self::NOT_MATCH => "'%value%' does not match against pattern '%pattern%'",
+ self::ERROROUS => "There was an internal error while using the pattern '%pattern%'",
+ );
+
+ /**
+ * @var array
+ */
+ protected $_messageVariables = array(
+ 'pattern' => '_pattern'
+ );
+
+ /**
+ * Regular expression pattern
+ *
+ * @var string
+ */
+ protected $_pattern;
+
+ /**
+ * Sets validator options
+ *
+ * @param string|Zend_Config $pattern
+ * @throws Zend_Validate_Exception On missing 'pattern' parameter
+ */
+ public function __construct($pattern)
+ {
+ if ($pattern instanceof Zend_Config) {
+ $pattern = $pattern->toArray();
+ }
+
+ if (is_array($pattern)) {
+ if (array_key_exists('pattern', $pattern)) {
+ $pattern = $pattern['pattern'];
+ } else {
+ throw new Zend_Validate_Exception("Missing option 'pattern'");
+ }
+ }
+
+ $this->setPattern($pattern);
+ }
+
+ /**
+ * Returns the pattern option
+ *
+ * @return string
+ */
+ public function getPattern()
+ {
+ return $this->_pattern;
+ }
+
+ /**
+ * Sets the pattern option
+ *
+ * @param string $pattern
+ * @throws Zend_Validate_Exception if there is a fatal error in pattern matching
+ * @return Zend_Validate_Regex Provides a fluent interface
+ */
+ public function setPattern($pattern)
+ {
+ $this->_pattern = (string) $pattern;
+ $status = @preg_match($this->_pattern, "Test");
+
+ if (false === $status) {
+ throw new Zend_Validate_Exception("Internal error while using the pattern '$this->_pattern'");
+ }
+
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if $value matches against the pattern option
+ *
+ * @param string $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ if (!is_string($value) && !is_int($value) && !is_float($value)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ $this->_setValue($value);
+
+ $status = @preg_match($this->_pattern, $value);
+ if (false === $status) {
+ $this->_error(self::ERROROUS);
+ return false;
+ }
+
+ if (!$status) {
+ $this->_error(self::NOT_MATCH);
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Sitemap/Changefreq.php b/library/vendor/Zend/Validate/Sitemap/Changefreq.php
new file mode 100644
index 0000000..972f355
--- /dev/null
+++ b/library/vendor/Zend/Validate/Sitemap/Changefreq.php
@@ -0,0 +1,94 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @subpackage Sitemap
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * Validates whether a given value is valid as a sitemap <changefreq> value
+ *
+ * @link http://www.sitemaps.org/protocol.php Sitemaps XML format
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @subpackage Sitemap
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Sitemap_Changefreq extends Zend_Validate_Abstract
+{
+ /**
+ * Validation key for not valid
+ *
+ */
+ const NOT_VALID = 'sitemapChangefreqNotValid';
+ const INVALID = 'sitemapChangefreqInvalid';
+
+ /**
+ * Validation failure message template definitions
+ *
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::NOT_VALID => "'%value%' is not a valid sitemap changefreq",
+ self::INVALID => "Invalid type given. String expected",
+ );
+
+ /**
+ * Valid change frequencies
+ *
+ * @var array
+ */
+ protected $_changeFreqs = array(
+ 'always', 'hourly', 'daily', 'weekly',
+ 'monthly', 'yearly', 'never'
+ );
+
+ /**
+ * Validates if a string is valid as a sitemap changefreq
+ *
+ * @link http://www.sitemaps.org/protocol.php#changefreqdef <changefreq>
+ *
+ * @param string $value value to validate
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ if (!is_string($value)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ $this->_setValue($value);
+ if (!is_string($value)) {
+ return false;
+ }
+
+ if (!in_array($value, $this->_changeFreqs, true)) {
+ $this->_error(self::NOT_VALID);
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Sitemap/Lastmod.php b/library/vendor/Zend/Validate/Sitemap/Lastmod.php
new file mode 100644
index 0000000..e813e5a
--- /dev/null
+++ b/library/vendor/Zend/Validate/Sitemap/Lastmod.php
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @subpackage Sitemap
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * Validates whether a given value is valid as a sitemap <lastmod> value
+ *
+ * @link http://www.sitemaps.org/protocol.php Sitemaps XML format
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @subpackage Sitemap
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Sitemap_Lastmod extends Zend_Validate_Abstract
+{
+ /**
+ * Regular expression to use when validating
+ *
+ */
+ const LASTMOD_REGEX = '/^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])(T([0-1][0-9]|2[0-3])(:[0-5][0-9])(:[0-5][0-9])?(\\+|-)([0-1][0-9]|2[0-3]):[0-5][0-9])?$/';
+
+ /**
+ * Validation key for not valid
+ *
+ */
+ const NOT_VALID = 'sitemapLastmodNotValid';
+ const INVALID = 'sitemapLastmodInvalid';
+
+ /**
+ * Validation failure message template definitions
+ *
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::NOT_VALID => "'%value%' is not a valid sitemap lastmod",
+ self::INVALID => "Invalid type given. String expected",
+ );
+
+ /**
+ * Validates if a string is valid as a sitemap lastmod
+ *
+ * @link http://www.sitemaps.org/protocol.php#lastmoddef <lastmod>
+ *
+ * @param string $value value to validate
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ if (!is_string($value)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ $this->_setValue($value);
+ $result = @preg_match(self::LASTMOD_REGEX, $value);
+ if ($result != 1) {
+ $this->_error(self::NOT_VALID);
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Sitemap/Loc.php b/library/vendor/Zend/Validate/Sitemap/Loc.php
new file mode 100644
index 0000000..84a16bc
--- /dev/null
+++ b/library/vendor/Zend/Validate/Sitemap/Loc.php
@@ -0,0 +1,85 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @subpackage Sitemap
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @see Zend_Uri
+ */
+
+/**
+ * Validates whether a given value is valid as a sitemap <loc> value
+ *
+ * @link http://www.sitemaps.org/protocol.php Sitemaps XML format
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @subpackage Sitemap
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Sitemap_Loc extends Zend_Validate_Abstract
+{
+ /**
+ * Validation key for not valid
+ *
+ */
+ const NOT_VALID = 'sitemapLocNotValid';
+ const INVALID = 'sitemapLocInvalid';
+
+ /**
+ * Validation failure message template definitions
+ *
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::NOT_VALID => "'%value%' is not a valid sitemap location",
+ self::INVALID => "Invalid type given. String expected",
+ );
+
+ /**
+ * Validates if a string is valid as a sitemap location
+ *
+ * @link http://www.sitemaps.org/protocol.php#locdef <loc>
+ *
+ * @param string $value value to validate
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ if (!is_string($value)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ $this->_setValue($value);
+ $result = Zend_Uri::check($value);
+ if ($result !== true) {
+ $this->_error(self::NOT_VALID);
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/Sitemap/Priority.php b/library/vendor/Zend/Validate/Sitemap/Priority.php
new file mode 100644
index 0000000..abb0ced
--- /dev/null
+++ b/library/vendor/Zend/Validate/Sitemap/Priority.php
@@ -0,0 +1,81 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @subpackage Sitemap
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * Validates whether a given value is valid as a sitemap <priority> value
+ *
+ * @link http://www.sitemaps.org/protocol.php Sitemaps XML format
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @subpackage Sitemap
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_Sitemap_Priority extends Zend_Validate_Abstract
+{
+ /**
+ * Validation key for not valid
+ *
+ */
+ const NOT_VALID = 'sitemapPriorityNotValid';
+ const INVALID = 'sitemapPriorityInvalid';
+
+ /**
+ * Validation failure message template definitions
+ *
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::NOT_VALID => "'%value%' is not a valid sitemap priority",
+ self::INVALID => "Invalid type given. Numeric string, integer or float expected",
+ );
+
+ /**
+ * Validates if a string is valid as a sitemap priority
+ *
+ * @link http://www.sitemaps.org/protocol.php#prioritydef <priority>
+ *
+ * @param string $value value to validate
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ if (!is_numeric($value)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ $this->_setValue($value);
+ $value = (float) $value;
+ if ($value < 0 || $value > 1) {
+ $this->_error(self::NOT_VALID);
+ return false;
+ }
+
+ return true;
+ }
+}
diff --git a/library/vendor/Zend/Validate/StringLength.php b/library/vendor/Zend/Validate/StringLength.php
new file mode 100644
index 0000000..22f9887
--- /dev/null
+++ b/library/vendor/Zend/Validate/StringLength.php
@@ -0,0 +1,263 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_Validate_Abstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_Validate
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Validate_StringLength extends Zend_Validate_Abstract
+{
+ const INVALID = 'stringLengthInvalid';
+ const TOO_SHORT = 'stringLengthTooShort';
+ const TOO_LONG = 'stringLengthTooLong';
+
+ /**
+ * @var array
+ */
+ protected $_messageTemplates = array(
+ self::INVALID => "Invalid type given. String expected",
+ self::TOO_SHORT => "'%value%' is less than %min% characters long",
+ self::TOO_LONG => "'%value%' is more than %max% characters long",
+ );
+
+ /**
+ * @var array
+ */
+ protected $_messageVariables = array(
+ 'min' => '_min',
+ 'max' => '_max'
+ );
+
+ /**
+ * Minimum length
+ *
+ * @var integer
+ */
+ protected $_min;
+
+ /**
+ * Maximum length
+ *
+ * If null, there is no maximum length
+ *
+ * @var integer|null
+ */
+ protected $_max;
+
+ /**
+ * Encoding to use
+ *
+ * @var string|null
+ */
+ protected $_encoding;
+
+ /**
+ * Sets validator options
+ *
+ * @param integer|array|Zend_Config $options
+ */
+ public function __construct($options = array())
+ {
+ if ($options instanceof Zend_Config) {
+ $options = $options->toArray();
+ } else if (!is_array($options)) {
+ $options = func_get_args();
+ $temp['min'] = array_shift($options);
+ if (!empty($options)) {
+ $temp['max'] = array_shift($options);
+ }
+
+ if (!empty($options)) {
+ $temp['encoding'] = array_shift($options);
+ }
+
+ $options = $temp;
+ }
+
+ if (!array_key_exists('min', $options)) {
+ $options['min'] = 0;
+ }
+
+ $this->setMin($options['min']);
+ if (array_key_exists('max', $options)) {
+ $this->setMax($options['max']);
+ }
+
+ if (array_key_exists('encoding', $options)) {
+ $this->setEncoding($options['encoding']);
+ }
+ }
+
+ /**
+ * Returns the min option
+ *
+ * @return integer
+ */
+ public function getMin()
+ {
+ return $this->_min;
+ }
+
+ /**
+ * Sets the min option
+ *
+ * @param integer $min
+ * @throws Zend_Validate_Exception
+ * @return Zend_Validate_StringLength Provides a fluent interface
+ */
+ public function setMin($min)
+ {
+ if (null !== $this->_max && $min > $this->_max) {
+ /**
+ * @see Zend_Validate_Exception
+ */
+ throw new Zend_Validate_Exception("The minimum must be less than or equal to the maximum length, but $min >"
+ . " $this->_max");
+ }
+ $this->_min = max(0, (integer) $min);
+ return $this;
+ }
+
+ /**
+ * Returns the max option
+ *
+ * @return integer|null
+ */
+ public function getMax()
+ {
+ return $this->_max;
+ }
+
+ /**
+ * Sets the max option
+ *
+ * @param integer|null $max
+ * @throws Zend_Validate_Exception
+ * @return Zend_Validate_StringLength Provides a fluent interface
+ */
+ public function setMax($max)
+ {
+ if (null === $max) {
+ $this->_max = null;
+ } else if ($max < $this->_min) {
+ /**
+ * @see Zend_Validate_Exception
+ */
+ throw new Zend_Validate_Exception("The maximum must be greater than or equal to the minimum length, but "
+ . "$max < $this->_min");
+ } else {
+ $this->_max = (integer) $max;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Returns the actual encoding
+ *
+ * @return string
+ */
+ public function getEncoding()
+ {
+ return $this->_encoding;
+ }
+
+ /**
+ * Sets a new encoding to use
+ *
+ * @param string $encoding
+ * @throws Zend_Validate_Exception
+ * @return Zend_Validate_StringLength
+ */
+ public function setEncoding($encoding = null)
+ {
+ if ($encoding !== null) {
+ $orig = PHP_VERSION_ID < 50600
+ ? iconv_get_encoding('internal_encoding')
+ : ini_get('default_charset');
+ if (PHP_VERSION_ID < 50600) {
+ if ($encoding) {
+ $result = iconv_set_encoding('internal_encoding', $encoding);
+ } else {
+ $result = false;
+ }
+ } else {
+ ini_set('default_charset', $encoding);
+ $result = ini_get('default_charset');
+ }
+ if (!$result) {
+ throw new Zend_Validate_Exception('Given encoding not supported on this OS!');
+ }
+
+ if (PHP_VERSION_ID < 50600) {
+ iconv_set_encoding('internal_encoding', $orig);
+ } else {
+ ini_set('default_charset', $orig);
+ }
+ }
+ $this->_encoding = $encoding;
+ return $this;
+ }
+
+ /**
+ * Defined by Zend_Validate_Interface
+ *
+ * Returns true if and only if the string length of $value is at least the min option and
+ * no greater than the max option (when the max option is not null).
+ *
+ * @param string $value
+ * @return boolean
+ */
+ public function isValid($value)
+ {
+ if (!is_string($value)) {
+ $this->_error(self::INVALID);
+ return false;
+ }
+
+ $this->_setValue($value);
+ if ($this->_encoding !== null) {
+ $length = iconv_strlen($value, $this->_encoding);
+ } else {
+ $length = iconv_strlen($value);
+ }
+
+ if ($length < $this->_min) {
+ $this->_error(self::TOO_SHORT);
+ }
+
+ if (null !== $this->_max && $this->_max < $length) {
+ $this->_error(self::TOO_LONG);
+ }
+
+ if (count($this->_messages)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+}
diff --git a/library/vendor/Zend/View.php b/library/vendor/Zend/View.php
new file mode 100644
index 0000000..b266b7e
--- /dev/null
+++ b/library/vendor/Zend/View.php
@@ -0,0 +1,158 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Abstract master class for extension.
+ */
+
+
+/**
+ * Concrete class for handling view scripts.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ *
+ * Convenience methods for build in helpers (@see __call):
+ *
+ * @method string baseUrl($file = null)
+ * @method string currency($value = null, $currency = null)
+ * @method Zend_View_Helper_Cycle cycle(array $data = array(), $name = Zend_View_Helper_Cycle::DEFAULT_NAME)
+ * @method Zend_View_Helper_Doctype doctype($doctype = null)
+ * @method string fieldset($name, $content, $attribs = null)
+ * @method string form($name, $attribs = null, $content = false)
+ * @method string formButton($name, $value = null, $attribs = null)
+ * @method string formCheckbox($name, $value = null, $attribs = null, array $checkedOptions = null)
+ * @method string formErrors($errors, array $options = null)
+ * @method string formFile($name, $attribs = null)
+ * @method string formHidden($name, $value = null, array $attribs = null)
+ * @method string formImage($name, $value = null, $attribs = null)
+ * @method string formLabel($name, $value = null, array $attribs = null)
+ * @method string formMultiCheckbox($name, $value = null, $attribs = null, $options = null, $listsep = "<br />\n")
+ * @method string formNote($name, $value = null)
+ * @method string formPassword($name, $value = null, $attribs = null)
+ * @method string formRadio($name, $value = null, $attribs = null, $options = null, $listsep = "<br />\n")
+ * @method string formReset($name = '', $value = 'Reset', $attribs = null)
+ * @method string formSelect($name, $value = null, $attribs = null, $options = null, $listsep = "<br />\n")
+ * @method string formSubmit($name, $value = null, $attribs = null)
+ * @method string formText($name, $value = null, $attribs = null)
+ * @method string formTextarea($name, $value = null, $attribs = null)
+ * @method Zend_View_Helper_Gravatar gravatar($email = "", $options = array(), $attribs = array())
+ * @method Zend_View_Helper_HeadLink headLink(array $attributes = null, $placement = Zend_View_Helper_Placeholder_Container_Abstract::APPEND)
+ * @method Zend_View_Helper_HeadMeta headMeta($content = null, $keyValue = null, $keyType = 'name', $modifiers = array(), $placement = Zend_View_Helper_Placeholder_Container_Abstract::APPEND)
+ * @method Zend_View_Helper_HeadScript headScript($mode = Zend_View_Helper_HeadScript::FILE, $spec = null, $placement = 'APPEND', array $attrs = array(), $type = 'text/javascript')
+ * @method Zend_View_Helper_HeadStyle headStyle($content = null, $placement = 'APPEND', $attributes = array())
+ * @method Zend_View_Helper_HeadTitle headTitle($title = null, $setType = null)
+ * @method string htmlFlash($data, array $attribs = array(), array $params = array(), $content = null)
+ * @method string htmlList(array $items, $ordered = false, $attribs = false, $escape = true)
+ * @method string htmlObject($data, $type, array $attribs = array(), array $params = array(), $content = null)
+ * @method string htmlPage($data, array $attribs = array(), array $params = array(), $content = null)
+ * @method string htmlQuicktime($data, array $attribs = array(), array $params = array(), $content = null)
+ * @method Zend_View_Helper_InlineScript inlineScript($mode = Zend_View_Helper_HeadScript::FILE, $spec = null, $placement = 'APPEND', array $attrs = array(), $type = 'text/javascript')
+ * @method string|void json($data, $keepLayouts = false, $encodeData = true)
+ * @method Zend_View_Helper_Layout layout()
+ * @method Zend_View_Helper_Navigation navigation(Zend_Navigation_Container $container = null)
+ * @method string paginationControl(Zend_Paginator $paginator = null, $scrollingStyle = null, $partial = null, $params = null)
+ * @method string partial($name = null, $module = null, $model = null)
+ * @method string partialLoop($name = null, $module = null, $model = null)
+ * @method Zend_View_Helper_Placeholder_Container_Abstract placeholder($name)
+ * @method void renderToPlaceholder($script, $placeholder)
+ * @method string serverUrl($requestUri = null)
+ * @method string translate($messageid = null)
+ * @method string url(array $urlOptions = array(), $name = null, $reset = false, $encode = true)
+ * @method Zend_Http_UserAgent userAgent(Zend_Http_UserAgent $userAgent = null)
+ */
+class Zend_View extends Zend_View_Abstract
+{
+ /**
+ * Whether or not to use streams to mimic short tags
+ * @var bool
+ */
+ private $_useViewStream = false;
+
+ /**
+ * Whether or not to use stream wrapper if short_open_tag is false
+ * @var bool
+ */
+ private $_useStreamWrapper = false;
+
+ /**
+ * Constructor
+ *
+ * Register Zend_View_Stream stream wrapper if short tags are disabled.
+ *
+ * @param array $config
+ * @return void
+ */
+ public function __construct($config = array())
+ {
+ $this->_useViewStream = (bool) ini_get('short_open_tag') ? false : true;
+ if ($this->_useViewStream) {
+ if (!in_array('zend.view', stream_get_wrappers())) {
+ stream_wrapper_register('zend.view', 'Zend_View_Stream');
+ }
+ }
+
+ if (array_key_exists('useStreamWrapper', $config)) {
+ $this->setUseStreamWrapper($config['useStreamWrapper']);
+ }
+
+ parent::__construct($config);
+ }
+
+ /**
+ * Set flag indicating if stream wrapper should be used if short_open_tag is off
+ *
+ * @param bool $flag
+ * @return Zend_View
+ */
+ public function setUseStreamWrapper($flag)
+ {
+ $this->_useStreamWrapper = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Should the stream wrapper be used if short_open_tag is off?
+ *
+ * @return bool
+ */
+ public function useStreamWrapper()
+ {
+ return $this->_useStreamWrapper;
+ }
+
+ /**
+ * Includes the view script in a scope with only public $this variables.
+ *
+ * @param string The view script to execute.
+ */
+ protected function _run()
+ {
+ if ($this->_useViewStream && $this->useStreamWrapper()) {
+ include 'zend.view://' . func_get_arg(0);
+ } else {
+ include func_get_arg(0);
+ }
+ }
+}
diff --git a/library/vendor/Zend/View/Abstract.php b/library/vendor/Zend/View/Abstract.php
new file mode 100644
index 0000000..edb577d
--- /dev/null
+++ b/library/vendor/Zend/View/Abstract.php
@@ -0,0 +1,1186 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** @see Zend_Loader */
+
+/** @see Zend_Loader_PluginLoader */
+
+/** @see Zend_View_Interface */
+
+/**
+ * Abstract class for Zend_View to help enforce private constructs.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_View_Abstract implements Zend_View_Interface
+{
+ /**
+ * Path stack for script, helper, and filter directories.
+ *
+ * @var array
+ */
+ private $_path = array(
+ 'script' => array(),
+ 'helper' => array(),
+ 'filter' => array(),
+ );
+
+ /**
+ * Script file name to execute
+ *
+ * @var string
+ */
+ private $_file = null;
+
+ /**
+ * Instances of helper objects.
+ *
+ * @var array
+ */
+ private $_helper = array();
+
+ /**
+ * Map of helper => class pairs to help in determining helper class from
+ * name
+ * @var array
+ */
+ private $_helperLoaded = array();
+
+ /**
+ * Map of helper => classfile pairs to aid in determining helper classfile
+ * @var array
+ */
+ private $_helperLoadedDir = array();
+
+ /**
+ * Stack of Zend_View_Filter names to apply as filters.
+ * @var array
+ */
+ private $_filter = array();
+
+ /**
+ * Stack of Zend_View_Filter objects that have been loaded
+ * @var array
+ */
+ private $_filterClass = array();
+
+ /**
+ * Map of filter => class pairs to help in determining filter class from
+ * name
+ * @var array
+ */
+ private $_filterLoaded = array();
+
+ /**
+ * Map of filter => classfile pairs to aid in determining filter classfile
+ * @var array
+ */
+ private $_filterLoadedDir = array();
+
+ /**
+ * Callback for escaping.
+ *
+ * @var string
+ */
+ private $_escape = 'htmlspecialchars';
+
+ /**
+ * Encoding to use in escaping mechanisms; defaults to utf-8
+ * @var string
+ */
+ private $_encoding = 'UTF-8';
+
+ /**
+ * Flag indicating whether or not LFI protection for rendering view scripts is enabled
+ * @var bool
+ */
+ private $_lfiProtectionOn = true;
+
+ /**
+ * Plugin loaders
+ * @var array
+ */
+ private $_loaders = array();
+
+ /**
+ * Plugin types
+ * @var array
+ */
+ private $_loaderTypes = array('filter', 'helper');
+
+ /**
+ * Strict variables flag; when on, undefined variables accessed in the view
+ * scripts will trigger notices
+ * @var boolean
+ */
+ private $_strictVars = false;
+
+ /**
+ * Constructor.
+ *
+ * @param array $config Configuration key-value pairs.
+ */
+ public function __construct($config = array())
+ {
+ // set inital paths and properties
+ $this->setScriptPath(null);
+
+ // $this->setHelperPath(null);
+ $this->setFilterPath(null);
+
+ // user-defined escaping callback
+ if (array_key_exists('escape', $config)) {
+ $this->setEscape($config['escape']);
+ }
+
+ // encoding
+ if (array_key_exists('encoding', $config)) {
+ $this->setEncoding($config['encoding']);
+ }
+
+ // base path
+ if (array_key_exists('basePath', $config)) {
+ $prefix = 'Zend_View';
+ if (array_key_exists('basePathPrefix', $config)) {
+ $prefix = $config['basePathPrefix'];
+ }
+ $this->setBasePath($config['basePath'], $prefix);
+ }
+
+ // user-defined view script path
+ if (array_key_exists('scriptPath', $config)) {
+ $this->addScriptPath($config['scriptPath']);
+ }
+
+ // user-defined helper path
+ if (array_key_exists('helperPath', $config)) {
+ if (is_array($config['helperPath'])) {
+ foreach ($config['helperPath'] as $prefix => $path) {
+ $this->addHelperPath($path, $prefix);
+ }
+ } else {
+ $prefix = 'Zend_View_Helper';
+ if (array_key_exists('helperPathPrefix', $config)) {
+ $prefix = $config['helperPathPrefix'];
+ }
+ $this->addHelperPath($config['helperPath'], $prefix);
+ }
+ }
+
+ // user-defined filter path
+ if (array_key_exists('filterPath', $config)) {
+ if (is_array($config['filterPath'])) {
+ foreach ($config['filterPath'] as $prefix => $path) {
+ $this->addFilterPath($path, $prefix);
+ }
+ } else {
+ $prefix = 'Zend_View_Filter';
+ if (array_key_exists('filterPathPrefix', $config)) {
+ $prefix = $config['filterPathPrefix'];
+ }
+ $this->addFilterPath($config['filterPath'], $prefix);
+ }
+ }
+
+ // user-defined filters
+ if (array_key_exists('filter', $config)) {
+ $this->addFilter($config['filter']);
+ }
+
+ // strict vars
+ if (array_key_exists('strictVars', $config)) {
+ $this->strictVars($config['strictVars']);
+ }
+
+ // LFI protection flag
+ if (array_key_exists('lfiProtectionOn', $config)) {
+ $this->setLfiProtection($config['lfiProtectionOn']);
+ }
+
+ if (array_key_exists('assign', $config)
+ && is_array($config['assign'])
+ ) {
+ foreach ($config['assign'] as $key => $value) {
+ $this->assign($key, $value);
+ }
+ }
+
+ $this->init();
+ }
+
+ /**
+ * Return the template engine object
+ *
+ * Returns the object instance, as it is its own template engine
+ *
+ * @return Zend_View_Abstract
+ */
+ public function getEngine()
+ {
+ return $this;
+ }
+
+ /**
+ * Allow custom object initialization when extending Zend_View_Abstract or
+ * Zend_View
+ *
+ * Triggered by {@link __construct() the constructor} as its final action.
+ *
+ * @return void
+ */
+ public function init()
+ {
+ }
+
+ /**
+ * Prevent E_NOTICE for nonexistent values
+ *
+ * If {@link strictVars()} is on, raises a notice.
+ *
+ * @param string $key
+ * @return null
+ */
+ public function __get($key)
+ {
+ if ($this->_strictVars) {
+ trigger_error('Key "' . $key . '" does not exist', E_USER_NOTICE);
+ }
+
+ return null;
+ }
+
+ /**
+ * Allows testing with empty() and isset() to work inside
+ * templates.
+ *
+ * @param string $key
+ * @return boolean
+ */
+ public function __isset($key)
+ {
+ if ('_' != substr($key, 0, 1)) {
+ return isset($this->$key);
+ }
+
+ return false;
+ }
+
+ /**
+ * Directly assigns a variable to the view script.
+ *
+ * Checks first to ensure that the caller is not attempting to set a
+ * protected or private member (by checking for a prefixed underscore); if
+ * not, the public member is set; otherwise, an exception is raised.
+ *
+ * @param string $key The variable name.
+ * @param mixed $val The variable value.
+ * @return void
+ * @throws Zend_View_Exception if an attempt to set a private or protected
+ * member is detected
+ */
+ public function __set($key, $val)
+ {
+ if ('_' != substr($key, 0, 1)) {
+ $this->$key = $val;
+ return;
+ }
+
+ $e = new Zend_View_Exception('Setting private or protected class members is not allowed');
+ $e->setView($this);
+ throw $e;
+ }
+
+ /**
+ * Allows unset() on object properties to work
+ *
+ * @param string $key
+ * @return void
+ */
+ public function __unset($key)
+ {
+ if ('_' != substr($key, 0, 1) && isset($this->$key)) {
+ unset($this->$key);
+ }
+ }
+
+ /**
+ * Accesses a helper object from within a script.
+ *
+ * If the helper class has a 'view' property, sets it with the current view
+ * object.
+ *
+ * @param string $name The helper name.
+ * @param array $args The parameters for the helper.
+ * @return string The result of the helper output.
+ */
+ public function __call($name, $args)
+ {
+ // is the helper already loaded?
+ $helper = $this->getHelper($name);
+
+ // call the helper method
+ return call_user_func_array(
+ array($helper, $name),
+ $args
+ );
+ }
+
+ /**
+ * Given a base path, sets the script, helper, and filter paths relative to it
+ *
+ * Assumes a directory structure of:
+ * <code>
+ * basePath/
+ * scripts/
+ * helpers/
+ * filters/
+ * </code>
+ *
+ * @param string $path
+ * @param string $prefix Prefix to use for helper and filter paths
+ * @return Zend_View_Abstract
+ */
+ public function setBasePath($path, $classPrefix = 'Zend_View')
+ {
+ $path = rtrim($path, '/');
+ $path = rtrim($path, '\\');
+ $path .= DIRECTORY_SEPARATOR;
+ $classPrefix = rtrim($classPrefix, '_') . '_';
+ $this->setScriptPath($path . 'scripts');
+ $this->setHelperPath($path . 'helpers', $classPrefix . 'Helper');
+ $this->setFilterPath($path . 'filters', $classPrefix . 'Filter');
+ return $this;
+ }
+
+ /**
+ * Given a base path, add script, helper, and filter paths relative to it
+ *
+ * Assumes a directory structure of:
+ * <code>
+ * basePath/
+ * scripts/
+ * helpers/
+ * filters/
+ * </code>
+ *
+ * @param string $path
+ * @param string $prefix Prefix to use for helper and filter paths
+ * @return Zend_View_Abstract
+ */
+ public function addBasePath($path, $classPrefix = 'Zend_View')
+ {
+ $path = rtrim($path, '/');
+ $path = rtrim($path, '\\');
+ $path .= DIRECTORY_SEPARATOR;
+ $classPrefix = rtrim($classPrefix, '_') . '_';
+ $this->addScriptPath($path . 'scripts');
+ $this->addHelperPath($path . 'helpers', $classPrefix . 'Helper');
+ $this->addFilterPath($path . 'filters', $classPrefix . 'Filter');
+ return $this;
+ }
+
+ /**
+ * Adds to the stack of view script paths in LIFO order.
+ *
+ * @param string|array The directory (-ies) to add.
+ * @return Zend_View_Abstract
+ */
+ public function addScriptPath($path)
+ {
+ $this->_addPath('script', $path);
+ return $this;
+ }
+
+ /**
+ * Resets the stack of view script paths.
+ *
+ * To clear all paths, use Zend_View::setScriptPath(null).
+ *
+ * @param string|array The directory (-ies) to set as the path.
+ * @return Zend_View_Abstract
+ */
+ public function setScriptPath($path)
+ {
+ $this->_path['script'] = array();
+ $this->_addPath('script', $path);
+ return $this;
+ }
+
+ /**
+ * Return full path to a view script specified by $name
+ *
+ * @param string $name
+ * @return false|string False if script not found
+ * @throws Zend_View_Exception if no script directory set
+ */
+ public function getScriptPath($name)
+ {
+ try {
+ $path = $this->_script($name);
+ return $path;
+ } catch (Zend_View_Exception $e) {
+ if (strstr($e->getMessage(), 'no view script directory set')) {
+ throw $e;
+ }
+
+ return false;
+ }
+ }
+
+ /**
+ * Returns an array of all currently set script paths
+ *
+ * @return array
+ */
+ public function getScriptPaths()
+ {
+ return $this->_getPaths('script');
+ }
+
+ /**
+ * Set plugin loader for a particular plugin type
+ *
+ * @param Zend_Loader_PluginLoader $loader
+ * @param string $type
+ * @return Zend_View_Abstract
+ */
+ public function setPluginLoader(Zend_Loader_PluginLoader $loader, $type)
+ {
+ $type = strtolower($type);
+ if (!in_array($type, $this->_loaderTypes)) {
+ $e = new Zend_View_Exception(sprintf('Invalid plugin loader type "%s"', $type));
+ $e->setView($this);
+ throw $e;
+ }
+
+ $this->_loaders[$type] = $loader;
+ return $this;
+ }
+
+ /**
+ * Retrieve plugin loader for a specific plugin type
+ *
+ * @param string $type
+ * @return Zend_Loader_PluginLoader
+ */
+ public function getPluginLoader($type)
+ {
+ $type = strtolower($type);
+ if (!in_array($type, $this->_loaderTypes)) {
+ $e = new Zend_View_Exception(sprintf('Invalid plugin loader type "%s"; cannot retrieve', $type));
+ $e->setView($this);
+ throw $e;
+ }
+
+ if (!array_key_exists($type, $this->_loaders)) {
+ $prefix = 'Zend_View_';
+ $pathPrefix = 'Zend/View/';
+
+ $pType = ucfirst($type);
+ switch ($type) {
+ case 'filter':
+ case 'helper':
+ default:
+ $prefix .= $pType;
+ $pathPrefix .= $pType;
+ $loader = new Zend_Loader_PluginLoader(array(
+ $prefix => $pathPrefix
+ ));
+ $this->_loaders[$type] = $loader;
+ break;
+ }
+ }
+ return $this->_loaders[$type];
+ }
+
+ /**
+ * Adds to the stack of helper paths in LIFO order.
+ *
+ * @param string|array The directory (-ies) to add.
+ * @param string $classPrefix Class prefix to use with classes in this
+ * directory; defaults to Zend_View_Helper
+ * @return Zend_View_Abstract
+ */
+ public function addHelperPath($path, $classPrefix = 'Zend_View_Helper_')
+ {
+ return $this->_addPluginPath('helper', $classPrefix, (array) $path);
+ }
+
+ /**
+ * Resets the stack of helper paths.
+ *
+ * To clear all paths, use Zend_View::setHelperPath(null).
+ *
+ * @param string|array $path The directory (-ies) to set as the path.
+ * @param string $classPrefix The class prefix to apply to all elements in
+ * $path; defaults to Zend_View_Helper
+ * @return Zend_View_Abstract
+ */
+ public function setHelperPath($path, $classPrefix = 'Zend_View_Helper_')
+ {
+ unset($this->_loaders['helper']);
+ return $this->addHelperPath($path, $classPrefix);
+ }
+
+ /**
+ * Get full path to a helper class file specified by $name
+ *
+ * @param string $name
+ * @return string|false False on failure, path on success
+ */
+ public function getHelperPath($name)
+ {
+ return $this->_getPluginPath('helper', $name);
+ }
+
+ /**
+ * Returns an array of all currently set helper paths
+ *
+ * @return array
+ */
+ public function getHelperPaths()
+ {
+ return $this->getPluginLoader('helper')->getPaths();
+ }
+
+ /**
+ * Registers a helper object, bypassing plugin loader
+ *
+ * @param Zend_View_Helper_Abstract|object $helper
+ * @param string $name
+ * @return Zend_View_Abstract
+ * @throws Zend_View_Exception
+ */
+ public function registerHelper($helper, $name)
+ {
+ if (!is_object($helper)) {
+ $e = new Zend_View_Exception('View helper must be an object');
+ $e->setView($this);
+ throw $e;
+ }
+
+ if (!$helper instanceof Zend_View_Interface) {
+ if (!method_exists($helper, $name)) {
+ $e = new Zend_View_Exception(
+ 'View helper must implement Zend_View_Interface or have a method matching the name provided'
+ );
+ $e->setView($this);
+ throw $e;
+ }
+ }
+
+ if (method_exists($helper, 'setView')) {
+ $helper->setView($this);
+ }
+
+ $name = ucfirst($name);
+ $this->_helper[$name] = $helper;
+ return $this;
+ }
+
+ /**
+ * Get a helper by name
+ *
+ * @param string $name
+ * @return object
+ */
+ public function getHelper($name)
+ {
+ return $this->_getPlugin('helper', $name);
+ }
+
+ /**
+ * Get array of all active helpers
+ *
+ * Only returns those that have already been instantiated.
+ *
+ * @return array
+ */
+ public function getHelpers()
+ {
+ return $this->_helper;
+ }
+
+ /**
+ * Adds to the stack of filter paths in LIFO order.
+ *
+ * @param string|array The directory (-ies) to add.
+ * @param string $classPrefix Class prefix to use with classes in this
+ * directory; defaults to Zend_View_Filter
+ * @return Zend_View_Abstract
+ */
+ public function addFilterPath($path, $classPrefix = 'Zend_View_Filter_')
+ {
+ return $this->_addPluginPath('filter', $classPrefix, (array) $path);
+ }
+
+ /**
+ * Resets the stack of filter paths.
+ *
+ * To clear all paths, use Zend_View::setFilterPath(null).
+ *
+ * @param string|array The directory (-ies) to set as the path.
+ * @param string $classPrefix The class prefix to apply to all elements in
+ * $path; defaults to Zend_View_Filter
+ * @return Zend_View_Abstract
+ */
+ public function setFilterPath($path, $classPrefix = 'Zend_View_Filter_')
+ {
+ unset($this->_loaders['filter']);
+ return $this->addFilterPath($path, $classPrefix);
+ }
+
+ /**
+ * Get full path to a filter class file specified by $name
+ *
+ * @param string $name
+ * @return string|false False on failure, path on success
+ */
+ public function getFilterPath($name)
+ {
+ return $this->_getPluginPath('filter', $name);
+ }
+
+ /**
+ * Get a filter object by name
+ *
+ * @param string $name
+ * @return object
+ */
+ public function getFilter($name)
+ {
+ return $this->_getPlugin('filter', $name);
+ }
+
+ /**
+ * Return array of all currently active filters
+ *
+ * Only returns those that have already been instantiated.
+ *
+ * @return array
+ */
+ public function getFilters()
+ {
+ return $this->_filter;
+ }
+
+ /**
+ * Returns an array of all currently set filter paths
+ *
+ * @return array
+ */
+ public function getFilterPaths()
+ {
+ return $this->getPluginLoader('filter')->getPaths();
+ }
+
+ /**
+ * Return associative array of path types => paths
+ *
+ * @return array
+ */
+ public function getAllPaths()
+ {
+ $paths = $this->_path;
+ $paths['helper'] = $this->getHelperPaths();
+ $paths['filter'] = $this->getFilterPaths();
+ return $paths;
+ }
+
+ /**
+ * Add one or more filters to the stack in FIFO order.
+ *
+ * @param string|array One or more filters to add.
+ * @return Zend_View_Abstract
+ */
+ public function addFilter($name)
+ {
+ foreach ((array) $name as $val) {
+ $this->_filter[] = $val;
+ }
+ return $this;
+ }
+
+ /**
+ * Resets the filter stack.
+ *
+ * To clear all filters, use Zend_View::setFilter(null).
+ *
+ * @param string|array One or more filters to set.
+ * @return Zend_View_Abstract
+ */
+ public function setFilter($name)
+ {
+ $this->_filter = array();
+ $this->addFilter($name);
+ return $this;
+ }
+
+ /**
+ * Sets the _escape() callback.
+ *
+ * @param mixed $spec The callback for _escape() to use.
+ * @return Zend_View_Abstract
+ */
+ public function setEscape($spec)
+ {
+ $this->_escape = $spec;
+ return $this;
+ }
+
+ /**
+ * Set LFI protection flag
+ *
+ * @param bool $flag
+ * @return Zend_View_Abstract
+ */
+ public function setLfiProtection($flag)
+ {
+ $this->_lfiProtectionOn = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Return status of LFI protection flag
+ *
+ * @return bool
+ */
+ public function isLfiProtectionOn()
+ {
+ return $this->_lfiProtectionOn;
+ }
+
+ /**
+ * Assigns variables to the view script via differing strategies.
+ *
+ * Zend_View::assign('name', $value) assigns a variable called 'name'
+ * with the corresponding $value.
+ *
+ * Zend_View::assign($array) assigns the array keys as variable
+ * names (with the corresponding array values).
+ *
+ * @see __set()
+ * @param string|array The assignment strategy to use.
+ * @param mixed (Optional) If assigning a named variable, use this
+ * as the value.
+ * @return Zend_View_Abstract Fluent interface
+ * @throws Zend_View_Exception if $spec is neither a string nor an array,
+ * or if an attempt to set a private or protected member is detected
+ */
+ public function assign($spec, $value = null)
+ {
+ // which strategy to use?
+ if (is_string($spec)) {
+ // assign by name and value
+ if ('_' == substr($spec, 0, 1)) {
+ $e = new Zend_View_Exception('Setting private or protected class members is not allowed');
+ $e->setView($this);
+ throw $e;
+ }
+ $this->$spec = $value;
+ } elseif (is_array($spec)) {
+ // assign from associative array
+ $error = false;
+ foreach ($spec as $key => $val) {
+ if ('_' == substr($key, 0, 1)) {
+ $error = true;
+ break;
+ }
+ $this->$key = $val;
+ }
+ if ($error) {
+ $e = new Zend_View_Exception('Setting private or protected class members is not allowed');
+ $e->setView($this);
+ throw $e;
+ }
+ } else {
+ $e = new Zend_View_Exception('assign() expects a string or array, received ' . gettype($spec));
+ $e->setView($this);
+ throw $e;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Return list of all assigned variables
+ *
+ * Returns all public properties of the object. Reflection is not used
+ * here as testing reflection properties for visibility is buggy.
+ *
+ * @return array
+ */
+ public function getVars()
+ {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if ('_' == substr($key, 0, 1)) {
+ unset($vars[$key]);
+ }
+ }
+
+ return $vars;
+ }
+
+ /**
+ * Clear all assigned variables
+ *
+ * Clears all variables assigned to Zend_View either via {@link assign()} or
+ * property overloading ({@link __set()}).
+ *
+ * @return void
+ */
+ public function clearVars()
+ {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if ('_' != substr($key, 0, 1)) {
+ unset($this->$key);
+ }
+ }
+ }
+
+ /**
+ * Processes a view script and returns the output.
+ *
+ * @param string $name The script name to process.
+ * @return string The script output.
+ */
+ public function render($name)
+ {
+ // find the script file name using the parent private method
+ $this->_file = $this->_script($name);
+ unset($name); // remove $name from local scope
+
+ ob_start();
+ $this->_run($this->_file);
+
+ return $this->_filter(ob_get_clean()); // filter output
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * If escaping mechanism is one of htmlspecialchars or htmlentities, uses
+ * {@link $_encoding} setting.
+ *
+ * @param mixed $var The output to escape.
+ * @return mixed The escaped value.
+ */
+ public function escape($var)
+ {
+ if (in_array($this->_escape, array('htmlspecialchars', 'htmlentities'))) {
+ return call_user_func($this->_escape, $var, ENT_COMPAT, $this->_encoding);
+ }
+
+ if (1 == func_num_args()) {
+ return call_user_func($this->_escape, $var);
+ }
+ $args = func_get_args();
+ return call_user_func_array($this->_escape, $args);
+ }
+
+ /**
+ * Set encoding to use with htmlentities() and htmlspecialchars()
+ *
+ * @param string $encoding
+ * @return Zend_View_Abstract
+ */
+ public function setEncoding($encoding)
+ {
+ $this->_encoding = $encoding;
+ return $this;
+ }
+
+ /**
+ * Return current escape encoding
+ *
+ * @return string
+ */
+ public function getEncoding()
+ {
+ return $this->_encoding;
+ }
+
+ /**
+ * Enable or disable strict vars
+ *
+ * If strict variables are enabled, {@link __get()} will raise a notice
+ * when a variable is not defined.
+ *
+ * Use in conjunction with {@link Zend_View_Helper_DeclareVars the declareVars() helper}
+ * to enforce strict variable handling in your view scripts.
+ *
+ * @param boolean $flag
+ * @return Zend_View_Abstract
+ */
+ public function strictVars($flag = true)
+ {
+ $this->_strictVars = ($flag) ? true : false;
+
+ return $this;
+ }
+
+ /**
+ * Finds a view script from the available directories.
+ *
+ * @param string $name The base name of the script.
+ * @return void
+ */
+ protected function _script($name)
+ {
+ if ($this->isLfiProtectionOn() && preg_match('#\.\.[\\\/]#', $name)) {
+ $e = new Zend_View_Exception('Requested scripts may not include parent directory traversal ("../", "..\\" notation)');
+ $e->setView($this);
+ throw $e;
+ }
+
+ if (0 == count($this->_path['script'])) {
+ $e = new Zend_View_Exception('no view script directory set; unable to determine location for view script');
+ $e->setView($this);
+ throw $e;
+ }
+
+ foreach ($this->_path['script'] as $dir) {
+ if (is_readable($dir . $name)) {
+ return $dir . $name;
+ }
+ }
+
+ $message = "script '$name' not found in path ("
+ . implode(PATH_SEPARATOR, $this->_path['script'])
+ . ")";
+ $e = new Zend_View_Exception($message);
+ $e->setView($this);
+ throw $e;
+ }
+
+ /**
+ * Applies the filter callback to a buffer.
+ *
+ * @param string $buffer The buffer contents.
+ * @return string The filtered buffer.
+ */
+ private function _filter($buffer)
+ {
+ // loop through each filter class
+ foreach ($this->_filter as $name) {
+ // load and apply the filter class
+ $filter = $this->getFilter($name);
+ $buffer = call_user_func(array($filter, 'filter'), $buffer);
+ }
+
+ // done!
+ return $buffer;
+ }
+
+ /**
+ * Adds paths to the path stack in LIFO order.
+ *
+ * Zend_View::_addPath($type, 'dirname') adds one directory
+ * to the path stack.
+ *
+ * Zend_View::_addPath($type, $array) adds one directory for
+ * each array element value.
+ *
+ * In the case of filter and helper paths, $prefix should be used to
+ * specify what class prefix to use with the given path.
+ *
+ * @param string $type The path type ('script', 'helper', or 'filter').
+ * @param string|array $path The path specification.
+ * @param string $prefix Class prefix to use with path (helpers and filters
+ * only)
+ * @return void
+ */
+ private function _addPath($type, $path, $prefix = null)
+ {
+ foreach ((array) $path as $dir) {
+ // attempt to strip any possible separator and
+ // append the system directory separator
+ $dir = rtrim($dir, '/');
+ $dir = rtrim($dir, '\\');
+ $dir .= '/';
+
+ switch ($type) {
+ case 'script':
+ // add to the top of the stack.
+ array_unshift($this->_path[$type], $dir);
+ break;
+ case 'filter':
+ case 'helper':
+ default:
+ // add as array with prefix and dir keys
+ array_unshift($this->_path[$type], array('prefix' => $prefix, 'dir' => $dir));
+ break;
+ }
+ }
+ }
+
+ /**
+ * Resets the path stack for helpers and filters.
+ *
+ * @param string $type The path type ('helper' or 'filter').
+ * @param string|array $path The directory (-ies) to set as the path.
+ * @param string $classPrefix Class prefix to apply to elements of $path
+ */
+ private function _setPath($type, $path, $classPrefix = null)
+ {
+ $dir = DIRECTORY_SEPARATOR . ucfirst($type) . DIRECTORY_SEPARATOR;
+
+ switch ($type) {
+ case 'script':
+ $this->_path[$type] = array(dirname(__FILE__) . $dir);
+ $this->_addPath($type, $path);
+ break;
+ case 'filter':
+ case 'helper':
+ default:
+ $this->_path[$type] = array(array(
+ 'prefix' => 'Zend_View_' . ucfirst($type) . '_',
+ 'dir' => dirname(__FILE__) . $dir
+ ));
+ $this->_addPath($type, $path, $classPrefix);
+ break;
+ }
+ }
+
+ /**
+ * Return all paths for a given path type
+ *
+ * @param string $type The path type ('helper', 'filter', 'script')
+ * @return array
+ */
+ private function _getPaths($type)
+ {
+ return $this->_path[$type];
+ }
+
+ /**
+ * Register helper class as loaded
+ *
+ * @param string $name
+ * @param string $class
+ * @param string $file path to class file
+ * @return void
+ */
+ private function _setHelperClass($name, $class, $file)
+ {
+ $this->_helperLoadedDir[$name] = $file;
+ $this->_helperLoaded[$name] = $class;
+ }
+
+ /**
+ * Register filter class as loaded
+ *
+ * @param string $name
+ * @param string $class
+ * @param string $file path to class file
+ * @return void
+ */
+ private function _setFilterClass($name, $class, $file)
+ {
+ $this->_filterLoadedDir[$name] = $file;
+ $this->_filterLoaded[$name] = $class;
+ }
+
+ /**
+ * Add a prefixPath for a plugin type
+ *
+ * @param string $type
+ * @param string $classPrefix
+ * @param array $paths
+ * @return Zend_View_Abstract
+ */
+ private function _addPluginPath($type, $classPrefix, array $paths)
+ {
+ $loader = $this->getPluginLoader($type);
+ foreach ($paths as $path) {
+ $loader->addPrefixPath($classPrefix, $path);
+ }
+ return $this;
+ }
+
+ /**
+ * Get a path to a given plugin class of a given type
+ *
+ * @param string $type
+ * @param string $name
+ * @return string|false
+ */
+ private function _getPluginPath($type, $name)
+ {
+ $loader = $this->getPluginLoader($type);
+ if ($loader->isLoaded($name)) {
+ return $loader->getClassPath($name);
+ }
+
+ try {
+ $loader->load($name);
+ return $loader->getClassPath($name);
+ } catch (Zend_Loader_Exception $e) {
+ return false;
+ }
+ }
+
+ /**
+ * Retrieve a plugin object
+ *
+ * @param string $type
+ * @param string $name
+ * @return object
+ */
+ private function _getPlugin($type, $name)
+ {
+ $name = ucfirst($name);
+ switch ($type) {
+ case 'filter':
+ $storeVar = '_filterClass';
+ $store = $this->_filterClass;
+ break;
+ case 'helper':
+ $storeVar = '_helper';
+ $store = $this->_helper;
+ break;
+ }
+
+ if (!isset($store[$name])) {
+ $class = $this->getPluginLoader($type)->load($name);
+ $store[$name] = new $class();
+ if (method_exists($store[$name], 'setView')) {
+ $store[$name]->setView($this);
+ }
+ }
+
+ $this->$storeVar = $store;
+ return $store[$name];
+ }
+
+ /**
+ * Use to include the view script in a scope that only allows public
+ * members.
+ *
+ * @return mixed
+ */
+ abstract protected function _run();
+}
diff --git a/library/vendor/Zend/View/Exception.php b/library/vendor/Zend/View/Exception.php
new file mode 100644
index 0000000..87685b8
--- /dev/null
+++ b/library/vendor/Zend/View/Exception.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+
+/**
+ * Zend_Exception
+ */
+
+
+/**
+ * Exception for Zend_View class.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Exception extends Zend_Exception
+{
+ protected $view = null;
+
+ public function setView(Zend_View_Interface $view = null)
+ {
+ $this->view = $view;
+ return $this;
+ }
+
+ public function getView()
+ {
+ return $this->view;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/Abstract.php b/library/vendor/Zend/View/Helper/Abstract.php
new file mode 100644
index 0000000..0946bc3
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Abstract.php
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_View_Helper_Interface
+ */
+
+/**
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_View_Helper_Abstract implements Zend_View_Helper_Interface
+{
+ /**
+ * View object
+ *
+ * @var Zend_View_Interface
+ */
+ public $view = null;
+
+ /**
+ * Set the View object
+ *
+ * @param Zend_View_Interface $view
+ * @return Zend_View_Helper_Abstract
+ */
+ public function setView(Zend_View_Interface $view)
+ {
+ $this->view = $view;
+ return $this;
+ }
+
+ /**
+ * Strategy pattern: currently unutilized
+ *
+ * @return void
+ */
+ public function direct()
+ {
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/Action.php b/library/vendor/Zend/View/Helper/Action.php
new file mode 100644
index 0000000..5020a47
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Action.php
@@ -0,0 +1,161 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_Abstract.php */
+
+/**
+ * Helper for rendering output of a controller action
+ *
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_Action extends Zend_View_Helper_Abstract
+{
+ /**
+ * @var string
+ */
+ public $defaultModule;
+
+ /**
+ * @var Zend_Controller_Dispatcher_Interface
+ */
+ public $dispatcher;
+
+ /**
+ * @var Zend_Controller_Request_Abstract
+ */
+ public $request;
+
+ /**
+ * @var Zend_Controller_Response_Abstract
+ */
+ public $response;
+
+ /**
+ * Constructor
+ *
+ * Grab local copies of various MVC objects
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ $front = Zend_Controller_Front::getInstance();
+ $modules = $front->getControllerDirectory();
+ if (empty($modules)) {
+ $e = new Zend_View_Exception('Action helper depends on valid front controller instance');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ $request = $front->getRequest();
+ $response = $front->getResponse();
+
+ if (empty($request) || empty($response)) {
+ $e = new Zend_View_Exception('Action view helper requires both a registered request and response object in the front controller instance');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ $this->request = clone $request;
+ $this->response = clone $response;
+ $this->dispatcher = clone $front->getDispatcher();
+ $this->defaultModule = $front->getDefaultModule();
+ }
+
+ /**
+ * Reset object states
+ *
+ * @return void
+ */
+ public function resetObjects()
+ {
+ $params = $this->request->getUserParams();
+ foreach (array_keys($params) as $key) {
+ $this->request->setParam($key, null);
+ }
+
+ $this->response->clearBody();
+ $this->response->clearHeaders()
+ ->clearRawHeaders();
+ }
+
+ /**
+ * Retrieve rendered contents of a controller action
+ *
+ * If the action results in a forward or redirect, returns empty string.
+ *
+ * @param string $action
+ * @param string $controller
+ * @param string $module Defaults to default module
+ * @param array $params
+ * @return string
+ */
+ public function action($action, $controller, $module = null, array $params = array())
+ {
+ $this->resetObjects();
+ if (null === $module) {
+ $module = $this->defaultModule;
+ }
+
+ // clone the view object to prevent over-writing of view variables
+ $viewRendererObj = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
+ Zend_Controller_Action_HelperBroker::addHelper(clone $viewRendererObj);
+
+ $this->request->setParams($params)
+ ->setModuleName($module)
+ ->setControllerName($controller)
+ ->setActionName($action)
+ ->setDispatched(true);
+
+ $this->dispatcher->dispatch($this->request, $this->response);
+
+ // reset the viewRenderer object to it's original state
+ Zend_Controller_Action_HelperBroker::addHelper($viewRendererObj);
+
+
+ if (!$this->request->isDispatched()
+ || $this->response->isRedirect())
+ {
+ // forwards and redirects render nothing
+ return '';
+ }
+
+ $return = $this->response->getBody();
+ $this->resetObjects();
+ return $return;
+ }
+
+ /**
+ * Clone the current View
+ *
+ * @return Zend_View_Interface
+ */
+ public function cloneView()
+ {
+ $view = clone $this->view;
+ $view->clearVars();
+ return $view;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/BaseUrl.php b/library/vendor/Zend/View/Helper/BaseUrl.php
new file mode 100644
index 0000000..48f8049
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/BaseUrl.php
@@ -0,0 +1,114 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** @see Zend_View_Helper_Abstract */
+
+/**
+ * Helper for retrieving the BaseUrl
+ *
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_BaseUrl extends Zend_View_Helper_Abstract
+{
+ /**
+ * BaseUrl
+ *
+ * @var string
+ */
+ protected $_baseUrl;
+
+ /**
+ * Returns site's base url, or file with base url prepended
+ *
+ * $file is appended to the base url for simplicity
+ *
+ * @param string|null $file
+ * @return string
+ */
+ public function baseUrl($file = null)
+ {
+ // Get baseUrl
+ $baseUrl = $this->getBaseUrl();
+
+ // Remove trailing slashes
+ if (null !== $file) {
+ $file = '/' . ltrim($file, '/\\');
+ }
+
+ return $baseUrl . $file;
+ }
+
+ /**
+ * Set BaseUrl
+ *
+ * @param string $base
+ * @return Zend_View_Helper_BaseUrl
+ */
+ public function setBaseUrl($base)
+ {
+ $this->_baseUrl = rtrim($base, '/\\');
+ return $this;
+ }
+
+ /**
+ * Get BaseUrl
+ *
+ * @return string
+ */
+ public function getBaseUrl()
+ {
+ if ($this->_baseUrl === null) {
+ /** @see Zend_Controller_Front */
+ $baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
+
+ // Remove scriptname, eg. index.php from baseUrl
+ $baseUrl = $this->_removeScriptName($baseUrl);
+
+ $this->setBaseUrl($baseUrl);
+ }
+
+ return $this->_baseUrl;
+ }
+
+ /**
+ * Remove Script filename from baseurl
+ *
+ * @param string $url
+ * @return string
+ */
+ protected function _removeScriptName($url)
+ {
+ if (!isset($_SERVER['SCRIPT_NAME'])) {
+ // We can't do much now can we? (Well, we could parse out by ".")
+ return $url;
+ }
+
+ if (($pos = strripos($url, basename($_SERVER['SCRIPT_NAME']))) !== false) {
+ $url = substr($url, 0, $pos);
+ }
+
+ return $url;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/Cycle.php b/library/vendor/Zend/View/Helper/Cycle.php
new file mode 100644
index 0000000..eb5fd51
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Cycle.php
@@ -0,0 +1,225 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * Helper for alternating between set of values
+ *
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_Cycle implements Iterator
+{
+
+ /**
+ * Default name
+ * @var string
+ */
+ const DEFAULT_NAME = 'default';
+
+ /**
+ * Pointers
+ *
+ * @var array
+ */
+ protected $_pointers = array(self::DEFAULT_NAME =>-1) ;
+
+ /**
+ * Array of values
+ *
+ * @var array
+ */
+ protected $_data = array(self::DEFAULT_NAME=>array());
+
+ /**
+ * Actual name of cycle
+ *
+ * @var string
+ */
+ protected $_name = self::DEFAULT_NAME;
+
+ /**
+ * Add elements to alternate
+ *
+ * @param array $data
+ * @param string $name
+ * @return Zend_View_Helper_Cycle
+ */
+ public function cycle(array $data = array(), $name = self::DEFAULT_NAME)
+ {
+ if(!empty($data))
+ $this->_data[$name] = $data;
+
+ $this->setName($name);
+ return $this;
+ }
+
+ /**
+ * Add elements to alternate
+ *
+ * @param array $data
+ * @param string $name
+ * @return Zend_View_Helper_Cycle
+ */
+ public function assign(Array $data , $name = self::DEFAULT_NAME)
+ {
+ $this->setName($name);
+ $this->_data[$name] = $data;
+ $this->rewind();
+ return $this;
+ }
+
+ /**
+ * Sets actual name of cycle
+ *
+ * @param string $name
+ * @return Zend_View_Helper_Cycle
+ */
+ public function setName($name = self::DEFAULT_NAME)
+ {
+ $this->_name = $name;
+
+ if(!isset($this->_data[$this->_name]))
+ $this->_data[$this->_name] = array();
+
+ if(!isset($this->_pointers[$this->_name]))
+ $this->rewind();
+
+ return $this;
+ }
+
+ /**
+ * Gets actual name of cycle
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->_name;
+ }
+
+
+ /**
+ * Return all elements
+ *
+ * @return array
+ */
+ public function getAll()
+ {
+ return $this->_data[$this->_name];
+ }
+
+ /**
+ * Turn helper into string
+ *
+ * @return string
+ */
+ public function toString()
+ {
+ return (string) $this->_data[$this->_name][$this->key()];
+ }
+
+ /**
+ * Cast to string
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->toString();
+ }
+
+ /**
+ * Move to next value
+ *
+ * @return Zend_View_Helper_Cycle
+ */
+ public function next()
+ {
+ $count = count($this->_data[$this->_name]);
+ if ($this->_pointers[$this->_name] == ($count - 1))
+ $this->_pointers[$this->_name] = 0;
+ else
+ $this->_pointers[$this->_name] = ++$this->_pointers[$this->_name];
+ return $this;
+ }
+
+ /**
+ * Move to previous value
+ *
+ * @return Zend_View_Helper_Cycle
+ */
+ public function prev()
+ {
+ $count = count($this->_data[$this->_name]);
+ if ($this->_pointers[$this->_name] <= 0)
+ $this->_pointers[$this->_name] = $count - 1;
+ else
+ $this->_pointers[$this->_name] = --$this->_pointers[$this->_name];
+ return $this;
+ }
+
+ /**
+ * Return iteration number
+ *
+ * @return int
+ */
+ public function key()
+ {
+ if ($this->_pointers[$this->_name] < 0)
+ return 0;
+ else
+ return $this->_pointers[$this->_name];
+ }
+
+ /**
+ * Rewind pointer
+ *
+ * @return Zend_View_Helper_Cycle
+ */
+ public function rewind()
+ {
+ $this->_pointers[$this->_name] = -1;
+ return $this;
+ }
+
+ /**
+ * Check if element is valid
+ *
+ * @return bool
+ */
+ public function valid()
+ {
+ return isset($this->_data[$this->_name][$this->key()]);
+ }
+
+ /**
+ * Return current element
+ *
+ * @return mixed
+ */
+ public function current()
+ {
+ return $this->_data[$this->_name][$this->key()];
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/DeclareVars.php b/library/vendor/Zend/View/Helper/DeclareVars.php
new file mode 100644
index 0000000..a6c0fcf
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/DeclareVars.php
@@ -0,0 +1,94 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_Abstract.php */
+
+/**
+ * Helper for declaring default values of template variables
+ *
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_DeclareVars extends Zend_View_Helper_Abstract
+{
+ /**
+ * The view object that created this helper object.
+ * @var Zend_View
+ */
+ public $view;
+
+ /**
+ * Declare template vars to set default values and avoid notices when using strictVars
+ *
+ * Primarily for use when using {@link Zend_View_Abstract::strictVars() Zend_View strictVars()},
+ * this helper can be used to declare template variables that may or may
+ * not already be set in the view object, as well as to set default values.
+ * Arrays passed as arguments to the method will be used to set default
+ * values; otherwise, if the variable does not exist, it is set to an empty
+ * string.
+ *
+ * Usage:
+ * <code>
+ * $this->declareVars(
+ * 'varName1',
+ * 'varName2',
+ * array('varName3' => 'defaultValue',
+ * 'varName4' => array()
+ * )
+ * );
+ * </code>
+ *
+ * @param string|array variable number of arguments, all string names of variables to test
+ * @return void
+ */
+ public function declareVars()
+ {
+ $args = func_get_args();
+ foreach($args as $key) {
+ if (is_array($key)) {
+ foreach ($key as $name => $value) {
+ $this->_declareVar($name, $value);
+ }
+ } else if (!isset($view->$key)) {
+ $this->_declareVar($key);
+ }
+ }
+ }
+
+ /**
+ * Set a view variable
+ *
+ * Checks to see if a $key is set in the view object; if not, sets it to $value.
+ *
+ * @param string $key
+ * @param string $value Defaults to an empty string
+ * @return void
+ */
+ protected function _declareVar($key, $value = '')
+ {
+ if (!isset($this->view->$key)) {
+ $this->view->$key = $value;
+ }
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/Doctype.php b/library/vendor/Zend/View/Helper/Doctype.php
new file mode 100644
index 0000000..866b193
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Doctype.php
@@ -0,0 +1,239 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Registry */
+
+/** Zend_View_Helper_Abstract.php */
+
+/**
+ * Helper for setting and retrieving the doctype
+ *
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_Doctype extends Zend_View_Helper_Abstract
+{
+ /**#@+
+ * DocType constants
+ */
+ const XHTML11 = 'XHTML11';
+ const XHTML1_STRICT = 'XHTML1_STRICT';
+ const XHTML1_TRANSITIONAL = 'XHTML1_TRANSITIONAL';
+ const XHTML1_FRAMESET = 'XHTML1_FRAMESET';
+ const XHTML1_RDFA = 'XHTML1_RDFA';
+ const XHTML1_RDFA11 = 'XHTML1_RDFA11';
+ const XHTML_BASIC1 = 'XHTML_BASIC1';
+ const XHTML5 = 'XHTML5';
+ const HTML4_STRICT = 'HTML4_STRICT';
+ const HTML4_LOOSE = 'HTML4_LOOSE';
+ const HTML4_FRAMESET = 'HTML4_FRAMESET';
+ const HTML5 = 'HTML5';
+ const CUSTOM_XHTML = 'CUSTOM_XHTML';
+ const CUSTOM = 'CUSTOM';
+ /**#@-*/
+
+ /**
+ * Default DocType
+ * @var string
+ */
+ protected $_defaultDoctype = self::HTML4_LOOSE;
+
+ /**
+ * Registry containing current doctype and mappings
+ * @var ArrayObject
+ */
+ protected $_registry;
+
+ /**
+ * Registry key in which helper is stored
+ * @var string
+ */
+ protected $_regKey = 'Zend_View_Helper_Doctype';
+
+ /**
+ * Constructor
+ *
+ * Map constants to doctype strings, and set default doctype
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ if (!Zend_Registry::isRegistered($this->_regKey)) {
+ $this->_registry = new ArrayObject(array(
+ 'doctypes' => array(
+ self::XHTML11 => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',
+ self::XHTML1_STRICT => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
+ self::XHTML1_TRANSITIONAL => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
+ self::XHTML1_FRAMESET => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',
+ self::XHTML1_RDFA => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">',
+ self::XHTML1_RDFA11 => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.1//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd">',
+ self::XHTML_BASIC1 => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">',
+ self::XHTML5 => '<!DOCTYPE html>',
+ self::HTML4_STRICT => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
+ self::HTML4_LOOSE => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
+ self::HTML4_FRAMESET => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">',
+ self::HTML5 => '<!DOCTYPE html>',
+ )
+ ));
+ Zend_Registry::set($this->_regKey, $this->_registry);
+ $this->setDoctype($this->_defaultDoctype);
+ } else {
+ $this->_registry = Zend_Registry::get($this->_regKey);
+ }
+ }
+
+ /**
+ * Set or retrieve doctype
+ *
+ * @param string $doctype
+ * @return Zend_View_Helper_Doctype
+ */
+ public function doctype($doctype = null)
+ {
+ if (null !== $doctype) {
+ switch ($doctype) {
+ case self::XHTML11:
+ case self::XHTML1_STRICT:
+ case self::XHTML1_TRANSITIONAL:
+ case self::XHTML1_FRAMESET:
+ case self::XHTML_BASIC1:
+ case self::XHTML1_RDFA:
+ case self::XHTML1_RDFA11:
+ case self::XHTML5:
+ case self::HTML4_STRICT:
+ case self::HTML4_LOOSE:
+ case self::HTML4_FRAMESET:
+ case self::HTML5:
+ $this->setDoctype($doctype);
+ break;
+ default:
+ if (substr($doctype, 0, 9) != '<!DOCTYPE') {
+ $e = new Zend_View_Exception('The specified doctype is malformed');
+ $e->setView($this->view);
+ throw $e;
+ }
+ if (stristr($doctype, 'xhtml')) {
+ $type = self::CUSTOM_XHTML;
+ } else {
+ $type = self::CUSTOM;
+ }
+ $this->setDoctype($type);
+ $this->_registry['doctypes'][$type] = $doctype;
+ break;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set doctype
+ *
+ * @param string $doctype
+ * @return Zend_View_Helper_Doctype
+ */
+ public function setDoctype($doctype)
+ {
+ $this->_registry['doctype'] = $doctype;
+ return $this;
+ }
+
+ /**
+ * Retrieve doctype
+ *
+ * @return string
+ */
+ public function getDoctype()
+ {
+ return $this->_registry['doctype'];
+ }
+
+ /**
+ * Get doctype => string mappings
+ *
+ * @return array
+ */
+ public function getDoctypes()
+ {
+ return $this->_registry['doctypes'];
+ }
+
+ /**
+ * Is doctype XHTML?
+ *
+ * @return boolean
+ */
+ public function isXhtml()
+ {
+ return (stristr($this->getDoctype(), 'xhtml') ? true : false);
+ }
+
+ /**
+ * Is doctype strict?
+ *
+ * @return boolean
+ */
+ public function isStrict()
+ {
+ switch ( $this->getDoctype() )
+ {
+ case self::XHTML1_STRICT:
+ case self::XHTML11:
+ case self::HTML4_STRICT:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ /**
+ * Is doctype HTML5? (HeadMeta uses this for validation)
+ *
+ * @return booleean
+ */
+ public function isHtml5() {
+ return (stristr($this->doctype(), '<!DOCTYPE html>') ? true : false);
+ }
+
+ /**
+ * Is doctype RDFa?
+ *
+ * @return booleean
+ */
+ public function isRdfa() {
+ return (stristr($this->getDoctype(), 'rdfa') ? true : false);
+ }
+
+ /**
+ * String representation of doctype
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ $doctypes = $this->getDoctypes();
+ return $doctypes[$this->getDoctype()];
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/Fieldset.php b/library/vendor/Zend/View/Helper/Fieldset.php
new file mode 100644
index 0000000..5456782
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Fieldset.php
@@ -0,0 +1,78 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_FormElement */
+
+/**
+ * Helper for rendering fieldsets
+ *
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_Fieldset extends Zend_View_Helper_FormElement
+{
+ /**
+ * Render HTML form
+ *
+ * @param string $name Form name
+ * @param string $content Form content
+ * @param array $attribs HTML form attributes
+ * @return string
+ */
+ public function fieldset($name, $content, $attribs = null)
+ {
+ $info = $this->_getInfo($name, $content, $attribs);
+ extract($info);
+
+ // get legend
+ $legend = '';
+ if (isset($attribs['legend'])) {
+ $legendString = trim($attribs['legend']);
+ if (!empty($legendString)) {
+ $legend = '<legend>'
+ . (($escape) ? $this->view->escape($legendString) : $legendString)
+ . '</legend>' . PHP_EOL;
+ }
+ unset($attribs['legend']);
+ }
+
+ // get id
+ if (!empty($id)) {
+ $id = ' id="' . $this->view->escape($id) . '"';
+ } else {
+ $id = '';
+ }
+
+ // render fieldset
+ $xhtml = '<fieldset'
+ . $id
+ . $this->_htmlAttribs($attribs)
+ . '>'
+ . $legend
+ . $content
+ . '</fieldset>';
+
+ return $xhtml;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/Form.php b/library/vendor/Zend/View/Helper/Form.php
new file mode 100644
index 0000000..87811d4
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Form.php
@@ -0,0 +1,85 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_FormElement */
+
+/**
+ * Helper for rendering HTML forms
+ *
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_Form extends Zend_View_Helper_FormElement
+{
+ /**
+ * Render HTML form
+ *
+ * @param string $name Form name
+ * @param null|array $attribs HTML form attributes
+ * @param false|string $content Form content
+ * @return string
+ */
+ public function form($name, $attribs = null, $content = false)
+ {
+ $info = $this->_getInfo($name, $content, $attribs);
+ extract($info);
+
+ if (!empty($id)) {
+ $id = ' id="' . $this->view->escape($id) . '"';
+ } else {
+ $id = '';
+ }
+
+ if (array_key_exists('id', $attribs) && empty($attribs['id'])) {
+ unset($attribs['id']);
+ }
+
+ if (!empty($name) && !($this->_isXhtml() && $this->_isStrictDoctype())) {
+ $name = ' name="' . $this->view->escape($name) . '"';
+ } else {
+ $name = '';
+ }
+
+ if ($this->_isHtml5() && array_key_exists('action', $attribs) && !$attribs['action']) {
+ unset($attribs['action']);
+ }
+
+ if ( array_key_exists('name', $attribs) && empty($attribs['id'])) {
+ unset($attribs['id']);
+ }
+
+ $xhtml = '<form'
+ . $id
+ . $name
+ . $this->_htmlAttribs($attribs)
+ . '>';
+
+ if (false !== $content) {
+ $xhtml .= $content
+ . '</form>';
+ }
+
+ return $xhtml;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/FormButton.php b/library/vendor/Zend/View/Helper/FormButton.php
new file mode 100644
index 0000000..312952e
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/FormButton.php
@@ -0,0 +1,104 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Abstract class for extension
+ */
+
+
+/**
+ * Helper to generate a "button" element
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_FormButton extends Zend_View_Helper_FormElement
+{
+ /**
+ * Generates a 'button' element.
+ *
+ * @access public
+ *
+ * @param string|array $name If a string, the element name. If an
+ * array, all other parameters are ignored, and the array elements
+ * are extracted in place of added parameters.
+ *
+ * @param mixed $value The element value.
+ *
+ * @param array $attribs Attributes for the element tag.
+ *
+ * @return string The element XHTML.
+ */
+ public function formButton($name, $value = null, $attribs = null)
+ {
+ $info = $this->_getInfo($name, $value, $attribs);
+ extract($info); // name, id, value, attribs, options, listsep, disable, escape
+
+ // Get content
+ $content = '';
+ if (isset($attribs['content'])) {
+ $content = $attribs['content'];
+ unset($attribs['content']);
+ } else {
+ $content = $value;
+ }
+
+ // Ensure type is sane
+ $type = 'button';
+ if (isset($attribs['type'])) {
+ $attribs['type'] = strtolower($attribs['type']);
+ if (in_array($attribs['type'], array('submit', 'reset', 'button'))) {
+ $type = $attribs['type'];
+ }
+ unset($attribs['type']);
+ }
+
+ // build the element
+ if ($disable) {
+ $attribs['disabled'] = 'disabled';
+ }
+
+ $content = ($escape) ? $this->view->escape($content) : $content;
+
+ $xhtml = '<button'
+ . ' name="' . $this->view->escape($name) . '"'
+ . ' id="' . $this->view->escape($id) . '"'
+ . ' type="' . $type . '"';
+
+ // add a value if one is given
+ if (!empty($value)) {
+ $xhtml .= ' value="' . $this->view->escape($value) . '"';
+ }
+
+ // add attributes and close start tag
+ $xhtml .= $this->_htmlAttribs($attribs) . '>';
+
+ // add content and end tag
+ $xhtml .= $content . '</button>';
+
+ return $xhtml;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/FormCheckbox.php b/library/vendor/Zend/View/Helper/FormCheckbox.php
new file mode 100644
index 0000000..4acf3cb
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/FormCheckbox.php
@@ -0,0 +1,163 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Abstract class for extension
+ */
+
+
+/**
+ * Helper to generate a "checkbox" element
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_FormCheckbox extends Zend_View_Helper_FormElement
+{
+ /**
+ * Default checked/unchecked options
+ * @var array
+ */
+ protected static $_defaultCheckedOptions = array(
+ 'checkedValue' => '1',
+ 'uncheckedValue' => '0'
+ );
+
+ /**
+ * Generates a 'checkbox' element.
+ *
+ * @access public
+ *
+ * @param string|array $name If a string, the element name. If an
+ * array, all other parameters are ignored, and the array elements
+ * are extracted in place of added parameters.
+ * @param mixed $value The element value.
+ * @param array $attribs Attributes for the element tag.
+ * @return string The element XHTML.
+ */
+ public function formCheckbox($name, $value = null, $attribs = null, array $checkedOptions = null)
+ {
+ $info = $this->_getInfo($name, $value, $attribs);
+ extract($info); // name, id, value, attribs, options, listsep, disable
+
+ $checked = false;
+ if (isset($attribs['checked']) && $attribs['checked']) {
+ $checked = true;
+ unset($attribs['checked']);
+ } elseif (isset($attribs['checked'])) {
+ $checked = false;
+ unset($attribs['checked']);
+ }
+
+ $checkedOptions = self::determineCheckboxInfo($value, $checked, $checkedOptions);
+
+ // is the element disabled?
+ $disabled = '';
+ if ($disable) {
+ $disabled = ' disabled="disabled"';
+ }
+
+ // build the element
+ $xhtml = '';
+ if ((!$disable && !strstr($name, '[]'))
+ && (empty($attribs['disableHidden']) || !$attribs['disableHidden'])
+ ) {
+ $xhtml = $this->_hidden($name, $checkedOptions['uncheckedValue']);
+ }
+
+ if (array_key_exists('disableHidden', $attribs)) {
+ unset($attribs['disableHidden']);
+ }
+
+ $xhtml .= '<input type="checkbox"'
+ . ' name="' . $this->view->escape($name) . '"'
+ . ' id="' . $this->view->escape($id) . '"'
+ . ' value="' . $this->view->escape($checkedOptions['checkedValue']) . '"'
+ . $checkedOptions['checkedString']
+ . $disabled
+ . $this->_htmlAttribs($attribs)
+ . $this->getClosingBracket();
+
+ return $xhtml;
+ }
+
+ /**
+ * Determine checkbox information
+ *
+ * @param string $value
+ * @param bool $checked
+ * @param array|null $checkedOptions
+ * @return array
+ */
+ public static function determineCheckboxInfo($value, $checked, array $checkedOptions = null)
+ {
+ // Checked/unchecked values
+ $checkedValue = null;
+ $uncheckedValue = null;
+ if (is_array($checkedOptions)) {
+ if (array_key_exists('checkedValue', $checkedOptions)) {
+ $checkedValue = (string) $checkedOptions['checkedValue'];
+ unset($checkedOptions['checkedValue']);
+ }
+ if (array_key_exists('uncheckedValue', $checkedOptions)) {
+ $uncheckedValue = (string) $checkedOptions['uncheckedValue'];
+ unset($checkedOptions['uncheckedValue']);
+ }
+ if (null === $checkedValue) {
+ $checkedValue = (string) array_shift($checkedOptions);
+ }
+ if (null === $uncheckedValue) {
+ $uncheckedValue = (string) array_shift($checkedOptions);
+ }
+ } elseif ($value !== null) {
+ $uncheckedValue = self::$_defaultCheckedOptions['uncheckedValue'];
+ } else {
+ $checkedValue = self::$_defaultCheckedOptions['checkedValue'];
+ $uncheckedValue = self::$_defaultCheckedOptions['uncheckedValue'];
+ }
+
+ // is the element checked?
+ $checkedString = '';
+ if ($checked || ((string) $value === $checkedValue)) {
+ $checkedString = ' checked="checked"';
+ $checked = true;
+ } else {
+ $checked = false;
+ }
+
+ // Checked value should be value if no checked options provided
+ if ($checkedValue == null) {
+ $checkedValue = $value;
+ }
+
+ return array(
+ 'checked' => $checked,
+ 'checkedString' => $checkedString,
+ 'checkedValue' => $checkedValue,
+ 'uncheckedValue' => $uncheckedValue,
+ );
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/FormElement.php b/library/vendor/Zend/View/Helper/FormElement.php
new file mode 100644
index 0000000..25f77b5
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/FormElement.php
@@ -0,0 +1,202 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_View_Helper_HtmlElement
+ */
+
+/**
+ * Base helper for form elements. Extend this, don't use it on its own.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_View_Helper_FormElement extends Zend_View_Helper_HtmlElement
+{
+ /**
+ * @var Zend_Translate_Adapter|null
+ */
+ protected $_translator;
+
+ /**
+ * Get translator
+ *
+ * @return Zend_Translate_Adapter|null
+ */
+ public function getTranslator()
+ {
+ return $this->_translator;
+ }
+
+ /**
+ * Set translator
+ *
+ * @param Zend_Translate|Zend_Translate_Adapter|null $translator
+ * @return Zend_View_Helper_FormElement
+ */
+ public function setTranslator($translator = null)
+ {
+ if (null === $translator) {
+ $this->_translator = null;
+ } elseif ($translator instanceof Zend_Translate_Adapter) {
+ $this->_translator = $translator;
+ } elseif ($translator instanceof Zend_Translate) {
+ $this->_translator = $translator->getAdapter();
+ } else {
+ $e = new Zend_View_Exception('Invalid translator specified');
+ $e->setView($this->view);
+ throw $e;
+ }
+ return $this;
+ }
+
+ /**
+ * Converts parameter arguments to an element info array.
+ *
+ * E.g, formExample($name, $value, $attribs, $options, $listsep) is
+ * the same thing as formExample(array('name' => ...)).
+ *
+ * Note that you cannot pass a 'disable' param; you need to pass
+ * it as an 'attribs' key.
+ *
+ * @access protected
+ *
+ * @return array An element info array with keys for name, value,
+ * attribs, options, listsep, disable, and escape.
+ */
+ protected function _getInfo($name, $value = null, $attribs = null,
+ $options = null, $listsep = null
+ ) {
+ // the baseline info. note that $name serves a dual purpose;
+ // if an array, it's an element info array that will override
+ // these baseline values. as such, ignore it for the 'name'
+ // if it's an array.
+ $info = array(
+ 'name' => is_array($name) ? '' : $name,
+ 'id' => is_array($name) ? '' : $name,
+ 'value' => $value,
+ 'attribs' => $attribs,
+ 'options' => $options,
+ 'listsep' => $listsep,
+ 'disable' => false,
+ 'escape' => true,
+ );
+
+ // override with named args
+ if (is_array($name)) {
+ // only set keys that are already in info
+ foreach ($info as $key => $val) {
+ if (isset($name[$key])) {
+ $info[$key] = $name[$key];
+ }
+ }
+
+ // If all helper options are passed as an array, attribs may have
+ // been as well
+ if (null === $attribs) {
+ $attribs = $info['attribs'];
+ }
+ }
+
+ $attribs = (array)$attribs;
+
+ // Normalize readonly tag
+ if (array_key_exists('readonly', $attribs)) {
+ $attribs['readonly'] = 'readonly';
+ }
+
+ // Disable attribute
+ if (array_key_exists('disable', $attribs)) {
+ if (is_scalar($attribs['disable'])) {
+ // disable the element
+ $info['disable'] = (bool)$attribs['disable'];
+ } else if (is_array($attribs['disable'])) {
+ $info['disable'] = $attribs['disable'];
+ }
+ }
+
+ // Set ID for element
+ if (array_key_exists('id', $attribs)) {
+ $info['id'] = (string)$attribs['id'];
+ } else if ('' !== $info['name']) {
+ $info['id'] = trim(strtr($info['name'],
+ array('[' => '-', ']' => '')), '-');
+ }
+
+ // Remove NULL name attribute override
+ if (array_key_exists('name', $attribs) && is_null($attribs['name'])) {
+ unset($attribs['name']);
+ }
+
+ // Override name in info if specified in attribs
+ if (array_key_exists('name', $attribs) && $attribs['name'] != $info['name']) {
+ $info['name'] = $attribs['name'];
+ }
+
+ // Determine escaping from attributes
+ if (array_key_exists('escape', $attribs)) {
+ $info['escape'] = (bool)$attribs['escape'];
+ }
+
+ // Determine listsetp from attributes
+ if (array_key_exists('listsep', $attribs)) {
+ $info['listsep'] = (string)$attribs['listsep'];
+ }
+
+ // Remove attribs that might overwrite the other keys. We do this LAST
+ // because we needed the other attribs values earlier.
+ foreach ($info as $key => $val) {
+ if (array_key_exists($key, $attribs)) {
+ unset($attribs[$key]);
+ }
+ }
+ $info['attribs'] = $attribs;
+
+ // done!
+ return $info;
+ }
+
+ /**
+ * Creates a hidden element.
+ *
+ * We have this as a common method because other elements often
+ * need hidden elements for their operation.
+ *
+ * @access protected
+ *
+ * @param string $name The element name.
+ * @param string $value The element value.
+ * @param array $attribs Attributes for the element.
+ *
+ * @return string A hidden element.
+ */
+ protected function _hidden($name, $value = null, $attribs = null)
+ {
+ return '<input type="hidden"'
+ . ' name="' . $this->view->escape($name) . '"'
+ . ' value="' . $this->view->escape($value) . '"'
+ . $this->_htmlAttribs($attribs) . $this->getClosingBracket();
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/FormErrors.php b/library/vendor/Zend/View/Helper/FormErrors.php
new file mode 100644
index 0000000..b57d851
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/FormErrors.php
@@ -0,0 +1,166 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Abstract class for extension
+ */
+
+
+/**
+ * Helper to render errors for a form element
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_FormErrors extends Zend_View_Helper_FormElement
+{
+ /**
+ * @var Zend_Form_Element
+ */
+ protected $_element;
+
+ /**#@+
+ * @var string Element block start/end tags and separator
+ */
+ protected $_htmlElementEnd = '</li></ul>';
+ protected $_htmlElementStart = '<ul%s><li>';
+ protected $_htmlElementSeparator = '</li><li>';
+ /**#@-*/
+
+ /**
+ * Render form errors
+ *
+ * @param string|array $errors Error(s) to render
+ * @param array $options
+ * @return string
+ */
+ public function formErrors($errors, array $options = null)
+ {
+ $escape = true;
+ if (isset($options['escape'])) {
+ $escape = (bool) $options['escape'];
+ unset($options['escape']);
+ }
+
+ if (empty($options['class'])) {
+ $options['class'] = 'errors';
+ }
+
+ if (isset($options['elementStart'])) {
+ $this->setElementStart($options['elementStart']);
+ }
+ if (isset($options['elementEnd'])) {
+ $this->setElementEnd($options['elementEnd']);
+ }
+ if (isset($options['elementSeparator'])) {
+ $this->setElementSeparator($options['elementSeparator']);
+ }
+
+ $start = $this->getElementStart();
+ if (strstr($start, '%s')) {
+ $attribs = $this->_htmlAttribs($options);
+ $start = sprintf($start, $attribs);
+ }
+
+ if ($escape) {
+ foreach ($errors as $key => $error) {
+ $errors[$key] = $this->view->escape($error);
+ }
+ }
+
+ $html = $start
+ . implode($this->getElementSeparator(), (array) $errors)
+ . $this->getElementEnd();
+
+ return $html;
+ }
+
+ /**
+ * Set end string for displaying errors
+ *
+ * @param string $string
+ * @return Zend_View_Helper_FormErrors
+ */
+ public function setElementEnd($string)
+ {
+ $this->_htmlElementEnd = (string) $string;
+ return $this;
+ }
+
+ /**
+ * Retrieve end string for displaying errors
+ *
+ * @return string
+ */
+ public function getElementEnd()
+ {
+ return $this->_htmlElementEnd;
+ }
+
+ /**
+ * Set separator string for displaying errors
+ *
+ * @param string $string
+ * @return Zend_View_Helper_FormErrors
+ */
+ public function setElementSeparator($string)
+ {
+ $this->_htmlElementSeparator = (string) $string;
+ return $this;
+ }
+
+ /**
+ * Retrieve separator string for displaying errors
+ *
+ * @return string
+ */
+ public function getElementSeparator()
+ {
+ return $this->_htmlElementSeparator;
+ }
+
+ /**
+ * Set start string for displaying errors
+ *
+ * @param string $string
+ * @return Zend_View_Helper_FormErrors
+ */
+ public function setElementStart($string)
+ {
+ $this->_htmlElementStart = (string) $string;
+ return $this;
+ }
+
+ /**
+ * Retrieve start string for displaying errors
+ *
+ * @return string
+ */
+ public function getElementStart()
+ {
+ return $this->_htmlElementStart;
+ }
+
+}
diff --git a/library/vendor/Zend/View/Helper/FormFile.php b/library/vendor/Zend/View/Helper/FormFile.php
new file mode 100644
index 0000000..24a37db
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/FormFile.php
@@ -0,0 +1,74 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Abstract class for extension
+ */
+
+
+/**
+ * Helper to generate a "file" element
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_FormFile extends Zend_View_Helper_FormElement
+{
+ /**
+ * Generates a 'file' element.
+ *
+ * @access public
+ *
+ * @param string|array $name If a string, the element name. If an
+ * array, all other parameters are ignored, and the array elements
+ * are extracted in place of added parameters.
+ *
+ * @param array $attribs Attributes for the element tag.
+ *
+ * @return string The element XHTML.
+ */
+ public function formFile($name, $attribs = null)
+ {
+ $info = $this->_getInfo($name, null, $attribs);
+ extract($info); // name, id, value, attribs, options, listsep, disable
+
+ // is it disabled?
+ $disabled = '';
+ if ($disable) {
+ $disabled = ' disabled="disabled"';
+ }
+
+ // build the element
+ $xhtml = '<input type="file"'
+ . ' name="' . $this->view->escape($name) . '"'
+ . ' id="' . $this->view->escape($id) . '"'
+ . $disabled
+ . $this->_htmlAttribs($attribs)
+ . $this->getClosingBracket();
+
+ return $xhtml;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/FormHidden.php b/library/vendor/Zend/View/Helper/FormHidden.php
new file mode 100644
index 0000000..36c9c9b
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/FormHidden.php
@@ -0,0 +1,65 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Abstract class for extension
+ */
+
+
+/**
+ * Helper to generate a "hidden" element
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_FormHidden extends Zend_View_Helper_FormElement
+{
+ /**
+ * Generates a 'hidden' element.
+ *
+ * @access public
+ *
+ * @param string|array $name If a string, the element name. If an
+ * array, all other parameters are ignored, and the array elements
+ * are extracted in place of added parameters.
+ * @param mixed $value The element value.
+ * @param array $attribs Attributes for the element tag.
+ * @return string The element XHTML.
+ */
+ public function formHidden($name, $value = null, array $attribs = null)
+ {
+ $info = $this->_getInfo($name, $value, $attribs);
+ extract($info); // name, value, attribs, options, listsep, disable
+ if (isset($id)) {
+ if (isset($attribs) && is_array($attribs)) {
+ $attribs['id'] = $id;
+ } else {
+ $attribs = array('id' => $id);
+ }
+ }
+ return $this->_hidden($name, $value, $attribs);
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/FormImage.php b/library/vendor/Zend/View/Helper/FormImage.php
new file mode 100644
index 0000000..31d6545
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/FormImage.php
@@ -0,0 +1,94 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Abstract class for extension
+ */
+
+
+/**
+ * Helper to generate an "image" element
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_FormImage extends Zend_View_Helper_FormElement
+{
+ /**
+ * Generates an 'image' element.
+ *
+ * @access public
+ *
+ * @param string|array $name If a string, the element name. If an
+ * array, all other parameters are ignored, and the array elements
+ * are extracted in place of added parameters.
+ *
+ * @param mixed $value The source ('src="..."') for the image.
+ *
+ * @param array $attribs Attributes for the element tag.
+ *
+ * @return string The element XHTML.
+ */
+ public function formImage($name, $value = null, $attribs = null)
+ {
+ $info = $this->_getInfo($name, $value, $attribs);
+ extract($info); // name, value, attribs, options, listsep, disable
+
+ // Determine if we should use the value or the src attribute
+ if (isset($attribs['src'])) {
+ $src = ' src="' . $this->view->escape($attribs['src']) . '"';
+ unset($attribs['src']);
+ } else {
+ $src = ' src="' . $this->view->escape($value) . '"';
+ unset($value);
+ }
+
+ // Do we have a value?
+ if (isset($value) && !empty($value)) {
+ $value = ' value="' . $this->view->escape($value) . '"';
+ } else {
+ $value = '';
+ }
+
+ // Disabled?
+ $disabled = '';
+ if ($disable) {
+ $disabled = ' disabled="disabled"';
+ }
+
+ // build the element
+ $xhtml = '<input type="image"'
+ . ' name="' . $this->view->escape($name) . '"'
+ . ' id="' . $this->view->escape($id) . '"'
+ . $src
+ . $value
+ . $disabled
+ . $this->_htmlAttribs($attribs)
+ . $this->getClosingBracket();
+
+ return $xhtml;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/FormLabel.php b/library/vendor/Zend/View/Helper/FormLabel.php
new file mode 100644
index 0000000..8b5fa71
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/FormLabel.php
@@ -0,0 +1,71 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_View_Helper_FormElement **/
+
+/**
+ * Form label helper
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_FormLabel extends Zend_View_Helper_FormElement
+{
+ /**
+ * Generates a 'label' element.
+ *
+ * @param string $name The form element name for which the label is being generated
+ * @param string $value The label text
+ * @param array $attribs Form element attributes (used to determine if disabled)
+ * @return string The element XHTML.
+ */
+ public function formLabel($name, $value = null, array $attribs = null)
+ {
+ $info = $this->_getInfo($name, $value, $attribs);
+ extract($info); // name, value, attribs, options, listsep, disable, escape
+
+ // build the element
+ if ($disable) {
+ // disabled; display nothing
+ return '';
+ }
+
+ $value = ($escape) ? $this->view->escape($value) : $value;
+ $for = (empty($attribs['disableFor']) || !$attribs['disableFor'])
+ ? ' for="' . $this->view->escape($id) . '"'
+ : '';
+ if (array_key_exists('disableFor', $attribs)) {
+ unset($attribs['disableFor']);
+ }
+
+ // enabled; display label
+ $xhtml = '<label'
+ . $for
+ . $this->_htmlAttribs($attribs)
+ . '>' . $value . '</label>';
+
+ return $xhtml;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/FormMultiCheckbox.php b/library/vendor/Zend/View/Helper/FormMultiCheckbox.php
new file mode 100644
index 0000000..3147369
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/FormMultiCheckbox.php
@@ -0,0 +1,73 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/** Zend_View_Helper_FormRadio */
+
+
+/**
+ * Helper to generate a set of checkbox button elements
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_FormMultiCheckbox extends Zend_View_Helper_FormRadio
+{
+ /**
+ * Input type to use
+ * @var string
+ */
+ protected $_inputType = 'checkbox';
+
+ /**
+ * Whether or not this element represents an array collection by default
+ * @var bool
+ */
+ protected $_isArray = true;
+
+ /**
+ * Generates a set of checkbox button elements.
+ *
+ * @access public
+ *
+ * @param string|array $name If a string, the element name. If an
+ * array, all other parameters are ignored, and the array elements
+ * are extracted in place of added parameters.
+ *
+ * @param mixed $value The checkbox value to mark as 'checked'.
+ *
+ * @param array $options An array of key-value pairs where the array
+ * key is the checkbox value, and the array value is the radio text.
+ *
+ * @param array|string $attribs Attributes added to each radio.
+ *
+ * @return string The radio buttons XHTML.
+ */
+ public function formMultiCheckbox($name, $value = null, $attribs = null,
+ $options = null, $listsep = "<br />\n")
+ {
+ return $this->formRadio($name, $value, $attribs, $options, $listsep);
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/FormNote.php b/library/vendor/Zend/View/Helper/FormNote.php
new file mode 100644
index 0000000..adeb411
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/FormNote.php
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Abstract class for extension
+ */
+
+
+/**
+ * Helper to show an HTML note
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_FormNote extends Zend_View_Helper_FormElement
+{
+ /**
+ * Helper to show a "note" based on a hidden value.
+ *
+ * @access public
+ *
+ * @param string|array $name If a string, the element name. If an
+ * array, all other parameters are ignored, and the array elements
+ * are extracted in place of added parameters.
+ *
+ * @param array $value The note to display. HTML is *not* escaped; the
+ * note is displayed as-is.
+ *
+ * @return string The element XHTML.
+ */
+ public function formNote($name, $value = null)
+ {
+ $info = $this->_getInfo($name, $value);
+ extract($info); // name, value, attribs, options, listsep, disable
+ return $value;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/FormPassword.php b/library/vendor/Zend/View/Helper/FormPassword.php
new file mode 100644
index 0000000..3cd880d
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/FormPassword.php
@@ -0,0 +1,88 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Abstract class for extension
+ */
+
+
+/**
+ * Helper to generate a "password" element
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_FormPassword extends Zend_View_Helper_FormElement
+{
+ /**
+ * Generates a 'password' element.
+ *
+ * @access public
+ *
+ * @param string|array $name If a string, the element name. If an
+ * array, all other parameters are ignored, and the array elements
+ * are extracted in place of added parameters.
+ *
+ * @param mixed $value The element value.
+ *
+ * @param array $attribs Attributes for the element tag.
+ *
+ * @return string The element XHTML.
+ */
+ public function formPassword($name, $value = null, $attribs = null)
+ {
+ $info = $this->_getInfo($name, $value, $attribs);
+ extract($info); // name, value, attribs, options, listsep, disable
+
+ // is it disabled?
+ $disabled = '';
+ if ($disable) {
+ // disabled
+ $disabled = ' disabled="disabled"';
+ }
+
+ // determine the XHTML value
+ $valueString = ' value=""';
+ if (array_key_exists('renderPassword', $attribs)) {
+ if ($attribs['renderPassword']) {
+ $valueString = ' value="' . $this->view->escape($value) . '"';
+ }
+ unset($attribs['renderPassword']);
+ }
+
+ // render the element
+ $xhtml = '<input type="password"'
+ . ' name="' . $this->view->escape($name) . '"'
+ . ' id="' . $this->view->escape($id) . '"'
+ . $valueString
+ . $disabled
+ . $this->_htmlAttribs($attribs)
+ . $this->getClosingBracket();
+
+ return $xhtml;
+ }
+
+}
diff --git a/library/vendor/Zend/View/Helper/FormRadio.php b/library/vendor/Zend/View/Helper/FormRadio.php
new file mode 100644
index 0000000..b67c0d6
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/FormRadio.php
@@ -0,0 +1,185 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Abstract class for extension
+ */
+
+
+/**
+ * Helper to generate a set of radio button elements
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_FormRadio extends Zend_View_Helper_FormElement
+{
+ /**
+ * Input type to use
+ * @var string
+ */
+ protected $_inputType = 'radio';
+
+ /**
+ * Whether or not this element represents an array collection by default
+ * @var bool
+ */
+ protected $_isArray = false;
+
+ /**
+ * Generates a set of radio button elements.
+ *
+ * @access public
+ *
+ * @param string|array $name If a string, the element name. If an
+ * array, all other parameters are ignored, and the array elements
+ * are extracted in place of added parameters.
+ *
+ * @param mixed $value The radio value to mark as 'checked'.
+ *
+ * @param array $options An array of key-value pairs where the array
+ * key is the radio value, and the array value is the radio text.
+ *
+ * @param array|string $attribs Attributes added to each radio.
+ *
+ * @return string The radio buttons XHTML.
+ */
+ public function formRadio($name, $value = null, $attribs = null,
+ $options = null, $listsep = "<br />\n")
+ {
+
+ $info = $this->_getInfo($name, $value, $attribs, $options, $listsep);
+ extract($info); // name, value, attribs, options, listsep, disable
+
+ // retrieve attributes for labels (prefixed with 'label_' or 'label')
+ $label_attribs = array();
+ foreach ($attribs as $key => $val) {
+ $tmp = false;
+ $keyLen = strlen($key);
+ if ((6 < $keyLen) && (substr($key, 0, 6) == 'label_')) {
+ $tmp = substr($key, 6);
+ } elseif ((5 < $keyLen) && (substr($key, 0, 5) == 'label')) {
+ $tmp = substr($key, 5);
+ }
+
+ if ($tmp) {
+ // make sure first char is lowercase
+ $tmp[0] = strtolower($tmp[0]);
+ $label_attribs[$tmp] = $val;
+ unset($attribs[$key]);
+ }
+ }
+
+ $labelPlacement = 'append';
+ foreach ($label_attribs as $key => $val) {
+ switch (strtolower($key)) {
+ case 'placement':
+ unset($label_attribs[$key]);
+ $val = strtolower($val);
+ if (in_array($val, array('prepend', 'append'))) {
+ $labelPlacement = $val;
+ }
+ break;
+ }
+ }
+
+ // the radio button values and labels
+ $options = (array) $options;
+
+ // build the element
+ $xhtml = '';
+ $list = array();
+
+ // should the name affect an array collection?
+ $name = $this->view->escape($name);
+ if ($this->_isArray && ('[]' != substr($name, -2))) {
+ $name .= '[]';
+ }
+
+ // ensure value is an array to allow matching multiple times
+ $value = (array) $value;
+
+ // Set up the filter - Alnum + hyphen + underscore
+ $pattern = @preg_match('/\pL/u', 'a')
+ ? '/[^\p{L}\p{N}\-\_]/u' // Unicode
+ : '/[^a-zA-Z0-9\-\_]/'; // No Unicode
+ $filter = new Zend_Filter_PregReplace($pattern, "");
+
+ // add radio buttons to the list.
+ foreach ($options as $opt_value => $opt_label) {
+
+ // Should the label be escaped?
+ if ($escape) {
+ $opt_label = $this->view->escape($opt_label);
+ }
+
+ // is it disabled?
+ $disabled = '';
+ if (true === $disable) {
+ $disabled = ' disabled="disabled"';
+ } elseif (is_array($disable) && in_array($opt_value, $disable)) {
+ $disabled = ' disabled="disabled"';
+ }
+
+ // is it checked?
+ $checked = '';
+ if (in_array($opt_value, $value)) {
+ $checked = ' checked="checked"';
+ }
+
+ // generate ID
+ $optId = $id . '-' . $filter->filter($opt_value);
+
+ // Wrap the radios in labels
+ $radio = '<label'
+ . $this->_htmlAttribs($label_attribs) . '>'
+ . (('prepend' == $labelPlacement) ? $opt_label : '')
+ . '<input type="' . $this->_inputType . '"'
+ . ' name="' . $name . '"'
+ . ' id="' . $optId . '"'
+ . ' value="' . $this->view->escape($opt_value) . '"'
+ . $checked
+ . $disabled
+ . $this->_htmlAttribs($attribs)
+ . $this->getClosingBracket()
+ . (('append' == $labelPlacement) ? $opt_label : '')
+ . '</label>';
+
+ // add to the array of radio buttons
+ $list[] = $radio;
+ }
+
+ // XHTML or HTML for standard list separator?
+ if (!$this->_isXhtml() && false !== strpos($listsep, '<br />')) {
+ $listsep = str_replace('<br />', '<br>', $listsep);
+ }
+
+ // done!
+ $xhtml .= implode($listsep, $list);
+
+ return $xhtml;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/FormReset.php b/library/vendor/Zend/View/Helper/FormReset.php
new file mode 100644
index 0000000..d6276f6
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/FormReset.php
@@ -0,0 +1,81 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Abstract class for extension
+ */
+
+
+/**
+ * Helper to generate a "reset" button
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_FormReset extends Zend_View_Helper_FormElement
+{
+ /**
+ * Generates a 'reset' button.
+ *
+ * @access public
+ *
+ * @param string|array $name If a string, the element name. If an
+ * array, all other parameters are ignored, and the array elements
+ * are extracted in place of added parameters.
+ *
+ * @param mixed $value The element value.
+ *
+ * @param array $attribs Attributes for the element tag.
+ *
+ * @return string The element XHTML.
+ */
+ public function formReset($name = '', $value = 'Reset', $attribs = null)
+ {
+ $info = $this->_getInfo($name, $value, $attribs);
+ extract($info); // name, value, attribs, options, listsep, disable
+
+ // check if disabled
+ $disabled = '';
+ if ($disable) {
+ $disabled = ' disabled="disabled"';
+ }
+
+ // Render button
+ $xhtml = '<input type="reset"'
+ . ' name="' . $this->view->escape($name) . '"'
+ . ' id="' . $this->view->escape($id) . '"'
+ . $disabled;
+
+ // add a value if one is given
+ if (! empty($value)) {
+ $xhtml .= ' value="' . $this->view->escape($value) . '"';
+ }
+
+ // add attributes, close, and return
+ $xhtml .= $this->_htmlAttribs($attribs) . $this->getClosingBracket();
+ return $xhtml;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/FormSelect.php b/library/vendor/Zend/View/Helper/FormSelect.php
new file mode 100644
index 0000000..82709b1
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/FormSelect.php
@@ -0,0 +1,199 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Abstract class for extension
+ */
+
+
+/**
+ * Helper to generate "select" list of options
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_FormSelect extends Zend_View_Helper_FormElement
+{
+ /**
+ * Generates 'select' list of options.
+ *
+ * @access public
+ *
+ * @param string|array $name If a string, the element name. If an
+ * array, all other parameters are ignored, and the array elements
+ * are extracted in place of added parameters.
+ *
+ * @param mixed $value The option value to mark as 'selected'; if an
+ * array, will mark all values in the array as 'selected' (used for
+ * multiple-select elements).
+ *
+ * @param array|string $attribs Attributes added to the 'select' tag.
+ * the optional 'optionClasses' attribute is used to add a class to
+ * the options within the select (associative array linking the option
+ * value to the desired class)
+ *
+ * @param array $options An array of key-value pairs where the array
+ * key is the radio value, and the array value is the radio text.
+ *
+ * @param string $listsep When disabled, use this list separator string
+ * between list values.
+ *
+ * @return string The select tag and options XHTML.
+ */
+ public function formSelect($name, $value = null, $attribs = null,
+ $options = null, $listsep = "<br />\n")
+ {
+ $info = $this->_getInfo($name, $value, $attribs, $options, $listsep);
+ extract($info); // name, id, value, attribs, options, listsep, disable
+
+ // force $value to array so we can compare multiple values to multiple
+ // options; also ensure it's a string for comparison purposes.
+ $value = array_map('strval', (array) $value);
+
+ // check if element may have multiple values
+ $multiple = '';
+
+ if (substr($name, -2) == '[]') {
+ // multiple implied by the name
+ $multiple = ' multiple="multiple"';
+ }
+
+ if (isset($attribs['multiple'])) {
+ // Attribute set
+ if ($attribs['multiple']) {
+ // True attribute; set multiple attribute
+ $multiple = ' multiple="multiple"';
+
+ // Make sure name indicates multiple values are allowed
+ if (!empty($multiple) && (substr($name, -2) != '[]')) {
+ $name .= '[]';
+ }
+ } else {
+ // False attribute; ensure attribute not set
+ $multiple = '';
+ }
+ unset($attribs['multiple']);
+ }
+
+ // handle the options classes
+ $optionClasses = array();
+ if (isset($attribs['optionClasses'])) {
+ $optionClasses = $attribs['optionClasses'];
+ unset($attribs['optionClasses']);
+ }
+
+ // now start building the XHTML.
+ $disabled = '';
+ if (true === $disable) {
+ $disabled = ' disabled="disabled"';
+ }
+
+ // Build the surrounding select element first.
+ $xhtml = '<select'
+ . ' name="' . $this->view->escape($name) . '"'
+ . ' id="' . $this->view->escape($id) . '"'
+ . $multiple
+ . $disabled
+ . $this->_htmlAttribs($attribs)
+ . ">\n ";
+
+ // build the list of options
+ $list = array();
+ $translator = $this->getTranslator();
+ foreach ((array) $options as $opt_value => $opt_label) {
+ if (is_array($opt_label)) {
+ $opt_disable = '';
+ if (is_array($disable) && in_array($opt_value, $disable)) {
+ $opt_disable = ' disabled="disabled"';
+ }
+ if (null !== $translator) {
+ $opt_value = $translator->translate($opt_value);
+ }
+ $opt_id = ' id="' . $this->view->escape($id) . '-optgroup-'
+ . $this->view->escape($opt_value) . '"';
+ $list[] = '<optgroup'
+ . $opt_disable
+ . $opt_id
+ . ' label="' . $this->view->escape($opt_value) .'">';
+ foreach ($opt_label as $val => $lab) {
+ $list[] = $this->_build($val, $lab, $value, $disable, $optionClasses);
+ }
+ $list[] = '</optgroup>';
+ } else {
+ $list[] = $this->_build($opt_value, $opt_label, $value, $disable, $optionClasses);
+ }
+ }
+
+ // add the options to the xhtml and close the select
+ $xhtml .= implode("\n ", $list) . "\n</select>";
+
+ return $xhtml;
+ }
+
+ /**
+ * Builds the actual <option> tag
+ *
+ * @param string $value Options Value
+ * @param string $label Options Label
+ * @param array $selected The option value(s) to mark as 'selected'
+ * @param array|bool $disable Whether the select is disabled, or individual options are
+ * @param array $optionClasses The classes to associate with each option value
+ * @return string Option Tag XHTML
+ */
+ protected function _build($value, $label, $selected, $disable, $optionClasses = array())
+ {
+ if (is_bool($disable)) {
+ $disable = array();
+ }
+
+ $class = null;
+ if (array_key_exists($value, $optionClasses)) {
+ $class = $optionClasses[$value];
+ }
+
+
+ $opt = '<option'
+ . ' value="' . $this->view->escape($value) . '"';
+
+ if ($class) {
+ $opt .= ' class="' . $class . '"';
+ }
+ // selected?
+ if (in_array((string) $value, $selected)) {
+ $opt .= ' selected="selected"';
+ }
+
+ // disabled?
+ if (in_array($value, $disable)) {
+ $opt .= ' disabled="disabled"';
+ }
+
+ $opt .= '>' . $this->view->escape($label) . "</option>";
+
+ return $opt;
+ }
+
+}
diff --git a/library/vendor/Zend/View/Helper/FormSubmit.php b/library/vendor/Zend/View/Helper/FormSubmit.php
new file mode 100644
index 0000000..959feb1
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/FormSubmit.php
@@ -0,0 +1,80 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Abstract class for extension
+ */
+
+
+/**
+ * Helper to generate a "submit" button
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_FormSubmit extends Zend_View_Helper_FormElement
+{
+ /**
+ * Generates a 'submit' button.
+ *
+ * @access public
+ *
+ * @param string|array $name If a string, the element name. If an
+ * array, all other parameters are ignored, and the array elements
+ * are extracted in place of added parameters.
+ *
+ * @param mixed $value The element value.
+ *
+ * @param array $attribs Attributes for the element tag.
+ *
+ * @return string The element XHTML.
+ */
+ public function formSubmit($name, $value = null, $attribs = null)
+ {
+ $info = $this->_getInfo($name, $value, $attribs);
+ extract($info); // name, value, attribs, options, listsep, disable, id
+ // check if disabled
+ $disabled = '';
+ if ($disable) {
+ $disabled = ' disabled="disabled"';
+ }
+
+ if ($id) {
+ $id = ' id="' . $this->view->escape($id) . '"';
+ }
+
+ // Render the button.
+ $xhtml = '<input type="submit"'
+ . ' name="' . $this->view->escape($name) . '"'
+ . $id
+ . ' value="' . $this->view->escape($value) . '"'
+ . $disabled
+ . $this->_htmlAttribs($attribs)
+ . $this->getClosingBracket();
+
+ return $xhtml;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/FormText.php b/library/vendor/Zend/View/Helper/FormText.php
new file mode 100644
index 0000000..8b2dbd9
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/FormText.php
@@ -0,0 +1,77 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Abstract class for extension
+ */
+
+
+/**
+ * Helper to generate a "text" element
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_FormText extends Zend_View_Helper_FormElement
+{
+ /**
+ * Generates a 'text' element.
+ *
+ * @access public
+ *
+ * @param string|array $name If a string, the element name. If an
+ * array, all other parameters are ignored, and the array elements
+ * are used in place of added parameters.
+ *
+ * @param mixed $value The element value.
+ *
+ * @param array $attribs Attributes for the element tag.
+ *
+ * @return string The element XHTML.
+ */
+ public function formText($name, $value = null, $attribs = null)
+ {
+ $info = $this->_getInfo($name, $value, $attribs);
+ extract($info); // name, value, attribs, options, listsep, disable
+
+ // build the element
+ $disabled = '';
+ if ($disable) {
+ // disabled
+ $disabled = ' disabled="disabled"';
+ }
+
+ $xhtml = '<input type="text"'
+ . ' name="' . $this->view->escape($name) . '"'
+ . ' id="' . $this->view->escape($id) . '"'
+ . ' value="' . $this->view->escape($value) . '"'
+ . $disabled
+ . $this->_htmlAttribs($attribs)
+ . $this->getClosingBracket();
+
+ return $xhtml;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/FormTextarea.php b/library/vendor/Zend/View/Helper/FormTextarea.php
new file mode 100644
index 0000000..7fa8442
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/FormTextarea.php
@@ -0,0 +1,103 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Abstract class for extension
+ */
+
+
+/**
+ * Helper to generate a "textarea" element
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_FormTextarea extends Zend_View_Helper_FormElement
+{
+ /**
+ * The default number of rows for a textarea.
+ *
+ * @access public
+ *
+ * @var int
+ */
+ public $rows = 24;
+
+ /**
+ * The default number of columns for a textarea.
+ *
+ * @access public
+ *
+ * @var int
+ */
+ public $cols = 80;
+
+ /**
+ * Generates a 'textarea' element.
+ *
+ * @access public
+ *
+ * @param string|array $name If a string, the element name. If an
+ * array, all other parameters are ignored, and the array elements
+ * are extracted in place of added parameters.
+ *
+ * @param mixed $value The element value.
+ *
+ * @param array $attribs Attributes for the element tag.
+ *
+ * @return string The element XHTML.
+ */
+ public function formTextarea($name, $value = null, $attribs = null)
+ {
+ $info = $this->_getInfo($name, $value, $attribs);
+ extract($info); // name, value, attribs, options, listsep, disable
+
+ // is it disabled?
+ $disabled = '';
+ if ($disable) {
+ // disabled.
+ $disabled = ' disabled="disabled"';
+ }
+
+ // Make sure that there are 'rows' and 'cols' values
+ // as required by the spec. noted by Orjan Persson.
+ if (empty($attribs['rows'])) {
+ $attribs['rows'] = (int) $this->rows;
+ }
+ if (empty($attribs['cols'])) {
+ $attribs['cols'] = (int) $this->cols;
+ }
+
+ // build the element
+ $xhtml = '<textarea name="' . $this->view->escape($name) . '"'
+ . ' id="' . $this->view->escape($id) . '"'
+ . $disabled
+ . $this->_htmlAttribs($attribs) . '>'
+ . $this->view->escape($value) . '</textarea>';
+
+ return $xhtml;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/Gravatar.php b/library/vendor/Zend/View/Helper/Gravatar.php
new file mode 100644
index 0000000..1afc4cb
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Gravatar.php
@@ -0,0 +1,361 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id: Doctype.php 16971 2009-07-22 18:05:45Z mikaelkael $
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_HtmlElement */
+
+/**
+ * Helper for retrieving avatars from gravatar.com
+ *
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @link http://pl.gravatar.com/site/implement/url
+ */
+class Zend_View_Helper_Gravatar extends Zend_View_Helper_HtmlElement
+{
+
+ /**
+ * URL to gravatar service
+ */
+ const GRAVATAR_URL = 'http://www.gravatar.com/avatar';
+ /**
+ * Secure URL to gravatar service
+ */
+ const GRAVATAR_URL_SECURE = 'https://secure.gravatar.com/avatar';
+
+ /**
+ * Gravatar rating
+ */
+ const RATING_G = 'g';
+ const RATING_PG = 'pg';
+ const RATING_R = 'r';
+ const RATING_X = 'x';
+
+ /**
+ * Default gravatar image value constants
+ */
+ const DEFAULT_404 = '404';
+ const DEFAULT_MM = 'mm';
+ const DEFAULT_IDENTICON = 'identicon';
+ const DEFAULT_MONSTERID = 'monsterid';
+ const DEFAULT_WAVATAR = 'wavatar';
+
+ /**
+ * Options
+ *
+ * @var array
+ */
+ protected $_options = array(
+ 'img_size' => 80,
+ 'default_img' => self::DEFAULT_MM,
+ 'rating' => self::RATING_G,
+ 'secure' => null,
+ );
+
+ /**
+ * Email Adress
+ *
+ * @var string
+ */
+ protected $_email;
+
+ /**
+ * Attributes for HTML image tag
+ *
+ * @var array
+ */
+ protected $_attribs;
+
+ /**
+ * Returns an avatar from gravatar's service.
+ *
+ * $options may include the following:
+ * - 'img_size' int height of img to return
+ * - 'default_img' string img to return if email adress has not found
+ * - 'rating' string rating parameter for avatar
+ * - 'secure' bool load from the SSL or Non-SSL location
+ *
+ * @see http://pl.gravatar.com/site/implement/url
+ * @see http://pl.gravatar.com/site/implement/url More information about gravatar's service.
+ * @param string|null $email Email adress.
+ * @param null|array $options Options
+ * @param array $attribs Attributes for image tag (title, alt etc.)
+ * @return Zend_View_Helper_Gravatar
+ */
+ public function gravatar($email = "", $options = array(), $attribs = array())
+ {
+ $this->setEmail($email);
+ $this->setOptions($options);
+ $this->setAttribs($attribs);
+ return $this;
+ }
+
+ /**
+ * Configure state
+ *
+ * @param array $options
+ * @return Zend_View_Helper_Gravatar
+ */
+ public function setOptions(array $options)
+ {
+ foreach ($options as $key => $value) {
+ $method = 'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key)));
+ if (method_exists($this, $method)) {
+ $this->{$method}($value);
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Get img size
+ *
+ * @return int The img size
+ */
+ public function getImgSize()
+ {
+ return $this->_options['img_size'];
+ }
+
+ /**
+ * Set img size in pixels
+ *
+ * @param int $imgSize Size of img must be between 1 and 512
+ * @return Zend_View_Helper_Gravatar
+ */
+ public function setImgSize($imgSize)
+ {
+ $this->_options['img_size'] = (int) $imgSize;
+ return $this;
+ }
+
+ /**
+ * Get default img
+ *
+ * @return string
+ */
+ public function getDefaultImg()
+ {
+ return $this->_options['default_img'];
+ }
+
+ /**
+ * Set default img
+ *
+ * Can be either an absolute URL to an image, or one of the DEFAULT_* constants
+ *
+ * @param string $defaultImg
+ * @link http://pl.gravatar.com/site/implement/url More information about default image.
+ * @return Zend_View_Helper_Gravatar
+ */
+ public function setDefaultImg($defaultImg)
+ {
+ $this->_options['default_img'] = urlencode($defaultImg);
+ return $this;
+ }
+
+ /**
+ * Set rating value
+ *
+ * Must be one of the RATING_* constants
+ *
+ * @param string $rating Value for rating. Allowed values are: g, px, r,x
+ * @link http://pl.gravatar.com/site/implement/url More information about rating.
+ * @throws Zend_View_Exception
+ */
+ public function setRating($rating)
+ {
+ switch ($rating) {
+ case self::RATING_G:
+ case self::RATING_PG:
+ case self::RATING_R:
+ case self::RATING_X:
+ $this->_options['rating'] = $rating;
+ break;
+ default:
+ throw new Zend_View_Exception(sprintf(
+ 'The rating value "%s" is not allowed',
+ $rating
+ ));
+ }
+ return $this;
+ }
+
+ /**
+ * Get rating value
+ *
+ * @return string
+ */
+ public function getRating()
+ {
+ return $this->_options['rating'];
+ }
+
+ /**
+ * Set email adress
+ *
+ * @param string $email
+ * @return Zend_View_Helper_Gravatar
+ */
+ public function setEmail( $email )
+ {
+ $this->_email = $email;
+ return $this;
+ }
+
+ /**
+ * Get email adress
+ *
+ * @return string
+ */
+ public function getEmail()
+ {
+ return $this->_email;
+ }
+
+ /**
+ * Load from an SSL or No-SSL location?
+ *
+ * @param bool $flag
+ * @return Zend_View_Helper_Gravatar
+ */
+ public function setSecure($flag)
+ {
+ $this->_options['secure'] = ($flag === null) ? null : (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Get an SSL or a No-SSL location
+ *
+ * @return bool
+ */
+ public function getSecure()
+ {
+ if ($this->_options['secure'] === null) {
+ return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off');
+ }
+ return $this->_options['secure'];
+ }
+
+ /**
+ * Get attribs of image
+ *
+ * Warning!
+ * If you set src attrib, you get it, but this value will be overwritten in
+ * protected method _setSrcAttribForImg(). And finally your get other src
+ * value!
+ *
+ * @return array
+ */
+ public function getAttribs()
+ {
+ return $this->_attribs;
+ }
+
+ /**
+ * Set attribs for image tag
+ *
+ * Warning! You shouldn't set src attrib for image tag.
+ * This attrib is overwritten in protected method _setSrcAttribForImg().
+ * This method(_setSrcAttribForImg) is called in public method getImgTag().
+
+ * @param array $attribs
+ * @return Zend_View_Helper_Gravatar
+ */
+ public function setAttribs(array $attribs)
+ {
+ $this->_attribs = $attribs;
+ return $this;
+ }
+
+ /**
+ * Get URL to gravatar's service.
+ *
+ * @return string URL
+ */
+ protected function _getGravatarUrl()
+ {
+ return ($this->getSecure() === false) ? self::GRAVATAR_URL : self::GRAVATAR_URL_SECURE;
+ }
+
+ /**
+ * Get avatar url (including size, rating and default image oprions)
+ *
+ * @return string
+ */
+ protected function _getAvatarUrl()
+ {
+ $src = $this->_getGravatarUrl()
+ . '/'
+ . md5(strtolower(trim($this->getEmail())))
+ . '?s='
+ . $this->getImgSize()
+ . '&d='
+ . $this->getDefaultImg()
+ . '&r='
+ . $this->getRating();
+ return $src;
+ }
+
+ /**
+ * Set src attrib for image.
+ *
+ * You shouldn't set a own url value!
+ * It sets value, uses protected method _getAvatarUrl.
+ *
+ * If already exsist overwritten.
+ */
+ protected function _setSrcAttribForImg()
+ {
+ $attribs = $this->getAttribs();
+ $attribs['src'] = $this->_getAvatarUrl();
+ $this->setAttribs($attribs);
+ }
+
+ /**
+ * Return valid image tag
+ *
+ * @return string
+ */
+ public function getImgTag()
+ {
+ $this->_setSrcAttribForImg();
+ $html = '<img'
+ . $this->_htmlAttribs($this->getAttribs())
+ . $this->getClosingBracket();
+
+ return $html;
+ }
+
+ /**
+ * Return valid image tag
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->getImgTag();
+
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/HeadLink.php b/library/vendor/Zend/View/Helper/HeadLink.php
new file mode 100644
index 0000000..3b1bcb7
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/HeadLink.php
@@ -0,0 +1,471 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_Placeholder_Container_Standalone */
+
+/**
+ * Zend_Layout_View_Helper_HeadLink
+ *
+ * @see http://www.w3.org/TR/xhtml1/dtds.html
+ * @uses Zend_View_Helper_Placeholder_Container_Standalone
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @method $this appendAlternate($href, $type, $title, $extras)
+ * @method $this appendStylesheet($href, $media = 'screen', $conditionalStylesheet = false, array $extras = array())
+ * @method $this offsetSetAlternate($index, $href, $type, $title, $extras)
+ * @method $this offsetSetStylesheet($index, $href, $media = 'screen', $conditionalStylesheet = false, array $extras = array())
+ * @method $this prependAlternate($href, $type, $title, $extras)
+ * @method $this prependStylesheet($href, $media = 'screen', $conditionalStylesheet = false, array $extras = array())
+ * @method $this setAlternate($href, $type, $title, $extras)
+ * @method $this setStylesheet($href, $media = 'screen', $conditionalStylesheet = false, array $extras = array())
+ */
+class Zend_View_Helper_HeadLink extends Zend_View_Helper_Placeholder_Container_Standalone
+{
+ /**
+ * $_validAttributes
+ *
+ * @var array
+ */
+ protected $_itemKeys = array(
+ 'charset',
+ 'href',
+ 'hreflang',
+ 'id',
+ 'media',
+ 'rel',
+ 'rev',
+ 'type',
+ 'title',
+ 'extras',
+ 'sizes',
+ );
+
+ /**
+ * @var string registry key
+ */
+ protected $_regKey = 'Zend_View_Helper_HeadLink';
+
+ /**
+ * Constructor
+ *
+ * Use PHP_EOL as separator
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->setSeparator(PHP_EOL);
+ }
+
+ /**
+ * headLink() - View Helper Method
+ *
+ * Returns current object instance. Optionally, allows passing array of
+ * values to build link.
+ *
+ * @return Zend_View_Helper_HeadLink
+ */
+ public function headLink(array $attributes = null, $placement = Zend_View_Helper_Placeholder_Container_Abstract::APPEND)
+ {
+ if (null !== $attributes) {
+ $item = $this->createData($attributes);
+ switch ($placement) {
+ case Zend_View_Helper_Placeholder_Container_Abstract::SET:
+ $this->set($item);
+ break;
+ case Zend_View_Helper_Placeholder_Container_Abstract::PREPEND:
+ $this->prepend($item);
+ break;
+ case Zend_View_Helper_Placeholder_Container_Abstract::APPEND:
+ default:
+ $this->append($item);
+ break;
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Overload method access
+ *
+ * Creates the following virtual methods:
+ * - appendStylesheet($href, $media, $conditionalStylesheet, $extras)
+ * - offsetSetStylesheet($index, $href, $media, $conditionalStylesheet, $extras)
+ * - prependStylesheet($href, $media, $conditionalStylesheet, $extras)
+ * - setStylesheet($href, $media, $conditionalStylesheet, $extras)
+ * - appendAlternate($href, $type, $title, $extras)
+ * - offsetSetAlternate($index, $href, $type, $title, $extras)
+ * - prependAlternate($href, $type, $title, $extras)
+ * - setAlternate($href, $type, $title, $extras)
+ *
+ * Items that may be added in the future:
+ * - Navigation? need to find docs on this
+ * - public function appendStart()
+ * - public function appendContents()
+ * - public function appendPrev()
+ * - public function appendNext()
+ * - public function appendIndex()
+ * - public function appendEnd()
+ * - public function appendGlossary()
+ * - public function appendAppendix()
+ * - public function appendHelp()
+ * - public function appendBookmark()
+ * - Other?
+ * - public function appendCopyright()
+ * - public function appendChapter()
+ * - public function appendSection()
+ * - public function appendSubsection()
+ *
+ * @param mixed $method
+ * @param mixed $args
+ * @return void
+ */
+ public function __call($method, $args)
+ {
+ if (preg_match('/^(?P<action>set|(ap|pre)pend|offsetSet)(?P<type>Stylesheet|Alternate)$/', $method, $matches)) {
+ $argc = count($args);
+ $action = $matches['action'];
+ $type = $matches['type'];
+ $index = null;
+
+ if ('offsetSet' == $action) {
+ if (0 < $argc) {
+ $index = array_shift($args);
+ --$argc;
+ }
+ }
+
+ if (1 > $argc) {
+ $e = new Zend_View_Exception(sprintf('%s requires at least one argument', $method));
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ if (is_array($args[0])) {
+ $item = $this->createData($args[0]);
+ } else {
+ $dataMethod = 'createData' . $type;
+ $item = $this->$dataMethod($args);
+ }
+
+ if ($item) {
+ if ('offsetSet' == $action) {
+ $this->offsetSet($index, $item);
+ } else {
+ $this->$action($item);
+ }
+ }
+
+ return $this;
+ }
+
+ return parent::__call($method, $args);
+ }
+
+ /**
+ * Check if value is valid
+ *
+ * @param mixed $value
+ * @return boolean
+ */
+ protected function _isValid($value)
+ {
+ if (!$value instanceof stdClass) {
+ return false;
+ }
+
+ $vars = get_object_vars($value);
+ $keys = array_keys($vars);
+ $intersection = array_intersect($this->_itemKeys, $keys);
+ if (empty($intersection)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * append()
+ *
+ * @param array $value
+ * @return void
+ */
+ public function append($value)
+ {
+ if (!$this->_isValid($value)) {
+ $e = new Zend_View_Exception('append() expects a data token; please use one of the custom append*() methods');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ return $this->getContainer()->append($value);
+ }
+
+ /**
+ * offsetSet()
+ *
+ * @param string|int $index
+ * @param array $value
+ * @return void
+ */
+ public function offsetSet($index, $value): void
+ {
+ if (!$this->_isValid($value)) {
+ $e = new Zend_View_Exception('offsetSet() expects a data token; please use one of the custom offsetSet*() methods');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ $this->getContainer()->offsetSet($index, $value);
+ }
+
+ /**
+ * prepend()
+ *
+ * @param array $value
+ * @return Zend_Layout_ViewHelper_HeadLink
+ */
+ public function prepend($value)
+ {
+ if (!$this->_isValid($value)) {
+ $e = new Zend_View_Exception('prepend() expects a data token; please use one of the custom prepend*() methods');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ return $this->getContainer()->prepend($value);
+ }
+
+ /**
+ * set()
+ *
+ * @param array $value
+ * @return Zend_Layout_ViewHelper_HeadLink
+ */
+ public function set($value)
+ {
+ if (!$this->_isValid($value)) {
+ $e = new Zend_View_Exception('set() expects a data token; please use one of the custom set*() methods');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ return $this->getContainer()->set($value);
+ }
+
+
+ /**
+ * Create HTML link element from data item
+ *
+ * @param stdClass $item
+ * @return string
+ */
+ public function itemToString(stdClass $item)
+ {
+ $attributes = (array) $item;
+ $link = '<link ';
+
+ foreach ($this->_itemKeys as $itemKey) {
+ if (isset($attributes[$itemKey])) {
+ if(is_array($attributes[$itemKey])) {
+ foreach($attributes[$itemKey] as $key => $value) {
+ $link .= sprintf('%s="%s" ', $key, ($this->_autoEscape) ? $this->_escape($value) : $value);
+ }
+ } else {
+ $link .= sprintf('%s="%s" ', $itemKey, ($this->_autoEscape) ? $this->_escape($attributes[$itemKey]) : $attributes[$itemKey]);
+ }
+ }
+ }
+
+ if ($this->view instanceof Zend_View_Abstract) {
+ $link .= ($this->view->doctype()->isXhtml()) ? '/>' : '>';
+ } else {
+ $link .= '/>';
+ }
+
+ if (($link == '<link />') || ($link == '<link >')) {
+ return '';
+ }
+
+ if (isset($attributes['conditionalStylesheet'])
+ && !empty($attributes['conditionalStylesheet'])
+ && is_string($attributes['conditionalStylesheet']))
+ {
+ if (str_replace(' ', '', $attributes['conditionalStylesheet']) === '!IE') {
+ $link = '<!-->' . $link . '<!--';
+ }
+ $link = '<!--[if ' . $attributes['conditionalStylesheet'] . ']>' . $link . '<![endif]-->';
+ }
+
+ return $link;
+ }
+
+ /**
+ * Render link elements as string
+ *
+ * @param string|int $indent
+ * @return string
+ */
+ public function toString($indent = null)
+ {
+ $indent = (null !== $indent)
+ ? $this->getWhitespace($indent)
+ : $this->getIndent();
+
+ $items = array();
+ $this->getContainer()->ksort();
+ foreach ($this as $item) {
+ $items[] = $this->itemToString($item);
+ }
+
+ return $indent . implode($this->_escape($this->getSeparator()) . $indent, $items);
+ }
+
+ /**
+ * Create data item for stack
+ *
+ * @param array $attributes
+ * @return stdClass
+ */
+ public function createData(array $attributes)
+ {
+ $data = (object) $attributes;
+ return $data;
+ }
+
+ /**
+ * Create item for stylesheet link item
+ *
+ * @param array $args
+ * @return stdClass|false Returns fals if stylesheet is a duplicate
+ */
+ public function createDataStylesheet(array $args)
+ {
+ $rel = 'stylesheet';
+ $type = 'text/css';
+ $media = 'screen';
+ $conditionalStylesheet = false;
+ $href = array_shift($args);
+
+ if ($this->_isDuplicateStylesheet($href)) {
+ return false;
+ }
+
+ if (0 < count($args)) {
+ $media = array_shift($args);
+ if(is_array($media)) {
+ $media = implode(',', $media);
+ } else {
+ $media = (string) $media;
+ }
+ }
+ if (0 < count($args)) {
+ $conditionalStylesheet = array_shift($args);
+ if(!empty($conditionalStylesheet) && is_string($conditionalStylesheet)) {
+ $conditionalStylesheet = (string) $conditionalStylesheet;
+ } else {
+ $conditionalStylesheet = null;
+ }
+ }
+
+ if(0 < count($args) && is_array($args[0])) {
+ $extras = array_shift($args);
+ $extras = (array) $extras;
+ }
+
+ $attributes = compact('rel', 'type', 'href', 'media', 'conditionalStylesheet', 'extras');
+ return $this->createData($this->_applyExtras($attributes));
+ }
+
+ /**
+ * Is the linked stylesheet a duplicate?
+ *
+ * @param string $uri
+ * @return bool
+ */
+ protected function _isDuplicateStylesheet($uri)
+ {
+ foreach ($this->getContainer() as $item) {
+ if (($item->rel == 'stylesheet') && ($item->href == $uri)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Create item for alternate link item
+ *
+ * @param array $args
+ * @return stdClass
+ */
+ public function createDataAlternate(array $args)
+ {
+ if (3 > count($args)) {
+ $e = new Zend_View_Exception(sprintf('Alternate tags require 3 arguments; %s provided', count($args)));
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ $rel = 'alternate';
+ $href = array_shift($args);
+ $type = array_shift($args);
+ $title = array_shift($args);
+
+ if(0 < count($args) && is_array($args[0])) {
+ $extras = array_shift($args);
+ $extras = (array) $extras;
+
+ if(isset($extras['media']) && is_array($extras['media'])) {
+ $extras['media'] = implode(',', $extras['media']);
+ }
+ }
+
+ $href = (string) $href;
+ $type = (string) $type;
+ $title = (string) $title;
+
+ $attributes = compact('rel', 'href', 'type', 'title', 'extras');
+ return $this->createData($this->_applyExtras($attributes));
+ }
+
+ /**
+ * Apply any overrides specified in the 'extras' array
+ * @param array $attributes
+ * @return array
+ */
+ protected function _applyExtras($attributes)
+ {
+ if (isset($attributes['extras'])) {
+ foreach ($attributes['extras'] as $eKey=>$eVal) {
+ if (isset($attributes[$eKey])) {
+ $attributes[$eKey] = $eVal;
+ unset($attributes['extras'][$eKey]);
+ }
+ }
+ }
+ return $attributes;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/HeadMeta.php b/library/vendor/Zend/View/Helper/HeadMeta.php
new file mode 100644
index 0000000..88cd3a7
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/HeadMeta.php
@@ -0,0 +1,440 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_Placeholder_Container_Standalone */
+
+/**
+ * Zend_Layout_View_Helper_HeadMeta
+ *
+ * @see http://www.w3.org/TR/xhtml1/dtds.html
+ * @uses Zend_View_Helper_Placeholder_Container_Standalone
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @method $this appendHttpEquiv($keyValue, $content, $conditionalHttpEquiv)
+ * @method $this appendName($keyValue, $content, $conditionalName)
+ * @method $this appendProperty($property, $content, $modifiers)
+ * @method $this offsetSetHttpEquiv($index, $keyValue, $content, $conditionalHttpEquiv)
+ * @method $this offsetSetName($index, $keyValue, $content, $conditionalName)
+ * @method $this offsetSetProperty($index, $property, $content, $modifiers)
+ * @method $this prependHttpEquiv($keyValue, $content, $conditionalHttpEquiv)
+ * @method $this prependName($keyValue, $content, $conditionalName)
+ * @method $this prependProperty($property, $content, $modifiers)
+ * @method $this setCharset($charset)
+ * @method $this setHttpEquiv($keyValue, $content, $modifiers)
+ * @method $this setName($keyValue, $content, $modifiers)
+ * @method $this setProperty($property, $content, $modifiers)
+ */
+class Zend_View_Helper_HeadMeta extends Zend_View_Helper_Placeholder_Container_Standalone
+{
+ /**
+ * Types of attributes
+ * @var array
+ */
+ protected $_typeKeys = array('name', 'http-equiv', 'charset', 'property');
+ protected $_requiredKeys = array('content');
+ protected $_modifierKeys = array('lang', 'scheme');
+
+ /**
+ * @var string registry key
+ */
+ protected $_regKey = 'Zend_View_Helper_HeadMeta';
+
+ /**
+ * Constructor
+ *
+ * Set separator to PHP_EOL
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->setSeparator(PHP_EOL);
+ }
+
+ /**
+ * Retrieve object instance; optionally add meta tag
+ *
+ * @param string $content
+ * @param string $keyValue
+ * @param string $keyType
+ * @param array $modifiers
+ * @param string $placement
+ * @return Zend_View_Helper_HeadMeta
+ */
+ public function headMeta($content = null, $keyValue = null, $keyType = 'name', $modifiers = array(), $placement = Zend_View_Helper_Placeholder_Container_Abstract::APPEND)
+ {
+ if ((null !== $content) && (null !== $keyValue)) {
+ $item = $this->createData($keyType, $keyValue, $content, $modifiers);
+ $action = strtolower($placement);
+ switch ($action) {
+ case 'append':
+ case 'prepend':
+ case 'set':
+ $this->$action($item);
+ break;
+ default:
+ $this->append($item);
+ break;
+ }
+ }
+
+ return $this;
+ }
+
+ protected function _normalizeType($type)
+ {
+ switch ($type) {
+ case 'Name':
+ return 'name';
+ case 'HttpEquiv':
+ return 'http-equiv';
+ case 'Property':
+ return 'property';
+ default:
+ $e = new Zend_View_Exception(sprintf('Invalid type "%s" passed to _normalizeType', $type));
+ $e->setView($this->view);
+ throw $e;
+ }
+ }
+
+ /**
+ * Overload method access
+ *
+ * Allows the following 'virtual' methods:
+ * - appendName($keyValue, $content, $modifiers = array())
+ * - offsetGetName($index, $keyValue, $content, $modifers = array())
+ * - prependName($keyValue, $content, $modifiers = array())
+ * - setName($keyValue, $content, $modifiers = array())
+ * - appendHttpEquiv($keyValue, $content, $modifiers = array())
+ * - offsetGetHttpEquiv($index, $keyValue, $content, $modifers = array())
+ * - prependHttpEquiv($keyValue, $content, $modifiers = array())
+ * - setHttpEquiv($keyValue, $content, $modifiers = array())
+ * - appendProperty($keyValue, $content, $modifiers = array())
+ * - offsetGetProperty($index, $keyValue, $content, $modifiers = array())
+ * - prependProperty($keyValue, $content, $modifiers = array())
+ * - setProperty($keyValue, $content, $modifiers = array())
+ *
+ * @param string $method
+ * @param array $args
+ * @return Zend_View_Helper_HeadMeta
+ */
+ public function __call($method, $args)
+ {
+ if (preg_match('/^(?P<action>set|(pre|ap)pend|offsetSet)(?P<type>Name|HttpEquiv|Property)$/', $method, $matches)) {
+ $action = $matches['action'];
+ $type = $this->_normalizeType($matches['type']);
+ $argc = count($args);
+ $index = null;
+
+ if ('offsetSet' == $action) {
+ if (0 < $argc) {
+ $index = array_shift($args);
+ --$argc;
+ }
+ }
+
+ if (2 > $argc) {
+ $e = new Zend_View_Exception('Too few arguments provided; requires key value, and content');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ if (3 > $argc) {
+ $args[] = array();
+ }
+
+ $item = $this->createData($type, $args[0], $args[1], $args[2]);
+
+ if ('offsetSet' == $action) {
+ $this->offsetSet($index, $item);
+ return $this;
+ }
+
+ $this->$action($item);
+ return $this;
+ }
+
+ return parent::__call($method, $args);
+ }
+
+ /**
+ * Create an HTML5-style meta charset tag. Something like <meta charset="utf-8">
+ *
+ * Not valid in a non-HTML5 doctype
+ *
+ * @param string $charset
+ * @return Zend_View_Helper_HeadMeta Provides a fluent interface
+ */
+ public function setCharset($charset)
+ {
+ $item = new stdClass;
+ $item->type = 'charset';
+ $item->charset = $charset;
+ $item->content = null;
+ $item->modifiers = array();
+ $this->set($item);
+ return $this;
+ }
+
+ /**
+ * Determine if item is valid
+ *
+ * @param mixed $item
+ * @return boolean
+ */
+ protected function _isValid($item)
+ {
+ if ((!$item instanceof stdClass)
+ || !isset($item->type)
+ || !isset($item->modifiers))
+ {
+ return false;
+ }
+
+ $isHtml5 = is_null($this->view) ? false : $this->view->doctype()->isHtml5();
+
+ if (!isset($item->content)
+ && (! $isHtml5 || (! $isHtml5 && $item->type !== 'charset'))) {
+ return false;
+ }
+
+ // <meta property= ... /> is only supported with doctype RDFa
+ if ( !is_null($this->view) && !$this->view->doctype()->isRdfa()
+ && $item->type === 'property') {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Append
+ *
+ * @param string $value
+ * @return void
+ * @throws Zend_View_Exception
+ */
+ public function append($value)
+ {
+ if (!$this->_isValid($value)) {
+ $e = new Zend_View_Exception('Invalid value passed to append; please use appendMeta()');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ return $this->getContainer()->append($value);
+ }
+
+ /**
+ * OffsetSet
+ *
+ * @param string|int $index
+ * @param string $value
+ * @return void
+ * @throws Zend_View_Exception
+ */
+ public function offsetSet($index, $value): void
+ {
+ if (!$this->_isValid($value)) {
+ $e = new Zend_View_Exception('Invalid value passed to offsetSet; please use offsetSetName() or offsetSetHttpEquiv()');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ $this->getContainer()->offsetSet($index, $value);
+ }
+
+ /**
+ * OffsetUnset
+ *
+ * @param string|int $index
+ * @return void
+ * @throws Zend_View_Exception
+ */
+ public function offsetUnset($index): void
+ {
+ if (!in_array($index, $this->getContainer()->getKeys())) {
+ $e = new Zend_View_Exception('Invalid index passed to offsetUnset()');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ $this->getContainer()->offsetUnset($index);
+ }
+
+ /**
+ * Prepend
+ *
+ * @param string $value
+ * @return void
+ * @throws Zend_View_Exception
+ */
+ public function prepend($value)
+ {
+ if (!$this->_isValid($value)) {
+ $e = new Zend_View_Exception('Invalid value passed to prepend; please use prependMeta()');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ return $this->getContainer()->prepend($value);
+ }
+
+ /**
+ * Set
+ *
+ * @param string $value
+ * @return void
+ * @throws Zend_View_Exception
+ */
+ public function set($value)
+ {
+ if (!$this->_isValid($value)) {
+ $e = new Zend_View_Exception('Invalid value passed to set; please use setMeta()');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ $container = $this->getContainer();
+ foreach ($container->getArrayCopy() as $index => $item) {
+ if ($item->type == $value->type && $item->{$item->type} == $value->{$value->type}) {
+ $this->offsetUnset($index);
+ }
+ }
+
+ return $this->append($value);
+ }
+
+ /**
+ * Build meta HTML string
+ *
+ * @param string $type
+ * @param string $typeValue
+ * @param string $content
+ * @param array $modifiers
+ * @return string
+ */
+ public function itemToString(stdClass $item)
+ {
+ if (!in_array($item->type, $this->_typeKeys)) {
+ $e = new Zend_View_Exception(sprintf('Invalid type "%s" provided for meta', $item->type));
+ $e->setView($this->view);
+ throw $e;
+ }
+ $type = $item->type;
+
+ $modifiersString = '';
+ foreach ($item->modifiers as $key => $value) {
+ if (!is_null($this->view) && $this->view->doctype()->isHtml5()
+ && $key == 'scheme') {
+ throw new Zend_View_Exception('Invalid modifier '
+ . '"scheme" provided; not supported by HTML5');
+ }
+ if (!in_array($key, $this->_modifierKeys)) {
+ continue;
+ }
+ $modifiersString .= $key . '="' . $this->_escape($value) . '" ';
+ }
+
+ if ($this->view instanceof Zend_View_Abstract) {
+ if ($this->view->doctype()->isHtml5()
+ && $type == 'charset') {
+ $tpl = ($this->view->doctype()->isXhtml())
+ ? '<meta %s="%s"/>'
+ : '<meta %s="%s">';
+ } elseif ($this->view->doctype()->isXhtml()) {
+ $tpl = '<meta %s="%s" content="%s" %s/>';
+ } else {
+ $tpl = '<meta %s="%s" content="%s" %s>';
+ }
+ } else {
+ $tpl = '<meta %s="%s" content="%s" %s/>';
+ }
+
+ $meta = sprintf(
+ $tpl,
+ $type,
+ $this->_escape($item->$type),
+ $this->_escape($item->content),
+ $modifiersString
+ );
+
+ if (isset($item->modifiers['conditional'])
+ && !empty($item->modifiers['conditional'])
+ && is_string($item->modifiers['conditional']))
+ {
+ if (str_replace(' ', '', $item->modifiers['conditional']) === '!IE') {
+ $meta = '<!-->' . $meta . '<!--';
+ }
+ $meta = '<!--[if ' . $this->_escape($item->modifiers['conditional']) . ']>' . $meta . '<![endif]-->';
+ }
+
+ return $meta;
+ }
+
+ /**
+ * Render placeholder as string
+ *
+ * @param string|int $indent
+ * @return string
+ */
+ public function toString($indent = null)
+ {
+ $indent = (null !== $indent)
+ ? $this->getWhitespace($indent)
+ : $this->getIndent();
+
+ $items = array();
+ $this->getContainer()->ksort();
+ try {
+ foreach ($this as $item) {
+ $items[] = $this->itemToString($item);
+ }
+ } catch (Zend_View_Exception $e) {
+ trigger_error($e->getMessage(), E_USER_WARNING);
+ return '';
+ }
+ return $indent . implode($this->_escape($this->getSeparator()) . $indent, $items);
+ }
+
+ /**
+ * Create data item for inserting into stack
+ *
+ * @param string $type
+ * @param string $typeValue
+ * @param string $content
+ * @param array $modifiers
+ * @return stdClass
+ */
+ public function createData($type, $typeValue, $content, array $modifiers)
+ {
+ $data = new stdClass;
+ $data->type = $type;
+ $data->$type = $typeValue;
+ $data->content = $content;
+ $data->modifiers = $modifiers;
+ return $data;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/HeadScript.php b/library/vendor/Zend/View/Helper/HeadScript.php
new file mode 100644
index 0000000..5b8461d
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/HeadScript.php
@@ -0,0 +1,512 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_Placeholder_Container_Standalone */
+
+/**
+ * Helper for setting and retrieving script elements for HTML head section
+ *
+ * @uses Zend_View_Helper_Placeholder_Container_Standalone
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @method $this appendFile($src, $type = 'text/javascript', array $attrs = array())
+ * @method $this appendScript($script, $type = 'text/javascript', array $attrs = array())
+ * @method $this offsetSetFile($index, $src, $type = 'text/javascript', array $attrs = array())
+ * @method $this offsetSetScript($index, $script, $type = 'text/javascript', array $attrs = array())
+ * @method $this prependFile($src, $type = 'text/javascript', array $attrs = array())
+ * @method $this prependScript($script, $type = 'text/javascript', array $attrs = array())
+ * @method $this setFile($src, $type = 'text/javascript', array $attrs = array())
+ * @method $this setScript($script, $type = 'text/javascript', array $attrs = array())
+ */
+class Zend_View_Helper_HeadScript extends Zend_View_Helper_Placeholder_Container_Standalone
+{
+ /**#@+
+ * Script type contants
+ * @const string
+ */
+ const FILE = 'FILE';
+ const SCRIPT = 'SCRIPT';
+ /**#@-*/
+
+ /**
+ * Registry key for placeholder
+ * @var string
+ */
+ protected $_regKey = 'Zend_View_Helper_HeadScript';
+
+ /**
+ * Are arbitrary attributes allowed?
+ * @var bool
+ */
+ protected $_arbitraryAttributes = false;
+
+ /**#@+
+ * Capture type and/or attributes (used for hinting during capture)
+ * @var string
+ */
+ protected $_captureLock;
+ protected $_captureScriptType = null;
+ protected $_captureScriptAttrs = null;
+ protected $_captureType;
+ /**#@-*/
+
+ /**
+ * Optional allowed attributes for script tag
+ * @var array
+ */
+ protected $_optionalAttributes = array(
+ 'charset', 'defer', 'language', 'src'
+ );
+
+ /**
+ * Required attributes for script tag
+ * @var string
+ */
+ protected $_requiredAttributes = array('type');
+
+ /**
+ * Whether or not to format scripts using CDATA; used only if doctype
+ * helper is not accessible
+ * @var bool
+ */
+ public $useCdata = false;
+
+ /**
+ * Constructor
+ *
+ * Set separator to PHP_EOL.
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->setSeparator(PHP_EOL);
+ }
+
+ /**
+ * Return headScript object
+ *
+ * Returns headScript helper object; optionally, allows specifying a script
+ * or script file to include.
+ *
+ * @param string $mode Script or file
+ * @param string $spec Script/url
+ * @param string $placement Append, prepend, or set
+ * @param array $attrs Array of script attributes
+ * @param string $type Script type and/or array of script attributes
+ * @return Zend_View_Helper_HeadScript
+ */
+ public function headScript($mode = Zend_View_Helper_HeadScript::FILE, $spec = null, $placement = 'APPEND', array $attrs = array(), $type = 'text/javascript')
+ {
+ if ((null !== $spec) && is_string($spec)) {
+ $action = ucfirst(strtolower($mode));
+ $placement = strtolower($placement);
+ switch ($placement) {
+ case 'set':
+ case 'prepend':
+ case 'append':
+ $action = $placement . $action;
+ break;
+ default:
+ $action = 'append' . $action;
+ break;
+ }
+ $this->$action($spec, $type, $attrs);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Start capture action
+ *
+ * @param mixed $captureType
+ * @param string $typeOrAttrs
+ * @return void
+ */
+ public function captureStart($captureType = Zend_View_Helper_Placeholder_Container_Abstract::APPEND, $type = 'text/javascript', $attrs = array())
+ {
+ if ($this->_captureLock) {
+ $e = new Zend_View_Helper_Placeholder_Container_Exception('Cannot nest headScript captures');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ $this->_captureLock = true;
+ $this->_captureType = $captureType;
+ $this->_captureScriptType = $type;
+ $this->_captureScriptAttrs = $attrs;
+ ob_start();
+ }
+
+ /**
+ * End capture action and store
+ *
+ * @return void
+ */
+ public function captureEnd()
+ {
+ $content = ob_get_clean();
+ $type = $this->_captureScriptType;
+ $attrs = $this->_captureScriptAttrs;
+ $this->_captureScriptType = null;
+ $this->_captureScriptAttrs = null;
+ $this->_captureLock = false;
+
+ switch ($this->_captureType) {
+ case Zend_View_Helper_Placeholder_Container_Abstract::SET:
+ case Zend_View_Helper_Placeholder_Container_Abstract::PREPEND:
+ case Zend_View_Helper_Placeholder_Container_Abstract::APPEND:
+ $action = strtolower($this->_captureType) . 'Script';
+ break;
+ default:
+ $action = 'appendScript';
+ break;
+ }
+ $this->$action($content, $type, $attrs);
+ }
+
+ /**
+ * Overload method access
+ *
+ * Allows the following method calls:
+ * - appendFile($src, $type = 'text/javascript', $attrs = array())
+ * - offsetSetFile($index, $src, $type = 'text/javascript', $attrs = array())
+ * - prependFile($src, $type = 'text/javascript', $attrs = array())
+ * - setFile($src, $type = 'text/javascript', $attrs = array())
+ * - appendScript($script, $type = 'text/javascript', $attrs = array())
+ * - offsetSetScript($index, $src, $type = 'text/javascript', $attrs = array())
+ * - prependScript($script, $type = 'text/javascript', $attrs = array())
+ * - setScript($script, $type = 'text/javascript', $attrs = array())
+ *
+ * @param string $method
+ * @param array $args
+ * @return Zend_View_Helper_HeadScript
+ * @throws Zend_View_Exception if too few arguments or invalid method
+ */
+ public function __call($method, $args)
+ {
+ if (preg_match('/^(?P<action>set|(ap|pre)pend|offsetSet)(?P<mode>File|Script)$/', $method, $matches)) {
+ if (1 > count($args)) {
+ $e = new Zend_View_Exception(sprintf('Method "%s" requires at least one argument', $method));
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ $action = $matches['action'];
+ $mode = strtolower($matches['mode']);
+ $type = 'text/javascript';
+ $attrs = array();
+
+ if ('offsetSet' == $action) {
+ $index = array_shift($args);
+ if (1 > count($args)) {
+ $e = new Zend_View_Exception(sprintf('Method "%s" requires at least two arguments, an index and source', $method));
+ $e->setView($this->view);
+ throw $e;
+ }
+ }
+
+ $content = $args[0];
+
+ if (isset($args[1])) {
+ $type = (string) $args[1];
+ }
+ if (isset($args[2])) {
+ $attrs = (array) $args[2];
+ }
+
+ switch ($mode) {
+ case 'script':
+ $item = $this->createData($type, $attrs, $content);
+ if ('offsetSet' == $action) {
+ $this->offsetSet($index, $item);
+ } else {
+ $this->$action($item);
+ }
+ break;
+ case 'file':
+ default:
+ if (!$this->_isDuplicate($content) || $action=='set') {
+ $attrs['src'] = $content;
+ $item = $this->createData($type, $attrs);
+ if ('offsetSet' == $action) {
+ $this->offsetSet($index, $item);
+ } else {
+ $this->$action($item);
+ }
+ }
+ break;
+ }
+
+ return $this;
+ }
+
+ return parent::__call($method, $args);
+ }
+
+ /**
+ * Is the file specified a duplicate?
+ *
+ * @param string $file
+ * @return bool
+ */
+ protected function _isDuplicate($file)
+ {
+ foreach ($this->getContainer() as $item) {
+ if (($item->source === null)
+ && array_key_exists('src', $item->attributes)
+ && ($file == $item->attributes['src']))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Is the script provided valid?
+ *
+ * @param mixed $value
+ * @param string $method
+ * @return bool
+ */
+ protected function _isValid($value)
+ {
+ if ((!$value instanceof stdClass)
+ || !isset($value->type)
+ || (!isset($value->source) && !isset($value->attributes)))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Override append
+ *
+ * @param string $value
+ * @return void
+ */
+ public function append($value)
+ {
+ if (!$this->_isValid($value)) {
+ $e = new Zend_View_Exception('Invalid argument passed to append(); please use one of the helper methods, appendScript() or appendFile()');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ return $this->getContainer()->append($value);
+ }
+
+ /**
+ * Override prepend
+ *
+ * @param string $value
+ * @return void
+ */
+ public function prepend($value)
+ {
+ if (!$this->_isValid($value)) {
+ $e = new Zend_View_Exception('Invalid argument passed to prepend(); please use one of the helper methods, prependScript() or prependFile()');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ return $this->getContainer()->prepend($value);
+ }
+
+ /**
+ * Override set
+ *
+ * @param string $value
+ * @return void
+ */
+ public function set($value)
+ {
+ if (!$this->_isValid($value)) {
+ $e = new Zend_View_Exception('Invalid argument passed to set(); please use one of the helper methods, setScript() or setFile()');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ return $this->getContainer()->set($value);
+ }
+
+ /**
+ * Override offsetSet
+ *
+ * @param string|int $index
+ * @param mixed $value
+ * @return void
+ */
+ public function offsetSet($index, $value): void
+ {
+ if (!$this->_isValid($value)) {
+ $e = new Zend_View_Exception('Invalid argument passed to offsetSet(); please use one of the helper methods, offsetSetScript() or offsetSetFile()');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ $this->getContainer()->offsetSet($index, $value);
+ }
+
+ /**
+ * Set flag indicating if arbitrary attributes are allowed
+ *
+ * @param bool $flag
+ * @return Zend_View_Helper_HeadScript
+ */
+ public function setAllowArbitraryAttributes($flag)
+ {
+ $this->_arbitraryAttributes = (bool) $flag;
+ return $this;
+ }
+
+ /**
+ * Are arbitrary attributes allowed?
+ *
+ * @return bool
+ */
+ public function arbitraryAttributesAllowed()
+ {
+ return $this->_arbitraryAttributes;
+ }
+
+ /**
+ * Create script HTML
+ *
+ * @param string $type
+ * @param array $attributes
+ * @param string $content
+ * @param string|int $indent
+ * @return string
+ */
+ public function itemToString($item, $indent, $escapeStart, $escapeEnd)
+ {
+ $attrString = '';
+ if (!empty($item->attributes)) {
+ foreach ($item->attributes as $key => $value) {
+ if ((!$this->arbitraryAttributesAllowed() && !in_array($key, $this->_optionalAttributes))
+ || in_array($key, array('conditional', 'noescape')))
+ {
+ continue;
+ }
+ if ('defer' == $key) {
+ $value = 'defer';
+ }
+ $attrString .= sprintf(' %s="%s"', $key, ($this->_autoEscape) ? $this->_escape($value) : $value);
+ }
+ }
+
+ $addScriptEscape = !(isset($item->attributes['noescape']) && filter_var($item->attributes['noescape'], FILTER_VALIDATE_BOOLEAN));
+
+ $type = ($this->_autoEscape) ? $this->_escape($item->type) : $item->type;
+ $html = '<script type="' . $type . '"' . $attrString . '>';
+ if (!empty($item->source)) {
+ $html .= PHP_EOL ;
+
+ if ($addScriptEscape) {
+ $html .= $indent . ' ' . $escapeStart . PHP_EOL;
+ }
+
+ $html .= $indent . ' ' . $item->source;
+
+ if ($addScriptEscape) {
+ $html .= $indent . ' ' . $escapeEnd . PHP_EOL;
+ }
+
+ $html .= $indent;
+ }
+ $html .= '</script>';
+
+ if (isset($item->attributes['conditional'])
+ && !empty($item->attributes['conditional'])
+ && is_string($item->attributes['conditional']))
+ {
+ // inner wrap with comment end and start if !IE
+ if (str_replace(' ', '', $item->attributes['conditional']) === '!IE') {
+ $html = '<!-->' . $html . '<!--';
+ }
+ $html = $indent . '<!--[if ' . $item->attributes['conditional'] . ']>' . $html . '<![endif]-->';
+ } else {
+ $html = $indent . $html;
+ }
+
+ return $html;
+ }
+
+ /**
+ * Retrieve string representation
+ *
+ * @param string|int $indent
+ * @return string
+ */
+ public function toString($indent = null)
+ {
+ $indent = (null !== $indent)
+ ? $this->getWhitespace($indent)
+ : $this->getIndent();
+
+ if ($this->view) {
+ $useCdata = $this->view->doctype()->isXhtml() ? true : false;
+ } else {
+ $useCdata = $this->useCdata ? true : false;
+ }
+ $escapeStart = ($useCdata) ? '//<![CDATA[' : '//<!--';
+ $escapeEnd = ($useCdata) ? '//]]>' : '//-->';
+
+ $items = array();
+ $this->getContainer()->ksort();
+ foreach ($this as $item) {
+ if (!$this->_isValid($item)) {
+ continue;
+ }
+
+ $items[] = $this->itemToString($item, $indent, $escapeStart, $escapeEnd);
+ }
+
+ $return = implode($this->getSeparator(), $items);
+ return $return;
+ }
+
+ /**
+ * Create data item containing all necessary components of script
+ *
+ * @param string $type
+ * @param array $attributes
+ * @param string $content
+ * @return stdClass
+ */
+ public function createData($type, array $attributes, $content = null)
+ {
+ $data = new stdClass();
+ $data->type = $type;
+ $data->attributes = $attributes;
+ $data->source = $content;
+ return $data;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/HeadStyle.php b/library/vendor/Zend/View/Helper/HeadStyle.php
new file mode 100644
index 0000000..c28f997
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/HeadStyle.php
@@ -0,0 +1,426 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_Placeholder_Container_Standalone */
+
+/**
+ * Helper for setting and retrieving stylesheets
+ *
+ * @uses Zend_View_Helper_Placeholder_Container_Standalone
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @method $this appendStyle($content, array $attributes = array())
+ * @method $this offsetSetStyle($index, $content, array $attributes = array())
+ * @method $this prependStyle($content, array $attributes = array())
+ * @method $this setStyle($content, array $attributes = array())
+ */
+class Zend_View_Helper_HeadStyle extends Zend_View_Helper_Placeholder_Container_Standalone
+{
+ /**
+ * Registry key for placeholder
+ * @var string
+ */
+ protected $_regKey = 'Zend_View_Helper_HeadStyle';
+
+ /**
+ * Allowed optional attributes
+ * @var array
+ */
+ protected $_optionalAttributes = array('lang', 'title', 'media', 'dir');
+
+ /**
+ * Allowed media types
+ * @var array
+ */
+ protected $_mediaTypes = array(
+ 'all', 'aural', 'braille', 'handheld', 'print',
+ 'projection', 'screen', 'tty', 'tv'
+ );
+
+ /**
+ * Capture type and/or attributes (used for hinting during capture)
+ * @var string
+ */
+ protected $_captureAttrs = null;
+
+ /**
+ * Capture lock
+ * @var bool
+ */
+ protected $_captureLock;
+
+ /**
+ * Capture type (append, prepend, set)
+ * @var string
+ */
+ protected $_captureType;
+
+ /**
+ * Constructor
+ *
+ * Set separator to PHP_EOL.
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->setSeparator(PHP_EOL);
+ }
+
+ /**
+ * Return headStyle object
+ *
+ * Returns headStyle helper object; optionally, allows specifying
+ *
+ * @param string $content Stylesheet contents
+ * @param string $placement Append, prepend, or set
+ * @param string|array $attributes Optional attributes to utilize
+ * @return Zend_View_Helper_HeadStyle
+ */
+ public function headStyle($content = null, $placement = 'APPEND', $attributes = array())
+ {
+ if ((null !== $content) && is_string($content)) {
+ switch (strtoupper($placement)) {
+ case 'SET':
+ $action = 'setStyle';
+ break;
+ case 'PREPEND':
+ $action = 'prependStyle';
+ break;
+ case 'APPEND':
+ default:
+ $action = 'appendStyle';
+ break;
+ }
+ $this->$action($content, $attributes);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Overload method calls
+ *
+ * Allows the following method calls:
+ * - appendStyle($content, $attributes = array())
+ * - offsetSetStyle($index, $content, $attributes = array())
+ * - prependStyle($content, $attributes = array())
+ * - setStyle($content, $attributes = array())
+ *
+ * @param string $method
+ * @param array $args
+ * @return void
+ * @throws Zend_View_Exception When no $content provided or invalid method
+ */
+ public function __call($method, $args)
+ {
+ if (preg_match('/^(?P<action>set|(ap|pre)pend|offsetSet)(Style)$/', $method, $matches)) {
+ $index = null;
+ $argc = count($args);
+ $action = $matches['action'];
+
+ if ('offsetSet' == $action) {
+ if (0 < $argc) {
+ $index = array_shift($args);
+ --$argc;
+ }
+ }
+
+ if (1 > $argc) {
+ $e = new Zend_View_Exception(sprintf('Method "%s" requires minimally content for the stylesheet', $method));
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ $content = $args[0];
+ $attrs = array();
+ if (isset($args[1])) {
+ $attrs = (array) $args[1];
+ }
+
+ $item = $this->createData($content, $attrs);
+
+ if ('offsetSet' == $action) {
+ $this->offsetSet($index, $item);
+ } else {
+ $this->$action($item);
+ }
+
+ return $this;
+ }
+
+ return parent::__call($method, $args);
+ }
+
+ /**
+ * Determine if a value is a valid style tag
+ *
+ * @param mixed $value
+ * @param string $method
+ * @return boolean
+ */
+ protected function _isValid($value)
+ {
+ if ((!$value instanceof stdClass)
+ || !isset($value->content)
+ || !isset($value->attributes))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Override append to enforce style creation
+ *
+ * @param mixed $value
+ * @return void
+ */
+ public function append($value)
+ {
+ if (!$this->_isValid($value)) {
+ $e = new Zend_View_Exception('Invalid value passed to append; please use appendStyle()');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ return $this->getContainer()->append($value);
+ }
+
+ /**
+ * Override offsetSet to enforce style creation
+ *
+ * @param string|int $index
+ * @param mixed $value
+ * @return void
+ */
+ public function offsetSet($index, $value): void
+ {
+ if (!$this->_isValid($value)) {
+ $e = new Zend_View_Exception('Invalid value passed to offsetSet; please use offsetSetStyle()');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ $this->getContainer()->offsetSet($index, $value);
+ }
+
+ /**
+ * Override prepend to enforce style creation
+ *
+ * @param mixed $value
+ * @return void
+ */
+ public function prepend($value)
+ {
+ if (!$this->_isValid($value)) {
+ $e = new Zend_View_Exception('Invalid value passed to prepend; please use prependStyle()');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ return $this->getContainer()->prepend($value);
+ }
+
+ /**
+ * Override set to enforce style creation
+ *
+ * @param mixed $value
+ * @return void
+ */
+ public function set($value)
+ {
+ if (!$this->_isValid($value)) {
+ $e = new Zend_View_Exception('Invalid value passed to set; please use setStyle()');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ return $this->getContainer()->set($value);
+ }
+
+ /**
+ * Start capture action
+ *
+ * @param mixed $captureType
+ * @param string $typeOrAttrs
+ * @return void
+ */
+ public function captureStart($type = Zend_View_Helper_Placeholder_Container_Abstract::APPEND, $attrs = null)
+ {
+ if ($this->_captureLock) {
+ $e = new Zend_View_Helper_Placeholder_Container_Exception('Cannot nest headStyle captures');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ $this->_captureLock = true;
+ $this->_captureAttrs = $attrs;
+ $this->_captureType = $type;
+ ob_start();
+ }
+
+ /**
+ * End capture action and store
+ *
+ * @return void
+ */
+ public function captureEnd()
+ {
+ $content = ob_get_clean();
+ $attrs = $this->_captureAttrs;
+ $this->_captureAttrs = null;
+ $this->_captureLock = false;
+
+ switch ($this->_captureType) {
+ case Zend_View_Helper_Placeholder_Container_Abstract::SET:
+ $this->setStyle($content, $attrs);
+ break;
+ case Zend_View_Helper_Placeholder_Container_Abstract::PREPEND:
+ $this->prependStyle($content, $attrs);
+ break;
+ case Zend_View_Helper_Placeholder_Container_Abstract::APPEND:
+ default:
+ $this->appendStyle($content, $attrs);
+ break;
+ }
+ }
+
+ /**
+ * Convert content and attributes into valid style tag
+ *
+ * @param stdClass $item Item to render
+ * @param string $indent Indentation to use
+ * @return string
+ */
+ public function itemToString(stdClass $item, $indent)
+ {
+ $attrString = '';
+ if (!empty($item->attributes)) {
+ $enc = 'UTF-8';
+ if ($this->view instanceof Zend_View_Interface
+ && method_exists($this->view, 'getEncoding')
+ ) {
+ $enc = $this->view->getEncoding();
+ }
+ foreach ($item->attributes as $key => $value) {
+ if (!in_array($key, $this->_optionalAttributes)) {
+ continue;
+ }
+ if ('media' == $key) {
+ if(false === strpos($value, ',')) {
+ if (!in_array($value, $this->_mediaTypes)) {
+ continue;
+ }
+ } else {
+ $media_types = explode(',', $value);
+ $value = '';
+ foreach($media_types as $type) {
+ $type = trim($type);
+ if (!in_array($type, $this->_mediaTypes)) {
+ continue;
+ }
+ $value .= $type .',';
+ }
+ $value = substr($value, 0, -1);
+ }
+ }
+ $attrString .= sprintf(' %s="%s"', $key, htmlspecialchars($value, ENT_COMPAT, $enc));
+ }
+ }
+
+ $escapeStart = $indent . '<!--'. PHP_EOL;
+ $escapeEnd = $indent . '-->'. PHP_EOL;
+ if (isset($item->attributes['conditional'])
+ && !empty($item->attributes['conditional'])
+ && is_string($item->attributes['conditional'])
+ ) {
+ $escapeStart = null;
+ $escapeEnd = null;
+ }
+
+ $html = '<style type="text/css"' . $attrString . '>' . PHP_EOL
+ . $escapeStart . $indent . $item->content . PHP_EOL . $escapeEnd
+ . '</style>';
+
+ if (null == $escapeStart && null == $escapeEnd) {
+ if (str_replace(' ', '', $item->attributes['conditional']) === '!IE') {
+ $html = '<!-->' . $html . '<!--';
+ }
+ $html = '<!--[if ' . $item->attributes['conditional'] . ']>' . $html . '<![endif]-->';
+ }
+
+ return $html;
+ }
+
+ /**
+ * Create string representation of placeholder
+ *
+ * @param string|int $indent
+ * @return string
+ */
+ public function toString($indent = null)
+ {
+ $indent = (null !== $indent)
+ ? $this->getWhitespace($indent)
+ : $this->getIndent();
+
+ $items = array();
+ $this->getContainer()->ksort();
+ foreach ($this as $item) {
+ if (!$this->_isValid($item)) {
+ continue;
+ }
+ $items[] = $this->itemToString($item, $indent);
+ }
+
+ $return = $indent . implode($this->getSeparator() . $indent, $items);
+ $return = preg_replace("/(\r\n?|\n)/", '$1' . $indent, $return);
+ return $return;
+ }
+
+ /**
+ * Create data item for use in stack
+ *
+ * @param string $content
+ * @param array $attributes
+ * @return stdClass
+ */
+ public function createData($content, array $attributes)
+ {
+ if (!isset($attributes['media'])) {
+ $attributes['media'] = 'screen';
+ } else if(is_array($attributes['media'])) {
+ $attributes['media'] = implode(',', $attributes['media']);
+ }
+
+ $data = new stdClass();
+ $data->content = $content;
+ $data->attributes = $attributes;
+
+ return $data;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/HeadTitle.php b/library/vendor/Zend/View/Helper/HeadTitle.php
new file mode 100644
index 0000000..77aef26
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/HeadTitle.php
@@ -0,0 +1,218 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_Placeholder_Container_Standalone */
+
+/**
+ * Helper for setting and retrieving title element for HTML head
+ *
+ * @uses Zend_View_Helper_Placeholder_Container_Standalone
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_HeadTitle extends Zend_View_Helper_Placeholder_Container_Standalone
+{
+ /**
+ * Registry key for placeholder
+ * @var string
+ */
+ protected $_regKey = 'Zend_View_Helper_HeadTitle';
+
+ /**
+ * Whether or not auto-translation is enabled
+ * @var boolean
+ */
+ protected $_translate = false;
+
+ /**
+ * Translation object
+ *
+ * @var Zend_Translate_Adapter
+ */
+ protected $_translator;
+
+ /**
+ * Default title rendering order (i.e. order in which each title attached)
+ *
+ * @var string
+ */
+ protected $_defaultAttachOrder = null;
+
+ /**
+ * Retrieve placeholder for title element and optionally set state
+ *
+ * @param string $title
+ * @param string $setType
+ * @return Zend_View_Helper_HeadTitle
+ */
+ public function headTitle($title = null, $setType = null)
+ {
+ if (null === $setType) {
+ $setType = (null === $this->getDefaultAttachOrder())
+ ? Zend_View_Helper_Placeholder_Container_Abstract::APPEND
+ : $this->getDefaultAttachOrder();
+ }
+ $title = (string) $title;
+ if ($title !== '') {
+ if ($setType == Zend_View_Helper_Placeholder_Container_Abstract::SET) {
+ $this->set($title);
+ } elseif ($setType == Zend_View_Helper_Placeholder_Container_Abstract::PREPEND) {
+ $this->prepend($title);
+ } else {
+ $this->append($title);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set a default order to add titles
+ *
+ * @param string $setType
+ */
+ public function setDefaultAttachOrder($setType)
+ {
+ if (!in_array($setType, array(
+ Zend_View_Helper_Placeholder_Container_Abstract::APPEND,
+ Zend_View_Helper_Placeholder_Container_Abstract::SET,
+ Zend_View_Helper_Placeholder_Container_Abstract::PREPEND
+ ))) {
+ throw new Zend_View_Exception("You must use a valid attach order: 'PREPEND', 'APPEND' or 'SET'");
+ }
+
+ $this->_defaultAttachOrder = $setType;
+ return $this;
+ }
+
+ /**
+ * Get the default attach order, if any.
+ *
+ * @return mixed
+ */
+ public function getDefaultAttachOrder()
+ {
+ return $this->_defaultAttachOrder;
+ }
+
+ /**
+ * Sets a translation Adapter for translation
+ *
+ * @param Zend_Translate|Zend_Translate_Adapter $translate
+ * @return Zend_View_Helper_HeadTitle
+ */
+ public function setTranslator($translate)
+ {
+ if ($translate instanceof Zend_Translate_Adapter) {
+ $this->_translator = $translate;
+ } elseif ($translate instanceof Zend_Translate) {
+ $this->_translator = $translate->getAdapter();
+ } else {
+ $e = new Zend_View_Exception("You must set an instance of Zend_Translate or Zend_Translate_Adapter");
+ $e->setView($this->view);
+ throw $e;
+ }
+ return $this;
+ }
+
+ /**
+ * Retrieve translation object
+ *
+ * If none is currently registered, attempts to pull it from the registry
+ * using the key 'Zend_Translate'.
+ *
+ * @return Zend_Translate_Adapter|null
+ */
+ public function getTranslator()
+ {
+ if (null === $this->_translator) {
+ if (Zend_Registry::isRegistered('Zend_Translate')) {
+ $this->setTranslator(Zend_Registry::get('Zend_Translate'));
+ }
+ }
+ return $this->_translator;
+ }
+
+ /**
+ * Enables translation
+ *
+ * @return Zend_View_Helper_HeadTitle
+ */
+ public function enableTranslation()
+ {
+ $this->_translate = true;
+ return $this;
+ }
+
+ /**
+ * Disables translation
+ *
+ * @return Zend_View_Helper_HeadTitle
+ */
+ public function disableTranslation()
+ {
+ $this->_translate = false;
+ return $this;
+ }
+
+ /**
+ * Turn helper into string
+ *
+ * @param string|null $indent
+ * @param string|null $locale
+ * @return string
+ */
+ public function toString($indent = null, $locale = null)
+ {
+ $indent = (null !== $indent)
+ ? $this->getWhitespace($indent)
+ : $this->getIndent();
+
+ $items = array();
+
+ if($this->_translate && $translator = $this->getTranslator()) {
+ foreach ($this as $item) {
+ $items[] = $translator->translate($item, $locale);
+ }
+ } else {
+ foreach ($this as $item) {
+ $items[] = $item;
+ }
+ }
+
+ $separator = $this->getSeparator();
+ $output = '';
+ if(($prefix = $this->getPrefix())) {
+ $output .= $prefix;
+ }
+ $output .= implode($separator, $items);
+ if(($postfix = $this->getPostfix())) {
+ $output .= $postfix;
+ }
+
+ $output = ($this->_autoEscape) ? $this->_escape($output) : $output;
+
+ return $indent . '<title>' . $output . '</title>';
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/HtmlElement.php b/library/vendor/Zend/View/Helper/HtmlElement.php
new file mode 100644
index 0000000..212afbd
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/HtmlElement.php
@@ -0,0 +1,165 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_View_Helper_Abstract
+ */
+
+/**
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_View_Helper_HtmlElement extends Zend_View_Helper_Abstract
+{
+ /**
+ * EOL character
+ */
+ const EOL = "\n";
+
+ /**
+ * The tag closing bracket
+ *
+ * @var string
+ */
+ protected $_closingBracket = null;
+
+ /**
+ * Get the tag closing bracket
+ *
+ * @return string
+ */
+ public function getClosingBracket()
+ {
+ if (!$this->_closingBracket) {
+ if ($this->_isXhtml()) {
+ $this->_closingBracket = ' />';
+ } else {
+ $this->_closingBracket = '>';
+ }
+ }
+
+ return $this->_closingBracket;
+ }
+
+ /**
+ * Is doctype XHTML?
+ *
+ * @return boolean
+ */
+ protected function _isXhtml()
+ {
+ $doctype = $this->view->doctype();
+ return $doctype->isXhtml();
+ }
+
+ /**
+ * Is doctype HTML5?
+ *
+ * @return boolean
+ */
+ protected function _isHtml5()
+ {
+ $doctype = $this->view->doctype();
+ return $doctype->isHtml5();
+ }
+
+ /**
+ * Is doctype strict?
+ *
+ * @return boolean
+ */
+ protected function _isStrictDoctype()
+ {
+ $doctype = $this->view->doctype();
+ return $doctype->isStrict();
+ }
+
+ /**
+ * Converts an associative array to a string of tag attributes.
+ *
+ * @access public
+ *
+ * @param array $attribs From this array, each key-value pair is
+ * converted to an attribute name and value.
+ *
+ * @return string The XHTML for the attributes.
+ */
+ protected function _htmlAttribs($attribs)
+ {
+ $xhtml = '';
+ foreach ((array) $attribs as $key => $val) {
+ $key = $this->view->escape($key);
+
+ if (('on' == substr($key, 0, 2)) || ('constraints' == $key)) {
+ // Don't escape event attributes; _do_ substitute double quotes with singles
+ if (!is_scalar($val)) {
+ // non-scalar data should be cast to JSON first
+ $val = Zend_Json::encode($val);
+ }
+ // Escape single quotes inside event attribute values.
+ // This will create html, where the attribute value has
+ // single quotes around it, and escaped single quotes or
+ // non-escaped double quotes inside of it
+ $val = str_replace('\'', '&#39;', $val);
+ } else {
+ if (is_array($val)) {
+ $val = implode(' ', $val);
+ }
+ $val = $this->view->escape($val);
+ }
+
+ if ('id' == $key) {
+ $val = $this->_normalizeId($val);
+ }
+
+ if (strpos($val, '"') !== false) {
+ $xhtml .= " $key='$val'";
+ } else {
+ $xhtml .= " $key=\"$val\"";
+ }
+
+ }
+ return $xhtml;
+ }
+
+ /**
+ * Normalize an ID
+ *
+ * @param string $value
+ * @return string
+ */
+ protected function _normalizeId($value)
+ {
+ if (strstr($value, '[')) {
+ if ('[]' == substr($value, -2)) {
+ $value = substr($value, 0, strlen($value) - 2);
+ }
+ $value = trim($value, ']');
+ $value = str_replace('][', '-', $value);
+ $value = str_replace('[', '-', $value);
+ }
+ return $value;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/HtmlFlash.php b/library/vendor/Zend/View/Helper/HtmlFlash.php
new file mode 100644
index 0000000..b33ad51
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/HtmlFlash.php
@@ -0,0 +1,59 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_View_Helper_HtmlObject
+ */
+
+/**
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_HtmlFlash extends Zend_View_Helper_HtmlObject
+{
+ /**
+ * Default file type for a flash applet
+ *
+ */
+ const TYPE = 'application/x-shockwave-flash';
+
+ /**
+ * Output a flash movie object tag
+ *
+ * @param string $data The flash file
+ * @param array $attribs Attribs for the object tag
+ * @param array $params Params for in the object tag
+ * @param string $content Alternative content
+ * @return string
+ */
+ public function htmlFlash($data, array $attribs = array(), array $params = array(), $content = null)
+ {
+ // Params
+ $params = array_merge(array('movie' => $data,
+ 'quality' => 'high'), $params);
+
+ return $this->htmlObject($data, self::TYPE, $attribs, $params, $content);
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/HtmlList.php b/library/vendor/Zend/View/Helper/HtmlList.php
new file mode 100644
index 0000000..e080eb1
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/HtmlList.php
@@ -0,0 +1,88 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Zend_View_Helper_FormELement
+ */
+
+/**
+ * Helper for ordered and unordered lists
+ *
+ * @uses Zend_View_Helper_FormElement
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_HtmlList extends Zend_View_Helper_FormElement
+{
+
+ /**
+ * Generates a 'List' element.
+ *
+ * @param array $items Array with the elements of the list
+ * @param boolean $ordered Specifies ordered/unordered list; default unordered
+ * @param array $attribs Attributes for the ol/ul tag.
+ * @return string The list XHTML.
+ */
+ public function htmlList(array $items, $ordered = false, $attribs = false, $escape = true)
+ {
+ if (!is_array($items)) {
+ $e = new Zend_View_Exception('First param must be an array');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ $list = '';
+
+ foreach ($items as $item) {
+ if (!is_array($item)) {
+ if ($escape) {
+ $item = $this->view->escape($item);
+ }
+ $list .= '<li>' . $item . '</li>' . self::EOL;
+ } else {
+ if (6 < strlen($list)) {
+ $list = substr($list, 0, strlen($list) - 6)
+ . $this->htmlList($item, $ordered, $attribs, $escape) . '</li>' . self::EOL;
+ } else {
+ $list .= '<li>' . $this->htmlList($item, $ordered, $attribs, $escape) . '</li>' . self::EOL;
+ }
+ }
+ }
+
+ if ($attribs) {
+ $attribs = $this->_htmlAttribs($attribs);
+ } else {
+ $attribs = '';
+ }
+
+ $tag = 'ul';
+ if ($ordered) {
+ $tag = 'ol';
+ }
+
+ return '<' . $tag . $attribs . '>' . self::EOL . $list . '</' . $tag . '>' . self::EOL;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/HtmlObject.php b/library/vendor/Zend/View/Helper/HtmlObject.php
new file mode 100644
index 0000000..a5a4e22
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/HtmlObject.php
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_View_Helper_HtmlElement
+ */
+
+/**
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_HtmlObject extends Zend_View_Helper_HtmlElement
+{
+ /**
+ * Output an object set
+ *
+ * @param string $data The data file
+ * @param string $type Data file type
+ * @param array $attribs Attribs for the object tag
+ * @param array $params Params for in the object tag
+ * @param string $content Alternative content for object
+ * @return string
+ */
+ public function htmlObject($data, $type, array $attribs = array(), array $params = array(), $content = null)
+ {
+ // Merge data and type
+ $attribs = array_merge(array('data' => $data,
+ 'type' => $type), $attribs);
+
+ // Params
+ $paramHtml = array();
+ $closingBracket = $this->getClosingBracket();
+
+ foreach ($params as $param => $options) {
+ if (is_string($options)) {
+ $options = array('value' => $options);
+ }
+
+ $options = array_merge(array('name' => $param), $options);
+
+ $paramHtml[] = '<param' . $this->_htmlAttribs($options) . $closingBracket;
+ }
+
+ // Content
+ if (is_array($content)) {
+ $content = implode(self::EOL, $content);
+ }
+
+ // Object header
+ $xhtml = '<object' . $this->_htmlAttribs($attribs) . '>' . self::EOL
+ . implode(self::EOL, $paramHtml) . self::EOL
+ . ($content ? $content . self::EOL : '')
+ . '</object>';
+
+ return $xhtml;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/HtmlPage.php b/library/vendor/Zend/View/Helper/HtmlPage.php
new file mode 100644
index 0000000..2a2265c
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/HtmlPage.php
@@ -0,0 +1,74 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_View_Helper_HtmlObject
+ */
+
+/**
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_HtmlPage extends Zend_View_Helper_HtmlObject
+{
+ /**
+ * Default file type for html
+ *
+ */
+ const TYPE = 'text/html';
+
+ /**
+ * Object classid
+ *
+ */
+ const ATTRIB_CLASSID = 'clsid:25336920-03F9-11CF-8FD0-00AA00686F13';
+
+ /**
+ * Default attributes
+ *
+ * @var array
+ */
+ protected $_attribs = array('classid' => self::ATTRIB_CLASSID);
+
+ /**
+ * Output a html object tag
+ *
+ * @param string $data The html url
+ * @param array $attribs Attribs for the object tag
+ * @param array $params Params for in the object tag
+ * @param string $content Alternative content
+ * @return string
+ */
+ public function htmlPage($data, array $attribs = array(), array $params = array(), $content = null)
+ {
+ // Attrs
+ $attribs = array_merge($this->_attribs, $attribs);
+
+ // Params
+ $params = array_merge(array('data' => $data), $params);
+
+ return $this->htmlObject($data, self::TYPE, $attribs, $params, $content);
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/HtmlQuicktime.php b/library/vendor/Zend/View/Helper/HtmlQuicktime.php
new file mode 100644
index 0000000..f09452d
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/HtmlQuicktime.php
@@ -0,0 +1,81 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @see Zend_View_Helper_HtmlObject
+ */
+
+/**
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_HtmlQuicktime extends Zend_View_Helper_HtmlObject
+{
+ /**
+ * Default file type for a movie applet
+ *
+ */
+ const TYPE = 'video/quicktime';
+
+ /**
+ * Object classid
+ *
+ */
+ const ATTRIB_CLASSID = 'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B';
+
+ /**
+ * Object Codebase
+ *
+ */
+ const ATTRIB_CODEBASE = 'http://www.apple.com/qtactivex/qtplugin.cab';
+
+ /**
+ * Default attributes
+ *
+ * @var array
+ */
+ protected $_attribs = array('classid' => self::ATTRIB_CLASSID,
+ 'codebase' => self::ATTRIB_CODEBASE);
+
+ /**
+ * Output a quicktime movie object tag
+ *
+ * @param string $data The quicktime file
+ * @param array $attribs Attribs for the object tag
+ * @param array $params Params for in the object tag
+ * @param string $content Alternative content
+ * @return string
+ */
+ public function htmlQuicktime($data, array $attribs = array(), array $params = array(), $content = null)
+ {
+ // Attrs
+ $attribs = array_merge($this->_attribs, $attribs);
+
+ // Params
+ $params = array_merge(array('src' => $data), $params);
+
+ return $this->htmlObject($data, self::TYPE, $attribs, $params, $content);
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/InlineScript.php b/library/vendor/Zend/View/Helper/InlineScript.php
new file mode 100644
index 0000000..555a2f4
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/InlineScript.php
@@ -0,0 +1,60 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_HeadScript */
+
+/**
+ * Helper for setting and retrieving script elements for inclusion in HTML body
+ * section
+ *
+ * @uses Zend_View_Helper_Head_Script
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_InlineScript extends Zend_View_Helper_HeadScript
+{
+ /**
+ * Registry key for placeholder
+ * @var string
+ */
+ protected $_regKey = 'Zend_View_Helper_InlineScript';
+
+ /**
+ * Return InlineScript object
+ *
+ * Returns InlineScript helper object; optionally, allows specifying a
+ * script or script file to include.
+ *
+ * @param string $mode Script or file
+ * @param string $spec Script/url
+ * @param string $placement Append, prepend, or set
+ * @param array $attrs Array of script attributes
+ * @param string $type Script type and/or array of script attributes
+ * @return Zend_View_Helper_InlineScript
+ */
+ public function inlineScript($mode = Zend_View_Helper_HeadScript::FILE, $spec = null, $placement = 'APPEND', array $attrs = array(), $type = 'text/javascript')
+ {
+ return $this->headScript($mode, $spec, $placement, $attrs, $type);
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/Interface.php b/library/vendor/Zend/View/Helper/Interface.php
new file mode 100644
index 0000000..c7e761b
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Interface.php
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_View_Helper_Interface
+{
+ /**
+ * Set the View object
+ *
+ * @param Zend_View_Interface $view
+ * @return Zend_View_Helper_Interface
+ */
+ public function setView(Zend_View_Interface $view);
+
+ /**
+ * Strategy pattern: helper method to invoke
+ *
+ * @return mixed
+ */
+ public function direct();
+}
diff --git a/library/vendor/Zend/View/Helper/Json.php b/library/vendor/Zend/View/Helper/Json.php
new file mode 100644
index 0000000..62bf079
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Json.php
@@ -0,0 +1,86 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Json */
+
+/** Zend_Controller_Front */
+
+/** Zend_View_Helper_Abstract.php */
+
+/**
+ * Helper for simplifying JSON responses
+ *
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_Json extends Zend_View_Helper_Abstract
+{
+ /**
+ * Encode data as JSON, disable layouts, and set response header
+ *
+ * If $keepLayouts is true, does not disable layouts.
+ * If $encodeJson is false, does not JSON-encode $data
+ *
+ * @param mixed $data
+ * @param bool $keepLayouts
+ * NOTE: if boolean, establish $keepLayouts to true|false
+ * if array, admit params for Zend_Json::encode as enableJsonExprFinder=>true|false
+ * this array can contains a 'keepLayout'=>true|false and/or 'encodeData'=>true|false
+ * that will not be passed to Zend_Json::encode method but will be used here
+ * @param bool $encodeData
+ * @return string|void
+ */
+ public function json($data, $keepLayouts = false, $encodeData = true)
+ {
+ $options = array();
+ if (is_array($keepLayouts)) {
+ $options = $keepLayouts;
+
+ $keepLayouts = false;
+ if (array_key_exists('keepLayouts', $options)) {
+ $keepLayouts = $options['keepLayouts'];
+ unset($options['keepLayouts']);
+ }
+
+ if (array_key_exists('encodeData', $options)) {
+ $encodeData = $options['encodeData'];
+ unset($options['encodeData']);
+ }
+ }
+
+ if ($encodeData) {
+ $data = Zend_Json::encode($data, null, $options);
+ }
+ if (!$keepLayouts) {
+ $layout = Zend_Layout::getMvcInstance();
+ if ($layout instanceof Zend_Layout) {
+ $layout->disableLayout();
+ }
+ }
+
+ $response = Zend_Controller_Front::getInstance()->getResponse();
+ $response->setHeader('Content-Type', 'application/json', true);
+ return $data;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/Layout.php b/library/vendor/Zend/View/Helper/Layout.php
new file mode 100644
index 0000000..a83bf06
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Layout.php
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_Abstract.php */
+
+/**
+ * View helper for retrieving layout object
+ *
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_Layout extends Zend_View_Helper_Abstract
+{
+ /** @var Zend_Layout */
+ protected $_layout;
+
+ /**
+ * Get layout object
+ *
+ * @return Zend_Layout
+ */
+ public function getLayout()
+ {
+ if (null === $this->_layout) {
+ $this->_layout = Zend_Layout::getMvcInstance();
+ if (null === $this->_layout) {
+ // Implicitly creates layout object
+ $this->_layout = new Zend_Layout();
+ }
+ }
+
+ return $this->_layout;
+ }
+
+ /**
+ * Set layout object
+ *
+ * @param Zend_Layout $layout
+ * @return Zend_Layout_Controller_Action_Helper_Layout
+ */
+ public function setLayout(Zend_Layout $layout)
+ {
+ $this->_layout = $layout;
+ return $this;
+ }
+
+ /**
+ * Return layout object
+ *
+ * Usage: $this->layout()->setLayout('alternate');
+ *
+ * @return Zend_Layout
+ */
+ public function layout()
+ {
+ return $this->getLayout();
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/PaginationControl.php b/library/vendor/Zend/View/Helper/PaginationControl.php
new file mode 100644
index 0000000..b474963
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/PaginationControl.php
@@ -0,0 +1,142 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * @category Zend
+ * @package Zend_View
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_PaginationControl
+{
+ /**
+ * View instance
+ *
+ * @var Zend_View_Instance
+ */
+ public $view = null;
+
+ /**
+ * Default view partial
+ *
+ * @var string|array
+ */
+ protected static $_defaultViewPartial = null;
+
+ /**
+ * Sets the view instance.
+ *
+ * @param Zend_View_Interface $view View instance
+ * @return Zend_View_Helper_PaginationControl
+ */
+ public function setView(Zend_View_Interface $view)
+ {
+ $this->view = $view;
+ return $this;
+ }
+
+ /**
+ * Sets the default view partial.
+ *
+ * @param string|array $partial View partial
+ */
+ public static function setDefaultViewPartial($partial)
+ {
+ self::$_defaultViewPartial = $partial;
+ }
+
+ /**
+ * Gets the default view partial
+ *
+ * @return string|array
+ */
+ public static function getDefaultViewPartial()
+ {
+ return self::$_defaultViewPartial;
+ }
+
+ /**
+ * Render the provided pages. This checks if $view->paginator is set and,
+ * if so, uses that. Also, if no scrolling style or partial are specified,
+ * the defaults will be used (if set).
+ *
+ * @param Zend_Paginator (Optional) $paginator
+ * @param string $scrollingStyle (Optional) Scrolling style
+ * @param string $partial (Optional) View partial
+ * @param array|string $params (Optional) params to pass to the partial
+ * @return string
+ * @throws Zend_View_Exception
+ */
+ public function paginationControl(Zend_Paginator $paginator = null, $scrollingStyle = null, $partial = null, $params = null)
+ {
+ if ($paginator === null) {
+ if (isset($this->view->paginator) and $this->view->paginator !== null and $this->view->paginator instanceof Zend_Paginator) {
+ $paginator = $this->view->paginator;
+ } else {
+ /**
+ * @see Zend_View_Exception
+ */
+
+ $e = new Zend_View_Exception('No paginator instance provided or incorrect type');
+ $e->setView($this->view);
+ throw $e;
+ }
+ }
+
+ if ($partial === null) {
+ if (self::$_defaultViewPartial === null) {
+ /**
+ * @see Zend_View_Exception
+ */
+ $e = new Zend_View_Exception('No view partial provided and no default set');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ $partial = self::$_defaultViewPartial;
+ }
+
+ $pages = get_object_vars($paginator->getPages($scrollingStyle));
+
+ if ($params !== null) {
+ $pages = array_merge($pages, (array) $params);
+ }
+
+ if (is_array($partial)) {
+ if (count($partial) != 2) {
+ /**
+ * @see Zend_View_Exception
+ */
+ $e = new Zend_View_Exception('A view partial supplied as an array must contain two values: the filename and its module');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ if ($partial[1] !== null) {
+ return $this->view->partial($partial[0], $partial[1], $pages);
+ }
+
+ $partial = $partial[0];
+ }
+
+ return $this->view->partial($partial, $pages);
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/Partial.php b/library/vendor/Zend/View/Helper/Partial.php
new file mode 100644
index 0000000..787db9c
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Partial.php
@@ -0,0 +1,150 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_Abstract.php */
+
+/**
+ * Helper for rendering a template fragment in its own variable scope.
+ *
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_Partial extends Zend_View_Helper_Abstract
+{
+ /**
+ * Variable to which object will be assigned
+ * @var string
+ */
+ protected $_objectKey;
+
+ /**
+ * Renders a template fragment within a variable scope distinct from the
+ * calling View object.
+ *
+ * If no arguments are passed, returns the helper instance.
+ *
+ * If the $model is an array, it is passed to the view object's assign()
+ * method.
+ *
+ * If the $model is an object, it first checks to see if the object
+ * implements a 'toArray' method; if so, it passes the result of that
+ * method to to the view object's assign() method. Otherwise, the result of
+ * get_object_vars() is passed.
+ *
+ * @param string $name Name of view script
+ * @param string|array $module If $model is empty, and $module is an array,
+ * these are the variables to populate in the
+ * view. Otherwise, the module in which the
+ * partial resides
+ * @param array $model Variables to populate in the view
+ * @return string|Zend_View_Helper_Partial
+ */
+ public function partial($name = null, $module = null, $model = null)
+ {
+ if (0 == func_num_args()) {
+ return $this;
+ }
+
+ $view = $this->cloneView();
+ if (isset($this->partialCounter)) {
+ $view->partialCounter = $this->partialCounter;
+ }
+ if (isset($this->partialTotalCount)) {
+ $view->partialTotalCount = $this->partialTotalCount;
+ }
+
+ if ((null !== $module) && is_string($module)) {
+ $moduleDir = Zend_Controller_Front::getInstance()->getControllerDirectory($module);
+ if (null === $moduleDir) {
+ $e = new Zend_View_Helper_Partial_Exception('Cannot render partial; module does not exist');
+ $e->setView($this->view);
+ throw $e;
+ }
+ $viewsDir = dirname($moduleDir) . '/views';
+ $view->addBasePath($viewsDir);
+ } elseif ((null == $model) && (null !== $module)
+ && (is_array($module) || is_object($module)))
+ {
+ $model = $module;
+ }
+
+ if (!empty($model)) {
+ if (is_array($model)) {
+ $view->assign($model);
+ } elseif (is_object($model)) {
+ if (null !== ($objectKey = $this->getObjectKey())) {
+ $view->assign($objectKey, $model);
+ } elseif (method_exists($model, 'toArray')) {
+ $view->assign($model->toArray());
+ } else {
+ $view->assign(get_object_vars($model));
+ }
+ }
+ }
+
+ return $view->render($name);
+ }
+
+ /**
+ * Clone the current View
+ *
+ * @return Zend_View_Interface
+ */
+ public function cloneView()
+ {
+ $view = clone $this->view;
+ $view->clearVars();
+ return $view;
+ }
+
+ /**
+ * Set object key
+ *
+ * @param string $key
+ * @return Zend_View_Helper_Partial
+ */
+ public function setObjectKey($key)
+ {
+ if (null === $key) {
+ $this->_objectKey = null;
+ } else {
+ $this->_objectKey = (string) $key;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Retrieve object key
+ *
+ * The objectKey is the variable to which an object in the iterator will be
+ * assigned.
+ *
+ * @return null|string
+ */
+ public function getObjectKey()
+ {
+ return $this->_objectKey;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/Partial/Exception.php b/library/vendor/Zend/View/Helper/Partial/Exception.php
new file mode 100644
index 0000000..5cd850a
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Partial/Exception.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+
+/** Zend_View_Exception */
+
+
+/**
+ * Exception for Zend_View_Helper_Partial class.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_Partial_Exception extends Zend_View_Exception
+{
+}
diff --git a/library/vendor/Zend/View/Helper/PartialLoop.php b/library/vendor/Zend/View/Helper/PartialLoop.php
new file mode 100644
index 0000000..12125b4
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/PartialLoop.php
@@ -0,0 +1,98 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_Partial */
+
+/**
+ * Helper for rendering a template fragment in its own variable scope; iterates
+ * over data provided and renders for each iteration.
+ *
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_PartialLoop extends Zend_View_Helper_Partial
+{
+
+ /**
+ * Marker to where the pointer is at in the loop
+ * @var integer
+ */
+ protected $partialCounter = 0;
+
+ /**
+ * Renders a template fragment within a variable scope distinct from the
+ * calling View object.
+ *
+ * If no arguments are provided, returns object instance.
+ *
+ * @param string $name Name of view script
+ * @param string|array $module If $model is empty, and $module is an array,
+ * these are the variables to populate in the
+ * view. Otherwise, the module in which the
+ * partial resides
+ * @param array $model Variables to populate in the view
+ * @return string
+ */
+ public function partialLoop($name = null, $module = null, $model = null)
+ {
+ if (0 == func_num_args()) {
+ return $this;
+ }
+
+ if ((null === $model) && (null !== $module)) {
+ $model = $module;
+ $module = null;
+ }
+
+ if (!is_array($model)
+ && (!$model instanceof Traversable)
+ && (is_object($model) && !method_exists($model, 'toArray'))
+ ) {
+ $e = new Zend_View_Helper_Partial_Exception('PartialLoop helper requires iterable data');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ if (is_object($model)
+ && (!$model instanceof Traversable)
+ && method_exists($model, 'toArray')
+ ) {
+ $model = $model->toArray();
+ }
+
+ $content = '';
+ // reset the counter if it's call again
+ $this->partialCounter = 0;
+ $this->partialTotalCount = count($model);
+
+ foreach ($model as $item) {
+ // increment the counter variable
+ $this->partialCounter++;
+
+ $content .= $this->partial($name, $module, $item);
+ }
+
+ return $content;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/Placeholder.php b/library/vendor/Zend/View/Helper/Placeholder.php
new file mode 100644
index 0000000..3ca47ad
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Placeholder.php
@@ -0,0 +1,85 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_Placeholder_Registry */
+
+/** Zend_View_Helper_Abstract.php */
+
+/**
+ * Helper for passing data between otherwise segregated Views. It's called
+ * Placeholder to make its typical usage obvious, but can be used just as easily
+ * for non-Placeholder things. That said, the support for this is only
+ * guaranteed to effect subsequently rendered templates, and of course Layouts.
+ *
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_Placeholder extends Zend_View_Helper_Abstract
+{
+ /**
+ * Placeholder items
+ * @var array
+ */
+ protected $_items = array();
+
+ /**
+ * @var Zend_View_Helper_Placeholder_Registry
+ */
+ protected $_registry;
+
+ /**
+ * Constructor
+ *
+ * Retrieve container registry from Zend_Registry, or create new one and register it.
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ $this->_registry = Zend_View_Helper_Placeholder_Registry::getRegistry();
+ }
+
+
+ /**
+ * Placeholder helper
+ *
+ * @param string $name
+ * @return Zend_View_Helper_Placeholder_Container_Abstract
+ */
+ public function placeholder($name)
+ {
+ $name = (string) $name;
+ return $this->_registry->getContainer($name);
+ }
+
+ /**
+ * Retrieve the registry
+ *
+ * @return Zend_View_Helper_Placeholder_Registry
+ */
+ public function getRegistry()
+ {
+ return $this->_registry;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/Placeholder/Container.php b/library/vendor/Zend/View/Helper/Placeholder/Container.php
new file mode 100644
index 0000000..c30025a
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Placeholder/Container.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_Placeholder_Container_Abstract */
+
+/**
+ * Container for placeholder values
+ *
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_Placeholder_Container extends Zend_View_Helper_Placeholder_Container_Abstract
+{
+}
diff --git a/library/vendor/Zend/View/Helper/Placeholder/Container/Abstract.php b/library/vendor/Zend/View/Helper/Placeholder/Container/Abstract.php
new file mode 100644
index 0000000..d015c1d
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Placeholder/Container/Abstract.php
@@ -0,0 +1,384 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/**
+ * Abstract class representing container for placeholder values
+ *
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_View_Helper_Placeholder_Container_Abstract extends ArrayObject
+{
+ /**
+ * Whether or not to override all contents of placeholder
+ * @const string
+ */
+ const SET = 'SET';
+
+ /**
+ * Whether or not to append contents to placeholder
+ * @const string
+ */
+ const APPEND = 'APPEND';
+
+ /**
+ * Whether or not to prepend contents to placeholder
+ * @const string
+ */
+ const PREPEND = 'PREPEND';
+
+ /**
+ * What text to prefix the placeholder with when rendering
+ * @var string
+ */
+ protected $_prefix = '';
+
+ /**
+ * What text to append the placeholder with when rendering
+ * @var string
+ */
+ protected $_postfix = '';
+
+ /**
+ * What string to use between individual items in the placeholder when rendering
+ * @var string
+ */
+ protected $_separator = '';
+
+ /**
+ * What string to use as the indentation of output, this will typically be spaces. Eg: ' '
+ * @var string
+ */
+ protected $_indent = '';
+
+ /**
+ * Whether or not we're already capturing for this given container
+ * @var bool
+ */
+ protected $_captureLock = false;
+
+ /**
+ * What type of capture (overwrite (set), append, prepend) to use
+ * @var string
+ */
+ protected $_captureType;
+
+ /**
+ * Key to which to capture content
+ * @var string
+ */
+ protected $_captureKey;
+
+ /**
+ * Constructor - This is needed so that we can attach a class member as the ArrayObject container
+ *
+ * @return \Zend_View_Helper_Placeholder_Container_Abstract
+ */
+ public function __construct()
+ {
+ parent::__construct(array(), parent::ARRAY_AS_PROPS);
+ }
+
+ /**
+ * Set a single value
+ *
+ * @param mixed $value
+ * @return void
+ */
+ public function set($value)
+ {
+ $this->exchangeArray(array($value));
+ }
+
+ /**
+ * Prepend a value to the top of the container
+ *
+ * @param mixed $value
+ * @return void
+ */
+ public function prepend($value)
+ {
+ $values = $this->getArrayCopy();
+ array_unshift($values, $value);
+ $this->exchangeArray($values);
+ }
+
+ /**
+ * Retrieve container value
+ *
+ * If single element registered, returns that element; otherwise,
+ * serializes to array.
+ *
+ * @return mixed
+ */
+ public function getValue()
+ {
+ if (1 == count($this)) {
+ $keys = $this->getKeys();
+ $key = array_shift($keys);
+ return $this[$key];
+ }
+
+ return $this->getArrayCopy();
+ }
+
+ /**
+ * Set prefix for __toString() serialization
+ *
+ * @param string $prefix
+ * @return Zend_View_Helper_Placeholder_Container
+ */
+ public function setPrefix($prefix)
+ {
+ $this->_prefix = (string) $prefix;
+ return $this;
+ }
+
+ /**
+ * Retrieve prefix
+ *
+ * @return string
+ */
+ public function getPrefix()
+ {
+ return $this->_prefix;
+ }
+
+ /**
+ * Set postfix for __toString() serialization
+ *
+ * @param string $postfix
+ * @return Zend_View_Helper_Placeholder_Container
+ */
+ public function setPostfix($postfix)
+ {
+ $this->_postfix = (string) $postfix;
+ return $this;
+ }
+
+ /**
+ * Retrieve postfix
+ *
+ * @return string
+ */
+ public function getPostfix()
+ {
+ return $this->_postfix;
+ }
+
+ /**
+ * Set separator for __toString() serialization
+ *
+ * Used to implode elements in container
+ *
+ * @param string $separator
+ * @return Zend_View_Helper_Placeholder_Container
+ */
+ public function setSeparator($separator)
+ {
+ $this->_separator = (string) $separator;
+ return $this;
+ }
+
+ /**
+ * Retrieve separator
+ *
+ * @return string
+ */
+ public function getSeparator()
+ {
+ return $this->_separator;
+ }
+
+ /**
+ * Set the indentation string for __toString() serialization,
+ * optionally, if a number is passed, it will be the number of spaces
+ *
+ * @param string|int $indent
+ * @return Zend_View_Helper_Placeholder_Container_Abstract
+ */
+ public function setIndent($indent)
+ {
+ $this->_indent = $this->getWhitespace($indent);
+ return $this;
+ }
+
+ /**
+ * Retrieve indentation
+ *
+ * @return string
+ */
+ public function getIndent()
+ {
+ return $this->_indent;
+ }
+
+ /**
+ * Retrieve whitespace representation of $indent
+ *
+ * @param int|string $indent
+ * @return string
+ */
+ public function getWhitespace($indent)
+ {
+ if (is_int($indent)) {
+ $indent = str_repeat(' ', $indent);
+ }
+
+ return (string) $indent;
+ }
+
+ /**
+ * Start capturing content to push into placeholder
+ *
+ * @param int|string $type How to capture content into placeholder; append, prepend, or set
+ * @param null $key
+ * @throws Zend_View_Helper_Placeholder_Container_Exception
+ * @return void
+ */
+ public function captureStart($type = Zend_View_Helper_Placeholder_Container_Abstract::APPEND, $key = null)
+ {
+ if ($this->_captureLock) {
+ $e = new Zend_View_Helper_Placeholder_Container_Exception('Cannot nest placeholder captures for the same placeholder');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ $this->_captureLock = true;
+ $this->_captureType = $type;
+ if ((null !== $key) && is_scalar($key)) {
+ $this->_captureKey = (string) $key;
+ }
+ ob_start();
+ }
+
+ /**
+ * End content capture
+ *
+ * @return void
+ */
+ public function captureEnd()
+ {
+ $data = ob_get_clean();
+ $key = null;
+ $this->_captureLock = false;
+ if (null !== $this->_captureKey) {
+ $key = $this->_captureKey;
+ }
+ switch ($this->_captureType) {
+ case self::SET:
+ if (null !== $key) {
+ $this[$key] = $data;
+ } else {
+ $this->exchangeArray(array($data));
+ }
+ break;
+ case self::PREPEND:
+ if (null !== $key) {
+ $array = array($key => $data);
+ $values = $this->getArrayCopy();
+ $final = $array + $values;
+ $this->exchangeArray($final);
+ } else {
+ $this->prepend($data);
+ }
+ break;
+ case self::APPEND:
+ default:
+ if (null !== $key) {
+ if (empty($this[$key])) {
+ $this[$key] = $data;
+ } else {
+ $this[$key] .= $data;
+ }
+ } else {
+ $this[$this->nextIndex()] = $data;
+ }
+ break;
+ }
+ }
+
+ /**
+ * Get keys
+ *
+ * @return array
+ */
+ public function getKeys()
+ {
+ $array = $this->getArrayCopy();
+ return array_keys($array);
+ }
+
+ /**
+ * Next Index
+ *
+ * as defined by the PHP manual
+ * @return int
+ */
+ public function nextIndex()
+ {
+ $keys = $this->getKeys();
+ if (0 == count($keys)) {
+ return 0;
+ }
+
+ return $nextIndex = max($keys) + 1;
+ }
+
+ /**
+ * Render the placeholder
+ *
+ * @param null $indent
+ * @return string
+ */
+ public function toString($indent = null)
+ {
+ // Check items
+ if (0 === $this->count()) {
+ return '';
+ }
+
+ $indent = ($indent !== null)
+ ? $this->getWhitespace($indent)
+ : $this->getIndent();
+
+ $items = $this->getArrayCopy();
+ $return = $indent
+ . $this->getPrefix()
+ . implode($this->getSeparator(), $items)
+ . $this->getPostfix();
+ $return = preg_replace("/(\r\n?|\n)/", '$1' . $indent, $return);
+ return $return;
+ }
+
+ /**
+ * Serialize object to string
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->toString();
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/Placeholder/Container/Exception.php b/library/vendor/Zend/View/Helper/Placeholder/Container/Exception.php
new file mode 100644
index 0000000..aceb769
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Placeholder/Container/Exception.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+
+/** Zend_View_Exception */
+
+
+/**
+ * Exception for Zend_View_Helper_Placeholder_Container class.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_Placeholder_Container_Exception extends Zend_View_Exception
+{
+}
diff --git a/library/vendor/Zend/View/Helper/Placeholder/Container/Standalone.php b/library/vendor/Zend/View/Helper/Placeholder/Container/Standalone.php
new file mode 100644
index 0000000..c875ca7
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Placeholder/Container/Standalone.php
@@ -0,0 +1,322 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_Placeholder_Registry */
+
+/** Zend_View_Helper_Abstract.php */
+
+/**
+ * Base class for targetted placeholder helpers
+ *
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+abstract class Zend_View_Helper_Placeholder_Container_Standalone extends Zend_View_Helper_Abstract implements IteratorAggregate, Countable, ArrayAccess
+{
+ /**
+ * @var Zend_View_Helper_Placeholder_Container_Abstract
+ */
+ protected $_container;
+
+ /**
+ * @var Zend_View_Helper_Placeholder_Registry
+ */
+ protected $_registry;
+
+ /**
+ * Registry key under which container registers itself
+ * @var string
+ */
+ protected $_regKey;
+
+ /**
+ * Flag wheter to automatically escape output, must also be
+ * enforced in the child class if __toString/toString is overriden
+ * @var book
+ */
+ protected $_autoEscape = true;
+
+ /**
+ * Constructor
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ $this->setRegistry(Zend_View_Helper_Placeholder_Registry::getRegistry());
+ $this->setContainer($this->getRegistry()->getContainer($this->_regKey));
+ }
+
+ /**
+ * Retrieve registry
+ *
+ * @return Zend_View_Helper_Placeholder_Registry
+ */
+ public function getRegistry()
+ {
+ return $this->_registry;
+ }
+
+ /**
+ * Set registry object
+ *
+ * @param Zend_View_Helper_Placeholder_Registry $registry
+ * @return Zend_View_Helper_Placeholder_Container_Standalone
+ */
+ public function setRegistry(Zend_View_Helper_Placeholder_Registry $registry)
+ {
+ $this->_registry = $registry;
+ return $this;
+ }
+
+ /**
+ * Set whether or not auto escaping should be used
+ *
+ * @param bool $autoEscape whether or not to auto escape output
+ * @return Zend_View_Helper_Placeholder_Container_Standalone
+ */
+ public function setAutoEscape($autoEscape = true)
+ {
+ $this->_autoEscape = ($autoEscape) ? true : false;
+ return $this;
+ }
+
+ /**
+ * Return whether autoEscaping is enabled or disabled
+ *
+ * return bool
+ */
+ public function getAutoEscape()
+ {
+ return $this->_autoEscape;
+ }
+
+ /**
+ * Escape a string
+ *
+ * @param string $string
+ * @return string
+ */
+ protected function _escape($string)
+ {
+ $enc = 'UTF-8';
+ if ($this->view instanceof Zend_View_Interface
+ && method_exists($this->view, 'getEncoding')
+ ) {
+ $enc = $this->view->getEncoding();
+ }
+
+ return htmlspecialchars((string) $string, ENT_COMPAT, $enc);
+ }
+
+ /**
+ * Set container on which to operate
+ *
+ * @param Zend_View_Helper_Placeholder_Container_Abstract $container
+ * @return Zend_View_Helper_Placeholder_Container_Standalone
+ */
+ public function setContainer(Zend_View_Helper_Placeholder_Container_Abstract $container)
+ {
+ $this->_container = $container;
+ return $this;
+ }
+
+ /**
+ * Retrieve placeholder container
+ *
+ * @return Zend_View_Helper_Placeholder_Container_Abstract
+ */
+ public function getContainer()
+ {
+ return $this->_container;
+ }
+
+ /**
+ * Overloading: set property value
+ *
+ * @param string $key
+ * @param mixed $value
+ * @return void
+ */
+ public function __set($key, $value)
+ {
+ $container = $this->getContainer();
+ $container[$key] = $value;
+ }
+
+ /**
+ * Overloading: retrieve property
+ *
+ * @param string $key
+ * @return mixed
+ */
+ public function __get($key)
+ {
+ $container = $this->getContainer();
+ if (isset($container[$key])) {
+ return $container[$key];
+ }
+
+ return null;
+ }
+
+ /**
+ * Overloading: check if property is set
+ *
+ * @param string $key
+ * @return bool
+ */
+ public function __isset($key)
+ {
+ $container = $this->getContainer();
+ return isset($container[$key]);
+ }
+
+ /**
+ * Overloading: unset property
+ *
+ * @param string $key
+ * @return void
+ */
+ public function __unset($key)
+ {
+ $container = $this->getContainer();
+ if (isset($container[$key])) {
+ unset($container[$key]);
+ }
+ }
+
+ /**
+ * Overload
+ *
+ * Proxy to container methods
+ *
+ * @param string $method
+ * @param array $args
+ * @return mixed
+ */
+ public function __call($method, $args)
+ {
+ $container = $this->getContainer();
+ if (method_exists($container, $method)) {
+ $return = call_user_func_array(array($container, $method), $args);
+ if ($return === $container) {
+ // If the container is returned, we really want the current object
+ return $this;
+ }
+ return $return;
+ }
+
+ $e = new Zend_View_Exception('Method "' . $method . '" does not exist');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ /**
+ * String representation
+ *
+ * @return string
+ */
+ public function toString()
+ {
+ return $this->getContainer()->toString();
+ }
+
+ /**
+ * Cast to string representation
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->toString();
+ }
+
+ /**
+ * Countable
+ *
+ * @return int
+ */
+ public function count(): int
+ {
+ $container = $this->getContainer();
+ return count($container);
+ }
+
+ /**
+ * ArrayAccess: offsetExists
+ *
+ * @param string|int $offset
+ * @return bool
+ */
+ public function offsetExists($offset): bool
+ {
+ return $this->getContainer()->offsetExists($offset);
+ }
+
+ /**
+ * ArrayAccess: offsetGet
+ *
+ * @param string|int $offset
+ * @return mixed
+ */
+ #[\ReturnTypeWillChange]
+ public function offsetGet($offset)
+ {
+ return $this->getContainer()->offsetGet($offset);
+ }
+
+ /**
+ * ArrayAccess: offsetSet
+ *
+ * @param string|int $offset
+ * @param mixed $value
+ * @return void
+ */
+ public function offsetSet($offset, $value): void
+ {
+ $this->getContainer()->offsetSet($offset, $value);
+ }
+
+ /**
+ * ArrayAccess: offsetUnset
+ *
+ * @param string|int $offset
+ * @return void
+ */
+ public function offsetUnset($offset): void
+ {
+ $this->getContainer()->offsetUnset($offset);
+ }
+
+ /**
+ * IteratorAggregate: get Iterator
+ *
+ * @return Iterator
+ */
+ public function getIterator(): Traversable
+ {
+ return $this->getContainer()->getIterator();
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/Placeholder/Registry.php b/library/vendor/Zend/View/Helper/Placeholder/Registry.php
new file mode 100644
index 0000000..111604c
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Placeholder/Registry.php
@@ -0,0 +1,183 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_Registry */
+
+/** Zend_View_Helper_Placeholder_Container_Abstract */
+
+/** Zend_View_Helper_Placeholder_Container */
+
+/**
+ * Registry for placeholder containers
+ *
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_Placeholder_Registry
+{
+ /**
+ * Zend_Registry key under which placeholder registry exists
+ * @const string
+ */
+ const REGISTRY_KEY = 'Zend_View_Helper_Placeholder_Registry';
+
+ /**
+ * Default container class
+ * @var string
+ */
+ protected $_containerClass = 'Zend_View_Helper_Placeholder_Container';
+
+ /**
+ * Placeholder containers
+ * @var array
+ */
+ protected $_items = array();
+
+ /**
+ * Retrieve or create registry instnace
+ *
+ * @return void
+ */
+ public static function getRegistry()
+ {
+ if (Zend_Registry::isRegistered(self::REGISTRY_KEY)) {
+ $registry = Zend_Registry::get(self::REGISTRY_KEY);
+ } else {
+ $registry = new self();
+ Zend_Registry::set(self::REGISTRY_KEY, $registry);
+ }
+
+ return $registry;
+ }
+
+ /**
+ * createContainer
+ *
+ * @param string $key
+ * @param array $value
+ * @return Zend_View_Helper_Placeholder_Container_Abstract
+ */
+ public function createContainer($key, array $value = array())
+ {
+ $key = (string) $key;
+
+ $this->_items[$key] = new $this->_containerClass($value);
+ return $this->_items[$key];
+ }
+
+ /**
+ * Retrieve a placeholder container
+ *
+ * @param string $key
+ * @return Zend_View_Helper_Placeholder_Container_Abstract
+ */
+ public function getContainer($key)
+ {
+ $key = (string) $key;
+ if (isset($this->_items[$key])) {
+ return $this->_items[$key];
+ }
+
+ $container = $this->createContainer($key);
+
+ return $container;
+ }
+
+ /**
+ * Does a particular container exist?
+ *
+ * @param string $key
+ * @return bool
+ */
+ public function containerExists($key)
+ {
+ $key = (string) $key;
+ $return = array_key_exists($key, $this->_items);
+ return $return;
+ }
+
+ /**
+ * Set the container for an item in the registry
+ *
+ * @param string $key
+ * @param Zend_View_Placeholder_Container_Abstract $container
+ * @return Zend_View_Placeholder_Registry
+ */
+ public function setContainer($key, Zend_View_Helper_Placeholder_Container_Abstract $container)
+ {
+ $key = (string) $key;
+ $this->_items[$key] = $container;
+ return $this;
+ }
+
+ /**
+ * Delete a container
+ *
+ * @param string $key
+ * @return bool
+ */
+ public function deleteContainer($key)
+ {
+ $key = (string) $key;
+ if (isset($this->_items[$key])) {
+ unset($this->_items[$key]);
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Set the container class to use
+ *
+ * @param string $name
+ * @return Zend_View_Helper_Placeholder_Registry
+ */
+ public function setContainerClass($name)
+ {
+ if (!class_exists($name)) {
+ Zend_Loader::loadClass($name);
+ }
+
+ $reflection = new ReflectionClass($name);
+ if (!$reflection->isSubclassOf(new ReflectionClass('Zend_View_Helper_Placeholder_Container_Abstract'))) {
+ $e = new Zend_View_Helper_Placeholder_Registry_Exception('Invalid Container class specified');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ $this->_containerClass = $name;
+ return $this;
+ }
+
+ /**
+ * Retrieve the container class
+ *
+ * @return string
+ */
+ public function getContainerClass()
+ {
+ return $this->_containerClass;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/Placeholder/Registry/Exception.php b/library/vendor/Zend/View/Helper/Placeholder/Registry/Exception.php
new file mode 100644
index 0000000..42d7a28
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Placeholder/Registry/Exception.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+
+/** Zend_View_Exception */
+
+
+/**
+ * Exception for Zend_View_Helper_Placeholder_Registry class.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_Placeholder_Registry_Exception extends Zend_View_Exception
+{
+}
diff --git a/library/vendor/Zend/View/Helper/RenderToPlaceholder.php b/library/vendor/Zend/View/Helper/RenderToPlaceholder.php
new file mode 100644
index 0000000..1d11186
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/RenderToPlaceholder.php
@@ -0,0 +1,52 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_Abstract.php */
+
+/**
+ * Renders a template and stores the rendered output as a placeholder
+ * variable for later use.
+ *
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+class Zend_View_Helper_RenderToPlaceholder extends Zend_View_Helper_Abstract
+{
+
+ /**
+ * Renders a template and stores the rendered output as a placeholder
+ * variable for later use.
+ *
+ * @param string $script The template script to render
+ * @param string $placeholder The placeholder variable name in which to store the rendered output
+ * @return void
+ */
+ public function renderToPlaceholder($script, $placeholder)
+ {
+ $this->view->placeholder($placeholder)->captureStart();
+ echo $this->view->render($script);
+ $this->view->placeholder($placeholder)->captureEnd();
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/ServerUrl.php b/library/vendor/Zend/View/Helper/ServerUrl.php
new file mode 100644
index 0000000..c38ec8b
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/ServerUrl.php
@@ -0,0 +1,148 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Helper for returning the current server URL (optionally with request URI)
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_ServerUrl
+{
+ /**
+ * Scheme
+ *
+ * @var string
+ */
+ protected $_scheme;
+
+ /**
+ * Host (including port)
+ *
+ * @var string
+ */
+ protected $_host;
+
+ /**
+ * Constructor
+ *
+ * @return void
+ */
+ public function __construct()
+ {
+ switch (true) {
+ case (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] === true)):
+ case (isset($_SERVER['HTTP_SCHEME']) && ($_SERVER['HTTP_SCHEME'] == 'https')):
+ case (isset($_SERVER['SERVER_PORT']) && ($_SERVER['SERVER_PORT'] == 443)):
+ $scheme = 'https';
+ break;
+ default:
+ $scheme = 'http';
+ }
+ $this->setScheme($scheme);
+
+ if (isset($_SERVER['HTTP_HOST']) && !empty($_SERVER['HTTP_HOST'])) {
+ $this->setHost($_SERVER['HTTP_HOST']);
+ } else if (isset($_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'])) {
+ $name = $_SERVER['SERVER_NAME'];
+ $port = $_SERVER['SERVER_PORT'];
+
+ if (($scheme == 'http' && $port == 80) ||
+ ($scheme == 'https' && $port == 443)) {
+ $this->setHost($name);
+ } else {
+ $this->setHost($name . ':' . $port);
+ }
+ }
+ }
+
+ /**
+ * View helper entry point:
+ * Returns the current host's URL like http://site.com
+ *
+ * @param string|boolean $requestUri [optional] if true, the request URI
+ * found in $_SERVER will be appended
+ * as a path. If a string is given, it
+ * will be appended as a path. Default
+ * is to not append any path.
+ * @return string server url
+ */
+ public function serverUrl($requestUri = null)
+ {
+ if ($requestUri === true) {
+ $path = $_SERVER['REQUEST_URI'];
+ } else if (is_string($requestUri)) {
+ $path = $requestUri;
+ } else {
+ $path = '';
+ }
+
+ return $this->getScheme() . '://' . $this->getHost() . $path;
+ }
+
+ /**
+ * Returns host
+ *
+ * @return string host
+ */
+ public function getHost()
+ {
+ return $this->_host;
+ }
+
+ /**
+ * Sets host
+ *
+ * @param string $host new host
+ * @return Zend_View_Helper_ServerUrl fluent interface, returns self
+ */
+ public function setHost($host)
+ {
+ $this->_host = $host;
+ return $this;
+ }
+
+ /**
+ * Returns scheme (typically http or https)
+ *
+ * @return string scheme (typically http or https)
+ */
+ public function getScheme()
+ {
+ return $this->_scheme;
+ }
+
+ /**
+ * Sets scheme (typically http or https)
+ *
+ * @param string $scheme new scheme (typically http or https)
+ * @return Zend_View_Helper_ServerUrl fluent interface, returns self
+ */
+ public function setScheme($scheme)
+ {
+ $this->_scheme = $scheme;
+ return $this;
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/Translate.php b/library/vendor/Zend/View/Helper/Translate.php
new file mode 100644
index 0000000..8a7d916
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Translate.php
@@ -0,0 +1,174 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/** Zend_Locale */
+
+/** Zend_View_Helper_Abstract.php */
+
+/**
+ * Translation view helper
+ *
+ * @category Zend
+ * @package Zend_View
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_Translate extends Zend_View_Helper_Abstract
+{
+ /**
+ * Translation object
+ *
+ * @var Zend_Translate_Adapter
+ */
+ protected $_translator;
+
+ /**
+ * Constructor for manually handling
+ *
+ * @param Zend_Translate|Zend_Translate_Adapter $translate Instance of Zend_Translate
+ */
+ public function __construct($translate = null)
+ {
+ if ($translate !== null) {
+ $this->setTranslator($translate);
+ }
+ }
+
+ /**
+ * Translate a message
+ * You can give multiple params or an array of params.
+ * If you want to output another locale just set it as last single parameter
+ * Example 1: translate('%1\$s + %2\$s', $value1, $value2, $locale);
+ * Example 2: translate('%1\$s + %2\$s', array($value1, $value2), $locale);
+ *
+ * @param string $messageid Id of the message to be translated
+ * @return string|Zend_View_Helper_Translate Translated message
+ */
+ public function translate($messageid = null)
+ {
+ if ($messageid === null) {
+ return $this;
+ }
+
+ $translate = $this->getTranslator();
+ $options = func_get_args();
+
+ array_shift($options);
+ $count = count($options);
+ $locale = null;
+ if ($count > 0) {
+ if (Zend_Locale::isLocale($options[($count - 1)], null, false) !== false) {
+ $locale = array_pop($options);
+ }
+ }
+
+ if ((count($options) === 1) and (is_array($options[0]) === true)) {
+ $options = $options[0];
+ }
+
+ if ($translate !== null) {
+ $messageid = $translate->translate($messageid, $locale);
+ }
+
+ if (count($options) === 0) {
+ return $messageid;
+ }
+
+ return vsprintf($messageid, $options);
+ }
+
+ /**
+ * Sets a translation Adapter for translation
+ *
+ * @param Zend_Translate|Zend_Translate_Adapter $translate Instance of Zend_Translate
+ * @throws Zend_View_Exception When no or a false instance was set
+ * @return Zend_View_Helper_Translate
+ */
+ public function setTranslator($translate)
+ {
+ if ($translate instanceof Zend_Translate_Adapter) {
+ $this->_translator = $translate;
+ } else if ($translate instanceof Zend_Translate) {
+ $this->_translator = $translate->getAdapter();
+ } else {
+ $e = new Zend_View_Exception('You must set an instance of Zend_Translate or Zend_Translate_Adapter');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Retrieve translation object
+ *
+ * @return Zend_Translate_Adapter|null
+ */
+ public function getTranslator()
+ {
+ if ($this->_translator === null) {
+ if (Zend_Registry::isRegistered('Zend_Translate')) {
+ $this->setTranslator(Zend_Registry::get('Zend_Translate'));
+ }
+ }
+
+ return $this->_translator;
+ }
+
+ /**
+ * Set's an new locale for all further translations
+ *
+ * @param string|Zend_Locale $locale New locale to set
+ * @throws Zend_View_Exception When no Zend_Translate instance was set
+ * @return Zend_View_Helper_Translate
+ */
+ public function setLocale($locale = null)
+ {
+ $translate = $this->getTranslator();
+ if ($translate === null) {
+ $e = new Zend_View_Exception('You must set an instance of Zend_Translate or Zend_Translate_Adapter');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ $translate->setLocale($locale);
+ return $this;
+ }
+
+ /**
+ * Returns the set locale for translations
+ *
+ * @throws Zend_View_Exception When no Zend_Translate instance was set
+ * @return string|Zend_Locale
+ */
+ public function getLocale()
+ {
+ $translate = $this->getTranslator();
+ if ($translate === null) {
+ $e = new Zend_View_Exception('You must set an instance of Zend_Translate or Zend_Translate_Adapter');
+ $e->setView($this->view);
+ throw $e;
+ }
+
+ return $translate->getLocale();
+ }
+}
diff --git a/library/vendor/Zend/View/Helper/Url.php b/library/vendor/Zend/View/Helper/Url.php
new file mode 100644
index 0000000..3ed84ca
--- /dev/null
+++ b/library/vendor/Zend/View/Helper/Url.php
@@ -0,0 +1,50 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id$
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_Abstract.php */
+
+/**
+ * Helper for making easy links and getting urls that depend on the routes and router
+ *
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_Url extends Zend_View_Helper_Abstract
+{
+ /**
+ * Generates an url given the name of a route.
+ *
+ * @access public
+ *
+ * @param array $urlOptions Options passed to the assemble method of the Route object.
+ * @param mixed $name The name of a Route to use. If null it will use the current Route
+ * @param bool $reset Whether or not to reset the route defaults with those provided
+ * @return string Url for the link href attribute.
+ */
+ public function url(array $urlOptions = array(), $name = null, $reset = false, $encode = true)
+ {
+ $router = Zend_Controller_Front::getInstance()->getRouter();
+ return $router->assemble($urlOptions, $name, $reset, $encode);
+ }
+}
diff --git a/library/vendor/Zend/View/Interface.php b/library/vendor/Zend/View/Interface.php
new file mode 100644
index 0000000..496ec71
--- /dev/null
+++ b/library/vendor/Zend/View/Interface.php
@@ -0,0 +1,137 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * Interface class for Zend_View compatible template engine implementations
+ *
+ * @category Zend
+ * @package Zend_View
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+interface Zend_View_Interface
+{
+ /**
+ * Return the template engine object, if any
+ *
+ * If using a third-party template engine, such as Smarty, patTemplate,
+ * phplib, etc, return the template engine object. Useful for calling
+ * methods on these objects, such as for setting filters, modifiers, etc.
+ *
+ * @return mixed
+ */
+ public function getEngine();
+
+ /**
+ * Set the path to find the view script used by render()
+ *
+ * @param string|array The directory (-ies) to set as the path. Note that
+ * the concrete view implentation may not necessarily support multiple
+ * directories.
+ * @return void
+ */
+ public function setScriptPath($path);
+
+ /**
+ * Retrieve all view script paths
+ *
+ * @return array
+ */
+ public function getScriptPaths();
+
+ /**
+ * Set a base path to all view resources
+ *
+ * @param string $path
+ * @param string $classPrefix
+ * @return void
+ */
+ public function setBasePath($path, $classPrefix = 'Zend_View');
+
+ /**
+ * Add an additional path to view resources
+ *
+ * @param string $path
+ * @param string $classPrefix
+ * @return void
+ */
+ public function addBasePath($path, $classPrefix = 'Zend_View');
+
+ /**
+ * Assign a variable to the view
+ *
+ * @param string $key The variable name.
+ * @param mixed $val The variable value.
+ * @return void
+ */
+ public function __set($key, $val);
+
+ /**
+ * Allows testing with empty() and isset() to work
+ *
+ * @param string $key
+ * @return boolean
+ */
+ public function __isset($key);
+
+ /**
+ * Allows unset() on object properties to work
+ *
+ * @param string $key
+ * @return void
+ */
+ public function __unset($key);
+
+ /**
+ * Assign variables to the view script via differing strategies.
+ *
+ * Suggested implementation is to allow setting a specific key to the
+ * specified value, OR passing an array of key => value pairs to set en
+ * masse.
+ *
+ * @see __set()
+ * @param string|array $spec The assignment strategy to use (key or array of key
+ * => value pairs)
+ * @param mixed $value (Optional) If assigning a named variable, use this
+ * as the value.
+ * @return void
+ */
+ public function assign($spec, $value = null);
+
+ /**
+ * Clear all assigned variables
+ *
+ * Clears all variables assigned to Zend_View either via {@link assign()} or
+ * property overloading ({@link __get()}/{@link __set()}).
+ *
+ * @return void
+ */
+ public function clearVars();
+
+ /**
+ * Processes a view script and returns the output.
+ *
+ * @param string $name The script name to process.
+ * @return string The script output.
+ */
+ public function render($name);
+}
diff --git a/library/vendor/Zend/View/Stream.php b/library/vendor/Zend/View/Stream.php
new file mode 100644
index 0000000..ae8d524
--- /dev/null
+++ b/library/vendor/Zend/View/Stream.php
@@ -0,0 +1,183 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Stream wrapper to convert markup of mostly-PHP templates into PHP prior to
+ * include().
+ *
+ * Based in large part on the example at
+ * http://www.php.net/manual/en/function.stream-wrapper-register.php
+ *
+ * As well as the example provided at:
+ * http://mikenaberezny.com/2006/02/19/symphony-templates-ruby-erb/
+ * written by
+ * Mike Naberezny (@link http://mikenaberezny.com)
+ * Paul M. Jones (@link http://paul-m-jones.com)
+ *
+ * @category Zend
+ * @package Zend_View
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Stream
+{
+ /**
+ * Current stream position.
+ *
+ * @var int
+ */
+ protected $_pos = 0;
+
+ /**
+ * Data for streaming.
+ *
+ * @var string
+ */
+ protected $_data;
+
+ /**
+ * Stream stats.
+ *
+ * @var array
+ */
+ protected $_stat;
+
+ /**
+ * Opens the script file and converts markup.
+ */
+ public function stream_open($path, $mode, $options, &$opened_path)
+ {
+ // get the view script source
+ $path = str_replace('zend.view://', '', $path);
+ $this->_data = file_get_contents($path);
+
+ /**
+ * If reading the file failed, update our local stat store
+ * to reflect the real stat of the file, then return on failure
+ */
+ if ($this->_data === false) {
+ $this->_stat = stat($path);
+ return false;
+ }
+
+ /**
+ * Convert <?= ?> to long-form <?php echo ?> and <? ?> to <?php ?>
+ *
+ */
+ $this->_data = preg_replace('/\<\?\=/', "<?php echo ", $this->_data);
+ $this->_data = preg_replace('/<\?(?!xml|php)/s', '<?php ', $this->_data);
+
+ /**
+ * file_get_contents() won't update PHP's stat cache, so we grab a stat
+ * of the file to prevent additional reads should the script be
+ * requested again, which will make include() happy.
+ */
+ $this->_stat = stat($path);
+
+ return true;
+ }
+
+ /**
+ * Included so that __FILE__ returns the appropriate info
+ *
+ * @return array
+ */
+ public function url_stat()
+ {
+ return $this->_stat;
+ }
+
+ /**
+ * Reads from the stream.
+ */
+ public function stream_read($count)
+ {
+ $ret = substr($this->_data, $this->_pos, $count);
+ $this->_pos += strlen($ret);
+ return $ret;
+ }
+
+
+ /**
+ * Tells the current position in the stream.
+ */
+ public function stream_tell()
+ {
+ return $this->_pos;
+ }
+
+
+ /**
+ * Tells if we are at the end of the stream.
+ */
+ public function stream_eof()
+ {
+ return $this->_pos >= strlen($this->_data);
+ }
+
+
+ /**
+ * Stream statistics.
+ */
+ public function stream_stat()
+ {
+ return $this->_stat;
+ }
+
+
+ /**
+ * Seek to a specific point in the stream.
+ */
+ public function stream_seek($offset, $whence)
+ {
+ switch ($whence) {
+ case SEEK_SET:
+ if ($offset < strlen($this->_data) && $offset >= 0) {
+ $this->_pos = $offset;
+ return true;
+ } else {
+ return false;
+ }
+ break;
+
+ case SEEK_CUR:
+ if ($offset >= 0) {
+ $this->_pos += $offset;
+ return true;
+ } else {
+ return false;
+ }
+ break;
+
+ case SEEK_END:
+ if (strlen($this->_data) + $offset >= 0) {
+ $this->_pos = strlen($this->_data) + $offset;
+ return true;
+ } else {
+ return false;
+ }
+ break;
+
+ default:
+ return false;
+ }
+ }
+}
diff --git a/library/vendor/Zend/Xml/Exception.php b/library/vendor/Zend/Xml/Exception.php
new file mode 100644
index 0000000..3d12d82
--- /dev/null
+++ b/library/vendor/Zend/Xml/Exception.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Xml
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @see Zend_Exception
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Xml
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Xml_Exception extends Zend_Exception
+{}
diff --git a/library/vendor/Zend/Xml/Security.php b/library/vendor/Zend/Xml/Security.php
new file mode 100644
index 0000000..321e1e6
--- /dev/null
+++ b/library/vendor/Zend/Xml/Security.php
@@ -0,0 +1,486 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_Xml
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ * @version $Id$
+ */
+
+
+/**
+ * @category Zend
+ * @package Zend_Xml_SecurityScan
+ * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_Xml_Security
+{
+ const ENTITY_DETECT = 'Detected use of ENTITY in XML, disabled to prevent XXE/XEE attacks';
+
+ /**
+ * Heuristic scan to detect entity in XML
+ *
+ * @param string $xml
+ * @throws Zend_Xml_Exception If entity expansion or external entity declaration was discovered.
+ */
+ protected static function heuristicScan($xml)
+ {
+ foreach (self::getEntityComparison($xml) as $compare) {
+ if (strpos($xml, $compare) !== false) {
+ throw new Zend_Xml_Exception(self::ENTITY_DETECT);
+ }
+ }
+ }
+
+ /**
+ * @param integer $errno
+ * @param string $errstr
+ * @param string $errfile
+ * @param integer $errline
+ * @return bool
+ */
+ public static function loadXmlErrorHandler($errno, $errstr, $errfile, $errline)
+ {
+ if (substr_count($errstr, 'DOMDocument::loadXML()') > 0) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Scan XML string for potential XXE and XEE attacks
+ *
+ * @param string $xml
+ * @param DomDocument $dom
+ * @throws Zend_Xml_Exception
+ * @return SimpleXMLElement|DomDocument|boolean
+ */
+ public static function scan($xml, DOMDocument $dom = null)
+ {
+ // If running with PHP-FPM we perform an heuristic scan
+ // We cannot use libxml_disable_entity_loader because of this bug
+ // @see https://bugs.php.net/bug.php?id=64938
+ if (self::isPhpFpm()) {
+ self::heuristicScan($xml);
+ }
+
+ if (null === $dom) {
+ $simpleXml = true;
+ $dom = new DOMDocument();
+ }
+
+ if (!self::isPhpFpm()) {
+ $loadEntities = libxml_disable_entity_loader(true);
+ $useInternalXmlErrors = libxml_use_internal_errors(true);
+ }
+
+ // Load XML with network access disabled (LIBXML_NONET)
+ // error disabled with @ for PHP-FPM scenario
+ set_error_handler(array('Zend_Xml_Security', 'loadXmlErrorHandler'), E_WARNING);
+
+ $result = $dom->loadXml($xml, LIBXML_NONET);
+ restore_error_handler();
+
+ if (!$result) {
+ // Entity load to previous setting
+ if (!self::isPhpFpm()) {
+ libxml_disable_entity_loader($loadEntities);
+ libxml_use_internal_errors($useInternalXmlErrors);
+ }
+ return false;
+ }
+
+ // Scan for potential XEE attacks using ENTITY, if not PHP-FPM
+ if (!self::isPhpFpm()) {
+ foreach ($dom->childNodes as $child) {
+ if ($child->nodeType === XML_DOCUMENT_TYPE_NODE) {
+ if ($child->entities->length > 0) {
+ throw new Zend_Xml_Exception(self::ENTITY_DETECT);
+ }
+ }
+ }
+ }
+
+ // Entity load to previous setting
+ if (!self::isPhpFpm()) {
+ libxml_disable_entity_loader($loadEntities);
+ libxml_use_internal_errors($useInternalXmlErrors);
+ }
+
+ if (isset($simpleXml)) {
+ $result = simplexml_import_dom($dom);
+ if (!$result instanceof SimpleXMLElement) {
+ return false;
+ }
+ return $result;
+ }
+ return $dom;
+ }
+
+ /**
+ * Scan XML file for potential XXE/XEE attacks
+ *
+ * @param string $file
+ * @param DOMDocument $dom
+ * @throws Zend_Xml_Exception
+ * @return SimpleXMLElement|DomDocument
+ */
+ public static function scanFile($file, DOMDocument $dom = null)
+ {
+ if (!file_exists($file)) {
+ throw new Zend_Xml_Exception(
+ "The file $file specified doesn't exist"
+ );
+ }
+ return self::scan(file_get_contents($file), $dom);
+ }
+
+ /**
+ * Return true if PHP is running with PHP-FPM
+ *
+ * This method is mainly used to determine whether or not heuristic checks
+ * (vs libxml checks) should be made, due to threading issues in libxml;
+ * under php-fpm, threading becomes a concern.
+ *
+ * However, PHP versions 5.5.22+ and 5.6.6+ contain a patch to the
+ * libxml support in PHP that makes the libxml checks viable; in such
+ * versions, this method will return false to enforce those checks, which
+ * are more strict and accurate than the heuristic checks.
+ *
+ * @return boolean
+ */
+ public static function isPhpFpm()
+ {
+ $isVulnerableVersion = (
+ version_compare(PHP_VERSION, '5.5.22', 'lt')
+ || (
+ version_compare(PHP_VERSION, '5.6', 'gte')
+ && version_compare(PHP_VERSION, '5.6.6', 'lt')
+ )
+ );
+
+ if (substr(php_sapi_name(), 0, 3) === 'fpm' && $isVulnerableVersion) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Determine and return the string(s) to use for the <!ENTITY comparison.
+ *
+ * @param string $xml
+ * @return string[]
+ */
+ protected static function getEntityComparison($xml)
+ {
+ $encodingMap = self::getAsciiEncodingMap();
+ return array_map(
+ array(__CLASS__, 'generateEntityComparison'),
+ self::detectXmlEncoding($xml, self::detectStringEncoding($xml))
+ );
+ }
+
+ /**
+ * Determine the string encoding.
+ *
+ * Determines string encoding from either a detected BOM or a
+ * heuristic.
+ *
+ * @param string $xml
+ * @return string File encoding
+ */
+ protected static function detectStringEncoding($xml)
+ {
+ $encoding = self::detectBom($xml);
+ return ($encoding) ? $encoding : self::detectXmlStringEncoding($xml);
+ }
+
+ /**
+ * Attempt to match a known BOM.
+ *
+ * Iterates through the return of getBomMap(), comparing the initial bytes
+ * of the provided string to the BOM of each; if a match is determined,
+ * it returns the encoding.
+ *
+ * @param string $string
+ * @return false|string Returns encoding on success.
+ */
+ protected static function detectBom($string)
+ {
+ foreach (self::getBomMap() as $criteria) {
+ if (0 === strncmp($string, $criteria['bom'], $criteria['length'])) {
+ return $criteria['encoding'];
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Attempt to detect the string encoding of an XML string.
+ *
+ * @param string $xml
+ * @return string Encoding
+ */
+ protected static function detectXmlStringEncoding($xml)
+ {
+ foreach (self::getAsciiEncodingMap() as $encoding => $generator) {
+ $prefix = call_user_func($generator, '<' . '?xml');
+ if (0 === strncmp($xml, $prefix, strlen($prefix))) {
+ return $encoding;
+ }
+ }
+
+ // Fallback
+ return 'UTF-8';
+ }
+
+ /**
+ * Attempt to detect the specified XML encoding.
+ *
+ * Using the file's encoding, determines if an "encoding" attribute is
+ * present and well-formed in the XML declaration; if so, it returns a
+ * list with both the ASCII representation of that declaration and the
+ * original file encoding.
+ *
+ * If not, a list containing only the provided file encoding is returned.
+ *
+ * @param string $xml
+ * @param string $fileEncoding
+ * @return string[] Potential XML encodings
+ */
+ protected static function detectXmlEncoding($xml, $fileEncoding)
+ {
+ $encodingMap = self::getAsciiEncodingMap();
+ $generator = $encodingMap[$fileEncoding];
+ $encAttr = call_user_func($generator, 'encoding="');
+ $quote = call_user_func($generator, '"');
+ $close = call_user_func($generator, '>');
+
+ $closePos = strpos($xml, $close);
+ if (false === $closePos) {
+ return array($fileEncoding);
+ }
+
+ $encPos = strpos($xml, $encAttr);
+ if (false === $encPos
+ || $encPos > $closePos
+ ) {
+ return array($fileEncoding);
+ }
+
+ $encPos += strlen($encAttr);
+ $quotePos = strpos($xml, $quote, $encPos);
+ if (false === $quotePos) {
+ return array($fileEncoding);
+ }
+
+ $encoding = self::substr($xml, $encPos, $quotePos);
+ return array(
+ // Following line works because we're only supporting 8-bit safe encodings at this time.
+ str_replace('\0', '', $encoding), // detected encoding
+ $fileEncoding, // file encoding
+ );
+ }
+
+ /**
+ * Return a list of BOM maps.
+ *
+ * Returns a list of common encoding -> BOM maps, along with the character
+ * length to compare against.
+ *
+ * @link https://en.wikipedia.org/wiki/Byte_order_mark
+ * @return array
+ */
+ protected static function getBomMap()
+ {
+ return array(
+ array(
+ 'encoding' => 'UTF-32BE',
+ 'bom' => pack('CCCC', 0x00, 0x00, 0xfe, 0xff),
+ 'length' => 4,
+ ),
+ array(
+ 'encoding' => 'UTF-32LE',
+ 'bom' => pack('CCCC', 0xff, 0xfe, 0x00, 0x00),
+ 'length' => 4,
+ ),
+ array(
+ 'encoding' => 'GB-18030',
+ 'bom' => pack('CCCC', 0x84, 0x31, 0x95, 0x33),
+ 'length' => 4,
+ ),
+ array(
+ 'encoding' => 'UTF-16BE',
+ 'bom' => pack('CC', 0xfe, 0xff),
+ 'length' => 2,
+ ),
+ array(
+ 'encoding' => 'UTF-16LE',
+ 'bom' => pack('CC', 0xff, 0xfe),
+ 'length' => 2,
+ ),
+ array(
+ 'encoding' => 'UTF-8',
+ 'bom' => pack('CCC', 0xef, 0xbb, 0xbf),
+ 'length' => 3,
+ ),
+ );
+ }
+
+ /**
+ * Return a map of encoding => generator pairs.
+ *
+ * Returns a map of encoding => generator pairs, where the generator is a
+ * callable that accepts a string and returns the appropriate byte order
+ * sequence of that string for the encoding.
+ *
+ * @return array
+ */
+ protected static function getAsciiEncodingMap()
+ {
+ return array(
+ 'UTF-32BE' => array(__CLASS__, 'encodeToUTF32BE'),
+ 'UTF-32LE' => array(__CLASS__, 'encodeToUTF32LE'),
+ 'UTF-32odd1' => array(__CLASS__, 'encodeToUTF32odd1'),
+ 'UTF-32odd2' => array(__CLASS__, 'encodeToUTF32odd2'),
+ 'UTF-16BE' => array(__CLASS__, 'encodeToUTF16BE'),
+ 'UTF-16LE' => array(__CLASS__, 'encodeToUTF16LE'),
+ 'UTF-8' => array(__CLASS__, 'encodeToUTF8'),
+ 'GB-18030' => array(__CLASS__, 'encodeToUTF8'),
+ );
+ }
+
+ /**
+ * Binary-safe substr.
+ *
+ * substr() is not binary-safe; this method loops by character to ensure
+ * multi-byte characters are aggregated correctly.
+ *
+ * @param string $string
+ * @param int $start
+ * @param int $end
+ * @return string
+ */
+ protected static function substr($string, $start, $end)
+ {
+ $substr = '';
+ for ($i = $start; $i < $end; $i += 1) {
+ $substr .= $string[$i];
+ }
+ return $substr;
+ }
+
+ /**
+ * Generate an entity comparison based on the given encoding.
+ *
+ * This patch is internal only, and public only so it can be used as a
+ * callable to pass to array_map.
+ *
+ * @internal
+ * @param string $encoding
+ * @return string
+ */
+ public static function generateEntityComparison($encoding)
+ {
+ $encodingMap = self::getAsciiEncodingMap();
+ $generator = isset($encodingMap[$encoding]) ? $encodingMap[$encoding] : $encodingMap['UTF-8'];
+ return call_user_func($generator, '<!ENTITY');
+ }
+
+ /**
+ * Encode an ASCII string to UTF-32BE
+ *
+ * @internal
+ * @param string $ascii
+ * @return string
+ */
+ public static function encodeToUTF32BE($ascii)
+ {
+ return preg_replace('/(.)/', "\0\0\0\\1", $ascii);
+ }
+
+ /**
+ * Encode an ASCII string to UTF-32LE
+ *
+ * @internal
+ * @param string $ascii
+ * @return string
+ */
+ public static function encodeToUTF32LE($ascii)
+ {
+ return preg_replace('/(.)/', "\\1\0\0\0", $ascii);
+ }
+
+ /**
+ * Encode an ASCII string to UTF-32odd1
+ *
+ * @internal
+ * @param string $ascii
+ * @return string
+ */
+ public static function encodeToUTF32odd1($ascii)
+ {
+ return preg_replace('/(.)/', "\0\\1\0\0", $ascii);
+ }
+
+ /**
+ * Encode an ASCII string to UTF-32odd2
+ *
+ * @internal
+ * @param string $ascii
+ * @return string
+ */
+ public static function encodeToUTF32odd2($ascii)
+ {
+ return preg_replace('/(.)/', "\0\0\\1\0", $ascii);
+ }
+
+ /**
+ * Encode an ASCII string to UTF-16BE
+ *
+ * @internal
+ * @param string $ascii
+ * @return string
+ */
+ public static function encodeToUTF16BE($ascii)
+ {
+ return preg_replace('/(.)/', "\0\\1", $ascii);
+ }
+
+ /**
+ * Encode an ASCII string to UTF-16LE
+ *
+ * @internal
+ * @param string $ascii
+ * @return string
+ */
+ public static function encodeToUTF16LE($ascii)
+ {
+ return preg_replace('/(.)/', "\\1\0", $ascii);
+ }
+
+ /**
+ * Encode an ASCII string to UTF-8
+ *
+ * @internal
+ * @param string $ascii
+ * @return string
+ */
+ public static function encodeToUTF8($ascii)
+ {
+ return $ascii;
+ }
+}