Manual:$wgForeignFileRepos/es

Detalles
Propiedades requeridas para todos los repositorios:
 * class
 * El nombre de clase del repositorio. Puede venir desde el núcleo o una extensión. Las clases de repositorio de núcleo son LocalRepo, ForeignDBRepo, FSRepo y ForeignAPIRepo.


 * name
 * Un nombre único para el repositorio.

Para todos los repositorios de núcleo:
 * url
 * URL base, pública


 * thumbUrl
 * URL base de las versiones thumbnail/miniatura, si es diferente de url


 * hashLevels
 * El número de directorios nivel para la división basada en hash de archivos


 * thumbScriptUrl
 * La URL de thumb.php (opcional, no recomendado)


 * transformVia404
 * Para ignorar la transformación del archivo en parse y en vez de eso usar un manipulador de 404s.


 * initialCapital
 * Equivalente a $wgCapitalLinks, determina si los nombres de archivo empiezan implícitamente con una letra capital o no. La implementación actual puede dar enlaces a páginas de descripción incorrectos cuando $wgCapitalLinks e initialCapital se encuentran mal configurados localmente.


 * pathDisclosureProtection
 * Puede usarse 'paranoid' para remover todos los parámetros de los mensajes de error, 'none' para dejar los directorios sin cambiar, o 'simple' para reemplazar los directorios con marcadores de posición (ó "placeholders"). El valor por defecto de LocalRepo es 'simple'.


 * descBaseUrl
 * URL de las páginas de descripción, ejemplo: http://en.wikipedia.org/wiki/Image:


 * scriptDirUrl
 * URL de la instalación MediaWiki, equivalente a $wgScriptPath, ejemplo: http://en.wikipedia.org/w


 * articleUrl
 * Equivalente a $wgArticlePath, ejemplo: http://en.wikipedia.org/wiki/$1


 * fetchDescription
 * Fetch the text of the remote file description page. Equivalent to $wgFetchCommonsDescriptions.


 * descriptionCacheExpiry
 * If set to 0, no caching will be used. Set to 1 or more (seconds) to define how long the local cache of description pages will last. Must set fetchDescription to true to use.

ForeignAPIRepo class:
 * apibase
 * The base URL for the remote repository's API (eg: http://commons.wikimedia.org/w/api.php). Only used for ForeignAPIRepo.


 * apiThumbCacheExpiry
 * How long to cache thumbs locally for. Not setting this or setting to 0 disables local thumb caching

ForeignDBRepo class:
 * dbType, dbServer, dbUser, dbPassword, dbName, dbFlags
 * equivalent to the corresponding member of $wgDBservers


 * tablePrefix
 * Table prefix, the foreign wiki's $wgDBprefix


 * hasSharedCache
 * True if the wiki's shared cache is accessible via the local $wgMemc

Default Value (code in Setup.php) :

Directory permissions
You'll need rw on  and   for whatever user php runs as.

Using files from Wikimedia Commons : ForeignAPIRepo

 * Since 1.16.0 there is a more convenient shorthand to use Commons as a foreign repository: $wgUseInstantCommons.

You can set your wiki to use media from Wikimedia Commons (or from any other MediaWiki-powered site, see below) directly. However, please beware any legal implications.

To use this, you need:
 * MediaWiki 1.13 or later
 * PHP with JSON support (for the  function). JSON is enabled by default since PHP 5.2.0, you'll need the PECL extension for older versions. Since MediaWiki 1.16, this is no longer necessary; v. 1.16 will use custom (and slower) code if JSON is not available.
 * The remote wiki must also use MediaWiki 1.13 or later; otherwise its  returns   and file requests fail silently (i.e. the requested files are just treated as non-existent).

The code below enables media files from Wikimedia Commons on your site. You should place it to localsettings.php.

To pull images from another Wikimedia project, set apibase to something like  http://en.wikipedia.org/w/api.php .

To embed an image in your installation, simply use  .

You may need to configure the $wgMainCacheType as well. Default it is set to CACHE_NONE, meaning it will load the image from the remote host on each page load.

Using files from a database that you can access : ForeignDBRepo
The ForeignDBRepo class is very useful for creating wiki families. In a wiki family, each wiki will have its own database or table prefix. Using this class, you can make a family member aware of the tables of another family member. Access through ForeignDBRepo is faster than through ForeignAPIRepo. This code should be deployed to localsettings.php.

Using files from a local folder : FSRepo
You can set your wiki to use media from a single folder. This is just a demonstration feature at present, and will probably be too slow for busy wikis or slow servers due to the lack of caching. This code should be deployed to localsettings.php.

The below code enabled media files from it: