/app/libs/nette.min.php
PHP | 5617 lines | 5475 code | 134 blank | 8 comment | 61 complexity | 5b4618b87e2daa7fce18c578cb0d4f10 MD5 | raw file
Large files files are truncated, but you can click here to view the full file
- <?php //netteloader=Nette\Framework
- namespace {/**
- * Nette Framework (version 2.0.3 released on 2012-04-04, http://nette.org)
- *
- * Copyright (c) 2004, 2012 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.
- */
- error_reporting(E_ALL|E_STRICT);@set_magic_quotes_runtime(FALSE);iconv_set_encoding('internal_encoding','UTF-8');extension_loaded('mbstring')&&mb_internal_encoding('UTF-8');umask(0);@header('X-Powered-By: Nette Framework');@header('Content-Type: text/html; charset=utf-8');define('NETTE',TRUE);define('NETTE_DIR',__DIR__);define('NETTE_VERSION_ID',20003);define('NETTE_PACKAGE','5.3');}namespace Nette\Diagnostics{use
- Nette;interface
- IBarPanel{function
- getTab();function
- getPanel();}}namespace Nette\Application{use
- Nette;interface
- IPresenter{function
- run(Request$request);}interface
- IPresenterFactory{function
- getPresenterClass(&$name);function
- createPresenter($name);}interface
- IResponse{function
- send(Nette\Http\IRequest$httpRequest,Nette\Http\IResponse$httpResponse);}interface
- IRouter{const
- ONE_WAY=1;const
- SECURED=2;function
- match(Nette\Http\IRequest$httpRequest);function
- constructUrl(Request$appRequest,Nette\Http\Url$refUrl);}}namespace Nette{use
- Nette;interface
- IFreezable{function
- freeze();function
- isFrozen();}}namespace Nette\ComponentModel{use
- Nette;interface
- IComponent{const
- NAME_SEPARATOR='-';function
- getName();function
- getParent();function
- setParent(IContainer$parent=NULL,$name=NULL);}interface
- IContainer
- extends
- IComponent{function
- addComponent(IComponent$component,$name);function
- removeComponent(IComponent$component);function
- getComponent($name);function
- getComponents($deep=FALSE,$filterType=NULL);}}namespace Nette\Application\UI{use
- Nette;interface
- ISignalReceiver{function
- signalReceived($signal);}interface
- IStatePersistent{function
- loadState(array$params);function
- saveState(array&$params);}interface
- IRenderable{function
- invalidateControl();function
- isControlInvalid();}}namespace Nette\Caching{use
- Nette;interface
- IStorage{function
- read($key);function
- lock($key);function
- write($key,$data,array$dependencies);function
- remove($key);function
- clean(array$conds);}}namespace Nette\Caching\Storages{use
- Nette;interface
- IJournal{function
- write($key,array$dependencies);function
- clean(array$conditions);}}namespace Nette\Config{use
- Nette;interface
- IAdapter{function
- load($file);function
- dump(array$data);}}namespace Nette\Database{use
- Nette;interface
- ISupplementalDriver{const
- META='meta';function
- delimite($name);function
- formatDateTime(\DateTime$value);function
- formatLike($value,$pos);function
- applyLimit(&$sql,$limit,$offset);function
- normalizeRow($row,$statement);function
- getTables();function
- getColumns($table);function
- getIndexes($table);function
- getForeignKeys($table);}interface
- IReflection{const
- FIELD_TEXT='string',FIELD_BINARY='bin',FIELD_BOOL='bool',FIELD_INTEGER='int',FIELD_FLOAT='float',FIELD_DATE='date',FIELD_TIME='time',FIELD_DATETIME='datetime';function
- getPrimary($table);function
- getHasManyReference($table,$key);function
- getBelongsToReference($table,$key);function
- setConnection(Connection$connection);}}namespace Nette\DI{use
- Nette;interface
- IContainer{function
- addService($name,$service);function
- getService($name);function
- removeService($name);function
- hasService($name);}}namespace Nette\Forms{use
- Nette;interface
- IControl{function
- loadHttpData();function
- setValue($value);function
- getValue();function
- getRules();function
- getErrors();function
- isDisabled();function
- translate($s,$count=NULL);}interface
- ISubmitterControl
- extends
- IControl{function
- isSubmittedBy();function
- getValidationScope();}interface
- IFormRenderer{function
- render(Form$form);}}namespace Nette\Http{use
- Nette;interface
- IRequest{const
- GET='GET',POST='POST',HEAD='HEAD',PUT='PUT',DELETE='DELETE';function
- getUrl();function
- getQuery($key=NULL,$default=NULL);function
- getPost($key=NULL,$default=NULL);function
- getFile($key);function
- getFiles();function
- getCookie($key,$default=NULL);function
- getCookies();function
- getMethod();function
- isMethod($method);function
- getHeader($header,$default=NULL);function
- getHeaders();function
- isSecured();function
- isAjax();function
- getRemoteAddress();function
- getRemoteHost();}interface
- IResponse{const
- PERMANENT=2116333333;const
- BROWSER=0;const
- S200_OK=200,S204_NO_CONTENT=204,S300_MULTIPLE_CHOICES=300,S301_MOVED_PERMANENTLY=301,S302_FOUND=302,S303_SEE_OTHER=303,S303_POST_GET=303,S304_NOT_MODIFIED=304,S307_TEMPORARY_REDIRECT=307,S400_BAD_REQUEST=400,S401_UNAUTHORIZED=401,S403_FORBIDDEN=403,S404_NOT_FOUND=404,S405_METHOD_NOT_ALLOWED=405,S410_GONE=410,S500_INTERNAL_SERVER_ERROR=500,S501_NOT_IMPLEMENTED=501,S503_SERVICE_UNAVAILABLE=503;function
- setCode($code);function
- getCode();function
- setHeader($name,$value);function
- addHeader($name,$value);function
- setContentType($type,$charset=NULL);function
- redirect($url,$code=self::S302_FOUND);function
- setExpiration($seconds);function
- isSent();function
- getHeaders();function
- setCookie($name,$value,$expire,$path=NULL,$domain=NULL,$secure=NULL,$httpOnly=NULL);function
- deleteCookie($name,$path=NULL,$domain=NULL,$secure=NULL);}interface
- ISessionStorage{function
- open($savePath,$sessionName);function
- close();function
- read($id);function
- write($id,$data);function
- remove($id);function
- clean($maxlifetime);}}namespace Nette\Security{use
- Nette;interface
- IUserStorage{const
- MANUAL=1,INACTIVITY=2,BROWSER_CLOSED=4;const
- CLEAR_IDENTITY=8;function
- setAuthenticated($state);function
- isAuthenticated();function
- setIdentity(IIdentity$identity=NULL);function
- getIdentity();function
- setExpiration($time,$flags=0);function
- getLogoutReason();}}namespace Nette\Latte{use
- Nette;interface
- IMacro{function
- initialize();function
- finalize();function
- nodeOpened(MacroNode$node);function
- nodeClosed(MacroNode$node);}}namespace Nette\Localization{use
- Nette;interface
- ITranslator{function
- translate($message,$count=NULL);}}namespace Nette\Mail{use
- Nette;interface
- IMailer{function
- send(Message$mail);}}namespace Nette\Reflection{use
- Nette;interface
- IAnnotation{function
- __construct(array$values);}}namespace Nette\Security{use
- Nette;interface
- IAuthenticator{const
- USERNAME=0,PASSWORD=1;const
- IDENTITY_NOT_FOUND=1,INVALID_CREDENTIAL=2,FAILURE=3,NOT_APPROVED=4;function
- authenticate(array$credentials);}interface
- IAuthorizator{const
- ALL=NULL;const
- ALLOW=TRUE;const
- DENY=FALSE;function
- isAllowed($role,$resource,$privilege);}interface
- IIdentity{function
- getId();function
- getRoles();}interface
- IResource{function
- getResourceId();}interface
- IRole{function
- getRoleId();}}namespace Nette\Templating{use
- Nette;interface
- ITemplate{function
- render();}interface
- IFileTemplate
- extends
- ITemplate{function
- setFile($file);function
- getFile();}}namespace Nette{use
- Nette;class
- ArgumentOutOfRangeException
- extends\InvalidArgumentException{}class
- InvalidStateException
- extends\RuntimeException{}class
- NotImplementedException
- extends\LogicException{}class
- NotSupportedException
- extends\LogicException{}class
- DeprecatedException
- extends
- NotSupportedException{}class
- MemberAccessException
- extends\LogicException{}class
- IOException
- extends\RuntimeException{}class
- FileNotFoundException
- extends
- IOException{}class
- DirectoryNotFoundException
- extends
- IOException{}class
- InvalidArgumentException
- extends\InvalidArgumentException{}class
- OutOfRangeException
- extends\OutOfRangeException{}class
- UnexpectedValueException
- extends\UnexpectedValueException{}class
- StaticClassException
- extends\LogicException{}class
- FatalErrorException
- extends\ErrorException{function
- __construct($message,$code,$severity,$file,$line,$context){parent::__construct($message,$code,$severity,$file,$line);$this->context=$context;}}abstract
- class
- Object{static
- function
- getReflection(){return
- new
- Reflection\ClassType(get_called_class());}function
- __call($name,$args){return
- ObjectMixin::call($this,$name,$args);}static
- function
- __callStatic($name,$args){return
- ObjectMixin::callStatic(get_called_class(),$name,$args);}static
- function
- extensionMethod($name,$callback=NULL){if(strpos($name,'::')===FALSE){$class=get_called_class();}else{list($class,$name)=explode('::',$name);}$class=new
- Reflection\ClassType($class);if($callback===NULL){return$class->getExtensionMethod($name);}else{$class->setExtensionMethod($name,$callback);}}function&__get($name){return
- ObjectMixin::get($this,$name);}function
- __set($name,$value){return
- ObjectMixin::set($this,$name,$value);}function
- __isset($name){return
- ObjectMixin::has($this,$name);}function
- __unset($name){ObjectMixin::remove($this,$name);}}}namespace Nette\Utils{use
- Nette;final
- class
- LimitedScope{private
- static$vars;final
- function
- __construct(){throw
- new
- Nette\StaticClassException;}static
- function
- evaluate(){if(func_num_args()>1){self::$vars=func_get_arg(1);extract(self::$vars);}$res=eval('?>'.func_get_arg(0));if($res===FALSE&&($error=error_get_last())&&$error['type']===E_PARSE){throw
- new
- Nette\FatalErrorException($error['message'],0,$error['type'],$error['file'],$error['line'],NULL);}return$res;}static
- function
- load(){if(func_num_args()>1){self::$vars=func_get_arg(1);if(self::$vars===TRUE){return include_once func_get_arg(0);}extract(self::$vars);}return include func_get_arg(0);}}}namespace Nette\Loaders{use
- Nette;abstract
- class
- AutoLoader
- extends
- Nette\Object{static
- private$loaders=array();public
- static$count=0;final
- static
- function
- load($type){foreach(func_get_args()as$type){if(!class_exists($type)){throw
- new
- Nette\InvalidStateException("Unable to load class or interface '$type'.");}}}final
- static
- function
- getLoaders(){return
- array_values(self::$loaders);}function
- register(){if(!function_exists('spl_autoload_register')){throw
- new
- Nette\NotSupportedException('spl_autoload does not exist in this PHP installation.');}spl_autoload_register(array($this,'tryLoad'));self::$loaders[spl_object_hash($this)]=$this;}function
- unregister(){unset(self::$loaders[spl_object_hash($this)]);return
- spl_autoload_unregister(array($this,'tryLoad'));}abstract
- function
- tryLoad($type);}}namespace Nette\Diagnostics{use
- Nette;final
- class
- Helpers{static
- function
- editorLink($file,$line){if(Debugger::$editor&&is_file($file)){$dir=dirname(strtr($file,'/',DIRECTORY_SEPARATOR));$base=isset($_SERVER['SCRIPT_FILENAME'])?dirname(dirname(strtr($_SERVER['SCRIPT_FILENAME'],'/',DIRECTORY_SEPARATOR))):dirname($dir);if(substr($dir,0,strlen($base))===$base){$dir='...'.substr($dir,strlen($base));}return
- Nette\Utils\Html::el('a')->href(strtr(Debugger::$editor,array('%file'=>rawurlencode($file),'%line'=>$line)))->title("$file:$line")->setHtml(htmlSpecialChars(rtrim($dir,DIRECTORY_SEPARATOR)).DIRECTORY_SEPARATOR.'<b>'.htmlSpecialChars(basename($file)).'</b>');}else{return
- Nette\Utils\Html::el('span')->setText($file);}}static
- function
- htmlDump(&$var,$level=0){static$tableUtf,$tableBin,$reBinary='#[^\x09\x0A\x0D\x20-\x7E\xA0-\x{10FFFF}]#u';if($tableUtf===NULL){foreach(range("\x00","\xFF")as$ch){if(ord($ch)<32&&strpos("\r\n\t",$ch)===FALSE){$tableUtf[$ch]=$tableBin[$ch]='\\x'.str_pad(dechex(ord($ch)),2,'0',STR_PAD_LEFT);}elseif(ord($ch)<127){$tableUtf[$ch]=$tableBin[$ch]=$ch;}else{$tableUtf[$ch]=$ch;$tableBin[$ch]='\\x'.dechex(ord($ch));}}$tableBin["\\"]='\\\\';$tableBin["\r"]='\\r';$tableBin["\n"]='\\n';$tableBin["\t"]='\\t';$tableUtf['\\x']=$tableBin['\\x']='\\\\x';}if(is_bool($var)){return'<span class="php-bool">'.($var?'TRUE':'FALSE')."</span>\n";}elseif($var===NULL){return"<span class=\"php-null\">NULL</span>\n";}elseif(is_int($var)){return"<span class=\"php-int\">$var</span>\n";}elseif(is_float($var)){$var=var_export($var,TRUE);if(strpos($var,'.')===FALSE){$var.='.0';}return"<span class=\"php-float\">$var</span>\n";}elseif(is_string($var)){if(Debugger::$maxLen&&strlen($var)>Debugger::$maxLen){$s=htmlSpecialChars(substr($var,0,Debugger::$maxLen),ENT_NOQUOTES,'ISO-8859-1').' ... ';}else{$s=htmlSpecialChars($var,ENT_NOQUOTES,'ISO-8859-1');}$s=strtr($s,preg_match($reBinary,$s)||preg_last_error()?$tableBin:$tableUtf);$len=strlen($var);return"<span class=\"php-string\">\"$s\"</span>".($len>1?" ($len)":"")."\n";}elseif(is_array($var)){$s='<span class="php-array">array</span>('.count($var).") ";$space=str_repeat($space1=' ',$level);$brackets=range(0,count($var)-1)===array_keys($var)?"[]":"{}";static$marker;if($marker===NULL){$marker=uniqid("\x00",TRUE);}if(empty($var)){}elseif(isset($var[$marker])){$brackets=$var[$marker];$s.="$brackets[0] *RECURSION* $brackets[1]";}elseif($level<Debugger::$maxDepth||!Debugger::$maxDepth){$s.="<code>$brackets[0]\n";$var[$marker]=$brackets;foreach($var
- as$k=>&$v){if($k===$marker){continue;}$k=strtr($k,preg_match($reBinary,$k)||preg_last_error()?$tableBin:$tableUtf);$k=htmlSpecialChars(preg_match('#^\w+$#',$k)?$k:"\"$k\"");$s.="$space$space1<span class=\"php-key\">$k</span> => ".self::htmlDump($v,$level+1);}unset($var[$marker]);$s.="$space$brackets[1]</code>";}else{$s.="$brackets[0] ... $brackets[1]";}return$s."\n";}elseif(is_object($var)){if($var
- instanceof\Closure){$rc=new\ReflectionFunction($var);$arr=array();foreach($rc->getParameters()as$param){$arr[]='$'.$param->getName();}$arr=array('file'=>$rc->getFileName(),'line'=>$rc->getStartLine(),'parameters'=>implode(', ',$arr));}else{$arr=(array)$var;}$s='<span class="php-object">'.get_class($var)."</span>(".count($arr).") ";$space=str_repeat($space1=' ',$level);static$list=array();if(empty($arr)){}elseif(in_array($var,$list,TRUE)){$s.="{ *RECURSION* }";}elseif($level<Debugger::$maxDepth||!Debugger::$maxDepth||$var
- instanceof\Closure){$s.="<code>{\n";$list[]=$var;foreach($arr
- as$k=>&$v){$m='';if($k[0]==="\x00"){$m=' <span class="php-visibility">'.($k[1]==='*'?'protected':'private').'</span>';$k=substr($k,strrpos($k,"\x00")+1);}$k=strtr($k,preg_match($reBinary,$k)||preg_last_error()?$tableBin:$tableUtf);$k=htmlSpecialChars(preg_match('#^\w+$#',$k)?$k:"\"$k\"");$s.="$space$space1<span class=\"php-key\">$k</span>$m => ".self::htmlDump($v,$level+1);}array_pop($list);$s.="$space}</code>";}else{$s.="{ ... }";}return$s."\n";}elseif(is_resource($var)){return'<span class="php-resource">'.htmlSpecialChars(get_resource_type($var))." resource</span>\n";}else{return"<span>unknown type</span>\n";}}static
- function
- clickableDump($dump,$collapsed=FALSE){return'<pre class="nette-dump">'.preg_replace_callback('#^( *)((?>[^(\r\n]{1,200}))\((\d+)\) <code>#m',function($m)use($collapsed){return"$m[1]<a href='#' rel='next'>$m[2]($m[3]) ".(($m[1]||!$collapsed)&&($m[3]<7)?'<abbr>▼</abbr> </a><code>':'<abbr>►</abbr> </a><code class="nette-collapsed">');},self::htmlDump($dump)).'</pre>';}static
- function
- findTrace(array$trace,$method,&$index=NULL){$m=explode('::',$method);foreach($trace
- as$i=>$item){if(isset($item['function'])&&$item['function']===end($m)&&isset($item['class'])===isset($m[1])&&(!isset($item['class'])||$item['class']===$m[0]||is_subclass_of($item['class'],$m[0]))){$index=$i;return$item;}}}}}namespace Nette\Utils{use
- Nette;class
- Html
- extends
- Nette\Object
- implements\ArrayAccess,\Countable,\IteratorAggregate{private$name;private$isEmpty;public$attrs=array();protected$children=array();public
- static$xhtml=TRUE;public
- static$emptyElements=array('img'=>1,'hr'=>1,'br'=>1,'input'=>1,'meta'=>1,'area'=>1,'embed'=>1,'keygen'=>1,'source'=>1,'base'=>1,'col'=>1,'link'=>1,'param'=>1,'basefont'=>1,'frame'=>1,'isindex'=>1,'wbr'=>1,'command'=>1);static
- function
- el($name=NULL,$attrs=NULL){$el=new
- static;$parts=explode(' ',$name,2);$el->setName($parts[0]);if(is_array($attrs)){$el->attrs=$attrs;}elseif($attrs!==NULL){$el->setText($attrs);}if(isset($parts[1])){foreach(Strings::matchAll($parts[1].' ','#([a-z0-9:-]+)(?:=(["\'])?(.*?)(?(2)\\2|\s))?#i')as$m){$el->attrs[$m[1]]=isset($m[3])?$m[3]:TRUE;}}return$el;}final
- function
- setName($name,$isEmpty=NULL){if($name!==NULL&&!is_string($name)){throw
- new
- Nette\InvalidArgumentException("Name must be string or NULL, ".gettype($name)." given.");}$this->name=$name;$this->isEmpty=$isEmpty===NULL?isset(static::$emptyElements[$name]):(bool)$isEmpty;return$this;}final
- function
- getName(){return$this->name;}final
- function
- isEmpty(){return$this->isEmpty;}function
- addAttributes(array$attrs){$this->attrs=$attrs+$this->attrs;return$this;}final
- function
- __set($name,$value){$this->attrs[$name]=$value;}final
- function&__get($name){return$this->attrs[$name];}final
- function
- __isset($name){return
- isset($this->attrs[$name]);}final
- function
- __unset($name){unset($this->attrs[$name]);}final
- function
- __call($m,$args){$p=substr($m,0,3);if($p==='get'||$p==='set'||$p==='add'){$m=substr($m,3);$m[0]=$m[0]|"\x20";if($p==='get'){return
- isset($this->attrs[$m])?$this->attrs[$m]:NULL;}elseif($p==='add'){$args[]=TRUE;}}if(count($args)===0){}elseif(count($args)===1){$this->attrs[$m]=$args[0];}elseif((string)$args[0]===''){$tmp=&$this->attrs[$m];}elseif(!isset($this->attrs[$m])||is_array($this->attrs[$m])){$this->attrs[$m][$args[0]]=$args[1];}else{$this->attrs[$m]=array($this->attrs[$m],$args[0]=>$args[1]);}return$this;}final
- function
- href($path,$query=NULL){if($query){$query=http_build_query($query,NULL,'&');if($query!==''){$path.='?'.$query;}}$this->attrs['href']=$path;return$this;}final
- function
- setHtml($html){if($html===NULL){$html='';}elseif(is_array($html)){throw
- new
- Nette\InvalidArgumentException("Textual content must be a scalar, ".gettype($html)." given.");}else{$html=(string)$html;}$this->removeChildren();$this->children[]=$html;return$this;}final
- function
- getHtml(){$s='';foreach($this->children
- as$child){if(is_object($child)){$s.=$child->render();}else{$s.=$child;}}return$s;}final
- function
- setText($text){if(!is_array($text)){$text=htmlspecialchars((string)$text,ENT_NOQUOTES);}return$this->setHtml($text);}final
- function
- getText(){return
- html_entity_decode(strip_tags($this->getHtml()),ENT_QUOTES,'UTF-8');}final
- function
- add($child){return$this->insert(NULL,$child);}final
- function
- create($name,$attrs=NULL){$this->insert(NULL,$child=static::el($name,$attrs));return$child;}function
- insert($index,$child,$replace=FALSE){if($child
- instanceof
- Html||is_scalar($child)){if($index===NULL){$this->children[]=$child;}else{array_splice($this->children,(int)$index,$replace?1:0,array($child));}}else{throw
- new
- Nette\InvalidArgumentException("Child node must be scalar or Html object, ".(is_object($child)?get_class($child):gettype($child))." given.");}return$this;}final
- function
- offsetSet($index,$child){$this->insert($index,$child,TRUE);}final
- function
- offsetGet($index){return$this->children[$index];}final
- function
- offsetExists($index){return
- isset($this->children[$index]);}function
- offsetUnset($index){if(isset($this->children[$index])){array_splice($this->children,(int)$index,1);}}final
- function
- count(){return
- count($this->children);}function
- removeChildren(){$this->children=array();}final
- function
- getIterator($deep=FALSE){if($deep){$deep=$deep>0?\RecursiveIteratorIterator::SELF_FIRST:\RecursiveIteratorIterator::CHILD_FIRST;return
- new\RecursiveIteratorIterator(new
- Nette\Iterators\Recursor(new\ArrayIterator($this->children)),$deep);}else{return
- new
- Nette\Iterators\Recursor(new\ArrayIterator($this->children));}}final
- function
- getChildren(){return$this->children;}final
- function
- render($indent=NULL){$s=$this->startTag();if(!$this->isEmpty){if($indent!==NULL){$indent++;}foreach($this->children
- as$child){if(is_object($child)){$s.=$child->render($indent);}else{$s.=$child;}}$s.=$this->endTag();}if($indent!==NULL){return"\n".str_repeat("\t",$indent-1).$s."\n".str_repeat("\t",max(0,$indent-2));}return$s;}final
- function
- __toString(){return$this->render();}final
- function
- startTag(){if($this->name){return'<'.$this->name.$this->attributes().(static::$xhtml&&$this->isEmpty?' />':'>');}else{return'';}}final
- function
- endTag(){return$this->name&&!$this->isEmpty?'</'.$this->name.'>':'';}final
- function
- attributes(){if(!is_array($this->attrs)){return'';}$s='';foreach($this->attrs
- as$key=>$value){if($value===NULL||$value===FALSE){continue;}elseif($value===TRUE){if(static::$xhtml){$s.=' '.$key.'="'.$key.'"';}else{$s.=' '.$key;}continue;}elseif(is_array($value)){if($key==='data'){foreach($value
- as$k=>$v){if($v!==NULL&&$v!==FALSE){$s.=' data-'.$k.'="'.htmlspecialchars((string)$v).'"';}}continue;}$tmp=NULL;foreach($value
- as$k=>$v){if($v!=NULL){$tmp[]=$v===TRUE?$k:(is_string($k)?$k.':'.$v:$v);}}if($tmp===NULL){continue;}$value=implode($key==='style'||!strncmp($key,'on',2)?';':' ',$tmp);}else{$value=(string)$value;}$s.=' '.$key.'="'.htmlspecialchars($value).'"';}$s=str_replace('@','@',$s);return$s;}function
- __clone(){foreach($this->children
- as$key=>$value){if(is_object($value)){$this->children[$key]=clone$value;}}}}}namespace Nette\Diagnostics{use
- Nette;final
- class
- Debugger{public
- static$productionMode;public
- static$consoleMode;public
- static$time;private
- static$ajaxDetected;public
- static$source;public
- static$editor='editor://open/?file=%file&line=%line';public
- static$browser;public
- static$maxDepth=3;public
- static$maxLen=150;public
- static$showLocation=FALSE;public
- static$consoleColors=array('bool'=>'1;33','null'=>'1;33','int'=>'1;36','float'=>'1;36','string'=>'1;32','array'=>'1;31','key'=>'1;37','object'=>'1;31','visibility'=>'1;30','resource'=>'1;37');const
- DEVELOPMENT=FALSE,PRODUCTION=TRUE,DETECT=NULL;public
- static$blueScreen;public
- static$strictMode=FALSE;public
- static$scream=FALSE;public
- static$onFatalError=array();private
- static$enabled=FALSE;private
- static$lastError=FALSE;public
- static$logger;public
- static$fireLogger;public
- static$logDirectory;public
- static$email;public
- static$mailer;public
- static$emailSnooze;public
- static$bar;private
- static$errorPanel;private
- static$dumpPanel;const
- DEBUG='debug',INFO='info',WARNING='warning',ERROR='error',CRITICAL='critical';final
- function
- __construct(){throw
- new
- Nette\StaticClassException;}static
- function
- _init(){self::$time=microtime(TRUE);self::$consoleMode=PHP_SAPI==='cli';self::$productionMode=self::DETECT;if(self::$consoleMode){self::$source=empty($_SERVER['argv'])?'cli':'cli: '.implode(' ',$_SERVER['argv']);}else{self::$ajaxDetected=isset($_SERVER['HTTP_X_REQUESTED_WITH'])&&$_SERVER['HTTP_X_REQUESTED_WITH']==='XMLHttpRequest';if(isset($_SERVER['REQUEST_URI'])){self::$source=(isset($_SERVER['HTTPS'])&&strcasecmp($_SERVER['HTTPS'],'off')?'https://':'http://').(isset($_SERVER['HTTP_HOST'])?$_SERVER['HTTP_HOST']:(isset($_SERVER['SERVER_NAME'])?$_SERVER['SERVER_NAME']:'')).$_SERVER['REQUEST_URI'];}}self::$logger=new
- Logger;self::$logDirectory=&self::$logger->directory;self::$email=&self::$logger->email;self::$mailer=&self::$logger->mailer;self::$emailSnooze=&Logger::$emailSnooze;self::$fireLogger=new
- FireLogger;self::$blueScreen=new
- BlueScreen;self::$blueScreen->addPanel(function($e){if($e
- instanceof
- Nette\Templating\FilterException){return
- array('tab'=>'Template','panel'=>'<p><b>File:</b> '.Helpers::editorLink($e->sourceFile,$e->sourceLine).' <b>Line:</b> '.($e->sourceLine?$e->sourceLine:'n/a').'</p>'.($e->sourceLine?BlueScreen::highlightFile($e->sourceFile,$e->sourceLine):''));}elseif($e
- instanceof
- Nette\Utils\NeonException&&preg_match('#line (\d+)#',$e->getMessage(),$m)){if($item=Helpers::findTrace($e->getTrace(),'Nette\Config\Adapters\NeonAdapter::load')){return
- array('tab'=>'NEON','panel'=>'<p><b>File:</b> '.Helpers::editorLink($item['args'][0],$m[1]).' <b>Line:</b> '.$m[1].'</p>'.BlueScreen::highlightFile($item['args'][0],$m[1]));}elseif($item=Helpers::findTrace($e->getTrace(),'Nette\Utils\Neon::decode')){return
- array('tab'=>'NEON','panel'=>BlueScreen::highlightPhp($item['args'][0],$m[1]));}}});self::$bar=new
- Bar;self::$bar->addPanel(new
- DefaultBarPanel('time'));self::$bar->addPanel(new
- DefaultBarPanel('memory'));self::$bar->addPanel(self::$errorPanel=new
- DefaultBarPanel('errors'));self::$bar->addPanel(self::$dumpPanel=new
- DefaultBarPanel('dumps'));}static
- function
- enable($mode=NULL,$logDirectory=NULL,$email=NULL){error_reporting(E_ALL|E_STRICT);if(is_bool($mode)){self::$productionMode=$mode;}elseif($mode!==self::DETECT||self::$productionMode===NULL){$mode=is_string($mode)?preg_split('#[,\s]+#',$mode):(array)$mode;$mode[]='127.0.0.1';$mode[]='::1';self::$productionMode=!in_array(isset($_SERVER['REMOTE_ADDR'])?$_SERVER['REMOTE_ADDR']:php_uname('n'),$mode,TRUE);}if(is_string($logDirectory)){self::$logDirectory=realpath($logDirectory);if(self::$logDirectory===FALSE){throw
- new
- Nette\DirectoryNotFoundException("Directory '$logDirectory' is not found.");}}elseif($logDirectory===FALSE){self::$logDirectory=FALSE;}elseif(self::$logDirectory===NULL){self::$logDirectory=defined('APP_DIR')?APP_DIR.'/../log':getcwd().'/log';}if(self::$logDirectory){ini_set('error_log',self::$logDirectory.'/php_error.log');}if(function_exists('ini_set')){ini_set('display_errors',!self::$productionMode);ini_set('html_errors',FALSE);ini_set('log_errors',FALSE);}elseif(ini_get('display_errors')!=!self::$productionMode&&ini_get('display_errors')!==(self::$productionMode?'stderr':'stdout')){throw
- new
- Nette\NotSupportedException('Function ini_set() must be enabled.');}if($email){if(!is_string($email)){throw
- new
- Nette\InvalidArgumentException('Email address must be a string.');}self::$email=$email;}if(!defined('E_DEPRECATED')){define('E_DEPRECATED',8192);}if(!defined('E_USER_DEPRECATED')){define('E_USER_DEPRECATED',16384);}if(!self::$enabled){register_shutdown_function(array(__CLASS__,'_shutdownHandler'));set_exception_handler(array(__CLASS__,'_exceptionHandler'));set_error_handler(array(__CLASS__,'_errorHandler'));self::$enabled=TRUE;}}static
- function
- isEnabled(){return
- self::$enabled;}static
- function
- log($message,$priority=self::INFO){if(self::$logDirectory===FALSE){return;}elseif(!self::$logDirectory){throw
- new
- Nette\InvalidStateException('Logging directory is not specified in Nette\Diagnostics\Debugger::$logDirectory.');}if($message
- instanceof\Exception){$exception=$message;$message=($message
- instanceof
- Nette\FatalErrorException?'Fatal error: '.$exception->getMessage():get_class($exception).": ".$exception->getMessage())." in ".$exception->getFile().":".$exception->getLine();$hash=md5($exception);$exceptionFilename="exception-".@date('Y-m-d-H-i-s')."-$hash.html";foreach(new\DirectoryIterator(self::$logDirectory)as$entry){if(strpos($entry,$hash)){$exceptionFilename=$entry;$saved=TRUE;break;}}}self::$logger->log(array(@date('[Y-m-d H-i-s]'),trim($message),self::$source?' @ '.self::$source:NULL,!empty($exceptionFilename)?' @@ '.$exceptionFilename:NULL),$priority);if(!empty($exceptionFilename)){$exceptionFilename=self::$logDirectory.'/'.$exceptionFilename;if(empty($saved)&&$logHandle=@fopen($exceptionFilename,'w')){ob_start();ob_start(function($buffer)use($logHandle){fwrite($logHandle,$buffer);},4096);self::$blueScreen->render($exception);ob_end_flush();ob_end_clean();fclose($logHandle);}return
- strtr($exceptionFilename,'\\/',DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR);}}static
- function
- _shutdownHandler(){if(!self::$enabled){return;}static$types=array(E_ERROR=>1,E_CORE_ERROR=>1,E_COMPILE_ERROR=>1,E_PARSE=>1);$error=error_get_last();if(isset($types[$error['type']])){self::_exceptionHandler(new
- Nette\FatalErrorException($error['message'],0,$error['type'],$error['file'],$error['line'],NULL));}if(self::$bar&&!self::$productionMode&&self::isHtmlMode()){self::$bar->render();}}static
- function
- _exceptionHandler(\Exception$exception){if(!headers_sent()){$protocol=isset($_SERVER['SERVER_PROTOCOL'])?$_SERVER['SERVER_PROTOCOL']:'HTTP/1.1';header($protocol.' 500',TRUE,500);}try{if(self::$productionMode){try{self::log($exception,self::ERROR);}catch(\Exception$e){echo'FATAL ERROR: unable to log error';}if(self::$consoleMode){echo"ERROR: the server encountered an internal error and was unable to complete your request.\n";}elseif(self::isHtmlMode()){?>
- <!DOCTYPE html>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name=robots content=noindex><meta name=generator content="Nette Framework">
- <style>body{color:#333;background:white;width:500px;margin:100px auto}h1{font:bold 47px/1.5 sans-serif;margin:.6em 0}p{font:21px/1.5 Georgia,serif;margin:1.5em 0}small{font-size:70%;color:gray}</style>
- <title>Server Error</title>
- <h1>Server Error</h1>
- <p>We're sorry! The server encountered an internal error and was unable to complete your request. Please try again later.</p>
- <p><small>error 500</small></p>
- <?php }}else{if(self::$consoleMode){echo"$exception\n";if($file=self::log($exception)){echo"(stored in $file)\n";if(self::$browser){exec(self::$browser.' '.escapeshellarg($file));}}}elseif(self::isHtmlMode()){self::$blueScreen->render($exception);if(self::$bar){self::$bar->render();}}elseif(!self::fireLog($exception,self::ERROR)){$file=self::log($exception);if(!headers_sent()){header("X-Nette-Error-Log: $file");}}}foreach(self::$onFatalError
- as$handler){call_user_func($handler,$exception);}}catch(\Exception$e){if(self::$productionMode){echo
- self::isHtmlMode()?'<meta name=robots content=noindex>FATAL ERROR':'FATAL ERROR';}else{echo"FATAL ERROR: thrown ",get_class($e),': ',$e->getMessage(),"\nwhile processing ",get_class($exception),': ',$exception->getMessage(),"\n";}}self::$enabled=FALSE;exit(255);}static
- function
- _errorHandler($severity,$message,$file,$line,$context){if(self::$scream){error_reporting(E_ALL|E_STRICT);}if(self::$lastError!==FALSE&&($severity&error_reporting())===$severity){self::$lastError=new\ErrorException($message,0,$severity,$file,$line);return
- NULL;}if($severity===E_RECOVERABLE_ERROR||$severity===E_USER_ERROR){throw
- new
- Nette\FatalErrorException($message,0,$severity,$file,$line,$context);}elseif(($severity&error_reporting())!==$severity){return
- FALSE;}elseif(!self::$productionMode&&(is_bool(self::$strictMode)?self::$strictMode:((self::$strictMode&$severity)===$severity))){self::_exceptionHandler(new
- Nette\FatalErrorException($message,0,$severity,$file,$line,$context));}static$types=array(E_WARNING=>'Warning',E_COMPILE_WARNING=>'Warning',E_USER_WARNING=>'Warning',E_NOTICE=>'Notice',E_USER_NOTICE=>'Notice',E_STRICT=>'Strict standards',E_DEPRECATED=>'Deprecated',E_USER_DEPRECATED=>'Deprecated');$message='PHP '.(isset($types[$severity])?$types[$severity]:'Unknown error').": $message";$count=&self::$errorPanel->data["$message|$file|$line"];if($count++){return
- NULL;}elseif(self::$productionMode){self::log("$message in $file:$line",self::ERROR);return
- NULL;}else{$ok=self::fireLog(new\ErrorException($message,0,$severity,$file,$line),self::WARNING);return!self::isHtmlMode()||(!self::$bar&&!$ok)?FALSE:NULL;}return
- FALSE;}static
- function
- toStringException(\Exception$exception){if(self::$enabled){self::_exceptionHandler($exception);}else{trigger_error($exception->getMessage(),E_USER_ERROR);}}static
- function
- tryError(){if(!self::$enabled&&self::$lastError===FALSE){set_error_handler(array(__CLASS__,'_errorHandler'));}self::$lastError=NULL;}static
- function
- catchError(&$error){if(!self::$enabled&&self::$lastError!==FALSE){restore_error_handler();}$error=self::$lastError;self::$lastError=FALSE;return(bool)$error;}static
- function
- dump($var,$return=FALSE){if(!$return&&self::$productionMode){return$var;}$output="<pre class=\"nette-dump\">".Helpers::htmlDump($var)."</pre>\n";if(!$return){$trace=debug_backtrace(FALSE);$i=Helpers::findTrace($trace,'dump')?1:0;if(isset($trace[$i]['file'],$trace[$i]['line'])&&is_file($trace[$i]['file'])){$lines=file($trace[$i]['file']);preg_match('#dump\((.*)\)#',$lines[$trace[$i]['line']-1],$m);$output=substr_replace($output,' title="'.htmlspecialchars((isset($m[0])?"$m[0] \n":'')."in file {$trace[$i]['file']} on line {$trace[$i]['line']}").'"',4,0);if(self::$showLocation){$output=substr_replace($output,' <small>in '.Helpers::editorLink($trace[$i]['file'],$trace[$i]['line']).":{$trace[$i]['line']}</small>",-8,0);}}}if(self::$consoleMode){if(self::$consoleColors&&substr(PHP_OS,0,3)!=='WIN'){$output=preg_replace_callback('#<span class="php-(\w+)">|</span>#',function($m){return"\033[".(isset($m[1],Debugger::$consoleColors[$m[1]])?Debugger::$consoleColors[$m[1]]:'0')."m";},$output);}$output=htmlspecialchars_decode(strip_tags($output),ENT_QUOTES);}if($return){return$output;}else{echo$output;return$var;}}static
- function
- timer($name=NULL){static$time=array();$now=microtime(TRUE);$delta=isset($time[$name])?$now-$time[$name]:0;$time[$name]=$now;return$delta;}static
- function
- barDump($var,$title=NULL){if(!self::$productionMode){$dump=array();foreach((is_array($var)?$var:array(''=>$var))as$key=>$val){$dump[$key]=Helpers::clickableDump($val);}self::$dumpPanel->data[]=array('title'=>$title,'dump'=>$dump);}return$var;}static
- function
- fireLog($message){if(!self::$productionMode){return
- self::$fireLogger->log($message);}}private
- static
- function
- isHtmlMode(){return!self::$ajaxDetected&&!self::$consoleMode&&!preg_match('#^Content-Type: (?!text/html)#im',implode("\n",headers_list()));}static
- function
- addPanel(IBarPanel$panel,$id=NULL){return
- self::$bar->addPanel($panel,$id);}}class
- Logger
- extends
- Nette\Object{const
- DEBUG='debug',INFO='info',WARNING='warning',ERROR='error',CRITICAL='critical';public
- static$emailSnooze=172800;public$mailer=array(__CLASS__,'defaultMailer');public$directory;public$email;function
- log($message,$priority=self::INFO){if(!is_dir($this->directory)){throw
- new
- Nette\DirectoryNotFoundException("Directory '$this->directory' is not found or is not directory.");}if(is_array($message)){$message=implode(' ',$message);}$res=error_log(trim($message).PHP_EOL,3,$this->directory.'/'.strtolower($priority).'.log');if(($priority===self::ERROR||$priority===self::CRITICAL)&&$this->email&&$this->mailer&&@filemtime($this->directory.'/email-sent')+self::$emailSnooze<time()&&@file_put_contents($this->directory.'/email-sent','sent')){callback($this->mailer)->invoke($message,$this->email);}return$res;}static
- function
- defaultMailer($message,$email){$host='';foreach(array('HTTP_HOST','SERVER_NAME','HOSTNAME')as$item){if(isset($_SERVER[$item])){$host=$_SERVER[$item];break;}}$parts=str_replace(array("\r\n","\n"),array("\n",PHP_EOL),array('headers'=>"From: noreply@$host\nX-Mailer: Nette Framework\n",'subject'=>"PHP: An error occurred on the server $host",'body'=>"[".@date('Y-m-d H:i:s')."] $message"));mail($email,$parts['subject'],$parts['body'],$parts['headers']);}}class
- FireLogger
- extends
- Nette\Object{const
- DEBUG='debug',INFO='info',WARNING='warning',ERROR='error',CRITICAL='critical';private
- static$payload=array('logs'=>array());static
- function
- log($message,$priority=self::DEBUG){if(!isset($_SERVER['HTTP_X_FIRELOGGER'])||headers_sent()){return
- FALSE;}$item=array('name'=>'PHP','level'=>$priority,'order'=>count(self::$payload['logs']),'time'=>str_pad(number_format((microtime(TRUE)-Debugger::$time)*1000,1,'.',' '),8,'0',STR_PAD_LEFT).' ms','template'=>'','message'=>'','style'=>'background:#767ab6');$args=func_get_args();if(isset($args[0])&&is_string($args[0])){$item['template']=array_shift($args);}if(isset($args[0])&&$args[0]instanceof\Exception){$e=array_shift($args);$trace=$e->getTrace();if(isset($trace[0]['class'])&&$trace[0]['class']==='Nette\Diagnostics\Debugger'&&($trace[0]['function']==='_shutdownHandler'||$trace[0]['function']==='_errorHandler')){unset($trace[0]);}$file=str_replace(dirname(dirname(dirname($e->getFile()))),"\xE2\x80\xA6",$e->getFile());$item['template']=($e
- instanceof\ErrorException?'':get_class($e).': ').$e->getMessage().($e->getCode()?' #'.$e->getCode():'').' in '.$file.':'.$e->getLine();$item['pathname']=$e->getFile();$item['lineno']=$e->getLine();}else{$trace=debug_backtrace();if(isset($trace[1]['class'])&&$trace[1]['class']==='Nette\Diagnostics\Debugger'&&($trace[1]['function']==='fireLog')){unset($trace[0]);}foreach($trace
- as$frame){if(isset($frame['file'])&&is_file($frame['file'])){$item['pathname']=$frame['file'];$item['lineno']=$frame['line'];break;}}}$item['exc_info']=array('','',array());$item['exc_frames']=array();foreach($trace
- as$frame){$frame+=array('file'=>NULL,'line'=>NULL,'class'=>NULL,'type'=>NULL,'function'=>NULL,'object'=>NULL,'args'=>NULL);$item['exc_info'][2][]=array($frame['file'],$frame['line'],"$frame[class]$frame[type]$frame[function]",$frame['object']);$item['exc_frames'][]=$frame['args'];}if(isset($args[0])&&in_array($args[0],array(self::DEBUG,self::INFO,self::WARNING,self::ERROR,self::CRITICAL),TRUE)){$item['level']=array_shift($args);}$item['args']=$args;self::$payload['logs'][]=self::jsonDump($item,-1);foreach(str_split(base64_encode(@json_encode(self::$payload)),4990)as$k=>$v){header("FireLogger-de11e-$k:$v");}return
- TRUE;}private
- static
- function
- jsonDump(&$var,$level=0){if(is_bool($var)||is_null($var)||is_int($var)||is_float($var)){return$var;}elseif(is_string($var)){if(Debugger::$maxLen&&strlen($var)>Debugger::$maxLen){$var=substr($var,0,Debugger::$maxLen)." \xE2\x80\xA6 ";}return
- Nette\Utils\Strings::fixEncoding($var);}elseif(is_array($var)){static$marker;if($marker===NULL){$marker=uniqid("\x00",TRUE);}if(isset($var[$marker])){return"\xE2\x80\xA6RECURSION\xE2\x80\xA6";}elseif($level<Debugger::$maxDepth||!Debugger::$maxDepth){$var[$marker]=TRUE;$res=array();foreach($var
- as$k=>&$v){if($k!==$marker){$res[self::jsonDump($k)]=self::jsonDump($v,$level+1);}}unset($var[$marker]);return$res;}else{return" \xE2\x80\xA6 ";}}elseif(is_object($var)){$arr=(array)$var;static$list=array();if(in_array($var,$list,TRUE)){return"\xE2\x80\xA6RECURSION\xE2\x80\xA6";}elseif($level<Debugger::$maxDepth||!Debugger::$maxDepth){$list[]=$var;$res=array("\x00"=>'(object) '.get_class($var));foreach($arr
- as$k=>&$v){if($k[0]==="\x00"){$k=substr($k,strrpos($k,"\x00")+1);}$res[self::jsonDump($k)]=self::jsonDump($v,$level+1);}array_pop($list);return$res;}else{return" \xE2\x80\xA6 ";}}elseif(is_resource($var)){return"resource ".get_resource_type($var);}else{return"unknown type";}}}class
- BlueScreen
- extends
- Nette\Object{private$panels=array();function
- addPanel($panel){if(!in_array($panel,$this->panels,TRUE)){$this->panels[]=$panel;}return$this;}function
- render(\Exception$exception){$panels=$this->panels;static$errorTypes=array(E_ERROR=>'Fatal Error',E_USER_ERROR=>'User Error',E_RECOVERABLE_ERROR=>'Recoverable Error',E_CORE_ERROR=>'Core Error',E_COMPILE_ERROR=>'Compile Error',E_PARSE=>'Parse Error',E_WARNING=>'Warning',E_CORE_WARNING=>'Core Warning',E_COMPILE_WARNING=>'Compile Warning',E_USER_WARNING=>'User Warning',E_NOTICE=>'Notice',E_USER_NOTICE=>'User Notice',E_STRICT=>'Strict',E_DEPRECATED=>'Deprecated',E_USER_DEPRECATED=>'User Deprecated');$title=($exception
- instanceof
- Nette\FatalErrorException&&isset($errorTypes[$exception->getSeverity()]))?$errorTypes[$exception->getSeverity()]:get_class($exception);$expandPath=NETTE_DIR.DIRECTORY_SEPARATOR;$counter=0;?><!DOCTYPE html><!-- "' --></script></style></pre></xmp></table>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta name="robots" content="noindex,noarchive">
- <meta name="generator" content="Nette Framework">
- <title><?php echo
- htmlspecialchars($title)?></title><!-- <?php
- $ex=$exception;echo
- htmlspecialchars($ex->getMessage().($ex->getCode()?' #'.$ex->getCode():''));while((method_exists($ex,'getPrevious')&&$ex=$ex->getPrevious())||(isset($ex->previous)&&$ex=$ex->previous))echo
- htmlspecialchars('; caused by '.get_class($ex).' '.$ex->getMessage().($ex->getCode()?' #'.$ex->getCode():''));?> -->
- <style type="text/css" class="nette">html{overflow-y:scroll}body{margin:0 0 2em;padding:0}#netteBluescreen{font:9pt/1.5 Verdana,sans-serif;background:white;color:#333;position:absolute;left:0;top:0;width:100%;z-index:23178;text-align:left}#netteBluescreen *{font:inherit;color:inherit;background:transparent;border:none;margin:0;padding:0;text-align:inherit;text-indent:0}#netteBluescreen b{font-weight:bold}#netteBluescreen i{font-style:italic}#netteBluescreen a{text-decoration:none;color:#328ADC;padding:2px 4px;margin:-2px -4px}#netteBluescreen a:hover,#netteBluescreen a:active,#netteBluescreen a:focus{color:#085AA3}#netteBluescreen a abbr{font-family:sans-serif;color:#BBB}#netteBluescreenIcon{position:absolute;right:.5em;top:.5em;z-index:23179;text-decoration:none;background:#CD1818;padding:3px}#netteBluescreenError{background:#CD1818;color:white;font:13pt/1.5 Verdana,sans-serif!important;display:block}#netteBluescreenError #netteBsSearch{color:#CD1818;font-size:.7em}#netteBluescreenError:hover #netteBsSearch{color:#ED8383}#netteBluescreen h1{font-size:18pt;font-weight:normal;text-shadow:1px 1px 0 rgba(0,0,0,.4);margin:.7em 0}#netteBluescreen h2{font:14pt/1.5 sans-serif!important;color:#888;margin:.6em 0}#netteBluescreen h3{font:bold 10pt/1.5 Verdana,sans-serif!important;margin:1em 0;padding:0}#netteBluescreen p,#netteBluescreen pre{margin:.8em 0}#netteBluescreen pre,#netteBluescreen code,#netteBluescreen table{font:9pt/1.5 Consolas,monospace!important}#netteBluescreen pre,#netteBluescreen table{background:#FDF5CE;padding:.4em .7em;border:1px dotted silver;overflow:auto}#netteBluescreen pre div{min-width:100%;float:left;_float:none;white-space:pre}#netteBluescreen table pre{padding:0;margin:0;border:none}#netteBluescreen pre .php-array,#netteBluescreen pre .php-object{color:#C22}#netteBluescreen pre .php-string{color:#080}#netteBluescreen pre .php-int,#netteBluescreen pre .php-float,#netteBluescreen pre .php-null,#netteBluescreen pre .php-bool{color:#328ADC}#netteBluescreen pre .php-visibility{font-size:85%;color:#998}#netteBluescreen pre.nette-dump a{color:#333}#netteBluescreen div.panel{padding:1px 25px}#netteBluescreen div.inner{background:#F4F3F1;padding:.1em 1em 1em;border-radius:8px;-moz-border-radius:8px;-webkit-border-radius:8px}#netteBluescreen table{border-collapse:collapse;width:100%}#netteBluescreen .outer{overflow:auto}#netteBluescreen td,#netteBluescreen th{vertical-align:top;text-align:left;padding:2px 6px;border:1px solid #e6dfbf}#netteBluescreen th{font-weight:bold}#netteBluescreen tr>:first-child{width:20%}#netteBluescreen tr:nth-child(2n),#netteBluescreen tr:nth-child(2n) pre{background-color:#F7F0CB}#netteBluescreen ol{margin:1em 0;padding-left:2.5em}#netteBluescreen ul{font:7pt/1.5 Verdana,sans-serif!important;padding:2em 4em;margin:1em 0 0;color:#777;background:#F6F5F3 url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFEAAAAjCAMAAADbuxbOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAADBQTFRF/fz24d7Y7Onj5uLd9vPu3drUzMvG09LN39zW8e7o2NbQ3NnT29jS0M7J1tXQAAAApvmsFgAAABB0Uk5T////////////////////AOAjXRkAAAKlSURBVHja7FbbsqQgDAwENEgc//9vN+SCWDtbtXPmZR/Wc6o02mlC58LA9ckFAOszvMV8xNgyUjyXhojfMVKvRL0ZHavxXYy5JrmchMdzou8YlTClxajtK8ZGGpWRoBr1+gFjKfHkJPbizabLgzE3pH7Iu4K980xgFvlrVzMZoVBWhtvouCDdcTDmTgMCJdVxJ9MKO6XxnliM7hxi5lbj2ZVM4l8DqYyKoNLYcfqBB1/LpHYxEcfVG6ZpMDgyFUVWY/Q1sSYPpIdSAKWqLWL0XqWiMWc4hpH0OQOMOAgdycY4N9Sb7wWANQs3rsDSdLAYiuxi5siVfOhBWIrtH0G3kNaF/8Q4kCPE1kMucG/ZMUBUCOgiKJkPuWWTLGVgLGpwns1DraUayCtoBqERyaYtVsm85NActRooezvSLO/sKZP/nq8n4+xcyjNsRu8zW6KWpdb7wjiQd4WrtFZYFiKHENSmWp6xshh96c2RQ+c7Lt+qbijyEjHWUJ/pZsy8MGIUuzNiPySK2Gqoh6ZTRF6ko6q3nVTkaA//itIrDpW6l3SLo8juOmqMXkYknu5FdQxWbhCfKHEGDhxxyTVaXJF3ZjSl3jMksjSOOKmne9pI+mcG5QvaUJhI9HpkmRo2NpCrDJvsktRhRE2MM6F2n7dt4OaMUq8bCctk0+PoMRzL+1l5PZ2eyM/Owr86gf8z/tOM53lom5+nVcFuB+eJVzlXwAYy9TZ9s537tfqcsJWbEU4nBngZo6FfO9T9CdhfBtmk2dLiAy8uS4zwOpMx2HqYbTC+amNeAYTpsP4SIgvWfUBWXxn3CMHW3ffd7k3+YIkx7w0t/CVGvcPejoeOlzOWzeGbawOHqXQGUTMZRcfj4XPCgW9y/fuvVn8zD9P1QHzv80uAAQA0i3Jer7Jr7gAAAABJRU5ErkJggg==') 99% 10px no-repeat;border-top:1px solid #DDD}#netteBluescreen .highlight{background:#CD1818;color:white;font-weight:bold;font-style:normal;display:block;padding:0 .4em;margin:0 -.4em}#netteBluescreen .line{color:#9F9C7F;font-weight:normal;font-style:normal}#netteBluescreen a[href^=editor\:]{color:inherit;border-bottom:1px dotted #C1D2E1}</style>
- </head>
- <body>
- <div id="netteBluescreen">
- <a id="netteBluescreenIcon" href="#" rel="next"><abbr>▼</abbr></a
- ><div>
- <div id="netteBluescreenError" class="panel">
- <h1><?php echo
- htmlspecialchars($title),($exception->getCode()?' #'.$exception->getCode():'')?></h1>
- <p><?php echo
- htmlspecialchars($exception->getMessage())?> <a href="http://www.google.cz/search?sourceid=nette&q=<?php echo
- urlencode($title.' '.preg_replace('#\'.*\'|".*"#Us','',$exception->getMessage()))?>" id="netteBsSearch">search►</a></p>
- </div>
- <?php $ex=$exception;$level=0;?>
- <?php do{?>
- <?php if($level++):?>
- <div class="panel">
- <h2><a href="#" rel="netteBsPnl<?php echo++$counter?>">Caused by <abbr><?php echo($collapsed=$level>2)?'►':'▼'?></abbr></a></h2>
- <div id="netteBsPnl<?php echo$counter?>" class="<?php echo$collapsed?'nette-collapsed ':''?>inner">
- <div class="panel">
- <h1><?php echo
- htmlspecialchars(get_class($ex).($ex->getCode()?' #'.$ex->getCode():''))?></h1>
- <p><b><?php echo
- htmlspecialchars($ex->getMessage())?></b></p>
- </div>
- <?php endif?>
- <?php foreach($panels
- as$panel):?>
- <?php $panel=call_user_func($panel,$ex);if(empty($panel['tab'])||empty($panel['panel']))continue;?>
- <?php if(!empty($panel['bottom'])){continue;}?>
- <div class="panel">
- <h2><a href="#" rel="netteBsPnl<?php echo++$counter?>"><?php echo
- htmlSpecialChars($panel['tab'])?> <abbr>▼</abbr></a></h2>
- <div id="netteBsPnl<?php echo$counter?>" class="inner">
- <?php echo$panel['panel']?>
- </div></div>
- <?php endforeach?>
- <?php $stack=$ex->getTrace();$expanded=NULL?>
- <?php if(strpos($ex->getFile(),$expandPath)===0){foreach($stack
- as$key=>$row){if(isset($row['file'])&&strpos($row['file'],$expandPath)!==0){$expanded=$key;break;}}}?>
- <div class="panel">
- <h2><a href="#" rel="netteBsPnl<?php echo++$counter?>">Source file <abbr><?php echo($collapsed=$expanded!==NULL)?'►':'▼'?></abbr></a></h2>
- <div id="netteBsPnl<?php echo$counter?>" class="<?php echo$collapsed?'nette-collapsed ':''?>inner">
- <p><b>File:</b> <?php echo
- Helpers::editorLink($ex->getFile(),$ex->getLine())?> <b>Line:</b> <?php echo$ex->getLine()?></p>
- <?php if(is_file($ex->getFile())):?><?php echo
- self::highlightFile($ex->getFile(),$ex->getLine(),15,isset($ex->context)?$ex->context:NULL)?><?php endif?>
- </div></div>
- <?php if(isset($stack[0]['class'])&&$stack[0]['class']==='Nette\Diagnostics\Debugger'&&($stack[0]['function']==='_shutdownHandler'||$stack[0]['function']==='_errorHandler'))unset($stack[0])?>
- <?php if($stack):?>
- <div class="panel">
- <h2><a href="#" rel="netteBsPnl<?php echo++$counter?>">Call stack <abbr>▼</abbr></a></h2>
- <div id="netteBsPnl<?php echo$counter?>" class="inner">
- <ol>
- <?php foreach($stack
- as$key=>$row):?>
- <li><p>
- <?php if(isset($row['file'])&&is_file($row['file'])):?>
- <?php echo
- Helpers::editorLink($row['file'],$row['line']),':',$row['line']?>
- <?php else:?>
- <i>inner-code</i><?php if(isset($row['line']))echo':',$row['line']?>
- <?php endif?>
- <?php if(isset($row['file'])&&is_file($row['file'])):?><a href="#" rel="netteBsSrc<?php echo"$level-$key"?>">source <abbr>►</abbr></a> <?php endif?>
- <?php if(isset($row['class']))echo
- htmlspecialchars($row['class'].$row['type'])?>
- <?php echo
- htmlspecialchars($row['function'])?>
- (<?php if(!empty($row['args'])):?><a href="#" rel="netteBsArgs<?php echo"$level-$key"?>">arguments <abbr>►</abbr></a><?php endif?>)
- </p>
- <?php if(!empty($row['args'])):?>
- <div class="nette-collapsed outer" id="netteBsArgs<?php echo"$level-$key"?>">
- <table>
- <?php
- try{$r=isset($row['class'])?new\ReflectionMethod($row['class'],$row['function']):new\ReflectionFunction($row['function']);$params=$r->getParameters();}catch(\Exception$e){$params=array();}foreach($row['args']as$k=>$v){echo'<tr><th>',htmlspecialchars(isset($params[$k])?'$'.$params[$k]->name:"#$k"),'</th><td>';echo
- Helpers::clickableDump($v);echo"</td></tr>\n";}?>
- </table>
- </div>
- <?php endif?>
- <?php if(isset($row['file'])&&is_file($row['file'])):?>
- <div <?php if($expanded!==$key)echo'class="nette-collapsed"';?> id="netteBsSrc<?php echo"$level-$key"?>"><?php echo
- self::highlightFile($row['file'],$row['line'])?></div>
- <?php endif?>
- </li>
- <?php endforeach?>
- </ol>
- </div></div>
- <?php endif?>
- <?php if(isset($ex->context)&&is_array($ex->context)):?>
- <div class="panel">
- <h2><a href="#" rel="netteBsPnl<?php echo++$counter?>">Variables <abbr>►</abbr></a></h2>
- <div id="netteBsPnl<?php echo$counter?>" class="nette-collapsed inner">
- <div class="outer">
- <table>
- <?php
- foreach($ex->context
- as$k=>$v){echo'<tr><th>$',htmlspecialchars($k),'</th><td>',Helpers::clickableDump($v),"</td></tr>\n";}?>
- </table>
- </div>
- </div></div>
- <?php endif?>
- <?php }while((method_exists($ex,'getPrevious')&&$ex=$ex->getPrevious())||(isset($ex->previous)&&$ex=$ex->previous));?>
- <?php while(--$level)echo'</div></div>'?>
- <?php $bottomPanels=array()?>
- <?php foreach($panels
- as$panel):?>
- <?php $panel=call_user_func($panel,NULL);if(empty($panel['tab'])||empty($panel['panel']))continue;?>
- <?php if(!empty($panel['bottom'])){$bottomPanels[]=$panel;continue;}?>
- <div class="panel">
- <h2><a href="#" rel="netteBsPnl<?php echo++$counter?>"><?php echo
- htmlSpecialChars($panel['tab'])?> <abbr>►</abbr></a></h2>
- <div id="netteBsPnl<?php echo$counter?>" class="nette-collapsed inner">
- <?php echo$panel['panel']?>
- </div></div>
- <?php endforeach?>
- <div class="panel">
- <h2><a href="#" rel="netteBsPnl<?php echo++$counter?>">Environment <abbr>►</abbr></a></h2>
- <div id="netteBsPnl<?php echo$counter?>" class="nette-collapsed inner">
- <h3><a href="#" rel="netteBsPnl<?php echo++$counter?>">$_SERVER <abbr>▼</abbr></a></h3>
- <div id="netteBsPnl<?php echo$counter?>" class="outer">
- <table>
- <?php
- foreach($_SERVER
- as$k=>$v)echo'<tr><th>',htmlspecialchars($k),'</th><td>',Helpers::clickableDump($v),"</td></tr>\n";?>
- </table>
- </div>
- <h3><a href="#" rel="netteBsPnl<?php echo++$counter?>">$_SESSION <abbr>▼</abbr></a></h3>
- <div id="netteBsPnl<?php echo$counter?>" class="outer">
- <?php if(empty($_SESSION)):?>
- <p><i>empty</i></p>
- <?php else:?>
- <table>
- <?php
- foreach($_SESSION
- as$k=>$v)echo'<tr><…
Large files files are truncated, but you can click here to view the full file