Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid tag_line detected: @param string $idx #461

Closed
olivierpons opened this issue May 15, 2012 · 29 comments
Closed

Invalid tag_line detected: @param string $idx #461

olivierpons opened this issue May 15, 2012 · 29 comments
Labels
Milestone

Comments

@olivierpons
Copy link

Hi,

This is a very simple to reproduce bug: just create a DocBlock with a parameter and an accentued char at the end (here it's the "à":

/** 
 * Short comment.
 *
 * @param string  $idx Index de la valeur à
 *   some other text
 *
 * @return void
 */

Try to compile, you get an error:

2012-05-15T11:39:48+02:00 CRIT (2): Invalid tag_line detected: @param string  $idx Index de la valeur à

Now just move the "à" to the next line (= no "spécial char" in the param line):

/** 
 * Short comment.
 *
 * @param string  $idx Index de la valeur
 *   à some other text
 *
 * @return void
 */

You'll get no error!

@mvriel
Copy link
Member

mvriel commented Jun 4, 2012

This is probably fixed in 2.0.0a4 but we have to test this specific case to be certain

@olivierpons
Copy link
Author

It seems, to talk globally, that the utf-8 is not properly handled (at least in comments). Solving this issue may solve a lot of other ones I've encountered.

@mvriel
Copy link
Member

mvriel commented Jun 6, 2012

During investigation this seemed to be caused by a regex in the system though I cannot rule out that the à is improperly converted because the system erroneously interpreted your file being another encoding.
Research continues (we want to replace the current 'magical' system of encoding transformations by a simpler system where UTF-8 is assumed and otherwise you can indicate which encoding the file is in; the detection process has proved unreliable)

@olivierpons
Copy link
Author

I'd like to test is in 2.0.0a4 but when I launch full re-install to get latest release through

sudo pear install --alldeps -f phpdoc/phpDocumentor-alpha

I can't launch it at all:

olivier@olivier-ubuntu ~/Documents/dev # phpdoc --help
PHP Fatal error:  Cannot redeclare class phpDocumentor\Plugin\Core\Listener in /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Core/Listener.php on line 194

Fatal error: Cannot redeclare class phpDocumentor\Plugin\Core\Listener in /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Core/Listener.php on line 194
olivier@olivier-ubuntu ~/Documents/dev # 

@mvriel
Copy link
Member

mvriel commented Jun 7, 2012

Is it possible that you have your own plugin that extends phpDocumentor_Plugin_Core_Listener?
We have changed the class name to \phpDocumentor\Plugin\Core\Listener and if the old name is used then this may cause these kind of error messages due to collisions

@mvriel
Copy link
Member

mvriel commented Jun 7, 2012

I have tried to reproduce it with 2.0.0a5 and when I use pear to install it I do not see these error. I assume it is caused by an old name lingering

@olivierpons
Copy link
Author

I'm sorry this may be out of topic, but here's what I do:

olivier@olivier-ubuntu ~/dev # sudo pear uninstall phpdoc/phpDocumentor-alpha
uninstall ok: channel://pear.phpdoc.org/phpDocumentor-2.0.0a6
olivier@olivier-ubuntu ~/dev # phpdoc --help
bash: /usr/bin/phpdoc: Aucun fichier ou dossier de ce type
olivier@olivier-ubuntu ~/dev # sudo pear install --alldeps -f phpdoc/phpDocumentor-alpha
downloading phpDocumentor-2.0.0a6.tgz ...
Starting to download phpDocumentor-2.0.0a6.tgz (1,107,853 bytes)
................................................done: 1,107,853 bytes
install ok: channel://pear.phpdoc.org/phpDocumentor-2.0.0a6
olivier@olivier-ubuntu ~/dev # phpdoc --help
PHP Fatal error:  Cannot redeclare class phpDocumentor\Plugin\Core\Listener in /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Core/Listener.php on line 194

Fatal error: Cannot redeclare class phpDocumentor\Plugin\Core\Listener in /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Core/Listener.php on line 194
olivier@olivier-ubuntu ~/dev # locate phpDocumentor | grep Listener
/usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/ListenerAbstract.php
/usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Core/Listener.php
olivier@olivier-ubuntu ~/dev # echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/rv/Bin
olivier@olivier-ubuntu ~/dev #```

@olivierpons
Copy link
Author

I can make an ugly workaround and add the code in the source file:

if ( !class_exists('phpDocumentor\Plugin\Core\Listener') ) {..}

But that's not a good solution.

@mvriel
Copy link
Member

mvriel commented Jun 25, 2012

I can't see any weird things in your locate nor your path. Can you delete the vendor directory from phpDocumentor, download composer.phar from http://getcomposer.org/composer.phar and run php composer.phar install from your phpDocumentor directory? perhaps something is going wrong with the classmap that is provided?

mvriel added a commit that referenced this issue Jun 25, 2012
…throw an error instead of crashing the application
@mvriel
Copy link
Member

mvriel commented Jun 25, 2012

@olivierpons concerning your original bug report: I have made a change that this issue will not cause phpDocumentor to crash but to throw an error and ignore that specific DocBlock

@olivierpons
Copy link
Author

Hi,

Unfortunately I still can't test phpDocumentor...
Here's how I tried, following you suggestion, and the error that showed up:

olivier@olivier-ubuntu /usr/share/php/data # php --version
PHP 5.3.2-1ubuntu4.17 with Suhosin-Patch (cli) (built: Jun 19 2012 03:21:35) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
olivier@olivier-ubuntu /usr/share/php/data # sudo pear uninstall phpdoc/phpDocumentor-alpha
uninstall ok: channel://pear.phpdoc.org/phpDocumentor-2.0.0a6
olivier@olivier-ubuntu /usr/share/php/data # l
total 20
drwxr-xr-x 2 root root 4096 2012-06-20 19:40 PEAR
drwxr-xr-x 2 root root 4096 2012-04-17 12:16 PHP_CodeSniffer
drwxr-xr-x 3 root root 4096 2012-06-06 17:08 PHP_CompatInfo
drwxr-xr-x 2 root root 4096 2012-06-06 17:08 Var_Dump
drwxr-xr-x 3 root root 4096 2012-06-06 17:08 XML_Serializer
olivier@olivier-ubuntu /usr/share/php/data # sudo pear install --alldeps phpdoc/phpDocumentor-alpha
downloading phpDocumentor-2.0.0a6.tgz ...
Starting to download phpDocumentor-2.0.0a6.tgz (1,107,853 bytes)
............................................................................................................................................................................................................................done: 1,107,853 bytes
install ok: channel://pear.phpdoc.org/phpDocumentor-2.0.0a6
olivier@olivier-ubuntu /usr/share/php/data # l
total 24
drwxr-xr-x 2 root root 4096 2012-06-20 19:40 PEAR
drwxr-xr-x 2 root root 4096 2012-04-17 12:16 PHP_CodeSniffer
drwxr-xr-x 3 root root 4096 2012-06-06 17:08 PHP_CompatInfo
drwxr-xr-x 3 root root 4096 2012-06-27 09:45 phpDocumentor
drwxr-xr-x 2 root root 4096 2012-06-06 17:08 Var_Dump
drwxr-xr-x 3 root root 4096 2012-06-06 17:08 XML_Serializer
olivier@olivier-ubuntu /usr/share/php/data # cd phpDocumentor/
olivier@olivier-ubuntu /usr/share/php/data/phpDocumentor # sudo mv /home/Olivier/Downloads/composer.phar .
olivier@olivier-ubuntu /usr/share/php/data/phpDocumentor # sudo php composer.phar install
PHP Fatal error:  Class '\phpDocumentor\Composer\UnifiedAssetInstaller' not found in phar:///usr/share/php/data/phpDocumentor/composer.phar/src/Composer/Installer/InstallerInstaller.php on line 102

Fatal error: Class '\phpDocumentor\Composer\UnifiedAssetInstaller' not found in phar:///usr/share/php/data/phpDocumentor/composer.phar/src/Composer/Installer/InstallerInstaller.php on line 102
olivier@olivier-ubuntu /usr/share/php/data/phpDocumentor # sudo updatedb && locate composer.json
/usr/share/php/data/phpDocumentor/composer.json
/usr/share/php/data/phpDocumentor/vendor/cilex/cilex/composer.json
/usr/share/php/data/phpDocumentor/vendor/dflydev/markdown/composer.json
/usr/share/php/data/phpDocumentor/vendor/nikic/php-parser/composer.json
/usr/share/php/data/phpDocumentor/vendor/phpdocumentor/fileset/composer.json
/usr/share/php/data/phpDocumentor/vendor/phpdocumentor/graphviz/composer.json
/usr/share/php/data/phpDocumentor/vendor/phpdocumentor/reflection-docblock/composer.json
/usr/share/php/data/phpDocumentor/vendor/phpdocumentor/unified-asset-installer/composer.json
/usr/share/php/data/phpDocumentor/vendor/pimple/pimple/composer.json
/usr/share/php/data/phpDocumentor/vendor/symfony/class-loader/Symfony/Component/ClassLoader/composer.json
/usr/share/php/data/phpDocumentor/vendor/symfony/console/Symfony/Component/Console/composer.json
/usr/share/php/data/phpDocumentor/vendor/symfony/finder/Symfony/Component/Finder/composer.json
/usr/share/php/data/phpDocumentor/vendor/symfony/process/Symfony/Component/Process/composer.json
/usr/share/php/phpDocumentor/data/templates/abstract/composer.json
/usr/share/php/phpDocumentor/data/templates/new-black/composer.json
/usr/share/php/phpDocumentor/data/templates/responsive/composer.json
olivier@olivier-ubuntu /usr/share/php/data/phpDocumentor #

@mvriel
Copy link
Member

mvriel commented Jun 29, 2012

Hmm... the latter appears to be an issue that it would want to use the UnifiedAssetInstaller to remove templates.
And it can't find it anymore.

I must admit; I am utterly flabbergasted at why you keep getting this error and it disturbs me that you are experiencing it.

Can you reinstall the application from scratch, run it and when you experience another crash note the file and line number and add the following code on the line before that:

print_r(get_declared_classes());

(See http://www.php.net/manual/en/function.get-declared-classes.php for an explanation what that does)

The latest print_r should determine which classes are indeed loaded; I hope to find an oddity here, a clue as to what causes this.

Thank you for your patience

@mvriel
Copy link
Member

mvriel commented Jun 30, 2012

I may have found the issue.

phpDocumentor used to have classes that did not conform to PSR-0. So in the composer.json I had added the root directory to both a classmap directive and the PSR-0 directive to generate autoload files.
This may cause conflicts in certain situation; such as your self.
In a moment I am going to commit a fix on the develop branch which I believe will fix this issue

mvriel added a commit that referenced this issue Jun 30, 2012
phpDocumentor used to have classes that did not conform to PSR-0.
So in the composer.json I had added the root directory to both a
classmap directive and the PSR-0 directive to generate autoload
files. This may cause conflicts in certain situation.

To be able to remove the classmap I also had to fix a few PSR-0
inconsistencies that caused classes not to be found.
@olivierpons
Copy link
Author

Thank you I'll try ASAP when

sudo pear install --alldeps phpdoc/phpDocumentor-alpha

will install version upper than phpDocumentor-2.0.0a6.tgz

@mvriel
Copy link
Member

mvriel commented Jul 4, 2012

I released a new version yesterday so you should be able to test now

@olivierpons
Copy link
Author

olivier@olivier-ubuntu ~ # sudo pear uninstall phpdoc/phpDocumentor-alpha
phpdoc/phpDocumentor not installed
olivier@olivier-ubuntu ~ # phpdoc
bash: /usr/bin/phpdoc: Aucun fichier ou dossier de ce type
olivier@olivier-ubuntu ~ # sudo pear install --alldeps phpdoc/phpDocumentor-alpha
[sudo] password for olivier: 
downloading phpDocumentor-2.0.0a7.tgz ...
Starting to download phpDocumentor-2.0.0a7.tgz (1,273,195 bytes)
......................done: 1,273,195 bytes
install ok: channel://pear.phpdoc.org/phpDocumentor-2.0.0a7
olivier@olivier-ubuntu ~ # phpdocs
phpdocs : commande introuvable
olivier@olivier-ubuntu ~ # phpdoc
PHP Fatal error:  Cannot redeclare class phpDocumentor\Plugin\Core\Listener in /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Core/Listener.php on line 194

Fatal error: Cannot redeclare class phpDocumentor\Plugin\Core\Listener in /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Core/Listener.php on line 194
olivier@olivier-ubuntu ~ # 

@olivierpons
Copy link
Author

I've put in the problematic file

print_r(get_declared_classes());

So now it gives:

Array
(
    [0] => stdClass
    [1] => Exception
    [2] => ErrorException
    [3] => Closure
    [4] => DateTime
    [5] => DateTimeZone
    [6] => DateInterval
    [7] => DatePeriod
    [8] => LibXMLError
    [9] => DOMException
    [10] => DOMStringList
    [11] => DOMNameList
    [12] => DOMImplementationList
    [13] => DOMImplementationSource
    [14] => DOMImplementation
    [15] => DOMNode
    [16] => DOMNameSpaceNode
    [17] => DOMDocumentFragment
    [18] => DOMDocument
    [19] => DOMNodeList
    [20] => DOMNamedNodeMap
    [21] => DOMCharacterData
    [22] => DOMAttr
    [23] => DOMElement
    [24] => DOMText
    [25] => DOMComment
    [26] => DOMTypeinfo
    [27] => DOMUserDataHandler
    [28] => DOMDomError
    [29] => DOMErrorHandler
    [30] => DOMLocator
    [31] => DOMConfiguration
    [32] => DOMCdataSection
    [33] => DOMDocumentType
    [34] => DOMNotation
    [35] => DOMEntity
    [36] => DOMEntityReference
    [37] => DOMProcessingInstruction
    [38] => DOMStringExtend
    [39] => DOMXPath
    [40] => finfo
    [41] => LogicException
    [42] => BadFunctionCallException
    [43] => BadMethodCallException
    [44] => DomainException
    [45] => InvalidArgumentException
    [46] => LengthException
    [47] => OutOfRangeException
    [48] => RuntimeException
    [49] => OutOfBoundsException
    [50] => OverflowException
    [51] => RangeException
    [52] => UnderflowException
    [53] => UnexpectedValueException
    [54] => RecursiveIteratorIterator
    [55] => IteratorIterator
    [56] => FilterIterator
    [57] => RecursiveFilterIterator
    [58] => ParentIterator
    [59] => LimitIterator
    [60] => CachingIterator
    [61] => RecursiveCachingIterator
    [62] => NoRewindIterator
    [63] => AppendIterator
    [64] => InfiniteIterator
    [65] => RegexIterator
    [66] => RecursiveRegexIterator
    [67] => EmptyIterator
    [68] => RecursiveTreeIterator
    [69] => ArrayObject
    [70] => ArrayIterator
    [71] => RecursiveArrayIterator
    [72] => SplFileInfo
    [73] => DirectoryIterator
    [74] => FilesystemIterator
    [75] => RecursiveDirectoryIterator
    [76] => GlobIterator
    [77] => SplFileObject
    [78] => SplTempFileObject
    [79] => SplDoublyLinkedList
    [80] => SplQueue
    [81] => SplStack
    [82] => SplHeap
    [83] => SplMinHeap
    [84] => SplMaxHeap
    [85] => SplPriorityQueue
    [86] => SplFixedArray
    [87] => SplObjectStorage
    [88] => MultipleIterator
    [89] => __PHP_Incomplete_Class
    [90] => php_user_filter
    [91] => Directory
    [92] => ReflectionException
    [93] => Reflection
    [94] => ReflectionFunctionAbstract
    [95] => ReflectionFunction
    [96] => ReflectionParameter
    [97] => ReflectionMethod
    [98] => ReflectionClass
    [99] => ReflectionObject
    [100] => ReflectionProperty
    [101] => ReflectionExtension
    [102] => PharException
    [103] => Phar
    [104] => PharData
    [105] => PharFileInfo
    [106] => SimpleXMLElement
    [107] => SimpleXMLIterator
    [108] => SoapClient
    [109] => SoapVar
    [110] => SoapServer
    [111] => SoapFault
    [112] => SoapParam
    [113] => SoapHeader
    [114] => XMLReader
    [115] => XMLWriter
    [116] => ZipArchive
    [117] => Collator
    [118] => NumberFormatter
    [119] => Normalizer
    [120] => Locale
    [121] => MessageFormatter
    [122] => IntlDateFormatter
    [123] => ResourceBundle
    [124] => mysqli_sql_exception
    [125] => mysqli_driver
    [126] => mysqli
    [127] => mysqli_warning
    [128] => mysqli_result
    [129] => mysqli_stmt
    [130] => PDOException
    [131] => PDO
    [132] => PDOStatement
    [133] => PDORow
    [134] => SQLiteDatabase
    [135] => SQLiteResult
    [136] => SQLiteUnbuffered
    [137] => SQLiteException
    [138] => SQLite3
    [139] => SQLite3Stmt
    [140] => SQLite3Result
    [141] => tidy
    [142] => tidyNode
    [143] => XSLTProcessor
    [144] => Composer\Autoload\ClassLoader
    [145] => Pimple
    [146] => Cilex\Application
    [147] => phpDocumentor\Application
    [148] => Cilex\Provider\MonologServiceProvider
    [149] => phpDocumentor\Reflection\ReflectionAbstract
    [150] => phpDocumentor\Parser\ParserAbstract
    [151] => phpDocumentor\Transformer\TransformerAbstract
    [152] => sfEventDispatcher
    [153] => sfEvent
    [154] => phpDocumentor\Plugin\Manager
    [155] => Zend\Config\Factory
    [156] => Zend\Stdlib\ArrayUtils
    [157] => Zend\Config\Reader\Xml
    [158] => Zend\Config\Config
    [159] => phpDocumentor\Plugin\PluginAbstract
    [160] => phpDocumentor\Plugin\Plugin
)

Fatal error: Cannot redeclare class phpDocumentor\Plugin\Core\Listener in /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Core/Listener.php on line 195

If I throw and exception before declaring the class I get:

PHP Fatal error:  Uncaught exception 'phpDocumentor\Plugin\Core\Exception' with message 'ERROR TEST' in /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Core/Listener.php:29
Stack trace:
#0 /usr/share/php/phpDocumentor/vendor/composer/ClassLoader.php(150): require()
#1 [internal function]: Composer\Autoload\ClassLoader->loadClass('\phpDocumentor\...')
#2 /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Plugin.php(104): spl_autoload_call('\phpDocumentor\...')
#3 /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Manager.php(91): phpDocumentor\Plugin\Plugin->load('Core', Object(Composer\Autoload\ClassLoader))
#4 /usr/share/php/phpDocumentor/src/phpDocumentor/Application.php(158): phpDocumentor\Plugin\Manager->loadFromConfiguration()
#5 /usr/share/php/phpDocumentor/src/phpDocumentor/Application.php(43): phpDocumentor\Application->loadPlugins()
#6 /usr/bin/phpdoc(27): phpDocumentor\Application->__construct()
#7 {main}

Next exception 'phpDocumentor\Plugin\Core\Exception' with message 'ERROR TEST' in /usr/share/php/php in /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Core/Listener.php on line 29

I hope this helps

@dtoro
Copy link

dtoro commented Jul 5, 2012

I am getting same error
"Fatal error: Cannot redeclare class phpDocumentor\Plugin\Core\Listener in /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Core/Listener.php on line 194"
using:
sudo pear install --alldeps phpdoc/phpDocumentor-alpha
just like the user above.

@mvriel
Copy link
Member

mvriel commented Jul 7, 2012

Hmm.. what I find interesting is that both of you have this error with the Listener. I am going to focus on that and hope that yields something.
This must be a tiny bug given the amount of time I have spend finding it (tiny bugs cost the most time ;)

@mvriel
Copy link
Member

mvriel commented Jul 7, 2012

Another angle (I wish I could reproduce this so I could test locally :( )

Can you change the following function in /vendor/composer/ClassLoader.php

    /**
     * Loads the given class or interface.
     *
     * @param  string    $class The name of the class
     * @return bool|null True, if loaded
     */
    public function loadClass($class)
    {
        if ($file = $this->findFile($class)) {
            include $file;

            return true;
        }
    }

to


    /**
     * Loads the given class or interface.
     *
     * @param  string    $class The name of the class
     * @return bool|null True, if loaded
     */
    public function loadClass($class)
    {
        if ($file = $this->findFile($class)) {
            var_dump($class.': '.$file);
            include $file;

            return true;
        }
    }

This should yield a listing of all classes that are coming through the autoloader with their associated filename. What I hope to see is 2 variations of a $class with the same $filename; this should be the error.

@olivierpons
Copy link
Author

# sudo pear uninstall phpdoc/phpDocumentor-alpha
uninstall ok: channel://pear.phpdoc.org/phpDocumentor-2.0.0a7
# sudo updatedb
# phpdoc
phpdoc : commande introuvable
# sudo pear install --alldeps phpdoc/phpDocumentor-alpha
downloading phpDocumentor-2.0.0a7.tgz ...
Starting to download phpDocumentor-2.0.0a7.tgz (1,273,195 bytes)
........done: 1,273,195 bytes
install ok: channel://pear.phpdoc.org/phpDocumentor-2.0.0a7
# sudo updatedb
# phpdoc
PHP Fatal error:  Cannot redeclare class phpDocumentor\Plugin\Core\Listener in /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Core/Listener.php on line 194

Fatal error: Cannot redeclare class phpDocumentor\Plugin\Core\Listener in /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Core/Listener.php on line 194
# locate ClassLoader.php
/usr/share/php/phpDocumentor/vendor/composer/ClassLoader.php
/usr/share/php/phpDocumentor/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ApcClassLoader.php
/usr/share/php/phpDocumentor/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php
/usr/share/php/phpDocumentor/vendor/symfony/class-loader/Symfony/Component/ClassLoader/ClassLoader.php
/usr/share/php/phpDocumentor/vendor/symfony/class-loader/Symfony/Component/ClassLoader/DebugClassLoader.php
/usr/share/php/phpDocumentor/vendor/symfony/class-loader/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php
/usr/share/php/phpDocumentor/vendor/symfony/class-loader/Symfony/Component/ClassLoader/MapClassLoader.php
/usr/share/php/phpDocumentor/vendor/symfony/class-loader/Symfony/Component/ClassLoader/UniversalClassLoader.php
/usr/share/php/phpDocumentor/vendor/symfony/class-loader/Symfony/Component/ClassLoader/XcacheClassLoader.php
# sudo vim /usr/share/php/phpDocumentor/vendor/composer/ClassLoader.php
# 

When I check that file it doesn't have exactly the same declaration as yours:

141     /**
142      * Loads the given class or interface.
143      *
144      * @param  string       $class The name of the class
145      * @return Boolean|null True, if loaded
146      */
147     public function loadClass($class)
148     {
149         if ($file = $this->findFile($class)) {
150             require $file;
151 
152             return true;
153         }
154     }

Anyway I've made the modifications.

@olivierpons
Copy link
Author

With modifications:

olivier@olivier-ubuntu ~ # phpdoc
string(93) "Cilex\Application: /usr/share/php/phpDocumentor/vendor/cilex/cilex/src//Cilex/Application.php"
string(73) "Pimple: /usr/share/php/phpDocumentor/vendor/pimple/pimple/lib//Pimple.php"
string(133) "Cilex\Provider\MonologServiceProvider: /usr/share/php/phpDocumentor/vendor/cilex/cilex/src//Cilex/Provider/MonologServiceProvider.php"
string(119) "Cilex\ServiceProviderInterface: /usr/share/php/phpDocumentor/vendor/cilex/cilex/src//Cilex/ServiceProviderInterface.php"
string(126) "phpDocumentor\Reflection\ReflectionAbstract: /usr/share/php/phpDocumentor/src//phpDocumentor/Reflection/ReflectionAbstract.php"
string(110) "phpDocumentor\Parser\ParserAbstract: /usr/share/php/phpDocumentor/src//phpDocumentor/Parser/ParserAbstract.php"
string(130) "phpDocumentor\Transformer\TransformerAbstract: /usr/share/php/phpDocumentor/src//phpDocumentor/Transformer/TransformerAbstract.php"
string(109) "sfEventDispatcher: /usr/share/php/phpDocumentor/vendor/pear-symfony/EventDispatcher/lib/sfEventDispatcher.php"
string(96) "phpDocumentor\Plugin\Manager: /usr/share/php/phpDocumentor/src//phpDocumentor/Plugin/Manager.php"
string(107) "Zend\Config\Factory: /usr/share/php/phpDocumentor/vendor/zendframework/zend-config//Zend/Config/Factory.php"
string(113) "Zend\Stdlib\ArrayUtils: /usr/share/php/phpDocumentor/vendor/zendframework/zend-stdlib//Zend/Stdlib/ArrayUtils.php"
string(113) "Zend\Config\Reader\Xml: /usr/share/php/phpDocumentor/vendor/zendframework/zend-config//Zend/Config/Reader/Xml.php"
string(137) "Zend\Config\Reader\ReaderInterface: /usr/share/php/phpDocumentor/vendor/zendframework/zend-config//Zend/Config/Reader/ReaderInterface.php"
string(105) "Zend\Config\Config: /usr/share/php/phpDocumentor/vendor/zendframework/zend-config//Zend/Config/Config.php"
string(94) "phpDocumentor\Plugin\Plugin: /usr/share/php/phpDocumentor/src//phpDocumentor/Plugin/Plugin.php"
string(110) "phpDocumentor\Plugin\PluginAbstract: /usr/share/php/phpDocumentor/src//phpDocumentor/Plugin/PluginAbstract.php"
string(109) "\phpDocumentor\Plugin\Core\Listener: /usr/share/php/phpDocumentor/src//phpDocumentor/Plugin/Core/Listener.php"
string(114) "phpDocumentor\Plugin\ListenerAbstract: /usr/share/php/phpDocumentor/src//phpDocumentor/Plugin/ListenerAbstract.php"
string(109) "\phpDocumentor\Plugin\Core\Listener: /usr/share/php/phpDocumentor/src//phpDocumentor/Plugin/Core/Listener.php"
PHP Fatal error:  Cannot redeclare class phpDocumentor\Plugin\Core\Listener in /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Core/Listener.php on line 194

Fatal error: Cannot redeclare class phpDocumentor\Plugin\Core\Listener in /usr/share/php/phpDocumentor/src/phpDocumentor/Plugin/Core/Listener.php on line 194
olivier@olivier-ubuntu ~ # 

@mvriel
Copy link
Member

mvriel commented Jul 17, 2012

It just hit me: the prefixing slash.

That class is the only one in that list who has a \ prefixing the class name. And since the \ is replaced with a directory separator and the prefixing slash is probably removed could it very well not detect that the class is already defined.

Let me search the code for this

mvriel added a commit that referenced this issue Jul 17, 2012
If my guess would be correct is that some inconsistency in a piece of software is
causing class files to be loaded duplicate if the class is loaded as a string and
starting with a \.

The first attempt is to fix the symptom by removing the slash. If that works then
we need to strip prefixing slashes when loading classes from the plugin.xml
@mvriel
Copy link
Member

mvriel commented Jul 17, 2012

@olivierpons can you test the latest version on the Develop branch? The issue should be fixed if my assumption is correct

@olivierpons
Copy link
Author

I'm sorry I just know (and have the time) to test it through:

sudo pear uninstall phpdoc/phpDocumentor-alpha
sudo pear install --alldeps phpdoc/phpDocumentor-alpha

I don't know how I could test the latest version on the Develop branch.

@mvriel
Copy link
Member

mvriel commented Jul 19, 2012

No problem; I will do a release in a few days including this fix. I will comment here once it is done.
Thank you!

@mvriel
Copy link
Member

mvriel commented Jul 27, 2012

I have released a new version on PEAR: 2.0.0a8.
That should solve the issue with the Listener; though I have understood that there is another reference to the Markdown component which gives the same type of issue

@Niklas-Peter
Copy link

I have in the moment not much time, but a little test with Yii brought a
memory limit error (128M), but I couldn't do further tests.

Am 27.07.2012 06:13, schrieb Mike van Riel:

I have released a new version on PEAR: 2.0.0a8.
That should solve the issue with the Listener; though I have understood that there is another reference to the Markdown component which gives the same type of issue


Reply to this email directly or view it on GitHub:
#461 (comment)

@olivierpons
Copy link
Author

It works!

. OMFG! the output graph class is incredible!

You're my man!

\o/

Incredible work!

Documentation far better, less errors, keep on the good work, it's astonishing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants