<?php

declare(strict_types=1);

/**
 * Copyright (c) 2013-2018 OpenCFP
 *
 * For the full copyright and license information, please view
 * the LICENSE file that was distributed with this source code.
 *
 * @see https://github.com/opencfp/opencfp
 */

use OpenCFP\Environment;
use OpenCFP\Kernel;

require_once __DIR__ . '/vendor/autoload.php';

$kernel = new Kernel((string) Environment::fromServer($_SERVER), false);
$kernel->boot();

$container = $kernel->getContainer();

return [
    'paths' => [
        'migrations' => '%%PHINX_CONFIG_DIR%%/migrations',
    ],
    'environments' => [
        'default_migration_table' => 'phinxlog',
        'default_database'        => $kernel->getEnvironment(),
        $kernel->getEnvironment() => [
            'adapter' => 'mysql',
            'host'    => $container->getParameter('database.host'),
            'name'    => $container->getParameter('database.database'),
            'user'    => $container->getParameter('database.user'),
            'pass'    => $container->getParameter('database.password'),
        ],
    ],
];

<?php

declare(strict_types=1);

/**
 * Copyright (c) 2013-2018 OpenCFP
 *
 * For the full copyright and license information, please view
 * the LICENSE file that was distributed with this source code.
 *
 * @see https://github.com/opencfp/opencfp
 */

use OpenCFP\Environment;
use OpenCFP\Kernel;

require_once __DIR__ . '/vendor/autoload.php';

$kernel = new Kernel((string) Environment::fromServer($_SERVER), false);
$kernel->boot();

$container = $kernel->getContainer();

return [
    'paths' => [
        'migrations' => '%%PHINX_CONFIG_DIR%%/migrations',
    ],
    'environments' => [
        'default_migration_table' => 'phinxlog',
        'default_database'        => $kernel->getEnvironment(),
        $kernel->getEnvironment() => [
            'adapter' => 'mysql',
            'host'    => $container->getParameter('database.host'),
            'name'    => $container->getParameter('database.database'),
            'user'    => $container->getParameter('database.user'),
            'pass'    => $container->getParameter('database.password'),
            'charset' => 'utf8-mb4',
            'collation' => 'utf8-mb4_unicode_ci',
        ],
    ],
];

Set default charset for tables to utf-mb4
Set default charset for tables to utf-mb4

That way *all* Unicode-Characters can find their way into the CFP and not only those of the first Unicode-Plane. Which is missing f.e. the emojis… ;)