Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

namespace not found #47

Closed
okochunk opened this Issue · 9 comments

3 participants

@okochunk

i have followed the installation instruction , and the installation goes successed
i use symfony 2.1.7

Loading composer repositories with package information
Updating dependencies

  • Installing doctrine/migrations (dev-master e1f6efc)
    Cloning e1f6efcd94993b493de5c6a413cbc327ea9c0caa

  • Installing doctrine/doctrine-migrations-bundle (dev-master 99c0192)
    Cloning 99c0192

but , after that...
if i run the commandline
php app/console doctrine:migrations

there are any error message like this
Fatal error: Class 'Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle' n
ot found in F:\XXX\AppName\app\AppKernel.php on line 24

and on the line 24 is

new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),

how can i fix that?
Thanks
Best Regard

Hendar

@stof
Collaborator

Are you using the Composer autoloader or a custom autoloader ?

@okochunk

i think i use composer autoloader ,
i'am just follow the instructions based on installation readme document

@okochunk

And after long long journey the error messsage ->

F:\VirtualServer\XXX>php app/console doctrine:migrations

[InvalidArgumentException]
Command "doctrine:migrations" is not defined.

can someone help me please ? i'am realy-realy new in symfony
thanks

@stof
Collaborator

this is because there is no such command. there is 5 or 6 commands named doctrine:migrations:...

@okochunk

it's solved guys :)
after read article composer namespace in 5 minutes
http://jtreminio.com/2012/10/composer-namespaces-in-5-minutes/

i manually added into \vendor\composer\autoload_namespaces.php
return array(
......
'Doctrine\Bundle\MigrationsBundle' => $vendorDir . '/doctrine/doctrine-migrations-bundle/',
'Doctrine\DBAL\Migrations' => $vendorDir . '/doctrine/migrations/lib/',

.....
);

and added this line into \app\AppKernel.php
$bundles = array(
......
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle()
.....
);

and when i run

php app/console doctrine:migrations:status

it's run smoothly :+1:

Thanks all of you guys ..

Best Regards

@okochunk okochunk closed this
@stof
Collaborator

you should not need to edit autoload_namespaces.php by hand. It is generated automatically by composer each time you install the deps.

@hardchor

I ran into the same issue. Looks like the physical paths have changed from Doctrine\Bundle\MigrationsBundle to Doctrine\Bundle\DoctrineMigrationsBundle but the namespaces haven't been updated?

@stof
Collaborator

The path has not changed. The target-dir is still Doctrine/Bundle/MigrationsBundle: https://github.com/doctrine/DoctrineMigrationsBundle/blob/master/composer.json#L31
Are you installing the bundle with composer or with a different system ?

@hardchor

You're right, the PSR-0 path has been correct in the composer.json for half a year or so.

I'm installing and autoloading via Composer. I completely removed the package and installed it again. For some reason the installed version was quite old (set "*" as required version, so would've expected it to pick the latest).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.