PHP code example of netpromotion / symfony-up

1. Go to this page and download the library: Download netpromotion/symfony-up 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/ */

    

netpromotion / symfony-up example snippets




use Symfony\Bundle\FrameworkBundle\FrameworkBundle;

return [
    FrameworkBundle::class => ['all' => true],
    // TODO add more bundles here
];



namespace App;

use Netpromotion\SymfonyUp\UpKernelTrait;
use Netpromotion\SymfonyUp\UpKernel;

class Kernel extends UpKernel
{
    use UpKernelTrait;

    public function getProjectDir()
    {
        return __DIR__ . '/..';
    }
}



namespace App\Test;

use Netpromotion\SymfonyUp\UpTestCase;

class TestCase extends UpTestCase
{
    // Your own asserts goes here
}



use Netpromotion\SymfonyUp\SymfonyUp;

/** @var Composer\Autoload\ClassLoader $loader */
$loader = s instead of dotenv

return $loader;



use App\Kernel;
use Netpromotion\SymfonyUp\SymfonyUp;
use Symfony\Component\HttpFoundation\Request;

ymfonyUp::loadEnvironmentIfNeeded(__DIR__ . '/../.env'); // remove this line if you are using parameters instead of dotenv

SymfonyUp::createFromKernelClass(Kernel::class)
    ->runWeb();

#!/usr/bin/env php


use App\Kernel;
use Netpromotion\SymfonyUp\SymfonyUp;

f you are using parameters instead of dotenv

SymfonyUp::createFromKernelClass(Kernel::class)
    ->runConsole();
xml
<phpunit bootstrap="./tests/bootstrap.php" colors="true">
    <testsuites>
        <testsuite>
            <directory suffix="Test.php">./tests/</directory>
        </testsuite>
    </testsuites>
    <php>
        <ini name="error_reporting" value="-1" />
        <env name="KERNEL_CLASS" value="App\Kernel" />
        <env name="APP_ENV" value="test" />
        <env name="APP_DEBUG" value="1" />
        <env name="APP_SECRET" value="s$cretf0rt3st" />
        <env name="SHELL_VERBOSITY" value="-1" />
        <!-- define your env variables for the test env below -->
    </php>
</phpunit>