Categories > TinyButStrong general >

Installation instruction does not work same in PHP 4

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: sheepy
Date: 2007-02-19
Time: 17:54

Installation instruction does not work same in PHP 4

The manual says to install TBS you do this:
$TBS = new clsTinyButStrong ;

Normally this works fine, until a plugin want to access and modify the TBS parent object in PHP 4.
Since the code assigns by value not by reference, $TBS is only a copy of what the plugins have been given on installation.  This is bad since as far as user knows, the plugin changes nothing.  And, as far as plugin knows, TBS is unmodified since installation.

The plugin, obviously, can't change how TBS is installed.  Should the users and developers be aware of this issue?
By: Skrol29
Date: 2007-02-19
Time: 23:19

Re: Installation instruction does not work same in PHP 4

Hi Sheepy,

The line
  $TBS = new clsTinyButStrong;
can make TBS autoinstalled plug-in to run not correctlt with PHP 4.
To have them working correctly, use this instead :
  $TBS =& new clsTinyButStrong;
(I will update the manual)

This is because in PHP 4, the $this variable is never assigned by reference in the constructor function, unless you call "=& new" to create the instance.