Skip to content

Commit f7af415

Browse files
committed
BackupTrait::getDriverName() has been removed
1 parent 8708e54 commit f7af415

File tree

4 files changed

+3
-29
lines changed

4 files changed

+3
-29
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 2.x branch
22
## 2.7 branch
33
### 2.7.0
4-
* `BackupTrait::getTarget()` has been removed.
4+
* `BackupTrait::getTarget()` and `BackupTrait::getDriverName()` have been removed.
55

66
## 2.6 branch
77
### 2.6.6

src/BackupTrait.php

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,11 @@ public function getConnection($name = null)
9595
* @since 2.0.0
9696
* @throws \InvalidArgumentException
9797
* @uses getConnection()
98-
* @uses getDriverName()
9998
*/
10099
public function getDriver(ConnectionInterface $connection = null)
101100
{
102101
$connection = $connection ?: $this->getConnection();
103-
$className = $this->getDriverName($connection);
102+
$className = get_class_short_name(get_class($connection->getDriver()));
104103
$driver = App::classname(sprintf('%s.%s', 'DatabaseBackup', $className), 'Driver');
105104
is_true_or_fail(
106105
$driver,
@@ -111,20 +110,6 @@ public function getDriver(ConnectionInterface $connection = null)
111110
return new $driver($connection);
112111
}
113112

114-
/**
115-
* Gets the driver name, according to the database engine
116-
* @param \Cake\Datasource\ConnectionInterface|null $connection A connection object
117-
* @return string The driver name
118-
* @since 2.6.2
119-
* @uses getConnection()
120-
*/
121-
public function getDriverName(ConnectionInterface $connection = null)
122-
{
123-
$connection = $connection ?: $this->getConnection();
124-
125-
return get_class_short_name(get_class($connection->getDriver()));
126-
}
127-
128113
/**
129114
* Returns the extension from a filename
130115
* @param string $filename Filename

src/Console/Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function execute(Arguments $args, ConsoleIo $io)
3636
$config = $this->getConnection()->config();
3737

3838
$io->out(__d('database_backup', 'Connection: {0}', $config['name']));
39-
$io->out(__d('database_backup', 'Driver: {0}', $this->getDriverName($this->getConnection())));
39+
$io->out(__d('database_backup', 'Driver: {0}', get_class_short_name(get_class($this->getConnection()->getDriver()))));
4040
$io->hr();
4141

4242
return null;

tests/TestCase/BackupTraitTest.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,6 @@ public function testGetDriver()
131131
$this->getDriver($connection);
132132
}
133133

134-
/**
135-
* Test for `getDriverName()` method
136-
* @test
137-
*/
138-
public function testGetDriverName()
139-
{
140-
foreach ([ConnectionManager::get('test'), null] as $driver) {
141-
$this->assertEquals('Mysql', $this->getDriverName($driver));
142-
}
143-
}
144-
145134
/**
146135
* Test for `getExtension()` method
147136
* @test

0 commit comments

Comments
 (0)