PHP code example of nikolaposa / phoundation

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

    

nikolaposa / phoundation example snippets


return [
    'db' => [
        'driver' => 'pdo_mysql',
        'host' => 'localhost',
        'user' => 'root',
        'password' => 'secret',
        'dbname' => 'test',
    ],
    'dependencies' => [
        'factories' => [
            \PDO::class => function () {
                return new \PDO('sqlite::memory:');
            },
            'My\\Web\\Application' => My\Web\ApplicationFactory::class,
        ]
    ],
];

return [
    'db' => [
        'user' => 'admin',
        'password' => '1234',
    ],
];


use Phoundation\Bootstrap;
use Phoundation\Config\FileConfigLoader;
use Phoundation\DependencyInjection\LaminasServiceManagerFactory;

$bootstrap = new Bootstrap(
    new FileConfigLoader(glob(sprintf('config/{{,*.}global,{,*.}%s}.php', getenv('APP_ENV') ?: 'local'), GLOB_BRACE)),
    new LaminasServiceManagerFactory()
);

return $bootstrap();


/* @var \Psr\Container\ContainerInterface $diContainer */
$diContainer =