Skip to content

Instantly share code, notes, and snippets.

View philsturgeon's full-sized avatar
🌳
Planting Trees

Phil Sturgeon philsturgeon

🌳
Planting Trees
View GitHub Profile
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class MY_Config extends CI_Config
{
function __get($item)
{
return parent::item($item);
}
function __set($item, $value)
<?php
/**
* @author Phil Sturgeon - PyroCMS development team
* @package PyroCMS
* @subpackage Installer
*
* @since v0.9.8
*
*/
class Installer_lib
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
# NOTICE: If you get a 404 play with combinations of the following commented out lines
#AllowOverride All
#RewriteBase /wherever/ci/is
# Keep people out of codeigniter directory and Git/Mercurial data
/**
* Force Array
*
* Take a totally mixed item and parse it into an array compatible with EE's Template library
*
* @access private
* @param mixed
* @return string
*/
private function _force_array($var, $level = 1)
preg_match('/^\/(cms|admin|manage)/', $_SERVER['REQUEST_URI'], $matches);
if ( ! empty($matches[1]))
{
$config['sess_cookie_name'] = $matches[1].'_session';
}
else
{
$config['sess_cookie_name'] = 'user_session';
@philsturgeon
philsturgeon / gist:497631
Created July 29, 2010 08:38
Controller_Api
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Api extends Controller {
/**
* Handle a response from an api
*/
public function response($status = 'success', $data = array())
{
$data = array_merge(array('status' => $status), $data);
class Manage extends REST_Controller
{
protected $rest_permissions = array(
'key_post' => 9
);
function key_post()
{
$this->response(array('foo' => 'BAR'), 200);
}
@philsturgeon
philsturgeon / feedback.md
Last active September 23, 2015 20:34
Reply to Just Learn Rails Part 3

Moved to

class Template
{
private $theme = 'default';
function set_theme($theme)
{
$this->theme = $theme;
}
function build($view, $data)
<?php
// Need to add 'activerecord' to your packages in config.php
namespace Fuel\Application;
use ActiveRecord;
class Model_User extends ActiveRecord\Model {}