@wuiPhpSetPageInfo(CVSID, INITDATE, TITLE)

Sets initial information about the PHP page ($wuiPageInfo object).

The following parameters are recognized:

CVSID

The CVS ID macro associated with the source code.

INITDATE

The date in the form YYYY-MM-DD the document was created.

TITLE

The title to associate with the document.

Example of using the macro:

<?php

@wuiPhpSetPageInfo("$Id: wuiphp.xml,v 1.4 2008/12/22 13:24:55 rwhalb Exp $","2006-08-26","My New NST WUI Page")

>

Assuming the com.ccg.macros.at.All class is within your CLASSPATH and the config/wuiphp.at macros file has been generated (Hint: run make atmacros in the wui directory), a developer should be able to run the above example by copy/pasting from below:

[root@probe root]# java com.ccg.macros.at.All <<EOF
@include("config/wuiphp.at",,"d")
<?php

@wuiPhpSetPageInfo("$Id: wuiphp.xml,v 1.4 2008/12/22 13:24:55 rwhalb Exp $","2006-08-26","My New NST WUI Page")

>
EOF

This macro is defined as:

class WuiPageInfo {
  var $cvsid, $initdate, $time, $title, $hostIp, $serverName, $serverAddress;

  function WuiPageInfo($cvsid, $initdate, $title) {
    $this->startTime = time();
    $this->cvsid = $cvsid;
    $this->initdate = $initdate;
    $this->title = $title;
    $this->serverAddress = getenv("SERVER_ADDR");
    $this->serverName = `hostname`;
    $this->releaseISO = null;
    $this->releaseWUI = '@releaseWUI()';
  }

  function getTitle() {
    return $this->title;
  }

  function getStartTime() {
    return $this->startTime;
  }

  function getServerAddress() {
    return $this->serverAddress;
  }

  function getServerName() {
    return $this->serverName;
  }

  function getReleaseISO() {
    return '@release()';
  }

  function getReleaseWUI() {
    return $this->releaseWUI;
  }

  function getLoadAvg() {
    if ($this->loadAvg == null) {
      $this->loadAvg = `/usr/bin/uptime | /bin/sed -e 's/.*load average: \\\\(.*$\\)/Load: \\\\1/'`;
    }

    return $this->loadAvg;
  }

  function getUpTime() {
    if ($this->upTime == null) {
      $this->upTime = `/usr/bin/uptime | /bin/sed 's/^.*up[ .*]\\\\(.*\\),.*user.*$/Up: \\\\1/'`;
    }
    return $this->upTime;
  }
}

$wuiPageInfo = new WuiPageInfo('@param(0)','@param(1)',"@param(2)");