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

@@ -17,7 +17,7 @@ use DomainException;
use Exception;
use IPS\convert\App;
use IPS\convert\Software;
use IPS\convert\Software\Core\Vbulletin5;
use IPS\convert\Software\Core\Vbulletin5 as Vbulletin5Core;
use IPS\Db;
use IPS\forums\Topic;
use IPS\forums\Topic\Post;
@@ -135,7 +135,6 @@ class Vbulletin5 extends Software
{
case 'forum':
return count( $this->fetchForums() );
break;
case 'thread':
try
@@ -146,7 +145,6 @@ class Vbulletin5 extends Software
{
throw new \IPS\convert\Exception( sprintf( Member::loggedIn()->language()->get( 'could_not_count_rows' ), $table ) );
}
break;
case 'post':
try
@@ -157,15 +155,12 @@ class Vbulletin5 extends Software
{
throw new \IPS\convert\Exception( sprintf( Member::loggedIn()->language()->get( 'could_not_count_rows' ), $table ) );
}
break;
case 'attachment':
return parent::countRows( 'node', array( "contenttypeid IN (" . $this->fetchType( 'Attach' ) . ',' . $this->fetchType( 'Photo' ) . ")" ) );
break;
default:
return parent::countRows( $table, $where, $recache );
break;
}
}
@@ -213,14 +208,14 @@ class Vbulletin5 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 Vbulletin5::fixPostData( $post, $className, $contentId );
return Vbulletin5Core::fixPostData( $post, $className, $contentId );
}
/**
@@ -297,7 +292,7 @@ class Vbulletin5 extends Software
*
* @return void
*/
public function convertForumsForums()
public function convertForumsForums() : void
{
$libraryClass = $this->getLibrary();
@@ -325,7 +320,7 @@ class Vbulletin5 extends Software
$key = 'nodeoptions';
}
if ( $forum[$key] & $self::$bitOptions[$name][$perm] )
if ( $forum[$key] & static::$bitOptions[$name][$perm] )
{
return TRUE;
}
@@ -362,7 +357,7 @@ class Vbulletin5 extends Software
*
* @return void
*/
public function convertForumsTopics()
public function convertForumsTopics() : void
{
$libraryClass = $this->getLibrary();
@@ -441,8 +436,7 @@ class Vbulletin5 extends Software
);
}
}
catch( UnderflowException $e ) {} # if the poll is missing, don't bother
catch( UnexpectedValueException $e ) {} # if poll data is corrupt, then skip
catch( UnderflowException|UnexpectedValueException $e ) {} # if the poll is missing, don't bother # if poll data is corrupt, then skip
$info = array(
'tid' => $topic['nodeid'],
@@ -517,7 +511,7 @@ class Vbulletin5 extends Software
*
* @return void
*/
public function convertForumsPosts()
public function convertForumsPosts() : void
{
$libraryClass = $this->getLibrary();
@@ -741,7 +735,7 @@ LINK;
*
* @return void
*/
public function convertAttachments()
public function convertAttachments() : void
{
$libraryClass = $this->getLibrary();
@@ -891,7 +885,7 @@ LINK;
*
* @return void
*/
public function convertAttachments2()
public function convertAttachments2() : void
{
$libraryClass = $this->getLibrary();
@@ -1020,7 +1014,7 @@ LINK;
*
* @return array
*/
protected function fetchForums()
protected function fetchForums() : array
{
$forums = array();
$clubs = $this->fetchClubs();
@@ -1037,7 +1031,7 @@ LINK;
*
* @return array
*/
protected function fetchClubs()
protected function fetchClubs() : array
{
$clubs = array();
@@ -1066,29 +1060,25 @@ LINK;
/**
* @brief Types Cache
*/
protected $typesCache = array();
protected array $typesCache = array();
/**
* Helper method to retrieve content type ids
*
* @param int|string $type The content type
* @return void
* @return array
*/
protected function fetchType( $type )
protected function fetchType( int|string $type ) : array
{
if ( count( $this->typesCache ) )
{
return $this->typesCache[ $type ];
}
else
if ( !count( $this->typesCache ) )
{
foreach( $this->db->select( '*', 'contenttype' ) AS $contenttype )
{
$this->typesCache[ $contenttype['class'] ] = $contenttype['contenttypeid'];
}
return $this->typesCache[ $type ];
}
return $this->typesCache[ $type ];
}
/**