Location: PHPKode > projects > Aratix > aratix/setup/pathes2.inc.php
<?php
/*
** Aratix
** Version 0.2.2beta9 (Anubis)
**
** Autor: Manuel Burghammer
** E-Mail: hide@address.com
** Homepage: http://www.xitara.net
**
** File: pathes2.inc.php - Version 0.2.2 build 18
** Position: /setup/
** Last Modified: 17.04.2006 - 14:59:51
*/

$checked_path = "";

$content->assign("root_path", get('root_path'));
$content->assign("path", get('path'));
$content->assign("cgi_path", get('cgi_path'));
$content->assign("domain", get('domain'));
$content->assign("folder", get('folder'));
$content->assign("cgi_folder", get('cgi_folder'));

include("../inc/mysql.conf.php");

$db->connect($db_host, $db_user, $db_pass);
$db->select_db($db_base);

update_db($db, 'path');
update_db($db, 'cgi_path');
update_db($db, 'folder');
update_db($db, 'cgi_folder');
$db->update(TB_DOMAINS, "domain", get('domain'), "id=1");

$version = file('version.conf');
$db->update(TB_CONFIG, "version", $version[0]);

$perl_pathes = array(	"/usr/bin/perl",
						"/usr/local/bin/perl",
						"/usr/sbin/perl",
						"/usr/local/sbin/perl",
						"C:\XAMPP",
						"C:\Programme\XAMPP");

foreach($perl_pathes as $perl_path){
	$handle = fopen(get('cgi_path') . "/test.cgi", "w") or die("Fehler");
	fwrite($handle, "#!" . $perl_path . "\n");
	fwrite($handle, "print \"Content-Type: text/plain\\n\\n\";\n");
	fwrite($handle, "print \"true\";\n");
	fclose($handle);

	chmod(get('cgi_path') . "/test.cgi", 0755) or die("Fehler");

	if($check = file("http://" . get('domain') . get('cgi_folder') . "/test.cgi")){
		if($check[0] == "true"){
			$checked_path = $perl_path;
			$db->update(TB_CONFIG, "text", $perl_path, "var='perl_path'");
			break;
		}
	}
}
unlink(get('cgi_path') . "/test.cgi");

$content->assign("perl_path", $checked_path);

// Ordner anlegen
if(@mkdir(get('path') . "/blocks", 0755)){
	chmod(get('path') . "/blocks", 0755);
	$content->assign("mk_blocks", TRUE);
}
if(@mkdir(get('path') . "/modules", 0755)){
	chmod(get('path') . "/modules", 0755);
	$content->assign("mk_modules", TRUE);
}

function update_db($db, $var){
	$db->update(TB_CONFIG, "text", get($var), "var='" . $var . "'");
}
?>
Return current item: Aratix