本文整理汇总了PHP中cascade_ws_utility\DebugUtility类的典型用法代码示例。如果您正苦于以下问题:PHP DebugUtility类的具体用法?PHP DebugUtility怎么用?PHP DebugUtility使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DebugUtility类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: addUserWriteAccess
public function addUserWriteAccess(a\User $u)
{
if (self::DEBUG) {
u\DebugUtility::out("Granting write access to " . $u->getName());
}
$this->setAccess($u, c\T::WRITE);
return $this;
}
开发者ID:wingmingchan,项目名称:php-cascade-ws-ns,代码行数:8,代码来源:AccessRightsInformation.class.php
示例2: setDoPASV
public function setDoPASV($bool)
{
if (!c\BooleanValues::isBoolean($bool)) {
throw new e\UnacceptableValueException(S_SPAN . "The value {$bool} must be a boolean." . E_SPAN);
}
if (self::DEBUG) {
u\DebugUtility::out($bool ? 'true' : 'false');
}
$this->getProperty()->doPASV = $bool;
return $this;
}
开发者ID:wingmingchan,项目名称:php-cascade-ws-ns,代码行数:11,代码来源:FtpTransport.class.php
示例3: getFolder
public function getFolder()
{
if ($this->isFolder() && $this->getIndexedFolderId() != NULL) {
$service = $this->getService();
if (self::DEBUG) {
u\DebugUtility::out("Returning folder" . "ID " . $this->getIndexedFolderPath());
}
return new Folder($service, $service->createId(Folder::TYPE, $this->getIndexedFolderId()));
}
return NULL;
}
开发者ID:wingmingchan,项目名称:php-cascade-ws-ns,代码行数:11,代码来源:IndexBlock.class.php
示例4: 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;
}
开发者ID:wingmingchan,项目名称:php-cascade-ws-ns,代码行数:48,代码来源:MetadataSet.class.php
示例5: 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();
}
开发者ID:quantegy,项目名称:php-cascade-ws-ns,代码行数:17,代码来源:Block.class.php
示例6: __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);
}
开发者ID:wingmingchan,项目名称:php-cascade-ws-ns,代码行数:18,代码来源:Audit.class.php
示例7: initialize
public static function initialize(aohs\AssetOperationHandlerService $service)
{
try {
$service->listMessages();
if ($service->isSuccessful()) {
$messages = $service->getListedMessages();
$temp_msg = array();
if (!($messages->message == NULL)) {
if (!is_array($messages->message)) {
$temp_msg[] = $messages->message;
} else {
$temp_msg = $messages->message;
}
foreach ($temp_msg as $message) {
$id = $message->id;
$to = $message->to;
$from = $message->from;
$date = $message->date;
$subject = trim($message->subject);
$body = $message->body;
self::$all_message_ids[] = $id;
$message_obj = new Message($message);
// store all messages
self::$all_messages[] = $message_obj;
self::$id_obj_map[$id] = $message_obj;
// from whom?
if (!isset($message_ids_from[$from])) {
self::$message_ids_from[$from] = array();
}
self::$message_ids_from[$from][] = $id;
if ($from != 'system') {
self::$non_system_messages[] = $message_obj;
}
if (self::DEBUG) {
u\DebugUtility::out($message_obj->getType());
}
if ($message_obj->getType() == Message::TYPE_EXPIRATION) {
self::$asset_expiration_message[] = $message_obj;
self::$asset_expiration_message_ids[] = $id;
} else {
if ($message_obj->getType() == Message::TYPE_PUBLISH) {
self::$publish_messages[] = $message_obj;
self::$publish_message_ids[] = $id;
// no issues
if (strpos($subject, "(0 issue(s))") !== false) {
if (self::DEBUG) {
echo "L::121 " . $id . BR;
}
self::$publish_message_ids_without_issues[] = $id;
self::$publish_messages_without_issues[] = $message_obj;
} else {
if (self::DEBUG) {
echo "L::124 " . $id . BR;
}
self::$publish_message_ids_with_issues[] = $id;
self::$publish_messages_with_issues[] = $message_obj;
}
} else {
if ($message_obj->getType() == Message::TYPE_UNPUBLISH) {
self::$unpublish_messages[] = $message_obj;
self::$unpublish_message_ids[] = $id;
// no issues
if (strpos($subject, "(0 issue(s))") !== false) {
self::$unpublish_message_ids_without_issues[] = $id;
self::$unpublish_messages_without_issues[] = $message_obj;
} else {
self::$unpublish_message_ids_with_issues[] = $id;
self::$unpublish_messages_with_issues[] = $message_obj;
}
} else {
if ($message_obj->getType() == Message::TYPE_SUMMARY) {
self::$summary_messages[] = $message_obj;
self::$summary_message_ids[] = $id;
// 0 failures
if (strpos($subject, "(0 failures)") !== false) {
self::$summary_message_ids_no_failures[] = $id;
self::$summary_messages_no_failures[] = $message_obj;
} else {
self::$summary_message_ids_with_failures[] = $id;
self::$summary_messages_with_failures[] = $message_obj;
}
} else {
if ($message_obj->getType() == Message::TYPE_WORKFLOW) {
self::$workflow_messages[] = $message_obj;
self::$workflow_message_ids[] = $id;
// is complete
if (strpos($subject, "is complete") !== false) {
self::$workflow_message_ids_is_complete[] = $id;
self::$workflow_messages_complete[] = $message_obj;
} else {
self::$workflow_message_ids_other[] = $id;
self::$workflow_messages_other[] = $message_obj;
}
} else {
self::$other_messages[] = $message_obj;
self::$other_message_ids[] = $id;
}
}
}
}
//.........这里部分代码省略.........
开发者ID:quantegy,项目名称:php-cascade-ws-ns,代码行数:101,代码来源:MessageArrays.class.php
示例8: catch
u\DebugUtility::dump($dmfd->getDefaultValue()->toStdClass());
u\DebugUtility::out($dmfd->getDefaultValueString());
}
u\DebugUtility::out($dmfd->getFieldType());
u\DebugUtility::out($dmfd->getLabel());
u\DebugUtility::out($dmfd->getName());
u\DebugUtility::dump($dmfd->getPossibleValues());
u\DebugUtility::dump($dmfd->getPossibleValueStrings());
u\DebugUtility::dump(u\StringUtility::boolToString($dmfd->getRequired()));
u\DebugUtility::dump($dmfd->getVisibility());
u\DebugUtility::dump(u\StringUtility::boolToString($dmfd->hasPossibleValue("Spanish")));
$dmfd->removeValue("Chinese");
$ms->edit()->dump();
$dmfd->setLabel("Languages");
$ms->edit()->dump();
$dmfd->setRequired(true);
$ms->edit()->dump();
$dmfd->unsetSelectedByDefault("Japanese");
$ms->edit()->dump();
// radio
$dmfd = $ms->getDynamicMetadataFieldDefinition("gender");
$dmfd->setSelectedByDefault("Male");
u\DebugUtility::dump($dmfd->toStdClass());
$ms->edit()->dump();
$dmfd->setVisibility(c\T::VISIBLE);
$ms->edit()->dump();
} catch (\Exception $e) {
echo S_PRE . $e . E_PRE;
} catch (\Error $er) {
echo S_PRE . $er . E_PRE;
}
开发者ID:wingmingchan,项目名称:php-cascade-ws-ns-examples,代码行数:31,代码来源:dynamic_metadata_field_definition.php
示例9: 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;
}
开发者ID:wingmingchan,项目名称:php-cascade-ws-ns-examples,代码行数:31,代码来源:get_info.php
示例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";
}
开发者ID:wingmingchan,项目名称:php-cascade-ws-ns-examples,代码行数:25,代码来源:report_long_title.php
示例11: isPublishable
public function isPublishable()
{
$path = $this->getPath();
if (self::DEBUG) {
u\DebugUtility::out($path);
}
if ($this->getPath() == '/') {
return $this->getShouldBePublished();
} else {
$parent = $this->getAsset($this->getService(), Folder::TYPE, $this->getParentContainerId());
return $parent->isPublishable() && $this->getShouldBePublished();
}
}
开发者ID:wingmingchan,项目名称:php-cascade-ws-ns,代码行数:13,代码来源:Folder.class.php
示例12: 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;
}
开发者ID:wingmingchan,项目名称:php-cascade-ws-ns-examples,代码行数:31,代码来源:page_configuration_set.php
示例13: catch
<?php
require_once 'cascade_ws_ns/auth_chanw.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 = $cascade->getAsset(a\Page::TYPE, '2a47653d8b7f08ee3c48c4e996f9054a');
$page->setRegionFormat("RWD", "BANNER FULL WIDTH", $cascade->getAsset(a\XsltFormat::TYPE, '5a654ee68b7f0856001b890211c4f553'))->edit();
// display the page-level block/format information
u\DebugUtility::dump($page->getPageLevelRegionBlockFormat());
} catch (\Exception $e) {
echo S_PRE . $e . E_PRE;
}
开发者ID:wingmingchan,项目名称:php-cascade-ws-ns-examples,代码行数:17,代码来源:set_region_format.php
示例14: catch
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_id = "824b63c68b7ffe830539acf09bc3135b";
$page = $cascade->getAsset(a\Page::TYPE, $page_id);
$audits = $page->getAudits();
//u\DebugUtility::dump( $audits );
$audit0 = $audits[0];
$audit1 = $audits[1];
$audit0->display();
$audit1->display();
echo "Action: ", $audit0->getAction(), BR;
echo "Audit asset: ", BR;
u\DebugUtility::dump($audit0->getAuditedAsset());
echo "Date: ", date_format($audit0->getDate(), 'Y-m-d H:i:s'), BR;
echo "Identifier: ", BR;
u\DebugUtility::dump($audit0->getIdentifier());
echo "User: ", $audit0->getUser(), BR;
u\DebugUtility::dump($audit0->toStdClass());
echo a\Audit::compare($audit0, $audit1), BR;
echo u\ReflectionUtility::getClassDocumentation("cascade_ws_asset\\Audit");
} catch (\Exception $e) {
echo S_PRE . $e . E_PRE;
} catch (\Error $er) {
echo S_PRE . $er . E_PRE;
}
开发者ID:wingmingchan,项目名称:php-cascade-ws-ns-examples,代码行数:31,代码来源:audit.php
示例15: getPageRegion
public function getPageRegion($name)
{
if (self::DEBUG) {
u\DebugUtility::dump($this->page_region_map);
}
if (!isset($this->page_region_map[$name])) {
throw new e\NoSuchPageRegionException(S_SPAN . "The region {$name} does not exist." . E_SPAN);
}
return $this->page_region_map[$name];
}
开发者ID:wingmingchan,项目名称:php-cascade-ws-ns,代码行数:10,代码来源:Template.class.php
示例16: catch
<?php
require_once 'cascade_ws_ns/auth_chanw.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 {
$dd_block = $cascade->getAsset(a\DataDefinitionBlock::TYPE, "32fca8458b7f08ee384a2061ad1d5f17");
u\DebugUtility::dump($dd_block->getIdentifiers());
} catch (\Exception $e) {
echo S_PRE . $e . E_PRE;
}
开发者ID:wingmingchan,项目名称:php-cascade-ws-ns-examples,代码行数:15,代码来源:get_identifiers.php
示例17: getStructuredDataNode
private function getStructuredDataNode($xml_element, $type, $identifier)
{
if (self::DEBUG) {
u\DebugUtility::out("{$type}, {$identifier}");
}
$obj = AssetTemplate::getStructuredDataNode();
if ($type == c\T::GROUP) {
$obj->type = $type;
$obj->identifier = $identifier;
$obj->structuredDataNodes = new \stdClass();
$child_count = count($xml_element->children());
$more_than_one = $child_count > 1 ? true : false;
if ($more_than_one) {
$obj->structuredDataNodes->structuredDataNode = array();
foreach ($xml_element->children() as $child) {
$child_type = $child->getName();
if (self::DEBUG) {
u\DebugUtility::out("Child type in group: {$child_type}");
}
if (isset($child[c\T::IDENTIFIER])) {
$child_identifier = $child[c\T::IDENTIFIER]->__toString();
$child_std = $this->createChildStd($child, $child_type, $child_identifier);
$obj->structuredDataNodes->structuredDataNode[] = $child_std;
}
}
} else {
$xml_array = $xml_element->children();
//var_dump( $xml_array );
$child = $xml_array[0];
$child_type = $child->getName();
if (self::DEBUG) {
u\DebugUtility::out("Child type in group: {$child_type}");
}
$child_identifier = $child[c\T::IDENTIFIER]->__toString();
$child_std = $this->createChildStd($child, $child_type, $child_identifier);
$obj->structuredDataNodes->structuredDataNode = $child_std;
}
} else {
$obj->type = $type;
$obj->identifier = $identifier;
}
return $obj;
}
开发者ID:wingmingchan,项目名称:php-cascade-ws-ns,代码行数:43,代码来源:DataDefinition.class.php
示例18: assetTreeSearchTextByPattern
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;
$start_time = time();
try {
// to prevent time-out
set_time_limit(10000);
// to prevent using up memory when traversing a large site
ini_set('memory_limit', '2048M');
$pattern = "/<a[^>]+href=['\"]\\S+web\\.upstate\\.edu/";
$params = array("pattern" => $pattern);
$results = array();
$cascade->getAsset(a\Folder::TYPE, "5fa0f00d8b7f0856002a5e11033c2ad1")->getAssetTree()->traverse(array(a\Page::TYPE => array("assetTreeSearchTextByPattern")), $params, $results);
u\DebugUtility::dump($results);
$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";
}
function assetTreeSearchTextByPattern(aohs\AssetOperationHandlerService $service, p\Child $child, $params = NULL, &$results = NULL)
{
$type = $child->getType();
if ($type != a\Page::TYPE && $type != a\DataBlock::TYPE) {
return;
}
$pattern = $params["pattern"];
if (!isset($pattern) || trim($pattern) == "") {
开发者ID:wingmingchan,项目名称:php-cascade-ws-ns-examples,代码行数:31,代码来源:search_text_by_pattern.php
示例19: assetTreeUpdatePageConfigurationSet
public static function assetTreeUpdatePageConfigurationSet(aohs\AssetOperationHandlerService $service, p\Child $child, $params = NULL, &$results = NULL)
{
if (isset($params['source-cascade'])) {
$source_cascade = $params['source-cascade'];
} else {
echo c\M::TARGET_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['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;
}
$source_pcs = $child->getAsset($service);
$source_pcs_name = $source_pcs->getName();
$source_pcs_parent_path = $source_pcs->getParentContainerPath();
// the default definition
$source_pcs_default_config = $source_pcs->getDefaultConfiguration();
$source_pcs_default_config_name = $source_pcs_default_config->getName();
$source_pcs_default_config_template_path = u\StringUtility::removeSiteNameFromPath($source_pcs_default_config->getTemplatePath());
$source_pcs_default_config_template_name = u\StringUtility::getNameFromPath($source_pcs_default_config_template_path);
$source_pcs_default_config_template = $source_pcs_default_config->getTemplate();
$source_pcs_default_config_template_site = $source_pcs_default_config_template->getSiteName();
$source_pcs_default_config_extension = $source_pcs_default_config->getOutputExtension();
$source_pcs_default_config_type = $source_pcs_default_config->getSerializationType();
if (self::DEBUG) {
u\DebugUtility::out("Extension: " . $source_pcs_default_config_extension . BR . "Type: " . $source_pcs_default_config_type);
}
$target_pcs_default_config_template_site = $source_pcs_default_config_template_site;
try {
// the template must be there
$template = $target_cascade->getAsset(Template::TYPE, $source_pcs_default_config_template_path, $target_pcs_default_config_template_site);
$target_site_name = $target_site->getName();
// parent must be there
$target_parent = $target_cascade->getAsset(PageConfigurationSetContainer::TYPE, $source_pcs_parent_path, $target_site_name);
$target_pcs = $target_cascade->createPageConfigurationSet($target_parent, $source_pcs_name, $source_pcs_default_config_name, $template, $source_pcs_default_config_extension, $source_pcs_default_config_type);
// update other configuration sets
$source_config_names = $source_pcs->getPageConfigurationNames();
foreach ($source_config_names as $source_config_name) {
// retrieve config info
$source_config = $source_pcs->getPageConfiguration($source_config_name);
$source_template = $source_config->getTemplate();
$source_template_path = u\StringUtility::removeSiteNameFromPath($source_template->getPath());
$source_template_site = $source_template->getSiteName();
$target_template_site = $source_template_site;
// template must be there
$target_template = $target_cascade->getAsset(Template::TYPE, $source_template_path, $target_template_site);
// add missing configurations
if ($source_pcs_default_config_name != $source_config_name && !$target_pcs->hasPageConfiguration($source_config_name)) {
$source_config_extension = $source_config->getOutputExtension();
$source_config_type = $source_config->getSerializationType();
$source_config_publishable = $source_config->getPublishable();
try {
$target_config = $target_pcs->getPageConfiguration($source_config_name);
} catch (e\NoSuchPageConfigurationException $e) {
$target_pcs->addPageConfiguration($source_config_name, $target_template, $source_config_extension, $source_config_type);
$target_config = $target_pcs->getPageConfiguration($source_config_name);
}
// update config
$target_pcs->setOutputExtension($source_config_name, $source_config_extension);
$target_pcs->setSerializationType($source_config_name, $source_config_type);
$target_pcs->setPublishable($source_config_name, $source_config_publishable);
}
// config format!!!
$source_config_format_id = $source_config->getFormatId();
if (isset($source_config_format_id)) {
$source_config_format = $source_cascade->getXsltFormat($source_config_format_id);
$source_config_format_path = u\StringUtility::removeSiteNameFromPath($source_config_format->getPath());
$source_config_format_site = $source_config_format->getSiteName();
$target_config_format_site = $source_config_format_site;
try {
if ($exception_thrown) {
$target_format = $target_cascade->getAsset(XsltFormat::TYPE, $source_config_format_path, $target_config_format_site);
} else {
$target_format = $target_cascade->getXsltFormat($source_config_format_path, $target_config_format_site);
}
$source_config->setFormat($target_format);
$target_pcs->edit();
} catch (\Exception $e) {
$msg = "The format {$source_config_format_path} does not exist in {$target_config_format_site}. ";
throw new e\CascadeInstancesErrorException(S_SPAN . $msg . E_SPAN . $e);
}
}
// set blocks and formats, if not $exception_thrown, skip missing ones
$region_names = $target_template->getRegionNames();
if (count($region_names) > 0) {
foreach ($region_names as $region_name) {
//.........这里部分代码省略.........
开发者ID:quantegy,项目名称:php-cascade-ws-ns,代码行数:101,代码来源:CascadeInstances.class.php
示例20:
}
case 'dump':
$ct->dump(true);
if ($mode != 'all') {
break;
}
case 'get':
echo "ID: " . $ct->getId() . BR;
echo "Dumping names of contentTypePageConfigurations: " . BR;
echo S_PRE;
var_dump($ct->getContentTypePageConfigurationNames());
echo E_PRE;
$ct->getConfigurationSet()->dump(true);
$ct->getDataDefinition()->dump(true);
echo "Inline editable field names", BR;
u\DebugUtility::dump($ct->getInlineEditableFieldNames());
$ct->getMetadataSet()->dump(true);
if ($mode != 'all') {
break;
}
case 'set':
$config_name = 'Printer';
if ($ct->hasPageConfiguration($config_name)) {
$ct->setPublishMode($config_name, a\ContentType::PUBLISH_MODE_ALL_DESTINATIONS)->edit();
}
if ($mode != 'all') {
break;
}
case 'inline':
echo S_PRE;
var_dump($ct->getInlineEditableFieldNames());
开发者ID:wingmingchan,项目名称:php-cascade-ws-ns-examples,代码行数:31,代码来源:content_type.php
注:本文中的cascade_ws_utility\DebugUtility类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论