mirror of
https://github.com/andres-montanez/Magallanes
synced 2024-06-27 09:40:04 +02:00
Update SPYC Library.
This commit is contained in:
parent
5cc9c02c3e
commit
fc3b7d87a5
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Spyc -- A Simple PHP YAML Class
|
* Spyc -- A Simple PHP YAML Class
|
||||||
* @version 0.5
|
* @version 0.5.1
|
||||||
* @author Vlad Andersen <vlad.andersen@gmail.com>
|
* @author Vlad Andersen <vlad.andersen@gmail.com>
|
||||||
* @author Chris Wanstrath <chris@ozmm.org>
|
* @author Chris Wanstrath <chris@ozmm.org>
|
||||||
* @link http://code.google.com/p/spyc/
|
* @link http://code.google.com/p/spyc/
|
||||||
|
@ -433,18 +433,16 @@ class Spyc {
|
||||||
$i--;
|
$i--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Strip out comments
|
||||||
|
if (strpos ($line, '#')) {
|
||||||
|
$line = preg_replace('/\s*#([^"\']+)$/','',$line);
|
||||||
|
}
|
||||||
|
|
||||||
while (++$i < $cnt && self::greedilyNeedNextLine($line)) {
|
while (++$i < $cnt && self::greedilyNeedNextLine($line)) {
|
||||||
$line = rtrim ($line, " \n\t\r") . ' ' . ltrim ($Source[$i], " \t");
|
$line = rtrim ($line, " \n\t\r") . ' ' . ltrim ($Source[$i], " \t");
|
||||||
}
|
}
|
||||||
$i--;
|
$i--;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (strpos ($line, '#')) {
|
|
||||||
if (strpos ($line, '"') === false && strpos ($line, "'") === false)
|
|
||||||
$line = preg_replace('/\s+#(.+)$/','',$line);
|
|
||||||
}
|
|
||||||
|
|
||||||
$lineArray = $this->_parseLine($line);
|
$lineArray = $this->_parseLine($line);
|
||||||
|
|
||||||
if ($literalBlockStyle)
|
if ($literalBlockStyle)
|
||||||
|
@ -653,7 +651,8 @@ class Spyc {
|
||||||
|
|
||||||
} while (strpos ($inline, '[') !== false || strpos ($inline, '{') !== false);
|
} while (strpos ($inline, '[') !== false || strpos ($inline, '{') !== false);
|
||||||
|
|
||||||
$explode = explode(', ',$inline);
|
$explode = explode(',',$inline);
|
||||||
|
$explode = array_map('trim', $explode);
|
||||||
$stringi = 0; $i = 0;
|
$stringi = 0; $i = 0;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
@ -1032,14 +1031,14 @@ class Spyc {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable use of Spyc from command line
|
// Enable use of Spyc from command line
|
||||||
// The syntax is the following: php spyc.php spyc.yaml
|
// The syntax is the following: php Spyc.php spyc.yaml
|
||||||
|
|
||||||
define ('SPYC_FROM_COMMAND_LINE', false);
|
define ('SPYC_FROM_COMMAND_LINE', false);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (!SPYC_FROM_COMMAND_LINE) break;
|
if (!SPYC_FROM_COMMAND_LINE) break;
|
||||||
if (empty ($_SERVER['argc']) || $_SERVER['argc'] < 2) break;
|
if (empty ($_SERVER['argc']) || $_SERVER['argc'] < 2) break;
|
||||||
if (empty ($_SERVER['PHP_SELF']) || $_SERVER['PHP_SELF'] != 'spyc.php') break;
|
if (empty ($_SERVER['PHP_SELF']) || $_SERVER['PHP_SELF'] != 'Spyc.php') break;
|
||||||
$file = $argv[1];
|
$file = $argv[1];
|
||||||
printf ("Spyc loading file: %s\n", $file);
|
printf ("Spyc loading file: %s\n", $file);
|
||||||
print_r (spyc_load_file ($file));
|
print_r (spyc_load_file ($file));
|
2
bin/mage
2
bin/mage
|
@ -17,7 +17,7 @@ define('MAGALLANES_VERSION', '1.0.0');
|
||||||
define('MAGALLANES_DIRECTORY', $baseDir);
|
define('MAGALLANES_DIRECTORY', $baseDir);
|
||||||
|
|
||||||
// Preload
|
// Preload
|
||||||
require_once $baseDir . '/Mage/spyc.php';
|
require_once $baseDir . '/Mage/Spyc.php';
|
||||||
require_once $baseDir . '/Mage/Autoload.php';
|
require_once $baseDir . '/Mage/Autoload.php';
|
||||||
spl_autoload_register(array('Mage\\Autoload', 'autoload'));
|
spl_autoload_register(array('Mage\\Autoload', 'autoload'));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue