Store FileInfo::getType() result for future use

remotes/origin/log-external-deletes
Robin McCorkell 11 years ago
parent 44c330aa5d
commit a79757bc37
  1. 7
      lib/private/files/fileinfo.php

@ -159,11 +159,10 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
* @return \OCP\Files\FileInfo::TYPE_FILE|\OCP\Files\FileInfo::TYPE_FOLDER
*/
public function getType() {
if (isset($this->data['type'])) {
return $this->data['type'];
} else {
return $this->getMimetype() === 'httpd/unix-directory' ? self::TYPE_FOLDER : self::TYPE_FILE;
if (!isset($this->data['type'])) {
$this->data['type'] = ($this->getMimetype() === 'httpd/unix-directory') ? self::TYPE_FOLDER : self::TYPE_FILE;
}
return $this->data['type'];
}
public function getData() {

Loading…
Cancel
Save