Skip to content

Commit

Permalink
Merge pull request #48 from katzwebservices/develop
Browse files Browse the repository at this point in the history
Update Twig; version 2.1.3
  • Loading branch information
zackkatz authored Jun 30, 2016
2 parents a23284f + 1aa9361 commit ad4175a
Show file tree
Hide file tree
Showing 98 changed files with 1,084 additions and 818 deletions.
13 changes: 7 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,12 @@ Weather Underground has been very gracious and has provided the plugin with free

== Changelog ==

= 2.1.2 on June 30, 2016 =
= 2.1.2 and 2.1.3 on June 30, 2016 =
* Added: Ability to override API key using the `wunderground_api_key` filter or the `WUNDERGROUND_API_KEY` constant
* Fixed: Location autocomplete issue on HTTPS websites
* Fixed: Don't cache responses if they result in errors (good idea, eh?)
* Added: `wunderground_include_pws` filter to toggle whether to include Personal Weather Stations as data sources (Default: false, unless the location requested is specifically a PWS station)
* Updated: Twig template framework from 1.21.0 to 1.24.1

= 2.1.1 on August 25, 2015 =
* Fixed: WordPress 4.3 compatibility
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
namespace Composer\Autoload;

/**
* ClassLoader implements a PSR-0 class loader
*
* See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
Expand All @@ -39,6 +37,8 @@
*
* @author Fabien Potencier <[email protected]>
* @author Jordi Boggiano <[email protected]>
* @see http://www.php-fig.org/psr/psr-0/
* @see http://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
Expand Down Expand Up @@ -147,7 +147,7 @@ public function add($prefix, $paths, $prepend = false)
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-0 base directories
* @param array|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
Expand Down
21 changes: 21 additions & 0 deletions vendor/composer/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

Copyright (c) 2015 Nils Adermann, Jordi Boggiano

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

5 changes: 0 additions & 5 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,3 @@ public static function getLoader()
return $loader;
}
}

function composerRequire7374dd036509d2ffae2282c2a10a41ce($file)
{
require $file;
}
14 changes: 7 additions & 7 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[
{
"name": "twig/twig",
"version": "v1.21.0",
"version_normalized": "1.21.0.0",
"version": "v1.24.1",
"version_normalized": "1.24.1.0",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "913d282caca9ee0e8d05940c6caa486d58810dd4"
"reference": "3566d311a92aae4deec6e48682dc5a4528c4a512"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/913d282caca9ee0e8d05940c6caa486d58810dd4",
"reference": "913d282caca9ee0e8d05940c6caa486d58810dd4",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/3566d311a92aae4deec6e48682dc5a4528c4a512",
"reference": "3566d311a92aae4deec6e48682dc5a4528c4a512",
"shasum": ""
},
"require": {
Expand All @@ -21,11 +21,11 @@
"symfony/debug": "~2.7",
"symfony/phpunit-bridge": "~2.7"
},
"time": "2015-08-24 09:51:18",
"time": "2016-05-30 09:11:59",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.21-dev"
"dev-master": "1.24-dev"
}
},
"installation-source": "dist",
Expand Down
77 changes: 77 additions & 0 deletions vendor/twig/twig/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,80 @@
* 1.24.1 (2016-05-30)

* fixed reserved keywords (forbids true, false, null and none keywords for variables names)
* fixed support for PHP7 (Throwable support)
* marked the following methods as being internals on Twig_Environment:
getFunctions(), getFilters(), getTests(), getFunction(), getFilter(), getTest(),
getTokenParsers(), getTags(), getNodeVisitors(), getUnaryOperators(), getBinaryOperators(),
getFunctions(), getFilters(), getGlobals(), initGlobals(), initExtensions(), and initExtension()

* 1.24.0 (2016-01-25)

* adding support for the ?? operator
* fixed the defined test when used on a constant, a map, or a sequence
* undeprecated _self (should only be used to get the template name, not the template instance)
* fixed parsing on PHP7

* 1.23.3 (2016-01-11)

* fixed typo

* 1.23.2 (2015-01-11)

* added versions in deprecated messages
* made file cache tolerant for trailing (back)slashes on directory configuration
* deprecated unused Twig_Node_Expression_ExtensionReference class

* 1.23.1 (2015-11-05)

* fixed some exception messages which triggered PHP warnings
* fixed BC on Twig_Test_NodeTestCase

* 1.23.0 (2015-10-29)

* deprecated the possibility to override an extension by registering another one with the same name
* deprecated Twig_ExtensionInterface::getGlobals() (added Twig_Extension_GlobalsInterface for BC)
* deprecated Twig_ExtensionInterface::initRuntime() (added Twig_Extension_InitRuntimeInterface for BC)
* deprecated Twig_Environment::computeAlternatives()

* 1.22.3 (2015-10-13)

* fixed regression when using null as a cache strategy
* improved performance when checking template freshness
* fixed warnings when loaded templates do not exist
* fixed template class name generation to prevent possible collisions
* fixed logic for custom escapers to call them even on integers and null values
* changed template cache names to take into account the Twig C extension

* 1.22.2 (2015-09-22)

* fixed a race condition in template loading

* 1.22.1 (2015-09-15)

* fixed regression in template_from_string

* 1.22.0 (2015-09-13)

* made Twig_Test_IntegrationTestCase more flexible
* added an option to force PHP bytecode invalidation when writing a compiled template into the cache
* fixed the profiler duration for the root node
* changed template cache names to take into account enabled extensions
* deprecated Twig_Environment::clearCacheFiles(), Twig_Environment::getCacheFilename(),
Twig_Environment::writeCacheFile(), and Twig_Environment::getTemplateClassPrefix()
* added a way to override the filesystem template cache system
* added a way to get the original template source from Twig_Template

* 1.21.2 (2015-09-09)

* fixed variable names for the deprecation triggering code
* fixed escaping strategy detection based on filename
* added Traversable support for replace, merge, and sort
* deprecated support for character by character replacement for the "replace" filter

* 1.21.1 (2015-08-26)

* fixed regression when using the deprecated Twig_Test_* classes

* 1.21.0 (2015-08-24)

* added deprecation notices for deprecated features
Expand Down
2 changes: 1 addition & 1 deletion vendor/twig/twig/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2009-2014 by the Twig Team.
Copyright (c) 2009-2016 by the Twig Team.

Some rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion vendor/twig/twig/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.21-dev"
"dev-master": "1.24-dev"
}
}
}
2 changes: 1 addition & 1 deletion vendor/twig/twig/ext/twig/php_twig.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#ifndef PHP_TWIG_H
#define PHP_TWIG_H

#define PHP_TWIG_VERSION "1.21.0"
#define PHP_TWIG_VERSION "1.24.1"

#include "php.h"

Expand Down
2 changes: 1 addition & 1 deletion vendor/twig/twig/ext/twig/twig.c
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ PHP_FUNCTION(twig_template_get_attributes)
efree(item);
return;
}
TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Method \"%s\" for object \"%s\" does not exist", item, TWIG_GET_CLASS_NAME(object TSRMLS_CC));
TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Neither the property \"%s\" nor one of the methods \"%s()\", \"get%s()\"/\"is%s()\" or \"__call()\" exist and have public access in class \"%s\"", item, item, item, item, TWIG_GET_CLASS_NAME(object TSRMLS_CC));
efree(item);
return;
}
Expand Down
6 changes: 3 additions & 3 deletions vendor/twig/twig/lib/Twig/Autoloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
* file that was distributed with this source code.
*/

@trigger_error('The Twig_Autoloader class is deprecated and will be removed in 2.0. Use Composer instead.', E_USER_DEPRECATED);
@trigger_error('The Twig_Autoloader class is deprecated since version 1.21 and will be removed in 2.0. Use Composer instead.', E_USER_DEPRECATED);

/**
* Autoloads Twig classes.
*
* @author Fabien Potencier <[email protected]>
*
* @deprecated Use Composer instead. Will be removed in Twig 2.0.
* @deprecated since 1.21 and will be removed in 2.0. Use Composer instead. 2.0.
*/
class Twig_Autoloader
{
Expand All @@ -27,7 +27,7 @@ class Twig_Autoloader
*/
public static function register($prepend = false)
{
@trigger_error('Using Twig_Autoloader is deprecated. Use Composer instead.', E_USER_DEPRECATED);
@trigger_error('Using Twig_Autoloader is deprecated since version 1.21. Use Composer instead.', E_USER_DEPRECATED);

if (PHP_VERSION_ID < 50300) {
spl_autoload_register(array(__CLASS__, 'autoload'));
Expand Down
96 changes: 96 additions & 0 deletions vendor/twig/twig/lib/Twig/Cache/Filesystem.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?php

/*
* This file is part of Twig.
*
* (c) 2015 Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

/**
* Implements a cache on the filesystem.
*
* @author Andrew Tch <[email protected]>
*/
class Twig_Cache_Filesystem implements Twig_CacheInterface
{
const FORCE_BYTECODE_INVALIDATION = 1;

private $directory;
private $options;

/**
* @param $directory string The root cache directory
* @param $options int A set of options
*/
public function __construct($directory, $options = 0)
{
$this->directory = rtrim($directory, '\/').'/';
$this->options = $options;
}

/**
* {@inheritdoc}
*/
public function generateKey($name, $className)
{
$hash = hash('sha256', $className);

return $this->directory.$hash[0].$hash[1].'/'.$hash.'.php';
}

/**
* {@inheritdoc}
*/
public function load($key)
{
@include_once $key;
}

/**
* {@inheritdoc}
*/
public function write($key, $content)
{
$dir = dirname($key);
if (!is_dir($dir)) {
if (false === @mkdir($dir, 0777, true) && !is_dir($dir)) {
throw new RuntimeException(sprintf('Unable to create the cache directory (%s).', $dir));
}
} elseif (!is_writable($dir)) {
throw new RuntimeException(sprintf('Unable to write in the cache directory (%s).', $dir));
}

$tmpFile = tempnam($dir, basename($key));
if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $key)) {
@chmod($key, 0666 & ~umask());

if (self::FORCE_BYTECODE_INVALIDATION == ($this->options & self::FORCE_BYTECODE_INVALIDATION)) {
// Compile cached file into bytecode cache
if (function_exists('opcache_invalidate')) {
opcache_invalidate($key, true);
} elseif (function_exists('apc_compile_file')) {
apc_compile_file($key);
}
}

return;
}

throw new RuntimeException(sprintf('Failed to write cache file "%s".', $key));
}

/**
* {@inheritdoc}
*/
public function getTimestamp($key)
{
if (!file_exists($key)) {
return 0;
}

return (int) @filemtime($key);
}
}
Loading

0 comments on commit ad4175a

Please sign in to comment.