Pages

5/25/2011

Using Drupal Session Variables outside of Drupal

Drupal stores session variables a bit differently then normal php applications, so some integration is required.

If you have an external script you want to call and need to include variables, then you need to add the following to your script:


Change anything with @@ @@

chdir('@@rootpathofdrupal@@');
require_once './includes/bootstrap.inc';
define('DRUPAL_ROOT', getcwd());
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

Once you have added the necessary information your will be able to get the same session variables.

5/24/2011

Example of Google Docs 3.0 API's

Currently we are in the process of rewriting our portal for the district. We are looking to tie more into Google App's within our portal. So, we thought this would be a good time for us to start going down the path or pulling the data and pushing data back.

First thing is first, there are many different client's out there you can use. We are using the Zend Framework to do what we need to do.

Download these:

Also, you'll need to be running Google APP's for what we are doing, we have setup OAuth. Please check here for more info: OAuth Overview

See Example below for a quick way to pull the first 5 results in a specified user's google doc's account:


replace the following
$CONSUMER_KEY = '@@replaceme@@';
$CONSUMER_SECRET = '@@replaceme@@';
$USER = '@@user@domain.com@@';
$admin = '@@admin@domain.com@@';