[dev] Fwd: [PEAR-DEV] PEAR_Server channel server is available for install

Chuck Hagenbuch chuck at horde.org
Tue Aug 3 21:19:15 PDT 2004


It'd be great to start getting a Horde channel server going...

----- Forwarded message from cellog at php.net -----
    Date: Tue, 03 Aug 2004 13:28:22 -0400
    From: Greg Beaver <cellog at php.net>
Reply-To: Greg Beaver <cellog at php.net>
 Subject: [PEAR-DEV] PEAR_Server channel server is available for install
      To: pear-dev at lists.php.net, PEAR Core <pear-core at lists.php.net>

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

--
PEAR Development Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

----- End forwarded message -----


-chuck

--
"Regard my poor demoralized mule!" - Juan Valdez


More information about the dev mailing list