[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-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-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-27] Method Next from ArrayCollection needs to return something! Created: 11/Oct/10  Updated: 31/Oct/10  Resolved: 31/Oct/10

Status: Resolved
Project: Doctrine Common
Component/s: Collections
Affects Version/s: 2.0.0-RC1
Fix Version/s: 2.0.0-RC2

Type: Bug Priority: Critical
Reporter: Henrique Girardi dos Santos Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

I think this method needs to return something...

/**

  • Moves the internal iterator position to the next element.
    *
  • @return mixed
    */
    public function next() { next($this->_elements); }

doctrine-common/lib/Doctrine/Common/Collections/ArrayCollection.php



 Comments   
Comment by Benjamin Eberlei [ 31/Oct/10 ]

resolved





[DCOM-25] method setAutoloadAnnotationClasses-fails Created: 25/Sep/10  Updated: 31/Oct/10  Resolved: 31/Oct/10

Status: Resolved
Project: Doctrine Common
Component/s: Annotations
Affects Version/s: 2.0.0-RC1
Fix Version/s: 2.0.0-RC2

Type: Bug Priority: Critical
Reporter: Margus Sipria Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

$reader = new Doctrine\Common\Annotations\AnnotationReader();
$reader->setAutoloadAnnotationClasses(true);

above code is trying use default parser's setAutoloadAnnotationClasses-method, which isn't found, instead parser has setAutoloadAnnotations.



 Comments   
Comment by Benjamin Eberlei [ 31/Oct/10 ]

fixed.





[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-31] setAutoloadAnnotationClasses() within AnnotationReader fails Created: 12/Nov/10  Updated: 15/Nov/10  Resolved: 15/Nov/10

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

Type: Bug Priority: Major
Reporter: Timo A. Hummel Assignee: Benjamin Eberlei
Resolution: Duplicate Votes: 0
Labels: None


 Description   

When calling setAutoloadAnnotationClasses() from within AnnotationReader, it fails because setAutoloadAnnotationClasses() is not implemented in Doctrine\Common\Annotations\Parser.

This should be fixed, or at least a FeatureNotImplementedException or such.



 Comments   
Comment by Benjamin Eberlei [ 15/Nov/10 ]

Duplicate of DCOM-25





[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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-3] Public value property in Base annotation class Created: 22/Apr/10  Updated: 14/Jun/10  Resolved: 14/Jun/10

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

Type: Improvement Priority: Major
Reporter: Kirill chEbba Chebunin Assignee: Roman S. Borschel
Resolution: Fixed Votes: 0
Labels: None


 Description   

1) If our annotation doesn't need any parameters, it stll can accept one ('value').
2) We can intercept set and get of annotation properties via __set and __get methods which is not final, but not for 'value'.
Example of interception

class Annotation extends \Doctrine\Common\Annotations\Annotation
{

    private $someProperty;
    
    public function __set($name, $value)
    {
        $setMethod = 'set' . ucfirst($name);
        if (method_exists($this, $setMethod)) {
            return $this->{$setMethod}($value);
        }
        return parent::__set($name, $value);
    }
    
    public function __get($name)
    {
        $getMethod = 'get' . ucfirst($name);
        if (method_exists($this, $getMethod)) {
            return $this->{$getMethod}();
        }
        return parent::__get($name);
    }

    public function getSomeProperty()
    {
        //some logic
        return $this->someProperty;
    }

    protected function setSomeProperty($someProperty)
    {
        //some logic
        $this->someProperty = $someProperty;
    }
}


 Comments   
Comment by Benjamin Eberlei [ 22/Apr/10 ]

Why is this even relevant? can't you just ignore the value property?

Comment by Roman S. Borschel [ 22/Apr/10 ]

I think there is something not clear here. __get and __set on Annotation are not used to set or get values but to intercept calls to non-existant values.
Annotations are populated through their constructors.

Second, you don't need to extend from Annotation (not in HEAD at least). Any class can be used as an annotation as long as it has a constructor that takes an array with values.

Annotation values are set through the constructor, not through setters or public properties. This allows you to even use immutable classes as annotations:

class MyClass {
     private $a, $b;
     public function __construct(array $values) {
          $this->a = $values['a'];
          $this->b = $values['b'];
     }
    //... only getters...
}
/** @MyClass(a="Hello", b="World") */
class Other {
    //...
}

The default "value" will still be in $values['value'] if set. So this should work, too:

class MyClass {
     private $value;
     public function __construct(array $values) {
          $this->value = $values['value'];
     }
    //...
}
/** @MyClass("Hello World") */
class Other {
    //...
}
Comment by Roman S. Borschel [ 22/Apr/10 ]

So my suggestion would be: Just don't extend from Doctrine\Common\Annotations\Annotation and you don't have the public $value property.

Comment by Kirill chEbba Chebunin [ 22/Apr/10 ]

Oh, i got it. It was my miss, because there was subclass checking in previous versions.
Also, is it a good idea not to have some base class or interface for all annotations, may be it will be better to have an interface with a constructor? based on this restriction
"Any class can be used as an annotation as long as it has a constructor that takes an array with values". Of course using constructors in interfaces not really good, but if we have such restriction...
For example

interface SomeCommonAnnotationInterface
{
    public function __construct(array $values);
}




[DCOM-21] Bug with annotations parser and tags that are not annotations (stripped tags) Created: 18/Aug/10  Updated: 18/Aug/10  Resolved: 18/Aug/10

Status: Resolved
Project: Doctrine Common
Component/s: None
Affects Version/s: 2.0.0-BETA4
Fix Version/s: 2.0.0-RC1

Type: Bug Priority: Major
Reporter: Jonathan H. Wage Assignee: Roman S. Borschel
Resolution: Fixed Votes: 0
Labels: None


 Comments   
Comment by Jonathan H. Wage [ 18/Aug/10 ]

Fixed in http://github.com/doctrine/common/commit/df50f65ee707bb148682232c516d5168cf46d987





[DCOM-20] ClassLoader should check before require()... Created: 12/Aug/10  Updated: 12/Aug/10  Resolved: 12/Aug/10

Status: Resolved
Project: Doctrine Common
Component/s: Class Loading
Affects Version/s: 2.0.0-BETA4
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Alexander Trauzzi Assignee: Roman S. Borschel
Resolution: Invalid Votes: 0
Labels: None
Environment:

Ubuntu 10.04



 Description   

I noticed that prior to the require function call in loadClass(), no attempt is made to see if the file can be loaded, or to trap the result of the require attempt.

This means that when I chain together class loaders on the autoload stack, the first one that specifies a namespace of null effectively terminates the process, preventing any others from being run.



 Comments   
Comment by Alexander Trauzzi [ 12/Aug/10 ]

One solution I propose (and have used in my own class loaders in the past) is to check and see if the file exists and/or is accessible prior to the require() or include().
It might be done something like this:


public function loadClass($className)
{
if ($this->namespace !== null && strpos($className, $this->namespace.$this->namespaceSeparator) !== 0)

{ return false; }

if ($this->canLoadClass())

{ require ($this->includePath !== null ? $this->includePath . DIRECTORY_SEPARATOR : '') . str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $className) . $this->fileExtension; return true; }

return false;

}

Another might be to catch any errors thrown by the require statement if possible.

This effectively guarantees that in the event of a failure, the natural PHP mechanism of the class autoloader can follow up or terminate, resulting in a Class Not Found error, rather than a failed include - which might be potentially misleading??

Comment by Alexander Trauzzi [ 12/Aug/10 ]

I should note that it isn't up to ClassLoader to trigger a failure in class loading, otherwise class instantiation requires every call to the "new" keyword to be prefixed by a check to verify the class is available.

ClassLoader should for the most part fail silently with the one exception of notifying the autoload stack with the boolean return value. Any other errors force developers to get into the plumbing and breaks the contract between PHP's class loading behaviour and the autoload stack.

Comment by Roman S. Borschel [ 12/Aug/10 ]

Hi.

This is by design. We consider the default "contract" for autoloaders inferior as checks for file existence are unnecessary and expensive in 99.9% of the classes loaded.

The ClassLoader of the Common project separates the responsibilities for a) checking whether a class can be loaded and b) actually loading the class.

Furthermore, it is by design that each class loader is responsible for classes in a certain namespace. Only 1 classloader can thus be responsible for a single class. If a class loader is asked to load a class, and he is responsible for loading that class, any failure to do so is a fatal error. A missing class that is requested to be loaded is a fatal error. Silently ignoring such cases is a very bad approach from our point of view and it requires slow(er) implementations due to checks for file existence.

If you specify NULL as the namespace, that means this class loader should be responsible for all classes. Thus it is obvious that a class loader that is configured as such can only be used a) as the only one or b) at the end of the autoload stack (as the last one).

This approach to class loading and this implementation is designed for best efficiency.

If you do not like this approach to class loading you are free to use any other implementations, Doctrine classes don't care which autoloader loads them.

ps. return values don't matter at all in autoload functions for PHP, they only matter if you invoke them directly. The SPL autoload stack continues to invoke the next loader until the class is defined/loaded, then it stops, irrespective of what a loader returns. It only matters whether the class definition is now available to PHP.





[DCOM-19] Transitive persistence on collections doesn't work when cascade is set to "all" Created: 10/Aug/10  Updated: 11/Aug/10  Resolved: 11/Aug/10

Status: Resolved
Project: Doctrine Common
Component/s: Collections
Affects Version/s: 2.0.0-BETA4
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: akeem philbert Assignee: Roman S. Borschel
Resolution: Invalid Votes: 0
Labels: None


 Description   

In documentation it says that cascade needs be set to persist for transitive persistence to work (http://www.doctrine-project.org/projects/orm/2.0/docs/reference/working-with-associations/en#transitive-persistence-/-cascade-operations:persistence-by-reachability:-cascade-persist) , but since "all" setting is a superset of "persist" it should work for that setting as well (but it doesn't )



 Comments   
Comment by akeem philbert [ 11/Aug/10 ]

It seems there is an issue with persisting new elements to a collection with existing elements and I've created a separate ticket (http://www.doctrine-project.org/jira/browse/DDC-742) so this one is invalid.





[DCOM-17] Add Collection::slice($offset, $length) Created: 08/Aug/10  Updated: 14/Jan/11  Resolved: 24/Aug/10

Status: Resolved
Project: Doctrine Common
Component/s: Collections
Affects Version/s: 2.0.0-BETA4
Fix Version/s: 2.0.0-RC1

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


 Description   

Since we are still at a point were bc breaks are potentially not so harming:

We need a slice() method on the Collection for forward compatibility, the support for large and very large collections using FETCH_EXTRA would heavily benefit from a method like this.

/**
 * Extract a slice of $length elements starting at position $offset from the Collection.
 * 
 * If $length is null it returns all elements from $offset to the end of the Collection.
 * Keys have to be preserved by this method.
 * 
 * @param int $offset
 * @param int $length
 * @return array
 */
public function slice($offset, $length = null);

The ArrayCollection implement would be:

public function slice($offset, $length = null);
{
    return array_slice($this->_elements, $offset, $length, true); // preserve keys
}


 Comments   
Comment by Benjamin Eberlei [ 08/Aug/10 ]

Updated preserve paragraph

Comment by Benjamin Eberlei [ 24/Aug/10 ]

Implemented

Comment by Jan Pieper [ 14/Jan/11 ]

Is there any reason why slice() returns an array although methods like filter() and map() return an instance of Doctrine\Common\Collections\ArrayCollection?





[DCOM-18] ArrayCollection::removeElement() violates Interface Contract Created: 09/Aug/10  Updated: 09/Aug/10  Resolved: 09/Aug/10

Status: Resolved
Project: Doctrine Common
Component/s: Collections
Affects Version/s: 2.0.0-BETA4
Fix Version/s: 2.0.0-RC1

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


 Description   

It return the element, not true.



 Comments   
Comment by Benjamin Eberlei [ 09/Aug/10 ]

Fixed





[DCOM-13] Better flexibility when the Annotation is created by the Parser Created: 24/Jul/10  Updated: 02/Aug/10  Resolved: 02/Aug/10

Status: Resolved
Project: Doctrine Common
Component/s: Annotations
Affects Version/s: None
Fix Version/s: 2.0.0-BETA4

Type: Improvement Priority: Major
Reporter: Fabien Potencier Assignee: Roman S. Borschel
Resolution: Fixed Votes: 0
Labels: None

Attachments: File patch    

 Description   

The creation of the Annotation class is done at the end in Parser::Annotation(). It assumes that the Annotation class constructor takes an array of values. But if this is not the case, you are out of luck. So, I propose to move the logic of Annotation creation to is own method for better flexibility.



 Comments   
Comment by Jonathan H. Wage [ 31/Jul/10 ]

What is the reason your annotation class can't have a single argument array constructor?

Comment by Jonathan H. Wage [ 31/Jul/10 ]

Currently it is by design that Annotation classes take a single argument array constructor and the Reader and Parser are not designed for inheritance.

Comment by Fabien Potencier [ 01/Aug/10 ]

To sum up:

  • You force me to design my Annotation class is a certain way (for no obvious reason);
  • You don't want the Parser and Reader to be extensible.

So, basically, you say that the Doctrine Annotation library is not designed to be used outside Doctrine? That's fine, but then I will need to create my own Annotation component, which makes me sad.

Comment by Roman S. Borschel [ 01/Aug/10 ]

@"You force me to design my Annotation class is a certain way (for no obvious reason)"

It is a contract of the implementation, nothing more, nothing less. An annotation class must have a single argument array constructor. Would you feel better if there were an interface with such a constructor? Any contract always "forces" you to design your class that implements that contract in a certain way.

@"You don't want the Parser and Reader to be extensible."

They simply are not designed to be inherited right now which simply means we don't care about backwards compatibility with regards to subclasses when changing these classes and we're not documenting and telling people it is a good idea to subclass them. And frankly, inhertiance just to swap out the annotation construction process is a bad idea. It reveals & couples the subclasses to all the details of the parent class even though all they actually want is exchange the construction process. Moreover you would right now need to extend both, the parser and and reader to swap out the construction process. At least the parser would then need to become an (optional) constructor argument of a reader in order not to need to subclass the reader. Inheritance => strong coupling => hard to maintain backwards compatibility.

If there is strong desire to replace the annotation construction process, a factory (method/closure) approach would be much better.
Can you maybe reveal your concrete use-case? That an annotation class must have a single-argument array constructor is not an unreasonable requirement and you're really exaggerating if you're saying that this simple requirement makes the annotation library unusable outside of Doctrine. That is ridiculous. The Symfony Validator component already uses it.

Please try to be more constructive. Neither did you show concrete use-cases nor is your suggested solution a good idea as it is now because it requires 2 classes to be extended plus 1 constructor and 1 method to be overridden just to exchange the annotation construction process. This can surely be done simpler and will be done simpler if there is enough need for this enhancement.

Comment by Jonathan H. Wage [ 02/Aug/10 ]

This was fixed in http://github.com/doctrine/common/commit/66dad3e22205d812911adeb32b9f8bab8879d4b7





[DCOM-12] Annotation caching causes application instance mixups Created: 13/Jul/10  Updated: 13/Jul/10  Resolved: 13/Jul/10

Status: Resolved
Project: Doctrine Common
Component/s: Annotations
Affects Version/s: 2.0.0-BETA2, 2.0.0-BETA3, 2.0.0-BETA4
Fix Version/s: None

Type: Bug Priority: Major
Reporter: John Kleijn Assignee: Roman S. Borschel
Resolution: Invalid Votes: 0
Labels: None


 Description   

Take a look at lib/Doctrine/Common/Annotations/AnnotationReader.php:137

 
    /**
     * Gets the annotations applied to a class.
     * 
     * @param string|ReflectionClass $class The name or ReflectionClass of the class from which
     * the class annotations should be read.
     * @return array An array of Annotations.
     */
    public function getClassAnnotations(ReflectionClass $class)
    {
        $cacheKey = $class->getName() . self::$CACHE_SALT;

        // Attempt to grab data from cache
        if (($data = $this->cache->fetch($cacheKey)) !== false) {
            return $data;
        }
        
        $annotations = $this->parser->parse($class->getDocComment(), 'class ' . $class->getName());
        $this->cache->save($cacheKey, $annotations, null);
        
        return $annotations;
    }

It uses the class name and a static salt to create a cache key. Actually, everything in that class uses a class name to assemble a cache key.

This makes it impossible to have mulitple instances of the same application in different states. Practically: it makes it impossible to have testing and staging, or staging and production versions on the same host if they use the same type of caching (which you sort of need in a staging environment).



 Comments   
Comment by John Kleijn [ 13/Jul/10 ]

Confused "fix" with "affects", sorry

Comment by Roman S. Borschel [ 13/Jul/10 ]

Why not just use the namespacing facilities of the cache drivers?

Comment by John Kleijn [ 13/Jul/10 ]

Cause I didn't read the caching docs?





[DCOM-6] Non existant namespace alias throws a PHP Notice Created: 27/May/10  Updated: 01/Sep/10  Resolved: 01/Sep/10

Status: Resolved
Project: Doctrine Common
Component/s: None
Affects Version/s: 2.0.0-BETA2
Fix Version/s: 2.0.0-RC1

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


 Description   

@nonalias:Annot results in a php notice.



 Comments   
Comment by Tim Nagel [ 27/May/10 ]

Proposed tests and fix

http://github.com/merk/common/commit/65e8c10b74201c39dbe291c36230205d9b08ed65

Comment by Guilherme Blanco [ 31/Aug/10 ]

In commit: http://github.com/doctrine/common/commit/ad49a676269af368563bd9a848c904b81a825622

I fixed this issue.
The validation on unexistent classes cannot be done correctly, otherwise it'd conflict with phpDoc tags.

Comment by Tim Nagel [ 31/Aug/10 ]

What will your change do if there are multiple implementations of the Reader working on entities that dont have common namespaces, but still use namespaces?

Would it not make more sense to skip something that the Reader doesnt understand, rather than throwing an error?

(For example, Symfony2's validator system might have namespaced validators, which would then cause the 'Doctrine' reader to throw an exception)

Comment by Guilherme Blanco [ 01/Sep/10 ]

Yes, you're right...

I think we'll have to silently bypass unknown aliases... this makes debug harder, but we don't have any other option. =(

Reopening it

Comment by Benjamin Eberlei [ 01/Sep/10 ]

Fixed to skip the unknown alias annotation.





[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-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-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-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-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-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-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-123] [GH-202] Add sqlite cache driver Created: 08/Oct/12  Updated: 23/May/13  Resolved: 23/May/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: Incomplete 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:



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

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





[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-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-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-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-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-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-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-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-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-15] ClassLoader does not autoload when namespace starts with \ Created: 03/Aug/10  Updated: 01/Sep/10  Resolved: 01/Sep/10

Status: Resolved
Project: Doctrine Common
Component/s: Class Loading
Affects Version/s: 2.0.0-BETA2
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: Bas K Assignee: Roman S. Borschel
Resolution: Won't Fix Votes: 0
Labels: None
Environment:

osx, php5.3.2



 Description   

Instantiating a fully qualified namespace (with a prefixed ) will not autoload modules, even while the canLoadClass reports it can and loadClass will load it...

Will NOT work
$classLoader = new \Doctrine\Common\ClassLoader('\Application\Models', '/some/path');
$classLoader->register();
new \Application\Models\SomeClass();

Will work
$classLoader = new \Doctrine\Common\ClassLoader('Application\Models', '/some/path');
$classLoader->register();
new \Application\Models\SomeClass();

Some sanitization or an exception on this would improve things a bit.



 Comments   
Comment by Roman S. Borschel [ 01/Sep/10 ]

I think this is a non-issue. You need to consider that the first argument is simply a namespace prefix that is checked against and PHP itself never passes class names with leading backslashes to an autoload function. Thus it is relatively obvious that a leading backslash in a namespace prefix for a ClassLoader makes no sense.

ps. Leading backslashes in strings in general are unnecessary, as namespaces in strings are always treated as "absolute" and never "relative". That might also be the reason why PHP itself passes class names to autoload functions without a leading backslash.





[DCOM-11] Impossible to skip annotations Created: 08/Jul/10  Updated: 02/Aug/10  Resolved: 02/Aug/10

Status: Resolved
Project: Doctrine Common
Component/s: Annotations
Affects Version/s: 2.0.0-BETA4
Fix Version/s: 2.0.0-BETA4

Type: Bug Priority: Minor
Reporter: Brandon Turner Assignee: Jonathan H. Wage
Resolution: Fixed Votes: 0
Labels: None

Attachments: Text File 0001-Always-look-for-Annotation-class.patch    

 Description   

It is currently impossible to skip annotations of the form:
@annotation(

When a doc block comment begins with an "@" and has an open parenthesis it is assumed to be an exist annotation even if the corresponding annotation class doesn't exist or can't be autoloaded. If you are trying to use the AnnotationReader on a file, you have to make sure all annotations are loaded or can be autoloaded - even the ones you don't care about

In a comment to DCOM-2, Roman stated that his recommended way to load annotations is to load them manually via a require call. This is done in Doctrine ORM and is absolutely necessary because ORM annotations are stored in an autoloader unfriendly way (multiple classes per file and namespace path different from filesystem path).

So, if I want to add my own annotations and store them in a non-autoloader friendly way as Doctrine ORM does, I need to ensure that every AnnotationReader acting on that file knows about my annotations. This is not always possible or desirable.

Removing the parenthesis check and relying solely on class_exists fixes this problem.



 Comments   
Comment by Tim Nagel [ 15/Jul/10 ]

I have come across another case where this bug causes a fatal PHP Error when you nest a non existant annotation:

/**

  • @Name
  • @NonExistant(
  • @InnerNonexistant(32)
  • )
    */

PHP Fatal error: Doctrine\Common\ClassLoader::loadClass(): Failed opening required 'Doctrine/Tests/Common/Annotations/InnerNonexistant.php'

Test case and fix provided in github: http://github.com/merk/common/commit/95388a5febee95dc0483cf35d991b2b227e89069

Comment by Jonathan H. Wage [ 16/Jul/10 ]

Roman, what are your thoughts on this issue? It has been a problem for us with the Symfony integration.

Comment by Jonathan H. Wage [ 31/Jul/10 ]

Brandon, can you help me understand better? In your case why is the class not present and why can it not be autoloaded?

Comment by Roman S. Borschel [ 31/Jul/10 ]

@"Removing the parenthesis check and relying solely on class_exists fixes this problem."

The main problem with such an approach is that an AnnotationReader works (and caches) under the assumption that all annotations of a doc-block are processed at once. That means the "undefined" annotations would never be visible and not accessible if a cache is used unless the cache is cleared and the annotations requested again, this time with all annotations defined.

Comment by Brandon Turner [ 31/Jul/10 ]

Let's say I'm writing an extension that supports annotations. I want my extension to work on the same entity classes that Doctrine ORM uses. It is not possible to hook in to the ORM to read my annotations (http://groups.google.com/group/doctrine-dev/browse_thread/thread/4d478a32f8a12a57/c3fce8707becce5c?lnk=gst&q=brandon#c3fce8707becce5c) so I will need to do it with my own code. That is fine, but I've got three problems:

1) When I process my annotations, I have to make sure I load all the annotation classes needed by Doctrine ORM. This is simple and easy.

2) When Doctrine ORM trys to process entities with my custom annotations, it needs to be able to load my extension's annotation classes. How does it know about them (if not autoloading)

3) What happens if someone else writes an extension that uses custom annotations. And say a user wants a single entity to implement my extension, another extension, and of course Doctrine ORM. Now all three need to know about each other.

Now we could make all classes able to be autoloaded and that may fix the problem, but Roman recommends against that here: http://www.doctrine-project.org/jira/browse/DCOM-2?focusedCommentId=13070&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_13070

So in summary, the annotation class would be present when I process the entity, but not when Doctrine ORM does.

Comment by Roman S. Borschel [ 01/Aug/10 ]

After some discussion, the current consensus is that we will apply the suggested change and clearly document how caching works with an AnnotationReader.

Comment by Jonathan H. Wage [ 02/Aug/10 ]

Fixed in http://github.com/doctrine/common/commit/5c90f7b513579bf14603621564db6b4da3fd5665

Commit updating the documentation is coming today.

Comment by Jonathan H. Wage [ 02/Aug/10 ]

Added docs for annotations here: http://github.com/doctrine/common-documentation/commit/896cc3bace84b6dc891a3d050a425fc99249359e





[DCOM-26] Notice when using an alias that is not registered Created: 02/Oct/10  Updated: 01/Nov/10  Resolved: 01/Nov/10

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

Type: Bug Priority: Trivial
Reporter: Fabien Potencier Assignee: Roman S. Borschel
Resolution: Fixed Votes: 0
Labels: None


 Description   

If you have an annotation that uses an alias that is not registered like:

  /**
   * @foo:SomeAnnot
   */
  ...

Then, the Parser will throw a PHP Notice:

Notice: Undefined index: foo in .../lib/Doctrine/Common/Annotations/Parser.php line 317



 Comments   
Comment by Fabien Potencier [ 04/Oct/10 ]

When a "normal" annotation is not found, Doctrine just ignore it:

/**
 * @Entityyyy
 */

So, the behavior should be the same when an alias does not exist.

Here is a simple patch that fixes the issue:

diff --git a/lib/Doctrine/Common/Annotations/Parser.php b/lib/Doctrine/Common/Annotations/Parser.php
index 3af7841..00df32b 100644
--- a/lib/Doctrine/Common/Annotations/Parser.php
+++ b/lib/Doctrine/Common/Annotations/Parser.php
@@ -315,6 +315,10 @@ class Parser
         // Effectively pick the name of the class (append default NS if none, grab from NS alias, etc)
         if (strpos($nameParts[0], ':')) {
             list ($alias, $nameParts[0]) = explode(':', $nameParts[0]);
+            if (!isset($this->namespaceAliases[$alias])) {
+                $this->lexer->skipUntil(Lexer::T_AT);
+                return false;
+            }
             $name = $this->namespaceAliases[$alias] . implode('\\', $nameParts);
         } else if (count($nameParts) == 1) {
             $name = $this->defaultAnnotationNamespace . $nameParts[0];
Comment by Benjamin Eberlei [ 31/Oct/10 ]

Which version of Common is that? I think this is already fixed in Common RC1.





[DCOM-23] Add interface for ObjectManager Created: 26/Aug/10  Updated: 31/Oct/10  Resolved: 31/Oct/10

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

Type: Improvement Priority: Trivial
Reporter: Henrik Bjornskov Assignee: Roman S. Borschel
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates DCOM-28 Extract Common Persistance Interfaces Open

 Description   

Add a ObjectManager interface so it is possible to write code that supports the EntityManager and DocumentManager at the same time.

Ornicar (Thibault Duplessis) did this gist: http://gist.github.com/545320



 Comments   
Comment by Benjamin Eberlei [ 31/Oct/10 ]

Mark as duplicate for DCOM-28





[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-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.





Generated at Fri May 24 04:40:16 UTC 2013 using JIRA 5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5.