Skip to content

Instantly share code, notes, and snippets.

@deanrather
Created September 11, 2012 12:59
Show Gist options
  • Save deanrather/3698274 to your computer and use it in GitHub Desktop.
Save deanrather/3698274 to your computer and use it in GitHub Desktop.
redPHP Nutshell Plugin
<?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