2013-03-30 16 views
0

我绑提交包(与项目凝视),以Packagist,但我有以下错误:将包提交给Packagist时发生异常。怎么解决?

[Doctrine\DBAL\DBALException] An exception occurred while executing 'INSERT INTO tag (name) VALUES (?)' with params {"1":"Mathematica"}: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Mathematica' for key 'name_idx' 

我的项目的URL是: https://github.com/GarouDan/phpmath.git

Packagist网址:https://packagist.org/packages/garoudan/phpmath

composer.json文件:

{ 
    "name": "garoudan/phpmath", 
    "type": "library", 
    "description": "Library to run Mathemtica functions trought PHP.", 
    "keywords": ["php","PHP","mathematica","Mathematica","MathKernel","mathkernel","math","MathematicaScript","mathematicascript"], 
    "homepage": "https://github.com/GarouDan/phpmath", 
    "license": "MIT", 
    "authors": [ 
     { 
      "name": "Danilo Araújo Silva", 
      "email": "[email protected]", 
      "homepage": "http://daniloaraujosilva.com", 
      "role": "Developer" 
     } 
    ], 
    "require": { 
     "php": ">=5.3.0" 
    }, 
    "autoload": { 
     "psr-0": { 
      "Backend" : "core" 
     } 
    } 
} 

回答

1

这看起来像是SQL唯一约束违规。这可能是因为你的所有标签都有小写和大写版本,并且它们使用不区分大小写的数据库。尝试使用每个标签中的一个来提交它。

+0

这有效(昨天我会找到相同的解决方案,但奇怪的是看起来像'PHP'和'php'工作,但是'Mathematica'和'mathematica'没有)。谢谢。 – GarouDan

+0

我的猜测是PHP标签已经存在,所以它会“查找”来获取该标签实体。但Mathematica还没有,所以它试图插入两者。但是因为他们使用的是不区分大小写的数据库,所以无论如何你都不需要它。 – bobthecow

+0

这个bug现在已经在Packagist中修复了。 – Seldaek

相关问题