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

@@ -43,19 +43,19 @@ class Vbulletin extends Software
/**
* @brief The schematic for vB3 and vB4 is similar enough that we can make specific concessions in a single converter for either version.
*/
protected static $isLegacy = NULL;
protected static ?bool $isLegacy = NULL;
/**
* @brief Cached article content type
*/
protected static $_articleContentType = NULL;
protected static mixed $_articleContentType = NULL;
/**
* Software Name
*
* @return string
* @return string
*/
public static function softwareName()
public static function softwareName(): string
{
/* Child classes must override this method */
return "vBulletin CMS (4.x only)";
@@ -64,9 +64,9 @@ class Vbulletin extends Software
/**
* Software Key
*
* @return string
* @return string
*/
public static function softwareKey()
public static function softwareKey(): string
{
/* Child classes must override this method */
return "vbulletin";
@@ -80,9 +80,9 @@ class Vbulletin 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 );
/* Is this vB3 or vB4? */
try
@@ -113,19 +113,16 @@ class Vbulletin extends Software
}
catch( \Exception $e ) {}
return $return;
}
/**
* Content we can convert from this software.
*
* @return array
* @return array|null
*/
public static function canConvert()
public static function canConvert(): ?array
{
$return = array(
return array(
'convertCmsBlocks' => array(
'table' => 'cms_widget',
'where' => NULL,
@@ -151,20 +148,18 @@ class Vbulletin extends Software
'where' => array( "contenttypeid=?", static::$_articleContentType )
)
);
return $return;
}
/**
* 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 \IPS\convert\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 )
{
@@ -182,24 +177,22 @@ class Vbulletin extends Software
{
throw new \IPS\convert\Exception( sprintf( Member::loggedIn()->language()->get( 'could_not_count_rows' ), $table ) );
}
break;
case 'page':
case 'database':
return 1;
break;
default:
return parent::countRows( $table, $where, $recache );
break;
}
}
/**
* Requires Parent
*
* @return boolean
* @return boolean
*/
public static function requiresParent()
public static function requiresParent(): bool
{
return TRUE;
}
@@ -207,9 +200,9 @@ class Vbulletin extends Software
/**
* Possible Parent Conversions
*
* @return array
* @return array|null
*/
public static function parents()
public static function parents(): ?array
{
return array( 'core' => array( 'vbulletin' ) );
}
@@ -217,9 +210,9 @@ class Vbulletin 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
@@ -233,7 +226,7 @@ class Vbulletin extends Software
* @param string $key The setting key
* @return mixed
*/
protected function _setting( $key )
protected function _setting( string $key ) : mixed
{
if ( isset( $this->settingsCache[$key] ) )
{
@@ -267,7 +260,7 @@ class Vbulletin extends Software
*
* @return void
*/
public function convertCmsBlocks()
public function convertCmsBlocks() : void
{
$libraryClass = $this->getLibrary();
@@ -326,7 +319,7 @@ class Vbulletin extends Software
*
* @return void
*/
public function convertCmsPages()
public function convertCmsPages() : void
{
$this->getLibrary()->convertCmsPage( array(
'page_id' => 1,
@@ -341,7 +334,7 @@ class Vbulletin extends Software
*
* @return void
*/
public function convertCmsDatabases()
public function convertCmsDatabases() : void
{
$convertedForums = FALSE;
try
@@ -402,7 +395,7 @@ class Vbulletin extends Software
*
* @return void
*/
public function convertCmsDatabaseCategories()
public function convertCmsDatabaseCategories() : void
{
$libraryClass = $this->getLibrary();
@@ -428,7 +421,7 @@ class Vbulletin extends Software
*
* @return void
*/
public function convertCmsDatabaseRecords()
public function convertCmsDatabaseRecords() : void
{
$libraryClass = $this->getLibrary();
$libraryClass::setKey( 'contentid' );
@@ -584,9 +577,9 @@ class Vbulletin 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
{
foreach( Db::i()->select( 'ipb_id', 'convert_link', array( 'type=? AND app=?', 'cms_databases', $this->app->app_id ) ) as $database )
{
@@ -609,7 +602,7 @@ class Vbulletin extends Software
*
* @return void
*/
public function convertAttachments()
public function convertAttachments() : void
{
$libraryClass = $this->getLibrary();
@@ -712,9 +705,9 @@ class Vbulletin 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( 'convertAttachments' );
}
@@ -722,10 +715,10 @@ class Vbulletin 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 )