Importate librerie fondamentali: Logger (UNTESTED) System (UNTESTED) Dao (INCOMPLETE)
161 lines
3.5 KiB
PHP
161 lines
3.5 KiB
PHP
<?php
|
|
abstract class FSObject {
|
|
|
|
|
|
public static $DEVICE_TYPE_COMPACT_FLASH = 1;
|
|
public static $DEVICE_TYPE_HARD_DRIVE = 2;
|
|
public static $DEVICE_TYPE_SECURE_DISK = 4;
|
|
public static $DEVICE_TYPE_NAS = 8;
|
|
public static $DEVICE_TYPE_OTHER_FLASH = 16;
|
|
public static $DEVICE_TYPE_RAMFS = 32;
|
|
|
|
public static $WRITELAW_NORMALLY_RO = 1;
|
|
public static $WRITELAW_NORMALLY_W = 2;
|
|
public static $WRITELAW_NOT_WRITEABLE = 4;
|
|
|
|
// public static $RQ_ROOTFS = 1;
|
|
// public static $RQ_TEMPFS = 2;
|
|
// public static $RQ_SYSTEMSTORAGE = 4;
|
|
// public static $RQ_USERSTORAGE = 8;
|
|
|
|
/**
|
|
* Identifica la classe del dispositivo fisico che lo sostiene
|
|
* @var int
|
|
*/
|
|
public $type;
|
|
|
|
/**
|
|
* Definisce le modalità di accesso al sistema
|
|
* @var int
|
|
*/
|
|
public $accessMode;
|
|
|
|
/**
|
|
* Identificativo di sistema del filesystem
|
|
* @var string
|
|
*/
|
|
public $deviceIdentifier;
|
|
|
|
/**
|
|
* Punto di mount a livello di sistema operativo
|
|
* @var string
|
|
*/
|
|
public $mountPoint;
|
|
|
|
/**
|
|
* Legge di scrittura (Normalmente a Sola Lettura, Normalmente Scrivibile, Non scrivibile)
|
|
* @var int
|
|
*/
|
|
public $writeLaw;
|
|
|
|
/**
|
|
* Qualificatore del tipo di risorsa (Filesystem di root, Filesystem di storage, Filesystem di storage utente
|
|
* @var int
|
|
*/
|
|
public $resourceQualifier;
|
|
|
|
/**
|
|
* Descrive il tipo di filesystem
|
|
* @var string
|
|
*/
|
|
public $fstype;
|
|
|
|
/**
|
|
* Nome descrittivo dello filesystem
|
|
* @var string
|
|
*/
|
|
public $name;
|
|
|
|
/**
|
|
* Dati di connessione al file system remoto
|
|
*/
|
|
public $remotefsdata;
|
|
|
|
/**
|
|
* Restituisce il mount point dell'FSObject
|
|
* @return string
|
|
*/
|
|
public function getMountPoint(){
|
|
return $this->mountPoint;
|
|
}
|
|
|
|
/**
|
|
* Scrive su un file del file system in base alle sue caratteristiche
|
|
* @param string $path
|
|
*/
|
|
public abstract function writeFile($content,$filePath);
|
|
|
|
/**
|
|
* Scrive su un file del file system in append
|
|
* @param string $path
|
|
*/
|
|
public abstract function appendToFile($content,$filePath);
|
|
/**
|
|
* Legge da un file del file system in base alle sue caratteristiche
|
|
* @param string $path
|
|
*/
|
|
public abstract function readFile($filePath);
|
|
|
|
/**
|
|
* Copia un file nella posizione inserita in base alle caratteristiche del FS
|
|
* @param string $path
|
|
*/
|
|
public abstract function copyFile($source,$destination,$sudo);
|
|
|
|
/**
|
|
* Sposta un file nella posizione inserita in base alle caratteristiche del FS
|
|
* @param string $path
|
|
*/
|
|
public abstract function moveFile($source,$destination,$sudo);
|
|
|
|
/**
|
|
* Crea un file sul file system in base alle sue caratteristiche
|
|
* @param string $path
|
|
*/
|
|
public abstract function touchFile($path,$sudo);
|
|
|
|
/**
|
|
* Cancella il file al percorso pecificato
|
|
* @param string $path
|
|
*/
|
|
public abstract function deleteFile($path,$sudo);
|
|
|
|
|
|
/**
|
|
* Crea una cartella sul file system in base alle sue caratteristiche
|
|
* @param string $path
|
|
*/
|
|
public abstract function createDirectory($path,$sudo);
|
|
|
|
/**
|
|
* Copia una cartella sul file system in base alle sue caratteristiche
|
|
* @param string $path
|
|
*/
|
|
public abstract function copyDirectory($source,$destination,$sudo);
|
|
|
|
/**
|
|
* Verifica l'esistenza di un file
|
|
* @param string $path
|
|
*/
|
|
public abstract function fileExists($filePath);
|
|
|
|
/**
|
|
* Verifica l'esistenza di un file
|
|
* @param string $path
|
|
*/
|
|
public abstract function directoryExists($dirPath);
|
|
|
|
|
|
/**
|
|
* Verifica che il file sia una cartella
|
|
* @param string $path
|
|
*/
|
|
public abstract function isDirectory($path);
|
|
|
|
/**
|
|
* Verifica che il file sia una cartella
|
|
* @param string $path
|
|
*/
|
|
public abstract function lsDir($path);
|
|
|
|
}?>
|