1 | <?php |
||
11 | abstract class AbstractDatabaseCommand extends AbstractMagentoCommand |
||
12 | { |
||
13 | /** |
||
14 | * @var array |
||
15 | */ |
||
16 | protected $dbSettings; |
||
17 | |||
18 | /** |
||
19 | * @var bool |
||
20 | */ |
||
21 | protected $isSocketConnect = false; |
||
22 | |||
23 | |||
24 | /** |
||
25 | * @param \Symfony\Component\Console\Output\OutputInterface $output |
||
26 | */ |
||
27 | protected function detectDbSettings(OutputInterface $output) |
||
28 | { |
||
29 | $database = $this->getDatabaseHelper(); |
||
30 | $database->detectDbSettings($output); |
||
31 | $this->isSocketConnect = $database->getIsSocketConnect(); |
||
32 | $this->dbSettings = $database->getDbSettings(); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @param $name |
||
37 | * |
||
38 | * @return mixed |
||
39 | */ |
||
40 | public function __get($name) |
||
41 | { |
||
42 | if ($name == '_connection') { |
||
43 | return $this->getDatabaseHelper()->getConnection(); |
||
44 | } |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Generate help for compression |
||
49 | * |
||
50 | * @return string |
||
51 | */ |
||
52 | protected function getCompressionHelp() |
||
63 | |||
64 | /** |
||
65 | * @param string $type |
||
66 | * @return AbstractCompressor |
||
67 | * @deprecated Since 1.1.12; use AbstractCompressor::create() instead |
||
68 | */ |
||
69 | protected function getCompressor($type) |
||
73 | |||
74 | /** |
||
75 | * @return string |
||
76 | * |
||
77 | * @deprecated Please use database helper |
||
78 | */ |
||
79 | protected function getMysqlClientToolConnectionString() |
||
83 | |||
84 | /** |
||
85 | * Creates a PDO DSN for the adapter from $this->_config settings. |
||
86 | * |
||
87 | * @see Zend_Db_Adapter_Pdo_Abstract |
||
88 | * @return string |
||
89 | * |
||
90 | * @deprecated Please use database helper |
||
91 | */ |
||
92 | protected function _dsn() |
||
96 | |||
97 | /** |
||
98 | * @param array $excludes |
||
99 | * @param array $definitions |
||
100 | * @param array $resolved Which definitions where already resolved -> prevent endless loops |
||
101 | * |
||
102 | * @return array |
||
103 | * |
||
104 | * @deprecated Please use database helper |
||
105 | * |
||
106 | * @throws \Exception |
||
107 | */ |
||
108 | protected function resolveTables(array $excludes, array $definitions, array $resolved = array()) |
||
112 | |||
113 | /** |
||
114 | * @return DatabaseHelper |
||
115 | */ |
||
116 | protected function getDatabaseHelper() |
||
120 | } |
||
121 |