src/login_github.php
public static function signup($user_id, $info) {
	if (empty($info['github_username']) || empty($info['oauth_token']) || empty($info['scope'])) {
		$exception = bootstrap::get_library('exception');
		throw new $exception('all info from ::is_valid() is needed for signup');
	}
	
	$mysql = bootstrap::get_library('mysql');
	
	$sql = "INSERT INTO `login_github` SET
		`user_id` = %d,
		`github_username` = '%s',
		`oauth_token` = '%s',
		`scope` = '%s'
	;";
	$binds = [$user_id, $info['github_username'], $info['oauth_token'], $info['scope']];
	$mysql::query($sql, $binds);
	
	return new static($mysql::$insert_id);
}
public static function signup($user_id, $info) {
	if (empty($info['github_username']) || empty($info['oauth_token']) || empty($info['scope'])) {
		$exception = bootstrap::get_library('exception');
		throw new $exception('all info from ::is_valid() is needed for signup');
	}
	
	$mysql = bootstrap::get_library('mysql');
	
	$sql = "INSERT INTO `login_github` SET
		`user_id` = %d,
		`github_username` = '%s',
		`oauth_token` = '%s',
		`scope` = '%s'
	;";
	$binds = [$user_id, $info['github_username'], $info['oauth_token'], $info['scope']];
	$mysql::query($sql, $binds);
	
	return new static($mysql::$insert_id);
}
public static function signup ( $ user_id , $ info ) { if ( empty ( $ info [ 'github_username' ] ) || empty ( $ info [ 'oauth_token' ] ) || empty ( $ info [ 'scope' ] ) ) { $ exception = bootstrap :: get_library ( 'exception' ) ; throw new $ exception ( 'all info from ::is_valid() is needed for signup' ) ; } $ mysql = bootstrap :: get_library ( 'mysql' ) ; $ sql = "INSERT INTO `login_github` SET
		`user_id` = %d,
		`github_username` = '%s',
		`oauth_token` = '%s',
		`scope` = '%s'
	;" ; $ binds = [ $ user_id , $ info [ 'github_username' ] , $ info [ 'oauth_token' ] , $ info [ 'scope' ] ] ; $ mysql :: query ( $ sql , $ binds ) ; return new static ( $ mysql :: $ insert_id ) ; }
adds a new login connection between a local user and a github account

@param  int     $user_id
@param  array   $info          as returned by ::is_valid()
@return $this
adds a new login connection between a local user and a github account