-
Notifications
You must be signed in to change notification settings - Fork 53
Fatal error: Uncaught Error: Class 'Doctrine\Instantiator\Instantiator' not found #146
Comments
Here my file BlogPost.php /** @document /
}` |
The doctrine class loader should no longer be used, as composer completely replaces it: are your examples coming from the docs? If so, then we'll likely need to upgrade or deprecate that section. |
Yes, the examples take them from doctrine couchdb documentation. |
On the command line you can Can you point us where you found the outdated documentation that show the use of the doctrine classLoader ? |
Now, I'm having this problem Did you mean one of these? require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] []... |
Thanks for the docs link. The error that you are seeing from composer is weird. |
Yes, very strange. Try other libs, such as, for example, composer require "doctrine/mongodb-odm" If it worked well. |
try another pc. I keep throwing error. But this time the C:\xampp\htdocs\couchdb>composer require doctrine/couchdb-odm [InvalidArgumentException] require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] |
Sorry but I have no idea what's going on, but it's not a couchdb-odm bug. |
please help me, it may be happening. This is the error
Fatal error: Uncaught Error: Class 'Doctrine\Instantiator\Instantiator' not found in C:\xampp\htdocs\couchdb-odm\lib\Doctrine\ODM\CouchDB\Mapping\ClassMetadata.php:219 Stack trace: #0 C:\xampp\htdocs\couchdb-odm\lib\Doctrine\ODM\CouchDB\Mapping\ClassMetadataFactory.php(191): Doctrine\ODM\CouchDB\Mapping\ClassMetadata->__construct('MyApp\Document\...') #1 C:\xampp\htdocs\couchdb-odm\lib\vendor\doctrine-common\lib\Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory.php(299): Doctrine\ODM\CouchDB\Mapping\ClassMetadataFactory->newClassMetadataInstance('MyApp\Document\...') #2 C:\xampp\htdocs\couchdb-odm\lib\Doctrine\ODM\CouchDB\Mapping\ClassMetadataFactory.php(178): Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory->loadMetadata('MyApp\Document\...') #3 C:\xampp\htdocs\couchdb-odm\lib\vendor\doctrine-common\lib\Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory.php(212): Doctrine\ODM\CouchDB\Mapping\ClassMetadataFactory->loadMetadata('MyApp\Document\...') #4 C:\xampp\htdocs\co in C:\xampp\htdocs\couchdb-odm\lib\Doctrine\ODM\CouchDB\Mapping\ClassMetadata.php on line 219
here my file boostrap.php.
`<?php
$couchPath = "lib";
require_once $couchPath . "/vendor/doctrine-common/lib/Doctrine/Common/ClassLoader.php";
$loader = new \Doctrine\Common\ClassLoader("Doctrine\Common", $couchPath . "/vendor/doctrine-common/lib");
$loader->register();
$loader = new \Doctrine\Common\ClassLoader("Doctrine\ODM\CouchDB", $couchPath);
$loader->register();
$loader = new \Doctrine\Common\ClassLoader("Doctrine\CouchDB", $couchPath);
$loader->register();
$loader = new \Doctrine\Common\ClassLoader("Symfony", $couchPath . "/vendor");
$loader->register();
$annotationNs = 'Doctrine\ODM\CouchDB\Mapping\Annotations';
Doctrine\Common\Annotations\AnnotationRegistry::registerAutoloadNamespace($annotationNs, $couchPath);
$databaseName = "couchdb_odm";
$documentPaths = array("MyApp\Documents");
$httpClient = new \Doctrine\CouchDB\HTTP\SocketClient();
$dbClient = new Doctrine\CouchDB\CouchDBClient($httpClient, $databaseName);
$config = new \Doctrine\ODM\CouchDB\Configuration();
$metadataDriver = $config->newDefaultAnnotationDriver($documentPaths);
$config->setProxyDir(DIR . "/proxies");
$config->setMetadataDriverImpl($metadataDriver);
$config->setLuceneHandlerName('_fti');
$dm = new \Doctrine\ODM\CouchDB\DocumentManager($dbClient, $config);
use MyApp\Document\BlogPost;
require_once 'MyApp/Documents/BlogPost.php';
$blogPost = new BlogPost();
$blogPost->setHeadline("Hello World!");
$blogPost->setText("This is a blog post going to be saved into CouchDB");
$dm->persist($blogPost);
$dm->flush();`
The text was updated successfully, but these errors were encountered: