prooph / proophessor-do

prooph components in action
http://getprooph.org
BSD 3-Clause "New" or "Revised" License
254 stars 67 forks source link

MariaDB config file is missing #146

Closed sebastianblum closed 6 years ago

sebastianblum commented 6 years ago

hello,

At the moment, in config/autoload (https://github.com/prooph/proophessor-do/tree/master/config/autoload) exists only a

but the mariadb_event_store.local.php.dist is missing

I tried these configuration: mariadb_event_store.local.php

<?php
/**
 * This file is part of prooph/proophessor-do.
 * (c) 2014-2017 prooph software GmbH <contact@prooph.de>
 * (c) 2015-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

declare(strict_types=1);

namespace Prooph\ProophessorDo;

use Prooph\EventStore;

/**
 * Local configuration overrides - make your adjustments here
 */
return [
    // dependencies settings
    'dependencies' => [
        'factories' => [
            EventStore\EventStore::class => [
                EventStore\Pdo\Container\MariaDbEventStoreFactory::class,
                'default',
            ],
            EventStore\Projection\ProjectionManager::class => [
                EventStore\Pdo\Container\MariaDbProjectionManagerFactory::class,
                'default',
            ],
        ],
    ],
    // prooph settings
    'prooph' => [
        'event_store' => [
            'default' => [
                'persistence_strategy' => EventStore\Pdo\PersistenceStrategy\MariaDbSingleStreamStrategy::class,
                'connection' => 'pdo.connection',
            ]
        ],
        'pdo_connection' => [
            'default' => [
                'schema' => 'mysql',
                'host' => '127.0.0.1',
                'port' => '3306',
                'user' => 'root',
                'password' => '',
                'dbname' => 'todo',
                'charset' => 'utf8',
            ],
        ],
        'projection_manager' => [
            'default' => [
                'connection' => 'pdo.connection',
            ],
        ],
    ],
];

but I get this error message:

$ php scripts/create_event_stream.php PHP Fatal error: Uncaught Zend\ServiceManager\Exception\ServiceNotFoundException: Unable to resolve service "Prooph\EventStore\Pdo\PersistenceStrategy\MariaDbSingleStreamStrategy" to a factory; are you certain you provided it during configuration? in /Users/sebastianblum/PhpstormProjects/proophessor-do/vendor/zendframework/zend-servicemanager/src/ServiceManager.php:681 Stack trace:

0 /Users/sebastianblum/PhpstormProjects/proophessor-do/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(757): Zend\ServiceManager\ServiceManager->getFactory('Prooph\EventSto...')

1 /Users/sebastianblum/PhpstormProjects/proophessor-do/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(200): Zend\ServiceManager\ServiceManager->doCreate('Prooph\EventSto...')

2 /Users/sebastianblum/PhpstormProjects/proophessor-do/vendor/prooph/pdo-event-store/src/Container/AbstractEventStoreFactory.php(83): Zend\ServiceManager\ServiceManager->get('Prooph\EventSto...')

3 /Users/sebastianblum/PhpstormProjects/proophessor-do/vendor/proop in /Users/sebastianblum/PhpstormProjects/proophessor-do/vendor/zendframework/zend-servicemanager/src/ServiceManager.php on line 681

prolic commented 6 years ago

You have to add that class, too. I don't know which file from my head, look into that config folder, you'll find the configs for the other implementations as well.

On Oct 28, 2017 05:03, "Sebastian Blum" notifications@github.com wrote:

hello,

At the moment, in config/autoload (https://github.com/prooph/ proophessor-do/tree/master/config/autoload) exists only a

  • mysql_event_store.local.php.dist
  • postgres_event_store.local.php.dist but the mariadb_event_store.local.php.dist is missing

I tried these configuration: mariadb_event_store.local.php

<?php/* This file is part of prooph/proophessor-do. (c) 2014-2017 prooph software GmbH contact@prooph.de (c) 2015-2017 Sascha-Oliver Prolic saschaprolic@googlemail.com For the full copyright and license information, please view the LICENSE file that was distributed with this source code. /declare(strict_types=1);namespace Prooph\ProophessorDo;use Prooph\EventStore;/* Local configuration overrides - make your adjustments here */return [ // dependencies settings 'dependencies' => [ 'factories' => [ EventStore\EventStore::class => [ EventStore\Pdo\Container\MariaDbEventStoreFactory::class, 'default', ], EventStore\Projection\ProjectionManager::class => [ EventStore\Pdo\Container\MariaDbProjectionManagerFactory::class, 'default', ], ], ], // prooph settings 'prooph' => [ 'event_store' => [ 'default' => [ 'persistence_strategy' => EventStore\Pdo\PersistenceStrategy\MariaDbSingleStreamStrategy::class, 'connection' => 'pdo.connection', ] ], 'pdo_connection' => [ 'default' => [ 'schema' => 'mysql', 'host' => '127.0.0.1', 'port' => '3306', 'user' => 'root', 'password' => '', 'dbname' => 'todo', 'charset' => 'utf8', ], ], 'projection_manager' => [ 'default' => [ 'connection' => 'pdo.connection', ], ], ],];

but I get this error message:

$ php scripts/create_event_stream.php PHP Fatal error: Uncaught Zend\ServiceManager\Exception\ServiceNotFoundException: Unable to resolve service "Prooph\EventStore\Pdo\PersistenceStrategy\MariaDbSingleStreamStrategy" to a factory; are you certain you provided it during configuration? in /Users/sebastianblum/PhpstormProjects/proophessor- do/vendor/zendframework/zend-servicemanager/src/ServiceManager.php:681 Stack trace:

0 /Users/sebastianblum/PhpstormProjects/proophessor-

do/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(757): Zend\ServiceManager\ServiceManager->getFactory('Prooph\EventSto...')

1 https://github.com/prooph/proophessor-do/issues/1

/Users/sebastianblum/PhpstormProjects/proophessor- do/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(200): Zend\ServiceManager\ServiceManager->doCreate('Prooph\EventSto...')

2 https://github.com/prooph/proophessor-do/issues/2

/Users/sebastianblum/PhpstormProjects/proophessor- do/vendor/prooph/pdo-event-store/src/Container/ AbstractEventStoreFactory.php(83): Zend\ServiceManager\ ServiceManager->get('Prooph\EventSto...')

3 https://github.com/prooph/proophessor-do/pull/3 /Users/sebastianblum/

PhpstormProjects/proophessor-do/vendor/proop in /Users/sebastianblum/ PhpstormProjects/proophessor-do/vendor/zendframework/zend- servicemanager/src/ServiceManager.php on line 681

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/prooph/proophessor-do/issues/146, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYEvFg9LoWXiixqJSyFjpAiZACT3baiks5swkUUgaJpZM4QJnSv .

sebastianblum commented 6 years ago

@prolic thank you for the quick reply. I found it and will create a pull request