本文整理匯總了PHP中XPClass::toString方法的典型用法代碼示例。如果您正苦於以下問題:PHP XPClass::toString方法的具體用法?PHP XPClass::toString怎麽用?PHP XPClass::toString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XPClass
的用法示例。
在下文中一共展示了XPClass::toString方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: register
/**
* Register transport implementation for a specific scheme
*
* @param string scheme
* @param lang.XPClass<peer.http.HttpTransport> class
*/
public static function register($scheme, XPClass $class)
{
if (!$class->isSubclassOf('peer.http.HttpTransport')) {
throw new IllegalArgumentException(sprintf('Given argument must be lang.XPClass<peer.http.HttpTransport>, %s given', $class->toString()));
}
self::$transports[$scheme] = $class;
}
示例2: register
/**
* Register a driver
*
* Usage:
* <code>
* DriverManager::register('mydb', XPClass::forName('my.db.Connection'));
* // [...]
* $conn= DriverManager::getConnection('mydb://...');
* </code>
*
* @param string name identifier
* @param lang.XPClass<rdbms.DBConnection> class
* @throws lang.IllegalArgumentException in case an incorrect class is given
*/
public static function register($name, XPClass $class)
{
if (!$class->isSubclassOf('rdbms.DBConnection')) {
throw new IllegalArgumentException(sprintf('Given argument must be lang.XPClass<rdbms.DBConnection>, %s given', $class->toString()));
}
self::$instance->drivers[$name] = $class;
self::$instance->lookup = array();
}