Added base version of the Ajatus PHP -library.
[ajatus.git] / plugins / ajatus / couchdb / replicator.php
blob4da7a164db5a6418489f8544732ec503b8dfba9a
1 <?php
2 /**
3 *
4 * Copyright (c) 2007 Jerry Jalava <jerry.jalava@gmail.com>
5 * Licensed under the GPLv3 license
6 * http://www.gnu.org/licenses/gpl.html
7 *
8 */
10 interface couchdb_replicator_interface
12 function replicate();
14 function check_config();
17 class couchdb_replicator
19 public $local_configuration;
20 public $configuration;
22 public function __construct($local_configuration, $configuration=array())
24 $this->local_configuration = $local_configuration;
26 if (empty($configuration))
28 throw new couchdb_replicator_exception('No configuration given!');
31 if (! isset($configuration['source']))
33 throw new couchdb_replicator_exception('No source found in configuration!');
36 if (! isset($configuration['target']))
38 throw new couchdb_replicator_exception('No target found in configuration!');
41 $this->configuration = $configuration;
43 $this->check_config();
46 public function check_config()
48 return true;