<commit_before>#!/bin/bash
#
# Install MediaWiki extensions.
#

print_title "Starting script extensions.sh"


# Clone ExtensionLoader
echo -e "\n\n## Meza1: Install ExtensionLoader and apply changes to MW settings"
cd "$m_mediawiki/extensions"
git clone https://github.com/jamesmontalvo3/ExtensionLoader.git
cd ..


# Add ExtensionSettings.php (used by ExtensionLoader) from Meza1 repo
cp "$m_meza/client_files/ExtensionSettings.php" ./ExtensionSettings.php


# Install extensions and update database
echo -e "\n\n## Meza1: update/install extensions"
cmd_profile "START extension loader install"
WIKI=demo php extensions/ExtensionLoader/updateExtensions.php
cmd_profile "END extension loader install"


# Install extensions installed via Composer
echo -e "\n\n## Meza1: Install composer-supported extensions"
cmd_profile "START extensions composer require"
composer require \
	mediawiki/semantic-media-wiki:~2.0 \
	mediawiki/semantic-result-formats:~2.0 \
	mediawiki/sub-page-list:~1.1 \
	mediawiki/semantic-meeting-minutes:~0.3
cmd_profile "END extensions composer require"


echo "******* Installing VE *******"
cd "$m_mediawiki/extensions/VisualEditor"
git submodule update --init


# Install Elastica library via composer
cd "$m_mediawiki/extensions/Elastica"
composer install


#
# Install Demo MW: create wiki directory, setup basic settings, create database
#
imports_dir="new"
wiki_id="demo"
wiki_name="Demo Wiki"
source "$m_meza/client_files/create-wiki.sh"
# note: now update.php required since it's in create-wiki.sh (import-wiki.sh, more specifically)

# update database
cd "$m_mediawiki"

# Import pages required for SemanticMeetingMinutes and rebuild indices
echo -e "\n\n## Meza1: import pages for SemanticMeetingMinutes"
WIKI=demo php maintenance/importDump.php < ./extensions/SemanticMeetingMinutes/ImportFiles/import.xml
echo -e "\n\n## Meza1: rebuildrecentchanges.php"
WIKI=demo php maintenance/rebuildrecentchanges.php
echo -e "\n\n## Meza1: Extension:TitleKey rebuildTitleKeys.php"
WIKI=demo php extensions/TitleKey/rebuildTitleKeys.php

#
# Create "Admin" user on Demo Wiki
# This is sort of strange in this location, but it cannot be done much prior to
# this due to the fact that everything defined in our pre-built LocalSettings.php
# must be available prior to running any maintenance scripts. Thus, it must be
# after SMW install due to the `enableSemantics()` function in LocalSettings.php.
# Other extensions could cause similar issues, so it's best that this go after
# loading extensions.
#
cp "$m_meza/client_files/mezaCreateUser.php" /var/www/meza1/mezaCreateUser.php<commit_msg>move Demo Wiki install earlier so uploadExtensions can run<commit_after>#!/bin/bash
#
# Install MediaWiki extensions.
#

print_title "Starting script extensions.sh"


#
# Install Demo MW: create wiki directory, setup basic settings, create database
#
imports_dir="new"
wiki_id="demo"
wiki_name="Demo Wiki"
source "$m_meza/client_files/create-wiki.sh"


# Clone ExtensionLoader
echo -e "\n\n## Meza1: Install ExtensionLoader and apply changes to MW settings"
cd "$m_mediawiki/extensions"
git clone https://github.com/jamesmontalvo3/ExtensionLoader.git
cd ..


# Add ExtensionSettings.php (used by ExtensionLoader) from Meza1 repo
cp "$m_meza/client_files/ExtensionSettings.php" ./ExtensionSettings.php


# Install extensions and update database
echo -e "\n\n## Meza1: update/install extensions"
cmd_profile "START extension loader install"
WIKI=demo php extensions/ExtensionLoader/updateExtensions.php
cmd_profile "END extension loader install"


# Install extensions installed via Composer
echo -e "\n\n## Meza1: Install composer-supported extensions"
cmd_profile "START extensions composer require"
composer require \
	mediawiki/semantic-media-wiki:~2.0 \
	mediawiki/semantic-result-formats:~2.0 \
	mediawiki/sub-page-list:~1.1 \
	mediawiki/semantic-meeting-minutes:~0.3
cmd_profile "END extensions composer require"


echo "******* Installing VE *******"
cd "$m_mediawiki/extensions/VisualEditor"
git submodule update --init


# Install Elastica library via composer
cd "$m_mediawiki/extensions/Elastica"
composer install


# update database
cd "$m_mediawiki"
WIKI=demo php maintenance/update.php --quick

# Import pages required for SemanticMeetingMinutes and rebuild indices
echo -e "\n\n## Meza1: import pages for SemanticMeetingMinutes"
WIKI=demo php maintenance/importDump.php < ./extensions/SemanticMeetingMinutes/ImportFiles/import.xml
echo -e "\n\n## Meza1: rebuildrecentchanges.php"
WIKI=demo php maintenance/rebuildrecentchanges.php
echo -e "\n\n## Meza1: Extension:TitleKey rebuildTitleKeys.php"
WIKI=demo php extensions/TitleKey/rebuildTitleKeys.php

#
# Create "Admin" user on Demo Wiki
# This is sort of strange in this location, but it cannot be done much prior to
# this due to the fact that everything defined in our pre-built LocalSettings.php
# must be available prior to running any maintenance scripts. Thus, it must be
# after SMW install due to the `enableSemantics()` function in LocalSettings.php.
# Other extensions could cause similar issues, so it's best that this go after
# loading extensions.
#
cp "$m_meza/client_files/mezaCreateUser.php" /var/www/meza1/mezaCreateUser.php
{'fraction_non_alphanumeric': 0.09697201993100805, 'fraction_numerical': 0.006515906477577616, 'mean_word_length': 5.326060606060606, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7289043', 'n_tokens_mistral': 1623, 'n_tokens_neox': 1558, 'n_words': 508}