本文整理汇总了PHP中cascade_ws_utility\DebugUtility::dump方法的典型用法代码示例。如果您正苦于以下问题:PHP DebugUtility::dump方法的具体用法?PHP DebugUtility::dump怎么用?PHP DebugUtility::dump使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cascade_ws_utility\DebugUtility
的用法示例。
在下文中一共展示了DebugUtility::dump方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addDynamicFieldDefinition
public function addDynamicFieldDefinition($field_name, $type, $label, $required = false, $visibility = c\T::VISIBLE, $possible_values = "")
{
if ($this->hasDynamicMetadataFieldDefinition($field_name)) {
throw new \Exception(S_SPAN . "The dynamic field definition {$field_name} already exists." . E_SPAN);
}
if ($type != c\T::TEXT && trim($possible_values) == "") {
throw new e\EmptyValueException(S_SPAN . c\M::EMPTY_POSSIBLE_VALUES . E_SPAN);
}
$dmfd = AssetTemplate::getDynamicMetadataFieldDefinition();
$dmfd->dynamicMetadataFieldDefinition->name = $field_name;
$dmfd->dynamicMetadataFieldDefinition->label = $label;
$dmfd->dynamicMetadataFieldDefinition->fieldType = $type;
$dmfd->dynamicMetadataFieldDefinition->required = $required;
$dmfd->dynamicMetadataFieldDefinition->visibility = $visibility;
if ($type != c\T::TEXT) {
$dmfd->dynamicMetadataFieldDefinition->possibleValues = new \stdClass();
$values = u\StringUtility::getExplodedStringArray(";", $possible_values);
$value_count = count($values);
if ($value_count == 1) {
$pv = new \stdClass();
$pv->value = $values[0];
$pv->selectedByDefault = false;
$dmfd->dynamicMetadataFieldDefinition->possibleValues->possibleValue = $pv;
} else {
$dmfd->dynamicMetadataFieldDefinition->possibleValues->possibleValue = array();
foreach ($values as $value) {
if (self::DEBUG) {
u\DebugUtility::out($value);
}
$pv = new \stdClass();
$pv->value = $value;
$pv->selectedByDefault = false;
$dmfd->dynamicMetadataFieldDefinition->possibleValues->possibleValue[] = $pv;
}
}
}
if (self::DEBUG && self::DUMP) {
u\DebugUtility::dump($dmfd);
}
$dmfd_obj = new p\DynamicMetadataFieldDefinition($dmfd->dynamicMetadataFieldDefinition);
$this->dynamic_metadata_field_definitions[] = $dmfd_obj;
if (self::DEBUG && self::DUMP) {
u\DebugUtility::dump($dmfd_obj->toStdClass());
}
$this->edit();
$this->processDynamicMetadataFieldDefinition();
return $this;
}
示例2: edit
public function edit()
{
$asset = new \stdClass();
//$this->getProperty()->metadata = $this->metadata->toStdClass();
$asset->{$p = $this->getPropertyName()} = $this->getProperty();
$asset->{$p = $this->getPropertyName()}->metadata = $this->metadata->toStdClass();
if (self::DEBUG) {
u\DebugUtility::dump($asset);
}
// edit asset
$service = $this->getService();
$service->edit($asset);
if (!$service->isSuccessful()) {
throw new e\EditingFailureException(S_SPAN . c\M::EDIT_ASSET_FAILURE . E_SPAN . $service->getMessage());
}
return $this->reloadProperty();
}
示例3: __construct
public function __construct(aohs\AssetOperationHandlerService $service, \stdClass $audit_std)
{
if ($service == NULL) {
throw new e\NullServiceException(S_SPAN . c\M::NULL_SERVICE . E_SPAN);
}
if ($audit_std == NULL) {
throw new e\EmptyValueException(S_SPAN . c\M::EMPTY_AUDIT . E_SPAN);
}
if (self::DEBUG) {
u\DebugUtility::dump($audit_std->identifier);
}
$this->service = $service;
$this->audit_std = $audit_std;
$this->user = $audit_std->user;
$this->action = $audit_std->action;
$this->identifier = new p\Identifier($audit_std->identifier);
$this->date_time = new \DateTime($audit_std->date);
}
示例4: getType
private function getType($id_string)
{
if (self::DEBUG) {
u\DebugUtility::out("string: " . $id_string);
}
if (isset($this->service)) {
$types = array('block', 'format');
$type_count = count($types);
for ($i = 0; $i < $type_count; $i++) {
$id = $this->service->createId($types[$i], $id_string);
$operation = new \stdClass();
$read_op = new \stdClass();
$read_op->identifier = $id;
$operation->read = $read_op;
$operations[] = $operation;
}
$this->service->batch($operations);
$reply_array = $this->service->getReply()->batchReturn;
if (self::DEBUG && self::DUMP) {
u\DebugUtility::dump($reply_array);
}
for ($j = 0; $j < $type_count; $j++) {
if ($reply_array[$j]->readResult->success == 'true') {
foreach (c\T::$type_property_name_map as $type => $property) {
//echo "$type => $property" . BR;
if (isset($reply_array[$j]->readResult->asset->{$property})) {
return $type;
}
}
}
}
}
return NULL;
}
示例5: time
use cascade_ws_constants as c;
use cascade_ws_asset as a;
use cascade_ws_property as p;
use cascade_ws_utility as u;
use cascade_ws_exception as e;
try {
$cache = u\Cache::getInstance($service);
$template_id_stdClass = $service->createId(a\Template::TYPE, "78c760648b7f0856004564242ce4d1d1");
$template_identifier = new p\Child($template_id_stdClass);
// test cache time
$start_time = time();
for ($i = 0; $i < 50; $i++) {
$template = $cache->retrieveAsset($template_identifier);
}
$end_time = time();
echo "\nTotal time taken: " . ($end_time - $start_time) . " seconds\n";
u\DebugUtility::dump($cache);
$cache->clearCache();
u\DebugUtility::dump($cache);
// test direct retrieval time
$start_time = time();
for ($i = 0; $i < 50; $i++) {
$template = $template_identifier->getAsset($service);
}
$end_time = time();
echo "\nTotal time taken: " . ($end_time - $start_time) . " seconds\n";
} catch (\Exception $e) {
echo S_PRE . $e . E_PRE;
} catch (\Error $er) {
echo S_PRE . $er . E_PRE;
}
示例6: catch
$pcs->setConfigurationPageRegionFormat( 'Mobile', 'DEFAULT',
$cascade->getAsset(
a\XsltFormat::TYPE,
'404872688b7f0856002a5e11bb8c8642' )
)->edit();
//$pcs->setDefaultConfiguration( "Mobile" )->edit();
$pcs->setFormat( "Mobile",
$cascade->getAsset(
a\XsltFormat::TYPE,
'404872688b7f0856002a5e11bb8c8642' )
)->edit();
*/
//$pcs->setIncludeXMLDeclaration( "Mobile", true )->edit();
$pcs->setOutputExtension("Mobile", ".php")->setPublishable("Mobile", true)->setSerializationType("Mobile", "XML")->edit();
if ($mode != 'all') {
break;
}
case 'raw':
$pcs = $service->retrieve($service->createId(c\T::CONFIGURATIONSET, $id), c\P::CONFIGURATIONSET);
//$pr = new PageRegion( $pcs->pageConfigurations->
//pageConfiguration[3]->pageRegions->pageRegion[0] );
//var_dump( $pr );
u\DebugUtility::dump($pcs);
if ($mode != 'all') {
break;
}
}
} catch (\Exception $e) {
echo S_PRE . $e . E_PRE;
}
示例7: array
</multiselect>
*/
$field_name = "languages";
echo "Testing {$field_name}", BR;
if ($m->hasDynamicField($field_name)) {
$multiselect = $m->getDynamicField($field_name);
u\DebugUtility::dump($multiselect->toStdClass());
$new_values = array("Japanese", "English");
if ($ms->hasDynamicMetadataFieldDefinition($field_name)) {
$dmfd = $ms->getDynamicMetadataFieldDefinition($field_name);
$valid = true;
foreach ($new_values as $new_value) {
if (!$dmfd->hasPossibleValue($new_value)) {
$valid = false;
break;
}
}
if ($valid) {
$m->setDynamicFieldValues($field_name, $new_values);
}
}
}
u\DebugUtility::dump($m->toStdClass());
// commit all changes
$block->edit();
echo u\ReflectionUtility::getClassDocumentation("cascade_ws_property\\Metadata");
} catch (\Exception $e) {
echo S_PRE . $e . E_PRE;
} catch (\Error $er) {
echo S_PRE . $er . E_PRE;
}
示例8: catch
u\DebugUtility::dump($page->getPageLevelRegionBlockFormat());
// get page properties
echo "Metadata" . BR;
$md = $page->getMetadata();
u\DebugUtility::dump($md->toStdClass());
echo "Dynamic fields" . BR;
$fns = $md->getDynamicFieldNames();
u\DebugUtility::dump($fns);
echo "Structured data" . BR;
$sd = $page->getStructuredData();
u\DebugUtility::dump($sd->toStdClass());
echo "Fully qualified identifiers" . BR;
// identifiers of structured data
u\DebugUtility::dump($page->getIdentifiers());
// get data from a node
echo $page->getText("main-content-title") . BR;
// subscribers
echo "Subscribers" . BR;
u\DebugUtility::dump($page->getSubscribers());
break;
case "Site":
$site = $cascade->getSite($site_name);
// get the base folder
$base_folder = $site->getBaseFolder()->dump(true);
// content type container
echo $site->getRootContentTypeContainerId() . BR;
break;
}
} catch (\Exception $e) {
echo S_PRE . $e . E_PRE;
}
示例9: array
try {
$site_names = array("cru", "com", "medicine");
foreach ($site_names as $site) {
$search_for = new \stdClass();
$search_for->matchType = c\T::MATCH_ANY;
$search_for->searchGroups = true;
$search_for->assetName = $site;
// $site as group name
$service->search($search_for);
// if succeeded
if ($service->getSuccess()) {
echo "<h2>Search Result for {$site}</h2>";
if (is_null($service->getSearchMatches()->match)) {
echo "No results<br />";
} else {
u\DebugUtility::dump($service->getSearchMatches()->match);
}
} else {
echo "Search failed.<br />";
echo $service->getMessage();
}
}
// search all groups
$search_for = new \stdClass();
$search_for->matchType = c\T::MATCH_ANY;
$search_for->searchGroups = true;
$search_for->assetName = "*";
// the wild card
$service->search($search_for);
// if succeeded
if ($service->isSuccessful()) {
示例10: time
<?php
/*
This program shows how to use the Report class to report
pages in a folder containing long titles.
*/
$start_time = time();
require_once 'cascade_ws_ns/auth_chanw.php';
use cascade_ws_constants as c;
use cascade_ws_asset as a;
use cascade_ws_property as p;
use cascade_ws_utility as u;
use cascade_ws_exception as e;
try {
$site_name = 'cascade-admin';
$folder_path = 'projects/web-services/oop/classes/asset-tree';
$results = $report->setRootContainer($cascade->getAsset(a\Folder::TYPE, $folder_path, $site_name));
u\DebugUtility::dump($report->reportLongTitle(15, a\Page::TYPE, true));
$end_time = time();
echo "\nTotal time taken: " . ($end_time - $start_time) . " seconds\n";
} catch (\Exception $e) {
echo S_PRE . $e . E_PRE;
$end_time = time();
echo "\nTotal time taken: " . ($end_time - $start_time) . " seconds\n";
}
示例11: assetTreeUpdateDataDefinitionBlock
public static function assetTreeUpdateDataDefinitionBlock(aohs\AssetOperationHandlerService $service, p\Child $child, $params = NULL, &$results = NULL)
{
if (isset($params['source-cascade'])) {
$source_cascade = $params['source-cascade'];
} else {
echo c\M::SOURCE_CASCADE_NOT_SET . BR;
return;
}
if (isset($params['target-cascade'])) {
$target_cascade = $params['target-cascade'];
} else {
echo c\M::TARGET_CASCADE_NOT_SET . BR;
return;
}
if (isset($params['source-site'])) {
$source_site = $params['source-site'];
} else {
echo c\M::SOURCE_SITE_NOT_SET . BR;
return;
}
if (isset($params['target-site'])) {
$target_site = $params['target-site'];
} else {
echo c\M::TARGET_SITE_NOT_SET . BR;
return;
}
if (isset($params['exception-thrown'])) {
$exception_thrown = $params['exception-thrown'];
} else {
echo c\M::EXCEPTION_THROWN_NOT_SET . BR;
return;
}
if (isset($params['update-data'])) {
$update_data = $params['update-data'];
} else {
$update_data = true;
}
if (isset($params['update-metadata'])) {
$update_metadata = $params['update-metadata'];
} else {
$update_metadata = true;
}
if (self::DEBUG && self::DUMP) {
u\DebugUtility::out("Retrieving block");
u\DebugUtility::dump($child->toStdClass());
}
try {
$source_block = $child->getAsset($service);
$source_block_path = u\StringUtility::removeSiteNameFromPath($source_block->getPath());
} catch (\Exception $e) {
throw new e\CascadeInstancesErrorException($e . BR . S_SPAN . "Path: " . $child->getPathPath() . E_SPAN);
}
$target_dd = NULL;
// it will fail if there is any irregularity in the block
if ($source_block->hasStructuredData()) {
$source_block_dd = $source_block->getDataDefinition();
$source_block_dd_path = u\StringUtility::removeSiteNameFromPath($source_block_dd->getPath());
$source_block_dd_site = $source_block_dd->getSiteName();
$target_block_dd_site = $source_block_dd_site;
// compare the two data definitions
$source_dd = Asset::getAsset($service, DataDefinition::TYPE, $source_block_dd_path, $source_block_dd_site);
// the data definition must be there
$target_dd = $target_cascade->getAsset(DataDefinition::TYPE, $source_block_dd_path, $target_block_dd_site);
$source_xml = new \SimpleXMLElement($source_dd->getXml());
$target_xml = new \SimpleXMLElement($target_dd->getXml());
if (!u\XMLUtility::isXmlIdentical($source_xml, $target_xml)) {
throw new e\CascadeInstancesErrorException(S_SPAN . c\M::DIFFERENT_DATA_DEFINITIONS . E_SPAN);
}
$source_structured_data_std = $source_block->getStructuredData()->toStdClass();
$target_dd_id = $target_dd->getId();
$target_structured_data_std = $source_structured_data_std;
$target_structured_data_std->definitionId = $target_dd_id;
} else {
$source_content = $source_block->getXhtml();
}
$source_block_path_array = u\StringUtility::getExplodedStringArray("/", $source_block_path);
$source_block_path = $source_block_path_array[count($source_block_path_array) - 1];
$source_block_parent_path = $source_block->getParentContainerPath();
// create block
$target_site_name = $target_site->getName();
// parent must be there
$target_parent = $target_cascade->getAsset(Folder::TYPE, $source_block_parent_path, $target_site_name);
$target_block = $target_cascade->createXhtmlDataDefinitionBlock($target_parent, $source_block_path, $target_dd, $source_content);
// update data
if ($update_data) {
if ($target_block->hasStructuredData()) {
if (self::DEBUG && self::DUMP) {
u\DebugUtility::dump($target_structured_data_std);
}
try {
$target_service = $target_cascade->getService();
$identifiers = $source_block->getIdentifiers();
$identifier_asset_map = array();
foreach ($identifiers as $identifier) {
if ($source_block->isAssetNode($identifier)) {
$block_id = $source_block->getBlockId($identifier);
if (isset($block_id)) {
$resource_id = $block_id;
$source_resource_type = Block::getBlockType($service, $resource_id);
}
//.........这里部分代码省略.........
示例12: processPageConfigurations
private function processPageConfigurations($page_config_std)
{
$this->page_configurations = array();
if (!is_array($page_config_std)) {
$page_config_std = array($page_config_std);
}
if (self::DEBUG && self::DUMP) {
u\DebugUtility::dump($page_config_std);
}
foreach ($page_config_std as $pc_std) {
$pc = new p\PageConfiguration($pc_std, $this->getService(), self::TYPE);
$this->page_configurations[] = $pc;
$this->page_configuration_map[$pc->getName()] = $pc;
}
}
示例13: catch
echo "Tis true", BR;
} else {
echo "Tis false", BR;
}
if (u\StringUtility::stringToBool(0)) {
echo "Tis true", BR;
} else {
echo "Tis false", BR;
}
if (u\StringUtility::stringToBool("")) {
echo "Tis true", BR;
} else {
echo "Tis false", BR;
}
echo u\StringUtility::boolToString(true), BR;
echo u\StringUtility::startsWith("Hello", "He") ? "yes" : "no", BR;
echo u\StringUtility::startsWith("Hello", "e") ? "yes" : "no", BR;
echo u\StringUtility::removeSiteNameFromPath("site://cascade-admin/web-services/api/utility-classes/debug-utility"), BR;
echo u\StringUtility::getParentPathFromPath("/web-services/api/utility-classes/debug-utility"), BR;
echo u\StringUtility::getNameFromPath("/web-services/api/utility-classes/debug-utility"), BR;
echo u\StringUtility::getMethodName("structuredData"), BR;
u\DebugUtility::dump(u\StringUtility::getExplodedStringArray(";", "this;0;that;3;these"));
echo u\StringUtility::getFullyQualifiedIdentifierWithoutPositions("this;0;that;3;these"), BR;
echo u\StringUtility::endsWith("Hello", "lo") ? "yes" : "no", BR;
echo u\StringUtility::endsWith("Hello", "l") ? "yes" : "no", BR;
echo u\ReflectionUtility::getClassDocumentation("cascade_ws_utility\\StringUtility", true);
} catch (\Exception $e) {
echo S_PRE . $e . E_PRE;
} catch (\Error $er) {
echo S_PRE . $er . E_PRE;
}
示例14: catch
<?php
require_once 'auth_tutorial7.php';
use cascade_ws_AOHS as aohs;
use cascade_ws_constants as c;
use cascade_ws_asset as a;
use cascade_ws_property as p;
use cascade_ws_utility as u;
use cascade_ws_exception as e;
try {
$page_path = "index";
$page = $service->retrieve($service->createId(a\Page::TYPE, $page_path, "cascade-admin"));
if ($service->isSuccessful()) {
echo "Read successfully";
u\DebugUtility::dump($page);
} else {
echo "Failed to read. " . $service->getMessage();
}
} catch (\Exception $e) {
echo S_PRE, $e, E_PRE;
} catch (\Error $er) {
echo S_PRE, $er, E_PRE;
}
示例15: DateTime
echo S_H2 . "Pages with No Authors" . E_H2;
u\DebugUtility::dump($report->reportHasNoAuthor());
echo S_H2 . "Pages with No Summaries" . E_H2;
u\DebugUtility::dump($report->reportHasNoSummary());
echo S_H2 . "Folders with No End Dates" . E_H2;
u\DebugUtility::dump($report->reportHasNoEndDate(a\Folder::TYPE));
echo S_H2 . "Folders with End Dates" . E_H2;
u\DebugUtility::dump($report->reportHasEndDate(a\Folder::TYPE));
$results = $report->setRootContainer($cascade->getAsset(a\Folder::TYPE, $folder_path, $site_name))->reportMetadataWiredFields($max, 'Global');
echo S_H2 . "Pages Containing 'Global' in Title" . E_H2;
u\DebugUtility::dump($report->reportTitleContains());
$results = $report->setRootContainer($cascade->getAsset(a\Folder::TYPE, $folder_path, $site_name))->reportMetadataWiredFields($max, 'asset tree');
echo S_H2 . "Pages Containing 'asset tree' in Keywords" . E_H2;
u\DebugUtility::dump($report->reportKeywordsContains());
$results = $report->setRootContainer($cascade->getAsset(a\Folder::TYPE, $folder_path, $site_name))->reportMetadataWiredFields($max, 'global functions');
echo S_H2 . "Pages Containing 'global functions' in Summary" . E_H2;
u\DebugUtility::dump($report->reportSummaryContains());
$date = new DateTime('2016-05-17 00:00:00');
$results = $report->setRootContainer($cascade->getAsset(a\Folder::TYPE, $folder_path, $site_name))->reportDate($date);
//u\DebugUtility::dump( $results );
echo S_H2 . "Pages with Earlier Start Date" . E_H2;
u\DebugUtility::dump($report->reportStartDateBefore());
echo S_H2 . "Pages with Later Start Date" . E_H2;
u\DebugUtility::dump($report->reportStartDateAfter());
$end_time = time();
echo "\nTotal time taken: " . ($end_time - $start_time) . " seconds\n";
} catch (\Exception $e) {
echo S_PRE . $e . E_PRE;
$end_time = time();
echo "\nTotal time taken: " . ($end_time - $start_time) . " seconds\n";
}