Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* A simple class for tracking execution times of PHP scripts and logging them into CVS files
* @author Bernhard Häussner
* @see https://gist.github.com/846504
*/
class Profile {
private $_start = array();
private $_subdata = '';
<?php defined('SYSPATH') or die('No direct script access.');
/**
* People API - Example Code
*
* @author icyleaf <icyleaf.cn@gmail.com>
* @link http://icyleaf.com
* @version 0.1
*/
class Controller_API_People extends Controller_REST {
@nexeck
nexeck / rest.php
Created March 22, 2011 08:36 — forked from cambiata/rest.php
<?php
/**
* Quickly assemled rest controller based on Kohana 3's Kohana_Controller_REST
* https://github.com/kohana/core/blob/3.1%2Fmaster/classes/kohana/controller/rest.php
*
* Added functionality from FuelPHP's Controller_Rest
* https://github.com/fuel/fuel/blob/develop/fuel/core/classes/controller/rest.php
*
* All credits to Kohana and FuelPHP teams!
* Jonas Nyström - cambiata
<?php
/**
* Test controller extending Controller_Cambiata_REST
* Jonas Nyström - cambiata
*
* To be used with a route like this one:
*
* Route::set('rest', 'rest(/<par1>(/<par2>(/<par3>(/<par4>(/<par5>)))))(.<format>)')
* ->defaults(array(
<?php
/**
* Attempt to wrap Http Authentication into a separate class...
*
* Ideas and some code from FuelPHP Controller_Rest
* https://github.com/fuel/fuel/blob/develop/fuel/core/classes/controller/rest.php
*
*/
@nexeck
nexeck / controller_ajax_template.php
Created August 4, 2011 08:46 — forked from smgladkovskiy/Controller_Ajax_Template.php
Ajax Template Controller for Kohana 3.1
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* Ajax Template Controller template
*
* @author Sergei Gladkovskiy <smgladkovskiy@gmail.com>
*/
abstract class Controller_Ajax_Template extends Controller {
protected $_auth_required = FALSE;
@nexeck
nexeck / gist:1216082
Created September 14, 2011 08:13
Kohana Valid Date Greater Than
/**
* Größer Als Methode
*
* @static
* @param $validation
* @param $field1
* @param $field2
* @param $field2_name string Wird für den Fehlertext benutzt, und sollte die Bezeichnung des Feld1 beinhalten
* @return bool
*/
@nexeck
nexeck / gist:1216085
Created September 14, 2011 08:14
Kohana Valid Date Less Than
/**
* Kleiner Als Methode
*
* @static
* @param $validation
* @param $field1
* @param $field2
* @param $field2_name string Wird für den Fehlertext benutzt, und sollte die Bezeichnung des Feld1 beinhalten
* @return bool
*/
@nexeck
nexeck / bootstrap.php
Created September 26, 2011 16:57
Kohana v3.2 Bootstrap for multiple environment configs
<?php defined('SYSPATH') or die('No direct script access.');
// -- Environment setup --------------------------------------------------------
// Load the core Kohana class
require SYSPATH.'classes/kohana/core'.EXT;
if (is_file(APPPATH.'classes/kohana'.EXT))
{
// Application extends the core
<?php
Route::set('cms', function($uri) {
if (empty($uri))
{
$default_route = Route::get('default');
$controller = Arr::get($default_route->defaults(), 'controller');
$action = Arr::get($default_route->defaults(), 'action');