You are here: PHP calling TCL proc causes thousands of server errors - HELP « PHP Programming Language « IT news, forums, messages
PHP calling TCL proc causes thousands of server errors - HELP

Posted by comp.lang.php on 03/13/06 20:50

if (!function_exists('proper_case')) {
/**
* Ths function will convert a string into a proper case format using
the customized TCL proc "PROPER_CASE" from the included TCL string
tools libraries
*
* @access public
* @param mixed $text
* @param mixed $tclLibPath Path to TCL Library files
* @param DBActionPerformer $dbAP You must generate a descendant of
MethodGeneratorForActionPerformer to retrieve customized command-line
formatting to call TCL shell
* @return mixed $text properly formatted in Proper Case Form
* @see DBActionPerformer
* @uses tcl_string_tools::PROPER_CASE
*/
function &proper_case($text, $tclLibPath, $dbAP) {
if (!is_object($dbAP)) $dbAP =& new DBActionPerformer(); // NO NEED TO
CONNECT NOR DISCONNECT
list($tclKommand, $tclRedirect) =
@array_values($dbAP->getKommandOSArray('tcl'));
$tclSourceString = tcl_lib_include($tclLibPath);
if ($tclSourceString && !preg_match('/;[\n\r\s\t]*$/i',
$tclSourceString)) $tclSourceString .= ';'; // ADD ";" TO ADD ONE MORE
TCL COMMAND TO THE SINGLE LINE
$tclSourceString = str_replace(';', ";\n", $tclSourceString);
$msg = exec("$tclKommand << ':eof'\n$tclSourceString puts [PROPER_CASE
\{$text}]\n:eof $tclRedirect");
if (preg_match('/^[eE](rror:)/i', $msg) ||
strcmp(strtolower(trim($msg)), strtolower(trim($text))) != 0) {
trigger_error("Error involving TCL proc \"PROPER_CASE\" on \"$text\":
" . nl2br($msg), E_USER_WARNING); // GENERATE WARNING ONLY
return $text;
} else {
return $msg;
}
}
}

This is a PHP function that utilizes a prior-written TCL proc I wrote
that converts a name to proper case.. however, upon running it, you get
thousands of these lines:

":eof" No such file or directory

What in the world am I doing wrong?

Thanx
Phil

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация