[ros-diffs] [cfinck] 32704: Change getbuilds, so that it works with the new server address and directory structure at the ISO Server

cfinck at svn.reactos.org cfinck at svn.reactos.org
Sun Mar 16 22:28:23 CET 2008


Author: cfinck
Date: Sun Mar 16 16:28:23 2008
New Revision: 32704

URL: http://svn.reactos.org/svn/reactos?rev=3D32704&view=3Drev
Log:
Change getbuilds, so that it works with the new server address and director=
y structure at the ISO Server

Modified:
    trunk/web/reactos.org/htdocs/getbuilds/ajax-getfiles-provider.php
    trunk/web/reactos.org/htdocs/getbuilds/config.inc.php
    trunk/web/reactos.org/htdocs/getbuilds/getbuilds.js.php

Modified: trunk/web/reactos.org/htdocs/getbuilds/ajax-getfiles-provider.php
URL: http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/getbui=
lds/ajax-getfiles-provider.php?rev=3D32704&r1=3D32703&r2=3D32704&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/web/reactos.org/htdocs/getbuilds/ajax-getfiles-provider.php (orig=
inal)
+++ trunk/web/reactos.org/htdocs/getbuilds/ajax-getfiles-provider.php Sun M=
ar 16 16:28:23 2008
@@ -4,14 +4,14 @@
   LICENSE:    GPL v2 or any later version
   FILE:       web/reactos.org/htdocs/getbuilds/ajax-getfiles-provider.php
   PURPOSE:    Easily download prebuilt ReactOS Revisions
-  COPYRIGHT:  Copyright 2007 Colin Finck <mail at colinfinck.de>
+  COPYRIGHT:  Copyright 2007-2008 Colin Finck <mail at colinfinck.de>
 */
    =

 	// This "ajax-getfiles.php" script has to be uploaded to the server, whic=
h contains the ISO files.
 	// Therefore it has an own configuration and doesn't use "config.inc.php".
 =

 	// Configuration
-	$ISO_DIR =3D "../iso";
+	$ROOT_DIR =3D "../";
 	$MAX_FILES_PER_PAGE =3D 100;			// The same value has to be set in "config=
.inc.php"
 	$REV_RANGE_LIMIT =3D 3000;
 =

@@ -63,7 +63,9 @@
 			die("<error><message>Wrong input for parameter 'get'!</message></error>=
");
 	}
 	=

+	$directories =3D array("bootcd", "livecd");
 	$file_patterns =3D array();
+	=

 	if( $_GET["bootcd-dbg"] =3D=3D 1 )
 		$file_patterns[] =3D "#bootcd-[0-9]+-dbg#";
 	if( $_GET["livecd-dbg"] =3D=3D 1 )
@@ -78,15 +80,19 @@
 	$firstrev =3D 0;
 	$lastrev =3D 0;
 	$morefiles =3D 0;
-	$dir =3D opendir( $ISO_DIR ) or die("<error><message>opendir failed!</mes=
sage></error>");
-
+	=

+	foreach($directories as $d)
+	{
+		$dir =3D opendir( $ROOT_DIR . $d ) or die("<error><message>opendir faile=
d!</message></error>");
+	=

+		while( $fname =3D readdir($dir) )
+			if( preg_match( "#-([0-9]+)-#", $fname, $matches ) )
+				$fnames[ $matches[1] ][] =3D $fname;
+		=

+		closedir($dir);
+	}
+	=

 	echo "<fileinformation>";
-	=

-	while( $fname =3D readdir($dir) )
-		if( preg_match( "#-([0-9]+)-#", $fname, $matches ) )
-			$fnames[ $matches[1] ][] =3D $fname;
-	=

-	closedir($dir);
 	=

 	for( $i =3D $_GET["startrev"]; $i <=3D $_GET["endrev"]; $i++ )
 	{
@@ -104,10 +110,12 @@
 						// This is a file we are looking for
 						if( $get_filelist )
 						{
+							$dir =3D substr($fname, 0, 6);
+							=

 							echo "<file>";
 							printf("<name>%s</name>", $fname );
-							printf("<size>%s</size>", fsize_str( filesize( "$ISO_DIR/$fname" ) =
) );
-							printf("<date>%s</date>", date( "Y-m-d H:i", filemtime( "$ISO_DIR/$=
fname" ) ) );
+							printf("<size>%s</size>", fsize_str( filesize( "$ROOT_DIR/$dir/$fna=
me" ) ) );
+							printf("<date>%s</date>", date( "Y-m-d H:i", filemtime( "$ROOT_DIR/=
$dir/$fname" ) ) );
 							echo "</file>";
 						}
 					=


Modified: trunk/web/reactos.org/htdocs/getbuilds/config.inc.php
URL: http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/getbui=
lds/config.inc.php?rev=3D32704&r1=3D32703&r2=3D32704&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/web/reactos.org/htdocs/getbuilds/config.inc.php (original)
+++ trunk/web/reactos.org/htdocs/getbuilds/config.inc.php Sun Mar 16 16:28:=
23 2008
@@ -8,7 +8,7 @@
 */
 	=

 	// Configuration
-	$AJAX_GETFILES_PROVIDER_URL =3D "http://svn.reactos.org/scripts/ajax-getf=
iles-provider.php";
+	$AJAX_GETFILES_PROVIDER_URL =3D "http://iso.reactos.org/scripts/ajax-getf=
iles-provider.php";
 	$ISO_DOWNLOAD_URL =3D "http://iso.reactos.org/";
 	$MAX_FILES_PER_PAGE =3D 100;			// The same value has to be set in "ajax-g=
etfiles-provider.php"
 	$SVN_ACTIVITY_URL =3D "http://svn.reactos.org/svnact/svn_activity.xml";

Modified: trunk/web/reactos.org/htdocs/getbuilds/getbuilds.js.php
URL: http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/getbui=
lds/getbuilds.js.php?rev=3D32704&r1=3D32703&r2=3D32704&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/web/reactos.org/htdocs/getbuilds/getbuilds.js.php (original)
+++ trunk/web/reactos.org/htdocs/getbuilds/getbuilds.js.php Sun Mar 16 16:2=
8:23 2008
@@ -176,7 +176,7 @@
 				var fname =3D files[i].getElementsByTagName("name")[0].firstChild.data;
 				var fsize =3D files[i].getElementsByTagName("size")[0].firstChild.data;
 				var fdate =3D files[i].getElementsByTagName("date")[0].firstChild.data;
-				var flink =3D '<a href=3D"<?php echo $ISO_DOWNLOAD_URL; ?>' + fname + =
'">';
+				var flink =3D '<a href=3D"<?php echo $ISO_DOWNLOAD_URL; ?>' + fname.su=
bstr(0, 6) + "/" + fname + '">';
 				oddeven =3D !oddeven;
 				=

 				html +=3D '<tr class=3D"' + (oddeven ? "odd" : "even") + '" onmouseove=
r=3D"tr_mouseover(this);" onmouseout=3D"tr_mouseout(this);">';




More information about the Ros-diffs mailing list