Commit graph

118 commits

Author SHA1 Message Date
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Alexandre Emsenhuber
2c7bf8b8b8 Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: Ie95c594fcd686ef30dadc7574d3e5b47236a8638
2012-06-03 22:54:44 +02:00
Sam Reed
2ec09c5165 More return documentation 2012-02-09 21:35:05 +00:00
Chad Horohoe
9160e1edf9 Followup r93921: missed something from testing 2011-08-04 22:06:05 +00:00
Chad Horohoe
7234919fd2 Move UNORM_ related defines inside of UtfNormal. $globalScope--; 2011-08-04 21:54:45 +00:00
Sam Reed
16842c0b73 Swap else if for elseif
Trimming trailing whitespace also

Doing in 3 commits (2/3), so hopefully reviewable in CR...
2011-06-17 16:05:05 +00:00
Chad Horohoe
dc535d56f9 Followup r87468: remove refs to CleanUpTest from Makefile 2011-05-25 15:59:30 +00:00
Tim Starling
69f2c2edee Fix for HipHop breakage in r87748 etc. Please do not use require_once(dirname(__FILE__)...) to fetch class, function or define() dependencies anymore. You do not need to have HipHop to know that doing so will break it. 2011-05-15 13:36:59 +00:00
Brion Vibber
71c3ae0111 (bug 28864) Fix UtfNormal benchmark & test case runners from regression in r85327, r85944
It's possible that this has some side effect on HipHop builds -- the require_once on UtfNormalDefines.php that had been moved from UtfNormalUtil.php to MediaWiki's Setup.php in r85944 had been previously damaged by r85327 sticking a MediaWiki-specific MWInit class static method call into it, making it break on all the generator & test & benchmark code which does not depend on MediaWiki.
With the require_once restored everything seems to work, though it's possible that it ends up trying to include twice on HipHop -- have not tested.
2011-05-09 17:43:09 +00:00
Chad Horohoe
6944e56581 Move CleanUpTest, fixes in next commit 2011-05-04 23:05:25 +00:00
Alexandre Emsenhuber
4207ab0c63 * (bug 28511) Use [] syntax instead of {} for string offset access 2011-04-17 07:59:58 +00:00
Brian Wolff
5c750139a6 (follow-up r86130) the normalizer_normalize function doesn't replace things like U+0001
which causes all sorts of pain and suffering if inserted into a page.

(discovered at translatewiki)
2011-04-16 15:32:19 +00:00
Brian Wolff
a518a5081a (follow-up r69626) Make it so the intl normalizer_normalize function is not
fed an invalid sequence in UtfNormal::cleanUp

normalizer_normalize seems to return false if fed an invalid unicode sequence (Which is quite different
from what our built in normalization functions do). So use quickIsNFC if it returns false.
(Noticed when investigating bug 28541).
2011-04-15 18:39:43 +00:00
Sam Reed
d762deeb7b Related to bug 28470 (Doxygen not updating)
Move require_once( MWInit::compiledPath( 'includes/normal/UtfNormalDefines.php' ) ); to Setup.php

Might want relocating in Setup.php though
2011-04-13 13:09:17 +00:00
Tim Starling
7bb50c630a The beginnings of HipHop compiled mode support. It works now for parser cache hits.
* Work around HipHop issue 314 (volatile broken) and issue 308 (no compilation detection) by adding some large and ugly compilation detection code to WebStart.php and doMaintenance.php.
* Provide an MW_COMPILED constant which can be used to detect compiled mode throughout the codebase.
* Introduced wfIsHipHop(), which detects either compiled or interpreted mode. Used this to work around unusual eval() return value in eval.php.
* Work around lack of ini_get() in Maintenance.php, by duplicating wfIsHipHop(). 
* In Maintenance::shouldExecute(), accept "include" as an inclusion function name, since all kinds of inclusion give this string in HipHop.
* Introduced new class MWInit, which provides some static functions in the pre-autoloader environment.
* Introduced MWInit::compiledPath(), which provides a relative path for invoking a compiled file, and MWInit::interpretedPath(), which provides an absolute path for interpreting a PHP file. Used these new functions in the appropriate places.
* When we are running compiled code, don't include files which would generate duplicate class, function or constant definitions. Documented the new requirements on the contents of Defines.php and UtfNormalDefines.php.
* In HipHop compiled mode, it's not possible to have executable code in the same file as a class definition. 
  ** Moved MimeMagic initialisation to the constructor.
  ** Moved Namespace.php global variable initialisation to Setup.php.
  ** Moved MemcachedSessions.php initialisation to the caller in GlobalFunctions.php.
  ** Moved Sanitizer.php constants and global variables to static class members. Introduced an accessor function for the attribs regex, as a new place to put code formerly at file level. 
  ** Moved Language.php initialisation of $wgLanguageNames to Language::getLanguageNames(). Removed the global variable, marked "private" since forever.

* In two places: don't use error_log() with type=3 to append to a file, HipHop doesn't support it. Use file_put_contents() with FILE_APPEND instead.
* Work around the terrible breakage of class_exists() by using MWInit::classExists() instead in various places. In WebInstaller::getPageByName(), the class_exists() was marked with a fixme comment already, so I replaced it with an autoloader solution.
2011-04-04 12:59:55 +00:00
Brion Vibber
3571ccc924 Memory stress test for UtfNormal issue re bug 28146
This pulls the source texts used for the UtfNormalBench.php benchmarks, repeats them into much larger strings, and attempts to reproduce an out-of-memory error in the middle of UtfNormal::cleanUp():

$ php 
Testing testdata/washington.txt (English text)...
     quickIsNFCVerify 1078.3ms   14,969,652 bytes/s (changed)
              cleanUp  992.1ms   16,270,594 bytes/s (no change)
Testing testdata/berlin.txt (German text)...
PHP Fatal error:  Allowed memory size of 136314880 bytes exhausted (tried to allocate 71 bytes) in /var/www/trunk/includes/normal/UtfNormal.php on line 285

Exact failure point may require adjustment depending on platform, etc.
2011-04-01 21:14:52 +00:00
Happy-melon
41ca27d283 Revert r84706, r84709 (UtfNormal rewrite). Clearly more work needed to get these in line with our coding standards. 2011-03-27 12:21:45 +00:00
Happy-melon
2234489178 (bug 5303) Merge UtfNormal rewrite. Patch by Ludovic Arnaud (YuviPanda). This is well beyond my ability to review... :D 2011-03-24 20:51:38 +00:00
Niklas Laxström
7aa56cf812 * (bug 25708) Update case mappings and normalization to Unicode 6.0.0 2011-01-09 12:04:28 +00:00
Platonides
c037ae23e5 Use constants. Add spacing. 2010-11-30 23:46:14 +00:00
Antoine Musso
cfc49a6883 With PHPUnit 3.5.0, use its autoloader (like r74831).
Fix 'make test' for me.
2010-11-13 12:45:10 +00:00
Sam Reed
7a789626fd Fix minor semi colon fail from r75767 2010-11-01 00:10:00 +00:00
Sam Reed
39c005ca79 bug 25517 Assignment in conditions should be avoided/ http://www.mediawiki.org/wiki/Manual:Coding_conventions#Assignment_expressions 2010-11-01 00:07:17 +00:00
Alexandre Emsenhuber
18cbe55c7b * Standardised file description headers
* Added some descriptions
* Added @file where needed
2010-08-15 07:47:23 +00:00
Platonides
aedae942f9 From globals to parameters: $columns, $exceptions, $verbose
New line after the error messages.
2010-07-28 12:07:53 +00:00
Platonides
53d59a383c From global to parameter. 2010-07-26 21:01:34 +00:00
Platonides
4074968ddf Moved globals $utfCombiningClass, $utfCanonicalComp, $utfCanonicalDecomp, $utfCheckNFC and utfCompatibilityDecomp into UtfNormal class
Regenerated unicode tables
All tests successful
2010-07-26 12:39:44 +00:00
Platonides
e603a4cdd1 Follow up r69643. Remove unused global. 2010-07-25 18:26:44 +00:00
Mark A. Hershberger
4d94621cb4 Added an explanation for the way the code is set up. 2010-07-20 21:24:07 +00:00
Mark A. Hershberger
9a80e48394 Slightly different, but similar to brion's tests. I wrote this before I discovered brion's tests. Maybe they'll be useful to someone some day. 2010-07-20 21:17:22 +00:00
Mark A. Hershberger
104444bbb5 fixes r69333 — remove dependency on iconv, use icu or native only 2010-07-20 16:14:09 +00:00
Mark A. Hershberger
f08147c313 Prefer the intl PECL extension for ICU Unicode 2010-07-20 15:41:24 +00:00
Mark A. Hershberger
6653570e36 revert r69620 2010-07-20 15:12:29 +00:00
Mark A. Hershberger
271c363db1 Admin is required now. 2010-07-20 15:05:34 +00:00
Mark A. Hershberger
af63bc308a * revert r61258
* check if iconv extension is loaded and, if so, use it in UtfNormal::cleanUp()
2010-07-14 17:34:18 +00:00
Domas Mituzas
13f64719b7 fix include path (DifferenceEngine.php has been moved to 'diff' subdir) 2010-02-21 14:28:16 +00:00
Max Semenik
b2772915be Fixed a E_DEPRECATED 2010-02-16 19:04:09 +00:00
Chad Horohoe
a4e5e935b6 Mass convert NULL -> null. Left strings and comments alone, obviously. 2009-12-11 21:07:27 +00:00
Max Semenik
a49fee2729 * Removed remaining trailing ?> from core.
* This involved updating of autogenerated Unicode normalisation tables, which are compliant with Unicode 5.2.0 now. All normalization tests pass except for RandomTest.php which have bitrotten to its death from PHP fatals.
* Added a line about r59036 to release notes
2009-11-14 08:12:51 +00:00
Roan Kattouw
ad4a03c316 Fix up r45749: do is_string() check in the caller instead 2009-01-21 09:26:48 +00:00
Roan Kattouw
ef19b747ca Fix regression from r45749: only UTF-8 normalize strings 2009-01-15 10:26:23 +00:00
Alexandre Emsenhuber
3ad85f1a20 Fixed Doxygen warnings 2008-06-02 17:50:59 +00:00
Alexandre Emsenhuber
087a9f70c5 WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>

Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage

One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
Brion Vibber
c012a63d95 * (bug 13615) Update case mappings and normalization to Unicode 5.1.0
Note that case mappings will only be used if mbstring extension is not present.

Normalization data files updated to Unicode 5.1.0; passes the automated tests.

Seem to have long since lost the script I originally used to generate the Utf8Case.php mapping file, which appears not to have been updated since 2002 or so. :)
Made a new one and moved it into the UtfNormal sub-library.

Note a couple limitations:
* Case mapping (still) uses only the 1:1 simple mappings. Any full or locale-specific mappings are ignored.
* These case mappings are not used anyway when the PHP mbstring extension is available; mbstring's case conversion functions are used instead, with whatever version of Unicode support and whatever complex mapping support they may or may not have.
* The generated Utf8Case.php file is not used directly -- you must also regenerate the serialized version in the 'serialized' directory after updating it to a new Unicode version.
2008-05-08 06:28:50 +00:00
Brion Vibber
4b4ae60c52 A bunch of Unicode constants got moved at some point out of the Unicode normalization library into core Defines.php, breaking the data file generation & testing.
Moved them out to a separate file in the library which can be cleanly included from both places for transparent happiness.
A fresh rebuild & test of UtfNormal data via 'make test' now works fine.
2008-05-08 05:34:48 +00:00
Siebrand Mazeland
79d5225c0e * remove end of line whitespace
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +00:00
Aryeh Gregor
a15c419b3d Remove ?>'s from files. They're pointless, and just asking for people to mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) 2007-06-29 01:19:14 +00:00
Tim Starling
ed4303922f Merged filerepo-work branch:
* Added support for configuration of an arbitrary number of commons-style file repositories.
* Split Image.php into filerepo/File.php and filerepo/LocalFile.php
* Renamed Image::getImagePath() to File::getPath()
* Added initial support for timestamp-based file fetching (OldLocalFile), to be expanded upon by aaron.
* Changed the interface for Image/File object creation: use wfFindFile() or wfLocalFile() depending on semantics
* ImageGallery::add() now accepts a title object as the first parameter
* Moved file handling operations on upload from SpecialUpload to File
* Removed path-related functions from ImageFunctions.php. Removed static path accessors from File. 
* Added a Content-Disposition header to thumb.php output
* Improved thumb.php error handling
* Updated the unit test suite to kind of partially work with modern computers. RunTests.php doesn't work just yet. Fixed an actual regression that the test suite detected -- moved some defines to Defines.php where they will be loaded consistently.
2007-05-30 21:02:32 +00:00
Nick Jenkins
bd23ec29c6 Doc tweaks:
* Seems like an opportune time to introduce "@addtogroup Media" documentation tags.
* Merge "@addtogroup Metadata" (used by Exif.php) into "@addtogroup Media".
* Few more moving comment blocks to above classes.
2007-04-24 06:53:31 +00:00