/** * The main entry point method. * This method creates the 'channel.xml' file based on the * given parameters. */ public function main() { $c = JLD_PearTools_Channel::singleton(); $result = $c->createRest(); if (!$result) { throw new BuildException('error creating REST directories'); } }
/** * The main entry point method. * This method creates the 'channel.xml' file based on the * given parameters. */ public function main() { $c = JLD_PearTools_Channel::singleton(); $result = $c->init($this->path); if (!$result) { throw new BuildException('channel object could not be created because channel.xml was not found'); } $this->project->setProperty('channel.uri', $c->getURI()); $this->project->setProperty('channel.name', $c->getName()); $this->project->setProperty('channel.alias', $c->getAlias()); $this->project->setProperty('channel.tags', $c->getTAGSPath()); $this->project->setProperty('channel.rest', $c->getRESTPath()); }
/** * The main entry point method. * This method creates the 'channel.xml' file based on the * given parameters. */ public function main() { $c = JLD_PearTools_Channel::singleton(); $c->name = $this->name; $c->alias = $this->alias; $c->uri = $this->uri; $c->file = $this->path . '/channel.xml'; $result = $c->create(); if (!$result) { throw new BuildException('error building channel.xml file'); } $result = $c->write(); if (!$result) { throw new BuildException('error writing channel.xml file'); } }
<?php /* @author: Jean-Lou Dupont $Id: TestChannel.php 252 2007-11-15 18:27:16Z JeanLou.Dupont $ */ //<source lang=php> require 'JLD/PearTools/Channel.php'; $c = JLD_PearTools_Channel::singleton(); // DON'T CHANGE THE DIRECTORY PATH OF THIS FILE OR ELSE THIS WON'T WORK $root = dirname(dirname(dirname(dirname(__FILE__)))); $c->init($root); echo 'Channel name: ' . $c->getURI(); //</source>