Skip to content

Commit

Permalink
Create extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Universal-Omega authored Jun 8, 2022
1 parent fd0601f commit 3afef62
Show file tree
Hide file tree
Showing 34 changed files with 10,334 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"root": true,
"extends": [
"wikimedia/client-es5",
"wikimedia/jquery",
"wikimedia/mediawiki"
],
"globals": {
"require": "readonly",
"module": "readonly"
},
"env": {
"browser": true,
"jquery": true,
"es6": true
},
"ignorePatterns": [ "vendor/**" ],
"rules": {
"one-var": "off",
"no-implicit-globals": "off",
"es/no-object-fromentries": "off",
"es/no-object-entries": "off",
"no-jquery/no-global-selector": "off",
"no-jquery/no-sizzle": "off",
"max-len": "off"
},
"parserOptions": {
"ecmaVersion": "latest"
}
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dependencies linguist-language=yaml
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "daily"
6 changes: 6 additions & 0 deletions .github/workflows/dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CreateWiki:
branch: master
repo: https://github.com/miraheze/CreateWiki
Echo:
branch: auto
repo: auto
67 changes: 67 additions & 0 deletions .github/workflows/globals.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

define( 'MW_DB', 'wikidb' );

require_once "$IP/extensions/CreateWiki/includes/WikiInitialise.php";
$wi = new WikiInitialise();

$wi->setVariables(
"$IP/cache",
[
''
],
[
'127.0.0.1' => ''
]
);

$wi->config->settings += [
'cwClosed' => [
'default' => false,
],
'cwInactive' => [
'default' => false,
],
'cwPrivate' => [
'default' => false,
],
];

$wgCreateWikiGlobalWiki = 'wikidb';
$wgCreateWikiDatabase = 'wikidb';
$wgCreateWikiCacheDirectory = "$IP/cache";

$wgHooks['MediaWikiServices'][] = 'wfOnMediaWikiServices';

function wfOnMediaWikiServices() {
try {
$dbw = wfGetDB( DB_PRIMARY );

$dbw->insert(
'cw_wikis',
[
'wiki_dbname' => 'wikidb',
'wiki_dbcluster' => 'c1',
'wiki_sitename' => 'TestWiki',
'wiki_language' => 'en',
'wiki_private' => (int)0,
'wiki_creation' => $dbw->timestamp(),
'wiki_category' => 'uncategorised',
'wiki_closed' => (int)0,
'wiki_deleted' => (int)0,
'wiki_locked' => (int)0,
'wiki_inactive' => (int)0,
'wiki_inactive_exempt' => (int)0,
'wiki_url' => 'http://127.0.0.1:9412'
],
__METHOD__,
[ 'IGNORE' ]
);
} catch ( Wikimedia\Rdbms\DBQueryError $e ) {
return;
}
}

$wi->readCache();
$wi->config->extractAllGlobals( $wi->dbname );
$wgConf = $wi->config;
Loading

0 comments on commit 3afef62

Please sign in to comment.