PEAR_Server channel server is available for install

From: Date: Tue, 03 Aug 2004 17:28:22 +0000
Subject: PEAR_Server channel server is available for install
Groups: php.pear.dev php.pear.core 
Request: Send a blank email to pear-dev+get-32397@lists.php.net to get a copy of this message
Hi, I've been hard at work designing a php5-based channel server, and now have a working server up and running. It requires that you have the latest PEAR CVS installed, which can be easily done via: $ pear upgrade package-PEAR.xml from the pear-core directory. Those who wish to test and then revert can do so simply via $ pear upgrade --force PEAR-1.3.1 after you're done, and the sources will revert to version 1.3.1 To install the PEAR_Server, the steps needed are simply: $ pear channel-add http://pear.chiaraquartet.net/chiarachannel.xml $ pear install chiara::PEAR_Server-devel Note that since PEAR_Server requires PHP5, you must have a webserver running php5 to use it. PEAR_Server comes with a modular design. The core class registers both a frontend and a backend class. Available frontends are the all-crucial Xmlrpc frontend, and a web-based frontend HTMLQuickform based on the HTML_QuickForm class. The web-based frontend is designed strictly to be for administering the server, and does not provide any fancy package display/documentation stuff that you're used to from pear.php.net. The only backend provided requires DB_DataObject. The server requires some kind of database, and defaults to using mysqli as the connection type. pearserver.sql is included with the package in the data directory for the needed database structure. The script you'll need for the xmlrpc frontend must be located in http://yourservername.com/xmlrpc.php, and should look something like: xmlrpc.php: <?php require_once 'PEAR/Server.php'; require_once 'PEAR/Server/Backend/DBDataObject.php'; require_once 'PEAR/Server/Frontend/HTMLQuickForm.php'; $backend = new PEAR_Server_Backend_DBDataObject('channelname', array('database' => 'mysql://user:pass@localhost/pearserver')); $frontend = PEAR_Server_Frontend_Xmlrpc::singleton('channelname'); $server = new PEAR_Server('/path/to/where/releases/are/saved'); $server->setBackend($backend); $server->setFrontend($frontend); $server->run(); ?> That's it! For the web frontend, the file has a similar look: admin.php: <?php require_once 'PEAR/Server.php'; require_once 'PEAR/Server/Backend/DBDataObject.php'; require_once 'PEAR/Server/Frontend/HTMLQuickForm.php'; $backend = new PEAR_Server_Backend_DBDataObject('channelname', array('database' => 'mysql://user:pass@localhost/pearserver')); $frontend = new PEAR_Server_Frontend_HTMLQuickForm('channelname', new HTML_QuickForm('channel'),
    'admin.php', '/tmp');
$frontend->sessionStart(); $server = new PEAR_Server('/path/to/where/releases/are/saved'); $server->setBackend($backend); $server->setFrontend($frontend); $server->run(); ?> Happy testing. Greg

« previous php.pear.dev (#32397) next »