Source for file CreateTablesApplication.php
Documentation is available at CreateTablesApplication.php
* "THE BEER-WARE LICENSE" (Revision 42):
* "Sven Strittmatter" <ausserirdisch@sven-space.de> wrote this file.
* As long as you retain this notice you can do whatever you want with
* this stuff. If we meet some day, and you think this stuff is worth it,
* you can buy me a beer in return.
* @package Console_Application
* @copyright Copyright (c) 2009 Sven Strittmatter
* @see AbstractDbApplication
require_once('AbstractDbApplication.php');
* MediaSearch_ConfigLoader
* @see MediaSearch_ConfigLoader
require_once('MediaSearch/ConfigLoader.php');
* Neequired to react on signals
* @link http://de.php.net/manual/en/function.pcntl-signal.php
* Creates the two neccessary tables FileMeta and KeyWord.
* Beware: Existing tables will be dropped.
* @see AbstractDbApplication
* @package Console_Application
* @uses MediaSearch_ConfigLoader
* @uses Console_Exception
* @copyright Copyright (c) 2009 Sven Strittmatter
* Loads the configs for FileMeta and KeyWord and executes them.
* The configs are located from application/configs/sql/table.
protected function run() {
$this->echoMsg('Initialize database connection...');
$this->echoMsg('Get config for table: FileMeta');
$sqlConfig->setPdo($dbAdapter->getConnection(), $this->dbName);
$this->echoMsg('Execute sql config');
$this->echoMsg('Get config for table: KeyWord');
$sqlConfig->setPdo($dbAdapter->getConnection(), $this->dbName);
$this->echoMsg('Execute sql config');
* @see AbstractDbApplication::getHelpMessage
public function getHelpMessage($author = 'Sven Strittmatter', $email = 'ich@weltraumschaf.de') {
$message = 'This script creates all neccessay database tables.' . PHP_EOL;
$message .= 'All configs from application/configs/sql/tables/ will be loaded ';
$message .= 'and executed in the database specified in application/configs/datapase.php' . PHP_EOL;
$message .= $this->getUsage() . PHP_EOL;
$message .= parent::getHelpMessage($author, $email);
throw new Console_Exception($message);
|