Dsn.class.php 568 Bytes
<?php

class Util_Gearman_Dsn {
	
	/**
	 * workers || jobs
	 *
	 * @param String $section
	 * @return Array
	 */
	public static function getServers($section = 'servers') {
		$maindriver = 'Clouds'; // 类型
		$subdriver = 'Gearman'; // 驱动
		$options = array ('section' => $section ); // 驱动类型
		$server = Util_Server::factory ( $maindriver, $subdriver, $options );
		if (empty ( $server )) {
			throw new Util_Dao_Exception ( $section . ' config is null ,find: ' . $subdriver . ' No such config file ' );
		}
		return (array) $server->loadServers();
	}
	
}