PHP code example of osumionline / plugin-file
1. Go to this page and download the library: Download osumionline/plugin-file 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/ */
osumionline / plugin-file example snippets
// Copiar un archivo
if (OFile::copy('/source/path', '/destinatio/path')) {
echo "Archivo copiado.";
}
// Renombrar un archivo
if (OFile::rename('/path/old_name.txt', '/path/new_name.txt')) {
echo "Archivo renombrado.";
}
// Borrar un archivo
if (OFile::delete('/path/file.txt')) {
echo "Archivo borrado.";
}
// Borrar una carpeta, sus archivos y sub-carpetas recursivamente
if (Ofile::rrmdir('/path')) {
echo "Carpeta borrada.";
}
// Crear un archivo comprimido con ZIP
OFile::zip('/path', '/destination_file.zip');