Template:ExtensionInstall/th

  • ดาวน์โหลดและวางไฟล์ลงในไดเร็กทอรีที่ชื่อ ExtensionInstall ในโฟลเดอร์ extensions/ ของคุณ
    Developers and code contributors should install the extension from Git instead, using:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/ExtensionInstall
    
  • เพิ่มโค้ดต่อไปนี้ไว้ที่ด้านล่างของ LocalSettings.php ของคุณ:
    require_once "$IP/extensions/ExtensionInstall/ExtensionInstall.php";
    
  • Yes สำเร็จ – ตรวจสอบที่ Special:Version บนวิกิของคุณเพื่อตรวจการติดตั้งส่วนขยาย
Template documentation
Category:Lua-based templates

การใช้งาน

Installation instructions.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Extension name1

Set the extension name manually.

Default
The current page name without namespace prefix.
Auto value
{{ROOTPAGENAME}}
Stringoptional
Git submodulegit-submodule

Add --recurse-submodules to the git clone command

Booleanoptional
Vagrant role namevagrant

If given, shows how to install extension with the Vagrant's enable-role command

Stringoptional
Download linkdownload-link

Overwrite the download link.

Default
Link to Special:ExtensionDistributor with the extension name.
URLoptional
LocalSettings earlylocalsettingsearly

Pass custom php code that the user should include in [[LocalSettings.php]] before the extension is loaded.

Example
$wgUseAjax = true; // Must be included before the extension is loaded
Unknownoptional
LocalSettingslocalsettings

Pass custom PHP code that the user should include in [[LocalSettings.php]].

Example
$wgUseAjax = true;
Unknownoptional
Database updatedb-update

If the extension has one or more database tables that need to be created through [[update.php]], set this parameter to any value.

Default
false
Booleanoptional
Composercomposer

If the extension uses [[Composer]] to manage dependencies, set this parameter to any value.

Default
false
Booleanoptional
Custom steps 0custom-steps0

Additional steps before download, e.g. other required extensions (as an unordered "* list").

Contentoptional
Custom stepscustom-steps

Additional steps (as an unordered "* list").

Contentoptional
Supports registrationregistration

Changes the template to use <code>wfLoadExtension()</code> if it supports registration. Set to any value if the extension supports registration, or to <code>required</code> if it <em>only</em> supports registration and doesn't support the old-style of loading.

Stringoptional
No registration versionno-registration-version

The MediaWiki version for which extension registration should not be used.

Default
1.24
Unknownoptional

ตัวอย่าง

ด้านล่างนี้คือตัวอย่างวิธีใช้แม่แบบนี้:

ตัวอย่าง

{{ExtensionInstall}}
  • ดาวน์โหลดและวางไฟล์ลงในไดเร็กทอรีที่ชื่อ MyExtension ในโฟลเดอร์ extensions/ ของคุณ
    Developers and code contributors should install the extension from Git instead, using:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension
    
  • เพิ่มโค้ดต่อไปนี้ไว้ที่ด้านล่างของ LocalSettings.php ของคุณ:
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    
  • Yes สำเร็จ – ตรวจสอบที่ Special:Version บนวิกิของคุณเพื่อตรวจการติดตั้งส่วนขยาย

ชื่อ

{{ExtensionInstall|CategoryTree}}
  • ดาวน์โหลดและวางไฟล์ลงในไดเร็กทอรีที่ชื่อ CategoryTree ในโฟลเดอร์ extensions/ ของคุณ
    Developers and code contributors should install the extension from Git instead, using:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CategoryTree
    
  • เพิ่มโค้ดต่อไปนี้ไว้ที่ด้านล่างของ LocalSettings.php ของคุณ:
    require_once "$IP/extensions/CategoryTree/CategoryTree.php";
    
  • Yes สำเร็จ – ตรวจสอบที่ Special:Version บนวิกิของคุณเพื่อตรวจการติดตั้งส่วนขยาย

ลิงก์ดาวน์โหลด

{{ExtensionInstall
|download-link=[http://bits.wikimedia.org/example.zip Download]
}}
  • Download และวางไฟล์ในไดเร็กทอรีชื่อ MyExtension ในโฟลเดอร์ $ex ของคุณ
  • เพิ่มโค้ดต่อไปนี้ไว้ที่ด้านล่างของ LocalSettings.php ของคุณ:
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    
  • Yes สำเร็จ – ตรวจสอบที่ Special:Version บนวิกิของคุณเพื่อตรวจการติดตั้งส่วนขยาย

LocalSettings

{{ExtensionInstall
|localsettings=
$wgUseAjax = true;
}}
  • ดาวน์โหลดและวางไฟล์ลงในไดเร็กทอรีที่ชื่อ MyExtension ในโฟลเดอร์ extensions/ ของคุณ
    Developers and code contributors should install the extension from Git instead, using:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension
    
  • เพิ่มโค้ดต่อไปนี้ไว้ที่ด้านล่างของ LocalSettings.php ของคุณ:
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    $wgUseAjax = true;
    
  • Yes สำเร็จ – ตรวจสอบที่ Special:Version บนวิกิของคุณเพื่อตรวจการติดตั้งส่วนขยาย

LocalSettings ช่วงแรก

{{ExtensionInstall
|localsettingsearly=
$wgUseAjax = true; // This must be included before the extension is loaded
}}
  • ดาวน์โหลดและวางไฟล์ลงในไดเร็กทอรีที่ชื่อ MyExtension ในโฟลเดอร์ extensions/ ของคุณ
    Developers and code contributors should install the extension from Git instead, using:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension
    
  • เพิ่มโค้ดต่อไปนี้ไว้ที่ด้านล่างของ LocalSettings.php ของคุณ:
    $wgUseAjax = true; // This must be included before the extension is loaded
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    
  • Yes สำเร็จ – ตรวจสอบที่ Special:Version บนวิกิของคุณเพื่อตรวจการติดตั้งส่วนขยาย

การอัปเดตฐานข้อมูล

{{ExtensionInstall
|db-update=Yes
}}
  • ดาวน์โหลดและวางไฟล์ลงในไดเร็กทอรีที่ชื่อ MyExtension ในโฟลเดอร์ extensions/ ของคุณ
    Developers and code contributors should install the extension from Git instead, using:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension
    
  • เพิ่มโค้ดต่อไปนี้ไว้ที่ด้านล่างของ LocalSettings.php ของคุณ:
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    
  • รันสคริปต์อัปเดต เพื่อสร้างตารางฐานข้อมูลที่จำเป็นสำหรับส่วนขยายนี้
  • Yes สำเร็จ – ตรวจสอบที่ Special:Version บนวิกิของคุณเพื่อตรวจการติดตั้งส่วนขยาย

คอมโพเซอร์

{{ExtensionInstall
|composer=Yes
}}
  • ดาวน์โหลดและวางไฟล์ลงในไดเร็กทอรีที่ชื่อ MyExtension ในโฟลเดอร์ extensions/ ของคุณ
    Developers and code contributors should install the extension from Git instead, using:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension
    
  • เฉพาะเมื่อติดตั้งจาก Git รัน Composer เพื่อติดตั้ง PHP dependencies โดยการสร้าง composer install --no-dev ในไดเรคทอรีของส่วนขยาย (ดูที่ T173141 สำหรับการขยายความ)
  • เพิ่มโค้ดต่อไปนี้ไว้ที่ด้านล่างของ LocalSettings.php ของคุณ:
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    
  • Yes สำเร็จ – ตรวจสอบที่ Special:Version บนวิกิของคุณเพื่อตรวจการติดตั้งส่วนขยาย

ขั้นตอนแบบเลือกเอง

{{ExtensionInstall
|custom-steps=
* Lorem ipsum dolor sit amet
* Foo bar baz quux [[sandbox]]
}}
  • ดาวน์โหลดและวางไฟล์ลงในไดเร็กทอรีที่ชื่อ MyExtension ในโฟลเดอร์ extensions/ ของคุณ
    Developers and code contributors should install the extension from Git instead, using:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension
    
  • เพิ่มโค้ดต่อไปนี้ไว้ที่ด้านล่างของ LocalSettings.php ของคุณ:
    require_once "$IP/extensions/MyExtension/MyExtension.php";
    
  • Lorem ipsum dolor sit amet
  • Foo bar baz quux sandbox
  • Yes สำเร็จ – ตรวจสอบที่ Special:Version บนวิกิของคุณเพื่อตรวจการติดตั้งส่วนขยาย

การรองรับการลงทะเบียน

{{ExtensionInstall
|registration=1
}}
  • ดาวน์โหลดและวางไฟล์ลงในไดเร็กทอรีที่ชื่อ MyExtension ในโฟลเดอร์ extensions/ ของคุณ
    Developers and code contributors should install the extension from Git instead, using:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension
    
  • เพิ่มโค้ดต่อไปนี้ไว้ที่ด้านล่างของ LocalSettings.php ของคุณ:
    wfLoadExtension( 'MyExtension' );
    
  • Yes สำเร็จ – ตรวจสอบที่ Special:Version บนวิกิของคุณเพื่อตรวจการติดตั้งส่วนขยาย

Support registration with minimum version

{{ExtensionInstall
|registration=1
|no-registration-version=1.39
}}
  • ดาวน์โหลดและวางไฟล์ลงในไดเร็กทอรีที่ชื่อ MyExtension ในโฟลเดอร์ extensions/ ของคุณ
    Developers and code contributors should install the extension from Git instead, using:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension
    
  • เพิ่มโค้ดต่อไปนี้ไว้ที่ด้านล่างของ LocalSettings.php ของคุณ:
    wfLoadExtension( 'MyExtension' );
    
  • Yes สำเร็จ – ตรวจสอบที่ Special:Version บนวิกิของคุณเพื่อตรวจการติดตั้งส่วนขยาย

สำหรับมีเดียวิกิรุ่น 1.39 หรือก่อนหน้า:

ข้อมูลด้านบนมีไว้สำหรับวิธิใหม่ในการติดตั้งส่วนขยายนี้โดยใช้ wfLoadExtension() ถ้าหากต้องการติดตั้งส่วนขยายนี้ในรุ่นมีเดียวิกิของคุณ (มีเดียวิกิ 1.39 หรือก่อนหน้า) แทนการใช้ wfLoadExtension( 'MyExtension' ); คุณจะต้องใช้:

require_once "$IP/extensions/MyExtension/MyExtension.php";

This only works if the version specified is 1.35 or later, otherwise the template assumes nobody cares about ancient versions and falls back to #Require registration.

การลงทะเบียนจำเป็น

{{ExtensionInstall
|registration=required
}}
  • ดาวน์โหลดและวางไฟล์ลงในไดเร็กทอรีที่ชื่อ MyExtension ในโฟลเดอร์ extensions/ ของคุณ
    Developers and code contributors should install the extension from Git instead, using:
    cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/MyExtension
    
  • เพิ่มโค้ดต่อไปนี้ไว้ที่ด้านล่างของ LocalSettings.php ของคุณ:
    wfLoadExtension( 'MyExtension' );
    
  • Yes สำเร็จ – ตรวจสอบที่ Special:Version บนวิกิของคุณเพื่อตรวจการติดตั้งส่วนขยาย

รวมทั้งหมด

{{ExtensionInstall|Example
|download-link=[http://bits.wikimedia.org/example.zip Download]
|vagrant=example
|localsettings=
$wgUseAjax = true;

|db-update=Yes
|composer=Yes
|custom-steps=
* Lorem ipsum dolor sit amet
* Foo bar baz quux [[sandbox]]
|registration=yes
}}
  • Download และวางไฟล์ในไดเร็กทอรีชื่อ Example ในโฟลเดอร์ $ex ของคุณ
  • เฉพาะเมื่อติดตั้งจาก Git รัน Composer เพื่อติดตั้ง PHP dependencies โดยการสร้าง composer install --no-dev ในไดเรคทอรีของส่วนขยาย (ดูที่ T173141 สำหรับการขยายความ)
  • เพิ่มโค้ดต่อไปนี้ไว้ที่ด้านล่างของ LocalSettings.php ของคุณ:
    wfLoadExtension( 'Example' );
    $wgUseAjax = true;
    
  • รันสคริปต์อัปเดต เพื่อสร้างตารางฐานข้อมูลที่จำเป็นสำหรับส่วนขยายนี้
  • Lorem ipsum dolor sit amet
  • Foo bar baz quux sandbox
  • Yes สำเร็จ – ตรวจสอบที่ Special:Version บนวิกิของคุณเพื่อตรวจการติดตั้งส่วนขยาย

สำหรับมีเดียวิกิรุ่น 1.39 หรือก่อนหน้า:

ข้อมูลด้านบนมีไว้สำหรับวิธิใหม่ในการติดตั้งส่วนขยายนี้โดยใช้ wfLoadExtension() ถ้าหากต้องการติดตั้งส่วนขยายนี้ในรุ่นมีเดียวิกิของคุณ (มีเดียวิกิ 1.39 หรือก่อนหน้า) แทนการใช้ wfLoadExtension( 'Example' ); คุณจะต้องใช้:

require_once "$IP/extensions/Example/Example.php";


การติดตั้งโดยใช้ Vagrant:

  • หากคุณใช้ Vagrant สามารถติดตั้งได้โดยใช้ vagrant roles enable example --provision
Category:Template documentation pages/th Category:Installation guide templates/th
Category:Installation guide templates/th Category:Lua-based templates Category:Pages using the JsonConfig extension Category:Template documentation pages/th