1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10: 11:
12:
13:
14:
15: 16: 17: 18: 19: 20:
21: class NetteLoader extends AutoLoader
22: {
23:
24: private static $instance;
25:
26:
27: public $list = array(
28: 'abortexception' => '/Application/exceptions.php',
29: 'ambiguousserviceexception' => '/DI/exceptions.php',
30: 'annotation' => '/Reflection/Annotation.php',
31: 'annotationsparser' => '/Reflection/AnnotationsParser.php',
32: 'appform' => '/Application/UI/Form.php',
33: 'application' => '/Application/Application.php',
34: 'applicationexception' => '/Application/exceptions.php',
35: 'argumentoutofrangeexception' => '/common/exceptions.php',
36: 'arrayhash' => '/common/ArrayHash.php',
37: 'arraylist' => '/common/ArrayList.php',
38: 'arrays' => '/Utils/Arrays.php',
39: 'authenticationexception' => '/Security/AuthenticationException.php',
40: 'autoloader' => '/Loaders/AutoLoader.php',
41: 'badrequestexception' => '/Application/exceptions.php',
42: 'badsignalexception' => '/Application/UI/BadSignalException.php',
43: 'button' => '/Forms/Controls/Button.php',
44: 'cache' => '/Caching/Cache.php',
45: 'cachemacro' => '/Latte/Macros/CacheMacro.php',
46: 'cachinghelper' => '/Caching/OutputHelper.php',
47: 'callback' => '/common/Callback.php',
48: 'checkbox' => '/Forms/Controls/Checkbox.php',
49: 'classreflection' => '/Reflection/ClassType.php',
50: 'clirouter' => '/Application/Routers/CliRouter.php',
51: 'component' => '/ComponentModel/Component.php',
52: 'componentcontainer' => '/ComponentModel/Container.php',
53: 'config' => '/Config/Config.php',
54: 'configurator' => '/common/Configurator.php',
55: 'connection' => '/Database/Connection.php',
56: 'control' => '/Application/UI/Control.php',
57: 'coremacros' => '/Latte/Macros/CoreMacros.php',
58: 'criticalsection' => '/Utils/CriticalSection.php',
59: 'databasepanel' => '/Database/Diagnostics/ConnectionPanel.php',
60: 'databasereflection' => '/Database/Reflection/DatabaseReflection.php',
61: 'datetime53' => '/common/DateTime.php',
62: 'debugbar' => '/Diagnostics/Bar.php',
63: 'debugbluescreen' => '/Diagnostics/BlueScreen.php',
64: 'debugger' => '/Diagnostics/Debugger.php',
65: 'debughelpers' => '/Diagnostics/Helpers.php',
66: 'defaultbarpanel' => '/Diagnostics/DefaultBarPanel.php',
67: 'defaultformrenderer' => '/Forms/Rendering/DefaultFormRenderer.php',
68: 'deprecatedexception' => '/common/exceptions.php',
69: 'devnullstorage' => '/Caching/Storages/DevNullStorage.php',
70: 'dicontainer' => '/DI/Container.php',
71: 'dicontainerbuilder' => '/DI/ContainerBuilder.php',
72: 'directorynotfoundexception' => '/common/exceptions.php',
73: 'environment' => '/common/Environment.php',
74: 'extensionreflection' => '/Reflection/Extension.php',
75: 'fatalerrorexception' => '/common/exceptions.php',
76: 'filejournal' => '/Caching/Storages/FileJournal.php',
77: 'filenotfoundexception' => '/common/exceptions.php',
78: 'fileresponse' => '/Application/Responses/FileResponse.php',
79: 'filestorage' => '/Caching/Storages/FileStorage.php',
80: 'filetemplate' => '/Templating/FileTemplate.php',
81: 'finder' => '/Utils/Finder.php',
82: 'firelogger' => '/Diagnostics/FireLogger.php',
83: 'forbiddenrequestexception' => '/Application/exceptions.php',
84: 'form' => '/Forms/Form.php',
85: 'formcontainer' => '/Forms/Container.php',
86: 'formcontrol' => '/Forms/Controls/BaseControl.php',
87: 'formgroup' => '/Forms/ControlGroup.php',
88: 'formmacros' => '/Latte/Macros/FormMacros.php',
89: 'forwardresponse' => '/Application/Responses/ForwardResponse.php',
90: 'framework' => '/common/Framework.php',
91: 'freezableobject' => '/common/FreezableObject.php',
92: 'functionreflection' => '/Reflection/GlobalFunction.php',
93: 'genericrecursiveiterator' => '/Iterators/Recursor.php',
94: 'groupedtableselection' => '/Database/Table/GroupedSelection.php',
95: 'hiddenfield' => '/Forms/Controls/HiddenField.php',
96: 'html' => '/Utils/Html.php',
97: 'htmlnode' => '/Latte/HtmlNode.php',
98: 'httpcontext' => '/Http/Context.php',
99: 'httprequest' => '/Http/Request.php',
100: 'httprequestfactory' => '/Http/RequestFactory.php',
101: 'httpresponse' => '/Http/Response.php',
102: 'httpuploadedfile' => '/Http/FileUpload.php',
103: 'iannotation' => '/Reflection/IAnnotation.php',
104: 'iauthenticator' => '/Security/IAuthenticator.php',
105: 'iauthorizator' => '/Security/IAuthorizator.php',
106: 'ibarpanel' => '/Diagnostics/IBarPanel.php',
107: 'icachejournal' => '/Caching/Storages/IJournal.php',
108: 'icachestorage' => '/Caching/IStorage.php',
109: 'icomponent' => '/ComponentModel/IComponent.php',
110: 'icomponentcontainer' => '/ComponentModel/IContainer.php',
111: 'iconfigadapter' => '/Config/IAdapter.php',
112: 'identity' => '/Security/Identity.php',
113: 'idicontainer' => '/DI/IContainer.php',
114: 'ifiletemplate' => '/Templating/IFileTemplate.php',
115: 'iformcontrol' => '/Forms/IControl.php',
116: 'iformrenderer' => '/Forms/IFormRenderer.php',
117: 'ifreezable' => '/common/IFreezable.php',
118: 'ihttprequest' => '/Http/IRequest.php',
119: 'ihttpresponse' => '/Http/IResponse.php',
120: 'iidentity' => '/Security/IIdentity.php',
121: 'imacro' => '/Latte/IMacro.php',
122: 'image' => '/common/Image.php',
123: 'imagebutton' => '/Forms/Controls/ImageButton.php',
124: 'imailer' => '/Mail/IMailer.php',
125: 'iniadapter' => '/Config/IniAdapter.php',
126: 'instancefilteriterator' => '/Iterators/InstanceFilter.php',
127: 'invalidlinkexception' => '/Application/UI/InvalidLinkException.php',
128: 'invalidpresenterexception' => '/Application/exceptions.php',
129: 'invalidstateexception' => '/common/exceptions.php',
130: 'ioexception' => '/common/exceptions.php',
131: 'ipartiallyrenderable' => '/Application/UI/IPartiallyRenderable.php',
132: 'ipresenter' => '/Application/IPresenter.php',
133: 'ipresenterfactory' => '/Application/IPresenterFactory.php',
134: 'ipresenterresponse' => '/Application/IResponse.php',
135: 'irenderable' => '/Application/UI/IRenderable.php',
136: 'iresource' => '/Security/IResource.php',
137: 'irole' => '/Security/IRole.php',
138: 'irouter' => '/Application/IRouter.php',
139: 'iservicebuilder' => '/DI/IServiceBuilder.php',
140: 'isessionstorage' => '/Http/ISessionStorage.php',
141: 'isignalreceiver' => '/Application/UI/ISignalReceiver.php',
142: 'istatepersistent' => '/Application/UI/IStatePersistent.php',
143: 'isubmittercontrol' => '/Forms/ISubmitterControl.php',
144: 'isupplementaldriver' => '/Database/ISupplementalDriver.php',
145: 'itemplate' => '/Templating/ITemplate.php',
146: 'itranslator' => '/Localization/ITranslator.php',
147: 'iuser' => '/Http/IUser.php',
148: 'json' => '/Utils/Json.php',
149: 'jsonexception' => '/Utils/Json.php',
150: 'jsonresponse' => '/Application/Responses/JsonResponse.php',
151: 'latteexception' => '/Latte/ParseException.php',
152: 'lattefilter' => '/Latte/Engine.php',
153: 'limitedscope' => '/Utils/LimitedScope.php',
154: 'link' => '/Application/UI/Link.php',
155: 'logger' => '/Diagnostics/Logger.php',
156: 'macronode' => '/Latte/MacroNode.php',
157: 'macroset' => '/Latte/Macros/MacroSet.php',
158: 'macrotokenizer' => '/Latte/MacroTokenizer.php',
159: 'mail' => '/Mail/Message.php',
160: 'mailmimepart' => '/Mail/MimePart.php',
161: 'mapiterator' => '/Iterators/Mapper.php',
162: 'memberaccessexception' => '/common/exceptions.php',
163: 'memcachedstorage' => '/Caching/Storages/MemcachedStorage.php',
164: 'memorystorage' => '/Caching/Storages/MemoryStorage.php',
165: 'methodreflection' => '/Reflection/Method.php',
166: 'micropresenter' => '/Application/MicroPresenter.php',
167: 'mimetypedetector' => '/Utils/MimeTypeDetector.php',
168: 'missingserviceexception' => '/DI/exceptions.php',
169: 'mssqldriver' => '/Database/Drivers/MsSqlDriver.php',
170: 'multiselectbox' => '/Forms/Controls/MultiSelectBox.php',
171: 'mysqldriver' => '/Database/Drivers/MySqlDriver.php',
172: 'ncallbackfilteriterator' => '/Iterators/Filter.php',
173: 'ncfix' => '/loader.php',
174: 'neon' => '/Utils/Neon.php',
175: 'neonadapter' => '/Config/NeonAdapter.php',
176: 'neonexception' => '/Utils/Neon.php',
177: 'netteloader' => '/Loaders/NetteLoader.php',
178: 'notimplementedexception' => '/common/exceptions.php',
179: 'notsupportedexception' => '/common/exceptions.php',
180: 'nrecursivecallbackfilteriterator' => '/Iterators/RecursiveFilter.php',
181: 'object' => '/common/Object.php',
182: 'objectmixin' => '/common/ObjectMixin.php',
183: 'ocidriver' => '/Database/Drivers/OciDriver.php',
184: 'odbcdriver' => '/Database/Drivers/OdbcDriver.php',
185: 'paginator' => '/Utils/Paginator.php',
186: 'parameterreflection' => '/Reflection/Parameter.php',
187: 'parser' => '/Latte/Parser.php',
188: 'permission' => '/Security/Permission.php',
189: 'pgsqldriver' => '/Database/Drivers/PgSqlDriver.php',
190: 'phpfilestorage' => '/Caching/Storages/PhpFileStorage.php',
191: 'phpwriter' => '/Latte/PhpWriter.php',
192: 'presenter' => '/Application/UI/Presenter.php',
193: 'presentercomponent' => '/Application/UI/PresenterComponent.php',
194: 'presentercomponentreflection' => '/Application/UI/PresenterComponentReflection.php',
195: 'presenterfactory' => '/Application/PresenterFactory.php',
196: 'presenterrequest' => '/Application/Request.php',
197: 'propertyreflection' => '/Reflection/Property.php',
198: 'radiolist' => '/Forms/Controls/RadioList.php',
199: 'recursivecomponentiterator' => '/ComponentModel/RecursiveComponentIterator.php',
200: 'redirectresponse' => '/Application/Responses/RedirectResponse.php',
201: 'regexpexception' => '/Utils/Strings.php',
202: 'robotloader' => '/Loaders/RobotLoader.php',
203: 'route' => '/Application/Routers/Route.php',
204: 'routelist' => '/Application/Routers/RouteList.php',
205: 'routingdebugger' => '/Application/Diagnostics/RoutingPanel.php',
206: 'row' => '/Database/Row.php',
207: 'rule' => '/Forms/Rule.php',
208: 'rules' => '/Forms/Rules.php',
209: 'safestream' => '/Utils/SafeStream.php',
210: 'selectbox' => '/Forms/Controls/SelectBox.php',
211: 'sendmailmailer' => '/Mail/SendmailMailer.php',
212: 'servicebuilder' => '/DI/ServiceBuilder.php',
213: 'session' => '/Http/Session.php',
214: 'sessionsection' => '/Http/SessionSection.php',
215: 'simpleauthenticator' => '/Security/SimpleAuthenticator.php',
216: 'simplerouter' => '/Application/Routers/SimpleRouter.php',
217: 'smartcachingiterator' => '/Iterators/CachingIterator.php',
218: 'smtpexception' => '/Mail/SmtpMailer.php',
219: 'smtpmailer' => '/Mail/SmtpMailer.php',
220: 'sqlite2driver' => '/Database/Drivers/Sqlite2Driver.php',
221: 'sqlitedriver' => '/Database/Drivers/SqliteDriver.php',
222: 'sqlliteral' => '/Database/SqlLiteral.php',
223: 'sqlpreprocessor' => '/Database/SqlPreprocessor.php',
224: 'statement' => '/Database/Statement.php',
225: 'staticclassexception' => '/common/exceptions.php',
226: 'strings' => '/Utils/Strings.php',
227: 'submitbutton' => '/Forms/Controls/SubmitButton.php',
228: 'tablerow' => '/Database/Table/ActiveRow.php',
229: 'tableselection' => '/Database/Table/Selection.php',
230: 'template' => '/Templating/Template.php',
231: 'templateexception' => '/Templating/FilterException.php',
232: 'templatehelpers' => '/Templating/DefaultHelpers.php',
233: 'textarea' => '/Forms/Controls/TextArea.php',
234: 'textbase' => '/Forms/Controls/TextBase.php',
235: 'textinput' => '/Forms/Controls/TextInput.php',
236: 'textresponse' => '/Application/Responses/TextResponse.php',
237: 'tokenizer' => '/Utils/Tokenizer.php',
238: 'tokenizerexception' => '/Utils/Tokenizer.php',
239: 'uimacros' => '/Latte/Macros/UIMacros.php',
240: 'unknownimagefileexception' => '/common/Image.php',
241: 'uploadcontrol' => '/Forms/Controls/UploadControl.php',
242: 'url' => '/Http/Url.php',
243: 'urlscript' => '/Http/UrlScript.php',
244: 'user' => '/Http/User.php',
245: );
246:
247:
248:
249: 250: 251: 252:
253: public static function getInstance()
254: {
255: if (self::$instance === NULL) {
256: self::$instance = new self;
257: }
258: return self::$instance;
259: }
260:
261:
262:
263: 264: 265: 266: 267:
268: public function tryLoad($type)
269: {
270: $type = ltrim(strtolower($type), '\\');
271: if (isset($this->list[$type])) {
272: LimitedScope::load(NETTE_DIR . $this->list[$type]);
273: self::$count++;
274: }
275: }
276:
277: }
278: