2

I have a legacy application which I am slowly converting to composer, and am writing a new database layer for. This database layer is PSR-0 compatible. The application is split into back and front end, and I am writing common classes for the DB layer so it is more DRY.

In my composer.json for the front end project I have this:

"autoload": {
        "psr-0": {
            "CompanyName": "_classes/"
        }
    }

where the CompanyName folder in _classes is in fact a symlink to the analogous folder in the back end project.

This causes the autoloading to fail.

It worked perfectly when it was

"autoload": {
        "psr-0": {
            "CompanyName": "../otherProject/_classes/"
        }
    }

but failed when put a symlink in this projects _classes folder.

I need the symlink to work because i do not want to hard code the other projects web folder name into composer.json, as I now have testing versions of both which have different folder names.

4

1 回答 1

4

问题是我的符号链接是相对的,这导致它无法正常工作。我使用完整路径重新创建了链接:

ln -sf /web/otherProject/_classes/CompanyName /web/project/_classes/CompanyName

现在没有问题了。

于 2013-10-12T13:38:21.443 回答