function init_self($path = null) { do { if (!isset($this->prefix) || !$this->prefix || $path != NULL) { if ($path == null) { return null; } $this->prefix = repository_get_scheme($path); } if (!isset($this->status)) { $this->status = 0; $this->tmpn = ''; // reserved file name for local buffering? $this->tmpf = NULL; // tmp file $this->ftpc = NULL; // ftp connection $this->cwls = NULL; // current wd list $this->cwpt = NULL; // current wd pointer $this->rdin = false; // initialized for reading? $this->wrin = false; // initialized for writing? $this->wrdn = false; // upload done? } // $path = $this->parse_url ($path); $this->ftpc = ftp_repository::connect($this->ftpc); if ($this->ftpc != NULL) { break; } $host = $this->get_param('ftp_host'); if (!$host) { break; } // paramname / default value $port = $this->get_param('ftp_port', 21); $user = $this->get_param('ftp_user', 'anonymous'); $pass = $this->get_param('ftp_pass', ''); $fmde = $this->get_param('mode', 'active'); $this->ftpc = new ftp_connection($host, $port); if (!$this->ftpc->connect()) { break; } if (!$this->ftpc->login($user, $pass)) { break; } if ($fmde == 'pasv' || $fmde == 'passive') { $this->ftpc->setPassive(); } ftp_repository::connect($this->ftpc); } while (false); return $this->ftpc; }
function init($path) { if ($this->plugin == NULL) { $scheme = repository_get_scheme($path); $obj =& podcaster_repository::create_repository($scheme); foreach ($obj as $key => $value) { // if (!isset ($this->$key)) { $this->{$key} = $value; // } } } else { } }