Coder Social home page Coder Social logo

annotations's People

Contributors

enumag avatar fprochazka avatar haltuf avatar jakub-fajkus avatar mikesimonson avatar mrtnzlml avatar spamercz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

annotations's Issues

Composer requirements problem

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?

Release new version

I see master is in good shape and supports nette 3, any plans of releasing new version soon?

Cache invalidation notes

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)

Doctrine Annotations loader is registered too late.

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');

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.