[DCOM-190] [GH-273] Added visibility in the methods Interfaces Created: 06/May/13  Updated: 21/May/13  Resolved: 21/May/13

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

This adjustment aims to bring to the default PSR2.
I see more alerts and warnings this is only a part.

Thanks,
Ramon



 Comments   
Comment by Doctrine Bot [ 21/May/13 ]

A related Github Pull-Request [GH-273] was closed:
https://github.com/doctrine/common/pull/273

Comment by Marco Pivetta [ 21/May/13 ]

merged





[DCOM-130] Paths in Doctrine\Common\Cache\FileCache could create large directory indexes Created: 23/Oct/12  Updated: 10/May/13

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

Type: Bug Priority: Minor
Reporter: R Churchill Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Any



 Description   

The way paths are created within FileCache currently, there is a theoretical maximum of 16^12 directories in the cache directory, which is quite a large number. Usually schemes like this are used to restrict the number of files in one directory.

Comparing with git, for example, the dirs are arranged

00/
1c/
...
ff/

and then the object store within those directories, which is a lot more manageable, say if you happen to type ls in the cache directory, you will get a maximum listing of 256 dirs. PhpThumb does something similar when caching images.

How about something like this for getFilename():

$idHash = md5($id);
$path = substr($idHash, 0, 2) . DIRECTORY_SEPARATOR . substr($idHash, 2, 2) . DIRECTORY_SEPARATOR . substr($idHash, 4);
$path = $this->directory . DIRECTORY_SEPARATOR . $path;

return $path . $id . $this->extension;

Not nearly so elegant, but I think this has better properties for the file system. Also I would be tempted to use one of the sha family hashes and not to include the $id within the filename, but perhaps this is helpful for debugging?



 Comments   
Comment by Julian Higman [ 10/May/13 ]

We hit this problem in a live system - with a lot of cached items, the number of subdirectories that FileCache creates can exceed the number that an ext3 filesystem allows in a single directory (about 32000).

After that, an attempt to cache a new item can get an error like this:

mkdir() [function.mkdir]: Too many links

Our solution was similar to that suggested:


    protected function getFilename($id) {
        $path = implode(str_split(md5($id), 2), DIRECTORY_SEPARATOR);
        $path = $this->directory . DIRECTORY_SEPARATOR . $path;
        return $path . DIRECTORY_SEPARATOR . $id . $this->extension;
    }

It splits the md5 of the item id into parts of length 2, rather than the original 12. This creates a deeply nested structure, but which won't ever exceed the limit on number of subdirectories in any one directory. It's the same subdirectory pattern used by default by Apache mod_disk_cache, as well.





[DCOM-193] [GH-275] Improve code to throw exception getting parents class instead of php warning Created: 09/May/13  Updated: 09/May/13  Resolved: 09/May/13

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

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


 Description   

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

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

Message:

Related to https://github.com/doctrine/common/pull/274



 Comments   
Comment by Doctrine Bot [ 09/May/13 ]

A related Github Pull-Request [GH-275] was closed:
https://github.com/doctrine/common/pull/275





[DCOM-192] [GH-274] Improve code on loadMetadata() to verify if class exists Created: 07/May/13  Updated: 08/May/13  Resolved: 08/May/13

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Improve code on loadMetadata() to verify if class exists, avoid a later warning when calling class_parents()

Instead throws a \RuntimeException if class doesn't exists.

Before changing code, just after add test:
```
1) Doctrine\Tests\Common\Persistence\Mapping\ClassMetadataFactoryTest::testGetMetadataForAbsentClass
class_parents(): Class Doctrine\Tests\Common\Persistence\Mapping\AbsentClass does not exist and could not be loaded

/home/www/common/lib/Doctrine/Common/Persistence/Mapping/RuntimeReflectionService.php:38
/home/www/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:257
/home/www/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:281
/home/www/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php:212
/home/www/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ClassMetadataFactoryTest.php:44
```



 Comments   
Comment by Doctrine Bot [ 08/May/13 ]

A related Github Pull-Request [GH-274] was closed:
https://github.com/doctrine/common/pull/274

Comment by Marco Pivetta [ 08/May/13 ]

Merged





[DCOM-191] Wrong inflection for "identity" Created: 07/May/13  Updated: 07/May/13

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

Type: Bug Priority: Minor
Reporter: Tom Vogt Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None
Environment:

OS X and Linux, PHP 5.4.x



 Description   

console doctrine:generate:entities

For an association named "identities", the code generator creates the two methods
addIdentitie() and removeIdentitie() - apparently the inflector doesn't catch that it should be addIdentity and removeIdentity.






[DCOM-189] Doctrine Proxies may conflict with interfaced constructors Created: 03/May/13  Updated: 03/May/13

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

Type: Documentation Priority: Major
Reporter: Harmen M Assignee: Marco Pivetta
Resolution: Unresolved Votes: 0
Labels: None


 Description   

The Doctrine ProxyGenerator generates for a proxy a constructor. The documentation of Doctrine states that the constructor is never called. For a project, I created a group of entities with a interfaced constructor in order to enforce a common interface. This results in a incompatible proxy and so a fatal error.



 Comments   
Comment by Marco Pivetta [ 03/May/13 ]

Cannot fix this - the constructor is required to override instantiation logic

Comment by Harmen M [ 03/May/13 ]

Edit: added the correct description. I accidentially submitted the form before editing the description.

Comment by Marco Pivetta [ 03/May/13 ]

Harmen M why do you have a constructor in an interface? That's a very bad practice, and it makes things quite hard to handle.

I can think of a workaround, but I first want to be sure there's a real advantage in changing the current implementation to use

unserialize()

just to handle this specific use case.

Comment by Benjamin Eberlei [ 03/May/13 ]

Adding __construct to an interface is an anti pattern and shouldn't be done.

Comment by Harmen M [ 03/May/13 ]

Ok, then I change my implementation.

But, maybe it is an idea to update the documentation of the ORM and state that constructor interfacing is not possible?
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/architecture.html





[DCOM-152] [GH-234] Criteria filtering doesn't work with DateTime instance Created: 17/Dec/12  Updated: 30/Apr/13

Status: Awaiting Feedback
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 ludekstepan:

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

Message:

Filtering associations doesn't work with DateTime instance as a comparison value because filtering uses === operator. It works with SQL backed filtering, but not on PHP collection level.

```php
$criteria = Criteria::create()
>where(Criteria::expr()>eq("birthday", new \DateTime("1982-02-17")))
->orderBy(array("username" => "ASC"))
->setFirstResult(0)
->setMaxResults(20)
;
```






[DCOM-175] Proxies return private properties in __sleep, which is not supported by PHP. Created: 27/Mar/12  Updated: 19/Apr/13

Status: In Progress
Project: Doctrine Common
Component/s: None
Affects Version/s: 2.4
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Ryan Mauger Assignee: Marco Pivetta
Resolution: Unresolved Votes: 0
Labels: None


 Description   

__sleep should not return private parent property names (see http://php.net/__sleep) this raises notices, and also results in the value of the property being 'N' (null) instead of keeping its value.

I am unfortunately stuck having to serialize proxies in my revision tracking, as doctrine seems to be currently ignoring the fetch="EAGER" I set on the related properties.

Proxies should use the Serializable interface, and not __sleep, or not return parent property names which are private, it serves no purpose, and is not supported by PHP itself anyway.

Also, if you keep __sleep, but do not return the parent property names, then it will only include the items you return, so it would be better to simply drop the __sleep method, I cannot actually see any useful purpose it serves.



 Comments   
Comment by Ryan Mauger [ 27/Mar/12 ]

just updated the issue body, realised that I worded something badly.

Comment by Marco Pivetta [ 23/Jan/13 ]

Ryan Mauger I think that's a limitation we have. We use `__sleep` to avoid serializing fields like the initializers and the persisters of course.

Even by implementing serializable, it would only work if the end user implemented it in the parent class.

Tempted to mark it as "can't fix"

Comment by Marco Pivetta [ 24/Jan/13 ]

I think there's a solution by having something like following:

class SomeGeneratedProxyName extends RealName implements \Serializable
{
    public function unserialize($data)
    {
        $reflectionClass = new ReflectionClass($this);
        foreach ($reflectionClass->getProperties(ReflectionProperty::IS_PRIVATE) as $privateProp) {
            $privateProp->setAccessible(true);
            $privateProp->setValue($this, $data[$privateProp->getName()]);
        }
        // ... other props ...
    }

    public function serialize()
    {
        $data = array();
        $reflectionClass = new ReflectionClass($this);
        foreach ($reflectionClass->getProperties(ReflectionProperty::IS_PRIVATE) as $privateProp) {
            $privateProp->setAccessible(true);
            $data[$privateProp->getName()] = $privateProp->getValue($this);
        }
        // ... other props ...
        return $data;
    }
}
Comment by Marco Pivetta [ 23/Feb/13 ]

Ryan Mauger I started implementing this one at https://github.com/Ocramius/common/compare/hotfix;DCOM-175 and so far it looks promising.

The only doubts so far are with handling cases like following:

class MyEntity implements Serializable
{
    public function serialize()
    {
        // [...]
    }

    public function unserialize($serialized)
    {
        // [...]
    }

    public function __sleep()
    {
        // [...]
    }

    public function __wakeup()
    {
        // [...]
    }
}

So far I didn't get to write tests that demonstrate the exact behaviour for this case, but it looks like when `Serializable` is implemented, `_sleep` and `_wakeup` are ignored. Any thoughts on this?

Comment by Marco Pivetta [ 19/Apr/13 ]

A possible solution is to use something like http://eval.in/16806, and thus exploiting the ability of php to retrieve an object's private properties by using the special

chr(0) . 'Foo' . chr(0) . 'bar'

trick.

This can be abstracted by using

array_keys((array) $object);

, which retrieves also those special keys





[DCOM-188] [GH-272] MappingDriverChain: the default driver wasn't called for getAllClassNames() Created: 16/Apr/13  Updated: 16/Apr/13  Resolved: 16/Apr/13

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

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

`MappingDriverChain::getAllClassNames()` would call and merge sub-drivers `getAllClassNames()` results, but not for the default driver.

I added a test that reproduced the problem, and then fixed it.



 Comments   
Comment by Doctrine Bot [ 16/Apr/13 ]

A related Github Pull-Request [GH-272] was closed:
https://github.com/doctrine/common/pull/272

Comment by Marco Pivetta [ 16/Apr/13 ]

Merged





[DCOM-170] [GH-250] Adding export attributes Created: 27/Jan/13  Updated: 16/Apr/13  Resolved: 16/Apr/13

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

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

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

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

Message:



 Comments   
Comment by Doctrine Bot [ 16/Apr/13 ]

A related Github Pull-Request [GH-250] was closed:
https://github.com/doctrine/common/pull/250

Comment by Marco Pivetta [ 16/Apr/13 ]

No good positive feedback - no need to force it in





[DCOM-187] [GH-270] Allow empty arrays in annotations Created: 29/Mar/13  Updated: 29/Mar/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 kitsunet:

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

Message:

an empty array so far is impossible as it either results in a parse error if you just do the obvious {} or if you try

{""}

it will create an empty entry which in turn will cause errors depending on the annotation.






[DCOM-186] [GH-269] ProxyGenerator eval() proxy code when $autoGenerate is true Created: 28/Mar/13  Updated: 28/Mar/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 mnapoli:

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

Message:

ProxyGenerator eval() proxy code instead of writing it to disk when $autoGenerate is true.

Related to DDC-2210(http://www.doctrine-project.org/jira/browse/DDC-2210)

The idea of eval() the proxy code was suggested by @ocramius in response to the fact that in dev environment, concurrent file writes create errors.

This would also simplify the setup for a dev environment: no more proxy directory to create and make writeable.






[DCOM-185] DQL errors when attempting to use GROUP BY MAX(field) Created: 26/Mar/13  Updated: 26/Mar/13

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

Type: Bug Priority: Major
Reporter: Jon Langevin Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: dql, groupby, max


 Description   

Attempting to run DQL similar to:
SELECT a FROM ClassName a GROUP BY MAX(a.depth)

Throws error:
[Semantical Error] line 0, col 250 near 'MAX(ao.depth)': Error: Cannot group by undefined identification or result variable.

Per docs, MAX is allowed within GROUP BY: http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html#aggregate-functions

If this error is due to some omission on my part, then perhaps the docs should be extended to show a valid GROUP BY MAX() usage, or the error message expanded for a better hint.






[DCOM-184] [GH-266] Add a new method to use a filter before extracting the metadata Created: 12/Mar/13  Updated: 12/Mar/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 nicolasTheodo:

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

Message:

Hi

I have notice that, when you use the doctrine:mapping:convert and doctrine:mapping:import command in symfony, the filter is added after all the metadata are extracting from the database.
In this case, when you have a table with no primary key for example, you cannot extract the mapping for only one entity.

I have also made a pull-request into the doctrineBundle and doctrine2 to fix this issue.
https://github.com/doctrine/DoctrineBundle/pull/161
https://github.com/doctrine/doctrine2/pull/603

What are your thought about my issue?






[DCOM-183] [GH-262] Fixed travis build Created: 11/Mar/13  Updated: 11/Mar/13  Resolved: 11/Mar/13

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

since composer/composer#1005 composer updates --dev by default.



 Comments   
Comment by Benjamin Eberlei [ 11/Mar/13 ]

A related Github Pull-Request [GH-262] was closed
https://github.com/doctrine/common/pull/262





[DCOM-182] [GH-261] Fixed typos Created: 11/Mar/13  Updated: 11/Mar/13  Resolved: 11/Mar/13

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:



 Comments   
Comment by Benjamin Eberlei [ 11/Mar/13 ]

A related Github Pull-Request [GH-261] was opened
https://github.com/doctrine/common/pull/261

Comment by Benjamin Eberlei [ 11/Mar/13 ]

A related Github Pull-Request [GH-261] was closed
https://github.com/doctrine/common/pull/261





[DCOM-181] [GH-260] Hotfix/issue #259 Created: 07/Mar/13  Updated: 08/Mar/13  Resolved: 08/Mar/13

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

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Hotfix for doctrine/common#259



 Comments   
Comment by Benjamin Eberlei [ 07/Mar/13 ]

A related Github Pull-Request [GH-260] was closed
https://github.com/doctrine/common/pull/260





[DCOM-180] Entity with field $key passes orm:validate but db create will fail Created: 03/Mar/13  Updated: 03/Mar/13

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

Type: Improvement Priority: Trivial
Reporter: exoon Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None
Environment:

apache2 php mysql



 Description   

There should be a warning if you name a field $key.






[DCOM-179] Underscore at the end of a label is not working with annotations Created: 03/Mar/13  Updated: 03/Mar/13

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

Type: Bug Priority: Minor
Reporter: exoon Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None
Environment:

apache2, php 5.4, mysql



 Description   

use Zend\Form\Annotation;

[...]

works:

  • @Annotation\Options( {"label":Namespace\Entity::LABEL}

    )
    or

  • @Annotation\Options( {"label":Namespace\Entity::_LABEL}

    )
    or

  • @Annotation\Options( {"label":Namespace\Entity::LA_BEL}

    )

works not:

  • @Annotation\Options( {"label":Namespace\Entity::LABEL_}

    )

Error message:

/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationException.php:52

[Semantical Error] Couldn't find constant Namespace\Entity\::LABEL, property ...

The _ at the end is missing.






[DCOM-178] [GH-258] Add an prefix to ApcCache Created: 03/Mar/13  Updated: 03/Mar/13  Resolved: 03/Mar/13

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

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

In shared hosting I ran into cache-collision. This gives users the option to avoid this problem.



 Comments   
Comment by Benjamin Eberlei [ 03/Mar/13 ]

A related Github Pull-Request [GH-258] was closed
https://github.com/doctrine/common/pull/258





[DCOM-177] [GH-257] Add an prefix to ApcCache Created: 03/Mar/13  Updated: 03/Mar/13  Resolved: 03/Mar/13

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

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

In shared hosting I ran into cache-collision. This gives users the option to avoid this problem.



 Comments   
Comment by Benjamin Eberlei [ 03/Mar/13 ]

A related Github Pull-Request [GH-257] was closed
https://github.com/doctrine/common/pull/257





[DCOM-176] [GH-256] Refactored AnnotationDriver to handle only required classes Created: 01/Mar/13  Updated: 01/Mar/13  Resolved: 01/Mar/13

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

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

Whilst debugging an issue I was having I found that the AnnotationDriver uses get_declared_classes() and iterates over the result to identify classes that should be handled.

This seems like a ridiculous overhead especially as it then instantiated a ReflectionClass for each declared class. As an example my current project was iterating over 522 items when it needed to only handle 6.

I've kept the alterations to a minimum but it now takes a snapshot of the declared classes before and after the require for the files and then uses array_diff to get only the classes we are targeting.



 Comments   
Comment by Marco Pivetta [ 01/Mar/13 ]

Patch breaks logic when files where already included

Comment by Benjamin Eberlei [ 01/Mar/13 ]

A related Github Pull-Request [GH-256] was closed
https://github.com/doctrine/common/pull/256





[DCOM-139] [GH-220] replaced silence operator by is_file() check Created: 16/Nov/12  Updated: 21/Feb/13  Resolved: 21/Feb/13

Status: Closed
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: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:






[DCOM-72] Change CommonException to interface and use it everywhere! Created: 22/Oct/11  Updated: 21/Feb/13  Resolved: 21/Feb/13

Status: Closed
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: Duplicate Votes: 0
Labels: None


 Comments   
Comment by Benjamin Eberlei [ 22/Oct/11 ]

This is also necessary for everything else that accepts a class name, we should compile a list of the most important methods.

Comment by Marco Pivetta [ 21/Feb/13 ]

See DCOM-80





[DCOM-105] Common base exception class Created: 27/Aug/12  Updated: 21/Feb/13  Resolved: 21/Feb/13

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

Type: Improvement Priority: Major
Reporter: Till Assignee: Marco Pivetta
Resolution: Duplicate Votes: 0
Labels: None


 Description   

Per our discussion on IRC/Twitter.

It would be nice if all exceptions thrown had a common base, so something like this is possible to catch all exceptions from Doctrine:

try {
    // some code here
} catch (\Doctrine\Common\BaseException $e) {
    // something in Doctrine threw an exception, handle it here
}

(The name is just an example.)

For reference:
https://wiki.php.net/pear/rfc/pear2_exception_policy



 Comments   
Comment by Christophe Coevoet [ 27/Aug/12 ]

Instead of a base class (which forbids extending the SPL exception), I would go the same way than Symfony2 and ZF: using an interface.

Comment by Till [ 27/Aug/12 ]

That's basically what the PEAR2 RFC is doing.

Comment by Marco Pivetta [ 21/Feb/13 ]

Duplicate of DCOM-80





[DCOM-135] [GH-214] [WIP] [Cache] Move cache ID namespacing to CacheNamespace class Created: 12/Nov/12  Updated: 21/Feb/13  Resolved: 21/Feb/13

Status: Closed
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: Incomplete Votes: 0
Labels: None


 Description   

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

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

Message:






[DCOM-173] Add test assets and tests for proxy generators Created: 18/Feb/13  Updated: 21/Feb/13  Due: 18/Feb/13  Resolved: 21/Feb/13

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

Type: Bug Priority: Blocker
Reporter: Marco Pivetta Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None


 Description   

Need to add tests assets to check __isset __get __set, etc. Currently only code generation for proxies inheriting __sleep is tested.



 Comments   
Comment by Marco Pivetta [ 18/Feb/13 ]

See https://github.com/doctrine/common/pull/255

Comment by Marco Pivetta [ 21/Feb/13 ]

Merged





[DCOM-172] [GH-254] Update lib/Doctrine/Common/Proxy/ProxyGenerator.php Created: 18/Feb/13  Updated: 19/Feb/13  Resolved: 19/Feb/13

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Added missed semicolon



 Comments   
Comment by Benjamin Eberlei [ 18/Feb/13 ]

A related Github Pull-Request [GH-254] was opened
https://github.com/doctrine/common/pull/254

Comment by Benjamin Eberlei [ 18/Feb/13 ]

A related Github Pull-Request [GH-254] was closed
https://github.com/doctrine/common/pull/254

Comment by Marco Pivetta [ 19/Feb/13 ]

Continuing in DCOM-173

Comment by Benjamin Eberlei [ 19/Feb/13 ]

A related Github Pull-Request [GH-255] was closed
https://github.com/doctrine/common/pull/255





[DCOM-174] [GH-255] Hotfix/dcom 173 tests Created: 18/Feb/13  Updated: 19/Feb/13  Resolved: 18/Feb/13

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

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Duplicate Votes: 0
Labels: None


 Description   

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

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

Message:

This PR introduces tests to avoid epic fails such as #254 and #253



 Comments   
Comment by Marco Pivetta [ 18/Feb/13 ]

Handled in DCOM-173

Comment by Benjamin Eberlei [ 19/Feb/13 ]

A related Github Pull-Request [GH-255] was closed
https://github.com/doctrine/common/pull/255





[DCOM-171] [GH-253] Proxy Generation Bug Created: 16/Feb/13  Updated: 16/Feb/13  Resolved: 16/Feb/13

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Added missing semi colon and removed backslashes previously used to escape function arguments



 Comments   
Comment by Benjamin Eberlei [ 16/Feb/13 ]

A related Github Pull-Request [GH-253] was closed
https://github.com/doctrine/common/pull/253





[DCOM-74] Ideas for Event Manager Improvements Created: 31/Oct/11  Updated: 06/Feb/13

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?





[DCOM-169] [GH-249] Namespaced the PR246 test case Created: 27/Jan/13  Updated: 29/Jan/13  Resolved: 29/Jan/13

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Sorry, I've forgot the namespace in the test case of my previous PR, which has just been merged.



 Comments   
Comment by Benjamin Eberlei [ 29/Jan/13 ]

A related Github Pull-Request [GH-249] was closed
https://github.com/doctrine/common/pull/249





[DCOM-168] ignoredAnnotationNames doesn't work in Annotation loop Created: 27/Jan/13  Updated: 27/Jan/13

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

Type: Bug Priority: Minor
Reporter: James S Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Mac OSX 10.6.8



 Description   

I'm just starting out with Doctrine, so my setup is a bit messy, but hopefully someone can figure out what is relevant from all my code.

Basically, I'm using Annotations on Doctrine ORM, and am integrating with Gedmo for several of their extensions.

I can run the CLI tool and update the schema, but when running via my web server, I'm getting the following error:

object(Doctrine\Common\Annotations\AnnotationException)[150]
  protected 'message' => string '[Semantical Error] The annotation "@Entity" in class Innertube\Models\Device was never imported. Did you maybe forget to add a "use" statement for this annotation?' (length=163)
  private 'string' (Exception) => string '' (length=0)
  protected 'code' => int 0
  protected 'file' => string '/Users/jshannon/Documents/Work/Projects/InnerTube/Repo/web/packages/lerteco_innertube/libraries/lerteco_framework/libraries/vendor-composer/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationException.php' (length=211)
  protected 'line' => int 52
  private 'trace' (Exception) => 
    array
      0 => 
        array
          'file' => string '/Users/jshannon/Documents/Work/Projects/InnerTube/Repo/web/packages/lerteco_innertube/libraries/lerteco_framework/libraries/vendor-composer/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php' (length=201)
          'line' => int 592
          'function' => string 'semanticalError' (length=15)
          'class' => string 'Doctrine\Common\Annotations\AnnotationException' (length=47)
          'type' => string '::' (length=2)
          'args' => 
            array
              ...
      1 => 
        array
          'file' => string '/Users/jshannon/Documents/Work/Projects/InnerTube/Repo/web/packages/lerteco_innertube/libraries/lerteco_framework/libraries/vendor-composer/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php' (length=201)
          'line' => int 533
          'function' => string 'Annotation' (length=10)
          'class' => string 'Doctrine\Common\Annotations\DocParser' (length=37)
          'type' => string '->' (length=2)
          'args' => 
            array
              ...
      2 => 
        array
          'file' => string '/Users/jshannon/Documents/Work/Projects/InnerTube/Repo/web/packages/lerteco_innertube/libraries/lerteco_framework/libraries/vendor-composer/doctrine/common/lib/Doctrine/Common/Annotations/DocParser.php' (length=201)
          'line' => int 297
          'function' => string 'Annotations' (length=11)
          'class' => string 'Doctrine\Common\Annotations\DocParser' (length=37)
          'type' => string '->' (length=2)
          'args' => 
            array
              ...
      3 => 
        array
          'file' => string '/Users/jshannon/Documents/Work/Projects/InnerTube/Repo/web/packages/lerteco_innertube/libraries/lerteco_framework/libraries/vendor-composer/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationReader.php' (length=208)
          'line' => int 151
          'function' => string 'parse' (length=5)
          'class' => string 'Doctrine\Common\Annotations\DocParser' (length=37)
          'type' => string '->' (length=2)
          'args' => 
            array
              ...
      4 => 
        array
          'file' => string '/Users/jshannon/Documents/Work/Projects/InnerTube/Repo/web/packages/lerteco_innertube/libraries/lerteco_framework/libraries/vendor-composer/doctrine/common/lib/Doctrine/Common/Annotations/CachedReader.php' (length=204)
          'line' => int 86
          'function' => string 'getClassAnnotations' (length=19)
          'class' => string 'Doctrine\Common\Annotations\AnnotationReader' (length=44)
          'type' => string '->' (length=2)
          'args' => 
            array
              ...
      5 => 
        array
          'file' => string '/Users/jshannon/Documents/Work/Projects/InnerTube/Repo/web/packages/lerteco_innertube/libraries/lerteco_framework/libraries/vendor-composer/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php' (length=205)
          'line' => int 61
          'function' => string 'getClassAnnotations' (length=19)
          'class' => string 'Doctrine\Common\Annotations\CachedReader' (length=40)
          'type' => string '->' (length=2)
          'args' => 
            array
              ...
      6 => 
        array
          'file' => string '/Users/jshannon/Documents/Work/Projects/InnerTube/Repo/web/packages/lerteco_innertube/libraries/lerteco_framework/libraries/vendor-composer/doctrine/orm/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php' (length=202)
          'line' => int 112
          'function' => string 'loadMetadataForClass' (length=20)
          'class' => string 'Doctrine\ORM\Mapping\Driver\AnnotationDriver' (length=44)
          'type' => string '->' (length=2)
          'args' => 
            array
              ...
      7 => 
        array
          'file' => string '/Users/jshannon/Documents/Work/Projects/InnerTube/Repo/web/packages/lerteco_innertube/libraries/lerteco_framework/libraries/vendor-composer/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php' (length=228)
          'line' => int 302
          'function' => string 'doLoadMetadata' (length=14)
          'class' => string 'Doctrine\ORM\Mapping\ClassMetadataFactory' (length=41)
          'type' => string '->' (length=2)
          'args' => 
            array
              ...
      8 => 
        array
          'file' => string '/Users/jshannon/Documents/Work/Projects/InnerTube/Repo/web/packages/lerteco_innertube/libraries/lerteco_framework/libraries/vendor-composer/doctrine/common/lib/Doctrine/Common/Persistence/Mapping/AbstractClassMetadataFactory.php' (length=228)
          'line' => int 205
          'function' => string 'loadMetadata' (length=12)
          'class' => string 'Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory' (length=64)
          'type' => string '->' (length=2)
          'args' => 
            array
              ...
      9 => 
        array
          'file' => string '/Users/jshannon/Documents/Work/Projects/InnerTube/Repo/web/packages/lerteco_innertube/libraries/lerteco_framework/libraries/vendor-composer/doctrine/orm/lib/Doctrine/ORM/EntityManager.php' (length=187)
          'line' => int 268
          'function' => string 'getMetadataFor' (length=14)
          'class' => string 'Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory' (length=64)
          'type' => string '->' (length=2)
          'args' => 
            array
              ...
      10 => 
        array
          'file' => string '/Users/jshannon/Documents/Work/Projects/InnerTube/Repo/web/packages/lerteco_innertube/libraries/lerteco_framework/libraries/vendor-composer/doctrine/orm/lib/Doctrine/ORM/EntityManager.php' (length=187)
          'line' => int 682
          'function' => string 'getClassMetadata' (length=16)
          'class' => string 'Doctrine\ORM\EntityManager' (length=26)
          'type' => string '->' (length=2)
          'args' => 
            array
              ...
      11 => 
        array
          'file' => string '/Users/jshannon/Documents/Work/Projects/InnerTube/Repo/web/packages/lerteco_innertube/api/routes/devices.php' (length=108)
          'line' => int 16
          'function' => string 'getRepository' (length=13)
          'class' => string 'Doctrine\ORM\EntityManager' (length=26)

The call that initiates this is getRepository(), which IS NOT in the CLI.

I've tracked it down to the fact that DocParser is not getting the list of names to ignore.

Oddly, it gets it the first time that it's called by AnnotationReader. However, DocParser->parse() calls $this->Annotations(), which calls $this->Annotation(), calls $this->collectAnnotationMetadata(), which then creates a new parser

self::$metadataParser = new self();

and eventually parses it

self::$metadataParser->parse()

, but DOES NOT pass its ignorednames.

This seems like an oversight, but it clearly works for a lot of people. My configuration code is:

                if (self::$isDevMode) {
			$cache = new \Doctrine\Common\Cache\ArrayCache;
		} else {
			$cache = new \Doctrine\Common\Cache\ApcCache;
		}

		\Doctrine\Common\Annotations\AnnotationReader::addGlobalIgnoredName('package');

		AnnotationRegistry::registerFile(__DIR__ . "/vendor-composer/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php");
		\Gedmo\DoctrineExtensions::registerAnnotations();

		

		$annotationReader = new \Doctrine\Common\Annotations\AnnotationReader();
		$cachedAnnotationReader = new \Doctrine\Common\Annotations\CachedReader($annotationReader, $cache);



		$annotationDriver = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($cachedAnnotationReader, self::$namespaceArray);

		$config = new \Doctrine\ORM\Configuration;
		$config->setProxyNamespace('Proxy');
		$config->setAutoGenerateProxyClasses(self::$isDevMode); // this can be based on production config.
		// register metadata driver
		$config->setMetadataDriverImpl($annotationDriver);
		// use our allready initialized cache driver
		$config->setMetadataCacheImpl($cache);
		$config->setQueryCacheImpl($cache);

		if (defined('DIR_FILES_CACHE')) {
			$config->setProxyDir(DIR_FILES_CACHE);
		} else {
			$config->setProxyDir(sys_get_temp_dir());
		}

		// create event manager and hook prefered extension listeners
		$evm = new \Doctrine\Common\EventManager();

		$prefix = new TablePrefix(null);
		$prefix->useNamespace(true);
		$evm->addEventListener(\Doctrine\ORM\Events::loadClassMetadata, $prefix);


		$blameableListener = new \Gedmo\Blameable\BlameableListener();
		$blameableListener->setAnnotationReader($config->getMetadataDriverImpl()->getReader());
		//class_exists makes this usable with the command-line
		if (class_exists('\User') && ($u = new \User()) != false) {
			$blameableListener->setUserValue($u->getUserID());
		}
		$evm->addEventSubscriber($blameableListener);


		$timestampableListener = new \Gedmo\Timestampable\TimestampableListener();
		$timestampableListener->setAnnotationReader($config->getMetadataDriverImpl()->getReader());
		$evm->addEventSubscriber($timestampableListener);

		$config->addFilter('soft-deleteable', '\Gedmo\SoftDeleteable\Filter\SoftDeleteableFilter');


		return EntityManager::create($connectionOptions, $config, $evm);

and the entity is (which sets up the repository) is:

namespace Innertube\Models;
defined('C5_EXECUTE') or die('Access Denied.');

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Gedmo\Mapping\Annotation as Gedmo;

/**
 * @ORM\Entity(repositoryClass="DeviceRepository") @ORM\Table(name="Devices")
 * @Gedmo\SoftDeleteable(fieldName="deletedOn")
 **/
class Device {

and the repository is:

namespace Innertube\Models;
defined('C5_EXECUTE') or die('Access Denied.');

use Doctrine\ORM\EntityRepository;

class DeviceRepository extends EntityRepository {





[DCOM-167] [GH-248] Hotfix/doctrine/common#247 fixes Created: 26/Jan/13  Updated: 26/Jan/13  Resolved: 26/Jan/13

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

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


 Description   

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

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

Message:

Includes fixes suggested for #247 (plus a weird fix on a failure with `array_map` on PHP <5.4)



 Comments   
Comment by Benjamin Eberlei [ 26/Jan/13 ]

A related Github Pull-Request [GH-248] was closed
https://github.com/doctrine/common/pull/248





[DCOM-166] [GH-246] Undefined variable fix Created: 25/Jan/13  Updated: 26/Jan/13  Resolved: 26/Jan/13

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:



 Comments   
Comment by Benjamin Eberlei [ 26/Jan/13 ]

A related Github Pull-Request [GH-246] was closed
https://github.com/doctrine/common/pull/246





[DCOM-165] Entities seems not be recognized by AnnotationDriver Created: 02/Sep/12  Updated: 23/Jan/13

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

Type: Bug Priority: Trivial
Reporter: Maarten de Keizer Assignee: Marco Pivetta
Resolution: Unresolved Votes: 0
Labels: annotationdriver, realpath, symlink, windows
Environment:

Windows 7 Profesional, Enterprise and Windows Server 2003 and 2008; Common: 2.2.3 DBAL: 2.2.2 ORM: 2.2.3; PHP 5.4.5 and 5.3.5



 Description   

Problem:
--------
"$em->getMetadataFactory()->getAllMetadata()"
Will result in an empty array. The entitiy manager is correctly configured and the entities files are loaded (echo's in the files will be displayed).

Debug steps:
------------
Looking in the code for the problem I created the following debug points first:

file AnnotationDriver.php method getAllClassNames()
after the line: "$includedFiles[] = $sourceFile;"
add: "echo $sourceFile . ' is loaded' . PHP_EOL;"

file AnnotationDriver.php method getAllClassNames()
after the line: "$sourceFile = $rc->getFileName();"
add: "echo $className . ' is loaded from: ' . $sourceFile . ' in the includedFiles array? ' . (in_array($sourceFile, $includedFiles) ? 'YES' : 'not found ') . PHP_EOL;"

the following output will be displayed:
...
f:\workspace\nl.markei.posto-2.3\lib\relaties\Contact.php is loaded
...
nl\markei\posto\relaties\Contact is loaded from: F:\workspace\nl.markei.posto-2.3\lib\relaties\Contact.php in the includedFiles array? not found

It seems that Doctrine includes the file from f: but ReflectionClass say it is loaded from F:. The in_array() will fail and Doctrine will not recognized the entity.

But this is not the full problem. I created a new debug point:

file AnnotationDriver.php method getAllClassNames()
after the line: "foreach ($this->_paths as $path) {"
add: "echo 'path: ' . $path . ' after realpath: ' . realpath($path) . PHP_EOL;"

This will result in the following output:
"path: F:\domains\markei.nl\lib\nl.markei.posto\ after realpath: f:\workspace\nl.markei.posto-2.3\lib"

So the conversion of the F: to f: is done by realpath; its look like

A simple fix should be in AnnotationDriver.php / getAllClassNames()
replace: "$sourceFile = $rc->getFileName();"
by: "$sourceFile = realpath($rc->getFileName());"

After I did that, the problem still exists. So I add to echo's (one with realpath and one without at the part of the code). And both echo's result in a path starting with "F:".

So my first reaction was freaky!

After some frustrating hours I found the problem in the symlink I used.
"F:\domains\markei.nl\lib\nl.markei.posto" was a symlink to "f:\workspace\nl.markei.posto-2.3\lib" and realpath will not convert the driver char in the target of the symlink for some freaky reason. After changing the symlink target to "F:\workspace...." everything works fine.

Summary:
--------
realpath results are not consistent on Windows. This will resulting in problems under Windows.

Possible solutions:
-------------------
Saying "this is a PHP bug".
It is possible that there are more case sensitive problems hidding here on Windows. Maybe it is better to use (for Windows only!) a case insensitive in_array-alternative in AnnotationDriver.php getAllClassNames() (or convert all paths for to lowercase for Windows)



 Comments   
Comment by Marco Pivetta [ 23/Jan/13 ]

Maarten de Keizer looks like the issue is still there in doctrine/annotations. Are you able to come up with a failing test case?





[DCOM-164] @type phpdoc annotations are not ignored (@type == @var) Created: 22/Jan/13  Updated: 22/Jan/13

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

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


 Description   

phpDocumentor guys wrote their own PSR to define how to use phpdoc properly (https://github.com/phpDocumentor/phpDocumentor2/blob/develop/docs/PSR.md).

They deprecate the @var annotation and recommend using @type instead.

The @type (phpdoc) annotation is not blacklisted/ignored by the AnnotationReader. Code that uses this annotation raises errors with Doctrine/Annotations.

@type should be blacklisted/ignored, but may that create BC breaks for users?



 Comments   
Comment by Matthieu Napoli [ 22/Jan/13 ]

PR: https://github.com/doctrine/annotations/pull/2





[DCOM-148] [GH-229] Decorator base class for object manager decorators Created: 25/Nov/12  Updated: 20/Jan/13  Resolved: 20/Jan/13

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

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


 Description   

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

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

Message:

As discussed on IRC, the first PR for decorator base classes. This time for ObjectManager.






[DCOM-163] [GH-245] Documentation fixes Created: 20/Jan/13  Updated: 20/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 BenMorel:

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

Message:

Documentation fixes, continuing the work done on [ORM](https://github.com/doctrine/doctrine2/pull/528) and [DBAL](https://github.com/doctrine/dbal/pull/243).

  • Missing docblocks
  • Missing / incorrect `@param` / `@return` / `@throws` annotations
  • Missing newlines between annotations
  • Incorrect vertical alignment of `@param` annotations
  • Incorrect doctrine-project.org links
  • SVN leftovers cleanup
  • Licensing (LGPL => MIT)





[DCOM-162] [GH-244] return parameter for debug method Created: 14/Jan/13  Updated: 14/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 sethunath:

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

Message:

Added $return as 4th parameter to specify whether to return the debug text or print it. It works similar to print_r function






[DCOM-137] [GH-218] hotfix cache Created: 16/Nov/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Closed
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: Duplicate Votes: 0
Labels: None


 Description   

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

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

Message:

a) replaced silence operator by is_file() check.
If there is a lock or permission problem while unlinking a file, the error should pop up.
b) replaced little typo in constant name (availiable => available)



 Comments   
Comment by Benjamin Eberlei [ 16/Nov/12 ]

A related Github Pull-Request [GH-218] was closed
https://github.com/doctrine/common/pull/218

Comment by Marco Pivetta [ 14/Jan/13 ]

Moved to DCOM-138 and DCOM-139





[DCOM-150] [GH-232] [DocParser] Don't check class exists if annotation name is ignored Created: 10/Dec/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Closed
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: Duplicate Votes: 0
Labels: None


 Description   

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

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

Message:

DocParser checks for the exist of all the annotation names even if they are ignored. Maybe this is feature , but i don't sure.



 Comments   
Comment by Benjamin Eberlei [ 10/Dec/12 ]

A related Github Pull-Request [GH-232] was closed
https://github.com/doctrine/common/pull/232

Comment by Marco Pivetta [ 14/Jan/13 ]

Superseded by DCOM-151





[DCOM-149] [GH-231] Fixing CS Created: 04/Dec/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:



 Comments   
Comment by Benjamin Eberlei [ 04/Dec/12 ]

A related Github Pull-Request [GH-231] was closed
https://github.com/doctrine/common/pull/231





[DCOM-147] [GH-227] [DDC-2160] Smart Pluralize/Singularize support for Doctrine/Common/Util/Inflector Created: 23/Nov/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Doctrine/ORM/Tools/EntityGenerator should pluralize/signularize correctly.

This PR adds functionality to Doctrine/Common/Util/Inflector to singularize/pluralize. The code is largely borrowed from a similar class in the CakePHP project - I'm not sure if the updates to the class doc covers the requirements for this.

Test coverage also added.






[DCOM-141] [GH-221] strip invalid characters Created: 17/Nov/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

This patch is proposal to fix #180
by replace invalid characters and hashing the filename as sub directories to create a unique path.






[DCOM-134] [GH-213] Added sort option for array collection Created: 11/Nov/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Closed
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: Won't Fix Votes: 0
Labels: None


 Description   

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

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

Message:

I have added a sorter class and sortBy method for the ArrayCollection class. It gives the option to reorder the ArrayCollection after someone has gotten it from the database, e.g. from a relationship. It takes an array of method names to sort by in order to priority and it takes an optional boolean to set the order to ascending. Here is an example:

`$arraycollection->sortBy(array('getName()', 'getAddress()'));`

It will recursively loop the collection change the order. Each time it will look to see if the previous matching option is the same as for the previous element and then store those elements in list to be reordered.

Once it has looped all the elements it will reorder the elements it has matched and if there is another option to reorder by it will loop only the elements it matched last time so it is not looping the whole array each time.



 Comments   
Comment by Marco Pivetta [ 14/Jan/13 ]

Can't change because of BC, and the performance impact is too high





[DCOM-132] [GH-211] Cache interface fix Created: 01/Nov/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Closed
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: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

The CacheProvider contained more public methods,
which were not defined in the Cache interface.



 Comments   
Comment by Benjamin Eberlei [ 09/Nov/12 ]

A related Github Pull-Request [GH-211] was closed
https://github.com/doctrine/common/pull/211





[DCOM-127] [GH-206] Debug::export ArrayIterator dumps the internal storage variable Created: 19/Oct/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Following my previous PR https://github.com/doctrine/common/pull/191 I found also ArrayIterator needs special behaviour.






[DCOM-126] [GH-205] Fixed a typo in PHPdoc Created: 17/Oct/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

A unnecessary new line was inserted in ClassLoader.php



 Comments   
Comment by Benjamin Eberlei [ 17/Oct/12 ]

A related Github Pull-Request [GH-205] was closed
https://github.com/doctrine/common/pull/205





[DCOM-125] [GH-204] Bad function call in Debug::toString() Created: 17/Oct/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Fixed an (obviously) over used function which were calling [method_exists](http://php.net/method_exists) function the wrong way.

In `Doctrine\Common\Util\Debug::toString($obj)`
From `method_exists('__toString',$obj)`
To `method_exists($obj,'__toString')`



 Comments   
Comment by Benjamin Eberlei [ 17/Oct/12 ]

A related Github Pull-Request [GH-204] was closed
https://github.com/doctrine/common/pull/204





[DCOM-124] [GH-203] Added deleteByPregix, deleteBySuffix, deleteByRegex in CacheProvider Created: 16/Oct/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Closed
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: Won't Fix Votes: 0
Labels: None


 Description   

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

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

Message:

I found that this feature is missing.






[DCOM-119] [GH-196] Make getNamespacedId protected instead of private Created: 02/Oct/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Closed
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: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

We want to extend the cache class provider MemcacheCache.php in order to set a custom namespace. However, because getNamespacedId is a private method, basically a complete rewrite and code duplication of the class is needed.
Is there any reason for this method to be private instead of protected?
Thanks in advace,

--JN



 Comments   
Comment by Benjamin Eberlei [ 02/Oct/12 ]

A related Github Pull-Request [GH-196] was closed
https://github.com/doctrine/common/pull/196





[DCOM-117] [GH-194] If that $element exists give it back Created: 28/Sep/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Closed
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: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

I think it would very useful to get back the element that matched



 Comments   
Comment by Benjamin Eberlei [ 01/Oct/12 ]

A related Github Pull-Request [GH-194] was closed
https://github.com/doctrine/common/pull/194





[DCOM-107] [GH-183] Fix bug in classExists when using multiple autoloaders (i.e. ZF2) Created: 17/Sep/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

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

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Duplicate Votes: 0
Labels: None


 Description   

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

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

Message:

The autoloading routine in the classExists method makes the assumption the autoload method always returns a value (i.e. no void) when the autoloading of a class is succesfull. When you have multiple autoloaders registered to the spl stack this can lead to problems. In my case I'm using ZF2 ClassmapAutoloader and StandardAutoloader as fallback. The classmapAutoloader returns nothing so the autoload method in the StandardAutoloader is called as well, because the for loop is continued. This results in a second include, and a fatal error "Cannot redeclare class" is triggered.



 Comments   
Comment by Benjamin Eberlei [ 17/Sep/12 ]

A related Github Pull-Request [GH-183] was closed
https://github.com/doctrine/common/pull/183

Comment by Marco Pivetta [ 14/Jan/13 ]

Handled in DCOM-136





[DCOM-108] [GH-184] Fix bug in classExists when using multiple autoloaders (i.e. ZF2) Created: 17/Sep/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

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

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Duplicate Votes: 0
Labels: None


 Description   

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

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

Message:

The autoloading routine in the classExists method makes the assumption the autoload method always returns a value (i.e. no void) when the autoloading of a class is succesfull. When you have multiple autoloaders registered to the spl stack this can lead to problems. In my case I'm using ZF2 ClassmapAutoloader and StandardAutoloader as fallback. The classmapAutoloader returns nothing so the autoload method in the StandardAutoloader is called as well, because the for loop is continued. This results in a second include, and a fatal error "Cannot redeclare class" is triggered.



 Comments   
Comment by Benjamin Eberlei [ 17/Sep/12 ]

A related Github Pull-Request [GH-184] was closed
https://github.com/doctrine/common/pull/184

Comment by Benjamin Eberlei [ 18/Sep/12 ]

A related Github Pull-Request [GH-184] was reopened
https://github.com/doctrine/common/pull/184

Comment by Marco Pivetta [ 14/Jan/13 ]

Handled in DCOM-136





[DCOM-116] [GH-193] Optimize autoload prefix in composer.json Created: 28/Sep/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

By having more specific autoload prefixes it is possible to reduce the number of stat calls made.



 Comments   
Comment by Benjamin Eberlei [ 28/Sep/12 ]

A related Github Pull-Request [GH-193] was closed
https://github.com/doctrine/common/pull/193





[DCOM-114] [GH-190] Test new3 Created: 24/Sep/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Closed
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: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

something master test?



 Comments   
Comment by Benjamin Eberlei [ 24/Sep/12 ]

A related Github Pull-Request [GH-190] was closed
https://github.com/doctrine/common/pull/190

Comment by Benjamin Eberlei [ 24/Sep/12 ]

A related Github Pull-Request [GH-190] was reopened
https://github.com/doctrine/common/pull/190

Comment by Benjamin Eberlei [ 24/Sep/12 ]

A related Github Pull-Request [GH-190] was closed
https://github.com/doctrine/common/pull/190

Comment by Benjamin Eberlei [ 24/Sep/12 ]

A related Github Pull-Request [GH-190] was reopened
https://github.com/doctrine/common/pull/190

Comment by Benjamin Eberlei [ 24/Sep/12 ]

A related Github Pull-Request [GH-190] was closed
https://github.com/doctrine/common/pull/190

Comment by Benjamin Eberlei [ 24/Sep/12 ]

A related Github Pull-Request [GH-190] was reopened
https://github.com/doctrine/common/pull/190

Comment by Benjamin Eberlei [ 24/Sep/12 ]

A related Github Pull-Request [GH-190] was closed
https://github.com/doctrine/common/pull/190

Comment by Marco Pivetta [ 14/Jan/13 ]

Was a test for the GH bot





[DCOM-113] [GH-189] Test new3 Created: 24/Sep/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Closed
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: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

last test i hope



 Comments   
Comment by Benjamin Eberlei [ 24/Sep/12 ]

A related Github Pull-Request [GH-189] was closed
https://github.com/doctrine/common/pull/189

Comment by Marco Pivetta [ 14/Jan/13 ]

Was a test for the GH bot





[DCOM-109] [GH-185] Test new Created: 24/Sep/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Closed
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: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

test



 Comments   
Comment by Benjamin Eberlei [ 24/Sep/12 ]

A related Github Pull-Request [GH-185] was closed
https://github.com/doctrine/common/pull/185

Comment by Marco Pivetta [ 14/Jan/13 ]

Was a test for the GH bot





[DCOM-111] [GH-187] Test new3 Created: 24/Sep/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Closed
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: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

test 3



 Comments   
Comment by Benjamin Eberlei [ 24/Sep/12 ]

A related Github Pull-Request [GH-187] was closed
https://github.com/doctrine/common/pull/187

Comment by Benjamin Eberlei [ 24/Sep/12 ]

A related Github Pull-Request [GH-187] was reopened
https://github.com/doctrine/common/pull/187

Comment by Benjamin Eberlei [ 24/Sep/12 ]

A related Github Pull-Request [GH-187] was closed
https://github.com/doctrine/common/pull/187

Comment by Marco Pivetta [ 14/Jan/13 ]

Was a test for the GH bot





[DCOM-110] [GH-186] Test new2 Created: 24/Sep/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Closed
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: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

new pull test



 Comments   
Comment by Benjamin Eberlei [ 24/Sep/12 ]

A related Github Pull-Request [GH-186] was closed
https://github.com/doctrine/common/pull/186

Comment by Marco Pivetta [ 14/Jan/13 ]

Was a test for the GH bot





[DCOM-112] [GH-188] Test new3 Created: 24/Sep/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

Status: Closed
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: Invalid Votes: 0
Labels: None


 Description   

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

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

Message:

trying against 2.3



 Comments   
Comment by Benjamin Eberlei [ 24/Sep/12 ]

A related Github Pull-Request [GH-188] was closed
https://github.com/doctrine/common/pull/188

Comment by Benjamin Eberlei [ 24/Sep/12 ]

A related Github Pull-Request [GH-188] was reopened
https://github.com/doctrine/common/pull/188

Comment by Benjamin Eberlei [ 24/Sep/12 ]

A related Github Pull-Request [GH-188] was closed
https://github.com/doctrine/common/pull/188

Comment by Benjamin Eberlei [ 24/Sep/12 ]

A related Github Pull-Request [GH-188] was reopened
https://github.com/doctrine/common/pull/188

Comment by Benjamin Eberlei [ 24/Sep/12 ]

A related Github Pull-Request [GH-188] was closed
https://github.com/doctrine/common/pull/188

Comment by Marco Pivetta [ 14/Jan/13 ]

Was a test for the GH bot





[DCOM-99] Variable Support in DQL Created: 25/Apr/12  Updated: 14/Jan/13  Resolved: 14/Jan/13

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

Type: New Feature Priority: Major
Reporter: Masoud Mazarei Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None


 Description   

sometimes in complex queries need to use variable,
but DQL not support Variable,



 Comments   
Comment by Marco Pivetta [ 07/Jun/12 ]

Could you please provide more information to this? Otherwise, this issue is quite invalid...





[DCOM-104] Dump() has side-effects or is unreliable Created: 02/Aug/12  Updated: 11/Jan/13

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

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

Debian Squeeze, MySQL 5



 Description   

after setting a one-to-one bi-directional relationship, I am hunting a bug and trying this:

\Doctrine\Common\Util\Debug::Dump($this->lord, 1);
\Doctrine\Common\Util\Debug::Dump($this, 2);
\Doctrine\Common\Util\Debug::Dump($this->lord, 1);

The first Dump() shows $this->lord as being NULL.
The third Dump() shows it as NOT being null, just like the 2nd one also shows it as having a value.



 Comments   
Comment by Tom Vogt [ 02/Aug/12 ]

More analysis found the issue being caused by an overloaded setLord() method:

public function setLord($NewLord) {
// overwriting the setter because we also want to update the lord days counter
if ($NewLord!=$this->lord)

{ $this->lord->setFief(null); // this is the line causing the issue if ($NewLord) $NewLord->setFief($this); $this->lord = $NewLord; $this->lordDays = 0; }

return $this;
}

without the marked line, everything works as expected, but of course the inverse side doesn't get updated without it.

Comment by Tom Vogt [ 02/Aug/12 ]

it ate the newlines in the comment above. The problematic line is:

$this->lord->setFief(null);

i.e. the update of the inverse side.

Comment by Christophe Coevoet [ 07/Aug/12 ]

I confirm that the dump command has some side effects. It initializes the persistent collections too

Comment by Tom Vogt [ 11/Jan/13 ]

Could this for the time being be fixed with a notice in the documentation warning of possible side-effects of Dump() ?





[DCOM-161] [GH-243] Update composer.json Created: 11/Jan/13  Updated: 11/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 stloyd:

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

Message:

Add `provide` part as `doctrine/common` >=2.2,<2.4 has cache in it.






[DCOM-156] [GH-238] fix to solve fatal error: apc_exist() does not exist Created: 04/Jan/13  Updated: 10/Jan/13  Resolved: 10/Jan/13

Status: Closed
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: Won't Fix Votes: 0
Labels: None


 Description   

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

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

Message:

Hi, folks. I'm running *Zend Server CE 5.6.0 5.6.0 SP4* with *PHP Version 5.3.14* and APC builtin:
![2013-01-04-15-15-sshot-1](https://f.cloud.github.com/assets/1616795/43026/86d0516e-5668-11e2-8342-10972e9bb214.png)

Now when I run in my project based on Symfony 2.1.6 comand:
```
console doctrine:fixtures:load --verbose
```
I am stack with fatal error:
```
Fatal error: Call to undefined function Doctrine\Common\Cache\apc_exists()
```

![2013-01-04-15-20-sshot-1](https://f.cloud.github.com/assets/1616795/43037/742fe1f4-5669-11e2-815b-dccc9a0f4fb4.png)

*Possible solution are in my pull request.*

As I descovered I am not alone with this problem: http://stackoverflow.com/questions/9125904/apc-exist-does-not-exist(http://stackoverflow.com/questions/9125904/apc-exist-does-not-exist)



 Comments   
Comment by Benjamin Eberlei [ 10/Jan/13 ]

A related Github Pull-Request [GH-238] was closed
https://github.com/doctrine/common/pull/238

Comment by Marco Pivetta [ 10/Jan/13 ]

This issue affects older versions of APC. If a fix is needed, a legacy APC cache class shall be implemented.





[DCOM-155] [GH-237] Update tests/Doctrine/Tests/Common/Annotations/Fixtures/NamespaceWithClo... Created: 03/Jan/13  Updated: 10/Jan/13  Resolved: 10/Jan/13

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

...sureDeclaration.php

Statement duplicate

$var = 1;
function () use ($var) {};



 Comments   
Comment by Benjamin Eberlei [ 10/Jan/13 ]

A related Github Pull-Request [GH-237] was closed
https://github.com/doctrine/common/pull/237





[DCOM-136] [GH-216] Adding failing test for silent autoloaders Created: 15/Nov/12  Updated: 10/Jan/13  Resolved: 10/Jan/13

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

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Fixing support for silent autoloaders






[DCOM-96] Extract a common ProxyFactory Created: 12/Feb/12  Updated: 10/Jan/13  Resolved: 10/Jan/13

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

Type: New Feature Priority: Major
Reporter: Christophe Coevoet Assignee: Marco Pivetta
Resolution: Fixed Votes: 1
Labels: None


 Description   

Currently, each Doctrine project implements its own ProxyFactory. But the most part of the logic is simply copy-pasted from the ORM implementation (or from an older version of the ORM implementation). Extracting the common code would be a good idea to avoid having to maintain 4 places (or even more) containing the same logic



 Comments   
Comment by Marco Pivetta [ 22/Oct/12 ]

I have a working implementation of public properties lazy loading at https://github.com/Ocramius/doctrine2/compare/master...DCOM-96-restarted

I am still trying to figure out performance issues, since this PR adds 5% overhead on top of Hydrators/Persisters/UnitOfWork, since it turned out that

$reflectionProperty->getValue($object);

actually triggers PHP's magic __get method.
I've worked this around by assuming nulls when values are not set, but this adds some conditionals that obviously slow down all the extraction of values process.





[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-159] [GH-241] Minor performance optimization for lookups of `ArrayCollection#contains()` Created: 08/Jan/13  Updated: 08/Jan/13  Resolved: 08/Jan/13

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

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:



 Comments   
Comment by Benjamin Eberlei [ 08/Jan/13 ]

A related Github Pull-Request [GH-241] was closed
https://github.com/doctrine/common/pull/241





[DCOM-158] [GH-240] [Cache/CouchbaseCache] Return false instead of null for compat. Created: 07/Jan/13  Updated: 07/Jan/13  Resolved: 07/Jan/13

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

This changeset fixes and verifies that instead of null, false is returned
from the fetch method. This fixes a bug which causes CouchbaseCache not
to work in combination with the ORM library. Test added.



 Comments   
Comment by Benjamin Eberlei [ 07/Jan/13 ]

A related Github Pull-Request [GH-240] was closed
https://github.com/doctrine/common/pull/240





[DCOM-157] [GH-239] Update lib/Doctrine/Common/Cache/Cache.php Created: 06/Jan/13  Updated: 06/Jan/13  Resolved: 06/Jan/13

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Typo in interface documentation



 Comments   
Comment by Benjamin Eberlei [ 06/Jan/13 ]

A related Github Pull-Request [GH-239] was closed
https://github.com/doctrine/common/pull/239





[DCOM-154] [GH-236] Adding Support for Couchbase as Caching Infrastructure. Created: 20/Dec/12  Updated: 06/Jan/13  Resolved: 06/Jan/13

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

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


 Description   

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

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

Message:

This changeset brings in support for Couchbase Server 2.0 as
the caching layer. The interface is identical to the memcached
one, but using ext/couchbase allows to take advantage of the
automatic cluster discovery and failover functionality provided.






[DCOM-103] Debug::toString issue with swapped parameters Created: 04/Aug/12  Updated: 28/Dec/12  Resolved: 28/Dec/12

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

Type: Bug Priority: Minor
Reporter: Oleg Namaka Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None


 Description   

Debug::toString has an issue with swapped parameters:

method_exists('__toString', $obj)

should be

method_exists($obj, '__toString')


 Comments   
Comment by Marco Pivetta [ 28/Dec/12 ]

Fixed in master @ https://github.com/doctrine/common/commit/301228e3a52d5259a341423daf75b25366895f17





[DCOM-153] [GH-235] Improve performance of if key exists in the array Created: 17/Dec/12  Updated: 18/Dec/12  Resolved: 18/Dec/12

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

So, here are few indications:
http://php.net/manual/en/function.array-key-exists.php#107786
http://php.net/manual/en/function.array-key-exists.php#104474



 Comments   
Comment by Benjamin Eberlei [ 18/Dec/12 ]

A related Github Pull-Request [GH-235] was closed
https://github.com/doctrine/common/pull/235





[DCOM-151] [GH-233] [DocParser] Fix trying include classes if its must be ignored. Created: 10/Dec/12  Updated: 10/Dec/12

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 Stroitel:

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

Message:

I recreate pull request (add test). Without fix test is failure.






[DCOM-142] [GH-222] make Base LifecycleEventArgs usable in orm and odm Created: 19/Nov/12  Updated: 05/Dec/12  Resolved: 05/Dec/12

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Pull requests are to come for both orm and odm to make use of this.

The main goal is to make more abstract listeners, compatible with both orm and odm.



 Comments   
Comment by Florian Klein [ 05/Dec/12 ]

@Benjamin Eberlei, any news on this ?





[DCOM-102] Updates for Fedora packaging Created: 07/Jul/12  Updated: 24/Nov/12

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

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

PEAR, Fedora, RHEL



 Description   

I am packaging the DoctrineDBAL PEAR package for Fedora and would like to have the following updates:

  • package.xml role for LICENSE changed from "data" to "doc"





[DCOM-146] [GH-226] Added error suppression to unlink() calls Created: 22/Nov/12  Updated: 22/Nov/12  Resolved: 22/Nov/12

Status: Resolved
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: Fixed Votes: 1
Labels: None


 Description   

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

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

Message:

Added error suppression to unlink() calls in the getPropertyAnnotations and getMethodAnnotations methods to be consistent with the getClassAnnotations method.



 Comments   
Comment by Benjamin Eberlei [ 22/Nov/12 ]

A related Github Pull-Request [GH-226] was closed
https://github.com/doctrine/common/pull/226

Comment by Fabio B. Silva [ 22/Nov/12 ]

Merged : https://github.com/doctrine/common/commit/a836c86c13e964051549e234250cf665a5f5a190





[DCOM-144] [GH-224] Use preg_quote() to escape text before inserting into regexp Created: 20/Nov/12  Updated: 21/Nov/12  Resolved: 21/Nov/12

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

PHP has build-in function `preg_quote()` in order to escape strings witch are dynamically inserted into regular expression.



 Comments   
Comment by Benjamin Eberlei [ 21/Nov/12 ]

A related Github Pull-Request [GH-224] was closed
https://github.com/doctrine/common/pull/224





[DCOM-106] Add @todo and @fixme to AnnotationReader::$globalIgnoredNames Created: 12/Sep/12  Updated: 21/Nov/12  Resolved: 21/Nov/12

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

Type: Improvement Priority: Minor
Reporter: Stephen Ostrow Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

I was wondering if you would consider adding @todo and @fixme

After doing some research, I'm not sure if @fixme is used anywhere other than being in Eclipse's PDT. However, @todo is definitely on the common tags of wiki page about PHPdoc as well as the phpDoc manual.

http://en.wikipedia.org/wiki/PHPDoc#Tags
http://manual.phpdoc.org/HTMLSmartyConverter/PHP/phpDocumentor/tutorial_tags.todo.pkg.html



 Comments   
Comment by Marco Pivetta [ 12/Sep/12 ]

Todo is already built in:
https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/Annotations/AnnotationReader.php#L63

Comment by Stephen Ostrow [ 12/Sep/12 ]

Sorry about that. I normally write them as @TODO so the standout more. Then when I got that exception and started doing research I swear I had tried @todo. But now looking back, I bet I tried @todo and still got exceptions which were from other bugs I had going on. I guess we can close this unless anyone thinks @fixme should be in there as well.

But like I said in the description, I'm not sure if @fixme is a common or just from Eclipse.

Comment by Marco Pivetta [ 12/Sep/12 ]

Netbeans matches that one too

Comment by Paweł Nowak [ 20/Nov/12 ]

I've prepared a fix for this issue that makes both @fixme and @TODO ignored. Pull request: https://github.com/doctrine/common/pull/223.





[DCOM-143] [GH-223] Fix for DCOM-106 Created: 20/Nov/12  Updated: 21/Nov/12  Resolved: 21/Nov/12

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Both fixme and TODO become ignored.



 Comments   
Comment by Benjamin Eberlei [ 20/Nov/12 ]

A related Github Pull-Request [GH-223] was closed
https://github.com/doctrine/common/pull/223





[DCOM-145] [GH-225] Replace file_exists() calls with is_file() where it is needed Created: 20/Nov/12  Updated: 21/Nov/12  Resolved: 21/Nov/12

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

The function `file_exists()` checks whether file or directory exists. And `is_file()` checks only files for the existence. All places, where `file_exists()` is replaced with `is_file()` needs only to check for file existence.



 Comments   
Comment by Benjamin Eberlei [ 20/Nov/12 ]

A related Github Pull-Request [GH-225] was closed
https://github.com/doctrine/common/pull/225





[DCOM-138] [GH-219] BC breaking constant name fix Created: 16/Nov/12  Updated: 16/Nov/12

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 jakoch:

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

Message:

fixed typo on constant name (STATS_MEMORY_AVAILIABLE => STATS_MEMORY_AVAILABLE)






[DCOM-133] [GH-212] Issue/gh #135 Created: 09/Nov/12  Updated: 09/Nov/12  Resolved: 09/Nov/12

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

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Fixes #135



 Comments   
Comment by Benjamin Eberlei [ 09/Nov/12 ]

A related Github Pull-Request [GH-212] was closed
https://github.com/doctrine/common/pull/212





[DCOM-131] [GH-210] MappingDriverChain::getAllClassNames should load all classes from the defaultDriver Created: 27/Oct/12  Updated: 27/Oct/12

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 rnijveld:

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

Message:

I actually tried working around this by adding a driver using an empty string as the namespace, only to find out that `strpos()` doesn't accept an empty delimiter.

Anyway, this makes sure that all loadable classes for the defaultDriver are actually returned by MappingDriverChain as well.






[DCOM-129] Annotation parser matches colon after annotation Created: 21/Oct/12  Updated: 21/Oct/12

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

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


 Description   

Code

/**
* Removes given $node from the tree and reparents its descendants
*
* @todo may be improved, to issue single query on reparenting
* @param object $node
* @throws RuntimeException - if something fails in transaction
* @return void
*/
public function removeFromTree($node)
{

fails with `[Semantical Error] The annotation "@todo:" in method Gedmo\Tree\Entity\Repository\ClosureTreeRepository::removeFromTree() was never imported. Did you maybe forget to add a "use" statement for this annotation?`.

As you see it tryes find annotation with name "@todo:". Don't know, maybe rtrim($name, ':') would enough.






[DCOM-128] RedisCache uses IGBINARY which is not always available Created: 20/Oct/12  Updated: 20/Oct/12

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

Type: New Feature Priority: Minor
Reporter: Sander Marechal Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

The RedisCache uses Redis::SERIALIZER_IGBINARY. See https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/Cache/RedisCache.php line 47.

The problem is that the php Redis extension can be compiled without IGBINARY support. In that case, this code causes a fatal error because the constant does not exist.

The DotDeb package of php5-redis (often used on Debian systems) for example comes compiled without IGBINARY support.

The code should probably check if the constant exists. If not, the default to Redis::SERIALIZER_PHP






[DCOM-123] [GH-202] Add sqlite cache driver Created: 08/Oct/12  Updated: 08/Oct/12

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 Baachi:

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

Message:






[DCOM-120] [GH-197] Avoid a critical error when parsed class is not found Created: 03/Oct/12  Updated: 08/Oct/12  Resolved: 08/Oct/12

Status: Closed
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Found a bug that returns a critical error when parsed class is not found. The new test explains exactly the situation found.

This issue was found running this test suite: https://github.com/alphalemon/AlphaLemonCmsBundle, running the following test; phpunit Tests/Functional/Controller/SecuryControllerTest.php



 Comments   
Comment by Benjamin Eberlei [ 07/Oct/12 ]

A related Github Pull-Request [GH-197] was closed
https://github.com/doctrine/common/pull/197





[DCOM-122] [GH-200] ClassMetadataFactory child classes can now filter the metadata when calling getAllMetadata Created: 07/Oct/12  Updated: 07/Oct/12  Resolved: 07/Oct/12

Status: Resolved
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: Won't Fix Votes: 0
Labels: None


 Description   

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

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

Message:

This is due mainly, because we have found performance issues when trying to generate a complete schema (annotation based) from a legacy database with tons of tables with the ConvertMapping command.

This will let filter table names to the ```Doctrine\ORM\Mapping\Driver\DatabaseDriver::getAllClassNames``` and ```Doctrine\ORM\Mapping\Driver\DatabaseDriver::loadMetadataForClass``` methods, and extract class metadata from a smaller subset of classes (I'm doing another PR for this in the ORM repository).



 Comments   
Comment by Benjamin Eberlei [ 07/Oct/12 ]

A related Github Pull-Request [GH-200] was closed
https://github.com/doctrine/common/pull/200





[DCOM-121] [GH-198] [DCOM-118] fix for issue #195 Created: 03/Oct/12  Updated: 03/Oct/12

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 pscheit:

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

Message:

I'm sorry, i have no idea why i got here now 23 commits .. i tried but no success.






[DCOM-118] [GH-195] Add failing test to demonstrate parse error when @ is present in the description Created: 02/Oct/12  Updated: 03/Oct/12

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 Seldaek:

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

Message:

If someone can take this and fix the issue it'd be great. I couldn't figure it out at a quick glance and I don't really have time, but it's a pretty messed up bug and not so trivial to debug if you don't know what happens in the background so I'd say it's pretty important.



 Comments   
Comment by Philipp Scheit [ 02/Oct/12 ]

I digged a little deeper. The test case is a great one
The DocLexer cuts ut -1 position from the first @ (which is the @ in the @example.com). so that the lexer has to process:

o@example.com"
     * }
     *
     * @AnnotationTargetPropertyMethod("Bar")

So that the catchable pattern: ("(?:[^"]|"")*") matches here to greedy (it matches string in quotes):

"
     * }
     *
     * @AnnotationTargetPropertyMethod("

As a result the lexer does not catch the correct @ from the Annotation

I could not think of a fast fix for this. But maybe tomorrow.
(leaving quoted string pattern with an @ was a wrong idea)

Its not a workaround to do more or less cutting in the parser, because not-well-formed quoted strings would break anyway

Comment by Philipp Scheit [ 03/Oct/12 ]

can someone think of a case, where a string (in some annotation) has a newline in it? Otherwise the tests do not fail, when I leave the string matching pattern with a newline.
I still had another idea to restrict the position of a annotation more strictly to:

  • the beginning of a new line (\s**\s* before)
  • in another annotation

but the second is not solvable with the lexer itself and would transfer the quoted string matching to the parser, because it needs context.

I'll let seldaek pull, what I have (is this the right way?)





[DCOM-115] [GH-191] Debug::export ArrayObject dumps the internal storage variable Created: 27/Sep/12  Updated: 01/Oct/12  Resolved: 01/Oct/12

Status: Resolved
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: Fixed Votes: 0
Labels: None


 Description   

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

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

Message:

Until now, exporting `ArrayObject` hid the internal storage variable, but `print_r` and `var_dump` show it.

With this PR the `ArrayObject::storage` variable is exported too.



 Comments   
Comment by Benjamin Eberlei [ 01/Oct/12 ]

A related Github Pull-Request [GH-191] was closed
https://github.com/doctrine/common/pull/191





[DCOM-101] Implement FilesystemCache Created: 08/Jun/12  Updated: 25/Jun/12  Resolved: 25/Jun/12

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

Type: New Feature Priority: Major
Reporter: Guilherme Blanco Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None


 Description   

Implement FilesystemCache, storing var exported pieces that could be loaded on demand.



 Comments   
Comment by Fabio B. Silva [ 25/Jun/12 ]

Fixed By : https://github.com/doctrine/common/commit/8df9cdf3b921a3b59bbba51d5ba9063509ef6a1a





[DCOM-76] switch license to MIT Created: 09/Nov/11  Updated: 09/Jun/12  Resolved: 09/Jun/12

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

Type: Improvement Priority: Major
Reporter: Lukas Kahwe Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

since common was mostly written by a small group of people and not based on Doctrine 1.x it seems possible to switch the license which imho would really boost the use cases.



 Comments   
Comment by Guilherme Blanco [ 09/Jun/12 ]

Successfully migrated to MIT!!! \o/





[DCOM-89] GH-85: php annotations Created: 15/Dec/11  Updated: 09/Jun/12  Resolved: 09/Jun/12

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

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

Pull-Request was automatically synchronized: https://github.com/doctrine/common/pull/85

Hello all,

This patch add support for php annotations, I think that is very useful to collect class metadata.
This patch support just 3 annotations ```@var, @param, @return```. but any annotation could be added.

@schmittjoh can you take a look please ?

Any suggestion are welcome.

Thanks



 Comments   
Comment by Guilherme Blanco [ 09/Jun/12 ]

Synchronizing with PR. It was closed.





[DCOM-100] bad filename for WincacheCahe Created: 02/Jun/12  Updated: 09/Jun/12  Resolved: 09/Jun/12

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

Type: Bug Priority: Minor
Reporter: Vladimír Náprstek Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

object WincacheCache object resides in file WinCacheCache.php and it confuses autoloading.



 Comments   
Comment by Guilherme Blanco [ 09/Jun/12 ]

Fixed in https://github.com/doctrine/common/commit/380ca1d2dcf353a7a768f8086bd0fe05199fbb56





[DCOM-97] phpParser.php and 'use' keyword in anonymous functions Created: 13/Feb/12  Updated: 30/Mar/12  Resolved: 30/Mar/12

Status: Closed
Project: Doctrine Common
Component/s: Annotations
Affects Version/s: 2.1.4
Fix Version/s: 2.2

Type: Bug Priority: Major
Reporter: Thomas Lecarpentier Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

php 5.3, Symfony2, linux



 Description   

When i use the keyword 'use' in anonymous function (like describe in page http://php.net/manual/en/functions.anonymous.php)

Exemple :
...

/**
*

  • Extract event from all events for this day
  • @param int $year
  • @param int $month
  • @param int $day
  • @return ArrayCollection
    */
    public function getEventsForDate($year, $month, $day)
    Unknown macro: { $extractEvents = null; // check if date of item is inside day given $extractEvents = $this->events->filter( function ($item) use ($year, $month, $day) { $leftDate = new \DateTime($year.'-'.$month.'-'.$day.' 00:00'); $rigthDate = new \DateTime($year.'-'.$month.'-'.$day.' +1 day 00:00'); return ( ( $leftDate <= $item->getDateStart() ) && ( $item->getDateStart() < $rigthDate ) ); } ); return $extractEvents; }

...

The phpParser generate error

[ErrorException]
Notice: Undefined offset: -1 in /home/ent/project/Symfony/vendor/doctrine-common/lib/Doctrine/Common/Annotations/PhpParser.php line 117

It try to parse 'use ($year, $month, $day)' as Class



 Comments   
Comment by Fabio B. Silva [ 25/Mar/12 ]

I think this is fixed on the php parser rewrite. (2.2)

Comment by Fabio B. Silva [ 25/Mar/12 ]

Coverage added : https://github.com/doctrine/common/commit/7ec510dbb2279f76a00ecf3f911298879c6ba1a1

I think this could be closed..

Comment by Fabio B. Silva [ 30/Mar/12 ]

Fixed on php parser rewrite. (2.2)





[DCOM-98] Fix bug with memcache/memcached and 0 as expire Created: 30/Mar/12  Updated: 30/Mar/12  Resolved: 30/Mar/12

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

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





[DCOM-32] Memcache cache relies on deprecated functions Created: 21/Dec/10  Updated: 28/Mar/12  Resolved: 27/Aug/11

Status: Resolved
Project: Doctrine Common
Component/s: Caching
Affects Version/s: 2.0.0-RC2
Fix Version/s: 2.2

Type: Bug Priority: Major
Reporter: Sebastian Hoitz Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

The method getIds() in MemcacheCache relies on the old "cachedump" stat type.

But as you can read here: http://de2.php.net/manual/en/memcache.getextendedstats.php this has been removed due to security reasons.



 Comments   
Comment by Sebastian Hoitz [ 21/Dec/10 ]

Adding this to memcached before getting the extended stats cachedump fixed this issue for me:

if(!is_int($slabId)) {
    continue;
}
Comment by Guilherme Blanco [ 15/Feb/11 ]

This issue doesn't seen to be valid anymore based on commit of @hobodave on Jan 29th.

Please reopen if it is still valid. I could not reproduce.

Comment by Guilherme Blanco [ 18/Apr/11 ]

Memcache daemon 1.4.5 do not provide cachedump and triggers a couple of issues all around.
Here is a link that gives more information: http://www.pecl.php.net/bugs/bug.php?id=20375&edit=3

We need to think on a workaround since current state of Doctrine 2 is unusable with recent memcache.

Comment by Denis [ 07/May/11 ]

There additionally seems to be a hard-coded limit to the size of the dump:

http://stackoverflow.com/questions/4363904/is-there-any-length-limitation-of-result-by-stats-cachedump-in-memcached

http://lists.danga.com/pipermail/memcached/2007-April/003906.html

Comment by Guilherme Blanco [ 27/Aug/11 ]

Fixed in master by this commit: https://github.com/doctrine/common/commit/486169851ea87b3e14ed45d5bfd7d07b1d41af65

Comment by Przemek Sobstel [ 28/Mar/12 ]

@Guilherme, your fix introduced big performance issue as now for each fetch() call there are always 2 additional calls, which is kind of big overhead. See https://github.com/doctrine/common/pull/125 for details.





[DCOM-94] Support for constants on annotation reader Created: 06/Feb/12  Updated: 15/Mar/12  Resolved: 15/Mar/12

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

Type: New Feature Priority: Minor
Reporter: Fabio B. Silva Assignee: Fabio B. Silva
Resolution: Fixed Votes: 1
Labels: None


 Description   

Would be nice get support for constants on annotation reader.

Usage :

/**
* @SomeAnnotation(PHP_EOL)
* @SomeAnnotation(SomeClass::SOME_VALUE)
* @SomeAnnotation({SomeClass::VALUE1,SomeClass::VALUE2})
* @SomeAnnotation({SomeClass::SOME_KEY = SomeClass::SOME_VALUE})
*/


 Comments   
Comment by gabriel sancho [ 22/Feb/12 ]

file doctrine-2.2.0/Doctrine/Common/Lexer.php
line 214
@patch : para poder usar constantes

  • definidas con define como param de las anotaciones
  • las constantes deben empesar por '_' para evitar conflictos con 'false' y 'true'
  • esto solo soporta constantes en los valores de las anotaciones
  • ej:

define('_db_clase_05', '"test.Clase_05"');
...
/** @Table(name=_db_clase_05)
... */
class Clase_05

{ ... }

if(is_string($match[0]) && ($match[0][0] == '_') && defined($match[0]))

{ $aux_val = constant($match[0]); $match[0] = $aux_val; }
Comment by Fabio B. Silva [ 22/Feb/12 ]

hello gabriel,

I have a pull request opened : https://github.com/doctrine/common/pull/104

feel free to join us and comment ...
in inglesh please

Comment by Fabio B. Silva [ 15/Mar/12 ]

Fixed : https://github.com/doctrine/common/commit/970912eec0a1371e03de7010556d9280c26d8083





[DCOM-70] [CacheProvider] missing functions Created: 27/Sep/11  Updated: 06/Mar/12  Resolved: 03/Oct/11

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

Type: Bug Priority: Major
Reporter: Jérôme Forêt Assignee: Guilherme Blanco
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

Why delete functions in CacheProvider like deleteByPrefix deleteByPostfix deleteByRegex ?
DeleteAll and FlushAll do not replace them. Please revert for these functions.



 Comments   
Comment by Guilherme Blanco [ 03/Oct/11 ]

The deleteBy*() aswell as getIds() methods cannot be brought back.
Some drivers do not support the getIds(), because (and I agree with) they consider the keys retrieval as a security issue.

Since we keep the Least Common Multiple (LCM) in our Cache platform, these drivers started to be affected in latest *NIX releases (like for example, Memcache 1.6.5+ that does not bring cachedump anymore).

We started to have many reports here because cache was not working, or they were not clearing or even they were getting partially cleared. So we re-worked on Cache package to bring the LCM again.

Based on that, individual drivers like APC may still support the cache Id retrieval, but our approach differed and we can't bring this back. You may override into your own driver (composition) extending our ApcCache and implemented your desired functions.

Marking the ticket as won't fix.

Cheers,

Comment by Peter Mitchell [ 06/Mar/12 ]

The documentation still refers to these deprecated elements which is a little confusing as there is no indication of this in the Abstract Classes/Interfaces

http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/caching.html





[DCOM-73] CodeGeneration using Doctrine\Common\Persistence\Mapping\ObjectMetadata Created: 24/Oct/11  Updated: 16/Feb/12

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

Type: New Feature Priority: Major
Reporter: Benjamin Eberlei Assignee: Jonathan H. Wage
Resolution: Unresolved Votes: 0
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-88] GH-84: Fixed phpdoc for the persistence interfaces Created: 13/Dec/11  Updated: 16/Jan/12  Resolved: 16/Jan/12

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

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

Pull-Request was automatically synchronized: https://github.com/doctrine/common/pull/84



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

Fixed since https://github.com/doctrine/common/commit/52c3882633b3cf11a694f2e8d9aaacb449bf5c6c





[DCOM-49] Debug::dump/export for ODM documents Created: 26/Apr/11  Updated: 16/Jan/12  Resolved: 16/Jan/12

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

Type: Task Priority: Minor
Reporter: Andrew Cobby Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

Doctrine\Common\Util\Debug has code to deal with Proxy objects from the ORM, but nothing for other Doctrine projects.

Maybe the Common package should introduce a base Proxy interface so the Debug class isn't dependant on the ORM? This would also mean standardising Proxy objects, particularly the private property names...

ORM proxy objects have $identifier and $_entityPersister while ODM proxy objects have $identifier_ and $_documentPersister. I think they should both use $identifier_ and $_persister_ and $_isInitialized_.

I suppose the team is wait for Doctrine ODM to become stable before changing this?



 Comments   
Comment by Christophe Coevoet [ 12/Dec/11 ]

This should be closed as https://github.com/doctrine/common/pull/83 decouples the Debug util from the ORM (the ODM does not uses the new interface but this is not a Doctrine Common issue)

Comment by Guilherme Blanco [ 16/Jan/12 ]

Fixed since https://github.com/doctrine/common/commit/97d9ef41a2f8dc0ee23670b4eb6ea74a780878b8





[DCOM-91] GH-87: typos Created: 23/Dec/11  Updated: 16/Jan/12  Resolved: 16/Jan/12

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

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

Pull-Request was automatically synchronized: https://github.com/doctrine/common/pull/87



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

Fixed as per PR resolution





[DCOM-90] GH-86: class_exists is great, use it. Created: 21/Dec/11  Updated: 16/Jan/12  Resolved: 16/Jan/12

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

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Invalid Votes: 0
Labels: None


 Description   

Pull-Request was automatically synchronized: https://github.com/doctrine/common/pull/86



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

As per PR's resolution





[DCOM-93] Add Reflection Abstraction Created: 28/Dec/11  Updated: 03/Jan/12  Resolved: 02/Jan/12

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

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

Issue Links:
Reference
is referenced by DDC-1577 Remove static Reflection dependency f... Resolved

 Description   

The Reflection code in ClassMetadata(Info*)s is getting out of control.

I want to remove the dependency by introducing a ReflectionService interface:

interface ReflectionService
{
    public function getClassShortName($class);
    public function getClassNamespace($class);
    public function getClass($class);
    public function getAccessibleProperty($class, $property);
    public function hasPublicMethod($class, $method);
}

The reflection methods are specifically allowed to return NULL, so that we can create a StaticReflectionService that works without the classes actually existing.



 Comments   
Comment by Benjamin Eberlei [ 28/Dec/11 ]

This issue is referenced in Github Pull-Request GH-89
https://github.com/doctrine/common/pull/89

Comment by Benjamin Eberlei [ 29/Dec/11 ]

Related Pull Request was closed: https://github.com/doctrine/common/pull/89

Comment by Benjamin Eberlei [ 02/Jan/12 ]

Implemented





[DCOM-87] Add a method to retrieve the identifier values in the Common interfaces Created: 12/Dec/11  Updated: 02/Jan/12  Resolved: 02/Jan/12

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

Type: Improvement Priority: Major
Reporter: Christophe Coevoet Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

Currently, https://github.com/symfony/symfony/blob/master/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php is tied to the ORM, forcing bundle integrating other Doctrine projects to reimplement it.

The only place which is not (or cannot be) implemented using only methods from the Common interfaces is retrieving the current id. `getIdentifierValues` is now implemented by the ClassMetadata in all ORM, MongoDB and CouchDB but not in the interface.

Note that the tricky point about adding it is the fact that the DisconnectedMetadataFactory (used when generating entities) returns a ClassMetadataInfo instead, which does not contain this method (as it relies on the existence of the class) but implements the interface.



 Comments   
Comment by Benjamin Eberlei [ 02/Jan/12 ]

This was implemented





[DCOM-86] k-fish Created: 09/Dec/11  Updated: 30/Dec/11  Resolved: 30/Dec/11

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

Type: Improvement Priority: Major
Reporter: Karsten Dambekalns Assignee: Fabio B. Silva
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

When parsing a class the DocParser uses class_exists() to check for annotation classes (this triggers autoloading) - only afterwards the annotation is ignored if it should be ignored.

At least for simple unqualified names the check against the ignored annotations could be done earlier. This already goes a long way:

----- DocParser.php, at about line 555 -----
// only process names which are not fully qualified, yet
// fully qualified names must start with a \
$originalName = $name;
if ('
' !== $name[0]) {
// check early and return before further inspections
if (isset($this->ignoredAnnotationNames[$name]))

{ return FALSE; }

$alias = (false === $pos = strpos($name, '
'))? $name : substr($name, 0, $pos);

----- DocParser.php, at about line 555 -----



 Comments   
Comment by Fabio B. Silva [ 30/Dec/11 ]

Other explanations : https://github.com/doctrine/common/pull/90#issuecomment-3313175





[DCOM-47] When using different class loaders Created: 07/Apr/11  Updated: 27/Dec/11  Resolved: 14/Sep/11

Status: Resolved
Project: Doctrine Common
Component/s: Class Loading
Affects Version/s: 2.1
Fix Version/s: 2.1.2

Type: Bug Priority: Major
Reporter: Gediminas Morkevicius Assignee: Guilherme Blanco
Resolution: Cannot Reproduce Votes: 0
Labels: None
Environment:

all



 Description   

ClassLoader::classExists($class); will fail if different class loader is used which does not return any boolean value. This includes Symfony2 UniversalClassLoader

I have never used this function before because native PHP method class_exits($class, true) first will try to autoload. But if the class does not exist
and you are using Doctrine\Common::ClassLoader and you call class_exists($class) it will trigger fatal error. This behavior makes it impossible to make code compatible
with different class loading mechanisms for Doctrine2



 Comments   
Comment by Christophe Coevoet [ 07/Apr/11 ]

This is known and documented in the code: https://github.com/doctrine/common/blob/master/lib/Doctrine/Common/Annotations/Parser.php#L110

Comment by Guilherme Blanco [ 14/Sep/11 ]

Since Annotations package changed a lot since the bug was opened and today, I'm closing the ticket as "Cannot reproduce".

Please reopen it if the issue is still valid with a testcase.

Cheers,

Comment by Benjamin Eberlei [ 27/Dec/11 ]

This issue is referenced in Github Pull-Request GH-88
https://github.com/doctrine/common/pull/88

Comment by Jan Dolecek [ 27/Dec/11 ]

Still a problem! Especially since this is used by ORM (https://github.com/doctrine/doctrine2/commit/3aea203b9ca77df65f55f036080a9af653194cbf)

Class loader doesn't have to return bool (and usually DOES NOT), so even though it has loaded the class, classExists will return false. Please pull this https://github.com/doctrine/common/pull/88

Comment by Benjamin Eberlei [ 27/Dec/11 ]

Related Pull Request was closed: https://github.com/doctrine/common/pull/88





[DCOM-92] CouchDB, MongoDB caches Created: 25/Dec/11  Updated: 25/Dec/11

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: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Very simple persisntent caches for query/view results now that result cache is actually useful






[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-84] Improve Proxy Naming Created: 01/Dec/11  Updated: 13/Dec/11  Resolved: 12/Dec/11

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

Type: Improvement Priority: Blocker
Reporter: Johannes Schmitt Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

see https://gist.github.com/b493493ecdb22c21590e



 Comments   
Comment by Benjamin Eberlei [ 12/Dec/11 ]

Implemented in https://github.com/doctrine/common/pull/83

Comment by Benjamin Eberlei [ 13/Dec/11 ]

This issue is referenced in Github Pull-Request GH-83
https://github.com/doctrine/common/pull/83





[DCOM-83] Rename ComparableInterface Created: 01/Dec/11  Updated: 12/Dec/11  Resolved: 12/Dec/11

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

Type: Improvement Priority: Minor
Reporter: Johannes Schmitt Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

see https://github.com/doctrine/common/commit/fce661a041aa1dc3634bd1c04cacd684619579fc for reasoning

I didn't want to do it myself, don't know what depends on this.



 Comments   
Comment by Benjamin Eberlei [ 12/Dec/11 ]

Fixed in 3ee9aea





[DCOM-79] Move Lifecycle Events into Doctrine\Common\Persistence\Events Created: 19/Nov/11  Updated: 12/Dec/11  Resolved: 12/Dec/11

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

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


 Comments   
Comment by Benjamin Eberlei [ 12/Dec/11 ]

Implemented in 29dbb7070058c8e7bb81bc5f9ef79d877b058887





[DCOM-85] GH-81: Add Proxy#__load() Created: 03/Dec/11  Updated: 12/Dec/11  Resolved: 12/Dec/11

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

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


 Description   

Pull-Request was automatically synchronized: https://github.com/doctrine/common/pull/81



 Comments   
Comment by Benjamin Eberlei [ 12/Dec/11 ]

Implemented in https://github.com/doctrine/common/pull/83





[DCOM-82] Fix composer.json in 2.1.x releases missing autoloader Created: 26/Nov/11  Updated: 26/Nov/11  Resolved: 26/Nov/11

Status: Resolved
Project: Doctrine Common
Component/s: None
Affects Version/s: 2.1.3
Fix Version/s: 2.1.4

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





[DCOM-81] Attempt to create Annotation File Cache directory Created: 23/Nov/11  Updated: 23/Nov/11  Resolved: 23/Nov/11

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

Type: Improvement Priority: Major
Reporter: Benjamin Eberlei Assignee: Fabio B. Silva
Resolution: Fixed Votes: 0
Labels: None


 Comments   
Comment by Fabio B. Silva [ 23/Nov/11 ]

Fixed : https://github.com/doctrine/common/pull/77





[DCOM-78] ZendDataCache, Can't use method return value in write context Created: 19/Nov/11  Updated: 19/Nov/11  Resolved: 19/Nov/11

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

Type: Bug Priority: Major
Reporter: Matti Niemelä Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

On line 70, empty($this->getNamespace()).

empty() works only with variables so you need to assign the namespace to something before using empty().

Fatal error: Can't use method return value in write context in Doctrine/Common/Cache/ZendDataCache.php on line 70



 Comments   
Comment by Benjamin Eberlei [ 19/Nov/11 ]

Fixed





[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-75] remove leading backslash from class name before comparing to namespace in annotation autoloading Created: 03/Nov/11  Updated: 03/Nov/11

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

Type: Improvement Priority: Minor
Reporter: Guillaume ORIOL Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 0
Labels: None
Environment:

not relevant



 Description   

I am figuring a problem with Symfony Validator constraints (I use annotations to define the constraint rules).

As I don't use Symfony's framework, I create the validator service by myself.
Somewhere in its factory, I put the following code:

         
AnnotationRegistry::registerAutoloadNamespaces(array(
    '\Symfony\Component\Validator\Constraints' => APPLICATION_ROOT . '/library'
));

Then, in my entities, I have annotations such as:

use Symfony\Component\Validator\Constraints as Assert;

class Author {
    /**
     * @Assert\NotBlank()
     */
    protected $name;
}

In this configuration, I get the following error:

[Semantical Error] The annotation "@Symfony\Component\Validator\Constraints\NotBlank"
in property Domain\Entity\Author::$name does not exist, or could not be auto-loaded.

I was able to trace it down to the Doctrine\Common\Annotations\AnnotationRegistry#loadAnnotationClass($class) where we can find the following test:

    if (strpos($class, $namespace) === 0) {
        require ...;
    }

which means "if the namespace can be found at the beginning of the FQCN, require it".
But those namespaces come from "use" statements where there is no leading backslash.
That's why the test fails.

Christophe Coevoet answered:

you should remove the leading backslash. Fully qualified class names used as string don't include it in PHP.

Benjamin Eberlei suggested to remove the leading backslash before comparing the class to the namespace.
I would follow Benjamin suggestion and would like to add a comment about leading backslashes:

When I add a use statement to my code for a class, I can then use its alias to get an instance of that class.

use Doctrine\ORM\Mapping\ClassMetadata;
...
$metadata = new ClassMetadata();

The same is true with:

use Doctrine\ORM\Mapping as Foo;
...
$metadata = new Foo\ClassMetadata();

This is not a fully qualified class name.
In that sense, I do understand such an annotation: @ORM\Entity.

But I find the syntax of a fully-qualified annotation (@My\Annotation\Whatever) erroneous (or at least counter-intuitive) as it doesn't start with a backslash.






[DCOM-71] Add save get_class() to Debug Util Created: 22/Oct/11  Updated: 23/Oct/11  Resolved: 23/Oct/11

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

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


 Comments   
Comment by Benjamin Eberlei [ 23/Oct/11 ]

Added.





[DCOM-69] [APC Cache] doFlush does not clear user cache Created: 27/Sep/11  Updated: 03/Oct/11  Resolved: 03/Oct/11

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

Type: Bug Priority: Critical
Reporter: Jérôme Forêt Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

lib\Doctrine\Common\Cache\ApcCache.php

The function "doFlush" only clears opcode cache.
The user cache is never cleared.

To correct it, one solution should be :

protected function doFlush()
{
    $res = false;    
    $bool1 = apc_clear_cache();
    $bool2 = apc_clear_cache('user');
    if ($bool1 && $bool2)
    {
        $res = true;
    }
    return $res;
}


 Comments   
Comment by Guilherme Blanco [ 03/Oct/11 ]

Fixed in https://github.com/doctrine/common/commit/d6e4c8b22af9800db4fd9d679ce98538da028168





[DCOM-68] Add @codeCoverageIgnoreStart and @codeCoverageIgnoreEnd to annotation ignore map Created: 25/Sep/11  Updated: 25/Sep/11  Resolved: 25/Sep/11

Status: Resolved
Project: Doctrine Common
Component/s: None
Affects Version/s: 2.1.1
Fix Version/s: 2.1.2

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


 Comments   
Comment by Benjamin Eberlei [ 25/Sep/11 ]

Done





[DCOM-43] Cache Stats Created: 05/Apr/11  Updated: 21/Sep/11  Resolved: 21/Sep/11

Status: Resolved
Project: Doctrine Common
Component/s: Caching
Affects Version/s: 2.0.1
Fix Version/s: 2.2

Type: New Feature Priority: Major
Reporter: Otavio Ferreira Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

Doctrine should be able to retrieve stats from cache providers, such as Memcache and APC. Stats may list cache hits, cache misses, memory, and so forth.



 Comments   
Comment by Guilherme Blanco [ 21/Sep/11 ]

Implemented this support since this commit: https://github.com/doctrine/common/commit/34e060309ee1ae06f4be610d39d8721d2cfb1b90





[DCOM-62] Github-PR-53 by shawndellysse: ArrayCollection#join Created: 21/Aug/11  Updated: 14/Sep/11  Resolved: 14/Sep/11

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

Type: Improvement Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

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

{username}

:

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

Message:

Added the `join` method to `ArrayCollection`.



 Comments   
Comment by Guilherme Blanco [ 14/Sep/11 ]

This can't be easily implemented by ORM because join() would require more than a single delimiter.
Marking ticket as won't fix. If you have a better solution, please reopen the issue with more details about how would you like to achieve it.





[DCOM-40] Using shared references with the SharedFixtureInterface with the DataFixtures extension will not work. Created: 06/Mar/11  Updated: 14/Sep/11  Resolved: 14/Sep/11

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

Type: Bug Priority: Major
Reporter: Steven Rosato Assignee: Guilherme Blanco
Resolution: Fixed Votes: 1
Labels: None

Attachments: Text File 0001-DCOM-40-Fixed-an-issue-where-shared-fixtures-where-n.patch    

 Description   

I did not know where to issue that component, but since this extension using the Doctrine Common namespace I thought it relevant to issue the bug here.

Consider the following shared fixures (as stated on jwage's github repo here: https://github.com/doctrine/data-fixtures)

In case if fixture objects have relations to other fixtures, it is now possible to easily add a reference to that object by name and later reference it to form a relation. Here is an example fixtures for Role and User relation

namespace MyDataFixtures;

use Doctrine\Common\DataFixtures\AbstractFixture;

class LoadUserRoleData extends AbstractFixture
{
    public function load($manager)
    {
        $adminRole = new Role();
        $adminRole->setName('admin');

        $anonymousRole = new Role;
        $anonymousRole->setName('anonymous');

        $manager->persist($adminRole);
        $manager->persist($anonymousRole);
        $manager->flush();

        // store reference to admin role for User relation to Role
        $this->addReference('admin-role', $adminRole);
    }
}

namespace MyDataFixtures;

use Doctrine\Common\DataFixtures\AbstractFixture;

class LoadUserData extends AbstractFixture
{
    public function load($manager)
    {
        $user = new User();
        $user->setUsername('jwage');
        $user->setPassword('test');
        $user->setRole(
            $this->getReference('admin-role') // load the stored reference
        );

        $manager->persist($user);
        $manager->flush();

        // store reference of admin-user for other Fixtures
        $this->addReference('admin-user', $user);
    }
}

This will not use the last reference as a MANAGED entity but whether as a NEW one since the manager gets cleared (thus the unit of work) on each call to load() for the AbstractExecutor and thus marking any new references to the 'admin-user' considered a NEW entity, which should not be the case.

The current workaround is to directly fetch the entity using the EM's find() function, but that completely eliminates the main goal SharedFixtures' references are bringing.

I have provided the small patch that adress this issue, tests still pass.



 Comments   
Comment by Steven Rosato [ 06/Mar/11 ]

Added patch that addresses the issue.

Comment by Guilherme Blanco [ 14/Sep/11 ]

Not related to Common package (do we have a project for that?), but it seems this issue was already addressed when I looked at data-fixture repository.
https://github.com/doctrine/data-fixtures/blob/master/lib/Doctrine/Common/DataFixtures/Executor/AbstractExecutor.php#L79

Closing as fixed.





[DCOM-37] orm:convert-d1-schema not working Created: 22/Feb/11  Updated: 14/Sep/11  Resolved: 14/Sep/11

Status: Resolved
Project: Doctrine Common
Component/s: None
Affects Version/s: 2.0.1
Fix Version/s: 2.1.2

Type: Bug Priority: Minor
Reporter: Jon Johnson Assignee: Guilherme Blanco
Resolution: Invalid Votes: 0
Labels: None
Environment:

Ubuntu 10.04 PEAR install of DoctrineORM



 Description   

orm:convert-d1-schema ~/schema.yml yml ~/newyml returns The helper "em" is not defined



 Comments   
Comment by Guilherme Blanco [ 14/Sep/11 ]

You are not providing the EntityManagerHelper to Symfony Console.

Marking as invalid. Please reopen if you have already addressed that and issue is still valid.





[DCOM-63] CacheReader does not take in account parent classes Created: 21/Aug/11  Updated: 14/Sep/11  Resolved: 14/Sep/11

Status: Resolved
Project: Doctrine Common
Component/s: Annotations
Affects Version/s: 2.1
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Filip Procházka Assignee: Guilherme Blanco
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

As the title says, Doctrine\Common\Annotations\CachedReaded is buggy.

It takes in account only modification time of file of the class it processes. But it ignores it's parents.

Pull: https://github.com/doctrine/common/pull/54

Shoud I change the commit message or something?



 Comments   
Comment by Guilherme Blanco [ 14/Sep/11 ]

As per Johannes Smith comment: "Since we are only reading the annotations of one file, I don't see why we need this."

Closed as won't fix.





[DCOM-57] Doctrine\Common\Cache\AbstractCache::deleteAll() does not take the namespace into account Created: 14/Jul/11  Updated: 08/Sep/11  Resolved: 27/Aug/11

Status: Resolved
Project: Doctrine Common
Component/s: Caching
Affects Version/s: 2.1
Fix Version/s: 2.1.2

Type: Bug Priority: Major
Reporter: Eric Durand-Tremblay Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None
Environment:

Memcached



 Description   

The deleteAll() function delete all keys with no respect of the namespace.

Using orm:clear-cache:metadata with memcache result in the deletion of all memcache keys. (including keys unrelated to the orm)



 Comments   
Comment by Eric Durand-Tremblay [ 14/Jul/11 ]

See pull request : https://github.com/doctrine/common/pull/46

I think the best way to fix this problem is to check for the namespace in the getIds() function.

Unfortunately, that would break the interface of AbstractCache

Split the function in getIds() and abstract _getIds(). Do the namespace check in getIds()

I can do pull request on github if necessary.

NOTE
I checked on master branch and the probleme is not fixed by commit
786deeae264ae03061d6aa92c681afa4344f18b9 : Fixed AbstractCache where delete* functions were incorrectly being prepended by namespace if any is defined. This was causing a double p

Comment by Guilherme Blanco [ 27/Aug/11 ]

Fixed in master since this commit: https://github.com/doctrine/common/commit/486169851ea87b3e14ed45d5bfd7d07b1d41af65

Comment by Benjamin Eberlei [ 08/Sep/11 ]

Merged into 2.1.x for next release





[DCOM-58] Having class named Entity in the global namespace, interferes with the new annotation reader. Created: 04/Aug/11  Updated: 07/Sep/11  Resolved: 07/Sep/11

Status: Resolved
Project: Doctrine Common
Component/s: Annotations
Affects Version/s: 2.1
Fix Version/s: 2.2

Type: Bug Priority: Minor
Reporter: Michael Nielsen Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None
Environment:

Ubuntu 10.04, Zend Server CE 5.1.0 (Apache 2.2.14, PHP 5.3.5), Doctrine 2.1



 Description   

Having a class named Entity in the global namespace, results in exceptions: "Class xxx is not a valid entity or mapped super class."
The problem is not present in 2.0

The problem:

\Doctrine\Common\Annotations\DocParser.php
line 421: $reflClass = new \ReflectionClass($name);

$name is "Entity", and the reflection finds the non-doctrine Entity-class in the global namespace, and so doesn't find the "@Annotation" it's looking for when it examines the class.

If I force it to reflect on \Doctrine\ORM\Mapping\Entity instead, the next problem is instantiation:

\Doctrine\Common\Annotations\DocParser.php
line 435: return new $name($values);

Forcing that to the right class, brings a "Failed opening required 'Doctrine/ORM/Mapping/Doctrine/ORM/Mapping/Id.php' " - I haven't investigated further (yet at least).

/Michael



 Comments   
Comment by Guilherme Blanco [ 07/Sep/11 ]

Fixed https://github.com/doctrine/common/commit/481083226477b325decfd7202ff59c252397c392





[DCOM-53] PhpParser doesn't ignore commented keywords Created: 24/May/11  Updated: 04/Sep/11  Resolved: 04/Sep/11

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

Type: Bug Priority: Major
Reporter: Michel D'HOOGE Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

PhpParser class provided with Symfony2 BETA 2
https://github.com/doctrine/common/blob/18518814c0f4e11fe90a0ec56919d4d2315565ef/lib/Doctrine/Common/Annotations/PhpParser.php



 Description   

The PhpParser makes a too optimistic assumption about code convention...

If you have the word 'class' or 'interface' in the comment before the class definition, preg_match_all finds wrong slice of code and PHP complains with a Warning about "Unterminated comment". This occurs only once after the cache is cleared.



 Comments   
Comment by Fabio B. Silva [ 03/Sep/11 ]

Hello all
I tested this issue.

After rewriting the php parser does not happen. : https://github.com/doctrine/common/commit/d274bd7fe9e8f5657c670ed8a22a31024544eeeb

I think that can be closed

Thanks

Comment by Michel D'HOOGE [ 04/Sep/11 ]

Unfortunately, I can't remember when the problem disappeared but it is no longer here for sure.
And since the call to preg_match_all has been removed, we can close the issue.





[DCOM-60] SimpleAnnotationReader get*Annotations Created: 12/Aug/11  Updated: 28/Aug/11  Resolved: 28/Aug/11

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

Type: Bug Priority: Major
Reporter: Ryan Hutchison Assignee: Guilherme Blanco
Resolution: Invalid Votes: 0
Labels: None


 Description   

<br />
<b>Notice</b>: Undefined variable: class in <b>/usr/home/gym/doctrine2-common/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php</b> on line <b>45</b><br />
<br />
<b>Fatal error</b>: Call to a member function getName() on a non-object in <b>/usr/home/gym/doctrine2-common/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php</b> on line <b>45</b><br />

Doctrine/Common/Annotations/SimpleAnnotationReader.php
    public function getMethodAnnotations(\ReflectionMethod $method)
    {
-        return $this->parser->parse($method->getDocComment(), 'method '.$class->getName().'::'.$method->getName().'()');
+        return $this->parser->parse($method->getDocComment(), 'method '.$method->getName().'::'.$method->getName().'()');
    }

    public function getPropertyAnnotations(\ReflectionProperty $property)
    {
-        return $this->parser->parse($property->getDocComment(), 'property '.$class->getName().'::$'.$property->getName());
+        return $this->parser->parse($property->getDocComment(), 'property '.$property->getName().'::$'.$property->getName());
    }


 Comments   
Comment by Guilherme Blanco [ 28/Aug/11 ]

This issue is already fixed in master. Closing the ticket.





[DCOM-66] Github-PR-55 by shesek: Use stream_resolve_include_path Created: 25/Aug/11  Updated: 28/Aug/11  Resolved: 28/Aug/11

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

Type: Improvement Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

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

{username}

:

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

Message:

`Doctrine\Common\ClassLoader::fileExistsInIncludePath` behaves the same as `stream_resolve_include_path`, use that instead when available (PHP >= 5.3.2). It should be faster than doing that manually.



 Comments   
Comment by Guilherme Blanco [ 28/Aug/11 ]

Fixed in trunk.





[DCOM-59] ArrayCollection contains function - switch from in_array to foreach Created: 10/Aug/11  Updated: 28/Aug/11  Resolved: 28/Aug/11

Status: Resolved
Project: Doctrine Common
Component/s: Collections
Affects Version/s: 2.1
Fix Version/s: 2.2

Type: Improvement Priority: Minor
Reporter: PEM Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None

Attachments: File inArray_vs_foreach.php    

 Description   

The function contains uses in_array to determine if an element provided as parameter is found in the array $this->_elements, and performs a strict comparison.
There might be a way to improve the performances of this function by using a foreach + if

In attachement you can find a small bench file to show the differences between in_array and foreach on object search.
You might want to run the bench with a doctrine Object to verify if this changes anything to the result.
For simple Objects, foreach is much faster when the array has less than 30k elements. Over 30k the difference flattens, and might revert around 50k (meaning that in_array might start being faster when the array has more than 50k entries).

Maybe we could provide two functions, one for smaller than 40-50k items (using foreach), and one for bigger arrays (using in_array) ?



 Comments   
Comment by Guilherme Blanco [ 28/Aug/11 ]

I created more test cases and indeed foreach is around 40% faster than in_array. I applied the change in our suite, this should be available in new versions of Doctrine Common.





[DCOM-61] Class annotation is not setting annotation properties Created: 18/Aug/11  Updated: 25/Aug/11  Resolved: 25/Aug/11

Status: Resolved
Project: Doctrine Common
Component/s: Annotations
Affects Version/s: 2.1
Fix Version/s: None

Type: Bug Priority: Blocker
Reporter: James Reed Assignee: Benjamin Eberlei
Resolution: Invalid Votes: 0
Labels: None
Environment:

Windows 7 64-bit, PHP v5.3.1



 Description   

My annotations were working fine with v2.0.5. Once I upgraded to v2.1 they stopped working. Using this condensed code based on the v2.1 documentation on Annotations (http://www.doctrine-project.org/docs/common/2.1/en/reference/annotations.html):

require 'c:/dev/library/doctrine-orm/Doctrine/Common/ClassLoader.php';

$classLoader = new \Doctrine\Common\ClassLoader('Doctrine', 'c:/dev/library/doctrine-orm');
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Symfony', 'c:/dev/library/doctrine-orm/Doctrine');
$classLoader->register();

$reader = new \Doctrine\Common\Annotations\AnnotationReader();
$reader->setIgnoreNotImportedAnnotations(true);
$reader->setEnableParsePhpImports(false);
$className = 'User';
$reflectionClass = new \ReflectionClass($className);

$classAnnotations = $reader->getClassAnnotations($reflectionClass);
echo "Class Annotations - $className:\n";
print_r($classAnnotations);

/**
* @Annotation
*/
class Foo {
    public $bar;
}

/**
* @Foo(bar="foo")
*/
class User {
    
}

The result is:

Class Annotations - User:
Array
(
    [0] => Foo Object
        (
            [bar] =>
        )

)

Why is bar empty? If I remove the @Foo annotation from the docblock for the User class, then the result is an empty array. So it's clearly detecting the annotation, it's just not setting the annotation property.



 Comments   
Comment by James Reed [ 25/Aug/11 ]

This is blocking me from upgrading to v2.1

Comment by James Reed [ 25/Aug/11 ]

Got the same result with v2.0.6. Must be something I'm missing here.





[DCOM-28] Extract Common Persistance Interfaces Created: 13/Oct/10  Updated: 30/Jul/11

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

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

Attachments: File dcom_persistence.diff    
Issue Links:
Duplicate
is duplicated by DCOM-23 Add interface for ObjectManager Resolved

 Description   

I discussed this with jwage on symfony day cologne and this also came up during discussions with @dzuelke at IPC yesterday. So i hacked up a first patch for discussion that adds a Doctrine\Common\Persistance namespace and extracts the functionality all our 3 layers implement with regards to EntityManager/EntityRepository (and equivalents).

Additionally i think it might make sense to also add an interface "ObjectMetadata" that has several getters-only that allow access to the field, identifier and association mapping information. This stuff is not necessarly compatible across layers when returned as its "array" representation, but for libraries hooking into the metadata (symfony admin generator) this might not even be necessary.



 Comments   
Comment by Jonathan H. Wage [ 15/Feb/11 ]

Added the interfaces here https://github.com/doctrine/common/commit/59e6b8c6edcb271622923035b687a063c2b47ce8

I implemented them here in the mongodb-odm https://github.com/doctrine/mongodb-odm/commit/8d02e8439fb6737de1e23e1953a643858a8a6c68

and the ORM https://github.com/doctrine/doctrine2/commit/68a40996841b1dbec3b8de5c1038809e5db512b7

I think we can add a few more methods to ClassMetadata interface that are always gonna exist between the different persistence layers. Let me know what you think and what you want to add.

Comment by Guilherme Blanco [ 15/Feb/11 ]

Jon is working on this.

Comment by Lukas Kahwe [ 19/Mar/11 ]

CouchDB ODM also has DocumentRepositry::findMany(array $ids)
Should we add that to the interface?

Comment by Benjamin Eberlei [ 19/Mar/11 ]

No, that method is only on the repository because CouchDB doesn't need persisters (yet). Its not part of the interfaceable public methods.

Comment by Lukas Kahwe [ 19/Mar/11 ]

Not sure I understand. The method is used in DocumentRepository::findBy() as well as in PersistentIdsCollection::load. Seems unnecessary for that method to be public just for this. At any rate imho the method seems convenient and also allows for more efficient access in many RDBMS compared to the generic findBy($criteria) method. So it seems worthwhile adding it.

Comment by Benjamin Eberlei [ 20/Mar/11 ]

It doesn't matter what CouchDB uses internally on the DocumentRepository, i don't think this method is particularly useful in another context than CouchDBs use of Collections. In any case the method is just a proxy for findBy(array("id" => array(1, 2, 3, 4, 5, 6))); and i am not sure we need such a method on an interface just for convenience, Repository::find() use-case is much broader.

Comment by Lukas Kahwe [ 20/Mar/11 ]

Actually using findMany($ids) ias clearly more efficient in CouchDB than using findBy(array("id" => $ids));
The same applies to PHPCR, since going by the node path means you can go via the normal node API, rather than the search API.
So this is already 2 out of 3 examples and I do not know MongoDB enough to tell if they also have some specific API advantage.

Comment by Benjamin Eberlei [ 20/Mar/11 ]

Hm, you might be right. Ok, this should be included.

What i am still pondering with is adding array $orderBy and $firstResult, $maxResults to findOneBy() and findBy() and findAll().

@Jon: Would this be possible for MongoDB?

It would not be possible for all use-cases in CouchDB, but for some it can work.

Comment by Lukas Kahwe [ 20/Mar/11 ]

Just a super trivial pull to add this to the interface:
https://github.com/doctrine/common/pull/11

Comment by Lukas Kahwe [ 21/Mar/11 ]

also wondering if we want to include the idgenerator API in the interface?

Comment by Benjamin Eberlei [ 21/Mar/11 ]

Hm yes, i think that is necessary. At least the differentation between assigned and auto-generated ids is relevant for metadata queries.

Comment by Jonathan H. Wage [ 21/Mar/11 ]

Yes, findMany() is possible with MongoDB.

I think it would just be a proxy to:

public function findMany(array $ids)
{
    return $this->findBy(array('_id' => array('$in' => $ids)));
}
Comment by Benjamin Eberlei [ 21/Mar/11 ]

Hm, What is this syntax? This is not conforming to the EntityRepository interface.

The only two allowed methods are:

IN Query:

$ids = array(...);
findBy(array('_id' => $ids)); 

Equals = Query:

$ids = 1234;
findBy(array('_id' => $id)); 

Everything else is not portable accross implementations and should only be able through DocumentManager::CreateQuery* sort of apis.

Comment by Jonathan H. Wage [ 21/Mar/11 ]

To find by things in MongoDB you just give an array of key => value pairs. It gets passed straight through to MongoDB. The $in syntax is just soemthing mongodb supports. It's not anything specific to Doctrine.

Comment by Lukas Kahwe [ 30/Jul/11 ]

i want to heat this topic back up:

  • findMany()
  • id generator API




[DCOM-48] Autoloading with a namespace is very restricted Created: 08/Apr/11  Updated: 17/Jul/11  Resolved: 17/Jul/11

Status: Closed
Project: Doctrine Common
Component/s: Class Loading
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Matthieu Napoli Assignee: Benjamin Eberlei
Resolution: Invalid Votes: 0
Labels: None


 Description   

Sorry for the vague title of the issue, but here is the problem:

$classLoader = new ClassLoader('Tests', '/basePath/tests');

If I want to autoload \Tests\Class1, it will look for /basePath/tests/Tests/Class1.php.

I would like it to load: /basePath/tests/Class1.php. i.e., the namespace registered is removed from the path.

Do you see what I mean ? Zend Framework autoloader allow this behavior, I am surprised the Doctrine autoloader doesn't allow that.

Thanks



 Comments   
Comment by Matthieu Napoli [ 29/Apr/11 ]

Hi, any news on this ?

I'd like to know if this is going to be corrected some day, or if I should not wait for it and find another solution ?

Thank you

Comment by Guilherme Blanco [ 17/Jul/11 ]

Hi,

Zend Framework (v1) does not follow PSR-0 (http://groups.google.com/group/php-standards/web/psr-0-final-proposal) so it does whatever it wants.
Second version of Zend Framework is PSR-0 compliant, so your wish will probably fail too.

Let me explain what is the deal: Every single project, no matter what it is, can be contained in a package (aka. namespace in PHP). This means that:

library
- Controller.php
- Controller/
  - Action.php

Is plain wrong. Why? Because it's part of a project (Your app (Application), Zend, Doctrine, Symfony, etc).
Due to this, PSR-0 stricts that it only loads namespaced classes, and nothing else. It was an agreement between 18 big PHP projects, including ZF, Symfony, Lithium, CodeIgniter, etc.

Cheers,

Comment by Benjamin Eberlei [ 17/Jul/11 ]

You can use any autoloader you want for your own classes, the Doctrine one is just focused on namespaces becuse Doctrine only uses namespaces.





[DCOM-42] Sort in ArrayCollection Created: 22/Mar/11  Updated: 17/Jul/11  Resolved: 17/Jul/11

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

Type: Improvement Priority: Trivial
Reporter: Thomas Lundquist Assignee: Benjamin Eberlei
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

Needed a sort function in ArrayCollection, made it. Simple but works for me at least.

Pull request: https://github.com/doctrine/common/pull/12



 Comments   
Comment by Guilherme Blanco [ 17/Jul/11 ]

As per github comment.





[DCOM-54] ClassLoader protected properties Created: 14/Jun/11  Updated: 17/Jul/11  Resolved: 17/Jul/11

Status: Resolved
Project: Doctrine Common
Component/s: Class Loading
Affects Version/s: None
Fix Version/s: 2.1.1

Type: Improvement Priority: Major
Reporter: Jon Johnson Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

na



 Description   

It would be great if the members of ClassLoader($fileExtension, $namespace, $includePath, $namespaceSeparator) where protected instead of private. In order to work around DCOM-20 I was going to extend and override loadClass but the private members mean I need to copy a lot of other code.
Didn't seem worth the overhead of creating a patch - but I can if you prefer.



 Comments   
Comment by Guilherme Blanco [ 17/Jul/11 ]

Fixed in https://github.com/doctrine/common/commit/c614a20e02cb8fd5531bce1adcb34a1210f79ac6





[DCOM-52] Doctrine\Common\Util\Debug::dump(): Why strip_tags dumps ? Created: 20/May/11  Updated: 17/Jul/11  Resolved: 17/Jul/11

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

Type: Improvement Priority: Trivial
Reporter: Jonathan Clus Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

Doctrine 2.1Beta with php_xdebug-2.1.0-5.3-vc6



 Description   

I use Doctrine\Common\Util\Debug::dump() for debugging my entities, but original method call strip_tags from the output generated by var_dump, so i got a nasty debug which is a very long line not formatted.
I commented the strip_tags call, so my debug is more human readable.
Is it possible to remove the strip_tags call, or let the developper to choose if debug method should call it or not ?



 Comments   
Comment by Guilherme Blanco [ 17/Jul/11 ]

This issue is not fixed in https://github.com/doctrine/common/commit/8dc338afaa8d2e94fbecd80b439341d0ffb9c7e7

Cheers,





[DCOM-56] Remote autoloading from annotations completly, replacing it with its own loading mechanism Created: 01/Jul/11  Updated: 02/Jul/11  Resolved: 02/Jul/11

Status: Resolved
Project: Doctrine Common
Component/s: Annotations
Affects Version/s: 2.1
Fix Version/s: 2.1

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


 Description   

This is a mail from me to the symfony-dev mailing-list:

I am sorry it is very late to bring this up again, but given the nasty problems I faced today with the way annotationreader works with autoload = true I have to share them (and blow of some steam). While i guess its to late to change this again before 2.0, we might still have to discuss to go away from autoload = true for 2.1. Now for the reasons:

AnnotationReader with autoload = true (which Symfony2 uses) will not only require a silent autoloader, it requires ALL autoloaders used to be silent. While this is the case for the Symfony Universal loader its not the case for the Doctrine one, and not for many others - and its not even a PSR-0 requirement. For a simple reason: Supporting silent failure means using file_exists, means a file stat, which means apc.stat = 0 is useless. While I don't care so much about it in Doctrine context, because the AnnotationReader default is NOT to autoload annotations this will cause problems for Symfony: Not every library in any Symfony2 app will be included through a silent autoloader. That means given the context users might run into problems using annotations that they have absolutely no way of fixing. And since the AnnotationReader does not know this upfront, potential failures become very real issue.

Example: I use SecurityExtraBundle and happen to have my SuperDuperLibrary XYZ. That library was developed by my company and contains tons of important business logic but unfortunately uses a non-silent autoloader (for whatever reasons). However i use Symfony to secure access to it by generating secure proxies. Now what happens if an annotation reader runs over that library? Because the current namespace is always considered, for every @var _NAMESPACE."
var" is class_exists'ed and then your code fatal errors. I didn't see this problem before, because i don't use annotations myself so much and always in the BC Doctrine 2.0.x way and that slipped my mind. Same goes for Validation with Annotations on external code, or maybe in the future services definitions through annotations.

All this trouble we are getting into with autoloading annotations is just because we wanted to validate that the annotations used actually exist. But since we changed to a use/import approach rather then re-using namespaces we don't even have the clashing problem anymore that got us into the trouble with class_exists before. The autoloading however also got us and users into other problems:

1. We have to maintain a rather large map of "blacklisted" annotations that never throw failure exceptions because they are actually used as doc documentations. As with blacklists this is never a complete list.
2. Users with intensive doc-block usage are punished by Symfony having to maintain their own blacklist of annotations that never throw exceptions so that their code actually works.
3. Libraries have to handle the case that a reader is either using autoloading or not through special code.

While I do think it would have been nice to offer validation for annotation this is a task that should be put on IDEs and developers, since it turns out that its not possible flawlessly within the library itself. The AnnotationReader should always use class_exists($name, false). Docblocks are still comments and the code shouldn't fail because classes are not available that are not even relevant in the context of the current AnnotationReader. Each part of the code that uses an AnnotationReader should require_once the annotations that it can potentially need upfront. That even works for Validation as you can grab the tags from the DIC. That way we have a single mode of operation for the AnnotationReader and not two different ones that are 180 degrees different. OF course one could argue ALWAYS to use class_exists($name, true) instead, but i hope my mail showed why this is not a good idea.

If for some reason we do want autoloading for annotations then it should be a mechanism different from the PHP one, because they are both not compatible. The reader could have hooks for autoloading and validation mechanisms. Nothing we want to add for Doctrine Common 2.1, but something we could easily play around with for Common 3.

Next a mail with implementation details:

I propose to change the following on AnnotationReader:

1. Add a method to register annotation classes:
$reader->registerAnnotation("Symfony\Bridge\Doctrine\Validator\UniqueEntity");
and $reader->registerAnnotations(array(..));
2. Add a method to register files that contain annotations:
$reader->registerAnnotationFile(".."), directly loading them via
require_once;
3. Add a method to register annotation namespaces:
$reader->registerAnnotationNamespace("Symfony\Component\Validator\Constraint",
$dir). This is used to create a silently failing PSR-0 "autoloader" for
this path + directories. It can be automatically populated from data in
the UniversalClassLoader.
4. Change the class_exists check to never use autoload = true. If a
class is part of a registered annotation namespace try load the file based on a silent
PSR-0 autoload for it using an autoloader impl. contained in the
AnnotationReader (not the php autoloading mechanism), before triggering
the class_exists($name, false)

This way for symfony only the UniversalClassLoader data has to be used
to populate the registered annotation namespaces.



 Comments   
Comment by Benjamin Eberlei [ 02/Jul/11 ]

Implemented





[DCOM-55] Ugly problems with default import __NAMESPACE__ when it contains non-annotation classes that are docblock props Created: 29/Jun/11  Updated: 29/Jun/11  Resolved: 29/Jun/11

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

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


 Description   

Say you have a class "Entity".

Then /** @Entity */ on a class in the same namespace will try to instantiate Entity.

We should avoid this by testing if Entity is a subclass of \Doctrine\Common\Annotations\Annotation



 Comments   
Comment by Benjamin Eberlei [ 29/Jun/11 ]

Actually this problem is more problematic, we have to enforce extending \Doctrine\Common\Annotations\Annotation for ALL annotations.

Comment by Benjamin Eberlei [ 29/Jun/11 ]

Fixed.





[DCOM-46] Make annotation index configurable Created: 07/Apr/11  Updated: 13/May/11  Resolved: 13/May/11

Status: Resolved
Project: Doctrine Common
Component/s: Annotations
Affects Version/s: 2.1
Fix Version/s: 2.1

Type: Improvement Priority: Major
Reporter: Johannes Schmitt Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

So, this is another improvement that I'd like to make. Right now all annotations are indexed by their name which has the limitation that on the top level annotations with the same name are only gathered once.

/**
 * @param mixed $a
 * @param mixed $a
 * @param mixed $a
 */
function ($a, $b, $c) { }

In the above case the annotation parser would only pick up one "param" annotation. My guess is that this was done for fast lookups, but I think we need to make this configurable (I know you hate this word ) as the workaround here is needlessly bloated.

/**
 * @params({@param, @param, @param})
 */
function($a, $b, $c) {}

This only requires two lines to be changed/made conditional, see
https://github.com/schmittjoh/SecurityExtraBundle/blob/master/Mapping/Driver/AnnotationParser.php#L63
https://github.com/schmittjoh/SecurityExtraBundle/blob/master/Mapping/Driver/AnnotationParser.php#L72

p.s. If you want me to provide a patch for this, just tell me.



 Comments   
Comment by Guilherme Blanco [ 13/May/11 ]

Implemented on master.

https://github.com/doctrine/common/commit/59910f53fad7ce08a1ec840d9874a74cefcf32b8





[DCOM-50] Unable to use '@' in combination with a number (example: email@3domain.tld) in comment block Created: 28/Apr/11  Updated: 13/May/11  Resolved: 13/May/11

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

Type: Bug Priority: Major
Reporter: Florian Preusner Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

My tld contains a number at the beginning (8points.de).
I'm not able to use it in the @author section (@author Florian Preusner <florian.preusner@8points.de>) cause after the "@" the next letter is a number.

Exception:
AnnotationException: [Syntax Error] Expected Doctrine\Common\Annotations\Lexer::T_IDENTIFIER, got '8' at position 118 in method Blog\MainBundle\Controller\MainController::indexAction().
n /var/www/floeh/vendor/doctrine-common/lib/Doctrine/Common/Annotations/AnnotationException.php at line 41

I think this is a bug?!



 Comments   
Comment by Guilherme Blanco [ 13/May/11 ]

Fixed on master.

https://github.com/doctrine/common/commit/42029e6327f6ffc00a268cb61892b8ecbba49278





[DCOM-51] Support parsing of single quotes Created: 03/May/11  Updated: 05/May/11  Resolved: 05/May/11

Status: Resolved
Project: Doctrine Common
Component/s: Annotations
Affects Version/s: 2.0.2
Fix Version/s: 2.1

Type: New Feature Priority: Major
Reporter: Jordi Boggiano Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

It'd be great to support single quotes, this limitation doesn't make sense from a user point of view and in php context single quotes are so commonly used that it's easy to slip and then get some funny Exception message out of it.



 Comments   
Comment by Jordi Boggiano [ 03/May/11 ]

Patch against master is at https://github.com/doctrine/common/pull/17

Comment by Guilherme Blanco [ 05/May/11 ]

Merged the pull request.

Thanks!





[DCOM-45] Allow different namespaces for the same alias Created: 07/Apr/11  Updated: 26/Apr/11  Resolved: 26/Apr/11

Status: Resolved
Project: Doctrine Common
Component/s: Annotations
Affects Version/s: 2.1
Fix Version/s: 2.1

Type: Improvement Priority: Major
Reporter: Johannes Schmitt Assignee: Benjamin Eberlei
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

Right now, it is only possible to register one namespace per annotation alias. This might lead to problems since we now throw exceptions if an annotation is not found in that namespace (https://github.com/doctrine/common/commit/8967f476ddcdb7b9017a8be7f774979ca4c72247).

This improvement would be a necessary first step in order to overcome the problem we talked about on IRC (FrameworkExtra/SecurityExtra both using the "extra" alias).



 Comments   
Comment by Johannes Schmitt [ 26/Apr/11 ]

I'll close this as there is a better solution now.





[DCOM-38] Annotation parser plain value types Created: 25/Feb/11  Updated: 07/Apr/11  Resolved: 07/Apr/11

Status: Resolved
Project: Doctrine Common
Component/s: Annotations
Affects Version/s: 2.0.1
Fix Version/s: 2.0.2

Type: Bug Priority: Trivial
Reporter: Martin Ivičič Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

any



 Description   

Hi,

I posted this question in doctrine user group(https://groups.google.com/forum/?fromgroups#!topic/doctrine-user/QhAz-Yr70T0), but with no response, so I'd like to open it up here as the solution is trivial and would save me either a lot of sub-classing or prevent me from changing the doctrine library files.

This annotation

class SomeGrid {
    /**
     *  @GRID:Column(header="Reg. plate", width=80, editable=TRUE, hidden=FALSE, tooltip="Registration plate", align="left", sortable=TRUE)
     */
    public $regPlate;
}

produces the following object:

(object) Grid\Annotations\Column {
    "header"   => (string) "Reg. plate"
    "width"    => (string) "80"
    "editable" => (bool)   true
    "hidden"   => (bool)   false
    "tooltip"  => (string) "Registration plate"
    "align"    => (string) "left"
    "sortable" => (bool)   true
}

You can see the value of the width property is string even I didn't use quotes in the annotation.
The same happens with float values, but true and false values become, correctly, bool.

I found this happens because of the following fragment of code in \Doctrine\Common\Annotations\Parser and could be easily corrected by prefixing the value with the corresponding type cast (marked in red).

    case Lexer::T_STRING:
        $this->match(Lexer::T_STRING);
        return $this->lexer->token['value'];
    case Lexer::T_INTEGER:
        $this->match(Lexer::T_INTEGER);
        return (int)$this->lexer->token['value'];
    case Lexer::T_FLOAT:
        $this->match(Lexer::T_FLOAT);
        return (float)$this->lexer->token['value'];
    case Lexer::T_TRUE:
        $this->match(Lexer::T_TRUE);
        return true;
    case Lexer::T_FALSE:
        $this->match(Lexer::T_FALSE);
        return false;

The point is, in our app, some of the values go directly to browser and are processed by JavaScript. Having those values as strings breaks all kinds of mathematical operations on the client or would require additional (unnecessary) string to int/float conversions.



 Comments   
Comment by Benjamin Eberlei [ 07/Apr/11 ]

Fixed.





[DCOM-41] Make annotation parser a bit cleverer Created: 09/Mar/11  Updated: 07/Apr/11  Resolved: 07/Apr/11

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

Type: Bug Priority: Major
Reporter: Johannes Schmitt Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

From an initial look that I had at the annotation parser, it simply search for anything starting with an "@" somewhere in the doc comment and assumes that it is an annotation. Now, if someone uses the @ somewhere in his doc comment but not as an annotation, the parser breaks.

An example for this can be found in the Doctrine code base, the following comment will result in a parse error:

    /**
     * Annotation     ::= "@" AnnotationName ["(" [Values] ")"]
     * AnnotationName ::= QualifiedName | SimpleName | AliasedName
     * QualifiedName  ::= NameSpacePart "\" {NameSpacePart "\"}* SimpleName
     * AliasedName    ::= Alias ":" SimpleName
     * NameSpacePart  ::= identifier
     * SimpleName     ::= identifier
     * Alias          ::= identifier
     *
     * @return mixed False if it is not a valid annotation.
     */

Obviously the first @ is not used to refer to an annotation here. I think it makes sense to allow new annotations only to start at a new line, what do you think?



 Comments   
Comment by Johannes Schmitt [ 09/Mar/11 ]

The pull request is here:
https://github.com/doctrine/common/pull/9

Comment by Benjamin Eberlei [ 09/Mar/11 ]

Does this still work with nested annotations?

/**
 * @annot({@annot2})
 */
Comment by Johannes Schmitt [ 09/Mar/11 ]

Sure, my patch only changes the way how the first @ is found.

Comment by Roman S. Borschel [ 09/Mar/11 ]

First of all, thanks for the patch. I'm just not sure whether the added complexity (nontrivial regexp vs substr/strpos) and performance penalty (to be tested) can justify fixing these such edge-cases where an @ appears in the comment block that is not one of the already stripped inline docblocks. Just my two cents, I think this needs further investigation and more extensive testing.

Edit: Since the regex is "only" applied once per parsed docblock the perf. difference might be negligible but should be tested anyway. Remains the verification of the correctness of the regex, given more extensive testing and test-cases.

Comment by Johannes Schmitt [ 09/Mar/11 ]

I think performance should not be an issue since this data is cached anyway.

As for the necessity of this, it's a pain if you parse third party files and they use @ somewhere which then breaks the parser. Since Symfony2 is heavily relying on the annotation parser not only for Doctrine metadata, but for annotation metadata in general, imo this needs to be fixed. I'm not 100% happy with my solution since it covers not all, but only the most likely cases. Ideally, the lexer would have a better way to detect if an @ is used to mark the beginning of an annotation, and simply ignore the @ if it does not. I'm not familar with the lexer code, but you probably have a better understand of how it works and whether this would make sense.

EDIT: I've made an alternative implementation which you can find here: https://github.com/schmittjoh/common/commit/123315e21aff6d7bce7cb77ab798660d0e68b139

Comment by Benjamin Eberlei [ 05/Apr/11 ]

Fixed formatting of code block

Comment by Benjamin Eberlei [ 07/Apr/11 ]

Fixed





[DCOM-44] Throw exception if known namespaced annotation is not found Created: 05/Apr/11  Updated: 06/Apr/11  Resolved: 05/Apr/11

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

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


 Description   

If we know that an annotation is namespaced and that the namespace exists we should throw an exception if the annotation specified does not exist, currently its just skipped which can be very nasty to debug.



 Comments   
Comment by Benjamin Eberlei [ 05/Apr/11 ]

Implemented

Comment by Gediminas Morkevicius [ 06/Apr/11 ]

For example my extensions are using same alias[vendor name] for all annotations. In this case each extension can be used independetly from others. And after this "fix" it couples all extensions and forces to autoload all annotations because in other case it will simply throw a fatal error, since class_exists now uses require without even checking if file exists.
Instead of fatal error ClassLoader maybe could throw an exception.

Comment by Benjamin Eberlei [ 06/Apr/11 ]

This change should not fatal through class_exists(). I dont change the autoloading behavior at all, i just throw an exception if the class was not found and annotation is namesapced

Johannes complained about this for the same reason (reusing vendor prefixes).

I find this quite annoying, because i constantly misstype annotations and get no error messages at all, the number of bug reports in this regard is also quite high. We have to find a solution for this





[DCOM-39] It is not possible to load multiple directories under the same namespace Created: 04/Mar/11  Updated: 04/Mar/11  Resolved: 04/Mar/11

Status: Resolved
Project: Doctrine Common
Component/s: Class Loading
Affects Version/s: 2.0.1
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Steven Rosato Assignee: Benjamin Eberlei
Resolution: Invalid Votes: 0
Labels: None


 Description   

Consider the following code snippet:

$loader = new ClassLoader('DoctrineExtensions',
   "/path/to/vendor/doctrine2-extensions-beberlei/lib");
$loader->register();

$loader = new ClassLoader('DoctrineExtensions',
   "/path/to/vendor/doctrine2-extensions-srosato/lib");
$loader->register();

The latter will not be able to be loaded since the documentation specifies (with good reason) that class loaders do not fail silently. Is there a workaround for this issue?



 Comments   
Comment by Steven Rosato [ 04/Mar/11 ]

Or maybe this is intentional, such as authors that write separate doctrine extensions (according to this exemple) must define their own namespace.

Comment by Benjamin Eberlei [ 04/Mar/11 ]

This is desired behavior, you need to pass a more specific path like "DoctrineExtensions/Versionable" + "DoctrineExtensions/Paginate" and so on...





[DCOM-10] The annotation parser isn't EBNF compliant Created: 04/Jul/10  Updated: 16/Feb/11  Resolved: 16/Feb/11

Status: Closed
Project: Doctrine Common
Component/s: Annotations
Affects Version/s: 2.0.0-BETA4
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Bernhard Schussek Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None
Environment:

PHP 5.3.2, Linux Ubuntu 10.04



 Description   

The EBNF allows passing multiple comma-separated annotations to an annotation:

Annotation ::= "@" AnnotationName ["(" [Values] ")"]
Values ::= Array | Value {"," Value}*
Value ::= PlainValue | FieldAssignment
PlainValue ::= integer | string | float | boolean | Array | Annotation

Therefore the following should be possible.

/** @Name(@Foo, @Bar) */

This results in an error though.

IMO,

/** @Name(@Foo, @Bar) */

should be equivalent to

/** @Name({@Foo, @Bar}) */

just like

/** @Name(foo = "foo", bar = "bar") */

is equivalent to

/** @Name({foo = "foo", bar = "bar"}) */


 Comments   
Comment by Bernhard Schussek [ 04/Jul/10 ]

Fixed in http://github.com/bschussek/doctrine-common/tree/DCOM-10

Comment by Bernhard Schussek [ 04/Jul/10 ]

As I've just noticed, the statement that

/** @Name(foo = "foo", bar = "bar") */

equals

/** @Name({foo = "foo", bar = "bar"}) */

is wrong. The first does field assignments, the second stores the array in the "value" field.

Nevertheless, either Doctrine's implementation (as per my commit) or the EBNF have to be updated.

Comment by Guilherme Blanco [ 15/Feb/11 ]

Your branch added another vulnerability, so I cannot merge.

The problem appears when you do this:

@Name(@Foo, {bar="bar"})

What would you expect on this situation? I'd imagine this:

array(
    0 => object<Foo>,
    1 => array(
        'bar' => 'bar'
    )
)

But with your patch, the actual result is:

array(
    0 => object<Foo>,
    'bar' => 'bar'
)

There's a way to fix it by changing how FieldAssignment returns. Instead of returning an array, it should return return an stdClass.
Then we could only update the Values grammar accordingly.

I'll assign this issue to me, so I can work on it to be EBNF compatible. Too bad it took so many time for us to look at it. =(

Comment by Bernhard Schussek [ 16/Feb/11 ]

Yes, I'd expect the first result. Thanks for looking into this, I completely forgot about this issue.

Comment by Guilherme Blanco [ 16/Feb/11 ]

This issue was fixed in: https://github.com/doctrine/common/commit/4210fbd8b261c000c793461c4f815b4d43bcc362

Thanks a lot for the bug report.
EBNF and Code are now compliant with each other. Took some time to be fixed, but here it is. =)





[DCOM-36] Declare annotation namespaces in the class' doc comment Created: 10/Feb/11  Updated: 15/Feb/11  Resolved: 15/Feb/11

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

Type: Improvement Priority: Major
Reporter: Kris Wallsmith Assignee: Guilherme Blanco
Resolution: Can't Fix Votes: 0
Labels: None


 Description   

I would like to declare my default annotation namespace and namespace aliases in my class' doc comment. This will ensure my class can be understood by the annotation reader regardless of its configuration.

An example of how I would use this:
https://gist.github.com/821412



 Comments   
Comment by Jonathan H. Wage [ 11/Feb/11 ]

I don't think implementing this is possible in any easy way.

Comment by Guilherme Blanco [ 15/Feb/11 ]

This cannot be done without adding a lot of WTF factor to Doctrine codebase.

For individual docblocks there's a simple way, but it is impossible to make they interchange definitions (like declare namespace on class docblock and take advantage of it on method docblock).

Marking it as can't fix, since our structure cannot support it without a complete rewrite (which would collide with our current interests).





[DCOM-30] Documentation Bug regarding setAnnotationNamespaceAlias Created: 12/Nov/10  Updated: 15/Feb/11  Resolved: 15/Feb/11

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

Type: Bug Priority: Major
Reporter: Timo A. Hummel Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


 Description   

In the documentation on http://www.doctrine-project.org/projects/common/2.0/docs/reference/annotations/en#setup-and-configuration:namespace-aliases I'm given the following example:

$reader->setAnnotationNamespaceAlias('MyCompany\Annotations', 'my');

However, this only works here if I do it that way:

$reader->setAnnotationNamespaceAlias('MyCompany\Annotations\\', 'my');

If the latter one is correct, it should be documented as such.



 Comments   
Comment by Guilherme Blanco [ 15/Feb/11 ]