From 9fe063022e08a4b6fa5f5935f8f185d5d95814a4 Mon Sep 17 00:00:00 2001 From: Sem Date: Wed, 25 Apr 2012 19:09:22 +0200 Subject: Upgraded to Elgg 1.8.4. --- install/ElggInstaller.php | 58 +++++++++++++++++++++++++++++++---------------- install/languages/en.php | 6 ++++- 2 files changed, 43 insertions(+), 21 deletions(-) (limited to 'install') diff --git a/install/ElggInstaller.php b/install/ElggInstaller.php index 2070f15e9..03c84a43e 100644 --- a/install/ElggInstaller.php +++ b/install/ElggInstaller.php @@ -391,7 +391,7 @@ class ElggInstaller { $formVars = array( 'sitename' => array( 'type' => 'text', - 'value' => 'New Elgg site', + 'value' => 'My New Community', 'required' => TRUE, ), 'siteemail' => array( @@ -535,8 +535,6 @@ class ElggInstaller { $params['destination'] = 'index.php'; } - elgg_invalidate_simplecache(); - $this->render('complete', $params); } @@ -754,6 +752,7 @@ class ElggInstaller { protected function finishBootstraping($step) { $dbIndex = array_search('database', $this->getSteps()); + $settingsIndex = array_search('settings', $this->getSteps()); $adminIndex = array_search('admin', $this->getSteps()); $completeIndex = array_search('complete', $this->getSteps()); $stepIndex = array_search($step, $this->getSteps()); @@ -780,7 +779,7 @@ class ElggInstaller { 'database.php', 'actions.php', 'admin.php', 'annotations.php', - 'cron.php', 'entities.php', + 'calendar.php', 'cron.php', 'entities.php', 'extender.php', 'filestore.php', 'group.php', 'location.php', 'mb_wrapper.php', 'memcache.php', 'metadata.php', 'metastrings.php', @@ -790,8 +789,8 @@ class ElggInstaller { 'private_settings.php', 'relationships.php', 'river.php', 'sites.php', 'statistics.php', 'tags.php', 'user_settings.php', 'users.php', 'upgrade.php', 'web_services.php', - 'widgets.php', 'xml.php', 'deprecated-1.7.php', - 'deprecated-1.8.php', 'deprecated-1.9.php' + 'widgets.php', 'xml.php', 'xml-rpc.php', + 'deprecated-1.7.php', 'deprecated-1.8.php', ); foreach ($lib_files as $file) { @@ -802,9 +801,17 @@ class ElggInstaller { } } - set_default_config(); + setup_db_connections(); + register_translations(dirname(dirname(__FILE__)) . "/languages/"); + + if ($stepIndex > $settingsIndex) { + $CONFIG->site_guid = (int) datalist_get('default_site'); + $CONFIG->site_id = $CONFIG->site_guid; + $CONFIG->site = get_entity($CONFIG->site_guid); + $CONFIG->dataroot = datalist_get('dataroot'); + _elgg_session_boot(NULL, NULL, NULL); + } - elgg_trigger_event('boot', 'system'); elgg_trigger_event('init', 'system'); } } @@ -823,8 +830,10 @@ class ElggInstaller { $CONFIG->wwwroot = $this->getBaseUrl(); $CONFIG->url = $CONFIG->wwwroot; $CONFIG->path = dirname(dirname(__FILE__)) . '/'; - $CONFIG->lastcache = 0; + $CONFIG->viewpath = $CONFIG->path . 'views/'; + $CONFIG->pluginspath = $CONFIG->path . 'mod/'; $CONFIG->context = array(); + $CONFIG->entity_types = array('group', 'object', 'site', 'user'); } /** @@ -1328,6 +1337,21 @@ class ElggInstaller { } } + // check that data root is absolute path + if (stripos(PHP_OS, 'win') === 0) { + if (strpos($submissionVars['dataroot'], ':') !== 1) { + $msg = elgg_echo('install:error:relative_path', array($submissionVars['dataroot'])); + register_error($msg); + return FALSE; + } + } else { + if (strpos($submissionVars['dataroot'], '/') !== 0) { + $msg = elgg_echo('install:error:relative_path', array($submissionVars['dataroot'])); + register_error($msg); + return FALSE; + } + } + // check that data root exists if (!file_exists($submissionVars['dataroot'])) { $msg = elgg_echo('install:error:datadirectoryexists', array($submissionVars['dataroot'])); @@ -1380,11 +1404,11 @@ class ElggInstaller { $submissionVars['wwwroot'] = sanitise_filepath($submissionVars['wwwroot']); $site = new ElggSite(); - $site->name = $submissionVars['sitename']; - $site->url = $submissionVars['wwwroot']; + $site->name = $submissionVars['sitename']; + $site->url = $submissionVars['wwwroot']; $site->access_id = ACCESS_PUBLIC; - $site->email = $submissionVars['siteemail']; - $guid = $site->save(); + $site->email = $submissionVars['siteemail']; + $guid = $site->save(); if (!$guid) { register_error(elgg_echo('install:error:createsite')); @@ -1401,7 +1425,7 @@ class ElggInstaller { datalist_set('default_site', $site->getGUID()); datalist_set('version', get_version()); datalist_set('simplecache_enabled', 1); - datalist_set('viewpath_cache_enabled', 1); + datalist_set('system_cache_enabled', 1); // new installations have run all the upgrades $upgrades = elgg_get_upgrade_files($submissionVars['path'] . 'engine/lib/upgrades/'); @@ -1416,12 +1440,6 @@ class ElggInstaller { $this->enablePlugins(); - // reset the views path in case of installing over an old data dir. - $dataroot = $submissionVars['dataroot']; - $CONFIG->dataroot = $dataroot; - $cache = new ElggFileCache($dataroot); - $cache->delete('view_paths'); - return TRUE; } diff --git a/install/languages/en.php b/install/languages/en.php index bbcd72d20..3a692e020 100644 --- a/install/languages/en.php +++ b/install/languages/en.php @@ -15,6 +15,9 @@ $english = array( 'install:admin' => 'Create admin account', 'install:complete' => 'Finished', + 'install:next' => 'Next', + 'install:refresh' => 'Refresh', + 'install:welcome:instructions' => "Installing Elgg has 6 simple steps and reading this welcome is the first one! If you haven't already, read through the installation instructions included with Elgg (or click the instructions link at the bottom of the page). @@ -85,7 +88,7 @@ If you are ready to proceed, click the Next button.", 'install:settings:help:siteemail' => 'Email address used by Elgg for communication with users', 'install:settings:help:wwwroot' => 'The address of the site (Elgg usually guesses this correctly)', 'install:settings:help:path' => 'The directory where you put the Elgg code (Elgg usually guesses this correctly)', - 'install:settings:help:dataroot' => 'The directory that you created for Elgg to save files (the permissions on this directory are checked when you click Next)', + 'install:settings:help:dataroot' => 'The directory that you created for Elgg to save files (the permissions on this directory are checked when you click Next). It must be an absolute path.', 'install:settings:help:dataroot:apache' => 'You have the option of Elgg creating the data directory or entering the directory that you already created for storing user files (the permissions on this directory are checked when you click Next)', 'install:settings:help:language' => 'The default language for the site', 'install:settings:help:siteaccess' => 'The default access level for new user created content', @@ -128,6 +131,7 @@ If you are ready to proceed, click the Next button.", 'install:error:readsettingsphp' => 'Unable to read engine/settings.example.php', 'install:error:writesettingphp' => 'Unable to write engine/settings.php', 'install:error:requiredfield' => '%s is required', + 'install:error:relative_path' => 'We don\'t think "%s" is an absoluate path for your data directory', 'install:error:datadirectoryexists' => 'Your data directory %s does not exist.', 'install:error:writedatadirectory' => 'Your data directory %s is not writable by the web server.', 'install:error:locationdatadirectory' => 'Your data directory %s must be outside of your install path for security.', -- cgit v1.2.3