Quote:
Topic: A Suggested GPL Compliant Abstraction Process (Read 82 times)
rugmonster
A Suggested GPL Compliant Abstraction Process
« on: June 23, 2007, 08:05:06 PM »
I have been trying to show folks over at the JCD-A a way to, without any admission of GPL violation, redesign the way their proprietary code works with Joomla!. It hasn't been received very well, but I hope that someone can find this useful.
Per the FSF, under the GPL, if a process calls another process, independently and no functions or classes are shared, the two are separate and distinct works. To illustrate how this might be done in Joomla!, I put together a simple example, that I called com_gplexample and hello.php.
Here's the breakdown. gplexample.php, being the main file for the Joomla! component, acts as the abstracting bridge between Joomla! and a BSD licensed script, hello.php. gplexample.php includes task.inc.phps which simply holds my $task related functions, so look there for the actual interfacing. The significance here is that the BSD license is not compatible with the GPL, yet through this implementation, I keep the two as separate, distinct works.
The way it works is the component provides the UI for input and output. It takes user input and puts it into a CURL HTTP request for hello.php. hello.php is accessed by passing it arguments like if you were to call a program from within another one. Obviously, they are two distinct entities. The BSD licensed script takes the information and does with it what I've told it to and passes it back as an HTTP response. The output is received by the component code and formatted for output. In this case, I ask for the user's name, it goes to hello.php to say "Hello there, $name" and sent back to be formatted inside a div. Simple, but I think it illustrates the point. You could adapt this to use Ajax or embed the non-GPL code's functionality inside an iframe.
As long as you aren't reaching into Joomla! proper to directly use it's functions or classes, you have not created a derivative. Also, the data Joomla! uses is stored in a database. To my understanding, there's nothing wrong with you connecting to that same database to grab data. If you need a user's session data, pass it as an argument for the non-GPL code. There are all kinds of possibilities to meeting the requirements of Joomla! and writing closed, proprietary code.
The biggest advantage here is that you no longer depend on Joomla! exclusively. You could take this generic code and create bridges for other CMS's. This would broaden the customer base for the product and allow you the opportunity to expand a potentially very limited niche market. After all, most CMS's provide similar functionality and chances are, if there is a demand under Joomla!, there will be demand under XOOPS, CMS Made Simple, e107, Typo3, and on and on and on.
If you would like to try the whole thing out, I have an installable package of it here. Note that you will need CURL support in PHP for the component to work properly. I welcome any and all thoughts on this.
Regards,
Daniel J. Givens
Jamandall Endeavors, Inc.
DISCLAIMER: The comments made here are strictly mine and do not represent the position of any other organization I may be affiliated with.
This is in my opinion adding a whole new layer of complexity to the process of making a Joomla component. As a developer of some merit I can tell you now that I would not use this method. You talk of CURL and AJAX, both of which are not existant on all systems / browsers.
Curl involves transmitting data via a http request which essentially means you would be making another page request and adding to load time. The same holds true for ajax. This is not feasible.
As I have stated before the way to do this is to take some "constants" from the Joomla system and apply them to another framework / api addressing system. This would allow one to create mulitple api that are independent of Joomla and GPL.
Bascically one would take all of the global variable output as well as database login details and make all available as variables (global or static) which are not covered by the GPL. The main thing to note here is that you cannot use Joomla! embedded functions such as:
$database->setQuery($query);
Although you could use
$database->myvariable
(it is my opinion that variables are not covered by the GPL but to be safe one could do this all in one global type file that sets the variables to the global namespace - IF GLOBAL VARIABLES CAN BE GPL'D I WILL EAT MY HAT!
This method evolves one moving to a new paradigm in approaching the creation of an extension, one that is in fact holds many advantageous for creating adaptable code. I will continue later as I need to head of to church.
-Lobos