Plusieurs bug de fixed important (!), mise en place env, mise en place img user par défaut
This commit is contained in:
parent
84dbe145b3
commit
ea38928869
91 changed files with 6711 additions and 24 deletions
58
vendor/vlucas/phpdotenv/src/Parser/Lexer.php
vendored
Normal file
58
vendor/vlucas/phpdotenv/src/Parser/Lexer.php
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dotenv\Parser;
|
||||
|
||||
final class Lexer
|
||||
{
|
||||
/**
|
||||
* The regex for each type of token.
|
||||
*/
|
||||
private const PATTERNS = [
|
||||
'[\r\n]{1,1000}', '[^\S\r\n]{1,1000}', '\\\\', '\'', '"', '\\#', '\\$', '([^(\s\\\\\'"\\#\\$)]|\\(|\\)){1,1000}',
|
||||
];
|
||||
|
||||
/**
|
||||
* This class is a singleton.
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
private function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert content into a token stream.
|
||||
*
|
||||
* Multibyte string processing is not needed here, and nether is error
|
||||
* handling, for performance reasons.
|
||||
*
|
||||
* @param string $content
|
||||
*
|
||||
* @return \Generator<string>
|
||||
*/
|
||||
public static function lex(string $content)
|
||||
{
|
||||
static $regex;
|
||||
|
||||
if ($regex === null) {
|
||||
$regex = '(('.\implode(')|(', self::PATTERNS).'))A';
|
||||
}
|
||||
|
||||
$offset = 0;
|
||||
|
||||
while (isset($content[$offset])) {
|
||||
if (!\preg_match($regex, $content, $matches, 0, $offset)) {
|
||||
throw new \Error(\sprintf('Lexer encountered unexpected character [%s].', $content[$offset]));
|
||||
}
|
||||
|
||||
$offset += \strlen($matches[0]);
|
||||
|
||||
yield $matches[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue