本文整理汇总了PHP中SplStack::bottom方法的典型用法代码示例。如果您正苦于以下问题:PHP SplStack::bottom方法的具体用法?PHP SplStack::bottom怎么用?PHP SplStack::bottom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SplStack
的用法示例。
在下文中一共展示了SplStack::bottom方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFirstEntry
/**
* {@inheritdoc}
*/
public function getFirstEntry() : EntryInterface
{
if (0 === $this->stack->count()) {
throw new \RuntimeException('Trace empty');
}
return $this->stack->bottom();
}
示例2: getPredicate
public function getPredicate()
{
$predicate = $this->predicateStack->bottom()->pruneInstancesOf(NullPredicate::class, true)->pruneRedundantComposites(true);
if ($predicate instanceof CompositePredicate) {
$predicate = $predicate->pruneInstancesOf(NullPredicate::class, true);
}
return $predicate;
}
示例3: bottom
/**
* @return ResourceInterface
*/
public function bottom()
{
return $this->transform(parent::bottom());
}
示例4: first
/**
* Convenient access to the first handler return value.
*
* @return mixed The first handler return value
*/
public function first()
{
return parent::bottom();
}
示例5: getExceptions
/**
* Get committed exceptions in the group.
*
* @return \ArrayObject
*/
public function getExceptions()
{
return $this->_group->bottom();
}
示例6: count
/**
* Count the number of committed exceptions.
*
* @return int
*/
public function count()
{
return count($this->_group->bottom());
}
示例7: startElement
/**
* Process start elements
* @param $parser
* @param $name
* @param $attrs
*/
protected function startElement($parser, $name, $attrs)
{
// Interpolate properties into the attributes
$attrs = $this->substituteProperties($attrs);
switch ($name) {
case 'ROLE':
$role = new Rs\CreateRole($attrs['NAME'], $attrs['DESCRIPTION'], []);
$this->stack->push($role);
break;
case 'TASK':
$role = $this->stack->pop();
$role->TaskIDs[] = $attrs['ID'];
$this->stack->push($role);
break;
case 'FOLDER':
fwrite(STDOUT, sprintf('Creating folder: %s%s%s', $this->path->top(), $this->path->top() == self::ROOT ? '' : '/', $attrs['NAME']) . PHP_EOL);
$folder = new Rs\CreateFolder($attrs['NAME'], $this->path->top(), []);
try {
$this->rs->CreateFolder($folder);
} catch (SoapFault $e) {
// Ignore already exists exceptions
if (strpos($e->getMessage(), 'Microsoft.ReportingServices.Diagnostics.Utilities.ItemAlreadyExistsException') === false) {
throw $e;
}
} catch (Exception $e) {
fwrite(STDERR, 'Error: ' . $e->getMessage() . PHP_EOL);
}
// Push the folder onto the queue. In SSRS root folder must be '/', but no other folders can have trailing slashes :(
if ($this->path->top() != self::ROOT) {
$this->path->push($this->path->top() . '/' . $attrs['NAME']);
} else {
$this->path->push($this->path->top() . $attrs['NAME']);
}
break;
case 'DATASOURCE':
fwrite(STDOUT, sprintf('Creating data source: %s%s%s', $this->path->top(), $this->path->top() == self::ROOT ? '' : '/', $attrs['NAME']) . PHP_EOL);
// Overwrite?
$overwrite = $this->getAttrDefault('OVERWRITE', $attrs, 'true') == 'true';
// Build definition
$definition = new Rs\DataSourceDefinition();
$definition->ConnectString = $this->getAttrDefault('CONNECTSTRING', $attrs, '');
$definition->Extension = $this->getAttrDefault('EXTENSION', $attrs, 'SQL');
$definition->Enabled = $this->getAttrDefault('ENABLED', $attrs, 'true') == 'true';
$definition->UseOriginalConnectString = $this->getAttrDefault('ORIGINALCONNECTSTRINGEXPRESSIONBASED', $attrs, 'false') == 'true';
$definition->OriginalConnectStringExpressionBased = $this->getAttrDefault('ORIGINALCONNECTSTRINGEXPRESSIONBASED', $attrs, 'false') == 'true';
$definition->WindowsCredentials = $this->getAttrDefault('WINDOWSCREDENTIALS', $attrs, 'false') == 'true';
$definition->ImpersonateUser = $this->getAttrDefault('IMPERSONATEUSER', $attrs, 'false') == 'true';
$credentialRetrieval = $this->getAttrDefault('CREDENTIALRETRIEVAL', $attrs, 'Prompt');
switch (strtoupper($credentialRetrieval)) {
case 'PROMPT':
$definition->Prompt = $this->getAttrDefault('PROMPT', $attrs, '');
$definition->CredentialRetrieval = Rs\CredentialRetrievalEnum::Prompt;
break;
case 'STORE':
$definition->CredentialRetrieval = Rs\CredentialRetrievalEnum::Store;
$definition->UserName = $this->getAttrDefault('USERNAME', $attrs, '');
$definition->Password = $this->getAttrDefault('PASSWORD', $attrs, '');
break;
case 'INTEGRATED':
$definition->CredentialRetrieval = Rs\CredentialRetrievalEnum::Integrated;
break;
case 'NONE':
$definition->CredentialRetrieval = Rs\CredentialRetrievalEnum::None;
break;
default:
throw new Exception("Invalid credential retrieval: " . $credentialRetrieval);
}
$dataSource = new Rs\CreateDataSource($attrs['NAME'], $this->path->top(), $overwrite, $definition, []);
try {
$this->rs->CreateDataSource($dataSource);
} catch (Exception $e) {
fwrite(STDERR, 'Error: ' . $e->getMessage() . PHP_EOL);
}
break;
case 'DATASET':
fwrite(STDOUT, sprintf('Creating dataset: %s%s%s', $this->path->top(), $this->path->top() == self::ROOT ? '' : '/', $attrs['NAME']) . PHP_EOL);
$dataset = new Rs\CreateCatalogItem();
$dataset->ItemType = 'DataSet';
$dataset->Name = $attrs['NAME'];
$dataset->Parent = $this->path->top();
$dataset->Overwrite = true;
if (!is_readable($attrs['DEFINITION'])) {
throw new Exception("File not found: " . $attrs['DEFINITION']);
}
// Change definition to point to live data source, if necessary
$definition = file_get_contents($attrs['DEFINITION']);
if (array_key_exists('DATASOURCEREF', $attrs)) {
$dsRef = $attrs['DATASOURCEREF'];
$rootRef = $this->path->bottom();
if ($rootRef != self::ROOT) {
$dsRef = $rootRef . $dsRef;
}
fwrite(STDOUT, sprintf(' Linking data source: %s', $dsRef) . PHP_EOL);
$xml = new SimpleXMLElement($definition);
//.........这里部分代码省略.........