Skip to content

Commit

Permalink
fixed tabs, spaces and indentations
Browse files Browse the repository at this point in the history
  • Loading branch information
ifsnop committed Jun 2, 2013
1 parent f6a1901 commit 6c1092c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ Or without the `'auto' => true` to load it on demand:
<?php

$dumpSettings = array(
'include-tables' => array('table1', 'table2'),
'exclude-tables' => array('table3', 'table4),
'compress' => true,
'add-drop-table' => true,
'no-data' => true);
'include-tables' => array('table1', 'table2'),
'exclude-tables' => array('table3', 'table4'),
'compress' => true,
'add-drop-table' => true,
'no-data' => true);

$dump = new MySQLDump('forum','forum_user','forum_pass','localhost', $dumpSettings);
$dump->start('forum_dump.sql.gz');

## Advanced usage

<?php
Expand All @@ -63,7 +63,7 @@ Or without the `'auto' => true` to load it on demand:
return "Backup complete.";
}
}


## Credits

Expand Down
29 changes: 15 additions & 14 deletions mysqldump.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ class MySQLDump
private $views = array();
private $db_handler;
private $file_handler;
private $defaultSettings = array('no-data' => false,
'add-drop-table' => false,
'include-tables' => array(),
'exclude-tables' => array(),
'compress' => false);
private $defaultSettings = array(
'no-data' => false,
'add-drop-table' => false,
'include-tables' => array(),
'exclude-tables' => array(),
'compress' => false);

/**
* Constructor of MySQLDump
Expand All @@ -48,24 +49,24 @@ public function __construct($db = '', $user = '', $pass = '', $host = 'localhost
$this->host = $host;
$this->settings = $this->extend($this->defaultSettings, $settings);
}

/**
* jquery style extend, merges arrays (without errors if the passed values are not arrays)
* extend($defaults, $options);
*
* @return array $extended
*/
public function extend() {
$args = func_get_args();
$args = func_get_args();
$extended = array();
if( is_array($args) && count($args)>0 ) {
foreach($args as $array) {
if(is_array($array)) {
$extended = array_merge($extended, $array);
}
}
}
return $extended;
foreach($args as $array) {
if(is_array($array)) {
$extended = array_merge($extended, $array);
}
}
}
return $extended;
}

/**
Expand Down

0 comments on commit 6c1092c

Please sign in to comment.