$wgUsePHPTal setting no longer exists; if a PHPTAL-based skin is used it will attempt to load PEAR+PHPTAL and gracefully disable itself if it can't.
Todo: get the list of skins in preferences to reflect this kind of disabling, so unselectable skins don't need to be moved into disabled subdir to be hidden.
$wgSVGConverter = 'ImageMagick'; # Pick one of the above
$wgSVGConverterPath = ''; # If not in the executable PATH, specify
-# PHPTAL is a library for page templates. This is optional;
-# MediaWiki's internal skins no longer use it but you might
-# create your own custom skin using it.
-#
-# Use PHPTAL 0.7.0 for PHP 4.x or PHPTAL 1.0.0 for PHP 5.0.
-# http://phptal.sourceforge.net/
-#
-# Leave it off to avoid trying to load the template library
-# if you're not going to be using any such skins.
-$wgUsePHPTal = false;
-
if( !isset( $wgCommandLineMode ) ) {
$wgCommandLineMode = false;
}
* Based on Brion's smarty skin
* Copyright (C) Gabriel Wicke -- http://www.aulinx.de/
*
- * Todo: Needs some serious refactoring into functions that correspond
- * to the computations individual esi snippets need. Most importantly no body
- * parsing for most of those of course.
- *
- * Set this in LocalSettings to enable phptal:
- * set_include_path(get_include_path() . ":" . $IP.'/PHPTAL-NP-0.7.0/libs');
- * $wgUsePHPTal = true;
+ * The guts of this have moved to SkinTemplate.php
+ *
+ * Make sure the appropriate version of PHPTAL is installed (0.7.0 for PHP4,
+ * or 1.0.0 for PHP5) and available in the include_path. The system PEAR
+ * directory is good.
+ *
+ * If PEAR or PHPTAL can't be loaded, it will try to gracefully fall back.
+ * Turn on MediaWiki's debug log to see it complain.
*
* @package MediaWiki
* @subpackage Skins
if( version_compare( phpversion(), "5.0", "lt" ) ) {
define( 'OLD_PHPTAL', true );
- global $IP;
- require_once $IP.'/PHPTAL-NP-0.7.0/libs/PHPTAL.php';
+ # PEAR and PHPTAL 0.7.x must be installed and in include_path
} else {
define( 'NEW_PHPTAL', true );
- # For now, PHPTAL 1.0.x must be installed via PEAR in system dir.
- require_once 'PEAR.php';
- require_once 'PHPTAL.php';
+ # PEAR and PHPTAL 1.0.x must be installed and in include_path
+}
+
+@include_once 'PEAR.php';
+if( !class_exists( 'PEAR' ) ) {
+ wfDebug( 'PHPTAL-based skin couldn\'t include PEAR.php' );
+} else {
+
+// PHPTAL may be in the libs dir direct, or under HTML/Template.
+// Try them both to be safe.
+@include_once 'HTML/Template/PHPTAL.php';
+if( !class_exists( 'PHPTAL' ) ) {
+ @include_once 'PHPTAL.php';
}
+if( !class_exists( 'PHPTAL' ) ) {
+ wfDebug( 'PHPTAL-based skin couldn\'t include PHPTAL.php' );
+} else {
+
/**
*
* @package MediaWiki
}
}
+} // end of if( class_exists( 'PHPTAL' ) )
+} // end of if( class_exists( 'PEAR' ) )
} // end of if( defined( 'MEDIAWIKI' ) )
?>
* to the computations individual esi snippets need. Most importantly no body
* parsing for most of those of course.
*
- * PHPTAL support has been moved to a subclass in SkinPHPTal.php
- * Set this in LocalSettings to enable phptal:
- * set_include_path(get_include_path() . ":" . $IP.'/PHPTAL-NP-0.7.0/libs');
- * $wgUsePHPTal = true;
+ * PHPTAL support has been moved to a subclass in SkinPHPTal.php,
+ * and is optional. You'll need to install PHPTAL manually to use
+ * skins that depend on it.
*
* @package MediaWiki
* @subpackage Skins
$wgDBpassword = $wgDBadminpassword;
-$wgUsePHPTal = false;
require_once( "Setup.php" );
require_once( "install-utils.inc" );
$wgTitle = Title::newFromText( "Command line script" );
require_once( "/home/wikipedia/common/php-new/CommonSettings.php" );
-$wgUsePHPTal = false;
-
define("MEDIAWIKI",true);
require_once( "Setup.php" );
require_once( "../install-utils.inc" );
<?php
-# Test if PHPTal is enabled. If not MediaWiki will load the 'standard' skin
-# which doesnt use PHPTal
-if ($wgUsePHPTal) {
require_once('includes/SkinPHPTal.php');
-# Your class extension is defined there.
-#
-# The class name MUST begin with 'Skin' and the rest is the name of the file
-# excluding '.php'
-# This file is named SkinPHPTal.sample (but it should end with php). So the
-# class name will be 'Skin' . 'SkinPHPTal'
-
-class SkinSkinPHPTal extends SkinPHPTal {
- function initPage( &$out ) {
- SkinPHPTal::initPage( $out );
- $this->skinname = 'name of your skin all lower case';
- $this->template = 'phptal template used do not put the .pt';
+# Test if PHPTal is enabled. If not MediaWiki will load the 'standard' skin
+# which doesnt use PHPTal
+if( class_exists( 'SkinPHPTal' ) ) {
+
+ # Your class extension is defined there.
+ #
+ # The class name MUST begin with 'Skin' and the rest is the name of the file
+ # excluding '.php'
+ # This file is named SkinPHPTal.sample (but it should end with php). So the
+ # class name will be 'Skin' . 'SkinPHPTal'
+
+ class SkinSkinPHPTal extends SkinPHPTal {
+ function initPage( &$out ) {
+ SkinPHPTal::initPage( $out );
+ $this->skinname = 'name of your skin all lower case';
+ $this->template = 'phptal template used do not put the .pt';
+ }
+
+ # Override method below
+ #
+
}
-# Override method below
-#
-
-}
-
}
?>
*/
/** */
-if ($wgUsePHPTal) {
require_once('includes/SkinPHPTal.php');
+if( class_exists( 'SkinPHPTal' ) ) {
/**
* See skin.doc
*/
/** */
-if ($wgUsePHPTal) {
require_once('includes/SkinPHPTal.php');
+if( class_exists( 'SkinPHPTal' ) ) {
/**
* See skin.doc
*/
/** */
-if( defined( 'MEDIAWIKI' ) ) {
-
-global $wgUsePHPTal;
-if ($wgUsePHPTal) {
require_once('includes/SkinPHPTal.php');
-/**
- * Inherit everything from SkinPHPTal
- * This is a dummy skin as MonoBook is the default PHPTal skin.
- * @todo document
- * @package MediaWiki
- * @subpackage Skins
- */
-class SkinMonoBookTal extends SkinPHPTal {
- /** Using monobook. */
- function initPage( &$out ) {
- SkinPHPTal::initPage( $out );
- $this->skinname = 'monobooktal';
- $this->stylename = 'monobook';
- $this->template = 'MonoBook';
+# Test if PHPTal is enabled. If not MediaWiki will load the 'standard' skin
+# which doesnt use PHPTal
+if( class_exists( 'SkinPHPTal' ) ) {
+ /**
+ * Inherit everything from SkinPHPTal
+ * This is a dummy skin as MonoBook is the default PHPTal skin.
+ * @todo document
+ * @package MediaWiki
+ * @subpackage Skins
+ */
+ class SkinMonoBookTal extends SkinPHPTal {
+ /** Using monobook. */
+ function initPage( &$out ) {
+ SkinPHPTal::initPage( $out );
+ $this->skinname = 'monobooktal';
+ $this->stylename = 'monobook';
+ $this->template = 'MonoBook';
+ }
}
-}
-
-}
}
?>
/** */
-if($wgUsePHPTal) {
require_once('includes/SkinPHPTal.php');
+if( class_exists( 'SkinPHPTal' ) ) {
$wgExtraSkins['wikimediawiki'] = 'Wikimediawiki';