当我从composer运行我的安装时,我有这个错误:
λcomposer install您正在运行启用了xdebug的composer.这对运行时性能有重大影响.请参阅https://getcomposer.org/xdebug 使用包信息加载composer存储库更新依赖项(包括require-dev)无法将您的需求解析为可安装的软件包集.
错误:
问题1 - 请求的包antoineb1/smoney_bundle 1.0以antoineb1/smoney_bundle [dev-master]的形式存在,但这些被约束拒绝.
我的composer.json
{
"name": "project",
"license": "proprietary",
"type": "project",
"minimum-stability": "dev",
"prefer-stable" : true,
"autoload": {
"psr-4": {
"": "src/"
}
},
"config": {
"preferred-install": "dist"
},
"repositories": [
{
"url": "bitbucket url",
"type": "vcs"
}
],
"require": {
"php": ">=5.5.9",
"antoineb1/smoney_bundle": "1.0"
}
}
Run Code Online (Sandbox Code Playgroud) 目前,我使用的是Symfony 3,并且在开发中没有任何问题。
当我将网站放入产品中时,出现以下错误:
Attempted to load class "ZoneRepository" from namespace "AppBundle\Repository".
Did you forget a "use" statement for another namespace?
Run Code Online (Sandbox Code Playgroud)
ZoneRepository 的代码:
<?php
namespace AppBundle\Repository;
/**
* ZoneRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class ZoneRepository extends \Doctrine\ORM\EntityRepository
{
/**
* @return array
*/
public function getZones()
{
$qb = $this->createQueryBuilder('z');
$qb
->select('z')
->where('z.active = 1')
->orderBy('z.id', 'DESC');
return $qb->getQuery()->getResult();
}
}
Run Code Online (Sandbox Code Playgroud)
我试过 :
use Doctrine\ORM\EntityRepository; …Run Code Online (Sandbox Code Playgroud)