The class handles file operations, either directly via the PHP functions or through an FTP connection. The latter is a workaround for insufficient file permissions when the PHP process runs under a different user than the file owner (referred to as "Safe Mode Hack"). Usage: $files = Files::getInstance(); $files->mkdir('test'); $files->fopen('test/one.txt', 'wb'); $files->fputs('My test'); $files->fclose(); $files->rrdir('test');
Пример #1
0
 /**
  * Clear the image
  *
  * @param string $key
  */
 public function clearImage($key)
 {
     $filePath = $this->getImageFilePath($key);
     if (is_file(TL_ROOT . '/' . $filePath)) {
         Files::getInstance()->delete($filePath);
     }
 }