[DCOM-250] [GH-335] add base events class Created: 28/Aug/14  Updated: 28/Aug/14

Status: Open
Project: Doctrine Common
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of jdeniau:

Url: https://github.com/doctrine/common/pull/335

Message:

Hi,

All doctrine projects implements events. A lot of them are similars, but there is no base class defining common Events.

I tried to gathen them all in this PR. I looked into ```CouchDb-orm```, ```doctrine-orm```, ```doctrine-mongodb-odm``` and ```phpcr-odm```.

I only added events present in all packages, but CouchDB is the only one to not implement some events implemented in every other packages (```postPersist```, ```loadClassmetadata```, ```preFlush```, etc.).






[DCOM-245] doContains method in MemcacheCache cache provider class returning wrong values Created: 27/Jun/14  Updated: 27/Jun/14

Status: Open
Project: Doctrine Common
Component/s: Caching
Affects Version/s: 2.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Javier Mellado Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: orm
Environment:

dev, test and prod



 Description   

Method doContains in MemcacheCache cache provider class looks like this


    /**
     * {@inheritdoc}
     */
    protected function doContains($id)
    {
        return (bool) $this->memcache->get($id);
    }

In the case of an empty array stored, the result of casting an empty array is false but actually there's a value in cache with they key $id. As a matter of fact, when you take a look at MemcachedCache cache provider class, the doContains method looks like this:

    /**
     * {@inheritdoc}
     */
    protected function doContains($id)
    {
        return (false !== $this->memcached->get($id));
    }

Which is more accurate in terms of the existance of a value in cache for $id. I had to have a workaround with the above code to make it work with Memcache.

Is there any reason it is like that in MemcacheCache cache provider class and not in MemcachedCache cache provider class?



 Comments   
Comment by Marco Pivetta [ 27/Jun/14 ]

Javier Mellado can you please open a PR for this? The fix seems trivial, but it just needs a test in order to merge.

Comment by Javier Mellado [ 27/Jun/14 ]

Excuse me Marco, what is a PR? I'll be more than happy to do so.

Comment by Marco Pivetta [ 27/Jun/14 ]

Javier Mellado pull request on github. If you don't then it may just be fixed in future as soon as someone picks it.





[DCOM-244] API docs for Doctrine\Common\Collections missing Created: 19/Jun/14  Updated: 26/Jun/14

Status: Open
Project: Doctrine Common
Component/s: Collections
Affects Version/s: 2.4
Fix Version/s: None

Type: Documentation Priority: Major
Reporter: Christian Schmidt Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

The API docs on http://www.doctrine-project.org/api/common/2.4/index.html (linked from e.g. http://www.doctrine-project.org/projects.html) does not include documentation for the Doctrine\Common\Collections namespace.

Even though the code for collections is separated into its own Github module, I assume it is still a part of Doctrine Common.



 Comments   
Comment by Marco Pivetta [ 26/Jun/14 ]

That's actually a completely separate project now. We may need new sections for collections/annotations/lexer/cache

Comment by Christian Schmidt [ 26/Jun/14 ]

I see. It would be nice if the API docs were crosslinked, so the list of namespaces in the left column is complete, and so that references to classes in other projects were links (this is also an issue with e.g. Doctrine classes that inherit from classes in Common).





[DCOM-243] 'Zend OPcache' PHP extension might prevent AnnotationReader from getting entity class comments Created: 22/May/14  Updated: 22/May/14

Status: Open
Project: Doctrine Common
Component/s: Annotations
Affects Version/s: 2.4.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Victor Smirnov Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

If module Zend OPcache is installed and configured not to save comments the AnnotationReader class fails to parse data for entities.

Output from php -m contains line Zend OPcache.
The module is configured with the following parameter opcache.save_comments=0.

I would expect the AnnotationReader constructor to throw an exception. But it does not check if the module is loaded.

In addition to the check for opcache module

        if (extension_loaded('opcache') && ini_get('opcache.save_comments') == 0) {
            throw AnnotationException::optimizerPlusSaveComments();
        }

we might have a new check for the Zend OPcache module

        if (extension_loaded('Zend OPcache') && ini_get('opcache.save_comments') == 0) {
            throw AnnotationException::optimizerPlusSaveComments();
        }


 Comments   
Comment by Victor Smirnov [ 22/May/14 ]

Please check the pull request - https://github.com/doctrine/annotations/pull/35
I think this might be a simple fix.

It took us a while here to discover the issue on production. I think the setup might be quite common on production servers. Adding the check should save people time on troubleshooting.

Warm regards,
Victor





[DCOM-239] [GH-319] Add last modified time for metadata Created: 22/Mar/14  Updated: 28/May/14

Status: Open
Project: Doctrine Common
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of c960657:

Url: https://github.com/doctrine/common/pull/319

Message:

This PR is part 1 of 2. Part 1 is for the doctrine/doctrine2 repository.

Read more in https://github.com/doctrine/doctrine2/pull/986



 Comments   
Comment by Christian Schmidt [ 28/May/14 ]

All comments raised in the pull request have been addressed. What is the next step?





[DCOM-203] Ability to set defaultManager on ManagerRegistry Created: 21/Jun/13  Updated: 21/Jun/13

Status: Open
Project: Doctrine Common
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Daniel Leech Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

We (in the CMF) need to be able to change the "default manager" name at runtime, to enable switching, for example, between Production and Staging workspaces.

This is currently not possible because defaultManager is private and there is no setter.

See: https://github.com/doctrine/DoctrinePHPCRBundle/issues/73






[DCOM-160] [GH-242] adds a simple manager registry Created: 10/Jan/13  Updated: 10/Jan/13

Status: Open
Project: Doctrine Common
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of schmittjoh:

Url: https://github.com/doctrine/common/pull/242

Message:

This registry adds some sane defaults and just requires a simple callable to be fully functional.






[DCOM-80] Add common exceptions into Doctrine\Common Created: 19/Nov/11  Updated: 20/Dec/11

Status: Open
Project: Doctrine Common
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3

Type: Improvement Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Following the ZF and SF2 Standard for Exceptions we should have base exceptions in Common






[DCOM-77] add a method to force removal of any unmapped data on flush for a given object Created: 16/Nov/11  Updated: 16/Nov/11

Status: Open
Project: Doctrine Common
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major
Reporter: Lukas Kahwe Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

in order to ensure that any unmapped fields are set to their defaults or removed in the case of nosql right now there is no way to do this except with 2 flush calls: aka remove+flush, persist+flush

there should be some way to do this in one flush






[DCOM-74] Ideas for Event Manager Improvements Created: 31/Oct/11  Updated: 21/Apr/14

Status: Open
Project: Doctrine Common
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Johannes Schmitt Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

I have two ideas for improving the event manager.

1. Add a lazy-loading implementation as we discussed on IRC already (helpful for keeping the overhead of post generation schema listener down for example)
2. Providing better debugging information of what is going on (which listeners have been called for which event, similar to Symfony2's event dispatcher)



 Comments   
Comment by Guilherme Blanco [ 16/Jan/12 ]

I'm still a huge fan of DOM2 Events.

I even have the code somewhere here, but that would break BC.

Comment by Marijn Huizendveld [ 06/Feb/13 ]

Would you care to elaborate on your DOM2 Events implementation Guilherme?

Comment by Guilherme Blanco [ 21/Apr/14 ]

Marijn Huizendveld sure (like... 1 year later!)
DOM2 Events ( http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/ )
The idea is to create an event system where you can control the flow over the listeners, such as prevent the default operation or stop propagation.
I'm a big fan of this because that way any piece can be easily decoupled from the base system and become a specialized event if needed. It also can be controlled depending on the conditions to be introspected by an specific listener.

Comment by Guilherme Blanco [ 21/Apr/14 ]

I also provided a very initial draft 2 years ago, as of https://github.com/doctrine/common/pull/153





[DCOM-73] CodeGeneration using Doctrine\Common\Persistence\Mapping\ObjectMetadata Created: 24/Oct/11  Updated: 03/Dec/13

Status: Open
Project: Doctrine Common
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major
Reporter: Benjamin Eberlei Assignee: Jonathan H. Wage
Resolution: Unresolved Votes: 1
Labels: None


 Description   

Currently we have tons of code in the ODM/ORMs regarding code generation that are ugly to extend and maintain. We should extract all them into a new component, for example named: doctrine-code-generator

  • It should be feed by only instances of Doctrine\Common\Persistence\Mapping\ObjectMetadata into a twig template.
  • A base template for an entity/document is shipped
  • Maybe ORM/ODM specific child templates or twig traits are necessary to handle writing annotations. This could also be done by adding hooks into the code-generation somehow.
  • Each entity of the user can provide its own template, for examples from a configurable directory "code_templates/Vendor.ProjectBundle.Entity.User.twig" to extend the base template and add own code.
  • As a perspective we should aim for 5.4 generating a trait so that you can have your entity "class User { use UserBase; }

    "






[DCOM-67] Introduce immutable DateTime with __toString() Created: 27/Aug/11  Updated: 29/Jan/12

Status: Reopened
Project: Doctrine Common
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3

Type: Improvement Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Comments   
Comment by Benjamin Eberlei [ 27/Aug/11 ]

Implemented

Comment by Koji Ando [ 11/Jan/12 ]

Though it is implemented once on https://github.com/doctrine/common/commit/7140ad3ba0ba2a94238976dd7f310ff92b478c96,
the class is removed on https://github.com/doctrine/common/commit/f845c1e267abf9069422eba8addfa976bc8d8685.

I think this issue must be reopened.

Comment by Benjamin Eberlei [ 11/Jan/12 ]

Code was removed due to implementation problems.





[DCOM-33] Allow to register callbacks in the EventManager Created: 01/Jan/11  Updated: 01/Jan/11

Status: Open
Project: Doctrine Common
Component/s: Event System
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major
Reporter: Benjamin Eberlei Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Comments   
Comment by Benjamin Eberlei [ 01/Jan/11 ]

Consider to add a second queue for callbacks. Its not possible to simulate this by doing something like:

public function addCallbackListener($event, Closure $callback)
{
    $eventListener = new stdClass();
    $eventListener->$event = $callback;
    $this->addEventListener($event, $eventListener);
}

sad





Generated at Wed Sep 03 07:23:26 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.