File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -107,18 +107,20 @@ public function extensionPath(): string
107107 return $ extensionPath ;
108108 }
109109
110+ // `extension_dir` may be a relative URL on Windows, so resolve it according to the location of PHP
111+ if (self ::operatingSystem () === OperatingSystem::Windows) {
112+ $ phpPath = dirname ($ this ->phpBinaryPath );
113+ $ attemptExtensionPath = $ phpPath . DIRECTORY_SEPARATOR . $ extensionPath ;
114+
115+ if (file_exists ($ attemptExtensionPath ) && is_dir ($ attemptExtensionPath )) {
116+ return $ attemptExtensionPath ;
117+ }
118+ }
119+
110120 // if the path is absolute, try to create it
111121 if (mkdir ($ extensionPath , 0777 , true ) && file_exists ($ extensionPath ) && is_dir ($ extensionPath )) {
112122 return $ extensionPath ;
113123 }
114-
115- // `extension_dir` may be a relative URL on Windows, so resolve it according to the location of PHP
116- $ phpPath = dirname ($ this ->phpBinaryPath );
117- $ attemptExtensionPath = $ phpPath . DIRECTORY_SEPARATOR . $ extensionPath ;
118-
119- if (file_exists ($ attemptExtensionPath ) && is_dir ($ attemptExtensionPath )) {
120- return $ attemptExtensionPath ;
121- }
122124 }
123125
124126 throw new RuntimeException ('Could not determine extension path for ' . $ this ->phpBinaryPath );
You can’t perform that action at this time.
0 commit comments