当前位置: 首页>>代码示例>>PHP>>正文


PHP cascade_ws_utility\DebugUtility类代码示例

本文整理汇总了PHP中cascade_ws_utility\DebugUtility的典型用法代码示例。如果您正苦于以下问题:PHP DebugUtility类的具体用法?PHP DebugUtility怎么用?PHP DebugUtility使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了DebugUtility类的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;
 }
开发者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


注:本文中的cascade_ws_utility\DebugUtility类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。