src/VendorExposeTask.php
protected function setupResources(IOInterface $io)
    {
        // Setup root dir
        $resourcesPath = $this->getResourcesPath();
        $this->filesystem->ensureDirectoryExists($resourcesPath);

        // Copy missing resources
        $files = new DirectoryIterator(__DIR__.'/../resources');
        foreach ($files as $file) {
            $targetPath = $resourcesPath . DIRECTORY_SEPARATOR . $file->getFilename();
            if ($file->isFile() && !file_exists($targetPath)) {
                $name = $file->getFilename();
                $io->write("Writing <info>{$name}</info> to resources folder");
                copy($file->getPathname(), $targetPath);
            }
        }
    }
protected function setupResources(IOInterface $io)
    {
        // Setup root dir
        $resourcesPath = $this->getResourcesPath();
        $this->filesystem->ensureDirectoryExists($resourcesPath);

        // Copy missing resources
        $files = new DirectoryIterator(__DIR__.'/../resources');
        foreach ($files as $file) {
            $targetPath = $resourcesPath . DIRECTORY_SEPARATOR . $file->getFilename();
            if ($file->isFile() && !file_exists($targetPath)) {
                $name = $file->getFilename();
                $io->write("Writing <info>{$name}</info> to resources folder");
                copy($file->getPathname(), $targetPath);
            }
        }
    }
protected function setupResources ( IOInterface $ io ) { // Setup root dir $ resourcesPath = $ this -> getResourcesPath ( ) ; $ this -> filesystem -> ensureDirectoryExists ( $ resourcesPath ) ; // Copy missing resources $ files = new DirectoryIterator ( __DIR__ . '/../resources' ) ; foreach ( $ files as $ file ) { $ targetPath = $ resourcesPath . DIRECTORY_SEPARATOR . $ file -> getFilename ( ) ; if ( $ file -> isFile ( ) && ! file_exists ( $ targetPath ) ) { $ name = $ file -> getFilename ( ) ; $ io -> write ( "Writing <info>{$name}</info> to resources folder" ) ; copy ( $ file -> getPathname ( ) , $ targetPath ) ; } } }
Ensure the resources folder is safely created and protected from index.php in root

@param IOInterface $io
Ensure the resources folder is safely created and protected from index . php in root