Upgrade - shish/shimmie2 GitHub Wiki
Get the new code
From Git
If you got shimmie from git
, then git pull
should fetch the latest code
(git checkout main
then git pull
if you're on an old non-main branch).
Once the new Shimmie code is ready, you'll need to make sure all the
dependencies are in place and up-to-date via composer install
.
From .zip
If you got shimmie from one of the .zip downloads, you'll need to download
new code, extract it, then copy across the data
folder from the old install
into the new one.
Update database schema
This should be automatic - next time the site is loaded, it'll see that the current schema is out of date, and will update it.
Check for any breaking changes
Release notes on https://github.com/shish/shimmie2/releases should include notes on any major changes
Upcoming breaking changes in 2.12
- Dropped features
- No more support for PHP 8.1
- Removed the half-implemented Hellban system - it didn't work reliably, and it made other things worse - if anybody really wants this, feel free to open a feature request
- Configuration
- User permissions are more easily configurable, in particular a database-based class system is available (as an extension)
SPEED_HAX
system config is removed; the various things it enabled are now "advanced" Board Config settingsSTATSD_HOST
system config is removed, statsd is configured with regular Board Config settings- Avatar support is no longer built-in to
User
, we now have multiple avatar providers to choose from- "Gravatar" is the provider used in all versions of Shimmie so far, if you just want to carry on like before, enable this extension
- Instead, or in addition, there is now an extension to set cropped parts of posts as avatars
- Both can be enabled at the same time -- if the user has a post avatar, that'll be shown; else if they have an email address configured, a gravatar will be shown; else the avatar slot will be empty
- CAPTCHA support is now added with extensions (eg, the ReCaptcha extension). If a captcha extension is enabled, then captchas will be added around the site, and specific user classes can skip them based on class permissions.
- Theme development
- Theme classes should now have a
const KEY = "extension_id";
to connect them to the extension with the same ID - The
Page $page
parameter has been dropped from a bunch of theme functions - themes should now consistently use theCtx::$page
global - Lots of places switched from string-concatenation to MicroHTML. If you have custom themes, they may need updating - the quick and dirty way is to wrap your HTML strings in
\MicroHTML\rawHTML(...)
- Theme overrides changed from
CustomFooTheme
toMyThemeFooTheme
(eg the danbooru2 override forFooTheme
isDanbooru2FooTheme
) - Common elements (thumbnail, paginator) moved from
Themelet
toCommonElementsTheme
, which can be overridden in the normal way, withMyThemeCommonElementsTheme
- Each theme's custom
Page
should now be namedMyThemePage
and inherit fromPage
- Theme classes should now have a
- Extension Development
- global variables deprecated in favour of a Context class - for quick compatibility, replace eg
global $database;
with$database = Ctx::$database
- Total overhaul of the Board Config / User Config pages
- Settings should now all be defined in
config.php
files for each extension $config->get_{int|string|...}()
functions replaced with a single$config->get()
whose type depends on which config variable is being fetched
- Settings should now all be defined in
- Major overhaul of the Permission system
- Permissions should now be defined in
permissions.php
files for each extension - The old gigantic
Permissions
class got broken into many pieces, egPermissions::CREATE_COMMENT
is nowCommentPermission::CREATE_COMMENT
- Permission IDs (the strings used to uniquely identify a permission) are mostly unchanged
- (Work in progress)
UserClass
es andPermission
s are stored in the database rather than inuser-classes.conf.php
- Permissions should now be defined in
- Removed
global $user_config;
andUserConfig::get_for_user($id);
-- use$user->get_config();
instead - Removed
SCORE_LOG_*
constants in favour of theShimmie2\LogLevel
enum Extension
/ExtensionInfo
/ etc classes are now grouped byconst KEY = "extension_id";
instead of by class name$page->set_redirect($url)
now impliesmode=REDIRECT
;$page->set_data(...)
impliesmode=DATA
, etc - no need to manually call$page->set_mode(...)
unless you're doing something weird
- global variables deprecated in favour of a Context class - for quick compatibility, replace eg
- Core development
- Total re-organisation of files in
core/
- One file per PHP class - it's not quite PSR-4 (the whole app is a single namespace spread across many folders), but it's going in that direction
- Various random unorganised functions got put into classes, eg
is_bot()
becameNetwork::is_bot()
,log_error()
becameLog::error()
- Folders in 2.12 mostly map to files in 2.11 - eg the one giant "search.php" is now several medium-sized files in a "search" folder
- Test classes live next to their tested classes
- Load balancing algorithm changed from
Flexihash
(because that library hasn't been updated in years, and isn't php8.4 compatible) to Weighted Rendezvous Hashing (Which is much simpler, better at balancing, and almost as fast)
- Total re-organisation of files in