Configure.php
Summary
No overview generated for 'Configure.php'
<?php
if ( @$_SERVER["HTTP_HOST"] != NULL )
{
die( "No\n" );
}
$stdin = fopen("php://stdin","r");
$stdout = fopen("php://stdout","r");
$stderr = fopen("php://stderr","r");
readfile( "./conf/banner.txt" );
print( "Press any key to continue:" );
$response = fgets( $stdin, 256 );
include_once( "./devutils/lib/install.php" );
$dataExport = array();
while ( true )
{
print "\n";
print "---------------------------------------------------------\n";
print "\nFull Path to PHP command line interpreter:\n";
print "[" . @$dataExport["PHP"] . "]:";
$response = fgets( $stdin, 256 );
if ( preg_match( "/\S/", $response ) )
{
$response = trim($response);
$dataExport[ "PHP" ] = $response;
break;
}
else
{
if ( preg_match( "/\S/", @$dataExport[ "PHP" ] ))
break;
print( "\nPlease enter the path to PHP\n" );
}
}
while ( true )
{
print "\n";
print "---------------------------------------------------------\n";
print "\nPath to PERL - used for generating documentation\n";
print "(or just press ENTER to skip):\n";
print "[" . @$dataExport["PERL"] . "]:";
$response = fgets( $stdin, 256 );
if ( preg_match( "/\S/", $response ) )
{
$response = trim($response);
$dataExport[ "PERL" ] = $response;
break;
}
else
{
$dataExport[ "PERL" ] = "/bin/false";
break;
}
}
while ( true )
{
print "\n";
print "---------------------------------------------------------\n";
print "AreaEdit needs to know what URL it's installed under.\n";
print "(e.g. /areaedit or maybe http://some_site.com/somedir/areaedit)\n";
print "\nURL of AreaEdit install:\n";
print "[" . @$dataExport["AREAEDIT_INSTALL_URL"] . "]:";
$response = fgets( $stdin, 256 );
if ( preg_match( "/\S/", $response ) )
{
$response = trim($response);
$dataExport[ "AREAEDIT_INSTALL_URL" ] = $response;
break;
}
else
{
if ( preg_match( "/\S/", @$dataExport[ "AREAEDIT_INSTALL_URL" ] ))
break;
print( "\nPlease enter the url of your AreaEdit install.\n" );
}
}
$dataExport[ "AREAEDIT_INSTALL_ROOT"] = getcwd();
if (( $infile_list = file( "./conf/infile_list.txt" )) == NULL )
{
print( "ERROR - unable open '.in' files list in './conf/infile_list.txt'\n" );
return false ;
}
foreach ( $infile_list as $offset => $source_line )
{
if (( preg_match( "/^\s$/", $source_line )) ||
( substr( $source_line, 0, 3 ) == "/**" ) ||
( substr( $source_line, 0, 1 ) == "*" ) ||
( substr( $source_line, 0, 2 ) == "<?" ) ||
( substr( $source_line, 0, 2 ) == "?>" ))
{
continue;
}
$source_line = rtrim( $source_line );
list( $filename, $permissions ) = split( " ", $source_line );
$permissions = rtrim( $permissions );
$target_filename = str_replace( ".in", "", $filename );
process_template( $filename, $target_filename, $dataExport );
$mode_oct = octdec($permissions);
chmod( $target_filename, $mode_oct );
print( "Generated '$target_filename' permissions '$permissions'\n" );
}
if (( $infile_list = file( "./conf/perms_list.txt" )) == NULL )
{
print( "ERROR - unable open perms list in './conf/perms_list.txt'\n" );
return false ;
}
foreach ( $infile_list as $offset => $source_line )
{
if (( preg_match( "/^\s$/", $source_line )) ||
( substr( $source_line, 0, 3 ) == "/**" ) ||
( substr( $source_line, 0, 1 ) == "*" ) ||
( substr( $source_line, 0, 2 ) == "<?" ) ||
( substr( $source_line, 0, 2 ) == "?>" ))
{
continue;
}
$source_line = rtrim( $source_line );
list( $filename, $permissions, $owner ) = split( " ", $source_line );
$owner = rtrim( $owner );
$mode_oct = octdec($permissions);
chmod( $filename, $mode_oct );
chown( $filename, $owner );
print( "Set '$filename' to perms '$permissions' owner '$owner'\n" );
}
?>
Documentation generated by
JSDoc on Sat Dec 31 14:56:56 2005