public static function createDefaultContainer($input = null, $output = null, $app = null, $config = null)
{
// Do not allow this function to be called more than once.
if (static::hasContainer()) {
return static::getContainer();
}
if (!$app) {
$app = static::createDefaultApplication();
}
if (!$config) {
$config = new Config();
}
// Set up our dependency injection container.
$container = new Container();
static::configureContainer($container, $app, $config, $input, $output);
// Set the application dispatcher
$app->setDispatcher($container->get('eventDispatcher'));
return $container;
}