/** * @throws \InvalidArgumentException */ private function validate() { $this->source->validateAsSource(); $this->dest->validateAsDest(); // this is a remote to remote sync and local_tmp isn't set if ($this->source->isRemote() && $this->dest->isRemote() && !isset($this->options['local_tmp'])) { throw new \InvalidArgumentException("You must provide the path to a folder for temporary files on the local machine, to perform remote to remote syncs."); } if (isset($this->options['search_replace']) && !is_array($this->options['search_replace'])) { throw new \InvalidArgumentException("The 'search_replace' param must be an array."); } // srdb must be set on the destination if we are going to do search and replace if (!empty($this->options['search_replace']) && empty($this->dest->getSrdb())) { throw new \InvalidArgumentException("The 'srdb' option must be defined on the destiation if 'search_replace' is provided."); } }
private function buildDbParams() { return ['host' => $this->options->getDbHost(), 'username' => $this->options->getDbUser(), 'password' => $this->options->getDbPass(), 'name' => $this->options->getDbName(), 'port' => $this->options->getDbPort()]; }