Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update actions. #19

Merged
merged 5 commits into from
Jun 27, 2023
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ name: build

jobs:
phpunit:
uses: yii-tools/actions/.github/workflows/build.yml@main
uses: yii-tools/actions/.github/workflows/codeception.yml@main
with:
extensions: fileinfo, intl
os: >-
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"prefer-stable": true,
"require": {
"php": "^8.1",
"httpsoft/http-server-request": "^1.1",
"psr/container": "^2.0",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.1",
Expand All @@ -38,12 +39,11 @@
"yiisoft/yii-http": "^1.0"
},
"require-dev": {
"codeception/c3": "^2.7",
"codeception/c3": "^2.8",
"codeception/codeception": "^5.0",
"codeception/module-asserts": "^3.0",
"codeception/module-cli": "^2.0",
"codeception/module-phpbrowser": "^3.0",
"httpsoft/http-message": "^1.1",
"maglnet/composer-require-checker": "^4.6",
"symfony/process": "^6.3",
"vimeo/psalm": "^5.9",
Expand Down
40 changes: 40 additions & 0 deletions public/index-test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

declare(strict_types=1);

use Yii\Framework\Runner\HttpApplication;

$c3 = \dirname(__DIR__) . '/c3.php';

if (\file_exists($c3)) {
require_once $c3;
}

/**
* @psalm-var string $_SERVER['REQUEST_URI']
*
* PHP built-in server routing.
*/
if (PHP_SAPI === 'cli-server') {
/**
* @psalm-suppress MixedArgument
*
* Serve static files as is.
*/
$path = \parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
if (\is_file(__DIR__ . $path)) {
return false;
}

/**
* Explicitly set for URLs with dot.
*/
$_SERVER['SCRIPT_NAME'] = '/index.php';
}

require_once \dirname(__DIR__) . '/vendor/autoload.php';

/**
* Run HTTP application runner
*/
(new HttpApplication())->withDebug(false)->withRootPath(\dirname(__DIR__))->run();
7 changes: 0 additions & 7 deletions public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@

use Yii\Framework\Runner\HttpApplication;

if (getenv('YII_C3')) {
$c3 = dirname(__DIR__) . '/c3.php';
if (file_exists($c3)) {
require_once $c3;
}
}

/**
* @psalm-var string $_SERVER['REQUEST_URI']
*
Expand Down
6 changes: 3 additions & 3 deletions src/Framework/Runner/HttpApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Yii\Framework\Runner;

use ErrorException;
use HttpSoft\ServerRequest\ServerRequestCreator;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Http\Message\ResponseInterface;
Expand Down Expand Up @@ -108,10 +109,9 @@ public function run(): void
$application = $container->get(Application::class);

/**
* @var ServerRequestFactory $serverRequestFactory
* @var ServerRequestInterface $serverRequestFactory
*/
$serverRequestFactory = $this->get(ServerRequestFactory::class);
$serverRequestFactory = $serverRequestFactory->createFromGlobals();
$serverRequestFactory = ServerRequestCreator::createFromGlobals();
$serverRequest = $serverRequestFactory->withAttribute('applicationStartTime', $startTime);

try {
Expand Down
289 changes: 0 additions & 289 deletions src/Framework/Runner/ServerRequestFactory.php

This file was deleted.

Loading