[TASK] Clean up phpDoc comments in typo3/sysext/rsaauth
[Packages/TYPO3.CMS.git] / typo3 / sysext / rsaauth / sv1 / storage / class.tx_rsaauth_storagefactory.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 2009-2011 Dmitry Dulepov <dmitry@typo3.org>
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 *
17 * This script is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * This copyright notice MUST APPEAR in all copies of the script!
23 ***************************************************************/
24
25 /**
26 * This class contains a factory for the RSA backends.
27 *
28 * @author Dmitry Dulepov <dmitry@typo3.org>
29 * @package TYPO3
30 * @subpackage tx_rsaauth
31 */
32 class tx_rsaauth_storagefactory {
33
34 /**
35 * A list of all available storages. Currently this list cannot be extended.
36 * This is for security reasons to avoid inserting some dummy storage to
37 * the list.
38 *
39 * @var string
40 */
41 static protected $preferredStorage = 'EXT:rsaauth/sv1/storage/class.tx_rsaauth_split_storage.php:tx_rsaauth_split_storage';
42
43 /**
44 * An instance of the storage. This member is set in the getStorage() function.
45 * It will not be an abstract storage as shown below but a real class, which is
46 * derieved from the tx_rsaauth_abstract_storage.
47 *
48 * <!-- Please, keep the variable type! It helps IDEs to provide autocomple! -->
49 *
50 * @var tx_rsaauth_abstract_storage
51 */
52 static protected $storageInstance = NULL;
53
54 /**
55 * Obtains a storage. This function will return a non-abstract class, which
56 * is derieved from the tx_rsaauth_abstract_storage. Applications should
57 * not use anoy methods that are not declared in the tx_rsaauth_abstract_storage.
58 *
59 * @return tx_rsaauth_abstract_storage A storage
60 */
61 static public function getStorage() {
62 if (is_null(self::$storageInstance)) {
63 self::$storageInstance = t3lib_div::getUserObj(self::$preferredStorage);
64 }
65 return self::$storageInstance;
66 }
67
68 /**
69 * Sets the preffered storage to the factory. This method can be called from
70 * another extension or ext_localconf.php
71 *
72 * @param string $preferredStorage Preffered storage
73 * @return void
74 */
75 static public function setPreferredStorage($preferredStorage) {
76 self::$preferredStorage = $preferredStorage;
77 }
78 }
79 ?>