如何离线安装DoctrineFixturesBundle [英] How to install DoctrineFixturesBundle offline

查看:65
本文介绍了如何离线安装DoctrineFixturesBundle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,由于我的ISP,我无法使用composer,因此,我需要一种手动安装 DoctrineFixturesBundle 的方法,因此我开始从 github ,还有 data-fixtures 包。
i在我的项目中创建此文件夹结构

 供应商
-主义
-主义夹具-bundle
-Doctrine
-捆绑
-FixturesBundle
DoctrineFixturesBundle.php
..其他文件...


供应商
-理论
-数据夹具
-lib
-测试
composer.json
..other文件...

我通过阅读每个捆绑软件中的composer.json文件来做到这一点,然后编辑了 AppKernel .php 并添加

 公共函数registerBundles(){
.....
新的Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),
.....
}

但它不起作用,我总是得到:

 致命错误:类' Dctrine\Bundle\FixturesBundle\DoctrineFixturesBundle'不在D:\wamp\www\cupon\app中找到
第20行上的\AppKernel.php

我错过了什么吗?我可以手动安装那些捆绑包吗?

希望您能为我提供帮助。
谢谢

解决方案

我认为您需要在 composer.json <中设置自动加载功能/ code>文件:

  {
autoload:{
psr-0 :{{
Doctrine\\Bundle\\FixturesBundle:厂商/学说/ doctrine-fixtures-bundle,
Doctrine\\Common\\DataFixtures :供应商/原则/数据夹具/库,
}
}
}

Composer会在 composer更新中自动执行此操作,但是由于您没有使用composer安装软件包,因此这些软件包并未完成。 / p>

First of all, i can't use composer because of my ISP, so, i need a way to install the DoctrineFixturesBundle manually, so i started downloading it from github, also the data-fixtures bundle. i create this folder structure in my project

vendor
  - doctrine
    - doctrine-fixtures-bundle
      - Doctrine
        - Bundle
         - FixturesBundle
           DoctrineFixturesBundle.php
           ..other files...


vendor
  - doctrine
    - data-fixtures
      - lib
      - test
      composer.json
      ..other files...

i did this by reading the composer.json file located within each bundle, then i edited the AppKernel.php and added

public function registerBundles(){
  .....
  new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),
  .....
}

but it is not working, i always get:

 Fatal error: Class 'Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle' not 
 found in D:\wamp\www\cupon\app\AppKernel.php on line 20

Am i missing something? can i install those bundles manually?
Hope you can help me. thanks

解决方案

I think you need to setup the autoloading in your composer.json file:

{
    "autoload": {
        "psr-0": {
            "Doctrine\\Bundle\\FixturesBundle": "vendor/doctrine/doctrine-fixtures-bundle",
            "Doctrine\\Common\\DataFixtures": "vendor/doctrine/data-fixtures/lib",
        }
    }
}

Composer does this automatically on composer update, but as you didn't install the packages using composer, this wasn't done for these packages.

这篇关于如何离线安装DoctrineFixturesBundle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆