Menu

#6 Rename include.php into Phrame.php

Phrame 2.0
open
nobody
Phrame (1)
5
2004-04-07
2004-04-07
No

Greetings:

I'd like to be able to place the Phrame's installation
directory in the "include_path" variable of the
php.ini, and then be able to include it without
specifying the path explicitely. If I do this
currently, I would end up writing:

include( "include.php" );

which is too generic, since I have more than one
directory in the include_path. IMO it would be nicer
if the Phrame's main include file was named
"Phrame.php": this way it is a lot clearer to the
reader of the code what's being included:

include( "Phrame.php" );

Thanks,
--
Arcady Genkin

Discussion

  • Nobody/Anonymous

    Logged In: NO

    Put Phrame into your include dir in its own directory and use
    require_once "Phrame/include.php"

     
  • Arcady Genkin

    Arcady Genkin - 2004-05-25

    Logged In: YES
    user_id=27110

    This would work, but would require that I change the way I
    manage locally installed packages. Currently each package
    lives in a directory named like
    /local/packages/phrame-2.1-pre4/, but the approach that you
    suggest requires the PHP packages to lived in some other
    sub-directory.

     
  • FjK

    FjK - 2004-05-26

    Logged In: YES
    user_id=693764

    So how do you get to your phrame include file from our root
    include path? I'll assume you create a symlink to the
    include file or something. Based on that assumption, you
    could create a symlink to your phrame package directory
    instead and use the idea
    require_once("Phrame/include.php")suggested below...

    <include_root>/Phrame -> /local/packages/phrame-2.1-pre4

     

Log in to post a comment.