2015-01-23 13:09:30 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Vn\Hedera;
|
|
|
|
|
|
|
|
function checkToken ($token)
|
|
|
|
{
|
|
|
|
return preg_match ('/^[\w\-]+$/', $token);
|
|
|
|
}
|
|
|
|
|
|
|
|
function ifNull ($map, $key)
|
|
|
|
{
|
|
|
|
return isset ($map[$key]) ? $map[$key] : NULL;
|
|
|
|
}
|
|
|
|
|
2015-01-31 01:05:12 +00:00
|
|
|
function checkFilePath ($file, $path)
|
|
|
|
{
|
|
|
|
$checkPath = stream_resolve_include_path ($path).'/';
|
|
|
|
$filePath = stream_resolve_include_path ($checkPath.$file);
|
|
|
|
|
|
|
|
$len = strlen ($checkPath);
|
|
|
|
return substr ($filePath, 0, strlen ($checkPath)) === $checkPath;
|
|
|
|
}
|
|
|
|
|
2015-01-23 13:09:30 +00:00
|
|
|
?>
|