本文整理汇总了PHP中cascade_ws_utility\DebugUtility::out方法的典型用法代码示例。如果您正苦于以下问题:PHP DebugUtility::out方法的具体用法?PHP DebugUtility::out怎么用?PHP DebugUtility::out使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cascade_ws_utility\DebugUtility
的用法示例。
在下文中一共展示了DebugUtility::out方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: appendSibling
public function appendSibling($identifier)
{
$this->checkStructuredData();
if (self::DEBUG) {
u\DebugUtility::out("Calling appendSibling");
}
$this->structured_data->appendSibling($identifier);
$this->edit();
return $this;
}
示例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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
示例8: 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) {
//.........这里部分代码省略.........
示例9: 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 {
echo u\ReflectionUtility::getClassName($service), BR;
u\DebugUtility::out(u\ReflectionUtility::getClassName($service));
//u\DebugUtility::dump( $service );
} catch (\Exception $e) {
echo S_PRE . $e . E_PRE;
} catch (\Error $er) {
echo S_PRE . $er . E_PRE;
}
/*
Useful code templates:
u\ReflectionUtility::showMethodSignatures(
"cascade_ws_utility\ReflectionUtility" );
u\ReflectionUtility::showMethodSignature(
"cascade_ws_asset\Page", "edit" );
u\ReflectionUtility::showMethodDescription(
"cascade_ws_utility\ReflectionUtility", "getMethodInfoByName", true );
u\ReflectionUtility::showMethodExample(
"cascade_ws_utility\ReflectionUtility", "getMethodInfoByName", true );
示例10: getAsset
/**
* Create an asset object, bridging this class and the Asset classes
* @param string
* @param string $type The type of the asset
* @param string $id_path Either the ID string or the path of the asset
* @param binary $site_name The site name
*
* @return mixed The asset object
* @throw Exception if the asset cannot be retrieved
*/
public function getAsset($type, $id_path, $site_name = NULL)
{
if (!in_array($type, c\T::getTypeArray())) {
throw new e\NoSuchTypeException(S_SPAN . "The type {$type} does not exist." . E_SPAN);
}
$class_name = c\T::$type_class_name_map[$type];
// get class name
$class_name = a\Asset::NAME_SPACE . "\\" . $class_name;
try {
return new $class_name($this, $this->createId($type, $id_path, $site_name));
} catch (\Exception $e) {
if (self::DEBUG && self::DUMP) {
u\DebugUtility::out($e->getMessage());
}
throw $e;
}
}
示例11: 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;
}
}
}
}
//.........这里部分代码省略.........
示例12: processStructuredDataNodePhantom
public static function processStructuredDataNodePhantom($parent_id, &$node_array, $node_std, $data_definition)
{
if (self::DEBUG) {
u\DebugUtility::out("Parent ID: " . $parent_id);
}
if (!is_array($node_std)) {
$node_std = array($node_std);
}
$node_count = count($node_std);
if (self::DEBUG) {
u\DebugUtility::out("Node count: " . $node_count);
}
// these are used to calculate the index
$previous_identifier;
$current_identifier;
$cur_index = 0;
// work out the id of the current node for the data definition
// no digits in the fully qualified identifiers
for ($i = 0; $i < $node_count; $i++) {
$fq_identifier = $node_std[$i]->identifier;
if ($parent_id != '') {
$parent_id_array = explode(self::DELIMITER, $parent_id);
$temp = '';
foreach ($parent_id_array as $part) {
if (!is_numeric($part)) {
$temp .= $part . self::DELIMITER;
}
}
$temp = trim($temp, self::DELIMITER);
$fq_identifier = $temp . self::DELIMITER . $node_std[$i]->identifier;
}
try {
$is_multiple = $data_definition->isMultiple($fq_identifier);
} catch (e\NoSuchFieldException $e) {
self::$phantoms[] = $fq_identifier;
continue;
}
if (isset($current_identifier)) {
$previous_identifier = $current_identifier;
}
$current_identifier = $node_std[$i]->identifier;
// a multiple text or group, work out fully qualified identifier
if ($is_multiple) {
// an old one, keep counting
if (isset($previous_identifier) && $previous_identifier == $current_identifier) {
$cur_index++;
} else {
$cur_index = 0;
}
}
if ($parent_id != '') {
$n = new StructuredDataNodePhantom($node_std[$i], NULL, $data_definition, $cur_index, $parent_id);
} else {
$n = new StructuredDataNodePhantom($node_std[$i], NULL, $data_definition, $cur_index);
}
$n->parent_id = $parent_id;
$node_array[$i] = $n;
}
}
示例13: setDynamicFieldValue
public function setDynamicFieldValue($field, $values)
{
if (!is_array($values)) {
$values = array($values);
}
$v_count = count($values);
if ($this->metadata_set == NULL) {
$this->metadata_set = a\Asset::getAsset($this->service, a\MetadataSet::TYPE, $this->metadata_set_id);
}
$df_def = $this->metadata_set->getDynamicMetadataFieldDefinition($field);
$field_type = $df_def->getFieldType();
$required = $df_def->getRequired();
$df = $this->getDynamicField($field);
// text can accept anything
if ($field_type == c\T::TEXT && $v_count == 1) {
$value = $values[0];
if ($value == NULL) {
// turn NULL to empty string
$value = '';
}
if ($required && $value == '') {
throw new e\RequiredFieldException(S_SPAN . "The {$field_type} requires non-empty value" . E_SPAN);
}
$v = new \stdClass();
$v->value = $value;
$df->setValue(array($v));
} else {
if (($field_type == c\T::RADIO || $field_type == c\T::DROPDOWN) && $v_count == 1) {
$value = $values[0];
// read first value
if ($value == '') {
// turn empty string to NULL
$value = NULL;
}
if ($required && $value == NULL) {
// cannot be empty if required
throw new e\RequiredFieldException(S_SPAN . "The {$field_type} requires non-empty value." . E_SPAN);
}
$possible_values = $df_def->getPossibleValueStrings();
// read from metadataSet
if (!in_array($value, $possible_values) && isset($value)) {
// undefined value
throw new e\NoSuchValueException(S_SPAN . "The value {$value} does not exist." . E_SPAN);
}
$v = new \stdClass();
if ($value != '') {
$v->value = $value;
}
$df->setValue(array($v));
} else {
if (($field_type == c\T::CHECKBOX || $field_type == c\T::MULTISELECT) && $v_count > 0) {
if (self::DEBUG) {
u\DebugUtility::out('Setting values for checkbox or multiselect');
}
if ($required && (in_array(NULL, $values) || in_array('', $values))) {
throw new e\RequiredFieldException(S_SPAN . "The {$field_type} requires non-empty value." . E_SPAN);
}
$possible_values = $df_def->getPossibleValueStrings();
foreach ($values as $value) {
if (self::DEBUG) {
u\DebugUtility::out("Value: {$value}");
}
if (!in_array($value, $possible_values) && isset($value)) {
throw new e\NoSuchValueException(S_SPAN . "The value {$value} does not exist." . E_SPAN);
}
}
$v_array = array();
foreach ($values as $value) {
$v = new \stdClass();
$v->value = $value;
$v_array[] = $v;
}
$df->setValue($v_array);
if (self::DEBUG && self::DUMP) {
u\DebugUtility::dump($df->toStdClass());
}
}
}
}
//if( self::DEBUG && self::DUMP ){ u\DebugUtility::dump( $this ); }
return $this;
}
示例14: hasPageRegion
public function hasPageRegion($region_name)
{
if (self::DEBUG) {
u\DebugUtility::out("Region name fed in: " . $region_name);
}
return isset($this->page_region_map[$region_name]);
}
示例15: 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 {
u\DebugUtility::dump($service);
u\DebugUtility::out("Hello");
echo u\ReflectionUtility::getClassDocumentation("cascade_ws_utility\\DebugUtility", true);
} catch (\Exception $e) {
echo S_PRE . $e . E_PRE;
} catch (\Error $er) {
echo S_PRE . $er . E_PRE;
}