diff --git a/bundled-libs/Smarty/COPYING.lib b/bundled-libs/Smarty/COPYING.lib
deleted file mode 100644
index 02bbb60b..00000000
--- a/bundled-libs/Smarty/COPYING.lib
+++ /dev/null
@@ -1,165 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
- This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
- 0. Additional Definitions.
-
- As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
- "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
- An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
- A "Combined Work" is a work produced by combining or linking an
-Application with the Library. The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
- The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
- The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
- 1. Exception to Section 3 of the GNU GPL.
-
- You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
- 2. Conveying Modified Versions.
-
- If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
- a) under this License, provided that you make a good faith effort to
- ensure that, in the event an Application does not supply the
- function or data, the facility still operates, and performs
- whatever part of its purpose remains meaningful, or
-
- b) under the GNU GPL, with none of the additional permissions of
- this License applicable to that copy.
-
- 3. Object Code Incorporating Material from Library Header Files.
-
- The object code form of an Application may incorporate material from
-a header file that is part of the Library. You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
- a) Give prominent notice with each copy of the object code that the
- Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the object code with a copy of the GNU GPL and this license
- document.
-
- 4. Combined Works.
-
- You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
- a) Give prominent notice with each copy of the Combined Work that
- the Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the Combined Work with a copy of the GNU GPL and this license
- document.
-
- c) For a Combined Work that displays copyright notices during
- execution, include the copyright notice for the Library among
- these notices, as well as a reference directing the user to the
- copies of the GNU GPL and this license document.
-
- d) Do one of the following:
-
- 0) Convey the Minimal Corresponding Source under the terms of this
- License, and the Corresponding Application Code in a form
- suitable for, and under terms that permit, the user to
- recombine or relink the Application with a modified version of
- the Linked Version to produce a modified Combined Work, in the
- manner specified by section 6 of the GNU GPL for conveying
- Corresponding Source.
-
- 1) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (a) uses at run time
- a copy of the Library already present on the user's computer
- system, and (b) will operate properly with a modified version
- of the Library that is interface-compatible with the Linked
- Version.
-
- e) Provide Installation Information, but only if you would otherwise
- be required to provide such information under section 6 of the
- GNU GPL, and only to the extent that such information is
- necessary to install and execute a modified version of the
- Combined Work produced by recombining or relinking the
- Application with a modified version of the Linked Version. (If
- you use option 4d0, the Installation Information must accompany
- the Minimal Corresponding Source and Corresponding Application
- Code. If you use option 4d1, you must provide the Installation
- Information in the manner specified by section 6 of the GNU GPL
- for conveying Corresponding Source.)
-
- 5. Combined Libraries.
-
- You may place library facilities that are a work based on the
-Library side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
- a) Accompany the combined library with a copy of the same work based
- on the Library, uncombined with any other library facilities,
- conveyed under the terms of this License.
-
- b) Give prominent notice with the combined library that part of it
- is a work based on the Library, and explaining where to find the
- accompanying uncombined form of the same work.
-
- 6. Revised Versions of the GNU Lesser General Public License.
-
- The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Library as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
- If the Library as you received it specifies that a proxy can decide
-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
diff --git a/bundled-libs/Smarty/NEW_FEATURES.txt b/bundled-libs/Smarty/NEW_FEATURES.txt
index 7632b07e..b3289dfc 100644
--- a/bundled-libs/Smarty/NEW_FEATURES.txt
+++ b/bundled-libs/Smarty/NEW_FEATURES.txt
@@ -2,7 +2,14 @@
This file contains a brief description of new features which have been added to Smarty 3.1
-Smarty 3.1.32 New tags for inheritance parent and child
+Smarty 3.1.33-dev
+ Variable capture name in Smarty special variable
+ ================================================
+ {$smarty.capture.$foo} can now be used to access the content of a named
+ capture block
+
+Smarty 3.1.32
+ New tags for inheritance parent and child
=========================================
{parent} == {$smarty.block.parent}
{child} == {$smarty.block.child}
diff --git a/bundled-libs/Smarty/README_SMARTY_CACHING_PURPOSES.txt b/bundled-libs/Smarty/README_SMARTY_CACHING_PURPOSES.txt
deleted file mode 100644
index 10a2abe4..00000000
--- a/bundled-libs/Smarty/README_SMARTY_CACHING_PURPOSES.txt
+++ /dev/null
@@ -1,124 +0,0 @@
- // enable properties with removing #cache#
- #cache# $this->setCacheDir($serendipity['serendipityPath'] . 'cache');
-
- #cache# $this->caching = true; // $this->setCaching(true);
- /*
- Caching is disabled, as long as we haven't figured out on how to use it best here....
-
- Note: rodneyrehm
- A cache_id is (ideally) supposed to identify a single page.
- md5(REQUEST_URI) may _seem_ to be doing that, but /foo.html and /foo.html?foo=bar are the same resource
- from S9Y's point of view - with DIFFERENT REQUEST_URIs. Your approach leads to a number of problems:
- * flooding the cache space with duplicate content
- * essentially making clearCache() useless, as md5 checksums of /foo.html and /foo.html?foo=bar have
- exactly nothing in common.
- You want to specify the pieces of cachable content yourself. Go with a structure like
- post-123
- post-123|comments (if you have a page for all comments belonging to that post)
- post-123|comments|feed (if you have a comment feed for a certain post)
- now you can clearCache('post-123') and comments and comments|feed are killed as well.
- */
-
- /*
- // APC and MEMCACHE are loaded from this libs plugins folder,
- // but you need to have enabled caching by $smarty->caching = true (see Rodneys upper template structure note),
- // which makes clear why we can't use Smarty caching currently with S9y
-
- // enable for APC in-memory (RAM) storage caching - must be enabled in PHP
- if(APC_EXTENSION_LOADED && !$serendipity['disable_apc']) {
- $this->addPluginsDir ( SMARTY_DIR . 'plugins/' );
- $this->caching_type = 'apc'; //$this->setCachingType ( 'apc' );
- }
- // enable for MEMCACHE storage caching - must be enabled in PHP
- if(MEMCACHE_EXTENSION_LOADED && !$serendipity['disable_memcache']) {
- $this->addPluginsDir ( SMARTY_DIR . 'plugins/' );
- $this->caching_type = 'memcache'; //$this->setCachingType ( 'memcache' );
- }
- */
-
- // does set cache also need to be set to true?
- #cache# $this->cache_modified_check = true; // to be used with display() method only, must be true to enable 304 headers
-
- /*
- Note: rodneyrehm
- $cache_modified_check only works if you're using display() - it won't do anything on fetch().
- It won't do anything if you have non-caching plugins or {insert} tags, either.
-
- We're working on making this more intelligent for 3.2, but? work with what you've got in 3.1 first.
- */
-
- // some documentary from the smarty forum
- /*
- With Smarty::CACHING_LIFETIME_SAVED the expiration date is written into the cached file.
- So each cache_id / compile_id combination may have their own cache lifetime.
- The point is simply, that once the cache lifetime (expiration date) has been saved to the cache file,
- it cannot be altered except for clearing and regenerating said cache file
-
- Template Inheritance
- Using is_cached() on sub-templates has to set up caching before is_cached() calls,
- e.g if (!$smarty->isCached('sub_test.tpl')) { $smarty->assign('foo', $foo); }.
- The subtemplate will always be cached as specified in the {include} tag.
- Otherwise you could never cache a subtemplate with caching disabled for the main template.
- If you don't want to have the main template cached, turn caching off again after the is_cached() calls for the subtemplate.
- So the example will cache sub_test.tpl, but not test.tpl
- Using is_cached() on subtemplates has to set up caching before is_cached() calls.
- The subtemplate will always be cached as specified in the {include} tag.
- Otherwise you could never cache a subtemplate with caching disabled for the main template.
- If you don't want to have the main template cached, turn caching off again after the is_cached() calls for the subtemplate.
- So the example will cache sub_test.tpl but not test.tpl
- Use $smarty->caching = Smarty::CACHING_LIFETIME_SAVED; with {include file="sub_test.tpl" cache_lifetime="120"} in test.tpl;
- Use $smarty->caching = Smarty::CACHING_LIFETIME_CURRENT; with {include .... caching}
- */
-
- #cache# $this->caching = Smarty::CACHING_LIFETIME_CURRENT; // $this->setCaching(2); // 1 will change the end of lifetime immediately.
- # $this->caching = Smarty::CACHING_LIFETIME_SAVED; // $this->setCaching(Smarty::CACHING_LIFETIME_SAVED);
- # $this->caching = Smarty::CACHING_OFF; // $this->setCaching(Smarty::CACHING_OFF) // stop caching >= 3.1.4
-
- /*
- Note: rodneyrehm
- The CACHING_LIFETIME_SAVED option is something you only really "need" if many cache files have different lifetimes.
- I've used Smarty intensively over the past years and I _never_ required LIFETIME_SAVED...
-
- you can do $force_cache = true; to make the current page re-render to cache. This actually allows you to work with a very high
- cache_lifetime and poll a secondary modified time from somewhere. You could then implement the serve-stale-until-updated caching approach.
- I'll blog about this? probably around christmas
- */
-
- // set the cache_lifetime for index.tpl to 5 minutes
- #cache# $this->cache_lifetime = 300; // $this->setCacheLifetime(300); // 86400; // one day: 60*60*24
-
- // some documentary from the smarty forum
- /*
- Smarty caching is based purely on the fetch() or display() call. So:
- $smarty->fetch('application.tpl');
- Will generate a cached output and use that on repeated calls. If you have multiple versions of this call, you need to pass a cache_id. Example:
- $cache_id = md5($_SERVER['REQUEST_URI']);
- $smarty->fetch('application.tpl',$cache_id);
- It is entirely up to you what is taken into account for the cache_id (URL, etc.)
- */
-
- // does this mean $this->setCacheId($id); is useless here and has to be set where the actual templates are called? or does ist work as something default?
- /*
- Note: rodneyrehm
- when fetch(tpl) is called, Smarty::$cache_id is injected. If you need a single cache_id for the whole render complex, this may be the sane thing to do.
- But you'll probably segment certain content. A Post does not have to be reendered for every new comment. It thus makes sense to separate these entities
- into their own cache spaces. In turn they'd probably receive their own cache_ids. Although that is not _necessary_ as template_name and cache_id work in
- conjunction. If both are supplied (to say clearCache()) template_name increases the specificity of cache_id, so only those items are purged that meet
- both criteria.
- */
-
- // some documentary from the smarty forum
- /*
- Smarty will use the cache_id for distributing the cache files into sub_dirs
- A cache id is used if you cache different output generated by the same template as for example on a product page.
- In such a case you should use a product id as cache id.
- $this->cache_id($id); // $this->setCacheId($id);
- */
-
- #cache# $this->cache_id = md5($_SERVER['REQUEST_URI']); // this isn't a good idea either, better have it disabled or use a special id
- /*
- Note: Ian
- What kind of Serendipity ID could this be?
- - see Rodneys first caching note
- */
-
diff --git a/bundled-libs/Smarty/change_log.txt b/bundled-libs/Smarty/change_log.txt
index 5765a171..70762eda 100644
--- a/bundled-libs/Smarty/change_log.txt
+++ b/bundled-libs/Smarty/change_log.txt
@@ -1,4 +1,46 @@
-===== 3.1.32 ===== (24.04.2018)
+===== 3.1.33 release ===== 12.09.2018
+===== 3.1.33-dev-12 =====
+03.09.2018
+ - bugfix {foreach} using new style property access like {$item@property} on
+ Smarty 2 style named foreach loop could produce errors https://github.com/smarty-php/smarty/issues/484
+
+31.08.2018
+ - bugfix some custom left and right delimiters like '{^' '^}' did not work
+ https://github.com/smarty-php/smarty/issues/450 https://github.com/smarty-php/smarty/pull/482
+
+ - reformating for PSR-2 coding standards https://github.com/smarty-php/smarty/pull/483
+
+ - bugfix on Windows absolute filepathes did fail if the drive letter was followed by a linux DIRECTORY_SEPARATOR
+ like C:/ at Smarty > 3.1.33-dev-5 https://github.com/smarty-php/smarty/issues/451
+
+ - PSR-2 code style fixes for config and template file Lexer/Parser generated with
+ the Smarty Lexer/Parser generator from https://github.com/smarty-php/smarty-lexer
+ https://github.com/smarty-php/smarty/pull/483
+
+26.08.2018
+ - bugfix/enhancement {capture} allow variable as capture block name in Smarty special variable
+ like $smarty.capture.$foo https://github.com/smarty-php/smarty/issues/478 https://github.com/smarty-php/smarty/pull/481
+
+===== 3.1.33-dev-6 =====
+19.08.2018
+ - fix PSR-2 coding standards and PHPDoc blocks https://github.com/smarty-php/smarty/pull/452
+ https://github.com/smarty-php/smarty/pull/475
+ https://github.com/smarty-php/smarty/pull/473
+ - bugfix PHP5.2 compatibility https://github.com/smarty-php/smarty/pull/472
+
+===== 3.1.33-dev-4 =====
+17.05.2018
+ - bugfix strip-block produces different output in Smarty v3.1.32 https://github.com/smarty-php/smarty/issues/436
+ - bugfix Smarty::compileAllTemplates ignores `$extension` parameter https://github.com/smarty-php/smarty/issues/437
+ https://github.com/smarty-php/smarty/pull/438
+ - improvement do not compute total property in {foreach} if not needed https://github.com/smarty-php/smarty/issues/443
+ - bugfix plugins may not be loaded when setMergeCompiledIncludes is true https://github.com/smarty-php/smarty/issues/435
+
+26.04.2018
+ - bugfix regarding Security Vulnerability did not solve the problem under Linux.
+ Security issue CVE-2018-16831
+
+===== 3.1.32 ===== (24.04.2018)
24.04.2018
- bugfix possible Security Vulnerability in Smarty_Security class.
diff --git a/bundled-libs/Smarty/composer.json b/bundled-libs/Smarty/composer.json
index 5064c8ce..5007517b 100644
--- a/bundled-libs/Smarty/composer.json
+++ b/bundled-libs/Smarty/composer.json
@@ -2,7 +2,9 @@
"name": "smarty/smarty",
"type": "library",
"description": "Smarty - the compiling PHP template engine",
- "keywords": ["templating"],
+ "keywords": [
+ "templating"
+ ],
"homepage": "http://www.smarty.net",
"license": "LGPL-3.0",
"authors": [
@@ -28,12 +30,13 @@
"php": ">=5.2"
},
"autoload": {
- "files": ["libs/bootstrap.php"]
+ "files": [
+ "libs/bootstrap.php"
+ ]
},
"extra": {
"branch-alias": {
"dev-master": "3.1.x-dev"
}
}
-
-}
+}
\ No newline at end of file
diff --git a/bundled-libs/Smarty/demo/configs/test.conf b/bundled-libs/Smarty/demo/configs/test.conf
deleted file mode 100644
index 5eac748e..00000000
--- a/bundled-libs/Smarty/demo/configs/test.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-title = Welcome to Smarty!
-cutoff_size = 40
-
-[setup]
-bold = true
diff --git a/bundled-libs/Smarty/demo/index.php b/bundled-libs/Smarty/demo/index.php
deleted file mode 100644
index b67c217b..00000000
--- a/bundled-libs/Smarty/demo/index.php
+++ /dev/null
@@ -1,30 +0,0 @@
-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/bundled-libs/Smarty/demo/plugins/cacheresource.apc.php b/bundled-libs/Smarty/demo/plugins/cacheresource.apc.php
deleted file mode 100644
index ed55ec84..00000000
--- a/bundled-libs/Smarty/demo/plugins/cacheresource.apc.php
+++ /dev/null
@@ -1,83 +0,0 @@
- $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/bundled-libs/Smarty/demo/plugins/cacheresource.memcache.php b/bundled-libs/Smarty/demo/plugins/cacheresource.memcache.php
deleted file mode 100644
index 945beb34..00000000
--- a/bundled-libs/Smarty/demo/plugins/cacheresource.memcache.php
+++ /dev/null
@@ -1,101 +0,0 @@
-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/bundled-libs/Smarty/demo/plugins/cacheresource.mysql.php b/bundled-libs/Smarty/demo/plugins/cacheresource.mysql.php
deleted file mode 100644
index 027b9376..00000000
--- a/bundled-libs/Smarty/demo/plugins/cacheresource.mysql.php
+++ /dev/null
@@ -1,160 +0,0 @@
-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/bundled-libs/Smarty/demo/plugins/cacheresource.pdo.php b/bundled-libs/Smarty/demo/plugins/cacheresource.pdo.php
deleted file mode 100644
index 24a94c1a..00000000
--- a/bundled-libs/Smarty/demo/plugins/cacheresource.pdo.php
+++ /dev/null
@@ -1,327 +0,0 @@
-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 : optional - 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/bundled-libs/Smarty/demo/plugins/cacheresource.pdo_gzip.php b/bundled-libs/Smarty/demo/plugins/cacheresource.pdo_gzip.php
deleted file mode 100644
index 8a9e0a5d..00000000
--- a/bundled-libs/Smarty/demo/plugins/cacheresource.pdo_gzip.php
+++ /dev/null
@@ -1,43 +0,0 @@
-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/bundled-libs/Smarty/demo/plugins/resource.extendsall.php b/bundled-libs/Smarty/demo/plugins/resource.extendsall.php
deleted file mode 100644
index a5ee432d..00000000
--- a/bundled-libs/Smarty/demo/plugins/resource.extendsall.php
+++ /dev/null
@@ -1,65 +0,0 @@
-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/bundled-libs/Smarty/demo/plugins/resource.mysql.php b/bundled-libs/Smarty/demo/plugins/resource.mysql.php
deleted file mode 100644
index 619707e7..00000000
--- a/bundled-libs/Smarty/demo/plugins/resource.mysql.php
+++ /dev/null
@@ -1,83 +0,0 @@
-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/bundled-libs/Smarty/demo/plugins/resource.mysqls.php b/bundled-libs/Smarty/demo/plugins/resource.mysqls.php
deleted file mode 100644
index d85aecf3..00000000
--- a/bundled-libs/Smarty/demo/plugins/resource.mysqls.php
+++ /dev/null
@@ -1,63 +0,0 @@
-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/bundled-libs/Smarty/demo/templates/footer.tpl b/bundled-libs/Smarty/demo/templates/footer.tpl
deleted file mode 100644
index e04310fd..00000000
--- a/bundled-libs/Smarty/demo/templates/footer.tpl
+++ /dev/null
@@ -1,2 +0,0 @@
-