IServerContainer.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2016, ownCloud, Inc.
  5. *
  6. * @author Arthur Schiwon <blizzz@arthur-schiwon.de>
  7. * @author Bart Visscher <bartv@thisnet.nl>
  8. * @author Bernhard Posselt <dev@bernhard-posselt.com>
  9. * @author Bjoern Schiessle <bjoern@schiessle.org>
  10. * @author Björn Schießle <bjoern@schiessle.org>
  11. * @author Christopher Schäpers <kondou@ts.unde.re>
  12. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  13. * @author Georg Ehrke <oc.list@georgehrke.com>
  14. * @author Joas Schilling <coding@schilljs.com>
  15. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  16. * @author Lukas Reschke <lukas@statuscode.ch>
  17. * @author Morris Jobke <hey@morrisjobke.de>
  18. * @author Robin Appelman <robin@icewind.nl>
  19. * @author Robin McCorkell <robin@mccorkell.me.uk>
  20. * @author Roeland Jago Douma <roeland@famdouma.nl>
  21. * @author Thomas Müller <thomas.mueller@tmit.eu>
  22. * @author Thomas Tanghus <thomas@tanghus.net>
  23. * @author Vincent Petry <vincent@nextcloud.com>
  24. *
  25. * @license AGPL-3.0
  26. *
  27. * This code is free software: you can redistribute it and/or modify
  28. * it under the terms of the GNU Affero General Public License, version 3,
  29. * as published by the Free Software Foundation.
  30. *
  31. * This program is distributed in the hope that it will be useful,
  32. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  33. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  34. * GNU Affero General Public License for more details.
  35. *
  36. * You should have received a copy of the GNU Affero General Public License, version 3,
  37. * along with this program. If not, see <http://www.gnu.org/licenses/>
  38. *
  39. */
  40. namespace OCP;
  41. use OCP\Federation\ICloudFederationFactory;
  42. use OCP\Federation\ICloudFederationProviderManager;
  43. use OCP\Log\ILogFactory;
  44. use OCP\Security\IContentSecurityPolicyManager;
  45. use Psr\Container\ContainerInterface;
  46. use Symfony\Component\EventDispatcher\EventDispatcherInterface;
  47. /**
  48. * This is a tagging interface for the server container
  49. *
  50. * The interface currently extends IContainer, but this interface is deprecated as of Nextcloud 20,
  51. * thus this interface won't extend it anymore once that was removed. So migrate to the ContainerInterface
  52. * only.
  53. *
  54. * @deprecated 20.0.0
  55. *
  56. * @since 6.0.0
  57. */
  58. interface IServerContainer extends ContainerInterface, IContainer {
  59. /**
  60. * The calendar manager will act as a broker between consumers for calendar information and
  61. * providers which actual deliver the calendar information.
  62. *
  63. * @return \OCP\Calendar\IManager
  64. * @since 13.0.0
  65. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  66. */
  67. public function getCalendarManager();
  68. /**
  69. * The calendar resource backend manager will act as a broker between consumers
  70. * for calendar resource information an providers which actual deliver the room information.
  71. *
  72. * @return \OCP\Calendar\Resource\IBackend
  73. * @since 14.0.0
  74. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  75. */
  76. public function getCalendarResourceBackendManager();
  77. /**
  78. * The calendar room backend manager will act as a broker between consumers
  79. * for calendar room information an providers which actual deliver the room information.
  80. *
  81. * @return \OCP\Calendar\Room\IBackend
  82. * @since 14.0.0
  83. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  84. */
  85. public function getCalendarRoomBackendManager();
  86. /**
  87. * The contacts manager will act as a broker between consumers for contacts information and
  88. * providers which actual deliver the contact information.
  89. *
  90. * @return \OCP\Contacts\IManager
  91. * @since 6.0.0
  92. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  93. */
  94. public function getContactsManager();
  95. /**
  96. * The current request object holding all information about the request currently being processed
  97. * is returned from this method.
  98. * In case the current execution was not initiated by a web request null is returned
  99. *
  100. * @return \OCP\IRequest
  101. * @since 6.0.0
  102. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  103. */
  104. public function getRequest();
  105. /**
  106. * Returns the preview manager which can create preview images for a given file
  107. *
  108. * @return \OCP\IPreview
  109. * @since 6.0.0
  110. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  111. */
  112. public function getPreviewManager();
  113. /**
  114. * Returns the tag manager which can get and set tags for different object types
  115. *
  116. * @see \OCP\ITagManager::load()
  117. * @return \OCP\ITagManager
  118. * @since 6.0.0
  119. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  120. */
  121. public function getTagManager();
  122. /**
  123. * Returns the root folder of ownCloud's data directory
  124. *
  125. * @return \OCP\Files\IRootFolder
  126. * @since 6.0.0 - between 6.0.0 and 8.0.0 this returned \OCP\Files\Folder
  127. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  128. */
  129. public function getRootFolder();
  130. /**
  131. * Returns a view to ownCloud's files folder
  132. *
  133. * @param string $userId user ID
  134. * @return \OCP\Files\Folder
  135. * @since 6.0.0 - parameter $userId was added in 8.0.0
  136. * @see getUserFolder in \OCP\Files\IRootFolder
  137. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  138. */
  139. public function getUserFolder($userId = null);
  140. /**
  141. * Returns a user manager
  142. *
  143. * @return \OCP\IUserManager
  144. * @since 8.0.0
  145. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  146. */
  147. public function getUserManager();
  148. /**
  149. * Returns a group manager
  150. *
  151. * @return \OCP\IGroupManager
  152. * @since 8.0.0
  153. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  154. */
  155. public function getGroupManager();
  156. /**
  157. * Returns the user session
  158. *
  159. * @return \OCP\IUserSession
  160. * @since 6.0.0
  161. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  162. */
  163. public function getUserSession();
  164. /**
  165. * Returns the navigation manager
  166. *
  167. * @return \OCP\INavigationManager
  168. * @since 6.0.0
  169. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  170. */
  171. public function getNavigationManager();
  172. /**
  173. * Returns the config manager
  174. *
  175. * @return \OCP\IConfig
  176. * @since 6.0.0
  177. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  178. */
  179. public function getConfig();
  180. /**
  181. * Returns a Crypto instance
  182. *
  183. * @return \OCP\Security\ICrypto
  184. * @since 8.0.0
  185. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  186. */
  187. public function getCrypto();
  188. /**
  189. * Returns a Hasher instance
  190. *
  191. * @return \OCP\Security\IHasher
  192. * @since 8.0.0
  193. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  194. */
  195. public function getHasher();
  196. /**
  197. * Returns a SecureRandom instance
  198. *
  199. * @return \OCP\Security\ISecureRandom
  200. * @since 8.1.0
  201. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  202. */
  203. public function getSecureRandom();
  204. /**
  205. * Returns a CredentialsManager instance
  206. *
  207. * @return \OCP\Security\ICredentialsManager
  208. * @since 9.0.0
  209. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  210. */
  211. public function getCredentialsManager();
  212. /**
  213. * Returns the app config manager
  214. *
  215. * @return \OCP\IAppConfig
  216. * @since 7.0.0
  217. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  218. */
  219. public function getAppConfig();
  220. /**
  221. * @return \OCP\L10N\IFactory
  222. * @since 8.2.0
  223. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  224. */
  225. public function getL10NFactory();
  226. /**
  227. * get an L10N instance
  228. * @param string $app appid
  229. * @param string $lang
  230. * @return \OCP\IL10N
  231. * @since 6.0.0 - parameter $lang was added in 8.0.0
  232. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  233. */
  234. public function getL10N($app, $lang = null);
  235. /**
  236. * @return \OC\Encryption\Manager
  237. * @since 8.1.0
  238. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  239. */
  240. public function getEncryptionManager();
  241. /**
  242. * @return \OC\Encryption\File
  243. * @since 8.1.0
  244. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  245. */
  246. public function getEncryptionFilesHelper();
  247. /**
  248. * @return \OCP\Encryption\Keys\IStorage
  249. * @since 8.1.0
  250. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  251. */
  252. public function getEncryptionKeyStorage();
  253. /**
  254. * Returns the URL generator
  255. *
  256. * @return \OCP\IURLGenerator
  257. * @since 6.0.0
  258. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  259. */
  260. public function getURLGenerator();
  261. /**
  262. * Returns an ICache instance
  263. *
  264. * @return \OCP\ICache
  265. * @since 6.0.0
  266. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  267. */
  268. public function getCache();
  269. /**
  270. * Returns an \OCP\CacheFactory instance
  271. *
  272. * @return \OCP\ICacheFactory
  273. * @since 7.0.0
  274. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  275. */
  276. public function getMemCacheFactory();
  277. /**
  278. * Returns the current session
  279. *
  280. * @return \OCP\ISession
  281. * @since 6.0.0
  282. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  283. */
  284. public function getSession();
  285. /**
  286. * Returns the activity manager
  287. *
  288. * @return \OCP\Activity\IManager
  289. * @since 6.0.0
  290. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  291. */
  292. public function getActivityManager();
  293. /**
  294. * Returns the current session
  295. *
  296. * @return \OCP\IDBConnection
  297. * @since 6.0.0
  298. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  299. */
  300. public function getDatabaseConnection();
  301. /**
  302. * Returns an avatar manager, used for avatar functionality
  303. *
  304. * @return \OCP\IAvatarManager
  305. * @since 6.0.0
  306. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  307. */
  308. public function getAvatarManager();
  309. /**
  310. * Returns an job list for controlling background jobs
  311. *
  312. * @return \OCP\BackgroundJob\IJobList
  313. * @since 7.0.0
  314. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  315. */
  316. public function getJobList();
  317. /**
  318. * Returns a logger instance
  319. *
  320. * @return \OCP\ILogger
  321. * @since 8.0.0
  322. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  323. */
  324. public function getLogger();
  325. /**
  326. * returns a log factory instance
  327. *
  328. * @return ILogFactory
  329. * @since 14.0.0
  330. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  331. */
  332. public function getLogFactory();
  333. /**
  334. * Returns a router for generating and matching urls
  335. *
  336. * @return \OCP\Route\IRouter
  337. * @since 7.0.0
  338. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  339. */
  340. public function getRouter();
  341. /**
  342. * Returns a search instance
  343. *
  344. * @return \OCP\ISearch
  345. * @since 7.0.0
  346. * @deprecated 20.0.0
  347. */
  348. public function getSearch();
  349. /**
  350. * Get the certificate manager
  351. *
  352. * @return \OCP\ICertificateManager
  353. * @since 8.0.0
  354. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  355. */
  356. public function getCertificateManager();
  357. /**
  358. * Returns an instance of the HTTP client service
  359. *
  360. * @return \OCP\Http\Client\IClientService
  361. * @since 8.1.0
  362. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  363. */
  364. public function getHTTPClientService();
  365. /**
  366. * Get the active event logger
  367. *
  368. * @return \OCP\Diagnostics\IEventLogger
  369. * @since 8.0.0
  370. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  371. */
  372. public function getEventLogger();
  373. /**
  374. * Get the active query logger
  375. *
  376. * The returned logger only logs data when debug mode is enabled
  377. *
  378. * @return \OCP\Diagnostics\IQueryLogger
  379. * @since 8.0.0
  380. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  381. */
  382. public function getQueryLogger();
  383. /**
  384. * Get the manager for temporary files and folders
  385. *
  386. * @return \OCP\ITempManager
  387. * @since 8.0.0
  388. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  389. */
  390. public function getTempManager();
  391. /**
  392. * Get the app manager
  393. *
  394. * @return \OCP\App\IAppManager
  395. * @since 8.0.0
  396. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  397. */
  398. public function getAppManager();
  399. /**
  400. * Get the webroot
  401. *
  402. * @return string
  403. * @since 8.0.0
  404. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  405. */
  406. public function getWebRoot();
  407. /**
  408. * @return \OCP\Files\Config\IMountProviderCollection
  409. * @since 8.0.0
  410. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  411. */
  412. public function getMountProviderCollection();
  413. /**
  414. * Get the IniWrapper
  415. *
  416. * @return \bantu\IniGetWrapper\IniGetWrapper
  417. * @since 8.0.0
  418. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  419. */
  420. public function getIniWrapper();
  421. /**
  422. * @return \OCP\Command\IBus
  423. * @since 8.1.0
  424. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  425. */
  426. public function getCommandBus();
  427. /**
  428. * Creates a new mailer
  429. *
  430. * @return \OCP\Mail\IMailer
  431. * @since 8.1.0
  432. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  433. */
  434. public function getMailer();
  435. /**
  436. * Get the locking provider
  437. *
  438. * @return \OCP\Lock\ILockingProvider
  439. * @since 8.1.0
  440. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  441. */
  442. public function getLockingProvider();
  443. /**
  444. * @return \OCP\Files\Mount\IMountManager
  445. * @since 8.2.0
  446. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  447. */
  448. public function getMountManager();
  449. /**
  450. * Get the MimeTypeDetector
  451. *
  452. * @return \OCP\Files\IMimeTypeDetector
  453. * @since 8.2.0
  454. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  455. */
  456. public function getMimeTypeDetector();
  457. /**
  458. * Get the MimeTypeLoader
  459. *
  460. * @return \OCP\Files\IMimeTypeLoader
  461. * @since 8.2.0
  462. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  463. */
  464. public function getMimeTypeLoader();
  465. /**
  466. * Get the EventDispatcher
  467. *
  468. * @return EventDispatcherInterface
  469. * @deprecated 20.0.0 use \OCP\EventDispatcher\IEventDispatcher
  470. * @since 8.2.0
  471. */
  472. public function getEventDispatcher();
  473. /**
  474. * Get the Notification Manager
  475. *
  476. * @return \OCP\Notification\IManager
  477. * @since 9.0.0
  478. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  479. */
  480. public function getNotificationManager();
  481. /**
  482. * @return \OCP\Comments\ICommentsManager
  483. * @since 9.0.0
  484. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  485. */
  486. public function getCommentsManager();
  487. /**
  488. * Returns the system-tag manager
  489. *
  490. * @return \OCP\SystemTag\ISystemTagManager
  491. *
  492. * @since 9.0.0
  493. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  494. */
  495. public function getSystemTagManager();
  496. /**
  497. * Returns the system-tag object mapper
  498. *
  499. * @return \OCP\SystemTag\ISystemTagObjectMapper
  500. *
  501. * @since 9.0.0
  502. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  503. */
  504. public function getSystemTagObjectMapper();
  505. /**
  506. * Returns the share manager
  507. *
  508. * @return \OCP\Share\IManager
  509. * @since 9.0.0
  510. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  511. */
  512. public function getShareManager();
  513. /**
  514. * @return IContentSecurityPolicyManager
  515. * @since 9.0.0
  516. * @deprecated 17.0.0 Use the AddContentSecurityPolicyEvent
  517. */
  518. public function getContentSecurityPolicyManager();
  519. /**
  520. * @return \OCP\IDateTimeZone
  521. * @since 8.0.0
  522. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  523. */
  524. public function getDateTimeZone();
  525. /**
  526. * @return \OCP\IDateTimeFormatter
  527. * @since 8.0.0
  528. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  529. */
  530. public function getDateTimeFormatter();
  531. /**
  532. * @return \OCP\Federation\ICloudIdManager
  533. * @since 12.0.0
  534. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  535. */
  536. public function getCloudIdManager();
  537. /**
  538. * @return \OCP\GlobalScale\IConfig
  539. * @since 14.0.0
  540. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  541. */
  542. public function getGlobalScaleConfig();
  543. /**
  544. * @return ICloudFederationFactory
  545. * @since 14.0.0
  546. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  547. */
  548. public function getCloudFederationFactory();
  549. /**
  550. * @return ICloudFederationProviderManager
  551. * @since 14.0.0
  552. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  553. */
  554. public function getCloudFederationProviderManager();
  555. /**
  556. * @return \OCP\Remote\Api\IApiFactory
  557. * @since 13.0.0
  558. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  559. */
  560. public function getRemoteApiFactory();
  561. /**
  562. * @return \OCP\Remote\IInstanceFactory
  563. * @since 13.0.0
  564. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  565. */
  566. public function getRemoteInstanceFactory();
  567. /**
  568. * @return \OCP\Files\Storage\IStorageFactory
  569. * @since 15.0.0
  570. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  571. */
  572. public function getStorageFactory();
  573. }