Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/config/
/metadata/
/cert/
/var/
/www/assets/fonts/*
/www/assets/js/*.js
/www/assets/js/*.js.LICENSE.txt
Expand Down
39 changes: 34 additions & 5 deletions bin/console
Original file line number Diff line number Diff line change
@@ -1,18 +1,47 @@
#!/usr/bin/env php
<?php

use SimpleSAML\Console\Application;
use SimpleSAML\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\ErrorHandler\Debug;

if (false === in_array(\PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
echo 'Warning: The console should be invoked via the CLI version of PHP, not the '.\PHP_SAPI.' SAPI'.\PHP_EOL;
}

umask(000);
set_time_limit(0);

require __DIR__.'/../vendor/autoload.php';
require dirname(__DIR__).'/vendor/autoload.php';

if (!class_exists(Application::class)) {
throw new RuntimeException('You need to add "symfony/framework-bundle" as a Composer dependency.');
}

$input = new ArgvInput();
$module = $input->getParameterOption(['--modules', '-m'], 'core');
$kernel = new Kernel($module);
if (null !== $env = $input->getParameterOption(['--env', '-e'], null, true)) {
putenv('APP_ENV='.$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = $env);
}

if ($input->hasParameterOption('--no-debug', true)) {
putenv('APP_DEBUG='.$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = '0');
}

require dirname(__DIR__).'/vendor/autoload.php';

$_SERVER += $_ENV;
$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';
$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0';

if ($_SERVER['APP_DEBUG']) {
umask(0000);

if (class_exists(Debug::class)) {
Debug::enable();
}
}

$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$application = new Application($kernel);
$application->run($input);
19 changes: 17 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"files": ["tests/_autoload_modules.php"]
},
"require": {
"php": ">=7.4 || ^8.0 ",
"php": ">=7.4 || ^8.0",
"ext-SPL": "*",
"ext-zlib": "*",
"ext-pcre": "*",
Expand All @@ -53,6 +53,7 @@
"simplesamlphp/assert": "^0.2.7",
"simplesamlphp/saml2": "^4.2.3",
"simplesamlphp/twig-configurable-i18n": "^2.3",
"symfony/asset": "^5.0",
"symfony/cache": "^5.0",
"symfony/config": "^5.0",
"symfony/console": "^5.0",
Expand All @@ -62,17 +63,26 @@
"symfony/http-foundation": "^5.0",
"symfony/http-kernel": "^5.0",
"symfony/routing": "^5.0",
"symfony/translation": "^5.0",
"symfony/twig-bridge": "^5.0",
"symfony/twig-bundle": "^5.0",
"symfony/var-exporter": "^5.0",
"symfony/yaml": "^5.0",
"symfony/twig-bundle": "^5.0",
"symfony/twig-bridge": "^5.0",
"twig/twig": "~2.0",
"twig/intl-extra": "^3.3"
},
"require-dev": {
"ext-curl": "*",
"mikey179/vfsstream": "~1.6",
"sgomez/simplesamlphp-module-expirycheck": "dev-master",
"simplesamlphp/simplesamlphp-module-adfs": "dev-master",
"simplesamlphp/simplesamlphp-test-framework": "^1.1.0",
"simplesamlphp/xml-security": "^0.2.7"
"simplesamlphp/xml-security": "^0.2.7",
"symfony/web-profiler-bundle": "^4.4 || ^5.0",
"symfony/stopwatch": "^4.4 || ^5,0",
"sgomez/simplesamlphp-module-expirycheck": "dev-master"
},
"suggest": {
"predis/predis": "Needed if a Redis server is used to store session information",
Expand All @@ -87,5 +97,10 @@
"support": {
"issues": "https://github.com/simplesamlphp/simplesamlphp/issues",
"source": "https://github.com/simplesamlphp/simplesamlphp"
},
"scripts": {
"post-install-cmd": [
"bin/console cache:clear"
]
}
}
Loading