Jump to content











Photo
* * * * * 1 votes

Server Site Management (v0.30)


  • Please log in to reply
68 replies to this topic

#26 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 11 March 2008 - 06:35 PM

Oops! Sorry. It was entirely my fault. Incomplete instructions. :)

I forgot to tell you that you need to add the $subdir and $update_list_all globals to line 380 so that it reads as follows:

global $ignore_files, $subdir, $update_list_all;

server_min.gif
I think the new function in_array in line 391 is too 'sharp'

There should be a function with

sub_in_array(xxx\bla\fool\.. , myDirArray) = in_array(xxx\, myDirArray)

Peter

#27 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 11 March 2008 - 07:28 PM

Yeah, something like that. It's in the wrong place in the logic tree. It should only be looking and branching at the first level subdirectories under the base projects directory, not at all of the layers below that as it does now.

I'll fix it and "slipstream" a proper revision into the download package for you as soon as I can, probably later today, but it might be quite late your time.

=====

GOT IT! Try this for line 391.
if(($listtype == 'folders' || $listtype == 'all') && ($startdir != '.' || $update_list_all || in_array($file.'/', $subdir))) $itemslist .= "$file=folder\n";


#28 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 11 March 2008 - 10:48 PM

I'll fix it and "slipstream" a proper revision into the download package for you as soon as I can, probably later today, but it might be quite late your time.

Okay, your revised download package is ready. In addition to the behavioural option fix, it also includes those missing paths for the folder entries that you mentioned earlier. Haven't actually heard anything from Nuno Brito, but I can only assume it was an oversight rather than deliberate. Besides, it's very easy to remove them again if he says otherwise. As far as the project.folder entry details are concerned, I just don't know until I hear from him. They're consistent with the parameters I was given for script file listings.

Sorry for the delay and the transient glitches, but your option request happened to catch me at an unusually busy time. Thanks for being a "guinea pig" and doing some of the follow-up on it yourself. :)

#29 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 12 March 2008 - 09:09 AM

Okay, your revised download package is ready. In addition to the behavioural option fix, it also includes those missing paths for the folder entries that you mentioned earlier. Haven't actually heard anything from Nuno Brito, but I can only assume it was an oversight rather than deliberate. Besides, it's very easy to remove them again if he says otherwise. As far as the project.folder entry details are concerned, I just don't know until I hear from him. They're consistent with the parameters I was given for script file listings.

Sorry for the delay and the transient glitches, but your option request happened to catch me at an unusually busy time. Thanks for being a "guinea pig" and doing some of the follow-up on it yourself. :)

I tested and got an error message ' is not a valid integer value' from WinBuilder download and the download listing aborted.
server_folder.gif
After making two small changes in index.php, everything run well.

I changed in get_fileinfo the default value of $script_version from "" to "0" and default of $script_download_level to "3"

Peter

#30 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 12 March 2008 - 09:45 AM

Great! Glad you got it working for you. It was actually a very good thing that you had an unanticipated set-up on your server. If you come up with any more ideas for functional improvements, please let me know.

Nuno didn't provide any default parameters for the script reader array outputs; so I just made 'em all nulls. I couldn't pry him loose from examining all the "pretty" interface details long enough to look at any of the actual outputs. :) Anyhow, I'll put in your suggested default numeric values. Good as any, I guess. Thanks.

#31 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 12 March 2008 - 12:15 PM

Great! Glad you got it working for you. It was actually a very good thing that you had an unanticipated set-up on your server. If you come up with any more ideas for functional improvements, please let me know.

Nuno didn't provide any default parameters for the script reader array outputs; so I just made 'em all nulls. I couldn't pry him loose from examining all the "pretty" interface details long enough to look at any of the actual outputs. :) Anyhow, I'll put in your suggested default numeric values. Good as any, I guess. Thanks.

Of course there are a couple of suggestions and wishes.

Two of them I already implemented by myself:
  • Instead of the hardcoded 'Download' in WinBuilder Download there has to be the name of the server.
  • Add in config.php:
    $server_name = 'nativeEx'; // the name which appears in WinBuilder download tree
  • In index.php > create_listing
  • Add $server_name to global
  • Replace
    $outputtext .= "Title=Downloads\n";
    by
    $outputtext .= "Title=".$server_name."\n";
[*]I want to show the different projects of the server in the order of $subdir in config.php
  • In index.php > create_listing
  • Replace
    $outputtext .= items_list('.', 'folders');
    by
    if (!$update_list_all)
    
    {
    
      $subdir_count = count($subdir);
    
      for &#40;$i = 1; $i <= $subdir_count; $i++&#41;
    
    	$outputtext .= rtrim&#40;$subdir&#91;$i&#93;, &#39;/&#39;&#41;.&#34;=folder\n&#34;;
    
    }
    
    else
    
      $outputtext .= items_list&#40;&#39;.&#39;, &#39;folders&#39;&#41;;
[/list]Peter

#32 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 12 March 2008 - 12:22 PM

BTW

If you now use WinBuilder's download and browse nativeEx:

The list is maintained by Arvy's prog with my small changes.

Peter

#33 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 12 March 2008 - 01:59 PM

@Arvy

I fullfilled me another wish:

While the user can browse every publish folder, only selected projects should go into build of Updates.ini:
  • In config.php add $subinc[] to $subdir[] and $subname[]
    Here is defined with TRUE / FALSE whether this subdir goes into Updates.ini or not
  • In index.php > createListing
    • Add $subinc to globals
    • ...
      
        $outputtext .= &#34;&#91;$update_section&#93;\n&#34;;
      
        if &#40;!$update_list_all&#41;
      
        {
      
      	$subdir_count = count&#40;$subdir&#41;;
      
      	for &#40;$i = 1; $i <= $subdir_count; $i++&#41;
      
      	{
      
      	  if &#40;$subinc&#91;$i&#93;&#41;
      
      		  $outputtext .= rtrim&#40;$subdir&#91;$i&#93;, &#39;/&#39;&#41;.&#34;=folder\n&#34;;
      
      	}
      
        }
      
        else
      
      	$outputtext .= items_list&#40;&#39;.&#39;, &#39;folders&#39;&#41;;
      
        $outputtext .= &#34;\n&#34;;
      
        $directories = directory_array&#40;&#39;.&#39;, FALSE, TRUE&#41;;
      
      ...
  • In index.php > directory_array
    • Add $subinc to globals
    • ...
      
      		if&#40;is_dir&#40;$startdir. &#34;/&#34; . $file&#41; && &#40;$level > 1 || $update_list_all || in_array&#40;$file.&#39;/&#39;, $subdir&#41;&#41;&#41;
      
      		{
      
      		  $doit = TRUE;
      
      		  $i = array_search&#40;$file.&#39;/&#39;, $subdir&#41;;
      
      		  if &#40;&#40;$level == 1&#41; && &#40;!$update_list_all&#41; && &#40;!$subinc&#91;$i&#93;&#41;&#41;
      
      			$doit = false;
      
      		  if &#40;$doit&#41;
      
      		  {
      
      			if&#40;$recursive&#41;
      
      			{
      
      			  $directory_array = array_merge&#40;$directory_array, directory_array&#40;$startdir. &#34;/&#34; . $file, $includefiles, $recursive, 2&#41;&#41;;
      
      			}
      
      			$file = $startdir . &#34;/&#34; . $file;
      
      			$directory_array&#91;&#93; = preg_replace&#40;&#34;/\/\//si&#34;, &#34;/&#34;, $file&#41;;
      
      		  }
      
      		}
      
      ...
Peter

BTW: You can now browse the nativeEx server using your app with my changes at http://nativeex.boot...d.net/index.php

#34 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 12 March 2008 - 05:39 PM

Good suggestions. I'll take a look at all of them. I was just a little hesitant about making any changes that might affect the updates.ini listing in any way that could possibly affect Nuno's current and planned winbuilder.exe usage. He didn't really say what's critical and what isn't. But that per subdir option for inclusion (instead of just a single $update_list_all parameter) is entirely up to the individual and should be no problem to implement.

BTW, in case you care, your page elements aren't all aligned the same way in my IE7 browser. The footer is centered, but all the rest are left-aligned.

#35 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 12 March 2008 - 06:06 PM

BTW, in case you care, your page elements aren't all aligned the same way in my IE7 browser. The footer is centered, but all the rest are left-aligned.


I think that is your original (CSS or whatelse). I did not change anything besides what you know.

In my Firefox it is the same.

Peter

server_just.gif

#36 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 12 March 2008 - 06:19 PM

Very strange. Looks okay on both test installations ( http://virtech.org/winbuilder/ and http://browser.winbuilder.net/ ) using either browser. Is it possible that you might have missed some of my CSS updates that were done along with the option mods?

#37 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 12 March 2008 - 06:26 PM

Very strange. Looks okay on both test installations ( http://virtech.org/winbuilder/ and http://browser.winbuilder.net/ ) using either browser. Is it possible that you might have missed some of my config.php CSS changes that were done along with the option mods?


Yes, I missed :)

Peter

server_just.gif

#38 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 12 March 2008 - 06:53 PM

Phew! That's a relief. Nuno would never forgive us if the user interface elements weren't properly aligned. :)

#39 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 12 March 2008 - 07:42 PM

Phew! That's a relief. Nuno would never forgive us if the user interface elements weren't properly aligned. :(


So I hope he will not kill me because I added my nativeEx backcolor and lower right logo

Peter :)

#40 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 12 March 2008 - 09:04 PM

So I hope he will not kill me because I added my nativeEx backcolor and lower right logo
Peter :)

I don't think we need to worry. I think he lost interest when I turned down his suggestion for 3-D animation. :( In fact, I'm starting to wonder if we're all alone in here. :cheers:

Anyhow, I'm in the process of implementing your .INI file title request and your idea for more user-specific subdir listing options. So far, I think I'll probably do the latter the same way I did the $allowBrowse option, replacing $update_list_all entirely. Something like this in the config file:
/////////////////////////////////////////////////////

// Subdirectories to include in WinBuilder updates listing file

// $subInclude = array&#40;&#34;*&#34;&#41; - all within base folder

/////////////////////////////////////////////////////

$subInclude = array&#40;$subdir&#91;1&#93;,$subdir&#91;2&#93;,$subdir&#91;3&#93;,$subdir&#91;4&#93;&#41;;
That makes the handling very simple in both the directory_array() and items_list() functions:
function directory_array&#40;$startdir, $includefiles, $recursive, $level=1&#41;

{

  global $ignore_files, $subInclude;

  $directory_array = array&#40;&#41;;

  if&#40;$handle = opendir&#40;$startdir&#41;&#41;

  {

	while &#40;false !== &#40;$file = readdir&#40;$handle&#41;&#41;&#41;

	{

	  if&#40;!in_array&#40;$file, $ignore_files&#41;&#41;

	  {

		if&#40;is_dir&#40;$startdir. &#34;/&#34; . $file&#41; && &#40;$level > 1 || in_array&#40;&#34;*&#34;, $subInclude&#41; || in_array&#40;$file.&#39;/&#39;, $subInclude&#41;&#41;&#41;

		{

		  if&#40;$recursive&#41;

		  {

			$directory_array = array_merge&#40;$directory_array, directory_array&#40;$startdir. &#34;/&#34; . $file, $includefiles, $recursive, 2&#41;&#41;;

		  }

		  $file = $startdir . &#34;/&#34; . $file;

		  $directory_array&#91;&#93; = preg_replace&#40;&#34;/\/\//si&#34;, &#34;/&#34;, $file&#41;;

		}

		else

		{

		  if&#40;$includefiles&#41;

		  {

			$file = $startdir . &#34;/&#34; . $file;

			$directory_array&#91;&#93; = preg_replace&#40;&#34;/\/\//si&#34;, &#34;/&#34;, $file&#41;;

		  }

		}

	  }

	}

	closedir&#40;$handle&#41;;

  }

  return $directory_array;

}



function items_list&#40;$startdir, $listtype = &#39;all&#39;&#41;

{

  global $ignore_files, $subInclude;

  $itemslist = &#34;&#34;;

  $formpath01 = str_replace&#40;&#34;./&#34;, &#34;.&#34;,$startdir&#41;;

  $formpath02 = str_replace&#40;&#34;.&#34;, &#34;&#34;,$formpath01&#41;;

  $formpath03 = str_replace&#40;&#34;/&#34;, &#34;\\&#34;,$formpath02&#41;;

  if&#40;$handle = opendir&#40;$startdir&#41;&#41;

  {

	while &#40;false !== &#40;$file = readdir&#40;$handle&#41;&#41;&#41;

	{

	  if&#40;!in_array&#40;$file, $ignore_files&#41;&#41;

	  {

		$chkdir = realpath&#40;$startdir.&#34;/&#34;.$file&#41;;

		if&#40;is_dir&#40;$chkdir&#41;&#41;

		{

		  if&#40;&#40;$listtype == &#39;folders&#39; || $listtype == &#39;all&#39;&#41; && &#40;$startdir != &#39;.&#39; || in_array&#40;&#34;*&#34;, $subInclude&#41; || in_array&#40;$file.&#39;/&#39;, $subInclude&#41;&#41;&#41;

		  {

			if&#40;$formpath03 == &#39;&#39;&#41; $itemslist .= $file.&#34;=folder\n&#34;;

			else $itemslist .= $formpath03.&#34;\\&#34;.$file.&#34;=folder\n&#34;;

		  }

		}

		else

		{

		  if&#40;$listtype == &#39;files&#39; || $listtype == &#39;all&#39;&#41; $itemslist .= get_fileinfo&#40;$file, $startdir&#41;.&#34;\n&#34;;

		}

	  }

	}

	closedir&#40;$handle&#41;;

  }

  return $itemslist;

}
My divergence is not a comment on the elegance of your own coding idea, BTW. I'm just very, very lazy. :cheers:

#41 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 12 March 2008 - 09:10 PM

My divergence is not a comment on the elegance of your own coding idea, BTW. I'm just very, very lazy. :(

With respect to my post here I do not want to say 'You are the boss'

But You are much more experienced with PHP than me (I started yesterday morning ..., and I'm glad that my first steps have been successful)

:) Peter

#42 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 12 March 2008 - 09:21 PM

Well, I think PHP is lots of fun and you're off to a great start. Your way would work as well as mine. Mine just saves re-doing a few code lines and my poor tired typing fingers appreciate that. :)

#43 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 12 March 2008 - 09:24 PM

Well, I think PHP is lots of fun and you're off to a great start. Your way would work as well as mine. Mine just saves re-doing a few code lines and my poor tired typing fingers appreciate that. :)

As long as I do not cry 'REVOLUTION' see my posts as suggestion and implement in your (surely more sophisticated) way.

Peter :(

#44 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 12 March 2008 - 11:55 PM

UPDATE (Board Time - 12th March 2008 - 11:55 PM)

Beta version 0.29 attempts to incorporate most of the suggestions made to time of posting. The demo and download locations are unchanged. It will undoubtedly be noted that certain demo appearance elements remain somewhat garish. The distasteful display is quite deliberate in order to emphasise the application's customisation capabilities. -- RV.

#45 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 13 March 2008 - 12:17 AM

Thank you for the update! :(



So I hope he will not kill me because I added my nativeEx backcolor and lower right logo

Peter :)



I don't think we need to worry. I think he lost interest when I turned down his suggestion for 3-D animation. :cheers: In fact, I'm starting to wonder if we're all alone in here. :cheers:
----



I'll just keep reading and waiting until the dark side persuades you to add some round buttons and flashy colors..

xtXZFNyjBSk

:cheers:

#46 Arvy

Arvy

    Frequent Member

  • Developer
  • 430 posts
  • Location:Canada, Parry Sound
  • Interests:IT, Outdoors, Horses
  •  
    Canada

Posted 13 March 2008 - 05:23 AM

Heh heh. If Darth Vader turns out to be my father, I think one of us will be in serious trouble. :)

One point you can clarify if you would, please. I adopted Peter's suggestion for some defaults where a .script or .project file specifies no values for them:

I changed in get_fileinfo the default value of $script_version from "" to "0" and default of $script_download_level to "3"

Can you confirm that causes no problem for any winbuilder.exe function. The defaults must be numeric (not null) but maybe they both should be 0 or -1.

#47 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 13 March 2008 - 07:36 AM

Heh heh. If Darth Vader turns out to be my father, I think one of us will be in serious trouble. :)

One point you can clarify if you would, please. I adopted Peter's suggestion for some defaults where a .script or .project file specifies no values for them:
Can you confirm that causes no problem for any winbuilder.exe function. The defaults must be numeric (not null) but maybe they both should be 0 or -1.

Reason for my decision:

A download level of 0 is 'Minimum', level 3 is 'Beta'

If there is a script w/o download level key, it can be assumed to be brand new.

In this case it is not wise to include into the minimum project download.
It should only appear if the user chooses 'Beta'

Peter

#48 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 13 March 2008 - 07:53 AM

Bug?

When trying to upload a file, I get the error 'Could not upload /tmp/php5ggSdy'

Of course the file does not arrive.

I try the upload with the folder visible in the browser, where the file should arrive.

Peter

#49 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 13 March 2008 - 09:54 AM

Reason for my decision:

A download level of 0 is 'Minimum', level 3 is 'Beta'

If there is a script w/o download level key, it can be assumed to be brand new.

In this case it is not wise to includ into the minimum project download.
It should only appear if the uses chooses 'Beta'

Peter


Good arguments, I subscribe to Peter's opinion.

:)

#50 pscEx

pscEx

    Platinum Member

  • Team Reboot
  • 12707 posts
  • Location:Korschenbroich, Germany
  • Interests:What somebody else cannot do.
  •  
    European Union

Posted 13 March 2008 - 01:43 PM

I tested version 0.29:

My change is lost that in WinBuilders Download tree the projects appear in the order of $subdir.

Version 028 with my change:
server_028.gif
Version 029:
server_029.gif

The upload error still exists.

Peter




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users