diff --git a/CHANGELOG b/CHANGELOG index f6fc163c5..dce497983 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,117 @@ +Hubzilla 3.0 (????-??-??) + - Don't zidify all permalinks, only zot permalinks + - Make remote homelink link to the home host and not to the home channel + - Auto promote beginner (techlevel 0) accounts to level 1 after they show signs of active participation. + - Go back to including the photo thumbnail data in the export file. + - Improvements to file import/export + - Default value for xlink_rating_text + - Implement IMoveTarget and recursive file/directory move/rename - github issue #680 + - Synchronise an attach_move operation to clones + - Provide a themed page with an error notification on errors instead of an obtuse XML error structure in mod cloud + - Disallow backslashes in wiki and wiki-page names + - We only require one update module. The rest are superfluous. + - Render installable elements as buttons instead of links + - Implement chunked uploads for photos page + - Remove warning for large files on cloud upload + - Add a filter for notification to show new posts only + - Implement chunked uploads for cloud + - Use httpsig auth for getfile + - Load the profile images in the custom acl selector only if we actually need them + - Rework liveUpdate() and notificationsUpdate() (aka ping) to first do the liveUpdate and when this is done only do the ping once. + - Don't include invisible "update activities" in category widget + - Default profile assign + - Provide system config option for minimum registration age. + - Remove deprecated $a argument from advanced_profile() + - Change to bbcode calling parameters + - Extra checking of server headers in upload functions + - Provide a handler for chunked uploads in mod file_upload + - Optional divider between item header and body + - Allow toggle to SMBC scaling mode. + - Add thumbnail hook + - Implement SVG thumbnails and expose security setting + - Implement video thumbnail generator + - Implement pdf thumbnails + - Implement thumbnail generator for epubs + - Make browser history buttons work with ajax calls in mod display and hq + - Implement tile view for mod cloud (read only) + - Add mp3 audio thumbnail generator + - Set display_path for photo_upload from the DAV File interface + - Provide a generalised interface for thumbnail generators to support various content types + - Add ID3Parser library. + - Text thumbnails in cloud tile mode + - Revisit media breakpoints - do not switch to mobile view to early. + - Add French to help pages language dropdown selector + - Inroduce the HQ module - an alternative landing page for hubzilla + - Strip author name from notify messages in notifications - github issue #911 + - Remove column item.diaspora_meta + - Provide ability to pin apps to navbar from mod apps + - Add private forums to forum widget + - Move notifications style to widgets.css + - Sort out a few more large image upload issues + - Move notifications full-screen handling to notifications widget + - Move mailhost settings from plugin to core + - Sort combined private mail conversations by latest updated conversation instead of created parent + - Filter atokens on acl search + - Allow a site to block (public) the directory separately from other resources. + - Improve removed_channel final cleanup - github issue #386 + - Cleanup of upload_to_comments( + - Dedicate the first click to slideup the cover again but make sure the nav buttons remain functional + - Set os_syspath in DAV file put operation so that photos will scale correctly. + - Unit tests for Zotlabs\Access classes + - Bring back tabindex to submit comments + - attach.php minor cleanup and doc + - Allow cloud filenames to include ampersands without messing up auth tokens (zid, owt, and zat, and the constant placeholder 'f=') + - Provide short localised summary for likes that will end up in displayed notifications + - Improving Doxygen documentation. + - Update item_normal() to not include ACTIVITY_OBJ_FILE obj_type + - Sort out issues with pubstream item interactions + - Don't perform zot_refresh on dead sites unless $force is set + - Do not send message_list responses to dead sites (this delivery method bypassed the notifier) + - Support for netselect query + - Add another delivery control parameter (queue threshold) + - Add some documentation about shareable widgets + - Allow plugin class widgets + - Some more work on unit tests + - Encrypt the owa token + - Bring back the markdown post feature + - We call Theme:url() statically, make it also static. + - Table structure for pseudo or proxy channels (pchan) + + Bugfixes + - Fix issue with long filenames in mod cloud + - Fix misc. issues with new 'insert photo from photo album' github issue #475 + - Fix regression in channel sources delivery + - Fix loading of theme-specific widgets + - Fix unable to add wiki pages with spaces + - Fix mod display and others that require a non-zero profile_uid for updates + - Fix various PHP 7.2 issues + - Fix typo in HTTPSig + - Fix pagetitle lost importing a pdl element from conversation + - Fix js warning - getelementbyid (id doesn't exist) + - Fix some pubstream on/off weirdness + - Fix default addressbook has no name - github issue #921 + - Fix double html ids in caldav widget if more than one sharee + - Fix regression in cdav calendar widget + - Fix sync packet not generated when deleting a file using the web browser interface + - Fix album cover thumb generator + - Fix like-button for images - github issue #826 + - Fix typo - github issue #910 + - Fix issue with group_rmv() + - Fix php warnings on photo delete + - Fix some conflicts between private tags and forum tags + - Fix some schema issues + - Fix wiki pages not updating after creating new page + - Fix a PHP warning in Permissions::FilledPerms() + - Fix unicode characters in urls tripping up url regexes - github issue #901 + - Fix second half of github issue #893 + - Fix common connections on suggestion page showing wildly different results than remote profile, and is consistently off by one + - Fix cloud redirects with owt tokens + - Fix issues with diaspora xchans + - Fix memory overflow trying to delete a connection with a very high noise to signal ratio + - Fix sql error in page module + - Fix unstar + + Hubzilla 2.8.1 (2017-11-11) - Rename channel app events to calendar and add nav_set_selected() to /cal - Load notifications links to /display via ajax if we are already in /display diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php index 073b67b92..1e46a6353 100644 --- a/Zotlabs/Module/Hq.php +++ b/Zotlabs/Module/Hq.php @@ -98,6 +98,8 @@ class Hq extends \Zotlabs\Web\Controller { $sys = get_sys_channel(); $sql_extra = item_permissions_sql($sys['channel_id']); + $sys_item = false; + } if(! $update) { @@ -215,6 +217,8 @@ class Hq extends \Zotlabs\Web\Controller { } if(!$r) { + $sys_item = true; + $r = q("SELECT item.id AS item_id FROM item LEFT JOIN abook ON item.author_xchan = abook.abook_xchan WHERE mid = '%s' AND item.uid = %d $item_normal @@ -243,6 +247,8 @@ class Hq extends \Zotlabs\Web\Controller { } if(!$r) { + $sys_item = true; + $r = q("SELECT item.parent AS item_id FROM item LEFT JOIN abook ON item.author_xchan = abook.abook_xchan WHERE mid = '%s' AND item.uid = %d $item_normal_update $simple_update @@ -268,7 +274,7 @@ class Hq extends \Zotlabs\Web\Controller { dbesc($parents_str) ); - xchan_query($items,true,local_channel()); + xchan_query($items,true,(($sys_item) ? local_channel() : 0)); $items = fetch_post_tags($items,true); $items = conv_sort($items,'created'); } diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 37a3a3a85..6365230f8 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -156,7 +156,7 @@ class Item extends \Zotlabs\Web\Controller { if(! x($_REQUEST,'type')) $_REQUEST['type'] = 'net-comment'; - if($obj_type == ACTIVITY_OBJ_POST) + if($obj_type == ACTIVITY_OBJ_NOTE) $obj_type = ACTIVITY_OBJ_COMMENT; if($parent) { diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php index c1bce0d51..a3f6cdfec 100644 --- a/Zotlabs/Module/Ping.php +++ b/Zotlabs/Module/Ping.php @@ -279,8 +279,8 @@ class Ping extends \Zotlabs\Web\Controller { 'photo' => $tt['photo'], 'when' => relative_date($tt['created']), 'hclass' => (($tt['seen']) ? 'notify-seen' : 'notify-unseen'), - 'b64mid' => $b64mid, - 'notify_id' => (($tt['otype'] == 'item') ? $tt['id'] : ''), + 'b64mid' => (($tt['otype'] == 'item') ? $b64mid : 'undefined'), + 'notify_id' => (($tt['otype'] == 'item') ? $tt['id'] : 'undefined'), 'message' => $message ); } diff --git a/Zotlabs/Render/SmartyInterface.php b/Zotlabs/Render/SmartyInterface.php index 0e3a47c2f..9c9a501c0 100755 --- a/Zotlabs/Render/SmartyInterface.php +++ b/Zotlabs/Render/SmartyInterface.php @@ -2,8 +2,6 @@ namespace Zotlabs\Render; -require_once('library/Smarty/libs/Smarty.class.php'); - class SmartyInterface extends \Smarty { public $filename; diff --git a/composer.json b/composer.json index d35548f94..f89fb15b2 100644 --- a/composer.json +++ b/composer.json @@ -36,15 +36,17 @@ "league/html-to-markdown": "^4.4", "pear/text_languagedetect": "^1.0", "commerceguys/intl": "~0.7", - "lukasreschke/id3parser": "^0.0.1" + "lukasreschke/id3parser": "^0.0.1", + "smarty/smarty": "~3.1" }, "require-dev" : { "php" : ">=7.0", - "phpunit/phpunit" : "^6.1", + "phpunit/phpunit" : "~6.4.4", "behat/behat" : "@stable", "behat/mink-extension": "@stable", "behat/mink-goutte-driver": "@stable", - "php-mock/php-mock-phpunit": "^2.0" + "php-mock/php-mock-phpunit": "^2.0", + "phpunit/dbunit": "^3.0" }, "autoload" : { "psr-4" : { diff --git a/composer.lock b/composer.lock index bcf6b41b4..ea76e9d6e 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "9c45792f04ea3e30f312f5eef0bdad86", + "content-hash": "73ca170baa6ded94a989b8a1066e6a98", "packages": [ { "name": "bshaffer/oauth2-server-php", - "version": "v1.9.0", + "version": "v1.10.0", "source": { "type": "git", "url": "https://github.com/bshaffer/oauth2-server-php.git", - "reference": "8856aed1a98d6da596ae3f9b8095b5c7a1581697" + "reference": "d158878425392fe5a0cc34f15dbaf46315ae0ed9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bshaffer/oauth2-server-php/zipball/8856aed1a98d6da596ae3f9b8095b5c7a1581697", - "reference": "8856aed1a98d6da596ae3f9b8095b5c7a1581697", + "url": "https://api.github.com/repos/bshaffer/oauth2-server-php/zipball/d158878425392fe5a0cc34f15dbaf46315ae0ed9", + "reference": "d158878425392fe5a0cc34f15dbaf46315ae0ed9", "shasum": "" }, "require": { @@ -27,12 +27,14 @@ "aws/aws-sdk-php": "~2.8", "firebase/php-jwt": "~2.2", "mongodb/mongodb": "^1.1", + "phpunit/phpunit": "^4.0", "predis/predis": "dev-master", "thobbs/phpcassa": "dev-master" }, "suggest": { "aws/aws-sdk-php": "~2.8 is required to use DynamoDB storage", - "firebase/php-jwt": "~1.1 is required to use MondoDB storage", + "firebase/php-jwt": "~2.2 is required to use JWT features", + "mongodb/mongodb": "^1.1 is required to use MongoDB storage", "predis/predis": "Required to use Redis storage", "thobbs/phpcassa": "Required to use Cassandra storage" }, @@ -60,7 +62,7 @@ "oauth", "oauth2" ], - "time": "2017-01-06T23:20:00+00:00" + "time": "2017-11-15T01:41:02+00:00" }, { "name": "commerceguys/intl", @@ -155,16 +157,16 @@ }, { "name": "league/html-to-markdown", - "version": "4.4.1", + "version": "4.6.0", "source": { "type": "git", "url": "https://github.com/thephpleague/html-to-markdown.git", - "reference": "82ea375b5b2b1da1da222644c0565c695bf88186" + "reference": "9022e648bc40e44cb3b18438d97ed8715ecbc49b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/82ea375b5b2b1da1da222644c0565c695bf88186", - "reference": "82ea375b5b2b1da1da222644c0565c695bf88186", + "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/9022e648bc40e44cb3b18438d97ed8715ecbc49b", + "reference": "9022e648bc40e44cb3b18438d97ed8715ecbc49b", "shasum": "" }, "require": { @@ -183,7 +185,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.5-dev" + "dev-master": "4.7-dev" } }, "autoload": { @@ -215,7 +217,7 @@ "html", "markdown" ], - "time": "2017-03-16T00:45:59+00:00" + "time": "2017-10-24T02:45:05+00:00" }, { "name": "lukasreschke/id3parser", @@ -643,16 +645,16 @@ }, { "name": "sabre/vobject", - "version": "4.1.2", + "version": "4.1.3", "source": { "type": "git", "url": "https://github.com/sabre-io/vobject.git", - "reference": "d0fde2fafa2a3dad1f559c2d1c2591d4fd75ae3c" + "reference": "df9916813d1d83e4f761c4cba13361ee74196fac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/vobject/zipball/d0fde2fafa2a3dad1f559c2d1c2591d4fd75ae3c", - "reference": "d0fde2fafa2a3dad1f559c2d1c2591d4fd75ae3c", + "url": "https://api.github.com/repos/sabre-io/vobject/zipball/df9916813d1d83e4f761c4cba13361ee74196fac", + "reference": "df9916813d1d83e4f761c4cba13361ee74196fac", "shasum": "" }, "require": { @@ -661,7 +663,7 @@ "sabre/xml": ">=1.5 <3.0" }, "require-dev": { - "phpunit/phpunit": "*", + "phpunit/phpunit": "> 4.8, <6.0.0", "sabre/cs": "^1.0.0" }, "suggest": { @@ -736,7 +738,7 @@ "xCal", "xCard" ], - "time": "2016-12-06T04:14:09+00:00" + "time": "2017-10-18T08:29:40+00:00" }, { "name": "sabre/xml", @@ -803,16 +805,16 @@ }, { "name": "simplepie/simplepie", - "version": "1.5", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/simplepie/simplepie.git", - "reference": "5de5551953f95feef12cf355a7a26a70f94aa3ab" + "reference": "db9fff27b6d49eed3d4047cd3211ec8dba2f5d6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/simplepie/simplepie/zipball/5de5551953f95feef12cf355a7a26a70f94aa3ab", - "reference": "5de5551953f95feef12cf355a7a26a70f94aa3ab", + "url": "https://api.github.com/repos/simplepie/simplepie/zipball/db9fff27b6d49eed3d4047cd3211ec8dba2f5d6e", + "reference": "db9fff27b6d49eed3d4047cd3211ec8dba2f5d6e", "shasum": "" }, "require": { @@ -859,25 +861,78 @@ "rss" ], "support": { - "source": "https://github.com/simplepie/simplepie/tree/1.5", + "source": "https://github.com/simplepie/simplepie/tree/1.5.1", "issues": "https://github.com/simplepie/simplepie/issues" }, - "time": "2017-04-17T07:29:31+00:00" + "time": "2017-11-12T02:03:34+00:00" + }, + { + "name": "smarty/smarty", + "version": "v3.1.31", + "source": { + "type": "git", + "url": "https://github.com/smarty-php/smarty.git", + "reference": "c7d42e4a327c402897dd587871434888fde1e7a9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/smarty-php/smarty/zipball/c7d42e4a327c402897dd587871434888fde1e7a9", + "reference": "c7d42e4a327c402897dd587871434888fde1e7a9", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "files": [ + "libs/bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0" + ], + "authors": [ + { + "name": "Monte Ohrt", + "email": "monte@ohrt.com" + }, + { + "name": "Uwe Tews", + "email": "uwe.tews@googlemail.com" + }, + { + "name": "Rodney Rehm", + "email": "rodney.rehm@medialize.de" + } + ], + "description": "Smarty - the compiling PHP template engine", + "homepage": "http://www.smarty.net", + "keywords": [ + "templating" + ], + "time": "2016-12-14T21:57:25+00:00" } ], "packages-dev": [ { "name": "behat/behat", - "version": "v3.4.1", + "version": "v3.4.3", "source": { "type": "git", "url": "https://github.com/Behat/Behat.git", - "reference": "cb51d4b0b11ea6d3897f3589a871a63a33632692" + "reference": "d60b161bff1b95ec4bb80bb8cb210ccf890314c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Behat/zipball/cb51d4b0b11ea6d3897f3589a871a63a33632692", - "reference": "cb51d4b0b11ea6d3897f3589a871a63a33632692", + "url": "https://api.github.com/repos/Behat/Behat/zipball/d60b161bff1b95ec4bb80bb8cb210ccf890314c2", + "reference": "d60b161bff1b95ec4bb80bb8cb210ccf890314c2", "shasum": "" }, "require": { @@ -887,18 +942,18 @@ "ext-mbstring": "*", "php": ">=5.3.3", "psr/container": "^1.0", - "symfony/class-loader": "~2.1||~3.0", - "symfony/config": "~2.3||~3.0", - "symfony/console": "~2.5||~3.0", - "symfony/dependency-injection": "~2.1||~3.0", - "symfony/event-dispatcher": "~2.1||~3.0", - "symfony/translation": "~2.3||~3.0", - "symfony/yaml": "~2.1||~3.0" + "symfony/class-loader": "~2.1||~3.0||~4.0", + "symfony/config": "~2.3||~3.0||~4.0", + "symfony/console": "~2.5||~3.0||~4.0", + "symfony/dependency-injection": "~2.1||~3.0||~4.0", + "symfony/event-dispatcher": "~2.1||~3.0||~4.0", + "symfony/translation": "~2.3||~3.0||~4.0", + "symfony/yaml": "~2.1||~3.0||~4.0" }, "require-dev": { "herrera-io/box": "~1.6.1", - "phpunit/phpunit": "~4.5", - "symfony/process": "~2.5|~3.0" + "phpunit/phpunit": "^4.8.36|^6.3", + "symfony/process": "~2.5|~3.0|~4.0" }, "suggest": { "behat/mink-extension": "for integration with Mink testing framework", @@ -947,7 +1002,7 @@ "symfony", "testing" ], - "time": "2017-09-18T11:10:28+00:00" + "time": "2017-11-27T10:37:56+00:00" }, { "name": "behat/gherkin", @@ -1124,27 +1179,27 @@ }, { "name": "behat/mink-extension", - "version": "v2.2", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/Behat/MinkExtension.git", - "reference": "5b4bda64ff456104564317e212c823e45cad9d59" + "reference": "badc565b7a1d05c4a4bf49c789045bcf7af6c6de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/MinkExtension/zipball/5b4bda64ff456104564317e212c823e45cad9d59", - "reference": "5b4bda64ff456104564317e212c823e45cad9d59", + "url": "https://api.github.com/repos/Behat/MinkExtension/zipball/badc565b7a1d05c4a4bf49c789045bcf7af6c6de", + "reference": "badc565b7a1d05c4a4bf49c789045bcf7af6c6de", "shasum": "" }, "require": { - "behat/behat": "~3.0,>=3.0.5", - "behat/mink": "~1.5", + "behat/behat": "^3.0.5", + "behat/mink": "^1.5", "php": ">=5.3.2", - "symfony/config": "~2.2|~3.0" + "symfony/config": "^2.7|^3.0|^4.0" }, "require-dev": { - "behat/mink-goutte-driver": "~1.1", - "phpspec/phpspec": "~2.0" + "behat/mink-goutte-driver": "^1.1", + "phpspec/phpspec": "^2.0" }, "type": "behat-extension", "extra": { @@ -1179,7 +1234,7 @@ "test", "web" ], - "time": "2016-02-15T07:55:18+00:00" + "time": "2017-11-24T19:30:49+00:00" }, { "name": "behat/mink-goutte-driver", @@ -1367,24 +1422,27 @@ }, { "name": "fabpot/goutte", - "version": "v3.2.1", + "version": "v3.2.2", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/Goutte.git", - "reference": "db5c28f4a010b4161d507d5304e28a7ebf211638" + "reference": "395f61d7c2e15a813839769553a4de16fa3b3c96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/db5c28f4a010b4161d507d5304e28a7ebf211638", - "reference": "db5c28f4a010b4161d507d5304e28a7ebf211638", + "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/395f61d7c2e15a813839769553a4de16fa3b3c96", + "reference": "395f61d7c2e15a813839769553a4de16fa3b3c96", "shasum": "" }, "require": { "guzzlehttp/guzzle": "^6.0", "php": ">=5.5.0", - "symfony/browser-kit": "~2.1|~3.0", - "symfony/css-selector": "~2.1|~3.0", - "symfony/dom-crawler": "~2.1|~3.0" + "symfony/browser-kit": "~2.1|~3.0|~4.0", + "symfony/css-selector": "~2.1|~3.0|~4.0", + "symfony/dom-crawler": "~2.1|~3.0|~4.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.3 || ^4" }, "type": "application", "extra": { @@ -1395,7 +1453,10 @@ "autoload": { "psr-4": { "Goutte\\": "Goutte" - } + }, + "exclude-from-classmap": [ + "Goutte/Tests" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1412,7 +1473,7 @@ "keywords": [ "scraper" ], - "time": "2017-01-03T13:21:43+00:00" + "time": "2017-11-19T08:45:40+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1858,22 +1919,22 @@ }, { "name": "php-mock/php-mock-phpunit", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/php-mock/php-mock-phpunit.git", - "reference": "173781abdc632c59200253e12e2b991ae6a4574f" + "reference": "b42fc41ecb7538564067527f6c30b8854f149d32" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-mock/php-mock-phpunit/zipball/173781abdc632c59200253e12e2b991ae6a4574f", - "reference": "173781abdc632c59200253e12e2b991ae6a4574f", + "url": "https://api.github.com/repos/php-mock/php-mock-phpunit/zipball/b42fc41ecb7538564067527f6c30b8854f149d32", + "reference": "b42fc41ecb7538564067527f6c30b8854f149d32", "shasum": "" }, "require": { "php": ">=7", "php-mock/php-mock-integration": "^2", - "phpunit/phpunit": "^6" + "phpunit/phpunit": "^6 <6.5" }, "type": "library", "autoload": { @@ -1905,20 +1966,20 @@ "test", "test double" ], - "time": "2017-02-17T22:44:38+00:00" + "time": "2017-12-02T09:49:02+00:00" }, { "name": "phpdocumentor/reflection-common", - "version": "1.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", - "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", "shasum": "" }, "require": { @@ -1959,33 +2020,39 @@ "reflection", "static analysis" ], - "time": "2015-12-27T11:43:31+00:00" + "time": "2017-09-11T18:02:19+00:00" }, { "name": "phpdocumentor/reflection-docblock", - "version": "3.1.1", + "version": "4.2.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e" + "reference": "66465776cfc249844bde6d117abff1d22e06c2da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/8331b5efe816ae05461b7ca1e721c01b46bafb3e", - "reference": "8331b5efe816ae05461b7ca1e721c01b46bafb3e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/66465776cfc249844bde6d117abff1d22e06c2da", + "reference": "66465776cfc249844bde6d117abff1d22e06c2da", "shasum": "" }, "require": { - "php": ">=5.5", - "phpdocumentor/reflection-common": "^1.0@dev", - "phpdocumentor/type-resolver": "^0.2.0", + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", "webmozart/assert": "^1.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, "autoload": { "psr-4": { "phpDocumentor\\Reflection\\": [ @@ -2004,24 +2071,24 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2016-09-30T07:12:33+00:00" + "time": "2017-11-27T17:38:31+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.2.1", + "version": "0.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb" + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", - "reference": "e224fb2ea2fba6d3ad6fdaef91cd09a172155ccb", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", "shasum": "" }, "require": { - "php": ">=5.5", + "php": "^5.5 || ^7.0", "phpdocumentor/reflection-common": "^1.0" }, "require-dev": { @@ -2051,37 +2118,37 @@ "email": "me@mikevanriel.com" } ], - "time": "2016-11-25T06:54:22+00:00" + "time": "2017-07-14T14:27:02+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.7.0", + "version": "1.7.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073" + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/93d39f1f7f9326d746203c7c056f300f7f126073", - "reference": "93d39f1f7f9326d746203c7c056f300f7f126073", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", + "reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", "sebastian/comparator": "^1.1|^2.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8 || ^5.6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6.x-dev" + "dev-master": "1.7.x-dev" } }, "autoload": { @@ -2114,45 +2181,33 @@ "spy", "stub" ], - "time": "2017-03-02T20:05:34+00:00" + "time": "2017-11-24T13:59:53+00:00" }, { - "name": "phpunit/php-code-coverage", - "version": "5.2.2", + "name": "phpunit/dbunit", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "8ed1902a57849e117b5651fc1a5c48110946c06b" + "url": "https://github.com/sebastianbergmann/dbunit.git", + "reference": "403350339b6aca748ee0067d027d85621992e21f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/8ed1902a57849e117b5651fc1a5c48110946c06b", - "reference": "8ed1902a57849e117b5651fc1a5c48110946c06b", + "url": "https://api.github.com/repos/sebastianbergmann/dbunit/zipball/403350339b6aca748ee0067d027d85621992e21f", + "reference": "403350339b6aca748ee0067d027d85621992e21f", "shasum": "" }, "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", + "ext-pdo": "*", + "ext-simplexml": "*", "php": "^7.0", - "phpunit/php-file-iterator": "^1.4.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^1.4.11 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.0", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1" - }, - "require-dev": { - "ext-xdebug": "^2.5", - "phpunit/phpunit": "^6.0" - }, - "suggest": { - "ext-xdebug": "^2.5.5" + "phpunit/phpunit": "^6.0", + "symfony/yaml": "^3.0 || ^4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.2.x-dev" + "dev-master": "3.0.x-dev" } }, "autoload": { @@ -2167,7 +2222,70 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "PHPUnit extension for database interaction testing", + "homepage": "https://github.com/sebastianbergmann/dbunit/", + "keywords": [ + "database", + "testing", + "xunit" + ], + "time": "2017-11-18T17:40:34+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/661f34d0bd3f1a7225ef491a70a020ad23a057a1", + "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^2.0.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-xdebug": "^2.5.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -2178,20 +2296,20 @@ "testing", "xunit" ], - "time": "2017-08-03T12:40:43+00:00" + "time": "2017-12-06T09:29:45+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.2", + "version": "1.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5" + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/3cc8f69b3028d0f96a9078e6295d86e9bf019be5", - "reference": "3cc8f69b3028d0f96a9078e6295d86e9bf019be5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", "shasum": "" }, "require": { @@ -2225,7 +2343,7 @@ "filesystem", "iterator" ], - "time": "2016-10-03T07:40:28+00:00" + "time": "2017-11-27T13:52:08+00:00" }, { "name": "phpunit/php-text-template", @@ -2319,16 +2437,16 @@ }, { "name": "phpunit/php-token-stream", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0" + "reference": "791198a2c6254db10131eecfe8c06670700904db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/9a02332089ac48e704c70f6cefed30c224e3c0b0", - "reference": "9a02332089ac48e704c70f6cefed30c224e3c0b0", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", "shasum": "" }, "require": { @@ -2364,20 +2482,20 @@ "keywords": [ "tokenizer" ], - "time": "2017-08-20T05:47:52+00:00" + "time": "2017-11-27T05:48:46+00:00" }, { "name": "phpunit/phpunit", - "version": "6.4.3", + "version": "6.4.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "06b28548fd2b4a20c3cd6e247dc86331a7d4db13" + "reference": "562f7dc75d46510a4ed5d16189ae57fbe45a9932" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/06b28548fd2b4a20c3cd6e247dc86331a7d4db13", - "reference": "06b28548fd2b4a20c3cd6e247dc86331a7d4db13", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/562f7dc75d46510a4ed5d16189ae57fbe45a9932", + "reference": "562f7dc75d46510a4ed5d16189ae57fbe45a9932", "shasum": "" }, "require": { @@ -2448,7 +2566,7 @@ "testing", "xunit" ], - "time": "2017-10-16T13:18:59+00:00" + "time": "2017-11-08T11:26:09+00:00" }, { "name": "phpunit/phpunit-mock-objects", @@ -2655,30 +2773,30 @@ }, { "name": "sebastian/comparator", - "version": "2.0.2", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "ae068fede81d06e7bb9bb46a367210a3d3e1fe6a" + "reference": "1174d9018191e93cb9d719edec01257fc05f8158" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/ae068fede81d06e7bb9bb46a367210a3d3e1fe6a", - "reference": "ae068fede81d06e7bb9bb46a367210a3d3e1fe6a", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1174d9018191e93cb9d719edec01257fc05f8158", + "reference": "1174d9018191e93cb9d719edec01257fc05f8158", "shasum": "" }, "require": { "php": "^7.0", "sebastian/diff": "^2.0", - "sebastian/exporter": "^3.0" + "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.1.x-dev" } }, "autoload": { @@ -2709,13 +2827,13 @@ } ], "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", + "homepage": "https://github.com/sebastianbergmann/comparator", "keywords": [ "comparator", "compare", "equality" ], - "time": "2017-08-03T07:14:59+00:00" + "time": "2017-11-03T07:16:52+00:00" }, { "name": "sebastian/diff", @@ -3169,25 +3287,25 @@ }, { "name": "symfony/browser-kit", - "version": "v3.3.10", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "317d5bdf0127f06db7ea294186132b4f5b036839" + "reference": "f761b4ecdd23a451c2cae6fba704d8b207cbb045" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/317d5bdf0127f06db7ea294186132b4f5b036839", - "reference": "317d5bdf0127f06db7ea294186132b4f5b036839", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/f761b4ecdd23a451c2cae6fba704d8b207cbb045", + "reference": "f761b4ecdd23a451c2cae6fba704d8b207cbb045", "shasum": "" }, "require": { "php": "^5.5.9|>=7.0.8", - "symfony/dom-crawler": "~2.8|~3.0" + "symfony/dom-crawler": "~2.8|~3.0|~4.0" }, "require-dev": { - "symfony/css-selector": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" + "symfony/css-selector": "~2.8|~3.0|~4.0", + "symfony/process": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/process": "" @@ -3195,7 +3313,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3222,27 +3340,27 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" + "time": "2017-12-11T22:06:16+00:00" }, { "name": "symfony/class-loader", - "version": "v3.3.10", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/class-loader.git", - "reference": "7572c904b209fa9907c69a6a9a68243c265a4d01" + "reference": "e8d36a7b5568d232f5c3f8ef92665836b9f1e038" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/class-loader/zipball/7572c904b209fa9907c69a6a9a68243c265a4d01", - "reference": "7572c904b209fa9907c69a6a9a68243c265a4d01", + "url": "https://api.github.com/repos/symfony/class-loader/zipball/e8d36a7b5568d232f5c3f8ef92665836b9f1e038", + "reference": "e8d36a7b5568d232f5c3f8ef92665836b9f1e038", "shasum": "" }, "require": { "php": "^5.5.9|>=7.0.8" }, "require-dev": { - "symfony/finder": "~2.8|~3.0", + "symfony/finder": "~2.8|~3.0|~4.0", "symfony/polyfill-apcu": "~1.1" }, "suggest": { @@ -3251,7 +3369,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3278,34 +3396,34 @@ ], "description": "Symfony ClassLoader Component", "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" + "time": "2017-11-05T16:10:10+00:00" }, { "name": "symfony/config", - "version": "v3.3.10", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "4ab62407bff9cd97c410a7feaef04c375aaa5cfd" + "reference": "e57211b88aa889fefac1cb36866db04100b0f21c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/4ab62407bff9cd97c410a7feaef04c375aaa5cfd", - "reference": "4ab62407bff9cd97c410a7feaef04c375aaa5cfd", + "url": "https://api.github.com/repos/symfony/config/zipball/e57211b88aa889fefac1cb36866db04100b0f21c", + "reference": "e57211b88aa889fefac1cb36866db04100b0f21c", "shasum": "" }, "require": { "php": "^5.5.9|>=7.0.8", - "symfony/filesystem": "~2.8|~3.0" + "symfony/filesystem": "~2.8|~3.0|~4.0" }, "conflict": { "symfony/dependency-injection": "<3.3", "symfony/finder": "<3.3" }, "require-dev": { - "symfony/dependency-injection": "~3.3", - "symfony/finder": "~3.3", - "symfony/yaml": "~3.0" + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/finder": "~3.3|~4.0", + "symfony/yaml": "~3.0|~4.0" }, "suggest": { "symfony/yaml": "To use the yaml reference dumper" @@ -3313,7 +3431,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3340,48 +3458,49 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2017-10-04T18:56:58+00:00" + "time": "2017-12-14T19:40:10+00:00" }, { "name": "symfony/console", - "version": "v3.3.10", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "116bc56e45a8e5572e51eb43ab58c769a352366c" + "reference": "9f21adfb92a9315b73ae2ed43138988ee4913d4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/116bc56e45a8e5572e51eb43ab58c769a352366c", - "reference": "116bc56e45a8e5572e51eb43ab58c769a352366c", + "url": "https://api.github.com/repos/symfony/console/zipball/9f21adfb92a9315b73ae2ed43138988ee4913d4e", + "reference": "9f21adfb92a9315b73ae2ed43138988ee4913d4e", "shasum": "" }, "require": { "php": "^5.5.9|>=7.0.8", - "symfony/debug": "~2.8|~3.0", + "symfony/debug": "~2.8|~3.0|~4.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/dependency-injection": "<3.3" + "symfony/dependency-injection": "<3.4", + "symfony/process": "<3.3" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~3.3", - "symfony/dependency-injection": "~3.3", - "symfony/event-dispatcher": "~2.8|~3.0", - "symfony/filesystem": "~2.8|~3.0", - "symfony/process": "~2.8|~3.0" + "symfony/config": "~3.3|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/event-dispatcher": "~2.8|~3.0|~4.0", + "symfony/lock": "~3.4|~4.0", + "symfony/process": "~3.3|~4.0" }, "suggest": { "psr/log": "For using the console logger", "symfony/event-dispatcher": "", - "symfony/filesystem": "", + "symfony/lock": "", "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3408,20 +3527,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" + "time": "2017-12-14T19:40:10+00:00" }, { "name": "symfony/css-selector", - "version": "v3.3.10", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "07447650225ca9223bd5c97180fe7c8267f7d332" + "reference": "eac760b414cf1f64362c3dd047b989e4db121332" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/07447650225ca9223bd5c97180fe7c8267f7d332", - "reference": "07447650225ca9223bd5c97180fe7c8267f7d332", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/eac760b414cf1f64362c3dd047b989e4db121332", + "reference": "eac760b414cf1f64362c3dd047b989e4db121332", "shasum": "" }, "require": { @@ -3430,7 +3549,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3461,20 +3580,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" + "time": "2017-12-14T19:40:10+00:00" }, { "name": "symfony/debug", - "version": "v3.3.10", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd" + "reference": "543deab3ffff94402440b326fc94153bae2dfa7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd", - "reference": "eb95d9ce8f18dcc1b3dfff00cb624c402be78ffd", + "url": "https://api.github.com/repos/symfony/debug/zipball/543deab3ffff94402440b326fc94153bae2dfa7a", + "reference": "543deab3ffff94402440b326fc94153bae2dfa7a", "shasum": "" }, "require": { @@ -3485,12 +3604,12 @@ "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" }, "require-dev": { - "symfony/http-kernel": "~2.8|~3.0" + "symfony/http-kernel": "~2.8|~3.0|~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3517,20 +3636,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" + "time": "2017-12-12T08:27:14+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.3.10", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "8ebad929aee3ca185b05f55d9cc5521670821ad1" + "reference": "5f81907ea43bfa971ac2c7fbac593ebe7cd7d333" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/8ebad929aee3ca185b05f55d9cc5521670821ad1", - "reference": "8ebad929aee3ca185b05f55d9cc5521670821ad1", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/5f81907ea43bfa971ac2c7fbac593ebe7cd7d333", + "reference": "5f81907ea43bfa971ac2c7fbac593ebe7cd7d333", "shasum": "" }, "require": { @@ -3538,17 +3657,18 @@ "psr/container": "^1.0" }, "conflict": { - "symfony/config": "<3.3.1", + "symfony/config": "<3.3.7", "symfony/finder": "<3.3", - "symfony/yaml": "<3.3" + "symfony/proxy-manager-bridge": "<3.4", + "symfony/yaml": "<3.4" }, "provide": { "psr/container-implementation": "1.0" }, "require-dev": { - "symfony/config": "~3.3", - "symfony/expression-language": "~2.8|~3.0", - "symfony/yaml": "~3.3" + "symfony/config": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { "symfony/config": "", @@ -3560,7 +3680,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3587,20 +3707,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2017-10-04T17:15:30+00:00" + "time": "2017-12-14T19:40:10+00:00" }, { "name": "symfony/dom-crawler", - "version": "v3.3.10", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "40dafd42d5dad7fe5ad4e958413d92a207522ac1" + "reference": "dc847845c66fa68ad4522ed27e62b9b9dd12ab3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/40dafd42d5dad7fe5ad4e958413d92a207522ac1", - "reference": "40dafd42d5dad7fe5ad4e958413d92a207522ac1", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/dc847845c66fa68ad4522ed27e62b9b9dd12ab3b", + "reference": "dc847845c66fa68ad4522ed27e62b9b9dd12ab3b", "shasum": "" }, "require": { @@ -3608,7 +3728,7 @@ "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { - "symfony/css-selector": "~2.8|~3.0" + "symfony/css-selector": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/css-selector": "" @@ -3616,7 +3736,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3643,20 +3763,20 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" + "time": "2017-12-14T19:40:10+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.3.10", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "d7ba037e4b8221956ab1e221c73c9e27e05dd423" + "reference": "b869cbf8a15ca6261689de2c28a7d7f2d0706835" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d7ba037e4b8221956ab1e221c73c9e27e05dd423", - "reference": "d7ba037e4b8221956ab1e221c73c9e27e05dd423", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b869cbf8a15ca6261689de2c28a7d7f2d0706835", + "reference": "b869cbf8a15ca6261689de2c28a7d7f2d0706835", "shasum": "" }, "require": { @@ -3667,10 +3787,10 @@ }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0", - "symfony/dependency-injection": "~3.3", - "symfony/expression-language": "~2.8|~3.0", - "symfony/stopwatch": "~2.8|~3.0" + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.3|~4.0", + "symfony/expression-language": "~2.8|~3.0|~4.0", + "symfony/stopwatch": "~2.8|~3.0|~4.0" }, "suggest": { "symfony/dependency-injection": "", @@ -3679,7 +3799,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3706,20 +3826,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" + "time": "2017-12-14T19:40:10+00:00" }, { "name": "symfony/filesystem", - "version": "v3.3.10", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1" + "reference": "25b135bea251829e3db6a77d773643408b575ed4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/90bc45abf02ae6b7deb43895c1052cb0038506f1", - "reference": "90bc45abf02ae6b7deb43895c1052cb0038506f1", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/25b135bea251829e3db6a77d773643408b575ed4", + "reference": "25b135bea251829e3db6a77d773643408b575ed4", "shasum": "" }, "require": { @@ -3728,7 +3848,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3755,7 +3875,7 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2017-10-03T13:33:10+00:00" + "time": "2017-12-14T19:40:10+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -3818,16 +3938,16 @@ }, { "name": "symfony/translation", - "version": "v3.3.10", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "409bf229cd552bf7e3faa8ab7e3980b07672073f" + "reference": "4c5d5582baf2829751a5207659329c1f52eedeb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/409bf229cd552bf7e3faa8ab7e3980b07672073f", - "reference": "409bf229cd552bf7e3faa8ab7e3980b07672073f", + "url": "https://api.github.com/repos/symfony/translation/zipball/4c5d5582baf2829751a5207659329c1f52eedeb6", + "reference": "4c5d5582baf2829751a5207659329c1f52eedeb6", "shasum": "" }, "require": { @@ -3836,13 +3956,16 @@ }, "conflict": { "symfony/config": "<2.8", - "symfony/yaml": "<3.3" + "symfony/dependency-injection": "<3.4", + "symfony/yaml": "<3.4" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0", - "symfony/intl": "^2.8.18|^3.2.5", - "symfony/yaml": "~3.3" + "symfony/config": "~2.8|~3.0|~4.0", + "symfony/dependency-injection": "~3.4|~4.0", + "symfony/finder": "~2.8|~3.0|~4.0", + "symfony/intl": "^2.8.18|^3.2.5|~4.0", + "symfony/yaml": "~3.4|~4.0" }, "suggest": { "psr/log": "To use logging capability in translator", @@ -3852,7 +3975,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3879,27 +4002,30 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2017-10-02T06:42:24+00:00" + "time": "2017-12-12T08:27:14+00:00" }, { "name": "symfony/yaml", - "version": "v3.3.10", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46" + "reference": "afe0cd38486505c9703707707d91450cfc1bd536" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46", - "reference": "8c7bf1e7d5d6b05a690b715729cb4cd0c0a99c46", + "url": "https://api.github.com/repos/symfony/yaml/zipball/afe0cd38486505c9703707707d91450cfc1bd536", + "reference": "afe0cd38486505c9703707707d91450cfc1bd536", "shasum": "" }, "require": { "php": "^5.5.9|>=7.0.8" }, + "conflict": { + "symfony/console": "<3.4" + }, "require-dev": { - "symfony/console": "~2.8|~3.0" + "symfony/console": "~3.4|~4.0" }, "suggest": { "symfony/console": "For validating YAML files using the lint command" @@ -3907,7 +4033,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.3-dev" + "dev-master": "3.4-dev" } }, "autoload": { @@ -3934,7 +4060,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-10-05T14:43:42+00:00" + "time": "2017-12-11T20:38:23+00:00" }, { "name": "theseer/tokenizer", diff --git a/doc/developer/api_zot.bb b/doc/developer/api_zot.bb index b2c19d7a1..ff937bfa5 100644 --- a/doc/developer/api_zot.bb +++ b/doc/developer/api_zot.bb @@ -1,5 +1,9 @@ [h3]Zot API[/h3] +Many existing social applications and tools can interface directly using the Twitter/StatusNet API, which is available using the 'twitter_api' addon. + +This document describes the native API; which allows direct programmatic access to several internal data structures and libraries extending beyond the basic social interface. + The API endpoints detailed below are relative to [code]api/z/1.0[/code], meaning that if an API is listed as [code]channel/stream[/code] the full API URL is [code][baseurl]/api/z/1.0/channel/stream[/code]. [h3]channel/export/basic[/h3] diff --git a/include/bbcode.php b/include/bbcode.php index ed34bc5d6..775a91f9a 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -941,27 +941,34 @@ function bbcode($Text, $options = []) { // Check for h1 if (strpos($Text,'[h1]') !== false) { $Text = preg_replace("(\[h1\](.*?)\[\/h1\])ism",'

$1

',$Text); + $Text = str_replace('
', '', $Text); } // Check for h2 if (strpos($Text,'[h2]') !== false) { $Text = preg_replace("(\[h2\](.*?)\[\/h2\])ism",'

$1

',$Text); + $Text = str_replace('
', '', $Text); } // Check for h3 if (strpos($Text,'[h3]') !== false) { $Text = preg_replace("(\[h3\](.*?)\[\/h3\])ism",'

$1

',$Text); + $Text = str_replace('
', '', $Text); } // Check for h4 if (strpos($Text,'[h4]') !== false) { $Text = preg_replace("(\[h4\](.*?)\[\/h4\])ism",'

$1

',$Text); + $Text = str_replace('
', '', $Text); } // Check for h5 if (strpos($Text,'[h5]') !== false) { $Text = preg_replace("(\[h5\](.*?)\[\/h5\])ism",'
$1
',$Text); + $Text = str_replace('
', '', $Text); } // Check for h6 if (strpos($Text,'[h6]') !== false) { $Text = preg_replace("(\[h6\](.*?)\[\/h6\])ism",'
$1
',$Text); + $Text = str_replace('
', '', $Text); } + // Check for table of content without params while(strpos($Text,'[toc]') !== false) { $toc_id = 'toc-' . random_string(10); diff --git a/include/feedutils.php b/include/feedutils.php index 8f2c5d988..4638ef66a 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -1305,7 +1305,7 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { // allow likes of comments - if($item_parent_mid && activity_match($datarray['verb'],ACTVITY_LIKE)) { + if($item_parent_mid && activity_match($datarray['verb'],ACTIVITY_LIKE)) { $datarray['thr_parent'] = $item_parent_mid[0]['parent_mid']; } diff --git a/include/html2bbcode.php b/include/html2bbcode.php index d7fbd8660..f67231847 100644 --- a/include/html2bbcode.php +++ b/include/html2bbcode.php @@ -196,12 +196,12 @@ function html2bbcode($message) //node2bbcode($doc, 'tr', array(), "[tr]", "[/tr]"); //node2bbcode($doc, 'td', array(), "[td]", "[/td]"); - node2bbcode($doc, 'h1', array(), "\n\n[size=xx-large][b]", "[/b][/size]\n"); - node2bbcode($doc, 'h2', array(), "\n\n[size=x-large][b]", "[/b][/size]\n"); - node2bbcode($doc, 'h3', array(), "\n\n[size=large][b]", "[/b][/size]\n"); - node2bbcode($doc, 'h4', array(), "\n\n[size=medium][b]", "[/b][/size]\n"); - node2bbcode($doc, 'h5', array(), "\n\n[size=small][b]", "[/b][/size]\n"); - node2bbcode($doc, 'h6', array(), "\n\n[size=x-small][b]", "[/b][/size]\n"); + node2bbcode($doc, 'h1', array(), "\n\n[h1]", "[/h1]\n"); + node2bbcode($doc, 'h2', array(), "\n\n[h2]", "[/h2]\n"); + node2bbcode($doc, 'h3', array(), "\n\n[h3]", "[/h3]\n"); + node2bbcode($doc, 'h4', array(), "\n\n[h4]", "[/h4]\n"); + node2bbcode($doc, 'h5', array(), "\n\n[h5]", "[/h5]\n"); + node2bbcode($doc, 'h6', array(), "\n\n[h6]", "[/h6]\n"); node2bbcode($doc, 'a', array('href'=>'/(.+)/'), '[url=$1]', '[/url]'); diff --git a/include/message.php b/include/message.php index b57d2e068..4a673b961 100644 --- a/include/message.php +++ b/include/message.php @@ -215,7 +215,7 @@ function send_message($uid = 0, $recipient = '', $body = '', $subject = '', $rep return $ret; } - if(count($images)) { + if($images) { foreach($images as $image) { if(! stristr($image,z_root() . '/photo/')) continue; diff --git a/include/text.php b/include/text.php index f3d522e04..107efe0cb 100644 --- a/include/text.php +++ b/include/text.php @@ -1754,9 +1754,14 @@ function get_plink($item,$conversation_mode = true) { else $key = 'llink'; + $zidify = true; + + if(array_key_exists('author',$item) && $item['author']['xchan_network'] !== 'zot') + $zidify = false; + if(x($item,$key)) { return array( - 'href' => zid($item[$key]), + 'href' => (($zidify) ? zid($item[$key]) : $item[$key]), 'title' => t('Link to Source'), ); } diff --git a/library/Smarty/libs/plugins/function.counter.php b/library/Smarty/libs/plugins/function.counter.php deleted file mode 100644 index 4da85a14e..000000000 --- a/library/Smarty/libs/plugins/function.counter.php +++ /dev/null @@ -1,78 +0,0 @@ - - * Name: counter
- * Purpose: print out a counter value - * - * @author Monte Ohrt - * @link http://www.smarty.net/manual/en/language.function.counter.php {counter} - * (Smarty online manual) - * - * @param array $params parameters - * @param Smarty_Internal_Template $template template object - * - * @return string|null - */ -function smarty_function_counter($params, $template) -{ - static $counters = array(); - - $name = (isset($params['name'])) ? $params['name'] : 'default'; - if (!isset($counters[$name])) { - $counters[$name] = array( - 'start' => 1, - 'skip' => 1, - 'direction' => 'up', - 'count' => 1 - ); - } - $counter =& $counters[$name]; - - if (isset($params['start'])) { - $counter['start'] = $counter['count'] = (int) $params['start']; - } - - if (!empty($params['assign'])) { - $counter['assign'] = $params['assign']; - } - - if (isset($counter['assign'])) { - $template->assign($counter['assign'], $counter['count']); - } - - if (isset($params['print'])) { - $print = (bool) $params['print']; - } else { - $print = empty($counter['assign']); - } - - if ($print) { - $retval = $counter['count']; - } else { - $retval = null; - } - - if (isset($params['skip'])) { - $counter['skip'] = $params['skip']; - } - - if (isset($params['direction'])) { - $counter['direction'] = $params['direction']; - } - - if ($counter['direction'] == "down") { - $counter['count'] -= $counter['skip']; - } else { - $counter['count'] += $counter['skip']; - } - - return $retval; -} diff --git a/library/Smarty/libs/plugins/function.math.php b/library/Smarty/libs/plugins/function.math.php deleted file mode 100644 index aba76e825..000000000 --- a/library/Smarty/libs/plugins/function.math.php +++ /dev/null @@ -1,91 +0,0 @@ - - * Name: math
- * Purpose: handle math computations in template - * - * @link http://www.smarty.net/manual/en/language.function.math.php {math} - * (Smarty online manual) - * @author Monte Ohrt - * - * @param array $params parameters - * @param Smarty_Internal_Template $template template object - * - * @return string|null - */ -function smarty_function_math($params, $template) -{ - static $_allowed_funcs = array( - 'int' => true, 'abs' => true, 'ceil' => true, 'cos' => true, 'exp' => true, 'floor' => true, - 'log' => true, 'log10' => true, 'max' => true, 'min' => true, 'pi' => true, 'pow' => true, - 'rand' => true, 'round' => true, 'sin' => true, 'sqrt' => true, 'srand' => true, 'tan' => true - ); - // be sure equation parameter is present - if (empty($params['equation'])) { - trigger_error("math: missing equation parameter", E_USER_WARNING); - - return; - } - - $equation = $params['equation']; - - // make sure parenthesis are balanced - if (substr_count($equation, "(") != substr_count($equation, ")")) { - trigger_error("math: unbalanced parenthesis", E_USER_WARNING); - - return; - } - - // match all vars in equation, make sure all are passed - preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]*)!", $equation, $match); - - foreach ($match[1] as $curr_var) { - if ($curr_var && !isset($params[$curr_var]) && !isset($_allowed_funcs[$curr_var])) { - trigger_error("math: function call $curr_var not allowed", E_USER_WARNING); - - return; - } - } - - foreach ($params as $key => $val) { - if ($key != "equation" && $key != "format" && $key != "assign") { - // make sure value is not empty - if (strlen($val) == 0) { - trigger_error("math: parameter $key is empty", E_USER_WARNING); - - return; - } - if (!is_numeric($val)) { - trigger_error("math: parameter $key: is not numeric", E_USER_WARNING); - - return; - } - $equation = preg_replace("/\b$key\b/", " \$params['$key'] ", $equation); - } - } - $smarty_math_result = null; - eval("\$smarty_math_result = " . $equation . ";"); - - if (empty($params['format'])) { - if (empty($params['assign'])) { - return $smarty_math_result; - } else { - $template->assign($params['assign'], $smarty_math_result); - } - } else { - if (empty($params['assign'])) { - printf($params['format'], $smarty_math_result); - } else { - $template->assign($params['assign'], sprintf($params['format'], $smarty_math_result)); - } - } -} diff --git a/library/Smarty/libs/plugins/modifiercompiler.unescape.php b/library/Smarty/libs/plugins/modifiercompiler.unescape.php deleted file mode 100644 index 3b17ea2e1..000000000 --- a/library/Smarty/libs/plugins/modifiercompiler.unescape.php +++ /dev/null @@ -1,50 +0,0 @@ - - * Name: unescape
- * Purpose: unescape html entities - * - * @author Rodney Rehm - * - * @param array $params parameters - * - * @return string with compiled code - */ -function smarty_modifiercompiler_unescape($params) -{ - if (!isset($params[1])) { - $params[1] = 'html'; - } - if (!isset($params[2])) { - $params[2] = '\'' . addslashes(Smarty::$_CHARSET) . '\''; - } else { - $params[2] = "'" . $params[2] . "'"; - } - - switch (trim($params[1], '"\'')) { - case 'entity': - case 'htmlall': - if (Smarty::$_MBSTRING) { - return 'mb_convert_encoding(' . $params[0] . ', ' . $params[2] . ', \'HTML-ENTITIES\')'; - } - - return 'html_entity_decode(' . $params[0] . ', ENT_NOQUOTES, ' . $params[2] . ')'; - - case 'html': - return 'htmlspecialchars_decode(' . $params[0] . ', ENT_QUOTES)'; - - case 'url': - return 'rawurldecode(' . $params[0] . ')'; - - default: - return $params[0]; - } -} diff --git a/library/Smarty/libs/plugins/shared.escape_special_chars.php b/library/Smarty/libs/plugins/shared.escape_special_chars.php deleted file mode 100644 index d3bd756b1..000000000 --- a/library/Smarty/libs/plugins/shared.escape_special_chars.php +++ /dev/null @@ -1,53 +0,0 @@ -=')) { - /** - * escape_special_chars common function - * Function: smarty_function_escape_special_chars
- * Purpose: used by other smarty functions to escape - * special chars except for already escaped ones - * - * @author Monte Ohrt - * - * @param string $string text that should by escaped - * - * @return string - */ - function smarty_function_escape_special_chars($string) - { - if (!is_array($string)) { - $string = htmlspecialchars($string, ENT_COMPAT, Smarty::$_CHARSET, false); - } - - return $string; - } -} else { - /** - * escape_special_chars common function - * Function: smarty_function_escape_special_chars
- * Purpose: used by other smarty functions to escape - * special chars except for already escaped ones - * - * @author Monte Ohrt - * - * @param string $string text that should by escaped - * - * @return string - */ - function smarty_function_escape_special_chars($string) - { - if (!is_array($string)) { - $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string); - $string = htmlspecialchars($string); - $string = str_replace(array('%%%SMARTY_START%%%', '%%%SMARTY_END%%%'), array('&', ';'), $string); - } - - return $string; - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_assign.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_assign.php deleted file mode 100644 index 5e3fce3cc..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_compile_assign.php +++ /dev/null @@ -1,98 +0,0 @@ - true, 'parent' => true, 'root' => true, 'global' => true, - 'smarty' => true, 'tpl_root' => true); - - /** - * Compiles code for the {assign} tag - * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter - * - * @return string compiled code - * @throws \SmartyCompilerException - */ - public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) - { - // the following must be assigned at runtime because it will be overwritten in Smarty_Internal_Compile_Append - $this->required_attributes = array('var', 'value'); - $this->shorttag_order = array('var', 'value'); - $this->optional_attributes = array('scope', 'bubble_up'); - $_nocache = 'null'; - // check and get attributes - $_attr = $this->getAttributes($compiler, $args); - // nocache ? - if ($compiler->tag_nocache || $compiler->nocache) { - $_nocache = 'true'; - // create nocache var to make it know for further compiling - if (isset($compiler->template->tpl_vars[trim($_attr['var'], "'")])) { - $compiler->template->tpl_vars[trim($_attr['var'], "'")]->nocache = true; - } else { - $compiler->template->tpl_vars[trim($_attr['var'], "'")] = new Smarty_Variable(null, true); - } - } - // scope setup - $_scope = Smarty::SCOPE_LOCAL; - if (isset($_attr['scope'])) { - $_attr['scope'] = trim($_attr['scope'], "'\""); - if (!isset($this->valid_scopes[$_attr['scope']])) { - $compiler->trigger_template_error("illegal value '{$_attr['scope']}' for \"scope\" attribute", null, true); - } - if ($_attr['scope'] != 'local') { - if ($_attr['scope'] == 'parent') { - $_scope = Smarty::SCOPE_PARENT; - } elseif ($_attr['scope'] == 'root') { - $_scope = Smarty::SCOPE_ROOT; - } elseif ($_attr['scope'] == 'global') { - $_scope = Smarty::SCOPE_GLOBAL; - } elseif ($_attr['scope'] == 'smarty') { - $_scope = Smarty::SCOPE_SMARTY; - } elseif ($_attr['scope'] == 'tpl_root') { - $_scope = Smarty::SCOPE_TPL_ROOT; - } - $_scope += (isset($_attr['bubble_up']) && $_attr['bubble_up'] == 'false') ? 0 : Smarty::SCOPE_BUBBLE_UP; - } - } - // compiled output - if (isset($parameter['smarty_internal_index'])) { - $output = - "smarty->ext->_var->createLocalArrayVariable(\$_smarty_tpl, $_attr[var], $_nocache);\n\$_smarty_tpl->tpl_vars[$_attr[var]]->value$parameter[smarty_internal_index] = $_attr[value];"; - } else { - // implement Smarty2's behaviour of variables assigned by reference - if ($compiler->template->smarty instanceof SmartyBC) { - $output = - "tpl_vars[$_attr[var]])) {\$_smarty_tpl->tpl_vars[$_attr[var]] = clone \$_smarty_tpl->tpl_vars[$_attr[var]];"; - $output .= "\n\$_smarty_tpl->tpl_vars[$_attr[var]]->value = $_attr[value]; \$_smarty_tpl->tpl_vars[$_attr[var]]->nocache = $_nocache;"; - $output .= "\n} else \$_smarty_tpl->tpl_vars[$_attr[var]] = new Smarty_Variable($_attr[value], $_nocache);"; - } else { - $output = "tpl_vars[$_attr[var]] = new Smarty_Variable($_attr[value], $_nocache);"; - } - } - $output .= "\n\$_smarty_tpl->ext->_updateScope->updateScope(\$_smarty_tpl, $_attr[var], $_scope);"; - $output .= '?>'; - - return $output; - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_block.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_block.php deleted file mode 100644 index ab1fc6e00..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_compile_block.php +++ /dev/null @@ -1,292 +0,0 @@ - - */ -class Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inheritance -{ - /** - * Attribute definition: Overwrites base class. - * - * @var array - * @see Smarty_Internal_CompileBase - */ - public $required_attributes = array('name'); - - /** - * Attribute definition: Overwrites base class. - * - * @var array - * @see Smarty_Internal_CompileBase - */ - public $shorttag_order = array('name'); - - /** - * Attribute definition: Overwrites base class. - * - * @var array - * @see Smarty_Internal_CompileBase - */ - public $option_flags = array('hide', 'nocache'); - - /** - * Attribute definition: Overwrites base class. - * - * @var array - * @see Smarty_Internal_CompileBase - */ - public $optional_attributes = array('assign'); - - /** - * nesting level of block tags - * - * @var int - */ - public static $blockTagNestingLevel = 0; - - /** - * Saved compiler object - * - * @var Smarty_Internal_TemplateCompilerBase - */ - public $compiler = null; - - /** - * Compiles code for the {block} tag - * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter - * - * @return bool true - */ - public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) - { - if (!isset($compiler->_cache['blockNesting'])) { - $compiler->_cache['blockNesting'] = 0; - } - if ($compiler->_cache['blockNesting'] == 0) { - // make sure that inheritance gets initialized in template code - $this->registerInit($compiler); - $this->option_flags = array('hide', 'nocache', 'append', 'prepend'); - } else { - $this->option_flags = array('hide', 'nocache'); - } - // check and get attributes - $_attr = $this->getAttributes($compiler, $args); - $compiler->_cache['blockNesting'] ++; - $compiler->_cache['blockName'][$compiler->_cache['blockNesting']] = $_attr['name']; - $compiler->_cache['blockParams'][$compiler->_cache['blockNesting']][0] = 'block_' . preg_replace('![^\w]+!', '_', uniqid(rand(), true)); - $compiler->_cache['blockParams'][$compiler->_cache['blockNesting']][1] = false; - $this->openTag($compiler, 'block', array($_attr, $compiler->nocache, $compiler->parser->current_buffer, - $compiler->template->compiled->has_nocache_code, - $compiler->template->caching)); - // must whole block be nocache ? - if ($compiler->tag_nocache) { - $i = 0; - } - $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; - // $compiler->suppressNocacheProcessing = true; - if ($_attr['nocache'] === true) { - //$compiler->trigger_template_error('nocache option not allowed', $compiler->parser->lex->taglineno); - } - $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template(); - $compiler->template->compiled->has_nocache_code = false; - $compiler->suppressNocacheProcessing = true; - } - - /** - * Compile saved child block source - * - * @param \Smarty_Internal_TemplateCompilerBase compiler object - * @param string $_name optional name of child block - * - * @return string compiled code of child block - */ - static function compileChildBlock(Smarty_Internal_TemplateCompilerBase $compiler, $_name = null) - { - if (!isset($compiler->_cache['blockNesting'])) { - $compiler->trigger_template_error(' tag {$smarty.block.child} used outside {block} tags ', - $compiler->parser->lex->taglineno); - } - $compiler->has_code = true; - $compiler->suppressNocacheProcessing = true; - $compiler->_cache['blockParams'][$compiler->_cache['blockNesting']][1] = true; - $output = "ext->_inheritance->processBlock(\$_smarty_tpl, 2, {$compiler->_cache['blockName'][$compiler->_cache['blockNesting']]}, null, \$_blockParentStack);\n?>\n"; - return $output; - } - - /** - * Compile $smarty.block.parent - * - * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param string $_name optional name of child block - * - * @return string compiled code of child block - */ - static function compileParentBlock(Smarty_Internal_TemplateCompilerBase $compiler, $_name = null) - { - if (!isset($compiler->_cache['blockNesting'])) { - $compiler->trigger_template_error(' tag {$smarty.block.parent} used outside {block} tags ', - $compiler->parser->lex->taglineno); - } - $compiler->suppressNocacheProcessing = true; - $compiler->has_code = true; - $output = "ext->_inheritance->processBlock(\$_smarty_tpl, 4, {$compiler->_cache['blockName'][$compiler->_cache['blockNesting']]}, null, \$_blockParentStack);\n?>\n"; - return $output; - } -} - -/** - * Smarty Internal Plugin Compile BlockClose Class - * - */ -class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_Inheritance -{ - /** - * Compiles code for the {/block} tag - * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter - * - * @return bool true - */ - public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) - { - list($_attr, $_nocache, $_buffer, $_has_nocache_code, $_caching) = $this->closeTag($compiler, array('block')); - // init block parameter - $_block = $compiler->_cache['blockParams'][$compiler->_cache['blockNesting']]; - unset($compiler->_cache['blockParams'][$compiler->_cache['blockNesting']]); - $_block[2] = $_block[3] = 0; - $_name = trim($_attr['name'], "'\""); - $_assign = isset($_attr['assign']) ? $_attr['assign'] : null; - unset($_attr['assign'], $_attr['name']); - foreach ($_attr as $name => $stat) { - if ((is_bool($stat) && $stat !== false) || (!is_bool($stat) && $stat != 'false')) { - $_block[$name] = is_string($stat) ? trim($stat, "'\"") : $stat; - } - } - $_funcName = $_block[0]; - // get compiled block code - $_functionCode = $compiler->parser->current_buffer; - // setup buffer for template function code - $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template(); - - if ($compiler->template->compiled->has_nocache_code) { - // $compiler->parent_compiler->template->tpl_function[$_name]['call_name_caching'] = $_funcNameCaching; - $_block[6] = $_funcNameCaching = $_funcName . '_nocache'; - $output = "template->source->type}:{$compiler->template->source->name} */\n"; - $output .= "function {$_funcNameCaching} (\$_smarty_tpl, \$_blockParentStack) {\n"; - $output .= "/*/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/\n"; - $output .= "\$_smarty_tpl->cached->hashes['{$compiler->template->compiled->nocache_hash}'] = true;\n"; - if (isset($_assign)) { - $output .= "ob_start();\n"; - } - $output .= "?>\n"; - $compiler->parser->current_buffer->append_subtree($compiler->parser, - new Smarty_Internal_ParseTree_Tag($compiler->parser, - $output)); - $compiler->parser->current_buffer->append_subtree($compiler->parser, $_functionCode); - $output = "tpl_vars[{$_assign}] = new Smarty_Variable(ob_get_clean());\n"; - } - $output .= "/*%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%*/\n"; - $output .= "}\n"; - $output .= "/* {/block '{$_name}'} */\n\n"; - $output .= "?>\n"; - $compiler->parser->current_buffer->append_subtree($compiler->parser, - new Smarty_Internal_ParseTree_Tag($compiler->parser, - $output)); - $compiler->blockOrFunctionCode .= $f = $compiler->parser->current_buffer->to_smarty_php($compiler->parser); - $compiler->parser->current_buffer = new Smarty_Internal_ParseTree_Template(); - $this->compiler = $compiler; - $_functionCode = new Smarty_Internal_ParseTree_Tag($compiler->parser, - preg_replace_callback("/((<\?php )?echo '\/\*%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%\*\/([\S\s]*?)\/\*\/%%SmartyNocache:{$compiler->template->compiled->nocache_hash}%%\*\/';(\?>\n)?)/", - array($this, 'removeNocache'), - $_functionCode->to_smarty_php($compiler->parser))); - $this->compiler = null; - } - $output = "template->source->type}:{$compiler->template->source->name} */\n"; - $output .= "function {$_funcName}(\$_smarty_tpl, \$_blockParentStack) {\n"; - if (isset($_assign)) { - $output .= "ob_start();\n"; - } - $output .= "?>\n"; - $compiler->parser->current_buffer->append_subtree($compiler->parser, - new Smarty_Internal_ParseTree_Tag($compiler->parser, - $output)); - $compiler->parser->current_buffer->append_subtree($compiler->parser, $_functionCode); - $output = "tpl_vars[{$_assign}] = new Smarty_Variable(ob_get_clean());\n"; - } - $output .= "}\n"; - $output .= "/* {/block '{$_name}'} */\n\n"; - $output .= "?>\n"; - $compiler->parser->current_buffer->append_subtree($compiler->parser, - new Smarty_Internal_ParseTree_Tag($compiler->parser, - $output)); - $compiler->blockOrFunctionCode .= $compiler->parser->current_buffer->to_smarty_php($compiler->parser); - // nocache plugins must be copied - if (!empty($compiler->template->compiled->required_plugins['nocache'])) { - foreach ($compiler->template->compiled->required_plugins['nocache'] as $plugin => $tmp) { - foreach ($tmp as $type => $data) { - $compiler->parent_compiler->template->compiled->required_plugins['compiled'][$plugin][$type] = - $data; - } - } - } - - - // restore old status - $compiler->template->compiled->has_nocache_code = $_has_nocache_code; - $compiler->tag_nocache = $compiler->nocache; - $compiler->nocache = $_nocache; - $compiler->parser->current_buffer = $_buffer; - $output = "_cache['blockNesting'] == 1) { - $output .= "\$_smarty_tpl->ext->_inheritance->processBlock(\$_smarty_tpl, 0, {$compiler->_cache['blockName'][$compiler->_cache['blockNesting']]}, " . - var_export($_block, true) . ");\n"; - } else { - $output .= "\$_smarty_tpl->ext->_inheritance->processBlock(\$_smarty_tpl, 0, {$compiler->_cache['blockName'][$compiler->_cache['blockNesting']]}, " . - var_export($_block, true) . ", \$_blockParentStack);\n"; - - } - $output .= "?>\n"; - $compiler->_cache['blockNesting'] --; - if ($compiler->_cache['blockNesting'] == 0) { - unset($compiler->_cache['blockNesting']); - } - $compiler->has_code = true; - $compiler->suppressNocacheProcessing = true; - return $output; - } - - /** - * @param $match - * - * @return mixed - */ - function removeNocache($match) - { - $code = - preg_replace("/((<\?php )?echo '\/\*%%SmartyNocache:{$this->compiler->template->compiled->nocache_hash}%%\*\/)|(\/\*\/%%SmartyNocache:{$this->compiler->template->compiled->nocache_hash}%%\*\/';(\?>\n)?)/", - '', $match[0]); - $code = str_replace(array('\\\'', '\\\\\''), array('\'', '\\\''), $code); - return $code; - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_break.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_break.php deleted file mode 100644 index cbc73d36a..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_compile_break.php +++ /dev/null @@ -1,77 +0,0 @@ - true, 'foreach' => true, 'while' => true, 'section' => true); - // check and get attributes - $_attr = $this->getAttributes($compiler, $args); - - if ($_attr['nocache'] === true) { - $compiler->trigger_template_error('nocache option not allowed', null, true); - } - - if (isset($_attr['levels'])) { - if (!is_numeric($_attr['levels'])) { - $compiler->trigger_template_error('level attribute must be a numeric constant', null, true); - } - $_levels = $_attr['levels']; - } else { - $_levels = 1; - } - $level_count = $_levels; - $stack_count = count($compiler->_tag_stack) - 1; - while ($level_count > 0 && $stack_count >= 0) { - if (isset($_is_loopy[$compiler->_tag_stack[$stack_count][0]])) { - $level_count --; - } - $stack_count --; - } - if ($level_count != 0) { - $compiler->trigger_template_error("cannot break {$_levels} level(s)", null, true); - } - - return ""; - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_continue.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_continue.php deleted file mode 100644 index 2ee04c94e..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_compile_continue.php +++ /dev/null @@ -1,77 +0,0 @@ - true, 'foreach' => true, 'while' => true, 'section' => true); - // check and get attributes - $_attr = $this->getAttributes($compiler, $args); - - if ($_attr['nocache'] === true) { - $compiler->trigger_template_error('nocache option not allowed', null, true); - } - - if (isset($_attr['levels'])) { - if (!is_numeric($_attr['levels'])) { - $compiler->trigger_template_error('level attribute must be a numeric constant', null, true); - } - $_levels = $_attr['levels']; - } else { - $_levels = 1; - } - $level_count = $_levels; - $stack_count = count($compiler->_tag_stack) - 1; - while ($level_count > 0 && $stack_count >= 0) { - if (isset($_is_loopy[$compiler->_tag_stack[$stack_count][0]])) { - $level_count --; - } - $stack_count --; - } - if ($level_count != 0) { - $compiler->trigger_template_error("cannot continue {$_levels} level(s)", null, true); - } - - return ""; - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_if.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_if.php deleted file mode 100644 index 541e21816..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_compile_if.php +++ /dev/null @@ -1,252 +0,0 @@ -getAttributes($compiler, $args); - $this->openTag($compiler, 'if', array(1, $compiler->nocache)); - // must whole block be nocache ? - $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; - - if (!array_key_exists("if condition", $parameter)) { - $compiler->trigger_template_error("missing if condition", null, true); - } - - if (is_array($parameter['if condition'])) { - if ($compiler->nocache) { - $_nocache = ',true'; - // create nocache var to make it know for further compiling - if (is_array($parameter['if condition']['var'])) { - $var = trim($parameter['if condition']['var']['var'], "'"); - } else { - $var = trim($parameter['if condition']['var'], "'"); - } - if (isset($compiler->template->tpl_vars[$var])) { - $compiler->template->tpl_vars[$var]->nocache = true; - } else { - $compiler->template->tpl_vars[$var] = new Smarty_Variable(null, true); - } - } else { - $_nocache = ''; - } - if (is_array($parameter['if condition']['var'])) { - $_output = "tpl_vars[" . $parameter['if condition']['var']['var'] . - "]) || !is_array(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . - "]->value)) \$_smarty_tpl->smarty->ext->_var->createLocalArrayVariable(\$_smarty_tpl, " . $parameter['if condition']['var']['var'] . - "$_nocache);\n"; - $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . - $parameter['if condition']['var']['smarty_internal_index'] . " = " . - $parameter['if condition']['value'] . ") {?>"; - } else { - $_output = "tpl_vars[" . $parameter['if condition']['var'] . - "])) \$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . - "] = new Smarty_Variable(null{$_nocache});"; - $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . - $parameter['if condition']['value'] . ") {?>"; - } - - return $_output; - } else { - return ""; - } - } -} - -/** - * Smarty Internal Plugin Compile Else Class - * - * @package Smarty - * @subpackage Compiler - */ -class Smarty_Internal_Compile_Else extends Smarty_Internal_CompileBase -{ - /** - * Compiles code for the {else} tag - * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter - * - * @return string compiled code - */ - public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) - { - list($nesting, $compiler->tag_nocache) = $this->closeTag($compiler, array('if', 'elseif')); - $this->openTag($compiler, 'else', array($nesting, $compiler->tag_nocache)); - - return ""; - } -} - -/** - * Smarty Internal Plugin Compile ElseIf Class - * - * @package Smarty - * @subpackage Compiler - */ -class Smarty_Internal_Compile_Elseif extends Smarty_Internal_CompileBase -{ - /** - * Compiles code for the {elseif} tag - * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter - * - * @return string compiled code - * @throws \SmartyCompilerException - */ - public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) - { - // check and get attributes - $_attr = $this->getAttributes($compiler, $args); - - list($nesting, $compiler->tag_nocache) = $this->closeTag($compiler, array('if', 'elseif')); - - if (!array_key_exists("if condition", $parameter)) { - $compiler->trigger_template_error("missing elseif condition", null, true); - } - - if (is_array($parameter['if condition'])) { - $condition_by_assign = true; - if ($compiler->nocache) { - $_nocache = ',true'; - // create nocache var to make it know for further compiling - if (is_array($parameter['if condition']['var'])) { - $var = trim($parameter['if condition']['var']['var'], "'"); - } else { - $var = trim($parameter['if condition']['var'], "'"); - } - if (isset($compiler->template->tpl_vars[$var])) { - $compiler->template->tpl_vars[$var]->nocache = true; - } else { - $compiler->template->tpl_vars[$var] = new Smarty_Variable(null, true); - } - } else { - $_nocache = ''; - } - } else { - $condition_by_assign = false; - } - - if (empty($compiler->prefix_code)) { - if ($condition_by_assign) { - $this->openTag($compiler, 'elseif', array($nesting + 1, $compiler->tag_nocache)); - if (is_array($parameter['if condition']['var'])) { - $_output = "tpl_vars[" . - $parameter['if condition']['var']['var'] . "]) || !is_array(\$_smarty_tpl->tpl_vars[" . - $parameter['if condition']['var']['var'] . - "]->value)) \$_smarty_tpl->smarty->ext->_var->createLocalArrayVariable(\$_smarty_tpl, " . - $parameter['if condition']['var']['var'] . "$_nocache);\n"; - $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . - $parameter['if condition']['var']['smarty_internal_index'] . " = " . - $parameter['if condition']['value'] . ") {?>"; - } else { - $_output = "tpl_vars[" . - $parameter['if condition']['var'] . "])) \$_smarty_tpl->tpl_vars[" . - $parameter['if condition']['var'] . "] = new Smarty_Variable(null{$_nocache});"; - $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . - $parameter['if condition']['value'] . ") {?>"; - } - - return $_output; - } else { - $this->openTag($compiler, 'elseif', array($nesting, $compiler->tag_nocache)); - - return ""; - } - } else { - $tmp = ''; - foreach ($compiler->prefix_code as $code) { - $tmp = $compiler->appendCode($tmp, $code); - } - $compiler->prefix_code = array(); - $tmp = $compiler->appendCode("", $tmp); - $this->openTag($compiler, 'elseif', array($nesting + 1, $compiler->tag_nocache)); - if ($condition_by_assign) { - if (is_array($parameter['if condition']['var'])) { - $_output = $compiler->appendCode($tmp, "tpl_vars[" . - $parameter['if condition']['var']['var'] . - "]) || !is_array(\$_smarty_tpl->tpl_vars[" . - $parameter['if condition']['var']['var'] . - "]->value)) \$_smarty_tpl->smarty->ext->_var->createLocalArrayVariable(\$_smarty_tpl, " . - $parameter['if condition']['var']['var'] . "$_nocache);\n"); - $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . - $parameter['if condition']['var']['smarty_internal_index'] . " = " . - $parameter['if condition']['value'] . ") {?>"; - } else { - $_output = $compiler->appendCode($tmp, "tpl_vars[" . - $parameter['if condition']['var'] . - "])) \$_smarty_tpl->tpl_vars[" . - $parameter['if condition']['var'] . - "] = new Smarty_Variable(null{$_nocache});"); - $_output .= "if (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . - $parameter['if condition']['value'] . ") {?>"; - } - - return $_output; - } else { - return $compiler->appendCode($tmp, ""); - } - } - } -} - -/** - * Smarty Internal Plugin Compile Ifclose Class - * - * @package Smarty - * @subpackage Compiler - */ -class Smarty_Internal_Compile_Ifclose extends Smarty_Internal_CompileBase -{ - /** - * Compiles code for the {/if} tag - * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter - * - * @return string compiled code - */ - public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) - { - // must endblock be nocache? - if ($compiler->nocache) { - $compiler->tag_nocache = true; - } - list($nesting, $compiler->nocache) = $this->closeTag($compiler, array('if', 'else', 'elseif')); - $tmp = ''; - for ($i = 0; $i < $nesting; $i ++) { - $tmp .= '}'; - } - - return ""; - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_private_block_plugin.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_private_block_plugin.php deleted file mode 100644 index 9e2eea233..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_compile_private_block_plugin.php +++ /dev/null @@ -1,89 +0,0 @@ -getAttributes($compiler, $args); - if ($_attr['nocache'] === true) { - $compiler->tag_nocache = true; - } - unset($_attr['nocache']); - // convert attributes into parameter array string - $_paramsArray = array(); - foreach ($_attr as $_key => $_value) { - if (is_int($_key)) { - $_paramsArray[] = "$_key=>$_value"; - } else { - $_paramsArray[] = "'$_key'=>$_value"; - } - } - $_params = 'array(' . implode(",", $_paramsArray) . ')'; - - $this->openTag($compiler, $tag, array($_params, $compiler->nocache)); - // maybe nocache because of nocache variables or nocache plugin - $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; - // compile code - $output = "smarty->_cache['tag_stack'][] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; - } else { - // must endblock be nocache? - if ($compiler->nocache) { - $compiler->tag_nocache = true; - } - // closing tag of block plugin, restore nocache - list($_params, $compiler->nocache) = $this->closeTag($compiler, substr($tag, 0, - 5)); - // This tag does create output - $compiler->has_output = true; - // compile code - if (!isset($parameter['modifier_list'])) { - $mod_pre = $mod_post = ''; - } else { - $mod_pre = ' ob_start(); '; - $mod_post = 'echo ' . - $compiler->compileTag('private_modifier', array(), array('modifierlist' => $parameter['modifier_list'], - 'value' => 'ob_get_clean()')) . ';'; - } - $output = "smarty->_cache['tag_stack']);?>"; - } - - return $output . "\n"; - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_private_object_block_function.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_private_object_block_function.php deleted file mode 100644 index d2bc5d60c..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_compile_private_object_block_function.php +++ /dev/null @@ -1,91 +0,0 @@ -getAttributes($compiler, $args); - if ($_attr['nocache'] === true) { - $compiler->tag_nocache = true; - } - unset($_attr['nocache']); - // convert attributes into parameter array string - $_paramsArray = array(); - foreach ($_attr as $_key => $_value) { - if (is_int($_key)) { - $_paramsArray[] = "$_key=>$_value"; - } else { - $_paramsArray[] = "'$_key'=>$_value"; - } - } - $_params = 'array(' . implode(",", $_paramsArray) . ')'; - - $this->openTag($compiler, $tag . '->' . $method, array($_params, $compiler->nocache)); - // maybe nocache because of nocache variables or nocache plugin - $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; - // compile code - $output = - "smarty->_cache['tag_stack'][] = array('{$tag}->{$method}', {$_params}); \$_block_repeat=true; echo \$_smarty_tpl->smarty->registered_objects['{$tag}'][0]->{$method}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; - } else { - $base_tag = substr($tag, 0, - 5); - // must endblock be nocache? - if ($compiler->nocache) { - $compiler->tag_nocache = true; - } - // closing tag of block plugin, restore nocache - list($_params, $compiler->nocache) = $this->closeTag($compiler, $base_tag . '->' . $method); - // This tag does create output - $compiler->has_output = true; - // compile code - if (!isset($parameter['modifier_list'])) { - $mod_pre = $mod_post = ''; - } else { - $mod_pre = ' ob_start(); '; - $mod_post = 'echo ' . $compiler->compileTag('private_modifier', array(), - array('modifierlist' => $parameter['modifier_list'], - 'value' => 'ob_get_clean()')) . ';'; - } - $output = "smarty->registered_objects['{$base_tag}'][0]->{$method}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); " . - $mod_post . " } array_pop(\$_smarty_tpl->smarty->_cache['tag_stack']);?>"; - } - - return $output . "\n"; - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_private_registered_block.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_private_registered_block.php deleted file mode 100644 index 78d95f720..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_compile_private_registered_block.php +++ /dev/null @@ -1,119 +0,0 @@ -getAttributes($compiler, $args); - if ($_attr['nocache']) { - $compiler->tag_nocache = true; - } - unset($_attr['nocache']); - if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$tag])) { - $tag_info = $compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$tag]; - } else { - $tag_info = $compiler->default_handler_plugins[Smarty::PLUGIN_BLOCK][$tag]; - } - // convert attributes into parameter array string - $_paramsArray = array(); - foreach ($_attr as $_key => $_value) { - if (is_int($_key)) { - $_paramsArray[] = "$_key=>$_value"; - } elseif ($compiler->template->caching && in_array($_key, $tag_info[2])) { - $_value = str_replace("'", "^#^", $_value); - $_paramsArray[] = "'$_key'=>^#^.var_export($_value,true).^#^"; - } else { - $_paramsArray[] = "'$_key'=>$_value"; - } - } - $_params = 'array(' . implode(",", $_paramsArray) . ')'; - - $this->openTag($compiler, $tag, array($_params, $compiler->nocache)); - // maybe nocache because of nocache variables or nocache plugin - $compiler->nocache = !$tag_info[1] | $compiler->nocache | $compiler->tag_nocache; - $function = $tag_info[0]; - // compile code - if (!is_array($function)) { - $output = "smarty->_cache['tag_stack'][] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; - } elseif (is_object($function[0])) { - $output = "smarty->_cache['tag_stack'][] = array('{$tag}', {$_params}); \$_block_repeat=true; echo \$_smarty_tpl->smarty->registered_plugins['block']['{$tag}'][0][0]->{$function[1]}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; - } else { - $output = "smarty->_cache['tag_stack'][] = array('{$tag}', {$_params}); \$_block_repeat=true; echo {$function[0]}::{$function[1]}({$_params}, null, \$_smarty_tpl, \$_block_repeat);while (\$_block_repeat) { ob_start();?>"; - } - } else { - // must endblock be nocache? - if ($compiler->nocache) { - $compiler->tag_nocache = true; - } - $base_tag = substr($tag, 0, - 5); - // closing tag of block plugin, restore nocache - list($_params, $compiler->nocache) = $this->closeTag($compiler, $base_tag); - // This tag does create output - $compiler->has_output = true; - if (isset($compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$base_tag])) { - $function = $compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$base_tag][0]; - } else { - $function = $compiler->default_handler_plugins[Smarty::PLUGIN_BLOCK][$base_tag][0]; - } - // compile code - if (!isset($parameter['modifier_list'])) { - $mod_pre = $mod_post = ''; - } else { - $mod_pre = ' ob_start(); '; - $mod_post = 'echo ' . - $compiler->compileTag('private_modifier', array(), array('modifierlist' => $parameter['modifier_list'], - 'value' => 'ob_get_clean()')) . ';'; - } - if (!is_array($function)) { - $output = "smarty->_cache['tag_stack']);?>"; - } elseif (is_object($function[0])) { - $output = "smarty->registered_plugins['block']['{$base_tag}'][0][0]->{$function[1]}({$_params}, \$_block_content, \$_smarty_tpl, \$_block_repeat); " . - $mod_post . "} array_pop(\$_smarty_tpl->smarty->_cache['tag_stack']);?>"; - } else { - $output = "smarty->_cache['tag_stack']);?>"; - } - } - - return $output . "\n"; - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_internal_compile_while.php b/library/Smarty/libs/sysplugins/smarty_internal_compile_while.php deleted file mode 100644 index bd31f6671..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_compile_while.php +++ /dev/null @@ -1,108 +0,0 @@ -loopNesting++; - // check and get attributes - $_attr = $this->getAttributes($compiler, $args); - $this->openTag($compiler, 'while', $compiler->nocache); - - if (!array_key_exists("if condition", $parameter)) { - $compiler->trigger_template_error("missing while condition", null, true); - } - - // maybe nocache because of nocache variables - $compiler->nocache = $compiler->nocache | $compiler->tag_nocache; - $_output = "nocache) { - $_nocache = ',true'; - // create nocache var to make it know for further compiling - if (is_array($parameter['if condition']['var'])) { - $var = trim($parameter['if condition']['var']['var'], "'"); - } else { - $var = trim($parameter['if condition']['var'], "'"); - } - if (isset($compiler->template->tpl_vars[$var])) { - $compiler->template->tpl_vars[$var]->nocache = true; - } else { - $compiler->template->tpl_vars[$var] = new Smarty_Variable(null, true); - } - } else { - $_nocache = ''; - } - if (is_array($parameter['if condition']['var'])) { - $_output .= "if (!isset(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . - "]) || !is_array(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . - "]->value)) \$_smarty_tpl->smarty->ext->_var->createLocalArrayVariable(\$_smarty_tpl, " . $parameter['if condition']['var']['var'] . - "$_nocache);\n"; - $_output .= "while (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var']['var'] . "]->value" . - $parameter['if condition']['var']['smarty_internal_index'] . " = " . - $parameter['if condition']['value'] . ") {?>"; - } else { - $_output .= "if (!isset(\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . - "])) \$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . - "] = new Smarty_Variable(null{$_nocache});"; - $_output .= "while (\$_smarty_tpl->tpl_vars[" . $parameter['if condition']['var'] . "]->value = " . - $parameter['if condition']['value'] . ") {?>"; - } - } else { - $_output .= "while ({$parameter['if condition']}) {?>"; - } - return $_output; - } -} - -/** - * Smarty Internal Plugin Compile Whileclose Class - * - * @package Smarty - * @subpackage Compiler - */ -class Smarty_Internal_Compile_Whileclose extends Smarty_Internal_CompileBase -{ - /** - * Compiles code for the {/while} tag - * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object - * - * @return string compiled code - */ - public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) - { - $compiler->loopNesting--; - // must endblock be nocache? - if ($compiler->nocache) { - $compiler->tag_nocache = true; - } - $compiler->nocache = $this->closeTag($compiler, array('while')); - return "\n"; - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_internal_extension_handler.php b/library/Smarty/libs/sysplugins/smarty_internal_extension_handler.php deleted file mode 100644 index 68012d86f..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_extension_handler.php +++ /dev/null @@ -1,157 +0,0 @@ - 0, 'DefaultModifiers' => 0, 'ConfigVars' => 0, - 'DebugTemplate' => 0, 'RegisteredObject' => 0, 'StreamVariable' => 0, - 'TemplateVars' => 0,);# - - private $resolvedProperties = array(); - - /** - * Call external Method - * - * @param \Smarty_Internal_Data $data - * @param string $name external method names - * @param array $args argument array - * - * @return mixed - * @throws SmartyException - */ - public function _callExternalMethod(Smarty_Internal_Data $data, $name, $args) - { - /* @var Smarty $data ->smarty */ - $smarty = isset($data->smarty) ? $data->smarty : $data; - if (!isset($smarty->ext->$name)) { - $class = 'Smarty_Internal_Method_' . ucfirst($name); - if (preg_match('/^(set|get)([A-Z].*)$/', $name, $match)) { - if (!isset($this->_property_info[$prop = $match[2]])) { - // convert camel case to underscored name - $this->resolvedProperties[$prop] = $pn = strtolower(join('_', - preg_split('/([A-Z][^A-Z]*)/', $prop, - 1, - PREG_SPLIT_NO_EMPTY | - PREG_SPLIT_DELIM_CAPTURE))); - $this->_property_info[$prop] = property_exists($data, $pn) ? 1 : - ($data->_objType == 2 && property_exists($smarty, $pn) ? 2 : 0); - } - if ($this->_property_info[$prop]) { - $pn = $this->resolvedProperties[$prop]; - if ($match[1] == 'get') { - return $this->_property_info[$prop] == 1 ? $data->$pn : $data->smarty->$pn; - } else { - return $this->_property_info[$prop] == 1 ? $data->$pn = $args[0] : - $data->smarty->$pn = $args[0]; - } - } elseif (!class_exists($class)) { - throw new SmartyException("property '$pn' does not exist."); - } - } - if (class_exists($class)) { - $callback = array($smarty->ext->$name = new $class(), $name); - } - } else { - $callback = array($smarty->ext->$name, $name); - } - array_unshift($args, $data); - if (isset($callback) && $callback[0]->objMap | $data->_objType) { - return call_user_func_array($callback, $args); - } - return call_user_func_array(array(new Smarty_Internal_Undefined(), $name), $args); - } - - /** - * set extension property - * - * @param string $property_name property name - * @param mixed $value value - * - * @throws SmartyException - */ - public function __set($property_name, $value) - { - $this->$property_name = $value; - } - - /** - * get extension object - * - * @param string $property_name property name - * - * @return mixed|Smarty_Template_Cached - * @throws SmartyException - */ - public function __get($property_name) - { - // object properties of runtime template extensions will start with '_' - if ($property_name[0] == '_') { - $class = 'Smarty_Internal_Runtime_' . ucfirst(substr($property_name, 1)); - } else { - $class = 'Smarty_Internal_Method_' . ucfirst($property_name); - } - if (class_exists($class)) { - return $this->$property_name = new $class(); - } - return $this; - } - - /** - * Call error handler for undefined method - * - * @param string $name unknown method-name - * @param array $args argument array - * - * @return mixed - * @throws SmartyException - */ - public function __call($name, $args) - { - return call_user_func_array(array(new Smarty_Internal_Undefined(), $name), $args); - } - -} \ No newline at end of file diff --git a/library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php b/library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php deleted file mode 100644 index 689636adb..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_runtime_foreach.php +++ /dev/null @@ -1,47 +0,0 @@ -getIterator()); - } elseif ($value instanceof Iterator) { - if ($value instanceof Generator) { - return 1; - } - return iterator_count($value); - } elseif ($value instanceof PDOStatement) { - return $value->rowCount(); - } elseif ($value instanceof Traversable) { - return iterator_count($value); - } elseif ($value instanceof ArrayAccess) { - if ($value->offsetExists(0)) { - return 1; - } - } elseif (is_object($value)) { - return count($value); - } - return 0; - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_internal_runtime_hhvm.php b/library/Smarty/libs/sysplugins/smarty_internal_runtime_hhvm.php deleted file mode 100644 index 117cd8166..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_runtime_hhvm.php +++ /dev/null @@ -1,30 +0,0 @@ -blockNesting || $this->state == 3)) { - $tpl->ext->_inheritance = new Smarty_Internal_Runtime_Inheritance(); - $tpl->ext->_inheritance->init($tpl, $initChild, $blockNames); - return; - } - // start of child sub template(s) - if ($initChild) { - $this->state = 1; - if (!$this->inheritanceLevel) { - //grab any output of child templates - ob_start(); - } - $this->inheritanceLevel ++; - } - // in parent state {include} will not increment template index - if ($this->state != 3) { - $this->tplIndex ++; - } - // if state was waiting for parent change state to parent - if ($this->state == 2) { - $this->state = 3; - } - } - - /** - * End of child template(s) - * - if outer level is reached flush output buffer and switch to wait for parent template state - * - * @param \Smarty_Internal_Template $tpl template object of caller - */ - public function endChild(Smarty_Internal_Template $tpl) - { - $this->inheritanceLevel --; - if (!$this->inheritanceLevel) { - ob_end_clean(); - $this->state = 2; - } - } - - /** - * Process inheritance {block} tag - * - * $type 0 = {block}: - * - search in inheritance template hierarchy for child blocks - * if found call it, otherwise call current block - * - ignored for outer level blocks in child templates - * - * $type 1 = {block}: - * - nested {block} - * - search in inheritance template hierarchy for child blocks - * if found call it, otherwise call current block - * - * $type 2 = {$smarty.block.child}: - * - search in inheritance template hierarchy for child blocks - * if found call it, otherwise ignore - * - * $type 3 = {block append} {block prepend}: - * - call parent block - * - * $type 4 = {$smarty.block.parent}: - * - call parent block - * - * @param \Smarty_Internal_Template $tpl template object of caller - * @param int $type call type see above - * @param string $name block name - * @param array $block block parameter - * @param array $callStack call stack with block parameters - * - * @throws \SmartyException - */ - public function processBlock(Smarty_Internal_Template $tpl, $type = 0, $name, $block, $callStack = array()) - { - if (!isset($this->blockParameter[ $name ])) { - $this->blockParameter[ $name ] = array(); - } - if ($this->state == 1) { - $block[ 2 ] = count($this->blockParameter[ $name ]); - $block[ 3 ] = $this->tplIndex; - $this->blockParameter[ $name ][] = $block; - return; - } - if ($type == 3) { - if (!empty($callStack)) { - $block = array_shift($callStack); - } else { - return; - } - } elseif ($type == 4) { - if (!empty($callStack)) { - array_shift($callStack); - if (empty($callStack)) { - throw new SmartyException("inheritance: tag {\$smarty.block.parent} used in parent template block '{$name}'"); - } - $block = array_shift($callStack); - } else { - return; - } - } else { - $index = 0; - $blockParameter = &$this->blockParameter[ $name ]; - if ($type == 0) { - $index = $block[ 2 ] = count($blockParameter); - $block[ 3 ] = $this->tplIndex; - $callStack = array(&$block); - } elseif ($type == 1) { - $block[ 3 ] = $callStack[ 0 ][ 3 ]; - for ($i = 0; $i < count($blockParameter); $i ++) { - if ($blockParameter[ $i ][ 3 ] <= $block[ 3 ]) { - $index = $blockParameter[ $i ][ 2 ]; - } - } - $block[ 2 ] = $index; - $callStack = array(&$block); - } elseif ($type == 2) { - $index = $callStack[ 0 ][ 2 ]; - if ($index == 0) { - return; - } - $callStack = $block = array(1 => false); - } - $index --; - // find lowest level child block - while ($index >= 0 && ($type || !$block[ 1 ])) { - $block = &$blockParameter[ $index ]; - array_unshift($callStack, $block); - if ($block[ 1 ]) { - break; - } - $index --; - } - if (isset($block[ 'hide' ]) && $index <= 0) { - return; - } - } - $this->blockNesting ++; - // {block append} ? - if (isset($block[ 'append' ])) { - $appendStack = $callStack; - if ($type == 0) { - array_shift($appendStack); - } - $this->processBlock($tpl, 3, $name, null, $appendStack); - } - // call block of current stack level - if (isset($block[6])) { - $block[6]($tpl, $callStack); - } else { - $block[0]($tpl, $callStack); - } - // {block prepend} ? - if (isset($block[ 'prepend' ])) { - $prependStack = $callStack; - if ($type == 0) { - array_shift($prependStack); - } - $this->processBlock($tpl, 3, $name, null, $prependStack); - } - $this->blockNesting --; - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_internal_runtime_subtemplate.php b/library/Smarty/libs/sysplugins/smarty_internal_runtime_subtemplate.php deleted file mode 100644 index 2c7623f93..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_runtime_subtemplate.php +++ /dev/null @@ -1,203 +0,0 @@ -tplObjects) ? $parent->smarty->_getTemplateId($template, $cache_id, $compile_id, $caching) : - null; - // already in template cache? - /* @var Smarty_Internal_Template $tpl */ - if (isset($_templateId) && isset($this->tplObjects[$_templateId])) { - // clone cached template object because of possible recursive call - $tpl = clone $this->tplObjects[$_templateId]; - $tpl->parent = $parent; - // if $caching mode changed the compiled resource is invalid - if ((bool) $tpl->caching !== (bool) $caching) { - unset($tpl->compiled); - } - // get variables from calling scope - $tpl->tpl_vars = $parent->tpl_vars; - $tpl->config_vars = $parent->config_vars; - // get template functions - $tpl->tpl_function = $parent->tpl_function; - // copy inheritance object? - if (isset($parent->ext->_inheritance)) { - $tpl->ext->_inheritance = $parent->ext->_inheritance; - } else { - unset($tpl->ext->_inheritance); - } - } else { - $tpl = clone $parent; - $tpl->parent = $parent; - if (!isset($tpl->templateId) || $tpl->templateId !== $_templateId) { - $tpl->templateId = $_templateId; - $tpl->template_resource = $template; - $tpl->cache_id = $cache_id; - $tpl->compile_id = $compile_id; - if (isset($uid)) { - // for inline templates we can get all resource information from file dependency - if (isset($tpl->compiled->file_dependency[$uid])) { - list($filepath, $timestamp, $resource) = $tpl->compiled->file_dependency[$uid]; - $tpl->source = - new Smarty_Template_Source(isset($tpl->smarty->_cache['resource_handlers'][$resource]) ? - $tpl->smarty->_cache['resource_handlers'][$resource] : - Smarty_Resource::load($tpl->smarty, $resource), $tpl->smarty, - $filepath, $resource, $filepath); - $tpl->source->filepath = $filepath; - $tpl->source->timestamp = $timestamp; - $tpl->source->exists = true; - $tpl->source->uid = $uid; - } else { - $tpl->source = null; - } - } else { - $tpl->source = null; - } - if (!isset($tpl->source)) { - $tpl->source = Smarty_Template_Source::load($tpl); - unset($tpl->compiled); - } - unset($tpl->cached); - } - } - $tpl->caching = $caching; - $tpl->cache_lifetime = $cache_lifetime; - if ($caching == 9999) { - $tpl->cached = $parent->cached; - } - // set template scope - $tpl->scope = $scope; - $scopePtr = false; - if ($scope & ~Smarty::SCOPE_BUBBLE_UP) { - if ($scope == Smarty::SCOPE_GLOBAL) { - $tpl->tpl_vars = Smarty::$global_tpl_vars; - $tpl->config_vars = $tpl->smarty->config_vars; - $scopePtr = true; - } else { - if ($scope == Smarty::SCOPE_PARENT) { - $scopePtr = $parent; - } elseif ($scope == Smarty::SCOPE_SMARTY) { - $scopePtr = $tpl->smarty; - } else { - $scopePtr = $tpl; - while (isset($scopePtr->parent)) { - if ($scopePtr->parent->_objType != 2 && $scope & Smarty::SCOPE_TPL_ROOT) { - break; - } - $scopePtr = $scopePtr->parent; - } - } - $tpl->tpl_vars = $scopePtr->tpl_vars; - $tpl->config_vars = $scopePtr->config_vars; - } - } - - if (!isset($this->tplObjects[$tpl->_getTemplateId()]) && !$tpl->source->handler->recompiled) { - // if template is called multiple times set flag to to cache template objects - $forceTplCache = $forceTplCache || - (isset($this->subTplInfo[$tpl->template_resource]) && $this->subTplInfo[$tpl->template_resource] > 1); - // check if template object should be cached - if ($tpl->parent->_objType == 2 && isset($this->tplObjects[$tpl->parent->templateId]) || - ($forceTplCache && $tpl->smarty->resource_cache_mode & Smarty::RESOURCE_CACHE_AUTOMATIC) || - ($tpl->smarty->resource_cache_mode & Smarty::RESOURCE_CACHE_ON) - ) { - $this->tplObjects[$tpl->_getTemplateId()] = $tpl; - } - } - - if (!empty($data)) { - // set up variable values - foreach ($data as $_key => $_val) { - $tpl->tpl_vars[$_key] = new Smarty_Variable($_val); - } - } - if (isset($uid)) { - if ($parent->smarty->debugging) { - $parent->smarty->_debug->start_template($tpl); - $parent->smarty->_debug->start_render($tpl); - } - $tpl->compiled->getRenderedTemplateCode($tpl, $content_func); - if ($parent->smarty->debugging) { - $parent->smarty->_debug->end_template($tpl); - $parent->smarty->_debug->end_render($tpl); - } - if ($tpl->caching == 9999 && $tpl->compiled->has_nocache_code) { - $parent->cached->hashes[$tpl->compiled->nocache_hash] = true; - } - } else { - if (isset($tpl->compiled)) { - $tpl->compiled->render($tpl); - } else { - $tpl->render(); - } - } - if ($scopePtr) { - if ($scope == Smarty::SCOPE_GLOBAL) { - Smarty::$global_tpl_vars = $tpl->tpl_vars; - $tpl->smarty->config_vars = $tpl->config_vars; - } else { - $scopePtr->tpl_vars = $tpl->tpl_vars; - $scopePtr->config_vars = $tpl->config_vars; - } - } - } - - /** - * Get called subtemplates from compiled template and save call count - * - * @param \Smarty_Internal_Template $tpl - */ - public function registerSubTemplates(Smarty_Internal_Template $tpl) - { - foreach ($tpl->compiled->includes as $name => $count) { - if (isset($this->subTplInfo[$name])) { - $this->subTplInfo[$name] += $count; - } else { - $this->subTplInfo[$name] = $count; - } - } - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_internal_runtime_tplfunction.php b/library/Smarty/libs/sysplugins/smarty_internal_runtime_tplfunction.php deleted file mode 100644 index 634ed5dc6..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_runtime_tplfunction.php +++ /dev/null @@ -1,97 +0,0 @@ -tpl_function[$name])) { - if (!$tpl->caching || ($tpl->caching && $nocache)) { - $function = $tpl->tpl_function[$name]['call_name']; - } else { - if (isset($tpl->tpl_function[$name]['call_name_caching'])) { - $function = $tpl->tpl_function[$name]['call_name_caching']; - } else { - $function = $tpl->tpl_function[$name]['call_name']; - } - } - if (function_exists($function)) { - $function ($tpl, $params); - return; - } - // try to load template function dynamically - if ($this->addTplFuncToCache($tpl, $name, $function)) { - $function ($tpl, $params); - return; - } - } - throw new SmartyException("Unable to find template function '{$name}'"); - } - - /** - * - * Add template function to cache file for nocache calls - * - * @param Smarty_Internal_Template $tpl - * @param string $_name template function name - * @param string $_function PHP function name - * - * @return bool - */ - public function addTplFuncToCache(Smarty_Internal_Template $tpl, $_name, $_function) - { - $funcParam = $tpl->tpl_function[$_name]; - if (is_file($funcParam['compiled_filepath'])) { - // read compiled file - $code = file_get_contents($funcParam['compiled_filepath']); - // grab template function - if (preg_match("/\/\* {$_function} \*\/([\S\s]*?)\/\*\/ {$_function} \*\//", $code, $match)) { - // grab source info from file dependency - preg_match("/\s*'{$funcParam['uid']}'([\S\s]*?)\),/", $code, $match1); - unset($code); - // make PHP function known - eval($match[0]); - if (function_exists($_function)) { - // search cache file template - $tplPtr = $tpl; - while (!isset($tplPtr->cached) && isset($tplPtr->parent)) { - $tplPtr = $tplPtr->parent; - } - // add template function code to cache file - if (isset($tplPtr->cached)) { - $cache = $tplPtr->cached; - $content = $cache->read($tplPtr); - if ($content) { - // check if we must update file dependency - if (!preg_match("/'{$funcParam['uid']}'(.*?)'nocache_hash'/", $content, $match2)) { - $content = preg_replace("/('file_dependency'(.*?)\()/", "\\1{$match1[0]}", $content); - } - $tplPtr->smarty->ext->_updateCache->write($cache, $tplPtr, preg_replace('/\s*\?>\s*$/', "\n", $content) . "\n" . - preg_replace(array('/^\s*<\?php\s+/', '/\s*\?>\s*$/'), "\n", - $match[0])); - } - } - return true; - } - } - } - return false; - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_internal_runtime_updatescope.php b/library/Smarty/libs/sysplugins/smarty_internal_runtime_updatescope.php deleted file mode 100644 index 5a125a4a7..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_runtime_updatescope.php +++ /dev/null @@ -1,55 +0,0 @@ -scope) { - return; - } - foreach (array($scope, $tpl->scope) as $s) { - $s = ($bubble_up = $s >= Smarty::SCOPE_BUBBLE_UP) ? $s - Smarty::SCOPE_BUBBLE_UP : $s; - if ($bubble_up && $s) { - $ptr = $tpl->parent; - if (isset($ptr)) { - $ptr->tpl_vars[$varName] = $tpl->tpl_vars[$varName]; - $ptr = $ptr->parent; - } - if ($s == Smarty::SCOPE_PARENT) { - continue; - } - while (isset($ptr) && $ptr->_objType == 2) { - $ptr->tpl_vars[$varName] = $tpl->tpl_vars[$varName]; - $ptr = $ptr->parent; - } - if ($s == Smarty::SCOPE_TPL_ROOT) { - continue; - } elseif ($s == Smarty::SCOPE_SMARTY) { - $tpl->smarty->tpl_vars[$varName] = $tpl->tpl_vars[$varName]; - } elseif ($s == Smarty::SCOPE_GLOBAL) { - Smarty::$global_tpl_vars[$varName] = $tpl->tpl_vars[$varName]; - } elseif ($s == Smarty::SCOPE_ROOT) { - while (isset($ptr->parent)) { - $ptr = $ptr->parent; - } - $ptr->tpl_vars[$varName] = $tpl->tpl_vars[$varName]; - } - } - } - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_internal_runtime_validatecompiled.php b/library/Smarty/libs/sysplugins/smarty_internal_runtime_validatecompiled.php deleted file mode 100644 index 7defd6c92..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_runtime_validatecompiled.php +++ /dev/null @@ -1,86 +0,0 @@ -smarty->compile_check) || $tpl->smarty->compile_check == 1) - ) { - // check file dependencies at compiled code - foreach ($properties['file_dependency'] as $_file_to_check) { - if ($_file_to_check[2] == 'file' || $_file_to_check[2] == 'extends' || $_file_to_check[2] == 'php') { - if ($tpl->source->filepath == $_file_to_check[0]) { - // do not recheck current template - continue; - //$mtime = $tpl->source->getTimeStamp(); - } else { - // file and php types can be checked without loading the respective resource handlers - $mtime = is_file($_file_to_check[0]) ? filemtime($_file_to_check[0]) : false; - } - } elseif ($_file_to_check[2] == 'string') { - continue; - } else { - $handler = Smarty_Resource::load($tpl->smarty, $_file_to_check[2]); - if ($handler->checkTimestamps()) { - $source = Smarty_Template_Source::load($tpl, $tpl->smarty, $_file_to_check[ 0 ]); - $mtime = $source->getTimeStamp(); - } else { - continue; - } - } - if (!$mtime || $mtime > $_file_to_check[1]) { - $is_valid = false; - break; - } - } - } - if ($cache) { - // CACHING_LIFETIME_SAVED cache expiry has to be validated here since otherwise we'd define the unifunc - if ($tpl->caching === Smarty::CACHING_LIFETIME_SAVED && $properties['cache_lifetime'] >= 0 && - (time() > ($tpl->cached->timestamp + $properties['cache_lifetime'])) - ) { - $is_valid = false; - } - $tpl->cached->cache_lifetime = $properties['cache_lifetime']; - $tpl->cached->valid = $is_valid; - $resource = $tpl->cached; - } else { - $tpl->mustCompile = !$is_valid; - $resource = $tpl->compiled; - $resource->includes = isset($properties['includes']) ? $properties['includes'] : array(); - } - if ($is_valid) { - $resource->unifunc = $properties['unifunc']; - $resource->has_nocache_code = $properties['has_nocache_code']; - // $tpl->compiled->nocache_hash = $properties['nocache_hash']; - $resource->file_dependency = $properties['file_dependency']; - if (isset($properties['tpl_function'])) { - $tpl->tpl_function = $properties['tpl_function']; - } - } - return $is_valid && !function_exists($properties['unifunc']); - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_internal_runtime_var.php b/library/Smarty/libs/sysplugins/smarty_internal_runtime_var.php deleted file mode 100644 index 8e09108fe..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_runtime_var.php +++ /dev/null @@ -1,33 +0,0 @@ -tpl_vars[$varName])) { - $tpl->tpl_vars[$varName] = new Smarty_Variable(array(), $nocache); - } else { - $tpl->tpl_vars[$varName] = clone $tpl->tpl_vars[$varName]; - if (!(is_array($tpl->tpl_vars[$varName]->value) || - $tpl->tpl_vars[$varName]->value instanceof ArrayAccess) - ) { - settype($tpl->tpl_vars[$varName]->value, 'array'); - } - } - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_internal_template.php b/library/Smarty/libs/sysplugins/smarty_internal_template.php deleted file mode 100644 index 7c16a53db..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_template.php +++ /dev/null @@ -1,376 +0,0 @@ -smarty = &$smarty; - // Smarty parameter - $this->cache_id = $_cache_id === null ? $this->smarty->cache_id : $_cache_id; - $this->compile_id = $_compile_id === null ? $this->smarty->compile_id : $_compile_id; - $this->caching = $_caching === null ? $this->smarty->caching : $_caching; - if ($this->caching === true) { - $this->caching = Smarty::CACHING_LIFETIME_CURRENT; - } - $this->cache_lifetime = $_cache_lifetime === null ? $this->smarty->cache_lifetime : $_cache_lifetime; - $this->parent = $_parent; - // Template resource - $this->template_resource = $template_resource; - $this->source = Smarty_Template_Source::load($this); - parent::__construct(); - } - - /** - * render template - * - * @param bool $merge_tpl_vars if true parent template variables merged in to local scope - * @param bool $no_output_filter if true do not run output filter - * @param bool $display true: display, false: fetch null: subtemplate - * - * @throws Exception - * @throws SmartyException - * @return string rendered template output - */ - public function render($no_output_filter = true, $display = null) - { - $parentIsTpl = isset($this->parent) && $this->parent->_objType == 2; - if ($this->smarty->debugging) { - $this->smarty->_debug->start_template($this, $display); - } - // checks if template exists - if (!$this->source->exists) { - if ($parentIsTpl) { - $parent_resource = " in '{$this->parent->template_resource}'"; - } else { - $parent_resource = ''; - } - throw new SmartyException("Unable to load template {$this->source->type} '{$this->source->name}'{$parent_resource}"); - } - // disable caching for evaluated code - if ($this->source->handler->recompiled) { - $this->caching = false; - } - // read from cache or render - $isCacheTpl = - $this->caching == Smarty::CACHING_LIFETIME_CURRENT || $this->caching == Smarty::CACHING_LIFETIME_SAVED; - if ($isCacheTpl) { - if (!isset($this->cached)) { - $this->loadCached(); - } - $this->cached->render($this, $no_output_filter); - } elseif ($this->source->handler->uncompiled) { - $this->source->render($this); - } else { - if (!isset($this->compiled)) { - $this->loadCompiled(); - } - $this->compiled->render($this); - } - - // display or fetch - if ($display) { - if ($this->caching && $this->smarty->cache_modified_check) { - $this->smarty->ext->_cachemodify->cacheModifiedCheck($this->cached, $this, - isset($content) ? $content : ob_get_clean()); - } else { - if ((!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled) && - !$no_output_filter && (isset($this->smarty->autoload_filters['output']) || - isset($this->smarty->registered_filters['output'])) - ) { - echo $this->smarty->ext->_filterHandler->runFilter('output', ob_get_clean(), $this); - } else { - ob_end_flush(); - flush(); - } - } - if ($this->smarty->debugging) { - $this->smarty->_debug->end_template($this); - // debug output - $this->smarty->_debug->display_debug($this, true); - } - return ''; - } else { - if ($this->smarty->debugging) { - $this->smarty->_debug->end_template($this); - if ($this->smarty->debugging === 2 && $display === false) { - $this->smarty->_debug->display_debug($this, true); - } - } - if ($parentIsTpl) { - if (!empty($this->tpl_function)) { - $this->parent->tpl_function = array_merge($this->parent->tpl_function, $this->tpl_function); - } - foreach ($this->compiled->required_plugins as $code => $tmp1) { - foreach ($tmp1 as $name => $tmp) { - foreach ($tmp as $type => $data) { - $this->parent->compiled->required_plugins[$code][$name][$type] = $data; - } - } - } - } - if (!$no_output_filter && - (!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled) && - (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output'])) - ) { - return $this->smarty->ext->_filterHandler->runFilter('output', ob_get_clean(), $this); - } - // return cache content - return null; - } - } - - /** - * Compiles the template - * If the template is not evaluated the compiled template is saved on disk - */ - public function compileTemplateSource() - { - return $this->compiled->compileTemplateSource($this); - } - - /** - * Writes the content to cache resource - * - * @param string $content - * - * @return bool - */ - public function writeCachedContent($content) - { - return $this->smarty->ext->_updateCache->writeCachedContent($this->cached, $this, $content); - } - - /** - * Get unique template id - * - * @return string - */ - public function _getTemplateId() - { - return isset($this->templateId) ? $this->templateId : $this->templateId = - $this->smarty->_getTemplateId($this->template_resource, $this->cache_id, $this->compile_id); - } - - /** - * runtime error not matching capture tags - */ - public function capture_error() - { - throw new SmartyException("Not matching {capture} open/close in \"{$this->template_resource}\""); - } - - /** - * Load compiled object - * - */ - public function loadCompiled() - { - if (!isset($this->compiled)) { - $this->compiled = Smarty_Template_Compiled::load($this); - } - } - - /** - * Load cached object - * - */ - public function loadCached() - { - if (!isset($this->cached)) { - $this->cached = Smarty_Template_Cached::load($this); - } - } - - /** - * Load compiler object - * - * @throws \SmartyException - */ - public function loadCompiler() - { - if (!class_exists($this->source->handler->compiler_class)) { - $this->smarty->loadPlugin($this->source->handler->compiler_class); - } - $this->compiler = new $this->source->handler->compiler_class($this->source->handler->template_lexer_class, - $this->source->handler->template_parser_class, - $this->smarty); - } - - /** - * Handle unknown class methods - * - * @param string $name unknown method-name - * @param array $args argument array - * - * @return mixed - * @throws SmartyException - */ - public function __call($name, $args) - { - // method of Smarty object? - if (method_exists($this->smarty, $name)) { - return call_user_func_array(array($this->smarty, $name), $args); - } - // parent - return parent::__call($name, $args); - } - - /** - * set Smarty property in template context - * - * @param string $property_name property name - * @param mixed $value value - * - * @throws SmartyException - */ - public function __set($property_name, $value) - { - switch ($property_name) { - case 'compiled': - case 'cached': - case 'compiler': - $this->$property_name = $value; - return; - default: - // Smarty property ? - if (property_exists($this->smarty, $property_name)) { - $this->smarty->$property_name = $value; - return; - } - } - throw new SmartyException("invalid template property '$property_name'."); - } - - /** - * get Smarty property in template context - * - * @param string $property_name property name - * - * @return mixed|Smarty_Template_Cached - * @throws SmartyException - */ - public function __get($property_name) - { - switch ($property_name) { - case 'compiled': - $this->loadCompiled(); - return $this->compiled; - - case 'cached': - $this->loadCached(); - return $this->cached; - - case 'compiler': - $this->loadCompiler(); - return $this->compiler; - default: - // Smarty property ? - if (property_exists($this->smarty, $property_name)) { - return $this->smarty->$property_name; - } - } - throw new SmartyException("template property '$property_name' does not exist."); - } - - /** - * Template data object destructor - */ - public function __destruct() - { - if ($this->smarty->cache_locking && isset($this->cached) && $this->cached->is_locked) { - $this->cached->handler->releaseLock($this->smarty, $this->cached); - } - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_internal_templateparser.php b/library/Smarty/libs/sysplugins/smarty_internal_templateparser.php deleted file mode 100644 index a745d1dc2..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_templateparser.php +++ /dev/null @@ -1,2833 +0,0 @@ -string = $s->string; - $this->metadata = $s->metadata; - } else { - $this->string = (string) $s; - if ($m instanceof TP_yyToken) { - $this->metadata = $m->metadata; - } elseif (is_array($m)) { - $this->metadata = $m; - } - } - } - - public function __toString() - { - return $this->string; - } - - public function offsetExists($offset) - { - return isset($this->metadata[ $offset ]); - } - - public function offsetGet($offset) - { - return $this->metadata[ $offset ]; - } - - public function offsetSet($offset, $value) - { - if ($offset === null) { - if (isset($value[ 0 ])) { - $x = ($value instanceof TP_yyToken) ? $value->metadata : $value; - $this->metadata = array_merge($this->metadata, $x); - - return; - } - $offset = count($this->metadata); - } - if ($value === null) { - return; - } - if ($value instanceof TP_yyToken) { - if ($value->metadata) { - $this->metadata[ $offset ] = $value->metadata; - } - } elseif ($value) { - $this->metadata[ $offset ] = $value; - } - } - - public function offsetUnset($offset) - { - unset($this->metadata[ $offset ]); - } -} - -class TP_yyStackEntry -{ - public $stateno; /* The state-number */ - public $major; /* The major token value. This is the code - ** number for the token at this stack level */ - public $minor; /* The user-supplied minor token value. This - ** is the value of the token */ -} - -; - -#line 11 "../smarty/lexer/smarty_internal_templateparser.y" - -/** - * Smarty Template Parser Class - * - * This is the template parser. - * It is generated from the smarty_internal_templateparser.y file - * - * @author Uwe Tews - */ -class Smarty_Internal_Templateparser -{ - #line 23 "../smarty/lexer/smarty_internal_templateparser.y" - - const Err1 = "Security error: Call to private object member not allowed"; - - const Err2 = "Security error: Call to dynamic object member not allowed"; - - const Err3 = "PHP in template not allowed. Use SmartyBC to enable it"; - - /** - * result status - * - * @var bool - */ - public $successful = true; - - /** - * return value - * - * @var mixed - */ - public $retvalue = 0; - - /** - * counter for prefix code - * - * @var int - */ - public static $prefix_number = 0; - - /** - * @var - */ - public $yymajor; - - /** - * last index of array variable - * - * @var mixed - */ - public $last_index; - - /** - * last variable name - * - * @var string - */ - public $last_variable; - - /** - * root parse tree buffer - * - * @var Smarty_Internal_ParseTree - */ - public $root_buffer; - - /** - * current parse tree object - * - * @var Smarty_Internal_ParseTree - */ - public $current_buffer; - - /** - * lexer object - * - * @var Smarty_Internal_Templatelexer - */ - public $lex; - - /** - * internal error flag - * - * @var bool - */ - private $internalError = false; - - /** - * {strip} status - * - * @var bool - */ - public $strip = false; - - /** - * compiler object - * - * @var Smarty_Internal_TemplateCompilerBase - */ - public $compiler = null; - - /** - * smarty object - * - * @var Smarty - */ - public $smarty = null; - - /** - * template object - * - * @var Smarty_Internal_Template - */ - public $template = null; - - /** - * block nesting level - * - * @var int - */ - public $block_nesting_level = 0; - - /** - * security object - * - * @var Smarty_Security - */ - public $security = null; - - /** - * template prefix array - * - * @var \Smarty_Internal_ParseTree[] - */ - public $template_prefix = array(); - - /** - * security object - * - * @var \Smarty_Internal_ParseTree[] - */ - public $template_postfix = array(); - - /** - * constructor - * - * @param Smarty_Internal_Templatelexer $lex - * @param Smarty_Internal_TemplateCompilerBase $compiler - */ - function __construct(Smarty_Internal_Templatelexer $lex, Smarty_Internal_TemplateCompilerBase $compiler) - { - $this->lex = $lex; - $this->compiler = $compiler; - $this->template = $this->compiler->template; - $this->smarty = $this->template->smarty; - $this->security = isset($this->smarty->security_policy) ? $this->smarty->security_policy : false; - $this->current_buffer = $this->root_buffer = new Smarty_Internal_ParseTree_Template(); - } - - /** - * insert PHP code in current buffer - * - * @param string $code - */ - public function insertPhpCode($code) - { - $this->current_buffer->append_subtree($this, new Smarty_Internal_ParseTree_Tag($this, $code)); - } - - /** - * merge PHP code with prefix code and return parse tree tag object - * - * @param string $code - * - * @return Smarty_Internal_ParseTree_Tag - */ - public function mergePrefixCode($code) - { - $tmp = ''; - foreach ($this->compiler->prefix_code as $preCode) { - $tmp .= $preCode; - } - $this->compiler->prefix_code = array(); - $tmp .= $code; - return new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp, true)); - } - - const TP_VERT = 1; - - const TP_COLON = 2; - - const TP_PHP = 3; - - const TP_NOCACHE = 4; - - const TP_TEXT = 5; - - const TP_STRIPON = 6; - - const TP_STRIPOFF = 7; - - const TP_LITERALSTART = 8; - - const TP_LITERALEND = 9; - - const TP_LITERAL = 10; - - const TP_RDEL = 11; - - const TP_SIMPELOUTPUT = 12; - - const TP_LDEL = 13; - - const TP_DOLLARID = 14; - - const TP_EQUAL = 15; - - const TP_SIMPLETAG = 16; - - const TP_ID = 17; - - const TP_PTR = 18; - - const TP_LDELIF = 19; - - const TP_LDELFOR = 20; - - const TP_SEMICOLON = 21; - - const TP_INCDEC = 22; - - const TP_TO = 23; - - const TP_STEP = 24; - - const TP_LDELFOREACH = 25; - - const TP_SPACE = 26; - - const TP_AS = 27; - - const TP_APTR = 28; - - const TP_LDELSETFILTER = 29; - - const TP_SMARTYBLOCKCHILDPARENT = 30; - - const TP_CLOSETAG = 31; - - const TP_LDELSLASH = 32; - - const TP_ATTR = 33; - - const TP_INTEGER = 34; - - const TP_COMMA = 35; - - const TP_OPENP = 36; - - const TP_CLOSEP = 37; - - const TP_MATH = 38; - - const TP_UNIMATH = 39; - - const TP_ISIN = 40; - - const TP_INSTANCEOF = 41; - - const TP_QMARK = 42; - - const TP_NOT = 43; - - const TP_TYPECAST = 44; - - const TP_HEX = 45; - - const TP_DOT = 46; - - const TP_SINGLEQUOTESTRING = 47; - - const TP_DOUBLECOLON = 48; - - const TP_NAMESPACE = 49; - - const TP_AT = 50; - - const TP_HATCH = 51; - - const TP_OPENB = 52; - - const TP_CLOSEB = 53; - - const TP_DOLLAR = 54; - - const TP_LOGOP = 55; - - const TP_TLOGOP = 56; - - const TP_SINGLECOND = 57; - - const TP_QUOTE = 58; - - const TP_BACKTICK = 59; - - const YY_NO_ACTION = 527; - - const YY_ACCEPT_ACTION = 526; - - const YY_ERROR_ACTION = 525; - - const YY_SZ_ACTTAB = 2021; - - static public $yy_action = array(242, 10, 131, 178, 255, 76, 157, 5, 83, 293, 12, 149, 152, 116, 292, 93, 331, 217, - 284, 295, 221, 331, 226, 36, 21, 169, 35, 43, 308, 99, 26, 42, 39, 294, 235, 244, - 30, 200, 187, 80, 1, 251, 320, 206, 442, 123, 53, 242, 10, 130, 98, 255, 194, 399, - 5, 83, 442, 240, 298, 107, 116, 310, 174, 220, 217, 36, 295, 221, 399, 208, 135, - 21, 26, 161, 43, 399, 8, 174, 42, 39, 294, 235, 218, 331, 200, 187, 80, 1, 312, - 320, 11, 290, 313, 53, 242, 10, 133, 306, 255, 205, 187, 5, 83, 264, 266, 267, 211, - 116, 353, 220, 52, 217, 298, 295, 221, 206, 226, 220, 21, 290, 290, 43, 321, 36, - 249, 42, 39, 294, 235, 244, 26, 200, 206, 80, 1, 11, 320, 283, 52, 52, 53, 242, 10, - 132, 248, 255, 205, 455, 5, 83, 84, 301, 151, 455, 116, 323, 92, 36, 217, 2, 295, - 221, 331, 226, 26, 21, 290, 304, 43, 137, 36, 111, 42, 39, 294, 235, 244, 26, 200, - 187, 80, 1, 225, 320, 320, 52, 123, 53, 242, 10, 133, 98, 255, 193, 175, 5, 83, - 177, 280, 273, 234, 116, 310, 23, 278, 217, 13, 295, 221, 320, 203, 223, 21, 290, - 442, 43, 138, 187, 326, 42, 39, 294, 235, 244, 216, 200, 442, 80, 1, 4, 320, 329, - 52, 15, 53, 242, 10, 134, 91, 255, 205, 176, 5, 83, 293, 12, 16, 90, 116, 292, 300, - 99, 217, 241, 295, 221, 320, 226, 215, 28, 213, 201, 43, 105, 187, 286, 42, 39, - 294, 235, 244, 215, 200, 214, 80, 1, 105, 320, 11, 135, 285, 53, 242, 10, 133, 8, - 255, 205, 164, 5, 83, 442, 215, 19, 239, 116, 99, 105, 331, 217, 6, 295, 221, 442, - 192, 311, 21, 182, 289, 43, 308, 443, 32, 42, 39, 294, 235, 244, 296, 200, 17, 80, - 1, 443, 320, 262, 107, 26, 53, 242, 10, 133, 122, 255, 191, 172, 5, 83, 183, 188, - 148, 231, 116, 223, 168, 331, 217, 181, 295, 221, 331, 226, 206, 21, 331, 141, 43, - 308, 206, 38, 42, 39, 294, 235, 244, 331, 200, 188, 80, 1, 187, 320, 155, 206, 308, - 53, 242, 10, 133, 25, 255, 198, 188, 5, 83, 206, 145, 160, 308, 116, 228, 146, 206, - 217, 180, 295, 221, 331, 226, 286, 21, 331, 359, 43, 179, 289, 38, 42, 39, 294, - 235, 244, 250, 200, 271, 80, 1, 272, 320, 122, 94, 103, 53, 242, 10, 129, 3, 255, - 205, 144, 5, 83, 185, 289, 170, 99, 116, 270, 322, 331, 217, 184, 295, 221, 331, - 226, 99, 7, 171, 35, 43, 308, 89, 105, 42, 39, 294, 235, 244, 120, 200, 328, 80, 1, - 187, 320, 82, 223, 4, 53, 242, 10, 134, 142, 255, 205, 107, 5, 83, 309, 324, 302, - 20, 116, 316, 206, 291, 217, 290, 295, 221, 33, 226, 277, 28, 399, 243, 43, 257, - 219, 189, 42, 39, 294, 235, 244, 110, 200, 140, 80, 399, 147, 320, 253, 327, 258, - 53, 399, 14, 236, 220, 207, 154, 113, 65, 108, 319, 159, 238, 311, 98, 471, 471, - 330, 237, 279, 471, 210, 325, 245, 299, 310, 86, 308, 143, 268, 263, 259, 260, 269, - 177, 204, 287, 136, 242, 10, 150, 87, 255, 320, 139, 5, 83, 293, 12, 22, 195, 116, - 292, 247, 258, 217, 153, 295, 221, 220, 207, 36, 126, 50, 104, 109, 112, 88, 26, - 98, 246, 397, 330, 237, 85, 212, 210, 325, 245, 258, 310, 102, 299, 299, 220, 207, - 397, 113, 65, 108, 320, 299, 134, 397, 98, 222, 442, 330, 237, 299, 299, 210, 325, - 245, 258, 310, 299, 299, 442, 220, 207, 299, 126, 69, 108, 299, 288, 31, 299, 98, - 299, 299, 330, 237, 299, 299, 210, 325, 245, 80, 310, 299, 320, 299, 258, 299, 299, - 209, 299, 220, 207, 299, 126, 69, 108, 206, 299, 299, 455, 98, 299, 206, 330, 237, - 455, 365, 210, 325, 245, 299, 310, 355, 227, 258, 299, 299, 299, 199, 220, 207, 36, - 126, 64, 104, 299, 214, 36, 26, 98, 299, 442, 330, 237, 26, 299, 210, 325, 245, - 258, 310, 471, 471, 442, 220, 207, 471, 126, 69, 108, 293, 12, 299, 299, 98, 292, - 299, 330, 237, 299, 299, 210, 325, 245, 36, 310, 163, 299, 258, 299, 299, 26, 202, - 220, 207, 299, 126, 44, 108, 471, 299, 299, 299, 98, 299, 299, 330, 237, 299, 299, - 210, 325, 245, 299, 310, 299, 299, 258, 134, 299, 299, 252, 220, 207, 206, 126, 72, - 108, 299, 299, 299, 299, 98, 299, 396, 330, 237, 299, 299, 210, 325, 245, 258, 310, - 299, 299, 299, 220, 207, 396, 126, 74, 108, 254, 299, 80, 396, 98, 320, 299, 330, - 237, 299, 297, 210, 325, 245, 299, 310, 299, 242, 9, 299, 299, 255, 299, 258, 5, - 83, 299, 299, 220, 207, 116, 126, 68, 108, 217, 299, 295, 221, 98, 299, 299, 330, - 237, 299, 299, 210, 325, 245, 299, 310, 299, 258, 299, 299, 299, 299, 220, 207, - 299, 100, 70, 108, 299, 303, 29, 299, 98, 299, 299, 330, 237, 299, 297, 210, 325, - 245, 299, 310, 299, 242, 9, 299, 299, 255, 299, 299, 5, 83, 299, 299, 299, 299, - 116, 299, 299, 258, 217, 299, 295, 221, 220, 207, 299, 126, 66, 108, 299, 299, 299, - 299, 98, 293, 12, 330, 237, 299, 292, 210, 325, 245, 299, 310, 258, 299, 299, 305, - 29, 220, 207, 299, 126, 60, 108, 299, 293, 12, 299, 98, 299, 292, 330, 237, 299, - 299, 210, 325, 245, 299, 310, 232, 299, 258, 299, 206, 299, 299, 220, 207, 299, - 126, 49, 108, 299, 299, 299, 299, 98, 299, 299, 330, 237, 299, 230, 210, 325, 245, - 299, 310, 258, 167, 299, 299, 299, 220, 207, 299, 126, 58, 108, 299, 41, 40, 37, - 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, 258, 299, 256, 275, 282, - 220, 97, 299, 81, 45, 106, 299, 299, 299, 299, 98, 299, 299, 330, 237, 299, 299, - 210, 325, 245, 299, 310, 299, 299, 258, 299, 206, 299, 299, 220, 207, 299, 126, 63, - 108, 299, 186, 299, 299, 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, - 258, 299, 299, 299, 299, 220, 197, 299, 114, 59, 108, 299, 41, 40, 37, 98, 299, - 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, 258, 299, 256, 275, 282, 220, - 207, 299, 126, 55, 108, 299, 299, 299, 299, 98, 299, 299, 330, 237, 299, 299, 210, - 325, 245, 299, 310, 299, 299, 258, 299, 206, 299, 299, 220, 207, 299, 126, 57, 108, - 299, 41, 40, 37, 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, 258, - 299, 256, 275, 282, 220, 95, 299, 81, 48, 106, 233, 41, 40, 37, 98, 299, 299, 330, - 237, 299, 299, 210, 325, 245, 299, 310, 258, 299, 256, 275, 282, 220, 207, 299, - 126, 78, 108, 299, 299, 299, 299, 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, - 299, 310, 299, 299, 258, 299, 206, 18, 299, 220, 207, 299, 96, 61, 108, 299, 299, - 299, 299, 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, 258, 299, 299, - 299, 299, 220, 207, 299, 126, 47, 108, 299, 41, 40, 37, 98, 299, 299, 330, 237, - 299, 299, 210, 325, 245, 299, 310, 258, 299, 256, 275, 282, 220, 207, 299, 126, 75, - 108, 299, 299, 299, 299, 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, - 299, 299, 258, 299, 206, 299, 299, 220, 207, 299, 126, 64, 108, 299, 299, 299, 299, - 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, 258, 299, 299, 299, 299, - 220, 207, 299, 126, 56, 108, 317, 41, 40, 37, 98, 299, 299, 330, 237, 299, 299, - 210, 325, 245, 299, 310, 258, 299, 256, 275, 282, 220, 207, 299, 115, 46, 108, 299, - 299, 299, 299, 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, 299, 299, - 258, 299, 206, 299, 299, 220, 207, 299, 126, 79, 108, 299, 190, 299, 299, 98, 299, - 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, 258, 299, 299, 299, 299, 220, - 207, 299, 126, 62, 108, 299, 41, 40, 37, 98, 299, 299, 330, 237, 299, 299, 210, - 325, 245, 299, 310, 258, 299, 256, 275, 282, 220, 207, 299, 126, 71, 108, 299, 299, - 299, 299, 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, 299, 299, 258, - 299, 206, 299, 299, 220, 207, 299, 101, 67, 108, 299, 318, 299, 299, 98, 299, 299, - 330, 237, 299, 299, 210, 325, 245, 299, 310, 258, 299, 299, 299, 299, 220, 207, - 299, 126, 77, 108, 299, 41, 40, 37, 98, 299, 299, 330, 237, 299, 299, 210, 325, - 245, 299, 310, 258, 299, 256, 275, 282, 220, 196, 299, 126, 54, 108, 299, 299, 299, - 299, 98, 299, 299, 330, 237, 299, 299, 210, 325, 245, 299, 310, 299, 299, 258, 299, - 206, 299, 299, 220, 207, 299, 126, 73, 108, 299, 274, 299, 299, 98, 299, 299, 330, - 237, 299, 299, 210, 325, 245, 299, 310, 258, 299, 299, 299, 299, 220, 224, 299, - 118, 299, 108, 299, 41, 40, 37, 98, 299, 299, 299, 261, 299, 299, 210, 325, 245, - 299, 310, 258, 299, 256, 275, 282, 220, 224, 299, 128, 299, 108, 299, 299, 299, - 299, 98, 299, 299, 229, 315, 206, 299, 210, 325, 245, 299, 310, 299, 471, 471, 307, - 27, 299, 471, 455, 526, 51, 265, 266, 267, 211, 299, 299, 220, 299, 36, 299, 409, - 409, 299, 299, 299, 26, 299, 299, 299, 299, 41, 40, 37, 206, 299, 455, 299, 455, - 299, 471, 299, 455, 299, 299, 299, 299, 299, 256, 275, 282, 229, 299, 299, 117, - 299, 442, 299, 409, 409, 409, 471, 471, 299, 299, 299, 471, 455, 442, 299, 299, 41, - 40, 37, 299, 409, 409, 409, 299, 299, 299, 299, 299, 299, 299, 299, 299, 299, 256, - 275, 282, 299, 299, 299, 299, 455, 299, 455, 258, 471, 299, 455, 281, 220, 224, - 299, 127, 299, 108, 299, 299, 299, 299, 98, 299, 299, 299, 299, 299, 299, 210, 325, - 245, 258, 310, 206, 156, 299, 220, 224, 175, 121, 299, 108, 299, 299, 331, 299, 98, - 23, 278, 299, 299, 299, 299, 210, 325, 245, 34, 310, 36, 299, 299, 187, 299, 299, - 299, 26, 299, 299, 258, 299, 41, 40, 37, 220, 224, 299, 125, 299, 108, 299, 299, - 299, 299, 98, 299, 299, 229, 256, 275, 282, 210, 325, 245, 299, 310, 299, 471, 471, - 258, 31, 299, 471, 455, 220, 224, 299, 124, 299, 108, 299, 299, 299, 299, 98, 299, - 299, 299, 299, 299, 299, 210, 325, 245, 258, 310, 206, 299, 299, 220, 224, 455, - 119, 455, 108, 471, 299, 455, 299, 98, 299, 299, 229, 299, 299, 24, 210, 325, 245, - 299, 310, 299, 471, 471, 299, 471, 471, 471, 455, 299, 471, 455, 206, 41, 40, 37, - 299, 299, 299, 471, 471, 299, 299, 299, 471, 455, 299, 299, 276, 299, 256, 275, - 282, 299, 299, 299, 455, 36, 455, 455, 471, 455, 455, 471, 26, 455, 299, 206, 403, - 41, 40, 37, 206, 455, 299, 455, 299, 471, 403, 455, 403, 299, 299, 403, 299, 299, - 256, 275, 282, 299, 403, 299, 403, 299, 403, 299, 299, 299, 299, 299, 299, 299, - 299, 223, 41, 40, 37, 299, 299, 41, 40, 37, 299, 299, 299, 299, 299, 299, 299, 299, - 173, 256, 275, 282, 175, 314, 256, 275, 282, 299, 331, 166, 299, 23, 278, 175, 162, - 299, 299, 299, 175, 331, 299, 299, 23, 278, 331, 187, 299, 23, 278, 158, 299, 299, - 299, 175, 299, 299, 187, 299, 299, 331, 165, 187, 23, 278, 175, 299, 299, 299, 299, - 299, 331, 299, 299, 23, 278, 299, 187, 299, 299, 299, 299, 299, 299, 299, 299, 299, - 299, 187,); - - static public $yy_lookahead = array(12, 13, 14, 80, 16, 17, 71, 19, 20, 12, 13, 71, 91, 25, 17, 75, 81, 29, 30, 31, - 32, 81, 34, 26, 36, 28, 15, 39, 93, 18, 33, 43, 44, 45, 46, 47, 28, 49, 98, 51, - 52, 70, 54, 1, 36, 74, 58, 12, 13, 14, 79, 16, 17, 11, 19, 20, 48, 86, 64, 48, - 25, 90, 75, 69, 29, 26, 31, 32, 26, 34, 46, 36, 33, 71, 39, 33, 52, 75, 43, 44, - 45, 46, 47, 81, 49, 98, 51, 52, 53, 54, 35, 22, 37, 58, 12, 13, 14, 103, 16, 17, - 98, 19, 20, 63, 64, 65, 66, 25, 11, 69, 41, 29, 64, 31, 32, 1, 34, 69, 36, 22, - 22, 39, 53, 26, 95, 43, 44, 45, 46, 47, 33, 49, 1, 51, 52, 35, 54, 37, 41, 41, - 58, 12, 13, 14, 14, 16, 17, 46, 19, 20, 102, 103, 71, 52, 25, 11, 75, 26, 29, - 36, 31, 32, 81, 34, 33, 36, 22, 17, 39, 14, 26, 48, 43, 44, 45, 46, 47, 33, 49, - 98, 51, 52, 70, 54, 54, 41, 74, 58, 12, 13, 14, 79, 16, 17, 75, 19, 20, 8, 9, - 10, 50, 25, 90, 84, 85, 29, 13, 31, 32, 54, 34, 46, 36, 22, 36, 39, 14, 98, 53, - 43, 44, 45, 46, 47, 46, 49, 48, 51, 52, 36, 54, 53, 41, 21, 58, 12, 13, 14, 36, - 16, 17, 75, 19, 20, 12, 13, 15, 35, 25, 17, 59, 18, 29, 22, 31, 32, 54, 34, 74, - 36, 76, 77, 39, 79, 98, 99, 43, 44, 45, 46, 47, 74, 49, 76, 51, 52, 79, 54, 35, - 46, 37, 58, 12, 13, 14, 52, 16, 17, 71, 19, 20, 36, 74, 15, 76, 25, 18, 79, 81, - 29, 35, 31, 32, 48, 34, 92, 36, 94, 95, 39, 93, 36, 15, 43, 44, 45, 46, 47, 53, - 49, 26, 51, 52, 48, 54, 89, 48, 33, 58, 12, 13, 14, 96, 16, 17, 71, 19, 20, 14, - 98, 71, 17, 25, 46, 71, 81, 29, 75, 31, 32, 81, 34, 1, 36, 81, 71, 39, 93, 1, 2, - 43, 44, 45, 46, 47, 81, 49, 98, 51, 52, 98, 54, 91, 1, 93, 58, 12, 13, 14, 28, - 16, 17, 98, 19, 20, 1, 91, 71, 93, 25, 18, 71, 1, 29, 80, 31, 32, 81, 34, 99, - 36, 81, 11, 39, 94, 95, 2, 43, 44, 45, 46, 47, 89, 49, 65, 51, 52, 68, 54, 96, - 80, 79, 58, 12, 13, 14, 36, 16, 17, 71, 19, 20, 94, 95, 71, 18, 25, 53, 96, 81, - 29, 75, 31, 32, 81, 34, 18, 36, 74, 15, 39, 93, 91, 79, 43, 44, 45, 46, 47, 17, - 49, 17, 51, 52, 98, 54, 17, 46, 36, 58, 12, 13, 14, 51, 16, 17, 48, 19, 20, 17, - 34, 17, 42, 25, 17, 1, 34, 29, 22, 31, 32, 23, 34, 37, 36, 11, 17, 39, 5, 17, - 17, 43, 44, 45, 46, 47, 17, 49, 51, 51, 26, 27, 54, 11, 53, 64, 58, 33, 13, 14, - 69, 70, 17, 72, 73, 74, 53, 91, 81, 92, 79, 12, 13, 82, 83, 9, 17, 86, 87, 88, - 104, 90, 79, 93, 91, 3, 4, 5, 6, 7, 8, 100, 101, 79, 12, 13, 91, 79, 16, 54, 91, - 19, 20, 12, 13, 13, 14, 25, 17, 17, 64, 29, 91, 31, 32, 69, 70, 26, 72, 73, 74, - 78, 76, 79, 33, 79, 34, 11, 82, 83, 79, 15, 86, 87, 88, 64, 90, 67, 104, 104, - 69, 70, 26, 72, 73, 74, 54, 104, 14, 33, 79, 17, 36, 82, 83, 104, 104, 86, 87, - 88, 64, 90, 104, 104, 48, 69, 70, 104, 72, 73, 74, 104, 101, 15, 104, 79, 104, - 104, 82, 83, 104, 104, 86, 87, 88, 51, 90, 104, 54, 104, 64, 104, 104, 97, 104, - 69, 70, 104, 72, 73, 74, 1, 104, 104, 46, 79, 104, 1, 82, 83, 52, 11, 86, 87, - 88, 104, 90, 11, 18, 64, 104, 104, 104, 97, 69, 70, 26, 72, 73, 74, 104, 76, 26, - 33, 79, 104, 36, 82, 83, 33, 104, 86, 87, 88, 64, 90, 12, 13, 48, 69, 70, 17, - 72, 73, 74, 12, 13, 104, 104, 79, 17, 104, 82, 83, 104, 104, 86, 87, 88, 26, 90, - 28, 104, 64, 104, 104, 33, 97, 69, 70, 104, 72, 73, 74, 50, 104, 104, 104, 79, - 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 104, 104, 64, 14, 104, 104, 17, - 69, 70, 1, 72, 73, 74, 104, 104, 104, 104, 79, 104, 11, 82, 83, 104, 104, 86, - 87, 88, 64, 90, 104, 104, 104, 69, 70, 26, 72, 73, 74, 49, 104, 51, 33, 79, 54, - 104, 82, 83, 104, 5, 86, 87, 88, 104, 90, 104, 12, 13, 14, 104, 16, 104, 64, 19, - 20, 104, 104, 69, 70, 25, 72, 73, 74, 29, 104, 31, 32, 79, 104, 104, 82, 83, - 104, 104, 86, 87, 88, 104, 90, 104, 64, 104, 104, 104, 104, 69, 70, 104, 72, 73, - 74, 104, 58, 59, 104, 79, 104, 104, 82, 83, 104, 5, 86, 87, 88, 104, 90, 104, - 12, 13, 14, 104, 16, 104, 104, 19, 20, 104, 104, 104, 104, 25, 104, 104, 64, 29, - 104, 31, 32, 69, 70, 104, 72, 73, 74, 104, 104, 104, 104, 79, 12, 13, 82, 83, - 104, 17, 86, 87, 88, 104, 90, 64, 104, 104, 58, 59, 69, 70, 104, 72, 73, 74, - 104, 12, 13, 104, 79, 104, 17, 82, 83, 104, 104, 86, 87, 88, 104, 90, 50, 104, - 64, 104, 1, 104, 104, 69, 70, 104, 72, 73, 74, 104, 104, 104, 104, 79, 104, 104, - 82, 83, 104, 50, 86, 87, 88, 104, 90, 64, 27, 104, 104, 104, 69, 70, 104, 72, - 73, 74, 104, 38, 39, 40, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, - 64, 104, 55, 56, 57, 69, 70, 104, 72, 73, 74, 104, 104, 104, 104, 79, 104, 104, - 82, 83, 104, 104, 86, 87, 88, 104, 90, 104, 104, 64, 104, 1, 104, 104, 69, 70, - 104, 72, 73, 74, 104, 11, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, - 104, 90, 64, 104, 104, 104, 104, 69, 70, 104, 72, 73, 74, 104, 38, 39, 40, 79, - 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 64, 104, 55, 56, 57, 69, 70, - 104, 72, 73, 74, 104, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, - 104, 90, 104, 104, 64, 104, 1, 104, 104, 69, 70, 104, 72, 73, 74, 104, 38, 39, - 40, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 64, 104, 55, 56, 57, - 69, 70, 104, 72, 73, 74, 37, 38, 39, 40, 79, 104, 104, 82, 83, 104, 104, 86, 87, - 88, 104, 90, 64, 104, 55, 56, 57, 69, 70, 104, 72, 73, 74, 104, 104, 104, 104, - 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 104, 104, 64, 104, 1, 2, - 104, 69, 70, 104, 72, 73, 74, 104, 104, 104, 104, 79, 104, 104, 82, 83, 104, - 104, 86, 87, 88, 104, 90, 64, 104, 104, 104, 104, 69, 70, 104, 72, 73, 74, 104, - 38, 39, 40, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 64, 104, 55, - 56, 57, 69, 70, 104, 72, 73, 74, 104, 104, 104, 104, 79, 104, 104, 82, 83, 104, - 104, 86, 87, 88, 104, 90, 104, 104, 64, 104, 1, 104, 104, 69, 70, 104, 72, 73, - 74, 104, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 64, - 104, 104, 104, 104, 69, 70, 104, 72, 73, 74, 37, 38, 39, 40, 79, 104, 104, 82, - 83, 104, 104, 86, 87, 88, 104, 90, 64, 104, 55, 56, 57, 69, 70, 104, 72, 73, 74, - 104, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 104, - 104, 64, 104, 1, 104, 104, 69, 70, 104, 72, 73, 74, 104, 11, 104, 104, 79, 104, - 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 64, 104, 104, 104, 104, 69, 70, 104, - 72, 73, 74, 104, 38, 39, 40, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, - 90, 64, 104, 55, 56, 57, 69, 70, 104, 72, 73, 74, 104, 104, 104, 104, 79, 104, - 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 104, 104, 64, 104, 1, 104, 104, 69, - 70, 104, 72, 73, 74, 104, 11, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, - 88, 104, 90, 64, 104, 104, 104, 104, 69, 70, 104, 72, 73, 74, 104, 38, 39, 40, - 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 64, 104, 55, 56, 57, 69, - 70, 104, 72, 73, 74, 104, 104, 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, - 88, 104, 90, 104, 104, 64, 104, 1, 104, 104, 69, 70, 104, 72, 73, 74, 104, 11, - 104, 104, 79, 104, 104, 82, 83, 104, 104, 86, 87, 88, 104, 90, 64, 104, 104, - 104, 104, 69, 70, 104, 72, 104, 74, 104, 38, 39, 40, 79, 104, 104, 104, 83, 104, - 104, 86, 87, 88, 104, 90, 64, 104, 55, 56, 57, 69, 70, 104, 72, 104, 74, 104, - 104, 104, 104, 79, 104, 104, 2, 83, 1, 104, 86, 87, 88, 104, 90, 104, 12, 13, - 11, 15, 104, 17, 18, 61, 62, 63, 64, 65, 66, 104, 104, 69, 104, 26, 104, 1, 2, - 104, 104, 104, 33, 104, 104, 104, 104, 38, 39, 40, 1, 104, 46, 104, 48, 104, 50, - 104, 52, 104, 104, 104, 104, 104, 55, 56, 57, 2, 104, 104, 21, 104, 36, 104, 38, - 39, 40, 12, 13, 104, 104, 104, 17, 18, 48, 104, 104, 38, 39, 40, 104, 55, 56, - 57, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 55, 56, 57, 104, 104, 104, - 104, 46, 104, 48, 64, 50, 104, 52, 53, 69, 70, 104, 72, 104, 74, 104, 104, 104, - 104, 79, 104, 104, 104, 104, 104, 104, 86, 87, 88, 64, 90, 1, 71, 104, 69, 70, - 75, 72, 104, 74, 104, 104, 81, 104, 79, 84, 85, 104, 104, 104, 104, 86, 87, 88, - 24, 90, 26, 104, 104, 98, 104, 104, 104, 33, 104, 104, 64, 104, 38, 39, 40, 69, - 70, 104, 72, 104, 74, 104, 104, 104, 104, 79, 104, 104, 2, 55, 56, 57, 86, 87, - 88, 104, 90, 104, 12, 13, 64, 15, 104, 17, 18, 69, 70, 104, 72, 104, 74, 104, - 104, 104, 104, 79, 104, 104, 104, 104, 104, 104, 86, 87, 88, 64, 90, 1, 104, - 104, 69, 70, 46, 72, 48, 74, 50, 104, 52, 104, 79, 104, 104, 2, 104, 104, 2, 86, - 87, 88, 104, 90, 104, 12, 13, 104, 12, 13, 17, 18, 104, 17, 18, 1, 38, 39, 40, - 104, 104, 104, 12, 13, 104, 104, 104, 17, 18, 104, 104, 53, 104, 55, 56, 57, - 104, 104, 104, 46, 26, 48, 46, 50, 48, 52, 50, 33, 52, 104, 1, 11, 38, 39, 40, - 1, 46, 104, 48, 104, 50, 21, 52, 23, 104, 104, 26, 104, 104, 55, 56, 57, 104, - 33, 104, 35, 104, 37, 104, 104, 104, 104, 104, 104, 104, 104, 46, 38, 39, 40, - 104, 104, 38, 39, 40, 104, 104, 104, 104, 104, 104, 104, 104, 71, 55, 56, 57, - 75, 59, 55, 56, 57, 104, 81, 71, 104, 84, 85, 75, 71, 104, 104, 104, 75, 81, - 104, 104, 84, 85, 81, 98, 104, 84, 85, 71, 104, 104, 104, 75, 104, 104, 98, 104, - 104, 81, 71, 98, 84, 85, 75, 104, 104, 104, 104, 104, 81, 104, 104, 84, 85, 104, - 98, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 98,); - - const YY_SHIFT_USE_DFLT = - 13; - - const YY_SHIFT_MAX = 236; - - static public $yy_shift_ofst = array(542, 364, 82, 82, 82, 411, 364, 411, 35, - 12, - 12, 82, 82, 82, 82, 82, 82, - 176, 82, 82, 129, 82, 82, 82, 317, 82, 82, 82, 82, 82, 82, 270, 82, 82, 82, 82, - 176, 223, 223, 458, 458, 458, 458, 458, 1734, 1603, 1862, 1862, 1862, 1862, - 1862, 542, 749, 803, 1897, 1448, 1531, 1199, 1643, 1826, 1365, 950, 1282, 1033, - 1116, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 1902, 660, - 1902, 1089, 1089, 594, 666, 131, 202, 865, - 3, 703, 551, 551, 233, 202, 202, - 131, 131, 357, 97, 484, 144, 920, 505, 42, 768, 189, 232, 11, 232, 278, 324, - 428, 39, 372, 324, 39, 351, 384, 391, 294, 155, 114, 114, 114, 114, 417, 417, - 114, 114, 114, 114, - 13, 1786, 1659, 1600, 1844, 1841, 1858, 552, 897, 519, - 618, 24, 101, 39, 101, 24, 39, 24, 39, 130, 39, 39, 24, 39, 24, 24, 193, 24, - 39, 39, 39, 24, 39, 39, 39, 130, 39, 39, 39, 130, 39, 130, 39, 231, 39, 39, - 114, 114, 114, 526, 404, 417, 404, 114, 417, 390, 114, 417, - 13, - 13, - 13, - - 13, - 13, 1630, 1888, 576, 178, 694, 191, 69, 8, 100, 275, 212, 243, 297, - 265, 255, 150, 98, 165, 55, 123, 493, 479, 468, 456, 434, 482, 483, 473, 461, - 502, 489, 457, 452, 466, 422, 421, 449, 442, 444, 462, 432, 467, 440, 464, 446, - 390,); - - const YY_REDUCE_USE_DFLT = - 80; - - const YY_REDUCE_MAX = 190; - - static public $yy_reduce_ofst = array(1558, 451, 556, 640, 586, 506, 531, 615, 995, 939, 1078, 723, 1244, 968, 856, - 912, 1354, 1134, 1105, 1161, 1051, 1217, 1022, 1188, 1300, 1466, 1383, 1271, - 1327, 1437, 1410, 757, 698, 669, 885, 829, 785, 1493, 1520, 1761, 1706, 1669, - 1644, 1736, 1880, 1665, 1896, 1911, 1665, 1891, 1922, 40, - 29, 48, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 81, 119, 119, 119, 112, 2, - 60, 184, - 6, 264, 358, - - 65, 217, 213, 218, 197, 284, 269, 166, 363, - 13, 363, 295, 342, - 13, - 13, - 349, 281, 310, 295, 310, 323, 310, 316, 272, 236, 273, - 13, - 13, - 13, 320, - 374, - 13, - 13, 366, - 13, 338, 310, - 13, - 13, - 13, - 13, - 13, 465, 465, - 465, 465, 465, 465, 474, 450, 465, 465, 437, 469, 447, 453, 437, 447, 437, - 447, 463, 447, 447, 437, 447, 437, 437, 481, 437, 447, 447, 447, 437, 447, - 447, 447, 478, 447, 447, 447, 511, 447, 504, 447, 503, 447, 447, 241, 241, - 241, 530, 300, 29, 300, 241, 29, 361, 241, 29, - 79, - 77, 314, 340, 436,); - - static public $yyExpectedTokens = array(array(3, 4, 5, 6, 7, 8, 12, 13, 16, 19, 20, 25, 29, 31, 32,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 53, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 30, 31, 32, 34, 36, 39, 43, 44, - 45, 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 30, 31, 32, 34, 36, 39, 43, 44, - 45, 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 52, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 54, 58,), - array(12, 13, 14, 16, 17, 19, 20, 25, 29, 31, 32, 34, 36, 39, 43, 44, 45, - 46, 47, 49, 51, 54, 58,), - array(1, 24, 26, 33, 38, 39, 40, 55, 56, 57,), - array(1, 11, 26, 33, 38, 39, 40, 55, 56, 57,), - array(1, 26, 33, 38, 39, 40, 55, 56, 57,), - array(1, 26, 33, 38, 39, 40, 55, 56, 57,), - array(1, 26, 33, 38, 39, 40, 55, 56, 57,), - array(1, 26, 33, 38, 39, 40, 55, 56, 57,), - array(1, 26, 33, 38, 39, 40, 55, 56, 57,), - array(3, 4, 5, 6, 7, 8, 12, 13, 16, 19, 20, 25, 29, 31, 32,), - array(14, 17, 49, 51, 54,), - array(5, 12, 13, 14, 16, 19, 20, 25, 29, 31, 32, 58, 59,), - array(1, 38, 39, 40, 55, 56, 57, 59,), - array(1, 11, 38, 39, 40, 55, 56, 57,), - array(1, 11, 38, 39, 40, 55, 56, 57,), array(1, 2, 38, 39, 40, 55, 56, 57,), - array(1, 21, 38, 39, 40, 55, 56, 57,), - array(1, 38, 39, 40, 53, 55, 56, 57,), - array(1, 11, 38, 39, 40, 55, 56, 57,), - array(1, 27, 38, 39, 40, 55, 56, 57,), - array(1, 37, 38, 39, 40, 55, 56, 57,), - array(1, 11, 38, 39, 40, 55, 56, 57,), - array(1, 37, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,), - array(1, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,), - array(1, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,), - array(1, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,), - array(1, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,), - array(1, 38, 39, 40, 55, 56, 57,), array(1, 38, 39, 40, 55, 56, 57,), - array(1, 11, 18, 26, 33, 36, 48,), array(1, 38, 39, 40, 55, 56, 57,), - array(38, 39, 40, 55, 56, 57,), array(38, 39, 40, 55, 56, 57,), - array(14, 17, 51, 54,), array(1, 11, 26, 33,), array(1, 26, 33,), - array(14, 36, 54,), - array(5, 12, 13, 14, 16, 19, 20, 25, 29, 31, 32, 58, 59,), - array(12, 13, 17, 26, 28, 33,), array(12, 13, 17, 26, 28, 33,), - array(12, 13, 17, 26, 33,), array(12, 13, 17, 26, 33,), array(18, 46, 52,), - array(14, 36, 54,), array(14, 36, 54,), array(1, 26, 33,), - array(1, 26, 33,), array(1, 2,), array(11, 22, 26, 33, 41,), - array(1, 11, 26, 27, 33,), array(11, 22, 26, 33, 41,), - array(12, 13, 17, 50,), array(13, 14, 17, 54,), array(1, 11, 26, 33,), - array(1, 11, 26, 33,), array(8, 9, 10,), array(12, 13, 17,), - array(15, 18, 48,), array(12, 13, 17,), array(15, 18, 48,), array(14, 17,), - array(18, 48,), array(26, 33,), array(1, 18,), array(14, 17,), - array(26, 33,), array(1, 28,), array(1, 53,), array(1, 11,), array(26, 33,), - array(14, 54,), array(1,), array(1,), array(1,), array(1,), array(18,), - array(18,), array(1,), array(1,), array(1,), array(1,), array(), - array(2, 12, 13, 15, 17, 18, 46, 48, 50, 52,), - array(2, 12, 13, 17, 18, 46, 48, 50, 52, 53,), - array(2, 12, 13, 15, 17, 18, 46, 48, 50, 52,), - array(2, 12, 13, 17, 18, 46, 48, 50, 52,), - array(2, 12, 13, 17, 18, 46, 48, 50, 52,), - array(12, 13, 17, 18, 46, 48, 50, 52,), array(13, 14, 17, 34, 54,), - array(12, 13, 17, 50,), array(12, 13, 17,), array(15, 46, 52,), - array(46, 52,), array(46, 52,), array(26, 33,), array(46, 52,), - array(46, 52,), array(26, 33,), array(46, 52,), array(26, 33,), - array(14, 54,), array(26, 33,), array(26, 33,), array(46, 52,), - array(26, 33,), array(46, 52,), array(46, 52,), array(13, 36,), - array(46, 52,), array(26, 33,), array(26, 33,), array(26, 33,), - array(46, 52,), array(26, 33,), array(26, 33,), array(26, 33,), - array(14, 54,), array(26, 33,), array(26, 33,), array(26, 33,), - array(14, 54,), array(26, 33,), array(14, 54,), array(26, 33,), - array(15, 22,), array(26, 33,), array(26, 33,), array(1,), array(1,), - array(1,), array(9,), array(2,), array(18,), array(2,), array(1,), - array(18,), array(36,), array(1,), array(18,), array(), array(), array(), - array(), array(), array(1, 2, 36, 38, 39, 40, 48, 55, 56, 57,), - array(11, 21, 23, 26, 33, 35, 37, 46,), array(11, 15, 26, 33, 36, 48,), - array(36, 46, 48, 53,), array(12, 13, 17, 50,), array(22, 41, 59,), - array(22, 41, 53,), array(28, 36, 48,), array(35, 37,), array(36, 48,), - array(21, 35,), array(35, 37,), array(15, 46,), array(35, 53,), - array(36, 48,), array(17, 50,), array(22, 41,), array(46, 53,), - array(35, 37,), array(36, 48,), array(5,), array(17,), array(23,), - array(37,), array(15,), array(17,), array(17,), array(53,), array(53,), - array(11,), array(17,), array(51,), array(34,), array(22,), array(51,), - array(46,), array(17,), array(17,), array(17,), array(17,), array(36,), - array(17,), array(42,), array(17,), array(34,), array(36,), array(), - array(), array(), array(), array(), array(), array(), array(), array(), - array(), array(), array(), array(), array(), array(), array(), array(), - array(), array(), array(), array(), array(), array(), array(), array(), - array(), array(), array(), array(), array(), array(), array(), array(), - array(), array(), array(), array(), array(), array(), array(), array(), - array(), array(), array(), array(), array(), array(), array(), array(), - array(), array(), array(), array(), array(), array(), array(), array(), - array(), array(), array(), array(), array(), array(), array(), array(), - array(), array(), array(), array(), array(), array(), array(), array(), - array(), array(), array(), array(), array(), array(), array(), array(), - array(), array(), array(), array(), array(), array(), array(), array(), - array(), array(), array(), array(), array(), array(),); - - static public $yy_default = array(335, 510, 490, 490, 490, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, - 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, - 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 393, 525, 360, 393, - 357, 393, 369, 332, 525, 525, 525, 525, 525, 525, 525, 525, 525, 398, 525, 525, - 525, 513, 405, 395, 404, 489, 398, 374, 400, 511, 488, 414, 432, 512, 421, 420, - 525, 407, 393, 525, 525, 393, 393, 393, 393, 502, 525, 525, 393, 393, 383, 422, - 407, 422, 455, 525, 407, 407, 525, 455, 445, 455, 445, 525, 445, 393, 387, 525, - 371, 407, 407, 407, 393, 525, 417, 425, 389, 410, 499, 445, 423, 411, 407, 424, - 497, 444, 444, 444, 444, 444, 444, 525, 457, 455, 471, 449, 448, 366, 450, 451, - 379, 453, 378, 525, 368, 367, 452, 364, 483, 480, 455, 481, 358, 380, 362, 482, - 373, 356, 361, 525, 382, 370, 377, 525, 372, 525, 354, 525, 381, 376, 439, 413, - 384, 348, 492, 477, 491, 388, 503, 455, 390, 500, 455, 496, 496, 496, 455, 432, - 428, 432, 432, 456, 422, 422, 432, 525, 440, 525, 525, 428, 525, 432, 525, 422, - 428, 525, 525, 340, 525, 401, 525, 525, 525, 525, 435, 525, 525, 525, 525, 430, - 422, 525, 428, 525, 525, 525, 525, 501, 525, 434, 525, 525, 471, 412, 391, 402, - 418, 375, 352, 394, 435, 436, 460, 459, 471, 479, 437, 419, 442, 351, 443, 363, - 504, 342, 438, 341, 343, 416, 441, 339, 334, 333, 336, 337, 338, 344, 468, 349, - 347, 350, 476, 505, 469, 406, 415, 345, 346, 466, 506, 486, 385, 487, 495, 508, - 509, 478, 426, 429, 474, 475, 427, 386, 507, 524, 523, 520, 518, 517, 493, 514, - 494, 515, 516, 522, 473, 446, 447, 454, 470, 485, 519, 498, 458, 434, 461, 464, - 472, 467, 484, 521, 431, 433, 465, 463, 409, 462, 408, 392,); - - const YYNOCODE = 105; - - const YYSTACKDEPTH = 500; - - const YYNSTATE = 332; - - const YYNRULE = 193; - - const YYERRORSYMBOL = 60; - - const YYERRSYMDT = 'yy0'; - - const YYFALLBACK = 0; - - public static $yyFallback = array(); - - public function Trace($TraceFILE, $zTracePrompt) - { - if (!$TraceFILE) { - $zTracePrompt = 0; - } elseif (!$zTracePrompt) { - $TraceFILE = 0; - } - $this->yyTraceFILE = $TraceFILE; - $this->yyTracePrompt = $zTracePrompt; - } - - public function PrintTrace() - { - $this->yyTraceFILE = fopen('php://output', 'w'); - $this->yyTracePrompt = '
'; - } - - public $yyTraceFILE; - - public $yyTracePrompt; - - public $yyidx; /* Index of top element in stack */ - public $yyerrcnt; /* Shifts left before out of the error */ - public $yystack = array(); /* The parser's stack */ - - public $yyTokenName = array('$', 'VERT', 'COLON', 'PHP', 'NOCACHE', 'TEXT', 'STRIPON', 'STRIPOFF', 'LITERALSTART', - 'LITERALEND', 'LITERAL', 'RDEL', 'SIMPELOUTPUT', 'LDEL', 'DOLLARID', 'EQUAL', - 'SIMPLETAG', 'ID', 'PTR', 'LDELIF', 'LDELFOR', 'SEMICOLON', 'INCDEC', 'TO', 'STEP', - 'LDELFOREACH', 'SPACE', 'AS', 'APTR', 'LDELSETFILTER', 'SMARTYBLOCKCHILDPARENT', - 'CLOSETAG', 'LDELSLASH', 'ATTR', 'INTEGER', 'COMMA', 'OPENP', 'CLOSEP', 'MATH', - 'UNIMATH', 'ISIN', 'INSTANCEOF', 'QMARK', 'NOT', 'TYPECAST', 'HEX', 'DOT', - 'SINGLEQUOTESTRING', 'DOUBLECOLON', 'NAMESPACE', 'AT', 'HATCH', 'OPENB', 'CLOSEB', - 'DOLLAR', 'LOGOP', 'TLOGOP', 'SINGLECOND', 'QUOTE', 'BACKTICK', 'error', 'start', - 'template', 'template_element', 'smartytag', 'literal', 'text_content', - 'literal_elements', 'literal_element', 'tag', 'variable', 'attributes', 'value', 'expr', - 'varindexed', 'modifierlist', 'statement', 'statements', 'foraction', 'varvar', - 'modparameters', 'attribute', 'ternary', 'array', 'lop', 'scond', 'ns1', 'function', - 'doublequoted_with_quotes', 'static_class_access', 'object', 'arrayindex', 'indexdef', - 'varvarele', 'objectchain', 'objectelement', 'method', 'params', 'modifier', - 'modparameter', 'arrayelements', 'arrayelement', 'doublequoted', - 'doublequotedcontent',); - - public static $yyRuleName = array('start ::= template', 'template ::= template_element', - 'template ::= template template_element', 'template ::=', - 'template_element ::= smartytag', 'template_element ::= literal', - 'template_element ::= PHP', 'template_element ::= NOCACHE', - 'template_element ::= text_content', 'text_content ::= TEXT', - 'text_content ::= text_content TEXT', 'template_element ::= STRIPON', - 'template_element ::= STRIPOFF', 'literal ::= LITERALSTART LITERALEND', - 'literal ::= LITERALSTART literal_elements LITERALEND', - 'literal_elements ::= literal_elements literal_element', 'literal_elements ::=', - 'literal_element ::= literal', 'literal_element ::= LITERAL', - 'smartytag ::= tag RDEL', 'smartytag ::= SIMPELOUTPUT', 'tag ::= LDEL variable', - 'tag ::= LDEL variable attributes', 'tag ::= LDEL value', - 'tag ::= LDEL value attributes', 'tag ::= LDEL expr', - 'tag ::= LDEL expr attributes', 'tag ::= LDEL DOLLARID EQUAL value', - 'tag ::= LDEL DOLLARID EQUAL expr', 'tag ::= LDEL DOLLARID EQUAL expr attributes', - 'tag ::= LDEL varindexed EQUAL expr attributes', 'smartytag ::= SIMPLETAG', - 'tag ::= LDEL ID attributes', 'tag ::= LDEL ID', - 'tag ::= LDEL ID modifierlist attributes', 'tag ::= LDEL ID PTR ID attributes', - 'tag ::= LDEL ID PTR ID modifierlist attributes', 'tag ::= LDELIF expr', - 'tag ::= LDELIF expr attributes', 'tag ::= LDELIF statement', - 'tag ::= LDELIF statement attributes', - 'tag ::= LDELFOR statements SEMICOLON expr SEMICOLON varindexed foraction attributes', - 'foraction ::= EQUAL expr', 'foraction ::= INCDEC', - 'tag ::= LDELFOR statement TO expr attributes', - 'tag ::= LDELFOR statement TO expr STEP expr attributes', - 'tag ::= LDELFOREACH attributes', - 'tag ::= LDELFOREACH SPACE value AS varvar attributes', - 'tag ::= LDELFOREACH SPACE value AS varvar APTR varvar attributes', - 'tag ::= LDELFOREACH SPACE expr AS varvar attributes', - 'tag ::= LDELFOREACH SPACE expr AS varvar APTR varvar attributes', - 'tag ::= LDELSETFILTER ID modparameters', - 'tag ::= LDELSETFILTER ID modparameters modifierlist', - 'tag ::= LDEL SMARTYBLOCKCHILDPARENT', 'smartytag ::= CLOSETAG', - 'tag ::= LDELSLASH ID', 'tag ::= LDELSLASH ID modifierlist', - 'tag ::= LDELSLASH ID PTR ID', 'tag ::= LDELSLASH ID PTR ID modifierlist', - 'attributes ::= attributes attribute', 'attributes ::= attribute', - 'attributes ::=', 'attribute ::= SPACE ID EQUAL ID', 'attribute ::= ATTR expr', - 'attribute ::= ATTR value', 'attribute ::= SPACE ID', 'attribute ::= SPACE expr', - 'attribute ::= SPACE value', 'attribute ::= SPACE INTEGER EQUAL expr', - 'statements ::= statement', 'statements ::= statements COMMA statement', - 'statement ::= DOLLARID EQUAL INTEGER', 'statement ::= DOLLARID EQUAL expr', - 'statement ::= varindexed EQUAL expr', 'statement ::= OPENP statement CLOSEP', - 'expr ::= value', 'expr ::= ternary', 'expr ::= DOLLARID COLON ID', - 'expr ::= expr MATH value', 'expr ::= expr UNIMATH value', 'expr ::= array', - 'expr ::= expr modifierlist', 'expr ::= expr lop expr', 'expr ::= expr scond', - 'expr ::= expr ISIN array', 'expr ::= expr ISIN value', - 'expr ::= variable INSTANCEOF ns1', 'expr ::= variable INSTANCEOF variable', - 'ternary ::= OPENP expr CLOSEP QMARK DOLLARID COLON expr', - 'ternary ::= OPENP expr CLOSEP QMARK expr COLON expr', 'value ::= variable', - 'value ::= UNIMATH value', 'value ::= NOT value', 'value ::= TYPECAST value', - 'value ::= variable INCDEC', 'value ::= HEX', 'value ::= INTEGER', - 'value ::= INTEGER DOT INTEGER', 'value ::= INTEGER DOT', 'value ::= DOT INTEGER', - 'value ::= ID', 'value ::= function', 'value ::= OPENP expr CLOSEP', - 'value ::= SINGLEQUOTESTRING', 'value ::= doublequoted_with_quotes', - 'value ::= varindexed DOUBLECOLON static_class_access', 'value ::= smartytag', - 'value ::= value modifierlist', 'value ::= NAMESPACE', - 'value ::= ns1 DOUBLECOLON static_class_access', 'ns1 ::= ID', - 'ns1 ::= NAMESPACE', 'variable ::= DOLLARID', 'variable ::= varindexed', - 'variable ::= varvar AT ID', 'variable ::= object', 'variable ::= HATCH ID HATCH', - 'variable ::= HATCH ID HATCH arrayindex', 'variable ::= HATCH variable HATCH', - 'variable ::= HATCH variable HATCH arrayindex', - 'varindexed ::= DOLLARID arrayindex', 'varindexed ::= varvar arrayindex', - 'arrayindex ::= arrayindex indexdef', 'arrayindex ::=', - 'indexdef ::= DOT DOLLARID', 'indexdef ::= DOT varvar', - 'indexdef ::= DOT varvar AT ID', 'indexdef ::= DOT ID', - 'indexdef ::= DOT INTEGER', 'indexdef ::= DOT LDEL expr RDEL', - 'indexdef ::= OPENB ID CLOSEB', 'indexdef ::= OPENB ID DOT ID CLOSEB', - 'indexdef ::= OPENB SINGLEQUOTESTRING CLOSEB', - 'indexdef ::= OPENB INTEGER CLOSEB', 'indexdef ::= OPENB DOLLARID CLOSEB', - 'indexdef ::= OPENB variable CLOSEB', 'indexdef ::= OPENB value CLOSEB', - 'indexdef ::= OPENB expr CLOSEB', 'indexdef ::= OPENB CLOSEB', - 'varvar ::= DOLLARID', 'varvar ::= DOLLAR', 'varvar ::= varvar varvarele', - 'varvarele ::= ID', 'varvarele ::= SIMPELOUTPUT', 'varvarele ::= LDEL expr RDEL', - 'object ::= varindexed objectchain', 'objectchain ::= objectelement', - 'objectchain ::= objectchain objectelement', - 'objectelement ::= PTR ID arrayindex', 'objectelement ::= PTR varvar arrayindex', - 'objectelement ::= PTR LDEL expr RDEL arrayindex', - 'objectelement ::= PTR ID LDEL expr RDEL arrayindex', - 'objectelement ::= PTR method', 'function ::= ns1 OPENP params CLOSEP', - 'method ::= ID OPENP params CLOSEP', 'method ::= DOLLARID OPENP params CLOSEP', - 'params ::= params COMMA expr', 'params ::= expr', 'params ::=', - 'modifierlist ::= modifierlist modifier modparameters', - 'modifierlist ::= modifier modparameters', 'modifier ::= VERT AT ID', - 'modifier ::= VERT ID', 'modparameters ::= modparameters modparameter', - 'modparameters ::=', 'modparameter ::= COLON value', - 'modparameter ::= COLON array', 'static_class_access ::= method', - 'static_class_access ::= method objectchain', 'static_class_access ::= ID', - 'static_class_access ::= DOLLARID arrayindex', - 'static_class_access ::= DOLLARID arrayindex objectchain', 'lop ::= LOGOP', - 'lop ::= TLOGOP', 'scond ::= SINGLECOND', 'array ::= OPENB arrayelements CLOSEB', - 'arrayelements ::= arrayelement', - 'arrayelements ::= arrayelements COMMA arrayelement', 'arrayelements ::=', - 'arrayelement ::= value APTR expr', 'arrayelement ::= ID APTR expr', - 'arrayelement ::= expr', 'doublequoted_with_quotes ::= QUOTE QUOTE', - 'doublequoted_with_quotes ::= QUOTE doublequoted QUOTE', - 'doublequoted ::= doublequoted doublequotedcontent', - 'doublequoted ::= doublequotedcontent', - 'doublequotedcontent ::= BACKTICK variable BACKTICK', - 'doublequotedcontent ::= BACKTICK expr BACKTICK', - 'doublequotedcontent ::= DOLLARID', 'doublequotedcontent ::= LDEL variable RDEL', - 'doublequotedcontent ::= LDEL expr RDEL', 'doublequotedcontent ::= smartytag', - 'doublequotedcontent ::= TEXT',); - - public function tokenName($tokenType) - { - if ($tokenType === 0) { - return 'End of Input'; - } - if ($tokenType > 0 && $tokenType < count($this->yyTokenName)) { - return $this->yyTokenName[ $tokenType ]; - } else { - return "Unknown"; - } - } - - public static function yy_destructor($yymajor, $yypminor) - { - switch ($yymajor) { - default: - break; /* If no destructor action specified: do nothing */ - } - } - - public function yy_pop_parser_stack() - { - if (empty($this->yystack)) { - return; - } - $yytos = array_pop($this->yystack); - if ($this->yyTraceFILE && $this->yyidx >= 0) { - fwrite($this->yyTraceFILE, $this->yyTracePrompt . 'Popping ' . $this->yyTokenName[ $yytos->major ] . "\n"); - } - $yymajor = $yytos->major; - self::yy_destructor($yymajor, $yytos->minor); - $this->yyidx --; - - return $yymajor; - } - - public function __destruct() - { - while ($this->yystack !== Array()) { - $this->yy_pop_parser_stack(); - } - if (is_resource($this->yyTraceFILE)) { - fclose($this->yyTraceFILE); - } - } - - public function yy_get_expected_tokens($token) - { - static $res3 = array(); - static $res4 = array(); - $state = $this->yystack[ $this->yyidx ]->stateno; - $expected = self::$yyExpectedTokens[ $state ]; - if (isset($res3[ $state ][ $token ])) { - if ($res3[ $state ][ $token ]) { - return $expected; - } - } else { - if ($res3[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) { - return $expected; - } - } - $stack = $this->yystack; - $yyidx = $this->yyidx; - do { - $yyact = $this->yy_find_shift_action($token); - if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { - // reduce action - $done = 0; - do { - if ($done ++ == 100) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // too much recursion prevents proper detection - // so give up - return array_unique($expected); - } - $yyruleno = $yyact - self::YYNSTATE; - $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ]; - $nextstate = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, - self::$yyRuleInfo[ $yyruleno ][ 0 ]); - if (isset(self::$yyExpectedTokens[ $nextstate ])) { - $expected = array_merge($expected, self::$yyExpectedTokens[ $nextstate ]); - if (isset($res4[ $nextstate ][ $token ])) { - if ($res4[ $nextstate ][ $token ]) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - return array_unique($expected); - } - } else { - if ($res4[ $nextstate ][ $token ] = - in_array($token, self::$yyExpectedTokens[ $nextstate ], true) - ) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - return array_unique($expected); - } - } - } - if ($nextstate < self::YYNSTATE) { - // we need to shift a non-terminal - $this->yyidx ++; - $x = new TP_yyStackEntry; - $x->stateno = $nextstate; - $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ]; - $this->yystack[ $this->yyidx ] = $x; - continue 2; - } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // the last token was just ignored, we can't accept - // by ignoring input, this is in essence ignoring a - // syntax error! - return array_unique($expected); - } elseif ($nextstate === self::YY_NO_ACTION) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // input accepted, but not shifted (I guess) - return $expected; - } else { - $yyact = $nextstate; - } - } while (true); - } - break; - } while (true); - $this->yyidx = $yyidx; - $this->yystack = $stack; - - return array_unique($expected); - } - - public function yy_is_expected_token($token) - { - static $res = array(); - static $res2 = array(); - if ($token === 0) { - return true; // 0 is not part of this - } - $state = $this->yystack[ $this->yyidx ]->stateno; - if (isset($res[ $state ][ $token ])) { - if ($res[ $state ][ $token ]) { - return true; - } - } else { - if ($res[ $state ][ $token ] = in_array($token, self::$yyExpectedTokens[ $state ], true)) { - return true; - } - } - $stack = $this->yystack; - $yyidx = $this->yyidx; - do { - $yyact = $this->yy_find_shift_action($token); - if ($yyact >= self::YYNSTATE && $yyact < self::YYNSTATE + self::YYNRULE) { - // reduce action - $done = 0; - do { - if ($done ++ == 100) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // too much recursion prevents proper detection - // so give up - return true; - } - $yyruleno = $yyact - self::YYNSTATE; - $this->yyidx -= self::$yyRuleInfo[ $yyruleno ][ 1 ]; - $nextstate = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, - self::$yyRuleInfo[ $yyruleno ][ 0 ]); - if (isset($res2[ $nextstate ][ $token ])) { - if ($res2[ $nextstate ][ $token ]) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - return true; - } - } else { - if ($res2[ $nextstate ][ $token ] = (isset(self::$yyExpectedTokens[ $nextstate ]) && - in_array($token, self::$yyExpectedTokens[ $nextstate ], true)) - ) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - return true; - } - } - if ($nextstate < self::YYNSTATE) { - // we need to shift a non-terminal - $this->yyidx ++; - $x = new TP_yyStackEntry; - $x->stateno = $nextstate; - $x->major = self::$yyRuleInfo[ $yyruleno ][ 0 ]; - $this->yystack[ $this->yyidx ] = $x; - continue 2; - } elseif ($nextstate == self::YYNSTATE + self::YYNRULE + 1) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - if (!$token) { - // end of input: this is valid - return true; - } - // the last token was just ignored, we can't accept - // by ignoring input, this is in essence ignoring a - // syntax error! - return false; - } elseif ($nextstate === self::YY_NO_ACTION) { - $this->yyidx = $yyidx; - $this->yystack = $stack; - // input accepted, but not shifted (I guess) - return true; - } else { - $yyact = $nextstate; - } - } while (true); - } - break; - } while (true); - $this->yyidx = $yyidx; - $this->yystack = $stack; - - return true; - } - - public function yy_find_shift_action($iLookAhead) - { - $stateno = $this->yystack[ $this->yyidx ]->stateno; - - /* if ($this->yyidx < 0) return self::YY_NO_ACTION; */ - if (!isset(self::$yy_shift_ofst[ $stateno ])) { - // no shift actions - return self::$yy_default[ $stateno ]; - } - $i = self::$yy_shift_ofst[ $stateno ]; - if ($i === self::YY_SHIFT_USE_DFLT) { - return self::$yy_default[ $stateno ]; - } - if ($iLookAhead == self::YYNOCODE) { - return self::YY_NO_ACTION; - } - $i += $iLookAhead; - if ($i < 0 || $i >= self::YY_SZ_ACTTAB || self::$yy_lookahead[ $i ] != $iLookAhead) { - if (count(self::$yyFallback) && $iLookAhead < count(self::$yyFallback) && - ($iFallback = self::$yyFallback[ $iLookAhead ]) != 0 - ) { - if ($this->yyTraceFILE) { - fwrite($this->yyTraceFILE, - $this->yyTracePrompt . "FALLBACK " . $this->yyTokenName[ $iLookAhead ] . " => " . - $this->yyTokenName[ $iFallback ] . "\n"); - } - - return $this->yy_find_shift_action($iFallback); - } - - return self::$yy_default[ $stateno ]; - } else { - return self::$yy_action[ $i ]; - } - } - - public function yy_find_reduce_action($stateno, $iLookAhead) - { - /* $stateno = $this->yystack[$this->yyidx]->stateno; */ - - if (!isset(self::$yy_reduce_ofst[ $stateno ])) { - return self::$yy_default[ $stateno ]; - } - $i = self::$yy_reduce_ofst[ $stateno ]; - if ($i == self::YY_REDUCE_USE_DFLT) { - return self::$yy_default[ $stateno ]; - } - if ($iLookAhead == self::YYNOCODE) { - return self::YY_NO_ACTION; - } - $i += $iLookAhead; - if ($i < 0 || $i >= self::YY_SZ_ACTTAB || self::$yy_lookahead[ $i ] != $iLookAhead) { - return self::$yy_default[ $stateno ]; - } else { - return self::$yy_action[ $i ]; - } - } - - public function yy_shift($yyNewState, $yyMajor, $yypMinor) - { - $this->yyidx ++; - if ($this->yyidx >= self::YYSTACKDEPTH) { - $this->yyidx --; - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sStack Overflow!\n", $this->yyTracePrompt); - } - while ($this->yyidx >= 0) { - $this->yy_pop_parser_stack(); - } - #line 214 "../smarty/lexer/smarty_internal_templateparser.y" - - $this->internalError = true; - $this->compiler->trigger_template_error("Stack overflow in template parser"); - - return; - } - $yytos = new TP_yyStackEntry; - $yytos->stateno = $yyNewState; - $yytos->major = $yyMajor; - $yytos->minor = $yypMinor; - $this->yystack[] = $yytos; - if ($this->yyTraceFILE && $this->yyidx > 0) { - fprintf($this->yyTraceFILE, "%sShift %d\n", $this->yyTracePrompt, $yyNewState); - fprintf($this->yyTraceFILE, "%sStack:", $this->yyTracePrompt); - for ($i = 1; $i <= $this->yyidx; $i ++) { - fprintf($this->yyTraceFILE, " %s", $this->yyTokenName[ $this->yystack[ $i ]->major ]); - } - fwrite($this->yyTraceFILE, "\n"); - } - } - - public static $yyRuleInfo = array(array(0 => 61, 1 => 1), array(0 => 62, 1 => 1), array(0 => 62, 1 => 2), - array(0 => 62, 1 => 0), array(0 => 63, 1 => 1), array(0 => 63, 1 => 1), - array(0 => 63, 1 => 1), array(0 => 63, 1 => 1), array(0 => 63, 1 => 1), - array(0 => 66, 1 => 1), array(0 => 66, 1 => 2), array(0 => 63, 1 => 1), - array(0 => 63, 1 => 1), array(0 => 65, 1 => 2), array(0 => 65, 1 => 3), - array(0 => 67, 1 => 2), array(0 => 67, 1 => 0), array(0 => 68, 1 => 1), - array(0 => 68, 1 => 1), array(0 => 64, 1 => 2), array(0 => 64, 1 => 1), - array(0 => 69, 1 => 2), array(0 => 69, 1 => 3), array(0 => 69, 1 => 2), - array(0 => 69, 1 => 3), array(0 => 69, 1 => 2), array(0 => 69, 1 => 3), - array(0 => 69, 1 => 4), array(0 => 69, 1 => 4), array(0 => 69, 1 => 5), - array(0 => 69, 1 => 5), array(0 => 64, 1 => 1), array(0 => 69, 1 => 3), - array(0 => 69, 1 => 2), array(0 => 69, 1 => 4), array(0 => 69, 1 => 5), - array(0 => 69, 1 => 6), array(0 => 69, 1 => 2), array(0 => 69, 1 => 3), - array(0 => 69, 1 => 2), array(0 => 69, 1 => 3), array(0 => 69, 1 => 8), - array(0 => 78, 1 => 2), array(0 => 78, 1 => 1), array(0 => 69, 1 => 5), - array(0 => 69, 1 => 7), array(0 => 69, 1 => 2), array(0 => 69, 1 => 6), - array(0 => 69, 1 => 8), array(0 => 69, 1 => 6), array(0 => 69, 1 => 8), - array(0 => 69, 1 => 3), array(0 => 69, 1 => 4), array(0 => 69, 1 => 2), - array(0 => 64, 1 => 1), array(0 => 69, 1 => 2), array(0 => 69, 1 => 3), - array(0 => 69, 1 => 4), array(0 => 69, 1 => 5), array(0 => 71, 1 => 2), - array(0 => 71, 1 => 1), array(0 => 71, 1 => 0), array(0 => 81, 1 => 4), - array(0 => 81, 1 => 2), array(0 => 81, 1 => 2), array(0 => 81, 1 => 2), - array(0 => 81, 1 => 2), array(0 => 81, 1 => 2), array(0 => 81, 1 => 4), - array(0 => 77, 1 => 1), array(0 => 77, 1 => 3), array(0 => 76, 1 => 3), - array(0 => 76, 1 => 3), array(0 => 76, 1 => 3), array(0 => 76, 1 => 3), - array(0 => 73, 1 => 1), array(0 => 73, 1 => 1), array(0 => 73, 1 => 3), - array(0 => 73, 1 => 3), array(0 => 73, 1 => 3), array(0 => 73, 1 => 1), - array(0 => 73, 1 => 2), array(0 => 73, 1 => 3), array(0 => 73, 1 => 2), - array(0 => 73, 1 => 3), array(0 => 73, 1 => 3), array(0 => 73, 1 => 3), - array(0 => 73, 1 => 3), array(0 => 82, 1 => 7), array(0 => 82, 1 => 7), - array(0 => 72, 1 => 1), array(0 => 72, 1 => 2), array(0 => 72, 1 => 2), - array(0 => 72, 1 => 2), array(0 => 72, 1 => 2), array(0 => 72, 1 => 1), - array(0 => 72, 1 => 1), array(0 => 72, 1 => 3), array(0 => 72, 1 => 2), - array(0 => 72, 1 => 2), array(0 => 72, 1 => 1), array(0 => 72, 1 => 1), - array(0 => 72, 1 => 3), array(0 => 72, 1 => 1), array(0 => 72, 1 => 1), - array(0 => 72, 1 => 3), array(0 => 72, 1 => 1), array(0 => 72, 1 => 2), - array(0 => 72, 1 => 1), array(0 => 72, 1 => 3), array(0 => 86, 1 => 1), - array(0 => 86, 1 => 1), array(0 => 70, 1 => 1), array(0 => 70, 1 => 1), - array(0 => 70, 1 => 3), array(0 => 70, 1 => 1), array(0 => 70, 1 => 3), - array(0 => 70, 1 => 4), array(0 => 70, 1 => 3), array(0 => 70, 1 => 4), - array(0 => 74, 1 => 2), array(0 => 74, 1 => 2), array(0 => 91, 1 => 2), - array(0 => 91, 1 => 0), array(0 => 92, 1 => 2), array(0 => 92, 1 => 2), - array(0 => 92, 1 => 4), array(0 => 92, 1 => 2), array(0 => 92, 1 => 2), - array(0 => 92, 1 => 4), array(0 => 92, 1 => 3), array(0 => 92, 1 => 5), - array(0 => 92, 1 => 3), array(0 => 92, 1 => 3), array(0 => 92, 1 => 3), - array(0 => 92, 1 => 3), array(0 => 92, 1 => 3), array(0 => 92, 1 => 3), - array(0 => 92, 1 => 2), array(0 => 79, 1 => 1), array(0 => 79, 1 => 1), - array(0 => 79, 1 => 2), array(0 => 93, 1 => 1), array(0 => 93, 1 => 1), - array(0 => 93, 1 => 3), array(0 => 90, 1 => 2), array(0 => 94, 1 => 1), - array(0 => 94, 1 => 2), array(0 => 95, 1 => 3), array(0 => 95, 1 => 3), - array(0 => 95, 1 => 5), array(0 => 95, 1 => 6), array(0 => 95, 1 => 2), - array(0 => 87, 1 => 4), array(0 => 96, 1 => 4), array(0 => 96, 1 => 4), - array(0 => 97, 1 => 3), array(0 => 97, 1 => 1), array(0 => 97, 1 => 0), - array(0 => 75, 1 => 3), array(0 => 75, 1 => 2), array(0 => 98, 1 => 3), - array(0 => 98, 1 => 2), array(0 => 80, 1 => 2), array(0 => 80, 1 => 0), - array(0 => 99, 1 => 2), array(0 => 99, 1 => 2), array(0 => 89, 1 => 1), - array(0 => 89, 1 => 2), array(0 => 89, 1 => 1), array(0 => 89, 1 => 2), - array(0 => 89, 1 => 3), array(0 => 84, 1 => 1), array(0 => 84, 1 => 1), - array(0 => 85, 1 => 1), array(0 => 83, 1 => 3), array(0 => 100, 1 => 1), - array(0 => 100, 1 => 3), array(0 => 100, 1 => 0), array(0 => 101, 1 => 3), - array(0 => 101, 1 => 3), array(0 => 101, 1 => 1), array(0 => 88, 1 => 2), - array(0 => 88, 1 => 3), array(0 => 102, 1 => 2), array(0 => 102, 1 => 1), - array(0 => 103, 1 => 3), array(0 => 103, 1 => 3), array(0 => 103, 1 => 1), - array(0 => 103, 1 => 3), array(0 => 103, 1 => 3), array(0 => 103, 1 => 1), - array(0 => 103, 1 => 1),); - - public static $yyReduceMap = array(0 => 0, 1 => 1, 2 => 2, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, - 17 => 9, 18 => 9, 43 => 9, 66 => 9, 67 => 9, 75 => 9, 76 => 9, 80 => 9, 90 => 9, - 95 => 9, 96 => 9, 101 => 9, 103 => 9, 104 => 9, 108 => 9, 110 => 9, 115 => 9, - 176 => 9, 181 => 9, 10 => 10, 11 => 11, 12 => 12, 13 => 13, 16 => 13, 14 => 14, - 74 => 14, 15 => 15, 91 => 15, 93 => 15, 94 => 15, 122 => 15, 19 => 19, 20 => 20, - 21 => 21, 23 => 21, 25 => 21, 22 => 22, 24 => 22, 26 => 22, 27 => 27, 28 => 27, - 29 => 29, 30 => 30, 31 => 31, 32 => 32, 33 => 33, 34 => 34, 35 => 35, 36 => 36, - 37 => 37, 38 => 38, 40 => 38, 39 => 39, 41 => 41, 42 => 42, 44 => 44, 45 => 45, - 46 => 46, 47 => 47, 49 => 47, 48 => 48, 50 => 48, 51 => 51, 52 => 52, 53 => 53, - 54 => 54, 55 => 55, 56 => 56, 57 => 57, 58 => 58, 59 => 59, 60 => 60, 69 => 60, - 157 => 60, 161 => 60, 165 => 60, 166 => 60, 61 => 61, 158 => 61, 164 => 61, - 62 => 62, 63 => 63, 64 => 63, 65 => 65, 142 => 65, 68 => 68, 70 => 70, 71 => 71, - 72 => 71, 73 => 73, 77 => 77, 78 => 78, 79 => 78, 81 => 81, 107 => 81, 82 => 82, - 83 => 83, 84 => 84, 85 => 85, 86 => 86, 87 => 86, 88 => 88, 89 => 89, 92 => 92, - 97 => 97, 98 => 98, 99 => 99, 100 => 100, 102 => 102, 105 => 105, 106 => 106, - 109 => 109, 111 => 111, 112 => 112, 113 => 113, 114 => 114, 116 => 116, - 117 => 117, 118 => 118, 119 => 119, 120 => 120, 121 => 121, 123 => 123, - 178 => 123, 124 => 124, 125 => 125, 126 => 126, 127 => 127, 128 => 128, - 129 => 129, 137 => 129, 130 => 130, 131 => 131, 132 => 132, 133 => 132, - 135 => 132, 136 => 132, 134 => 134, 138 => 138, 139 => 139, 140 => 140, - 182 => 140, 141 => 141, 143 => 143, 144 => 144, 145 => 145, 146 => 146, - 147 => 147, 148 => 148, 149 => 149, 150 => 150, 151 => 151, 152 => 152, - 153 => 153, 154 => 154, 155 => 155, 156 => 156, 159 => 159, 160 => 160, - 162 => 162, 163 => 163, 167 => 167, 168 => 168, 169 => 169, 170 => 170, - 171 => 171, 172 => 172, 173 => 173, 174 => 174, 175 => 175, 177 => 177, - 179 => 179, 180 => 180, 183 => 183, 184 => 184, 185 => 185, 186 => 186, - 187 => 186, 189 => 186, 188 => 188, 190 => 190, 191 => 191, 192 => 192,); - - #line 225 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r0() - { - $this->root_buffer->prepend_array($this, $this->template_prefix); - $this->root_buffer->append_array($this, $this->template_postfix); - $this->_retvalue = $this->root_buffer->to_smarty_php($this); - } - - #line 235 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r1() - { - if ($this->yystack[ $this->yyidx + 0 ]->minor != null) { - $this->current_buffer->append_subtree($this, $this->yystack[ $this->yyidx + 0 ]->minor); - } - } - - #line 242 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r2() - { - if ($this->yystack[ $this->yyidx + 0 ]->minor != null) { - // because of possible code injection - $this->current_buffer->append_subtree($this, $this->yystack[ $this->yyidx + 0 ]->minor); - } - } - - #line 256 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r4() - { - if ($this->compiler->has_code) { - $this->_retvalue = $this->mergePrefixCode($this->yystack[ $this->yyidx + 0 ]->minor); - } else { - $this->_retvalue = null; - } - $this->compiler->has_variable_string = false; - $this->block_nesting_level = count($this->compiler->_tag_stack); - } - - #line 267 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r5() - { - $this->_retvalue = new Smarty_Internal_ParseTree_Text($this->yystack[ $this->yyidx + 0 ]->minor); - } - - #line 271 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r6() - { - $code = $this->compiler->compileTag('private_php', - array(array('code' => $this->yystack[ $this->yyidx + 0 ]->minor), - array('type' => $this->lex->phpType)), array()); - if ($this->compiler->has_code && !empty($code)) { - $tmp = ''; - foreach ($this->compiler->prefix_code as $code) { - $tmp .= $code; - } - $this->compiler->prefix_code = array(); - $this->_retvalue = - new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp . $code, true)); - } else { - $this->_retvalue = null; - } - } - - #line 282 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r7() - { - $this->compiler->tag_nocache = true; - $save = $this->template->compiled->has_nocache_code; - $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, - $this->compiler->processNocacheCode("yystack[$this->yyidx + 0]->minor}';?>\n", - $this->compiler, - true)); - $this->template->compiled->has_nocache_code = $save; - } - - #line 289 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r8() - { - $this->_retvalue = $this->compiler->processText($this->yystack[ $this->yyidx + 0 ]->minor); - } - - #line 293 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r9() - { - $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 297 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r10() - { - $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 302 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r11() - { - $this->strip = true; - } - - #line 306 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r12() - { - $this->strip = false; - } - - #line 311 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r13() - { - $this->_retvalue = ''; - } - - #line 315 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r14() - { - $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor; - } - - #line 319 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r15() - { - $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 335 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r19() - { - $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor; - } - - #line 341 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r20() - { - $var = - trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->lex->ldel_length, - $this->lex->rdel_length), - ' $'); - if (preg_match('/^(.*)(\s+nocache)$/', $var, $match)) { - $this->_retvalue = $this->compiler->compileTag('private_print_expression', array('nocache'), - array('value' => $this->compiler->compileVariable('\'' . - $match[ 1 ] . - '\''))); - } else { - $this->_retvalue = $this->compiler->compileTag('private_print_expression', array(), - array('value' => $this->compiler->compileVariable('\'' . - $var . - '\''))); - } - } - - #line 351 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r21() - { - $this->_retvalue = $this->compiler->compileTag('private_print_expression', array(), - array('value' => $this->yystack[ $this->yyidx + 0 ]->minor)); - } - - #line 355 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r22() - { - $this->_retvalue = - $this->compiler->compileTag('private_print_expression', $this->yystack[ $this->yyidx + 0 ]->minor, - array('value' => $this->yystack[ $this->yyidx + - 1 ]->minor)); - } - - #line 378 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r27() - { - $this->_retvalue = $this->compiler->compileTag('assign', array(array('value' => $this->yystack[ $this->yyidx + - 0 ]->minor), array('var' => '\'' . substr($this->yystack[ $this->yyidx + - 2 ]->minor, 1) . '\''))); - } - - #line 386 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r29() - { - $this->_retvalue = $this->compiler->compileTag('assign', - array_merge(array(array('value' => $this->yystack[ $this->yyidx + - - 1 ]->minor), array('var' => '\'' . - substr($this->yystack[ $this->yyidx + - 3 ]->minor, 1) . - '\'')), $this->yystack[ $this->yyidx + 0 ]->minor)); - } - - #line 390 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r30() - { - $this->_retvalue = $this->compiler->compileTag('assign', - array_merge(array(array('value' => $this->yystack[ $this->yyidx + - - 1 ]->minor), array('var' => $this->yystack[ $this->yyidx + - - 3 ]->minor[ 'var' ])), - $this->yystack[ $this->yyidx + 0 ]->minor), - array('smarty_internal_index' => $this->yystack[ $this->yyidx + - - 3 ]->minor[ 'smarty_internal_index' ])); - } - - #line 395 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r31() - { - $tag = - trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->lex->ldel_length, - $this->lex->rdel_length)); - if ($tag == 'strip') { - $this->strip = true; - $this->_retvalue = null;; - } else { - if (defined($tag)) { - if ($this->security) { - $this->security->isTrustedConstant($tag, $this->compiler); - } - $this->_retvalue = - $this->compiler->compileTag('private_print_expression', array(), array('value' => $tag)); - } else { - if (preg_match('/^(.*)(\s+nocache)$/', $tag, $match)) { - $this->_retvalue = $this->compiler->compileTag($match[ 1 ], array("'nocache'")); - } else { - $this->_retvalue = $this->compiler->compileTag($tag, array()); - } - } - } - } - - #line 417 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r32() - { - if (defined($this->yystack[ $this->yyidx + - 1 ]->minor)) { - if ($this->security) { - $this->security->isTrustedConstant($this->yystack[ $this->yyidx + - 1 ]->minor, $this->compiler); - } - $this->_retvalue = - $this->compiler->compileTag('private_print_expression', $this->yystack[ $this->yyidx + 0 ]->minor, - array('value' => $this->yystack[ $this->yyidx + - 1 ]->minor)); - } else { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + - 1 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor); - } - } - - #line 427 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r33() - { - if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { - if ($this->security) { - $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler); - } - $this->_retvalue = $this->compiler->compileTag('private_print_expression', array(), - array('value' => $this->yystack[ $this->yyidx + 0 ]->minor)); - } else { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + 0 ]->minor, array()); - } - } - - #line 440 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r34() - { - if (defined($this->yystack[ $this->yyidx + - 2 ]->minor)) { - if ($this->security) { - $this->security->isTrustedConstant($this->yystack[ $this->yyidx + - 2 ]->minor, $this->compiler); - } - $this->_retvalue = - $this->compiler->compileTag('private_print_expression', $this->yystack[ $this->yyidx + 0 ]->minor, - array('value' => $this->yystack[ $this->yyidx + - 2 ]->minor, - 'modifierlist' => $this->yystack[ $this->yyidx + - 1 ]->minor)); - } else { - $this->_retvalue = '' . - $this->compiler->compileTag($this->yystack[ $this->yyidx + - 2 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor) . '_retvalue .= $this->compiler->compileTag('private_modifier', array(), - array('modifierlist' => $this->yystack[ $this->yyidx + - - 1 ]->minor, 'value' => 'ob_get_clean()')) . ';?>'; - } - } - - #line 453 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r35() - { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + - 3 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor, - array('object_method' => $this->yystack[ $this->yyidx + - - 1 ]->minor)); - } - - #line 458 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r36() - { - $this->_retvalue = '' . - $this->compiler->compileTag($this->yystack[ $this->yyidx + - 4 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor, - array('object_method' => $this->yystack[ $this->yyidx + - 2 ]->minor)) . - '_retvalue .= $this->compiler->compileTag('private_modifier', array(), - array('modifierlist' => $this->yystack[ $this->yyidx + - - 1 ]->minor, 'value' => 'ob_get_clean()')) . ';?>'; - } - - #line 464 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r37() - { - $tag = trim(substr($this->yystack[ $this->yyidx + - 1 ]->minor, $this->lex->ldel_length)); - $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, array(), - array('if condition' => $this->yystack[ $this->yyidx + - 0 ]->minor)); - } - - #line 469 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r38() - { - $tag = trim(substr($this->yystack[ $this->yyidx + - 2 ]->minor, $this->lex->ldel_length)); - $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, - $this->yystack[ $this->yyidx + 0 ]->minor, - array('if condition' => $this->yystack[ $this->yyidx + - - 1 ]->minor)); - } - - #line 474 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r39() - { - $tag = trim(substr($this->yystack[ $this->yyidx + - 1 ]->minor, $this->lex->ldel_length)); - $this->_retvalue = $this->compiler->compileTag(($tag == 'else if') ? 'elseif' : $tag, array(), - array('if condition' => $this->yystack[ $this->yyidx + - 0 ]->minor)); - } - - #line 485 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r41() - { - $this->_retvalue = $this->compiler->compileTag('for', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, - array(array('start' => $this->yystack[ $this->yyidx + - - 6 ]->minor), - array('ifexp' => $this->yystack[ $this->yyidx + - - 4 ]->minor), - array('var' => $this->yystack[ $this->yyidx + - - 2 ]->minor), - array('step' => $this->yystack[ $this->yyidx + - - 1 ]->minor))), 1); - } - - #line 489 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r42() - { - $this->_retvalue = '=' . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 497 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r44() - { - $this->_retvalue = $this->compiler->compileTag('for', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, - array(array('start' => $this->yystack[ $this->yyidx + - - 3 ]->minor), - array('to' => $this->yystack[ $this->yyidx + - - 1 ]->minor))), 0); - } - - #line 501 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r45() - { - $this->_retvalue = $this->compiler->compileTag('for', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, - array(array('start' => $this->yystack[ $this->yyidx + - - 5 ]->minor), - array('to' => $this->yystack[ $this->yyidx + - - 3 ]->minor), - array('step' => $this->yystack[ $this->yyidx + - - 1 ]->minor))), 0); - } - - #line 506 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r46() - { - $this->_retvalue = $this->compiler->compileTag('foreach', $this->yystack[ $this->yyidx + 0 ]->minor); - } - - #line 511 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r47() - { - $this->_retvalue = $this->compiler->compileTag('foreach', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, - array(array('from' => $this->yystack[ $this->yyidx + - - 3 ]->minor), - array('item' => $this->yystack[ $this->yyidx + - - 1 ]->minor)))); - } - - #line 515 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r48() - { - $this->_retvalue = $this->compiler->compileTag('foreach', array_merge($this->yystack[ $this->yyidx + 0 ]->minor, - array(array('from' => $this->yystack[ $this->yyidx + - - 5 ]->minor), - array('item' => $this->yystack[ $this->yyidx + - - 1 ]->minor), - array('key' => $this->yystack[ $this->yyidx + - - 3 ]->minor)))); - } - - #line 528 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r51() - { - $this->_retvalue = $this->compiler->compileTag('setfilter', array(), - array('modifier_list' => array(array_merge(array($this->yystack[ $this->yyidx + - - 1 ]->minor), $this->yystack[ $this->yyidx + 0 ]->minor)))); - } - - #line 532 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r52() - { - $this->_retvalue = $this->compiler->compileTag('setfilter', array(), - array('modifier_list' => array_merge(array(array_merge(array($this->yystack[ $this->yyidx + - - 2 ]->minor), $this->yystack[ $this->yyidx + - 1 ]->minor)), - $this->yystack[ $this->yyidx + - 0 ]->minor))); - } - - #line 537 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r53() - { - $j = strrpos($this->yystack[ $this->yyidx + 0 ]->minor, '.'); - if ($this->yystack[ $this->yyidx + 0 ]->minor[ $j + 1 ] == 'c') { - // {$smarty.block.child} - $this->_retvalue = SMARTY_INTERNAL_COMPILE_BLOCK::compileChildBlock($this->compiler); - } else { - // {$smarty.block.parent} - $this->_retvalue = SMARTY_INTERNAL_COMPILE_BLOCK::compileParentBlock($this->compiler); - } - } - - #line 550 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r54() - { - $tag = - trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->lex->ldel_length, - $this->lex->rdel_length), - ' /'); - if ($tag == 'strip') { - $this->strip = false; - $this->_retvalue = null; - } else { - $this->_retvalue = $this->compiler->compileTag($tag . 'close', array()); - } - } - - #line 559 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r55() - { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + 0 ]->minor . 'close', array()); - } - - #line 563 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r56() - { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + - 1 ]->minor . 'close', array(), - array('modifier_list' => $this->yystack[ $this->yyidx + - 0 ]->minor)); - } - - #line 568 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r57() - { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + - 2 ]->minor . 'close', array(), - array('object_method' => $this->yystack[ $this->yyidx + - 0 ]->minor)); - } - - #line 572 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r58() - { - $this->_retvalue = $this->compiler->compileTag($this->yystack[ $this->yyidx + - 3 ]->minor . 'close', array(), - array('object_method' => $this->yystack[ $this->yyidx + - - 1 ]->minor, 'modifier_list' => $this->yystack[ $this->yyidx + - 0 ]->minor)); - } - - #line 580 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r59() - { - $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor; - $this->_retvalue[] = $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 586 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r60() - { - $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor); - } - - #line 591 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r61() - { - $this->_retvalue = array(); - } - - #line 596 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r62() - { - if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { - if ($this->security) { - $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler); - } - $this->_retvalue = - array($this->yystack[ $this->yyidx + - 2 ]->minor => $this->yystack[ $this->yyidx + 0 ]->minor); - } else { - $this->_retvalue = - array($this->yystack[ $this->yyidx + - 2 ]->minor => '\'' . $this->yystack[ $this->yyidx + 0 ]->minor . - '\''); - } - } - - #line 607 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r63() - { - $this->_retvalue = - array(trim($this->yystack[ $this->yyidx + - 1 ]->minor, " =\n\r\t") => $this->yystack[ $this->yyidx + - 0 ]->minor); - } - - #line 615 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r65() - { - $this->_retvalue = '\'' . $this->yystack[ $this->yyidx + 0 ]->minor . '\''; - } - - #line 627 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r68() - { - $this->_retvalue = - array($this->yystack[ $this->yyidx + - 2 ]->minor => $this->yystack[ $this->yyidx + 0 ]->minor); - } - - #line 640 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r70() - { - $this->yystack[ $this->yyidx + - 2 ]->minor[] = $this->yystack[ $this->yyidx + 0 ]->minor; - $this->_retvalue = $this->yystack[ $this->yyidx + - 2 ]->minor; - } - - #line 645 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r71() - { - $this->_retvalue = array('var' => '\'' . substr($this->yystack[ $this->yyidx + - 2 ]->minor, 1) . '\'', - 'value' => $this->yystack[ $this->yyidx + 0 ]->minor); - } - - #line 652 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r73() - { - $this->_retvalue = array('var' => $this->yystack[ $this->yyidx + - 2 ]->minor, - 'value' => $this->yystack[ $this->yyidx + 0 ]->minor); - } - - #line 676 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r77() - { - $this->_retvalue = - '$_smarty_tpl->getStreamVariable(\'' . substr($this->yystack[ $this->yyidx + - 2 ]->minor, 1) . '://' . - $this->yystack[ $this->yyidx + 0 ]->minor . '\')'; - } - - #line 681 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r78() - { - $this->_retvalue = - $this->yystack[ $this->yyidx + - 2 ]->minor . trim($this->yystack[ $this->yyidx + - 1 ]->minor) . - $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 695 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r81() - { - $this->_retvalue = $this->compiler->compileTag('private_modifier', array(), - array('value' => $this->yystack[ $this->yyidx + - 1 ]->minor, - 'modifierlist' => $this->yystack[ $this->yyidx + - 0 ]->minor)); - } - - #line 701 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r82() - { - $this->_retvalue = (isset($this->yystack[ $this->yyidx + - 1 ]->minor[ 'pre' ]) ? - $this->yystack[ $this->yyidx + - 1 ]->minor[ 'pre' ] : '') . - $this->yystack[ $this->yyidx + - 2 ]->minor . $this->yystack[ $this->yyidx + - 1 ]->minor[ 'op' ] . - $this->yystack[ $this->yyidx + 0 ]->minor . - (isset($this->yystack[ $this->yyidx + - 1 ]->minor[ 'pre' ]) ? ')' : ''); - } - - #line 704 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r83() - { - $this->_retvalue = - $this->yystack[ $this->yyidx + 0 ]->minor . $this->yystack[ $this->yyidx + - 1 ]->minor . ')'; - } - - #line 708 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r84() - { - $this->_retvalue = 'in_array(' . $this->yystack[ $this->yyidx + - 2 ]->minor . ',' . - $this->yystack[ $this->yyidx + 0 ]->minor . ')'; - } - - #line 712 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r85() - { - $this->_retvalue = 'in_array(' . $this->yystack[ $this->yyidx + - 2 ]->minor . ',(array)' . - $this->yystack[ $this->yyidx + 0 ]->minor . ')'; - } - - #line 716 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r86() - { - $this->_retvalue = $this->yystack[ $this->yyidx + - 2 ]->minor . $this->yystack[ $this->yyidx + - 1 ]->minor . - $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 728 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r88() - { - $this->_retvalue = $this->yystack[ $this->yyidx + - 5 ]->minor . ' ? ' . - $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + - 2 ]->minor, 1) . '\'') . - ' : ' . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 732 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r89() - { - $this->_retvalue = - $this->yystack[ $this->yyidx + - 5 ]->minor . ' ? ' . $this->yystack[ $this->yyidx + - 2 ]->minor . ' : ' . - $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 747 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r92() - { - $this->_retvalue = '!' . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 768 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r97() - { - $this->_retvalue = - $this->yystack[ $this->yyidx + - 2 ]->minor . '.' . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 772 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r98() - { - $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor . '.'; - } - - #line 776 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r99() - { - $this->_retvalue = '.' . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 781 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r100() - { - if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { - if ($this->security) { - $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler); - } - $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; - } else { - $this->_retvalue = '\'' . $this->yystack[ $this->yyidx + 0 ]->minor . '\''; - } - } - - #line 798 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r102() - { - $this->_retvalue = "(" . $this->yystack[ $this->yyidx + - 1 ]->minor . ")"; - } - - #line 813 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r105() - { - self::$prefix_number ++; - if ($this->yystack[ $this->yyidx + - 2 ]->minor[ 'var' ] == '\'smarty\'') { - $this->compiler->prefix_code[] = 'compiler->compileTag('private_special_variable', array(), - $this->yystack[ $this->yyidx + - 2 ]->minor[ 'smarty_internal_index' ]) . - ';?>'; - } else { - $this->compiler->prefix_code[] = 'compiler->compileVariable($this->yystack[ $this->yyidx + - 2 ]->minor[ 'var' ]) . - $this->yystack[ $this->yyidx + - 2 ]->minor[ 'smarty_internal_index' ] . ';?>'; - } - $this->_retvalue = '$_tmp' . self::$prefix_number . '::' . $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . - $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]; - } - - #line 824 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r106() - { - self::$prefix_number ++; - $tmp = $this->compiler->appendCode('', $this->yystack[ $this->yyidx + 0 ]->minor); - $this->compiler->prefix_code[] = - $this->compiler->appendCode($tmp, ''); - $this->_retvalue = '$_tmp' . self::$prefix_number; - } - - #line 841 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r109() - { - if (!in_array(strtolower($this->yystack[ $this->yyidx + - 2 ]->minor), array('self', 'parent')) && - (!$this->security || - $this->security->isTrustedStaticClassAccess($this->yystack[ $this->yyidx + - 2 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler)) - ) { - if (isset($this->smarty->registered_classes[ $this->yystack[ $this->yyidx + - 2 ]->minor ])) { - $this->_retvalue = - $this->smarty->registered_classes[ $this->yystack[ $this->yyidx + - 2 ]->minor ] . '::' . - $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]; - } else { - $this->_retvalue = $this->yystack[ $this->yyidx + - 2 ]->minor . '::' . - $this->yystack[ $this->yyidx + 0 ]->minor[ 0 ] . $this->yystack[ $this->yyidx + 0 ]->minor[ 1 ]; - } - } else { - $this->compiler->trigger_template_error("static class '" . $this->yystack[ $this->yyidx + - 2 ]->minor . - "' is undefined or not allowed by security setting"); - } - } - - #line 860 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r111() - { - $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 871 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r112() - { - $this->_retvalue = - $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\''); - } - - #line 874 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r113() - { - if ($this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ] == '\'smarty\'') { - $smarty_var = $this->compiler->compileTag('private_special_variable', array(), - $this->yystack[ $this->yyidx + - 0 ]->minor[ 'smarty_internal_index' ]); - $this->_retvalue = $smarty_var; - } else { - // used for array reset,next,prev,end,current - $this->last_variable = $this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ]; - $this->last_index = $this->yystack[ $this->yyidx + 0 ]->minor[ 'smarty_internal_index' ]; - $this->_retvalue = $this->compiler->compileVariable($this->yystack[ $this->yyidx + 0 ]->minor[ 'var' ]) . - $this->yystack[ $this->yyidx + 0 ]->minor[ 'smarty_internal_index' ]; - } - } - - #line 887 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r114() - { - $this->_retvalue = '$_smarty_tpl->tpl_vars[' . $this->yystack[ $this->yyidx + - 2 ]->minor . ']->' . - $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 897 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r116() - { - $this->_retvalue = - $this->compiler->compileConfigVariable("'" . $this->yystack[ $this->yyidx + - 1 ]->minor . "'"); - } - - #line 901 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r117() - { - $this->_retvalue = '(is_array($tmp = ' . - $this->compiler->compileConfigVariable("'" . $this->yystack[ $this->yyidx + - 2 ]->minor . "'") . - ') ? $tmp' . $this->yystack[ $this->yyidx + 0 ]->minor . ' :null)'; - } - - #line 905 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r118() - { - $this->_retvalue = $this->compiler->compileConfigVariable($this->yystack[ $this->yyidx + - 1 ]->minor); - } - - #line 909 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r119() - { - $this->_retvalue = - '(is_array($tmp = ' . $this->compiler->compileConfigVariable($this->yystack[ $this->yyidx + - 2 ]->minor) . - ') ? $tmp' . $this->yystack[ $this->yyidx + 0 ]->minor . ' : null)'; - } - - #line 913 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r120() - { - $this->_retvalue = array('var' => '\'' . substr($this->yystack[ $this->yyidx + - 1 ]->minor, 1) . '\'', - 'smarty_internal_index' => $this->yystack[ $this->yyidx + 0 ]->minor); - } - - #line 916 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r121() - { - $this->_retvalue = array('var' => $this->yystack[ $this->yyidx + - 1 ]->minor, - 'smarty_internal_index' => $this->yystack[ $this->yyidx + 0 ]->minor); - } - - #line 929 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r123() - { - return; - } - - #line 935 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r124() - { - $this->_retvalue = - '[' . $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\'') . - ']'; - } - - #line 938 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r125() - { - $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + 0 ]->minor) . ']'; - } - - #line 942 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r126() - { - $this->_retvalue = '[' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + - 2 ]->minor) . '->' . - $this->yystack[ $this->yyidx + 0 ]->minor . ']'; - } - - #line 946 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r127() - { - if (defined($this->yystack[ $this->yyidx + 0 ]->minor)) { - if ($this->security) { - $this->security->isTrustedConstant($this->yystack[ $this->yyidx + 0 ]->minor, $this->compiler); - } - $this->_retvalue = '[' . $this->yystack[ $this->yyidx + 0 ]->minor . ']'; - } else { - $this->_retvalue = "['" . $this->yystack[ $this->yyidx + 0 ]->minor . "']"; - } - } - - #line 957 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r128() - { - $this->_retvalue = '[' . $this->yystack[ $this->yyidx + 0 ]->minor . ']'; - } - - #line 962 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r129() - { - $this->_retvalue = '[' . $this->yystack[ $this->yyidx + - 1 ]->minor . ']'; - } - - #line 967 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r130() - { - $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable', array(), '[\'section\'][\'' . - $this->yystack[ $this->yyidx + - - 1 ]->minor . - '\'][\'index\']') . ']'; - } - - #line 971 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r131() - { - $this->_retvalue = '[' . $this->compiler->compileTag('private_special_variable', array(), '[\'section\'][\'' . - $this->yystack[ $this->yyidx + - - 3 ]->minor . '\'][\'' . - $this->yystack[ $this->yyidx + - - 1 ]->minor . '\']') . ']'; - } - - #line 974 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r132() - { - $this->_retvalue = '[' . $this->yystack[ $this->yyidx + - 1 ]->minor . ']'; - } - - #line 980 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r134() - { - $this->_retvalue = '[' . - $this->compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + - 1 ]->minor, 1) . '\'') . - ']';; - } - - #line 996 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r138() - { - $this->_retvalue = '[]'; - } - - #line 1006 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r139() - { - $this->_retvalue = '\'' . substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . '\''; - } - - #line 1010 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r140() - { - $this->_retvalue = "''"; - } - - #line 1015 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r141() - { - $this->_retvalue = - $this->yystack[ $this->yyidx + - 1 ]->minor . '.' . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 1023 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r143() - { - $var = - trim(substr($this->yystack[ $this->yyidx + 0 ]->minor, $this->lex->ldel_length, - $this->lex->rdel_length), - ' $'); - $this->_retvalue = $this->compiler->compileVariable('\'' . $var . '\''); - } - - #line 1029 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r144() - { - $this->_retvalue = '(' . $this->yystack[ $this->yyidx + - 1 ]->minor . ')'; - } - - #line 1036 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r145() - { - if ($this->yystack[ $this->yyidx + - 1 ]->minor[ 'var' ] == '\'smarty\'') { - $this->_retvalue = $this->compiler->compileTag('private_special_variable', array(), - $this->yystack[ $this->yyidx + - - 1 ]->minor[ 'smarty_internal_index' ]) . - $this->yystack[ $this->yyidx + 0 ]->minor; - } else { - $this->_retvalue = $this->compiler->compileVariable($this->yystack[ $this->yyidx + - 1 ]->minor[ 'var' ]) . - $this->yystack[ $this->yyidx + - 1 ]->minor[ 'smarty_internal_index' ] . - $this->yystack[ $this->yyidx + 0 ]->minor; - } - } - - #line 1045 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r146() - { - $this->_retvalue = $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 1050 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r147() - { - $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 1055 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r148() - { - if ($this->security && substr($this->yystack[ $this->yyidx + - 1 ]->minor, 0, 1) == '_') { - $this->compiler->trigger_template_error(self::Err1); - } - $this->_retvalue = - '->' . $this->yystack[ $this->yyidx + - 1 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 1062 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r149() - { - if ($this->security) { - $this->compiler->trigger_template_error(self::Err2); - } - $this->_retvalue = '->{' . $this->compiler->compileVariable($this->yystack[ $this->yyidx + - 1 ]->minor) . - $this->yystack[ $this->yyidx + 0 ]->minor . '}'; - } - - #line 1069 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r150() - { - if ($this->security) { - $this->compiler->trigger_template_error(self::Err2); - } - $this->_retvalue = - '->{' . $this->yystack[ $this->yyidx + - 2 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor . '}'; - } - - #line 1076 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r151() - { - if ($this->security) { - $this->compiler->trigger_template_error(self::Err2); - } - $this->_retvalue = '->{\'' . $this->yystack[ $this->yyidx + - 4 ]->minor . '\'.' . - $this->yystack[ $this->yyidx + - 2 ]->minor . $this->yystack[ $this->yyidx + 0 ]->minor . '}'; - } - - #line 1084 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r152() - { - $this->_retvalue = '->' . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 1092 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r153() - { - if (!$this->security || - $this->security->isTrustedPhpFunction($this->yystack[ $this->yyidx + - 3 ]->minor, $this->compiler) - ) { - if (strcasecmp($this->yystack[ $this->yyidx + - 3 ]->minor, 'isset') === 0 || - strcasecmp($this->yystack[ $this->yyidx + - 3 ]->minor, 'empty') === 0 || - strcasecmp($this->yystack[ $this->yyidx + - 3 ]->minor, 'array') === 0 || - is_callable($this->yystack[ $this->yyidx + - 3 ]->minor) - ) { - $func_name = strtolower($this->yystack[ $this->yyidx + - 3 ]->minor); - if ($func_name == 'isset') { - if (count($this->yystack[ $this->yyidx + - 1 ]->minor) == 0) { - $this->compiler->trigger_template_error('Illegal number of paramer in "isset()"'); - } - $par = implode(',', $this->yystack[ $this->yyidx + - 1 ]->minor); - if (strncasecmp($par, '$_smarty_tpl->smarty->ext->_config->_getConfigVariable', - strlen('$_smarty_tpl->smarty->ext->_config->_getConfigVariable')) === 0 - ) { - self::$prefix_number ++; - $this->compiler->prefix_code[] = - ''; - $isset_par = '$_tmp' . self::$prefix_number; - } else { - $isset_par = str_replace("')->value", "',null,true,false)->value", $par); - } - $this->_retvalue = $this->yystack[ $this->yyidx + - 3 ]->minor . "(" . $isset_par . ")"; - } elseif (in_array($func_name, array('empty', 'reset', 'current', 'end', 'prev', 'next'))) { - if (count($this->yystack[ $this->yyidx + - 1 ]->minor) != 1) { - $this->compiler->trigger_template_error('Illegal number of paramer in "empty()"'); - } - if ($func_name == 'empty') { - $this->_retvalue = $func_name . '(' . str_replace("')->value", "',null,true,false)->value", - $this->yystack[ $this->yyidx + - - 1 ]->minor[ 0 ]) . ')'; - } else { - $this->_retvalue = $func_name . '(' . $this->yystack[ $this->yyidx + - 1 ]->minor[ 0 ] . ')'; - } - } else { - $this->_retvalue = $this->yystack[ $this->yyidx + - 3 ]->minor . "(" . - implode(',', $this->yystack[ $this->yyidx + - 1 ]->minor) . ")"; - } - } else { - $this->compiler->trigger_template_error("unknown function \"" . - $this->yystack[ $this->yyidx + - 3 ]->minor . "\""); - } - } - } - - #line 1131 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r154() - { - if ($this->security && substr($this->yystack[ $this->yyidx + - 3 ]->minor, 0, 1) == '_') { - $this->compiler->trigger_template_error(self::Err1); - } - $this->_retvalue = $this->yystack[ $this->yyidx + - 3 ]->minor . "(" . - implode(',', $this->yystack[ $this->yyidx + - 1 ]->minor) . ")"; - } - - #line 1138 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r155() - { - if ($this->security) { - $this->compiler->trigger_template_error(self::Err2); - } - self::$prefix_number ++; - $this->compiler->prefix_code[] = 'compiler->compileVariable('\'' . substr($this->yystack[ $this->yyidx + - 3 ]->minor, 1) . '\'') . - ';?>'; - $this->_retvalue = - '$_tmp' . self::$prefix_number . '(' . implode(',', $this->yystack[ $this->yyidx + - 1 ]->minor) . ')'; - } - - #line 1149 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r156() - { - $this->_retvalue = - array_merge($this->yystack[ $this->yyidx + - 2 ]->minor, array($this->yystack[ $this->yyidx + 0 ]->minor)); - } - - #line 1166 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r159() - { - $this->_retvalue = array_merge($this->yystack[ $this->yyidx + - 2 ]->minor, - array(array_merge($this->yystack[ $this->yyidx + - 1 ]->minor, - $this->yystack[ $this->yyidx + 0 ]->minor))); - } - - #line 1170 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r160() - { - $this->_retvalue = - array(array_merge($this->yystack[ $this->yyidx + - 1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor)); - } - - #line 1178 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r162() - { - $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor); - } - - #line 1186 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r163() - { - $this->_retvalue = - array_merge($this->yystack[ $this->yyidx + - 1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor); - } - - #line 1205 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r167() - { - $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor, '', 'method'); - } - - #line 1210 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r168() - { - $this->_retvalue = - array($this->yystack[ $this->yyidx + - 1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, 'method'); - } - - #line 1215 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r169() - { - $this->_retvalue = array($this->yystack[ $this->yyidx + 0 ]->minor, ''); - } - - #line 1220 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r170() - { - $this->_retvalue = - array($this->yystack[ $this->yyidx + - 1 ]->minor, $this->yystack[ $this->yyidx + 0 ]->minor, 'property'); - } - - #line 1225 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r171() - { - $this->_retvalue = array($this->yystack[ $this->yyidx + - 2 ]->minor, - $this->yystack[ $this->yyidx + - 1 ]->minor . - $this->yystack[ $this->yyidx + 0 ]->minor, 'property'); - } - - #line 1231 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r172() - { - $this->_retvalue[ 'op' ] = ' ' . trim($this->yystack[ $this->yyidx + 0 ]->minor) . ' '; - } - - #line 1235 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r173() - { - static $lops = array('eq' => array('op' => ' == ', 'pre' => null), - 'ne' => array('op' => ' != ', 'pre' => null), - 'neq' => array('op' => ' != ', 'pre' => null), - 'gt' => array('op' => ' > ', 'pre' => null), - 'ge' => array('op' => ' >= ', 'pre' => null), - 'gte' => array('op' => ' >= ', 'pre' => null), - 'lt' => array('op' => ' < ', 'pre' => null), - 'le' => array('op' => ' <= ', 'pre' => null), - 'lte' => array('op' => ' <= ', 'pre' => null), - 'mod' => array('op' => ' % ', 'pre' => null), - 'and' => array('op' => ' && ', 'pre' => null), - 'or' => array('op' => ' || ', 'pre' => null), - 'xor' => array('op' => ' xor ', 'pre' => null), - 'isdivby' => array('op' => ' % ', 'pre' => '!('), - 'isnotdivby' => array('op' => ' % ', 'pre' => '('), - 'isevenby' => array('op' => ' / ', 'pre' => '!(1 & '), - 'isnotevenby' => array('op' => ' / ', 'pre' => '(1 & '), - 'isoddby' => array('op' => ' / ', 'pre' => '(1 & '), - 'isnotoddby' => array('op' => ' / ', 'pre' => '!(1 & '),); - $op = strtolower(preg_replace('/\s*/', '', $this->yystack[ $this->yyidx + 0 ]->minor)); - $this->_retvalue = $lops[ $op ]; - } - - #line 1261 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r174() - { - static $scond = - array('iseven' => '!(1 & ', 'isnoteven' => '(1 & ', 'isodd' => '(1 & ', 'isnotodd' => '!(1 & ',); - $op = strtolower(str_replace(' ', '', $this->yystack[ $this->yyidx + 0 ]->minor)); - $this->_retvalue = $scond[ $op ]; - } - - #line 1275 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r175() - { - $this->_retvalue = 'array(' . $this->yystack[ $this->yyidx + - 1 ]->minor . ')'; - } - - #line 1283 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r177() - { - $this->_retvalue = - $this->yystack[ $this->yyidx + - 2 ]->minor . ',' . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 1291 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r179() - { - $this->_retvalue = - $this->yystack[ $this->yyidx + - 2 ]->minor . '=>' . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 1295 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r180() - { - $this->_retvalue = - '\'' . $this->yystack[ $this->yyidx + - 2 ]->minor . '\'=>' . $this->yystack[ $this->yyidx + 0 ]->minor; - } - - #line 1311 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r183() - { - $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor->to_smarty_php($this); - } - - #line 1316 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r184() - { - $this->yystack[ $this->yyidx + - 1 ]->minor->append_subtree($this, $this->yystack[ $this->yyidx + 0 ]->minor); - $this->_retvalue = $this->yystack[ $this->yyidx + - 1 ]->minor; - } - - #line 1321 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r185() - { - $this->_retvalue = new Smarty_Internal_ParseTree_Dq($this, $this->yystack[ $this->yyidx + 0 ]->minor); - } - - #line 1325 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r186() - { - $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)' . $this->yystack[ $this->yyidx + - 1 ]->minor); - } - - #line 1333 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r188() - { - $this->_retvalue = new Smarty_Internal_ParseTree_Code('(string)$_smarty_tpl->tpl_vars[\'' . - substr($this->yystack[ $this->yyidx + 0 ]->minor, 1) . - '\']->value'); - } - - #line 1341 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r190() - { - $this->_retvalue = - new Smarty_Internal_ParseTree_Code('(string)(' . $this->yystack[ $this->yyidx + - 1 ]->minor . ')'); - } - - #line 1345 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r191() - { - $this->_retvalue = new Smarty_Internal_ParseTree_Tag($this, $this->yystack[ $this->yyidx + 0 ]->minor); - } - - #line 1349 "../smarty/lexer/smarty_internal_templateparser.y" - function yy_r192() - { - $this->_retvalue = new Smarty_Internal_ParseTree_DqContent($this->yystack[ $this->yyidx + 0 ]->minor); - } - - private $_retvalue; - - public function yy_reduce($yyruleno) - { - if ($this->yyTraceFILE && $yyruleno >= 0 && $yyruleno < count(self::$yyRuleName)) { - fprintf($this->yyTraceFILE, "%sReduce (%d) [%s].\n", $this->yyTracePrompt, $yyruleno, - self::$yyRuleName[ $yyruleno ]); - } - - $this->_retvalue = $yy_lefthand_side = null; - if (isset(self::$yyReduceMap[ $yyruleno ])) { - // call the action - $this->_retvalue = null; - $this->{'yy_r' . self::$yyReduceMap[ $yyruleno ]}(); - $yy_lefthand_side = $this->_retvalue; - } - $yygoto = self::$yyRuleInfo[ $yyruleno ][ 0 ]; - $yysize = self::$yyRuleInfo[ $yyruleno ][ 1 ]; - $this->yyidx -= $yysize; - for ($i = $yysize; $i; $i --) { - // pop all of the right-hand side parameters - array_pop($this->yystack); - } - $yyact = $this->yy_find_reduce_action($this->yystack[ $this->yyidx ]->stateno, $yygoto); - if ($yyact < self::YYNSTATE) { - if (!$this->yyTraceFILE && $yysize) { - $this->yyidx ++; - $x = new TP_yyStackEntry; - $x->stateno = $yyact; - $x->major = $yygoto; - $x->minor = $yy_lefthand_side; - $this->yystack[ $this->yyidx ] = $x; - } else { - $this->yy_shift($yyact, $yygoto, $yy_lefthand_side); - } - } elseif ($yyact == self::YYNSTATE + self::YYNRULE + 1) { - $this->yy_accept(); - } - } - - public function yy_parse_failed() - { - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sFail!\n", $this->yyTracePrompt); - } - while ($this->yyidx >= 0) { - $this->yy_pop_parser_stack(); - } - } - - public function yy_syntax_error($yymajor, $TOKEN) - { - #line 207 "../smarty/lexer/smarty_internal_templateparser.y" - - $this->internalError = true; - $this->yymajor = $yymajor; - $this->compiler->trigger_template_error(); - } - - public function yy_accept() - { - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sAccept!\n", $this->yyTracePrompt); - } - while ($this->yyidx >= 0) { - $this->yy_pop_parser_stack(); - } - #line 200 "../smarty/lexer/smarty_internal_templateparser.y" - - $this->successful = !$this->internalError; - $this->internalError = false; - $this->retvalue = $this->_retvalue; - } - - public function doParse($yymajor, $yytokenvalue) - { - $yyerrorhit = 0; /* True if yymajor has invoked an error */ - - if ($this->yyidx === null || $this->yyidx < 0) { - $this->yyidx = 0; - $this->yyerrcnt = - 1; - $x = new TP_yyStackEntry; - $x->stateno = 0; - $x->major = 0; - $this->yystack = array(); - $this->yystack[] = $x; - } - $yyendofinput = ($yymajor == 0); - - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sInput %s\n", $this->yyTracePrompt, $this->yyTokenName[ $yymajor ]); - } - - do { - $yyact = $this->yy_find_shift_action($yymajor); - if ($yymajor < self::YYERRORSYMBOL && !$this->yy_is_expected_token($yymajor)) { - // force a syntax error - $yyact = self::YY_ERROR_ACTION; - } - if ($yyact < self::YYNSTATE) { - $this->yy_shift($yyact, $yymajor, $yytokenvalue); - $this->yyerrcnt --; - if ($yyendofinput && $this->yyidx >= 0) { - $yymajor = 0; - } else { - $yymajor = self::YYNOCODE; - } - } elseif ($yyact < self::YYNSTATE + self::YYNRULE) { - $this->yy_reduce($yyact - self::YYNSTATE); - } elseif ($yyact == self::YY_ERROR_ACTION) { - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sSyntax Error!\n", $this->yyTracePrompt); - } - if (self::YYERRORSYMBOL) { - if ($this->yyerrcnt < 0) { - $this->yy_syntax_error($yymajor, $yytokenvalue); - } - $yymx = $this->yystack[ $this->yyidx ]->major; - if ($yymx == self::YYERRORSYMBOL || $yyerrorhit) { - if ($this->yyTraceFILE) { - fprintf($this->yyTraceFILE, "%sDiscard input token %s\n", $this->yyTracePrompt, - $this->yyTokenName[ $yymajor ]); - } - $this->yy_destructor($yymajor, $yytokenvalue); - $yymajor = self::YYNOCODE; - } else { - while ($this->yyidx >= 0 && $yymx != self::YYERRORSYMBOL && - ($yyact = $this->yy_find_shift_action(self::YYERRORSYMBOL)) >= self::YYNSTATE) { - $this->yy_pop_parser_stack(); - } - if ($this->yyidx < 0 || $yymajor == 0) { - $this->yy_destructor($yymajor, $yytokenvalue); - $this->yy_parse_failed(); - $yymajor = self::YYNOCODE; - } elseif ($yymx != self::YYERRORSYMBOL) { - $u2 = 0; - $this->yy_shift($yyact, self::YYERRORSYMBOL, $u2); - } - } - $this->yyerrcnt = 3; - $yyerrorhit = 1; - } else { - if ($this->yyerrcnt <= 0) { - $this->yy_syntax_error($yymajor, $yytokenvalue); - } - $this->yyerrcnt = 3; - $this->yy_destructor($yymajor, $yytokenvalue); - if ($yyendofinput) { - $this->yy_parse_failed(); - } - $yymajor = self::YYNOCODE; - } - } else { - $this->yy_accept(); - $yymajor = self::YYNOCODE; - } - } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0); - } -} - diff --git a/library/Smarty/libs/sysplugins/smarty_internal_undefined.php b/library/Smarty/libs/sysplugins/smarty_internal_undefined.php deleted file mode 100644 index 93fca8ec1..000000000 --- a/library/Smarty/libs/sysplugins/smarty_internal_undefined.php +++ /dev/null @@ -1,48 +0,0 @@ -cached->valid = false; - } else { - $tpl->mustCompile = true; - } - return false; - } - - /** - * Call error handler for undefined method - * - * @param string $name unknown method-name - * @param array $args argument array - * - * @return mixed - * @throws SmartyException - */ - public function __call($name, $args) - { - throw new SmartyException(get_class($args[0]) . "->{$name}() undefined method"); - } -} \ No newline at end of file diff --git a/library/Smarty/libs/sysplugins/smarty_resource_recompiled.php b/library/Smarty/libs/sysplugins/smarty_resource_recompiled.php deleted file mode 100644 index cfd73401b..000000000 --- a/library/Smarty/libs/sysplugins/smarty_resource_recompiled.php +++ /dev/null @@ -1,47 +0,0 @@ -filepath = false; - $compiled->timestamp = false; - $compiled->exists = false; - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_resource_uncompiled.php b/library/Smarty/libs/sysplugins/smarty_resource_uncompiled.php deleted file mode 100644 index 88d2bba81..000000000 --- a/library/Smarty/libs/sysplugins/smarty_resource_uncompiled.php +++ /dev/null @@ -1,79 +0,0 @@ -filepath = false; - $compiled->timestamp = false; - $compiled->exists = false; - } - - /** - * render compiled template code - * - * @param Smarty_Internal_Template $_template - * - * @return string - * @throws Exception - */ - public function render($_template) - { - $level = ob_get_level(); - ob_start(); - try { - $this->renderUncompiled($_template->source, $_template); - return ob_get_clean(); - } - catch (Exception $e) { - while (ob_get_level() > $level) { - ob_end_clean(); - } - throw $e; - } - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_template_compiled.php b/library/Smarty/libs/sysplugins/smarty_template_compiled.php deleted file mode 100644 index e7710f85e..000000000 --- a/library/Smarty/libs/sysplugins/smarty_template_compiled.php +++ /dev/null @@ -1,297 +0,0 @@ -source->handler->recompiled && - ($_template->smarty->resource_cache_mode & Smarty::RESOURCE_CACHE_ON) - ) { - $_cache_key = $_template->source->unique_resource . '#'; - if ($_template->caching) { - $_cache_key .= 'caching#'; - } - $_cache_key .= $_template->compile_id; - if (isset($_template->source->compileds[$_cache_key])) { - return $_template->source->compileds[$_cache_key]; - } - } - $compiled = new Smarty_Template_Compiled(); - if ($_template->source->handler->hasCompiledHandler) { - $_template->source->handler->populateCompiledFilepath($compiled, $_template); - } else { - $compiled->populateCompiledFilepath($_template); - } - // runtime cache - if (!$_template->source->handler->recompiled && - ($_template->smarty->resource_cache_mode & Smarty::RESOURCE_CACHE_ON) - ) { - $_template->source->compileds[$_cache_key] = $compiled; - } - return $compiled; - } - - /** - * populate Compiled Object with compiled filepath - * - * @param Smarty_Internal_Template $_template template object - **/ - public function populateCompiledFilepath(Smarty_Internal_Template $_template) - { - $_compile_id = isset($_template->compile_id) ? preg_replace('![^\w]+!', '_', $_template->compile_id) : null; - if ($_template->source->isConfig) { - $_flag = '_' . - ((int) $_template->smarty->config_read_hidden + (int) $_template->smarty->config_booleanize * 2 + - (int) $_template->smarty->config_overwrite * 4); - } else { - $_flag = - '_' . ((int) $_template->smarty->merge_compiled_includes + (int) $_template->smarty->escape_html * 2); - } - $_filepath = $_template->source->uid . $_flag; - // if use_sub_dirs, break file into directories - if ($_template->smarty->use_sub_dirs) { - $_filepath = substr($_filepath, 0, 2) . DS . substr($_filepath, 2, 2) . DS . substr($_filepath, 4, 2) . DS . - $_filepath; - } - $_compile_dir_sep = $_template->smarty->use_sub_dirs ? DS : '^'; - if (isset($_compile_id)) { - $_filepath = $_compile_id . $_compile_dir_sep . $_filepath; - } - // caching token - if ($_template->caching) { - $_cache = '.cache'; - } else { - $_cache = ''; - } - $_compile_dir = $_template->smarty->getCompileDir(); - // set basename if not specified - $_basename = $_template->source->handler->getBasename($_template->source); - if ($_basename === null) { - $_basename = basename(preg_replace('![^\w]+!', '_', $_template->source->name)); - } - // separate (optional) basename by dot - if ($_basename) { - $_basename = '.' . $_basename; - } - - $this->filepath = $_compile_dir . $_filepath . '.' . $_template->source->type . $_basename . $_cache . '.php'; - $this->exists = is_file($this->filepath); - if (!$this->exists) { - $this->timestamp = false; - } - } - - /** - * load compiled template or compile from source - * - * @param Smarty_Internal_Template $_template - * - * @throws Exception - */ - public function process(Smarty_Internal_Template $_template) - { - $_smarty_tpl = $_template; - if ($_template->source->handler->recompiled || !$_template->compiled->exists || - $_template->smarty->force_compile || ($_template->smarty->compile_check && - $_template->source->getTimeStamp() > $_template->compiled->getTimeStamp()) - ) { - $this->compileTemplateSource($_template); - $compileCheck = $_template->smarty->compile_check; - $_template->smarty->compile_check = false; - if ($_template->source->handler->recompiled) { - $level = ob_get_level(); - ob_start(); - try { - eval("?>" . $this->content); - } - catch (Exception $e) { - while (ob_get_level() > $level) { - ob_end_clean(); - } - throw $e; - } - ob_get_clean(); - $this->content = null; - } else { - $this->loadCompiledTemplate($_template); - } - $_template->smarty->compile_check = $compileCheck; - } else { - $_template->mustCompile = true; - @include($_template->compiled->filepath); - if ($_template->mustCompile) { - $this->compileTemplateSource($_template); - $compileCheck = $_template->smarty->compile_check; - $_template->smarty->compile_check = false; - $this->loadCompiledTemplate($_template); - $_template->smarty->compile_check = $compileCheck; - } - } - $_template->smarty->ext->_subTemplate->registerSubTemplates($_template); - - $this->processed = true; - } - - /** - * Load fresh compiled template by including the PHP file - * HHVM requires a work around because of a PHP incompatibility - * - * @param \Smarty_Internal_Template $_template - */ - private function loadCompiledTemplate(Smarty_Internal_Template $_template) - { - if (function_exists('opcache_invalidate')) { - opcache_invalidate($_template->compiled->filepath); - } - $_smarty_tpl = $_template; - if (defined('HHVM_VERSION')) { - $_template->smarty->ext->_hhvm->includeHhvm($_template, $_template->compiled->filepath); - } else { - include($_template->compiled->filepath); - } - } - - /** - * render compiled template code - * - * @param Smarty_Internal_Template $_template - * - * @return string - * @throws Exception - */ - public function render(Smarty_Internal_Template $_template) - { - if ($_template->smarty->debugging) { - $_template->smarty->_debug->start_render($_template); - } - if (!$this->processed) { - $this->process($_template); - } - if (isset($_template->cached)) { - $_template->cached->file_dependency = - array_merge($_template->cached->file_dependency, $this->file_dependency); - } - $this->getRenderedTemplateCode($_template); - if ($_template->caching && $this->has_nocache_code) { - $_template->cached->hashes[$this->nocache_hash] = true; - } - if (isset($_template->parent) && $_template->parent->_objType == 2 && !empty($_template->tpl_function)) { - $_template->parent->tpl_function = array_merge($_template->parent->tpl_function, $_template->tpl_function); - } - if ($_template->smarty->debugging) { - $_template->smarty->_debug->end_render($_template); - } - } - - /** - * compile template from source - * - * @param Smarty_Internal_Template $_template - * - * @return string - * @throws Exception - */ - public function compileTemplateSource(Smarty_Internal_Template $_template) - { - $_template->source->compileds = array(); - $this->file_dependency = array(); - $this->tpl_function = array(); - $this->includes = array(); - $this->nocache_hash = null; - $this->unifunc = null; - // compile locking - if (!$_template->source->handler->recompiled) { - if ($saved_timestamp = $_template->compiled->getTimeStamp()) { - touch($_template->compiled->filepath); - } - } - // call compiler - try { - $_template->loadCompiler(); - $code = $_template->compiler->compileTemplate($_template); - } - catch (Exception $e) { - // restore old timestamp in case of error - if (!$_template->source->handler->recompiled && $saved_timestamp) { - touch($_template->compiled->filepath, $saved_timestamp); - } - throw $e; - } - // compiling succeeded - if ($_template->compiler->write_compiled_code) { - // write compiled template - $this->write($_template, $code); - $code = ''; - } - // release compiler object to free memory - unset($_template->compiler); - return $code; - } - - /** - * Write compiled code by handler - * - * @param Smarty_Internal_Template $_template template object - * @param string $code compiled code - * - * @return boolean success - */ - public function write(Smarty_Internal_Template $_template, $code) - { - if (!$_template->source->handler->recompiled) { - if ($_template->smarty->ext->_writeFile->writeFile($this->filepath, $code, $_template->smarty) === true) { - $this->timestamp = $this->exists = is_file($this->filepath); - if ($this->exists) { - $this->timestamp = filemtime($this->filepath); - return true; - } - } - return false; - } else { - $this->content = $code; - } - $this->timestamp = time(); - $this->exists = true; - return true; - } - - /** - * Read compiled content from handler - * - * @param Smarty_Internal_Template $_template template object - * - * @return string content - */ - public function read(Smarty_Internal_Template $_template) - { - if (!$_template->source->handler->recompiled) { - return file_get_contents($this->filepath); - } - return isset($this->content) ? $this->content : false; - } -} diff --git a/library/Smarty/libs/sysplugins/smarty_template_config.php b/library/Smarty/libs/sysplugins/smarty_template_config.php deleted file mode 100644 index f0fff5080..000000000 --- a/library/Smarty/libs/sysplugins/smarty_template_config.php +++ /dev/null @@ -1,97 +0,0 @@ -handler = clone $handler; // Note: prone to circular references - $this->handler->compiler_class = 'Smarty_Internal_Config_File_Compiler'; - $this->handler->template_lexer_class = 'Smarty_Internal_Configfilelexer'; - $this->handler->template_parser_class = 'Smarty_Internal_Configfileparser'; - $this->resource = $resource; - $this->type = $type; - $this->name = $name; - $this->smarty = $smarty; - } - - /** - * initialize Source Object for given resource - * Either [$_template] or [$smarty, $template_resource] must be specified - * - * @param Smarty_Internal_Template $_template template object - * @param Smarty $smarty smarty object - * @param string $template_resource resource identifier - * - * @return Smarty_Template_Config Source Object - * @throws SmartyException - */ - public static function load(Smarty_Internal_Template $_template = null, Smarty $smarty = null, $template_resource = null) - { - static $_incompatible_resources = array('extends' => true, 'php' => true); - $template_resource = $_template->template_resource; - if (empty($template_resource)) { - throw new SmartyException('Missing config name'); - } - // parse resource_name, load resource handler - list($name, $type) = Smarty_Resource::parseResourceName($template_resource, $_template->smarty->default_config_type); - // make sure configs are not loaded via anything smarty can't handle - if (isset($_incompatible_resources[$type])) { - throw new SmartyException ("Unable to use resource '{$type}' for config"); - } - $resource = Smarty_Resource::load($_template->smarty, $type); - $source = new Smarty_Template_Config($resource, $_template->smarty, $template_resource, $type, $name); - $resource->populate($source, $_template); - if (!$source->exists && isset($_template->smarty->default_config_handler_func)) { - Smarty_Internal_Method_RegisterDefaultTemplateHandler::_getDefaultTemplate($source); - } - $source->unique_resource = $resource->buildUniqueResourceName($_template->smarty, $name, true); - return $source; - } -} diff --git a/vendor/bshaffer/oauth2-server-php/CHANGELOG.md b/vendor/bshaffer/oauth2-server-php/CHANGELOG.md index 4fddd72c9..7671b2396 100644 --- a/vendor/bshaffer/oauth2-server-php/CHANGELOG.md +++ b/vendor/bshaffer/oauth2-server-php/CHANGELOG.md @@ -8,6 +8,24 @@ To see the files changed for a given bug, go to https://github.com/bshaffer/oaut To get the diff between two versions, go to https://github.com/bshaffer/oauth2-server-php/compare/v1.0...v1.1 To get the diff for a specific change, go to https://github.com/bshaffer/oauth2-server-php/commit/XXX where XXX is the change hash +* 1.10.0 (2017-12-14) + + PR: https://github.com/bshaffer/oauth2-server-php/pull/889 + + * #795 - [feature] added protected createPayload method to allow easier customization of JWT payload + * #807 - [refactor] simplifies UserInfoController constructor + * #814 - [docs] Adds https to README link + * #827 - [testing] Explicitly pulls in phpunit 4 + * #828 - [docs] PHPDoc improvements and type hinting of variables. + * #829 - [bug] Fix CORS issue for revoking and requesting an access token + * #869 - [testing] Remove php 5.3 from travis and use vendored phpunit + * #834 - [feature] use random_bytes if available + * #851 - [docs] Fix PHPDoc + * #872 - [bug] Fix count() error on PHP 7.2 + * #873 - [testing] adds php 7.2 to travis + * #794 - [docs] Fix typo in composer.json + * #885 - [testing] Use PHPUnit\Framework\TestCase instead of PHPUnit_Framework_TestCase + * 1.9.0 (2016-01-06) PR: https://github.com/bshaffer/oauth2-server-php/pull/788 @@ -87,7 +105,7 @@ To get the diff for a specific change, go to https://github.com/bshaffer/oauth2- * bug #346 Fixes open_basedir warning * bug #351 Adds OpenID Connect support * bug #355 Adds php 5.6 and HHVM to travis.ci testing - * [BC] bug #358 Adds `getQuerystringIdentifier()` to the GrantType interface + * [BC] bug #358 Adds `getQueryStringIdentifier()` to the GrantType interface * bug #363 Encryption\JWT - Allows for subclassing JWT Headers * bug #349 Bearer Tokens - adds requestHasToken method for when access tokens are optional * bug #301 Encryption\JWT - fixes urlSafeB64Encode(): ensures newlines are replaced as expected diff --git a/vendor/bshaffer/oauth2-server-php/README.md b/vendor/bshaffer/oauth2-server-php/README.md index 4ceda6cf9..f1788e9ce 100644 --- a/vendor/bshaffer/oauth2-server-php/README.md +++ b/vendor/bshaffer/oauth2-server-php/README.md @@ -5,4 +5,4 @@ oauth2-server-php [![Total Downloads](https://poser.pugx.org/bshaffer/oauth2-server-php/downloads.png)](https://packagist.org/packages/bshaffer/oauth2-server-php) -View the [complete documentation](http://bshaffer.github.io/oauth2-server-php-docs/) \ No newline at end of file +View the [complete documentation](https://bshaffer.github.io/oauth2-server-php-docs/) diff --git a/vendor/bshaffer/oauth2-server-php/composer.json b/vendor/bshaffer/oauth2-server-php/composer.json index 561699f5e..272d20027 100644 --- a/vendor/bshaffer/oauth2-server-php/composer.json +++ b/vendor/bshaffer/oauth2-server-php/composer.json @@ -19,6 +19,7 @@ "php":">=5.3.9" }, "require-dev": { + "phpunit/phpunit": "^4.0", "aws/aws-sdk-php": "~2.8", "firebase/php-jwt": "~2.2", "predis/predis": "dev-master", @@ -29,6 +30,7 @@ "predis/predis": "Required to use Redis storage", "thobbs/phpcassa": "Required to use Cassandra storage", "aws/aws-sdk-php": "~2.8 is required to use DynamoDB storage", - "firebase/php-jwt": "~1.1 is required to use MondoDB storage" + "firebase/php-jwt": "~2.2 is required to use JWT features", + "mongodb/mongodb": "^1.1 is required to use MongoDB storage" } } diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Autoloader.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Autoloader.php index ecfb6ba75..4ec08cbdd 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Autoloader.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Autoloader.php @@ -10,8 +10,14 @@ namespace OAuth2; */ class Autoloader { + /** + * @var string + */ private $dir; + /** + * @param string $dir + */ public function __construct($dir = null) { if (is_null($dir)) { @@ -19,6 +25,7 @@ class Autoloader } $this->dir = $dir; } + /** * Registers OAuth2\Autoloader as an SPL autoloader. */ @@ -31,9 +38,8 @@ class Autoloader /** * Handles autoloading of classes. * - * @param string $class A class name. - * - * @return boolean Returns true if the class has been loaded + * @param string $class - A class name. + * @return boolean - Returns true if the class has been loaded */ public function autoload($class) { diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ClientAssertionType/ClientAssertionTypeInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ClientAssertionType/ClientAssertionTypeInterface.php index 29c7171b5..6a167da90 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ClientAssertionType/ClientAssertionTypeInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ClientAssertionType/ClientAssertionTypeInterface.php @@ -10,6 +10,19 @@ use OAuth2\ResponseInterface; */ interface ClientAssertionTypeInterface { + /** + * Validate the OAuth request + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @return mixed + */ public function validateRequest(RequestInterface $request, ResponseInterface $response); + + /** + * Get the client id + * + * @return mixed + */ public function getClientId(); } diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ClientAssertionType/HttpBasic.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ClientAssertionType/HttpBasic.php index 0ecb7e18d..ef6120300 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ClientAssertionType/HttpBasic.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ClientAssertionType/HttpBasic.php @@ -5,6 +5,7 @@ namespace OAuth2\ClientAssertionType; use OAuth2\Storage\ClientCredentialsInterface; use OAuth2\RequestInterface; use OAuth2\ResponseInterface; +use LogicException; /** * Validate a client via Http Basic authentication @@ -19,14 +20,16 @@ class HttpBasic implements ClientAssertionTypeInterface protected $config; /** - * @param OAuth2\Storage\ClientCredentialsInterface $clientStorage REQUIRED Storage class for retrieving client credentials information - * @param array $config OPTIONAL Configuration options for the server - * - * $config = array( - * 'allow_credentials_in_request_body' => true, // whether to look for credentials in the POST body in addition to the Authorize HTTP Header - * 'allow_public_clients' => true // if true, "public clients" (clients without a secret) may be authenticated - * ); - * + * Config array $config should look as follows: + * @code + * $config = array( + * 'allow_credentials_in_request_body' => true, // whether to look for credentials in the POST body in addition to the Authorize HTTP Header + * 'allow_public_clients' => true // if true, "public clients" (clients without a secret) may be authenticated + * ); + * @endcode + * + * @param ClientCredentialsInterface $storage Storage + * @param array $config Configuration options for the server */ public function __construct(ClientCredentialsInterface $storage, array $config = array()) { @@ -37,6 +40,14 @@ class HttpBasic implements ClientAssertionTypeInterface ), $config); } + /** + * Validate the OAuth request + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @return bool|mixed + * @throws LogicException + */ public function validateRequest(RequestInterface $request, ResponseInterface $response) { if (!$clientData = $this->getClientCredentials($request, $response)) { @@ -44,7 +55,7 @@ class HttpBasic implements ClientAssertionTypeInterface } if (!isset($clientData['client_id'])) { - throw new \LogicException('the clientData array must have "client_id" set'); + throw new LogicException('the clientData array must have "client_id" set'); } if (!isset($clientData['client_secret']) || $clientData['client_secret'] == '') { @@ -70,6 +81,11 @@ class HttpBasic implements ClientAssertionTypeInterface return true; } + /** + * Get the client id + * + * @return mixed + */ public function getClientId() { return $this->clientData['client_id']; @@ -82,13 +98,14 @@ class HttpBasic implements ClientAssertionTypeInterface * According to the spec (draft 20), the client_id can be provided in * the Basic Authorization header (recommended) or via GET/POST. * - * @return - * A list containing the client identifier and password, for example + * @param RequestInterface $request + * @param ResponseInterface $response + * @return array|null A list containing the client identifier and password, for example: * @code - * return array( - * "client_id" => CLIENT_ID, // REQUIRED the client id - * "client_secret" => CLIENT_SECRET, // OPTIONAL the client secret (may be omitted for public clients) - * ); + * return array( + * "client_id" => CLIENT_ID, // REQUIRED the client id + * "client_secret" => CLIENT_SECRET, // OPTIONAL the client secret (may be omitted for public clients) + * ); * @endcode * * @see http://tools.ietf.org/html/rfc6749#section-2.3.1 @@ -108,7 +125,6 @@ class HttpBasic implements ClientAssertionTypeInterface * client_secret can be null if the client's password is an empty string * @see http://tools.ietf.org/html/rfc6749#section-2.3.1 */ - return array('client_id' => $request->request('client_id'), 'client_secret' => $request->request('client_secret')); } } diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/AuthorizeController.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/AuthorizeController.php index ea7f54a87..4bafb1d24 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/AuthorizeController.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/AuthorizeController.php @@ -7,37 +7,76 @@ use OAuth2\ScopeInterface; use OAuth2\RequestInterface; use OAuth2\ResponseInterface; use OAuth2\Scope; +use InvalidArgumentException; /** - * @see OAuth2\Controller\AuthorizeControllerInterface + * @see AuthorizeControllerInterface */ class AuthorizeController implements AuthorizeControllerInterface { + /** + * @var string + */ private $scope; + + /** + * @var int + */ private $state; + + /** + * @var mixed + */ private $client_id; + + /** + * @var string + */ private $redirect_uri; + + /** + * The response type + * + * @var string + */ private $response_type; + /** + * @var ClientInterface + */ protected $clientStorage; + + /** + * @var array + */ protected $responseTypes; + + /** + * @var array + */ protected $config; + + /** + * @var ScopeInterface + */ protected $scopeUtil; /** - * @param OAuth2\Storage\ClientInterface $clientStorage REQUIRED Instance of OAuth2\Storage\ClientInterface to retrieve client information - * @param array $responseTypes OPTIONAL Array of OAuth2\ResponseType\ResponseTypeInterface objects. Valid array - * keys are "code" and "token" - * @param array $config OPTIONAL Configuration options for the server - * - * $config = array( - * 'allow_implicit' => false, // if the controller should allow the "implicit" grant type - * 'enforce_state' => true // if the controller should require the "state" parameter - * 'require_exact_redirect_uri' => true, // if the controller should require an exact match on the "redirect_uri" parameter - * 'redirect_status_code' => 302, // HTTP status code to use for redirect responses - * ); - * - * @param OAuth2\ScopeInterface $scopeUtil OPTIONAL Instance of OAuth2\ScopeInterface to validate the requested scope + * Constructor + * + * @param ClientInterface $clientStorage REQUIRED Instance of OAuth2\Storage\ClientInterface to retrieve client information + * @param array $responseTypes OPTIONAL Array of OAuth2\ResponseType\ResponseTypeInterface objects. Valid array + * keys are "code" and "token" + * @param array $config OPTIONAL Configuration options for the server: + * @param ScopeInterface $scopeUtil OPTIONAL Instance of OAuth2\ScopeInterface to validate the requested scope + * @code + * $config = array( + * 'allow_implicit' => false, // if the controller should allow the "implicit" grant type + * 'enforce_state' => true // if the controller should require the "state" parameter + * 'require_exact_redirect_uri' => true, // if the controller should require an exact match on the "redirect_uri" parameter + * 'redirect_status_code' => 302, // HTTP status code to use for redirect responses + * ); + * @endcode */ public function __construct(ClientInterface $clientStorage, array $responseTypes = array(), array $config = array(), ScopeInterface $scopeUtil = null) { @@ -56,10 +95,20 @@ class AuthorizeController implements AuthorizeControllerInterface $this->scopeUtil = $scopeUtil; } + /** + * Handle the authorization request + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @param boolean $is_authorized + * @param mixed $user_id + * @return mixed|void + * @throws InvalidArgumentException + */ public function handleAuthorizeRequest(RequestInterface $request, ResponseInterface $response, $is_authorized, $user_id = null) { if (!is_bool($is_authorized)) { - throw new \InvalidArgumentException('Argument "is_authorized" must be a boolean. This method must know if the user has granted access to the client.'); + throw new InvalidArgumentException('Argument "is_authorized" must be a boolean. This method must know if the user has granted access to the client.'); } // We repeat this, because we need to re-validate. The request could be POSTed @@ -101,6 +150,14 @@ class AuthorizeController implements AuthorizeControllerInterface $response->setRedirect($this->config['redirect_status_code'], $uri); } + /** + * Set not authorized response + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @param string $redirect_uri + * @param mixed $user_id + */ protected function setNotAuthorizedResponse(RequestInterface $request, ResponseInterface $response, $redirect_uri, $user_id = null) { $error = 'access_denied'; @@ -108,9 +165,16 @@ class AuthorizeController implements AuthorizeControllerInterface $response->setRedirect($this->config['redirect_status_code'], $redirect_uri, $this->state, $error, $error_message); } - /* + /** * We have made this protected so this class can be extended to add/modify * these parameters + * + * @TODO: add dependency injection for the parameters in this method + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @param mixed $user_id + * @return array */ protected function buildAuthorizeParameters($request, $response, $user_id) { @@ -127,6 +191,8 @@ class AuthorizeController implements AuthorizeControllerInterface } /** + * Validate the OAuth request + * * @param RequestInterface $request * @param ResponseInterface $response * @return bool @@ -186,7 +252,7 @@ class AuthorizeController implements AuthorizeControllerInterface $redirect_uri = $registered_redirect_uri; } - // Select the redirect URI + // Select the response type $response_type = $request->query('response_type', $request->request('response_type')); // for multiple-valued response types - make them alphabetical @@ -281,10 +347,10 @@ class AuthorizeController implements AuthorizeControllerInterface /** * Build the absolute URI based on supplied URI and parameters. * - * @param $uri An absolute URI. - * @param $params Parameters to be append as GET. + * @param string $uri An absolute URI. + * @param array $params Parameters to be append as GET. * - * @return + * @return string * An absolute URI with supplied parameters. * * @ingroup oauth2_section_4 @@ -302,9 +368,9 @@ class AuthorizeController implements AuthorizeControllerInterface } } - // Put humpty dumpty back together + // Put the uri back together return - ((isset($parse_url["scheme"])) ? $parse_url["scheme"] . "://" : "") + ((isset($parse_url["scheme"])) ? $parse_url["scheme"] . "://" : "") . ((isset($parse_url["user"])) ? $parse_url["user"] . ((isset($parse_url["pass"])) ? ":" . $parse_url["pass"] : "") . "@" : "") . ((isset($parse_url["host"])) ? $parse_url["host"] : "") @@ -326,10 +392,10 @@ class AuthorizeController implements AuthorizeControllerInterface /** * Internal method for validating redirect URI supplied * - * @param string $inputUri The submitted URI to be validated + * @param string $inputUri The submitted URI to be validated * @param string $registeredUriString The allowed URI(s) to validate against. Can be a space-delimited string of URIs to * allow for multiple URIs - * + * @return bool * @see http://tools.ietf.org/html/rfc6749#section-3.1.2 */ protected function validateRedirectUri($inputUri, $registeredUriString) @@ -363,29 +429,50 @@ class AuthorizeController implements AuthorizeControllerInterface } /** - * Convenience methods to access the parameters derived from the validated request + * Convenience method to access the scope + * + * @return string */ - public function getScope() { return $this->scope; } + /** + * Convenience method to access the state + * + * @return int + */ public function getState() { return $this->state; } + /** + * Convenience method to access the client id + * + * @return mixed + */ public function getClientId() { return $this->client_id; } + /** + * Convenience method to access the redirect url + * + * @return string + */ public function getRedirectUri() { return $this->redirect_uri; } + /** + * Convenience method to access the response type + * + * @return string + */ public function getResponseType() { return $this->response_type; diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/AuthorizeControllerInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/AuthorizeControllerInterface.php index fa07ae8d2..f758f976a 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/AuthorizeControllerInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/AuthorizeControllerInterface.php @@ -11,17 +11,18 @@ use OAuth2\ResponseInterface; * authorization directly, this controller ensures the request is valid, but * requires the application to determine the value of $is_authorized * - * ex: - * > $user_id = $this->somehowDetermineUserId(); - * > $is_authorized = $this->somehowDetermineUserAuthorization(); - * > $response = new OAuth2\Response(); - * > $authorizeController->handleAuthorizeRequest( - * > OAuth2\Request::createFromGlobals(), - * > $response, - * > $is_authorized, - * > $user_id); - * > $response->send(); - * + * @code + * $user_id = $this->somehowDetermineUserId(); + * $is_authorized = $this->somehowDetermineUserAuthorization(); + * $response = new OAuth2\Response(); + * $authorizeController->handleAuthorizeRequest( + * OAuth2\Request::createFromGlobals(), + * $response, + * $is_authorized, + * $user_id + * ); + * $response->send(); + * @endcode */ interface AuthorizeControllerInterface { @@ -37,7 +38,21 @@ interface AuthorizeControllerInterface const RESPONSE_TYPE_AUTHORIZATION_CODE = 'code'; const RESPONSE_TYPE_ACCESS_TOKEN = 'token'; + /** + * Handle the OAuth request + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @param $is_authorized + * @param null $user_id + * @return mixed + */ public function handleAuthorizeRequest(RequestInterface $request, ResponseInterface $response, $is_authorized, $user_id = null); + /** + * @param RequestInterface $request + * @param ResponseInterface $response + * @return bool + */ public function validateAuthorizeRequest(RequestInterface $request, ResponseInterface $response); } diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/ResourceController.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/ResourceController.php index 3cfaaaf12..926f90fda 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/ResourceController.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/ResourceController.php @@ -10,17 +10,43 @@ use OAuth2\ResponseInterface; use OAuth2\Scope; /** - * @see OAuth2\Controller\ResourceControllerInterface + * @see ResourceControllerInterface */ class ResourceController implements ResourceControllerInterface { + /** + * @var array + */ private $token; + /** + * @var TokenTypeInterface + */ protected $tokenType; + + /** + * @var AccessTokenInterface + */ protected $tokenStorage; + + /** + * @var array + */ protected $config; + + /** + * @var ScopeInterface + */ protected $scopeUtil; + /** + * Constructor + * + * @param TokenTypeInterface $tokenType + * @param AccessTokenInterface $tokenStorage + * @param array $config + * @param ScopeInterface $scopeUtil + */ public function __construct(TokenTypeInterface $tokenType, AccessTokenInterface $tokenStorage, $config = array(), ScopeInterface $scopeUtil = null) { $this->tokenType = $tokenType; @@ -36,6 +62,14 @@ class ResourceController implements ResourceControllerInterface $this->scopeUtil = $scopeUtil; } + /** + * Verify the resource request + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @param null $scope + * @return bool + */ public function verifyResourceRequest(RequestInterface $request, ResponseInterface $response, $scope = null) { $token = $this->getAccessTokenData($request, $response); @@ -71,6 +105,13 @@ class ResourceController implements ResourceControllerInterface return (bool) $token; } + /** + * Get access token data. + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @return array|null + */ public function getAccessTokenData(RequestInterface $request, ResponseInterface $response) { // Get the token parameter @@ -103,7 +144,11 @@ class ResourceController implements ResourceControllerInterface return null; } - // convenience method to allow retrieval of the token + /** + * convenience method to allow retrieval of the token. + * + * @return array + */ public function getToken() { return $this->token; diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/ResourceControllerInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/ResourceControllerInterface.php index 611421935..0e847ca61 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/ResourceControllerInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/ResourceControllerInterface.php @@ -10,17 +10,32 @@ use OAuth2\ResponseInterface; * call verifyResourceRequest in order to determine if the request * contains a valid token. * - * ex: - * > if (!$resourceController->verifyResourceRequest(OAuth2\Request::createFromGlobals(), $response = new OAuth2\Response())) { - * > $response->send(); // authorization failed - * > die(); - * > } - * > return json_encode($resource); // valid token! Send the stuff! - * + * @code + * if (!$resourceController->verifyResourceRequest(OAuth2\Request::createFromGlobals(), $response = new OAuth2\Response())) { + * $response->send(); // authorization failed + * die(); + * } + * return json_encode($resource); // valid token! Send the stuff! + * @endcode */ interface ResourceControllerInterface { + /** + * Verify the resource request + * + * @param RequestInterface $request - Request object + * @param ResponseInterface $response - Response object + * @param string $scope + * @return mixed + */ public function verifyResourceRequest(RequestInterface $request, ResponseInterface $response, $scope = null); + /** + * Get access token data. + * + * @param RequestInterface $request - Request object + * @param ResponseInterface $response - Response object + * @return mixed + */ public function getAccessTokenData(RequestInterface $request, ResponseInterface $response); } diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/TokenController.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/TokenController.php index 5d2d731fe..7fdaf85a6 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/TokenController.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/TokenController.php @@ -10,9 +10,12 @@ use OAuth2\Scope; use OAuth2\Storage\ClientInterface; use OAuth2\RequestInterface; use OAuth2\ResponseInterface; +use InvalidArgumentException; +use LogicException; +use RuntimeException; /** - * @see \OAuth2\Controller\TokenControllerInterface + * @see TokenControllerInterface */ class TokenController implements TokenControllerInterface { @@ -22,7 +25,7 @@ class TokenController implements TokenControllerInterface protected $accessToken; /** - * @var array + * @var array */ protected $grantTypes; @@ -32,7 +35,7 @@ class TokenController implements TokenControllerInterface protected $clientAssertionType; /** - * @var Scope|ScopeInterface + * @var ScopeInterface */ protected $scopeUtil; @@ -41,12 +44,22 @@ class TokenController implements TokenControllerInterface */ protected $clientStorage; + /** + * Constructor + * + * @param AccessTokenInterface $accessToken + * @param ClientInterface $clientStorage + * @param array $grantTypes + * @param ClientAssertionTypeInterface $clientAssertionType + * @param ScopeInterface $scopeUtil + * @throws InvalidArgumentException + */ public function __construct(AccessTokenInterface $accessToken, ClientInterface $clientStorage, array $grantTypes = array(), ClientAssertionTypeInterface $clientAssertionType = null, ScopeInterface $scopeUtil = null) { if (is_null($clientAssertionType)) { foreach ($grantTypes as $grantType) { if (!$grantType instanceof ClientAssertionTypeInterface) { - throw new \InvalidArgumentException('You must supply an instance of OAuth2\ClientAssertionType\ClientAssertionTypeInterface or only use grant types which implement OAuth2\ClientAssertionType\ClientAssertionTypeInterface'); + throw new InvalidArgumentException('You must supply an instance of OAuth2\ClientAssertionType\ClientAssertionTypeInterface or only use grant types which implement OAuth2\ClientAssertionType\ClientAssertionTypeInterface'); } } } @@ -63,6 +76,12 @@ class TokenController implements TokenControllerInterface $this->scopeUtil = $scopeUtil; } + /** + * Handle the token request. + * + * @param RequestInterface $request - Request object to grant access token + * @param ResponseInterface $response - Response object + */ public function handleTokenRequest(RequestInterface $request, ResponseInterface $response) { if ($token = $this->grantAccessToken($request, $response)) { @@ -83,8 +102,10 @@ class TokenController implements TokenControllerInterface * This would be called from the "/token" endpoint as defined in the spec. * You can call your endpoint whatever you want. * - * @param RequestInterface $request Request object to grant access token - * @param ResponseInterface $response + * @param RequestInterface $request - Request object to grant access token + * @param ResponseInterface $response - Response object + * + * @return bool|null|array * * @throws \InvalidArgumentException * @throws \LogicException @@ -97,9 +118,15 @@ class TokenController implements TokenControllerInterface */ public function grantAccessToken(RequestInterface $request, ResponseInterface $response) { - if (strtolower($request->server('REQUEST_METHOD')) != 'post') { + if (strtolower($request->server('REQUEST_METHOD')) === 'options') { + $response->addHttpHeaders(array('Allow' => 'POST, OPTIONS')); + + return null; + } + + if (strtolower($request->server('REQUEST_METHOD')) !== 'post') { $response->setError(405, 'invalid_request', 'The request method must be POST when requesting an access token', '#section-3.2'); - $response->addHttpHeaders(array('Allow' => 'POST')); + $response->addHttpHeaders(array('Allow' => 'POST, OPTIONS')); return null; } @@ -121,6 +148,7 @@ class TokenController implements TokenControllerInterface return null; } + /** @var GrantTypeInterface $grantType */ $grantType = $this->grantTypes[$grantTypeIdentifier]; /** @@ -128,8 +156,8 @@ class TokenController implements TokenControllerInterface * ClientAssertionTypes allow for grant types which also assert the client data * in which case ClientAssertion is handled in the validateRequest method * - * @see OAuth2\GrantType\JWTBearer - * @see OAuth2\GrantType\ClientCredentials + * @see \OAuth2\GrantType\JWTBearer + * @see \OAuth2\GrantType\ClientCredentials */ if (!$grantType instanceof ClientAssertionTypeInterface) { if (!$this->clientAssertionType->validateRequest($request, $response)) { @@ -178,7 +206,6 @@ class TokenController implements TokenControllerInterface * * @see http://tools.ietf.org/html/rfc6749#section-3.3 */ - $requestedScope = $this->scopeUtil->getScopeFromRequest($request); $availableScope = $grantType->getScope(); @@ -225,20 +252,24 @@ class TokenController implements TokenControllerInterface } /** - * addGrantType + * Add grant type * - * @param GrantTypeInterface $grantType the grant type to add for the specified identifier - * @param string $identifier a string passed in as "grant_type" in the response that will call this grantType + * @param GrantTypeInterface $grantType - the grant type to add for the specified identifier + * @param string|null $identifier - a string passed in as "grant_type" in the response that will call this grantType */ public function addGrantType(GrantTypeInterface $grantType, $identifier = null) { if (is_null($identifier) || is_numeric($identifier)) { - $identifier = $grantType->getQuerystringIdentifier(); + $identifier = $grantType->getQueryStringIdentifier(); } $this->grantTypes[$identifier] = $grantType; } + /** + * @param RequestInterface $request + * @param ResponseInterface $response + */ public function handleRevokeRequest(RequestInterface $request, ResponseInterface $response) { if ($this->revokeToken($request, $response)) { @@ -257,13 +288,20 @@ class TokenController implements TokenControllerInterface * * @param RequestInterface $request * @param ResponseInterface $response + * @throws RuntimeException * @return bool|null */ public function revokeToken(RequestInterface $request, ResponseInterface $response) { - if (strtolower($request->server('REQUEST_METHOD')) != 'post') { + if (strtolower($request->server('REQUEST_METHOD')) === 'options') { + $response->addHttpHeaders(array('Allow' => 'POST, OPTIONS')); + + return null; + } + + if (strtolower($request->server('REQUEST_METHOD')) !== 'post') { $response->setError(405, 'invalid_request', 'The request method must be POST when revoking an access token', '#section-3.2'); - $response->addHttpHeaders(array('Allow' => 'POST')); + $response->addHttpHeaders(array('Allow' => 'POST, OPTIONS')); return null; } @@ -285,7 +323,7 @@ class TokenController implements TokenControllerInterface // @todo remove this check for v2.0 if (!method_exists($this->accessToken, 'revokeToken')) { $class = get_class($this->accessToken); - throw new \RuntimeException("AccessToken {$class} does not implement required revokeToken method"); + throw new RuntimeException("AccessToken {$class} does not implement required revokeToken method"); } $this->accessToken->revokeToken($token, $token_type_hint); diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/TokenControllerInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/TokenControllerInterface.php index 72d72570f..2f83ce4bd 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/TokenControllerInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Controller/TokenControllerInterface.php @@ -10,23 +10,30 @@ use OAuth2\ResponseInterface; * it is called to handle all grant types the application supports. * It also validates the client's credentials * - * ex: - * > $tokenController->handleTokenRequest(OAuth2\Request::createFromGlobals(), $response = new OAuth2\Response()); - * > $response->send(); - * + * @code + * $tokenController->handleTokenRequest(OAuth2\Request::createFromGlobals(), $response = new OAuth2\Response()); + * $response->send(); + * @endcode */ interface TokenControllerInterface { /** - * handleTokenRequest - * - * @param $request - * OAuth2\RequestInterface - The current http request - * @param $response - * OAuth2\ResponseInterface - An instance of OAuth2\ResponseInterface to contain the response data + * Handle the token request * + * @param RequestInterface $request - The current http request + * @param ResponseInterface $response - An instance of OAuth2\ResponseInterface to contain the response data */ public function handleTokenRequest(RequestInterface $request, ResponseInterface $response); + /** + * Grant or deny a requested access token. + * This would be called from the "/token" endpoint as defined in the spec. + * You can call your endpoint whatever you want. + * + * @param RequestInterface $request - Request object to grant access token + * @param ResponseInterface $response - Response object + * + * @return mixed + */ public function grantAccessToken(RequestInterface $request, ResponseInterface $response); } diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Encryption/EncryptionInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Encryption/EncryptionInterface.php index 2d336c664..8dc720a43 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Encryption/EncryptionInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Encryption/EncryptionInterface.php @@ -4,8 +4,31 @@ namespace OAuth2\Encryption; interface EncryptionInterface { + /** + * @param $payload + * @param $key + * @param null $algorithm + * @return mixed + */ public function encode($payload, $key, $algorithm = null); + + /** + * @param $payload + * @param $key + * @param null $algorithm + * @return mixed + */ public function decode($payload, $key, $algorithm = null); + + /** + * @param $data + * @return mixed + */ public function urlSafeB64Encode($data); + + /** + * @param $b64 + * @return mixed + */ public function urlSafeB64Decode($b64); } diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Encryption/Jwt.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Encryption/Jwt.php index ee576e643..c258b8fc3 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Encryption/Jwt.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Encryption/Jwt.php @@ -2,12 +2,21 @@ namespace OAuth2\Encryption; +use Exception; +use InvalidArgumentException; + /** * @link https://github.com/F21/jwt * @author F21 */ class Jwt implements EncryptionInterface { + /** + * @param $payload + * @param $key + * @param string $algo + * @return string + */ public function encode($payload, $key, $algo = 'HS256') { $header = $this->generateJwtHeader($payload, $algo); @@ -25,6 +34,12 @@ class Jwt implements EncryptionInterface return implode('.', $segments); } + /** + * @param string $jwt + * @param null $key + * @param array|bool $allowedAlgorithms + * @return bool|mixed + */ public function decode($jwt, $key = null, $allowedAlgorithms = true) { if (!strpos($jwt, '.')) { @@ -67,6 +82,14 @@ class Jwt implements EncryptionInterface return $payload; } + /** + * @param $signature + * @param $input + * @param $key + * @param string $algo + * @return bool + * @throws InvalidArgumentException + */ private function verifySignature($signature, $input, $key, $algo = 'HS256') { // use constants when possible, for HipHop support @@ -89,10 +112,17 @@ class Jwt implements EncryptionInterface return @openssl_verify($input, $signature, $key, defined('OPENSSL_ALGO_SHA512') ? OPENSSL_ALGO_SHA512 : 'sha512') === 1; default: - throw new \InvalidArgumentException("Unsupported or invalid signing algorithm."); + throw new InvalidArgumentException("Unsupported or invalid signing algorithm."); } } + /** + * @param $input + * @param $key + * @param string $algo + * @return string + * @throws Exception + */ private function sign($input, $key, $algo = 'HS256') { switch ($algo) { @@ -115,19 +145,30 @@ class Jwt implements EncryptionInterface return $this->generateRSASignature($input, $key, defined('OPENSSL_ALGO_SHA512') ? OPENSSL_ALGO_SHA512 : 'sha512'); default: - throw new \Exception("Unsupported or invalid signing algorithm."); + throw new Exception("Unsupported or invalid signing algorithm."); } } + /** + * @param $input + * @param $key + * @param string $algo + * @return mixed + * @throws Exception + */ private function generateRSASignature($input, $key, $algo) { if (!openssl_sign($input, $signature, $key, $algo)) { - throw new \Exception("Unable to sign data."); + throw new Exception("Unable to sign data."); } return $signature; } + /** + * @param string $data + * @return string + */ public function urlSafeB64Encode($data) { $b64 = base64_encode($data); @@ -138,6 +179,10 @@ class Jwt implements EncryptionInterface return $b64; } + /** + * @param string $b64 + * @return mixed|string + */ public function urlSafeB64Decode($b64) { $b64 = str_replace(array('-', '_'), @@ -158,6 +203,11 @@ class Jwt implements EncryptionInterface ); } + /** + * @param string $a + * @param string $b + * @return bool + */ protected function hash_equals($a, $b) { if (function_exists('hash_equals')) { @@ -170,4 +220,4 @@ class Jwt implements EncryptionInterface return $diff === 0; } -} +} \ No newline at end of file diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/AuthorizationCode.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/AuthorizationCode.php index cae9f787d..784f6b3a3 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/AuthorizationCode.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/AuthorizationCode.php @@ -6,29 +6,47 @@ use OAuth2\Storage\AuthorizationCodeInterface; use OAuth2\ResponseType\AccessTokenInterface; use OAuth2\RequestInterface; use OAuth2\ResponseInterface; +use Exception; /** - * * @author Brent Shaffer */ class AuthorizationCode implements GrantTypeInterface { + /** + * @var AuthorizationCodeInterface + */ protected $storage; + + /** + * @var array + */ protected $authCode; /** - * @param \OAuth2\Storage\AuthorizationCodeInterface $storage REQUIRED Storage class for retrieving authorization code information + * @param AuthorizationCodeInterface $storage - REQUIRED Storage class for retrieving authorization code information */ public function __construct(AuthorizationCodeInterface $storage) { $this->storage = $storage; } - public function getQuerystringIdentifier() + /** + * @return string + */ + public function getQueryStringIdentifier() { return 'authorization_code'; } + /** + * Validate the OAuth request + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @return bool + * @throws Exception + */ public function validateRequest(RequestInterface $request, ResponseInterface $response) { if (!$request->request('code')) { @@ -75,21 +93,45 @@ class AuthorizationCode implements GrantTypeInterface return true; } + /** + * Get the client id + * + * @return mixed + */ public function getClientId() { return $this->authCode['client_id']; } + /** + * Get the scope + * + * @return string + */ public function getScope() { return isset($this->authCode['scope']) ? $this->authCode['scope'] : null; } + /** + * Get the user id + * + * @return mixed + */ public function getUserId() { return isset($this->authCode['user_id']) ? $this->authCode['user_id'] : null; } + /** + * Create access token + * + * @param AccessTokenInterface $accessToken + * @param mixed $client_id - client identifier related to the access token. + * @param mixed $user_id - user id associated with the access token + * @param string $scope - scopes to be stored in space-separated string. + * @return array + */ public function createAccessToken(AccessTokenInterface $accessToken, $client_id, $user_id, $scope) { $token = $accessToken->createAccessToken($client_id, $user_id, $scope); diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/ClientCredentials.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/ClientCredentials.php index f953e4e8d..e135c2dd2 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/ClientCredentials.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/ClientCredentials.php @@ -9,12 +9,19 @@ use OAuth2\Storage\ClientCredentialsInterface; /** * @author Brent Shaffer * - * @see OAuth2\ClientAssertionType_HttpBasic + * @see HttpBasic */ class ClientCredentials extends HttpBasic implements GrantTypeInterface { + /** + * @var array + */ private $clientData; + /** + * @param ClientCredentialsInterface $storage + * @param array $config + */ public function __construct(ClientCredentialsInterface $storage, array $config = array()) { /** @@ -27,11 +34,21 @@ class ClientCredentials extends HttpBasic implements GrantTypeInterface parent::__construct($storage, $config); } - public function getQuerystringIdentifier() + /** + * Get query string identifier + * + * @return string + */ + public function getQueryStringIdentifier() { return 'client_credentials'; } + /** + * Get scope + * + * @return string|null + */ public function getScope() { $this->loadClientData(); @@ -39,6 +56,11 @@ class ClientCredentials extends HttpBasic implements GrantTypeInterface return isset($this->clientData['scope']) ? $this->clientData['scope'] : null; } + /** + * Get user id + * + * @return mixed + */ public function getUserId() { $this->loadClientData(); @@ -46,6 +68,15 @@ class ClientCredentials extends HttpBasic implements GrantTypeInterface return isset($this->clientData['user_id']) ? $this->clientData['user_id'] : null; } + /** + * Create access token + * + * @param AccessTokenInterface $accessToken + * @param mixed $client_id - client identifier related to the access token. + * @param mixed $user_id - user id associated with the access token + * @param string $scope - scopes to be stored in space-separated string. + * @return array + */ public function createAccessToken(AccessTokenInterface $accessToken, $client_id, $user_id, $scope) { /** diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/GrantTypeInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/GrantTypeInterface.php index 98489e9c1..f45786ff5 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/GrantTypeInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/GrantTypeInterface.php @@ -11,10 +11,49 @@ use OAuth2\ResponseInterface; */ interface GrantTypeInterface { - public function getQuerystringIdentifier(); + /** + * Get query string identifier + * + * @return string + */ + public function getQueryStringIdentifier(); + + /** + * @param RequestInterface $request + * @param ResponseInterface $response + * @return mixed + */ public function validateRequest(RequestInterface $request, ResponseInterface $response); + + /** + * Get client id + * + * @return mixed + */ public function getClientId(); + + /** + * Get user id + * + * @return mixed + */ public function getUserId(); + + /** + * Get scope + * + * @return string|null + */ public function getScope(); + + /** + * Create access token + * + * @param AccessTokenInterface $accessToken + * @param mixed $client_id - client identifier related to the access token. + * @param mixed $user_id - user id associated with the access token + * @param string $scope - scopes to be stored in space-separated string. + * @return array + */ public function createAccessToken(AccessTokenInterface $accessToken, $client_id, $user_id, $scope); } diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/JwtBearer.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/JwtBearer.php index bb11a6954..62c1efabd 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/JwtBearer.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/JwtBearer.php @@ -30,10 +30,12 @@ class JwtBearer implements GrantTypeInterface, ClientAssertionTypeInterface /** * Creates an instance of the JWT bearer grant type. * - * @param OAuth2\Storage\JWTBearerInterface|JwtBearerInterface $storage A valid storage interface that implements storage hooks for the JWT bearer grant type. - * @param string $audience The audience to validate the token against. This is usually the full URI of the OAuth token requests endpoint. - * @param EncryptionInterface|OAuth2\Encryption\JWT $jwtUtil OPTONAL The class used to decode, encode and verify JWTs. - * @param array $config + * @param JwtBearerInterface $storage - A valid storage interface that implements storage hooks for the JWT + * bearer grant type. + * @param string $audience - The audience to validate the token against. This is usually the full + * URI of the OAuth token requests endpoint. + * @param EncryptionInterface|JWT $jwtUtil - OPTONAL The class used to decode, encode and verify JWTs. + * @param array $config */ public function __construct(JwtBearerInterface $storage, $audience, EncryptionInterface $jwtUtil = null, array $config = array()) { @@ -56,12 +58,11 @@ class JwtBearer implements GrantTypeInterface, ClientAssertionTypeInterface /** * Returns the grant_type get parameter to identify the grant type request as JWT bearer authorization grant. * - * @return - * The string identifier for grant_type. + * @return string - The string identifier for grant_type. * - * @see OAuth2\GrantType\GrantTypeInterface::getQuerystringIdentifier() + * @see GrantTypeInterface::getQueryStringIdentifier() */ - public function getQuerystringIdentifier() + public function getQueryStringIdentifier() { return 'urn:ietf:params:oauth:grant-type:jwt-bearer'; } @@ -69,10 +70,9 @@ class JwtBearer implements GrantTypeInterface, ClientAssertionTypeInterface /** * Validates the data from the decoded JWT. * - * @return - * TRUE if the JWT request is valid and can be decoded. Otherwise, FALSE is returned. - * - * @see OAuth2\GrantType\GrantTypeInterface::getTokenData() + * @param RequestInterface $request + * @param ResponseInterface $response + * @return bool|mixed|null TRUE if the JWT request is valid and can be decoded. Otherwise, FALSE is returned.@see GrantTypeInterface::getTokenData() */ public function validateRequest(RequestInterface $request, ResponseInterface $response) { @@ -196,16 +196,31 @@ class JwtBearer implements GrantTypeInterface, ClientAssertionTypeInterface return true; } + /** + * Get client id + * + * @return mixed + */ public function getClientId() { return $this->jwt['iss']; } + /** + * Get user id + * + * @return mixed + */ public function getUserId() { return $this->jwt['sub']; } + /** + * Get scope + * + * @return null + */ public function getScope() { return null; @@ -215,7 +230,13 @@ class JwtBearer implements GrantTypeInterface, ClientAssertionTypeInterface * Creates an access token that is NOT associated with a refresh token. * If a subject (sub) the name of the user/account we are accessing data on behalf of. * - * @see OAuth2\GrantType\GrantTypeInterface::createAccessToken() + * @see GrantTypeInterface::createAccessToken() + * + * @param AccessTokenInterface $accessToken + * @param mixed $client_id - client identifier related to the access token. + * @param mixed $user_id - user id associated with the access token + * @param string $scope - scopes to be stored in space-separated string. + * @return array */ public function createAccessToken(AccessTokenInterface $accessToken, $client_id, $user_id, $scope) { diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/RefreshToken.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/RefreshToken.php index e55385222..75c611f1d 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/RefreshToken.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/RefreshToken.php @@ -8,25 +8,34 @@ use OAuth2\RequestInterface; use OAuth2\ResponseInterface; /** - * * @author Brent Shaffer */ class RefreshToken implements GrantTypeInterface { + /** + * @var array + */ private $refreshToken; + /** + * @var RefreshTokenInterface + */ protected $storage; + + /** + * @var array + */ protected $config; /** - * @param OAuth2\Storage\RefreshTokenInterface $storage REQUIRED Storage class for retrieving refresh token information - * @param array $config OPTIONAL Configuration options for the server - * - * $config = array( - * 'always_issue_new_refresh_token' => true, // whether to issue a new refresh token upon successful token request - * 'unset_refresh_token_after_use' => true // whether to unset the refresh token after after using - * ); - * + * @param RefreshTokenInterface $storage - REQUIRED Storage class for retrieving refresh token information + * @param array $config - OPTIONAL Configuration options for the server + * @code + * $config = array( + * 'always_issue_new_refresh_token' => true, // whether to issue a new refresh token upon successful token request + * 'unset_refresh_token_after_use' => true // whether to unset the refresh token after after using + * ); + * @endcode */ public function __construct(RefreshTokenInterface $storage, $config = array()) { @@ -45,11 +54,21 @@ class RefreshToken implements GrantTypeInterface $this->storage = $storage; } - public function getQuerystringIdentifier() + /** + * @return string + */ + public function getQueryStringIdentifier() { return 'refresh_token'; } + /** + * Validate the OAuth request + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @return bool|mixed|null + */ public function validateRequest(RequestInterface $request, ResponseInterface $response) { if (!$request->request("refresh_token")) { @@ -76,21 +95,45 @@ class RefreshToken implements GrantTypeInterface return true; } + /** + * Get client id + * + * @return mixed + */ public function getClientId() { return $this->refreshToken['client_id']; } + /** + * Get user id + * + * @return mixed|null + */ public function getUserId() { return isset($this->refreshToken['user_id']) ? $this->refreshToken['user_id'] : null; } + /** + * Get scope + * + * @return null|string + */ public function getScope() { return isset($this->refreshToken['scope']) ? $this->refreshToken['scope'] : null; } + /** + * Create access token + * + * @param AccessTokenInterface $accessToken + * @param mixed $client_id - client identifier related to the access token. + * @param mixed $user_id - user id associated with the access token + * @param string $scope - scopes to be stored in space-separated string. + * @return array + */ public function createAccessToken(AccessTokenInterface $accessToken, $client_id, $user_id, $scope) { /* diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/UserCredentials.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/UserCredentials.php index f165538ba..b10c2dd09 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/UserCredentials.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/GrantType/UserCredentials.php @@ -6,30 +6,46 @@ use OAuth2\Storage\UserCredentialsInterface; use OAuth2\ResponseType\AccessTokenInterface; use OAuth2\RequestInterface; use OAuth2\ResponseInterface; +use LogicException; /** - * * @author Brent Shaffer */ class UserCredentials implements GrantTypeInterface { + /** + * @var array + */ private $userInfo; + /** + * @var UserCredentialsInterface + */ protected $storage; /** - * @param OAuth2\Storage\UserCredentialsInterface $storage REQUIRED Storage class for retrieving user credentials information + * @param UserCredentialsInterface $storage - REQUIRED Storage class for retrieving user credentials information */ public function __construct(UserCredentialsInterface $storage) { $this->storage = $storage; } - public function getQuerystringIdentifier() + /** + * @return string + */ + public function getQueryStringIdentifier() { return 'password'; } + /** + * @param RequestInterface $request + * @param ResponseInterface $response + * @return bool|mixed|null + * + * @throws LogicException + */ public function validateRequest(RequestInterface $request, ResponseInterface $response) { if (!$request->request("password") || !$request->request("username")) { @@ -61,21 +77,45 @@ class UserCredentials implements GrantTypeInterface return true; } + /** + * Get client id + * + * @return mixed|null + */ public function getClientId() { return null; } + /** + * Get user id + * + * @return mixed + */ public function getUserId() { return $this->userInfo['user_id']; } + /** + * Get scope + * + * @return null|string + */ public function getScope() { return isset($this->userInfo['scope']) ? $this->userInfo['scope'] : null; } + /** + * Create access token + * + * @param AccessTokenInterface $accessToken + * @param mixed $client_id - client identifier related to the access token. + * @param mixed $user_id - user id associated with the access token + * @param string $scope - scopes to be stored in space-separated string. + * @return array + */ public function createAccessToken(AccessTokenInterface $accessToken, $client_id, $user_id, $scope) { return $accessToken->createAccessToken($client_id, $user_id, $scope); diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Controller/AuthorizeController.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Controller/AuthorizeController.php index c9b5c6af7..54c5f9a63 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Controller/AuthorizeController.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Controller/AuthorizeController.php @@ -11,8 +11,19 @@ use OAuth2\ResponseInterface; */ class AuthorizeController extends BaseAuthorizeController implements AuthorizeControllerInterface { + /** + * @var mixed + */ private $nonce; + /** + * Set not authorized response + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @param string $redirect_uri + * @param null $user_id + */ protected function setNotAuthorizedResponse(RequestInterface $request, ResponseInterface $response, $redirect_uri, $user_id = null) { $prompt = $request->query('prompt', 'consent'); @@ -32,6 +43,14 @@ class AuthorizeController extends BaseAuthorizeController implements AuthorizeCo $response->setRedirect($this->config['redirect_status_code'], $redirect_uri, $this->getState(), $error, $error_message); } + /** + * @TODO: add dependency injection for the parameters in this method + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @param mixed $user_id + * @return array + */ protected function buildAuthorizeParameters($request, $response, $user_id) { if (!$params = parent::buildAuthorizeParameters($request, $response, $user_id)) { @@ -49,6 +68,11 @@ class AuthorizeController extends BaseAuthorizeController implements AuthorizeCo return $params; } + /** + * @param RequestInterface $request + * @param ResponseInterface $response + * @return bool + */ public function validateAuthorizeRequest(RequestInterface $request, ResponseInterface $response) { if (!parent::validateAuthorizeRequest($request, $response)) { @@ -69,6 +93,11 @@ class AuthorizeController extends BaseAuthorizeController implements AuthorizeCo return true; } + /** + * Array of valid response types + * + * @return array + */ protected function getValidResponseTypes() { return array( @@ -87,11 +116,8 @@ class AuthorizeController extends BaseAuthorizeController implements AuthorizeCo * method checks whether OpenID Connect is enabled in the server settings * and whether the openid scope was requested. * - * @param $request_scope - * A space-separated string of scopes. - * - * @return - * TRUE if an id token is needed, FALSE otherwise. + * @param string $request_scope - A space-separated string of scopes. + * @return boolean - TRUE if an id token is needed, FALSE otherwise. */ public function needsIdToken($request_scope) { @@ -99,6 +125,9 @@ class AuthorizeController extends BaseAuthorizeController implements AuthorizeCo return $this->scopeUtil->checkScope('openid', $request_scope); } + /** + * @return mixed + */ public function getNonce() { return $this->nonce; diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Controller/AuthorizeControllerInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Controller/AuthorizeControllerInterface.php index 1e231d844..b4967c317 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Controller/AuthorizeControllerInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Controller/AuthorizeControllerInterface.php @@ -5,6 +5,8 @@ namespace OAuth2\OpenID\Controller; interface AuthorizeControllerInterface { const RESPONSE_TYPE_ID_TOKEN = 'id_token'; + const RESPONSE_TYPE_ID_TOKEN_TOKEN = 'id_token token'; + const RESPONSE_TYPE_CODE_ID_TOKEN = 'code id_token'; } diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Controller/UserInfoController.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Controller/UserInfoController.php index 30cb942d0..c489b7af3 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Controller/UserInfoController.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Controller/UserInfoController.php @@ -16,30 +16,34 @@ use OAuth2\ResponseInterface; */ class UserInfoController extends ResourceController implements UserInfoControllerInterface { - private $token; - - protected $tokenType; - protected $tokenStorage; + /** + * @var UserClaimsInterface + */ protected $userClaimsStorage; - protected $config; - protected $scopeUtil; + /** + * Constructor + * + * @param TokenTypeInterface $tokenType + * @param AccessTokenInterface $tokenStorage + * @param UserClaimsInterface $userClaimsStorage + * @param array $config + * @param ScopeInterface $scopeUtil + */ public function __construct(TokenTypeInterface $tokenType, AccessTokenInterface $tokenStorage, UserClaimsInterface $userClaimsStorage, $config = array(), ScopeInterface $scopeUtil = null) { - $this->tokenType = $tokenType; - $this->tokenStorage = $tokenStorage; + parent::__construct($tokenType, $tokenStorage, $config, $scopeUtil); + $this->userClaimsStorage = $userClaimsStorage; - - $this->config = array_merge(array( - 'www_realm' => 'Service', - ), $config); - - if (is_null($scopeUtil)) { - $scopeUtil = new Scope(); - } - $this->scopeUtil = $scopeUtil; } + /** + * Handle the user info request + * + * @param RequestInterface $request + * @param ResponseInterface $response + * @return void + */ public function handleUserInfoRequest(RequestInterface $request, ResponseInterface $response) { if (!$this->verifyResourceRequest($request, $response, 'openid')) { @@ -55,4 +59,4 @@ class UserInfoController extends ResourceController implements UserInfoControlle ); $response->addParameters($claims); } -} +} \ No newline at end of file diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Controller/UserInfoControllerInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Controller/UserInfoControllerInterface.php index a89049d49..88e9228d0 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Controller/UserInfoControllerInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Controller/UserInfoControllerInterface.php @@ -9,15 +9,22 @@ use OAuth2\ResponseInterface; * This controller is called when the user claims for OpenID Connect's * UserInfo endpoint should be returned. * - * ex: - * > $response = new OAuth2\Response(); - * > $userInfoController->handleUserInfoRequest( - * > OAuth2\Request::createFromGlobals(), - * > $response; - * > $response->send(); - * + * @code + * $response = new OAuth2\Response(); + * $userInfoController->handleUserInfoRequest( + * OAuth2\Request::createFromGlobals(), + * $response + * ); + * $response->send(); + * @endcode */ interface UserInfoControllerInterface { + /** + * Handle user info request + * + * @param RequestInterface $request + * @param ResponseInterface $response + */ public function handleUserInfoRequest(RequestInterface $request, ResponseInterface $response); } diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/GrantType/AuthorizationCode.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/GrantType/AuthorizationCode.php index 8ed1edc26..ee113a0e5 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/GrantType/AuthorizationCode.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/GrantType/AuthorizationCode.php @@ -6,11 +6,19 @@ use OAuth2\GrantType\AuthorizationCode as BaseAuthorizationCode; use OAuth2\ResponseType\AccessTokenInterface; /** - * * @author Brent Shaffer */ class AuthorizationCode extends BaseAuthorizationCode { + /** + * Create access token + * + * @param AccessTokenInterface $accessToken + * @param mixed $client_id - client identifier related to the access token. + * @param mixed $user_id - user id associated with the access token + * @param string $scope - scopes to be stored in space-separated string. + * @return array + */ public function createAccessToken(AccessTokenInterface $accessToken, $client_id, $user_id, $scope) { $includeRefreshToken = true; diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/AuthorizationCode.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/AuthorizationCode.php index 8971954c5..b8ad41ffb 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/AuthorizationCode.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/AuthorizationCode.php @@ -6,16 +6,26 @@ use OAuth2\ResponseType\AuthorizationCode as BaseAuthorizationCode; use OAuth2\OpenID\Storage\AuthorizationCodeInterface as AuthorizationCodeStorageInterface; /** - * * @author Brent Shaffer */ class AuthorizationCode extends BaseAuthorizationCode implements AuthorizationCodeInterface { + /** + * Constructor + * + * @param AuthorizationCodeStorageInterface $storage + * @param array $config + */ public function __construct(AuthorizationCodeStorageInterface $storage, array $config = array()) { parent::__construct($storage, $config); } + /** + * @param $params + * @param null $user_id + * @return array + */ public function getAuthorizeResponse($params, $user_id = null) { // build the URL to redirect to @@ -35,18 +45,14 @@ class AuthorizationCode extends BaseAuthorizationCode implements AuthorizationCo /** * Handle the creation of the authorization code. * - * @param $client_id - * Client identifier related to the authorization code - * @param $user_id - * User ID associated with the authorization code - * @param $redirect_uri - * An absolute URI to which the authorization server will redirect the - * user-agent to when the end-user authorization step is completed. - * @param $scope - * (optional) Scopes to be stored in space-separated string. - * @param $id_token - * (optional) The OpenID Connect id_token. + * @param mixed $client_id - Client identifier related to the authorization code + * @param mixed $user_id - User ID associated with the authorization code + * @param string $redirect_uri - An absolute URI to which the authorization server will redirect the + * user-agent to when the end-user authorization step is completed. + * @param string $scope - OPTIONAL Scopes to be stored in space-separated string. + * @param string $id_token - OPTIONAL The OpenID Connect id_token. * + * @return string * @see http://tools.ietf.org/html/rfc6749#section-4 * @ingroup oauth2_section_4 */ diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/AuthorizationCodeInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/AuthorizationCodeInterface.php index ea4779255..eb94ef077 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/AuthorizationCodeInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/AuthorizationCodeInterface.php @@ -5,7 +5,6 @@ namespace OAuth2\OpenID\ResponseType; use OAuth2\ResponseType\AuthorizationCodeInterface as BaseAuthorizationCodeInterface; /** - * * @author Brent Shaffer */ interface AuthorizationCodeInterface extends BaseAuthorizationCodeInterface @@ -13,12 +12,13 @@ interface AuthorizationCodeInterface extends BaseAuthorizationCodeInterface /** * Handle the creation of the authorization code. * - * @param $client_id Client identifier related to the authorization code - * @param $user_id User ID associated with the authorization code - * @param $redirect_uri An absolute URI to which the authorization server will redirect the - * user-agent to when the end-user authorization step is completed. - * @param $scope OPTIONAL Scopes to be stored in space-separated string. - * @param $id_token OPTIONAL The OpenID Connect id_token. + * @param mixed $client_id - Client identifier related to the authorization code + * @param mixed $user_id - User ID associated with the authorization code + * @param string $redirect_uri - An absolute URI to which the authorization server will redirect the + * user-agent to when the end-user authorization step is completed. + * @param string $scope - OPTIONAL Scopes to be stored in space-separated string. + * @param string $id_token - OPTIONAL The OpenID Connect id_token. + * @return string * * @see http://tools.ietf.org/html/rfc6749#section-4 * @ingroup oauth2_section_4 diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/CodeIdToken.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/CodeIdToken.php index ac7764d6c..2696ada37 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/CodeIdToken.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/CodeIdToken.php @@ -4,15 +4,31 @@ namespace OAuth2\OpenID\ResponseType; class CodeIdToken implements CodeIdTokenInterface { + /** + * @var AuthorizationCodeInterface + */ protected $authCode; + + /** + * @var IdTokenInterface + */ protected $idToken; + /** + * @param AuthorizationCodeInterface $authCode + * @param IdTokenInterface $idToken + */ public function __construct(AuthorizationCodeInterface $authCode, IdTokenInterface $idToken) { $this->authCode = $authCode; $this->idToken = $idToken; } + /** + * @param array $params + * @param mixed $user_id + * @return mixed + */ public function getAuthorizeResponse($params, $user_id = null) { $result = $this->authCode->getAuthorizeResponse($params, $user_id); diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/IdToken.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/IdToken.php index 97777fbf2..55e446074 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/IdToken.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/IdToken.php @@ -6,14 +6,38 @@ use OAuth2\Encryption\EncryptionInterface; use OAuth2\Encryption\Jwt; use OAuth2\Storage\PublicKeyInterface; use OAuth2\OpenID\Storage\UserClaimsInterface; +use LogicException; class IdToken implements IdTokenInterface { + /** + * @var UserClaimsInterface + */ protected $userClaimsStorage; + /** + * @var PublicKeyInterface + */ protected $publicKeyStorage; + + /** + * @var array + */ protected $config; + + /** + * @var EncryptionInterface + */ protected $encryptionUtil; + /** + * Constructor + * + * @param UserClaimsInterface $userClaimsStorage + * @param PublicKeyInterface $publicKeyStorage + * @param array $config + * @param EncryptionInterface $encryptionUtil + * @throws LogicException + */ public function __construct(UserClaimsInterface $userClaimsStorage, PublicKeyInterface $publicKeyStorage, array $config = array(), EncryptionInterface $encryptionUtil = null) { $this->userClaimsStorage = $userClaimsStorage; @@ -24,13 +48,18 @@ class IdToken implements IdTokenInterface $this->encryptionUtil = $encryptionUtil; if (!isset($config['issuer'])) { - throw new \LogicException('config parameter "issuer" must be set'); + throw new LogicException('config parameter "issuer" must be set'); } $this->config = array_merge(array( 'id_lifetime' => 3600, ), $config); } + /** + * @param array $params + * @param null $userInfo + * @return array|mixed + */ public function getAuthorizeResponse($params, $userInfo = null) { // build the URL to redirect to @@ -50,6 +79,16 @@ class IdToken implements IdTokenInterface return array($params['redirect_uri'], $result); } + /** + * Create id token + * + * @param string $client_id + * @param mixed $userInfo + * @param mixed $nonce + * @param mixed $userClaims + * @param mixed $access_token + * @return mixed|string + */ public function createIdToken($client_id, $userInfo, $nonce = null, $userClaims = null, $access_token = null) { // pull auth_time from user info if supplied @@ -79,6 +118,11 @@ class IdToken implements IdTokenInterface return $this->encodeToken($token, $client_id); } + /** + * @param $access_token + * @param null $client_id + * @return mixed|string + */ protected function createAtHash($access_token, $client_id = null) { // maps HS256 and RS256 to sha256, etc. @@ -90,6 +134,11 @@ class IdToken implements IdTokenInterface return $this->encryptionUtil->urlSafeB64Encode($at_hash); } + /** + * @param array $token + * @param null $client_id + * @return mixed|string + */ protected function encodeToken(array $token, $client_id = null) { $private_key = $this->publicKeyStorage->getPrivateKey($client_id); @@ -98,6 +147,11 @@ class IdToken implements IdTokenInterface return $this->encryptionUtil->encode($token, $private_key, $algorithm); } + /** + * @param $userInfo + * @return array + * @throws LogicException + */ private function getUserIdAndAuthTime($userInfo) { $auth_time = null; @@ -105,7 +159,7 @@ class IdToken implements IdTokenInterface // support an array for user_id / auth_time if (is_array($userInfo)) { if (!isset($userInfo['user_id'])) { - throw new \LogicException('if $user_id argument is an array, user_id index must be set'); + throw new LogicException('if $user_id argument is an array, user_id index must be set'); } $auth_time = isset($userInfo['auth_time']) ? $userInfo['auth_time'] : null; diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/IdTokenInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/IdTokenInterface.php index 0bd2f8391..226a3bcbb 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/IdTokenInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/IdTokenInterface.php @@ -15,12 +15,13 @@ interface IdTokenInterface extends ResponseTypeInterface * If the Implicit Flow is used, the token and id_token are generated and * returned together. * - * @param string $client_id The client id. - * @param string $user_id The user id. - * @param string $nonce OPTIONAL The nonce. - * @param string $userClaims OPTIONAL Claims about the user. - * @param string $access_token OPTIONAL The access token, if known. - * + * @param string $client_id - The client id. + * @param mixed $userInfo - User info + * @param string $nonce - OPTIONAL The nonce. + * @param string $userClaims - OPTIONAL Claims about the user. + * @param string $access_token - OPTIONAL The access token, if known. + + * @internal param string $user_id - The user id. * @return string The ID Token represented as a JSON Web Token (JWT). * * @see http://openid.net/specs/openid-connect-core-1_0.html#IDToken diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/IdTokenToken.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/IdTokenToken.php index f0c59799b..94c51ae4d 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/IdTokenToken.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/ResponseType/IdTokenToken.php @@ -6,15 +6,33 @@ use OAuth2\ResponseType\AccessTokenInterface; class IdTokenToken implements IdTokenTokenInterface { + /** + * @var AccessTokenInterface + */ protected $accessToken; + + /** + * @var IdTokenInterface + */ protected $idToken; + /** + * Constructor + * + * @param AccessTokenInterface $accessToken + * @param IdTokenInterface $idToken + */ public function __construct(AccessTokenInterface $accessToken, IdTokenInterface $idToken) { $this->accessToken = $accessToken; $this->idToken = $idToken; } + /** + * @param array $params + * @param mixed $user_id + * @return mixed + */ public function getAuthorizeResponse($params, $user_id = null) { $result = $this->accessToken->getAuthorizeResponse($params, $user_id); diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Storage/AuthorizationCodeInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Storage/AuthorizationCodeInterface.php index 51dd867ec..446cec928 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Storage/AuthorizationCodeInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Storage/AuthorizationCodeInterface.php @@ -23,13 +23,13 @@ interface AuthorizationCodeInterface extends BaseAuthorizationCodeInterface * * Required for OAuth2::GRANT_TYPE_AUTH_CODE. * - * @param $code authorization code to be stored. - * @param $client_id client identifier to be stored. - * @param $user_id user identifier to be stored. - * @param string $redirect_uri redirect URI(s) to be stored in a space-separated string. - * @param int $expires expiration to be stored as a Unix timestamp. - * @param string $scope OPTIONAL scopes to be stored in space-separated string. - * @param string $id_token OPTIONAL the OpenID Connect id_token. + * @param string $code - authorization code to be stored. + * @param mixed $client_id - client identifier to be stored. + * @param mixed $user_id - user identifier to be stored. + * @param string $redirect_uri - redirect URI(s) to be stored in a space-separated string. + * @param int $expires - expiration to be stored as a Unix timestamp. + * @param string $scope - OPTIONAL scopes to be stored in space-separated string. + * @param string $id_token - OPTIONAL the OpenID Connect id_token. * * @ingroup oauth2_section_4 */ diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Storage/UserClaimsInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Storage/UserClaimsInterface.php index f230bef9e..9c5e7c8c4 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Storage/UserClaimsInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/OpenID/Storage/UserClaimsInterface.php @@ -23,14 +23,11 @@ interface UserClaimsInterface * Groups of claims are returned based on the requested scopes. No group * is required, and no claim is required. * - * @param $user_id - * The id of the user for which claims should be returned. - * @param $scope - * The requested scope. + * @param mixed $user_id - The id of the user for which claims should be returned. + * @param string $scope - The requested scope. * Scopes with matching claims: profile, email, address, phone. * - * @return - * An array in the claim => value format. + * @return array - An array in the claim => value format. * * @see http://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims */ diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Request.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Request.php index c92cee821..c96cb972f 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Request.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Request.php @@ -2,6 +2,8 @@ namespace OAuth2; +use LogicException; + /** * OAuth2\Request * This class is taken from the Symfony2 Framework and is part of the Symfony package. @@ -21,13 +23,14 @@ class Request implements RequestInterface /** * Constructor. * - * @param array $query The GET parameters - * @param array $request The POST parameters - * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) - * @param array $cookies The COOKIE parameters - * @param array $files The FILES parameters - * @param array $server The SERVER parameters - * @param string $content The raw body data + * @param array $query - The GET parameters + * @param array $request - The POST parameters + * @param array $attributes - The request attributes (parameters parsed from the PATH_INFO, ...) + * @param array $cookies - The COOKIE parameters + * @param array $files - The FILES parameters + * @param array $server - The SERVER parameters + * @param string $content - The raw body data + * @param array $headers - The headers * * @api */ @@ -41,13 +44,14 @@ class Request implements RequestInterface * * This method also re-initializes all properties. * - * @param array $query The GET parameters - * @param array $request The POST parameters - * @param array $attributes The request attributes (parameters parsed from the PATH_INFO, ...) - * @param array $cookies The COOKIE parameters - * @param array $files The FILES parameters - * @param array $server The SERVER parameters - * @param string $content The raw body data + * @param array $query - The GET parameters + * @param array $request - The POST parameters + * @param array $attributes - The request attributes (parameters parsed from the PATH_INFO, ...) + * @param array $cookies - The COOKIE parameters + * @param array $files - The FILES parameters + * @param array $server - The SERVER parameters + * @param string $content - The raw body data + * @param array $headers - The headers * * @api */ @@ -63,21 +67,41 @@ class Request implements RequestInterface $this->headers = is_null($headers) ? $this->getHeadersFromServer($this->server) : $headers; } + /** + * @param string $name + * @param mixed $default + * @return mixed + */ public function query($name, $default = null) { return isset($this->query[$name]) ? $this->query[$name] : $default; } + /** + * @param string $name + * @param mixed $default + * @return mixed + */ public function request($name, $default = null) { return isset($this->request[$name]) ? $this->request[$name] : $default; } + /** + * @param string $name + * @param mixed $default + * @return mixed + */ public function server($name, $default = null) { return isset($this->server[$name]) ? $this->server[$name] : $default; } + /** + * @param string $name + * @param mixed $default + * @return mixed + */ public function headers($name, $default = null) { $headers = array_change_key_case($this->headers); @@ -86,6 +110,9 @@ class Request implements RequestInterface return isset($headers[$name]) ? $headers[$name] : $default; } + /** + * @return array + */ public function getAllQueryParameters() { return $this->query; @@ -94,14 +121,15 @@ class Request implements RequestInterface /** * Returns the request body content. * - * @param Boolean $asResource If true, a resource will be returned + * @param boolean $asResource - If true, a resource will be returned + * @return string|resource - The request body content or a resource to read the body stream. * - * @return string|resource The request body content or a resource to read the body stream. + * @throws LogicException */ public function getContent($asResource = false) { if (false === $this->content || (true === $asResource && null !== $this->content)) { - throw new \LogicException('getContent() can only be called once when using the resource return type.'); + throw new LogicException('getContent() can only be called once when using the resource return type.'); } if (true === $asResource) { @@ -117,6 +145,10 @@ class Request implements RequestInterface return $this->content; } + /** + * @param array $server + * @return array + */ private function getHeadersFromServer($server) { $headers = array(); @@ -185,13 +217,15 @@ class Request implements RequestInterface /** * Creates a new request with values from PHP's super globals. * - * @return Request A new request + * @return Request - A new request * * @api */ public static function createFromGlobals() { $class = get_called_class(); + + /** @var Request $request */ $request = new $class($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER); $contentType = $request->server('CONTENT_TYPE', ''); diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/RequestInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/RequestInterface.php index 8a70d5fad..1d036b735 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/RequestInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/RequestInterface.php @@ -4,13 +4,36 @@ namespace OAuth2; interface RequestInterface { + /** + * @param string $name + * @param mixed $default + * @return mixed + */ public function query($name, $default = null); + /** + * @param string $name + * @param mixed $default + * @return mixed + */ public function request($name, $default = null); + /** + * @param string $name + * @param mixed $default + * @return mixed + */ public function server($name, $default = null); + /** + * @param string $name + * @param mixed $default + * @return mixed + */ public function headers($name, $default = null); + /** + * @return mixed + */ public function getAllQueryParameters(); } diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Response.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Response.php index fc1e62a98..ccd797ae7 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Response.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Response.php @@ -2,6 +2,8 @@ namespace OAuth2; +use InvalidArgumentException; + /** * Class to handle OAuth2 Responses in a graceful way. Use this interface * to output the proper OAuth2 responses. @@ -13,12 +15,34 @@ namespace OAuth2; */ class Response implements ResponseInterface { + /** + * @var string + */ public $version; + + /** + * @var int + */ protected $statusCode = 200; + + /** + * @var string + */ protected $statusText; + + /** + * @var array + */ protected $parameters = array(); + + /** + * @var array + */ protected $httpHeaders = array(); + /** + * @var array + */ public static $statusTexts = array( 100 => 'Continue', 101 => 'Switching Protocols', @@ -63,6 +87,11 @@ class Response implements ResponseInterface 505 => 'HTTP Version Not Supported', ); + /** + * @param array $parameters + * @param int $statusCode + * @param array $headers + */ public function __construct($parameters = array(), $statusCode = 200, $headers = array()) { $this->setParameters($parameters); @@ -102,76 +131,128 @@ class Response implements ResponseInterface return sprintf("%s: %s\n", $name, $value); } + /** + * @return int + */ public function getStatusCode() { return $this->statusCode; } + /** + * @param int $statusCode + * @param string $text + * @throws InvalidArgumentException + */ public function setStatusCode($statusCode, $text = null) { $this->statusCode = (int) $statusCode; if ($this->isInvalid()) { - throw new \InvalidArgumentException(sprintf('The HTTP status code "%s" is not valid.', $statusCode)); + throw new InvalidArgumentException(sprintf('The HTTP status code "%s" is not valid.', $statusCode)); } $this->statusText = false === $text ? '' : (null === $text ? self::$statusTexts[$this->statusCode] : $text); } + /** + * @return string + */ public function getStatusText() { return $this->statusText; } + /** + * @return array + */ public function getParameters() { return $this->parameters; } + /** + * @param array $parameters + */ public function setParameters(array $parameters) { $this->parameters = $parameters; } + /** + * @param array $parameters + */ public function addParameters(array $parameters) { $this->parameters = array_merge($this->parameters, $parameters); } + /** + * @param string $name + * @param mixed $default + * @return mixed + */ public function getParameter($name, $default = null) { return isset($this->parameters[$name]) ? $this->parameters[$name] : $default; } + /** + * @param string $name + * @param mixed $value + */ public function setParameter($name, $value) { $this->parameters[$name] = $value; } + /** + * @param array $httpHeaders + */ public function setHttpHeaders(array $httpHeaders) { $this->httpHeaders = $httpHeaders; } + /** + * @param string $name + * @param mixed $value + */ public function setHttpHeader($name, $value) { $this->httpHeaders[$name] = $value; } + /** + * @param array $httpHeaders + */ public function addHttpHeaders(array $httpHeaders) { $this->httpHeaders = array_merge($this->httpHeaders, $httpHeaders); } + /** + * @return array + */ public function getHttpHeaders() { return $this->httpHeaders; } + /** + * @param string $name + * @param mixed $default + * @return mixed + */ public function getHttpHeader($name, $default = null) { return isset($this->httpHeaders[$name]) ? $this->httpHeaders[$name] : $default; } + /** + * @param string $format + * @return mixed + * @throws InvalidArgumentException + */ public function getResponseBody($format = 'json') { switch ($format) { @@ -187,10 +268,13 @@ class Response implements ResponseInterface return $xml->asXML(); } - throw new \InvalidArgumentException(sprintf('The format %s is not supported', $format)); + throw new InvalidArgumentException(sprintf('The format %s is not supported', $format)); } + /** + * @param string $format + */ public function send($format = 'json') { // headers have already been sent by the developer @@ -215,6 +299,14 @@ class Response implements ResponseInterface echo $this->getResponseBody($format); } + /** + * @param int $statusCode + * @param string $error + * @param string $errorDescription + * @param string $errorUri + * @return mixed + * @throws InvalidArgumentException + */ public function setError($statusCode, $error, $errorDescription = null, $errorUri = null) { $parameters = array( @@ -239,14 +331,24 @@ class Response implements ResponseInterface $this->addHttpHeaders($httpHeaders); if (!$this->isClientError() && !$this->isServerError()) { - throw new \InvalidArgumentException(sprintf('The HTTP status code is not an error ("%s" given).', $statusCode)); + throw new InvalidArgumentException(sprintf('The HTTP status code is not an error ("%s" given).', $statusCode)); } } + /** + * @param int $statusCode + * @param string $url + * @param string $state + * @param string $error + * @param string $errorDescription + * @param string $errorUri + * @return mixed + * @throws InvalidArgumentException + */ public function setRedirect($statusCode, $url, $state = null, $error = null, $errorDescription = null, $errorUri = null) { if (empty($url)) { - throw new \InvalidArgumentException('Cannot redirect to an empty URL.'); + throw new InvalidArgumentException('Cannot redirect to an empty URL.'); } $parameters = array(); @@ -271,15 +373,16 @@ class Response implements ResponseInterface $this->addHttpHeaders(array('Location' => $url)); if (!$this->isRedirection()) { - throw new \InvalidArgumentException(sprintf('The HTTP status code is not a redirect ("%s" given).', $statusCode)); + throw new InvalidArgumentException(sprintf('The HTTP status code is not a redirect ("%s" given).', $statusCode)); } } - // http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html /** * @return Boolean * * @api + * + * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html */ public function isInvalid() { @@ -336,8 +439,11 @@ class Response implements ResponseInterface return $this->statusCode >= 500 && $this->statusCode < 600; } - /* - * Functions from Symfony2 HttpFoundation - output pretty header + /** + * Function from Symfony2 HttpFoundation - output pretty header + * + * @param array $headers + * @return string */ private function getHttpHeadersAsString($headers) { @@ -357,11 +463,23 @@ class Response implements ResponseInterface return $content; } + /** + * Function from Symfony2 HttpFoundation - output pretty header + * + * @param string $name + * @return mixed + */ private function beautifyHeaderName($name) { return preg_replace_callback('/\-(.)/', array($this, 'beautifyCallback'), ucfirst($name)); } + /** + * Function from Symfony2 HttpFoundation - output pretty header + * + * @param array $match + * @return string + */ private function beautifyCallback($match) { return '-'.strtoupper($match[1]); diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseInterface.php index c99b5f7d1..fe920864a 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseInterface.php @@ -6,19 +6,48 @@ namespace OAuth2; * Interface which represents an object response. Meant to handle and display the proper OAuth2 Responses * for errors and successes * - * @see OAuth2\Response + * @see \OAuth2\Response */ interface ResponseInterface { + /** + * @param array $parameters + */ public function addParameters(array $parameters); + /** + * @param array $httpHeaders + */ public function addHttpHeaders(array $httpHeaders); + /** + * @param int $statusCode + */ public function setStatusCode($statusCode); + /** + * @param int $statusCode + * @param string $name + * @param string $description + * @param string $uri + * @return mixed + */ public function setError($statusCode, $name, $description = null, $uri = null); + /** + * @param int $statusCode + * @param string $url + * @param string $state + * @param string $error + * @param string $errorDescription + * @param string $errorUri + * @return mixed + */ public function setRedirect($statusCode, $url, $state = null, $error = null, $errorDescription = null, $errorUri = null); + /** + * @param string $name + * @return mixed + */ public function getParameter($name); } diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/AccessToken.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/AccessToken.php index 98f51218f..e836a3447 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/AccessToken.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/AccessToken.php @@ -4,28 +4,39 @@ namespace OAuth2\ResponseType; use OAuth2\Storage\AccessTokenInterface as AccessTokenStorageInterface; use OAuth2\Storage\RefreshTokenInterface; +use RuntimeException; /** - * * @author Brent Shaffer */ class AccessToken implements AccessTokenInterface { + /** + * @var AccessTokenInterface + */ protected $tokenStorage; + + /** + * @var RefreshTokenInterface + */ protected $refreshStorage; + + /** + * @var array + */ protected $config; /** - * @param OAuth2\Storage\AccessTokenInterface $tokenStorage REQUIRED Storage class for saving access token information - * @param OAuth2\Storage\RefreshTokenInterface $refreshStorage OPTIONAL Storage class for saving refresh token information - * @param array $config OPTIONAL Configuration options for the server - * - * $config = array( - * 'token_type' => 'bearer', // token type identifier - * 'access_lifetime' => 3600, // time before access token expires - * 'refresh_token_lifetime' => 1209600, // time before refresh token expires - * ); - * + * @param AccessTokenStorageInterface $tokenStorage - REQUIRED Storage class for saving access token information + * @param RefreshTokenInterface $refreshStorage - OPTIONAL Storage class for saving refresh token information + * @param array $config - OPTIONAL Configuration options for the server + * @code + * $config = array( + * 'token_type' => 'bearer', // token type identifier + * 'access_lifetime' => 3600, // time before access token expires + * 'refresh_token_lifetime' => 1209600, // time before refresh token expires + * ); + * @endcode */ public function __construct(AccessTokenStorageInterface $tokenStorage, RefreshTokenInterface $refreshStorage = null, array $config = array()) { @@ -39,6 +50,13 @@ class AccessToken implements AccessTokenInterface ), $config); } + /** + * Get authorize response + * + * @param array $params + * @param mixed $user_id + * @return array + */ public function getAuthorizeResponse($params, $user_id = null) { // build the URL to redirect to @@ -64,10 +82,11 @@ class AccessToken implements AccessTokenInterface /** * Handle the creation of access token, also issue refresh token if supported / desirable. * - * @param $client_id client identifier related to the access token. - * @param $user_id user ID associated with the access token - * @param $scope OPTIONAL scopes to be stored in space-separated string. - * @param bool $includeRefreshToken if true, a new refresh_token will be added to the response + * @param mixed $client_id - client identifier related to the access token. + * @param mixed $user_id - user ID associated with the access token + * @param string $scope - OPTIONAL scopes to be stored in space-separated string. + * @param bool $includeRefreshToken - if true, a new refresh_token will be added to the response + * @return array * * @see http://tools.ietf.org/html/rfc6749#section-5 * @ingroup oauth2_section_5 @@ -107,13 +126,18 @@ class AccessToken implements AccessTokenInterface * Implementing classes may want to override this function to implement * other access token generation schemes. * - * @return - * An unique access token. + * @return string - A unique access token. * * @ingroup oauth2_section_4 */ protected function generateAccessToken() { + if (function_exists('random_bytes')) { + $randomData = random_bytes(20); + if ($randomData !== false && strlen($randomData) === 20) { + return bin2hex($randomData); + } + } if (function_exists('openssl_random_pseudo_bytes')) { $randomData = openssl_random_pseudo_bytes(20); if ($randomData !== false && strlen($randomData) === 20) { @@ -144,8 +168,7 @@ class AccessToken implements AccessTokenInterface * Implementing classes may want to override this function to implement * other refresh token generation schemes. * - * @return - * An unique refresh. + * @return string - A unique refresh token. * * @ingroup oauth2_section_4 * @see OAuth2::generateAccessToken() @@ -162,6 +185,7 @@ class AccessToken implements AccessTokenInterface * * @param $token * @param null $tokenTypeHint + * @throws RuntimeException * @return boolean */ public function revokeToken($token, $tokenTypeHint = null) @@ -174,7 +198,7 @@ class AccessToken implements AccessTokenInterface /** @TODO remove in v2 */ if (!method_exists($this->tokenStorage, 'unsetAccessToken')) { - throw new \RuntimeException( + throw new RuntimeException( sprintf('Token storage %s must implement unsetAccessToken method', get_class($this->tokenStorage) )); } diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/AccessTokenInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/AccessTokenInterface.php index 4bd3928d8..0e576df52 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/AccessTokenInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/AccessTokenInterface.php @@ -3,7 +3,6 @@ namespace OAuth2\ResponseType; /** - * * @author Brent Shaffer */ interface AccessTokenInterface extends ResponseTypeInterface @@ -11,10 +10,10 @@ interface AccessTokenInterface extends ResponseTypeInterface /** * Handle the creation of access token, also issue refresh token if supported / desirable. * - * @param $client_id client identifier related to the access token. - * @param $user_id user ID associated with the access token - * @param $scope OPTONAL scopes to be stored in space-separated string. - * @param bool $includeRefreshToken if true, a new refresh_token will be added to the response + * @param mixed $client_id - client identifier related to the access token. + * @param mixed $user_id - user ID associated with the access token + * @param string $scope - OPTONAL scopes to be stored in space-separated string. + * @param bool $includeRefreshToken - if true, a new refresh_token will be added to the response * * @see http://tools.ietf.org/html/rfc6749#section-5 * @ingroup oauth2_section_5 @@ -31,4 +30,4 @@ interface AccessTokenInterface extends ResponseTypeInterface * @todo v2.0 include this method in interface. Omitted to maintain BC in v1.x */ //public function revokeToken($token, $tokenTypeHint); -} +} \ No newline at end of file diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/AuthorizationCode.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/AuthorizationCode.php index 52aeb4be5..b92c73cda 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/AuthorizationCode.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/AuthorizationCode.php @@ -5,7 +5,6 @@ namespace OAuth2\ResponseType; use OAuth2\Storage\AuthorizationCodeInterface as AuthorizationCodeStorageInterface; /** - * * @author Brent Shaffer */ class AuthorizationCode implements AuthorizationCodeInterface @@ -85,7 +84,9 @@ class AuthorizationCode implements AuthorizationCodeInterface protected function generateAuthorizationCode() { $tokenLen = 40; - if (function_exists('openssl_random_pseudo_bytes')) { + if (function_exists('random_bytes')) { + $randomData = random_bytes(100); + } elseif (function_exists('openssl_random_pseudo_bytes')) { $randomData = openssl_random_pseudo_bytes(100); } elseif (function_exists('mcrypt_create_iv')) { $randomData = mcrypt_create_iv(100, MCRYPT_DEV_URANDOM); diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/AuthorizationCodeInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/AuthorizationCodeInterface.php index df777e221..4f0a29df4 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/AuthorizationCodeInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/AuthorizationCodeInterface.php @@ -3,7 +3,6 @@ namespace OAuth2\ResponseType; /** - * * @author Brent Shaffer */ interface AuthorizationCodeInterface extends ResponseTypeInterface @@ -17,11 +16,12 @@ interface AuthorizationCodeInterface extends ResponseTypeInterface /** * Handle the creation of the authorization code. * - * @param $client_id client identifier related to the authorization code - * @param $user_id user id associated with the authorization code - * @param $redirect_uri an absolute URI to which the authorization server will redirect the - * user-agent to when the end-user authorization step is completed. - * @param $scope OPTIONAL scopes to be stored in space-separated string. + * @param mixed $client_id - Client identifier related to the authorization code + * @param mixed $user_id - User ID associated with the authorization code + * @param string $redirect_uri - An absolute URI to which the authorization server will redirect the + * user-agent to when the end-user authorization step is completed. + * @param string $scope - OPTIONAL Scopes to be stored in space-separated string. + * @return string * * @see http://tools.ietf.org/html/rfc6749#section-4 * @ingroup oauth2_section_4 diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/JwtAccessToken.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/JwtAccessToken.php index 3942fe41e..0af9705ff 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/JwtAccessToken.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/JwtAccessToken.php @@ -10,7 +10,6 @@ use OAuth2\Storage\PublicKeyInterface; use OAuth2\Storage\Memory; /** - * * @author Brent Shaffer */ class JwtAccessToken extends AccessToken @@ -19,10 +18,13 @@ class JwtAccessToken extends AccessToken protected $encryptionUtil; /** - * @param $config - * - store_encrypted_token_string (bool true) - * whether the entire encrypted string is stored, - * or just the token ID is stored + * @param PublicKeyInterface $publicKeyStorage - + * @param AccessTokenStorageInterface $tokenStorage - + * @param RefreshTokenInterface $refreshStorage - + * @param array $config - array with key store_encrypted_token_string (bool true) + * whether the entire encrypted string is stored, + * or just the token ID is stored + * @param EncryptionInterface $encryptionUtil - */ public function __construct(PublicKeyInterface $publicKeyStorage = null, AccessTokenStorageInterface $tokenStorage = null, RefreshTokenInterface $refreshStorage = null, array $config = array(), EncryptionInterface $encryptionUtil = null) { @@ -45,46 +47,31 @@ class JwtAccessToken extends AccessToken /** * Handle the creation of access token, also issue refresh token if supported / desirable. * - * @param $client_id - * Client identifier related to the access token. - * @param $user_id - * User ID associated with the access token - * @param $scope - * (optional) Scopes to be stored in space-separated string. - * @param bool $includeRefreshToken - * If true, a new refresh_token will be added to the response + * @param mixed $client_id - Client identifier related to the access token. + * @param mixed $user_id - User ID associated with the access token + * @param string $scope - (optional) Scopes to be stored in space-separated string. + * @param bool $includeRefreshToken - If true, a new refresh_token will be added to the response + * @return array - The access token * * @see http://tools.ietf.org/html/rfc6749#section-5 * @ingroup oauth2_section_5 */ public function createAccessToken($client_id, $user_id, $scope = null, $includeRefreshToken = true) { - // token to encrypt - $expires = time() + $this->config['access_lifetime']; - $id = $this->generateAccessToken(); - $jwtAccessToken = array( - 'id' => $id, // for BC (see #591) - 'jti' => $id, - 'iss' => $this->config['issuer'], - 'aud' => $client_id, - 'sub' => $user_id, - 'exp' => $expires, - 'iat' => time(), - 'token_type' => $this->config['token_type'], - 'scope' => $scope - ); + // payload to encrypt + $payload = $this->createPayload($client_id, $user_id, $scope); /* - * Encode the token data into a single access_token string + * Encode the payload data into a single JWT access_token string */ - $access_token = $this->encodeToken($jwtAccessToken, $client_id); + $access_token = $this->encodeToken($payload, $client_id); /* * Save the token to a secondary storage. This is implemented on the * OAuth2\Storage\JwtAccessToken side, and will not actually store anything, * if no secondary storage has been supplied */ - $token_to_store = $this->config['store_encrypted_token_string'] ? $access_token : $jwtAccessToken['id']; + $token_to_store = $this->config['store_encrypted_token_string'] ? $access_token : $payload['id']; $this->tokenStorage->setAccessToken($token_to_store, $client_id, $user_id, $this->config['access_lifetime'] ? time() + $this->config['access_lifetime'] : null, $scope); // token to return to the client @@ -114,6 +101,11 @@ class JwtAccessToken extends AccessToken return $token; } + /** + * @param array $token + * @param mixed $client_id + * @return mixed + */ protected function encodeToken(array $token, $client_id = null) { $private_key = $this->publicKeyStorage->getPrivateKey($client_id); @@ -121,4 +113,31 @@ class JwtAccessToken extends AccessToken return $this->encryptionUtil->encode($token, $private_key, $algorithm); } + + /** + * This function can be used to create custom JWT payloads + * + * @param mixed $client_id - Client identifier related to the access token. + * @param mixed $user_id - User ID associated with the access token + * @param string $scope - (optional) Scopes to be stored in space-separated string. + * @return array - The access token + */ + protected function createPayload($client_id, $user_id, $scope = null) + { + // token to encrypt + $expires = time() + $this->config['access_lifetime']; + $id = $this->generateAccessToken(); + + return array( + 'id' => $id, // for BC (see #591) + 'jti' => $id, + 'iss' => $this->config['issuer'], + 'aud' => $client_id, + 'sub' => $user_id, + 'exp' => $expires, + 'iat' => time(), + 'token_type' => $this->config['token_type'], + 'scope' => $scope + ); + } } diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/ResponseTypeInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/ResponseTypeInterface.php index f8e26a5b0..a27156580 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/ResponseTypeInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ResponseType/ResponseTypeInterface.php @@ -4,5 +4,10 @@ namespace OAuth2\ResponseType; interface ResponseTypeInterface { + /** + * @param array $params + * @param mixed $user_id + * @return mixed + */ public function getAuthorizeResponse($params, $user_id = null); } diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Scope.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Scope.php index c44350bfd..3ba6e5328 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Scope.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Scope.php @@ -2,19 +2,23 @@ namespace OAuth2; +use InvalidArgumentException; use OAuth2\Storage\Memory; use OAuth2\Storage\ScopeInterface as ScopeStorageInterface; /** -* @see OAuth2\ScopeInterface +* @see ScopeInterface */ class Scope implements ScopeInterface { protected $storage; /** - * @param mixed @storage - * Either an array of supported scopes, or an instance of OAuth2\Storage\ScopeInterface + * Constructor + * + * @param mixed $storage - Either an array of supported scopes, or an instance of OAuth2\Storage\ScopeInterface + * + * @throws InvalidArgumentException */ public function __construct($storage = null) { @@ -23,7 +27,7 @@ class Scope implements ScopeInterface } if (!$storage instanceof ScopeStorageInterface) { - throw new \InvalidArgumentException("Argument 1 to OAuth2\Scope must be null, an array, or instance of OAuth2\Storage\ScopeInterface"); + throw new InvalidArgumentException("Argument 1 to OAuth2\Scope must be null, an array, or instance of OAuth2\Storage\ScopeInterface"); } $this->storage = $storage; @@ -32,12 +36,10 @@ class Scope implements ScopeInterface /** * Check if everything in required scope is contained in available scope. * - * @param $required_scope - * A space-separated string of scopes. - * - * @return - * TRUE if everything in required scope is contained in available scope, - * and FALSE if it isn't. + * @param string $required_scope - A space-separated string of scopes. + * @param string $available_scope - A space-separated string of scopes. + * @return bool - TRUE if everything in required scope is contained in available scope and FALSE + * if it isn't. * * @see http://tools.ietf.org/html/rfc6749#section-7 * @@ -54,11 +56,8 @@ class Scope implements ScopeInterface /** * Check if the provided scope exists in storage. * - * @param $scope - * A space-separated string of scopes. - * - * @return - * TRUE if it exists, FALSE otherwise. + * @param string $scope - A space-separated string of scopes. + * @return bool - TRUE if it exists, FALSE otherwise. */ public function scopeExists($scope) { @@ -76,12 +75,20 @@ class Scope implements ScopeInterface } } + /** + * @param RequestInterface $request + * @return string + */ public function getScopeFromRequest(RequestInterface $request) { // "scope" is valid if passed in either POST or QUERY return $request->request('scope', $request->query('scope')); } + /** + * @param null $client_id + * @return mixed + */ public function getDefaultScope($client_id = null) { return $this->storage->getDefaultScope($client_id); @@ -93,8 +100,7 @@ class Scope implements ScopeInterface * In case OpenID Connect is used, these scopes must include: * 'openid', offline_access'. * - * @return - * An array of reserved scopes. + * @return array - An array of reserved scopes. */ public function getReservedScopes() { diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ScopeInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ScopeInterface.php index 5b60f9aee..f65cfa7bd 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/ScopeInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/ScopeInterface.php @@ -7,19 +7,17 @@ use OAuth2\Storage\ScopeInterface as ScopeStorageInterface; /** * Class to handle scope implementation logic * - * @see OAuth2\Storage\ScopeInterface + * @see \OAuth2\Storage\ScopeInterface */ interface ScopeInterface extends ScopeStorageInterface { /** * Check if everything in required scope is contained in available scope. * - * @param $required_scope - * A space-separated string of scopes. - * - * @return - * TRUE if everything in required scope is contained in available scope, - * and FALSE if it isn't. + * @param string $required_scope - A space-separated string of scopes. + * @param string $available_scope - A space-separated string of scopes. + * @return boolean - TRUE if everything in required scope is contained in available scope and FALSE + * if it isn't. * * @see http://tools.ietf.org/html/rfc6749#section-7 * @@ -30,11 +28,8 @@ interface ScopeInterface extends ScopeStorageInterface /** * Return scope info from request * - * @param OAuth2\RequestInterface - * Request object to check - * - * @return - * string representation of requested scope + * @param RequestInterface $request - Request object to check + * @return string - representation of requested scope */ public function getScopeFromRequest(RequestInterface $request); } diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Server.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Server.php index 9cfcb83a5..62ae8970d 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Server.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Server.php @@ -30,25 +30,28 @@ use OAuth2\GrantType\UserCredentials; use OAuth2\GrantType\ClientCredentials; use OAuth2\GrantType\RefreshToken; use OAuth2\GrantType\AuthorizationCode; +use OAuth2\Storage\ClientCredentialsInterface; +use OAuth2\Storage\ClientInterface; use OAuth2\Storage\JwtAccessToken as JwtAccessTokenStorage; use OAuth2\Storage\JwtAccessTokenInterface; +use InvalidArgumentException; +use LogicException; /** * Server class for OAuth2 * This class serves as a convience class which wraps the other Controller classes * -* @see OAuth2\Controller\ResourceController -* @see OAuth2\Controller\AuthorizeController -* @see OAuth2\Controller\TokenController +* @see \OAuth2\Controller\ResourceController +* @see \OAuth2\Controller\AuthorizeController +* @see \OAuth2\Controller\TokenController */ class Server implements ResourceControllerInterface, AuthorizeControllerInterface, TokenControllerInterface, UserInfoControllerInterface { - // misc properties /** - * @var Response + * @var ResponseInterface */ protected $response; @@ -62,7 +65,6 @@ class Server implements ResourceControllerInterface, */ protected $storages; - // servers /** * @var AuthorizeControllerInterface */ @@ -83,17 +85,34 @@ class Server implements ResourceControllerInterface, */ protected $userInfoController; - // config classes - protected $grantTypes; - protected $responseTypes; + /** + * @var array + */ + protected $grantTypes = []; + + /** + * @var array + */ + protected $responseTypes = []; + + /** + * @var TokenTypeInterface + */ protected $tokenType; /** * @var ScopeInterface */ protected $scopeUtil; + + /** + * @var ClientAssertionTypeInterface + */ protected $clientAssertionType; + /** + * @var array + */ protected $storageMap = array( 'access_token' => 'OAuth2\Storage\AccessTokenInterface', 'authorization_code' => 'OAuth2\Storage\AuthorizationCodeInterface', @@ -107,6 +126,9 @@ class Server implements ResourceControllerInterface, 'scope' => 'OAuth2\Storage\ScopeInterface', ); + /** + * @var array + */ protected $responseTypeMap = array( 'token' => 'OAuth2\ResponseType\AccessTokenInterface', 'code' => 'OAuth2\ResponseType\AuthorizationCodeInterface', @@ -116,15 +138,15 @@ class Server implements ResourceControllerInterface, ); /** - * @param mixed $storage (array or OAuth2\Storage) - single object or array of objects implementing the - * required storage types (ClientCredentialsInterface and AccessTokenInterface as a minimum) - * @param array $config specify a different token lifetime, token header name, etc - * @param array $grantTypes An array of OAuth2\GrantType\GrantTypeInterface to use for granting access tokens - * @param array $responseTypes Response types to use. array keys should be "code" and and "token" for - * Access Token and Authorization Code response types - * @param \OAuth2\TokenType\TokenTypeInterface $tokenType The token type object to use. Valid token types are "bearer" and "mac" - * @param \OAuth2\ScopeInterface $scopeUtil The scope utility class to use to validate scope - * @param \OAuth2\ClientAssertionType\ClientAssertionTypeInterface $clientAssertionType The method in which to verify the client identity. Default is HttpBasic + * @param mixed $storage (array or OAuth2\Storage) - single object or array of objects implementing the + * required storage types (ClientCredentialsInterface and AccessTokenInterface as a minimum) + * @param array $config specify a different token lifetime, token header name, etc + * @param array $grantTypes An array of OAuth2\GrantType\GrantTypeInterface to use for granting access tokens + * @param array $responseTypes Response types to use. array keys should be "code" and "token" for + * Access Token and Authorization Code response types + * @param TokenTypeInterface $tokenType The token type object to use. Valid token types are "bearer" and "mac" + * @param ScopeInterface $scopeUtil The scope utility class to use to validate scope + * @param ClientAssertionTypeInterface $clientAssertionType The method in which to verify the client identity. Default is HttpBasic * * @ingroup oauth2_section_7 */ @@ -172,6 +194,9 @@ class Server implements ResourceControllerInterface, } } + /** + * @return AuthorizeControllerInterface + */ public function getAuthorizeController() { if (is_null($this->authorizeController)) { @@ -181,6 +206,9 @@ class Server implements ResourceControllerInterface, return $this->authorizeController; } + /** + * @return TokenController + */ public function getTokenController() { if (is_null($this->tokenController)) { @@ -190,6 +218,9 @@ class Server implements ResourceControllerInterface, return $this->tokenController; } + /** + * @return ResourceControllerInterface + */ public function getResourceController() { if (is_null($this->resourceController)) { @@ -199,6 +230,9 @@ class Server implements ResourceControllerInterface, return $this->resourceController; } + /** + * @return UserInfoControllerInterface + */ public function getUserInfoController() { if (is_null($this->userInfoController)) { @@ -209,8 +243,6 @@ class Server implements ResourceControllerInterface, } /** - * every getter deserves a setter - * * @param AuthorizeControllerInterface $authorizeController */ public function setAuthorizeController(AuthorizeControllerInterface $authorizeController) @@ -219,8 +251,6 @@ class Server implements ResourceControllerInterface, } /** - * every getter deserves a setter - * * @param TokenControllerInterface $tokenController */ public function setTokenController(TokenControllerInterface $tokenController) @@ -229,8 +259,6 @@ class Server implements ResourceControllerInterface, } /** - * every getter deserves a setter - * * @param ResourceControllerInterface $resourceController */ public function setResourceController(ResourceControllerInterface $resourceController) @@ -239,8 +267,6 @@ class Server implements ResourceControllerInterface, } /** - * every getter deserves a setter - * * @param UserInfoControllerInterface $userInfoController */ public function setUserInfoController(UserInfoControllerInterface $userInfoController) @@ -252,12 +278,8 @@ class Server implements ResourceControllerInterface, * Return claims about the authenticated end-user. * This would be called from the "/UserInfo" endpoint as defined in the spec. * - * @param $request - \OAuth2\RequestInterface - * Request object to grant access token - * - * @param $response - \OAuth2\ResponseInterface - * Response object containing error messages (failure) or user claims (success) - * + * @param RequestInterface $request - Request object to grant access token + * @param ResponseInterface $response - Response object containing error messages (failure) or user claims (success) * @return ResponseInterface * * @throws \InvalidArgumentException @@ -278,12 +300,8 @@ class Server implements ResourceControllerInterface, * This would be called from the "/token" endpoint as defined in the spec. * Obviously, you can call your endpoint whatever you want. * - * @param $request - \OAuth2\RequestInterface - * Request object to grant access token - * - * @param $response - \OAuth2\ResponseInterface - * Response object containing error messages (failure) or access token (success) - * + * @param RequestInterface $request - Request object to grant access token + * @param ResponseInterface $response - Response object containing error messages (failure) or access token (success) * @return ResponseInterface * * @throws \InvalidArgumentException @@ -303,6 +321,11 @@ class Server implements ResourceControllerInterface, return $this->response; } + /** + * @param RequestInterface $request - Request object to grant access token + * @param ResponseInterface $response - Response object + * @return mixed + */ public function grantAccessToken(RequestInterface $request, ResponseInterface $response = null) { $this->response = is_null($response) ? new Response() : $response; @@ -336,25 +359,18 @@ class Server implements ResourceControllerInterface, * authorization server should call this function to redirect the user * appropriately. * - * @param $request - * The request should have the follow parameters set in the querystring: - * - response_type: The requested response: an access token, an - * authorization code, or both. + * @param RequestInterface $request - The request should have the follow parameters set in the querystring: + * - response_type: The requested response: an access token, an authorization code, or both. * - client_id: The client identifier as described in Section 2. - * - redirect_uri: An absolute URI to which the authorization server - * will redirect the user-agent to when the end-user authorization - * step is completed. - * - scope: (optional) The scope of the resource request expressed as a - * list of space-delimited strings. - * - state: (optional) An opaque value used by the client to maintain - * state between the request and callback. - * @param ResponseInterface $response - * @param $is_authorized - * TRUE or FALSE depending on whether the user authorized the access. - * @param $user_id - * Identifier of user who authorized the client + * - redirect_uri: An absolute URI to which the authorization server will redirect the user-agent to when the + * end-user authorization step is completed. + * - scope: (optional) The scope of the resource request expressed as a list of space-delimited strings. + * - state: (optional) An opaque value used by the client to maintain state between the request and callback. * - * @return Response + * @param ResponseInterface $response - Response object + * @param bool $is_authorized - TRUE or FALSE depending on whether the user authorized the access. + * @param mixed $user_id - Identifier of user who authorized the client + * @return ResponseInterface * * @see http://tools.ietf.org/html/rfc6749#section-4 * @@ -371,14 +387,17 @@ class Server implements ResourceControllerInterface, /** * Pull the authorization request data out of the HTTP request. * - The redirect_uri is OPTIONAL as per draft 20. But your implementation can enforce it - * by setting $config['enforce_redirect'] to true. + * by setting $config['enforce_redirect'] to true. * - The state is OPTIONAL but recommended to enforce CSRF. Draft 21 states, however, that - * CSRF protection is MANDATORY. You can enforce this by setting the $config['enforce_state'] to true. + * CSRF protection is MANDATORY. You can enforce this by setting the $config['enforce_state'] to true. * * The draft specifies that the parameters should be retrieved from GET, override the Response * object to change this * - * @return + * @param RequestInterface $request - Request object + * @param ResponseInterface $response - Response object + * @return bool + * * The authorization parameters so the authorization server can prompt * the user for approval if valid. * @@ -395,6 +414,12 @@ class Server implements ResourceControllerInterface, return $value; } + /** + * @param RequestInterface $request - Request object + * @param ResponseInterface $response - Response object + * @param string $scope - Scope + * @return mixed + */ public function verifyResourceRequest(RequestInterface $request, ResponseInterface $response = null, $scope = null) { $this->response = is_null($response) ? new Response() : $response; @@ -403,6 +428,11 @@ class Server implements ResourceControllerInterface, return $value; } + /** + * @param RequestInterface $request - Request object + * @param ResponseInterface $response - Response object + * @return mixed + */ public function getAccessTokenData(RequestInterface $request, ResponseInterface $response = null) { $this->response = is_null($response) ? new Response() : $response; @@ -411,10 +441,14 @@ class Server implements ResourceControllerInterface, return $value; } + /** + * @param GrantTypeInterface $grantType + * @param mixed $identifier + */ public function addGrantType(GrantTypeInterface $grantType, $identifier = null) { if (!is_string($identifier)) { - $identifier = $grantType->getQuerystringIdentifier(); + $identifier = $grantType->getQueryStringIdentifier(); } $this->grantTypes[$identifier] = $grantType; @@ -428,11 +462,10 @@ class Server implements ResourceControllerInterface, /** * Set a storage object for the server * - * @param $storage - * An object implementing one of the Storage interfaces - * @param $key - * If null, the storage is set to the key of each storage interface it implements + * @param object $storage - An object implementing one of the Storage interfaces + * @param mixed $key - If null, the storage is set to the key of each storage interface it implements * + * @throws InvalidArgumentException * @see storageMap */ public function addStorage($storage, $key = null) @@ -446,11 +479,11 @@ class Server implements ResourceControllerInterface, // special logic to handle "client" and "client_credentials" strangeness if ($key === 'client' && !isset($this->storages['client_credentials'])) { - if ($storage instanceof \OAuth2\Storage\ClientCredentialsInterface) { + if ($storage instanceof ClientCredentialsInterface) { $this->storages['client_credentials'] = $storage; } } elseif ($key === 'client_credentials' && !isset($this->storages['client'])) { - if ($storage instanceof \OAuth2\Storage\ClientInterface) { + if ($storage instanceof ClientInterface) { $this->storages['client'] = $storage; } } @@ -471,6 +504,12 @@ class Server implements ResourceControllerInterface, } } + /** + * @param ResponseTypeInterface $responseType + * @param mixed $key + * + * @throws InvalidArgumentException + */ public function addResponseType(ResponseTypeInterface $responseType, $key = null) { $key = $this->normalizeResponseType($key); @@ -497,6 +536,9 @@ class Server implements ResourceControllerInterface, } } + /** + * @return ScopeInterface + */ public function getScopeUtil() { if (!$this->scopeUtil) { @@ -508,8 +550,6 @@ class Server implements ResourceControllerInterface, } /** - * every getter deserves a setter - * * @param ScopeInterface $scopeUtil */ public function setScopeUtil($scopeUtil) @@ -517,6 +557,10 @@ class Server implements ResourceControllerInterface, $this->scopeUtil = $scopeUtil; } + /** + * @return AuthorizeControllerInterface + * @throws LogicException + */ protected function createDefaultAuthorizeController() { if (!isset($this->storages['client'])) { @@ -541,6 +585,10 @@ class Server implements ResourceControllerInterface, return new AuthorizeController($this->storages['client'], $this->responseTypes, $config, $this->getScopeUtil()); } + /** + * @return TokenControllerInterface + * @throws LogicException + */ protected function createDefaultTokenController() { if (0 == count($this->grantTypes)) { @@ -562,7 +610,7 @@ class Server implements ResourceControllerInterface, } if (!isset($this->storages['client'])) { - throw new \LogicException('You must supply a storage object implementing OAuth2\Storage\ClientInterface to use the token server'); + throw new LogicException("You must supply a storage object implementing OAuth2\Storage\ClientInterface to use the token server"); } $accessTokenResponseType = $this->getAccessTokenResponseType(); @@ -570,6 +618,10 @@ class Server implements ResourceControllerInterface, return new TokenController($accessTokenResponseType, $this->storages['client'], $this->grantTypes, $this->clientAssertionType, $this->getScopeUtil()); } + /** + * @return ResourceControllerInterface + * @throws LogicException + */ protected function createDefaultResourceController() { if ($this->config['use_jwt_access_tokens']) { @@ -590,6 +642,10 @@ class Server implements ResourceControllerInterface, return new ResourceController($this->tokenType, $this->storages['access_token'], $config, $this->getScopeUtil()); } + /** + * @return UserInfoControllerInterface + * @throws LogicException + */ protected function createDefaultUserInfoController() { if ($this->config['use_jwt_access_tokens']) { @@ -614,6 +670,9 @@ class Server implements ResourceControllerInterface, return new UserInfoController($this->tokenType, $this->storages['access_token'], $this->storages['user_claims'], $config, $this->getScopeUtil()); } + /** + * @return Bearer + */ protected function getDefaultTokenType() { $config = array_intersect_key($this->config, array_flip(explode(' ', 'token_param_name token_bearer_header_name'))); @@ -621,6 +680,10 @@ class Server implements ResourceControllerInterface, return new Bearer($config); } + /** + * @return array + * @throws LogicException + */ protected function getDefaultResponseTypes() { $responseTypes = array(); @@ -656,6 +719,10 @@ class Server implements ResourceControllerInterface, return $responseTypes; } + /** + * @return array + * @throws LogicException + */ protected function getDefaultGrantTypes() { $grantTypes = array(); @@ -692,6 +759,9 @@ class Server implements ResourceControllerInterface, return $grantTypes; } + /** + * @return AccessToken + */ protected function getAccessTokenResponseType() { if (isset($this->responseTypes['token'])) { @@ -705,6 +775,9 @@ class Server implements ResourceControllerInterface, return $this->createDefaultAccessTokenResponseType(); } + /** + * @return IdToken + */ protected function getIdTokenResponseType() { if (isset($this->responseTypes['id_token'])) { @@ -714,6 +787,9 @@ class Server implements ResourceControllerInterface, return $this->createDefaultIdTokenResponseType(); } + /** + * @return IdTokenToken + */ protected function getIdTokenTokenResponseType() { if (isset($this->responseTypes['id_token token'])) { @@ -725,6 +801,9 @@ class Server implements ResourceControllerInterface, /** * For Resource Controller + * + * @return JwtAccessTokenStorage + * @throws LogicException */ protected function createDefaultJwtAccessTokenStorage() { @@ -741,6 +820,9 @@ class Server implements ResourceControllerInterface, /** * For Authorize and Token Controllers + * + * @return JwtAccessToken + * @throws LogicException */ protected function createDefaultJwtAccessTokenResponseType() { @@ -763,10 +845,14 @@ class Server implements ResourceControllerInterface, return new JwtAccessToken($this->storages['public_key'], $tokenStorage, $refreshStorage, $config); } + /** + * @return AccessToken + * @throws LogicException + */ protected function createDefaultAccessTokenResponseType() { if (!isset($this->storages['access_token'])) { - throw new \LogicException('You must supply a response type implementing OAuth2\ResponseType\AccessTokenInterface, or a storage object implementing OAuth2\Storage\AccessTokenInterface to use the token server'); + throw new LogicException("You must supply a response type implementing OAuth2\ResponseType\AccessTokenInterface, or a storage object implementing OAuth2\Storage\AccessTokenInterface to use the token server"); } $refreshStorage = null; @@ -780,13 +866,17 @@ class Server implements ResourceControllerInterface, return new AccessToken($this->storages['access_token'], $refreshStorage, $config); } + /** + * @return IdToken + * @throws LogicException + */ protected function createDefaultIdTokenResponseType() { if (!isset($this->storages['user_claims'])) { - throw new \LogicException('You must supply a storage object implementing OAuth2\OpenID\Storage\UserClaimsInterface to use openid connect'); + throw new LogicException("You must supply a storage object implementing OAuth2\OpenID\Storage\UserClaimsInterface to use openid connect"); } if (!isset($this->storages['public_key'])) { - throw new \LogicException('You must supply a storage object implementing OAuth2\Storage\PublicKeyInterface to use openid connect'); + throw new LogicException("You must supply a storage object implementing OAuth2\Storage\PublicKeyInterface to use openid connect"); } $config = array_intersect_key($this->config, array_flip(explode(' ', 'issuer id_lifetime'))); @@ -794,11 +884,17 @@ class Server implements ResourceControllerInterface, return new IdToken($this->storages['user_claims'], $this->storages['public_key'], $config); } + /** + * @return IdTokenToken + */ protected function createDefaultIdTokenTokenResponseType() { return new IdTokenToken($this->getAccessTokenResponseType(), $this->getIdTokenResponseType()); } + /** + * @throws InvalidArgumentException + */ protected function validateOpenIdConnect() { $authCodeGrant = $this->getGrantType('authorization_code'); @@ -807,6 +903,10 @@ class Server implements ResourceControllerInterface, } } + /** + * @param string $name + * @return string + */ protected function normalizeResponseType($name) { // for multiple-valued response types - make them alphabetical @@ -819,36 +919,60 @@ class Server implements ResourceControllerInterface, return $name; } + /** + * @return mixed + */ public function getResponse() { return $this->response; } + /** + * @return array + */ public function getStorages() { return $this->storages; } + /** + * @param string $name + * @return object|null + */ public function getStorage($name) { return isset($this->storages[$name]) ? $this->storages[$name] : null; } + /** + * @return array + */ public function getGrantTypes() { return $this->grantTypes; } + /** + * @param string $name + * @return object|null + */ public function getGrantType($name) { return isset($this->grantTypes[$name]) ? $this->grantTypes[$name] : null; } + /** + * @return array + */ public function getResponseTypes() { return $this->responseTypes; } + /** + * @param string $name + * @return object|null + */ public function getResponseType($name) { // for multiple-valued response types - make them alphabetical @@ -857,23 +981,38 @@ class Server implements ResourceControllerInterface, return isset($this->responseTypes[$name]) ? $this->responseTypes[$name] : null; } + /** + * @return TokenTypeInterface + */ public function getTokenType() { return $this->tokenType; } + /** + * @return ClientAssertionTypeInterface + */ public function getClientAssertionType() { return $this->clientAssertionType; } + /** + * @param string $name + * @param mixed $value + */ public function setConfig($name, $value) { $this->config[$name] = $value; } + /** + * @param string $name + * @param mixed $default + * @return mixed + */ public function getConfig($name, $default = null) { return isset($this->config[$name]) ? $this->config[$name] : $default; } -} +} \ No newline at end of file diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/AccessTokenInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/AccessTokenInterface.php index 1819158af..22428f2c8 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/AccessTokenInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/AccessTokenInterface.php @@ -15,17 +15,18 @@ interface AccessTokenInterface * * We need to retrieve access token data as we create and verify tokens. * - * @param $oauth_token - * oauth_token to be check with. + * @param string $oauth_token - oauth_token to be check with. * - * @return - * An associative array as below, and return NULL if the supplied oauth_token - * is invalid: - * - expires: Stored expiration in unix timestamp. - * - client_id: (optional) Stored client identifier. - * - user_id: (optional) Stored user identifier. - * - scope: (optional) Stored scope values in space-separated string. - * - id_token: (optional) Stored id_token (if "use_openid_connect" is true). + * @return array|null - An associative array as below, and return NULL if the supplied oauth_token is invalid: + * @code + * array( + * 'expires' => $expires, // Stored expiration in unix timestamp. + * 'client_id' => $client_id, // (optional) Stored client identifier. + * 'user_id' => $user_id, // (optional) Stored user identifier. + * 'scope' => $scope, // (optional) Stored scope values in space-separated string. + * 'id_token' => $id_token // (optional) Stored id_token (if "use_openid_connect" is true). + * ); + * @endcode * * @ingroup oauth2_section_7 */ @@ -36,11 +37,11 @@ interface AccessTokenInterface * * We need to store access token data as we create and verify tokens. * - * @param $oauth_token oauth_token to be stored. - * @param $client_id client identifier to be stored. - * @param $user_id user identifier to be stored. - * @param int $expires expiration to be stored as a Unix timestamp. - * @param string $scope OPTIONAL Scopes to be stored in space-separated string. + * @param string $oauth_token - oauth_token to be stored. + * @param mixed $client_id - client identifier to be stored. + * @param mixed $user_id - user identifier to be stored. + * @param int $expires - expiration to be stored as a Unix timestamp. + * @param string $scope - OPTIONAL Scopes to be stored in space-separated string. * * @ingroup oauth2_section_4 */ @@ -61,4 +62,4 @@ interface AccessTokenInterface * @todo v2.0 include this method in interface. Omitted to maintain BC in v1.x */ //public function unsetAccessToken($access_token); -} +} \ No newline at end of file diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/AuthorizationCodeInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/AuthorizationCodeInterface.php index edc7c70e5..2dbc138ac 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/AuthorizationCodeInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/AuthorizationCodeInterface.php @@ -59,12 +59,12 @@ interface AuthorizationCodeInterface * * Required for OAuth2::GRANT_TYPE_AUTH_CODE. * - * @param string $code Authorization code to be stored. - * @param mixed $client_id Client identifier to be stored. - * @param mixed $user_id User identifier to be stored. - * @param string $redirect_uri Redirect URI(s) to be stored in a space-separated string. - * @param int $expires Expiration to be stored as a Unix timestamp. - * @param string $scope OPTIONAL Scopes to be stored in space-separated string. + * @param string $code - Authorization code to be stored. + * @param mixed $client_id - Client identifier to be stored. + * @param mixed $user_id - User identifier to be stored. + * @param string $redirect_uri - Redirect URI(s) to be stored in a space-separated string. + * @param int $expires - Expiration to be stored as a Unix timestamp. + * @param string $scope - OPTIONAL Scopes to be stored in space-separated string. * * @ingroup oauth2_section_4 */ diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/Cassandra.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/Cassandra.php index c5048c08d..e60e9d3ad 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/Cassandra.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/Cassandra.php @@ -7,24 +7,25 @@ use phpcassa\ColumnSlice; use phpcassa\Connection\ConnectionPool; use OAuth2\OpenID\Storage\UserClaimsInterface; use OAuth2\OpenID\Storage\AuthorizationCodeInterface as OpenIDAuthorizationCodeInterface; +use InvalidArgumentException; /** * Cassandra storage for all storage types * - * To use, install "thobbs/phpcassa" via composer + * To use, install "thobbs/phpcassa" via composer: * - * composer require thobbs/phpcassa:dev-master + * composer require thobbs/phpcassa:dev-master * * - * Once this is done, instantiate the + * Once this is done, instantiate the connection: * - * $cassandra = new \phpcassa\Connection\ConnectionPool('oauth2_server', array('127.0.0.1:9160')); + * $cassandra = new \phpcassa\Connection\ConnectionPool('oauth2_server', array('127.0.0.1:9160')); * * * Then, register the storage client: * - * $storage = new OAuth2\Storage\Cassandra($cassandra); - * $storage->setClientDetails($client_id, $client_secret, $redirect_uri); + * $storage = new OAuth2\Storage\Cassandra($cassandra); + * $storage->setClientDetails($client_id, $client_secret, $redirect_uri); * * * @see test/lib/OAuth2/Storage/Bootstrap::getCassandraStorage @@ -43,17 +44,23 @@ class Cassandra implements AuthorizationCodeInterface, private $cache; - /* The cassandra client */ + /** + * @var ConnectionPool + */ protected $cassandra; - /* Configuration array */ + /** + * @var array + */ protected $config; /** * Cassandra Storage! uses phpCassa * - * @param \phpcassa\ConnectionPool $cassandra - * @param array $config + * @param ConnectionPool|array $connection + * @param array $config + * + * @throws InvalidArgumentException */ public function __construct($connection = array(), array $config = array()) { @@ -61,7 +68,7 @@ class Cassandra implements AuthorizationCodeInterface, $this->cassandra = $connection; } else { if (!is_array($connection)) { - throw new \InvalidArgumentException('First argument to OAuth2\Storage\Cassandra must be an instance of phpcassa\Connection\ConnectionPool or a configuration array'); + throw new InvalidArgumentException('First argument to OAuth2\Storage\Cassandra must be an instance of phpcassa\Connection\ConnectionPool or a configuration array'); } $connection = array_merge(array( 'keyspace' => 'oauth2', @@ -87,6 +94,10 @@ class Cassandra implements AuthorizationCodeInterface, ), $config); } + /** + * @param $key + * @return bool|mixed + */ protected function getValue($key) { if (isset($this->cache[$key])) { @@ -104,6 +115,12 @@ class Cassandra implements AuthorizationCodeInterface, return json_decode($value, true); } + /** + * @param $key + * @param $value + * @param int $expire + * @return bool + */ protected function setValue($key, $value, $expire = 0) { $this->cache[$key] = $value; @@ -131,6 +148,10 @@ class Cassandra implements AuthorizationCodeInterface, return true; } + /** + * @param $key + * @return bool + */ protected function expireValue($key) { unset($this->cache[$key]); @@ -151,12 +172,25 @@ class Cassandra implements AuthorizationCodeInterface, return false; } - /* AuthorizationCodeInterface */ + /** + * @param string $code + * @return bool|mixed + */ public function getAuthorizationCode($code) { return $this->getValue($this->config['code_key'] . $code); } + /** + * @param string $authorization_code + * @param mixed $client_id + * @param mixed $user_id + * @param string $redirect_uri + * @param int $expires + * @param string $scope + * @param string $id_token + * @return bool + */ public function setAuthorizationCode($authorization_code, $client_id, $user_id, $redirect_uri, $expires, $scope = null, $id_token = null) { return $this->setValue( @@ -166,6 +200,10 @@ class Cassandra implements AuthorizationCodeInterface, ); } + /** + * @param string $code + * @return bool + */ public function expireAuthorizationCode($code) { $key = $this->config['code_key'] . $code; @@ -174,7 +212,11 @@ class Cassandra implements AuthorizationCodeInterface, return $this->expireValue($key); } - /* UserCredentialsInterface */ + /** + * @param string $username + * @param string $password + * @return bool + */ public function checkUserCredentials($username, $password) { if ($user = $this->getUser($username)) { @@ -184,7 +226,13 @@ class Cassandra implements AuthorizationCodeInterface, return false; } - // plaintext passwords are bad! Override this for your application + /** + * plaintext passwords are bad! Override this for your application + * + * @param array $user + * @param string $password + * @return bool + */ protected function checkPassword($user, $password) { return $user['password'] == $this->hashPassword($password); @@ -196,11 +244,19 @@ class Cassandra implements AuthorizationCodeInterface, return sha1($password); } + /** + * @param string $username + * @return array|bool|false + */ public function getUserDetails($username) { return $this->getUser($username); } + /** + * @param string $username + * @return array|bool + */ public function getUser($username) { if (!$userInfo = $this->getValue($this->config['user_key'] . $username)) { @@ -213,6 +269,13 @@ class Cassandra implements AuthorizationCodeInterface, ), $userInfo); } + /** + * @param string $username + * @param string $password + * @param string $first_name + * @param string $last_name + * @return bool + */ public function setUser($username, $password, $first_name = null, $last_name = null) { $password = $this->hashPassword($password); @@ -223,7 +286,11 @@ class Cassandra implements AuthorizationCodeInterface, ); } - /* ClientCredentialsInterface */ + /** + * @param mixed $client_id + * @param string $client_secret + * @return bool + */ public function checkClientCredentials($client_id, $client_secret = null) { if (!$client = $this->getClientDetails($client_id)) { @@ -234,6 +301,10 @@ class Cassandra implements AuthorizationCodeInterface, && $client['client_secret'] == $client_secret; } + /** + * @param $client_id + * @return bool + */ public function isPublicClient($client_id) { if (!$client = $this->getClientDetails($client_id)) { @@ -243,12 +314,24 @@ class Cassandra implements AuthorizationCodeInterface, return empty($client['client_secret']); } - /* ClientInterface */ + /** + * @param $client_id + * @return array|bool|mixed + */ public function getClientDetails($client_id) { return $this->getValue($this->config['client_key'] . $client_id); } + /** + * @param $client_id + * @param null $client_secret + * @param null $redirect_uri + * @param null $grant_types + * @param null $scope + * @param null $user_id + * @return bool + */ public function setClientDetails($client_id, $client_secret = null, $redirect_uri = null, $grant_types = null, $scope = null, $user_id = null) { return $this->setValue( @@ -257,6 +340,11 @@ class Cassandra implements AuthorizationCodeInterface, ); } + /** + * @param $client_id + * @param $grant_type + * @return bool + */ public function checkRestrictedGrantType($client_id, $grant_type) { $details = $this->getClientDetails($client_id); @@ -270,12 +358,23 @@ class Cassandra implements AuthorizationCodeInterface, return true; } - /* RefreshTokenInterface */ + /** + * @param $refresh_token + * @return bool|mixed + */ public function getRefreshToken($refresh_token) { return $this->getValue($this->config['refresh_token_key'] . $refresh_token); } + /** + * @param $refresh_token + * @param $client_id + * @param $user_id + * @param $expires + * @param null $scope + * @return bool + */ public function setRefreshToken($refresh_token, $client_id, $user_id, $expires, $scope = null) { return $this->setValue( @@ -285,17 +384,32 @@ class Cassandra implements AuthorizationCodeInterface, ); } + /** + * @param $refresh_token + * @return bool + */ public function unsetRefreshToken($refresh_token) { return $this->expireValue($this->config['refresh_token_key'] . $refresh_token); } - /* AccessTokenInterface */ + /** + * @param string $access_token + * @return array|bool|mixed|null + */ public function getAccessToken($access_token) { return $this->getValue($this->config['access_token_key'].$access_token); } + /** + * @param string $access_token + * @param mixed $client_id + * @param mixed $user_id + * @param int $expires + * @param null $scope + * @return bool + */ public function setAccessToken($access_token, $client_id, $user_id, $expires, $scope = null) { return $this->setValue( @@ -305,12 +419,19 @@ class Cassandra implements AuthorizationCodeInterface, ); } + /** + * @param $access_token + * @return bool + */ public function unsetAccessToken($access_token) { return $this->expireValue($this->config['access_token_key'] . $access_token); } - /* ScopeInterface */ + /** + * @param $scope + * @return bool + */ public function scopeExists($scope) { $scope = explode(' ', $scope); @@ -322,6 +443,10 @@ class Cassandra implements AuthorizationCodeInterface, return (count(array_diff($scope, $supportedScope)) == 0); } + /** + * @param null $client_id + * @return bool|mixed + */ public function getDefaultScope($client_id = null) { if (is_null($client_id) || !$result = $this->getValue($this->config['scope_key'].'default:'.$client_id)) { @@ -331,6 +456,13 @@ class Cassandra implements AuthorizationCodeInterface, return $result; } + /** + * @param $scope + * @param null $client_id + * @param string $type + * @return bool + * @throws \InvalidArgumentException + */ public function setScope($scope, $client_id = null, $type = 'supported') { if (!in_array($type, array('default', 'supported'))) { @@ -346,7 +478,11 @@ class Cassandra implements AuthorizationCodeInterface, return $this->setValue($key, $scope); } - /*JWTBearerInterface */ + /** + * @param $client_id + * @param $subject + * @return bool|null + */ public function getClientKey($client_id, $subject) { if (!$jwt = $this->getValue($this->config['jwt_key'] . $client_id)) { @@ -360,6 +496,12 @@ class Cassandra implements AuthorizationCodeInterface, return null; } + /** + * @param $client_id + * @param $key + * @param null $subject + * @return bool + */ public function setClientKey($client_id, $key, $subject = null) { return $this->setValue($this->config['jwt_key'] . $client_id, array( @@ -368,7 +510,10 @@ class Cassandra implements AuthorizationCodeInterface, )); } - /*ScopeInterface */ + /** + * @param $client_id + * @return bool|null + */ public function getClientScope($client_id) { if (!$clientDetails = $this->getClientDetails($client_id)) { @@ -382,19 +527,38 @@ class Cassandra implements AuthorizationCodeInterface, return null; } + /** + * @param $client_id + * @param $subject + * @param $audience + * @param $expiration + * @param $jti + * @throws \Exception + */ public function getJti($client_id, $subject, $audience, $expiration, $jti) { //TODO: Needs cassandra implementation. throw new \Exception('getJti() for the Cassandra driver is currently unimplemented.'); } + /** + * @param $client_id + * @param $subject + * @param $audience + * @param $expiration + * @param $jti + * @throws \Exception + */ public function setJti($client_id, $subject, $audience, $expiration, $jti) { //TODO: Needs cassandra implementation. throw new \Exception('setJti() for the Cassandra driver is currently unimplemented.'); } - /* PublicKeyInterface */ + /** + * @param string $client_id + * @return mixed + */ public function getPublicKey($client_id = '') { $public_key = $this->getValue($this->config['public_key_key'] . $client_id); @@ -407,6 +571,10 @@ class Cassandra implements AuthorizationCodeInterface, } } + /** + * @param string $client_id + * @return mixed + */ public function getPrivateKey($client_id = '') { $public_key = $this->getValue($this->config['public_key_key'] . $client_id); @@ -419,6 +587,10 @@ class Cassandra implements AuthorizationCodeInterface, } } + /** + * @param null $client_id + * @return mixed|string + */ public function getEncryptionAlgorithm($client_id = null) { $public_key = $this->getValue($this->config['public_key_key'] . $client_id); @@ -433,7 +605,11 @@ class Cassandra implements AuthorizationCodeInterface, return 'RS256'; } - /* UserClaimsInterface */ + /** + * @param mixed $user_id + * @param string $claims + * @return array|bool + */ public function getUserClaims($user_id, $claims) { $userDetails = $this->getUserDetails($user_id); @@ -460,6 +636,11 @@ class Cassandra implements AuthorizationCodeInterface, return $userClaims; } + /** + * @param $claim + * @param $userDetails + * @return array + */ protected function getUserClaim($claim, $userDetails) { $userClaims = array(); @@ -476,5 +657,4 @@ class Cassandra implements AuthorizationCodeInterface, return $userClaims; } - -} +} \ No newline at end of file diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/CouchbaseDB.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/CouchbaseDB.php old mode 100755 new mode 100644 index 1eb55f027..9e8148b6b --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/CouchbaseDB.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/CouchbaseDB.php @@ -328,4 +328,4 @@ class CouchbaseDB implements AuthorizationCodeInterface, //TODO: Needs couchbase implementation. throw new \Exception('setJti() for the Couchbase driver is currently unimplemented.'); } -} +} \ No newline at end of file diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/DynamoDB.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/DynamoDB.php index 8347ab258..a54cb3712 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/DynamoDB.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/DynamoDB.php @@ -537,4 +537,4 @@ class DynamoDB implements { return null !== $value && '' !== $value; } -} +} \ No newline at end of file diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/JwtAccessToken.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/JwtAccessToken.php index 75b49d301..6ccacd6d9 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/JwtAccessToken.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/JwtAccessToken.php @@ -6,7 +6,6 @@ use OAuth2\Encryption\EncryptionInterface; use OAuth2\Encryption\Jwt; /** - * * @author Brent Shaffer */ class JwtAccessToken implements JwtAccessTokenInterface @@ -85,4 +84,4 @@ class JwtAccessToken implements JwtAccessTokenInterface return $tokenData; } -} +} \ No newline at end of file diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/Memory.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/Memory.php index 42d833ccb..2c60b71ce 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/Memory.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/Memory.php @@ -378,4 +378,4 @@ class Memory implements AuthorizationCodeInterface, return 'RS256'; } -} +} \ No newline at end of file diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/Pdo.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/Pdo.php index ae5107e29..074cee447 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/Pdo.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/Pdo.php @@ -4,6 +4,7 @@ namespace OAuth2\Storage; use OAuth2\OpenID\Storage\UserClaimsInterface; use OAuth2\OpenID\Storage\AuthorizationCodeInterface as OpenIDAuthorizationCodeInterface; +use InvalidArgumentException; /** * Simple PDO storage for all storage types @@ -29,9 +30,22 @@ class Pdo implements UserClaimsInterface, OpenIDAuthorizationCodeInterface { + /** + * @var \PDO + */ protected $db; + + /** + * @var array + */ protected $config; + /** + * @param mixed $connection + * @param array $config + * + * @throws InvalidArgumentException + */ public function __construct($connection, $config = array()) { if (!$connection instanceof \PDO) { @@ -70,7 +84,11 @@ class Pdo implements ), $config); } - /* OAuth2\Storage\ClientCredentialsInterface */ + /** + * @param string $client_id + * @param null|string $client_secret + * @return bool + */ public function checkClientCredentials($client_id, $client_secret = null) { $stmt = $this->db->prepare(sprintf('SELECT * from %s where client_id = :client_id', $this->config['client_table'])); @@ -81,6 +99,10 @@ class Pdo implements return $result && $result['client_secret'] == $client_secret; } + /** + * @param string $client_id + * @return bool + */ public function isPublicClient($client_id) { $stmt = $this->db->prepare(sprintf('SELECT * from %s where client_id = :client_id', $this->config['client_table'])); @@ -93,7 +115,10 @@ class Pdo implements return empty($result['client_secret']); } - /* OAuth2\Storage\ClientInterface */ + /** + * @param string $client_id + * @return array|mixed + */ public function getClientDetails($client_id) { $stmt = $this->db->prepare(sprintf('SELECT * from %s where client_id = :client_id', $this->config['client_table'])); @@ -102,6 +127,15 @@ class Pdo implements return $stmt->fetch(\PDO::FETCH_ASSOC); } + /** + * @param string $client_id + * @param null|string $client_secret + * @param null|string $redirect_uri + * @param null|array $grant_types + * @param null|string $scope + * @param null|string $user_id + * @return bool + */ public function setClientDetails($client_id, $client_secret = null, $redirect_uri = null, $grant_types = null, $scope = null, $user_id = null) { // if it exists, update it. @@ -114,6 +148,11 @@ class Pdo implements return $stmt->execute(compact('client_id', 'client_secret', 'redirect_uri', 'grant_types', 'scope', 'user_id')); } + /** + * @param $client_id + * @param $grant_type + * @return bool + */ public function checkRestrictedGrantType($client_id, $grant_type) { $details = $this->getClientDetails($client_id); @@ -127,7 +166,10 @@ class Pdo implements return true; } - /* OAuth2\Storage\AccessTokenInterface */ + /** + * @param string $access_token + * @return array|bool|mixed|null + */ public function getAccessToken($access_token) { $stmt = $this->db->prepare(sprintf('SELECT * from %s where access_token = :access_token', $this->config['access_token_table'])); @@ -141,6 +183,14 @@ class Pdo implements return $token; } + /** + * @param string $access_token + * @param mixed $client_id + * @param mixed $user_id + * @param int $expires + * @param string $scope + * @return bool + */ public function setAccessToken($access_token, $client_id, $user_id, $expires, $scope = null) { // convert expires to datestring @@ -156,6 +206,10 @@ class Pdo implements return $stmt->execute(compact('access_token', 'client_id', 'user_id', 'expires', 'scope')); } + /** + * @param $access_token + * @return bool + */ public function unsetAccessToken($access_token) { $stmt = $this->db->prepare(sprintf('DELETE FROM %s WHERE access_token = :access_token', $this->config['access_token_table'])); @@ -166,6 +220,10 @@ class Pdo implements } /* OAuth2\Storage\AuthorizationCodeInterface */ + /** + * @param string $code + * @return mixed + */ public function getAuthorizationCode($code) { $stmt = $this->db->prepare(sprintf('SELECT * from %s where authorization_code = :code', $this->config['code_table'])); @@ -179,6 +237,16 @@ class Pdo implements return $code; } + /** + * @param string $code + * @param mixed $client_id + * @param mixed $user_id + * @param string $redirect_uri + * @param int $expires + * @param string $scope + * @param string $id_token + * @return bool|mixed + */ public function setAuthorizationCode($code, $client_id, $user_id, $redirect_uri, $expires, $scope = null, $id_token = null) { if (func_num_args() > 6) { @@ -199,6 +267,16 @@ class Pdo implements return $stmt->execute(compact('code', 'client_id', 'user_id', 'redirect_uri', 'expires', 'scope')); } + /** + * @param string $code + * @param mixed $client_id + * @param mixed $user_id + * @param string $redirect_uri + * @param string $expires + * @param string $scope + * @param string $id_token + * @return bool + */ private function setAuthorizationCodeWithIdToken($code, $client_id, $user_id, $redirect_uri, $expires, $scope = null, $id_token = null) { // convert expires to datestring @@ -214,6 +292,10 @@ class Pdo implements return $stmt->execute(compact('code', 'client_id', 'user_id', 'redirect_uri', 'expires', 'scope', 'id_token')); } + /** + * @param string $code + * @return bool + */ public function expireAuthorizationCode($code) { $stmt = $this->db->prepare(sprintf('DELETE FROM %s WHERE authorization_code = :code', $this->config['code_table'])); @@ -221,7 +303,11 @@ class Pdo implements return $stmt->execute(compact('code')); } - /* OAuth2\Storage\UserCredentialsInterface */ + /** + * @param string $username + * @param string $password + * @return bool + */ public function checkUserCredentials($username, $password) { if ($user = $this->getUser($username)) { @@ -231,12 +317,20 @@ class Pdo implements return false; } + /** + * @param string $username + * @return array|bool + */ public function getUserDetails($username) { return $this->getUser($username); } - /* UserClaimsInterface */ + /** + * @param mixed $user_id + * @param string $claims + * @return array|bool + */ public function getUserClaims($user_id, $claims) { if (!$userDetails = $this->getUserDetails($user_id)) { @@ -262,6 +356,11 @@ class Pdo implements return $userClaims; } + /** + * @param string $claim + * @param array $userDetails + * @return array + */ protected function getUserClaim($claim, $userDetails) { $userClaims = array(); @@ -275,7 +374,10 @@ class Pdo implements return $userClaims; } - /* OAuth2\Storage\RefreshTokenInterface */ + /** + * @param string $refresh_token + * @return bool|mixed + */ public function getRefreshToken($refresh_token) { $stmt = $this->db->prepare(sprintf('SELECT * FROM %s WHERE refresh_token = :refresh_token', $this->config['refresh_token_table'])); @@ -289,6 +391,14 @@ class Pdo implements return $token; } + /** + * @param string $refresh_token + * @param mixed $client_id + * @param mixed $user_id + * @param string $expires + * @param string $scope + * @return bool + */ public function setRefreshToken($refresh_token, $client_id, $user_id, $expires, $scope = null) { // convert expires to datestring @@ -299,6 +409,10 @@ class Pdo implements return $stmt->execute(compact('refresh_token', 'client_id', 'user_id', 'expires', 'scope')); } + /** + * @param string $refresh_token + * @return bool + */ public function unsetRefreshToken($refresh_token) { $stmt = $this->db->prepare(sprintf('DELETE FROM %s WHERE refresh_token = :refresh_token', $this->config['refresh_token_table'])); @@ -308,7 +422,13 @@ class Pdo implements return $stmt->rowCount() > 0; } - // plaintext passwords are bad! Override this for your application + /** + * plaintext passwords are bad! Override this for your application + * + * @param array $user + * @param string $password + * @return bool + */ protected function checkPassword($user, $password) { return $user['password'] == $this->hashPassword($password); @@ -320,6 +440,10 @@ class Pdo implements return sha1($password); } + /** + * @param string $username + * @return array|bool + */ public function getUser($username) { $stmt = $this->db->prepare($sql = sprintf('SELECT * from %s where username=:username', $this->config['user_table'])); @@ -335,6 +459,15 @@ class Pdo implements ), $userInfo); } + /** + * plaintext passwords are bad! Override this for your application + * + * @param string $username + * @param string $password + * @param string $firstName + * @param string $lastName + * @return bool + */ public function setUser($username, $password, $firstName = null, $lastName = null) { // do not store in plaintext @@ -350,7 +483,10 @@ class Pdo implements return $stmt->execute(compact('username', 'password', 'firstName', 'lastName')); } - /* ScopeInterface */ + /** + * @param string $scope + * @return bool + */ public function scopeExists($scope) { $scope = explode(' ', $scope); @@ -365,6 +501,10 @@ class Pdo implements return false; } + /** + * @param mixed $client_id + * @return null|string + */ public function getDefaultScope($client_id = null) { $stmt = $this->db->prepare(sprintf('SELECT scope FROM %s WHERE is_default=:is_default', $this->config['scope_table'])); @@ -381,7 +521,11 @@ class Pdo implements return null; } - /* JWTBearerInterface */ + /** + * @param mixed $client_id + * @param $subject + * @return string + */ public function getClientKey($client_id, $subject) { $stmt = $this->db->prepare($sql = sprintf('SELECT public_key from %s where client_id=:client_id AND subject=:subject', $this->config['jwt_table'])); @@ -391,6 +535,10 @@ class Pdo implements return $stmt->fetchColumn(); } + /** + * @param mixed $client_id + * @return bool|null + */ public function getClientScope($client_id) { if (!$clientDetails = $this->getClientDetails($client_id)) { @@ -404,6 +552,14 @@ class Pdo implements return null; } + /** + * @param mixed $client_id + * @param $subject + * @param $audience + * @param $expires + * @param $jti + * @return array|null + */ public function getJti($client_id, $subject, $audience, $expires, $jti) { $stmt = $this->db->prepare($sql = sprintf('SELECT * FROM %s WHERE issuer=:client_id AND subject=:subject AND audience=:audience AND expires=:expires AND jti=:jti', $this->config['jti_table'])); @@ -423,6 +579,14 @@ class Pdo implements return null; } + /** + * @param mixed $client_id + * @param $subject + * @param $audience + * @param $expires + * @param $jti + * @return bool + */ public function setJti($client_id, $subject, $audience, $expires, $jti) { $stmt = $this->db->prepare(sprintf('INSERT INTO %s (issuer, subject, audience, expires, jti) VALUES (:client_id, :subject, :audience, :expires, :jti)', $this->config['jti_table'])); @@ -430,7 +594,10 @@ class Pdo implements return $stmt->execute(compact('client_id', 'subject', 'audience', 'expires', 'jti')); } - /* PublicKeyInterface */ + /** + * @param mixed $client_id + * @return mixed + */ public function getPublicKey($client_id = null) { $stmt = $this->db->prepare($sql = sprintf('SELECT public_key FROM %s WHERE client_id=:client_id OR client_id IS NULL ORDER BY client_id IS NOT NULL DESC', $this->config['public_key_table'])); @@ -441,6 +608,10 @@ class Pdo implements } } + /** + * @param mixed $client_id + * @return mixed + */ public function getPrivateKey($client_id = null) { $stmt = $this->db->prepare($sql = sprintf('SELECT private_key FROM %s WHERE client_id=:client_id OR client_id IS NULL ORDER BY client_id IS NOT NULL DESC', $this->config['public_key_table'])); @@ -451,6 +622,10 @@ class Pdo implements } } + /** + * @param mixed $client_id + * @return string + */ public function getEncryptionAlgorithm($client_id = null) { $stmt = $this->db->prepare($sql = sprintf('SELECT encryption_algorithm FROM %s WHERE client_id=:client_id OR client_id IS NULL ORDER BY client_id IS NOT NULL DESC', $this->config['public_key_table'])); @@ -467,6 +642,9 @@ class Pdo implements * DDL to create OAuth2 database and tables for PDO storage * * @see https://github.com/dsquier/oauth2-server-php-mysql + * + * @param string $dbName + * @return string */ public function getBuildSql($dbName = 'oauth2_server_php') { @@ -481,73 +659,73 @@ class Pdo implements PRIMARY KEY (client_id) ); - CREATE TABLE {$this->config['access_token_table']} ( - access_token VARCHAR(40) NOT NULL, - client_id VARCHAR(80) NOT NULL, - user_id VARCHAR(80), - expires TIMESTAMP NOT NULL, - scope VARCHAR(4000), - PRIMARY KEY (access_token) - ); + CREATE TABLE {$this->config['access_token_table']} ( + access_token VARCHAR(40) NOT NULL, + client_id VARCHAR(80) NOT NULL, + user_id VARCHAR(80), + expires TIMESTAMP NOT NULL, + scope VARCHAR(4000), + PRIMARY KEY (access_token) + ); - CREATE TABLE {$this->config['code_table']} ( - authorization_code VARCHAR(40) NOT NULL, - client_id VARCHAR(80) NOT NULL, - user_id VARCHAR(80), - redirect_uri VARCHAR(2000), - expires TIMESTAMP NOT NULL, - scope VARCHAR(4000), - id_token VARCHAR(1000), - PRIMARY KEY (authorization_code) - ); + CREATE TABLE {$this->config['code_table']} ( + authorization_code VARCHAR(40) NOT NULL, + client_id VARCHAR(80) NOT NULL, + user_id VARCHAR(80), + redirect_uri VARCHAR(2000), + expires TIMESTAMP NOT NULL, + scope VARCHAR(4000), + id_token VARCHAR(1000), + PRIMARY KEY (authorization_code) + ); - CREATE TABLE {$this->config['refresh_token_table']} ( - refresh_token VARCHAR(40) NOT NULL, - client_id VARCHAR(80) NOT NULL, - user_id VARCHAR(80), - expires TIMESTAMP NOT NULL, - scope VARCHAR(4000), - PRIMARY KEY (refresh_token) - ); + CREATE TABLE {$this->config['refresh_token_table']} ( + refresh_token VARCHAR(40) NOT NULL, + client_id VARCHAR(80) NOT NULL, + user_id VARCHAR(80), + expires TIMESTAMP NOT NULL, + scope VARCHAR(4000), + PRIMARY KEY (refresh_token) + ); - CREATE TABLE {$this->config['user_table']} ( - username VARCHAR(80), - password VARCHAR(80), - first_name VARCHAR(80), - last_name VARCHAR(80), - email VARCHAR(80), - email_verified BOOLEAN, - scope VARCHAR(4000) - ); + CREATE TABLE {$this->config['user_table']} ( + username VARCHAR(80), + password VARCHAR(80), + first_name VARCHAR(80), + last_name VARCHAR(80), + email VARCHAR(80), + email_verified BOOLEAN, + scope VARCHAR(4000) + ); - CREATE TABLE {$this->config['scope_table']} ( - scope VARCHAR(80) NOT NULL, - is_default BOOLEAN, - PRIMARY KEY (scope) - ); + CREATE TABLE {$this->config['scope_table']} ( + scope VARCHAR(80) NOT NULL, + is_default BOOLEAN, + PRIMARY KEY (scope) + ); - CREATE TABLE {$this->config['jwt_table']} ( - client_id VARCHAR(80) NOT NULL, - subject VARCHAR(80), - public_key VARCHAR(2000) NOT NULL - ); + CREATE TABLE {$this->config['jwt_table']} ( + client_id VARCHAR(80) NOT NULL, + subject VARCHAR(80), + public_key VARCHAR(2000) NOT NULL + ); - CREATE TABLE {$this->config['jti_table']} ( - issuer VARCHAR(80) NOT NULL, - subject VARCHAR(80), - audience VARCHAR(80), - expires TIMESTAMP NOT NULL, - jti VARCHAR(2000) NOT NULL - ); + CREATE TABLE {$this->config['jti_table']} ( + issuer VARCHAR(80) NOT NULL, + subject VARCHAR(80), + audiance VARCHAR(80), + expires TIMESTAMP NOT NULL, + jti VARCHAR(2000) NOT NULL + ); - CREATE TABLE {$this->config['public_key_table']} ( - client_id VARCHAR(80), - public_key VARCHAR(2000), - private_key VARCHAR(2000), - encryption_algorithm VARCHAR(100) DEFAULT 'RS256' - ) -"; + CREATE TABLE {$this->config['public_key_table']} ( + client_id VARCHAR(80), + public_key VARCHAR(2000), + private_key VARCHAR(2000), + encryption_algorithm VARCHAR(100) DEFAULT 'RS256' + ) + "; return $sql; } -} +} \ No newline at end of file diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/PublicKeyInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/PublicKeyInterface.php index 108418d3a..a6dc49fb5 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/PublicKeyInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/PublicKeyInterface.php @@ -10,7 +10,21 @@ namespace OAuth2\Storage; */ interface PublicKeyInterface { + /** + * @param mixed $client_id + * @return mixed + */ public function getPublicKey($client_id = null); + + /** + * @param mixed $client_id + * @return mixed + */ public function getPrivateKey($client_id = null); + + /** + * @param mixed $client_id + * @return mixed + */ public function getEncryptionAlgorithm($client_id = null); -} +} \ No newline at end of file diff --git a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/UserCredentialsInterface.php b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/UserCredentialsInterface.php index 6e0fd7bad..f550579e4 100644 --- a/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/UserCredentialsInterface.php +++ b/vendor/bshaffer/oauth2-server-php/src/OAuth2/Storage/UserCredentialsInterface.php @@ -37,15 +37,15 @@ interface UserCredentialsInterface public function checkUserCredentials($username, $password); /** - * @return - * ARRAY the associated "user_id" and optional "scope" values - * This function MUST return FALSE if the requested user does not exist or is - * invalid. "scope" is a space-separated list of restricted scopes. + * @param string $username - username to get details for + * @return array|false - the associated "user_id" and optional "scope" values + * This function MUST return FALSE if the requested user does not exist or is + * invalid. "scope" is a space-separated list of restricted scopes. * @code - * return array( - * "user_id" => USER_ID, // REQUIRED user_id to be stored with the authorization code or access token - * "scope" => SCOPE // OPTIONAL space-separated list of restricted scopes - * ); + * return array( + * "user_id" => USER_ID, // REQUIRED user_id to be stored with the authorization code or access token + * "scope" => SCOPE // OPTIONAL space-separated list of restricted scopes + * ); * @endcode */ public function getUserDetails($username); diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/AutoloadTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/AutoloadTest.php index 5901bdc42..2cb292389 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/AutoloadTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/AutoloadTest.php @@ -2,7 +2,9 @@ namespace OAuth2; -class AutoloadTest extends \PHPUnit_Framework_TestCase +use PHPUnit\Framework\TestCase; + +class AutoloadTest extends TestCase { public function testClassesExist() { diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/AuthorizeControllerTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/AuthorizeControllerTest.php index 3bfc760e4..fe3553b23 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/AuthorizeControllerTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/AuthorizeControllerTest.php @@ -10,8 +10,9 @@ use OAuth2\GrantType\AuthorizationCode; use OAuth2\Request; use OAuth2\Response; use OAuth2\Request\TestRequest; +use PHPUnit\Framework\TestCase; -class AuthorizeControllerTest extends \PHPUnit_Framework_TestCase +class AuthorizeControllerTest extends TestCase { public function testNoClientIdResponse() { diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/ResourceControllerTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/ResourceControllerTest.php index b277514a5..cd54d239a 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/ResourceControllerTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/ResourceControllerTest.php @@ -7,8 +7,9 @@ use OAuth2\Server; use OAuth2\GrantType\AuthorizationCode; use OAuth2\Request; use OAuth2\Response; +use PHPUnit\Framework\TestCase; -class ResourceControllerTest extends \PHPUnit_Framework_TestCase +class ResourceControllerTest extends TestCase { public function testNoAccessToken() { diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/TokenControllerTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/TokenControllerTest.php index 4a217bd55..d18eaa6d7 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/TokenControllerTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/Controller/TokenControllerTest.php @@ -10,8 +10,9 @@ use OAuth2\GrantType\UserCredentials; use OAuth2\Scope; use OAuth2\Request\TestRequest; use OAuth2\Response; +use PHPUnit\Framework\TestCase; -class TokenControllerTest extends \PHPUnit_Framework_TestCase +class TokenControllerTest extends TestCase { public function testNoGrantType() { @@ -271,6 +272,48 @@ class TokenControllerTest extends \PHPUnit_Framework_TestCase $this->assertEquals($response->getParameter('error_description'), 'The request method must be POST when revoking an access token'); } + public function testCanUseCrossOriginRequestForRevoke() + { + $server = $this->getTestServer(); + + $request = new TestRequest(); + $request->setMethod('OPTIONS'); + + $server->handleRevokeRequest($request, $response = new Response()); + $this->assertTrue($response instanceof Response); + $this->assertEquals(200, $response->getStatusCode(), var_export($response, 1)); + $this->assertEquals($response->getHttpHeader('Allow'), 'POST, OPTIONS'); + } + + public function testInvalidRequestMethodForAccessToken() + { + $server = $this->getTestServer(); + + $request = new TestRequest(); + $request->setQuery(array( + 'token_type_hint' => 'access_token' + )); + + $server->handleTokenRequest($request, $response = new Response()); + $this->assertTrue($response instanceof Response); + $this->assertEquals(405, $response->getStatusCode(), var_export($response, 1)); + $this->assertEquals($response->getParameter('error'), 'invalid_request'); + $this->assertEquals($response->getParameter('error_description'), 'The request method must be POST when requesting an access token'); + } + + public function testCanUseCrossOriginRequestForAccessToken() + { + $server = $this->getTestServer(); + + $request = new TestRequest(); + $request->setMethod('OPTIONS'); + + $server->handleTokenRequest($request, $response = new Response()); + $this->assertTrue($response instanceof Response); + $this->assertEquals(200, $response->getStatusCode(), var_export($response, 1)); + $this->assertEquals($response->getHttpHeader('Allow'), 'POST, OPTIONS'); + } + public function testCreateController() { $storage = Bootstrap::getInstance()->getMemoryStorage(); diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/Encryption/FirebaseJwtTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/Encryption/FirebaseJwtTest.php index d34136767..c7e92c053 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/Encryption/FirebaseJwtTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/Encryption/FirebaseJwtTest.php @@ -3,8 +3,9 @@ namespace OAuth2\Encryption; use OAuth2\Storage\Bootstrap; +use PHPUnit\Framework\TestCase; -class FirebaseJwtTest extends \PHPUnit_Framework_TestCase +class FirebaseJwtTest extends TestCase { private $privateKey; diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/Encryption/JwtTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/Encryption/JwtTest.php index 214eebac8..d73b4c923 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/Encryption/JwtTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/Encryption/JwtTest.php @@ -3,8 +3,9 @@ namespace OAuth2\Encryption; use OAuth2\Storage\Bootstrap; +use PHPUnit\Framework\TestCase; -class JwtTest extends \PHPUnit_Framework_TestCase +class JwtTest extends TestCase { private $privateKey; diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/AuthorizationCodeTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/AuthorizationCodeTest.php index 356b8e53c..b2314ffc6 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/AuthorizationCodeTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/AuthorizationCodeTest.php @@ -6,8 +6,9 @@ use OAuth2\Storage\Bootstrap; use OAuth2\Server; use OAuth2\Request\TestRequest; use OAuth2\Response; +use PHPUnit\Framework\TestCase; -class AuthorizationCodeTest extends \PHPUnit_Framework_TestCase +class AuthorizationCodeTest extends TestCase { public function testNoCode() { diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/ClientCredentialsTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/ClientCredentialsTest.php index f0d46ccb3..2a7d0eb3d 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/ClientCredentialsTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/ClientCredentialsTest.php @@ -7,8 +7,9 @@ use OAuth2\Server; use OAuth2\Request\TestRequest; use OAuth2\Request; use OAuth2\Response; +use PHPUnit\Framework\TestCase; -class ClientCredentialsTest extends \PHPUnit_Framework_TestCase +class ClientCredentialsTest extends TestCase { public function testInvalidCredentials() { diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/ImplicitTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/ImplicitTest.php index a47aae3e8..14bf980f1 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/ImplicitTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/ImplicitTest.php @@ -6,8 +6,9 @@ use OAuth2\Storage\Bootstrap; use OAuth2\Server; use OAuth2\Request; use OAuth2\Response; +use PHPUnit\Framework\TestCase; -class ImplicitTest extends \PHPUnit_Framework_TestCase +class ImplicitTest extends TestCase { public function testImplicitNotAllowedResponse() { diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/JwtBearerTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/JwtBearerTest.php index 0a6c4b827..e60023b3c 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/JwtBearerTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/JwtBearerTest.php @@ -7,8 +7,9 @@ use OAuth2\Server; use OAuth2\Request\TestRequest; use OAuth2\Response; use OAuth2\Encryption\Jwt; +use PHPUnit\Framework\TestCase; -class JwtBearerTest extends \PHPUnit_Framework_TestCase +class JwtBearerTest extends TestCase { private $privateKey; diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/RefreshTokenTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/RefreshTokenTest.php index a458aad8a..c964c6bbd 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/RefreshTokenTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/RefreshTokenTest.php @@ -6,8 +6,9 @@ use OAuth2\Storage\Bootstrap; use OAuth2\Server; use OAuth2\Request\TestRequest; use OAuth2\Response; +use PHPUnit\Framework\TestCase; -class RefreshTokenTest extends \PHPUnit_Framework_TestCase +class RefreshTokenTest extends TestCase { private $storage; diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/UserCredentialsTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/UserCredentialsTest.php index 18943d055..8b725e13a 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/UserCredentialsTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/GrantType/UserCredentialsTest.php @@ -6,8 +6,9 @@ use OAuth2\Storage\Bootstrap; use OAuth2\Server; use OAuth2\Request\TestRequest; use OAuth2\Response; +use PHPUnit\Framework\TestCase; -class UserCredentialsTest extends \PHPUnit_Framework_TestCase +class UserCredentialsTest extends TestCase { public function testNoUsername() { diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/Controller/AuthorizeControllerTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/Controller/AuthorizeControllerTest.php index 46de936d8..fdc16daba 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/Controller/AuthorizeControllerTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/Controller/AuthorizeControllerTest.php @@ -6,8 +6,9 @@ use OAuth2\Storage\Bootstrap; use OAuth2\Server; use OAuth2\Request; use OAuth2\Response; +use PHPUnit\Framework\TestCase; -class AuthorizeControllerTest extends \PHPUnit_Framework_TestCase +class AuthorizeControllerTest extends TestCase { public function testValidateAuthorizeRequest() { diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/Controller/UserInfoControllerTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/Controller/UserInfoControllerTest.php index b1b687077..62e84df57 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/Controller/UserInfoControllerTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/Controller/UserInfoControllerTest.php @@ -6,8 +6,9 @@ use OAuth2\Storage\Bootstrap; use OAuth2\Server; use OAuth2\Request; use OAuth2\Response; +use PHPUnit\Framework\TestCase; -class UserInfoControllerTest extends \PHPUnit_Framework_TestCase +class UserInfoControllerTest extends TestCase { public function testCreateController() { diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/GrantType/AuthorizationCodeTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/GrantType/AuthorizationCodeTest.php index 776002d1e..c89a1ae97 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/GrantType/AuthorizationCodeTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/GrantType/AuthorizationCodeTest.php @@ -6,8 +6,9 @@ use OAuth2\Storage\Bootstrap; use OAuth2\Server; use OAuth2\Request\TestRequest; use OAuth2\Response; +use PHPUnit\Framework\TestCase; -class AuthorizationCodeTest extends \PHPUnit_Framework_TestCase +class AuthorizationCodeTest extends TestCase { public function testValidCode() { diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/ResponseType/CodeIdTokenTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/ResponseType/CodeIdTokenTest.php index b0311434a..7b892c946 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/ResponseType/CodeIdTokenTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/ResponseType/CodeIdTokenTest.php @@ -7,8 +7,9 @@ use OAuth2\Request; use OAuth2\Response; use OAuth2\Storage\Bootstrap; use OAuth2\GrantType\ClientCredentials; +use PHPUnit\Framework\TestCase; -class CodeIdTokenTest extends \PHPUnit_Framework_TestCase +class CodeIdTokenTest extends TestCase { public function testHandleAuthorizeRequest() { diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/ResponseType/IdTokenTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/ResponseType/IdTokenTest.php index e772f6be4..a0df3a936 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/ResponseType/IdTokenTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/ResponseType/IdTokenTest.php @@ -8,8 +8,9 @@ use OAuth2\Response; use OAuth2\Storage\Bootstrap; use OAuth2\GrantType\ClientCredentials; use OAuth2\Encryption\Jwt; +use PHPUnit\Framework\TestCase; -class IdTokenTest extends \PHPUnit_Framework_TestCase +class IdTokenTest extends TestCase { public function testValidateAuthorizeRequest() { diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/ResponseType/IdTokenTokenTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/ResponseType/IdTokenTokenTest.php index bc564d37b..0573a9866 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/ResponseType/IdTokenTokenTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/OpenID/ResponseType/IdTokenTokenTest.php @@ -8,8 +8,9 @@ use OAuth2\Response; use OAuth2\Storage\Bootstrap; use OAuth2\GrantType\ClientCredentials; use OAuth2\ResponseType\AccessToken; +use PHPUnit\Framework\TestCase; -class IdTokenTokenTest extends \PHPUnit_Framework_TestCase +class IdTokenTokenTest extends TestCase { public function testHandleAuthorizeRequest() diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/RequestTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/RequestTest.php index 10db3215c..cbf8f096b 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/RequestTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/RequestTest.php @@ -5,8 +5,9 @@ namespace OAuth2; use OAuth2\Request\TestRequest; use OAuth2\Storage\Bootstrap; use OAuth2\GrantType\AuthorizationCode; +use PHPUnit\Framework\TestCase; -class RequestTest extends \PHPUnit_Framework_TestCase +class RequestTest extends TestCase { public function testRequestOverride() { diff --git a/vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php b/vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php index b8149005d..2d2c57ee6 100644 --- a/vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/OAuth2/ResponseTest.php @@ -1,8 +1,8 @@ query = $query; } + public function setMethod($method) + { + $this->server['REQUEST_METHOD'] = $method; + } + public function setPost(array $params) { - $this->server['REQUEST_METHOD'] = 'POST'; + $this->setMethod('POST'); $this->request = $params; } diff --git a/vendor/bshaffer/oauth2-server-php/test/lib/OAuth2/Storage/BaseTest.php b/vendor/bshaffer/oauth2-server-php/test/lib/OAuth2/Storage/BaseTest.php old mode 100755 new mode 100644 index f0b1274a2..e841d3ad2 --- a/vendor/bshaffer/oauth2-server-php/test/lib/OAuth2/Storage/BaseTest.php +++ b/vendor/bshaffer/oauth2-server-php/test/lib/OAuth2/Storage/BaseTest.php @@ -2,7 +2,9 @@ namespace OAuth2\Storage; -abstract class BaseTest extends \PHPUnit_Framework_TestCase +use PHPUnit\Framework\TestCase; + +abstract class BaseTest extends TestCase { public function provideStorage() { diff --git a/vendor/bshaffer/oauth2-server-php/test/lib/OAuth2/Storage/Bootstrap.php b/vendor/bshaffer/oauth2-server-php/test/lib/OAuth2/Storage/Bootstrap.php old mode 100755 new mode 100644 diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index ea7bbb286..707f72738 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -755,10 +755,8 @@ return array( 'SimplePie_XML_Declaration_Parser' => $vendorDir . '/simplepie/simplepie/library/SimplePie/XML/Declaration/Parser.php', 'SimplePie_gzdecode' => $vendorDir . '/simplepie/simplepie/library/SimplePie/gzdecode.php', 'Text_LanguageDetect' => $vendorDir . '/pear/text_languagedetect/Text/LanguageDetect.php', - 'Text_LanguageDetectTest' => $vendorDir . '/pear/text_languagedetect/tests/Text_LanguageDetectTest.php', 'Text_LanguageDetect_Exception' => $vendorDir . '/pear/text_languagedetect/Text/LanguageDetect/Exception.php', 'Text_LanguageDetect_ISO639' => $vendorDir . '/pear/text_languagedetect/Text/LanguageDetect/ISO639.php', - 'Text_LanguageDetect_ISO639Test' => $vendorDir . '/pear/text_languagedetect/tests/Text_LanguageDetect_ISO639Test.php', 'Text_LanguageDetect_Parser' => $vendorDir . '/pear/text_languagedetect/Text/LanguageDetect/Parser.php', 'Zotlabs\\Access\\AccessList' => $baseDir . '/Zotlabs/Access/AccessList.php', 'Zotlabs\\Access\\PermissionLimits' => $baseDir . '/Zotlabs/Access/PermissionLimits.php', @@ -839,6 +837,8 @@ return array( 'Zotlabs\\Module\\Appman' => $baseDir . '/Zotlabs/Module/Appman.php', 'Zotlabs\\Module\\Apporder' => $baseDir . '/Zotlabs/Module/Apporder.php', 'Zotlabs\\Module\\Apps' => $baseDir . '/Zotlabs/Module/Apps.php', + 'Zotlabs\\Module\\Article_edit' => $baseDir . '/Zotlabs/Module/Article_edit.php', + 'Zotlabs\\Module\\Articles' => $baseDir . '/Zotlabs/Module/Articles.php', 'Zotlabs\\Module\\Attach' => $baseDir . '/Zotlabs/Module/Attach.php', 'Zotlabs\\Module\\Authorize' => $baseDir . '/Zotlabs/Module/Authorize.php', 'Zotlabs\\Module\\Authtest' => $baseDir . '/Zotlabs/Module/Authtest.php', @@ -990,13 +990,7 @@ return array( 'Zotlabs\\Module\\Toggle_safesearch' => $baseDir . '/Zotlabs/Module/Toggle_safesearch.php', 'Zotlabs\\Module\\Token' => $baseDir . '/Zotlabs/Module/Token.php', 'Zotlabs\\Module\\Uexport' => $baseDir . '/Zotlabs/Module/Uexport.php', - 'Zotlabs\\Module\\Update_cards' => $baseDir . '/Zotlabs/Module/Update_cards.php', - 'Zotlabs\\Module\\Update_channel' => $baseDir . '/Zotlabs/Module/Update_channel.php', - 'Zotlabs\\Module\\Update_display' => $baseDir . '/Zotlabs/Module/Update_display.php', - 'Zotlabs\\Module\\Update_home' => $baseDir . '/Zotlabs/Module/Update_home.php', - 'Zotlabs\\Module\\Update_network' => $baseDir . '/Zotlabs/Module/Update_network.php', - 'Zotlabs\\Module\\Update_pubstream' => $baseDir . '/Zotlabs/Module/Update_pubstream.php', - 'Zotlabs\\Module\\Update_search' => $baseDir . '/Zotlabs/Module/Update_search.php', + 'Zotlabs\\Module\\Update' => $baseDir . '/Zotlabs/Module/Update.php', 'Zotlabs\\Module\\View' => $baseDir . '/Zotlabs/Module/View.php', 'Zotlabs\\Module\\Viewconnections' => $baseDir . '/Zotlabs/Module/Viewconnections.php', 'Zotlabs\\Module\\Viewsrc' => $baseDir . '/Zotlabs/Module/Viewsrc.php', @@ -1027,6 +1021,11 @@ return array( 'Zotlabs\\Storage\\File' => $baseDir . '/Zotlabs/Storage/File.php', 'Zotlabs\\Storage\\GitRepo' => $baseDir . '/Zotlabs/Storage/GitRepo.php', 'Zotlabs\\Text\\Tagadelic' => $baseDir . '/Zotlabs/Text/Tagadelic.php', + 'Zotlabs\\Thumbs\\Epubthumb' => $baseDir . '/Zotlabs/Thumbs/Epubthumb.php', + 'Zotlabs\\Thumbs\\Mp3audio' => $baseDir . '/Zotlabs/Thumbs/Mp3audio.php', + 'Zotlabs\\Thumbs\\Pdf' => $baseDir . '/Zotlabs/Thumbs/Pdf.php', + 'Zotlabs\\Thumbs\\Text' => $baseDir . '/Zotlabs/Thumbs/Text.php', + 'Zotlabs\\Thumbs\\Video' => $baseDir . '/Zotlabs/Thumbs/Video.php', 'Zotlabs\\Web\\CheckJS' => $baseDir . '/Zotlabs/Web/CheckJS.php', 'Zotlabs\\Web\\Controller' => $baseDir . '/Zotlabs/Web/Controller.php', 'Zotlabs\\Web\\HTTPHeaders' => $baseDir . '/Zotlabs/Web/HTTPHeaders.php', @@ -1065,6 +1064,7 @@ return array( 'Zotlabs\\Widget\\Forums' => $baseDir . '/Zotlabs/Widget/Forums.php', 'Zotlabs\\Widget\\Fullprofile' => $baseDir . '/Zotlabs/Widget/Fullprofile.php', 'Zotlabs\\Widget\\Helpindex' => $baseDir . '/Zotlabs/Widget/Helpindex.php', + 'Zotlabs\\Widget\\Hq_controls' => $baseDir . '/Zotlabs/Widget/Hq_controls.php', 'Zotlabs\\Widget\\Item' => $baseDir . '/Zotlabs/Widget/Item.php', 'Zotlabs\\Widget\\Mailmenu' => $baseDir . '/Zotlabs/Widget/Mailmenu.php', 'Zotlabs\\Widget\\Menu_preview' => $baseDir . '/Zotlabs/Widget/Menu_preview.php', diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index bbe6fd553..f2747ecac 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -7,11 +7,12 @@ $baseDir = dirname($vendorDir); return array( '383eaff206634a77a1be54e64e6459c7' => $vendorDir . '/sabre/uri/lib/functions.php', + '3569eecfeed3bcf0bad3c998a494ecb8' => $vendorDir . '/sabre/xml/lib/Deserializer/functions.php', + '93aa591bc4ca510c520999e34229ee79' => $vendorDir . '/sabre/xml/lib/Serializer/functions.php', '2b9d0f43f9552984cfa82fee95491826' => $vendorDir . '/sabre/event/lib/coroutine.php', 'd81bab31d3feb45bfe2f283ea3c8fdf7' => $vendorDir . '/sabre/event/lib/Loop/functions.php', 'a1cce3d26cc15c00fcd0b3354bd72c88' => $vendorDir . '/sabre/event/lib/Promise/functions.php', - '3569eecfeed3bcf0bad3c998a494ecb8' => $vendorDir . '/sabre/xml/lib/Deserializer/functions.php', - '93aa591bc4ca510c520999e34229ee79' => $vendorDir . '/sabre/xml/lib/Serializer/functions.php', 'ebdb698ed4152ae445614b69b5e4bb6a' => $vendorDir . '/sabre/http/lib/functions.php', '2cffec82183ee1cea088009cef9a6fc3' => $vendorDir . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php', + 'f084d01b0a599f67676cffef638aa95b' => $vendorDir . '/smarty/smarty/libs/bootstrap.php', ); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 63dc8c257..74d6cf27b 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -8,13 +8,14 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d { public static $files = array ( '383eaff206634a77a1be54e64e6459c7' => __DIR__ . '/..' . '/sabre/uri/lib/functions.php', + '3569eecfeed3bcf0bad3c998a494ecb8' => __DIR__ . '/..' . '/sabre/xml/lib/Deserializer/functions.php', + '93aa591bc4ca510c520999e34229ee79' => __DIR__ . '/..' . '/sabre/xml/lib/Serializer/functions.php', '2b9d0f43f9552984cfa82fee95491826' => __DIR__ . '/..' . '/sabre/event/lib/coroutine.php', 'd81bab31d3feb45bfe2f283ea3c8fdf7' => __DIR__ . '/..' . '/sabre/event/lib/Loop/functions.php', 'a1cce3d26cc15c00fcd0b3354bd72c88' => __DIR__ . '/..' . '/sabre/event/lib/Promise/functions.php', - '3569eecfeed3bcf0bad3c998a494ecb8' => __DIR__ . '/..' . '/sabre/xml/lib/Deserializer/functions.php', - '93aa591bc4ca510c520999e34229ee79' => __DIR__ . '/..' . '/sabre/xml/lib/Serializer/functions.php', 'ebdb698ed4152ae445614b69b5e4bb6a' => __DIR__ . '/..' . '/sabre/http/lib/functions.php', '2cffec82183ee1cea088009cef9a6fc3' => __DIR__ . '/..' . '/ezyang/htmlpurifier/library/HTMLPurifier.composer.php', + 'f084d01b0a599f67676cffef638aa95b' => __DIR__ . '/..' . '/smarty/smarty/libs/bootstrap.php', ); public static $prefixLengthsPsr4 = array ( @@ -907,10 +908,8 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d 'SimplePie_XML_Declaration_Parser' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/XML/Declaration/Parser.php', 'SimplePie_gzdecode' => __DIR__ . '/..' . '/simplepie/simplepie/library/SimplePie/gzdecode.php', 'Text_LanguageDetect' => __DIR__ . '/..' . '/pear/text_languagedetect/Text/LanguageDetect.php', - 'Text_LanguageDetectTest' => __DIR__ . '/..' . '/pear/text_languagedetect/tests/Text_LanguageDetectTest.php', 'Text_LanguageDetect_Exception' => __DIR__ . '/..' . '/pear/text_languagedetect/Text/LanguageDetect/Exception.php', 'Text_LanguageDetect_ISO639' => __DIR__ . '/..' . '/pear/text_languagedetect/Text/LanguageDetect/ISO639.php', - 'Text_LanguageDetect_ISO639Test' => __DIR__ . '/..' . '/pear/text_languagedetect/tests/Text_LanguageDetect_ISO639Test.php', 'Text_LanguageDetect_Parser' => __DIR__ . '/..' . '/pear/text_languagedetect/Text/LanguageDetect/Parser.php', 'Zotlabs\\Access\\AccessList' => __DIR__ . '/../..' . '/Zotlabs/Access/AccessList.php', 'Zotlabs\\Access\\PermissionLimits' => __DIR__ . '/../..' . '/Zotlabs/Access/PermissionLimits.php', @@ -991,6 +990,8 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d 'Zotlabs\\Module\\Appman' => __DIR__ . '/../..' . '/Zotlabs/Module/Appman.php', 'Zotlabs\\Module\\Apporder' => __DIR__ . '/../..' . '/Zotlabs/Module/Apporder.php', 'Zotlabs\\Module\\Apps' => __DIR__ . '/../..' . '/Zotlabs/Module/Apps.php', + 'Zotlabs\\Module\\Article_edit' => __DIR__ . '/../..' . '/Zotlabs/Module/Article_edit.php', + 'Zotlabs\\Module\\Articles' => __DIR__ . '/../..' . '/Zotlabs/Module/Articles.php', 'Zotlabs\\Module\\Attach' => __DIR__ . '/../..' . '/Zotlabs/Module/Attach.php', 'Zotlabs\\Module\\Authorize' => __DIR__ . '/../..' . '/Zotlabs/Module/Authorize.php', 'Zotlabs\\Module\\Authtest' => __DIR__ . '/../..' . '/Zotlabs/Module/Authtest.php', @@ -1142,13 +1143,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d 'Zotlabs\\Module\\Toggle_safesearch' => __DIR__ . '/../..' . '/Zotlabs/Module/Toggle_safesearch.php', 'Zotlabs\\Module\\Token' => __DIR__ . '/../..' . '/Zotlabs/Module/Token.php', 'Zotlabs\\Module\\Uexport' => __DIR__ . '/../..' . '/Zotlabs/Module/Uexport.php', - 'Zotlabs\\Module\\Update_cards' => __DIR__ . '/../..' . '/Zotlabs/Module/Update_cards.php', - 'Zotlabs\\Module\\Update_channel' => __DIR__ . '/../..' . '/Zotlabs/Module/Update_channel.php', - 'Zotlabs\\Module\\Update_display' => __DIR__ . '/../..' . '/Zotlabs/Module/Update_display.php', - 'Zotlabs\\Module\\Update_home' => __DIR__ . '/../..' . '/Zotlabs/Module/Update_home.php', - 'Zotlabs\\Module\\Update_network' => __DIR__ . '/../..' . '/Zotlabs/Module/Update_network.php', - 'Zotlabs\\Module\\Update_pubstream' => __DIR__ . '/../..' . '/Zotlabs/Module/Update_pubstream.php', - 'Zotlabs\\Module\\Update_search' => __DIR__ . '/../..' . '/Zotlabs/Module/Update_search.php', + 'Zotlabs\\Module\\Update' => __DIR__ . '/../..' . '/Zotlabs/Module/Update.php', 'Zotlabs\\Module\\View' => __DIR__ . '/../..' . '/Zotlabs/Module/View.php', 'Zotlabs\\Module\\Viewconnections' => __DIR__ . '/../..' . '/Zotlabs/Module/Viewconnections.php', 'Zotlabs\\Module\\Viewsrc' => __DIR__ . '/../..' . '/Zotlabs/Module/Viewsrc.php', @@ -1179,6 +1174,11 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d 'Zotlabs\\Storage\\File' => __DIR__ . '/../..' . '/Zotlabs/Storage/File.php', 'Zotlabs\\Storage\\GitRepo' => __DIR__ . '/../..' . '/Zotlabs/Storage/GitRepo.php', 'Zotlabs\\Text\\Tagadelic' => __DIR__ . '/../..' . '/Zotlabs/Text/Tagadelic.php', + 'Zotlabs\\Thumbs\\Epubthumb' => __DIR__ . '/../..' . '/Zotlabs/Thumbs/Epubthumb.php', + 'Zotlabs\\Thumbs\\Mp3audio' => __DIR__ . '/../..' . '/Zotlabs/Thumbs/Mp3audio.php', + 'Zotlabs\\Thumbs\\Pdf' => __DIR__ . '/../..' . '/Zotlabs/Thumbs/Pdf.php', + 'Zotlabs\\Thumbs\\Text' => __DIR__ . '/../..' . '/Zotlabs/Thumbs/Text.php', + 'Zotlabs\\Thumbs\\Video' => __DIR__ . '/../..' . '/Zotlabs/Thumbs/Video.php', 'Zotlabs\\Web\\CheckJS' => __DIR__ . '/../..' . '/Zotlabs/Web/CheckJS.php', 'Zotlabs\\Web\\Controller' => __DIR__ . '/../..' . '/Zotlabs/Web/Controller.php', 'Zotlabs\\Web\\HTTPHeaders' => __DIR__ . '/../..' . '/Zotlabs/Web/HTTPHeaders.php', @@ -1217,6 +1217,7 @@ class ComposerStaticInit7b34d7e50a62201ec5d5e526a5b8b35d 'Zotlabs\\Widget\\Forums' => __DIR__ . '/../..' . '/Zotlabs/Widget/Forums.php', 'Zotlabs\\Widget\\Fullprofile' => __DIR__ . '/../..' . '/Zotlabs/Widget/Fullprofile.php', 'Zotlabs\\Widget\\Helpindex' => __DIR__ . '/../..' . '/Zotlabs/Widget/Helpindex.php', + 'Zotlabs\\Widget\\Hq_controls' => __DIR__ . '/../..' . '/Zotlabs/Widget/Hq_controls.php', 'Zotlabs\\Widget\\Item' => __DIR__ . '/../..' . '/Zotlabs/Widget/Item.php', 'Zotlabs\\Widget\\Mailmenu' => __DIR__ . '/../..' . '/Zotlabs/Widget/Mailmenu.php', 'Zotlabs\\Widget\\Menu_preview' => __DIR__ . '/../..' . '/Zotlabs/Widget/Menu_preview.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 31aa8aef4..52312a34a 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,38 +1,267 @@ [ { - "name": "sabre/event", - "version": "3.0.0", - "version_normalized": "3.0.0.0", + "name": "commerceguys/intl", + "version": "v0.7.4", + "version_normalized": "0.7.4.0", "source": { "type": "git", - "url": "https://github.com/sabre-io/event.git", - "reference": "831d586f5a442dceacdcf5e9c4c36a4db99a3534" + "url": "https://github.com/commerceguys/intl.git", + "reference": "edfcfc26ed8505c4f6fcf862eb36dfda1af74b00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/event/zipball/831d586f5a442dceacdcf5e9c4c36a4db99a3534", - "reference": "831d586f5a442dceacdcf5e9c4c36a4db99a3534", + "url": "https://api.github.com/repos/commerceguys/intl/zipball/edfcfc26ed8505c4f6fcf862eb36dfda1af74b00", + "reference": "edfcfc26ed8505c4f6fcf862eb36dfda1af74b00", "shasum": "" }, "require": { - "php": ">=5.5" + "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "*", - "sabre/cs": "~0.0.4" + "mikey179/vfsstream": "1.*", + "phpunit/phpunit": "~4.0" }, - "time": "2015-11-05T20:14:39+00:00", + "time": "2016-12-13T12:33:19+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "CommerceGuys\\Intl\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bojan Zivanovic" + } + ], + "description": "Internationalization library powered by CLDR data." + }, + { + "name": "ezyang/htmlpurifier", + "version": "v4.9.3", + "version_normalized": "4.9.3.0", + "source": { + "type": "git", + "url": "https://github.com/ezyang/htmlpurifier.git", + "reference": "95e1bae3182efc0f3422896a3236e991049dac69" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/95e1bae3182efc0f3422896a3236e991049dac69", + "reference": "95e1bae3182efc0f3422896a3236e991049dac69", + "shasum": "" + }, + "require": { + "php": ">=5.2" + }, + "require-dev": { + "simpletest/simpletest": "^1.1" + }, + "time": "2017-06-03T02:28:16+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "HTMLPurifier": "library/" + }, + "files": [ + "library/HTMLPurifier.composer.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL" + ], + "authors": [ + { + "name": "Edward Z. Yang", + "email": "admin@htmlpurifier.org", + "homepage": "http://ezyang.com" + } + ], + "description": "Standards compliant HTML filter written in PHP", + "homepage": "http://htmlpurifier.org/", + "keywords": [ + "html" + ] + }, + { + "name": "lukasreschke/id3parser", + "version": "v0.0.1", + "version_normalized": "0.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/LukasReschke/ID3Parser.git", + "reference": "cd3ba6e8918cc30883f01a3c24281cfe23b8877a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/LukasReschke/ID3Parser/zipball/cd3ba6e8918cc30883f01a3c24281cfe23b8877a", + "reference": "cd3ba6e8918cc30883f01a3c24281cfe23b8877a", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "time": "2016-04-04T09:34:50+00:00", "type": "library", "installation-source": "dist", "autoload": { "psr-4": { - "Sabre\\Event\\": "lib/" + "ID3Parser\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL" + ], + "homepage": "https://github.com/LukasReschke/ID3Parser/", + "keywords": [ + "codecs", + "php", + "tags" + ] + }, + { + "name": "michelf/php-markdown", + "version": "1.7.0", + "version_normalized": "1.7.0.0", + "source": { + "type": "git", + "url": "https://github.com/michelf/php-markdown.git", + "reference": "1f51cc520948f66cd2af8cbc45a5ee175e774220" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/michelf/php-markdown/zipball/1f51cc520948f66cd2af8cbc45a5ee175e774220", + "reference": "1f51cc520948f66cd2af8cbc45a5ee175e774220", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2016-10-29T18:58:20+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-lib": "1.4.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Michelf": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Michel Fortin", + "email": "michel.fortin@michelf.ca", + "homepage": "https://michelf.ca/", + "role": "Developer" }, + { + "name": "John Gruber", + "homepage": "https://daringfireball.net/" + } + ], + "description": "PHP Markdown", + "homepage": "https://michelf.ca/projects/php-markdown/", + "keywords": [ + "markdown" + ] + }, + { + "name": "pear/text_languagedetect", + "version": "v1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/pear/Text_LanguageDetect.git", + "reference": "bb9ff6f4970f686fac59081e916b456021fe7ba6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pear/Text_LanguageDetect/zipball/bb9ff6f4970f686fac59081e916b456021fe7ba6", + "reference": "bb9ff6f4970f686fac59081e916b456021fe7ba6", + "shasum": "" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-mbstring": "May require the mbstring PHP extension" + }, + "time": "2017-03-02T16:14:08+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Text": "./" + } + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "./" + ], + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Nicholas Pisarro", + "email": "taak@php.net", + "role": "Lead" + } + ], + "description": "Identify human languages from text samples", + "homepage": "http://pear.php.net/package/Text_LanguageDetect" + }, + { + "name": "sabre/uri", + "version": "1.2.1", + "version_normalized": "1.2.1.0", + "source": { + "type": "git", + "url": "https://github.com/sabre-io/uri.git", + "reference": "ada354d83579565949d80b2e15593c2371225e61" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sabre-io/uri/zipball/ada354d83579565949d80b2e15593c2371225e61", + "reference": "ada354d83579565949d80b2e15593c2371225e61", + "shasum": "" + }, + "require": { + "php": ">=5.4.7" + }, + "require-dev": { + "phpunit/phpunit": ">=4.0,<6.0", + "sabre/cs": "~1.0.0" + }, + "time": "2017-02-20T19:59:28+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { "files": [ - "lib/coroutine.php", - "lib/Loop/functions.php", - "lib/Promise/functions.php" - ] + "lib/functions.php" + ], + "psr-4": { + "Sabre\\Uri\\": "lib/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -46,16 +275,12 @@ "role": "Developer" } ], - "description": "sabre/event is a library for lightweight event-based programming", - "homepage": "http://sabre.io/event/", + "description": "Functions for making sense out of URIs.", + "homepage": "http://sabre.io/uri/", "keywords": [ - "EventEmitter", - "async", - "events", - "hooks", - "plugin", - "promise", - "signal" + "rfc3986", + "uri", + "url" ] }, { @@ -123,6 +348,123 @@ "xml" ] }, + { + "name": "sabre/event", + "version": "3.0.0", + "version_normalized": "3.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/sabre-io/event.git", + "reference": "831d586f5a442dceacdcf5e9c4c36a4db99a3534" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sabre-io/event/zipball/831d586f5a442dceacdcf5e9c4c36a4db99a3534", + "reference": "831d586f5a442dceacdcf5e9c4c36a4db99a3534", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "*", + "sabre/cs": "~0.0.4" + }, + "time": "2015-11-05T20:14:39+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Sabre\\Event\\": "lib/" + }, + "files": [ + "lib/coroutine.php", + "lib/Loop/functions.php", + "lib/Promise/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Evert Pot", + "email": "me@evertpot.com", + "homepage": "http://evertpot.com/", + "role": "Developer" + } + ], + "description": "sabre/event is a library for lightweight event-based programming", + "homepage": "http://sabre.io/event/", + "keywords": [ + "EventEmitter", + "async", + "events", + "hooks", + "plugin", + "promise", + "signal" + ] + }, + { + "name": "sabre/http", + "version": "4.2.3", + "version_normalized": "4.2.3.0", + "source": { + "type": "git", + "url": "https://github.com/sabre-io/http.git", + "reference": "0295f9a3ee39be97e0898592fc19e42421e0cd93" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sabre-io/http/zipball/0295f9a3ee39be97e0898592fc19e42421e0cd93", + "reference": "0295f9a3ee39be97e0898592fc19e42421e0cd93", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-mbstring": "*", + "php": ">=5.4", + "sabre/event": ">=1.0.0,<4.0.0", + "sabre/uri": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.3", + "sabre/cs": "~0.0.1" + }, + "suggest": { + "ext-curl": " to make http requests with the Client class" + }, + "time": "2017-06-12T07:53:04+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "lib/functions.php" + ], + "psr-4": { + "Sabre\\HTTP\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Evert Pot", + "email": "me@evertpot.com", + "homepage": "http://evertpot.com/", + "role": "Developer" + } + ], + "description": "The sabre/http library provides utilities for dealing with http requests and responses. ", + "homepage": "https://github.com/fruux/sabre-http", + "keywords": [ + "http" + ] + }, { "name": "psr/log", "version": "1.0.2", @@ -172,182 +514,6 @@ "psr-3" ] }, - { - "name": "michelf/php-markdown", - "version": "1.7.0", - "version_normalized": "1.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/michelf/php-markdown.git", - "reference": "1f51cc520948f66cd2af8cbc45a5ee175e774220" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/michelf/php-markdown/zipball/1f51cc520948f66cd2af8cbc45a5ee175e774220", - "reference": "1f51cc520948f66cd2af8cbc45a5ee175e774220", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2016-10-29T18:58:20+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-lib": "1.4.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Michelf": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Michel Fortin", - "email": "michel.fortin@michelf.ca", - "homepage": "https://michelf.ca/", - "role": "Developer" - }, - { - "name": "John Gruber", - "homepage": "https://daringfireball.net/" - } - ], - "description": "PHP Markdown", - "homepage": "https://michelf.ca/projects/php-markdown/", - "keywords": [ - "markdown" - ] - }, - { - "name": "bshaffer/oauth2-server-php", - "version": "v1.9.0", - "version_normalized": "1.9.0.0", - "source": { - "type": "git", - "url": "https://github.com/bshaffer/oauth2-server-php.git", - "reference": "8856aed1a98d6da596ae3f9b8095b5c7a1581697" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/bshaffer/oauth2-server-php/zipball/8856aed1a98d6da596ae3f9b8095b5c7a1581697", - "reference": "8856aed1a98d6da596ae3f9b8095b5c7a1581697", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "aws/aws-sdk-php": "~2.8", - "firebase/php-jwt": "~2.2", - "mongodb/mongodb": "^1.1", - "predis/predis": "dev-master", - "thobbs/phpcassa": "dev-master" - }, - "suggest": { - "aws/aws-sdk-php": "~2.8 is required to use DynamoDB storage", - "firebase/php-jwt": "~1.1 is required to use MondoDB storage", - "predis/predis": "Required to use Redis storage", - "thobbs/phpcassa": "Required to use Cassandra storage" - }, - "time": "2017-01-06T23:20:00+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "OAuth2": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Brent Shaffer", - "email": "bshafs@gmail.com", - "homepage": "http://brentertainment.com" - } - ], - "description": "OAuth2 Server for PHP", - "homepage": "http://github.com/bshaffer/oauth2-server-php", - "keywords": [ - "auth", - "oauth", - "oauth2" - ] - }, - { - "name": "simplepie/simplepie", - "version": "1.5", - "version_normalized": "1.5.0.0", - "source": { - "type": "git", - "url": "https://github.com/simplepie/simplepie.git", - "reference": "5de5551953f95feef12cf355a7a26a70f94aa3ab" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/simplepie/simplepie/zipball/5de5551953f95feef12cf355a7a26a70f94aa3ab", - "reference": "5de5551953f95feef12cf355a7a26a70f94aa3ab", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "~4 || ~5" - }, - "suggest": { - "mf2/mf2": "Microformat module that allows for parsing HTML for microformats" - }, - "time": "2017-04-17T07:29:31+00:00", - "type": "library", - "installation-source": "source", - "autoload": { - "psr-0": { - "SimplePie": "library" - } - }, - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Ryan Parman", - "homepage": "http://ryanparman.com/", - "role": "Creator, alumnus developer" - }, - { - "name": "Geoffrey Sneddon", - "homepage": "http://gsnedders.com/", - "role": "Alumnus developer" - }, - { - "name": "Ryan McCue", - "email": "me@ryanmccue.info", - "homepage": "http://ryanmccue.info/", - "role": "Developer" - } - ], - "description": "A simple Atom/RSS parsing library for PHP", - "homepage": "http://simplepie.org/", - "keywords": [ - "atom", - "feeds", - "rss" - ], - "support": { - "source": "https://github.com/simplepie/simplepie/tree/1.5", - "issues": "https://github.com/simplepie/simplepie/issues" - } - }, { "name": "sabre/dav", "version": "3.2.2", @@ -434,18 +600,143 @@ ] }, { - "name": "league/html-to-markdown", - "version": "4.4.1", - "version_normalized": "4.4.1.0", + "name": "bshaffer/oauth2-server-php", + "version": "v1.10.0", + "version_normalized": "1.10.0.0", "source": { "type": "git", - "url": "https://github.com/thephpleague/html-to-markdown.git", - "reference": "82ea375b5b2b1da1da222644c0565c695bf88186" + "url": "https://github.com/bshaffer/oauth2-server-php.git", + "reference": "d158878425392fe5a0cc34f15dbaf46315ae0ed9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/82ea375b5b2b1da1da222644c0565c695bf88186", - "reference": "82ea375b5b2b1da1da222644c0565c695bf88186", + "url": "https://api.github.com/repos/bshaffer/oauth2-server-php/zipball/d158878425392fe5a0cc34f15dbaf46315ae0ed9", + "reference": "d158878425392fe5a0cc34f15dbaf46315ae0ed9", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "aws/aws-sdk-php": "~2.8", + "firebase/php-jwt": "~2.2", + "mongodb/mongodb": "^1.1", + "phpunit/phpunit": "^4.0", + "predis/predis": "dev-master", + "thobbs/phpcassa": "dev-master" + }, + "suggest": { + "aws/aws-sdk-php": "~2.8 is required to use DynamoDB storage", + "firebase/php-jwt": "~2.2 is required to use JWT features", + "mongodb/mongodb": "^1.1 is required to use MongoDB storage", + "predis/predis": "Required to use Redis storage", + "thobbs/phpcassa": "Required to use Cassandra storage" + }, + "time": "2017-11-15T01:41:02+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "OAuth2": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brent Shaffer", + "email": "bshafs@gmail.com", + "homepage": "http://brentertainment.com" + } + ], + "description": "OAuth2 Server for PHP", + "homepage": "http://github.com/bshaffer/oauth2-server-php", + "keywords": [ + "auth", + "oauth", + "oauth2" + ] + }, + { + "name": "simplepie/simplepie", + "version": "1.5.1", + "version_normalized": "1.5.1.0", + "source": { + "type": "git", + "url": "https://github.com/simplepie/simplepie.git", + "reference": "db9fff27b6d49eed3d4047cd3211ec8dba2f5d6e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/simplepie/simplepie/zipball/db9fff27b6d49eed3d4047cd3211ec8dba2f5d6e", + "reference": "db9fff27b6d49eed3d4047cd3211ec8dba2f5d6e", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4 || ~5" + }, + "suggest": { + "mf2/mf2": "Microformat module that allows for parsing HTML for microformats" + }, + "time": "2017-11-12T02:03:34+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "SimplePie": "library" + } + }, + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Ryan Parman", + "homepage": "http://ryanparman.com/", + "role": "Creator, alumnus developer" + }, + { + "name": "Geoffrey Sneddon", + "homepage": "http://gsnedders.com/", + "role": "Alumnus developer" + }, + { + "name": "Ryan McCue", + "email": "me@ryanmccue.info", + "homepage": "http://ryanmccue.info/", + "role": "Developer" + } + ], + "description": "A simple Atom/RSS parsing library for PHP", + "homepage": "http://simplepie.org/", + "keywords": [ + "atom", + "feeds", + "rss" + ], + "support": { + "source": "https://github.com/simplepie/simplepie/tree/1.5.1", + "issues": "https://github.com/simplepie/simplepie/issues" + } + }, + { + "name": "league/html-to-markdown", + "version": "4.6.0", + "version_normalized": "4.6.0.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/html-to-markdown.git", + "reference": "9022e648bc40e44cb3b18438d97ed8715ecbc49b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/9022e648bc40e44cb3b18438d97ed8715ecbc49b", + "reference": "9022e648bc40e44cb3b18438d97ed8715ecbc49b", "shasum": "" }, "require": { @@ -458,14 +749,14 @@ "phpunit/phpunit": "4.*", "scrutinizer/ocular": "~1.1" }, - "time": "2017-03-16T00:45:59+00:00", + "time": "2017-10-24T02:45:05+00:00", "bin": [ "bin/html-to-markdown" ], "type": "library", "extra": { "branch-alias": { - "dev-master": "4.5-dev" + "dev-master": "4.7-dev" } }, "installation-source": "dist", @@ -499,72 +790,19 @@ "markdown" ] }, - { - "name": "sabre/uri", - "version": "1.2.1", - "version_normalized": "1.2.1.0", - "source": { - "type": "git", - "url": "https://github.com/sabre-io/uri.git", - "reference": "ada354d83579565949d80b2e15593c2371225e61" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sabre-io/uri/zipball/ada354d83579565949d80b2e15593c2371225e61", - "reference": "ada354d83579565949d80b2e15593c2371225e61", - "shasum": "" - }, - "require": { - "php": ">=5.4.7" - }, - "require-dev": { - "phpunit/phpunit": ">=4.0,<6.0", - "sabre/cs": "~1.0.0" - }, - "time": "2017-02-20T19:59:28+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "lib/functions.php" - ], - "psr-4": { - "Sabre\\Uri\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Evert Pot", - "email": "me@evertpot.com", - "homepage": "http://evertpot.com/", - "role": "Developer" - } - ], - "description": "Functions for making sense out of URIs.", - "homepage": "http://sabre.io/uri/", - "keywords": [ - "rfc3986", - "uri", - "url" - ] - }, { "name": "sabre/vobject", - "version": "4.1.2", - "version_normalized": "4.1.2.0", + "version": "4.1.3", + "version_normalized": "4.1.3.0", "source": { "type": "git", "url": "https://github.com/sabre-io/vobject.git", - "reference": "d0fde2fafa2a3dad1f559c2d1c2591d4fd75ae3c" + "reference": "df9916813d1d83e4f761c4cba13361ee74196fac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sabre-io/vobject/zipball/d0fde2fafa2a3dad1f559c2d1c2591d4fd75ae3c", - "reference": "d0fde2fafa2a3dad1f559c2d1c2591d4fd75ae3c", + "url": "https://api.github.com/repos/sabre-io/vobject/zipball/df9916813d1d83e4f761c4cba13361ee74196fac", + "reference": "df9916813d1d83e4f761c4cba13361ee74196fac", "shasum": "" }, "require": { @@ -573,13 +811,13 @@ "sabre/xml": ">=1.5 <3.0" }, "require-dev": { - "phpunit/phpunit": "*", + "phpunit/phpunit": "> 4.8, <6.0.0", "sabre/cs": "^1.0.0" }, "suggest": { "hoa/bench": "If you would like to run the benchmark scripts" }, - "time": "2016-12-06T04:14:09+00:00", + "time": "2017-10-18T08:29:40+00:00", "bin": [ "bin/vobject", "bin/generate_vcards" @@ -652,239 +890,58 @@ ] }, { - "name": "ezyang/htmlpurifier", - "version": "v4.9.3", - "version_normalized": "4.9.3.0", + "name": "smarty/smarty", + "version": "v3.1.31", + "version_normalized": "3.1.31.0", "source": { "type": "git", - "url": "https://github.com/ezyang/htmlpurifier.git", - "reference": "95e1bae3182efc0f3422896a3236e991049dac69" + "url": "https://github.com/smarty-php/smarty.git", + "reference": "c7d42e4a327c402897dd587871434888fde1e7a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/95e1bae3182efc0f3422896a3236e991049dac69", - "reference": "95e1bae3182efc0f3422896a3236e991049dac69", + "url": "https://api.github.com/repos/smarty-php/smarty/zipball/c7d42e4a327c402897dd587871434888fde1e7a9", + "reference": "c7d42e4a327c402897dd587871434888fde1e7a9", "shasum": "" }, "require": { "php": ">=5.2" }, - "require-dev": { - "simpletest/simpletest": "^1.1" - }, - "time": "2017-06-03T02:28:16+00:00", + "time": "2016-12-14T21:57:25+00:00", "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, "installation-source": "dist", "autoload": { - "psr-0": { - "HTMLPurifier": "library/" - }, "files": [ - "library/HTMLPurifier.composer.php" + "libs/bootstrap.php" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL" + "LGPL-3.0" ], "authors": [ { - "name": "Edward Z. Yang", - "email": "admin@htmlpurifier.org", - "homepage": "http://ezyang.com" + "name": "Monte Ohrt", + "email": "monte@ohrt.com" + }, + { + "name": "Uwe Tews", + "email": "uwe.tews@googlemail.com" + }, + { + "name": "Rodney Rehm", + "email": "rodney.rehm@medialize.de" } ], - "description": "Standards compliant HTML filter written in PHP", - "homepage": "http://htmlpurifier.org/", + "description": "Smarty - the compiling PHP template engine", + "homepage": "http://www.smarty.net", "keywords": [ - "html" - ] - }, - { - "name": "sabre/http", - "version": "4.2.3", - "version_normalized": "4.2.3.0", - "source": { - "type": "git", - "url": "https://github.com/sabre-io/http.git", - "reference": "0295f9a3ee39be97e0898592fc19e42421e0cd93" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sabre-io/http/zipball/0295f9a3ee39be97e0898592fc19e42421e0cd93", - "reference": "0295f9a3ee39be97e0898592fc19e42421e0cd93", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "ext-mbstring": "*", - "php": ">=5.4", - "sabre/event": ">=1.0.0,<4.0.0", - "sabre/uri": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.3", - "sabre/cs": "~0.0.1" - }, - "suggest": { - "ext-curl": " to make http requests with the Client class" - }, - "time": "2017-06-12T07:53:04+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "lib/functions.php" - ], - "psr-4": { - "Sabre\\HTTP\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Evert Pot", - "email": "me@evertpot.com", - "homepage": "http://evertpot.com/", - "role": "Developer" - } - ], - "description": "The sabre/http library provides utilities for dealing with http requests and responses. ", - "homepage": "https://github.com/fruux/sabre-http", - "keywords": [ - "http" - ] - }, - { - "name": "pear/text_languagedetect", - "version": "v1.0.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/pear/Text_LanguageDetect.git", - "reference": "bb9ff6f4970f686fac59081e916b456021fe7ba6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/pear/Text_LanguageDetect/zipball/bb9ff6f4970f686fac59081e916b456021fe7ba6", - "reference": "bb9ff6f4970f686fac59081e916b456021fe7ba6", - "shasum": "" - }, - "require-dev": { - "phpunit/phpunit": "*" - }, - "suggest": { - "ext-mbstring": "May require the mbstring PHP extension" - }, - "time": "2017-03-02T16:14:08+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Text": "./" - } - }, - "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "./" - ], - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Nicholas Pisarro", - "email": "taak@php.net", - "role": "Lead" - } - ], - "description": "Identify human languages from text samples", - "homepage": "http://pear.php.net/package/Text_LanguageDetect" - }, - { - "name": "commerceguys/intl", - "version": "v0.7.4", - "version_normalized": "0.7.4.0", - "source": { - "type": "git", - "url": "https://github.com/commerceguys/intl.git", - "reference": "edfcfc26ed8505c4f6fcf862eb36dfda1af74b00" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/commerceguys/intl/zipball/edfcfc26ed8505c4f6fcf862eb36dfda1af74b00", - "reference": "edfcfc26ed8505c4f6fcf862eb36dfda1af74b00", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "require-dev": { - "mikey179/vfsstream": "1.*", - "phpunit/phpunit": "~4.0" - }, - "time": "2016-12-13T12:33:19+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "CommerceGuys\\Intl\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bojan Zivanovic" - } - ], - "description": "Internationalization library powered by CLDR data." - }, - { - "name": "lukasreschke/id3parser", - "version": "v0.0.1", - "version_normalized": "0.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/LukasReschke/ID3Parser.git", - "reference": "cd3ba6e8918cc30883f01a3c24281cfe23b8877a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/LukasReschke/ID3Parser/zipball/cd3ba6e8918cc30883f01a3c24281cfe23b8877a", - "reference": "cd3ba6e8918cc30883f01a3c24281cfe23b8877a", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "time": "2016-04-04T09:34:50+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "ID3Parser\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL" - ], - "homepage": "https://github.com/LukasReschke/ID3Parser/", - "keywords": [ - "codecs", - "php", - "tags" + "templating" ] } ] diff --git a/vendor/league/html-to-markdown/CHANGELOG.md b/vendor/league/html-to-markdown/CHANGELOG.md index 067864412..7a24130df 100644 --- a/vendor/league/html-to-markdown/CHANGELOG.md +++ b/vendor/league/html-to-markdown/CHANGELOG.md @@ -4,6 +4,17 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip ## [Unreleased][unreleased] +## [4.6.0] +### Added + - Added support for ordered lists starting at numbers other than 1 + +### Fixed + - Fixed overly-eager escaping of list-like text (#141) + +## [4.5.0] +### Added + - Added configuration option for list item style (#135, #136) + ## [4.4.1] ### Fixed @@ -188,7 +199,9 @@ not ideally set, so this releases fixes that. Moving forwards this should reduce ### Added - Initial release -[unreleased]: https://github.com/thephpleague/html-to-markdown/compare/4.4.1...master +[unreleased]: https://github.com/thephpleague/html-to-markdown/compare/4.6.0...master +[4.6.0]: https://github.com/thephpleague/html-to-markdown/compare/4.5.0...4.6.0 +[4.5.0]: https://github.com/thephpleague/html-to-markdown/compare/4.4.1...4.5.0 [4.4.1]: https://github.com/thephpleague/html-to-markdown/compare/4.4.0...4.4.1 [4.4.0]: https://github.com/thephpleague/html-to-markdown/compare/4.3.1...4.4.0 [4.3.1]: https://github.com/thephpleague/html-to-markdown/compare/4.3.0...4.3.1 diff --git a/vendor/league/html-to-markdown/README.md b/vendor/league/html-to-markdown/README.md index 8d75649d6..ab80541e6 100644 --- a/vendor/league/html-to-markdown/README.md +++ b/vendor/league/html-to-markdown/README.md @@ -13,7 +13,7 @@ HTML To Markdown for PHP Library which converts HTML to [Markdown](http://daringfireball.net/projects/markdown/) for your sanity and convenience. -**Requires**: PHP 5.3+ +**Requires**: PHP 5.3+ or PHP 7.0+ **Lead Developer**: [@colinodell](http://twitter.com/colinodell) @@ -97,15 +97,15 @@ $markdown = $converter->convert($html); // $markdown now contains "" ### Style options -Bold and italic tags are converted using the asterisk syntax by default. Change this to the underlined syntax using the `bold_style` and `italic_style` options. +By default bold tags are converted using the asterisk syntax, and italic tags are converted using the underlined syntax. Change these by using the `bold_style` and `italic_style` options. ```php $converter = new HtmlConverter(); -$converter->getConfig()->setOption('italic_style', '_'); +$converter->getConfig()->setOption('italic_style', '*'); $converter->getConfig()->setOption('bold_style', '__'); $html = 'Italic and a bold'; -$markdown = $converter->convert($html); // $markdown now contains "_Italic_ and a __bold__" +$markdown = $converter->convert($html); // $markdown now contains "*Italic* and a __bold__" ``` ### Line break options diff --git a/vendor/league/html-to-markdown/composer.json b/vendor/league/html-to-markdown/composer.json index 58764bcb5..8482b767c 100644 --- a/vendor/league/html-to-markdown/composer.json +++ b/vendor/league/html-to-markdown/composer.json @@ -42,7 +42,7 @@ "bin": ["bin/html-to-markdown"], "extra": { "branch-alias": { - "dev-master": "4.5-dev" + "dev-master": "4.7-dev" } } } diff --git a/vendor/league/html-to-markdown/src/Converter/ListItemConverter.php b/vendor/league/html-to-markdown/src/Converter/ListItemConverter.php index dafec077c..f737b4e19 100644 --- a/vendor/league/html-to-markdown/src/Converter/ListItemConverter.php +++ b/vendor/league/html-to-markdown/src/Converter/ListItemConverter.php @@ -2,10 +2,25 @@ namespace League\HTMLToMarkdown\Converter; +use League\HTMLToMarkdown\Configuration; +use League\HTMLToMarkdown\ConfigurationAwareInterface; use League\HTMLToMarkdown\ElementInterface; -class ListItemConverter implements ConverterInterface +class ListItemConverter implements ConverterInterface, ConfigurationAwareInterface { + /** + * @var Configuration + */ + protected $config; + + /** + * @param Configuration $config + */ + public function setConfig(Configuration $config) + { + $this->config = $config; + } + /** * @param ElementInterface $element * @@ -29,10 +44,15 @@ class ListItemConverter implements ConverterInterface } if ($list_type === 'ul') { - return $prefix . '- ' . $value . "\n"; + $list_item_style = $this->config->getOption('list_item_style', '-'); + return $prefix . $list_item_style . ' ' . $value . "\n"; } - $number = $element->getSiblingPosition(); + if ($list_type === 'ol' && $start = $element->getParent()->getAttribute('start')) { + $number = $start + $element->getSiblingPosition() - 1; + } else { + $number = $element->getSiblingPosition(); + } return $prefix . $number . '. ' . $value . "\n"; } diff --git a/vendor/league/html-to-markdown/src/Converter/ParagraphConverter.php b/vendor/league/html-to-markdown/src/Converter/ParagraphConverter.php index cf852bfcf..7207b81a6 100644 --- a/vendor/league/html-to-markdown/src/Converter/ParagraphConverter.php +++ b/vendor/league/html-to-markdown/src/Converter/ParagraphConverter.php @@ -109,7 +109,8 @@ class ParagraphConverter implements ConverterInterface { $regExs = array( // Match numbers ending on ')' or '.' that are at the beginning of the line. - '/^[0-9]+(?=\)|\.)/' + // They will be escaped if immediately followed by a space or newline. + '/^[0-9]+(?=(\)|\.)( |$))/' ); foreach ($regExs as $i) { diff --git a/vendor/league/html-to-markdown/src/HtmlConverter.php b/vendor/league/html-to-markdown/src/HtmlConverter.php index db3c29e1c..8d8936ec5 100644 --- a/vendor/league/html-to-markdown/src/HtmlConverter.php +++ b/vendor/league/html-to-markdown/src/HtmlConverter.php @@ -38,7 +38,8 @@ class HtmlConverter 'bold_style' => '**', // Set to '__' if you prefer the underlined style 'italic_style' => '_', // Set to '*' if you prefer the asterisk style 'remove_nodes' => '', // space-separated list of dom nodes that should be removed. example: 'meta style script' - 'hard_break' => false,// Set to true to turn
into `\n` instead of ` \n` + 'hard_break' => false, // Set to true to turn
into `\n` instead of ` \n` + 'list_item_style' => '-', // Set the default character for each
  • in a
      . Can be '-', '*', or '+' ); $this->environment = Environment::createDefaultEnvironment($defaults); diff --git a/vendor/sabre/vobject/.travis.yml b/vendor/sabre/vobject/.travis.yml index 3c5b32157..531ad5be4 100644 --- a/vendor/sabre/vobject/.travis.yml +++ b/vendor/sabre/vobject/.travis.yml @@ -4,15 +4,15 @@ php: - 5.6 - 7.0 - 7.1 + - 7.2 sudo: false script: - - phpunit --configuration tests/phpunit.xml + - ./bin/phpunit --configuration tests/phpunit.xml - ./bin/sabre-cs-fixer fix . --dry-run --diff before_script: - - phpenv config-rm xdebug.ini; true - composer install cache: diff --git a/vendor/sabre/vobject/CHANGELOG.md b/vendor/sabre/vobject/CHANGELOG.md index c8f4cb4be..56a36f99c 100644 --- a/vendor/sabre/vobject/CHANGELOG.md +++ b/vendor/sabre/vobject/CHANGELOG.md @@ -1,6 +1,15 @@ ChangeLog ========= +4.1.3 (2017-10-18) +------------------ + +* #363: Repair script and de-duplicate properties that are only allowed once, + but appear more than once. (@ddolcimascolo). +* #377: Addes Pacific Time (US & Canada) as exchange timezone +* #384: Added fallback for VCards without `FN` + + 4.1.2 (2016-12-15) ------------------ diff --git a/vendor/sabre/vobject/README.md b/vendor/sabre/vobject/README.md index 0e37f1388..5030cf276 100644 --- a/vendor/sabre/vobject/README.md +++ b/vendor/sabre/vobject/README.md @@ -33,12 +33,12 @@ Build status | branch | status | | ------ | ------ | -| master | [![Build Status](https://travis-ci.org/fruux/sabre-vobject.svg?branch=master)](https://travis-ci.org/fruux/sabre-vobject) | -| 3.5 | [![Build Status](https://travis-ci.org/fruux/sabre-vobject.svg?branch=3.5)](https://travis-ci.org/fruux/sabre-vobject) | -| 3.4 | [![Build Status](https://travis-ci.org/fruux/sabre-vobject.svg?branch=3.4)](https://travis-ci.org/fruux/sabre-vobject) | -| 3.1 | [![Build Status](https://travis-ci.org/fruux/sabre-vobject.svg?branch=3.1)](https://travis-ci.org/fruux/sabre-vobject) | -| 2.1 | [![Build Status](https://travis-ci.org/fruux/sabre-vobject.svg?branch=2.1)](https://travis-ci.org/fruux/sabre-vobject) | -| 2.0 | [![Build Status](https://travis-ci.org/fruux/sabre-vobject.svg?branch=2.0)](https://travis-ci.org/fruux/sabre-vobject) | +| master | [![Build Status](https://travis-ci.org/sabre-io/vobject.svg?branch=master)](https://travis-ci.org/sabre-io/vobject) | +| 3.5 | [![Build Status](https://travis-ci.org/sabre-io/vobject.svg?branch=3.5)](https://travis-ci.org/sabre-io/vobject) | +| 3.4 | [![Build Status](https://travis-ci.org/sabre-io/vobject.svg?branch=3.4)](https://travis-ci.org/sabre-io/vobject) | +| 3.1 | [![Build Status](https://travis-ci.org/sabre-io/vobject.svg?branch=3.1)](https://travis-ci.org/sabre-io/vobject) | +| 2.1 | [![Build Status](https://travis-ci.org/sabre-io/vobject.svg?branch=2.1)](https://travis-ci.org/sabre-io/vobject) | +| 2.0 | [![Build Status](https://travis-ci.org/sabre-io/vobject.svg?branch=2.0)](https://travis-ci.org/sabre-io/vobject) | diff --git a/vendor/sabre/vobject/bin/bench.php b/vendor/sabre/vobject/bin/bench.php old mode 100755 new mode 100644 diff --git a/vendor/sabre/vobject/bin/fetch_windows_zones.php b/vendor/sabre/vobject/bin/fetch_windows_zones.php old mode 100755 new mode 100644 diff --git a/vendor/sabre/vobject/bin/generateicalendardata.php b/vendor/sabre/vobject/bin/generateicalendardata.php old mode 100755 new mode 100644 diff --git a/vendor/sabre/vobject/bin/mergeduplicates.php b/vendor/sabre/vobject/bin/mergeduplicates.php old mode 100755 new mode 100644 diff --git a/vendor/sabre/vobject/composer.json b/vendor/sabre/vobject/composer.json index cfa4a712d..1f22f6de1 100644 --- a/vendor/sabre/vobject/composer.json +++ b/vendor/sabre/vobject/composer.json @@ -37,7 +37,7 @@ "sabre/xml" : ">=1.5 <3.0" }, "require-dev" : { - "phpunit/phpunit" : "*", + "phpunit/phpunit" : "> 4.8, <6.0.0", "sabre/cs" : "^1.0.0" }, diff --git a/vendor/sabre/vobject/lib/Component.php b/vendor/sabre/vobject/lib/Component.php index 9a10ed3f8..ac87a10ec 100644 --- a/vendor/sabre/vobject/lib/Component.php +++ b/vendor/sabre/vobject/lib/Component.php @@ -662,8 +662,23 @@ class Component extends Node { break; case '?' : if (isset($propertyCounters[$propName]) && $propertyCounters[$propName] > 1) { + $level = 3; + + // We try to repair the same property appearing multiple times with the exact same value + // by removing the duplicates and keeping only one property + if ($options & self::REPAIR) { + $properties = array_unique($this->select($propName), SORT_REGULAR); + + if (count($properties) === 1) { + $this->remove($propName); + $this->add($properties[0]); + + $level = 1; + } + } + $messages[] = [ - 'level' => 3, + 'level' => $level, 'message' => $propName . ' MUST NOT appear more than once in a ' . $this->name . ' component', 'node' => $this, ]; diff --git a/vendor/sabre/vobject/lib/Component/VCard.php b/vendor/sabre/vobject/lib/Component/VCard.php index 4f620de10..bca623d5e 100644 --- a/vendor/sabre/vobject/lib/Component/VCard.php +++ b/vendor/sabre/vobject/lib/Component/VCard.php @@ -295,6 +295,11 @@ class VCard extends VObject\Document { } elseif (isset($this->ORG)) { $this->FN = (string)$this->ORG; $repaired = true; + + // Otherwise, the EMAIL property may work + } elseif (isset($this->EMAIL)) { + $this->FN = (string)$this->EMAIL; + $repaired = true; } } diff --git a/vendor/sabre/vobject/lib/Version.php b/vendor/sabre/vobject/lib/Version.php index 346e2044d..24c51a604 100644 --- a/vendor/sabre/vobject/lib/Version.php +++ b/vendor/sabre/vobject/lib/Version.php @@ -14,6 +14,6 @@ class Version { /** * Full version number. */ - const VERSION = '4.1.2'; + const VERSION = '4.1.3'; } diff --git a/vendor/sabre/vobject/lib/timezonedata/exchangezones.php b/vendor/sabre/vobject/lib/timezonedata/exchangezones.php index 38138354a..edba5b473 100644 --- a/vendor/sabre/vobject/lib/timezonedata/exchangezones.php +++ b/vendor/sabre/vobject/lib/timezonedata/exchangezones.php @@ -85,6 +85,7 @@ return [ 'Saskatchewan' => 'America/Edmonton', 'Arizona' => 'America/Phoenix', 'Mountain Time (US & Canada)' => 'America/Denver', // Best guess + 'Pacific Time (US & Canada)' => 'America/Los_Angeles', // Best guess 'Pacific Time (US & Canada); Tijuana' => 'America/Los_Angeles', // Best guess 'Alaska' => 'America/Anchorage', 'Hawaii' => 'Pacific/Honolulu', diff --git a/vendor/simplepie/simplepie/.travis.yml b/vendor/simplepie/simplepie/.travis.yml new file mode 100644 index 000000000..83d90ad19 --- /dev/null +++ b/vendor/simplepie/simplepie/.travis.yml @@ -0,0 +1,21 @@ +sudo: false +language: php +matrix: + fast_finish: true + include: + - php: 5.4 + - php: 5.5 + - php: 5.6 + - php: 7.0 + - php: 7.1 + - php: hhvm + sudo: true + dist: trusty + group: edge # until the next Travis CI update + allow_failures: + - php: hhvm + - php: 7.0 + - php: 7.1 +branches: + except: + - one-dot-two diff --git a/vendor/simplepie/simplepie/library/SimplePie.php b/vendor/simplepie/simplepie/library/SimplePie.php old mode 100755 new mode 100644 index 428bfc068..34b6ca0c9 --- a/vendor/simplepie/simplepie/library/SimplePie.php +++ b/vendor/simplepie/simplepie/library/SimplePie.php @@ -33,7 +33,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * @package SimplePie - * @version 1.5 + * @version 1.5.1 * @copyright 2004-2017 Ryan Parman, Geoffrey Sneddon, Ryan McCue * @author Ryan Parman * @author Geoffrey Sneddon @@ -50,7 +50,7 @@ define('SIMPLEPIE_NAME', 'SimplePie'); /** * SimplePie Version */ -define('SIMPLEPIE_VERSION', '1.5'); +define('SIMPLEPIE_VERSION', '1.5.1'); /** * SimplePie Build @@ -810,7 +810,7 @@ class SimplePie } /** - * Set the the default timeout for fetching remote feeds + * Set the default timeout for fetching remote feeds * * This allows you to change the maximum time the feed's server to respond * and send the feed back. @@ -1320,6 +1320,11 @@ class SimplePie } } + // The default sanitize class gets set in the constructor, check if it has + // changed. + if ($this->registry->get_class('Sanitize') !== 'SimplePie_Sanitize') { + $this->sanitize = $this->registry->create('Sanitize'); + } if (method_exists($this->sanitize, 'set_registry')) { $this->sanitize->set_registry($this->registry); @@ -1644,33 +1649,18 @@ class SimplePie try { $microformats = false; - if (function_exists('Mf2\parse')) { + if (class_exists('DOMXpath') && function_exists('Mf2\parse')) { + $doc = new DOMDocument(); + @$doc->loadHTML($file->body); + $xpath = new DOMXpath($doc); // Check for both h-feed and h-entry, as both a feed with no entries // and a list of entries without an h-feed wrapper are both valid. - $position = 0; - while ($position = strpos($file->body, 'h-feed', $position)) - { - $start = $position < 200 ? 0 : $position - 200; - $check = substr($file->body, $start, 400); - if ($microformats = preg_match('/class="[^"]*h-feed/', $check)) - { - break; - } - $position += 7; - } - $position = 0; - while ($position = strpos($file->body, 'h-entry', $position)) - { - $start = $position < 200 ? 0 : $position - 200; - $check = substr($file->body, $start, 400); - if ($microformats = preg_match('/class="[^"]*h-entry/', $check)) - { - break; - } - $position += 7; - } + $query = '//*[contains(concat(" ", @class, " "), " h-feed ") or '. + 'contains(concat(" ", @class, " "), " h-entry ")]'; + $result = $xpath->query($query); + $microformats = $result->length !== 0; } - // Now also do feed discovery, but if an h-entry was found don't + // Now also do feed discovery, but if microformats were found don't // overwrite the current value of file. $discovered = $locate->find($this->autodiscovery, $this->all_discovered_feeds); @@ -2606,16 +2596,16 @@ class SimplePie } } - if (isset($this->data['links'][$rel])) - { - return $this->data['links'][$rel]; - } - else if (isset($this->data['headers']['link']) && - preg_match('/<([^>]+)>; rel='.preg_quote($rel).'/', - $this->data['headers']['link'], $match)) + if (isset($this->data['headers']['link']) && + preg_match('/<([^>]+)>; rel='.preg_quote($rel).'/', + $this->data['headers']['link'], $match)) { return array($match[1]); } + else if (isset($this->data['links'][$rel])) + { + return $this->data['links'][$rel]; + } else { return null; @@ -3155,7 +3145,7 @@ class SimplePie if (($url = $this->get_link()) !== null) { - return 'http://g.etfv.co/' . urlencode($url); + return 'https://www.google.com/s2/favicons?domain=' . urlencode($url); } return false; diff --git a/vendor/simplepie/simplepie/library/SimplePie/Cache/Memcached.php b/vendor/simplepie/simplepie/library/SimplePie/Cache/Memcached.php old mode 100755 new mode 100644 diff --git a/vendor/simplepie/simplepie/library/SimplePie/File.php b/vendor/simplepie/simplepie/library/SimplePie/File.php index e670e05a0..2bb0a3b44 100644 --- a/vendor/simplepie/simplepie/library/SimplePie/File.php +++ b/vendor/simplepie/simplepie/library/SimplePie/File.php @@ -136,8 +136,7 @@ class SimplePie_File $this->url = $info['url']; } curl_close($fp); - $this->headers = explode("\r\n\r\n", $this->headers, $info['redirect_count'] + 1); - $this->headers = array_pop($this->headers); + $this->headers = SimplePie_HTTP_Parser::prepareHeaders($this->headers, $info['redirect_count'] + 1); $parser = new SimplePie_HTTP_Parser($this->headers); if ($parser->parse()) { diff --git a/vendor/simplepie/simplepie/library/SimplePie/HTTP/Parser.php b/vendor/simplepie/simplepie/library/SimplePie/HTTP/Parser.php index 63ae1e03d..e982c206f 100644 --- a/vendor/simplepie/simplepie/library/SimplePie/HTTP/Parser.php +++ b/vendor/simplepie/simplepie/library/SimplePie/HTTP/Parser.php @@ -496,4 +496,25 @@ class SimplePie_HTTP_Parser } } } + + /** + * Prepare headers (take care of proxies headers) + * + * @param string $headers Raw headers + * @param integer $count Redirection count. Default to 1. + * + * @return string + */ + static public function prepareHeaders($headers, $count = 1) + { + $data = explode("\r\n\r\n", $headers, $count); + $data = array_pop($data); + if (false !== stripos($data, "HTTP/1.0 200 Connection established\r\n\r\n")) { + $data = str_ireplace("HTTP/1.0 200 Connection established\r\n\r\n", '', $data); + } + if (false !== stripos($data, "HTTP/1.1 200 Connection established\r\n\r\n")) { + $data = str_ireplace("HTTP/1.1 200 Connection established\r\n\r\n", '', $data); + } + return $data; + } } diff --git a/vendor/simplepie/simplepie/library/SimplePie/Item.php b/vendor/simplepie/simplepie/library/SimplePie/Item.php index 00f4179bf..2083e7a92 100644 --- a/vendor/simplepie/simplepie/library/SimplePie/Item.php +++ b/vendor/simplepie/simplepie/library/SimplePie/Item.php @@ -477,15 +477,15 @@ class SimplePie_Item $label = null; if (isset($category['attribs']['']['term'])) { - $term = $this->sanitize($category['attribs']['']['term'], SIMPLEPIE_CONSTRUCT_HTML); + $term = $this->sanitize($category['attribs']['']['term'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['scheme'])) { - $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_HTML); + $scheme = $this->sanitize($category['attribs']['']['scheme'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($category['attribs']['']['label'])) { - $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_HTML); + $label = $this->sanitize($category['attribs']['']['label'], SIMPLEPIE_CONSTRUCT_TEXT); } $categories[] = $this->registry->create('Category', array($term, $scheme, $label, $type)); } @@ -493,10 +493,10 @@ class SimplePie_Item { // This is really the label, but keep this as the term also for BC. // Label will also work on retrieving because that falls back to term. - $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_HTML); + $term = $this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT); if (isset($category['attribs']['']['domain'])) { - $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_HTML); + $scheme = $this->sanitize($category['attribs']['']['domain'], SIMPLEPIE_CONSTRUCT_TEXT); } else { @@ -508,11 +508,11 @@ class SimplePie_Item $type = 'subject'; foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, $type) as $category) { - $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_HTML), null, null, $type)); + $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null, $type)); } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, $type) as $category) { - $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_HTML), null, null, $type)); + $categories[] = $this->registry->create('Category', array($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null, $type)); } if (!empty($categories)) @@ -649,7 +649,7 @@ class SimplePie_Item $email = null; if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'])) { - $name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_HTML); + $name = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['uri'][0]['data'])) { @@ -657,7 +657,7 @@ class SimplePie_Item } if (isset($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'])) { - $email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_HTML); + $email = $this->sanitize($author['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $uri !== null) { @@ -671,7 +671,7 @@ class SimplePie_Item $email = null; if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'])) { - $name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_HTML); + $name = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['name'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['url'][0]['data'])) { @@ -679,7 +679,7 @@ class SimplePie_Item } if (isset($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'])) { - $email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_HTML); + $email = $this->sanitize($author[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_03]['email'][0]['data'], SIMPLEPIE_CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $url !== null) { @@ -688,19 +688,19 @@ class SimplePie_Item } if ($author = $this->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'author')) { - $authors[] = $this->registry->create('Author', array(null, null, $this->sanitize($author[0]['data'], SIMPLEPIE_CONSTRUCT_HTML))); + $authors[] = $this->registry->create('Author', array(null, null, $this->sanitize($author[0]['data'], SIMPLEPIE_CONSTRUCT_TEXT))); } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_11, 'creator') as $author) { - $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_HTML), null, null)); + $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_DC_10, 'creator') as $author) { - $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_HTML), null, null)); + $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } foreach ((array) $this->get_item_tags(SIMPLEPIE_NAMESPACE_ITUNES, 'author') as $author) { - $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_HTML), null, null)); + $authors[] = $this->registry->create('Author', array($this->sanitize($author['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null)); } if (!empty($authors)) diff --git a/vendor/simplepie/simplepie/library/SimplePie/Parser.php b/vendor/simplepie/simplepie/library/SimplePie/Parser.php index 17139abe9..df1234023 100644 --- a/vendor/simplepie/simplepie/library/SimplePie/Parser.php +++ b/vendor/simplepie/simplepie/library/SimplePie/Parser.php @@ -76,26 +76,17 @@ class SimplePie_Parser public function parse(&$data, $encoding, $url = '') { - if (function_exists('Mf2\parse')) { + if (class_exists('DOMXpath') && function_exists('Mf2\parse')) { + $doc = new DOMDocument(); + @$doc->loadHTML($data); + $xpath = new DOMXpath($doc); // Check for both h-feed and h-entry, as both a feed with no entries // and a list of entries without an h-feed wrapper are both valid. - $position = 0; - while ($position = strpos($data, 'h-feed', $position)) { - $start = $position < 200 ? 0 : $position - 200; - $check = substr($data, $start, 400); - if (preg_match('/class="[^"]*h-feed/', $check)) { - return $this->parse_microformats($data, $url); - } - $position += 7; - } - $position = 0; - while ($position = strpos($data, 'h-entry', $position)) { - $start = $position < 200 ? 0 : $position - 200; - $check = substr($data, $start, 400); - if (preg_match('/class="[^"]*h-entry/', $check)) { - return $this->parse_microformats($data, $url); - } - $position += 7; + $query = '//*[contains(concat(" ", @class, " "), " h-feed ") or '. + 'contains(concat(" ", @class, " "), " h-entry ")]'; + $result = $xpath->query($query); + if ($result->length !== 0) { + return $this->parse_microformats($data, $url); } } @@ -465,7 +456,7 @@ class SimplePie_Parser $h_feed = $mf_item; break; } - // Also look for an h-feed in the children of each top level item. + // Also look for h-feed or h-entry in the children of each top level item. if (!isset($mf_item['children'][0]['type'])) continue; if (in_array('h-feed', $mf_item['children'][0]['type'])) { $h_feed = $mf_item['children'][0]; @@ -474,6 +465,13 @@ class SimplePie_Parser if (in_array('h-card', $mf_item['type'])) $feed_author = $mf_item; break; } + else if (in_array('h-entry', $mf_item['children'][0]['type'])) { + $entries = $mf_item['children']; + // In this case the parent of the h-entry list may be an h-card, so use + // it as the feed_author. + if (in_array('h-card', $mf_item['type'])) $feed_author = $mf_item; + break; + } } if (isset($h_feed['children'])) { $entries = $h_feed['children']; @@ -485,7 +483,7 @@ class SimplePie_Parser $feed_author = $mf['items'][0]['properties']['author'][0]; } } - else { + else if (count($entries) === 0) { $entries = $mf['items']; } for ($i = 0; $i < count($entries); $i++) { @@ -554,18 +552,21 @@ class SimplePie_Parser $photo_list = array(); for ($j = 0; $j < count($entry['properties']['photo']); $j++) { $photo = $entry['properties']['photo'][$j]; - if (strpos($content, $photo) === false) { + if (!empty($photo) && strpos($content, $photo) === false) { $photo_list[] = $photo; } } // When there's more than one photo show the first and use a lightbox. + // Need a permanent, unique name for the image set, but don't have + // anything unique except for the content itself, so use that. $count = count($photo_list); if ($count > 1) { + $image_set_id = preg_replace('/[[:^alnum:]]/', '', $photo_list[0]); $description = '

      '; for ($j = 0; $j < $count; $j++) { $hidden = $j === 0 ? '' : 'class="hidden" '; $description .= ''. + 'data-lightbox="image-set-'.$image_set_id.'">'. ''; } $description .= '
      '.$count.' photos

      '; @@ -583,10 +584,18 @@ class SimplePie_Parser $item['title'] = array(array('data' => $title)); } $description .= $entry['properties']['content'][0]['html']; - if (isset($entry['properties']['in-reply-to'][0]['value'])) { - $in_reply_to = $entry['properties']['in-reply-to'][0]['value']; - $description .= '

      '. - ''.$in_reply_to.'

      '; + if (isset($entry['properties']['in-reply-to'][0])) { + $in_reply_to = ''; + if (is_string($entry['properties']['in-reply-to'][0])) { + $in_reply_to = $entry['properties']['in-reply-to'][0]; + } + else if (isset($entry['properties']['in-reply-to'][0]['value'])) { + $in_reply_to = $entry['properties']['in-reply-to'][0]['value']; + } + if ($in_reply_to !== '') { + $description .= '

      '. + ''.$in_reply_to.'

      '; + } } $item['description'] = array(array('data' => $description)); } @@ -627,7 +636,7 @@ class SimplePie_Parser $image = array(array('child' => array('' => array('url' => array(array('data' => $feed_author['properties']['photo'][0])))))); } - // Use the a name given for the h-feed, or get the title from the html. + // Use the name given for the h-feed, or get the title from the html. if ($feed_title !== '') { $feed_title = array(array('data' => htmlspecialchars($feed_title))); } diff --git a/vendor/simplepie/simplepie/library/SimplePie/Registry.php b/vendor/simplepie/simplepie/library/SimplePie/Registry.php old mode 100755 new mode 100644 diff --git a/vendor/smarty/smarty/COMPOSER_RELEASE_NOTES.txt b/vendor/smarty/smarty/COMPOSER_RELEASE_NOTES.txt new file mode 100644 index 000000000..c943d9f2e --- /dev/null +++ b/vendor/smarty/smarty/COMPOSER_RELEASE_NOTES.txt @@ -0,0 +1,29 @@ + + +Starting with Smarty 3.1.21 Composer has been configured to load the packages from github. + +******************************************************************************* +* * +* NOTE: Because of this change you must clear your local composer cache with * +* the "composer clearcache" command * +* * +******************************************************************************* + +To get the latest stable version use + "require": { + "smarty/smarty": "~3.1" + } +in your composer.json file. + +To get the trunk version use + "require": { + "smarty/smarty": "~3.1@dev" + } + +The "smarty/smarty" package will start at libs/.... subfolder. + +To retrieve the development and documentation folders add + "require-dev": { + "smarty/smarty-dev": "~3.1@dev" + } + diff --git a/vendor/smarty/smarty/INHERITANCE_RELEASE_NOTES.txt b/vendor/smarty/smarty/INHERITANCE_RELEASE_NOTES.txt new file mode 100644 index 000000000..c415c4ccd --- /dev/null +++ b/vendor/smarty/smarty/INHERITANCE_RELEASE_NOTES.txt @@ -0,0 +1,87 @@ +3.1.31-dev +New tags for inheritance parent and child +{block_parent} == {$smarty.block.parent} +{block_child} == {$smarty.block.child} + +Since 3.1.28 you can mix inheritance by extends resource with the {extends} tag. +A template called by extends resource can extend a subtemplate or chain buy the {extends} tag. +Since 3.1.31 this feature can be turned off by setting the new Smarty property Smarty::$extends_recursion to false. + + +3.1.28 +Starting with version 3.1.28 template inheritance is no longer a compile time process. +All {block} tag parent/child relations are resolved at run time. +This does resolve all known existing restrictions (see below). + +The $smarty::$inheritance_merge_compiled_includes property has been removed. +Any access to it is ignored. + +New features: + +Any code outside root {block} tags in child templates is now executed but any output will be ignored. + + {extends 'foo.tpl'} + {$bar = 'on'} // assigns variable $bar seen in parent templates + {block 'buh'}{/block} + + {extends 'foo.tpl'} + {$bar} // the output of variable bar is ignored + {block 'buh'}{/block} + +{block} tags can be dynamically en/disabled by conditions. + + {block 'root'} + {if $foo} + {block 'v1'} + .... + {/block} + {else} + {block 'v1'} + .... + {/block} + {/if} + {/block} + +{block} tags can have variable names. + + {block $foo} + .... + {/block} + +Starting with 3.1.28 you can mix inheritance by extends resource with the {extends} tag. +A template called by extends resource can extend a subtemplate or chain buy the {extends} tag. + +NOTE There is a BC break. If you used the extends resource {extends} tags have been ignored. + +THE FOLLOWING RESTRICTIONS ARE NO LONGER EXISTING: +In Smarty 3.1 template inheritance is a compile time process. All the extending of {block} tags +is done at compile time and the parent and child templates are compiled in a single compiled template. +{include} subtemplate could also {block} tags. Such subtemplate could not compiled by it's own because +it could be used in other context where the {block} extended with a different result. For that reasion +the compiled code of {include} subtemplates gets also merged in compiled inheritance template. + +Merging the code into a single compile template has some drawbacks. +1. You could not use variable file names in {include} Smarty would use the {include} of compilation time. +2. You could not use individual compile_id in {include} +3. Seperate caching of subtemplate was not possible +4. Any change of the template directory structure between calls was not necessarily seen. + +Starting with 3.1.15 some of the above conditions got checked and resulted in an exception. It turned out +that a couple of users did use some of above and now got exceptions. + +To resolve this starting with 3.1.16 there is a new configuration parameter $inheritance_merge_compiled_includes. +For most backward compatibility its default setting is true. +With this setting all {include} subtemplate will be merge into the compiled inheritance template, but the above cases +could be rejected by exception. + + +If $smarty->inheritance_merge_compiled_includes = false; {include} subtemplate will not be merged. +You must now manually merge all {include} subtemplate which do contain {block} tags. This is done by setting the "inline" option. +{include file='foo.bar' inline} + +1. In case of a variable file name like {include file=$foo inline} you must use the variable in a compile_id $smarty->compile_id = $foo; +2. If you use individual compile_id in {include file='foo.tpl' compile_id=$bar inline} it must be used in the + global compile_id as well $smarty->compile_id = $bar; +3. If call templates with different template_dir configurations and a parent could same named child template from different folders + you must make the folder name part of the compile_id. + diff --git a/library/Smarty/COPYING.lib b/vendor/smarty/smarty/LICENSE similarity index 93% rename from library/Smarty/COPYING.lib rename to vendor/smarty/smarty/LICENSE index 02bbb60bc..fb8ca6c6f 100644 --- a/library/Smarty/COPYING.lib +++ b/vendor/smarty/smarty/LICENSE @@ -1,3 +1,17 @@ +Smarty: the PHP compiling template engine + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU Lesser General Public License below for more details. + + GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -162,4 +176,4 @@ General Public License ever published by the Free Software Foundation. whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the -Library. \ No newline at end of file +Library. diff --git a/library/Smarty/NEW_FEATURES.txt b/vendor/smarty/smarty/NEW_FEATURES.txt similarity index 50% rename from library/Smarty/NEW_FEATURES.txt rename to vendor/smarty/smarty/NEW_FEATURES.txt index 1a51c71d9..adbc1099b 100644 --- a/library/Smarty/NEW_FEATURES.txt +++ b/vendor/smarty/smarty/NEW_FEATURES.txt @@ -2,6 +2,114 @@ This file contains a brief description of new features which have been added to Smarty 3.1 +Smarty 3.1.31 + New tags for inheritance parent and child + ========================================= + {block_parent} == {$smarty.block.parent} + {block_child} == {$smarty.block.child} + +Smarty 3.1.30 + + Loop optimization {foreach} and {section} + ========================================= + Smarty does optimize the {foreach} and {section} loops by removing code for not needed loop + properties. + The compiler collects needed properties by scanning the current template for $item@property, + $smarty.foreach.name.property and $smarty.section.name.property. + The compiler does not know if additional properties will be needed outside the current template scope. + Additional properties can be generated by adding them with the property attribute. + + Example: + index.tpl + {foreach $from as $item properties=[iteration, index]} + {include 'sub.tpl'} + {$item.total} + {/foreach} + + sub.tpl + {$item.index} {$item.iteration} {$item.total} + + In above example code for the 'total' property is automatically generated as $item.total is used in + index.tpl. Code for 'iteration' and 'index' must be added with properties=[iteration, index]. + + New tag {make_nocache} + ====================== + Syntax: {make_nocache $foo} + + This tag makes a variable which does exists normally only while rendering the compiled template + available in the cached template for use in not cached expressions. + + Expample: + {foreach from=$list item=item} +

    • {$item.name} {make_nocache $item}{if $current==$item.id} ACTIVE{/if}
    • + {/foreach} + + The {foreach} loop is rendered while processing the compiled template, but $current is a nocache + variable. Normally the {if $current==$item.id} would fail as the $item variable is unkown in the + cached template. {make_nocache $item} does make the current $item value known in thee cached template. + + {make_nocache} is ignored when caching is disabled or the variable does exists as nocache variable. + + NOTE: if the variable value does contain objects these must have the __set_state method implemented. + + + Scope Attributes + ================ + The scope handling has been updated to cover all cases of variable assignments in templates. + + The tags {assign}, {append} direct assignments like {$foo = ...}, {$foo[...]= ...} support + the following optional scope attributes: + scope='parent' - the variable will be assigned in the current template and if the template + was included by {include} the calling template + scope='tpl_root' - the variable will be assigned in the outermost root template called by $smarty->display() + or $smarty->fetch() and is bubbled up all {include} sub-templates to the current template. + scope='smarty' - the variable will be assigned in the Smarty object and is bubbled up all {include} sub-templates + to the current template. + scope='global' - the variable will be assigned as Smarty object global variable and is bubbled up all {include} + sub-templates to the current template. + scope='root' - the variable will be assigned if a data object was used for variable definitions in the data + object or in the Smarty object otherwise and is bubbled up all {include} sub-templates to the + current template. + scope='local' - this scope has only a meaning if the tag is called within a template {function}. + The variable will be assigned in the local scope of the template function and the + template which did call the template function. + + + The {config_load} tag supports all of the above except the global scope. + + The scope attribute can be used also with the {include} tag. + Supported scope are parent, tpl_root, smarty, global and root. + A scope used together with the {include} tag will cause that with some exceptions any variable + assignment within that sub-template will update/assign the variable in other scopes according + to the above rules. It does include also variables assigned by plugins, tags supporting the assign=foo + attribute and direct assignments in {if} and {while} like {if $foo=$bar}. + Excluded are the key and value variables of {foreach}, {for} loop variables , variables passed by attributes + in {include} and direct increments/decrements like {$foo++}, {$foo--} + + Note: The scopes should be used only to the extend really need. If a variable value assigned in an included + sub-template should be returned to the calling sub-template just use {$foo='bar' scope='parent'}. + Use scopes only with variables for which it's realy needed. Avoid general scope settings with the + {include} tag as it can have a performance impact. + + The {assign}, {append}, {config_load} and {$foo...=...} tags have a new option flag 'noscope'.Thi + Example: {$foo='bar' noscope} This will assign $foo only in the current template and any scope settings + at {include} is ignored. + + + Caching + ======= + Caching does now observe the template_dir setting and will create separate cache files if required + + Compiled Templates + ================== + The template_dir setting is now encoded in the uid of the file name. + The content of the compiled template may depend on the template_dir search order + {include .... inline} is used or $smarty->merge_compiled_includes is enabled + + APC + === + If APC is enabled force an apc_compile_file() when compiled or cached template was updated + Smarty 3.1.28 OPCACHE @@ -32,7 +140,7 @@ Smarty 3.1.28 The template_dir array is searched in the order of the indices. (Could be used to change the default search order) Example: $smarty->display('[1],[0]foo.bar'); - + Filter support ============== Optional filter names @@ -47,7 +155,7 @@ Smarty 3.1.28 If you register multiple closures register each with a unique filter name. - $smarty->registerFilter('pre', function($source) {return $source;}, 'closure_1'); - $smarty->registerFilter('pre', function($source) {return $source;}, 'closure_2'); - + Smarty 3.1.22 @@ -120,7 +228,7 @@ Smarty 3.1.22 Debugging ========= The layout of the debug window has been changed for better readability - + New class constants Smarty::DEBUG_OFF Smarty::DEBUG_ON @@ -129,5 +237,3 @@ Smarty 3.1.22 Smarty::DEBUG_INDIVIDUAL will create for each display() and fetch() call an individual debug window. - . - diff --git a/library/Smarty/README b/vendor/smarty/smarty/README similarity index 100% rename from library/Smarty/README rename to vendor/smarty/smarty/README diff --git a/vendor/smarty/smarty/README.md b/vendor/smarty/smarty/README.md new file mode 100644 index 000000000..5783eb3e0 --- /dev/null +++ b/vendor/smarty/smarty/README.md @@ -0,0 +1,65 @@ +#Smarty 3 template engine +##Distribution repository + +> Smarty 3.1.28 introduces run time template inheritance + +> Read the NEW_FEATURES and INHERITANCE_RELEASE_NOTES file for recent extensions to Smarty 3.1 functionality + +Smarty versions 3.1.11 or later are now on github and can be installed with Composer. + + +The "smarty/smarty" package will start at libs/.... subfolder. + +To get the latest stable version of Smarty 3.1 use + +```json +"require": { + "smarty/smarty": "~3.1" +} +``` + +in your composer.json file. + +To get the trunk version use + +```json +"require": { + "smarty/smarty": "~3.1@dev" +} +``` + +For a specific version use something like + +```json +"require": { + "smarty/smarty": "3.1.19" +} +``` + +PHPUnit test can be installed by corresponding composer entries like + +```json +"require": { + "smarty/smarty-phpunit": "3.1.19" +} +``` + +Similar applies for the lexer/parser generator + +```json +"require": { + "smarty/smarty-lexer": "3.1.19" +} +``` + +Or you could use + +```json +"require": { + "smarty/smarty-dev": "3.1.19" +} +``` + +Which is a wrapper to install all 3 packages + +Composer can also be used for Smarty2 versions 2.6.24 to 2.6.28 diff --git a/vendor/smarty/smarty/SMARTY_2_BC_NOTES.txt b/vendor/smarty/smarty/SMARTY_2_BC_NOTES.txt new file mode 100644 index 000000000..79a2cb1b6 --- /dev/null +++ b/vendor/smarty/smarty/SMARTY_2_BC_NOTES.txt @@ -0,0 +1,109 @@ += Known incompatibilities with Smarty 2 = + +== Syntax == + +Smarty 3 API has a new syntax. Much of the Smarty 2 syntax is supported +by a wrapper but deprecated. See the README that comes with Smarty 3 for more +information. + +The {$array|@mod} syntax has always been a bit confusing, where an "@" is required +to apply a modifier to an array instead of the individual elements. Normally you +always want the modifier to apply to the variable regardless of its type. In Smarty 3, +{$array|mod} and {$array|@mod} behave identical. It is safe to drop the "@" and the +modifier will still apply to the array. If you really want the modifier to apply to +each array element, you must loop the array in-template, or use a custom modifier that +supports array iteration. Most smarty functions already escape values where necessary +such as {html_options} + +== PHP Version == +Smarty 3 is PHP 5 only. It will not work with PHP 4. + +== {php} Tag == +The {php} tag is disabled by default. The use of {php} tags is +deprecated. It can be enabled with $smarty->allow_php_tag=true. + +But if you scatter PHP code which belongs together into several +{php} tags it may not work any longer. + +== Delimiters and whitespace == +Delimiters surrounded by whitespace are no longer treated as Smarty tags. +Therefore, { foo } will not compile as a tag, you must use {foo}. This change +Makes Javascript/CSS easier to work with, eliminating the need for {literal}. +This can be disabled by setting $smarty->auto_literal = false; + +== Unquoted Strings == +Smarty 2 was a bit more forgiving (and ambiguous) when it comes to unquoted strings +in parameters. Smarty3 is more restrictive. You can still pass strings without quotes +so long as they contain no special characters. (anything outside of A-Za-z0-9_) + +For example filename strings must be quoted + +{include file='path/foo.tpl'} + + +== Extending the Smarty class == +Smarty 3 makes use of the __construct method for initialization. If you are extending +the Smarty class, its constructor is not called implicitly if the your child class defines +its own constructor. In order to run Smarty's constructor, a call to parent::__construct() +within your child constructor is required. + + +class MySmarty extends Smarty { + function __construct() { + parent::__construct(); + + // your initialization code goes here + + } +} + + +== Autoloader == +Smarty 3 does register its own autoloader with spl_autoload_register. If your code has +an existing __autoload function then this function must be explicitly registered on +the __autoload stack. See http://us3.php.net/manual/en/function.spl-autoload-register.php +for further details. + +== Plugin Filenames == +Smarty 3 optionally supports the PHP spl_autoloader. The autoloader requires filenames +to be lower case. Because of this, Smarty plugin file names must also be lowercase. +In Smarty 2, mixed case file names did work. + +== Scope of Special Smarty Variables == +In Smarty 2 the special Smarty variables $smarty.section... and $smarty.foreach... +had global scope. If you had loops with the same name in subtemplates you could accidentally +overwrite values of parent template. + +In Smarty 3 these special Smarty variable have only local scope in the template which +is defining the loop. If you need their value in a subtemplate you have to pass them +as parameter. + +{include file='path/foo.tpl' index=$smarty.section.foo.index} + + +== SMARTY_RESOURCE_CHAR_SET == +Smarty 3 sets the constant SMARTY_RESOURCE_CHAR_SET to utf-8 as default template charset. +This is now used also on modifiers like escape as default charset. If your templates use +other charsets make sure that you define the constant accordingly. Otherwise you may not +get any output. + +== newline at {if} tags == +A \n was added to the compiled code of the {if},{else},{elseif},{/if} tags to get output of newlines as expected by the template source. +If one of the {if} tags is at the line end you will now get a newline in the HTML output. + +== trigger_error() == +The API function trigger_error() has been removed because it did just map to PHP trigger_error. +However it's still included in the Smarty2 API wrapper. + +== Smarty constants == +The constants +SMARTY_PHP_PASSTHRU +SMARTY_PHP_QUOTE +SMARTY_PHP_REMOVE +SMARTY_PHP_ALLOW +have been replaced with class constants +Smarty::PHP_PASSTHRU +Smarty::PHP_QUOTE +Smarty::PHP_REMOVE +Smarty::PHP_ALLOW + diff --git a/vendor/smarty/smarty/SMARTY_3.0_BC_NOTES.txt b/vendor/smarty/smarty/SMARTY_3.0_BC_NOTES.txt new file mode 100644 index 000000000..fd8b540c2 --- /dev/null +++ b/vendor/smarty/smarty/SMARTY_3.0_BC_NOTES.txt @@ -0,0 +1,24 @@ +== Smarty2 backward compatibility == +All Smarty2 specific API functions and deprecated functionallity has been moved +to the SmartyBC class. + +== {php} Tag == +The {php} tag is no longer available in the standard Smarty calls. +The use of {php} tags is deprecated and only available in the SmartyBC class. + +== {include_php} Tag == +The {include_php} tag is no longer available in the standard Smarty calls. +The use of {include_php} tags is deprecated and only available in the SmartyBC class. + +== php template resource == +The support of the php template resource is removed. + +== $cache_dir, $compile_dir, $config_dir, $template_dir access == +The mentioned properties can't be accessed directly any longer. You must use +corresponding getter/setters like addConfigDir(), setConfigDir(), getConfigDir() + +== obsolete Smarty class properties == +The following no longer used properties are removed: +$allow_php_tag +$allow_php_template +$deprecation_notices \ No newline at end of file diff --git a/vendor/smarty/smarty/SMARTY_3.1_NOTES.txt b/vendor/smarty/smarty/SMARTY_3.1_NOTES.txt new file mode 100644 index 000000000..57709f0d7 --- /dev/null +++ b/vendor/smarty/smarty/SMARTY_3.1_NOTES.txt @@ -0,0 +1,306 @@ +Smarty 3.1 Notes +================ + +Smarty 3.1 is a departure from 2.0 compatibility. Most notably, all +backward compatibility has been moved to a separate class file named +SmartyBC.class.php. If you require compatibility with 2.0, you will +need to use this class. + +Some differences from 3.0 are also present. 3.1 begins the journey of +requiring setters/getters for property access. So far this is only +implemented on the five directory properties: template_dir, +plugins_dir, configs_dir, compile_dir and cache_dir. These properties +are now protected, it is required to use the setters/getters instead. +That said, direct property access will still work, however slightly +slower since they will now fall through __set() and __get() and in +turn passed through the setter/getter methods. 3.2 will exhibit a full +list of setter/getter methods for all (currently) public properties, +so code-completion in your IDE will work as expected. + +There is absolutely no PHP allowed in templates any more. All +deprecated features of Smarty 2.0 are gone. Again, use the SmartyBC +class if you need any backward compatibility. + +Internal Changes + + Full UTF-8 Compatibility + +The plugins shipped with Smarty 3.1 have been rewritten to fully +support UTF-8 strings if Multibyte String is available. Without +MBString UTF-8 cannot be handled properly. For those rare cases where +templates themselves have to juggle encodings, the new modifiers +to_charset and from_charset may come in handy. + + Plugin API and Performance + +All Plugins (modifiers, functions, blocks, resources, +default_template_handlers, etc) are now receiving the +Smarty_Internal_Template instance, where they were supplied with the +Smarty instance in Smarty 3.0. *. As The Smarty_Internal_Template +mimics the behavior of Smarty, this API simplification should not +require any changes to custom plugins. + +The plugins shipped with Smarty 3.1 have been rewritten for better +performance. Most notably {html_select_date} and {html_select_time} +have been improved vastly. Performance aside, plugins have also been +reviewed and generalized in their API. {html_select_date} and +{html_select_time} now share almost all available options. + +The escape modifier now knows the $double_encode option, which will +prevent entities from being encoded again. + +The capitalize modifier now know the $lc_rest option, which makes sure +all letters following a captial letter are lower-cased. + +The count_sentences modifier now accepts (.?!) as +legitimate endings of a sentence - previously only (.) was +accepted + +The new unescape modifier is there to reverse the effects of the +escape modifier. This applies to the escape formats html, htmlall and +entity. + + default_template_handler_func + +The invocation of $smarty->$default_template_handler_func had to be +altered. Instead of a Smarty_Internal_Template, the fifth argument is +now provided with the Smarty instance. New footprint: + + +/** + * Default Template Handler + * + * called when Smarty's file: resource is unable to load a requested file + * + * @param string $type resource type (e.g. "file", "string", "eval", "resource") + * @param string $name resource name (e.g. "foo/bar.tpl") + * @param string &$content template's content + * @param integer &$modified template's modification time + * @param Smarty $smarty Smarty instance + * @return string|boolean path to file or boolean true if $content and $modified + * have been filled, boolean false if no default template + * could be loaded + */ +function default_template_handler_func($type, $name, &$content, &$modified, Smarty $smarty) { + if (false) { + // return corrected filepath + return "/tmp/some/foobar.tpl"; + } elseif (false) { + // return a template directly + $content = "the template source"; + $modified = time(); + return true; + } else { + // tell smarty that we failed + return false; + } +} + + Stuff done to the compiler + +Many performance improvements have happened internally. One notable +improvement is that all compiled templates are now handled as PHP +functions. This speeds up repeated templates tremendously, as each one +calls an (in-memory) PHP function instead of performing another file +include/scan. + +New Features + + Template syntax + + {block}..{/block} + +The {block} tag has a new hide option flag. It does suppress the block +content if no corresponding child block exists. +EXAMPLE: +parent.tpl +{block name=body hide} child content "{$smarty.block.child}" was +inserted {block} +In the above example the whole block will be suppressed if no child +block "body" is existing. + + {setfilter}..{/setfilter} + +The new {setfilter} block tag allows the definition of filters which +run on variable output. +SYNTAX: +{setfilter filter1|filter2|filter3....} +Smarty3 will lookup up matching filters in the following search order: +1. varibale filter plugin in plugins_dir. +2. a valid modifier. A modifier specification will also accept +additional parameter like filter2:'foo' +3. a PHP function +{/setfilter} will turn previous filter setting off again. +{setfilter} tags can be nested. +EXAMPLE: +{setfilter filter1} + {$foo} + {setfilter filter2} + {$bar} + {/setfilter} + {$buh} +{/setfilter} +{$blar} +In the above example filter1 will run on the output of $foo, filter2 +on $bar, filter1 again on $buh and no filter on $blar. +NOTES: +- {$foo nofilter} will suppress the filters +- These filters will run in addition to filters defined by +registerFilter('variable',...), autoLoadFilter('variable',...) and +defined default modifier. +- {setfilter} will effect only the current template, not included +subtemplates. + + Resource API + +Smarty 3.1 features a new approach to resource management. The +Smarty_Resource API allows simple, yet powerful integration of custom +resources for templates and configuration files. It offers simple +functions for loading data from a custom resource (e.g. database) as +well as define new template types adhering to the special +non-compiling (e,g, plain php) and non-compile-caching (e.g. eval: +resource type) resources. + +See demo/plugins/resource.mysql.php for an example custom database +resource. + +Note that old-fashioned registration of callbacks for resource +management has been deprecated but is still possible with SmartyBC. + + CacheResource API + +In line with the Resource API, the CacheResource API offers a more +comfortable handling of output-cache data. With the +Smarty_CacheResource_Custom accessing databases is made simple. With +the introduction of Smarty_CacheResource_KeyValueStore the +implementation of resources like memcache or APC became a no-brainer; +simple hash-based storage systems are now supporting hierarchical +output-caches. + +See demo/plugins/cacheresource.mysql.php for an example custom +database CacheResource. +See demo/plugins/cacheresource.memcache.php for an example custom +memcache CacheResource using the KeyValueStore helper. + +Note that old-fashioned registration of $cache_handler is not possible +anymore. As the functionality had not been ported to Smarty 3.0.x +properly, it has been dropped from 3.1 completely. + +Locking facilities have been implemented to avoid concurrent cache +generation. Enable cache locking by setting +$smarty->cache_locking = true; + + Relative Paths in Templates (File-Resource) + +As of Smarty 3.1 {include file="../foo.tpl"} and {include +file="./foo.tpl"} will resolve relative to the template they're in. +Relative paths are available with {include file="..."} and +{extends file="..."}. As $smarty->fetch('../foo.tpl') and +$smarty->fetch('./foo.tpl') cannot be relative to a template, an +exception is thrown. + + Addressing a specific $template_dir + +Smarty 3.1 introduces the $template_dir index notation. +$smarty->fetch('[foo]bar.tpl') and {include file="[foo]bar.tpl"} +require the template bar.tpl to be loaded from $template_dir['foo']; +Smarty::setTemplateDir() and Smarty::addTemplateDir() offer ways to +define indexes along with the actual directories. + + Mixing Resources in extends-Resource + +Taking the php extends: template resource one step further, it is now +possible to mix resources within an extends: call like +$smarty->fetch("extends:file:foo.tpl|db:bar.tpl"); + +To make eval: and string: resources available to the inheritance +chain, eval:base64:TPL_STRING and eval:urlencode:TPL_STRING have been +introduced. Supplying the base64 or urlencode flags will trigger +decoding the TPL_STRING in with either base64_decode() or urldecode(). + + extends-Resource in template inheritance + +Template based inheritance may now inherit from php's extends: +resource like {extends file="extends:foo.tpl|db:bar.tpl"}. + + New Smarty property escape_html + +$smarty->escape_html = true will autoescape all template variable +output by calling htmlspecialchars({$output}, ENT_QUOTES, +SMARTY_RESOURCE_CHAR_SET). +NOTE: +This is a compile time option. If you change the setting you must make +sure that the templates get recompiled. + + New option at Smarty property compile_check + +The automatic recompilation of modified templates can now be +controlled by the following settings: +$smarty->compile_check = COMPILECHECK_OFF (false) - template files +will not be checked +$smarty->compile_check = COMPILECHECK_ON (true) - template files will +always be checked +$smarty->compile_check = COMPILECHECK_CACHEMISS - template files will +be checked if caching is enabled and there is no existing cache file +or it has expired + + Automatic recompilation on Smarty version change + +Templates will now be automatically recompiled on Smarty version +changes to avoide incompatibillities in the compiled code. Compiled +template checked against the current setting of the SMARTY_VERSION +constant. + + default_config_handler_func() + +Analogous to the default_template_handler_func() +default_config_handler_func() has been introduced. + + default_plugin_handler_func() + +An optional default_plugin_handler_func() can be defined which gets called +by the compiler on tags which can't be resolved internally or by plugins. +The default_plugin_handler() can map tags to plugins on the fly. + +New getters/setters + +The following setters/getters will be part of the official +documentation, and will be strongly recommended. Direct property +access will still work for the foreseeable future... it will be +transparently routed through the setters/getters, and consequently a +bit slower. + +array|string getTemplateDir( [string $index] ) +replaces $smarty->template_dir; and $smarty->template_dir[$index]; +Smarty setTemplateDir( array|string $path ) +replaces $smarty->template_dir = "foo"; and $smarty->template_dir = +array("foo", "bar"); +Smarty addTemplateDir( array|string $path, [string $index]) +replaces $smarty->template_dir[] = "bar"; and +$smarty->template_dir[$index] = "bar"; + +array|string getConfigDir( [string $index] ) +replaces $smarty->config_dir; and $smarty->config_dir[$index]; +Smarty setConfigDir( array|string $path ) +replaces $smarty->config_dir = "foo"; and $smarty->config_dir = +array("foo", "bar"); +Smarty addConfigDir( array|string $path, [string $index]) +replaces $smarty->config_dir[] = "bar"; and +$smarty->config_dir[$index] = "bar"; + +array getPluginsDir() +replaces $smarty->plugins_dir; +Smarty setPluginsDir( array|string $path ) +replaces $smarty->plugins_dir = "foo"; +Smarty addPluginsDir( array|string $path ) +replaces $smarty->plugins_dir[] = "bar"; + +string getCompileDir() +replaces $smarty->compile_dir; +Smarty setCompileDir( string $path ) +replaces $smarty->compile_dir = "foo"; + +string getCacheDir() +replaces $smarty->cache_dir; +Smarty setCacheDir( string $path ) +replaces $smarty->cache_dir; diff --git a/library/Smarty/change_log.txt b/vendor/smarty/smarty/change_log.txt similarity index 85% rename from library/Smarty/change_log.txt rename to vendor/smarty/smarty/change_log.txt index dadc5d17d..1d42b0a76 100644 --- a/library/Smarty/change_log.txt +++ b/vendor/smarty/smarty/change_log.txt @@ -1,11 +1,348 @@ - ===== 3.1.29 ===== (21.12.2015) +===== 3.1.31 ===== (14.12.2016) + 23.11.2016 + - move template object cache into static variables + + 19.11.2016 + - bugfix inheritance root child templates containing nested {block}{/block} could call sub-bock content from parent + template https://github.com/smarty-php/smarty/issues/317 + - change version checking + + 11.11.2016 + - bugfix when Smarty is using a cached template object on Smarty::fetch() or Smarty::isCached() the inheritance data + must be removed https://github.com/smarty-php/smarty/issues/312 + - smaller speed optimization + + 08.11.2016 + - add bootstrap file to load and register Smarty_Autoloader. Change composer.json to make it known to composer + + 07.11.2016 + - optimization of lexer speed https://github.com/smarty-php/smarty/issues/311 + + 27.10.2016 + - bugfix template function definitions array has not been cached between Smarty::fetch() and Smarty::display() calls + https://github.com/smarty-php/smarty/issues/301 + + 23.10.2016 + - improvement/bugfix when Smarty::fetch() is called on a template object the inheritance and tplFunctions property + should be copied to the called template object + + 21.10.2016 + - bugfix for compile locking touched timestamp of old compiled file was not restored on compilation error https://github.com/smarty-php/smarty/issues/308 + + 20.10.2016 + - bugfix nocache code was not removed in cache file when subtemplate did contain PHP short tags in text but no other + nocache code https://github.com/smarty-php/smarty/issues/300 + + 19.10.2016 + - bugfix {make_nocache $var} did fail when variable value did contain '\' https://github.com/smarty-php/smarty/issues/305 + - bugfix {make_nocache $var} remove spaces from variable value https://github.com/smarty-php/smarty/issues/304 + + 12.10.2016 + - bugfix {include} with template names including variable or constants could fail after bugfix from + 28.09.2016 https://github.com/smarty-php/smarty/issues/302 + + 08.10.2016 + - optimization move runtime extension for template functions into Smarty objects + + 29.09.2016 + - improvement new Smarty::$extends_recursion property to disable execution of {extends} in templates called by extends resource + https://github.com/smarty-php/smarty/issues/296 + + 28.09.2016 + - bugfix the generated code for calling a subtemplate must pass the template resource name in single quotes https://github.com/smarty-php/smarty/issues/299 + - bugfix nocache hash was not removed for tags in subtemplates https://github.com/smarty-php/smarty/issues/300 + + 27.09.2016 + - bugfix when Smarty does use an internally cached template object on Smarty::fetch() calls + the template and config variables must be cleared https://github.com/smarty-php/smarty/issues/297 + + 20.09.2016 + - bugfix some $smarty special template variables are no longer accessed as real variable. + using them on calls like {if isset($smarty.foo)} or {if empty($smarty.foo)} will fail + http://www.smarty.net/forums/viewtopic.php?t=26222 + - temporary fix for https://github.com/smarty-php/smarty/issues/293 main reason still under investigation + - improvement new tags {block_parent} {block_child} in template inheritance + + 19.09.2016 + - optimization clear compiled and cached folder completely on detected version change + - cleanup convert cache resource file method clear into runtime extension + + 15.09.2016 + - bugfix assigning a variable in if condition by function like {if $value = array_shift($array)} the function got called twice https://github.com/smarty-php/smarty/issues/291 + - bugfix function plugins called with assign attribute like {foo assign='bar'} did not output returned content because + because assumption was made that it was assigned to a variable https://github.com/smarty-php/smarty/issues/292 + - bugfix calling $smarty->isCached() on a not existing cache file with $smarty->cache_locking = true; could cause a 10 second delay http://www.smarty.net/forums/viewtopic.php?t=26282 + - improvement make Smarty::clearCompiledTemplate() on custom resource independent from changes of templateId computation + + 11.09.2016 + - improvement {math} misleading E_USER_WARNING messages when parameter value = null https://github.com/smarty-php/smarty/issues/288 + - improvement move often used code snippets into methods + - performance Smarty::configLoad() did load unneeded template source object + + 09.09.2016 + - bugfix/optimization {foreach} did not execute the {foreachelse} when iterating empty objects https://github.com/smarty-php/smarty/pull/287 + - bugfix {foreach} must keep the @properties when restoring a saved $item variable as the properties might be used outside {foreach} https://github.com/smarty-php/smarty/issues/267 + - improvement {foreach} observe {break n} and {continue n} nesting levels when restoring saved $item and $key variables + + 08.09.2016 + - bugfix implement wrapper for removed method getConfigVariable() https://github.com/smarty-php/smarty/issues/286 + + 07.09.2016 + - bugfix using nocache like attribute with value true like {plugin nocache=true} did not work https://github.com/smarty-php/smarty/issues/285 + - bugfix uppercase TRUE, FALSE and NULL did not work when security was enabled https://github.com/smarty-php/smarty/issues/282 + - bugfix when {foreach} was looping over an object the total property like {$item@total} did always return 1 https://github.com/smarty-php/smarty/issues/281 + - bugfix {capture}{/capture} did add in 3.1.30 unintended additional blank lines https://github.com/smarty-php/smarty/issues/268 + + 01.09.2016 + - performance require_once should be called only once for shared plugins https://github.com/smarty-php/smarty/issues/280 + + 26.08.2016 + - bugfix change of 23.08.2016 failed on linux when use_include_path = true + + 23.08.2016 + - bugfix remove constant DS as shortcut for DIRECTORY_SEPARATOR as the user may have defined it to something else https://github.com/smarty-php/smarty/issues/277 + + 20.08-2016 + - bugfix {config_load ... scope="global"} shall not throw an arror but fallback to scope="smarty" https://github.com/smarty-php/smarty/issues/274 + - bugfix {make_nocache} failed when using composer autoloader https://github.com/smarty-php/smarty/issues/275 + + 14.08.2016 + - bugfix $smarty_>debugging = true; did E_NOTICE messages when {eval} tag was used https://github.com/smarty-php/smarty/issues/266 + - bugfix Class 'Smarty_Internal_Runtime_ValidateCompiled' not found when upgrading from some older Smarty versions with existing + compiled or cached template files https://github.com/smarty-php/smarty/issues/269 + - optimization remove unneeded call to update acopes when {assign} scope and template scope was local (default) + +===== 3.1.30 ===== (07.08.2016) + + 07.08.2016 + - bugfix update of 04.08.2016 was incomplete + + 05.08.2016 + - bugfix compiling of templates failed when the Smarty delimiter did contain '/' https://github.com/smarty-php/smarty/issues/264 + - updated error checking at template and config default handler + + 04.08.2016 + - improvement move template function source parameter into extension + + 26.07.2016 + - optimization unneeded loading of compiled resource + + 24.07.2016 + - regression this->addPluginsDir('/abs/path/to/dir') adding absolute path without trailing '/' did fail https://github.com/smarty-php/smarty/issues/260 + + 23.07.2016 + - bugfix setTemplateDir('/') and setTemplateDir('') did create wrong absolute filepath https://github.com/smarty-php/smarty/issues/245 + - optimization of filepath normalization + - improvement remove double function declaration in plugin shared.escape_special_cars.php https://github.com/smarty-php/smarty/issues/229 + + 19.07.2016 + - bugfix multiple {include} with relative filepath within {block}{/block} could fail https://github.com/smarty-php/smarty/issues/246 + - bugfix {math} shell injection vulnerability patch provided by Tim Weber + + 18.07.2016 + - bugfix {foreach} if key variable and item@key attribute have been used both the key variable was not updated https://github.com/smarty-php/smarty/issues/254 + - bugfix modifier on plugins like {plugin|modifier ... } did fail when the plugin does return an array https://github.com/smarty-php/smarty/issues/228 + - bugfix avoid opcache_invalidate to result in ErrorException when opcache.restrict_api is not empty https://github.com/smarty-php/smarty/pull/244 + - bugfix multiple {include} with relative filepath within {block}{/block} could fail https://github.com/smarty-php/smarty/issues/246 + + 14.07.2016 + - bugfix wrong parameter on compileAllTemplates() and compileAllConfig() https://github.com/smarty-php/smarty/issues/231 + + 13.07.2016 + - bugfix PHP 7 compatibility on registered compiler plugins https://github.com/smarty-php/smarty/issues/241 + - update testInstall() https://github.com/smarty-php/smarty/issues/248https://github.com/smarty-php/smarty/issues/248 + - bugfix enable debugging could fail when template objects did already exists https://github.com/smarty-php/smarty/issues/237 + - bugfix template function data should be merged when loading subtemplate https://github.com/smarty-php/smarty/issues/240 + - bugfix wrong parameter on compileAllTemplates() https://github.com/smarty-php/smarty/issues/231 + + 12.07.2016 + - bugfix {foreach} item variable must be created also on empty from array https://github.com/smarty-php/smarty/issues/238 and https://github.com/smarty-php/smarty/issues/239 + - bugfix enableSecurity() must init cache flags https://github.com/smarty-php/smarty/issues/247 + + 27.05.2016 + - bugfix/improvement of compileAlltemplates() follow symlinks in template folder (PHP >= 5.3.1) https://github.com/smarty-php/smarty/issues/224 + clear internal cache and expension handler for each template to avoid possible conflicts https://github.com/smarty-php/smarty/issues/231 + + 16.05.2016 + - optimization {foreach} compiler and processing + - broken PHP 5.3 and 5.4 compatibility + + 15.05.2016 + - optimization and cleanup of resource code + + 10.05.2016 + - optimization of inheritance processing + + 07.05.2016 + -bugfix Only variables should be assigned by reference https://github.com/smarty-php/smarty/issues/227 + + 02.05.2016 + - enhancement {block} tag names can now be variable https://github.com/smarty-php/smarty/issues/221 + + 01.05.2016 + - bugfix same relative filepath at {include} called from template in different folders could display wrong sub-template + + 29.04.2016 + - bugfix {strip} remove space on linebreak between html tags https://github.com/smarty-php/smarty/issues/213 + + 24.04.2016 + - bugfix nested {include} with relative file path could fail when called in {block} ... {/block} https://github.com/smarty-php/smarty/issues/218 + + 14.04.2016 + - bugfix special variable {$smarty.capture.name} was not case sensitive on name https://github.com/smarty-php/smarty/issues/210 + - bugfix the default template handler must calculate the source uid https://github.com/smarty-php/smarty/issues/205 + + 13.04.2016 + - bugfix template inheritance status must be saved when calling sub-templates https://github.com/smarty-php/smarty/issues/215 + + 27.03.2016 + - bugfix change of 11.03.2016 cause again {capture} data could not been seen in other templates with {$smarty.capture.name} https://github.com/smarty-php/smarty/issues/153 + + 11.03.2016 + - optimization of capture and security handling + - improvement $smarty->clearCompiledTemplate() should return on recompiled or uncompiled resources + + 10.03.2016 + - optimization of resource processing + + 09.03.2016 + - improvement rework of 'scope' attribute handling see see NEW_FEATURES.txt https://github.com/smarty-php/smarty/issues/194 + https://github.com/smarty-php/smarty/issues/186 https://github.com/smarty-php/smarty/issues/179 + - bugfix correct Autoloader update of 2.3.2014 https://github.com/smarty-php/smarty/issues/199 + + 04.03.2016 + - bugfix change from 01.03.2016 will cause $smarty->isCached(..) failure if called multiple time for same template + (forum topic 25935) + + 02.03.2016 + - revert autoloader optimizations because of unexplainable warning when using plugins https://github.com/smarty-php/smarty/issues/199 + + 01.03.2016 + - bugfix template objects must be cached on $smarty->fetch('foo.tpl) calls incase the template is fetched + multiple times (forum topic 25909) + + 25.02.2016 + - bugfix wrong _realpath with 4 or more parent-directories https://github.com/smarty-php/smarty/issues/190 + - optimization of _realpath + - bugfix instanceof expression in template code must be treated as value https://github.com/smarty-php/smarty/issues/191 + + 20.02.2016 + - bugfix {strip} must keep space between hmtl tags. Broken by changes of 10.2.2016 https://github.com/smarty-php/smarty/issues/184 + - new feature/bugfix {foreach}{section} add 'properties' attribute to force compilation of loop properties + see NEW_FEATURES.txt https://github.com/smarty-php/smarty/issues/189 + + 19.02.2016 + - revert output buffer flushing on display, echo content again because possible problems when PHP files had + characters (newline} after ?> at file end https://github.com/smarty-php/smarty/issues/187 + + 14.02.2016 + - new tag {make_nocache} read NEW_FEATURES.txt https://github.com/smarty-php/smarty/issues/110 + - optimization of sub-template processing + - bugfix using extendsall as default resource and {include} inside {block} tags could produce unexpected results https://github.com/smarty-php/smarty/issues/183 + - optimization of tag attribute compiling + - optimization make compiler tag object cache static for higher compilation speed + + 11.02.2016 + - improvement added KnockoutJS comments to trimwhitespace outputfilter https://github.com/smarty-php/smarty/issues/82 + https://github.com/smarty-php/smarty/pull/181 + + 10.02.2016 + - bugfix {strip} must keep space on output creating smarty tags within html tags https://github.com/smarty-php/smarty/issues/177 + - bugfix wrong precedence on special if conditions like '$foo is ... by $bar' could cause wrong code https://github.com/smarty-php/smarty/issues/178 + - improvement because of ambiguities the inline constant support has been removed from the $foo.bar syntax https://github.com/smarty-php/smarty/issues/149 + - bugfix other {strip} error with output tags between hmtl https://github.com/smarty-php/smarty/issues/180 + + 09.02.2016 + - move some code from parser into compiler + - reformat all code for unique style + - update/bugfix scope attribute handling reworked. Read the newfeatures.txt file + + 05.02.2016 + - improvement internal compiler changes + + 01.02.2016 + - bugfix {foreach} compilation failed when $smarty->merge_compiled_includes = true and pre-filters are used. + + 29.01.2016 + - bugfix implement replacement code for _tag_stack property https://github.com/smarty-php/smarty/issues/151 + + 28.01.2016 + - bugfix allow windows network filepath or wrapper (forum topic 25876) https://github.com/smarty-php/smarty/issues/170 + - bugfix if fetch('foo.tpl') is called on a template object the $parent parameter should default to the calling template object https://github.com/smarty-php/smarty/issues/152 + + 27.01.2016 + - revert bugfix compiling {section} did create warning + - bugfix {$smarty.section.customer.loop} did throw compiler error https://github.com/smarty-php/smarty/issues/161 + update of yesterdays fix + - bugfix string resource could inject code at {block} or inline subtemplates through PHP comments https://github.com/smarty-php/smarty/issues/157 + - bugfix output filters did not observe nocache code flhttps://github.com/smarty-php/smarty/issues/154g https://github.com/smarty-php/smarty/issues/160 + - bugfix {extends} with relative file path did not work https://github.com/smarty-php/smarty/issues/154 + https://github.com/smarty-php/smarty/issues/158 + - bugfix {capture} data could not been seen in other templates with {$smarty.capture.name} https://github.com/smarty-php/smarty/issues/153 + + 26.01.2016 + - improvement observe Smarty::$_CHARSET in debugging console https://github.com/smarty-php/smarty/issues/169 + - bugfix compiling {section} did create warning + - bugfix {$smarty.section.customer.loop} did throw compiler error https://github.com/smarty-php/smarty/issues/161 + + 02.01.2016 + - update scope handling + - optimize block plugin compiler + - improvement runtime checks if registered block plugins are callable + + 01.01.2016 + - remove Smarty::$resource_cache_mode property + + 31.12.2015 + - optimization of {assign}, {if} and {while} compiled code + + 30.12.2015 + - bugfix plugin names starting with "php" did not compile https://github.com/smarty-php/smarty/issues/147 + + 29.12.2015 + - bugfix Smarty::error_reporting was not observed when display() or fetch() was called on template objects https://github.com/smarty-php/smarty/issues/145 + + 28.12.2015 + - optimization of {foreach} code size and processing + + 27.12.2015 + - improve inheritance code + - update external methods + - code fixes + - PHPdoc updates + + 25.12.2015 + - compile {block} tag code and its processing into classes + - optimization replace hhvm extension by inline code + - new feature If ACP is enabled force an apc_compile_file() when compiled or cached template was updated + + 24.12.2015 + - new feature Compiler does now observe the template_dir setting and will create separate compiled files if required + - bugfix post filter did fail on template inheritance https://github.com/smarty-php/smarty/issues/144 + + 23.12.2015 + - optimization move internal method decodeProperties back into template object + - optimization move subtemplate processing back into template object + - new feature Caching does now observe the template_dir setting and will create separate cache files if required + + 22.12.2015 + - change $xxx_dir properties from private to protected in case Smarty class gets extended + - code optimizations + + 21.12.2015 + - bugfix a filepath starting with '/' or '\' on windows should normalize to the root dir + of current working drive https://github.com/smarty-php/smarty/issues/134 + - optimization of filepath normalization + - bugfix {strip} must remove all blanks between html tags https://github.com/smarty-php/smarty/issues/136 + + ===== 3.1.29 ===== (21.12.2015) 21.12.2015 - optimization improve speed of filetime checks on extends and extendsall resource 20.12.2015 - bugfix failure when the default resource type was set to 'extendsall' https://github.com/smarty-php/smarty/issues/123 - update compilation of Smarty special variables - - bugfix add addition check for OS type on normalizaition of file path https://github.com/smarty-php/smarty/issues/134 + - bugfix add addition check for OS type on normalization of file path https://github.com/smarty-php/smarty/issues/134 - bugfix the source uid of the extendsall resource must contain $template_dir settings https://github.com/smarty-php/smarty/issues/123 19.12.2015 @@ -15,7 +352,7 @@ - improvement make sure that compiled and cache templates never can contain a trailing '?>? 18.12.2015 - - bugfix regression when modifier parameter was follow by math https://github.com/smarty-php/smarty/issues/132 + - bugfix regression when modifier parameter was followed by math https://github.com/smarty-php/smarty/issues/132 17.12.2015 - bugfix {$smarty.capture.nameFail} did lowercase capture name https://github.com/smarty-php/smarty/issues/135 diff --git a/vendor/smarty/smarty/demo/configs/test.conf b/vendor/smarty/smarty/demo/configs/test.conf new file mode 100644 index 000000000..5eac748ec --- /dev/null +++ b/vendor/smarty/smarty/demo/configs/test.conf @@ -0,0 +1,5 @@ +title = Welcome to Smarty! +cutoff_size = 40 + +[setup] +bold = true diff --git a/vendor/smarty/smarty/demo/index.php b/vendor/smarty/smarty/demo/index.php new file mode 100644 index 000000000..b67c217be --- /dev/null +++ b/vendor/smarty/smarty/demo/index.php @@ -0,0 +1,30 @@ +force_compile = true; +$smarty->debugging = true; +$smarty->caching = true; +$smarty->cache_lifetime = 120; + +$smarty->assign("Name", "Fred Irving Johnathan Bradley Peppergill", true); +$smarty->assign("FirstName", array("John", "Mary", "James", "Henry")); +$smarty->assign("LastName", array("Doe", "Smith", "Johnson", "Case")); +$smarty->assign("Class", array(array("A", "B", "C", "D"), array("E", "F", "G", "H"), array("I", "J", "K", "L"), + array("M", "N", "O", "P"))); + +$smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"), + array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234"))); + +$smarty->assign("option_values", array("NY", "NE", "KS", "IA", "OK", "TX")); +$smarty->assign("option_output", array("New York", "Nebraska", "Kansas", "Iowa", "Oklahoma", "Texas")); +$smarty->assign("option_selected", "NE"); + +$smarty->display('index.tpl'); diff --git a/vendor/smarty/smarty/demo/plugins/cacheresource.apc.php b/vendor/smarty/smarty/demo/plugins/cacheresource.apc.php new file mode 100644 index 000000000..ed55ec846 --- /dev/null +++ b/vendor/smarty/smarty/demo/plugins/cacheresource.apc.php @@ -0,0 +1,83 @@ + $v) { + $_res[ $k ] = $v; + } + + return $_res; + } + + /** + * Save values for a set of keys to cache + * + * @param array $keys list of values to save + * @param int $expire expiration time + * + * @return boolean true on success, false on failure + */ + protected function write(array $keys, $expire = null) + { + foreach ($keys as $k => $v) { + apc_store($k, $v, $expire); + } + + return true; + } + + /** + * Remove values from cache + * + * @param array $keys list of keys to delete + * + * @return boolean true on success, false on failure + */ + protected function delete(array $keys) + { + foreach ($keys as $k) { + apc_delete($k); + } + + return true; + } + + /** + * Remove *all* values from cache + * + * @return boolean true on success, false on failure + */ + protected function purge() + { + return apc_clear_cache('user'); + } +} diff --git a/vendor/smarty/smarty/demo/plugins/cacheresource.memcache.php b/vendor/smarty/smarty/demo/plugins/cacheresource.memcache.php new file mode 100644 index 000000000..945beb349 --- /dev/null +++ b/vendor/smarty/smarty/demo/plugins/cacheresource.memcache.php @@ -0,0 +1,101 @@ +memcache = new Memcached(); + } else { + $this->memcache = new Memcache(); + } + $this->memcache->addServer('127.0.0.1', 11211); + } + + /** + * Read values for a set of keys from cache + * + * @param array $keys list of keys to fetch + * + * @return array list of values with the given keys used as indexes + * @return boolean true on success, false on failure + */ + protected function read(array $keys) + { + $_keys = $lookup = array(); + foreach ($keys as $k) { + $_k = sha1($k); + $_keys[] = $_k; + $lookup[ $_k ] = $k; + } + $_res = array(); + $res = $this->memcache->get($_keys); + foreach ($res as $k => $v) { + $_res[ $lookup[ $k ] ] = $v; + } + + return $_res; + } + + /** + * Save values for a set of keys to cache + * + * @param array $keys list of values to save + * @param int $expire expiration time + * + * @return boolean true on success, false on failure + */ + protected function write(array $keys, $expire = null) + { + foreach ($keys as $k => $v) { + $k = sha1($k); + $this->memcache->set($k, $v, 0, $expire); + } + + return true; + } + + /** + * Remove values from cache + * + * @param array $keys list of keys to delete + * + * @return boolean true on success, false on failure + */ + protected function delete(array $keys) + { + foreach ($keys as $k) { + $k = sha1($k); + $this->memcache->delete($k); + } + + return true; + } + + /** + * Remove *all* values from cache + * + * @return boolean true on success, false on failure + */ + protected function purge() + { + $this->memcache->flush(); + } +} diff --git a/vendor/smarty/smarty/demo/plugins/cacheresource.mysql.php b/vendor/smarty/smarty/demo/plugins/cacheresource.mysql.php new file mode 100644 index 000000000..027b93766 --- /dev/null +++ b/vendor/smarty/smarty/demo/plugins/cacheresource.mysql.php @@ -0,0 +1,160 @@ +CREATE TABLE IF NOT EXISTS `output_cache` ( + * `id` CHAR(40) NOT NULL COMMENT 'sha1 hash', + * `name` VARCHAR(250) NOT NULL, + * `cache_id` VARCHAR(250) NULL DEFAULT NULL, + * `compile_id` VARCHAR(250) NULL DEFAULT NULL, + * `modified` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, + * `content` LONGTEXT NOT NULL, + * PRIMARY KEY (`id`), + * INDEX(`name`), + * INDEX(`cache_id`), + * INDEX(`compile_id`), + * INDEX(`modified`) + * ) ENGINE = InnoDB; + * + * @package CacheResource-examples + * @author Rodney Rehm + */ +class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom +{ + // PDO instance + protected $db; + + protected $fetch; + + protected $fetchTimestamp; + + protected $save; + + public function __construct() + { + try { + $this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty"); + } + catch (PDOException $e) { + throw new SmartyException('Mysql Resource failed: ' . $e->getMessage()); + } + $this->fetch = $this->db->prepare('SELECT modified, content FROM output_cache WHERE id = :id'); + $this->fetchTimestamp = $this->db->prepare('SELECT modified FROM output_cache WHERE id = :id'); + $this->save = $this->db->prepare('REPLACE INTO output_cache (id, name, cache_id, compile_id, content) + VALUES (:id, :name, :cache_id, :compile_id, :content)'); + } + + /** + * fetch cached content and its modification time from data source + * + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param string $content cached content + * @param integer $mtime cache modification timestamp (epoch) + * + * @return void + */ + protected function fetch($id, $name, $cache_id, $compile_id, &$content, &$mtime) + { + $this->fetch->execute(array('id' => $id)); + $row = $this->fetch->fetch(); + $this->fetch->closeCursor(); + if ($row) { + $content = $row[ 'content' ]; + $mtime = strtotime($row[ 'modified' ]); + } else { + $content = null; + $mtime = null; + } + } + + /** + * Fetch cached content's modification timestamp from data source + * + * @note implementing this method is optional. Only implement it if modification times can be accessed faster than loading the complete cached content. + * + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * + * @return integer|boolean timestamp (epoch) the template was modified, or false if not found + */ + protected function fetchTimestamp($id, $name, $cache_id, $compile_id) + { + $this->fetchTimestamp->execute(array('id' => $id)); + $mtime = strtotime($this->fetchTimestamp->fetchColumn()); + $this->fetchTimestamp->closeCursor(); + + return $mtime; + } + + /** + * Save content to cache + * + * @param string $id unique cache content identifier + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer|null $exp_time seconds till expiration time in seconds or null + * @param string $content content to cache + * + * @return boolean success + */ + protected function save($id, $name, $cache_id, $compile_id, $exp_time, $content) + { + $this->save->execute(array('id' => $id, 'name' => $name, 'cache_id' => $cache_id, 'compile_id' => $compile_id, + 'content' => $content,)); + + return !!$this->save->rowCount(); + } + + /** + * Delete content from cache + * + * @param string $name template name + * @param string $cache_id cache id + * @param string $compile_id compile id + * @param integer|null $exp_time seconds till expiration or null + * + * @return integer number of deleted caches + */ + protected function delete($name, $cache_id, $compile_id, $exp_time) + { + // delete the whole cache + if ($name === null && $cache_id === null && $compile_id === null && $exp_time === null) { + // returning the number of deleted caches would require a second query to count them + $query = $this->db->query('TRUNCATE TABLE output_cache'); + + return - 1; + } + // build the filter + $where = array(); + // equal test name + if ($name !== null) { + $where[] = 'name = ' . $this->db->quote($name); + } + // equal test compile_id + if ($compile_id !== null) { + $where[] = 'compile_id = ' . $this->db->quote($compile_id); + } + // range test expiration time + if ($exp_time !== null) { + $where[] = 'modified < DATE_SUB(NOW(), INTERVAL ' . intval($exp_time) . ' SECOND)'; + } + // equal test cache_id and match sub-groups + if ($cache_id !== null) { + $where[] = '(cache_id = ' . $this->db->quote($cache_id) . ' OR cache_id LIKE ' . + $this->db->quote($cache_id . '|%') . ')'; + } + // run delete query + $query = $this->db->query('DELETE FROM output_cache WHERE ' . join(' AND ', $where)); + + return $query->rowCount(); + } +} diff --git a/vendor/smarty/smarty/demo/plugins/cacheresource.pdo.php b/vendor/smarty/smarty/demo/plugins/cacheresource.pdo.php new file mode 100644 index 000000000..d1e2d6ace --- /dev/null +++ b/vendor/smarty/smarty/demo/plugins/cacheresource.pdo.php @@ -0,0 +1,327 @@ +setCachingType('pdo'); + * $smarty->loadPlugin('Smarty_CacheResource_Pdo'); + * $smarty->registerCacheResource('pdo', new Smarty_CacheResource_Pdo($cnx, 'smarty_cache')); + * + * @author Beno!t POLASZEK - 2014 + */ +class Smarty_CacheResource_Pdo extends Smarty_CacheResource_Custom +{ + + protected $fetchStatements = Array('default' => 'SELECT %2$s + FROM %1$s + WHERE 1 + AND id = :id + AND cache_id IS NULL + AND compile_id IS NULL', + + 'withCacheId' => 'SELECT %2$s + FROM %1$s + WHERE 1 + AND id = :id + AND cache_id = :cache_id + AND compile_id IS NULL', + + 'withCompileId' => 'SELECT %2$s + FROM %1$s + WHERE 1 + AND id = :id + AND compile_id = :compile_id + AND cache_id IS NULL', + + 'withCacheIdAndCompileId' => 'SELECT %2$s + FROM %1$s + WHERE 1 + AND id = :id + AND cache_id = :cache_id + AND compile_id = :compile_id'); + + protected $insertStatement = 'INSERT INTO %s + + SET id = :id, + name = :name, + cache_id = :cache_id, + compile_id = :compile_id, + modified = CURRENT_TIMESTAMP, + expire = DATE_ADD(CURRENT_TIMESTAMP, INTERVAL :expire SECOND), + content = :content + + ON DUPLICATE KEY UPDATE + name = :name, + cache_id = :cache_id, + compile_id = :compile_id, + modified = CURRENT_TIMESTAMP, + expire = DATE_ADD(CURRENT_TIMESTAMP, INTERVAL :expire SECOND), + content = :content'; + + protected $deleteStatement = 'DELETE FROM %1$s WHERE %2$s'; + + protected $truncateStatement = 'TRUNCATE TABLE %s'; + + protected $fetchColumns = 'modified, content'; + + protected $fetchTimestampColumns = 'modified'; + + protected $pdo, $table, $database; + + /* + * Constructor + * + * @param PDO $pdo PDO : active connection + * @param string $table : table (or view) name + * @param string $database : optionnal - if table is located in another db + */ + public function __construct(PDO $pdo, $table, $database = null) + { + + if (is_null($table)) { + throw new SmartyException("Table name for caching can't be null"); + } + + $this->pdo = $pdo; + $this->table = $table; + $this->database = $database; + + $this->fillStatementsWithTableName(); + } + + /* + * Fills the table name into the statements. + * + * @return Current Instance + * @access protected + */ + protected function fillStatementsWithTableName() + { + + foreach ($this->fetchStatements AS &$statement) { + $statement = sprintf($statement, $this->getTableName(), '%s'); + } + + $this->insertStatement = sprintf($this->insertStatement, $this->getTableName()); + $this->deleteStatement = sprintf($this->deleteStatement, $this->getTableName(), '%s'); + $this->truncateStatement = sprintf($this->truncateStatement, $this->getTableName()); + + return $this; + } + + /* + * Gets the fetch statement, depending on what you specify + * + * @param string $columns : the column(s) name(s) you want to retrieve from the database + * @param string $id unique cache content identifier + * @param string|null $cache_id cache id + * @param string|null $compile_id compile id + * @access protected + */ + protected function getFetchStatement($columns, $id, $cache_id = null, $compile_id = null) + { + + if (!is_null($cache_id) && !is_null($compile_id)) { + $query = $this->fetchStatements[ 'withCacheIdAndCompileId' ] AND + $args = Array('id' => $id, 'cache_id' => $cache_id, 'compile_id' => $compile_id); + } elseif (is_null($cache_id) && !is_null($compile_id)) { + $query = $this->fetchStatements[ 'withCompileId' ] AND + $args = Array('id' => $id, 'compile_id' => $compile_id); + } elseif (!is_null($cache_id) && is_null($compile_id)) { + $query = $this->fetchStatements[ 'withCacheId' ] AND $args = Array('id' => $id, 'cache_id' => $cache_id); + } else { + $query = $this->fetchStatements[ 'default' ] AND $args = Array('id' => $id); + } + + $query = sprintf($query, $columns); + + $stmt = $this->pdo->prepare($query); + + foreach ($args AS $key => $value) { + $stmt->bindValue($key, $value); + } + + return $stmt; + } + + /** + * fetch cached content and its modification time from data source + * + * @param string $id unique cache content identifier + * @param string $name template name + * @param string|null $cache_id cache id + * @param string|null $compile_id compile id + * @param string $content cached content + * @param integer $mtime cache modification timestamp (epoch) + * + * @return void + * @access protected + */ + protected function fetch($id, $name, $cache_id = null, $compile_id = null, &$content, &$mtime) + { + + $stmt = $this->getFetchStatement($this->fetchColumns, $id, $cache_id, $compile_id); + $stmt->execute(); + $row = $stmt->fetch(); + $stmt->closeCursor(); + + if ($row) { + $content = $this->outputContent($row[ 'content' ]); + $mtime = strtotime($row[ 'modified' ]); + } else { + $content = null; + $mtime = null; + } + } + + /** + * Fetch cached content's modification timestamp from data source + * {@internal implementing this method is optional. + * Only implement it if modification times can be accessed faster than loading the complete cached content.}} + * + * @param string $id unique cache content identifier + * @param string $name template name + * @param string|null $cache_id cache id + * @param string|null $compile_id compile id + * + * @return integer|boolean timestamp (epoch) the template was modified, or false if not found + * @access protected + */ + // protected function fetchTimestamp($id, $name, $cache_id = null, $compile_id = null) { + // $stmt = $this->getFetchStatement($this->fetchTimestampColumns, $id, $cache_id, $compile_id); + // $stmt -> execute(); + // $mtime = strtotime($stmt->fetchColumn()); + // $stmt -> closeCursor(); + // return $mtime; + // } + + /** + * Save content to cache + * + * @param string $id unique cache content identifier + * @param string $name template name + * @param string|null $cache_id cache id + * @param string|null $compile_id compile id + * @param integer|null $exp_time seconds till expiration time in seconds or null + * @param string $content content to cache + * + * @return boolean success + * @access protected + */ + protected function save($id, $name, $cache_id = null, $compile_id = null, $exp_time, $content) + { + + $stmt = $this->pdo->prepare($this->insertStatement); + + $stmt->bindValue('id', $id); + $stmt->bindValue('name', $name); + $stmt->bindValue('cache_id', $cache_id, (is_null($cache_id)) ? PDO::PARAM_NULL : PDO::PARAM_STR); + $stmt->bindValue('compile_id', $compile_id, (is_null($compile_id)) ? PDO::PARAM_NULL : PDO::PARAM_STR); + $stmt->bindValue('expire', (int) $exp_time, PDO::PARAM_INT); + $stmt->bindValue('content', $this->inputContent($content)); + $stmt->execute(); + + return !!$stmt->rowCount(); + } + + /* + * Encodes the content before saving to database + * + * @param string $content + * @return string $content + * @access protected + */ + protected function inputContent($content) + { + return $content; + } + + /* + * Decodes the content before saving to database + * + * @param string $content + * @return string $content + * @access protected + */ + protected function outputContent($content) + { + return $content; + } + + /** + * Delete content from cache + * + * @param string|null $name template name + * @param string|null $cache_id cache id + * @param string|null $compile_id compile id + * @param integer|null|-1 $exp_time seconds till expiration or null + * + * @return integer number of deleted caches + * @access protected + */ + protected function delete($name = null, $cache_id = null, $compile_id = null, $exp_time = null) + { + + // delete the whole cache + if ($name === null && $cache_id === null && $compile_id === null && $exp_time === null) { + // returning the number of deleted caches would require a second query to count them + $this->pdo->query($this->truncateStatement); + return - 1; + } + // build the filter + $where = array(); + // equal test name + if ($name !== null) { + $where[] = 'name = ' . $this->pdo->quote($name); + } + // equal test cache_id and match sub-groups + if ($cache_id !== null) { + $where[] = '(cache_id = ' . $this->pdo->quote($cache_id) . ' OR cache_id LIKE ' . + $this->pdo->quote($cache_id . '|%') . ')'; + } + // equal test compile_id + if ($compile_id !== null) { + $where[] = 'compile_id = ' . $this->pdo->quote($compile_id); + } + // for clearing expired caches + if ($exp_time === Smarty::CLEAR_EXPIRED) { + $where[] = 'expire < CURRENT_TIMESTAMP'; + } // range test expiration time + elseif ($exp_time !== null) { + $where[] = 'modified < DATE_SUB(NOW(), INTERVAL ' . intval($exp_time) . ' SECOND)'; + } + // run delete query + $query = $this->pdo->query(sprintf($this->deleteStatement, join(' AND ', $where))); + return $query->rowCount(); + } + + /** + * Gets the formatted table name + * + * @return string + * @access protected + */ + protected function getTableName() + { + return (is_null($this->database)) ? "`{$this->table}`" : "`{$this->database}`.`{$this->table}`"; + } +} + \ No newline at end of file diff --git a/vendor/smarty/smarty/demo/plugins/cacheresource.pdo_gzip.php b/vendor/smarty/smarty/demo/plugins/cacheresource.pdo_gzip.php new file mode 100644 index 000000000..8a9e0a5dd --- /dev/null +++ b/vendor/smarty/smarty/demo/plugins/cacheresource.pdo_gzip.php @@ -0,0 +1,43 @@ +setCachingType('pdo_gzip'); + * $smarty->loadPlugin('Smarty_CacheResource_Pdo_Gzip'); + * $smarty->registerCacheResource('pdo_gzip', new Smarty_CacheResource_Pdo_Gzip($cnx, 'smarty_cache')); + * + * @require Smarty_CacheResource_Pdo class + * @author Beno!t POLASZEK - 2014 + */ +require_once 'cacheresource.pdo.php'; + +class Smarty_CacheResource_Pdo_Gzip extends Smarty_CacheResource_Pdo +{ + + /* + * Encodes the content before saving to database + * + * @param string $content + * @return string $content + * @access protected + */ + protected function inputContent($content) + { + return gzdeflate($content); + } + + /* + * Decodes the content before saving to database + * + * @param string $content + * @return string $content + * @access protected + */ + protected function outputContent($content) + { + return gzinflate($content); + } +} + \ No newline at end of file diff --git a/vendor/smarty/smarty/demo/plugins/resource.extendsall.php b/vendor/smarty/smarty/demo/plugins/resource.extendsall.php new file mode 100644 index 000000000..a5ee432dd --- /dev/null +++ b/vendor/smarty/smarty/demo/plugins/resource.extendsall.php @@ -0,0 +1,65 @@ +smarty->getTemplateDir() as $key => $directory) { + try { + $s = Smarty_Resource::source(null, $source->smarty, 'file:' . '[' . $key . ']' . $source->name); + if (!$s->exists) { + continue; + } + $sources[ $s->uid ] = $s; + $uid .= $s->filepath; + $timestamp = $s->timestamp > $timestamp ? $s->timestamp : $timestamp; + } + catch (SmartyException $e) { + } + } + if (!$sources) { + $source->exists = false; + return; + } + + $sources = array_reverse($sources, true); + reset($sources); + $s = current($sources); + $source->components = $sources; + $source->filepath = $s->filepath; + $source->uid = sha1($uid . $source->smarty->_joined_template_dir); + $source->exists = true; + $source->timestamp = $timestamp; + } + + /* + * Disable timestamp checks for extendsall resource. + * The individual source components will be checked. + * + * @return bool + */ + public function checkTimestamps() + { + return false; + } + +} diff --git a/vendor/smarty/smarty/demo/plugins/resource.mysql.php b/vendor/smarty/smarty/demo/plugins/resource.mysql.php new file mode 100644 index 000000000..619707e78 --- /dev/null +++ b/vendor/smarty/smarty/demo/plugins/resource.mysql.php @@ -0,0 +1,83 @@ +CREATE TABLE IF NOT EXISTS `templates` ( + * `name` varchar(100) NOT NULL, + * `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + * `source` text, + * PRIMARY KEY (`name`) + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + * Demo data: + *
      INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}');
      + * + * @package Resource-examples + * @author Rodney Rehm + */ +class Smarty_Resource_Mysql extends Smarty_Resource_Custom +{ + // PDO instance + protected $db; + + // prepared fetch() statement + protected $fetch; + + // prepared fetchTimestamp() statement + protected $mtime; + + public function __construct() + { + try { + $this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty"); + } + catch (PDOException $e) { + throw new SmartyException('Mysql Resource failed: ' . $e->getMessage()); + } + $this->fetch = $this->db->prepare('SELECT modified, source FROM templates WHERE name = :name'); + $this->mtime = $this->db->prepare('SELECT modified FROM templates WHERE name = :name'); + } + + /** + * Fetch a template and its modification time from database + * + * @param string $name template name + * @param string $source template source + * @param integer $mtime template modification timestamp (epoch) + * + * @return void + */ + protected function fetch($name, &$source, &$mtime) + { + $this->fetch->execute(array('name' => $name)); + $row = $this->fetch->fetch(); + $this->fetch->closeCursor(); + if ($row) { + $source = $row[ 'source' ]; + $mtime = strtotime($row[ 'modified' ]); + } else { + $source = null; + $mtime = null; + } + } + + /** + * Fetch a template's modification time from database + * + * @note implementing this method is optional. Only implement it if modification times can be accessed faster than loading the comple template source. + * + * @param string $name template name + * + * @return integer timestamp (epoch) the template was modified + */ + protected function fetchTimestamp($name) + { + $this->mtime->execute(array('name' => $name)); + $mtime = $this->mtime->fetchColumn(); + $this->mtime->closeCursor(); + + return strtotime($mtime); + } +} diff --git a/vendor/smarty/smarty/demo/plugins/resource.mysqls.php b/vendor/smarty/smarty/demo/plugins/resource.mysqls.php new file mode 100644 index 000000000..d85aecf31 --- /dev/null +++ b/vendor/smarty/smarty/demo/plugins/resource.mysqls.php @@ -0,0 +1,63 @@ +CREATE TABLE IF NOT EXISTS `templates` ( + * `name` varchar(100) NOT NULL, + * `modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + * `source` text, + * PRIMARY KEY (`name`) + * ) ENGINE=InnoDB DEFAULT CHARSET=utf8; + * Demo data: + *
      INSERT INTO `templates` (`name`, `modified`, `source`) VALUES ('test.tpl', "2010-12-25 22:00:00", '{$x="hello world"}{$x}');
      + * + * @package Resource-examples + * @author Rodney Rehm + */ +class Smarty_Resource_Mysqls extends Smarty_Resource_Custom +{ + // PDO instance + protected $db; + + // prepared fetch() statement + protected $fetch; + + public function __construct() + { + try { + $this->db = new PDO("mysql:dbname=test;host=127.0.0.1", "smarty"); + } + catch (PDOException $e) { + throw new SmartyException('Mysql Resource failed: ' . $e->getMessage()); + } + $this->fetch = $this->db->prepare('SELECT modified, source FROM templates WHERE name = :name'); + } + + /** + * Fetch a template and its modification time from database + * + * @param string $name template name + * @param string $source template source + * @param integer $mtime template modification timestamp (epoch) + * + * @return void + */ + protected function fetch($name, &$source, &$mtime) + { + $this->fetch->execute(array('name' => $name)); + $row = $this->fetch->fetch(); + $this->fetch->closeCursor(); + if ($row) { + $source = $row[ 'source' ]; + $mtime = strtotime($row[ 'modified' ]); + } else { + $source = null; + $mtime = null; + } + } +} diff --git a/vendor/smarty/smarty/demo/templates/footer.tpl b/vendor/smarty/smarty/demo/templates/footer.tpl new file mode 100644 index 000000000..e04310fdd --- /dev/null +++ b/vendor/smarty/smarty/demo/templates/footer.tpl @@ -0,0 +1,2 @@ + + diff --git a/vendor/smarty/smarty/demo/templates/header.tpl b/vendor/smarty/smarty/demo/templates/header.tpl new file mode 100644 index 000000000..783210a18 --- /dev/null +++ b/vendor/smarty/smarty/demo/templates/header.tpl @@ -0,0 +1,5 @@ + + +{$title} - {$Name} + + diff --git a/vendor/smarty/smarty/demo/templates/index.tpl b/vendor/smarty/smarty/demo/templates/index.tpl new file mode 100644 index 000000000..1fbb6d379 --- /dev/null +++ b/vendor/smarty/smarty/demo/templates/index.tpl @@ -0,0 +1,87 @@ +{config_load file="test.conf" section="setup"} +{include file="header.tpl" title=foo} + +
      +
      +{* bold and title are read from the config file *}
      +    {if #bold#}{/if}
      +        {* capitalize the first letters of each word of the title *}
      +        Title: {#title#|capitalize}
      +        {if #bold#}{/if}
      +
      +    The current date and time is {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
      +
      +    The value of global assigned variable $SCRIPT_NAME is {$SCRIPT_NAME}
      +
      +    Example of accessing server environment variable SERVER_NAME: {$smarty.server.SERVER_NAME}
      +
      +    The value of {ldelim}$Name{rdelim} is {$Name}
      +
      +variable modifier example of {ldelim}$Name|upper{rdelim}
      +
      +{$Name|upper}
      +
      +
      +An example of a section loop:
      +
      +    {section name=outer
      +    loop=$FirstName}
      +        {if $smarty.section.outer.index is odd by 2}
      +            {$smarty.section.outer.rownum} . {$FirstName[outer]} {$LastName[outer]}
      +        {else}
      +            {$smarty.section.outer.rownum} * {$FirstName[outer]} {$LastName[outer]}
      +        {/if}
      +        {sectionelse}
      +        none
      +    {/section}
      +
      +    An example of section looped key values:
      +
      +    {section name=sec1 loop=$contacts}
      +        phone: {$contacts[sec1].phone}
      +        
      + + fax: {$contacts[sec1].fax} +
      + + cell: {$contacts[sec1].cell} +
      + {/section} +

      + + testing strip tags + {strip} + + + + +
      + + This is a test + +
      + {/strip} + +

      + +This is an example of the html_select_date function: + +
      + {html_select_date start_year=1998 end_year=2010} +
      + +This is an example of the html_select_time function: + +
      + {html_select_time use_24_hours=false} +
      + +This is an example of the html_options function: + +
      + +
      + +{include file="footer.tpl"} diff --git a/library/Smarty/libs/Autoloader.php b/vendor/smarty/smarty/libs/Autoloader.php similarity index 61% rename from library/Smarty/libs/Autoloader.php rename to vendor/smarty/smarty/libs/Autoloader.php index 7d0c388a6..d3b039caa 100644 --- a/library/Smarty/libs/Autoloader.php +++ b/vendor/smarty/smarty/libs/Autoloader.php @@ -11,11 +11,12 @@ * @package Smarty * @author Uwe Tews * Usage: - * require_once '...path/Autoloader.php'; - * Smarty_Autoloader::register(); - * $smarty = new Smarty(); - * Note: This autoloader is not needed if you use Composer. - * Composer will automatically add the classes of the Smarty package to it common autoloader. + * require_once '...path/Autoloader.php'; + * Smarty_Autoloader::register(); + * or + * include '...path/bootstarp.php'; + * + * $smarty = new Smarty(); */ class Smarty_Autoloader { @@ -24,14 +25,14 @@ class Smarty_Autoloader * * @var string */ - public static $SMARTY_DIR = ''; + public static $SMARTY_DIR = null; /** * Filepath to Smarty internal plugins * * @var string */ - public static $SMARTY_SYSPLUGINS_DIR = ''; + public static $SMARTY_SYSPLUGINS_DIR = null; /** * Array with Smarty core classes and their filename @@ -57,7 +58,7 @@ class Smarty_Autoloader set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false ) { $registeredAutoLoadFunctions = spl_autoload_functions(); - if (!isset($registeredAutoLoadFunctions['spl_autoload'])) { + if (!isset($registeredAutoLoadFunctions[ 'spl_autoload' ])) { spl_autoload_register(); } } else { @@ -89,36 +90,21 @@ class Smarty_Autoloader */ public static function autoload($class) { + if ($class[ 0 ] !== 'S' && strpos($class, 'Smarty') !== 0) { + return; + } $_class = strtolower($class); - $file = self::$SMARTY_SYSPLUGINS_DIR . $_class . '.php'; - if (strpos($_class, 'smarty_internal_') === 0) { - if (strpos($_class, 'smarty_internal_compile_') === 0) { - if (is_file($file)) { - require $file; - } - return; + if (isset(self::$rootClasses[ $_class ])) { + $file = self::$SMARTY_DIR . self::$rootClasses[ $_class ]; + if (is_file($file)) { + include $file; } - @include $file; - return; - } - if (preg_match('/^(smarty_(((template_(source|config|cache|compiled|resource_base))|((cached|compiled)?resource)|(variable|security)))|(smarty(bc)?)$)/', - $_class, $match)) { - if (!empty($match[3])) { - @include $file; - return; - } elseif (!empty($match[9]) && isset(self::$rootClasses[$_class])) { - $file = self::$rootClasses[$_class]; - require $file; - return; + } else { + $file = self::$SMARTY_SYSPLUGINS_DIR . $_class . '.php'; + if (is_file($file)) { + include $file; } } - if (0 !== strpos($_class, 'smarty')) { - return; - } - if (is_file($file)) { - require $file; - return; - } return; } } diff --git a/library/Smarty/libs/Smarty.class.php b/vendor/smarty/smarty/libs/Smarty.class.php similarity index 71% rename from library/Smarty/libs/Smarty.class.php rename to vendor/smarty/smarty/libs/Smarty.class.php index a029f942e..57eedfb93 100644 --- a/library/Smarty/libs/Smarty.class.php +++ b/vendor/smarty/smarty/libs/Smarty.class.php @@ -21,28 +21,21 @@ * smarty-discussion-subscribe@googlegroups.com * * @link http://www.smarty.net/ - * @copyright 2015 New Digital Group, Inc. - * @copyright 2015 Uwe Tews + * @copyright 2016 New Digital Group, Inc. + * @copyright 2016 Uwe Tews * @author Monte Ohrt * @author Uwe Tews * @author Rodney Rehm * @package Smarty - * @version 3.1.29 + * @version 3.1.31 */ -/** - * define shorthand directory separator constant - */ -if (!defined('DS')) { - define('DS', DIRECTORY_SEPARATOR); -} - /** * set SMARTY_DIR to absolute path to Smarty library files. * Sets SMARTY_DIR only if user application has not already defined it. */ if (!defined('SMARTY_DIR')) { - define('SMARTY_DIR', dirname(__FILE__) . DS); + define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR); } /** @@ -50,10 +43,10 @@ if (!defined('SMARTY_DIR')) { * Sets SMARTY_SYSPLUGINS_DIR only if user application has not already defined it. */ if (!defined('SMARTY_SYSPLUGINS_DIR')) { - define('SMARTY_SYSPLUGINS_DIR', SMARTY_DIR . 'sysplugins' . DS); + define('SMARTY_SYSPLUGINS_DIR', SMARTY_DIR . 'sysplugins' . DIRECTORY_SEPARATOR); } if (!defined('SMARTY_PLUGINS_DIR')) { - define('SMARTY_PLUGINS_DIR', SMARTY_DIR . 'plugins' . DS); + define('SMARTY_PLUGINS_DIR', SMARTY_DIR . 'plugins' . DIRECTORY_SEPARATOR); } if (!defined('SMARTY_MBSTRING')) { define('SMARTY_MBSTRING', function_exists('mb_get_info')); @@ -73,23 +66,16 @@ if (!defined('SMARTY_RESOURCE_DATE_FORMAT')) { } /** - * Try loading the Smarty_Internal_Data class - * If we fail we must load Smarty's autoloader. - * Otherwise we may have a global autoloader like Composer + * Load Smarty_Autoloader */ -if (!class_exists('Smarty_Autoloader', false)) { - if (!class_exists('Smarty_Internal_Data', true)) { - require_once dirname(__FILE__) . '/Autoloader.php'; - Smarty_Autoloader::registerBC(); - } +if (!class_exists('Smarty_Autoloader')) { + include __DIR__ . '/bootstrap.php'; } /** * Load always needed external class files */ -if (!class_exists('Smarty_Internal_Data', false)) { - require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_data.php'; -} +require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_data.php'; require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_extension_handler.php'; require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_templatebase.php'; require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_template.php'; @@ -97,17 +83,21 @@ require_once SMARTY_SYSPLUGINS_DIR . 'smarty_resource.php'; require_once SMARTY_SYSPLUGINS_DIR . 'smarty_variable.php'; require_once SMARTY_SYSPLUGINS_DIR . 'smarty_template_source.php'; require_once SMARTY_SYSPLUGINS_DIR . 'smarty_template_resource_base.php'; +require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_resource_file.php'; /** * This is the main Smarty class * * @package Smarty * + * The following methods will be dynamically loaded by the extension handler when they are called. + * They are located in a corresponding Smarty_Internal_Method_xxxx class + * * @method int clearAllCache(int $exp_time = null, string $type = null) * @method int clearCache(string $template_name, string $cache_id = null, string $compile_id = null, int $exp_time = null, string $type = null) - * @method int compileAllTemplates(Smarty $smarty, string $extension = '.tpl', bool $force_compile = false, int $time_limit = 0, int $max_errors = null) - * @method int compileAllConfig(Smarty $smarty, string $extension = '.conf', bool $force_compile = false, int $time_limit = 0, int $max_errors = null) - * + * @method int compileAllTemplates(string $extension = '.tpl', bool $force_compile = false, int $time_limit = 0, int $max_errors = null) + * @method int compileAllConfig(string $extension = '.conf', bool $force_compile = false, int $time_limit = 0, int $max_errors = null) + * @method int clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null) */ class Smarty extends Smarty_Internal_TemplateBase { @@ -118,12 +108,12 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.29'; + const SMARTY_VERSION = '3.1.31'; /** * define variable scopes */ - const SCOPE_LOCAL = 0; + const SCOPE_LOCAL = 1; const SCOPE_PARENT = 2; @@ -135,8 +125,6 @@ class Smarty extends Smarty_Internal_TemplateBase const SCOPE_GLOBAL = 32; - const SCOPE_BUBBLE_UP = 64; - /** * define caching modes */ @@ -206,6 +194,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * Resource caching modes + * (not used since 3.1.30) */ const RESOURCE_CACHE_OFF = 0; @@ -288,7 +277,21 @@ class Smarty extends Smarty_Internal_TemplateBase * * @var array */ - private $template_dir = array('./templates/'); + protected $template_dir = array('./templates/'); + + /** + * flags for normalized template directory entries + * + * @var array + */ + protected $_processedTemplateDir = array(); + + /** + * flag if template_dir is normalized + * + * @var bool + */ + public $_templateDirNormalized = false; /** * joined template directory string used in cache keys @@ -297,6 +300,27 @@ class Smarty extends Smarty_Internal_TemplateBase */ public $_joined_template_dir = null; + /** + * config directory + * + * @var array + */ + protected $config_dir = array('./configs/'); + + /** + * flags for normalized template directory entries + * + * @var array + */ + protected $_processedConfigDir = array(); + + /** + * flag if config_dir is normalized + * + * @var bool + */ + public $_configDirNormalized = false; + /** * joined config directory string used in cache keys * @@ -330,28 +354,42 @@ class Smarty extends Smarty_Internal_TemplateBase * * @var string */ - private $compile_dir = './templates_c/'; + protected $compile_dir = './templates_c/'; + + /** + * flag if template_dir is normalized + * + * @var bool + */ + public $_compileDirNormalized = false; /** * plugins directory * * @var array */ - private $plugins_dir = null; + protected $plugins_dir = array(); + + /** + * flag if plugins_dir is normalized + * + * @var bool + */ + public $_pluginsDirNormalized = false; /** * cache directory * * @var string */ - private $cache_dir = './cache/'; + protected $cache_dir = './cache/'; /** - * config directory + * flag if template_dir is normalized * - * @var array + * @var bool */ - private $config_dir = array('./configs/'); + public $_cacheDirNormalized = false; /** * force template compiling? @@ -388,6 +426,15 @@ class Smarty extends Smarty_Internal_TemplateBase */ public $merge_compiled_includes = false; + /* + * flag for behaviour when extends: resource and {extends} tag are used simultaneous + * if false disable execution of {extends} in templates called by extends resource. + * (behaviour as versions < 3.1.28) + * + * @var boolean + */ + public $extends_recursion = true; + /** * force cache file creation * @@ -562,13 +609,6 @@ class Smarty extends Smarty_Internal_TemplateBase */ public $default_config_type = 'file'; - /** - * enable resource caching - * - * @var bool - */ - public $resource_cache_mode = 1; - /** * check If-Modified-Since headers * @@ -674,23 +714,30 @@ class Smarty extends Smarty_Internal_TemplateBase */ public $_debug = null; + /** + * Directory separator + * + * @var string + */ + public $ds = DIRECTORY_SEPARATOR; + /** * removed properties * * @var string[] */ - private static $obsoleteProperties = array('resource_caching', 'template_resource_caching', - 'direct_access_security', '_dir_perms', '_file_perms', - 'plugin_search_order', 'inheritance_merge_compiled_includes'); + private $obsoleteProperties = array('resource_caching', 'template_resource_caching', 'direct_access_security', + '_dir_perms', '_file_perms', 'plugin_search_order', + 'inheritance_merge_compiled_includes', 'resource_cache_mode',); /** - * List of private properties which will call getter/setter ona direct access + * List of private properties which will call getter/setter on a direct access * - * @var array + * @var string[] */ - private static $accessMap = array('template_dir' => 'TemplateDir', 'config_dir' => 'ConfigDir', - 'plugins_dir' => 'PluginsDir', 'compile_dir' => 'CompileDir', - 'cache_dir' => 'CacheDir',); + private $accessMap = array('template_dir' => 'TemplateDir', 'config_dir' => 'ConfigDir', + 'plugins_dir' => 'PluginsDir', 'compile_dir' => 'CompileDir', + 'cache_dir' => 'CacheDir',); /**#@-*/ @@ -699,19 +746,19 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function __construct() { + $this->_clearTemplateCache(); parent::__construct(); if (is_callable('mb_internal_encoding')) { mb_internal_encoding(Smarty::$_CHARSET); } $this->start_time = microtime(true); - if (isset($_SERVER['SCRIPT_NAME'])) { - Smarty::$global_tpl_vars['SCRIPT_NAME'] = new Smarty_Variable($_SERVER['SCRIPT_NAME']); + if (isset($_SERVER[ 'SCRIPT_NAME' ])) { + Smarty::$global_tpl_vars[ 'SCRIPT_NAME' ] = new Smarty_Variable($_SERVER[ 'SCRIPT_NAME' ]); } // Check if we're running on windows Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN'; - // let PCRE (preg_*) treat strings as ISO-8859-1 if we're not dealing with UTF-8 if (Smarty::$_CHARSET !== 'UTF-8') { Smarty::$_UTF8_MODIFIER = ''; @@ -732,31 +779,6 @@ class Smarty extends Smarty_Internal_TemplateBase return $source->exists; } - /** - * Returns a single or all global variables - * - * @param string $varname variable name or null - * - * @return string variable value or or array of variables - */ - public function getGlobal($varname = null) - { - if (isset($varname)) { - if (isset(self::$global_tpl_vars[$varname])) { - return self::$global_tpl_vars[$varname]->value; - } else { - return ''; - } - } else { - $_result = array(); - foreach (self::$global_tpl_vars AS $key => $var) { - $_result[$key] = $var->value; - } - - return $_result; - } - } - /** * Loads security class and enables security * @@ -793,12 +815,14 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function setTemplateDir($template_dir, $isConfig = false) { - $type = $isConfig ? 'config_dir' : 'template_dir'; - $joined = '_joined_' . $type; - $this->{$type} = (array) $template_dir; - $this->{$joined} = join(' # ', $this->{$type}); - $this->_cache[$type . '_new'] = true; - $this->_cache[$type] = false; + if ($isConfig) { + $this->config_dir = array(); + $this->_processedConfigDir = array(); + } else { + $this->template_dir = array(); + $this->_processedTemplateDir = array(); + } + $this->addTemplateDir($template_dir, null, $isConfig); return $this; } @@ -813,16 +837,36 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function addTemplateDir($template_dir, $key = null, $isConfig = false) { - $type = $isConfig ? 'config_dir' : 'template_dir'; - $joined = '_joined_' . $type; - if (!isset($this->_cache[$type])) { - $this->{$type} = (array) $this->{$type}; - $this->{$joined} = join(' # ', $this->{$type}); - $this->_cache[$type . '_new'] = true; - $this->_cache[$type] = false; + if ($isConfig) { + $processed = &$this->_processedConfigDir; + $dir = &$this->config_dir; + $this->_configDirNormalized = false; + } else { + $processed = &$this->_processedTemplateDir; + $dir = &$this->template_dir; + $this->_templateDirNormalized = false; + } + if (is_array($template_dir)) { + foreach ($template_dir as $k => $v) { + if (is_int($k)) { + // indexes are not merged but appended + $dir[] = $v; + } else { + // string indexes are overridden + $dir[ $k ] = $v; + unset($processed[ $key ]); + } + } + } else { + if ($key !== null) { + // override directory at specified index + $dir[ $key ] = $template_dir; + unset($processed[ $key ]); + } else { + // append new directory + $dir[] = $template_dir; + } } - $this->{$joined} .= ' # ' . join(' # ', (array) $template_dir); - $this->_addDir($type, $template_dir, $key); return $this; } @@ -836,24 +880,18 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function getTemplateDir($index = null, $isConfig = false) { - $type = $isConfig ? 'config_dir' : 'template_dir'; - if (!isset($this->_cache[$type])) { - $joined = '_joined_' . $type; - $this->{$type} = (array) $this->{$type}; - $this->{$joined} = join(' # ', $this->{$type}); - $this->_cache[$type] = false; + if ($isConfig) { + $dir = &$this->config_dir; + } else { + $dir = &$this->template_dir; } - if ($this->_cache[$type] == false) { - foreach ($this->{$type} as $k => $v) { - $this->{$type}[$k] = $this->_realpath($v . DS, true); - } - $this->_cache[$type . '_new'] = true; - $this->_cache[$type] = true; + if ($isConfig ? !$this->_configDirNormalized : !$this->_templateDirNormalized) { + $this->_nomalizeTemplateConfig($isConfig); } if ($index !== null) { - return isset($this->{$type}[$index]) ? $this->{$type}[$index] : null; + return isset($dir[ $index ]) ? $dir[ $index ] : null; } - return $this->{$type}; + return $dir; } /** @@ -903,28 +941,24 @@ class Smarty extends Smarty_Internal_TemplateBase public function setPluginsDir($plugins_dir) { $this->plugins_dir = (array) $plugins_dir; - if (isset($this->_cache['plugins_dir'])) { - unset($this->_cache['plugins_dir']); - } + $this->_pluginsDirNormalized = false; return $this; } /** * Adds directory of plugin files * - * @param $plugins_dir + * @param null|array $plugins_dir * * @return Smarty current Smarty instance for chaining */ public function addPluginsDir($plugins_dir) { - if (!isset($this->plugins_dir)) { - $this->plugins_dir = array(SMARTY_PLUGINS_DIR); - } - $this->plugins_dir = array_merge((array) $this->plugins_dir, (array) $plugins_dir); - if (isset($this->_cache['plugins_dir'])) { - unset($this->_cache['plugins_dir']); + if (empty($this->plugins_dir)) { + $this->plugins_dir[] = SMARTY_PLUGINS_DIR; } + $this->plugins_dir = array_merge($this->plugins_dir, (array) $plugins_dir); + $this->_pluginsDirNormalized = false; return $this; } @@ -935,25 +969,24 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function getPluginsDir() { - if (!isset($this->_cache['plugins_dir'])) { - if (!isset($this->plugins_dir)) { - $this->plugins_dir = array(SMARTY_PLUGINS_DIR); - } else { - $plugins_dir = (array) $this->plugins_dir; - $this->plugins_dir = array(); - foreach ($plugins_dir as $v) { - $this->plugins_dir[] = $this->_realpath($v . DS, true); - } - $this->plugins_dir = array_unique($this->plugins_dir); + if (empty($this->plugins_dir)) { + $this->plugins_dir[] = SMARTY_PLUGINS_DIR; + $this->_pluginsDirNormalized = false; + } + if (!$this->_pluginsDirNormalized) { + if (!is_array($this->plugins_dir)) { + $this->plugins_dir = (array) $this->plugins_dir; } - $this->_cache['plugin_files'] = array(); - $this->_cache['plugins_dir'] = true; + foreach ($this->plugins_dir as $k => $v) { + $this->plugins_dir[ $k ] = $this->_realpath(rtrim($v, "/\\") . $this->ds, true); + } + $this->_cache[ 'plugin_files' ] = array(); + $this->_pluginsDirNormalized = true; } return $this->plugins_dir; } /** - * Set compile directory * * @param string $compile_dir directory to store compiled templates in * @@ -961,11 +994,8 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function setCompileDir($compile_dir) { - $this->compile_dir = $this->_realpath($compile_dir . DS, true); - if (!isset(Smarty::$_muted_directories[$this->compile_dir])) { - Smarty::$_muted_directories[$this->compile_dir] = null; - } - $this->_cache['compile_dir'] = true; + $this->_normalizeDir('compile_dir', $compile_dir); + $this->_compileDirNormalized = true; return $this; } @@ -976,12 +1006,9 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function getCompileDir() { - if (!isset($this->_cache['compile_dir'])) { - $this->compile_dir = $this->_realpath($this->compile_dir . DS, true); - if (!isset(Smarty::$_muted_directories[$this->compile_dir])) { - Smarty::$_muted_directories[$this->compile_dir] = null; - } - $this->_cache['compile_dir'] = true; + if (!$this->_compileDirNormalized) { + $this->_normalizeDir('compile_dir', $this->compile_dir); + $this->_compileDirNormalized = true; } return $this->compile_dir; } @@ -995,11 +1022,8 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function setCacheDir($cache_dir) { - $this->cache_dir = $this->_realpath($cache_dir . DS, true); - if (!isset(Smarty::$_muted_directories[$this->cache_dir])) { - Smarty::$_muted_directories[$this->cache_dir] = null; - } - $this->_cache['cache_dir'] = true; + $this->_normalizeDir('cache_dir', $cache_dir); + $this->_cacheDirNormalized = true; return $this; } @@ -1010,47 +1034,54 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function getCacheDir() { - if (!isset($this->_cache['cache_dir'])) { - $this->cache_dir = $this->_realpath($this->cache_dir . DS, true); - if (!isset(Smarty::$_muted_directories[$this->cache_dir])) { - Smarty::$_muted_directories[$this->cache_dir] = null; - } - $this->_cache['cache_dir'] = true; + if (!$this->_cacheDirNormalized) { + $this->_normalizeDir('cache_dir', $this->cache_dir); + $this->_cacheDirNormalized = true; } return $this->cache_dir; } /** - * add directories to given property name + * Normalize and set directory string * - * @param string $dirName directory property name - * @param string|array $dir directory string or array of strings - * @param mixed $key optional key + * @param string $dirName cache_dir or compile_dir + * @param string $dir filepath of folder */ - private function _addDir($dirName, $dir, $key = null) + private function _normalizeDir($dirName, $dir) { - $rp = $this->_cache[$dirName]; - if (is_array($dir)) { - foreach ($dir as $k => $v) { - $path = $rp ? $this->_realpath($v . DS, true) : $v; - if (is_int($k)) { - // indexes are not merged but appended - $this->{$dirName}[] = $path; - } else { - // string indexes are overridden - $this->{$dirName}[$k] = $path; - } - } + $this->{$dirName} = $this->_realpath(rtrim($dir, "/\\") . $this->ds, true); + if (!isset(Smarty::$_muted_directories[ $this->{$dirName} ])) { + Smarty::$_muted_directories[ $this->{$dirName} ] = null; + } + } + + /** + * Normalize template_dir or config_dir + * + * @param bool $isConfig true for config_dir + * + */ + private function _nomalizeTemplateConfig($isConfig) + { + if ($isConfig) { + $processed = &$this->_processedConfigDir; + $dir = &$this->config_dir; } else { - $path = $rp ? $this->_realpath($dir . DS, true) : $dir; - if ($key !== null) { - // override directory at specified index - $this->{$dirName}[$key] = $path; - } else { - // append new directory - $this->{$dirName}[] = $path; + $processed = &$this->_processedTemplateDir; + $dir = &$this->template_dir; + } + if (!is_array($dir)) { + $dir = (array) $dir; + } + foreach ($dir as $k => $v) { + if (!isset($processed[ $k ])) { + $dir[ $k ] = $v = $this->_realpath(rtrim($v, "/\\") . $this->ds, true); + $processed[ $k ] = true; } } + $isConfig ? $this->_configDirNormalized = true : $this->_templateDirNormalized = true; + $isConfig ? $this->_joined_config_dir = join('#', $this->config_dir) : + $this->_joined_template_dir = join('#', $this->template_dir); } /** @@ -1076,27 +1107,34 @@ class Smarty extends Smarty_Internal_TemplateBase } else { $data = null; } - if ($this->caching && - isset($this->_cache['isCached'][$_templateId = $this->_getTemplateId($template, $cache_id, $compile_id)]) - ) { - $tpl = $do_clone ? clone $this->_cache['isCached'][$_templateId] : $this->_cache['isCached'][$_templateId]; - $tpl->parent = $parent; - $tpl->tpl_vars = array(); - $tpl->config_vars = array(); + if (!$this->_templateDirNormalized) { + $this->_nomalizeTemplateConfig(false); + } + $_templateId = $this->_getTemplateId($template, $cache_id, $compile_id); + $tpl = null; + if ($this->caching && isset(Smarty_Internal_Template::$isCacheTplObj[ $_templateId ])) { + $tpl = $do_clone ? clone Smarty_Internal_Template::$isCacheTplObj[ $_templateId ] : + Smarty_Internal_Template::$isCacheTplObj[ $_templateId ]; + $tpl->inheritance = null; + $tpl->tpl_vars = $tpl->config_vars = array(); + } else if (!$do_clone && isset(Smarty_Internal_Template::$tplObjCache[ $_templateId ])) { + $tpl = clone Smarty_Internal_Template::$tplObjCache[ $_templateId ]; + $tpl->inheritance = null; + $tpl->tpl_vars = $tpl->config_vars = array(); } else { /* @var Smarty_Internal_Template $tpl */ - $tpl = new $this->template_class($template, $this, $parent, $cache_id, $compile_id, null, null); + $tpl = new $this->template_class($template, $this, null, $cache_id, $compile_id, null, null); + $tpl->templateId = $_templateId; } if ($do_clone) { $tpl->smarty = clone $tpl->smarty; - } elseif ($parent === null) { - $tpl->parent = $this; } + $tpl->parent = $parent ? $parent : $this; // fill data if present if (!empty($data) && is_array($data)) { // set up variable values foreach ($data as $_key => $_val) { - $tpl->tpl_vars[$_key] = new Smarty_Variable($_val); + $tpl->tpl_vars[ $_key ] = new Smarty_Variable($_val); } } if ($this->debugging || $this->debugging_ctrl == 'URL') { @@ -1128,26 +1166,31 @@ class Smarty extends Smarty_Internal_TemplateBase /** * Get unique template id * - * @param string $template_name - * @param null|mixed $cache_id - * @param null|mixed $compile_id - * @param null $caching + * @param string $template_name + * @param null|mixed $cache_id + * @param null|mixed $compile_id + * @param null $caching + * @param \Smarty_Internal_Template $template * * @return string */ - public function _getTemplateId($template_name, $cache_id = null, $compile_id = null, $caching = null) + public function _getTemplateId($template_name, $cache_id = null, $compile_id = null, $caching = null, + Smarty_Internal_Template $template = null) { + $template_name = (strpos($template_name, ':') === false) ? "{$this->default_resource_type}:{$template_name}" : + $template_name; $cache_id = $cache_id === null ? $this->cache_id : $cache_id; $compile_id = $compile_id === null ? $this->compile_id : $compile_id; $caching = (int) ($caching === null ? $this->caching : $caching); - if ($this->allow_ambiguous_resources) { + if ((isset($template) && strpos($template_name, ':.') !== false) || $this->allow_ambiguous_resources) { $_templateId = - Smarty_Resource::getUniqueTemplateName($this, $template_name) . "#{$cache_id}#{$compile_id}#{$caching}"; + Smarty_Resource::getUniqueTemplateName((isset($template) ? $template : $this), $template_name) . + "#{$cache_id}#{$compile_id}#{$caching}"; } else { $_templateId = $this->_joined_template_dir . "#{$template_name}#{$cache_id}#{$compile_id}#{$caching}"; } - if (isset($_templateId[150])) { + if (isset($_templateId[ 150 ])) { $_templateId = sha1($_templateId); } return $_templateId; @@ -1158,36 +1201,66 @@ class Smarty extends Smarty_Internal_TemplateBase * - remove /./ and /../ * - make it absolute if required * - * @param string $path file path - * @param bool $realpath leave $path relative + * @param string $path file path + * @param bool $realpath if true - convert to absolute + * false - convert to relative + * null - keep as it is but remove /./ /../ * * @return string */ public function _realpath($path, $realpath = null) { - static $pattern = null; - static $nds = null; - if ($pattern == null) { - $nds = DS == '/' ? '\\' : '/'; - $ds = '\\' . DS; - $pattern = - "#([{$ds}]+[^{$ds}]+[{$ds}]+[.]([{$ds}]+[.])*[.][{$ds}]+([.][{$ds}]+)*)|([{$ds}]+([.][{$ds}]+)+)|[{$ds}]{2,}#"; + $nds = $this->ds == '/' ? '\\' : '/'; + // normalize $this->ds + $path = str_replace($nds, $this->ds, $path); + preg_match('%^(?(?:[[:alpha:]]:[\\\\]|/|[\\\\]{2}[[:alpha:]]+|[[:print:]]{2,}:[/]{2}|[\\\\])?)(?(?:[[:print:]]*))$%', + $path, $parts); + $path = $parts[ 'path' ]; + if ($parts[ 'root' ] == '\\') { + $parts[ 'root' ] = substr(getcwd(), 0, 2) . $parts[ 'root' ]; + } else { + if ($realpath !== null && !$parts[ 'root' ]) { + $path = getcwd() . $this->ds . $path; + } } - // normalize DS - if (strpos($path, $nds) !== false) { - $path = str_replace($nds, DS, $path); + // remove noop 'DIRECTORY_SEPARATOR DIRECTORY_SEPARATOR' and 'DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR' patterns + $path = preg_replace('#([\\\\/]([.]?[\\\\/])+)#', $this->ds, $path); + // resolve '..DIRECTORY_SEPARATOR' pattern, smallest first + if (strpos($path, '..' . $this->ds) != false && + preg_match_all('#(([.]?[\\\\/])*([.][.])[\\\\/]([.]?[\\\\/])*)+#', $path, $match) + ) { + $counts = array(); + foreach ($match[ 0 ] as $m) { + $counts[] = (int) ((strlen($m) - 1) / 3); + } + sort($counts); + foreach ($counts as $count) { + $path = preg_replace('#(([\\\\/]([.]?[\\\\/])*[^\\\\/.]+){' . $count . + '}[\\\\/]([.]?[\\\\/])*([.][.][\\\\/]([.]?[\\\\/])*){' . $count . '})(?=[^.])#', + $this->ds, $path); + } } - if ($realpath === true && (($path[0] !== '/' && DS == '/') || ($path[1] !== ':' && DS != '/'))) { - $path = getcwd() . DS . $path; - } - while ((strpos($path, '.' . DS) !== false) || (strpos($path, DS . DS) !== false)) { - $path = preg_replace($pattern, DS, $path); - } - if ($realpath === false && ($path[0] == '/' || $path[1] == ':')) { - $path = str_ireplace(getcwd(), '.', $path); - } - return $path; + return $parts[ 'root' ] . $path; + } + + /** + * Empty template objects cache + */ + public function _clearTemplateCache() + { + Smarty_Internal_Template::$isCacheTplObj = array(); + Smarty_Internal_Template::$tplObjCache = array(); + } + + /** + * Get Smarty object + * + * @return Smarty + */ + public function _getSmartyObj() + { + return $this; } /** @@ -1328,14 +1401,6 @@ class Smarty extends Smarty_Internal_TemplateBase Smarty_Internal_TestInstall::testInstall($this, $errors); } - /** - * Class destructor - */ - public function __destruct() - { - $i = 0;// intentionally left blank - } - /** * <> Generic getter. * Calls the appropriate getter function. @@ -1347,15 +1412,17 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function __get($name) { - - if (isset(self::$accessMap[$name])) { - $method = 'get' . self::$accessMap[$name]; + if (isset($this->accessMap[ $name ])) { + $method = 'get' . $this->accessMap[ $name ]; return $this->{$method}(); - } elseif (in_array($name, self::$obsoleteProperties)) { + } elseif (isset($this->_cache[ $name ])) { + return $this->_cache[ $name ]; + } elseif (in_array($name, $this->obsoleteProperties)) { return null; } else { trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE); } + return null; } /** @@ -1368,10 +1435,10 @@ class Smarty extends Smarty_Internal_TemplateBase */ public function __set($name, $value) { - if (isset(self::$accessMap[$name])) { - $method = 'set' . self::$accessMap[$name]; + if (isset($this->accessMap[ $name ])) { + $method = 'set' . $this->accessMap[ $name ]; $this->{$method}($value); - } elseif (in_array($name, self::$obsoleteProperties)) { + } elseif (in_array($name, $this->obsoleteProperties)) { return; } else { if (is_object($value) && method_exists($value, $name)) { @@ -1393,17 +1460,17 @@ class Smarty extends Smarty_Internal_TemplateBase * @param $errline * @param $errcontext * - * @return boolean + * @return bool|void */ public static function mutingErrorHandler($errno, $errstr, $errfile, $errline, $errcontext) { $_is_muted_directory = false; // add the SMARTY_DIR to the list of muted directories - if (!isset(Smarty::$_muted_directories[SMARTY_DIR])) { + if (!isset(Smarty::$_muted_directories[ SMARTY_DIR ])) { $smarty_dir = realpath(SMARTY_DIR); if ($smarty_dir !== false) { - Smarty::$_muted_directories[SMARTY_DIR] = + Smarty::$_muted_directories[ SMARTY_DIR ] = array('file' => $smarty_dir, 'length' => strlen($smarty_dir),); } } @@ -1415,17 +1482,16 @@ class Smarty extends Smarty_Internal_TemplateBase $file = realpath($key); if ($file === false) { // this directory does not exist, remove and skip it - unset(Smarty::$_muted_directories[$key]); + unset(Smarty::$_muted_directories[ $key ]); continue; } $dir = array('file' => $file, 'length' => strlen($file),); } - if (!strncmp($errfile, $dir['file'], $dir['length'])) { + if (!strncmp($errfile, $dir[ 'file' ], $dir[ 'length' ])) { $_is_muted_directory = true; break; } } - // pass to next error handler if this error did not occur inside SMARTY_DIR // or the error was within smarty but masked to be ignored if (!$_is_muted_directory || ($errno && $errno & error_reporting())) { @@ -1436,6 +1502,7 @@ class Smarty extends Smarty_Internal_TemplateBase return false; } } + return; } /** diff --git a/library/Smarty/libs/SmartyBC.class.php b/vendor/smarty/smarty/libs/SmartyBC.class.php similarity index 94% rename from library/Smarty/libs/SmartyBC.class.php rename to vendor/smarty/smarty/libs/SmartyBC.class.php index 1dd529c9c..3955e4f24 100644 --- a/library/Smarty/libs/SmartyBC.class.php +++ b/vendor/smarty/smarty/libs/SmartyBC.class.php @@ -31,7 +31,7 @@ require_once(dirname(__FILE__) . '/Smarty.class.php'); /** - * Smarty Backward Compatability Wrapper Class + * Smarty Backward Compatibility Wrapper Class * * @package Smarty */ @@ -54,11 +54,10 @@ class SmartyBC extends Smarty /** * Initialize new SmartyBC object * - * @param array $options options to set during initialization, e.g. array( 'forceCompile' => false ) */ - public function __construct(array $options = array()) + public function __construct() { - parent::__construct($options); + parent::__construct(); } /** @@ -108,7 +107,7 @@ class SmartyBC extends Smarty } /** - * Unregisters custom function + * Unregister custom function * * @param string $function name of template function */ @@ -129,7 +128,8 @@ class SmartyBC extends Smarty * @throws SmartyException * @internal param array $block_functs list of methods that are block format */ - public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true, $block_methods = array()) + public function register_object($object, $object_impl, $allowed = array(), $smarty_args = true, + $block_methods = array()) { settype($allowed, 'array'); settype($smarty_args, 'boolean'); @@ -137,7 +137,7 @@ class SmartyBC extends Smarty } /** - * Unregisters object + * Unregister object * * @param string $object name of template object */ @@ -160,7 +160,7 @@ class SmartyBC extends Smarty } /** - * Unregisters block function + * Unregister block function * * @param string $block name of template function */ @@ -182,7 +182,7 @@ class SmartyBC extends Smarty } /** - * Unregisters compiler function + * Unregister compiler function * * @param string $function name of template function */ @@ -203,7 +203,7 @@ class SmartyBC extends Smarty } /** - * Unregisters modifier + * Unregister modifier * * @param string $modifier name of template modifier */ @@ -224,7 +224,7 @@ class SmartyBC extends Smarty } /** - * Unregisters a resource + * Unregister a resource * * @param string $type name of resource */ @@ -245,7 +245,7 @@ class SmartyBC extends Smarty } /** - * Unregisters a prefilter function + * Unregister a prefilter function * * @param callable $function */ @@ -266,7 +266,7 @@ class SmartyBC extends Smarty } /** - * Unregisters a postfilter function + * Unregister a postfilter function * * @param callable $function */ @@ -287,7 +287,7 @@ class SmartyBC extends Smarty } /** - * Unregisters an outputfilter function + * Unregister an outputfilter function * * @param callable $function */ diff --git a/vendor/smarty/smarty/libs/bootstrap.php b/vendor/smarty/smarty/libs/bootstrap.php new file mode 100644 index 000000000..32096087f --- /dev/null +++ b/vendor/smarty/smarty/libs/bootstrap.php @@ -0,0 +1,17 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +/* + * Load and register Smarty Autoloader + */ +if (!class_exists('Smarty_Autoloader')) { + require __DIR__ . '/Autoloader.php'; +} +Smarty_Autoloader::register(); diff --git a/library/Smarty/libs/debug.tpl b/vendor/smarty/smarty/libs/debug.tpl similarity index 100% rename from library/Smarty/libs/debug.tpl rename to vendor/smarty/smarty/libs/debug.tpl diff --git a/library/Smarty/libs/plugins/block.textformat.php b/vendor/smarty/smarty/libs/plugins/block.textformat.php similarity index 90% rename from library/Smarty/libs/plugins/block.textformat.php rename to vendor/smarty/smarty/libs/plugins/block.textformat.php index abf544939..e2c5e3de4 100644 --- a/library/Smarty/libs/plugins/block.textformat.php +++ b/vendor/smarty/smarty/libs/plugins/block.textformat.php @@ -38,6 +38,9 @@ function smarty_block_textformat($params, $content, $template, &$repeat) if (is_null($content)) { return; } + if (Smarty::$_MBSTRING && !is_callable('smarty_mb_wordwrap')) { + require_once(SMARTY_PLUGINS_DIR . 'shared.mb_wordwrap.php'); + } $style = null; $indent = 0; @@ -83,14 +86,15 @@ function smarty_block_textformat($params, $content, $template, &$repeat) continue; } // convert mult. spaces & special chars to single space - $_paragraph = preg_replace(array('!\s+!' . Smarty::$_UTF8_MODIFIER, '!(^\s+)|(\s+$)!' . Smarty::$_UTF8_MODIFIER), array(' ', ''), $_paragraph); + $_paragraph = + preg_replace(array('!\s+!' . Smarty::$_UTF8_MODIFIER, '!(^\s+)|(\s+$)!' . Smarty::$_UTF8_MODIFIER), + array(' ', ''), $_paragraph); // indent first line if ($indent_first > 0) { $_paragraph = str_repeat($indent_char, $indent_first) . $_paragraph; } // wordwrap sentences if (Smarty::$_MBSTRING) { - require_once(SMARTY_PLUGINS_DIR . 'shared.mb_wordwrap.php'); $_paragraph = smarty_mb_wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut); } else { $_paragraph = wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut); diff --git a/vendor/smarty/smarty/libs/plugins/function.counter.php b/vendor/smarty/smarty/libs/plugins/function.counter.php new file mode 100644 index 000000000..bcc8f498c --- /dev/null +++ b/vendor/smarty/smarty/libs/plugins/function.counter.php @@ -0,0 +1,73 @@ + + * Name: counter
      + * Purpose: print out a counter value + * + * @author Monte Ohrt + * @link http://www.smarty.net/manual/en/language.function.counter.php {counter} + * (Smarty online manual) + * + * @param array $params parameters + * @param Smarty_Internal_Template $template template object + * + * @return string|null + */ +function smarty_function_counter($params, $template) +{ + static $counters = array(); + + $name = (isset($params[ 'name' ])) ? $params[ 'name' ] : 'default'; + if (!isset($counters[ $name ])) { + $counters[ $name ] = array('start' => 1, 'skip' => 1, 'direction' => 'up', 'count' => 1); + } + $counter =& $counters[ $name ]; + + if (isset($params[ 'start' ])) { + $counter[ 'start' ] = $counter[ 'count' ] = (int) $params[ 'start' ]; + } + + if (!empty($params[ 'assign' ])) { + $counter[ 'assign' ] = $params[ 'assign' ]; + } + + if (isset($counter[ 'assign' ])) { + $template->assign($counter[ 'assign' ], $counter[ 'count' ]); + } + + if (isset($params[ 'print' ])) { + $print = (bool) $params[ 'print' ]; + } else { + $print = empty($counter[ 'assign' ]); + } + + if ($print) { + $retval = $counter[ 'count' ]; + } else { + $retval = null; + } + + if (isset($params[ 'skip' ])) { + $counter[ 'skip' ] = $params[ 'skip' ]; + } + + if (isset($params[ 'direction' ])) { + $counter[ 'direction' ] = $params[ 'direction' ]; + } + + if ($counter[ 'direction' ] == "down") { + $counter[ 'count' ] -= $counter[ 'skip' ]; + } else { + $counter[ 'count' ] += $counter[ 'skip' ]; + } + + return $retval; +} diff --git a/library/Smarty/libs/plugins/function.cycle.php b/vendor/smarty/smarty/libs/plugins/function.cycle.php similarity index 54% rename from library/Smarty/libs/plugins/function.cycle.php rename to vendor/smarty/smarty/libs/plugins/function.cycle.php index 8dc5cd9d5..a76d49aed 100644 --- a/library/Smarty/libs/plugins/function.cycle.php +++ b/vendor/smarty/smarty/libs/plugins/function.cycle.php @@ -48,58 +48,56 @@ function smarty_function_cycle($params, $template) { static $cycle_vars; - $name = (empty($params['name'])) ? 'default' : $params['name']; - $print = (isset($params['print'])) ? (bool) $params['print'] : true; - $advance = (isset($params['advance'])) ? (bool) $params['advance'] : true; - $reset = (isset($params['reset'])) ? (bool) $params['reset'] : false; + $name = (empty($params[ 'name' ])) ? 'default' : $params[ 'name' ]; + $print = (isset($params[ 'print' ])) ? (bool) $params[ 'print' ] : true; + $advance = (isset($params[ 'advance' ])) ? (bool) $params[ 'advance' ] : true; + $reset = (isset($params[ 'reset' ])) ? (bool) $params[ 'reset' ] : false; - if (!isset($params['values'])) { - if (!isset($cycle_vars[$name]['values'])) { + if (!isset($params[ 'values' ])) { + if (!isset($cycle_vars[ $name ][ 'values' ])) { trigger_error("cycle: missing 'values' parameter"); return; } } else { - if (isset($cycle_vars[$name]['values']) - && $cycle_vars[$name]['values'] != $params['values'] - ) { - $cycle_vars[$name]['index'] = 0; + if (isset($cycle_vars[ $name ][ 'values' ]) && $cycle_vars[ $name ][ 'values' ] != $params[ 'values' ]) { + $cycle_vars[ $name ][ 'index' ] = 0; } - $cycle_vars[$name]['values'] = $params['values']; + $cycle_vars[ $name ][ 'values' ] = $params[ 'values' ]; } - if (isset($params['delimiter'])) { - $cycle_vars[$name]['delimiter'] = $params['delimiter']; - } elseif (!isset($cycle_vars[$name]['delimiter'])) { - $cycle_vars[$name]['delimiter'] = ','; + if (isset($params[ 'delimiter' ])) { + $cycle_vars[ $name ][ 'delimiter' ] = $params[ 'delimiter' ]; + } elseif (!isset($cycle_vars[ $name ][ 'delimiter' ])) { + $cycle_vars[ $name ][ 'delimiter' ] = ','; } - if (is_array($cycle_vars[$name]['values'])) { - $cycle_array = $cycle_vars[$name]['values']; + if (is_array($cycle_vars[ $name ][ 'values' ])) { + $cycle_array = $cycle_vars[ $name ][ 'values' ]; } else { - $cycle_array = explode($cycle_vars[$name]['delimiter'], $cycle_vars[$name]['values']); + $cycle_array = explode($cycle_vars[ $name ][ 'delimiter' ], $cycle_vars[ $name ][ 'values' ]); } - if (!isset($cycle_vars[$name]['index']) || $reset) { - $cycle_vars[$name]['index'] = 0; + if (!isset($cycle_vars[ $name ][ 'index' ]) || $reset) { + $cycle_vars[ $name ][ 'index' ] = 0; } - if (isset($params['assign'])) { + if (isset($params[ 'assign' ])) { $print = false; - $template->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]); + $template->assign($params[ 'assign' ], $cycle_array[ $cycle_vars[ $name ][ 'index' ] ]); } if ($print) { - $retval = $cycle_array[$cycle_vars[$name]['index']]; + $retval = $cycle_array[ $cycle_vars[ $name ][ 'index' ] ]; } else { $retval = null; } if ($advance) { - if ($cycle_vars[$name]['index'] >= count($cycle_array) - 1) { - $cycle_vars[$name]['index'] = 0; + if ($cycle_vars[ $name ][ 'index' ] >= count($cycle_array) - 1) { + $cycle_vars[ $name ][ 'index' ] = 0; } else { - $cycle_vars[$name]['index'] ++; + $cycle_vars[ $name ][ 'index' ] ++; } } diff --git a/library/Smarty/libs/plugins/function.fetch.php b/vendor/smarty/smarty/libs/plugins/function.fetch.php similarity index 83% rename from library/Smarty/libs/plugins/function.fetch.php rename to vendor/smarty/smarty/libs/plugins/function.fetch.php index 3506d4a8d..cb60dd918 100644 --- a/library/Smarty/libs/plugins/function.fetch.php +++ b/vendor/smarty/smarty/libs/plugins/function.fetch.php @@ -24,31 +24,31 @@ */ function smarty_function_fetch($params, $template) { - if (empty($params['file'])) { + if (empty($params[ 'file' ])) { trigger_error("[plugin] fetch parameter 'file' cannot be empty", E_USER_NOTICE); return; } // strip file protocol - if (stripos($params['file'], 'file://') === 0) { - $params['file'] = substr($params['file'], 7); + if (stripos($params[ 'file' ], 'file://') === 0) { + $params[ 'file' ] = substr($params[ 'file' ], 7); } - $protocol = strpos($params['file'], '://'); + $protocol = strpos($params[ 'file' ], '://'); if ($protocol !== false) { - $protocol = strtolower(substr($params['file'], 0, $protocol)); + $protocol = strtolower(substr($params[ 'file' ], 0, $protocol)); } if (isset($template->smarty->security_policy)) { if ($protocol) { // remote resource (or php stream, …) - if (!$template->smarty->security_policy->isTrustedUri($params['file'])) { + if (!$template->smarty->security_policy->isTrustedUri($params[ 'file' ])) { return; } } else { // local file - if (!$template->smarty->security_policy->isTrustedResourceDir($params['file'])) { + if (!$template->smarty->security_policy->isTrustedResourceDir($params[ 'file' ])) { return; } } @@ -57,26 +57,26 @@ function smarty_function_fetch($params, $template) $content = ''; if ($protocol == 'http') { // http fetch - if ($uri_parts = parse_url($params['file'])) { + if ($uri_parts = parse_url($params[ 'file' ])) { // set defaults - $host = $server_name = $uri_parts['host']; + $host = $server_name = $uri_parts[ 'host' ]; $timeout = 30; $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*"; $agent = "Smarty Template Engine " . Smarty::SMARTY_VERSION; $referer = ""; - $uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/'; - $uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : ''; + $uri = !empty($uri_parts[ 'path' ]) ? $uri_parts[ 'path' ] : '/'; + $uri .= !empty($uri_parts[ 'query' ]) ? '?' . $uri_parts[ 'query' ] : ''; $_is_proxy = false; - if (empty($uri_parts['port'])) { + if (empty($uri_parts[ 'port' ])) { $port = 80; } else { - $port = $uri_parts['port']; + $port = $uri_parts[ 'port' ]; } - if (!empty($uri_parts['user'])) { - $user = $uri_parts['user']; + if (!empty($uri_parts[ 'user' ])) { + $user = $uri_parts[ 'user' ]; } - if (!empty($uri_parts['pass'])) { - $pass = $uri_parts['pass']; + if (!empty($uri_parts[ 'pass' ])) { + $pass = $uri_parts[ 'pass' ]; } // loop through parameters, setup headers foreach ($params as $param_key => $param_value) { @@ -163,7 +163,7 @@ function smarty_function_fetch($params, $template) return; } else { if ($_is_proxy) { - fputs($fp, 'GET ' . $params['file'] . " HTTP/1.0\r\n"); + fputs($fp, 'GET ' . $params[ 'file' ] . " HTTP/1.0\r\n"); } else { fputs($fp, "GET $uri HTTP/1.0\r\n"); } @@ -195,10 +195,10 @@ function smarty_function_fetch($params, $template) fclose($fp); $csplit = preg_split("!\r\n\r\n!", $content, 2); - $content = $csplit[1]; + $content = $csplit[ 1 ]; - if (!empty($params['assign_headers'])) { - $template->assign($params['assign_headers'], preg_split("!\r\n!", $csplit[0])); + if (!empty($params[ 'assign_headers' ])) { + $template->assign($params[ 'assign_headers' ], preg_split("!\r\n!", $csplit[ 0 ])); } } } else { @@ -207,14 +207,14 @@ function smarty_function_fetch($params, $template) return; } } else { - $content = @file_get_contents($params['file']); + $content = @file_get_contents($params[ 'file' ]); if ($content === false) { - throw new SmartyException("{fetch} cannot read resource '" . $params['file'] . "'"); + throw new SmartyException("{fetch} cannot read resource '" . $params[ 'file' ] . "'"); } } - if (!empty($params['assign'])) { - $template->assign($params['assign'], $content); + if (!empty($params[ 'assign' ])) { + $template->assign($params[ 'assign' ], $content); } else { return $content; } diff --git a/library/Smarty/libs/plugins/function.html_checkboxes.php b/vendor/smarty/smarty/libs/plugins/function.html_checkboxes.php similarity index 78% rename from library/Smarty/libs/plugins/function.html_checkboxes.php rename to vendor/smarty/smarty/libs/plugins/function.html_checkboxes.php index d78680368..04ce45733 100644 --- a/library/Smarty/libs/plugins/function.html_checkboxes.php +++ b/vendor/smarty/smarty/libs/plugins/function.html_checkboxes.php @@ -45,7 +45,9 @@ */ function smarty_function_html_checkboxes($params, $template) { - require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'); + if (!is_callable('smarty_function_escape_special_chars')) { + require_once(SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'); + } $name = 'checkbox'; $values = null; @@ -90,19 +92,21 @@ function smarty_function_html_checkboxes($params, $template) if (method_exists($_sel, "__toString")) { $_sel = smarty_function_escape_special_chars((string) $_sel->__toString()); } else { - trigger_error("html_checkboxes: selected attribute contains an object of class '" . get_class($_sel) . "' without __toString() method", E_USER_NOTICE); + trigger_error("html_checkboxes: selected attribute contains an object of class '" . + get_class($_sel) . "' without __toString() method", E_USER_NOTICE); continue; } } else { $_sel = smarty_function_escape_special_chars((string) $_sel); } - $selected[$_sel] = true; + $selected[ $_sel ] = true; } } elseif (is_object($_val)) { if (method_exists($_val, "__toString")) { $selected = smarty_function_escape_special_chars((string) $_val->__toString()); } else { - trigger_error("html_checkboxes: selected attribute is an object of class '" . get_class($_val) . "' without __toString() method", E_USER_NOTICE); + trigger_error("html_checkboxes: selected attribute is an object of class '" . get_class($_val) . + "' without __toString() method", E_USER_NOTICE); } } else { $selected = smarty_function_escape_special_chars((string) $_val); @@ -110,7 +114,8 @@ function smarty_function_html_checkboxes($params, $template) break; case 'checkboxes': - trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING); + trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', + E_USER_WARNING); $options = (array) $_val; break; @@ -122,9 +127,10 @@ function smarty_function_html_checkboxes($params, $template) case 'disabled': case 'readonly': - if (!empty($params['strict'])) { + if (!empty($params[ 'strict' ])) { if (!is_scalar($_val)) { - trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute", E_USER_NOTICE); + trigger_error("html_options: $_key attribute must be a scalar, only boolean true or string '$_key' will actually add the attribute", + E_USER_NOTICE); } if ($_val === true || $_val === $_key) { @@ -153,23 +159,28 @@ function smarty_function_html_checkboxes($params, $template) if (isset($options)) { foreach ($options as $_key => $_val) { - $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $escape); + $_html_result[] = + smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, + $label_ids, $escape); } } else { foreach ($values as $_i => $_key) { - $_val = isset($output[$_i]) ? $output[$_i] : ''; - $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids, $escape); + $_val = isset($output[ $_i ]) ? $output[ $_i ] : ''; + $_html_result[] = + smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels, + $label_ids, $escape); } } - if (!empty($params['assign'])) { - $template->assign($params['assign'], $_html_result); + if (!empty($params[ 'assign' ])) { + $template->assign($params[ 'assign' ], $_html_result); } else { return implode("\n", $_html_result); } } -function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, $escape = true) +function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, + $label_ids, $escape = true) { $_output = ''; @@ -177,7 +188,8 @@ function smarty_function_html_checkboxes_output($name, $value, $output, $selecte if (method_exists($value, "__toString")) { $value = (string) $value->__toString(); } else { - trigger_error("html_options: value is an object of class '" . get_class($value) . "' without __toString() method", E_USER_NOTICE); + trigger_error("html_options: value is an object of class '" . get_class($value) . + "' without __toString() method", E_USER_NOTICE); return ''; } @@ -189,7 +201,8 @@ function smarty_function_html_checkboxes_output($name, $value, $output, $selecte if (method_exists($output, "__toString")) { $output = (string) $output->__toString(); } else { - trigger_error("html_options: output is an object of class '" . get_class($output) . "' without __toString() method", E_USER_NOTICE); + trigger_error("html_options: output is an object of class '" . get_class($output) . + "' without __toString() method", E_USER_NOTICE); return ''; } @@ -199,7 +212,8 @@ function smarty_function_html_checkboxes_output($name, $value, $output, $selecte if ($labels) { if ($label_ids) { - $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER, '_', $name . '_' . $value)); + $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER, '_', + $name . '_' . $value)); $_output .= '