Example #1
0
 function download()
 {
     $OOoFile = new File(CACHE_PATH . "/" . $this->fileName);
     if ($OOoFile->exists()) {
         $df_size = $OOoFile->length();
         header("Pragma: no-cache");
         header("Expires: 0");
         header("Cache-control: private");
         header("Content-Type: application/vnd.sun.xml." . $this->TYPE);
         header("Content-Length: " . $df_size);
         header("Content-Disposition: inline; filename=" . $this->fileName);
         $fp = fopen(CACHE_PATH . "/" . $this->fileName, 'r');
         rewind($fp);
         fpassthru($fp);
         // ** CORRECT **
         fclose($fp);
         return $fp;
     }
     return false;
 }
Example #2
0
out::prntln("Last index of 'o': " . ((!$hello->lastIndexOf("o")) ? 'false' :  $hello->lastIndexOf("o")));

// ----------------------------------------------------- //

// New Section
out::prntln();

// ----------------------------------------------------- //

// Initialize a File
$file = new File("index.php");

// Get the name
out::prntln("Filename? " . $file->getName());

// Is it a file?
out::prntln("File? " . (($file->isFile()) ? 'true' : 'false'));

// Check validation.
out::prntln("Does it exist? " . (($file->exists()) ? 'true' : 'false'));

// Attempt creation
out::prntln("Creation? " . (($file->createNewFile()) ? 'true' : 'false'));

// Size?
out::prntln("Size: " . $file->length());

// Last modified?
out::prntln("Last modified: " . $file->lastModified());

// ----------------------------------------------------- //