PHP code example of corbinjurgens / qstorage

1. Go to this page and download the library: Download corbinjurgens/qstorage 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/ */

    

corbinjurgens / qstorage example snippets


if (Storage::disk('data')->exists('folder/file.txt')){
  $contents = Storage::disk('data')->get('folder/file.txt');
  ...
  Storage::disk('data')->put('folder/file.txt', $contents);
}

$file = QStorage::disk('data')->file('folder/file.txt');
if ($file->exists()){
  $contents = $file->get();
  ...
  $file->put($contents);
}

composer dump-autoload

$files = QStorage::folder('folder')->files();
foreach($files as $file){
	$contents = $file->get();
	...
	$file->put($contents);
}

QStorage::$operation_disk_fetcher = function(){
  return \Storage::disk('custom');
};