本文整理汇总了PHP中SPRequest::search方法的典型用法代码示例。如果您正苦于以下问题:PHP SPRequest::search方法的具体用法?PHP SPRequest::search怎么用?PHP SPRequest::search使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SPRequest
的用法示例。
在下文中一共展示了SPRequest::search方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: submit
/**
* Gets the data for a field, verify it and pre-save it.
* @param SPEntry $entry
* @param string $tsId
* @param string $request
* @return array
*/
public function submit(&$entry, $tsId = null, $request = 'POST')
{
if (count($this->verify($entry, $request))) {
return SPRequest::search($this->nid, $request);
} else {
return array();
}
}
示例2: submit
/**
* Gets the data for a field, verify it and pre-save it.
* @param SPEntry $entry
* @param string $tsId
* @param string $request
* @return void
*/
public function submit(&$entry, $tsId = null, $request = 'POST')
{
$data = $this->fetchData($this->multi ? SPRequest::arr($this->nid, array(), $request) : SPRequest::word($this->nid, null, $request));
if (count($this->verify($entry, $request, $data))) {
return SPRequest::search($this->nid, $request);
} else {
return array();
}
}
示例3: submit
/**
* Gets the data for a field, verify it and pre-save it.
* @param SPEntry $entry
* @param string $tsId
* @param string $request
* @return void
*/
public function submit(&$entry, $tsId = null, $request = 'POST')
{
$data = $this->verify($entry, $request);
if (strlen($data)) {
return SPRequest::search($this->nid, $request);
} else {
return array();
}
}
示例4: downloadRequest
private function downloadRequest()
{
$pid = SPRequest::cmd('exid');
$msg = SPFactory::Controller('progress');
$msg->progress(50, Sobi::Txt('EX.CONNECTING_TO_REPO'));
$pid = explode('.', $pid);
$repo = $pid[0];
$tid = $pid[1];
$pid = $pid[2];
$data = SPRequest::search('sprpfield_');
$answer = array();
$msg->progress(55, Sobi::Txt('EX.PARSING_RESPONSE'));
if (count($data)) {
foreach ($data as $k => $v) {
$v = strlen($v) && $v != '' ? $v : SPC::NO_VALUE;
$answer[str_replace('sprpfield_', null, $k)] = $v;
}
}
$defFile = SPLoader::path("etc.repos.{$repo}.repository", 'front', true, 'xml');
$repository = SPFactory::Instance('services.installers.repository');
$repository->loadDefinition($defFile);
try {
$repository->connect();
} catch (SPException $x) {
$msg->error(SPLang::e('REPO_ERR', $x->getMessage()));
exit;
}
$callback = SPRequest::word('callback');
try {
array_unshift($answer, $pid);
array_unshift($answer, $tid);
array_unshift($answer, $repository->get('token'));
$msg->progress(60, Sobi::Txt('EX.SENDING_REQUEST_TO', array('repo' => $repository->get('name'))));
$response = call_user_func_array(array($repository, $callback), $answer);
// sleep( 2 );
} catch (SPException $x) {
$msg->error(SPLang::e('REPO_ERR', $x->getMessage()));
exit;
}
$this->downloadResponse($response, $repository, $msg);
}
示例5: session
protected function session(&$ssid)
{
/* if it wasn't new search */
$ssid = SPRequest::cmd('ssid', SPRequest::cmd('ssid', null, 'cookie'));
$new = false;
/* otherwise create new ssid */
if (!$ssid) {
$ssid = microtime(true) * 100 . '.' . rand(0, 99);
$new = true;
}
$attr = array('ssid' => $ssid, 'uid' => Sobi::My('id'), 'browserData' => SPConfig::serialize(SPBrowser::getInstance()));
/* get search request */
if (!count($this->_request)) {
$r = SPRequest::search('field_');
if (is_array($r) && count($r)) {
$attr['requestData'] = SPConfig::serialize($r);
}
}
/* determine the search parameters */
if ($new) {
$attr['searchCreated'] = 'FUNCTION:NOW()';
}
/* finally save */
try {
$this->_db->insertUpdate('spdb_search', $attr);
} catch (SPException $x) {
Sobi::Error($this->name(), SPLang::e('CANNOT_CREATE_SESSION_DB_ERR', $x->getMessage()), SPC::ERROR, 500, __LINE__, __FILE__);
}
return SPCookie::set('ssid', $ssid, SPCookie::days(7));
}