namespace not found #47

Closed
okochunk opened this Issue Mar 3, 2013 · 9 comments

Comments

Projects
None yet
3 participants
@okochunk

okochunk commented Mar 3, 2013

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

This comment has been minimized.

Show comment Hide comment
@stof

stof Mar 3, 2013

Member

Are you using the Composer autoloader or a custom autoloader ?

Member

stof commented Mar 3, 2013

Are you using the Composer autoloader or a custom autoloader ?

@okochunk

This comment has been minimized.

Show comment Hide comment
@okochunk

okochunk Mar 4, 2013

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

okochunk commented Mar 4, 2013

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

@okochunk

This comment has been minimized.

Show comment Hide comment
@okochunk

okochunk Mar 5, 2013

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

okochunk commented Mar 5, 2013

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

This comment has been minimized.

Show comment Hide comment
@stof

stof Mar 6, 2013

Member

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

Member

stof commented Mar 6, 2013

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

@okochunk

This comment has been minimized.

Show comment Hide comment
@okochunk

okochunk Mar 7, 2013

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 👍

Thanks all of you guys ..

Best Regards

okochunk commented Mar 7, 2013

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 👍

Thanks all of you guys ..

Best Regards

@okochunk okochunk closed this Mar 7, 2013

@stof

This comment has been minimized.

Show comment Hide comment
@stof

stof Mar 8, 2013

Member

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

Member

stof commented Mar 8, 2013

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

@hardchor

This comment has been minimized.

Show comment Hide comment
@hardchor

hardchor Mar 12, 2013

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?

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

This comment has been minimized.

Show comment Hide comment
@stof

stof Mar 12, 2013

Member

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 ?

Member

stof commented Mar 12, 2013

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

This comment has been minimized.

Show comment Hide comment
@hardchor

hardchor Mar 12, 2013

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).

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