/** * Construct a new Gallery3 instance associated with a remote resource * @param string remote url * @param string authentication token * @return object Gallery3 */ public function factory($url = null, $token = null) { $obj = new Gallery3(); $obj->token = $token; $obj->url = $url; if ($url && $token) { $obj->load(); } return $obj; }