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


PHP Code::getClass方法代码示例

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


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

示例1: log

 protected function log(\Exception $e, $contextInfo = NULL)
 {
     if ($e instanceof \ErrorException) {
         $errorType = self::$errors[$e->getSeverity()];
     } else {
         $errorType = Code::getClass($e);
     }
     // wir müssen hier den error selbst loggen, da php nichts mehr macht (die faule banane)
     $php = NULL;
     $php .= 'PHP ' . $errorType . ': ' . $e->getMessage() . ' in ' . $e->getFile() . ' on line ' . $e->getLine() . "\n";
     $php .= $errorType . ': ' . \Psc\Exception::getExceptionText($e, 'text') . "\n";
     error_log($php, 0);
     /* Debug-Mail */
     $debug = NULL;
     $debug .= '[' . date('d.M.Y H:i:s') . "] ";
     $debug .= $errorType . ': ' . \Psc\Exception::getExceptionText($e, 'text') . "\n";
     if ($e instanceof \Psc\Code\ErrorException) {
         $debug .= "\n" . $e->contextDump;
     }
     if (isset($contextInfo)) {
         $debug .= "\nContextInfo: \n" . $contextInfo;
     }
     if (isset($this->recipient) && !PSC::inTests()) {
         if ($ret = @mail($this->recipient, '[Psc-ErrorHandler] [' . $e->getCode() . '] ' . $e->getMessage(), $debug, 'From: www@' . PSC::getEnvironment()->getHostName() . "\r\n" . 'Content-Type: text/plain; charset=UTF-8' . "\r\n") === FALSE) {
             error_log('[\\Psc\\Code\\ErrorHandler.php:' . __LINE__ . '] Die Fehlerinformationen konnten nicht an den lokalen Mailer übergeben werden.', 0);
         }
     }
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:28,代码来源:ErrorHandler.php

示例2: callGetter

 /**
  * Ruft den Getter für das Feld $field auf dem Entity auf
  *
  * @param string $field der Name des Feldes in CamelCase
  * @return mixed
  */
 public function callGetter($field)
 {
     $f = 'get' . ucfirst($field);
     if (!method_exists($this, $f)) {
         throw new \InvalidArgumentException($f . '() existiert nicht in ' . \Psc\Code\Code::getClass($this));
     }
     return $this->{$f}();
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:14,代码来源:BaseEntity.php

示例3: assertRoutingException

 public function assertRoutingException(Closure $c, $debugMessage = '')
 {
     try {
         $c();
     } catch (\Exception $e) {
         if ($e instanceof \Psc\CMS\Service\ControllerRouteException || $e instanceof \Psc\Net\HTTP\HTTPException || $e instanceof \Psc\Net\RequestMatchingException) {
             return;
         } else {
             $this->fail('Exception: Psc\\CMS\\Service\\ControllerRouteException oder Psc\\Net\\RequestMatchingException erwartet. Es wurde aber ' . \Psc\Code\Code::getClass($e) . ' gecatched. (ExceptionMessage: ' . $e->getMessage() . ') ' . $debugMessage);
         }
     }
     $this->fail('Exception: Psc\\CMS\\Service\\ControllerRouteException oder Psc\\Net\\RequestMatchingException erwartet. Es wurde aber keine gecatched. ' . $debugMessage);
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:13,代码来源:ServiceBase.php

示例4: doInit

 protected function doInit()
 {
     // damit die components der form innerhalb des formpanels an der richtigen stelle stehen
     // holen wir uns diese aus der Componentsform
     foreach ($this->form->getComponents() as $key => $component) {
         try {
             $this->content['component' . $key] = $component->html();
         } catch (\Psc\Exception $e) {
             throw new \Psc\Exception('Component ' . Code::getClass($component) . ' verursachte einen Fehler beim HTML-Erzeugen', 0, $e);
         }
     }
     parent::doInit();
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:13,代码来源:EntityFormPanel.php

示例5: testAfterLogoutValidateIsNotOkay

 public function testAfterLogoutValidateIsNotOkay()
 {
     // pre: validate does not throw exception
     $this->auth->login($this->id, $this->pw);
     $this->expectUserInDB();
     $this->auth->validate();
     // now logout
     $this->auth->logout();
     try {
         $this->auth->validate();
         $this->fail('validate sollte eine exception schmeissen, da der User ausgeloggt ist');
     } catch (NoAuthException $e) {
         return;
     }
     $this->fail('Falsche Exception Gecatched: ' . \Psc\Code\Code::getClass($e));
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:16,代码来源:AuthTest.php

示例6: getAnnotationName

 /**
  * @param PscAnnotation|DoctrineAnnotation $annotation
  */
 public function getAnnotationName($annotation)
 {
     if ($annotation instanceof PscAnnotation) {
         $name = $annotation->getAnnotationName();
     } else {
         $name = \Psc\Code\Code::getClass($annotation);
     }
     if (isset($this->defaultAnnotationNamespace) && mb_strpos($name, $this->defaultAnnotationNamespace) === 0) {
         return mb_substr($name, mb_strlen($this->defaultAnnotationNamespace) + 1);
     }
     foreach ($this->annotationNamespaceAliases as $alias => $namespace) {
         if (mb_strpos($name, $namespace) === 0) {
             return $alias . '\\' . mb_substr($name, mb_strlen($namespace) + 1);
         }
     }
     return '\\' . $name;
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:20,代码来源:AnnotationWriter.php

示例7: walk

 protected function walk($ast)
 {
     if (is_object($ast)) {
         $this->stack[] = Code::getClass($ast);
     }
     /* es muss nach der "spezialität" von Klassen sortiert werden
           die Klassen am tiefsten in der Hierarchie müssen nach oben
           gleichzeitig ist die Schleife auch Performance-Kritisch
        */
     if ($ast instanceof \Psc\HTML\Page) {
         return $this->walkPage($ast);
     } elseif ($ast instanceof \Bugatti\Templates\LanguagePicker) {
         return $this->walkLanguagePicker($ast);
     } elseif ($ast instanceof \Bugatti\Templates\Headline) {
         return $this->walkHeadline($ast);
     } elseif ($ast instanceof \Bugatti\Templates\NavigationLevel) {
         return $this->walkNavigationLevel($ast);
     } elseif ($ast instanceof \Bugatti\Templates\Section) {
         return $this->walkContainer($ast);
     } elseif ($ast instanceof \Bugatti\Templates\Container) {
         return $this->walkContainer($ast);
     } elseif ($ast instanceof \Psc\Data\ArrayCollection) {
         return $this->walkCollection($ast);
     } elseif ($ast instanceof \Bugatti\Templates\LayoutTable) {
         return $this->walkLayoutTable($ast);
     } elseif ($ast instanceof \Bugatti\Templates\ContentTable) {
         return $this->walkContentTable($ast);
     }
     if (is_string($ast)) {
         return $ast;
     }
     if (is_int($ast)) {
         return $ast;
     }
     if (is_array($ast)) {
         return $ast;
     }
     var_dump($this->stack);
     throw new ASTException('kann mit dem Part: ' . Code::varInfo($ast) . ' nichts anfangen');
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:40,代码来源:ASTCompiler.php

示例8: compile

 public function compile()
 {
     $gClass = new \Psc\Code\Generate\GClass(\Psc\Code\Code::getClass($this));
     $gClass->elevateClass();
     $this->log('compiling ProjectEntities:');
     foreach ($gClass->getMethods() as $method) {
         if (\Psc\Preg::match($method->getName(), '/^compile[a-z0-9A-Z_]+$/') && $method->isPublic()) {
             $this->modelCompiler = NULL;
             // neuen erzeugen damit flags resetted werden, etc
             $m = $method->getName();
             $this->log('  ' . $m . ':');
             try {
                 $out = $this->{$m}($this->getModelCompiler());
             } catch (\Doctrine\DBAL\DBALException $e) {
                 if (mb_strpos($e->getMessage(), 'Unknown column type') !== FALSE) {
                     $types = A::implode(\Doctrine\DBAL\Types\Type::getTypesMap(), "\n", function ($fqn, $type) {
                         return $type . "\t\t" . ': ' . $fqn;
                     });
                     throw new \Psc\Exception('Database Error: Unknown Column Type: types are: ' . "\n" . $types, $e->getCode(), $e);
                 }
                 throw $e;
             } catch (\Exception $e) {
                 $this->log('    Fehler beim Aufruf von ' . $m);
                 throw $e;
             }
             if ($out instanceof \Webforge\Common\System\File) {
                 $this->log('    ' . $out . ' geschrieben');
             } elseif (is_array($out)) {
                 foreach ($out as $file) {
                     $this->log('    ' . $file . ' geschrieben');
                 }
             } elseif ($out instanceof \Psc\Doctrine\EntityBuilder) {
                 $this->log('    ' . $out->getWrittenFile() . ' geschrieben');
             }
         }
     }
     $this->log('finished.');
     return $this;
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:39,代码来源:ProjectCompiler.php

示例9: decorateWalkable

 public function decorateWalkable($walkable, $walkedFields)
 {
     return '@' . Code::getClass($walkable) . '(' . implode(', ', $walkedFields) . ')';
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:4,代码来源:WalkerTest.php

示例10: __toString

 /**
  * @cc-ignore
  */
 public function __toString()
 {
     return '[class ' . Code::getClass($this) . ' not converted to string]';
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:7,代码来源:SimpleObject.php

示例11: findService

 /**
  * Sucht den ersten der Services, der den Request bearbeiten will
  * 
  * @throws NoServiceFoundException
  */
 public function findService(ServiceRequest $serviceRequest)
 {
     $this->log('Find Services..');
     foreach ($this->services as $service) {
         $this->log('Service: ' . Code::getClass($service) . '::isResponsibleFor');
         if ($service->isResponsibleFor($serviceRequest)) {
             $this->log('ok: Service übernimmt den Request');
             return $service;
         }
     }
     throw NoServiceFoundException::build('Es konnte kein passender Service ermittelt werden. Es wurden %d Services (%s) befragt.', count($this->services), \Webforge\Common\ArrayUtil::implode($this->services, ', ', function ($svc) {
         return Code::getClass($svc);
     }))->set('serviceRequest', $serviceRequest)->end();
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:19,代码来源:RequestHandler.php

示例12: getEntityName

 /**
  * Gibt den FQN des Entities zurück
  *
  * dies kann man zur Performance überschreiben
  * @return string
  */
 public function getEntityName()
 {
     return \Psc\Code\Code::getClass($this);
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:10,代码来源:AbstractEntity.php

示例13: registerCacheAdapter

 public function registerCacheAdapter(CacheAdapter $adapter, $name = NULL)
 {
     if (!isset($name)) {
         $name = Code::getClassName(Code::getClass($adapter));
     }
     $this->registeredCacheAdapters[$name] = $adapter;
     return $this;
 }
开发者ID:pscheit,项目名称:psc-cms-image,代码行数:8,代码来源:Manager.php

示例14: getRepositoryMock

 public function getRepositoryMock(\Psc\Code\Test\Base $testCase, $entityName, array $methods = NULL)
 {
     $realRepository = $this->getRepository($entityName);
     $class = Code::getClass($realRepository);
     return $testCase->getMock($class, $methods, array($this, $this->getClassMetadata($entityName)));
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:6,代码来源:EntityManager.php

示例15: deploy

 public function deploy()
 {
     $this->init();
     $this->logf('Starting Deployment [%s%s] to %s', $this->project->getName(), $this->variant ? '.' . $this->variant : NULL, $this->target);
     foreach ($this->tasks as $task) {
         try {
             $label = $task instanceof LabelTask ? $task->getLabel() : Code::getClassName(Code::getClass($task));
             $this->logf('** Task: %s', $label);
             $task->run();
         } catch (\Webforge\Common\Exception\MessageException $e) {
             $e->prependMessage('ERROR in task ' . $label . '. ');
             throw $e;
         }
     }
     $this->logf('finished Deployment [%s%s]', $this->project->getName(), $this->variant ? '.' . $this->variant : NULL);
 }
开发者ID:pscheit,项目名称:psc-cms,代码行数:16,代码来源:Deployer.php


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