关于路径 path

来源:互联网 发布:mac bombshell试色 编辑:程序博客网 时间:2024/05/16 17:12

     在所有的语言中,所有路径的引用:

     1。 /index/index.jpg 这个路径就是相对于当前文件夹中的index文件夹下的index.jpg文件。

     2。 一般关于php文件中的,

 

当你开始一个php项目的时候如果要引用本项目中已经有的文件的时候文件目录要使用绝对路径:不过一般在index.php

defined('APPLICATION_PATH')

|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../'));

//

// Define application environment

defined('APPLICATION_ENV')

    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

// Ensure library/ is on include_path

set_include_path(implode(PATH_SEPARATOR, array(

    realpath(APPLICATION_PATH . '/../library'),

    get_include_path(),

)));

 

include_once APPLICATION_PATH."/Maged/Model.php";

一般都是使用这样的形式进行引用文件:

原创粉丝点击