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; }
protected function getElement(&$theNode, &$theElement) { ENTER("config::getElement", __LINE__); SHOW("====== nodeName=" . $theNode->nodeName . " ======\n"); $theElement = NULL; $anArray = NULL; $aName = ""; $aElementIsHidden = false; if ($theNode->nodeType !== XML_ELEMENT_NODE) { return; } if ($theNode->hasAttributes()) { foreach ($theNode->attributes as $a) { $anArray[$a->name] = $a->value; } } if ($theNode->hasChildNodes()) { $a = $theNode->firstChild; while ($a != NULL) { if ($a->nodeType === XML_ELEMENT_NODE) { $b = $a->firstChild; if ($b != NULL && $b->isSameNode($a->lastChild)) { $anArray[$a->nodeName] = $b->nodeValue; } } $a = $a->nextSibling; } } switch ($theNode->nodeName) { case MINIMENU_CATEGORY: $theElement = new category($anArray); break; case MINIMENU_PROGRAM: $theElement = new program($anArray); break; case MINIMENU_DOCUMENT: $theElement = new document($anArray); break; default: $aError = sprintf("Error: unknown element: %s\n", $aNode->nodeName); ErrorMessage($aError, __LINE__, __FILE__, '$Revision: 1.2 $'); break; } }
$FieldDir = '/www/wikifarm/fields'; include 'debugfuncs.php'; if (!isset($_POST['submit'])) { echo "<form action='<?php echo $_SERVER[PHP_SELF]; ?> ' method='post'>"; echo "Wiki-Field: ".makeSelectBox(gatherFields($FieldDir))."<br>"; echo "<input type='submit' value='OK'>"; echo "</form>"; exit; } SHOW($_POST); ?> </body> </html> <? function gatherFields ($dir) { $d = @opendir($dir); if ($d === false) return false; while (($f = readdir($d)) !== false) { if ($f{0} != '.' && is_dir("$dir/$f")) $fields[] = $f; }
function getLine(&$theLine, $theLastInput = "") { ENTER("dumbTerminal::getLine", __LINE__); $aResult = getCharOK; $theLine = fgets($this->_myFileDescriptor); if ($theLine === false) { //die(sprintf("Fatal error: fgets (%s %s)",__FILE__,__LINE__)); } SHOW($theLine); return $aResult; }
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** ** GNU General Public License for more details. ** ** ** ** You should have received a copy of the GNU General Public License ** ** along with this program; if not, write to the Free Software ** ** Foundation, Inc., 51 Franklin Street, Fifth Floor, ** ** Boston, MA 02110-1301, USA. ** *******************************************************************************/ require_once 'debugfuncs.php'; $pagename = $_GET['n']; if ($pagename == 'all') { $basedir = dirname(__FILE__)."/../../m2m.d"; SHOW($basedir); $d = opendir($basedir); while (($fname = readdir($d)) !== false) { if (is_dir("$basedir/$fname") && file_exists("$basedir/$fname/.lock")) { echo "remove $fname/.lock<br>"; unlink("$basedir/$fname/.lock"); } } closedir($d); echo "ready"; } else { @unlink("$M2MDataDir/$pagename/.lock"); }