1 | <?php |
||
15 | final class WordPoints_Importers { |
||
16 | |||
17 | // |
||
18 | // Private Vars. |
||
19 | // |
||
20 | |||
21 | /** |
||
22 | * The registered importers. |
||
23 | * |
||
24 | * @since 1.0.0 |
||
25 | * |
||
26 | * @type array $importers |
||
27 | */ |
||
28 | private static $importers = array(); |
||
29 | |||
30 | /** |
||
31 | * Whether the class has been initialized yet. |
||
32 | * |
||
33 | * @since 1.0.0 |
||
34 | * |
||
35 | * @type bool $initialized |
||
36 | */ |
||
37 | private static $initialized = false; |
||
38 | |||
39 | // |
||
40 | // Private Functions. |
||
41 | // |
||
42 | |||
43 | /** |
||
44 | * Initialize the class. |
||
45 | * |
||
46 | * @since 1.0.0 |
||
47 | */ |
||
48 | private static function init() { |
||
61 | |||
62 | // |
||
63 | // Public Functions. |
||
64 | // |
||
65 | |||
66 | /** |
||
67 | * Get all of the registered importers. |
||
68 | * |
||
69 | * @since 1.0.0 |
||
70 | * |
||
71 | * @return array All of the registered importers. |
||
72 | */ |
||
73 | public static function get() { |
||
81 | |||
82 | /** |
||
83 | * Register an importer. |
||
84 | * |
||
85 | * If the importer is already registered, it will be overwritten. |
||
86 | * |
||
87 | * @since 1.0.0 |
||
88 | * |
||
89 | * @param string $slug The unique identifier for this importer. |
||
90 | * @param array $args { |
||
91 | * Other importer arguments. |
||
92 | * |
||
93 | * @type string $class The Importer class. |
||
94 | * @type string $name The name of this importer. |
||
95 | * } |
||
96 | */ |
||
97 | public static function register( $slug, array $args ) { |
||
100 | |||
101 | /** |
||
102 | * Deregister an importer. |
||
103 | * |
||
104 | * @since 1.0.0 |
||
105 | * |
||
106 | * @param string $slug The slug of the importer to deregister. |
||
107 | */ |
||
108 | public static function deregister( $slug ) { |
||
111 | |||
112 | /** |
||
113 | * Check if an importer is registered. |
||
114 | * |
||
115 | * @since 1.0.0 |
||
116 | * |
||
117 | * @param string $slug The slug of the importer. |
||
118 | * |
||
119 | * @return bool True if the importer is registered, otherwise false. |
||
120 | */ |
||
121 | public static function is_registered( $slug ) { |
||
129 | |||
130 | /** |
||
131 | * Get an instance of an importer. |
||
132 | * |
||
133 | * @since 1.0.0 |
||
134 | * |
||
135 | * @param string $slug The slug of the importer to get an instance of. |
||
136 | * |
||
137 | * @return WordPoints_Importer|false The importer, or false if it isn't registered. |
||
138 | */ |
||
139 | public static function get_importer( $slug ) { |
||
149 | } |
||
150 | |||
152 |