Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
2,411 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI']; | ||
include('./index.php'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
if ( ! defined('BASE_PATH')) exit('No direct script access allowed'); | ||
|
||
/** | ||
* 封装SAE storage | ||
* */ | ||
class StorageHandle{ | ||
|
||
public $instance; | ||
|
||
public $domain; | ||
|
||
public function __construct(){ | ||
$this->domain = DOMAIN; | ||
require dirname(__FILE__).'/bcs/bcs.class.php'; | ||
$this->instance = new BaiduBCS(); | ||
} | ||
|
||
public function exists($filename){ | ||
return $this->instance->is_object_exist($this->domain,$this->get_file($filename)); | ||
} | ||
//这里是效率瓶颈啊!! | ||
public function read($filename){ | ||
return $this->instance->get_object($this->domain,$this->get_file($filename)); | ||
} | ||
|
||
public function write($name,$content){ | ||
return $this->instance->create_object_by_content($this->domain,$this->get_file($name),$content); | ||
} | ||
|
||
public function url($name){ | ||
//return $this->instance->getUrl($this->domain,$this->get_file($name)); | ||
return 'http://bcs.duapp.com/'.$this->domain.$this->get_file($name); | ||
} | ||
|
||
public function error(){ | ||
return false; | ||
} | ||
|
||
public function delete($name){ | ||
return $this->instance->delete_object($this->domain,$name); | ||
} | ||
|
||
private function get_file($name){ | ||
return '/'.ltrim($name,'/'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.