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