-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Breaking compatibility, but remove non-autoloadable shortcuts.php
- Loading branch information
Showing
2 changed files
with
73 additions
and
88 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
|
||
namespace libAllure; | ||
|
||
abstract class Shortcuts | ||
{ | ||
public static function san(): \libAllure\Sanitizer | ||
{ | ||
return \libAllure\Sanitizer::getInstance(); | ||
} | ||
|
||
public static function db(): \libAllure\DatabaseFactory | ||
{ | ||
return \libAllure\DatabaseFactory::getInstance(); | ||
} | ||
|
||
public static function stmt($sql) | ||
{ | ||
$stmt = db()->prepare($sql); | ||
|
||
return $stmt; | ||
} | ||
|
||
public static function stmtPrepExec($sql) | ||
{ | ||
$stmt = stmt($sql); | ||
$stmt->prepare(); | ||
$stmt->execute(); | ||
|
||
return $stmt; | ||
} | ||
|
||
public static function filterStrings() | ||
{ | ||
$ret = array(); | ||
$san = \libAllure\Sanitizer::getInstance(); | ||
$san->filterAllowUndefined = false; | ||
|
||
foreach (func_get_args() as $argname) { | ||
$ret[$argname] = $san->filterString($argname); | ||
} | ||
|
||
return $ret; | ||
} | ||
|
||
public static function filterUints() | ||
{ | ||
$ret = array(); | ||
$san = \libAllure\Sanitizer::getInstance(); | ||
$san->filterAllowUndefined = false; | ||
|
||
foreach (func_get_args() as $argname) { | ||
$ret[$argname] = $san->filterUint($argname); | ||
} | ||
|
||
return $ret; | ||
} | ||
|
||
public static function vde() | ||
{ | ||
if (!headers_sent()) { | ||
header('Content-Type: text/plain'); | ||
} | ||
|
||
foreach (func_get_args() as $i => $arg) { | ||
echo "Arg " . $i . ":\n"; | ||
var_dump($arg); | ||
echo "\n\n"; | ||
} | ||
|
||
exit; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.