home resources search newsjoinmembers: 6958
PHP Flash Java Ruby Windows Linux
fireorb's picture

fireorb | Sat, 2008-09-27 20:33  tags: , , ,

One of the goals of the FireOrb Project is for php developers to be able to use their propietory and contributed modules coded for Drupal. This is where the FireOrb MIT Extractor comes into play. The extractor application code named "Firemite" will hijack calls to Drupal functions and route them to FireOrb.

Firemite will be distributed seperately for now to maintain the seperation of code necessary to prevent infection by the GPL. This application will be built upon until it becomes the larger core product called FireOrb. Firemite is to be considered a migration tool to help developers move their Drupal code effortlessly over to the FireOrb code base. The single file that must be included in a Drupal install now will connect Drupal to growing into a set of files that in short time will make the use of Drupal no longer necessary.

You have probably noticed that I have decided on using the MIT License for FireOrb. This license provides the most freedom of use when open source software is to be melded with other applications be they FOSS or commercially licensed. This is also the license being used for projects like JQuery and CakePHP. End users will be given the freedom of sticking with the GPL or going with a more business friendly sub-licensing scheme. This was a decision made after reading this Give it away". So although names used in the FireOrb project will be offered under the Public Domain License the software will be under the MIT license. This is the best I could do given the present state of copyright laws.

In an effort to maintain totally transparency I will be adding code snippets to the blog post until the subversion repository is complete. Here is some of the testing code from this evening.

<?php

ob_start
();
/********************************************************
* This script code named "Firemite" is part of the FireOrb Project
* and licensed under the following license.
*
* The MIT License
*
* Copyright (c) 2008 Carl McDade
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following
* conditions:
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
*/
/**
* The plan:
*
* Take the sessions id and look up the user id using the sessions table.
*
* Take the user id and get the menu data from the cache_menu table
*
* Find the callback name that matches the path used
*
* convert the callback name to a FireOrb class method call
*/
print 'FireOrb overriding ....';
print 
'<pre>';
print_r($_POST);
print_r($_GET);
print_r($_COOKIE);
print 
'</pre>';
$sid current($_COOKIE); 
$mysqli = new mysqli("localhost""root""""drupal_510");
/* check connection */
if (mysqli_connect_errno()) {
    
printf("Connect failed: %s\n"mysqli_connect_error());
    exit();
}
$query "SELECT uid FROM sessions WHERE sid='".$sid."'";
print 
$query;
if (
$result $mysqli->query($query)) {
    
/* fetch object array */
    
while ($row $result->fetch_row()) {
        
$user_cid $row[0];
    }
    
/* free result set */
    
$result->close();
}
$query "SELECT data FROM cache_menu WHERE cid='".$user_cid.":en'";
print 
$query;
print 
'<pre>';
if (
$result $mysqli->query($query)) {
    
/* fetch object array */
    
while ($row $result->fetch_row()) {
        
//print_r(unserialize( $row[0]));
    
$menu unserialize$row[0]);
    }
    
$callbacks $menu['callbacks'];
    
print_r($callbacks);
    
/* free result set */
    
$result->close();
}
print 
'</pre>';
/* close connection */
$mysqli->close();
?>

There will be two development branches first there is Firemite as previously described. Then a CMS based on Drupal developed under the code name "Firewater" until Firemite is ready. At that time there will be a major change where the Firewater based code will most likely be archived and Firemite's MIT code will assume the name FireOrb. Doing things this way will make transistion easier as third party modules and php code will work with a stable codebase until FireOrb is fully established.


Happy Publishing!

fireorb's picture
Join Hiveminds and link to your website or blog.
Thoughtbox - So what did you think?



 
CMS Comparison Matrix
 
Wordpress ASP.NET Web Developers Adobe Flex Web Developers Silverlight Web Developers

Newsletter

Get updates on Hiveminds services, articles and downloads by signing up for the newsletter.

Editor's choice

Some of the better articles, stories and tutorials found at Hiveminds.

Find more

Find more of Hiveminds articles, stories, tutorials and user comments by searching.




Picked links

Hand picked websites and articles from around the web that provide quality reading.