1
0
mirror of https://github.com/typemill/typemill.git synced 2025-01-17 05:18:19 +01:00

fixed settings but

This commit is contained in:
Sebastian 2017-07-02 19:18:48 +02:00
parent 9c4bff52f3
commit b227d89e9d
378 changed files with 2820 additions and 183 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
cache/structure.txt
cache/sitemap.txt
cache/lastSitemap.txt
cache/lastCache.txt
settings/settings.yaml
typemill.zip
typemill-1.0.1.zip

View File

@ -11,6 +11,7 @@ RewriteEngine On
RewriteRule ^(system\/author\/) - [L]
RewriteRule ^(system) - [F,L]
RewriteRule ^(content) - [F,L]
RewriteRule ^(settings) - [F,L]
RewriteRule ^(.*)?\.yml$ - [F,L]
Rewriterule ^(.*)?\.yaml$ - [F,L]
RewriteRule ^(.*)?\.txt$ - [F,L]

2
cache/lastCache.txt vendored
View File

@ -1 +1 @@
1493667461
1498906249

99
cache/sitemap.xml vendored Normal file
View File

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://localhost/typemill</loc>
</url>
<url>
<loc>http://localhost/typemill/typemill</loc>
</url>
<url>
<loc>http://localhost/typemill/typemill/use-cases</loc>
</url>
<url>
<loc>http://localhost/typemill/typemill/features</loc>
</url>
<url>
<loc>http://localhost/typemill/typemill/roadmap</loc>
</url>
<url>
<loc>http://localhost/typemill/getting-started</loc>
</url>
<url>
<loc>http://localhost/typemill/getting-started/system-requirements</loc>
</url>
<url>
<loc>http://localhost/typemill/getting-started/installation</loc>
</url>
<url>
<loc>http://localhost/typemill/getting-started/settings</loc>
</url>
<url>
<loc>http://localhost/typemill/getting-started/update</loc>
</url>
<url>
<loc>http://localhost/typemill/writers</loc>
</url>
<url>
<loc>http://localhost/typemill/writers/quick-start</loc>
</url>
<url>
<loc>http://localhost/typemill/writers/mardown</loc>
</url>
<url>
<loc>http://localhost/typemill/writers/naming-files-and-folders</loc>
</url>
<url>
<loc>http://localhost/typemill/writers/folder-structure</loc>
</url>
<url>
<loc>http://localhost/typemill/writers/google-sitemap</loc>
</url>
<url>
<loc>http://localhost/typemill/developers</loc>
</url>
<url>
<loc>http://localhost/typemill/developers/quick-start</loc>
</url>
<url>
<loc>http://localhost/typemill/developers/twig</loc>
</url>
<url>
<loc>http://localhost/typemill/developers/theme-structure</loc>
</url>
<url>
<loc>http://localhost/typemill/developers/theme-variables</loc>
</url>
<url>
<loc>http://localhost/typemill/developers/theme-variables/content</loc>
</url>
<url>
<loc>http://localhost/typemill/developers/theme-variables/description</loc>
</url>
<url>
<loc>http://localhost/typemill/developers/theme-variables/item</loc>
</url>
<url>
<loc>http://localhost/typemill/developers/theme-variables/breadcrumb</loc>
</url>
<url>
<loc>http://localhost/typemill/developers/theme-variables/navigation</loc>
</url>
<url>
<loc>http://localhost/typemill/developers/theme-variables/settings</loc>
</url>
<url>
<loc>http://localhost/typemill/info</loc>
</url>
<url>
<loc>http://localhost/typemill/info/release-notes</loc>
</url>
<url>
<loc>http://localhost/typemill/info/usage-and-licence</loc>
</url>
<url>
<loc>http://localhost/typemill/info/imprint-and-privacy</loc>
</url>
<url>
<loc>http://localhost/typemill/info/markdown-test</loc>
</url>
</urlset>

View File

@ -1,9 +1,9 @@
{
"name": "trendschau/writeitdown",
"name": "trendschau/typemill",
"type": "project",
"description": "A crazy simple tool to create web-documentations and online manuals with markdown files.",
"keywords": ["documentations","manuals","flat-file","Markdown","php"],
"homepage": "http://writeitdown.net",
"homepage": "http://typemill.net",
"license": "MIT",
"config": {
"vendor-dir": "system/vendor"
@ -16,7 +16,8 @@
"symfony/yaml": "~2.8",
"erusev/parsedown": "~1.4",
"erusev/parsedown-extra": "dev-master",
"jbroadway/urlify": "dev-master"
"jbroadway/urlify": "dev-master",
"vlucas/valitron": "dev-master"
},
"autoload": {
"psr-4": {

78
composer.lock generated
View File

@ -4,7 +4,7 @@
"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": "f62200a42c7079d79121ddda255fa670",
"content-hash": "d051059d0d2e16c98ddd6562a4ae9c17",
"packages": [
{
"name": "container-interop/container-interop",
@ -536,16 +536,16 @@
},
{
"name": "symfony/yaml",
"version": "v2.8.19",
"version": "v2.8.22",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "286d84891690b0e2515874717e49360d1c98a703"
"reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/286d84891690b0e2515874717e49360d1c98a703",
"reference": "286d84891690b0e2515874717e49360d1c98a703",
"url": "https://api.github.com/repos/symfony/yaml/zipball/4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5",
"reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5",
"shasum": ""
},
"require": {
@ -581,24 +581,24 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2017-03-20T09:41:44+00:00"
"time": "2017-06-01T20:52:29+00:00"
},
{
"name": "twig/twig",
"version": "v1.33.0",
"version": "v1.34.3",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "05cf49921b13f6f01d3cfdf9018cfa7a8086fd5a"
"reference": "451c6f4197e113e24c1c85bc3fc8c2d77adeff2e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/05cf49921b13f6f01d3cfdf9018cfa7a8086fd5a",
"reference": "05cf49921b13f6f01d3cfdf9018cfa7a8086fd5a",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/451c6f4197e113e24c1c85bc3fc8c2d77adeff2e",
"reference": "451c6f4197e113e24c1c85bc3fc8c2d77adeff2e",
"shasum": ""
},
"require": {
"php": ">=5.2.7"
"php": ">=5.3.3"
},
"require-dev": {
"psr/container": "^1.0",
@ -608,12 +608,15 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.33-dev"
"dev-master": "1.34-dev"
}
},
"autoload": {
"psr-0": {
"Twig_": "lib/"
},
"psr-4": {
"Twig\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@ -643,7 +646,53 @@
"keywords": [
"templating"
],
"time": "2017-03-22T15:40:09+00:00"
"time": "2017-06-07T18:45:17+00:00"
},
{
"name": "vlucas/valitron",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/vlucas/valitron.git",
"reference": "107d1eebc1d5420b6e88032a4bec0420adfa7495"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vlucas/valitron/zipball/107d1eebc1d5420b6e88032a4bec0420adfa7495",
"reference": "107d1eebc1d5420b6e88032a4bec0420adfa7495",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"type": "library",
"autoload": {
"psr-0": {
"Valitron": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD"
],
"authors": [
{
"name": "Vance Lucas",
"email": "vance@vancelucas.com",
"homepage": "http://www.vancelucas.com"
}
],
"description": "Simple, elegant, stand-alone validation library with NO dependencies",
"homepage": "http://github.com/vlucas/valitron",
"keywords": [
"valid",
"validation",
"validator"
],
"time": "2017-06-26 21:34:20"
}
],
"packages-dev": [],
@ -653,7 +702,8 @@
"slim/twig-view": 20,
"slim/flash": 20,
"erusev/parsedown-extra": 20,
"jbroadway/urlify": 20
"jbroadway/urlify": 20,
"vlucas/valitron": 20
},
"prefer-stable": false,
"prefer-lowest": false,

View File

@ -3,21 +3,20 @@
DEFINE('DS', DIRECTORY_SEPARATOR);
return [
'settings' => [
'title' => 'TYPEMILL',
'author' => 'unknown',
'copyright' => 'copyright',
'startpage' => true,
'rootPath' => __DIR__ . DS . '..' . DS,
'theme' => ($theme = 'typemill'),
'themeFolder' => ($themeFolder = 'themes'),
'themePath' => __DIR__ . DS . '..' . DS . $themeFolder . DS . $theme,
'settingsPath' => __DIR__ . DS . '..' . DS . 'settings',
'authorPath' => __DIR__ . DS . 'author' . DS,
'contentFolder' => 'content',
'displayErrorDetails' => true,
'version' => '1.0.1'
],
'title' => 'TYPEMILL',
'author' => 'unknown',
'copyright' => 'copyright',
'startpage' => true,
'rootPath' => __DIR__ . DS . '..' . DS,
'theme' => ($theme = 'typemill'),
'themeFolder' => ($themeFolder = 'themes'),
'themeBasePath' => __DIR__ . DS . '..' . DS,
'themePath' => __DIR__ . DS . '..' . DS . $themeFolder . DS . $theme,
'settingsPath' => __DIR__ . DS . '..' . DS . 'settings',
'authorPath' => __DIR__ . DS . 'author' . DS,
'contentFolder' => 'content',
'displayErrorDetails' => false,
'version' => '1.0.2'
];
?>

View File

@ -10,38 +10,42 @@ session_start();
* LOAD SETTINGS *
************************/
$settings = require_once( __DIR__ . '/settings.php');
$settings = require_once( __DIR__ . '/settings.php');
if(file_exists($settings['settings']['settingsPath'] . DIRECTORY_SEPARATOR . 'settings.yaml'))
if(file_exists($settings['settingsPath'] . DIRECTORY_SEPARATOR . 'settings.yaml'))
{
$yaml = new \Symfony\Component\Yaml\Parser();
$yaml = new \Symfony\Component\Yaml\Parser();
try {
$userSettings = $yaml->parse( file_get_contents($settings['settings']['settingsPath'] . DIRECTORY_SEPARATOR . 'settings.yaml' ) );
$userSettings = $yaml->parse( file_get_contents($settings['settingsPath'] . DIRECTORY_SEPARATOR . 'settings.yaml' ) );
} catch (ParseException $e) {
printf("Unable to parse the YAML string: %s", $e->getMessage());
}
$settings = array('settings' => array_merge($settings['settings'], $userSettings));
$settings = array_merge($settings, $userSettings);
$settings['themePath'] = $settings['themeBasePath'] . $settings['themeFolder'] . DIRECTORY_SEPARATOR . $settings['theme'];
}
$settings['settings'] = $settings;
/************************
* INITIATE SLIM *
************************/
$app = new \Slim\App($settings);
$app = new \Slim\App($settings);
/************************
* SLIM CONTAINER *
************************/
$container = $app->getContainer();
$container = $app->getContainer();
/************************
* LOAD TWIG *
************************/
$container['view'] = function ($container) use ($settings){
$path = array($settings['settings']['themePath'], $settings['settings']['authorPath']);
$view = new \Slim\Views\Twig( $path, [
'cache' => false,
'autoescape' => false

View File

@ -6,6 +6,7 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname(dirname($vendorDir));
return array(
'Valitron' => array($vendorDir . '/vlucas/valitron/src'),
'URLify' => array($vendorDir . '/jbroadway/urlify'),
'Twig_' => array($vendorDir . '/twig/twig/lib'),
'Pimple' => array($vendorDir . '/pimple/pimple/src'),

View File

@ -6,6 +6,7 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname(dirname($vendorDir));
return array(
'Twig\\' => array($vendorDir . '/twig/twig/src'),
'System\\' => array($baseDir . '/system'),
'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
'Slim\\Views\\' => array($vendorDir . '/slim/twig-view/src'),

View File

@ -11,6 +11,10 @@ class ComposerStaticInit836351be733ecbf4741aea17e1973480
);
public static $prefixLengthsPsr4 = array (
'T' =>
array (
'Twig\\' => 5,
),
'S' =>
array (
'System\\' => 7,
@ -35,6 +39,10 @@ class ComposerStaticInit836351be733ecbf4741aea17e1973480
);
public static $prefixDirsPsr4 = array (
'Twig\\' =>
array (
0 => __DIR__ . '/..' . '/twig/twig/src',
),
'System\\' =>
array (
0 => __DIR__ . '/../../..' . '/system',
@ -74,6 +82,13 @@ class ComposerStaticInit836351be733ecbf4741aea17e1973480
);
public static $prefixesPsr0 = array (
'V' =>
array (
'Valitron' =>
array (
0 => __DIR__ . '/..' . '/vlucas/valitron/src',
),
),
'U' =>
array (
'URLify' =>

View File

@ -551,38 +551,41 @@
},
{
"name": "twig/twig",
"version": "v1.33.0",
"version_normalized": "1.33.0.0",
"version": "v1.34.3",
"version_normalized": "1.34.3.0",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "05cf49921b13f6f01d3cfdf9018cfa7a8086fd5a"
"reference": "451c6f4197e113e24c1c85bc3fc8c2d77adeff2e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/05cf49921b13f6f01d3cfdf9018cfa7a8086fd5a",
"reference": "05cf49921b13f6f01d3cfdf9018cfa7a8086fd5a",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/451c6f4197e113e24c1c85bc3fc8c2d77adeff2e",
"reference": "451c6f4197e113e24c1c85bc3fc8c2d77adeff2e",
"shasum": ""
},
"require": {
"php": ">=5.2.7"
"php": ">=5.3.3"
},
"require-dev": {
"psr/container": "^1.0",
"symfony/debug": "~2.7",
"symfony/phpunit-bridge": "~3.3@dev"
},
"time": "2017-03-22T15:40:09+00:00",
"time": "2017-06-07T18:45:17+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.33-dev"
"dev-master": "1.34-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
"Twig_": "lib/"
},
"psr-4": {
"Twig\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@ -615,23 +618,23 @@
},
{
"name": "symfony/yaml",
"version": "v2.8.19",
"version_normalized": "2.8.19.0",
"version": "v2.8.22",
"version_normalized": "2.8.22.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "286d84891690b0e2515874717e49360d1c98a703"
"reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/286d84891690b0e2515874717e49360d1c98a703",
"reference": "286d84891690b0e2515874717e49360d1c98a703",
"url": "https://api.github.com/repos/symfony/yaml/zipball/4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5",
"reference": "4c29dec8d489c4e37cf87ccd7166cd0b0e6a45c5",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"time": "2017-03-20T09:41:44+00:00",
"time": "2017-06-01T20:52:29+00:00",
"type": "library",
"extra": {
"branch-alias": {
@ -663,5 +666,53 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com"
},
{
"name": "vlucas/valitron",
"version": "dev-master",
"version_normalized": "9999999-dev",
"source": {
"type": "git",
"url": "https://github.com/vlucas/valitron.git",
"reference": "107d1eebc1d5420b6e88032a4bec0420adfa7495"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/vlucas/valitron/zipball/107d1eebc1d5420b6e88032a4bec0420adfa7495",
"reference": "107d1eebc1d5420b6e88032a4bec0420adfa7495",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"time": "2017-06-26T21:34:20+00:00",
"type": "library",
"installation-source": "source",
"autoload": {
"psr-0": {
"Valitron": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD"
],
"authors": [
{
"name": "Vance Lucas",
"email": "vance@vancelucas.com",
"homepage": "http://www.vancelucas.com"
}
],
"description": "Simple, elegant, stand-alone validation library with NO dependencies",
"homepage": "http://github.com/vlucas/valitron",
"keywords": [
"valid",
"validation",
"validator"
]
}
]

View File

@ -33,13 +33,15 @@ class Escaper
"\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f",
"\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17",
"\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f",
"\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9");
"\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9",
);
private static $escaped = array('\\\\', '\\"', '\\\\', '\\"',
'\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a',
'\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f',
'\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17',
'\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f',
'\\N', '\\_', '\\L', '\\P');
'\\N', '\\_', '\\L', '\\P',
);
/**
* Determines if a PHP value would require double quoting in YAML.
@ -50,7 +52,7 @@ class Escaper
*/
public static function requiresDoubleQuoting($value)
{
return preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value);
return 0 < preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value);
}
/**
@ -82,7 +84,7 @@ class Escaper
// Determines if the PHP value contains any single characters that would
// cause it to require single quoting in YAML.
return preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x', $value);
return 0 < preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x', $value);
}
/**

View File

@ -26,11 +26,11 @@ class ParseException extends RuntimeException
/**
* Constructor.
*
* @param string $message The error message
* @param int $parsedLine The line where the error occurred
* @param int $snippet The snippet of code near the problem
* @param string $parsedFile The file name where the error occurred
* @param \Exception $previous The previous exception
* @param string $message The error message
* @param int $parsedLine The line where the error occurred
* @param string|null $snippet The snippet of code near the problem
* @param string|null $parsedFile The file name where the error occurred
* @param \Exception|null $previous The previous exception
*/
public function __construct($message, $parsedLine = -1, $snippet = null, $parsedFile = null, \Exception $previous = null)
{
@ -123,7 +123,7 @@ class ParseException extends RuntimeException
}
if (null !== $this->parsedFile) {
if (PHP_VERSION_ID >= 50400) {
if (\PHP_VERSION_ID >= 50400) {
$jsonOptions = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
} else {
$jsonOptions = 0;

View File

@ -212,12 +212,12 @@ class Inline
/**
* Parses a YAML scalar.
*
* @param string $scalar
* @param string $delimiters
* @param array $stringDelimiters
* @param int &$i
* @param bool $evaluate
* @param array $references
* @param string $scalar
* @param string[] $delimiters
* @param string[] $stringDelimiters
* @param int &$i
* @param bool $evaluate
* @param array $references
*
* @return string
*
@ -453,7 +453,7 @@ class Inline
* @param string $scalar
* @param array $references
*
* @return string A YAML string
* @return mixed The evaluated YAML string
*
* @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved
*/

View File

@ -64,23 +64,57 @@ class Parser
if (false === preg_match('//u', $value)) {
throw new ParseException('The YAML value does not appear to be valid UTF-8.');
}
$this->currentLineNb = -1;
$this->currentLine = '';
$value = $this->cleanup($value);
$this->lines = explode("\n", $value);
if (null === $this->totalNumberOfLines) {
$this->totalNumberOfLines = count($this->lines);
}
$this->refs = array();
$mbEncoding = null;
$e = null;
$data = null;
if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) {
$mbEncoding = mb_internal_encoding();
mb_internal_encoding('UTF-8');
}
try {
$data = $this->doParse($value, $exceptionOnInvalidType, $objectSupport, $objectForMap);
} catch (\Exception $e) {
} catch (\Throwable $e) {
}
if (null !== $mbEncoding) {
mb_internal_encoding($mbEncoding);
}
$this->lines = array();
$this->currentLine = '';
$this->refs = array();
$this->skippedLineNumbers = array();
$this->locallySkippedLineNumbers = array();
if (null !== $e) {
throw $e;
}
return $data;
}
private function doParse($value, $exceptionOnInvalidType = false, $objectSupport = false, $objectForMap = false)
{
$this->currentLineNb = -1;
$this->currentLine = '';
$value = $this->cleanup($value);
$this->lines = explode("\n", $value);
$this->locallySkippedLineNumbers = array();
if (null === $this->totalNumberOfLines) {
$this->totalNumberOfLines = count($this->lines);
}
$data = array();
$context = null;
$allowOverwrite = false;
while ($this->moveToNextLine()) {
if ($this->isCurrentLineEmpty()) {
continue;
@ -246,10 +280,6 @@ class Parser
throw $e;
}
if (isset($mbEncoding)) {
mb_internal_encoding($mbEncoding);
}
return $value;
}
@ -257,10 +287,6 @@ class Parser
}
}
if (isset($mbEncoding)) {
mb_internal_encoding($mbEncoding);
}
if ($objectForMap && !is_object($data) && 'mapping' === $context) {
$object = new \stdClass();
@ -289,7 +315,7 @@ class Parser
$parser = new self($offset, $this->totalNumberOfLines, $skippedLineNumbers);
$parser->refs = &$this->refs;
return $parser->parse($yaml, $exceptionOnInvalidType, $objectSupport, $objectForMap);
return $parser->doParse($yaml, $exceptionOnInvalidType, $objectSupport, $objectForMap);
}
/**

View File

@ -193,27 +193,42 @@ class InlineTest extends TestCase
/**
* @group legacy
* @dataProvider getReservedIndicators
* @expectedDeprecation Not quoting the scalar "@foo " starting with "@" is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.
* throws \Symfony\Component\Yaml\Exception\ParseException in 3.0
*/
public function testParseUnquotedScalarStartingWithReservedIndicator($indicator)
public function testParseUnquotedScalarStartingWithReservedAtIndicator()
{
Inline::parse(sprintf('{ foo: %sfoo }', $indicator));
}
public function getReservedIndicators()
{
return array(array('@'), array('`'));
Inline::parse('{ foo: @foo }');
}
/**
* @group legacy
* @dataProvider getScalarIndicators
* @expectedDeprecation Not quoting the scalar "`foo " starting with "`" is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.
* throws \Symfony\Component\Yaml\Exception\ParseException in 3.0
*/
public function testParseUnquotedScalarStartingWithScalarIndicator($indicator)
public function testParseUnquotedScalarStartingWithReservedBacktickIndicator()
{
Inline::parse(sprintf('{ foo: %sfoo }', $indicator));
Inline::parse('{ foo: `foo }');
}
/**
* @group legacy
* @expectedDeprecation Not quoting the scalar "|foo " starting with "|" is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.
* throws \Symfony\Component\Yaml\Exception\ParseException in 3.0
*/
public function testParseUnquotedScalarStartingWithLiteralStyleIndicator()
{
Inline::parse('{ foo: |foo }');
}
/**
* @group legacy
* @expectedDeprecation Not quoting the scalar ">foo " starting with ">" is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.
* throws \Symfony\Component\Yaml\Exception\ParseException in 3.0
*/
public function testParseUnquotedScalarStartingWithFoldedStyleIndicator()
{
Inline::parse('{ foo: >foo }');
}
public function getScalarIndicators()

View File

@ -19,7 +19,7 @@ class ParseExceptionTest extends TestCase
public function testGetMessage()
{
$exception = new ParseException('Error message', 42, 'foo: bar', '/var/www/app/config.yml');
if (PHP_VERSION_ID >= 50400) {
if (\PHP_VERSION_ID >= 50400) {
$message = 'Error message in "/var/www/app/config.yml" at line 42 (near "foo: bar")';
} else {
$message = 'Error message in "\\/var\\/www\\/app\\/config.yml" at line 42 (near "foo: bar")';
@ -31,7 +31,7 @@ class ParseExceptionTest extends TestCase
public function testGetMessageWithUnicodeInFilename()
{
$exception = new ParseException('Error message', 42, 'foo: bar', 'äöü.yml');
if (PHP_VERSION_ID >= 50400) {
if (\PHP_VERSION_ID >= 50400) {
$message = 'Error message in "äöü.yml" at line 42 (near "foo: bar")';
} else {
$message = 'Error message in "\u00e4\u00f6\u00fc.yml" at line 42 (near "foo: bar")';

View File

@ -1231,6 +1231,27 @@ YAML
$this->assertEquals($trickyVal, $arrayFromYaml);
}
/**
* @expectedException \Symfony\Component\Yaml\Exception\ParseException
* @expectedExceptionMessage Reference "foo" does not exist at line 2
*/
public function testParserCleansUpReferencesBetweenRuns()
{
$yaml = <<<YAML
foo: &foo
baz: foobar
bar:
<<: *foo
YAML;
$this->parser->parse($yaml);
$yaml = <<<YAML
bar:
<<: *foo
YAML;
$this->parser->parse($yaml);
}
}
class B

View File

@ -5,6 +5,8 @@
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
failOnRisky="true"
failOnWarning="true"
>
<php>
<ini name="error_reporting" value="-1" />

View File

@ -8,36 +8,41 @@ cache:
- $HOME/.composer/cache/files
php:
- 5.2
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1
- hhvm
- nightly
env:
- TWIG_EXT=no
- TWIG_EXT=yes
before_install:
- if [[ ! $TRAVIS_PHP_VERSION = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi
- phpenv config-rm xdebug.ini
install:
# Composer is not available on PHP 5.2
- if [ ${TRAVIS_PHP_VERSION:0:3} != "5.2" ]; then travis_retry composer install; fi
- travis_retry composer install
before_script:
- if [ "$TWIG_EXT" == "yes" ]; then sh -c "cd ext/twig && phpize && ./configure --enable-twig && make && make install"; fi
- if [ "$TWIG_EXT" == "yes" ]; then echo "extension=twig.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi
script: |
if [[ $TRAVIS_PHP_VERSION = 7.* || $TRAVIS_PHP_VERSION = nightly ]]; then
SYMFONY_PHPUNIT_VERSION=6.1 ./vendor/bin/simple-phpunit
else
./vendor/bin/simple-phpunit
fi
matrix:
fast_finish: true
exclude:
- php: hhvm
env: TWIG_EXT=yes
- php: 7.0
env: TWIG_EXT=yes
- php: 7.1
env: TWIG_EXT=yes
- php: nightly
env: TWIG_EXT=yes

View File

@ -1,3 +1,33 @@
* 1.34.3 (2017-06-07)
* fixed namespaces introduction
* 1.34.2 (2017-06-05)
* fixed namespaces introduction
* 1.34.1 (2017-06-05)
* fixed namespaces introduction
* 1.34.0 (2017-06-05)
* added support for PHPUnit 6 when testing extensions
* fixed PHP 7.2 compatibility
* fixed template name generation in Twig_Environment::createTemplate()
* removed final tag on Twig_TokenParser_Include
* added namespaced aliases for all (non-deprecated) classes and interfaces
* dropped HHVM support
* dropped PHP 5.2 support
* 1.33.2 (2017-04-20)
* fixed edge case in the method cache for Twig attributes
* 1.33.1 (2017-04-18)
* fixed the empty() test
* 1.33.0 (2017-03-22)
* fixed a race condition handling when writing cache files

View File

@ -27,7 +27,7 @@
"forum": "https://groups.google.com/forum/#!forum/twig-users"
},
"require": {
"php": ">=5.2.7"
"php": ">=5.3.3"
},
"require-dev": {
"symfony/phpunit-bridge": "~3.3@dev",
@ -37,11 +37,14 @@
"autoload": {
"psr-0" : {
"Twig_" : "lib/"
},
"psr-4" : {
"Twig\\" : "src/"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.33-dev"
"dev-master": "1.34-dev"
}
}
}

View File

@ -464,7 +464,7 @@ from the token stream (``$this->parser->getStream()``):
type/value a syntax error is thrown. Otherwise, if the type and value are correct,
the token is returned and the stream moves to the next token.
* ``look()``: Looks a the next token without consuming it.
* ``look()``: Looks at the next token without consuming it.
Parsing expressions is done by calling the ``parseExpression()`` like we did for
the ``set`` tag.
@ -838,7 +838,7 @@ instance on the environment that knows how to instantiate such runtime classes
It is now possible to move the runtime logic to a new
``Project_Twig_RuntimeExtension`` class and use it directly in the extension::
class Project_Twig_RuntimeExtension extends Twig_Extension
class Project_Twig_RuntimeExtension
{
private $rot13Provider;

View File

@ -18,6 +18,14 @@ separator using the additional arguments:
{{ 9800.333|number_format(2, '.', ',') }}
To format negative numbers, wrap the number with parentheses (needed because of
Twig's :ref:`precedence of operators <twig-expressions>`:
.. code-block:: jinja
{{ -9800.333|number_format(2, '.', ',') }} {# outputs : -9 #}
{{ (-9800.333)|number_format(2, '.', ',') }} {# outputs : -9.800,33 #}
If no formatting options are provided then Twig will use the default formatting
options of:

View File

@ -28,7 +28,8 @@ Slim, Yii, Laravel, Codeigniter and Kohana — just to name a few.
Prerequisites
-------------
Twig needs at least **PHP 5.2.7** to run.
Twig needs at least **PHP 5.2.7** to run. As of 1.34, the minimum requirement
was bumped to **PHP 5.3.3**.
Installation
------------

View File

@ -15,7 +15,7 @@
#ifndef PHP_TWIG_H
#define PHP_TWIG_H
#define PHP_TWIG_VERSION "1.33.0"
#define PHP_TWIG_VERSION "1.34.3"
#include "php.h"

View File

@ -48,3 +48,7 @@ abstract class Twig_BaseNodeVisitor implements Twig_NodeVisitorInterface
*/
abstract protected function doLeaveNode(Twig_Node $node, Twig_Environment $env);
}
class_alias('Twig_BaseNodeVisitor', 'Twig\NodeVisitor\AbstractNodeVisitor', false);
class_exists('Twig_Environment');
class_exists('Twig_Node');

View File

@ -89,3 +89,5 @@ class Twig_Cache_Filesystem implements Twig_CacheInterface
return (int) @filemtime($key);
}
}
class_alias('Twig_Cache_Filesystem', 'Twig\Cache\FilesystemCache', false);

View File

@ -36,3 +36,5 @@ class Twig_Cache_Null implements Twig_CacheInterface
return 0;
}
}
class_alias('Twig_Cache_Null', 'Twig\Cache\NullCache', false);

View File

@ -54,3 +54,5 @@ interface Twig_CacheInterface
*/
public function getTimestamp($key);
}
class_alias('Twig_CacheInterface', 'Twig\Cache\CacheInterface', false);

View File

@ -279,3 +279,6 @@ class Twig_Compiler implements Twig_CompilerInterface
return sprintf('__internal_%s', hash('sha256', uniqid(mt_rand(), true), false));
}
}
class_alias('Twig_Compiler', 'Twig\Compiler', false);
class_exists('Twig_Node');

View File

@ -35,3 +35,5 @@ class Twig_ContainerRuntimeLoader implements Twig_RuntimeLoaderInterface
}
}
}
class_alias('Twig_ContainerRuntimeLoader', 'Twig\RuntimeLoader\ContainerRuntimeLoader', false);

View File

@ -16,11 +16,11 @@
*/
class Twig_Environment
{
const VERSION = '1.33.0';
const VERSION_ID = 13300;
const VERSION = '1.34.3';
const VERSION_ID = 13403;
const MAJOR_VERSION = 1;
const MINOR_VERSION = 33;
const RELEASE_VERSION = 0;
const MINOR_VERSION = 34;
const RELEASE_VERSION = 3;
const EXTRA_VERSION = '';
protected $charset;
@ -489,7 +489,7 @@ class Twig_Environment
*/
public function createTemplate($template)
{
$name = sprintf('__string_template__%s', hash('sha256', uniqid(mt_rand(), true), false));
$name = sprintf('__string_template__%s', hash('sha256', $template, false));
$loader = new Twig_Loader_Chain(array(
new Twig_Loader_Array(array($name => $template)),
@ -758,7 +758,7 @@ class Twig_Environment
public function setLoader(Twig_LoaderInterface $loader)
{
if (!$loader instanceof Twig_SourceContextLoaderInterface && 0 !== strpos(get_class($loader), 'Mock_Twig_LoaderInterface')) {
if (!$loader instanceof Twig_SourceContextLoaderInterface && 0 !== strpos(get_class($loader), 'Mock_')) {
@trigger_error(sprintf('Twig loader "%s" should implement Twig_SourceContextLoaderInterface since version 1.27.', get_class($loader)), E_USER_DEPRECATED);
}
@ -831,6 +831,12 @@ class Twig_Environment
public function hasExtension($class)
{
$class = ltrim($class, '\\');
if (!isset($this->extensionsByClass[$class]) && class_exists($class, false)) {
// For BC/FC with namespaced aliases
$class = new ReflectionClass($class);
$class = $class->name;
}
if (isset($this->extensions[$class])) {
if ($class !== get_class($this->extensions[$class])) {
@trigger_error(sprintf('Referencing the "%s" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', $class), E_USER_DEPRECATED);
@ -860,6 +866,11 @@ class Twig_Environment
public function getExtension($class)
{
$class = ltrim($class, '\\');
if (!isset($this->extensionsByClass[$class]) && class_exists($class, false)) {
// For BC/FC with namespaced aliases
$class = new ReflectionClass($class);
$class = $class->name;
}
if (isset($this->extensions[$class])) {
if ($class !== get_class($this->extensions[$class])) {
@ -938,6 +949,12 @@ class Twig_Environment
}
$class = ltrim($name, '\\');
if (!isset($this->extensionsByClass[$class]) && class_exists($class, false)) {
// For BC/FC with namespaced aliases
$class = new ReflectionClass($class);
$class = $class->name;
}
if (isset($this->extensions[$class])) {
if ($class !== get_class($this->extensions[$class])) {
@trigger_error(sprintf('Referencing the "%s" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', $class), E_USER_DEPRECATED);
@ -1559,3 +1576,5 @@ class Twig_Environment
$this->optionsHash = implode(':', $hashParts);
}
}
class_alias('Twig_Environment', 'Twig\Environment', false);

View File

@ -332,11 +332,6 @@ class Twig_Error extends Exception
$r = new ReflectionObject($template);
$file = $r->getFileName();
// hhvm has a bug where eval'ed files comes out as the current directory
if (is_dir($file)) {
$file = '';
}
$exceptions = array($e = $this);
while (($e instanceof self || method_exists($e, 'getPrevious')) && $e = $e->getPrevious()) {
$exceptions[] = $e;
@ -363,3 +358,6 @@ class Twig_Error extends Exception
}
}
}
class_alias('Twig_Error', 'Twig\Error\Error', false);
class_exists('Twig_Source');

View File

@ -36,3 +36,5 @@ class Twig_Error_Loader extends Twig_Error
$this->setTemplateLine(false);
}
}
class_alias('Twig_Error_Loader', 'Twig\Error\LoaderError', false);

View File

@ -18,3 +18,5 @@
class Twig_Error_Runtime extends Twig_Error
{
}
class_alias('Twig_Error_Runtime', 'Twig\Error\RuntimeError', false);

View File

@ -51,3 +51,5 @@ class Twig_Error_Syntax extends Twig_Error
return array_keys($alternatives);
}
}
class_alias('Twig_Error_Syntax', 'Twig\Error\SyntaxError', false);

View File

@ -27,3 +27,5 @@ interface Twig_ExistsLoaderInterface
*/
public function exists($name);
}
class_alias('Twig_ExistsLoaderInterface', 'Twig\Loader\ExistsLoaderInterface', false);

View File

@ -737,3 +737,5 @@ class Twig_ExpressionParser
return true;
}
}
class_alias('Twig_ExpressionParser', 'Twig\ExpressionParser', false);

View File

@ -8,6 +8,7 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
abstract class Twig_Extension implements Twig_ExtensionInterface
{
/**
@ -63,3 +64,6 @@ abstract class Twig_Extension implements Twig_ExtensionInterface
return get_class($this);
}
}
class_alias('Twig_Extension', 'Twig\Extension\AbstractExtension', false);
class_exists('Twig_Environment');

View File

@ -1,8 +1,7 @@
<?php
if (!defined('ENT_SUBSTITUTE')) {
// use 0 as hhvm does not support several flags yet
define('ENT_SUBSTITUTE', 0);
define('ENT_SUBSTITUTE', 8);
}
/*
@ -1006,30 +1005,22 @@ function twig_escape_filter(Twig_Environment $env, $string, $strategy = 'html',
// Using a static variable to avoid initializing the array
// each time the function is called. Moving the declaration on the
// top of the function slow downs other escaping strategies.
static $htmlspecialcharsCharsets;
if (null === $htmlspecialcharsCharsets) {
if (defined('HHVM_VERSION')) {
$htmlspecialcharsCharsets = array('utf-8' => true, 'UTF-8' => true);
} else {
$htmlspecialcharsCharsets = array(
'ISO-8859-1' => true, 'ISO8859-1' => true,
'ISO-8859-15' => true, 'ISO8859-15' => true,
'utf-8' => true, 'UTF-8' => true,
'CP866' => true, 'IBM866' => true, '866' => true,
'CP1251' => true, 'WINDOWS-1251' => true, 'WIN-1251' => true,
'1251' => true,
'CP1252' => true, 'WINDOWS-1252' => true, '1252' => true,
'KOI8-R' => true, 'KOI8-RU' => true, 'KOI8R' => true,
'BIG5' => true, '950' => true,
'GB2312' => true, '936' => true,
'BIG5-HKSCS' => true,
'SHIFT_JIS' => true, 'SJIS' => true, '932' => true,
'EUC-JP' => true, 'EUCJP' => true,
'ISO8859-5' => true, 'ISO-8859-5' => true, 'MACROMAN' => true,
);
}
}
static $htmlspecialcharsCharsets = array(
'ISO-8859-1' => true, 'ISO8859-1' => true,
'ISO-8859-15' => true, 'ISO8859-15' => true,
'utf-8' => true, 'UTF-8' => true,
'CP866' => true, 'IBM866' => true, '866' => true,
'CP1251' => true, 'WINDOWS-1251' => true, 'WIN-1251' => true,
'1251' => true,
'CP1252' => true, 'WINDOWS-1252' => true, '1252' => true,
'KOI8-R' => true, 'KOI8-RU' => true, 'KOI8R' => true,
'BIG5' => true, '950' => true,
'GB2312' => true, '936' => true,
'BIG5-HKSCS' => true,
'SHIFT_JIS' => true, 'SJIS' => true, '932' => true,
'EUC-JP' => true, 'EUCJP' => true,
'ISO8859-5' => true, 'ISO-8859-5' => true, 'MACROMAN' => true,
);
if (isset($htmlspecialcharsCharsets[$charset])) {
return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset);
@ -1264,15 +1255,23 @@ if (function_exists('mb_get_info')) {
*/
function twig_length_filter(Twig_Environment $env, $thing)
{
if (null === $thing) {
return 0;
}
if (is_scalar($thing)) {
return mb_strlen($thing, $env->getCharset());
}
if (method_exists($thing, '__toString') && !$thing instanceof \Countable) {
if (is_object($thing) && method_exists($thing, '__toString') && !$thing instanceof \Countable) {
return mb_strlen((string) $thing, $env->getCharset());
}
return count($thing);
if ($thing instanceof \Countable || is_array($thing)) {
return count($thing);
}
return 1;
}
/**
@ -1355,15 +1354,23 @@ else {
*/
function twig_length_filter(Twig_Environment $env, $thing)
{
if (null === $thing) {
return 0;
}
if (is_scalar($thing)) {
return strlen($thing);
}
if (method_exists($thing, '__toString') && !$thing instanceof \Countable) {
if (is_object($thing) && method_exists($thing, '__toString') && !$thing instanceof \Countable) {
return strlen((string) $thing);
}
return count($thing);
if ($thing instanceof \Countable || is_array($thing)) {
return count($thing);
}
return 1;
}
/**
@ -1425,7 +1432,7 @@ function twig_test_empty($value)
return 0 == count($value);
}
if (method_exists($value, '__toString')) {
if (is_object($value) && method_exists($value, '__toString')) {
return '' === (string) $value;
}
@ -1601,3 +1608,5 @@ function twig_array_batch($items, $size, $fill = null)
return $result;
}
class_alias('Twig_Extension_Core', 'Twig\Extension\CoreExtension', false);

View File

@ -23,7 +23,7 @@ class Twig_Extension_Debug extends Twig_Extension
// false means that it was not set (and the default is on) or it explicitly enabled
// xdebug.overload_var_dump produces HTML only when html_errors is also enabled
&& (false === ini_get('html_errors') || ini_get('html_errors'))
|| 'cli' === php_sapi_name()
|| 'cli' === PHP_SAPI
;
return array(
@ -63,3 +63,5 @@ function twig_var_dump(Twig_Environment $env, $context)
return ob_get_clean();
}
class_alias('Twig_Extension_Debug', 'Twig\Extension\DebugExtension', false);

View File

@ -108,3 +108,5 @@ function twig_raw_filter($string)
{
return $string;
}
class_alias('Twig_Extension_Escaper', 'Twig\Extension\EscaperExtension', false);

View File

@ -20,3 +20,5 @@
interface Twig_Extension_GlobalsInterface
{
}
class_alias('Twig_Extension_GlobalsInterface', 'Twig\Extension\GlobalsInterface', false);

View File

@ -20,3 +20,5 @@
interface Twig_Extension_InitRuntimeInterface
{
}
class_alias('Twig_Extension_InitRuntimeInterface', 'Twig\Extension\InitRuntimeInterface', false);

View File

@ -31,3 +31,5 @@ class Twig_Extension_Optimizer extends Twig_Extension
return 'optimizer';
}
}
class_alias('Twig_Extension_Optimizer', 'Twig\Extension\OptimizerExtension', false);

View File

@ -44,3 +44,6 @@ class Twig_Extension_Profiler extends Twig_Extension
return 'profiler';
}
}
class_alias('Twig_Extension_Profiler', 'Twig\Extension\ProfilerExtension', false);
class_exists('Twig_Profiler_Profile');

View File

@ -99,3 +99,5 @@ class Twig_Extension_Sandbox extends Twig_Extension
return 'sandbox';
}
}
class_alias('Twig_Extension_Sandbox', 'Twig\Extension\SandboxExtension', false);

View File

@ -108,3 +108,5 @@ class Twig_Extension_Staging extends Twig_Extension
return 'staging';
}
}
class_alias('Twig_Extension_Staging', 'Twig\Extension\StagingExtension', false);

View File

@ -43,3 +43,5 @@ function twig_template_from_string(Twig_Environment $env, $template)
{
return $env->createTemplate((string) $template);
}
class_alias('Twig_Extension_StringLoader', 'Twig\Extension\StringLoaderExtension', false);

View File

@ -85,3 +85,6 @@ interface Twig_ExtensionInterface
*/
public function getName();
}
class_alias('Twig_ExtensionInterface', 'Twig\Extension\ExtensionInterface', false);
class_exists('Twig_Environment');

View File

@ -35,3 +35,5 @@ class Twig_FactoryRuntimeLoader implements Twig_RuntimeLoaderInterface
}
}
}
class_alias('Twig_FactoryRuntimeLoader', 'Twig\RuntimeLoader\FactoryRuntimeLoader', false);

View File

@ -56,3 +56,5 @@ class Twig_FileExtensionEscapingStrategy
}
}
}
class_alias('Twig_FileExtensionEscapingStrategy', 'Twig\FileExtensionEscapingStrategy', false);

View File

@ -420,3 +420,5 @@ class Twig_Lexer implements Twig_LexerInterface
$this->state = array_pop($this->states);
}
}
class_alias('Twig_Lexer', 'Twig\Lexer', false);

View File

@ -80,7 +80,7 @@ class Twig_Loader_Array implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name));
}
return $this->templates[$name];
return $name.':'.$this->templates[$name];
}
public function isFresh($name, $time)
@ -93,3 +93,5 @@ class Twig_Loader_Array implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
return true;
}
}
class_alias('Twig_Loader_Array', 'Twig\Loader\ArrayLoader', false);

View File

@ -147,3 +147,5 @@ class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterf
throw new Twig_Error_Loader(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : ''));
}
}
class_alias('Twig_Loader_Chain', 'Twig\Loader\ChainLoader', false);

View File

@ -286,3 +286,5 @@ class Twig_Loader_Filesystem implements Twig_LoaderInterface, Twig_ExistsLoaderI
;
}
}
class_alias('Twig_Loader_Filesystem', 'Twig\Loader\FilesystemLoader', false);

View File

@ -53,3 +53,5 @@ interface Twig_LoaderInterface
*/
public function isFresh($name, $time);
}
class_alias('Twig_LoaderInterface', 'Twig\Loader\LoaderInterface', false);

View File

@ -35,3 +35,5 @@ class Twig_Markup implements Countable
return function_exists('mb_get_info') ? mb_strlen($this->content, $this->charset) : strlen($this->content);
}
}
class_alias('Twig_Markup', 'Twig\Markup', false);

View File

@ -251,3 +251,6 @@ class Twig_Node implements Twig_NodeInterface
return $this->name;
}
}
class_alias('Twig_Node', 'Twig\Node\Node', false);
class_exists('Twig_Compiler');

View File

@ -32,3 +32,5 @@ class Twig_Node_AutoEscape extends Twig_Node
$compiler->subcompile($this->getNode('body'));
}
}
class_alias('Twig_Node_AutoEscape', 'Twig\Node\AutoEscapeNode', false);

View File

@ -37,3 +37,5 @@ class Twig_Node_Block extends Twig_Node
;
}
}
class_alias('Twig_Node_Block', 'Twig\Node\BlockNode', false);

View File

@ -30,3 +30,5 @@ class Twig_Node_BlockReference extends Twig_Node implements Twig_NodeOutputInter
;
}
}
class_alias('Twig_Node_BlockReference', 'Twig\Node\BlockReferenceNode', false);

View File

@ -17,3 +17,5 @@
class Twig_Node_Body extends Twig_Node
{
}
class_alias('Twig_Node_Body', 'Twig\Node\BodyNode', false);

View File

@ -76,3 +76,5 @@ class Twig_Node_CheckSecurity extends Twig_Node
;
}
}
class_alias('Twig_Node_CheckSecurity', 'Twig\Node\CheckSecurityNode', false);

View File

@ -31,3 +31,5 @@ class Twig_Node_Do extends Twig_Node
;
}
}
class_alias('Twig_Node_Do', 'Twig\Node\DoNode', false);

View File

@ -42,3 +42,5 @@ class Twig_Node_Embed extends Twig_Node_Include
;
}
}
class_alias('Twig_Node_Embed', 'Twig\Node\EmbedNode', false);

View File

@ -18,3 +18,5 @@
abstract class Twig_Node_Expression extends Twig_Node
{
}
class_alias('Twig_Node_Expression', 'Twig\Node\Expression\AbstractExpression', false);

View File

@ -79,3 +79,5 @@ class Twig_Node_Expression_Array extends Twig_Node_Expression
$compiler->raw(')');
}
}
class_alias('Twig_Node_Expression_Array', 'Twig\Node\Expression\ArrayExpression', false);

View File

@ -21,3 +21,5 @@ class Twig_Node_Expression_AssignName extends Twig_Node_Expression_Name
;
}
}
class_alias('Twig_Node_Expression_AssignName', 'Twig\Node\Expression\AssignNameExpression', false);

View File

@ -33,3 +33,5 @@ abstract class Twig_Node_Expression_Binary extends Twig_Node_Expression
abstract public function operator(Twig_Compiler $compiler);
}
class_alias('Twig_Node_Expression_Binary', 'Twig\Node\Expression\Binary\AbstractBinary', false);

View File

@ -16,3 +16,5 @@ class Twig_Node_Expression_Binary_Add extends Twig_Node_Expression_Binary
return $compiler->raw('+');
}
}
class_alias('Twig_Node_Expression_Binary_Add', 'Twig\Node\Expression\Binary\AddBinary', false);

View File

@ -16,3 +16,5 @@ class Twig_Node_Expression_Binary_And extends Twig_Node_Expression_Binary
return $compiler->raw('&&');
}
}
class_alias('Twig_Node_Expression_Binary_And', 'Twig\Node\Expression\Binary\AndBinary', false);

View File

@ -16,3 +16,5 @@ class Twig_Node_Expression_Binary_BitwiseAnd extends Twig_Node_Expression_Binary
return $compiler->raw('&');
}
}
class_alias('Twig_Node_Expression_Binary_BitwiseAnd', 'Twig\Node\Expression\Binary\BitwiseAndBinary', false);

View File

@ -16,3 +16,5 @@ class Twig_Node_Expression_Binary_BitwiseOr extends Twig_Node_Expression_Binary
return $compiler->raw('|');
}
}
class_alias('Twig_Node_Expression_Binary_BitwiseOr', 'Twig\Node\Expression\Binary\BitwiseOrBinary', false);

View File

@ -16,3 +16,5 @@ class Twig_Node_Expression_Binary_BitwiseXor extends Twig_Node_Expression_Binary
return $compiler->raw('^');
}
}
class_alias('Twig_Node_Expression_Binary_BitwiseXor', 'Twig\Node\Expression\Binary\BitwiseXorBinary', false);

View File

@ -16,3 +16,5 @@ class Twig_Node_Expression_Binary_Concat extends Twig_Node_Expression_Binary
return $compiler->raw('.');
}
}
class_alias('Twig_Node_Expression_Binary_Concat', 'Twig\Node\Expression\Binary\ConcatBinary', false);

View File

@ -16,3 +16,5 @@ class Twig_Node_Expression_Binary_Div extends Twig_Node_Expression_Binary
return $compiler->raw('/');
}
}
class_alias('Twig_Node_Expression_Binary_Div', 'Twig\Node\Expression\Binary\DivBinary', false);

View File

@ -28,3 +28,5 @@ class Twig_Node_Expression_Binary_EndsWith extends Twig_Node_Expression_Binary
return $compiler->raw('');
}
}
class_alias('Twig_Node_Expression_Binary_EndsWith', 'Twig\Node\Expression\Binary\EndsWithBinary', false);

View File

@ -15,3 +15,5 @@ class Twig_Node_Expression_Binary_Equal extends Twig_Node_Expression_Binary
return $compiler->raw('==');
}
}
class_alias('Twig_Node_Expression_Binary_Equal', 'Twig\Node\Expression\Binary\EqualBinary', false);

View File

@ -22,3 +22,5 @@ class Twig_Node_Expression_Binary_FloorDiv extends Twig_Node_Expression_Binary
return $compiler->raw('/');
}
}
class_alias('Twig_Node_Expression_Binary_FloorDiv', 'Twig\Node\Expression\Binary\FloorDivBinary', false);

View File

@ -15,3 +15,5 @@ class Twig_Node_Expression_Binary_Greater extends Twig_Node_Expression_Binary
return $compiler->raw('>');
}
}
class_alias('Twig_Node_Expression_Binary_Greater', 'Twig\Node\Expression\Binary\GreaterBinary', false);

View File

@ -15,3 +15,5 @@ class Twig_Node_Expression_Binary_GreaterEqual extends Twig_Node_Expression_Bina
return $compiler->raw('>=');
}
}
class_alias('Twig_Node_Expression_Binary_GreaterEqual', 'Twig\Node\Expression\Binary\GreaterEqualBinary', false);

View File

@ -26,3 +26,5 @@ class Twig_Node_Expression_Binary_In extends Twig_Node_Expression_Binary
return $compiler->raw('in');
}
}
class_alias('Twig_Node_Expression_Binary_In', 'Twig\Node\Expression\Binary\InBinary', false);

View File

@ -15,3 +15,5 @@ class Twig_Node_Expression_Binary_Less extends Twig_Node_Expression_Binary
return $compiler->raw('<');
}
}
class_alias('Twig_Node_Expression_Binary_Less', 'Twig\Node\Expression\Binary\LessBinary', false);

View File

@ -15,3 +15,5 @@ class Twig_Node_Expression_Binary_LessEqual extends Twig_Node_Expression_Binary
return $compiler->raw('<=');
}
}
class_alias('Twig_Node_Expression_Binary_LessEqual', 'Twig\Node\Expression\Binary\LessEqualBinary', false);

View File

@ -26,3 +26,5 @@ class Twig_Node_Expression_Binary_Matches extends Twig_Node_Expression_Binary
return $compiler->raw('');
}
}
class_alias('Twig_Node_Expression_Binary_Matches', 'Twig\Node\Expression\Binary\MatchesBinary', false);

View File

@ -16,3 +16,5 @@ class Twig_Node_Expression_Binary_Mod extends Twig_Node_Expression_Binary
return $compiler->raw('%');
}
}
class_alias('Twig_Node_Expression_Binary_Mod', 'Twig\Node\Expression\Binary\ModBinary', false);

View File

@ -16,3 +16,5 @@ class Twig_Node_Expression_Binary_Mul extends Twig_Node_Expression_Binary
return $compiler->raw('*');
}
}
class_alias('Twig_Node_Expression_Binary_Mul', 'Twig\Node\Expression\Binary\MulBinary', false);

View File

@ -15,3 +15,5 @@ class Twig_Node_Expression_Binary_NotEqual extends Twig_Node_Expression_Binary
return $compiler->raw('!=');
}
}
class_alias('Twig_Node_Expression_Binary_NotEqual', 'Twig\Node\Expression\Binary\NotEqualBinary', false);

View File

@ -26,3 +26,5 @@ class Twig_Node_Expression_Binary_NotIn extends Twig_Node_Expression_Binary
return $compiler->raw('not in');
}
}
class_alias('Twig_Node_Expression_Binary_NotIn', 'Twig\Node\Expression\Binary\NotInBinary', false);

View File

@ -16,3 +16,5 @@ class Twig_Node_Expression_Binary_Or extends Twig_Node_Expression_Binary
return $compiler->raw('||');
}
}
class_alias('Twig_Node_Expression_Binary_Or', 'Twig\Node\Expression\Binary\OrBinary', false);

View File

@ -30,3 +30,5 @@ class Twig_Node_Expression_Binary_Power extends Twig_Node_Expression_Binary
return $compiler->raw('**');
}
}
class_alias('Twig_Node_Expression_Binary_Power', 'Twig\Node\Expression\Binary\PowerBinary', false);

View File

@ -26,3 +26,5 @@ class Twig_Node_Expression_Binary_Range extends Twig_Node_Expression_Binary
return $compiler->raw('..');
}
}
class_alias('Twig_Node_Expression_Binary_Range', 'Twig\Node\Expression\Binary\RangeBinary', false);

View File

@ -28,3 +28,5 @@ class Twig_Node_Expression_Binary_StartsWith extends Twig_Node_Expression_Binary
return $compiler->raw('');
}
}
class_alias('Twig_Node_Expression_Binary_StartsWith', 'Twig\Node\Expression\Binary\StartsWithBinary', false);

View File

@ -16,3 +16,5 @@ class Twig_Node_Expression_Binary_Sub extends Twig_Node_Expression_Binary
return $compiler->raw('-');
}
}
class_alias('Twig_Node_Expression_Binary_Sub', 'Twig\Node\Expression\Binary\SubBinary', false);

View File

@ -89,3 +89,5 @@ class Twig_Node_Expression_BlockReference extends Twig_Node_Expression
return $compiler->raw(')');
}
}
class_alias('Twig_Node_Expression_BlockReference', 'Twig\Node\Expression\BlockReferenceExpression', false);

View File

@ -287,3 +287,5 @@ abstract class Twig_Node_Expression_Call extends Twig_Node_Expression
return $this->reflector = array($r, $callable);
}
}
class_alias('Twig_Node_Expression_Call', 'Twig\Node\Expression\CallExpression', false);

View File

@ -29,3 +29,5 @@ class Twig_Node_Expression_Conditional extends Twig_Node_Expression
;
}
}
class_alias('Twig_Node_Expression_Conditional', 'Twig\Node\Expression\ConditionalExpression', false);

Some files were not shown because too many files have changed in this diff Show More