Howard Zoopaloopa
Howard Zoopaloopa

Reputation: 3822

Silex Doctrine Extensions

To make use of the Doctrine Extension in the Silex usage documentation they are asking that you

"Make sure you place a copy of Doctrine DBAL in vendor/doctrine-dbal and Doctrine Common in vendor/doctrine-common."

They then go onto an example of how to register with:

$app->register(new Silex\Extension\DoctrineExtension(), array(
    'db.options'            => array(
        'driver'    => 'pdo_sqlite',
        'path'      => __DIR__.'/app.db',
    ),
    'db.dbal.class_path'    => __DIR__.'/vendor/doctrine-dbal/lib',
    'db.common.class_path'  => __DIR__.'/vendor/doctrine-common/lib',
));

What I don't get are two things...

1) the path __DIR_.'vendor/doctrine-dbal/lib'

What does lib mean?? I don't see a lib folder or file in the doctrine package.

2) doctrine dbal and doctrine common...

The folder structure of the unpacked tar look like this: enter image description here does that mean I put the contents of each of those folders in their respective folders?

Thanks for your help. I'm having more trouble figuring out paths to these extensions than I am the extensions themselves.

-J

Upvotes: 0

Views: 1655

Answers (3)

theaxel
theaxel

Reputation: 19

Include them as submodules if you are using git as version control system (which you should).

Then just add them this way:

git submodule add git://github.com/doctrine/dbal.git vendor/doctrine-dbal
git submodule add git://github.com/doctrine/common.git vendor/doctrine-common

Next init the submodule folders:

git submodule init

and fetch them from git:

git submodule update --recursive

Upvotes: 1

MagePal Extensions
MagePal Extensions

Reputation: 17656

After downloading the DBLA, copy the 'Doctrine' folder to 'vendor', then update db.dbal.class_path and db.common.class_path to '/vendor/'.


    $app->register(new Silex\Provider\DoctrineServiceProvider(), array(
        'db.options' => array(
            'driver' => 'pdo_mysql',
            'host' => 'localhost',
            'dbname' => 'testdb',
            'user' => 'root',
            'password' => ''
        ),
        'db.dbal.class_path'    => __DIR__.'/vendor/',
        'db.common.class_path'  => __DIR__.'/vendor/',
    ));

or

Create the following folder structure in 'vendor'
'doctrine-dbal/lib/Doctrine/DBAL/'
'doctrine-common/lib/Doctrine/Common/'

copy 'Doctrine/DBAL/' to 'vendor/doctrine-dbal/lib/Doctrine/DBAL/'
copy 'Doctrine/Common/' to 'vendor/doctrine-common/lib/Doctrine/Common/'


    $app->register(new Silex\Provider\DoctrineServiceProvider(), array(
        'db.options'            => array(
            'driver'    => 'pdo_sqlite',
            'path'      => __DIR__.'/app.db',
        ),
        'db.dbal.class_path'    => __DIR__.'/vendor/doctrine-dbal/lib',
        'db.common.class_path'  => __DIR__.'/vendor/doctrine-common/lib',
    ));

Upvotes: 0

prodigitalson
prodigitalson

Reputation: 60413

lib should correspond to the DBAL/lib folder and likewise with the Common/lib folder. I think these instructions are more inline with a composer based installation layout.

Upvotes: 0

Related Questions