Welcome Guest, Not a member yet? Register   Sign In
integrate gapi in codeigniter
#1

[eluser]fefe[/eluser]
Hello

Is anybody has successfully integrated the gapi as library in codeigniter.I'm trying to do that but as I debuge it the variable are not passed to the library
in my controller i'm initilaizing the library
Code:
$this->load->library( 'gapi', array( 'email' => "email",'password' => "pass" ));


than normally the gapis class construct method shoul pick up the this 2 variables but actually doesn't happening.
#2

[eluser]Alface[/eluser]
I will try to do it here too
#3

[eluser]fefe[/eluser]
hi!

I found a viable solution to the problem. After googling a while I was finding the following post.Is not hundred% what I want but whit a bit of hard-coding you can achieve results.
http://somethingstatic.com/google-analyt...deigniter/
#4

[eluser]Alface[/eluser]
Rename the file gapi.class.php to gapi.php
Rename the class form "gapi" to "Gapi"

Replace:
Code:
public function __construct($email, $password, $token=null)
  {
    if($token !== null)
    {
      $this->auth_token = $token;
    }
    else
    {
      $this->authenticateUser($email,$password);
    }
  }

Code:
public function __construct($params)
  {
    $email = (isset($params['email']))?$params['email']:NULL;
    $password = (isset($params['password']))?$params['password']:NULL;
    $token = (isset($params['token']))?$params['token']:NULL;
    
    if($token !== null)
    {
      $this->auth_token = $token;
    }
    else
    {
      $this->authenticateUser($email,$password);
    }
  }

It is loading with no errors here.
#5

[eluser]fefe[/eluser]
thansk I'm gonna give a try with your code
#6

[eluser]Alface[/eluser]
And I remove this 2 lines. 281 and 282
Code:
//$account_root_parameters['startDate'] = strval($google_results->startDate);
    //$account_root_parameters['endDate'] = strval($google_results->endDate);
I think gapi isn't update




Theme © iAndrew 2016 - Forum software by © MyBB