mmieluch / laravel-vfs-provider

A service provider intended to use with Laravel 5.x for The League Flysystem's wrapper around PHP-VFS library.
MIT License
4 stars 2 forks source link

CLI-Test not working #1

Open thewulf00 opened 8 years ago

thewulf00 commented 8 years ago

I am just trying to start with laravel-vfs. I worte some test to use laravel vfs storage instead of sFTP-storage. The provider is not able to create a directory.

Steps:

  1. composer require mmieluch/laravel-vfs-provider
  2. Register new service provider in config/app.php
  3. Update config/filesystems.php file
  4. Started a simple test.

Environment:

Error message:

mkdir(): Invalid argument
 \vendor\league\flysystem\src\Adapter\Local.php:357
 \vendor\league\flysystem\src\Filesystem.php:259
 \vendor\laravel\framework\src\Illuminate\Filesystem\FilesystemAdapter.php:304
 \tests\RenderTest.php:8

Errornous line debugged details:

mkdir('phpvfs577a380d4a238:\\test', 0755, true)

Test function:

class RenderTest extends TestCase
{
    public function testFirst()
    {
        $storage = Storage::disk('virtual');
        $storage->makeDirectory('test');
        print_r($storage->allFiles());
    }
}

filesystems.php:

    'disks' => [

        'local' => [
            'driver' => 'local',
            'root' => storage_path('app'),
        ],

        'virtual' => [
            'driver' => 'vfs',
        ],
// ...

composer.json:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.2.*",
        "kirkbushell/eloquence": "~2.0",
        "doctrine/dbal": "~2.3",
        "chumper/zipper": "^0.6",
        "league/flysystem-sftp": "~1.0",
        "mmieluch/laravel-vfs-provider": "^0.0.2"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "symfony/css-selector": "2.8.*|3.0.*",
        "symfony/dom-crawler": "2.8.*|3.0.*",
        "barryvdh/laravel-ide-helper": "~2.1"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan clear-compiled",
            "php artisan ide-helper:generate",
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}
mmieluch commented 8 years ago

I'll have a look in a spare moment. Thanks!