Codeigniter path functions definitions









up vote
15
down vote

favorite
5












I have come across this page



https://www.codeigniter.com/user_guide/general/reserved_names.html


Could someone please explain to me what following constants do:



EXT
FCPATH
SELF
BASEPATH
APPPATH


Thanks










share|improve this question



















  • 2




    Those aren't functions, they are constants.
    – Rocket Hazmat
    Dec 21 '12 at 15:00














up vote
15
down vote

favorite
5












I have come across this page



https://www.codeigniter.com/user_guide/general/reserved_names.html


Could someone please explain to me what following constants do:



EXT
FCPATH
SELF
BASEPATH
APPPATH


Thanks










share|improve this question



















  • 2




    Those aren't functions, they are constants.
    – Rocket Hazmat
    Dec 21 '12 at 15:00












up vote
15
down vote

favorite
5









up vote
15
down vote

favorite
5






5





I have come across this page



https://www.codeigniter.com/user_guide/general/reserved_names.html


Could someone please explain to me what following constants do:



EXT
FCPATH
SELF
BASEPATH
APPPATH


Thanks










share|improve this question















I have come across this page



https://www.codeigniter.com/user_guide/general/reserved_names.html


Could someone please explain to me what following constants do:



EXT
FCPATH
SELF
BASEPATH
APPPATH


Thanks







php codeigniter






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 at 18:12









Manu K M

385311




385311










asked Dec 21 '12 at 14:39









lomse

1,25442646




1,25442646







  • 2




    Those aren't functions, they are constants.
    – Rocket Hazmat
    Dec 21 '12 at 15:00












  • 2




    Those aren't functions, they are constants.
    – Rocket Hazmat
    Dec 21 '12 at 15:00







2




2




Those aren't functions, they are constants.
– Rocket Hazmat
Dec 21 '12 at 15:00




Those aren't functions, they are constants.
– Rocket Hazmat
Dec 21 '12 at 15:00












3 Answers
3






active

oldest

votes

















up vote
33
down vote



accepted










These constants are each defined in the index.php page:



/*
* -------------------------------------------------------------------
* Now that we know the path, set the main path constants
* -------------------------------------------------------------------
*/
// The name of THIS file
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));

// The PHP file extension
// this global constant is deprecated.
define('EXT', '.php');

// Path to the system folder
define('BASEPATH', str_replace("\", "/", $system_path));

// Path to the front controller (this file)
define('FCPATH', str_replace(SELF, '', __FILE__));

// Name of the "system folder"
define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));


// The path to the "application" folder
if (is_dir($application_folder))

define('APPPATH', $application_folder.'/');

else

if ( ! is_dir(BASEPATH.$application_folder.'/'))

exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);


define('APPPATH', BASEPATH.$application_folder.'/');



Starting at line 196 on https://github.com/EllisLab/CodeIgniter/blob/develop/index.php






share|improve this answer




















  • Very documented. Exactly what I need thanks
    – lomse
    Dec 21 '12 at 15:56

















up vote
14
down vote













You can find its short definition in index.php on the root of your CI folder.



EXT: The PHP file extension
FCPATH: Path to the front controller (this file) (root of CI)
SELF: The name of THIS file (index.php)
BASEPATH: Path to the system folder
APPPATH: The path to the "application" folder





share|improve this answer





























    up vote
    2
    down vote













    SELF = index.php



    Use when you want to include something from your root folder
    FCPATH = C:xampphtdocsyour_root_folder



    Use when you want to include something from your application folder
    APPPATH = C:xampphtdocsyour_root_folderapplication



    BASEPATH = C:xampphtdocsyour_root_foldersystem






    share|improve this answer






















    • Please format your answer
      – Billa
      Aug 19 at 18:56










    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f13992074%2fcodeigniter-path-functions-definitions%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    33
    down vote



    accepted










    These constants are each defined in the index.php page:



    /*
    * -------------------------------------------------------------------
    * Now that we know the path, set the main path constants
    * -------------------------------------------------------------------
    */
    // The name of THIS file
    define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));

    // The PHP file extension
    // this global constant is deprecated.
    define('EXT', '.php');

    // Path to the system folder
    define('BASEPATH', str_replace("\", "/", $system_path));

    // Path to the front controller (this file)
    define('FCPATH', str_replace(SELF, '', __FILE__));

    // Name of the "system folder"
    define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));


    // The path to the "application" folder
    if (is_dir($application_folder))

    define('APPPATH', $application_folder.'/');

    else

    if ( ! is_dir(BASEPATH.$application_folder.'/'))

    exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);


    define('APPPATH', BASEPATH.$application_folder.'/');



    Starting at line 196 on https://github.com/EllisLab/CodeIgniter/blob/develop/index.php






    share|improve this answer




















    • Very documented. Exactly what I need thanks
      – lomse
      Dec 21 '12 at 15:56














    up vote
    33
    down vote



    accepted










    These constants are each defined in the index.php page:



    /*
    * -------------------------------------------------------------------
    * Now that we know the path, set the main path constants
    * -------------------------------------------------------------------
    */
    // The name of THIS file
    define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));

    // The PHP file extension
    // this global constant is deprecated.
    define('EXT', '.php');

    // Path to the system folder
    define('BASEPATH', str_replace("\", "/", $system_path));

    // Path to the front controller (this file)
    define('FCPATH', str_replace(SELF, '', __FILE__));

    // Name of the "system folder"
    define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));


    // The path to the "application" folder
    if (is_dir($application_folder))

    define('APPPATH', $application_folder.'/');

    else

    if ( ! is_dir(BASEPATH.$application_folder.'/'))

    exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);


    define('APPPATH', BASEPATH.$application_folder.'/');



    Starting at line 196 on https://github.com/EllisLab/CodeIgniter/blob/develop/index.php






    share|improve this answer




















    • Very documented. Exactly what I need thanks
      – lomse
      Dec 21 '12 at 15:56












    up vote
    33
    down vote



    accepted







    up vote
    33
    down vote



    accepted






    These constants are each defined in the index.php page:



    /*
    * -------------------------------------------------------------------
    * Now that we know the path, set the main path constants
    * -------------------------------------------------------------------
    */
    // The name of THIS file
    define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));

    // The PHP file extension
    // this global constant is deprecated.
    define('EXT', '.php');

    // Path to the system folder
    define('BASEPATH', str_replace("\", "/", $system_path));

    // Path to the front controller (this file)
    define('FCPATH', str_replace(SELF, '', __FILE__));

    // Name of the "system folder"
    define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));


    // The path to the "application" folder
    if (is_dir($application_folder))

    define('APPPATH', $application_folder.'/');

    else

    if ( ! is_dir(BASEPATH.$application_folder.'/'))

    exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);


    define('APPPATH', BASEPATH.$application_folder.'/');



    Starting at line 196 on https://github.com/EllisLab/CodeIgniter/blob/develop/index.php






    share|improve this answer












    These constants are each defined in the index.php page:



    /*
    * -------------------------------------------------------------------
    * Now that we know the path, set the main path constants
    * -------------------------------------------------------------------
    */
    // The name of THIS file
    define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));

    // The PHP file extension
    // this global constant is deprecated.
    define('EXT', '.php');

    // Path to the system folder
    define('BASEPATH', str_replace("\", "/", $system_path));

    // Path to the front controller (this file)
    define('FCPATH', str_replace(SELF, '', __FILE__));

    // Name of the "system folder"
    define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));


    // The path to the "application" folder
    if (is_dir($application_folder))

    define('APPPATH', $application_folder.'/');

    else

    if ( ! is_dir(BASEPATH.$application_folder.'/'))

    exit("Your application folder path does not appear to be set correctly. Please open the following file and correct this: ".SELF);


    define('APPPATH', BASEPATH.$application_folder.'/');



    Starting at line 196 on https://github.com/EllisLab/CodeIgniter/blob/develop/index.php







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Dec 21 '12 at 14:55









    swatkins

    11.6k43370




    11.6k43370











    • Very documented. Exactly what I need thanks
      – lomse
      Dec 21 '12 at 15:56
















    • Very documented. Exactly what I need thanks
      – lomse
      Dec 21 '12 at 15:56















    Very documented. Exactly what I need thanks
    – lomse
    Dec 21 '12 at 15:56




    Very documented. Exactly what I need thanks
    – lomse
    Dec 21 '12 at 15:56












    up vote
    14
    down vote













    You can find its short definition in index.php on the root of your CI folder.



    EXT: The PHP file extension
    FCPATH: Path to the front controller (this file) (root of CI)
    SELF: The name of THIS file (index.php)
    BASEPATH: Path to the system folder
    APPPATH: The path to the "application" folder





    share|improve this answer


























      up vote
      14
      down vote













      You can find its short definition in index.php on the root of your CI folder.



      EXT: The PHP file extension
      FCPATH: Path to the front controller (this file) (root of CI)
      SELF: The name of THIS file (index.php)
      BASEPATH: Path to the system folder
      APPPATH: The path to the "application" folder





      share|improve this answer
























        up vote
        14
        down vote










        up vote
        14
        down vote









        You can find its short definition in index.php on the root of your CI folder.



        EXT: The PHP file extension
        FCPATH: Path to the front controller (this file) (root of CI)
        SELF: The name of THIS file (index.php)
        BASEPATH: Path to the system folder
        APPPATH: The path to the "application" folder





        share|improve this answer














        You can find its short definition in index.php on the root of your CI folder.



        EXT: The PHP file extension
        FCPATH: Path to the front controller (this file) (root of CI)
        SELF: The name of THIS file (index.php)
        BASEPATH: Path to the system folder
        APPPATH: The path to the "application" folder






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jun 25 '14 at 11:21









        Community

        11




        11










        answered Dec 21 '12 at 14:56









        SubRed

        2,75911215




        2,75911215




















            up vote
            2
            down vote













            SELF = index.php



            Use when you want to include something from your root folder
            FCPATH = C:xampphtdocsyour_root_folder



            Use when you want to include something from your application folder
            APPPATH = C:xampphtdocsyour_root_folderapplication



            BASEPATH = C:xampphtdocsyour_root_foldersystem






            share|improve this answer






















            • Please format your answer
              – Billa
              Aug 19 at 18:56














            up vote
            2
            down vote













            SELF = index.php



            Use when you want to include something from your root folder
            FCPATH = C:xampphtdocsyour_root_folder



            Use when you want to include something from your application folder
            APPPATH = C:xampphtdocsyour_root_folderapplication



            BASEPATH = C:xampphtdocsyour_root_foldersystem






            share|improve this answer






















            • Please format your answer
              – Billa
              Aug 19 at 18:56












            up vote
            2
            down vote










            up vote
            2
            down vote









            SELF = index.php



            Use when you want to include something from your root folder
            FCPATH = C:xampphtdocsyour_root_folder



            Use when you want to include something from your application folder
            APPPATH = C:xampphtdocsyour_root_folderapplication



            BASEPATH = C:xampphtdocsyour_root_foldersystem






            share|improve this answer














            SELF = index.php



            Use when you want to include something from your root folder
            FCPATH = C:xampphtdocsyour_root_folder



            Use when you want to include something from your application folder
            APPPATH = C:xampphtdocsyour_root_folderapplication



            BASEPATH = C:xampphtdocsyour_root_foldersystem







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Aug 19 at 19:17

























            answered Aug 19 at 18:37









            Mohammad Khalik Shaikh

            212




            212











            • Please format your answer
              – Billa
              Aug 19 at 18:56
















            • Please format your answer
              – Billa
              Aug 19 at 18:56















            Please format your answer
            – Billa
            Aug 19 at 18:56




            Please format your answer
            – Billa
            Aug 19 at 18:56

















             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f13992074%2fcodeigniter-path-functions-definitions%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            What does pagestruct do in Eviews?

            Dutch intervention in Lombok and Karangasem

            Channel Islands