Permalink
Browse files

* Initial commit.

git-svn-id: http://svn.php.net/repository/pear/packages/Net_FTP2/trunk@176892 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent c1c852f commit 4d798f556f4d02c1244f289cf35bfcbaf1e86a3c @tobyS tobyS committed Jan 10, 2005
View
@@ -0,0 +1,55 @@
+<?php
+// +----------------------------------------------------------------------+
+// | Net_FTP2 Version 1.0 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 2001-2005 Tobias Schlitt |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 3.0 of the PHP license, |
+// | that is available at through the world-wide-web at |
+// | http://www.php.net/license/3_0.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Tobias Schlitt <toby@php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id$
+
+require_once 'PEAR.php';
+
+/**
+ * Net_FTP2 base class.
+ * This class may not be instanciated directly. Use the factory method
+ * Net_FTP2::connect() instead.
+ *
+ * @since 0.1
+ * @package Net_FTP2
+ * @author Tobias Schlitt <toby@php.net>
+ * @see http://www.schlitt.info
+ * @license http://www.php.net/license/3_0.txt PHP License 3.0
+ */
+class Net_FTP2 {
+
+ /**
+ * Factory method to create a new Net_FTP2 connection.
+ * This factory method returns a Net_FTP2 driver which will be
+ * used for all further actions.
+ *
+ * @since 0.1
+ * @access public
+ * @param string $driver Name of the driver to use for connection.
+ * @param string $uri A URI to describe the the FTP connection in the format
+ * <protocol>://[<username>][:<password>][@]<host>[:<port>][/<directory]
+ * @param array $options An array of further options for the FTP connection.
+ * @static
+ * @return object(Net_FTP_Driver_*) The Net_FTP2 driver.
+ */
+ function connect($driver, $uri, $options = array())
+ {
+
+
+ }
+}
+
+?>
View
@@ -0,0 +1,114 @@
+<?php
+// +----------------------------------------------------------------------+
+// | Net_FTP2 Version 1.0 |
+// +----------------------------------------------------------------------+
+// | Copyright (c) 2001-2005 Tobias Schlitt |
+// +----------------------------------------------------------------------+
+// | This source file is subject to version 3.0 of the PHP license, |
+// | that is available at through the world-wide-web at |
+// | http://www.php.net/license/3_0.txt. |
+// | If you did not receive a copy of the PHP license and are unable to |
+// | obtain it through the world-wide-web, please send a note to |
+// | license@php.net so we can mail you a copy immediately. |
+// +----------------------------------------------------------------------+
+// | Authors: Tobias Schlitt <toby@php.net> |
+// +----------------------------------------------------------------------+
+//
+// $Id$
+
+/**
+ * Base class for Net_FTP2_Driver_* classes.
+ * This class implements common features for Net_FTP2_Driver_* classes,
+ * as well as abstract methods, which have to be implemented by the
+ * specific driver.
+ *
+ * @since 0.1
+ * @package Net_FTP2
+ * @author Tobias Schlitt <toby@php.net>
+ * @see http://www.schlitt.info
+ * @license http://www.php.net/license/3_0.txt PHP License 3.0
+ */
+class Net_FTP2_Driver {
+
+ /**
+ * Connection settings
+ * This settings are determined through the URI delivered to
+ * the constructor.
+ *
+ * @var array
+ * @since 0.1
+ */
+ var $_connectionSettings = array(
+ 'protocol' => 'ftp',
+ 'username' => '',
+ 'password' => '',
+ 'host' => '',
+ 'port' => 21,
+ 'dir' => '/',
+ );
+
+ /**
+ * Options
+ * An array of options for the FTP connection.
+ *
+ * @var array
+ * @since 0.1
+ */
+ var $_options = array(
+ 'timeout' => 30,
+ 'mode' => 'active',
+ );
+
+ /**
+ * Constructor
+ * This is the base constructor for Net_FTP2_Driver_* classes.
+ * It provides base functionalities for creating a new driver
+ * object, like parsing the URI. Forethat, this constructor
+ * should be called even if overwritten.
+ *
+ * @since 0.1
+ * @access public
+ * @param string $uri A URI to describe the the FTP connection in the format
+ * <protocol>://[<username>][:<password>][@]<host>[:<port>][/<directory]
+ * @param array $options An array of further options for the FTP connection.
+ * @return void
+ */
+ function Net_FTP2_Driver($uri, $options)
+ {
+
+
+ }
+
+ /**
+ * Parse an FTP URI into it's parts'
+ *
+ * @since
+ * @access priotected
+ * @param string $uri The URI to parse
+ * @return array The parsed URI
+ */
+ private function _parseURI($uri)
+ {
+
+
+ }
+
+ /**
+ *
+ *
+ *
+ * @since
+ * @access private
+ * @param
+ * @return void
+ */
+ private function _ ()
+ {
+
+
+ }
+}
+
+
+
+?>
View
No changes.
No changes.
No changes.
View
@@ -0,0 +1,101 @@
+<?php
+
+ $debug = false;
+
+ if (isset($argv[1])) {
+ $debug = true;
+ }
+
+ require_once('PEAR/PackageFileManager.php');
+
+ $pkg = new PEAR_PackageFileManager;
+
+ // directory that PEAR CVS is located in
+ $cvsdir = '/cvs/pear/';
+ $packagedir = $cvsdir . 'Net_FTP2/';
+ $category = 'Networking';
+
+ $version = '0.1';
+
+ $summary = 'Net_FTP2 provides multiple backends and advanced features for communication with FTP servers.';
+
+ $description = <<<EOT
+[[[DESCRIBTION TO BE ADDED HERE]]]
+EOT;
+
+ $notes = <<<EOT
+EOT;
+
+ $e = $pkg->setOptions(
+ array('baseinstalldir' => '',
+ 'summary' => $summary,
+ 'description' => $description,
+ 'version' => $version,
+ 'packagedirectory' => $packagedir,
+ 'pathtopackagefile' => $packagedir,
+ 'state' => 'devel',
+// 'filelistgenerator' => 'cvs',
+ 'filelistgenerator' => 'file',
+ 'notes' => $notes,
+ 'package' => 'Net_FTP2',
+ 'dir_roles' => array(
+ 'example' => 'doc',
+ 'test' => 'test'
+ ),
+ 'ignore' => array(
+ 'package.xml',
+ 'doc*',
+ 'test*',
+ 'generate_package_xml.php',
+ '*.tgz',
+ 'FTP_PHP5.php',
+ ),
+ )
+ );
+
+ if (PEAR::isError($e)) {
+ echo $e->getMessage();
+ exit;
+ }
+
+ $e = $pkg->addMaintainer('toby', 'lead', 'Tobias Schlitt', 'toby@php.net');
+
+
+ if (PEAR::isError($e)) {
+ echo $e->getMessage();
+ exit;
+ }
+
+ // Orphaned with socket backend
+ // $e = $pkg->addDependency('ftp', null, 'has', 'ext');
+
+ if (PEAR::isError($e)) {
+ echo $e->getMessage();
+ exit;
+ }
+
+ // hack until they get their shit in line with docroot role
+ $pkg->addRole('tpl', 'php');
+ $pkg->addRole('png', 'php');
+ $pkg->addRole('gif', 'php');
+ $pkg->addRole('jpg', 'php');
+ $pkg->addRole('css', 'php');
+ $pkg->addRole('js', 'php');
+ $pkg->addRole('ini', 'php');
+ $pkg->addRole('inc', 'php');
+ $pkg->addRole('afm', 'php');
+ $pkg->addRole('pkg', 'doc');
+ $pkg->addRole('cls', 'doc');
+ $pkg->addRole('proc', 'doc');
+ $pkg->addRole('sh', 'script');
+
+ if ($debug) {
+ $e = $pkg->debugPackageFile();
+ } else {
+ $e = $pkg->writePackageFile();
+ }
+
+ if (PEAR::isError($e)) {
+ echo $e->getMessage();
+ }
+?>
View
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
+<package version="1.0">
+ <name>Net_FTP2</name>
+ <summary>Net_FTP2 provides multiple backends and advanced features for communication with FTP servers.</summary>
+ <description>[[[DESCRIBTION TO BE ADDED HERE]]]</description>
+ <maintainers>
+ <maintainer>
+ <user>toby</user>
+ <name>Tobias Schlitt</name>
+ <email>toby@php.net</email>
+ <role>lead</role>
+ </maintainer>
+ </maintainers>
+ <release>
+ <version>0.1</version>
+ <date>2005-01-07</date>
+ <license>PHP License</license>
+ <state>devel</state>
+ <deps>
+ <dep type="ext" rel="has" optional="no">ftp</dep>
+ </deps>
+ <provides type="class" name="Net_FTP2" />
+ <provides type="function" name="Net_FTP2::connect" />
+ <filelist>
+ <file role="data" baseinstalldir="" md5sum="57b8d745384127342f95660d97e1c9c2" name="CVS/Entries"/>
+ <file role="data" baseinstalldir="" md5sum="248dbd3f0deadc5615c73a6ee41bc440" name="CVS/Repository"/>
+ <file role="data" baseinstalldir="" md5sum="3d8ca296ef80be6b9e35696d9b58a679" name="CVS/Root"/>
+ <file role="php" baseinstalldir="" md5sum="d2e2714598ac4b71c9dcc7ea5ce34e3c" name="Net/Net_FTP2.php"/>
+ </filelist>
+ </release>
+ <changelog>
+ <release>
+ <version>0.1</version>
+ <date>2005-01-07</date>
+ <license>PHP License</license>
+ <state>devel</state>
+ </release>
+ </changelog>
+</package>

0 comments on commit 4d798f5

Please sign in to comment.