Home >Backend Development >PHP Tutorial >yii2 Trying to copy a directory to itself or a subdirectory

yii2 Trying to copy a directory to itself or a subdirectory

WBOY
WBOYOriginal
2016-06-06 20:10:091696browse

用php composer.phar 添加了个扩展 就报这个错误了
上次也遇到过 莫名其妙的好了 好像记得我只清空了web目录下的缓存
可这次却不行了

<code>public static function copyDirectory($src, $dst, $options = [])
    {
        if ($src === $dst || strpos($dst, $src) === 0) {
            throw new InvalidParamException('Trying to copy a directory to itself or a subdirectory.');
        }
        if (!is_dir($dst)) {
            static::createDirectory($dst, isset($options['dirMode']) ? $options['dirMode'] : 0775, true);
        }
 
        $handle = opendir($src);
        if ($handle === false) {
            throw new InvalidParamException("Unable to open directory: $src");
        }</code>

有遇到类似情况的或有解决方法的 同学 提个醒啊 谢谢

回复内容:

用php composer.phar 添加了个扩展 就报这个错误了
上次也遇到过 莫名其妙的好了 好像记得我只清空了web目录下的缓存
可这次却不行了

<code>public static function copyDirectory($src, $dst, $options = [])
    {
        if ($src === $dst || strpos($dst, $src) === 0) {
            throw new InvalidParamException('Trying to copy a directory to itself or a subdirectory.');
        }
        if (!is_dir($dst)) {
            static::createDirectory($dst, isset($options['dirMode']) ? $options['dirMode'] : 0775, true);
        }
 
        $handle = opendir($src);
        if ($handle === false) {
            throw new InvalidParamException("Unable to open directory: $src");
        }</code>

有遇到类似情况的或有解决方法的 同学 提个醒啊 谢谢

重新编辑了AppAsset的sourcePath,就可以了

<code>public $sourcePath = '@webroot/adminlte';
    public $baseUrl = '@web';
    public $css = [
        'dist/css/AdminLTE.min.css',
    ];
    public $js = [
        'dist/js/app.min.js',

    ];</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn