略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: TokyoTyrant::__construct

2024-11-15

TokyoTyrant::__construct

(PECL tokyo_tyrant >= 0.1.0)

TokyoTyrant::__constructConstruct a new TokyoTyrant object

说明

public TokyoTyrant::__construct ([ string $host [, int $port = TokyoTyrant::RDBDEF_PORT [, array $options ]]] )

Constructs a new TokyoTyrant object and optionally connects to the database

参数

host

The hostname. Default: NULL

port

port number. Default: 1978

options

Connection options: timeout (default: 5.0), reconnect (default: TRUE) and persistent (default: TRUE)

返回值

Throws TokyoTyrantException if connection to database fails

参见

add a note add a note

User Contributed Notes 1 note

up
0
bit dot kevin at gmail dot com
8 years ago
Catch The Exception
<?php
       
try {
           
$tt = new TokyoTyrant("192.168.1.100", 11211);
        }catch (
TokyoTyrantException $e) {
           
var_dump($e);
            exit;
        }
?>

官方地址:https://www.php.net/manual/en/tokyotyrant.construct.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3