PageRenderTime 86ms CodeModel.GetById 32ms RepoModel.GetById 0ms app.codeStats 3ms

/Nette-minified/nette.min.php

https://bitbucket.org/rluks/projectmanager
PHP | 5614 lines | 5472 code | 134 blank | 8 comment | 61 complexity | d7acb7388db553211f6d4295571b3e3a MD5 | raw file
Possible License(s): BSD-3-Clause, Apache-2.0

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

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