File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,8 +134,9 @@ public function dumpRequireFile() {
134134
135135 // Find the relative path from the mu-plugins dir to the mu-loader file.
136136 $ muPath = $ this ->resolveMURelPath ( $ muRelPath );
137- $ loadFile = dirname ( __DIR__ ) . DIRECTORY_SEPARATOR . 'mu-loader.php ' ;
138- $ toLoader = DIRECTORY_SEPARATOR . Util \rel_path ( $ muPath , $ loadFile );
137+ $ ds = $ this ->getDirectorySeparator ();
138+ $ loadFile = dirname ( __DIR__ ) . $ ds . 'mu-loader.php ' ;
139+ $ toLoader = $ ds . Util \rel_path ( $ muPath , $ loadFile , $ ds );
139140
140141 // Write the boostrapping PHP file.
141142 if ( !file_exists ( $ muPath ) ) {
@@ -194,4 +195,21 @@ protected function resolveMURelPath( $relpath ) {
194195 // Return the abosolute path.
195196 return $ basepath . $ relpath ;
196197 }
198+
199+ /**
200+ * Get the directory separator to use for the generatoed loader
201+ *
202+ * This defaults to the DIRECTORY_SEPARATOR constant, but can be overridden in
203+ * the composer.json extra section with "force-unix-separator" set to true.
204+ *
205+ * @return string The directory separator character to use
206+ */
207+ protected function getDirectorySeparator () {
208+ $ separator = DIRECTORY_SEPARATOR ;
209+ if ( ! empty ( $ this ->extras ['force-unix-separator ' ] ) ) {
210+ $ separator = '/ ' ;
211+ }
212+
213+ return $ separator ;
214+ }
197215}
You can’t perform that action at this time.
0 commit comments