Skip to content

Commit

Permalink
Dev: Remove unused method _executeSQLFile
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Nov 7, 2017
1 parent f2ea08e commit f297269
Showing 1 changed file with 0 additions and 41 deletions.
41 changes: 0 additions & 41 deletions application/commands/InstallCommand.php
Expand Up @@ -90,47 +90,6 @@ public function run($sArgument)
}
}

/**
* @param string $sFileName
* @return array|boolean
*/
public function _executeSQLFile($sFileName)
{
echo $sFileName;
$aMessages = array();
$sCommand = '';

if (!is_readable($sFileName)) {
return false;
} else {
$aLines = file($sFileName);
}
foreach ($aLines as $sLine) {
$sLine = rtrim($sLine);
$iLineLength = strlen($sLine);

if ($iLineLength && $sLine[0] != '#' && substr($sLine, 0, 2) != '--') {
if (substr($sLine, $iLineLength-1, 1) == ';') {
$sCommand .= $sLine;
$sCommand = str_replace('prefix_', $this->connection->tablePrefix, $sCommand); // Table prefixes

try {
$this->connection->createCommand($sCommand)->execute();
} catch (Exception $e) {
$aMessages[] = "Executing: ".$sCommand." failed! Reason: ".$e;
}

$sCommand = '';
} else {
$sCommand .= $sLine;
}
}
}
return $aMessages;


}

/**
* @param string $sProperty
* @param string $connectionString
Expand Down

0 comments on commit f297269

Please sign in to comment.