Beispiel #1
0
 public function config($theUser, &$theElement)
 {
     ENTER("config::config", __LINE__);
     parent::__construct();
     $this->{$myUser} = $theUser;
     $this->myFilename = "/home/{$theUser}/" . CONFIGNAME;
     if (!is_file($this->myFilename)) {
         $aSourceFilename = MAINDIR . "/" . CONFIGNAME;
         if (copy($aSourceFilename, $this->myFilename) == false) {
             $aError = sprintf("Error: can't copy file: %s to %s\n", $aSourceFilename, $this->myFilename);
             ErrorMessage($aError, __LINE__, __FILE__, '$Revision: 1.2 $');
             return;
         }
     }
     if (!is_readable($this->myFilename)) {
         $aError = sprintf("Error: file unreadable: %s\n", $this->myFilename);
         ErrorMessage($aError, __LINE__, __FILE__, '$Revision: 1.2 $');
         return;
     }
     $this->load($this->myFilename);
     $this->myXpath = new domXPath($this);
     $this->myXPathQuery = $this->myXpath->query($this->configPath . "/*");
     $aNumberOfItems = $this->myXPathQuery->length;
     for ($i = 0; $i < $aNumberOfItems; $i++) {
         $aNode = $this->myXPathQuery->item($i);
         unset($anElement);
         $this->getElement($aNode, &$anElement);
         $theElement[] = $anElement;
     }
     $this->my_object_is_build = true;
 }
Beispiel #2
0
 function mailConfig($theUser)
 {
     ENTER("mailConfig::mailConfig", __LINE__);
     parent::__construct();
     SHOW("theUser={$theUser}, this={$this}");
     $this->_myUser = $theUser;
     $this->_myFilename = sprintf($this->_myTemplateFilename, $theUser);
     if (!is_file($this->_myFilename)) {
         $fd = fopen($this->_myFilename, "w");
         if ($fd == NULL) {
             $aError = sprintf("Error: can't open file: %s\n", $this->_myFilename);
             ErrorMessage($aError, __LINE__, __FILE__, '$Revision: 1.8 $');
             return;
         }
         fwrite($fd, $this->_myInitialFile);
         fclose($fd);
     }
     if (!is_readable($this->_myFilename)) {
         $aError = sprintf("Error: file unreadable: %s\n", $this->_myFilename);
         ErrorMessage($aError, __LINE__, __FILE__, '$Revision: 1.8 $');
         return;
     }
     $this->load($this->_myFilename);
     $this->_myXpath = new domxpath($this);
     $this->_myMailconfigContext = $this->_myXpath->query($this->_mailconfigPath)->item(0);
     $this->initMailSourceIndex();
     $this->_my_object_is_build = true;
 }
Beispiel #3
0
 function __construct()
 {
     $this->sessionid = uniqid();
     parent::__construct('1.0', 'UTF-8');
     $this->formatOutput = true;
     //$this->standalone = false;
     #$this->validateOnParse = true;
 }
Beispiel #4
0
 /**
  * Constructs a new DOM document.
  *
  * \param string $version
  *      (optional) XML version to use.
  *
  * \param string $encoding
  *      (optional) Encoding for the document.
  */
 public function __construct($version = null, $encoding = null)
 {
     $this->clearErrors();
     if ($version === null && $encoding === null) {
         parent::__construct();
     } elseif ($encoding === null) {
         parent::__construct($version);
     } else {
         parent::__construct($version, $encoding);
     }
 }
Beispiel #5
0
 function __construct($type)
 {
     parent::__construct('1.0', 'UTF-8');
     $this->loadXML(self::TEMPLATE);
     $type = strtolower($type);
     if (!in_array($type, array('hello', 'greeting', 'command', 'response'))) {
         trigger_error("Invalid argument value '{$type}' for \$type", E_USER_ERROR);
     }
     $this->epp = $this->firstChild;
     $this->body = $this->createElement($type);
     $this->epp->appendChild($this->body);
 }
Beispiel #6
0
 /**
  * Constructor, duh
  *
  * Set up the DOM environment
  *
  * @param    string    $root        The name of the root node
  * @param    string    $nod_name    The name numeric keys are called
  *
  */
 public function __construct($root = 'root', $node_name = 'node')
 {
     parent::__construct();
     /*** set the encoding ***/
     $this->encoding = "ISO-8859-1";
     /*** format the output ***/
     $this->formatOutput = true;
     /*** set the node names ***/
     $this->node_name = $node_name;
     /*** create the root element ***/
     $this->root = $this->appendChild($this->createElement($root));
     $this->xpath = new DomXPath($this);
 }
Beispiel #7
0
 /**
  * WsdlWriter Constructor
  *
  * @param string The Object File name
  * @param string The Base Url for the Web Service
  */
 public function __construct(WsdlDefinition $wsdlDefinition)
 {
     // Items before parent Constructor don't stick!
     parent::__construct();
     // DomDocument::$formatOutput Format the WSDL Doc
     $this->formatOutput = true;
     $this->encoding = "UTF-8";
     // Set the WsdlWriter Properties
     $this->wsdlMethods = array();
     $this->wsdlDefinition = $wsdlDefinition;
     // Create the Base WSDL Doc
     $this->seedXML();
 }
Beispiel #8
0
 /**
  * @constructor Sets up the DOM environment.
  * @access public
  * @param string $sTitle The site title
  * @param string $sLink The link to the site
  * @param string $sDescription The site description
  * @return void
  */
 public function __construct($sTitle, $sLink, $sDescription)
 {
     // Call the parent constructor (DomDocument)
     parent::__construct();
     // Craete the root element
     $oRoot = $this->appendChild($this->createElement('rss'));
     // Sets to RSS version 2
     $oRoot->setAttribute('version', '2.0');
     // Sets the channel node
     $this->_oChannel = $oRoot->appendChild($this->createElement('channel'));
     // Sets the title link and description elements
     $this->_oChannel->appendChild($this->createElement('title', $sTitle));
     $this->_oChannel->appendChild($this->createElement('link', $sLink));
     $this->_oChannel->appendChild($this->createElement('description', $sDescription));
 }
Beispiel #9
0
 public function __construct($title, $link, $description)
 {
     // call the parent constructor
     parent::__construct();
     // format the created XML
     $this->formatOutput = true;
     // craete the root element
     $root = $this->appendChild($this->createElement('rss'));
     // set to rss2
     $root->setAttribute('version', '2.0');
     // set the channel node
     $this->channel = $root->appendChild($this->createElement('channel'));
     // set the title link and description elements
     $this->channel->appendChild($this->createElement('title', $title));
     $this->channel->appendChild($this->createElement('link', $link));
     $this->channel->appendChild($this->createElement('description', $description));
 }
 function __construct($elemWhitelist = null, $attrWhitelist = null)
 {
     global $tags_allowed_in_fields;
     // defined in config.inc
     Logger::log("Enter: creating new InputSanitizer class");
     parent::__construct();
     if ($elemWhitelist) {
         $this->elemWhitelist = $elemWhitelist;
     }
     if ($attrWhitelist) {
         $this->attrWhitelist = $attrWhitelist;
     }
     $this->tags_allowed_in_fields = $tags_allowed_in_fields;
     // defined in config.inc
     // note: this is still not really OO,
     // but better than using a global in process()
     Logger::log("Exit: creating new InputSanitizer class");
 }
Beispiel #11
0
 public function __construct($version = '1.0', $encoding = 'ISO-8859-1')
 {
     parent::__construct($version, $encoding);
     $this->formatOutput = true;
 }
 /**
  *  Constructor.
  *  All it does is to call the parent constructor
  */
 public function __construct()
 {
     parent::__construct();
 }
Beispiel #13
0
 public function __construct()
 {
     parent::__construct();
     $this->formatOutput = true;
     #$this->validateOnParse = true;
 }
 public function __construct($filepath)
 {
     parent::__construct();
     $this->load($filepath);
 }
Beispiel #15
0
 public function __construct($root, $value = null, $attributes = null)
 {
     parent::__construct('1.0');
     $this->root_element = $this->createElement($root);
     $this->appendChild($this->root_element);
     $this->formatOutput = true;
     if ($attributes) {
         foreach ($attributes as $key => $val) {
             $this->root_element->setAttribute($key, $val);
         }
     }
 }