Difference between revisions of "C.php"

From Organic Design wiki
(compiler working :-))
m
Line 1: Line 1:
 
<?
 
<?
 
# C compiler for XmlWiki Environment
 
# C compiler for XmlWiki Environment
xwSetProperty('language','TEXT');
+
xwSetProperty($properties,'language','TEXT');
 
$server = $_SERVER['HTTP_HOST'];
 
$server = $_SERVER['HTTP_HOST'];
 
$htdocs = $_SERVER['DOCUMENT_ROOT'];
 
$htdocs = $_SERVER['DOCUMENT_ROOT'];

Revision as of 05:48, 23 June 2006

<?

  1. C compiler for XmlWiki Environment

xwSetProperty($properties,'language','TEXT'); $server = $_SERVER['HTTP_HOST']; $htdocs = $_SERVER['DOCUMENT_ROOT']; if ( !ereg( "\\/$", $htdocs ) ) $htdocs .= '/';

// Write the source to tmp file source.c if ($handle = fopen($htdocs.'/source.c', 'w+')) {

   fwrite($handle, $article);
   fclose($handle);
   }

// Compile and output $gcc = $htdocs.'wiki/gcc'; $article = "Compiling using $gcc:\n"; $article .= shell_exec("$gcc 2>&1"); ?>