Mongo class is used to create a connection to MongoDB from PHP (
http://php.net/manual/es/book.mongo.php ). You don't have to create an
instance yourself. Your problem is that the class Mongo is not being found.
Can you verify if you have two php.ini, and if that's the case, if the
extension is loaded for CLI too..? if you have two php.ini, and you're
running a script with phpinfo() from your browser, you have to run the same
script on the CLI and verify again that you have the Mongo extension loaded.

2011/3/30 César Hernández <dpce...@gmail.com>

> mongod is runnig
>
> phpinfo()...
> mongo MongoDB Supportenabled Version 1.1.4
>  DirectiveLocal ValueMaster Value mongo.allow_empty_keys00
> mongo.allow_persistent11 mongo.auto_reconnect11 mongo.chunk_size262144
> 262144 mongo.cmd$$ mongo.default_hostlocalhostlocalhost mongo.default_port
> 2701727017 mongo.long_as_object00 mongo.native_long00 mongo.no_id00
> mongo.utf811
>
> what remains is to declare an instance of the class mongo
> but where?
>
>
>
> 2011/3/31 Gustavo Adrian <comfortablynum...@gmail.com>
>
>> Your function should look like:
>>
>> public function load($manager)
>>     {
>>       $user1 = new User();
>>       $user1->setName('Cesar Hernandez');
>>       $manager->persist($user);
>>
>>       $user2 = new User();
>>       $user2->setName('May-lhing Sanchez');
>>       $manager->persist($user);
>>
>>       $user3 = new User();
>>       $user3->setName('Sebastian Hernandez Sanchez');
>>       $manager->persist($user);
>>
>>       $manager->flush();
>>     }
>>
>> $manager is already passed to the load function, and it's the
>> EntityManager you need to persist your entities. There's no need to assign
>> it again.
>>
>> Also, check you have the PHP extension installed (look at phpinfo()) and
>> the mongo server running.
>>
>> 2011/3/30 César Hernández <dpce...@gmail.com>
>>
>>> ok...
>>> has gone a little ...
>>>
>>> *file: config.yml*
>>>
>>> doctrine_mongo_db:
>>>     connections:
>>>         default:
>>>             server: mongodb://localhost:27017
>>>             options:
>>>                 connect: true
>>>     default_document_manager: default
>>>     document_managers:
>>>         default:
>>>             mappings:
>>>                 MiPrimerNOSQL: ~
>>>             metadata_cache_driver: array
>>>
>>> *file: MisDatosIniciales.php*
>>>
>>>
>>> <?php
>>>
>>> namespace MiEmpresa\MiPrimerNOSQLBundle\DataFixtures\MongoDB;
>>>
>>> use Doctrine\Common\DataFixtures\FixtureInterface;
>>> use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
>>> use Symfony\Component\DependencyInjection\ContainerInterface;
>>> use Symfony\Component\DependencyInjection\ContainerAwareInterface;
>>>
>>> use MiEmpresa\MiPrimerNOSQLBundle\Document\Personas;
>>> use RuntimeException;
>>>
>>> class LoadPersonas implements FixtureInterface
>>>
>>> {
>>>     public function load($manager)
>>>     {
>>>       $user1 = new User();
>>>       $user1->setName('Cesar Hernandez');
>>>       $manager = $this->get('doctrine.odm.mongodb.document_manager');
>>>       $manager->persist($user);
>>>
>>>       $user2 = new User();
>>>       $user2->setName('May-lhing Sanchez');
>>>       $manager = $this->get('doctrine.odm.mongodb.document_manager');
>>>       $manager->persist($user);
>>>
>>>       $user3 = new User();
>>>       $user3->setName('Sebastian Hernandez Sanchez');
>>>
>>>       $manager = $this->get('doctrine.odm.mongodb.document_manager');
>>>       $manager->persist($user);
>>>
>>>       $manager->flush();
>>>     }
>>> }
>>>
>>> when i run
>>>
>>>
>>> php app/console doctrine:mongodb:data:load
>>>
>>> the console display
>>>
>>> * > purging database
>>>
>>> PHP Fatal error:  Class 'Mongo' not found in
>>> /var/www/sf2-pr8-05/vendor/doctrine-mongodb/lib/Doctrine/MongoDB/Connection.php
>>> on line 94
>>>
>>> Fatal error: Class 'Mongo' not found in
>>> /var/www/sf2-pr8-05/vendor/doctrine-mongodb/lib/Doctrine/MongoDB/Connection.php
>>> on line 94
>>> *
>>> at the beginning of the function load
>>> I add
>>>
>>> $manager = new Mongo();
>>>
>>> but not solved the problem...
>>>
>>>
>>>
>>> 2011/3/31 Christophe COEVOET <s...@notk.org>
>>>
>>>>  Le 30/03/2011 05:59, César Hernández a écrit :
>>>>
>>>> Ufff, now
>>>>
>>>> *php app/console doctrine:mongodb:data:load*
>>>>
>>>> PHP Fatal error:  Class 'Doctrine\Common\DataFixtures\Loader' not found
>>>> in
>>>> /var/www/sf2-pr8-05/vendor/symfony/src/Symfony/Bundle/DoctrineAbstractBundle/Common/DataFixtures/Loader.php
>>>> on line 11
>>>>
>>>> Fatal error: Class 'Doctrine\Common\DataFixtures\Loader' not found in
>>>> /var/www/sf2-pr8-05/vendor/symfony/src/Symfony/Bundle/DoctrineAbstractBundle/Common/DataFixtures/Loader.php
>>>> on line 11
>>>>
>>>>  You need to get the Doctrine DataFixtures vendor to load fixtures. It
>>>> is available on github on the doctrine account
>>>>
>>>> --
>>>> Christophe | Stof
>>>>
>>>>  --
>>>> If you want to report a vulnerability issue on symfony, please send it
>>>> to security at symfony-project.com
>>>>
>>>> You received this message because you are subscribed to the Google
>>>> Groups "symfony users" group.
>>>> To post to this group, send email to symfony-users@googlegroups.com
>>>> To unsubscribe from this group, send email to
>>>> symfony-users+unsubscr...@googlegroups.com
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/symfony-users?hl=en
>>>>
>>>
>>>
>>>
>>> --
>>> César Hernández
>>> Anzoátegui - Venezuela
>>> dpce...@gmail.com
>>>
>>> LinuxCounter: 285.345
>>> CIV: 122.539
>>>
>>> --
>>> If you want to report a vulnerability issue on symfony, please send it to
>>> security at symfony-project.com
>>>
>>> You received this message because you are subscribed to the Google
>>> Groups "symfony users" group.
>>> To post to this group, send email to symfony-users@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> symfony-users+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/symfony-users?hl=en
>>>
>>
>>  --
>> If you want to report a vulnerability issue on symfony, please send it to
>> security at symfony-project.com
>>
>> You received this message because you are subscribed to the Google
>> Groups "symfony users" group.
>> To post to this group, send email to symfony-users@googlegroups.com
>> To unsubscribe from this group, send email to
>> symfony-users+unsubscr...@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/symfony-users?hl=en
>>
>
>
>
> --
> César Hernández
> Anzoátegui - Venezuela
> dpce...@gmail.com
>
> LinuxCounter: 285.345
> CIV: 122.539
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to