Require DIR. '//bootstrap What does this code mean?

Source: Internet
Author: User
Tags autoload
Recently studied the Laravel framework,

Require __dir__. ' /.. /bootstrap/autoload.php ';
What do you mean by this code?

The call is:
d:\web\laravel\public/. /bootstrap/autoload.php This path format is problematic;

And the real call is indeed:
D:\Web\Laravel\bootstrap\autoload.php

/In the path: /What does that mean? Can you tell me in detail, I read the PHP manual a few times, did not find this grammar ah;



Reply to discussion (solution)

Represents the autoload.php under the bootstrap directory under the __DIR__ directory under the upper directory

I am also just beginning to learn PHP, also take the laravel framework to study, _DIR_ is a magic constant after php5.3, used to point to the current execution of the PHP script is located in the directory, "." is a connector for connecting strings and variables,. /indicates the current directory of the previous level of directory, previously used DOS system should know, and now use the command-line tool is still used.

Require __dir__. ' /.. /bootstrap/autoload.php ';
Under fold:
__dir__ Magic constant represents the directory where the current running file is located, your own echo __dir__; Look, the directory path it outputs is not/ended;
.. /represents the top-level directory at the current location;

Represents the autoload.php under the bootstrap directory under the __DIR__ directory under the upper directory




The main question is: __dir__. ' /.. /bootstrap Here's/... /No in the beginning position, the path of the string is not right ah;

Require __dir__. ' /.. /bootstrap/autoload.php ';
Under fold:
__dir__ Magic constant represents the directory where the current running file is located, your own echo __dir__; Look, the directory path it outputs is not/ended;
.. /represents the top-level directory at the current location;




The main questions are:
The result of the string connection is D:\Web\Laravel\public/. /bootstrap/autoload.php This path is legal?

Represents the bootstrap/autoload.php file under the parent directory of the current directory.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.