From: Brion Vibber Date: Fri, 19 Nov 2004 07:37:46 +0000 (+0000) Subject: * remove PHP5 warning; PHPTAL no longer needed for MonoBook X-Git-Tag: 1.5.0alpha1~1308 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=f571b7e068300906fc91f571214fe9938e179f9a;p=lhc%2Fweb%2Fwiklou.git * remove PHP5 warning; PHPTAL no longer needed for MonoBook * set $wgUsePHPTal to false; not sure if it's really needed anymore. Disabled TAL version of MonoBook * re-enabled display of PEAR errors from PHPTal skins (if they get used) --- diff --git a/config/index.php b/config/index.php index fe0ad95f2e..9a446b83f6 100644 --- a/config/index.php +++ b/config/index.php @@ -190,15 +190,7 @@ $conf = new ConfigData; install_version_checks(); -print "
  • PHP " . phpversion() . ": "; -if( version_compare( phpversion(), "5.0", "lt" ) ) { - print "ok"; -} else { - print " the MonoBook skin will be disabled due to an incompatibility - between the PHPTAL template library and PHP 5. The wiki should - function normally, but with the older look and feel."; -} -print "
  • \n"; +print "
  • PHP " . phpversion() . ": ok
  • \n"; if( ini_get( "register_globals" ) ) { ?> diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 58b6a25f8d..11c9cea97e 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -608,12 +608,16 @@ $wgSVGConverters = array( $wgSVGConverter = 'ImageMagick'; # Pick one of the above $wgSVGConverterPath = ''; # If not in the executable PATH, specify -# PHPTal is a library for page templates. MediaWiki includes -# a recent PHPTal distribution. It is required to use the -# Monobook (default) skin. +# 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. # -# Currently it does not work on PHP5. -$wgUsePHPTal = version_compare( phpversion(), "5.0", "lt" ); +# 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; diff --git a/includes/Skin.php b/includes/Skin.php index 9bb6a52001..406e83cb3c 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -14,27 +14,6 @@ if( defined( "MEDIAWIKI" ) ) { # See skin.doc require_once( 'Image.php' ); -# These are the INTERNAL names, which get mapped directly to class names and -# file names in ./skins/. For display purposes, the Language class has -# internationalized names -# -/* -$wgValidSkinNames = array( - 'standard' => 'Standard', - 'nostalgia' => 'Nostalgia', - 'cologneblue' => 'CologneBlue' -); -if( $wgUsePHPTal ) { - #$wgValidSkinNames[] = 'PHPTal'; - #$wgValidSkinNames['davinci'] = 'DaVinci'; - #$wgValidSkinNames['mono'] = 'Mono'; - #$wgValidSkinNames['monobookminimal'] = 'MonoBookMinimal'; - $wgValidSkinNames['monobook'] = 'MonoBook'; - $wgValidSkinNames['myskin'] = 'MySkin'; - $wgValidSkinNames['chick'] = 'Chick'; -} -*/ - # Get a list of all skins available in /skins/ # Build using the regular expression '^(.*).php$' # Array keys are all lower case, array value keep the case used by filename diff --git a/includes/SkinPHPTal.php b/includes/SkinPHPTal.php index 944612ef0e..082e52fc00 100644 --- a/includes/SkinPHPTal.php +++ b/includes/SkinPHPTal.php @@ -77,6 +77,21 @@ class SkinPHPTal extends SkinTemplate { return new PHPTAL( $file . '.pt', $repository, $cache_dir ); } } + + /** + * Output the string, or print error message if it's + * an error object of the appropriate type. + * + * @param mixed $str + * @access private + */ + function printOrError( &$str ) { + if( PEAR::isError( $str ) ) { + echo $str->toString(), "\n"; + } else { + echo $str; + } + } } class PHPTAL_version_bridge { diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index ae5c304c65..855ac93225 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -317,13 +317,20 @@ class SkinTemplate extends Skin { $res = $tpl->execute(); // result may be an error - #if (PEAR::isError($res)) { - # echo $res->toString(), "\n"; - #} else { - echo $res; - #} + $this->printOrError( $res ); } + + /** + * Output the string, or print error message if it's + * an error object of the appropriate type. + * + * @param mixed $str + * @access private + */ + function printOrError( &$str ) { + echo $str; + } /** * build array of urls for personal toolbar diff --git a/skins/MonoBook.pt b/skins/MonoBook.pt deleted file mode 100644 index 2614b017c4..0000000000 --- a/skins/MonoBook.pt +++ /dev/null @@ -1,139 +0,0 @@ - - - - -
    - Exciting xhtml slimfast - - - - - - - - - -
    -
    -
    - -
    -

    Leonardo da Vinci

    -
    -

    From Wikipedia, the free encyclopedia.

    -
    -
    -
    - -
    - - -
    -
    -
    -
    -
    -
    -
    Views
    - -
    -
    -
    Personal Tools
    -
    - -
    -
    - -
    -
    Navigation
    -
    - -
    -
    - - -
    -
    Language
    -
    - -
    -
    -
    -
    - -
    -
    - - diff --git a/skins/MonoBookTal.php b/skins/MonoBookTal.php deleted file mode 100644 index 7fe1eace20..0000000000 --- a/skins/MonoBookTal.php +++ /dev/null @@ -1,37 +0,0 @@ -skinname = 'monobooktal'; - $this->stylename = 'monobook'; - $this->template = 'MonoBook'; - } -} - -} - -} -?> diff --git a/skins/disabled/MonoBook.pt b/skins/disabled/MonoBook.pt new file mode 100644 index 0000000000..2614b017c4 --- /dev/null +++ b/skins/disabled/MonoBook.pt @@ -0,0 +1,139 @@ + + + + +
    + Exciting xhtml slimfast + + + + + + + + + +
    +
    +
    + +
    +

    Leonardo da Vinci

    +
    +

    From Wikipedia, the free encyclopedia.

    +
    +
    +
    + +
    + + +
    +
    +
    +
    +
    +
    +
    Views
    + +
    +
    +
    Personal Tools
    +
    + +
    +
    + +
    +
    Navigation
    +
    + +
    +
    + + +
    +
    Language
    +
    + +
    +
    +
    +
    + +
    +
    + + diff --git a/skins/disabled/MonoBookTal.php b/skins/disabled/MonoBookTal.php new file mode 100644 index 0000000000..d565122a84 --- /dev/null +++ b/skins/disabled/MonoBookTal.php @@ -0,0 +1,44 @@ +skinname = 'monobooktal'; + $this->stylename = 'monobook'; + $this->template = 'MonoBook'; + } +} + +} + +} +?>