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
/** | |
* 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) |
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
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'; |
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
<?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); |
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
class Manage extends REST_Controller | |
{ | |
protected $rest_permissions = array( | |
'key_post' => 9 | |
); | |
function key_post() | |
{ | |
$this->response(array('foo' => 'BAR'), 200); | |
} |
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
if ($handle = fopen($csv_file, 'r')) | |
{ | |
$all_headings = array_unique(explode(',', trim(fgets($handle)))); | |
foreach ($all_headings as $heading) | |
{ | |
if ( ! $heading) | |
{ | |
break; | |
} |
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
class Template | |
{ | |
private $theme = 'default'; | |
function set_theme($theme) | |
{ | |
$this->theme = $theme; | |
} | |
function build($view, $data) |
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
<?php | |
// Need to add 'activerecord' to your packages in config.php | |
namespace Fuel\Application; | |
use ActiveRecord; | |
class Model_User extends ActiveRecord\Model {} |
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
$route['default_controller'] = 'pages'; | |
$route['404'] = 'pages'; | |
<?php defined('BASEPATH') OR exit('No direct script access allowed'); | |
class Pages extends CI_Controller { | |
public function _remap() | |
{ | |
$method = $this->uri->segment(1, 'home'); |
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
<?php | |
/** | |
* Fuel | |
* | |
* Fuel is a fast, lightweight, community driven PHP5 framework. | |
* | |
* @package Fuel | |
* @version 1.0 | |
* @author Fuel Development Team | |
* @license MIT License |
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
web1: | |
################################################ | |
## GENERAL SETTINGS | |
################################################ | |
shared_writable_dirs: [/fuel/app/cache, /fuel/app/logs] | |
local_writable_dirs: [/fuel/app/tmp] | |
################################################ | |
## WEB SPECIFIC SETTINGS |