deployment - PHP : Virtual machines VS __FILE__ resolving symbolic links? -
i'm using existing php software makes extensive usage of __file__
magic constant, require bootstrap files, among other things, example:
require dirname(__file__) . '/path/to/config.php';
right have several websites on same server running software.
all websites have copies of files, works, centralize "common" files (classes, controllers, etc...), to:
- reduce amount of files
- simplify deployments
at first, thought using symlinks "common" files, simple folders "specific" files:
config classes -> /path/to/common/classes controllers -> /path/to/common/controllers ...
... problem __file__
resolves symbolic links
since php 4.0.2,
__file__
contains absolute path symlinks resolved whereas in older versions contained relative path under circumstances.
it means using constant resolve pathes relative "common" files, not want.
i know can use $_server['script_filename]
, don't want modify code of software i'm using, unmaintainable.
is there other way achieve ?
maybe using virtual machines (one each website) sort of shared folders ? (i'm not expert @ all)
Comments
Post a Comment