im a beginner with learning. I just installed pare + doctrine 2.3.3 and want to test it.
to test the doctrine, I wrote a class called "man"
class person { private $id; private $name; private $surname;
after that I made bootstrap.php, bootstrep_doctrine.php and cli-config.php files and ran the command:
doctrine orm:schema-tool:create
works great!
But now, when I want to include my bootstrap.php in a βregularβ php file to create a βpersonβ, I get the following error:
Fatal error: Class 'Doctrine\ORM\Tools\Setup' not found in /var/www/vms/bootstrap_doctrine.php on line 15
The file is as follows:
<?php $debug = true; if($debug){ error_reporting(E_ALL); ini_set("display_errors", "on"); ini_set("display_startip_errors", "on"); } require_once '../bootstrap.php'; include_once ('testClassOrm.php'); $person = new person(); $person = new person(); $person->setName("Hans"); ?>
bootstrap.php:
if(!class_exists("Doctrine\Common\Version", false)){ require_once 'bootstrap_doctrine.php'; }
bootstrap_doctrine.php
use Doctrine\ORM\Tools\Setup; use Doctrine\ORM\EntityManager; $paths = array("entities/"); $isDevMode = true; // the connection configuration $dbParams = array( 'driver' => 'pdo_mysql', 'user' => 'TEST', 'password' => 'TEST', 'dbname' => 'test', ); $config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode); $em = EntityManager::create($dbParams, $config);
i checks if / usr / share / pear / is in the php_include path. and this..
require_once 'System.php'; var_dump(class_exists('System', false));
returns true:
but this returns false:
use Doctrine\ORM\Tools\Setup; var_dump(class_exists('Setup', false));
Am I doing something wrong?
Best wishes