本文整理汇总了PHP中unknown_type::setPid方法的典型用法代码示例。如果您正苦于以下问题:PHP unknown_type::setPid方法的具体用法?PHP unknown_type::setPid怎么用?PHP unknown_type::setPid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unknown_type
的用法示例。
在下文中一共展示了unknown_type::setPid方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: EventPagesEditSubmit
/**
* Обработка отправки формы при редактировании страницы
*
* @param unknown_type $oPageEdit
*/
protected function EventPagesEditSubmit($oPageEdit)
{
$this->Security_ValidateSendForm();
// * Проверяем корректность полей
if (!$this->EventPagesCheckFields()) {
return;
}
if ($oPageEdit->getId() == getRequest('page_pid')) {
$this->_messageError($this->Lang_Get('system_error'), 'page:edit');
return;
}
// * Обновляем свойства страницы
$oPageEdit->setAutoBr(getRequest('page_auto_br') ? 1 : 0);
$oPageEdit->setActive(getRequest('page_active') ? 1 : 0);
$oPageEdit->setMain(getRequest('page_main') ? 1 : 0);
$oPageEdit->setDateEdit(date("Y-m-d H:i:s"));
if (getRequest('page_pid') == 0) {
$oPageEdit->setUrlFull(getRequest('page_url'));
$oPageEdit->setPid(null);
} else {
$oPageEdit->setPid(getRequest('page_pid'));
$oPageParent = $this->PluginPage_Page_GetPageById(getRequest('page_pid'));
$oPageEdit->setUrlFull($oPageParent->getUrlFull() . '/' . getRequest('page_url'));
}
$oPageEdit->setSeoDescription(getRequest('page_seo_description'));
$oPageEdit->setSeoKeywords(getRequest('page_seo_keywords'));
$oPageEdit->setText(getRequest('page_text'));
$oPageEdit->setTitle(getRequest('page_title'));
$oPageEdit->setUrl(getRequest('page_url'));
$oPageEdit->setSort(intval(getRequest('page_sort')));
$oPageEdit->setOtherUrl(getRequest('page_other_url'));
// * Обновляем страницу
if ($this->PluginPage_Page_UpdatePage($oPageEdit)) {
$this->PluginPage_Page_RebuildUrlFull($oPageEdit);
$this->_messageNotice($this->Lang_Get('page_edit_submit_save_ok'), 'page:edit');
$this->SetParam(0, null);
$this->SetParam(1, null);
} else {
$this->_messageError($this->Lang_Get('system_error'), 'page:edit');
}
}
示例2: startProcess
/**
* Start a child process for pushing data
* @param unknown_type $client
*/
private function startProcess($client)
{
$this->console("Start a client process");
$pid = pcntl_fork();
if ($pid == -1) {
die('could not fork');
} elseif ($pid) {
// process
$client->setPid($pid);
} else {
// we are the child
while (true) {
// check if the client is connected
if (!$client->isConnected()) {
break;
}
// push something to the client
$seconds = rand(2, 5);
$this->send($client, "I am waiting {$seconds} seconds");
sleep($seconds);
}
}
}
示例3: SubmitEditPage
/**
* Обработка отправки формы при редактировании страницы
*
* @param unknown_type $oPageEdit
*/
protected function SubmitEditPage($oPageEdit)
{
/**
* Проверяем корректность полей
*/
if (!$this->CheckPageFields()) {
return;
}
if ($oPageEdit->getId() == getRequest('page_pid')) {
$this->Message_AddError($this->Lang_Get('system_error'));
return;
}
/**
* Обновляем свойства страницы
*/
$oPageEdit->setActive(getRequest('page_active') ? 1 : 0);
$oPageEdit->setAutoBr(getRequest('page_auto_br') ? 1 : 0);
$oPageEdit->setMain(getRequest('page_main') ? 1 : 0);
$oPageEdit->setDateEdit(date("Y-m-d H:i:s"));
if (getRequest('page_pid') == 0) {
$oPageEdit->setUrlFull(getRequest('page_url'));
$oPageEdit->setPid(null);
} else {
$oPageEdit->setPid(getRequest('page_pid'));
$oPageParent = $this->PluginPage_Page_GetPageById(getRequest('page_pid'));
$oPageEdit->setUrlFull($oPageParent->getUrlFull() . '/' . getRequest('page_url'));
}
$oPageEdit->setSeoDescription(getRequest('page_seo_description'));
$oPageEdit->setSeoKeywords(getRequest('page_seo_keywords'));
$oPageEdit->setText(getRequest('page_text'));
$oPageEdit->setTitle(getRequest('page_title'));
$oPageEdit->setUrl(getRequest('page_url'));
$oPageEdit->setSort(getRequest('page_sort'));
/**
* Обновляем страницу
*/
if ($this->PluginPage_Page_UpdatePage($oPageEdit)) {
$this->PluginPage_Page_RebuildUrlFull($oPageEdit);
$this->Message_AddNotice($this->Lang_Get('plugin.page.edit_submit_save_ok'));
$this->SetParam(0, null);
$this->SetParam(1, null);
} else {
$this->Message_AddError($this->Lang_Get('system_error'));
}
}
示例4: startProcess
/**
* Start a child process for pushing data
* @param unknown_type $client
*/
private function startProcess($client)
{
$this->console("Start a client process");
$pid = pcntl_fork();
if ($pid == -1) {
die('could not fork');
} elseif ($pid) {
// process
$client->setPid($pid);
} else {
// we are the child
while (true) {
//if the client is broken, exit the child process
if ($client->exists == false) {
break;
}
// push something to the client
$seconds = rand(2, 5);
//$this->send($client, "I am waiting {$seconds} seconds");
sleep($seconds);
}
}
}