/** * Constructor * * @param util.cmd.ParamString args */ public function __construct(\util\cmd\ParamString $args) { $dsn = new DSN($args->value(0)); $this->adapter = self::$adapters[$dsn->getDriver()]->newInstance(DriverManager::getInstance()->getConnection($dsn->dsn)); $this->package = $args->value('package', 'p', 'db'); $this->host = $args->value('host', 'h', $dsn->getHost()); $this->naming = $args->value('nstrategy', 'n', ''); if ('' != $this->naming) { DBXMLNamingContext::setStrategy(XPClass::forName($this->naming)->newInstance()); } $this->prefix = $args->value('prefix', 'pv', ''); $this->ptargets = explode('|', $args->value('ptargets', 'pt', '')); $this->pexclude = $args->value('pexclude', 'pe', false); // Setup generator $this->processor = new DomXSLProcessor(); $this->processor->setXSLBuf($this->getClass()->getPackage()->getResource($args->value('lang', 'l', 'xp5.php') . '.xsl')); $this->processor->setParam('package', $this->package); if ($this->prefix) { $this->processor->setParam('prefix', $this->prefix); $this->processor->setParam($this->pexclude ? 'exprefix' : 'incprefix', implode(',', $this->ptargets)); } }