1+ <?php
2+ /***************************************************************
3+ * Copyright notice
4+ *
5+ * (c) 2012 Georg Ringer <[email protected] > 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+ * Extension API Command Controller
27+ *
28+ * @package TYPO3
29+ * @subpackage tx_coreapi
30+ */
31+ class Tx_Coreapi_Command_ExtensionApiCommandController extends Tx_Extbase_MVC_Controller_CommandController {
32+
33+ /**
34+ * List all installed extensions
35+ *
36+ * @param string $type Extension type, can either be L for local, S for system or G for global. Leave it empty for all
37+ * @return void
38+ */
39+ public function listInstalledCommand ($ type = '' ) {
40+ $ type = strtoupper ($ type );
41+ if (!empty ($ type ) && $ type !== 'L ' && $ type !== 'G ' && $ type !== 'S ' ) {
42+ $ this ->outputLine ('Only "L", "S" and "G" are supported as type (or nothing) ' );
43+ $ this ->quit ();
44+ }
45+
46+ $ extensions = $ GLOBALS ['TYPO3_LOADED_EXT ' ];
47+
48+ $ list = array ();
49+ foreach ($ extensions as $ key => $ extension ) {
50+ if (!empty ($ type ) && $ type !== $ extension ['type ' ]) {
51+ continue ;
52+ }
53+ $ list [$ key ] = $ extension ['ext_tables.sql ' ];
54+ }
55+
56+ ksort ($ list );
57+
58+ foreach ($ list as $ key => $ description ) {
59+ include_once (t3lib_extMgm::extPath ($ key ) . 'ext_emconf.php ' );
60+ $ title = $ key . ' - ' . $ EM_CONF ['' ]['version ' ] . '/ ' . $ EM_CONF ['' ]['state ' ];
61+ $ description = $ EM_CONF ['' ]['title ' ];
62+ $ description = wordwrap ($ description , self ::MAXIMUM_LINE_LENGTH - 43 , PHP_EOL . str_repeat (' ' , 43 ), TRUE );
63+ $ this ->outputLine ('%-2s%-40s %s ' , array (' ' , $ title , $ description ));
64+ }
65+ }
66+
67+ /**
68+ * Update list
69+ *
70+ * @return void
71+ */
72+ public function updateListCommand () {
73+ }
74+
75+ }
76+
77+ ?>
0 commit comments