@@ -125,7 +125,7 @@ public function writeFile($path, $file, $opts = NULL) {/*{{{*/
125125 if (!is_null ($ this ->_file_secret )) array_push ($ opts , self ::$ CONTENT_SECRET . " {$ this ->_file_secret }" );
126126 }
127127
128- $ this ->_do_request ('PUT ' , $ path , $ opts , $ file );
128+ return $ this ->_do_request ('PUT ' , $ path , $ opts , $ file );
129129 }/*}}}*/
130130
131131 /**
@@ -143,11 +143,10 @@ public function readFile($path, $file_handle = NULL) {/*{{{*/
143143 * 获取目录文件列表
144144 *
145145 * @param string $path 查询路径
146- * @param string $format 返回数据格式
147146 *
148147 * @return mixed
149148 */
150- public function getList ($ path, $ format = NULL ) {/*{{{*/
149+ public function getList ($ path ) {/*{{{*/
151150 $ rsp = $ this ->_do_request ('GET ' , $ path );
152151
153152 $ list = array ();
@@ -169,12 +168,7 @@ public function getList($path, $format = NULL) {/*{{{*/
169168 }
170169 }
171170
172- if (is_null ($ format )) {
173- return $ list ;
174- }
175- elseif ($ format == 'json ' ) {
176- return json_encode (array ('data ' => $ list ));
177- }
171+ return $ list ;
178172 }/*}}}*/
179173
180174 /**
@@ -193,15 +187,11 @@ public function getFolderUsage($path) {/*{{{*/
193187 * 获取文件、目录信息
194188 *
195189 * @param string $path 路径
196- * @param string $format 返回数据格式
197190 *
198191 * @return mixed
199192 */
200- public function head ($ path, $ format = NULL ) {/*{{{*/
193+ public function head ($ path ) {/*{{{*/
201194 $ rsp = $ this ->_do_request ('HEAD ' , $ path );
202- if ($ format == 'json ' ) {
203- return json_encode ($ rsp );
204- }
205195
206196 return $ rsp ;
207197 }/*}}}*/
@@ -299,11 +289,15 @@ protected function _do_request($method, $path, $headers = NULL, $body= NULL, $fi
299289 if ($ method == 'GET ' && is_null ($ file_handle )) {
300290 return $ body ;
301291 }
302- elseif ( $ method == ' HEAD ' ) {
303- //return $this->_get_headers_data(substr($response, 0 , $header_size) );
304- return $ this -> _getHeadersData ( $ header_string ) ;
292+ else {
293+ $ data = $ this ->_getHeadersData ( $ header_string );
294+ return count ( $ data ) > 0 ? $ data : true ;
305295 }
306- return True ;
296+ //elseif ($method == 'HEAD') {
297+ // //return $this->_get_headers_data(substr($response, 0 , $header_size));
298+ // return $this->_getHeadersData($header_string);
299+ //}
300+ //return True;
307301 }
308302 else {
309303 $ message = $ this ->_getErrorMessage ($ header_string );
0 commit comments