Example #1
0
 /**
  * UPI2DB
  */
 function upi2db()
 {
     global $config;
     $this->data['upi2db_access'] = false;
     if (!$config['board_disable'] && $this->data['session_logged_in'] && $config['upi2db_on']) {
         $this->data['upi2db_access'] = check_upi2db_on($this->data);
         if ($this->data['upi2db_access'] != false) {
             $this->data['always_read'] = select_always_read($this->data);
             $this->data['auth_forum_id'] = auth_forum_read($this->data);
             sync_database($this->data);
         }
     }
 }
Example #2
0
|                       ! ERROR !                           |
| Ensure you have all the following commands installed in   |
| your machine: rsync, ssh, sshpass, mysqldump, gzip and    |
| scp.                                                      |
+-----------------------------------------------------------+

MESSAGE;
    exit();
}

/**
 * Continue with normal process
 */
sync_files($config, $direction);
if ($sync_database) {
    sync_database($config, $direction);
}
echo "---> Synchronization finished.\n";


/**
 * Synchronization functions
 */

function sync_files($config, $direction = ' up')
{
    $remote = $config['remote']['server'];
    $local = $config['local']['server'];
    $password = $remote['password'];
    $ssh_port = (int) $remote['ssh_port'];
    $from = trim($local['path'], '/').'/';