/** * {@inheritdoc} */ protected function normalizeObject(DataObject $object) { $name = $object->getName(); $name = $this->removePathPrefix($name); $mimetype = explode('; ', $object->getContentType()); return ['type' => in_array('application/directory', $mimetype) ? 'dir' : 'file', 'dirname' => Util::dirname($name), 'path' => $name, 'timestamp' => strtotime($object->getLastModified()), 'mimetype' => reset($mimetype), 'size' => $object->getContentLength()]; }
/** * Normalize a DataObject * * @param DataObject $object * @return array file metadata */ protected function normalizeObject(DataObject $object) { $name = $object->getName(); if ($this->prefix) { $name = substr($name, strlen($this->prefix)); } $mimetype = explode('; ', $object->getContentType()); return array('type' => 'file', 'dirname' => Util::dirname($name), 'path' => $name, 'timestamp' => strtotime($object->getLastModified()), 'mimetype' => reset($mimetype), 'size' => $object->getContentLength()); }