wp-muplugin-loader icon indicating copy to clipboard operation
wp-muplugin-loader copied to clipboard

mu-loader.php invalid path

Open joraff opened this issue 5 years ago • 1 comments

For some reason in my installation when the mu-loader.php file is written, the __DIR__ in the template is being expanded and producing an invalid path for require_once().

https://github.com/lkwdwrd/wp-muplugin-loader/blob/aed228e0037fc243c116a0d2d69076db5ed7d96b/src/lkwdwrd/Composer/MULoaderPlugin.php#L145-L148

If I rewrite the template using single quotes, the file content is created correctly.

file_put_contents(
    $muPath . 'mu-require.php',
    '<?php' . PHP_EOL . 'require_once __DIR__ . \'' . $toLoader . '\';' . PHP_EOL
);

php 7.2.18 in an alpine linux docker container and version 1.0.5 of this plugin.

joraff avatar Sep 04 '19 16:09 joraff

Sounds like the bug first referenced in #2

@lkwdwrd either #13 or #12 should be a sound way to resolve the issue

benvoynick avatar Oct 01 '19 18:10 benvoynick