wiki | forum | trac | otrs | joomla | tech blog | mailman | bewelcome Branches: test.bw | alpha.bw | www.bw Participate: download | get involved

Ticket #593 (new new feature)

Opened 2 months ago

Last modified 2 months ago

Sandbox for bw legacy scripts

Reported by: lemon-head Assigned to:
Priority: major Milestone: unassigned
Component: FrameWork Version:
Keywords: Cc:
Follow up needed: test Frequently reported: 1
Announce on BW: 0

Description

Inversion of control for bw scripts.

Instead of including the roxlauncher stuff with htdocs/bw/lib/tbinit.php, we begin with RoxLauncher? and let it include the requested bw file. This can be considered safer.

See

Change History

06/16/08 15:02:12 changed by lemon-head

Some problems we can still run into:

  • bw global scope is turned into rox method scope. This means, all the variables declared in bw global scope will become local function variables, and can no longer be used as "global $x" inside bw functions. This does not apply to PHP superglobals ($_GET, $_SESSION, etc), and to $_SYSHCVOL (which is declared in RoxLauncher?)

06/20/08 20:57:38 changed by lemon-head

oops, the above explanation is not really helpful.

What actually happens is this:

Traditional way, for bw.org/bw/mymessages.php:

  • we start with htdocs/bw/mymessages.php
  • from there we include htdocs/bw/lib/tbinit.php
  • from there we include roxlauncher/roxlauncher.php, create a fresh RoxLauncher, and say $launcher->initBW();
  • the launcher does all the TB stuff and global settings that are needed for BW.

Sandboxed way, for bw.org/bewelcome/mymessages.php:

  • we start with htdocs/index.php (thanks to apache rewrite rule and .htaccess)
  • from there the roxlauncher is started, as described in RequestRouting and InversionOfControl.
  • the RoxFrontRouter? looks at the request and the build/bw/alias.ini, and decides that this request should be handled by the BwController
  • The BwController (in build/bw) returns a BwPage, which finally includes the htdocs/bw/mymessages.php, as if it was a template
  • The mymessages.php includes the tbinit.php, which does nothing in this case (because it finds that the class RoxLauncher? already exists)
  • The mymessages.php includes some other files from htdocs/bw...

06/23/08 08:34:20 changed by philipp

is it really worth to invest time and energy into this? it worked fairly well so far (I am sure there are more severe security issues than this one) and we should rather spend the time on getting rid of the bw part than integrating it better.

06/26/08 14:41:46 changed by guaka

This can be used to partly get rid of /bw/ stuff, for example the whole layout stuff. And it can be used to gradually make a transition towards Rox. See MigrationToRox

Trac Customization: trac stylesheet
SourceForge.net Logo