Skip to content

Commit

Permalink
feat: composer autoloading
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricerenck committed Oct 30, 2024
1 parent 04c84cf commit 620c5a6
Show file tree
Hide file tree
Showing 13 changed files with 1,153 additions and 2 deletions.
12 changes: 10 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"autoload": {
"psr-4": {
"mauricerenck\\Komments\\": "lib/"
"mauricerenck\\OgImage\\": "lib/"
},
"classmap": [
"lib"
Expand All @@ -27,5 +27,13 @@
},
"require": {
"php": ">=8.2.0"
},
"scripts": {
"test": "vendor/bin/phpunit --testdox --colors=always",
"build-test-package": "git archive HEAD -o ogimage.zip --worktree-attributes",
"build-composer": "composer install --no-dev --optimize-autoloader",
"build-release": [
"composer install --no-dev --optimize-autoloader"
]
}
}
}
20 changes: 20 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
use Kirby\Http\Response;
use Kirby\Cms\App as Kirby;

@include_once __DIR__ . '/vendor/autoload.php';

Kirby::plugin('mauricerenck/ogimage', [
'pageMethods' => require_once __DIR__ . '/src/page-methods.php',
'routes' => [
Expand Down
25 changes: 25 additions & 0 deletions vendor/autoload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

// autoload.php @generated by Composer

if (PHP_VERSION_ID < 50600) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, $err);
} elseif (!headers_sent()) {
echo $err;
}
}
trigger_error(
$err,
E_USER_ERROR
);
}

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit43e4bf87f07fe85c472d97f0aae0c9b8::getLoader();
Loading

0 comments on commit 620c5a6

Please sign in to comment.