Slide 1: Quick Working Environment

This one's a keeper. Code appears in library.

<?php

// This is for J3.x. See Code Library for J2.5.x example.
$thisJoomlaRoot = '/path/to/your/public_html';
define('_JEXEC', 1);
define('JPATH_BASE', $thisJoomlaRoot);
require_once JPATH_BASE . '/includes/defines.php';
require_once JPATH_BASE . '/includes/framework.php';
$app = JFactory::getApplication('administrator');
echo 'hello world';


// in J!, they just use the magic constant for this, as in:
// define('JPATH_BASE', __DIR__);
// Of course, in this course, we're not in the root, so...

Results:

hello world


Notes