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 // file: library/App/Record.php | |
abstract class App_Record extends Doctrine_Record | |
{ | |
public function setUp() | |
{ | |
$this->unshiftFilter(new App_Record_Filter_Date); | |
} |
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 // file: library/App/Record/Filter/Date.php | |
/** Doctrine_Record */ | |
require_once 'Doctrine/Record.php'; | |
/** Doctrine_Record_Filter */ | |
require_once 'Doctrine/Record/Filter.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 //file: application/modules/admin/controllers/IndexController.php | |
class Admin_IndexController extends Zend_Controller_Admin | |
{ | |
public function init() | |
{ | |
$request = $this->getRequest(); | |
$auth = App_Auth_Admin::getInstance(); | |
if (!$auth->hasIdentity() && ('login' !== $request->getActionName())) { |
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 | |
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap | |
{ | |
// ... | |
protected function _initSession() | |
{ | |
$front = $this->bootstrap('FrontController') | |
->getResource('FrontController'); |
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 | |
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap | |
{ | |
protected function _initFrontController() | |
{ | |
$front = ($this->hasPluginResource('FrontController')) | |
? $this->getPluginResource('FrontController')->init() | |
: Zend_Controller_Front::getInstance(); | |
$front ->setRequest(new Zend_Controller_Request_Http()); |
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 //file: library/Application/Controller/Plugin/ModularAuth.php | |
class Application_Controller_Plugin_ModularAuth extends Zend_Controller_Plugin_Abstract | |
{ | |
protected $groups; | |
public function __construct($groups = array()) | |
{ |
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 | |
class RS_Auth_Adapter implements Zend_Auth_Adapter_Interface | |
{ | |
const NOT_FOUND_MSG = 'Account not found'; | |
const BAD_PW_MSG = 'Password in invalid'; | |
protected $user = null; |
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
# | |
# Core Redmine sync | |
# | |
[core] | |
repositoryformatversion = 0 | |
filemode = true | |
bare = false | |
logallrefupdates = true | |
[instaweb] | |
local = true |
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
var sys = require('sys'), | |
arr = []; | |
// fill with 100 dummy items | |
for (var i = 0; i < 100; ++i) arr.push('test'); | |
// delete first 99 dummy items | |
for (var i = 0; i < 99; ++i) delete(arr[i]); | |
// add one item more |
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
// Let's extend prototype of Object with something like delete in ruby, but | |
// we'll call it grab (just to avoid keyword name collision) | |
Object.prototype.grab = function grab(key) { | |
var val = this[key]; | |
delete(this[key]); | |
return val; | |
}; |