This file contains hidden or 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 Default_Controller_Action_Helper_FileCache extends | |
| Zend_Controller_Action_Helper_Abstract | |
| { | |
| protected $_cache; | |
| public function load($file, $id) | |
| { | |
| return $this->getCache($file)->load($id); | |
| } |
This file contains hidden or 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 | |
| // ... | |
| $this->addElementPrefixPath('My_Validate', 'My/Validate/', 'validate'); | |
| $this->addElement('text', 'start_time', array( | |
| 'label' => 'Start Time (GMT)', | |
| 'class' => 'datetime', | |
| 'required' => true, | |
| 'validators' => array( |
This file contains hidden or 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 CustomersController extends Zend_Controller_Action | |
| { | |
| public function init() | |
| { | |
| $this->_helper->MessengerSetup->enable($this->view); | |
| } | |
| ... | |
| } |
This file contains hidden or 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 pinfo() { | |
| ob_start(); | |
| phpinfo(); | |
| $data = ob_get_contents(); | |
| ob_clean(); | |
| return $data; | |
| } |
This file contains hidden or 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
| <VirtualHost *:80> | |
| ServerAdmin webmaster@localhost | |
| DocumentRoot "/path/to/root" | |
| ServerName abc.localhost | |
| # This should be changed to whatever you set DocumentRoot to. | |
| # | |
| <Directory "/path/to/root"> | |
| Options Indexes FollowSymLinks | |
| AllowOverride All |
This file contains hidden or 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 duration = 3600; | |
| duration = parseInt(Math.abs(duration)); | |
| duration = | |
| String('00' + parseInt(duration / 3600)).slice(-2) + ':' + | |
| String('00' + parseInt((duration / 60) % 60)).slice(-2) + ':' + | |
| String('00' + parseInt(duration % 60)).slice(-2); |
This file contains hidden or 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 now = new Date(); | |
| var offset = -now.getTimezoneOffset() * 60 * 1000; | |
| var nowUTC = new Date(+now - offset); |
This file contains hidden or 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 | |
| // Credit: http://gif.phpnet.org/frederic/programs/http_status_codes/ | |
| $code = isset($_GET['code']) ? $_GET['code'] : '200'; | |
| header('x', true, $code); | |
| ?> |
This file contains hidden or 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 My_Controller_Plugin_Navigation extends Zend_Controller_Plugin_Abstract | |
| { | |
| /** | |
| * Sets the appropriate page to active. | |
| * NOTE: This is not module safe and only works with controllers/actions. | |
| * NOTE: This plugin is designed for top-level navigations. | |
| * | |
| * @param Zend_Controller_Request_Abstract $request | |
| */ |
This file contains hidden or 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 Default_Controller_Action_Helper_Acl extends | |
| Zend_Controller_Action_Helper_Abstract | |
| { | |
| protected $_auth; | |
| protected $_acl; | |
| protected $_action; | |
| protected $_controllerName; | |
| protected $_roleFieldName = 'role'; | |
| protected $_disabled = false; |