This repository has been archived by the owner on Dec 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added google+ oauth 2 example, and updated readme
added google+ oauth 2 example updated readme minor fixes
- Loading branch information
Showing
18 changed files
with
439 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
/examples/FacebookOpenGraphOAuth2/nbproject/ | ||
/examples/JamendoApiOAuth2/nbproject/ | ||
/examples/GooglePlusOAuth2/nbproject/ | ||
/examples/FacebookOpenGraphOAuth2/application/configs/facebook_api.ini | ||
/examples/JamendoApiOAuth2/application/configs/jamendo_api.ini | ||
/examples/JamendoApiOAuth2/application/configs/jamendo_api.ini | ||
/examples/GooglePlusOAuth2/application/configs/google_plus_api.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
/** | ||
* Application Bootstrap | ||
*/ | ||
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap | ||
{ | ||
|
||
protected function _initAutoloader() | ||
{ | ||
|
||
$autoloader = Zend_Loader_Autoloader::getInstance(); | ||
$autoloader->registerNamespace('Chrisweb'); | ||
|
||
} | ||
|
||
protected function _initDoctype() | ||
{ | ||
$this->bootstrap('view'); | ||
$view = $this->getResource('view'); | ||
$view->doctype('HTML5'); | ||
} | ||
|
||
protected function _initRouting() | ||
{ | ||
|
||
//Zend_Debug::dump(APPLICATION_PATH.'/configs/routes.ini'); | ||
//exit; | ||
|
||
$config = new Zend_Config_Ini(APPLICATION_PATH.'/configs/routes.ini'); | ||
$frontController = Zend_Controller_Front::getInstance(); | ||
$router = $frontController->getRouter(); | ||
$router->addConfig($config, 'routes'); | ||
Zend_Controller_Front::getInstance()->setRouter($router); | ||
|
||
} | ||
|
||
} |
35 changes: 35 additions & 0 deletions
35
examples/GooglePlusOAuth2/application/configs/application.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
; application/configs/application.ini | ||
|
||
[production] | ||
; phpSettings | ||
phpSettings.display_startup_errors = 0 | ||
phpSettings.display_errors = 0 | ||
|
||
resources.frontController.params.displayExceptions = 0 | ||
|
||
includePaths.library = APPLICATION_PATH "/../library" | ||
|
||
; bootstrap | ||
bootstrap.path = APPLICATION_PATH "/Bootstrap.php" | ||
bootstrap.class = "Bootstrap" | ||
|
||
appnamespace = "Application" | ||
|
||
; controllers | ||
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" | ||
|
||
; layout | ||
resources.layout.layoutPath = APPLICATION_PATH "/views/layouts" | ||
|
||
; views | ||
resources.view[] = | ||
|
||
[staging : production] | ||
|
||
[testing : production] | ||
phpSettings.display_startup_errors = 1 | ||
phpSettings.display_errors = 1 | ||
|
||
[development : production] | ||
phpSettings.display_startup_errors = 1 | ||
phpSettings.display_errors = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
; facebook callback route | ||
routes.googlepluscallback.type = "Zend_Controller_Router_Route_Static" | ||
routes.googlepluscallback.route = "/googlepluscallback" | ||
routes.googlepluscallback.defaults.controller = "index" | ||
routes.googlepluscallback.defaults.action = "googlepluscallback" |
38 changes: 38 additions & 0 deletions
38
examples/GooglePlusOAuth2/application/controllers/ErrorController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
/** | ||
* ErrorController | ||
*/ | ||
class ErrorController extends Zend_Controller_Action | ||
{ | ||
|
||
public function errorAction() | ||
{ | ||
$errors = $this->_getParam('error_handler'); | ||
|
||
switch ($errors->type) { | ||
|
||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE: | ||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER: | ||
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION: | ||
|
||
// 404 error -- controller or action not found | ||
$this->getResponse()->setHttpResponseCode(404); | ||
$this->view->message = 'Page not found'; | ||
break; | ||
|
||
default: | ||
// application error | ||
$this->getResponse()->setHttpResponseCode(500); | ||
$this->view->message = 'Application error'; | ||
break; | ||
|
||
} | ||
|
||
$this->view->exception = $errors->exception; | ||
$this->view->request = $errors->request; | ||
$this->view->env = APPLICATION_ENV; | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.