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