Skip to content

Commit

Permalink
fixes issue GH-69 and prepare release 3.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
llaville committed Mar 13, 2021
1 parent 0b0f9dc commit 3e81c5c
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/php-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ jobs:

-
name: Unit tests
run: vendor/bin/simple-phpunit --verbose --testsuite ${{ matrix.extensions }}
run: vendor/bin/simple-phpunit --testsuite ${{ matrix.extensions }}
11 changes: 10 additions & 1 deletion CHANGELOG-3.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ using the [Keep a CHANGELOG](http://keepachangelog.com) principles.

## [Unreleased]

## [3.4.1] - 2021-03-13

**CAUTION:** uses `config/bootstrap.php` to apply autoloader and initialize environment variables (`APP_ENV` and `APP_PROXY_DIR`)

### Fixed

- [#69](https://github.com/llaville/php-compatinfo-db/issues/69) Proxy files management is broken (thanks to @remicollet for reporting)

## [3.4.0] - 2021-03-12

### Added
Expand Down Expand Up @@ -158,7 +166,8 @@ replace old `ContainerService` that was introduced in version 2.13
- [#55](https://github.com/llaville/php-compatinfo-db/issues/55) Wrong assertion results when method checks
- [#57](https://github.com/llaville/php-compatinfo-db/issues/57) GenericTest - function_exists failed to proceed expected assertion with Polyfills

[unreleased]: https://github.com/llaville/php-compatinfo-db/compare/3.4.0...HEAD
[unreleased]: https://github.com/llaville/php-compatinfo-db/compare/3.4.1...HEAD
[3.4.1]: https://github.com/llaville/php-compatinfo-db/compare/3.4.0...3.4.1
[3.4.0]: https://github.com/llaville/php-compatinfo-db/compare/3.3.0...3.4.0
[3.3.0]: https://github.com/llaville/php-compatinfo-db/compare/3.2.0...3.3.0
[3.2.0]: https://github.com/llaville/php-compatinfo-db/compare/3.1.1...3.2.0
Expand Down
11 changes: 3 additions & 8 deletions bin/compatinfo-db
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ gc_disable(); // performance boost

if (\Phar::running()) {
$possibleAutoloadPaths = [
'phar://compatinfo-db.phar/vendor/autoload.php'
'phar://compatinfo-db.phar/config/bootstrap.php'
];
} else {
$possibleAutoloadPaths = [
// local dev repository
__DIR__ . '/../vendor/autoload.php',
// dependency
__DIR__ . '/../../../../vendor/autoload.php',
dirname(__DIR__) . '/config/bootstrap.php',
];
}

Expand All @@ -28,7 +26,7 @@ foreach ($possibleAutoloadPaths as $possibleAutoloadPath) {

if ($isAutoloadFound === false) {
throw new RuntimeException(sprintf(
'Unable to find "vendor/autoload.php" in "%s" paths.',
'Unable to find "config/bootstrap.php" in "%s" paths.',
implode('", "', $possibleAutoloadPaths)
));
}
Expand All @@ -38,9 +36,6 @@ use Bartlett\CompatInfoDb\Presentation\Console\ApplicationInterface;
use Symfony\Component\Console\CommandLoader\CommandLoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;

putenv('APP_ENV=' . ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? 'prod'));
putenv('APP_PROXY_DIR=' . ($_SERVER['APP_PROXY_DIR'] ?? $_ENV['APP_PROXY_DIR'] ?? '/tmp/bartlett/php-compatinfo-db/' . ApplicationInterface::VERSION . '/proxies'));

/** @var ContainerBuilder $container */
$container = require dirname(__DIR__) . '/config/container.php';

Expand Down
2 changes: 1 addition & 1 deletion cli-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Tools\Console\ConsoleRunner;

require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/config/bootstrap.php';

$container = require __DIR__ . '/config/container.php';

Expand Down
8 changes: 8 additions & 0 deletions config/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use Bartlett\CompatInfoDb\Presentation\Console\ApplicationInterface;

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

putenv('APP_ENV=' . ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? 'prod'));
putenv('APP_PROXY_DIR=' . ($_SERVER['APP_PROXY_DIR'] ?? $_ENV['APP_PROXY_DIR'] ?? '/tmp/bartlett/php-compatinfo-db/' . ApplicationInterface::VERSION . '/proxies'));
4 changes: 2 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<phpunit
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="tests/bootstrap.php"
bootstrap="config/bootstrap.php"
colors="true"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnRisky="false"
stopOnSkipped="false"
verbose="false"
verbose="true"
beStrictAboutTestsThatDoNotTestAnything="false"
processIsolation="false"
>
Expand Down
2 changes: 1 addition & 1 deletion src/Presentation/Console/ApplicationInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
interface ApplicationInterface extends ContainerAwareInterface
{
public const NAME = 'Database handler for CompatInfo';
public const VERSION = '3.4.0';
public const VERSION = '3.4.1';

/**
* @param CommandLoaderInterface $commandLoader
Expand Down
1 change: 0 additions & 1 deletion tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';

0 comments on commit 3e81c5c

Please sign in to comment.