本文整理汇总了PHP中load::auto方法的典型用法代码示例。如果您正苦于以下问题:PHP load::auto方法的具体用法?PHP load::auto怎么用?PHP load::auto使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类load
的用法示例。
在下文中一共展示了load::auto方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: start
/**
* Function start function server JSON RPC.
* @access public
* @static
*/
public static function start()
{
// checks if a JSON-RCP request has been received.
if ($_SERVER['REQUEST_METHOD'] != 'POST' || empty($_SERVER['CONTENT_TYPE']) || !preg_match('/application\\/json/i', $_SERVER['CONTENT_TYPE'])) {
// If cross Domain true.
if (config::sys('crossDomain') == 1) {
header('Access-Control-Allow-Origin: *');
header('Access-Control-Request-Method: POST');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept');
}
// class html startTmpl.
html::startTmpl();
} else {
// reads the input data.
$request = json_decode(file_get_contents('php://input'), true);
// Gestion error.
try {
// Si app-maintenance.
if (config::sys('off') != 1) {
// Exception.
throw new Exception('SERV-ERROR-OFFLINE-MESSAGE');
}
// method post.
$reqConMethod = explode('_', $request['method']);
// Controleur.
$control = util::filtre($reqConMethod[0]);
// Action.
$action = util::filtre($reqConMethod[1]);
// Load.
load::auto('controleur_' . $control);
// forward_static_call_array.
if ($result = @forward_static_call_array(array($control, $action), $request['params'])) {
// Succes. Array.
$response = array('id' => $request['id'], 'result' => $result, 'jsonrpc' => $request['jsonrpc'], 'error' => NULL);
} else {
throw new Exception('SERV-ERROR-INVALID-PARAM-OR-METHODE');
}
} catch (Exception $e) {
// JSON RPC Error. Array.
$response = array('id' => $request['id'], 'result' => NULL, 'jsonrpc' => $request['jsonrpc'], 'error' => $e->getMessage());
}
// output the response.
header('content-type: text/javascript');
// If cross Domain true.
if (config::sys('crossDomain') == 1) {
header('Access-Control-Allow-Origin: *');
header('Access-Control-Request-Method: POST');
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept');
}
// Print request.
print json_encode($response);
}
}
示例2: btc_sign
public static function btc_sign($a = '', $m = '', $s = '')
{
// RegEx.
$tmp = false;
try {
// Class model dbClub.
load::auto('lib_verifymessage');
// Control.
if (verifymessage($a, $s, $m)) {
$tmp = true;
}
// Return.
return $tmp;
} catch (Exception $e) {
return $tmp;
}
}