O projektu
Lemonade Framework.
Jak je framework postavený.
Lemonade je open-source PHP framework pro webové a konzolové aplikace. Nabízí společný základ pro HTTP požadavky, CLI příkazy a úlohy na pozadí. Aplikační logika zůstává oddělená od frameworkové infrastruktury.
O Lemonade
Základ pro aplikaci
Lemonade zajišťuje společnou infrastrukturu aplikace. Routing, konfigurace a správa služeb mají jasně definovaná rozhraní. Vlastní aplikační logika zůstává v projektu.
app/Providers/ArticleProvider.php
<?php
declare(strict_types=1);
namespace App\Providers;
use App\Services\ArticleRepository;
use App\Services\ArticleRepositoryInterface;
use Lemonade\Framework\Container\ContainerBuilderInterface;
use Lemonade\Framework\Core\ServiceProviderInterface;
final class ArticleProvider implements ServiceProviderInterface
{
public function register(ContainerBuilderInterface $builder): void
{
$builder->scoped(ArticleRepository::class, ArticleRepository::class);
$builder->alias(ArticleRepositoryInterface::class, ArticleRepository::class);
}
}app/Config/Routing.php
<?php
declare(strict_types=1);
use App\Controllers\Frontend\SiteController;
use Lemonade\Framework\Routing\ControllerAction;
use Lemonade\Framework\Routing\Router;
return static function (Router $router): void {
$router->getNamed(
'site.about',
'/o-projektu',
ControllerAction::for(SiteController::class, 'about'),
);
};app/Console/StatusCommand.php
<?php
declare(strict_types=1);
namespace App\Console;
use Lemonade\Framework\Cli\CommandContext;
use Lemonade\Framework\Cli\CommandInterface;
use Lemonade\Framework\Cli\CommandOutput;
final readonly class StatusCommand implements CommandInterface
{
public function __construct(
private CommandContext $context,
private CommandOutput $output,
) {}
public function name(): string
{
return 'app:status';
}
public function description(): string
{
return 'Show the current command';
}
public function run(array $args): int
{
$this->output->writeln($this->context->commandName);
return 0;
}
}Veřejný vývoj
Stav repozitářů
Rozbalte projekt a zkontrolujte stav analýzy, testů i coding standards pro poslední commit na hlavní větvi.