lib/Traceguide.php
public static function initialize($group_name, $access_token, $opts = null) {

        if (!is_string($group_name) || strlen($group_name) == 0) {
            throw new Exception("Invalid group_name");
        }
        if (!is_string($access_token) || strlen($access_token) == 0) {
            throw new Exception("Invalid access_token");
        }

        // If the singleton has already been created, treat the initialization
        // as an options() call instead.
        if (isset(self::$_singleton)) {
            if (!isset($opts)) {
                $opts = array();
            }
            self::$_singleton->options(array_merge($opts, array(
                'group_name' => $group_name,
                'access_token' => $access_token,
            )));
        } else {
            self::$_singleton = self::newRuntime($group_name, $access_token, $opts);
        }
        return self::$_singleton;
    }
public static function initialize($group_name, $access_token, $opts = null) {

        if (!is_string($group_name) || strlen($group_name) == 0) {
            throw new Exception("Invalid group_name");
        }
        if (!is_string($access_token) || strlen($access_token) == 0) {
            throw new Exception("Invalid access_token");
        }

        // If the singleton has already been created, treat the initialization
        // as an options() call instead.
        if (isset(self::$_singleton)) {
            if (!isset($opts)) {
                $opts = array();
            }
            self::$_singleton->options(array_merge($opts, array(
                'group_name' => $group_name,
                'access_token' => $access_token,
            )));
        } else {
            self::$_singleton = self::newRuntime($group_name, $access_token, $opts);
        }
        return self::$_singleton;
    }
public static function initialize ( $ group_name , $ access_token , $ opts = null ) { if ( ! is_string ( $ group_name ) || strlen ( $ group_name ) == 0 ) { throw new Exception ( "Invalid group_name" ) ; } if ( ! is_string ( $ access_token ) || strlen ( $ access_token ) == 0 ) { throw new Exception ( "Invalid access_token" ) ; } // If the singleton has already been created, treat the initialization // as an options() call instead. if ( isset ( self :: $ _singleton ) ) { if ( ! isset ( $ opts ) ) { $ opts = array ( ) ; } self :: $ _singleton -> options ( array_merge ( $ opts , array ( 'group_name' => $ group_name , 'access_token' => $ access_token , ) ) ) ; } else { self :: $ _singleton = self :: newRuntime ( $ group_name , $ access_token , $ opts ) ; } return self :: $ _singleton ; }
Initializes and returns the singleton instance of the Runtime.

For convenience, multiple calls to initialize are allowed. For example,
in library code with more than possible first entry-point, this may
be helpful.

@return \TraceguideBase\Runtime
@throws Exception if the group name or access token is not a valid string
@throws Exception if the runtime singleton has already been initialized
Initializes and returns the singleton instance of the Runtime .