Get filesystem path of installed composer package

后端 未结 4 1035
渐次进展
渐次进展 2021-02-08 07:43

How can get filesystem path of composer package?

composer.json example:

{

    \"require\" : {
        \"codeception/codeception\" : \"@stable\",
                


        
4条回答
  •  情深已故
    2021-02-08 08:17

    Here is my solution to get the vendor path without using the $composer object :

    getFileName() );
            if($vendorPath && is_dir($vendorPath)) {
                return $vendorPath . '/';
            }
            throw new \RuntimeException('Unable to detect vendor path.');
        }
    }
    

提交回复
热议问题