Exemplo n.º 1
0
 public function testClone()
 {
     $file = fFile::create('output/fFile/three.txt', 'thr33');
     $new_file = clone $file;
     $this->assertEquals(TRUE, $new_file instanceof fFile);
     $this->assertEquals(TRUE, $new_file->getPath() != $file->getPath());
     $this->assertEquals('thr33', file_get_contents($new_file->getPath()));
 }
Exemplo n.º 2
0
$jsonOutput .= '], "itemsPerPage": ' . $totalRecords . ', "startIndex": 0, "totalResults": ' . $totalRecords . '}';
//dont write files unless there were rows returned
if ($jsonCount > 0) {
    echo DOC_ROOT . '/feeds/driveCache/drive' . $driveId . '.json';
    //write JSON
    try {
        $file = new fFile(DOC_ROOT . '/feeds/driveCache/drive' . $driveId . '.json');
        $file->write($jsonOutput);
    } catch (fExpectedException $e) {
        $new_file = fFile::create(DOC_ROOT . '/feeds/driveCache/drive' . $driveId . '.json', $jsonOutput);
    } catch (fEnvironmentException $e) {
    }
    //write KML
    try {
        $file = new fFile(DOC_ROOT . '/feeds/driveCache/drive' . $driveId . '.kml');
        $file->write($kmlOutput);
    } catch (fExpectedException $e) {
        $new_file = fFile::create(DOC_ROOT . '/feeds/driveCache/drive' . $driveId . '.kml', $kmlOutput);
    } catch (fEnvironmentException $e) {
    }
    //write CSV
    try {
        $file = new fFile(DOC_ROOT . '/feeds/driveCache/drive' . $driveId . '.csv');
        $file->write($csvOutput);
    } catch (fExpectedException $e) {
        $new_file = fFile::create(DOC_ROOT . '/feeds/driveCache/drive' . $driveId . '.csv', $csvOutput);
    } catch (fEnvironmentException $e) {
    }
}
$db = null;
//echo $output;