First commit

This commit is contained in:
Cody Cook 2024-04-29 19:04:51 -07:00
commit d5bb2f19fa
117 changed files with 68604 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/includes/config.toml

8
.idea/.gitignore generated vendored Normal file
View file

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

18
.idea/codeception.xml generated Normal file
View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Codeception">
<option name="configurations">
<list>
<Configuration>
<option name="path" value="$PROJECT_DIR$/tests" />
</Configuration>
<Configuration>
<option name="path" value="$PROJECT_DIR$/tests" />
</Configuration>
<Configuration>
<option name="path" value="$PROJECT_DIR$/tests" />
</Configuration>
</list>
</option>
</component>
</project>

30
.idea/deployment.xml generated Normal file
View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData" autoUpload="Always" serverName="beta_utahsdjs" remoteFilesAllowedToDisappearOnAutoupload="false" confirmBeforeUploading="false">
<option name="confirmBeforeUploading" value="false" />
<serverData>
<paths name="ConsoleServer">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
<paths name="beta_utahsdjs">
<serverdata>
<mappings>
<mapping deploy="web/beta.utahsdjs.com/public_html/" local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
<paths name="devserver">
<serverdata>
<mappings>
<mapping local="$PROJECT_DIR$" web="/" />
</mappings>
</serverdata>
</paths>
</serverData>
<option name="myAutoUpload" value="ALWAYS" />
</component>
</project>

8
.idea/modules.xml generated Normal file
View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/utahsdjs2025.iml" filepath="$PROJECT_DIR$/.idea/utahsdjs2025.iml" />
</modules>
</component>
</project>

85
.idea/php.xml generated Normal file
View file

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MessDetectorOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCSFixerOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCodeSnifferOptionsConfiguration">
<option name="highlightLevel" value="WARNING" />
<option name="transferred" value="true" />
</component>
<component name="PhpIncludePathManager">
<include_path>
<path value="$PROJECT_DIR$/vendor/composer" />
<path value="$PROJECT_DIR$/vendor/yosymfony/parser-utils" />
<path value="$PROJECT_DIR$/vendor/yosymfony/toml" />
</include_path>
</component>
<component name="PhpInterpreters">
<interpreters>
<interpreter id="07ab7e15-53fd-4087-8d15-d4f05ac5edb8" name="Debian" home="\\wsl$\Debian/usr/bin/php" auto="false" debugger_id="php.debugger.XDebug">
<remote_data INTERPRETER_PATH="/usr/bin/php" HELPERS_PATH="" VALID="true" RUN_AS_ROOT_VIA_SUDO="false" DISTRIBUTION_ID="Debian" />
</interpreter>
</interpreters>
</component>
<component name="PhpInterpretersPhpInfoCache">
<phpInfoCache>
<interpreter name="Debian">
<phpinfo binary_type="PHP" php_cli="/usr/bin/php8.2" path_separator=":" remote_host="172.22.16.1" version="8.2.7">
<additional_php_ini>/etc/php/8.2/cli/conf.d/10-opcache.ini, /etc/php/8.2/cli/conf.d/10-pdo.ini, /etc/php/8.2/cli/conf.d/20-calendar.ini, /etc/php/8.2/cli/conf.d/20-ctype.ini, /etc/php/8.2/cli/conf.d/20-exif.ini, /etc/php/8.2/cli/conf.d/20-ffi.ini, /etc/php/8.2/cli/conf.d/20-fileinfo.ini, /etc/php/8.2/cli/conf.d/20-ftp.ini, /etc/php/8.2/cli/conf.d/20-gettext.ini, /etc/php/8.2/cli/conf.d/20-iconv.ini, /etc/php/8.2/cli/conf.d/20-phar.ini, /etc/php/8.2/cli/conf.d/20-posix.ini, /etc/php/8.2/cli/conf.d/20-readline.ini, /etc/php/8.2/cli/conf.d/20-shmop.ini, /etc/php/8.2/cli/conf.d/20-sockets.ini, /etc/php/8.2/cli/conf.d/20-sysvmsg.ini, /etc/php/8.2/cli/conf.d/20-sysvsem.ini, /etc/php/8.2/cli/conf.d/20-sysvshm.ini, /etc/php/8.2/cli/conf.d/20-tokenizer.ini</additional_php_ini>
<configuration_file>/etc/php/8.2/cli/php.ini</configuration_file>
<configuration_options>
<configuration_option name="include_path" value=".:/usr/share/php" />
</configuration_options>
<debuggers />
<loaded_extensions>
<extension name="Core" />
<extension name="FFI" />
<extension name="PDO" />
<extension name="Phar" />
<extension name="Reflection" />
<extension name="SPL" />
<extension name="Zend OPcache" />
<extension name="calendar" />
<extension name="ctype" />
<extension name="date" />
<extension name="exif" />
<extension name="fileinfo" />
<extension name="filter" />
<extension name="ftp" />
<extension name="gettext" />
<extension name="hash" />
<extension name="iconv" />
<extension name="json" />
<extension name="libxml" />
<extension name="openssl" />
<extension name="pcntl" />
<extension name="pcre" />
<extension name="posix" />
<extension name="random" />
<extension name="readline" />
<extension name="session" />
<extension name="shmop" />
<extension name="sockets" />
<extension name="sodium" />
<extension name="standard" />
<extension name="sysvmsg" />
<extension name="sysvsem" />
<extension name="sysvshm" />
<extension name="tokenizer" />
<extension name="zlib" />
</loaded_extensions>
</phpinfo>
</interpreter>
</phpInfoCache>
</component>
<component name="PhpProjectSharedConfiguration" php_language_level="8.2" />
<component name="PhpStanOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PsalmOptionsConfiguration">
<option name="transferred" value="true" />
</component>
</project>

16
.idea/phpspec.xml generated Normal file
View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PHPSpec">
<suites>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
<PhpSpecSuiteConfiguration>
<option name="myPath" value="$PROJECT_DIR$" />
</PhpSpecSuiteConfiguration>
</suites>
</component>
</project>

10
.idea/phpunit.xml generated Normal file
View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PHPUnit">
<option name="directories">
<list>
<option value="$PROJECT_DIR$/tests" />
</list>
</option>
</component>
</project>

12
.idea/utahsdjs2025.iml generated Normal file
View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/yosymfony/parser-utils" />
<excludeFolder url="file://$MODULE_DIR$/vendor/yosymfony/toml" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml generated Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

12
classes/Database.php Normal file
View file

@ -0,0 +1,12 @@
<?php
// create a class that extends mysql database
class Database extends mysqli
{
// create a constructor that takes in the config file
public function __construct($config)
{
// call the parent constructor with the config file
parent::__construct($config['database']['host'], $config['database']['username'], $config['database']['password'], $config['database']['database'], $config['database']['port'] ?? 3306);
}
}

18
composer.json Normal file
View file

@ -0,0 +1,18 @@
{
"name": "utahsdjs/utahsdjs2025",
"description": "description",
"minimum-stability": "stable",
"version": "0.0.1",
"license": "proprietary",
"authors": [
{
"name": "Cody Cook",
"email": "utahsdjs@codycook.us"
}
],
"require": {
"php": ">=8.2.0",
"yosymfony/toml": "*",
"ext-mysqli": "*"
}
}

131
composer.lock generated Normal file
View file

@ -0,0 +1,131 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "30cbda5947197fc974540cf5949444a9",
"packages": [
{
"name": "yosymfony/parser-utils",
"version": "v2.0.0",
"source": {
"type": "git",
"url": "https://github.com/yosymfony/parser-utils.git",
"reference": "00bec9a12722b21f2baf7f9db35f127e90c162c9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yosymfony/parser-utils/zipball/00bec9a12722b21f2baf7f9db35f127e90c162c9",
"reference": "00bec9a12722b21f2baf7f9db35f127e90c162c9",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"require-dev": {
"phpunit/phpunit": "^6"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"autoload": {
"psr-4": {
"Yosymfony\\ParserUtils\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Victor Puertas",
"email": "vpgugr@gmail.com",
"homepage": "http://yosymfony.com"
}
],
"description": "Parser utilities",
"homepage": "http://github.com/yosymfony/toml",
"keywords": [
"lexer",
"parser"
],
"support": {
"issues": "https://github.com/yosymfony/parser-utils/issues",
"source": "https://github.com/yosymfony/parser-utils/tree/master"
},
"time": "2018-06-29T15:31:11+00:00"
},
{
"name": "yosymfony/toml",
"version": "v1.0.4",
"source": {
"type": "git",
"url": "https://github.com/yosymfony/toml.git",
"reference": "bdab92ad920d0e36810a3a3e4a998d23f3498f8e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yosymfony/toml/zipball/bdab92ad920d0e36810a3a3e4a998d23f3498f8e",
"reference": "bdab92ad920d0e36810a3a3e4a998d23f3498f8e",
"shasum": ""
},
"require": {
"php": ">=7.1",
"yosymfony/parser-utils": "^2.0"
},
"require-dev": {
"phpunit/phpunit": "^7.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"psr-4": {
"Yosymfony\\Toml\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Victor Puertas",
"email": "vpgugr@gmail.com",
"homepage": "http://yosymfony.com"
}
],
"description": "A PHP parser for TOML compatible with specification 0.4.0",
"homepage": "http://github.com/yosymfony/toml",
"keywords": [
"mojombo",
"parser",
"toml"
],
"support": {
"issues": "https://github.com/yosymfony/toml/issues",
"source": "https://github.com/yosymfony/toml/tree/master"
},
"time": "2018-08-08T15:08:14+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=8.2.0"
},
"platform-dev": [],
"plugin-api-version": "2.6.0"
}

BIN
composer.phar Normal file

Binary file not shown.

4085
css/bootstrap-grid.css vendored Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

6
css/bootstrap-grid.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4084
css/bootstrap-grid.rtl.css vendored Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

6
css/bootstrap-grid.rtl.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

597
css/bootstrap-reboot.css vendored Normal file
View file

@ -0,0 +1,597 @@
/*!
* Bootstrap Reboot v5.3.3 (https://getbootstrap.com/)
* Copyright 2011-2024 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
:root,
[data-bs-theme=light] {
--bs-blue: #0d6efd;
--bs-indigo: #6610f2;
--bs-purple: #6f42c1;
--bs-pink: #d63384;
--bs-red: #dc3545;
--bs-orange: #fd7e14;
--bs-yellow: #ffc107;
--bs-green: #198754;
--bs-teal: #20c997;
--bs-cyan: #0dcaf0;
--bs-black: #000;
--bs-white: #fff;
--bs-gray: #6c757d;
--bs-gray-dark: #343a40;
--bs-gray-100: #f8f9fa;
--bs-gray-200: #e9ecef;
--bs-gray-300: #dee2e6;
--bs-gray-400: #ced4da;
--bs-gray-500: #adb5bd;
--bs-gray-600: #6c757d;
--bs-gray-700: #495057;
--bs-gray-800: #343a40;
--bs-gray-900: #212529;
--bs-primary: #0d6efd;
--bs-secondary: #6c757d;
--bs-success: #198754;
--bs-info: #0dcaf0;
--bs-warning: #ffc107;
--bs-danger: #dc3545;
--bs-light: #f8f9fa;
--bs-dark: #212529;
--bs-primary-rgb: 13, 110, 253;
--bs-secondary-rgb: 108, 117, 125;
--bs-success-rgb: 25, 135, 84;
--bs-info-rgb: 13, 202, 240;
--bs-warning-rgb: 255, 193, 7;
--bs-danger-rgb: 220, 53, 69;
--bs-light-rgb: 248, 249, 250;
--bs-dark-rgb: 33, 37, 41;
--bs-primary-text-emphasis: #052c65;
--bs-secondary-text-emphasis: #2b2f32;
--bs-success-text-emphasis: #0a3622;
--bs-info-text-emphasis: #055160;
--bs-warning-text-emphasis: #664d03;
--bs-danger-text-emphasis: #58151c;
--bs-light-text-emphasis: #495057;
--bs-dark-text-emphasis: #495057;
--bs-primary-bg-subtle: #cfe2ff;
--bs-secondary-bg-subtle: #e2e3e5;
--bs-success-bg-subtle: #d1e7dd;
--bs-info-bg-subtle: #cff4fc;
--bs-warning-bg-subtle: #fff3cd;
--bs-danger-bg-subtle: #f8d7da;
--bs-light-bg-subtle: #fcfcfd;
--bs-dark-bg-subtle: #ced4da;
--bs-primary-border-subtle: #9ec5fe;
--bs-secondary-border-subtle: #c4c8cb;
--bs-success-border-subtle: #a3cfbb;
--bs-info-border-subtle: #9eeaf9;
--bs-warning-border-subtle: #ffe69c;
--bs-danger-border-subtle: #f1aeb5;
--bs-light-border-subtle: #e9ecef;
--bs-dark-border-subtle: #adb5bd;
--bs-white-rgb: 255, 255, 255;
--bs-black-rgb: 0, 0, 0;
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
--bs-body-font-family: var(--bs-font-sans-serif);
--bs-body-font-size: 1rem;
--bs-body-font-weight: 400;
--bs-body-line-height: 1.5;
--bs-body-color: #212529;
--bs-body-color-rgb: 33, 37, 41;
--bs-body-bg: #fff;
--bs-body-bg-rgb: 255, 255, 255;
--bs-emphasis-color: #000;
--bs-emphasis-color-rgb: 0, 0, 0;
--bs-secondary-color: rgba(33, 37, 41, 0.75);
--bs-secondary-color-rgb: 33, 37, 41;
--bs-secondary-bg: #e9ecef;
--bs-secondary-bg-rgb: 233, 236, 239;
--bs-tertiary-color: rgba(33, 37, 41, 0.5);
--bs-tertiary-color-rgb: 33, 37, 41;
--bs-tertiary-bg: #f8f9fa;
--bs-tertiary-bg-rgb: 248, 249, 250;
--bs-heading-color: inherit;
--bs-link-color: #0d6efd;
--bs-link-color-rgb: 13, 110, 253;
--bs-link-decoration: underline;
--bs-link-hover-color: #0a58ca;
--bs-link-hover-color-rgb: 10, 88, 202;
--bs-code-color: #d63384;
--bs-highlight-color: #212529;
--bs-highlight-bg: #fff3cd;
--bs-border-width: 1px;
--bs-border-style: solid;
--bs-border-color: #dee2e6;
--bs-border-color-translucent: rgba(0, 0, 0, 0.175);
--bs-border-radius: 0.375rem;
--bs-border-radius-sm: 0.25rem;
--bs-border-radius-lg: 0.5rem;
--bs-border-radius-xl: 1rem;
--bs-border-radius-xxl: 2rem;
--bs-border-radius-2xl: var(--bs-border-radius-xxl);
--bs-border-radius-pill: 50rem;
--bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
--bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
--bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
--bs-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.075);
--bs-focus-ring-width: 0.25rem;
--bs-focus-ring-opacity: 0.25;
--bs-focus-ring-color: rgba(13, 110, 253, 0.25);
--bs-form-valid-color: #198754;
--bs-form-valid-border-color: #198754;
--bs-form-invalid-color: #dc3545;
--bs-form-invalid-border-color: #dc3545;
}
[data-bs-theme=dark] {
color-scheme: dark;
--bs-body-color: #dee2e6;
--bs-body-color-rgb: 222, 226, 230;
--bs-body-bg: #212529;
--bs-body-bg-rgb: 33, 37, 41;
--bs-emphasis-color: #fff;
--bs-emphasis-color-rgb: 255, 255, 255;
--bs-secondary-color: rgba(222, 226, 230, 0.75);
--bs-secondary-color-rgb: 222, 226, 230;
--bs-secondary-bg: #343a40;
--bs-secondary-bg-rgb: 52, 58, 64;
--bs-tertiary-color: rgba(222, 226, 230, 0.5);
--bs-tertiary-color-rgb: 222, 226, 230;
--bs-tertiary-bg: #2b3035;
--bs-tertiary-bg-rgb: 43, 48, 53;
--bs-primary-text-emphasis: #6ea8fe;
--bs-secondary-text-emphasis: #a7acb1;
--bs-success-text-emphasis: #75b798;
--bs-info-text-emphasis: #6edff6;
--bs-warning-text-emphasis: #ffda6a;
--bs-danger-text-emphasis: #ea868f;
--bs-light-text-emphasis: #f8f9fa;
--bs-dark-text-emphasis: #dee2e6;
--bs-primary-bg-subtle: #031633;
--bs-secondary-bg-subtle: #161719;
--bs-success-bg-subtle: #051b11;
--bs-info-bg-subtle: #032830;
--bs-warning-bg-subtle: #332701;
--bs-danger-bg-subtle: #2c0b0e;
--bs-light-bg-subtle: #343a40;
--bs-dark-bg-subtle: #1a1d20;
--bs-primary-border-subtle: #084298;
--bs-secondary-border-subtle: #41464b;
--bs-success-border-subtle: #0f5132;
--bs-info-border-subtle: #087990;
--bs-warning-border-subtle: #997404;
--bs-danger-border-subtle: #842029;
--bs-light-border-subtle: #495057;
--bs-dark-border-subtle: #343a40;
--bs-heading-color: inherit;
--bs-link-color: #6ea8fe;
--bs-link-hover-color: #8bb9fe;
--bs-link-color-rgb: 110, 168, 254;
--bs-link-hover-color-rgb: 139, 185, 254;
--bs-code-color: #e685b5;
--bs-highlight-color: #dee2e6;
--bs-highlight-bg: #664d03;
--bs-border-color: #495057;
--bs-border-color-translucent: rgba(255, 255, 255, 0.15);
--bs-form-valid-color: #75b798;
--bs-form-valid-border-color: #75b798;
--bs-form-invalid-color: #ea868f;
--bs-form-invalid-border-color: #ea868f;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
@media (prefers-reduced-motion: no-preference) {
:root {
scroll-behavior: smooth;
}
}
body {
margin: 0;
font-family: var(--bs-body-font-family);
font-size: var(--bs-body-font-size);
font-weight: var(--bs-body-font-weight);
line-height: var(--bs-body-line-height);
color: var(--bs-body-color);
text-align: var(--bs-body-text-align);
background-color: var(--bs-body-bg);
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
hr {
margin: 1rem 0;
color: inherit;
border: 0;
border-top: var(--bs-border-width) solid;
opacity: 0.25;
}
h6, h5, h4, h3, h2, h1 {
margin-top: 0;
margin-bottom: 0.5rem;
font-weight: 500;
line-height: 1.2;
color: var(--bs-heading-color);
}
h1 {
font-size: calc(1.375rem + 1.5vw);
}
@media (min-width: 1200px) {
h1 {
font-size: 2.5rem;
}
}
h2 {
font-size: calc(1.325rem + 0.9vw);
}
@media (min-width: 1200px) {
h2 {
font-size: 2rem;
}
}
h3 {
font-size: calc(1.3rem + 0.6vw);
}
@media (min-width: 1200px) {
h3 {
font-size: 1.75rem;
}
}
h4 {
font-size: calc(1.275rem + 0.3vw);
}
@media (min-width: 1200px) {
h4 {
font-size: 1.5rem;
}
}
h5 {
font-size: 1.25rem;
}
h6 {
font-size: 1rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title] {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
-webkit-text-decoration-skip-ink: none;
text-decoration-skip-ink: none;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul {
padding-left: 2rem;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: 0.5rem;
margin-left: 0;
}
blockquote {
margin: 0 0 1rem;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 0.875em;
}
mark {
padding: 0.1875em;
color: var(--bs-highlight-color);
background-color: var(--bs-highlight-bg);
}
sub,
sup {
position: relative;
font-size: 0.75em;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
a {
color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
text-decoration: underline;
}
a:hover {
--bs-link-color-rgb: var(--bs-link-hover-color-rgb);
}
a:not([href]):not([class]), a:not([href]):not([class]):hover {
color: inherit;
text-decoration: none;
}
pre,
code,
kbd,
samp {
font-family: var(--bs-font-monospace);
font-size: 1em;
}
pre {
display: block;
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
font-size: 0.875em;
}
pre code {
font-size: inherit;
color: inherit;
word-break: normal;
}
code {
font-size: 0.875em;
color: var(--bs-code-color);
word-wrap: break-word;
}
a > code {
color: inherit;
}
kbd {
padding: 0.1875rem 0.375rem;
font-size: 0.875em;
color: var(--bs-body-bg);
background-color: var(--bs-body-color);
border-radius: 0.25rem;
}
kbd kbd {
padding: 0;
font-size: 1em;
}
figure {
margin: 0 0 1rem;
}
img,
svg {
vertical-align: middle;
}
table {
caption-side: bottom;
border-collapse: collapse;
}
caption {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
color: var(--bs-secondary-color);
text-align: left;
}
th {
text-align: inherit;
text-align: -webkit-match-parent;
}
thead,
tbody,
tfoot,
tr,
td,
th {
border-color: inherit;
border-style: solid;
border-width: 0;
}
label {
display: inline-block;
}
button {
border-radius: 0;
}
button:focus:not(:focus-visible) {
outline: 0;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
select {
text-transform: none;
}
[role=button] {
cursor: pointer;
}
select {
word-wrap: normal;
}
select:disabled {
opacity: 1;
}
[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator {
display: none !important;
}
button,
[type=button],
[type=reset],
[type=submit] {
-webkit-appearance: button;
}
button:not(:disabled),
[type=button]:not(:disabled),
[type=reset]:not(:disabled),
[type=submit]:not(:disabled) {
cursor: pointer;
}
::-moz-focus-inner {
padding: 0;
border-style: none;
}
textarea {
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
float: left;
width: 100%;
padding: 0;
margin-bottom: 0.5rem;
font-size: calc(1.275rem + 0.3vw);
line-height: inherit;
}
@media (min-width: 1200px) {
legend {
font-size: 1.5rem;
}
}
legend + * {
clear: left;
}
::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-minute,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-year-field {
padding: 0;
}
::-webkit-inner-spin-button {
height: auto;
}
[type=search] {
-webkit-appearance: textfield;
outline-offset: -2px;
}
/* rtl:raw:
[type="tel"],
[type="url"],
[type="email"],
[type="number"] {
direction: ltr;
}
*/
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-color-swatch-wrapper {
padding: 0;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
::file-selector-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
iframe {
border: 0;
}
summary {
display: list-item;
cursor: pointer;
}
progress {
vertical-align: baseline;
}
[hidden] {
display: none !important;
}
/*# sourceMappingURL=bootstrap-reboot.css.map */

File diff suppressed because one or more lines are too long

6
css/bootstrap-reboot.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

594
css/bootstrap-reboot.rtl.css vendored Normal file
View file

@ -0,0 +1,594 @@
/*!
* Bootstrap Reboot v5.3.3 (https://getbootstrap.com/)
* Copyright 2011-2024 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
:root,
[data-bs-theme=light] {
--bs-blue: #0d6efd;
--bs-indigo: #6610f2;
--bs-purple: #6f42c1;
--bs-pink: #d63384;
--bs-red: #dc3545;
--bs-orange: #fd7e14;
--bs-yellow: #ffc107;
--bs-green: #198754;
--bs-teal: #20c997;
--bs-cyan: #0dcaf0;
--bs-black: #000;
--bs-white: #fff;
--bs-gray: #6c757d;
--bs-gray-dark: #343a40;
--bs-gray-100: #f8f9fa;
--bs-gray-200: #e9ecef;
--bs-gray-300: #dee2e6;
--bs-gray-400: #ced4da;
--bs-gray-500: #adb5bd;
--bs-gray-600: #6c757d;
--bs-gray-700: #495057;
--bs-gray-800: #343a40;
--bs-gray-900: #212529;
--bs-primary: #0d6efd;
--bs-secondary: #6c757d;
--bs-success: #198754;
--bs-info: #0dcaf0;
--bs-warning: #ffc107;
--bs-danger: #dc3545;
--bs-light: #f8f9fa;
--bs-dark: #212529;
--bs-primary-rgb: 13, 110, 253;
--bs-secondary-rgb: 108, 117, 125;
--bs-success-rgb: 25, 135, 84;
--bs-info-rgb: 13, 202, 240;
--bs-warning-rgb: 255, 193, 7;
--bs-danger-rgb: 220, 53, 69;
--bs-light-rgb: 248, 249, 250;
--bs-dark-rgb: 33, 37, 41;
--bs-primary-text-emphasis: #052c65;
--bs-secondary-text-emphasis: #2b2f32;
--bs-success-text-emphasis: #0a3622;
--bs-info-text-emphasis: #055160;
--bs-warning-text-emphasis: #664d03;
--bs-danger-text-emphasis: #58151c;
--bs-light-text-emphasis: #495057;
--bs-dark-text-emphasis: #495057;
--bs-primary-bg-subtle: #cfe2ff;
--bs-secondary-bg-subtle: #e2e3e5;
--bs-success-bg-subtle: #d1e7dd;
--bs-info-bg-subtle: #cff4fc;
--bs-warning-bg-subtle: #fff3cd;
--bs-danger-bg-subtle: #f8d7da;
--bs-light-bg-subtle: #fcfcfd;
--bs-dark-bg-subtle: #ced4da;
--bs-primary-border-subtle: #9ec5fe;
--bs-secondary-border-subtle: #c4c8cb;
--bs-success-border-subtle: #a3cfbb;
--bs-info-border-subtle: #9eeaf9;
--bs-warning-border-subtle: #ffe69c;
--bs-danger-border-subtle: #f1aeb5;
--bs-light-border-subtle: #e9ecef;
--bs-dark-border-subtle: #adb5bd;
--bs-white-rgb: 255, 255, 255;
--bs-black-rgb: 0, 0, 0;
--bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
--bs-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
--bs-body-font-family: var(--bs-font-sans-serif);
--bs-body-font-size: 1rem;
--bs-body-font-weight: 400;
--bs-body-line-height: 1.5;
--bs-body-color: #212529;
--bs-body-color-rgb: 33, 37, 41;
--bs-body-bg: #fff;
--bs-body-bg-rgb: 255, 255, 255;
--bs-emphasis-color: #000;
--bs-emphasis-color-rgb: 0, 0, 0;
--bs-secondary-color: rgba(33, 37, 41, 0.75);
--bs-secondary-color-rgb: 33, 37, 41;
--bs-secondary-bg: #e9ecef;
--bs-secondary-bg-rgb: 233, 236, 239;
--bs-tertiary-color: rgba(33, 37, 41, 0.5);
--bs-tertiary-color-rgb: 33, 37, 41;
--bs-tertiary-bg: #f8f9fa;
--bs-tertiary-bg-rgb: 248, 249, 250;
--bs-heading-color: inherit;
--bs-link-color: #0d6efd;
--bs-link-color-rgb: 13, 110, 253;
--bs-link-decoration: underline;
--bs-link-hover-color: #0a58ca;
--bs-link-hover-color-rgb: 10, 88, 202;
--bs-code-color: #d63384;
--bs-highlight-color: #212529;
--bs-highlight-bg: #fff3cd;
--bs-border-width: 1px;
--bs-border-style: solid;
--bs-border-color: #dee2e6;
--bs-border-color-translucent: rgba(0, 0, 0, 0.175);
--bs-border-radius: 0.375rem;
--bs-border-radius-sm: 0.25rem;
--bs-border-radius-lg: 0.5rem;
--bs-border-radius-xl: 1rem;
--bs-border-radius-xxl: 2rem;
--bs-border-radius-2xl: var(--bs-border-radius-xxl);
--bs-border-radius-pill: 50rem;
--bs-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
--bs-box-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
--bs-box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
--bs-box-shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.075);
--bs-focus-ring-width: 0.25rem;
--bs-focus-ring-opacity: 0.25;
--bs-focus-ring-color: rgba(13, 110, 253, 0.25);
--bs-form-valid-color: #198754;
--bs-form-valid-border-color: #198754;
--bs-form-invalid-color: #dc3545;
--bs-form-invalid-border-color: #dc3545;
}
[data-bs-theme=dark] {
color-scheme: dark;
--bs-body-color: #dee2e6;
--bs-body-color-rgb: 222, 226, 230;
--bs-body-bg: #212529;
--bs-body-bg-rgb: 33, 37, 41;
--bs-emphasis-color: #fff;
--bs-emphasis-color-rgb: 255, 255, 255;
--bs-secondary-color: rgba(222, 226, 230, 0.75);
--bs-secondary-color-rgb: 222, 226, 230;
--bs-secondary-bg: #343a40;
--bs-secondary-bg-rgb: 52, 58, 64;
--bs-tertiary-color: rgba(222, 226, 230, 0.5);
--bs-tertiary-color-rgb: 222, 226, 230;
--bs-tertiary-bg: #2b3035;
--bs-tertiary-bg-rgb: 43, 48, 53;
--bs-primary-text-emphasis: #6ea8fe;
--bs-secondary-text-emphasis: #a7acb1;
--bs-success-text-emphasis: #75b798;
--bs-info-text-emphasis: #6edff6;
--bs-warning-text-emphasis: #ffda6a;
--bs-danger-text-emphasis: #ea868f;
--bs-light-text-emphasis: #f8f9fa;
--bs-dark-text-emphasis: #dee2e6;
--bs-primary-bg-subtle: #031633;
--bs-secondary-bg-subtle: #161719;
--bs-success-bg-subtle: #051b11;
--bs-info-bg-subtle: #032830;
--bs-warning-bg-subtle: #332701;
--bs-danger-bg-subtle: #2c0b0e;
--bs-light-bg-subtle: #343a40;
--bs-dark-bg-subtle: #1a1d20;
--bs-primary-border-subtle: #084298;
--bs-secondary-border-subtle: #41464b;
--bs-success-border-subtle: #0f5132;
--bs-info-border-subtle: #087990;
--bs-warning-border-subtle: #997404;
--bs-danger-border-subtle: #842029;
--bs-light-border-subtle: #495057;
--bs-dark-border-subtle: #343a40;
--bs-heading-color: inherit;
--bs-link-color: #6ea8fe;
--bs-link-hover-color: #8bb9fe;
--bs-link-color-rgb: 110, 168, 254;
--bs-link-hover-color-rgb: 139, 185, 254;
--bs-code-color: #e685b5;
--bs-highlight-color: #dee2e6;
--bs-highlight-bg: #664d03;
--bs-border-color: #495057;
--bs-border-color-translucent: rgba(255, 255, 255, 0.15);
--bs-form-valid-color: #75b798;
--bs-form-valid-border-color: #75b798;
--bs-form-invalid-color: #ea868f;
--bs-form-invalid-border-color: #ea868f;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
@media (prefers-reduced-motion: no-preference) {
:root {
scroll-behavior: smooth;
}
}
body {
margin: 0;
font-family: var(--bs-body-font-family);
font-size: var(--bs-body-font-size);
font-weight: var(--bs-body-font-weight);
line-height: var(--bs-body-line-height);
color: var(--bs-body-color);
text-align: var(--bs-body-text-align);
background-color: var(--bs-body-bg);
-webkit-text-size-adjust: 100%;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
hr {
margin: 1rem 0;
color: inherit;
border: 0;
border-top: var(--bs-border-width) solid;
opacity: 0.25;
}
h6, h5, h4, h3, h2, h1 {
margin-top: 0;
margin-bottom: 0.5rem;
font-weight: 500;
line-height: 1.2;
color: var(--bs-heading-color);
}
h1 {
font-size: calc(1.375rem + 1.5vw);
}
@media (min-width: 1200px) {
h1 {
font-size: 2.5rem;
}
}
h2 {
font-size: calc(1.325rem + 0.9vw);
}
@media (min-width: 1200px) {
h2 {
font-size: 2rem;
}
}
h3 {
font-size: calc(1.3rem + 0.6vw);
}
@media (min-width: 1200px) {
h3 {
font-size: 1.75rem;
}
}
h4 {
font-size: calc(1.275rem + 0.3vw);
}
@media (min-width: 1200px) {
h4 {
font-size: 1.5rem;
}
}
h5 {
font-size: 1.25rem;
}
h6 {
font-size: 1rem;
}
p {
margin-top: 0;
margin-bottom: 1rem;
}
abbr[title] {
-webkit-text-decoration: underline dotted;
text-decoration: underline dotted;
cursor: help;
-webkit-text-decoration-skip-ink: none;
text-decoration-skip-ink: none;
}
address {
margin-bottom: 1rem;
font-style: normal;
line-height: inherit;
}
ol,
ul {
padding-right: 2rem;
}
ol,
ul,
dl {
margin-top: 0;
margin-bottom: 1rem;
}
ol ol,
ul ul,
ol ul,
ul ol {
margin-bottom: 0;
}
dt {
font-weight: 700;
}
dd {
margin-bottom: 0.5rem;
margin-right: 0;
}
blockquote {
margin: 0 0 1rem;
}
b,
strong {
font-weight: bolder;
}
small {
font-size: 0.875em;
}
mark {
padding: 0.1875em;
color: var(--bs-highlight-color);
background-color: var(--bs-highlight-bg);
}
sub,
sup {
position: relative;
font-size: 0.75em;
line-height: 0;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
a {
color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1));
text-decoration: underline;
}
a:hover {
--bs-link-color-rgb: var(--bs-link-hover-color-rgb);
}
a:not([href]):not([class]), a:not([href]):not([class]):hover {
color: inherit;
text-decoration: none;
}
pre,
code,
kbd,
samp {
font-family: var(--bs-font-monospace);
font-size: 1em;
}
pre {
display: block;
margin-top: 0;
margin-bottom: 1rem;
overflow: auto;
font-size: 0.875em;
}
pre code {
font-size: inherit;
color: inherit;
word-break: normal;
}
code {
font-size: 0.875em;
color: var(--bs-code-color);
word-wrap: break-word;
}
a > code {
color: inherit;
}
kbd {
padding: 0.1875rem 0.375rem;
font-size: 0.875em;
color: var(--bs-body-bg);
background-color: var(--bs-body-color);
border-radius: 0.25rem;
}
kbd kbd {
padding: 0;
font-size: 1em;
}
figure {
margin: 0 0 1rem;
}
img,
svg {
vertical-align: middle;
}
table {
caption-side: bottom;
border-collapse: collapse;
}
caption {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
color: var(--bs-secondary-color);
text-align: right;
}
th {
text-align: inherit;
text-align: -webkit-match-parent;
}
thead,
tbody,
tfoot,
tr,
td,
th {
border-color: inherit;
border-style: solid;
border-width: 0;
}
label {
display: inline-block;
}
button {
border-radius: 0;
}
button:focus:not(:focus-visible) {
outline: 0;
}
input,
button,
select,
optgroup,
textarea {
margin: 0;
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
button,
select {
text-transform: none;
}
[role=button] {
cursor: pointer;
}
select {
word-wrap: normal;
}
select:disabled {
opacity: 1;
}
[list]:not([type=date]):not([type=datetime-local]):not([type=month]):not([type=week]):not([type=time])::-webkit-calendar-picker-indicator {
display: none !important;
}
button,
[type=button],
[type=reset],
[type=submit] {
-webkit-appearance: button;
}
button:not(:disabled),
[type=button]:not(:disabled),
[type=reset]:not(:disabled),
[type=submit]:not(:disabled) {
cursor: pointer;
}
::-moz-focus-inner {
padding: 0;
border-style: none;
}
textarea {
resize: vertical;
}
fieldset {
min-width: 0;
padding: 0;
margin: 0;
border: 0;
}
legend {
float: right;
width: 100%;
padding: 0;
margin-bottom: 0.5rem;
font-size: calc(1.275rem + 0.3vw);
line-height: inherit;
}
@media (min-width: 1200px) {
legend {
font-size: 1.5rem;
}
}
legend + * {
clear: right;
}
::-webkit-datetime-edit-fields-wrapper,
::-webkit-datetime-edit-text,
::-webkit-datetime-edit-minute,
::-webkit-datetime-edit-hour-field,
::-webkit-datetime-edit-day-field,
::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-year-field {
padding: 0;
}
::-webkit-inner-spin-button {
height: auto;
}
[type=search] {
-webkit-appearance: textfield;
outline-offset: -2px;
}
[type="tel"],
[type="url"],
[type="email"],
[type="number"] {
direction: ltr;
}
::-webkit-search-decoration {
-webkit-appearance: none;
}
::-webkit-color-swatch-wrapper {
padding: 0;
}
::-webkit-file-upload-button {
font: inherit;
-webkit-appearance: button;
}
::file-selector-button {
font: inherit;
-webkit-appearance: button;
}
output {
display: inline-block;
}
iframe {
border: 0;
}
summary {
display: list-item;
cursor: pointer;
}
progress {
vertical-align: baseline;
}
[hidden] {
display: none !important;
}
/*# sourceMappingURL=bootstrap-reboot.rtl.css.map */

File diff suppressed because one or more lines are too long

6
css/bootstrap-reboot.rtl.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

5402
css/bootstrap-utilities.css vendored Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

6
css/bootstrap-utilities.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

5393
css/bootstrap-utilities.rtl.css vendored Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

6
css/bootstrap-utilities.rtl.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

12057
css/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load diff

1
css/bootstrap.css.map Normal file

File diff suppressed because one or more lines are too long

6
css/bootstrap.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

12030
css/bootstrap.rtl.css vendored Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

6
css/bootstrap.rtl.min.css vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

11
functions/i18n.php Normal file
View file

@ -0,0 +1,11 @@
<?php
function loadLocale($lang = 'en_US') {
$file = __DIR__ . '/../locale/' . $lang . '/messages.php';
if (file_exists($file)) {
return require $file;
} else {
// Fallback to English if the specified language file does not exist
return require __DIR__ . '/../locale/en_US/messages.php';
}
}

View file

@ -0,0 +1,30 @@
[app]
name = "DJ Mix Hosting Software"
logo = "about:blank"
document_root = "/home/utahsdjs/web/beta.utahsdjs.com/public_html/"
timezone = "America/Los_Angeles"
locale = "en_US"
[database]
type = "mysql"
host = "localhost"
port = 3306
user = "username"
password = "password"
prefix = ""
file = "app.db"
[notifications]
[notifications.telegram]
token = "telegram:token"
chat_id = "1234567890"
[seo]
yandex = false
google = false
bing = false
baidu = false
[seo.crawlers]
yandex_id = "a1b2c3d4f5g6h7"

14
index.php Normal file
View file

@ -0,0 +1,14 @@
<?php
// read toml config file
require 'vendor/autoload.php';
require 'functions/i18n.php';
use Yosymfony\Toml\Toml;
$config = Toml::ParseFile('includes/config.toml');
// $config['app']['name']
// load locale
$locale = loadLocale($config['app']['locale']);
// $locale['string']

6314
js/bootstrap.bundle.js vendored Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

7
js/bootstrap.bundle.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4447
js/bootstrap.esm.js vendored Normal file

File diff suppressed because it is too large Load diff

1
js/bootstrap.esm.js.map Normal file

File diff suppressed because one or more lines are too long

7
js/bootstrap.esm.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4494
js/bootstrap.js vendored Normal file

File diff suppressed because it is too large Load diff

1
js/bootstrap.js.map Normal file

File diff suppressed because one or more lines are too long

7
js/bootstrap.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1
js/bootstrap.min.js.map Normal file

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,5 @@
<?php
return [
'welcome' => 'Welcome to Our Website!',
'description' => 'This is a description in English.'
];

25
vendor/autoload.php vendored Normal file
View file

@ -0,0 +1,25 @@
<?php
// autoload.php @generated by Composer
if (PHP_VERSION_ID < 50600) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
}
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit6bb46fd04ba59751dbe13daf4711c4e1::getLoader();

579
vendor/composer/ClassLoader.php vendored Normal file
View file

@ -0,0 +1,579 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Autoload;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see https://www.php-fig.org/psr/psr-0/
* @see https://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
/** @var \Closure(string):void */
private static $includeFile;
/** @var string|null */
private $vendorDir;
// PSR-4
/**
* @var array<string, array<string, int>>
*/
private $prefixLengthsPsr4 = array();
/**
* @var array<string, list<string>>
*/
private $prefixDirsPsr4 = array();
/**
* @var list<string>
*/
private $fallbackDirsPsr4 = array();
// PSR-0
/**
* List of PSR-0 prefixes
*
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
*
* @var array<string, array<string, list<string>>>
*/
private $prefixesPsr0 = array();
/**
* @var list<string>
*/
private $fallbackDirsPsr0 = array();
/** @var bool */
private $useIncludePath = false;
/**
* @var array<string, string>
*/
private $classMap = array();
/** @var bool */
private $classMapAuthoritative = false;
/**
* @var array<string, bool>
*/
private $missingClasses = array();
/** @var string|null */
private $apcuPrefix;
/**
* @var array<string, self>
*/
private static $registeredLoaders = array();
/**
* @param string|null $vendorDir
*/
public function __construct($vendorDir = null)
{
$this->vendorDir = $vendorDir;
self::initializeIncludeClosure();
}
/**
* @return array<string, list<string>>
*/
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
}
return array();
}
/**
* @return array<string, list<string>>
*/
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
/**
* @return list<string>
*/
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
/**
* @return list<string>
*/
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
/**
* @return array<string, string> Array of classname => path
*/
public function getClassMap()
{
return $this->classMap;
}
/**
* @param array<string, string> $classMap Class to filename map
*
* @return void
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*
* @return void
*/
public function add($prefix, $paths, $prepend = false)
{
$paths = (array) $paths;
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
$paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
$paths
);
}
return;
}
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
$paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
$paths = (array) $paths;
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
$paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
$paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
$paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 base directories
*
* @return void
*/
public function set($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public function setPsr4($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*
* @return void
*/
public function setUseIncludePath($useIncludePath)
{
$this->useIncludePath = $useIncludePath;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public function getUseIncludePath()
{
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*
* @return void
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*
* @return void
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*
* @return void
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
if (null === $this->vendorDir) {
return;
}
if ($prepend) {
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
} else {
unset(self::$registeredLoaders[$this->vendorDir]);
self::$registeredLoaders[$this->vendorDir] = $this;
}
}
/**
* Unregisters this instance as an autoloader.
*
* @return void
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
if (null !== $this->vendorDir) {
unset(self::$registeredLoaders[$this->vendorDir]);
}
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return true|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
$includeFile = self::$includeFile;
$includeFile($file);
return true;
}
return null;
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
}
return $file;
}
/**
* Returns the currently registered loaders keyed by their corresponding vendor directories.
*
* @return array<string, self>
*/
public static function getRegisteredLoaders()
{
return self::$registeredLoaders;
}
/**
* @param string $class
* @param string $ext
* @return string|false
*/
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
}
}
}
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
// PSR-0 lookup
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
}
}
}
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
// PSR-0 include paths.
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
return false;
}
/**
* @return void
*/
private static function initializeIncludeClosure()
{
if (self::$includeFile !== null) {
return;
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
*/
self::$includeFile = \Closure::bind(static function($file) {
include $file;
}, null, null);
}
}

359
vendor/composer/InstalledVersions.php vendored Normal file
View file

@ -0,0 +1,359 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer;
use Composer\Autoload\ClassLoader;
use Composer\Semver\VersionParser;
/**
* This class is copied in every Composer installed project and available to all
*
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
*
* To require its presence, you can require `composer-runtime-api ^2.0`
*
* @final
*/
class InstalledVersions
{
/**
* @var mixed[]|null
* @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
*/
private static $installed;
/**
* @var bool|null
*/
private static $canGetVendors;
/**
* @var array[]
* @psalm-var array<string, array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
private static $installedByVendor = array();
/**
* Returns a list of all package names which are present, either by being installed, replaced or provided
*
* @return string[]
* @psalm-return list<string>
*/
public static function getInstalledPackages()
{
$packages = array();
foreach (self::getInstalled() as $installed) {
$packages[] = array_keys($installed['versions']);
}
if (1 === \count($packages)) {
return $packages[0];
}
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
}
/**
* Returns a list of all package names with a specific type e.g. 'library'
*
* @param string $type
* @return string[]
* @psalm-return list<string>
*/
public static function getInstalledPackagesByType($type)
{
$packagesByType = array();
foreach (self::getInstalled() as $installed) {
foreach ($installed['versions'] as $name => $package) {
if (isset($package['type']) && $package['type'] === $type) {
$packagesByType[] = $name;
}
}
}
return $packagesByType;
}
/**
* Checks whether the given package is installed
*
* This also returns true if the package name is provided or replaced by another package
*
* @param string $packageName
* @param bool $includeDevRequirements
* @return bool
*/
public static function isInstalled($packageName, $includeDevRequirements = true)
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
}
}
return false;
}
/**
* Checks whether the given package satisfies a version constraint
*
* e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
*
* Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
*
* @param VersionParser $parser Install composer/semver to have access to this class and functionality
* @param string $packageName
* @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
* @return bool
*/
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints((string) $constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint);
}
/**
* Returns a version constraint representing all the range(s) which are installed for a given package
*
* It is easier to use this via isInstalled() with the $constraint argument if you need to check
* whether a given version of a package is installed, and not just whether it exists
*
* @param string $packageName
* @return string Version constraint usable with composer/semver
*/
public static function getVersionRanges($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
$ranges = array();
if (isset($installed['versions'][$packageName]['pretty_version'])) {
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
}
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
}
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
}
if (array_key_exists('provided', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
}
return implode(' || ', $ranges);
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['version'])) {
return null;
}
return $installed['versions'][$packageName]['version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
*/
public static function getPrettyVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
return null;
}
return $installed['versions'][$packageName]['pretty_version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
*/
public static function getReference($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['reference'])) {
return null;
}
return $installed['versions'][$packageName]['reference'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @param string $packageName
* @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
*/
public static function getInstallPath($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
/**
* @return array
* @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}
*/
public static function getRootPackage()
{
$installed = self::getInstalled();
return $installed[0]['root'];
}
/**
* Returns the raw installed.php data for custom implementations
*
* @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
* @return array[]
* @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}
*/
public static function getRawData()
{
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
if (null === self::$installed) {
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
self::$installed = include __DIR__ . '/installed.php';
} else {
self::$installed = array();
}
}
return self::$installed;
}
/**
* Returns the raw data of all installed.php which are currently loaded for custom implementations
*
* @return array[]
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
public static function getAllRawData()
{
return self::getInstalled();
}
/**
* Lets you reload the static array from another file
*
* This is only useful for complex integrations in which a project needs to use
* this class but then also needs to execute another project's autoloader in process,
* and wants to ensure both projects have access to their version of installed.php.
*
* A typical case would be PHPUnit, where it would need to make sure it reads all
* the data it needs from this class, then call reload() with
* `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
* the project in which it runs can then also use this class safely, without
* interference between PHPUnit's dependencies and the project's dependencies.
*
* @param array[] $data A vendor/composer/installed.php data set
* @return void
*
* @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $data
*/
public static function reload($data)
{
self::$installed = $data;
self::$installedByVendor = array();
}
/**
* @return array[]
* @psalm-return list<array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}>
*/
private static function getInstalled()
{
if (null === self::$canGetVendors) {
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
}
$installed = array();
if (self::$canGetVendors) {
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require $vendorDir.'/composer/installed.php';
$installed[] = self::$installedByVendor[$vendorDir] = $required;
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
self::$installed = $installed[count($installed) - 1];
}
}
}
}
if (null === self::$installed) {
// only require the installed.php file if this file is loaded from its dumped location,
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
if (substr(__DIR__, -8, 1) !== 'C') {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require __DIR__ . '/installed.php';
self::$installed = $required;
} else {
self::$installed = array();
}
}
if (self::$installed !== array()) {
$installed[] = self::$installed;
}
return $installed;
}
}

21
vendor/composer/LICENSE vendored Normal file
View file

@ -0,0 +1,21 @@
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

10
vendor/composer/autoload_classmap.php vendored Normal file
View file

@ -0,0 +1,10 @@
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
);

View file

@ -0,0 +1,9 @@
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
);

11
vendor/composer/autoload_psr4.php vendored Normal file
View file

@ -0,0 +1,11 @@
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'Yosymfony\\Toml\\' => array($vendorDir . '/yosymfony/toml/src'),
'Yosymfony\\ParserUtils\\' => array($vendorDir . '/yosymfony/parser-utils/src'),
);

38
vendor/composer/autoload_real.php vendored Normal file
View file

@ -0,0 +1,38 @@
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit6bb46fd04ba59751dbe13daf4711c4e1
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
/**
* @return \Composer\Autoload\ClassLoader
*/
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit6bb46fd04ba59751dbe13daf4711c4e1', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit6bb46fd04ba59751dbe13daf4711c4e1', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit6bb46fd04ba59751dbe13daf4711c4e1::getInitializer($loader));
$loader->register(true);
return $loader;
}
}

41
vendor/composer/autoload_static.php vendored Normal file
View file

@ -0,0 +1,41 @@
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit6bb46fd04ba59751dbe13daf4711c4e1
{
public static $prefixLengthsPsr4 = array (
'Y' =>
array (
'Yosymfony\\Toml\\' => 15,
'Yosymfony\\ParserUtils\\' => 22,
),
);
public static $prefixDirsPsr4 = array (
'Yosymfony\\Toml\\' =>
array (
0 => __DIR__ . '/..' . '/yosymfony/toml/src',
),
'Yosymfony\\ParserUtils\\' =>
array (
0 => __DIR__ . '/..' . '/yosymfony/parser-utils/src',
),
);
public static $classMap = array (
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit6bb46fd04ba59751dbe13daf4711c4e1::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit6bb46fd04ba59751dbe13daf4711c4e1::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit6bb46fd04ba59751dbe13daf4711c4e1::$classMap;
}, null, ClassLoader::class);
}
}

122
vendor/composer/installed.json vendored Normal file
View file

@ -0,0 +1,122 @@
{
"packages": [
{
"name": "yosymfony/parser-utils",
"version": "v2.0.0",
"version_normalized": "2.0.0.0",
"source": {
"type": "git",
"url": "https://github.com/yosymfony/parser-utils.git",
"reference": "00bec9a12722b21f2baf7f9db35f127e90c162c9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yosymfony/parser-utils/zipball/00bec9a12722b21f2baf7f9db35f127e90c162c9",
"reference": "00bec9a12722b21f2baf7f9db35f127e90c162c9",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"require-dev": {
"phpunit/phpunit": "^6"
},
"time": "2018-06-29T15:31:11+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Yosymfony\\ParserUtils\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Victor Puertas",
"email": "vpgugr@gmail.com",
"homepage": "http://yosymfony.com"
}
],
"description": "Parser utilities",
"homepage": "http://github.com/yosymfony/toml",
"keywords": [
"lexer",
"parser"
],
"support": {
"issues": "https://github.com/yosymfony/parser-utils/issues",
"source": "https://github.com/yosymfony/parser-utils/tree/master"
},
"install-path": "../yosymfony/parser-utils"
},
{
"name": "yosymfony/toml",
"version": "v1.0.4",
"version_normalized": "1.0.4.0",
"source": {
"type": "git",
"url": "https://github.com/yosymfony/toml.git",
"reference": "bdab92ad920d0e36810a3a3e4a998d23f3498f8e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yosymfony/toml/zipball/bdab92ad920d0e36810a3a3e4a998d23f3498f8e",
"reference": "bdab92ad920d0e36810a3a3e4a998d23f3498f8e",
"shasum": ""
},
"require": {
"php": ">=7.1",
"yosymfony/parser-utils": "^2.0"
},
"require-dev": {
"phpunit/phpunit": "^7.1"
},
"time": "2018-08-08T15:08:14+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Yosymfony\\Toml\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Victor Puertas",
"email": "vpgugr@gmail.com",
"homepage": "http://yosymfony.com"
}
],
"description": "A PHP parser for TOML compatible with specification 0.4.0",
"homepage": "http://github.com/yosymfony/toml",
"keywords": [
"mojombo",
"parser",
"toml"
],
"support": {
"issues": "https://github.com/yosymfony/toml/issues",
"source": "https://github.com/yosymfony/toml/tree/master"
},
"install-path": "../yosymfony/toml"
}
],
"dev": true,
"dev-package-names": []
}

41
vendor/composer/installed.php vendored Normal file
View file

@ -0,0 +1,41 @@
<?php return array(
'root' => array(
'name' => 'utahsdjs/utahsdjs2025',
'pretty_version' => '0.0.1',
'version' => '0.0.1.0',
'reference' => null,
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev' => true,
),
'versions' => array(
'utahsdjs/utahsdjs2025' => array(
'pretty_version' => '0.0.1',
'version' => '0.0.1.0',
'reference' => null,
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'yosymfony/parser-utils' => array(
'pretty_version' => 'v2.0.0',
'version' => '2.0.0.0',
'reference' => '00bec9a12722b21f2baf7f9db35f127e90c162c9',
'type' => 'library',
'install_path' => __DIR__ . '/../yosymfony/parser-utils',
'aliases' => array(),
'dev_requirement' => false,
),
'yosymfony/toml' => array(
'pretty_version' => 'v1.0.4',
'version' => '1.0.4.0',
'reference' => 'bdab92ad920d0e36810a3a3e4a998d23f3498f8e',
'type' => 'library',
'install_path' => __DIR__ . '/../yosymfony/toml',
'aliases' => array(),
'dev_requirement' => false,
),
),
);

26
vendor/composer/platform_check.php vendored Normal file
View file

@ -0,0 +1,26 @@
<?php
// platform_check.php @generated by Composer
$issues = array();
if (!(PHP_VERSION_ID >= 80200)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 8.2.0". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
} elseif (!headers_sent()) {
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues),
E_USER_ERROR
);
}

View file

@ -0,0 +1,4 @@
vendor/
phpunit.xml
.php_cs.cache
composer.lock

View file

@ -0,0 +1,15 @@
language: php
php:
- 7.1
- 7.2
- nightly
before_script:
- composer self-update
- composer install --no-interaction --no-dev
matrix:
allow_failures:
- php: nightly
fast_finish: true

View file

@ -0,0 +1,12 @@
CHANGELOG
=========
2.0.0 (2018/06/29)
------------------
* [New] The class `TokenStream` implements `TokenStreamInterface`.
* [New] Added PHPUnit as dev-requirement
* [Fixed] Fixed a typo with the method `parseImplementation` from the class `AbstractParser`.
The previous name was `parseImplentation`.
1.0.0 (2017/11/18)
------------------
* Initial version.

19
vendor/yosymfony/parser-utils/LICENSE vendored Normal file
View file

@ -0,0 +1,19 @@
Copyright (c) 2017-2018 Víctor Puertas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

145
vendor/yosymfony/parser-utils/README.md vendored Normal file
View file

@ -0,0 +1,145 @@
A library for writing [recursive descent parsers](https://en.wikipedia.org/wiki/Recursive_descent_parser)
in PHP.
[![Build Status](https://travis-ci.org/yosymfony/parser-utils.svg?branch=master)](https://travis-ci.org/yosymfony/parser-utils)
## requires
* PHP >= 7.1
## Installation
The preferred installation method is [composer](https://getcomposer.org):
```bash
composer require yosymfony/parser-utils
```
## An example
First, you need to create a lexer. This one will recognize tokens
```php
use Yosymfony\ParserUtils\BasicLexer;
$lexer = new BasicLexer([
'/^([0-9]+)/x' => 'T_NUMBER',
'/^(\+)/x' => 'T_PLUS',
'/^(-)/x' => 'T_MINUS',
'/^\s+/' => 'T_SPACE', // We do not surround it with parentheses because
// this is not meaningful for us in this case
]);
```
Second, you need a parser for consuming the tokens provided by the lexer.
The `AbstractParser` class contains an abstract method called `parseImplementation`
that receives a `TokenStream` as an argument.
```php
use Yosymfony\ParserUtils\AbstractParser;
class Parser extends AbstractParser
{
protected function parseImplementation(TokenStream $stream)
{
$result = $stream->matchNext('T_NUMBER');
while ($stream->isNextAny(['T_PLUS', 'T_MINUS'])) {
switch ($stream->moveNext()->getName()) {
case 'T_PLUS':
$result += $stream->matchNext('T_NUMBER');
break;
case 'T_MINUS':
$result -= $stream->matchNext('T_NUMBER');
break;
default:
throw new SyntaxErrorException("Something went wrong");
break;
}
}
return $result;
}
}
```
Now, you can see the results:
```php
$parser = new Parser($lexer);
$parser->parse('1 + 1'); // 2
```
### The BasicLexer class
The lexer has the responsibility of recognizing tokens. This one works line by
line. If you want to generate an special `T_NEWLINE` token for each line
of the input, call `$lexer->generateNewlineTokens()` before tokenizing. You can set the
name of this special token using the method `setNewlineTokenName`.
```php
$lexer = new BasicLexer([...]);
$lexer->generateNewlineTokens()
->setNewlineTokenName('T_NL');
$lexer->tokenize('...');
```
Additionally, there is another special token `T_EOS` that determines the end of the input
string. To enable this feature call `$lexer->generateEosToken()` before tokenizing.
You can set the name of this special token using the method `setEosTokenName`.
```php
$lexer = new BasicLexer([...]);
$lexer->generateEosToken()
->setEosTokenName('T_MY_EOS');
$lexer->tokenize('...');
```
### The TokenStream class
This class let you treat with the list of tokens returned by the lexer.
* **moveNext**: Moves the pointer one token forward. Returns a `Token` object or
`null` if there are not more tokens. e.g: `$ts->moveNext()`.
* **matchNext**: Matches the next token and returns its value. This method moves
the pointer one token forward. It will throw an `SyntaxErrorException` exception
if the next token does not match. e.g: `$number = $ts->matchNext('T_NUMBER')`.
* **isNext**: Checks if the next token matches with the token name passed as argument.
e.g: `$ts->isNext('T_PLUS') // true or false`.
* **skipWhile**: Skips tokens while they match with the token name passed
as argument. This method moves the pointer "n" tokens forward until the
last one that match with the token name. e.g: `$ts->skipWhile('T_PLUS')`
* **skipWhileAny**: Skips tokens while they match with one of the token
names passed as argument. This method moves the pointer "n" tokens
forward until the last one that match with one of the token names
e.g: `$ts->skipWhileAny(['T_PLUS', 'T_MINUS'])`
* **isNextSequence**: Checks if the following tokens in the stream match with
the sequence of tokens. e.g: `$ts->isNextSequence(['T_NUMBER', 'T_PLUS', 'T_NUMBER']) // true or false`.
* **isNextAny**: Checks if one of the tokens passed as argument is the next token.
e.g: `$fs->isNextAny(['T_PLUS', 'T_SUB']) // true or false`
* **hasPendingTokens**: Has pending tokens? e.g: `$fs->hasPendingTokens() // true or false`.
* **reset**: Resets the stream to the beginning.
### Tokens
Tokens are instances of `Token` class, a class than contains the following methods:
* **getName**: returns the name of the toke. e.g: `T_SUM`.
* **getValue**: returns the value of the token.
* **getLine**: returns the line in where the token is found.
## Unit tests
You can run the unit tests with the following command:
```bash
$ cd parser-utils
$ composer test
```
## License
This library is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

View file

@ -0,0 +1,32 @@
{
"name": "yosymfony/parser-utils",
"description": "Parser utilities",
"type": "library",
"keywords": ["parser", "lexer"],
"homepage": "http://github.com/yosymfony/toml",
"license": "MIT",
"authors": [
{
"name": "Victor Puertas",
"email": "vpgugr@gmail.com",
"homepage": "http://yosymfony.com"
}
],
"require": {
"php": ">=7.1"
},
"autoload": {
"psr-4": { "Yosymfony\\ParserUtils\\": "src/" }
},
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"require-dev": {
"phpunit/phpunit": "^6"
},
"scripts": {
"test": "vendor/bin/phpunit"
}
}

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<testsuites>
<testsuite name="Spress Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>./</directory>
<exclude>
<directory>./vendor</directory>
<directory>./tests</directory>
</exclude>
</whitelist>
</filter>
</phpunit>

View file

@ -0,0 +1,53 @@
<?php
/*
* This file is part of the Yosymfony\ParserUtils package.
*
* (c) YoSymfony <http://github.com/yosymfony>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Yosymfony\ParserUtils;
abstract class AbstractParser
{
protected $lexer;
/**
* Constructor
*
* @param LexerInterface $lexer The lexer
*/
public function __construct(LexerInterface $lexer)
{
$this->lexer = $lexer;
}
/**
* Parse a given input
*
* @param string $input
*
* @return mixed
*/
public function parse(string $input)
{
$ts = $this->lexer->tokenize($input);
$parseResult = $this->parseImplementation($ts);
if ($ts->hasPendingTokens()) {
throw new SyntaxErrorException('There are tokens not processed.');
}
return $parseResult;
}
/**
* Do the real parsing
*
* @param TokenStream $stream The token stream returned by the lexer
*
* @return mixed
*/
abstract protected function parseImplementation(TokenStream $stream);
}

View file

@ -0,0 +1,175 @@
<?php
/*
* This file is part of the Yosymfony\ParserUtils package.
*
* (c) YoSymfony <http://github.com/yosymfony>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Yosymfony\ParserUtils;
class BasicLexer implements LexerInterface
{
protected $newlineTokenName = 'T_NEWLINE';
protected $eosTokenName = 'T_EOS';
protected $activateNewlineToken = false;
protected $activateEOSToken = false;
protected $terminals = [];
/**
* Constructor
*
* @param array $terminal List of terminals
* e.g:
* [
* "/^([)/" => "T_BRAKET_BEGIN"
* ]
*/
public function __construct(array $terminals)
{
$this->terminals = $terminals;
}
/**
* Generates an special "T_NEWLINE" for each line of the input
*
* @return BasicLexer The BasicLexer itself
*/
public function generateNewlineTokens() : BasicLexer
{
$this->activateNewlineToken = true;
return $this;
}
/**
* Generates an special "T_EOS" at the end of the input string
*
* @return BasicLexer The BasicLexer itself
*/
public function generateEosToken() : BasicLexer
{
$this->activateEOSToken = true;
return $this;
}
/**
* Sets the name of the newline token
*
* @param string $name The name of the token
*
* @return BasicLexer The BasicLexer itself
*
* @throws InvalidArgumentException If the name is empty
*/
public function setNewlineTokenName(string $name) : BasicLexer
{
if (strlen($name) == 0) {
throw new \InvalidArgumentException('The name of the newline token must be not empty.');
}
$this->newlineTokenName = $name;
return $this;
}
/**
* Sets the name of the end-of-string token
*
* @param string $name The name of the token
*
* @return BasicLexer The BasicLexer itself
*
* @throws InvalidArgumentException If the name is empty
*/
public function setEosTokenName(string $name) : BasicLexer
{
if (strlen($name) == 0) {
throw new \InvalidArgumentException('The name of the EOS token must be not empty.');
}
$this->eosTokenName = $name;
return $this;
}
/**
* {@inheritdoc}
*/
public function tokenize(string $input) : TokenStream
{
$counter = 0;
$tokens = [];
$lines = explode("\n", $input);
$totalLines = count($lines);
foreach ($lines as $number => $line) {
$offset = 0;
$lineNumber = $number + 1;
while ($offset < strlen($line)) {
list($name, $matches) = $this->match($line, $lineNumber, $offset);
if (isset($matches[1])) {
$token = new Token($matches[1], $name, $lineNumber);
$this->processToken($token, $matches);
$tokens[] = $token;
}
$offset += strlen($matches[0]);
}
if ($this->activateNewlineToken && ++$counter < $totalLines) {
$tokens[] = new Token("\n", $this->newlineTokenName, $lineNumber);
}
}
if ($this->activateEOSToken) {
$tokens[] = new Token('', $this->eosTokenName, $lineNumber);
}
return new TokenStream($tokens);
}
/**
* Returns the first match with the list of terminals
*
* @return array An array with the following keys:
* [0] (string): name of the token
* [1] (array): matches of the regular expression
*
* @throws SyntaxErrorException If the line does not contain any token
*/
protected function match(string $line, int $lineNumber, int $offset) : array
{
$restLine = substr($line, $offset);
foreach ($this->terminals as $pattern => $name) {
if (preg_match($pattern, $restLine, $matches)) {
return [
$name,
$matches,
];
}
}
throw new SyntaxErrorException(sprintf('Lexer error: unable to parse "%s" at line %s.', $line, $lineNumber));
}
/**
* Applies additional actions over a token.
*
* Implement this method if you need to do changes after a token was found.
* This method is invoked for each token found
*
* @param Token $token The token
* @param string[] $matches Set of matches from the regular expression
*
* @return void
*/
protected function processToken(Token $token, array $matches) : void
{
}
}

View file

@ -0,0 +1,25 @@
<?php
/*
* This file is part of the Yosymfony\ParserUtils package.
*
* (c) YoSymfony <http://github.com/yosymfony>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Yosymfony\ParserUtils;
/**
* Interface for a lexer
*/
interface LexerInterface
{
/**
* Returns the tokens found
*
* @param string $input The input to be tokenized
*
* @return TokenStream The stream of tokens
*/
public function tokenize(string $input) : TokenStream;
}

View file

@ -0,0 +1,50 @@
<?php
/*
* This file is part of the Yosymfony\ParserUtils package.
*
* (c) YoSymfony <http://github.com/yosymfony>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Yosymfony\ParserUtils;
/**
* Exception thrown when an error occurs during parsing or tokenizing
*/
class SyntaxErrorException extends \RuntimeException
{
protected $token;
/**
* Constructor
*
* @param string $message The error messsage
* @param Token|null $token The token
* @param \Exception|null $previous The previous exceptio
*/
public function __construct(string $message, Token $token = null, \Exception $previous = null)
{
parent::__construct($message, 0, $previous);
}
/**
* Sets the token associated to the exception
*
* @param Token $token The token
*/
public function setToken(Token $token) : void
{
$this->token = $token;
}
/**
* Returns the token associated to the exception
*
* @return Token|null
*/
public function getToken() : ?Token
{
return $this->token;
}
}

View file

@ -0,0 +1,71 @@
<?php
/*
* This file is part of the Yosymfony\ParserUtils package.
*
* (c) YoSymfony <http://github.com/yosymfony>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Yosymfony\ParserUtils;
class Token
{
protected $value;
protected $name;
protected $line;
/**
* Constructor.
*
* @param string $value The value of the token
* @param string $name The name of the token. e.g: T_BRAKET_BEGIN
* @param int $line Line of the code in where the token is found
*/
public function __construct(string $value, string $name, int $line)
{
$this->value = $value;
$this->name = $name;
$this->line = $line;
}
/**
* Returns the value (the match term)
*
* @return string
*/
public function getValue() : string
{
return $this->value;
}
/**
* Returns the name of the token
*
* @return string
*/
public function getName() : string
{
return $this->name;
}
/**
* Returns the line of the code in where the token is found
*
* @return int
*/
public function getLine() : int
{
return $this->line;
}
public function __toString() : string
{
return sprintf(
"[\n name: %s\n value:%s\n line: %s\n]",
$this->name,
$this->value,
$this->line
);
}
}

View file

@ -0,0 +1,163 @@
<?php
/*
* This file is part of the Yosymfony\ParserUtils package.
*
* (c) YoSymfony <http://github.com/yosymfony>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Yosymfony\ParserUtils;
class TokenStream implements TokenStreamInterface
{
protected $tokens;
protected $index = -1;
/**
* Constructor
*
* @param Token[] List of tokens
*/
public function __construct(array $tokens)
{
$this->tokens = $tokens;
}
/**
* {@inheritdoc}
*/
public function moveNext() : ?Token
{
return $this->tokens[++$this->index] ?? null;
}
/**
* {@inheritdoc}
*/
public function matchNext(string $tokenName) : string
{
$token = $this->moveNext();
--$this->index;
if ($token->getName() == $tokenName) {
return $this->moveNext()->getValue();
}
throw new SyntaxErrorException(sprintf(
'Syntax error: expected token with name "%s" instead of "%s" at line %s.',
$tokenName,
$token->getName(),
$token->getLine()
));
}
/**
* {@inheritdoc}
*/
public function skipWhile(string $tokenName) : void
{
$this->skipWhileAny([$tokenName]);
}
/**
* {@inheritdoc}
*/
public function skipWhileAny(array $tokenNames) : void
{
while ($this->isNextAny($tokenNames)) {
$this->moveNext();
}
}
/**
* {@inheritdoc}
*/
public function isNext(string $tokenName) : bool
{
$token = $this->moveNext();
--$this->index;
if ($token === null) {
return false;
}
return $token->getName() == $tokenName;
}
/**
* {@inheritdoc}
*/
public function isNextSequence(array $tokenNames) : bool
{
$result = true;
$currentIndex = $this->index;
foreach ($tokenNames as $tokenName) {
$token = $this->moveNext();
if ($token === null || $token->getName() != $tokenName) {
$result = false;
break;
}
}
$this->index = $currentIndex;
return $result;
}
/**
* {@inheritdoc}
*/
public function isNextAny(array $tokenNames) : bool
{
$token = $this->moveNext();
--$this->index;
if ($token === null) {
return false;
}
foreach ($tokenNames as $tokenName) {
if ($tokenName === $token->getName()) {
return true;
}
}
return false;
}
/**
* Returns all tokens
*
* @return token[] List of tokens
*/
public function getAll() : array
{
return $this->tokens;
}
/**
* {@inheritdoc}
*/
public function hasPendingTokens() :bool
{
$tokenCount = count($this->tokens);
if ($tokenCount == 0) {
return false;
}
return $this->index < ($tokenCount - 1);
}
/**
* {@inheritdoc}
*/
public function reset() : void
{
$this->index = -1;
}
}

View file

@ -0,0 +1,89 @@
<?php
/*
* This file is part of the Yosymfony\ParserUtils package.
*
* (c) YoSymfony <http://github.com/yosymfony>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Yosymfony\ParserUtils;
interface TokenStreamInterface
{
/**
* Moves the pointer one token forward
*
* @return Token|null The token or null if there are not more tokens
*/
public function moveNext() : ?Token;
/**
* Matches the next token. This method moves the pointer one token forward
* if an error does not occur
*
* @param string $tokenName The name of the token
*
* @return string The value of the token
*
* @throws SyntaxErrorException If the next token does not match
*/
public function matchNext(string $tokenName) : string;
/**
* Skips tokens while they match with the token name passed as argument.
* This method moves the pointer "n" tokens forward until the last one
* that match with the token name
*
* @param string $tokenName The name of the token
*/
public function skipWhile(string $tokenName) : void;
/**
* Skips tokens while they match with one of the token names passed as
* argument. This method moves the pointer "n" tokens forward until the
* last one that match with one of the token names
*
* @param string[] $tokenNames List of token names
*/
public function skipWhileAny(array $tokenNames) : void;
/**
* Checks if the next token matches with the token name passed as argument
*
* @param string $tokenName The name of the token
*
* @return bool
*/
public function isNext(string $tokenName) : bool;
/**
* Checks if the following tokens in the stream match with the sequence of tokens
*
* @param string[] $tokenNames Sequence of token names
*
* @return bool
*/
public function isNextSequence(array $tokenNames) : bool;
/**
* Checks if one of the tokens passed as argument is the next token
*
* @param string[] $tokenNames List of token names. e.g: 'T_PLUS', 'T_SUB'
*
* @return bool
*/
public function isNextAny(array $tokenNames) : bool;
/**
* Has pending tokens?
*
* @return bool
*/
public function hasPendingTokens() :bool;
/**
* Resets the stream to the beginning
*/
public function reset() : void;
}

View file

@ -0,0 +1,62 @@
<?php
/*
* This file is part of the Yosymfony\ParserUtils package.
*
* (c) YoSymfony <http://github.com/yosymfony>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Yosymfony\ParserUtils\Test;
use PHPUnit\Framework\TestCase;
use Yosymfony\ParserUtils\AbstractParser;
use Yosymfony\ParserUtils\BasicLexer;
use Yosymfony\ParserUtils\SyntaxErrorException;
use Yosymfony\ParserUtils\TokenStream;
class AbstractParserTest extends TestCase
{
private $parser;
public function setup()
{
$lexer = new BasicLexer([
'/^([0-9]+)/x' => 'T_NUMBER',
'/^(\+)/x' => 'T_PLUS',
'/^(-)/x' => 'T_MINUS',
'/^\s+/' => 'T_SPACE',
]);
$this->parser = $this->getMockBuilder(AbstractParser::class)
->setConstructorArgs([$lexer])
->getMockForAbstractClass();
$this->parser->expects($this->any())
->method('parseImplementation')
->will($this->returnCallback(function (TokenStream $stream) {
$result = $stream->matchNext('T_NUMBER');
while ($stream->isNextAny(['T_PLUS', 'T_MINUS'])) {
switch ($stream->moveNext()->getName()) {
case 'T_PLUS':
$result += $stream->matchNext('T_NUMBER');
break;
case 'T_MINUS':
$result -= $stream->matchNext('T_NUMBER');
break;
default:
throw new SyntaxErrorException("Something went wrong");
break;
}
}
return $result;
}));
}
public function testParseMustReturnTheResultOfTheSum()
{
$this->assertEquals(2, $this->parser->parse('1 + 1'));
}
}

View file

@ -0,0 +1,127 @@
<?php
/*
* This file is part of the Yosymfony\ParserUtils package.
*
* (c) YoSymfony <http://github.com/yosymfony>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Yosymfony\ParserUtils\Test;
use PHPUnit\Framework\TestCase;
use Yosymfony\ParserUtils\BasicLexer;
use Yosymfony\ParserUtils\Token;
class BasicLexerTest extends TestCase
{
public function testTokenizeMustReturnsTheListOfTokens()
{
$lexer = new BasicLexer([
'/^([0-9]+)/x' => 'T_NUMBER',
'/^(\+)/x' => 'T_PLUS',
'/^(-)/x' => 'T_MINUS',
]);
$tokens = $lexer->tokenize('1+2')->getAll();
$this->assertEquals([
new Token('1', 'T_NUMBER', 1),
new Token('+', 'T_PLUS', 1),
new Token('2', 'T_NUMBER', 1),
], $tokens);
}
public function testTokenizeMustReturnsTheListOfTokensWithoutThoseDoNotHaveParenthesizedSupatternInTerminalSymbols()
{
$lexer = new BasicLexer([
'/^([0-9]+)/' => 'T_NUMBER',
'/^(\+)/' => 'T_PLUS',
'/^(-)/' => 'T_MINUS',
'/^\s+/' => 'T_SPACE',
]);
$tokens = $lexer->tokenize('1 + 2')->getAll();
$this->assertEquals([
new Token('1', 'T_NUMBER', 1),
new Token('+', 'T_PLUS', 1),
new Token('2', 'T_NUMBER', 1),
], $tokens, 'T_SPACE is not surround with (). e.g: ^(\s+)');
}
public function testTokenizeWithEmptyStringMustReturnsZeroTokens()
{
$lexer = new BasicLexer([
'/^([0-9]+)/' => 'T_NUMBER',
'/^(\+)/' => 'T_PLUS',
'/^(-)/' => 'T_MINUS',
]);
$tokens = $lexer->tokenize('')->getAll();
$this->assertCount(0, $tokens);
}
public function testTokenizeMustReturnsNewLineTokensWhenGenerateNewlineTokensIsEnabled()
{
$lexer = new BasicLexer([
'/^([0-9]+)/' => 'T_NUMBER',
]);
$lexer->generateNewlineTokens();
$ts = $lexer->tokenize("0\n");
$ts->moveNext();
$token = $ts->moveNext();
$this->assertEquals('T_NEWLINE', $token->getName());
$this->assertFalse($ts->hasPendingTokens());
}
public function testTokenizeMustReturnsCustomNewLineTokensWhenThereIsCustomNameAndGenerateNewlineTokensIsEnabled()
{
$lexer = new BasicLexer([
'/^([0-9]+)/' => 'T_NUMBER',
]);
$lexer->setNewlineTokenName('T_MY_NEWLINE')
->generateNewlineTokens();
$ts = $lexer->tokenize("0\n");
$ts->moveNext();
$token = $ts->moveNext();
$this->assertEquals('T_MY_NEWLINE', $token->getName());
$this->assertFalse($ts->hasPendingTokens());
}
public function testTokenizeMustReturnsEosTokenWhenGenerateEosTokenIsEnabled()
{
$lexer = new BasicLexer([
'/^([0-9]+)/' => 'T_NUMBER',
]);
$lexer->generateEosToken();
$ts = $lexer->tokenize("0");
$ts->moveNext();
$token = $ts->moveNext();
$this->assertEquals('T_EOS', $token->getName());
$this->assertFalse($ts->hasPendingTokens());
}
public function testTokenizeMustReturnsCustomNameEosTokenWhenThereIsCustomNameAndGenerateEosTokenIsEnabled()
{
$lexer = new BasicLexer([
'/^([0-9]+)/' => 'T_NUMBER',
]);
$lexer->setEosTokenName('T_MY_EOS')
->generateEosToken();
$ts = $lexer->tokenize("0");
$ts->moveNext();
$token = $ts->moveNext();
$this->assertEquals('T_MY_EOS', $token->getName());
$this->assertFalse($ts->hasPendingTokens());
}
}

View file

@ -0,0 +1,261 @@
<?php
/*
* This file is part of the Yosymfony\ParserUtils package.
*
* (c) YoSymfony <http://github.com/yosymfony>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Yosymfony\ParserUtils\Test;
use PHPUnit\Framework\TestCase;
use Yosymfony\ParserUtils\SyntaxErrorException;
use Yosymfony\ParserUtils\Token;
use Yosymfony\ParserUtils\TokenStream;
class TokenStreamTest extends TestCase
{
public function testGetAllMustReturnsAllTokens()
{
$ts = new TokenStream([
new Token('+', 'T_PLUS', 1),
new Token('1', 'T_NUMBER', 1),
]);
$this->assertCount(2, $ts->getAll());
}
public function testMoveNextMustReturnsTheFirstTokenTheFirstTime()
{
$token = new Token('+', 'T_PLUS', 1);
$ts = new TokenStream([
$token,
]);
$this->assertEquals($token, $ts->moveNext());
}
public function testMoveNextMustReturnsTheSecondTokenTheSecondTime()
{
$token = new Token('1', 'T_NUMBER', 1);
$ts = new TokenStream([
new Token('+', 'T_PLUS', 1),
$token,
]);
$ts->moveNext();
$this->assertEquals($token, $ts->moveNext());
}
public function testMoveNextMustReturnsWhenThereAreNotMoreTokens()
{
$ts = new TokenStream([
new Token('+', 'T_PLUS', 1),
]);
$ts->moveNext();
$this->assertNull($ts->moveNext());
}
public function testMoveNextMustReturnsTheFirstTokenAfterAReset()
{
$token = new Token('1', 'T_NUMBER', 1);
$ts = new TokenStream([
$token,
new Token('+', 'T_PLUS', 1),
]);
$ts->moveNext();
$ts->moveNext();
$ts->reset();
$this->assertEquals($token, $ts->moveNext());
}
public function testMatchNextMustReturnMatchValueWhenTheNameOfNextTokenMatchWithTheNamePassed()
{
$token = new Token('1', 'T_NUMBER', 1);
$ts = new TokenStream([
$token,
]);
$this->assertEquals('1', $ts->matchNext('T_NUMBER'));
}
public function testMatchNextMustThrowExceptionWhenTheNameOfNextTokenDoesNotMatchWithTheNamePassed()
{
$this->expectException(SyntaxErrorException::class);
$this->expectExceptionMessage('Syntax error: expected token with name "T_PLUS" instead of "T_NUMBER" at line 1.');
$token = new Token('1', 'T_NUMBER', 1);
$ts = new TokenStream([
$token,
]);
$ts->matchNext('T_PLUS');
}
public function testIsNextMustReturnsTrueWhenTheNameOfNextTokenMatchWithTheNamePassed()
{
$ts = new TokenStream([
new Token('+', 'T_PLUS', 1),
new Token('1', 'T_NUMBER', 1),
]);
$ts->moveNext();
$this->assertTrue($ts->isNext('T_NUMBER'));
}
public function testIsNextMustReturnsTrueWhenTheNameOfNextTokenMatchWithTheNamePassedAtTheBeginning()
{
$ts = new TokenStream([
new Token('+', 'T_PLUS', 1),
new Token('1', 'T_NUMBER', 1),
]);
$this->assertTrue($ts->isNext('T_PLUS'));
}
public function testIsNextMustReturnsFalseWhenTheNameOfNextTokenDoesNotMatchWithTheNamePassed()
{
$ts = new TokenStream([
new Token('+', 'T_PLUS', 1),
new Token('1', 'T_NUMBER', 1),
]);
$this->assertFalse($ts->isNext('T_NUMBER'));
}
public function testIsNextMustNotAlterTheTokenStream()
{
$token = new Token('+', 'T_PLUS', 1);
$ts = new TokenStream([
$token,
new Token('1', 'T_NUMBER', 1),
]);
$ts->isNext('T_PLUS');
$this->assertEquals($token, $ts->moveNext(), 'The next token must be T_PLUS');
}
public function testIsNextSequenceMustReturnTrueWhenTheFollowingTokensInTheStreamMatchWithSequence()
{
$ts = new TokenStream([
new Token('+', 'T_PLUS', 1),
new Token('1', 'T_NUMBER', 1),
]);
$this->assertTrue($ts->isNextSequence(['T_PLUS', 'T_NUMBER']));
}
public function testIsNextSequenceMustReturnFalseWhenTheFollowingTokensInTheStreamDoesNotMatchWithSequence()
{
$ts = new TokenStream([
new Token('+', 'T_PLUS', 1),
new Token('1', 'T_NUMBER', 1),
]);
$this->assertFalse($ts->isNextSequence(['T_NUMBER', 'T_PLUS']));
}
public function testIsNextSequenceMustNotAlterTheTokenStream()
{
$token = new Token('+', 'T_PLUS', 1);
$ts = new TokenStream([
$token,
new Token('1', 'T_NUMBER', 1),
]);
$ts->isNextSequence(['T_NUMBER', 'T_PLUS']);
$this->assertEquals($token, $ts->moveNext(), 'The next token must be T_PLUS');
}
public function testIsNextAnyMustReturnTrueWhenNameOfNextTokenMatchWithOneOfTheList()
{
$ts = new TokenStream([
new Token('+', 'T_PLUS', 1),
new Token('1', 'T_NUMBER', 1),
]);
$this->assertTrue($ts->isNextAny(['T_MINUS', 'T_PLUS']));
}
public function testIsNextAnyMustReturnFalseWhenNameOfNextTokenDoesNotMatchWithOneOfTheList()
{
$ts = new TokenStream([
new Token('+', 'T_PLUS', 1),
new Token('1', 'T_NUMBER', 1),
]);
$this->assertFalse($ts->isNextAny(['T_DIV', 'T_MINUS']));
}
public function testIsNextAnyMustNotAlterTheTokenStream()
{
$token = new Token('+', 'T_PLUS', 1);
$ts = new TokenStream([
$token,
new Token('1', 'T_NUMBER', 1),
]);
$ts->isNextAny(['T_MINUS', 'T_PLUS']);
$this->assertEquals($token, $ts->moveNext(), 'The next token must be T_PLUS');
}
public function testHasPendingTokensMustReturnTrueWhenThereArePendingTokens()
{
$ts = new TokenStream([
new Token('+', 'T_PLUS', 1),
]);
$this->assertTrue($ts->hasPendingTokens());
}
public function testHasPendingTokensMustReturnFalseWhenTokenStreamIsEmpty()
{
$ts = new TokenStream([]);
$this->assertFalse($ts->hasPendingTokens());
}
public function testHasPendingTokensMustReturnFalseAfterPointingToTheLastToken()
{
$ts = new TokenStream([
new Token('+', 'T_PLUS', 1),
]);
$ts->moveNext();
$this->assertFalse($ts->hasPendingTokens());
}
public function testSkipWhileMustMovesPointerNTokensForwardUtilLastOneInstanceOfToken()
{
$ts = new TokenStream([
new Token('+', 'T_PLUS', 1),
new Token('+', 'T_PLUS', 1),
new Token('1', 'T_NUMBER', 1),
]);
$ts->skipWhile('T_PLUS');
$this->assertTrue($ts->isNext('T_NUMBER'));
}
public function testSkipWhileAnyMustMovesPointerNTokensForwardUtilLastOneInstanceOfOneOfAnyTokens()
{
$ts = new TokenStream([
new Token('+', 'T_PLUS', 1),
new Token('+', 'T_PLUS', 1),
new Token('+', 'T_MINUS', 1),
new Token('1', 'T_NUMBER', 1),
]);
$ts->skipWhileAny(['T_PLUS', 'T_MINUS']);
$this->assertTrue($ts->isNext('T_NUMBER'));
}
}

View file

@ -0,0 +1,26 @@
<?php
/*
* This file is part of the Yosymfony\ParserUtils package.
*
* (c) YoSymfony <http://github.com/yosymfony>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Yosymfony\ParserUtils\Test;
use PHPUnit\Framework\TestCase;
use Yosymfony\ParserUtils\Token;
class TokenTest extends TestCase
{
public function testConstructorMustSetMatchAndNameAndLine()
{
$token = new Token('+', 'T_PLUS', 1);
$this->assertEquals('+', $token->getValue());
$this->assertEquals('T_PLUS', $token->getName());
$this->assertEquals(1, $token->getLine());
}
}

3
vendor/yosymfony/toml/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
vendor/
phpunit.xml
.php_cs.cache

15
vendor/yosymfony/toml/.travis.yml vendored Normal file
View file

@ -0,0 +1,15 @@
language: php
php:
- 7.1
- 7.2
- nightly
before_script:
- composer self-update
- composer install --no-interaction --no-dev
matrix:
allow_failures:
- php: nightly
fast_finish: true

81
vendor/yosymfony/toml/CHANGELOG.md vendored Normal file
View file

@ -0,0 +1,81 @@
CHANGELOG
=========
1.0.4 (2018-08-08)
------------------
* Several corrections and refactorings in `TomBuilder` class. The problem described in the PR #25 "fixed a bug when used the function 'in_array'" has been solved.
* The test file `TomlBuilderTest` has been refactored for readability. Added some tests.
* The `README.md` file has been updated with the `TomlBuilder` class limitations.
1.0.3 (2018-07-31)
------------------
* `TomlBuilder` does not throw a `DumpException` anymore when the character "#" appears in a quoted key.
* The method `addArrayTables` from the class `TomlBuilder` has been declared as deprecated. Use the method `addArrayOfTable` instead.
* Fixed the bug #24: "Wrong array of tables implementation".
* A new class `TomlArray` has been added to handle the Toml array generation.
1.0.2 (2018-06-29)
------------------
* Fixed the bug #23: "Unable to parse ArrayTables that contain Tables".
* A new class `KeyStore` has been added to deal with the logic of the keys (keys, tables and array of tables).
* Package `yosymfony/parser-utils` has been updated to 2.0.0.
1.0.1 (2018-02-05)
------------------
* Fixed a bug related to integer keys: now, it's possible to create keys using an integer. Reported by @betrixed.
* Merged the pull request #17: "removing `is_string` check".
* Minor fixes in README file.
1.0.0 (2017-11-18)
------------------
* The code has been rewritten from scratch for PHP 7.1.
* The method `parse` from `Toml` class must only be applied to TOML strings.
In case of parsing a TOML filename use the new method `parseFile`.
* Methods `parse` and `parseFile` from `Toml` class accept a new argument `resultAsObject`
(optional) to return the parsed input as an object (an instance of `stdClass`).
* The method `addGroup` of `TomlBuilder` class has been deleted.
* The exceptions have been refactored, so the classes `ExceptionInterface`,
`LexerException` and `RuntimeException` have been removed.
* Added the inner exception when a `ParseException` is thrown in method `parse` of class `Toml`.
* Fixed bug #13: "Inline sub-tables don't work".
* Fixed bug #12: "Does not parse a table with an array of tables".
* Better support for dates as specified in the latest TOML spec. See PR #11.
0.3.3 (2015-08-24)
------------------
* Fixed bug #10: Cannot parse quote (") in table name.
0.3.2 (2015-03-07)
------------------
* Fixed issue #9: Only double-quoted strings work in arrays, contrary to spec.
0.3.1 (2015-03-07)
------------------
* Added support to literal strings in `TomlBuilder`.
0.3.0 (2015-03-06)
------------------
* Support for TOML 0.4.0.
* CS fixes.
0.2.0 (2014-05-03)
--------------------
* Support for TOML 0.2.0.
* New tests for arrays of tables.
* TomlBuilder: new methods `addTabl`e
* TomlBuilder: Deprecated methods `addGroup`.
* Fixtures folder in tests renamed to fixtures.
* Fixtures reorganized.
0.1.1 (2013-12-14)
------------------
* Fixed bug with empty string value parse error.
* Fixed exception default timezone unset in unit tests.
* Added Travis configuration file.
* Fixed some issues in README.md.
0.1.0 (2013-05-12)
------------------
* Initial release.
* Support for TOML 0.1.0.
* BurntSushi test suite included.
* Included TomlBuilder to create inline TOML strings.

19
vendor/yosymfony/toml/LICENSE vendored Normal file
View file

@ -0,0 +1,19 @@
Copyright (c) 2013-2017 Víctor Puertas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

185
vendor/yosymfony/toml/README.md vendored Normal file
View file

@ -0,0 +1,185 @@
TOML parser for PHP
===================
A PHP parser for [TOML](https://github.com/toml-lang/toml) compatible with [TOML v0.4.0](https://github.com/toml-lang/toml/releases/tag/v0.4.0).
[![Build Status](https://travis-ci.org/yosymfony/toml.png?branch=master)](https://travis-ci.org/yosymfony/toml)
[![Latest Stable Version](https://poser.pugx.org/yosymfony/toml/v/stable.png)](https://packagist.org/packages/yosymfony/toml)
[![Total Downloads](https://poser.pugx.org/yosymfony/toml/downloads.png)](https://packagist.org/packages/yosymfony/toml)
Support:
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/yosymfony/Toml?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
Installation
------------
**Requires PHP >= 7.1.**
Use [Composer](http://getcomposer.org/) to install this package:
```bash
composer require yosymfony/toml
```
Usage
-----
You can parse an inline TOML string or from a file:
To parse an inline TOML string:
```php
use Yosymfony\Toml\Toml;
$array = Toml::Parse('key = [1,2,3]');
print_r($array);
```
To parse a TOML file:
```php
$array = Toml::ParseFile('example.toml');
print_r($array);
```
Additionally, methods `parse` and `parseFile` accept a second argument called
`resultAsObject` to return the result as an object based on `stdClass`.
```php
$object = Toml::Parse('key = [1,2,3]', true);
```
### TomlBuilder
You can create a TOML string with TomlBuilder. TomlBuilder uses a *fluent interface* for more readable code:
```php
use Yosymfony\Toml\TomlBuilder;
$tb = new TomlBuilder();
$result = $tb->addComment('Toml file')
->addTable('data.string')
->addValue('name', "Toml", 'This is your name')
->addValue('newline', "This string has a \n new line character.")
->addValue('winPath', "C:\\Users\\nodejs\\templates")
->addValue('literal', '@<\i\c*\s*>') // literals starts with '@'.
->addValue('unicode', 'unicode character: ' . json_decode('"\u03B4"'))
->addTable('data.bool')
->addValue('t', true)
->addValue('f', false)
->addTable('data.integer')
->addValue('positive', 25, 'Comment inline.')
->addValue('negative', -25)
->addTable('data.float')
->addValue('positive', 25.25)
->addValue('negative', -25.25)
->addTable('data.datetime')
->addValue('datetime', new \Datetime())
->addComment('Related to arrays')
->addTable('data.array')
->addValue('simple', array(1,2,3))
->addValue('multiple', array(
array(1,2),
array('abc', 'def'),
array(1.1, 1.2),
array(true, false),
array( new \Datetime()) ))
->addComment('Array of tables')
->addArrayOfTable('fruit') // Row
->addValue('name', 'apple')
->addArrayOfTable('fruit.variety')
->addValue('name', 'red delicious')
->addArrayOfTable('fruit.variety')
->addValue('name', 'granny smith')
->addArrayOfTable('fruit') // Row
->addValue('name', 'banana')
->addArrayOfTable('fruit.variety')
->addValue('name', 'plantain')
->getTomlString(); // Generate the TOML string
```
The result:
#Toml file
[data.string]
name = "Toml" #This is your name
newline = "This string has a \n new line character."
winPath = "C:\\Users\\nodejs\\templates"
literal = '<\i\c*\s*>'
unicode = "unicode character: δ"
[data.bool]
t = true
f = false
[data.integer]
positive = 25 #Comment inline.
negative = -25
[data.float]
positive = 25.25
negative = -25.25
[data.datetime]
datetime = 2013-06-10T21:12:48Z
#Related to arrays
[data.array]
simple = [1, 2, 3]
multiple = [[1, 2], ["abc", "def"], [1.1, 1.2], [true, false], [2013-06-10T21:12:48Z]]
# Array of tables
[[fruit]]
name = "apple"
[[fruit.variety]]
name = "red delicious"
[[fruit.variety]]
name = "granny smith"
[[fruit]]
name = "banana"
[[fruit.variety]]
name = "plantain"
#### Limitations
The `TomlBuilder` class is an utility to get Toml strings that has the following limitations:
* Only admits `basic strings` and `literal strings`.
Deprecated method
-----------------
The following method will be eliminated in version 2.0.0
* [TomlBuilder] **addArrayTables**
Contributing
------------
When Contributing code to this library, you must follow its coding standards.
Toml follows [PSR-2 coding style](https://www.php-fig.org/psr/psr-2/). To ensure
the CS, you can use the CLI tool [PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer).
Unit tests
----------
You can run the unit tests with the following command:
```bash
$ cd toml
$ composer test
```
## License
This library is open-sourced software licensed under the
[MIT license](http://opensource.org/licenses/MIT).

33
vendor/yosymfony/toml/composer.json vendored Normal file
View file

@ -0,0 +1,33 @@
{
"name": "yosymfony/toml",
"description": "A PHP parser for TOML compatible with specification 0.4.0",
"type": "library",
"keywords": ["toml", "parser", "mojombo"],
"homepage": "http://github.com/yosymfony/toml",
"license": "MIT",
"authors": [
{
"name": "Victor Puertas",
"email": "vpgugr@gmail.com",
"homepage": "http://yosymfony.com"
}
],
"require": {
"php": ">=7.1",
"yosymfony/parser-utils": "^2.0"
},
"require-dev": {
"phpunit/phpunit": "^7.1"
},
"autoload": {
"psr-4": { "Yosymfony\\Toml\\": "src/" }
},
"scripts": {
"test": "vendor/bin/phpunit"
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
}
}

1476
vendor/yosymfony/toml/composer.lock generated vendored Normal file

File diff suppressed because it is too large Load diff

26
vendor/yosymfony/toml/phpunit.xml.dist vendored Normal file
View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
failOnRisky="true"
failOnWarning="true"
>
<testsuites>
<testsuite name="Yosymfony Toml Parser test suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>./</directory>
<exclude>
<directory>./vendor</directory>
<directory>./tests</directory>
</exclude>
</whitelist>
</filter>
</phpunit>

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