2012-02-18 06:56:20 +04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* ownCloud
|
|
|
|
*
|
|
|
|
* @author Michael Gapczynski
|
|
|
|
* @copyright 2012 Michael Gapczynski mtgap@owncloud.com
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 3 of the License, or any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2012-02-29 04:15:49 +04:00
|
|
|
require_once 'common.inc.php';
|
|
|
|
|
|
|
|
class OC_Filestorage_Google extends OC_Filestorage_Common {
|
2012-02-27 23:59:41 +04:00
|
|
|
|
|
|
|
private $consumer;
|
|
|
|
private $oauth_token;
|
|
|
|
private $sig_method;
|
2012-02-29 04:15:49 +04:00
|
|
|
private $entries;
|
2012-02-27 23:59:41 +04:00
|
|
|
|
|
|
|
public function __construct($arguments) {
|
|
|
|
$consumer_key = isset($arguments['consumer_key']) ? $arguments['consumer_key'] : 'anonymous';
|
|
|
|
$consumer_secret = isset($arguments['consumer_secret']) ? $arguments['consumer_secret'] : 'anonymous';
|
|
|
|
$this->consumer = new OAuthConsumer($consumer_key, $consumer_secret);
|
|
|
|
$this->oauth_token = new OAuthToken($arguments['token'], $arguments['token_secret']);
|
|
|
|
$this->sig_method = new OAuthSignatureMethod_HMAC_SHA1();
|
2012-02-29 04:15:49 +04:00
|
|
|
$this->entries = array();
|
2012-02-27 23:59:41 +04:00
|
|
|
}
|
|
|
|
|
2012-03-24 22:49:44 +04:00
|
|
|
private function sendRequest($feedUri, $http_method, $isDownload = false, $postData = null) {
|
2012-02-27 23:59:41 +04:00
|
|
|
$feedUri = trim($feedUri);
|
|
|
|
// create an associative array from each key/value url query param pair.
|
|
|
|
$params = array();
|
|
|
|
$pieces = explode('?', $feedUri);
|
|
|
|
if (isset($pieces[1])) {
|
|
|
|
$params = explode_assoc('=', '&', $pieces[1]);
|
|
|
|
}
|
|
|
|
// urlencode each url parameter key/value pair
|
|
|
|
$tempStr = $pieces[0];
|
|
|
|
foreach ($params as $key => $value) {
|
|
|
|
$tempStr .= '&' . urlencode($key) . '=' . urlencode($value);
|
|
|
|
}
|
|
|
|
$feedUri = preg_replace('/&/', '?', $tempStr, 1);
|
2012-03-24 22:49:44 +04:00
|
|
|
$request = OAuthRequest::from_consumer_and_token($this->consumer, $this->oauth_token, $http_method, $feedUri, $params);
|
|
|
|
$request->sign_request($this->sig_method, $this->consumer, $this->oauth_token);
|
|
|
|
$auth_header = $request->to_header();
|
|
|
|
$headers = array($auth_header, 'Content-Type: application/atom+xml', 'GData-Version: 3.0');
|
|
|
|
$curl = curl_init($feedUri);
|
|
|
|
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
|
|
|
curl_setopt($curl, CURLOPT_FAILONERROR, false);
|
|
|
|
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
|
|
|
|
switch ($http_method) {
|
|
|
|
case 'GET':
|
|
|
|
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
|
|
|
|
break;
|
|
|
|
case 'POST':
|
|
|
|
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
|
|
|
|
curl_setopt($curl, CURLOPT_POST, 1);
|
|
|
|
curl_setopt($curl, CURLOPT_POSTFIELDS, $postData);
|
|
|
|
break;
|
|
|
|
case 'PUT':
|
|
|
|
$headers[] = 'If-Match: *';
|
|
|
|
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
|
|
|
|
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $http_method);
|
|
|
|
curl_setopt($curl, CURLOPT_POSTFIELDS, $postData);
|
|
|
|
break;
|
|
|
|
case 'DELETE':
|
|
|
|
$headers[] = 'If-Match: *';
|
|
|
|
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
|
|
|
|
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $http_method);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
|
|
|
|
}
|
|
|
|
if ($isDownload) {
|
2012-05-02 14:54:31 +04:00
|
|
|
$tmpFile = OCP\Files::tmpFile();
|
2012-03-24 22:49:44 +04:00
|
|
|
$fp = fopen($tmpFile, 'w');
|
|
|
|
curl_setopt($curl, CURLOPT_FILE, $fp);
|
|
|
|
curl_exec($curl);
|
|
|
|
curl_close($curl);
|
|
|
|
return $tmpFile;
|
2012-02-27 23:59:41 +04:00
|
|
|
}
|
2012-03-24 22:49:44 +04:00
|
|
|
$result = curl_exec($curl);
|
|
|
|
curl_close($curl);
|
2012-02-27 23:59:41 +04:00
|
|
|
$dom = new DOMDocument();
|
|
|
|
$dom->loadXML($result);
|
|
|
|
return $dom;
|
|
|
|
}
|
|
|
|
|
|
|
|
private function getResource($path) {
|
2012-03-24 22:49:44 +04:00
|
|
|
$file = basename($path);
|
|
|
|
if (array_key_exists($file, $this->entries)) {
|
|
|
|
return $this->entries[$file];
|
2012-02-29 04:15:49 +04:00
|
|
|
} else {
|
2012-03-24 22:49:44 +04:00
|
|
|
// Strip the file extension; file could be a native Google Docs resource
|
|
|
|
if ($pos = strpos($file, '.')) {
|
|
|
|
$title = substr($file, 0, $pos);
|
|
|
|
$dom = $this->sendRequest('https://docs.google.com/feeds/default/private/full?showfolders=true&title='.$title, 'GET');
|
|
|
|
// Check if request was successful and entry exists
|
|
|
|
if ($dom && $entry = $dom->getElementsByTagName('entry')->item(0)) {
|
|
|
|
$this->entries[$file] = $entry;
|
|
|
|
return $entry;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$dom = $this->sendRequest('https://docs.google.com/feeds/default/private/full?showfolders=true&title='.$file, 'GET');
|
2012-02-29 04:15:49 +04:00
|
|
|
// Check if request was successful and entry exists
|
|
|
|
if ($dom && $entry = $dom->getElementsByTagName('entry')->item(0)) {
|
2012-03-24 22:49:44 +04:00
|
|
|
$this->entries[$file] = $entry;
|
2012-02-29 04:15:49 +04:00
|
|
|
return $entry;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2012-02-27 23:59:41 +04:00
|
|
|
}
|
|
|
|
|
2012-02-29 04:15:49 +04:00
|
|
|
private function getExtension($entry) {
|
|
|
|
$mimetype = $this->getMimeType('', $entry);
|
2012-03-24 22:49:44 +04:00
|
|
|
switch ($mimetype) {
|
2012-02-29 04:15:49 +04:00
|
|
|
case 'httpd/unix-directory':
|
|
|
|
return '';
|
|
|
|
case 'application/vnd.oasis.opendocument.text':
|
|
|
|
return 'odt';
|
|
|
|
case 'application/vnd.oasis.opendocument.spreadsheet':
|
|
|
|
return 'ods';
|
|
|
|
case 'application/vnd.oasis.opendocument.presentation':
|
|
|
|
return 'pptx';
|
|
|
|
case 'text/html':
|
|
|
|
return 'html';
|
|
|
|
default:
|
|
|
|
return 'html';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-02-27 23:59:41 +04:00
|
|
|
public function mkdir($path) {
|
|
|
|
$dir = dirname($path);
|
|
|
|
// Check if path parent is root directory
|
|
|
|
if ($dir == '/' || $dir == '\.' || $dir == '.') {
|
|
|
|
$feedUri = 'https://docs.google.com/feeds/default/private/full';
|
|
|
|
// Get parent content link
|
2012-02-29 04:15:49 +04:00
|
|
|
} else if ($dom = $this->getResource(basename($dir))) {
|
2012-02-27 23:59:41 +04:00
|
|
|
$feedUri = $dom->getElementsByTagName('content')->item(0)->getAttribute('src');
|
|
|
|
}
|
2012-02-29 04:15:49 +04:00
|
|
|
if (isset($feedUri)) {
|
|
|
|
$title = basename($path);
|
|
|
|
// Construct post data
|
|
|
|
$postData = '<?xml version="1.0" encoding="UTF-8"?>';
|
|
|
|
$postData .= '<entry xmlns="http://www.w3.org/2005/Atom">';
|
|
|
|
$postData .= '<category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/docs/2007#folder"/>';
|
|
|
|
$postData .= '<title>'.$title.'</title>';
|
|
|
|
$postData .= '</entry>';
|
|
|
|
if ($dom = $this->sendRequest($feedUri, 'POST', $postData)) {
|
|
|
|
return true;
|
|
|
|
}
|
2012-02-27 23:59:41 +04:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2012-02-18 06:56:20 +04:00
|
|
|
|
2012-02-27 23:59:41 +04:00
|
|
|
public function rmdir($path) {
|
|
|
|
return $this->unlink($path);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function opendir($path) {
|
|
|
|
if ($path == '' || $path == '/') {
|
2012-02-29 04:15:49 +04:00
|
|
|
$next = 'https://docs.google.com/feeds/default/private/full/folder%3Aroot/contents';
|
2012-02-27 23:59:41 +04:00
|
|
|
} else {
|
2012-02-29 04:15:49 +04:00
|
|
|
if ($entry = $this->getResource($path)) {
|
2012-02-29 22:18:19 +04:00
|
|
|
$next = $entry->getElementsByTagName('content')->item(0)->getAttribute('src');
|
2012-02-29 04:15:49 +04:00
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
2012-02-27 23:59:41 +04:00
|
|
|
}
|
|
|
|
$files = array();
|
2012-02-29 04:15:49 +04:00
|
|
|
while ($next) {
|
|
|
|
$dom = $this->sendRequest($next, 'GET');
|
|
|
|
$links = $dom->getElementsByTagName('link');
|
|
|
|
foreach ($links as $link) {
|
|
|
|
if ($link->getAttribute('rel') == 'next') {
|
|
|
|
$next = $link->getAttribute('src');
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
$next = false;
|
|
|
|
}
|
|
|
|
}
|
2012-02-27 23:59:41 +04:00
|
|
|
$entries = $dom->getElementsByTagName('entry');
|
2012-02-29 04:15:49 +04:00
|
|
|
foreach ($entries as $entry) {
|
2012-02-27 23:59:41 +04:00
|
|
|
$name = $entry->getElementsByTagName('title')->item(0)->nodeValue;
|
2012-02-29 04:15:49 +04:00
|
|
|
// Google Docs resources don't always include extensions in title
|
2012-02-27 23:59:41 +04:00
|
|
|
if (!strpos($name, '.')) {
|
2012-03-24 22:49:44 +04:00
|
|
|
$extension = $this->getExtension($entry);
|
|
|
|
if ($extension != '') {
|
|
|
|
$name .= '.'.$extension;
|
|
|
|
}
|
2012-02-27 23:59:41 +04:00
|
|
|
}
|
|
|
|
$files[] = $name;
|
2012-02-29 04:15:49 +04:00
|
|
|
// Cache entry for future use
|
|
|
|
$this->entries[$name] = $entry;
|
2012-02-27 23:59:41 +04:00
|
|
|
}
|
2012-02-29 04:15:49 +04:00
|
|
|
}
|
|
|
|
OC_FakeDirStream::$dirs['google'] = $files;
|
2012-02-27 23:59:41 +04:00
|
|
|
return opendir('fakedir://google');
|
|
|
|
}
|
|
|
|
|
2012-02-29 04:15:49 +04:00
|
|
|
public function stat($path) {
|
|
|
|
if ($path == '' || $path == '/') {
|
|
|
|
$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;
|
2012-03-24 22:49:44 +04:00
|
|
|
// 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);
|
2012-02-29 04:15:49 +04:00
|
|
|
$stat['mtime'] = strtotime($entry->getElementsByTagName('updated')->item(0)->nodeValue);
|
|
|
|
$stat['ctime'] = strtotime($entry->getElementsByTagName('published')->item(0)->nodeValue);
|
|
|
|
}
|
2012-03-24 22:49:44 +04:00
|
|
|
if (isset($stat)) {
|
|
|
|
return $stat;
|
|
|
|
}
|
|
|
|
return false;
|
2012-02-29 04:15:49 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
public function filetype($path) {
|
|
|
|
if ($path == '' || $path == '/') {
|
|
|
|
return 'dir';
|
|
|
|
} else if ($entry = $this->getResource($path)) {
|
2012-02-27 23:59:41 +04:00
|
|
|
$categories = $entry->getElementsByTagName('category');
|
|
|
|
foreach ($categories as $category) {
|
|
|
|
if ($category->getAttribute('scheme') == 'http://schemas.google.com/g/2005#kind') {
|
|
|
|
$type = $category->getAttribute('label');
|
|
|
|
if (strlen(strstr($type, 'folder')) > 0) {
|
2012-02-29 04:15:49 +04:00
|
|
|
return 'dir';
|
|
|
|
} else {
|
|
|
|
return 'file';
|
2012-02-27 23:59:41 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function is_readable($path) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function is_writable($path) {
|
2012-02-29 04:15:49 +04:00
|
|
|
if ($path == '' || $path == '/') {
|
|
|
|
return true;
|
|
|
|
} else if ($entry = $this->getResource($path)) {
|
|
|
|
// Check if edit or edit-media links exist
|
2012-02-27 23:59:41 +04:00
|
|
|
$links = $entry->getElementsByTagName('link');
|
|
|
|
foreach ($links as $link) {
|
|
|
|
if ($link->getAttribute('rel') == 'edit') {
|
|
|
|
return true;
|
|
|
|
} else if ($link->getAttribute('rel') == 'edit-media') {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2012-02-18 06:56:20 +04:00
|
|
|
|
2012-02-27 23:59:41 +04:00
|
|
|
public function file_exists($path) {
|
2012-02-29 04:15:49 +04:00
|
|
|
if ($path == '' || $path == '/') {
|
|
|
|
return true;
|
|
|
|
} else if ($this->getResource($path)) {
|
2012-02-27 23:59:41 +04:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function unlink($path) {
|
|
|
|
// Get resource self link to trash resource
|
|
|
|
if ($entry = $this->getResource($path)) {
|
|
|
|
$links = $entry->getElementsByTagName('link');
|
|
|
|
foreach ($links as $link) {
|
|
|
|
if ($link->getAttribute('rel') == 'self') {
|
|
|
|
$feedUri = $link->getAttribute('href');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (isset($feedUri)) {
|
|
|
|
$this->sendRequest($feedUri, 'DELETE');
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-02-29 04:15:49 +04:00
|
|
|
public function rename($path1, $path2) {
|
|
|
|
// TODO Add support for moving to different collections
|
|
|
|
// Get resource edit link to rename resource
|
|
|
|
if ($entry = $this->getResource($path1)) {
|
|
|
|
$etag = $entry->getElementsByTagName('entry')->item(0)->getAttribute('gd:etag');
|
|
|
|
$links = $entry->getElementsByTagName('link');
|
|
|
|
foreach ($links as $link) {
|
|
|
|
if ($link->getAttribute('rel') == 'edit') {
|
|
|
|
$feedUri = $link->getAttribute('href');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (isset($etag) && isset($feedUri)) {
|
|
|
|
$title = basename($path2);
|
|
|
|
// Construct post data
|
|
|
|
$postData = '<?xml version="1.0" encoding="UTF-8"?>';
|
|
|
|
$postData .= '<entry xmlns="http://www.w3.org/2005/Atom" xmlns:docs="http://schemas.google.com/docs/2007" xmlns:gd="http://schemas.google.com/g/2005" gd:etag='.$etag.'>';
|
|
|
|
$postData .= '<title>'.$title.'</title>';
|
|
|
|
$postData .= '</entry>';
|
|
|
|
$this->sendRequest($feedUri, 'PUT', $postData);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
2012-02-27 23:59:41 +04:00
|
|
|
}
|
|
|
|
|
2012-02-29 04:15:49 +04:00
|
|
|
public function fopen($path, $mode) {
|
|
|
|
if ($entry = $this->getResource($path)) {
|
2012-03-24 22:49:44 +04:00
|
|
|
switch ($mode) {
|
|
|
|
case 'r':
|
|
|
|
case 'rb':
|
|
|
|
$extension = $this->getExtension($entry);
|
|
|
|
$downloadUri = $entry->getElementsByTagName('content')->item(0)->getAttribute('src');
|
|
|
|
// TODO Non-native documents don't need these additional parameters
|
|
|
|
$downloadUri .= '&exportFormat='.$extension.'&format='.$extension;
|
|
|
|
$tmpFile = $this->sendRequest($downloadUri, 'GET', true);
|
|
|
|
return fopen($tmpFile, 'r');
|
|
|
|
case 'w':
|
|
|
|
case 'wb':
|
|
|
|
case 'a':
|
|
|
|
case 'ab':
|
|
|
|
case 'r+':
|
|
|
|
case 'w+':
|
|
|
|
case 'wb+':
|
|
|
|
case 'a+':
|
|
|
|
case 'x':
|
|
|
|
case 'x+':
|
|
|
|
case 'c':
|
|
|
|
case 'c+':
|
|
|
|
// TODO Edit documents
|
|
|
|
}
|
|
|
|
|
2012-02-29 04:15:49 +04:00
|
|
|
}
|
2012-03-24 22:49:44 +04:00
|
|
|
return false;
|
2012-02-27 23:59:41 +04:00
|
|
|
}
|
|
|
|
|
2012-02-29 04:15:49 +04:00
|
|
|
public function getMimeType($path, $entry = null) {
|
2012-03-24 22:49:44 +04:00
|
|
|
// Entry can be passed, because extension is required for opendir and the entry can't be cached without the extension
|
2012-02-29 04:15:49 +04:00
|
|
|
if ($entry == null) {
|
|
|
|
if ($path == '' || $path == '/') {
|
|
|
|
return 'httpd/unix-directory';
|
|
|
|
} else {
|
|
|
|
$entry = $this->getResource($path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ($entry) {
|
|
|
|
$mimetype = $entry->getElementsByTagName('content')->item(0)->getAttribute('type');
|
|
|
|
// Native Google Docs resources often default to text/html, but it may be more useful to default to a corresponding ODF mimetype
|
|
|
|
// Collections get reported as application/atom+xml, make sure it actually is a folder and fix the mimetype
|
2012-03-24 22:49:44 +04:00
|
|
|
if ($mimetype == 'text/html' || $mimetype == 'application/atom+xml;type=feed') {
|
2012-02-29 04:15:49 +04:00
|
|
|
$categories = $entry->getElementsByTagName('category');
|
|
|
|
foreach ($categories as $category) {
|
|
|
|
if ($category->getAttribute('scheme') == 'http://schemas.google.com/g/2005#kind') {
|
|
|
|
$type = $category->getAttribute('label');
|
|
|
|
if (strlen(strstr($type, 'folder')) > 0) {
|
|
|
|
return 'httpd/unix-directory';
|
|
|
|
} else if (strlen(strstr($type, 'document')) > 0) {
|
|
|
|
return 'application/vnd.oasis.opendocument.text';
|
|
|
|
} else if (strlen(strstr($type, 'spreadsheet')) > 0) {
|
|
|
|
return 'application/vnd.oasis.opendocument.spreadsheet';
|
|
|
|
} else if (strlen(strstr($type, 'presentation')) > 0) {
|
|
|
|
return 'application/vnd.oasis.opendocument.presentation';
|
|
|
|
} else if (strlen(strstr($type, 'drawing')) > 0) {
|
|
|
|
return 'application/vnd.oasis.opendocument.graphics';
|
|
|
|
} else {
|
|
|
|
// If nothing matches return text/html, all native Google Docs resources can be exported as text/html
|
|
|
|
return 'text/html';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $mimetype;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2012-02-27 23:59:41 +04:00
|
|
|
|
|
|
|
public function free_space($path) {
|
|
|
|
if ($dom = $this->sendRequest('https://docs.google.com/feeds/metadata/default', 'GET')) {
|
2012-02-29 04:15:49 +04:00
|
|
|
// NOTE: Native Google Docs resources don't count towards quota
|
2012-02-27 23:59:41 +04:00
|
|
|
$total = $dom->getElementsByTagNameNS('http://schemas.google.com/g/2005', 'quotaBytesTotal')->item(0)->nodeValue;
|
|
|
|
$used = $dom->getElementsByTagNameNS('http://schemas.google.com/g/2005', 'quotaBytesUsed')->item(0)->nodeValue;
|
|
|
|
return $total - $used;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-03-24 22:49:44 +04:00
|
|
|
public function touch($path, $mtime = null) {
|
|
|
|
|
2012-02-27 23:59:41 +04:00
|
|
|
}
|
2012-02-29 04:15:49 +04:00
|
|
|
|
2012-02-18 06:56:20 +04:00
|
|
|
}
|