Version 5.0.0 beta 4

This commit is contained in:
Neo committed 2025-12-19 16:57:00 -08:00
1 parent e86153356a
commit 2f24f9de48
276 files changed
+8614 -6044

No files matched your search

@@ -46,14 +46,14 @@ class Woltlab extends Software
/**
* @brief The WCF table prefix can change depending on the number of installs
*/
public static $installId = 1;
public static int $installId = 1;
/**
* Software Name
*
* @return string
*/
public static function softwareName()
public static function softwareName(): string
{
/* Child classes must override this method */
return "WoltLab Suite (3.1)";
@@ -64,7 +64,7 @@ class Woltlab extends Software
*
* @return string
*/
public static function softwareKey()
public static function softwareKey(): string
{
/* Child classes must override this method */
return "woltlab";
@@ -73,9 +73,9 @@ class Woltlab extends Software
/**
* Content we can convert from this software.
*
* @return array
* @return array|null
*/
public static function canConvert()
public static function canConvert(): ?array
{
return array(
'convertProfileFieldGroups' => array(
@@ -116,13 +116,13 @@ class Woltlab extends Software
/**
* Count Source Rows for a specific step
*
* @param string $table The table containing the rows to count.
* @param array|NULL $where WHERE clause to only count specific rows, or NULL to count all.
* @param bool $recache Skip cache and pull directly (updating cache)
* @return integer
* @param string $table The table containing the rows to count.
* @param string|array|NULL $where WHERE clause to only count specific rows, or NULL to count all.
* @param bool $recache Skip cache and pull directly (updating cache)
* @return integer
* @throws Exception
*/
public function countRows( $table, $where=NULL, $recache=FALSE )
public function countRows( string $table, string|array|null $where=NULL, bool $recache=FALSE ): int
{
switch( $table )
{
@@ -136,20 +136,18 @@ class Woltlab extends Software
{
throw new Exception( sprintf( Member::loggedIn()->language()->get( 'could_not_count_rows' ), $table ) );
}
break;
default:
return parent::countRows( $table, $where, $recache );
break;
}
}
/**
* Can we convert passwords from this software.
*
* @return boolean
* @return boolean
*/
public static function loginEnabled()
public static function loginEnabled(): bool
{
return TRUE;
}
@@ -157,9 +155,9 @@ class Woltlab extends Software
/**
* List of conversion methods that require additional information
*
* @return array
* @return array
*/
public static function checkConf()
public static function checkConf(): array
{
return array(
'convertProfileFieldGroups',
@@ -173,10 +171,10 @@ class Woltlab extends Software
/**
* Get More Information
*
* @param string $method Conversion method
* @return array
* @param string $method Conversion method
* @return array|null
*/
public function getMoreInfo( $method )
public function getMoreInfo( string $method ): ?array
{
$return = array();
switch( $method )
@@ -329,9 +327,9 @@ class Woltlab extends Software
/**
* Finish - Adds everything it needs to the queues and clears data store
*
* @return array Messages to display
* @return array Messages to display
*/
public function finish()
public function finish(): array
{
/* Search Index Rebuild */
Index::i()->rebuild();
@@ -362,9 +360,9 @@ class Woltlab extends Software
/**
* Pre-process content for the Invision Community text parser
*
* @param string The post
* @param string|null Content Classname passed by post-conversion rebuild
* @param int|null Content ID passed by post-conversion rebuild
* @param string $post post
* @param string|null $className Classname passed by post-conversion rebuild
* @param int|null $contentId ID passed by post-conversion rebuild
* @return string The converted post
*/
public static function fixPostData( string $post, ?string $className=null, ?int $contentId=null ): string
@@ -377,7 +375,7 @@ class Woltlab extends Software
*
* @return void
*/
public function convertProfileFieldGroups()
public function convertProfileFieldGroups() : void
{
$libraryClass = $this->getLibrary();
$libraryClass::setKey( 'categoryID' );
@@ -403,7 +401,7 @@ class Woltlab extends Software
*
* @return void
*/
public function convertProfileFields()
public function convertProfileFields() : void
{
$libraryClass = $this->getLibrary();
$libraryClass::setKey( 'optionID' );
@@ -476,7 +474,7 @@ class Woltlab extends Software
*
* @return void
*/
public function convertEmoticons()
public function convertEmoticons() : void
{
$libraryClass = $this->getLibrary();
$libraryClass::setKey( 'smileyID' );
@@ -515,7 +513,7 @@ class Woltlab extends Software
'emo_position' => $row['showOrder'],
);
$libraryClass->convertEmoticon( $info, $set, $this->app->_session['more_info']['convertEmoticons']['keep_existing_emoticons'], $filepath, NULL, $filepathx2, NULL );
$libraryClass->convertEmoticon( $info, $set, $this->app->_session['more_info']['convertEmoticons']['keep_existing_emoticons'], $filepath, NULL, $filepathx2 );
$libraryClass->setLastKeyValue( $row['smileyID'] );
}
}
@@ -525,7 +523,7 @@ class Woltlab extends Software
*
* @return void
*/
public function convertGroups()
public function convertGroups() : void
{
$libraryClass = $this->getLibrary();
$libraryClass::setKey( 'groupID' );
@@ -534,8 +532,8 @@ class Woltlab extends Software
{
/* Username Styles */
$style = explode( '%s', $row['userOnlineMarking'] );
$prefix = isset( $style[0] ) ? $style[0] : '';
$suffix = isset( $style[1] ) ? $style[1] : '';
$prefix = $style[0] ?? '';
$suffix = $style[1] ?? '';
$info = array(
'g_id' => $row['groupID'],
@@ -565,7 +563,7 @@ class Woltlab extends Software
*
* @return void
*/
public function convertMembers()
public function convertMembers() : void
{
$libraryClass = $this->getLibrary();
$libraryClass::setKey( 'userID' );
@@ -717,7 +715,7 @@ class Woltlab extends Software
*
* @return void
*/
public function convertIgnoredUsers()
public function convertIgnoredUsers() : void
{
$libraryClass = $this->getLibrary();
$libraryClass::setKey( 'ignoreID' );
@@ -742,7 +740,7 @@ class Woltlab extends Software
*
* @return void
*/
public function convertPrivateMessages()
public function convertPrivateMessages() : void
{
$libraryClass = $this->getLibrary();
$libraryClass::setKey( 'conversationID' );
@@ -789,7 +787,7 @@ class Woltlab extends Software
*
* @return void
*/
public function convertPrivateMessageReplies()
public function convertPrivateMessageReplies() : void
{
$libraryClass = $this->getLibrary();
$libraryClass::setKey( 'messageID' );
@@ -812,13 +810,13 @@ class Woltlab extends Software
/**
* @brief Cache default language
*/
static $_defaultLanguage = NULL;
static ?int $_defaultLanguage = NULL;
/**
* Helper to fetch a WCF lang string
*
* @param string $itemName WCF Language Name
* @param string $itemPrefix WCF Prefix for end-user input
* @param string|null $itemPrefix WCF Prefix for end-user input
* @return string Translated string, or original if no customisation exists
* @throws UnderflowException
*/
@@ -852,7 +850,7 @@ class Woltlab extends Software
* @param string $password Password from form
* @return bool
*/
public static function login( $member, $password )
public static function login( Member $member, string $password ) : bool
{
/* If it's not blowfish, then we don't have a salt for it. fail. */
if( preg_match( '/^\$2[ay]\$(0[4-9]|[1-2][0-9]|3[0-1])\$[a-zA-Z0-9.\/]{53}/', $member->conv_password ) )