Created
September 11, 2012 12:59
-
-
Save deanrather/3698274 to your computer and use it in GitHub Desktop.
redPHP Nutshell Plugin
This file contains hidden or 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
<?php | |
// Nutshell Bootstrap | |
if(!defined('NUTSHELL_DIR')) | |
{ | |
define('NUTSHELL_DIR', APP_DIR.'/../lib/nutshell/'); | |
define('NUTSHELL_APP_DIR', APP_DIR.'/../nutshell-application'); | |
function bootstrap() | |
{ | |
\nutshell\Nutshell::setAppPath(NUTSHELL_APP_DIR); | |
\nutshell\Nutshell::getInstance()->plugin->AppPlugin(); | |
\nutshell\Nutshell::getInstance()->plugin->Mvc(false); | |
\nutshell\Nutshell::getInstance()->plugin->MvcQuery(); | |
} | |
require_once(NUTSHELL_DIR.'Nutshell.php'); | |
} | |
// redPHP Plugin to provide access to Nutshell | |
require_once(APP_DIR.'/plugins/plugin.php'); | |
class Nutshell extends plugin | |
{ | |
public static function getInstance() | |
{ | |
return \nutshell\Nutshell::getInstance(); | |
} | |
public static function getHelper($helperName) | |
{ | |
require_once(NUTSHELL_APP_DIR.'helper'.DIRECTORY_SEPARATOR.$helperName.'.php'); | |
$namepathString = "\\application\\helper\\$helperName"; | |
return new $namepathString; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment