简体   繁体   中英

Full physical path of Composer vendor directory

Is there any way to get the full physical path of the Composer's vendor folder?

I have been searching internet for an hour but no luck.

Thanks

Use getcwd() function. Here you can read also regarding this http://php.net/manual/en/function.getcwd.php

you can write a class within the constant " __FILE__ ". just like following:

class ComposerPath{
    static  function  get(){
         return dirname(__FILE__);
    }
}

then you load it by composer,and use

CompoerPath::get();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM