ALIOSS::set_host_name PHP Метод

set_host_name() публичный Метод

设置host地址
С версии: 2012-06-11
Автор: [email protected]
public set_host_name ( string $hostname, integer $port = null ) : void
$hostname string host name
$port integer int
Результат void
    public function set_host_name($hostname, $port = null)
    {
        $this->hostname = $hostname;
        if ($port) {
            $this->port = $port;
            $this->hostname .= ':' . $port;
        }
    }

Usage Example

Пример #1
0
 function ftp_get($file, $path)
 {
     $obj = new ALIOSS();
     $obj->set_host_name($this->hostname, $this->port);
     $obj->set_debug_mode(FALSE);
     $bucket = $this->bucket;
     $file = jishigou_oss::clear($file);
     $path = jishigou_oss::clear($path);
     $options = array(ALIOSS::OSS_FILE_DOWNLOAD => $path);
     $response = $obj->get_object($bucket, $file, $options);
     $rt = jishigou_oss::status($response);
     return $rt == '2' ? 1 : 0;
 }