kdyby / annotations Goto Github PK
View Code? Open in Web Editor NEWDoctrine Annotations integration into Nette Framework
Home Page: https://packagist.org/packages/kdyby/annotations
License: Other
Doctrine Annotations integration into Nette Framework
Home Page: https://packagist.org/packages/kdyby/annotations
License: Other
When I require kdyby/annotations 2.0.* with minumum stability dev it installs both nette 2.1 (from kdyby/annotations) and nette 2.2 packages (from kdyby/doctrine-cache).
Can you pls fix it?
I see master is in good shape and supports nette 3, any plans of releasing new version soon?
I've installed symfony demo project in order to look how annotations invalidation works for both Doctrine/ORM and Symfony/Validator.
The interesting fact is that default configuration doesn’t actualy use cache for metadata, only for the annotations themselves.
This applies for both dev and prod environments.
The Annotations are cached using FileCacheReader which has the ability to invalidate the cache if set to debug.
I’m considering using something like this instead of the solution I suggested earlier for Kdyby/DoctrineCache.
I'd like to use the same as Symfony for debug mode (maybe with in-memory cache for Validator), but with some additional cache for metadata in production mode. Also I'd like to stop using the delegation to Nette/Caching by default.
What do you think? (cc @fprochazka)
We use some services with run
tag, those services uses some Entity
and we run into this exception
Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@Doctrine\ORM\Mapping\MappedSuperclass" in class Kdyby\Doctrine\Entities\BaseEntity does not exist, or could not be auto-loaded.
I've found out that Doctrine\Common\Annotations\AnnotationRegistry::registerLoader
is calling after the services are initialized, which should cause the problem.
class Container_XXX {
// ....
public function initialize()
{
date_default_timezone_set('Europe/Amsterdam');
$this->getService('events.manager')->createEvent(array('Nette\DI\Container', 'onInitialize'))->dispatch($this);
$this->getService(155); // This service uses Doctrine Entity
Nette\Reflection\AnnotationsParser::setCacheStorage($this->getByType("Nette\Caching\IStorage"));
Nette\Reflection\AnnotationsParser::$autoRefresh = FALSE;
Doctrine\Common\Annotations\AnnotationRegistry::registerLoader("class_exists");
Kdyby\Doctrine\Diagnostics\Panel::registerBluescreen($this);
}
}
Simple fix for this is to put line below in bootstrap file
Doctrine\Common\Annotations\AnnotationRegistry::registerFile( __VENDOR_DIR__ . '/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
nette/*
to absolute minimumA declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.