drop filectime from the filesystem api's

This commit is contained in:
Robin Appelman 2012-10-20 23:54:37 +02:00
parent f7722abcb0
commit cfa036eaa9
13 changed files with 1 additions and 55 deletions

View File

@ -115,12 +115,10 @@ class AmazonS3 extends \OC\Files\Storage\Common {
$stat['size'] = $this->s3->get_bucket_filesize($this->bucket);
$stat['atime'] = time();
$stat['mtime'] = $stat['atime'];
$stat['ctime'] = $stat['atime'];
} else if ($object = $this->getObject($path)) {
$stat['size'] = $object['Size'];
$stat['atime'] = time();
$stat['mtime'] = strtotime($object['LastModified']);
$stat['ctime'] = $stat['mtime'];
}
if (isset($stat)) {
return $stat;

View File

@ -119,7 +119,6 @@ class Dropbox extends \OC\Files\Storage\Common {
$stat['size'] = $metaData['bytes'];
$stat['atime'] = time();
$stat['mtime'] = (isset($metaData['modified'])) ? strtotime($metaData['modified']) : time();
$stat['ctime'] = $stat['mtime'];
return $stat;
}
return false;

View File

@ -257,14 +257,12 @@ class Google extends \OC\Files\Storage\Common {
$stat['size'] = $this->free_space($path);
$stat['atime'] = time();
$stat['mtime'] = time();
$stat['ctime'] = time();
} else if ($entry = $this->getResource($path)) {
// NOTE: Native resources don't have a file size
$stat['size'] = $entry->getElementsByTagNameNS('http://schemas.google.com/g/2005', 'quotaBytesUsed')->item(0)->nodeValue;
// if (isset($atime = $entry->getElementsByTagNameNS('http://schemas.google.com/g/2005', 'lastViewed')->item(0)->nodeValue))
// $stat['atime'] = strtotime($entry->getElementsByTagNameNS('http://schemas.google.com/g/2005', 'lastViewed')->item(0)->nodeValue);
$stat['mtime'] = strtotime($entry->getElementsByTagName('updated')->item(0)->nodeValue);
$stat['ctime'] = strtotime($entry->getElementsByTagName('published')->item(0)->nodeValue);
}
if (isset($stat)) {
return $stat;

View File

@ -500,7 +500,6 @@ class SWIFT extends \OC\Files\Storage\Common{
return array(
'mtime'=>-1,
'size'=>$container->bytes_used,
'ctime'=>-1
);
}
@ -518,7 +517,6 @@ class SWIFT extends \OC\Files\Storage\Common{
return array(
'mtime'=>$mtime,
'size'=>$obj->content_length,
'ctime'=>-1,
);
}

View File

@ -256,7 +256,6 @@ class DAV extends \OC\Files\Storage\Common{
return array(
'mtime'=>strtotime($response['{DAV:}getlastmodified']),
'size'=>(int)isset($response['{DAV:}getcontentlength']) ? $response['{DAV:}getcontentlength'] : 0,
'ctime'=>-1,
);
}catch(\Exception $e) {
return array();

View File

@ -162,7 +162,6 @@ class Shared extends \OC\Files\Storage\Common {
if ($path == '' || $path == '/') {
$stat['size'] = $this->filesize($path);
$stat['mtime'] = $this->filemtime($path);
$stat['ctime'] = $this->filectime($path);
return $stat;
} else if ($source = $this->getSourcePath($path)) {
list($storage, $internalPath)=\OC\Files\Filesystem::resolvePath($source);
@ -233,27 +232,6 @@ class Shared extends \OC\Files\Storage\Common {
return false;
}
public function filectime($path) {
if ($path == '' || $path == '/') {
$ctime = 0;
if ($dh = $this->opendir($path)) {
while (($filename = readdir($dh)) !== false) {
$tempctime = $this->filectime($filename);
if ($tempctime < $ctime) {
$ctime = $tempctime;
}
}
}
return $ctime;
} else {
$source = $this->getSourcePath($path);
if ($source) {
list($storage, $internalPath)=\OC\Files\Filesystem::resolvePath($source);
return $storage->filectime($internalPath);
}
}
}
public function filemtime($path) {
if ($path == '' || $path == '/') {
$mtime = 0;

View File

@ -30,13 +30,12 @@ class OC_Files {
/**
* get the filesystem info
* @param string path
* @param string $path
* @return array
*
* returns an associative array with the following keys:
* - size
* - mtime
* - ctime
* - mimetype
* - encrypted
* - versioned

View File

@ -478,10 +478,6 @@ class Filesystem {
return self::$defaultInstance->file_exists($path);
}
static public function filectime($path) {
return self::$defaultInstance->filectime($path);
}
static public function filemtime($path) {
return self::$defaultInstance->filemtime($path);
}

View File

@ -74,10 +74,6 @@ abstract class Common extends \OC\Files\Storage\Storage {
return $permissions;
}
// abstract public function file_exists($path);
public function filectime($path) {
$stat = $this->stat($path);
return $stat['ctime'];
}
public function filemtime($path) {
$stat = $this->stat($path);
return $stat['mtime'];

View File

@ -66,9 +66,6 @@ class Local extends \OC\Files\Storage\Common{
public function file_exists($path) {
return file_exists($this->datadir.$path);
}
public function filectime($path) {
return filectime($this->datadir.$path);
}
public function filemtime($path) {
return filemtime($this->datadir.$path);
}

View File

@ -29,7 +29,6 @@ abstract class Storage{
abstract public function isSharable($path);
abstract public function getPermissions($path);
abstract public function file_exists($path);
abstract public function filectime($path);
abstract public function filemtime($path);
abstract public function file_get_contents($path);
abstract public function file_put_contents($path,$data);

View File

@ -236,10 +236,6 @@ class View {
return $this->basicOperation('file_exists', $path);
}
public function filectime($path) {
return $this->basicOperation('filectime', $path);
}
public function filemtime($path) {
return $this->basicOperation('filemtime', $path);
}

View File

@ -306,13 +306,6 @@ class OC_Filesystem {
return \OC\Files\Filesystem::file_exists($path);
}
/**
* @deprecated OC_Filesystem is replaced by \OC\Files\Filesystem
*/
static public function filectime($path) {
return \OC\Files\Filesystem::filectime($path);
}
/**
* @deprecated OC_Filesystem is replaced by \OC\Files\Filesystem
*/