PageRenderTime 76ms CodeModel.GetById 32ms RepoModel.GetById 1ms app.codeStats 2ms

/app/libs/nette.min.php

https://bitbucket.org/thoracek/rdprstice
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

  1. <?php //netteloader=Nette\Framework
  2. namespace {/**
  3. * Nette Framework (version 2.0.3 released on 2012-04-04, http://nette.org)
  4. *
  5. * Copyright (c) 2004, 2012 David Grudl (http://davidgrudl.com)
  6. *
  7. * For the full copyright and license information, please view
  8. * the file license.txt that was distributed with this source code.
  9. */
  10. 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
  11. Nette;interface
  12. IBarPanel{function
  13. getTab();function
  14. getPanel();}}namespace Nette\Application{use
  15. Nette;interface
  16. IPresenter{function
  17. run(Request$request);}interface
  18. IPresenterFactory{function
  19. getPresenterClass(&$name);function
  20. createPresenter($name);}interface
  21. IResponse{function
  22. send(Nette\Http\IRequest$httpRequest,Nette\Http\IResponse$httpResponse);}interface
  23. IRouter{const
  24. ONE_WAY=1;const
  25. SECURED=2;function
  26. match(Nette\Http\IRequest$httpRequest);function
  27. constructUrl(Request$appRequest,Nette\Http\Url$refUrl);}}namespace Nette{use
  28. Nette;interface
  29. IFreezable{function
  30. freeze();function
  31. isFrozen();}}namespace Nette\ComponentModel{use
  32. Nette;interface
  33. IComponent{const
  34. NAME_SEPARATOR='-';function
  35. getName();function
  36. getParent();function
  37. setParent(IContainer$parent=NULL,$name=NULL);}interface
  38. IContainer
  39. extends
  40. IComponent{function
  41. addComponent(IComponent$component,$name);function
  42. removeComponent(IComponent$component);function
  43. getComponent($name);function
  44. getComponents($deep=FALSE,$filterType=NULL);}}namespace Nette\Application\UI{use
  45. Nette;interface
  46. ISignalReceiver{function
  47. signalReceived($signal);}interface
  48. IStatePersistent{function
  49. loadState(array$params);function
  50. saveState(array&$params);}interface
  51. IRenderable{function
  52. invalidateControl();function
  53. isControlInvalid();}}namespace Nette\Caching{use
  54. Nette;interface
  55. IStorage{function
  56. read($key);function
  57. lock($key);function
  58. write($key,$data,array$dependencies);function
  59. remove($key);function
  60. clean(array$conds);}}namespace Nette\Caching\Storages{use
  61. Nette;interface
  62. IJournal{function
  63. write($key,array$dependencies);function
  64. clean(array$conditions);}}namespace Nette\Config{use
  65. Nette;interface
  66. IAdapter{function
  67. load($file);function
  68. dump(array$data);}}namespace Nette\Database{use
  69. Nette;interface
  70. ISupplementalDriver{const
  71. META='meta';function
  72. delimite($name);function
  73. formatDateTime(\DateTime$value);function
  74. formatLike($value,$pos);function
  75. applyLimit(&$sql,$limit,$offset);function
  76. normalizeRow($row,$statement);function
  77. getTables();function
  78. getColumns($table);function
  79. getIndexes($table);function
  80. getForeignKeys($table);}interface
  81. IReflection{const
  82. 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
  83. getPrimary($table);function
  84. getHasManyReference($table,$key);function
  85. getBelongsToReference($table,$key);function
  86. setConnection(Connection$connection);}}namespace Nette\DI{use
  87. Nette;interface
  88. IContainer{function
  89. addService($name,$service);function
  90. getService($name);function
  91. removeService($name);function
  92. hasService($name);}}namespace Nette\Forms{use
  93. Nette;interface
  94. IControl{function
  95. loadHttpData();function
  96. setValue($value);function
  97. getValue();function
  98. getRules();function
  99. getErrors();function
  100. isDisabled();function
  101. translate($s,$count=NULL);}interface
  102. ISubmitterControl
  103. extends
  104. IControl{function
  105. isSubmittedBy();function
  106. getValidationScope();}interface
  107. IFormRenderer{function
  108. render(Form$form);}}namespace Nette\Http{use
  109. Nette;interface
  110. IRequest{const
  111. GET='GET',POST='POST',HEAD='HEAD',PUT='PUT',DELETE='DELETE';function
  112. getUrl();function
  113. getQuery($key=NULL,$default=NULL);function
  114. getPost($key=NULL,$default=NULL);function
  115. getFile($key);function
  116. getFiles();function
  117. getCookie($key,$default=NULL);function
  118. getCookies();function
  119. getMethod();function
  120. isMethod($method);function
  121. getHeader($header,$default=NULL);function
  122. getHeaders();function
  123. isSecured();function
  124. isAjax();function
  125. getRemoteAddress();function
  126. getRemoteHost();}interface
  127. IResponse{const
  128. PERMANENT=2116333333;const
  129. BROWSER=0;const
  130. 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
  131. setCode($code);function
  132. getCode();function
  133. setHeader($name,$value);function
  134. addHeader($name,$value);function
  135. setContentType($type,$charset=NULL);function
  136. redirect($url,$code=self::S302_FOUND);function
  137. setExpiration($seconds);function
  138. isSent();function
  139. getHeaders();function
  140. setCookie($name,$value,$expire,$path=NULL,$domain=NULL,$secure=NULL,$httpOnly=NULL);function
  141. deleteCookie($name,$path=NULL,$domain=NULL,$secure=NULL);}interface
  142. ISessionStorage{function
  143. open($savePath,$sessionName);function
  144. close();function
  145. read($id);function
  146. write($id,$data);function
  147. remove($id);function
  148. clean($maxlifetime);}}namespace Nette\Security{use
  149. Nette;interface
  150. IUserStorage{const
  151. MANUAL=1,INACTIVITY=2,BROWSER_CLOSED=4;const
  152. CLEAR_IDENTITY=8;function
  153. setAuthenticated($state);function
  154. isAuthenticated();function
  155. setIdentity(IIdentity$identity=NULL);function
  156. getIdentity();function
  157. setExpiration($time,$flags=0);function
  158. getLogoutReason();}}namespace Nette\Latte{use
  159. Nette;interface
  160. IMacro{function
  161. initialize();function
  162. finalize();function
  163. nodeOpened(MacroNode$node);function
  164. nodeClosed(MacroNode$node);}}namespace Nette\Localization{use
  165. Nette;interface
  166. ITranslator{function
  167. translate($message,$count=NULL);}}namespace Nette\Mail{use
  168. Nette;interface
  169. IMailer{function
  170. send(Message$mail);}}namespace Nette\Reflection{use
  171. Nette;interface
  172. IAnnotation{function
  173. __construct(array$values);}}namespace Nette\Security{use
  174. Nette;interface
  175. IAuthenticator{const
  176. USERNAME=0,PASSWORD=1;const
  177. IDENTITY_NOT_FOUND=1,INVALID_CREDENTIAL=2,FAILURE=3,NOT_APPROVED=4;function
  178. authenticate(array$credentials);}interface
  179. IAuthorizator{const
  180. ALL=NULL;const
  181. ALLOW=TRUE;const
  182. DENY=FALSE;function
  183. isAllowed($role,$resource,$privilege);}interface
  184. IIdentity{function
  185. getId();function
  186. getRoles();}interface
  187. IResource{function
  188. getResourceId();}interface
  189. IRole{function
  190. getRoleId();}}namespace Nette\Templating{use
  191. Nette;interface
  192. ITemplate{function
  193. render();}interface
  194. IFileTemplate
  195. extends
  196. ITemplate{function
  197. setFile($file);function
  198. getFile();}}namespace Nette{use
  199. Nette;class
  200. ArgumentOutOfRangeException
  201. extends\InvalidArgumentException{}class
  202. InvalidStateException
  203. extends\RuntimeException{}class
  204. NotImplementedException
  205. extends\LogicException{}class
  206. NotSupportedException
  207. extends\LogicException{}class
  208. DeprecatedException
  209. extends
  210. NotSupportedException{}class
  211. MemberAccessException
  212. extends\LogicException{}class
  213. IOException
  214. extends\RuntimeException{}class
  215. FileNotFoundException
  216. extends
  217. IOException{}class
  218. DirectoryNotFoundException
  219. extends
  220. IOException{}class
  221. InvalidArgumentException
  222. extends\InvalidArgumentException{}class
  223. OutOfRangeException
  224. extends\OutOfRangeException{}class
  225. UnexpectedValueException
  226. extends\UnexpectedValueException{}class
  227. StaticClassException
  228. extends\LogicException{}class
  229. FatalErrorException
  230. extends\ErrorException{function
  231. __construct($message,$code,$severity,$file,$line,$context){parent::__construct($message,$code,$severity,$file,$line);$this->context=$context;}}abstract
  232. class
  233. Object{static
  234. function
  235. getReflection(){return
  236. new
  237. Reflection\ClassType(get_called_class());}function
  238. __call($name,$args){return
  239. ObjectMixin::call($this,$name,$args);}static
  240. function
  241. __callStatic($name,$args){return
  242. ObjectMixin::callStatic(get_called_class(),$name,$args);}static
  243. function
  244. extensionMethod($name,$callback=NULL){if(strpos($name,'::')===FALSE){$class=get_called_class();}else{list($class,$name)=explode('::',$name);}$class=new
  245. Reflection\ClassType($class);if($callback===NULL){return$class->getExtensionMethod($name);}else{$class->setExtensionMethod($name,$callback);}}function&__get($name){return
  246. ObjectMixin::get($this,$name);}function
  247. __set($name,$value){return
  248. ObjectMixin::set($this,$name,$value);}function
  249. __isset($name){return
  250. ObjectMixin::has($this,$name);}function
  251. __unset($name){ObjectMixin::remove($this,$name);}}}namespace Nette\Utils{use
  252. Nette;final
  253. class
  254. LimitedScope{private
  255. static$vars;final
  256. function
  257. __construct(){throw
  258. new
  259. Nette\StaticClassException;}static
  260. function
  261. 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
  262. new
  263. Nette\FatalErrorException($error['message'],0,$error['type'],$error['file'],$error['line'],NULL);}return$res;}static
  264. function
  265. 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
  266. Nette;abstract
  267. class
  268. AutoLoader
  269. extends
  270. Nette\Object{static
  271. private$loaders=array();public
  272. static$count=0;final
  273. static
  274. function
  275. load($type){foreach(func_get_args()as$type){if(!class_exists($type)){throw
  276. new
  277. Nette\InvalidStateException("Unable to load class or interface '$type'.");}}}final
  278. static
  279. function
  280. getLoaders(){return
  281. array_values(self::$loaders);}function
  282. register(){if(!function_exists('spl_autoload_register')){throw
  283. new
  284. 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
  285. unregister(){unset(self::$loaders[spl_object_hash($this)]);return
  286. spl_autoload_unregister(array($this,'tryLoad'));}abstract
  287. function
  288. tryLoad($type);}}namespace Nette\Diagnostics{use
  289. Nette;final
  290. class
  291. Helpers{static
  292. function
  293. 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
  294. 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
  295. Nette\Utils\Html::el('span')->setText($file);}}static
  296. function
  297. 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
  298. 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
  299. 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
  300. instanceof\Closure){$s.="<code>{\n";$list[]=$var;foreach($arr
  301. 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
  302. function
  303. 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>&#x25bc;</abbr> </a><code>':'<abbr>&#x25ba;</abbr> </a><code class="nette-collapsed">');},self::htmlDump($dump)).'</pre>';}static
  304. function
  305. findTrace(array$trace,$method,&$index=NULL){$m=explode('::',$method);foreach($trace
  306. 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
  307. Nette;class
  308. Html
  309. extends
  310. Nette\Object
  311. implements\ArrayAccess,\Countable,\IteratorAggregate{private$name;private$isEmpty;public$attrs=array();protected$children=array();public
  312. static$xhtml=TRUE;public
  313. 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
  314. function
  315. el($name=NULL,$attrs=NULL){$el=new
  316. 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
  317. function
  318. setName($name,$isEmpty=NULL){if($name!==NULL&&!is_string($name)){throw
  319. new
  320. 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
  321. function
  322. getName(){return$this->name;}final
  323. function
  324. isEmpty(){return$this->isEmpty;}function
  325. addAttributes(array$attrs){$this->attrs=$attrs+$this->attrs;return$this;}final
  326. function
  327. __set($name,$value){$this->attrs[$name]=$value;}final
  328. function&__get($name){return$this->attrs[$name];}final
  329. function
  330. __isset($name){return
  331. isset($this->attrs[$name]);}final
  332. function
  333. __unset($name){unset($this->attrs[$name]);}final
  334. function
  335. __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
  336. 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
  337. function
  338. href($path,$query=NULL){if($query){$query=http_build_query($query,NULL,'&');if($query!==''){$path.='?'.$query;}}$this->attrs['href']=$path;return$this;}final
  339. function
  340. setHtml($html){if($html===NULL){$html='';}elseif(is_array($html)){throw
  341. new
  342. Nette\InvalidArgumentException("Textual content must be a scalar, ".gettype($html)." given.");}else{$html=(string)$html;}$this->removeChildren();$this->children[]=$html;return$this;}final
  343. function
  344. getHtml(){$s='';foreach($this->children
  345. as$child){if(is_object($child)){$s.=$child->render();}else{$s.=$child;}}return$s;}final
  346. function
  347. setText($text){if(!is_array($text)){$text=htmlspecialchars((string)$text,ENT_NOQUOTES);}return$this->setHtml($text);}final
  348. function
  349. getText(){return
  350. html_entity_decode(strip_tags($this->getHtml()),ENT_QUOTES,'UTF-8');}final
  351. function
  352. add($child){return$this->insert(NULL,$child);}final
  353. function
  354. create($name,$attrs=NULL){$this->insert(NULL,$child=static::el($name,$attrs));return$child;}function
  355. insert($index,$child,$replace=FALSE){if($child
  356. instanceof
  357. Html||is_scalar($child)){if($index===NULL){$this->children[]=$child;}else{array_splice($this->children,(int)$index,$replace?1:0,array($child));}}else{throw
  358. new
  359. Nette\InvalidArgumentException("Child node must be scalar or Html object, ".(is_object($child)?get_class($child):gettype($child))." given.");}return$this;}final
  360. function
  361. offsetSet($index,$child){$this->insert($index,$child,TRUE);}final
  362. function
  363. offsetGet($index){return$this->children[$index];}final
  364. function
  365. offsetExists($index){return
  366. isset($this->children[$index]);}function
  367. offsetUnset($index){if(isset($this->children[$index])){array_splice($this->children,(int)$index,1);}}final
  368. function
  369. count(){return
  370. count($this->children);}function
  371. removeChildren(){$this->children=array();}final
  372. function
  373. getIterator($deep=FALSE){if($deep){$deep=$deep>0?\RecursiveIteratorIterator::SELF_FIRST:\RecursiveIteratorIterator::CHILD_FIRST;return
  374. new\RecursiveIteratorIterator(new
  375. Nette\Iterators\Recursor(new\ArrayIterator($this->children)),$deep);}else{return
  376. new
  377. Nette\Iterators\Recursor(new\ArrayIterator($this->children));}}final
  378. function
  379. getChildren(){return$this->children;}final
  380. function
  381. render($indent=NULL){$s=$this->startTag();if(!$this->isEmpty){if($indent!==NULL){$indent++;}foreach($this->children
  382. 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
  383. function
  384. __toString(){return$this->render();}final
  385. function
  386. startTag(){if($this->name){return'<'.$this->name.$this->attributes().(static::$xhtml&&$this->isEmpty?' />':'>');}else{return'';}}final
  387. function
  388. endTag(){return$this->name&&!$this->isEmpty?'</'.$this->name.'>':'';}final
  389. function
  390. attributes(){if(!is_array($this->attrs)){return'';}$s='';foreach($this->attrs
  391. 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
  392. as$k=>$v){if($v!==NULL&&$v!==FALSE){$s.=' data-'.$k.'="'.htmlspecialchars((string)$v).'"';}}continue;}$tmp=NULL;foreach($value
  393. 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('@','&#64;',$s);return$s;}function
  394. __clone(){foreach($this->children
  395. as$key=>$value){if(is_object($value)){$this->children[$key]=clone$value;}}}}}namespace Nette\Diagnostics{use
  396. Nette;final
  397. class
  398. Debugger{public
  399. static$productionMode;public
  400. static$consoleMode;public
  401. static$time;private
  402. static$ajaxDetected;public
  403. static$source;public
  404. static$editor='editor://open/?file=%file&line=%line';public
  405. static$browser;public
  406. static$maxDepth=3;public
  407. static$maxLen=150;public
  408. static$showLocation=FALSE;public
  409. 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
  410. DEVELOPMENT=FALSE,PRODUCTION=TRUE,DETECT=NULL;public
  411. static$blueScreen;public
  412. static$strictMode=FALSE;public
  413. static$scream=FALSE;public
  414. static$onFatalError=array();private
  415. static$enabled=FALSE;private
  416. static$lastError=FALSE;public
  417. static$logger;public
  418. static$fireLogger;public
  419. static$logDirectory;public
  420. static$email;public
  421. static$mailer;public
  422. static$emailSnooze;public
  423. static$bar;private
  424. static$errorPanel;private
  425. static$dumpPanel;const
  426. DEBUG='debug',INFO='info',WARNING='warning',ERROR='error',CRITICAL='critical';final
  427. function
  428. __construct(){throw
  429. new
  430. Nette\StaticClassException;}static
  431. function
  432. _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
  433. Logger;self::$logDirectory=&self::$logger->directory;self::$email=&self::$logger->email;self::$mailer=&self::$logger->mailer;self::$emailSnooze=&Logger::$emailSnooze;self::$fireLogger=new
  434. FireLogger;self::$blueScreen=new
  435. BlueScreen;self::$blueScreen->addPanel(function($e){if($e
  436. instanceof
  437. Nette\Templating\FilterException){return
  438. array('tab'=>'Template','panel'=>'<p><b>File:</b> '.Helpers::editorLink($e->sourceFile,$e->sourceLine).'&nbsp; <b>Line:</b> '.($e->sourceLine?$e->sourceLine:'n/a').'</p>'.($e->sourceLine?BlueScreen::highlightFile($e->sourceFile,$e->sourceLine):''));}elseif($e
  439. instanceof
  440. Nette\Utils\NeonException&&preg_match('#line (\d+)#',$e->getMessage(),$m)){if($item=Helpers::findTrace($e->getTrace(),'Nette\Config\Adapters\NeonAdapter::load')){return
  441. array('tab'=>'NEON','panel'=>'<p><b>File:</b> '.Helpers::editorLink($item['args'][0],$m[1]).'&nbsp; <b>Line:</b> '.$m[1].'</p>'.BlueScreen::highlightFile($item['args'][0],$m[1]));}elseif($item=Helpers::findTrace($e->getTrace(),'Nette\Utils\Neon::decode')){return
  442. array('tab'=>'NEON','panel'=>BlueScreen::highlightPhp($item['args'][0],$m[1]));}}});self::$bar=new
  443. Bar;self::$bar->addPanel(new
  444. DefaultBarPanel('time'));self::$bar->addPanel(new
  445. DefaultBarPanel('memory'));self::$bar->addPanel(self::$errorPanel=new
  446. DefaultBarPanel('errors'));self::$bar->addPanel(self::$dumpPanel=new
  447. DefaultBarPanel('dumps'));}static
  448. function
  449. 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
  450. new
  451. 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
  452. new
  453. Nette\NotSupportedException('Function ini_set() must be enabled.');}if($email){if(!is_string($email)){throw
  454. new
  455. 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
  456. function
  457. isEnabled(){return
  458. self::$enabled;}static
  459. function
  460. log($message,$priority=self::INFO){if(self::$logDirectory===FALSE){return;}elseif(!self::$logDirectory){throw
  461. new
  462. Nette\InvalidStateException('Logging directory is not specified in Nette\Diagnostics\Debugger::$logDirectory.');}if($message
  463. instanceof\Exception){$exception=$message;$message=($message
  464. instanceof
  465. 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
  466. strtr($exceptionFilename,'\\/',DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR);}}static
  467. function
  468. _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
  469. Nette\FatalErrorException($error['message'],0,$error['type'],$error['file'],$error['line'],NULL));}if(self::$bar&&!self::$productionMode&&self::isHtmlMode()){self::$bar->render();}}static
  470. function
  471. _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()){?>
  472. <!DOCTYPE html>
  473. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  474. <meta name=robots content=noindex><meta name=generator content="Nette Framework">
  475. <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>
  476. <title>Server Error</title>
  477. <h1>Server Error</h1>
  478. <p>We're sorry! The server encountered an internal error and was unable to complete your request. Please try again later.</p>
  479. <p><small>error 500</small></p>
  480. <?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
  481. as$handler){call_user_func($handler,$exception);}}catch(\Exception$e){if(self::$productionMode){echo
  482. 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
  483. function
  484. _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
  485. NULL;}if($severity===E_RECOVERABLE_ERROR||$severity===E_USER_ERROR){throw
  486. new
  487. Nette\FatalErrorException($message,0,$severity,$file,$line,$context);}elseif(($severity&error_reporting())!==$severity){return
  488. FALSE;}elseif(!self::$productionMode&&(is_bool(self::$strictMode)?self::$strictMode:((self::$strictMode&$severity)===$severity))){self::_exceptionHandler(new
  489. 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
  490. NULL;}elseif(self::$productionMode){self::log("$message in $file:$line",self::ERROR);return
  491. NULL;}else{$ok=self::fireLog(new\ErrorException($message,0,$severity,$file,$line),self::WARNING);return!self::isHtmlMode()||(!self::$bar&&!$ok)?FALSE:NULL;}return
  492. FALSE;}static
  493. function
  494. toStringException(\Exception$exception){if(self::$enabled){self::_exceptionHandler($exception);}else{trigger_error($exception->getMessage(),E_USER_ERROR);}}static
  495. function
  496. tryError(){if(!self::$enabled&&self::$lastError===FALSE){set_error_handler(array(__CLASS__,'_errorHandler'));}self::$lastError=NULL;}static
  497. function
  498. catchError(&$error){if(!self::$enabled&&self::$lastError!==FALSE){restore_error_handler();}$error=self::$lastError;self::$lastError=FALSE;return(bool)$error;}static
  499. function
  500. 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
  501. function
  502. timer($name=NULL){static$time=array();$now=microtime(TRUE);$delta=isset($time[$name])?$now-$time[$name]:0;$time[$name]=$now;return$delta;}static
  503. function
  504. 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
  505. function
  506. fireLog($message){if(!self::$productionMode){return
  507. self::$fireLogger->log($message);}}private
  508. static
  509. function
  510. isHtmlMode(){return!self::$ajaxDetected&&!self::$consoleMode&&!preg_match('#^Content-Type: (?!text/html)#im',implode("\n",headers_list()));}static
  511. function
  512. addPanel(IBarPanel$panel,$id=NULL){return
  513. self::$bar->addPanel($panel,$id);}}class
  514. Logger
  515. extends
  516. Nette\Object{const
  517. DEBUG='debug',INFO='info',WARNING='warning',ERROR='error',CRITICAL='critical';public
  518. static$emailSnooze=172800;public$mailer=array(__CLASS__,'defaultMailer');public$directory;public$email;function
  519. log($message,$priority=self::INFO){if(!is_dir($this->directory)){throw
  520. new
  521. 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
  522. function
  523. 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
  524. FireLogger
  525. extends
  526. Nette\Object{const
  527. DEBUG='debug',INFO='info',WARNING='warning',ERROR='error',CRITICAL='critical';private
  528. static$payload=array('logs'=>array());static
  529. function
  530. log($message,$priority=self::DEBUG){if(!isset($_SERVER['HTTP_X_FIRELOGGER'])||headers_sent()){return
  531. 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
  532. 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
  533. 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
  534. 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
  535. TRUE;}private
  536. static
  537. function
  538. 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
  539. 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
  540. 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
  541. 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
  542. BlueScreen
  543. extends
  544. Nette\Object{private$panels=array();function
  545. addPanel($panel){if(!in_array($panel,$this->panels,TRUE)){$this->panels[]=$panel;}return$this;}function
  546. 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
  547. instanceof
  548. 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>
  549. <html>
  550. <head>
  551. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  552. <meta name="robots" content="noindex,noarchive">
  553. <meta name="generator" content="Nette Framework">
  554. <title><?php echo
  555. htmlspecialchars($title)?></title><!-- <?php
  556. $ex=$exception;echo
  557. htmlspecialchars($ex->getMessage().($ex->getCode()?' #'.$ex->getCode():''));while((method_exists($ex,'getPrevious')&&$ex=$ex->getPrevious())||(isset($ex->previous)&&$ex=$ex->previous))echo
  558. htmlspecialchars('; caused by '.get_class($ex).' '.$ex->getMessage().($ex->getCode()?' #'.$ex->getCode():''));?> -->
  559. <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>
  560. </head>
  561. <body>
  562. <div id="netteBluescreen">
  563. <a id="netteBluescreenIcon" href="#" rel="next"><abbr>&#x25bc;</abbr></a
  564. ><div>
  565. <div id="netteBluescreenError" class="panel">
  566. <h1><?php echo
  567. htmlspecialchars($title),($exception->getCode()?' #'.$exception->getCode():'')?></h1>
  568. <p><?php echo
  569. htmlspecialchars($exception->getMessage())?> <a href="http://www.google.cz/search?sourceid=nette&amp;q=<?php echo
  570. urlencode($title.' '.preg_replace('#\'.*\'|".*"#Us','',$exception->getMessage()))?>" id="netteBsSearch">search&#x25ba;</a></p>
  571. </div>
  572. <?php $ex=$exception;$level=0;?>
  573. <?php do{?>
  574. <?php if($level++):?>
  575. <div class="panel">
  576. <h2><a href="#" rel="netteBsPnl<?php echo++$counter?>">Caused by <abbr><?php echo($collapsed=$level>2)?'&#x25ba;':'&#x25bc;'?></abbr></a></h2>
  577. <div id="netteBsPnl<?php echo$counter?>" class="<?php echo$collapsed?'nette-collapsed ':''?>inner">
  578. <div class="panel">
  579. <h1><?php echo
  580. htmlspecialchars(get_class($ex).($ex->getCode()?' #'.$ex->getCode():''))?></h1>
  581. <p><b><?php echo
  582. htmlspecialchars($ex->getMessage())?></b></p>
  583. </div>
  584. <?php endif?>
  585. <?php foreach($panels
  586. as$panel):?>
  587. <?php $panel=call_user_func($panel,$ex);if(empty($panel['tab'])||empty($panel['panel']))continue;?>
  588. <?php if(!empty($panel['bottom'])){continue;}?>
  589. <div class="panel">
  590. <h2><a href="#" rel="netteBsPnl<?php echo++$counter?>"><?php echo
  591. htmlSpecialChars($panel['tab'])?> <abbr>&#x25bc;</abbr></a></h2>
  592. <div id="netteBsPnl<?php echo$counter?>" class="inner">
  593. <?php echo$panel['panel']?>
  594. </div></div>
  595. <?php endforeach?>
  596. <?php $stack=$ex->getTrace();$expanded=NULL?>
  597. <?php if(strpos($ex->getFile(),$expandPath)===0){foreach($stack
  598. as$key=>$row){if(isset($row['file'])&&strpos($row['file'],$expandPath)!==0){$expanded=$key;break;}}}?>
  599. <div class="panel">
  600. <h2><a href="#" rel="netteBsPnl<?php echo++$counter?>">Source file <abbr><?php echo($collapsed=$expanded!==NULL)?'&#x25ba;':'&#x25bc;'?></abbr></a></h2>
  601. <div id="netteBsPnl<?php echo$counter?>" class="<?php echo$collapsed?'nette-collapsed ':''?>inner">
  602. <p><b>File:</b> <?php echo
  603. Helpers::editorLink($ex->getFile(),$ex->getLine())?> &nbsp; <b>Line:</b> <?php echo$ex->getLine()?></p>
  604. <?php if(is_file($ex->getFile())):?><?php echo
  605. self::highlightFile($ex->getFile(),$ex->getLine(),15,isset($ex->context)?$ex->context:NULL)?><?php endif?>
  606. </div></div>
  607. <?php if(isset($stack[0]['class'])&&$stack[0]['class']==='Nette\Diagnostics\Debugger'&&($stack[0]['function']==='_shutdownHandler'||$stack[0]['function']==='_errorHandler'))unset($stack[0])?>
  608. <?php if($stack):?>
  609. <div class="panel">
  610. <h2><a href="#" rel="netteBsPnl<?php echo++$counter?>">Call stack <abbr>&#x25bc;</abbr></a></h2>
  611. <div id="netteBsPnl<?php echo$counter?>" class="inner">
  612. <ol>
  613. <?php foreach($stack
  614. as$key=>$row):?>
  615. <li><p>
  616. <?php if(isset($row['file'])&&is_file($row['file'])):?>
  617. <?php echo
  618. Helpers::editorLink($row['file'],$row['line']),':',$row['line']?>
  619. <?php else:?>
  620. <i>inner-code</i><?php if(isset($row['line']))echo':',$row['line']?>
  621. <?php endif?>
  622. <?php if(isset($row['file'])&&is_file($row['file'])):?><a href="#" rel="netteBsSrc<?php echo"$level-$key"?>">source <abbr>&#x25ba;</abbr></a>&nbsp; <?php endif?>
  623. <?php if(isset($row['class']))echo
  624. htmlspecialchars($row['class'].$row['type'])?>
  625. <?php echo
  626. htmlspecialchars($row['function'])?>
  627. (<?php if(!empty($row['args'])):?><a href="#" rel="netteBsArgs<?php echo"$level-$key"?>">arguments <abbr>&#x25ba;</abbr></a><?php endif?>)
  628. </p>
  629. <?php if(!empty($row['args'])):?>
  630. <div class="nette-collapsed outer" id="netteBsArgs<?php echo"$level-$key"?>">
  631. <table>
  632. <?php
  633. 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
  634. Helpers::clickableDump($v);echo"</td></tr>\n";}?>
  635. </table>
  636. </div>
  637. <?php endif?>
  638. <?php if(isset($row['file'])&&is_file($row['file'])):?>
  639. <div <?php if($expanded!==$key)echo'class="nette-collapsed"';?> id="netteBsSrc<?php echo"$level-$key"?>"><?php echo
  640. self::highlightFile($row['file'],$row['line'])?></div>
  641. <?php endif?>
  642. </li>
  643. <?php endforeach?>
  644. </ol>
  645. </div></div>
  646. <?php endif?>
  647. <?php if(isset($ex->context)&&is_array($ex->context)):?>
  648. <div class="panel">
  649. <h2><a href="#" rel="netteBsPnl<?php echo++$counter?>">Variables <abbr>&#x25ba;</abbr></a></h2>
  650. <div id="netteBsPnl<?php echo$counter?>" class="nette-collapsed inner">
  651. <div class="outer">
  652. <table>
  653. <?php
  654. foreach($ex->context
  655. as$k=>$v){echo'<tr><th>$',htmlspecialchars($k),'</th><td>',Helpers::clickableDump($v),"</td></tr>\n";}?>
  656. </table>
  657. </div>
  658. </div></div>
  659. <?php endif?>
  660. <?php }while((method_exists($ex,'getPrevious')&&$ex=$ex->getPrevious())||(isset($ex->previous)&&$ex=$ex->previous));?>
  661. <?php while(--$level)echo'</div></div>'?>
  662. <?php $bottomPanels=array()?>
  663. <?php foreach($panels
  664. as$panel):?>
  665. <?php $panel=call_user_func($panel,NULL);if(empty($panel['tab'])||empty($panel['panel']))continue;?>
  666. <?php if(!empty($panel['bottom'])){$bottomPanels[]=$panel;continue;}?>
  667. <div class="panel">
  668. <h2><a href="#" rel="netteBsPnl<?php echo++$counter?>"><?php echo
  669. htmlSpecialChars($panel['tab'])?> <abbr>&#x25ba;</abbr></a></h2>
  670. <div id="netteBsPnl<?php echo$counter?>" class="nette-collapsed inner">
  671. <?php echo$panel['panel']?>
  672. </div></div>
  673. <?php endforeach?>
  674. <div class="panel">
  675. <h2><a href="#" rel="netteBsPnl<?php echo++$counter?>">Environment <abbr>&#x25ba;</abbr></a></h2>
  676. <div id="netteBsPnl<?php echo$counter?>" class="nette-collapsed inner">
  677. <h3><a href="#" rel="netteBsPnl<?php echo++$counter?>">$_SERVER <abbr>&#x25bc;</abbr></a></h3>
  678. <div id="netteBsPnl<?php echo$counter?>" class="outer">
  679. <table>
  680. <?php
  681. foreach($_SERVER
  682. as$k=>$v)echo'<tr><th>',htmlspecialchars($k),'</th><td>',Helpers::clickableDump($v),"</td></tr>\n";?>
  683. </table>
  684. </div>
  685. <h3><a href="#" rel="netteBsPnl<?php echo++$counter?>">$_SESSION <abbr>&#x25bc;</abbr></a></h3>
  686. <div id="netteBsPnl<?php echo$counter?>" class="outer">
  687. <?php if(empty($_SESSION)):?>
  688. <p><i>empty</i></p>
  689. <?php else:?>
  690. <table>
  691. <?php
  692. foreach($_SESSION
  693. as$k=>$v)echo'<tr><…

Large files files are truncated, but you can click here to view the full file