Exemple #1
0
 /**
  * GitVersioning constructor.
  *
  * @param string $input
  * @param string $gitDir
  * @param int    $timeout
  */
 public function __construct($input, $gitDir = null, $timeout = 300)
 {
     RequirementsChecker::check('git');
     $this->input = $input;
     $this->gitDir = $gitDir;
     $this->gitWrapper = new GitWrapper();
     $this->gitWrapper->setTimeout($timeout);
 }
Exemple #2
0
 /**
  * MySQLInput constructor.
  *
  * @param $host
  * @param $user
  * @param $password
  * @param $database
  * @param int $port
  * @param $socket
  * @param string $compress
  * @param bool   $noData
  * @param bool   $addDropTable
  * @param bool   $singleTransaction
  * @param bool   $lockTables
  * @param bool   $addLocks
  * @param bool   $extendedInsert
  * @param bool   $disableKeys
  * @param bool   $noCreateInfo
  * @param bool   $skipTriggers
  * @param bool   $addDropTrigger
  * @param bool   $routines
  * @param bool   $hexBlob
  * @param bool   $skipTzUtc
  * @param bool   $noAutocommit
  * @param string $defaultCharacterSet
  * @param bool   $skipComments
  * @param bool   $skipDumpDate
  */
 public function __construct($host = null, $user, $password, $database = null, $port = 3306, $socket = null, $compress = 'None', $noData = false, $addDropTable = false, $singleTransaction = true, $lockTables = false, $addLocks = true, $extendedInsert = true, $disableKeys = true, $noCreateInfo = false, $skipTriggers = false, $addDropTrigger = true, $routines = false, $hexBlob = true, $skipTzUtc = false, $noAutocommit = true, $defaultCharacterSet = 'utf8', $skipComments = false, $skipDumpDate = false)
 {
     RequirementsChecker::check('PDO');
     $this->host = $host;
     $this->user = $user;
     $this->password = $password;
     $this->port = $port;
     $this->socket = $socket;
     if (stristr($compress, 'gzip')) {
         $this->extension = '.gz';
     } elseif (stristr($compress, 'bzip')) {
         $this->extension = '.bzip';
     }
     $this->dumperData = ['compress' => $compress, 'no-data' => $noData, 'add-drop-table' => $addDropTable, 'single-transaction' => $singleTransaction, 'lock-tables' => $lockTables, 'add-locks' => $addLocks, 'extended-insert' => $extendedInsert, 'disable-keys' => $disableKeys, 'no-create-info' => $noCreateInfo, 'skip-triggers' => $skipTriggers, 'add-drop-trigger' => $addDropTrigger, 'routines' => $routines, 'hex-blob' => $hexBlob, 'skip-tz-utc' => $skipTzUtc, 'no-autocommit' => $noAutocommit, 'default-character-set' => $defaultCharacterSet, 'skip-comments' => $skipComments, 'skip-dump-date' => $skipDumpDate];
     $this->database = $this->getDatabase($database);
     $this->setFileTable();
 }
Exemple #3
0
    $GLOBALS['autoloadPath'] = $autoloadGlobal;
} elseif (file_exists($autoloadLocal)) {
    require $autoloadLocal;
    $GLOBALS['autoloadPath'] = $autoloadLocal;
} else {
    throw new Exception("Can't find composer autoload.php");
}
// Display that beautiful banner
if ($argc == 1) {
    echo "┬ ┬┬ ┬┌┐┌\n";
    echo "│││└┬┘│││\n";
    echo "└┴┘ ┴ ┘└┘\n\n";
}
// Check for requirements
try {
    RequirementsChecker::check();
} catch (RequirementNotFulfilledException $e) {
    echo "Error: " . $e->getMessage() . "\n\n";
    die;
}
// Set version
$GLOBALS['wynVersion'] = file_get_contents(__DIR__ . '/../VERSION');
// Run the command line application
$app = new Application('wyn', $GLOBALS['wynVersion']);
$app->add(new BackupSingleCommand());
$app->add(new BackupAllCommand());
$app->add(new BackupCronCommand());
$app->add(new BackupDaemonCommand());
$app->add(new EditCommand());
$app->add(new DecryptCommand());
$app->add(new RollbackUpdateCommand());