mirror of
https://github.com/getgrav/grav.git
synced 2025-11-01 10:56:21 +01:00
Created a .dependencies and some other install cleanup
This commit is contained in:
23
.dependencies
Normal file
23
.dependencies
Normal file
@@ -0,0 +1,23 @@
|
||||
git:
|
||||
problems:
|
||||
url: git@github.com:getgrav/grav-plugin-problems.git
|
||||
path: user/plugins/problems
|
||||
branch: develop
|
||||
error:
|
||||
url: git@github.com:getgrav/grav-plugin-error.git
|
||||
path: user/plugins/error
|
||||
branch: develop
|
||||
antimatter:
|
||||
url: git@github.com:getgrav/grav-theme-antimatter.git
|
||||
path: user/themes/antimatter
|
||||
branch: develop
|
||||
links:
|
||||
problems:
|
||||
src: ../grav-plugin-problems
|
||||
path: user/plugins/problems
|
||||
error:
|
||||
src: ../grav-plugin-error
|
||||
path: user/plugins/error
|
||||
antimatter:
|
||||
src: ../grav-theme-antimatter
|
||||
path: user/themes/antimatter
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -12,9 +12,6 @@ Thumbs.db
|
||||
*.swp
|
||||
|
||||
# Grav Specific
|
||||
/cache
|
||||
/logs
|
||||
/images
|
||||
/user/data/*
|
||||
!/user/data/index.html
|
||||
user/plugins/**/
|
||||
|
||||
4
bin/grav
4
bin/grav
@@ -15,7 +15,7 @@ if (!file_exists(ROOT_DIR . 'index.php')) {
|
||||
|
||||
$app = new Application('Grav CLI Application', '0.1.0');
|
||||
$app->addCommands(array(
|
||||
new Grav\Console\InstallCommand(),
|
||||
new Grav\Console\PackageCommand(),
|
||||
new Grav\Console\SetupCommand(),
|
||||
new Grav\Console\CleanCommand(),
|
||||
));
|
||||
$app->run();
|
||||
|
||||
0
cache/.gitkeep
vendored
Normal file
0
cache/.gitkeep
vendored
Normal file
0
images/.gitkeep
Normal file
0
images/.gitkeep
Normal file
0
logs/.gitkeep
Normal file
0
logs/.gitkeep
Normal file
@@ -8,20 +8,11 @@ use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
|
||||
|
||||
class PackageCommand extends Command {
|
||||
class CleanCommand extends Command {
|
||||
|
||||
protected $destination_dir = 'distribution';
|
||||
|
||||
protected $paths_to_create = [
|
||||
'cache',
|
||||
'logs',
|
||||
'images',
|
||||
];
|
||||
|
||||
protected $paths_to_remove = [
|
||||
'cache',
|
||||
'logs',
|
||||
'images',
|
||||
'user/plugins/email/vendor/swiftmailer/swiftmailer/.travis.yml',
|
||||
'user/plugins/email/vendor/swiftmailer/swiftmailer/build.xml',
|
||||
'user/plugins/email/vendor/swiftmailer/swiftmailer/composer.json',
|
||||
@@ -96,15 +87,9 @@ class PackageCommand extends Command {
|
||||
|
||||
protected function configure() {
|
||||
$this
|
||||
->setName("package")
|
||||
->setDescription("Handles packaging chores for Grav")
|
||||
->addOption(
|
||||
'clean',
|
||||
'c',
|
||||
InputOption::VALUE_NONE,
|
||||
'Clean out extra files in vendor folder'
|
||||
)
|
||||
->setHelp('The <info>package</info> command does things and stuff');
|
||||
->setName("clean")
|
||||
->setDescription("Handles cl chores for Grav")
|
||||
->setHelp('The <info>clean</info> clean extraneous folders and data');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
@@ -117,9 +102,8 @@ class PackageCommand extends Command {
|
||||
$output->getFormatter()->setStyle('green', new OutputFormatterStyle('green'));
|
||||
$output->getFormatter()->setStyle('magenta', new OutputFormatterStyle('magenta'));
|
||||
|
||||
if ($input->getOption('clean')) {
|
||||
$this->cleanPaths($output);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -129,25 +113,25 @@ class PackageCommand extends Command {
|
||||
$output->writeln('');
|
||||
$output->writeln('<red>DELETING</red>');
|
||||
|
||||
$anything = false;
|
||||
|
||||
foreach($this->paths_to_remove as $path) {
|
||||
$path = ROOT_DIR . $path;
|
||||
|
||||
if (is_dir($path) && @$this->rrmdir($path)) {
|
||||
$anything = true;
|
||||
$output->writeln('<red>dir: </red>' . $path);
|
||||
} elseif (is_file($path) && @unlink($path)) {
|
||||
$anything = true;
|
||||
$output->writeln('<red>file: </red>' . $path);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$anything) {
|
||||
$output->writeln('');
|
||||
$output->writeln('<green>CREATING</green>');
|
||||
$output->writeln('<green>Nothing to clean...</green>');
|
||||
}
|
||||
|
||||
foreach($this->paths_to_create as $path) {
|
||||
$path = ROOT_DIR . $path;
|
||||
if (@mkdir($path)) {
|
||||
$output->writeln('<green>dir: </green>' . $path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Recursively Delete folder - DANGEROUS! USE WITH CARE!!!!
|
||||
@@ -1,283 +0,0 @@
|
||||
<?php
|
||||
namespace Grav\Console;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Formatter\OutputFormatterStyle;
|
||||
|
||||
//Use the Composer classes
|
||||
// use Composer\Console\Application;
|
||||
// use Composer\Command\UpdateCommand;
|
||||
// use Symfony\Component\Console\Input\ArrayInput;
|
||||
|
||||
class InstallCommand extends Command
|
||||
{
|
||||
protected $directories = array('/cache',
|
||||
'/logs',
|
||||
'/images',
|
||||
'/user/accounts',
|
||||
'/user/config',
|
||||
'/user/pages',
|
||||
'/user/data',
|
||||
'/user/plugins',
|
||||
'/user/themes',
|
||||
);
|
||||
|
||||
protected $files = array(
|
||||
'/.htaccess',
|
||||
'/user/config/site.yaml',
|
||||
'/user/config/system.yaml',
|
||||
);
|
||||
|
||||
protected $mappings = array('/index.php' => '/index.php',
|
||||
'/composer.json' => '/composer.json',
|
||||
'/bin' => '/bin',
|
||||
'/system' => '/system',
|
||||
'/vendor' => '/vendor',
|
||||
'/user/plugins/error' => '/user/plugins/error',
|
||||
'/user/plugins/problems' => '/user/plugins/problems',
|
||||
'/user/themes/antimatter' => '/user/themes/antimatter',
|
||||
);
|
||||
|
||||
protected $default_file = "---\ntitle: HomePage\n---\n# HomePage\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque porttitor eu felis sed ornare. Sed a mauris venenatis, pulvinar velit vel, dictum enim. Phasellus ac rutrum velit. Nunc lorem purus, hendrerit sit amet augue aliquet, iaculis ultricies nisl. Suspendisse tincidunt euismod risus, quis feugiat arcu tincidunt eget. Nulla eros mi, commodo vel ipsum vel, aliquet congue odio. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque velit orci, laoreet at adipiscing eu, interdum quis nibh. Nunc a accumsan purus.";
|
||||
|
||||
protected $source;
|
||||
protected $destination;
|
||||
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('install')
|
||||
->setDescription('Installs the base Grav system')
|
||||
->addArgument(
|
||||
'destination',
|
||||
InputArgument::REQUIRED,
|
||||
'The destination directory to symlink into'
|
||||
)
|
||||
->addOption(
|
||||
'symlink',
|
||||
's',
|
||||
InputOption::VALUE_NONE,
|
||||
'Symlink the base grav system'
|
||||
)
|
||||
->setHelp(<<<EOT
|
||||
The <info>install</info> command help create a development environment that uses symbolic links to link the core of grav to the git cloned repository
|
||||
EOT
|
||||
);
|
||||
$this->source = getcwd();
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$this->destination = $input->getArgument('destination');
|
||||
|
||||
// Create a red output option
|
||||
$output->getFormatter()->setStyle('red', new OutputFormatterStyle('red'));
|
||||
$output->getFormatter()->setStyle('cyan', new OutputFormatterStyle('cyan'));
|
||||
$output->getFormatter()->setStyle('magenta', new OutputFormatterStyle('magenta'));
|
||||
|
||||
// Symlink the Core Stuff
|
||||
if ($input->getOption('symlink')) {
|
||||
// Create Some core stuff if it doesn't exist
|
||||
$this->createDirectories($output);
|
||||
|
||||
// Loop through the symlink mappings and create the symlinks
|
||||
$this->symlink($output);
|
||||
|
||||
// Copy the Core STuff
|
||||
} else {
|
||||
$options = true;
|
||||
// Create Some core stuff if it doesn't exist
|
||||
$this->createDirectories($output);
|
||||
|
||||
// Loop through the symlink mappings and copy what otherwise would be symlinks
|
||||
$this->copy($output);
|
||||
}
|
||||
|
||||
$this->pages($output);
|
||||
$this->initFiles($output);
|
||||
$this->perms($output);
|
||||
}
|
||||
|
||||
private function createDirectories($output)
|
||||
{
|
||||
$output->writeln('');
|
||||
$output->writeln('<comment>Creating Directories</comment>');
|
||||
$dirs_created = false;
|
||||
|
||||
if (!file_exists($this->destination)) {
|
||||
mkdir($this->destination, 0777, true);
|
||||
}
|
||||
|
||||
foreach ($this->directories as $dir) {
|
||||
if (!file_exists($this->destination . $dir)) {
|
||||
$dirs_created = true;
|
||||
$output->writeln(' <cyan>' . $dir . '</cyan>');
|
||||
mkdir($this->destination . $dir, 0777, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$dirs_created) {
|
||||
$output->writeln(' <red>Directories already exist</red>');
|
||||
}
|
||||
}
|
||||
|
||||
private function copy($output)
|
||||
{
|
||||
$output->writeln('');
|
||||
$output->writeln('<comment>Copying Files</comment>');
|
||||
|
||||
|
||||
foreach ($this->mappings as $source => $target) {
|
||||
if ((int) $source == $source) {
|
||||
$source = $target;
|
||||
}
|
||||
|
||||
$from = $this->source . $source;
|
||||
$to = $this->destination . $target;
|
||||
|
||||
$output->writeln(' <cyan>' . $source . '</cyan> <comment>-></comment> ' . $to);
|
||||
$this->rcopy($from, $to);
|
||||
}
|
||||
}
|
||||
|
||||
private function symlink($output)
|
||||
{
|
||||
$output->writeln('');
|
||||
$output->writeln('<comment>Resetting Symbolic Links</comment>');
|
||||
|
||||
|
||||
foreach ($this->mappings as $source => $target) {
|
||||
if ((int) $source == $source) {
|
||||
$source = $target;
|
||||
}
|
||||
|
||||
$from = $this->source . $source;
|
||||
$to = $this->destination . $target;
|
||||
|
||||
$output->writeln(' <cyan>' . $source . '</cyan> <comment>-></comment> ' . $to);
|
||||
@unlink ($to);
|
||||
symlink ($from, $to);
|
||||
}
|
||||
}
|
||||
|
||||
private function initFiles($output)
|
||||
{
|
||||
$this->check($output);
|
||||
|
||||
$output->writeln('');
|
||||
$output->writeln('<comment>File Initializing</comment>');
|
||||
$files_init = false;
|
||||
|
||||
// Copy files if they do not exist
|
||||
foreach ($this->files as $source => $target) {
|
||||
if ((int) $source == $source) {
|
||||
$source = $target;
|
||||
}
|
||||
|
||||
$from = $this->source . $source;
|
||||
$to = $this->destination . $target;
|
||||
|
||||
if (!file_exists($to)) {
|
||||
$files_init = true;
|
||||
copy($from, $to);
|
||||
$output->writeln(' <cyan>'.$target.'</cyan> <comment>-></comment> Created');
|
||||
}
|
||||
}
|
||||
|
||||
if (!$files_init) {
|
||||
$output->writeln(' <red>Files already exist</red>');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function pages($output)
|
||||
{
|
||||
$output->writeln('');
|
||||
$output->writeln('<comment>Pages Initializing</comment>');
|
||||
|
||||
// get pages files and initialize if no pages exist
|
||||
$pages_dir = $this->destination . '/user/pages';
|
||||
$pages_files = array_diff(scandir($pages_dir), array('..', '.'));
|
||||
|
||||
if (count($pages_files) == 0) {
|
||||
$destination = $this->source . '/user/pages';
|
||||
$this->rcopy($destination, $pages_dir);
|
||||
$output->writeln(' <cyan>'.$destination.'</cyan> <comment>-></comment> Created');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private function perms($output)
|
||||
{
|
||||
$output->writeln('');
|
||||
$output->writeln('<comment>Permisions Initializing</comment>');
|
||||
|
||||
$dir_perms = 0755;
|
||||
|
||||
// get pages files and initialize if no pages exist
|
||||
chmod($this->destination.'/bin/grav', $dir_perms);
|
||||
$output->writeln(' <cyan>bin/grav</cyan> permissions reset to '. decoct($dir_perms));
|
||||
}
|
||||
|
||||
|
||||
private function check($output)
|
||||
{
|
||||
$success = true;
|
||||
|
||||
if (!file_exists($this->destination)) {
|
||||
$output->writeln(' file: <red>$this->destination</red> does not exist!');
|
||||
$success = false;
|
||||
}
|
||||
|
||||
foreach ($this->directories as $dir) {
|
||||
if (!file_exists($this->destination . $dir)) {
|
||||
$output->writeln(' directory: <red>' . $dir . '</red> does not exist!');
|
||||
$success = false;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->mappings as $target => $link) {
|
||||
if (!file_exists($this->destination . $target)) {
|
||||
$output->writeln(' mappings: <red>' . $target . '</red> does not exist!');
|
||||
$success = false;
|
||||
}
|
||||
}
|
||||
if (!$success) {
|
||||
$output->writeln('');
|
||||
$output->writeln('<comment>install should be run with --symlink|--s to symlink first</comment>');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
private function rcopy($src, $dest){
|
||||
|
||||
// If the src is not a directory do a simple file copy
|
||||
if(!is_dir($src)) {
|
||||
copy($src, $dest);
|
||||
return true;
|
||||
}
|
||||
|
||||
// If the destination directory does not exist create it
|
||||
if(!is_dir($dest)) {
|
||||
if(!mkdir($dest)) {
|
||||
// If the destination directory could not be created stop processing
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Open the source directory to read in files
|
||||
$i = new \DirectoryIterator($src);
|
||||
foreach($i as $f) {
|
||||
if($f->isFile()) {
|
||||
copy($f->getRealPath(), "$dest/" . $f->getFilename());
|
||||
} else if(!$f->isDot() && $f->isDir()) {
|
||||
$this->rcopy($f->getRealPath(), "$dest/$f");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1
user/plugins/error
Symbolic link
1
user/plugins/error
Symbolic link
@@ -0,0 +1 @@
|
||||
/Users/rhuk/Projects/github/grav-plugin-error
|
||||
1
user/plugins/problems
Symbolic link
1
user/plugins/problems
Symbolic link
@@ -0,0 +1 @@
|
||||
/Users/rhuk/Projects/github/grav-plugin-problems
|
||||
1
user/themes/antimatter
Symbolic link
1
user/themes/antimatter
Symbolic link
@@ -0,0 +1 @@
|
||||
/Users/rhuk/Projects/github/grav-theme-antimatter
|
||||
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@@ -4,4 +4,4 @@
|
||||
|
||||
require_once __DIR__ . '/composer' . '/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInitce64a487a9bcfc71e33f1f5e1fb002eb::getLoader();
|
||||
return ComposerAutoloaderInitcd548803417e916a9b8fece56bc99491::getLoader();
|
||||
|
||||
2
vendor/composer/autoload_files.php
vendored
2
vendor/composer/autoload_files.php
vendored
@@ -6,6 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
$vendorDir . '/ircmaxell/password-compat/lib/password.php',
|
||||
$vendorDir . '/tracy/tracy/src/shortcuts.php',
|
||||
$vendorDir . '/ircmaxell/password-compat/lib/password.php',
|
||||
);
|
||||
|
||||
10
vendor/composer/autoload_real.php
vendored
10
vendor/composer/autoload_real.php
vendored
@@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInitce64a487a9bcfc71e33f1f5e1fb002eb
|
||||
class ComposerAutoloaderInitcd548803417e916a9b8fece56bc99491
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitce64a487a9bcfc71e33f1f5e1fb002eb
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInitce64a487a9bcfc71e33f1f5e1fb002eb', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitcd548803417e916a9b8fece56bc99491', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitce64a487a9bcfc71e33f1f5e1fb002eb', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitcd548803417e916a9b8fece56bc99491', 'loadClassLoader'));
|
||||
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
@@ -42,14 +42,14 @@ class ComposerAutoloaderInitce64a487a9bcfc71e33f1f5e1fb002eb
|
||||
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
foreach ($includeFiles as $file) {
|
||||
composerRequirece64a487a9bcfc71e33f1f5e1fb002eb($file);
|
||||
composerRequirecd548803417e916a9b8fece56bc99491($file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequirece64a487a9bcfc71e33f1f5e1fb002eb($file)
|
||||
function composerRequirecd548803417e916a9b8fece56bc99491($file)
|
||||
{
|
||||
require $file;
|
||||
}
|
||||
|
||||
502
vendor/composer/installed.json
vendored
502
vendor/composer/installed.json
vendored
@@ -1,4 +1,45 @@
|
||||
[
|
||||
{
|
||||
"name": "erusev/parsedown",
|
||||
"version": "dev-master",
|
||||
"version_normalized": "9999999-dev",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/erusev/parsedown.git",
|
||||
"reference": "e33ac1c56ea591f21b9cf2fa74356ef708d4e130"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/erusev/parsedown/zipball/e33ac1c56ea591f21b9cf2fa74356ef708d4e130",
|
||||
"reference": "e33ac1c56ea591f21b9cf2fa74356ef708d4e130",
|
||||
"shasum": ""
|
||||
},
|
||||
"time": "2014-06-18 09:27:25",
|
||||
"type": "library",
|
||||
"installation-source": "source",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Parsedown": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Emanuil Rusev",
|
||||
"email": "hello@erusev.com",
|
||||
"homepage": "http://erusev.com"
|
||||
}
|
||||
],
|
||||
"description": "Parser for Markdown.",
|
||||
"homepage": "http://parsedown.org",
|
||||
"keywords": [
|
||||
"markdown",
|
||||
"parser"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "doctrine/cache",
|
||||
"version": "dev-master",
|
||||
@@ -6,12 +47,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/cache.git",
|
||||
"reference": "8f8810a67de1e45e1f471c5a93dbd829c4184975"
|
||||
"reference": "72121e68265cd8b37f9b69778308251f6c5133e4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/cache/zipball/8f8810a67de1e45e1f471c5a93dbd829c4184975",
|
||||
"reference": "8f8810a67de1e45e1f471c5a93dbd829c4184975",
|
||||
"url": "https://api.github.com/repos/doctrine/cache/zipball/72121e68265cd8b37f9b69778308251f6c5133e4",
|
||||
"reference": "72121e68265cd8b37f9b69778308251f6c5133e4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -24,7 +65,7 @@
|
||||
"phpunit/phpunit": ">=3.7",
|
||||
"satooshi/php-coveralls": "~0.6"
|
||||
},
|
||||
"time": "2014-07-27 17:14:15",
|
||||
"time": "2014-08-05 12:51:19",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
@@ -70,240 +111,6 @@
|
||||
"caching"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "twig/twig",
|
||||
"version": "dev-master",
|
||||
"version_normalized": "9999999-dev",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/fabpot/Twig.git",
|
||||
"reference": "72aa82b9a260b823325eec9b37bf6106a0137fb2"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/fabpot/Twig/zipball/72aa82b9a260b823325eec9b37bf6106a0137fb2",
|
||||
"reference": "72aa82b9a260b823325eec9b37bf6106a0137fb2",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.2.4"
|
||||
},
|
||||
"time": "2014-07-31 13:21:40",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.16-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "source",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Twig_": "lib/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com",
|
||||
"homepage": "http://fabien.potencier.org",
|
||||
"role": "Lead Developer"
|
||||
},
|
||||
{
|
||||
"name": "Armin Ronacher",
|
||||
"email": "armin.ronacher@active-4.com",
|
||||
"role": "Project Founder"
|
||||
},
|
||||
{
|
||||
"name": "Twig Team",
|
||||
"homepage": "https://github.com/fabpot/Twig/graphs/contributors",
|
||||
"role": "Contributors"
|
||||
}
|
||||
],
|
||||
"description": "Twig, the flexible, fast, and secure template language for PHP",
|
||||
"homepage": "http://twig.sensiolabs.org",
|
||||
"keywords": [
|
||||
"templating"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "gregwar/cache",
|
||||
"version": "v1.0.9",
|
||||
"version_normalized": "1.0.9.0",
|
||||
"target-dir": "Gregwar/Cache",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Gregwar/Cache.git",
|
||||
"reference": "514b9b469082028d094e33e4a059c863c546b14e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Gregwar/Cache/zipball/514b9b469082028d094e33e4a059c863c546b14e",
|
||||
"reference": "514b9b469082028d094e33e4a059c863c546b14e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3"
|
||||
},
|
||||
"time": "2014-07-05 17:42:36",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Gregwar\\Cache": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Grégoire Passault",
|
||||
"email": "g.passault@gmail.com",
|
||||
"homepage": "http://www.gregwar.com/"
|
||||
}
|
||||
],
|
||||
"description": "A lightweight file-system cache system",
|
||||
"keywords": [
|
||||
"cache",
|
||||
"caching",
|
||||
"file-system",
|
||||
"system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "ircmaxell/password-compat",
|
||||
"version": "1.0.3",
|
||||
"version_normalized": "1.0.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ircmaxell/password_compat.git",
|
||||
"reference": "1fc1521b5e9794ea77e4eca30717be9635f1d4f4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/1fc1521b5e9794ea77e4eca30717be9635f1d4f4",
|
||||
"reference": "1fc1521b5e9794ea77e4eca30717be9635f1d4f4",
|
||||
"shasum": ""
|
||||
},
|
||||
"time": "2013-04-30 19:58:08",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"lib/password.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Anthony Ferrara",
|
||||
"email": "ircmaxell@ircmaxell.com",
|
||||
"homepage": "http://blog.ircmaxell.com"
|
||||
}
|
||||
],
|
||||
"description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash",
|
||||
"homepage": "https://github.com/ircmaxell/password_compat",
|
||||
"keywords": [
|
||||
"hashing",
|
||||
"password"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "gregwar/image",
|
||||
"version": "dev-master",
|
||||
"version_normalized": "9999999-dev",
|
||||
"target-dir": "Gregwar/Image",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Gregwar/Image.git",
|
||||
"reference": "31cf30151015d66f320011ea8646e90bb62ffb13"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Gregwar/Image/zipball/31cf30151015d66f320011ea8646e90bb62ffb13",
|
||||
"reference": "31cf30151015d66f320011ea8646e90bb62ffb13",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-gd": "*",
|
||||
"gregwar/cache": "1.*",
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"time": "2014-06-30 15:00:37",
|
||||
"type": "library",
|
||||
"installation-source": "source",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Gregwar\\Image": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Grégoire Passault",
|
||||
"email": "g.passault@gmail.com",
|
||||
"homepage": "http://www.gregwar.com/"
|
||||
}
|
||||
],
|
||||
"description": "Image handling",
|
||||
"homepage": "https://github.com/Gregwar/Image",
|
||||
"keywords": [
|
||||
"gd",
|
||||
"image"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "erusev/parsedown",
|
||||
"version": "dev-master",
|
||||
"version_normalized": "9999999-dev",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/erusev/parsedown.git",
|
||||
"reference": "e33ac1c56ea591f21b9cf2fa74356ef708d4e130"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/erusev/parsedown/zipball/e33ac1c56ea591f21b9cf2fa74356ef708d4e130",
|
||||
"reference": "e33ac1c56ea591f21b9cf2fa74356ef708d4e130",
|
||||
"shasum": ""
|
||||
},
|
||||
"time": "2014-06-18 09:27:25",
|
||||
"type": "library",
|
||||
"installation-source": "source",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Parsedown": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Emanuil Rusev",
|
||||
"email": "hello@erusev.com",
|
||||
"homepage": "http://erusev.com"
|
||||
}
|
||||
],
|
||||
"description": "Parser for Markdown.",
|
||||
"homepage": "http://parsedown.org",
|
||||
"keywords": [
|
||||
"markdown",
|
||||
"parser"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "tracy/tracy",
|
||||
"version": "dev-master",
|
||||
@@ -365,6 +172,158 @@
|
||||
"nette"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "gregwar/cache",
|
||||
"version": "v1.0.9",
|
||||
"version_normalized": "1.0.9.0",
|
||||
"target-dir": "Gregwar/Cache",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Gregwar/Cache.git",
|
||||
"reference": "514b9b469082028d094e33e4a059c863c546b14e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Gregwar/Cache/zipball/514b9b469082028d094e33e4a059c863c546b14e",
|
||||
"reference": "514b9b469082028d094e33e4a059c863c546b14e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3"
|
||||
},
|
||||
"time": "2014-07-05 17:42:36",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Gregwar\\Cache": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Grégoire Passault",
|
||||
"email": "g.passault@gmail.com",
|
||||
"homepage": "http://www.gregwar.com/"
|
||||
}
|
||||
],
|
||||
"description": "A lightweight file-system cache system",
|
||||
"keywords": [
|
||||
"cache",
|
||||
"caching",
|
||||
"file-system",
|
||||
"system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "gregwar/image",
|
||||
"version": "dev-master",
|
||||
"version_normalized": "9999999-dev",
|
||||
"target-dir": "Gregwar/Image",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Gregwar/Image.git",
|
||||
"reference": "31cf30151015d66f320011ea8646e90bb62ffb13"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Gregwar/Image/zipball/31cf30151015d66f320011ea8646e90bb62ffb13",
|
||||
"reference": "31cf30151015d66f320011ea8646e90bb62ffb13",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-gd": "*",
|
||||
"gregwar/cache": "1.*",
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"time": "2014-06-30 15:00:37",
|
||||
"type": "library",
|
||||
"installation-source": "source",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Gregwar\\Image": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Grégoire Passault",
|
||||
"email": "g.passault@gmail.com",
|
||||
"homepage": "http://www.gregwar.com/"
|
||||
}
|
||||
],
|
||||
"description": "Image handling",
|
||||
"homepage": "https://github.com/Gregwar/Image",
|
||||
"keywords": [
|
||||
"gd",
|
||||
"image"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "twig/twig",
|
||||
"version": "dev-master",
|
||||
"version_normalized": "9999999-dev",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/fabpot/Twig.git",
|
||||
"reference": "e2d2a250d963dd5bba4ad23fc01c7282fc042946"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/fabpot/Twig/zipball/e2d2a250d963dd5bba4ad23fc01c7282fc042946",
|
||||
"reference": "e2d2a250d963dd5bba4ad23fc01c7282fc042946",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.2.4"
|
||||
},
|
||||
"time": "2014-08-06 06:46:32",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.16-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "source",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Twig_": "lib/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com",
|
||||
"homepage": "http://fabien.potencier.org",
|
||||
"role": "Lead Developer"
|
||||
},
|
||||
{
|
||||
"name": "Armin Ronacher",
|
||||
"email": "armin.ronacher@active-4.com",
|
||||
"role": "Project Founder"
|
||||
},
|
||||
{
|
||||
"name": "Twig Team",
|
||||
"homepage": "https://github.com/fabpot/Twig/graphs/contributors",
|
||||
"role": "Contributors"
|
||||
}
|
||||
],
|
||||
"description": "Twig, the flexible, fast, and secure template language for PHP",
|
||||
"homepage": "http://twig.sensiolabs.org",
|
||||
"keywords": [
|
||||
"templating"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "symfony/yaml",
|
||||
"version": "2.5.x-dev",
|
||||
@@ -373,18 +332,18 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/Yaml.git",
|
||||
"reference": "f868ecdbcc0276b6158dfbf08b9e98ce07f014e1"
|
||||
"reference": "5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/Yaml/zipball/f868ecdbcc0276b6158dfbf08b9e98ce07f014e1",
|
||||
"reference": "f868ecdbcc0276b6158dfbf08b9e98ce07f014e1",
|
||||
"url": "https://api.github.com/repos/symfony/Yaml/zipball/5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f",
|
||||
"reference": "5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"time": "2014-07-09 09:05:48",
|
||||
"time": "2014-08-05 09:00:40",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
@@ -402,15 +361,13 @@
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com",
|
||||
"homepage": "http://fabien.potencier.org",
|
||||
"role": "Lead Developer"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "http://symfony.com/contributors"
|
||||
},
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
}
|
||||
],
|
||||
"description": "Symfony Yaml Component",
|
||||
@@ -424,12 +381,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/Console.git",
|
||||
"reference": "fae03eba0b01d2a45f35080de50096ebb1901475"
|
||||
"reference": "cd2d1e4bac2206b337326b0140ff475fe9ad5f63"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/Console/zipball/fae03eba0b01d2a45f35080de50096ebb1901475",
|
||||
"reference": "fae03eba0b01d2a45f35080de50096ebb1901475",
|
||||
"url": "https://api.github.com/repos/symfony/Console/zipball/cd2d1e4bac2206b337326b0140ff475fe9ad5f63",
|
||||
"reference": "cd2d1e4bac2206b337326b0140ff475fe9ad5f63",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -443,7 +400,7 @@
|
||||
"psr/log": "For using the console logger",
|
||||
"symfony/event-dispatcher": ""
|
||||
},
|
||||
"time": "2014-07-29 11:56:02",
|
||||
"time": "2014-08-05 09:00:40",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
@@ -472,5 +429,46 @@
|
||||
],
|
||||
"description": "Symfony Console Component",
|
||||
"homepage": "http://symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "ircmaxell/password-compat",
|
||||
"version": "1.0.3",
|
||||
"version_normalized": "1.0.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/ircmaxell/password_compat.git",
|
||||
"reference": "1fc1521b5e9794ea77e4eca30717be9635f1d4f4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/1fc1521b5e9794ea77e4eca30717be9635f1d4f4",
|
||||
"reference": "1fc1521b5e9794ea77e4eca30717be9635f1d4f4",
|
||||
"shasum": ""
|
||||
},
|
||||
"time": "2013-04-30 19:58:08",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"lib/password.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Anthony Ferrara",
|
||||
"email": "ircmaxell@ircmaxell.com",
|
||||
"homepage": "http://blog.ircmaxell.com"
|
||||
}
|
||||
],
|
||||
"description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash",
|
||||
"homepage": "https://github.com/ircmaxell/password_compat",
|
||||
"keywords": [
|
||||
"hashing",
|
||||
"password"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -105,9 +105,21 @@ class FilesystemCache extends FileCache
|
||||
$filepath = pathinfo($filename, PATHINFO_DIRNAME);
|
||||
|
||||
if ( ! is_dir($filepath)) {
|
||||
mkdir($filepath, 0777, true);
|
||||
if (false === @mkdir($filepath, 0777, true) && !is_dir($filepath)) {
|
||||
return false;
|
||||
}
|
||||
} elseif ( ! is_writable($filepath)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return file_put_contents($filename, $lifeTime . PHP_EOL . $data) !== false;
|
||||
$tmpFile = tempnam($filepath, basename($filename));
|
||||
|
||||
if ((file_put_contents($tmpFile, $lifeTime . PHP_EOL . $data) !== false) && @rename($tmpFile, $filename)) {
|
||||
@chmod($filename, 0666 & ~umask());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
0
vendor/erusev/parsedown/Parsedown.php
vendored
Normal file → Executable file
0
vendor/erusev/parsedown/Parsedown.php
vendored
Normal file → Executable file
@@ -874,6 +874,8 @@ class Application
|
||||
* @param OutputInterface $output An Output instance
|
||||
*
|
||||
* @return int 0 if everything went fine, or an error code
|
||||
*
|
||||
* @throws \Exception when the command being run threw an exception
|
||||
*/
|
||||
protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
|
||||
@@ -54,7 +54,7 @@ class DescriptorHelper extends Helper
|
||||
* @param object $object
|
||||
* @param array $options
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
* @throws \InvalidArgumentException when the given format is not supported
|
||||
*/
|
||||
public function describe(OutputInterface $output, $object, array $options = array())
|
||||
{
|
||||
|
||||
@@ -328,7 +328,7 @@ class DialogHelper extends InputAwareHelper
|
||||
* @param OutputInterface $output An Output instance
|
||||
* @param string|array $question The question to ask
|
||||
* @param callable $validator A PHP callback
|
||||
* @param int $attempts Max number of times to ask before giving up (false by default, which means infinite)
|
||||
* @param int|false $attempts Max number of times to ask before giving up (false by default, which means infinite)
|
||||
* @param string $default The default answer if none is given by the user
|
||||
* @param array $autocomplete List of values to autocomplete
|
||||
*
|
||||
@@ -357,7 +357,7 @@ class DialogHelper extends InputAwareHelper
|
||||
* @param OutputInterface $output An Output instance
|
||||
* @param string|array $question The question to ask
|
||||
* @param callable $validator A PHP callback
|
||||
* @param int $attempts Max number of times to ask before giving up (false by default, which means infinite)
|
||||
* @param int|false $attempts Max number of times to ask before giving up (false by default, which means infinite)
|
||||
* @param bool $fallback In case the response can not be hidden, whether to fallback on non-hidden question or not
|
||||
*
|
||||
* @return string The response
|
||||
@@ -451,7 +451,7 @@ class DialogHelper extends InputAwareHelper
|
||||
* @param callable $interviewer A callable that will ask for a question and return the result
|
||||
* @param OutputInterface $output An Output instance
|
||||
* @param callable $validator A PHP callback
|
||||
* @param int $attempts Max number of times to ask before giving up ; false will ask infinitely
|
||||
* @param int|false $attempts Max number of times to ask before giving up ; false will ask infinitely
|
||||
*
|
||||
* @return string The validated response
|
||||
*
|
||||
|
||||
@@ -44,6 +44,8 @@ class TableHelper extends Helper
|
||||
* @param int $layout self::LAYOUT_*
|
||||
*
|
||||
* @return TableHelper
|
||||
*
|
||||
* @throws InvalidArgumentException when the table layout is not known
|
||||
*/
|
||||
public function setLayout($layout)
|
||||
{
|
||||
|
||||
@@ -402,6 +402,8 @@ class Inline
|
||||
* @param string $scalar
|
||||
*
|
||||
* @return string A YAML string
|
||||
*
|
||||
* @throws ParseException when object parsing support was disabled and the parser detected a PHP object
|
||||
*/
|
||||
private static function evaluateScalar($scalar)
|
||||
{
|
||||
|
||||
3
vendor/twig/twig/CHANGELOG
vendored
3
vendor/twig/twig/CHANGELOG
vendored
@@ -1,6 +1,7 @@
|
||||
* 1.16.1 (2014-XX-XX)
|
||||
|
||||
* n/a
|
||||
* fixed for mb function overload mb_substr acting different
|
||||
* fixed the attribute() function when passing a variable for the arguments
|
||||
|
||||
* 1.16.0 (2014-07-05)
|
||||
|
||||
|
||||
5
vendor/twig/twig/lib/Twig/Compiler.php
vendored
5
vendor/twig/twig/lib/Twig/Compiler.php
vendored
@@ -267,4 +267,9 @@ class Twig_Compiler implements Twig_CompilerInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getVarName()
|
||||
{
|
||||
return sprintf('__internal_%s', hash('sha256', uniqid(mt_rand(), true), false));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ class Twig_ExpressionParser
|
||||
throw new Twig_Error_Syntax('The "attribute" function takes at least two arguments (the variable and the attributes)', $line, $this->parser->getFilename());
|
||||
}
|
||||
|
||||
return new Twig_Node_Expression_GetAttr($args->getNode(0), $args->getNode(1), count($args) > 2 ? $args->getNode(2) : new Twig_Node_Expression_Array(array(), $line), Twig_Template::ANY_CALL, $line);
|
||||
return new Twig_Node_Expression_GetAttr($args->getNode(0), $args->getNode(1), count($args) > 2 ? $args->getNode(2) : null, Twig_Template::ANY_CALL, $line);
|
||||
default:
|
||||
if (null !== $alias = $this->parser->getImportedSymbol('function', $name)) {
|
||||
$arguments = new Twig_Node_Expression_Array(array(), $line);
|
||||
|
||||
2
vendor/twig/twig/lib/Twig/Extension/Core.php
vendored
2
vendor/twig/twig/lib/Twig/Extension/Core.php
vendored
@@ -944,7 +944,7 @@ function twig_escape_filter(Twig_Environment $env, $string, $strategy = 'html',
|
||||
static $htmlspecialcharsCharsets;
|
||||
|
||||
if (null === $htmlspecialcharsCharsets) {
|
||||
if ('hiphop' === substr(PHP_VERSION, -6)) {
|
||||
if (defined('HHVM_VERSION')) {
|
||||
$htmlspecialcharsCharsets = array('utf-8' => true, 'UTF-8' => true);
|
||||
} else {
|
||||
$htmlspecialcharsCharsets = array(
|
||||
|
||||
@@ -12,14 +12,14 @@ class Twig_Node_Expression_Binary_EndsWith extends Twig_Node_Expression_Binary
|
||||
{
|
||||
public function compile(Twig_Compiler $compiler)
|
||||
{
|
||||
$left = $compiler->getVarName();
|
||||
$right = $compiler->getVarName();
|
||||
$compiler
|
||||
->raw('(0 === substr_compare(')
|
||||
->raw(sprintf('(is_string($%s = ', $left))
|
||||
->subcompile($this->getNode('left'))
|
||||
->raw(', ')
|
||||
->raw(sprintf(') && is_string($%s = ', $right))
|
||||
->subcompile($this->getNode('right'))
|
||||
->raw(', -strlen(')
|
||||
->subcompile($this->getNode('right'))
|
||||
->raw(')))')
|
||||
->raw(sprintf(') && (\'\' === $%2$s || $%2$s === substr($%1$s, -strlen($%2$s))))', $left, $right))
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,12 +12,14 @@ class Twig_Node_Expression_Binary_StartsWith extends Twig_Node_Expression_Binary
|
||||
{
|
||||
public function compile(Twig_Compiler $compiler)
|
||||
{
|
||||
$left = $compiler->getVarName();
|
||||
$right = $compiler->getVarName();
|
||||
$compiler
|
||||
->raw('(0 === strpos(')
|
||||
->raw(sprintf('(is_string($%s = ', $left))
|
||||
->subcompile($this->getNode('left'))
|
||||
->raw(', ')
|
||||
->raw(sprintf(') && is_string($%s = ', $right))
|
||||
->subcompile($this->getNode('right'))
|
||||
->raw('))')
|
||||
->raw(sprintf(') && (\'\' === $%2$s || 0 === strpos($%1$s, $%2$s)))', $left, $right))
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
*/
|
||||
class Twig_Node_Expression_GetAttr extends Twig_Node_Expression
|
||||
{
|
||||
public function __construct(Twig_Node_Expression $node, Twig_Node_Expression $attribute, Twig_Node_Expression_Array $arguments, $type, $lineno)
|
||||
public function __construct(Twig_Node_Expression $node, Twig_Node_Expression $attribute, Twig_Node_Expression $arguments = null, $type, $lineno)
|
||||
{
|
||||
parent::__construct(array('node' => $node, 'attribute' => $attribute, 'arguments' => $arguments), array('type' => $type, 'is_defined_test' => false, 'ignore_strict_check' => false, 'disable_c_ext' => false), $lineno);
|
||||
}
|
||||
@@ -32,20 +32,30 @@ class Twig_Node_Expression_GetAttr extends Twig_Node_Expression
|
||||
|
||||
$compiler->raw(', ')->subcompile($this->getNode('attribute'));
|
||||
|
||||
if (count($this->getNode('arguments')) || Twig_Template::ANY_CALL !== $this->getAttribute('type') || $this->getAttribute('is_defined_test') || $this->getAttribute('ignore_strict_check')) {
|
||||
$compiler->raw(', ')->subcompile($this->getNode('arguments'));
|
||||
// only generate optional arguments when needed (to make generated code more readable)
|
||||
$needFourth = $this->getAttribute('ignore_strict_check');
|
||||
$needThird = $needFourth || $this->getAttribute('is_defined_test');
|
||||
$needSecond = $needThird || Twig_Template::ANY_CALL !== $this->getAttribute('type');
|
||||
$needFirst = $needSecond || null !== $this->getNode('arguments');
|
||||
|
||||
if (Twig_Template::ANY_CALL !== $this->getAttribute('type') || $this->getAttribute('is_defined_test') || $this->getAttribute('ignore_strict_check')) {
|
||||
if ($needFirst) {
|
||||
if (null !== $this->getNode('arguments')) {
|
||||
$compiler->raw(', ')->subcompile($this->getNode('arguments'));
|
||||
} else {
|
||||
$compiler->raw(', array()');
|
||||
}
|
||||
}
|
||||
|
||||
if ($needSecond) {
|
||||
$compiler->raw(', ')->repr($this->getAttribute('type'));
|
||||
}
|
||||
|
||||
if ($this->getAttribute('is_defined_test') || $this->getAttribute('ignore_strict_check')) {
|
||||
$compiler->raw(', '.($this->getAttribute('is_defined_test') ? 'true' : 'false'));
|
||||
if ($needThird) {
|
||||
$compiler->raw(', ')->repr($this->getAttribute('is_defined_test'));
|
||||
}
|
||||
|
||||
if ($this->getAttribute('ignore_strict_check')) {
|
||||
$compiler->raw(', '.($this->getAttribute('ignore_strict_check') ? 'true' : 'false'));
|
||||
}
|
||||
if ($needFourth) {
|
||||
$compiler->raw(', ')->repr($this->getAttribute('ignore_strict_check'));
|
||||
}
|
||||
|
||||
$compiler->raw(')');
|
||||
|
||||
4
vendor/twig/twig/lib/Twig/Template.php
vendored
4
vendor/twig/twig/lib/Twig/Template.php
vendored
@@ -379,7 +379,11 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
||||
} elseif (is_object($object)) {
|
||||
$message = sprintf('Impossible to access a key "%s" on an object of class "%s" that does not implement ArrayAccess interface', $item, get_class($object));
|
||||
} elseif (is_array($object)) {
|
||||
if (empty($object)) {
|
||||
$message = sprintf('Key "%s" does not exist as the array is empty', $arrayItem);
|
||||
} else {
|
||||
$message = sprintf('Key "%s" for array with keys "%s" does not exist', $arrayItem, implode(', ', array_keys($object)));
|
||||
}
|
||||
} elseif (Twig_Template::ARRAY_CALL === $type) {
|
||||
$message = sprintf('Impossible to access a key ("%s") on a %s variable ("%s")', $item, gettype($object), $object);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user