⬆️ update dependencies and add an autoload if used without composer

This commit is contained in:
Clement Desmidt 2023-04-17 10:12:51 +02:00 committed by Shikiryu
parent e2febcfacf
commit 09d16fb74b
3 changed files with 40 additions and 8 deletions

View File

@ -22,6 +22,12 @@ For example, [Zend](http://framework.zend.com/manual/current/en/modules/zend.fee
composer install shikiryu/shikiryurss
```
or
```php
include '/path/to/this/library/autoload.php';
```
## :rocket: Usage
----------------------------------

24
autoload.php Normal file
View File

@ -0,0 +1,24 @@
<?php
spl_autoload_register(static function ($class) {
$folders = explode('\\', $class);
if ($folders[0] === 'Shikiryu' && $folders[1] === 'SRSS') {
$folders = array_slice($folders, 2);
$path = sprintf('%s%ssrc%s%s.php',
__DIR__,
DIRECTORY_SEPARATOR,
DIRECTORY_SEPARATOR,
implode(DIRECTORY_SEPARATOR, $folders)
);
if (file_exists($path)) {
require $path;
}
}
});

18
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "f9098bb855d1eaf15a0ec531f0903ae9",
"content-hash": "f6a1c2940a5181b2d7e1d4709db556d3",
"packages": [],
"packages-dev": [
{
@ -623,16 +623,16 @@
},
{
"name": "phpunit/phpunit",
"version": "9.6.6",
"version": "9.6.7",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "b65d59a059d3004a040c16a82e07bbdf6cfdd115"
"reference": "c993f0d3b0489ffc42ee2fe0bd645af1538a63b2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b65d59a059d3004a040c16a82e07bbdf6cfdd115",
"reference": "b65d59a059d3004a040c16a82e07bbdf6cfdd115",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c993f0d3b0489ffc42ee2fe0bd645af1538a63b2",
"reference": "c993f0d3b0489ffc42ee2fe0bd645af1538a63b2",
"shasum": ""
},
"require": {
@ -706,7 +706,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.6"
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.7"
},
"funding": [
{
@ -722,7 +722,7 @@
"type": "tidelift"
}
],
"time": "2023-03-27T11:43:46+00:00"
"time": "2023-04-14T08:58:40+00:00"
},
{
"name": "sebastian/cli-parser",
@ -1745,7 +1745,9 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"ext-dom": "*"
"php": ">=8.0",
"ext-dom": "*",
"ext-libxml": "*"
},
"platform-dev": [],
"plugin-api-version": "2.1.0"