PHP code example of marvinjanssen / magicmounter

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

    

marvinjanssen / magicmounter example snippets


Magic::mount(string $name,string $type,array $options);

// Local filesystem:

Magic::mount('backup','fs',['directory'=>'/media/backup']);

copy('./index.php','magic://backup/index.php');

Magic::unmount('backup');

// FTP:

Magic::mount('production','ftp',
	[
	'host' => 'ftp.example.com',
	'username' => 'user',
	'password' => 'password',
	'directory' => '/var/www'
	]);

copy('./index.php','magic://production/index.php');

Magic::unmount('production');

$resource = fopen('magic://mount/file.ext','r');

// ...

Magic::quote($resource,'download_speed');
Magic::quote($resource,'bytes_downloaded');

Magic::driver('custom','\My\CustomDriver');

Magic::mount('production','custom');