PHP code example of brzuchal / filesystem-stream-wrapper

1. Go to this page and download the library: Download brzuchal/filesystem-stream-wrapper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

brzuchal / filesystem-stream-wrapper example snippets


FilesystemStreamWrapper::register('app', __DIR__ . '/myapp_direcotry')

touch('app://file.txt');
file_put_contents('app://file.txt', "comment\n");
echo file_get_contents('app://file.txt'); // "comment\n"
unlink('app://file.txt');
mkdir('app://directory');
rename('app://directory', 'app://dir');
rmdir('app://dir');

FilesystemStreamWrapper::unregister('app');

namespace Doctrine\ORM\Tools\Console\Command;

function realpath() {
    return call_user_func_array("FilesystemStreamWrapper::realpath", func_get_args());
}