PHP code example of nazir / iofiles
1. Go to this page and download the library: Download nazir/iofiles 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/ */
nazir / iofiles example snippets
use \IOFiles\IOFiles;
$iofiles = new IOFiles;
\\ jika tanpa use maka $iofiles = new \IOFiles\IOFiles;
$iofiles->copy($file, $destination);
$iofiles->move($oldfile, $newfile);
$iofiles->rename($oldfile, $newfile);
$iofiles->delete($file);
$iofiles->download($file);
$iofiles->gz_file($file);
$iofiles->get_attrib($file, [$flags]);
$iofiles->get_attrib('index.php', 'size');
$iofiles->get_attrib('index.php', array('size', 'perms');
$iofiles->get_type($file)
$iofiles->find($keyword, [$directory]);
$iofiles->search($keyword, [$directory]);
// sama dengan $iofiles->find(..) :D
$iofiles->read($file, [[[$returnType], [$length]], [$readType]]);
$iofiles->write($file, [[$content], [$mode]]);
$iofiles->upload_config($config);
$iofiles->upload_config(
array(
'allowed_types' => 'docx|pdf',
'overwrite' => true,
'encrypt_name' => true
)
);
$iofiles->upload('userfile');
$iofiles->upload([$field]);
$iofiles->upload_get_param($paramName);
$iofiles->upload_show_error();
$iofiles->zip_compress($file, [$zipName]);
$iofiles->zip_extract($zipfile, $destdir);
$iofiles->image_config($config);
$iofiles->image_config(
array(
'source_image' => 'yourimage.png',
'maintain_ratio' => true,
'wm_type' => 'text',
'wm_text' => 'Copyright 2017'
)
);
$iofiles->image_crop();
// pastikan image_config sudah dipanggil
$iofiles->image_resize();
$iofiles->image_rotate();
$iofiles->image_watermark();
$iofiles->image_mirror();
$iofiles->image_show_error();
$iofiles->image_clear();