Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
function time2str($ts) { | |
if(!ctype_digit($ts)) { | |
$ts = strtotime($ts); | |
} | |
$diff = time() - $ts; | |
if($diff == 0) { | |
return 'now'; | |
} elseif($diff > 0) { | |
$day_diff = floor($diff / 86400); |
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 | |
/** | |
* 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 | |
* | |
*/ |
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 | |
/** | |
* 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( |