PHP code example of flytachi / winter-kernel

1. Go to this page and download the library: Download flytachi/winter-kernel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

flytachi / winter-kernel example snippets




declare(strict_types=1);

use Flytachi\Winter\Kernel\App\Attribute\EnableWeb;
use Flytachi\Winter\Kernel\WinterApplication;

 parent::run($argv);
    }
}

#!/usr/bin/env php


chdir(__DIR__);

use Flytachi\Winter\Kernel\Http\Stereotype\Controller;
use Flytachi\Winter\Kernel\Route\Annotation\GetMapping;

final class PingController extends Controller
{
    #[GetMapping('/ping')]
    public function ping(): array
    {
        return ['pong' => true];
    }
}

#[Configuration] / #[Bean]   // DI factories            → dependency-injection
WebConfigurer                // host, port, CORS, static → web-configuration
LoggingConfigurer            // extra log channels       → logging
bash
php call            # the command list
php call run        # bring the application up
php call run dev    # same, restarting when a .php file changes