Skip to content

Commit

Permalink
google and installer format
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Jan 6, 2010
1 parent 6324301 commit 161db9a
Show file tree
Hide file tree
Showing 13 changed files with 1,921 additions and 2,123 deletions.
108 changes: 55 additions & 53 deletions infinitas/google/config/setup.php
@@ -1,57 +1,59 @@
<?php
/**
* Google config class file.
*
* setup the google helper.
*
* Copyright (c) 2009 Carl Sutton ( dogmatic69 )
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright (c) 2009 Carl Sutton ( dogmatic69 )
* @link http://www.dogmatic.co.za
* @package google
* @subpackage google.setup
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
class GoogleConfig
{
/**
* Current version: http://github.com/dogmatic/cakephp_google_plugin
* @access public
* @var string
*/
public $version = '0.1';
/**
* Google config class file.
*
* setup the google helper.
*
* Copyright (c) 2009 Carl Sutton ( dogmatic69 )
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright (c) 2009 Carl Sutton ( dogmatic69 )
* @link http://www.dogmatic.co.za
* @package google
* @subpackage google.setup
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
class GoogleConfig {
/**
* Current version: http://github.com/dogmatic/cakephp_google_plugin
*
* @access public
* @var string
*/
public $version = '0.1';

/**
* Settings
* @access public
* @var array
*/
public $settings = array();
/**
* Settings
*
* @access public
* @var array
*/
public $settings = array();

/**
* Singleton Instance
* @access private
* @var array
* @static
*/
private static $__instance;
/**
* Singleton Instance
*
* @access private
* @var array
* @static
*/
private static $__instance;

/**
* @access private
* @return void
*/
function __construct()
{
/**
* analytics setup
*/
$analytics = array(
'profile_id' => 'xxxxxxxx-x'
);
Configure::write( 'Google.Analytics', $analytics );
}
}
/**
*
* @access private
* @return void
*/
function __construct() {
/**
* analytics setup
*/
$analytics = array(
'profile_id' => 'xxxxxxxx-x'
);
Configure::write('Google.Analytics', $analytics);
}
}
109 changes: 53 additions & 56 deletions infinitas/google/controllers/google_contacts_controller.php
Expand Up @@ -22,12 +22,12 @@
* Configuration in app/config/database.php:
*
* var $google_contacts = array(
* 'datasource' => 'google_contacts',
* 'accounttype' => 'GOOGLE',
* 'email' => 'YOUR GOOGLE EMAIL',
* 'passwd' => 'YOUR PASSWORD',
* 'source' => 'companyName-applicationName-versionID',
* 'database' => ''
* 'datasource' => 'google_contacts',
* 'accounttype' => 'GOOGLE',
* 'email' => 'YOUR GOOGLE EMAIL',
* 'passwd' => 'YOUR PASSWORD',
* 'source' => 'companyName-applicationName-versionID',
* 'database' => ''
* );
*
* Find methods:
Expand All @@ -47,60 +47,57 @@
* Restult array keys:
*
* Use debug($this->GoogleContacts->_schema); to get structured array
*
*/

class GoogleContactsController extends AppController
{
var $name = 'GoogleContacts';
var $uses = array( 'GoogleContacts' , 'Users' );
class GoogleContactsController extends AppController {
var $name = 'GoogleContacts';
var $uses = array('GoogleContacts' , 'Users');

function testFindById() {
$contact = $this->GoogleContacts->find('first');
$res = $this->GoogleContacts->findById($contact['id']);
debug($res);
die();
}

function testFindAllLimit5() {
$contact = $this->GoogleContacts->find('all', array('limit' => 5));
debug($contact);
die();
}

function testFindAll() {
$contact = $this->GoogleContacts->find('all');
debug($contact);
die();
}

function testFindById(){
$contact = $this->GoogleContacts->find('first');
$res = $this->GoogleContacts->findById($contact['id']);
debug($res);
die();
}
function testCount() {
$contact = $this->GoogleContacts->find('count');
debug($contact);
die();
}

function testFindAllLimit5(){
$contact = $this->GoogleContacts->find('all', array('limit'=>5));
debug($contact);
die();
}

function testFindAll(){
$contact = $this->GoogleContacts->find('all');
debug($contact);
die();
}
function testFindFirst() {
$contact = $this->GoogleContacts->find('first');
debug($contact);
die();
}

function testCount(){
$contact = $this->GoogleContacts->find('count');
debug($contact);
die();
}

function testFindFirst(){
$contact = $this->GoogleContacts->find('first');
debug($contact);
die();
}

function testUpdate() {
$contact = $this->GoogleContacts->find('first');
$contact['Name']['fullName'] = "Contact Changed From Cake";
$this->GoogleContacts->create($contact);
$r = $this->GoogleContacts->save();
debug($r);
die();
}
function testUpdate() {
$contact = $this->GoogleContacts->find('first');
$contact['Name']['fullName'] = "Contact Changed From Cake";
$this->GoogleContacts->create($contact);
$r = $this->GoogleContacts->save();
debug($r);
die();
}

function index()
{
$contact['title'] = "NEW CONTACT";
$res = $this->GoogleContacts->create('Juanito');
debug($res);
$this->GoogleContacts->save($contact);
//debug($r);
}
function index() {
$contact['title'] = "NEW CONTACT";
$res = $this->GoogleContacts->create('Juanito');
debug($res);
$this->GoogleContacts->save($contact);
// debug($r);
}
}
63 changes: 31 additions & 32 deletions infinitas/google/google_app_controller.php
@@ -1,36 +1,35 @@
<?php
App::import(
array(
'type' => 'File',
'name' => 'Google.GoogleConfig',
'file' => 'config'. DS .'setup.php'
)
);
App::import(
array(
'type' => 'File',
'name' => 'Google.GoogleConfig',
'file' => 'config' . DS . 'setup.php'
)
);

/**
* Google App Controller class file.
*
* the google_appcontroller file, extends AppController
*
* Copyright (c) 2009 Carl Sutton ( dogmatic69 )
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright (c) 2009 Carl Sutton ( dogmatic69 )
* @link http://www.dogmatic.co.za
* @package google
* @subpackage google.controllers.google_app_controller
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
class GoogleAppController extends AppController
{
function beforeFilter()
{
parent::beforeFilter();
/**
* Google App Controller class file.
*
* the google_appcontroller file, extends AppController
*
* Copyright (c) 2009 Carl Sutton ( dogmatic69 )
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright (c) 2009 Carl Sutton ( dogmatic69 )
* @link http://www.dogmatic.co.za
* @package google
* @subpackage google.controllers.google_app_controller
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
class GoogleAppController extends AppController {
function beforeFilter() {
parent::beforeFilter();

$GoogleConfig = new GoogleConfig();
}
}

$GoogleConfig = new GoogleConfig();
}
}
?>

0 comments on commit 161db9a

Please sign in to comment.