You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IServerContainer.php 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  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. * @since 6.0.0
  55. */
  56. interface IServerContainer extends ContainerInterface, IContainer {
  57. /**
  58. * The calendar manager will act as a broker between consumers for calendar information and
  59. * providers which actual deliver the calendar information.
  60. *
  61. * @return \OCP\Calendar\IManager
  62. * @since 13.0.0
  63. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  64. */
  65. public function getCalendarManager();
  66. /**
  67. * The calendar resource backend manager will act as a broker between consumers
  68. * for calendar resource information an providers which actual deliver the room information.
  69. *
  70. * @return \OCP\Calendar\Resource\IBackend
  71. * @since 14.0.0
  72. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  73. */
  74. public function getCalendarResourceBackendManager();
  75. /**
  76. * The calendar room backend manager will act as a broker between consumers
  77. * for calendar room information an providers which actual deliver the room information.
  78. *
  79. * @return \OCP\Calendar\Room\IBackend
  80. * @since 14.0.0
  81. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  82. */
  83. public function getCalendarRoomBackendManager();
  84. /**
  85. * The contacts manager will act as a broker between consumers for contacts information and
  86. * providers which actual deliver the contact information.
  87. *
  88. * @return \OCP\Contacts\IManager
  89. * @since 6.0.0
  90. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  91. */
  92. public function getContactsManager();
  93. /**
  94. * The current request object holding all information about the request currently being processed
  95. * is returned from this method.
  96. * In case the current execution was not initiated by a web request null is returned
  97. *
  98. * @return \OCP\IRequest
  99. * @since 6.0.0
  100. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  101. */
  102. public function getRequest();
  103. /**
  104. * Returns the preview manager which can create preview images for a given file
  105. *
  106. * @return \OCP\IPreview
  107. * @since 6.0.0
  108. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  109. */
  110. public function getPreviewManager();
  111. /**
  112. * Returns the tag manager which can get and set tags for different object types
  113. *
  114. * @see \OCP\ITagManager::load()
  115. * @return \OCP\ITagManager
  116. * @since 6.0.0
  117. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  118. */
  119. public function getTagManager();
  120. /**
  121. * Returns the root folder of ownCloud's data directory
  122. *
  123. * @return \OCP\Files\IRootFolder
  124. * @since 6.0.0 - between 6.0.0 and 8.0.0 this returned \OCP\Files\Folder
  125. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  126. */
  127. public function getRootFolder();
  128. /**
  129. * Returns a view to ownCloud's files folder
  130. *
  131. * @param string $userId user ID
  132. * @return \OCP\Files\Folder
  133. * @since 6.0.0 - parameter $userId was added in 8.0.0
  134. * @see getUserFolder in \OCP\Files\IRootFolder
  135. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  136. */
  137. public function getUserFolder($userId = null);
  138. /**
  139. * Returns a user manager
  140. *
  141. * @return \OCP\IUserManager
  142. * @since 8.0.0
  143. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  144. */
  145. public function getUserManager();
  146. /**
  147. * Returns a group manager
  148. *
  149. * @return \OCP\IGroupManager
  150. * @since 8.0.0
  151. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  152. */
  153. public function getGroupManager();
  154. /**
  155. * Returns the user session
  156. *
  157. * @return \OCP\IUserSession
  158. * @since 6.0.0
  159. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  160. */
  161. public function getUserSession();
  162. /**
  163. * Returns the navigation manager
  164. *
  165. * @return \OCP\INavigationManager
  166. * @since 6.0.0
  167. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  168. */
  169. public function getNavigationManager();
  170. /**
  171. * Returns the config manager
  172. *
  173. * @return \OCP\IConfig
  174. * @since 6.0.0
  175. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  176. */
  177. public function getConfig();
  178. /**
  179. * Returns a Crypto instance
  180. *
  181. * @return \OCP\Security\ICrypto
  182. * @since 8.0.0
  183. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  184. */
  185. public function getCrypto();
  186. /**
  187. * Returns a Hasher instance
  188. *
  189. * @return \OCP\Security\IHasher
  190. * @since 8.0.0
  191. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  192. */
  193. public function getHasher();
  194. /**
  195. * Returns a SecureRandom instance
  196. *
  197. * @return \OCP\Security\ISecureRandom
  198. * @since 8.1.0
  199. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  200. */
  201. public function getSecureRandom();
  202. /**
  203. * Returns a CredentialsManager instance
  204. *
  205. * @return \OCP\Security\ICredentialsManager
  206. * @since 9.0.0
  207. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  208. */
  209. public function getCredentialsManager();
  210. /**
  211. * Returns the app config manager
  212. *
  213. * @return \OCP\IAppConfig
  214. * @since 7.0.0
  215. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  216. */
  217. public function getAppConfig();
  218. /**
  219. * @return \OCP\L10N\IFactory
  220. * @since 8.2.0
  221. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  222. */
  223. public function getL10NFactory();
  224. /**
  225. * get an L10N instance
  226. * @param string $app appid
  227. * @param string $lang
  228. * @return \OCP\IL10N
  229. * @since 6.0.0 - parameter $lang was added in 8.0.0
  230. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  231. */
  232. public function getL10N($app, $lang = null);
  233. /**
  234. * @return \OC\Encryption\Manager
  235. * @since 8.1.0
  236. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  237. */
  238. public function getEncryptionManager();
  239. /**
  240. * @return \OC\Encryption\File
  241. * @since 8.1.0
  242. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  243. */
  244. public function getEncryptionFilesHelper();
  245. /**
  246. * @return \OCP\Encryption\Keys\IStorage
  247. * @since 8.1.0
  248. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  249. */
  250. public function getEncryptionKeyStorage();
  251. /**
  252. * Returns the URL generator
  253. *
  254. * @return \OCP\IURLGenerator
  255. * @since 6.0.0
  256. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  257. */
  258. public function getURLGenerator();
  259. /**
  260. * Returns an ICache instance
  261. *
  262. * @return \OCP\ICache
  263. * @since 6.0.0
  264. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  265. */
  266. public function getCache();
  267. /**
  268. * Returns an \OCP\CacheFactory instance
  269. *
  270. * @return \OCP\ICacheFactory
  271. * @since 7.0.0
  272. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  273. */
  274. public function getMemCacheFactory();
  275. /**
  276. * Returns the current session
  277. *
  278. * @return \OCP\ISession
  279. * @since 6.0.0
  280. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  281. */
  282. public function getSession();
  283. /**
  284. * Returns the activity manager
  285. *
  286. * @return \OCP\Activity\IManager
  287. * @since 6.0.0
  288. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  289. */
  290. public function getActivityManager();
  291. /**
  292. * Returns the current session
  293. *
  294. * @return \OCP\IDBConnection
  295. * @since 6.0.0
  296. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  297. */
  298. public function getDatabaseConnection();
  299. /**
  300. * Returns an avatar manager, used for avatar functionality
  301. *
  302. * @return \OCP\IAvatarManager
  303. * @since 6.0.0
  304. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  305. */
  306. public function getAvatarManager();
  307. /**
  308. * Returns an job list for controlling background jobs
  309. *
  310. * @return \OCP\BackgroundJob\IJobList
  311. * @since 7.0.0
  312. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  313. */
  314. public function getJobList();
  315. /**
  316. * Returns a logger instance
  317. *
  318. * @return \OCP\ILogger
  319. * @since 8.0.0
  320. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  321. */
  322. public function getLogger();
  323. /**
  324. * returns a log factory instance
  325. *
  326. * @return ILogFactory
  327. * @since 14.0.0
  328. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  329. */
  330. public function getLogFactory();
  331. /**
  332. * Returns a router for generating and matching urls
  333. *
  334. * @return \OCP\Route\IRouter
  335. * @since 7.0.0
  336. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  337. */
  338. public function getRouter();
  339. /**
  340. * Returns a search instance
  341. *
  342. * @return \OCP\ISearch
  343. * @since 7.0.0
  344. * @deprecated 20.0.0
  345. */
  346. public function getSearch();
  347. /**
  348. * Get the certificate manager
  349. *
  350. * @return \OCP\ICertificateManager
  351. * @since 8.0.0
  352. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  353. */
  354. public function getCertificateManager();
  355. /**
  356. * Create a new event source
  357. *
  358. * @return \OCP\IEventSource
  359. * @since 8.0.0
  360. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  361. */
  362. public function createEventSource();
  363. /**
  364. * Returns an instance of the HTTP client service
  365. *
  366. * @return \OCP\Http\Client\IClientService
  367. * @since 8.1.0
  368. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  369. */
  370. public function getHTTPClientService();
  371. /**
  372. * Get the active event logger
  373. *
  374. * @return \OCP\Diagnostics\IEventLogger
  375. * @since 8.0.0
  376. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  377. */
  378. public function getEventLogger();
  379. /**
  380. * Get the active query logger
  381. *
  382. * The returned logger only logs data when debug mode is enabled
  383. *
  384. * @return \OCP\Diagnostics\IQueryLogger
  385. * @since 8.0.0
  386. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  387. */
  388. public function getQueryLogger();
  389. /**
  390. * Get the manager for temporary files and folders
  391. *
  392. * @return \OCP\ITempManager
  393. * @since 8.0.0
  394. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  395. */
  396. public function getTempManager();
  397. /**
  398. * Get the app manager
  399. *
  400. * @return \OCP\App\IAppManager
  401. * @since 8.0.0
  402. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  403. */
  404. public function getAppManager();
  405. /**
  406. * Get the webroot
  407. *
  408. * @return string
  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 getWebRoot();
  413. /**
  414. * @return \OCP\Files\Config\IMountProviderCollection
  415. * @since 8.0.0
  416. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  417. */
  418. public function getMountProviderCollection();
  419. /**
  420. * Get the IniWrapper
  421. *
  422. * @return \bantu\IniGetWrapper\IniGetWrapper
  423. * @since 8.0.0
  424. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  425. */
  426. public function getIniWrapper();
  427. /**
  428. * @return \OCP\Command\IBus
  429. * @since 8.1.0
  430. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  431. */
  432. public function getCommandBus();
  433. /**
  434. * Creates a new mailer
  435. *
  436. * @return \OCP\Mail\IMailer
  437. * @since 8.1.0
  438. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  439. */
  440. public function getMailer();
  441. /**
  442. * Get the locking provider
  443. *
  444. * @return \OCP\Lock\ILockingProvider
  445. * @since 8.1.0
  446. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  447. */
  448. public function getLockingProvider();
  449. /**
  450. * @return \OCP\Files\Mount\IMountManager
  451. * @since 8.2.0
  452. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  453. */
  454. public function getMountManager();
  455. /**
  456. * Get the MimeTypeDetector
  457. *
  458. * @return \OCP\Files\IMimeTypeDetector
  459. * @since 8.2.0
  460. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  461. */
  462. public function getMimeTypeDetector();
  463. /**
  464. * Get the MimeTypeLoader
  465. *
  466. * @return \OCP\Files\IMimeTypeLoader
  467. * @since 8.2.0
  468. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  469. */
  470. public function getMimeTypeLoader();
  471. /**
  472. * Get the EventDispatcher
  473. *
  474. * @return EventDispatcherInterface
  475. * @deprecated 20.0.0 use \OCP\EventDispatcher\IEventDispatcher
  476. * @since 8.2.0
  477. */
  478. public function getEventDispatcher();
  479. /**
  480. * Get the Notification Manager
  481. *
  482. * @return \OCP\Notification\IManager
  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 getNotificationManager();
  487. /**
  488. * @return \OCP\Comments\ICommentsManager
  489. * @since 9.0.0
  490. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  491. */
  492. public function getCommentsManager();
  493. /**
  494. * Returns the system-tag manager
  495. *
  496. * @return \OCP\SystemTag\ISystemTagManager
  497. *
  498. * @since 9.0.0
  499. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  500. */
  501. public function getSystemTagManager();
  502. /**
  503. * Returns the system-tag object mapper
  504. *
  505. * @return \OCP\SystemTag\ISystemTagObjectMapper
  506. *
  507. * @since 9.0.0
  508. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  509. */
  510. public function getSystemTagObjectMapper();
  511. /**
  512. * Returns the share manager
  513. *
  514. * @return \OCP\Share\IManager
  515. * @since 9.0.0
  516. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  517. */
  518. public function getShareManager();
  519. /**
  520. * @return IContentSecurityPolicyManager
  521. * @since 9.0.0
  522. * @deprecated 17.0.0 Use the AddContentSecurityPolicyEvent
  523. */
  524. public function getContentSecurityPolicyManager();
  525. /**
  526. * @return \OCP\IDateTimeZone
  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 getDateTimeZone();
  531. /**
  532. * @return \OCP\IDateTimeFormatter
  533. * @since 8.0.0
  534. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  535. */
  536. public function getDateTimeFormatter();
  537. /**
  538. * @return \OCP\Federation\ICloudIdManager
  539. * @since 12.0.0
  540. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  541. */
  542. public function getCloudIdManager();
  543. /**
  544. * @return \OCP\GlobalScale\IConfig
  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 getGlobalScaleConfig();
  549. /**
  550. * @return ICloudFederationFactory
  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 getCloudFederationFactory();
  555. /**
  556. * @return ICloudFederationProviderManager
  557. * @since 14.0.0
  558. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  559. */
  560. public function getCloudFederationProviderManager();
  561. /**
  562. * @return \OCP\Remote\Api\IApiFactory
  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 getRemoteApiFactory();
  567. /**
  568. * @return \OCP\Remote\IInstanceFactory
  569. * @since 13.0.0
  570. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  571. */
  572. public function getRemoteInstanceFactory();
  573. /**
  574. * @return \OCP\Files\Storage\IStorageFactory
  575. * @since 15.0.0
  576. * @deprecated 20.0.0 have it injected or fetch it through \Psr\Container\ContainerInterface::get
  577. */
  578. public function getStorageFactory();
  579. }