<commit_before>#!/bin/bash
# (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
#
# All Rights Reserved. See copyright.txt for details and a complete list of authors.
# Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
# $Id: update.dogfoodserver.sh 41172 2012-04-29 15:25:16Z changi67 $

# TODO: Handle local file gal and wiki_up
# TODO: update to using new Console commands

#Production
DOCROOTOLDVERSION="public_html/8x"
DOCROOTDOGFOODVERSION="publib_html/9x"

OLDMYSQLDB="changi_8x"
DOGFOODMYSQLDB="changi_9x"
#Be careful, this user need to have the right to drop the database.
MYSQLUSER="changi"
MYSQLPASS="<PASSWORD>"
MYSQLCOMMAND="mysql -u $MYSQLUSER -p$MYSQLPASS"
MYSQLDUMPCOMMAND="mysqldump -u $MYSQLUSER -p$MYSQLPASS"

pushd $DOCROOTDOGFOODVERSION
echo "Update checkout"
rm -rf templates_c/*.tpl.php
rm -rf temp/cache/*
rm -rf temp/public/minified*

bash doc/devtools/svnup.sh
echo "Fix permission"
bash setup.sh mixed
echo "Drop and recreate database"
$MYSQLCOMMAND -e "drop database $DOGFOODMYSQLDB;create database $DOGFOODMYSQLDB"
echo "Populate $DOGFOODMYSQLDB with $OLDMYSQLDB data"
$MYSQLDUMPCOMMAND --single-transaction $OLDMYSQLDB | $MYSQLCOMMAND $DOGFOODMYSQLDB
echo "Upgrade schema"
php console.php -n database:update
echo "Update search index"
php console.php -n index:rebuild
echo "Update memcache prefix"
$MYSQLCOMMAND $DOGFOODMYSQLDB -e "update tiki_preferences set value = \"DOGFOODtiki_\" where name = \"memcache_prefix\";"
echo "Remove cdn"
$MYSQLCOMMAND $DOGFOODMYSQLDB -e "update tiki_preferences set value = \"\" where name = \"tiki_cdn\";"
echo "Upgrading HTACCESS"
rm .htaccess
sh htaccess.sh on
popd
<commit_msg>Use console.php to clear cache in update.dogfoodserver.sh<commit_after>#!/bin/bash
# (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
#
# All Rights Reserved. See copyright.txt for details and a complete list of authors.
# Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
# $Id: update.dogfoodserver.sh 41172 2012-04-29 15:25:16Z changi67 $

# TODO: Handle local file gal and wiki_up
# TODO: update to using new Console commands

#Production
DOCROOTOLDVERSION="public_html/8x"
DOCROOTDOGFOODVERSION="publib_html/9x"

OLDMYSQLDB="changi_8x"
DOGFOODMYSQLDB="changi_9x"
#Be careful, this user need to have the right to drop the database.
MYSQLUSER="changi"
MYSQLPASS="<PASSWORD>"
MYSQLCOMMAND="mysql -u $MYSQLUSER -p$MYSQLPASS"
MYSQLDUMPCOMMAND="mysqldump -u $MYSQLUSER -p$MYSQLPASS"

pushd $DOCROOTDOGFOODVERSION
echo "Clear cache"
php console.php -n cache:clear
echo "Update checkout"
bash doc/devtools/svnup.sh
echo "Fix permission"
bash setup.sh mixed
echo "Drop and recreate database"
$MYSQLCOMMAND -e "drop database $DOGFOODMYSQLDB;create database $DOGFOODMYSQLDB"
echo "Populate $DOGFOODMYSQLDB with $OLDMYSQLDB data"
$MYSQLDUMPCOMMAND --single-transaction $OLDMYSQLDB | $MYSQLCOMMAND $DOGFOODMYSQLDB
echo "Upgrade schema"
php console.php -n database:update
echo "Update search index"
php console.php -n index:rebuild
echo "Update memcache prefix"
$MYSQLCOMMAND $DOGFOODMYSQLDB -e "update tiki_preferences set value = \"DOGFOODtiki_\" where name = \"memcache_prefix\";"
echo "Remove cdn"
$MYSQLCOMMAND $DOGFOODMYSQLDB -e "update tiki_preferences set value = \"\" where name = \"tiki_cdn\";"
echo "Upgrading HTACCESS"
rm .htaccess
sh htaccess.sh on
popd

{'fraction_non_alphanumeric': 0.09628328943517706, 'fraction_numerical': 0.019315188762071993, 'mean_word_length': 5.688845401174168, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1992319', 'n_tokens_mistral': 1263, 'n_tokens_neox': 1239, 'n_words': 370}