Difference between revisions of "Framework Compatibility"

From Joomla! Documentation

(New page: The Joomla! Framework is mostly compatible with external frameworks. However when the framework loads by default, the libraries/joomla/import.php file actions a clean of the request variab...)
 
m (source)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
The Joomla! Framework is mostly compatible with external frameworks. However when the framework loads by default, the libraries/joomla/import.php file actions a clean of the request variables. This can have detrimental impact upon any framework loaded into memory prior to Joomla! as their variables in global scope can be destroyed.
 
The Joomla! Framework is mostly compatible with external frameworks. However when the framework loads by default, the libraries/joomla/import.php file actions a clean of the request variables. This can have detrimental impact upon any framework loaded into memory prior to Joomla! as their variables in global scope can be destroyed.
  
The solution to this is when you are loading up Joomla! to define the "_JREQUEST_NO_CLEAN" when loading the framework. This was fixed with #21772, see [[http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_id=8103&tracker_item_id=21772]].
+
The solution to this is when you are loading up Joomla! to define the "_JREQUEST_NO_CLEAN" when loading the framework. This was fixed with #21772, see [http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_id=8103&tracker_item_id=21772 JoomlaCode Tracker Item #21772].
  
 
Example:
 
Example:
<pre>
+
 
 +
<source lang="php">
 
// Define JRequest::clean to protect our variables!
 
// Define JRequest::clean to protect our variables!
 
define('_JREQUEST_NO_CLEAN', 1);  
 
define('_JREQUEST_NO_CLEAN', 1);  
Line 15: Line 16:
 
// Load up the standard stuff for testing
 
// Load up the standard stuff for testing
 
require_once JPATH_BASE.DS.'includes'.DS.'defines.php';
 
require_once JPATH_BASE.DS.'includes'.DS.'defines.php';
require_once JPATH_BASE.DS.'includes'.DS.'framework.php';
+
require_once JPATH_BASE.DS.'includes'.DS.'framework.php';</source>
</pre>
+
 
 +
<noinclude>[[Category:FAQ]][[Category:Framework]]</noinclude>

Latest revision as of 08:26, 15 January 2014

The Joomla! Framework is mostly compatible with external frameworks. However when the framework loads by default, the libraries/joomla/import.php file actions a clean of the request variables. This can have detrimental impact upon any framework loaded into memory prior to Joomla! as their variables in global scope can be destroyed.

The solution to this is when you are loading up Joomla! to define the "_JREQUEST_NO_CLEAN" when loading the framework. This was fixed with #21772, see JoomlaCode Tracker Item #21772.

Example:

// Define JRequest::clean to protect our variables!
define('_JREQUEST_NO_CLEAN', 1); 

// basic to make J! happy
define('_JEXEC', 1); //make j! happy
define('JPATH_BASE', dirname(__FILE__));
define('DS', DIRECTORY_SEPARATOR);

// Load up the standard stuff for testing
require_once JPATH_BASE.DS.'includes'.DS.'defines.php';
require_once JPATH_BASE.DS.'includes'.DS.'framework.php';