Fixed setup issues
authorMarcel Werk <burntime@woltlab.com>
Mon, 20 May 2013 23:52:41 +0000 (01:52 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 20 May 2013 23:52:41 +0000 (01:52 +0200)
com.woltlab.wcf/package.xml
wcfsetup/install/files/acp/install.php
wcfsetup/install/files/acp/post_install.php [new file with mode: 0644]

index 90a5376580bf8d25eddf1182c9b9508a3dcad115..3a78d36850d99a8b35f4d06049a29375cb7792f0 100644 (file)
@@ -38,7 +38,8 @@
                <instruction type="userProfileMenu">userProfileMenu.xml</instruction>
                <instruction type="userMenu">userMenu.xml</instruction>
                <instruction type="userNotificationEvent">userNotificationEvent.xml</instruction>
-               <instruction type="aclOption">aclOption.xml</instruction> 
+               <instruction type="aclOption">aclOption.xml</instruction>
+               <instruction type="script">acp/post_install.php</instruction> 
        </instructions>
        
        <instructions type="update" fromversion="2.0.0 Alpha 1">
index 014cc8cad29760bf036a487f933e393ea25110bd..1049927ab94fab15592be102eb1c3542f9502978 100644 (file)
@@ -1,10 +1,6 @@
 <?php
-namespace wcf\acp;
 use wcf\data\language\LanguageEditor;
-use wcf\data\user\UserEditor;
-use wcf\data\user\UserProfileAction;
 use wcf\system\cache\CacheHandler;
-use wcf\system\dashboard\DashboardHandler;
 use wcf\system\session\SessionHandler;
 use wcf\system\template\ACPTemplateEngine;
 use wcf\system\WCF;
@@ -61,15 +57,6 @@ $sql = "UPDATE       wcf".WCF_N."_user_group_option
 $statement = WCF::getDB()->prepareStatement($sql);
 $statement->execute(array(1));
 
-// reset all caches
-CacheHandler::getInstance()->flushAll();
-
-// delete language files
-LanguageEditor::deleteLanguageFiles();
-
-// delete all compiled templates
-ACPTemplateEngine::deleteCompiledTemplates(WCF_DIR.'acp/templates/compiled/');
-
 // get server timezone
 if ($timezone = @date_default_timezone_get()) {
        if ($timezone != 'Europe/London' && in_array($timezone, DateUtil::getAvailableTimezones())) {
@@ -81,23 +68,4 @@ if ($timezone = @date_default_timezone_get()) {
        }
 }
 
-// set dashboard default values
-DashboardHandler::setDefaultValues('com.woltlab.wcf.user.DashboardPage', array(
-       // content
-       'com.woltlab.wcf.user.recentActivity' => 1,
-       // sidebar
-       'com.woltlab.wcf.user.registerButton' => 1,
-       'com.woltlab.wcf.user.signedInAs' => 2,
-       'com.woltlab.wcf.user.statsSidebar' => 3
-));
-DashboardHandler::setDefaultValues('com.woltlab.wcf.user.MembersListPage', array(
-       'com.woltlab.wcf.user.newestMembers' => 1,
-       'com.woltlab.wcf.user.mostActiveMembers' => 2
-));
 
-// update administrator user rank and user online marking
-$editor = new UserEditor(WCF::getUser());
-$action = new UserProfileAction(array($editor), 'updateUserRank');
-$action->executeAction();
-$action = new UserProfileAction(array($editor), 'updateUserOnlineMarking');
-$action->executeAction();
diff --git a/wcfsetup/install/files/acp/post_install.php b/wcfsetup/install/files/acp/post_install.php
new file mode 100644 (file)
index 0000000..442713f
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+use wcf\data\user\UserEditor;
+use wcf\data\user\UserProfileAction;
+use wcf\system\dashboard\DashboardHandler;
+use wcf\system\WCF;
+
+// set dashboard default values
+DashboardHandler::setDefaultValues('com.woltlab.wcf.user.DashboardPage', array(
+// content
+'com.woltlab.wcf.user.recentActivity' => 1,
+// sidebar
+'com.woltlab.wcf.user.registerButton' => 1,
+'com.woltlab.wcf.user.signedInAs' => 2,
+'com.woltlab.wcf.user.statsSidebar' => 3
+));
+DashboardHandler::setDefaultValues('com.woltlab.wcf.user.MembersListPage', array(
+'com.woltlab.wcf.user.newestMembers' => 1,
+'com.woltlab.wcf.user.mostActiveMembers' => 2
+));
+
+// update administrator user rank and user online marking
+$editor = new UserEditor(WCF::getUser());
+$action = new UserProfileAction(array($editor), 'updateUserRank');
+$action->executeAction();
+$action = new UserProfileAction(array($editor), 'updateUserOnlineMarking');
+$action->executeAction();