本文整理汇总了PHP中Zend\Code\Reflection\ClassReflection::isInternal方法的典型用法代码示例。如果您正苦于以下问题:PHP ClassReflection::isInternal方法的具体用法?PHP ClassReflection::isInternal怎么用?PHP ClassReflection::isInternal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Code\Reflection\ClassReflection
的用法示例。
在下文中一共展示了ClassReflection::isInternal方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dumpClass
/**
* Returns class' code inside namespace
*
* @param ClassReflection $class
*/
private function dumpClass(ClassReflection $class)
{
if (array_search($class->getName(), $this->cachedClasses) !== false) {
return;
}
if ($class->isInternal()) {
return;
}
if ($class->getParentClass()) {
$this->dumpClass($class->getParentClass());
}
foreach ($class->getInterfaces() as $interface) {
$this->dumpClass($interface);
}
if ($class->getTraits()) {
foreach ($class->getTraits() as $trait) {
$this->dumpClass($trait);
}
}
$classContents = $class->getContents(false);
$classFileDir = dirname($class->getFileName());
$classContents = trim(str_replace('__DIR__', sprintf("'%s'", $classFileDir), $classContents));
$uses = implode("\n", $this->codeGenerator->getUseLines($class));
$this->cache[] = "namespace " . $class->getNamespaceName() . " {\n" . ($uses ? $uses . "\n" : '') . $this->codeGenerator->getDeclarationLine($class) . "\n" . $classContents . "\n}\n";
$this->cachedClasses[] = $class->getName();
}
示例2: shouldSkip
private function shouldSkip(ClassReflection $class)
{
if ($class->isInternal()) {
return true;
}
foreach ($this->skip as $prefix) {
if (strpos($class->getName(), $prefix) === 0) {
return true;
}
}
return false;
}
示例3: cache
/**
* Cache declared interfaces and classes to a single file
*
* @param \Zend\Mvc\MvcEvent $e
* @return void
*/
public function cache($e)
{
$request = $e->getRequest();
if ($request instanceof ConsoleRequest || $request->getQuery()->get('EDPSUPERLUMINAL_CACHE', null) === null) {
return;
}
if (file_exists(ZF_CLASS_CACHE)) {
$this->reflectClassCache();
$code = file_get_contents(ZF_CLASS_CACHE);
} else {
$code = "<?php\n";
}
$classes = array_merge(get_declared_interfaces(), get_declared_classes());
foreach ($classes as $class) {
// Skip non-Zend classes
if (0 !== strpos($class, 'Zend')) {
continue;
}
// Skip the autoloader factory and this class
if (in_array($class, array('Zend\\Loader\\AutoloaderFactory', __CLASS__))) {
continue;
}
if ($class === 'Zend\\Loader\\SplAutoloader') {
continue;
}
// Skip any classes we already know about
if (in_array($class, $this->knownClasses)) {
continue;
}
$this->knownClasses[] = $class;
$class = new ClassReflection($class);
// Skip any Annotation classes
$docBlock = $class->getDocBlock();
if ($docBlock) {
if ($docBlock->getTags('Annotation')) {
continue;
}
}
// Skip ZF2-based autoloaders
if (in_array('Zend\\Loader\\SplAutoloader', $class->getInterfaceNames())) {
continue;
}
// Skip internal classes or classes from extensions
// (this shouldn't happen, as we're only caching Zend classes)
if ($class->isInternal() || $class->getExtensionName()) {
continue;
}
$code .= static::getCacheCode($class);
}
file_put_contents(ZF_CLASS_CACHE, $code);
// minify the file
file_put_contents(ZF_CLASS_CACHE, php_strip_whitespace(ZF_CLASS_CACHE));
}
示例4: processClassIntoCacheFile
/**
* Makes several checks.
*
* 1. Exclude blacklisted namespaces
* 2. Exclude blacklisted classes
* 3. Skip Internal classes
*
* @param Reflection\ClassReflection $class
*/
protected function processClassIntoCacheFile(Reflection\ClassReflection $class)
{
if ($this->classList[$class->getName()] === true) {
return;
}
if ($class->isInternal() === true) {
return;
}
// Make the string regex compactible
$excludeNamespaces = array_map(function ($namespace) {
return str_replace('\\', '[\\\\]', $namespace);
}, $this->getConfig()->getIgnoreNamespaces());
// Make the regex
$excludeNamespaceRegex = '/^(' . implode('|', $excludeNamespaces) . ')(.*)/';
if (preg_match($excludeNamespaceRegex, $class->getName())) {
return;
}
$this->classList[$class->getName()] = true;
$this->buildNamespace($class);
}
示例5: isSatisfiedBy
/**
* @param ClassReflection $class
* @return bool
*/
public function isSatisfiedBy(ClassReflection $class)
{
// Skip internal classes or classes from extensions
// (this shouldn't happen, as we're only caching Zend classes)
return $class->isInternal() || $class->getExtensionName();
}