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 $renamed = array(
28: 'Configurator' => 'Configurator',
29: 'User' => 'User',
30: 'DefaultHelpers' => 'TemplateHelpers',
31: 'LatteException' => 'CompileException',
32: );
33:
34:
35: public $list = array(
36: 'AbortException' => '/Application/exceptions',
37: 'Annotation' => '/Reflection/Annotation',
38: 'AnnotationsParser' => '/Reflection/AnnotationsParser',
39: 'AppForm' => '/Application/UI/Form',
40: 'Application' => '/Application/Application',
41: 'ApplicationException' => '/Application/exceptions',
42: 'ArgumentOutOfRangeException' => '/common/exceptions',
43: 'ArrayHash' => '/common/ArrayHash',
44: 'ArrayList' => '/common/ArrayList',
45: 'Arrays' => '/Utils/Arrays',
46: 'AssertionException' => '/Utils/Validators',
47: 'AuthenticationException' => '/Security/AuthenticationException',
48: 'AutoLoader' => '/Loaders/AutoLoader',
49: 'BadRequestException' => '/Application/exceptions',
50: 'BadSignalException' => '/Application/UI/BadSignalException',
51: 'Button' => '/Forms/Controls/Button',
52: 'Cache' => '/Caching/Cache',
53: 'CacheMacro' => '/Latte/Macros/CacheMacro',
54: 'CachingHelper' => '/Caching/OutputHelper',
55: 'Callback' => '/common/Callback',
56: 'Checkbox' => '/Forms/Controls/Checkbox',
57: 'ClassReflection' => '/Reflection/ClassType',
58: 'CliRouter' => '/Application/Routers/CliRouter',
59: 'CompileException' => '/Latte/exceptions',
60: 'Component' => '/ComponentModel/Component',
61: 'ComponentContainer' => '/ComponentModel/Container',
62: 'ConfigCompiler' => '/Config/Compiler',
63: 'ConfigCompilerExtension' => '/Config/CompilerExtension',
64: 'ConfigHelpers' => '/Config/Helpers',
65: 'ConfigIniAdapter' => '/Config/Adapters/IniAdapter',
66: 'ConfigLoader' => '/Config/Loader',
67: 'ConfigNeonAdapter' => '/Config/Adapters/NeonAdapter',
68: 'ConfigPhpAdapter' => '/Config/Adapters/PhpAdapter',
69: 'Configurator' => '/Config/Configurator',
70: 'Connection' => '/Database/Connection',
71: 'ConstantsExtension' => '/Config/Extensions/ConstantsExtension',
72: 'ContainerPanel' => '/DI/Diagnostics/ContainerPanel',
73: 'Control' => '/Application/UI/Control',
74: 'ConventionalReflection' => '/Database/Reflection/ConventionalReflection',
75: 'CoreMacros' => '/Latte/Macros/CoreMacros',
76: 'DIContainer' => '/DI/Container',
77: 'DIContainerBuilder' => '/DI/ContainerBuilder',
78: 'DIHelpers' => '/DI/Helpers',
79: 'DINestedAccessor' => '/DI/NestedAccessor',
80: 'DIServiceDefinition' => '/DI/ServiceDefinition',
81: 'DIStatement' => '/DI/Statement',
82: 'DatabaseHelpers' => '/Database/Helpers',
83: 'DatabasePanel' => '/Database/Diagnostics/ConnectionPanel',
84: 'DateTime53' => '/common/DateTime',
85: 'DebugBar' => '/Diagnostics/Bar',
86: 'DebugBlueScreen' => '/Diagnostics/BlueScreen',
87: 'DebugHelpers' => '/Diagnostics/Helpers',
88: 'Debugger' => '/Diagnostics/Debugger',
89: 'DefaultBarPanel' => '/Diagnostics/DefaultBarPanel',
90: 'DefaultFormRenderer' => '/Forms/Rendering/DefaultFormRenderer',
91: 'DeprecatedException' => '/common/exceptions',
92: 'DevNullStorage' => '/Caching/Storages/DevNullStorage',
93: 'DirectoryNotFoundException' => '/common/exceptions',
94: 'DiscoveredReflection' => '/Database/Reflection/DiscoveredReflection',
95: 'Environment' => '/common/Environment',
96: 'ExtensionReflection' => '/Reflection/Extension',
97: 'FatalErrorException' => '/common/exceptions',
98: 'FileJournal' => '/Caching/Storages/FileJournal',
99: 'FileNotFoundException' => '/common/exceptions',
100: 'FileResponse' => '/Application/Responses/FileResponse',
101: 'FileStorage' => '/Caching/Storages/FileStorage',
102: 'FileTemplate' => '/Templating/FileTemplate',
103: 'Finder' => '/Utils/Finder',
104: 'FireLogger' => '/Diagnostics/FireLogger',
105: 'ForbiddenRequestException' => '/Application/exceptions',
106: 'Form' => '/Forms/Form',
107: 'FormContainer' => '/Forms/Container',
108: 'FormControl' => '/Forms/Controls/BaseControl',
109: 'FormGroup' => '/Forms/ControlGroup',
110: 'FormMacros' => '/Latte/Macros/FormMacros',
111: 'ForwardResponse' => '/Application/Responses/ForwardResponse',
112: 'Framework' => '/common/Framework',
113: 'FreezableObject' => '/common/FreezableObject',
114: 'FunctionReflection' => '/Reflection/GlobalFunction',
115: 'GenericRecursiveIterator' => '/Iterators/Recursor',
116: 'GroupedTableSelection' => '/Database/Table/GroupedSelection',
117: 'HiddenField' => '/Forms/Controls/HiddenField',
118: 'Html' => '/Utils/Html',
119: 'HtmlNode' => '/Latte/HtmlNode',
120: 'HttpContext' => '/Http/Context',
121: 'HttpRequest' => '/Http/Request',
122: 'HttpRequestFactory' => '/Http/RequestFactory',
123: 'HttpResponse' => '/Http/Response',
124: 'HttpUploadedFile' => '/Http/FileUpload',
125: 'IAnnotation' => '/Reflection/IAnnotation',
126: 'IAuthenticator' => '/Security/IAuthenticator',
127: 'IAuthorizator' => '/Security/IAuthorizator',
128: 'IBarPanel' => '/Diagnostics/IBarPanel',
129: 'ICacheJournal' => '/Caching/Storages/IJournal',
130: 'ICacheStorage' => '/Caching/IStorage',
131: 'IComponent' => '/ComponentModel/IComponent',
132: 'IComponentContainer' => '/ComponentModel/IContainer',
133: 'IConfigAdapter' => '/Config/IAdapter',
134: 'IDIContainer' => '/DI/IContainer',
135: 'IFileTemplate' => '/Templating/IFileTemplate',
136: 'IFormControl' => '/Forms/IControl',
137: 'IFormRenderer' => '/Forms/IFormRenderer',
138: 'IFreezable' => '/common/IFreezable',
139: 'IHttpRequest' => '/Http/IRequest',
140: 'IHttpResponse' => '/Http/IResponse',
141: 'IIdentity' => '/Security/IIdentity',
142: 'IMacro' => '/Latte/IMacro',
143: 'IMailer' => '/Mail/IMailer',
144: 'IOException' => '/common/exceptions',
145: 'IPresenter' => '/Application/IPresenter',
146: 'IPresenterFactory' => '/Application/IPresenterFactory',
147: 'IPresenterResponse' => '/Application/IResponse',
148: 'IReflection' => '/Database/IReflection',
149: 'IRenderable' => '/Application/UI/IRenderable',
150: 'IResource' => '/Security/IResource',
151: 'IRole' => '/Security/IRole',
152: 'IRouter' => '/Application/IRouter',
153: 'ISessionStorage' => '/Http/ISessionStorage',
154: 'ISignalReceiver' => '/Application/UI/ISignalReceiver',
155: 'IStatePersistent' => '/Application/UI/IStatePersistent',
156: 'ISubmitterControl' => '/Forms/ISubmitterControl',
157: 'ISupplementalDriver' => '/Database/ISupplementalDriver',
158: 'ITemplate' => '/Templating/ITemplate',
159: 'ITranslator' => '/Localization/ITranslator',
160: 'IUserStorage' => '/Security/IUserStorage',
161: 'Identity' => '/Security/Identity',
162: 'Image' => '/common/Image',
163: 'ImageButton' => '/Forms/Controls/ImageButton',
164: 'InstanceFilterIterator' => '/Iterators/InstanceFilter',
165: 'InvalidLinkException' => '/Application/UI/InvalidLinkException',
166: 'InvalidPresenterException' => '/Application/exceptions',
167: 'InvalidStateException' => '/common/exceptions',
168: 'Json' => '/Utils/Json',
169: 'JsonException' => '/Utils/Json',
170: 'JsonResponse' => '/Application/Responses/JsonResponse',
171: 'LatteCompiler' => '/Latte/Compiler',
172: 'LatteFilter' => '/Latte/Engine',
173: 'LatteToken' => '/Latte/Token',
174: 'LimitedScope' => '/Utils/LimitedScope',
175: 'Link' => '/Application/UI/Link',
176: 'Logger' => '/Diagnostics/Logger',
177: 'MacroNode' => '/Latte/MacroNode',
178: 'MacroSet' => '/Latte/Macros/MacroSet',
179: 'MacroTokenizer' => '/Latte/MacroTokenizer',
180: 'Mail' => '/Mail/Message',
181: 'MailMimePart' => '/Mail/MimePart',
182: 'MapIterator' => '/Iterators/Mapper',
183: 'MemberAccessException' => '/common/exceptions',
184: 'MemcachedStorage' => '/Caching/Storages/MemcachedStorage',
185: 'MemoryStorage' => '/Caching/Storages/MemoryStorage',
186: 'MethodReflection' => '/Reflection/Method',
187: 'MicroPresenter' => '/Application/MicroPresenter',
188: 'MimeTypeDetector' => '/Utils/MimeTypeDetector',
189: 'MissingServiceException' => '/DI/exceptions',
190: 'MsSqlDriver' => '/Database/Drivers/MsSqlDriver',
191: 'MultiSelectBox' => '/Forms/Controls/MultiSelectBox',
192: 'Multiplier' => '/Application/UI/Multiplier',
193: 'MySqlDriver' => '/Database/Drivers/MySqlDriver',
194: 'NCFix' => '/loader',
195: 'NCallbackFilterIterator' => '/Iterators/Filter',
196: 'NRecursiveCallbackFilterIterator' => '/Iterators/RecursiveFilter',
197: 'Neon' => '/Utils/Neon',
198: 'NeonEntity' => '/Utils/Neon',
199: 'NeonException' => '/Utils/Neon',
200: 'NetteExtension' => '/Config/Extensions/NetteExtension',
201: 'NetteLoader' => '/Loaders/NetteLoader',
202: 'NotImplementedException' => '/common/exceptions',
203: 'NotSupportedException' => '/common/exceptions',
204: 'Object' => '/common/Object',
205: 'ObjectMixin' => '/common/ObjectMixin',
206: 'OciDriver' => '/Database/Drivers/OciDriver',
207: 'OdbcDriver' => '/Database/Drivers/OdbcDriver',
208: 'Paginator' => '/Utils/Paginator',
209: 'ParameterReflection' => '/Reflection/Parameter',
210: 'Parser' => '/Latte/Parser',
211: 'Permission' => '/Security/Permission',
212: 'PgSqlDriver' => '/Database/Drivers/PgSqlDriver',
213: 'PhpClassType' => '/Utils/PhpGenerator/ClassType',
214: 'PhpExtension' => '/Config/Extensions/PhpExtension',
215: 'PhpFileStorage' => '/Caching/Storages/PhpFileStorage',
216: 'PhpHelpers' => '/Utils/PhpGenerator/Helpers',
217: 'PhpLiteral' => '/Utils/PhpGenerator/PhpLiteral',
218: 'PhpMethod' => '/Utils/PhpGenerator/Method',
219: 'PhpParameter' => '/Utils/PhpGenerator/Parameter',
220: 'PhpProperty' => '/Utils/PhpGenerator/Property',
221: 'PhpWriter' => '/Latte/PhpWriter',
222: 'Presenter' => '/Application/UI/Presenter',
223: 'PresenterComponent' => '/Application/UI/PresenterComponent',
224: 'PresenterComponentReflection' => '/Application/UI/PresenterComponentReflection',
225: 'PresenterFactory' => '/Application/PresenterFactory',
226: 'PresenterRequest' => '/Application/Request',
227: 'PropertyReflection' => '/Reflection/Property',
228: 'RadioList' => '/Forms/Controls/RadioList',
229: 'RecursiveComponentIterator' => '/ComponentModel/RecursiveComponentIterator',
230: 'RedirectResponse' => '/Application/Responses/RedirectResponse',
231: 'RegexpException' => '/Utils/Strings',
232: 'RobotLoader' => '/Loaders/RobotLoader',
233: 'Route' => '/Application/Routers/Route',
234: 'RouteList' => '/Application/Routers/RouteList',
235: 'RoutingDebugger' => '/Application/Diagnostics/RoutingPanel',
236: 'Row' => '/Database/Row',
237: 'Rule' => '/Forms/Rule',
238: 'Rules' => '/Forms/Rules',
239: 'SafeStream' => '/Utils/SafeStream',
240: 'SelectBox' => '/Forms/Controls/SelectBox',
241: 'SendmailMailer' => '/Mail/SendmailMailer',
242: 'ServiceCreationException' => '/DI/exceptions',
243: 'Session' => '/Http/Session',
244: 'SessionSection' => '/Http/SessionSection',
245: 'SimpleAuthenticator' => '/Security/SimpleAuthenticator',
246: 'SimpleRouter' => '/Application/Routers/SimpleRouter',
247: 'SmartCachingIterator' => '/Iterators/CachingIterator',
248: 'SmtpException' => '/Mail/SmtpMailer',
249: 'SmtpMailer' => '/Mail/SmtpMailer',
250: 'SqlBuilder' => '/Database/Table/SqlBuilder',
251: 'SqlLiteral' => '/Database/SqlLiteral',
252: 'SqlPreprocessor' => '/Database/SqlPreprocessor',
253: 'Sqlite2Driver' => '/Database/Drivers/Sqlite2Driver',
254: 'SqliteDriver' => '/Database/Drivers/SqliteDriver',
255: 'Statement' => '/Database/Statement',
256: 'StaticClassException' => '/common/exceptions',
257: 'Strings' => '/Utils/Strings',
258: 'SubmitButton' => '/Forms/Controls/SubmitButton',
259: 'TableRow' => '/Database/Table/ActiveRow',
260: 'TableSelection' => '/Database/Table/Selection',
261: 'Template' => '/Templating/Template',
262: 'TemplateException' => '/Templating/FilterException',
263: 'TemplateHelpers' => '/Templating/Helpers',
264: 'TextArea' => '/Forms/Controls/TextArea',
265: 'TextBase' => '/Forms/Controls/TextBase',
266: 'TextInput' => '/Forms/Controls/TextInput',
267: 'TextResponse' => '/Application/Responses/TextResponse',
268: 'Tokenizer' => '/Utils/Tokenizer',
269: 'TokenizerException' => '/Utils/Tokenizer',
270: 'UIMacros' => '/Latte/Macros/UIMacros',
271: 'UnknownImageFileException' => '/common/Image',
272: 'UploadControl' => '/Forms/Controls/UploadControl',
273: 'Url' => '/Http/Url',
274: 'UrlScript' => '/Http/UrlScript',
275: 'User' => '/Security/User',
276: 'UserPanel' => '/Security/Diagnostics/UserPanel',
277: 'UserStorage' => '/Http/UserStorage',
278: 'Validators' => '/Utils/Validators',
279: );
280:
281:
282:
283: 284: 285: 286:
287: public static function getInstance()
288: {
289: if (self::$instance === NULL) {
290: self::$instance = new self;
291: }
292: return self::$instance;
293: }
294:
295:
296:
297: 298: 299: 300: 301:
302: public function tryLoad($type)
303: {
304: $type = ltrim($type, '\\');
305: if (isset($this->list[$type])) {
306: LimitedScope::load(NETTE_DIR . $this->list[$type] . '.php', TRUE);
307: self::$count++;
308:
309: }}
310:
311: }
312: