本文整理汇总了PHP中main::loadLibs方法的典型用法代码示例。如果您正苦于以下问题:PHP main::loadLibs方法的具体用法?PHP main::loadLibs怎么用?PHP main::loadLibs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类main
的用法示例。
在下文中一共展示了main::loadLibs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pingUrl
public function pingUrl()
{
if (!utils::keysOk($this->data, ['url', 'title'])) {
return $this->response('ERROR', 'required keys not set');
}
$url = $this->data['url'];
if (!utils::validUrl($url)) {
return $this->response('ERROR', 'invalid url');
}
$title = $this->data['title'];
main::loadLibs(['httpRequest/httpRequest.class.php']);
$pingomaticUrl = 'http://pingomatic.com/ping/' . '?title=' . urlencode($title) . '&blogurl=' . urlencode($url) . '&rssurl=' . '&chk_weblogscom=on' . '&chk_blogs=on' . '&chk_feedburner=on' . '&chk_newsgator=on' . '&chk_myyahoo=on' . '&chk_pubsubcom=on' . '&chk_blogdigger=on' . '&chk_weblogalot=on' . '&chk_newsisfree=on' . '&chk_topicexchange=on' . '&chk_google=on' . '&chk_tailrank=on' . '&chk_skygrid=on' . '&chk_collecta=on' . '&chk_superfeedr=on' . '&chk_audioweblogs=on' . '&chk_rubhub=on' . '&chk_a2b=on' . '&chk_blogshares=on';
$request = new httpRequest($pingomaticUrl);
$request->setRandUserAgent();
if (array_key_exists('proxy', $this->data)) {
try {
$request->setProxy($this->data['proxy']);
} catch (Exception $e) {
return $this->response('ERROR', $e->getMessage());
}
}
$request = $request->exec();
if (!$request['status'] == 'OK') {
return $this->response('ERROR', $request['message']);
}
if (strrpos($request['data'], 'Pinging complete!') === false) {
return $this->response('ERROR', 'pingomatic failed to ping ' . $url);
}
return $this->response('OK', 'successfully pinged ' . $url);
}
示例2: header
header('Content Type: text/plain');
define('wm_absolute_path', dirname(__FILE__) . '/');
define('wm_lib_path', wm_absolute_path . 'lib/');
define('wm_acts_path', wm_absolute_path . 'acts/');
define('wm_templates_path', wm_absolute_path . 'templates/');
define('wm_log_path', wm_absolute_path . 'log/');
define('wm_db_file', wm_absolute_path . 'db.sqlite');
require wm_absolute_path . 'main.php';
require wm_absolute_path . 'template.php';
require wm_absolute_path . 'utils.php';
$inputData = trim(file_get_contents('php://input'));
if (!$inputData) {
main::log('ERROR', sprintf('[%s] no input data provided', $_SERVER['REMOTE_ADDR']), true);
}
$inputData = json_decode($inputData, true);
if (!($inputData && is_array($inputData))) {
main::log('ERROR', sprintf('[%s] invalid input data', $_SERVER['REMOTE_ADDR']), true);
}
if (!utils::keysOk($inputData, ['act', 'data'])) {
main::log('ERROR', sprintf('[%s] required keys not set', $_SERVER['REMOTE_ADDR']), true);
}
$act = $inputData['act'];
$data = $inputData['data'];
main::loadLibs(['sqliteDB/sqliteDB.class.php']);
main::initDB();
list($laBool, $laMsg) = main::loadAct($act);
if (!$laBool) {
main::log('ERROR', $lsMsg, true);
}
$actOb = new $act($data);
print_r($actOb->exec());