Edit report at https://pear.php.net/bugs/bug.php?id=20101&edit=1

  ID: 20101
  Updated by: gsherwood@squiz.net
  Reported By: slangley@google.com
  Summary: CodeSniffer doesn't work when run from a symlink farm
  Status: Feedback
-Type: Bug
+Type: Feature/Change Request
  Package: PHP_CodeSniffer
  Operating System: linux
  Package Version: 1.5.0RC4
  PHP Version: Irrelevant
  Assigned To: squiz
  Roadmap Versions:
  New Comment:

-Type: Bug
+Type: Feature/Change Request
This isn't a bug with how PHP_CodeSniffer functions, but I'll leave this
as a feature
request in case I get some more support for this particular
configuration. If you have
a patch that works for you, please let me know and I'll look at it

Previous Comments:

[2013-10-23 05:23:01] slangley

Image all of the files are symlinked back to the original sources, one
by one, not just
the top level directory.


[2013-10-23 05:12:45] squiz

-Status: Open
+Status: Feedback
-Assigned To:
+Assigned To: squiz
I don't know what you mean by a "symlink farm". Is the PEAR directory a
symlink to
somewhere else or is it more complex than that? I'm just trying to
figure out how to
replicate this properly.


[2013-10-16 05:31:03] slangley

Because of the liberal use of the __FILE__ magic constant,
which resolves symlinks, PHP code sniffer will not run.

Also, in some places there is code like this ...

if (is_file(dirname(__FILE__).'/../CodeSniffer/CLI.php') ===
true) {
     include_once dirname(__FILE__).'/../CodeSniffer/CLI.php';
} else {
     include_once 'PHP/CodeSniffer/CLI.php';

note that there is 'PHP' prefixed in the include_once statement.

But in the autoloader, there is no PHP prefixed to the file name
to be loaded, so you need to add various combinations to the
include_path of the interpreter to try and get this to work.

However, it will finally barf on

Fatal error: Uncaught exception 'UnexpectedValueException'
with message
ndards): failed to open dir: No such file or directory' in
Stack trace:
#3 /build/cas/834/83498a458876f676802c5ff4e099f7e0(37):
#4 {main}
   thrown in
/build/cas/168/1688b0514f62b3cb072697454fcb2eb0 on line

which cannot be worked around


Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 3 | next ›
Discussion Overview
grouppear-bugs @
postedOct 24, '13 at 4:23a
activeOct 24, '13 at 4:33a

2 users in discussion

Gsherwood: 2 posts Slangley: 1 post



site design / logo © 2022 Grokbase