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
12 changes: 5 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,24 @@
"sort-packages": true
},
"suggest": {
"makise-co/postgres": "To work with modern PostgreSQL Coroutine driver",
"makise-co/orm-bundle": "To work with modern ORM",
"makise-co/postgres-spiral-driver": "To work with modern DBAL"
"makise-co/http": "To run HTTP server",
"makise-co/auth": "To authenticate/authrize HTTP requests"
},
"require": {
"php": "^7.4",
"ext-json": "*",
"ext-swoole": "^4.4",
"laminas/laminas-diactoros": "^2.4",
"makise-co/http-router": "^1.0",
"monolog/monolog": "^2.0",
"nunomaduro/collision": "^4.1",
"php-di/php-di": "^6.1",
"psr/log": "^1.1",
"symfony/console": "^5.0",
"symfony/event-dispatcher": "^5.0",
"symfony/finder": "^5.0",
"symfony/http-foundation": "^5.0",
"symfony/property-access": "^5.0",
"symfony/var-dumper": "^5.0",
"vlucas/phpdotenv": "^4.1"
"vlucas/phpdotenv": "^5.0"
},
"require-dev": {
"phpstan/phpstan": "^0.12.18",
Expand All @@ -53,7 +50,8 @@
},
"autoload": {
"psr-4": {
"MakiseCo\\": "src/"
"MakiseCo\\": "src/",
"MakiseCo\\Tests\\": "tests/"
},
"files": [
"src/Env/functions.php"
Expand Down
15 changes: 8 additions & 7 deletions phpunit.xml → phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
backupStaticAttributes="false"
beStrictAboutTestsThatDoNotTestAnything="false"
bootstrap="vendor/autoload.php"
Expand All @@ -11,17 +12,17 @@
stopOnError="false"
stopOnFailure="false"
verbose="true"
>
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
</coverage>
<testsuites>
<testsuite name="Makise-Co Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<php>

</php>
Expand Down
38 changes: 12 additions & 26 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
namespace MakiseCo;

use DI\Container;
use Dotenv\Repository\Adapter\EnvConstAdapter;
use Dotenv\Repository\Adapter\PutenvAdapter;
use Dotenv\Repository\Adapter\ServerConstAdapter;
use Dotenv\Repository\RepositoryBuilder;
use MakiseCo\Config\ConfigRepositoryInterface;
use MakiseCo\Config\Repository;
use MakiseCo\Env\Env;
Expand Down Expand Up @@ -102,36 +98,26 @@ protected function bootDi(): void
$this->container->set(ApplicationInterface::class, $this);
// alias to ApplicationInterface
$this->container->set(self::class, \DI\get(ApplicationInterface::class));
// add services bootstrapper
$this->container->set(Bootstrapper::class, new Bootstrapper());
}

protected function bootEnv(): void
{
$repository = RepositoryBuilder::create()
->withReaders([new EnvConstAdapter, new PutenvAdapter, new ServerConstAdapter])
->withWriters([new EnvConstAdapter, new PutenvAdapter, new ServerConstAdapter])
$repository = \Dotenv\Repository\RepositoryBuilder::createWithDefaultAdapters()
->make();

Env::setRepository($repository);

$dotenv = \Dotenv\Dotenv::create(
$repository,
[$this->appDir . DIRECTORY_SEPARATOR],
['.env'],
true
);

$dotenv->safeLoad();

// load env-scoped variables
$env = Env::get('APP_ENV', null);
if (null !== $env) {
\Dotenv\Dotenv::create(
$repository,
[$this->appDir . DIRECTORY_SEPARATOR],
[".env.{$env}"],
true
)->safeLoad();
$envFile = '.env';

if (($input = new ArgvInput)->hasParameterOption('--env')) {
$envFile .= ".{$input->getParameterOption('--env')}";
} elseif (!empty($env = $repository->get('APP_ENV'))) {
$envFile .= ".{$env}";
}

\Dotenv\Dotenv::create($repository, [$this->appDir], [$envFile])->safeLoad();
}

protected function bootConfig(): void
Expand Down Expand Up @@ -205,6 +191,6 @@ protected function bootCommands(): void

public function getVersion(): string
{
return '1.0.3';
return '2.0.0';
}
}
103 changes: 0 additions & 103 deletions src/Auth/AuthManager.php

This file was deleted.

50 changes: 0 additions & 50 deletions src/Auth/AuthServiceProvider.php

This file was deleted.

19 changes: 0 additions & 19 deletions src/Auth/AuthenticatableInterface.php

This file was deleted.

50 changes: 0 additions & 50 deletions src/Auth/AuthorizableInterface.php

This file was deleted.

Loading