This repository has been archived on 2024-03-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
GitSnax/GitSnax.php
2024-03-20 09:26:54 -05:00

59 lines
1.9 KiB
PHP

<?php
/**
* GitSnax - embed raw code and/or gist from github.com
*
* @section LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
*
* @file
* @ingroup Extensions
* @author Troy Engel
* @license GNU GPL v2+
*/
// Ensure we're inside MW
if ( !defined( 'MEDIAWIKI' ) ) {
die( 'Not an entry point.' );
}
// Credits et. al
$wgExtensionCredits['parserhook'][] = array(
'path' => __FILE__,
'name' => 'GitSnax',
'author' => array( 'Troy Engel' ),
'url' => 'https://github.com/troyengel/GitSnax',
'descriptionmsg' => 'gitsnax-desc',
'version' => '0.1.1',
);
// Load the extension body to call the static function in the hook
$wgAutoloadClasses['GitSnaxHooks'] = __DIR__ . '/GitSnax.body.php';
// The function that will initialize the parser function
$wgHooks['ParserFirstCallInit'][] = 'GitSnaxHooks::setupGitSnax';
// i18n
$wgMessagesDirs['GitSnax'] = __DIR__ . '/i18n';
$wgExtensionMessagesFiles['GitSnax'] = __DIR__ . '/GitSnax.i18n.php';
$wgExtensionMessagesFiles['GitSnaxMagic'] = __DIR__ .
'/GitSnax.i18n.magic.php';
// Change these in LocalSettings.php for a private instance
$wgGitSnaxCode = 'https://raw.githubusercontent.com/';
$wgGitSnaxGist = 'https://gist.githubusercontent.com/';
$wgGitSnaxCTTL = 60;