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 | |
/** plugin_DatabaseHide.php | |
* @author Alix Axel | |
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0 | |
*/ | |
class AdminerDatabaseHide { | |
protected $disabled; | |
function AdminerDatabaseHide($disabled) { |
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 isVATIN($vatin) | |
{ | |
if (preg_match('~^[125689][0-9]{8}$~', $vatin) > 0) | |
{ | |
$vatin = str_split($vatin); | |
foreach (array_slice($vatin, 0, -1) as $key => $value) | |
{ |
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 | |
/** | |
* The MIT License | |
* http://creativecommons.org/licenses/MIT/ | |
* | |
* Copyright (c) Alix Axel <[email protected]> | |
**/ | |
class phunction_HTML_Form extends phunction_HTML |
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 | |
public static function Typography($string, $quotes = true) | |
{ | |
if ($quotes === true) | |
{ | |
$string = preg_replace(array("~'([^']+)'~", '~"([^"]+)"~'), array('‘$1’', '“$1”'), $string); | |
} | |
return preg_replace(array('~[.]{2,}~', '~--~', '~-~', '~(?<=\d)(st|nd|rd|th)\b~i'), array('…', '—', '–', '<sup>$1</sup>'), $string); |
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 | |
public static function Dump() | |
{ | |
foreach (func_get_args() as $argument) | |
{ | |
switch (gettype($argument)) | |
{ | |
case 'array': | |
case 'object': |
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 | |
public static function DB($query = null) | |
{ | |
static $db = array(); | |
static $result = array(); | |
if (isset($db[self::$id], $query) === true) | |
{ | |
if (empty($result[self::$id][$hash = md5($query)]) === 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
<?php | |
public static function Enclose($string, $delimiter = null) | |
{ | |
if (strlen($string = trim($string)) > 0) | |
{ | |
$string = sprintf('%2$s%1$s%2$s', trim($string, $delimiter), $delimiter); | |
} | |
return $string; |
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 Zip($input, $output) | |
{ | |
if (class_exists('PharData', false) === true) | |
{ | |
if (is_object($phar = new PharData($output)) === true) | |
{ | |
if (is_dir($input) === 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
<?php | |
public static function Highway($path, $throttle = null) | |
{ | |
if ((count($segments = self::Segment()) > 0) && (preg_match('~/$~', $path = ph()->Disk->Path($path)) > 0)) | |
{ | |
$class = null; | |
while ((is_null($segment = array_shift($segments)) !== true) && (is_dir($path . $class . $segment . '/') === 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
<?php | |
function RESTful($root, $convention = '_%s') | |
{ | |
$root = rtrim(str_replace('\\', '/', realpath($root)), '/'); | |
$segments = preg_replace('~/+~', '/', trim(substr($_SERVER['PHP_SELF'], strlen($_SERVER['SCRIPT_NAME'])), '/')); | |
foreach (range(0, count($segments = explode('/', $segments))) as $i) | |
{ | |
if (is_file(sprintf('%s/%s.php', $root, $path = implode('/', array_slice($segments, 0, $i)))) === true) |