* Add ".deps.php" include-file preloaders for some dynamically-loaded
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 17 Jan 2006 23:43:15 +0000 (23:43 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 17 Jan 2006 23:43:15 +0000 (23:43 +0000)
  language and skin classes. Should help with the broken base-class
  problem under PHP 5 with APC as opcode cache. See details:
  http://mail.wikipedia.org/pipermail/wikitech-l/2006-January/033660.html

33 files changed:
RELEASE-NOTES
includes/Setup.php
includes/Skin.php
languages/Language.php
languages/LanguageAb.deps.php [new file with mode: 0644]
languages/LanguageAv.deps.php [new file with mode: 0644]
languages/LanguageAy.deps.php [new file with mode: 0644]
languages/LanguageBa.deps.php [new file with mode: 0644]
languages/LanguageBm.deps.php [new file with mode: 0644]
languages/LanguageCe.deps.php [new file with mode: 0644]
languages/LanguageCv.deps.php [new file with mode: 0644]
languages/LanguageGem_alsatian.deps.php [new file with mode: 0644]
languages/LanguageGn.deps.php [new file with mode: 0644]
languages/LanguageIi.deps.php [new file with mode: 0644]
languages/LanguageKv.deps.php [new file with mode: 0644]
languages/LanguageNah.deps.php [new file with mode: 0644]
languages/LanguageNap.deps.php [new file with mode: 0644]
languages/LanguageNon.deps.php [new file with mode: 0644]
languages/LanguageOs.deps.php [new file with mode: 0644]
languages/LanguagePt_br.deps.php [new file with mode: 0644]
languages/LanguageQu.deps.php [new file with mode: 0644]
languages/LanguageTy.deps.php [new file with mode: 0644]
languages/LanguageUdm.deps.php [new file with mode: 0644]
languages/LanguageVec.deps.php [new file with mode: 0644]
languages/LanguageZa.deps.php [new file with mode: 0644]
languages/LanguageZh.deps.php [new file with mode: 0644]
languages/LanguageZh_hk.deps.php [new file with mode: 0644]
languages/LanguageZh_sg.deps.php [new file with mode: 0644]
languages/LanguageZh_tw.deps.php [new file with mode: 0644]
skins/Chick.deps.php [new file with mode: 0644]
skins/MonoBook.deps.php [new file with mode: 0644]
skins/MySkin.deps.php [new file with mode: 0644]
skins/Simple.deps.php [new file with mode: 0644]

index 6542a4e..99a10d6 100644 (file)
@@ -536,6 +536,10 @@ fully support the editing toolbar, but was found to be too confusing.
 * (bug 3350) Missing label for move talk page checkbox.
 * (bug 2108) Sort entries when using category browser
 * (bug 2393) Fix MIME type for Atom feeds ( application/rss+atom )
+* Add ".deps.php" include-file preloaders for some dynamically-loaded
+  language and skin classes. Should help with the broken base-class
+  problem under PHP 5 with APC as opcode cache. See details:
+  http://mail.wikipedia.org/pipermail/wikitech-l/2006-January/033660.html
 
 
 === Caveats ===
index d84ec66..fe4ce1e 100644 (file)
@@ -241,6 +241,8 @@ if( $wgLangClass == $wgContLangClass ) {
        $wgLang = &$wgContLang;
 } else {
        wfSuppressWarnings();
+       // Preload base classes to work around APC/PHP5 bug
+       include_once("$IP/languages/$wgLangClass.deps.php");
        include_once("$IP/languages/$wgLangClass.php");
        wfRestoreWarnings();
 
index f5c2f80..09f39e4 100644 (file)
@@ -21,7 +21,8 @@ $skinDir = dir($IP.'/skins');
 
 # while code from www.php.net
 while (false !== ($file = $skinDir->read())) {
-       if(preg_match('/^([^.].*)\.php$/',$file, $matches)) {
+       // Skip non-PHP files, hidden files, and '.dep' includes
+       if(preg_match('/^([^.]*)\.php$/',$file, $matches)) {
                $aSkin = $matches[1];
                $wgValidSkinNames[strtolower($aSkin)] = $aSkin;
        }
@@ -115,6 +116,10 @@ class Skin extends Linker {
 
                # Grab the skin class and initialise it. Each skin checks for PHPTal
                # and will not load if it's not enabled.
+               wfSuppressWarnings();
+               // Preload base classes to work around APC/PHP5 bug
+               include_once( $IP.'/skins/'.$skinName.'.deps.php' );
+               wfRestoreWarnings();
                require_once( $IP.'/skins/'.$skinName.'.php' );
 
                # Check if we got if not failback to default skin
index f509a77..ec670f5 100644 (file)
@@ -3054,8 +3054,14 @@ class Language {
 
 }
 
+# FIXME: Merge all UTF-8 support code into Language base class.
+# We no longer support Latin-1 charset.
+require_once( 'LanguageUtf8.php' );
+
 # This should fail gracefully if there's not a localization available
 wfSuppressWarnings();
+// Preload base classes to work around APC/PHP5 bug
+include_once( 'Language' . str_replace( '-', '_', ucfirst( $wgLanguageCode ) ) . '.deps.php' );
 include_once( 'Language' . str_replace( '-', '_', ucfirst( $wgLanguageCode ) ) . '.php' );
 wfRestoreWarnings();
 
diff --git a/languages/LanguageAb.deps.php b/languages/LanguageAb.deps.php
new file mode 100644 (file)
index 0000000..e08bfc2
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageAb.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageRu.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageAv.deps.php b/languages/LanguageAv.deps.php
new file mode 100644 (file)
index 0000000..c9a6d35
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageAv.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageRu.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageAy.deps.php b/languages/LanguageAy.deps.php
new file mode 100644 (file)
index 0000000..3f2d8c2
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageAy.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageEs.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageBa.deps.php b/languages/LanguageBa.deps.php
new file mode 100644 (file)
index 0000000..b694940
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageBa.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageRu.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageBm.deps.php b/languages/LanguageBm.deps.php
new file mode 100644 (file)
index 0000000..40d5b35
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageBm.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageFr.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageCe.deps.php b/languages/LanguageCe.deps.php
new file mode 100644 (file)
index 0000000..08b934b
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageCe.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageRu.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageCv.deps.php b/languages/LanguageCv.deps.php
new file mode 100644 (file)
index 0000000..3b548b2
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageCv.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageRu.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageGem_alsatian.deps.php b/languages/LanguageGem_alsatian.deps.php
new file mode 100644 (file)
index 0000000..e1e2b98
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageGem_alsatian.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageDe.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageGn.deps.php b/languages/LanguageGn.deps.php
new file mode 100644 (file)
index 0000000..1976ebb
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageGn.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageEs.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageIi.deps.php b/languages/LanguageIi.deps.php
new file mode 100644 (file)
index 0000000..8fb9cfb
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageIi.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageZh_cn.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageKv.deps.php b/languages/LanguageKv.deps.php
new file mode 100644 (file)
index 0000000..8f82de3
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageKv.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageRu.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageNah.deps.php b/languages/LanguageNah.deps.php
new file mode 100644 (file)
index 0000000..cbad90b
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageNah.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageEs.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageNap.deps.php b/languages/LanguageNap.deps.php
new file mode 100644 (file)
index 0000000..e8cfeae
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageNap.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageIt.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageNon.deps.php b/languages/LanguageNon.deps.php
new file mode 100644 (file)
index 0000000..31a5255
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageNon.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageIs.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageOs.deps.php b/languages/LanguageOs.deps.php
new file mode 100644 (file)
index 0000000..8cd42d8
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageOs.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageRu.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguagePt_br.deps.php b/languages/LanguagePt_br.deps.php
new file mode 100644 (file)
index 0000000..f5d738a
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguagePt_br.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguagePt.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageQu.deps.php b/languages/LanguageQu.deps.php
new file mode 100644 (file)
index 0000000..0a9f460
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageQu.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageEs.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageTy.deps.php b/languages/LanguageTy.deps.php
new file mode 100644 (file)
index 0000000..cdafb29
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageTy.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageFr.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageUdm.deps.php b/languages/LanguageUdm.deps.php
new file mode 100644 (file)
index 0000000..e8cbcab
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageUdm.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageRu.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageVec.deps.php b/languages/LanguageVec.deps.php
new file mode 100644 (file)
index 0000000..89c063f
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageVec.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageIt.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageZa.deps.php b/languages/LanguageZa.deps.php
new file mode 100644 (file)
index 0000000..01c3bb7
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageZa.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageZh_cn.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageZh.deps.php b/languages/LanguageZh.deps.php
new file mode 100644 (file)
index 0000000..593e875
--- /dev/null
@@ -0,0 +1,9 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageZh.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageZh_cn.php" );
+require_once( "LanguageConverter.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageZh_hk.deps.php b/languages/LanguageZh_hk.deps.php
new file mode 100644 (file)
index 0000000..2c08455
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageZh_hk.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageZh_tw.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageZh_sg.deps.php b/languages/LanguageZh_sg.deps.php
new file mode 100644 (file)
index 0000000..4da7862
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageZh_sg.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageZh_cn.php" );
+?>
\ No newline at end of file
diff --git a/languages/LanguageZh_tw.deps.php b/languages/LanguageZh_tw.deps.php
new file mode 100644 (file)
index 0000000..a793784
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// LanguageZh_tw.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once( "LanguageZh_cn.php" );
+?>
\ No newline at end of file
diff --git a/skins/Chick.deps.php b/skins/Chick.deps.php
new file mode 100644 (file)
index 0000000..65f3a1f
--- /dev/null
@@ -0,0 +1,9 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// Chick.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once('includes/SkinTemplate.php');
+require_once('MonoBook.php');
+?>
\ No newline at end of file
diff --git a/skins/MonoBook.deps.php b/skins/MonoBook.deps.php
new file mode 100644 (file)
index 0000000..0efe121
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// MonoBook.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once('includes/SkinTemplate.php');
+?>
\ No newline at end of file
diff --git a/skins/MySkin.deps.php b/skins/MySkin.deps.php
new file mode 100644 (file)
index 0000000..b46c902
--- /dev/null
@@ -0,0 +1,9 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// MySkin.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once('includes/SkinTemplate.php');
+require_once('MonoBook.php');
+?>
\ No newline at end of file
diff --git a/skins/Simple.deps.php b/skins/Simple.deps.php
new file mode 100644 (file)
index 0000000..71a411d
--- /dev/null
@@ -0,0 +1,9 @@
+<?php
+// This file exists to ensure that base classes are preloaded before
+// Simple.php is compiled, working around a bug in the APC opcode
+// cache on PHP 5, where cached code can break if the include order
+// changed on a subsequent page view.
+
+require_once('includes/SkinTemplate.php');
+require_once('MonoBook.php');
+?>
\ No newline at end of file