Commit graph

15 commits

Author SHA1 Message Date
Umherirrender
9879723ef3 Use namespaced classes (1)
Changes to the use statements done automatically via script
Addition of missing use statement done manually

Change-Id: Ic4d4dd61de5ab896fb6173eb579c81f164a1e4a3
2024-06-16 20:18:23 +02:00
daniel
9638fa314a Introduce entry point classes for media files.
This moves a code out of file scope into classes to make it
testable. The code is left in the same structure as it was before,
global functions have been converted into methods on the new
ThumbnailEntryPoint and Thumbnail404EntryPoint classes.

This test introduces comprehensive phpunit tests covering all functional
code paths in ThumbnailEntryPoint. This is intended to support
refactoring of this code.

Change-Id: I459abc7b11d0ab4ee682a863c9525a945048296f
2024-03-30 21:14:05 +01:00
Timo Tijhof
8f6b0723af docs: Improve entry point documentation
* Unlink the word "Action" in api.php description, which was unhelpfully
  being autolinked to the index.php Action baseclass.

* Add links in the first sentence to the primary classes involved in
  their handling so that the "Entry points" overview page includes
  these links (subsequent sentence/paragraphs require an additional
  click).

Change-Id: Ibe882746ea7753d5d4c90a04f6974ea807122d1c
2020-07-02 02:07:25 +00:00
Timo Tijhof
7639aa869a docs: Add api.php to "API" doc group
Follow-up bc1f601382, which added a group to load.php, but I forgot
to add api.php to its group.

Also, fix the pre-existing group that thumb.php and thumb_handler.php
were a part of. It looks like the entire "Media" group was not
defined anywhere, so it was ignored by Doxygen. This is now fixed.

Change-Id: Iba487aac5883f66b81f2496a38a3c978d5e6600b
2020-02-05 22:53:25 +00:00
Timo Tijhof
bc1f601382 docs: Improve "Entry points" documentation page
Turn this into a doc group, and let the descriptions come
directly from the files in question. This makes the list easier
to maintain, and alsom means that the overview page becomes
discoverable whenever one is looking at the entry point file
as well. Previously the doc page pointed to the entry points,
but not the other way around. This is also fixed.

Bug: T244294
Change-Id: I891c5a37e17592edc1136d7367949927121c8bc8
2020-02-04 21:44:38 +00:00
Tim Starling
b7ce7aacb0 Add MW_REST_API and MW_ENTRY_POINT
Define the global constant MW_REST_API in rest.php, by analogy with
MW_API. Also generalize this by adding MW_ENTRY_POINT, which contains
the entry script name, "cli" or "unknown". This allows tests such as

  if ( MW_ENTRY_POINT !== 'index' )

which is probably what is really intended by defined('MW_API') in many
cases.

Change-Id: I24099f4cdd170de17afd6e1bbad67c9b204071fc
2019-09-03 11:43:18 +10:00
Waldir Pimenta
86a9b8c06c Clean up access points
* Harmonize spacing
* Use // for comments rather than #
* Harmonize call style for 'require', 'include' etc.
* Add missing profileinfo.php5
* Use "./" for path to api.php in api.php5 (to match other php5 files).
* Move documentation related to Setup.php from index.php to WebStart.php
* Remove "Initialise common code." comment in api.php (was already remove
  in most entry points)

Change-Id: I8dc4a79fd13cee49e34f250a4039b3666bd42aca
2014-03-28 01:05:30 +00:00
Timo Tijhof
beb1c4a0ec phpcs: More require/include is not a function
Follows-up I1343872de7, Ia533aedf63 and I2df2f80b81.

Also updated usage in text in documentation and the
installer LocalSettingsGenerator.

Most of them were handled by this regex:
- find: (require|include|require_once|include_once)\s*\(\s*(.+?)\s*\)\s*;$
- replace: $1 $2;

Change-Id: I6b38aad9a5149c9c43ce18bd8edbab14b8ce43fa
2013-05-21 23:26:28 +02:00
jeroendedauw
38c7f444e1 Use __DIR__ instead of dirname( __FILE__ )
We can now do this since we finally switched to PHP 5.3 for MW 1.20 and get rid of the silly dirname(__FILE__) stuff :)

Change-Id: Id9b2c9cd2e678197aa81c78adced5d1d31ff57b1
2012-08-27 21:45:00 +02:00
Alexandre Emsenhuber
f27ff698fb Added missing GPLv2 headers in some places.
Also made file documentation more consistent.

Change-Id: I30e124514396f110a572467b94ca06cefd5f7b46
2012-05-23 13:41:30 +02:00
Aaron Schulz
056651c3f0 FU r105512: just always use thumb.php style errors 2011-12-08 04:58:26 +00:00
Aaron Schulz
dcbe8e7dd3 FU r101117: removed cURL thumb handler code and made thumb_handler.php a thin wrapper around thumb.php
* Moved original URL fetching code and parameter extraction code to thumb.php
* Made use of local repo URL and hash settings to avoid extra config code
* This makes it easy to add hooks for extensions/config to alter behavoir (ExtractThumbParameters hook added)
* Added FileRepo::getHashLevels()
2011-12-08 03:43:07 +00:00
Aaron Schulz
87382f3380 FU r101117:
* Moved 'checkCache' callback to cURL function as the 'fillCache' function is only ever called from that function
2011-10-28 19:50:25 +00:00
Aaron Schulz
3a6b5d6005 FU r100535:
* Thumb handler can now also work without cURL
* Combined related config vars into array config vars
* Folded $thgThumb404File into $thgThumbCallbacks
* Avoided some global pollution
2011-10-28 05:12:12 +00:00
Aaron Schulz
3dbb621c58 FU r100535: renamed thumb-handler.php to match the other files here 2011-10-27 22:42:53 +00:00
Renamed from thumb-handler.php (Browse further)