PageRenderTime 57ms CodeModel.GetById 32ms RepoModel.GetById 1ms app.codeStats 0ms

/document_root/libs/Nette/Loaders/NetteLoader.php

https://github.com/taypan/Pocitace
PHP | 232 lines | 192 code | 13 blank | 27 comment | 2 complexity | a07578d52e5218384d591c3c3f71ef45 MD5 | raw file
  1. <?php
  2. /**
  3. * Nette Framework
  4. *
  5. * @copyright Copyright (c) 2004, 2010 David Grudl
  6. * @license http://nettephp.com/license Nette license
  7. * @link http://nettephp.com
  8. * @category Nette
  9. * @package Nette\Loaders
  10. */
  11. /**
  12. * Nette auto loader is responsible for loading Nette classes and interfaces.
  13. *
  14. * @copyright Copyright (c) 2004, 2010 David Grudl
  15. * @package Nette\Loaders
  16. */
  17. class NetteLoader extends AutoLoader
  18. {
  19. /** @var NetteLoader */
  20. public static $instance;
  21. /** @var string base file path */
  22. public $base;
  23. /** @var array */
  24. public $list = array(
  25. 'abortexception' => '/Application/Exceptions/AbortException.php',
  26. 'ambiguousserviceexception' => '/ServiceLocator.php',
  27. 'annotation' => '/Reflection/Annotation.php',
  28. 'annotations' => '/Annotations.php',
  29. 'annotationsparser' => '/Reflection/AnnotationsParser.php',
  30. 'appform' => '/Application/AppForm.php',
  31. 'application' => '/Application/Application.php',
  32. 'applicationexception' => '/Application/Exceptions/ApplicationException.php',
  33. 'argumentoutofrangeexception' => '/exceptions.php',
  34. 'arraylist' => '/Collections/ArrayList.php',
  35. 'arraytools' => '/ArrayTools.php',
  36. 'authenticationexception' => '/Security/AuthenticationException.php',
  37. 'autoloader' => '/Loaders/AutoLoader.php',
  38. 'badrequestexception' => '/Application/Exceptions/BadRequestException.php',
  39. 'badsignalexception' => '/Application/Exceptions/BadSignalException.php',
  40. 'basetemplate' => '/Templates/BaseTemplate.php',
  41. 'button' => '/Forms/Controls/Button.php',
  42. 'cache' => '/Caching/Cache.php',
  43. 'cachinghelper' => '/Templates/Filters/CachingHelper.php',
  44. 'callback' => '/Callback.php',
  45. 'checkbox' => '/Forms/Controls/Checkbox.php',
  46. 'classreflection' => '/Reflection/ClassReflection.php',
  47. 'clirouter' => '/Application/Routers/CliRouter.php',
  48. 'collection' => '/Collections/Collection.php',
  49. 'component' => '/Component.php',
  50. 'componentcontainer' => '/ComponentContainer.php',
  51. 'config' => '/Config/Config.php',
  52. 'configadapterini' => '/Config/ConfigAdapterIni.php',
  53. 'configurator' => '/Configurator.php',
  54. 'control' => '/Application/Control.php',
  55. 'conventionalrenderer' => '/Forms/Renderers/ConventionalRenderer.php',
  56. 'curlybracketsfilter' => '/Templates/Filters/LatteFilter.php',
  57. 'curlybracketsmacros' => '/Templates/Filters/LatteFilter.php',
  58. 'datetime53' => '/compatibility/DateTime53.php',
  59. 'debug' => '/Debug.php',
  60. 'deprecatedexception' => '/exceptions.php',
  61. 'directorynotfoundexception' => '/exceptions.php',
  62. 'downloadresponse' => '/Application/Responses/DownloadResponse.php',
  63. 'dummystorage' => '/Caching/DummyStorage.php',
  64. 'environment' => '/Environment.php',
  65. 'extensionreflection' => '/Reflection/ExtensionReflection.php',
  66. 'fatalerrorexception' => '/exceptions.php',
  67. 'filenotfoundexception' => '/exceptions.php',
  68. 'filestorage' => '/Caching/FileStorage.php',
  69. 'fileupload' => '/Forms/Controls/FileUpload.php',
  70. 'forbiddenrequestexception' => '/Application/Exceptions/ForbiddenRequestException.php',
  71. 'form' => '/Forms/Form.php',
  72. 'formcontainer' => '/Forms/FormContainer.php',
  73. 'formcontrol' => '/Forms/Controls/FormControl.php',
  74. 'formgroup' => '/Forms/FormGroup.php',
  75. 'forwardingresponse' => '/Application/Responses/ForwardingResponse.php',
  76. 'framework' => '/Framework.php',
  77. 'freezableobject' => '/FreezableObject.php',
  78. 'ftp' => '/Web/Ftp.php',
  79. 'ftpexception' => '/Web/Ftp.php',
  80. 'functionreflection' => '/Reflection/FunctionReflection.php',
  81. 'hashtable' => '/Collections/Hashtable.php',
  82. 'hiddenfield' => '/Forms/Controls/HiddenField.php',
  83. 'html' => '/Web/Html.php',
  84. 'httpcontext' => '/Web/HttpContext.php',
  85. 'httprequest' => '/Web/HttpRequest.php',
  86. 'httpresponse' => '/Web/HttpResponse.php',
  87. 'httpuploadedfile' => '/Web/HttpUploadedFile.php',
  88. 'iannotation' => '/Reflection/IAnnotation.php',
  89. 'iauthenticator' => '/Security/IAuthenticator.php',
  90. 'iauthorizator' => '/Security/IAuthorizator.php',
  91. 'icachestorage' => '/Caching/ICacheStorage.php',
  92. 'icollection' => '/Collections/ICollection.php',
  93. 'icomponent' => '/IComponent.php',
  94. 'icomponentcontainer' => '/IComponentContainer.php',
  95. 'iconfigadapter' => '/Config/IConfigAdapter.php',
  96. 'idebuggable' => '/IDebuggable.php',
  97. 'identity' => '/Security/Identity.php',
  98. 'ifiletemplate' => '/Templates/IFileTemplate.php',
  99. 'iformcontrol' => '/Forms/IFormControl.php',
  100. 'iformrenderer' => '/Forms/IFormRenderer.php',
  101. 'ihttprequest' => '/Web/IHttpRequest.php',
  102. 'ihttpresponse' => '/Web/IHttpResponse.php',
  103. 'iidentity' => '/Security/IIdentity.php',
  104. 'ilist' => '/Collections/IList.php',
  105. 'image' => '/Image.php',
  106. 'imagebutton' => '/Forms/Controls/ImageButton.php',
  107. 'imagemagick' => '/ImageMagick.php',
  108. 'imailer' => '/Mail/IMailer.php',
  109. 'imap' => '/Collections/IMap.php',
  110. 'inamingcontainer' => '/Forms/INamingContainer.php',
  111. 'instancefilteriterator' => '/InstanceFilterIterator.php',
  112. 'instantclientscript' => '/Forms/Renderers/InstantClientScript.php',
  113. 'invalidlinkexception' => '/Application/Exceptions/InvalidLinkException.php',
  114. 'invalidpresenterexception' => '/Application/Exceptions/InvalidPresenterException.php',
  115. 'invalidstateexception' => '/exceptions.php',
  116. 'ioexception' => '/exceptions.php',
  117. 'ipartiallyrenderable' => '/Application/IRenderable.php',
  118. 'ipermissionassertion' => '/Security/IPermissionAssertion.php',
  119. 'ipresenter' => '/Application/IPresenter.php',
  120. 'ipresenterloader' => '/Application/IPresenterLoader.php',
  121. 'ipresenterresponse' => '/Application/IPresenterResponse.php',
  122. 'irenderable' => '/Application/IRenderable.php',
  123. 'iresource' => '/Security/IResource.php',
  124. 'irole' => '/Security/IRole.php',
  125. 'irouter' => '/Application/IRouter.php',
  126. 'iservicelocator' => '/IServiceLocator.php',
  127. 'iset' => '/Collections/ISet.php',
  128. 'isignalreceiver' => '/Application/ISignalReceiver.php',
  129. 'istatepersistent' => '/Application/IStatePersistent.php',
  130. 'isubmittercontrol' => '/Forms/ISubmitterControl.php',
  131. 'itemplate' => '/Templates/ITemplate.php',
  132. 'itranslator' => '/ITranslator.php',
  133. 'iuser' => '/Web/IUser.php',
  134. 'jsonresponse' => '/Application/Responses/JsonResponse.php',
  135. 'keynotfoundexception' => '/Collections/Hashtable.php',
  136. 'lattefilter' => '/Templates/Filters/LatteFilter.php',
  137. 'lattemacros' => '/Templates/Filters/LatteMacros.php',
  138. 'limitedscope' => '/Loaders/LimitedScope.php',
  139. 'link' => '/Application/Link.php',
  140. 'mail' => '/Mail/Mail.php',
  141. 'mailmimepart' => '/Mail/MailMimePart.php',
  142. 'memberaccessexception' => '/exceptions.php',
  143. 'memcachedstorage' => '/Caching/MemcachedStorage.php',
  144. 'methodparameterreflection' => '/Reflection/MethodParameterReflection.php',
  145. 'methodreflection' => '/Reflection/MethodReflection.php',
  146. 'multirouter' => '/Application/Routers/MultiRouter.php',
  147. 'multiselectbox' => '/Forms/Controls/MultiSelectBox.php',
  148. 'netteloader' => '/Loaders/NetteLoader.php',
  149. 'notimplementedexception' => '/exceptions.php',
  150. 'notsupportedexception' => '/exceptions.php',
  151. 'object' => '/Object.php',
  152. 'objectmixin' => '/ObjectMixin.php',
  153. 'paginator' => '/Paginator.php',
  154. 'permission' => '/Security/Permission.php',
  155. 'presenter' => '/Application/Presenter.php',
  156. 'presentercomponent' => '/Application/PresenterComponent.php',
  157. 'presentercomponentreflection' => '/Application/PresenterComponentReflection.php',
  158. 'presenterloader' => '/Application/PresenterLoader.php',
  159. 'presenterrequest' => '/Application/PresenterRequest.php',
  160. 'propertyreflection' => '/Reflection/PropertyReflection.php',
  161. 'radiolist' => '/Forms/Controls/RadioList.php',
  162. 'recursivecomponentiterator' => '/ComponentContainer.php',
  163. 'recursivehtmliterator' => '/Web/Html.php',
  164. 'redirectingresponse' => '/Application/Responses/RedirectingResponse.php',
  165. 'renderresponse' => '/Application/Responses/RenderResponse.php',
  166. 'robotloader' => '/Loaders/RobotLoader.php',
  167. 'route' => '/Application/Routers/Route.php',
  168. 'rule' => '/Forms/Rule.php',
  169. 'rules' => '/Forms/Rules.php',
  170. 'safestream' => '/IO/SafeStream.php',
  171. 'selectbox' => '/Forms/Controls/SelectBox.php',
  172. 'sendmailmailer' => '/Mail/SendmailMailer.php',
  173. 'servicelocator' => '/ServiceLocator.php',
  174. 'session' => '/Web/Session.php',
  175. 'sessionnamespace' => '/Web/SessionNamespace.php',
  176. 'set' => '/Collections/Set.php',
  177. 'simpleauthenticator' => '/Security/SimpleAuthenticator.php',
  178. 'simplerouter' => '/Application/Routers/SimpleRouter.php',
  179. 'smartcachingiterator' => '/SmartCachingIterator.php',
  180. 'snippethelper' => '/Templates/Filters/SnippetHelper.php',
  181. 'string' => '/String.php',
  182. 'submitbutton' => '/Forms/Controls/SubmitButton.php',
  183. 'template' => '/Templates/Template.php',
  184. 'templatecachestorage' => '/Templates/TemplateCacheStorage.php',
  185. 'templatefilters' => '/Templates/Filters/TemplateFilters.php',
  186. 'templatehelpers' => '/Templates/Filters/TemplateHelpers.php',
  187. 'textarea' => '/Forms/Controls/TextArea.php',
  188. 'textbase' => '/Forms/Controls/TextBase.php',
  189. 'textinput' => '/Forms/Controls/TextInput.php',
  190. 'tools' => '/Tools.php',
  191. 'uri' => '/Web/Uri.php',
  192. 'uriscript' => '/Web/UriScript.php',
  193. 'user' => '/Web/User.php',
  194. );
  195. /**
  196. * Returns singleton instance with lazy instantiation.
  197. * @return NetteLoader
  198. */
  199. public static function getInstance()
  200. {
  201. if (self::$instance === NULL) {
  202. self::$instance = new self;
  203. }
  204. return self::$instance;
  205. }
  206. /**
  207. * Handles autoloading of classes or interfaces.
  208. * @param string
  209. * @return void
  210. */
  211. public function tryLoad($type)
  212. {
  213. $type = strtolower($type);
  214. if (isset($this->list[$type])) {
  215. LimitedScope::load($this->base . $this->list[$type]);
  216. self::$count++;
  217. }
  218. }
  219. }