1: <?php
2:
3: 4: 5: 6: 7: 8: 9: 10: 11:
12:
13:
14:
15: 16: 17: 18: 19: 20:
21: class NNetteLoader extends NAutoLoader
22: {
23:
24: private static $instance;
25:
26:
27: public $renamed = array(
28: 'NUser' => 'NUser',
29: 'NDefaultHelpers' => 'NTemplateHelpers',
30: 'NLatteException' => 'NCompileException',
31: );
32:
33:
34: public $list = array(
35: 'ArgumentOutOfRangeException' => '/common/exceptions',
36: 'DeprecatedException' => '/common/exceptions',
37: 'DirectoryNotFoundException' => '/common/exceptions',
38: 'FatalErrorException' => '/common/exceptions',
39: 'FileNotFoundException' => '/common/exceptions',
40: 'IAnnotation' => '/Reflection/IAnnotation',
41: 'IAuthenticator' => '/Security/IAuthenticator',
42: 'IAuthorizator' => '/Security/IAuthorizator',
43: 'IBarPanel' => '/Diagnostics/IBarPanel',
44: 'ICacheJournal' => '/Caching/Storages/IJournal',
45: 'ICacheStorage' => '/Caching/IStorage',
46: 'IComponent' => '/ComponentModel/IComponent',
47: 'IComponentContainer' => '/ComponentModel/IContainer',
48: 'IConfigAdapter' => '/Config/IAdapter',
49: 'IDIContainer' => '/DI/IContainer',
50: 'IFileTemplate' => '/Templating/IFileTemplate',
51: 'IFormControl' => '/Forms/IControl',
52: 'IFormRenderer' => '/Forms/IFormRenderer',
53: 'IFreezable' => '/common/IFreezable',
54: 'IHttpRequest' => '/Http/IRequest',
55: 'IHttpResponse' => '/Http/IResponse',
56: 'IIdentity' => '/Security/IIdentity',
57: 'IMacro' => '/Latte/IMacro',
58: 'IMailer' => '/Mail/IMailer',
59: 'IOException' => '/common/exceptions',
60: 'IPresenter' => '/Application/IPresenter',
61: 'IPresenterFactory' => '/Application/IPresenterFactory',
62: 'IPresenterResponse' => '/Application/IResponse',
63: 'IReflection' => '/Database/IReflection',
64: 'IRenderable' => '/Application/UI/IRenderable',
65: 'IResource' => '/Security/IResource',
66: 'IRole' => '/Security/IRole',
67: 'IRouter' => '/Application/IRouter',
68: 'ISessionStorage' => '/Http/ISessionStorage',
69: 'ISignalReceiver' => '/Application/UI/ISignalReceiver',
70: 'IStatePersistent' => '/Application/UI/IStatePersistent',
71: 'ISubmitterControl' => '/Forms/ISubmitterControl',
72: 'ISupplementalDriver' => '/Database/ISupplementalDriver',
73: 'ITemplate' => '/Templating/ITemplate',
74: 'ITranslator' => '/Localization/ITranslator',
75: 'IUserStorage' => '/Security/IUserStorage',
76: 'InvalidStateException' => '/common/exceptions',
77: 'MemberAccessException' => '/common/exceptions',
78: 'NAbortException' => '/Application/exceptions',
79: 'NAmbiguousReferenceKeyException' => '/Database/Reflection/exceptions',
80: 'NAnnotation' => '/Reflection/Annotation',
81: 'NAnnotationsParser' => '/Reflection/AnnotationsParser',
82: 'NAppForm' => '/Application/UI/Form',
83: 'NApplication' => '/Application/Application',
84: 'NApplicationException' => '/Application/exceptions',
85: 'NArrayHash' => '/common/ArrayHash',
86: 'NArrayList' => '/common/ArrayList',
87: 'NArrays' => '/Utils/Arrays',
88: 'NAssertionException' => '/Utils/Validators',
89: 'NAuthenticationException' => '/Security/AuthenticationException',
90: 'NAutoLoader' => '/Loaders/AutoLoader',
91: 'NBadRequestException' => '/Application/exceptions',
92: 'NBadSignalException' => '/Application/UI/BadSignalException',
93: 'NButton' => '/Forms/Controls/Button',
94: 'NCache' => '/Caching/Cache',
95: 'NCacheMacro' => '/Latte/Macros/CacheMacro',
96: 'NCachingHelper' => '/Caching/OutputHelper',
97: 'NCallback' => '/common/Callback',
98: 'NCheckbox' => '/Forms/Controls/Checkbox',
99: 'NClassReflection' => '/Reflection/ClassType',
100: 'NCliRouter' => '/Application/Routers/CliRouter',
101: 'NCompileException' => '/Latte/exceptions',
102: 'NComponent' => '/ComponentModel/Component',
103: 'NComponentContainer' => '/ComponentModel/Container',
104: 'NConfigCompiler' => '/Config/Compiler',
105: 'NConfigCompilerExtension' => '/Config/CompilerExtension',
106: 'NConfigHelpers' => '/Config/Helpers',
107: 'NConfigIniAdapter' => '/Config/Adapters/IniAdapter',
108: 'NConfigLoader' => '/Config/Loader',
109: 'NConfigNeonAdapter' => '/Config/Adapters/NeonAdapter',
110: 'NConfigPhpAdapter' => '/Config/Adapters/PhpAdapter',
111: 'NConfigurator' => '/Config/Configurator',
112: 'NConnection' => '/Database/Connection',
113: 'NConstantsExtension' => '/Config/Extensions/ConstantsExtension',
114: 'NContainerPanel' => '/DI/Diagnostics/ContainerPanel',
115: 'NControl' => '/Application/UI/Control',
116: 'NConventionalReflection' => '/Database/Reflection/ConventionalReflection',
117: 'NCoreMacros' => '/Latte/Macros/CoreMacros',
118: 'NDIContainer' => '/DI/Container',
119: 'NDIContainerBuilder' => '/DI/ContainerBuilder',
120: 'NDIHelpers' => '/DI/Helpers',
121: 'NDINestedAccessor' => '/DI/NestedAccessor',
122: 'NDIServiceDefinition' => '/DI/ServiceDefinition',
123: 'NDIStatement' => '/DI/Statement',
124: 'NDatabaseHelpers' => '/Database/Helpers',
125: 'NDatabasePanel' => '/Database/Diagnostics/ConnectionPanel',
126: 'NDateTime53' => '/common/DateTime',
127: 'NDebugBar' => '/Diagnostics/Bar',
128: 'NDebugBlueScreen' => '/Diagnostics/BlueScreen',
129: 'NDebugHelpers' => '/Diagnostics/Helpers',
130: 'NDebugger' => '/Diagnostics/Debugger',
131: 'NDefaultBarPanel' => '/Diagnostics/DefaultBarPanel',
132: 'NDefaultFormRenderer' => '/Forms/Rendering/DefaultFormRenderer',
133: 'NDevNullStorage' => '/Caching/Storages/DevNullStorage',
134: 'NDiscoveredReflection' => '/Database/Reflection/DiscoveredReflection',
135: 'NEnvironment' => '/common/Environment',
136: 'NExtensionReflection' => '/Reflection/Extension',
137: 'NFileJournal' => '/Caching/Storages/FileJournal',
138: 'NFileResponse' => '/Application/Responses/FileResponse',
139: 'NFileStorage' => '/Caching/Storages/FileStorage',
140: 'NFileTemplate' => '/Templating/FileTemplate',
141: 'NFinder' => '/Utils/Finder',
142: 'NFireLogger' => '/Diagnostics/FireLogger',
143: 'NForbiddenRequestException' => '/Application/exceptions',
144: 'NForm' => '/Forms/Form',
145: 'NFormContainer' => '/Forms/Container',
146: 'NFormControl' => '/Forms/Controls/BaseControl',
147: 'NFormGroup' => '/Forms/ControlGroup',
148: 'NFormMacros' => '/Latte/Macros/FormMacros',
149: 'NForwardResponse' => '/Application/Responses/ForwardResponse',
150: 'NFramework' => '/common/Framework',
151: 'NFreezableObject' => '/common/FreezableObject',
152: 'NFunctionReflection' => '/Reflection/GlobalFunction',
153: 'NGenericRecursiveIterator' => '/Iterators/Recursor',
154: 'NGroupedTableSelection' => '/Database/Table/GroupedSelection',
155: 'NHiddenField' => '/Forms/Controls/HiddenField',
156: 'NHtml' => '/Utils/Html',
157: 'NHtmlNode' => '/Latte/HtmlNode',
158: 'NHttpContext' => '/Http/Context',
159: 'NHttpRequest' => '/Http/Request',
160: 'NHttpRequestFactory' => '/Http/RequestFactory',
161: 'NHttpResponse' => '/Http/Response',
162: 'NHttpUploadedFile' => '/Http/FileUpload',
163: 'NIdentity' => '/Security/Identity',
164: 'NImage' => '/common/Image',
165: 'NImageButton' => '/Forms/Controls/ImageButton',
166: 'NInstanceFilterIterator' => '/Iterators/InstanceFilter',
167: 'NInvalidLinkException' => '/Application/UI/InvalidLinkException',
168: 'NInvalidPresenterException' => '/Application/exceptions',
169: 'NJson' => '/Utils/Json',
170: 'NJsonException' => '/Utils/Json',
171: 'NJsonResponse' => '/Application/Responses/JsonResponse',
172: 'NLatteCompiler' => '/Latte/Compiler',
173: 'NLatteFilter' => '/Latte/Engine',
174: 'NLatteToken' => '/Latte/Token',
175: 'NLimitedScope' => '/Utils/LimitedScope',
176: 'NLink' => '/Application/UI/Link',
177: 'NLogger' => '/Diagnostics/Logger',
178: 'NMacroNode' => '/Latte/MacroNode',
179: 'NMacroSet' => '/Latte/Macros/MacroSet',
180: 'NMacroTokenizer' => '/Latte/MacroTokenizer',
181: 'NMail' => '/Mail/Message',
182: 'NMailMimePart' => '/Mail/MimePart',
183: 'NMapIterator' => '/Iterators/Mapper',
184: 'NMemcachedStorage' => '/Caching/Storages/MemcachedStorage',
185: 'NMemoryStorage' => '/Caching/Storages/MemoryStorage',
186: 'NMethodReflection' => '/Reflection/Method',
187: 'NMimeTypeDetector' => '/Utils/MimeTypeDetector',
188: 'NMissingReferenceException' => '/Database/Reflection/exceptions',
189: 'NMissingServiceException' => '/DI/exceptions',
190: 'NMsSqlDriver' => '/Database/Drivers/MsSqlDriver',
191: 'NMultiSelectBox' => '/Forms/Controls/MultiSelectBox',
192: 'NMultiplier' => '/Application/UI/Multiplier',
193: 'NMySqlDriver' => '/Database/Drivers/MySqlDriver',
194: 'NNCallbackFilterIterator' => '/Iterators/Filter',
195: 'NNRecursiveCallbackFilterIterator' => '/Iterators/RecursiveFilter',
196: 'NNeon' => '/Utils/Neon',
197: 'NNeonEntity' => '/Utils/Neon',
198: 'NNeonException' => '/Utils/Neon',
199: 'NNetteExtension' => '/Config/Extensions/NetteExtension',
200: 'NNetteLoader' => '/Loaders/NetteLoader',
201: 'NObject' => '/common/Object',
202: 'NObjectMixin' => '/common/ObjectMixin',
203: 'NOciDriver' => '/Database/Drivers/OciDriver',
204: 'NOdbcDriver' => '/Database/Drivers/OdbcDriver',
205: 'NPaginator' => '/Utils/Paginator',
206: 'NParameterReflection' => '/Reflection/Parameter',
207: 'NParser' => '/Latte/Parser',
208: 'NPermission' => '/Security/Permission',
209: 'NPgSqlDriver' => '/Database/Drivers/PgSqlDriver',
210: 'NPhpClassType' => '/Utils/PhpGenerator/ClassType',
211: 'NPhpExtension' => '/Config/Extensions/PhpExtension',
212: 'NPhpFileStorage' => '/Caching/Storages/PhpFileStorage',
213: 'NPhpHelpers' => '/Utils/PhpGenerator/Helpers',
214: 'NPhpLiteral' => '/Utils/PhpGenerator/PhpLiteral',
215: 'NPhpMethod' => '/Utils/PhpGenerator/Method',
216: 'NPhpParameter' => '/Utils/PhpGenerator/Parameter',
217: 'NPhpProperty' => '/Utils/PhpGenerator/Property',
218: 'NPhpWriter' => '/Latte/PhpWriter',
219: 'NPresenter' => '/Application/UI/Presenter',
220: 'NPresenterComponent' => '/Application/UI/PresenterComponent',
221: 'NPresenterComponentReflection' => '/Application/UI/PresenterComponentReflection',
222: 'NPresenterFactory' => '/Application/PresenterFactory',
223: 'NPresenterRequest' => '/Application/Request',
224: 'NPropertyReflection' => '/Reflection/Property',
225: 'NRadioList' => '/Forms/Controls/RadioList',
226: 'NRecursiveComponentIterator' => '/ComponentModel/RecursiveComponentIterator',
227: 'NRedirectResponse' => '/Application/Responses/RedirectResponse',
228: 'NRegexpException' => '/Utils/Strings',
229: 'NRobotLoader' => '/Loaders/RobotLoader',
230: 'NRoute' => '/Application/Routers/Route',
231: 'NRouteList' => '/Application/Routers/RouteList',
232: 'NRoutingDebugger' => '/Application/Diagnostics/RoutingPanel',
233: 'NRow' => '/Database/Row',
234: 'NRule' => '/Forms/Rule',
235: 'NRules' => '/Forms/Rules',
236: 'NSafeStream' => '/Utils/SafeStream',
237: 'NSelectBox' => '/Forms/Controls/SelectBox',
238: 'NSendmailMailer' => '/Mail/SendmailMailer',
239: 'NServiceCreationException' => '/DI/exceptions',
240: 'NSession' => '/Http/Session',
241: 'NSessionSection' => '/Http/SessionSection',
242: 'NSimpleAuthenticator' => '/Security/SimpleAuthenticator',
243: 'NSimpleRouter' => '/Application/Routers/SimpleRouter',
244: 'NSmartCachingIterator' => '/Iterators/CachingIterator',
245: 'NSmtpException' => '/Mail/SmtpMailer',
246: 'NSmtpMailer' => '/Mail/SmtpMailer',
247: 'NSqlBuilder' => '/Database/Table/SqlBuilder',
248: 'NSqlLiteral' => '/Database/SqlLiteral',
249: 'NSqlPreprocessor' => '/Database/SqlPreprocessor',
250: 'NSqlite2Driver' => '/Database/Drivers/Sqlite2Driver',
251: 'NSqliteDriver' => '/Database/Drivers/SqliteDriver',
252: 'NStatement' => '/Database/Statement',
253: 'NStaticClassException' => '/common/exceptions',
254: 'NStrings' => '/Utils/Strings',
255: 'NSubmitButton' => '/Forms/Controls/SubmitButton',
256: 'NTableRow' => '/Database/Table/ActiveRow',
257: 'NTableSelection' => '/Database/Table/Selection',
258: 'NTemplate' => '/Templating/Template',
259: 'NTemplateException' => '/Templating/FilterException',
260: 'NTemplateHelpers' => '/Templating/Helpers',
261: 'NTextArea' => '/Forms/Controls/TextArea',
262: 'NTextBase' => '/Forms/Controls/TextBase',
263: 'NTextInput' => '/Forms/Controls/TextInput',
264: 'NTextResponse' => '/Application/Responses/TextResponse',
265: 'NTokenizer' => '/Utils/Tokenizer',
266: 'NTokenizerException' => '/Utils/Tokenizer',
267: 'NUIMacros' => '/Latte/Macros/UIMacros',
268: 'NUnknownImageFileException' => '/common/Image',
269: 'NUploadControl' => '/Forms/Controls/UploadControl',
270: 'NUrl' => '/Http/Url',
271: 'NUrlScript' => '/Http/UrlScript',
272: 'NUser' => '/Security/User',
273: 'NUserPanel' => '/Security/Diagnostics/UserPanel',
274: 'NUserStorage' => '/Http/UserStorage',
275: 'NValidators' => '/Utils/Validators',
276: 'Nette_MicroPresenter' => '/Application/MicroPresenter',
277: 'NotImplementedException' => '/common/exceptions',
278: 'NotSupportedException' => '/common/exceptions',
279: );
280:
281:
282: 283: 284: 285:
286: public static function getInstance()
287: {
288: if (self::$instance === NULL) {
289: self::$instance = new self;
290: }
291: return self::$instance;
292: }
293:
294:
295: 296: 297: 298: 299:
300: public function tryLoad($type)
301: {
302: $type = ltrim($type, '\\');
303: if (isset($this->list[$type])) {
304: NLimitedScope::load(NETTE_DIR . $this->list[$type] . '.php', TRUE);
305: self::$count++;
306:
307: }}
308:
309: }
310: