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


PHP Code::expandNamespace方法代码示例

本文整理汇总了PHP中Psc\Code\Code::expandNamespace方法的典型用法代码示例。如果您正苦于以下问题:PHP Code::expandNamespace方法的具体用法?PHP Code::expandNamespace怎么用?PHP Code::expandNamespace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Psc\Code\Code的用法示例。


在下文中一共展示了Code::expandNamespace方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: createComponent

 public function createComponent($class)
 {
     $class = Code::expandNamespace($class, 'Psc\\UI\\Component');
     $component = new $class();
     $this->manager->dispatchEvent(self::EVENT_COMPONENT_CREATED, array('component' => $component, 'componentClass' => $class), $this);
     return $component;
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:7,代码来源:ComponentMapper.php

示例2: assertTypeMapsComponent

 protected function assertTypeMapsComponent($class, WebforgeType $type, $mapper = NULL)
 {
     $mapper = $mapper ?: new ComponentMapper();
     $this->assertInstanceOf('Psc\\CMS\\Component', $component = $mapper->inferComponent($type));
     if ($class !== 'any') {
         $class = Code::expandNamespace($class, 'Psc\\UI\\Component');
         $this->assertInstanceOf($class, $component);
     }
     return $component;
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:10,代码来源:TestCase.php

示例3: array

use Webforge\Setup\ConfigurationTester\ConfigurationTester;
use Psc\System\System;
use Psc\Code\Generate\ClassWriter;
use Webforge\Common\JS\JSONConverter;
use Psc\JS\jQuery;
use Seld\JsonLint\JsonParser;
/**
 *
 * $createCommand = function ($name, array|closure $configure, closure $execute) {
 * 
 * $arg = function ($name, $description = NULL, $required = TRUE) // default: required
 * $opt = function($name, $short = NULL, $withValue = TRUE, $description = NULL) // default: mit value required
 * $flag = function($name, $short = NULL, $description) // ohne value
 */
$createCommand('compile:komodo-command-call', array($arg('extension-name')), function ($input, $output, $command) {
    $extensionClass = Code::expandNamespace(\Webforge\Common\String::expand($input->getArgument('extension-name'), 'Extension'), 'Psc\\Code\\Compile');
    $extension = GClass::factory($extensionClass);
    $fields = array();
    if ($extension->hasMethod('__construct')) {
        foreach ($extension->getMethod('__construct')->getParameters() as $param) {
            $fields[] = $param->getName();
        }
    }
    // das nimmt vielleicht zu viele, weis nicht, alternativ würds auch ne statische methode zur extension tun
    foreach ($extension->getProperties() as $property) {
        $fields[] = $property->getName();
    }
    $json = array();
    foreach (array_unique($fields) as $field) {
        $json[$field] = '%(ask:' . $field . ')';
    }
开发者ID:pscheit,项目名称:psc-cms,代码行数:31,代码来源:inc.commands.php

示例4: assertInstanceOfL

 protected function assertInstanceOfL($element, $actual, $msg = '')
 {
     $element = Code::expandNamespace('L' . $element, 'Psc\\Code\\AST');
     return $this->assertInstanceOf($element, $actual, $msg);
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:5,代码来源:ParserTest.php

示例5: getEntityName

 /**
  * Gibt die Klasse (den vollen Namen) eines Entities zurück
  * 
  * speaker => 'projectNamespace\Entities\Speaker'
  * oid => 'projectNamespace\Entities\OID'
  *
  * Dies wird z.B. für die Umwandlung von entity-bezeichnern in URLs in echte Klassen gebraucht.
  * Irreguläre Namen (sowas wie OID) können in $this->getEntityNames() eingetragen werden
  *
  * @param string $input kann ein Name in LowerCase sein, eine volle Klasse oder auch ein TabsContentItem2::getTabsResourceName() sein
  */
 public function getEntityName($input)
 {
     if (is_string($input)) {
         if (array_key_exists($input, $names = $this->getEntityNames())) {
             $name = $names[$input];
         } elseif (mb_strpos($input, '\\') === FALSE) {
             $name = \Webforge\Common\String::ucfirst($input);
         } else {
             $name = $input;
         }
         return Code::expandNamespace($name, $this->getEntitiesNamespace());
     }
     throw new \Psc\Exception('unbekannter Fall für getEntityName. Input ist: ' . Code::varInfo($input));
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:25,代码来源:Module.php

示例6: parseExtensionGClass

 protected function parseExtensionGClass($input)
 {
     $extensionClass = Code::expandNamespace(\Webforge\Common\String::expand($input->getArgument('name'), 'Extension'), 'Psc\\Code\\Compile');
     return GClass::factory($extensionClass);
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:5,代码来源:GenericCompileCommand.php

示例7: createTask

 /**
  * wird automatisch mit dependencies erstellt
  * @param string $name der Name des Tasks ohne Namespace und "Task" dahinter
  */
 public function createTask($name)
 {
     $this->init();
     $class = Code::expandNamespace(\Webforge\Common\String::expand($name, 'Task'), 'Psc\\System\\Deploy');
     $gClass = GClass::factory($class);
     $params = array();
     if ($gClass->hasMethod('__construct')) {
         $constructor = $gClass->getMethod('__construct');
         foreach ($constructor->getParameters() as $parameter) {
             $params[] = $this->resolveTaskDependency($parameter, $gClass);
         }
     }
     return $gClass->newInstance($params);
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:18,代码来源:Deployer.php

示例8: testExpandNamespace

 /**
  * @dataProvider provideTestExpandNamespace
  * @group expandnamespace
  */
 public function testExpandNamespace($expectedClass, $candidate, $expandNamespace)
 {
     $this->assertEquals($expectedClass, Code::expandNamespace($candidate, $expandNamespace));
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:8,代码来源:CodeTest.php


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