├── vendor ├── composer │ ├── autoload_namespaces.php │ ├── autoload_files.php │ ├── autoload_psr4.php │ ├── platform_check.php │ ├── autoload_classmap.php │ ├── LICENSE │ ├── autoload_real.php │ ├── autoload_static.php │ └── installed.php ├── vlucas │ └── phpdotenv │ │ ├── src │ │ ├── Exception │ │ │ ├── ExceptionInterface.php │ │ │ ├── ValidationException.php │ │ │ ├── InvalidFileException.php │ │ │ ├── InvalidPathException.php │ │ │ └── InvalidEncodingException.php │ │ ├── Repository │ │ │ ├── Adapter │ │ │ │ ├── ReaderInterface.php │ │ │ │ ├── AdapterInterface.php │ │ │ │ ├── WriterInterface.php │ │ │ │ ├── MultiReader.php │ │ │ │ ├── MultiWriter.php │ │ │ │ ├── ArrayAdapter.php │ │ │ │ ├── GuardedWriter.php │ │ │ │ ├── PutenvAdapter.php │ │ │ │ ├── EnvConstAdapter.php │ │ │ │ ├── ServerConstAdapter.php │ │ │ │ ├── ApacheAdapter.php │ │ │ │ ├── ReplacingWriter.php │ │ │ │ └── ImmutableWriter.php │ │ │ ├── RepositoryInterface.php │ │ │ ├── AdapterRepository.php │ │ │ └── RepositoryBuilder.php │ │ ├── Store │ │ │ ├── StoreInterface.php │ │ │ ├── StringStore.php │ │ │ ├── File │ │ │ │ ├── Paths.php │ │ │ │ └── Reader.php │ │ │ ├── FileStore.php │ │ │ └── StoreBuilder.php │ │ ├── Parser │ │ │ ├── ParserInterface.php │ │ │ ├── Entry.php │ │ │ ├── Lexer.php │ │ │ ├── Parser.php │ │ │ ├── Value.php │ │ │ └── Lines.php │ │ ├── Loader │ │ │ ├── LoaderInterface.php │ │ │ ├── Loader.php │ │ │ └── Resolver.php │ │ ├── Util │ │ │ ├── Str.php │ │ │ └── Regex.php │ │ ├── Validator.php │ │ └── Dotenv.php │ │ ├── LICENSE │ │ └── composer.json ├── symfony │ ├── polyfill-ctype │ │ ├── README.md │ │ ├── composer.json │ │ ├── LICENSE │ │ ├── bootstrap.php │ │ ├── bootstrap80.php │ │ └── Ctype.php │ ├── polyfill-php80 │ │ ├── Resources │ │ │ └── stubs │ │ │ │ ├── ValueError.php │ │ │ │ ├── UnhandledMatchError.php │ │ │ │ ├── PhpToken.php │ │ │ │ ├── Stringable.php │ │ │ │ └── Attribute.php │ │ ├── README.md │ │ ├── LICENSE │ │ ├── composer.json │ │ ├── bootstrap.php │ │ ├── PhpToken.php │ │ └── Php80.php │ └── polyfill-mbstring │ │ ├── README.md │ │ ├── LICENSE │ │ ├── composer.json │ │ ├── Resources │ │ └── unidata │ │ │ ├── caseFolding.php │ │ │ └── titleCaseRegexp.php │ │ ├── bootstrap.php │ │ └── bootstrap80.php ├── afragen │ ├── wp-dismiss-notice │ │ ├── composer.json │ │ ├── LICENSE │ │ ├── README.md │ │ ├── js │ │ │ └── dismiss-notice.js │ │ └── wp-dismiss-notice.php │ └── wp-dependency-installer │ │ ├── composer.json │ │ ├── LICENSE │ │ ├── wp-dependency-installer-skin.php │ │ └── README.md ├── autoload.php ├── graham-campbell │ └── result-type │ │ ├── composer.json │ │ ├── LICENSE │ │ └── src │ │ ├── Result.php │ │ ├── Success.php │ │ └── Error.php └── phpoption │ └── phpoption │ ├── composer.json │ └── src │ └── PhpOption │ ├── None.php │ ├── Some.php │ └── LazyOption.php ├── .env.example ├── composer.json ├── CHANGES.md ├── LICENSE ├── readme.txt ├── README.md └── freemius-license-installer.php /vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | public function read(string $name); 17 | } 18 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Store/StoreInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | if (\PHP_VERSION_ID < 80000) { 13 | class ValueError extends Error 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-mbstring/README.md: -------------------------------------------------------------------------------- 1 | Symfony Polyfill / Mbstring 2 | =========================== 3 | 4 | This component provides a partial, native PHP implementation for the 5 | [Mbstring](https://php.net/mbstring) extension. 6 | 7 | More information can be found in the 8 | [main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). 9 | 10 | License 11 | ======= 12 | 13 | This library is released under the [MIT license](LICENSE). 14 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | if (\PHP_VERSION_ID < 80000) { 13 | class UnhandledMatchError extends Error 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Parser/ParserInterface.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public static function create(); 15 | } 16 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) { 13 | class PhpToken extends Symfony\Polyfill\Php80\PhpToken 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/composer/autoload_files.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', 10 | '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', 11 | 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', 12 | ); 13 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | if (\PHP_VERSION_ID < 80000) { 13 | interface Stringable 14 | { 15 | /** 16 | * @return string 17 | */ 18 | public function __toString(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Loader/LoaderInterface.php: -------------------------------------------------------------------------------- 1 | 18 | */ 19 | public function load(RepositoryInterface $repository, array $entries); 20 | } 21 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/WriterInterface.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/symfony/polyfill-php80'), 10 | 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), 11 | 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), 12 | 'PhpOption\\' => array($vendorDir . '/phpoption/phpoption/src/PhpOption'), 13 | 'GrahamCampbell\\ResultType\\' => array($vendorDir . '/graham-campbell/result-type/src'), 14 | 'Dotenv\\' => array($vendorDir . '/vlucas/phpdotenv/src'), 15 | ); 16 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "afragen/freemius-license-installer", 3 | "description": "Add Freemius licensing from .env file.", 4 | "type": "wordpress-plugin", 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "Andy Fragen", 9 | "email": "andy@thefragens.com", 10 | "homepage": "https://thefragens.com", 11 | "role": "Developer" 12 | } 13 | ], 14 | "support": { 15 | "issues": "https://github.com/afragen/freemius-license-installer/issues", 16 | "source": "https://github.com/afragen/freemius-license-installer" 17 | }, 18 | "prefer-stable": true, 19 | "require": { 20 | "php": ">=7.4", 21 | "afragen/wp-dependency-installer": "^4", 22 | "vlucas/phpdotenv": "^5.4" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Store/StringStore.php: -------------------------------------------------------------------------------- 1 | content = $content; 26 | } 27 | 28 | /** 29 | * Read the content of the environment file(s). 30 | * 31 | * @return string 32 | */ 33 | public function read() 34 | { 35 | return $this->content; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/afragen/wp-dismiss-notice/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "afragen/wp-dismiss-notice", 3 | "description": "Library for time dismissible WordPress admin notices.", 4 | "version": "0.3.7", 5 | "type": "library", 6 | "license": "MIT", 7 | "authors": [ 8 | { 9 | "name": "Andy Fragen", 10 | "email": "andy@thefragens.com", 11 | "homepage": "https://thefragens.com", 12 | "role": "Developer" 13 | } 14 | ], 15 | "prefer-stable": true, 16 | "require": { 17 | "php": ">=5.6" 18 | }, 19 | "support": { 20 | "issues": "https://github.com/afragen/wp-dismiss-notice/issues", 21 | "source": "https://github.com/afragen/wp-dismiss-notice" 22 | }, 23 | "autoload": { 24 | "classmap": [ 25 | "wp-dismiss-notice.php" 26 | ] 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /vendor/autoload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | #[Attribute(Attribute::TARGET_CLASS)] 13 | final class Attribute 14 | { 15 | public const TARGET_CLASS = 1; 16 | public const TARGET_FUNCTION = 2; 17 | public const TARGET_METHOD = 4; 18 | public const TARGET_PROPERTY = 8; 19 | public const TARGET_CLASS_CONSTANT = 16; 20 | public const TARGET_PARAMETER = 32; 21 | public const TARGET_ALL = 63; 22 | public const IS_REPEATABLE = 64; 23 | 24 | /** @var int */ 25 | public $flags; 26 | 27 | public function __construct(int $flags = self::TARGET_ALL) 28 | { 29 | $this->flags = $flags; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Store/File/Paths.php: -------------------------------------------------------------------------------- 1 | = 70400)) { 8 | $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.'; 9 | } 10 | 11 | if ($issues) { 12 | if (!headers_sent()) { 13 | header('HTTP/1.1 500 Internal Server Error'); 14 | } 15 | if (!ini_get('display_errors')) { 16 | if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { 17 | fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); 18 | } elseif (!headers_sent()) { 19 | 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; 20 | } 21 | } 22 | trigger_error( 23 | 'Composer detected issues in your platform: ' . implode(' ', $issues), 24 | E_USER_ERROR 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /vendor/graham-campbell/result-type/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "graham-campbell/result-type", 3 | "description": "An Implementation Of The Result Type", 4 | "keywords": ["result", "result-type", "Result", "Result Type", "Result-Type", "Graham Campbell", "GrahamCampbell"], 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "Graham Campbell", 9 | "email": "hello@gjcampbell.co.uk", 10 | "homepage": "https://github.com/GrahamCampbell" 11 | } 12 | ], 13 | "require": { 14 | "php": "^7.2.5 || ^8.0", 15 | "phpoption/phpoption": "^1.9.3" 16 | }, 17 | "require-dev": { 18 | "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" 19 | }, 20 | "autoload": { 21 | "psr-4": { 22 | "GrahamCampbell\\ResultType\\": "src/" 23 | } 24 | }, 25 | "autoload-dev": { 26 | "psr-4": { 27 | "GrahamCampbell\\Tests\\ResultType\\": "tests/" 28 | } 29 | }, 30 | "config": { 31 | "preferred-install": "dist" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /CHANGES.md: -------------------------------------------------------------------------------- 1 | [unreleased] 2 | #### 1.2.0 / 2025-07-15 3 | * update bootstrap 4 | * composer update 5 | 6 | #### 1.1.0 / 2023-05-30 7 | * composer update 8 | 9 | #### 1.0.0 / 2023-04-14 10 | * add .env to plugin root, tradeoff less secure but easier to distribute 11 | * update requirements 12 | 13 | #### 0.8.0 / 2023-04-04 14 | * composer update 15 | 16 | #### 0.7.0 / 2023-03-30 17 | * composer update 18 | 19 | #### 0.6.0 / 2023-01-31 20 | * fix composer issue 21 | 22 | #### 0.5.0 / 2023-01-19 23 | * composer update 24 | 25 | #### 0.4.0 / 2023-01-02 26 | * composer update 27 | 28 | #### 0.3.0 / 2022-09-24 29 | * ensure `$wp_filesystem` is loaded 30 | 31 | #### 0.2.2 / 2022-07-15 32 | * delete Freemius Auto Activation plugin on deactivation 33 | * composer update 34 | 35 | #### 0.2.1 / 2022-05-25 36 | * composer update 37 | 38 | #### 0.2.0 / 2022-02-07 39 | * use `.env` file for license data 40 | * use `vlucas/phpdotenv` to read `.env` data 41 | * rename plugin 42 | 43 | #### 0.1.0 / 2022-02-05 44 | * initial pass 45 | * use wp-dependency-installer for `squarecandy/freemius-auto-activation` 46 | -------------------------------------------------------------------------------- /vendor/composer/autoload_classmap.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 10 | 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 11 | 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 12 | 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 13 | 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', 14 | 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', 15 | 'WP_Dependency_Installer' => $vendorDir . '/afragen/wp-dependency-installer/wp-dependency-installer.php', 16 | 'WP_Dependency_Installer_Skin' => $vendorDir . '/afragen/wp-dependency-installer/wp-dependency-installer-skin.php', 17 | 'WP_Dismiss_Notice' => $vendorDir . '/afragen/wp-dismiss-notice/wp-dismiss-notice.php', 18 | ); 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Andy Fragen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-ctype/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/polyfill-ctype", 3 | "type": "library", 4 | "description": "Symfony polyfill for ctype functions", 5 | "keywords": ["polyfill", "compatibility", "portable", "ctype"], 6 | "homepage": "https://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Gert de Pagter", 11 | "email": "BackEndTea@gmail.com" 12 | }, 13 | { 14 | "name": "Symfony Community", 15 | "homepage": "https://symfony.com/contributors" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=7.2" 20 | }, 21 | "provide": { 22 | "ext-ctype": "*" 23 | }, 24 | "autoload": { 25 | "psr-4": { "Symfony\\Polyfill\\Ctype\\": "" }, 26 | "files": [ "bootstrap.php" ] 27 | }, 28 | "suggest": { 29 | "ext-ctype": "For best performance" 30 | }, 31 | "minimum-stability": "dev", 32 | "extra": { 33 | "thanks": { 34 | "name": "symfony/polyfill", 35 | "url": "https://github.com/symfony/polyfill" 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/composer/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) Nils Adermann, Jordi Boggiano 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is furnished 9 | to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-ctype/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018-present Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020-present Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-mbstring/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015-present Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/afragen/wp-dependency-installer/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "afragen/wp-dependency-installer", 3 | "description": "Library that helps WordPress plugin dependency management.", 4 | "version": "4.3.14", 5 | "type": "library", 6 | "license": "MIT", 7 | "authors": [ 8 | { 9 | "name": "Andy Fragen", 10 | "email": "andy@thefragens.com", 11 | "homepage": "https://thefragens.com", 12 | "role": "Developer" 13 | }, 14 | { 15 | "name": "Matt Gibbs", 16 | "homepage": "https://facetwp.com", 17 | "role": "Developer" 18 | }, 19 | { 20 | "name": "Raruto", 21 | "homepage": "https://raruto.github.io", 22 | "role": "Developer" 23 | } 24 | ], 25 | "prefer-stable": true, 26 | "require": { 27 | "php": ">=5.6", 28 | "afragen/wp-dismiss-notice": "*" 29 | }, 30 | "support": { 31 | "issues": "https://github.com/afragen/wp-dependency-installer/issues", 32 | "source": "https://github.com/afragen/wp-dependency-installer" 33 | }, 34 | "autoload": { 35 | "classmap": [ 36 | "wp-dependency-installer.php", 37 | "wp-dependency-installer-skin.php" 38 | ] 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/afragen/wp-dismiss-notice/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Andy Fragen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/afragen/wp-dependency-installer/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Andy Fragen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/polyfill-php80", 3 | "type": "library", 4 | "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", 5 | "keywords": ["polyfill", "shim", "compatibility", "portable"], 6 | "homepage": "https://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Ion Bazan", 11 | "email": "ion.bazan@gmail.com" 12 | }, 13 | { 14 | "name": "Nicolas Grekas", 15 | "email": "p@tchwork.com" 16 | }, 17 | { 18 | "name": "Symfony Community", 19 | "homepage": "https://symfony.com/contributors" 20 | } 21 | ], 22 | "require": { 23 | "php": ">=7.2" 24 | }, 25 | "autoload": { 26 | "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, 27 | "files": [ "bootstrap.php" ], 28 | "classmap": [ "Resources/stubs" ] 29 | }, 30 | "minimum-stability": "dev", 31 | "extra": { 32 | "thanks": { 33 | "name": "symfony/polyfill", 34 | "url": "https://github.com/symfony/polyfill" 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/afragen/wp-dismiss-notice/README.md: -------------------------------------------------------------------------------- 1 | # WP Dismiss Notice 2 | 3 | Add time dismissible admin notices to WordPress. 4 | Fork of https://github.com/w3guy/persist-admin-notices-dismissal 5 | 6 | ## Instuctions 7 | 8 | Initialize the class. 9 | 10 | `new \WP_Dismiss_Notice();` in your project. 11 | 12 | ### Admin notice format. 13 | 14 | You must add `data-dismissible='-'` to the admin notice div class. `` values are from one day '1' to 'forever'. Default timeout is 14 days. The `` should be some unique value based upon the admin notice that you wish to dismiss. 15 | 16 | Example using a 14 day dismissible notice. 17 | 18 | ```html 19 |
...
20 | ``` 21 | 22 | Use the filter `dismiss_notice_vendor_dir` if you have set the composer `vendor-dir` to a non-standard location. 23 | 24 | /** 25 | * Filter composer.json vendor directory. 26 | * Some people don't use the standard vendor directory. 27 | * 28 | * @param string Composer vendor directory. 29 | */ 30 | $vendor_dir = apply_filters( 'dismiss_notice_vendor_dir', '/vendor' ); 31 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-mbstring/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "symfony/polyfill-mbstring", 3 | "type": "library", 4 | "description": "Symfony polyfill for the Mbstring extension", 5 | "keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"], 6 | "homepage": "https://symfony.com", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Nicolas Grekas", 11 | "email": "p@tchwork.com" 12 | }, 13 | { 14 | "name": "Symfony Community", 15 | "homepage": "https://symfony.com/contributors" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=7.2", 20 | "ext-iconv": "*" 21 | }, 22 | "provide": { 23 | "ext-mbstring": "*" 24 | }, 25 | "autoload": { 26 | "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, 27 | "files": [ "bootstrap.php" ] 28 | }, 29 | "suggest": { 30 | "ext-mbstring": "For best performance" 31 | }, 32 | "minimum-stability": "dev", 33 | "extra": { 34 | "thanks": { 35 | "name": "symfony/polyfill", 36 | "url": "https://github.com/symfony/polyfill" 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/RepositoryInterface.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/afragen/wp-dismiss-notice/js/dismiss-notice.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @output wp-admin/js/dismiss-notice.js 3 | * 4 | * @see https://github.com/w3guy/persist-admin-notices-dismissal 5 | */ 6 | 7 | (function ($) { 8 | // Shorthand for ready event. 9 | $( 10 | function () { 11 | $('div[data-dismissible] button.notice-dismiss').on('click', 12 | function (event) { 13 | event.preventDefault(); 14 | var $this = $(this); 15 | 16 | var attr_value, option_name, dismissible_length, data; 17 | 18 | attr_value = $this.closest('div[data-dismissible]').attr('data-dismissible').split('-'); 19 | 20 | // Remove the dismissible length from the attribute value and rejoin the array. 21 | dismissible_length = attr_value.pop(); 22 | 23 | option_name = attr_value.join('-'); 24 | 25 | data = { 26 | 'action': 'wp_dismiss_notice', 27 | 'option_name': option_name, 28 | 'dismissible_length': dismissible_length, 29 | 'nonce': window.wp_dismiss_notice.nonce 30 | }; 31 | 32 | // Run Ajax request. 33 | $.post(window.wp_dismiss_notice.ajaxurl, data); 34 | $this.closest('div[data-dismissible]').hide('slow'); 35 | } 36 | ); 37 | } 38 | ); 39 | 40 | }(jQuery)); 41 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiReader.php: -------------------------------------------------------------------------------- 1 | readers = $readers; 28 | } 29 | 30 | /** 31 | * Read an environment variable, if it exists. 32 | * 33 | * @param non-empty-string $name 34 | * 35 | * @return \PhpOption\Option 36 | */ 37 | public function read(string $name) 38 | { 39 | foreach ($this->readers as $reader) { 40 | $result = $reader->read($name); 41 | if ($result->isDefined()) { 42 | return $result; 43 | } 44 | } 45 | 46 | return None::create(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/afragen/wp-dependency-installer/wp-dependency-installer-skin.php: -------------------------------------------------------------------------------- 1 | name = $name; 36 | $this->value = $value; 37 | } 38 | 39 | /** 40 | * Get the entry name. 41 | * 42 | * @return string 43 | */ 44 | public function getName() 45 | { 46 | return $this->name; 47 | } 48 | 49 | /** 50 | * Get the entry value. 51 | * 52 | * @return \PhpOption\Option<\Dotenv\Parser\Value> 53 | */ 54 | public function getValue() 55 | { 56 | /** @var \PhpOption\Option<\Dotenv\Parser\Value> */ 57 | return Option::fromValue($this->value); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | # Freemius License Installer 2 | Author: Andy Fragen 3 | License: MIT 4 | Requires at least: 5.9 5 | Requires PHP: 7.2 6 | Tested up to: trunk 7 | Stable version: main 8 | Donate link: 9 | 10 | ## Description 11 | 12 | Activating this plugin loads your license data from a `.env` file. You will need to create this `.env` file for the plugin to function. A PHP Fatal Exception error on activation will be thrown if the `.env` file is not found in the correct path. 13 | 14 | Refer to `.env.example` for the format of the `.env` file. 15 | 16 | The `.env` file will need to be created in the plugin root directory. This is a tradeoff as it is less secure but provides for an easier installation for you and your users. 17 | 18 | The shortcode is unique to each Freemius integrated plugin or theme. Ask the plugin developer for this shortcode. It is usually evident in the Freemius integration code. 19 | 20 | It will also automatically install and activate the [Freemius Auto Activation](https://github.com/squarecandy/freemius-auto-activation) plugin. 21 | 22 | After running, the licenses with be loaded in the WordPress database. You may still be asked to opt in to telemetry data. Please agree to this instead of skipping. 23 | 24 | After running this plugin, it may be deactivated and/or deleted. Upon deactivation, the Freemius Auto Activation plugin will be deleted. 25 | -------------------------------------------------------------------------------- /vendor/phpoption/phpoption/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "phpoption/phpoption", 3 | "description": "Option Type for PHP", 4 | "keywords": ["php", "option", "language", "type"], 5 | "license": "Apache-2.0", 6 | "authors": [ 7 | { 8 | "name": "Johannes M. Schmitt", 9 | "email": "schmittjoh@gmail.com", 10 | "homepage": "https://github.com/schmittjoh" 11 | }, 12 | { 13 | "name": "Graham Campbell", 14 | "email": "hello@gjcampbell.co.uk", 15 | "homepage": "https://github.com/GrahamCampbell" 16 | } 17 | ], 18 | "require": { 19 | "php": "^7.2.5 || ^8.0" 20 | }, 21 | "require-dev": { 22 | "bamarni/composer-bin-plugin": "^1.8.2", 23 | "phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28" 24 | }, 25 | "autoload": { 26 | "psr-4": { 27 | "PhpOption\\": "src/PhpOption/" 28 | } 29 | }, 30 | "autoload-dev": { 31 | "psr-4": { 32 | "PhpOption\\Tests\\": "tests/PhpOption/Tests/" 33 | } 34 | }, 35 | "config": { 36 | "allow-plugins": { 37 | "bamarni/composer-bin-plugin": true 38 | }, 39 | "preferred-install": "dist" 40 | }, 41 | "extra": { 42 | "bamarni-bin": { 43 | "bin-links": true, 44 | "forward-command": false 45 | }, 46 | "branch-alias": { 47 | "dev-master": "1.9-dev" 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Parser/Lexer.php: -------------------------------------------------------------------------------- 1 | 37 | */ 38 | public static function lex(string $content) 39 | { 40 | static $regex; 41 | 42 | if ($regex === null) { 43 | $regex = '(('.\implode(')|(', self::PATTERNS).'))A'; 44 | } 45 | 46 | $offset = 0; 47 | 48 | while (isset($content[$offset])) { 49 | if (!\preg_match($regex, $content, $matches, 0, $offset)) { 50 | throw new \Error(\sprintf('Lexer encountered unexpected character [%s].', $content[$offset])); 51 | } 52 | 53 | $offset += \strlen($matches[0]); 54 | 55 | yield $matches[0]; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Freemius License Installer 2 | 3 | * Author: Andy Fragen 4 | * License: MIT 5 | * Requires at least: 5.9 6 | * Requires PHP: 7.2 7 | * Tested up to: trunk 8 | * Stable version: main 9 | * Donate link: 10 | 11 | Add Freemius licensing from `.env` file. Uses https://github.com/squarecandy/freemius-auto-activation plugin. 12 | 13 | ## Description 14 | 15 | Activating this plugin loads your license data from a `.env` file. You will need to create this `.env` file for the plugin to function. A PHP Fatal Exception error on activation will be thrown if the `.env` file is not found in the correct path. 16 | 17 | Refer to `.env.example` for the format of the `.env` file. 18 | 19 | The `.env` file will need to be created in the plugin root directory. This is a tradeoff as it is less secure but provides for an easier installation for you and your users. 20 | 21 | The shortcode is unique to each Freemius integrated plugin or theme. Ask the plugin developer for this shortcode. It is usually evident in the Freemius integration code. 22 | 23 | It will also automatically install and activate the [Freemius Auto Activation](https://github.com/squarecandy/freemius-auto-activation) plugin. 24 | 25 | After running, the licenses with be loaded in the WordPress database. You may still be asked to opt in to telemetry data. Please agree to this instead of skipping. 26 | 27 | After running this plugin, it may be deactivated and/or deleted. Upon deactivation, the Freemius Auto Activation plugin will be deleted. 28 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/MultiWriter.php: -------------------------------------------------------------------------------- 1 | writers = $writers; 26 | } 27 | 28 | /** 29 | * Write to an environment variable, if possible. 30 | * 31 | * @param non-empty-string $name 32 | * @param string $value 33 | * 34 | * @return bool 35 | */ 36 | public function write(string $name, string $value) 37 | { 38 | foreach ($this->writers as $writers) { 39 | if (!$writers->write($name, $value)) { 40 | return false; 41 | } 42 | } 43 | 44 | return true; 45 | } 46 | 47 | /** 48 | * Delete an environment variable, if possible. 49 | * 50 | * @param non-empty-string $name 51 | * 52 | * @return bool 53 | */ 54 | public function delete(string $name) 55 | { 56 | foreach ($this->writers as $writers) { 57 | if (!$writers->delete($name)) { 58 | return false; 59 | } 60 | } 61 | 62 | return true; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2014, Graham Campbell. 4 | Copyright (c) 2013, Vance Lucas. 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | 3. Neither the name of the copyright holder nor the names of its 18 | contributors may be used to endorse or promote products derived from 19 | this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 25 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 27 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 28 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /vendor/graham-campbell/result-type/src/Result.php: -------------------------------------------------------------------------------- 1 | 9 | * 10 | * For the full copyright and license information, please view the LICENSE 11 | * file that was distributed with this source code. 12 | */ 13 | 14 | namespace GrahamCampbell\ResultType; 15 | 16 | /** 17 | * @template T 18 | * @template E 19 | */ 20 | abstract class Result 21 | { 22 | /** 23 | * Get the success option value. 24 | * 25 | * @return \PhpOption\Option 26 | */ 27 | abstract public function success(); 28 | 29 | /** 30 | * Map over the success value. 31 | * 32 | * @template S 33 | * 34 | * @param callable(T):S $f 35 | * 36 | * @return \GrahamCampbell\ResultType\Result 37 | */ 38 | abstract public function map(callable $f); 39 | 40 | /** 41 | * Flat map over the success value. 42 | * 43 | * @template S 44 | * @template F 45 | * 46 | * @param callable(T):\GrahamCampbell\ResultType\Result $f 47 | * 48 | * @return \GrahamCampbell\ResultType\Result 49 | */ 50 | abstract public function flatMap(callable $f); 51 | 52 | /** 53 | * Get the error option value. 54 | * 55 | * @return \PhpOption\Option 56 | */ 57 | abstract public function error(); 58 | 59 | /** 60 | * Map over the error value. 61 | * 62 | * @template F 63 | * 64 | * @param callable(E):F $f 65 | * 66 | * @return \GrahamCampbell\ResultType\Result 67 | */ 68 | abstract public function mapError(callable $f); 69 | } 70 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Loader/Loader.php: -------------------------------------------------------------------------------- 1 | 23 | */ 24 | public function load(RepositoryInterface $repository, array $entries) 25 | { 26 | /** @var array */ 27 | return \array_reduce($entries, static function (array $vars, Entry $entry) use ($repository) { 28 | $name = $entry->getName(); 29 | 30 | $value = $entry->getValue()->map(static function (Value $value) use ($repository) { 31 | return Resolver::resolve($repository, $value); 32 | }); 33 | 34 | if ($value->isDefined()) { 35 | $inner = $value->get(); 36 | if ($repository->set($name, $inner)) { 37 | return \array_merge($vars, [$name => $inner]); 38 | } 39 | } else { 40 | if ($repository->clear($name)) { 41 | return \array_merge($vars, [$name => null]); 42 | } 43 | } 44 | 45 | return $vars; 46 | }, []); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/bootstrap.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Symfony\Polyfill\Php80 as p; 13 | 14 | if (\PHP_VERSION_ID >= 80000) { 15 | return; 16 | } 17 | 18 | if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { 19 | define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); 20 | } 21 | 22 | if (!function_exists('fdiv')) { 23 | function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } 24 | } 25 | if (!function_exists('preg_last_error_msg')) { 26 | function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } 27 | } 28 | if (!function_exists('str_contains')) { 29 | function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } 30 | } 31 | if (!function_exists('str_starts_with')) { 32 | function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } 33 | } 34 | if (!function_exists('str_ends_with')) { 35 | function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } 36 | } 37 | if (!function_exists('get_debug_type')) { 38 | function get_debug_type($value): string { return p\Php80::get_debug_type($value); } 39 | } 40 | if (!function_exists('get_resource_id')) { 41 | function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-ctype/bootstrap.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Symfony\Polyfill\Ctype as p; 13 | 14 | if (\PHP_VERSION_ID >= 80000) { 15 | return require __DIR__.'/bootstrap80.php'; 16 | } 17 | 18 | if (!function_exists('ctype_alnum')) { 19 | function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); } 20 | } 21 | if (!function_exists('ctype_alpha')) { 22 | function ctype_alpha($text) { return p\Ctype::ctype_alpha($text); } 23 | } 24 | if (!function_exists('ctype_cntrl')) { 25 | function ctype_cntrl($text) { return p\Ctype::ctype_cntrl($text); } 26 | } 27 | if (!function_exists('ctype_digit')) { 28 | function ctype_digit($text) { return p\Ctype::ctype_digit($text); } 29 | } 30 | if (!function_exists('ctype_graph')) { 31 | function ctype_graph($text) { return p\Ctype::ctype_graph($text); } 32 | } 33 | if (!function_exists('ctype_lower')) { 34 | function ctype_lower($text) { return p\Ctype::ctype_lower($text); } 35 | } 36 | if (!function_exists('ctype_print')) { 37 | function ctype_print($text) { return p\Ctype::ctype_print($text); } 38 | } 39 | if (!function_exists('ctype_punct')) { 40 | function ctype_punct($text) { return p\Ctype::ctype_punct($text); } 41 | } 42 | if (!function_exists('ctype_space')) { 43 | function ctype_space($text) { return p\Ctype::ctype_space($text); } 44 | } 45 | if (!function_exists('ctype_upper')) { 46 | function ctype_upper($text) { return p\Ctype::ctype_upper($text); } 47 | } 48 | if (!function_exists('ctype_xdigit')) { 49 | function ctype_xdigit($text) { return p\Ctype::ctype_xdigit($text); } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-ctype/bootstrap80.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Symfony\Polyfill\Ctype as p; 13 | 14 | if (!function_exists('ctype_alnum')) { 15 | function ctype_alnum(mixed $text): bool { return p\Ctype::ctype_alnum($text); } 16 | } 17 | if (!function_exists('ctype_alpha')) { 18 | function ctype_alpha(mixed $text): bool { return p\Ctype::ctype_alpha($text); } 19 | } 20 | if (!function_exists('ctype_cntrl')) { 21 | function ctype_cntrl(mixed $text): bool { return p\Ctype::ctype_cntrl($text); } 22 | } 23 | if (!function_exists('ctype_digit')) { 24 | function ctype_digit(mixed $text): bool { return p\Ctype::ctype_digit($text); } 25 | } 26 | if (!function_exists('ctype_graph')) { 27 | function ctype_graph(mixed $text): bool { return p\Ctype::ctype_graph($text); } 28 | } 29 | if (!function_exists('ctype_lower')) { 30 | function ctype_lower(mixed $text): bool { return p\Ctype::ctype_lower($text); } 31 | } 32 | if (!function_exists('ctype_print')) { 33 | function ctype_print(mixed $text): bool { return p\Ctype::ctype_print($text); } 34 | } 35 | if (!function_exists('ctype_punct')) { 36 | function ctype_punct(mixed $text): bool { return p\Ctype::ctype_punct($text); } 37 | } 38 | if (!function_exists('ctype_space')) { 39 | function ctype_space(mixed $text): bool { return p\Ctype::ctype_space($text); } 40 | } 41 | if (!function_exists('ctype_upper')) { 42 | function ctype_upper(mixed $text): bool { return p\Ctype::ctype_upper($text); } 43 | } 44 | if (!function_exists('ctype_xdigit')) { 45 | function ctype_xdigit(mixed $text): bool { return p\Ctype::ctype_xdigit($text); } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | register(true); 35 | 36 | $filesToLoad = \Composer\Autoload\ComposerStaticInitd270377834bfdde1328c10b0ad602c8f::$files; 37 | $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { 38 | if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { 39 | $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; 40 | 41 | require $file; 42 | } 43 | }, null, null); 44 | foreach ($filesToLoad as $fileIdentifier => $file) { 45 | $requireFile($fileIdentifier, $file); 46 | } 47 | 48 | return $loader; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vlucas/phpdotenv", 3 | "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", 4 | "keywords": ["env", "dotenv", "environment"], 5 | "license": "BSD-3-Clause", 6 | "authors": [ 7 | { 8 | "name": "Graham Campbell", 9 | "email": "hello@gjcampbell.co.uk", 10 | "homepage": "https://github.com/GrahamCampbell" 11 | }, 12 | { 13 | "name": "Vance Lucas", 14 | "email": "vance@vancelucas.com", 15 | "homepage": "https://github.com/vlucas" 16 | } 17 | ], 18 | "require": { 19 | "php": "^7.2.5 || ^8.0", 20 | "ext-pcre": "*", 21 | "graham-campbell/result-type": "^1.1.3", 22 | "phpoption/phpoption": "^1.9.3", 23 | "symfony/polyfill-ctype": "^1.24", 24 | "symfony/polyfill-mbstring": "^1.24", 25 | "symfony/polyfill-php80": "^1.24" 26 | }, 27 | "require-dev": { 28 | "ext-filter": "*", 29 | "bamarni/composer-bin-plugin": "^1.8.2", 30 | "phpunit/phpunit":"^8.5.34 || ^9.6.13 || ^10.4.2" 31 | }, 32 | "autoload": { 33 | "psr-4": { 34 | "Dotenv\\": "src/" 35 | } 36 | }, 37 | "autoload-dev": { 38 | "psr-4": { 39 | "Dotenv\\Tests\\": "tests/Dotenv/" 40 | } 41 | }, 42 | "suggest": { 43 | "ext-filter": "Required to use the boolean validator." 44 | }, 45 | "config": { 46 | "allow-plugins": { 47 | "bamarni/composer-bin-plugin": true 48 | }, 49 | "preferred-install": "dist" 50 | }, 51 | "extra": { 52 | "bamarni-bin": { 53 | "bin-links": true, 54 | "forward-command": false 55 | }, 56 | "branch-alias": { 57 | "dev-master": "5.6-dev" 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Parser/Parser.php: -------------------------------------------------------------------------------- 1 | mapError(static function () { 26 | return 'Could not split into separate lines.'; 27 | })->flatMap(static function (array $lines) { 28 | return self::process(Lines::process($lines)); 29 | })->mapError(static function (string $error) { 30 | throw new InvalidFileException(\sprintf('Failed to parse dotenv file. %s', $error)); 31 | })->success()->get(); 32 | } 33 | 34 | /** 35 | * Convert the raw entries into proper entries. 36 | * 37 | * @param string[] $entries 38 | * 39 | * @return \GrahamCampbell\ResultType\Result<\Dotenv\Parser\Entry[], string> 40 | */ 41 | private static function process(array $entries) 42 | { 43 | /** @var \GrahamCampbell\ResultType\Result<\Dotenv\Parser\Entry[], string> */ 44 | return \array_reduce($entries, static function (Result $result, string $raw) { 45 | return $result->flatMap(static function (array $entries) use ($raw) { 46 | return EntryParser::parse($raw)->map(static function (Entry $entry) use ($entries) { 47 | /** @var \Dotenv\Parser\Entry[] */ 48 | return \array_merge($entries, [$entry]); 49 | }); 50 | }); 51 | }, Success::create([])); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Parser/Value.php: -------------------------------------------------------------------------------- 1 | chars = $chars; 36 | $this->vars = $vars; 37 | } 38 | 39 | /** 40 | * Create an empty value instance. 41 | * 42 | * @return \Dotenv\Parser\Value 43 | */ 44 | public static function blank() 45 | { 46 | return new self('', []); 47 | } 48 | 49 | /** 50 | * Create a new value instance, appending the characters. 51 | * 52 | * @param string $chars 53 | * @param bool $var 54 | * 55 | * @return \Dotenv\Parser\Value 56 | */ 57 | public function append(string $chars, bool $var) 58 | { 59 | return new self( 60 | $this->chars.$chars, 61 | $var ? \array_merge($this->vars, [Str::len($this->chars)]) : $this->vars 62 | ); 63 | } 64 | 65 | /** 66 | * Get the string representation of the parsed value. 67 | * 68 | * @return string 69 | */ 70 | public function getChars() 71 | { 72 | return $this->chars; 73 | } 74 | 75 | /** 76 | * Get the locations of the variables in the value. 77 | * 78 | * @return int[] 79 | */ 80 | public function getVars() 81 | { 82 | $vars = $this->vars; 83 | 84 | \rsort($vars); 85 | 86 | return $vars; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/ArrayAdapter.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | private $variables; 18 | 19 | /** 20 | * Create a new array adapter instance. 21 | * 22 | * @return void 23 | */ 24 | private function __construct() 25 | { 26 | $this->variables = []; 27 | } 28 | 29 | /** 30 | * Create a new instance of the adapter, if it is available. 31 | * 32 | * @return \PhpOption\Option<\Dotenv\Repository\Adapter\AdapterInterface> 33 | */ 34 | public static function create() 35 | { 36 | /** @var \PhpOption\Option */ 37 | return Some::create(new self()); 38 | } 39 | 40 | /** 41 | * Read an environment variable, if it exists. 42 | * 43 | * @param non-empty-string $name 44 | * 45 | * @return \PhpOption\Option 46 | */ 47 | public function read(string $name) 48 | { 49 | return Option::fromArraysValue($this->variables, $name); 50 | } 51 | 52 | /** 53 | * Write to an environment variable, if possible. 54 | * 55 | * @param non-empty-string $name 56 | * @param string $value 57 | * 58 | * @return bool 59 | */ 60 | public function write(string $name, string $value) 61 | { 62 | $this->variables[$name] = $value; 63 | 64 | return true; 65 | } 66 | 67 | /** 68 | * Delete an environment variable, if possible. 69 | * 70 | * @param non-empty-string $name 71 | * 72 | * @return bool 73 | */ 74 | public function delete(string $name) 75 | { 76 | unset($this->variables[$name]); 77 | 78 | return true; 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Store/FileStore.php: -------------------------------------------------------------------------------- 1 | filePaths = $filePaths; 45 | $this->shortCircuit = $shortCircuit; 46 | $this->fileEncoding = $fileEncoding; 47 | } 48 | 49 | /** 50 | * Read the content of the environment file(s). 51 | * 52 | * @throws \Dotenv\Exception\InvalidEncodingException|\Dotenv\Exception\InvalidPathException 53 | * 54 | * @return string 55 | */ 56 | public function read() 57 | { 58 | if ($this->filePaths === []) { 59 | throw new InvalidPathException('At least one environment file path must be provided.'); 60 | } 61 | 62 | $contents = Reader::read($this->filePaths, $this->shortCircuit, $this->fileEncoding); 63 | 64 | if (\count($contents) > 0) { 65 | return \implode("\n", $contents); 66 | } 67 | 68 | throw new InvalidPathException( 69 | \sprintf('Unable to read any of the environment file(s) at [%s].', \implode(', ', $this->filePaths)) 70 | ); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Loader/Resolver.php: -------------------------------------------------------------------------------- 1 | getVars(), static function (string $s, int $i) use ($repository) { 41 | return Str::substr($s, 0, $i).self::resolveVariable($repository, Str::substr($s, $i)); 42 | }, $value->getChars()); 43 | } 44 | 45 | /** 46 | * Resolve a single nested variable. 47 | * 48 | * @param \Dotenv\Repository\RepositoryInterface $repository 49 | * @param string $str 50 | * 51 | * @return string 52 | */ 53 | private static function resolveVariable(RepositoryInterface $repository, string $str) 54 | { 55 | return Regex::replaceCallback( 56 | '/\A\${([a-zA-Z0-9_.]+)}/', 57 | static function (array $matches) use ($repository) { 58 | /** @var string */ 59 | return Option::fromValue($repository->get($matches[1]))->getOrElse($matches[0]); 60 | }, 61 | $str, 62 | 1 63 | )->success()->getOrElse($str); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/GuardedWriter.php: -------------------------------------------------------------------------------- 1 | writer = $writer; 34 | $this->allowList = $allowList; 35 | } 36 | 37 | /** 38 | * Write to an environment variable, if possible. 39 | * 40 | * @param non-empty-string $name 41 | * @param string $value 42 | * 43 | * @return bool 44 | */ 45 | public function write(string $name, string $value) 46 | { 47 | // Don't set non-allowed variables 48 | if (!$this->isAllowed($name)) { 49 | return false; 50 | } 51 | 52 | // Set the value on the inner writer 53 | return $this->writer->write($name, $value); 54 | } 55 | 56 | /** 57 | * Delete an environment variable, if possible. 58 | * 59 | * @param non-empty-string $name 60 | * 61 | * @return bool 62 | */ 63 | public function delete(string $name) 64 | { 65 | // Don't clear non-allowed variables 66 | if (!$this->isAllowed($name)) { 67 | return false; 68 | } 69 | 70 | // Set the value on the inner writer 71 | return $this->writer->delete($name); 72 | } 73 | 74 | /** 75 | * Determine if the given variable is allowed. 76 | * 77 | * @param non-empty-string $name 78 | * 79 | * @return bool 80 | */ 81 | private function isAllowed(string $name) 82 | { 83 | return \in_array($name, $this->allowList, true); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/PutenvAdapter.php: -------------------------------------------------------------------------------- 1 | 27 | */ 28 | public static function create() 29 | { 30 | if (self::isSupported()) { 31 | /** @var \PhpOption\Option */ 32 | return Some::create(new self()); 33 | } 34 | 35 | return None::create(); 36 | } 37 | 38 | /** 39 | * Determines if the adapter is supported. 40 | * 41 | * @return bool 42 | */ 43 | private static function isSupported() 44 | { 45 | return \function_exists('getenv') && \function_exists('putenv'); 46 | } 47 | 48 | /** 49 | * Read an environment variable, if it exists. 50 | * 51 | * @param non-empty-string $name 52 | * 53 | * @return \PhpOption\Option 54 | */ 55 | public function read(string $name) 56 | { 57 | /** @var \PhpOption\Option */ 58 | return Option::fromValue(\getenv($name), false)->filter(static function ($value) { 59 | return \is_string($value); 60 | }); 61 | } 62 | 63 | /** 64 | * Write to an environment variable, if possible. 65 | * 66 | * @param non-empty-string $name 67 | * @param string $value 68 | * 69 | * @return bool 70 | */ 71 | public function write(string $name, string $value) 72 | { 73 | \putenv("$name=$value"); 74 | 75 | return true; 76 | } 77 | 78 | /** 79 | * Delete an environment variable, if possible. 80 | * 81 | * @param non-empty-string $name 82 | * 83 | * @return bool 84 | */ 85 | public function delete(string $name) 86 | { 87 | \putenv($name); 88 | 89 | return true; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/EnvConstAdapter.php: -------------------------------------------------------------------------------- 1 | 26 | */ 27 | public static function create() 28 | { 29 | /** @var \PhpOption\Option */ 30 | return Some::create(new self()); 31 | } 32 | 33 | /** 34 | * Read an environment variable, if it exists. 35 | * 36 | * @param non-empty-string $name 37 | * 38 | * @return \PhpOption\Option 39 | */ 40 | public function read(string $name) 41 | { 42 | /** @var \PhpOption\Option */ 43 | return Option::fromArraysValue($_ENV, $name) 44 | ->filter(static function ($value) { 45 | return \is_scalar($value); 46 | }) 47 | ->map(static function ($value) { 48 | if ($value === false) { 49 | return 'false'; 50 | } 51 | 52 | if ($value === true) { 53 | return 'true'; 54 | } 55 | 56 | /** @psalm-suppress PossiblyInvalidCast */ 57 | return (string) $value; 58 | }); 59 | } 60 | 61 | /** 62 | * Write to an environment variable, if possible. 63 | * 64 | * @param non-empty-string $name 65 | * @param string $value 66 | * 67 | * @return bool 68 | */ 69 | public function write(string $name, string $value) 70 | { 71 | $_ENV[$name] = $value; 72 | 73 | return true; 74 | } 75 | 76 | /** 77 | * Delete an environment variable, if possible. 78 | * 79 | * @param non-empty-string $name 80 | * 81 | * @return bool 82 | */ 83 | public function delete(string $name) 84 | { 85 | unset($_ENV[$name]); 86 | 87 | return true; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/ServerConstAdapter.php: -------------------------------------------------------------------------------- 1 | 26 | */ 27 | public static function create() 28 | { 29 | /** @var \PhpOption\Option */ 30 | return Some::create(new self()); 31 | } 32 | 33 | /** 34 | * Read an environment variable, if it exists. 35 | * 36 | * @param non-empty-string $name 37 | * 38 | * @return \PhpOption\Option 39 | */ 40 | public function read(string $name) 41 | { 42 | /** @var \PhpOption\Option */ 43 | return Option::fromArraysValue($_SERVER, $name) 44 | ->filter(static function ($value) { 45 | return \is_scalar($value); 46 | }) 47 | ->map(static function ($value) { 48 | if ($value === false) { 49 | return 'false'; 50 | } 51 | 52 | if ($value === true) { 53 | return 'true'; 54 | } 55 | 56 | /** @psalm-suppress PossiblyInvalidCast */ 57 | return (string) $value; 58 | }); 59 | } 60 | 61 | /** 62 | * Write to an environment variable, if possible. 63 | * 64 | * @param non-empty-string $name 65 | * @param string $value 66 | * 67 | * @return bool 68 | */ 69 | public function write(string $name, string $value) 70 | { 71 | $_SERVER[$name] = $value; 72 | 73 | return true; 74 | } 75 | 76 | /** 77 | * Delete an environment variable, if possible. 78 | * 79 | * @param non-empty-string $name 80 | * 81 | * @return bool 82 | */ 83 | public function delete(string $name) 84 | { 85 | unset($_SERVER[$name]); 86 | 87 | return true; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/ApacheAdapter.php: -------------------------------------------------------------------------------- 1 | 27 | */ 28 | public static function create() 29 | { 30 | if (self::isSupported()) { 31 | /** @var \PhpOption\Option */ 32 | return Some::create(new self()); 33 | } 34 | 35 | return None::create(); 36 | } 37 | 38 | /** 39 | * Determines if the adapter is supported. 40 | * 41 | * This happens if PHP is running as an Apache module. 42 | * 43 | * @return bool 44 | */ 45 | private static function isSupported() 46 | { 47 | return \function_exists('apache_getenv') && \function_exists('apache_setenv'); 48 | } 49 | 50 | /** 51 | * Read an environment variable, if it exists. 52 | * 53 | * @param non-empty-string $name 54 | * 55 | * @return \PhpOption\Option 56 | */ 57 | public function read(string $name) 58 | { 59 | /** @var \PhpOption\Option */ 60 | return Option::fromValue(apache_getenv($name))->filter(static function ($value) { 61 | return \is_string($value) && $value !== ''; 62 | }); 63 | } 64 | 65 | /** 66 | * Write to an environment variable, if possible. 67 | * 68 | * @param non-empty-string $name 69 | * @param string $value 70 | * 71 | * @return bool 72 | */ 73 | public function write(string $name, string $value) 74 | { 75 | return apache_setenv($name, $value); 76 | } 77 | 78 | /** 79 | * Delete an environment variable, if possible. 80 | * 81 | * @param non-empty-string $name 82 | * 83 | * @return bool 84 | */ 85 | public function delete(string $name) 86 | { 87 | return apache_setenv($name, ''); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Store/File/Reader.php: -------------------------------------------------------------------------------- 1 | 42 | */ 43 | public static function read(array $filePaths, bool $shortCircuit = true, ?string $fileEncoding = null) 44 | { 45 | $output = []; 46 | 47 | foreach ($filePaths as $filePath) { 48 | $content = self::readFromFile($filePath, $fileEncoding); 49 | if ($content->isDefined()) { 50 | $output[$filePath] = $content->get(); 51 | if ($shortCircuit) { 52 | break; 53 | } 54 | } 55 | } 56 | 57 | return $output; 58 | } 59 | 60 | /** 61 | * Read the given file. 62 | * 63 | * @param string $path 64 | * @param string|null $encoding 65 | * 66 | * @throws \Dotenv\Exception\InvalidEncodingException 67 | * 68 | * @return \PhpOption\Option 69 | */ 70 | private static function readFromFile(string $path, ?string $encoding = null) 71 | { 72 | /** @var Option */ 73 | $content = Option::fromValue(@\file_get_contents($path), false); 74 | 75 | return $content->flatMap(static function (string $content) use ($encoding) { 76 | return Str::utf8($content, $encoding)->mapError(static function (string $error) { 77 | throw new InvalidEncodingException($error); 78 | })->success(); 79 | }); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php: -------------------------------------------------------------------------------- 1 | 'i̇', 5 | 'µ' => 'μ', 6 | 'ſ' => 's', 7 | 'ͅ' => 'ι', 8 | 'ς' => 'σ', 9 | 'ϐ' => 'β', 10 | 'ϑ' => 'θ', 11 | 'ϕ' => 'φ', 12 | 'ϖ' => 'π', 13 | 'ϰ' => 'κ', 14 | 'ϱ' => 'ρ', 15 | 'ϵ' => 'ε', 16 | 'ẛ' => 'ṡ', 17 | 'ι' => 'ι', 18 | 'ß' => 'ss', 19 | 'ʼn' => 'ʼn', 20 | 'ǰ' => 'ǰ', 21 | 'ΐ' => 'ΐ', 22 | 'ΰ' => 'ΰ', 23 | 'և' => 'եւ', 24 | 'ẖ' => 'ẖ', 25 | 'ẗ' => 'ẗ', 26 | 'ẘ' => 'ẘ', 27 | 'ẙ' => 'ẙ', 28 | 'ẚ' => 'aʾ', 29 | 'ẞ' => 'ss', 30 | 'ὐ' => 'ὐ', 31 | 'ὒ' => 'ὒ', 32 | 'ὔ' => 'ὔ', 33 | 'ὖ' => 'ὖ', 34 | 'ᾀ' => 'ἀι', 35 | 'ᾁ' => 'ἁι', 36 | 'ᾂ' => 'ἂι', 37 | 'ᾃ' => 'ἃι', 38 | 'ᾄ' => 'ἄι', 39 | 'ᾅ' => 'ἅι', 40 | 'ᾆ' => 'ἆι', 41 | 'ᾇ' => 'ἇι', 42 | 'ᾈ' => 'ἀι', 43 | 'ᾉ' => 'ἁι', 44 | 'ᾊ' => 'ἂι', 45 | 'ᾋ' => 'ἃι', 46 | 'ᾌ' => 'ἄι', 47 | 'ᾍ' => 'ἅι', 48 | 'ᾎ' => 'ἆι', 49 | 'ᾏ' => 'ἇι', 50 | 'ᾐ' => 'ἠι', 51 | 'ᾑ' => 'ἡι', 52 | 'ᾒ' => 'ἢι', 53 | 'ᾓ' => 'ἣι', 54 | 'ᾔ' => 'ἤι', 55 | 'ᾕ' => 'ἥι', 56 | 'ᾖ' => 'ἦι', 57 | 'ᾗ' => 'ἧι', 58 | 'ᾘ' => 'ἠι', 59 | 'ᾙ' => 'ἡι', 60 | 'ᾚ' => 'ἢι', 61 | 'ᾛ' => 'ἣι', 62 | 'ᾜ' => 'ἤι', 63 | 'ᾝ' => 'ἥι', 64 | 'ᾞ' => 'ἦι', 65 | 'ᾟ' => 'ἧι', 66 | 'ᾠ' => 'ὠι', 67 | 'ᾡ' => 'ὡι', 68 | 'ᾢ' => 'ὢι', 69 | 'ᾣ' => 'ὣι', 70 | 'ᾤ' => 'ὤι', 71 | 'ᾥ' => 'ὥι', 72 | 'ᾦ' => 'ὦι', 73 | 'ᾧ' => 'ὧι', 74 | 'ᾨ' => 'ὠι', 75 | 'ᾩ' => 'ὡι', 76 | 'ᾪ' => 'ὢι', 77 | 'ᾫ' => 'ὣι', 78 | 'ᾬ' => 'ὤι', 79 | 'ᾭ' => 'ὥι', 80 | 'ᾮ' => 'ὦι', 81 | 'ᾯ' => 'ὧι', 82 | 'ᾲ' => 'ὰι', 83 | 'ᾳ' => 'αι', 84 | 'ᾴ' => 'άι', 85 | 'ᾶ' => 'ᾶ', 86 | 'ᾷ' => 'ᾶι', 87 | 'ᾼ' => 'αι', 88 | 'ῂ' => 'ὴι', 89 | 'ῃ' => 'ηι', 90 | 'ῄ' => 'ήι', 91 | 'ῆ' => 'ῆ', 92 | 'ῇ' => 'ῆι', 93 | 'ῌ' => 'ηι', 94 | 'ῒ' => 'ῒ', 95 | 'ῖ' => 'ῖ', 96 | 'ῗ' => 'ῗ', 97 | 'ῢ' => 'ῢ', 98 | 'ῤ' => 'ῤ', 99 | 'ῦ' => 'ῦ', 100 | 'ῧ' => 'ῧ', 101 | 'ῲ' => 'ὼι', 102 | 'ῳ' => 'ωι', 103 | 'ῴ' => 'ώι', 104 | 'ῶ' => 'ῶ', 105 | 'ῷ' => 'ῶι', 106 | 'ῼ' => 'ωι', 107 | 'ff' => 'ff', 108 | 'fi' => 'fi', 109 | 'fl' => 'fl', 110 | 'ffi' => 'ffi', 111 | 'ffl' => 'ffl', 112 | 'ſt' => 'st', 113 | 'st' => 'st', 114 | 'ﬓ' => 'մն', 115 | 'ﬔ' => 'մե', 116 | 'ﬕ' => 'մի', 117 | 'ﬖ' => 'վն', 118 | 'ﬗ' => 'մխ', 119 | ]; 120 | -------------------------------------------------------------------------------- /freemius-license-installer.php: -------------------------------------------------------------------------------- 1 | 'Freemius Auto Activation', 42 | 'host' => 'github', 43 | 'slug' => 'freemius-auto-activation/freemius-auto-activation.php', 44 | 'uri' => 'https://github.com/squarecandy/freemius-auto-activation', 45 | 'branch' => 'main', 46 | 'required' => true, 47 | ], 48 | ]; 49 | add_action( 50 | 'plugins_loaded', 51 | function() use ( $config ) { 52 | WP_Dependency_Installer::instance( PLUGIN_DIR )->register( $config )->run(); 53 | } 54 | ); 55 | 56 | // Load licenses from .env file. 57 | ( Dotenv::createImmutable( dirname( PLUGIN_FILE ) ) )->load(); 58 | 59 | $fs_shortcodes = explode( ',', $_ENV['fs_shortcodes'] ); 60 | 61 | // Define constants for Freemius Auto Activation. 62 | define( 'FS_SHORTCODES', $fs_shortcodes ); 63 | foreach ( $fs_shortcodes as $fs_shortcode ) { 64 | define( 'WP__' . strtoupper( $fs_shortcode ) . '__LICENSE_KEY', $_ENV[ $fs_shortcode ] ); 65 | } 66 | 67 | register_deactivation_hook( PLUGIN_FILE, __NAMESPACE__ . '\\delete_freemius_auto_activation' ); 68 | } 69 | 70 | /** 71 | * Upon deactivation, delete freemius-auto-activation plugin. 72 | * 73 | * @return void 74 | */ 75 | function delete_freemius_auto_activation() { 76 | global $wp_filesystem; 77 | 78 | if ( ! $wp_filesystem ) { 79 | require_once ABSPATH . '/wp-admin/includes/file.php'; 80 | WP_Filesystem(); 81 | } 82 | 83 | $wp_filesystem->delete( $wp_filesystem->wp_plugins_dir() . 'freemius-auto-activation', true ); 84 | } 85 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/ReplacingWriter.php: -------------------------------------------------------------------------------- 1 | 27 | */ 28 | private $seen; 29 | 30 | /** 31 | * Create a new replacement writer instance. 32 | * 33 | * @param \Dotenv\Repository\Adapter\WriterInterface $writer 34 | * @param \Dotenv\Repository\Adapter\ReaderInterface $reader 35 | * 36 | * @return void 37 | */ 38 | public function __construct(WriterInterface $writer, ReaderInterface $reader) 39 | { 40 | $this->writer = $writer; 41 | $this->reader = $reader; 42 | $this->seen = []; 43 | } 44 | 45 | /** 46 | * Write to an environment variable, if possible. 47 | * 48 | * @param non-empty-string $name 49 | * @param string $value 50 | * 51 | * @return bool 52 | */ 53 | public function write(string $name, string $value) 54 | { 55 | if ($this->exists($name)) { 56 | return $this->writer->write($name, $value); 57 | } 58 | 59 | // succeed if nothing to do 60 | return true; 61 | } 62 | 63 | /** 64 | * Delete an environment variable, if possible. 65 | * 66 | * @param non-empty-string $name 67 | * 68 | * @return bool 69 | */ 70 | public function delete(string $name) 71 | { 72 | if ($this->exists($name)) { 73 | return $this->writer->delete($name); 74 | } 75 | 76 | // succeed if nothing to do 77 | return true; 78 | } 79 | 80 | /** 81 | * Does the given environment variable exist. 82 | * 83 | * Returns true if it currently exists, or existed at any point in the past 84 | * that we are aware of. 85 | * 86 | * @param non-empty-string $name 87 | * 88 | * @return bool 89 | */ 90 | private function exists(string $name) 91 | { 92 | if (isset($this->seen[$name])) { 93 | return true; 94 | } 95 | 96 | if ($this->reader->read($name)->isDefined()) { 97 | $this->seen[$name] = ''; 98 | 99 | return true; 100 | } 101 | 102 | return false; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/PhpToken.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Polyfill\Php80; 13 | 14 | /** 15 | * @author Fedonyuk Anton 16 | * 17 | * @internal 18 | */ 19 | class PhpToken implements \Stringable 20 | { 21 | /** 22 | * @var int 23 | */ 24 | public $id; 25 | 26 | /** 27 | * @var string 28 | */ 29 | public $text; 30 | 31 | /** 32 | * @var -1|positive-int 33 | */ 34 | public $line; 35 | 36 | /** 37 | * @var int 38 | */ 39 | public $pos; 40 | 41 | /** 42 | * @param -1|positive-int $line 43 | */ 44 | public function __construct(int $id, string $text, int $line = -1, int $position = -1) 45 | { 46 | $this->id = $id; 47 | $this->text = $text; 48 | $this->line = $line; 49 | $this->pos = $position; 50 | } 51 | 52 | public function getTokenName(): ?string 53 | { 54 | if ('UNKNOWN' === $name = token_name($this->id)) { 55 | $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; 56 | } 57 | 58 | return $name; 59 | } 60 | 61 | /** 62 | * @param int|string|array $kind 63 | */ 64 | public function is($kind): bool 65 | { 66 | foreach ((array) $kind as $value) { 67 | if (\in_array($value, [$this->id, $this->text], true)) { 68 | return true; 69 | } 70 | } 71 | 72 | return false; 73 | } 74 | 75 | public function isIgnorable(): bool 76 | { 77 | return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); 78 | } 79 | 80 | public function __toString(): string 81 | { 82 | return (string) $this->text; 83 | } 84 | 85 | /** 86 | * @return list 87 | */ 88 | public static function tokenize(string $code, int $flags = 0): array 89 | { 90 | $line = 1; 91 | $position = 0; 92 | $tokens = token_get_all($code, $flags); 93 | foreach ($tokens as $index => $token) { 94 | if (\is_string($token)) { 95 | $id = \ord($token); 96 | $text = $token; 97 | } else { 98 | [$id, $text, $line] = $token; 99 | } 100 | $tokens[$index] = new static($id, $text, $line, $position); 101 | $position += \strlen($text); 102 | } 103 | 104 | return $tokens; 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /vendor/graham-campbell/result-type/src/Success.php: -------------------------------------------------------------------------------- 1 | 9 | * 10 | * For the full copyright and license information, please view the LICENSE 11 | * file that was distributed with this source code. 12 | */ 13 | 14 | namespace GrahamCampbell\ResultType; 15 | 16 | use PhpOption\None; 17 | use PhpOption\Some; 18 | 19 | /** 20 | * @template T 21 | * @template E 22 | * 23 | * @extends \GrahamCampbell\ResultType\Result 24 | */ 25 | final class Success extends Result 26 | { 27 | /** 28 | * @var T 29 | */ 30 | private $value; 31 | 32 | /** 33 | * Internal constructor for a success value. 34 | * 35 | * @param T $value 36 | * 37 | * @return void 38 | */ 39 | private function __construct($value) 40 | { 41 | $this->value = $value; 42 | } 43 | 44 | /** 45 | * Create a new error value. 46 | * 47 | * @template S 48 | * 49 | * @param S $value 50 | * 51 | * @return \GrahamCampbell\ResultType\Result 52 | */ 53 | public static function create($value) 54 | { 55 | return new self($value); 56 | } 57 | 58 | /** 59 | * Get the success option value. 60 | * 61 | * @return \PhpOption\Option 62 | */ 63 | public function success() 64 | { 65 | return Some::create($this->value); 66 | } 67 | 68 | /** 69 | * Map over the success value. 70 | * 71 | * @template S 72 | * 73 | * @param callable(T):S $f 74 | * 75 | * @return \GrahamCampbell\ResultType\Result 76 | */ 77 | public function map(callable $f) 78 | { 79 | return self::create($f($this->value)); 80 | } 81 | 82 | /** 83 | * Flat map over the success value. 84 | * 85 | * @template S 86 | * @template F 87 | * 88 | * @param callable(T):\GrahamCampbell\ResultType\Result $f 89 | * 90 | * @return \GrahamCampbell\ResultType\Result 91 | */ 92 | public function flatMap(callable $f) 93 | { 94 | return $f($this->value); 95 | } 96 | 97 | /** 98 | * Get the error option value. 99 | * 100 | * @return \PhpOption\Option 101 | */ 102 | public function error() 103 | { 104 | return None::create(); 105 | } 106 | 107 | /** 108 | * Map over the error value. 109 | * 110 | * @template F 111 | * 112 | * @param callable(E):F $f 113 | * 114 | * @return \GrahamCampbell\ResultType\Result 115 | */ 116 | public function mapError(callable $f) 117 | { 118 | return self::create($this->value); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /vendor/graham-campbell/result-type/src/Error.php: -------------------------------------------------------------------------------- 1 | 9 | * 10 | * For the full copyright and license information, please view the LICENSE 11 | * file that was distributed with this source code. 12 | */ 13 | 14 | namespace GrahamCampbell\ResultType; 15 | 16 | use PhpOption\None; 17 | use PhpOption\Some; 18 | 19 | /** 20 | * @template T 21 | * @template E 22 | * 23 | * @extends \GrahamCampbell\ResultType\Result 24 | */ 25 | final class Error extends Result 26 | { 27 | /** 28 | * @var E 29 | */ 30 | private $value; 31 | 32 | /** 33 | * Internal constructor for an error value. 34 | * 35 | * @param E $value 36 | * 37 | * @return void 38 | */ 39 | private function __construct($value) 40 | { 41 | $this->value = $value; 42 | } 43 | 44 | /** 45 | * Create a new error value. 46 | * 47 | * @template F 48 | * 49 | * @param F $value 50 | * 51 | * @return \GrahamCampbell\ResultType\Result 52 | */ 53 | public static function create($value) 54 | { 55 | return new self($value); 56 | } 57 | 58 | /** 59 | * Get the success option value. 60 | * 61 | * @return \PhpOption\Option 62 | */ 63 | public function success() 64 | { 65 | return None::create(); 66 | } 67 | 68 | /** 69 | * Map over the success value. 70 | * 71 | * @template S 72 | * 73 | * @param callable(T):S $f 74 | * 75 | * @return \GrahamCampbell\ResultType\Result 76 | */ 77 | public function map(callable $f) 78 | { 79 | return self::create($this->value); 80 | } 81 | 82 | /** 83 | * Flat map over the success value. 84 | * 85 | * @template S 86 | * @template F 87 | * 88 | * @param callable(T):\GrahamCampbell\ResultType\Result $f 89 | * 90 | * @return \GrahamCampbell\ResultType\Result 91 | */ 92 | public function flatMap(callable $f) 93 | { 94 | /** @var \GrahamCampbell\ResultType\Result */ 95 | return self::create($this->value); 96 | } 97 | 98 | /** 99 | * Get the error option value. 100 | * 101 | * @return \PhpOption\Option 102 | */ 103 | public function error() 104 | { 105 | return Some::create($this->value); 106 | } 107 | 108 | /** 109 | * Map over the error value. 110 | * 111 | * @template F 112 | * 113 | * @param callable(E):F $f 114 | * 115 | * @return \GrahamCampbell\ResultType\Result 116 | */ 117 | public function mapError(callable $f) 118 | { 119 | return self::create($f($this->value)); 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/AdapterRepository.php: -------------------------------------------------------------------------------- 1 | reader = $reader; 38 | $this->writer = $writer; 39 | } 40 | 41 | /** 42 | * Determine if the given environment variable is defined. 43 | * 44 | * @param string $name 45 | * 46 | * @return bool 47 | */ 48 | public function has(string $name) 49 | { 50 | return '' !== $name && $this->reader->read($name)->isDefined(); 51 | } 52 | 53 | /** 54 | * Get an environment variable. 55 | * 56 | * @param string $name 57 | * 58 | * @throws \InvalidArgumentException 59 | * 60 | * @return string|null 61 | */ 62 | public function get(string $name) 63 | { 64 | if ('' === $name) { 65 | throw new InvalidArgumentException('Expected name to be a non-empty string.'); 66 | } 67 | 68 | return $this->reader->read($name)->getOrElse(null); 69 | } 70 | 71 | /** 72 | * Set an environment variable. 73 | * 74 | * @param string $name 75 | * @param string $value 76 | * 77 | * @throws \InvalidArgumentException 78 | * 79 | * @return bool 80 | */ 81 | public function set(string $name, string $value) 82 | { 83 | if ('' === $name) { 84 | throw new InvalidArgumentException('Expected name to be a non-empty string.'); 85 | } 86 | 87 | return $this->writer->write($name, $value); 88 | } 89 | 90 | /** 91 | * Clear an environment variable. 92 | * 93 | * @param string $name 94 | * 95 | * @throws \InvalidArgumentException 96 | * 97 | * @return bool 98 | */ 99 | public function clear(string $name) 100 | { 101 | if ('' === $name) { 102 | throw new InvalidArgumentException('Expected name to be a non-empty string.'); 103 | } 104 | 105 | return $this->writer->delete($name); 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/Adapter/ImmutableWriter.php: -------------------------------------------------------------------------------- 1 | 27 | */ 28 | private $loaded; 29 | 30 | /** 31 | * Create a new immutable writer instance. 32 | * 33 | * @param \Dotenv\Repository\Adapter\WriterInterface $writer 34 | * @param \Dotenv\Repository\Adapter\ReaderInterface $reader 35 | * 36 | * @return void 37 | */ 38 | public function __construct(WriterInterface $writer, ReaderInterface $reader) 39 | { 40 | $this->writer = $writer; 41 | $this->reader = $reader; 42 | $this->loaded = []; 43 | } 44 | 45 | /** 46 | * Write to an environment variable, if possible. 47 | * 48 | * @param non-empty-string $name 49 | * @param string $value 50 | * 51 | * @return bool 52 | */ 53 | public function write(string $name, string $value) 54 | { 55 | // Don't overwrite existing environment variables 56 | // Ruby's dotenv does this with `ENV[key] ||= value` 57 | if ($this->isExternallyDefined($name)) { 58 | return false; 59 | } 60 | 61 | // Set the value on the inner writer 62 | if (!$this->writer->write($name, $value)) { 63 | return false; 64 | } 65 | 66 | // Record that we have loaded the variable 67 | $this->loaded[$name] = ''; 68 | 69 | return true; 70 | } 71 | 72 | /** 73 | * Delete an environment variable, if possible. 74 | * 75 | * @param non-empty-string $name 76 | * 77 | * @return bool 78 | */ 79 | public function delete(string $name) 80 | { 81 | // Don't clear existing environment variables 82 | if ($this->isExternallyDefined($name)) { 83 | return false; 84 | } 85 | 86 | // Clear the value on the inner writer 87 | if (!$this->writer->delete($name)) { 88 | return false; 89 | } 90 | 91 | // Leave the variable as fair game 92 | unset($this->loaded[$name]); 93 | 94 | return true; 95 | } 96 | 97 | /** 98 | * Determine if the given variable is externally defined. 99 | * 100 | * That is, is it an "existing" variable. 101 | * 102 | * @param non-empty-string $name 103 | * 104 | * @return bool 105 | */ 106 | private function isExternallyDefined(string $name) 107 | { 108 | return $this->reader->read($name)->isDefined() && !isset($this->loaded[$name]); 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /vendor/afragen/wp-dependency-installer/README.md: -------------------------------------------------------------------------------- 1 | # WP Dependency Installer 2 | * Contributors: [Andy Fragen](https://github.com/afragen), [Matt Gibbs](https://github.com/mgibbs189), [Raruto](https://github.com/Raruto), [contributors](https://github.com/afragen/wp-dependency-installer/graphs/contributors) 3 | * Tags: plugin, dependency, install 4 | * Requires at least: 5.1 5 | * Requires PHP: 5.6 6 | * Stable tag: master 7 | * Donate link: 8 | * License: MIT 9 | 10 | This is a drop in class for developers to optionally or automatically install plugin dependencies for their own plugins or themes. It can install a plugin from wp.org, GitHub, Bitbucket, GitLab, Gitea, or a direct URL. 11 | 12 | [Comprehensive information regarding WP Dependency Installer is available on the wiki.](https://github.com/afragen/wp-dependency-installer/wiki) 13 | 14 | See also: [example plugin](https://github.com/afragen/wp-dependency-installer-examples). 15 | 16 | ## Description 17 | 18 | You can use **composer** to install this package within your WordPress plugin / theme. 19 | 20 | **Please ensure you are using the latest version of this framework in your `composer.json`** 21 | 22 | 1. Within your plugin or theme root folder, run the following command: 23 | 24 | ```shell 25 | composer require afragen/wp-dependency-installer 26 | ``` 27 | 28 | 2. Then create a sample [**`wp-dependencies.json`**](https://github.com/afragen/wp-dependency-installer/wiki/Configuration#json-config-file-format) file 29 | 30 | ```js 31 | [ 32 | { 33 | "name": "Git Updater", 34 | "host": "github", 35 | "slug": "git-updater/git-updater.php", 36 | "uri": "afragen/git-updater", 37 | "branch": "develop", 38 | "required": true, 39 | "token": null 40 | }, 41 | { 42 | "name": "Query Monitor", 43 | "host": "wordpress", 44 | "slug": "query-monitor/query-monitor.php", 45 | "uri": "https://wordpress.org/plugins/query-monitor/", 46 | "optional": true 47 | }, 48 | { 49 | "name": "Local Development", 50 | "host": "wordpress", 51 | "slug": "local-development/local-development.php", 52 | "uri": "https://wordpress.org/plugins/local-development/", 53 | "required": true 54 | } 55 | ] 56 | ``` 57 | 58 | You will then need to update `wp-dependencies.json` to suit your requirements. 59 | 60 | 3. Finally add the following lines to your plugin or theme's `functions.php` file: 61 | 62 | ```php 63 | require_once __DIR__ . '/vendor/autoload.php'; 64 | add_action( 'plugins_loaded', static function() { 65 | WP_Dependency_Installer::instance( __DIR__ )->run(); 66 | }); 67 | ``` 68 | 69 | `WP_Dependency_Installer` should be loaded via an action hook like `plugins_loaded` or `init` to function properly as it requires `wp-includes/pluggable.php` to be loaded for `wp_create_nonce()`. 70 | 71 | 4. (optional) Take a look at some of built in [Hooks](https://github.com/afragen/wp-dependency-installer/wiki/Actions-and-Hooks) and [Functions](https://github.com/afragen/wp-dependency-installer/wiki/Helper-Functions) to further customize your plugin look and behaviour: 72 | 73 | That's it, happy blogging! 74 | 75 | ## Development 76 | 77 | PRs are welcome against the `develop` branch. 78 | -------------------------------------------------------------------------------- /vendor/phpoption/phpoption/src/PhpOption/None.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | namespace PhpOption; 20 | 21 | use EmptyIterator; 22 | 23 | /** 24 | * @extends Option 25 | */ 26 | final class None extends Option 27 | { 28 | /** @var None|null */ 29 | private static $instance; 30 | 31 | /** 32 | * @return None 33 | */ 34 | public static function create(): self 35 | { 36 | if (null === self::$instance) { 37 | self::$instance = new self(); 38 | } 39 | 40 | return self::$instance; 41 | } 42 | 43 | public function get() 44 | { 45 | throw new \RuntimeException('None has no value.'); 46 | } 47 | 48 | public function getOrCall($callable) 49 | { 50 | return $callable(); 51 | } 52 | 53 | public function getOrElse($default) 54 | { 55 | return $default; 56 | } 57 | 58 | public function getOrThrow(\Exception $ex) 59 | { 60 | throw $ex; 61 | } 62 | 63 | public function isEmpty(): bool 64 | { 65 | return true; 66 | } 67 | 68 | public function isDefined(): bool 69 | { 70 | return false; 71 | } 72 | 73 | public function orElse(Option $else) 74 | { 75 | return $else; 76 | } 77 | 78 | public function ifDefined($callable) 79 | { 80 | // Just do nothing in that case. 81 | } 82 | 83 | public function forAll($callable) 84 | { 85 | return $this; 86 | } 87 | 88 | public function map($callable) 89 | { 90 | return $this; 91 | } 92 | 93 | public function flatMap($callable) 94 | { 95 | return $this; 96 | } 97 | 98 | public function filter($callable) 99 | { 100 | return $this; 101 | } 102 | 103 | public function filterNot($callable) 104 | { 105 | return $this; 106 | } 107 | 108 | public function select($value) 109 | { 110 | return $this; 111 | } 112 | 113 | public function reject($value) 114 | { 115 | return $this; 116 | } 117 | 118 | public function getIterator(): EmptyIterator 119 | { 120 | return new EmptyIterator(); 121 | } 122 | 123 | public function foldLeft($initialValue, $callable) 124 | { 125 | return $initialValue; 126 | } 127 | 128 | public function foldRight($initialValue, $callable) 129 | { 130 | return $initialValue; 131 | } 132 | 133 | private function __construct() 134 | { 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Util/Str.php: -------------------------------------------------------------------------------- 1 | 35 | */ 36 | public static function utf8(string $input, ?string $encoding = null) 37 | { 38 | if ($encoding !== null && !\in_array($encoding, \mb_list_encodings(), true)) { 39 | /** @var \GrahamCampbell\ResultType\Result */ 40 | return Error::create( 41 | \sprintf('Illegal character encoding [%s] specified.', $encoding) 42 | ); 43 | } 44 | 45 | $converted = $encoding === null ? 46 | @\mb_convert_encoding($input, 'UTF-8') : 47 | @\mb_convert_encoding($input, 'UTF-8', $encoding); 48 | 49 | if (!is_string($converted)) { 50 | /** @var \GrahamCampbell\ResultType\Result */ 51 | return Error::create( 52 | \sprintf('Conversion from encoding [%s] failed.', $encoding ?? 'NULL') 53 | ); 54 | } 55 | 56 | /** 57 | * this is for support UTF-8 with BOM encoding 58 | * @see https://en.wikipedia.org/wiki/Byte_order_mark 59 | * @see https://github.com/vlucas/phpdotenv/issues/500 60 | */ 61 | if (\substr($converted, 0, 3) == "\xEF\xBB\xBF") { 62 | $converted = \substr($converted, 3); 63 | } 64 | 65 | /** @var \GrahamCampbell\ResultType\Result */ 66 | return Success::create($converted); 67 | } 68 | 69 | /** 70 | * Search for a given substring of the input. 71 | * 72 | * @param string $haystack 73 | * @param string $needle 74 | * 75 | * @return \PhpOption\Option 76 | */ 77 | public static function pos(string $haystack, string $needle) 78 | { 79 | /** @var \PhpOption\Option */ 80 | return Option::fromValue(\mb_strpos($haystack, $needle, 0, 'UTF-8'), false); 81 | } 82 | 83 | /** 84 | * Grab the specified substring of the input. 85 | * 86 | * @param string $input 87 | * @param int $start 88 | * @param int|null $length 89 | * 90 | * @return string 91 | */ 92 | public static function substr(string $input, int $start, ?int $length = null) 93 | { 94 | return \mb_substr($input, $start, $length, 'UTF-8'); 95 | } 96 | 97 | /** 98 | * Compute the length of the given string. 99 | * 100 | * @param string $input 101 | * 102 | * @return int 103 | */ 104 | public static function len(string $input) 105 | { 106 | return \mb_strlen($input, 'UTF-8'); 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /vendor/composer/autoload_static.php: -------------------------------------------------------------------------------- 1 | __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', 11 | '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', 12 | 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', 13 | ); 14 | 15 | public static $prefixLengthsPsr4 = array ( 16 | 'S' => 17 | array ( 18 | 'Symfony\\Polyfill\\Php80\\' => 23, 19 | 'Symfony\\Polyfill\\Mbstring\\' => 26, 20 | 'Symfony\\Polyfill\\Ctype\\' => 23, 21 | ), 22 | 'P' => 23 | array ( 24 | 'PhpOption\\' => 10, 25 | ), 26 | 'G' => 27 | array ( 28 | 'GrahamCampbell\\ResultType\\' => 26, 29 | ), 30 | 'D' => 31 | array ( 32 | 'Dotenv\\' => 7, 33 | ), 34 | ); 35 | 36 | public static $prefixDirsPsr4 = array ( 37 | 'Symfony\\Polyfill\\Php80\\' => 38 | array ( 39 | 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', 40 | ), 41 | 'Symfony\\Polyfill\\Mbstring\\' => 42 | array ( 43 | 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', 44 | ), 45 | 'Symfony\\Polyfill\\Ctype\\' => 46 | array ( 47 | 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype', 48 | ), 49 | 'PhpOption\\' => 50 | array ( 51 | 0 => __DIR__ . '/..' . '/phpoption/phpoption/src/PhpOption', 52 | ), 53 | 'GrahamCampbell\\ResultType\\' => 54 | array ( 55 | 0 => __DIR__ . '/..' . '/graham-campbell/result-type/src', 56 | ), 57 | 'Dotenv\\' => 58 | array ( 59 | 0 => __DIR__ . '/..' . '/vlucas/phpdotenv/src', 60 | ), 61 | ); 62 | 63 | public static $classMap = array ( 64 | 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 65 | 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 66 | 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 67 | 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 68 | 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', 69 | 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', 70 | 'WP_Dependency_Installer' => __DIR__ . '/..' . '/afragen/wp-dependency-installer/wp-dependency-installer.php', 71 | 'WP_Dependency_Installer_Skin' => __DIR__ . '/..' . '/afragen/wp-dependency-installer/wp-dependency-installer-skin.php', 72 | 'WP_Dismiss_Notice' => __DIR__ . '/..' . '/afragen/wp-dismiss-notice/wp-dismiss-notice.php', 73 | ); 74 | 75 | public static function getInitializer(ClassLoader $loader) 76 | { 77 | return \Closure::bind(function () use ($loader) { 78 | $loader->prefixLengthsPsr4 = ComposerStaticInitd270377834bfdde1328c10b0ad602c8f::$prefixLengthsPsr4; 79 | $loader->prefixDirsPsr4 = ComposerStaticInitd270377834bfdde1328c10b0ad602c8f::$prefixDirsPsr4; 80 | $loader->classMap = ComposerStaticInitd270377834bfdde1328c10b0ad602c8f::$classMap; 81 | 82 | }, null, ClassLoader::class); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Util/Regex.php: -------------------------------------------------------------------------------- 1 | 34 | */ 35 | public static function matches(string $pattern, string $subject) 36 | { 37 | return self::pregAndWrap(static function (string $subject) use ($pattern) { 38 | return @\preg_match($pattern, $subject) === 1; 39 | }, $subject); 40 | } 41 | 42 | /** 43 | * Perform a preg match all, wrapping up the result. 44 | * 45 | * @param string $pattern 46 | * @param string $subject 47 | * 48 | * @return \GrahamCampbell\ResultType\Result 49 | */ 50 | public static function occurrences(string $pattern, string $subject) 51 | { 52 | return self::pregAndWrap(static function (string $subject) use ($pattern) { 53 | return (int) @\preg_match_all($pattern, $subject); 54 | }, $subject); 55 | } 56 | 57 | /** 58 | * Perform a preg replace callback, wrapping up the result. 59 | * 60 | * @param string $pattern 61 | * @param callable(string[]): string $callback 62 | * @param string $subject 63 | * @param int|null $limit 64 | * 65 | * @return \GrahamCampbell\ResultType\Result 66 | */ 67 | public static function replaceCallback(string $pattern, callable $callback, string $subject, ?int $limit = null) 68 | { 69 | return self::pregAndWrap(static function (string $subject) use ($pattern, $callback, $limit) { 70 | return (string) @\preg_replace_callback($pattern, $callback, $subject, $limit ?? -1); 71 | }, $subject); 72 | } 73 | 74 | /** 75 | * Perform a preg split, wrapping up the result. 76 | * 77 | * @param string $pattern 78 | * @param string $subject 79 | * 80 | * @return \GrahamCampbell\ResultType\Result 81 | */ 82 | public static function split(string $pattern, string $subject) 83 | { 84 | return self::pregAndWrap(static function (string $subject) use ($pattern) { 85 | /** @var string[] */ 86 | return (array) @\preg_split($pattern, $subject); 87 | }, $subject); 88 | } 89 | 90 | /** 91 | * Perform a preg operation, wrapping up the result. 92 | * 93 | * @template V 94 | * 95 | * @param callable(string): V $operation 96 | * @param string $subject 97 | * 98 | * @return \GrahamCampbell\ResultType\Result 99 | */ 100 | private static function pregAndWrap(callable $operation, string $subject) 101 | { 102 | $result = $operation($subject); 103 | 104 | if (\preg_last_error() !== \PREG_NO_ERROR) { 105 | /** @var \GrahamCampbell\ResultType\Result */ 106 | return Error::create(\preg_last_error_msg()); 107 | } 108 | 109 | /** @var \GrahamCampbell\ResultType\Result */ 110 | return Success::create($result); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Parser/Lines.php: -------------------------------------------------------------------------------- 1 | map(static function () use ($line) { 91 | return self::looksLikeMultilineStop($line, true) === false; 92 | })->getOrElse(false); 93 | } 94 | 95 | /** 96 | * Determine if the given line can be the start of a multiline variable. 97 | * 98 | * @param string $line 99 | * @param bool $started 100 | * 101 | * @return bool 102 | */ 103 | private static function looksLikeMultilineStop(string $line, bool $started) 104 | { 105 | if ($line === '"') { 106 | return true; 107 | } 108 | 109 | return Regex::occurrences('/(?=([^\\\\]"))/', \str_replace('\\\\', '', $line))->map(static function (int $count) use ($started) { 110 | return $started ? $count > 1 : $count >= 1; 111 | })->success()->getOrElse(false); 112 | } 113 | 114 | /** 115 | * Determine if the line in the file is a comment or whitespace. 116 | * 117 | * @param string $line 118 | * 119 | * @return bool 120 | */ 121 | private static function isCommentOrWhitespace(string $line) 122 | { 123 | $line = \trim($line); 124 | 125 | return $line === '' || (isset($line[0]) && $line[0] === '#'); 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Store/StoreBuilder.php: -------------------------------------------------------------------------------- 1 | paths = $paths; 57 | $this->names = $names; 58 | $this->shortCircuit = $shortCircuit; 59 | $this->fileEncoding = $fileEncoding; 60 | } 61 | 62 | /** 63 | * Create a new store builder instance with no names. 64 | * 65 | * @return \Dotenv\Store\StoreBuilder 66 | */ 67 | public static function createWithNoNames() 68 | { 69 | return new self(); 70 | } 71 | 72 | /** 73 | * Create a new store builder instance with the default name. 74 | * 75 | * @return \Dotenv\Store\StoreBuilder 76 | */ 77 | public static function createWithDefaultName() 78 | { 79 | return new self([], [self::DEFAULT_NAME]); 80 | } 81 | 82 | /** 83 | * Creates a store builder with the given path added. 84 | * 85 | * @param string $path 86 | * 87 | * @return \Dotenv\Store\StoreBuilder 88 | */ 89 | public function addPath(string $path) 90 | { 91 | return new self(\array_merge($this->paths, [$path]), $this->names, $this->shortCircuit, $this->fileEncoding); 92 | } 93 | 94 | /** 95 | * Creates a store builder with the given name added. 96 | * 97 | * @param string $name 98 | * 99 | * @return \Dotenv\Store\StoreBuilder 100 | */ 101 | public function addName(string $name) 102 | { 103 | return new self($this->paths, \array_merge($this->names, [$name]), $this->shortCircuit, $this->fileEncoding); 104 | } 105 | 106 | /** 107 | * Creates a store builder with short circuit mode enabled. 108 | * 109 | * @return \Dotenv\Store\StoreBuilder 110 | */ 111 | public function shortCircuit() 112 | { 113 | return new self($this->paths, $this->names, true, $this->fileEncoding); 114 | } 115 | 116 | /** 117 | * Creates a store builder with the specified file encoding. 118 | * 119 | * @param string|null $fileEncoding 120 | * 121 | * @return \Dotenv\Store\StoreBuilder 122 | */ 123 | public function fileEncoding(?string $fileEncoding = null) 124 | { 125 | return new self($this->paths, $this->names, $this->shortCircuit, $fileEncoding); 126 | } 127 | 128 | /** 129 | * Creates a new store instance. 130 | * 131 | * @return \Dotenv\Store\StoreInterface 132 | */ 133 | public function make() 134 | { 135 | return new FileStore( 136 | Paths::filePaths($this->paths, $this->names), 137 | $this->shortCircuit, 138 | $this->fileEncoding 139 | ); 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-php80/Php80.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Polyfill\Php80; 13 | 14 | /** 15 | * @author Ion Bazan 16 | * @author Nico Oelgart 17 | * @author Nicolas Grekas 18 | * 19 | * @internal 20 | */ 21 | final class Php80 22 | { 23 | public static function fdiv(float $dividend, float $divisor): float 24 | { 25 | return @($dividend / $divisor); 26 | } 27 | 28 | public static function get_debug_type($value): string 29 | { 30 | switch (true) { 31 | case null === $value: return 'null'; 32 | case \is_bool($value): return 'bool'; 33 | case \is_string($value): return 'string'; 34 | case \is_array($value): return 'array'; 35 | case \is_int($value): return 'int'; 36 | case \is_float($value): return 'float'; 37 | case \is_object($value): break; 38 | case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; 39 | default: 40 | if (null === $type = @get_resource_type($value)) { 41 | return 'unknown'; 42 | } 43 | 44 | if ('Unknown' === $type) { 45 | $type = 'closed'; 46 | } 47 | 48 | return "resource ($type)"; 49 | } 50 | 51 | $class = \get_class($value); 52 | 53 | if (false === strpos($class, '@')) { 54 | return $class; 55 | } 56 | 57 | return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; 58 | } 59 | 60 | public static function get_resource_id($res): int 61 | { 62 | if (!\is_resource($res) && null === @get_resource_type($res)) { 63 | throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); 64 | } 65 | 66 | return (int) $res; 67 | } 68 | 69 | public static function preg_last_error_msg(): string 70 | { 71 | switch (preg_last_error()) { 72 | case \PREG_INTERNAL_ERROR: 73 | return 'Internal error'; 74 | case \PREG_BAD_UTF8_ERROR: 75 | return 'Malformed UTF-8 characters, possibly incorrectly encoded'; 76 | case \PREG_BAD_UTF8_OFFSET_ERROR: 77 | return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; 78 | case \PREG_BACKTRACK_LIMIT_ERROR: 79 | return 'Backtrack limit exhausted'; 80 | case \PREG_RECURSION_LIMIT_ERROR: 81 | return 'Recursion limit exhausted'; 82 | case \PREG_JIT_STACKLIMIT_ERROR: 83 | return 'JIT stack limit exhausted'; 84 | case \PREG_NO_ERROR: 85 | return 'No error'; 86 | default: 87 | return 'Unknown error'; 88 | } 89 | } 90 | 91 | public static function str_contains(string $haystack, string $needle): bool 92 | { 93 | return '' === $needle || false !== strpos($haystack, $needle); 94 | } 95 | 96 | public static function str_starts_with(string $haystack, string $needle): bool 97 | { 98 | return 0 === strncmp($haystack, $needle, \strlen($needle)); 99 | } 100 | 101 | public static function str_ends_with(string $haystack, string $needle): bool 102 | { 103 | if ('' === $needle || $needle === $haystack) { 104 | return true; 105 | } 106 | 107 | if ('' === $haystack) { 108 | return false; 109 | } 110 | 111 | $needleLength = \strlen($needle); 112 | 113 | return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength); 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /vendor/composer/installed.php: -------------------------------------------------------------------------------- 1 | array( 3 | 'name' => 'afragen/freemius-license-installer', 4 | 'pretty_version' => 'dev-main', 5 | 'version' => 'dev-main', 6 | 'reference' => 'dc96a910f7b469b060c37916dc5b506c9ddd274b', 7 | 'type' => 'wordpress-plugin', 8 | 'install_path' => __DIR__ . '/../../', 9 | 'aliases' => array(), 10 | 'dev' => true, 11 | ), 12 | 'versions' => array( 13 | 'afragen/freemius-license-installer' => array( 14 | 'pretty_version' => 'dev-main', 15 | 'version' => 'dev-main', 16 | 'reference' => 'dc96a910f7b469b060c37916dc5b506c9ddd274b', 17 | 'type' => 'wordpress-plugin', 18 | 'install_path' => __DIR__ . '/../../', 19 | 'aliases' => array(), 20 | 'dev_requirement' => false, 21 | ), 22 | 'afragen/wp-dependency-installer' => array( 23 | 'pretty_version' => '4.3.14', 24 | 'version' => '4.3.14.0', 25 | 'reference' => '38f127feeaeb1cfc8544c120d4e9e372fa41f79e', 26 | 'type' => 'library', 27 | 'install_path' => __DIR__ . '/../afragen/wp-dependency-installer', 28 | 'aliases' => array(), 29 | 'dev_requirement' => false, 30 | ), 31 | 'afragen/wp-dismiss-notice' => array( 32 | 'pretty_version' => '0.3.7', 33 | 'version' => '0.3.7.0', 34 | 'reference' => '3e2c694ca891fe94771457f54a3a5457a70c0aec', 35 | 'type' => 'library', 36 | 'install_path' => __DIR__ . '/../afragen/wp-dismiss-notice', 37 | 'aliases' => array(), 38 | 'dev_requirement' => false, 39 | ), 40 | 'graham-campbell/result-type' => array( 41 | 'pretty_version' => 'v1.1.3', 42 | 'version' => '1.1.3.0', 43 | 'reference' => '3ba905c11371512af9d9bdd27d99b782216b6945', 44 | 'type' => 'library', 45 | 'install_path' => __DIR__ . '/../graham-campbell/result-type', 46 | 'aliases' => array(), 47 | 'dev_requirement' => false, 48 | ), 49 | 'phpoption/phpoption' => array( 50 | 'pretty_version' => '1.9.3', 51 | 'version' => '1.9.3.0', 52 | 'reference' => 'e3fac8b24f56113f7cb96af14958c0dd16330f54', 53 | 'type' => 'library', 54 | 'install_path' => __DIR__ . '/../phpoption/phpoption', 55 | 'aliases' => array(), 56 | 'dev_requirement' => false, 57 | ), 58 | 'symfony/polyfill-ctype' => array( 59 | 'pretty_version' => 'v1.32.0', 60 | 'version' => '1.32.0.0', 61 | 'reference' => 'a3cc8b044a6ea513310cbd48ef7333b384945638', 62 | 'type' => 'library', 63 | 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', 64 | 'aliases' => array(), 65 | 'dev_requirement' => false, 66 | ), 67 | 'symfony/polyfill-mbstring' => array( 68 | 'pretty_version' => 'v1.32.0', 69 | 'version' => '1.32.0.0', 70 | 'reference' => '6d857f4d76bd4b343eac26d6b539585d2bc56493', 71 | 'type' => 'library', 72 | 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 73 | 'aliases' => array(), 74 | 'dev_requirement' => false, 75 | ), 76 | 'symfony/polyfill-php80' => array( 77 | 'pretty_version' => 'v1.32.0', 78 | 'version' => '1.32.0.0', 79 | 'reference' => '0cc9dd0f17f61d8131e7df6b84bd344899fe2608', 80 | 'type' => 'library', 81 | 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 82 | 'aliases' => array(), 83 | 'dev_requirement' => false, 84 | ), 85 | 'vlucas/phpdotenv' => array( 86 | 'pretty_version' => 'v5.6.2', 87 | 'version' => '5.6.2.0', 88 | 'reference' => '24ac4c74f91ee2c193fa1aaa5c249cb0822809af', 89 | 'type' => 'library', 90 | 'install_path' => __DIR__ . '/../vlucas/phpdotenv', 91 | 'aliases' => array(), 92 | 'dev_requirement' => false, 93 | ), 94 | ), 95 | ); 96 | -------------------------------------------------------------------------------- /vendor/phpoption/phpoption/src/PhpOption/Some.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | namespace PhpOption; 20 | 21 | use ArrayIterator; 22 | 23 | /** 24 | * @template T 25 | * 26 | * @extends Option 27 | */ 28 | final class Some extends Option 29 | { 30 | /** @var T */ 31 | private $value; 32 | 33 | /** 34 | * @param T $value 35 | */ 36 | public function __construct($value) 37 | { 38 | $this->value = $value; 39 | } 40 | 41 | /** 42 | * @template U 43 | * 44 | * @param U $value 45 | * 46 | * @return Some 47 | */ 48 | public static function create($value): self 49 | { 50 | return new self($value); 51 | } 52 | 53 | public function isDefined(): bool 54 | { 55 | return true; 56 | } 57 | 58 | public function isEmpty(): bool 59 | { 60 | return false; 61 | } 62 | 63 | public function get() 64 | { 65 | return $this->value; 66 | } 67 | 68 | public function getOrElse($default) 69 | { 70 | return $this->value; 71 | } 72 | 73 | public function getOrCall($callable) 74 | { 75 | return $this->value; 76 | } 77 | 78 | public function getOrThrow(\Exception $ex) 79 | { 80 | return $this->value; 81 | } 82 | 83 | public function orElse(Option $else) 84 | { 85 | return $this; 86 | } 87 | 88 | public function ifDefined($callable) 89 | { 90 | $this->forAll($callable); 91 | } 92 | 93 | public function forAll($callable) 94 | { 95 | $callable($this->value); 96 | 97 | return $this; 98 | } 99 | 100 | public function map($callable) 101 | { 102 | return new self($callable($this->value)); 103 | } 104 | 105 | public function flatMap($callable) 106 | { 107 | /** @var mixed */ 108 | $rs = $callable($this->value); 109 | if (!$rs instanceof Option) { 110 | throw new \RuntimeException('Callables passed to flatMap() must return an Option. Maybe you should use map() instead?'); 111 | } 112 | 113 | return $rs; 114 | } 115 | 116 | public function filter($callable) 117 | { 118 | if (true === $callable($this->value)) { 119 | return $this; 120 | } 121 | 122 | return None::create(); 123 | } 124 | 125 | public function filterNot($callable) 126 | { 127 | if (false === $callable($this->value)) { 128 | return $this; 129 | } 130 | 131 | return None::create(); 132 | } 133 | 134 | public function select($value) 135 | { 136 | if ($this->value === $value) { 137 | return $this; 138 | } 139 | 140 | return None::create(); 141 | } 142 | 143 | public function reject($value) 144 | { 145 | if ($this->value === $value) { 146 | return None::create(); 147 | } 148 | 149 | return $this; 150 | } 151 | 152 | /** 153 | * @return ArrayIterator 154 | */ 155 | public function getIterator(): ArrayIterator 156 | { 157 | return new ArrayIterator([$this->value]); 158 | } 159 | 160 | public function foldLeft($initialValue, $callable) 161 | { 162 | return $callable($initialValue, $this->value); 163 | } 164 | 165 | public function foldRight($initialValue, $callable) 166 | { 167 | return $callable($this->value, $initialValue); 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /vendor/afragen/wp-dismiss-notice/wp-dismiss-notice.php: -------------------------------------------------------------------------------- 1 | version; 33 | 34 | /** 35 | * Filter composer.json vendor directory. 36 | * Some people don't use the standard vendor directory. 37 | * 38 | * @param string Composer vendor directory. 39 | */ 40 | $vendor_dir = apply_filters( 'dismiss_notice_vendor_dir', '/vendor' ); 41 | $composer_js_path = untrailingslashit( $vendor_dir ) . '/afragen/wp-dismiss-notice/js/dismiss-notice.js'; 42 | 43 | $theme_js_url = get_theme_file_uri( $composer_js_path ); 44 | $theme_js_file = parse_url( $theme_js_url, PHP_URL_PATH ); 45 | 46 | if ( file_exists( ABSPATH . $theme_js_file ) ) { 47 | $js_url = $theme_js_url; 48 | } 49 | 50 | if ( '/vendor' !== $vendor_dir ) { 51 | $js_url = home_url( $composer_js_path ); 52 | } 53 | 54 | wp_enqueue_script( 55 | 'dismissible-notices', 56 | $js_url, 57 | [ 'jquery', 'common' ], 58 | $version, 59 | true 60 | ); 61 | 62 | wp_localize_script( 63 | 'dismissible-notices', 64 | 'wp_dismiss_notice', 65 | [ 66 | 'nonce' => wp_create_nonce( 'wp-dismiss-notice' ), 67 | 'ajaxurl' => admin_url( 'admin-ajax.php' ), 68 | ] 69 | ); 70 | } 71 | 72 | /** 73 | * Handles Ajax request to persist notices dismissal. 74 | * Uses check_ajax_referer to verify nonce. 75 | */ 76 | public static function dismiss_admin_notice() { 77 | $option_name = isset( $_POST['option_name'] ) ? sanitize_text_field( wp_unslash( $_POST['option_name'] ) ) : false; 78 | $dismissible_length = isset( $_POST['dismissible_length'] ) ? sanitize_text_field( wp_unslash( $_POST['dismissible_length'] ) ) : 14; 79 | 80 | if ( 'forever' !== $dismissible_length ) { 81 | // If $dismissible_length is not an integer default to 14. 82 | $dismissible_length = ( 0 === absint( $dismissible_length ) ) ? 14 : $dismissible_length; 83 | $dismissible_length = strtotime( absint( $dismissible_length ) . ' days' ); 84 | } 85 | 86 | check_ajax_referer( 'wp-dismiss-notice', 'nonce' ); 87 | self::set_admin_notice_cache( $option_name, $dismissible_length ); 88 | wp_die(); 89 | } 90 | 91 | /** 92 | * Is admin notice active? 93 | * 94 | * @param string $arg data-dismissible content of notice. 95 | * 96 | * @return bool 97 | */ 98 | public static function is_admin_notice_active( $arg ) { 99 | $array = explode( '-', $arg ); 100 | array_pop( $array ); 101 | $option_name = implode( '-', $array ); 102 | $db_record = self::get_admin_notice_cache( $option_name ); 103 | 104 | if ( 'forever' === $db_record ) { 105 | return false; 106 | } elseif ( absint( $db_record ) >= time() ) { 107 | return false; 108 | } else { 109 | return true; 110 | } 111 | } 112 | 113 | /** 114 | * Returns admin notice cached timeout. 115 | * 116 | * @access public 117 | * 118 | * @param string|bool $id admin notice name or false. 119 | * 120 | * @return array|bool The timeout. False if expired. 121 | */ 122 | public static function get_admin_notice_cache( $id = false ) { 123 | if ( ! $id ) { 124 | return false; 125 | } 126 | $cache_key = 'wpdn-' . md5( $id ); 127 | $timeout = get_site_option( $cache_key ); 128 | $timeout = 'forever' === $timeout ? time() + 60 : $timeout; 129 | 130 | if ( empty( $timeout ) || time() > $timeout ) { 131 | return false; 132 | } 133 | 134 | return $timeout; 135 | } 136 | 137 | /** 138 | * Sets admin notice timeout in site option. 139 | * 140 | * @access public 141 | * 142 | * @param string $id Data Identifier. 143 | * @param string|bool $timeout Timeout for admin notice. 144 | * 145 | * @return bool 146 | */ 147 | public static function set_admin_notice_cache( $id, $timeout ) { 148 | $cache_key = 'wpdn-' . md5( $id ); 149 | update_site_option( $cache_key, $timeout ); 150 | 151 | return true; 152 | } 153 | } 154 | 155 | // Initialize. 156 | add_action( 'admin_init', [ 'WP_Dismiss_Notice', 'init' ] ); 157 | -------------------------------------------------------------------------------- /vendor/phpoption/phpoption/src/PhpOption/LazyOption.php: -------------------------------------------------------------------------------- 1 | 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | namespace PhpOption; 20 | 21 | use Traversable; 22 | 23 | /** 24 | * @template T 25 | * 26 | * @extends Option 27 | */ 28 | final class LazyOption extends Option 29 | { 30 | /** @var callable(mixed...):(Option) */ 31 | private $callback; 32 | 33 | /** @var array */ 34 | private $arguments; 35 | 36 | /** @var Option|null */ 37 | private $option; 38 | 39 | /** 40 | * @template S 41 | * @param callable(mixed...):(Option) $callback 42 | * @param array $arguments 43 | * 44 | * @return LazyOption 45 | */ 46 | public static function create($callback, array $arguments = []): self 47 | { 48 | return new self($callback, $arguments); 49 | } 50 | 51 | /** 52 | * @param callable(mixed...):(Option) $callback 53 | * @param array $arguments 54 | */ 55 | public function __construct($callback, array $arguments = []) 56 | { 57 | if (!is_callable($callback)) { 58 | throw new \InvalidArgumentException('Invalid callback given'); 59 | } 60 | 61 | $this->callback = $callback; 62 | $this->arguments = $arguments; 63 | } 64 | 65 | public function isDefined(): bool 66 | { 67 | return $this->option()->isDefined(); 68 | } 69 | 70 | public function isEmpty(): bool 71 | { 72 | return $this->option()->isEmpty(); 73 | } 74 | 75 | public function get() 76 | { 77 | return $this->option()->get(); 78 | } 79 | 80 | public function getOrElse($default) 81 | { 82 | return $this->option()->getOrElse($default); 83 | } 84 | 85 | public function getOrCall($callable) 86 | { 87 | return $this->option()->getOrCall($callable); 88 | } 89 | 90 | public function getOrThrow(\Exception $ex) 91 | { 92 | return $this->option()->getOrThrow($ex); 93 | } 94 | 95 | public function orElse(Option $else) 96 | { 97 | return $this->option()->orElse($else); 98 | } 99 | 100 | public function ifDefined($callable) 101 | { 102 | $this->option()->forAll($callable); 103 | } 104 | 105 | public function forAll($callable) 106 | { 107 | return $this->option()->forAll($callable); 108 | } 109 | 110 | public function map($callable) 111 | { 112 | return $this->option()->map($callable); 113 | } 114 | 115 | public function flatMap($callable) 116 | { 117 | return $this->option()->flatMap($callable); 118 | } 119 | 120 | public function filter($callable) 121 | { 122 | return $this->option()->filter($callable); 123 | } 124 | 125 | public function filterNot($callable) 126 | { 127 | return $this->option()->filterNot($callable); 128 | } 129 | 130 | public function select($value) 131 | { 132 | return $this->option()->select($value); 133 | } 134 | 135 | public function reject($value) 136 | { 137 | return $this->option()->reject($value); 138 | } 139 | 140 | /** 141 | * @return Traversable 142 | */ 143 | public function getIterator(): Traversable 144 | { 145 | return $this->option()->getIterator(); 146 | } 147 | 148 | public function foldLeft($initialValue, $callable) 149 | { 150 | return $this->option()->foldLeft($initialValue, $callable); 151 | } 152 | 153 | public function foldRight($initialValue, $callable) 154 | { 155 | return $this->option()->foldRight($initialValue, $callable); 156 | } 157 | 158 | /** 159 | * @return Option 160 | */ 161 | private function option(): Option 162 | { 163 | if (null === $this->option) { 164 | /** @var mixed */ 165 | $option = call_user_func_array($this->callback, $this->arguments); 166 | if ($option instanceof Option) { 167 | $this->option = $option; 168 | } else { 169 | throw new \RuntimeException(sprintf('Expected instance of %s', Option::class)); 170 | } 171 | } 172 | 173 | return $this->option; 174 | } 175 | } 176 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php: -------------------------------------------------------------------------------- 1 | repository = $repository; 39 | $this->variables = $variables; 40 | } 41 | 42 | /** 43 | * Assert that each variable is present. 44 | * 45 | * @throws \Dotenv\Exception\ValidationException 46 | * 47 | * @return \Dotenv\Validator 48 | */ 49 | public function required() 50 | { 51 | return $this->assert( 52 | static function (?string $value) { 53 | return $value !== null; 54 | }, 55 | 'is missing' 56 | ); 57 | } 58 | 59 | /** 60 | * Assert that each variable is not empty. 61 | * 62 | * @throws \Dotenv\Exception\ValidationException 63 | * 64 | * @return \Dotenv\Validator 65 | */ 66 | public function notEmpty() 67 | { 68 | return $this->assertNullable( 69 | static function (string $value) { 70 | return Str::len(\trim($value)) > 0; 71 | }, 72 | 'is empty' 73 | ); 74 | } 75 | 76 | /** 77 | * Assert that each specified variable is an integer. 78 | * 79 | * @throws \Dotenv\Exception\ValidationException 80 | * 81 | * @return \Dotenv\Validator 82 | */ 83 | public function isInteger() 84 | { 85 | return $this->assertNullable( 86 | static function (string $value) { 87 | return \ctype_digit($value); 88 | }, 89 | 'is not an integer' 90 | ); 91 | } 92 | 93 | /** 94 | * Assert that each specified variable is a boolean. 95 | * 96 | * @throws \Dotenv\Exception\ValidationException 97 | * 98 | * @return \Dotenv\Validator 99 | */ 100 | public function isBoolean() 101 | { 102 | return $this->assertNullable( 103 | static function (string $value) { 104 | if ($value === '') { 105 | return false; 106 | } 107 | 108 | return \filter_var($value, \FILTER_VALIDATE_BOOLEAN, \FILTER_NULL_ON_FAILURE) !== null; 109 | }, 110 | 'is not a boolean' 111 | ); 112 | } 113 | 114 | /** 115 | * Assert that each variable is amongst the given choices. 116 | * 117 | * @param string[] $choices 118 | * 119 | * @throws \Dotenv\Exception\ValidationException 120 | * 121 | * @return \Dotenv\Validator 122 | */ 123 | public function allowedValues(array $choices) 124 | { 125 | return $this->assertNullable( 126 | static function (string $value) use ($choices) { 127 | return \in_array($value, $choices, true); 128 | }, 129 | \sprintf('is not one of [%s]', \implode(', ', $choices)) 130 | ); 131 | } 132 | 133 | /** 134 | * Assert that each variable matches the given regular expression. 135 | * 136 | * @param string $regex 137 | * 138 | * @throws \Dotenv\Exception\ValidationException 139 | * 140 | * @return \Dotenv\Validator 141 | */ 142 | public function allowedRegexValues(string $regex) 143 | { 144 | return $this->assertNullable( 145 | static function (string $value) use ($regex) { 146 | return Regex::matches($regex, $value)->success()->getOrElse(false); 147 | }, 148 | \sprintf('does not match "%s"', $regex) 149 | ); 150 | } 151 | 152 | /** 153 | * Assert that the callback returns true for each variable. 154 | * 155 | * @param callable(?string):bool $callback 156 | * @param string $message 157 | * 158 | * @throws \Dotenv\Exception\ValidationException 159 | * 160 | * @return \Dotenv\Validator 161 | */ 162 | public function assert(callable $callback, string $message) 163 | { 164 | $failing = []; 165 | 166 | foreach ($this->variables as $variable) { 167 | if ($callback($this->repository->get($variable)) === false) { 168 | $failing[] = \sprintf('%s %s', $variable, $message); 169 | } 170 | } 171 | 172 | if (\count($failing) > 0) { 173 | throw new ValidationException(\sprintf( 174 | 'One or more environment variables failed assertions: %s.', 175 | \implode(', ', $failing) 176 | )); 177 | } 178 | 179 | return $this; 180 | } 181 | 182 | /** 183 | * Assert that the callback returns true for each variable. 184 | * 185 | * Skip checking null variable values. 186 | * 187 | * @param callable(string):bool $callback 188 | * @param string $message 189 | * 190 | * @throws \Dotenv\Exception\ValidationException 191 | * 192 | * @return \Dotenv\Validator 193 | */ 194 | public function assertNullable(callable $callback, string $message) 195 | { 196 | return $this->assert( 197 | static function (?string $value) use ($callback) { 198 | if ($value === null) { 199 | return true; 200 | } 201 | 202 | return $callback($value); 203 | }, 204 | $message 205 | ); 206 | } 207 | } 208 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-ctype/Ctype.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Symfony\Polyfill\Ctype; 13 | 14 | /** 15 | * Ctype implementation through regex. 16 | * 17 | * @internal 18 | * 19 | * @author Gert de Pagter 20 | */ 21 | final class Ctype 22 | { 23 | /** 24 | * Returns TRUE if every character in text is either a letter or a digit, FALSE otherwise. 25 | * 26 | * @see https://php.net/ctype-alnum 27 | * 28 | * @param mixed $text 29 | * 30 | * @return bool 31 | */ 32 | public static function ctype_alnum($text) 33 | { 34 | $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); 35 | 36 | return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text); 37 | } 38 | 39 | /** 40 | * Returns TRUE if every character in text is a letter, FALSE otherwise. 41 | * 42 | * @see https://php.net/ctype-alpha 43 | * 44 | * @param mixed $text 45 | * 46 | * @return bool 47 | */ 48 | public static function ctype_alpha($text) 49 | { 50 | $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); 51 | 52 | return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text); 53 | } 54 | 55 | /** 56 | * Returns TRUE if every character in text is a control character from the current locale, FALSE otherwise. 57 | * 58 | * @see https://php.net/ctype-cntrl 59 | * 60 | * @param mixed $text 61 | * 62 | * @return bool 63 | */ 64 | public static function ctype_cntrl($text) 65 | { 66 | $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); 67 | 68 | return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text); 69 | } 70 | 71 | /** 72 | * Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise. 73 | * 74 | * @see https://php.net/ctype-digit 75 | * 76 | * @param mixed $text 77 | * 78 | * @return bool 79 | */ 80 | public static function ctype_digit($text) 81 | { 82 | $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); 83 | 84 | return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text); 85 | } 86 | 87 | /** 88 | * Returns TRUE if every character in text is printable and actually creates visible output (no white space), FALSE otherwise. 89 | * 90 | * @see https://php.net/ctype-graph 91 | * 92 | * @param mixed $text 93 | * 94 | * @return bool 95 | */ 96 | public static function ctype_graph($text) 97 | { 98 | $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); 99 | 100 | return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text); 101 | } 102 | 103 | /** 104 | * Returns TRUE if every character in text is a lowercase letter. 105 | * 106 | * @see https://php.net/ctype-lower 107 | * 108 | * @param mixed $text 109 | * 110 | * @return bool 111 | */ 112 | public static function ctype_lower($text) 113 | { 114 | $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); 115 | 116 | return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text); 117 | } 118 | 119 | /** 120 | * Returns TRUE if every character in text will actually create output (including blanks). Returns FALSE if text contains control characters or characters that do not have any output or control function at all. 121 | * 122 | * @see https://php.net/ctype-print 123 | * 124 | * @param mixed $text 125 | * 126 | * @return bool 127 | */ 128 | public static function ctype_print($text) 129 | { 130 | $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); 131 | 132 | return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text); 133 | } 134 | 135 | /** 136 | * Returns TRUE if every character in text is printable, but neither letter, digit or blank, FALSE otherwise. 137 | * 138 | * @see https://php.net/ctype-punct 139 | * 140 | * @param mixed $text 141 | * 142 | * @return bool 143 | */ 144 | public static function ctype_punct($text) 145 | { 146 | $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); 147 | 148 | return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text); 149 | } 150 | 151 | /** 152 | * Returns TRUE if every character in text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters. 153 | * 154 | * @see https://php.net/ctype-space 155 | * 156 | * @param mixed $text 157 | * 158 | * @return bool 159 | */ 160 | public static function ctype_space($text) 161 | { 162 | $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); 163 | 164 | return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text); 165 | } 166 | 167 | /** 168 | * Returns TRUE if every character in text is an uppercase letter. 169 | * 170 | * @see https://php.net/ctype-upper 171 | * 172 | * @param mixed $text 173 | * 174 | * @return bool 175 | */ 176 | public static function ctype_upper($text) 177 | { 178 | $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); 179 | 180 | return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text); 181 | } 182 | 183 | /** 184 | * Returns TRUE if every character in text is a hexadecimal 'digit', that is a decimal digit or a character from [A-Fa-f] , FALSE otherwise. 185 | * 186 | * @see https://php.net/ctype-xdigit 187 | * 188 | * @param mixed $text 189 | * 190 | * @return bool 191 | */ 192 | public static function ctype_xdigit($text) 193 | { 194 | $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); 195 | 196 | return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text); 197 | } 198 | 199 | /** 200 | * Converts integers to their char versions according to normal ctype behaviour, if needed. 201 | * 202 | * If an integer between -128 and 255 inclusive is provided, 203 | * it is interpreted as the ASCII value of a single character 204 | * (negative values have 256 added in order to allow characters in the Extended ASCII range). 205 | * Any other integer is interpreted as a string containing the decimal digits of the integer. 206 | * 207 | * @param mixed $int 208 | * @param string $function 209 | * 210 | * @return mixed 211 | */ 212 | private static function convert_int_to_char_for_ctype($int, $function) 213 | { 214 | if (!\is_int($int)) { 215 | return $int; 216 | } 217 | 218 | if ($int < -128 || $int > 255) { 219 | return (string) $int; 220 | } 221 | 222 | if (\PHP_VERSION_ID >= 80100) { 223 | @trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED); 224 | } 225 | 226 | if ($int < 0) { 227 | $int += 256; 228 | } 229 | 230 | return \chr($int); 231 | } 232 | } 233 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-mbstring/bootstrap.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Symfony\Polyfill\Mbstring as p; 13 | 14 | if (\PHP_VERSION_ID >= 80000) { 15 | return require __DIR__.'/bootstrap80.php'; 16 | } 17 | 18 | if (!function_exists('mb_convert_encoding')) { 19 | function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); } 20 | } 21 | if (!function_exists('mb_decode_mimeheader')) { 22 | function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); } 23 | } 24 | if (!function_exists('mb_encode_mimeheader')) { 25 | function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); } 26 | } 27 | if (!function_exists('mb_decode_numericentity')) { 28 | function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); } 29 | } 30 | if (!function_exists('mb_encode_numericentity')) { 31 | function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); } 32 | } 33 | if (!function_exists('mb_convert_case')) { 34 | function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); } 35 | } 36 | if (!function_exists('mb_internal_encoding')) { 37 | function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); } 38 | } 39 | if (!function_exists('mb_language')) { 40 | function mb_language($language = null) { return p\Mbstring::mb_language($language); } 41 | } 42 | if (!function_exists('mb_list_encodings')) { 43 | function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } 44 | } 45 | if (!function_exists('mb_encoding_aliases')) { 46 | function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } 47 | } 48 | if (!function_exists('mb_check_encoding')) { 49 | function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); } 50 | } 51 | if (!function_exists('mb_detect_encoding')) { 52 | function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); } 53 | } 54 | if (!function_exists('mb_detect_order')) { 55 | function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } 56 | } 57 | if (!function_exists('mb_parse_str')) { 58 | function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; } 59 | } 60 | if (!function_exists('mb_strlen')) { 61 | function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } 62 | } 63 | if (!function_exists('mb_strpos')) { 64 | function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); } 65 | } 66 | if (!function_exists('mb_strtolower')) { 67 | function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); } 68 | } 69 | if (!function_exists('mb_strtoupper')) { 70 | function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); } 71 | } 72 | if (!function_exists('mb_substitute_character')) { 73 | function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); } 74 | } 75 | if (!function_exists('mb_substr')) { 76 | function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); } 77 | } 78 | if (!function_exists('mb_stripos')) { 79 | function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); } 80 | } 81 | if (!function_exists('mb_stristr')) { 82 | function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); } 83 | } 84 | if (!function_exists('mb_strrchr')) { 85 | function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); } 86 | } 87 | if (!function_exists('mb_strrichr')) { 88 | function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); } 89 | } 90 | if (!function_exists('mb_strripos')) { 91 | function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); } 92 | } 93 | if (!function_exists('mb_strrpos')) { 94 | function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); } 95 | } 96 | if (!function_exists('mb_strstr')) { 97 | function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); } 98 | } 99 | if (!function_exists('mb_get_info')) { 100 | function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } 101 | } 102 | if (!function_exists('mb_http_output')) { 103 | function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); } 104 | } 105 | if (!function_exists('mb_strwidth')) { 106 | function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); } 107 | } 108 | if (!function_exists('mb_substr_count')) { 109 | function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); } 110 | } 111 | if (!function_exists('mb_output_handler')) { 112 | function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); } 113 | } 114 | if (!function_exists('mb_http_input')) { 115 | function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); } 116 | } 117 | 118 | if (!function_exists('mb_convert_variables')) { 119 | function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); } 120 | } 121 | 122 | if (!function_exists('mb_ord')) { 123 | function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); } 124 | } 125 | if (!function_exists('mb_chr')) { 126 | function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); } 127 | } 128 | if (!function_exists('mb_scrub')) { 129 | function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } 130 | } 131 | if (!function_exists('mb_str_split')) { 132 | function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } 133 | } 134 | 135 | if (!function_exists('mb_str_pad')) { 136 | function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } 137 | } 138 | 139 | if (!function_exists('mb_ucfirst')) { 140 | function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } 141 | } 142 | 143 | if (!function_exists('mb_lcfirst')) { 144 | function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } 145 | } 146 | 147 | if (!function_exists('mb_trim')) { 148 | function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); } 149 | } 150 | 151 | if (!function_exists('mb_ltrim')) { 152 | function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); } 153 | } 154 | 155 | if (!function_exists('mb_rtrim')) { 156 | function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); } 157 | } 158 | 159 | 160 | if (extension_loaded('mbstring')) { 161 | return; 162 | } 163 | 164 | if (!defined('MB_CASE_UPPER')) { 165 | define('MB_CASE_UPPER', 0); 166 | } 167 | if (!defined('MB_CASE_LOWER')) { 168 | define('MB_CASE_LOWER', 1); 169 | } 170 | if (!defined('MB_CASE_TITLE')) { 171 | define('MB_CASE_TITLE', 2); 172 | } 173 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Dotenv.php: -------------------------------------------------------------------------------- 1 | store = $store; 67 | $this->parser = $parser; 68 | $this->loader = $loader; 69 | $this->repository = $repository; 70 | } 71 | 72 | /** 73 | * Create a new dotenv instance. 74 | * 75 | * @param \Dotenv\Repository\RepositoryInterface $repository 76 | * @param string|string[] $paths 77 | * @param string|string[]|null $names 78 | * @param bool $shortCircuit 79 | * @param string|null $fileEncoding 80 | * 81 | * @return \Dotenv\Dotenv 82 | */ 83 | public static function create(RepositoryInterface $repository, $paths, $names = null, bool $shortCircuit = true, ?string $fileEncoding = null) 84 | { 85 | $builder = $names === null ? StoreBuilder::createWithDefaultName() : StoreBuilder::createWithNoNames(); 86 | 87 | foreach ((array) $paths as $path) { 88 | $builder = $builder->addPath($path); 89 | } 90 | 91 | foreach ((array) $names as $name) { 92 | $builder = $builder->addName($name); 93 | } 94 | 95 | if ($shortCircuit) { 96 | $builder = $builder->shortCircuit(); 97 | } 98 | 99 | return new self($builder->fileEncoding($fileEncoding)->make(), new Parser(), new Loader(), $repository); 100 | } 101 | 102 | /** 103 | * Create a new mutable dotenv instance with default repository. 104 | * 105 | * @param string|string[] $paths 106 | * @param string|string[]|null $names 107 | * @param bool $shortCircuit 108 | * @param string|null $fileEncoding 109 | * 110 | * @return \Dotenv\Dotenv 111 | */ 112 | public static function createMutable($paths, $names = null, bool $shortCircuit = true, ?string $fileEncoding = null) 113 | { 114 | $repository = RepositoryBuilder::createWithDefaultAdapters()->make(); 115 | 116 | return self::create($repository, $paths, $names, $shortCircuit, $fileEncoding); 117 | } 118 | 119 | /** 120 | * Create a new mutable dotenv instance with default repository with the putenv adapter. 121 | * 122 | * @param string|string[] $paths 123 | * @param string|string[]|null $names 124 | * @param bool $shortCircuit 125 | * @param string|null $fileEncoding 126 | * 127 | * @return \Dotenv\Dotenv 128 | */ 129 | public static function createUnsafeMutable($paths, $names = null, bool $shortCircuit = true, ?string $fileEncoding = null) 130 | { 131 | $repository = RepositoryBuilder::createWithDefaultAdapters() 132 | ->addAdapter(PutenvAdapter::class) 133 | ->make(); 134 | 135 | return self::create($repository, $paths, $names, $shortCircuit, $fileEncoding); 136 | } 137 | 138 | /** 139 | * Create a new immutable dotenv instance with default repository. 140 | * 141 | * @param string|string[] $paths 142 | * @param string|string[]|null $names 143 | * @param bool $shortCircuit 144 | * @param string|null $fileEncoding 145 | * 146 | * @return \Dotenv\Dotenv 147 | */ 148 | public static function createImmutable($paths, $names = null, bool $shortCircuit = true, ?string $fileEncoding = null) 149 | { 150 | $repository = RepositoryBuilder::createWithDefaultAdapters()->immutable()->make(); 151 | 152 | return self::create($repository, $paths, $names, $shortCircuit, $fileEncoding); 153 | } 154 | 155 | /** 156 | * Create a new immutable dotenv instance with default repository with the putenv adapter. 157 | * 158 | * @param string|string[] $paths 159 | * @param string|string[]|null $names 160 | * @param bool $shortCircuit 161 | * @param string|null $fileEncoding 162 | * 163 | * @return \Dotenv\Dotenv 164 | */ 165 | public static function createUnsafeImmutable($paths, $names = null, bool $shortCircuit = true, ?string $fileEncoding = null) 166 | { 167 | $repository = RepositoryBuilder::createWithDefaultAdapters() 168 | ->addAdapter(PutenvAdapter::class) 169 | ->immutable() 170 | ->make(); 171 | 172 | return self::create($repository, $paths, $names, $shortCircuit, $fileEncoding); 173 | } 174 | 175 | /** 176 | * Create a new dotenv instance with an array backed repository. 177 | * 178 | * @param string|string[] $paths 179 | * @param string|string[]|null $names 180 | * @param bool $shortCircuit 181 | * @param string|null $fileEncoding 182 | * 183 | * @return \Dotenv\Dotenv 184 | */ 185 | public static function createArrayBacked($paths, $names = null, bool $shortCircuit = true, ?string $fileEncoding = null) 186 | { 187 | $repository = RepositoryBuilder::createWithNoAdapters()->addAdapter(ArrayAdapter::class)->make(); 188 | 189 | return self::create($repository, $paths, $names, $shortCircuit, $fileEncoding); 190 | } 191 | 192 | /** 193 | * Parse the given content and resolve nested variables. 194 | * 195 | * This method behaves just like load(), only without mutating your actual 196 | * environment. We do this by using an array backed repository. 197 | * 198 | * @param string $content 199 | * 200 | * @throws \Dotenv\Exception\InvalidFileException 201 | * 202 | * @return array 203 | */ 204 | public static function parse(string $content) 205 | { 206 | $repository = RepositoryBuilder::createWithNoAdapters()->addAdapter(ArrayAdapter::class)->make(); 207 | 208 | $phpdotenv = new self(new StringStore($content), new Parser(), new Loader(), $repository); 209 | 210 | return $phpdotenv->load(); 211 | } 212 | 213 | /** 214 | * Read and load environment file(s). 215 | * 216 | * @throws \Dotenv\Exception\InvalidPathException|\Dotenv\Exception\InvalidEncodingException|\Dotenv\Exception\InvalidFileException 217 | * 218 | * @return array 219 | */ 220 | public function load() 221 | { 222 | $entries = $this->parser->parse($this->store->read()); 223 | 224 | return $this->loader->load($this->repository, $entries); 225 | } 226 | 227 | /** 228 | * Read and load environment file(s), silently failing if no files can be read. 229 | * 230 | * @throws \Dotenv\Exception\InvalidEncodingException|\Dotenv\Exception\InvalidFileException 231 | * 232 | * @return array 233 | */ 234 | public function safeLoad() 235 | { 236 | try { 237 | return $this->load(); 238 | } catch (InvalidPathException $e) { 239 | // suppressing exception 240 | return []; 241 | } 242 | } 243 | 244 | /** 245 | * Required ensures that the specified variables exist, and returns a new validator object. 246 | * 247 | * @param string|string[] $variables 248 | * 249 | * @return \Dotenv\Validator 250 | */ 251 | public function required($variables) 252 | { 253 | return (new Validator($this->repository, (array) $variables))->required(); 254 | } 255 | 256 | /** 257 | * Returns a new validator object that won't check if the specified variables exist. 258 | * 259 | * @param string|string[] $variables 260 | * 261 | * @return \Dotenv\Validator 262 | */ 263 | public function ifPresent($variables) 264 | { 265 | return new Validator($this->repository, (array) $variables); 266 | } 267 | } 268 | -------------------------------------------------------------------------------- /vendor/vlucas/phpdotenv/src/Repository/RepositoryBuilder.php: -------------------------------------------------------------------------------- 1 | readers = $readers; 71 | $this->writers = $writers; 72 | $this->immutable = $immutable; 73 | $this->allowList = $allowList; 74 | } 75 | 76 | /** 77 | * Create a new repository builder instance with no adapters added. 78 | * 79 | * @return \Dotenv\Repository\RepositoryBuilder 80 | */ 81 | public static function createWithNoAdapters() 82 | { 83 | return new self(); 84 | } 85 | 86 | /** 87 | * Create a new repository builder instance with the default adapters added. 88 | * 89 | * @return \Dotenv\Repository\RepositoryBuilder 90 | */ 91 | public static function createWithDefaultAdapters() 92 | { 93 | $adapters = \iterator_to_array(self::defaultAdapters()); 94 | 95 | return new self($adapters, $adapters); 96 | } 97 | 98 | /** 99 | * Return the array of default adapters. 100 | * 101 | * @return \Generator<\Dotenv\Repository\Adapter\AdapterInterface> 102 | */ 103 | private static function defaultAdapters() 104 | { 105 | foreach (self::DEFAULT_ADAPTERS as $adapter) { 106 | $instance = $adapter::create(); 107 | if ($instance->isDefined()) { 108 | yield $instance->get(); 109 | } 110 | } 111 | } 112 | 113 | /** 114 | * Determine if the given name if of an adapterclass. 115 | * 116 | * @param string $name 117 | * 118 | * @return bool 119 | */ 120 | private static function isAnAdapterClass(string $name) 121 | { 122 | if (!\class_exists($name)) { 123 | return false; 124 | } 125 | 126 | return (new ReflectionClass($name))->implementsInterface(AdapterInterface::class); 127 | } 128 | 129 | /** 130 | * Creates a repository builder with the given reader added. 131 | * 132 | * Accepts either a reader instance, or a class-string for an adapter. If 133 | * the adapter is not supported, then we silently skip adding it. 134 | * 135 | * @param \Dotenv\Repository\Adapter\ReaderInterface|string $reader 136 | * 137 | * @throws \InvalidArgumentException 138 | * 139 | * @return \Dotenv\Repository\RepositoryBuilder 140 | */ 141 | public function addReader($reader) 142 | { 143 | if (!(\is_string($reader) && self::isAnAdapterClass($reader)) && !($reader instanceof ReaderInterface)) { 144 | throw new InvalidArgumentException( 145 | \sprintf( 146 | 'Expected either an instance of %s or a class-string implementing %s', 147 | ReaderInterface::class, 148 | AdapterInterface::class 149 | ) 150 | ); 151 | } 152 | 153 | $optional = Some::create($reader)->flatMap(static function ($reader) { 154 | return \is_string($reader) ? $reader::create() : Some::create($reader); 155 | }); 156 | 157 | $readers = \array_merge($this->readers, \iterator_to_array($optional)); 158 | 159 | return new self($readers, $this->writers, $this->immutable, $this->allowList); 160 | } 161 | 162 | /** 163 | * Creates a repository builder with the given writer added. 164 | * 165 | * Accepts either a writer instance, or a class-string for an adapter. If 166 | * the adapter is not supported, then we silently skip adding it. 167 | * 168 | * @param \Dotenv\Repository\Adapter\WriterInterface|string $writer 169 | * 170 | * @throws \InvalidArgumentException 171 | * 172 | * @return \Dotenv\Repository\RepositoryBuilder 173 | */ 174 | public function addWriter($writer) 175 | { 176 | if (!(\is_string($writer) && self::isAnAdapterClass($writer)) && !($writer instanceof WriterInterface)) { 177 | throw new InvalidArgumentException( 178 | \sprintf( 179 | 'Expected either an instance of %s or a class-string implementing %s', 180 | WriterInterface::class, 181 | AdapterInterface::class 182 | ) 183 | ); 184 | } 185 | 186 | $optional = Some::create($writer)->flatMap(static function ($writer) { 187 | return \is_string($writer) ? $writer::create() : Some::create($writer); 188 | }); 189 | 190 | $writers = \array_merge($this->writers, \iterator_to_array($optional)); 191 | 192 | return new self($this->readers, $writers, $this->immutable, $this->allowList); 193 | } 194 | 195 | /** 196 | * Creates a repository builder with the given adapter added. 197 | * 198 | * Accepts either an adapter instance, or a class-string for an adapter. If 199 | * the adapter is not supported, then we silently skip adding it. We will 200 | * add the adapter as both a reader and a writer. 201 | * 202 | * @param \Dotenv\Repository\Adapter\WriterInterface|string $adapter 203 | * 204 | * @throws \InvalidArgumentException 205 | * 206 | * @return \Dotenv\Repository\RepositoryBuilder 207 | */ 208 | public function addAdapter($adapter) 209 | { 210 | if (!(\is_string($adapter) && self::isAnAdapterClass($adapter)) && !($adapter instanceof AdapterInterface)) { 211 | throw new InvalidArgumentException( 212 | \sprintf( 213 | 'Expected either an instance of %s or a class-string implementing %s', 214 | WriterInterface::class, 215 | AdapterInterface::class 216 | ) 217 | ); 218 | } 219 | 220 | $optional = Some::create($adapter)->flatMap(static function ($adapter) { 221 | return \is_string($adapter) ? $adapter::create() : Some::create($adapter); 222 | }); 223 | 224 | $readers = \array_merge($this->readers, \iterator_to_array($optional)); 225 | $writers = \array_merge($this->writers, \iterator_to_array($optional)); 226 | 227 | return new self($readers, $writers, $this->immutable, $this->allowList); 228 | } 229 | 230 | /** 231 | * Creates a repository builder with mutability enabled. 232 | * 233 | * @return \Dotenv\Repository\RepositoryBuilder 234 | */ 235 | public function immutable() 236 | { 237 | return new self($this->readers, $this->writers, true, $this->allowList); 238 | } 239 | 240 | /** 241 | * Creates a repository builder with the given allow list. 242 | * 243 | * @param string[]|null $allowList 244 | * 245 | * @return \Dotenv\Repository\RepositoryBuilder 246 | */ 247 | public function allowList(?array $allowList = null) 248 | { 249 | return new self($this->readers, $this->writers, $this->immutable, $allowList); 250 | } 251 | 252 | /** 253 | * Creates a new repository instance. 254 | * 255 | * @return \Dotenv\Repository\RepositoryInterface 256 | */ 257 | public function make() 258 | { 259 | $reader = new MultiReader($this->readers); 260 | $writer = new MultiWriter($this->writers); 261 | 262 | if ($this->immutable) { 263 | $writer = new ImmutableWriter($writer, $reader); 264 | } 265 | 266 | if ($this->allowList !== null) { 267 | $writer = new GuardedWriter($writer, $this->allowList); 268 | } 269 | 270 | return new AdapterRepository($reader, $writer); 271 | } 272 | } 273 | -------------------------------------------------------------------------------- /vendor/symfony/polyfill-mbstring/bootstrap80.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | use Symfony\Polyfill\Mbstring as p; 13 | 14 | if (!function_exists('mb_convert_encoding')) { 15 | function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); } 16 | } 17 | if (!function_exists('mb_decode_mimeheader')) { 18 | function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); } 19 | } 20 | if (!function_exists('mb_encode_mimeheader')) { 21 | function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); } 22 | } 23 | if (!function_exists('mb_decode_numericentity')) { 24 | function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); } 25 | } 26 | if (!function_exists('mb_encode_numericentity')) { 27 | function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); } 28 | } 29 | if (!function_exists('mb_convert_case')) { 30 | function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); } 31 | } 32 | if (!function_exists('mb_internal_encoding')) { 33 | function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); } 34 | } 35 | if (!function_exists('mb_language')) { 36 | function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); } 37 | } 38 | if (!function_exists('mb_list_encodings')) { 39 | function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); } 40 | } 41 | if (!function_exists('mb_encoding_aliases')) { 42 | function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); } 43 | } 44 | if (!function_exists('mb_check_encoding')) { 45 | function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); } 46 | } 47 | if (!function_exists('mb_detect_encoding')) { 48 | function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); } 49 | } 50 | if (!function_exists('mb_detect_order')) { 51 | function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); } 52 | } 53 | if (!function_exists('mb_parse_str')) { 54 | function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; } 55 | } 56 | if (!function_exists('mb_strlen')) { 57 | function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); } 58 | } 59 | if (!function_exists('mb_strpos')) { 60 | function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } 61 | } 62 | if (!function_exists('mb_strtolower')) { 63 | function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); } 64 | } 65 | if (!function_exists('mb_strtoupper')) { 66 | function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); } 67 | } 68 | if (!function_exists('mb_substitute_character')) { 69 | function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); } 70 | } 71 | if (!function_exists('mb_substr')) { 72 | function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); } 73 | } 74 | if (!function_exists('mb_stripos')) { 75 | function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } 76 | } 77 | if (!function_exists('mb_stristr')) { 78 | function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } 79 | } 80 | if (!function_exists('mb_strrchr')) { 81 | function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } 82 | } 83 | if (!function_exists('mb_strrichr')) { 84 | function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } 85 | } 86 | if (!function_exists('mb_strripos')) { 87 | function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); } 88 | } 89 | if (!function_exists('mb_strrpos')) { 90 | function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); } 91 | } 92 | if (!function_exists('mb_strstr')) { 93 | function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); } 94 | } 95 | if (!function_exists('mb_get_info')) { 96 | function mb_get_info(?string $type = 'all'): array|string|int|false|null { return p\Mbstring::mb_get_info((string) $type); } 97 | } 98 | if (!function_exists('mb_http_output')) { 99 | function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } 100 | } 101 | if (!function_exists('mb_strwidth')) { 102 | function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); } 103 | } 104 | if (!function_exists('mb_substr_count')) { 105 | function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); } 106 | } 107 | if (!function_exists('mb_output_handler')) { 108 | function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); } 109 | } 110 | if (!function_exists('mb_http_input')) { 111 | function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); } 112 | } 113 | 114 | if (!function_exists('mb_convert_variables')) { 115 | function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); } 116 | } 117 | 118 | if (!function_exists('mb_ord')) { 119 | function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); } 120 | } 121 | if (!function_exists('mb_chr')) { 122 | function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); } 123 | } 124 | if (!function_exists('mb_scrub')) { 125 | function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); } 126 | } 127 | if (!function_exists('mb_str_split')) { 128 | function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); } 129 | } 130 | 131 | if (!function_exists('mb_str_pad')) { 132 | function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } 133 | } 134 | 135 | if (!function_exists('mb_ucfirst')) { 136 | function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); } 137 | } 138 | 139 | if (!function_exists('mb_lcfirst')) { 140 | function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); } 141 | } 142 | 143 | if (!function_exists('mb_trim')) { 144 | function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); } 145 | } 146 | 147 | if (!function_exists('mb_ltrim')) { 148 | function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); } 149 | } 150 | 151 | if (!function_exists('mb_rtrim')) { 152 | function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); } 153 | } 154 | 155 | if (extension_loaded('mbstring')) { 156 | return; 157 | } 158 | 159 | if (!defined('MB_CASE_UPPER')) { 160 | define('MB_CASE_UPPER', 0); 161 | } 162 | if (!defined('MB_CASE_LOWER')) { 163 | define('MB_CASE_LOWER', 1); 164 | } 165 | if (!defined('MB_CASE_TITLE')) { 166 | define('MB_CASE_TITLE', 2); 167 | } 168 | --------------------------------------------------------------------------------