Pozor na nové verze doctrine/common 3.0.0 nekompatibilní s Nettrine
- Petr Parolek
- Člen | 455
Ahoj, kdyby se někdo začal divit jako já, proč se mu rozbila aplikace.
Začalo mi házet chybu:
Error Class 'Doctrine\Common\Persistence\AbstractManagerRegistry' not found
Vyřešil jsem problém takto:
composer require doctrine/common:<3.0.0
@Felix nebylo by dobré zamknout verze na doctrine 2, aby se nestahovala 3? Navrhuju přidat do https://github.com/…omposer.json něco takového:
"doctrine/common": "^2.10"
a vydat i opravnou verzi pro nette 2.4 nettrine/orm 0.3.1
- esorimer
- Člen | 114
Zdravím,
mohl by mi prosím někdo pomoci s rozchozením netrrine?
Zkoušel jsem to podle https://github.com/…cs/README.md#…,
ale je to pro mě gibberish.
Instaloval jsem pomocí:
composer require "doctrine/common:<3.0.0"
composer require nettrine/orm
composer require nettrine/dbal
composer require contributte/console
Příkaz:
composer require nettrine/cache
vrátí chybu:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- nettrine/annotations v0.6.1 requires nettrine/cache ^0.1.0 -> satisfiable by nettrine/cache[v0.1.0] but these conflict with your requirements or minimum-stability.
- nettrine/annotations v0.6.1 requires nettrine/cache ^0.1.0 -> satisfiable by nettrine/cache[v0.1.0] but these conflict with your requirements or minimum-stability.
- nettrine/annotations v0.6.1 requires nettrine/cache ^0.1.0 -> satisfiable by nettrine/cache[v0.1.0] but these conflict with your requirements or minimum-stability.
- Installation request for nettrine/annotations (locked at v0.6.1) -> satisfiable by nettrine/annotations[v0.6.1].
V konfigu mám:
extensions:
console: Contributte\Console\DI\ConsoleExtension(%consoleMode%)
nettrine.orm: Nettrine\ORM\DI\OrmExtension
nettrine.cache: Nettrine\Cache\DI\CacheExtension
nettrine.orm.console: Nettrine\ORM\DI\OrmConsoleExtension(%consoleMode%)
nettrine.orm.annotations: Nettrine\ORM\DI\OrmAnnotationsExtension
nettrine.orm.annotations:
namespaces: []
paths: []
excludePaths: []
Pak dostanu chybu
Service of type ‚Doctrine\DBAL\Connection‘ not found.
V dokumentaci je odkaz na https://github.com/…ettrine.neon Project, ve kterém ale
vypadá konfigurace úplně jinak! A ikdyž použiju to co je v tomto
projektu, tak mi to nefunguje :/
(**The mandatory option ‚orm.annotations › namespaces‘ is
missing. **)
S tímhle:
extensions:
console: Contributte\Console\DI\ConsoleExtension(%consoleMode%)
dbal: Nettrine\DBAL\DI\DbalExtension
nettrine.orm: Nettrine\ORM\DI\OrmExtension
nettrine.cache: Nettrine\Cache\DI\CacheExtension
nettrine.orm.console: Nettrine\ORM\DI\OrmConsoleExtension(%consoleMode%)
nettrine.orm.annotations: Nettrine\ORM\DI\OrmAnnotationsExtension
nettrine.orm:
configuration:
autoGenerateProxyClasses: %debugMode%
nettrine.orm.annotations:
namespaces: []
paths: []
excludePaths: []
dostanu chybu
Service ‚nettrine.orm.annotations.annotationDriver‘ (type of Doctrine\Persistence\Mapping\Driver\MappingDriver): Service of type Doctrine\Common\Annotations\Reader needed by $reader in Nettrine\ORM\Mapping\AnnotationDriver::__construct() not found. Did you register it in configuration file?
A krom toho v konzoli bin/console nevypíše žádné orm příkazy.
- Felix
- Nette Core | 1245
@ppar nettrine/orm v0.6.1 (https://github.com/…s/tag/v0.6.1) uz ma zamknutou verzi Doctrine.
- esorimer
- Člen | 114
Felix napsal(a):
@ppar nettrine/orm v0.6.1 (https://github.com/…s/tag/v0.6.1) uz ma zamknutou verzi Doctrine.
Pořád stejná chyba:
Service ‚nettrine.orm.annotations.annotationDriver‘ (type of
Doctrine\Persistence\Mapping\Driver\MappingDriver): Service of type
Doctrine\Common\Annotations\Reader needed by $reader in
Nettrine\ORM\Mapping\AnnotationDriver::__construct() not found. Did you register
it in configuration file?
- nightfish
- Člen | 518
Pořád stejná chyba:
Service ‚nettrine.orm.annotations.annotationDriver‘ (type of Doctrine\Persistence\Mapping\Driver\MappingDriver): Service of type Doctrine\Common\Annotations\Reader needed by $reader in Nettrine\ORM\Mapping\AnnotationDriver::__construct() not found. Did you register it in configuration file?
@esorimer Přidej si ještě extension:
nettrine.annotations: Nettrine\Annotations\DI\AnnotationsExtension
- esorimer
- Člen | 114
@esorimer Přidej si ještě extension:
nettrine.annotations: Nettrine\Annotations\DI\AnnotationsExtension
Díky, tohle už trochu pomohlo, ale ještě to nedokáže najít mapping:
bin/console orm:info
!
! [CAUTION] You do not have any mapped Doctrine ORM entities according to the current configuration.
!
! If you have entities or mapping files you should check your mapping configuration for errors.
V configu mam toto:
extensions:
console: Contributte\Console\DI\ConsoleExtension(%consoleMode%)
dbal: Nettrine\DBAL\DI\DbalExtension
nettrine.orm: Nettrine\ORM\DI\OrmExtension
nettrine.cache: Nettrine\Cache\DI\CacheExtension
nettrine.orm.console: Nettrine\ORM\DI\OrmConsoleExtension(%consoleMode%)
nettrine.orm.annotations: Nettrine\ORM\DI\OrmAnnotationsExtension
nettrine.annotations: Nettrine\Annotations\DI\AnnotationsExtension
nettrine.migrations: Nettrine\Migrations\DI\MigrationsExtension
nettrine.orm.annotations:
paths:
- %appDir%/model/entity
namespaces:
- App\Model\Entity
#cache: Doctrine\Common\Cache\FilesystemCache
#cacheDir: '%tempDir%/cache/Doctrine.Annotations'
nettrine.migrations:
directory: %appDir%/migrations
A v app/model/entity/Buyrequest.php toto:
<?php
namespace App\Model\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="buyrequest")
*/
class Buyrequest {
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue
* @var int
*/
protected $id;
/**
* @ORM\Column(type="string")
* @var string
*/
protected $email;
public function getId()
{
return $this->id;
}
public function getEmail() : string
{
return $this->email;
}
public function setEmail(string $email) : void
{
$this->email = $email;
}
}
?>
- piskotek
- Člen | 35
ahoj, aktualizoval jsem contributte/webapp-skeleton
a od té doby mi to dává tento error.
Poradíte mi co s tím?
Unexpected option 'nettrine.orm.annotations › namespaces', 'nettrine.orm.annotations › paths'.
composer
"nettrine/annotations": "^0.6.2",
"nettrine/orm": "^0.7.1",
"nettrine/dbal": "^0.6.4",
"nettrine/cache": "^0.2.0",
"nettrine/migrations": "^0.7.0",
"nettrine/fixtures": "^0.5.1",
"mongodb/mongodb": "^1.5",
"symfony/filesystem": "^5.1",
"contributte/redis": "^0.2.2",
nettrine.neon
nettrine.orm.annotations:
namespaces:
- App\Model\Database\Entity
paths:
- %appDir%/model/Database/Entity
config je komplet podle návodu na webu
- Michal Hlávka
- Člen | 190
Smaz si kompletne balicky Nettrine, udelej si zavilost v composeru na
doctrine/common:^2.13.1
a pak nainstalu Nettrine balicky. Bude ti
fungovat namespaces
spolu s paths
.
- toka
- Člen | 253
piskotek napsal(a):
ahoj, aktualizoval jsem „contributte/webapp-skeleton“ a od té doby mi to dává tento error.
Poradíte mi co s tím?Unexpected option 'nettrine.orm.annotations › namespaces', 'nettrine.orm.annotations › paths'.
composer
"nettrine/annotations": "^0.6.2", "nettrine/orm": "^0.7.1", "nettrine/dbal": "^0.6.4", "nettrine/cache": "^0.2.0", "nettrine/migrations": "^0.7.0", "nettrine/fixtures": "^0.5.1", "mongodb/mongodb": "^1.5", "symfony/filesystem": "^5.1", "contributte/redis": "^0.2.2",
nettrine.neon
nettrine.orm.annotations: namespaces: - App\Model\Database\Entity paths: - %appDir%/model/Database/Entity
config je komplet podle návodu na webu
Uprav si konfiguraci následovně:
nettrine.orm.annotations:
mapping:
App\Model\Database\Entity: %appDir%/model/Database/Entity