Version 5.0.0 beta 7

This commit is contained in:
Neo committed 2025-12-19 17:18:38 -08:00
1 parent fa2a720105
commit 54d5dcd0a0
156 files changed
+4337 -2995

No files matched your search

@@ -19,7 +19,7 @@ use InvalidArgumentException;
use IPS\Content;
use IPS\convert\App;
use IPS\convert\Software;
use IPS\convert\Software\Core\Xenforo;
use IPS\convert\Software\Core\Xenforo as XenforoCore;
use IPS\Db;
use IPS\Http\Url;
use IPS\Member;
@@ -51,7 +51,7 @@ class Xenforo extends Software
/**
* @brief The similarities between XF1 and XF2 are close enough that we can use the same converter
*/
public static $isLegacy = NULL;
public static ?bool $isLegacy = NULL;
/**
* @brief Flag to indicate the post data has been fixed during conversion, and we only need to use Legacy Parser
@@ -61,7 +61,7 @@ class Xenforo extends Software
/**
* @brief XF2.1 changed serialized data to json decoded
*/
public static $useJson = FALSE;
public static bool $useJson = FALSE;
/**
* Constructor
@@ -71,9 +71,9 @@ class Xenforo extends Software
* @return void
* @throws InvalidArgumentException
*/
public function __construct( App $app, $needDB=TRUE )
public function __construct( App $app, bool $needDB=TRUE )
{
$return = parent::__construct( $app, $needDB );
parent::__construct( $app, $needDB );
if ( $needDB )
{
@@ -104,8 +104,6 @@ class Xenforo extends Software
}
catch( Exception $e ) {} # If we can't query, we won't be able to do anything anyway
}
return $return;
}
/**
@@ -275,14 +273,14 @@ class Xenforo 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 The post
* @param string|null $className Content Classname passed by post-conversion rebuild
* @param int|null $contentId Content ID passed by post-conversion rebuild
* @return string The converted post
*/
public static function fixPostData( string $post, ?string $className=null, ?int $contentId=null ): string
{
return Xenforo::fixPostData( $post, $className, $contentId );
return XenforoCore::fixPostData( $post, $className, $contentId );
}
/**
@@ -292,7 +290,7 @@ class Xenforo extends Software
* @param string $xfTwoTitle XF2 Phrase Title
* @return string|null
*/
protected function getPhrase( $xfOneTitle, $xfTwoTitle )
protected function getPhrase( string $xfOneTitle, string $xfTwoTitle ) : ?string
{
try
{
@@ -310,7 +308,7 @@ class Xenforo extends Software
*
* @return void
*/
public function convertForumsForums()
public function convertForumsForums() : void
{
$libraryClass = $this->getLibrary();
@@ -384,7 +382,7 @@ class Xenforo extends Software
*
* @return void
*/
public function convertForumsTopics()
public function convertForumsTopics() : void
{
$libraryClass = $this->getLibrary();
$libraryClass::setKey( 'thread_id' );
@@ -494,7 +492,7 @@ class Xenforo extends Software
'last_poster_name' => $row['last_post_username'],
'poll_state' => $poll,
'views' => $row['view_count'],
'approved' => $approved,
'approved' => $approved ?? 0,
'pinned' => $row['sticky'],
'moved_to' => $moved_to,
);
@@ -571,7 +569,7 @@ class Xenforo extends Software
*
* @return void
*/
public function convertForumsPosts()
public function convertForumsPosts() : void
{
$libraryClass = $this->getLibrary();
@@ -628,7 +626,7 @@ class Xenforo extends Software
'author_name' => $row['username'],
'ip_address' => $row['ip'] ?? '127.0.0.1',
'post_date' => $row['post_date'],
'queued' => $queued,
'queued' => $queued ?? 0,
);
$libraryClass->convertForumsPost( $info );
@@ -726,7 +724,7 @@ class Xenforo extends Software
*
* @return void
*/
public function convertAttachments()
public function convertAttachments() : void
{
$libraryClass = $this->getLibrary();
$libraryClass::setKey( 'xf_attachment.attachment_id' );
@@ -786,9 +784,8 @@ class Xenforo extends Software
}
}
}
catch( UnderflowException $e ) {}
catch( OutOfRangeException $e ) {}
catch( UnderflowException|OutOfRangeException $e ) {}
$libraryClass->setLastKeyValue( $row['attachment_id'] );
}
}