本文整理汇总了PHP中Process::get方法的典型用法代码示例。如果您正苦于以下问题:PHP Process::get方法的具体用法?PHP Process::get怎么用?PHP Process::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Process
的用法示例。
在下文中一共展示了Process::get方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->removeByName('Order');
$fields->removeByName('ProcessInfo');
$fields->removeByName('ProcessStages');
$processParent = Process::get();
if ($processParent) {
$fields->insertAfter(new DropdownField('ParentID', 'Belongs to this Process', $processParent->map('ID', 'Title')), 'Title');
}
$fields->addFieldToTab('Root.Main', $processSteps = new CompositeField(new GridField('ProcessInfo', 'Information for this stage', $this->ProcessInfo(), GridFieldConfig_RelationEditor::create())));
$fields->insertBefore(new LiteralField('StageTitle', '<h3 class="process-info-header">
<span class="step-label">
<span class="flyout">1.1</span><span class="arrow"></span>
<span class="title">Stop stage details</span>
</span>
</h3>'), 'Title');
$fields->insertBefore(new LiteralField('StageTitle', '<h3 class="process-info-header">
<span class="step-label">
<span class="flyout">1.2</span><span class="arrow"></span>
<span class="title">Final information</span>
</span>
</h3>'), 'ProcessInfo');
return $fields;
}
示例2: getCMSFields
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->removeByName('Order');
$fields->removeByName('Title');
$fields->removeByName('ProcessInfo');
$fields->removeByName('ParentProcessID');
$fields->addFieldToTab('Root.Main', $processSteps = new CompositeField($title = new TextField('Title', 'Title')));
$title->addExtraClass('process-noborder');
$processSteps->addExtraClass('process-step');
$fields->addFieldToTab('Root.Main', $processSteps = new CompositeField(new GridField('ProcessInfo', 'Information for this case', $this->ProcessInfo(), GridFieldConfig_RecordViewer::create())));
$processes = Process::get();
if ($processes) {
$fields->insertAfter($inner = new CompositeField(new LiteralField('ExplainStop', '<label class="right">This must be set after you create a process</label>'), $processesOptions = new DropdownField('ParentProcessID', 'Process', $processes->map('ID', 'Title'))), 'Title');
$inner->addExtraClass('message special');
}
$processSteps->addExtraClass('process-step');
$fields->insertBefore(new LiteralField('StageTitle', '<h3 class="process-info-header">
<span class="step-label">
<span class="flyout">0.1</span><span class="arrow"></span>
<span class="title">Case details</span>
</span>
</h3>'), 'Title');
$fields->insertBefore(new LiteralField('StageTitle', '<h3 class="process-info-header">
<span class="step-label">
<span class="flyout">0.2</span><span class="arrow"></span>
<span class="title">Associated Information Pieces</span>
</span>
</h3>'), 'ProcessInfo');
return $fields;
}
示例3: getTitle
/**
* Get the terminal title.
* @return string
*/
public static function getTitle()
{
if (!empty(self::$username)) {
$process = new Process("uname -n");
$title = self::$username . "@" . trim($process->get());
$process->close();
return $title;
} else {
return "not logged shell - how cold it be possible, uh?";
}
}
示例4: __construct
/**
* Initialise la requete.
*/
public function __construct(ServerCallRequest $httpRequest, ServerCallResponse $httpResponse)
{
parent::__construct();
//On appelle le constructeur parent
//On initialise la requete et la reponse HTTP
$this->httpRequest = $httpRequest;
$this->httpResponse = $httpResponse;
//Classe demandee dans la requete
$class = $this->getHTTPRequest()->getClass();
if (!class_exists('\\lib\\controllers\\' . $class)) {
//On verifie que la classe existe
throw new \InvalidArgumentException('La classe "' . $class . '" spécifiée dans la requête HTTP n\'existe pas');
}
//Et qu'elle herite bien de ServerCallComponent
if (!in_array('lib\\ServerCallComponent', class_parents('\\lib\\controllers\\' . $class))) {
throw new \InvalidArgumentException('La classe "' . $class . '" spécifiée dans la requête HTTP ne peut pas être appellée comme action d\'administration');
}
//Si un mot de passe et un nom d'utilisateur sont specifies dans la requete
//On tente d'executer l'action demandee avec l'utilisateur specifie
if ($this->getHTTPRequest()->getPassword() != null && $this->getHTTPRequest()->getUsername() != null) {
$this->user = new User($this->getHTTPRequest()->getUsername(), $this->getHTTPRequest()->getPassword());
}
if ($this->getHTTPRequest()->getPid() != null && $this->getHTTPRequest()->getKey() != null) {
$process = Process::get($this->getHTTPRequest()->getPid());
if ($process->getKey() == $this->getHTTPRequest()->getKey()) {
throw new RuntimeException('Clef du processus #' . $this->getHTTPRequest()->getPid() . ' invalide');
}
if (!$process->getAuthorization()->check($this->getHTTPRequest())) {
throw new RuntimeException('Vous n\'avez pas les droits requis pour effectuer cette action (module : "' . $class . '"; action : "' . $this->getHTTPRequest()->getMethod() . '"; arguments: "' . implode('", "', $this->getHTTPRequest()->getArguments()) . '")');
}
$this->process = $process;
} else {
//On cree l'autorisation d'executer l'action
$authorization = new Authorization($this, $this->user);
//Si on n'a pas les droits suffisants pour executer la requete demandee
if (!$authorization->check($this->getHTTPRequest())) {
throw new RuntimeException('Vous n\'avez pas les droits requis pour effectuer cette action (module : "' . $class . '"; action : "' . $this->getHTTPRequest()->getMethod() . '"; arguments: "' . implode('", "', $this->getHTTPRequest()->getArguments()) . '")');
}
//On cree le processus de l'action
$this->process = new models\ServerCallProcess($this, $authorization, $this->getHTTPRequest()->getClass(), $this->getHTTPRequest()->getMethod());
}
}
示例5: json_encode
<?php
require_once 'test_webterminal/process.class.php';
$p = new Process("su neco");
usleep(500000);
$p->put("neco");
$p->put(chr(13));
echo $p->get();
echo '<hr>';
//$p->put(chr(21));
//var_dump($p->close());
//echo json_encode($p->getStatus());
//echo '<hr>';
// $p->put("whoami");
// $p->put(chr(13));
//echo $p->get();
usleep(500000);
echo $p->get();
$p->put("whoami");
$p->put(chr(13));
echo $p->get();
echo '<hr>';
usleep(500000);
echo $p->get();
echo '<hr>';
echo json_encode($p->getStatus());
echo '<hr>';
$p->put("ls -l");
$p->put(chr(13));
echo $p->get();
echo '<hr>';
示例6: ProcessContent
public function ProcessContent()
{
return Process::get()->byID($this->ProcessID);
}