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
license: gpl-3.0 |
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 | |
$regions = array( | |
'Africa' => DateTimeZone::AFRICA, | |
'America' => DateTimeZone::AMERICA, | |
'Antarctica' => DateTimeZone::ANTARCTICA, | |
'Aisa' => DateTimeZone::ASIA, | |
'Atlantic' => DateTimeZone::ATLANTIC, | |
'Europe' => DateTimeZone::EUROPE, | |
'Indian' => DateTimeZone::INDIAN, | |
'Pacific' => DateTimeZone::PACIFIC |
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 | |
// source: http://www.paulferrett.com/2009/php-camel-case-functions/ | |
/** | |
* Translates a camel case string into a string with underscores (e.g. firstName -> first_name) | |
* @param string $str String in camel case format | |
* @return string $str Translated into underscore format | |
*/ | |
function from_camel_case($str) { | |
$str[0] = strtolower($str[0]); |
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 | |
/** | |
* The string tokenizer class allows an application to break a string into tokens. | |
* | |
* @author Azeem Michael | |
* @example The following is one example of the use of the tokenizer. The code: | |
* <code> | |
* <?php | |
* $str = "this is:@\t\n a test!"; |
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 interface imposes a total ordering on the objects of each class that implements | |
* it. This ordering is referred to as the class's natural ordering, and the class's | |
* compareTo method is referred to as its natural comparison method | |
* @author Azeem Michael | |
*/ | |
interface Comparable { | |
/** |
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 | |
/** | |
* @package Joomla.Platform | |
* @subpackage Cache | |
* | |
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved. | |
* @license GNU General Public License version 2 or later; see LICENSE | |
*/ | |
defined('JPATH_PLATFORM') or die(); |
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
function fixEvent(event) | |
{ | |
if (!event) var event = window.event; | |
// Fix target property, if necessary (IE 6/7/8 & Safari2) | |
if ( ! event.target) | |
{ | |
event.target = originalEvent.srcElement || document; | |
} |
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 Email($name, $from, $to, $subject, $message, $bcc = null, $attachments = null) | |
{ | |
ini_set('SMTP', 'localhost'); | |
ini_set('sendmail_from', $from); | |
$name = filter_var($name, FILTER_SANITIZE_STRING); | |
$from = filter_var($from, FILTER_SANITIZE_EMAIL); | |
$subject = filter_var($subject, FILTER_SANITIZE_STRING); |
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 | |
/** | |
* Resize Image Class | |
* | |
* @author Erik Pettersson <[email protected]> | |
* @copyright 2011 Erik Pettersson <[email protected]> | |
* @license http://www.opensource.org/licenses/mit-license.php MIT | |
*/ | |
class Image { |
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 | |
/** | |
* Here is a non-magic-method version for those that need better auto-complete and faster access times. | |
* It also filters the input to be valid UTF-8 just when needed thanks to phunction. | |
*/ | |
class input | |
{ | |
public static $encoding = 'UTF-8'; | |
public static function server($key, $default = NULL, $control = true) |