Codeigniter PHP代码点火器与信条

Codeigniter PHP代码点火器与信条,codeigniter,Codeigniter,我想问你们中是否有人能帮助我。 历史: 设置代码点火器 抄袭教义库 创建Doctrine.php 测试控制器-hello world-ok 通过将数据保存到数据库中来测试模型-失败 错误: 遇到一个PHP错误 严重性:警告 消息: require(C:/CI/system/application/libraries/doctor/Common/ClassLoader.php\doctor\ORM\Configuration.php):打开流失败:没有这样的文件或目录 文件名:Common/Cla

我想问你们中是否有人能帮助我。 历史:

  • 设置代码点火器
  • 抄袭教义库
  • 创建Doctrine.php
  • 测试控制器-hello world-ok
  • 通过将数据保存到数据库中来测试模型-失败
  • 错误: 遇到一个PHP错误

    严重性:警告

    消息:

    require(C:/CI/system/application/libraries/doctor/Common/ClassLoader.php\doctor\ORM\Configuration.php):打开流失败:没有这样的文件或目录

    文件名:Common/ClassLoader.php

    行号:164

    致命错误:require():无法打开C:\CI\system\application\libraries\Doctrine/Common/ClassLoader.php\Doctrine\ORM\Configuration.php(include_path=';C:\php\pear')中第164行的C:\CI\system\application\libraries\Doctrine\Common\ClassLoader.php中所需的“C:/

    Doctrine.Php的副本
    您可能会错过将条令文件加载到您的
    系统/应用程序/插件中的机会


    参考

    您应该将包含DBAL、Common和ORM的Doctrine文件夹复制到应用程序/第三方目录中

    <?php
    use Doctrine\Common\ClassLoader,
        Doctrine\ORM\Configuration,
        Doctrine\ORM\EntityManager,
        Doctrine\Common\Cache\ArrayCache,
        Doctrine\DBAL\Logging\EchoSQLLogger;
    
    class Doctrine {
    
      public $em = null;
    
      public function __construct()
      {
        // load database configuration from CodeIgniter
        require_once APPPATH.'config/database.php';
    
        // Set up class loading. You could use different autoloaders, provided by your favorite framework,
        // if you want to.
            require_once APPPATH.'libraries/Doctrine/Common/ClassLoader.php';
     //   require_once APPPATH.'libraries/Doctrine/Common/ClassLoader.php';
    
        $doctrineClassLoader = new ClassLoader('Doctrine',  APPPATH.'libraries/Doctrine/Common/ClassLoader.php');
        $doctrineClassLoader->register();
        $entitiesClassLoader = new ClassLoader('models', rtrim(APPPATH, "/" ));
        $entitiesClassLoader->register();
        $proxiesClassLoader = new ClassLoader('Proxies', APPPATH.'models/proxies');
        $proxiesClassLoader->register();
    
        // Set up caches
        $config = new Configuration;
        $cache = new ArrayCache;
        $config->setMetadataCacheImpl($cache);
        $driverImpl = $config->newDefaultAnnotationDriver(array(APPPATH.'models'));
        $config->setMetadataDriverImpl($driverImpl);
        $config->setQueryCacheImpl($cache);
    
        $config->setQueryCacheImpl($cache);
    
        // Proxy configuration
        $config->setProxyDir(APPPATH.'/models/proxies');
        $config->setProxyNamespace('Proxies');
    
        // Set up logger
        $logger = new EchoSQLLogger;
        $config->setSQLLogger($logger);
    
        $config->setAutoGenerateProxyClasses( TRUE );
    
        // Database connection information
        $connectionOptions = array(
            'driver' => 'pdo_mysql',
            'user' =>     $db['default']['root'],
            'password' => $db['default']['root'],
            'host' =>     $db['default']['localhost'],
            'dbname' =>   $db['default']['ci_database']
        );
    
        // Create EntityManager
        $this->em = EntityManager::create($connectionOptions, $config);
      }
    }
    
    -------------------------------------------------------------------------------------------