예제 #1
0
 public function __construct($driver_config, $table_config)
 {
     foreach ($driver_config['child'] as $child) {
         $this->children[] = manila::get_driver($child, $table_config, array('meta', 'tables', 'tables_serial'));
     }
     $this->table_list = array_keys($table_config);
 }
예제 #2
0
 public function __construct($driver_config, $table_config)
 {
     if (isset($driver_config['strict'])) {
         $this->strict = $driver_config[$strict];
     }
     $this->child = manila::get_driver($driver_config['child'], $table_config);
 }
예제 #3
0
파일: logger.php 프로젝트: prophile/manila
 public function __construct($driver_config, $table_config)
 {
     $child = manila::get_driver($driver_config['child'], $table_config);
     $this->child = $child;
     $msg = sprintf("[LOGGER(%s)] Started\n", get_class($child));
     echo $msg;
 }
예제 #4
0
 public function __construct($driver_config, $table_config)
 {
     $this->child = manila::get_driver($driver_config['child'], $table_config, array('filesystem'));
     $password = $driver_config['password'];
     $this->iv = md5($password, true);
     $this->key = md5($password . 'k1', true) . md5($password . 'k2', true);
     $this->module = mcrypt_module_open(MCRYPT_RIJNDAEL_256, "", MCRYPT_MODE_CBC, "");
 }
예제 #5
0
 public function __construct($driver_config, $table_config)
 {
     $this->child = manila::get_driver($driver_config['child'], $table_config, array('filesystem'));
     $this->gc_count = 200;
     if ($this->child->file_exists("info/gc-count")) {
         $this->gc_count = (int) $this->child->file_read("info/gc-count");
     }
 }
예제 #6
0
파일: cluster.php 프로젝트: prophile/manila
 public function __construct($driver_config, $table_config)
 {
     $this->unique_id = $driver_config['unique_id'];
     $this->localchild = manila::get_driver($driver_config['master'], array(), array('meta'));
     if (isset($driver_config['duplication'])) {
         $this->duplication = $driver_config['duplication'];
     }
     $subnodes = (array) $driver_config['child'];
     foreach ($subnodes as $child) {
         $hash = $this->hash($child);
         $this->children[$child] = manila::get_driver($child, $table_config, array('tables', 'meta'));
         $this->nodes[$hash] = $child;
         $this->node_keys[] = $hash;
     }
     sort($this->node_keys);
 }
예제 #7
0
 public function __construct($driver_config, $table_config)
 {
     unset($driver_config['driver']);
     $tables = array_keys($table_config);
     $patterns = array();
     foreach ($driver_config as $pattern => $target) {
         $patterns[$pattern] = manila::get_driver($target, $table_config);
     }
     $tables[] = '__meta';
     foreach ($tables as $table) {
         $found = false;
         foreach ($patterns as $pattern => &$target) {
             if (fnmatch($pattern, $table)) {
                 $this->targets[$table] =& $target;
                 $found = true;
             }
         }
         if (!$found) {
             die("Splitter driver cannot target table: {$table}\n");
         }
     }
 }
예제 #8
0
파일: manila.php 프로젝트: prophile/manila
 /**
  * Migrate data between two config files
  * @param string $old_config The path to the old config file
  * @param string $new_config The path to the new config file
  */
 public static function migrate($old_config, $new_config)
 {
     $tmpname = tempnam("/tmp", "manila-migrate");
     $old = manila::open($old_config);
     $new = manila::open($new_config);
     $tables = $old->list_tables();
     foreach ($tables as $table) {
         echo "Migrating table: {$table}.";
         $old->table($table)->export($tmpname);
         echo ".";
         $new->table($table)->import($tmpname);
         echo ". done.\n";
     }
     unlink($tmpname);
 }
예제 #9
0
 public function __construct($driver_config, $tablee_config)
 {
     foreach ($driver_config['child'] as $child) {
         $this->children[] = manila::get_driver($child, $table_config, array('meta', 'tables'));
     }
 }
예제 #10
0
파일: cache.php 프로젝트: prophile/manila
 public function __construct($driver_config, $table_config)
 {
     $this->child = manila::get_driver($driver_config['child'], $table_config);
     $this->cache_init($driver_config);
 }
예제 #11
0
파일: iniconf.php 프로젝트: prophile/manila
 public function __construct($driver_config, $table_config)
 {
     $this->child = manila::get_driver($driver_config['child'], array(), array('filesystem'));
 }
예제 #12
0
 public function __construct($driver_config, $table_config)
 {
     $this->child = manila::get_driver($driver_config['child'], $table_config, array('filesystem'));
     $this->level = (int) $driver_config['level'];
     $this->threshold = isset($driver_config['threshold']) ? (int) $driver_config['threshold'] : 1024;
 }