Actions

Difference between revisions of "How to create a stand-alone application using the Joomla! Platform"

From Joomla! Documentation

Line 11: Line 11:
 
:'''Note:''' ''Normally only the table #__session is needed, but if you want to stay safe, just use the whole structure of a Joomla! install (without the samples!)''
 
:'''Note:''' ''Normally only the table #__session is needed, but if you want to stay safe, just use the whole structure of a Joomla! install (without the samples!)''
 
*Create an '''index.php''' file in the root with the following starting code:
 
*Create an '''index.php''' file in the root with the following starting code:
:/* Initialize Joomla framework */
+
<source lang="php">
:define( '_JEXEC', 1 );
+
/* Initialize Joomla framework */
:define('JPATH_BASE', dirname(__FILE__) );
+
define( '_JEXEC', 1 );
:define( 'DS', DIRECTORY_SEPARATOR );
+
define('JPATH_BASE', dirname(__FILE__) );
:/* Required Files */
+
define( 'DS', DIRECTORY_SEPARATOR );
:require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
+
/* Required Files */
:require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
+
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
:/* Create the Application */
+
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
:$mainframe =& JFactory::getApplication('site');
+
/* Create the Application */
:/**************************************************/
+
$mainframe =& JFactory::getApplication('site');
:// Your code starts here...
+
/**************************************************/
:/**************************************************/
+
// Your code starts here...
 +
/**************************************************/
 +
</source>

Revision as of 19:39, 6 July 2008

[This is based on my experiments, I expect more knowledgeable people to jump in!]

In order to use the Joomla! Framework alone, you would have to follow the following guidelines:

  • Keep this folder/files from a normal Joomla! install:
  • includes/
  • libraries/
  • configuration.php
  • Edit configuration.php to match your server database/username/password/paths/etc.
  • Create the required tables in the database
Note: Normally only the table #__session is needed, but if you want to stay safe, just use the whole structure of a Joomla! install (without the samples!)
  • Create an index.php file in the root with the following starting code:
/* Initialize Joomla framework */
define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(__FILE__) );
define( 'DS', DIRECTORY_SEPARATOR );
/* Required Files */
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
/* Create the Application */
$mainframe =& JFactory::getApplication('site');
/**************************************************/
// Your code starts here...
/**************************************************/